Finally, I found a way to do it. I am not sure it is a good way or not but it works so far.
The demo script is as follows.
from bpy import context
from math import sin, cos, radians
cursor = context.scene.cursor_location
radius = 10
anglesInRadians = [radians(degree) for degree in range(0,360,36)]
for theta in anglesInRadians: #add_elbow_joint()
bpy.ops.mesh.primitive_elbow_joint_add()
x = cursor.x + radiuscos(theta)
y = cursor.y + radiuscos(theta)
z = cursor.z
context.active_object.location.xyz = [x,y,z]
context.active_object.rotation_euler = [theta,0,0]