parse_results

        Parses the MelissaData response.

        Args:
                data (dict): Contains MelissaData response

        Returns:
                results, either contains a dict with corrected address info or -1 for an invalid address.
970234
def parse_results(self, data):
        
        results = []
        if len(data["Records"]) < 1:
            return -1

        codes = data["Records"][0]["Results"]
        for code in codes.split(","):
            results.append(str(code))

        self.addr1 = data["Records"][0]["AddressLine1"]
        self.addr2 = data["Records"][0]["AddressLine2"]
        self.city = data["Records"][0]["City"]
        self.name = data["Records"][0]["NameFull"]
        self.phone = data["Records"][0]["PhoneNumber"]
        self.province = data["Records"][0]["State"]
        self.postal = data["Records"][0]["PostalCode"]
        self.recordID = data["Records"][0]["RecordID"]
        return results
598786
def parse_json(raw_json):
        
        result = json.loads(raw_json)

        if 'results' in result:
            result = result['results']

        return result
394754
def __parse_results(self,results):
        
        reslist = []
        cursor = 0
        match  = RE_RESULTS.search(results,cursor)
        while match:
            doc = {}
            doc['bibcode'] = match.group('bibcode')
            doc['confidence'] = self.__get_confidence_level(match.group('confidence'))
            doc['refstring'] = match.group('refstring')
            reslist.append(doc)
            cursor = match.end()
            match  = RE_RESULTS.search(results,cursor)
        return reslist
386166
def parse(self, data):
        

        data = data.decode('utf-8')
        self.linesep = detect_linesep(data)

        # the first section is the main one for the manifest. It's
        # also where we will check for our newline separator
        sections = parse_sections(data)
        self.load(next(sections))

        # and all following sections are considered sub-sections
        for section in sections:
            next_section = ManifestSection(None)
            next_section.load(section)
            self.sub_sections[next_section.primary()] = next_section
461406
def _parse_message(self, data):
        
        try:
            _, values = data.split(':')
            values = values.split(',')

            # Handle older-format events
            if len(values) <= 3:
                self.event_data, self.partition, self.event_type = values
                self.version = 1

            # Newer-format events
            else:
                self.event_data, self.partition, self.event_type, self.report_code = values
                self.version = 2

                event_type_data = self.event_type.split('_')
                self.event_prefix = event_type_data[0]                      # Ex: CID
                self.event_source = get_event_source(self.event_prefix)     # Ex: LRR_EVENT_TYPE.CID
                self.event_status = int(event_type_data[1][0])              # Ex: 1 or 3
                self.event_code = int(event_type_data[1][1:], 16)           # Ex: 0x100 = Medical

                # replace last 2 digits of event_code with report_code, if applicable.
                if not self.skip_report_override and self.report_code not in ['00', 'ff']:
                    self.event_code = int(event_type_data[1][1] + self.report_code, 16)
                self.event_description = get_event_description(self.event_source, self.event_code)

        except ValueError:
            raise InvalidMessageError('Received invalid message: {0}'.format(data))
1359744
def _parse_info(self, data):
		

		match = GNTP_INFO_LINE.match(data)

		if not match:
			raise errors.ParseError('ERROR_PARSING_INFO_LINE')

		info = match.groupdict()
		if info['encryptionAlgorithmID'] == 'NONE':
			info['encryptionAlgorithmID'] = None

		return info
112912
def parse(data)
      sections = data.split(/^## .+?$/)
      headings = data.scan(/^## .+?$/)

      headings.each_with_index.map do |heading, index|
        section = parse_heading(heading)
        section["content"] = sections.at(index + 1)
        section
      end
    end
567362
def parse(self, callback_data: str) -> typing.Dict[str, str]:
        
        prefix, *parts = callback_data.split(self.sep)
        if prefix != self.prefix:
            raise ValueError("Passed callback data can't be parsed with that prefix.")
        elif len(parts) != len(self._part_names):
            raise ValueError('Invalid parts count!')

        result = {'@': prefix}
        result.update(zip(self._part_names, parts))
        return result
595749
def _deserialize_data(self, json_data):
        

        my_dict = json.loads(json_data.decode('utf8').replace("'", '"'),
            encoding='UTF-8')

        for item in my_dict:
            if item == const.ADIF:
                my_dict[item] = int(my_dict[item])
            elif item == const.DELETED:
                my_dict[item] = self._str_to_bool(my_dict[item])
            elif item == const.CQZ:
                my_dict[item] = int(my_dict[item])
            elif item == const.ITUZ:
                my_dict[item] = int(my_dict[item])
            elif item == const.LATITUDE:
                my_dict[item] = float(my_dict[item])
            elif item == const.LONGITUDE:
                my_dict[item] = float(my_dict[item])
            elif item == const.START:
                my_dict[item] = datetime.strptime(my_dict[item], '%Y-%m-%d%H:%M:%S').replace(tzinfo=UTC)
            elif item == const.END:
                my_dict[item] = datetime.strptime(my_dict[item], '%Y-%m-%d%H:%M:%S').replace(tzinfo=UTC)
            elif item == const.WHITELIST_START:
                my_dict[item] = datetime.strptime(my_dict[item], '%Y-%m-%d%H:%M:%S').replace(tzinfo=UTC)
            elif item == const.WHITELIST_END:
                my_dict[item] = datetime.strptime(my_dict[item], '%Y-%m-%d%H:%M:%S').replace(tzinfo=UTC)
            elif item == const.WHITELIST:
                my_dict[item] = self._str_to_bool(my_dict[item])
            else:
                my_dict[item] = unicode(my_dict[item])

        return my_dict
86310
async def parse_result(response, response_type=None, *, encoding="utf-8"):
    
    if response_type is None:
        ct = response.headers.get("content-type")
        if ct is None:
            cl = response.headers.get("content-length")
            if cl is None or cl == "0":
                return ""
            raise TypeError(
                "Cannot auto-detect response type "
                "due to missing Content-Type header."
            )
        main_type, sub_type, extras = parse_content_type(ct)
        if sub_type == "json":
            response_type = "json"
        elif sub_type == "x-tar":
            response_type = "tar"
        elif (main_type, sub_type) == ("text", "plain"):
            response_type = "text"
            encoding = extras.get("charset", encoding)
        else:
            raise TypeError("Unrecognized response type: {ct}".format(ct=ct))
    if "tar" == response_type:
        what = await response.read()
        return tarfile.open(mode="r", fileobj=BytesIO(what))
    if "json" == response_type:
        data = await response.json(encoding=encoding)
    elif "text" == response_type:
        data = await response.text(encoding=encoding)
    else:
        data = await response.read()
    return data
766381
def parse(data)
      return unless data
      parsed_data = []
      data.lines.each do |line|
        if line =~ /^FRU.*/
          # this is the either the first line of of the fru or another fru
          if parsed_data.count != 0
            # we have reached a new fru device so lets record the previous fru
            new_fru = FruData.new(parsed_data)
            parsed_data = []
            @list[new_fru[:name]] = new_fru
          end

        end
        parsed_data << line
      end
      # process the last fru
      return if parsed_data.count == 0
      # we have reached a new fru device so lets record the previous fru
      new_fru = FruData.new(parsed_data)
      parsed_data = []
      @list[new_fru[:name]] = new_fru
    end
1322202
def _parse_response(response, post_request=False):
        
        data = response.json()

        if not response.ok:
            utils.error_message_and_exit('Push Api Error:', data)

        if post_request and not data['success']:
            raise Exception('Push Api Error: [%s]' % data['error'])

        return data
429696
def _parse_bug(self, data):
        
        if 'id' in data:
            data['weburl'] = self.url.replace('xmlrpc.cgi', str(data['id']))
        bug = AttrDict(data)
        return bug
810127
def _parse(data: str) -> list:
        
        if isinstance(data, bytes):
            data = data.decode('utf-8')
        lines = (
            item for item in
            (item.strip() for item in data.split('\n'))
            if len(item) and not item.startswith('#')
        )
        rules = []
        for line in lines:
            rules.append(
                Rule.parse(line)
            )
        return rules
746382
def _parse_address(self, address_string):
        ''''''
        match = utils.match(self.rules, address_string, flags=re.VERBOSE | re.U)
        if match:
            match_as_dict = match.groupdict()
            match_as_dict.update({'country_id': self.country})
            # combine results
            cleaned_dict = self._combine_results(match_as_dict)
            # create object containing results
            return address.Address(**cleaned_dict)

        return False
681537
def parse_result(cls, result):
        
        if len(result) == 3:
            items, count, context = result
        else:
            context = {}
            items, count = result
        return items, count, context
201093
def parse(self, data):
        
        self.binding_var_count = 0
        self.segment_count = 0

        segments = self.parser.parse(data)
        # Validation step: checks that there are no nested bindings.
        path_wildcard = False
        for segment in segments:
            if segment.kind == _TERMINAL and segment.literal == '**':
                if path_wildcard:
                    raise ValidationException(
                        'validation error: path template cannot contain more '
                        'than one path wildcard')
                path_wildcard = True
        return segments