code: def _validate_file_format(self, file_format):
          
  
          if file_format not in self.valid_file_formats:
              raise InvalidFileFormatError(
                  "{} is not a valid file format".format(file_format)
              )
  
          return file_format
docs: Validates file format, raising error if invalid.