Submit a valid transaction to the mempool.
332443
def write_transaction(self, transaction, mode):
        # This method offers backward compatibility with the Web API.
        """"""
        response = self.post_transaction(transaction, mode)
        return self._process_post_response(response.json(), mode)
967334
def form_valid(self, form):
        """"""

        ret = super(ProjectCopy, self).form_valid(form)
        self.copy_relations()

        # Good to make note of that
        messages.add_message(self.request, messages.SUCCESS, 'Project %s copied' % self.object.name)

        return ret
403590
def form_valid(self, form):
        """"""

        ret = super(HookCreate, self).form_valid(form)

        # Good to make note of that
        messages.add_message(self.request, messages.SUCCESS, 'Hook %s created' % self.object.url)

        return ret
632530
private function _submitTransaction($transaction, $txnType, $clientTxnId = null, $cardData = null)
    {
        try {
            $response = $this->doRequest($transaction, $clientTxnId);
        } catch (HpsException $e) {
            if ($e->innerException != null && $e->innerException->getMessage() == 'gateway_time-out') {
                // if (in_array($txnType, array('CreditSale', 'CreditAuth'))) {
                //     try {
                //         $this->reverse($cardData, $this->_amount, $this->_currency);
                //     } catch (Exception $e) {
                //         throw new HpsGatewayException('0', HpsExceptionCodes::GATEWAY_TIMEOUT_REVERSAL_ERROR);
                //     }
                // }
                throw new HpsException('An error occurred and the gateway has timed out', 'gateway_timeout', $e, 'gateway_timeout');
            }
            throw $e;
        }

        $this->_processGatewayResponse($response, $txnType);
        $this->_processProcessorResponse($response, $txnType);

        $rvalue = null;
        switch ($txnType) {
            case 'AltPaymentCreateSession':
                $rvalue = HpsAltPaymentCreateSession::fromDict($response, $txnType);
                break;
            case 'AltPaymentSessionInfo':
                $rvalue = HpsAltPaymentSessionInfo::fromDict($response, $txnType);
                break;
            case 'AltPaymentSale':
                $rvalue = HpsAltPaymentSale::fromDict($response, $txnType);
                break;
            case 'AltPaymentAuth':
                $rvalue = HpsAltPaymentAuth::fromDict($response, $txnType);
                break;
            case 'AltPaymentCapture':
                $rvalue = HpsAltPaymentCapture::fromDict($response, $txnType);
                break;
            case 'AltPaymentReturn':
                $rvalue = HpsAltPaymentReturn::fromDict($response, $txnType);
                break;
            case 'AltPaymentVoid':
                $rvalue = HpsAltPaymentVoid::fromDict($response, $txnType);
                break;
            case 'GetTransactionStatus':
                $rvalue = HpsTransactionStatus::fromDict($response, $txnType);
                break;
            default:
                break;
        }

        return $rvalue;
    }
426306
def submit(self, fn, *args, **kwargs):
        """"""
        if not self.asynchronous:
            return fn(*args, **kwargs)
        raise NotImplementedError
586834
def submit(cls, client, direction, legs, price, quantity, time_in_force,
               trigger, order_type, run_validations=True):
        '''
        
        '''

        if run_validations:
            assert(direction in ["debit", "credit"])
            assert(type(price) is str)
            assert(type(quantity) is int)
            assert(time_in_force in ["gfd", "gtc"])
            assert(trigger in ["immediate"])
            assert(order_type in ["limit", "market"])
            assert(cls._validate_legs(legs) is True)

        payload = json.dumps({
            "account": client.account_url,
            "direction": direction,
            "legs": legs,
            "price": price,
            "quantity": quantity,
            "time_in_force": time_in_force,
            "trigger": trigger,
            "type": order_type,
            "override_day_trade_checks": False,
            "override_dtbp_checks": False,
            "ref_id": str(uuid.uuid4())
        })

        request_url = "https://api.robinhood.com/options/orders/"
        data = client.post(request_url, payload=payload)
        return data
877012
function transact(transaction, api, secret, options, converter, callback) {
  if (options.submit === false) {
    prepareAndOptionallySign.apply(this, arguments);
  } else {
    prepareAndSignAndSubmit.apply(this, arguments);
  }
}
634538
def form_valid(self, form):
        '''
        
        '''
        slotIds = form.cleaned_data['slotIds']
        deleteSlot = form.cleaned_data.get('deleteSlot', False)

        these_slots = InstructorAvailabilitySlot.objects.filter(id__in=slotIds)

        if deleteSlot:
            these_slots.delete()
        else:
            for this_slot in these_slots:
                this_slot.location = form.cleaned_data['updateLocation']
                this_slot.room = form.cleaned_data['updateRoom']
                this_slot.status = form.cleaned_data['updateStatus']
                this_slot.pricingTier = form.cleaned_data.get('updatePricing')
                this_slot.save()

        return JsonResponse({'valid': True})
1220794
def commit(self, sql=None):
        """"""
        self._transaction = False
        try:
            commit = self._con.commit
        except AttributeError:
            return self._con.query(sql or 'commit')
        else:
            if sql:
                return commit(sql=sql)
            else:
                return commit()
642135
def commit(self):
        

        if not self._parent._is_active:
            raise exc.InvalidRequestError("This transaction is inactive")
        yield from self._do_commit()
        self._is_active = False
218525
def validate(self,
                 asset,
                 amount,
                 portfolio,
                 algo_datetime,
                 algo_current_data):
        
        if portfolio.positions[asset].amount + amount < 0:
            self.handle_violation(asset, amount, algo_datetime)
816504
private function _submitTransaction($transaction, $txnType)
    {

        try {
            $response = $this->doRequest($transaction);
        } catch (HpsException $e) {
            if ($e->innerException != null && $e->innerException->getMessage() == 'gateway_time-out') {
                throw new HpsException('An error occurred and the gateway has timed out', 'gateway_timeout', $e, 'gateway_timeout');
            }
            throw $e;
        }

        $this->_processGatewayResponse($response, $txnType);

        $rvalue = null;
        switch ($txnType) {
            case 'GetAttachments':
                $rvalue = HpsAttachment::fromDict($response, $txnType);
                break;
            default:
                break;
        }

        return $rvalue;
    }
268343
def submit(self, method, method_args=(), method_kwargs={}, done_callback=None, done_kwargs={}, loop=None):
        '''
        
        '''
        _future = self.pool.submit(method, *method_args, **method_kwargs)
        self.current_id += 1
        if done_callback:
            _future.add_done_callback(lambda _f:done_callback(_f,loop,**done_kwargs))#done kwargs, hardcoded kwargs
        self.request_pool[self.current_id] = _future
        return self.current_id, _future
56222
private void postCommit(DbSession dbSession, Collection<String> logins, Collection<EsQueueDto> items) {
    index(dbSession, items);
  }
1170934
void preCommit(Transaction transaction)
                    throws ObjectManagerException
    {
        throw new InvalidStateException(this, InternalTransaction.stateTerminated, InternalTransaction.stateNames[InternalTransaction.stateTerminated]);
    }
1330539
function verify($transaction)
	{
		$this->transaction = $transaction;
		$this->transactionId = $transaction->id;
		$this->amount = intval($transaction->price);
		$this->refId = $transaction->ref_id;
	}
656158
def release(self):
        """"""
        base64_key = _encode(self.key)
        base64_value = _encode(self._uuid)

        txn = {
            'compare': [{
                'key': base64_key,
                'result': 'EQUAL',
                'target': 'VALUE',
                'value': base64_value
            }],
            'success': [{
                'request_delete_range': {
                    'key': base64_key
                }
            }]
        }

        result = self.client.transaction(txn)
        if 'succeeded' in result:
            return result['succeeded']
        return False