human
What is a good Python function to that cleans up namespace.
assistant
Here is a Python function that cleans up names

import re

def clean_name(name):
    """Cleans up name"""
    return re.sub(r'[^a-zA-Z0-9_]', '_', name)

# Enter the name
name ="yellow submarine"

# Calling the function
print((clean_name(name)))

#Example Output
# yellow_submarine

#Remember to inspect code for bugs.