code: def _hashable_bytes(data):
      
      if isinstance(data, bytes):
          return data
      elif isinstance(data, str):
          return data.encode('ascii')  # Fail on anything non-ASCII.
      else:
          raise TypeError(data)
docs: Coerce strings to hashable bytes.