@@ -20,7 +20,9 @@ class Sources(str, enum.Enum):
2020
2121
2222@V2 .get ("/latest" , response_model = LatestResponse )
23- async def get_latest (request : Request , source : Sources = "jhu" ): # pylint: disable=unused-argument
23+ async def get_latest (
24+ request : Request , source : Sources = "jhu"
25+ ): # pylint: disable=unused-argument
2426 """
2527 Getting latest amount of total confirmed cases, deaths, and recoveries.
2628 """
@@ -35,7 +37,9 @@ async def get_latest(request: Request, source: Sources = "jhu"): # pylint: disa
3537
3638
3739# pylint: disable=unused-argument,too-many-arguments,redefined-builtin
38- @V2 .get ("/locations" , response_model = LocationsResponse , response_model_exclude_unset = True )
40+ @V2 .get (
41+ "/locations" , response_model = LocationsResponse , response_model_exclude_unset = True
42+ )
3943async def get_locations (
4044 request : Request ,
4145 source : Sources = "jhu" ,
@@ -65,11 +69,18 @@ async def get_locations(
6569
6670 # Do filtering.
6771 try :
68- locations = [location for location in locations if str (getattr (location , key )).lower () == str (value )]
72+ locations = [
73+ location
74+ for location in locations
75+ if str (getattr (location , key )).lower () == str (value )
76+ ]
6977 except AttributeError :
7078 pass
7179 if not locations :
72- raise HTTPException (404 , detail = f"Source `{ source } ` does not have the desired location data." )
80+ raise HTTPException (
81+ 404 ,
82+ detail = f"Source `{ source } ` does not have the desired location data." ,
83+ )
7384
7485 # Return final serialized data.
7586 return {
@@ -84,7 +95,9 @@ async def get_locations(
8495
8596# pylint: disable=invalid-name
8697@V2 .get ("/locations/{id}" , response_model = LocationResponse )
87- async def get_location_by_id (request : Request , id : int , source : Sources = "jhu" , timelines : bool = True ):
98+ async def get_location_by_id (
99+ request : Request , id : int , source : Sources = "jhu" , timelines : bool = True
100+ ):
88101 """
89102 Getting specific location by id.
90103 """
0 commit comments