'Create the FunctionIdentity of the given function.'

@classmethod
def from_function(cls, pyfunc):

    func = get_function_object(pyfunc)
    code = get_code_object(func)
    pysig = utils.pysignature(func)
    if (not code):
        raise errors.ByteCodeSupportError(('%s    does    not    provide    its    bytecode' % func))
    try:
        func_qualname = func.__qualname__
    except AttributeError:
        func_qualname = func.__name__
    self = cls()
    self.func = func
    self.func_qualname = func_qualname
    self.func_name = func_qualname.split('.')[(-1)]
    self.code = code
    self.module = inspect.getmodule(func)
    self.modname = (utils._dynamic_modname if (self.module is None) else self.module.__name__)
    self.is_generator = inspect.isgeneratorfunction(func)
    self.pysig = pysig
    self.filename = code.co_filename
    self.firstlineno = code.co_firstlineno
    self.arg_count = len(pysig.parameters)
    self.arg_names = list(pysig.parameters)
    uid = next(cls._unique_ids)
    self.unique_name = '{}${}'.format(self.func_qualname, uid)
    return self
