code: def remove_dataset(self, dataset=None, **kwargs):
          self._kwargs_checks(kwargs)
          if dataset is None and not len(kwargs.items()):
              raise ValueError("must provide some value to filter for datasets")
          kind = kwargs.get('kind', None)
          if kind is not None:
              if isinstance(kind, str):
                  kind = [kind]
              kind_deps = []
              for kind_i in kind:
                  dep = '{}_dep'.format(kind_i)
                  if dep not in kind:
                      kind_deps.append(dep)
              kind = kind + kind_deps
          kwargs['kind'] = kind
          if dataset is None:
              dataset = self.filter(**kwargs).datasets
              kwargs['kind'] = None
          kwargs['dataset'] = dataset
          kwargs['qualifier'] = None
          kwargs.setdefault('context', ['dataset', 'model', 'constraint', 'compute'])
          self.remove_parameters_all(**kwargs)
          self.remove_parameters_all(**kwargs)
          self._handle_dataset_selectparams()
          self._add_history(redo_func='remove_dataset',
                            redo_kwargs={'dataset': dataset},
                            undo_func=None,
                            undo_kwargs={})
          return