original_docstring: return a task for the given PID
docstring: return a task for the given PID
docstring_tokens: return a task for the given PID
code: def for_pid(cls, pid):
  		"""return a task for the given PID"""
  		pidhash_sym = gdb.lookup_global_symbol('g_pidhash')
  		pidhash_value = pidhash_sym.value()
  		pidhash_type = pidhash_sym.type
  		for i in range(pidhash_type.range()[0],pidhash_type.range()[1]):
  			pidhash_entry = pidhash_value[i]
  			if pidhash_entry['pid'] == pid:
  				return cls(pidhash_entry['tcb'])
  		return None
code_tokens: def for_pid ( cls , pid ) : pidhash_sym = gdb . lookup_global_symbol ( 'g_pidhash' ) pidhash_value = pidhash_sym . value ( ) pidhash_type = pidhash_sym . type for i in range ( pidhash_type . range ( ) [ 0 ] , pidhash_type . range ( ) [ 1 ] ) : pidhash_entry = pidhash_value [ i ] if pidhash_entry [ 'pid' ] == pid : return cls ( pidhash_entry [ 'tcb' ] ) return None
short_docstring: return a task for the given PID
short_docstring_tokens: return a task for the given PID
comment: """return a task for the given PID"""