specify a toolchain
 hash supports:
 * :command
185722
def toolchain(name, tc)
      raise "not a tc" unless tc.is_a?(Hash)
      check_hash(tc, Cxxproject::Toolchain::Provider.default.keys)
      check_compiler(tc[:COMPILER]) if tc[:COMPILER]
      check_linker(tc[:LINKER]) if tc[:LINKER]
      check_archiver(tc[:ARCHIVER]) if tc[:ARCHIVER]
      PluginContext::expand(tc)
      Cxxproject::Toolchain::Provider.add(name)
      Cxxproject::Toolchain::Provider.merge(Cxxproject::Toolchain::Provider[name], tc)
    end
8353
def git_call(command, verbose = debug_mode, enforce_success = false)
      if verbose
        puts
        puts "  git #{command}"
        puts
      end

      output = `git #{command}`
      puts output if verbose and not output.empty?

      if enforce_success and not command_successful?
        puts output unless output.empty?
        raise ::GitReview::UnprocessableState
      end

      output
    end
1243759
def run_command(self, args=None, node_paths=None):
    """"""
    return command_gen(
      self.tool_installations,
      self.name,
      args=args,
      node_paths=node_paths
    )
19310
def diff_as_hash(diff_command, opts=[])
      command_lines(diff_command, opts).inject({}) do |memo, line|
        info, file = line.split("\t")
        mode_src, mode_dest, sha_src, sha_dest, type = info.split

        memo[file] = {
          :mode_index => mode_dest,
          :mode_repo => mode_src.to_s[1, 7],
          :path => file,
          :sha_repo => sha_src,
          :sha_index => sha_dest,
          :type => type
        }

        memo
      end
    end
1153455
def method_missing(cmd, options={}, *args, &block)
      native(cmd, options, *args, &block)
    end
1328281
def _cmd(self, command, data=None, params=None, api_version=1):
    
    return self._post("commands/" + command, ApiCommand,
        data=data, params=params, api_version=api_version)
312368
def set(key, opts = nil)
      fail ArgumentError, 'Second argument must be a hash' unless opts.is_a?(Hash)
      path  = key_endpoint + key
      payload = {}
      [:ttl, :value, :dir, :prevExist, :prevValue, :prevIndex].each do |k|
        payload[k] = opts[k] if opts.key?(k)
      end
      response = api_execute(path, :put, params: payload)
      Response.from_http_response(response)
    end
968641
def _call_zincrby(self, command, value, *args, **kwargs):
        
        if self.indexable:
            self.index([value])
        return self._traverse_command(command, value, *args, **kwargs)
600283
def command(command_name, *args)
      response_key = "#{command_name}_response".to_sym
      result_key = "#{command_name}_result".to_sym

      message = args.last.is_a?(Hash) ? args.pop : {}
      result = @client.call command_name,
                            cookies: @auth_cookie,
                            message: { :token => @login_token }.merge(message)

      result.hash[:envelope][:body][response_key][result_key]
    end
3301
def options
      Hash[
        DeskApi::Configuration.keys.map do |key|
          [key, instance_variable_get(:"@#{key}")]
        end
      ]
    end
1002510
def run_command(self, command):
        
        if not isinstance(command, basestring):
            raise ValueError("command must be a string")
        return self._ssh_client.run_gerrit_command(command)
639708
def main():
    
   
    argparser = argparse.ArgumentParser(
            description='Blockstack-file version {}'.format(__version__))

    subparsers = argparser.add_subparsers(
            dest='action', help='The file command to take [get/put/delete]')

    parser = subparsers.add_parser(
            'init',
            help='Initialize this host to start sending and receiving files')
    parser.add_argument(
            '--config', action='store',
            help='path to the config file to use (default is %s)' % CONFIG_PATH)
    parser.add_argument(
            '--blockchain_id', action='store',
            help='the recipient blockchain ID to use'),
    parser.add_argument(
            '--hostname', action='store',
            help='the recipient hostname to use')

    parser = subparsers.add_parser(
            'reset',
            help='Reset this host\'s key')
    parser.add_argument(
            '--config', action='store',
            help='path to the config file to use (default is %s)' % CONFIG_PATH)
    parser.add_argument(
            '--blockchain_id', action='store',
            help='the recipient blockchain ID to use'),
    parser.add_argument(
            '--hostname', action='store',
            help='the recipient hostname to use')

    parser = subparsers.add_parser(
            'get',
            help='Get a file')
    parser.add_argument(
            '--config', action='store',
            help='path to the config file to use (default is %s)' % CONFIG_PATH)
    parser.add_argument(
            '--blockchain_id', action='store',
            help='the recipient blockchain ID to use'),
    parser.add_argument(
            '--hostname', action='store',
            help='the recipient hostname to use')
    parser.add_argument(
            '--passphrase', action='store',
            help='decryption passphrase')
    parser.add_argument(
            '--wallet', action='store',
            help='path to your Blockstack wallet')
    parser.add_argument(
            'sender_blockchain_id', action='store',
            help='the sender\'s blockchain ID')
    parser.add_argument(
            'data_name', action='store',
            help='Public name of the file to fetch')
    parser.add_argument(
            'output_path', action='store', nargs='?',
            help='[optional] destination path to save the file; defaults to stdout')

    parser = subparsers.add_parser(
            'put',
            help='Share a file')
    parser.add_argument(
            '--config', action='store',
            help='path to the config file to use (default is %s)' % CONFIG_PATH)
    parser.add_argument(
            '--blockchain_id', action='store',
            help='the sender blockchain ID to use'),
    parser.add_argument(
            '--hostname', action='store',
            help='the sender hostname to use')
    parser.add_argument(
            '--passphrase', action='store',
            help='encryption passphrase')
    parser.add_argument(
            '--wallet', action='store',
            help='path to your Blockstack wallet')
    parser.add_argument(
            'input_path', action='store',
            help='Path to the file to share')
    parser.add_argument(
            'data_name', action='store',
            help='Public name of the file to store')
    # recipients come afterwards


    parser = subparsers.add_parser(
            'delete',
            help='Delete a shared file')
    parser.add_argument(
            '--config', action='store',
            help='path to the config file to use (default is %s)' % CONFIG_PATH)
    parser.add_argument(
            '--blockchain_id', action='store',
            help='the sender blockchain ID to use'),
    parser.add_argument(
            '--hostname', action='store',
            help='the sender hostname to use')
    parser.add_argument(
            '--wallet', action='store',
            help='path to your Blockstack wallet')
    parser.add_argument(
            'data_name', action='store',
            help='Public name of the file to delete')

    args, unparsed = argparser.parse_known_args()

    # load up config
    config_path = args.config
    if config_path is None:
        config_path = CONFIG_PATH

    conf = get_config( config_path )
    config_dir = os.path.dirname(config_path)
    blockchain_id = getattr(args, "blockchain_id", None)
    hostname = getattr(args, "hostname", None)
    passphrase = getattr(args, "passphrase", None)
    data_name = getattr(args, "data_name", None)
    wallet_path = getattr(args, "wallet", None)

    if blockchain_id is None:
        blockchain_id = conf['blockchain_id']

    if hostname is None:
        hostname = conf['hostname']

    if wallet_path is None:
        wallet_path = conf['wallet']
    
    if wallet_path is None and config_dir is not None:
        wallet_path = os.path.join(config_dir, blockstack_client.config.WALLET_FILENAME)

    # load wallet 
    if wallet_path is not None and os.path.exists( wallet_path ):
        # load from disk
        log.debug("Load wallet from %s" % wallet_path)
        wallet = blockstack_client.load_wallet( config_dir=config_dir, wallet_path=wallet_path, include_private=True )
        if 'error' in wallet:
            print >> sys.stderr, json.dumps(wallet, sort_keys=True, indent=4 )
            sys.exit(1)

        else:
            wallet = wallet['wallet']

    else:
        # load from RPC
        log.debug("Load wallet from RPC")
        wallet = blockstack_client.dump_wallet(config_path=config_path)
        if 'error' in wallet:
            print >> sys.stderr, json.dumps(wallet, sort_keys=True, indent=4)
            sys.exit(1)

    log.debug("Process %s" %  args.action)
    if args.action in ['init', 'reset']:
        # (re)key
        res = file_key_regenerate( blockchain_id, hostname, config_path=config_path, wallet_keys=wallet ) 
        if 'error' in res:
            print >> sys.stderr, json.dumps(res, sort_keys=True, indent=4 )
            sys.exit(1)
        

    if args.action == 'get':
        # get a file
        sender_blockchain_id = args.sender_blockchain_id
        output_path = args.output_path

        tmp = False
        if output_path is None:
            fd, path = tempfile.mkstemp( prefix='blockstack-file-', dir=config_dir )
            os.close(fd)
            output_path = path
            tmp = True

        res = file_get( blockchain_id, hostname, sender_blockchain_id, data_name, output_path, passphrase=passphrase, config_path=config_path, wallet_keys=wallet )
        if 'error' in res:
            print >> sys.stderr, json.dumps(res, sort_keys=True, indent=4 )
            sys.exit(1)

        if tmp:
            # print to stdout 
            with open(output_path, "r") as f:
                while True:
                    buf = f.read(65536)
                    if len(buf) == 0:
                        break

                    sys.stdout.write(buf)

            os.unlink(output_path)

    elif args.action == 'put':
        # put a file
        recipients = unparsed
        input_path = args.input_path
        res = file_put( blockchain_id, hostname, recipients, data_name, input_path, passphrase=passphrase, config_path=config_path, wallet_keys=wallet )
        if 'error' in res:
            print >> sys.stderr, json.dumps(res, sort_keys=True, indent=4 )
            sys.exit(1)

    elif args.action == 'delete':
        # delete a file
        res = file_delete( blockchain_id, data_name, config_path=config_path, wallet_keys=wallet )
        if 'error' in res:
            print >> sys.stderr, json.dumps(res, sort_keys=True, indent=4 )
            sys.exit(1)

    
    print >> sys.stderr, json.dumps({'status': True}, sort_keys=True, indent=4 )
    sys.exit(0)
695165
def rule(cmd, a, &block)
      # Evaluate a block expression and return early if it evaluates to false.
      # If no block is passed it is equivalent to the block: { true }.
      return self if block_given? && !instance_eval(&block)

      raise ArgumentError, 'chain is a required argument' unless a[:chain]
      assert_valid_ipaddr(a[:src]) if a[:src]
      assert_valid_ipaddr(a[:dst]) if a[:dst]

      # Map of commands for rules
      cmds = {
        add: '-A', delete: '-D', insert: '-I', replace: '-R',
        check: '-C'
      }

      a[:proto] ||= 'tcp'
      table = build_option('-t', @table)
      jump = build_option('-j', a[:jump])
      goto = build_option('-g', a[:goto])
      proto = build_option('-p', a[:proto])
      inface = build_option('-i', a[:in])
      outface = build_option('-o', a[:out])
      src = build_option('-s', a[:src])
      dst = build_option('-d', a[:dst])
      match = build_option('-m', a[:match] || @match)
      ports = build_option('--dport', @ports)
      to_port = build_option('--to-port', a[:to_port])
      @buffer << [
        'iptables', table, cmds[cmd], a[:chain], src, dst, outface,
        inface, proto, match, ports, jump || goto, to_port
      ].compact.join(' ') << "\n"
      self
    end
525382
def as_es2_command(command):
    

    if command[0] == 'FUNC':
        return (command[0], re.sub(r'^gl([A-Z])',
                lambda m: m.group(1).lower(), command[1])) + command[2:]
    if command[0] == 'SHADERS':
        return command[:2] + convert_shaders('es2', command[2:])
    if command[0] == 'UNIFORM':
        return command[:-1] + (command[-1].tolist(),)
    return command
892241
private void setChaining(Map<Integer, byte[]> hashes, List<Map<Integer, byte[]>> legacyHashes, Map<Integer, List<Tuple2<byte[], byte[]>>> chainedOperatorHashes) {
		for (Integer sourceNodeId : streamGraph.getSourceIDs()) {
			createChain(sourceNodeId, sourceNodeId, hashes, legacyHashes, 0, chainedOperatorHashes);
		}
	}
358867
def lock
      cmd = Xcode::Shell::Command.new "security"
      cmd << "lock-keychain"
      cmd << "\"#{@path}\""
      cmd.execute
    end
769086
def get_invocation_command(toolset, tool, user_provided_command = [],
                           additional_paths = [], path_last = False):
    
    assert isinstance(toolset, basestring)
    assert isinstance(tool, basestring)
    assert is_iterable_typed(user_provided_command, basestring)
    assert is_iterable_typed(additional_paths, basestring) or additional_paths is None
    assert isinstance(path_last, (int, bool))

    result = get_invocation_command_nodefault(toolset, tool,
                                              user_provided_command,
                                              additional_paths,
                                              path_last)

    if not result:
        if user_provided_command:
            result = user_provided_command[0]
        else:
            result = tool

    assert(isinstance(result, str))

    return result