Parse the home and away healthy scratches

        :returns: ``self`` on success, ``None`` otherwise
968479
def parse_scratches(self):
        
        lx_doc = self.html_doc()
        if not self.__blocks:
            self.__pl_blocks(lx_doc)

        for t in ['aw_scr', 'h_scr']:
            ix = 'away' if t == 'aw_scr' else 'home'
            self.scratches[ix] = self.__clean_pl_block(self.__blocks[t])

        return self if self.scratches else None
1265853
def _get_containing_contigs(self, hits_dict):
        ''''''
        containing = {}

        for qry_name in hits_dict:
            d = self._containing_contigs(hits_dict[qry_name])
            if len(d):
                containing[qry_name] = d

        return containing
410360
function afterWhere(array, exp) {

  if(!isArray(array) || isUndefined(exp))
    return array;

  var index = array.map(function(elm) {
    return $parse(exp)(elm);
  }).indexOf(true);

  return array.slice((index === -1) ? 0 : index);
}
569644
def parse_pkg_info(fn):
    
    res = {}
    for ln in open(fn).read().splitlines():
        if not ln or not ln[:1].strip():
            continue
        key, value = ln.split(": ", 1)
        res[key] = value
    return res
730985
def parse(self):
        
        self.fp.seek(0)
        magic = self.fp.readline()
        assert magic == b'ANDROID BACKUP\n'
        self.version = int(self.fp.readline().strip())
        self.compression = CompressionType(int(self.fp.readline().strip()))
        self.encryption = EncryptionType(self.fp.readline().strip().decode())
        self.__data_start = self.fp.tell()
1367071
def home_abbreviation(self):
        
        abbr = re.sub(r'.*/teams/', '', str(self._home_name))
        abbr = re.sub(r'/.*', '', abbr)
        return abbr
1089386
def _parse_include(self, include):
        
        ret = {}
        for item in include:
            if '.' in item:
                local, remote = item.split('.', 1)
            else:
                local = item
                remote = None

            ret.setdefault(local, [])
            if remote:
                ret[local].append(remote)

        return ret
221970
def toDict(self):
        
        return {
            'hsps': [hsp.toDict() for hsp in self.hsps],
            'read': self.read.toDict(),
        }
840023
def parse_entry(self, soup):
    
    # parse the media object first.
    media_attrs = self.parse_entry_media_attributes(soup)
    media_id = media_attrs[u'id']
    del media_attrs[u'id']
    media = getattr(self.session, self.type)(media_id).set(media_attrs)

    entry_info = {}
    try:
      entry_info[u'started'] = utilities.parse_profile_date(soup.find(u'my_start_date').text)
    except ValueError:
      entry_info[u'started'] = None
    except:
      if not self.session.suppress_parse_exceptions:
        raise

    try:
      entry_info[u'finished'] = utilities.parse_profile_date(soup.find(u'my_finish_date').text)
    except ValueError:
      entry_info[u'finished'] = None
    except:
      if not self.session.suppress_parse_exceptions:
        raise

    try:
      entry_info[u'status'] = self.user_status_terms[int(soup.find(u'my_status').text)]
    except:
      if not self.session.suppress_parse_exceptions:
        raise

    try:
      entry_info[u'score'] = int(soup.find(u'my_score').text)
      # if user hasn't set a score, set it to None to indicate as such.
      if entry_info[u'score'] == 0:
        entry_info[u'score'] = None
    except:
      if not self.session.suppress_parse_exceptions:
        raise

    try:
      entry_info[u'last_updated'] = datetime.datetime.fromtimestamp(int(soup.find(u'my_last_updated').text))
    except:
      if not self.session.suppress_parse_exceptions:
        raise

    return media,entry_info
1137271
def Parse(self):
    """"""
    for timestamp, url, title in self.Query(self.VISITS_QUERY):
      if not isinstance(timestamp, (long, int)):
        timestamp = 0

      yield [timestamp, "FIREFOX3_VISIT", url, title]
970895
def hsps(self):
        
        return (hsp for titleAlignments in self.values()
                for alignment in titleAlignments for hsp in alignment.hsps)
1008735
def get_hkr_state(self):
        """"""
        self.update()
        try:
            return {
                126.5: 'off',
                127.0: 'on',
                self.eco_temperature: 'eco',
                self.comfort_temperature: 'comfort'
            }[self.target_temperature]
        except KeyError:
            return 'manual'
870872
def parse_one_response(line, ignore_bad_cookies=False,
                       ignore_bad_attributes=True):
    
    cookie_dict = {}
    # Basic validation, extract name/value/attrs-chunk
    match = Definitions.SET_COOKIE_HEADER_RE.match(line)
    if not match:
        if not ignore_bad_cookies:
            raise InvalidCookieError(data=line)
        _report_invalid_cookie(line)
        return None
    cookie_dict.update({
        'name': match.group('name'),
        'value': match.group('value')})
    # Extract individual attrs from the attrs chunk
    for match in Definitions.ATTR_RE.finditer(match.group('attrs')):
        captured = dict((k, v) for (k, v) in match.groupdict().items() if v)
        unrecognized = captured.get('unrecognized', None)
        if unrecognized:
            if not ignore_bad_attributes:
                raise InvalidCookieAttributeError(None, unrecognized,
                                                  "unrecognized")
            _report_unknown_attribute(unrecognized)
            continue
        # for unary flags
        for key in ('secure', 'httponly'):
            if captured.get(key):
                captured[key] = True
        # ignore subcomponents of expires - they're still there to avoid doing
        # two passes
        timekeys = ('weekday', 'month', 'day', 'hour', 'minute', 'second',
                    'year')
        if 'year' in captured:
            for key in timekeys:
                del captured[key]
        elif 'year2' in captured:
            for key in timekeys:
                del captured[key + "2"]
        cookie_dict.update(captured)
    return cookie_dict
1221343
def from_array(array):
        
        if array is None or not array:
            return None
        # end if
        assert_type_or_raise(array, dict, parameter_name="array")
        from pytgbot.api_types.receivable.media import Sticker
        

        data = {}
        data['name'] = u(array.get('name'))
        data['title'] = u(array.get('title'))
        data['contains_masks'] = bool(array.get('contains_masks'))
        data['stickers'] = Sticker.from_array_list(array.get('stickers'), list_level=1)
        data['_raw'] = array
        return StickerSet(**data)
980998
def splay_health(health_target):
    
    HealthCheck = collections.namedtuple('HealthCheck', ['path', 'port', 'proto', 'target'])

    proto, health_port_path = health_target.split(':')
    port, *health_path = health_port_path.split('/')

    if proto == 'TCP':
        path = ''
    elif not health_path:
        path = '/healthcheck'
    else:
        path = '/{0}'.format('/'.join(health_path))

    target = '{0}:{1}{2}'.format(proto, port, path)

    health = HealthCheck(path, port, proto, target)
    LOG.info(health)

    return health
367798
def parse_headers(self, use_cookies, raw):
        
        if not raw:
            packet = helper.to_str(helper.read_file(self.fpth))
        else:
            packet = raw
        dat = {}

        pks = [x for x in packet.split('\n') if x.replace(' ', '')]
        url = pks[0].split(' ')[1]

        for i, cnt in enumerate(pks[1:]):
            arr = cnt.split(':')
            if len(arr) < 2:
                continue
            arr = [x.replace(' ', '') for x in arr]
            _k, v = arr[0], ':'.join(arr[1:])
            dat[_k] = v

        if use_cookies:
            try:
                self.fmt_cookies(dat.pop('Cookie'))
            except:
                pass
        self.headers = dat
        self.url = 'https://{}{}'.format(self.headers.get('Host'), url)
        return url, dat
1210942
def get_raw(self):
        
        value = self.parent.read_efuse(self.data_reg_offs)
        return (value & self.mask) >> self.shift