根据 pid 判断是否由 husky 调用

@param {string} ppid parent pid
@returns {Promise<boolean>} 是否是 husky 调用
492830
function isRunByHusky (ppid) {
  return find('pid', ppid).then(list => {
    debug('process list: %o', list)

    const cmd = list[0] && list[0].cmd
    const pppid = list[0] && list[0].ppid

    if (!cmd) {
      return false
    }

    if (huskyCmdReg.test(cmd)) {
      return true
    }

    // 一直迭代到最顶
    return isRunByHusky(pppid)
  })
}
654956
function pkgPropUpd(pd, u, n, r) {
			var v = null;
			if (u && pd.oldVer !== self.version && self.version) {
				v = self.version;
			} else if (n && pd.oldVer !== self.next.version && self.next.version) {
				v = self.next.version;
			} else if (r && self.prev.version) {
				v = self.prev.version;
			}
			pd.version = v;
			if (v && !pd.props) {
				pd.pkg.version = v;
				pd.propChangeCount++;
			}
			if (pd.props && pd.pkgParent) {
				pd.props.forEach(function pkgProp(p) {
					if (pd.pkgParent[p] && (!pd.pkg[p] || pd.pkgParent[p] !== pd.pkg[p])) {
						// sync parent package property with the current one
						pd.pkg[p] = pd.pkgParent[p];
						pd.propChangeCount++;
					}
				});
			}
			return v;
		}
238918
function _ps(args, lineProcessor) {
  const output = runProgram('ps', args).trim();
  const result = [];
  _.each(output.split('\n'), line => {
    const process = lineProcessor(line);
    if (!process) return;
    // Normalize pid and ppid to be numbers
    _.each(['pid', 'ppid'], numericField => process[numericField] = parseInt(process[numericField], 10));
    result.push(process);
  });
  return result;
}
625199
@Override
	public List<CPInstance> getCPInstancesByUuidAndCompanyId(String uuid,
		long companyId) {
		return cpInstancePersistence.findByUuid_C(uuid, companyId);
	}
288439
function (cwd = process.cwd()) {
        const promise = new Promise((resolve, reject) => {
            const _name = this.toString();
            // eslint-disable-next-line no-console
            console.log(`spawning:: ${_name}`);
            const call = spawn(this.cmd, this.args, {env: process.env, shell: true, stdio: 'inherit', cwd});
            this.args = [];
            call.on('exit', (code) => {
                // eslint-disable-next-line no-console
                console.log(`spawning:: ${_name} code::${code}`);
                if (code === 0) {
                    resolve(0);
                } else {
                    reject(code);
                }
            });
            return call;
        });

        return promise;
    }
1048890
function processPid(host,path,api_key,pid) {
	var query = nitro.newQuery();
	query.add(api.fProgrammesPageSize,pageSize,true)
		.add(api.mProgrammesContributions)
		.add(api.mProgrammesDuration)
		.add(api.mProgrammesAncestorTitles)
		.add(api.mProgrammesAvailableVersions)
		.add(api.mProgrammesGenreGroupings)

	if (upcoming || children) {
		query.add(api.fProgrammesDescendantsOf,pid)
		.add(api.fProgrammesAvailabilityPending);
	}
	else {
		query.add(api.fProgrammesPid,pid)
	}
	if (partner_pid != '') {
		query.add(api.fProgrammesPartnerPid,partner_pid);
	}
	else {
		if (pending) {
			query.add(api.fProgrammesAvailability,'P30D');
		}
		else {
			query.add(api.fProgrammesAvailabilityAvailable);
		}
		query.add(api.mProgrammesAvailability); // has a dependency on 'availability'
	}
	if (episode_type == 'clip') {
		query.add(api.fProgrammesAvailabilityEntityTypeClip);
	}
	else if ((episode_type == 'brand') || (episode_type == 'series')) {
		query.add(api.fProgrammesEntityType,episode_type);
	}
	else {
		query.add(api.fProgrammesAvailabilityEntityTypeEpisode);
	}
	if (embargoed) {
		query.add(api.xProgrammesEmbargoed,embargoed);
	}
	if (payment_type) {
		query.add(api.fProgrammesPaymentType,payment_type);
	}
	nitro.make_request(host,path,api_key,query,{},function(obj){
		return dispatch(obj);
	});
}
252295
function guid(moduleId) {
   var S4 = function() {
      return (((1+Math.random())*0x10000)|0).toString(16).substring(1);
   };
   return moduleId + '@' + (S4()+S4());
}
37236
def parent(self):
        """"""
        if self._parent is None:
            if self.pid is not None:
                self._parent = self.api._load_directory(self.pid)
        return self._parent
652741
function closeLiveBrowser(pid) {
        var result = new $.Deferred();

        if (isNaN(pid)) {
            pid = 0;
        }
        brackets.app.closeLiveBrowser(function (err) {
            if (!err) {
                var i = liveBrowserOpenedPIDs.indexOf(pid);
                if (i !== -1) {
                    liveBrowserOpenedPIDs.splice(i, 1);
                }
                result.resolve();
            } else {
                result.reject(_browserErrToFileError(err));
            }
        }, pid);

        return result.promise();
    }
613579
function resolvePackageId(id) {
        each(
            packagesIndex,
            function (packageConf) {
                var name = packageConf.name;
                if (name === id) {
                    id = name + '/' + packageConf.main;
                    return false;
                }
            }
        );

        return id;
    }
1176749
def resolve_pid(fetched_pid):
    
    return PersistentIdentifier.get(
        pid_type=fetched_pid.pid_type,
        pid_value=fetched_pid.pid_value,
        pid_provider=fetched_pid.provider.pid_provider
    )
961879
private String getSubProcessInstanceId(String instanceId) {
        int beg = instanceId.indexOf("/");

        if (beg > -1 && beg + 1 < instanceId.length()) {
            return instanceId.substring(beg + 1);
        }

        return "";
    }
557090
def pid
      return nil unless is_window?
      process_id = 0.chr * 4
      GetWindowThreadProcessId(handle, process_id)
      process_id = process_id.unpack('L').first
    end
370926
func (p *Pod) Pid() (int, error) {
	if pid, err := p.readIntFromFile("pid"); err == nil {
		return pid, nil
	}
	if pid, err := p.readIntFromFile("ppid"); err != nil {
		return -1, err
	} else {
		return pid, nil
	}
}
650494
protected function _getPidRecursive($ppid) {
		if (!$ppid) {
			return array();
		}
		$allPids = $pids = array_filter(preg_split('/\s+/', `ps -o pid --no-heading --ppid $ppid`));

		foreach ($pids as $pid) {
			$allPids = array_merge($allPids, $this->_getPidRecursive($pid));
		}
		return $allPids;
	}
890330
function(res, pid) {
  var lines = res.split('\n')
    , data = s(lines[1]).collapseWhitespace().s
    , dataParts = data.split(' ');

  return {
    pid: pid
  , cpu: dataParts[0] || '0.0'
  , mem: dataParts[1] || '0'
  };
}
317911
private static final boolean parentHasSameExPc(JPAPuId parentPuIds[], JPAPuId puId)
    {
        for (JPAPuId parentPuId : parentPuIds)
        {
            if (parentPuId.equals(puId))
            {
                return true;
            }
        }
        return false;
    }