Parse the EProcess object we get from some rekall output
356301
def parse_eprocess(self, eprocess_data):
        """"""
        Name = eprocess_data['_EPROCESS']['Cybox']['Name']
        PID = eprocess_data['_EPROCESS']['Cybox']['PID']
        PPID = eprocess_data['_EPROCESS']['Cybox']['Parent_PID']
        return {'Name': Name, 'PID': PID, 'PPID': PPID}
298943
def _parse_show_output(cmd_ret):
    '''
    
    '''
    parsed_data = dict()
    list_key = None

    for line in cmd_ret.splitlines():
        # Skip empty lines.
        if not line.strip():
            continue

        # If there are indented lines below an existing key, assign them as a list value
        # for that key.
        if not salt.utils.stringutils.contains_whitespace(line[0]):
            list_key = None

        if list_key:
            list_value = _convert_to_closest_type(line)
            parsed_data.setdefault(list_key, []).append(list_value)
            continue

        items = [item.strip() for item in line.split(':', 1)]

        key = items[0].lower()
        key = ' '.join(key.split()).replace(' ', '_')

        # Track the current key so that we can use it in instances where the values
        # appear on subsequent lines of the output.
        list_key = key

        try:
            value = items[1]
        except IndexError:
            # If the line doesn't have the separator or is otherwise invalid, skip it.
            log.debug('Skipping line: %s', line)
            continue

        if value:
            parsed_data[key] = _convert_to_closest_type(value)

    return _convert_parsed_show_output(parsed_data=parsed_data)
1158336
def _parse_executable_spec(src_dir, json_file_name, parser):
    
    if not os.path.isdir(src_dir):
        parser.error("{} is not a directory".format(src_dir))

    if not os.path.exists(os.path.join(src_dir, json_file_name)):
        raise WorkflowBuilderException(
            "Directory {} does not contain dxworkflow.json: not a valid DNAnexus workflow source directory"
            .format(src_dir))

    with open(os.path.join(src_dir, json_file_name)) as desc:
        try:
            return json_load_raise_on_duplicates(desc)
        except Exception as e:
            raise WorkflowBuilderException("Could not parse {} file as JSON: {}".format(json_file_name, e.args))
1353365
def parse(self):
        
        try:
            data = json.loads(self.obj.content, object_pairs_hook=OrderedDict)
            if data:
                for package_type in ['default', 'develop']:
                    if package_type in data:
                        for name, meta in data[package_type].items():
                            # skip VCS dependencies
                            if 'version' not in meta:
                                continue
                            specs = meta['version']
                            hashes = meta['hashes']
                            self.obj.dependencies.append(
                                Dependency(
                                    name=name, specs=SpecifierSet(specs),
                                    dependency_type=filetypes.pipfile_lock,
                                    hashes=hashes,
                                    line=''.join([name, specs]),
                                    section=package_type
                                )
                            )
        except ValueError:
            pass
1110770
def _parse_members(self, contents, anexec, params, mode="insert"):
        """"""
        #First get the variables declared in the body of the executable, these can
        #be either locals or parameter declarations.
        members = self.vparser.parse(contents, anexec)

        #If the name matches one in the parameter list, we can connect them
        for param in list(params):
            lparam = param.lower()
            if lparam in members:
                if mode == "insert" and not lparam in anexec.parameters:
                    anexec.add_parameter(members[lparam])
                elif mode == "delete":
                    anexec.remove_parameter(members[lparam])
            
        #The remaining members that aren't in parameters are the local variables
        for key in members:
            if mode == "insert":
                if not key.lower() in anexec.parameters:
                    anexec.members[key] = members[key]
            elif mode == "delete" and key in anexec.members:
                del anexec.members[key]

        #Next we need to get hold of the docstrings for these members
        if mode == "insert":
            memdocs = self.docparser.parse_docs(contents, anexec)
            if anexec.name in memdocs:
                docs = self.docparser.to_doc(memdocs[anexec.name][0], anexec.name)
                self.docparser.process_memberdocs(docs, anexec)

            #Also process the embedded types and executables who may have
            #docstrings just like regular executables/types do.
            self.docparser.process_embedded(memdocs, anexec)
52904
def _parse_
      out = []
      str = ''
      fresh = true
      while @scanner.rest?
        # last ||= 0
        # out.last.tap do |o|
        # 	if o.is_a?(Hash)
        # 		puts "[#{@scanner.pos}] Parser has a Dictionary (#{o.class.name}) with data:"
        # 		o.each do |k, v|
        # 			puts "    #{k}: is #{v.class.name} with data: #{v.to_s[0..4]}#{"..." if v.to_s.length > 5}"
        # 		end
        # 	else
        # 		puts "[#{@scanner.pos}] Parser has #{o.class.name} with data: #{o.to_s[0..4]}#{"..." if o.to_s.length > 5}"
        # 	end
        # 	puts "next is #{@scanner.peek 8}"
        # end unless (last == out.count) || (-1 == (last = out.count))
        if @scanner.scan(/\[/)
          out << _parse_
        ##########################################
        ## Parse a Name
        ##########################################
        # old, probably working version: when str = @scanner.scan(/\/[\#\w\d\.\+\-\\\?\,]+/)
        # I don't know how to write the /[\x21-\x7e___subtract_certain_hex_values_here____]+/
        # all allowed regular caracters between ! and ~ : /[\x21-\x24\x26\x27\x2a-\x2e\x30-\x3b\x3d\x3f-\x5a\x5c\x5e-\x7a\x7c\x7e]+
        # all characters that aren't white space or special: /[^\x00\x09\x0a\x0c\x0d\x20\x28\x29\x3c\x3e\x5b\x5d\x7b\x7d\x2f\x25]+
        elsif str = @scanner.scan(/\/[^\x00\x09\x0a\x0c\x0d\x20\x28\x29\x3c\x3e\x5b\x5d\x7b\x7d\x2f\x25]*/)
          out << (str[1..-1].gsub(/\#[0-9a-fA-F]{2}/) { |a| a[1..2].hex.chr }).to_sym
        ##########################################
        ## Parse a Number
        ##########################################
        elsif str = @scanner.scan(/[\+\-\.\d]+/)
          str =~ /\./ ? (out << str.to_f) : (out << str.to_i)
        ##########################################
        ## parse a Hex String
        ##########################################
        elsif str = @scanner.scan(/\<[0-9a-fA-F]*\>/)
          # warn "Found a hex string"
          str = str.slice(1..-2).force_encoding(Encoding::ASCII_8BIT)
          # str = "0#{str}" if str.length.odd?
          out << unify_string([str].pack('H*').force_encoding(Encoding::ASCII_8BIT))
        ##########################################
        ## parse a space delimited Hex String
        ##########################################
        elsif str = @scanner.scan(/\<[0-9a-fA-F\s]*\>/)
          # warn "Found a space seperated hex string"
          str = str.force_encoding(Encoding::ASCII_8BIT).split(/\s/).map! {|b| b.length.odd? ? "0#{b}" : b}
          out << unify_string(str.pack('H*' * str.length).force_encoding(Encoding::ASCII_8BIT))
        ##########################################
        ## parse a Literal String
        ##########################################
        elsif @scanner.scan(/\(/)
          # warn "Found a literal string"
          str = ''.force_encoding(Encoding::ASCII_8BIT)
          count = 1
          while count > 0 && @scanner.rest?
            scn = @scanner.scan_until(/[\(\)]/)
            unless scn
              warn "Unknown error parsing string at #{@scanner.pos} for string: #{str}!"
              count = 0 # error
              next
            end

            str += scn.to_s
            seperator_count = 0
            seperator_count += 1 while str[-2 - seperator_count] == '\\'

            case str[-1]
            when '('
              ## The following solution might fail when (string ends with this sign: \\)
              count += 1 unless seperator_count.odd?
            when ')'
              count -= 1 unless seperator_count.odd?
            else
              warn "Unknown error parsing string at #{@scanner.pos} for string: #{str}!"
              count = 0 # error
            end
          end
          # The PDF formatted string is: str[0..-2]
          # now starting to convert to regular string
          str_bytes = str.force_encoding(Encoding::ASCII_8BIT)[0..-2].bytes.to_a
          str = []
          until str_bytes.empty?
            case str_bytes[0]
            when 13 # eol - \r
              # An end-of-line marker appearing within a literal string without a preceding REVERSE SOLIDUS
              # shall be treated as a byte value of (0Ah),
              # irrespective of whether the end-of-line marker was a CARRIAGE RETURN (0Dh), a LINE FEED (0Ah), or both.
              str_bytes.shift
              str_bytes.shift if str_bytes[0] == 10
              str << 10
            when 10 # eol - \n
              # An end-of-line marker appearing within a literal string without a preceding REVERSE SOLIDUS
              # shall be treated as a byte value of (0Ah),
              # irrespective of whether the end-of-line marker was a CARRIAGE RETURN (0Dh), a LINE FEED (0Ah), or both.
              str_bytes.shift
              str_bytes.shift if str_bytes[0] == 13
              str << 10
            when 92 # "\\".ord == 92
              str_bytes.shift
              rep = str_bytes.shift
              case rep
              when 110 # n
                str << 10 # new line
              when 114 # r
                str << 13 # CR
              when 116 # t
                str << 9 # tab
              when 98 # b
                str << 8
              when 102 # f, form-feed
                str << 12
              when 48..57 # octal notation for byte?
                rep -= 48
                rep = (rep << 3) + (str_bytes.shift-48) if str_bytes[0].between?(48, 57)
                rep = (rep << 3) + (str_bytes.shift-48) if str_bytes[0].between?(48, 57) && (((rep << 3) + (str_bytes[0] - 48)) <= 255)
                str << rep
              when 10 # new line, ignore
                str_bytes.shift if str_bytes[0] == 13
                true
              when 13 # new line (or double notation for new line), ignore
                str_bytes.shift if str_bytes[0] == 10
                true
              else
                str << rep
              end
            else
              str << str_bytes.shift
            end
          end
          out << unify_string(str.pack('C*').force_encoding(Encoding::ASCII_8BIT))
        ##########################################
        ## parse a Dictionary
        ##########################################
        elsif @scanner.scan(/<</)
          data = _parse_
          obj = {}
          obj[data.shift] = data.shift while data[0]
          out << obj
        ##########################################
        ## return content of array or dictionary
        ##########################################
        elsif @scanner.scan(/\]/) || @scanner.scan(/>>/)
          return out
        ##########################################
        ## parse a Stream
        ##########################################
        elsif @scanner.scan(/stream[ \t]*[\r\n]/)
          @scanner.pos += 1 if @scanner.peek(1) == "\n".freeze && @scanner.matched[-1] != "\n".freeze
          # the following was dicarded because some PDF files didn't have an EOL marker as required
          # str = @scanner.scan_until(/(\r\n|\r|\n)endstream/)
          # instead, a non-strict RegExp is used:
          str = @scanner.scan_until(/endstream/)

          # raise error if the stream doesn't end.
          unless str
            raise ParsingError, "Parsing Error: PDF file error - a stream object wasn't properly closed using 'endstream'!"
          end

          # need to remove end of stream
          if out.last.is_a? Hash
            # out.last[:raw_stream_content] = str[0...-10] #cuts only one EON char (\n or \r)
            out.last[:raw_stream_content] = unify_string str.sub(/(\r\n|\n|\r)?endstream\z/, '').force_encoding(Encoding::ASCII_8BIT)
          else
            warn 'Stream not attached to dictionary!'
            out << str.sub(/(\r\n|\n|\r)?endstream\z/, '').force_encoding(Encoding::ASCII_8BIT)
          end
        ##########################################
        ## parse an Object after finished
        ##########################################
        elsif str = @scanner.scan(/endobj/)
          # what to do when this is an object?
          if out.last.is_a? Hash
            out << out.pop.merge(indirect_generation_number: out.pop, indirect_reference_id: out.pop)
          else
            out << { indirect_without_dictionary: out.pop, indirect_generation_number: out.pop, indirect_reference_id: out.pop }
          end
          fresh = true
          # fix wkhtmltopdf use of PDF 1.1 Dest using symbols instead of strings
          out.last[:Dest] = unify_string(out.last[:Dest].to_s) if out.last[:Dest] && out.last[:Dest].is_a?(Symbol)
        # puts "!!!!!!!!! Error with :indirect_reference_id\n\nObject #{out.last}  :indirect_reference_id = #{out.last[:indirect_reference_id]}" unless out.last[:indirect_reference_id].is_a?(Numeric)
        ##########################################
        ## Parse an Object Reference
        ##########################################
        elsif @scanner.scan(/R/)
          out << { is_reference_only: true, indirect_generation_number: out.pop, indirect_reference_id: out.pop }
        # @references << out.last
        ##########################################
        ## Parse Bool - true and after false
        ##########################################
        elsif @scanner.scan(/true/)
          out << true
        elsif @scanner.scan(/false/)
          out << false
        ##########################################
        ## Parse NULL - null
        ##########################################
        elsif @scanner.scan(/null/)
          out << nil
        ##########################################
        ## Parse file trailer
        ##########################################
        elsif @scanner.scan(/trailer/)
          if @scanner.skip_until(/<</)
            data = _parse_
            (@root_object ||= {}).clear
            @root_object[data.shift] = data.shift while data[0]
          end
        ##########################################
        ## XREF - check for encryption... anything else?
        ##########################################
        elsif @scanner.scan(/xref/)
          # skip list indetifier lines or list lines ([\d] [\d][\r\n]) ot ([\d] [\d] [nf][\r\n])
          while @scanner.scan(/[\s]*[\d]+[ \t]+[\d]+[ \t]*[\n\r]+/) || @scanner.scan(/[ \t]*[\d]+[ \t]+[\d]+[ \t]+[nf][\s]*/)
            nil
          end
        ##########################################
        ## XREF location can be ignored
        ##########################################
        elsif @scanner.scan(/startxref/)
          @scanner.scan(/[\s]+[\d]+[\s]+/)
        ##########################################
        ## Skip Whitespace
        ##########################################
        elsif @scanner.scan(/[\s]+/)
          # Generally, do nothing
          nil
        ##########################################
        ## EOF?
        ##########################################
        elsif @scanner.scan(/\%\%EOF/)
          ##########
          ## If this was the last valid segment, ignore any trailing garbage
          ## (issue #49 resolution)
          break unless @scanner.exist?(/\%\%EOF/)
        ##########################################
        ## Parse a comment
        ##########################################
        elsif str = @scanner.scan(/\%/)
          # is a comment, skip until new line
          loop do
            # break unless @scanner.scan(/[^\d\r\n]+/)
            break if @scanner.check(/([\d]+[\s]+[\d]+[\s]+obj[\s]+\<\<)|([\n\r]+)/) || @scanner.eos? # || @scanner.scan(/[^\d]+[\r\n]+/) ||
            @scanner.scan(/[^\d\r\n]+/) || @scanner.pos += 1
          end
        # puts "AFTER COMMENT: #{@scanner.peek 8}"
        ##########################################
        ## Fix wkhtmltopdf - missing 'endobj' keywords
        ##########################################
        elsif @scanner.scan(/obj[\s]*/)
          # Fix wkhtmltopdf PDF authoring issue - missing 'endobj' keywords
          unless fresh || (out[-4].nil? || out[-4].is_a?(Hash))
            keep = []
            keep << out.pop # .tap {|i| puts "#{i} is an ID"}
            keep << out.pop # .tap {|i| puts "#{i} is a REF"}

            if out.last.is_a? Hash
              out << out.pop.merge(indirect_generation_number: out.pop, indirect_reference_id: out.pop)
            else
              out << { indirect_without_dictionary: out.pop, indirect_generation_number: out.pop, indirect_reference_id: out.pop }
            end
            # fix wkhtmltopdf use of PDF 1.1 Dest using symbols instead of strings
            out.last[:Dest] = unify_string(out.last[:Dest].to_s) if out.last[:Dest] && out.last[:Dest].is_a?(Symbol)
            warn "'endobj' keyword was missing for Object ID: #{out.last[:indirect_reference_id]}, trying to auto-fix issue, but might fail."

            out << keep.pop
            out << keep.pop
          end
          fresh = false
        ##########################################
        ## Unknown, warn and advance
        ##########################################
        else
          # always advance
          # warn "Advancing for unknown reason... #{@scanner.string[@scanner.pos - 4, 8]} ... #{@scanner.peek(4)}" unless @scanner.peek(1) =~ /[\s\n]/
          warn 'Warning: parser advancing for unknown reason. Potential data-loss.'
          @scanner.pos = @scanner.pos + 1
        end
      end
      out
    end
728416
function extract_program_stats(prog) {
    var stats = {};
    var sources_array = source_stats(prog);

    stats.inputs = input_stats(prog);
    stats.input_total = count_procs(stats.inputs);
    stats.sources = sources_array;
    stats.source_total = sources_array.length;
    stats.reducers = reducer_stats(prog);
    stats.reducer_total = count_procs(stats.reducers);
    stats.functions = function_stats(prog);
    stats.procs = proc_stats(prog);
    stats.proc_total = count_procs(stats.procs);
    stats.views = view_stats(prog);
    stats.view_total = count_procs(stats.views);
    stats.subs = sub_stats(prog);
    stats.imports = import_stats(prog);
    return stats;
}
997244
def parse(self, *args, **kw):
        """"""

        ev = 'errex' in kw and kw.pop('errex')
        if ev and not isinstance(ev, int):
            raise TypeError("error exit value should be an integer")

        try:
            self.cmdline = self.parser.parse_args(*args, **kw)
        except OptParseError:
          if ev:
              sys.exit(ev)
          raise

        return self.fuse_args
158088
def parse(handle):
    

    components = handle.split('/', 1)
    if len(components) == 1:
        return None, components[0]
    elif len(components) == 2:
        return components[0], components[1]
    else:
        raise BinstarError("{} can't be parsed".format(handle))
1191026
def parse_arguments():
    
    max_procs = MAX_PROCS
    dry_run = DRY_RUN
    logging.basicConfig(level=logging.INFO, stream=sys.stdout,
                        format='%(asctime)s * %(levelname)s * %(message)s')

    parser = argparse.ArgumentParser(description="""nestrun - substitute values
            into a template and run commands in parallel.""")
    parser.add_argument('-j', '--processes', '--local', dest='local_procs',
            type=int, help="""Run a maximum of N processes in parallel locally
            (default: %(default)s)""", metavar='N', default=MAX_PROCS)
    parser.add_argument('--template', dest='template',
            metavar="'template text'", help="""Command-execution template, e.g.
            bash {infile}. By default, nestrun executes the templatefile.""")
    parser.add_argument('--stop-on-error', action='store_true',
            default=False, help="""Terminate remaining processes if any process
            returns non-zero exit status (default: %(default)s)""")
    parser.add_argument('--template-file', dest='template_file', metavar="FILE",
            help='Command-execution template file path.')
    parser.add_argument('--save-cmd-file', dest='savecmd_file',
            help="""Name of the file that will contain the command that was
            executed.""")
    log_group = parser.add_mutually_exclusive_group()
    log_group.add_argument('--log-file', dest='log_file', default='log.txt',
            help="""Name of the file that will contain output of the executed
            command.""")
    log_group.add_argument('--no-log', dest="log_file", action="store_const",
            default='log.txt', const=os.devnull, help="""Don't create a log
            file""")
    parser.add_argument('--dry-run', action='store_true', help="""Dry run mode,
            does not execute commands.""", default=False)
    parser.add_argument('--summary-file', type=argparse.FileType('w'),
            help="""Write a summary of the run to the specified file""")

    ctrl_group = parser.add_argument_group('Control files')
    ctrl_group.add_argument('json_files', metavar='control_files', type=extant_file,
            nargs='*', help="""Nestly control dictionaries""")
    ctrl_group.add_argument('-d', '--directory', help="""Run on all control
            files under %(metavar)s. May be used in place of specifying control
            files.""", metavar='DIR')
    arguments = parser.parse_args()


    # Load controls
    if bool(arguments.directory) == bool(arguments.json_files):
        parser.error('Exactly one of `-d` and control_files must be specified.')
    elif arguments.directory:
        arguments.json_files.extend(control_iter(arguments.directory))

    template = arguments.template

    # Make sure that either a template or a template file was given
    if arguments.template_file:
        # if given a template file, the default is to run the input
        if not arguments.template:
            template = os.path.join('.',
                    os.path.basename(arguments.template_file))

            # If using the default argument, the template must be executable:
            if (not os.access(arguments.template_file, os.X_OK) and not
                    arguments.dry_run):
                parser.error(
                        "{0} is not executable. Specify a template.".format(
                    arguments.template_file))

    if not (arguments.template or arguments.template_file):
        parser.exit("Error: Please specify either a template "
                "or a template file")

    logging.info('Template: %s', template)

    if arguments.local_procs is not None:
        max_procs = arguments.local_procs

    # Create a dictionary that will be shared amongst all forked processes.
    data = {}
    data['dry_run'] = arguments.dry_run
    data['start_directory'] = os.getcwd()
    data['template'] = template
    data['template_file'] = arguments.template_file
    data['savecmd_file'] = arguments.savecmd_file
    data['log_file'] = arguments.log_file
    data['stop_on_error'] = arguments.stop_on_error
    data['summary_file'] = arguments.summary_file

    return data, max_procs, arguments.json_files
1306622
function parseProcesses(list, ps) {
  var p = ps.split(/ +/);

  list.push({
    user: p[0],
    pid: p[1],
    cpu: parseFloat(p[2]),
    mem: parseFloat(p[3]),
    vsz: p[4],
    rss: p[5],
    tt: p[6],
    stat: p[7],
    started: p[8],
    time: p[9],
    command: p.slice(10).join(' ')
  });

  return list;
}
797725
function parse(str, options, callback) {
	if (typeof options === 'function') {
		callback = options
		options = {}
	}
	process.nextTick(() => {
		const output = parseSync(str, options)
		callback(output)
	})
}
854863
def get_process_output(process, encoding=None):
    """"""

    output = process.communicate()
    returncode = process.returncode

    if not encoding:
        try:
            encoding = sys.stdout.encoding
        except Exception:
            encoding = locale.getpreferredencoding()

    if returncode != 0:
        raise RuntimeError("Runtime Error: %s" % (output[0].rstrip().decode(encoding, errors='replace')))

    return output[0].decode(encoding, errors='replace')
519291
function parseCommandLine() {
	var commands = process.argv.slice(2);
	var args = {};

	for (var i = 0; i < commands.length; i++) {
		var match = commands[i].match(/^--(.+)=(.+)$/);
		if (match)
			args[match[1]] = match[2];
		else if (i < commands.length - 1 && commands[i].substr(0, 1) === "-") {
			args[commands[i].substr(1)] = commands[i + 1];
			i++;
		}
		else if (i === 0) args[commandKey] = commands[i];
		else if (i === 1) args[commandHost] = commands[i];
	}

	return args;
}
1120165
def parse(self, parser):
        """"""
        lineno = next(parser.stream).lineno
        num_called_num = False

        # find all the variables referenced.  Additionally a variable can be
        # defined in the body of the trans block too, but this is checked at
        # a later state.
        plural_expr = None
        plural_expr_assignment = None
        variables = {}
        trimmed = None
        while parser.stream.current.type != 'block_end':
            if variables:
                parser.stream.expect('comma')

            # skip colon for python compatibility
            if parser.stream.skip_if('colon'):
                break

            name = parser.stream.expect('name')
            if name.value in variables:
                parser.fail('translatable variable %r defined twice.' %
                            name.value, name.lineno,
                            exc=TemplateAssertionError)

            # expressions
            if parser.stream.current.type == 'assign':
                next(parser.stream)
                variables[name.value] = var = parser.parse_expression()
            elif trimmed is None and name.value in ('trimmed', 'notrimmed'):
                trimmed = name.value == 'trimmed'
                continue
            else:
                variables[name.value] = var = nodes.Name(name.value, 'load')

            if plural_expr is None:
                if isinstance(var, nodes.Call):
                    plural_expr = nodes.Name('_trans', 'load')
                    variables[name.value] = plural_expr
                    plural_expr_assignment = nodes.Assign(
                        nodes.Name('_trans', 'store'), var)
                else:
                    plural_expr = var
                num_called_num = name.value == 'num'

        parser.stream.expect('block_end')

        plural = None
        have_plural = False
        referenced = set()

        # now parse until endtrans or pluralize
        singular_names, singular = self._parse_block(parser, True)
        if singular_names:
            referenced.update(singular_names)
            if plural_expr is None:
                plural_expr = nodes.Name(singular_names[0], 'load')
                num_called_num = singular_names[0] == 'num'

        # if we have a pluralize block, we parse that too
        if parser.stream.current.test('name:pluralize'):
            have_plural = True
            next(parser.stream)
            if parser.stream.current.type != 'block_end':
                name = parser.stream.expect('name')
                if name.value not in variables:
                    parser.fail('unknown variable %r for pluralization' %
                                name.value, name.lineno,
                                exc=TemplateAssertionError)
                plural_expr = variables[name.value]
                num_called_num = name.value == 'num'
            parser.stream.expect('block_end')
            plural_names, plural = self._parse_block(parser, False)
            next(parser.stream)
            referenced.update(plural_names)
        else:
            next(parser.stream)

        # register free names as simple name expressions
        for var in referenced:
            if var not in variables:
                variables[var] = nodes.Name(var, 'load')

        if not have_plural:
            plural_expr = None
        elif plural_expr is None:
            parser.fail('pluralize without variables', lineno)

        if trimmed is None:
            trimmed = self.environment.policies['ext.i18n.trimmed']
        if trimmed:
            singular = self._trim_whitespace(singular)
            if plural:
                plural = self._trim_whitespace(plural)

        node = self._make_node(singular, plural, variables, plural_expr,
                               bool(referenced),
                               num_called_num and have_plural)
        node.set_lineno(lineno)
        if plural_expr_assignment is not None:
            return [plural_expr_assignment, node]
        else:
            return node
96378
def parse_block(self, contents, parent, module, depth):
        """"""
        for anexec in self.RE_EXEC.finditer(contents):
            x = self._process_execs(anexec, parent, module)
            parent.executables[x.name.lower()] = x
            if  isinstance(parent, Module) and "public" in x.modifiers:
                parent.publics[x.name.lower()] = 1
            
            #To handle the embedded executables, run this method recursively
            self.parse_block(x.contents, x, module, depth + 1)

        #Now that we have the executables, we can use them to compile a string
        #that includes only documentation *external* to the executable definitions
        #Because we enforce adding the name to 'end subroutine' statements etc.
        #all the embedded executables haven't been parsed yet.
        if len(parent.executables) > 0:
            remove = []
            for x in parent.executables:
                remove.append((parent.executables[x].start, parent.executables[x].end))

            remove.sort(key=lambda tup: tup[0])
            retain = []
            cur_end = 0
            for rem in remove:
                if "\n" in contents[rem[0]+1:rem[1]]:
                    signature = contents[rem[0]+1:rem[1]].index("\n") + 2
                    keep = contents[cur_end:rem[0] + signature]
                    cur_end = rem[1]
                    retain.append(keep)

            #Now we have a string of documentation segments and the signatures they
            #decorate that only applies to the non-embedded subroutines
            docsearch = "".join(retain)
            docblocks = self.docparser.parse_docs(docsearch, parent)

            #Process the decorating documentation for the executables including the
            #parameter definitions.
            for x in parent.executables:
                self._process_docs(parent.executables[x], docblocks, 
                                   parent, module, docsearch)
904567
def parse_from_parent(
            self,
            parent,  # type: ET.Element
            state  # type: _ProcessorState
    ):
        # type: (...) -> Any
        """"""
        parsed_dict = self._dictionary.parse_from_parent(parent, state)
        return self._converter.from_dict(parsed_dict)