class_docstr: Determines the protocol (http or https) of a url.
  
  Description:
      Extract the protocol of a url using regex.
      It will be either https or http. Returns nan if
      the url doesn't contain a protocol.
  
  Examples:
      >>> url_to_protocol = URLToProtocol()
      >>> urls =  ['https://play.google.com',
      ...          'http://www.google.co.in',
      ...          'www.facebook.com']
      >>> url_to_protocol(urls).to_list()
      ['https', 'http', nan]
class_docstr_tok: ["Determines","the","protocol","(","http","or","https",")","of","a","url",".","Description",":","Extract","the","protocol","of","a","url","using","regex",".","It","will","be","either","https","or","http",".","Returns","nan","if","the","url","does","n't","contain","a","protocol",".","Examples",":",">",">",">","url_to_protocol","=","URLToProtocol","(",")",">",">",">","urls","=","[","'https",":","\/\/play.google.com","'",",","...","'http",":","\/\/www.google.co.in","'",",","...","'www.facebook.com","'","]",">",">",">","url_to_protocol","(","urls",")",".to_list","(",")","[","'https","'",",","'http","'",",","nan","]"]
code: def get_function(self):
      def url_to_protocol(x):
          p = r"^(https|http)(?:\:)"
          return x.str.extract(p, expand=False)
  
      return url_to_protocol
  
imports: from woodwork.column_schema import ColumnSchema
  from woodwork.logical_types import URL, Categorical
  from featuretools.primitives.base import TransformPrimitive
label_desc: Use image node_id 1 for calling the URLToProtocol obj's underlying member method code with example usage: obj.get_function() and returns: url_to_protocol, x