Provides a match group for the result.
 Return value is a hash following this structure
 { :filename => 'something.rb',
   :values => [ [1, 'sum(5, 5)', '10'] ]  ( Array of Arrays. [ line_number, expression, result])
 }
345199
def parse
      parsed_output = []

      File.open(@filename).each_line.with_index do |line, num|
        next if line.lstrip[0] != "#"

        if expr = line.match(EXPRESSION)
          parsed_output.push [num, expr["expression"]]
        elsif result = line.match(RESULT)
          parsed_output.last.push(result["result"])
        end
      end
      parsed_output
    end
170898
async def _parse_lines(lines, regex):
    
    results = []
    if inspect.iscoroutinefunction(lines):
        lines = await lines
    for line in lines:
        if line:
            match = regex.search(line)
            if not match:
                _LOGGER.debug("Could not parse row: %s", line)
                continue
            results.append(match.groupdict())
    return results
337240
def _keys(result, key_ary, hash)
      hash.each do |key, value|
        key_ary << key
        result << "/#{key_ary.join('/')}"
        _keys(result, key_ary, value) if value.is_a?(Hash)
        key_ary.pop
      end
    end
193756
def get_group_value(self, token, match):
        """"""
        try:
            value = match.group('{}_{}'.format(token.name, self.group))
        except IndexError:
            value = ''
        return self.func(value) if callable(self.func) else value
1201890
def _create_output_from_match(self, match_result):
        
        if isinstance(match_result, dict):
            return LinterOutput(self.name, **match_result)
        return LinterOutput(self.name, *match_result)
164516
def value(args = {})
      r = self.raw_value

      case datatype
      when RubyXL::DataType::SHARED_STRING then workbook.shared_strings_container[r.to_i].to_s
      when RubyXL::DataType::INLINE_STRING then is.to_s
      when RubyXL::DataType::RAW_STRING    then raw_value
      else
        if is_date? then workbook.num_to_date(r.to_f)
        elsif r.is_a?(String) && (r =~ NUMBER_REGEXP) then # Numeric
          if $1 != '' then r.to_f
          else r.to_i
          end
        else r
        end
      end
    end
1213304
def hash(self):
        '''
        
        '''
        hashed = super(Group, self).hash()
        return khash(hashed, frozenset(self._values))
511695
def regex_group(ctx, text, pattern, group_num):
    
    text = conversions.to_string(text, ctx)
    pattern = conversions.to_string(pattern, ctx)
    group_num = conversions.to_integer(group_num, ctx)

    expression = regex.compile(pattern, regex.UNICODE | regex.IGNORECASE | regex.MULTILINE | regex.V0)
    match = expression.search(text)

    if not match:
        return ""

    if group_num < 0 or group_num > len(match.groups()):
        raise ValueError("No such matching group %d" % group_num)

    return match.group(group_num)
847320
def hash_of?(key_clause, value_clause)
      all_keys   = many_with_map?(key_clause, "all keys")     { |kv| kv[0] }
      all_values = many_with_map?(value_clause, "all values") { |kv| kv[1] }
      all? Hash, all_keys, all_values
    end
67659
def report data
      return nil if data.nil? || data.empty?
      result = ''
      data.each do |file_name, analysis|
        rel_path = File.join('.', File.expand_path(file_name).sub(Dir.pwd, ''))
        result += "\n#{rel_path}\n"
        analysis.each do |line_number, warning|
          result += "  #{line_number}: #{warning.join(',')}\n"
        end
      end
      result.strip!

      result.empty? ? nil : result
    end
861236
def find_first_match regex #:nodoc:
      @list.each_with_index do |row, ix|
        return ix if !row.match(regex).nil?
      end
      return nil
    end
1346454
def recursive_to_hash(*values)
      if values.size == 1
        value = values.first
        case value
        when String, Numeric, Symbol, TrueClass, FalseClass, NilClass, Time
          value
        when Hash
          value.inject({}) { |h, (k, v)| h.update k => recursive_to_hash(v) }
        when Array
          value.map { |v| recursive_to_hash v }
        else
          value.to_hash
        end
      else
        values.all? { |v| Type! v, Hash, NilClass }
        recursive_to_hash(values.compact.reduce { |h, v| h.merge v })
      end
    end
170656
def return_value(nil_values = false, transformation = nil, return_hash = false)
      @value = decode_values
      return @value if @value.first.is_a? String

      if @value.count == 1 && !return_hash
        @value = @value.first['Value']
        @value = transformation.call(@value) if transformation && !@value.nil?
        return @value
      else
        @value = @value.map do |el|
          el['Value'] = transformation.call(el['Value']) if transformation && !el['Value'].nil?
          { key: el['Key'], value: el['Value'] } if el['Value'] || nil_values
        end.compact
      end
    end
241838
def hash_algo(self, value):
        

        if value not in set(['sha1', 'sha256', 'sha512']):
            raise ValueError(_pretty_message(
                '''
                hash_algo must be one of "sha1", "sha256", "sha512", not %s
                ''',
                repr(value)
            ))

        self._hash_algo = value
1109648
def result
      result = []

      @ranges.each do |r|

        if r.instance_of?(Fixnum) || r.instance_of?(String)
          result << _result(r.to_s)
          next
        end

        unless r.instance_of?(Range)
          @logger.error("Illigal number #{r}")
          next
        end

        r.each do |n|
          runner = _result(n.to_s)
          unless runner.nil?
            result << runner
          end
        end
      end

      return result.compact
    end
94901
def get_group_result(self, grp, **kwargs):
        
        id_ = self.get_id(grp)
        self.cache[grp] = id_

        # Check if this file is already processed
        alignment_written, results_written = self.check_work_done(grp)

        if not results_written:
            if not alignment_written:
                self.write_group(grp, **kwargs)
            logger.error('Alignment {} has not been analysed - run analyse_cache_dir'.format(id_))
            raise ValueError('Missing result')
        else:
            with open(self.get_result_file(id_)) as fl:
                return json.load(fl)
265196
function _indexOfGroup(match, group_number) {
        var index = 0,
            i;

        for (i = 1; i < group_number; ++i) {
            if (match[i]) {
                index += match[i].length;
            }
        }

        return index;
    }