code: def callback_parent(attr, old, new):
      '''Update data directories drop down with new parent directory'''
      import os
  
      # Remove accidental white space if copy/pasted
      new = new.strip()
      parent_input.value = new
  
      # Verify new parent path exists and update `datadirs_select` widget
      if os.path.exists(new):
          # Create sorted list of data directories, ignore files
          joinisdir = lambda parent, d: os.path.isdir(os.path.join(parent, d))
          options = sorted([d for d in os.listdir(new) if joinisdir(new, d)])
  
          # Update dropdown list of available data directories and select first
          datadirs_select.options = options
          datadirs_select.value = options[0]
          callback_datadirs('value', options[0], options[0])
  
      else:
          msg = '''
                The parent path `{}` does not exist.
  
                Check that you have entered the absolute path.
                '''.format(new)
          output_window.text = output_template.format(msg)
  
      return Nonf callback_parent(attr, old, new):
      '''Update data directories drop down with new parent directory'''
      import os
  
      # Remove accidental white space if copy/pasted
      new = new.strip()
      parent_input.value = new
  
      # Verify new parent path exists and update `datadirs_select` widget
      if os.path.exists(new):
          # Create sorted list of data directories, ignore files
          joinisdir = lambda parent, d: os.path.isdir(os.path.join(parent, d))
          options = sorted([d for d in os.listdir(new) if joinisdir(new, d)])
  
          # Update dropdown list of available data directories and select first
          datadirs_select.options = options
          datadirs_select.value = options[0]
          callback_datadirs('value', options[0], options[0])
  
      else:
          msg = '''
                The parent path `{}` does not exist.
  
                Check that you have entered the absolute path.
                '''.format(new)
          output_window.text = output_template.format(msg)
  
      return None
docs: Update data directories drop down with new parent directory