@staticmethod<EOL><INDENT>def _get_index_from_meta(<EOL>meta: "<STR_LIT>", package_name: str, index_name: typing.Optional[str]<EOL>) -> typing.Optional[Source]:<DEDENT>
if index_name is not None and index_name in meta.sources:<EOL><INDENT>return meta.sources[index_name]<EOL><DEDENT>elif index_name is not None and index_name not in meta.sources:<EOL><INDENT>raise PipfileParseError(f"<STR_LIT>")<EOL><DEDENT>return None<EOL>
Get the only index name present in the Pipfile.lock metadata.

        If there is no index explicitly assigned to package, there is only one package source
        index configured in the meta. Assign it to package.