Return true, if subdomain is available

@param   string          $subdomain
@param   array|object    $params
@return  bool
973381
public function isSubdomainAvailable( $subdomain, $params = array() )
    {
        $params = (object) $params;

        return ! $this->getMapper()
                      ->isSubdomainExists(
                          $subdomain,
                          empty( $params->id ) ? null : $params->id
                      );
    }
464727
def check_initial_subdomain(cls, subdomain_rec):
        
        if subdomain_rec.n != 0:
            return False
       
        if subdomain_rec.independent:
            return False

        return True
1075163
public function getSubstitutedDomain()
    {
        $currentHost = $_SERVER['HTTP_HOST'];

        // If there are wildcards in the primary domain (not recommended), make some
        // educated guesses about what to replace them with:
        $domain = preg_replace('/\.\*$/', ".{$currentHost}", $this->Domain);

        // Default to "subsite." prefix for first wildcard
        // TODO Whats the significance of "subsite" in this context?!
        $domain = preg_replace('/^\*\./', "subsite.", $domain);

        // *Only* removes "intermediate" subdomains, so 'subdomain.www.domain.com' becomes 'subdomain.domain.com'
        $domain = str_replace('.www.', '.', $domain);

        return $domain;
    }
657321
public function hasSub($name, $ns = null)
    {
        foreach ($this->subs as $sub) {
            if (($name === "*" or $sub->name === $name) and ($ns === null or $sub->ns === $ns)) {
                return true;
            }
        }
        return false;
    }
464711
public static function getSubDomain($sub)
    {
        if (isset(self::$domains[$sub])) {
            return self::$domains[$sub][self::getEnvironment()];
        }

        return null;
    }
27182
private function isDomainMatch($imageHost, array $sourceDomains)
    {
        if (null === $imageHost) {
            return empty($sourceDomains) || in_array(null, $sourceDomains);
        }

        if (in_array($imageHost, $sourceDomains)) {
            return true;
        }

        // check sub domain
        $imageDomainParts = explode('.', $imageHost, 2);
        if (isset($imageDomainParts[1]) && in_array($imageDomainParts[1], $sourceDomains)) {
            return true;
        }

        return false;
    }
702411
public function createSubdomain($domainName, \Transip\Model\SubDomain $subDomain)
    {
        return $this->getSoapClient(array_merge(array($domainName, $subDomain), array('__method' => 'createSubdomain')))->createSubdomain($domainName, $subDomain);
    }
918157
def check_subdomain
			if request.subdomain.present? && Account.where(subdomain: request.subdomain).blank?
				redirect_to mtdevise.root_url(subdomain: false), notice: "Subdomain Doesn't Exist. Would you like to Register."
			end
		end
1338989
public function isIgnoredDomain($domain)
    {
        if ($ignoreRegexes = $this->config()->get('ignore_domain_regexes')) {
            foreach ($ignoreRegexes as $ignore) {
                if (preg_match($ignore, $domain) > 0) {
                    return true;
                }
            }
        }

        return false;
    }
1098408
public static function only(...$params): bool
    {
        if (static::parametersCount() != count(is_array($params[0]) ? $params[0] : $params)) {
            return false;
        }

        return static::containsParams(...$params);
    }
780482
def is_subdomain_record(rec):
    
    txt_entry = rec['txt']
    if not isinstance(txt_entry, list):
        return False

    has_parts_entry = False
    has_pk_entry = False
    has_seqn_entry = False
    for entry in txt_entry:
        if entry.startswith(SUBDOMAIN_ZF_PARTS + "="):
            has_parts_entry = True
        if entry.startswith(SUBDOMAIN_PUBKEY + "="):
            has_pk_entry = True
        if entry.startswith(SUBDOMAIN_N + "="):
            has_seqn_entry = True

    return (has_parts_entry and has_pk_entry and has_seqn_entry)
1003090
function userDomainIsPermitted(userDomains, permittedDomains) {
  var isPermitted = false;

  _.each(permittedDomains, function(permittedDomain) {
    _.each(userDomains, function(userDomain) {
      if(userDomain.toUpperCase() === permittedDomain.toUpperCase()) {
        isPermitted = true;
      }
    });
  });

  return isPermitted;
}
161948
def containsParamSubset(self, params):
        
        for key in params.keys():
            if key not in self.params:
                return False

            if params[key] != self.params[key]:
                return False

        return True
822012
public function isApplicable(array $params)
    {
        foreach ($this->getArguments() as $argument) {
            if ($argument->isApplicable($params)) {
                $this->argument = $argument;
                return true;
            }
        }
        return false;
    }
971486
def delete(self, domain, delete_subdomains=False):
        
        uri = "/%s/%s" % (self.uri_base, utils.get_id(domain))
        if delete_subdomains:
            uri = "%s?deleteSubdomains=true" % uri
        resp, resp_body = self._async_call(uri, method="DELETE",
                error_class=exc.DomainDeletionFailed, has_response=False)
1276267
public function checkDomain()
    {
        // parent
        if ($this->group && ! $this->group->checkDomain())
            return false;

        if ($this->domain === null)
            return true;

        $domain = empty($_SERVER['SERVER_NAME']) ? null : $_SERVER['SERVER_NAME'];
        if ($domain === null)
            return false;

        return $domain === $this->domain;
    }
965848
public function requireIfNotAvailableOr(Configuration $configuration, array $params)
  {
    $requiredIfNotAvailable = $configuration->getOptions()->getRequiredIfNotAvailable();
    foreach ($requiredIfNotAvailable->getOr() as $key)
    {
      if (!array_key_exists(strtolower($key), $params))
      {
        return true;
        break;
      }
    }

    return false;
  }