code: def newLayer(self, name):
          
          layerName = name
          glyphName = self.name
          layerName = normalizers.normalizeLayerName(layerName)
          for glyph in self.layers:
              if glyph.layer.name == layerName:
                  layer = glyph.layer
                  layer.removeGlyph(glyphName)
                  break
          glyph = self._newLayer(name=layerName)
          layer = self.font.getLayer(layerName)
          # layer._setLayerInGlyph(glyph)
          return glyph
docs: Make a new layer with ``name`` in this glyph.
  
              >>> glyphLayer = glyph.newLayer("background")
  
          This will return the new :ref:`type-glyph-layer`.
          If the layer already exists in this glyph, it
          will be cleared.