Parse the args, returns if the type of update:
    Major, minor, fix
514563
def parse_args():
    
    parser = argparse.ArgumentParser()
    parser.add_argument('-M', action='store_true')
    parser.add_argument('-m', action='store_true')
    parser.add_argument('-f', action='store_true')
    args = parser.parse_args()
    major, minor, fix = args.M, args.m, args.f
    if major + minor + fix != 1:
        fail('Please select one and only one action.')
    return major, minor, fix
1063130
function(str){
        var versionArray = str.split(",");//replace with regex
        return {
            "raw":str,
            "major":parseInt(versionArray[0].split(" ")[1], 10),
            "minor":parseInt(versionArray[1], 10),
            "revision":parseInt(versionArray[2], 10),
            "revisionStr":versionArray[2]
        };
    }
1019741
def tokenize_version(version_string: str) -> Tuple[int, int, int]:
    
    before_dash = version_string.split('-')[0]
    major, minor, patch = before_dash.split('.')[:3]  # take only the first 3 in case there's an extension like -dev.0
    return int(major), int(minor), int(patch)
218570
def args_update(self):
        """"""
        for key, value in self._config_data.items():
            setattr(self._default_args, key, value)
334859
def parse_simple_args(self, term):
        """"""
        match = SHORTCUT.match(term)
        if not match:
            return False

        _, start, end, _, stride, _, format = match.groups()

        if start is not None:
            try:
                start = int(start, 0)
            except ValueError:
                raise AnsibleError("can't parse start=%s as integer" % start)
        if end is not None:
            try:
                end = int(end, 0)
            except ValueError:
                raise AnsibleError("can't parse end=%s as integer" % end)
        if stride is not None:
            try:
                stride = int(stride, 0)
            except ValueError:
                raise AnsibleError("can't parse stride=%s as integer" % stride)

        if start is not None:
            self.start = start
        if end is not None:
            self.end = end
        if stride is not None:
            self.stride = stride
        if format is not None:
            self.format = format
920723
def parseargs(argv):
    ''''''
    args = []
    options = {}
    key = None
    for arg in argv:
        if arg in DEFAULT_OPTION_VALUES:
            key = arg.strip('=').replace('-', '_')
            options[key] = ()
        elif key is None:
            args.append(arg)
        else:
            options[key] += (arg,)

    if set(args) & {'-h', '--help'}:
        print(__doc__, end='')
        exit(0)
    elif set(args) & {'-V', '--version'}:
        print(__version__)
        exit(0)
    elif args:
        exit('invalid option: %s\nTry --help for more information.' % args[0])

    return options
1262177
def _parse(args):
    """"""

    ordered = []
    opt_full = dict()
    opt_abbrev = dict()

    args = args + ['']  # Avoid out of range
    i = 0

    while i < len(args) - 1:
        arg = args[i]
        arg_next = args[i+1]
        if arg.startswith('--'):
            if arg_next.startswith('-'):
                raise ValueError('{} lacks value'.format(arg))
            else:
                opt_full[arg[2:]] = arg_next
                i += 2
        elif arg.startswith('-'):
            if arg_next.startswith('-'):
                raise ValueError('{} lacks value'.format(arg))
            else:
                opt_abbrev[arg[1:]] = arg_next
                i += 2
        else:
            ordered.append(arg)
            i += 1
    
    return ordered, opt_full, opt_abbrev
1028391
def version_parser(version_string):
    
    version, commit, branch = version_string.split('-', 3)

    # Remove the "v"
    version_number = version[1:]
    version_number = int(version_number)

    return Version(version_number, commit, branch)
897901
def parse_args
      options = { :verbose => false, :status => false, :immediately => false, :action => :attach}

      parser = Trollop::Parser.new do 
        opt :url, "", :long => "--attach", :short => "-a", :type => String, :required => true
        opt :force
        opt :cloud, "", :type => String
        version ""
      end

      parse do
        options.merge(parser.parse)
      end
    end
8881
def parse_generic_options(args)
      a = args.dup
      arguments = []
      options = {}

      until a.empty?
        arg = a.shift
        case arg
        when /\A--.+=/
          _, option, value = arg.match(/\A--(.+)=(.+)\Z/).to_a
          update_options(option, value, options)
        when /\A--.+/
          if a[0].nil? || a[0].to_s.start_with?("--")
            # Current option is a boolean
            update_options(arg, true, options)
          else
            # Take value from next
            update_options(arg, a.shift, options)
          end
        else
          arguments << arg
        end
      end

      [options, arguments]
    end
925121
function parseUpdateInfo (node, nodeType, feedType) {
  var updateInfo = {}, temp;

  if (temp = utils.get(node['sy:updatefrequency'])) {
    updateInfo.frequency = temp;
  }
  if (temp = utils.get(node['sy:updateperiod'])) {
    updateInfo.period = temp;
  }
  if (temp = utils.get(node['sy:updatebase'])) {
    updateInfo.base = temp;
  }
  if (temp = utils.get(node.ttl)) {
    updateInfo.ttl = temp;
  }

  return Object.keys(updateInfo).length ? updateInfo : null;
}
1363817
def parse_args(args):
    
    parser = argparse.ArgumentParser(
        description="Just a Hello World demonstration")
    parser.add_argument(
        '-v',
        '--version',
        action='version',
        version='twip {ver}'.format(ver=__version__))
    return parser.parse_args(args)
868955
def parse_updates(rule):
    '''
    
    '''
    rules = shlex.split(rule)
    rules.pop(0)
    return {'url': rules[0]} if rules else True
538836
def check_version(version: str):
    
    code_version = parse_version(__version__)
    given_version = parse_version(version)
    check_condition(code_version[0] == given_version[0],
                    "Given release version (%s) does not match release code version (%s)" % (version, __version__))
    check_condition(code_version[1] == given_version[1],
                    "Given major version (%s) does not match major code version (%s)" % (version, __version__))
484050
function parseUpdateArguments (conditions, doc, options, callback) {
    if ('function' === typeof options) {
        // .update(conditions, doc, callback)
        callback = options;
        options = null;
    } else if ('function' === typeof doc) {
        // .update(doc, callback);
        callback = doc;
        doc = conditions;
        conditions = {};
        options = null;
    } else if ('function' === typeof conditions) {
        // .update(callback)
        callback = conditions;
        conditions = undefined;
        doc = undefined;
        options = undefined;
    } else if (typeof conditions === 'object' && !doc && !options && !callback) {
        // .update(doc)
        doc = conditions;
        conditions = undefined;
        options = undefined;
        callback = undefined;
    }

    var args = [];

    if (conditions) { args.push(conditions); }
    if (doc) { args.push(doc); }
    if (options) { args.push(options); }
    if (callback) { args.push(callback); }

    return args;
}
1025511
def _parse_args(arg):
    '''
    
    '''
    yaml_args = salt.utils.args.yamlify_arg(arg)

    if yaml_args is None:
        return []
    elif not isinstance(yaml_args, list):
        return [yaml_args]
    else:
        return yaml_args
1017148
def update_args(self, args):
        

        for arg in vars(args):
            if self.get(arg) and getattr(args, arg) is not None:
                self._config[self.root_section][arg] = getattr(args, arg)