Parse information from the provider.
195006
def user_parse(data):
        """"""
        user_ = data.get('user', {})
        yield 'id', data.get('user_nsid') or user_.get('id')
        yield 'username', user_.get('username', {}).get('_content')
        first_name, _, last_name = data.get(
            'fullname', {}).get('_content', '').partition(' ')
        yield 'first_name', first_name
        yield 'last_name', last_name
411348
def parse_response(self, response):
        """"""
        try:
            for header in response.msg.get_all("Set-Cookie"):
                cookie = header.split(";", 1)[0]
                cookieKey, cookieValue = cookie.split("=", 1)
                self._cookies[cookieKey] = cookieValue
        finally:
            return Transport.parse_response(self, response)
286476
def _parseElfHeader(self, data):
        """"""
        ehdr = self.__classes.EHDR.from_buffer(data)
        return EhdrData(header=ehdr)
247928
def user_parse(data):
        """"""
        _user = data.get('query', {}).get('results', {}).get('profile', {})
        yield 'id', _user.get('guid')
        yield 'username', _user.get('username')
        yield 'link', _user.get('profileUrl')
        emails = _user.get('emails')
        if isinstance(emails, list):
            for email in emails:
                if 'primary' in list(email.keys()):
                    yield 'email', email.get('handle')
        elif isinstance(emails, dict):
            yield 'email', emails.get('handle')
        yield 'picture', _user.get('image', {}).get('imageUrl')
        city, country = map(lambda s: s.strip(),
                            _user.get('location', ',').split(','))
        yield 'city', city
        yield 'country', country
938333
def parse(self):
        """"""

        self.parse_fields()
        records = []
        for line in self.t['data'].split('\n'):
            if EMPTY_ROW.match(line):
                continue
            row = [self.autoconvert(line[start_field:end_field+1])
                   for start_field, end_field in self.fields]
            records.append(tuple(row))
        self.records = records
445284
def _parse_description(self, description_text):
        """"""
        text = description_text
        text = text.strip()
        lines = text.split('\n')

        data = {}
        for line in lines:
            if ":" in line:
                idx = line.index(":")
                key = line[:idx]
                value = line[idx+1:].lstrip().rstrip()
                data[key] = value
            else:
                if isinstance(value, list) is False:
                    value = [value]
                value.append(line.lstrip().rstrip())
                data[key] = value
        return data
1231057
def user_parse(data):
        """"""
        yield 'id', data.get('id') or data.get('user_id')
        first_name, _, last_name = data['name'].partition(' ')
        yield 'first_name', first_name
        yield 'last_name', last_name
        yield 'picture', data.get('profile_image_url')
        yield 'locale', data.get('lang')
        yield 'link', data.get('url')
        yield 'username', data.get('screen_name')
        city, _, country = map(lambda s: s.strip(),
                               data.get('location', '').partition(','))
        yield 'city', city
        yield 'country', country
48585
def Parse(self):
    """"""
    (start_line, lang) = self.ParseDesc()
    if start_line < 0:
      return
    if 'python' == lang:
      self.ParsePythonFlags(start_line)
    elif 'c' == lang:
      self.ParseCFlags(start_line)
    elif 'java' == lang:
      self.ParseJavaFlags(start_line)
793302
def parse(cls, requester, entries):
        """"""
        result_entries = SearchableList()
        for entry in entries:
            result_entries.append(cls.instance.parse(requester, entry))
        return result_entries
1046362
def _parse(self, source, name, filename):
        """"""
        return Parser(self, source, name, encode_filename(filename)).parse()
1176482
def parse(binary, **params):
    """"""
    binary = io.BytesIO(binary)
    collection = list()
    with zipfile.ZipFile(binary, 'r') as zip_:
        for zip_info in zip_.infolist():
            content_type, encoding = mimetypes.guess_type(zip_info.filename)
            content = zip_.read(zip_info)
            content = content_encodings.get(encoding).decode(content)
            content = content_types.get(content_type).parse(content, **params)
            collection.apppend((zip_info.filename, content))
    return collection
1115815
def parse_detail(self, response):
        """"""
        # Product Information (a start)
        product_data = {
            'url': response.url,
            'name': response.css('div.page-title h1::text').extract_first(),
        }

        # Inventory Number
        inventory_number = re.search(
            r'(?P<inv_num>\d+)$',
            response.css('span.product-in::text').extract_first(),
        ).group('inv_num')
        product_data.update({'in': inventory_number})

        # Specifications (arbitrary key:value pairs)
        specs_table = response.css('#tab-specs dl')
        for row in specs_table.css('div.spec-row'):
            keys = row.css('dt::text').extract()
            values = row.css('dd::text').extract()
            product_data.update({
                key: value
                for (key, value) in zip(keys, values)
            })

        self.logger.info(product_data['name'])
        yield product_data
701972
def _parse(self, text):
        '''
        
        '''
        # ensure unicode first
        text = str(text).strip()

        if not text.startswith(DELIMITER):
            return {}, text

        try:
            _, fm, content = BOUNDARY.split(text, 2)
        except ValueError:
            # if we can't split, bail
            return {}, text
        # loader_class = self.loader_factory(self)
        metadata = yaml.load(fm, Loader=self.loader_class)
        metadata = metadata if (isinstance(metadata, dict)) else {}
        return metadata, content
515431
def parse(self):
        """"""
        # fetch data
        sess = requests.session()
        request = sess.get('https://{}/{}'.format(self.locale,
                                                  self.product_id),
                           allow_redirects=True,
                           timeout=2)
        sess.close()

        # raise exception, e.g. if we are blocked because of too many requests
        request.raise_for_status()

        soup = BeautifulSoup(request.text, 'html.parser')

        # parse name
        raw = soup.find('h1', attrs={'class': 'gh-headline'})
        self.device.name = raw.string.replace('\n', '')

        # parse prices
        self.device.prices = []
        for tmp in soup.select('div.offer__price .gh_price'):
            matches = re.search(_REGEX, tmp.string)
            raw = '{}.{}'.format(matches.group(1),
                                 matches.group(2))
            self.device.prices += [float(raw)]

        # parse unit
        price_match = soup.find('span', attrs={'class': 'gh_price'})
        matches = re.search(r'€|£|PLN', price_match.string)
        self.device.price_currency = matches.group()

        return self.device
114559
def _parse_response(self, resp):
        """"""
        access = resp["access"]
        token = access.get("token")
        self.token = token["id"]
        self.tenant_id = token["tenant"]["id"]
        self.tenant_name = token["tenant"]["name"]
        self.expires = self._parse_api_time(token["expires"])
        self.service_catalog = access.get("serviceCatalog")
        self._parse_service_catalog()
        user = access["user"]
        self.user = {}
        self.user["id"] = user["id"]
        self.username = self.user["name"] = user["name"]
        self.user["roles"] = user["roles"]
169539
public void parse() {
        // read resource file header.
        ResourceTableHeader resourceTableHeader = (ResourceTableHeader) readChunkHeader();

        // read string pool chunk
        stringPool = ParseUtils.readStringPool(buffer, (StringPoolHeader) readChunkHeader());

        resourceTable = new ResourceTable();
        resourceTable.setStringPool(stringPool);

        PackageHeader packageHeader = (PackageHeader) readChunkHeader();
        for (int i = 0; i < resourceTableHeader.getPackageCount(); i++) {
            Pair<ResourcePackage, PackageHeader> pair = readPackage(packageHeader);
            resourceTable.addPackage(pair.getLeft());
            packageHeader = pair.getRight();
        }
    }
1137869
def parse_response(self, response):
        """"""
        try:
            for header in response.getheader("set-cookie").split(", "):
                # filter 'expire' information
                if not header.startswith("D"):
                    continue
                cookie = header.split(";", 1)[0]
                cookieKey, cookieValue = cookie.split("=", 1)
                self._cookies[cookieKey] = cookieValue
        finally:
            return Transport.parse_response(self, response)