# Path: src/rustypy/rswrapper/rswrapper.py
# FIND_TYPE = re.compile("type\((.*)\)")
# class TupleMeta(type):
# class Tuple(metaclass=TupleMeta):
# class OpaquePtr(object):
# class KrateData(object):
# class RustBinds(object):
#     class FnCall(object):
#     def __new__(mcs, name, bases, namespace, parameters=None):
#         def check_type(arg_t, **checkers):
#     def __init__(cls, *args, **kwds):
#     def __len__(self):
#     def __getitem__(self, parameters):
#     def __repr__(self):
#     def element_type(self, pos):
#     def __subclasscheck__(self, cls):
#     def __iter__(self):
#     def __next__(self):
#     def __new__(cls, *args, **kwds):
# def _get_signature_types(params):
#     def inner_types(t):
#     def non_empty(param):
# def _get_ptr_to_C_obj(obj, sig=None):
# def _extract_pytypes(ref, sig=False, call_fn=None, depth=0):
# def get_crate_entry(mod):
# def bind_rs_crate_funcs(mod, lib, prefixes=None):
#     def __init__(self, prefixes):
#     def __enter__(self):
#     def __exit__(self, exc_type, exc_value, traceback):
#     def __iter__(self):
#     def __next__(self):
#     def __init__(self, entry_point, compiled_lib, prefixes=None):
#         def __init__(self, name, argtypes, lib):
#         def __call__(self, *args, **kwargs):
#         def real_restype(self):
#         def restype(self):
#         def restype(self, annotation):
#         def argtypes(self):
#         def argtypes(self):
#         def add_argtype(self, position, hint):
#         def get_argtype(self, position):
#     def decl_C_args(FFI, params):
# 
# Path: src/rustypy/scripts.py
# def get_version():
#     import pkg_resources
#     try:
#         rustypy_ver = pkg_resources.require("rustypy")[0].version
#     except:
#         import os
#         import re
#         p = os.path.join(os.path.dirname(__file__), '__init__.py')
#         rustypy_ver = re.compile(r"^__version__ = '(.*)'")
#         with open(p) as f:
#             for l in f:
#                 ver = re.match(rustypy_ver, l)
#                 if ver:
#                     rustypy_ver = ver.group(1)
#                     break
#     return rustypy_ver
# 
# Path: src/rustypy/type_checkers.py
# def type_checkers(func):
#     @functools.wraps(func)
#     def checker(*args, **kwargs):
# 
#         checkers = {
#             "map_like": is_map_like,
#             "seq_like": is_seq_like,
#             "generic": is_generic,
#         }
# 
#         kwargs.update(checkers)
#         return func(*args, **kwargs)
#     return checker


import inspect
import os
import random
import sys
from collections import abc, namedtuple
from importlib import import_module, invalidate_caches
from io import StringIO
from string import Template, ascii_letters
from textwrap import dedent, indent
from types import FunctionType
from .rswrapper.rswrapper import Double, Float, Tuple
from .scripts import get_version
from .type_checkers import type_checkers

        self.m_dict = m_dict = {}
        if inspect.ismodule(self.root):
            module = self.root.__dict__
            module_objs = m_dict[self.root.__name__] = []
            imp_statement = module["__spec__"].name
            inspect_parameters()
        else:
            root, libname = os.path.split(self.root)
            sys.path.append(root)
            invalidate_caches()
            for f in self.pyfiles:
                self.__no_funcs = True
                # get the absolute import path and dynamically import it
                path, filename = os.path.split(f)
                rel_imp = [libname, None]
                while True:
                    path, tail = os.path.split(path)
                    if path == root or path == os.path.abspath(os.sep):
                        break
                    rel_imp.insert(1, tail)
                rel_imp = [s + '.' for s in rel_imp[:-1]]
                rel_imp.append(filename[:-3])
                imp_statement = "".join(rel_imp)
                module_objs = m_dict[imp_statement] = []
                module = import_module(imp_statement).__dict__
                inspect_parameters()
            sys.path.pop()

    def parse_parameter(self, p, pytypes=False):

# Path: src/rustypy/rswrapper/rswrapper.py
# FIND_TYPE = re.compile("type\((.*)\)")
# class TupleMeta(type):
# class Tuple(metaclass=TupleMeta):
# class OpaquePtr(object):
# class KrateData(object):
# class RustBinds(object):
#     class FnCall(object):
#     def __new__(mcs, name, bases, namespace, parameters=None):
#         def check_type(arg_t, **checkers):
#     def __init__(cls, *args, **kwds):
#     def __len__(self):
#     def __getitem__(self, parameters):
#     def __repr__(self):
#     def element_type(self, pos):
#     def __subclasscheck__(self, cls):
#     def __iter__(self):
#     def __next__(self):
#     def __new__(cls, *args, **kwds):
# def _get_signature_types(params):
#     def inner_types(t):
#     def non_empty(param):
# def _get_ptr_to_C_obj(obj, sig=None):
# def _extract_pytypes(ref, sig=False, call_fn=None, depth=0):
# def get_crate_entry(mod):
# def bind_rs_crate_funcs(mod, lib, prefixes=None):
#     def __init__(self, prefixes):
#     def __enter__(self):
#     def __exit__(self, exc_type, exc_value, traceback):
#     def __iter__(self):
#     def __next__(self):
#     def __init__(self, entry_point, compiled_lib, prefixes=None):
#         def __init__(self, name, argtypes, lib):
#         def __call__(self, *args, **kwargs):
#         def real_restype(self):
#         def restype(self):
#         def restype(self, annotation):
#         def argtypes(self):
#         def argtypes(self):
#         def add_argtype(self, position, hint):
#         def get_argtype(self, position):
#     def decl_C_args(FFI, params):
# 
# Path: src/rustypy/scripts.py
# def get_version():
#     import pkg_resources
#     try:
#         rustypy_ver = pkg_resources.require("rustypy")[0].version
#     except:
#         import os
#         import re
#         p = os.path.join(os.path.dirname(__file__), '__init__.py')
#         rustypy_ver = re.compile(r"^__version__ = '(.*)'")
#         with open(p) as f:
#             for l in f:
#                 ver = re.match(rustypy_ver, l)
#                 if ver:
#                     rustypy_ver = ver.group(1)
#                     break
#     return rustypy_ver
# 
# Path: src/rustypy/type_checkers.py
# def type_checkers(func):
#     @functools.wraps(func)
#     def checker(*args, **kwargs):
# 
#         checkers = {
#             "map_like": is_map_like,
#             "seq_like": is_seq_like,
#             "generic": is_generic,
#         }
# 
#         kwargs.update(checkers)
#         return func(*args, **kwargs)
#     return checker


# Path: src/rustypy/pywrapper.py
import inspect
import os
import random
import sys
from collections import abc, namedtuple
from importlib import import_module, invalidate_caches
from io import StringIO
from string import Template, ascii_letters
from textwrap import dedent, indent
from types import FunctionType
from .rswrapper.rswrapper import Double, Float, Tuple
from .scripts import get_version
from .type_checkers import type_checkers


        self.m_dict = m_dict = {}
        if inspect.ismodule(self.root):
            module = self.root.__dict__
            module_objs = m_dict[self.root.__name__] = []
            imp_statement = module["__spec__"].name
            inspect_parameters()
        else:
            root, libname = os.path.split(self.root)
            sys.path.append(root)
            invalidate_caches()
            for f in self.pyfiles:
                self.__no_funcs = True
                # get the absolute import path and dynamically import it
                path, filename = os.path.split(f)
                rel_imp = [libname, None]
                while True:
                    path, tail = os.path.split(path)
                    if path == root or path == os.path.abspath(os.sep):
                        break
                    rel_imp.insert(1, tail)
                rel_imp = [s + '.' for s in rel_imp[:-1]]
                rel_imp.append(filename[:-3])
                imp_statement = "".join(rel_imp)
                module_objs = m_dict[imp_statement] = []
                module = import_module(imp_statement).__dict__
                inspect_parameters()
            sys.path.pop()

    def parse_parameter(self, p, pytypes=False):

        @type_checkers