class_docstr: Utility static functions to handle model directories.
class_docstr_tok: ["Utility","static","functions","to","handle","model","directories","."]
docstr: Returns the model directory.
  
  Args:
    trial: model_search.metadata.trial.Trial
  
  Returns:
    model directory (string).
docstr_tok: ["Returns","the","model","directory",".","Args",":","trial",":","model_search.metadata.trial.Trial","Returns",":","model","directory","(","string",")","."]
code: def trial_dir(trial):
      """Returns the model directory.
  
      Args:
        trial: model_search.metadata.trial.Trial
  
      Returns:
        model directory (string).
      """
      if getattr(trial, "model_dir", None) is not None:
          return trial.model_dir
  
imports: import collections
  import os
  import string
  import time
  from absl import flags
  from absl import logging
  from model_search import block
  from model_search import block_builder
  from model_search import hparam
  from model_search import utils
  from model_search.proto import hparam_pb2
  from model_search.proto import phoenix_spec_pb2
  from model_search.proto import transfer_learning_spec_pb2
  import numpy
  import tensorflow.compat.v2
  import tf_slim
  from google.protobuf import text_format
label_desc: Use image node_id 2 for calling the DirectoryHandler obj's underlying member method code with example usage: obj.trial_dir(trial) and returns: trial