code: def cast(cls, datasets, datatype=None, cast_type=None):
          
          datatype = datatype or cls.datatype
          cast = []
          for ds in datasets:
              if cast_type is not None or ds.interface.datatype != datatype:
                  ds = ds.clone(ds, datatype=[datatype], new_type=cast_type)
              cast.append(ds)
          return cast
docs: Given a list of Dataset objects, cast them to the specified
          datatype (by default the format matching the current interface)
          with the given cast_type (if specified).