code: def _canonical_hsdir(hsdir):
      
      if not isabs(hsdir):
          abs_hsdir = abspath(hsdir)
          warnings.warn(
              "Onions service directory ({}) is relative and has"
              " been resolved to '{}'".format(hsdir, abs_hsdir)
          )
          hsdir = abs_hsdir
      return hsdir
docs: Internal helper.
  
      :return: the absolute path for 'hsdir' (and issue a warning)
          issuing a warning) if it was relative. Otherwise, returns the path
          unmodified.