language stringclasses 2
values | func_code_string stringlengths 63 466k |
|---|---|
java | public final String get(final String pkey) {
try {
// Replace "." with "_" in the key to match what ConstantsImplCreator does.
return pkey == null ? null : messages.getString(pkey.replace(".", "_"));
} catch (final MissingResourceException e) {
return null;
}
} |
python | def write_banner(title, text=' '):
"""
Write html <title> tag into markup.page object
"""
page = markup.page(mode="strict_html")
page._escape = False
page.div(id="header")
page.h1()
page.add(title)
page.h1.close()
page.h3()
page.add(text)
page.h3.close()
page.... |
java | protected void init(Map<String, String> items) {
initWidget(m_panel);
m_eventBus = new SimpleEventBus();
m_radioButtons = new HashMap<String, CmsRadioButton>();
for (Map.Entry<String, String> entry : items.entrySet()) {
final CmsRadioButton button = new CmsRadioButton(entry... |
python | def property_pickled(f):
"""Same thing as above but the result will be stored on disk
The path of the pickle file will be determined by looking for the
`cache_dir` attribute of the instance containing the cached property.
If no `cache_dir` attribute exists the `p` attribute will be accessed with
the... |
java | @Override
public List<CachedResource> getResources() {
SystemConfiguration config = getSystemConfiguration();
File cacheDirectory = config.getCacheDirectory();
List<CachedResource> cachedResource = new ArrayList<CachedResource>();
for (File cacheSubDirectory : cacheDirectory.listFi... |
java | public static HashMap<String, String> getParameters(String query) {
HashMap<String, String> params = new HashMap<String, String>();
if (query == null || query.length() == 0) {
return params;
}
String[] splitQuery = query.split("&");
for (String splitItem : splitQuery... |
java | public void unsubscribeDurable(String subscriptionName)
throws MessagingException {
try {
Session session =
connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
MessageConsumer consumer = durableSubscriptions.get(subscriptionName);
if(consume... |
python | def update_pull_request_reviewers(self, patch_votes, repository_id, pull_request_id, project=None):
"""UpdatePullRequestReviewers.
Reset the votes of multiple reviewers on a pull request. NOTE: This endpoint only supports updating votes, but does not support updating required reviewers (use policy) or ... |
python | def _build_tree(self, actor, content):
"""
Builds the tree for the given actor.
:param actor: the actor to process
:type actor: Actor
:param content: the rows of the tree collected so far
:type content: list
"""
depth = actor.depth
row = ""
... |
python | def status(conf):
"""
Show anchore system status.
"""
ecode = 0
try:
if conf:
if config.cliargs['json']:
anchore_print(config.data, do_formatting=True)
else:
anchore_print(yaml.safe_dump(config.data, indent=True, default_flow_style=Fal... |
java | private void setBrowserPattern(List<Pattern> pattern) {
if ((pattern == null) || (pattern.size() == 0)) {
setValidConfiguration(false);
LOG.error(Messages.get().getBundle().key(Messages.LOG_EDITOR_CONFIG_NO_PATTERN_0));
}
m_browserPattern = pattern;
} |
java | public void setDialogCopyFileMode(String mode) {
CmsResourceCopyMode copyMode = CmsResource.COPY_AS_NEW;
if (mode.equalsIgnoreCase(COPYMODE_SIBLING)) {
copyMode = CmsResource.COPY_AS_SIBLING;
}
setDialogCopyFileMode(copyMode);
} |
java | public void setGoal(com.google.api.ads.admanager.axis.v201811.Goal goal) {
this.goal = goal;
} |
java | private DeleteSecurityGroupResponseType deleteSecurityGroup(final String securityGroupId) {
DeleteSecurityGroupResponseType ret = new DeleteSecurityGroupResponseType();
ret.setRequestId(UUID.randomUUID().toString());
mockSecurityGroupController.deleteSecurityGroup(securityGroupId);
retur... |
java | public void setStepDetails(java.util.Collection<RemediationExecutionStep> stepDetails) {
if (stepDetails == null) {
this.stepDetails = null;
return;
}
this.stepDetails = new com.amazonaws.internal.SdkInternalList<RemediationExecutionStep>(stepDetails);
} |
java | private static void parseAttributeOrTextContent(
String stringValue,
Field field,
Type valueType,
List<Type> context,
Object destination,
GenericXml genericXml,
Map<String, Object> destinationMap,
String name) {
if (field != null || genericXml != null || destinationMa... |
python | def set_alpha(node, alpha=0.1):
"""
Sets all a(lpha) field of the rgba attribute to be @alpha
for @node and all subnodes
used for managing display
"""
for child_node in node.findall(".//*[@rgba]"):
rgba_orig = string_to_array(child_node.get("rgba"))
child_node.set("rgba", array_t... |
java | private void _reportUndefinedNotationRefs()
throws XMLStreamException
{
int count = mNotationForwardRefs.size();
String id = mNotationForwardRefs.keySet().iterator().next();
String msg = ""+count+" referenced notation"+((count == 1) ? "":"s")+" undefined: first one '"+id+"'";
... |
java | public static void closeWindows(Window... ignoredWindows) {
Window[] ws = Window.getWindows();
for (Window w : ws) {
if (!contains(ignoredWindows, w)) w.dispose();
}
} |
java | public static <T, A, B, C, D, E, F> Answer<T> toAnswer(final Answer6<T, A, B, C, D, E, F> answer) {
return new Answer<T>() {
@SuppressWarnings("unchecked")
public T answer(InvocationOnMock invocation) throws Throwable {
return answer.answer(
(A)inv... |
java | static Type parseType(String value, ResourceLoader resourceLoader) {
value = value.trim();
// Wildcards
if (value.equals(WILDCARD)) {
return WildcardTypeImpl.defaultInstance();
}
if (value.startsWith(WILDCARD_EXTENDS)) {
Type upperBound = parseType(value.s... |
python | def containsUid(self, uid):
'''
containsUid - Check if the uid (unique internal ID) appears anywhere as a direct child to this node, or the node itself.
@param uid <uuid.UUID> - uuid to check
@return <bool> - True if #uid is this node's uid, or is the uid of any childre... |
java | public static ByteBuffer allocateAndReadAll(int size, ReadableByteChannel channel) throws IOException
{
ByteBuffer buf = ByteBuffer.allocate(size);
int justRead;
int totalRead = 0;
// FIXME, this will be a tight loop if the channel is non-blocking...
while(totalRead < size)
{
logger.debug("reading tota... |
python | def oriented_bounds(obj, angle_digits=1, ordered=True):
"""
Find the oriented bounding box for a Trimesh
Parameters
----------
obj : trimesh.Trimesh, (n, 2) float, or (n, 3) float
Mesh object or points in 2D or 3D space
angle_digits : int
How much angular precision do we want on o... |
python | def load_schema(path):
"""Loads a JSON schema file."""
with open(path) as json_data:
schema = json.load(json_data)
return schema |
python | def file_claims_pdfa(filename):
"""Determines if the file claims to be PDF/A compliant
This only checks if the XMP metadata contains a PDF/A marker. It does not
do full PDF/A validation.
"""
with pikepdf.open(filename) as pdf:
pdfmeta = pdf.open_metadata()
if not pdfmeta.pdfa_statu... |
java | protected void marshallElementContent(XMLObject samlObject, Element domElement) throws MarshallingException {
SPType spType = (SPType) samlObject;
if (spType.getType() != null && spType.getType().getValue() != null) {
ElementSupport.appendTextContent(domElement, spType.getType().getValue());
}
} |
java | public void convert(String jobName, String jobId, Writer writer) throws IOException {
List<? extends JobState> jobStates = this.jobStateStore.getAll(jobName, jobId + JOB_STATE_STORE_TABLE_SUFFIX);
if (jobStates.isEmpty()) {
LOGGER.warn(String.format("No job state found for job with name %s and id %s", job... |
python | def start_reloader(
worker_path,
reload_interval=1,
shutdown_interval=default,
verbose=1,
logger=None,
monitor_factory=None,
worker_args=None,
worker_kwargs=None,
ignore_files=None,
):
"""
Start a monitor and then fork a worker process which starts by executing
the import... |
java | static void append(Appendable outputBuf, SoyValue value, SoyNode node) {
try {
value.render(outputBuf);
} catch (IOException e) {
throw new RuntimeException(e);
} catch (RenderException e) {
throw e.addStackTraceElement(node);
}
} |
python | def analyze_structures(self, structures, step_freq=10,
most_frequent_polyhedra=15):
"""
Perform Voronoi analysis on a list of Structures.
Note that this might take a significant amount of time depending on the
size and number of structures.
Args:
... |
java | public void setId(String id)
{
super.setId(id);
try {
setTagId(id);
} catch (JspException e) {
e.printStackTrace();
}
} |
java | public static boolean fieldInsnEqual(FieldInsnNode insn1, FieldInsnNode insn2)
{
return insn1.owner.equals(insn2.owner) && insn1.name.equals(insn2.name) && insn1.desc.equals(insn2.desc);
} |
java | @Nullable
public static String getAsIdentifier (@Nullable final String s, final char cReplacement)
{
if (StringHelper.hasNoText (s))
return s;
String sReplacement;
if (cReplacement == '$' || cReplacement == '\\')
{
// These 2 chars must be quoted, otherwise an
// StringIndexOutOfB... |
java | private static void sortKeyPrefixArrayAtByte(
LongArray array, long numRecords, long[] counts, int byteIdx, long inIndex, long outIndex,
boolean desc, boolean signed) {
assert counts.length == 256;
long[] offsets = transformCountsToOffsets(
counts, numRecords, array.getBaseOffset() + outIndex ... |
python | def color_is_allowed():
''' Look for clues in environment, e.g.:
- https://bixense.com/clicolors/
- http://no-color.org/
Returns:
Bool: Allowed
'''
result = True # generally yes - env.CLICOLOR != '0'
if color_is_disabled():
result = False
log.debug('... |
python | def index_bams(job, config):
"""
Convenience job for handling bam indexing to make the workflow declaration cleaner
:param JobFunctionWrappingJob job: passed automatically by Toil
:param Namespace config: Argparse Namespace object containing argument inputs
"""
job.fileStore.logToMaster('Indexe... |
python | def gradient_program(f_h: float, precision: int) -> Program:
"""
Gradient estimation via Jordan's algorithm (10.1103/PhysRevLett.95.050501).
:param f_h: Oracle output at perturbation h.
:param precision: Bit precision of gradient.
:return: Quil program to estimate gradient of f.
"""
# enco... |
java | static <RESOLVERSYSTEMTYPE extends ResolverSystem> RESOLVERSYSTEMTYPE createFromUserView(
final Class<RESOLVERSYSTEMTYPE> userViewClass, final ClassLoader cl) {
assert userViewClass != null : "user view class must be specified";
assert cl != null : "ClassLoader must be specified";
... |
python | def SpiceUDREPU(f):
"""
Decorator for wrapping python functions in spice udrepu callback type
:param f: function to be wrapped
:type f: builtins.function
:return: wrapped udrepu function
:rtype: builtins.function
"""
@functools.wraps(f)
def wrapping_udrepu(beg, end, et):
f(be... |
java | public DependencyTreeNode getNode(int position) {
if (position < 0 || position >= nodes.size())
throw new IndexOutOfBoundsException("Invalid node: " + position);
return nodes.get(position);
} |
java | public static EntityMetadata introspect(Class<?> entityClass) {
EntityMetadata cachedMetadata = cache.get(entityClass);
if (cachedMetadata != null) {
return cachedMetadata;
}
return loadMetadata(entityClass);
} |
java | @SuppressWarnings("squid:S3655")
public String getNummerFormatted() {
if (!this.getNummer().isPresent()) {
throw new IllegalStateException("no number present");
}
BigInteger hundert = BigInteger.valueOf(100);
StringBuilder formatted = new StringBuilder();
for (Big... |
python | def create(self, data, fields=[], models={}):
'''
Create model attributes
'''
if not fields: fields = self.fields
if not models and hasattr(self, 'models'): models = self.models
for field in fields:
setattr(self,field,None)
if not data: return None
... |
java | public void setTargets(com.google.api.ads.admanager.axis.v201902.ForecastBreakdownTarget[] targets) {
this.targets = targets;
} |
python | def closest_pair(arr, give="indicies"):
"""Find the pair of indices corresponding to the closest elements in an array.
If multiple pairs are equally close, both pairs of indicies are returned.
Optionally returns the closest distance itself.
I am sure that this could be written as a cheaper operation. ... |
python | def get_prottable_headerfields(headertypes, lookup=False, poolnames=False, genecentric=False):
"""Called by driver to generate headerfields object"""
field_defs = {'isoquant': get_isoquant_fields,
'precursorquant': get_precursorquant_fields,
'probability': get_probability_fie... |
python | def detx(self, det_id, t0set=None, calibration=None):
"""Retrieve the detector file for given detector id
If t0set is given, append the calibration data.
"""
url = 'detx/{0}?'.format(det_id) # '?' since it's ignored if no args
if t0set is not None:
url += '&t0set=... |
python | def convert_shortcut_quick_reply(items):
"""
support shortcut [{'title':'title', 'payload':'payload'}]
"""
if items is not None and isinstance(items, list):
result = []
for item in items:
if isinstance(item, QuickReply):
result.... |
python | def create_path_env_var(new_entries, env=None, env_var='PATH', delimiter=':', prepend=False):
"""Join path entries, combining with an environment variable if specified."""
if env is None:
env = {}
prev_path = env.get(env_var, None)
if prev_path is None:
path_dirs = list()
else:
path_dirs = list(p... |
python | def _poll_for_refresh(self, check_id):
"""
Given a Trusted Advisor check_id that has just been refreshed, poll
until the refresh is complete. Once complete, return the check result.
:param check_id: the Trusted Advisor check ID
:type check_id: str
:returns: dict check re... |
java | public OrderingList<S> replace(int index, OrderedProperty<S> property) {
int size = size();
if (index < 0 || index >= size) {
throw new IndexOutOfBoundsException();
}
OrderingList<S> newList = emptyList();
for (int i=0; i<size; i++) {
newList = newL... |
python | def store_node_label_meta(self, x, y, tx, ty, rot):
"""
This function stored coordinates-related metadate for a node
This function should not be called by the user
:param x: x location of node label or number
:type x: np.float64
:param y: y location of node label or num... |
java | @Override
public Iterable<ExceptionQueuedEvent> getUnhandledExceptionQueuedEvents()
{
init();
if (!isUseMyFacesErrorHandling())
{
return super.getUnhandledExceptionQueuedEvents();
}
else
{
return unhandled == null ? Collections.<ExceptionQu... |
python | def do_stack_resource(self, args):
"""Use specified stack resource. stack_resource -h for detailed help."""
parser = CommandArgumentParser()
parser.add_argument('-s','--stack-name',dest='stack-name',help='name of the stack resource');
parser.add_argument('-i','--logical-id',dest='logical... |
java | public Deadline minimum(Deadline other) {
assert this.ticker == other.ticker : "Tickers don't match";
return isBefore(other) ? this : other;
} |
python | def get_objectives_by_search(self, objective_query, objective_search):
"""Pass through to provider ObjectiveSearchSession.get_objectives_by_search"""
# Implemented from azosid template for -
# osid.resource.ResourceSearchSession.get_resources_by_search_template
if not self._can('search')... |
java | public static <E, R> R reduce(Iterable<E> iterable, BiFunction<R, E, R> function, R init) {
dbc.precondition(iterable != null, "cannot call reduce with a null iterable");
return new Reductor<>(function, init).apply(iterable.iterator());
} |
python | def deal_list_query(self, code="", trd_env=TrdEnv.REAL, acc_id=0, acc_index=0):
"""for querying deal list"""
ret, msg = self._check_trd_env(trd_env)
if ret != RET_OK:
return ret, msg
ret, msg, acc_id = self._check_acc_id_and_acc_index(trd_env, acc_id, acc_index)
if r... |
java | public void containsRow(@NullableDecl Object rowKey) {
check("rowKeySet()").that(actual().rowKeySet()).contains(rowKey);
} |
python | def spec(self, postf_un_ops: str) -> list:
"""Return prefix unary operators list"""
spec = [(l + op, {'pat': self.pat(pat),
'postf': self.postf(r, postf_un_ops),
'regex': None})
for op, pat in self.styles.items()
for l, ... |
python | def bootstrap_jar_classfiles(self):
"""Returns a set of classfiles from the JVM bootstrap jars."""
bootstrap_jar_classfiles = set()
for jar_file in self._find_all_bootstrap_jars():
for cls in self._jar_classfiles(jar_file):
bootstrap_jar_classfiles.add(cls)
return bootstrap_jar_classfiles |
java | @Override
public BundleInstanceResult bundleInstance(BundleInstanceRequest request) {
request = beforeClientExecution(request);
return executeBundleInstance(request);
} |
python | def search(self, scope, search, **kwargs):
"""Search the project resources matching the provided string.'
Args:
scope (str): Scope of the search
search (str): Search string
**kwargs: Extra options to send to the server (e.g. sudo)
Raises:
GitlabA... |
python | def prepare(self, ansi='', ensure_trailing_newline=False):
""" Load the contents of 'ansi' into this object """
body, styles = self.apply_regex(ansi)
if ensure_trailing_newline and _needs_extra_newline(body):
body += '\n'
self._attrs = {
'dark_bg': self.dark_bg... |
python | def check_policies(self, account, account_policies, aws_policies):
"""Iterate through the policies of a specific account and create or update the policy if its missing or
does not match the policy documents from Git. Returns a dict of all the policies added to the account
(does not include updat... |
python | def find(self, source, issuer):
"""
Find a key bundle based on the source of the keys
:param source: A source url
:param issuer: The issuer of keys
:return: A :py:class:`oidcmsg.key_bundle.KeyBundle` instance or None
"""
try:
for kb in self.issuer_key... |
java | @XmlElementDecl(namespace = "http://www.opengis.net/gml", name = "polarCSRef")
public JAXBElement<PolarCSRefType> createPolarCSRef(PolarCSRefType value) {
return new JAXBElement<PolarCSRefType>(_PolarCSRef_QNAME, PolarCSRefType.class, null, value);
} |
python | def cull(self, file_filter=None, attrs=None):
""" Delete ALL data files and remove torrent from client.
@param file_filter: Optional callable for selecting a subset of all files.
The callable gets a file item as described for RtorrentItem._get_files
and must return T... |
python | def factor_weights(factor_data,
demeaned=True,
group_adjust=False,
equal_weight=False):
"""
Computes asset weights by factor values and dividing by the sum of their
absolute value (achieving gross leverage of 1). Positive factor values will
result... |
java | protected void create(List<TableInfo> tableInfos)
{
try
{
createOrUpdateKeyspace(tableInfos);
}
catch (Exception ex)
{
throw new SchemaGenerationException(ex);
}
} |
java | public boolean forwardIfCurrentAndNoWordAfter(String str) {
int c = pos;
if (forwardIfCurrent(str)) {
if (!isCurrentBetween('a', 'z') && !isCurrent('_')) return true;
}
pos = c;
return false;
} |
java | public void marshall(AddFacetToObjectRequest addFacetToObjectRequest, ProtocolMarshaller protocolMarshaller) {
if (addFacetToObjectRequest == null) {
throw new SdkClientException("Invalid argument passed to marshall(...)");
}
try {
protocolMarshaller.marshall(addFacetTo... |
java | @Override
public boolean validateObject(HostAndPort hostAndPort, PooledObject<SocketWriter> socketWriterRef) {
Socket socket = socketWriterRef.getObject().getSocket();
return socket.isConnected()
&& socket.isBound()
&& !socket.isClosed()
&& !socket.isI... |
python | def _render(template, render, renderer, template_dict, opts):
'''
Render a template
'''
if render:
if template_dict is None:
template_dict = {}
if not renderer:
renderer = opts.get('renderer', 'jinja|yaml')
rend = salt.loader.render(opts, {})
black... |
java | public static vpnvserver_vpntrafficpolicy_binding[] get(nitro_service service, String name) throws Exception{
vpnvserver_vpntrafficpolicy_binding obj = new vpnvserver_vpntrafficpolicy_binding();
obj.set_name(name);
vpnvserver_vpntrafficpolicy_binding response[] = (vpnvserver_vpntrafficpolicy_binding[]) obj.get_re... |
python | def get_stars_of_sibling_of(self, component):
"""
same as get_sibling_of except if the sibling is an orbit, this will recursively
follow the tree to return a list of all stars under that orbit
"""
sibling = self.get_sibling_of(component)
if sibling in self.get_stars():
... |
java | @SuppressWarnings("rawtypes")
private List<AttributeConfig> parserAttribute(Element element) {
List attributes = element.getAttributes();
List<AttributeConfig> attributeConfigList = null;
if (attributes != null && attributes.size() > 0) {
attributeConfigList = new ArrayList<AttributeConfig>();
fo... |
java | static void unregister(Object value) {
if (value != null) {
Map<Object, Object> m = getRegistry();
if (m != null) {
m.remove(value);
if (m.isEmpty()) {
REGISTRY.remove();
}
}
}
} |
python | def set_mime_data(self, mime_type, data):
"""
Attach an image in the format :obj:`mime_type` to this surface.
To remove the data from a surface,
call this method with same mime type and :obj:`None` for data.
The attached image (or filename) data can later
be used by bac... |
java | public void register(String table, String column, Class<?> javaType) {
register(table, column, javaTypeMapping.getType(javaType));
} |
java | static void parsePropertyElement(final ModelNode operation, final XMLExtendedStreamReader reader, final String wrapperName) throws XMLStreamException {
while (reader.nextTag() != END_ELEMENT) {
final int cnt = reader.getAttributeCount();
String name = null;
String value = nul... |
python | def drel(simulated_array, observed_array, replace_nan=None, replace_inf=None,
remove_neg=False, remove_zero=False):
"""Compute the the relative index of agreement (drel).
.. image:: /pictures/drel.png
**Range:** 0 ≤ drel < 1, does not indicate bias, larger is better.
**Notes:** Instead of ab... |
python | def is_dimensionless_standard_name(xml_tree, standard_name):
'''
Returns True if the units for the associated standard name are
dimensionless. Dimensionless standard names include those that have no
units and units that are defined as constant units in the CF standard name
table i.e. '1', or '1e-3'... |
java | public TaskCompletionEvent[] readJobTaskCompletionEvents(JobID jobId,
int fromEventId,
int maxEvents) {
TaskCompletionEvent[] events = TaskCompletionEvent.EMPTY_ARRAY;
if (active) {
... |
java | public static String getPrettyMapOfContiguousPartitionRunLengths(final Cluster cluster,
int zoneId) {
Map<Integer, Integer> runLengthToCount = getMapOfContiguousPartitionRunLengths(cluster,
... |
python | def modifier_id(self, modifier_id):
"""
Sets the modifier_id of this CatalogModifierOverride.
The ID of the [CatalogModifier](#type-catalogmodifier) whose default behavior is being overridden.
:param modifier_id: The modifier_id of this CatalogModifierOverride.
:type: str
... |
python | def load_recommendations(self):
"""Fetches the MAL user recommendations page and sets the current user's recommendations attributes.
:rtype: :class:`.User`
:return: Current user object.
"""
user_recommendations = self.session.session.get(u'http://myanimelist.net/profile/' + utilities.urlencode(sel... |
python | def public_key_to_address(public_key: Union[PublicKey, bytes]) -> ChecksumAddress:
""" Converts a public key to an Ethereum address. """
if isinstance(public_key, PublicKey):
public_key = public_key.format(compressed=False)
assert isinstance(public_key, bytes)
return to_checksum_address(sha3(pub... |
python | def wrpcap(filename, pkt, *args, **kargs):
"""Write a list of packets to a pcap file
gz: set to 1 to save a gzipped capture
linktype: force linktype value
endianness: "<" or ">", force endianness"""
with PcapWriter(filename, *args, **kargs) as pcap:
pcap.write(pkt) |
java | private CmsContainerPageElementPanel createElement(
Element element,
I_CmsDropContainer dragParent,
CmsContainerElement elementData) {
CmsContainerPageElementPanel dragElement = new CmsContainerPageElementPanel(
element,
dragParent,
elementData.getCli... |
python | def _get_image_stream_info_for_build_request(self, build_request):
"""Return ImageStream, and ImageStreamTag name for base_image of build_request
If build_request is not auto instantiated, objects are not fetched
and None, None is returned.
"""
image_stream = None
image_... |
python | def create_dbinstance_read_replica(self, id, source_id,
instance_class=None,
port=3306,
availability_zone=None,
auto_minor_version_upgrade=None):
"""
... |
java | public ArrayList<String> hosting_privateDatabase_serviceName_ram_GET(String serviceName, OvhAvailableRamSizeEnum ram) throws IOException {
String qPath = "/order/hosting/privateDatabase/{serviceName}/ram";
StringBuilder sb = path(qPath, serviceName);
query(sb, "ram", ram);
String resp = exec(qPath, "GET", sb.to... |
python | def json_to_key_value(json_data, key_field, value_field=None, array=False):
"""Convert JSON data to a KeyValue/KeyValueArray.
Args:
json_data (dictionary|list): Array/List of JSON data.
key_field (string): Field name for the key.
value_field (string): Field name for ... |
python | def _check_types(self) -> None:
"""
Check that all the instances have the same types.
"""
all_instance_fields_and_types: List[Dict[str, str]] = [{k: v.__class__.__name__
for k, v in x.fields.items()}
... |
python | def get_node_config(self, jid, node=None):
"""
Request the configuration of a node.
:param jid: Address of the PubSub service.
:type jid: :class:`aioxmpp.JID`
:param node: Name of the PubSub node to query.
:type node: :class:`str`
:raises aioxmpp.errors.XMPPError... |
python | def default(ruby=None, runas=None):
'''
Returns or sets the currently defined default ruby
ruby
The version to set as the default. Should match one of the versions
listed by :py:func:`rbenv.versions <salt.modules.rbenv.versions>`.
Leave blank to return the current default.
CLI ... |
python | async def set_led_mode(self, led_id, mode, timeout=OTGW_DEFAULT_TIMEOUT):
"""
Configure the functions of the six LEDs (A-F) that can
optionally be connected to pins RB3/RB4/RB6/RB7 and the GPIO
pins of the PIC. The following functions are currently
available:
R Receiving... |
python | def _create_ssh_keys(self):
"""
Generate a pair of ssh keys for this prefix
Returns:
None
Raises:
RuntimeError: if it fails to create the keys
"""
ret, _, _ = utils.run_command(
[
'ssh-keygen',
'-t',
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.