language stringclasses 2
values | func_code_string stringlengths 63 466k |
|---|---|
python | def create_event_subscription(self, instance, on_data, timeout=60):
"""
Create a new subscription for receiving events of an instance.
This method returns a future, then returns immediately. Stop the
subscription by canceling the future.
:param str instance: A Yamcs instance na... |
java | void manage_reply(int timeout)
{
switch (cmd_type)
{
case CMD:
command_inout_reply(timeout);
break;
case ATT_R:
read_attribute_reply(timeout);
break;
case ATT_W:
write_attribute_reply(timeout);
break;
}
} |
java | private void processDocs(final RootDoc rootDoc) {
this.rootDoc = rootDoc;
// Get a list of all the features and groups that we'll actually retain
workUnits = computeWorkUnits();
final Set<String> uniqueGroups = new HashSet<>();
final List<Map<String, String>> featureMaps = new ... |
java | public Map<String, Map<String, List<String>>> resourcePermissions() {
return getEntity(invokeGet("_permissions", null), Map.class);
} |
java | private static Map<String, QueryBuilder> buildFilters(RuleQuery query) {
Map<String, QueryBuilder> filters = new HashMap<>();
/* Add enforced filter on main type Rule */
filters.put(
FIELD_INDEX_TYPE,
boolQuery().must(QueryBuilders.termsQuery(FIELD_INDEX_TYPE, TYPE_RULE.getType())));
/* Ad... |
java | public ServiceFuture<Void> beginPauseAsync(String resourceGroupName, String serverName, String databaseName, final ServiceCallback<Void> serviceCallback) {
return ServiceFuture.fromResponse(beginPauseWithServiceResponseAsync(resourceGroupName, serverName, databaseName), serviceCallback);
} |
java | private static synchronized Object getFromCache(Cache cache,
byte[] encoding) {
Object key = new Cache.EqualByteArray(encoding);
Object value = cache.get(key);
return value;
} |
java | public String formatAsString(final Cell cell, final Locale locale, final boolean isStartDate1904) {
ArgUtils.notNull(cell, "cell");
return format(cell, locale, isStartDate1904).getText();
} |
python | def _background_color(s):
"""
Generate a random background color.
Brighter colors are dropped, because the text is white.
:param s: Seed used by the random generator
(same seed will produce the same color).
"""
seed(s)
r = v = b = 255
... |
python | def is_true(self, e, extra_constraints=(), solver=None, model_callback=None): #pylint:disable=unused-argument
"""
Should return True if `e` can be easily found to be True.
:param e: The AST.
:param extra_constraints: Extra constraints (as ASTs) to add to the solver f... |
java | public void run()
{
notifyListeners();
try
{
repository.getWorkspaceContainer(workspaceName).setState(ManageableRepository.SUSPENDED);
List<Backupable> backupableComponents =
repository.getWorkspaceContainer(workspaceName).getComponentInstancesOfType(Backupa... |
java | @Override
public void onUpdateNotificationBuilder(com.meizu.cloud.pushsdk.notification.PushNotificationBuilder pushNotificationBuilder) {
//重要,详情参考应用小图标自定设置
if (AVMixPushManager.flymeMStatusBarIcon != 0) {
pushNotificationBuilder.setmStatusbarIcon(AVMixPushManager.flymeMStatusBarIcon);
}
} |
python | def build_gpio():
""" Builds source with Python 2.7 and 3.2, and tests import """
with cd("/tmp/source/c_gpio"):
test = "import _GPIO; print(_GPIO.VERSION_GPIO)"
run("make gpio2.7 && cp build/_GPIO.so .")
run('sudo python2.7 -c "%s"' % test)
run("cp _GPIO.so ../RPIO/")
ru... |
python | def write(self, valuedict):
"""Generates the lines for the converted input file using the specified
value dictionary."""
result = []
if self.identifier in valuedict:
values = valuedict[self.identifier]
else:
return result
if self.comment != "":
... |
python | def serialise(self):
"""Creates standard market book json response,
will error if EX_MARKET_DEF not incl.
"""
return {
'marketId': self.market_id,
'totalAvailable': None,
'isMarketDataDelayed': None,
'lastMatchTime': None,
'betD... |
python | def to_csv(self, filename=None, *, fields=None, append=False, header=True, header_prefix='', sep=',', newline='\n'):
"""
Parameters
----------
filename: str or None
The file to which output will be written. By default, any existing content is
overwritten. Use `app... |
python | def auth_complete(self):
"""Whether the authentication handshake is complete during
connection initialization.
:rtype: bool
"""
timeout = False
auth_in_progress = False
if self._connection.cbs:
timeout, auth_in_progress = self._auth.handle_token()
... |
java | @Override
public StringBuffer format(BigInteger number,
StringBuffer toAppendTo,
FieldPosition pos) {
return format(new android.icu.math.BigDecimal(number), toAppendTo, pos);
} |
python | def df_pdb_ranking(self):
"""DataFrame: Get a dataframe of UniProt -> best structure in PDB results"""
best_structures_pre_df = []
chain_specific_keys = ['coverage', 'start', 'end', 'unp_start', 'unp_end', 'rank']
for p in self.get_experimental_structures():
for c in p.cha... |
python | def create_config():
"""Initiates process to generate configuration file."""
file_exists = exists(CONFIG_FILE)
if not file_exists:
# Set directories
config.add_section('Directories')
defaults = [
('AbstractRetrieval', expanduser('~/.scopus/abstract_retrieval')),
... |
python | def lastz_to_blast(row):
"""
Convert the lastz tabular to the blast tabular, see headers above
Obsolete after LASTZ version 1.02.40
"""
atoms = row.strip().split("\t")
name1, name2, coverage, identity, nmismatch, ngap, \
start1, end1, strand1, start2, end2, strand2, score = atoms
... |
java | public static ExecutableScript getScriptFormSource(String language, String source, ExpressionManager expressionManager, ScriptFactory scriptFactory) {
ensureNotEmpty(NotValidException.class, "Script language", language);
ensureNotNull(NotValidException.class, "Script source", source);
if (isDynamicScriptExp... |
java | public EClass getIfcImageTexture() {
if (ifcImageTextureEClass == null) {
ifcImageTextureEClass = (EClass) EPackage.Registry.INSTANCE.getEPackage(Ifc2x3tc1Package.eNS_URI)
.getEClassifiers().get(280);
}
return ifcImageTextureEClass;
} |
java | public static MutableDoubleTuple toDoubleTuple(LongTuple longTuple)
{
int d = longTuple.getSize();
MutableDoubleTuple doubleTuple = DoubleTuples.create(d);
for (int i=0; i<d; i++)
{
doubleTuple.set(i, longTuple.get(i));
}
return doubleTuple;
} |
python | def multiget_slice(self, keys, column_parent, predicate, consistency_level):
"""
Performs a get_slice for column_parent and predicate for the given keys in parallel.
Parameters:
- keys
- column_parent
- predicate
- consistency_level
"""
self._seqid += 1
d = self._reqs[self._... |
java | public Observable<VirtualHubInner> updateTagsAsync(String resourceGroupName, String virtualHubName, Map<String, String> tags) {
return updateTagsWithServiceResponseAsync(resourceGroupName, virtualHubName, tags).map(new Func1<ServiceResponse<VirtualHubInner>, VirtualHubInner>() {
@Override
... |
python | def transformer_base_vq1_16_nb1_packed_nda_b01_scales():
"""Set of hyperparameters."""
hparams = transformer_base_vq_ada_32ex_packed()
hparams.use_scales = int(True)
hparams.moe_num_experts = 16
hparams.moe_k = 1
hparams.beta = 0.1
hparams.layer_preprocess_sequence = "n"
hparams.layer_postprocess_sequen... |
java | @Override
public boolean booleanValue(CssFormatter formatter) {
Expression leftOp = operands.get( 0 );
switch( operator ) {
case '&':
case '|':
boolean value = leftOp.booleanValue( formatter );
for( int i = 1; i < operands.size(); i++ ) {
... |
java | protected SendListener getSendListener()
{
if (tc.isEntryEnabled()) SibTr.entry(this, tc, "getSendListener");
if (tc.isEntryEnabled()) SibTr.exit(this, tc, "getSendListener", sendListener);
return sendListener;
} |
python | def status():
'''
.. versionadded:: 2014.7.0
Display puppet agent status
CLI Example:
.. code-block:: bash
salt '*' puppet.status
'''
puppet = _Puppet()
if os.path.isfile(puppet.disabled_lockfile):
return 'Administratively disabled'
if os.path.isfile(puppet.run_... |
python | def singular_noun(self, text, count=None, gender=None):
"""
Return the singular of text, where text is a plural noun.
If count supplied, then return the singular if count is one of:
1, a, an, one, each, every, this, that or if count is None
otherwise return text unchanged.
... |
python | def getparent(self, profile):
"""Resolve a parent ID"""
assert self.parent
for inputtemplate in profile.input:
if inputtemplate == self.parent:
return inputtemplate
raise Exception("Parent InputTemplate '"+self.parent+"' not found!") |
python | def check_precomputed_distance_matrix(X):
"""Perform check_array(X) after removing infinite values (numpy.inf) from the given distance matrix.
"""
tmp = X.copy()
tmp[np.isinf(tmp)] = 1
check_array(tmp) |
java | private JSplitPane createStatusPanelsSplit() {
JSplitPane splitVert = new JSplitPane();
splitVert.setDividerLocation(restoreDividerLocation(DIVIDER_VERTICAL, 300));
splitVert.addPropertyChangeListener(JSplitPane.DIVIDER_LOCATION_PROPERTY, new DividerResizedListener(DIVIDER_VERTICAL));
splitVert.setDivid... |
python | def trainObjects(objects, exp, numRepeatsPerObject, experimentIdOffset=0):
"""
Train the network on all the objects by randomly traversing points on
each object. We offset the id of each object to avoid confusion with
any sequences that might have been learned.
"""
# We want to traverse the features of eac... |
python | def _get_deprecation_warning(self, route):
"""Returns a deprecation tag / message, if route is deprecated."""
result = ''
if route.deprecated:
msg = '{} is deprecated.'.format(fmt_route_func(route))
if route.deprecated.by:
msg += ' Use {}.'.format(fmt_var(... |
java | static Process execShellScript(
final Logger logger,
final File workingdir,
final File scriptfile,
final String scriptargs,
final String[] scriptargsarr,
final Map<String, Map<String, String>> envContext,
final Map<String, Map<String, S... |
java | public static base_responses update(nitro_service client, appfwconfidfield resources[]) throws Exception {
base_responses result = null;
if (resources != null && resources.length > 0) {
appfwconfidfield updateresources[] = new appfwconfidfield[resources.length];
for (int i=0;i<resources.length;i++){
updat... |
python | def dataframe_from_result_table(table):
import pandas as pd
from ._models import KustoResultTable
from dateutil.tz import UTC
"""Converts Kusto tables into pandas DataFrame.
:param azure.kusto.data._models.KustoResultTable table: Table received from the response.
:return: pandas DataFrame.
... |
python | def get_context_json(self, context):
'''
Return a base answer for a json answer
'''
# Initialize answer
answer = {}
# Metadata builder
answer['meta'] = self.__jcontext_metadata(context)
# Filter builder
answer['filter'] = self.__jcontext_filter(c... |
python | def remove_networks(self, ids):
"""
Set column 'active = 0' in tables redeipv4 and redeipv6]
:param ids: ID for NetworkIPv4 and/or NetworkIPv6
:return: Nothing
:raise NetworkInactiveError: Unable to remove the network because it is inactive.
:raise InvalidParameterErro... |
python | def set_text(self, text=None):
"""stub"""
if text is None:
raise NullArgument()
if self.get_text_metadata().is_read_only():
raise NoAccess()
if not self.my_osid_object_form._is_valid_string(
text,
self.get_text_metadata()):
... |
python | def _make_indices(self, Ns):
''' makes indices for cross validation '''
N_new = int(Ns * self.n_splits)
test = [np.full(N_new, False) for i in range(self.n_splits)]
for i in range(self.n_splits):
test[i][np.arange(Ns * i, Ns * (i + 1))] = True
train = [np.logical_not... |
python | def order_assimilation(args):
"""
Internal helper method for BorgQueen to process assimilation
"""
(path, drone, data, status) = args
newdata = drone.assimilate(path)
if newdata:
data.append(json.dumps(newdata, cls=MontyEncoder))
status['count'] += 1
count = status['count']
t... |
java | public static FileOrder fromName(final String name) {
if (name == null) {
return null;
}
for (final FileOrder fo : INSTANCES) {
if (fo.name.equals(name)) {
return fo;
}
}
throw new IllegalArgumentException("Unknown name... |
python | def generate_row_keys(self):
"""
Method for generating key features at serving time or prediction time
:param data: Pass in the data that is necessary for generating the keys
Example :
Feature : User warehouse searches and conversions
Keys will be of the form 'us... |
java | public static CPInstance fetchByC_ERC(long companyId,
String externalReferenceCode, boolean retrieveFromCache) {
return getPersistence()
.fetchByC_ERC(companyId, externalReferenceCode,
retrieveFromCache);
} |
python | def server_log(self):
''' Launch log '''
logfilename = self.config.get('Server Parameters', 'logfile')
if sys.platform == "darwin":
args = ["open", "-a", "Console.app", logfilename]
else:
args = ["xterm", "-e", "'tail -f %s'" % logfilename]
subprocess.Pope... |
java | public void createDestination(com.ibm.ws.sib.admin.DestinationDefinition dd)throws JMSException
{
if (tcInt.isEntryEnabled()) SibTr.entry(tcInt, "createDestination(DestinationDefinition)");
try
{
Reliability defRel = dd.getDefaultReliability();
if(defRel == null)
{
dd.setDefaultReliability(Rel... |
java | static Document loadDocument(Resource xmlFile) throws SAXException, IOException {
InputStream is = null;
try {
return _loadDocument(is = IOUtil.toBufferedInputStream(xmlFile.getInputStream()));
}
finally {
IOUtil.closeEL(is);
}
} |
python | def dump(self):
"""Dump the current state to debug level log."""
logging.debug('AccessPolicy:')
map(
logging.debug,
[
' {}'.format(s)
for s in pprint.pformat(self.get_normalized_perm_list()).splitlines()
],
) |
python | def parse_template_config(template_config_data):
"""
>>> from tests import doctest_utils
>>> convert_html_to_text = registration_settings.VERIFICATION_EMAIL_HTML_TO_TEXT_CONVERTER # noqa: E501
>>> parse_template_config({}) # doctest: +IGNORE_EXCEPTION_DETAIL
Traceback (most recent call last):
... |
python | def commit(self):
"Commit data to the storage."
if self._meta.path:
with open(self._meta.path, 'wb') as fd:
raw = deepcopy(self.raw)
# LAZY INDEX PROCESSING
# Save indexes only if not lazy
lazy_indexes = self.lazy_indexes # Kee... |
java | public void marshall(GetLifecyclePolicyRequest getLifecyclePolicyRequest, ProtocolMarshaller protocolMarshaller) {
if (getLifecyclePolicyRequest == null) {
throw new SdkClientException("Invalid argument passed to marshall(...)");
}
try {
protocolMarshaller.marshall(getL... |
python | def _split_generators(self, dl_manager):
"""Returns splits."""
dl_urls = {
split: _BASE_DOWNLOAD_PATH + "%s.tfrecord" % split for split in _SPLITS
}
dl_urls["instrument_labels"] = (_BASE_DOWNLOAD_PATH +
"instrument_labels.txt")
dl_paths = dl_manager.downlo... |
java | public void setAttribute(String key, Object value) {
if (m_attributeMap == null) {
// hash table is still the most efficient form of a synchronized Map
m_attributeMap = new Hashtable<String, Object>();
}
m_attributeMap.put(key, value);
} |
java | private static String getText(Document document)
{
try
{
return document.getText(0, document.getLength());
}
catch (BadLocationException exception)
{
return null;
}
} |
python | def mask(self):
'''
The array of indices to be masked. This is the union of the sets of
outliers, bad (flagged) cadences, transit cadences, and :py:obj:`NaN`
cadences.
'''
return np.array(list(set(np.concatenate([self.outmask, self.badmask,
self.... |
python | def get_link_domain(link, dist):
"""
tool to identify the domain of a given monotonic link function
Parameters
----------
link : Link object
dist : Distribution object
Returns
-------
domain : list of length 2, representing the interval of the domain.
"""
domain = np.array(... |
java | private void handleFileAnnotation(String featureName, String value) {
if (featureName.equals(GF_ACCESSION_NUMBER)) {
stockholmStructure.getFileAnnotation().setGFAccessionNumber(value);
} else if (featureName.equals(GF_IDENTIFICATION)) {
stockholmStructure.getFileAnnotation().setGFIdentification(value);
} el... |
python | def simxGetIntegerSignal(clientID, signalName, operationMode):
'''
Please have a look at the function description/documentation in the V-REP user manual
'''
signalValue = ct.c_int()
if (sys.version_info[0] == 3) and (type(signalName) is str):
signalName=signalName.encode('utf-8')
return... |
java | public static Object getAggBuckets(Map<String,?> map ,String metrics){
if(map != null){
Map<String,Object> metrics_ = (Map<String,Object>)map.get(metrics);
if(metrics_ != null){
return metrics_.get("buckets");
}
}
return null;
} |
java | @RequiresApi(Build.VERSION_CODES.KITKAT)
public void removePauseListener(@NonNull IconicsAnimationPauseListener listener) {
if (mPauseListeners == null) {
return;
}
mPauseListeners.remove(listener);
if (mPauseListeners.size() == 0) {
mPauseListeners = null;
... |
python | def batch_entrez(list_of_terms, db="nuccore", retmax=1, rettype="fasta",
batchsize=1, email=myEmail):
"""
Retrieve multiple rather than a single record
"""
for term in list_of_terms:
logging.debug("Search term %s" % term)
success = False
ids = None
if n... |
java | protected final void addDefaultServlet(WebAppContext context) {
Assert.notNull(context, "Context must not be null");
ServletHolder holder = new ServletHolder();
holder.setName("default");
holder.setClassName("org.eclipse.jetty.servlet.DefaultServlet");
holder.setInitParameter("dirAllowed", "false");
holder.... |
python | def execute(cls, uri, http_verb, extra_headers=None, batch=False, _body=None, **kw):
"""
if batch == False, execute a command with the given parameters and
return the response JSON.
If batch == True, return the dictionary that would be used in a batch
command.
"""
... |
java | public boolean addTagPreserve(final Tag tag) {
boolean result = false;
String tagName = tag.getTagName();
if (CmsStringUtil.isNotEmptyOrWhitespaceOnly(tagName)) {
result = m_visibleTags.add(tagName.toLowerCase());
}
return result;
} |
java | public static <T> boolean isReferringTo(final Reference<T> ref, final T obj)
{
return ref.get() == obj;
} |
java | @Override
public String getDescription(Comparison difference) {
final ComparisonType type = difference.getType();
String description = type.getDescription();
final Detail controlDetails = difference.getControlDetails();
final Detail testDetails = difference.getTestDetails();
... |
python | def create_url_rules(endpoint, list_route=None, item_route=None,
pid_type=None, pid_minter=None, pid_fetcher=None,
read_permission_factory_imp=None,
create_permission_factory_imp=None,
update_permission_factory_imp=None,
... |
java | private boolean associateElasticIp() {
String elasticIp = this.targetProperties.get( Ec2Constants.ELASTIC_IP );
if( ! Utils.isEmptyOrWhitespaces( elasticIp )) {
this.logger.fine( "Associating an elastic IP with the instance. IP = " + elasticIp );
AssociateAddressRequest associateAddressRequest = new Associat... |
java | public OHLCSeries addSeries(
String seriesName,
List<?> xData,
List<? extends Number> openData,
List<? extends Number> highData,
List<? extends Number> lowData,
List<? extends Number> closeData) {
DataType dataType = getDataType(xData);
switch (dataType) {
case Date:
... |
java | @Override
public T visitBinaryExpression(BinaryExpression elm, C context) {
if (elm instanceof CalculateAgeAt) return visitCalculateAgeAt((CalculateAgeAt)elm, context);
else return super.visitBinaryExpression(elm, context);
} |
java | public Observable<ServiceResponse<Page<CsmUsageQuotaInner>>> listUsagesSinglePageAsync(final String resourceGroupName, final String name, final String filter) {
if (resourceGroupName == null) {
throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.");
... |
java | @SuppressWarnings("rawtypes")
public Enumeration getCMP20Enumeration(Enumeration keys)
throws FinderException,
RemoteException
{
return ivEntityHelper.getCMP20Enumeration(this, keys);
} |
python | def _join_chars(chars, length):
"""
Used by the random character functions.
"""
mult = int(length / len(chars)) + 1
mult_chars = chars * mult
return "".join(random.sample(mult_chars, length)) |
python | def rec_append_fields(rec, names, arrs, dtypes=None):
"""
Return a new record array with field names populated with data
from arrays in *arrs*. If appending a single field, then *names*,
*arrs* and *dtypes* do not have to be lists. They can just be the
values themselves.
"""
if (not isstrin... |
java | public List<String> getRootChildren() {
List<String> children = new ArrayList<String>();
try {
children = zk.getChildren("/", false);
} catch (KeeperException e) {
LOGGER.error(e.toString());
} catch (InterruptedException e) {
LOGGER.error(e.toString(... |
java | public void marshall(GetFaceSearchRequest getFaceSearchRequest, ProtocolMarshaller protocolMarshaller) {
if (getFaceSearchRequest == null) {
throw new SdkClientException("Invalid argument passed to marshall(...)");
}
try {
protocolMarshaller.marshall(getFaceSearchReques... |
python | def read_case(input, format=None):
""" Returns a case object from the given input file object. The data
format may be optionally specified.
"""
# Map of data file types to readers.
format_map = {"matpower": MATPOWERReader,
"psse": PSSEReader, "pickle": PickleReader}
# Read case data.
... |
java | public static String padleft(String s, int len, char c) {
s = s.trim();
if (s.length() > len) {
return s;
}
final StringBuilder sb = new StringBuilder(len);
int fill = len - s.length();
while (fill-- > 0) {
sb.append(c);
}
sb.append... |
python | def _query_tns(self):
"""
*determine how to query the TNS, send query and parse the results*
**Return:**
- ``results`` -- a list of dictionaries (one dictionary for each result set returned from the TNS)
"""
self.log.info('starting the ``get`` method')
sourc... |
java | @Draft
public static void recvMsg(ZMQ.Socket socket, int flags,
Consumer<ZMsg> handler,
Consumer<ZMQException> exceptionHandler)
{
try {
handler.accept(ZMsg.recvMsg(socket, flags));
}
catch (ZMQException e) {
... |
python | def wrap(text, width, *args, **kwargs):
"""
Like :func:`textwrap.wrap` but preserves existing newlines which
:func:`textwrap.wrap` does not otherwise handle well.
See Also
--------
:func:`textwrap.wrap`
"""
return sum([textwrap.wrap(line, width, *args, **kwargs)
if line... |
python | def get_config(self, config_filename):
"""
Collection all config file in all available apps, and merge them into ini object
:return: ini object
"""
x = pyini.Ini(lazy=True, basepath=os.path.join(self.project_dir, 'apps'))
for p in reversed(self.apps):
app_path... |
java | private Reference createDefinitionResourceBindingListenerReference(String refName,
String bindingName,
String type,
... |
python | def _setComparasionOperator(self, field, oper):
"""Sets correct operator for given string representation"""
if oper != '':
validOperators = {
'eq':'eq',
'equals':'eq',
'=':'eq',
'==':'eq',
'cn':'cn',
'contains':'cn',
'%%':'cn',
'%':'cn',
'*':'cn',
'bw':'bw',
'begins w... |
java | public void marshall(Organization organization, ProtocolMarshaller protocolMarshaller) {
if (organization == null) {
throw new SdkClientException("Invalid argument passed to marshall(...)");
}
try {
protocolMarshaller.marshall(organization.getId(), ID_BINDING);
... |
python | def _type_check(arg, msg):
"""Check that the argument is a type, and return it (internal helper).
As a special case, accept None and return type(None) instead.
Also, _TypeAlias instances (e.g. Match, Pattern) are acceptable.
The msg argument is a human-readable error message, e.g.
"Union[arg,... |
java | final public SelectionKey getKey(SocketChannel channel) {
if (null == channel) {
return null;
}
return channel.keyFor(this.selector);
} |
python | def notifiers_stack_padding(self, value):
"""
Setter for **self.__notifiers_stack_padding** attribute.
:param value: Attribute value.
:type value: int
"""
if value is not None:
assert type(value) is int, "'{0}' attribute: '{1}' type is not 'int'!".format("no... |
java | public void debug(String correlationId, String message, Object... args) {
formatAndWrite(LogLevel.Debug, correlationId, null, message, args);
} |
python | def logical_chassis_fwdl_status_output_cluster_fwdl_entries_fwdl_entries_message(self, **kwargs):
"""Auto Generated Code
"""
config = ET.Element("config")
logical_chassis_fwdl_status = ET.Element("logical_chassis_fwdl_status")
config = logical_chassis_fwdl_status
output =... |
java | public static Optional<Object> getSubjectAltNameField(X509Certificate certificate, int field) {
try {
Collection<List<?>> subjectAltNames = certificate.getSubjectAlternativeNames();
if (subjectAltNames == null) subjectAltNames = Collections.emptyList();
for (List<?> idAndVal... |
python | def update_payload(self, fields=None):
"""Wrap submitted data within an extra dict."""
payload = super(Media, self).update_payload(fields)
if 'path_' in payload:
payload['path'] = payload.pop('path_')
return {u'medium': payload} |
python | def _accept_header(self):
"""
Method for determining correct `Accept` header.
Different resources and different GoCD version servers prefer
a diverse headers. In order to manage all of them, this method
tries to help: if `VERSION_TO_ACCEPT_HEADER` is not provided,
if wou... |
java | public void commit() throws SQLException {
lock.lock();
try {
if (protocol.inTransaction()) {
try (Statement st = createStatement()) {
st.execute("COMMIT");
}
}
} finally {
lock.unlock();
}
} |
python | def removeLastRow(self):
"""Removes the last track"""
lastrow = self._segments.pop(len(self._segments)-1)
if len(lastrow) > 0:
raise Exception("Attempt to remove non-empty stimulus track") |
python | def downsample(work_dir, sample_name, fastq_left_fpath, fastq_right_fpath, downsample_to, num_pairs=None):
""" get N random headers from a fastq file without reading the
whole thing into memory
modified from: http://www.biostars.org/p/6544/
"""
sample_name = sample_name or splitext(''.join(lc if lc ... |
java | public static List<CredentialParams> manyFromConfig(ConfigParams config, boolean configAsDefault) {
List<CredentialParams> result = new ArrayList<CredentialParams>();
// Try to get multiple credentials first
ConfigParams credentials = config.getSection("credentials");
if (credentials.size() > 0) {
List<Str... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.