:class:`~zhmcclient.UnmanagedCpcManager`: Access to the unmanaged
        :term:`CPCs <CPC>` in this Console.
176983
def unmanaged_cpcs(self):
        
        # We do here some lazy loading.
        if not self._unmanaged_cpcs:
            self._unmanaged_cpcs = UnmanagedCpcManager(self)
        return self._unmanaged_cpcs
277565
protected final PrcAccEntityPbWithSubaccCopy
    lazyGetPrcAccEntityPbWithSubaccCopy(
      final Map<String, Object> pAddParam) throws Exception {
    @SuppressWarnings("unchecked")
    PrcAccEntityPbWithSubaccCopy<RS, IPersistableBase> proc =
      (PrcAccEntityPbWithSubaccCopy<RS, IPersistableBase>)
        this.processorsMap
          .get(PrcAccEntityPbWithSubaccCopy.class.getSimpleName());
    if (proc == null) {
      proc = new PrcAccEntityPbWithSubaccCopy<RS, IPersistableBase>();
      @SuppressWarnings("unchecked")
      PrcEntityPbCopy<RS, IPersistableBase> procDlg =
        (PrcEntityPbCopy<RS, IPersistableBase>)
          this.fctBnEntitiesProcessors
            .lazyGet(pAddParam, PrcEntityPbCopy.class.getSimpleName());
      proc.setPrcAccEntityPbCopy(procDlg);
      proc.setSrvTypeCode(getSrvTypeCode());
      //assigning fully initialized object:
      this.processorsMap
        .put(PrcAccEntityPbWithSubaccCopy.class.getSimpleName(), proc);
    }
    return proc;
  }
893829
def pdb_to_uniparc(pdb_ids, silent = True, cache_dir = None, manual_additions = {}):
    ''' 
    '''

    # Map PDB IDs to UniProtKB AC
    if not silent:
        colortext.write("Retrieving PDB to UniProtKB AC mapping: ", 'cyan')
    pdb_ac_mapping = uniprot_map('PDB_ID', 'ACC', pdb_ids, cache_dir = cache_dir, silent = silent)

    for k, v in manual_additions.iteritems():
        if k in pdb_ids:
            if pdb_ac_mapping.get(k):
                pdb_ac_mapping[k].extend(v)
                pdb_ac_mapping[k] = list(set(pdb_ac_mapping[k]))
            else:
                pdb_ac_mapping[k] = v

    if not silent:
        colortext.write("done\n", 'green')

    # Get a list of AC_IDs
    if not silent:
        colortext.write("Retrieving UniProtKB AC to UniProtKB ID mapping: ", 'cyan')
    AC_IDs = set()
    for k, v in pdb_ac_mapping.iteritems():
        AC_IDs = AC_IDs.union(set(v))
    AC_IDs = list(AC_IDs)
    if not silent:
        colortext.write("done\n", 'green')

    # Map UniProtKB ACs to UniParc IDs
    if not silent:
        colortext.write("Retrieving UniProtKB AC to UniParc ID mapping: ", 'cyan')
    ac_uniparc_mapping = uniprot_map('ACC', 'UPARC', AC_IDs, cache_dir = cache_dir, silent = silent)
    for k, v in ac_uniparc_mapping.iteritems():
        assert(len(v) == 1)
        ac_uniparc_mapping[k] = v[0]
    if not silent:
        colortext.write("done\n", 'green')

    # Map UniProtKB ACs to UniProtKB IDs
    ac_id_mapping = uniprot_map('ACC', 'ID', AC_IDs, cache_dir = cache_dir, silent = silent)

    for k, v in ac_id_mapping.iteritems():
        assert(len(v) == 1)
        ac_id_mapping[k] = v[0]

    # Create mapping from PDB IDs to UniParcEntry objects
    m = {}
    if not silent:
        colortext.message("\nRetrieving FASTA sequences for the %d PDB IDs." % len(pdb_ids))
    for pdb_id, ACs in pdb_ac_mapping.iteritems():
        if not silent:
            colortext.write("%s: " % pdb_id, "orange")
        m[pdb_id] = []
        for AC in ACs:
            entry = UniParcEntry(ac_uniparc_mapping[AC], [AC], [ac_id_mapping[AC]], cache_dir = cache_dir)
            m[pdb_id].append(entry)
            if not silent:
                colortext.write(".", "green")
        if not silent:
            print("")
    return m
550040
def OIDC_UNAUTHENTICATED_SESSION_MANAGEMENT_KEY(self):
        

        # Memoize generated value
        if not self._unauthenticated_session_management_key:
            self._unauthenticated_session_management_key = ''.join(
                random.choice(string.ascii_uppercase + string.digits) for _ in range(100))
        return self._unauthenticated_session_management_key
621044
@Override
	public int countByC_C(long CPDefinitionId, String CPInstanceUuid) {
		FinderPath finderPath = FINDER_PATH_COUNT_BY_C_C;

		Object[] finderArgs = new Object[] { CPDefinitionId, CPInstanceUuid };

		Long count = (Long)finderCache.getResult(finderPath, finderArgs, this);

		if (count == null) {
			StringBundler query = new StringBundler(3);

			query.append(_SQL_COUNT_CPINSTANCE_WHERE);

			query.append(_FINDER_COLUMN_C_C_CPDEFINITIONID_2);

			boolean bindCPInstanceUuid = false;

			if (CPInstanceUuid == null) {
				query.append(_FINDER_COLUMN_C_C_CPINSTANCEUUID_1);
			}
			else if (CPInstanceUuid.equals("")) {
				query.append(_FINDER_COLUMN_C_C_CPINSTANCEUUID_3);
			}
			else {
				bindCPInstanceUuid = true;

				query.append(_FINDER_COLUMN_C_C_CPINSTANCEUUID_2);
			}

			String sql = query.toString();

			Session session = null;

			try {
				session = openSession();

				Query q = session.createQuery(sql);

				QueryPos qPos = QueryPos.getInstance(q);

				qPos.add(CPDefinitionId);

				if (bindCPInstanceUuid) {
					qPos.add(CPInstanceUuid);
				}

				count = (Long)q.uniqueResult();

				finderCache.putResult(finderPath, finderArgs, count);
			}
			catch (Exception e) {
				finderCache.removeResult(finderPath, finderArgs);

				throw processException(e);
			}
			finally {
				closeSession(session);
			}
		}

		return count.intValue();
	}
353025
def cmServiceAbort():
    """"""
    a = TpPd(pd=0x5)
    b = MessageType(mesType=0x23)  # 00100011
    packet = a / b
    return packet
493141
def unmanaged_devices(self):
        
        if not self.__unmanaged_devices:
            self.__unmanaged_devices = UnmanagedDevices(self.__connection)
        return self.__unmanaged_devices
457050
def get(method, hmc, uri, uri_parms, logon_required):
        """"""
        query_str = uri_parms[0]
        try:
            console = hmc.consoles.lookup_by_oid(None)
        except KeyError:
            raise InvalidResourceError(method, uri)

        result_ucpcs = []
        filter_args = parse_query_parms(method, uri, query_str)
        for ucpc in console.unmanaged_cpcs.list(filter_args):
            result_ucpc = {}
            for prop in ucpc.properties:
                if prop in ('object-uri', 'name'):
                    result_ucpc[prop] = ucpc.properties[prop]
            result_ucpcs.append(result_ucpc)
        return {'cpcs': result_ucpcs}
672874
public ConnectionManager getConnectionManager() {
        if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
            Tr.debug(this, tc, "Connection manager is " + cm + " for managed connection " + this);
            if (cm == null && pm != null) {
                Tr.debug(this, tc, "Connection pool is " + this.pm.toString());
            }
        }
        if (cm != null) {
            return cm;
        } else {
            IllegalStateException e = new IllegalStateException("ConnectionManager is null");
            Tr.error(tc, "ILLEGAL_STATE_EXCEPTION_J2CA0079", "getConnectionManager", e);
            throw e;
        }
    }
184703
def unregisterSdc(self, sdcObj):
        
        # TODO:
        # Add code that unmap volume if mapped
        self.conn.connection._check_login()
        response = self.conn.connection._do_post("{}/{}{}/{}".format(self.conn.connection._api_url, "instances/Sdc::", sdcObj.id, 'action/removeSdc'))    
        return response
164889
def post(method, hmc, uri, uri_parms, body, logon_required,
             wait_for_completion):
        """"""
        assert wait_for_completion is True  # async not supported yet
        cpc_oid = uri_parms[0]
        try:
            cpc = hmc.cpcs.lookup_by_oid(cpc_oid)
        except KeyError:
            raise InvalidResourceError(method, uri)
        if not cpc.dpm_enabled:
            raise CpcNotInDpmError(method, uri, cpc)
        check_valid_cpc_status(method, uri, cpc)
        check_required_fields(method, uri, body,
                              ['name', 'initial-memory', 'maximum-memory'])
        # TODO: There are some more input properties that are required under
        # certain conditions.

        # Reflect the result of creating the partition
        new_partition = cpc.partitions.add(body)
        return {'object-uri': new_partition.uri}
1061674
@Override
	public CPInstance removeByC_S(long CPDefinitionId, String sku)
		throws NoSuchCPInstanceException {
		CPInstance cpInstance = findByC_S(CPDefinitionId, sku);

		return remove(cpInstance);
	}
1323928
private void unregisterQueryMBeans(ComponentRegistry cr, String cacheName) {
      if (mbeanServer != null) {
         try {
            InfinispanQueryStatisticsInfo stats = cr.getComponent(InfinispanQueryStatisticsInfo.class);
            if (stats != null) {
               GlobalJmxStatisticsConfiguration jmxConfig = cr.getGlobalComponentRegistry().getGlobalConfiguration().globalJmxStatistics();
               String queryGroupName = getQueryGroupName(jmxConfig.cacheManagerName(), cacheName);
               String queryMBeanFilter = stats.getObjectName().getDomain() + ":" + queryGroupName + ",*";
               JmxUtil.unregisterMBeans(queryMBeanFilter, mbeanServer);
            }
         } catch (Exception e) {
            throw new CacheException("Unable to unregister query MBeans", e);
         }
      }
   }
1168166
private static Consumer<ByteBuffer> unmapper() {
        final Lookup lookup = lookup();
        try {
            // *** sun.misc.Unsafe unmapping (Java 9+) ***
            final Class<?> unsafeClass = Class.forName("sun.misc.Unsafe");
            // first check if Unsafe has the right method, otherwise we can give up
            // without doing any security critical stuff:
            final MethodHandle unmapper = lookup.findVirtual(unsafeClass, "invokeCleaner",
                    methodType(void.class, ByteBuffer.class));
            // fetch the unsafe instance and bind it to the virtual MH:
            final Field f = unsafeClass.getDeclaredField("theUnsafe");
            f.setAccessible(true);
            final Object theUnsafe = f.get(null);
            return newBufferCleaner(ByteBuffer.class, unmapper.bindTo(theUnsafe));
        } catch (SecurityException se) {
            LOG.error(
                    "Unmapping is not supported because of missing permissions. Please grant at least the following permissions: RuntimePermission(\"accessClassInPackage.sun.misc\") "
                            + " and ReflectPermission(\"suppressAccessChecks\")",
                    se);

        } catch (ReflectiveOperationException | RuntimeException e) {
            LOG.error("Unmapping is not supported.", e);
        }
        return null;
    }
870102
def pkcs7_unpad(buf):
    # type: (bytes) -> bytes
    
    unpadder = cryptography.hazmat.primitives.padding.PKCS7(
        cryptography.hazmat.primitives.ciphers.
        algorithms.AES.block_size).unpadder()
    return unpadder.update(buf) + unpadder.finalize()
1157745
private static void doDumpOpenJPAPCRegistry(final Class pcRegClass, final PrintWriter out) {
        out.println();
        out.println("################################################################################");
        out.println("OpenJPA PCRegistry Dump");
        out.println("################################################################################");

        // Access the PCRegistry._metas Map<Class<?>,Meta> static field
        try {
            final Field _metas = pcRegClass.getDeclaredField("_metas");
            final boolean accessible = _metas.isAccessible();
            Object _metasObjVal = null; // Type is Map<Class<?>,Meta>
            try {
                _metas.setAccessible(true);
                _metasObjVal = _metas.get(null);
            } finally {
                _metas.setAccessible(accessible);
            }

            if (_metasObjVal == null) {
                return;
            }

            final Map<?, ?> _metasMap = (Map<?, ?>) _metasObjVal;
            for (Map.Entry<?, ?> entry : _metasMap.entrySet()) {
                final Class cls = (Class) entry.getKey();
                final Object metaObj = entry.getValue();

                out.println();
                out.println("Class " + cls.getName() + " " + getObjectAddress(cls));
                out.println("  ClassLoader: " + poa(cls.getClassLoader()));
                out.println("  CodeSource: " + poa(cls.getProtectionDomain().getCodeSource()));

                if (metaObj == null) {
                    continue;
                }

                try {
                    final Class metaObjClass = metaObj.getClass();
                    final String alias = (String) reflectObjValue(metaObj, "alias");
                    final Object pc = reflectObjValue(metaObj, "pc"); // PersistenceCapable type
                    final Class pcSuper = (Class) reflectObjValue(metaObj, "pcSuper");
                    final String pcTxt = getInstanceClassAndAddress(pc); // Calling a PC's toString() can be dangerous.  Don't do it.

                    out.println("  Meta alias: " + alias); // metaObjClass.getDeclaredField("alias").get(metaObj)); // String
                    out.println("  Meta pc: " + poa(pcTxt)); // metaObjClass.getDeclaredField("pc").get(metaObj)); // PersistenceCapable
                    out.println("  Meta pcSuper: " + poa(pcSuper)); // metaObjClass.getDeclaredField("pcSuper").get(metaObj));

                    out.print("  Meta fieldNames: ");
                    final Object[] fieldNames = (Object[]) reflectObjValue(metaObj, "fieldNames"); // metaObjClass.getDeclaredField("fieldNames").get(metaObj); // String[]
                    for (Object o : fieldNames) {
                        out.print(poa(o));
                        out.print(" ");
                    }
                    out.println();

                    out.print("  Meta fieldTypes: ");
                    final Object[] fieldTypes = (Object[]) reflectObjValue(metaObj, "fieldTypes"); // (Object[]) metaObjClass.getDeclaredField("fieldTypes").get(metaObj); // Class<?>[]
                    for (Object o : fieldTypes) {
                        out.print(poa(o));
                        out.print(" ");
                    }
                    out.println();
                } catch (Throwable t) {
                    FFDCFilter.processException(t, FFDCCN + ".doDumpOpenJPAPCRegistry", "708");
                }
            }
        } catch (Throwable t) {
            FFDCFilter.processException(t, FFDCCN + ".doDumpOpenJPAPCRegistry", "713");
        }
    }
767458
def _getMonitorInfo(self):
        
        monitors = []
        CCHDEVICENAME = 32
        def _MonitorEnumProcCallback(hMonitor, hdcMonitor, lprcMonitor, dwData):
            class MONITORINFOEX(ctypes.Structure):
                _fields_ = [("cbSize", ctypes.wintypes.DWORD),
                            ("rcMonitor", ctypes.wintypes.RECT),
                            ("rcWork", ctypes.wintypes.RECT),
                            ("dwFlags", ctypes.wintypes.DWORD),
                            ("szDevice", ctypes.wintypes.WCHAR*CCHDEVICENAME)]
            lpmi = MONITORINFOEX()
            lpmi.cbSize = ctypes.sizeof(MONITORINFOEX)
            self._user32.GetMonitorInfoW(hMonitor, ctypes.byref(lpmi))
            #hdc = self._gdi32.CreateDCA(ctypes.c_char_p(lpmi.szDevice), 0, 0, 0)
            monitors.append({
                "hmon": hMonitor,
                #"hdc":  hdc,
                "rect": (lprcMonitor.contents.left,
                         lprcMonitor.contents.top,
                         lprcMonitor.contents.right,
                         lprcMonitor.contents.bottom),
                "name": lpmi.szDevice
                })
            return True
        MonitorEnumProc = ctypes.WINFUNCTYPE(
            ctypes.c_bool,
            ctypes.c_ulong,
            ctypes.c_ulong,
            ctypes.POINTER(ctypes.wintypes.RECT),
            ctypes.c_int)
        callback = MonitorEnumProc(_MonitorEnumProcCallback)
        if self._user32.EnumDisplayMonitors(0, 0, callback, 0) == 0:
            raise WindowsError("Unable to enumerate monitors")
        # Clever magic to make the screen with origin of (0,0) [the primary monitor]
        # the first in the list
        # Sort by device ID - 0 is primary, 1 is next, etc.
        monitors.sort(key=lambda x: (not (x["rect"][0] == 0 and x["rect"][1] == 0), x["name"]))

        return monitors