class_docstr: This class represents a SageMaker trial component object.
  
  A trial component is a stage in a trial.
  Trial components are created automatically within the SageMaker runtime and
  may not be created directly. To automatically associate trial components with
  a trial and experiment, supply an experiment config when creating a job.
  For example: https://docs.aws.amazon.com/sagemaker/latest/dg/API_CreateTrainingJob.html
  
  Attributes:
      trial_component_name (str): The name of the trial component. Generated by SageMaker
          from the name of the source job with a suffix specific to the type of source job.
      trial_component_arn (str): The ARN of the trial component.
      display_name (str): The name of the trial component that will appear in UI,
          such as SageMaker Studio.
      source (TrialComponentSource): A TrialComponentSource object with a source_arn attribute.
      status (str): Status of the source job.
      start_time (datetime): When the source job started.
      end_time (datetime): When the source job ended.
      creation_time (datetime): When the source job was created.
      created_by (obj): Contextual info on which account created the trial component.
      last_modified_time (datetime): When the trial component was last modified.
      last_modified_by (obj): Contextual info on which account last modified the trial component.
      parameters (dict): Dictionary of parameters to the source job.
      input_artifacts (dict): Dictionary of input artifacts.
      output_artifacts (dict): Dictionary of output artifacts.
      metrics (obj): Aggregated metrics for the job.
      parameters_to_remove (list): The hyperparameters to remove from the component.
      input_artifacts_to_remove (list): The input artifacts to remove from the component.
      output_artifacts_to_remove (list): The output artifacts to remove from the component.
      tags (List[Dict[str, str]]): A list of tags to associate with the trial component.
class_docstr_tok: ["This","class","represents","a","SageMaker","trial","component","object",".","A","trial","component","is","a","stage","in","a","trial",".","Trial","components","are","created","automatically","within","the","SageMaker","runtime","and","may","not","be","created","directly",".","To","automatically","associate","trial","components","with","a","trial","and","experiment",",","supply","an","experiment","config","when","creating","a","job",".","For","example",":","https",":","\/\/docs.aws.amazon.com\/sagemaker\/latest\/dg\/API_CreateTrainingJob.html","Attributes",":","trial_component_name","(","str",")",":","The","name","of","the","trial","component",".","Generated","by","SageMaker","from","the","name","of","the","source","job","with","a","suffix","specific","to","the","type","of","source","job",".","trial_component_arn","(","str",")",":","The","ARN","of","the","trial","component",".","display_name","(","str",")",":","The","name","of","the","trial","component","that","will","appear","in","UI",",","such","as","SageMaker","Studio",".","source","(","TrialComponentSource",")",":","A","TrialComponentSource","object","with","a","source_arn","attribute",".","status","(","str",")",":","Status","of","the","source","job",".","start_time","(","datetime",")",":","When","the","source","job","started",".","end_time","(","datetime",")",":","When","the","source","job","ended",".","creation_time","(","datetime",")",":","When","the","source","job","was","created",".","created_by","(","obj",")",":","Contextual","info","on","which","account","created","the","trial","component",".","last_modified_time","(","datetime",")",":","When","the","trial","component","was","last","modified",".","last_modified_by","(","obj",")",":","Contextual","info","on","which","account","last","modified","the","trial","component",".","parameters","(","dict",")",":","Dictionary","of","parameters","to","the","source","job",".","input_artifacts","(","dict",")",":","Dictionary","of","input","artifacts",".","output_artifacts","(","dict",")",":","Dictionary","of","output","artifacts",".","metrics","(","obj",")",":","Aggregated","metrics","for","the","job",".","parameters_to_remove","(","list",")",":","The","hyperparameters","to","remove","from","the","component",".","input_artifacts_to_remove","(","list",")",":","The","input","artifacts","to","remove","from","the","component",".","output_artifacts_to_remove","(","list",")",":","The","output","artifacts","to","remove","from","the","component",".","tags","(","List","[","Dict","[","str",",","str","]","]",")",":","A","list","of","tags","to","associate","with","the","trial","component","."]
docstr: Delete this TrialComponent from SageMaker.
  
  Args:
      force_disassociate (boolean): Indicates whether to force disassociate the
          trial component with the trials before deletion (default: False).
          If set to true, force disassociate the trial component with associated trials
          first, then delete the trial component.
          If it's not set or set to false, it will delete the trial component directory
          without disassociation.
  
    Returns:
      dict: Delete trial component response.
docstr_tok: ["Delete","this","TrialComponent","from","SageMaker",".","Args",":","force_disassociate","(","boolean",")",":","Indicates","whether","to","force","disassociate","the","trial","component","with","the","trials","before","deletion","(","default",":","False",")",".","If","set","to","true",",","force","disassociate","the","trial","component","with","associated","trials","first",",","then","delete","the","trial","component",".","If","it","'s","not","set","or","set","to","false",",","it","will","delete","the","trial","component","directory","without","disassociation",".","Returns",":","dict",":","Delete","trial","component","response","."]
code: def delete(self, force_disassociate=False):
      """Delete this TrialComponent from SageMaker.
  
      Args:
          force_disassociate (boolean): Indicates whether to force disassociate the
              trial component with the trials before deletion (default: False).
              If set to true, force disassociate the trial component with associated trials
              first, then delete the trial component.
              If it's not set or set to false, it will delete the trial component directory
              without disassociation.
  
        Returns:
          dict: Delete trial component response.
      """
      if force_disassociate:
          next_token = None
  
          while True:
              if next_token:
                  list_trials_response = self.sagemaker_session.sagemaker_client.list_trials(
                      TrialComponentName=self.trial_component_name,
                      NextToken=next_token,
                  )
              else:
                  list_trials_response = self.sagemaker_session.sagemaker_client.list_trials(
                      TrialComponentName=self.trial_component_name
                  )
  
              # Disassociate the trials and trial components
              for per_trial in list_trials_response["TrialSummaries"]:
                  # to prevent DisassociateTrialComponent throttling
                  time.sleep(1.2)
                  self.sagemaker_session.sagemaker_client.disassociate_trial_component(
                      TrialName=per_trial["TrialName"],
                      TrialComponentName=self.trial_component_name,
                  )
  
              if "NextToken" in list_trials_response:
                  next_token = list_trials_response["NextToken"]
              else:
                  break
  
      return self._invoke_api(
          self._boto_delete_method, self._boto_delete_members
      )
  
file_path: sagemaker-python-sdk/src/sagemaker/experiments/trial_component.py
imports: from __future__ import absolute_import
  import time
  from botocore.exceptions import ClientError
  from sagemaker.apiutils import _base_types
  from sagemaker.experiments import _api_types
  from sagemaker.experiments._api_types import TrialComponentSearchResult
  from sagemaker.utils import format_tags
label_desc: Use image node_id 4 for calling the _TrialComponent obj's underlying member method code with example usage: obj.delete(force_disassociate) and returns: self