class_docstr: fastNLP的数据容器。
  
  Example::
  
      from fastNLP.core.dataset import DataSet, Instance
      data = {'x': [[1, 0, 1], [0, 1, 1], 'y': [0, 1]}
      data1 = [Instance(x=[1,0,1],y=0), Instance(x=[0,1,1],y=1)]
      ds = DataSet(data)
      ds = DataSet(data1)
  
  fastNLP的 DataSet 是 key-value 存储形式， 目前支持两种初始化方式，输入 data 分别为 ``List[:class:`~fastNLP.core.dataset.Instance`]`` 和
  ``Dict[str, List[Any]]``。
  
      * 当 data 为 ``List[:class:`~fastNLP.core.dataset.Instance`]`` 时,  每个 ``Instance`` 的 field_name 需要保持一致。
        Instance 详见 :class:`~fastNLP.core.dataset.Instance` 。
      * 当 data 为 ``Dict[str, List[Any]]`` 时， 则每个 key 的 value 应该为等长的 list， 否则不同 field 的长度不一致。
  
  :param data: 初始化的内容，其只能为两种类型，分别为 ``List[:class:`~fastNLP.core.dataset.Instance`]`` 和
      ``Dict[str, List[Any]]``。
  
      * 当 data 为 ``List[:class:`~fastNLP.core.dataset.Instance`]`` 时,  每个 ``Instance`` 的 field_name 需要保持一致。
        Instance 详见 :class:`~fastNLP.core.dataset.Instance` 。
      * 当 data 为 ``Dict[str, List[Any]] 时， 则每个 key 的 value 应该为等长的 list， 否则不同 field 的长度不一致。
class_docstr_tok: ["fastNLP\u7684\u6570\u636e\u5bb9\u5668\u3002","Example",":",":","from","fastNLP.core.dataset","import","DataSet",",","Instance","data","=","{","'","x","'",":","[","[","1",",","0",",","1","]",",","[","0",",","1",",","1","]",",","'","y","'",":","[","0",",","1","]","}","data1","=","[","Instance","(","x=","[","1,0,1","]",",","y=0",")",",","Instance","(","x=","[","0,1,1","]",",","y=1",")","]","ds","=","DataSet","(","data",")","ds","=","DataSet","(","data1",")","fastNLP\u7684","DataSet","\u662f","key-value","\u5b58\u50a8\u5f62\u5f0f\uff0c","\u76ee\u524d\u652f\u6301\u4e24\u79cd\u521d\u59cb\u5316\u65b9\u5f0f\uff0c\u8f93\u5165","data","\u5206\u522b\u4e3a","``","List","[",":","class",":","`","~fastNLP.core.dataset.Instance","`","]","``","\u548c","``","Dict","[","str",",","List","[","Any","]","]","``","\u3002","*","\u5f53","data","\u4e3a","``","List","[",":","class",":","`","~fastNLP.core.dataset.Instance","`","]","``","\u65f6",",","\u6bcf\u4e2a","``","Instance","``","\u7684","field_name","\u9700\u8981\u4fdd\u6301\u4e00\u81f4\u3002","Instance","\u8be6\u89c1",":","class",":","`","~fastNLP.core.dataset.Instance","`","\u3002","*","\u5f53","data","\u4e3a","``","Dict","[","str",",","List","[","Any","]","]","``","\u65f6\uff0c","\u5219\u6bcf\u4e2a","key","\u7684","value","\u5e94\u8be5\u4e3a\u7b49\u957f\u7684","list\uff0c","\u5426\u5219\u4e0d\u540c","field","\u7684\u957f\u5ea6\u4e0d\u4e00\u81f4\u3002",":","param","data",":","\u521d\u59cb\u5316\u7684\u5185\u5bb9\uff0c\u5176\u53ea\u80fd\u4e3a\u4e24\u79cd\u7c7b\u578b\uff0c\u5206\u522b\u4e3a","``","List","[",":","class",":","`","~fastNLP.core.dataset.Instance","`","]","``","\u548c","``","Dict","[","str",",","List","[","Any","]","]","``","\u3002","*","\u5f53","data","\u4e3a","``","List","[",":","class",":","`","~fastNLP.core.dataset.Instance","`","]","``","\u65f6",",","\u6bcf\u4e2a","``","Instance","``","\u7684","field_name","\u9700\u8981\u4fdd\u6301\u4e00\u81f4\u3002","Instance","\u8be6\u89c1",":","class",":","`","~fastNLP.core.dataset.Instance","`","\u3002","*","\u5f53","data","\u4e3a","``","Dict","[","str",",","List","[","Any","]","]","\u65f6\uff0c","\u5219\u6bcf\u4e2a","key","\u7684","value","\u5e94\u8be5\u4e3a\u7b49\u957f\u7684","list\uff0c","\u5426\u5219\u4e0d\u540c","field","\u7684\u957f\u5ea6\u4e0d\u4e00\u81f4\u3002"]
docstr: 删除某些 Instance。 需要注意的是 ``func`` 接受一个 Instance ，返回 bool 值。返回值为 ``True`` 时，
  该 Instance 会被移除或者不会包含在返回的 DataSet 中。
  
  :param func: 接受一个 Instance 作为参数，返回 bool 值。为 ``True`` 时删除该 instance
  :param inplace: 是否在当前 DataSet 中直接删除 instance；如果为 False，将返回一个新的 DataSet。
  
  :return: DataSet
docstr_tok: ["\u5220\u9664\u67d0\u4e9b","Instance\u3002","\u9700\u8981\u6ce8\u610f\u7684\u662f","``","func","``","\u63a5\u53d7\u4e00\u4e2a","Instance","\uff0c\u8fd4\u56de","bool","\u503c\u3002\u8fd4\u56de\u503c\u4e3a","``","True","``","\u65f6\uff0c","\u8be5","Instance","\u4f1a\u88ab\u79fb\u9664\u6216\u8005\u4e0d\u4f1a\u5305\u542b\u5728\u8fd4\u56de\u7684","DataSet","\u4e2d\u3002",":","param","func",":","\u63a5\u53d7\u4e00\u4e2a","Instance","\u4f5c\u4e3a\u53c2\u6570\uff0c\u8fd4\u56de","bool","\u503c\u3002\u4e3a","``","True","``","\u65f6\u5220\u9664\u8be5","instance",":","param","inplace",":","\u662f\u5426\u5728\u5f53\u524d","DataSet","\u4e2d\u76f4\u63a5\u5220\u9664","instance\uff1b\u5982\u679c\u4e3a","False\uff0c\u5c06\u8fd4\u56de\u4e00\u4e2a\u65b0\u7684","DataSet\u3002",":","return",":","DataSet"]
code: def drop(self, func: Callable, inplace=True):
      r"""
      删除某些 Instance。 需要注意的是 ``func`` 接受一个 Instance ，返回 bool 值。返回值为 ``True`` 时，
      该 Instance 会被移除或者不会包含在返回的 DataSet 中。
  
      :param func: 接受一个 Instance 作为参数，返回 bool 值。为 ``True`` 时删除该 instance
      :param inplace: 是否在当前 DataSet 中直接删除 instance；如果为 False，将返回一个新的 DataSet。
  
      :return: DataSet
      """
      if inplace:
          results = [ins for ins in self if not func(ins)]
          for name, old_field in self.field_arrays.items():
              self.field_arrays[name].content = [
                  ins[name] for ins in results
              ]
          return self
      else:
          results = [ins for ins in self if not func(ins)]
          if len(results) != 0:
              dataset = DataSet(results)
          else:
              dataset = DataSet()
              for name in self.field_arrays.keys():
                  empty_field = FieldArray(name, [None])
                  empty_field.content = []
                  dataset.field_arrays[name] = empty_field
          return dataset
  
imports: import _pickle
  from copy import deepcopy
  from typing import Optional, List, Callable, Union, Dict, Any, Mapping
  from types import LambdaType
  import sys
  import time
  import numpy
  from .field import FieldArray
  from .instance import Instance
  from fastNLP.core.utils.utils import pretty_table_printer, deprecated
  from fastNLP.core.collators import Collator
  from fastNLP.core.utils.rich_progress import f_rich_progress, DummyFRichProgress
  from fastNLP.core.utils.tqdm_progress import f_tqdm_progress
  from ..log import logger
  from fastNLP.core.utils.dummy_class import DummyClass
  from ..utils.utils import _get_fun_msg
label_desc: Use image node_id 31 for calling the DataSet obj's underlying member method code with example usage: obj.drop(func, inplace) and returns: self, dataset