Read the next token and interpret it as a DNS name.

        @raises dns.exception.SyntaxError:
        @rtype: dns.name.Name object
176609
def get_name(self, origin=None):
        """"""

        token = self.get()
        if not token.is_identifier():
            raise dns.exception.SyntaxError('expecting an identifier')
        return dns.name.from_text(token.value, origin)
476667
def get_domain_name(url):
    
    if not url.startswith("http"):
        url = "http://" + url
    if not is_valid_url(url):
        raise ValueError("Invalid URL '%s'" % url)
    parse = urlparse(url)
    return parse.netloc
1008355
private function ConsumeNCName()
	{
		$c;
		$sb = array();
		$this->BeginToken();
		while ( ( $c = $this->Peek( 0 ) ) && ord( $c ) != 0 && preg_match( "/[\p{L}\p{N}_\-.]/u", $c ) )
		{
			$sb[] = $this->Read();
		}
		$this->EndToken();
		$this->ConsumeToken2( Token::NCName, implode( "", $sb ) );
	}
146852
protected Name parseNodeTypeName( TokenStream tokens ) {
        tokens.consume('[');
        Name name = parseName(tokens);
        tokens.consume(']');
        return name;
    }
501698
def cmd_dns_lookup_forward(hostname, verbose):
    
    if verbose:
        logging.basicConfig(level=logging.INFO, format='%(message)s')
        print("Looking up %s..." % hostname, file=sys.stderr)

    answer = lookup_forward(hostname)

    print(json.dumps(answer, indent=4))

    return True
306106
def _get_dns_cname(name, link=False):
        
        resolver = dns.resolver.Resolver()
        resolver.lifetime = 1
        domain = dns.resolver.zone_for_name(name, resolver=resolver).to_text(True)
        nameservers = Provider._get_nameservers(domain)
        cname = None
        links, max_links = 0, 5
        while link:
            if links >= max_links:
                LOGGER.error('Hetzner => Record %s has more than %d linked CNAME '
                             'records. Reduce the amount of CNAME links!',
                             name, max_links)
                raise AssertionError
            qname = cname if cname else name
            rrset = Provider._dns_lookup(qname, 'CNAME', nameservers)
            if rrset:
                links += 1
                cname = rrset[0].to_text()
                qdomain = dns.resolver.zone_for_name(cname, resolver=resolver).to_text(True)
                if domain != qdomain:
                    domain = qdomain
                    nameservers = Provider._get_nameservers(qdomain)
            else:
                link = False
        if cname:
            LOGGER.info('Hetzner => Record %s has CNAME %s', name, cname)
        return domain, nameservers, cname
230456
def parse_name(parser):
    # type: (Parser) -> Name
    """"""
    token = expect(parser, TokenKind.NAME)
    return ast.Name(value=token.value, loc=loc(parser, token.start))
1117404
def update_dns(self, new_ip):
        

        headers = None
        if self.auth_type == 'T':
            api_call_url = self._base_url.format(hostname=self.hostname,
                                                 token=self.auth.token,
                                                 ip=new_ip)
        else:
            api_call_url = self._base_url.format(hostname=self.hostname,
                                                 ip=new_ip)
            headers = {
                'Authorization': "Basic %s" %
                                 self.auth.base64key.decode('utf-8'),
                'User-Agent': "%s/%s %s" % (__title__, __version__, __email__)
            }

        r = requests.get(api_call_url, headers=headers)
        self.last_ddns_response = str(r.text).strip()

        return r.status_code, r.text
62277
def parse_names(cls, names: List[str]) -> T:
        """"""
        value = 0
        iterable = cls  # type: Iterable
        for name in names:
            name = name.lower()
            flag = next((item for item in iterable if name == item.name.lower()), None)
            if not flag:
                raise ValueError("{} is not a member of {}".format(
                    name, cls.__name__))
            value = value | int(flag)
        return cls(value)
1322829
def _lookup_dnspython(name, rdtype, timeout=None, servers=None, secure=None):
    '''
    
    '''
    resolver = dns.resolver.Resolver()

    if timeout is not None:
        resolver.lifetime = float(timeout)
    if servers:
        resolver.nameservers = servers
    if secure:
        resolver.ednsflags += dns.flags.DO

    try:
        res = [_data_clean(rr.to_text())
               for rr in resolver.query(name, rdtype, raise_on_no_answer=False)]
        return res
    except dns.rdatatype.UnknownRdatatype:
        raise ValueError('Invalid DNS type {}'.format(rdtype))
    except (dns.resolver.NXDOMAIN,
            dns.resolver.YXDOMAIN,
            dns.resolver.NoNameservers,
            dns.exception.Timeout):
        return False
1093142
def _read_name(self, bufr, idx, strings_offset):
        
        platform_id, encoding_id, lang_id, name_id, length, str_offset = (
            self._name_header(bufr, idx)
        )
        name = self._read_name_text(
            bufr, platform_id, encoding_id, strings_offset, str_offset,
            length
        )
        return platform_id, name_id, name
371453
def ndsname(self):
        
        if self.type not in [None, 'raw', 'reduced', 'online']:
            return '%s,%s' % (self.name, self.type)
        return self.name
257340
def name(self):
        """"""
        # pylint:disable=E1101
        return next((self.names.get(x) for x in self._locales if x in
                     self.names), None)
29707
private void readNameToApps(CoronaSerializer coronaSerializer)
    throws IOException {
    coronaSerializer.readField("nameToApps");
    // Expecting the START_OBJECT token for nameToApps
    coronaSerializer.readStartObjectToken("nameToApps");
    JsonToken current = coronaSerializer.nextToken();

    while (current != JsonToken.END_OBJECT) {
      String nodeName = coronaSerializer.getFieldName();
      // Expecting the START_OBJECT token for the Apps
      coronaSerializer.readStartObjectToken(nodeName);
      Map<String, String> appMap = coronaSerializer.readValueAs(Map.class);
      Map<ResourceType, String> appsOnNode =
        new HashMap<ResourceType, String>();

      for (Map.Entry<String, String> entry : appMap.entrySet()) {
        appsOnNode.put(ResourceType.valueOf(entry.getKey()),
          entry.getValue());
      }

      nameToApps.put(nodeName, appsOnNode);
      current = coronaSerializer.nextToken();
    }
  }
107634
def parse_name(self, line):
        """"""
        end = self.idx
        for char in line[self.idx:]:
            if not char.isalnum() and char not in '\'"_':
                break
            end += 1

        word = line[self.idx:end]

        self.idx = end - 1
        # Update iterator, minus first character which was already read
        self.characters = itertools.islice(self.characters, len(word) - 1,
                                           None)
        self.update_chars()

        return word
1198592
public Token lookahead() {
        Token current = token;
        if (current.next == null) {
            current.next = token_source.getNextToken();
        }
        return current.next;
    }
453533
def get_name(self, seq=None):
        """"""
        if seq is not None:
            it = iter(seq)

            def get_next_token():
                return next(it)
        else:
            get_next_token = self._get_next_token

        next_token = get_next_token()
        tokens = []
        last_token_was_name = False
        while (next_token.token_type == tokenize.NAME or
               (next_token.token_type == tokenize.SYNTAX and
                next_token.name in ('::', '<'))):
            # Two NAMEs in a row means the identifier should terminate.
            # It's probably some sort of variable declaration.
            if last_token_was_name and next_token.token_type == tokenize.NAME:
                break
            last_token_was_name = next_token.token_type == tokenize.NAME
            tokens.append(next_token)
            # Handle templated names.
            if next_token.name == '<':
                tokens.extend(self._get_matching_char('<', '>',
                                                      get_next_token))
                last_token_was_name = True
            next_token = get_next_token()
        return tokens, next_token