Builds final set of XML-RPC method arguments based on
        the method's arguments, any default arguments, and their
        defined respective ordering.
979928
def get_args(self, client):
        
        default_args = self.default_args(client)

        if self.method_args or self.optional_args:
            optional_args = getattr(self, 'optional_args', tuple())
            args = []
            for arg in (self.method_args + optional_args):
                if hasattr(self, arg):
                    obj = getattr(self, arg)
                    if hasattr(obj, 'struct'):
                        args.append(obj.struct)
                    else:
                        args.append(obj)
            args = list(default_args) + args
        else:
            args = default_args

        return args
1354802
public static Set<String> buildProduces(Method method) {
		Set<String> produces = new LinkedHashSet<String>();
		Class<?> controller = method.getDeclaringClass();

		if(isAnnotated(controller, RequestMapping.class)) {
			RequestMapping requestMapping = getAnnotation(controller, RequestMapping.class);
			if(requestMapping.produces().length > 0) {
				produces.addAll(Arrays.asList(requestMapping.produces()));
			}
		}
		
		if(isAnnotated(method, RequestMapping.class)) {
			RequestMapping requestMapping = getAnnotation(method, RequestMapping.class);
			if(requestMapping.produces().length > 0) {
				produces.clear();
				produces.addAll(Arrays.asList(requestMapping.produces()));
			}
		}
		
		if(produces.isEmpty()) {
			produces.add(MediaType.APPLICATION_JSON_VALUE);
		}
		
		return produces;
	}
1231904
@Deprecated
    public static SofaRequest buildSofaRequest(Class<?> clazz, String method, Class[] argTypes, Object[] args) {
        SofaRequest request = new SofaRequest();
        request.setInterfaceName(clazz.getName());
        request.setMethodName(method);
        request.setMethodArgs(args == null ? CodecUtils.EMPTY_OBJECT_ARRAY : args);
        request.setMethodArgSigs(ClassTypeUtils.getTypeStrs(argTypes, true));
        return request;
    }
322134
def BuildTemplates(self):
    
    if args.config:
      build_args = [
          "--verbose", "--config", args.config, "build", "--output",
          args.output_dir
      ]
    else:
      build_args = ["--verbose", "build", "--output", args.output_dir]
    subprocess.check_call([self.grr_client_build64] + build_args)
    if args.build_32:
      subprocess.check_call([self.grr_client_build32] + build_args)
98785
protected static MethodDescriptor _buildMethodDescriptor(
    Class actionClass, String methodName, String[] parameterNames, Class[] parameterTypes, Class[] actualParameterTypes )
  {
    MethodDescriptor method;
    assert (parameterNames.length == parameterTypes.length) : "Number of parameter names different from number of parameter types.";
    assert (parameterNames.length == actualParameterTypes.length) :
            "Number of parameter names different from number of actual parameters.";

    try
    {
      int numParams = parameterNames.length;
      ParameterDescriptor[] parameters = new ParameterDescriptor[numParams];
      for( int i = 0; i < numParams; i++ )
      {
        parameters[i] = new TypedParameterDescriptor( parameterNames[i], parameterTypes[i] );
      }

      method = new MethodDescriptor( actionClass.getMethod( methodName, actualParameterTypes ), parameters );
    }
    catch( NoSuchMethodException e )
    {
      throw new RuntimeException( e );
    }
    catch( SecurityException e )
    {
      throw new RuntimeException( e );
    }
    return method;
  }
1326003
function customizeMethods(custom) {
  _.each(custom, function(classMethods, className) {
    _.extend(xml2js.CLASSES[className].methods, _.pick(classMethods, function(methodSpec, methodName) {
      return isValidMethodSpec(methodSpec, className + '.' + methodName);
    }));
  });
}
993199
public static void addArgument(MethodCallExpr call, Expression arg) {
        List<Expression> args = call.getArgs();
        if (args == null) {
            args = new ArrayList<Expression>();
            call.setArgs(args);
        }
        args.add(arg);
    }
941812
private void processArgument() {
        final StringBuilder argumentBuilder = new StringBuilder();
        while (templateReader.hasNextCharacter()) {
            final char argumentCharacter = templateReader.nextCharacter();
            if (argumentCharacter == syntax.getArgumentClosing()) {
                final String argument = argumentBuilder.toString().trim(); // Getting actual argument name.
                if (Strings.startsWith(argument, syntax.getEquationMarker())) {
                    // Starts with an equation sign. Evaluating.
                    final String equation = LmlUtilities.stripMarker(argument);
                    templateReader.append(newEquation().getResult(equation), equation + " equation");
                } else if (Strings.startsWith(argument, syntax.getConditionMarker())) {
                    // Condition/ternary operator. Evaluating.
                    processConditionArgument(argument, argumentBuilder);
                } else { // Regular argument. Looking for value mapped to the selected key.
                    templateReader.append(Nullables.toString(data.getArgument(argument)), argument + " argument");
                }
                return;
            }
            argumentBuilder.append(argumentCharacter);
        }
    }
55048
public static <T> WithOrWithoutExpectedArguments<T> when(Class<?> cls, Method method) {
        return new DefaultMethodExpectationSetup<T>(cls, method);
    }
1288722
private function buildArgumentArray(array $params, ArrayCollection $methodArguments)
    {
        $arguments = [];

        $sort = Criteria::create();
        $sort->orderBy(['order' => Criteria::ASC]);
        $methodArguments = $methodArguments->matching($sort);

        for ($i = 0; $i < count($params); $i++) {
            if (!isset($methodArguments[$i])) {
                break;
            }

            /** @var \ReflectionParameter $param */
            $param = $params[$i];

            /** @var ArgumentDocument $argument */
            $argument = $methodArguments[$i];

            $callback = $argument->getCallback();
            $value = $argument->getValue();

            $argumentValue = null;
            if (null !== $callback) {
                $argumentValue = $this->call($callback);
            } else if (null !== $value) {
                $argumentValue = $argument->getValue();
            } else {
                throw new MissingMethodArgumentException(
                    sprintf(
                        'The argument at position %d has no value or callback defined',
                        $argument->getOrder()
                    )
                );
            }

            $paramType = $param->getClass();
            if (null !== $paramType || is_object($argumentValue)) {
                if (null !== $paramType) {
                    $paramType = $paramType->getName();
                }

                $argumentType = null;
                if (is_object($argumentValue)) {
                    $argumentType = get_class($argumentValue);
                }

                if ($argumentType !== $paramType) {
                    throw new BadArgumentTypeException(
                        sprintf(
                            'The argument at position %d was expected to be of type "%s"',
                            $argument->getOrder(),
                            $paramType
                        )
                    );
                }
            }

            $arguments[] = $argumentValue;
        }

        return $arguments;
    }
1035116
public @NotNull String build() {
    SortedMap<String, Object> sortedParameterMap = new TreeMap<>(parameterMap);

    // gather resource paths in a treeset (having them in a defined order helps with caching)
    SortedSet<String> resourcePathsSet = new TreeSet<>();

    // iterate over all parts that should be kept from the current request
    for (String nextPart : initialSuffixParts) {
      // if this is a key-value-part:
      if (nextPart.indexOf(KEY_VALUE_DELIMITER) > 0) {
        String key = decodeKey(nextPart);
        // decode and keep the part if it is not overridden in the given parameter-map
        if (!sortedParameterMap.containsKey(key)) {
          String value = decodeValue(nextPart);
          sortedParameterMap.put(key, value);
        }
      }
      else {
        // decode and keep the resource paths (unless they are specified again in resourcePaths)
        String path = decodeResourcePathPart(nextPart);
        if (!resourcePaths.contains(path)) {
          resourcePathsSet.add(path);
        }
      }
    }

    // copy the resources specified as parameters to the sorted set of paths
    if (resourcePaths != null) {
      resourcePathsSet.addAll(ImmutableList.copyOf(resourcePaths));
    }

    // gather all suffix parts in this list
    List<String> suffixParts = new ArrayList<>();

    // now encode all resource paths
    for (String path : resourcePathsSet) {
      suffixParts.add(encodeResourcePathPart(path));
    }

    // now encode all entries from the parameter map
    for (Entry<String, Object> entry : sortedParameterMap.entrySet()) {
      Object value = entry.getValue();
      if (value == null) {
        // don't add suffix part if value is null
        continue;
      }
      String encodedKey = encodeKeyValuePart(entry.getKey());
      String encodedValue = encodeKeyValuePart(value.toString());
      suffixParts.add(encodedKey + KEY_VALUE_DELIMITER + encodedValue);
    }

    // finally join these parts to a single string
    return StringUtils.join(suffixParts, SUFFIX_PART_DELIMITER);
  }
564067
def _build_args(method, ip, comment):
    '''
    
    '''
    opt = _get_opt(method)
    args = '{0} {1}'.format(opt, ip)
    if comment:
        args += ' {0}'.format(comment)
    return args
636803
public void buildMethodComments(XMLNode node, Content methodDocTree) {
        if (!configuration.nocomment) {
            ExecutableElement method = currentMethod;
            if (utils.getFullBody(currentMethod).isEmpty()) {
                DocFinder.Output docs = DocFinder.search(configuration,
                        new DocFinder.Input(utils, currentMethod));
                if (docs.inlineTags != null && !docs.inlineTags.isEmpty())
                        method = (ExecutableElement)docs.holder;
            }
            TypeMirror containingType = method.getEnclosingElement().asType();
            writer.addComments(containingType, method, methodDocTree);
        }
    }
167292
protected function buildSortParameter() {
        $sorts = $this->getIndexCriteria()->getSorts();
        if(!empty($sorts)) {
            $orderBy = '';
            foreach($sorts as $sort) {
                $this->buildSortRecursive($this->getEntityFactory(), $sort->getFields(), $sort->isAsc(), $orderBy);
            }
            $this->getCriteria()->orderBy($orderBy);
        }
    }
808905
private void verifyArguments(JmxExecRequest request, OperationAndParamType pTypes, int pNrParams, List<Object> pArgs) {
        if ( (pNrParams > 0 && pArgs == null) || (pArgs != null && pArgs.size() != pNrParams)) {
            throw new IllegalArgumentException("Invalid number of operation arguments. Operation " +
                    request.getOperation() + " on " + request.getObjectName() + " requires " + pTypes.paramClasses.length +
                    " parameters, not " + (pArgs == null ? 0 : pArgs.size()) + " as given");
        }
    }
1070826
def build_params(self, params, i):
        
        prefix = 'Tags.member.%d.' % i
        params[prefix+'ResourceId'] = self.resource_id
        params[prefix+'ResourceType'] = self.resource_type
        params[prefix+'Key'] = self.key
        params[prefix+'Value'] = self.value
        if self.propagate_at_launch:
            params[prefix+'PropagateAtLaunch'] = 'true'
        else:
            params[prefix+'PropagateAtLaunch'] = 'false'
739239
private void buildPluralMethod(
      TypeSpec.Builder type, String pluralType, Map<String, PluralData> pluralMap, Map<String, FieldSpec> fieldMap) {

    MethodSpec.Builder method = MethodSpec.methodBuilder("eval" + pluralType)
        .addModifiers(PUBLIC)
        .addParameter(String.class, "language")
        .addParameter(NUMBER_OPERANDS, "o")
        .returns(PLURAL_CATEGORY);

    method.beginControlFlow("switch (language)");

    List<MethodSpec> ruleMethods = new ArrayList<>();
    for (Map.Entry<String, PluralData> entry : pluralMap.entrySet()) {
      String language = entry.getKey();
      String methodName = String.format("eval%s%s", pluralType, language.toUpperCase());
      method.addStatement("case $S:\n  return $L(o)", language, methodName);

      MethodSpec ruleMethod = buildRuleMethod(methodName, entry.getValue(), fieldMap);
      ruleMethods.add(ruleMethod);
    }

    method.addStatement("default:\n  return null");

    method.endControlFlow();
    type.addMethod(method.build());

    for (MethodSpec ruleMethod : ruleMethods) {
      type.addMethod(ruleMethod);
    }
  }