read_attribute_reply_i - access limited to package Group
439397
@Override
    GroupReplyList write_attribute_reply_i(final int rid, final int tmo, final boolean fwd) throws DevFailed {
	final Integer rid_obj = new Integer(rid);
	final GroupReplyList rl = new GroupReplyList();
	final AsynchRequest ar = arp.get(rid_obj);
	if (ar == null) {
	    final DevError[] errors = new DevError[1];
	    errors[0] = new DevError();
	    errors[0].severity = ErrSeverity.ERR;
	    errors[0].reason = "API_BadAsynPollId";
	    errors[0].desc = "Invalid asynch. request identifier specified";
	    errors[0].origin = "GroupDeviceElement.write_attribute_reply";
	    final DevFailed e = new DevFailed(errors);
	    rl.add(new GroupReply(get_name(), "unknown", e));
	    return rl;
	}
	if (ar.req_id == -1) {
	    for (final String element : ar.obj_name) {
		rl.add(new GroupReply(get_name(), element, ar.exception));
	    }
	    arp.remove(rid_obj);
	    return rl;
	}
	try {
	    proxy.write_attribute_reply(ar.req_id, tmo);
	    for (final String element : ar.obj_name) {
		rl.add(new GroupReply(get_name(), element));
	    }
	} catch (final AsynReplyNotArrived na) {
	    final DevError[] errors = new DevError[1];
	    errors[0] = new DevError();
	    errors[0].severity = ErrSeverity.ERR;
	    errors[0].reason = "API_AsynReplyNotArrived";
	    errors[0].desc = "No reply for asynch request";
	    errors[0].origin = "GroupDeviceElement.write_attribute_reply";
	    final DevFailed e = new DevFailed(errors);
	    for (final String element : ar.obj_name) {
		rl.add(new GroupReply(get_name(), element, e));
	    }
	} catch (final DevFailed df) {
	    for (final String element : ar.obj_name) {
		rl.add(new GroupReply(get_name(), element, df));
	    }
	} catch (final Exception ex) {
	    final DevError[] errors = new DevError[1];
	    errors[0] = new DevError();
	    errors[0].severity = ErrSeverity.ERR;
	    errors[0].reason = "unknown exception caught";
	    errors[0].desc = "unknown error";
	    errors[0].origin = "GroupDeviceElemnt.write_attribute_reply";
	    final DevFailed e = new DevFailed(errors);
	    for (final String element : ar.obj_name) {
		rl.add(new GroupReply(get_name(), element, e));
	    }
	}
	arp.remove(rid_obj);
        return rl;
    }
444340
private void authorizeClassicDbSecurityGroup(String groupName, String sourceCidr) throws CloudException, InternalException {
        Map<String,String> parameters = getProvider().getStandardRdsParameters(getProvider().getContext(), AUTHORIZE_DB_SECURITY_GROUP_INGRESS);
        parameters.put("DBSecurityGroupName", groupName);
        parameters.put("CIDRIP", sourceCidr);
        EC2Method method = new EC2Method(SERVICE_ID, getProvider(), parameters);
        try {
            method.invoke();
        }
        catch( EC2Exception e ) {
            String code = e.getCode();
            if( code != null && code.equals("AuthorizationAlreadyExists") ) {
                return;
            }
            throw new CloudException(e);
        }
    }
1348597
def exec_command(attr, cmd):
    
    import subprocess

    p = popen(cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
    out, err = p.communicate()

    if p.returncode:
        from rez.exceptions import InvalidPackageError
        raise InvalidPackageError(
            "Error determining package attribute '%s':\n%s" % (attr, err))

    return out.strip(), err.strip()
531700
public void getGroupsForUser(List<String> grpMbrshipAttrs, int countLimit) throws Exception {
        throw new WIMApplicationException(WIMMessageKey.METHOD_NOT_IMPLEMENTED, Tr.formatMessage(tc, WIMMessageKey.METHOD_NOT_IMPLEMENTED));
    }
313742
private void getMessageDigestMD5() throws AttributeNotFoundException {
        if (MBeans.messageDigestMD5 == null) {
            try {
                MBeans.messageDigestMD5 = MessageDigestUtility.createMessageDigest("MD5");
            } catch (NoSuchAlgorithmException e) {
                Tr.error(tc, "DYNA1044E", new Object[] { e.getMessage() });
                throw new AttributeNotFoundException("Message digest for MD5 is not available. " + e.getMessage());
            }
        }
    }
317025
public void write_attribute_reply(final DeviceProxy deviceProxy, final int id, final int timeout)
            throws DevFailed {
        final int ms_to_sleep = 10;
        AsynReplyNotArrived except = null;
        final long t0 = System.currentTimeMillis();
        long t1 = t0;
        boolean done = false;
        while ((t1 - t0 < timeout || timeout == 0) && !done) {
            try {
                write_attribute_reply(deviceProxy, id);
                done = true;
            } catch (final AsynReplyNotArrived na) {
                except = na;
                // Wait a bit before retry
                try { Thread.sleep(ms_to_sleep); } catch (final InterruptedException e) { /* */ }
                t1 = System.currentTimeMillis();
            }
        }
        // If reply not arrived throw last exception
        if (!done) {
            throw except;
        }
    }
634182
private INDArray readDataSet(Group fileGroup, String datasetName)
            throws UnsupportedKerasConfigurationException {
        synchronized (Hdf5Archive.LOCK_OBJECT) {
            DataSet dataset = fileGroup.openDataSet(datasetName);
            DataSpace space = dataset.getSpace();
            int nbDims = space.getSimpleExtentNdims();
            long[] dims = new long[nbDims];
            space.getSimpleExtentDims(dims);
            float[] dataBuffer;
            FloatPointer fp;
            int j;
            INDArray data;
            switch (nbDims) {
                case 5: /* 3D Convolution weights */
                    dataBuffer = new float[(int) (dims[0] * dims[1] * dims[2] * dims[3] * dims[4])];
                    fp = new FloatPointer(dataBuffer);
                    dataset.read(fp, dataType);
                    fp.get(dataBuffer);
                    data = Nd4j.create((int) dims[0], (int) dims[1], (int) dims[2], (int) dims[3], (int) dims[4]);
                    j = 0;
                    for (int i1 = 0; i1 < dims[0]; i1++)
                        for (int i2 = 0; i2 < dims[1]; i2++)
                            for (int i3 = 0; i3 < dims[2]; i3++)
                                for (int i4 = 0; i4 < dims[3]; i4++)
                                    for (int i5 = 0; i5 < dims[4]; i5++)
                                        data.putScalar(new int[] { i1, i2, i3, i4, i5 }, dataBuffer[j++]);
                    break;
                case 4: /* 2D Convolution weights */
                    dataBuffer = new float[(int) (dims[0] * dims[1] * dims[2] * dims[3])];
                    fp = new FloatPointer(dataBuffer);
                    dataset.read(fp, dataType);
                    fp.get(dataBuffer);
                    data = Nd4j.create((int) dims[0], (int) dims[1], (int) dims[2], (int) dims[3]);
                    j = 0;
                    for (int i1 = 0; i1 < dims[0]; i1++)
                        for (int i2 = 0; i2 < dims[1]; i2++)
                            for (int i3 = 0; i3 < dims[2]; i3++)
                                for (int i4 = 0; i4 < dims[3]; i4++)
                                    data.putScalar(i1, i2, i3, i4, dataBuffer[j++]);
                    break;
                case 3:
                    dataBuffer = new float[(int) (dims[0] * dims[1] * dims[2])];
                    fp = new FloatPointer(dataBuffer);
                    dataset.read(fp, dataType);
                    fp.get(dataBuffer);
                    data = Nd4j.create((int) dims[0], (int) dims[1], (int) dims[2]);
                    j = 0;
                    for (int i1 = 0; i1 < dims[0]; i1++)
                        for (int i2 = 0; i2 < dims[1]; i2++)
                            for (int i3 = 0; i3 < dims[2]; i3++)
                                data.putScalar(i1, i2, i3, dataBuffer[j++]);
                    break;
                case 2: /* Dense and Recurrent weights */
                    dataBuffer = new float[(int) (dims[0] * dims[1])];
                    fp = new FloatPointer(dataBuffer);
                    dataset.read(fp, dataType);
                    fp.get(dataBuffer);
                    data = Nd4j.create((int) dims[0], (int) dims[1]);
                    j = 0;
                    for (int i1 = 0; i1 < dims[0]; i1++)
                        for (int i2 = 0; i2 < dims[1]; i2++)
                            data.putScalar(i1, i2, dataBuffer[j++]);
                    break;
                case 1: /* Bias */
                    dataBuffer = new float[(int) dims[0]];
                    fp = new FloatPointer(dataBuffer);
                    dataset.read(fp, dataType);
                    fp.get(dataBuffer);
                    data = Nd4j.create((int) dims[0]);
                    j = 0;
                    for (int i1 = 0; i1 < dims[0]; i1++)
                        data.putScalar(i1, dataBuffer[j++]);
                    break;
                default:
                    throw new UnsupportedKerasConfigurationException("Cannot import weights with rank " + nbDims);
            }
            space.deallocate();
            dataset.deallocate();
            return data;
        }
    }
698325
void manage_reply(int timeout)
	{
		switch (cmd_type)
		{
		case CMD:
			command_inout_reply(timeout);
			break;
		case ATT_R:
			read_attribute_reply(timeout);
			break;
		case ATT_W:
			write_attribute_reply(timeout);
			break;
		}
	}
946251
def attrget(self, groupname, attrname, rownr):
        """"""
        return self._attrget(groupname, attrname, rownr)
1008670
def setAccessPolicy(self, pid, accessPolicy, serialVersion, vendorSpecific=None):
        
        response = self.setAccessPolicyResponse(
            pid, accessPolicy, serialVersion, vendorSpecific
        )
        return self._read_boolean_response(response)
195681
def _getAttrGroupMember(self, attrGroup, attr):
        
        method_name = '%s_%s' % (attrGroup, attr)
        return getattr(self, method_name)
352134
def read_version(group):
    
    version = ('0.1' if 'version' not in group.attrs
               else group.attrs['version'])

    # decode from bytes to str if needed
    if isinstance(version, bytes):
        version = version.decode()

    if not is_supported_version(version):
        raise IOError('version {} is not supported'.format(version))

    return version
53384
def pretty_print(pp)
      return super if custom_inspect_method_defined?
      pp.object_address_group(self) do
        if defined?(@attributes) && @attributes
          attr_names = self.class.attribute_names.select { |name| has_attribute?(name) }
          pp.seplist(attr_names, proc { pp.text "," }) do |attr_name|
            pp.breakable " "
            pp.group(1) do
              pp.text attr_name
              pp.text ":"
              pp.breakable
              value = _read_attribute(attr_name)
              value = inspection_filter.filter_param(attr_name, value) unless value.nil?
              pp.pp value
            end
          end
        else
          pp.breakable " "
          pp.text "not initialized"
        end
      end
    end
316781
function serializeContentObjectAttribute( $package, $objectAttribute )
    {
        $node = $this->createContentObjectAttributeDOMNode( $objectAttribute );

        $stamp = $objectAttribute->attribute( 'data_int' );

        if ( $stamp !== null )
        {
            $dom = $node->ownerDocument;
            $dateTimeNode = $dom->createElement( 'date_time' );
            $dateTimeNode->appendChild( $dom->createTextNode( eZDateUtils::rfc1123Date( $stamp ) ) );
            $node->appendChild( $dateTimeNode );
        }
        return $node;
    }
1303931
function unserializeContentObjectAttribute( $package, $objectAttribute, $attributeNode )
    {
        if ( $attributeNode->hasChildNodes() )
        {
            $contentObjectAttributeID = $objectAttribute->attribute( 'id' );
            $contentObjectAttributeVersion = $objectAttribute->attribute( 'version' );

            $enumNodes = $attributeNode->childNodes;
            foreach ( $enumNodes as $enumNode )
            {
                $eID      = $enumNode->getAttribute( 'id' );
                $eValue   = $enumNode->getAttribute( 'value' );
                $eElement = $enumNode->getAttribute( 'element' );

                eZEnum::storeObjectEnumeration( $contentObjectAttributeID,
                                                $contentObjectAttributeVersion,
                                                $eID,
                                                $eElement,
                                                $eValue );
            }
        }
        else
        {
            eZDebug::writeError( "Can't find attributes for enumeration", __METHOD__ );
        }
    }
139468
private Group readGroup(Node groupNode) throws Exception
   {
      String groupName = groupNode.getName();
      String desc = utils.readString(groupNode, GroupProperties.JOS_DESCRIPTION);
      String label = utils.readString(groupNode, GroupProperties.JOS_LABEL);
      String parentId = utils.getGroupIds(groupNode).parentId;

      GroupImpl group = new GroupImpl(groupName, parentId);
      group.setInternalId(groupNode.getUUID());
      group.setDescription(desc);
      group.setLabel(label);

      return group;
   }
672514
def group_toggle(self, addr, use_cache=True):
        
        data = self.group_read(addr, use_cache)
        if len(data) != 1:
            problem = "Can't toggle a {}-octet group address {}".format(
                len(data), addr)
            logging.error(problem)
            raise KNXException(problem)

        if data[0] == 0:
            self.group_write(addr, [1])
        elif data[0] == 1:
            self.group_write(addr, [0])
        else:
            problem = "Can't toggle group address {} as value is {}".format(
                addr, data[0])
            logging.error(problem)
            raise KNXException(problem)