Can't assign a task to a user

can i assign a user a task where i am fetching the user value from somewhere else because i can’t figure out how to do it through python code?

kindly refer this code to assign a task
def assign():
from frappe.desk.form import assign_to

	"assign_to": [""],
	"doctype": task.doctype,
	"description": "Close this task",