Return the domain and username in the format:
<tt>domain\\username</tt>. This is equivalent to <tt>toString()</tt>.
503265
public String getName() {
        boolean d = domain.length() > 0 && domain.equals( "?" ) == false;
        return d ? domain + "\\" + username : username;
    }
921780
public function getUsername()
    {
        $info = $this->getUserInfo();
        $username = strstr($info, ':', true);

        return rawurldecode($username === false ? $info : $username);
    }
7177
def domain_name(self, levels=1):
        
        if levels < 1:
            raise ValueError("levels must be greater than or equal to 1")
        if levels == 1:
            return self.domain_word() + '.' + self.tld()
        else:
            return self.domain_word() + '.' + self.domain_name(levels - 1)
1230903
function getDomain(domainName) {
    if (!isString(domainName)) {
        throw new InvalidException('domaiName should extists and be a string', domainName);
    }
    if (!domainsMap.has(domainName)) {
        console.warn(`You are trying to access a non existing domain: ${domainName}`);
        return Immutable.Map({});
    }
    return domainsMap.get(domainName);
}
283808
def _generate_domain():
        

        # Check for LSID domain setting file
        try:
            user_dir = str(pathlib.Path.home())
            jupyter_dir = os.path.join(user_dir, '.jupyter')
            domain_path = os.path.join(jupyter_dir, 'lsid_domain')
            with open(domain_path, 'r') as domain_file:
                domain = str(domain_file.read()).strip()
            if domain is not None and domain != '':
                return domain
        except:
            # Ignore exceptions, simply fall back to the domain name
            pass

        # If this fails, return the fully qualified domain name
        return socket.getfqdn()
1145726
public com.google.protobuf.ByteString
      getAuthDomainBytes() {
    java.lang.Object ref = authDomain_;
    if (ref instanceof java.lang.String) {
      com.google.protobuf.ByteString b = 
          com.google.protobuf.ByteString.copyFromUtf8(
              (java.lang.String) ref);
      authDomain_ = b;
      return b;
    } else {
      return (com.google.protobuf.ByteString) ref;
    }
  }
1276290
public function toString()
   {
      if ( empty( $this->_hostName ) )
      {
         if ( \is_null( $this->_tld ) )
         {
            return '';
         }
         return $this->_tld->toString();
      }
      if ( \is_null( $this->_tld ) )
      {
         return $this->_hostName;
      }
      return $this->_hostName . '.' . $this->_tld->toString();
   }
1224077
def usernameFromRequest(request):
    
    username = request.args.get('username', [''])[0]
    if '@' not in username:
        username = '%s@%s' % (
            username, request.getHeader('host').split(':')[0])
    return username
777121
def get_username(identifier):
    """"""
    pattern = re.compile('.+@\w+\..+')
    if pattern.match(identifier):
        try:
            user = User.objects.get(email=identifier)
        except:
            raise Http404
        else:
            return user.username
    else:
        return identifier
1175655
public HostName toHostName() {
		HostName host = fromHost;
		if(host == null) {
			fromHost = host = toCanonicalHostName();
		}
		return host;
	}
577703
public static String userName() {
        return fixNonWord(StringUtils.left(JDefaultName.firstName(), 1).toLowerCase() + JDefaultName.lastName().toLowerCase() + JDefaultNumber.randomNumberString(2));
    }
60353
public java.lang.String getAuthDomain() {
    java.lang.Object ref = authDomain_;
    if (ref instanceof java.lang.String) {
      return (java.lang.String) ref;
    } else {
      com.google.protobuf.ByteString bs = 
          (com.google.protobuf.ByteString) ref;
      java.lang.String s = bs.toStringUtf8();
      authDomain_ = s;
      return s;
    }
  }
1155908
def get_ip_address(domain):
    
    if "://" not in domain:
        domain = "http://" + domain

    hostname = urlparse(domain).netloc

    if not hostname:
        raise ValueError("Can't parse hostname!")

    return socket.gethostbyname(hostname)
661045
def getDomainFromUrl(self, url):
        
        try:
            domain = re.findall( self.domainRegexp, url )[0]
        except Exception, e:
            errMsg = "ERROR. Something happened when trying to find the domain from <" + url + ">. Are you sure that the following regular expression matches a domain in the url provided?\n\t" + self.domainRegexp
            raise Exception( errMsg + "\n" + str(e) )
                    
        return domain
961985
def get_domain_home_from_url(self, url):
        
        p = parse.urlparse(url)
        if p.netloc:
            self.domain = p.netloc
            self.homepage = '{}://{}'.format(p.scheme, p.netloc)
            return self.homepage, p.netloc
        else:
            return '', ''
894124
def get_email_address(self):
        
        if self.login is None:
            self.login = self.generate_login()

        available_domains = self.available_domains
        if self.domain is None:
            self.domain = random.choice(available_domains)
        elif self.domain not in available_domains:
            raise ValueError('Domain not found in available domains!')
        return u'{0}{1}'.format(self.login, self.domain)
331693
private String getSimpleUsername(String username) {
        int lastSlash = username.lastIndexOf('\\');
        if (lastSlash > -1) {
            username = username.substring(lastSlash + 1);
        }

        return username;
    }