Register
Login
Resources
Docs Blog Datasets Glossary Case Studies Tutorials & Webinars
Product
Data Engine LLMs Platform Enterprise
Pricing Explore
Connect to our Discord channel

same_emails_without_domain.py 769 B

You have to be logged in to leave a comment. Sign In
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
  1. from typing import Optional, Tuple
  2. from bohrapi.artifacts.identity import Identity
  3. from bohrapi.core import Heuristic
  4. from bohrlabels.core import OneOrManyLabels
  5. from bohrlabels.labels import MatchLabel
  6. @Heuristic(Identity, Identity)
  7. def same_emails_without_domain(
  8. identities: Tuple[Identity, Identity]
  9. ) -> Optional[OneOrManyLabels]:
  10. """
  11. >>> same_emails_without_domain((Identity({"emails": ["hbabii@gmail.com"]}), Identity({"emails": ["hbabii@unibz.it"]})))
  12. MatchLabel.Match
  13. >>> same_emails_without_domain((Identity({"emails": ["a@a.com"]}), Identity({"emails": ["b@b.com"]}))) is None
  14. True
  15. """
  16. name1 = identities[0].normalized_email
  17. name2 = identities[1].normalized_email
  18. if name1 == name2:
  19. return MatchLabel.Match
Tip!

Press p or to see the previous file or, n or to see the next file

Comments

Loading...