

def __init__(self, function):
    self.spec = getattr(function, 'original', function)
    self.arguments = introspect.arguments(function)
    self._function = function
    self.is_coroutine = introspect.is_coroutine(self.spec)
    if self.is_coroutine:
        self.spec = getattr(self.spec, '__wrapped__', self.spec)
    self.takes_kargs = introspect.takes_kargs(self.spec)
    self.takes_kwargs = introspect.takes_kwargs(self.spec)
    self.parameters = introspect.arguments(self.spec, (1 if self.takes_kargs else 0))
    if self.takes_kargs:
        self.karg = self.parameters[(- 1)]
    self.defaults = {
        
    }
    for (index, default) in enumerate(reversed((self.spec.__defaults__ or ()))):
        self.defaults[self.parameters[(- (index + 1))]] = default
    self.required = self.parameters[:((- len((self.spec.__defaults__ or ()))) or None)]
    if (introspect.is_method(self.spec) or introspect.is_method(function)):
        self.required = self.required[1:]
        self.parameters = self.parameters[1:]
    self.transform = self.spec.__annotations__.get('return', None)
    self.directives = {
        
    }
    self.input_transformations = {
        
    }
    for (name, transformer) in self.spec.__annotations__.items():
        if isinstance(transformer, str):
            continue
        elif hasattr(transformer, 'directive'):
            self.directives[name] = transformer
            continue
        if hasattr(transformer, 'load'):
            transformer = MarshmallowSchema(transformer)
        elif hasattr(transformer, 'deserialize'):
            transformer = transformer.deserialize
        self.input_transformations[name] = transformer

dataset/ETHPy150Open timothycrosley/hug/hug/interface.py Interfaces.__init__/original