<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def get_or_create_evidence(self, citation: Citation, text: str) -> Evidence: """Create an entry and object for given evidence if it does not exist."""

        sha512 = hash_evidence(text=text, type=str(citation.type), reference=str(citation.reference))

        if sha512 in self.object_cache_evidence:
            evidence = self.object_cache_evidence[sha512]
            self.session.add(evidence)
            return evidence

        evidence = self.get_evidence_by_hash(sha512)

        if evidence is not None:
            self.object_cache_evidence[sha512] = evidence
            return evidence

        evidence = Evidence(
            text=text,
            citation=citation,
            sha512=sha512,
        )

        self.session.add(evidence)
        self.object_cache_evidence[sha512] = evidence
        return evidence