def encode_instance(instance, local=True):
 if local:
  return dict(id=instance['id'], _is_precooked=False)
 else:
  inst = dict(instance)
  inst['_is_precooked'] = True
  return inst

def encode_instance ( instance , local = True ) : if local : return dict ( id = instance [ 'id' ] , _is_precooked = False ) else : inst = dict ( instance ) inst [ '_is_precooked' ] = True return inst
encode locally created instance for return via rpc .