code: def user_domain_match(A, B):
      
      A = A.lower()
      B = B.lower()
      if not (liberal_is_HDN(A) and liberal_is_HDN(B)):
          if A == B:
              # equal IP addresses
              return True
          return False
      initial_dot = B.startswith(".")
      if initial_dot and A.endswith(B):
          return True
      if not initial_dot and A == B:
          return True
      return False
docs: For blocking/accepting domains.
  
      A and B may be host domain names or IP addresses.