code: def _make_sequential_log_dir(log_dir):
      """Creates log_dir, appending a number if necessary.
  
      Attempts to create the directory `log_dir`. If it already exists, appends
      "_1". If that already exists, appends "_2" instead, etc.
  
      Args:
          log_dir (str): The log directory to attempt to create.
  
      Returns:
          str: The log directory actually created.
  
      """
      i = 0
      while True:
          try:
              if i == 0:
                  os.makedirs(log_dir)
              else:
                  possible_log_dir = "{}_{}".format(log_dir, i)
                  os.makedirs(possible_log_dir)
                  log_dir = possible_log_dir
              return log_dir
          except FileExistsError:
              i += 1
  
imports: import collections
  import datetime
  import enum
  import functools
  import gc
  import inspect
  import json
  import os
  import pathlib
  import subprocess
  import warnings
  import weakref
  import dateutil.tz
  import dowel
  from dowel import logger
  import numpy
  import __main__
label_desc: Use image node_id 1 for calling a global function with example usage: _make_sequential_log_dir(log_dir) and returns: log_dir