def get_pack_metadata(pack_dir):
    """
    Return parsed metadata for a particular pack directory.

    :rtype: ``dict``
    """
    manifest_path = os.path.join(pack_dir, MANIFEST_FILE_NAME)

    if not os.path.isfile(manifest_path):
        raise ValueError(
            'Pack "%s" is missing %s file' % (pack_dir, MANIFEST_FILE_NAME)
        )

    meta_loader = MetaLoader()
    content = meta_loader.load(manifest_path)
    if not content:
        raise ValueError('Pack "%s" metadata file is empty' % (pack_dir))

    return content

    Return parsed metadata for a particular pack directory.

    :rtype: ``dict``
    
st2common/st2common/util/pack.py