code: def get_layer_by_name(self, name):
          
          try:
              return self.layernames[name]
          except KeyError:
              msg = 'Layer "{0}" not found.'
              logger.debug(msg.format(name))
              raise ValueError
docs: Return a layer by name
  
          :param name: Name of layer.  Case-sensitive.
          :rtype: Layer object if found, otherwise ValueError