language stringclasses 2
values | func_code_string stringlengths 63 466k |
|---|---|
java | public void show (Popups.Position pos, Widget target)
{
Popups.show(this, pos, target);
} |
python | def add_secondary(self, address, append_lists=False):
"""
Add secondary IP addresses to this host element. If append_list
is True, then add to existing list. Otherwise overwrite.
:param list address: ip addresses to add in IPv4 or IPv6 format
:param bool append_list: add... |
java | public org.yecht.Node handle(Parser p, String a) {
IRubyObject anchor_name = runtime.newString(a);
IRubyObject nm = runtime.newString("name");
org.yecht.Node badanc = org.yecht.Node.newMap(nm, anchor_name);
badanc.type_id = "tag:ruby.yaml.org,2002:object:YAML::Yecht::BadAlias";
r... |
python | def copy_all_a(input_a, *other_inputs, **kwargs):
"""Copy all readings in input a into the output.
All other inputs are skipped so that after this function runs there are no
readings left in any of the input walkers when the function finishes, even
if it generated no output readings.
Returns:
... |
python | def findbestparams_iso(xsamples):
""" Minimize sum of square differences of H_iso-<H_iso> for timesamples"""
p = 0.5*np.sum(xsamples.T[3:]**2,axis=0)
r = np.sum(xsamples.T[:3]**2,axis=0)
return np.abs(leastsq(deltaH_iso,np.array([10.,10.]), Dfun = None , col_deriv=1,args=(p,r,))[0]) |
python | def device_event_list(self, **kwargs): # noqa: E501
"""List all device events. # noqa: E501
List all device events for an account. # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass asynchronous=True
>>> thr... |
java | public final void declareAlreadyPrecommitted() throws TaskListException
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(this, tc, "declareAlreadyPrecommitted");
if (STATE_UNTOUCHED == _state)
{
_state = STATE_END_PRECOMMIT;
}
else i... |
java | @Override
public EJSWrapperCommon internalCreateWrapper(BeanId beanId)
throws CreateException, RemoteException, CSIException
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
Tr.entry(tc, "internalCreateWrapper : " + beanId);
// -----------------... |
python | def p_expression_lor(self, p):
'expression : expression LOR expression'
p[0] = Lor(p[1], p[3], lineno=p.lineno(1))
p.set_lineno(0, p.lineno(1)) |
java | protected final ItemInList findItemInListFor(final List<ItemInList> pItemsList, final Long pItemId, final EShopItemType pItemType) {
int j = 0;
while (j < pItemsList.size()) {
if (pItemsList.get(j).getItsType().equals(pItemType)
&& pItemsList.get(j).getItemId().equals(pItemId)) {
return p... |
python | def Change(self,cpu=None,memory=None,description=None,group_id=None):
"""Change existing server object.
One more more fields can be set and method will return with a requests
object for all queued activities. This is a convenience function - all
each of these changes requires a seperate API call. Some API ca... |
java | private NodeUsageReport getReportUnprotected(String trackerName) {
NodeUsageReport usageReport = usageReports.get(trackerName);
if (usageReport == null) {
usageReport = new NodeUsageReport(trackerName, 0, 0, 0, 0, 0, 0, 0);
usageReports.put(trackerName, usageReport);
}
return usageReport;
... |
python | def get_intel_notifications_feed(self, page=None, timeout=None):
""" Get notification feed in JSON for further processing.
:param page: the next_page property of the results of a previously issued query to this API. This parameter
should not be provided if it is the very first query to the ... |
java | static int seeded(int item, int i) {
long hash = SEED[i] * item;
hash += hash >>> 32;
return (int) hash;
} |
python | def Jkpw(dW, h, n=5):
"""matrix J approximating repeated Stratonovich integrals for each of N
time intervals, based on the method of Kloeden, Platen and Wright (1992).
Args:
dW (array of shape (N, m)): giving m independent Weiner increments for
each time step N. (You can make this array using... |
java | public long getPID() {
long currentPID = cachedPID.get();
if (currentPID != 0) {
return currentPID;
}
try {
currentPID = detectPID();
} catch (Throwable cause) {
logger.info("Unable to detect process ID!", cause);
}
if (currentPID == 0) {
currentPID = System.nanoTime();
if (!cac... |
python | def new_with_atts_removed(self, *attributes):
"""Returns a new FmtStr with the same content but some attributes removed"""
return FmtStr(*[Chunk(bfs.s, bfs.atts.remove(*attributes))
for bfs in self.chunks]) |
java | static public long unpackRecid(DataInput2 in) throws IOException {
long val = in.readPackedLong();
val = DataIO.parity1Get(val);
return val >>> 1;
} |
java | public String sequence(int hashCode) {
if (hashCode <= 0)
return null;
int state = 0;
// If the hash code is larger than the number of suffixes in the start state,
// the hash code does not correspond to a sequence.
if (hashCode > d_nSeqs)
return null;
... |
python | def mkdir(self, astr_dirSpec):
"""
Given an <astr_dirSpec> in form '/a/b/c/d/.../f',
create that path in the internal stree, creating all
intermediate nodes as necessary
:param astr_dirSpec:
:return:
"""
if astr_dirSpec != ... |
java | public static int[] range(int length) {
int[] index = new int[length];
for (int i=0; i<index.length; i++) {
// TODO: This should maybe be a safe cast for the benefit of non-IntDouble classes.
index[i] = (int) i;
}
return index;
} |
java | public void marshall(Rectangle rectangle, ProtocolMarshaller protocolMarshaller) {
if (rectangle == null) {
throw new SdkClientException("Invalid argument passed to marshall(...)");
}
try {
protocolMarshaller.marshall(rectangle.getHeight(), HEIGHT_BINDING);
... |
java | public byte[] decodeBytes(byte[] rgbValue)
throws NoSuchAlgorithmException
{
rgbValue = super.decodeBytes(rgbValue); // Base64 encoding
rgbValue = this.decrypt(rgbValue);
return rgbValue;
} |
python | def _dens(self, R, z, phi=0., t=0.):
"""
NAME:
_dens
PURPOSE:
evaluate the density at (R,z, phi)
INPUT:
R - Cylindrical Galactocentric radius
z - vertical height
phi - azimuth
t - time
OUTPUT:
density at... |
python | def _validate_build_resource_structure(autoload_resource):
"""Validate resource structure
:param dict autoload_resource:
:return correct autoload resource structure
:rtype: dict
"""
result = {}
for resource_prefix, resources in autoload_resource.iteritems():
... |
python | def derivative(f, t):
"""Fourth-order finite-differencing with non-uniform time steps
The formula for this finite difference comes from Eq. (A 5b) of "Derivative formulas and errors for non-uniformly
spaced points" by M. K. Bowen and Ronald Smith. As explained in their Eqs. (B 9b) and (B 10b), this is a
... |
java | public static Map<String, String> getEvidences(ProbabilisticNetwork bn) {
HashMap<String, String> evidences = new HashMap<String, String>();
for (Node n : bn.getNodes()) {
ProbabilisticNode pn = (ProbabilisticNode) n;
if (pn.hasEvidence()) {
evidences.put(pn.getN... |
java | public void marshall(EncryptionConfiguration encryptionConfiguration, ProtocolMarshaller protocolMarshaller) {
if (encryptionConfiguration == null) {
throw new SdkClientException("Invalid argument passed to marshall(...)");
}
try {
protocolMarshaller.marshall(encryption... |
java | public Options put(String key, ICollectionItemOptions value)
{
options.put(key, value);
return this;
} |
python | def wite_to_json(self, dir_path="", file_name=""):
"""将性能数据写入文件."""
# 提取数据
data = {
"plot_data": self.record_thread.profile_data,
"method_exec_info": self.method_exec_info,
"search_file": self.search_file,
"source_file": self.source_file}
#... |
java | @Override
public DeleteDatastoreResult deleteDatastore(DeleteDatastoreRequest request) {
request = beforeClientExecution(request);
return executeDeleteDatastore(request);
} |
java | private List<PipelineStage> findUnmappedStages(Dashboard dashboard,List<PipelineStage> pipelineStageList){
List<PipelineStage> unmappedStages = new ArrayList<>();
Map<PipelineStage, String> stageToEnvironmentNameMap = PipelineUtils.getStageToEnvironmentNameMap(dashboard);
for (PipelineStage sy... |
java | private SagaType containsItem(final Iterable<SagaType> source, final Class itemToSearch) {
SagaType containedItem = null;
for (SagaType sagaType : source) {
if (sagaType.getSagaClass().equals(itemToSearch)) {
containedItem = sagaType;
break;
}
... |
java | public static void startWakefulService(Context context) {
acquireWakeLock(context);
context.startService(new Intent(context, WingsService.class));
} |
python | def send_heartbeats(heartbeats, args, configs, use_ntlm_proxy=False):
"""Send heartbeats to WakaTime API.
Returns `SUCCESS` when heartbeat was sent, otherwise returns an error code.
"""
if len(heartbeats) == 0:
return SUCCESS
api_url = args.api_url
if not api_url:
api_url = 'h... |
python | def write_element(elem_to_parse, file_or_path, encoding=DEFAULT_ENCODING):
"""
Writes the contents of the parsed element to file_or_path
:see: get_element(parent_to_parse, element_path)
"""
xml_header = '<?xml version="1.0" encoding="{0}"?>'.format(encoding)
get_element_tree(elem_to_parse).wri... |
python | def _kl_divergence_bh(params, P, degrees_of_freedom, n_samples, n_components,
angle=0.5, skip_num_points=0, verbose=False):
"""t-SNE objective function: KL divergence of p_ijs and q_ijs.
Uses Barnes-Hut tree methods to calculate the gradient that
runs in O(NlogN) instead of O(N^2)
... |
java | public void stop()
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.entry(tc, "stop");
synchronized (this)
{
active = false;
// stop the liveness timer for sending ControlRequestHighestGeneratedTick, if needed
//NOTE: the requestHighestGeneratedTickTimer w... |
python | def retract(self, idx_or_declared_fact):
"""
Retracts a specific fact, using its index
.. note::
This updates the agenda
"""
self.facts.retract(idx_or_declared_fact)
if not self.running:
added, removed = self.get_activations()
self.st... |
python | def fetch_changes(repo_path, up_commit='master'):
"""
Fetch latest changes from stage and touch .timestamp
if any python sources have been modified.
"""
last_up_commit = None
prevcwd = os.getcwd()
try:
gitexe = 'git'
os.chdir(repo_path)
old_sources_timestamp = sources... |
python | def set_property(self, name, value, update_session=True):
"""Create or set the value of a property. Returns `True` if the property was created or updated, or `False` if
there were no changes to the value of the property.
Args:
name (str): Name of the property to create or update
... |
java | private void pushEvent(GobblinTrackingEvent event) throws IOException {
Map<String, String> metadata = event.getMetadata();
String name = getMetricName(metadata, event.getName());
long timestamp = event.getTimestamp();
MultiPartEvent multiPartEvent = MultiPartEvent.getEvent(metadata.get(EventSubmitter.... |
java | public String convertTextFidelityRepTxtExToString(EDataType eDataType, Object instanceValue) {
return instanceValue == null ? null : instanceValue.toString();
} |
python | def flush_tx_buffer(self):
"""
Flushes the transmit buffer.
:raises can.CanError:
If flushing of the transmit buffer failed.
"""
log.info('Flushing transmit buffer')
self._ucan.reset_can(self.channel, ResetFlags.RESET_ONLY_TX_BUFF) |
java | private int itemToIndex(I i) {
Integer r = allItems.absoluteIndexOf(i);
return r == null ? -1 : r.intValue();
} |
java | public static byte[] encryptWithPublicKey(byte[] publicKeyData, byte[] data)
throws InvalidKeyException, NoSuchAlgorithmException, InvalidKeySpecException,
NoSuchPaddingException, IllegalBlockSizeException, BadPaddingException, IOException {
return encryptWithPublicKey(publicKeyData, dat... |
java | @Override
public Collection<URL> getURLs() {
// There is only ever a single URI for the directory so return this
try {
return Collections.singleton(dir.toURI().toURL());
} catch (MalformedURLException e) {
return Collections.emptySet();
}
} |
python | def FlatArrow(line1, line2, c="m", alpha=1, tipSize=1, tipWidth=1):
"""Build a 2D arrow in 3D space by joining two close lines.
.. hint:: |flatarrow| |flatarrow.py|_
"""
if isinstance(line1, Actor):
line1 = line1.coordinates()
if isinstance(line2, Actor):
line2 = line2.coordinates()... |
python | def ticket_collaborators(self, id, **kwargs):
"https://developer.zendesk.com/rest_api/docs/core/tickets#list-collaborators-for-a-ticket"
api_path = "/api/v2/tickets/{id}/collaborators.json"
api_path = api_path.format(id=id)
return self.call(api_path, **kwargs) |
java | private void errorStatus(MtasSolrStatus status, IOException exception) {
try {
status.setError(exception);
if (requestHandler != null) {
requestHandler.finishStatus(status);
}
} catch (IOException e) {
log.error(e);
}
} |
python | def subscribe(self, coro):
"""
Subscribe to status updates from the Opentherm Gateway.
Can only be used after connect()
@coro is a coroutine which will be called with a single
argument (status) when a status change occurs.
Return True on success, False if not connected or... |
python | def __move(self, current_pos):
'''
Move in the feature map.
Args:
current_pos: The now position.
Returns:
The next position.
'''
if self.__move_range is not None:
next_pos = np.random.randint(current_pos - self.__move_range, curren... |
java | @Override
public void renderHead(IHeaderResponse response) {
super.renderHead(response);
response.render(JavaScriptHeaderItem.forReference(DRAWER_JAVASCRIPT));
response.render(JavaScriptHeaderItem.forReference(MANAGER_JAVASCRIPT));
response.render(CssHeaderItem.forReference(DRAWER_CSS));
Iterator<ListItem>... |
python | def init_config(self, app):
"""Initialize configuration."""
# Set up API endpoints for records.
for k in dir(config):
if k.startswith('RECORDS_REST_'):
app.config.setdefault(k, getattr(config, k))
# Resolve the Elasticsearch error handlers
handlers = ... |
python | def addFeatureEndLocation(
self, coordinate, reference_id, strand=None, position_types=None):
"""
Adds the coordinate details for the end of this feature
:param coordinate:
:param reference_id:
:param strand:
:return:
"""
self.stop = self._g... |
python | def on_plot_select(self,event):
"""
Select data point if cursor is in range of a data point
@param: event -> the wx Mouseevent for that click
"""
if not self.xdata or not self.ydata: return
pos=event.GetPosition()
width, height = self.canvas.get_width_height()
... |
java | public static Tailer create(final File file, final TailerListener listener, final long delayMillis,
final boolean end, final boolean reOpen, final int bufSize) {
return Tailer.create(file, Tailer.DEFAULT_CHARSET, listener, delayMillis, end, reOpen, bufSize);
} |
python | def expire_leaderboard_at_for(self, leaderboard_name, timestamp):
'''
Expire the given leaderboard at a specific UNIX timestamp. Do not use this with
leaderboards that utilize member data as there is no facility to cascade the
expiration out to the keys for the member data.
@par... |
python | def targets(self):
"""
Using the data from the BLAST analyses, set the targets folder, and create the 'mapping file'. This is the
genera-specific FASTA file that will be used for all the reference mapping; it replaces the 'bait file' in the
code
"""
logging.info('Performi... |
python | def confirm_operation(prompt, prefix=None, assume_yes=False, err=False):
"""Prompt the user for confirmation for dangerous actions."""
if assume_yes:
return True
prefix = prefix or click.style(
"Are you %s certain you want to" % (click.style("absolutely", bold=True))
)
prompt = "%(... |
java | private FlowScope traverseArrayLiteral(Node n, FlowScope scope) {
scope = traverseChildren(n, scope);
n.setJSType(getNativeType(ARRAY_TYPE));
return scope;
} |
python | def address(address=None):
"""Convert one of a number of inputs into a valid ip:port string.
Elements which are not provided are filled in as follows:
* IP Address: the system is asked for the set of IP addresses associated
with the machine and the first one is used, preferring those matchin... |
python | def delete_mount_cache(real_name):
'''
.. versionadded:: 2018.3.0
Provide information if the path is mounted
CLI Example:
.. code-block:: bash
salt '*' mount.delete_mount_cache /mnt/share
'''
cache = salt.utils.mount.read_cache(__opts__)
if cache:
if 'mounts' in cach... |
java | public CSVParserBuilder<T, K> usingSeparatorWithQuote(char separator, char quote) {
this.metadata = new CSVFileMetadata(separator, Optional.of(quote));
return this;
} |
python | def propagate(self, assumptions=[], phase_saving=0):
"""
Propagate a given set of assumption literals.
"""
if self.maplesat:
if self.use_timer:
start_time = time.clock()
# saving default SIGINT handler
def_sigint_handler = signal... |
python | def uniq(self) -> 'TList[T]':
"""
Usage:
>>> TList([1, 2, 3, 2, 1]).uniq()
[1, 2, 3]
"""
rs = TList()
for e in self:
if e not in rs:
rs.append(e)
return rs |
python | def set_manifest(self, alias, manifest_json):
"""
Give a name (alias) to a manifest.
:param alias: Alias name
:type alias: str
:param manifest_json: A V2 Schema 2 manifest JSON string
:type digests: list
"""
self._request('put',
'ma... |
java | public T path(String path) {
if (path.length() == 0) {
this.path += encodePath(path);
} else {
this.path += "/" + encodePath(path);
}
return returnThis();
} |
python | def extract_bs(self, cutoff, ligcentroid, resis):
"""Return list of ids from residues belonging to the binding site"""
return [obres.GetIdx() for obres in resis if self.res_belongs_to_bs(obres, cutoff, ligcentroid)] |
python | def calc_intsize(self):
""" Calculates the size of an integration (cross + auto) in bytes
"""
# assume first cross blob starts after headxml and second is one int of bytes later
for k in self.binarychunks.iterkeys():
if int(k.split('/')[3]) == 1 and 'cross' in k.split(... |
java | public void removeLockedNode(String nodeId) throws SQLException
{
ResultSet resultSet = null;
PreparedStatement preparedStatement = null;
Connection jdbcConnection = openConnection();
try
{
InspectionQuery query = getDeleteQuery(nodeId);
preparedStatement = jdbcConne... |
python | def info(gandi, resource):
"""Display information about an ip.
Resource can be an ip or id.
"""
output_keys = ['ip', 'state', 'dc', 'type', 'vm', 'reverse']
datacenters = gandi.datacenter.list()
ip = gandi.ip.info(resource)
iface = gandi.iface.info(ip['iface_id'])
vms = None
if if... |
python | def _wrap_public_method(self, attr):
"""
Ensure that plugin will call current connection method when accessing
as ``plugin.<public_method>(*args, **kwargs)``.
"""
def wrapper(*args, **kwargs):
return getattr(self.connection, attr)(*args, **kwargs)
return wrapp... |
python | def _read_msg(session):
"""
Perform a read on input socket to consume message and then return the
payload and block_id in a tuple.
:param session: Push Session to read data for.
"""
if len(session.data) == session.message_length:
# Data Already completely read. Return
return Tr... |
java | public IoBuffer fetchOutNetBuffer() {
IoBufferEx answer = outNetBuffer;
if (answer == null) {
return (IoBuffer) emptyBuffer;
}
outNetBuffer = null;
return (IoBuffer) answer.shrink(allocator);
} |
java | @Override
public Identifier toPhysicalColumnName(Identifier name, JdbcEnvironment context) {
// call superclass and get string value
Identifier columnIdentifier = super.toPhysicalColumnName(name, context);
String columnIdentifierText = columnIdentifier.getText();
if (StringUtils.equa... |
python | def _parse_name(name: str, as_qvm: bool, noisy: bool) -> Tuple[str, str, bool]:
"""
Try to figure out whether we're getting a (noisy) qvm, and the associated qpu name.
See :py:func:`get_qc` for examples of valid names + flags.
"""
parts = name.split('-')
if len(parts) >= 2 and parts[-2] == 'noi... |
java | public Observable<String> beginGetVpnProfilePackageUrlAsync(String resourceGroupName, String virtualNetworkGatewayName) {
return beginGetVpnProfilePackageUrlWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayName).map(new Func1<ServiceResponse<String>, String>() {
@Override
... |
java | public Vector3d transformTranspose(Vector3dc v, Vector3d dest) {
v.mulTranspose(this, dest);
return dest;
} |
java | @Override
public long skip(long n) throws IOException {
if (mInputStream.available() >= n) {
return mInputStream.skip(n);
}
// The number of bytes to skip is possibly large, open a new stream from GCS.
mInputStream.close();
mPos += n;
try {
mObject = mClient.getObject(mBucketName, ... |
java | public RecordId currentRecordId() {
int id = rp.currentId();
return new RecordId(new BlockId(fileName, currentBlkNum), id);
} |
java | String readString() throws IOException {
StringBuilder sb = new StringBuilder(50);
// first char must be ":
char ch = reader.next();
if (ch != '\"') {
throw new JsonParseException("Expected \" but actual is: " + ch,
reader.readed);
}
for (;;) {
ch = reader.next();
if (ch == '\\') {
// esca... |
java | private String buildAuthorizationHeader(String serverPrincipalName) throws LoginException
{
/*
* Get the principal from the Subject's private credentials and populate the
* client and server principal name for the GSS API
*/
final String clientPrincipal = getClientPrincipalName();
final Cre... |
python | def setup_seq_signals(self, ):
"""Setup the signals for the sequence page
:returns: None
:rtype: None
:raises: None
"""
log.debug("Setting up sequence page signals.")
self.seq_prj_view_pb.clicked.connect(self.seq_view_prj)
self.seq_shot_view_pb.clicked.co... |
python | def run_terraform(self, command='plan'): # noqa pylint: disable=too-many-branches,too-many-statements
"""Run Terraform."""
response = {'skipped_configs': False}
tf_cmd = [command]
if command == 'destroy':
tf_cmd.append('-force')
elif command == 'apply':
... |
java | protected void init(CmsObject cms, CmsMessages messages, I_CmsWidgetParameter param, String configuration) {
if (configuration == null) {
// no configuration String found, return
return;
}
configuration = CmsMacroResolver.resolveMacros(configuration, cms, messages);
... |
java | public static CPMeasurementUnit fetchByG_K_T(long groupId, String key,
int type) {
return getPersistence().fetchByG_K_T(groupId, key, type);
} |
java | public Observable<List<IdentifyResult>> identifyAsync(String personGroupId, List<UUID> faceIds, IdentifyOptionalParameter identifyOptionalParameter) {
return identifyWithServiceResponseAsync(personGroupId, faceIds, identifyOptionalParameter).map(new Func1<ServiceResponse<List<IdentifyResult>>, List<IdentifyResu... |
python | def set_data_path(self, pth):
"""Set the location of the measures data directory.
:param pth: The absolute path to the measures data directory.
"""
if os.path.exists(pth):
if not os.path.exists(os.path.join(pth, 'data', 'geodetic')):
raise IOError("The given ... |
java | public static PageSnapshot shootPage(WebDriver driver, boolean useDevicePixelRatio) {
Browser browser = new Browser(driver, useDevicePixelRatio);
PageSnapshot pageScreenshot = new PageSnapshot(driver,browser.getDevicePixelRatio());
pageScreenshot.setImage(browser.takeScreenshot());
retur... |
python | def lola_image(self, save=False, name='BaseLola.png'):
''' Draw the topography of the region of interest
Args:
save (Optional[bool]): Weither or not to save the image.
Defaults to False.
name (Optional[str]): Absolut path to save the resulting
ima... |
java | public Nfs3RemoveResponse sendRemove(NfsRemoveRequest request) throws IOException {
Nfs3RemoveResponse response = new Nfs3RemoveResponse();
_rpcWrapper.callRpcNaked(request, response);
return response;
} |
python | def select_next(self):
"""
Selects the next occurrence.
:return: True in case of success, false if no occurrence could be
selected.
"""
current_occurence = self._current_occurrence()
occurrences = self.get_occurences()
if not occurrences:
... |
python | def _dir_additions(self):
""" add the string-like attributes from the info_axis.
If info_axis is a MultiIndex, it's first level values are used.
"""
additions = {c for c in self._info_axis.unique(level=0)[:100]
if isinstance(c, str) and c.isidentifier()}
retu... |
python | def subtract(lhs, rhs):
"""Returns element-wise difference of the input arrays with broadcasting.
Equivalent to ``lhs - rhs``, ``mx.nd.broadcast_sub(lhs, rhs)`` and
``mx.nd.broadcast_minus(lhs, rhs)``.
.. note::
If the corresponding dimensions of two arrays have the same size or one of them ha... |
python | def fetch_all(self, api_client, fetchstatuslogger, q, targets):
'''
Make all API calls as defined in metadata.json
:param api_client:
:param fetchstatuslogger:
:param q:
:param targets:
:return:
'''
self.fetchstatuslogger = fetchstatuslogger
... |
java | public static vpnsessionpolicy_aaauser_binding[] get(nitro_service service, String name) throws Exception{
vpnsessionpolicy_aaauser_binding obj = new vpnsessionpolicy_aaauser_binding();
obj.set_name(name);
vpnsessionpolicy_aaauser_binding response[] = (vpnsessionpolicy_aaauser_binding[]) obj.get_resources(service... |
python | def add_bookmark(request):
"""
This view serves and validates a bookmark form.
If requested via ajax it also returns the drop bookmark form to replace the
add bookmark form.
"""
if request.method == "POST":
form = BookmarkForm(user=request.user, data=request.POST)
if form.is_vali... |
python | def rotation_matrix(d):
"""
Calculates a rotation matrix given a vector d. The direction of d
corresponds to the rotation axis. The length of d corresponds to
the sin of the angle of rotation.
Variant of: http://mail.scipy.org/pipermail/numpy-discussion/2009-March/040806.html
"""
sin_angle ... |
java | private static byte[] digest(final byte[] input, final String algorithm, final byte[] salt, final int iterations) {
try {
MessageDigest digest = MessageDigest.getInstance(algorithm);
if (salt != null) {
digest.update(salt);
}
byte[] result = digest.digest(input);
for (int i = 1; i < iterations; ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.