code: def _takes_ascii(f):
      @wraps(f)
      def func(self, str_in, *args, **kwargs):
          # If it's a stream, read the whole thing
          str_in = getattr(str_in, "read", lambda: str_in)()
  
          # If it's unicode, turn it into bytes, since ISO-8601 only covers ASCII
          if isinstance(str_in, six.text_type):
              # ASCII is the same in UTF-8
              try:
                  str_in = str_in.encode("ascii")
              except UnicodeEncodeError as e:
                  msg = "ISO-8601 strings should contain only ASCII characters"
                  six.raise_from(ValueError(msg), e)
  
          return f(self, str_in, *args, **kwargs)
  
      return func
  
file_path: catboost/contrib/python/python-dateutil/py3/dateutil/parser/isoparser.py
imports: from datetime import datetime, timedelta, time, date
  import calendar
  from dateutil import tz
  from functools import wraps
  import re
  import six
label_desc: Use image node_id 1 for calling a global function with example usage: _takes_ascii(f) and returns: func, f