parameters: (self, value)
docstring: Support dictionary, list, and slice -like access to the datasource.
          ds[0] would return the first layer on the datasource.
          ds['aname'] would return the layer named "aname".
          ds[0:4] would return a list of the first four layers.
docstring_summary: Support dictionary, list, and slice -like access to the datasource.
          ds[0] would return the first layer on the datasource.
          ds['aname'] would return the layer named "aname".
          ds[0:4] would return a list of the first four layers.
docstring_tokens: Support dictionary list and slice - like access to the datasource . ds [ 0 ] would return the first layer on the datasource . ds [ aname ] would return the layer named aname . ds [ 0 : 4 ] would return a list of the first four layers .
function: def __getitem__(self, value):
          """Support dictionary, list, and slice -like access to the datasource.
          ds[0] would return the first layer on the datasource.
          ds['aname'] would return the layer named "aname".
          ds[0:4] would return a list of the first four layers."""
          if isinstance(value, slice):
              output = []
              step = value.step if value.step else 1
              for i in range(value.start, value.stop, step):
                  lyr = self.GetLayer(i)
                  if lyr is None:
                      return output
                  output.append(lyr)
              return output
          if isinstance(value, int):
              if value > len(self) - 1:
                  raise IndexError
              return self.GetLayer(value)
          elif isinstance(value, str):
              return self.GetLayer(value)
          else:
              raise TypeError('Input %s is not of String or Int type' % type(value))
function_tokens: def __getitem__ ( self , value ) : if isinstance ( value , slice ) : output = [ ] step = value . step if value . step else 1 for i in range ( value . start , value . stop , step ) : lyr = self . GetLayer ( i ) if lyr is None : return output output . append ( lyr ) return output if isinstance ( value , int ) : if value > len ( self ) - 1 : raise IndexError return self . GetLayer ( value ) elif isinstance ( value , str ) : return self . GetLayer ( value ) else : raise TypeError ( 'Input %s is not of String or Int type' % type ( value ) )