Executes an HTTP OPTIONS.

        :Parameters:
           - `args`: Non-keyword arguments
           - `kwargs`: Keyword arguments
182375
def options(self, *args, **kwargs):
        
        return self.session.options(*args, **self.get_kwargs(**kwargs))
476137
def options(self, url, url_params=empty.dict, headers=empty.dict, timeout=None, **params):
        """"""
        return self.request('OPTIONS', url=url, headers=headers, timeout=timeout, **params)
518805
def _execute(self, logger: Logger, options: Dict[str, Dict[str, Any]]) -> T:
        
        pass
25823
def use_args(
        self,
        argmap: ArgMap,
        req: typing.Optional[Request] = None,
        locations: typing.Iterable = None,
        as_kwargs: bool = False,
        validate: Validate = None,
        error_status_code: typing.Optional[int] = None,
        error_headers: typing.Union[typing.Mapping[str, str], None] = None,
    ) -> typing.Callable[..., typing.Callable]:
        
        locations = locations or self.locations
        request_obj = req
        # Optimization: If argmap is passed as a dictionary, we only need
        # to generate a Schema once
        if isinstance(argmap, Mapping):
            argmap = core.dict2schema(argmap, self.schema_class)()

        def decorator(func: typing.Callable) -> typing.Callable:
            req_ = request_obj

            if inspect.iscoroutinefunction(func):

                @functools.wraps(func)
                async def wrapper(*args, **kwargs):
                    req_obj = req_

                    if not req_obj:
                        req_obj = self.get_request_from_view_args(func, args, kwargs)
                    # NOTE: At this point, argmap may be a Schema, callable, or dict
                    parsed_args = await self.parse(
                        argmap,
                        req=req_obj,
                        locations=locations,
                        validate=validate,
                        error_status_code=error_status_code,
                        error_headers=error_headers,
                    )
                    if as_kwargs:
                        kwargs.update(parsed_args or {})
                        return await func(*args, **kwargs)
                    else:
                        # Add parsed_args after other positional arguments
                        new_args = args + (parsed_args,)
                        return await func(*new_args, **kwargs)

            else:

                @functools.wraps(func)  # type: ignore
                def wrapper(*args, **kwargs):
                    req_obj = req_

                    if not req_obj:
                        req_obj = self.get_request_from_view_args(func, args, kwargs)
                    # NOTE: At this point, argmap may be a Schema, callable, or dict
                    parsed_args = yield from self.parse(  # type: ignore
                        argmap,
                        req=req_obj,
                        locations=locations,
                        validate=validate,
                        error_status_code=error_status_code,
                        error_headers=error_headers,
                    )
                    if as_kwargs:
                        kwargs.update(parsed_args)
                        return func(*args, **kwargs)  # noqa: B901
                    else:
                        # Add parsed_args after other positional arguments
                        new_args = args + (parsed_args,)
                        return func(*new_args, **kwargs)

            return wrapper

        return decorator
806959
def run(options, http_req_handler = HttpReqHandler):
    
    # pylint: disable-msg=W0613
    global _HTTP_SERVER

    for x in ('server_version', 'sys_version'):
        if _OPTIONS.get(x) is not None:
            setattr(http_req_handler, x, _OPTIONS[x])

    _HTTP_SERVER = threading_tcp_server.KillableThreadingHTTPServer(
                       _OPTIONS,
                       (_OPTIONS['listen_addr'], _OPTIONS['listen_port']),
                       http_req_handler,
                       name = "httpdis")

    for name, cmd in _COMMANDS.iteritems():
        if cmd.at_start:
            LOG.info("at_start: %r", name)
            cmd.at_start(options)

    LOG.info("will now serve")
    while not _KILLED:
        try:
            _HTTP_SERVER.serve_until_killed()
        except (socket.error, select.error), why:
            if errno.EINTR == why[0]:
                LOG.debug("interrupted system call")
            elif errno.EBADF == why[0] and _KILLED:
                LOG.debug("server close")
            else:
                raise

    LOG.info("exiting")
18010
def _http_request(self, method, url, request_kwargs=None):
        

        kwargs = request_kwargs if request_kwargs is not None else {}

        headers = self._request_headers()
        headers.update(self.additional_headers)
        if 'headers' in kwargs:
            headers.update(kwargs['headers'])
        kwargs['headers'] = headers

        if self._has_proxy():
            kwargs['proxies'] = self._proxy_parameters()

        request_url = self._url(
            url,
            file_upload=kwargs.pop('file_upload', False)
        )

        request_method = getattr(requests, method)
        response = request_method(request_url, **kwargs)

        if response.status_code == 429:
            raise RateLimitExceededError(response)

        return response
811453
def execute(self):
        
        #Initialize the option parser
        parser = LaxOptionParser(
            usage="%prog subcommand [options] [args]",
            option_list=BaseCommand.option_list #This will define what is allowed input to the parser (ie --settings=)
        )

        #Parse the options
        options, args = parser.parse_args(self.argv)
        #Handle --settings and --pythonpath properly
        options = handle_default_options(options)

        try:
            #Get the name of the subcommand
            subcommand = self.argv[1]
        except IndexError:
            #If the subcommand name cannot be found, set it to help
            subcommand = 'help'

        #If the subcommand is help, print the usage of the parser, and available command names
        if subcommand == 'help':
            if len(args) <= 2:
                parser.print_help()
                sys.stdout.write(self.help_text + '\n')
        else:
            #Otherwise, run the given command
            self.fetch_command(subcommand).run_from_argv(self.argv)
1308787
def run(self, args, options):
        
        config.LOGGER.info('In SushiChef.run method. args=' + str(args) + 'options=' + str(options))
        self.pre_run(args, options)
        uploadchannel_wrapper(self, args, options)
468578
def execute(self, request, *args, **path_args):
        # type: (BaseHttpRequest, tuple, Dict[Any]) -> Any
        
        binding = self.binding
        if binding:
            # Provide binding as decorators are executed prior to binding
            return self.callback(binding, request, *args, **path_args)
        else:
            return self.callback(request, *args, **path_args)
910169
def execute(self):
        
        try:
            subcommand = self.argv[1]
        except IndexError:
            subcommand = 'help'  # Display help if no arguments were given.

        # Preprocess options to extract --settings and --pythonpath.
        # These options could affect the commands that are available, so they
        # must be processed early.
        parser = CommandParser(None, usage="%(prog)s subcommand [options] [args]", add_help=False)
        parser.add_argument('--settings')
        parser.add_argument('--pythonpath')
        parser.add_argument('args', nargs='*')  # catch-all
        try:
            options, args = parser.parse_known_args(self.argv[2:])
            handle_default_options(options)
        except CommandError:
            pass  # Ignore any option errors at this point.

        no_settings_commands = [
            'help', 'version', '--help', '--version', '-h',
            'compilemessages', 'makemessages',
            'startapp', 'startproject',
        ]

        try:
            settings.INSTALLED_APPS
        except ImproperlyConfigured as exc:
            self.settings_exception = exc
            # A handful of built-in management commands work without settings.
            # Load the default settings -- where INSTALLED_APPS is empty.
            if subcommand in no_settings_commands:
                settings.configure()

        if settings.configured:
            django.setup()

        self.autocomplete()

        if subcommand == 'help':
            if '--commands' in args:
                sys.stdout.write(self.main_help_text(commands_only=True) + '\n')
            elif len(options.args) < 1:
                sys.stdout.write(self.main_help_text() + '\n')
            else:
                self.fetch_command(options.args[0]).print_help(self.prog_name, options.args[0])
        # Special cases for 'jira.py --version' and 'jira.py --help' to work.
        elif subcommand == 'version' or self.argv[1:] == ['--version']:
            sys.stdout.write(django.get_version() + '\n')
        elif self.argv[1:] in (['--help'], ['-h']):
            sys.stdout.write(self.main_help_text() + '\n')
        else:
            self.fetch_command(subcommand).run_from_argv(self.argv)
99462
def options(self, *args, **kwargs):
        '''
        
        '''
        # Allow X-Auth-Token in requests
        request_headers = self.request.headers.get('Access-Control-Request-Headers')
        allowed_headers = request_headers.split(',')

        # Filter allowed header here if needed.

        # Allow request headers
        self.set_header('Access-Control-Allow-Headers', ','.join(allowed_headers))

        # Allow X-Auth-Token in responses
        self.set_header('Access-Control-Expose-Headers', 'X-Auth-Token')

        # Allow all methods
        self.set_header('Access-Control-Allow-Methods', 'OPTIONS, GET, POST')

        self.set_status(204)
        self.finish()
246918
def request_args(self):
        '''
        
        '''
        kwargs = {}
        kwargs.update(self.request.match_info.items())
        kwargs.update(self.request.query.items())
        return kwargs
328908
def set_options(self, **kwargs):
        
        options = self.options
        options.update(kwargs)
        self.update(options=options)
1278164
def exec(self, args):
        

        logger.debug("update %s", args.update)
        self.update(args.update)
418129
def _execute_callback(self, *args):
        ""
        self._validate_key(args)      # Validate input key

        # Additional validation needed to ensure kwargs don't clash
        kdims = [kdim.name for kdim in self.kdims]
        kwarg_items = [s.contents.items() for s in self.streams]
        hash_items = tuple(tuple(sorted(s.hashkey.items())) for s in self.streams)+args
        flattened = [(k,v) for kws in kwarg_items for (k,v) in kws
                     if k not in kdims]

        if self._posarg_keys:
            kwargs = dict(flattened, **dict(zip(self._posarg_keys, args)))
            args = ()
        else:
            kwargs = dict(flattened)
        if not isinstance(self.callback, Generator):
            kwargs['_memoization_hash_'] = hash_items

        with dynamicmap_memoization(self.callback, self.streams):
            retval = self.callback(*args, **kwargs)
        return self._style(retval)
492530
def run_cmd(self, *args, **kwargs):
        
        timeout = kwargs.pop('timeout', None)
        p = self.raw_cmd(*args, **kwargs)
        return p.communicate(timeout=timeout)[0].decode('utf-8').replace('\r\n', '\n')
1006778
def execute(self, *args, **kwargs):
        
        args = self.parser.parse_args(*args, **kwargs)
        self.process(args)