Call with no argument to use default
772951
def load_format requested_format = nil
      raise ArgumentError, "Requested format not supported" if !requested_format.nil? && @@formats[requested_format].nil?
      @format = requested_format || @@default_format
      attempted_formats = ""

      begin
        attempted_formats += @@formats[@format][:require]
        require @@formats[@format][:require]
        return true
      rescue LoadError
        # If the user requested the format and it failed. Just give up!
        raise Error("Please install: '#{@@formats[@format][:require]}' to use #{@format} format.") unless requested_format.nil?

        # Otherwise lets exhaust all our other options first
        available_formats = @@formats
        available_formats.delete(@format)
        
        available_formats.each_key do |format|
          begin
            attempted_formats += ", "            
            require @@formats[format][:require]
            
            @format = format
            return true
          rescue LoadError
            attempted_formats += @@formats[format][:require]
          end
        end
        
        raise Error, "Could not find any suitable library to parse response with, tried: #{attempted_formats}. Please install one of these to use OEmbed."
      end      
    end
473379
def default_settings(params):
    
    def _default_settings(fn, command):
        for k, w in params.items():
            settings.setdefault(k, w)
        return fn(command)
    return decorator(_default_settings)
142919
public void constructFault(FaultException faultException, Object argument)
	{
		
		//check argument
		if(argument != null && faultException.getArgument() == null)
			faultException.setArgument(argument);
		

		StackTraceElement stackTraceElement = null;
		if(faultException.getModule() == null)
		{
			if(this.defaultModule != null && this.defaultModule.length() > 0)
				faultException.setModule(defaultModule);
			else
			{
				stackTraceElement = determineCauseStackTraceElementsn(faultException);
				
				if(stackTraceElement != null)
					faultException.setModule(stackTraceElement.getFileName());
			}
				
		}
		
		if(faultException.getOperation() == null)
		{
			if(this.defaultOperation != null && this.defaultOperation.length() > 0)
				faultException.setOperation(this.defaultOperation);
			else
			{
				if(stackTraceElement == null)
					stackTraceElement = determineCauseStackTraceElementsn(faultException);
				
				if(stackTraceElement != null)
					faultException.setOperation(stackTraceElement.getMethodName());
				
				
				//add line number
				if((faultException.getNotes() == null || faultException.getNotes().length() == 0) && stackTraceElement != null)
				{
					faultException.setNotes(lineNumberNotePrefix+stackTraceElement.getLineNumber());
					
				}
			}
			
			
		}
		
		
		
	}
18997
def arg_default(*args, **kwargs):
    
    parser = argparse.ArgumentParser()
    parser.add_argument(*args, **kwargs)
    args = vars(parser.parse_args([]))
    _, default = args.popitem()
    return default
1153455
def method_missing(cmd, options={}, *args, &block)
      native(cmd, options, *args, &block)
    end
1092194
function parseCall(source, defaultArgs) {
    var expr = readCall(new Walker(source), defaultArgs);

    if (expr.type !== ExprType.CALL) {
        expr = {
            type: ExprType.CALL,
            name: expr,
            args: defaultArgs || []
        };
    }

    expr.raw = source;
    return expr;
}
55242
def _internal_function_call(self, call_conf):
        '''
        
        '''
        def stub(*args, **kwargs):
            message = 'Function {} is not available'.format(call_conf['fun'])
            self.out.error(message)
            log.debug(
                'Attempt to run "%s" with %s arguments and %s parameters.',
                call_conf['fun'], call_conf['arg'], call_conf['kwargs']
            )
            return message

        return getattr(salt.cli.support.intfunc,
                       call_conf['fun'], stub)(self.collector,
                                               *call_conf['arg'],
                                               **call_conf['kwargs'])
810429
def _none():
    """"""

    Mock = type("Mock", (), {"__getattr__": lambda Qt, attr: None})

    Qt.__binding__ = "None"
    Qt.__qt_version__ = "0.0.0"
    Qt.__binding_version__ = "0.0.0"
    Qt.QtCompat.loadUi = lambda uifile, baseinstance=None: None
    Qt.QtCompat.setSectionResizeMode = lambda *args, **kwargs: None

    for submodule in _common_members.keys():
        setattr(Qt, submodule, Mock())
        setattr(Qt, "_" + submodule, Mock())
39824
def parse_int_arg(name, default):
    """"""
    return default if request.args.get(name) is None \
        else int(request.args.get(name))
237489
def parent(version=None, include=None):
    '''
    
    '''
    parser = argparse.ArgumentParser(add_help=False)
    add_default_args(parser, version=version, include=include)
    return parser
1214290
def add_argument(self, name, value_type, item_help, default=None):
    
    if value_type and value_type not in self.__restricted_types:
      raise ArgumentException("Named argument couldn't have {} type".format(value_type.__name__))

    if default is not None and not isinstance(default, value_type):
      raise ArgumentException("Invalid default type for argument".format(name))

    if value_type is bool and default is None:
      default = False

    self._args.update({
      name: ModuleArgumentItem(name, value_type, item_help, default)
    })
    return self
953883
def set_default(self, default):  # type: (typing.Any) -> None
        
        if default is not None and len(default) > 1 and default[0] == '"' and default[-1] == '"':
            default = default[1:-1]
        self.defaultValue = default
1030062
def call(self, name, args=None):  # type: (str, Optional[str]) -> int
        
        if args is None:
            args = ""

        args = StringArgs(args)
        command = self.application.get_command(name)

        return command.run(args, self.io)
372520
function(fun /*, defaults */) {
      var defaults = _.rest(arguments);

      return function(/*args*/) {
        var args = _.toArray(arguments);
        var sz = _.size(defaults);

        for(var i = 0; i < sz; i++) {
          if (!existy(args[i]))
            args[i] = defaults[i];
        }

        return fun.apply(this, args);
      };
    }
1177879
def exec_argparse_funckw(func, globals_=None, defaults={}, **kwargs):
    
    import utool as ut
    funckw = ut.get_func_kwargs(func)
    funckw.update(defaults)
    parsekw = ut.argparse_dict(funckw, **kwargs)
    if globals_:
        globals_.update(parsekw)
    return parsekw
435732
function defaultGetCallingScript(offset = 0) {
	const stack = (new Error).stack.split(/$/m);
	const line = stack[(/^Error/).test(stack[0]) + 1 + offset];
	const parts = line.split(/@(?![^/]*?\.xpi)|\(|\s+/g);
	return parts[parts.length - 1].replace(/:\d+(?::\d+)?\)?$/, '');
}
993183
def call_command(self, name, *arguments, **options):
        
        command, defaults = get_command_and_defaults(
            name,
            exclude_packages=self.get_exclude_packages(),
            exclude_command_class=self.__class__)
        if command is None:
            raise management.CommandError(
                "Unknown command: {name:s}".format(
                    name=name))
        defaults.update(options)
        return command.execute(*arguments, **defaults)