Check if Scrapy reports any issue with the HTML <title> element.
    If so, compare that <title> element to the title that we got in the
    A11yItem. If they don't match, something is screwy, and pa11y isn't
    parsing the page that we expect.
481439
def check_title_match(expected_title, pa11y_results, logger):
    
    if not pa11y_results:
        # no output from pa11y, nothing to check.
        return
    title_errs = [err for err in pa11y_results
                  if err["context"].startswith("<title")]
    for err in title_errs:
        title_elmt = html.fragment_fromstring(err["context"])
        # pa11ycrawler will elide the title, so grab whatever true
        # content we can from the output
        elided_title = title_elmt.text.strip()
        if elided_title.endswith("..."):
            pa11y_title = elided_title[0:-4].strip()
        else:
            pa11y_title = elided_title

        # check that they match -- the elided version should be a substring
        # of the full version
        if pa11y_title not in expected_title:
            # whoa, something's screwy!
            msg = (
                u'Parser mismatch! '
                u'Scrapy saw full title "{scrapy_title}", '
                u'Pa11y saw elided title "{elided_title}".'
            ).format(
                scrapy_title=expected_title, elided_title=elided_title,
            )
            logger.error(msg)
247092
function( title ) {
		this.element.attr( 'title', lm.utils.stripTags( title ) );
		this.titleElement.html( title );
	}
1352212
def contains_is_html(cls, data):
        
        for key, val in data.items():
            if isinstance(key, str) and key.endswith("IsHTML"):
                return True
            if isinstance(val, (OrderedDict, dict)) and cls.contains_is_html(val):
                return True
        return False
1242392
def is_text_in_page?(content, flag=true)
      if flag
        assert page.has_content?("#{content}"), "Error: #{content} not found page !"
      else
        assert !page.has_content?("#{content}"), "Error: #{content} found in page !"
      end
    end
752789
def matches_content?
      return true if @expected_content.empty?

      @actual_content = ChefSpec::Renderer.new(@runner, resource).content

      return false if @actual_content.nil?

      # Knock out matches that pass. When we're done, we pass if the list is
      # empty. Otherwise, @expected_content is the list of matchers that
      # failed
      @expected_content.delete_if do |expected|
        if expected.is_a?(Regexp)
          @actual_content =~ expected
        elsif RSpec::Matchers.is_a_matcher?(expected)
          expected.matches?(@actual_content)
        elsif expected.is_a?(Proc)
          expected.call(@actual_content)
          # Weird RSpecish, but that block will return false for a negated check,
          # so we always return true. The block will raise an exception if the
          # assertion fails.
          true
        else
          @actual_content.include?(expected)
        end
      end
      @expected_content.empty?
    end
421433
def check_element_by_selector(self, selector):
    """"""
    elems = find_elements_by_jquery(world.browser, selector)
    if not elems:
        raise AssertionError("Expected matching elements, none found.")
88069
def contains_content(browser, content):
    
    for elem in browser.find_elements_by_xpath(str(
            '//*[contains(normalize-space(.), {content}) '
            'and not(./*[contains(normalize-space(.), {content})])]'
            .format(content=string_literal(content)))):

        try:
            if elem.is_displayed():
                return True
        except StaleElementReferenceException:
            pass

    return False
334682
def has_property(elem_to_parse, xpath):
    

    xroot, attr = get_xpath_tuple(xpath)

    if not xroot and not attr:
        return False
    elif not attr:
        return bool(get_elements_text(elem_to_parse, xroot))
    else:
        return bool(get_elements_attributes(elem_to_parse, xroot, attr))
385871
def _html_title(page):
    
    link = "<a href=\"%s\">%s</a>" % (page.data.get('url'),
                                      page.data.get('title'))
    desc = page.data.get('description')
    if desc:
        link += "&mdash;<i>%s</i>" % desc
    else:
        link += "&mdash;<i>description</i>"
    if link:
        return "<p>%s</p>" % link
1298449
def report(issues, show_urls=False):
    
    # titles may have unicode in them, so we must encode everything below
    if show_urls:
        for i in issues:
            print(u'#%d: %s' % (i['number'],
                                      i['title'].replace(u'`', u'``')))
    else:
        for i in issues:
            print(u'* %d: %s' % (i['number'], i['title'].replace(u'`', u'``')))
1273048
def _parse_chance(self, element):
        
        try:
            chance = float(element.text)
        except (ValueError, TypeError, AttributeError):
            self._log.warn('Invalid Chance string: {chance}'.format(chance=element.text))
            return

        # Make sure the chance is a valid percentage
        if not (0 <= chance <= 100):
            self._log.warn('Chance percent must contain an integer or float between 0 and 100')
            return

        self.chance = chance
        self.chance_blocking = bool_attribute(element, 'blocking', self.chance_blocking)
496030
def checkPos(self):
        """"""
        soup = BeautifulSoup(self.css1(path['movs-table']).html, 'html.parser')
        poss = []
        for label in soup.find_all("tr"):
            pos_id = label['id']
            # init an empty list
            # check if it already exist
            pos_list = [x for x in self.positions if x.id == pos_id]
            if pos_list:
                # and update it
                pos = pos_list[0]
                pos.update(label)
            else:
                pos = self.new_pos(label)
            pos.get_gain()
            poss.append(pos)
        # remove old positions
        self.positions.clear()
        self.positions.extend(poss)
        logger.debug("%d positions update" % len(poss))
        return self.positions
712967
def title_text(tag, parent_tag_name=None, p_parent_tag_name=None, direct_sibling_only=False):
    """"""
    title = None

    title_tag = title_tag_inspected(tag, parent_tag_name, p_parent_tag_name, direct_sibling_only)

    if title_tag:
        title = node_contents_str(title_tag)
    return title
573206
def page_title(self, title):
    

    if world.browser.title != title:
        raise AssertionError(
            "Page title expected to be {!r}, got {!r}.".format(
                title, world.browser.title))
242291
def is_string_dunder_all(self, element):
        
        if not isinstance(element.value, (ast.Str, ast.Bytes)):
            return False

        node_value = element.value.s
        if isinstance(node_value, bytes):
            node_value = node_value.decode()
        return node_value == '__all__'
58006
def match?(arr, parser=nil)
      arr = arr.to_a
      return false if arr.length != self.length
      each_with_index do |node, i|
        node.match?(arr[i], parser) or return false
      end
      return true
    end
1255541
private boolean checkElementName(final Node node) {
        return TOPIC_INDEXTERM.matches(node)
                || INDEXING_D_INDEX_SORT_AS.matches(node)
                || INDEXING_D_INDEX_SEE.matches(node)
                || INDEXING_D_INDEX_SEE_ALSO.matches(node);
    }