(s)
return ''.join([c for c in s
                  if (c.isalnum() and ord(c) < 128) or c in ['.', '_']])
Sanitize a domain name to ch aracters suitable for use in code.

  We only want text characters, digits, and '.'. For now, we only allow ASCII,
  characters but we may revisit that in the future if there is demand from
  Endpoints customers.

  Since the pattern 'my-custom-app.appspot.com' is a popular one, preserve the
  '-' in a useful way.

  Args:
    s: (str) A domain name
  Returns:
    (str) A version of the domain name suitable for use in code structures
        like Java package names. None if s is None.
Sanitize a domain name to ch aracters suitable for use in code.
Sanitize a domain name to ch aracters suitable for use in code .
def SanitizeDomain(s):
  """Sanitize a domain name to ch aracters suitable for use in code.

  We only want text characters, digits, and '.'. For now, we only allow ASCII,
  characters but we may revisit that in the future if there is demand from
  Endpoints customers.

  Since the pattern 'my-custom-app.appspot.com' is a popular one, preserve the
  '-' in a useful way.

  Args:
    s: (str) A domain name
  Returns:
    (str) A version of the domain name suitable for use in code structures
        like Java package names. None if s is None.
  """
  if s is None:
    return None
  s = s.lower().replace('-', '_')
  return ''.join([c for c in s
                  if (c.isalnum() and ord(c) < 128) or c in ['.', '_']])
def SanitizeDomain ( s ) : if s is None : return None s = s . lower ( ) . replace ( '-' , '_' ) return '' . join ( [ c for c in s if ( c . isalnum ( ) and ord ( c ) < 128 ) or c in [ '.' , '_' ] ] )