I ran the following code to reset the origin of Cube:
import bpy
# set selection
bpy.data.objects["Cube"].select = False
bpy.data.objects["Plane"].select = True
# override context
override = bpy.context.copy()
override["selected_bases"] = [bpy.data.scenes[0].object_bases["Cube"]]
override["active_base"] = bpy.data.scenes[0].object_bases["Cube"]
bpy.ops.object.origin_set(override) # works on Plane
bpy.ops.transform.translate(override, value=(1,1,1)) # works on Cube
However this resets the origin of the Plane instead. What am I doing wrong ?