code: def connection(cls):
          
          local = cls._threadlocal
          if not getattr(local, 'connection', None):
              # Make sure these variables are no longer affected by other threads.
              local.user = cls.user
              local.password = cls.password
              local.site = cls.site
              local.timeout = cls.timeout
              local.headers = cls.headers
              local.format = cls.format
              local.version = cls.version
              local.url = cls.url
              if cls.site is None:
                  raise ValueError("No shopify session is active")
              local.connection = ShopifyConnection(
                  cls.site, cls.user, cls.password, cls.timeout, cls.format)
          return local.connection
docs: HTTP connection for the current thread