<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def get_metric(revision, operator, path, key):
 """ Get a metric from the cache. :param revision: The revision id. :type revision: ``str`` :param operator: The operator name. :type operator: ``str`` :param path: The path to the file/function :type path: ``str`` :param key: The key of the data :type key: ``str`` :return: Data from the cache :rtype: ``dict`` """

    if ":" in path:
        part, entry = path.split(":")
        val = revision[operator][part][entry][key]
    else:
        val = revision[operator][path][key]
    return val