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

	} catch (final DevFailed df) {
	    for (final String element : ar.obj_name) {
		rl.add(new GroupCmdReply(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.command_inout";
	    final DevFailed e = new DevFailed(errors);
	    for (final String element : ar.obj_name) {
		rl.add(new GroupCmdReply(get_name(), element, e));
	    }
	}
	arp.remove(rid_obj);
	return rl;
    }
416018
public DeviceData command_inout(TacoTangoDevice tacoDevice, String command, DeviceData argin) throws DevFailed {
        Except.throw_exception("Api_TacoFailed",
                "Taco protocol not supported",
                "TacoTangoDeviceDAODefaultImpl.command_inout()");
        return null;
    }
390079
def in_reply_to(self) -> Optional[UnstructuredHeader]:
        """"""
        try:
            return cast(UnstructuredHeader, self[b'in-reply-to'][0])
        except (KeyError, IndexError):
            return None
25839
def cli(ctx, group, organism_name, administrate=False, write=False, read=False, export=False):
    
    return ctx.gi.groups.update_organism_permissions(group, organism_name, administrate=administrate, write=write, read=read, export=export)
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;
    }
790183
function SetupCLI(execName, packageJson, Commands, args) {
  assert(_.isString(execName), 'execName must be a string.');
  assert(_.isObject(packageJson), 'packageJson must be an object.');
  assert(_.isObject(Commands), 'Command collection must be an object.');
  assert(_.isObject(args), 'Arguments must be an object.');

  // --version or -v triggers npm version check.
  if (args.version || args.v) {
    const progName = packageJson.title || packageJson.name || process.argv[0];
    console.log(`${progName} ${ShowVersion(packageJson)}`);
    return process.exit(0);
  }

  // Remove 'color' flags if present.
  if ('color' in args) {
    delete args.color;
  }

  // The first positional (non-option) argument is the sub-command to run.
  const cmdName = _.first(args._);
  if (!cmdName) {
    console.error(GetCommandList(execName, packageJson, Commands));
    return process.exit(1);
  }
  const cmd = global.COMMAND = Commands[cmdName];
  if (!cmd) {
    console.error(col.fatal(`Unknown command "${col.bold(cmdName)}".`));
    return process.exit(1);
  }

  // Show command-specific help.
  if (args.help || args.h) {
    console.error(GetCommandUsage(execName, packageJson, cmd, args));
    return process.exit(1);
  }

  // Parse command-line parameters
  try {
    args = ParseArguments(cmd, args);
  } catch (e) {
    console.error(col.fatal(e.message));
    return process.exit(1);
  }

  return args;
}
1072098
public GroupAttrReplyList (final int rid, final int tmo) throws DevFailed {
	final Integer rid_obj = new Integer(rid);
	final Boolean fwd = (Boolean) arp.get(rid_obj);
	if (fwd == null) {
	    Except.throw_exception("API_BadAsynPollId", "Invalid asynch. request identifier specified",
		    "Group.read_inout_reply");
	}
	arp.remove(rid_obj);
	return _i(rid, tmo, fwd.booleanValue());
    }
450412
def _apply_dvportgroup_out_shaping(pg_name, out_shaping, out_shaping_conf):
    '''
    
    '''
    log.trace('Building portgroup\'s \'%s\' out shaping policy', pg_name)
    if out_shaping_conf.get('average_bandwidth'):
        out_shaping.averageBandwidth = vim.LongPolicy()
        out_shaping.averageBandwidth.value = \
                out_shaping_conf['average_bandwidth']
    if out_shaping_conf.get('burst_size'):
        out_shaping.burstSize = vim.LongPolicy()
        out_shaping.burstSize.value = out_shaping_conf['burst_size']
    if 'enabled' in out_shaping_conf:
        out_shaping.enabled = vim.BoolPolicy()
        out_shaping.enabled.value = out_shaping_conf['enabled']
    if out_shaping_conf.get('peak_bandwidth'):
        out_shaping.peakBandwidth = vim.LongPolicy()
        out_shaping.peakBandwidth.value = out_shaping_conf['peak_bandwidth']
856636
function initializePackageMaintainer( $package, $http, $step, &$persistentData, $tpl )
    {
        $maintainerPerson = false;
        $maintainerEmail = false;
        $user = eZUser::currentUser();
           $userObject = $user->attribute( 'contentobject' );
        if ( $userObject )
            $maintainerPerson = $userObject->attribute( 'name' );
        $maintainerEmail = $user->attribute( 'email' );
        $persistentData['maintainer_person'] = $maintainerPerson;
        $persistentData['maintainer_email'] = $maintainerEmail;
        $persistentData['maintainer_role'] = false;
    }
589
def cli(env):
    """"""
    table = formatting.Table([
        'Id', 'Name', 'Created', 'Expiration', 'Status', 'Package Name', 'Package Id'
    ])
    table.align['Name'] = 'l'
    table.align['Package Name'] = 'r'
    table.align['Package Id'] = 'l'

    manager = ordering.OrderingManager(env.client)
    items = manager.get_quotes()

    for item in items:
        package = item['order']['items'][0]['package']
        table.add_row([
            item.get('id'),
            item.get('name'),
            clean_time(item.get('createDate')),
            clean_time(item.get('modifyDate')),
            item.get('status'),
            package.get('keyName'),
            package.get('id')
        ])
    env.fout(table)
17512
def cli(env, package_keyname):
    
    manager = ordering.OrderingManager(env.client)
    table = formatting.Table(COLUMNS)

    locations = manager.package_locations(package_keyname)
    for region in locations:
        for datacenter in region['locations']:
            table.add_row([
                datacenter['location']['id'],
                datacenter['location']['name'],
                region['description'],
                region['keyname']
            ])
    env.fout(table)
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);
		}
	});
}
661086
public void parseUnixListReply(String reply)
        throws FTPException {
        if (reply == null) return;

        StringTokenizer tokens = new StringTokenizer(reply);
        String token, previousToken;

        int numTokens = tokens.countTokens();

        if (numTokens < 8) {
            throw new FTPException(FTPException.UNSPECIFIED,
                           "Invalid number of tokens in the list reply [" +
                                   reply + "]");
        }

        token = tokens.nextToken();

        // permissions
        switch( token.charAt(0) ) {
        case 'd':
            setFileType(DIRECTORY_TYPE); break;
        case '-':
            setFileType(FILE_TYPE); break;
        case 'l':
            setFileType(SOFTLINK_TYPE); break;
        case 'c':
        case 'b':
            // do not try to parse device entries;
            // they aren't important anyway
            setFileType(DEVICE_TYPE);
            return;
        default:
            setFileType(UNKNOWN_TYPE);
        }

        try {
            for(int i=1;i<=9;i++) {
                if (token.charAt(i) != '-') {
                    mode += 1 << (9 - i);
                }
            }
        } catch (IndexOutOfBoundsException e) {
            throw new FTPException(FTPException.UNSPECIFIED,
                                   "Could not parse access permission bits");
        }


        // ??? can ignore
        tokens.nextToken();

        // next token is the owner
        tokens.nextToken();

        // In ls from System V, next token is the group
        // In ls from Berkeley (BSD), group token is missing
        previousToken = tokens.nextToken();

        // size
        token = tokens.nextToken();

        /*
         * if the group is missing this will try to parse the date field
         * as an integer and will fail. if so, then the previous field is the size field
         * and the current token is part of the date.
         */
        try {
            setSize( Long.parseLong(token) );
            token = null;
        } catch(NumberFormatException e) {
            // this might mean that the group is missing
            // and this token is part of date.
            try {
                setSize( Long.parseLong(previousToken) );
            } catch(NumberFormatException ee) {
                throw new FTPException(FTPException.UNSPECIFIED,
                                       "Invalid size number in the ftp reply [" +
                                       previousToken + ", " + token + "]");
            }
        }

        // date - two fields together
        if (token == null) {
            token = tokens.nextToken();
        }
        String month = token;
        setDate(token + " " + tokens.nextToken());

        //next token is either date or time
        token = tokens.nextToken();
        this.setTime(token);

        // this is to handle spaces in the filenames
        // as well filenames with dates in them
        int ps = reply.indexOf(month);
        if (ps == -1) {
            // this should never happen
            throw new FTPException(FTPException.UNSPECIFIED,
                                   "Could not find date token");
        } else {
            ps = reply.indexOf(this.time, ps+month.length());
            if (ps == -1) {
                // this should never happen
                throw new FTPException(FTPException.UNSPECIFIED,
                                       "Could not find time token");
            } else {
                this.setName(reply.substring(1+ps+this.time.length()));
            }
        }
    }
726424
@Override
    int command_inout_asynch_i(final String c, final boolean fgt, final boolean fwd, final int rid) throws DevFailed {
	try {
	    final int actual_rid = proxy.command_inout_asynch(c, fgt);
	    if (fgt == false) {
		arp.put(new Integer(rid), new AsynchRequest(actual_rid, c));
	    }
	} catch (final DevFailed df) {
	    if (fgt == false) {
		arp.put(new Integer(rid), new AsynchRequest(-1, c, df));
	    }
	} catch (final Exception e) {
	    if (fgt == false) {
		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.command_inout";
		final DevFailed ex = new DevFailed(errors);
		arp.put(new Integer(rid), new AsynchRequest(-1, c, ex));
	    }
	}
	return rid;
    }
535210
public final void checkApplicableIn(ItemGroup parent) {
        if (!isApplicableIn(parent)) {
            throw new AccessDeniedException(
                    Messages.TopLevelItemDescriptor_NotApplicableIn(getDisplayName(), parent.getFullDisplayName()));
        }
    }
185832
def enter_unlinking_mode(self, group):
        
        msg = StandardSend(self._address,
                           COMMAND_ENTER_UNLINKING_MODE_0X0A_NONE,
                           cmd2=group)
        self._send_msg(msg)
428017
def cmd(send, msg, args):
    
    users = get_users(args)
    if " into " in msg and msg != "into":
        match = re.match('(.*) into (.*)', msg)
        if match:
            msg = 'throws %s into %s' % (match.group(1), match.group(2))
            send(msg, 'action')
        else:
            return
    elif " at " in msg and msg != "at":
        match = re.match('(.*) at (.*)', msg)
        if match:
            msg = 'throws %s at %s' % (match.group(1), match.group(2))
            send(msg, 'action')
        else:
            return
    elif msg:
        msg = 'throws %s at %s' % (msg, choice(users))
        send(msg, 'action')
    else:
        send("Throw what?")
        return