code: def string_to_date(value):
      
      if isinstance(value, datetime.date):
          return value
  
      return dateutil.parser.parse(value).date()
docs: Return a Python date that corresponds to the specified string
      representation.
  
      @param value: string representation of a date.
  
      @return: an instance ``datetime.datetime`` represented by the string.