def _tracking_uri(tracking_uri):
    """Helper function for URI shorthands.

    Parameters
    ----------
    tracking_uri: str
        "file" will translate to `None`,
        "localhost" to "http://localhost:5000", and
        "localhost-2" to "http://localhost:5002".

    Returns
    -------
    str or None
    """
    if tracking_uri == 'file':
        tracking_uri = None
    elif tracking_uri is not None and tracking_uri.startswith('localhost'):
        split = tracking_uri.split('-')
        port = 5000
        if len(split) > 1:
            port += int(split[1])
        tracking_uri = 'http://localhost:{}'.format(port)
    else:
        tracking_uri = tracking_uri
    return tracking_uri
