code: def stage_tc_associations(self, entity1, entity2):
          
          # resource 1
          entity1 = self.tcex.playbook.read(entity1)
          entity1_id = entity1.get('id')
          entity1_owner = entity1.get('ownerName')
          entity1_type = entity1.get('type')
          if entity1.get('type') in self.tcex.indicator_types:
              entity1_id = entity1.get('value')
  
          # resource 2
          entity2 = self.tcex.playbook.read(entity2)
          entity2_id = entity2.get('id')
          entity2_owner = entity1.get('ownerName')
          entity2_type = entity2.get('type')
          if entity2.get('type') in self.tcex.indicator_types:
              entity2_id = entity2.get('value')
  
          if entity1_owner != entity2_owner:
              self.log.error('[stage] Can not associate resource across owners.')
              return
  
          resource1 = self.tcex.resource(entity1_type)
          resource1.http_method = 'POST'
          resource1.owner = entity1_owner
          resource1.resource_id(entity1_id)
  
          resource2 = self.tcex.resource(entity2_type)
          resource2.resource_id(entity2_id)
  
          a_resource = resource1.associations(resource2)
          response = a_resource.request()
          if response.get('status') != 'Success':
              self.log.warning(
                  '[stage] Failed associating "{}:{}" with "{}:{}" ({}).'.format(
                      entity1_type,
                      entity1_id,
                      entity2_type,
                      entity2_id,
                      response.get('response').text,
                  )
              )
docs: Add an attribute to a resource.
  
          Args:
              entity1 (str): A Redis variable containing a TCEntity.
              entity2 (str): A Redis variable containing a TCEntity.