

def check_if_new(self, member_identifier, add_if_new=True, alert_function=None):
    if (member_identifier is None):
        return False
    name = MemberTracker.doc_name(member_identifier)
    tool = MemberTracker.tool_name()
    (repo, did_add) = get_one_or_create(self.session, Repo, name=self.repository_name)
    (members_doc, did_add) = get_one_or_create(self.session, RepoDocument, repo=repo, tool=tool, name=name)
    if did_add:
        members_doc.data = {
            
        }
        if alert_function:
            alert_function(member_identifier)
        self.session.commit()
        return True
    self.session.commit()
    return False

dataset/ETHPy150Open SalesforceEng/Providence/detection/behavior/membertracker.py MemberTracker.check_if_new/original