def encode(data):
    assert isinstance(data, dict)

    # Even though ordered is unspecified, we put the 
    # command/response/error keys in front to help with debugging
    def isnt_special(entry):
        return entry[0] not in ('command', 'response', 'error')

    ordered = OrderedDict(sorted(data.iteritems(), key=isnt_special))
    return json.dumps(ordered, separators=(',',':')) + '\n'
dataset/ETHPy150Open geky/pyDAPLink/pyDAPLink/utility/encoding.py/encode/original