language
stringclasses
2 values
func_code_string
stringlengths
63
466k
java
protected void setSerializationService(ServiceReference<SerializationService> ref) { if (TraceComponent.isAnyTracingEnabled() && LoggingUtil.SESSION_LOGGER_WAS.isLoggable(Level.FINE)) { LoggingUtil.SESSION_LOGGER_WAS.logp(Level.FINE, methodClassName, "setSerializationService", "setting " + ref); ...
java
public void service(ServletRequest req, ServletResponse res) throws ServletException, IOException { // Check if we should replace this request if (req instanceof HttpServletRequest) { HttpServletRequest httpServletRequest = (HttpServletRequest) req; if (!isProxied(httpServletRequ...
python
def mnl_estimate(data, chosen, numalts, GPU=False, coeffrange=(-3, 3), weights=None, lcgrad=False, beta=None): """ Calculate coefficients of the MNL model. Parameters ---------- data : 2D array The data are expected to be in "long" form where each row is for one alt...
python
def find_lines(filename, **pattern): """Find a line (JSON-formatted) in the given file where all keys in `pattern` are present as keys in the line's JSON, and where their values equal the corresponding values in `pattern`. Additional keys in the line are ignored. If no matching line is found, or if ...
python
def notification_on_post_create_historical_record( instance, history_date, history_user, history_change_reason, **kwargs ): """Checks and processes any notifications for this model. Processes if `label_lower` is in site_notifications.models. Note, this is the post_create of the historical model. "...
python
def update_firmware(node): """Performs SUM based firmware update on the node. This method performs SUM firmware update by mounting the SPP ISO on the node. It performs firmware update on all or some of the firmware components. :param node: A node object of type dict. :returns: Operation Status...
java
public static boolean isPortletEnvSupported() { if (enabled == null) { synchronized (PortletSupport.class) { if (enabled == null) { try { PortletSupport.class.getClassLoader().loadClass("javax.portlet.PortletContext"); ...
java
public List<NamedNativeQuery<OrmDescriptor>> getAllNamedNativeQuery() { List<NamedNativeQuery<OrmDescriptor>> list = new ArrayList<NamedNativeQuery<OrmDescriptor>>(); List<Node> nodeList = model.get("named-native-query"); for(Node node: nodeList) { NamedNativeQuery<OrmDescriptor> ty...
java
private void exportRelationships(PrintWriter out, Reporter reporter, int batchSize) { if (graph.getRelationships().iterator().hasNext()) { begin(out); appendRelationships(out, batchSize, reporter); commit(out); out.flush(); } }
python
def plot_sensitivity(self, config_nr=None, sens_data=None, mag_only=False, absv=False, **kwargs): """Create a nice looking plot of the sensitivity distribution for the given configuration nr. Configs start at 1! Parameters ---------- ...
java
@NotNull public static Map<String, String> getFailureResultsMap(@NotNull final String errorMessage) { final Map<String, String> results = new HashMap<>(); results.put(OutputNames.RETURN_CODE, ReturnCodes.FAILURE); results.put(OutputNames.RETURN_RESULT, errorMessage); results.put(Outp...
python
def _clone_and_score_clusterer(clf, X, n_clusters): """Clones and scores clusterer instance. Args: clf: Clusterer instance that implements ``fit``,``fit_predict``, and ``score`` methods, and an ``n_clusters`` hyperparameter. e.g. :class:`sklearn.cluster.KMeans` instance ...
java
boolean cleanupBadClusters( LloydsIterationTask task, final Vec[] vecs, final double[][] centers, final double[] means, final double[] mults, final int[] modes ) { // Find any bad clusters int clu; for( clu=0; clu<centers.length; clu++ ) if( task._size[clu] == 0 ) break; if( clu == cente...
java
public <V> Reflecter<T> populate(Map<String, V> properties, String... excludes) { return populate(properties, Arrays.asList(excludes)); }
python
def context(self, key, method): """A helper method to attach a value within context. :param key: the key attached to the context. :param method: the constructor function. :return: the value attached to the context. """ ctx = stack.top if ctx is not None: ...
java
public <T extends WebServiceTemplate> T build(Class<T> webServiceTemplateClass) { Assert.notNull(webServiceTemplateClass, "WebServiceTemplateClass must not be null"); return configure(BeanUtils.instantiateClass(webServiceTemplateClass)); }
python
def geturl(self): """ Returns the URL that was the source of this response. If the request that generated this response redirected, this method will return the final redirect location. """ if self.retries is not None and len(self.retries.history): return self....
java
public ArrayList<OvhMigration> project_serviceName_migration_GET(String serviceName) throws IOException { String qPath = "/cloud/project/{serviceName}/migration"; StringBuilder sb = path(qPath, serviceName); String resp = exec(qPath, "GET", sb.toString(), null); return convertTo(resp, t10); }
java
protected static Type getTypeArgument(GenericType type, int index) { GenericType arg = type.getTypeArgument(index); if (arg != null) { return new Type(arg); } // unknown type, so return object return Type.OBJECT_TYPE; }
python
def write_pid(self, pid): """ Write pid to the pid file :param pid: pid of the process :type pid: None | int :return: None """ self.fpid.seek(0) self.fpid.truncate() self.fpid.write("%d" % pid) self.fpid.close() del self.fpid
java
public void serviceName_ips_ip_DELETE(String serviceName, String ip) throws IOException { String qPath = "/xdsl/{serviceName}/ips/{ip}"; StringBuilder sb = path(qPath, serviceName, ip); exec(qPath, "DELETE", sb.toString(), null); }
python
def authenticate_key(api_key): """ Authenticate an API key against our database :param api_key: :return: authenticated username """ user_model = Query() user = db.search(user_model.api_key == api_key)[0] if user: return user['username'] return False
java
public Object getExprValue(int id){ if (tc.isEntryEnabled()) tc.entry(this,cclass, "getExprValue", "id: " + new Integer(id)); Object result = null; if (cacheTag[id] == generation) result = cacheValue[id]; if (tc.isEntryEnabled()) tc.exit(this,cclass, "getExprValue","result: " + result)...
java
public static Optional<Path> createDirectories(Path dirPath, FileAttribute<?>... attrs) { debug(log, "createDirectories", dirPath, attrs); try { return Optional.of(Files.createDirectories(dirPath, attrs)); } catch (Exception e) { return JMExceptionManager.hand...
java
public ServiceFuture<List<ExpressRouteCrossConnectionPeeringInner>> listAsync(final String resourceGroupName, final String crossConnectionName, final ListOperationCallback<ExpressRouteCrossConnectionPeeringInner> serviceCallback) { return AzureServiceFuture.fromPageResponse( listSinglePageAsync(reso...
python
def TypeUrlToMessage(type_url): """Returns a message instance corresponding to a given type URL.""" if not type_url.startswith(TYPE_URL_PREFIX): raise ValueError("Type URL has to start with a prefix %s: %s" % (TYPE_URL_PREFIX, type_url)) full_name = type_url[len(TYPE_URL_PREFIX):] try...
python
def execute_request(self, action, path, data=None, headers_ext=None): """Generate request to WebDAV server for specified action and path and execute it. :param action: the action for WebDAV server which should be executed. :param path: the path to resource for action :param data: (optio...
java
private void processCustomValueLists() throws IOException { DirectoryEntry taskDir = (DirectoryEntry) m_projectDir.getEntry("TBkndTask"); Props taskProps = new Props12(m_inputStreamFactory.getInstance(taskDir, "Props")); CustomFieldValueReader12 reader = new CustomFieldValueReader12(m_file.getProj...
java
public static String escapeJson(final String text) { return escapeJson(text, JsonEscapeType.SINGLE_ESCAPE_CHARS_DEFAULT_TO_UHEXA, JsonEscapeLevel.LEVEL_2_ALL_NON_ASCII_PLUS_BASIC_ESCAPE_SET); }
java
@CheckReturnValue public <NewReqT, NewRespT> Builder<NewReqT, NewRespT> toBuilder( Marshaller<NewReqT> requestMarshaller, Marshaller<NewRespT> responseMarshaller) { return MethodDescriptor.<NewReqT, NewRespT>newBuilder() .setRequestMarshaller(requestMarshaller) .setResponseMarshaller(respons...
java
public InputStream loadTemplate(String fileName) throws IOException { Path currentPath=new Path(fileName); return openFile(currentPath); }
java
public static CallCredentials bearerAuth(final String token) { final Metadata extraHeaders = new Metadata(); extraHeaders.put(AUTHORIZATION_HEADER, BEARER_AUTH_PREFIX + token); return new StaticSecurityHeaderCallCredentials(extraHeaders); }
java
public static String decodeObjectAndDate(String type) { return type.replace("object", Object.class.getName()).replace("date", Date.class.getName()); }
python
def get_key_from_url(self, url): """ parses the url into a list of folder locations We take a URL like: http://rest.ensembl.org/sequence/id/ENST00000538324?type=genomic;expand_3prime=10;expand_5prime=10 and turn it into 'sequence.id.ENST00000538324.genomic' ...
python
def current_batch(self): """Return the batch id for the tag. :return: :class: `int` current batch id """ current_batch = memcache.get(self.group_key) if not current_batch: memcache.add(self.group_key, 1) current_batch = 1 return current_batch
python
def clean(self): """Clear the contents of the build area.""" if os.path.exists(self.buildroot): log.info('Clearing the build area.') log.debug('Deleting: %s', self.buildroot) shutil.rmtree(self.buildroot) os.makedirs(self.buildroot)
python
def sign(message: bytes, sign_key: SignKey) -> Signature: """ Signs the message and returns signature. :param: message - Message to sign :param: sign_key - Sign key :return: Signature """ logger = logging.getLogger(__name__) logger.debug("Bls::sign: >>> ...
java
public ServerUpdater removeRolesFromUser(User user, Collection<Role> roles) { delegate.removeRolesFromUser(user, roles); return this; }
python
def to_json(self): """Inherit doc.""" current_iter = None if self._current_iter: current_iter = self._current_iter.to_json() return {"key_ranges": self._key_ranges.to_json(), "query_spec": self._query_spec.to_json(), "current_iter": current_iter, "key_range_ite...
python
def invert_permutation(permutation): """Compute the image tuple of the inverse permutation. :param permutation: A valid (cf. :py:func:check_permutation) permutation. :return: The inverse permutation tuple :rtype: tuple """ return tuple([permutation.index(p) for p in range(len(permutation))])
java
public void marshall(CreateThingGroupRequest createThingGroupRequest, ProtocolMarshaller protocolMarshaller) { if (createThingGroupRequest == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); } try { protocolMarshaller.marshall(createThin...
python
def libvlc_media_player_set_position(p_mi, f_pos): '''Set movie position as percentage between 0.0 and 1.0. This has no effect if playback is not enabled. This might not work depending on the underlying input format and protocol. @param p_mi: the Media Player. @param f_pos: the position. ''' ...
java
public boolean skipTemplate(EnclosingScope scope) { int start = index; if (tryAndMatch(false, LeftAngle) == null) { return true; } else { boolean firstTime = true; while (tryAndMatch(false, RightAngle) == null) { if (!firstTime && tryAndMatch(false,Comma) == null) { // Failed to match a comma. ...
python
def form_lines_valid(self, form): """Handle a valid LineFormSet.""" handled = 0 for inner_form in form: if not inner_form.cleaned_data.get(formsets.DELETION_FIELD_NAME): handled += 1 self.handle_inner_form(inner_form) self.log_and_notify_lines...
java
public void setValue(Object value) { if(LOGGER.isInfoEnabled() && !(value instanceof java.io.Serializable)) LOGGER.info("Warning: setting a filter value tiat is not serializable. The Filter object is serializable and should contain only serializable state"); _value = value; }
python
def starting_offset(source_code, offset): """Return the offset in which the completion should be inserted Usually code assist proposals should be inserted like:: completion = proposal.name result = (source_code[:starting_offset] + completion + source_code[offset:]) Where...
python
async def unban_chat_member(self, chat_id: typing.Union[base.Integer, base.String], user_id: base.Integer) -> base.Boolean: """ Use this method to unban a previously kicked user in a supergroup or channel. ` The user will not return to the group or channel automat...
python
def _parse_args(args): """ Interpret command line arguments. :param args: `sys.argv` :return: The populated argparse namespace. """ parser = argparse.ArgumentParser(prog='nibble', description='Speed, distance and time ' ...
python
def fill_backward_with_list(self, please_stop=None): ''' Expects requests of the tuple form: (parent_cset, timestamp) parent_cset can be an int X to go back by X changesets, or a string to search for going backwards in time. If timestamp is false, no timestamps will be added to t...
java
@XmlElementDecl(namespace = "http://www.opengis.net/gml", name = "coordinateReferenceSystemRef") public JAXBElement<CoordinateReferenceSystemRefType> createCoordinateReferenceSystemRef(CoordinateReferenceSystemRefType value) { return new JAXBElement<CoordinateReferenceSystemRefType>(_CoordinateReferenceSyst...
java
public static void resetModelClass() { ModelFactory.modelClass = DefaultModelImpl.class; System.err.println("[INFO] Reset model-class: " + ModelFactory.modelClass.getName()); }
java
public static Path appendAndClose(String filePath, Charset charset, String writingString) { return new JMFileAppender(filePath, charset).append(writingString) .closeAndGetFilePath(); }
python
def _save_file(self, data, path): """Save an file to the specified path. :param data: binary data of the file :param path: path to save the file to """ with open(path, 'wb') as tfile: for chunk in data: tfile.write(chunk)
java
@SuppressWarnings({ "rawtypes" }) public static void printList(List list, String name) { if (list == null) { System.out.println("json info " + name + "::null"); return; } if (list.size() == 0) { System.out.println("json info " + name + "::"); return; } for (int i = 0; i < list.size(); i++) { O...
python
def deserialize_pem(cert_pem): """Deserialize PEM (Base64) encoded X.509 v3 certificate. Args: cert_pem: str or bytes PEM (Base64) encoded X.509 v3 certificate Returns: cert_obj: cryptography.Certificate """ if isinstance(cert_pem, str): cert_pem = cert_pem.encode("utf...
java
@Override final CancellableTask<K, T> scheduleImpl(T task, long period, TimeUnit unit) { return new HashedWheelTimerTask<>(executor, task, period, unit); }
java
public static <T> DStreamJavaFunctions<T> javaFunctions(JavaDStream<T> dStream) { return new DStreamJavaFunctions<>(dStream.dstream()); }
java
public void info(Object message) { doLog(Level.INFO, FQCN, message, null, null); }
java
public FSArray getGoldenGrammarErrors() { if (GoldenSentence_Type.featOkTst && ((GoldenSentence_Type) jcasType).casFeat_goldenGrammarErrors == null) jcasType.jcas.throwFeatMissing("goldenGrammarErrors", "cogroo.uima.GoldenSentence"); return (FSArray) (jcasType.ll_cas.ll_getFSForRef(jcasT...
java
@Bean public AmqpMessageHandlerService amqpMessageHandlerService(final RabbitTemplate rabbitTemplate, final AmqpMessageDispatcherService amqpMessageDispatcherService, final ControllerManagement controllerManagement, final EntityFactory entityFactory) { return new AmqpMessageHandlerSe...
java
public ApiResponse<ApiSuccessResponse> setDNDOffWithHttpInfo(DndOffBody dndOffBody) throws ApiException { com.squareup.okhttp.Call call = setDNDOffValidateBeforeCall(dndOffBody, null, null); Type localVarReturnType = new TypeToken<ApiSuccessResponse>(){}.getType(); return apiClient.execute(call,...
java
public RaConnector getProcessedConnector() throws ResourceAdapterInternalException { final boolean trace = TraceComponent.isAnyTracingEnabled(); String jcaVersion = getAdapterVersion(deploymentDescriptor); boolean processAnno = checkProcessAnnotations(deploymentDescriptor, jcaVersion); ...
python
def set_servo_pulsewidth(self, user_gpio, pulsewidth): """ Starts (500-2500) or stops (0) servo pulses on the GPIO. user_gpio:= 0-31. pulsewidth:= 0 (off), 500 (most anti-clockwise) - 2500 (most clockwise). The selected pulsewidth will continue to be transmi...
python
def drop_duplicates(self, subset=None, keep='min'): """Return DataFrame with duplicate rows (excluding index) removed, optionally only considering subset columns. Note that the row order is NOT maintained due to hashing. Parameters ---------- subset : list of str, optio...
python
def templatesCollector(text, open, close): """leaves related articles and wikitables in place""" others = [] spans = [i for i in findBalanced(text, open, close)] spanscopy = copy(spans) for i in range(len(spans)): start, end = spans[i] o = text[start:end] ol = o.lower() ...
python
def write(gmt, out_path): """ Write a GMT to a text file. Args: gmt (GMT object): list of dicts out_path (string): output path Returns: None """ with open(out_path, 'w') as f: for _, each_dict in enumerate(gmt): f.write(each_dict[SET_IDENTIFIER_FIELD] +...
java
public void addRuleSet (String prefix, TileSetRuleSet ruleset) { // configure the ruleset with the appropriate prefix ruleset.setPrefix(prefix); // and have it set itself up with the digester _digester.addRuleSet(ruleset); // add a set next rule which will put tilesets with...
python
def _modifier(self, operator, params): ''' $orderby: sorts the results of a query in ascending (1) or descending (-1) order. ''' if operator == '$orderby': order_types = {-1: 'DESC', 1: 'ASC'} if not isinstance(params, dict): raise RuntimeError...
python
def _set_fcoe_config(self, v, load=False): """ Setter method for fcoe_config, mapped from YANG variable /rbridge_id/fcoe_config (container) If this variable is read-only (config: false) in the source YANG file, then _set_fcoe_config is considered as a private method. Backends looking to populate thi...
python
def to_string(cls, error_code): """Returns the string message for the given ``error_code``. Args: cls (JLinkWriteErrors): the ``JLinkWriteErrors`` class error_code (int): error code to convert Returns: An error string corresponding to the error code. Rais...
java
@Handler(priority = 1000) public void onProtocolSwitchAccepted( ProtocolSwitchAccepted event, IOSubchannel channel) { event.requestEvent().associated(Selection.class) .ifPresent( selection -> channel.setAssociated(Selection.class, selection)); }
java
public static <S> List<Class<? extends S>> load(Class<S> service) { return load(service, null); }
python
def set_fig_y_label(self, ylabel, **kwargs): """Set overall figure y. Set label for y axis on overall figure. This is not for a specific plot. It will place the label on the figure at the left with a call to ``fig.text``. Args: ylabel (str): ylabel for entire figure. ...
python
def faulty(): ''' Display list of faulty resources CLI Example: .. code-block:: bash salt '*' fmadm.faulty ''' fmadm = _check_fmadm() cmd = '{cmd} faulty'.format( cmd=fmadm, ) res = __salt__['cmd.run_all'](cmd) result = {} if res['stdout'] == '': re...
java
private boolean sendResponse(String respondToURL, String payloadType, ResponseWrapper payload) { // This method will likely need some thought and care in the error handling // and error reporting // It's a had job at the moment. String responseStr = null; String contentType = null; // MIME type ...
python
def reset(self): """ Kills old session and creates a new one with no proxies or headers """ # Kill old connection self.quit() # Clear chrome configs self.opts = webdriver.ChromeOptions() # Create new web driver self._create_session()
java
public void removeTrack(int playlistIndex) { checkState(); SoundCloudTrack currentTrack = mPlayerPlaylist.getCurrentTrack(); SoundCloudTrack removedTrack = mPlayerPlaylist.remove(playlistIndex); if (removedTrack == null) { // nothing removed return; } ...
java
protected int rearrangePoints(int[] indices, final int startidx, final int endidx, final int splitDim, final double splitVal) { int tmp, left = startidx - 1; for (int i = startidx; i <= endidx; i++) { if (m_EuclideanDistance.valueIsSmallerEqual(m_Instances .instance(indices[i...
java
@Override public <T> GraphRequest<T> graph(String object, TypeReference<T> type, Param... params) { return this.graph(object, mapper.getTypeFactory().constructType(type), params); }
java
@Nonnull public static ESuccess writeToFile (@Nonnull final IMicroNode aNode, @Nonnull final Path aPath) { return writeToFile (aNode, aPath, XMLWriterSettings.DEFAULT_XML_SETTINGS); }
python
def read(self, symbol, chunk_range=None, filter_data=True, **kwargs): """ Reads data for a given symbol from the database. Parameters ---------- symbol: str, or list of str the symbol(s) to retrieve chunk_range: object corresponding range object f...
python
def check_integrity(filename): """Checks the integrity of an InferenceFile. Checks done are: * can the file open? * do all of the datasets in the samples group have the same shape? * can the first and last sample in all of the datasets in the samples group be read? If an...
java
public ServiceFuture<Void> exportAsync(String vaultName, String resourceGroupName, final ServiceCallback<Void> serviceCallback) { return ServiceFuture.fromResponse(exportWithServiceResponseAsync(vaultName, resourceGroupName), serviceCallback); }
python
def find_all(self, predicate): """Returns a generator that produces a sequence of Entry objects for which the predicate returned True. Args: predicate: A callable that returns a value coercible to bool. """ for _nid, entry in self._registry.items(): if predicate(...
python
def last_bed_temp(self): """Return avg bed temperature for last session.""" try: bedtemps = self.intervals[1]['timeseries']['tempBedC'] except KeyError: return None tmp = 0 num_temps = len(bedtemps) if num_temps == 0: return None ...
python
def parse_int_literal(ast, _variables=None): """Parse an integer value node in the AST.""" if isinstance(ast, IntValueNode): num = int(ast.value) if MIN_INT <= num <= MAX_INT: return num return INVALID
java
public long getGranularity() { long now = env.currentTimeMillis(); long curr = lastSampleTime.get(); if (now - curr > periodMillis && lastSampleTime.compareAndSet(curr, now)) { samples[sampleIndex] = sampleGranularity(); sampleIndex = (sampleIndex + 1) % s...
java
@Override protected void runUnsafe() throws Exception { Path reportDirectory = getReportDirectoryPath(); Files.walkFileTree(reportDirectory, new DeleteVisitor()); LOGGER.info("Report directory <{}> was successfully cleaned.", reportDirectory); }
python
def run(analysis, path=None, name=None, info=None, **kwargs): """Run a single analysis. :param Analysis analysis: Analysis class to run. :param str path: Path of analysis. Can be `__file__`. :param str name: Name of the analysis. :param dict info: Optional entries are ``version``, ``title``, ...
java
private void addLine(Content pre, String line, int currentLineNo) { if (line != null) { pre.addContent(Util.replaceTabs(configuration, line)); Content anchor = HtmlTree.A_NAME("line." + Integer.toString(currentLineNo)); pre.addContent(anchor); pre.addContent(NEW_L...
python
def upload_rabbitmq_environment_conf(template_name=None, context=None, restart=True): """Upload RabbitMQ environment configuration from a template.""" template_name = template_name or u'rabbitmq/rabbitmq-env.conf' destination = u'/etc/rabbitmq/rabbitmq-env.conf' upload_template(template_name, desti...
python
def wrap_fmin_slsqp(fun, guess, opt_kwargs={}): """Wrapper for :py:func:`fmin_slsqp` to allow it to be called with :py:func:`minimize`-like syntax. This is included to enable the code to run with :py:mod:`scipy` versions older than 0.11.0. Accepts `opt_kwargs` in the same format as used by :py:fun...
java
public void free() { for (int i = m_vKeyFieldList.size() - 1 ; i >= 0 ;i--) { KeyField keyField = (KeyField)m_vKeyFieldList.elementAt(i); keyField.free(); } super.free(); }
java
@Override public QStringValue appendSQL(final SQLSelect _sql) { if (this.noEscape) { _sql.addValuePart(this.value); } else { _sql.addEscapedValuePart(this.value); } return this; }
python
def parse_block_scalar_indent(token_class): """Process indentation spaces in a block scalar.""" def callback(lexer, match, context): text = match.group() if context.block_scalar_indent is None: if len(text) <= max(context.indent, 0): context.st...
python
def set_stack(self, stack_dump, stack_top): """ Stack dump is a dump of the stack from gdb, i.e. the result of the following gdb command : ``dump binary memory [stack_dump] [begin_addr] [end_addr]`` We set the stack to the same addresses as the gdb session to avoid pointers corruption....
java
public static base_response unset(nitro_service client, nslimitselector resource, String[] args) throws Exception{ nslimitselector unsetresource = new nslimitselector(); unsetresource.selectorname = resource.selectorname; return unsetresource.unset_resource(client,args); }
java
@Override public void prepareFileTypeAnalyzer(Engine engine) throws InitializationException { LOGGER.debug("Initializing {}", getName()); try { searcher = new NodeAuditSearch(getSettings()); } catch (MalformedURLException ex) { setEnabled(false); throw new...
python
def _mkpda(self, nonterms, productions, productions_struct, terminals, splitstring=1): """ This function generates a PDA from a CNF grammar as described in: - http://www.oit.edu/faculty/sherry.yang/CST229/Lectures/7_pda.pdf - http://www.eng.utah.edu/~cs3100/lectures/l18/pda-notes.p...
python
def change_range_cb(self, setting, value, fitsimage): """ This method is called when the cut level values (lo/hi) have changed in a channel. We adjust them in the ColorBar to match. """ if not self.gui_up: return if fitsimage != self.fv.getfocus_viewer(): ...