////////////////////////////////////////////////////////////////////////////////
// 'set-ref' subcommand.
779112
func cmdSetRef(params Parameters) *subcommands.Command {
	return &subcommands.Command{
		UsageLine: "set-ref <package or package prefix> [options]",
		ShortDesc: "moves a ref to point to a given version",
		LongDesc:  "Moves a ref to point to a given version.",
		CommandRun: func() subcommands.CommandRun {
			c := &setRefRun{}
			c.registerBaseFlags()
			c.refsOptions.registerFlags(&c.Flags)
			c.clientOptions.registerFlags(&c.Flags, params, withoutRootDir)
			c.Flags.StringVar(&c.version, "version", "<version>", "Package version to point the ref to.")
			return c
		},
	}
}
650797
def handle_set_command_list(self, line: str, position: int, tokens: ParseResults) -> ParseResults:
        """"""
        key, values = tokens['key'], tokens['values']
        for value in values:
            self.raise_for_invalid_annotation_value(line, position, key, value)
        self.annotations[key] = set(values)
        return tokens
525218
function nest (str, refs, escape) {
		var res = [], match

		var a = 0
		while (match = re.exec(str)) {
			if (a++ > 10e3) throw Error('Circular references in parenthesis')

			res.push(str.slice(0, match.index))

			res.push(nest(refs[match[1]], refs))

			str = str.slice(match.index + match[0].length)
		}

		res.push(str)

		return res
	}
823166
public SubCommandSet add(SubCommand<SubCommandDef> subCommand) {
        if (subCommandMap.containsKey(subCommand.getName())) {
            throw new IllegalArgumentException("SubCommand with name " + subCommand.getName() + " already exists");
        }
        this.subCommands.add(subCommand);
        this.subCommandMap.put(subCommand.getName(), subCommand);
        for (String alias : subCommand.getAliases()) {
            if (subCommandMap.containsKey(alias)) {
                throw new IllegalArgumentException("SubCommand (" + subCommand.getName() + ") alias " + alias + " already exists");
            }
            this.subCommandMap.put(alias, subCommand);
        }
        return this;
    }
501776
function initializeCommands() {
        var prefs = getPreferences();

        CommandManager.register(Strings.CMD_FILE_CLOSE_BELOW, closeBelow, function () {
            handleClose(closeBelow);
        });
        CommandManager.register(Strings.CMD_FILE_CLOSE_OTHERS, closeOthers, function () {
            handleClose(closeOthers);
        });
        CommandManager.register(Strings.CMD_FILE_CLOSE_ABOVE, closeAbove, function () {
            handleClose(closeAbove);
        });

        if (prefs.closeBelow) {
            workingSetListCmenu.addMenuItem(closeBelow, "", Menus.AFTER, Commands.FILE_CLOSE);
        }
        if (prefs.closeOthers) {
            workingSetListCmenu.addMenuItem(closeOthers, "", Menus.AFTER, Commands.FILE_CLOSE);
        }
        if (prefs.closeAbove) {
            workingSetListCmenu.addMenuItem(closeAbove, "", Menus.AFTER, Commands.FILE_CLOSE);
        }
        menuEntriesShown = prefs;
    }
241345
@Override
    public void setRef(int parameterIndex, Ref x) throws SQLException {
        internalStmt.setRef(parameterIndex, x);
    }
244717
function simpleRef(ref) {
  if (!ref) {
    return null;
  }
  var index = ref.lastIndexOf('/');
  if (index >= 0) {
    ref = ref.substr(index + 1);
  }
  return toClassName(ref);
}
760166
function setInvocation(commandItem) {
			var command = commandItem.command;
			if (!command.visibleWhen || command.visibleWhen(item)) {
				commandItem.invocation = new mCommands.CommandInvocation(item, item, null, command, commandRegistry);
				return new Deferred().resolve(commandItem);
			} else if (typeof alternateItem === "function") {
				if (!alternateItemDeferred) {
					alternateItemDeferred = alternateItem();
				}
				return Deferred.when(alternateItemDeferred, function (newItem) {
					if (newItem && (item === pageItem)) {
						// there is an alternate, and it still applies to the current page target
						if (!command.visibleWhen || command.visibleWhen(newItem)) {
							commandItem.invocation = new mCommands.CommandInvocation(newItem, newItem, null, command, commandRegistry);
							return commandItem;
						}
					}
				});
			}
			return new Deferred().resolve();
		}
1004467
func (s *ContainerDetail) SetCommand(v []*string) *ContainerDetail {
	s.Command = v
	return s
}
592153
function setOptions(command, query) {
  var count, opts;

  command = commands[command];
  if (!command) {
    return;
  }

  opts = {};
  count = Object.keys(query).length;

  [options.common].concat(command.options).some(function someTypes(options) {
    if (!options) {
      return;
    }
    Object.keys(options).some(function someOptions(key) {
      var valid = options[key].valid;

      if (key in query) {
        if (options[key].bool) {
          opts[options[key].name] = !reBool.test(query[key]);
        } else if (!valid || (valid && valid.test(query[key]))) {
          opts[options[key].name] = decodeURIComponent(query[key]);
        }
        count -= 1;
      }

      return count === 0;
    });

    return count === 0;
  });

  return opts;
}
65801
def set_reference(self,ref):
    
    self._options = self._options._replace(reference = ref)
114567
def __sub_del_reference(self, req, key):
        """"""
        if not req.success:
            try:
                self.__new_subs.pop(key)
            except KeyError:
                logger.warning('No sub ref %s', key)
297923
public void write_ref(OtpErlangRef ref) {
	int[] ids = ref.ids();
        int arity = ids.length;

	write1(ref.tag());
	write2BE(arity);
	write_atom(ref.node());

	switch (ref.tag()) {
	case OtpExternal.newRefTag:
	    write1(ref.creation());
	    write4BE(ids[0] & 0x3ffff); // first word gets truncated to 18 bits
	    break;
	case OtpExternal.newerRefTag:
	    write4BE(ref.creation());
	    write4BE(ids[0]); // full first word
	    break;
	default:
	    throw new AssertionError("Invalid ref tag " + ref.tag());
	}

	for (int i = 1; i < arity; i++) {
	    write4BE(ids[i]);
	}
    }
885516
function(setname, cb){
      client.smembers(setname, function(e,d){
        if(e) return console.error(e)
        console.log("\nPrinting set members for set %s", setname)
        console.dir(d)
        cb && cb(e,d)
      })
    }
1027930
function ForCommand(value, engine) {
        var rule = new RegExp(
            stringFormat(
                /* jshint ignore:start */
                '^\\s*({0}[\\s\\S]+{1})\\s+as\\s+{0}([0-9a-z_]+){1}\\s*(,\\s*{0}([0-9a-z_]+){1})?\\s*$',
                /* jshint ignore:end */
                regexpLiteral(engine.options.variableOpen),
                regexpLiteral(engine.options.variableClose)
            ),
            'i'
        );


        var match = value.match(rule);
        if (!match) {
            throw new Error('Invalid ' + this.type + ' syntax: ' + value);
        }

        this.list = match[1];
        this.item = match[2];
        this.index = match[4];
        Command.call(this, value, engine);
        this.cloneProps = ['list', 'item', 'index'];
    }
945896
function Ops (ref, key) {
		this.ref = ref;
		this.key = key;

		if (this.ref[this.key] === undefined) {
			this.ref[this.key] = 0;
		}
		this._toNumber();

		this.isNumber = (typeof this.ref[this.key] === 'number');
		this.isBoolean = (typeof this.ref[this.key] === 'boolean');
		this.isString = (typeof this.ref[this.key] === 'string');
		this.isArray = Array.isArray(this.ref[this.key]);
		this.isObject = (!this.isArray && typeof this.ref[this.key] === 'object');
	}
89485
def modify_usage_error(subcommand, program_list):
    
    import click
    from click._compat import get_text_stderr
    from click.utils import echo

    def show(self, file=None):
        import sys
        if file is None:
            file = get_text_stderr()
        color = None
        if self.ctx is not None:
            color = self.ctx.color
        echo('Error: %s\n' % self.format_message(), file=file, color=color)
        # Set the sys.argv to be the first two arguments passed to the script if the subcommand was specified
        arg2 = sys.argv[1] if sys.argv[1] in program_list else str()
        sys.argv = [' '.join([sys.argv[0], arg2])] if arg2 else [sys.argv[0]]
        # Call the help
        subcommand(['--help'])

    click.exceptions.UsageError.show = show