def _encode_value(self, value):

        if isinstance(value, str):
            ret = '"' + value + '"'
        elif isinstance(value, float):
            ret = str(value) + 'f'

        elif sys.version_info[0] >= 3 and isinstance(value, int):
            if value > 2147483647:
                ret = str(value) + 'l'
            else:
                ret = str(value)

        elif sys.version_info[0] < 3 and isinstance(value, long):
            ret = str(value) + 'l'
        elif isinstance(value, int):
            ret = str(value)

        elif isinstance(value, datetime):
            ret = str(int(time.mktime(value.timetuple())) * 1000) + 't'
        elif isinstance(value, date):
            ret = str(int(time.mktime(value.timetuple())) * 1000) + 'a'
        elif isinstance(value, Decimal):
            ret = str(value) + 'c'
        elif isinstance(value, list):
            try:
                ret = "[" + ','.join(
                    map(
                        lambda elem: self._parse_value(type(value[0])(elem))
                        if not isinstance(value[0], OrientRecordLink)
                        else elem.get_hash(),
                        value
                    )) + ']'
            except __HOLE__ as e:
                raise Exception("wrong type commistion")
        elif isinstance(value, dict):
            ret = "{" + ','.join(map(
                lambda elem: '"' + elem + '":' + self._parse_value(value[elem]),
                value)) + '}'
        elif isinstance(value, OrientRecord):
            ret = "(" + self.__encode(value) + ")"
        elif isinstance(value, OrientRecordLink):
            ret = value.get_hash()
        elif isinstance(value, OrientBinaryObject):
            ret = value.get_hash()
        else:
            ret = ''
        return ret

    #
    # DECODING STUFF
    #

    # Consume the first field key, which could be a class name.
    # :param content str The input to consume
    # :return: list The collected string and any remaining content,
    # followed by a boolean indicating whether this is a class name.
dataset/ETHPy150Open mogui/pyorient/pyorient/serializations.py/OrientSerializationCSV._encode_value