Handles the 'o' command.

        :glob: Whether to store specified options globally.
        :args: Arguments supplied to the 'o' command (excluding '-g').
359838
def options(self, glob=False, **args):
        
        kwargs = {}
        for argname, argarg in args.items():
            if argname == "sort":
                argarg = self._getPattern(argarg)
            if argname not in ["done", "undone"]:
                kwargs[argname] = argarg
        if "done" in args or "undone" in args:
            kwargs["done"] = self._getDone(
                args.get("done"), args.get("undone")
            )

        self.model.setOptions(glob=glob, **kwargs)
1078514
def handle_cmd_options():
    '''
    
    '''
    parser = OptionParser()
    parser.add_option("-s", "--silent", action="store_true", dest="silent",
                      help="print any warnings", default=False)
    (options, args) = parser.parse_args()
    return options, args
34849
def handle_basic_container_args(options, parser=None):
    
    dir_modes = {}
    error_fn = parser.error if parser else sys.exit

    def handle_dir_mode(path, mode):
        path = os.path.abspath(path)
        if not os.path.isdir(path):
            error_fn(
                "Cannot specify directory mode for '{}' because it does not exist or is no directory."
                .format(path))
        if path in dir_modes:
            error_fn("Cannot specify multiple directory modes for '{}'.".format(path))
        dir_modes[path] = mode

    for path in options.hidden_dir:
        handle_dir_mode(path, DIR_HIDDEN)
    for path in options.read_only_dir:
        handle_dir_mode(path, DIR_READ_ONLY)
    for path in options.overlay_dir:
        handle_dir_mode(path, DIR_OVERLAY)
    for path in options.full_access_dir:
        handle_dir_mode(path, DIR_FULL_ACCESS)

    if options.keep_tmp:
        if "/tmp" in dir_modes and not dir_modes["/tmp"] == DIR_FULL_ACCESS:
            error_fn("Cannot specify both --keep-tmp and --hidden-dir /tmp.")
        dir_modes["/tmp"] = DIR_FULL_ACCESS
    elif not "/tmp" in dir_modes:
        dir_modes["/tmp"] = DIR_HIDDEN

    if not "/" in dir_modes:
        dir_modes["/"] = DIR_OVERLAY
    if not "/run" in dir_modes:
        dir_modes["/run"] = DIR_HIDDEN

    if options.container_system_config:
        if options.network_access:
            logging.warning("The container configuration disables DNS, "
                "host lookups will fail despite --network-access. "
                "Consider using --keep-system-config.")
    else:
        # /etc/resolv.conf is necessary for DNS lookups and on many systems is a symlink
        # to either /run/resolvconf/resolv.conf or /run/systemd/resolve/sub-resolve.conf,
        # so we keep that directory accessible as well.
        if not "/run/resolvconf" in dir_modes and os.path.isdir("/run/resolvconf"):
            dir_modes["/run/resolvconf"] = DIR_READ_ONLY
        if not "/run/systemd/resolve" in dir_modes and os.path.isdir("/run/systemd/resolve"):
            dir_modes["/run/systemd/resolve"] = DIR_READ_ONLY

    return {
        'network_access': options.network_access,
        'container_tmpfs': options.tmpfs,
        'container_system_config': options.container_system_config,
        'dir_modes': dir_modes,
        }
1126185
def glob(cls, files=None):
        '''
        
        '''
        files = files or []
        if isinstance(files, str):
            files = os.path.normpath(files)
            matches = lambda path: matches_patterns(path, [files])
            return [path for path in cls.get_static_files() if matches(path)]
        elif isinstance(files, (list, tuple)):
            all_files = cls.get_static_files()
            files = [os.path.normpath(f) for f in files]
            sorted_result = []
            for pattern in files:
                sorted_result.extend([f for f in all_files if matches_patterns(f, [pattern])])
            return sorted_result
1069210
def handle_args(args):
  
  parser = argparse.ArgumentParser()
  parser.add_argument("configpath", default=None, nargs="?",
                      help="/path/to/configs (always a directory; if omitted, all /configs are checked")
  parser.add_argument("--verbose", action="store_true", default=False)
  parsed_args = vars(parser.parse_args(args))
  # If a config path wasn't given, calculate it based on location of the script
  if parsed_args["configpath"] is None:
    script_dir = os.path.abspath(os.path.dirname(sys.argv[0]))
    parsed_args["configpath"] = os.path.normpath("{}/{}".format(script_dir, CONFIGS_RELATIVE_PATH_FROM_SCRIPT_DIR))
  else:
    parsed_args["configpath"] = os.path.normpath(parsed_args["configpath"])
  # If the path is a directory, all good. if it's a file, find the directory the file is in and check that instead
  if os.path.isdir(parsed_args["configpath"]):
    parsed_args["configdir"] = parsed_args["configpath"]
  else:
    parsed_args["configdir"] = os.path.dirname(parsed_args["configpath"])
  return parsed_args
1081963
def handle_options(argv) # :nodoc:
      set_default_options

      OptionParser.new do |opts|
        opts.banner = "#{Rake.application.name} [-f rakefile] {options} targets..."
        opts.separator ""
        opts.separator "Options are ..."

        opts.on_tail("-h", "--help", "-H", "Display this help message.") do
          puts opts
          exit
        end

        standard_rake_options.each { |args| opts.on(*args) }
        opts.environment("RAKEOPT")
      end.parse(argv)
    end
224783
def isglob(value):
    
    if os.name == 'nt':
        if isinstance(value, basestring):
            value = glob.glob(value)
    return value
921612
def global_option_proc(switches, &block)
      lambda do |value|
        unless active_command.nil?
          active_command.proxy_options << [Runner.switch_to_sym(switches.last), value]
        end
        yield value if block && !value.nil?
      end
    end
4670
def handle(self, *args, **options):
        
        self._connection = Auth()._get_connection()

        if len(args) == 0:
            containers = self._connection.list_containers()
            if not containers:
                print("No containers were found for this account.")
        elif len(args) == 1:
            containers = self._connection.list_container_object_names(args[0])
            if not containers:
                print("No matching container found.")
        else:
            raise CommandError("Pass one and only one [container_name] as an argument")

        for container in containers:
            print(container)
371396
def _expand_argument(self, arg):
        
        if isinstance(arg, R): return [arg.str]
        scope = self._scope or self._exports
        arg = arg % scope
        arg = os.path.expanduser(arg)
        res = glob.glob(self._expand_path(arg))
        if not res: return [arg]
        if self._cwd != "/":
            for idx in xrange(0, len(res)):
                if res[idx].startswith(self._cwd + "/"):
                    res[idx] = "./" + res[idx][len(self._cwd + "/"):]
        return res
1321661
def _arg2opt(arg):
    '''
    
    '''
    res = [o for o, a in option_toggles.items() if a == arg]
    res += [o for o, a in option_flags.items() if a == arg]
    return res[0] if res else None
786022
def sort(args):
    
    valid_sort_methods = ("unix", "topo")

    p = OptionParser(sort.__doc__)
    p.add_option("--method", default="unix", choices=valid_sort_methods,
                 help="Specify sort method [default: %default]")
    p.add_option("-i", dest="inplace", default=False, action="store_true",
                 help="If doing a unix sort, perform sort inplace [default: %default]")
    p.set_tmpdir()
    p.set_outfile()
    p.set_home("gt")
    opts, args = p.parse_args(args)

    if len(args) != 1:
        sys.exit(not p.print_help())

    gffile, = args
    sortedgff = opts.outfile
    if opts.inplace:
        if opts.method == "topo" or (opts.method == "unix" and gffile in ("-", "stdin")):
            logging.error("Cannot perform inplace sort when method is `topo`" + \
                " or method is `unix` and input is `stdin` stream")
            sys.exit()

    if opts.method == "unix":
        cmd = "sort"
        cmd += " -k1,1 -k4,4n {0}".format(gffile)
        if opts.tmpdir:
            cmd += " -T {0}".format(opts.tmpdir)
        if opts.inplace:
            cmd += " -o {0}".gffile
            sortedgff = None
        sh(cmd, outfile=sortedgff)
    elif opts.method == "topo":
        GT_HOME = opts.gt_home
        if not op.isdir(GT_HOME):
            logging.error("GT_HOME={0} directory does not exist".format(GT_HOME))
            sys.exit()
        cmd = "{0}".format(op.join(GT_HOME, "bin", "gt"))
        cmd += " gff3 -sort -tidy -retainids -addids no {0}".format(gffile)
        sh(cmd, outfile=sortedgff)
254250
def pngout(ext_args):
    """"""
    args = _PNGOUT_ARGS + [ext_args.old_filename, ext_args.new_filename]
    extern.run_ext(args)
    return _PNG_FORMAT
697009
def handle_default_args(args):
    

    if hasattr(args, 'pythonpath'):
        if args.pythonpath:
            sys.path.insert(0, args.pythonpath)
1131940
function (glob, opts) {
    if (opts.ignore) {
      this.map('exclude', opts.ignore, opts);
    }
    if (opts.exclude) {
      this.map('exclude', opts.exclude, opts);
    }
    if (opts.include) {
      this.map('include', opts.include, opts);
    }

    // if not disabled by the user, run the built-ins
    if (!this.disabled('builtins')) {
      if (!this.disabled('npm')) {
        this.use(npm(opts));
      }
      if (!this.disabled('dotfiles')) {
        this.use(dotfiles()(opts));
      }
      if (!this.disabled('gitignore')) {
        this.use(gitignore()(opts));
      }
    }
  }
286816
function (o, cb) {
    if (!o.src) {
      throw new Error('glob missing');
    }
    if (!o.out) {
      throw new Error('output dir missing');
    }

    var opts = _.extend({}, defaults, o);
    if (opts.style && path.basename(opts.style).indexOf('.') === -1) {
      opts.style = path.join(opts.style, replaceExtension(opts.name, '.' + opts.processor));
    }
    vfs.src(opts.src)
      .pipe(sprite(opts))
      .pipe(through2.obj(writeFile))
      .on('data', noop)
      .on('end', function () {
        if (_.isFunction(cb)) {
          cb();
        }
      });
  }
630763
def arguments(self, args):
        """"""
        self.args = args
        self.manage_flags()
        self.filename = self.args[0]
        if len(self.args) == 1 and self.args[0] in self.options[:2]:
            print(self.help.__doc__)
        elif len(self.args) == 1 and self.args[0] in self.options[2:4]:
            self.version()
        elif len(self.args) == 2 and self.args[0] in self.options[4:5]:
            self.filename = self.args[1]
            self.remove()
        elif len(self.args) == 2 and self.args[0] in self.options[6:7]:
            self.filename = self.args[1]
            self.remove()
        elif len(self.args) == 1:
            if os.path.isfile(self.args[0]):
                self.remove()
            else:
                self.not_access()
        else:
            self.usage()