language
stringclasses
2 values
func_code_string
stringlengths
63
466k
java
public void setTopologyPaths(String[] topologyPaths) throws IOException { if (topologyPaths == null) { this.topologyPaths = new String[0]; } else { this.topologyPaths = topologyPaths; } }
java
public static <T, E extends Exception, E2 extends Exception> void parse(final Iterator<? extends T> iter, long offset, long count, final int processThreadNum, final int queueSize, final Try.Consumer<? super T, E> elementParser, final Try.Runnable<E2> onComplete) throws E, E2 { parse(N.asList(iter)...
python
def render_css_classes(self): """ Return a string containing the css classes for the module. >>> mod = DashboardModule(enabled=False, draggable=True, ... collapsible=True, deletable=True) >>> mod.render_css_classes() 'dashboard-module disabled dragg...
java
public OvhPayment deposit_depositId_payment_GET(String depositId) throws IOException { String qPath = "/me/deposit/{depositId}/payment"; StringBuilder sb = path(qPath, depositId); String resp = exec(qPath, "GET", sb.toString(), null); return convertTo(resp, OvhPayment.class); }
python
def iflatten_dict_values(node, depth=0): """ >>> from utool.util_dict import * # NOQA """ if isinstance(node, dict): _iter = (iflatten_dict_values(value) for value in six.itervalues(node)) return util_iter.iflatten(_iter) else: return node
python
def get_base_cnv_regions(data, work_dir, genome_default="transcripts1e4", include_gene_names=True): """Retrieve set of target regions for CNV analysis. Subsets to extended transcript regions for WGS experiments to avoid long runtimes. """ cov_interval = dd.get_coverage_interval(data) base_regio...
python
def ensure_mkdir_p(mode=0o777): """Decorator to ensure `mkdir_p` is called to the function's return value. """ def decorator(f): @functools.wraps(f) def decorated(*args, **kwargs): path = f(*args, **kwargs) mkdir_p(path, mode=mode) return path re...
python
def upload(ctx, yes=False): """Upload the package to PyPI.""" import callee version = callee.__version__ # check the packages version # TODO: add a 'release' to automatically bless a version as release one if version.endswith('-dev'): fatal("Can't upload a development version (%s) to Py...
java
protected String getRealInputAttrName(String inputAttrName, String id, boolean isUser) { boolean isInputAttrValueDN = UniqueNameHelper.isDN(id) != null; boolean isInputAttrIdentifier = isIdentifierTypeProperty(inputAttrName); if (!isInputAttrIdentifier && isInputAttrValueDN) { // To...
python
def _read_register(self, reg): """Read 16 bit register value.""" self.buf[0] = reg with self.i2c_device as i2c: i2c.write(self.buf, end=1, stop=False) i2c.readinto(self.buf, end=2) return self.buf[0] << 8 | self.buf[1]
python
def merge_strings(list_of_strings: Union[List[str], Tuple[str]]) -> dict: """ Pack the list of strings into two arrays: the concatenated chars and the \ individual string lengths. :func:`split_strings()` does the inverse. :param list_of_strings: The :class:`tuple` or :class:`list` of :class:`str`-s \ ...
java
public BuildProject buildProject(String name, String reference) { return buildProject(name, reference, null); }
java
public FoxHttpRequestBuilder addRequestHeader(String name, String value) { foxHttpRequest.getRequestHeader().addHeader(name, value); return this; }
python
def _rshift_logical(self, shift_amount): """ Logical shift right with a concrete shift amount :param int shift_amount: Number of bits to shift right. :return: The new StridedInterval after right shifting :rtype: StridedInterval """ if self.is_empty: ...
java
private final String load(String key, String defaultValue, String comment) { if(options.containsKey(key)) { return options.get(key); } else if (config.getProperty(key) != null) { return config.getString(key); } else { if (defaultValue != null) { try...
java
public void shutdown() { shutdownCalled = true; if (isRunning()) { watchdog.waitForProcessStarted(); watchdog.destroyProcess(); watchdog.waitForTerminationAfterDestroy(2, SECONDS); if (isRunning()) { watchdog.destroyProcessForcefully(); ...
python
def to_python(self, value, resource): """Dictionary to Python object""" if isinstance(value, dict): d = { self.aliases.get(k, k): self.to_python(v, resource) if isinstance(v, (dict, list)) else v for k, v in six.iteritems(value) } retu...
java
public static IConjunct negate( IConjunct conjunct) { AnyOf anyOf = new AnyOf(); for( Iterator<IDisjunct> disjuncts = conjunct.getDisjuncts(); disjuncts.hasNext();) { Conjunction conjunction = new Conjunction(); for( Iterator<IAssertion> assertions = disjuncts.next().getAs...
java
public int initialSize() { if (tc.isEntryEnabled()) Tr.entry(tc, "initialSize",this); if (tc.isEntryEnabled()) Tr.exit(tc, "initialSize",new Integer(_initialSize)); return _initialSize; }
java
@GetMapping(ENDPOINT_REDIRECT) public View redirectToProvider(final HttpServletRequest request, final HttpServletResponse response) { val wsfedId = request.getParameter(PARAMETER_NAME); try { val cfg = configurations.stream().filter(c -> c.getId().equals(wsfedId)).findFirst().orElse(null...
python
def slice(self, window_size=1, step_size=1, cumulative=False, count_only=False, subcorpus=True, feature_name=None): """ Returns a generator that yields ``(key, subcorpus)`` tuples for sequential time windows. Two common slicing patterns are the "sliding time-window" and th...
python
def have_consistent_saxis(magmoms): """ This method checks that all Magmom objects in a list have a consistent spin quantization axis. To write MAGMOM tags to a VASP INCAR, a global SAXIS value for all magmoms has to be used. If saxis are inconsistent, can create consistent set w...
python
def save_file(self, filename, text): """Save the given text under the given condition filename and the current path. If the current directory is not defined explicitly, the directory name is constructed with the actual simulation end date. If such an directory does not exist, i...
java
public static boolean writeImage(BufferedImage image, String filename, int dpi) throws IOException { return writeImage(image, filename, dpi, 1.0f); }
java
public void setTranslation(Tuple3D<?> translation) { this.m03 = translation.getX(); this.m13 = translation.getY(); this.m23 = translation.getZ(); }
java
public static void createFile(SshKeyPair key, String passphrase, String comment, int format, File toFile) throws IOException { SshPrivateKeyFile pub = create(key, passphrase, comment, format); FileOutputStream out = new FileOutputStream(toFile); try { out.write(pub.getFormattedKey()); out.flush(); }...
java
public static int checkElementIndex(int index, int size, final String eid) { if (isSizeIllegal(size)) { throw new EidIllegalArgumentException(ensureEid(eid)); } if (isIndexAndSizeIllegal(index, size)) { throw new EidIndexOutOfBoundsException(ensureEid(eid)); } ...
java
private Delta createDelta(PermissionUpdateRequest request) { MapDeltaBuilder builder = Deltas.mapBuilder(); for (String permissionString : request.getPermitted()) { builder.put("perm_" + validated(permissionString), 1); } for (String permissionString : request.getRevoked()) ...
java
public static double[] decode( String cvAccession, byte[] data, int dataSize ) { switch (cvAccession) { case ACC_NUMPRESS_LINEAR: { double[] buffer = new double[dataSize * 2]; int nbrOfDoubles = MSNumpress.decodeLinear(data, dataSize, buffer); double[] re...
python
def pass_defaults(func): """Decorator that returns a function named wrapper. When invoked, wrapper invokes func with default kwargs appended. Parameters ---------- func : callable The function to append the default kwargs to """ @functools.wraps(func) def wrapper(self, *args, *...
java
public static Iterable<MBlockPos> getAllInBox(MBlockPos from, MBlockPos to) { return new BlockIterator(from, to).asIterable(); }
java
public List<String> toList() { ArrayList<String> list = new ArrayList<String>(); for (StringGrabber sg : mSgList) { list.add(sg.toString()); } return list; }
java
@Override public void postProcess(BeanDefinitionBuilder builder, XmlRepositoryConfigurationSource config) { Element element = config.getElement(); ParsingUtils.setPropertyReference(builder, element, SIMPLEDB_TEMPLATE_REF, "simpleDbOperations"); }
python
def fit_arrays(uv, xy): """ Performs a generalized fit between matched lists of positions given by the 2 column arrays xy and uv. This function fits for translation, rotation, and scale changes between 'xy' and 'uv', allowing for different scales and orientations for X and Y axes. ...
java
public List<Taglet> getCustomTaglets(Element e) { switch (e.getKind()) { case CONSTRUCTOR: return getConstructorCustomTaglets(); case METHOD: return getMethodCustomTaglets(); case ENUM_CONSTANT: case FIELD: return ge...
java
@Override protected String doBase(String name, Object value) { if (value instanceof InetAddress) { return ((InetAddress) value).getHostAddress(); } else if (value instanceof String) { return doBase(name, (String) value); } else { throw new IndexException("...
python
def ValidateEndConfig(self, config_obj, errors_fatal=True): """Given a generated client config, attempt to check for common errors.""" errors = [] if not config.CONFIG["Client.fleetspeak_enabled"]: location = config_obj.Get("Client.server_urls", context=self.context) if not location: er...
python
def get_image(self, digest, blob, mime_type, index, size=500): """Return an image for the given content, only if it already exists in the image cache.""" # Special case, for now (XXX). if mime_type.startswith("image/"): return "" cache_key = f"img:{index}:{size}:{dig...
python
def svm_load_model(model_file_name): """ svm_load_model(model_file_name) -> model Load a LIBSVM model from model_file_name and return. """ model = libsvm.svm_load_model(model_file_name.encode()) if not model: print("can't open model file %s" % model_file_name) return None model = toPyModel(model) return mo...
java
public Resource parse(XmlPullParser xpp) throws IOException, FHIRFormatError, XmlPullParserException { if (xpp.getNamespace() == null) throw new FHIRFormatError("This does not appear to be a FHIR resource (no namespace '"+xpp.getNamespace()+"') (@ /) "+Integer.toString(xpp.getEventType())); if (!xpp.getNames...
java
public void addTransition(DuzztAction action, DuzztState succ) { transitions.put(action, new DuzztTransition(action, succ)); }
python
def revs(self, branch='master', limit=None, skip=None, num_datapoints=None): """ Returns a dataframe of all revision tags and their timestamps for each project. It will have the columns: * date * repository * rev :param branch: (optional, default 'master') the branch...
java
public String getId() { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(tc, "getId"); if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(tc, "getId", aoBrowserSession.toString()); return aoBrowserSession.toString(); }
python
def create_game(self, map_name): """Create a game for the agents to join. Args: map_name: The map to use. """ map_inst = maps.get(map_name) map_data = map_inst.data(self._run_config) if map_name not in self._saved_maps: for controller in self._controllers: controller.save_ma...
python
def resolve_name(name, module=None): """Resolve a dotted name to a module and its parts. This is stolen wholesale from unittest.TestLoader.loadTestByName. """ parts = name.split('.') parts_copy = parts[:] if module is None: while parts_copy: # pragma: no cover try: ...
python
def _createGsshaPyObjects(self, eventChunk): """ Create GSSHAPY PrecipEvent, PrecipValue, and PrecipGage Objects Method """ ## TODO: Add Support for RADAR file format type values # Create GSSHAPY PrecipEvent event = PrecipEvent(description=eventChunk['description'], ...
python
def _post_activity(self, activity, unserialize=True): """ Posts a activity to feed """ # I think we always want to post to feed feed_url = "{proto}://{server}/api/user/{username}/feed".format( proto=self._pump.protocol, server=self._pump.client.server, usernam...
python
def pass_allowedremoterelieve_v1(self): """Update the outlet link sequence |dam_outlets.R|.""" flu = self.sequences.fluxes.fastaccess sen = self.sequences.senders.fastaccess sen.r[0] += flu.allowedremoterelieve
python
def get_pipeline_stage(self, pipeline_key, stage_key = None, sort_by = None): '''Gets a list of one/all stage objects in a pipeline. Performs a single GET. Args: pipeline_key key for pipeline stage_key key for stage (default: None i.e. ALL) sort_by in desc order by 'creationTimestamp' or 'lastUpdatedTi...
python
def _render(self): ''' Standard rendering of bar graph. ''' cm_chars = self._comp_style(self.icons[_ic] * self._num_complete_chars) em_chars = self._empt_style(self.icons[_ie] * self._num_empty_chars) return f'{self._first}{cm_chars}{em_chars}{self._last} {self._lbl}'
java
public void stop() { if (workerTimer != null) { try { workerTimer.cancel(); } catch (Throwable e) //NOSONAR { LOG.warn(this.name + " cache, stop error " + e.getMessage()); } } nodesCache.clear(); propertiesCa...
python
def _syllable_condenser(self, words_syllables): """Reduce a list of [sentence [word [syllable]]] to [sentence [syllable]]. :param syllables_words: Elided text :return: Text tokenized only at the sentence and syllable level :rtype : list """ sentences_syllables = [] ...
java
public void setImmunePrototypeProperty(Object value) { if ((prototypePropertyAttributes & READONLY) != 0) { throw new IllegalStateException(); } prototypeProperty = (value != null) ? value : UniqueTag.NULL_VALUE; prototypePropertyAttributes = DONTENUM | PERMANENT | READON...
java
@Override public void eSet(int featureID, Object newValue) { switch (featureID) { case AfplibPackage.GSCC__CELLWI: setCELLWI((Integer)newValue); return; case AfplibPackage.GSCC__CELLHI: setCELLHI((Integer)newValue); return; case AfplibPackage.GSCC__CELLWFR: setCELLWFR((Integer)newValue);...
python
def clear_cache(ip=None): """Clear the client cache or remove key matching the given ip.""" if ip: with ignored(Exception): client = CLIENT_CACHE[ip] del CLIENT_CACHE[ip] client.close() else: for client in CLIENT_CACHE.values(): with ignored(Ex...
java
private void readCalendars(Project ganttProject) { m_mpxjCalendar = m_projectFile.addCalendar(); m_mpxjCalendar.setName(ProjectCalendar.DEFAULT_BASE_CALENDAR_NAME); Calendars gpCalendar = ganttProject.getCalendars(); setWorkingDays(m_mpxjCalendar, gpCalendar); setExceptions(m_mpxjCalen...
python
def prompt(self): """ Open a prompt to navigate to a different subreddit or comment" """ name = self.term.prompt_input('Enter page: /') if name: # Check if opening a submission url or a subreddit url # Example patterns for submissions: # co...
python
def _writeContaminantTable(self, session, fileObject, mapTable, contaminants, replaceParamFile): """ This method writes the contaminant transport mapping table case. """ # Write the contaminant mapping table header fileObject.write('%s\n' % (mapTable.name)) fileObject.wri...
java
public void setupSFields() { this.getRecord(UserGroup.USER_GROUP_FILE).getField(UserGroup.DESCRIPTION).setupDefaultView(this.getNextLocation(ScreenConstants.NEXT_LOGICAL, ScreenConstants.ANCHOR_DEFAULT), this, ScreenConstants.DEFAULT_DISPLAY); }
java
public void setMetricResults(java.util.Collection<CurrentMetricResult> metricResults) { if (metricResults == null) { this.metricResults = null; return; } this.metricResults = new java.util.ArrayList<CurrentMetricResult>(metricResults); }
python
def _find_human_readable_labels(synsets, synset_to_human): """Build a list of human-readable labels. Args: synsets: list of strings; each string is a unique WordNet ID. synset_to_human: dict of synset to human labels, e.g., 'n02119022' --> 'red fox, Vulpes vulpes' Returns: List of human-readab...
python
def cmd( name, func=None, arg=(), **kwargs): ''' Execute a runner asynchronous: USAGE: .. code-block:: yaml run_cloud: runner.cmd: - func: cloud.create - arg: - my-ec2-config - myinstance ...
java
@UiThread public void notifyChildRemoved(int parentPosition, int childPosition) { int flatParentPosition = getFlatParentPosition(parentPosition); ExpandableWrapper<P, C> parentWrapper = mFlatItemList.get(flatParentPosition); parentWrapper.setParent(mParentList.get(parentPosition)); ...
java
static <T1, T2> Flowable<Notification<Tuple2<T1, T2>>> createWithTwoOutParameters(Single<Connection> connection, String sql, Flowable<List<Object>> parameterGroups, List<ParameterPlaceholder> parameterPlaceholders, Class<T1> cls1, Class<T2> cls2) { return connection.toFlowable().flatMap(...
java
public static String findTitle(final String xml) { // Convert the string to a document to make it easier to get the proper title Document doc = null; try { doc = XMLUtilities.convertStringToDocument(xml); } catch (Exception ex) { LOG.debug("Unable to convert Strin...
python
def scripthash_to_address(scripthash): """ Convert a script hash to a public address. Args: scripthash (bytes): Returns: str: base58 encoded string representing the wallet address. """ sb = bytearray([ADDRESS_VERSION]) + scripthash c256 = bin_dbl_sha256(sb)[0:4] outb = ...
java
@Override public ResultSet getCatalogs() throws SQLException { checkClosed(); VoltTable result = new VoltTable(new VoltTable.ColumnInfo("TABLE_CAT",VoltType.STRING)); result.addRow(new Object[] { catalogString }); return new JDBC4ResultSet(null, result); }
python
def config_dir(self): "Return dir(self)." my_vars = set(self) skips = self.bad_names | my_vars yield from ( attr for attr in dir(type(self)) if ( attr not in skips and not ( attr.startswith('_') and...
java
@NotNull public OptionalBoolean mapToBoolean(@NotNull ToBooleanFunction<? super T> mapper) { if (!isPresent()) return OptionalBoolean.empty(); return OptionalBoolean.of(mapper.applyAsBoolean(value)); }
python
def gradient_pred(model, ref, ref_rc, alt, alt_rc, mutation_positions, out_annotation_all_outputs, output_filter_mask=None, out_annotation=None): """Gradient-based (saliency) variant effect prediction Based on the idea of [saliency maps](https://arxiv.org/pdf/1312.6034.pdf) the gradient-based...
java
public <T extends State> void deserializeFromSequenceFile(final Class<? extends Writable> keyClass, final Class<T> stateClass, final Path inputFilePath, final Collection<T> states, final boolean deleteAfter) { this.futures.add(new NamedFuture(this.executor.submit(new Callable<Void>() { @Override p...
python
def make_class_method_decorator(classkey, modname=None): """ register a class to be injectable classkey is a key that identifies the injected class REMEMBER to call inject_instance in __init__ Args: classkey : the class to be injected into modname : the global __name__ of the module...
python
def get_userstory_by_ref(self, ref): """ Get a :class:`UserStory` by ref. :param ref: :class:`UserStory` reference """ response = self.requester.get( '/{endpoint}/by_ref?ref={us_ref}&project={project_id}', endpoint=UserStory.endpoint, us_ref=r...
python
def to_name(self) -> str: """ Convert to ANSI color name :return: ANSI color name """ return { self.BLACK: 'black', self.RED: 'red', self.GREEN: 'green', self.YELLOW: 'yellow', self.BLUE: 'blue', self.MAGENTA...
java
public static String buildGlueExpression(List<Column> partitionKeys, List<String> partitionValues) { if (partitionValues == null || partitionValues.isEmpty()) { return null; } if (partitionKeys == null || partitionValues.size() != partitionKeys.size()) { throw new Pr...
python
def do_dot2(self, args, arguments): """ :: Usage: dot2 FILENAME FORMAT Export the data in cvs format to a file. Former cvs command Arguments: FILENAME The filename FORMAT the export format, pdf, png, ... ...
java
@SuppressWarnings("ConstantConditions") public static NaaccrDictionary getDefaultUserDictionaryByVersion(String naaccrVersion) { if (naaccrVersion == null) throw new RuntimeException("Version is required for getting the default user dictionary."); if (!NaaccrFormat.isVersionSupported(naa...
java
protected void initFailedJobCommandFactory() { if (failedJobCommandFactory == null) { failedJobCommandFactory = new DefaultFailedJobCommandFactory(); } if (postParseListeners == null) { postParseListeners = new ArrayList<BpmnParseListener>(); } postParseListeners.add(new DefaultFailedJob...
python
def _set_interface_reliable_messaging(self, v, load=False): """ Setter method for interface_reliable_messaging, mapped from YANG variable /mpls_config/router/mpls/mpls_cmds_holder/mpls_interface/rsvp/interface_reliable_messaging (container) If this variable is read-only (config: false) in the source YAN...
python
def create(request): """Create a new poll""" errors = [] success = False listOfResponses = ['', '', ''] # 3 Blank lines by default title = '' description = '' id = '' if request.method == 'POST': # User saved the form # Retrieve parameters title = request.form.get('ti...
java
private void addJQueryFile(Content head, DocPath filePath) { HtmlTree jqyeryScriptFile = HtmlTree.SCRIPT( pathToRoot.resolve(DocPaths.JQUERY_FILES.resolve(filePath)).getPath()); head.addContent(jqyeryScriptFile); }
java
public void loginAndRedirectBack(Object userIdentifier, String defaultLandingUrl) { login(userIdentifier); RedirectToLoginUrl.redirectToOriginalUrl(this, defaultLandingUrl); }
python
def get_next_line(self): """ Gets next line of random_file and starts over when reaching end of file""" try: line = next(self.random_file).strip() #keep track of which document we are currently looking at to later avoid having the same doc as t1 if line == "": ...
python
def get_host(url): """ Given a url, return its scheme, host and port (None if it's not there). For example: :: >>> get_host('http://google.com/mail/') ('http', 'google.com', None) >>> get_host('google.com:80') ('http', 'google.com', 80) """ # This code is actually s...
java
public StringGrabber replaceEnclosedIn(String startToken, String endToken, String replacement) { StringCropper cropper = getCropper(); final List<StrPosition> stringEnclosedInWithDetails = cropper.getStringEnclosedInWithDetails(sb.toString(), startToken, endToken); final List<Integer> splitList = new ArrayList...
python
def write_chunks(self, data, start, step, count) -> None: ''' Split data to count equal parts. Write the chunks using offsets calculated from start, step and stop. Args: data (bytes): The data. start (int): First offset. step ...
python
def delete(self, config_file=None): """Deletes the credentials file specified in `config_file`. If no file is specified, it deletes the default user credential file. Args: config_file (str): Path to configuration file. Defaults to delete the user default location if ...
java
private void execute(final Level level, final Object message, final Throwable t) { if (!m_logger.isEnabledFor(level)) return; if (m_asynchLoggerPool == null) { m_logger.log(level, message, t); return; } final Runnable runnableLoggingTask = createRunnableLoggingT...
python
def register(self, name): """ Register configuration for an editor instance. Arguments: name (string): Config name from available ones in ``settings.CODEMIRROR_SETTINGS``. Raises: UnknowConfigError: If given config name does not exist in ...
python
def is_manifestation_model(instance, attribute, value): """Must include a ``manifestationOfWork`` key.""" instance_name = instance.__class__.__name__ is_creation_model(instance, attribute, value) manifestation_of = value.get('manifestationOfWork') if not isinstance(manifestation_of, str): ...
java
public static String getText(Activity context, int id) { TextView view = findViewById(context, id); String text = ""; if (view != null) { text = view.getText().toString(); } else { Log.e("Caffeine", "Null view given to getText(). \"\" will be returned."); ...
java
public Interval<C> coalesce(final Interval<C> that) { if(this.overlaps(that)) { return new Interval(this.dimension, this.range.span(that.range)); } return NULL; }
java
public MultimapWithProtoValuesFluentAssertion<M> ignoringFieldAbsenceOfFieldsForValues( int firstFieldNumber, int... rest) { return usingConfig(config.ignoringFieldAbsenceOfFields(asList(firstFieldNumber, rest))); }
python
def create_indexes(self, indexes): """Create one or more indexes on this collection. >>> from pymongo import IndexModel, ASCENDING, DESCENDING >>> index1 = IndexModel([("hello", DESCENDING), ... ("world", ASCENDING)], name="hello_world") >>> index2 =...
java
public WikiFormat removeStyle(WikiStyle style) { if (!fStyles.contains(style)) { return this; } WikiFormat clone = getClone(); clone.fStyles.remove(style); return clone; }
java
public EqualsVerifierApi<T> suppress(Warning... warnings) { Collections.addAll(warningsToSuppress, warnings); Validations.validateWarnings(warningsToSuppress); Validations.validateWarningsAndFields(warningsToSuppress, allIncludedFields, allExcludedFields); Validations.validateNonnullFiel...
python
def get_db_prep_value(self, value, connection, prepared=False): """Convert a value to DB storage. Returns the state name. """ if not prepared: value = self.get_prep_value(value) return value.state.name
java
public HttpSession getSession(boolean arg0) { final HttpSession httpSession = request.getSession(arg0); if (httpSession == null) { return null; } else { return new HttpSessionWrapper(httpSession); } }
python
def do_action_for(self, context, request): """/@@API/doActionFor: Perform workflow transition on values returned by jsonapi "read" function. Required parameters: - action: The workflow transition to apply to found objects. Parameters used to locate objects are the same as ...
java
protected ListView<T> newChoices(final String id, final IModel<CheckboxModelBean<T>> model) { final ListView<T> choices = new ListView<T>("choices", model.getObject().getChoices()) { /** The serialVersionUID. */ private static final long serialVersionUID = 1L; /** * {@inheritDoc} */ @Override ...