query
stringlengths
4
15k
positive
stringlengths
5
373k
negative
stringlengths
5
289k
get the current input instance @param CCIn_Instance $set if set the current instance gets updated @return CCIn_Instance
public static function instance( $set = null ) { if ( is_null( $set ) ) { return static::$_instance; } if ( !$set instanceof CCIn_Instance ) { throw new \InvalidArgumentException('CCIn::set() - only CCIn_Instance object can be passed.'); } static::$_instance = $set; }
public function getInstanceValue() { $value = $this->getValue(); if ( is_array($value) && array_key_exists($this->instances, $this->value) ) { $value = $value[$this->instances]; } return $value; }
get the current input instance @param CCIn_Instance $set if set the current instance gets updated @return CCIn_Instance
public static function instance( $set = null ) { if ( is_null( $set ) ) { return static::$_instance; } if ( !$set instanceof CCIn_Instance ) { throw new \InvalidArgumentException('CCIn::set() - only CCIn_Instance object can be passed.'); } static::$_instance = $set; }
public function setConfig( array $config ) { if ( $config == $this->getConfig() ) { return; } $this->_values['config'] = $config; $this->setModified(); }
get the current input instance @param CCIn_Instance $set if set the current instance gets updated @return CCIn_Instance
public static function instance( $set = null ) { if ( is_null( $set ) ) { return static::$_instance; } if ( !$set instanceof CCIn_Instance ) { throw new \InvalidArgumentException('CCIn::set() - only CCIn_Instance object can be passed.'); } static::$_instance = $set; }
public function setInstance($instance = 'default') { $this->get($instance); $this->session->put($this->prefix.'.instance', $instance); if (!in_array($instance, $this->getInstances())) { $this->session->push($this->prefix.'.instances', $instance); } $this->events...
get the current input instance @param CCIn_Instance $set if set the current instance gets updated @return CCIn_Instance
public static function instance( $set = null ) { if ( is_null( $set ) ) { return static::$_instance; } if ( !$set instanceof CCIn_Instance ) { throw new \InvalidArgumentException('CCIn::set() - only CCIn_Instance object can be passed.'); } static::$_instance = $set; }
protected function fill_instance_data(\cm_info $cm) { global $DB; if (!isset($this->instancedata[$cm->instance])) { $this->instancedata[$cm->instance] = $DB->get_record($this->get_activity_type(), array('id' => $cm->instance), '*', MUST_EXIST); } }
get the current input instance @param CCIn_Instance $set if set the current instance gets updated @return CCIn_Instance
public static function instance( $set = null ) { if ( is_null( $set ) ) { return static::$_instance; } if ( !$set instanceof CCIn_Instance ) { throw new \InvalidArgumentException('CCIn::set() - only CCIn_Instance object can be passed.'); } static::$_instance = $set; }
public static function getInstance(): ConnectionManager { if (self::$instance === NULL) { self::$instance = new self(); } return self::$instance; }
Print the default values of all cls's Parameters.
def print_param_defaults(self_): """Print the default values of all cls's Parameters.""" cls = self_.cls for key,val in cls.__dict__.items(): if isinstance(val,Parameter): print(cls.__name__+'.'+key+ '='+ repr(val.default))
function(name, options) { name = defaultValue(name, "Conditions"); options = defaultValue(options, defaultValue.EMPTY_OBJECT); DisplayVariablesConcept.call(this, name, options); }
Print the default values of all cls's Parameters.
def print_param_defaults(self_): """Print the default values of all cls's Parameters.""" cls = self_.cls for key,val in cls.__dict__.items(): if isinstance(val,Parameter): print(cls.__name__+'.'+key+ '='+ repr(val.default))
def print_param_values(self_): """Print the values of all this object's Parameters.""" self = self_.self for name,val in self.param.get_param_values(): print('%s.%s = %s' % (self.name,name,val))
Print the default values of all cls's Parameters.
def print_param_defaults(self_): """Print the default values of all cls's Parameters.""" cls = self_.cls for key,val in cls.__dict__.items(): if isinstance(val,Parameter): print(cls.__name__+'.'+key+ '='+ repr(val.default))
def print_parameters(self): """ Print the list of parameters and exit. """ self.print_info(u"Available parameters:") self.print_generic(u"\n" + u"\n".join(self.PARAMETERS) + u"\n") return self.HELP_EXIT_CODE
Print the default values of all cls's Parameters.
def print_param_defaults(self_): """Print the default values of all cls's Parameters.""" cls = self_.cls for key,val in cls.__dict__.items(): if isinstance(val,Parameter): print(cls.__name__+'.'+key+ '='+ repr(val.default))
def all_options env_variable_options = UserOptions.new global_configuration_options = UserOptions.new(Departure.configuration.global_percona_args) options = env_variable_options.merge(global_configuration_options).merge(DEFAULT_OPTIONS) options.to_a.join(' ') end
Print the default values of all cls's Parameters.
def print_param_defaults(self_): """Print the default values of all cls's Parameters.""" cls = self_.cls for key,val in cls.__dict__.items(): if isinstance(val,Parameter): print(cls.__name__+'.'+key+ '='+ repr(val.default))
protected function getDefaultInputDefinition() { return new InputDefinition(array( new InputOption('--help', '-h', InputOption::VALUE_NONE, 'Display this help message.'), new InputOption('--quiet', '-q', InputOption::VALUE_NONE, 'Do not output any message.'), new InputOpt...
Perform an ajax request to get comments for a node and insert the comments into the comments tree.
function getComments(id) { $.ajax({ type: 'GET', url: opts.getCommentsURL, data: {node: id}, success: function(data, textStatus, request) { var ul = $('#cl' + id); var speed = 100; $('#cf' + id) .find('textarea[name="proposal"]') .data('source', data.source...
public function create(Comment &$comment) { $data = $comment->exportData(); $endpoint = '/admin/comments.json'; $respoinse = $this->request( $endpoint, 'POST', array( 'comment' => $data ) ); $comment->setData($response['comment']); }
Perform an ajax request to get comments for a node and insert the comments into the comments tree.
function getComments(id) { $.ajax({ type: 'GET', url: opts.getCommentsURL, data: {node: id}, success: function(data, textStatus, request) { var ul = $('#cl' + id); var speed = 100; $('#cf' + id) .find('textarea[name="proposal"]') .data('source', data.source...
public function Comments() { $list = $this->AllVisibleComments(); // If nesting comments, only show root level if ($this->owner->getCommentsOption('nested_comments')) { $list = $list->filter('ParentCommentID', 0); } $this->owner->extend('updateComments', $list);...
Perform an ajax request to get comments for a node and insert the comments into the comments tree.
function getComments(id) { $.ajax({ type: 'GET', url: opts.getCommentsURL, data: {node: id}, success: function(data, textStatus, request) { var ul = $('#cl' + id); var speed = 100; $('#cf' + id) .find('textarea[name="proposal"]') .data('source', data.source...
public static void appendQueryPageComments(RequestContext requestContext, QueryPage queryPage) { QueryQuestionCommentDAO queryQuestionCommentDAO = new QueryQuestionCommentDAO(); PanelStamp activeStamp = RequestUtils.getActiveStamp(requestContext); List<QueryQuestionComment> rootComments = queryQuestionComme...
Perform an ajax request to get comments for a node and insert the comments into the comments tree.
function getComments(id) { $.ajax({ type: 'GET', url: opts.getCommentsURL, data: {node: id}, success: function(data, textStatus, request) { var ul = $('#cl' + id); var speed = 100; $('#cf' + id) .find('textarea[name="proposal"]') .data('source', data.source...
public function CommentsForm() { // Check if enabled $enabled = $this->getCommentsEnabled(); if ($enabled && $this->owner->getCommentsOption('include_js')) { Requirements::javascript('//code.jquery.com/jquery-3.3.1.min.js'); Requirements::javascript('silverstripe/comm...
Perform an ajax request to get comments for a node and insert the comments into the comments tree.
function getComments(id) { $.ajax({ type: 'GET', url: opts.getCommentsURL, data: {node: id}, success: function(data, textStatus, request) { var ul = $('#cl' + id); var speed = 100; $('#cf' + id) .find('textarea[name="proposal"]') .data('source', data.source...
public function store($content) { $comment = $this->client->post( sprintf('buckets/%d/recordings/%d/comments.json', $this->bucket, $this->parent), [ 'json' => [ 'content' => $content, ], ] ); return new ...
// lookupReader - return the reader function for the given scheme
func (d *Data) lookupReader(scheme string) (func(*Source, ...string) ([]byte, error), error) { if d.sourceReaders == nil { d.registerReaders() } r, ok := d.sourceReaders[scheme] if !ok { return nil, errors.Errorf("scheme %s not registered", scheme) } return r, nil }
func (m *Client) NewReader(o string) (io.ReadCloser, error) { return m.NewReaderWithContext(context.Background(), o) }
// lookupReader - return the reader function for the given scheme
func (d *Data) lookupReader(scheme string) (func(*Source, ...string) ([]byte, error), error) { if d.sourceReaders == nil { d.registerReaders() } r, ok := d.sourceReaders[scheme] if !ok { return nil, errors.Errorf("scheme %s not registered", scheme) } return r, nil }
func (l *LocalStore) NewReader(o string) (io.ReadCloser, error) { return l.NewReaderWithContext(context.Background(), o) }
// lookupReader - return the reader function for the given scheme
func (d *Data) lookupReader(scheme string) (func(*Source, ...string) ([]byte, error), error) { if d.sourceReaders == nil { d.registerReaders() } r, ok := d.sourceReaders[scheme] if !ok { return nil, errors.Errorf("scheme %s not registered", scheme) } return r, nil }
func WithReader(r reader.Reader) loader.Option { return func(o *loader.Options) { o.Reader = r } }
// lookupReader - return the reader function for the given scheme
func (d *Data) lookupReader(scheme string) (func(*Source, ...string) ([]byte, error), error) { if d.sourceReaders == nil { d.registerReaders() } r, ok := d.sourceReaders[scheme] if !ok { return nil, errors.Errorf("scheme %s not registered", scheme) } return r, nil }
func NewReader(r io.Reader) *Reader { return &Reader{ r: r, ctx: context.Background(), } }
// lookupReader - return the reader function for the given scheme
func (d *Data) lookupReader(scheme string) (func(*Source, ...string) ([]byte, error), error) { if d.sourceReaders == nil { d.registerReaders() } r, ok := d.sourceReaders[scheme] if !ok { return nil, errors.Errorf("scheme %s not registered", scheme) } return r, nil }
func (vp *ValidatingPool) GetReadSeeker(fileIndex int64) (io.ReadSeeker, error) { return vp.Pool.GetReadSeeker(fileIndex) }
Calculates the probability matrix of substitutions i->j over time t, given the normalised generator diagonalisation. :param t: time :type t: float :return: probability matrix :rtype: numpy.ndarray
def get_pij_matrix(t, diag, A, A_inv): """ Calculates the probability matrix of substitutions i->j over time t, given the normalised generator diagonalisation. :param t: time :type t: float :return: probability matrix :rtype: numpy.ndarray """ return A.dot(np.diag(np.exp(diag * t))...
def stationary_distribution_sensitivity(T, j): r"""Calculate the sensitivity matrix for entry j the stationary distribution vector given transition matrix T. Parameters ---------- T : numpy.ndarray shape = (n, n) Transition matrix j : int entry of stationary distribution for whi...
Calculates the probability matrix of substitutions i->j over time t, given the normalised generator diagonalisation. :param t: time :type t: float :return: probability matrix :rtype: numpy.ndarray
def get_pij_matrix(t, diag, A, A_inv): """ Calculates the probability matrix of substitutions i->j over time t, given the normalised generator diagonalisation. :param t: time :type t: float :return: probability matrix :rtype: numpy.ndarray """ return A.dot(np.diag(np.exp(diag * t))...
def _log_posterior(theta, counts, alpha, beta, n): """Log of the posterior probability and gradient Parameters ---------- theta : ndarray, shape=(n_params,) The free parameters of the reversible rate matrix counts : ndarray, shape=(n, n) The count matrix (sufficient statistics for t...
Calculates the probability matrix of substitutions i->j over time t, given the normalised generator diagonalisation. :param t: time :type t: float :return: probability matrix :rtype: numpy.ndarray
def get_pij_matrix(t, diag, A, A_inv): """ Calculates the probability matrix of substitutions i->j over time t, given the normalised generator diagonalisation. :param t: time :type t: float :return: probability matrix :rtype: numpy.ndarray """ return A.dot(np.diag(np.exp(diag * t))...
def compute_probab_ratios(p_new, p_old, actions, reward_mask): """Computes the probability ratios for each time-step in a trajectory. Args: p_new: ndarray of shape [B, T+1, A] of the log-probabilities that the policy network assigns to all the actions at each time-step in each batch using the old p...
Calculates the probability matrix of substitutions i->j over time t, given the normalised generator diagonalisation. :param t: time :type t: float :return: probability matrix :rtype: numpy.ndarray
def get_pij_matrix(t, diag, A, A_inv): """ Calculates the probability matrix of substitutions i->j over time t, given the normalised generator diagonalisation. :param t: time :type t: float :return: probability matrix :rtype: numpy.ndarray """ return A.dot(np.diag(np.exp(diag * t))...
def viterbi(self,observations): """ The probability of occurence of the observation sequence **Arguments**: :param observations: The observation sequence, where each element belongs to 'observations' variable declared with __init__ object. :type observations: A list or tuple ...
Calculates the probability matrix of substitutions i->j over time t, given the normalised generator diagonalisation. :param t: time :type t: float :return: probability matrix :rtype: numpy.ndarray
def get_pij_matrix(t, diag, A, A_inv): """ Calculates the probability matrix of substitutions i->j over time t, given the normalised generator diagonalisation. :param t: time :type t: float :return: probability matrix :rtype: numpy.ndarray """ return A.dot(np.diag(np.exp(diag * t))...
def propose(self): """ This method proposes values for stochastics based on the empirical covariance of the values sampled so far. The proposal jumps are drawn from a multivariate normal distribution. """ arrayjump = np.dot( self.proposal_sd, np....
Like tree view mode
def tree(self): """Like tree view mode """ self.msg.template(78) print("| Dependencies\n" "| -- Packages") self.msg.template(78) self.data() for pkg, dep in self.dmap.iteritems(): print("+ {0}{1}{2}".format(self.green, pkg, self.endc)) ...
def pages_dynamic_tree_menu(context, page, url='/'): """ Render a "dynamic" tree menu, with all nodes expanded which are either ancestors or the current page itself. Override ``pages/dynamic_tree_menu.html`` if you want to change the design. :param page: the current page :param url: not us...
Like tree view mode
def tree(self): """Like tree view mode """ self.msg.template(78) print("| Dependencies\n" "| -- Packages") self.msg.template(78) self.data() for pkg, dep in self.dmap.iteritems(): print("+ {0}{1}{2}".format(self.green, pkg, self.endc)) ...
private void mapTreeHierarchy(final WComponent currentComponent, final StringTreeNode currentNode, final WText selectedMenuText) { if (currentNode.isLeaf()) { WMenuItem menuItem = new WMenuItem(currentNode.getData(), new ExampleMenuAction( selectedMenuText)); menuItem.setActionObject(currentNode.getData...
Like tree view mode
def tree(self): """Like tree view mode """ self.msg.template(78) print("| Dependencies\n" "| -- Packages") self.msg.template(78) self.data() for pkg, dep in self.dmap.iteritems(): print("+ {0}{1}{2}".format(self.green, pkg, self.endc)) ...
protected function buildDisplayTree( SwatTreeFlydownNode $tree, SwatTreeFlydownNode $parent, $path = array() ) { $flydown_option = $tree->getOption(); $path[] = $flydown_option->value; $new_node = new SwatTreeFlydownNode($path, $flydown_option->title); $paren...
Like tree view mode
def tree(self): """Like tree view mode """ self.msg.template(78) print("| Dependencies\n" "| -- Packages") self.msg.template(78) self.data() for pkg, dep in self.dmap.iteritems(): print("+ {0}{1}{2}".format(self.green, pkg, self.endc)) ...
def mk_dropdown_tree(cls, model, for_node=None): """ Creates a tree-like list of choices """ options = [(0, _('-- root --'))] for node in model.get_root_nodes(): cls.add_subtree(for_node, node, options) return options
Like tree view mode
def tree(self): """Like tree view mode """ self.msg.template(78) print("| Dependencies\n" "| -- Packages") self.msg.template(78) self.data() for pkg, dep in self.dmap.iteritems(): print("+ {0}{1}{2}".format(self.green, pkg, self.endc)) ...
public function treePageDefaultUpdate(ServerRequestInterface $request): ResponseInterface { $main_blocks = (array) $request->get('main'); $side_blocks = (array) $request->get('side'); $this->updateTreeBlocks(-1, $main_blocks, $side_blocks); return redirect(route('admin-control-pane...
Payment options. @return array
public static function getOptions() { $options = []; $options[] = [ 'id' => Operation::PRODUCT_VISA, 'label' => "Visa", ]; $options[] = [ 'id' => Operation::PRODUCT_MASTERCARD, 'label' => "Mastercard", ]; $options[] = [...
public function toOptionArray() { $return = []; $paymentMethodCodes = $this->_installmentsHelper->getAllInstallmentPaymentMethodCodes(); foreach ($paymentMethodCodes as $paymentMethodCode) { $return[] = [ 'value' => $paymentMethodCode, 'label' => ...
Payment options. @return array
public static function getOptions() { $options = []; $options[] = [ 'id' => Operation::PRODUCT_VISA, 'label' => "Visa", ]; $options[] = [ 'id' => Operation::PRODUCT_MASTERCARD, 'label' => "Mastercard", ]; $options[] = [...
public function getPaymentOptions($payKey, $details = false) { $operation = ($details) ? 'PaymentDetails' : 'GetPaymentOptions'; $this->setRequestData([ 'requestEnvelope' => $this->setEnvelope(), 'payKey' => $payKey, ]); return $this->doPayPalReques...
Payment options. @return array
public static function getOptions() { $options = []; $options[] = [ 'id' => Operation::PRODUCT_VISA, 'label' => "Visa", ]; $options[] = [ 'id' => Operation::PRODUCT_MASTERCARD, 'label' => "Mastercard", ]; $options[] = [...
final protected static function configOptions(IOptions $o) {$s = $o->s(); /** @var Settings $s */ return [ // 2017-09-19 «Where to ask for a payment option?» 'needShowOptions' => Options::needShow($s) /** * 2017-09-18 * @used-by Df_Payments/withOptions::options() * https://github.com/mage2pro/core/blob/2...
Payment options. @return array
public static function getOptions() { $options = []; $options[] = [ 'id' => Operation::PRODUCT_VISA, 'label' => "Visa", ]; $options[] = [ 'id' => Operation::PRODUCT_MASTERCARD, 'label' => "Mastercard", ]; $options[] = [...
public function toOptionArray() { return [ [ 'value' => self::CARD_VISA, 'label' => __('Visa') ], [ 'value' => self::CARD_MASTERCARD, 'label' => __('Mastercard') ], [ 'valu...
Payment options. @return array
public static function getOptions() { $options = []; $options[] = [ 'id' => Operation::PRODUCT_VISA, 'label' => "Visa", ]; $options[] = [ 'id' => Operation::PRODUCT_MASTERCARD, 'label' => "Mastercard", ]; $options[] = [...
public function getOptions() { $options = parent::getOptions(); foreach ($options as $option) { $option->Name = "{$this->name}[]"; } return $options; }
Load a profile by name Called by load_user_options
def _load_profile(self, profile_name): """Load a profile by name Called by load_user_options """ # find the profile default_profile = self._profile_list[0] for profile in self._profile_list: if profile.get('default', False): # explicit defaul...
public static systemuser get(nitro_service service, String username) throws Exception{ systemuser obj = new systemuser(); obj.set_username(username); systemuser response = (systemuser) obj.get_resource(service); return response; }
Load a profile by name Called by load_user_options
def _load_profile(self, profile_name): """Load a profile by name Called by load_user_options """ # find the profile default_profile = self._profile_list[0] for profile in self._profile_list: if profile.get('default', False): # explicit defaul...
async def get_friendly_name(self) -> Text: """ Let's use the first name of the user as friendly name. In some cases the user object is incomplete, and in those cases the full user is fetched. """ if 'first_name' not in self._user: user = await self._get_full_...
Load a profile by name Called by load_user_options
def _load_profile(self, profile_name): """Load a profile by name Called by load_user_options """ # find the profile default_profile = self._profile_list[0] for profile in self._profile_list: if profile.get('default', False): # explicit defaul...
public function get($profileId, array $parameters = []) { if($profileId === 'me') { return $this->getCurrent($parameters); } return $this->rest_read($profileId, $parameters); }
Load a profile by name Called by load_user_options
def _load_profile(self, profile_name): """Load a profile by name Called by load_user_options """ # find the profile default_profile = self._profile_list[0] for profile in self._profile_list: if profile.get('default', False): # explicit defaul...
def get_user_name(): """Get user name provide by operating system """ if sys.platform == 'win32': #user = os.getenv('USERPROFILE') user = os.getenv('USERNAME') else: user = os.getenv('LOGNAME') return user
Load a profile by name Called by load_user_options
def _load_profile(self, profile_name): """Load a profile by name Called by load_user_options """ # find the profile default_profile = self._profile_list[0] for profile in self._profile_list: if profile.get('default', False): # explicit defaul...
def list_profile(hostname, username, password, profile_type, name=None, ): ''' A function to connect to a bigip device and list an existing profile. If no name is provided than all profiles of the specified type will be listed. hostname The host/address of the bigip device username ...
Wrapper works for conversion. Args: - filename -- str, file to be converted
def f2format(filename): """Wrapper works for conversion. Args: - filename -- str, file to be converted """ print('Now converting %r...' % filename) # fetch encoding encoding = os.getenv('F2FORMAT_ENCODING', LOCALE_ENCODING) lineno = dict() # line number -> file offset conten...
public final void convertFile(final String inputFileName, final String outputFileName) throws IOException, ConversionException { openInputFile(inputFileName); openOutputFile(outputFileName); doConvertFile(myLineReader, myBufferedWriter); closeOutputFile(); closeInputFile(); }
Wrapper works for conversion. Args: - filename -- str, file to be converted
def f2format(filename): """Wrapper works for conversion. Args: - filename -- str, file to be converted """ print('Now converting %r...' % filename) # fetch encoding encoding = os.getenv('F2FORMAT_ENCODING', LOCALE_ENCODING) lineno = dict() # line number -> file offset conten...
def open_as_needed(filename): """Return a file-object given either a filename or an object. Handles opening with the right class based on the file extension. """ if hasattr(filename, 'read'): return filename if filename.endswith('.bz2'): return bz2.BZ2File(filename, 'rb') elif...
Wrapper works for conversion. Args: - filename -- str, file to be converted
def f2format(filename): """Wrapper works for conversion. Args: - filename -- str, file to be converted """ print('Now converting %r...' % filename) # fetch encoding encoding = os.getenv('F2FORMAT_ENCODING', LOCALE_ENCODING) lineno = dict() # line number -> file offset conten...
function fmtconv (input, output, compact = false) { if (!input) { throw new TypeError('"input" argument must be a file path') } else if (!output) { throw new TypeError('"output" argument must be a file path') } let extInput = path.extname(input).toLowerCase() if (extInput !== '.yaml' && extInput !== ...
Wrapper works for conversion. Args: - filename -- str, file to be converted
def f2format(filename): """Wrapper works for conversion. Args: - filename -- str, file to be converted """ print('Now converting %r...' % filename) # fetch encoding encoding = os.getenv('F2FORMAT_ENCODING', LOCALE_ENCODING) lineno = dict() # line number -> file offset conten...
def write(self, session, directory, name, maskMap): """ Write from database to file. *session* = SQLAlchemy session object\n *directory* = to which directory will the files be written (e.g.: '/example/path')\n *name* = name of file that will be written (e.g.: 'my_project.ext')\n...
Wrapper works for conversion. Args: - filename -- str, file to be converted
def f2format(filename): """Wrapper works for conversion. Args: - filename -- str, file to be converted """ print('Now converting %r...' % filename) # fetch encoding encoding = os.getenv('F2FORMAT_ENCODING', LOCALE_ENCODING) lineno = dict() # line number -> file offset conten...
def read_file(file_path, filename=None): """ Open file by path and optional filename If no file name is given the path is interpreted as direct path to the file to be read. If there is no file at location the return value will be None to offer a option for case handling. :param str file_path: Path str...
Teardown button handler.
def exitClient(self): """Teardown button handler.""" self.sendRtspRequest(self.TEARDOWN) #self.handler() os.remove(CACHE_FILE_NAME + str(self.sessionId) + CACHE_FILE_EXT) # Delete the cache image from video rate = float(self.counter/self.frameNbr) print('-'*60 + "\nRTP Packet Loss Rate :" + str(...
public void detach() { textComponent.removePropertyChangeListener( documentPropertyChangeListener); Document document = textComponent.getDocument(); document.removeUndoableEditListener(undoableEditListener); textComponent.getInputMap().remove(undoKeyStroke); ...
Teardown button handler.
def exitClient(self): """Teardown button handler.""" self.sendRtspRequest(self.TEARDOWN) #self.handler() os.remove(CACHE_FILE_NAME + str(self.sessionId) + CACHE_FILE_EXT) # Delete the cache image from video rate = float(self.counter/self.frameNbr) print('-'*60 + "\nRTP Packet Loss Rate :" + str(...
function() { var t = this; UI.hideToolTips(); UI.pageView.model.get('components').remove(t.model); t.connectMonitor(false); t.view.remove(); }
Teardown button handler.
def exitClient(self): """Teardown button handler.""" self.sendRtspRequest(self.TEARDOWN) #self.handler() os.remove(CACHE_FILE_NAME + str(self.sessionId) + CACHE_FILE_EXT) # Delete the cache image from video rate = float(self.counter/self.frameNbr) print('-'*60 + "\nRTP Packet Loss Rate :" + str(...
function() { var self = this; var eventNS = self.eventNS; var revertSettings = self.revertSettings; self.trigger('destroy'); self.off(); self.$wrapper.remove(); self.$dropdown.remove(); self.$input .html('') .append(revertSettings.$children) .removeAttr('tabindex') .removeCla...
Teardown button handler.
def exitClient(self): """Teardown button handler.""" self.sendRtspRequest(self.TEARDOWN) #self.handler() os.remove(CACHE_FILE_NAME + str(self.sessionId) + CACHE_FILE_EXT) # Delete the cache image from video rate = float(self.counter/self.frameNbr) print('-'*60 + "\nRTP Packet Loss Rate :" + str(...
function destroy() { var element = this.element, options = this.options; if (!getData(element, NAMESPACE)) { return this; } this.destroyed = true; if (this.ready) { if (this.played) { this.stop(); } if (options.inline) { if (this.fulled) { ...
Teardown button handler.
def exitClient(self): """Teardown button handler.""" self.sendRtspRequest(self.TEARDOWN) #self.handler() os.remove(CACHE_FILE_NAME + str(self.sessionId) + CACHE_FILE_EXT) # Delete the cache image from video rate = float(self.counter/self.frameNbr) print('-'*60 + "\nRTP Packet Loss Rate :" + str(...
function onDeactivateEvent() { // cancel all event subscriptions me.event.unsubscribe(this.vpChangeHdlr); me.event.unsubscribe(this.vpResizeHdlr); me.event.unsubscribe(this.vpLoadedHdlr); }
Cancelles an invoice :param invoice_id: the invoice id :return Response
def cancel_invoice(self, invoice_id): """ Cancelles an invoice :param invoice_id: the invoice id :return Response """ return self._create_put_request( resource=INVOICES, billomat_id=invoice_id, command=CANCEL, )
def delete(self, invoice_id, **kwargs): """" Delete an invoice You can delete an invoice which is in the draft state. Args: invoice_id : Id for delete the invoice Returns: The response is always be an empty array like this - [] """ url = "...
Cancelles an invoice :param invoice_id: the invoice id :return Response
def cancel_invoice(self, invoice_id): """ Cancelles an invoice :param invoice_id: the invoice id :return Response """ return self._create_put_request( resource=INVOICES, billomat_id=invoice_id, command=CANCEL, )
def delete_additional_charge(self, recurring_billing_id): """ Remove an extra charge from an invoice. Args: recurring_billing_id: Identifier of the additional charge. Returns: """ fmt = 'recurringBillItems/{}'.format(recurring_billing_id) return sel...
Cancelles an invoice :param invoice_id: the invoice id :return Response
def cancel_invoice(self, invoice_id): """ Cancelles an invoice :param invoice_id: the invoice id :return Response """ return self._create_put_request( resource=INVOICES, billomat_id=invoice_id, command=CANCEL, )
def cancel(self, refund=True): """Cancel this order, optionally refunding it """ if refund: self.refund() self.status = self.CANCELLED self.save()
Cancelles an invoice :param invoice_id: the invoice id :return Response
def cancel_invoice(self, invoice_id): """ Cancelles an invoice :param invoice_id: the invoice id :return Response """ return self._create_put_request( resource=INVOICES, billomat_id=invoice_id, command=CANCEL, )
public static function cancel($transactionUUID, $client = null) { return Recurly_Base::_post('/purchases/transaction-uuid-' . rawurlencode($transactionUUID) . '/cancel', null, $client); }
Cancelles an invoice :param invoice_id: the invoice id :return Response
def cancel_invoice(self, invoice_id): """ Cancelles an invoice :param invoice_id: the invoice id :return Response """ return self._create_put_request( resource=INVOICES, billomat_id=invoice_id, command=CANCEL, )
def _cancel_callback(self, request_id): """Construct a cancellation callback for the given request ID.""" def callback(future): if future.cancelled(): self.notify(CANCEL_METHOD, {'id': request_id}) future.set_exception(JsonRpcRequestCancelled()) return...
Initializes a new service.
@SuppressWarnings("unchecked") private RaftServiceContext initializeService(PrimitiveId primitiveId, PrimitiveType primitiveType, String serviceName, byte[] config) { RaftServiceContext oldService = raft.getServices().getService(serviceName); ServiceConfig serviceConfig = config == null ? new ServiceConfig() ...
private Service initService(String serviceName) { m_logger.debug("Initializing service: " + serviceName); try { @SuppressWarnings("unchecked") Class<Service> serviceClass = (Class<Service>) Class.forName(serviceName); Method instanceMethod = serviceClass.getMetho...
Initializes a new service.
@SuppressWarnings("unchecked") private RaftServiceContext initializeService(PrimitiveId primitiveId, PrimitiveType primitiveType, String serviceName, byte[] config) { RaftServiceContext oldService = raft.getServices().getService(serviceName); ServiceConfig serviceConfig = config == null ? new ServiceConfig() ...
protected synchronized void initialize() { String invocationServiceName = this.invocationServiceName; invocationService = (InvocationService) CacheFactory.getService(invocationServiceName); if (invocationService == null) { throw new IllegalArgumentException("Invocatio...
Initializes a new service.
@SuppressWarnings("unchecked") private RaftServiceContext initializeService(PrimitiveId primitiveId, PrimitiveType primitiveType, String serviceName, byte[] config) { RaftServiceContext oldService = raft.getServices().getService(serviceName); ServiceConfig serviceConfig = config == null ? new ServiceConfig() ...
def create(self, module_name, class_name, args=None, kwargs=None, factory_method=None, factory_args=None, factory_kwargs=None, static=False, calls=None): """ Initializes an instance of the service """ if args is None: args = [] if kwargs i...
Initializes a new service.
@SuppressWarnings("unchecked") private RaftServiceContext initializeService(PrimitiveId primitiveId, PrimitiveType primitiveType, String serviceName, byte[] config) { RaftServiceContext oldService = raft.getServices().getService(serviceName); ServiceConfig serviceConfig = config == null ? new ServiceConfig() ...
public void start() { if (socket == null) { throw new RuntimeException("Cannot bind a server that has not been initialized!"); } running = true; Thread t = new Thread(this); t.setName("HttpServer"); t.start(); }
Initializes a new service.
@SuppressWarnings("unchecked") private RaftServiceContext initializeService(PrimitiveId primitiveId, PrimitiveType primitiveType, String serviceName, byte[] config) { RaftServiceContext oldService = raft.getServices().getService(serviceName); ServiceConfig serviceConfig = config == null ? new ServiceConfig() ...
public void start() throws Exception { Injector injector = Guice.createInjector( new ConfigModule(conf), new ZKModule(), new DiscoveryModules().getDistributedModules(), new TransactionModules().getDistributedModules(), new TransactionClientModule() ); ZKClientService zkClientS...
// GetSettings retrieves settings from the ArgoCDConfigMap and secret.
func (mgr *SettingsManager) GetSettings() (*ArgoCDSettings, error) { err := mgr.ensureSynced(false) if err != nil { return nil, err } argoCDCM, err := mgr.configmaps.ConfigMaps(mgr.namespace).Get(common.ArgoCDConfigMapName) if err != nil { return nil, err } argoCDSecret, err := mgr.secrets.Secrets(mgr.namesp...
func (adm *AdminClient) GetConfig() ([]byte, error) { // Execute GET on /minio/admin/v1/config to get config of a setup. resp, err := adm.executeMethod("GET", requestData{relPath: "/v1/config"}) defer closeResponse(resp) if err != nil { return nil, err } if resp.StatusCode != http.StatusOK { return nil, ht...
// GetSettings retrieves settings from the ArgoCDConfigMap and secret.
func (mgr *SettingsManager) GetSettings() (*ArgoCDSettings, error) { err := mgr.ensureSynced(false) if err != nil { return nil, err } argoCDCM, err := mgr.configmaps.ConfigMaps(mgr.namespace).Get(common.ArgoCDConfigMapName) if err != nil { return nil, err } argoCDSecret, err := mgr.secrets.Secrets(mgr.namesp...
func (a *Application) LeaderSettings() (map[string]string, error) { // There's no compelling reason to have these methods on Application -- and // thus require an extra db read to access them -- but it stops the State // type getting even more cluttered. doc, err := readSettingsDoc(a.st.db(), settingsC, leadership...
// GetSettings retrieves settings from the ArgoCDConfigMap and secret.
func (mgr *SettingsManager) GetSettings() (*ArgoCDSettings, error) { err := mgr.ensureSynced(false) if err != nil { return nil, err } argoCDCM, err := mgr.configmaps.ConfigMaps(mgr.namespace).Get(common.ArgoCDConfigMapName) if err != nil { return nil, err } argoCDSecret, err := mgr.secrets.Secrets(mgr.namesp...
func (b *settingBiz) Get() (setting *model.Setting, err error) { do(func(d dao.Interface) { setting, err = d.SettingGet() }) return }
// GetSettings retrieves settings from the ArgoCDConfigMap and secret.
func (mgr *SettingsManager) GetSettings() (*ArgoCDSettings, error) { err := mgr.ensureSynced(false) if err != nil { return nil, err } argoCDCM, err := mgr.configmaps.ConfigMaps(mgr.namespace).Get(common.ArgoCDConfigMapName) if err != nil { return nil, err } argoCDSecret, err := mgr.secrets.Secrets(mgr.namesp...
func charmConfigFromGetYaml(yamlContents map[string]interface{}) (charm.Settings, error) { onlySettings := charm.Settings{} settingsMap, ok := yamlContents["settings"].(map[interface{}]interface{}) if !ok { return nil, errors.New("unknown format for settings") } for setting := range settingsMap { s, ok := set...
// GetSettings retrieves settings from the ArgoCDConfigMap and secret.
func (mgr *SettingsManager) GetSettings() (*ArgoCDSettings, error) { err := mgr.ensureSynced(false) if err != nil { return nil, err } argoCDCM, err := mgr.configmaps.ConfigMaps(mgr.namespace).Get(common.ArgoCDConfigMapName) if err != nil { return nil, err } argoCDSecret, err := mgr.secrets.Secrets(mgr.namesp...
func (c ConfigStore) Get(ctx context.Context) (*chronograf.Config, error) { return c.Config, nil }
Build a new graph excluding the isolated nodes. :param pybel.BELGraph graph: A BEL graph :rtype: pybel.BELGraph
def remove_isolated_nodes_op(graph): """Build a new graph excluding the isolated nodes. :param pybel.BELGraph graph: A BEL graph :rtype: pybel.BELGraph """ rv = graph.copy() nodes = list(nx.isolates(rv)) rv.remove_nodes_from(nodes) return rv
def get_subgraph_by_second_neighbors(graph, nodes: Iterable[BaseEntity], filter_pathologies: bool = False): """Get a graph around the neighborhoods of the given nodes and expand to the neighborhood of those nodes. Returns none if none of the nodes are in the graph. :param pybel.BELGraph graph: A BEL graph...
Build a new graph excluding the isolated nodes. :param pybel.BELGraph graph: A BEL graph :rtype: pybel.BELGraph
def remove_isolated_nodes_op(graph): """Build a new graph excluding the isolated nodes. :param pybel.BELGraph graph: A BEL graph :rtype: pybel.BELGraph """ rv = graph.copy() nodes = list(nx.isolates(rv)) rv.remove_nodes_from(nodes) return rv
def get_downstream_causal_subgraph(graph, nbunch: Union[BaseEntity, Iterable[BaseEntity]]): """Induce a sub-graph from all of the downstream causal entities of the nodes in the nbunch. :type graph: pybel.BELGraph :rtype: pybel.BELGraph """ return get_subgraph_by_edge_filter(graph, build_downstream_...
Build a new graph excluding the isolated nodes. :param pybel.BELGraph graph: A BEL graph :rtype: pybel.BELGraph
def remove_isolated_nodes_op(graph): """Build a new graph excluding the isolated nodes. :param pybel.BELGraph graph: A BEL graph :rtype: pybel.BELGraph """ rv = graph.copy() nodes = list(nx.isolates(rv)) rv.remove_nodes_from(nodes) return rv
def get_upstream_causal_subgraph(graph, nbunch: Union[BaseEntity, Iterable[BaseEntity]]): """Induce a sub-graph from all of the upstream causal entities of the nodes in the nbunch. :type graph: pybel.BELGraph :rtype: pybel.BELGraph """ return get_subgraph_by_edge_filter(graph, build_upstream_edge_p...
Build a new graph excluding the isolated nodes. :param pybel.BELGraph graph: A BEL graph :rtype: pybel.BELGraph
def remove_isolated_nodes_op(graph): """Build a new graph excluding the isolated nodes. :param pybel.BELGraph graph: A BEL graph :rtype: pybel.BELGraph """ rv = graph.copy() nodes = list(nx.isolates(rv)) rv.remove_nodes_from(nodes) return rv
def simplify_graph(graph): """ strips out everything but connectivity Args: graph (nx.Graph): Returns: nx.Graph: new_graph CommandLine: python3 -m utool.util_graph simplify_graph --show python2 -m utool.util_graph simplify_graph --show python2 -c "import n...
Build a new graph excluding the isolated nodes. :param pybel.BELGraph graph: A BEL graph :rtype: pybel.BELGraph
def remove_isolated_nodes_op(graph): """Build a new graph excluding the isolated nodes. :param pybel.BELGraph graph: A BEL graph :rtype: pybel.BELGraph """ rv = graph.copy() nodes = list(nx.isolates(rv)) rv.remove_nodes_from(nodes) return rv
def _create_complete_graph(node_ids): """Create a complete graph from the list of node ids. Args: node_ids: a list of node ids Returns: An undirected graph (as a networkx.Graph) """ g = nx.Graph() g.add_nodes_from(node_ids) for (i, j) in combinations(node_ids, 2): g...
Create a user-friendly gradient function. By default, gradient functions expect the stack to be passed to them explicitly. This function modifies the function so that the stack doesn't need to be passed and gets initialized in the function body instead. For consistency, gradient functions always return a tupl...
def _create_joint(fwdbwd, func, wrt, input_derivative): """Create a user-friendly gradient function. By default, gradient functions expect the stack to be passed to them explicitly. This function modifies the function so that the stack doesn't need to be passed and gets initialized in the function body instead...
def gradient_factory(name): """Create gradient `Functional` for some ufuncs.""" if name == 'sin': def gradient(self): """Return the gradient operator.""" return cos(self.domain) elif name == 'cos': def gradient(self): """Return the gradient operator.""" ...
Create a user-friendly gradient function. By default, gradient functions expect the stack to be passed to them explicitly. This function modifies the function so that the stack doesn't need to be passed and gets initialized in the function body instead. For consistency, gradient functions always return a tupl...
def _create_joint(fwdbwd, func, wrt, input_derivative): """Create a user-friendly gradient function. By default, gradient functions expect the stack to be passed to them explicitly. This function modifies the function so that the stack doesn't need to be passed and gets initialized in the function body instead...
def _forward_mode(self, *args): """Forward mode differentiation for a sum""" # (f+g)(x) = f(x) + g(x) f_val, f_diff = self.f._forward_mode(*args) g_val, g_diff = self.g._forward_mode(*args) # The function value and derivative is the sum of f and g val = f_val + g_val ...
Create a user-friendly gradient function. By default, gradient functions expect the stack to be passed to them explicitly. This function modifies the function so that the stack doesn't need to be passed and gets initialized in the function body instead. For consistency, gradient functions always return a tupl...
def _create_joint(fwdbwd, func, wrt, input_derivative): """Create a user-friendly gradient function. By default, gradient functions expect the stack to be passed to them explicitly. This function modifies the function so that the stack doesn't need to be passed and gets initialized in the function body instead...
def grad(self, X, *params): """ Return the gradient of the basis function for each parameter. Parameters ---------- X : ndarray (N, d) array of observations where N is the number of samples, and d is the dimensionality of X. *params : optional ...
Create a user-friendly gradient function. By default, gradient functions expect the stack to be passed to them explicitly. This function modifies the function so that the stack doesn't need to be passed and gets initialized in the function body instead. For consistency, gradient functions always return a tupl...
def _create_joint(fwdbwd, func, wrt, input_derivative): """Create a user-friendly gradient function. By default, gradient functions expect the stack to be passed to them explicitly. This function modifies the function so that the stack doesn't need to be passed and gets initialized in the function body instead...
def backward(outputs, out_grads=None, retain_graph=False): """Compute the gradients of outputs w.r.t variables. Parameters ---------- outputs: list of NDArray out_grads: list of NDArray or None """ assert isinstance(outputs, (list, tuple)), \ "outputs must be a list or tuple of NDAr...
Create a user-friendly gradient function. By default, gradient functions expect the stack to be passed to them explicitly. This function modifies the function so that the stack doesn't need to be passed and gets initialized in the function body instead. For consistency, gradient functions always return a tupl...
def _create_joint(fwdbwd, func, wrt, input_derivative): """Create a user-friendly gradient function. By default, gradient functions expect the stack to be passed to them explicitly. This function modifies the function so that the stack doesn't need to be passed and gets initialized in the function body instead...
def gradient(self): """Gradient of the compositon according to the chain rule.""" func = self.left op = self.right class FunctionalCompositionGradient(Operator): """Gradient of the compositon according to the chain rule.""" def __init__(self): "...
Determine whether a given key is filterable @param string $key @return bool
public function isFilterable(string $key): bool { if ($this->filterable === self::ALLOW_ALL) { return true; } return isset($this->filterable[$key]) && $this->filterable[$key]; }
private function isExclude(string $key): bool { if (!empty($this->excludes) && in_array($key, $this->excludes, true)) { return true; } if (!empty($this->only) && !in_array($key, $this->only, true)) { return true; } return false; }
Determine whether a given key is filterable @param string $key @return bool
public function isFilterable(string $key): bool { if ($this->filterable === self::ALLOW_ALL) { return true; } return isset($this->filterable[$key]) && $this->filterable[$key]; }
public function exists(?string $key = null) : bool { $key = $this->constructKey($key); return $this->parseKey($key, function ($part, $result) { return array_key_exists($part, $result); }); }
Determine whether a given key is filterable @param string $key @return bool
public function isFilterable(string $key): bool { if ($this->filterable === self::ALLOW_ALL) { return true; } return isset($this->filterable[$key]) && $this->filterable[$key]; }
public function is(string $key): bool { return isset($this->meta[$key]) && (bool)$this->meta[$key]; }
Determine whether a given key is filterable @param string $key @return bool
public function isFilterable(string $key): bool { if ($this->filterable === self::ALLOW_ALL) { return true; } return isset($this->filterable[$key]) && $this->filterable[$key]; }
public function has($key) { if (count(func_get_args()) > 1) { foreach (func_get_args() as $value) { if ( ! $this->has($value)) return false; } return true; } if (is_bool($this->input($key)) || is_array($this->input($key))) { return true; } return trim((string) $this->input($key)) !=...
Determine whether a given key is filterable @param string $key @return bool
public function isFilterable(string $key): bool { if ($this->filterable === self::ALLOW_ALL) { return true; } return isset($this->filterable[$key]) && $this->filterable[$key]; }
protected function filterWouldMatch($filterValue, $value, $key) { if ($value === null) { return $filterValue === null; } if (is_array($filterValue)) { return is_array($value) ? $filterValue == $value : in_array($value, $filterValue); } if (is_numeric...
Borrow an object from the pool, or create a new object if no valid objects in the pool @return {@link Entry} to the pooled object @throws E exception thrown by initializer
public Entry borrow() throws E { long now = System.currentTimeMillis(); if (timeout > 0) { long accessed_ = accessed.get(); if (now > accessed_ + Time.SECOND && accessed.compareAndSet(accessed_, now)) { Entry entry; while ((entry = deque.pollLast()) != null) { // inactiveCount.decrem...
public T borrowObject() { T object; if ((object = pool.poll()) == null) { object = createObject(); } return object; }
Borrow an object from the pool, or create a new object if no valid objects in the pool @return {@link Entry} to the pooled object @throws E exception thrown by initializer
public Entry borrow() throws E { long now = System.currentTimeMillis(); if (timeout > 0) { long accessed_ = accessed.get(); if (now > accessed_ + Time.SECOND && accessed.compareAndSet(accessed_, now)) { Entry entry; while ((entry = deque.pollLast()) != null) { // inactiveCount.decrem...
func NewObjectPool(ctx context.Context, factory PooledObjectFactory, config *ObjectPoolConfig) *ObjectPool { return NewObjectPoolWithAbandonedConfig(ctx, factory, config, nil) }
Borrow an object from the pool, or create a new object if no valid objects in the pool @return {@link Entry} to the pooled object @throws E exception thrown by initializer
public Entry borrow() throws E { long now = System.currentTimeMillis(); if (timeout > 0) { long accessed_ = accessed.get(); if (now > accessed_ + Time.SECOND && accessed.compareAndSet(accessed_, now)) { Entry entry; while ((entry = deque.pollLast()) != null) { // inactiveCount.decrem...
public static Object instantiate(Class clazz) throws InstantiationException { Object result = null; try { result = ClassHelper.newInstance(clazz); } catch(IllegalAccessException e) { try { result = ClassHe...
Borrow an object from the pool, or create a new object if no valid objects in the pool @return {@link Entry} to the pooled object @throws E exception thrown by initializer
public Entry borrow() throws E { long now = System.currentTimeMillis(); if (timeout > 0) { long accessed_ = accessed.get(); if (now > accessed_ + Time.SECOND && accessed.compareAndSet(accessed_, now)) { Entry entry; while ((entry = deque.pollLast()) != null) { // inactiveCount.decrem...
@SuppressWarnings("unchecked") public T get() { try { isLoaded(); return (T) this; } catch (Error e) { load(); } isLoaded(); return (T) this; }
Borrow an object from the pool, or create a new object if no valid objects in the pool @return {@link Entry} to the pooled object @throws E exception thrown by initializer
public Entry borrow() throws E { long now = System.currentTimeMillis(); if (timeout > 0) { long accessed_ = accessed.get(); if (now > accessed_ + Time.SECOND && accessed.compareAndSet(accessed_, now)) { Entry entry; while ((entry = deque.pollLast()) != null) { // inactiveCount.decrem...
public java.util.List<ObjectId> getObjectId() { if (objectId == null) { objectId = new ArrayList<ObjectId>(); } return this.objectId; }
Creates a new Server object. Also creates an HTTP server to start listening for XML-RPC method calls. Will emit an event with the XML-RPC call's method name when receiving a method call. @constructor @param {Object|String} options - The HTTP server options. Either a URI string (e.g. 'http://localhost:9090') or an obje...
function Server(options, isSecure, onListening) { if (false === (this instanceof Server)) { return new Server(options, isSecure) } onListening = onListening || function() {} var that = this // If a string URI is passed in, converts to URI fields if (typeof options === 'string') { options = url.par...
function Client(options, isSecure) { // Invokes with new if called without if (false === (this instanceof Client)) { return new Client(options, isSecure) } // If a string URI is passed in, converts to URI fields if (typeof options === 'string') { options = url.parse(options) options.host = optio...
Creates a new Server object. Also creates an HTTP server to start listening for XML-RPC method calls. Will emit an event with the XML-RPC call's method name when receiving a method call. @constructor @param {Object|String} options - The HTTP server options. Either a URI string (e.g. 'http://localhost:9090') or an obje...
function Server(options, isSecure, onListening) { if (false === (this instanceof Server)) { return new Server(options, isSecure) } onListening = onListening || function() {} var that = this // If a string URI is passed in, converts to URI fields if (typeof options === 'string') { options = url.par...
function(options) { EventEmitter.call(this); this.node = options.node; this.https = options.https || this.node.https; this.httpsOptions = options.httpsOptions || this.node.httpsOptions; this.bwsPort = options.bwsPort || baseConfig.port; this.messageBrokerPort = options.messageBrokerPort || 3380; if (base...
Creates a new Server object. Also creates an HTTP server to start listening for XML-RPC method calls. Will emit an event with the XML-RPC call's method name when receiving a method call. @constructor @param {Object|String} options - The HTTP server options. Either a URI string (e.g. 'http://localhost:9090') or an obje...
function Server(options, isSecure, onListening) { if (false === (this instanceof Server)) { return new Server(options, isSecure) } onListening = onListening || function() {} var that = this // If a string URI is passed in, converts to URI fields if (typeof options === 'string') { options = url.par...
function(config){ this.options = { hostname : config.url, port : 443, path : '', //override method : '', //override auth : config.user + ':' + config.passwd, headers : config.headers }; }
Creates a new Server object. Also creates an HTTP server to start listening for XML-RPC method calls. Will emit an event with the XML-RPC call's method name when receiving a method call. @constructor @param {Object|String} options - The HTTP server options. Either a URI string (e.g. 'http://localhost:9090') or an obje...
function Server(options, isSecure, onListening) { if (false === (this instanceof Server)) { return new Server(options, isSecure) } onListening = onListening || function() {} var that = this // If a string URI is passed in, converts to URI fields if (typeof options === 'string') { options = url.par...
function Server(opts){ // Shorthand, no "new" required. if (!(this instanceof Server)) return new Server(...arguments); if (typeof opts !== 'object') opts = {}; this.clients = opts.dummies || []; this.server = opts.server || new SocketServer(socket => { let client = new Client(socket); this...
Creates a new Server object. Also creates an HTTP server to start listening for XML-RPC method calls. Will emit an event with the XML-RPC call's method name when receiving a method call. @constructor @param {Object|String} options - The HTTP server options. Either a URI string (e.g. 'http://localhost:9090') or an obje...
function Server(options, isSecure, onListening) { if (false === (this instanceof Server)) { return new Server(options, isSecure) } onListening = onListening || function() {} var that = this // If a string URI is passed in, converts to URI fields if (typeof options === 'string') { options = url.par...
function Connection(options) { if (!(this instanceof Connection)){ return new Connection(options); } this.prefixCounter = 0; this.serverMessages = {}; this._options = { username: options.username || options.user || '', password: options.password || '', host: options.host || 'localhost', port: optio...
Convenient decorator. Allows easy registering of functions to this dispatcher. Example: .. code-block:: python dispatch = RPCDispatcher() @dispatch.public def foo(bar): # ... class Baz(object): def not_exposed(self): ...
def public(self, name=None): """Convenient decorator. Allows easy registering of functions to this dispatcher. Example: .. code-block:: python dispatch = RPCDispatcher() @dispatch.public def foo(bar): # ... class Baz(object): ...
def alias(*aliases): """ Decorating a class with @alias('FOO', 'BAR', ..) allows the class to be referenced by each of the names provided as arguments. """ def decorator(cls): # alias must be set in globals from caller's frame caller = sys._getframe(1) globals_dict = caller.f...
Convenient decorator. Allows easy registering of functions to this dispatcher. Example: .. code-block:: python dispatch = RPCDispatcher() @dispatch.public def foo(bar): # ... class Baz(object): def not_exposed(self): ...
def public(self, name=None): """Convenient decorator. Allows easy registering of functions to this dispatcher. Example: .. code-block:: python dispatch = RPCDispatcher() @dispatch.public def foo(bar): # ... class Baz(object): ...
def register(self, f, *args, **kwargs): """ Register a function and arguments to be called later. """ self._functions.append(lambda: f(*args, **kwargs))
Convenient decorator. Allows easy registering of functions to this dispatcher. Example: .. code-block:: python dispatch = RPCDispatcher() @dispatch.public def foo(bar): # ... class Baz(object): def not_exposed(self): ...
def public(self, name=None): """Convenient decorator. Allows easy registering of functions to this dispatcher. Example: .. code-block:: python dispatch = RPCDispatcher() @dispatch.public def foo(bar): # ... class Baz(object): ...
def _register_handler(event, fun, external=False): """Register a function to be an event handler""" registry = core.HANDLER_REGISTRY if external: registry = core.EXTERNAL_HANDLER_REGISTRY if not isinstance(event, basestring): # If not basestring, it is a BaseEvent subclass. # Th...
Convenient decorator. Allows easy registering of functions to this dispatcher. Example: .. code-block:: python dispatch = RPCDispatcher() @dispatch.public def foo(bar): # ... class Baz(object): def not_exposed(self): ...
def public(self, name=None): """Convenient decorator. Allows easy registering of functions to this dispatcher. Example: .. code-block:: python dispatch = RPCDispatcher() @dispatch.public def foo(bar): # ... class Baz(object): ...
def add_handlers(self, namespace): """ Add handler functions from the given `namespace`, for instance a module. The namespace may be a string, in which case it is expected to be a name of a module. It may also be a dictionary mapping names to functions. Only non-underscore-pref...
Convenient decorator. Allows easy registering of functions to this dispatcher. Example: .. code-block:: python dispatch = RPCDispatcher() @dispatch.public def foo(bar): # ... class Baz(object): def not_exposed(self): ...
def public(self, name=None): """Convenient decorator. Allows easy registering of functions to this dispatcher. Example: .. code-block:: python dispatch = RPCDispatcher() @dispatch.public def foo(bar): # ... class Baz(object): ...
def parametrized_class(decorator): '''Decorator used to make simple class decorator with arguments. Doesn't really do anything, just here to have a central implementation of the simple class decorator.''' def decorator_builder(*args, **kwargs): def meta_decorator(cls): return decor...
Collects information about the number of edit actions belonging to keys in a supplied dictionary of object or changeset ids. Parameters ---------- collation : dict A dictionary of OpenStreetMap object or changeset ids. first_axis : string An object or changeset key for the collatio...
def _collate_data(collation, first_axis, second_axis): """ Collects information about the number of edit actions belonging to keys in a supplied dictionary of object or changeset ids. Parameters ---------- collation : dict A dictionary of OpenStreetMap object or changeset ids. firs...
def generate_csv(data): """Generate a CSV of the abilities for easy commenting.""" print(",".join([ "ability_id", "link_name", "link_index", "button_name", "hotkey", "friendly_name", "remap_to", "mismatch", ])) for ability in sorted(six.itervalues(data.abilities),...
Collects information about the number of edit actions belonging to keys in a supplied dictionary of object or changeset ids. Parameters ---------- collation : dict A dictionary of OpenStreetMap object or changeset ids. first_axis : string An object or changeset key for the collatio...
def _collate_data(collation, first_axis, second_axis): """ Collects information about the number of edit actions belonging to keys in a supplied dictionary of object or changeset ids. Parameters ---------- collation : dict A dictionary of OpenStreetMap object or changeset ids. firs...
def get_actions(self, request, view): """ Return metadata for resource-specific actions, such as start, stop, unlink """ metadata = OrderedDict() actions = self.get_resource_actions(view) resource = view.get_object() for action_name, action in actions.ite...
Collects information about the number of edit actions belonging to keys in a supplied dictionary of object or changeset ids. Parameters ---------- collation : dict A dictionary of OpenStreetMap object or changeset ids. first_axis : string An object or changeset key for the collatio...
def _collate_data(collation, first_axis, second_axis): """ Collects information about the number of edit actions belonging to keys in a supplied dictionary of object or changeset ids. Parameters ---------- collation : dict A dictionary of OpenStreetMap object or changeset ids. firs...
private void registerRefEntityIndexActions() { // bidirectional attribute: register indexing actions for other side getEntityType() .getMappedByAttributes() .forEach( mappedByAttr -> { EntityType refEntity = mappedByAttr.getRefEntity(); indexActionRegister...
Collects information about the number of edit actions belonging to keys in a supplied dictionary of object or changeset ids. Parameters ---------- collation : dict A dictionary of OpenStreetMap object or changeset ids. first_axis : string An object or changeset key for the collatio...
def _collate_data(collation, first_axis, second_axis): """ Collects information about the number of edit actions belonging to keys in a supplied dictionary of object or changeset ids. Parameters ---------- collation : dict A dictionary of OpenStreetMap object or changeset ids. firs...
def _parse_action(self, action, current_time): """Parse a player action. TODO: handle cancels """ if action.action_type == 'research': name = mgz.const.TECHNOLOGIES[action.data.technology_type] self._research[action.data.player_id].append({ 'techn...
Collects information about the number of edit actions belonging to keys in a supplied dictionary of object or changeset ids. Parameters ---------- collation : dict A dictionary of OpenStreetMap object or changeset ids. first_axis : string An object or changeset key for the collatio...
def _collate_data(collation, first_axis, second_axis): """ Collects information about the number of edit actions belonging to keys in a supplied dictionary of object or changeset ids. Parameters ---------- collation : dict A dictionary of OpenStreetMap object or changeset ids. firs...
def get_indices(self, include_aliases=False): """ Get a dict holding an entry for each index which exists. If include_alises is True, the dict will also contain entries for aliases. The key for each entry in the dict is the index or alias name. The value is a dict hold...