Get a domain by it's name.
432588
function getDomain(domain, callback) {
    getAll(function onGetAll(err, domains) {
      if (err) {
        return callback(err);
      }

      callback(null, domains.results.filter(function onGetDomain(domain_obj) {
        return domain_obj.domain == domain;
      })[0]);
    });
  }
538375
def domain_name(self, domain_name):
        

        if domain_name is None:
            raise ValueError("Invalid value for `domain_name`, must not be `None`")
        if len(domain_name) > 255:
            raise ValueError("Invalid value for `domain_name`, length must be less than `255`")
        if len(domain_name) < 1:
            raise ValueError("Invalid value for `domain_name`, length must be greater than or equal to `1`")

        self._domain_name = domain_name
666280
def extract_domain(host):
    
    host = re.sub('https?://', '', host)
    host = re.match('([^/]+)', host).groups()[0]
    domain = '.'.join(host.split('.')[-2:])
    if domain in _domains:
        domain = '.'.join(host.split('.')[-3:])
    return domain
1137845
def lookup(sock, domain, cache = None):
    """"""
    domain = normalize_domain(domain)

    # cache miss, perform lookup
    reply = sam_cmd(sock, "NAMING LOOKUP NAME=%s" % domain)

    b64_dest = reply.get('VALUE')
    if b64_dest:
        dest = Dest(b64_dest, encoding='base64')
        if cache:
            cache[dest.base32 + '.b32.i2p'] = dest
        return dest
    else:
        raise NSError('Domain name %r not resolved because %r' % (domain, reply))
1139475
def _get_zone_id_from_name(self, name):
        """"""
        results = self.client['Account'].getDomains(
            filter={"domains": {"name": utils.query_filter(name)}})
        return [x['id'] for x in results]
1182202
def _is_domain_match(domain: str, hostname: str) -> bool:
        """"""
        if hostname == domain:
            return True

        if not hostname.endswith(domain):
            return False

        non_matching = hostname[:-len(domain)]

        if not non_matching.endswith("."):
            return False

        return not is_ip_address(hostname)
786096
def get_by_name(self, name, alias=None):
        """"""
        search_filter = "[?name=='{}']".format(name)

        if alias:
            if self.version == 1:
                search_filter = "accounts[?name=='{name}' || contains(alias, '{name}')]".format(name=name)

            elif self.version == 2:
                search_filter = "[?name=='{name}' || contains(aliases, '{name}')]".format(name=name)

        return self.get_all(search_filter)
426724
def get_subdomain(url):
        

        if url not in URLHelper.__cache:
            URLHelper.__cache[url] = urlparse(url)

        return ".".join(URLHelper.__cache[url].netloc.split(".")[:-2])
185425
def get_name(self, properly_capitalized=False):
        """"""

        if properly_capitalized:
            self.name = _extract(
                self._request(self.ws_prefix + ".getInfo", True), "name"
            )

        return self.name
814668
def get_domain(self):
        
        if hasattr(self, 'domain'):
            return Domain(self.rest_client.make_request(self.domain), self.rest_client)
619921
def extract_domain(var_name, output):
    

    var = getenv(var_name)

    if var:
        p = urlparse(var)
        output.append(p.hostname)
1236779
public Cookie get(String name, String domain) {
		for(Cookie cookie : this) {
			if(cookie.getName().equals(name) && cookie.getDomain().equals(domain))
				return cookie; 
		}
		return null;
	}
1217025
def get_netki_domains(self, fetch=False):
        """"""
        return NetkiDomains(
            self.resource.netki_domains, self.client, populate=fetch)
556217
def get_by_hostname(self, hostname):
        """"""
        def filter_by_hostname(hostname, enclosure):
            is_primary_ip = ('activeOaPreferredIP' in enclosure and enclosure['activeOaPreferredIP'] == hostname)
            is_standby_ip = ('standbyOaPreferredIP' in enclosure and enclosure['standbyOaPreferredIP'] == hostname)
            return is_primary_ip or is_standby_ip

        enclosures = self.get_all()
        result = [x for x in enclosures if filter_by_hostname(hostname, x)]

        if result:
            new_resource = self.new(self._connection, result[0])
        else:
            new_resource = None

        return new_resource
216572
def get_source_name(self, name):
        """"""
        if name not in self.like.sourceNames():
            name = self.roi.get_source_by_name(name).name
        return name
253950
def get_name(self, name):
        """"""
        if name not in self.get_names():
            raise exceptions.NameNotFoundError('name %s not found' % name)
        return self.get_names()[name]
327762
def get_domains(custom_headers:nil)
      response = get_domains_async(custom_headers:custom_headers).value!
      response.body unless response.nil?
    end