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