code: def reach(h):
      
      i = h.find(".")
      if i >= 0:
          #a = h[:i]  # this line is only here to show what a is
          b = h[i+1:]
          i = b.find(".")
          if is_HDN(h) and (i >= 0 or b == "local"):
              return "."+b
      return h
docs: Return reach of host h, as defined by RFC 2965, section 1.
  
      The reach R of a host name H is defined as follows:
  
         *  If
  
            -  H is the host domain name of a host; and,
  
            -  H has the form A.B; and
  
            -  A has no embedded (that is, interior) dots; and
  
            -  B has at least one embedded dot, or B is the string "local".
               then the reach of H is .B.
  
         *  Otherwise, the reach of H is H.
  
      >>> reach("www.acme.com")
      '.acme.com'
      >>> reach("acme.com")
      'acme.com'
      >>> reach("acme.local")
      '.local'