<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def add_pending(self, family: str, email: str=None) -> models.Analysis: """Add pending entry for an analysis."""

        started_at = dt.datetime.now()
        new_log = self.Analysis(family=family, status='pending', started_at=started_at)
        new_log.user = self.user(email) if email else None
        self.add_commit(new_log)
        return new_log