language stringclasses 2
values | func_code_string stringlengths 63 466k |
|---|---|
java | protected final void printCommandLine(@Nonnull String[] cmd, @CheckForNull FilePath workDir) {
StringBuilder buf = new StringBuilder();
if (workDir != null) {
buf.append('[');
if(showFullPath)
buf.append(workDir.getRemote());
else
buf.a... |
python | def load_data(self, sess, inputs, state_inputs):
"""Bulk loads the specified inputs into device memory.
The shape of the inputs must conform to the shapes of the input
placeholders this optimizer was constructed with.
The data is split equally across all the devices. If the data is not... |
java | public final void setItsUser(final UserJetty pUser) {
this.itsUser = pUser;
if (this.itsId == null) {
this.itsId = new IdUserRoleJetty();
}
this.itsId.setItsUser(this.itsUser);
} |
python | def remove_links(self):
"""Remove links from our bin."""
for link in self.list_exes():
link = path.join(ENV_BIN, path.basename(link))
print_pretty("<FG_BLUE>Removing link {}...<END>".format(link))
os.remove(link) |
python | def popError(text, title="Lackey Error"):
""" Creates an error dialog with the specified text. """
root = tk.Tk()
root.withdraw()
tkMessageBox.showerror(title, text) |
python | def disconnect(self):
'''
Disconnect from the serial port
'''
if self._poll_stop_event:
self._poll_stop_event.set()
if self._driver:
if self.status != 'idle':
self.deactivate()
self._driver.disconnect() |
java | public static void setPreferredRadius(double radius) {
assert !Double.isNaN(radius);
final Preferences prefs = Preferences.userNodeForPackage(MapElementConstants.class);
if (prefs != null) {
prefs.putDouble("RADIUS", radius); //$NON-NLS-1$
try {
prefs.flush();
} catch (BackingStoreException exception... |
java | @Override
public SecurityCookieImpl preInvoke(EJBRequestData request) throws EJBAccessDeniedException {
Subject invokedSubject = subjectManager.getInvocationSubject();
Subject callerSubject = subjectManager.getCallerSubject();
EJBMethodMetaData methodMetaData = request.getEJBMethodMetaData(... |
java | public <A extends Annotation> List<A> getAnnotations(final Class<A> annoClass) {
Objects.requireNonNull(annoClass, "annoClass should not be null.");
return getAnnotationsByType(expandedAnnos, annoClass);
} |
java | public SecretBundle setSecret(String vaultBaseUrl, String secretName, String value) {
return setSecretWithServiceResponseAsync(vaultBaseUrl, secretName, value).toBlocking().single().body();
} |
python | def parse_file(self, file_or_fname):
"""
Parse a file or a filename
"""
with self._context():
if hasattr(file_or_fname, 'read'):
self.filename = getattr(
file_or_fname, 'name', file_or_fname.__class__.__name__)
self.p.ParseF... |
python | def num_rewards(self):
"""Returns the number of distinct rewards.
Returns:
Returns None if the reward range is infinite or the processed rewards
aren't discrete, otherwise returns the number of distinct rewards.
"""
# Pre-conditions: reward range is finite.
# : processed ... |
java | @Override
public Collection<Bean> delete(String schemaName, Collection<String> instanceIds)
throws AbortRuntimeException {
init();
Map<BeanId, Bean> deleted = list(schemaName, instanceIds);
Set<HBeanRow> rows = new HashSet<>();
for (String id : instanceIds) {
... |
java | private void buildDeprecatedSection(MarkupDocBuilder markupDocBuilder, PathOperation operation) {
if (BooleanUtils.isTrue(operation.getOperation().isDeprecated())) {
markupDocBuilder.block(DEPRECATED_OPERATION, MarkupBlockStyle.EXAMPLE, null, MarkupAdmonition.CAUTION);
}
} |
python | def fields(depth, Rp, Rm, Gam, lrec, lsrc, zsrc, ab, TM, use_ne_eval):
r"""Calculate Pu+, Pu-, Pd+, Pd-.
.. math:: P^{u\pm}_s, P^{d\pm}_s, \bar{P}^{u\pm}_s, \bar{P}^{d\pm}_s;
P^{u\pm}_{s-1}, P^{u\pm}_n, \bar{P}^{u\pm}_{s-1}, \bar{P}^{u\pm}_n;
P^{d\pm}_{s+1}, P^{d\pm}_n, \bar{P}^{d\pm}_{s+1}... |
python | def delay(sig):
""" Simple feedforward delay effect """
smix = Streamix()
sig = thub(sig, 3) # Auto-copy 3 times (remove this line if using feedback)
smix.add(0, sig)
# To get a feedback delay, use "smix.copy()" below instead of both "sig"
smix.add(280 * ms, .1 * sig) # You can also try other constants
sm... |
python | def _apply_discrete_colormap(arr, cmap):
"""
Apply discrete colormap.
Attributes
----------
arr : numpy.ndarray
1D image array to convert.
color_map: dict
Discrete ColorMap dictionary
e.g:
{
1: [255, 255, 255],
2: [255, 0, 0]
}
... |
python | def mapping_get(uri, mapping):
"""Look up the URI in the given mapping and return the result.
Throws KeyError if no matching mapping was found.
"""
ln = localname(uri)
# 1. try to match URI keys
for k, v in mapping.items():
if k == uri:
return v
# 2. try to match local ... |
python | def randomizer_bin_und(R, alpha, seed=None):
'''
This function randomizes a binary undirected network, while preserving
the degree distribution. The function directly searches for rewirable
edge pairs (rather than trying to rewire edge pairs at random), and
hence avoids long loops and works especial... |
python | def exclude_items(items, any_all=any, ignore_case=False, normalize_values=False, **kwargs):
"""Exclude items by matching metadata.
Note:
Metadata values are lowercased when ``normalized_values`` is ``True``,
so ``ignore_case`` is automatically set to ``True``.
Parameters:
items (list): A list of item dicts o... |
java | public S getNext() {
S result = null;
QueryParameters params = innerGetNext();
try {
result = processor.toBean(params, this.type);
} catch (MjdbcException ex) {
throw new MjdbcRuntimeException(ex);
}
return result;
} |
java | public PrecedenceOrderStep<ConfigFactory> withSources(
NamedConfigSource firstSource,
NamedConfigSource secondSource,
NamedConfigSource... moreSources
) {
return withSources(listOfTwoOrMore(
firstSource,
secondSource,
moreSources
));
} |
java | private void processSecurityIdentity(BeanMetaData bmd) {
final boolean isTraceOn = TraceComponent.isAnyTracingEnabled();
if (isTraceOn && tc.isEntryEnabled()) {
Tr.entry(tc, "processSecurityIdentity");
}
EnterpriseBean ejbBean = bmd.wccm.enterpriseBean;
boolean runA... |
java | public void addHeader (@Nonnull @Nonempty final String sName, @Nullable final String sValue)
{
if (sValue != null)
_addHeader (sName, sValue);
} |
java | public static void add(ClassVisitor cw, ClassInfo classInfo, boolean typeQueryRootBean) {
List<FieldInfo> fields = classInfo.getFields();
if (fields != null) {
for (FieldInfo field : fields) {
field.writeMethod(cw, typeQueryRootBean);
}
}
} |
java | public FessMessages addConstraintsRangeMessage(String property, String min, String max) {
assertPropertyNotNull(property);
add(property, new UserMessage(CONSTRAINTS_Range_MESSAGE, min, max));
return this;
} |
java | public static boolean areBooleanEquals(Boolean boolean1, Boolean boolean2) {
if (boolean1 != null && !boolean1.equals(boolean2)) {
return false;
} else if (boolean2 != null && !boolean2.equals(boolean1)) {
return false;
}
return true;
} |
java | @Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
try {
boolean isFragment = ContextUtils.isFragment(fragment);
boolean isSupportFragment = ContextUtils.isSupportFragment(fragment);
if(isFragment || isSupportFragment) {
Layout layou... |
java | @Override
protected Promise call(String name, Tree params, Options opts, PacketStream stream, Context parent, String targetID,
int remaining) {
EndpointKey endpointKey = null;
ErrorCounter errorCounter = null;
try {
// Get the first recommended Endpoint and Error Counter
ActionEndpoint action =... |
java | public TokenResult prepareLogin(String username) throws Exception {
username = encode(username);
Api apiResult = null;
TokenResult token = new TokenResult();
token.tokenName = "lgtoken";
token.tokenMode = TokenMode.token1_19;
// see https://github.com/WolfgangFahl/Mediawiki-Japi/issues/31
if... |
java | protected List<INode> getUserModules(List<? extends INode> ast)
{
List<INode> userModules = new LinkedList<INode>();
for (INode node : ast)
{
if (!getInfo().getDeclAssistant().isLibrary(node))
{
userModules.add(node);
}
}
return userModules;
} |
python | def tryimport(modname, pipiname=None, ensure=False):
"""
CommandLine:
python -m utool.util_import --test-tryimport
Example:
>>> # ENABLE_DOCTEST
>>> from utool.util_tests import * # NOQA
>>> import utool as ut
>>> modname = 'pyfiglet'
>>> pipiname = 'git+htt... |
java | public String processRequest(HttpServletRequest request) {
Map<String, Object> reqMap = MessageUtil.parseXml(request, getToken(), getAppId(), getAESKey());
String fromUserName = (String) reqMap.get("FromUserName");
String toUserName = (String) reqMap.get("ToUserName");
String msgType... |
python | def import_project(controller, project_id, stream, location=None, name=None, keep_compute_id=False):
"""
Import a project contain in a zip file
You need to handle OSerror exceptions
:param controller: GNS3 Controller
:param project_id: ID of the project to import
:param stream: A io.BytesIO of... |
python | def listen(self):
"""
Listens to messages
"""
with Consumer(self.connection, queues=self.queue, on_message=self.on_message,
auto_declare=False):
for _ in eventloop(self.connection, timeout=1, ignore_timeouts=True):
pass |
java | public static boolean isMatch(Method javaMethod,
String name, Class<?> []param)
{
if (! javaMethod.getName().equals(name))
return false;
Class<?> []mparam = javaMethod.getParameterTypes();
return isMatch(mparam, param);
} |
java | public ListThingGroupsResult withThingGroups(GroupNameAndArn... thingGroups) {
if (this.thingGroups == null) {
setThingGroups(new java.util.ArrayList<GroupNameAndArn>(thingGroups.length));
}
for (GroupNameAndArn ele : thingGroups) {
this.thingGroups.add(ele);
}
... |
python | def launch_cif_clean(cif_filter, cif_select, group_cif_raw, group_cif_clean, group_structure, group_workchain, node,
max_entries, skip_check, parse_engine, daemon):
"""Run the `CifCleanWorkChain` on the entries in a group with raw imported CifData nodes.
It will use the `cif_filter` and `cif_select` script... |
java | public static Object toUUId(Object o, Object defaultValue) {
String str = toString(o, null);
if (str == null) return defaultValue;
if (!Decision.isUUId(str)) return defaultValue;
return str;
} |
java | @Override
public boolean writeEvent(AuditEvent event) throws HandlerException {
StringBuilder elements = new StringBuilder();
for (Field element : event.getFields()) {
elements.append(
element.getName() + " " + element.getType() + ":" + element.getValue() + ", ");
}
try (Connection conn... |
python | def FALSE(classical_reg):
"""
Produce a FALSE instruction.
:param classical_reg: A classical register to modify.
:return: An instruction object representing the equivalent MOVE.
"""
warn("`FALSE a` has been deprecated. Use `MOVE a 0` instead.")
if isinstance(classical_reg, int):
cla... |
python | def _write_abstract_named_entity(self):
""" This method generates AbstractNamedEntity class js file.
"""
filename = "%sAbstractNamedEntity.js" % (self._class_prefix)
superclass_name = "%sEntity" % (self._class_prefix)
# write will write a file using a te... |
java | private void processInboxResponse(final JSONObject response){
if(getConfig().isAnalyticsOnly()){
getConfigLogger().verbose(getAccountId(),"CleverTap instance is configured to analytics only, not processing inbox messages");
return;
}
getConfigLogger().verbose(getAccountI... |
java | public static Method getListenerMethod(String invokedMethodName, boolean isBefore) {
if (isBefore) {
return beforeLifecycleMethodsByMethodName.get(invokedMethodName);
} else {
return afterLifecycleMethodsByMethodName.get(invokedMethodName);
}
} |
java | public AbstractBuilder getMethodBuilder(ClassWriter classWriter) {
return MethodBuilder.getInstance(context, classWriter.getTypeElement(),
writerFactory.getMethodWriter(classWriter));
} |
python | def set_data(self, pos=None, symbol='o', size=10., edge_width=1.,
edge_width_rel=None, edge_color='black', face_color='white',
scaling=False):
""" Set the data used to display this visual.
Parameters
----------
pos : array
The array of locat... |
java | public CQLSSTableWriter rawAddRow(ByteBuffer... values)
throws InvalidRequestException, IOException
{
return rawAddRow(Arrays.asList(values));
} |
python | def _compile_prefixes(self):
'''
Create a dict of all OS prefixes and their compiled regexs
'''
self.compiled_prefixes = {}
for dev_os, os_config in self.config.items():
if not os_config:
continue
self.compiled_prefixes[dev_os] = []
... |
python | def _callback_new_block(self, latest_block: Dict):
"""Called once a new block is detected by the alarm task.
Note:
This should be called only once per block, otherwise there will be
duplicated `Block` state changes in the log.
Therefore this method should be called ... |
java | public void annotate(Run<?,?> build, Entry change, MarkupText text) {
if (build instanceof AbstractBuild && Util.isOverridden(ChangeLogAnnotator.class, getClass(), "annotate", AbstractBuild.class, Entry.class, MarkupText.class)) {
annotate((AbstractBuild) build, change, text);
} else {
... |
python | def is_ipv4_filter(ip, options=None):
'''
Returns a bool telling if the value passed to it was a valid IPv4 address.
ip
The IP address.
net: False
Consider IP addresses followed by netmask.
options
CSV of options regarding the nature of the IP address. E.g.: loopback, mult... |
java | public long getTimeInMillis(final Calendar startInstant) {
Calendar cal = (Calendar) startInstant.clone();
addTo(cal);
return getCalendarTimeInMillis(cal)
- getCalendarTimeInMillis(startInstant);
} |
java | public void setVectorCounters(java.util.Collection<SummarizedCounter> vectorCounters) {
if (vectorCounters == null) {
this.vectorCounters = null;
return;
}
this.vectorCounters = new java.util.ArrayList<SummarizedCounter>(vectorCounters);
} |
python | def lookup_bg_color(self, bg_color):
"""
Return the color for use in the
`windll.kernel32.SetConsoleTextAttribute` API call.
:param bg_color: Background as text. E.g. 'ffffff' or 'red'
"""
# Background.
if bg_color in BG_ANSI_COLORS:
return BG_ANSI_CO... |
java | static String makeXmlName(String name) {
if (name.length()==0) name="_";
if (!XmlChars.isNameStart(name.charAt(0))) {
if (name.length()>1 && XmlChars.isNameStart(name.charAt(1)))
name = name.substring(1);
else
name = '_'+name;
}
... |
python | def plot_input(ace_model, fname='ace_input.png'):
"""Plot the transforms."""
if not plt:
raise ImportError('Cannot plot without the matplotlib package')
plt.rcParams.update({'font.size': 8})
plt.figure()
num_cols = len(ace_model.x) / 2 + 1
for i in range(len(ace_model.x)):
plt.su... |
java | public void marshall(DescribeUploadBufferRequest describeUploadBufferRequest, ProtocolMarshaller protocolMarshaller) {
if (describeUploadBufferRequest == null) {
throw new SdkClientException("Invalid argument passed to marshall(...)");
}
try {
protocolMarshaller.marshal... |
java | public void tagSubtree(Area root)
{
tagSingleNode(root);
for (int i = 0; i < root.getChildCount(); i++)
tagSubtree(root.getChildAt(i));
}
/**
* Applies all the taggers to a single tree node.
* @param area the tree node
*/
public void tagSingleNode(Area are... |
python | def query(self, sql, *args, **kwargs):
"""Executes an SQL SELECT query, returning a result set as a Statement object.
:param sql: query to execute
:param args: parameters iterable
:param kwargs: parameters iterable
:return: result set as a Statement object
:rtype: pydbal... |
python | def imagetransformerpp_base_5l_8h_big_uncond_dr00_dan_g_bs1():
"""For 256x256."""
hparams = imagetransformerpp_base_10l_8h_big_uncond_dr03_dan_g()
# TODO(trandustin): I forgot to set this in the runs! Maybe it's not used in
# image transformer training implementation?
# hparams.img_len = 256
hparams.max_len... |
java | public static void registerUrlTypes(String...typesToSkip) {
final List<Vfs.UrlType> urlTypes = Lists.newArrayList();
// include a list of file extensions / filenames to be recognized
urlTypes.add(new EmptyIfFileEndingsUrlType(typesToSkip));
urlTypes.addAll(Arrays.asList(Vfs.DefaultUrl... |
java | public FromHostPrimitiveResult < T > fromHost(Class < T > javaClass,
CobolContext cobolContext, byte[] hostData, int start) {
int bytesLen = getBytesLen();
// For strings it is acceptable that host is sending over less data
// than expected. This happens when trailing low values ar... |
java | public Vector getMidpoint(Vector other) {
double x = (this.x + other.x) / 2;
double y = (this.y + other.y) / 2;
double z = (this.z + other.z) / 2;
return new Vector(x, y, z);
} |
python | def __install_node_dependencies(kudu_client):
"""Installs Node.js dependencies at `site/wwwroot/` for Node.js bots.
This method is only called when the detected bot is a Node.js bot.
:return: Dictionary with results of the HTTP Kudu request
"""
if not kudu_client._KuduClient__initialized: # pylin... |
python | def embed(self, width=600, height=650):
"""
Embed a viewer into a Jupyter notebook.
"""
from IPython.display import IFrame
return IFrame(self.url, width, height) |
java | public PythonKeyedStream key_by(KeySelector<PyObject, PyKey> selector) throws IOException {
return new PythonKeyedStream(stream.keyBy(new PythonKeySelector(selector)));
} |
java | public BinaryClassificationFMeasure evaluate(String corpus)
{
Instance[] instanceList = readInstance(corpus, model.featureMap);
return evaluate(instanceList);
} |
java | public void set(Object data, int iOpenMode) throws DBException, RemoteException
{
BaseTransport transport = this.createProxyTransport(SET);
transport.addParam(DATA, data);
transport.addParam(OPEN_MODE, iOpenMode);
Object strReturn = transport.sendMessageAndGetReply();
Object ... |
java | private static void computeCentroid(double[] centroid, Relation<? extends NumberVector> relation, DBIDs ids) {
Arrays.fill(centroid, 0);
int dim = centroid.length;
for(DBIDIter it = ids.iter(); it.valid(); it.advance()) {
NumberVector v = relation.get(it);
for(int i = 0; i < dim; i++) {
... |
java | protected boolean updateStatusFile(List<File> createdFiles) {
boolean success;
final Properties statusProperties = new Properties();
try {
for (File createdFile : createdFiles) {
try {
statusProperties.setProperty(
getProjectRelativePath(createdFile),
calculateChecksum(createdFile));
... |
java | public void setIpRoutesInfo(java.util.Collection<IpRouteInfo> ipRoutesInfo) {
if (ipRoutesInfo == null) {
this.ipRoutesInfo = null;
return;
}
this.ipRoutesInfo = new com.amazonaws.internal.SdkInternalList<IpRouteInfo>(ipRoutesInfo);
} |
java | List<Integer> convexhull(List<Float> pts) {
int npts = pts.size() / 3;
List<Integer> out = new ArrayList<>();
// Find lower-leftmost point.
int hull = 0;
for (int i = 1; i < npts; ++i) {
float[] a = new float[] { pts.get(i * 3), pts.get(i * 3 + 1), pts.get(i * 3 + 2) ... |
java | public void reload() {
providers = new HashSet<Metadata<S>>();
for (URL serviceFile : loadServiceFiles()) {
loadServiceFile(serviceFile);
}
} |
python | def add_section(self, name):
"""Append `section` to model
Arguments:
name (str): Name of section
"""
assert isinstance(name, str)
# Skip existing sections
for section in self.sections:
if section.name == name:
return section
... |
java | public String objectToString() {
try {
checkForDao();
} catch (SQLException e) {
throw new IllegalArgumentException(e);
}
@SuppressWarnings("unchecked")
T t = (T) this;
return dao.objectToString(t);
} |
java | public List<Attribute> collectAttributes(QualifiedName context, QualifiedName qualifiedName,
Types.ProvType type) {
List<Attribute> attributes = new ArrayList<Attribute>();
List<Statement> statements = collators.get(context).get(qualifiedName);
for (Statement statement : statements) {
QualifiedName pr... |
java | public static Codec<long[], LongGene> ofVector(
final LongRange domain,
final int length
) {
requireNonNull(domain);
require.positive(length);
return Codec.of(
Genotype.of(LongChromosome.of(domain, length)),
gt -> gt.getChromosome().as(LongChromosome.class).toArray()
);
} |
java | @Override
protected void _from(ObjectInput in) throws IOException,
ClassNotFoundException {
// XXX this can be improved
final int size = in.readInt();
for (int i = 0; i < size; i++) {
final int termIndex = in.readInt();
final int parametersSize = in.readIn... |
java | public static void doMetaUpdateVersionsOnStores(AdminClient adminClient,
List<StoreDefinition> oldStoreDefs,
List<StoreDefinition> newStoreDefs) {
Set<String> storeNamesUnion = new HashSet<String>... |
python | def _find_id(self, result, uid):
"""
This method performs a depth-first search for the given uid in the dictionary of results.
"""
# if the result is a list
if isinstance(result, list):
# if the list has a valid entry
if any([self._find_id(value, uid) ... |
python | def copy(self, deep=True):
"""
Make a copy of this object's indices and data.
When ``deep=True`` (default), a new object will be created with a
copy of the calling object's data and indices. Modifications to
the data or indices of the copy will not be reflected in the
or... |
java | public ServiceFuture<Void> validatePurchaseInformationAsync(AppServiceCertificateOrderInner appServiceCertificateOrder, final ServiceCallback<Void> serviceCallback) {
return ServiceFuture.fromResponse(validatePurchaseInformationWithServiceResponseAsync(appServiceCertificateOrder), serviceCallback);
} |
python | def from_array(array):
"""
Deserialize a new ShippingOption from a given dictionary.
:return: new ShippingOption instance.
:rtype: ShippingOption
"""
if array is None or not array:
return None
# end if
assert_type_or_raise(array, dict, paramet... |
python | def validate_metadata_token(self, claims, endpoint):
"""
If the token endpoint is used in the grant type, the value of this
parameter MUST be the same as the value of the "grant_type"
parameter passed to the token endpoint defined in the grant type
definition.
"""
... |
python | def lookUpFieldType(field_type):
""" Converts the ArcGIS REST field types to Python Types
Input:
field_type - string - type of field as string
Output:
Python field type as string
"""
if field_type == "esriFieldTypeDate":
return "DATE"
elif field_type == "esr... |
java | protected void handleException(Throwable t) {
if (LOG.isErrorEnabled()) {
LOG.error(Messages.get().getBundle().key(Messages.LOG_ERR_JSP_BEAN_0), t);
}
if (!(m_isSupressingExceptions || getRequestContext().getCurrentProject().isOnlineProject())) {
if (LOG.isDebugEnabled()... |
java | private void checkMallocedChunk(int mem, int s) {
if (VALIDATING) {
int p = memToChunk(mem);
int sz = head(p) & ~INUSE_BITS;
checkInUseChunk(p);
if (sz < MIN_CHUNK_SIZE)
throw new AssertionError("Allocated chunk " + p + " is too small");
if ((sz & CHUNK_ALIGN_MASK) != 0)
... |
python | def _fit_gpu(self, Ciu_host, Cui_host, show_progress=True):
""" specialized training on the gpu. copies inputs to/from cuda device """
if not implicit.cuda.HAS_CUDA:
raise ValueError("No CUDA extension has been built, can't train on GPU.")
if self.dtype == np.float64:
lo... |
java | private static final int count_flip(final int[] perm_flip)
{
// cache first element, avoid swapping perm[0] and perm[k]
int v0 = perm_flip[0];
int tmp;
int flip_count = 0;
do
{
for (int i = 1, j = v0 - 1; i < j; ++i, --j)
{
tmp... |
java | @Override
public int compareTo (CharsetMatch other) {
int compareResult = 0;
if (this.fConfidence > other.fConfidence) {
compareResult = 1;
} else if (this.fConfidence < other.fConfidence) {
compareResult = -1;
}
return compareResult;
} |
python | def reindex_model_on_save(sender, document, **kwargs):
'''(Re/Un)Index Mongo document on post_save'''
if current_app.config.get('AUTO_INDEX'):
reindex.delay(document) |
java | @Override
public void printStack(final StringBuilder sb, final StackTraceElement[] trace) {
for (final StackTraceElement element : trace) {
sb.append("\tat ").append(element).append('\n');
}
} |
java | public static void pushImageTag(DockerClient docker, String imageName,
List<String> imageTags, Log log, boolean skipPush)
throws MojoExecutionException, DockerException, IOException, InterruptedException {
if (skipPush) {
log.info("Skipping docker push");
return;
... |
python | def join(self, other):
"""
Try to join a rectangle to this one, if the result is also a rectangle
and the operation is successful and this rectangle is modified to the union.
Arguments:
other (Rectangle): Rectangle to join
Returns:
bool: True when succe... |
python | def create_translation_field(model, field_name, lang, empty_value):
"""
Translation field factory. Returns a ``TranslationField`` based on a
fieldname and a language.
The list of supported fields can be extended by defining a tuple of field
names in the projects settings.py like this::
MOD... |
python | def has_legend(self, bool_value):
"""
Add, remove, or leave alone the ``<c:legend>`` child element depending
on current state and *bool_value*. If *bool_value* is |True| and no
``<c:legend>`` element is present, a new default element is added.
When |False|, any existing legend el... |
java | public void addCluster() {
System.out.printf("%nAdding cluster: %s to instance: %s%n", CLUSTER, instanceId);
// [START bigtable_create_cluster]
try {
adminClient.createCluster(
CreateClusterRequest.of(instanceId, CLUSTER)
.setZone("us-central1-c")
.setServeNodes(3... |
python | def remove(attributes, properties):
"""Returns a property sets which include all the elements
in 'properties' that do not have attributes listed in 'attributes'."""
if isinstance(attributes, basestring):
attributes = [attributes]
assert is_iterable_typed(attributes, basestring)
assert is_ite... |
python | def linear_interpolate(p1, p2, fraction):
'''Returns the point p satisfying: p1 + fraction * (p2 - p1)'''
return np.array((p1[0] + fraction * (p2[0] - p1[0]),
p1[1] + fraction * (p2[1] - p1[1]),
p1[2] + fraction * (p2[2] - p1[2]))) |
java | public void printScreen(PrintWriter out, ResourceBundle reg)
throws DBException
{
int iPrintOptions = this.getScreenField().getPrintOptions();
this.getScreenField().printControl(out, iPrintOptions);
this.getScreenField().printData(out, iPrintOptions);
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.