def __safe_name(self, method_name):
    """Restrict method name to a-zA-Z0-9_, first char lowercase."""
    # Endpoints backend restricts what chars are allowed in a method name.
    safe_name = re.sub(r'[^\.a-zA-Z0-9_]', '', method_name)

    # Strip any number of leading underscores.
    safe_name = safe_name.lstrip('_')

    # Ensure the first character is lowercase.
    # Slice from 0:1 rather than indexing [0] in case safe_name is length 0.
    return safe_name[0:1].lower() + safe_name[1:]
def __safe_name ( self , method_name ) : safe_name = re . sub ( r'[^\.a-zA-Z0-9_]' , '' , method_name ) safe_name = safe_name . lstrip ( '_' ) return safe_name [ 0 : 1 ] . lower ( ) + safe_name [ 1 : ]
Restrict method name to a-zA-Z0-9_, first char lowercase.