This will return the doc of the calling function
    :param function_index: int of how many frames back the program should look
    :param function_name: str of what function to look for
    :return: str of the doc from the target function
170339
def function_doc(function_index=1, function_name=None):
    
    frm = func_frame(function_index + 1, function_name)
    try:
        func = getattr(frm.f_locals['self'], frm.f_code.co_name)
    except:
        func = frm.f_globals[frm.f_code.co_name]
    return func.__doc__
1144864
def name(self):
        

        if self._name is not None:
            return self._name

        if not self.blocks:
            return None

        if not self.blocks[0].instructions:
            return None

        if not self.blocks[0].instructions[0].labels:
            return None

        lbl = self.blocks[0].instructions[0].labels[0]

        if isinstance(lbl, FunctionLabel):
            return lbl.function_name

        return None
460194
def fn_name(fn):
    '''
        
    '''
    expression = '(\S+) (?:of|at)'
    #Checks if the function is a mehtod and should have the self argument passed
    is_method   = inspect.ismethod(fn)

    #Builds the name of the method,module.class.method or module.method
    name        = '{}.{}'.format(fn.__module__, re.compile(expression).findall(str(fn))[0])

    return name,is_method
720393
public static function isFunctionCall($function_name) {
    $function_names = func_get_args();

    return function ($node) use ($function_names) {
      if ($node instanceof FunctionCallNode) {
        return in_array($node->getName()->getText(), $function_names, TRUE);
      }
      return FALSE;
    };
  }
730855
def __lookup_builtin(name):
    
    global __builtin_functions
    if __builtin_functions is None:
        builtins = dict()
        for proto in __builtins:
            pos = proto.find('(')
            name, params, defaults = proto[:pos], list(), dict()
            for param in proto[pos + 1:-1].split(','):
                pos = param.find('=')
                if not pos < 0:
                    param, value = param[:pos], param[pos + 1:]
                    try:
                        defaults[param] = __builtin_defaults[value]
                    except KeyError:
                        raise ValueError(
                            'builtin function %s: parameter %s: '
                            'unknown default %r' % (name, param, value))
                params.append(param)
            builtins[name] = (params, defaults)
        __builtin_functions = builtins

    try:
        params, defaults = __builtin_functions[name]
    except KeyError:
        params, defaults = tuple(), dict()
        __builtin_functions[name] = (params, defaults)
        print(
            "Warning: builtin function %r is missing prototype" % name,
            file=sys.stderr)
    return len(params), params, defaults
1333336
def system_methodHelp(self, method_name: str)->str:
        
        method = None
        if method_name in self.funcs:
            method = self.funcs[method_name]
        elif self.instance is not None:
            try:
                method = resolve_dotted_attribute(
                    self.instance,
                    method_name,
                    self.allow_dotted_names
                )
            except AttributeError:
                pass
        if method is None:
            return ""
        else:
            return pydoc.getdoc(method)
1368610
def _get_method_doc(self):
        
        ret = {}
        for method_name in self.methods:
            method = getattr(self, method_name, None)
            if method:
                ret[method_name] = method.__doc__
        return ret
840720
def _compute_function_attributes(cfg):
        
        # the attributes we use are the number of basic blocks, number of edges, and number of subfunction calls
        attributes = dict()
        all_funcs = set(cfg.kb.callgraph.nodes())
        for function_addr in cfg.kb.functions:
            # skip syscalls and functions which are None in the cfg
            if cfg.kb.functions.function(function_addr) is None or cfg.kb.functions.function(function_addr).is_syscall:
                continue
            if cfg.kb.functions.function(function_addr) is not None:
                normalized_funtion = NormalizedFunction(cfg.kb.functions.function(function_addr))
                number_of_basic_blocks = len(normalized_funtion.graph.nodes())
                number_of_edges = len(normalized_funtion.graph.edges())
            else:
                number_of_basic_blocks = 0
                number_of_edges = 0
            if function_addr in all_funcs:
                number_of_subfunction_calls = len(list(cfg.kb.callgraph.successors(function_addr)))
            else:
                number_of_subfunction_calls = 0
            attributes[function_addr] = (number_of_basic_blocks, number_of_edges, number_of_subfunction_calls)

        return attributes
625164
def _get_function_type(self, function_name):
        
        if (function_name.startswith("Fn::") and
                function_name[4:] in self.inspect_functions):
            return self.inspect_functions[function_name[4:]]
        return (self.inspect_functions['Ref'] if function_name == "Ref"
                else None)
943838
public function _get_filter_name($function_name)
    {
        if (is_array($function_name)) {
            $_class_name = (is_object($function_name[0]) ?
            get_class($function_name[0]) : $function_name[0]);

            return $_class_name . '_' . $function_name[1];
        } else {
            return $function_name;
        }
    }
863090
def view(self, function_name, extension_name):
        
        if isinstance(self.Access_Control_Allow_Origin, dict):
            d = {
                "Access-Control-Allow-Origin": self.Access_Control_Allow_Origin[function_name],
                "Access-Control-Allow-Methods": self.Access_Control_Allow_Methods[function_name]
            }
        else:
            d = {
                "Access-Control-Allow-Origin": self.Access_Control_Allow_Origin,
                "Access-Control-Allow-Methods": self.Access_Control_Allow_Methods[function_name]
            }

        def r(*x, **y):
            val = getattr(self._extensions[extension_name], function_name)(*x, **y)
            if isinstance(val, Response):
                val.headers.extend(d)
                return val
            else:
                val = list(val)
                val[2].update(d)
                return tuple(val)
        return r
867103
function _gpfFunctionDescribeName (functionToDescribe, resultDescription) {
    var name = _gpfGetFunctionName(functionToDescribe);
    if (name) {
        resultDescription.name = name;
    }
}
161219
def get_property(self, index, doctype, name):
        

        return self.indices[index][doctype].properties[name]
391990
def _get_method(name, func):
    ""
    def method(self, *args, **kw):
        return func(self, *args, **kw)
    method.__name__ = name
    return method
149091
def document(cls):
    
    if cls.__doc__ is None:
        return cls

    baseclass_name = cls.mro()[-2].__name__

    try:
        return DOC_FUNCTIONS[baseclass_name](cls)
    except KeyError:
        return cls
151481
def get_function(self, name: str) -> AbiFunction or None:
        
        for func in self.functions:
            if func['name'] == name:
                return AbiFunction(func['name'], func['parameters'], func.get('returntype', ''))
        return None
377934
def get_function_doc(function, config=default_config):
    """"""
    if config.exclude_function:
        for ex in config.exclude_function:
            if ex.match(function.__name__):
                return None

    return _doc_object(function, 'function', config=config)