<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def continent(self, code: bool = False) -> str: """Get a random continent name or continent code. :param code: Return code of continent. :return: Continent name. """

        codes = CONTINENT_CODES if \
            code else self._data['continent']

        return self.random.choice(codes)