生成键名
@param string|object $obj
@param string $funcName
@param array $params
@return string
195802
protected function generateKey($obj, string $funcName = '', array $params = []): string {
		$className = is_object($obj) ? get_class($obj) : $obj;
		$key       = ''; // default
		if (!empty($params)) {
			foreach ($params as $v) {
				if (is_object($v))
					throw new InvalidArgumentException('the object is not supported as the parameter in ' .
					                                   static::class . '::call. ');
				if ($v === true)
					$key .= '_bool-t';
				elseif ($v === false)
					$key .= '_bool-f';
				else
					$key .= '_' . gettype($v) . '-' . (is_array($v) ? serialize($v) : $v);
			}
			$key = '/' . md5($key);
		}
		$str = $className . '/' . $funcName . $key;
		$str = is_null($this->identifier) ? $str : '@' . $this->identifier . '/' . $str;
		return str_replace('\\', '/', $str);
	}
930749
function handleRequest( $functionName, $params )
    {
        if ( array_key_exists( $functionName, $this->FunctionList ) )
        {
            $paramsOk = false;
            foreach( $this->FunctionList[$functionName] as $paramDesc )
            {
                $paramsOk = ( ( $paramDesc === null ) || $this->validateParams( $params, $paramDesc['in'] ) );
                if ( $paramsOk )
                {
                    break;
                }
            }
            if ( $paramsOk )
            {
                // allow to use the dot as namespace separator in webservices
                $functionName = str_replace( array( '.' ), '_', $functionName );

                try
                {
                    if ( strpos( $functionName, '::' ) )
                    {
                        return call_user_func_array( explode( '::', $functionName ), $params );
                    }
                    else
                    {
                        return call_user_func_array( $functionName, $params );
                    }
                }
                catch( Exception $e )
                {
                    switch ( $this->exception_handling )
                    {
                        case 0:
                            return new ggWebservicesFault( $e->getCode(), $e->getMessage() );
                        case 1:
                            return new ggWebservicesFault( self::GENERICRESPONSEERROR, self::GENERICRESPONSESTRING );
                        case 2:
                        default: // coder did something weird if we get someting else...
                            throw $e;
                    }
                }
            }
            else
            {
                return new ggWebservicesFault( self::INVALIDPARAMSERROR, self::INVALIDPARAMSSTRING );
            }
        }
        else
        {
            return new ggWebservicesFault( self::INVALIDMETHODERROR, self::INVALIDMETHODSTRING . " '$functionName'" );
        }
    }
1280478
private function createFunction($func, array $arguments = array(), $alias = null)
    {
        // Prepare function arguments
        foreach ($arguments as $index => $argument) {
            if ($argument instanceof RawSqlFragmentInterface) {
                $item = $argument->getFragment();
            } else {
                $item = $this->quote($argument);
            }

            // Update item collection
            $arguments[$index] = $item;
        }

        $fragment = sprintf(' %s(%s) ', $func, implode(', ', $arguments));

        // Generate alias if provided
        if (!is_null($alias)) {
            $fragment .= sprintf(' AS %s ', $this->quote($alias));
        }

        // Append a comma if there was a function call before
        if ($this->hasFunctionCall === true) {
            $this->append(', ');
        }

        $this->hasFunctionCall = true;
        return $fragment;
    }
701177
function makeSignature(params) {
	var r = ['('], desc;
	if ( params ) {
		for (var i = 0, p; (p = params[i]); i++) {
			// ignore @param tags for 'virtual' params that are used to document members of config-like params
			// (e.g. like "@param param1.key ...")
			if (p.name && p.name.indexOf('.') == -1) {
				if (i > 0) {
					r.push(', ');
				}

				r.push('<span');

				var types = listTypes(p.type, true);
				if ( (desc = asPlainSummary(p.description)) || types ) {
					r.push(' title="');
					if (types) {
						r.push('(');
						r.push(types);
						r.push(') ');
					}
					r.push(desc);
					r.push('"');
				}

				r.push('>');
				r.push(p.name);
				r.push('</span>');
				if ( p.optional ) {
					r.push('<i class="help" title="Optional parameter">?</i>');
				}
			}
		}
	}
	r.push(')');
	return r.join('');
}
404248
def create(cls, obj, body, evaldict, defaults=None,
               doc=None, module=None, addsource=True, **attrs):
        
        if isinstance(obj, str): # "name(signature)"
            name, rest = obj.strip().split('(', 1)
            signature = rest[:-1] #strip a right parens
            func = None
        else: # a function
            name = None
            signature = None
            func = obj
        self = cls(func, name, signature, defaults, doc, module)
        ibody = '\n'.join('    ' + line for line in body.splitlines())
        return self.make('def %(name)s(%(signature)s):\n' + ibody,
                        evaldict, addsource, **attrs)
420038
public static String generateJNISignature(Class<?>[] params) {
        StringBuilder ret = new StringBuilder();

        for (Class<?> param : params) {
            ret.append(getJavaSignature(param));
        }

        return ret.toString();
    }
786587
function provideName(obj, token){
    if(!isString(token)) {
      throw new Error('Must provide string as name of module');
    }
    di.annotate(obj, new di.Provide(token));
  }
895347
protected function generateSign($params = [])
    {
        if ($this->sign_method == 'md5') {
            return $this->generateMd5Sign($params);
        } elseif ($this->sign_method == 'hmac') {
            return $this->generateHmacSign($params);
        } else {
            throw new Exception("sign_method错误...");
        }
    }
466110
function renameFunction(func, newName) {
    // eslint-disable-next-line no-unused-vars
    const prop = Object.getOwnPropertyDescriptor(func, 'name');
    if (prop) {
        const { value, ...others } = prop;
        Object.defineProperty(func, 'name', { value: newName, ...others });
    }
}
668878
function getFunctionNameAndArgs(value) {
    var pattern = /^(.*)\{\{([^()]+?)(\((.+)\))?\}\}(.*)$/g,
    match, func, args;
    var argArray = [], surroundings = [];
    var retValue;

    while (match = pattern.exec(value)) {
      surroundings[0] = match[1];
      func = match[2];
      args = match[4];
      surroundings[1] = match[5];
    }

    if (args !== undefined ){
      if (args.indexOf("[") !== -1){
        // is an array as string
        args = JSON.parse(args);
        argArray.push(args);
      } else {
        // one or more string/number params
        args = args.replace(/, /gi, ",");
        args = args.replace(/'/gi, "", "gi");
        argArray = args.split(',');
      }
    }
    // return value if no Faker method is detected
    retValue = func ?
      executeFunctionByName(func,argArray) :
      value;

    if(surroundings[0]) {	// prefix
      retValue = surroundings[0] + retValue;
    }

    if(surroundings[1]) {	// postfix
      retValue += surroundings[1];
    }

    return retValue;
  }
1265524
function (actionName) {
            actionName = actionName || "";

            var idx = actionName.indexOf("?");
            var object = {
                name : "",
                params : ""
            };

            if (idx < 0) {
                object.name = actionName;
            } else {
                object = {
                    name : actionName.substring(0, idx),
                    params : actionName.substring(idx + 1)
                };
            }

            return object;
        }
353189
protected function generateHmacSign($params = [])
    {
        static::sortParams($params);  // 排序

        $arr = [];
        foreach ($params as $k => $v) {
            $arr[] = $k . $v;
        }
        
        $str = implode('', $arr);

        return strtoupper(hash_hmac('md5', $str, $this->app->app_secret));
    }
1129137
public function createUrl(string $moduleName, string $controllerName, string $actionName, ?DataMap $params = null): string
    {
        $url = '/';
        if (! $this->isModuleName($moduleName)) {
            Application::$app->dispatchEvent(ApplicationErrorEvent::createCustom(500, '模块名' . $moduleName . '非法'));
        }
        if (! $this->isControllerName($controllerName)) {
            Application::$app->dispatchEvent(ApplicationErrorEvent::createCustom(500, '控制器名' . $controllerName . '非法'));
        }
        if (! $this->isActionName($actionName)) {
            Application::$app->dispatchEvent(ApplicationErrorEvent::createCustom(500, '操作名' . $actionName . '非法'));
        }
        return $url;
    }
966376
function makeSignature(params) {
	if (!params) return "()";
	var signature = "("
	+
	params.filter(
		function($) {
			return $.name.indexOf(".") == -1; // don't show config params in signature
		}
	).map(
		function($) {
			return $.name;
		}
	).join(", ")
	+
	")";
	return signature;
}
1327372
function(obj)
	{
	    var output = '';
	    
	    for (var i in obj)
	    {
	    	try
	    	{
			    if (obj[i] == null)
			    {
		            output += i + ' = [null]\n';
			    }
			    else if (typeof(obj[i]) == 'function')
			    {
		            output += i + ' => [Function]\n';
		        }
		        else if (typeof(obj[i]) == 'object')
		        {
		        	var ctor = mxUtils.getFunctionName(obj[i].constructor); 
		            output += i + ' => [' + ctor + ']\n';
		        }
		        else
		        {
		            output += i + ' = ' + obj[i] + '\n';
		        }
	    	}
	    	catch (e)
	    	{
	    		output += i + '=' + e.message;
	    	}
	    }
	    
	    return output;
	}
1038045
@Override
  public byte[] encode(final NamingRegisterRequest obj) {
    final AvroNamingRegisterRequest result = AvroNamingRegisterRequest.newBuilder()
        .setId(obj.getNameAssignment().getIdentifier().toString())
        .setHost(obj.getNameAssignment().getAddress().getHostName())
        .setPort(obj.getNameAssignment().getAddress().getPort())
        .build();
    return AvroUtils.toBytes(result, AvroNamingRegisterRequest.class);
  }
1173979
protected function generateSign($params)
    {
        ksort($params);

        $stringToBeSigned = $this->clientSecret;

        foreach ($params as $k => $v) {
            if (!is_array($v) && '@' != substr($v, 0, 1)) {
                $stringToBeSigned .= "$k$v";
            }
        }

        $stringToBeSigned .= $this->clientSecret;

        return strtoupper(md5($stringToBeSigned));
    }