def proc_info(pid, attrs=None):
 try:
  proc = psutil.Process(pid)
  return proc.as_dict(attrs)
 except (psutil.NoSuchProcess, psutil.AccessDenied, AttributeError) as exc:
  raise CommandExecutionError(exc)

def proc_info ( pid , attrs = None ) : try : proc = psutil . Process ( pid ) return proc . as_dict ( attrs ) except ( psutil . NoSuchProcess , psutil . AccessDenied , AttributeError ) as exc : raise CommandExecutionError ( exc )
return a dictionary of information for a process id .