code: def put_subsegment(self, subsegment):
          
          entity = self.get_trace_entity()
          if not entity:
              log.warning("Active segment or subsegment not found. Discarded %s." % subsegment.name)
              return
  
          entity.add_subsegment(subsegment)
          self._local.entities.append(subsegment)
docs: Store the subsegment created by ``xray_recorder`` to the context.
          If you put a new subsegment while there is already an open subsegment,
          the new subsegment becomes the child of the existing subsegment.