code: def normalize_dir_url(dataset_url):
      if dataset_url is None or not isinstance(
          dataset_url, six.string_types
      ):
          raise ValueError("directory url must be a string")
  
      dataset_url = (
          dataset_url[:-1] if dataset_url[-1] == "/" else dataset_url
      )
      logger.debug("directory url: %s", dataset_url)
      return dataset_url
  
file_path: petastorm/petastorm/fs_utils.py
imports: import logging
  import fsspec
  import pyarrow
  import six
  from six.moves.urllib.parse import urlparse, urlunparse
  from fsspec.core import strip_protocol
  from fsspec.utils import update_storage_options
  from petastorm.hdfs.namenode import HdfsNamenodeResolver, HdfsConnector
label_desc: Use image node_id 3 for calling a global function with example usage: normalize_dir_url(dataset_url) and returns: dataset_url