Imposta il parser.
427996
def get_parser(func, parent):
    
    parser = parent.add_parser(func.__cmd_name__, help=func.__doc__)
    for args, kwargs in func.__arguments__:
        parser.add_argument(*args, **kwargs)
    return parser
1241153
def verifica(ver_list, res_dict, difs):
    ""
    for k, v in ver_list.items():
        # normalizo a float para poder comparar numericamente:
        if isinstance(v, (Decimal, int, long)):
            v = float(v)
        if isinstance(res_dict.get(k), (Decimal, int, long)):
            res_dict[k] = float(res_dict[k])
        if isinstance(v, list):
            # verifico que ambas listas tengan la misma cantidad de elementos:
            if v and not k in res_dict and v:
                difs.append("falta tag %s: %s %s" % (k, repr(v), repr(res_dict.get(k))))
            elif len(res_dict.get(k, []))!=len(v or []):
                difs.append("tag %s len !=: %s %s" % (k, repr(v), repr(res_dict.get(k))))
            else:
                # ordeno las listas para poder compararlas si vienen mezcladas
                rl = sorted(res_dict.get(k, []))
                # comparo los elementos uno a uno:
                for i, vl in enumerate(sorted(v)):
                    verifica(vl, rl[i], difs)
        elif isinstance(v, dict):
            # comparo recursivamente los elementos:
            verifica(v, res_dict.get(k, {}), difs)
        elif res_dict.get(k) is None or v is None:
            # alguno de los dos es nulo, verifico si ambos lo son o faltan
            if v=="":
                v = None
            r = res_dict.get(k)
            if r=="":
                r = None
            if not (r is None and v is None):
                difs.append("%s: nil %s!=%s" % (k, repr(v), repr(r)))
        elif type(res_dict.get(k)) == type(v):
            # tipos iguales, los comparo directamente
            if res_dict.get(k) != v:
                difs.append("%s: %s!=%s" % (k, repr(v), repr(res_dict.get(k))))
        elif isinstance(v, float) or isinstance(res_dict.get(k), float):
            # comparar numericamente
            if float(res_dict.get(k)) != float(v):
                difs.append("%s: %s!=%s" % (k, repr(v), repr(res_dict.get(k))))
        elif unicode(res_dict.get(k)) != unicode(v):
            # tipos diferentes, comparo la representación  
            difs.append("%s: str %s!=%s" % (k, repr(v), repr(res_dict.get(k))))
        else:
            pass
115525
private function parsing() : void
    {
        $lines = explode("\n", $this->raw);

        foreach ($lines as $line) {
            // check "at" mark
            if (false === strpos($line, '@')) {
                continue;
            }

            // check inline annotation
            if ($anp = strpos($line, '//')) {
                $line = substr($line, 0, $anp);
            }

            // trim blanks
            $line = trim(ltrim($line, ' *'));

            // analyze expr
            if (false === $fws = strpos($line, ' ')) {
                // @some-key
                $key = substr($line, 1);
                $val = true;
            } else {
                // @some-key some-val
                $key = substr($line, 1, $fws - 1);
                $val = trim(substr($line, $fws));
            }

            $this->lines[] = [$key, $val];

            $this->declares[$key][] = $val;
        }
    }
191031
def prepare(self, rule):
        
        if self.parser:
            rule = self.parser.parse(rule)
        if self.compiler:
            rule = self.compiler.compile(rule)
        return rule
514742
def parser(rules=None, **kwargs):
    """"""
    rules = RULES_SPLUNK if rules is None else dict(RULES_SPLUNK, **rules)
    return Parser(rules, **kwargs)
254061
function parseArgumentList() {
                    var token, expr, args = [];

                    while (true) {
                        expr = parseExpression();
                        if (typeof expr === 'undefined') {
                            break;
                        }
                        args.push(expr);
                        token = lexer.peek();
                        if (!matchOp(token, ',')) {
                            break;
                        }
                        lexer.next();
                    }

                    return args;
                }
1014158
def doc_parser():
    """"""

    parser = argparse.ArgumentParser(
        prog='ambry',
        description='Ambry {}. Management interface for ambry, libraries '
                    'and repositories. '.format(ambry._meta.__version__))

    return parser
750224
def parse(self):
        """"""
        if self.parser is None:
            self.makeParser()
        self.args = self.parser.parse_args()
        self.verbose = self.args.verbose
300613
def filtra_json(pandoc_json_tree)
      # Exemplo de código:
      
      # {"blocks":[{"t":"OrderedList","c":[[1,{"t":"LowerAlpha"},{"t":"OneParen"}],[[{"t":"Plain","c":[{"t":"Str","c":"item"},{"t":"Space"},{"t":"Str","c":"1."}]}],[{"t":"Plain","c":[{"t":"Str","c":"item"},{"t":"Space"},{"t":"Str","c":"2."}]}],[{"t":"Plain","c":[{"t":"Str","c":"item"},{"t":"Space"},{"t":"Str","c":"3."}]}]]]}],"pandoc-api-version":[1,17,0,4],"meta":{}}
      tree = JSON.parse(pandoc_json_tree)
      meta = tree["meta"]
      blocks = tree["blocks"]
      api = tree["pandoc-api-version"]
      
      filtrados = []
      anterior = nil
      
      if not blocks
        raise ArgumentError, "Problema no argumento passado: #{pandoc_json_tree}"
      end

      blocks.each do |node|
        if (lista?(node)) then
          lista_modificada = processa_items_da_lista(node)
          filtrados << lista_modificada
        else
          filtrados << node
        end
      end
      JSON.generate({"blocks"=>filtrados, "pandoc-api-version" => api, "meta" => meta})
    end
1197080
def parser():

    """"""

    parser = argparse.ArgumentParser()
    parser.add_argument('-c', '--config_paths', default=[], action='append',
                        help='path to a configuration directory')
    return parser
369913
def _prodterm(lexer):
    """"""
    factor = _factor(lexer)
    prodterm_prime = _prodterm_prime(lexer)
    if prodterm_prime is None:
        return factor
    else:
        return ('and', factor, prodterm_prime)
522265
def parser(self):
        """"""
        parser = configparser.RawConfigParser()
        for filename in self.available_files:
            friendly_name = format_path(filename)
            logger.debug("Loading configuration file: %s", friendly_name)
            loaded_files = parser.read(filename)
            if len(loaded_files) == 0:
                self.report_issue("Failed to load configuration file! (%s)", friendly_name)
        logger.debug("Loaded %s from %s.",
                     pluralize(len(parser.sections()), "section"),
                     pluralize(len(self.available_files), "configuration file"))
        return parser
1000935
def _impl(lexer):
    """"""
    p = _sumterm(lexer)

    tok = next(lexer)
    # SUMTERM '=>' IMPL
    if isinstance(tok, OP_rarrow):
        q = _impl(lexer)
        return ('implies', p, q)
    # SUMTERM '<=>' IMPL
    elif isinstance(tok, OP_lrarrow):
        q = _impl(lexer)
        return ('equal', p, q)
    # SUMTERM
    else:
        lexer.unpop_token(tok)
        return p
366976
private void parseRule( Rule rule ) {
        ruleStack.add( rule );
        for( ;; ) {
            int ch = reader.nextBlockMarker();
            switch( ch ) {
                case -1:
                    throw createException( "Unexpected end of Less data" );
                case ';':
                    parseSemicolon( rule );
                    break;
                case '{':
                    parseBlock( rule );
                    break;
                case '}':
                    parseSemicolon( rule );
                    ruleStack.removeLast();
                    return;
                default:
                    throw createException( "Unrecognized input: '" + reader.getLookAhead() + "'" );
            }
        }

    }
772999
def parser(*events):
    """"""
    def dec(func):
        for event in events:
            PARSERS[event] = func
        return func
    return dec
800919
function parsePattern (inp) {
    return parseWildcard(inp)
        || parseNullLiteral(inp)
        || parseUndefinedLiteral(inp)
        || parseBooleanLiteral(inp)
        || parseNumberLiteral(inp)
        || parseStringLiteral(inp)
        || parseClassPattern(inp)
        || parseExtractor(inp)
        || parseArray(inp)
        || parseObject(inp)
        || parseIdentPattern(inp);
  }
1340794
def _exprparser(
        expr, scope, lang=None, conf=None, configurable=None,
        safe=DEFAULT_SAFE, besteffort=DEFAULT_BESTEFFORT, tostr=False
):
    """"""

    if scope is None:
        scope = {}

    scope.update({
        'configurable': configurable,
        'conf': conf
    })

    expr = REGEX_EXPR_R.sub(
        _refrepl(
            configurable=configurable, conf=conf, safe=safe, scope=scope,
            besteffort=besteffort
        ), expr
    )

    result = resolve(
        expr=expr, name=lang, safe=safe, scope=scope, tostr=tostr,
        besteffort=besteffort
    )

    return result