<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def im_files(self, room_id=None, user_name=None, **kwargs):
 """Retrieves the files from a direct message."""

        if room_id:
            return self.__call_api_get('im.files', roomId=room_id, kwargs=kwargs)
        elif user_name:
            return self.__call_api_get('im.files', username=user_name, kwargs=kwargs)
        else:
            raise RocketMissingParamException('roomId or username required')