Input:
CODE <module>()
  RESUME 0
  LOAD_CONST <code setup>
  MAKE_FUNCTION 0
  STORE_NAME setup
  RETURN_CONST None
END
CODE setup(app)
  DOC 'pass'
  RESUME 0
  LOAD_CONST 0
  LOAD_CONST None
  IMPORT_NAME sphinxcontrib_django.docstrings
  STORE_FAST sphinxcontrib_django
  LOAD_CONST 0
  LOAD_CONST None
  IMPORT_NAME sphinxcontrib_django.roles
  STORE_FAST sphinxcontrib_django
  LOAD_FAST sphinxcontrib_django
  LOAD_ATTR docstrings
  LOAD_ATTR NULL|self + setup
  LOAD_FAST app
  CALL 1
  POP_TOP
  LOAD_FAST sphinxcontrib_django
  LOAD_ATTR roles
  LOAD_ATTR NULL|self + setup
  LOAD_FAST app
  CALL 1
  POP_TOP
  RETURN_CONST None
END

def setup(app):
    """pass"""
    import sphinxcontrib_django.docstrings
    import sphinxcontrib_django.roles
    sphinxcontrib_django.docstrings.setup(app)
    sphinxcontrib_django.roles.setup(app)


Input:
CODE <module>()
  RESUME 0
  LOAD_CONST <code patch_django_for_autodoc>
  MAKE_FUNCTION 0
  STORE_NAME patch_django_for_autodoc
  RETURN_CONST None
END
CODE patch_django_for_autodoc()
  DOC 'pass'
  RESUME 0
  LOAD_CONST <code patch_django_for_autodoc.<locals>.<lambda>>
  MAKE_FUNCTION 0
  LOAD_GLOBAL ManagerDescriptor
  STORE_ATTR __get__
  LOAD_CONST <code patch_django_for_autodoc.<locals>.<lambda>>
  MAKE_FUNCTION 0
  LOAD_GLOBAL models
  LOAD_ATTR QuerySet
  STORE_ATTR __repr__
  RETURN_CONST None
END
CODE patch_django_for_autodoc.<locals>.<lambda>(self, *args, **kwargs)
  RESUME 0
  LOAD_FAST self
  LOAD_ATTR manager
  RETURN_VALUE
END
CODE patch_django_for_autodoc.<locals>.<lambda>(self)
  RESUME 0
  LOAD_FAST self
  LOAD_ATTR __class__
  LOAD_ATTR __name__
  RETURN_VALUE
END

def patch_django_for_autodoc():
    """pass"""
    ManagerDescriptor.__get__ = lambda self, *args, **kwargs: self.manager
    models.QuerySet.__repr__ = lambda self: self.__class__.__name__

code-search-net/code_search_net (python, train split)


Input:
CODE <module>()
  RESUME 0
  LOAD_CONST <code setup>
  MAKE_FUNCTION 0
  STORE_NAME setup
  RETURN_CONST None
END
CODE setup(app)
  DOC 'pass'
  RESUME 0
  LOAD_CONST 1
  LOAD_CONST ('patch_django_for_autodoc',)
  IMPORT_NAME patches
  IMPORT_FROM patch_django_for_autodoc
  STORE_FAST patch_django_for_autodoc
  POP_TOP
  PUSH_NULL
  LOAD_FAST patch_django_for_autodoc
  CALL 0
  POP_TOP
  LOAD_FAST app
  LOAD_ATTR NULL|self + connect
  LOAD_CONST 'autodoc-process-docstring'
  LOAD_GLOBAL improve_model_docstring
  CALL 2
  POP_TOP
  LOAD_FAST app
  LOAD_ATTR NULL|self + connect
  LOAD_CONST 'autodoc-skip-member'
  LOAD_GLOBAL autodoc_skip
  CALL 2
  POP_TOP
  RETURN_CONST None
END

def setup(app):
    """pass"""
    from .patches import patch_django_for_autodoc
    patch_django_for_autodoc()
    app.connect('autodoc-process-docstring', improve_model_docstring)
    app.connect('autodoc-skip-member', autodoc_skip)


Input:
CODE <module>()
  RESUME 0
  LOAD_CONST <code autodoc_skip>
  MAKE_FUNCTION 0
  STORE_NAME autodoc_skip
  RETURN_CONST None
END
CODE autodoc_skip(app, what, name, obj, skip, options)
  DOC 'pass'
  RESUME 0
  LOAD_FAST name
  LOAD_GLOBAL config
  LOAD_ATTR EXCLUDE_MEMBERS
  CONTAINS_OP 0
  POP_JUMP_IF_FALSE L1
  RETURN_CONST True
L1:
  LOAD_FAST name
  LOAD_GLOBAL config
  LOAD_ATTR INCLUDE_MEMBERS
  CONTAINS_OP 0
  POP_JUMP_IF_FALSE L2
  RETURN_CONST False
L2:
  LOAD_FAST skip
  RETURN_VALUE
END

def autodoc_skip(app, what, name, obj, skip, options):
    """pass"""
    if name in config.EXCLUDE_MEMBERS:
        return True
    if name in config.INCLUDE_MEMBERS:
        return False
    return skip


Input:
CODE <module>()
  RESUME 0
  LOAD_CONST <code improve_model_docstring>
  MAKE_FUNCTION 0
  STORE_NAME improve_model_docstring
  RETURN_CONST None
END
CODE improve_model_docstring(app, what, name, obj, options, lines)
  DOC 'pass'
  RESUME 0
  LOAD_FAST what
  LOAD_CONST 'class'
  COMPARE_OP ==
  POP_JUMP_IF_FALSE L1
  LOAD_GLOBAL NULL + _improve_class_docs
  LOAD_FAST app
  LOAD_FAST obj
  LOAD_FAST lines
  CALL 3
  POP_TOP
  LOAD_FAST lines
  RETURN_VALUE
L1:
  LOAD_FAST what
  LOAD_CONST 'attribute'
  COMPARE_OP ==
  POP_JUMP_IF_FALSE L2
  LOAD_GLOBAL NULL + _improve_attribute_docs
  LOAD_FAST obj
  LOAD_FAST name
  LOAD_FAST lines
  CALL 3
  POP_TOP
  LOAD_FAST lines
  RETURN_VALUE
L2:
  LOAD_FAST what
  LOAD_CONST 'method'
  COMPARE_OP ==
  POP_JUMP_IF_FALSE L3
  LOAD_GLOBAL NULL + _improve_method_docs
  LOAD_FAST obj
  LOAD_FAST name
  LOAD_FAST lines
  CALL 3
  POP_TOP
L3:
  LOAD_FAST lines
  RETURN_VALUE
END

def improve_model_docstring(app, what, name, obj, options, lines):
    """pass"""
    if what == 'class':
        _improve_class_docs(app, obj, lines)
    elif what == 'attribute':
        _improve_attribute_docs(obj, name, lines)
    elif what == 'method':
        _improve_method_docs(obj, name, lines)
    return lines


Input:
CODE <module>()
  RESUME 0
  LOAD_CONST <code _improve_class_docs>
  MAKE_FUNCTION 0
  STORE_NAME _improve_class_docs
  RETURN_CONST None
END
CODE _improve_class_docs(app, cls, lines)
  DOC 'pass'
  RESUME 0
  LOAD_GLOBAL NULL + issubclass
  LOAD_FAST cls
  LOAD_GLOBAL models
  LOAD_ATTR Model
  CALL 2
  POP_JUMP_IF_FALSE L1
  LOAD_GLOBAL NULL + _add_model_fields_as_params
  LOAD_FAST app
  LOAD_FAST cls
  LOAD_FAST lines
  CALL 3
  POP_TOP
  RETURN_CONST None
L1:
  LOAD_GLOBAL NULL + issubclass
  LOAD_FAST cls
  LOAD_GLOBAL forms
  LOAD_ATTR Form
  CALL 2
  POP_JUMP_IF_FALSE L2
  LOAD_GLOBAL NULL + _add_form_fields
  LOAD_FAST cls
  LOAD_FAST lines
  CALL 2
  POP_TOP
  RETURN_CONST None
L2:
  RETURN_CONST None
END

def _improve_class_docs(app, cls, lines):
    """pass"""
    if issubclass(cls, models.Model):
        _add_model_fields_as_params(app, cls, lines)
    elif issubclass(cls, forms.Form):
        _add_form_fields(cls, lines)


Input:
CODE <module>()
  DOC 'return'
  RESUME 0
  LOAD_CONST 'return'
  LOAD_NAME List
  LOAD_NAME str
  BINARY_SUBSCR
  BUILD_TUPLE 2
  LOAD_CONST <code attr_names>
  MAKE_FUNCTION annotations
  STORE_NAME attr_names
  RETURN_CONST None
END
CODE attr_names(cls)
  DOC 'pass'
  RESUME 0
  LOAD_FAST cls
  LOAD_ATTR NULL|self + attr_types
  CALL 0
  LOAD_ATTR NULL|self + items
  CALL 0
  GET_ITER
  LOAD_FAST_AND_CLEAR k
  LOAD_FAST_AND_CLEAR v
  SWAP 3
L1:
  BUILD_LIST 0
  SWAP 2
L2:
  FOR_ITER L3
  UNPACK_SEQUENCE 2
  STORE_FAST k
  STORE_FAST v
  LOAD_FAST k
  LIST_APPEND 2
  JUMP_BACKWARD L2
L3:
  END_FOR
L4:
  SWAP 3
  STORE_FAST v
  STORE_FAST k
  RETURN_VALUE
L5:
  SWAP 2
  POP_TOP
  SWAP 3
  STORE_FAST v
  STORE_FAST k
  RERAISE 0
  EXC try=L1..L4 -> handler=L5 depth=3 lasti=False
END

def attr_names(cls) -> List[str]:
    """pass"""
    return [k for k, v in cls.attr_types().items()]


Input:
CODE <module>()
  RESUME 0
  LOAD_CONST (10, False)
  LOAD_CONST <code elliptic_fourier_descriptors>
  MAKE_FUNCTION defaults
  STORE_NAME elliptic_fourier_descriptors
  RETURN_CONST None
END
CODE elliptic_fourier_descriptors(contour, order, normalize)
  DOC 'pass'
  RESUME 0
  LOAD_GLOBAL np
  LOAD_ATTR NULL|self + diff
  LOAD_FAST contour
  LOAD_CONST 0
  KW_NAMES ('axis',)
  CALL 2
  STORE_FAST dxy
  LOAD_GLOBAL np
  LOAD_ATTR NULL|self + sqrt
  LOAD_FAST dxy
  LOAD_CONST 2
  BINARY_OP **
  LOAD_ATTR NULL|self + sum
  LOAD_CONST 1
  KW_NAMES ('axis',)
  CALL 1
  CALL 1
  STORE_FAST dt
  LOAD_GLOBAL np
  LOAD_ATTR NULL|self + concatenate
  LOAD_CONST 0.0
  BUILD_LIST 1
  LOAD_GLOBAL np
  LOAD_ATTR NULL|self + cumsum
  LOAD_FAST dt
  CALL 1
  BUILD_LIST 2
  CALL 1
  STORE_FAST t
  LOAD_FAST t
  LOAD_CONST -1
  BINARY_SUBSCR
  STORE_FAST T
  LOAD_CONST 2
  LOAD_GLOBAL np
  LOAD_ATTR pi
  BINARY_OP *
  LOAD_FAST t
  BINARY_OP *
  LOAD_FAST T
  BINARY_OP /
  STORE_FAST phi
  LOAD_GLOBAL np
  LOAD_ATTR NULL|self + zeros
  LOAD_FAST order
  LOAD_CONST 4
  BUILD_TUPLE 2
  CALL 1
  STORE_FAST coeffs
  LOAD_GLOBAL NULL + _range
  LOAD_CONST 1
  LOAD_FAST order
  LOAD_CONST 1
  BINARY_OP +
  CALL 2
  GET_ITER
L1:
  EXTENDED_ARG 1
  FOR_ITER L2
  STORE_FAST n
  LOAD_FAST T
  LOAD_CONST 2
  LOAD_FAST n
  BINARY_OP *
  LOAD_FAST n
  BINARY_OP *
  LOAD_GLOBAL np
  LOAD_ATTR pi
  BINARY_OP *
  LOAD_GLOBAL np
  LOAD_ATTR pi
  BINARY_OP *
  BINARY_OP /
  STORE_FAST const
  LOAD_FAST phi
  LOAD_FAST n
  BINARY_OP *
  STORE_FAST phi_n
  LOAD_GLOBAL np
  LOAD_ATTR NULL|self + cos
  LOAD_FAST phi_n
  LOAD_CONST 1
  LOAD_CONST None
  BINARY_SLICE
  CALL 1
  LOAD_GLOBAL np
  LOAD_ATTR NULL|self + cos
  LOAD_FAST phi_n
  LOAD_CONST None
  LOAD_CONST -1
  BINARY_SLICE
  CALL 1
  BINARY_OP -
  STORE_FAST d_cos_phi_n
  LOAD_GLOBAL np
  LOAD_ATTR NULL|self + sin
  LOAD_FAST phi_n
  LOAD_CONST 1
  LOAD_CONST None
  BINARY_SLICE
  CALL 1
  LOAD_GLOBAL np
  LOAD_ATTR NULL|self + sin
  LOAD_FAST phi_n
  LOAD_CONST None
  LOAD_CONST -1
  BINARY_SLICE
  CALL 1
  BINARY_OP -
  STORE_FAST d_sin_phi_n
  LOAD_FAST const
  LOAD_GLOBAL np
  LOAD_ATTR NULL|self + sum
  LOAD_FAST dxy
  LOAD_CONST None
  LOAD_CONST None
  BUILD_SLICE 2
  LOAD_CONST 0
  BUILD_TUPLE 2
  BINARY_SUBSCR
  LOAD_FAST dt
  BINARY_OP /
  LOAD_FAST d_cos_phi_n
  BINARY_OP *
  CALL 1
  BINARY_OP *
  STORE_FAST a_n
  LOAD_FAST const
  LOAD_GLOBAL np
  LOAD_ATTR NULL|self + sum
  LOAD_FAST dxy
  LOAD_CONST None
  LOAD_CONST None
  BUILD_SLICE 2
  LOAD_CONST 0
  BUILD_TUPLE 2
  BINARY_SUBSCR
  LOAD_FAST dt
  BINARY_OP /
  LOAD_FAST d_sin_phi_n
  BINARY_OP *
  CALL 1
  BINARY_OP *
  STORE_FAST b_n
  LOAD_FAST const
  LOAD_GLOBAL np
  LOAD_ATTR NULL|self + sum
  LOAD_FAST dxy
  LOAD_CONST None
  LOAD_CONST None
  BUILD_SLICE 2
  LOAD_CONST 1
  BUILD_TUPLE 2
  BINARY_SUBSCR
  LOAD_FAST dt
  BINARY_OP /
  LOAD_FAST d_cos_phi_n
  BINARY_OP *
  CALL 1
  BINARY_OP *
  STORE_FAST c_n
  LOAD_FAST const
  LOAD_GLOBAL np
  LOAD_ATTR NULL|self + sum
  LOAD_FAST dxy
  LOAD_CONST None
  LOAD_CONST None
  BUILD_SLICE 2
  LOAD_CONST 1
  BUILD_TUPLE 2
  BINARY_SUBSCR
  LOAD_FAST dt
  BINARY_OP /
  LOAD_FAST d_sin_phi_n
  BINARY_OP *
  CALL 1
  BINARY_OP *
  STORE_FAST d_n
  LOAD_FAST a_n
  LOAD_FAST b_n
  LOAD_FAST c_n
  LOAD_FAST d_n
  BUILD_TUPLE 4
  LOAD_FAST coeffs
  LOAD_FAST n
  LOAD_CONST 1
  BINARY_OP -
  LOAD_CONST None
  LOAD_CONST None
  BUILD_SLICE 2
  BUILD_TUPLE 2
  STORE_SUBSCR
  EXTENDED_ARG 1
  JUMP_BACKWARD L1
L2:
  END_FOR
  LOAD_FAST normalize
  POP_JUMP_IF_FALSE L3
  LOAD_GLOBAL NULL + normalize_efd
  LOAD_FAST coeffs
  CALL 1
  STORE_FAST coeffs
L3:
  LOAD_FAST coeffs
  RETURN_VALUE
END

def elliptic_fourier_descriptors(contour, order=10, normalize=False):
    """pass"""
    dxy = np.diff(contour, axis=0)
    dt = np.sqrt((dxy ** 2).sum(axis=1))
    t = np.concatenate([[0.0], np.cumsum(dt)])
    T = t[-1]
    phi = 2 * np.pi * t / T
    coeffs = np.zeros((order, 4))
    for n in _range(1, order + 1):
        const = T / (2 * n * n * np.pi * np.pi)
        phi_n = phi * n
        d_cos_phi_n = np.cos(phi_n[1:]) - np.cos(phi_n[:-1])
        d_sin_phi_n = np.sin(phi_n[1:]) - np.sin(phi_n[:-1])
        a_n = const * np.sum(dxy[:, 0] / dt * d_cos_phi_n)
        b_n = const * np.sum(dxy[:, 0] / dt * d_sin_phi_n)
        c_n = const * np.sum(dxy[:, 1] / dt * d_cos_phi_n)
        d_n = const * np.sum(dxy[:, 1] / dt * d_sin_phi_n)
        coeffs[n - 1, :] = (a_n, b_n, c_n, d_n)
    if normalize:
        coeffs = normalize_efd(coeffs)
    return coeffs


Input:
CODE <module>()
  RESUME 0
  LOAD_CONST (True,)
  LOAD_CONST <code normalize_efd>
  MAKE_FUNCTION defaults
  STORE_NAME normalize_efd
  RETURN_CONST None
END
CODE normalize_efd(coeffs, size_invariant)
  DOC 'pass'
  RESUME 0
  LOAD_CONST 0.5
  LOAD_GLOBAL np
  LOAD_ATTR NULL|self + arctan2
  LOAD_CONST 2
  LOAD_FAST coeffs
  LOAD_CONST (0, 0)
  BINARY_SUBSCR
  LOAD_FAST coeffs
  LOAD_CONST (0, 1)
  BINARY_SUBSCR
  BINARY_OP *
  LOAD_FAST coeffs
  LOAD_CONST (0, 2)
  BINARY_SUBSCR
  LOAD_FAST coeffs
  LOAD_CONST (0, 3)
  BINARY_SUBSCR
  BINARY_OP *
  BINARY_OP +
  BINARY_OP *
  LOAD_FAST coeffs
  LOAD_CONST (0, 0)
  BINARY_SUBSCR
  LOAD_CONST 2
  BINARY_OP **
  LOAD_FAST coeffs
  LOAD_CONST (0, 1)
  BINARY_SUBSCR
  LOAD_CONST 2
  BINARY_OP **
  BINARY_OP -
  LOAD_FAST coeffs
  LOAD_CONST (0, 2)
  BINARY_SUBSCR
  LOAD_CONST 2
  BINARY_OP **
  BINARY_OP +
  LOAD_FAST coeffs
  LOAD_CONST (0, 3)
  BINARY_SUBSCR
  LOAD_CONST 2
  BINARY_OP **
  BINARY_OP -
  CALL 2
  BINARY_OP *
  STORE_FAST theta_1
  LOAD_GLOBAL NULL + _range
  LOAD_CONST 1
  LOAD_FAST coeffs
  LOAD_ATTR shape
  LOAD_CONST 0
  BINARY_SUBSCR
  LOAD_CONST 1
  BINARY_OP +
  CALL 2
  GET_ITER
L1:
  FOR_ITER L2
  STORE_FAST n
  LOAD_GLOBAL np
  LOAD_ATTR NULL|self + dot
  LOAD_GLOBAL np
  LOAD_ATTR NULL|self + array
  LOAD_FAST coeffs
  LOAD_FAST n
  LOAD_CONST 1
  BINARY_OP -
  LOAD_CONST 0
  BUILD_TUPLE 2
  BINARY_SUBSCR
  LOAD_FAST coeffs
  LOAD_FAST n
  LOAD_CONST 1
  BINARY_OP -
  LOAD_CONST 1
  BUILD_TUPLE 2
  BINARY_SUBSCR
  BUILD_LIST 2
  LOAD_FAST coeffs
  LOAD_FAST n
  LOAD_CONST 1
  BINARY_OP -
  LOAD_CONST 2
  BUILD_TUPLE 2
  BINARY_SUBSCR
  LOAD_FAST coeffs
  LOAD_FAST n
  LOAD_CONST 1
  BINARY_OP -
  LOAD_CONST 3
  BUILD_TUPLE 2
  BINARY_SUBSCR
  BUILD_LIST 2
  BUILD_LIST 2
  CALL 1
  LOAD_GLOBAL np
  LOAD_ATTR NULL|self + array
  LOAD_GLOBAL np
  LOAD_ATTR NULL|self + cos
  LOAD_FAST n
  LOAD_FAST theta_1
  BINARY_OP *
  CALL 1
  LOAD_GLOBAL np
  LOAD_ATTR NULL|self + sin
  LOAD_FAST n
  LOAD_FAST theta_1
  BINARY_OP *
  CALL 1
  UNARY_NEGATIVE
  BUILD_LIST 2
  LOAD_GLOBAL np
  LOAD_ATTR NULL|self + sin
  LOAD_FAST n
  LOAD_FAST theta_1
  BINARY_OP *
  CALL 1
  LOAD_GLOBAL np
  LOAD_ATTR NULL|self + cos
  LOAD_FAST n
  LOAD_FAST theta_1
  BINARY_OP *
  CALL 1
  BUILD_LIST 2
  BUILD_LIST 2
  CALL 1
  CALL 2
  LOAD_ATTR NULL|self + flatten
  CALL 0
  LOAD_FAST coeffs
  LOAD_FAST n
  LOAD_CONST 1
  BINARY_OP -
  LOAD_CONST None
  LOAD_CONST None
  BUILD_SLICE 2
  BUILD_TUPLE 2
  STORE_SUBSCR
  JUMP_BACKWARD L1
L2:
  END_FOR
  LOAD_GLOBAL np
  LOAD_ATTR NULL|self + arctan2
  LOAD_FAST coeffs
  LOAD_CONST (0, 2)
  BINARY_SUBSCR
  LOAD_FAST coeffs
  LOAD_CONST (0, 0)
  BINARY_SUBSCR
  CALL 2
  STORE_FAST psi_1
  LOAD_GLOBAL np
  LOAD_ATTR NULL|self + array
  LOAD_GLOBAL np
  LOAD_ATTR NULL|self + cos
  LOAD_FAST psi_1
  CALL 1
  LOAD_GLOBAL np
  LOAD_ATTR NULL|self + sin
  LOAD_FAST psi_1
  CALL 1
  BUILD_LIST 2
  LOAD_GLOBAL np
  LOAD_ATTR NULL|self + sin
  LOAD_FAST psi_1
  CALL 1
  UNARY_NEGATIVE
  LOAD_GLOBAL np
  LOAD_ATTR NULL|self + cos
  LOAD_FAST psi_1
  CALL 1
  BUILD_LIST 2
  BUILD_LIST 2
  CALL 1
  STORE_FAST psi_rotation_matrix
  LOAD_GLOBAL NULL + _range
  LOAD_CONST 1
  LOAD_FAST coeffs
  LOAD_ATTR shape
  LOAD_CONST 0
  BINARY_SUBSCR
  LOAD_CONST 1
  BINARY_OP +
  CALL 2
  GET_ITER
L3:
  FOR_ITER L4
  STORE_FAST n
  LOAD_FAST psi_rotation_matrix
  LOAD_ATTR NULL|self + dot
  LOAD_GLOBAL np
  LOAD_ATTR NULL|self + array
  LOAD_FAST coeffs
  LOAD_FAST n
  LOAD_CONST 1
  BINARY_OP -
  LOAD_CONST 0
  BUILD_TUPLE 2
  BINARY_SUBSCR
  LOAD_FAST coeffs
  LOAD_FAST n
  LOAD_CONST 1
  BINARY_OP -
  LOAD_CONST 1
  BUILD_TUPLE 2
  BINARY_SUBSCR
  BUILD_LIST 2
  LOAD_FAST coeffs
  LOAD_FAST n
  LOAD_CONST 1
  BINARY_OP -
  LOAD_CONST 2
  BUILD_TUPLE 2
  BINARY_SUBSCR
  LOAD_FAST coeffs
  LOAD_FAST n
  LOAD_CONST 1
  BINARY_OP -
  LOAD_CONST 3
  BUILD_TUPLE 2
  BINARY_SUBSCR
  BUILD_LIST 2
  BUILD_LIST 2
  CALL 1
  CALL 1
  LOAD_ATTR NULL|self + flatten
  CALL 0
  LOAD_FAST coeffs
  LOAD_FAST n
  LOAD_CONST 1
  BINARY_OP -
  LOAD_CONST None
  LOAD_CONST None
  BUILD_SLICE 2
  BUILD_TUPLE 2
  STORE_SUBSCR
  JUMP_BACKWARD L3
L4:
  END_FOR
  LOAD_FAST size_invariant
  POP_JUMP_IF_FALSE L5
  LOAD_FAST coeffs
  LOAD_GLOBAL np
  LOAD_ATTR NULL|self + abs
  LOAD_FAST coeffs
  LOAD_CONST (0, 0)
  BINARY_SUBSCR
  CALL 1
  BINARY_OP /=
  STORE_FAST coeffs
L5:
  LOAD_FAST coeffs
  RETURN_VALUE
END

def normalize_efd(coeffs, size_invariant=True):
    """pass"""
    theta_1 = 0.5 * np.arctan2(2 * (coeffs[0, 0] * coeffs[0, 1] + coeffs[0, 2] * coeffs[0, 3]), coeffs[0, 0] ** 2 - coeffs[0, 1] ** 2 + coeffs[0, 2] ** 2 - coeffs[0, 3] ** 2)
    for n in _range(1, coeffs.shape[0] + 1):
        coeffs[n - 1, :] = np.dot(np.array([[coeffs[n - 1, 0], coeffs[n - 1, 1]], [coeffs[n - 1, 2], coeffs[n - 1, 3]]]), np.array([[np.cos(n * theta_1), -np.sin(n * theta_1)], [np.sin(n * theta_1), np.cos(n * theta_1)]])).flatten()
    psi_1 = np.arctan2(coeffs[0, 2], coeffs[0, 0])
    psi_rotation_matrix = np.array([[np.cos(psi_1), np.sin(psi_1)], [-np.sin(psi_1), np.cos(psi_1)]])
    for n in _range(1, coeffs.shape[0] + 1):
        coeffs[n - 1, :] = psi_rotation_matrix.dot(np.array([[coeffs[n - 1, 0], coeffs[n - 1, 1]], [coeffs[n - 1, 2], coeffs[n - 1, 3]]])).flatten()
    if size_invariant:
        coeffs /= np.abs(coeffs[0, 0])
    return coeffs


Input:
CODE <module>()
  RESUME 0
  LOAD_CONST <code calculate_dc_coefficients>
  MAKE_FUNCTION 0
  STORE_NAME calculate_dc_coefficients
  RETURN_CONST None
END
CODE calculate_dc_coefficients(contour)
  DOC 'pass'
  RESUME 0
  LOAD_GLOBAL np
  LOAD_ATTR NULL|self + diff
  LOAD_FAST contour
  LOAD_CONST 0
  KW_NAMES ('axis',)
  CALL 2
  STORE_FAST dxy
  LOAD_GLOBAL np
  LOAD_ATTR NULL|self + sqrt
  LOAD_FAST dxy
  LOAD_CONST 2
  BINARY_OP **
  LOAD_ATTR NULL|self + sum
  LOAD_CONST 1
  KW_NAMES ('axis',)
  CALL 1
  CALL 1
  STORE_FAST dt
  LOAD_GLOBAL np
  LOAD_ATTR NULL|self + concatenate
  LOAD_CONST 0.0
  BUILD_LIST 1
  LOAD_GLOBAL np
  LOAD_ATTR NULL|self + cumsum
  LOAD_FAST dt
  CALL 1
  BUILD_LIST 2
  CALL 1
  STORE_FAST t
  LOAD_FAST t
  LOAD_CONST -1
  BINARY_SUBSCR
  STORE_FAST T
  LOAD_GLOBAL np
  LOAD_ATTR NULL|self + cumsum
  LOAD_FAST dxy
  LOAD_CONST None
  LOAD_CONST None
  BUILD_SLICE 2
  LOAD_CONST 0
  BUILD_TUPLE 2
  BINARY_SUBSCR
  CALL 1
  LOAD_FAST dxy
  LOAD_CONST None
  LOAD_CONST None
  BUILD_SLICE 2
  LOAD_CONST 0
  BUILD_TUPLE 2
  BINARY_SUBSCR
  LOAD_FAST dt
  BINARY_OP /
  LOAD_FAST t
  LOAD_CONST 1
  LOAD_CONST None
  BINARY_SLICE
  BINARY_OP *
  BINARY_OP -
  STORE_FAST xi
  LOAD_CONST 1
  LOAD_FAST T
  BINARY_OP /
  LOAD_GLOBAL np
  LOAD_ATTR NULL|self + sum
  LOAD_FAST dxy
  LOAD_CONST None
  LOAD_CONST None
  BUILD_SLICE 2
  LOAD_CONST 0
  BUILD_TUPLE 2
  BINARY_SUBSCR
  LOAD_CONST 2
  LOAD_FAST dt
  BINARY_OP *
  BINARY_OP /
  LOAD_GLOBAL np
  LOAD_ATTR NULL|self + diff
  LOAD_FAST t
  LOAD_CONST 2
  BINARY_OP **
  CALL 1
  BINARY_OP *
  LOAD_FAST xi
  LOAD_FAST dt
  BINARY_OP *
  BINARY_OP +
  CALL 1
  BINARY_OP *
  STORE_FAST A0
  LOAD_GLOBAL np
  LOAD_ATTR NULL|self + cumsum
  LOAD_FAST dxy
  LOAD_CONST None
  LOAD_CONST None
  BUILD_SLICE 2
  LOAD_CONST 1
  BUILD_TUPLE 2
  BINARY_SUBSCR
  CALL 1
  LOAD_FAST dxy
  LOAD_CONST None
  LOAD_CONST None
  BUILD_SLICE 2
  LOAD_CONST 1
  BUILD_TUPLE 2
  BINARY_SUBSCR
  LOAD_FAST dt
  BINARY_OP /
  LOAD_FAST t
  LOAD_CONST 1
  LOAD_CONST None
  BINARY_SLICE
  BINARY_OP *
  BINARY_OP -
  STORE_FAST delta
  LOAD_CONST 1
  LOAD_FAST T
  BINARY_OP /
  LOAD_GLOBAL np
  LOAD_ATTR NULL|self + sum
  LOAD_FAST dxy
  LOAD_CONST None
  LOAD_CONST None
  BUILD_SLICE 2
  LOAD_CONST 1
  BUILD_TUPLE 2
  BINARY_SUBSCR
  LOAD_CONST 2
  LOAD_FAST dt
  BINARY_OP *
  BINARY_OP /
  LOAD_GLOBAL np
  LOAD_ATTR NULL|self + diff
  LOAD_FAST t
  LOAD_CONST 2
  BINARY_OP **
  CALL 1
  BINARY_OP *
  LOAD_FAST delta
  LOAD_FAST dt
  BINARY_OP *
  BINARY_OP +
  CALL 1
  BINARY_OP *
  STORE_FAST C0
  LOAD_FAST contour
  LOAD_CONST (0, 0)
  BINARY_SUBSCR
  LOAD_FAST A0
  BINARY_OP +
  LOAD_FAST contour
  LOAD_CONST (0, 1)
  BINARY_SUBSCR
  LOAD_FAST C0
  BINARY_OP +
  BUILD_TUPLE 2
  RETURN_VALUE
END

def calculate_dc_coefficients(contour):
    """pass"""
    dxy = np.diff(contour, axis=0)
    dt = np.sqrt((dxy ** 2).sum(axis=1))
    t = np.concatenate([[0.0], np.cumsum(dt)])
    T = t[-1]
    xi = np.cumsum(dxy[:, 0]) - dxy[:, 0] / dt * t[1:]
    A0 = 1 / T * np.sum(dxy[:, 0] / (2 * dt) * np.diff(t ** 2) + xi * dt)
    delta = np.cumsum(dxy[:, 1]) - dxy[:, 1] / dt * t[1:]
    C0 = 1 / T * np.sum(dxy[:, 1] / (2 * dt) * np.diff(t ** 2) + delta * dt)
    return (contour[0, 0] + A0, contour[0, 1] + C0)


Input:
CODE <module>()
  RESUME 0
  LOAD_CONST ((0.0, 0.0), None, None, 300)
  LOAD_CONST <code plot_efd>
  MAKE_FUNCTION defaults
  STORE_NAME plot_efd
  RETURN_CONST None
END
CODE plot_efd(coeffs, locus, image, contour, n)
  DOC 'pass'
  RESUME 0
  NOP
L1:
  LOAD_CONST 0
  LOAD_CONST None
  IMPORT_NAME matplotlib.pyplot
  IMPORT_FROM pyplot
  STORE_FAST plt
  POP_TOP
L2:
  LOAD_FAST coeffs
  LOAD_ATTR shape
  LOAD_CONST 0
  BINARY_SUBSCR
  STORE_FAST N
  LOAD_GLOBAL NULL + int
  LOAD_GLOBAL np
  LOAD_ATTR NULL|self + ceil
  LOAD_FAST N
  LOAD_CONST 2
  BINARY_OP /
  CALL 1
  CALL 1
  STORE_FAST N_half
  LOAD_CONST 2
  STORE_FAST n_rows
  LOAD_GLOBAL np
  LOAD_ATTR NULL|self + linspace
  LOAD_CONST 0
  LOAD_CONST 1.0
  LOAD_FAST n
  CALL 3
  STORE_FAST t
  LOAD_GLOBAL np
  LOAD_ATTR NULL|self + ones
  LOAD_FAST n
  BUILD_TUPLE 1
  CALL 1
  LOAD_FAST locus
  LOAD_CONST 0
  BINARY_SUBSCR
  BINARY_OP *
  STORE_FAST xt
  LOAD_GLOBAL np
  LOAD_ATTR NULL|self + ones
  LOAD_FAST n
  BUILD_TUPLE 1
  CALL 1
  LOAD_FAST locus
  LOAD_CONST 1
  BINARY_SUBSCR
  BINARY_OP *
  STORE_FAST yt
  LOAD_GLOBAL NULL + _range
  LOAD_FAST coeffs
  LOAD_ATTR shape
  LOAD_CONST 0
  BINARY_SUBSCR
  CALL 1
  GET_ITER
L3:
  EXTENDED_ARG 1
  FOR_ITER L6
  STORE_FAST n
  LOAD_FAST xt
  LOAD_FAST coeffs
  LOAD_FAST n
  LOAD_CONST 0
  BUILD_TUPLE 2
  BINARY_SUBSCR
  LOAD_GLOBAL np
  LOAD_ATTR NULL|self + cos
  LOAD_CONST 2
  LOAD_FAST n
  LOAD_CONST 1
  BINARY_OP +
  BINARY_OP *
  LOAD_GLOBAL np
  LOAD_ATTR pi
  BINARY_OP *
  LOAD_FAST t
  BINARY_OP *
  CALL 1
  BINARY_OP *
  LOAD_FAST coeffs
  LOAD_FAST n
  LOAD_CONST 1
  BUILD_TUPLE 2
  BINARY_SUBSCR
  LOAD_GLOBAL np
  LOAD_ATTR NULL|self + sin
  LOAD_CONST 2
  LOAD_FAST n
  LOAD_CONST 1
  BINARY_OP +
  BINARY_OP *
  LOAD_GLOBAL np
  LOAD_ATTR pi
  BINARY_OP *
  LOAD_FAST t
  BINARY_OP *
  CALL 1
  BINARY_OP *
  BINARY_OP +
  BINARY_OP +=
  STORE_FAST xt
  LOAD_FAST yt
  LOAD_FAST coeffs
  LOAD_FAST n
  LOAD_CONST 2
  BUILD_TUPLE 2
  BINARY_SUBSCR
  LOAD_GLOBAL np
  LOAD_ATTR NULL|self + cos
  LOAD_CONST 2
  LOAD_FAST n
  LOAD_CONST 1
  BINARY_OP +
  BINARY_OP *
  LOAD_GLOBAL np
  LOAD_ATTR pi
  BINARY_OP *
  LOAD_FAST t
  BINARY_OP *
  CALL 1
  BINARY_OP *
  LOAD_FAST coeffs
  LOAD_FAST n
  LOAD_CONST 3
  BUILD_TUPLE 2
  BINARY_SUBSCR
  LOAD_GLOBAL np
  LOAD_ATTR NULL|self + sin
  LOAD_CONST 2
  LOAD_FAST n
  LOAD_CONST 1
  BINARY_OP +
  BINARY_OP *
  LOAD_GLOBAL np
  LOAD_ATTR pi
  BINARY_OP *
  LOAD_FAST t
  BINARY_OP *
  CALL 1
  BINARY_OP *
  BINARY_OP +
  BINARY_OP +=
  STORE_FAST yt
  LOAD_FAST plt
  LOAD_ATTR NULL|self + subplot2grid
  LOAD_FAST n_rows
  LOAD_FAST N_half
  BUILD_TUPLE 2
  LOAD_FAST n
  LOAD_FAST N_half
  BINARY_OP //
  LOAD_FAST n
  LOAD_FAST N_half
  BINARY_OP %
  BUILD_TUPLE 2
  CALL 2
  STORE_FAST ax
  LOAD_FAST ax
  LOAD_ATTR NULL|self + set_title
  LOAD_GLOBAL NULL + str
  LOAD_FAST n
  LOAD_CONST 1
  BINARY_OP +
  CALL 1
  CALL 1
  POP_TOP
  LOAD_FAST contour
  POP_JUMP_IF_NONE L4
  LOAD_FAST ax
  LOAD_ATTR NULL|self + plot
  LOAD_FAST contour
  LOAD_CONST None
  LOAD_CONST None
  BUILD_SLICE 2
  LOAD_CONST 1
  BUILD_TUPLE 2
  BINARY_SUBSCR
  LOAD_FAST contour
  LOAD_CONST None
  LOAD_CONST None
  BUILD_SLICE 2
  LOAD_CONST 0
  BUILD_TUPLE 2
  BINARY_SUBSCR
  LOAD_CONST 'c--'
  LOAD_CONST 2
  KW_NAMES ('linewidth',)
  CALL 4
  POP_TOP
L4:
  LOAD_FAST ax
  LOAD_ATTR NULL|self + plot
  LOAD_FAST yt
  LOAD_FAST xt
  LOAD_CONST 'r'
  LOAD_CONST 2
  KW_NAMES ('linewidth',)
  CALL 4
  POP_TOP
  LOAD_FAST image
  POP_JUMP_IF_NOT_NONE L5
  EXTENDED_ARG 1
  JUMP_BACKWARD L3
L5:
  LOAD_FAST ax
  LOAD_ATTR NULL|self + imshow
  LOAD_FAST image
  LOAD_FAST plt
  LOAD_ATTR cm
  LOAD_ATTR gray
  CALL 2
  POP_TOP
  EXTENDED_ARG 1
  JUMP_BACKWARD L3
L6:
  END_FOR
  LOAD_FAST plt
  LOAD_ATTR NULL|self + show
  CALL 0
  POP_TOP
  RETURN_CONST None
L7:
  PUSH_EXC_INFO
  LOAD_GLOBAL ImportError
  CHECK_EXC_MATCH
  POP_JUMP_IF_FALSE L9
  POP_TOP
  LOAD_GLOBAL NULL + print
  LOAD_CONST 'Cannot plot: matplotlib was not installed.'
  CALL 1
  POP_TOP
L8:
  POP_EXCEPT
  RETURN_CONST None
L9:
  RERAISE 0
L10:
  COPY 3
  POP_EXCEPT
  RERAISE 1
  EXC try=L1..L2 -> handler=L7 depth=0 lasti=False
  EXC try=L7..L8 -> handler=L10 depth=1 lasti=True
  EXC try=L9..L10 -> handler=L10 depth=1 lasti=True
END

def plot_efd(coeffs, locus=(0.0, 0.0), image=None, contour=None, n=300):
    """pass"""
    try:
        import matplotlib.pyplot as plt
    except ImportError:
        print('Cannot plot: matplotlib was not installed.')
        return
    N = coeffs.shape[0]
    N_half = int(np.ceil(N / 2))
    n_rows = 2
    t = np.linspace(0, 1.0, n)
    xt = np.ones((n,)) * locus[0]
    yt = np.ones((n,)) * locus[1]
    for n in _range(coeffs.shape[0]):
        xt += coeffs[n, 0] * np.cos(2 * (n + 1) * np.pi * t) + coeffs[n, 1] * np.sin(2 * (n + 1) * np.pi * t)
        yt += coeffs[n, 2] * np.cos(2 * (n + 1) * np.pi * t) + coeffs[n, 3] * np.sin(2 * (n + 1) * np.pi * t)
        ax = plt.subplot2grid((n_rows, N_half), (n // N_half, n % N_half))
        ax.set_title(str(n + 1))
        if contour is not None:
            ax.plot(contour[:, 1], contour[:, 0], 'c--', linewidth=2)
        ax.plot(yt, xt, 'r', linewidth=2)
        if image is not None:
            ax.imshow(image, plt.cm.gray)
    plt.show()


Input:
CODE <module>()
  RESUME 0
  LOAD_CONST <code _errcheck>
  MAKE_FUNCTION 0
  STORE_NAME _errcheck
  RETURN_CONST None
END
CODE _errcheck(result, func, arguments)
  DOC 'pass'
  RESUME 0
  LOAD_FAST result
  LOAD_CONST 0
  COMPARE_OP !=
  POP_JUMP_IF_FALSE L1
  LOAD_GLOBAL NULL + XdoException
  LOAD_CONST 'Function {0} returned error code {1}'
  LOAD_ATTR NULL|self + format
  LOAD_FAST func
  LOAD_ATTR __name__
  LOAD_FAST result
  CALL 2
  CALL 1
  RAISE_VARARGS 1
L1:
  RETURN_CONST None
END

def _errcheck(result, func, arguments):
    """pass"""
    if result != 0:
        raise XdoException('Function {0} returned error code {1}'.format(func.__name__, result))
    return None


Input:
CODE <module>()
  RESUME 0
  LOAD_CONST <code _gen_input_mask>
  MAKE_FUNCTION 0
  STORE_NAME _gen_input_mask
  RETURN_CONST None
END
CODE _gen_input_mask(mask)
  DOC 'pass'
  RESUME 0
  LOAD_GLOBAL NULL + input_mask
  LOAD_GLOBAL NULL + bool
  LOAD_FAST mask
  LOAD_GLOBAL MOD_Shift
  BINARY_OP &
  CALL 1
  LOAD_GLOBAL NULL + bool
  LOAD_FAST mask
  LOAD_GLOBAL MOD_Lock
  BINARY_OP &
  CALL 1
  LOAD_GLOBAL NULL + bool
  LOAD_FAST mask
  LOAD_GLOBAL MOD_Control
  BINARY_OP &
  CALL 1
  LOAD_GLOBAL NULL + bool
  LOAD_FAST mask
  LOAD_GLOBAL MOD_Mod1
  BINARY_OP &
  CALL 1
  LOAD_GLOBAL NULL + bool
  LOAD_FAST mask
  LOAD_GLOBAL MOD_Mod2
  BINARY_OP &
  CALL 1
  LOAD_GLOBAL NULL + bool
  LOAD_FAST mask
  LOAD_GLOBAL MOD_Mod3
  BINARY_OP &
  CALL 1
  LOAD_GLOBAL NULL + bool
  LOAD_FAST mask
  LOAD_GLOBAL MOD_Mod4
  BINARY_OP &
  CALL 1
  LOAD_GLOBAL NULL + bool
  LOAD_FAST mask
  LOAD_GLOBAL MOD_Mod5
  BINARY_OP &
  CALL 1
  KW_NAMES ('shift', 'lock', 'control', 'mod1', 'mod2', 'mod3', 'mod4', 'mod5')
  CALL 8
  RETURN_VALUE
END

def _gen_input_mask(mask):
    """pass"""
    return input_mask(shift=bool(mask & MOD_Shift), lock=bool(mask & MOD_Lock), control=bool(mask & MOD_Control), mod1=bool(mask & MOD_Mod1), mod2=bool(mask & MOD_Mod2), mod3=bool(mask & MOD_Mod3), mod4=bool(mask & MOD_Mod4), mod5=bool(mask & MOD_Mod5))


Input:
CODE <module>()
  RESUME 0
  LOAD_CONST (0,)
  LOAD_CONST <code move_mouse>
  MAKE_FUNCTION defaults
  STORE_NAME move_mouse
  RETURN_CONST None
END
CODE move_mouse(self, x, y, screen)
  DOC 'pass'
  RESUME 0
  LOAD_GLOBAL ctypes
  LOAD_ATTR NULL|self + c_int
  LOAD_FAST x
  CALL 1
  STORE_FAST x
  LOAD_GLOBAL ctypes
  LOAD_ATTR NULL|self + c_int
  LOAD_FAST y
  CALL 1
  STORE_FAST y
  LOAD_GLOBAL ctypes
  LOAD_ATTR NULL|self + c_int
  LOAD_FAST screen
  CALL 1
  STORE_FAST screen
  LOAD_GLOBAL _libxdo
  LOAD_ATTR NULL|self + xdo_move_mouse
  LOAD_FAST self
  LOAD_ATTR _xdo
  LOAD_FAST x
  LOAD_FAST y
  LOAD_FAST screen
  CALL 4
  POP_TOP
  RETURN_CONST None
END

def move_mouse(self, x, y, screen=0):
    """pass"""
    x = ctypes.c_int(x)
    y = ctypes.c_int(y)
    screen = ctypes.c_int(screen)
    _libxdo.xdo_move_mouse(self._xdo, x, y, screen)


Input:
CODE <module>()
  RESUME 0
  LOAD_CONST <code move_mouse_relative_to_window>
  MAKE_FUNCTION 0
  STORE_NAME move_mouse_relative_to_window
  RETURN_CONST None
END
CODE move_mouse_relative_to_window(self, window, x, y)
  DOC 'pass'
  RESUME 0
  LOAD_GLOBAL _libxdo
  LOAD_ATTR NULL|self + xdo_move_mouse_relative_to_window
  LOAD_FAST self
  LOAD_ATTR _xdo
  LOAD_GLOBAL ctypes
  LOAD_ATTR NULL|self + c_ulong
  LOAD_FAST window
  CALL 1
  LOAD_FAST x
  LOAD_FAST y
  CALL 4
  POP_TOP
  RETURN_CONST None
END

def move_mouse_relative_to_window(self, window, x, y):
    """pass"""
    _libxdo.xdo_move_mouse_relative_to_window(self._xdo, ctypes.c_ulong(window), x, y)


Input:
CODE <module>()
  RESUME 0
  LOAD_CONST <code move_mouse_relative>
  MAKE_FUNCTION 0
  STORE_NAME move_mouse_relative
  RETURN_CONST None
END
CODE move_mouse_relative(self, x, y)
  DOC 'pass'
  RESUME 0
  LOAD_GLOBAL _libxdo
  LOAD_ATTR NULL|self + xdo_move_mouse_relative
  LOAD_FAST self
  LOAD_ATTR _xdo
  LOAD_FAST x
  LOAD_FAST y
  CALL 3
  POP_TOP
  RETURN_CONST None
END

def move_mouse_relative(self, x, y):
    """pass"""
    _libxdo.xdo_move_mouse_relative(self._xdo, x, y)


Input:
CODE <module>()
  RESUME 0
  LOAD_CONST <code mouse_down>
  MAKE_FUNCTION 0
  STORE_NAME mouse_down
  RETURN_CONST None
END
CODE mouse_down(self, window, button)
  DOC 'pass'
  RESUME 0
  LOAD_GLOBAL _libxdo
  LOAD_ATTR NULL|self + xdo_mouse_down
  LOAD_FAST self
  LOAD_ATTR _xdo
  LOAD_GLOBAL ctypes
  LOAD_ATTR NULL|self + c_ulong
  LOAD_FAST window
  CALL 1
  LOAD_GLOBAL ctypes
  LOAD_ATTR NULL|self + c_int
  LOAD_FAST button
  CALL 1
  CALL 3
  POP_TOP
  RETURN_CONST None
END

def mouse_down(self, window, button):
    """pass"""
    _libxdo.xdo_mouse_down(self._xdo, ctypes.c_ulong(window), ctypes.c_int(button))


Input:
CODE <module>()
  RESUME 0
  LOAD_CONST <code strip_punctuation_space>
  MAKE_FUNCTION 0
  STORE_NAME strip_punctuation_space
  RETURN_CONST None
END
CODE strip_punctuation_space(value)
  DOC 'pass'
  RESUME 0
  LOAD_CONST <code strip_punctuation_space.<locals>.strip_punctuation>
  MAKE_FUNCTION 0
  STORE_FAST strip_punctuation
  LOAD_FAST value
  LOAD_CONST None
  COMPARE_OP ==
  POP_JUMP_IF_FALSE L1
  RETURN_CONST None
L1:
  LOAD_GLOBAL NULL + type
  LOAD_FAST value
  CALL 1
  LOAD_GLOBAL list
  COMPARE_OP ==
  POP_JUMP_IF_FALSE L6
  LOAD_FAST value
  GET_ITER
  LOAD_FAST_AND_CLEAR v
  SWAP 2
L2:
  BUILD_LIST 0
  SWAP 2
L3:
  FOR_ITER L4
  STORE_FAST v
  PUSH_NULL
  LOAD_FAST strip_punctuation
  LOAD_FAST v
  CALL 1
  LIST_APPEND 2
  JUMP_BACKWARD L3
L4:
  END_FOR
L5:
  SWAP 2
  STORE_FAST v
  RETURN_VALUE
L6:
  PUSH_NULL
  LOAD_FAST strip_punctuation
  LOAD_FAST value
  CALL 1
  RETURN_VALUE
L7:
  SWAP 2
  POP_TOP
  SWAP 2
  STORE_FAST v
  RERAISE 0
  EXC try=L2..L5 -> handler=L7 depth=2 lasti=False
END
CODE strip_punctuation_space.<locals>.strip_punctuation(string)
  RESUME 0
  LOAD_CONST ((' .', '.'), (' :', ':'), ('( ', '('), (' )', ')'))
  STORE_FAST replacement_list
  LOAD_FAST replacement_list
  GET_ITER
L1:
  FOR_ITER L2
  UNPACK_SEQUENCE 2
  STORE_FAST match
  STORE_FAST replacement
  LOAD_FAST string
  LOAD_ATTR NULL|self + replace
  LOAD_FAST match
  LOAD_FAST replacement
  CALL 2
  STORE_FAST string
  JUMP_BACKWARD L1
L2:
  END_FOR
  LOAD_FAST string
  RETURN_VALUE
END

def strip_punctuation_space(value):
    """pass"""

    def strip_punctuation(string):
        replacement_list = ((' .', '.'), (' :', ':'), ('( ', '('), (' )', ')'))
        for match, replacement in replacement_list:
            string = string.replace(match, replacement)
        return string
    if value == None:
        return None
    if type(value) == list:
        return [strip_punctuation(v) for v in value]
    return strip_punctuation(value)


Input:
CODE <module>()
  DOC '.'
  RESUME 0
  LOAD_CONST ('.',)
  LOAD_CONST <code join_sentences>
  MAKE_FUNCTION defaults
  STORE_NAME join_sentences
  RETURN_CONST None
END
CODE join_sentences(string1, string2, glue)
  DOC 'pass'
  RESUME 0
  LOAD_FAST string1
  POP_JUMP_IF_FALSE L1
  LOAD_FAST string1
  LOAD_CONST ''
  COMPARE_OP ==
  POP_JUMP_IF_FALSE L2
L1:
  LOAD_FAST string2
  RETURN_VALUE
L2:
  LOAD_FAST string2
  POP_JUMP_IF_FALSE L3
  LOAD_FAST string2
  LOAD_CONST ''
  COMPARE_OP ==
  POP_JUMP_IF_FALSE L4
L3:
  LOAD_FAST string1
  RETURN_VALUE
L4:
  LOAD_FAST string1
  LOAD_ATTR NULL|self + rstrip
  CALL 0
  STORE_FAST new_string
  LOAD_FAST new_string
  LOAD_ATTR NULL|self + endswith
  LOAD_FAST glue
  CALL 1
  POP_JUMP_IF_TRUE L5
  LOAD_FAST new_string
  LOAD_FAST glue
  BINARY_OP +=
  STORE_FAST new_string
L5:
  LOAD_FAST new_string
  LOAD_CONST ' '
  LOAD_FAST string2
  LOAD_ATTR NULL|self + lstrip
  CALL 0
  BINARY_OP +
  BINARY_OP +=
  STORE_FAST new_string
  LOAD_FAST new_string
  RETURN_VALUE
END

def join_sentences(string1, string2, glue='.'):
    """pass"""
    if not string1 or string1 == '':
        return string2
    if not string2 or string2 == '':
        return string1
    new_string = string1.rstrip()
    if not new_string.endswith(glue):
        new_string += glue
    new_string += ' ' + string2.lstrip()
    return new_string


Input:
CODE <module>()
  RESUME 0
  LOAD_CONST (3735928559,)
  LOAD_CONST <code coerce_to_int>
  MAKE_FUNCTION defaults
  STORE_NAME coerce_to_int
  RETURN_CONST None
END
CODE coerce_to_int(val, default)
  DOC 'pass'
  RESUME 0
  NOP
L1:
  LOAD_GLOBAL NULL + int
  LOAD_FAST val
  CALL 1
L2:
  RETURN_VALUE
L3:
  PUSH_EXC_INFO
  LOAD_GLOBAL TypeError
  LOAD_GLOBAL ValueError
  BUILD_TUPLE 2
  CHECK_EXC_MATCH
  POP_JUMP_IF_FALSE L7
  POP_TOP
  LOAD_FAST default
  LOAD_CONST 3735928559
  COMPARE_OP !=
  POP_JUMP_IF_FALSE L5
  LOAD_FAST default
  SWAP 2
L4:
  POP_EXCEPT
  RETURN_VALUE
L5:
  LOAD_FAST val
  SWAP 2
L6:
  POP_EXCEPT
  RETURN_VALUE
L7:
  RERAISE 0
L8:
  COPY 3
  POP_EXCEPT
  RERAISE 1
  EXC try=L1..L2 -> handler=L3 depth=0 lasti=False
  EXC try=L3..L4 -> handler=L8 depth=1 lasti=True
  EXC try=L5..L6 -> handler=L8 depth=1 lasti=True
  EXC try=L7..L8 -> handler=L8 depth=1 lasti=True
END

def coerce_to_int(val, default=3735928559):
    """pass"""
    try:
        return int(val)
    except (TypeError, ValueError):
        if default != 3735928559:
            return default
        return val


Input:
CODE <module>()
  RESUME 0
  LOAD_CONST <code nullify>
  MAKE_FUNCTION 0
  STORE_NAME nullify
  RETURN_CONST None
END
CODE nullify(function)
  DOC 'pass'
  MAKE_CELL function
  RESUME 0
  LOAD_CLOSURE function
  BUILD_TUPLE 1
  LOAD_CONST <code nullify.<locals>.wrapper>
  MAKE_FUNCTION closure
  STORE_FAST wrapper
  LOAD_FAST wrapper
  RETURN_VALUE
END
CODE nullify.<locals>.wrapper(*args, **kwargs)
  COPY_FREE_VARS 1
  RESUME 0
  PUSH_NULL
  LOAD_DEREF function
  LOAD_FAST args
  BUILD_MAP 0
  LOAD_FAST kwargs
  DICT_MERGE 1
  CALL_FUNCTION_EX 1
  STORE_FAST value
  LOAD_GLOBAL NULL + type
  LOAD_FAST value
  CALL 1
  LOAD_GLOBAL list
  COMPARE_OP ==
  POP_JUMP_IF_FALSE L1
  LOAD_GLOBAL NULL + len
  LOAD_FAST value
  CALL 1
  LOAD_CONST 0
  COMPARE_OP ==
  POP_JUMP_IF_FALSE L1
  RETURN_CONST None
L1:
  LOAD_FAST value
  RETURN_VALUE
END

def nullify(function):
    """pass"""

    def wrapper(*args, **kwargs):
        value = function(*args, **kwargs)
        if type(value) == list and len(value) == 0:
            return None
        return value
    return wrapper


Input:
CODE <module>()
  RESUME 0
  LOAD_CONST <code strippen>
  MAKE_FUNCTION 0
  STORE_NAME strippen
  RETURN_CONST None
END
CODE strippen(function)
  DOC 'pass'
  MAKE_CELL function
  RESUME 0
  LOAD_CLOSURE function
  BUILD_TUPLE 1
  LOAD_CONST <code strippen.<locals>.wrapper>
  MAKE_FUNCTION closure
  STORE_FAST wrapper
  LOAD_FAST wrapper
  RETURN_VALUE
END
CODE strippen.<locals>.wrapper(*args, **kwargs)
  COPY_FREE_VARS 1
  RESUME 0
  LOAD_GLOBAL NULL + strip_strings
  PUSH_NULL
  LOAD_DEREF function
  LOAD_FAST args
  BUILD_MAP 0
  LOAD_FAST kwargs
  DICT_MERGE 1
  CALL_FUNCTION_EX 1
  CALL 1
  RETURN_VALUE
END

def strippen(function):
    """pass"""

    def wrapper(*args, **kwargs):
        return strip_strings(function(*args, **kwargs))
    return wrapper


Input:
CODE <module>()
  RESUME 0
  LOAD_CONST <code inten>
  MAKE_FUNCTION 0
  STORE_NAME inten
  RETURN_CONST None
END
CODE inten(function)
  DOC 'pass'
  MAKE_CELL function
  RESUME 0
  LOAD_CLOSURE function
  BUILD_TUPLE 1
  LOAD_CONST <code inten.<locals>.wrapper>
  MAKE_FUNCTION closure
  STORE_FAST wrapper
  LOAD_FAST wrapper
  RETURN_VALUE
END
CODE inten.<locals>.wrapper(*args, **kwargs)
  COPY_FREE_VARS 1
  RESUME 0
  LOAD_GLOBAL NULL + coerce_to_int
  PUSH_NULL
  LOAD_DEREF function
  LOAD_FAST args
  BUILD_MAP 0
  LOAD_FAST kwargs
  DICT_MERGE 1
  CALL_FUNCTION_EX 1
  CALL 1
  RETURN_VALUE
END

def inten(function):
    """pass"""

    def wrapper(*args, **kwargs):
        return coerce_to_int(function(*args, **kwargs))
    return wrapper


Input:
CODE <module>()
  RESUME 0
  LOAD_CONST (None,)
  LOAD_CONST <code connect>
  MAKE_FUNCTION defaults
  STORE_NAME connect
  RETURN_CONST None
END
CODE connect(url, max_retries, **kwargs)
  DOC 'pass'
  RESUME 0
  LOAD_GLOBAL NULL + AvaticaClient
  LOAD_FAST url
  LOAD_FAST max_retries
  KW_NAMES ('max_retries',)
  CALL 2
  STORE_FAST client
  LOAD_FAST client
  LOAD_ATTR NULL|self + connect
  CALL 0
  POP_TOP
  LOAD_GLOBAL NULL + Connection
  LOAD_FAST client
  BUILD_TUPLE 1
  BUILD_MAP 0
  LOAD_FAST kwargs
  DICT_MERGE 1
  CALL_FUNCTION_EX 1
  RETURN_VALUE
END

def connect(url, max_retries=None, **kwargs):
    """pass"""
    client = AvaticaClient(url, max_retries=max_retries)
    client.connect()
    return Connection(client, **kwargs)


Input:
CODE <module>()
  RESUME 0
  LOAD_CONST <code connect>
  MAKE_FUNCTION 0
  STORE_NAME connect
  RETURN_CONST None
END
CODE connect(self)
  DOC 'pass'
  RESUME 0
  LOAD_GLOBAL logger
  LOAD_ATTR NULL|self + debug
  LOAD_CONST 'Opening connection to %s:%s'
  LOAD_FAST self
  LOAD_ATTR url
  LOAD_ATTR hostname
  LOAD_FAST self
  LOAD_ATTR url
  LOAD_ATTR port
  CALL 3
  POP_TOP
  NOP
L1:
  LOAD_GLOBAL httplib
  LOAD_ATTR NULL|self + HTTPConnection
  LOAD_FAST self
  LOAD_ATTR url
  LOAD_ATTR hostname
  LOAD_FAST self
  LOAD_ATTR url
  LOAD_ATTR port
  CALL 2
  LOAD_FAST self
  STORE_ATTR connection
  LOAD_FAST self
  LOAD_ATTR connection
  LOAD_ATTR NULL|self + connect
  CALL 0
  POP_TOP
L2:
  RETURN_CONST None
L3:
  PUSH_EXC_INFO
  LOAD_GLOBAL httplib
  LOAD_ATTR HTTPException
  LOAD_GLOBAL socket
  LOAD_ATTR error
  BUILD_TUPLE 2
  CHECK_EXC_MATCH
  POP_JUMP_IF_FALSE L6
  STORE_FAST e
L4:
  LOAD_GLOBAL errors
  LOAD_ATTR NULL|self + InterfaceError
  LOAD_CONST 'Unable to connect to the specified service'
  LOAD_FAST e
  CALL 2
  RAISE_VARARGS 1
L5:
  LOAD_CONST None
  STORE_FAST e
  DELETE_FAST e
  RERAISE 1
L6:
  RERAISE 0
L7:
  COPY 3
  POP_EXCEPT
  RERAISE 1
  EXC try=L1..L2 -> handler=L3 depth=0 lasti=False
  EXC try=L3..L4 -> handler=L7 depth=1 lasti=True
  EXC try=L4..L5 -> handler=L5 depth=1 lasti=True
  EXC try=L5..L7 -> handler=L7 depth=1 lasti=True
END

def connect(self):
    """pass"""
    logger.debug('Opening connection to %s:%s', self.url.hostname, self.url.port)
    try:
        self.connection = httplib.HTTPConnection(self.url.hostname, self.url.port)
        self.connection.connect()
    except (httplib.HTTPException, socket.error) as e:
        raise errors.InterfaceError('Unable to connect to the specified service', e)


Input:
CODE <module>()
  RESUME 0
  LOAD_CONST <code close>
  MAKE_FUNCTION 0
  STORE_NAME close
  RETURN_CONST None
END
CODE close(self)
  DOC 'pass'
  RESUME 0
  LOAD_FAST self
  LOAD_ATTR connection
  POP_JUMP_IF_NONE L3
  LOAD_GLOBAL logger
  LOAD_ATTR NULL|self + debug
  LOAD_CONST 'Closing connection to %s:%s'
  LOAD_FAST self
  LOAD_ATTR url
  LOAD_ATTR hostname
  LOAD_FAST self
  LOAD_ATTR url
  LOAD_ATTR port
  CALL 3
  POP_TOP
  NOP
L1:
  LOAD_FAST self
  LOAD_ATTR connection
  LOAD_ATTR NULL|self + close
  CALL 0
  POP_TOP
L2:
  LOAD_CONST None
  LOAD_FAST self
  STORE_ATTR connection
  RETURN_CONST None
L3:
  RETURN_CONST None
L4:
  PUSH_EXC_INFO
  LOAD_GLOBAL httplib
  LOAD_ATTR HTTPException
  CHECK_EXC_MATCH
  POP_JUMP_IF_FALSE L6
  POP_TOP
  LOAD_GLOBAL logger
  LOAD_ATTR NULL|self + warning
  LOAD_CONST 'Error while closing connection'
  LOAD_CONST True
  KW_NAMES ('exc_info',)
  CALL 2
  POP_TOP
L5:
  POP_EXCEPT
  JUMP_BACKWARD L2
L6:
  RERAISE 0
L7:
  COPY 3
  POP_EXCEPT
  RERAISE 1
  EXC try=L1..L2 -> handler=L4 depth=0 lasti=False
  EXC try=L4..L5 -> handler=L7 depth=1 lasti=True
  EXC try=L6..L7 -> handler=L7 depth=1 lasti=True
END

def close(self):
    """pass"""
    if self.connection is not None:
        logger.debug('Closing connection to %s:%s', self.url.hostname, self.url.port)
        try:
            self.connection.close()
        except httplib.HTTPException:
            logger.warning('Error while closing connection', exc_info=True)
        self.connection = None


Input:
CODE <module>()
  RESUME 0
  LOAD_CONST (None,)
  LOAD_CONST <code connection_sync>
  MAKE_FUNCTION defaults
  STORE_NAME connection_sync
  RETURN_CONST None
END
CODE connection_sync(self, connection_id, connProps)
  DOC 'pass'
  RESUME 0
  LOAD_FAST connProps
  POP_JUMP_IF_NOT_NONE L1
  BUILD_MAP 0
  STORE_FAST connProps
L1:
  LOAD_GLOBAL requests_pb2
  LOAD_ATTR NULL|self + ConnectionSyncRequest
  CALL 0
  STORE_FAST request
  LOAD_FAST connection_id
  LOAD_FAST request
  STORE_ATTR connection_id
  LOAD_FAST connProps
  LOAD_ATTR NULL|self + get
  LOAD_CONST 'autoCommit'
  LOAD_CONST False
  CALL 2
  LOAD_FAST request
  LOAD_ATTR conn_props
  STORE_ATTR auto_commit
  LOAD_CONST True
  LOAD_FAST request
  LOAD_ATTR conn_props
  STORE_ATTR has_auto_commit
  LOAD_FAST connProps
  LOAD_ATTR NULL|self + get
  LOAD_CONST 'readOnly'
  LOAD_CONST False
  CALL 2
  LOAD_FAST request
  LOAD_ATTR conn_props
  STORE_ATTR read_only
  LOAD_CONST True
  LOAD_FAST request
  LOAD_ATTR conn_props
  STORE_ATTR has_read_only
  LOAD_FAST connProps
  LOAD_ATTR NULL|self + get
  LOAD_CONST 'transactionIsolation'
  LOAD_CONST 0
  CALL 2
  LOAD_FAST request
  LOAD_ATTR conn_props
  STORE_ATTR transaction_isolation
  LOAD_FAST connProps
  LOAD_ATTR NULL|self + get
  LOAD_CONST 'catalog'
  LOAD_CONST ''
  CALL 2
  LOAD_FAST request
  LOAD_ATTR conn_props
  STORE_ATTR catalog
  LOAD_FAST connProps
  LOAD_ATTR NULL|self + get
  LOAD_CONST 'schema'
  LOAD_CONST ''
  CALL 2
  LOAD_FAST request
  LOAD_ATTR conn_props
  STORE_ATTR schema
  LOAD_FAST self
  LOAD_ATTR NULL|self + _apply
  LOAD_FAST request
  CALL 1
  STORE_FAST response_data
  LOAD_GLOBAL responses_pb2
  LOAD_ATTR NULL|self + ConnectionSyncResponse
  CALL 0
  STORE_FAST response
  LOAD_FAST response
  LOAD_ATTR NULL|self + ParseFromString
  LOAD_FAST response_data
  CALL 1
  POP_TOP
  LOAD_FAST response
  LOAD_ATTR conn_props
  RETURN_VALUE
END

def connection_sync(self, connection_id, connProps=None):
    """pass"""
    if connProps is None:
        connProps = {}
    request = requests_pb2.ConnectionSyncRequest()
    request.connection_id = connection_id
    request.conn_props.auto_commit = connProps.get('autoCommit', False)
    request.conn_props.has_auto_commit = True
    request.conn_props.read_only = connProps.get('readOnly', False)
    request.conn_props.has_read_only = True
    request.conn_props.transaction_isolation = connProps.get('transactionIsolation', 0)
    request.conn_props.catalog = connProps.get('catalog', '')
    request.conn_props.schema = connProps.get('schema', '')
    response_data = self._apply(request)
    response = responses_pb2.ConnectionSyncResponse()
    response.ParseFromString(response_data)
    return response.conn_props


Input:
CODE <module>()
  RESUME 0
  LOAD_CONST (None,)
  LOAD_CONST <code open_connection>
  MAKE_FUNCTION defaults
  STORE_NAME open_connection
  RETURN_CONST None
END
CODE open_connection(self, connection_id, info)
  DOC 'pass'
  RESUME 0
  LOAD_GLOBAL requests_pb2
  LOAD_ATTR NULL|self + OpenConnectionRequest
  CALL 0
  STORE_FAST request
  LOAD_FAST connection_id
  LOAD_FAST request
  STORE_ATTR connection_id
  LOAD_FAST info
  POP_JUMP_IF_NONE L3
  LOAD_FAST info
  LOAD_ATTR NULL|self + items
  CALL 0
  GET_ITER
L1:
  FOR_ITER L2
  UNPACK_SEQUENCE 2
  STORE_FAST k
  STORE_FAST v
  LOAD_FAST v
  LOAD_FAST request
  LOAD_ATTR info
  LOAD_FAST k
  STORE_SUBSCR
  JUMP_BACKWARD L1
L2:
  END_FOR
L3:
  LOAD_FAST self
  LOAD_ATTR NULL|self + _apply
  LOAD_FAST request
  CALL 1
  STORE_FAST response_data
  LOAD_GLOBAL responses_pb2
  LOAD_ATTR NULL|self + OpenConnectionResponse
  CALL 0
  STORE_FAST response
  LOAD_FAST response
  LOAD_ATTR NULL|self + ParseFromString
  LOAD_FAST response_data
  CALL 1
  POP_TOP
  RETURN_CONST None
END

def open_connection(self, connection_id, info=None):
    """pass"""
    request = requests_pb2.OpenConnectionRequest()
    request.connection_id = connection_id
    if info is not None:
        for k, v in info.items():
            request.info[k] = v
    response_data = self._apply(request)
    response = responses_pb2.OpenConnectionResponse()
    response.ParseFromString(response_data)


Input:
CODE <module>()
  RESUME 0
  LOAD_CONST <code close_connection>
  MAKE_FUNCTION 0
  STORE_NAME close_connection
  RETURN_CONST None
END
CODE close_connection(self, connection_id)
  DOC 'pass'
  RESUME 0
  LOAD_GLOBAL requests_pb2
  LOAD_ATTR NULL|self + CloseConnectionRequest
  CALL 0
  STORE_FAST request
  LOAD_FAST connection_id
  LOAD_FAST request
  STORE_ATTR connection_id
  LOAD_FAST self
  LOAD_ATTR NULL|self + _apply
  LOAD_FAST request
  CALL 1
  POP_TOP
  RETURN_CONST None
END

def close_connection(self, connection_id):
    """pass"""
    request = requests_pb2.CloseConnectionRequest()
    request.connection_id = connection_id
    self._apply(request)


Input:
CODE <module>()
  RESUME 0
  LOAD_CONST <code fit>
  MAKE_FUNCTION 0
  STORE_NAME fit
  RETURN_CONST None
END
CODE fit(self, X, y)
  DOC 'pass'
  RESUME 0
  LOAD_FAST X
  LOAD_FAST self
  STORE_ATTR X
  LOAD_FAST y
  LOAD_FAST self
  STORE_ATTR y
  LOAD_GLOBAL NULL + hasattr
  LOAD_FAST self
  LOAD_ATTR gamma
  LOAD_CONST '__iter__'
  CALL 2
  POP_JUMP_IF_FALSE L1
  LOAD_FAST self
  LOAD_ATTR NULL|self + _optimize_gamma
  LOAD_FAST self
  LOAD_ATTR gamma
  CALL 1
  LOAD_FAST self
  STORE_ATTR gamma
L1:
  LOAD_FAST self
  RETURN_VALUE
END

def fit(self, X, y):
    """pass"""
    self.X = X
    self.y = y
    if hasattr(self.gamma, '__iter__'):
        self.gamma = self._optimize_gamma(self.gamma)
    return self


Input:
CODE <module>()
  RESUME 0
  LOAD_CONST <code predict>
  MAKE_FUNCTION 0
  STORE_NAME predict
  RETURN_CONST None
END
CODE predict(self, X)
  DOC 'pass'
  RESUME 0
  LOAD_GLOBAL NULL + pairwise_kernels
  LOAD_FAST self
  LOAD_ATTR X
  LOAD_FAST X
  LOAD_FAST self
  LOAD_ATTR kernel
  LOAD_FAST self
  LOAD_ATTR gamma
  KW_NAMES ('metric', 'gamma')
  CALL 4
  STORE_FAST K
  LOAD_FAST K
  LOAD_FAST self
  LOAD_ATTR y
  LOAD_CONST None
  LOAD_CONST None
  BUILD_SLICE 2
  LOAD_CONST None
  BUILD_TUPLE 2
  BINARY_SUBSCR
  BINARY_OP *
  LOAD_ATTR NULL|self + sum
  LOAD_CONST 0
  KW_NAMES ('axis',)
  CALL 1
  LOAD_FAST K
  LOAD_ATTR NULL|self + sum
  LOAD_CONST 0
  KW_NAMES ('axis',)
  CALL 1
  BINARY_OP /
  RETURN_VALUE
END

def predict(self, X):
    """pass"""
    K = pairwise_kernels(self.X, X, metric=self.kernel, gamma=self.gamma)
    return (K * self.y[:, None]).sum(axis=0) / K.sum(axis=0)


Input:
CODE <module>()
  RESUME 0
  LOAD_CONST <code _compute_hidden_activations>
  MAKE_FUNCTION 0
  STORE_NAME _compute_hidden_activations
  RETURN_CONST None
END
CODE _compute_hidden_activations(self, X)
  DOC 'pass'
  RESUME 0
  LOAD_FAST self
  LOAD_ATTR NULL|self + _compute_input_activations
  LOAD_FAST X
  CALL 1
  POP_TOP
  LOAD_FAST self
  LOAD_ATTR input_activations_
  STORE_FAST acts
  LOAD_GLOBAL NULL + callable
  LOAD_FAST self
  LOAD_ATTR activation_func
  CALL 1
  POP_JUMP_IF_FALSE L3
  LOAD_FAST self
  LOAD_ATTR activation_args
  POP_JUMP_IF_FALSE L1
  LOAD_FAST self
  LOAD_ATTR activation_args
  JUMP_FORWARD L2
L1:
  BUILD_MAP 0
L2:
  STORE_FAST args_dict
  PUSH_NULL
  LOAD_FAST self
  LOAD_ATTR activation_func
  LOAD_FAST acts
  BUILD_TUPLE 1
  BUILD_MAP 0
  LOAD_FAST args_dict
  DICT_MERGE 1
  CALL_FUNCTION_EX 1
  STORE_FAST X_new
  LOAD_FAST X_new
  RETURN_VALUE
L3:
  LOAD_FAST self
  LOAD_ATTR activation_func
  STORE_FAST func_name
  LOAD_FAST self
  LOAD_ATTR _internal_activation_funcs
  LOAD_FAST func_name
  BINARY_SUBSCR
  STORE_FAST func
  PUSH_NULL
  LOAD_FAST func
  LOAD_FAST acts
  BUILD_TUPLE 1
  BUILD_MAP 0
  LOAD_FAST self
  LOAD_ATTR _extra_args
  DICT_MERGE 1
  CALL_FUNCTION_EX 1
  STORE_FAST X_new
  LOAD_FAST X_new
  RETURN_VALUE
END

def _compute_hidden_activations(self, X):
    """pass"""
    self._compute_input_activations(X)
    acts = self.input_activations_
    if callable(self.activation_func):
        args_dict = self.activation_args if self.activation_args else {}
        X_new = self.activation_func(acts, **args_dict)
    else:
        func_name = self.activation_func
        func = self._internal_activation_funcs[func_name]
        X_new = func(acts, **self._extra_args)
    return X_new


Input:
CODE <module>()
  RESUME 0
  LOAD_CONST (None,)
  LOAD_CONST <code transform>
  MAKE_FUNCTION defaults
  STORE_NAME transform
  RETURN_CONST None
END
CODE transform(self, X, y)
  DOC 'pass'
  RESUME 0
  LOAD_FAST self
  LOAD_ATTR components_
  POP_JUMP_IF_NOT_NONE L1
  LOAD_GLOBAL NULL + ValueError
  LOAD_CONST 'No components initialized'
  CALL 1
  RAISE_VARARGS 1
L1:
  LOAD_FAST self
  LOAD_ATTR NULL|self + _compute_hidden_activations
  LOAD_FAST X
  CALL 1
  RETURN_VALUE
END

def transform(self, X, y=None):
    """pass"""
    if self.components_ is None:
        raise ValueError('No components initialized')
    return self._compute_hidden_activations(X)


Input:
CODE <module>()
  RESUME 0
  LOAD_CONST <code _compute_radii>
  MAKE_FUNCTION 0
  STORE_NAME _compute_radii
  RETURN_CONST None
END
CODE _compute_radii(self)
  DOC 'pass'
  RESUME 0
  LOAD_FAST self
  LOAD_ATTR NULL|self + _get_user_components
  LOAD_CONST 'radii'
  CALL 1
  STORE_FAST radii
  LOAD_FAST radii
  POP_JUMP_IF_NOT_NONE L1
  LOAD_FAST self
  LOAD_ATTR components_
  LOAD_CONST 'centers'
  BINARY_SUBSCR
  STORE_FAST centers
  LOAD_FAST centers
  LOAD_ATTR shape
  LOAD_CONST 0
  BINARY_SUBSCR
  STORE_FAST n_centers
  LOAD_GLOBAL np
  LOAD_ATTR NULL|self + max
  LOAD_GLOBAL NULL + pairwise_distances
  LOAD_FAST centers
  CALL 1
  CALL 1
  STORE_FAST max_dist
  LOAD_GLOBAL np
  LOAD_ATTR NULL|self + ones
  LOAD_FAST n_centers
  CALL 1
  LOAD_FAST max_dist
  BINARY_OP *
  LOAD_GLOBAL NULL + sqrt
  LOAD_CONST 2.0
  LOAD_FAST n_centers
  BINARY_OP *
  CALL 1
  BINARY_OP /
  STORE_FAST radii
L1:
  LOAD_FAST radii
  LOAD_FAST self
  LOAD_ATTR components_
  LOAD_CONST 'radii'
  STORE_SUBSCR
  RETURN_CONST None
END

def _compute_radii(self):
    """pass"""
    radii = self._get_user_components('radii')
    if radii is None:
        centers = self.components_['centers']
        n_centers = centers.shape[0]
        max_dist = np.max(pairwise_distances(centers))
        radii = np.ones(n_centers) * max_dist / sqrt(2.0 * n_centers)
    self.components_['radii'] = radii


Input:
CODE <module>()
  RESUME 0
  LOAD_CONST <code _compute_centers>
  MAKE_FUNCTION 0
  STORE_NAME _compute_centers
  RETURN_CONST None
END
CODE _compute_centers(self, X, sparse, rs)
  DOC 'pass'
  MAKE_CELL max_dtype
  MAKE_CELL min_dtype
  RESUME 0
  LOAD_FAST self
  LOAD_ATTR NULL|self + _get_user_components
  LOAD_CONST 'centers'
  CALL 1
  STORE_FAST centers
  LOAD_FAST centers
  EXTENDED_ARG 1
  POP_JUMP_IF_NOT_NONE L7
  LOAD_FAST X
  LOAD_ATTR shape
  LOAD_CONST 1
  BINARY_SUBSCR
  STORE_FAST n_features
  LOAD_FAST sparse
  POP_JUMP_IF_FALSE L5
  LOAD_GLOBAL NULL + range
  LOAD_FAST n_features
  CALL 1
  STORE_FAST fxr
  LOAD_FAST fxr
  GET_ITER
  LOAD_FAST_AND_CLEAR i
  SWAP 2
L1:
  BUILD_LIST 0
  SWAP 2
L2:
  FOR_ITER L3
  STORE_FAST i
  LOAD_FAST X
  LOAD_ATTR NULL|self + getcol
  LOAD_FAST i
  CALL 1
  LIST_APPEND 2
  JUMP_BACKWARD L2
L3:
  END_FOR
L4:
  STORE_FAST cols
  STORE_FAST i
  LOAD_FAST X
  LOAD_ATTR dtype
  LOAD_ATTR NULL|self + type
  LOAD_CONST 10000000000.0
  CALL 1
  STORE_DEREF min_dtype
  LOAD_CLOSURE min_dtype
  BUILD_TUPLE 1
  LOAD_CONST <code _compute_centers.<locals>.<lambda>>
  MAKE_FUNCTION closure
  STORE_FAST sp_min
  LOAD_GLOBAL np
  LOAD_ATTR NULL|self + array
  LOAD_GLOBAL NULL + map
  LOAD_FAST sp_min
  LOAD_FAST cols
  CALL 2
  CALL 1
  STORE_FAST min_Xs
  LOAD_FAST X
  LOAD_ATTR dtype
  LOAD_ATTR NULL|self + type
  LOAD_CONST -10000000000.0
  CALL 1
  STORE_DEREF max_dtype
  LOAD_CLOSURE max_dtype
  BUILD_TUPLE 1
  LOAD_CONST <code _compute_centers.<locals>.<lambda>>
  MAKE_FUNCTION closure
  STORE_FAST sp_max
  LOAD_GLOBAL np
  LOAD_ATTR NULL|self + array
  LOAD_GLOBAL NULL + map
  LOAD_FAST sp_max
  LOAD_FAST cols
  CALL 2
  CALL 1
  STORE_FAST max_Xs
  JUMP_FORWARD L6
L5:
  LOAD_FAST X
  LOAD_ATTR NULL|self + min
  LOAD_CONST 0
  KW_NAMES ('axis',)
  CALL 1
  STORE_FAST min_Xs
  LOAD_FAST X
  LOAD_ATTR NULL|self + max
  LOAD_CONST 0
  KW_NAMES ('axis',)
  CALL 1
  STORE_FAST max_Xs
L6:
  LOAD_FAST max_Xs
  LOAD_FAST min_Xs
  BINARY_OP -
  STORE_FAST spans
  LOAD_FAST self
  LOAD_ATTR n_hidden
  LOAD_FAST n_features
  BUILD_TUPLE 2
  STORE_FAST ctrs_size
  LOAD_FAST min_Xs
  LOAD_FAST spans
  LOAD_FAST rs
  LOAD_ATTR NULL|self + uniform
  LOAD_CONST 0.0
  LOAD_CONST 1.0
  LOAD_FAST ctrs_size
  CALL 3
  BINARY_OP *
  BINARY_OP +
  STORE_FAST centers
L7:
  LOAD_FAST centers
  LOAD_FAST self
  LOAD_ATTR components_
  LOAD_CONST 'centers'
  STORE_SUBSCR
  RETURN_CONST None
L8:
  SWAP 2
  POP_TOP
  SWAP 2
  STORE_FAST i
  RERAISE 0
  EXC try=L1..L4 -> handler=L8 depth=2 lasti=False
END
CODE _compute_centers.<locals>.<lambda>(col)
  COPY_FREE_VARS 1
  RESUME 0
  LOAD_GLOBAL np
  LOAD_ATTR NULL|self + minimum
  LOAD_DEREF min_dtype
  LOAD_GLOBAL np
  LOAD_ATTR NULL|self + min
  LOAD_FAST col
  LOAD_ATTR data
  CALL 1
  CALL 2
  RETURN_VALUE
END
CODE _compute_centers.<locals>.<lambda>(col)
  COPY_FREE_VARS 1
  RESUME 0
  LOAD_GLOBAL np
  LOAD_ATTR NULL|self + maximum
  LOAD_DEREF max_dtype
  LOAD_GLOBAL np
  LOAD_ATTR NULL|self + max
  LOAD_FAST col
  LOAD_ATTR data
  CALL 1
  CALL 2
  RETURN_VALUE
END

def _compute_centers(self, X, sparse, rs):
    """pass"""
    centers = self._get_user_components('centers')
    if centers is None:
        n_features = X.shape[1]
        if sparse:
            fxr = range(n_features)
            cols = [X.getcol(i) for i in fxr]
            min_dtype = X.dtype.type(10000000000.0)
            sp_min = lambda col: np.minimum(min_dtype, np.min(col.data))
            min_Xs = np.array(map(sp_min, cols))
            max_dtype = X.dtype.type(-10000000000.0)
            sp_max = lambda col: np.maximum(max_dtype, np.max(col.data))
            max_Xs = np.array(map(sp_max, cols))
        else:
            min_Xs = X.min(axis=0)
            max_Xs = X.max(axis=0)
        spans = max_Xs - min_Xs
        ctrs_size = (self.n_hidden, n_features)
        centers = min_Xs + spans * rs.uniform(0.0, 1.0, ctrs_size)
    self.components_['centers'] = centers


Input:
CODE <module>()
  RESUME 0
  LOAD_CONST <code compat_serializer_check_is_valid>
  MAKE_FUNCTION 0
  STORE_NAME compat_serializer_check_is_valid
  RETURN_CONST None
END
CODE compat_serializer_check_is_valid(serializer)
  DOC 'pass'
  RESUME 0
  LOAD_GLOBAL DRFVLIST
  LOAD_CONST 0
  BINARY_SUBSCR
  LOAD_CONST 3
  COMPARE_OP >=
  POP_JUMP_IF_FALSE L1
  LOAD_FAST serializer
  LOAD_ATTR NULL|self + is_valid
  LOAD_CONST True
  KW_NAMES ('raise_exception',)
  CALL 1
  POP_TOP
  RETURN_CONST None
L1:
  LOAD_FAST serializer
  LOAD_ATTR NULL|self + is_valid
  CALL 0
  POP_JUMP_IF_TRUE L2
  LOAD_GLOBAL serializers
  LOAD_ATTR NULL|self + ValidationError
  LOAD_CONST 'The serializer raises a validation error'
  CALL 1
  POP_TOP
  RETURN_CONST None
L2:
  RETURN_CONST None
END

def compat_serializer_check_is_valid(serializer):
    """pass"""
    if DRFVLIST[0] >= 3:
        serializer.is_valid(raise_exception=True)
    elif not serializer.is_valid():
        serializers.ValidationError('The serializer raises a validation error')


Input:
CODE <module>()
  RESUME 0
  LOAD_CONST <code compat_serializer_attr>
  MAKE_FUNCTION 0
  STORE_NAME compat_serializer_attr
  RETURN_CONST None
END
CODE compat_serializer_attr(serializer, obj)
  DOC 'pass'
  RESUME 0
  LOAD_GLOBAL DRFVLIST
  LOAD_CONST 0
  BINARY_SUBSCR
  LOAD_CONST 3
  COMPARE_OP ==
  POP_JUMP_IF_FALSE L4
  LOAD_GLOBAL DRFVLIST
  LOAD_CONST 1
  BINARY_SUBSCR
  LOAD_CONST 1
  COMPARE_OP ==
  POP_JUMP_IF_FALSE L4
  LOAD_FAST serializer
  LOAD_ATTR instance
  GET_ITER
L1:
  FOR_ITER L3
  STORE_FAST i
  LOAD_FAST i
  LOAD_ATTR id
  LOAD_FAST obj
  LOAD_ATTR id
  COMPARE_OP ==
  POP_JUMP_IF_TRUE L2
  JUMP_BACKWARD L1
L2:
  LOAD_FAST i
  SWAP 2
  POP_TOP
  RETURN_VALUE
L3:
  END_FOR
  RETURN_CONST None
L4:
  LOAD_FAST obj
  RETURN_VALUE
END

def compat_serializer_attr(serializer, obj):
    """pass"""
    if DRFVLIST[0] == 3 and DRFVLIST[1] == 1:
        for i in serializer.instance:
            if i.id == obj.id:
                return i
    else:
        return obj


Input:
CODE <module>()
  RESUME 0
  LOAD_CONST <code compat_get_paginated_response>
  MAKE_FUNCTION 0
  STORE_NAME compat_get_paginated_response
  RETURN_CONST None
END
CODE compat_get_paginated_response(view, page)
  DOC 'pass'
  RESUME 0
  LOAD_GLOBAL DRFVLIST
  LOAD_CONST 0
  BINARY_SUBSCR
  LOAD_CONST 3
  COMPARE_OP ==
  POP_JUMP_IF_FALSE L1
  LOAD_GLOBAL DRFVLIST
  LOAD_CONST 1
  BINARY_SUBSCR
  LOAD_CONST 1
  COMPARE_OP >=
  POP_JUMP_IF_FALSE L1
  LOAD_CONST 0
  LOAD_CONST ('ComplexMessageSerializer',)
  IMPORT_NAME rest_messaging.serializers
  IMPORT_FROM ComplexMessageSerializer
  STORE_FAST ComplexMessageSerializer
  POP_TOP
  PUSH_NULL
  LOAD_FAST ComplexMessageSerializer
  LOAD_FAST page
  LOAD_CONST True
  KW_NAMES ('many',)
  CALL 2
  STORE_FAST serializer
  LOAD_FAST view
  LOAD_ATTR NULL|self + get_paginated_response
  LOAD_FAST serializer
  LOAD_ATTR data
  CALL 1
  RETURN_VALUE
L1:
  LOAD_FAST view
  LOAD_ATTR NULL|self + get_pagination_serializer
  LOAD_FAST page
  CALL 1
  STORE_FAST serializer
  LOAD_GLOBAL NULL + Response
  LOAD_FAST serializer
  LOAD_ATTR data
  CALL 1
  RETURN_VALUE
END

def compat_get_paginated_response(view, page):
    """pass"""
    if DRFVLIST[0] == 3 and DRFVLIST[1] >= 1:
        from rest_messaging.serializers import ComplexMessageSerializer
        serializer = ComplexMessageSerializer(page, many=True)
        return view.get_paginated_response(serializer.data)
    else:
        serializer = view.get_pagination_serializer(page)
        return Response(serializer.data)


Input:
CODE <module>()
  RESUME 0
  LOAD_CONST <code compat_pagination_messages>
  MAKE_FUNCTION 0
  STORE_NAME compat_pagination_messages
  RETURN_CONST None
END
CODE compat_pagination_messages(cls)
  DOC 'pass'
  RESUME 0
  LOAD_GLOBAL DRFVLIST
  LOAD_CONST 0
  BINARY_SUBSCR
  LOAD_CONST 3
  COMPARE_OP ==
  POP_JUMP_IF_FALSE L1
  LOAD_GLOBAL DRFVLIST
  LOAD_CONST 1
  BINARY_SUBSCR
  LOAD_CONST 1
  COMPARE_OP >=
  POP_JUMP_IF_FALSE L1
  LOAD_GLOBAL NULL + setattr
  LOAD_FAST cls
  LOAD_CONST 'pagination_class'
  LOAD_GLOBAL MessagePagination
  CALL 3
  POP_TOP
  LOAD_FAST cls
  RETURN_VALUE
L1:
  LOAD_GLOBAL NULL + setattr
  LOAD_FAST cls
  LOAD_CONST 'paginate_by'
  LOAD_GLOBAL NULL + getattr
  LOAD_GLOBAL settings
  LOAD_CONST 'DJANGO_REST_MESSAGING_MESSAGES_PAGE_SIZE'
  LOAD_CONST 30
  CALL 3
  CALL 3
  POP_TOP
  LOAD_FAST cls
  RETURN_VALUE
END

def compat_pagination_messages(cls):
    """pass"""
    if DRFVLIST[0] == 3 and DRFVLIST[1] >= 1:
        setattr(cls, 'pagination_class', MessagePagination)
        return cls
    else:
        setattr(cls, 'paginate_by', getattr(settings, 'DJANGO_REST_MESSAGING_MESSAGES_PAGE_SIZE', 30))
        return cls


Input:
CODE <module>()
  RESUME 0
  LOAD_CONST <code get_participants>
  MAKE_FUNCTION 0
  STORE_NAME get_participants
  RETURN_CONST None
END
CODE get_participants(self, obj)
  DOC 'pass'
  RESUME 0
  LOAD_FAST self
  LOAD_ATTR callback
  POP_JUMP_IF_NOT_NONE L5
  LOAD_FAST obj
  LOAD_ATTR participants
  LOAD_ATTR NULL|self + all
  CALL 0
  GET_ITER
  LOAD_FAST_AND_CLEAR participant
  SWAP 2
L1:
  BUILD_LIST 0
  SWAP 2
L2:
  FOR_ITER L3
  STORE_FAST participant
  LOAD_FAST participant
  LOAD_ATTR id
  LIST_APPEND 2
  JUMP_BACKWARD L2
L3:
  END_FOR
L4:
  SWAP 2
  STORE_FAST participant
  RETURN_VALUE
L5:
  LOAD_FAST self
  LOAD_ATTR NULL|self + callback
  LOAD_FAST obj
  CALL 1
  RETURN_VALUE
L6:
  SWAP 2
  POP_TOP
  SWAP 2
  STORE_FAST participant
  RERAISE 0
  EXC try=L1..L4 -> handler=L6 depth=2 lasti=False
END

def get_participants(self, obj):
    """pass"""
    if self.callback is None:
        return [participant.id for participant in obj.participants.all()]
    else:
        return self.callback(obj)


Input:
CODE <module>()
  RESUME 0
  LOAD_CONST <code get_is_notification>
  MAKE_FUNCTION 0
  STORE_NAME get_is_notification
  RETURN_CONST None
END
CODE get_is_notification(self, obj)
  DOC 'pass'
  RESUME 0
  NOP
L1:
  LOAD_GLOBAL NULL + compat_serializer_attr
  LOAD_FAST self
  LOAD_FAST obj
  CALL 2
  STORE_FAST o
  LOAD_FAST o
  LOAD_ATTR is_notification
L2:
  RETURN_VALUE
L3:
  PUSH_EXC_INFO
  LOAD_GLOBAL Exception
  CHECK_EXC_MATCH
  POP_JUMP_IF_FALSE L5
  POP_TOP
L4:
  POP_EXCEPT
  RETURN_CONST False
L5:
  RERAISE 0
L6:
  COPY 3
  POP_EXCEPT
  RERAISE 1
  EXC try=L1..L2 -> handler=L3 depth=0 lasti=False
  EXC try=L3..L4 -> handler=L6 depth=1 lasti=True
  EXC try=L5..L6 -> handler=L6 depth=1 lasti=True
END

def get_is_notification(self, obj):
    """pass"""
    try:
        o = compat_serializer_attr(self, obj)
        return o.is_notification
    except Exception:
        return False


Input:
CODE <module>()
  RESUME 0
  LOAD_CONST (False,)
  LOAD_CONST <code process>
  MAKE_FUNCTION defaults
  STORE_NAME process
  RETURN_CONST None
END
CODE process(self, quoted)
  DOC 'pass'
  RESUME 0
  LOAD_GLOBAL NULL + urlparse
  LOAD_FAST self
  LOAD_ATTR raw
  CALL 1
  LOAD_FAST self
  STORE_ATTR p
  LOAD_FAST self
  LOAD_ATTR p
  LOAD_ATTR scheme
  LOAD_FAST self
  STORE_ATTR scheme
  LOAD_FAST self
  LOAD_ATTR p
  LOAD_ATTR netloc
  LOAD_FAST self
  STORE_ATTR netloc
  LOAD_FAST quoted
  POP_JUMP_IF_TRUE L1
  LOAD_FAST self
  LOAD_ATTR p
  LOAD_ATTR path
  JUMP_FORWARD L2
L1:
  LOAD_GLOBAL NULL + quote
  LOAD_FAST self
  LOAD_ATTR p
  LOAD_ATTR path
  CALL 1
L2:
  LOAD_FAST self
  STORE_ATTR opath
  LOAD_FAST self
  LOAD_ATTR opath
  LOAD_ATTR NULL|self + split
  LOAD_CONST '/'
  CALL 1
  GET_ITER
  LOAD_FAST_AND_CLEAR x
  SWAP 2
L3:
  BUILD_LIST 0
  SWAP 2
L4:
  FOR_ITER L7
  STORE_FAST x
  LOAD_FAST x
  POP_JUMP_IF_TRUE L6
L5:
  JUMP_BACKWARD L4
L6:
  LOAD_FAST x
  LIST_APPEND 2
  JUMP_BACKWARD L4
L7:
  END_FOR
L8:
  SWAP 2
  STORE_FAST x
  LOAD_FAST self
  STORE_ATTR path
  LOAD_FAST self
  LOAD_ATTR p
  LOAD_ATTR params
  LOAD_FAST self
  STORE_ATTR params
  LOAD_GLOBAL NULL + parse_qs
  LOAD_FAST self
  LOAD_ATTR p
  LOAD_ATTR query
  LOAD_CONST True
  KW_NAMES ('keep_blank_values',)
  CALL 2
  LOAD_FAST self
  STORE_ATTR query
  LOAD_FAST self
  LOAD_ATTR p
  LOAD_ATTR fragment
  LOAD_FAST self
  STORE_ATTR fragment
  RETURN_CONST None
L9:
  SWAP 2
  POP_TOP
  SWAP 2
  STORE_FAST x
  RERAISE 0
  EXC try=L3..L5 -> handler=L9 depth=2 lasti=False
  EXC try=L6..L8 -> handler=L9 depth=2 lasti=False
END

def process(self, quoted=False):
    """pass"""
    self.p = urlparse(self.raw)
    self.scheme = self.p.scheme
    self.netloc = self.p.netloc
    self.opath = self.p.path if not quoted else quote(self.p.path)
    self.path = [x for x in self.opath.split('/') if x]
    self.params = self.p.params
    self.query = parse_qs(self.p.query, keep_blank_values=True)
    self.fragment = self.p.fragment


Input:
CODE <module>()
  RESUME 0
  LOAD_CONST (None, False, False, True)
  LOAD_CONST <code fetch>
  MAKE_FUNCTION defaults
  STORE_NAME fetch
  RETURN_CONST None
END
CODE fetch(self, url, encoding, force_refetch, nocache, quiet)
  DOC 'pass'
  RESUME 0
  NOP
L1:
  LOAD_FAST force_refetch
  POP_JUMP_IF_TRUE L3
  LOAD_FAST self
  LOAD_ATTR cache
  POP_JUMP_IF_NONE L3
  LOAD_FAST url
  LOAD_FAST self
  LOAD_ATTR cache
  CONTAINS_OP 0
  POP_JUMP_IF_FALSE L3
  LOAD_GLOBAL logging
  LOAD_ATTR NULL|self + debug
  LOAD_CONST 'Retrieving content from cache for {}'
  LOAD_ATTR NULL|self + format
  LOAD_FAST url
  CALL 1
  CALL 1
  POP_TOP
  LOAD_FAST self
  LOAD_ATTR cache
  LOAD_ATTR NULL|self + retrieve_blob
  LOAD_FAST url
  LOAD_FAST encoding
  CALL 2
L2:
  RETURN_VALUE
L3:
  LOAD_GLOBAL WebHelper
  LOAD_ATTR NULL|self + encode_url
  LOAD_FAST url
  CALL 1
  STORE_FAST encoded_url
  LOAD_GLOBAL NULL + Request
  LOAD_FAST encoded_url
  LOAD_CONST 'User-Agent'
  LOAD_CONST 'Mozilla/5.0'
  BUILD_MAP 1
  KW_NAMES ('headers',)
  CALL 2
  STORE_FAST req
  LOAD_FAST req
  LOAD_ATTR NULL|self + add_header
  LOAD_CONST 'Accept-encoding'
  LOAD_CONST 'gzip, deflate'
  CALL 2
  POP_TOP
  LOAD_GLOBAL NULL + getLogger
  CALL 0
  LOAD_ATTR NULL|self + info
  LOAD_CONST 'Fetching: {url} |'
  LOAD_ATTR NULL|self + format
  LOAD_FAST url
  KW_NAMES ('url',)
  CALL 1
  CALL 1
  POP_TOP
  LOAD_GLOBAL NULL + urlopen
  LOAD_FAST req
  CALL 1
  STORE_FAST response
  LOAD_FAST response
  LOAD_ATTR NULL|self + read
  CALL 0
  STORE_FAST content
  LOAD_CONST 'Content-Encoding'
  LOAD_FAST response
  LOAD_ATTR NULL|self + info
  CALL 0
  CONTAINS_OP 0
  POP_JUMP_IF_FALSE L6
  LOAD_FAST response
  LOAD_ATTR NULL|self + info
  CALL 0
  LOAD_ATTR NULL|self + get
  LOAD_CONST 'Content-Encoding'
  CALL 1
  LOAD_CONST 'gzip'
  COMPARE_OP ==
  POP_JUMP_IF_FALSE L6
  LOAD_GLOBAL gzip
  LOAD_ATTR NULL|self + open
  LOAD_GLOBAL NULL + BytesIO
  LOAD_FAST content
  CALL 1
  CALL 1
  BEFORE_WITH
L4:
  STORE_FAST gzfile
  LOAD_FAST gzfile
  LOAD_ATTR NULL|self + read
  CALL 0
  STORE_FAST content
L5:
  LOAD_CONST None
  LOAD_CONST None
  LOAD_CONST None
  CALL 2
  POP_TOP
L6:
  LOAD_FAST self
  LOAD_ATTR cache
  POP_JUMP_IF_NONE L7
  LOAD_FAST nocache
  POP_JUMP_IF_TRUE L7
  LOAD_FAST url
  LOAD_FAST self
  LOAD_ATTR cache
  CONTAINS_OP 1
  POP_JUMP_IF_FALSE L7
  LOAD_FAST self
  LOAD_ATTR cache
  LOAD_ATTR NULL|self + insert_blob
  LOAD_FAST url
  LOAD_FAST content
  CALL 2
  POP_TOP
L7:
  LOAD_FAST content
  POP_JUMP_IF_FALSE L9
  LOAD_FAST encoding
  POP_JUMP_IF_FALSE L9
  LOAD_FAST content
  LOAD_ATTR NULL|self + decode
  LOAD_FAST encoding
  CALL 1
L8:
  RETURN_VALUE
L9:
  LOAD_FAST content
L10:
  RETURN_VALUE
L11:
  PUSH_EXC_INFO
  WITH_EXCEPT_START
  POP_JUMP_IF_TRUE L12
  RERAISE 2
L12:
  POP_TOP
L13:
  POP_EXCEPT
  POP_TOP
  POP_TOP
  JUMP_BACKWARD L6
L14:
  COPY 3
  POP_EXCEPT
  RERAISE 1
L15:
  PUSH_EXC_INFO
  LOAD_GLOBAL URLError
  CHECK_EXC_MATCH
  POP_JUMP_IF_FALSE L22
  STORE_FAST e
L16:
  LOAD_GLOBAL NULL + hasattr
  LOAD_FAST e
  LOAD_CONST 'reason'
  CALL 2
  POP_JUMP_IF_FALSE L17
  LOAD_GLOBAL NULL + getLogger
  CALL 0
  LOAD_ATTR NULL|self + exception
  LOAD_CONST 'We failed to reach {}. Reason: {}'
  LOAD_ATTR NULL|self + format
  LOAD_FAST url
  LOAD_FAST e
  LOAD_ATTR reason
  CALL 2
  CALL 1
  POP_TOP
  JUMP_FORWARD L19
L17:
  LOAD_GLOBAL NULL + hasattr
  LOAD_FAST e
  LOAD_CONST 'code'
  CALL 2
  POP_JUMP_IF_FALSE L18
  LOAD_GLOBAL NULL + getLogger
  CALL 0
  LOAD_ATTR NULL|self + exception
  LOAD_CONST "The server couldn't fulfill the request. Error code: {}"
  LOAD_ATTR NULL|self + format
  LOAD_FAST e
  LOAD_ATTR code
  CALL 1
  CALL 1
  POP_TOP
  JUMP_FORWARD L19
L18:
  LOAD_GLOBAL NULL + getLogger
  CALL 0
  LOAD_ATTR NULL|self + exception
  LOAD_CONST 'Fetching error'
  CALL 1
  POP_TOP
L19:
  LOAD_FAST quiet
  POP_JUMP_IF_TRUE L20
  RAISE_VARARGS 0
L20:
  POP_EXCEPT
  LOAD_CONST None
  STORE_FAST e
  DELETE_FAST e
  RETURN_CONST None
L21:
  LOAD_CONST None
  STORE_FAST e
  DELETE_FAST e
  RERAISE 1
L22:
  RERAISE 0
L23:
  COPY 3
  POP_EXCEPT
  RERAISE 1
  EXC try=L1..L2 -> handler=L15 depth=0 lasti=False
  EXC try=L3..L4 -> handler=L15 depth=0 lasti=False
  EXC try=L4..L5 -> handler=L11 depth=1 lasti=True
  EXC try=L5..L8 -> handler=L15 depth=0 lasti=False
  EXC try=L9..L10 -> handler=L15 depth=0 lasti=False
  EXC try=L11..L13 -> handler=L14 depth=3 lasti=True
  EXC try=L13..L15 -> handler=L15 depth=0 lasti=False
  EXC try=L15..L16 -> handler=L23 depth=1 lasti=True
  EXC try=L16..L20 -> handler=L21 depth=1 lasti=True
  EXC try=L21..L23 -> handler=L23 depth=1 lasti=True
END

def fetch(self, url, encoding=None, force_refetch=False, nocache=False, quiet=True):
    """pass"""
    try:
        if not force_refetch and self.cache is not None and (url in self.cache):
            logging.debug('Retrieving content from cache for {}'.format(url))
            return self.cache.retrieve_blob(url, encoding)
        encoded_url = WebHelper.encode_url(url)
        req = Request(encoded_url, headers={'User-Agent': 'Mozilla/5.0'})
        req.add_header('Accept-encoding', 'gzip, deflate')
        getLogger().info('Fetching: {url} |'.format(url=url))
        response = urlopen(req)
        content = response.read()
        if 'Content-Encoding' in response.info() and response.info().get('Content-Encoding') == 'gzip':
            with gzip.open(BytesIO(content)) as gzfile:
                content = gzfile.read()
        if self.cache is not None and (not nocache):
            if url not in self.cache:
                self.cache.insert_blob(url, content)
        return content.decode(encoding) if content and encoding else content
    except URLError as e:
        if hasattr(e, 'reason'):
            getLogger().exception('We failed to reach {}. Reason: {}'.format(url, e.reason))
        elif hasattr(e, 'code'):
            getLogger().exception("The server couldn't fulfill the request. Error code: {}".format(e.code))
        else:
            getLogger().exception('Fetching error')
        if not quiet:
            raise
    return None


Input:
CODE <module>()
  RESUME 0
  LOAD_CONST (False, False)
  LOAD_CONST <code download>
  MAKE_FUNCTION defaults
  STORE_NAME download
  RETURN_CONST None
END
CODE download(self, url, path, force_refetch, nocache)
  DOC 'pass'
  RESUME 0
  LOAD_GLOBAL os
  LOAD_ATTR path
  LOAD_ATTR NULL|self + isfile
  LOAD_FAST path
  CALL 1
  POP_JUMP_IF_FALSE L1
  LOAD_GLOBAL NULL + getLogger
  CALL 0
  LOAD_ATTR NULL|self + info
  LOAD_CONST 'File exists, download task skipped -> {path}'
  LOAD_ATTR NULL|self + format
  LOAD_FAST path
  KW_NAMES ('path',)
  CALL 1
  CALL 1
  POP_TOP
  RETURN_CONST True
L1:
  NOP
L2:
  LOAD_GLOBAL NULL + getLogger
  CALL 0
  LOAD_ATTR NULL|self + info
  LOAD_CONST 'Downloading: {url} -> {path}'
  LOAD_ATTR NULL|self + format
  LOAD_FAST url
  LOAD_FAST path
  KW_NAMES ('url', 'path')
  CALL 2
  CALL 1
  POP_TOP
  LOAD_FAST self
  LOAD_ATTR NULL|self + fetch
  LOAD_FAST url
  LOAD_FAST force_refetch
  LOAD_FAST nocache
  KW_NAMES ('force_refetch', 'nocache')
  CALL 3
  STORE_FAST response
  LOAD_FAST response
  POP_JUMP_IF_NONE L4
  LOAD_GLOBAL NULL + open
  LOAD_FAST path
  LOAD_CONST 'wb'
  CALL 2
  STORE_FAST local_file
  LOAD_FAST local_file
  LOAD_ATTR NULL|self + write
  LOAD_FAST response
  CALL 1
  POP_TOP
  LOAD_FAST local_file
  LOAD_ATTR NULL|self + close
  CALL 0
  POP_TOP
L3:
  RETURN_CONST True
L4:
  RETURN_CONST False
L5:
  PUSH_EXC_INFO
  LOAD_GLOBAL Exception
  CHECK_EXC_MATCH
  POP_JUMP_IF_FALSE L11
  STORE_FAST e
L6:
  LOAD_GLOBAL NULL + hasattr
  LOAD_FAST e
  LOAD_CONST 'reason'
  CALL 2
  POP_JUMP_IF_FALSE L7
  LOAD_GLOBAL NULL + getLogger
  CALL 0
  LOAD_ATTR NULL|self + exception
  LOAD_CONST 'We failed to reach a server. Reason: '
  LOAD_FAST e
  LOAD_ATTR reason
  FORMAT_VALUE str
  BUILD_STRING 2
  CALL 1
  POP_TOP
  JUMP_FORWARD L9
L7:
  LOAD_GLOBAL NULL + hasattr
  LOAD_FAST e
  LOAD_CONST 'code'
  CALL 2
  POP_JUMP_IF_FALSE L8
  LOAD_GLOBAL NULL + getLogger
  CALL 0
  LOAD_ATTR NULL|self + exception
  LOAD_CONST "The server couldn't fulfill the request. Error code: {code}"
  LOAD_ATTR NULL|self + format
  LOAD_FAST e
  LOAD_ATTR code
  KW_NAMES ('code',)
  CALL 1
  CALL 1
  POP_TOP
  JUMP_FORWARD L9
L8:
  LOAD_GLOBAL NULL + getLogger
  CALL 0
  LOAD_ATTR NULL|self + exception
  LOAD_CONST 'Unknown error: '
  LOAD_FAST e
  FORMAT_VALUE str
  BUILD_STRING 2
  CALL 1
  POP_TOP
L9:
  POP_EXCEPT
  LOAD_CONST None
  STORE_FAST e
  DELETE_FAST e
  RETURN_CONST False
L10:
  LOAD_CONST None
  STORE_FAST e
  DELETE_FAST e
  RERAISE 1
L11:
  RERAISE 0
L12:
  COPY 3
  POP_EXCEPT
  RERAISE 1
  EXC try=L2..L3 -> handler=L5 depth=0 lasti=False
  EXC try=L5..L6 -> handler=L12 depth=1 lasti=True
  EXC try=L6..L9 -> handler=L10 depth=1 lasti=True
  EXC try=L10..L12 -> handler=L12 depth=1 lasti=True
END

def download(self, url, path, force_refetch=False, nocache=False):
    """pass"""
    if os.path.isfile(path):
        getLogger().info('File exists, download task skipped -> {path}'.format(path=path))
        return True
    try:
        getLogger().info('Downloading: {url} -> {path}'.format(url=url, path=path))
        response = self.fetch(url, force_refetch=force_refetch, nocache=nocache)
        if response is not None:
            local_file = open(path, 'wb')
            local_file.write(response)
            local_file.close()
            return True
        else:
            return False
    except Exception as e:
        if hasattr(e, 'reason'):
            getLogger().exception('We failed to reach a server. Reason: %s' % (e.reason,))
        elif hasattr(e, 'code'):
            getLogger().exception("The server couldn't fulfill the request. Error code: {code}".format(code=e.code))
        else:
            getLogger().exception('Unknown error: %s' % (e,))
    return False


Input:
CODE <module>()
  DOC 'return'
  RESUME 0
  LOAD_CONST 'return'
  LOAD_NAME Optional
  LOAD_NAME str
  BINARY_SUBSCR
  BUILD_TUPLE 2
  LOAD_CONST <code _platform>
  MAKE_FUNCTION annotations
  STORE_NAME _platform
  RETURN_CONST None
END
CODE _platform(self)
  DOC 'pass'
  RESUME 0
  NOP
L1:
  LOAD_GLOBAL NULL + str
  LOAD_FAST self
  LOAD_ATTR journey
  LOAD_ATTR MainStop
  LOAD_ATTR BasicStop
  LOAD_ATTR Dep
  LOAD_ATTR Platform
  LOAD_ATTR text
  CALL 1
L2:
  RETURN_VALUE
L3:
  PUSH_EXC_INFO
  LOAD_GLOBAL AttributeError
  CHECK_EXC_MATCH
  POP_JUMP_IF_FALSE L5
  POP_TOP
L4:
  POP_EXCEPT
  RETURN_CONST None
L5:
  RERAISE 0
L6:
  COPY 3
  POP_EXCEPT
  RERAISE 1
  EXC try=L1..L2 -> handler=L3 depth=0 lasti=False
  EXC try=L3..L4 -> handler=L6 depth=1 lasti=True
  EXC try=L5..L6 -> handler=L6 depth=1 lasti=True
END

def _platform(self) -> Optional[str]:
    """pass"""
    try:
        return str(self.journey.MainStop.BasicStop.Dep.Platform.text)
    except AttributeError:
        return None


Input:
CODE <module>()
  DOC 'return'
  RESUME 0
  LOAD_CONST 'return'
  LOAD_NAME int
  BUILD_TUPLE 2
  LOAD_CONST <code _delay>
  MAKE_FUNCTION annotations
  STORE_NAME _delay
  RETURN_CONST None
END
CODE _delay(self)
  DOC 'pass'
  RESUME 0
  NOP
L1:
  LOAD_GLOBAL NULL + int
  LOAD_FAST self
  LOAD_ATTR journey
  LOAD_ATTR MainStop
  LOAD_ATTR BasicStop
  LOAD_ATTR Dep
  LOAD_ATTR Delay
  LOAD_ATTR text
  CALL 1
L2:
  RETURN_VALUE
L3:
  PUSH_EXC_INFO
  LOAD_GLOBAL AttributeError
  CHECK_EXC_MATCH
  POP_JUMP_IF_FALSE L5
  POP_TOP
L4:
  POP_EXCEPT
  RETURN_CONST 0
L5:
  RERAISE 0
L6:
  COPY 3
  POP_EXCEPT
  RERAISE 1
  EXC try=L1..L2 -> handler=L3 depth=0 lasti=False
  EXC try=L3..L4 -> handler=L6 depth=1 lasti=True
  EXC try=L5..L6 -> handler=L6 depth=1 lasti=True
END

def _delay(self) -> int:
    """pass"""
    try:
        return int(self.journey.MainStop.BasicStop.Dep.Delay.text)
    except AttributeError:
        return 0


Input:
CODE <module>()
  DOC 'return'
  RESUME 0
  LOAD_CONST 'return'
  LOAD_NAME datetime
  BUILD_TUPLE 2
  LOAD_CONST <code _departure>
  MAKE_FUNCTION annotations
  STORE_NAME _departure
  RETURN_CONST None
END
CODE _departure(self)
  DOC 'pass'
  RESUME 0
  LOAD_GLOBAL datetime
  LOAD_ATTR NULL|self + strptime
  LOAD_FAST self
  LOAD_ATTR journey
  LOAD_ATTR MainStop
  LOAD_ATTR BasicStop
  LOAD_ATTR Dep
  LOAD_ATTR Time
  LOAD_ATTR text
  LOAD_CONST '%H:%M'
  CALL 2
  LOAD_ATTR NULL|self + time
  CALL 0
  STORE_FAST departure_time
  LOAD_FAST departure_time
  LOAD_FAST self
  LOAD_ATTR now
  LOAD_GLOBAL NULL + timedelta
  LOAD_CONST 1
  KW_NAMES ('hours',)
  CALL 1
  BINARY_OP -
  LOAD_ATTR NULL|self + time
  CALL 0
  COMPARE_OP >
  POP_JUMP_IF_FALSE L1
  LOAD_GLOBAL datetime
  LOAD_ATTR NULL|self + combine
  LOAD_FAST self
  LOAD_ATTR now
  LOAD_ATTR NULL|self + date
  CALL 0
  LOAD_FAST departure_time
  CALL 2
  RETURN_VALUE
L1:
  LOAD_GLOBAL datetime
  LOAD_ATTR NULL|self + combine
  LOAD_FAST self
  LOAD_ATTR now
  LOAD_ATTR NULL|self + date
  CALL 0
  LOAD_GLOBAL NULL + timedelta
  LOAD_CONST 1
  KW_NAMES ('days',)
  CALL 1
  BINARY_OP +
  LOAD_FAST departure_time
  CALL 2
  RETURN_VALUE
END

def _departure(self) -> datetime:
    """pass"""
    departure_time = datetime.strptime(self.journey.MainStop.BasicStop.Dep.Time.text, '%H:%M').time()
    if departure_time > (self.now - timedelta(hours=1)).time():
        return datetime.combine(self.now.date(), departure_time)
    return datetime.combine(self.now.date() + timedelta(days=1), departure_time)


Input:
CODE <module>()
  DOC 'return'
  RESUME 0
  LOAD_CONST 'return'
  LOAD_NAME str
  BUILD_TUPLE 2
  LOAD_CONST <code _extract>
  MAKE_FUNCTION annotations
  STORE_NAME _extract
  RETURN_CONST None
END
CODE _extract(self, attribute)
  DOC 'pass'
  RESUME 0
  LOAD_FAST self
  LOAD_ATTR journey
  LOAD_ATTR JourneyAttributeList
  LOAD_ATTR JourneyAttribute
  LOAD_FAST self
  LOAD_ATTR attr_types
  LOAD_ATTR NULL|self + index
  LOAD_FAST attribute
  CALL 1
  BINARY_SUBSCR
  LOAD_ATTR Attribute
  STORE_FAST attr_data
  LOAD_FAST attr_data
  LOAD_ATTR NULL|self + xpath
  LOAD_CONST 'AttributeVariant/@type'
  CALL 1
  STORE_FAST attr_variants
  LOAD_FAST attr_data
  LOAD_ATTR AttributeVariant
  LOAD_FAST attr_variants
  LOAD_ATTR NULL|self + index
  LOAD_CONST 'NORMAL'
  CALL 1
  BINARY_SUBSCR
  LOAD_ATTR Text
  LOAD_ATTR pyval
  STORE_FAST data
  LOAD_GLOBAL NULL + str
  LOAD_FAST data
  CALL 1
  RETURN_VALUE
END

def _extract(self, attribute) -> str:
    """pass"""
    attr_data = self.journey.JourneyAttributeList.JourneyAttribute[self.attr_types.index(attribute)].Attribute
    attr_variants = attr_data.xpath('AttributeVariant/@type')
    data = attr_data.AttributeVariant[attr_variants.index('NORMAL')].Text.pyval
    return str(data)


Input:
CODE <module>()
  DOC 'return'
  RESUME 0
  LOAD_CONST 'return'
  LOAD_NAME Optional
  LOAD_NAME str
  BINARY_SUBSCR
  BUILD_TUPLE 2
  LOAD_CONST <code _info>
  MAKE_FUNCTION annotations
  STORE_NAME _info
  RETURN_CONST None
END
CODE _info(self)
  DOC 'pass'
  RESUME 0
  NOP
L1:
  LOAD_GLOBAL NULL + str
  LOAD_GLOBAL html
  LOAD_ATTR NULL|self + unescape
  LOAD_FAST self
  LOAD_ATTR journey
  LOAD_ATTR InfoTextList
  LOAD_ATTR InfoText
  LOAD_ATTR NULL|self + get
  LOAD_CONST 'text'
  CALL 1
  CALL 1
  CALL 1
L2:
  RETURN_VALUE
L3:
  PUSH_EXC_INFO
  LOAD_GLOBAL AttributeError
  CHECK_EXC_MATCH
  POP_JUMP_IF_FALSE L5
  POP_TOP
L4:
  POP_EXCEPT
  RETURN_CONST None
L5:
  RERAISE 0
L6:
  COPY 3
  POP_EXCEPT
  RERAISE 1
  EXC try=L1..L2 -> handler=L3 depth=0 lasti=False
  EXC try=L3..L4 -> handler=L6 depth=1 lasti=True
  EXC try=L5..L6 -> handler=L6 depth=1 lasti=True
END

def _info(self) -> Optional[str]:
    """pass"""
    try:
        return str(html.unescape(self.journey.InfoTextList.InfoText.get('text')))
    except AttributeError:
        return None


Input:
CODE <module>()
  DOC 'return'
  RESUME 0
  LOAD_CONST 'return'
  LOAD_NAME Optional
  LOAD_NAME str
  BINARY_SUBSCR
  BUILD_TUPLE 2
  LOAD_CONST <code _info_long>
  MAKE_FUNCTION annotations
  STORE_NAME _info_long
  RETURN_CONST None
END
CODE _info_long(self)
  DOC 'pass'
  RESUME 0
  NOP
L1:
  LOAD_GLOBAL NULL + str
  LOAD_GLOBAL html
  LOAD_ATTR NULL|self + unescape
  LOAD_FAST self
  LOAD_ATTR journey
  LOAD_ATTR InfoTextList
  LOAD_ATTR InfoText
  LOAD_ATTR NULL|self + get
  LOAD_CONST 'textL'
  CALL 1
  CALL 1
  LOAD_ATTR NULL|self + replace
  LOAD_CONST '<br />'
  LOAD_CONST '\n'
  CALL 2
  CALL 1
L2:
  RETURN_VALUE
L3:
  PUSH_EXC_INFO
  LOAD_GLOBAL AttributeError
  CHECK_EXC_MATCH
  POP_JUMP_IF_FALSE L5
  POP_TOP
L4:
  POP_EXCEPT
  RETURN_CONST None
L5:
  RERAISE 0
L6:
  COPY 3
  POP_EXCEPT
  RERAISE 1
  EXC try=L1..L2 -> handler=L3 depth=0 lasti=False
  EXC try=L3..L4 -> handler=L6 depth=1 lasti=True
  EXC try=L5..L6 -> handler=L6 depth=1 lasti=True
END

def _info_long(self) -> Optional[str]:
    """pass"""
    try:
        return str(html.unescape(self.journey.InfoTextList.InfoText.get('textL')).replace('<br />', '\n'))
    except AttributeError:
        return None


Input:
CODE <module>()
  RESUME 0
  LOAD_CONST <code validate>
  MAKE_FUNCTION 0
  STORE_NAME validate
  RETURN_CONST None
END
CODE validate(style)
  DOC 'pass'
  RESUME 0
  NOP
L1:
  LOAD_CONST 0
  LOAD_CONST None
  IMPORT_NAME jsonschema
  STORE_FAST jsonschema
L2:
  NOP
L3:
  LOAD_FAST jsonschema
  LOAD_ATTR NULL|self + validate
  LOAD_FAST style
  LOAD_GLOBAL schema
  CALL 2
  POP_TOP
L4:
  RETURN_CONST None
L5:
  PUSH_EXC_INFO
  LOAD_GLOBAL ImportError
  CHECK_EXC_MATCH
  POP_JUMP_IF_FALSE L7
  POP_TOP
L6:
  POP_EXCEPT
  RETURN_CONST None
L7:
  RERAISE 0
L8:
  COPY 3
  POP_EXCEPT
  RERAISE 1
L9:
  PUSH_EXC_INFO
  LOAD_FAST jsonschema
  LOAD_ATTR ValidationError
  CHECK_EXC_MATCH
  POP_JUMP_IF_FALSE L12
  STORE_FAST exc
L10:
  LOAD_GLOBAL NULL + StyleValidationError
  LOAD_FAST exc
  CALL 1
  STORE_FAST new_exc
  LOAD_CONST None
  LOAD_FAST new_exc
  STORE_ATTR __cause__
  LOAD_FAST new_exc
  RAISE_VARARGS 1
L11:
  LOAD_CONST None
  STORE_FAST exc
  DELETE_FAST exc
  RERAISE 1
L12:
  RERAISE 0
L13:
  COPY 3
  POP_EXCEPT
  RERAISE 1
  EXC try=L1..L2 -> handler=L5 depth=0 lasti=False
  EXC try=L3..L4 -> handler=L9 depth=0 lasti=False
  EXC try=L5..L6 -> handler=L8 depth=1 lasti=True
  EXC try=L7..L8 -> handler=L8 depth=1 lasti=True
  EXC try=L9..L10 -> handler=L13 depth=1 lasti=True
  EXC try=L10..L11 -> handler=L11 depth=1 lasti=True
  EXC try=L11..L13 -> handler=L13 depth=1 lasti=True
END

def validate(style):
    """pass"""
    try:
        import jsonschema
    except ImportError:
        return
    try:
        jsonschema.validate(style, schema)
    except jsonschema.ValidationError as exc:
        new_exc = StyleValidationError(exc)
        new_exc.__cause__ = None
        raise new_exc


Input:
CODE <module>()
  RESUME 0
  LOAD_CONST <code value_type>
  MAKE_FUNCTION 0
  STORE_NAME value_type
  RETURN_CONST None
END
CODE value_type(value)
  DOC 'pass'
  RESUME 0
  NOP
L1:
  LOAD_GLOBAL NULL + list
  LOAD_FAST value
  LOAD_ATTR NULL|self + keys
  CALL 0
  CALL 1
  STORE_FAST keys
L2:
  LOAD_FAST keys
  LOAD_CONST 'lookup'
  BUILD_LIST 1
  LOAD_CONST 're_lookup'
  BUILD_LIST 1
  LOAD_CONST 'interval'
  BUILD_LIST 1
  BUILD_TUPLE 3
  CONTAINS_OP 0
  POP_JUMP_IF_FALSE L3
  LOAD_FAST keys
  LOAD_CONST 0
  BINARY_SUBSCR
  RETURN_VALUE
L3:
  LOAD_GLOBAL NULL + ValueError
  LOAD_CONST 'Type of `value` could not be determined'
  CALL 1
  RAISE_VARARGS 1
L4:
  PUSH_EXC_INFO
  LOAD_GLOBAL AttributeError
  CHECK_EXC_MATCH
  POP_JUMP_IF_FALSE L6
  POP_TOP
L5:
  POP_EXCEPT
  RETURN_CONST 'simple'
L6:
  RERAISE 0
L7:
  COPY 3
  POP_EXCEPT
  RERAISE 1
  EXC try=L1..L2 -> handler=L4 depth=0 lasti=False
  EXC try=L4..L5 -> handler=L7 depth=1 lasti=True
  EXC try=L6..L7 -> handler=L7 depth=1 lasti=True
END

def value_type(value):
    """pass"""
    try:
        keys = list(value.keys())
    except AttributeError:
        return 'simple'
    if keys in [['lookup'], ['re_lookup'], ['interval']]:
        return keys[0]
    raise ValueError('Type of `value` could not be determined')


Input:
CODE <module>()
  RESUME 0
  LOAD_CONST <code _register_mecab_loc>
  MAKE_FUNCTION 0
  STORE_NAME _register_mecab_loc
  RETURN_CONST None
END
CODE _register_mecab_loc(location)
  DOC 'pass'
  RESUME 0
  LOAD_GLOBAL os
  LOAD_ATTR path
  LOAD_ATTR NULL|self + isfile
  LOAD_FAST location
  CALL 1
  POP_JUMP_IF_TRUE L1
  LOAD_GLOBAL logging
  LOAD_ATTR NULL|self + getLogger
  LOAD_GLOBAL __name__
  CALL 1
  LOAD_ATTR NULL|self + warning
  LOAD_CONST 'Provided mecab binary location does not exist {}'
  LOAD_ATTR NULL|self + format
  LOAD_FAST location
  CALL 1
  CALL 1
  POP_TOP
L1:
  LOAD_GLOBAL logging
  LOAD_ATTR NULL|self + getLogger
  LOAD_GLOBAL __name__
  CALL 1
  LOAD_ATTR NULL|self + info
  LOAD_CONST 'Mecab binary is switched to: {}'
  LOAD_ATTR NULL|self + format
  LOAD_FAST location
  CALL 1
  CALL 1
  POP_TOP
  LOAD_FAST location
  STORE_GLOBAL MECAB_LOC
  RETURN_CONST None
END

def _register_mecab_loc(location):
    """pass"""
    global MECAB_LOC
    if not os.path.isfile(location):
        logging.getLogger(__name__).warning('Provided mecab binary location does not exist {}'.format(location))
    logging.getLogger(__name__).info('Mecab binary is switched to: {}'.format(location))
    MECAB_LOC = location


Input:
CODE <module>()
  RESUME 0
  LOAD_CONST <code run_mecab_process>
  MAKE_FUNCTION 0
  STORE_NAME run_mecab_process
  RETURN_CONST None
END
CODE run_mecab_process(content, *args, **kwargs)
  DOC 'pass'
  RESUME 0
  LOAD_CONST 'encoding'
  LOAD_FAST kwargs
  CONTAINS_OP 1
  POP_JUMP_IF_FALSE L1
  LOAD_CONST 'utf-8'
  JUMP_FORWARD L2
L1:
  LOAD_FAST kwargs
  LOAD_CONST 'encoding'
  BINARY_SUBSCR
L2:
  STORE_FAST encoding
  LOAD_CONST 'mecab_loc'
  LOAD_FAST kwargs
  CONTAINS_OP 0
  POP_JUMP_IF_FALSE L3
  LOAD_FAST kwargs
  LOAD_CONST 'mecab_loc'
  BINARY_SUBSCR
  JUMP_FORWARD L4
L3:
  LOAD_CONST None
L4:
  STORE_FAST mecab_loc
  LOAD_FAST mecab_loc
  POP_JUMP_IF_NOT_NONE L5
  LOAD_GLOBAL MECAB_LOC
  STORE_FAST mecab_loc
L5:
  LOAD_FAST mecab_loc
  BUILD_LIST 1
  STORE_FAST proc_args
  LOAD_FAST args
  POP_JUMP_IF_FALSE L6
  LOAD_FAST proc_args
  LOAD_ATTR NULL|self + extend
  LOAD_FAST args
  CALL 1
  POP_TOP
L6:
  LOAD_GLOBAL subprocess
  LOAD_ATTR NULL|self + run
  LOAD_FAST proc_args
  LOAD_FAST content
  LOAD_ATTR NULL|self + encode
  LOAD_FAST encoding
  CALL 1
  LOAD_GLOBAL subprocess
  LOAD_ATTR PIPE
  KW_NAMES ('input', 'stdout')
  CALL 3
  STORE_FAST output
  LOAD_GLOBAL os
  LOAD_ATTR linesep
  LOAD_ATTR NULL|self + join
  LOAD_FAST output
  LOAD_ATTR stdout
  LOAD_ATTR NULL|self + decode
  LOAD_FAST encoding
  CALL 1
  LOAD_ATTR NULL|self + splitlines
  CALL 0
  CALL 1
  STORE_FAST output_string
  LOAD_FAST output_string
  RETURN_VALUE
END

def run_mecab_process(content, *args, **kwargs):
    """pass"""
    encoding = 'utf-8' if 'encoding' not in kwargs else kwargs['encoding']
    mecab_loc = kwargs['mecab_loc'] if 'mecab_loc' in kwargs else None
    if mecab_loc is None:
        mecab_loc = MECAB_LOC
    proc_args = [mecab_loc]
    if args:
        proc_args.extend(args)
    output = subprocess.run(proc_args, input=content.encode(encoding), stdout=subprocess.PIPE)
    output_string = os.linesep.join(output.stdout.decode(encoding).splitlines())
    return output_string


Input:
CODE <module>()
  RESUME 0
  LOAD_CONST <code parse>
  MAKE_FUNCTION 0
  STORE_NAME parse
  RETURN_CONST None
END
CODE parse(content, *args, **kwargs)
  DOC 'pass'
  RESUME 0
  LOAD_CONST 'mecab_loc'
  LOAD_FAST kwargs
  CONTAINS_OP 1
  POP_JUMP_IF_FALSE L1
  LOAD_GLOBAL MECAB_PYTHON3
  POP_JUMP_IF_FALSE L1
  LOAD_CONST 'MeCab'
  LOAD_GLOBAL NULL + globals
  CALL 0
  CONTAINS_OP 0
  POP_JUMP_IF_FALSE L1
  LOAD_GLOBAL NULL + MeCab
  LOAD_ATTR Tagger
  LOAD_FAST args
  CALL_FUNCTION_EX 0
  LOAD_ATTR NULL|self + parse
  LOAD_FAST content
  CALL 1
  RETURN_VALUE
L1:
  LOAD_GLOBAL NULL + run_mecab_process
  LOAD_FAST content
  BUILD_LIST 1
  LOAD_FAST args
  LIST_EXTEND 1
  CALL_INTRINSIC_1 INTRINSIC_LIST_TO_TUPLE
  BUILD_MAP 0
  LOAD_FAST kwargs
  DICT_MERGE 1
  CALL_FUNCTION_EX 1
  RETURN_VALUE
END

def parse(content, *args, **kwargs):
    """pass"""
    global MECAB_PYTHON3
    if 'mecab_loc' not in kwargs and MECAB_PYTHON3 and ('MeCab' in globals()):
        return MeCab.Tagger(*args).parse(content)
    else:
        return run_mecab_process(content, *args, **kwargs)


Input:
CODE <module>()
  RESUME 0
  LOAD_CONST (None, None)
  LOAD_CONST <code create_track>
  MAKE_FUNCTION defaults
  STORE_NAME create_track
  RETURN_CONST None
END
CODE create_track(self, path_in_ipod, checksum)
  DOC 'pass'
  RESUME 0
  LOAD_GLOBAL NULL + bool
  LOAD_FAST path_in_ipod
  CALL 1
  LOAD_GLOBAL NULL + bool
  LOAD_FAST checksum
  CALL 1
  COMPARE_OP ==
  POP_JUMP_IF_FALSE L1
  LOAD_GLOBAL Exception
  RAISE_VARARGS 1
L1:
  LOAD_FAST path_in_ipod
  POP_JUMP_IF_TRUE L2
  LOAD_FAST self
  LOAD_ATTR audiodb
  LOAD_ATTR NULL|self + get_voice
  LOAD_FAST checksum
  CALL 1
  STORE_FAST path_in_ipod
L2:
  LOAD_GLOBAL NULL + Track
  LOAD_FAST self
  LOAD_FAST path_in_ipod
  KW_NAMES ('path_in_ipod',)
  CALL 2
  STORE_FAST track
  LOAD_FAST track
  RETURN_VALUE
END

def create_track(self, path_in_ipod=None, checksum=None):
    """pass"""
    if bool(path_in_ipod) == bool(checksum):
        raise Exception
    if not path_in_ipod:
        path_in_ipod = self.audiodb.get_voice(checksum)
    track = Track(self, path_in_ipod=path_in_ipod)
    return track


Input:
CODE <module>()
  RESUME 0
  LOAD_CONST <code voice>
  MAKE_FUNCTION 0
  STORE_NAME voice
  RETURN_CONST None
END
CODE voice(self)
  DOC 'pass'
  RESUME 0
  LOAD_FAST self
  LOAD_ATTR lldb
  LOAD_ATTR dbid
  STORE_FAST dbid
  LOAD_FAST self
  LOAD_ATTR _voiceoverdb
  LOAD_ATTR NULL|self + get_text_lang
  LOAD_FAST dbid
  CALL 1
  UNPACK_SEQUENCE 2
  STORE_FAST text
  STORE_FAST lang
  LOAD_FAST text
  LOAD_FAST lang
  BUILD_TUPLE 2
  RETURN_VALUE
END

def voice(self):
    """pass"""
    dbid = self.lldb.dbid
    text, lang = self._voiceoverdb.get_text_lang(dbid)
    return (text, lang)


Input:
CODE <module>()
  RESUME 0
  LOAD_CONST <code add>
  MAKE_FUNCTION 0
  STORE_NAME add
  RETURN_CONST None
END
CODE add(self, src)
  DOC 'pass'
  RESUME 0
  LOAD_GLOBAL audio
  LOAD_ATTR NULL|self + get_type
  LOAD_FAST src
  CALL 1
  POP_JUMP_IF_TRUE L1
  LOAD_GLOBAL NULL + TypeError
  LOAD_CONST 'The type of this file is not supported.'
  CALL 1
  RAISE_VARARGS 1
L1:
  LOAD_GLOBAL NULL + super
  CALL 0
  LOAD_ATTR NULL|self + add
  LOAD_FAST src
  CALL 1
  RETURN_VALUE
END

def add(self, src):
    """pass"""
    if not audio.get_type(src):
        raise TypeError('The type of this file is not supported.')
    return super().add(src)


Input:
CODE <module>()
  RESUME 0
  LOAD_CONST <code _get_cmd>
  MAKE_FUNCTION 0
  STORE_NAME _get_cmd
  RETURN_CONST None
END
CODE _get_cmd(command, arguments)
  DOC 'pass'
  RESUME 0
  LOAD_FAST arguments
  POP_JUMP_IF_NOT_NONE L1
  BUILD_LIST 0
  STORE_FAST arguments
L1:
  LOAD_FAST command
  LOAD_ATTR NULL|self + endswith
  LOAD_CONST '.py'
  CALL 1
  POP_JUMP_IF_TRUE L2
  LOAD_FAST command
  LOAD_ATTR NULL|self + endswith
  LOAD_CONST '.pyw'
  CALL 1
  POP_JUMP_IF_FALSE L3
L2:
  LOAD_GLOBAL sys
  LOAD_ATTR executable
  LOAD_FAST command
  BUILD_LIST 2
  LOAD_GLOBAL NULL + list
  LOAD_FAST arguments
  CALL 1
  BINARY_OP +
  RETURN_VALUE
L3:
  LOAD_FAST command
  BUILD_LIST 1
  LOAD_GLOBAL NULL + list
  LOAD_FAST arguments
  CALL 1
  BINARY_OP +
  RETURN_VALUE
END

def _get_cmd(command, arguments):
    """pass"""
    if arguments is None:
        arguments = []
    if command.endswith('.py') or command.endswith('.pyw'):
        return [sys.executable, command] + list(arguments)
    else:
        return [command] + list(arguments)


Input:
CODE <module>()
  RESUME 0
  LOAD_CONST <code argparse>
  MAKE_FUNCTION 0
  STORE_NAME argparse
  RETURN_CONST None
END
CODE argparse(argv, parser, arguments)
  DOC 'pass'
  MAKE_CELL add_arg
  MAKE_CELL parse_request
  RESUME 0
  LOAD_CONST <code argparse.<locals>.add_arg>
  MAKE_FUNCTION 0
  STORE_DEREF add_arg
  LOAD_FAST parser
  LOAD_ATTR NULL|self + map
  LOAD_CONST <code argparse.<locals>.<lambda>>
  MAKE_FUNCTION 0
  CALL 1
  LOAD_ATTR NULL|self + combine_latest
  LOAD_FAST arguments
  LOAD_CLOSURE add_arg
  BUILD_TUPLE 1
  LOAD_CONST <code argparse.<locals>.<lambda>>
  MAKE_FUNCTION closure
  CALL 2
  LOAD_ATTR NULL|self + last
  CALL 0
  LOAD_ATTR NULL|self + combine_latest
  LOAD_FAST argv
  LOAD_ATTR NULL|self + to_list
  CALL 0
  LOAD_CONST <code argparse.<locals>.<lambda>>
  MAKE_FUNCTION 0
  CALL 2
  STORE_DEREF parse_request
  LOAD_CLOSURE parse_request
  BUILD_TUPLE 1
  LOAD_CONST <code argparse.<locals>.subscribe>
  MAKE_FUNCTION closure
  STORE_FAST subscribe
  LOAD_GLOBAL NULL + AnonymousObservable
  LOAD_FAST subscribe
  CALL 1
  RETURN_VALUE
END
CODE argparse.<locals>.add_arg(parser, arg_spec)
  RESUME 0
  LOAD_FAST parser
  LOAD_ATTR NULL|self + add_argument
  LOAD_FAST arg_spec
  LOAD_ATTR name
  LOAD_FAST arg_spec
  LOAD_ATTR help
  KW_NAMES ('help',)
  CALL 2
  POP_TOP
  LOAD_FAST parser
  RETURN_VALUE
END
CODE argparse.<locals>.<lambda>(i)
  RESUME 0
  LOAD_GLOBAL NULL + ArgumentParser
  LOAD_FAST i
  LOAD_ATTR description
  KW_NAMES ('description',)
  CALL 1
  RETURN_VALUE
END
CODE argparse.<locals>.<lambda>(parser, arg_def)
  COPY_FREE_VARS 1
  RESUME 0
  PUSH_NULL
  LOAD_DEREF add_arg
  LOAD_FAST parser
  LOAD_FAST arg_def
  CALL 2
  RETURN_VALUE
END
CODE argparse.<locals>.<lambda>(parser, args)
  RESUME 0
  LOAD_FAST parser
  LOAD_FAST args
  BUILD_TUPLE 2
  RETURN_VALUE
END
CODE argparse.<locals>.subscribe(observer)
  COPY_FREE_VARS 1
  MAKE_CELL observer
  RESUME 0
  LOAD_CLOSURE observer
  BUILD_TUPLE 1
  LOAD_CONST <code argparse.<locals>.subscribe.<locals>.on_next>
  MAKE_FUNCTION closure
  STORE_FAST on_next
  LOAD_DEREF parse_request
  LOAD_ATTR NULL|self + subscribe
  LOAD_FAST on_next
  LOAD_DEREF observer
  LOAD_ATTR on_error
  LOAD_DEREF observer
  LOAD_ATTR on_completed
  CALL 3
  RETURN_VALUE
END
CODE argparse.<locals>.subscribe.<locals>.on_next(value)
  COPY_FREE_VARS 1
  RESUME 0
  LOAD_FAST value
  UNPACK_SEQUENCE 2
  STORE_FAST parser
  STORE_FAST args
  NOP
L1:
  LOAD_FAST parser
  LOAD_ATTR NULL|self + parse_args
  LOAD_FAST args
  CALL 1
  STORE_FAST args
  LOAD_GLOBAL NULL + vars
  LOAD_FAST args
  CALL 1
  LOAD_ATTR NULL|self + items
  CALL 0
  GET_ITER
L2:
  FOR_ITER L3
  UNPACK_SEQUENCE 2
  STORE_FAST key
  STORE_FAST value
  LOAD_DEREF observer
  LOAD_ATTR NULL|self + on_next
  LOAD_GLOBAL NULL + Argument
  LOAD_FAST key
  LOAD_FAST value
  KW_NAMES ('key', 'value')
  CALL 2
  CALL 1
  POP_TOP
  JUMP_BACKWARD L2
L3:
  END_FOR
L4:
  RETURN_CONST None
L5:
  PUSH_EXC_INFO
  LOAD_GLOBAL NameError
  CHECK_EXC_MATCH
  POP_JUMP_IF_FALSE L9
  STORE_FAST exc
L6:
  LOAD_DEREF observer
  LOAD_ATTR NULL|self + on_error
  LOAD_CONST '{}\n{}'
  LOAD_ATTR NULL|self + format
  LOAD_FAST exc
  LOAD_FAST parser
  LOAD_ATTR NULL|self + format_help
  CALL 0
  CALL 2
  CALL 1
  POP_TOP
L7:
  POP_EXCEPT
  LOAD_CONST None
  STORE_FAST exc
  DELETE_FAST exc
  RETURN_CONST None
L8:
  LOAD_CONST None
  STORE_FAST exc
  DELETE_FAST exc
  RERAISE 1
L9:
  RERAISE 0
L10:
  COPY 3
  POP_EXCEPT
  RERAISE 1
  EXC try=L1..L4 -> handler=L5 depth=0 lasti=False
  EXC try=L5..L6 -> handler=L10 depth=1 lasti=True
  EXC try=L6..L7 -> handler=L8 depth=1 lasti=True
  EXC try=L8..L10 -> handler=L10 depth=1 lasti=True
END

def argparse(argv, parser, arguments):
    """pass"""

    def add_arg(parser, arg_spec):
        parser.add_argument(arg_spec.name, help=arg_spec.help)
        return parser
    parse_request = parser.map(lambda i: ArgumentParser(description=i.description)).combine_latest(arguments, lambda parser, arg_def: add_arg(parser, arg_def)).last().combine_latest(argv.to_list(), lambda parser, args: (parser, args))

    def subscribe(observer):

        def on_next(value):
            parser, args = value
            try:
                args = parser.parse_args(args)
                for key, value in vars(args).items():
                    observer.on_next(Argument(key=key, value=value))
            except NameError as exc:
                observer.on_error('{}\n{}'.format(exc, parser.format_help()))
        return parse_request.subscribe(on_next, observer.on_error, observer.on_completed)
    return AnonymousObservable(subscribe)


Input:
CODE <module>()
  RESUME 0
  LOAD_CONST <code qn>
  MAKE_FUNCTION 0
  STORE_NAME qn
  RETURN_CONST None
END
CODE qn(phi, *n)
  DOC 'pass'
  RESUME 0
  LOAD_GLOBAL np
  LOAD_ATTR NULL|self + ravel
  LOAD_FAST phi
  CALL 1
  STORE_FAST phi
  LOAD_GLOBAL np
  LOAD_ATTR NULL|self + asarray
  LOAD_FAST n
  CALL 1
  STORE_FAST n
  LOAD_GLOBAL np
  LOAD_ATTR NULL|self + zeros
  LOAD_FAST n
  LOAD_ATTR size
  LOAD_FAST phi
  LOAD_ATTR size
  BUILD_TUPLE 2
  LOAD_GLOBAL complex
  KW_NAMES ('dtype',)
  CALL 2
  STORE_FAST i_n_phi
  LOAD_GLOBAL np
  LOAD_ATTR NULL|self + outer
  LOAD_FAST n
  LOAD_FAST phi
  LOAD_FAST i_n_phi
  LOAD_ATTR imag
  KW_NAMES ('out',)
  CALL 3
  POP_TOP
  LOAD_GLOBAL np
  LOAD_ATTR NULL|self + exp
  LOAD_FAST i_n_phi
  LOAD_FAST i_n_phi
  KW_NAMES ('out',)
  CALL 2
  LOAD_ATTR NULL|self + sum
  LOAD_CONST 1
  KW_NAMES ('axis',)
  CALL 1
  STORE_FAST qn
  LOAD_FAST qn
  LOAD_ATTR size
  LOAD_CONST 1
  COMPARE_OP ==
  POP_JUMP_IF_FALSE L1
  LOAD_FAST qn
  LOAD_CONST 0
  BINARY_SUBSCR
  STORE_FAST qn
L1:
  LOAD_FAST qn
  RETURN_VALUE
END

def qn(phi, *n):
    """pass"""
    phi = np.ravel(phi)
    n = np.asarray(n)
    i_n_phi = np.zeros((n.size, phi.size), dtype=complex)
    np.outer(n, phi, out=i_n_phi.imag)
    qn = np.exp(i_n_phi, out=i_n_phi).sum(axis=1)
    if qn.size == 1:
        qn = qn[0]
    return qn


Input:
CODE <module>()
  RESUME 0
  LOAD_CONST (False,)
  LOAD_CONST <code correlation>
  MAKE_FUNCTION defaults
  STORE_NAME correlation
  RETURN_CONST None
END
CODE correlation(self, n, k, error)
  DOC 'pass'
  RESUME 0
  LOAD_FAST self
  LOAD_ATTR NULL|self + _calculate_corr
  LOAD_FAST n
  LOAD_FAST k
  CALL 2
  POP_TOP
  LOAD_FAST self
  LOAD_ATTR _corr
  LOAD_FAST n
  BINARY_SUBSCR
  LOAD_FAST k
  BINARY_SUBSCR
  STORE_FAST corr_nk
  LOAD_FAST error
  POP_JUMP_IF_FALSE L1
  LOAD_FAST self
  LOAD_ATTR NULL|self + _calculate_corr_err
  LOAD_FAST n
  LOAD_FAST k
  CALL 2
  POP_TOP
  LOAD_FAST corr_nk
  LOAD_FAST self
  LOAD_ATTR _corr_err
  LOAD_FAST n
  BINARY_SUBSCR
  LOAD_FAST k
  BINARY_SUBSCR
  BUILD_TUPLE 2
  RETURN_VALUE
L1:
  LOAD_FAST corr_nk
  RETURN_VALUE
END

def correlation(self, n, k, error=False):
    """pass"""
    self._calculate_corr(n, k)
    corr_nk = self._corr[n][k]
    if error:
        self._calculate_corr_err(n, k)
        return (corr_nk, self._corr_err[n][k])
    else:
        return corr_nk