def queue(self, task=None, tasks=None, retry=None, **kwargs):
        tasks_data = []
        if task is None:
            task = Task(**kwargs)
        if tasks is None:
            tasks = [task]
        for task in tasks:
            payload = task.payload
            if (3,) >= sys.version_info:
                if not isinstance(payload, str):
                    payload = json.dumps(payload)
            else:
                if not isinstance(payload, basestring):
                    payload = json.dumps(payload)
            if task.code_name is None:
                raise ValueError("task.code_name is required.")
            task_data = {
                    "name": task.code_name,
                    "code_name": task.code_name,
                    "payload": payload,
                    "priority": task.priority,
                    "delay": task.delay,
                    "label": task.label,
                    "cluster": task.cluster
            }
            if not task.scheduled:
                type_str = "tasks"
                task_data["timeout"] = task.timeout
            else:
                type_str = "schedules"
                if task.run_every is not None:
                    task_data["run_every"] = task.run_every
                if task.end_at is not None:
                    if task.end_at.tzinfo is None:
                        task.end_at = task.end_at.replace(tzinfo=tzlocal())
                    task_data["end_at"] = iron_core.IronClient.toRfc3339(
                            task.end_at)
                if task.run_times is not None:
                    task_data["run_times"] = task.run_times
                if task.start_at is not None:
                    if task.start_at.tzinfo is None:
                        task.start_at = task.start_at.replace(tzinfo=tzlocal())
                    task_data["start_at"] = iron_core.IronClient.toRfc3339(
                            task.start_at)
                if task.timeout is not None:
                    task_data["timeout"] = task.timeout
                task_data["label"] = task.label
                task_data["cluster"] = task.cluster
            tasks_data.append(task_data)
        data = json.dumps({type_str: tasks_data})
        headers = {"Content-Type": "application/json"}

        if retry is not None:
            resp = self.client.post(type_str, body=data, headers=headers, retry=retry)
        else:
            resp = self.client.post(type_str, body=data, headers=headers)
        tasks = resp["body"]
        if len(tasks[type_str]) > 1:
            return [Task(task, scheduled=(type_str == "schedules"))
                    for task in tasks[type_str]]
        else:
            return Task(tasks[type_str][0],
                        scheduled=(type_str == "schedules"))
dataset/ETHPy150Open iron-io/iron_worker_python/iron_worker.py/IronWorker.queue/swapped operands of `>=`