Coverage for /pythoncovmergedfiles/medio/medio/usr/local/lib/python3.9/dist-packages/pandas/util/__init__.py: 42%

Shortcuts on this page

r m x   toggle line displays

j k   next/prev highlighted chunk

0   (zero) top of page

1   (one) first highlighted chunk

19 statements  

1def __getattr__(key: str): 

2 # These imports need to be lazy to avoid circular import errors 

3 if key == "hash_array": 

4 from pandas.core.util.hashing import hash_array 

5 

6 return hash_array 

7 if key == "hash_pandas_object": 

8 from pandas.core.util.hashing import hash_pandas_object 

9 

10 return hash_pandas_object 

11 if key == "Appender": 

12 from pandas.util._decorators import Appender 

13 

14 return Appender 

15 if key == "Substitution": 

16 from pandas.util._decorators import Substitution 

17 

18 return Substitution 

19 

20 if key == "cache_readonly": 

21 from pandas.util._decorators import cache_readonly 

22 

23 return cache_readonly 

24 

25 raise AttributeError(f"module 'pandas.util' has no attribute '{key}'") 

26 

27 

28def capitalize_first_letter(s): 

29 return s[:1].upper() + s[1:]