class_docstr: Class to add epoch selection and metadata to certain classes.
class_docstr_tok: ["Class","to","add","epoch","selection","and","metadata","to","certain","classes","."]
docstr: Return an Epochs object with a copied subset of epochs.
  
  Parameters
  ----------
  item : slice, array-like, str, or list
      See below for use cases.
  
  Returns
  -------
  epochs : instance of Epochs
      See below for use cases.
  
  Notes
  -----
  Epochs can be accessed as ``epochs[...]`` in several ways:
  
  1. **Integer or slice:** ``epochs[idx]`` will return an `~mne.Epochs`
     object with a subset of epochs chosen by index (supports single
     index and Python-style slicing).
  
  2. **String:** ``epochs['name']`` will return an `~mne.Epochs` object
     comprising only the epochs labeled ``'name'`` (i.e., epochs created
     around events with the label ``'name'``).
  
     If there are no epochs labeled ``'name'`` but there are epochs
     labeled with /-separated tags (e.g. ``'name/left'``,
     ``'name/right'``), then ``epochs['name']`` will select the epochs
     with labels that contain that tag (e.g., ``epochs['left']`` selects
     epochs labeled ``'audio/left'`` and ``'visual/left'``, but not
     ``'audio_left'``).
  
     If multiple tags are provided *as a single string* (e.g.,
     ``epochs['name_1/name_2']``), this selects epochs containing *all*
     provided tags. For example, ``epochs['audio/left']`` selects
     ``'audio/left'`` and ``'audio/quiet/left'``, but not
     ``'audio/right'``. Note that tag-based selection is insensitive to
     order: tags like ``'audio/left'`` and ``'left/audio'`` will be
     treated the same way when selecting via tag.
  
  3. **List of strings:** ``epochs[['name_1', 'name_2', ... ]]`` will
     return an `~mne.Epochs` object comprising epochs that match *any* of
     the provided names (i.e., the list of names is treated as an
     inclusive-or condition). If *none* of the provided names match any
     epoch labels, a ``KeyError`` will be raised.
  
     If epoch labels are /-separated tags, then providing multiple tags
     *as separate list entries* will likewise act as an inclusive-or
     filter. For example, ``epochs[['audio', 'left']]`` would select
     ``'audio/left'``, ``'audio/right'``, and ``'visual/left'``, but not
     ``'visual/right'``.
  
  4. **Pandas query:** ``epochs['pandas query']`` will return an
     `~mne.Epochs` object with a subset of epochs (and matching
     metadata) selected by the query called with
     ``self.metadata.eval``, e.g.::
  
         epochs["col_a > 2 and col_b == 'foo'"]
  
     would return all epochs whose associated ``col_a`` metadata was
     greater than two, and whose ``col_b`` metadata was the string 'foo'.
     Query-based indexing only works if Pandas is installed and
     ``self.metadata`` is a :class:`pandas.DataFrame`.
  
     .. versionadded:: 0.16
docstr_tok: ["Return","an","Epochs","object","with","a","copied","subset","of","epochs",".","Parameters","--","--","--","--","--","item",":","slice",",","array-like",",","str",",","or","list","See","below","for","use","cases",".","Returns","--","--","--","-","epochs",":","instance","of","Epochs","See","below","for","use","cases",".","Notes","--","--","-","Epochs","can","be","accessed","as","``","epochs","[","...","]","``","in","several","ways",":","1",".","*","*","Integer","or","slice",":","*","*","``","epochs","[","idx","]","``","will","return","an","`","~mne.Epochs","`","object","with","a","subset","of","epochs","chosen","by","index","(","supports","single","index","and","Python-style","slicing",")",".","2",".","*","*","String",":","*","*","``","epochs","[","'name","'","]","``","will","return","an","`","~mne.Epochs","`","object","comprising","only","the","epochs","labeled","``","'name","'","``","(","i.e.",",","epochs","created","around","events","with","the","label","``","'name","'","``",")",".","If","there","are","no","epochs","labeled","``","'name","'","``","but","there","are","epochs","labeled","with","\/-separated","tags","(","e.g",".","``","'name\/left","'","``",",","``","'name\/right","'","``",")",",","then","``","epochs","[","'name","'","]","``","will","select","the","epochs","with","labels","that","contain","that","tag","(","e.g.",",","``","epochs","[","'left","'","]","``","selects","epochs","labeled","``","'audio\/left","'","``","and","``","'visual\/left","'","``",",","but","not","``","'audio_left","'","``",")",".","If","multiple","tags","are","provided","*","as","a","single","string","*","(","e.g.",",","``","epochs","[","'name_1\/name_2","'","]","``",")",",","this","selects","epochs","containing","*","all","*","provided","tags",".","For","example",",","``","epochs","[","'audio\/left","'","]","``","selects","``","'audio\/left","'","``","and","``","'audio\/quiet\/left","'","``",",","but","not","``","'audio\/right","'","``",".","Note","that","tag-based","selection","is","insensitive","to","order",":","tags","like","``","'audio\/left","'","``","and","``","'left\/audio","'","``","will","be","treated","the","same","way","when","selecting","via","tag",".","3",".","*","*","List","of","strings",":","*","*","``","epochs","[","[","'name_1","'",",","'name_2","'",",","...","]","]","``","will","return","an","`","~mne.Epochs","`","object","comprising","epochs","that","match","*","any","*","of","the","provided","names","(","i.e.",",","the","list","of","names","is","treated","as","an","inclusive-or","condition",")",".","If","*","none","*","of","the","provided","names","match","any","epoch","labels",",","a","``","KeyError","``","will","be","raised",".","If","epoch","labels","are","\/-separated","tags",",","then","providing","multiple","tags","*","as","separate","list","entries","*","will","likewise","act","as","an","inclusive-or","filter",".","For","example",",","``","epochs","[","[","'audio","'",",","'left","'","]","]","``","would","select","``","'audio\/left","'","``",",","``","'audio\/right","'","``",",","and","``","'visual\/left","'","``",",","but","not","``","'visual\/right","'","``",".","4",".","*","*","Pandas","query",":","*","*","``","epochs","[","'pandas","query","'","]","``","will","return","an","`","~mne.Epochs","`","object","with","a","subset","of","epochs","(","and","matching","metadata",")","selected","by","the","query","called","with","``","self.metadata.eval","``",",","e.g",".",":",":","epochs","[","``","col_a",">","2","and","col_b","==","'foo","'","''","]","would","return","all","epochs","whose","associated","``","col_a","``","metadata","was","greater","than","two",",","and","whose","``","col_b","``","metadata","was","the","string","'foo","'",".","Query-based","indexing","only","works","if","Pandas","is","installed","and","``","self.metadata","``","is","a",":","class",":","`","pandas.DataFrame","`",".","..","versionadded",":",":","0.16"]
code: def __getitem__(self, item):
      """Return an Epochs object with a copied subset of epochs.
  
      Parameters
      ----------
      item : slice, array-like, str, or list
          See below for use cases.
  
      Returns
      -------
      epochs : instance of Epochs
          See below for use cases.
  
      Notes
      -----
      Epochs can be accessed as ``epochs[...]`` in several ways:
  
      1. **Integer or slice:** ``epochs[idx]`` will return an `~mne.Epochs`
         object with a subset of epochs chosen by index (supports single
         index and Python-style slicing).
  
      2. **String:** ``epochs['name']`` will return an `~mne.Epochs` object
         comprising only the epochs labeled ``'name'`` (i.e., epochs created
         around events with the label ``'name'``).
  
         If there are no epochs labeled ``'name'`` but there are epochs
         labeled with /-separated tags (e.g. ``'name/left'``,
         ``'name/right'``), then ``epochs['name']`` will select the epochs
         with labels that contain that tag (e.g., ``epochs['left']`` selects
         epochs labeled ``'audio/left'`` and ``'visual/left'``, but not
         ``'audio_left'``).
  
         If multiple tags are provided *as a single string* (e.g.,
         ``epochs['name_1/name_2']``), this selects epochs containing *all*
         provided tags. For example, ``epochs['audio/left']`` selects
         ``'audio/left'`` and ``'audio/quiet/left'``, but not
         ``'audio/right'``. Note that tag-based selection is insensitive to
         order: tags like ``'audio/left'`` and ``'left/audio'`` will be
         treated the same way when selecting via tag.
  
      3. **List of strings:** ``epochs[['name_1', 'name_2', ... ]]`` will
         return an `~mne.Epochs` object comprising epochs that match *any* of
         the provided names (i.e., the list of names is treated as an
         inclusive-or condition). If *none* of the provided names match any
         epoch labels, a ``KeyError`` will be raised.
  
         If epoch labels are /-separated tags, then providing multiple tags
         *as separate list entries* will likewise act as an inclusive-or
         filter. For example, ``epochs[['audio', 'left']]`` would select
         ``'audio/left'``, ``'audio/right'``, and ``'visual/left'``, but not
         ``'visual/right'``.
  
      4. **Pandas query:** ``epochs['pandas query']`` will return an
         `~mne.Epochs` object with a subset of epochs (and matching
         metadata) selected by the query called with
         ``self.metadata.eval``, e.g.::
  
             epochs["col_a > 2 and col_b == 'foo'"]
  
         would return all epochs whose associated ``col_a`` metadata was
         greater than two, and whose ``col_b`` metadata was the string 'foo'.
         Query-based indexing only works if Pandas is installed and
         ``self.metadata`` is a :class:`pandas.DataFrame`.
  
         .. versionadded:: 0.16
      """
      return self._getitem(item)
  
imports: import json
  import logging
  from collections import OrderedDict
  from copy import deepcopy
  import numpy
  from ._logging import verbose, warn
  from .check import _check_pandas_installed, _check_preload, _validate_type
  from .numerics import _time_mask, object_hash, object_size
label_desc: Use image node_id 1 for calling the GetEpochsMixin obj's underlying member method code with example usage: obj.__getitem__(item) and returns: self