Get the fetch options from the given merge dict.
511075
def _fetch_options(self, merge):
        """"""
        cmd = tuple()
        for option in FETCH_DEFAULTS:
            value = merge.get(option, self.defaults.get(option))
            if value:
                cmd += ("--%s" % option, str(value))
        return cmd
912014
def get(self):
        
        return {k:v for k,v in list(self.options.items()) if k in self._allowed_axes}
50842
function mergeOptions(parsedOptions) {
    return Object.keys(autoflowOptions).reduce(function (accum, k) {
      if (!accum[k]) accum[k] = autoflowOptions[k];
      return accum;
    }, parsedOptions);
  }
86332
def get_merged_config(self):
        
        if self.yamldocs:
            return

        loadfiles = []
        if self.configfile:
            loadfiles.append(self.configfile)

        if self.configdir:
            # Gets list of all non-dotfile files from configdir.
            loadfiles.extend(
                [f for f in
                 [os.path.join(self.configdir, x) for x in
                  os.listdir(self.configdir)]
                 if os.path.isfile(f) and
                 not os.path.basename(f).startswith('.')])

        merged_configfile = io.StringIO()
        merged_configfile.write('-\n')
        for thefile in loadfiles:
            self.logdebug('reading in config file %s\n' % thefile)
            merged_configfile.write(open(thefile).read())
            merged_configfile.write('\n-\n')
        merged_configfile.seek(0)
        self.logdebug('merged log file: """\n%s\n"""\n' %
                      merged_configfile.read())
        merged_configfile.seek(0)
        return merged_configfile
1158110
def get_repos(config, force=False):
    
    repo_list = []
    for directory, repo_data in config.items():
        if not os.path.isabs(directory):
            directory = os.path.abspath(directory)
        repo_dict = {
            'cwd': directory,
            'defaults': repo_data.get('defaults', dict()),
            'force': force,
        }
        remote_names = set()
        if 'remotes' in repo_data:
            repo_dict['remotes'] = []
            remotes_data = repo_data['remotes'] or {}
            for remote_name, url in remotes_data.items():
                if not url:
                    raise ConfigException(
                        '%s: No url defined for remote %s.' %
                        (directory, remote_name))
                remote_dict = {
                    'name': remote_name,
                    'url': url
                }
                repo_dict['remotes'].append(remote_dict)
                remote_names.add(remote_name)
            if not remote_names:
                raise ConfigException(
                    '%s: You should at least define one remote.' % directory)
        else:
            raise ConfigException('%s: remotes is not defined.' % directory)
        if 'merges' in repo_data:
            merges = []
            merge_data = repo_data.get('merges') or []
            for merge in merge_data:
                try:
                    # Assume parts is a str
                    parts = merge.split(' ')
                    if len(parts) != 2:
                        raise ConfigException(
                            '%s: Merge must be formatted as '
                            '"remote_name ref".' % directory)
                    merge = {
                        "remote": parts[0],
                        "ref": parts[1],
                    }
                except AttributeError:
                    # Parts is a dict
                    try:
                        merge["remote"] = str(merge["remote"])
                        merge["ref"] = str(merge["ref"])
                    except KeyError:
                        raise ConfigException(
                            '%s: Merge lacks mandatory '
                            '`remote` or `ref` keys.' % directory)
                # Check remote is available
                if merge["remote"] not in remote_names:
                    raise ConfigException(
                        '%s: Merge remote %s not defined in remotes.' %
                        (directory, merge["remote"]))
                merges.append(merge)
            repo_dict['merges'] = merges
            if not merges:
                raise ConfigException(
                    '%s: You should at least define one merge.' % directory)
        else:
            raise ConfigException(
                '%s: merges is not defined.' % directory)
        # Only fetch required remotes by default
        repo_dict["fetch_all"] = repo_data.get("fetch_all", False)
        if isinstance(repo_dict["fetch_all"], string_types):
            repo_dict["fetch_all"] = frozenset((repo_dict["fetch_all"],))
        elif isinstance(repo_dict["fetch_all"], list):
            repo_dict["fetch_all"] = frozenset(repo_dict["fetch_all"])
        if 'target' not in repo_data:
            raise ConfigException('%s: No target defined.' % directory)
        parts = (repo_data.get('target') or "") .split(' ')
        if len(parts) != 2:
            raise ConfigException(
                '%s: Target must be formatted as '
                '"remote_name branch_name"' % directory)

        remote_name, branch = repo_data.get('target').split(' ')
        if remote_name not in remote_names:
            raise ConfigException(
                '%s: Target remote %s not defined in remotes.' %
                (directory, remote_name))
        repo_dict['target'] = {
            'remote': remote_name,
            'branch': branch,
        }
        commands = []
        if 'shell_command_after' in repo_data:
            cmds = repo_data['shell_command_after']
            # if str: turn to list
            if cmds:
                if isinstance(cmds, string_types):
                    cmds = [cmds]
                commands = cmds
        repo_dict['shell_command_after'] = commands
        repo_list.append(repo_dict)
    return repo_list
1210248
def fetch(self):
        
        params = values.of({})

        payload = self._version.fetch(
            'GET',
            self._uri,
            params=params,
        )

        return AddOnResultInstance(
            self._version,
            payload,
            account_sid=self._solution['account_sid'],
            reference_sid=self._solution['reference_sid'],
            sid=self._solution['sid'],
        )
943598
def get_options(server):
    """"""
    try:
        response = requests.options(
            server, allow_redirects=False, verify=False, timeout=5)
    except (requests.exceptions.ConnectionError,
            requests.exceptions.MissingSchema):
        return "Server {} is not available!".format(server)

    try:
        return {'allowed': response.headers['Allow']}
    except KeyError:
        return "Unable to get HTTP methods"
334514
def merge_dicts(*dicts, **kwargs):
    """"""
    result = {}
    for d in dicts:
        result.update(d)
    result.update(kwargs)
    return result
431658
def fetch(self, spec=None, *args, **kwargs):
        
        if spec is None:
            spec = {}
        for key in self.structure:
            if key in spec:
                if isinstance(spec[key], dict):
                    spec[key].update({'$exists': True})
            else:
                spec[key] = {'$exists': True}
        return self.find(spec, *args, **kwargs)
7809
function mergeOptions(...opt){
        // extract default (last argument)
        const result = opt.pop();

        // try to find first match
        while (opt.length > 0){
            // extract first argument (priority)
            const o = opt.shift();

            // value set ?
            if (typeof o !== 'undefined' && o !== null){
                return o;
            }
        }

        return result;
    }
627199
def find_harpoon_options(self, configuration, args_dict):
        """"""
        d = lambda r: {} if r in (None, "", NotSpecified) else r
        return MergedOptions.using(
              dict(d(configuration.get('harpoon')).items())
            , dict(d(args_dict.get("harpoon")).items())
            ).as_dict()
273922
def option(self, opt):
        '''
        
        '''
        if 'config.merge' in self.functions:
            return self.functions['config.merge'](opt, {}, omit_master=True)
        return self.opts.get(opt, {})
785073
def fetch(self, end=values.unset, start=values.unset):
        
        return self._proxy.fetch(end=end, start=start, )
1041716
def fetch_all(options = {})
      options = { :prune => false }.merge(options)
      git_args = ['--all']
      git_args << '--prune' if options[:prune]
      fetch(git_args)
      fetch('--tags')  # need a separate call for tags or else you don't get all the tags
      true
    end
297374
def fetch(self):
        
        params = values.of({})

        payload = self._version.fetch(
            'GET',
            self._uri,
            params=params,
        )

        return CallSummaryInstance(self._version, payload, call_sid=self._solution['call_sid'], )
778872
def extract_options(options, names):
    
    result = {}
    for name, value in copy(options).items():
        if name in names:
            result[name] = value
            del options[name]
    return result
511239
def get_options(config=None):
    """"""
    if config is None:
        from . import config
        config.get = lambda key, default=None: getattr(config, key, default)

    base = {
        "components": config.get("COMPONENTS"),
        "signatures": config.get("SIGNATURES"),
        "commit_msg_template": config.get("COMMIT_MSG_TEMPLATE"),
        "commit_msg_labels": config.get("COMMIT_MSG_LABELS"),
        "alt_signatures": config.get("ALT_SIGNATURES"),
        "trusted": config.get("TRUSTED_DEVELOPERS"),
        "pep8": config.get("CHECK_PEP8", True),
        "pydocstyle": config.get("CHECK_PYDOCSTYLE", True),
        "license": config.get("CHECK_LICENSE", True),
        "pyflakes": config.get("CHECK_PYFLAKES", True),
        "ignore": config.get("IGNORE"),
        "select": config.get("SELECT"),
        "match": config.get("PYDOCSTYLE_MATCH"),
        "match_dir": config.get("PYDOCSTYLE_MATCH_DIR"),
        "min_reviewers": config.get("MIN_REVIEWERS"),
        "colors": config.get("COLORS", True),
        "excludes": config.get("EXCLUDES", []),
        "authors": config.get("AUTHORS"),
        "exclude_author_names": config.get("EXCLUDE_AUTHOR_NAMES"),
    }
    options = {}
    for k, v in base.items():
        if v is not None:
            options[k] = v
    return options