'Parses a path, extracting an asset key or creating one.
Args:
course_key: key to the course which owns this asset
path: the path to said content
Returns:
AssetKey: the asset key that represents the path'

@staticmethod
def get_asset_key_from_path(course_key, path):

    if path.startswith('/static/'):
        path = path[len('/static/'):]
    if (not path.startswith('/c4x')):
        path = path.lstrip('/')
    try:
        return AssetKey.from_string(path)
    except InvalidKeyError:
        return StaticContent.compute_location(course_key, path)
