@@ -72,7 +72,6 @@ def consensus_name_attr(objs):
72
72
73
73
74
74
def maybe_box (indexer , values , obj , key ):
75
-
76
75
# if we have multiples coming back, box em
77
76
if isinstance (values , np .ndarray ):
78
77
return obj [indexer .get_loc (key )]
@@ -84,13 +83,13 @@ def maybe_box(indexer, values, obj, key):
84
83
def maybe_box_datetimelike (value ):
85
84
# turn a datetime like into a Timestamp/timedelta as needed
86
85
87
- if isinstance (value , (np .datetime64 , datetime )) \
88
- and not isinstance (value , tslibs .Timestamp ) \
89
- and notnull (value ):
86
+ if isinstance (value , (np .datetime64 , datetime )) and (
87
+ not isinstance (value , tslibs .Timestamp )) and (
88
+ notnull (value ) ):
90
89
value = tslibs .Timestamp (value )
91
- elif isinstance (value , (np .timedelta64 , timedelta )) \
92
- and not isinstance (value , tslibs .Timedelta ) \
93
- and notnull (value ):
90
+ elif isinstance (value , (np .timedelta64 , timedelta )) and (
91
+ not isinstance (value , tslibs .Timedelta )) and (
92
+ notnull (value ) ):
94
93
value = tslibs .Timedelta (value )
95
94
96
95
return value
@@ -123,7 +122,7 @@ def is_bool_indexer(key: Any) -> bool:
123
122
"""
124
123
na_msg = "cannot index with vector containing NA / NaN values"
125
124
if isinstance (key , (ABCSeries , np .ndarray , ABCIndex )) or (
126
- is_array_like (key ) and is_extension_array_dtype (key .dtype )
125
+ is_array_like (key ) and is_extension_array_dtype (key .dtype )
127
126
):
128
127
if key .dtype == np .object_ :
129
128
key = np .asarray (values_from_object (key ))
@@ -219,7 +218,6 @@ def try_sort(iterable):
219
218
220
219
221
220
def asarray_tuplesafe (values , dtype = None ):
222
-
223
221
if not (isinstance (values , (list , tuple )) or hasattr (values , "__array__" )):
224
222
values = list (values )
225
223
elif isinstance (values , ABCIndexClass ):
@@ -288,10 +286,10 @@ def is_null_slice(obj):
288
286
We have a null slice.
289
287
"""
290
288
return (
291
- isinstance (obj , slice )
292
- and obj .start is None
293
- and obj .stop is None
294
- and obj .step is None
289
+ isinstance (obj , slice )
290
+ and obj .start is None
291
+ and obj .stop is None
292
+ and obj .step is None
295
293
)
296
294
297
295
@@ -308,7 +306,7 @@ def is_full_slice(obj, l):
308
306
We have a full length slice.
309
307
"""
310
308
return (
311
- isinstance (obj , slice ) and obj .start == 0 and obj .stop == l and obj .step is None
309
+ isinstance (obj , slice ) and obj .start == 0 and obj .stop == l and obj .step is None
312
310
)
313
311
314
312
0 commit comments