docs: def dynamic_import(modname, import_tuples, developing=True, ignore_froms=[],
                     dump=False, ignore_startswith=[], ignore_endswith=[],
                     ignore_list=[], check_not_imported=True, return_initstr=False,
                     verbose=False):
      """
      MAIN ENTRY POINT
  
      Dynamically import listed util libraries and their attributes.
      Create reload_subs function.
  
      Using __import__ like this is typically not considered good style However,
      it is better than import * and this will generate the good file text that
      can be used when the module is 'frozen"
  
      Returns:
          str: init_inject_str - by default all imports are executed in this
              function and only the remainig code needed to be executed is
              returned to define the reload logic.
  
          str, str: init_inject_str, init_str - if return_initstr is True then
              also returns init_str defining the from imports.
  
      Ignore:
          ignore_startswith = []
          ignore_endswith = []
          check_not_imported = True
          verbose = True
      """
      if verbose:
          print('[UTIL_IMPORT] Running Dynamic Imports for modname=%r ' % modname)
      # Get the module that will be imported into
      try:
          module = sys.modules[modname]
      except:
          module = __import__(modname)
      # List of modules to be imported
      imports = [tup[0] for tup in import_tuples]
      # Import the modules
      __excecute_imports(module, modname, imports, verbose=verbose)
      # If developing do explicit import stars
      if developing:
          from_imports = __execute_fromimport_star(module, modname, import_tuples,
                                                   ignore_list=ignore_list,
                                                   ignore_startswith=ignore_startswith,
                                                   ignore_endswith=ignore_endswith,
                                                   check_not_imported=check_not_imported,
                                                   verbose=verbose)
      else:
          from_imports = __execute_fromimport(module, modname, import_tuples, verbose=verbose)
  
      inject_execstr = _inject_execstr(modname, import_tuples)
  
      # If requested: print what the __init__ module should look like
      dump_requested = (('--dump-%s-init' % modname) in sys.argv or
                        ('--print-%s-init' % modname) in sys.argv) or dump
      overwrite_requested = ('--update-%s-init' % modname) in sys.argv
      if verbose:
          print('[UTIL_IMPORT] Finished Dynamic Imports for modname=%r ' % modname)
  
      if dump_requested:
          is_main_proc = multiprocessing.current_process().name == 'MainProcess'
          if is_main_proc:
              from utool import util_str
              initstr = _initstr(modname, imports, from_imports, inject_execstr)
              print(util_str.indent(initstr))
      # Overwrite the __init__.py file with new explicit imports
      if overwrite_requested:
          """
          SeeAlso:
              util_inject.inject_python_code
              util_str.replace_between_tags
          """
          is_main_proc = multiprocessing.current_process().name == 'MainProcess'
          if is_main_proc:
              from utool import util_str
              from os.path import join, exists
              initstr = _initstr(modname, imports, from_imports, inject_execstr, withheader=False)
              new_else = util_str.indent(initstr)
              #print(new_else)
              # Get path to init file so we can overwrite it
              init_fpath = join(module.__path__[0], '__init__.py')
              print('attempting to update: %r' % init_fpath)
              assert exists(init_fpath)
              new_lines = []
              editing = False
              updated = False
              #start_tag = '# <AUTOGEN_INIT>'
              #end_tag = '# </AUTOGEN_INIT>'
              with open(init_fpath, 'r') as file_:
                  #text = file_.read()
                  lines = file_.readlines()
                  for line in lines:
                      if not editing:
                          new_lines.append(line)
                      if line.strip().startswith('# <AUTOGEN_INIT>'):
                          new_lines.append('\n' + new_else + '\n    # </AUTOGEN_INIT>\n')
                          editing = True
                          updated = True
                      if line.strip().startswith('# </AUTOGEN_INIT>'):
                          editing = False
              # TODO:
              #new_text = util_str.replace_between_tags(text, new_else, start_tag, end_tag)
              if updated:
                  print('writing updated file: %r' % init_fpath)
                  new_text = ''.join(new_lines)
                  with open(init_fpath, 'w') as file_:
                      file_.write(new_text)
              else:
                  print('no write hook for file: %r' % init_fpath)
      if return_initstr:
          initstr = _initstr(modname, imports, from_imports, '', withheader=False)
          return inject_execstr, initstr
      else:
          return inject_execstr