Create and return an OptionParser with the given defaults.
973368
def get_option_parser(defaults):
    """"""
    # based on recipe from:
    # http://stackoverflow.com/questions/1880404/using-a-file-to-store-optparse-arguments

    # process command line parameters
    # e.g. skosify yso.owl -o yso-skos.rdf
    usage = "Usage: %prog [options] voc1 [voc2 ...]"
    parser = optparse.OptionParser(usage=usage)
    parser.set_defaults(**defaults)
    parser.add_option('-c', '--config', type='string',
                      help='Read default options '
                           'and transformation definitions '
                           'from the given configuration file.')
    parser.add_option('-o', '--output', type='string',
                      help='Output file name. Default is "-" (stdout).')
    parser.add_option('-D', '--debug', action="store_true",
                      help='Show debug output.')
    parser.add_option('-d', '--no-debug', dest="debug",
                      action="store_false", help='Hide debug output.')
    parser.add_option('-O', '--log', type='string',
                      help='Log file name. Default is to use standard error.')

    group = optparse.OptionGroup(parser, "Input and Output Options")
    group.add_option('-f', '--from-format', type='string',
                     help='Input format. '
                           'Default is to detect format '
                           'based on file extension. '
                           'Possible values: xml, n3, turtle, nt...')
    group.add_option('-F', '--to-format', type='string',
                     help='Output format. '
                           'Default is to detect format '
                           'based on file extension. '
                           'Possible values: xml, n3, turtle, nt...')
    group.add_option('--update-query', type='string',
                     help='SPARQL update query. '
                     'This query is executed against the input '
                     'data before processing it. '
                     'The value can be either the actual query, '
                     'or "@filename".')
    group.add_option('--construct-query', type='string',
                     help='SPARQL CONSTRUCT query. '
                     'This query is executed against the input '
                     'data and the result graph is used as the '
                     'actual input. '
                     'The value can be either the actual query, '
                     'or "@filename".')
    group.add_option('-I', '--infer', action="store_true",
                     help='Perform RDFS subclass/subproperty inference '
                          'before transforming input.')
    group.add_option('-i', '--no-infer', dest="infer", action="store_false",
                     help="Don't perform RDFS subclass/subproperty inference "
                          "before transforming input.")
    parser.add_option_group(group)

    group = optparse.OptionGroup(
        parser, "Concept Scheme and Labelling Options")
    group.add_option('-s', '--namespace', type='string',
                     help='Namespace of vocabulary '
                          '(usually optional; used to create a ConceptScheme)')
    group.add_option('-L', '--label', type='string',
                     help='Label/title for the vocabulary '
                          '(usually optional; used to label a ConceptScheme)')
    group.add_option('-l', '--default-language', type='string',
                     help='Language tag to set for labels '
                          'with no defined language.')
    group.add_option('-p', '--preflabel-policy', type='string',
                     help='Policy for handling multiple prefLabels '
                          'with the same language tag. '
                          'Possible values: shortest, longest, all.')
    group.add_option('--set-modified', dest="set_modified",
                     action="store_true",
                     help='Set modification date on the ConceptScheme')
    group.add_option('--no-set-modified', dest="set_modified",
                     action="store_false",
                     help="Don't set modification date on the ConceptScheme")
    parser.add_option_group(group)

    group = optparse.OptionGroup(parser, "Vocabulary Structure Options")
    group.add_option('-E', '--mark-top-concepts', action="store_true",
                     help='Mark top-level concepts in the hierarchy '
                          'as top concepts (entry points).')
    group.add_option('-e', '--no-mark-top-concepts',
                     dest="mark_top_concepts", action="store_false",
                     help="Don't mark top-level concepts in the hierarchy "
                          "as top concepts.")
    group.add_option('-N', '--narrower', action="store_true",
                     help='Include narrower/narrowerGeneric/narrowerPartitive '
                          'relationships in the output vocabulary.')
    group.add_option('-n', '--no-narrower',
                     dest="narrower", action="store_false",
                     help="Don't include "
                          "narrower/narrowerGeneric/narrowerPartitive "
                          "relationships in the output vocabulary.")
    group.add_option('-T', '--transitive', action="store_true",
                     help='Include transitive hierarchy relationships '
                          'in the output vocabulary.')
    group.add_option('-t', '--no-transitive',
                     dest="transitive", action="store_false",
                     help="Don't include transitive hierarchy relationships "
                          "in the output vocabulary.")
    group.add_option('-M', '--enrich-mappings', action="store_true",
                     help='Perform SKOS enrichments on mapping relationships.')
    group.add_option('-m', '--no-enrich-mappings', dest="enrich_mappings",
                     action="store_false",
                     help="Don't perform SKOS enrichments "
                          "on mapping relationships.")
    group.add_option('-A', '--aggregates', action="store_true",
                     help='Keep AggregateConcepts completely '
                          'in the output vocabulary.')
    group.add_option('-a', '--no-aggregates',
                     dest="aggregates", action="store_false",
                     help='Remove AggregateConcepts completely '
                          'from the output vocabulary.')
    group.add_option('-R', '--keep-related', action="store_true",
                     help="Keep skos:related relationships "
                          "within the same hierarchy.")
    group.add_option('-r', '--no-keep-related',
                     dest="keep_related", action="store_false",
                     help="Remove skos:related relationships "
                          "within the same hierarchy.")
    group.add_option('-B', '--break-cycles', action="store_true",
                     help="Break any cycles in the skos:broader hierarchy.")
    group.add_option('-b', '--no-break-cycles', dest="break_cycles",
                     action="store_false",
                     help="Don't break cycles in the skos:broader hierarchy.")
    group.add_option('--eliminate-redundancy', action="store_true",
                     help="Eliminate hierarchical redundancy in the "
                          "skos:broader hierarchy.")
    group.add_option('--no-eliminate-redundancy', dest="eliminate_redundancy",
                     action="store_false",
                     help="Don't eliminate hierarchical redundancy in the "
                          "skos:broader hierarchy.")
    parser.add_option_group(group)

    group = optparse.OptionGroup(parser, "Cleanup Options")
    group.add_option('--cleanup-classes', action="store_true",
                     help="Remove definitions of classes with no instances.")
    group.add_option('--no-cleanup-classes', dest='cleanup_classes',
                     action="store_false",
                     help="Don't remove definitions "
                          "of classes with no instances.")
    group.add_option('--cleanup-properties', action="store_true",
                     help="Remove definitions of properties "
                          "which have not been used.")
    group.add_option('--no-cleanup-properties', action="store_false",
                     dest='cleanup_properties',
                     help="Don't remove definitions of properties "
                          "which have not been used.")
    group.add_option('--cleanup-unreachable', action="store_true",
                     help="Remove triples which can not be reached "
                          "by a traversal from the main vocabulary graph.")
    group.add_option('--no-cleanup-unreachable', action="store_false",
                     dest='cleanup_unreachable',
                     help="Don't remove triples which can not be reached "
                          "by a traversal from the main vocabulary graph.")
    parser.add_option_group(group)

    return parser
652701
def _get_with_default(self, method, section, option, default, expected_type=None, **kwargs):
        
        try:
            try:
                # Underscore-style is the recommended configuration style
                option = option.replace('-', '_')
                return method(self, section, option, **kwargs)
            except (NoOptionError, NoSectionError):
                # Support dash-style option names (with deprecation warning).
                option_alias = option.replace('_', '-')
                value = method(self, section, option_alias, **kwargs)
                warn = 'Configuration [{s}] {o} (with dashes) should be avoided. Please use underscores: {u}.'.format(
                    s=section, o=option_alias, u=option)
                warnings.warn(warn, DeprecationWarning)
                return value
        except (NoOptionError, NoSectionError):
            if default is LuigiConfigParser.NO_DEFAULT:
                raise
            if expected_type is not None and default is not None and \
               not isinstance(default, expected_type):
                raise
            return default
247738
function addDefaultOptions(options, defaultOptions) {

    _.defaults(options, defaultOptions);
    options.currentRetries = 0;
    return options;

}
784607
def get_defaults_str(raw=None, after='Defaults::'):
    """"""
    if raw is None:
        raw = __doc__
    return unicode(textwrap.dedent(raw.split(after)[-1]).strip())
847532
function defaults(options, defaultOption) {
  options = options || {};
  for (var i in defaultOption) {
    if (own(defaultOption, i) && !(i in options)) options[i] = defaultOption[i];
  }
  return options
}
1181062
def _parser_options():
    """"""
    #We have two options: get some of the details from the config file,
    import argparse
    from acorn import base
    pdescr = "ACORN setup and custom configuration"
    parser = argparse.ArgumentParser(parents=[base.bparser], description=pdescr)
    for arg, options in script_options.items():
        parser.add_argument(arg, **options)
        
    args = base.exhandler(examples, parser)
    if args is None:
        return

    return args
716376
def add_defaults_to_kwargs(defaults, **kwargs):
    
    defaults = dict(defaults)
    defaults.update(kwargs)
    return defaults
1305631
def get_option_parser():
    
    import optparse

    prs = optparse.OptionParser(
        usage=(
            "$0 pyrpo [-h] [-v] [-q] [-s .] "
            "[-r <report>] [--thg]"))

    prs.add_option('-s', '--scan',
                   dest='scan',
                   action='append',
                   default=[],
                   help='Path(s) to scan for repositories')

    prs.add_option('-r', '--report',
                   dest='reports',
                   action='append',
                   default=[],
                   help=("""origin, status, full, gitmodule, json, sh, str, pip, hgsub"""))
    prs.add_option('--thg',
                   dest='thg_report',
                   action='store_true',
                   help='Write a thg-reporegistry.xml file to stdout')

    prs.add_option('--template',
                   dest='report_template',
                   action='store',
                   help='Report template')

    prs.add_option('-v', '--verbose',
                   dest='verbose',
                   action='store_true',)
    prs.add_option('-q', '--quiet',
                   dest='quiet',
                   action='store_true',)

    return prs
668746
def defaults(**options):
    
    _check_options(options)

    def real_decorator(function):
        function._async_options = options

        @wraps(function)
        def wrapper(*args, **kwargs):
            return function(*args, **kwargs)
        return wrapper

    return real_decorator
814487
function parseOptions(options) {
    const defaults = {
        singleline: 1,
        multiline: 1,
        allowFirstLine: false,
    }

    if (options) {
        if (options.singleline) {
            if (typeof options.singleline === "number") {
                defaults.singleline = options.singleline
            } else if (options.singleline.max) {
                defaults.singleline = options.singleline.max
            }
        }

        if (options.multiline) {
            if (typeof options.multiline === "number") {
                defaults.multiline = options.multiline
            } else {
                if (options.multiline.max) {
                    defaults.multiline = options.multiline.max
                }

                if (options.multiline.allowFirstLine) {
                    defaults.allowFirstLine = options.multiline.allowFirstLine
                }
            }
        }
    }

    return defaults
}
999523
def parse_options(options, arg_split:':', valuesep: '=', opt_default: true, keyed_sep: "/")
			return {} unless options
			parsed_options={}
			options=options.split(arg_split) unless options.is_a?(Enumerable)
			options.each do |optvalue|
				opt,value=DR::SimpleParser.parse_namevalue(optvalue,sep: valuesep, default: opt_default)
				parsed_options.set_keyed_value(opt,value, sep: keyed_sep)
			end
			return parsed_options
		end
1159214
function options(defaults, opts) {
  for (var p in opts) {
    if (opts[p] && opts[p].constructor && opts[p].constructor === Object) {
      defaults[p] = defaults[p] || {};
      options(defaults[p], opts[p]);
    } else {
      defaults[p] = opts[p];
    }
  }
  return defaults;
}
305213
def p_default_option(self, p):
        """"""
        if p[1]:
            if isinstance(p[2], AstTagRef):
                p[0] = p[2]
            else:
                p[0] = p[2]
98245
function optionToDefinition(option, defaults) {
            if (!option) {
                return defaults;
            }

            return typeof option === "string"
                ? optionDefinitions[option]
                : Object.assign({}, defaults, option);
        }
634576
public final Parser<T> optional(T defaultValue) {
    return Parsers.or(this, Parsers.constant(defaultValue));
  }
911595
function(args, defaults) {
        var args = args || {};

        if (typeof defaults == 'object') {
          for (var key in defaults) {
            if (elation.utils.isNull(args[key])) {
              args[key] = defaults[key];
            }
          }
        }
        
        return args;
      }
788071
function mergeDefaultOptions(opts) {
    const copy = {};
    copyKeys(copy, _defaultOptions);
    copyKeys(copy, opts);
    Object.keys(_defaultOptions).forEach((key) => {
        const obj = _defaultOptions[key];
        if (typeof obj === 'object') {
            const objCopy = {};
            copyKeys(objCopy, obj);
            copyKeys(objCopy, copy[key]);
            copy[key] = objCopy;
        }
    });
    return copy;
}