Get PID object for the Release record.
508714
def pid(self):
        """"""
        if self.model.status == ReleaseStatus.PUBLISHED and self.record:
            fetcher = current_pidstore.fetchers[
                current_app.config.get('GITHUB_PID_FETCHER')]
            return fetcher(self.record.id, self.record)
630676
def pid(name):
    '''
    
    '''
    try:
        return int(info(name).get('PID'))
    except (TypeError, ValueError) as exc:
        raise CommandExecutionError(
            'Unable to get PID for container \'{0}\': {1}'.format(name, exc)
        )
1160694
def get_release_id(self, package_name: str, version: str) -> bytes:
        
        validate_package_name(package_name)
        validate_package_version(version)
        self._validate_set_registry()
        return self.registry._get_release_id(package_name, version)
1275637
function getByPID(pid) {
  var workers = get();
  var i;
  var worker;

  for (i = 0; i < workers.length; i++) {
    worker = workers[i];
    if (worker.pid === pid) {
      return worker;
    }
  }
  // else return undefined
}
1159240
def pid(self):
    
    self._assert_bound()
    return PID(self._context.ip, self._context.port, self.name)
230880
def get_new_pid(institute):
    
    number = '0001'
    prefix = 'p%s' % institute.name.replace(' ', '')[:4]

    found = True
    while found:
        try:
            Project.objects.get(pid=prefix + number)
            number = str(int(number) + 1)
            if len(number) == 1:
                number = '000' + number
            elif len(number) == 2:
                number = '00' + number
            elif len(number) == 3:
                number = '0' + number
        except Project.DoesNotExist:
            found = False

    return prefix + number
326462
def get_pID(read):
    
    try:
        return 100 * (1 - read.get_tag("NM") / read.query_alignment_length)
    except KeyError:
        try:
            return 100 * (1 - (parse_MD(read.get_tag("MD")) + parse_CIGAR(read.cigartuples))
                          / read.query_alignment_length)
        except KeyError:
            return None
    except ZeroDivisionError:
        return None
830971
private String getPackagePid(DigitalObject object) throws Exception {
        for (String pid : object.getPayloadIdList()) {
            if (pid.endsWith(".tfpackage")) {
                return pid;
            }
        }
        return null;
    }
187338
def get_shell(pid=None, max_depth=6):
    
    if not pid:
        pid = os.getpid()
    processes = dict(_iter_process())

    def check_parent(pid, lvl=0):
        ppid = processes[pid].get('parent_pid')
        shell_name = _get_executable(processes.get(ppid))
        if shell_name in SHELL_NAMES:
            return (shell_name, processes[ppid]['executable'])
        if lvl >= max_depth:
            return None
        return check_parent(ppid, lvl=lvl + 1)

    shell_name = _get_executable(processes.get(pid))
    if shell_name in SHELL_NAMES:
        return (shell_name, processes[pid]['executable'])
    try:
        return check_parent(pid)
    except KeyError:
        return None
1023028
def is_valid_pid_to_be_updated(did):
    """"""
    return (
        is_existing_object(did)
        and not is_local_replica(did)
        and not is_archived(did)
        and not is_obsoleted(did)
    )
1155810
def _get_pid_file_variable(self, db):
        
        pid_file = None
        try:
            with closing(db.cursor()) as cursor:
                cursor.execute("SHOW VARIABLES LIKE 'pid_file'")
                pid_file = cursor.fetchone()[1]
        except Exception:
            self.warning("Error while fetching pid_file variable of MySQL.")

        return pid_file
1307120
def get(self):
        """"""
        output = helm("get", self.release)
        if output.returncode != 0:
            print("Something went wrong!")
            print(output.stderr)
        else:
            print(output.stdout)
670644
def get_deploy_by_id(self, dep_id):
        """"""

        for elem in self.deploys:
            if elem.id == dep_id:
                return elem
        return None
835035
def _get_chain_by_pid(pid):
    
    try:
        return d1_gmn.app.models.ChainMember.objects.get(pid__did=pid).chain
    except d1_gmn.app.models.ChainMember.DoesNotExist:
        pass
272056
def pid(self):
        
        pf = self.path('cmd.pid')
        if not os.path.exists(pf):
            return None
        with open(pf, 'r') as f:
            return int(f.read())
657655
def releases(release_id=None, **kwargs):
    """"""
    if not 'id' in kwargs and release_id is not None:
        kwargs['release_id'] = release_id
        return Fred().release(**kwargs)
    return Fred().releases(**kwargs)
1211275
def release_save(lock):
    """"""
    if hasattr(lock, '_release_save'):
        return lock._release_save()
    elif hasattr(lock, 'release'):
        lock.release()
    else:
        raise TypeError('expecting Lock/RLock')