def _normalize_id(key):
    """
    Helper method to normalize a key to avoid issues where some keys have version/branch and others don't.
    e.g. self.scope_ids.usage_id != self.runtime.get_block(self.scope_ids.usage_id).scope_ids.usage_id
    """
    if hasattr(key, 'for_branch'):
        key = key.for_branch(None)
    if hasattr(key, 'for_version'):
        key = key.for_version(None)
    return key
