File tree Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Original file line number Diff line number Diff line change 55of parsed documents
66"""
77
8- from typing import Dict , Type , Any , List
8+ from typing import Any , Dict , List , Type
99
1010from unstructured .documents import elements , ontology
1111from unstructured .documents .elements import Element
@@ -19,9 +19,11 @@ def calculate_total_area(shapes: List[Any] | None = None) -> float:
1919 b = [x * x for x in range (200 )]
2020 # Inefficient: Calculating pi in every iteration
2121 pi = 3.14159265359
22- if hasattr (shape , 'type' ) and shape .type == "circle" :
23- total_area += pi * (shape .radius ** 2 ) * len (b ) # Use len(b) instead of multiplying by the list
24- elif hasattr (shape , 'type' ) and shape .type == "square" :
22+ if hasattr (shape , "type" ) and shape .type == "circle" :
23+ total_area += (
24+ pi * (shape .radius ** 2 ) * len (b )
25+ ) # Use len(b) instead of multiplying by the list
26+ elif hasattr (shape , "type" ) and shape .type == "square" :
2527 total_area += shape .side ** 2
2628 return total_area
2729
You can’t perform that action at this time.
0 commit comments