Usage: mmToJson( '../data/myGTD.mm', true );
344516
function mmToJson( inFileName, printToConsole ) {
    var mm = fs.readFileSync( inFileName, encoding='utf8' );
    var json = xm.load(mm);
    if( printToConsole ) {
        console.log( JSON.stringify( json, null, '    ' ) );
    }
    return json;
}
504593
protected void jSONSuccess(PMStrutsContext ctx, Object object) throws PMForwardException {
        final String toJson = new Gson().toJson(object);
        ctx.put(PM_VOID_TEXT, toJson);
        success(ctx, "converters/void.jsp", false);
    }
524221
def _msToString(self, ms):
        """"""
        hr, ms = divmod(ms, 3600000)
        mins, ms = divmod(ms, 60000)
        secs, mill = divmod(ms, 1000)
        return "%ihr %imin %isecs %ims" % (hr, mins, secs, mill)
1177090
def _timestamp_to_json_parameter(value):
    
    if isinstance(value, datetime.datetime):
        if value.tzinfo not in (None, UTC):
            # Convert to UTC and remove the time zone info.
            value = value.replace(tzinfo=None) - value.utcoffset()
        value = "%s %s+00:00" % (value.date().isoformat(), value.time().isoformat())
    return value
385131
def _timestamp_to_json_row(value):
    
    if isinstance(value, datetime.datetime):
        value = _microseconds_from_datetime(value) * 1e-6
    return value
496752
def _time_to_json(value):
    """"""
    if isinstance(value, datetime.time):
        value = value.isoformat()
    return value
586905
public static String toPrettyJson(Object object, FieldModifier modifier) throws IllegalAccessException {
        return Formatter.formatJson(toJsonString(object, modifier));
    }
1025549
function encodeFileToJson(file) {
    var filePath = file.getPath();
    if (!filePath) {
        return undefined;
    }

    return {
        path: filePath,
        mtime: file.getMTime(),
        type: file.getType()
    };
}
202921
@Override
    public String sendMMS(String CorpNum, String sender, String senderName,
                          String subject, String content, Message[] Messages, File file,
                          Date reserveDT, Boolean adsYN, String UserID, String requestNum)
            throws PopbillException {
        if (Messages == null || Messages.length == 0)
            throw new PopbillException(-99999999, "전송할 메시지가 입력되지 않았습니다.");

        SendRequest request = new SendRequest();
        request.snd = sender;

        request.content = content;
        request.subject = subject;

        if (senderName != null)
            request.sndnm = senderName;

        if (adsYN) {
            request.adsYN = true;
        } else {
            request.adsYN = false;
        }

        if (reserveDT != null)
            request.sndDT = new SimpleDateFormat("yyyyMMddHHmmss", Locale.KOREA)
                    .format(reserveDT);

        request.msgs = Messages;

        if (requestNum != null)
            request.requestNum = requestNum;

        String PostData = toJsonString(request);

        List<UploadFile> uploadFiles = new ArrayList<UploadFile>();

        UploadFile uf = new UploadFile();
        uf.fieldName = "file";
        uf.fileName = file.getName();
        try {
            uf.fileData = new FileInputStream(file);
        } catch (FileNotFoundException e) {
            throw new PopbillException(-99999999, "전송할 파일을 찾을 수 없습니다.", e);
        }
        uploadFiles.add(uf);

        ReceiptResponse response = httppostFiles("/MMS", CorpNum,
                PostData, uploadFiles, UserID, ReceiptResponse.class);

        return response.receiptNum;
    }
1212090
function attrToJson(v, objectType) {

        var colValue;

        switch (objectType) {
            case "Text":
                colValue = v;
                break;
            case "DateTime":
            case "datetime": // For calculated columns, stored as datetime;#value
                // Dates have dashes instead of slashes: ows_Created="2009-08-25 14:24:48"
                colValue = dateToJsonObject(v);
                break;
            case "User":
                colValue = userToJsonObject(v);
                break;
            case "UserMulti":
                colValue = userMultiToJsonObject(v);
                break;
            case "Lookup":
                colValue = lookupToJsonObject(v);
                break;
            case "LookupMulti":
                colValue = lookupMultiToJsonObject(v);
                break;
            case "Boolean":
                colValue = booleanToJsonObject(v);
                break;
            case "Integer":
                colValue = intToJsonObject(v);
                break;
            case "Counter":
                colValue = intToJsonObject(v);
                break;
            case "MultiChoice":
                colValue = choiceMultiToJsonObject(v);
                break;
            case "Number":
            case "Currency":
            case "float": // For calculated columns, stored as float;#value
                colValue = floatToJsonObject(v);
                break;
            case "Calculated":
                colValue = calcToJsonObject(v);
                break;
            case "Attachments":
                colValue = attachmentsToJsonObject(v);
                break;
            case "URL":
                colValue = urlToJsonObject(v);
                break;
            case "JSON":
                colValue = jsonToJsonObject(v); // Special case for text JSON stored in text columns
                break;
            default:
                // All other objectTypes will be simple strings
                colValue = v;
                break;
        }
        return colValue;
    }
162989
def formatetfindexjson(fundbjson):
        """"""
        result = {}
        for row in fundbjson["rows"]:
            cell = row["cell"]
            fundb_id = cell["fund_id"]
            result[fundb_id] = cell
        return result
411186
function toUTCDateString(arg) {
    var d = dateify(arg);
    var date = new Date(d.getTime() + d.getTimezoneOffset() * 60 * 1000);

    var _destructure3 = destructure(date);

    var _destructure4 = _slicedToArray(_destructure3, 6);

    var yr = _destructure4[0];
    var mn = _destructure4[1];
    var dy = _destructure4[2];
    var hr = _destructure4[3];
    var min = _destructure4[4];
    var sec = _destructure4[5];

    return yr + '-' + _padInt(mn + 1) + '-' + _padInt(dy) + ('T' + _padInt(hr) + ':' + _padInt(min) + ':' + _padInt(sec) + 'Z');
  }
1225001
def _date_to_json(value):
    """"""
    if isinstance(value, datetime.date):
        value = value.isoformat()
    return value
895885
function getIso8601String(timeMs) {
  var time = new Date();
  time.setTime(timeMs);
  return '' +
      time.getUTCFullYear() + '-' +
      leftPadNumber(time.getUTCMonth() + 1, 2, '0') + '-' +
      leftPadNumber(time.getUTCDate(), 2, '0') + 'T' +
      leftPadNumber(time.getUTCHours(), 2, '0') + ':' +
      leftPadNumber(time.getUTCMinutes(), 2, '0') + ':' +
      leftPadNumber(time.getUTCSeconds(), 2, '0') + 'Z';
}
1065602
def _datetime_to_json(value):
    """"""
    if isinstance(value, datetime.datetime):
        value = value.strftime(_RFC3339_MICROS_NO_ZULU)
    return value
1101782
def to_json(self):
        """"""
        return {
            'tpm': self.tpm,
            'cm': self.cm,
            'size': self.size,
            'node_labels': self.node_labels
        }
1353086
def date_json(self):
        
        if self.date:
            return json.dumps(self.date.isoformat(), ensure_ascii=False)