28
28
29
29
def set_function_name (f , name , cls ):
30
30
"""
31
- Bind the name/qualname attributes of the function
31
+ Bind the name/qualname attributes of the function.
32
32
"""
33
33
f .__name__ = name
34
34
f .__qualname__ = "{klass}.{name}" .format (klass = cls .__name__ , name = name )
@@ -38,28 +38,72 @@ def set_function_name(f, name, cls):
38
38
39
39
# https://github.com/pandas-dev/pandas/pull/9123
40
40
def is_platform_little_endian ():
41
- """ am I little endian """
41
+ """
42
+ Checking if the running platform is little endian.
43
+
44
+ Returns
45
+ -------
46
+ bool
47
+ True if the running platform is little endian.
48
+ """
42
49
return sys .byteorder == "little"
43
50
44
51
45
52
def is_platform_windows ():
53
+ """
54
+ Checking if the running platform is windows.
55
+
56
+ Returns
57
+ -------
58
+ bool
59
+ True if the running platform is windows.
60
+ """
46
61
return sys .platform == "win32" or sys .platform == "cygwin"
47
62
48
63
49
64
def is_platform_linux ():
65
+ """
66
+ Checking if the running platform is linux.
67
+
68
+ Returns
69
+ -------
70
+ bool
71
+ True if the running platform is linux.
72
+ """
50
73
return sys .platform == "linux2"
51
74
52
75
53
76
def is_platform_mac ():
77
+ """
78
+ Checking if the running platform is mac.
79
+
80
+ Returns
81
+ -------
82
+ bool
83
+ True if the running platform is mac.
84
+ """
54
85
return sys .platform == "darwin"
55
86
56
87
57
88
def is_platform_32bit ():
89
+ """
90
+ Checking if the running platform is 32-bit.
91
+
92
+ Returns
93
+ -------
94
+ bool
95
+ True if the running platform is 32-bit.
96
+ """
58
97
return struct .calcsize ("P" ) * 8 < 64
59
98
60
99
61
100
def _import_lzma ():
62
- """Attempts to import lzma, warning the user when lzma is not available.
101
+ """
102
+ Attempts to import the lzma module.
103
+
104
+ Warns
105
+ -----
106
+ When the lzma module is not available.
63
107
"""
64
108
try :
65
109
import lzma
@@ -75,8 +119,18 @@ def _import_lzma():
75
119
76
120
77
121
def _get_lzma_file (lzma ):
78
- """Returns the lzma method LZMAFile when the module was correctly imported.
79
- Otherwise, raises a RuntimeError.
122
+ """
123
+ Attempting to get the lzma.LZMAFile class.
124
+
125
+ Returns
126
+ -------
127
+ class
128
+ The lzma.LZMAFile class.
129
+
130
+ Raises
131
+ ------
132
+ RuntimeError
133
+ If the module lzma was not imported correctly, or didn't exist.
80
134
"""
81
135
if lzma is None :
82
136
raise RuntimeError (
0 commit comments