def METHOD_NAME(self, func: Function) -> J.Function:
    return {
        'name': func.name,
        'description': func.description,
        'since': func.since if func.since else None,
        'deprecated': func.deprecated if func.deprecated else None,
        'notes': func.notes,
        'warnings': func.warnings,
        'example': func.example if func.example else None,
        'returns': self._generate_type(func.returns),
        'returns_str': self._generate_type_str(func.returns),
        'posargs': {x.name: self._generate_arg(x) for x in func.posargs},
        'optargs': {x.name: self._generate_arg(x, True) for x in func.optargs},
        'kwargs': {x.name: self._generate_arg(x) for x in self.sorted_and_filtered(list(func.kwargs.values()))},
        'varargs': self._generate_arg(func.varargs) if func.varargs else None,
        'arg_flattening': func.arg_flattening,
    }