code: def encode(self, o, depth=0):
          
          if isinstance(o, OrderedDict):
              return "{" + ",\n ".join([self.encode(k) + ":" +
                                        self.encode(v, depth + 1)
                                        for (k, v) in o.items()]) + "}\n"
          else:
              return simplejson.JSONEncoder.encode(self, o)
docs: encode the json object at given depth
          :param o: the object
          :param depth: the depth
          :return: the json encoding