<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_student_by_email(self, email, students=None):
 """Get a student based on an email address. Calls ``self.get_students()`` to get list of all students, if not passed as the ``students`` parameter. Args: email (str):
 student email students (list):
 dictionary of students to search, default: None When ``students`` is unspecified, all students in gradebook are retrieved. Raises: requests.RequestException: Exception connection error ValueError: Unable to decode response content Returns: tuple: tuple of student id and student dictionary. """

        if students is None:
            students = self.get_students()

        email = email.lower()
        for student in students:
            if student['accountEmail'].lower() == email:
                return student['studentId'], student
        return None, None