def add_trial_component()

in src/smexperiments/trial.py [0:0]


    def add_trial_component(self, tc):
        """Add the specified trial component to this ``Trial``.

        A trial component may belong to many trials and a trial may have many trial components.

        Args:
           tc (str or Tracker or TrialComponent or TrialComponentSummary): The trial component to
           add. Can be one of a Tracker instance, a TrialComponent instance, or a string containing
           the name of the trial component to add.
        """
        if isinstance(tc, tracker.Tracker):
            trial_component_name = tc.trial_component.trial_component_name
        elif isinstance(tc, trial_component.TrialComponent):
            trial_component_name = tc.trial_component_name
        elif isinstance(tc, api_types.TrialComponentSummary):
            trial_component_name = tc.trial_component_name
        else:
            trial_component_name = str(tc)
        self.sagemaker_boto_client.associate_trial_component(
            TrialName=self.trial_name, TrialComponentName=trial_component_name
        )