class_docstr: Utility class for quick manipulation of a connector pipeline.
class_docstr_tok: ["Utility","class","for","quick","manipulation","of","a","connector","pipeline","."]
docstr: Returns a list of connectors that fit 'key'.
  
  If key is a number n, we return a list with the nth element of this pipeline.
  If key is a Connector class or a string matching the class name of a
  Connector class, we return a list of all connectors in this pipeline matching
  the specified class.
  
  Args:
      key: The key to index by
  
  Returns: The Connector at index `key`.
docstr_tok: ["Returns","a","list","of","connectors","that","fit","'key","'",".","If","key","is","a","number","n",",","we","return","a","list","with","the","nth","element","of","this","pipeline",".","If","key","is","a","Connector","class","or","a","string","matching","the","class","name","of","a","Connector","class",",","we","return","a","list","of","all","connectors","in","this","pipeline","matching","the","specified","class",".","Args",":","key",":","The","key","to","index","by","Returns",":","The","Connector","at","index","`","key","`","."]
code: def __getitem__(self, key: Union[str, int, type]):
      """Returns a list of connectors that fit 'key'.
  
      If key is a number n, we return a list with the nth element of this pipeline.
      If key is a Connector class or a string matching the class name of a
      Connector class, we return a list of all connectors in this pipeline matching
      the specified class.
  
      Args:
          key: The key to index by
  
      Returns: The Connector at index `key`.
      """
      # In case key is a class
      if not isinstance(key, str):
          if isinstance(key, slice):
              raise NotImplementedError(
                  "Slicing of ConnectorPipeline is currently not supported."
              )
          elif isinstance(key, int):
              return [self.connectors[key]]
          elif isinstance(key, type):
              results = []
              for c in self.connectors:
                  if issubclass(c.__class__, key):
                      results.append(c)
              return results
          else:
              raise NotImplementedError(
                  "Indexing by {} is currently not supported.".format(
                      type(key)
                  )
              )
  
      results = []
      for c in self.connectors:
          if c.__class__.__name__ == key:
              results.append(c)
  
      return results
  
imports: import abc
  import logging
  from typing import TYPE_CHECKING, Any, Dict, List, Tuple, Union
  import gymnasium
  from ray.rllib.policy.view_requirement import ViewRequirement
  from ray.rllib.utils.typing import ActionConnectorDataType, AgentConnectorDataType, AlgorithmConfigDict, TensorType
  from ray.util.annotations import PublicAPI
label_desc: Use image node_id 10 for calling the ConnectorPipeline obj's underlying member method code with example usage: obj.__getitem__(key) and returns: results, list, results