def valid_domain(domain):
 domain.encode('ascii')
 if (domain and (domain[0] in '."')):
  return False
 if Definitions.DOMAIN_RE.match(domain):
  return True
 return False

def valid_domain ( domain ) : domain . encode ( 'ascii' ) if ( domain and ( domain [ 0 ] in '."' ) ) : return False if Definitions . DOMAIN_RE . match ( domain ) : return True return False
validate a cookie domain ascii string .