@@ -55,7 +55,7 @@ def get_values(series, jurisdiction, year, documentType=1, summary=True,
5555 return
5656
5757 # If multiple jurisdiction names are given, find list of IDs
58- if jurisdiction . isinstance (type ) and re .search (
58+ if isinstance (jurisdiction , list ) and re .search (
5959 r'[A-Za-z]' , str (jurisdiction [0 ])):
6060 jurisdiction = [list_jurisdictions ()[i ] for i in jurisdiction ]
6161 # If jurisdiction name is passed, find ID
@@ -94,7 +94,7 @@ def get_values(series, jurisdiction, year, documentType=1, summary=True,
9494 return
9595
9696 # If multiple series are given, parses the list into a string
97- if series . isinstance (list ):
97+ if isinstance (series , list ):
9898 url_call += f'series={ "," .join (str (i ) for i in series )} '
9999 elif type (series ) in [int , str ]:
100100 url_call += f'series={ series } '
@@ -106,7 +106,7 @@ def get_values(series, jurisdiction, year, documentType=1, summary=True,
106106 return
107107
108108 # If multiple jurisdiction IDs are given, parses the list into a string
109- if jurisdiction . isinstance (list ):
109+ if isinstance (jurisdiction , list ):
110110 url_call += f'&jurisdiction={ "," .join (str (i ) for i in jurisdiction )} '
111111 # If jurisdiction is just an ID, use jurisdiction
112112 elif type (jurisdiction ) in [int , str ]:
@@ -119,13 +119,13 @@ def get_values(series, jurisdiction, year, documentType=1, summary=True,
119119 return
120120
121121 # If multiple agencies are given, parses the list into a string
122- if agency . isinstance (list ):
122+ if isinstance (agency , list ):
123123 url_call += f'&agency={ "," .join (str (i ) for i in agency )} '
124124 elif agency :
125125 url_call += f'&agency={ agency } '
126126
127127 # If multiple clusters are given, parses the list into a string
128- if cluster . isinstance (list ):
128+ if isinstance (cluster , list ):
129129 url_call += f'&cluster={ "," .join (str (i ) for i in cluster )} '
130130 elif cluster :
131131 url_call += f'&cluster={ cluster } '
@@ -138,7 +138,7 @@ def get_values(series, jurisdiction, year, documentType=1, summary=True,
138138 print ('WARNING: industryLevel is deprecated; use labellevel' )
139139 labellevel = industryLevel
140140 # If multiple industries are given, parses the list into a string
141- if label . isinstance (list ):
141+ if isinstance (label , list ):
142142 if labelsource == 'NAICS' :
143143 label = [list_industries (labellevel = labellevel ,
144144 labelsource = labelsource ,
@@ -155,7 +155,7 @@ def get_values(series, jurisdiction, year, documentType=1, summary=True,
155155 url_call += f'&labelLevel={ labellevel } '
156156
157157 # If multiple years are given, parses the list into a string
158- if not summary and year . isinstance (list ):
158+ if not summary and isinstance (year , list ):
159159 print (
160160 'WARNING: document-level data is only returnable for a single '
161161 'year at a time. Returning the first year requested.'
@@ -168,7 +168,7 @@ def get_values(series, jurisdiction, year, documentType=1, summary=True,
168168 'for 2019 and before is not compatible with years 2020-2023. '
169169 'These data will be compatible in version 6.0.'
170170 )
171- if year . isinstance (list ):
171+ if isinstance (year , list ):
172172 # If dateIsRange, parses the list to include all years
173173 if dateIsRange and len (year ) == 2 :
174174 year = range (int (year [0 ]), int (year [1 ]) + 1 )
@@ -240,7 +240,7 @@ def get_values(series, jurisdiction, year, documentType=1, summary=True,
240240
241241 # If download path is given, write csv instead of returning dataframe
242242 if download :
243- if download . isinstance (str ):
243+ if isinstance (download , str ):
244244 clean_columns (output ).to_csv (download , index = False )
245245 else :
246246 print ("Valid outpath required to download." )
@@ -255,7 +255,7 @@ def get_document_values(*args, **kwargs):
255255
256256 Simply returns get_values() with summary=False
257257 """
258- if kwargs ["year" ]. isinstance ( list ):
258+ if isinstance ( kwargs ["year" ], list ):
259259 print_error ({"message" : "Only single year can be passed." })
260260 return
261261 return get_values (* args , ** kwargs , summary = False )
@@ -304,9 +304,9 @@ def get_endpoint(series, jurisdiction, year, documentType, summary=True):
304304
305305 Returns the endpoint, e.g. '/state-summary' for summary-level state data
306306 """
307- if year . isinstance (list ):
307+ if isinstance (year , list ):
308308 year = [int (y ) for y in year ]
309- if series . isinstance (list ):
309+ if isinstance (series , list ):
310310 series = [int (s ) for s in series ]
311311 try :
312312 datafinder = get_datafinder (jurisdiction , documentType ).query (
@@ -514,7 +514,7 @@ def list_agencies(jurisdictionID=None, keyword=None, reverse=False, verbose=0):
514514 """
515515 # Removes duplicate agency names (uses only most recent)
516516 df = get_agencies (jurisdictionID , keyword , verbose )
517- if df . isinstance (type (None )):
517+ if isinstance (df , type (None )):
518518 return
519519 df = df .sort_values (
520520 'agency_id' , ascending = False ).drop_duplicates (
0 commit comments