language stringclasses 2
values | func_code_string stringlengths 63 466k |
|---|---|
java | protected void evaluate () {
if (bufEmpty) {
bufType = p.currentSegment(coords);
}
switch (bufType) {
case SEG_MOVETO:
case SEG_LINETO:
px = coords[0];
py = coords[1];
break;
case SEG_QUADTO:
if (bufEmpty) {
... |
java | public static <S, D> D[] mapArray(final S[] sourceArray, final Class<D> destinationClass) {
D[] destinationArray = ArrayUtil.newArray(destinationClass, sourceArray.length);
int i = 0;
for (S source : sourceArray) {
if (source != null) {
destinationArray[i] = mapper.map(sourceArray[i], destinationClass);
... |
python | def home(request):
"""Home page.
Root of web server should redirect to here.
"""
if request.path.endswith('/'):
return django.http.HttpResponseRedirect(request.path[:-1])
return django.http.HttpResponse(
generate_status_xml(), d1_common.const.CONTENT_TYPE_XML
) |
python | def setLevel(self, level):
""" Changement du niveau du Log """
if isinstance(level, int):
self.logger.setLevel(level)
return
# level en tant que string
level = level.lower()
if level == "debug":
self.logger.setLevel(logging.DEBUG)
elif level == "info":
self.logger.setLevel(logging.INFO)
eli... |
python | def parse(chord):
""" Parse a string to get chord component
:param str chord: str expression of a chord
:rtype: (str, pychord.Quality, str, str)
:return: (root, quality, appended, on)
"""
if len(chord) > 1 and chord[1] in ("b", "#"):
root = chord[:2]
rest = chord[2:]
else:
... |
java | public void removeOnItemTouchListener(OnItemTouchListener listener) {
mOnItemTouchListeners.remove(listener);
if (mActiveOnItemTouchListener == listener) {
mActiveOnItemTouchListener = null;
}
} |
python | def select_specimen(self, specimen):
"""
Goes through the calculations necessary to plot measurement data for
specimen and sets specimen as current GUI specimen, also attempts to
handle changing current fit.
"""
try:
fit_index = self.pmag_results_data['specime... |
java | private static TimeZone getCustomTimeZone(String id) {
Matcher m = NoImagePreloadHolder.CUSTOM_ZONE_ID_PATTERN.matcher(id);
if (!m.matches()) {
return null;
}
int hour;
int minute = 0;
try {
hour = Integer.parseInt(m.group(1));
if (m.g... |
python | def generate_sb(date: datetime.datetime, project: str,
programme_block: str) -> dict:
"""Generate a Scheduling Block data object.
Args:
date (datetime.datetime): UTC date of the SBI
project (str): Project Name
programme_block (str): Programme
Returns:
str, S... |
python | async def providers():
"""
Iterates over all instances of analytics provider found in configuration
"""
for provider in settings.ANALYTICS_PROVIDERS:
cls: BaseAnalytics = import_class(provider['class'])
yield await cls.instance(*provider['args']) |
python | def chain_HSPs(blast, xdist=100, ydist=100):
"""
Take a list of BlastLines (or a BlastSlow instance), and returns a list of
BlastLines.
"""
key = lambda x: (x.query, x.subject)
blast.sort(key=key)
clusters = Grouper()
for qs, points in groupby(blast, key=key):
points = sorted(li... |
python | def get_url(cls, url, uid, **kwargs):
"""
Construct the URL for talking to an individual resource.
http://myapi.com/api/resource/1
Args:
url: The url for this resource
uid: The unique identifier for an individual resource
kwargs: Additional keyword a... |
java | public UpdateIdentityProviderRequest withProviderDetails(java.util.Map<String, String> providerDetails) {
setProviderDetails(providerDetails);
return this;
} |
java | @Override
public GetBackupVaultNotificationsResult getBackupVaultNotifications(GetBackupVaultNotificationsRequest request) {
request = beforeClientExecution(request);
return executeGetBackupVaultNotifications(request);
} |
python | def quantify(**kwargs):
"""
Quantify expected read counts
:param alnfile: alignment incidence file (h5)
:param grpfile: gene ID to isoform ID mapping info (tsv)
:param lenfile: transcript lengths (tsv)
:param multiread_model: emase model (default: 4)
:param read_length: read length (default... |
java | static int hash(int hashIn, int n) {
int hash = ((hashIn << 5) + hashIn) + (n & 0xFF); /* hash * 33 + c */
hash = ((hash << 5) + hash) + ((n >> 8) & 0xFF);
hash = ((hash << 5) + hash) + ((n >> 16) & 0xFF);
hash = ((hash << 5) + hash) + ((n >> 24) & 0xFF);
hash &= 0x7FFFFFFF;
return hash;
} |
java | public void marshall(UpdateHITTypeOfHITRequest updateHITTypeOfHITRequest, ProtocolMarshaller protocolMarshaller) {
if (updateHITTypeOfHITRequest == null) {
throw new SdkClientException("Invalid argument passed to marshall(...)");
}
try {
protocolMarshaller.marshall(upda... |
python | def _total_microsec(t1, t2):
"""
Calculate difference between two datetime stamps in microseconds.
:type t1: :class: `datetime.datetime`
:type t2: :class: `datetime.datetime`
:return: int
.. rubric:: Example
>>> print(_total_microsec(UTCDateTime(2013, 1, 1).datetime,
... ... |
java | public static Path getWriterFilePath(State state, int numBranches, int branchId) {
if (state.contains(
ForkOperatorUtils.getPropertyNameForBranch(ConfigurationKeys.WRITER_FILE_PATH, numBranches, branchId))) {
return new Path(state.getProp(
ForkOperatorUtils.getPropertyNameForBranch(Configura... |
java | public void quitOpera() {
// running opera under the launcher
if (runner != null) {
if (runner.isOperaRunning() || runner.hasOperaCrashed()) {
// Cut off the services connection to free the port
getScopeServices().shutdown();
// Quit Opera
runner.stopOpera();
}
}... |
java | public static WebClient setHeader(WebClient webClient) {
Properties properties = getInstance().getHeader();
Enumeration<Object> keys = properties.keys();
while (keys.hasMoreElements()) {
String key = (String) keys.nextElement();
webClient = webClient.header(key, properties.getProperty((String) key));
}
... |
java | protected void downloadTemplates(ProgressMonitor... monitors) throws IOException {
File templateDir = getTemplateDir();
if (!templateDir.exists()) {
if (!templateDir.mkdirs())
throw new IOException("Unable to create directory: " + templateDir.getAbsolutePath());
S... |
java | private String checkPattern(final String value, final Pattern pattern, final boolean withBrace) {
String res = value;
final Matcher matcher = pattern.matcher(value);
while (matcher.find()) {
final String envName = matcher.group(2);
if (!this.varenvMap.containsKey(env... |
java | public static <T extends Tree> Matcher<T> hasAnnotation(final String annotationClass) {
return new Matcher<T>() {
@Override
public boolean matches(T tree, VisitorState state) {
return ASTHelpers.hasAnnotation(ASTHelpers.getDeclaredSymbol(tree), annotationClass, state);
}
};
} |
python | def _ntowfv2(user_name, password, domain_name):
"""
[MS-NLMP] v28.0 2016-07-14
3.3.2 NTLM v2 Authentication
Same function as NTOWFv2 (and LMOWFv2) in document to create a one way hash of the password.
This combines some extra security features over the v1 calculations used in NTLMv2 auth.
:par... |
python | def two_pointers(self):
"""
Returns an ``int`` of the total number of two point field goals the
player made.
"""
if self.field_goals and self.three_pointers:
return int(self.field_goals - self.three_pointers)
# Occurs when the player didn't make any three poin... |
python | def export(self, pid, context=None, format=None, encoding=None,
stream=False):
'''Export an object to be migrated or archived.
:param pid: object pid
:param context: export context, one of: public, migrate, archive
(default: public)
:param format: export form... |
python | def get_assessment_taken_admin_session(self, proxy):
"""Gets the ``OsidSession`` associated with the assessment taken administration service.
arg: proxy (osid.proxy.Proxy): a proxy
return: (osid.assessment.AssessmentTakenAdminSession) - an
``AssessmentTakenAdminSession``
... |
java | private File createFileNameFromRequest(HttpServletRequest pRequest) {
//System.out.println("ServletPath" + pRequest.getServletPath());
String path = pRequest.getServletPath();
// Find last '/'
int splitIndex = path.lastIndexOf("/");
// Split -> path + name
Strin... |
java | public Resource.Iterator get(Resource resource) {
Integer key = Integer.valueOf(System.identityHashCode(resource));
return map.get(key);
} |
java | protected void fireClusterChange(long timestamp, String type, String message) {
// if we have no listeners, do nothing...
if (listeners != null && !listeners.isEmpty()) {
// create the event object to send
ClusterEvent event =
new ClusterEvent(this, timestamp, type , message);
// make... |
java | public Iterator<S> iterator() {
return new Iterator<S>() {
Iterator<Map.Entry<String,S>> knownProviders
= providers.entrySet().iterator();
public boolean hasNext() {
if (knownProviders.hasNext())
return true;
return lo... |
python | def parse_labels(labels_str):
"""Parse label keys and values following the Resource spec.
>>> parse_labels("k=v")
{'k': 'v'}
>>> parse_labels("k1=v1, k2=v2")
{'k1': 'v1', 'k2': 'v2'}
>>> parse_labels("k1='v1,=z1'")
{'k1': 'v1,=z1'}
"""
if not _LABELS_RE.match(labels_str):
re... |
python | def list_provincies(self, gewest=2):
'''
List all `provincies` in a `gewest`.
:param gewest: The :class:`Gewest` for which the \
`provincies` are wanted.
:param integer sort: What field to sort on.
:rtype: A :class:`list` of :class:`Provincie`.
'''
tr... |
python | def whois_emails(self, emails):
"""Calls WHOIS Email end point
Args:
emails: An enumerable of string Emails
Returns:
A dict of {email: domain_result}
"""
api_name = 'opendns-whois-emails'
fmt_url_path = u'whois/emails/{0}'
return self._mul... |
java | @Override
public GetTemplateSummaryResult getTemplateSummary(GetTemplateSummaryRequest request) {
request = beforeClientExecution(request);
return executeGetTemplateSummary(request);
} |
java | protected void startReconnectThread() {
final String interfaceId = consumerConfig.getInterfaceId();
// 启动线程池
// 默认每隔10秒重连
int reconnect = consumerConfig.getReconnectPeriod();
if (reconnect > 0) {
reconnect = Math.max(reconnect, 2000); // 最小2000
reconThread... |
python | def plot(self, fig=None, plot_trap=False, name=False, trap_color='g',
trap_kwargs=None, **kwargs):
"""
Makes a simple plot of signal
:param fig: (optional)
Argument for :func:`plotutils.setfig`.
:param plot_trap: (optional)
Whether to plot the (best... |
java | @Override
public long processSyncReadRequest(long numBytes, int timeout) throws IOException {
long bytesRead = 0L;
if (numBytes != 0L) {
if (this.blockWait == null) {
this.blockWait = new SimpleSync();
}
this.blockingIOError = null;
/... |
python | def find_file_in_load_dirs(relpath):
"""If given relative path exists in one of DevAssistant load paths,
return its full path.
Args:
relpath: a relative path, e.g. "assitants/crt/test.yaml"
Returns:
absolute path of the file, e.g. "/home/x/.devassistant/assistanta/crt/test.yaml
... |
python | def analysis(self):
"""Get musical analysis of the song using the librosa library
"""
if self._analysis is not None:
return self._analysis
if self.cache_dir is not None:
path = os.path.join(self.cache_dir, self.checksum)
try:
if self.r... |
python | def variantcall_sample(data, region=None, align_bams=None, out_file=None):
"""Parallel entry point for doing genotyping of a region of a sample.
"""
if out_file is None or not os.path.exists(out_file) or not os.path.lexists(out_file):
utils.safe_makedir(os.path.dirname(out_file))
ref_file = ... |
java | @Override
public final void makeCartLine(final Map<String, Object> pRqVs,
final CartLn pCartLn, final AccSettings pAs, final TradingSettings pTs,
final TaxDestination pTxRules, final boolean pRedoPr,
final boolean pRedoTxc) throws Exception {
AItemPrice<?, ?> itPrice = null;
if (pRedoPr || p... |
java | public void addAll(Iterable<? extends E> elements) {
if (elements == null) throw new NullPointerException();
for (E element : elements) {
add(element);
}
} |
python | def get_calendar_class(self, iso_code):
"""
Retrieves calendar class associated with given ``iso_code``.
If calendar of subdivision is not registered
(for subdivision like ISO codes, e.g. GB-ENG)
returns calendar of containing region
(e.g. United Kingdom for ISO code GB)... |
python | def on_backward_begin(self, last_loss, last_output, **kwargs):
"Record `last_loss` in the proper list."
last_loss = last_loss.detach().cpu()
if self.gen_mode:
self.smoothenerG.add_value(last_loss)
self.glosses.append(self.smoothenerG.smooth)
self.last_gen = la... |
java | private static int put(byte[] block, int offset, ByteBuffer buf) {
int len = Math.min(block.length - offset, buf.remaining());
buf.get(block, offset, len);
return len;
} |
python | def save(self):
"""
:return: save this OS instance on Ariane server (create or update)
"""
LOGGER.debug("OSInstance.save")
post_payload = {}
consolidated_osi_id = []
consolidated_ipa_id = []
consolidated_nic_id = []
consolidated_app_id = []
... |
python | def wage(return_X_y=True):
"""wage dataset
Parameters
----------
return_X_y : bool,
if True, returns a model-ready tuple of data (X, y)
otherwise, returns a Pandas DataFrame
Returns
-------
model-ready tuple of data (X, y)
OR
Pandas DataFrame
Notes
----... |
java | @Override
public AssociateVPCWithHostedZoneResult associateVPCWithHostedZone(AssociateVPCWithHostedZoneRequest request) {
request = beforeClientExecution(request);
return executeAssociateVPCWithHostedZone(request);
} |
python | def get_damage(self, amount: int, target) -> int:
"""
Override to modify the damage dealt to a target from the given amount.
"""
if target.immune:
self.log("%r is immune to %s for %i damage", target, self, amount)
return 0
return amount |
java | public void setAEGName(String newAEGName) {
String oldAEGName = aegName;
aegName = newAEGName;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, AfplibPackage.BAG__AEG_NAME, oldAEGName, aegName));
} |
java | public synchronized byte[] firstToken() {
if (saslClient != null && saslClient.hasInitialResponse()) {
try {
return saslClient.evaluateChallenge(new byte[0]);
} catch (SaslException e) {
throw Throwables.propagate(e);
}
} else {
return new byte[0];
}
} |
python | def to_pixel(self, wcs, mode='all'):
"""
Convert the aperture to a `CircularAnnulus` object defined in
pixel coordinates.
Parameters
----------
wcs : `~astropy.wcs.WCS`
The world coordinate system (WCS) transformation to use.
mode : {'all', 'wcs'}, o... |
java | public static void runExample(AdManagerServices adManagerServices, AdManagerSession session)
throws RemoteException {
AudienceSegmentServiceInterface audienceSegmentService =
adManagerServices.get(session, AudienceSegmentServiceInterface.class);
// Create a statement to select audience segments.
... |
python | def __initialize_snapshot(self):
"""
Private method to automatically initialize the snapshot
when you try to use it without calling any of the scan_*
methods first. You don't need to call this yourself.
"""
if not self.__processDict:
try:
self.... |
python | def update_config(self, config_dict, config_file):
"""Update the content and reference of the config
:param dict config_dict: The new configuration
:param str config_file: The new file reference
"""
config_path = path.dirname(config_file)
self.config.config_file_path = c... |
python | def get_function_from_config(item):
"""
Import the function to get profile by handle.
"""
config = get_configuration()
func_path = config.get(item)
module_path, func_name = func_path.rsplit(".", 1)
module = importlib.import_module(module_path)
func = getattr(module, func_name)
return... |
java | public CreateWebhookParams description(String description) {
String value = (description==null) ? "" : description;
parameters.add(new NameValuePair("description", value));
return this;
} |
java | public static byte[] get(Object from, Field field)
{
PropertyAccessor<?> accessor = PropertyAccessorFactory.getPropertyAccessor(field);
return accessor.toBytes(getObject(from, field));
} |
python | def migration_exchange(self, *, users: List[str], **kwargs) -> SlackResponse:
"""For Enterprise Grid workspaces, map local user IDs to global user IDs
Args:
users (list): A list of user ids, up to 400 per request.
e.g. ['W1234567890', 'U2345678901', 'U3456789012']
""... |
python | def get_plan_table(self, plan_list):
"""
This method return a list in following order:
[
( Quota1, [ Plan1Quota1, Plan2Quota1, ... , PlanNQuota1] ),
( Quota2, [ Plan1Quota2, Plan2Quota2, ... , PlanNQuota2] ),
...
( QuotaM, [ Plan1QuotaM, Plan2Quota... |
python | def build_relation(self, name, klass=None):
"""
Constructs a related ``Resource`` or ``Collection``.
This allows for construction of classes with information prepopulated
from what the current instance has. This enables syntax like::
bucket = Bucket(bucket='some-bucket-name... |
python | def group_by_ngram(self, labels):
"""Groups result rows by n-gram and label, providing a single summary
field giving the range of occurrences across each work's
witnesses. Results are sorted by n-gram then by label (in the
order given in `labels`).
:param labels: labels to order... |
python | def printSegment(self):
"""Print segment information for verbose messaging and debugging.
This uses the following format:
ID:54413 True 0.64801 (24/36) 101 [9,1]0.75 [10,1]0.75 [11,1]0.75
where:
54413 - is the unique segment id
True - is sequence segment
0.64801 - moving average dut... |
java | public static <T> Predicate<T> always() {
return new Predicate<T>() {
@Override
public boolean test( T input ) {
return true;
}
};
} |
java | public boolean writeTextField(BaseField textField, String strBaseClass, String strMethodName, String strMethodInterface, String strClassName)
{
if (textField.getString().length() == 0)
return false;
String beforeMethodCode; //, currentString;
beforeMethodCode = textField.getSt... |
python | def create(input_width, input_height, input_channels=1):
""" Vel factory function """
def instantiate(**_):
return DoubleNatureCnn(input_width=input_width, input_height=input_height, input_channels=input_channels)
return ModelFactory.generic(instantiate) |
python | def unpack_infer(stmt, context=None):
"""recursively generate nodes inferred by the given statement.
If the inferred value is a list or a tuple, recurse on the elements
"""
if isinstance(stmt, (List, Tuple)):
for elt in stmt.elts:
if elt is util.Uninferable:
yield elt... |
python | def get_file_size(self, filenames):
"""
Get size of all files in string (space-separated) in megabytes (Mb).
:param str filenames: a space-separated string of filenames
"""
# use (1024 ** 3) for gigabytes
# equivalent to: stat -Lc '%s' filename
# If given a list... |
python | def parse_api_datetime(value):
""" parse a datetime returned from the salesforce API.
in python 3 we should just use a strptime %z, but until then we're just going
to assert that its a fixed offset of +0000 since thats the observed behavior. getting
python 2 to support fixed offset parsing is too compl... |
python | def like(self, x, y):
"""Evaluate the 2-D likelihood in the x/y parameter space.
The dimension of the two input arrays should be the same.
Parameters
----------
x : array_like
Array of coordinates in the `x` parameter.
y : array_like
Arra... |
java | void setRecentInvalTable() {
int tableSize = _smc.getInMemorySize();
if (tableSize > 1)
recentInvalidIds = new LRUHashMap(tableSize / 2);
else
_smc.setCheckRecentlyInvalidList(false);
} |
java | public RequestTable<T> grow(int new_capacity) {
lock.lock();
try {
_grow(new_capacity);
return this;
}
finally {
lock.unlock();
}
} |
python | def activate_component(self, name):
"""
Activates given Component.
:param name: Component name.
:type name: unicode
:return: Method success.
:rtype: bool
"""
if not name in self.__engine.components_manager.components:
raise manager.exceptions... |
python | async def check_record(self, record, timeout=60):
"""Measures the time for a DNS record to become available.
Query a provided DNS server multiple times until the reply matches the
information in the record or until timeout is reached.
Args:
record (dict): DNS record as a di... |
java | private static byte[] decodePem(File pemFile) throws IOException {
BufferedReader reader = new BufferedReader(new FileReader(pemFile));
try {
String line;
while ((line = reader.readLine()) != null) {
if (line.contains("-----BEGIN ")) {
return r... |
python | def get_violation_if_found(self, node, lint_context):
""" Returns a violation if the node is invalid. """
if self.is_valid(node, lint_context):
return None
return self.create_violation_report(node, lint_context) |
java | public static String nullify(String value, byte delimiter) {
// check to see if we need to null out passwords
if (null == value) {
return null;
}
String source = value.toLowerCase();
StringBuilder b = new StringBuilder(value);
boolean modified = optionallyMas... |
java | public static void stopJob(String jobHandle) throws NoSuchObjectException {
checkNonEmpty(jobHandle, "jobHandle");
Key key = KeyFactory.createKey(JobRecord.DATA_STORE_KIND, jobHandle);
JobRecord jobRecord = backEnd.queryJob(key, JobRecord.InflationType.NONE);
jobRecord.setState(State.STOPPED);
Updat... |
java | public EventTypeFilter withEventTypeCategories(EventTypeCategory... eventTypeCategories) {
java.util.ArrayList<String> eventTypeCategoriesCopy = new java.util.ArrayList<String>(eventTypeCategories.length);
for (EventTypeCategory value : eventTypeCategories) {
eventTypeCategoriesCopy.add(valu... |
java | public Float getFloat(String name) {
Object o = get(name);
if (o instanceof Number) {
return ((Number)o).floatValue();
}
if (o != null) {
try {
String string = o.toString();
if (string != null) {
return Float.pa... |
python | def check_dataset_metadata(client):
"""Check location of dataset metadata."""
# Find pre 0.3.4 metadata files.
old_metadata = list(_dataset_metadata_pre_0_3_4(client))
if not old_metadata:
return True
click.secho(
WARNING + 'There are metadata files in the old location.'
'\... |
java | public static ChaincodeCollectionConfiguration fromJsonObject(JsonArray jsonConfig) throws InvalidArgumentException, ChaincodeCollectionConfigurationException {
// Sanity check
if (jsonConfig == null) {
throw new InvalidArgumentException("jsonConfig must be specified");
}
i... |
python | def spectrum_to_xyz100(spectrum, observer):
"""Computes the tristimulus values XYZ from a given spectrum for a given
observer via
X_i = int_lambda spectrum_i(lambda) * observer_i(lambda) dlambda.
In section 7, the technical report CIE Standard Illuminants for
Colorimetry, 1999, gives a recommendat... |
java | public static KeySnapshot globalSnapshot(long timeTolerance){
KeySnapshot res = _cache;
final long t = System.currentTimeMillis();
if(res == null || (t - res.timestamp) > timeTolerance)
res = new KeySnapshot((new GlobalUKeySetTask().doAllNodes()._res));
else if(t - res.timestamp > _updateInterval)... |
java | public static List<MenuItem> getVisibleMenuItemList(@NonNull Toolbar toolbar) {
List<MenuItem> list = new ArrayList<>();
for (int i = 0; i < toolbar.getChildCount(); i++) {
final View v = toolbar.getChildAt(i);
if (v instanceof ActionMenuView) {
int childCount = (... |
java | static boolean isImmutableValue(Node n) {
// TODO(johnlenz): rename this function. It is currently being used
// in two disjoint cases:
// 1) We only care about the result of the expression
// (in which case NOT here should return true)
// 2) We care that expression is a side-effect free and can... |
python | def toggle_wrap_mode(self, checked):
"""Toggle wrap mode"""
self.plain_text.editor.toggle_wrap_mode(checked)
self.set_option('wrap', checked) |
java | public String encode() throws IOException {
FastStringWriter fsw = new FastStringWriter();
boolean hasComma = false;
String preString;
try {
if (this.point != null) {
fsw.write("\"point\":{");
fsw.write(this.point.encode());
fs... |
java | public static final Object removeList(Object bean, String property)
{
return doFor(
bean,
property,
null,
(Object a, int i)->{throw new UnsupportedOperationException("not supported");},
(List l, int i)->{return l.remove(i);},
... |
java | public void marshall(DocumentDescription documentDescription, ProtocolMarshaller protocolMarshaller) {
if (documentDescription == null) {
throw new SdkClientException("Invalid argument passed to marshall(...)");
}
try {
protocolMarshaller.marshall(documentDescription.ge... |
java | public static MathContext getMathContext(MonetaryContext monetaryContext, RoundingMode defaultMode) {
MathContext ctx = monetaryContext.get(MathContext.class);
if (Objects.nonNull(ctx)) {
return ctx;
}
RoundingMode roundingMode = monetaryContext.get(RoundingMode.class);
if (roundingMode == null) {
round... |
python | def IpaS(d, a, tt_instance=True):
'''A special bidiagonal _matrix in the QTT-format
M = IPAS(D, A)
Generates I+a*S_{-1} _matrix in the QTT-format:
1 0 0 0
a 1 0 0
0 a 1 0
0 0 a 1
Convenient for Crank-Nicolson and time gradient matrices
'''
if d == 1:
M = _np.array([[1, 0... |
java | public Dialog getNewUnstructuredDialog(SccpAddress localAddress, SccpAddress remoteAddress) throws TCAPException {
DialogImpl res = _getDialog(localAddress, remoteAddress, false, getNextSeqControl(), null);
this.setSsnToDialog(res, localAddress.getSubsystemNumber());
return res;
} |
java | public ServiceFuture<NetworkInterfaceIPConfigurationInner> getVirtualMachineScaleSetIpConfigurationAsync(String resourceGroupName, String virtualMachineScaleSetName, String virtualmachineIndex, String networkInterfaceName, String ipConfigurationName, final ServiceCallback<NetworkInterfaceIPConfigurationInner> serviceCa... |
python | def msconcat(names, newname, concatTime=False):
"""Virtually concatenate multiple MeasurementSets.
Multiple MeasurementSets are concatenated into a single MeasurementSet.
The concatenation is done in an entirely or almost entirely virtual way,
so hardly any data are copied. It makes the command very fa... |
python | def get(self, name, param=None):
"""Retreive a metadata attribute.
:param string name: name of the attribute to retrieve. See `attribs`
:param param: Required parameter for some attributes
"""
if name not in self.attribs:
raise exceptions.SoftLayerError('Unknown met... |
java | public HttpSession getIHttpSession(HttpServletRequest _request, HttpServletResponse _response, boolean create)
{
return getIHttpSession(_request, _response, create, false);
} |
python | def get_parent_and_child(self, table_name):
"""
Get the name of the parent table and the child table
for a given MagIC table name.
Parameters
----------
table_name : string of MagIC table name ['specimens', 'samples', 'sites', 'locations']
Returns
------... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.