code: def translate(cls, val):
          
          if val is None:
              return cls.translate_none(val)
          elif isinstance(val, string_types):
              return cls.translate_str(val)
          # Needs to be before integer checks
          elif isinstance(val, bool):
              return cls.translate_bool(val)
          elif isinstance(val, integer_types):
              return cls.translate_int(val)
          elif isinstance(val, float):
              return cls.translate_float(val)
          elif isinstance(val, dict):
              return cls.translate_dict(val)
          elif isinstance(val, list):
              return cls.translate_list(val)
          # Use this generic translation as a last resort
          return cls.translate_escaped_str(val)
docs: Translate each of the standard json/yaml types to appropiate objects.