language stringclasses 2
values | func_code_string stringlengths 63 466k |
|---|---|
java | public E set(E value, Locale locale) {
if (defaultLocale == null)
defaultLocale = locale;
if (value != null)
return values.put(locale, value);
values.remove(locale);
return null;
} |
python | def find_zero_constrained_reactions(model):
"""Return list of reactions that are constrained to zero flux."""
return [rxn for rxn in model.reactions if
rxn.lower_bound == 0 and
rxn.upper_bound == 0] |
python | def make_epub(binders, file):
"""Creates an EPUB file from a binder(s)."""
if not isinstance(binders, (list, set, tuple,)):
binders = [binders]
epub = EPUB([_make_package(binder) for binder in binders])
epub.to_file(epub, file) |
java | public static URI toHttp(final URI inputUri) throws URISyntaxException {
Objects.requireNonNull(inputUri, "Input URI must not be null");
String wsScheme = inputUri.getScheme();
if ("http".equalsIgnoreCase(wsScheme) || "https".equalsIgnoreCase(wsScheme)) {
// leave alone
r... |
python | def scalar_reshape(a, newshape, order='C'):
"""
Reshape, but also return scalars or empty lists.
Identical to `numpy.reshape` except in the case where `newshape` is
the empty tuple, in which case we return a scalar instead of a
0-dimensional array.
Examples
--------
>>> a = np.arange(6... |
python | def py2dict(elements):
"""Convert a Python object into a Python dictionary."""
metadata_dict = {}
# Loop through all elements in the Python object.
for element in elements.children:
# Start an empty element list if an entry for the element
# list hasn't been made in the dictionary.
... |
python | def hide_routemap_holder_route_map_content_set_dampening_half_life(self, **kwargs):
"""Auto Generated Code
"""
config = ET.Element("config")
hide_routemap_holder = ET.SubElement(config, "hide-routemap-holder", xmlns="urn:brocade.com:mgmt:brocade-ip-policy")
route_map = ET.SubElem... |
java | public static BoxResourceIterable<BoxRecentItem> getRecentItems(final BoxAPIConnection api,
int limit, String... fields) {
QueryStringBuilder builder = new QueryStringBuilder();
if (fields.length > 0) {
builder.appendParam("... |
python | def _toMathInfo(self, guidelines=True):
"""
Subclasses may override this method.
"""
import fontMath
# A little trickery is needed here because MathInfo
# handles font level guidelines. Those are not in this
# object so we temporarily fake them just enough for
... |
java | @SuppressWarnings("unchecked")
public static <E> E get(Properties props, String key, E defaultValue, Type type) {
String value = props.getProperty(key);
if (value == null) {
return defaultValue;
} else {
return (E) MetaClass.cast(value, type);
}
} |
python | def update_status_with_media(self, **params): # pragma: no cover
"""Updates the authenticating user's current status and attaches media
for upload. In other words, it creates a Tweet with a picture attached.
Docs:
https://developer.twitter.com/en/docs/tweets/post-and-engage/api-referen... |
python | def _get_server(vm_, volumes, nics):
'''
Construct server instance from cloud profile config
'''
# Apply component overrides to the size from the cloud profile config
vm_size = _override_size(vm_)
# Set the server availability zone from the cloud profile config
availability_zone = config.ge... |
python | def convert_to_env_data(mgr, env_paths, validator_func, activate_func,
name_template, display_name_template, name_prefix):
"""Converts a list of paths to environments to env_data.
env_data is a structure {name -> (ressourcedir, kernel spec)}
"""
env_data = {}
for venv_dir in... |
java | @Override
@Deprecated
public void setTitle(String title) {
StringBuilder strBuilder = new StringBuilder();
if (title != null && !title.isEmpty()) {
strBuilder.append(title);
strBuilder.append(" - ");
}
strBuilder.append(Constant.PROGRAM_NAME).append(' ').append(Constant.PROGRAM_VERSION);
sup... |
python | def construct_context(self, request):
"""
Builds context with various required variables.
"""
opts = self.model._meta
app_label = opts.app_label
object_name = opts.object_name.lower()
form = self.construct_form(request)
media = self.media(form)
co... |
python | def add_nic(self, nic, sync=True):
"""
add a nic to this OS instance.
:param nic: the nic to add on this OS instance
:param sync: If sync=True(default) synchronize with Ariane server. If sync=False,
add the nic object on list to be added on next save().
:return:
"... |
java | static void insertEmptyFlag(final WritableMemory wmem, final boolean empty) {
int flags = wmem.getByte(FLAGS_BYTE);
if (empty) { flags |= EMPTY_FLAG_MASK; }
else { flags &= ~EMPTY_FLAG_MASK; }
wmem.putByte(FLAGS_BYTE, (byte) flags);
} |
java | @Deprecated
public static boolean noneSatisfy(String string, CharPredicate predicate)
{
return StringIterate.noneSatisfyChar(string, predicate);
} |
java | private Object resolveReferenceValueOfField(FieldData field) {
Object value = null;
// Regardless of its path, the field references another resource.
// fetch the field value (the path(s) to the referenced resource(s)) and resolve these resources.
if (field.metaData.isCollectionType()) {... |
java | public HtmlEmailImpl setHtmlMsg(String aHtml) throws EmailException {
if (StringUtil.isEmpty(aHtml)) {
throw new EmailException("Invalid message supplied");
}
this.html = aHtml;
return this;
} |
java | public static Attribute attribute(String name, String customGet, String customSet){
return new Attribute(name, customGet, customSet);
} |
java | @BetaApi
public final Operation deleteInstanceGroupManager(String instanceGroupManager) {
DeleteInstanceGroupManagerHttpRequest request =
DeleteInstanceGroupManagerHttpRequest.newBuilder()
.setInstanceGroupManager(instanceGroupManager)
.build();
return deleteInstanceGroupManag... |
java | private boolean canBeMerged(DenseRange<T> current, DenseRange<T> next) {
return Order.of(comparator, current.end(), Optional.of(next.begin())) == Order.EQ || current.overlaps(next);
} |
python | def pasa(args):
"""
%prog pasa pasa_db fastafile
Run EVM in TIGR-only mode.
"""
p = OptionParser(pasa.__doc__)
opts, args = p.parse_args(args)
if len(args) != 2:
sys.exit(not p.print_help())
pasa_db, fastafile = args
termexons = "pasa.terminal_exons.gff3"
if need_upda... |
python | def _find_set_info(set):
'''
Return information about the set
'''
cmd = '{0} list -t {1}'.format(_ipset_cmd(), set)
out = __salt__['cmd.run_all'](cmd, python_shell=False)
if out['retcode'] > 0:
# Set doesn't exist return false
return False
setinfo = {}
_tmp = out['stdo... |
java | public ServiceFuture<VirtualNetworkGatewayConnectionInner> updateTagsAsync(String resourceGroupName, String virtualNetworkGatewayConnectionName, final ServiceCallback<VirtualNetworkGatewayConnectionInner> serviceCallback) {
return ServiceFuture.fromResponse(updateTagsWithServiceResponseAsync(resourceGroupName, ... |
java | @Override
public boolean simpleEvaluation(Agent currentAgent) {
Agent agent = currentAgent;
if (bodyId != null) {
agent = agent.getAgentsAppState().getAgent(bodyId);
if(agent == null) {
logger.log(Level.SEVERE, "Body {0} does not exists!", new Object[]{bodyId}... |
java | protected void filterMarginalSeparators()
{
for (Iterator<Separator> it = hsep.iterator(); it.hasNext();)
{
Separator sep = it.next();
if (sep.getY1() == root.getY1() || sep.getY2() == root.getY2())
it.remove();
}
for (Iterator<Separator> it = ... |
java | private static Class<?> lookupSerializableType(Class<?> type) {
Class<?> serializableType = serializableTypes.get(type);
if (serializableType != null) {
return serializableType;
}
serializableType = findSerializableType(type);
if (serializableType != null) {
serializableTypes.put(type, s... |
python | def sortWithinPartitions(self, *cols, **kwargs):
"""Returns a new :class:`DataFrame` with each partition sorted by the specified column(s).
:param cols: list of :class:`Column` or column names to sort by.
:param ascending: boolean or list of boolean (default True).
Sort ascending vs... |
java | private static void addDescriptions(Entry entry, String... descriptions) {
try {
entry.add(SchemaConstants.OBJECT_CLASS_ATTRIBUTE, SchemaConstants.DESCRIPTIVE_OBJECT_OC);
if (descriptions == null) {
// case 1
entry.add(SchemaConstants.EMPTY_FLAG_ATTRIBUTE,... |
python | def remove_sub(self, sub):
"""
Remove all references to a specific Subject ID
:param sub: A Subject ID
"""
for _sid in self.get('sub2sid', sub):
self.remove('sid2sub', _sid, sub)
self.delete('sub2sid', sub) |
python | def get_messenger(config):
"""Return an appropriate Messenger.
If we're in debug mode, or email settings aren't set, return a debug
version which logs the message instead of attempting to send a real
email.
"""
email_settings = EmailConfig(config)
if config.get("mode") == "debug":
r... |
java | @Nonnull
public static <T> LTieLongFunctionBuilder<T> tieLongFunction(Consumer<LTieLongFunction<T>> consumer) {
return new LTieLongFunctionBuilder(consumer);
} |
java | public void setClob(final int parameterIndex, final Reader reader, final long length)
throws SQLException {
setCharacterStream(parameterIndex, reader, length);
} |
java | public void marshall(SkillGroupData skillGroupData, ProtocolMarshaller protocolMarshaller) {
if (skillGroupData == null) {
throw new SdkClientException("Invalid argument passed to marshall(...)");
}
try {
protocolMarshaller.marshall(skillGroupData.getSkillGroupArn(), SK... |
java | public static <K, V> MapDataStore<K, V> createWriteBehindStore(MapStoreContext mapStoreContext, int partitionId,
WriteBehindProcessor writeBehindProcessor) {
MapServiceContext mapServiceContext = mapStoreContext.getMapServiceContext();
N... |
java | protected void sequence_Parameter(ISerializationContext context, Parameter semanticObject) {
if (errorAcceptor != null) {
if (transientValues.isValueTransient(semanticObject, XtextPackage.Literals.PARAMETER__NAME) == ValueTransient.YES)
errorAcceptor.accept(diagnosticProvider.createFeatureValueMissing(semantic... |
python | def replace(self, photo, photo_file, **kwds):
"""
Endpoint: /photo/<id>/replace.json
Uploads the specified photo file to replace an existing photo.
"""
with open(photo_file, 'rb') as in_file:
result = self._client.post("/photo/%s/replace.json" %
... |
python | def estimate_completion(self):
"""
Estimate completion time for a task.
:returns: deferred that when fired returns a datetime object for the
estimated, or the actual datetime, or None if we could not
estimate a time for this task method.
"""
i... |
java | public void enableSettingsCursor(Cursor cursor) {
menuCursor = cursor;
IoDevice device = cursor.getIoDevice();
if (device != null)
{
settingsIoDeviceFarDepth = device.getFarDepth();
settingsIoDeviceNearDepth = device.getNearDepth();
}
settingsCurso... |
python | def get_pg_info():
"""Check PostgreSQL connection."""
from psycopg2 import connect, OperationalError
log.debug("entered get_pg_info")
try:
conf = settings.DATABASES['default']
database = conf["NAME"]
user = conf["USER"]
host = conf["HOST"]
port = conf["PORT"]
... |
java | public boolean addItem()
{
try ( Session session = driver.session() )
{
return session.writeTransaction( new TransactionWork<Boolean>()
{
@Override
public Boolean execute( Transaction tx )
{
tx.run( "CREATE (... |
java | public static AgentProperties readIaasProperties( Properties props ) throws IOException {
// Deal with files transferred through user data.
// Store files in the system's temporary directory.
// In Karaf, this will point to the "data/tmp" directory.
File msgResourcesDirectory = new File( System.getProperty( "j... |
python | def set_web_hook(self, url=None, certificate=None):
"""
Use this method to specify a url and receive incoming updates via an outgoing webhook. Whenever there is an
update for the bot, we will send an HTTPS POST request to the specified url, containing a JSON-serialized
Update... |
python | def input_has_value(step, field_name, value):
"""
Check that the form input element has given value.
"""
with AssertContextManager(step):
text_field = find_any_field(world.browser,
DATE_FIELDS + TEXT_FIELDS,
field_name)
... |
python | def addDependencyInfo(self):
""" Adds version info about the installed dependencies
"""
logger.debug("Adding dependency info to the AboutDialog")
self.progressLabel.setText("Retrieving package info...")
self.editor.clear()
self._addModuleInfo(mi.PythonModuleInfo())
... |
java | @NonNull
public Transition excludeChildren(@Nullable Class type, boolean exclude) {
mTargetTypeChildExcludes = excludeObject(mTargetTypeChildExcludes, type, exclude);
return this;
} |
python | def get_user_name(user, full_name=True):
"""Return the user's name as a string.
:param user: `models.User` object. The user to get the name of.
:param full_name: (optional) Whether to return full user name, or just first name.
:return: The user's name.
""" # noqa
try:
if full_name:
... |
python | def alpha_multiply(self, alpha, data, shape=None):
"""(alpha) can be a scalar or an array.
"""
# alpha can be a scalar or an array
if shape is None:
shape = data.shape
if len(data.shape) == 2:
res = alpha * data
# If desired shape is monochrom... |
java | @Override
public void serviceRequest(final Request request) {
// Get trigger id
triggerId = request.getParameter(WServlet.AJAX_TRIGGER_PARAM_NAME);
if (triggerId == null) {
throw new SystemException("No AJAX trigger id to check step count");
}
// Get trigger and its context
ComponentWithContext trigger... |
java | public void setVideoAssets(com.google.api.ads.admanager.axis.v201811.VideoRedirectAsset[] videoAssets) {
this.videoAssets = videoAssets;
} |
python | def touch_log(log, cwd='.'):
"""
Touches the log file. Creates if not exists OR updates the modification date if exists.
:param log:
:return: nothing
"""
logfile = '%s/%s' % (cwd, log)
with open(logfile, 'a'):
os.utime(logfile, None) |
java | public Criteria function(Function function) {
Assert.notNull(function, "Cannot add 'null' function to criteria.");
predicates.add(new Predicate(OperationKey.FUNCTION, function));
return this;
} |
python | def get_file_list(shortFile):
"""
The function get_file_list expands a short filename to a sorted list
of filenames. The short filename can contain variables and wildcards.
"""
if "://" in shortFile: # seems to be a URL
return [shortFile]
# expand tilde and variables
expandedFile = ... |
java | @SuppressWarnings("static-method")
protected String generateJson(Map<String, Object> map) throws JsonProcessingException {
final ObjectMapper mapper = new ObjectMapper();
return mapper.writerWithDefaultPrettyPrinter().writeValueAsString(map);
} |
python | def main():
"""Run the merge driver program."""
usage = \
"""%prog [options] <input GTFS a.zip> <input GTFS b.zip> <output GTFS.zip>
Merges <input GTFS a.zip> and <input GTFS b.zip> into a new GTFS file
<output GTFS.zip>.
For more information see
https://github.com/google/transitfeed/wiki/Merge
"""
parser = ut... |
java | public void setRotation(float w, float x, float y, float z) {
componentRotation.set(w, x, y, z);
if (sceneObject != null) {
sceneObject.getTransform().setRotation(w, x, y, z);
}
} |
java | public void marshall(UnlinkDeveloperIdentityRequest unlinkDeveloperIdentityRequest, ProtocolMarshaller protocolMarshaller) {
if (unlinkDeveloperIdentityRequest == null) {
throw new SdkClientException("Invalid argument passed to marshall(...)");
}
try {
protocolMarshalle... |
python | def get_substrates(self, material_id, number=50, orient=None):
"""
Get a substrate list for a material id. The list is in order of
increasing elastic energy if a elastic tensor is available for
the material_id. Otherwise the list is in order of increasing
matching area.
... |
python | def _parse_binding_config(self, binding_config):
"""Parse configured interface -> ACL bindings
Bindings are returned as a set of (intf, name, direction) tuples:
set([(intf1, acl_name, direction),
(intf2, acl_name, direction),
...,
])
"""
parsed_... |
java | public ZapReply nextReply(boolean wait)
{
if (!repliesEnabled) {
System.out.println("ZAuth: replies are disabled. Please use replies(true);");
return null;
}
return ZapReply.recv(replies, wait);
} |
java | public static BufferedImage getResized(final BufferedImage originalImage,
final String formatName, final int targetWidth, final int targetHeight) throws IOException
{
return read(resize(originalImage, formatName, targetWidth, targetHeight));
} |
python | def decorate_client(api_client, func, name):
"""A helper for decorating :class:`bravado.client.SwaggerClient`.
:class:`bravado.client.SwaggerClient` can be extended by creating a class
which wraps all calls to it. This helper is used in a :func:`__getattr__`
to check if the attr exists on the api_client... |
python | def add_websocket(
self,
path: str,
endpoint: Optional[str]=None,
view_func: Optional[Callable]=None,
defaults: Optional[dict]=None,
host: Optional[str]=None,
subdomain: Optional[str]=None,
*,
strict_slashes: boo... |
java | public Observable<ServiceResponse<SharedAccessAuthorizationRuleResourceInner>> createOrUpdateAuthorizationRuleWithServiceResponseAsync(String resourceGroupName, String namespaceName, String notificationHubName, String authorizationRuleName, SharedAccessAuthorizationRuleProperties properties) {
if (resourceGroup... |
python | def create_assembly(self, did, wid, name='My Assembly'):
'''
Creates a new assembly element in the specified document / workspace.
Args:
- did (str): Document ID
- wid (str): Workspace ID
- name (str, default='My Assembly')
Returns:
- req... |
java | public VirtualHubInner beginUpdateTags(String resourceGroupName, String virtualHubName, Map<String, String> tags) {
return beginUpdateTagsWithServiceResponseAsync(resourceGroupName, virtualHubName, tags).toBlocking().single().body();
} |
java | public EClass getEDG() {
if (edgEClass == null) {
edgEClass = (EClass)EPackage.Registry.INSTANCE.getEPackage(AfplibPackage.eNS_URI).getEClassifiers().get(238);
}
return edgEClass;
} |
python | def run(self):
"""
consume message from channel on the consuming thread.
"""
LOGGER.debug("rabbitmq.Service.run")
try:
self.channel.start_consuming()
except Exception as e:
LOGGER.warn("rabbitmq.Service.run - Exception raised while consuming") |
java | public static boolean isPointNearMultiLatLng(LatLng point, MultiLatLng multiLatLng, double tolerance) {
boolean near = false;
for (LatLng multiPoint : multiLatLng.getLatLngs()) {
near = isPointNearPoint(point, multiPoint, tolerance);
if (near) {
break;
... |
java | public final void mDATE() throws RecognitionException {
try {
int _type = DATE;
int _channel = DEFAULT_TOKEN_CHANNEL;
// druidG.g:680:2: ( DATE_YEAR_MONTH_ONLY '-' NUM NUM )
// druidG.g:680:4: DATE_YEAR_MONTH_ONLY '-' NUM NUM
{
mDATE_YEAR_MONTH_ONLY();
match('-');
mNUM();
mNUM();
... |
python | def _create_dock_toggle_action(self):
"""Create action for plugin dockable window (show/hide)."""
# pylint: disable=W0201
icon = resources_path('img', 'icons', 'icon.svg')
self.action_dock = QAction(
QIcon(icon),
self.tr('Toggle InaSAFE Dock'), self.iface.mainWind... |
java | protected com.vividsolutions.jts.geom.Geometry toJtsGeometryCollection(Geometry<?> src) {
com.vividsolutions.jts.geom.Geometry returnGeometry;
if (src instanceof Point) {
returnGeometry = toJtsPoint((Point) src);
} else if (src instanceof LineString) {
returnGeometry = t... |
java | @Override
public Set<OWLLiteral> getDataPropertyValues(OWLNamedIndividual ind,
OWLDataProperty pe) throws InconsistentOntologyException,
FreshEntitiesException, ReasonerInterruptedException,
TimeOutException {
return Collections.emptySet();
} |
java | public T findOneByAttribute(String attribute, Object value) {
CriteriaBuilder cb = getEntityManager().getCriteriaBuilder();
CriteriaQuery<T> query = cb.createQuery(getEntityClass());
Root<T> from = query.from(getEntityClass());
query.where(cb.equal(from.get(attribute), value));
... |
python | def get_subscription_labels(self, userPk):
"""Returns a list with all the labels the user is subscribed to"""
r = self._request('subscriptions/' + str(userPk))
if r:
s = r.json()
return s
return [] |
python | def _parse_routes(iface, opts):
'''
Filters given options and outputs valid settings for
the route settings file.
'''
# Normalize keys
opts = dict((k.lower(), v) for (k, v) in six.iteritems(opts))
result = {}
if 'routes' not in opts:
_raise_error_routes(iface, 'routes', 'List of ... |
python | def graph_route(self, request):
"""Given a single run, return the graph definition in protobuf format."""
run = request.args.get('run')
tag = request.args.get('tag', '')
conceptual_arg = request.args.get('conceptual', False)
is_conceptual = True if conceptual_arg == 'true' else False
if run is ... |
python | def ImportContractAddr(wallet, contract_hash, pubkey_script_hash):
"""
Args:
wallet (Wallet): a UserWallet instance
contract_hash (UInt160): hash of the contract to import
pubkey_script_hash (UInt160):
Returns:
neo.SmartContract.Contract.Contract
"""
contract = Bloc... |
java | @Nullable
private UCPMUserValue callHasInline(int seen) {
if (seen != Const.INVOKEVIRTUAL) {
return null;
}
String sig = getSigConstantOperand();
String returnSig = SignatureUtils.getReturnSignature(sig);
if (Values.SIG_JAVA_UTIL_STRINGBUILDER.equals(returnSig) |... |
java | @Override
public void validate(T arg) throws ValidationException {
for (final Validator<T> validator : validators) {
validator.validate(arg);
}
} |
python | def setDaemon(self, runnable, isdaemon, noregister = False):
'''
If a runnable is a daemon, it will not keep the main loop running. The main loop will end when all alived runnables are daemons.
'''
if not noregister and runnable not in self.registerIndex:
self.register((), ru... |
python | def set_pin_retries(ctx, management_key, pin, pin_retries, puk_retries, force):
"""
Set the number of PIN and PUK retries.
NOTE: This will reset the PIN and PUK to their factory defaults.
"""
controller = ctx.obj['controller']
_ensure_authenticated(
ctx, controller, pin, management_key, ... |
python | def train():
"""Training loop for language model.
"""
print(model)
from_epoch = 0
model.initialize(mx.init.Xavier(factor_type='out'), ctx=context)
trainer_params = {'learning_rate': args.lr, 'wd': 0, 'eps': args.eps}
trainer = gluon.Trainer(model.collect_params(), 'adagrad', trainer_params)
... |
java | protected void writeToSerializedStream(ObjectOutputStream stream) throws IOException {
stream.writeLong(cas);
stream.writeInt(expiry);
stream.writeUTF(id);
stream.writeObject(content);
stream.writeObject(mutationToken);
} |
python | def static_dag_launchpoint(job, job_vars):
"""
Statically define jobs in the pipeline
job_vars: tuple Tuple of dictionaries: input_args and ids
"""
input_args, ids = job_vars
if input_args['config_fastq']:
cores = input_args['cpu_count']
a = job.wrapJobFn(mapsplice, job_vars... |
python | def _asyncio_open_serial_windows(path):
"""
Open a windows named pipe
:returns: An IO like object
"""
try:
yield from wait_for_named_pipe_creation(path)
except asyncio.TimeoutError:
raise NodeError('Pipe file "{}" is missing'.format(path))
return WindowsPipe(path) |
java | public void replaceValue(List<CmsDataViewValue> replacementValues) {
CmsAttributeHandler handler = (CmsAttributeHandler)m_handler;
Element parent = CmsDomUtil.getAncestor(
m_widget.getElement(),
I_CmsLayoutBundle.INSTANCE.form().attributeValue()).getParentElement();
Node... |
java | private void sendRequestHeader(MessageType type, int size) throws IOException {
ByteBuffer buf = ByteBuffer.allocate(8);
buf.order(ByteOrder.BIG_ENDIAN);
buf.put((byte) 'L');
buf.put((byte) '1');
buf.put(type.getValue());
buf.put((byte) 0); // request
buf.putInt(size);
buf.flip();
l... |
python | def set_flag(self, user, note=None, status=None):
"""Flags the object.
:param User user:
:param str note: User-defined note for this flag.
:param int status: Optional status integer (the meaning is defined by a developer).
:return:
"""
if not user.id:
... |
java | public MucConfigFormManager setRoomSecret(String secret)
throws MucConfigurationNotSupportedException {
if (!answerForm.hasField(MUC_ROOMCONFIG_ROOMSECRET)) {
throw new MucConfigurationNotSupportedException(MUC_ROOMCONFIG_ROOMSECRET);
}
answerForm.setAnswer(MUC_RO... |
java | public final static void setMaxSelectors(int size) throws IOException {
synchronized (selectors) {
if (size < maxSelectors) {
reduce(size);
} else if (size > maxSelectors) {
grow(size);
}
maxSelectors = size;
}
} |
python | def rank(self):
"""
Returns the item's rank (if it has one)
as a dict that includes required score, name, and level.
"""
if self._rank != {}:
# Don't bother doing attribute lookups again
return self._rank
try:
# The eater determining ... |
java | private Month readOptionalMonth(JSONValue val) {
String str = readOptionalString(val);
if (null != str) {
try {
return Month.valueOf(str);
} catch (@SuppressWarnings("unused") IllegalArgumentException e) {
// Do nothing -return the default value
... |
java | public final int compare( byte[] bytes1, byte[] bytes2) {
int diff;
for (int i = 0; i < bytes1.length && i < bytes2.length; i++) {
diff = (bytes1[i] & 0xFF) - (bytes2[i] & 0xFF);
if (diff != 0) {
return diff;
}
}
// if array entries are... |
java | public PolicyEventsQueryResultsInner listQueryResultsForResourceGroup(String subscriptionId, String resourceGroupName) {
return listQueryResultsForResourceGroupWithServiceResponseAsync(subscriptionId, resourceGroupName).toBlocking().single().body();
} |
java | @SuppressWarnings("all")
@Override
public void startAnimation(Animation animation) {
if (animation != null &&
(getAnimation() == null || getAnimation().hasEnded())) {
super.startAnimation(animation);
}
} |
java | public void filter(ClientRequestContext request) throws IOException
{
if(!request.getHeaders().containsKey("X-Query-Key"))
request.getHeaders().add("X-Query-Key", this.querykey);
} |
python | def wait_for_array(self, wait_for, timeout_ms):
"""Waits for one or more events to happen.
Scriptable version of :py:func:`wait_for` .
in wait_for of type :class:`GuestSessionWaitForFlag`
Specifies what to wait for;
see :py:class:`GuestSessionWaitForFlag` for more infor... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.