def equal_object_(a, b):
  if type(a) == types.DictType and type(b) == types.DictType:
    if len(a.keys()) != len(b.keys()):
      return False
    for k, v in a.iteritems():
      if k not in b:
        return False
      if not equal_object_(v, b[k]):
        return False
    return True
  elif type(a) in [types.ListType, types.TupleType] and \
        type(b) in [types.ListType, types.TupleType]:
    if len(a) != len(b):
      return False
    ia = iter(a)
    ib = iter(b)
    try:
      while True:
        if not equal_object_(ia.next(), ib.next()):
          return False
    except:
      pass
    return True
  else:
    return a == b
dataset/ETHPy150Open IanLewis/kay/kay/ext/media_compressor/media_compiler.py/equal_object_/original