steambird/models/coursetree.py
def parent(self) -> Optional['Period']:
        """
        Method which returns the parents of a Period

        :return: Usually a Period, or None
        """

        if self in [Period.Q1, Period.Q2]:
            return Period.S1
        if self in [Period.Q3, Period.Q4]:
            return Period.S2
        if self == Period.Q5:
            return Period.S3
        if self in [Period.S1, Period.S2]:
            return Period.YEAR
        if self in [Period.S3, Period.YEAR]:
            return Period.FULL_YEAR
        return None

        Method which returns the parents of a Period

        :return: Usually a Period, or None
        
Method which returns the parents of a Period
Method which returns the parents of a Period
def parent(self) -> Optional['Period']:
        if self in [Period.Q1, Period.Q2]:
            return Period.S1
        if self in [Period.Q3, Period.Q4]:
            return Period.S2
        if self == Period.Q5:
            return Period.S3
        if self in [Period.S1, Period.S2]:
            return Period.YEAR
        if self in [Period.S3, Period.YEAR]:
            return Period.FULL_YEAR
        return None
def parent ( self ) -> Optional [ 'Period' ] : if self in [ Period . Q1 , Period . Q2 ] : return Period . S1 if self in [ Period . Q3 , Period . Q4 ] : return Period . S2 if self == Period . Q5 : return Period . S3 if self in [ Period . S1 , Period . S2 ] : return Period . YEAR if self in [ Period . S3 , Period . YEAR ] : return Period . FULL_YEAR return None
Method which returns the parents of a Period
Method which returns the parents of a Period
"""
        Method which returns the parents of a Period

        :return: Usually a Period, or None
        """
Usually a Period, or None
Usually a Period or None
self