def strip_type_prefix(path, prefix):
    """Strip source type prefix from the path.

    This function strips prefix from strings like::

        [<prefix>]://<path>

    For example::

        pyfile://home/me/config.py -> /home/me/config.py
        json://path/to/some.cfg -> /path/to/some.cfg

    Args:
        path: Path string.
        prefix: Prefix to strip.

    Returns:
        Path string.
    """
    path = path.lstrip()
    if path.startswith(prefix + '://'):
        path = path[len(prefix) + 2:]
    return path