code: def IsNameBased(link):
      
      if not link:
          return False
  
      # trimming the leading "/"
      if link.startswith('/') and len(link) > 1:
          link = link[1:]
  
      # Splitting the link(separated by "/") into parts 
      parts = link.split('/')
  
      # First part should be "dbs" 
      if len(parts) == 0 or not parts[0] or not parts[0].lower() == 'dbs':
          return False
  
      # The second part is the database id(ResourceID or Name) and cannot be empty
      if len(parts) < 2 or not parts[1]:
      	return False
  
      # Either ResourceID or database name
      databaseID = parts[1]
      	
      # Length of databaseID(in case of ResourceID) is always 8
      if len(databaseID) != 8:
          return True
  
      return not IsValidBase64String(str(databaseID))
docs: Finds whether the link is name based or not
  
      :param str link:
  
      :return:
          True if link is name-based; otherwise, False.
      :rtype: boolean