code: def valid_date(date_string):
      r"""Determine whether or not the given string is a valid date.
  
      Parameters
      ----------
      date_string : str
          An alphanumeric string in the format %Y-%m-%d.
  
      Returns
      -------
      date_string : str
          The valid date string.
  
      Raises
      ------
      ValueError
          Not a valid date.
  
      Examples
      --------
  
      >>> valid_date('2016-7-1')   # datetime.datetime(2016, 7, 1, 0, 0)
      >>> valid_date('345')        # ValueError: Not a valid date
  
      """
      try:
          date_time = datetime.strptime(date_string, "%Y-%m-%d")
          return date_string
      except:
          message = "Not a valid date: '{0}'.".format(date_string)
          raise argparse.ArgumentTypeError(message)
  
file_path: AlphaPy/alphapy/utilities.py
imports: from alphapy.globals import PSEP, SSEP, USEP
  import argparse
  from datetime import datetime, timedelta
  import glob
  import inspect
  from itertools import groupby
  import logging
  import numpy
  import os
  from os import listdir
  from os.path import isfile, join
  import re
label_desc: Use image node_id 6 for calling a global function with example usage: valid_date(date_string) and returns: date_string