<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def extension(self, file_type: Optional[FileType] = None) -> str: """Get a random file extension from list. :param file_type: Enum object FileType. :return: Extension of the file. :Example: .py """

        key = self._validate_enum(item=file_type, enum=FileType)
        extensions = EXTENSIONS[key]
        return self.random.choice(extensions)