read_attribute_reply_i - access limited to package Group
180994
@Override
    GroupAttrReplyList read_attribute_reply_i(final int rid, final int tmo, final boolean fwd) throws DevFailed {
	final Integer rid_obj = new Integer(rid);
	final GroupAttrReplyList rl = new GroupAttrReplyList();
	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.read_attribute_reply";
	    final DevFailed e = new DevFailed(errors);
	    rl.add(new GroupAttrReply(get_name(), "unknown", e));
	    return rl;
	}
	if (ar.req_id == -1) {
	    for (final String element : ar.obj_name) {
		rl.add(new GroupAttrReply(get_name(), element, ar.exception));
	    }
	    arp.remove(rid_obj);
	    return rl;
	}
	try {

	    final DeviceAttribute[] das = proxy.read_attribute_reply(ar.req_id, tmo);
	    int i = 0;
	    for (final String element : ar.obj_name) {
		rl.add(new GroupAttrReply(get_name(), element, das[i++]));
	    }
	} 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.read_attribute_reply";
	    final DevFailed e = new DevFailed(errors);
	    for (final String element : ar.obj_name) {
		rl.add(new GroupAttrReply(get_name(), element, e));
	    }
	} catch (final DevFailed df) {
	    for (final String element : ar.obj_name) {
		rl.add(new GroupAttrReply(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.read_attribute_reply";
	    final DevFailed e = new DevFailed(errors);
	    for (final String element : ar.obj_name) {
		rl.add(new GroupAttrReply(get_name(), element, e));
	    }
	}
	arp.remove(rid_obj);
	return rl;
    }
104508
private AttributeDataset parse(String name, Attribute[] attributes, BufferedReader reader) throws IOException, ParseException {
        String line = reader.readLine();
        while (line != null) {
            if (line.isEmpty() || line.startsWith(comment)) {
                line = reader.readLine();
            } else {
                break;
            }
        }

        if (line == null) {
            throw new IOException("Empty data source.");
        }

        if (hasRowNames) {
            addIgnoredColumn(0);
        }

        String[] s = line.split(delimiter, 0);

        int p = s.length - ignoredColumns.size();

        if (p <= 0) {
          throw new IllegalArgumentException("There are more ignored columns (" + ignoredColumns.size() + ") than columns in the file (" + s.length + ").");
        }

        if (responseIndex >= s.length) {
          throw new ParseException("Invalid response variable index: " + responseIndex, responseIndex);
        }

        if (ignoredColumns.contains(responseIndex)) {
          throw new IllegalArgumentException("The response variable is present in the list of ignored columns.");
        }

        if (p == 1) {
          throw new IllegalArgumentException("All columns are ignored, except the response variable.");
        }

        if (responseIndex >= 0) {
          p--;
        }

        if (attributes == null) {
            attributes = new Attribute[p];
            for (int i = 0, k = 0; i < s.length; i++) {
                if (!ignoredColumns.contains(i) && i != responseIndex) {
                    attributes[k++] = new NumericAttribute("V" + (i + 1));
                }
            }
        }

        int ncols = attributes.length;

        if (responseIndex >= 0) {
            ncols++;
        }

        ncols += ignoredColumns.size();

        if (ncols != s.length)
            throw new ParseException(String.format("%d columns, expected %d", s.length, ncols), s.length);

        AttributeDataset data = new AttributeDataset(name, attributes, response);

        if (hasColumnNames) {
            for (int i = 0, k = 0; i < s.length; i++) {
                if (!ignoredColumns.contains(i)) {
                    if (i != responseIndex) {
                        attributes[k++].setName(s[i]);
                    } else {
                        response.setName(s[i]);
                    }
                }
            }
        } else {
            String rowName = hasRowNames ? s[0] : null;
            double[] x = new double[attributes.length];
            double y = Double.NaN;

            for (int i = 0, k = 0; i < s.length; i++) {
                if (!ignoredColumns.contains(i)) {
                    if (i == responseIndex) {
                        y = response.valueOf(s[i]);
                    } else if (missing != null && missing.equalsIgnoreCase(s[i])) {
                        x[k++] = Double.NaN;
                    } else {
                        x[k] = attributes[k].valueOf(s[i]);
                        k++;
                    }
                }
            }

            AttributeDataset.Row datum = Double.isNaN(y) ? data.add(x) : data.add(x, y);
            datum.name = rowName;
        }

        while ((line = reader.readLine()) != null) {
            if (line.isEmpty() || line.startsWith(comment)) {
                continue;
            }

            s = line.split(delimiter, 0);
            if (s.length != ncols) {
                throw new ParseException(String.format("%d columns, expected %d", s.length, ncols), s.length);
            }

            String rowName = hasRowNames ? s[0] : null;
            double[] x = new double[attributes.length];
            double y = Double.NaN;

            for (int i = 0, k = 0; i < s.length; i++) {
                if (!ignoredColumns.contains(i)) {
                    if (i == responseIndex) {
                        y = response.valueOf(s[i]);
                    } else if (missing != null && missing.equalsIgnoreCase(s[i])) {
                        x[k++] = Double.NaN;
                    } else {
                        x[k] = attributes[k].valueOf(s[i]);
                        k++;
                    }
                }
            }

            AttributeDataset.Row datum = Double.isNaN(y) ? data.add(x) : data.add(x, y);
            datum.name = rowName;
        }

        return data;
    }
503074
def read(self, req, ino, size, off, fi):
        
        self.reply_err(req, errno.EIO)
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;
        }
    }
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()
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());
            }
        }
    }
1166697
function unserializeContentObjectAttribute( $package, $objectAttribute, $attributeNode )
    {
        $userNode = $attributeNode->getElementsByTagName( 'account' )->item( 0 );
        if ( is_object( $userNode ) )
        {
            $userID = $objectAttribute->attribute( 'contentobject_id' );
            $user = eZUser::fetch( $userID );
            if ( !is_object( $user ) )
            {
                $user = eZUser::create( $userID );
            }
            $user->setAttribute( 'login', $userNode->getAttribute( 'login' ) );
            $user->setAttribute( 'email', $userNode->getAttribute( 'email' ) );
            $user->setAttribute( 'password_hash', $userNode->getAttribute( 'password_hash' ) );
            $user->setAttribute( 'password_hash_type', eZUser::passwordHashTypeID( $userNode->getAttribute( 'password_hash_type' ) ) );
            $user->store();
        }
    }
828515
private String readAttributeAsString(Attribute attribute) throws UnsupportedKerasConfigurationException {
        synchronized (Hdf5Archive.LOCK_OBJECT) {
            VarLenType vl = attribute.getVarLenType();
            int bufferSizeMult = 1;
            String s = null;
            /* TODO: find a less hacky way to do this.
             * Reading variable length strings (from attributes) is a giant
             * pain. There does not appear to be any way to determine the
             * length of the string in advance, so we use a hack: choose a
             * buffer size and read the config, increase buffer and repeat
             * until the buffer ends with \u0000
             */
            while (true) {
                byte[] attrBuffer = new byte[bufferSizeMult * 2000];
                BytePointer attrPointer = new BytePointer(attrBuffer);
                attribute.read(vl, attrPointer);
                attrPointer.get(attrBuffer);
                s = new String(attrBuffer);

                if (s.endsWith("\u0000")) {
                    s = s.replace("\u0000", "");
                    break;
                }

                bufferSizeMult++;
                if (bufferSizeMult > 1000) {
                    throw new UnsupportedKerasConfigurationException("Could not read abnormally long HDF5 attribute");
                }
            }
            vl.deallocate();
            return s;
        }
    }
1109446
function getPackageSet(index, callback) {
	var page = {
		limit  : 100,
		offset : index*100
	}

	ckan.exec('current_package_list_with_resources', page, function(err, resp){
		checkError(err, resp);
		
		for( var i = 0; i < resp.result.length; i++ ) {
			data.packages[resp.result[i].id] = resp.result[i];
		}

		if( resp.result.length == 0 ) {
			if( callback ) callback();
		} else {
			if( options.debug ) console.log("CKAN EXPORT: Package data loaded ("+(index*100)+" to "+((index+1)*100)+")");
			index++;
			getPackageSet(index, callback);
		}
	});
}
1260162
private void requestPermissionForInstallPackage() {
        AndPermission.with(this)
            .runtime()
            .permission(Permission.Group.STORAGE)
            .rationale(new RuntimeRationale())
            .onGranted(new Action<List<String>>() {
                @Override
                public void onAction(List<String> data) {
                    new WriteApkTask(MainActivity.this, new Runnable() {
                        @Override
                        public void run() {
                            installPackage();
                        }
                    }).execute();
                }
            })
            .onDenied(new Action<List<String>>() {
                @Override
                public void onAction(List<String> data) {
                    toast(R.string.message_install_failed);
                }
            })
            .start();
    }
498119
public void read_attribute_asynch(final DeviceProxy deviceProxy, final String[] attnames,
            final CallBack cb) throws DevFailed {
        final int id = read_attribute_asynch(deviceProxy, attnames);
        ApiUtil.set_async_reply_model(id, CALLBACK);
        ApiUtil.set_async_reply_cb(id, cb);

        // if push callback, start a thread to do it
        if (ApiUtil.get_asynch_cb_sub_model() == PUSH_CALLBACK) {
            final AsyncCallObject aco = ApiUtil.get_async_object(id);
            new CallbackThread(aco).start();
        }
    }
244588
private void addAttributes(SubscriberRegistration subscriberRegistration, String group) {

        // if group == null; group = "DEFAULT_GROUP"
        if (StringUtils.isNotEmpty(group)) {
            subscriberRegistration.setGroup(group);
        }

        subscriberRegistration.setScopeEnum(ScopeEnum.global);
    }
891474
def access(self, req, ino, mask):
        
        self.reply_err(req, errno.ENOSYS)
570932
def groups_set_read_only(self, room_id, read_only, **kwargs):
        """"""
        return self.__call_api_post('groups.setReadOnly', roomId=room_id, readOnly=bool(read_only), kwargs=kwargs)
776087
def group_get_info(attribs, dir_info)
      attribs = group_record_name_alternatives(attribs)

      check_critical_attribute( attribs, :record_name )

      command = {action: 'read', scope: 'Groups', value: nil}
      user_attrs = attribs.merge(command)

      dscl( user_attrs, dir_info )
    end
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);
        }
    }
1283486
def group_read(self, addr, use_cache=True, timeout=1):
        """"""
        if use_cache:
            res = self.value_cache.get(addr)
            if res:
                logging.debug(
                    "Got value of group address %s from cache: %s", addr, res)
                return res

        cemi = CEMIMessage()
        cemi.init_group_read(addr)

        with self._lock:
            # There might be old messages in the result quue, remove them
            self.result_queue.queue.clear()
            self.send_tunnelling_request(cemi)
            # Wait for the result
            try:
                res = self.result_queue.get(block=True, timeout=timeout)
            except queue.Empty:
                return None

            self.result_queue.task_done()
            return res