def uid(uid):
    """Decorator specifying the unique identifier (UID) of a test case.

    The UID will be recorded in the test's record when executed by Mobly.

    If you use any other decorator for the test method, you may want to use
    this as the outer-most one.

    Note a common UID system is the Universal Unitque Identifier (UUID), but
    we are not limiting people to use UUID, hence the more generic name `UID`.

    Args:
        uid: string, the uid for the decorated test function.
    """
    if uid is None:
        raise ValueError('UID cannot be None.')

    def decorate(test_func):
        @functools.wraps(test_func)
        def wrapper(*args, **kwargs):
            return test_func(*args, **kwargs)

        setattr(wrapper, 'uid', uid)
        return wrapper

    return decorate
Decorator specifying the unique identifier (UID) of a test case.

    The UID will be recorded in the test's record when executed by Mobly.

    If you use any other decorator for the test method, you may want to use
    this as the outer-most one.

    Note a common UID system is the Universal Unitque Identifier (UUID), but
    we are not limiting people to use UUID, hence the more generic name `UID`.

    Args:
        uid: string, the uid for the decorated test function.