Code Duplication    Length = 11-11 lines in 2 locations

injectify/inspect_mate.py 2 locations

@@ 185-195 (lines=11) @@
182
    return pairs
183
184
185
def get_all_methods(klass):
186
    """Get all method members (regular, static, class method)."""
187
    if not inspect.isclass(klass):
188
        raise ValueError
189
190
    pairs = list()
191
    for attr, value in inspect.getmembers(
192
            klass, lambda x: inspect.isroutine(x)):
193
        if not (attr.startswith('__') or attr.endswith('__')):
194
            pairs.append((attr, value))
195
    return pairs
196
197
198
def extract_wrapped(decorated):
@@ 172-182 (lines=11) @@
169
get_class_methods.__doc__ = 'Get all class method attributes members.'
170
171
172
def get_all_attributes(klass):
173
    """Get all attribute members (attribute, property style method)."""
174
    if not inspect.isclass(klass):
175
        raise ValueError
176
177
    pairs = list()
178
    for attr, value in inspect.getmembers(
179
            klass, lambda x: not inspect.isroutine(x)):
180
        if not (attr.startswith('__') or attr.endswith('__')):
181
            pairs.append((attr, value))
182
    return pairs
183
184
185
def get_all_methods(klass):