def get_pmid_by_keyword(keyword: str,<EOL>graph: Optional[BELGraph] = None,<EOL>pubmed_identifiers: Optional[Set[str]] = None,<EOL>) -> Set[str]:
if pubmed_identifiers is not None:<EOL><INDENT>return {<EOL>pubmed_identifier<EOL>for pubmed_identifier in pubmed_identifiers<EOL>if pubmed_identifier.startswith(keyword)<EOL>}<EOL><DEDENT>if graph is None:<EOL><INDENT>raise ValueError('<STR_LIT>')<EOL><DEDENT>return {<EOL>pubmed_identifier<EOL>for pubmed_identifier in iterate_pubmed_identifiers(graph)<EOL>if pubmed_identifier.startswith(keyword)<EOL>}<EOL>
Get the set of PubMed identifiers beginning with the given keyword string.

    :param keyword: The beginning of a PubMed identifier
    :param graph: A BEL graph
    :param pubmed_identifiers: A set of pre-cached PubMed identifiers
    :return: A set of PubMed identifiers starting with the given string