def _is_dns_label(name):
 dns_label = re.compile('^[a-z0-9][a-z0-9\\.-]{1,62}$')
 if dns_label.match(name):
  return True
 else:
  return False

def _is_dns_label ( name ) : dns_label = re . compile ( '^[a-z0-9][a-z0-9\\.-]{1,62}$' ) if dns_label . match ( name ) : return True else : return False
check that name is dns label: an alphanumeric string .