in src/smexperiments/_environment.py [0:0]
def get_trial_component(self, sagemaker_boto_client):
"""Retrieves the trial component from the job in the environment.
Args:
sagemaker_boto_client (SageMaker.Client): SageMaker boto client.
Returns:
TrialComponent: The trial component created from the job. None if not found.
"""
start = time.time()
while time.time() - start < 300:
summaries = list(
trial_component.TrialComponent.list(
source_arn=self.source_arn, sagemaker_boto_client=sagemaker_boto_client
)
)
if summaries:
summary = summaries[0]
return trial_component.TrialComponent.load(
trial_component_name=summary.trial_component_name, sagemaker_boto_client=sagemaker_boto_client
)
else:
time.sleep(2)
return None