code: def nb_name_from_path(config, path):
      
      if path is None:
          path = os.getcwd()
      root = config.get('root', 'path')
      root = os.path.join(path, root)
      root = os.path.realpath(root)
      default_nb_name = os.path.split(os.path.realpath(root))[1]
      nb_name = config.get('misc', 'nb-name', fallback=default_nb_name)
      return root, nb_name
docs: Get a notebook name from a path to a notebook