Args:
      pid : str

    Returns:
      str : URIRef of the entry identified by ``pid``.
162721
def getObjectByPid(self, pid):
        
        self._check_initialized()
        opid = rdflib.term.Literal(pid)
        res = [o for o in self.subjects(predicate=DCTERMS.identifier, object=opid)]
        return res[0]
122027
def pid_exists(value, pidtype=None):
    
    try:
        PersistentIdentifier.get(pidtype, value)
        return True
    except PIDDoesNotExistError:
        return False
32073
def write_pidfile(pidfile):
    
    pid = os.getpid()
    if pidfile:
        with open(pidfile, "w", encoding="utf-8") as fobj:
            fobj.write(six.u(str(pid)))
    return pid
994415
def getPID(self):
        
        if self._pid is not None:
            if not PlatformManager.isPIDValid(self._pid):
                self._pid = -1
            return self._pid
        return -1
743141
def get_pidpath(rundir, process_type, name=None):
    
    assert rundir, "rundir is not configured"
    path = os.path.join(rundir, '%s.pid' % process_type)
    if name:
        path = os.path.join(rundir, '%s.%s.pid' % (process_type, name))
    log.log('common', 'get_pidpath for type %s, name %r: %s'
            % (process_type, name, path))
    return path
1332313
def _get_shell_pid():
    """"""
    proc = Process(os.getpid())

    try:
        return proc.parent().pid
    except TypeError:
        return proc.parent.pid
1045085
def uid(self):
        
        if not self._uid:
            if self.config.daemon.user:
                self._uid = pwd.getpwnam(self.config.daemon.user).pw_uid
            else:
                self._uid = os.getuid()
        return self._uid
356723
def __get_pid_and_tid(self):
        ""
        self.dwThreadId, self.dwProcessId = \
                            win32.GetWindowThreadProcessId(self.get_handle())
1004226
def resolve(self, pid):
        """"""
        client = d1_cli.impl.client.CLICNClient(
            **self._cn_client_connect_params_from_session()
        )
        object_location_list_pyxb = client.resolve(pid)
        for location in object_location_list_pyxb.objectLocation:
            d1_cli.impl.util.print_info(location.url)
1293424
def __writepid(self, pid):
        
        import tempfile
        d = tempfile.gettempdir()
        name = os.path.join(d, "hoverpy.%i.%i"%(self._proxyPort, self._adminPort))
        with open(name, 'w') as f:
            f.write(str(pid))
            logging.debug("writing to %s"%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
612665
protected function getPageId($pid)
    {
        $pid = (int)$pid;
        if ($pid > 0) {
            return $pid;
        }
        $row = BackendUtilityCore::getRecord('tt_content', abs($pid), 'uid,pid');
        return $row['pid'];
    }
695789
private int openDoor(int pid) throws IOException {
        String path = tmpdir + "/.java_pid" + pid;;
        fd = open(path);

        // Check that the file owner/permission to avoid attaching to
        // bogus process
        try {
            checkPermissions(path);
        } catch (IOException ioe) {
            close(fd);
            throw ioe;
        }
        return fd;
    }
473940
def get_stdin_pid(cached_result=None):
    """"""
    if cached_result is None:
        try:
            tasks = os.listdir('/proc/self/task')
        except OSError as e:
            if e.errno != errno.ENOENT:
                raise
            cached_result = os.getpid()
        else:
            tasks.remove(str(os.getpid()))
            assert len(tasks) == 1
            cached_result = int(tasks[0])
    return cached_result
167254
def write_pid_file(fn):
    
    if not fn:
        return None
    if fn == '' or fn == "''":
        # work around argument passings in init-scripts
        return None
    f = open(fn, "w")
    f.write("%s\n" % (os.getpid()))
    f.close()
329909
def _is_pid_running_on_windows(pid):
    
    import ctypes.wintypes

    kernel32 = ctypes.windll.kernel32
    handle = kernel32.OpenProcess(1, 0, pid)
    if handle == 0:
        return False
    exit_code = ctypes.wintypes.DWORD()
    ret = kernel32.GetExitCodeProcess(handle, ctypes.byref(exit_code))
    is_alive = (ret == 0 or exit_code.value == _STILL_ALIVE)  # pylint: disable=undefined-variable
    kernel32.CloseHandle(handle)
    return is_alive
1146574
def read_pid_constants(self):
        """"""
        p = self._read_as_int(Addr.PConstant, 4)
        i = self._read_as_int(Addr.IConstant, 4)
        d = self._read_as_int(Addr.DConstant, 4)
        
        return map(lambda x: x / (2 ** 16), (p, i, d))