<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def email(self, domains: Union[tuple, list] = None) -> str: """Generate a random email. :param domains: List of custom domains for emails. :type domains: list or tuple :return: Email address. :Example: foretime10@live.com """

        if not domains:
            domains = EMAIL_DOMAINS

        domain = self.random.choice(domains)
        name = self.username(template='ld')
        return '{name}{domain}'.format(
            name=name,
            domain=domain,
        )