class_docstr: Determines the top level domain of a url.
  
  Description:
      Extract the top level domain of a url, using regex,
      and a list of common top level domains. Returns nan if
      the url is invalid or null.
      Common top level domains were pulled from this list:
      https://www.hayksaakian.com/most-popular-tlds/
  
  Examples:
      >>> url_to_tld = URLToTLD()
      >>> urls = ['https://www.google.com', 'http://www.google.co.in',
      ...         'www.facebook.com']
      >>> url_to_tld(urls).to_list()
      ['com', 'in', 'com']
code: def get_function(self):
      self.tlds_pattern = r"(?:\.({}))".format("|".join(COMMON_TLDS))
  
      def url_to_domain(x):
          p = r"^(?:https?:\/\/)?(?:[^@\/\n]+@)?(?:www\.)?([^:\/?\n]+)"
          return x.str.extract(p, expand=False)
  
      def url_to_tld(x):
          domains = url_to_domain(x)
          df = domains.str.extractall(self.tlds_pattern)
          matches = df.groupby(level=0).last()[0]
          return matches.reindex(x.index)
  
      return url_to_tld
  
imports: from woodwork.column_schema import ColumnSchema
  from woodwork.logical_types import URL, Categorical
  from featuretools.primitives.base import TransformPrimitive
  from featuretools.utils.common_tld_utils import COMMON_TLDS
label_desc: Use image node_id 1 for calling the URLToTLD obj's underlying member method code with example usage: obj.get_function() and returns: url_to_tld, x, matches