language stringclasses 2
values | func_code_string stringlengths 63 466k |
|---|---|
python | def get_dimension_array(array):
"""
Get dimension of an array getting the number of rows and the max num of
columns.
"""
if all(isinstance(el, list) for el in array):
result = [len(array), len(max([x for x in array], key=len,))]
# elif array and isinstance(array, list):
else:
... |
java | private <T extends HalRepresentation> T getResource(final Link link,
final Class<T> type,
final List<EmbeddedTypeInfo> embeddedType) throws IOException {
LOG.trace("Fetching resource href={} rel={} as... |
python | def entries(self):
"""
Return the entries (as a {date: entries} dict) of all timesheets in the
collection.
"""
entries_list = self._timesheets_callback('entries')()
return reduce(lambda x, y: x + y, entries_list) |
python | def filter_oplog_entry(self, entry, include_fields=None, exclude_fields=None):
"""Remove fields from an oplog entry that should not be replicated.
NOTE: this does not support array indexing, for example 'a.b.2'"""
if not include_fields and not exclude_fields:
return entry
el... |
python | def activationFunctionASIG(self, x):
"""
Determine the activation of a node based on that nodes net input.
"""
def act(v):
if v < -15.0: return 0.0
elif v > 15.0: return 1.0
else: return 1.0 / (1.0 + Numeric.exp(-v))
return Numeric.array(lis... |
java | public OutputStream createOutputStream(Number streamId) {
int channelId = getChannelIdForStreamId(streamId);
if (log.isTraceEnabled()) {
log.trace("Create output - stream id: {} channel id: {}", streamId, channelId);
}
final Channel data = getChannel(channelId++);
... |
python | def plist(iterable=(), reverse=False):
"""
Creates a new persistent list containing all elements of iterable.
Optional parameter reverse specifies if the elements should be inserted in
reverse order or not.
>>> plist([1, 2, 3])
plist([1, 2, 3])
>>> plist([1, 2, 3], reverse=True)
plist([... |
java | public RequestSender request(HttpMethod method) {
Objects.requireNonNull(method, "method");
TcpClient tcpConfiguration = tcpConfiguration().bootstrap(b -> HttpClientConfiguration.method(b, method));
return new HttpClientFinalizer(tcpConfiguration);
} |
python | async def fetch_lightpad(self, lpid):
"""Lookup details for a given lightpad"""
url = "https://production.plum.technology/v2/getLightpad"
data = {"lpid": lpid}
return await self.__post(url, data) |
java | protected Object execPreparedStatement(Method method, Object[] args)
throws Throwable {
final SQL methodSQL = (SQL) _context.getMethodPropertySet(method, SQL.class);
if (methodSQL == null || methodSQL.statement() == null) {
throw new ControlException("Method " + method.getName()... |
java | public void setQueues(java.util.Collection<Queue> queues) {
if (queues == null) {
this.queues = null;
return;
}
this.queues = new java.util.ArrayList<Queue>(queues);
} |
python | def parsing(**kwargs):
"""
Context manager for overriding the default validator parsing rules for the
following code block.
"""
from .validators import Object
with _VALIDATOR_FACTORIES_LOCK:
old_values = {}
for key, value in iteritems(kwargs):
if value is not None:
... |
python | def del_metadata_keys(self, bucket, label, keys):
'''Delete the metadata corresponding to the specified keys.
'''
if self.mode !="r":
try:
payload = self._get_bucket_md(bucket)
except OFSFileNotFound:
# No MD found...
raise ... |
java | public JBBPTextWriter HR() throws IOException {
if (this.flagCommentsAllowed) {
this.ensureNewLineMode();
this.writeIndent();
this.write(this.prefixHR);
for (int i = 0; i < this.hrLength; i++) {
this.write(this.hrChar);
}
}
this.BR();
return this;
} |
python | def sync(infile, outfile):
"""
Sync (download) latest policies from the Anchore.io service.
"""
ecode = 0
try:
rc, ret = anchore_policy.sync_policymeta(bundlefile=infile, outfile=outfile)
if not rc:
anchore_print_err(ret['text'])
ecode = 1
elif outfi... |
java | public void addMethod(String methodName, Class<?> returnType, Class<?> [] params, boolean isStatic, String ... lines) throws CannotCompileException, NotFoundException {
CtMethod m = new CtMethod(resolve(returnType), methodName, getList(params), clazz);
int modifiers = Modifier.PUBLIC;
if (isStatic) {
modifiers... |
java | public ArrayList<HashMap<String, Object>> runGenerators(HashMap<String, Object> data) {
return runGenerators(data, false);
} |
java | public static void checkQuery(Query<?> query, InjectionManager manager) {
checkQuery(query, null, null, manager);
} |
python | def _build_filter(*patterns):
"""
Given a list of patterns, return a callable that will be true only if
the input matches at least one of the patterns.
"""
return lambda name: any(fnmatchcase(name, pat=pat) for pat in patterns) |
python | def parse_statement(self):
"""Parse a single statement."""
token = self.stream.current
if token.type != 'name':
self.fail('tag name expected', token.lineno)
self._tag_stack.append(token.value)
pop_tag = True
try:
if token.value in _statement_keywor... |
java | public void d_lsp(
int index[], int is, /* input : indexes */
float lsp_q[], /* output: decoded lsp */
int bfi /* input : frame erase information */
)
{
int i;
lsp_iqua_cs(index, is, lsp_q,bfi); /* decode quantized information */
/* Conv... |
java | public final void increaseReadMessages(long currentTime) {
readMessages++;
lastReadTime = currentTime;
idleCountForBoth.set(0);
idleCountForRead.set(0);
if (getService() instanceof AbstractIoService) {
getService().getStatistics().increaseReadMessages(currentTime);
... |
python | def save(self):
"""Convert to JSON.
Returns
-------
`dict`
JSON data.
"""
data = super().save()
data['block_size'] = list(self.block_size)
data['block_sentences'] = self.block_sentences
data['traverse_image'] = self.traverse_image.save... |
python | def create_from_dict(data: dict, format_name: str, check_version: bool = True) -> Union[HistogramBase, HistogramCollection]:
"""Once dict from source data is created, turn this into histogram.
Parameters
----------
data : dict
Parsed JSON-like tree.
Returns
-------
histogram : ... |
java | public DockerFileBuilder run(List<String> runCmds) {
if (runCmds != null) {
for (String cmd : runCmds) {
if (!StringUtils.isEmpty(cmd)) {
this.runCmds.add(cmd);
}
}
}
return this;
} |
java | public void didLeavePlace ()
{
// unsubscribe from our old place object
if (_subber != null) {
_subber.unsubscribe(_ctx.getDObjectManager());
_subber = null;
}
// let the old controller know that things are going away
if (_plobj != null && _controller... |
python | def delete_trigger(self, trigger):
"""
Deletes from the Alert API the trigger record identified by the ID of the provided
`pyowm.alertapi30.trigger.Trigger`, along with all related alerts
:param trigger: the `pyowm.alertapi30.trigger.Trigger` object to be deleted
:type trigger: ... |
python | def construct(self, method, name, lowcut, highcut, samp_rate, filt_order,
prepick, **kwargs):
"""
Construct a template using a given method.
:param method:
Method to make the template,
see :mod:`eqcorrscan.core.template_gen` for possible methods.
... |
java | @Override
public CommerceTaxFixedRate removeByC_C(long CPTaxCategoryId,
long commerceTaxMethodId) throws NoSuchTaxFixedRateException {
CommerceTaxFixedRate commerceTaxFixedRate = findByC_C(CPTaxCategoryId,
commerceTaxMethodId);
return remove(commerceTaxFixedRate);
} |
python | def import_profile(self):
""" Import minimum needs from an existing json file.
The minimum needs are loaded from a file into the table. This state
is only saved if the form is accepted.
"""
# noinspection PyCallByClass,PyTypeChecker
file_name_dialog = QFileDialog(self)
... |
java | public void templateModem_name_PUT(String name, OvhTemplateModem body) throws IOException {
String qPath = "/xdsl/templateModem/{name}";
StringBuilder sb = path(qPath, name);
exec(qPath, "PUT", sb.toString(), body);
} |
java | private double getColor( Expression exp, CssFormatter formatter ) {
type = exp.getDataType( formatter );
switch( type ) {
case COLOR:
case RGBA:
return exp.doubleValue( formatter );
}
throw new ParameterOutOfBoundsException();
} |
python | def insert(self, index = 0, *widgets):
"""insert widget in the sprites list at the given index.
by default will prepend."""
for widget in widgets:
self._add(widget, index)
index +=1 # as we are moving forwards
self._sort() |
java | public ProcessingStatus onOK() {
// Sanity check to make sure that every mutation received a response.
if (!messageIsInvalid) {
for (int i = 0; i < results.length; i++) {
if (results[i] == null) {
messageIsInvalid = true;
break;
}
}
}
// There was a probl... |
java | public ConnectionMonitorQueryResultInner query(String resourceGroupName, String networkWatcherName, String connectionMonitorName) {
return queryWithServiceResponseAsync(resourceGroupName, networkWatcherName, connectionMonitorName).toBlocking().last().body();
} |
java | public static MessagingBuilder standard(boolean autoconfigure, String... basePackages) {
MessagingBuilder builder = new MessagingBuilder();
findAndRegister(builder, "standard", basePackages);
if (autoconfigure) {
builder.configure();
}
return builder;
} |
python | def is_subscribed(self, login, repo):
"""Check if the authenticated user is subscribed to login/repo.
:param str login: (required), owner of repository
:param str repo: (required), name of repository
:returns: bool
"""
json = False
if login and repo:
... |
python | def cartisian_from_fractional(coordinate, lattice_array):
"""Return cartesian coordinate from a fractional one."""
orthogonalisation_M = np.matrix(lattice_array)
orthogonal = orthogonalisation_M * coordinate.reshape(-1, 1)
return np.array(orthogonal.reshape(1, -1)) |
java | public void trackFailure() {
retryTime = Utils.currentTimeMillis() + (long)backoff;
backoff = Math.min(backoff * params.multiplier, params.maximum);
} |
java | private static MtasTreeItem getMtasTreeItem(Long ref,
AtomicBoolean isSinglePoint, AtomicBoolean isStoreAdditionalIdAndRef,
AtomicLong nodeRefApproxOffset, IndexInput in, long objectRefApproxOffset)
throws IOException {
try {
Boolean isRoot = false;
if (nodeRefApproxOffset.get() < 0) {... |
java | public void setHeaderDivider(Drawable drawable) {
mHeaderDivider = drawable;
if (drawable != null) {
mHeaderDividerHeight = drawable.getIntrinsicHeight();
} else {
mHeaderDividerHeight = 0;
}
mContentView.setWillNotDraw(drawable == null);
mContentV... |
python | def paren_change(inputstring, opens=opens, closes=closes):
"""Determine the parenthetical change of level (num closes - num opens)."""
count = 0
for c in inputstring:
if c in opens: # open parens/brackets/braces
count -= 1
elif c in closes: # close parens/brackets/braces
... |
java | public void marshall(CustomCodeSigning customCodeSigning, ProtocolMarshaller protocolMarshaller) {
if (customCodeSigning == null) {
throw new SdkClientException("Invalid argument passed to marshall(...)");
}
try {
protocolMarshaller.marshall(customCodeSigning.getSignatu... |
java | public final boolean login()
throws LoginException
{
boolean ret = false;
final Callback[] callbacks = new Callback[4];
callbacks[0] = new ActionCallback();
callbacks[1] = new NameCallback("Username: ");
callbacks[2] = new PasswordCallback("Password", false);
... |
java | public static <T, U extends Comparable<? super U>> Collector<T, ?, Optional<U>> median(Function<? super T, ? extends U> function) {
return percentile(0.5, function);
} |
python | def get_weekday_parameters(self, filename='shlp_weekday_factors.csv'):
""" Retrieve the weekday parameter from csv-file
Parameters
----------
filename : string
name of file where sigmoid factors are stored
"""
file = os.path.join(self.datapath, filename)
... |
python | def logarithmic_n(min_n, max_n, factor):
"""
Creates a list of values by successively multiplying a minimum value min_n by
a factor > 1 until a maximum value max_n is reached.
Non-integer results are rounded down.
Args:
min_n (float):
minimum value (must be < max_n)
max_n (float):
maximu... |
python | def validate(self, model_name, object):
"""Validate an object against its swagger model"""
if model_name not in self.swagger_dict['definitions']:
raise ValidationError("Swagger spec has no definition for model %s" % model_name)
model_def = self.swagger_dict['definitions'][model_name]... |
java | Map<String, Object> getUnderlyingMap()
{
StateHelper stateHelper = _component.getStateHelper(false);
Map<String, Object> attributes = null;
if (stateHelper != null)
{
attributes = (Map<String, Object>) stateHelper.get(UIComponentBase.PropertyKeys.attributesMap);
}... |
python | def visit_file(self, item, parent):
"""
Increments counter if item needs to be sent.
:param item: LocalFile
:param parent: LocalFolder/LocalProject
"""
if item.need_to_send:
self.files += 1
self.chunks += item.count_chunks(self.bytes_per_chunk) |
python | def iso8601_datetime(s):
"""
Parses an ISO 8601 datetime string and returns a UTC datetime object,
or the string if parsing failed.
:param s: ISO 8601-formatted datetime string (2015-01-25T12:34:56Z)
:return: datetime or str
"""
try:
return datetime.datetime.strptime(s, ISO8601_DATET... |
python | def secpolicy_sa_secpolicy_defined_policy_policies_policy(self, **kwargs):
"""Auto Generated Code
"""
config = ET.Element("config")
secpolicy_sa = ET.SubElement(config, "secpolicy-sa", xmlns="urn:brocade.com:mgmt:brocade-fc-auth")
secpolicy = ET.SubElement(secpolicy_sa, "secpolic... |
java | protected void updateButtons() {
List<Button> buttons = ((A_CmsModuleImportForm)m_tabs.getSelectedTab()).getButtons();
m_buttons.removeAllComponents();
for (Button button : buttons) {
m_buttons.addComponent(button);
}
} |
java | public static<T extends ImageGray<T>, D extends ImageGray<D>>
void detectLines( BufferedImage image ,
Class<T> imageType ,
Class<D> derivType )
{
// convert the line into a single band image
T input = ConvertBufferedImage.convertFromSingle(image, null, imageType );
// Comment/uncomment to ... |
java | public static File createDir(String path, boolean isHidden) throws IOException {
File file = new File(path);
deleteIfExists(file);
File newFile = new File(path);
newFile.mkdir();
if (OsUtil.isWindows()) {
Files.setAttribute(newFile.toPath(), "dos:hidden", isHidden);
}
return file;
} |
python | def _py_expand_long(subsequence, sequence, max_l_dist):
"""Partial match expansion, optimized for long sub-sequences."""
# The additional optimization in this version is to limit the part of
# the sub-sequence inspected for each sequence character. The start and
# end of the iteration are limited to th... |
java | @Override
protected RdKNNEntry createNewDirectoryEntry(RdKNNNode node) {
return new RdKNNDirectoryEntry(node.getPageID(), node.computeMBR(), node.kNNDistance());
} |
java | protected Class<?> getSubClass(Class<?> ancestor, Class<?> descendant) {
if (ancestor == descendant) {
return null;
}
if (!ancestor.isAssignableFrom(descendant)) {
return null;
}
Class<?> child = descendant;
if (ancestor.isInterface()) {
while (true) {
for (Class<?> ch... |
java | public static MozuUrl getAttributeVocabularyValueLocalizedContentsUrl(String attributeFQN, String value)
{
UrlFormatter formatter = new UrlFormatter("/api/commerce/catalog/admin/attributedefinition/attributes/{attributeFQN}/VocabularyValues/{value}/LocalizedContent");
formatter.formatUrl("attributeFQN", attribu... |
python | def ellipsize(s, max_length=60):
"""
>>> print(ellipsize(u'lorem ipsum dolor sit amet', 40))
lorem ipsum dolor sit amet
>>> print(ellipsize(u'lorem ipsum dolor sit amet', 20))
lorem ipsum dolor...
"""
if len(s) > max_length:
ellipsis = '...'
return s[:(max_length - len(ellips... |
python | def read_filtering_config (self):
"""
Read configuration options in section "filtering".
"""
section = "filtering"
if self.has_option(section, "ignorewarnings"):
self.config['ignorewarnings'] = [f.strip().lower() for f in \
self.get(section, 'ignorewa... |
python | def summary(self, variables=None, alpha=0.05, start=0, batches=100,
chain=None, roundto=3):
"""
Generate a pretty-printed summary of the model's variables.
:Parameters:
alpha : float
The alpha level for generating posterior intervals. Defaults to
0.05... |
java | public void restoreTransientState(FacesContext context, Object state)
{
boolean forceCreate = (state != null);
TransientStateHelper helper = getTransientStateHelper(forceCreate);
if (helper != null) {
helper.restoreTransientState(context, state);
}
} |
java | public static Map<String, String> parseSimpleArrayAsMap(String configPrefix) {
Configuration configuration = ConfigurationFactory.getConfiguration();
return parseSimpleArrayAsMap(configuration, configPrefix);
} |
python | def transition_to_add(self):
"""Transition to add"""
assert self.state in [AQStateMachineStates.init, AQStateMachineStates.add]
self.state = AQStateMachineStates.add |
python | def export_roles(path_prefix='/', region=None, key=None, keyid=None, profile=None):
'''
Get all IAM role details. Produces results that can be used to create an
sls file.
CLI Example:
salt-call boto_iam.export_roles --out=txt | sed "s/local: //" > iam_roles.sls
'''
conn = _get_conn(reg... |
python | def schema_list(dbname, user=None,
db_user=None, db_password=None,
db_host=None, db_port=None):
'''
Return a dict with information about schemas in a Postgres database.
CLI Example:
.. code-block:: bash
salt '*' postgres.schema_list dbname
dbname
D... |
python | def place_objects(self):
"""Places objects randomly until no collisions or max iterations hit."""
pos_arr, quat_arr = self.initializer.sample()
for i in range(len(self.objects)):
self.objects[i].set("pos", array_to_string(pos_arr[i]))
self.objects[i].set("quat", array_to_... |
java | protected int computeHistogramBin( float value[] ) {
int indexHistogram = 0;
int binStride = 1;
for( int bandIndex = 0; bandIndex < value.length; bandIndex++ ) {
int bin = (int)(numBins*value[bandIndex]/maxPixelValue);
indexHistogram += bin*binStride;
binStride *= numBins;
}
return indexHistogram;
... |
python | def split_multi_sections(self):
"""
Parse through the WorkflowConfigParser instance and splits any sections
labelled with an "&" sign (for e.g. [inspiral&tmpltbank]) into
[inspiral] and [tmpltbank] sections. If these individual sections
already exist they will be appended to. If... |
python | def write_metrics(baseName, values):
"""Write the metrics data
:param baseName: The base name of the output files.
e.g. extensions will be appended to this base name
:param values dictionary of values to write
"""
m = open(baseName + '_metrics.txt', 'w')
for key in values:... |
java | public final boolean setActivity(String activity) throws LockingException {
Validate.notNull(activity);
Validate.notEmpty(activity);
if (isFieldLocked(EntryField.ACTIVITY)) {
if (!this.activity.equals(activity)) {
th... |
python | def dump_table_as_insert_sql(engine: Engine,
table_name: str,
fileobj: TextIO,
wheredict: Dict[str, Any] = None,
include_ddl: bool = False,
multirow: bool = False) -> None:
... |
java | public java.util.Map<String, String> getExtractedValues() {
if (extractedValues == null) {
extractedValues = new com.amazonaws.internal.SdkInternalMap<String, String>();
}
return extractedValues;
} |
java | public List<Diagnostic> diagnoseApplication( String applicationName ) {
this.logger.finer( "Diagnosing application " + applicationName );
WebResource path = this.resource.path( UrlConstants.DEBUG ).path( "diagnose-application" );
path = path.queryParam( "application-name", applicationName );
List<Diagnostic> ... |
java | private void addPkcs12ButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_addPkcs12ButtonActionPerformed
if (fileTextField.getText().equals("")) {
return;
}
String kspass = new String(pkcs12PasswordField.getPassword());
if (kspass.equals("")){
//pcks#12 file with empty password ... |
python | def remove_constraint(self, name):
"""Remove a constraint from the problem"""
index = self._get_constraint_index(name)
# Remove from matrix
self._A = np.delete(self.A, index, 0)
# Remove from upper_bounds
self.upper_bounds = np.delete(self.upper_bounds, index)
# R... |
java | private void setIsInventionsAndPatentsAndIsPreviouslyReported(
PHS398CoverPageSupplement20 coverPageSupplement) {
String answer = getAnswer(PROPOSAL_YNQ_QUESTION_118,answerHeaders);
if (answer != null && !answer.equals(NOT_ANSWERED)) {
if (YnqConstant.YES.code().equals(answer)) {... |
python | def mac2eui64(mac, prefix=None):
'''
Convert a MAC address to a EUI64 identifier
or, with prefix provided, a full IPv6 address
'''
# http://tools.ietf.org/html/rfc4291#section-2.5.1
eui64 = re.sub(r'[.:-]', '', mac).lower()
eui64 = eui64[0:6] + 'fffe' + eui64[6:]
eui64 = hex(int(eui64[0:... |
python | def seq():
"""
Counts up sequentially from a number based on the current time
:rtype int:
"""
current_frame = inspect.currentframe().f_back
trace_string = ""
while current_frame.f_back:
trace_string = trace_string + current_frame.f_back.f_code.co_name
current_frame = cu... |
python | def quantile_for_single_value(self, **kwargs):
"""Returns quantile of each column or row.
Returns:
A new QueryCompiler object containing the quantile of each column or row.
"""
if self._is_transposed:
kwargs["axis"] = kwargs.get("axis", 0) ^ 1
return ... |
python | def get_sum(path, form='sha256'):
'''
Return the checksum for the given file. The following checksum algorithms
are supported:
* md5
* sha1
* sha224
* sha256 **(default)**
* sha384
* sha512
path
path to the file or directory
form
desired sum format
CLI... |
java | @Override
public CPDAvailabilityEstimate fetchByUUID_G(String uuid, long groupId) {
return fetchByUUID_G(uuid, groupId, true);
} |
java | public CmsAttributeHandler getHandlerById(String entityId, String attributeName) {
return m_handlerById.get(entityId + "/" + attributeName);
} |
java | public Observable<ServiceResponse<Page<SyncAgentLinkedDatabaseInner>>> listLinkedDatabasesWithServiceResponseAsync(final String resourceGroupName, final String serverName, final String syncAgentName) {
return listLinkedDatabasesSinglePageAsync(resourceGroupName, serverName, syncAgentName)
.concatMap... |
python | def _CheckData(yaml_data):
"""Checks data for illegal keys and formatting."""
legal_keys = set(('blacklist', 'whitelist'))
unknown_keys = set(yaml_data) - legal_keys
if unknown_keys:
raise UnknownConfigKeyError(
'Unknown keys in configuration: %s' % unknown_keys)
for key, data in six.iteritems(ya... |
java | public GuiceyBootstrap modules(final Module... modules) {
Preconditions.checkState(modules.length > 0, "Specify at least one module");
context.registerModules(modules);
return this;
} |
java | @Override
public boolean eIsSet(int featureID)
{
switch (featureID)
{
case TypesPackage.JVM_ANNOTATION_VALUE__OPERATION:
return operation != null;
}
return super.eIsSet(featureID);
} |
java | public void setImplementors(Map<Class<?>, CloneImplementor> implementors) {
// this.implementors = implementors;
this.allImplementors = new HashMap<Class<?>, CloneImplementor>();
allImplementors.putAll(builtInImplementors);
allImplementors.putAll(implementors);
} |
python | def get_context_data(self, **kwargs):
""" Returns the context data to provide to the template. """
context = super().get_context_data(**kwargs)
context['top_level_forum'] = self.top_level_forum
context['top_level_forum_url'] = self.get_top_level_forum_url()
return context |
python | def DbGetClassAttributePropertyHist(self, argin):
""" Retrieve Tango class attribute property history
:param argin: Str[0] = Tango class
Str[1] = Attribute name
Str[2] = Property name
:type: tango.DevVarStringArray
:return: Str[0] = Attribute name
Str[1] = Proper... |
java | public ServiceFuture<VerificationIPFlowResultInner> verifyIPFlowAsync(String resourceGroupName, String networkWatcherName, VerificationIPFlowParameters parameters, final ServiceCallback<VerificationIPFlowResultInner> serviceCallback) {
return ServiceFuture.fromResponse(verifyIPFlowWithServiceResponseAsync(resou... |
java | public void changePathInURL(String path, boolean changeHistory) {
jcrURL.setPath(path);
if (changeHistory) {
htmlHistory.newItem(jcrURL.toString(), false);
}
} |
java | @SuppressWarnings("unchecked")
public void handleExtraOptions() {
dimension = (argOptions.hasOption("dimension"))
? argOptions.getIntOption("dimension")
: DEFAULT_DIMENSION;
if (argOptions.hasOption("loadVectors")) {
generatorMap = (GeneratorMap<DoubleVector>) Seriali... |
python | def generate_variables(name, n_vars=1, hermitian=None, commutative=True):
"""Generates a number of commutative or noncommutative variables
:param name: The prefix in the symbolic representation of the noncommuting
variables. This will be suffixed by a number from 0 to
n_vars-1... |
python | def needs_to_auth(self, dbname):
"""
Determines if the server needs to authenticate to the database.
NOTE: we stopped depending on is_auth() since its only a configuration
and may not be accurate
"""
log_debug("Checking if server '%s' needs to auth on db '%s'...." %
... |
python | def pre_translation(self, query):
"""
Translates the query for possible aliases
"""
old = query.copy()
if 'bug_id' in query:
if not isinstance(query['bug_id'], list):
query['id'] = query['bug_id'].split(',')
else:
query['id... |
java | public OvhSOTPValidate accessRestriction_backupCode_validate_POST(String code) throws IOException {
String qPath = "/me/accessRestriction/backupCode/validate";
StringBuilder sb = path(qPath);
HashMap<String, Object>o = new HashMap<String, Object>();
addBody(o, "code", code);
String resp = exec(qPath, "POST", ... |
java | @SuppressWarnings("unchecked")
@Override
public EList<Double> getSurfaceReinforcement1() {
return (EList<Double>) eGet(Ifc4Package.Literals.IFC_SURFACE_REINFORCEMENT_AREA__SURFACE_REINFORCEMENT1, true);
} |
python | def _maxscore(self):
"""
m._maxscore() -- Sets self.maxscore and self.minscore
"""
total = 0
lowtot= 0
for lli in self.ll:
total = total + max(lli.values())
lowtot= lowtot+ min(lli.values())
self.maxscore = total
self.minscore = lo... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.