Raw, undecorated function for internal use
342127
def _evaluatephiforces(Pot,R,z,phi=None,t=0.,v=None):
    """"""
    isList= isinstance(Pot,list)
    nonAxi= _isNonAxi(Pot)
    if nonAxi and phi is None:
        raise PotentialError("The (list of) Potential instances is non-axisymmetric, but you did not provide phi")
    dissipative= _isDissipative(Pot)
    if dissipative and v is None:
        raise PotentialError("The (list of) Potential instances includes dissipative, but you did not provide the 3D velocity (required for dissipative forces")
    if isList:
        sum= 0.
        for pot in Pot:
            if isinstance(pot,DissipativeForce):
                sum+= pot._phiforce_nodecorator(R,z,phi=phi,t=t,v=v)
            else:
                sum+= pot._phiforce_nodecorator(R,z,phi=phi,t=t)
        return sum
    elif isinstance(Pot,Potential):
        return Pot._phiforce_nodecorator(R,z,phi=phi,t=t)
    elif isinstance(Pot,DissipativeForce):
        return Pot._phiforce_nodecorator(R,z,phi=phi,t=t,v=v)
    else: #pragma: no cover 
        raise PotentialError("Input to 'evaluatephiforces' is neither a Potential-instance, DissipativeForce-instance or a list of such instances")
237092
def parsed_function_to_ast(parsed: Parsed, parsed_key):
    """"""

    sub = parsed[parsed_key]

    subtree = {
        "type": "Function",
        "span": sub["span"],
        "function": {
            "name": sub["name"],
            "name_span": sub["name_span"],
            "parens_span": sub.get("parens_span", []),
        },
    }

    args = []
    for arg in parsed[parsed_key].get("args", []):

        # pdb.set_trace()

        if arg["type"] == "Function":
            args.append(parsed_function_to_ast(parsed, arg["span"]))
        elif arg["type"] == "NSArg":
            args.append(
                {
                    "arg": arg["arg"],
                    "type": arg["type"],
                    "span": arg["span"],
                    "nsarg": {
                        "ns": arg["ns"],
                        "ns_val": arg["ns_val"],
                        "ns_span": arg["ns_span"],
                        "ns_val_span": arg["ns_val_span"],
                    },
                }
            )
        elif arg["type"] == "StrArg":
            args.append({"arg": arg["arg"], "type": arg["type"], "span": arg["span"]})

    subtree["args"] = copy.deepcopy(args)

    return subtree
676228
def _raw(cls, vertices, edges, out_edges, in_edges, head, tail):
        
        self = object.__new__(cls)
        self._out_edges = out_edges
        self._in_edges = in_edges
        self._head = head
        self._tail = tail
        self._vertices = vertices
        self._edges = edges
        return self
940509
def make_builtin(lineno, fname, operands, func=None, type_=None):
    
    if operands is None:
        operands = []
    assert isinstance(operands, Symbol) or isinstance(operands, tuple) or isinstance(operands, list)
    # TODO: In the future, builtin functions will be implemented in an external library, like POINT or ATTR
    __DEBUG__('Creating BUILTIN "{}"'.format(fname), 1)
    if not isinstance(operands, collections.Iterable):
        operands = [operands]
    return symbols.BUILTIN.make_node(lineno, fname, func, type_, *operands)
645716
def p_function(self, p):
        ''' '''
        p[0] = ast.Function(
            name=p[3],
            parameters=p[5],
            return_type=p[2],
            exceptions=p[7],
            oneway=p[1],
            annotations=p[8],
            lineno=p.lineno(3),
        )
731857
private UnaryExpression resolveUnary(FunctionRef fun) {
        UnaryExpression operator = null;
        try {
            Class clazz = Class.forName("org.hl7.elm.r1." + fun.getName());
            if (UnaryExpression.class.isAssignableFrom(clazz)) {
                operator = (UnaryExpression) clazz.newInstance();
                checkNumberOfOperands(fun, 1);
                operator.setOperand(fun.getOperand().get(0));
                builder.resolveUnaryCall("System", fun.getName(), operator);
                return operator;
            }
        } catch (Exception e) {
            // Do nothing but fall through
        }
        return null;
    }
260656
def on_functiondef(self, node):
        """"""
        # ('name', 'args', 'body', 'decorator_list')
        if node.decorator_list:
            raise Warning("decorated procedures not supported!")
        kwargs = []

        if not valid_symbol_name(node.name) or node.name in self.readonly_symbols:
            errmsg = "invalid function name (reserved word?) %s" % node.name
            self.raise_exception(node, exc=NameError, msg=errmsg)

        offset = len(node.args.args) - len(node.args.defaults)
        for idef, defnode in enumerate(node.args.defaults):
            defval = self.run(defnode)
            keyval = self.run(node.args.args[idef+offset])
            kwargs.append((keyval, defval))

        if version_info[0] == 3:
            args = [tnode.arg for tnode in node.args.args[:offset]]
        else:
            args = [tnode.id for tnode in node.args.args[:offset]]

        doc = None
        nb0 = node.body[0]
        if isinstance(nb0, ast.Expr) and isinstance(nb0.value, ast.Str):
            doc = nb0.value.s

        varkws = node.args.kwarg
        vararg = node.args.vararg
        if version_info[0] == 3:
            if isinstance(vararg, ast.arg):
                vararg = vararg.arg
            if isinstance(varkws, ast.arg):
                varkws = varkws.arg

        self.symtable[node.name] = Procedure(node.name, self, doc=doc,
                                             lineno=self.lineno,
                                             body=node.body,
                                             args=args, kwargs=kwargs,
                                             vararg=vararg, varkws=varkws)
        if node.name in self.no_deepcopy:
            self.no_deepcopy.remove(node.name)
253615
def serialized(func):
    """"""

    @wraps(func)
    def wrapper(*args, **kwargs):
        return '\n'.join(
            ' '.join(parts) if isinstance(parts, tuple) else parts
            for parts in func(*args, **kwargs)
        )

    return wrapper
1129254
function makeCacheable(rawFunction) {
    var lastArguments;
    var currentArguments;
    var lastResult;
    var cacheFunction = function () {
        currentArguments = arguments;
        if (lastArguments == undefined || Array.prototype.some.call(lastArguments, function (value, index) {
            return value != currentArguments[index];
        })) {
            lastResult = rawFunction.apply(null, currentArguments);
            lastArguments = currentArguments;
        }
        return lastResult;
    };
    return cacheFunction;
}
1324119
def is_decorated(cls, f):
        ''''''
        real_func = inspect.unwrap(f)
        return real_func in cls.DECORATED_FUNCTIONS
896501
def mutable(function):
    ''''''

    def wrapper(self, *args, **kwargs):
        state = self._get_state()
        return function(self, state, *args, **kwargs)

    return wrapper
743684
function fn (deps, func, context) {
		if( isString(deps) ) {
			if( func === undefined ) {
				return definitions[deps];
			} else {
				return fn.define(deps, func, context);
			}
		} else {
			fn.run(deps, func, context);
		}
		return fn;
	}
811885
function step(inst, raw, argv, event, fin) {
    if (!_isPresent(raw)) return fin(_wrapError(_badInput(inst), inst, raw), null);
    var flat = _denestList(raw);
    preproc(inst, flat, argv, event, function postPreproc(err, data) {
        if (err) return fin(err);
        var list = _safeObject(data);
        return branch(inst, list, argv, event, fin);
    });
}
389553
function buildInputsArray(rawInputsString) {
  let returnArray = []; // eslint-disable-line
  const rawMethodInputs = rawInputsString.split(',');

  // no inputs
  if (typeof rawMethodInputs === 'undefined' || rawMethodInputs.length === 0) {
    return [];
  }

  rawMethodInputs.forEach((rawMethodInput) => {
    const inputData = rawMethodInput.trim().split(' ');
    const type = inputData[0];
    const name = inputData[1] || '';

    // if type exists
    if (type !== '' && typeof type !== 'undefined') {
      returnArray.push({
        type,
        name,
      });
    }
  });

  return returnArray;
}
753740
def _onFunction(self, name, line, pos, absPosition,
                    keywordLine, keywordPos,
                    colonLine, colonPos, level,
                    isAsync, returnAnnotation):
        """"""
        self.__flushLevel(level)
        f = Function(name, line, pos, absPosition, keywordLine, keywordPos,
                     colonLine, colonPos, isAsync, returnAnnotation)
        if self.__lastDecorators is not None:
            f.decorators = self.__lastDecorators
            self.__lastDecorators = None
        self.objectsStack.append(f)
938914
def function_body(self):
        """"""
        if self.shared.function_vars > 0:
            const = self.symtab.insert_constant("0{}".format(self.shared.function_vars * 4), SharedData.TYPES.UNSIGNED)
            self.arithmetic("-", "%15", const, "%15")
        self.newline_label(self.shared.function_name + "_body", True, True)
131684
def get_func(func, aliasing, implementations):
    
    try:
        func_str = aliasing[func]
    except KeyError:
        if callable(func):
            return func
    else:
        if func_str in implementations:
            return func_str
        if func_str.startswith('nan') and \
                func_str[3:] in funcs_no_separate_nan:
            raise ValueError("%s does not have a nan-version".format(func_str[3:]))
        else:
            raise NotImplementedError("No such function available")
    raise ValueError("func %s is neither a valid function string nor a "
                     "callable object".format(func))