Returns symbol instances corresponding to functions
        of the current scope.
357964
def functions(self):
        
        return [x for x in self[self.current_scope].values() if x.class_ in
                (CLASS.function, CLASS.sub)]
279239
def symbols(self):
        """"""
        def _iter_symbols(symbol_values):
            # The initial charset doesn't matter, as the start codes have the same symbol values in all charsets.
            charset = 'A'

            shift_charset = None
            for symbol_value in symbol_values:
                if shift_charset:
                    symbol = self._val2sym[shift_charset][symbol_value]
                    shift_charset = None
                else:
                    symbol = self._val2sym[charset][symbol_value]

                if symbol in (self.Special.START_A, self.Special.CODE_A):
                    charset = 'A'
                elif symbol in (self.Special.START_B, self.Special.CODE_B):
                    charset = 'B'
                elif symbol in (self.Special.START_C, self.Special.CODE_C):
                    charset = 'C'
                elif symbol in (self.Special.SHIFT_A,):
                    shift_charset = 'A'
                elif symbol in (self.Special.SHIFT_B,):
                    shift_charset = 'B'

                yield symbol

        return list(_iter_symbols(self.symbol_values))
44795
public Symbol getSymbolForInstancesOf(Symbol sym) {
    FunctionType fn = sym.getFunctionType();
    if (fn != null && fn.isNominalConstructor()) {
      return getSymbolForInstancesOf(fn);
    }
    return null;
  }
1250037
def virtual_functions(self):
        
        # We do here some lazy loading.
        if not self._virtual_functions:
            self._virtual_functions = VirtualFunctionManager(self)
        return self._virtual_functions
903816
def all_functions_called(self):
        '''
            
        '''
        all_calls = [f.all_internal_calls() for f in self.functions + self.modifiers] + [self.functions + self.modifiers]
        all_calls = [item for sublist in all_calls for item in sublist] + self.functions
        all_calls = list(set(all_calls))

        all_constructors = [c.constructor for c in self.inheritance]
        all_constructors = list(set([c for c in all_constructors if c]))

        all_calls = set(all_calls+all_constructors)

        return [c for c in all_calls if isinstance(c, Function)]
687069
def free_functions(
            self,
            name=None,
            function=None,
            return_type=None,
            arg_types=None,
            header_dir=None,
            header_file=None,
            recursive=None,
            allow_empty=None):
        

        return (
            self._find_multiple(
                scopedef.scopedef_t._impl_matchers[namespace_t.free_function],
                name=name,
                function=function,
                decl_type=self._impl_decl_types[namespace_t.free_function],
                return_type=return_type,
                arg_types=arg_types,
                header_dir=header_dir,
                header_file=header_file,
                recursive=recursive,
                allow_empty=allow_empty)
        )
427119
def bound_symbols(self):
        """"""
        if self._bound_symbols is None:
            res = set()
            self._bound_symbols = res.union(
                *[sym.free_symbols for sym in self._vals.keys()])
        return self._bound_symbols
1003472
def functions(self):
        
        names = []

        for i, k in enumerate(self.obj):
            if _(self.obj[k]).isCallable():
                names.append(k)

        return self._wrap(sorted(names))
906133
def get_current_args(caller_level = 0, func = None, argNames = None):
    
    if argNames is None:
        argNames = getargnames(getargspecs(func))
    if func is None:
        func = get_current_function(caller_level+1)
    if isinstance(func, property):
        func = func.fget if func.fset is None else func.fset
    stck = inspect.stack()
    lcs = stck[1+caller_level][0].f_locals
    return tuple([lcs[t] for t in argNames])
1310116
def get_symbols(self):
        
        return [s if isinstance(s, Symbol) else s.args[0] for s in self.get_literals()]
1204370
def functions(self):
        
        return [v for v in self.globals.values()
                if isinstance(v, values.Function)]
94322
def _scope_lookup(self, node, name, offset=0):
        """"""
        try:
            stmts = node._filter_stmts(self.locals[name], self, offset)
        except KeyError:
            stmts = ()
        if stmts:
            return self, stmts
        if self.parent:  # i.e. not Module
            # nested scope: if parent scope is a function, that's fine
            # else jump to the module
            pscope = self.parent.scope()
            if not pscope.is_function:
                pscope = pscope.root()
            return pscope.scope_lookup(node, name)
        return builtin_lookup(name)
81649
def _getFuncArgs(func):
  
  """
  code = func.func_code
  Defaults = func.func_defaults

  nargs = code.co_argcount
  ArgNames = code.co_varnames[:nargs]

  Args = OrderedDict()
  argCount = len(ArgNames)
  defCount = len(Defaults) if Defaults else 0
  diff = argCount - defCount

  for i in range(0, diff):
    Args[ArgNames[i]] = {}

  for i in range(diff, argCount):
    Args[ArgNames[i]] = {'default': Defaults[i - diff]}

  return Args
1277473
def find_prototypes(code):
    

    prots = []
    lines = code.split('\n')
    for line in lines:
        m = re.match("\s*" + re_func_prot, line)
        if m is not None:
            rtype, name, args = m.groups()[:3]
            if args == 'void' or args.strip() == '':
                args = []
            else:
                args = [tuple(arg.strip().split(' '))
                        for arg in args.split(',')]
            prots.append((name, args, rtype))

    return prots
515194
def variables(
            self,
            name=None,
            function=None,
            decl_type=None,
            header_dir=None,
            header_file=None,
            recursive=None,
            allow_empty=None):

        """"""
        return (
            self._find_multiple(
                self._impl_matchers[
                    scopedef_t.variable],
                name=name,
                function=function,
                decl_type=decl_type,
                header_dir=header_dir,
                header_file=header_file,
                recursive=recursive,
                allow_empty=allow_empty)
        )
1263284
def without_global_scope(self, scope):
        
        if isinstance(scope, basestring):
            del self._scopes[scope]

            return self

        keys = []
        for key, value in self._scopes.items():
            if scope == value.__class__ or isinstance(scope, value.__class__):
                keys.append(key)

        for key in keys:
            del self._scopes[key]

        return self
949864
def _get_func_nodes():
    """"""
    return [definition for definition in project_definitions.values()
            if isinstance(definition.node, ast.FunctionDef)]