Gets the subtask with the given ID
771002
def get_subtask(client, subtask_id):
    '''  '''
    endpoint = '/'.join([client.api.Endpoints.SUBTASKS, str(subtask_id)])
    response = client.authenticated_request(endpoint)
    return response.json()
963740
public Task getTask(int index) {
		final Lock readLock = lock.readLock();
		try {
			readLock.lock();
			return tasks.get(index);
		} finally {
			readLock.unlock();
		}
	}
1343795
private static TaskEntity getTask(final int taskId, final Collection<TaskEntity> tasks) {
    for (final TaskEntity task : tasks) {
      if (taskId == task.getId()) {
        return task;
      }
    }
    return null;
  }
561776
private int synchroizeTaskIDToHierarchy(Task parentTask, int currentID)
   {
      for (Task task : parentTask.getChildTasks())
      {
         task.setID(Integer.valueOf(currentID++));
         add(task);
         currentID = synchroizeTaskIDToHierarchy(task, currentID);
      }
      return currentID;
   }
547755
private void readTasks(Integer id)
   {
      Integer currentID = id;
      Table table = getTable("WBSTAB");

      while (currentID.intValue() != 0)
      {
         MapRow row = table.find(currentID);
         Task task = m_projectFile.getTaskByUniqueID(row.getInteger("TASK_ID"));
         readLeafTasks(task, row.getInteger("FIRST_CHILD_TASK_ID"));
         Integer childID = row.getInteger("CHILD_ID");
         if (childID.intValue() != 0)
         {
            readTasks(childID);
         }
         currentID = row.getInteger("NEXT_ID");
      }
   }
1356555
def update_subtask(self, subtask_id, revision, title=None, completed=None):
        '''
        
        '''
        return subtasks_endpoint.update_subtask(self, subtask_id, revision, title=title, completed=completed)
84361
def get_sub_balance(self, sub_id, _async=False):
        

        params = {}
        params['sub-uid'] = sub_id
        path = '/v1/account/accounts/{sub-uid}'
        return api_key_get(params, path, _async=_async)
168807
def find_by_id(self, workspace, params={}, **options): 
        
        path = "/workspaces/%s" % (workspace)
        return self.client.get(path, params, **options)
1134213
public Optional<SingularityTaskState> getTaskState(String requestId, String runId) {
    final Function<String, String> requestUri = (host) -> String.format(TRACK_BY_RUN_ID_FORMAT, getApiBase(host), requestId, runId);
    return getSingle(requestUri, "track by task id", String.format("%s-%s", requestId, runId), SingularityTaskState.class);
  }
163897
protected function getTaskRequest($id)
    {
        // verify the required parameter 'id' is set
        if ($id === null) {
            throw new \InvalidArgumentException(
                'Missing the required parameter $id when calling getTask'
            );
        }

        $resourcePath = '/tasks/{id}';
        $formParams = [];
        $queryParams = [];
        $headerParams = [];
        $httpBody = '';
        $multipart = false;


        // path params
        if ($id !== null) {
            $resourcePath = str_replace(
                '{' . 'id' . '}',
                ObjectSerializer::toPathValue($id),
                $resourcePath
            );
        }

        // body params
        $_tempBody = null;

        if ($multipart) {
            $headers = $this->headerSelector->selectHeadersForMultipart(
                ['application/json']
            );
        } else {
            $headers = $this->headerSelector->selectHeaders(
                ['application/json'],
                ['application/json']
            );
        }

        // for model (json/xml)
        if (isset($_tempBody)) {
            // $_tempBody is the method argument, if present
            $httpBody = $_tempBody;
            // \stdClass has no __toString(), so we should encode it manually
            if ($httpBody instanceof \stdClass && $headers['Content-Type'] === 'application/json') {
                $httpBody = \GuzzleHttp\json_encode($httpBody);
            }
        } elseif (count($formParams) > 0) {
            if ($multipart) {
                $multipartContents = [];
                foreach ($formParams as $formParamName => $formParamValue) {
                    $multipartContents[] = [
                        'name' => $formParamName,
                        'contents' => $formParamValue
                    ];
                }
                // for HTTP post (form)
                $httpBody = new MultipartStream($multipartContents);

            } elseif ($headers['Content-Type'] === 'application/json') {
                $httpBody = \GuzzleHttp\json_encode($formParams);

            } else {
                // for HTTP post (form)
                $httpBody = \GuzzleHttp\Psr7\build_query($formParams);
            }
        }

        // this endpoint requires API key authentication
        $apiKey = $this->config->getApiKeyWithPrefix('X-API-KEY');
        if ($apiKey !== null) {
            $headers['X-API-KEY'] = $apiKey;
        }

        $defaultHeaders = [];
        if ($this->config->getUserAgent()) {
            $defaultHeaders['User-Agent'] = $this->config->getUserAgent();
        }

        $headers = array_merge(
            $defaultHeaders,
            $headerParams,
            $headers
        );

        $query = \GuzzleHttp\Psr7\build_query($queryParams);
        return new Request(
            'GET',
            $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''),
            $headers,
            $httpBody
        );
    }
617093
function addTask(taskData, subTaskData) {
			var subTaskList,
				parsedData,
				subTask = false;

			if(taskData !== undefined) {
				if(parseInt(taskData,10) > -1) {
					subTaskList = this.getTaskByID(parseInt(taskData,10)).subTasks;

					parsedData = this.parseInputData(subTaskData);
					subTask = true;
				}
				else {
					parsedData = this.parseInputData(taskData);
				}


				var newTask = _.clone(defaultTask)
				_.extend(newTask, parsedData);

				newTask.dateAdded = Date.now();
				newTask.id = largestID + 1;
				newTask.subTask = subTask;

				this.tasks.unshift( newTask );

				if(subTask) {
					subTaskList.push(newTask.id);
				}

				console.log('Added:');
				return newTask;
			}
			else {
				console.log('no task name given');
				return false;
			}

		}
796173
public Optional<SingularityTaskState> getTaskState(String taskId) {
    final Function<String, String> requestUri = (host) -> String.format(TRACK_BY_TASK_ID_FORMAT, getApiBase(host), taskId);
    return getSingle(requestUri, "track by task id", taskId, SingularityTaskState.class);
  }
501272
def get_work_item_by_id(self, wi_id):
        '''
        
        '''
        work_items = self.get_work_items(id=wi_id)
        if work_items is not None:
            return work_items[0]
        return None
81034
def task(self):
        
        # If we have no .task_id, this is a no-op to return None.
        if not self.task_id:
            return defer.succeed(None)
        return self.connection.getTaskInfo(self.task_id)
1284180
public function getByTask($task_id, array $params = [])
    {
        $task_id = (int) $task_id;
        if ($task_id <= 0) {
            throw new Exception('Invalid param task_id');
        }
        return $this->rest->get("todo_items/$task_id/$this->action", $params);
    }
575340
def getElementById(self, _id):
        '''
            
        '''
        for tag in self:
            if tag.id == _id:
                return tag
            for subtag in tag.children:
                tmp = subtag.getElementById(_id)
                if tmp is not None:
                    return tmp
        return None
647197
public SubscriptionEnvelope getSubscription(String subId) throws ApiException {
        ApiResponse<SubscriptionEnvelope> resp = getSubscriptionWithHttpInfo(subId);
        return resp.getData();
    }