Return the function id of the given signature
    Args:
        sig (str)
    Return:
        (int)
556278
def get_function_id(sig):
    ''''
        
    '''
    s = sha3.keccak_256()
    s.update(sig.encode('utf-8'))
    return int("0x" + s.hexdigest()[:8], 16)
868213
def fn_signature(callable, 
                 argument_transform=(lambda name: name),
                 default_transform=(lambda name, value: "%s=%s" % 
                                                        (name, repr(value))),
                 vararg_transform=(lambda name: "*" + name),
                 kwargs_transform=(lambda name: "**" + name)):
    """"""
    signature = []
    fn = get_fn(callable)
    avail_ac = fn_available_argcount(fn)
    kwargs = fn_kwargs(fn)
    argnames = fn_argnames(fn)
    for name in stop_at(argnames, avail_ac):
        if name in kwargs:
            signature.append(default_transform(name, kwargs[name]))
        else:
            signature.append(argument_transform(name))
    if fn_has_args(fn):
        if fn_has_kwargs(fn):
            signature.append(vararg_transform(argnames[-2]))
            signature.append(kwargs_transform(argnames[-1]))
        else:
            signature.append(vararg_transform(argnames[-1]))
    elif fn_has_kwargs(fn):
        signature.append(kwargs_transform(argnames[-1]))

    return signature
489830
def parse_type_signature(sig):
    
    match = TYPE_SIG_RE.match(sig.strip())
    if not match:
        raise RuntimeError('Type signature invalid, got ' + sig)
    groups = match.groups()
    typ = groups[0]
    generic_types = groups[1]
    if not generic_types:
        generic_types = []
    else:
        generic_types = split_sig(generic_types[1:-1])
    is_array = (groups[2] is not None)
    return typ, generic_types, is_array
888149
def get_identifier(self, origin=None):
        

        token = self.get().unescape()
        if not token.is_identifier():
            raise dns.exception.SyntaxError('expecting an identifier')
        return token.value
809012
def get_contents_sig(self):
        

        try:
            return self.contentsig
        except AttributeError:
            pass

        executor = self.get_executor()

        result = self.contentsig = SCons.Util.MD5signature(executor.get_contents())
        return result
1251182
def _parse_signature(func):
    """"""
    if hasattr(func, "im_func"):
        func = func.im_func

    # if we have a cached validator for this function, return it
    parse = _signature_cache.get(func)
    if parse is not None:
        return parse

    # inspect the function signature and collect all the information
    if hasattr(inspect, "getfullargspec"):
        tup = inspect.getfullargspec(func)
    else:
        tup = inspect.getargspec(func)
    positional, vararg_var, kwarg_var, defaults = tup[:4]
    defaults = defaults or ()
    arg_count = len(positional)
    arguments = []
    for idx, name in enumerate(positional):
        if isinstance(name, list):
            raise TypeError(
                "cannot parse functions that unpack tuples in the function signature"
            )
        try:
            default = defaults[idx - arg_count]
        except IndexError:
            param = (name, False, None)
        else:
            param = (name, True, default)
        arguments.append(param)
    arguments = tuple(arguments)

    def parse(args, kwargs):
        new_args = []
        missing = []
        extra = {}

        # consume as many arguments as positional as possible
        for idx, (name, has_default, default) in enumerate(arguments):
            try:
                new_args.append(args[idx])
            except IndexError:
                try:
                    new_args.append(kwargs.pop(name))
                except KeyError:
                    if has_default:
                        new_args.append(default)
                    else:
                        missing.append(name)
            else:
                if name in kwargs:
                    extra[name] = kwargs.pop(name)

        # handle extra arguments
        extra_positional = args[arg_count:]
        if vararg_var is not None:
            new_args.extend(extra_positional)
            extra_positional = ()
        if kwargs and kwarg_var is None:
            extra.update(kwargs)
            kwargs = {}

        return (
            new_args,
            kwargs,
            missing,
            extra,
            extra_positional,
            arguments,
            vararg_var,
            kwarg_var,
        )

    _signature_cache[func] = parse
    return parse
277062
def _complete_sig(self, symbol, attribute):
        """"""
        #Return a list of valid parameters for the function being called
        fncall = self.context.el_name
        iexec, execmod = self.context.parser.tree_find(fncall, self.context.module, "executables")

        if iexec is None:
            #Try the interfaces as a possible executable to complete.
            iexec, execmod = self.context.parser.tree_find(fncall, self.context.module, "interfaces")

        if iexec is not None:
            if symbol == "":
                return iexec.parameters
            else:
                result = {}
                for ikey in iexec.parameters:
                    if self._symbol_in(symbol, ikey):
                        result[ikey] = iexec.parameters[ikey]
                return result
        else:
            return self._complete_word(symbol, attribute)
102518
def get_all_args(fn) -> list:
    
    sig = inspect.signature(fn)
    return list(sig.parameters)
773937
def get_sig(ir, name):
    '''
        
    '''
    sig = '{}({})'

    # list of list of arguments
    argss = convert_arguments(ir.arguments)
    return [sig.format(name, ','.join(args)) for args in argss]
922261
def checkMessageSignature(self, message):
        
        message_sig = message.getArg(OPENID_NS, 'sig')
        if not message_sig:
            raise ValueError("%s has no sig." % (message,))
        calculated_sig = self.getMessageSignature(message)
        return cryptutil.const_eq(calculated_sig, message_sig)
1105684
def _build_signature(self, run_args):
    """"""
    return (id(run_args.fct), run_args.input.dtype, run_args.input.shape)
856573
private boolean isCallingOnThis(String sig) {
        if (getMethod().isStatic()) {
            return false;
        }

        int numParameters = SignatureUtils.getNumParameters(sig);
        if (stack.getStackDepth() <= numParameters) {
            return false;
        }

        OpcodeStack.Item item = stack.getStackItem(numParameters);
        return item.getRegisterNumber() == 0;
    }
535340
def sig_handler(self, sig, _):
        
        import tornado.ioloop
        from tornado.process import task_id
        tid = task_id()
        pid = os.getpid()
        if tid is None:
            logger.warning("main process (pid %s) caught signal: %s" %
                           (pid, sig))
        else:
            logger.warning("child %s (pid %s) caught signal: %s" %
                           (tid, pid, sig))
        tornado.ioloop.IOLoop.current().add_callback(self.shutdown)
1219347
function signature(obj, sig) {
    if (typeof obj === 'string') obj = list[obj];

    let r = obj.id;

    if (sig.args) {
      r += '(';
      sig.args.forEach((arg, idx) => {
        let skip_first, a, value;
        // skip the first bound argument for prototype methods
        skip_first = obj.bound && obj.id.indexOf('#') >= 0;
        a = arg.name;
        // argument can be callback
        if (arg.args) a = signature({ id: a }, arg);

        if (!idx && skip_first) return; //a = '@' + a;

        if (typeof arg.default_value !== 'undefined') {
          // apply custom stringifier
          value = JSON.stringify(arg.default_value, function (k, v) {
            // FIXME: get rid of quotes, if possible
            if (v instanceof RegExp) v = v.source;
            else if (v === 'null') v = null;
            return v;
          });
          a = a + ' = ' + value;
        }
        // compensate for possibly skipped first argument
        if (idx > (skip_first ? 1 : 0)) a = ', ' + a;
        if (arg.ellipsis) a += '...';
        if (arg.optional) a = '[' + a + ']';
        r += a;
      });
      r += ')';
    }
    return r;
  }
570517
def get_func_posargs_name(f):
    """"""
    sigparams = inspect.signature(f).parameters
    for p in sigparams:
        if sigparams[p].kind == inspect.Parameter.VAR_POSITIONAL:
            return sigparams[p].name
    return None
437522
function verifySignature($in, $sig)
		{
			// check each possible signature in turn
			if (is_object($in))
			{
				$numParams = $in->getNumParams();
			}
			else
			{
				$numParams = count($in);
			}
			foreach($sig as $cursig)
			{
				if(count($cursig)==$numParams+1)
				{
					$itsOK=1;
					for($n=0; $n<$numParams; $n++)
					{
						if (is_object($in))
						{
							$p=$in->getParam($n);
							if($p->kindOf() == 'scalar')
							{
								$pt=$p->scalartyp();
							}
							else
							{
								$pt=$p->kindOf();
							}
						}
						else
						{
							$pt= $in[$n] == 'i4' ? 'int' : strtolower($in[$n]); // dispatch maps never use i4...
						}

						// param index is $n+1, as first member of sig is return type
						if($pt != $cursig[$n+1] && $cursig[$n+1] != $GLOBALS['xmlrpcValue'])
						{
							$itsOK=0;
							$pno=$n+1;
							$wanted=$cursig[$n+1];
							$got=$pt;
							break;
						}
					}
					if($itsOK)
					{
						return array(1,'');
					}
				}
			}
			if(isset($wanted))
			{
				return array(0, "Wanted ${wanted}, got ${got} at param ${pno}");
			}
			else
			{
				return array(0, "No method signature matches number of parameters");
			}
		}
716258
def handle_signature(self, sig, signode):
        """"""
        if sig != 'Configuration':
            signode.clear()

            # Add "component" which is the type of this thing
            signode += addnodes.desc_annotation('component ', 'component ')

            if '.' in sig:
                modname, clsname = sig.rsplit('.', 1)
            else:
                modname, clsname = '', sig

            # If there's a module name, then we add the module
            if modname:
                signode += addnodes.desc_addname(modname + '.', modname + '.')

            # Add the class name
            signode += addnodes.desc_name(clsname, clsname)
        else:
            # Add just "Configuration"
            signode += addnodes.desc_name(sig, sig)

        return sig