See Also: setObsoletedByResponse()

        Args:
          pid:
          obsoletedByPid:
          serialVersion:
          vendorSpecific:

        Returns:
357974
def setObsoletedBy(self, pid, obsoletedByPid, serialVersion, vendorSpecific=None):
        
        response = self.setObsoletedByResponse(
            pid, obsoletedByPid, serialVersion, vendorSpecific
        )
        return self._read_boolean_response(response)
240597
def set_uids(pifs, uids=None):
    
    if not uids:
        uids = [str(hash(dumps(x))) for x in pifs]
    for pif, uid in zip(pifs, uids):
        pif.uid = uid
    return pifs
1332419
def _reinit_daq_daemons(sender, instance, **kwargs):
    
    if type(instance) is OneWireDevice:
        post_save.send_robust(sender=Device, instance=instance.onewire_device)
    elif type(instance) is OneWireVariable:
        post_save.send_robust(sender=Variable, instance=instance.onewire_variable)
    elif type(instance) is ExtendedOneWireVariable:
        post_save.send_robust(sender=Variable, instance=Variable.objects.get(pk=instance.pk))
    elif type(instance) is ExtendedOneWireDevice:
        post_save.send_robust(sender=Device, instance=Device.objects.get(pk=instance.pk))
462020
@SuppressWarnings("unused")
    private static MBeanServerConnection getServerConnection(int pid) {

        try {
            JMXServiceURL serviceURL = new JMXServiceURL(connectorAddress(pid));
            return JMXConnectorFactory.connect(serviceURL).getMBeanServerConnection();
        } catch (MalformedURLException ex) {
            throw failed("JMX connection failed", ex);
        } catch (IOException ex) {
            throw failed("JMX connection failed", ex);
        }

    }
818516
def _reinit_daq_daemons(sender, instance, **kwargs):
    
    if type(instance) is VISADevice:
        post_save.send_robust(sender=Device, instance=instance.visa_device)
    elif type(instance) is VISAVariable:
        post_save.send_robust(sender=Variable, instance=instance.visa_variable)
    elif type(instance) is VISADeviceHandler:
        # todo
        pass
    elif type(instance) is ExtendedVISAVariable:
        post_save.send_robust(sender=Variable, instance=Variable.objects.get(pk=instance.pk))
    elif type(instance) is ExtendedVISADevice:
        post_save.send_robust(sender=Device, instance=Device.objects.get(pk=instance.pk))
758403
def pid_exists(pid):
    
    try:
        os.kill(pid, 0)
    except OSError as exc:
        return exc.errno == errno.EPERM
    else:
        return True
472309
def pid(self):
        
        try:

            with open(self.pidfile, 'r') as pidfile:

                try:

                    pid = int(pidfile.read().strip())

                except ValueError:

                    return None

                try:

                    os.kill(pid, 0)

                except OSError as e:

                    if e.errno == errno.EPERM:

                        return pid

                    elif e.errno == errno.ESRCH:

                        return None

                    LOG.exception(
                        "os.kill returned unhandled error "
                        "{0}".format(e.strerror)
                    )
                    sys.exit(exit.PIDFILE_ERROR)

                return pid

        except IOError:

            if not os.path.isfile(self.pidfile):

                return None

            LOG.exception("Failed to read pidfile {0}.".format(self.pidfile))
            sys.exit(exit.PIDFILE_INACCESSIBLE)
290240
def __get_pid_by_scanning(self):
        ''
        dwProcessId = None
        dwThreadId = self.get_tid()
        with win32.CreateToolhelp32Snapshot(win32.TH32CS_SNAPTHREAD) as hSnapshot:
            te = win32.Thread32First(hSnapshot)
            while te is not None:
                if te.th32ThreadID == dwThreadId:
                    dwProcessId = te.th32OwnerProcessID
                    break
                te = win32.Thread32Next(hSnapshot)
        if dwProcessId is None:
            msg = "Cannot find thread ID %d in any process" % dwThreadId
            raise RuntimeError(msg)
        return dwProcessId
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
    )
362616
String lookupPid(ConfigID referenceId) {
        ExtendedConfiguration config = caSupport.lookupConfiguration(referenceId);
        String pid = (config == null) ? null : config.getPid();
        if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
            Tr.debug(tc, "lookupPid(): Lookup of " + referenceId + " reference resolved to " + pid);
        }
        return pid;
    }
1312732
public static ObjectFields getObjectFields(String pid, String[] fields)
            throws IOException {
        FieldSearchQuery query = new FieldSearchQuery();
        Condition condition = new Condition();
        condition.setProperty("pid");
        condition.setOperator(ComparisonOperator.fromValue("eq"));
        condition.setValue(pid);
        FieldSearchQuery.Conditions conds = new FieldSearchQuery.Conditions();
        conds.getCondition().add(condition);
        ObjectFactory factory = new ObjectFactory();
        query.setConditions(factory.createFieldSearchQueryConditions(conds));
        FieldSearchResult result =
                Administrator.APIA
                        .findObjects(TypeUtility.convertStringtoAOS(fields),
                                     new BigInteger("1"),
                                     query);
        ResultList resultList = result.getResultList();
        if (resultList == null || resultList.getObjectFields() == null
                && resultList.getObjectFields().size() == 0) {
            throw new IOException("Object not found in repository");
        }
        return resultList.getObjectFields().get(0);
    }
1259349
def lock_pidfile_or_die(pidfile):
    
    pid = os.getpid()
    try:
        remove_if_stale_pidfile(pidfile)
        pid_write_file = pidfile + '.' + str(pid)
        fpid = open(pid_write_file, 'w')
        try:
            fpid.write("%s\n" % pid)
        finally:
            fpid.close()
        if not take_file_lock(pid_write_file, pidfile, "%s\n" % pid):
            sys.exit(1)
    except SystemExit:
        raise
    except Exception:
        log.exception("unable to take pidfile")
        sys.exit(1)
    return pid
1166644
def setReplicationPolicy(self, pid, policy, serialVersion, vendorSpecific=None):
        
        response = self.setReplicationPolicyResponse(
            pid, policy, serialVersion, vendorSpecific
        )
        return self._read_boolean_response(response)
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]
709369
def _reinit_daq_daemons(sender, instance, **kwargs):
    
    if type(instance) is ModbusDevice:
        post_save.send_robust(sender=Device, instance=instance.modbus_device)
    elif type(instance) is ModbusVariable:
        post_save.send_robust(sender=Variable, instance=instance.modbus_variable)
    elif type(instance) is ExtendedModbusVariable:
        post_save.send_robust(sender=Variable, instance=Variable.objects.get(pk=instance.pk))
    elif type(instance) is ExtendedModbusDevice:
        post_save.send_robust(sender=Device, instance=Device.objects.get(pk=instance.pk))
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)
1201476
public void write_pid(OtpErlangPid pid) {
	write1(pid.tag());
	write_atom(pid.node());
	write4BE(pid.id());
	write4BE(pid.serial());
	switch (pid.tag()) {
	case OtpExternal.pidTag:
	    write1(pid.creation());
	    break;
	case OtpExternal.newPidTag:
	    write4BE(pid.creation());
	    break;
	default:
	    throw new AssertionError("Invalid pid tag " + pid.tag());
	}
    }