code: def convert(self, obj):
          
          # We accept None representing No Image
          if obj is None:
              return None
          elif isinstance(obj, six.string_types):
              return DataFrame(filename=obj)
          elif isinstance(obj, DataFrame):
              return obj
          elif isinstance(obj, fits.HDUList):
              return DataFrame(frame=obj)
          elif isinstance(obj, fits.PrimaryHDU):
              return DataFrame(frame=fits.HDUList([obj]))
          else:
              msg = 'object of type %r cannot be converted to DataFrame' % obj
              raise TypeError(msg)
docs: Convert