Inserts a method's i/o into the datastore

    :param dict args: A dictionary of the hash, stack, packet_num, methodname, args, and returnval

    :rtype None:
768664
def insert_io( args ):
    
    global CACHE_
    load_cache()
    hash = args['hash']
    record_used('cache', hash)
    packet_num = args['packet_num']
    if hash not in CACHE_['cache']:
        CACHE_['cache'][hash] = {}
    CACHE_['cache'][hash][packet_num] = pickle.dumps(args, PPROT)
    write_out()
1352145
def invoke(self, method, *args):
        
        def inv(value, *ar):
            if (
                _(method).isFunction() or
                _(method).isLambda() or
                _(method).isMethod()
            ):
                return method(value, *args)
            else:
                return getattr(value, method)(*args)
        return self._wrap(self._clean.map(inv))
1242888
def create(args):
    
    # for PUT HTTP method
    action = True

    if ((args.__dict__.get('domain') and args.__dict__.get('name')
         and args.__dict__.get('rtype') and args.__dict__.get('content'))):
        # for create sub-command

        domain = args.domain
        o = JSONConverter(domain)

        name, rtype, content, ttl, priority = get_record_params(args)
        record_dict = o.set_record(name, rtype, content, ttl, priority)

        json = set_json(domain, action, record=record_dict)

    else:
        # for bulk_create sub-command
        if args.__dict__.get('domain'):
            domain = args.domain
        else:
            domain = check_infile(args.infile)
        json = set_json(domain, action, filename=args.infile)

    password = get_password(args)
    token = connect.get_token(args.username, password, args.server)
    processing.create_records(args.server, token, domain, json)

    if args.auto_update_soa == 'True':
        update_soa_serial(args)
1217782
def import_from_dicts(data, samples=None, *args, **kwargs):
    

    data = iter(data)

    cached_rows, headers = [], []
    for index, row in enumerate(data, start=1):
        cached_rows.append(row)

        for key in row.keys():
            if key not in headers:
                headers.append(key)

        if samples and index == samples:
            break

    data_rows = (
        [row.get(header, None) for header in headers]
        for row in chain(cached_rows, data)
    )

    kwargs["samples"] = samples
    meta = {"imported_from": "dicts"}
    return create_table(chain([headers], data_rows), meta=meta, *args, **kwargs)
775252
def _add_arg_java(self, key, value, mask=False):
        
        if isinstance(value, bool):
            value = int(value)
        self._data[key] = value
        self._args.append('{}{}={}'.format('-D', key, value))
        self._args_quoted.append(self.quote('{}{}={}'.format('-D', key, value)))
        if mask:
            value = 'x' * len(str(value))
        self._args_masked.append('{}{}={}'.format('-D', key, value))
862063
function(operation, key, args, callback) {
		var operationArgs = [key].concat(args)
		if (callback) { operationArgs.push(callback) }
		storeAPI[operation].apply(this, operationArgs)
	}
1103967
void createMethodBody(String classname, ExecutableElement methodElement, List<String> arguments, Writer writer) throws IOException {
		String methodName = getMethodName(methodElement);
		boolean ws = isWebsocketDataService(methodElement);
		String args = stringJoinAndDecorate(arguments, COMMA, new NothingDecorator());
		String keys = computeKeys(methodElement, arguments);
		createReturnOcelotPromiseFactory(classname, methodName, ws, args, keys, writer);
	}
649801
def _insert_row(self, i, index):
        
        if i == len(self._index):
            self._add_row(index)
        else:
            self._index.insert(i, index)
            self._data.insert(i, None)
708865
def archive_insert_data(self, data_dump):
        '''
        
        '''
        with self.session as session:
            try:
                data = [self.tables.archive(**entry) for entry in data_dump]

                session.add_all(data)
                session.commit()
            except SQLAlchemyError as exc:
                session.rollback()
                print_exc()
                raise IOError(exc)
85515
def insert_record_by_dict(self,
                              table: str,
                              valuedict: Dict[str, Any]) -> Optional[int]:
        """"""
        if not valuedict:
            return None
        n = len(valuedict)
        fields = []
        args = []
        for f, v in valuedict.items():
            fields.append(self.delimit(f))
            args.append(v)
        query = """
            INSERT INTO {table}
                ({fields})
                VALUES ({placeholders})
        """.format(
            table=table,
            fields=",".join(fields),
            placeholders=",".join(["?"]*n)
        )
        query = self.localize_sql(query)
        log.debug("About to insert_record_by_dict with SQL template: " + query)
        try:
            cursor = self.db.cursor()
            debug_sql(query, args)
            cursor.execute(query, args)
            new_pk = get_pk_of_last_insert(cursor)
            log.debug("Record inserted.")
            return new_pk
        except:  # nopep8
            log.exception("insert_record_by_dict: Failed to insert record.")
            raise
1353557
def load_data(self, *args, **kwargs):
        
        # get positional argument names from parameters and apply them to args
        # update data with additional kwargs
        argpos = {
            v['extras']['argpos']: k for k, v in self.parameters.iteritems()
            if 'argpos' in v['extras']
        }
        data = dict(
            {argpos[n]: a for n, a in enumerate(args)}, **kwargs
        )
        return self.apply_units_to_cache(data)
659878
def send_dict(*args, **kwargs):
    
    if not _module_instance:
        raise GraphiteSendException(
            "Must call graphitesend.init() before sending")
    _module_instance.send_dict(*args, **kwargs)
    return _module_instance
1194459
def make_payload(base, method, params):
    
    payload = {
        'jsonrpc': '2.0',
        'method': '{base}APING/v1.0/{method}'.format(**locals()),
        'params': utils.serialize_dict(params),
        'id': 1,
    }
    return payload
876570
def insert(self, space_no, *args):
        
        d = self.replyQueue.get()
        packet = RequestInsert(self.charset, self.errors, d._ipro_request_id, space_no, Request.TNT_FLAG_ADD, *args)
        self.transport.write(bytes(packet))
        return d.addCallback(self.handle_reply, self.charset, self.errors, None)
802608
def dispatch_with_args(self, body, argMap):
        ''
        inputs = body.get('inputs', [])
        state = body.get('state', [])
        output = body['output']

        try:
            output_id = output['id']
            output_property = output['property']
            target_id = "%s.%s" %(output_id, output_property)
        except:
            target_id = output
            output_id, output_property = output.split(".")

        args = []

        da = argMap.get('dash_app', None)

        for component_registration in self.callback_map[target_id]['inputs']:
            for c in inputs:
                if c['property'] == component_registration['property'] and c['id'] == component_registration['id']:
                    v = c.get('value', None)
                    args.append(v)
                    if da:
                        da.update_current_state(c['id'], c['property'], v)

        for component_registration in self.callback_map[target_id]['state']:
            for c in state:
                if c['property'] == component_registration['property'] and c['id'] == component_registration['id']:
                    v = c.get('value', None)
                    args.append(v)
                    if da:
                        da.update_current_state(c['id'], c['property'], v)

        # Special: intercept case of insufficient arguments
        # This happens when a propery has been updated with a pipe component
        # TODO see if this can be attacked from the client end

        if len(args) < len(self.callback_map[target_id]['inputs']):
            return 'EDGECASEEXIT'

        res = self.callback_map[target_id]['callback'](*args, **argMap)
        if da and da.have_current_state_entry(output_id, output_property):
            response = json.loads(res.data.decode('utf-8'))
            value = response.get('response', {}).get('props', {}).get(output_property, None)
            da.update_current_state(output_id, output_property, value)

        return res
228008
def load(self, args):
        
        self._queue.append(tc.CMD_LOAD)
        self._string += struct.pack("!BiB", 0, 1 + 4 + 1 + 1 + 4 + sum(map(len, args)) + 4 * len(args), tc.CMD_LOAD)
        self._packStringList(args)
        self._sendExact()
1024851
def send(self, method, args={}, to=None, nowait=False, **kwargs):
        

        if to is None:
            to = self.routing_key
        r = self.call_or_cast(method, args, routing_key=to,
                              nowait=nowait, **kwargs)
        if not nowait:
            return r.get()