docs: def getLayerName(url):
      """Extract the layer name from a url.
  
      Args:
          url (str): The url to parse.
  
      Returns:
          str: The layer name.
  
      Examples:
          >>> url = "http://services.arcgis.com/<random>/arcgis/rest/services/test/FeatureServer/12"
          >>> arcresthelper.common.getLayerIndex(url)
          'test'
  
      """
      urlInfo = None
      urlSplit = None
      try:
          urlInfo = urlparse.urlparse(url)
          urlSplit = str(urlInfo.path).split('/')
          name = urlSplit[len(urlSplit)-3]
          return name
      except:
          return url
  
      finally:
          urlInfo = None
          urlSplit = None
  
          del urlInfo
          del urlSplit
  
          gc.collect()