human
Complete this python program:
def RegisterUtility(utility_name, version_mapping=None):
assistant
#Here is the Python program you requested.

    """Decorator that registers a class with the given utility name.
    This will only register the utilities being used if the UtilityRegistry is
    enabled. Note that only the utility class\s public methods will cause the
    utility name to be added to the registry.
    Args:
    utility_name: A str specifying the utility name associated with the class.
    version_mapping: A dict containing optional version strings to append to the
    utility string for individual methods; where the key is the method name and
    the value is the text to be appended as the version.
    Returns:
    The decorated class.
    """
    def MethodDecorator(utility_method, version):
        'Decorates    a    method    in    the    utility    class.'
        registry_name = (('%s/%s' % (utility_name, version)) if version else utility_name)
        @wraps(utility_method)
        def Wrapper(*args, **kwargs):
            with _UTILITY_LOCK:
                _utility_registry.Add(registry_name)
            return utility_method(*args, **kwargs)
        return Wrapper
    def ClassDecorator(cls):
        'Decorates    a    utility    class.'
        for (name, method) in inspect.getmembers(cls, inspect.ismethod):
            if (not name.startswith('_')):
                if (not getattr(method, '__self__', None)):
                    setattr(cls, name, MethodDecorator(method, (version_mapping.get(name) if version_mapping else None)))
        return cls
    return ClassDecorator