language stringclasses 2
values | func_code_string stringlengths 63 466k |
|---|---|
python | def get_instance(self, payload):
"""
Build an instance of ShortCodeInstance
:param dict payload: Payload response from the API
:returns: twilio.rest.api.v2010.account.short_code.ShortCodeInstance
:rtype: twilio.rest.api.v2010.account.short_code.ShortCodeInstance
"""
... |
java | private static String createBaseUrl(AuthleteConfiguration configuration)
{
String baseUrl = configuration.getBaseUrl();
// If the configuration does not contain a base URL.
if (baseUrl == null)
{
throw new IllegalArgumentException("The configuration does not have informa... |
java | private Expression correctClassClassChain(PropertyExpression pe) {
LinkedList<Expression> stack = new LinkedList<Expression>();
ClassExpression found = null;
for (Expression it = pe; it != null; it = ((PropertyExpression) it).getObjectExpression()) {
if (it instanceof ClassExpression... |
java | @Override
public void register(Class<? extends Throwable> throwableClass,
HandlerException handler) {
if (throwableClass != null && handler != null) {
handlers.put(throwableClass.getName(), handler);
}
} |
java | public WorkflowDef getWorkflowDef(String name, Integer version) {
Preconditions.checkArgument(StringUtils.isNotBlank(name), "name cannot be blank");
return getForEntity("metadata/workflow/{name}", new Object[]{"version", version}, WorkflowDef.class, name);
} |
python | def _status(self):
"""Return the current connection status as an integer value.
The status should match one of the following constants:
- queries.Session.INTRANS: Connection established, in transaction
- queries.Session.PREPARED: Prepared for second phase of transaction
- queri... |
python | def request_output(self, table, outtype):
"""
Request the output for a given table.
## Arguments
* `table` (str): The name of the table to export.
* `outtype` (str): The type of output. Must be one of:
CSV - Comma Seperated Values
DataSet - XML DataS... |
python | def U(Document, __raw__=None, **update):
"""Generate a MongoDB update document through paramater interpolation.
Arguments passed by name have their name interpreted as an optional operation prefix (defaulting to `set`, e.g.
`push`), a double-underscore separated field reference (e.g. `foo`, or `foo__bar`, or `foo_... |
python | def dskd02(handle,dladsc,item,start,room):
"""
Fetch double precision data from a type 2 DSK segment.
http://naif.jpl.nasa.gov/pub/naif/toolkit_docs/C/cspice/dskd02_c.html
:param handle: DSK file handle
:type handle: int
:param dladsc: DLA descriptor
:type dladsc: spiceypy.utils.support_ty... |
python | def black_tophat(image, radius=None, mask=None, footprint=None):
'''Black tophat filter an image using a circular structuring element
image - image in question
radius - radius of the circular structuring element. If no radius, use
an 8-connected structuring element.
mask - mask of sig... |
python | def m_b(mbmb, scale, f, alphasMZ=0.1185, loop=3):
r"""Get running b quark mass in the MSbar scheme at the scale `scale`
in the theory with `f` dynamical quark flavours starting from $m_b(m_b)$"""
if scale == mbmb and f == 5:
return mbmb # nothing to do
_sane(scale, f)
alphas_mb = alpha_s(mb... |
java | public void findPatterns()
throws Exception {
HashSet<String> patterns = new HashSet<String>();
for (String phrase : filtered_phrases) {
String phrase_arr[] = phrase.split(":");
String A = phrase_arr[0];
String B = phrase_arr[1];
//System.err.prin... |
java | private String getDatatypeLabel(DatatypeIdValue datatype) {
if (datatype.getIri() == null) { // TODO should be redundant once the
// JSON parsing works
return "Unknown";
}
switch (datatype.getIri()) {
case DatatypeIdValue.DT_COMMONS_MEDIA:
return "Commons media";
case DatatypeIdValue.DT_GLOB... |
python | def residual_block(inputs,
filters,
is_training,
projection_shortcut,
strides,
final_block,
data_format="channels_first",
use_td=False,
targeting_rate=None,
... |
python | def recv(self, mac_addr=broadcast_addr, timeout=0):
"""read packet off the recv queue for a given address, optional timeout to block and wait for packet"""
# recv on the broadcast address "00:..:00" will give you all packets (for promiscuous mode)
if self.keep_listening:
try:
... |
java | protected int handleComputeMonthStart(int year, int month, boolean useMonth) {
//month is 0 based; converting it to 1-based
int imonth;
// If the month is out of range, adjust it into range, and adjust the extended year accordingly
if (month < 0 || month > 11) {
year += ... |
python | def bfill(self, dim, limit=None):
'''Fill NaN values by propogating values backward
*Requires bottleneck.*
Parameters
----------
dim : str
Specifies the dimension along which to propagate values when
filling.
limit : int, default None
... |
java | public static String getSDbl( double Value, int DecPrec, boolean ShowPlusSign, int StringLength ) {
//
String Info = "";
//
String SDbl = getSDbl( Value, DecPrec, ShowPlusSign );
//
if ( SDbl.length() >= StringLength ) return SDbl;
//
// String SpacesS = " ";
String SpacesS = getSpaces( Stri... |
java | public List<Runner> getAllRunners(Runner.RunnerStatus scope, Integer page, Integer perPage) throws GitLabApiException {
GitLabApiForm formData = new GitLabApiForm()
.withParam("scope", scope, false)
.withParam("page", page, false)
.withParam("per_page", perPage, f... |
python | def features(self):
"""All available features"""
mycols = []
for col in dfn.feature_names:
if col in self:
mycols.append(col)
mycols.sort()
return mycols |
java | private static HystrixThreadPoolKey initThreadPoolKey(HystrixThreadPoolKey threadPoolKey, HystrixCommandGroupKey groupKey, String threadPoolKeyOverride) {
if (threadPoolKeyOverride == null) {
// we don't have a property overriding the value so use either HystrixThreadPoolKey or HystrixCommandGroup
... |
java | public static List<String> readLines(String filename) {
List<String> lines = Lists.newArrayList();
try {
BufferedReader in = new BufferedReader(new FileReader(filename));
String line;
while ((line = in.readLine()) != null) {
// Ignore blank lines.
if (line.trim().length() > 0) ... |
java | public synchronized void bury(ProxyQueue queue)
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(tc, "bury");
// Get the proxy queue id
short id = queue.getId();
// Remove it from the table
mutableId.setValue(id);
idToProxyQueueMap.remov... |
python | def start_watching(self, cluster, callback):
"""
Initiates the "watching" of a cluster's associated znode.
This is done via kazoo's ChildrenWatch object. When a cluster's
znode's child nodes are updated, a callback is fired and we update
the cluster's `nodes` attribute based on... |
python | def req_with_ack(self, msg_type, payload, callb = None, timeout_secs=None, max_attempts=None):
"""Method to send a message expecting to receive an ACK.
:param msg_type: The type of the message to send, a subclass of aiolifx.Message
:type msg_type: class
:param payload: value... |
python | def create(self):
"""
create a SNAP7 client.
"""
logger.info("creating snap7 client")
self.library.Cli_Create.restype = c_void_p
self.pointer = S7Object(self.library.Cli_Create()) |
java | public AsyncFuture getFutureFromIndex(int theIndex) {
if (theIndex == READ_FUTURE_INDEX || theIndex == SYNC_READ_FUTURE_INDEX) {
return this.readFuture;
}
if (theIndex == WRITE_FUTURE_INDEX || theIndex == SYNC_WRITE_FUTURE_INDEX) {
return this.writeFuture;
}
... |
java | public Transient<EmbeddableAttributes<T>> getOrCreateTransient()
{
List<Node> nodeList = childNode.get("transient");
if (nodeList != null && nodeList.size() > 0)
{
return new TransientImpl<EmbeddableAttributes<T>>(this, "transient", childNode, nodeList.get(0));
}
return create... |
java | public static <K, V> ChronicleMapBuilder<K, V> of(
@NotNull Class<K> keyClass, @NotNull Class<V> valueClass) {
return new ChronicleMapBuilder<>(keyClass, valueClass);
} |
java | public static final <T extends BaseDateTime> Function<T[], Interval> baseDateTimeFieldArrayToInterval(DateTimeZone dateTimeZone) {
return FnInterval.baseDateTimeFieldArrayToInterval(dateTimeZone);
} |
python | def wp(ssid):
"""Show wifi password."""
if not ssid:
ok, err = _detect_wifi_ssid()
if not ok:
click.secho(click.style(err, fg='red'))
sys.exit(1)
ssid = err
ok, err = _hack_wifi_password(ssid)
if not ok:
click.secho(click.style(err, fg='red'))
... |
java | public static long min(long... numberArray) {
if (isEmpty(numberArray)) {
throw new IllegalArgumentException("Number array must not empty !");
}
long min = numberArray[0];
for (int i = 0; i < numberArray.length; i++) {
if (min > numberArray[i]) {
min = numberArray[i];
}
}
return min;
... |
java | public final void detachChildren() {
for (Node child = first; child != null;) {
Node nextChild = child.next;
child.parent = null;
child.next = null;
child.previous = null;
child = nextChild;
}
first = null;
} |
python | def get_events_df(self, num_items=100, params=None, columns=None, drop_columns=None, convert_ips=True):
"""
Get events as pandas DataFrame
:param int num_items: Max items to retrieve
:param dict params: Additional params dictionary according to:
https://www.alienvault.com/doc... |
python | def combine(self, other_sequence):
"""
If this sequence is the prefix of another sequence, combine
them into a single VariantSequence object. If the other sequence
is contained in this one, then add its reads to this VariantSequence.
Also tries to flip the order (e.g. this sequen... |
java | public void drawFrame(int textureId, float[] texMatrix) {
// Use the identity matrix for MVP so our 2x2 FULL_RECTANGLE covers the viewport.
mProgram.draw(IDENTITY_MATRIX, mRectDrawable.getVertexArray(), 0,
mRectDrawable.getVertexCount(), mRectDrawable.getCoordsPerVertex(),
... |
java | private void getDescendants(Entity entity, LdapEntry ldapEntry, DescendantControl descCtrl) throws WIMException {
if (descCtrl == null) {
return;
}
List<String> propNames = descCtrl.getProperties();
int level = descCtrl.getLevel();
List<String> descTypes = getEntityT... |
java | StructTypeID findStruct(String name) {
// walk through the list, searching. Not the most efficient way, but this
// in intended to be used rarely, so we keep it simple.
// As an optimization, we can keep a hashmap of record name to its RTI, for later.
for (FieldTypeInfo ti : typeInfos) {
if ((0 =... |
java | @Override
public <B extends Appendable> B format(Calendar calendar, final B buf) {
// do not pass in calendar directly, this will cause TimeZone of FastDatePrinter to be ignored
if(!calendar.getTimeZone().equals(mTimeZone)) {
calendar = (Calendar)calendar.clone();
calendar.se... |
python | def move(self, x = None, y = None, width = None, height = None,
bRepaint = True):
"""
Moves and/or resizes the window.
@note: This is request is performed syncronously.
@type x: int
@param x: (Optional) New horizontal... |
python | def get_score(self, member, default=None, pipe=None):
"""
Return the score of *member*, or *default* if it is not in the
collection.
"""
pipe = self.redis if pipe is None else pipe
score = pipe.zscore(self.key, self._pickle(member))
if (score is None) and (defaul... |
python | def identify(path_name, *, override=None, check_exists=True, default=ISDIR):
"""
Identify the type of a given path name (file or directory). If check_exists
is specified to be false, then the function will not set the identity based
on the path existing or not. If override is specified as either ISDIR o... |
python | def stop(self):
""" Stops the playing thread and close """
with self.lock:
self.halting = True
self.go.clear() |
python | def make_id():
''' Return a new unique ID for a Bokeh object.
Normally this function will return simple monotonically increasing integer
IDs (as strings) for identifying Bokeh objects within a Document. However,
if it is desirable to have globally unique for every object, this behavior
can be overr... |
java | public void normalize(Set<String> testNames, Map<String, Pair<Set<Test>, Set<Test>>> tests)
{
for (Pair<Set<Test>, Set<Test>> inOutTests : tests.values()) {
addNotApplicableTests(testNames, inOutTests.getLeft());
addNotApplicableTests(testNames, inOutTests.getRight());
}
... |
python | def parse_exio12_ext(ext_file, index_col, name, drop_compartment=True,
version=None, year=None, iosystem=None, sep=','):
""" Parse an EXIOBASE version 1 or 2 like extension file into pymrio.Extension
EXIOBASE like extensions files are assumed to have two
rows which are used as columns ... |
java | Object asJSON() {
final List<Object> json = new ArrayList<>();
for (Ordering ordering : orderings) { json.add(ordering.asJSON()); }
return json;
} |
java | public SignInResponse login(final LoginCredentials loginCreds){
logger.debug("login("+loginCreds+")");
try{
setLoginState(LOGGING_IN);
if(!loginCreds.isEncrypted()){
PublicKey key = Crypto.pubKeyFromBytes(getWebService().getPublicKey());
loginCred... |
java | private void writeCurrency()
{
ProjectProperties props = m_projectFile.getProjectProperties();
CurrencyType currency = m_factory.createCurrencyType();
m_apibo.getCurrency().add(currency);
String positiveSymbol = getCurrencyFormat(props.getSymbolPosition());
String negativeSymbol = "(" ... |
python | def remove_star(self, component=None, **kwargs):
"""
[NOT IMPLEMENTED]
Shortcut to :meth:`remove_component` but with kind='star'
"""
kwargs.setdefault('kind', 'star')
return self.remove_component(component, **kwargs) |
java | private ScanContext grab() throws ExecutionException, InterruptedException {
final Future<ScanContext> ret = exec.take();
final ScanRequest originalRequest = ret.get().getScanRequest();
final int segment = originalRequest.getSegment();
final ScanSegmentWorker sw = workers[segment];
... |
java | public void marshall(ListFunctionDefinitionsRequest listFunctionDefinitionsRequest, ProtocolMarshaller protocolMarshaller) {
if (listFunctionDefinitionsRequest == null) {
throw new SdkClientException("Invalid argument passed to marshall(...)");
}
try {
protocolMarshalle... |
python | def encrypt_file(self,
path,
output_path=None,
overwrite=False,
stream=True,
enable_verbose=True,
**kwargs):
"""
Encrypt a file. If output_path are not given, then try to use the... |
java | public void marshall(DeprecateWorkflowTypeRequest deprecateWorkflowTypeRequest, ProtocolMarshaller protocolMarshaller) {
if (deprecateWorkflowTypeRequest == null) {
throw new SdkClientException("Invalid argument passed to marshall(...)");
}
try {
protocolMarshaller.mars... |
python | def learnTransitions(self):
"""
Train the location layer to do path integration. For every location, teach
it each previous-location + motor command pair.
"""
print "Learning transitions"
for (i, j), locationSDR in self.locations.iteritems():
print "i, j", (i, j)
for (di, dj), trans... |
java | public static DateFormat getInstance() {
if (instance == null) {
synchronized (instanceLock) {
if (instance == null) {
instance = new ResqueDateFormatThreadLocal();
}
}
}
return instance.get();
} |
java | public synchronized static Session getSession() {
if(session == null){
Properties properties = IOUtil.loadProperties("jdbc.properties");
session = getSession(properties);
}
return session;
} |
python | def get(self, vehicle_id, command, wake_if_asleep=False):
# pylint: disable=unused-argument
"""Send get command to the vehicle_id.
This is a wrapped function by wake_up.
Parameters
----------
vehicle_id : string
Identifier for the car on the owner-api endpo... |
python | def encoder_decoder_split(self, dialogues):
"""
For now, this assumes a flat (non-hierarchical) model, and therefore
assumes that dialogues are simply adjacency pairs.
"""
self.log('info', 'Making encoder decoder split ...')
# get start, stop, and pad symbols
start = self.pr... |
python | def _process_msg(self, client, state, reward, isOver):
"""
Process a message sent from some client.
"""
# in the first message, only state is valid,
# reward&isOver should be discarded
if len(client.memory) > 0:
client.memory[-1].reward = reward
if... |
java | public static TimeZone getTimeZone(String id) {
if (id == null) {
throw new NullPointerException("id == null");
}
// Special cases? These can clone an existing instance.
if (id.length() == 3) {
if (id.equals("GMT")) {
return (TimeZone) GMTHolder.I... |
python | def send_chat_action(
self,
chat_id: Union[int, str],
action: Union[ChatAction, str],
progress: int = 0
):
"""Use this method when you need to tell the other party that something is happening on your side.
Args:
chat_id (``int`` | ``str``):
... |
python | def OD(ND):
"""Return a pipe's outer diameter according to its nominal diameter.
The pipe schedule is not required here because all of the pipes of a
given nominal diameter have the same outer diameter.
Steps:
1. Find the index of the closest nominal diameter.
(Should this be changed to fin... |
java | public static void main(String[] args) {
SparkSession spark = SparkSession
.builder()
.appName("Java Spark SQL user-defined Datasets aggregation example")
.getOrCreate();
// $example on:typed_custom_aggregation$
Encoder<Employee> employeeEncoder = Encoders.bean(Employee.class);
String... |
java | public Datatype.Builder setBuilderSerializable(boolean builderSerializable) {
this.builderSerializable = builderSerializable;
_unsetProperties.remove(Property.BUILDER_SERIALIZABLE);
return (Datatype.Builder) this;
} |
java | public void dequeueUser(EntityJid userID) throws XMPPException, NotConnectedException, InterruptedException {
// todo: this method simply won't work right now.
DepartQueuePacket departPacket = new DepartQueuePacket(workgroupJID, userID);
// PENDING
this.connection.sendStanza(departPacke... |
python | def add_altitude(self, altitude, precision=100):
"""Add altitude (pre is the precision)."""
ref = 0 if altitude > 0 else 1
self._ef["GPS"][piexif.GPSIFD.GPSAltitude] = (
int(abs(altitude) * precision), precision)
self._ef["GPS"][piexif.GPSIFD.GPSAltitudeRef] = ref |
python | def manager_view(request, managerTitle):
''' View the details of a manager position.
Parameters:
request is an HTTP request
managerTitle is the URL title of the manager.
'''
targetManager = get_object_or_404(Manager, url_title=managerTitle)
if not targetManager.active:
messa... |
java | public Any execute(DeviceImpl device,Any in_any) throws DevFailed
{
Util.out4.println("State::execute(): arrived");
//
// return state in a CORBA_Any
//
Any out_any = Util.instance().get_orb().create_any();
DevState sta = device.dev_state();
DevStateHelper.insert(out_any,sta);
Util.out4.println("Leav... |
java | @Override
public Temporal subtractFrom(Temporal temporal) {
if (months != 0) {
temporal = temporal.minus(months, MONTHS);
}
return temporal;
} |
java | public static Rect unflattenFromString(String str) {
Matcher matcher = FLATTENED_PATTERN.matcher(str);
if (!matcher.matches()) {
return null;
}
return new Rect(Integer.parseInt(matcher.group(1)),
Integer.parseInt(matcher.group(2)),
Integer.pars... |
python | def kill(self, sig=signal.SIGTERM):
"""
Terminate the test job.
Kill the subprocess if it was spawned, abort the spawning
process otherwise. This information can be collected afterwards
by reading the self.killed and self.spawned flags.
Also join the 3 related threads t... |
java | public boolean isSet(int bit) {
int bite = byteForBit(bit);
if (bite >= bits.length || bits.length == 0) {
return false;
}
int bitOnByte = bitOnByte(bit, bite);
return ((1 << bitOnByte) & bits[bite]) != 0;
} |
python | def realtime_updates(self):
"""
fetch realtime events from docker and pass them to buffers
:return: None
"""
# TODO: make this available for every buffer
logger.info("starting receiving events from docker")
it = self.d.realtime_updates()
while True:
... |
java | public static RepositoryPackage fromPackageRepository(File input) throws IOException, ParseException {
PackageRepository repo = new PackageRepository(input);
return repo.getPackage();
} |
python | def escape(arg):
"escape shell special characters"
slash = '\\'
special = '"$'
arg = arg.replace(slash, slash+slash)
for c in special:
arg = arg.replace(c, slash+c)
# print("ESCAPE RESULT: %s" % arg)
return '"' + arg + '"' |
python | def configure_logging():
'''Configures the root logger for command line applications.
Two stream handlers will be added to the logger:
* "out" that will direct INFO & DEBUG messages to the standard output
stream
* "err" that will direct WARN, WARNING, ERROR, & CRITICAL messages to
... |
java | private void validateFilter(Filter filter) throws IllegalArgumentException {
switch (filter.getFilterTypeCase()) {
case COMPOSITE_FILTER:
for (Filter subFilter : filter.getCompositeFilter().getFiltersList()) {
validateFilter(subFilter);
}
break;
case PROPERTY_FILTER:
... |
python | def htmlDocContentDumpOutput(self, cur, encoding):
"""Dump an HTML document. Formating return/spaces are added. """
if cur is None: cur__o = None
else: cur__o = cur._o
libxml2mod.htmlDocContentDumpOutput(self._o, cur__o, encoding) |
java | public SIBUuid8 getSystemMessageSourceUuid() {
byte[] b = (byte[]) jmo.getField(JsHdrAccess.SYSTEMMESSAGESOURCEUUID);
if (b != null)
return new SIBUuid8(b);
return null;
} |
java | public static PackageSummaryBuilder getInstance(Context context,
PackageElement pkg, PackageSummaryWriter packageWriter) {
return new PackageSummaryBuilder(context, pkg, packageWriter);
} |
java | private LinkedList<TimephasedWork> readTimephasedAssignment(ProjectCalendar calendar, Project.Assignments.Assignment assignment, int type)
{
LinkedList<TimephasedWork> result = new LinkedList<TimephasedWork>();
for (TimephasedDataType item : assignment.getTimephasedData())
{
if (NumberHel... |
python | def cmd_subset(
self,
tgt,
fun,
arg=(),
tgt_type='glob',
ret='',
kwarg=None,
sub=3,
cli=False,
progress=False,
full_return=False,
**kwargs):
'''
Execute a comma... |
python | def close(self):
"""Close any open channels."""
self.consumer.close()
self.publisher.close()
self._closed = True |
java | public EEnum getIfcChangeActionEnum() {
if (ifcChangeActionEnumEEnum == null) {
ifcChangeActionEnumEEnum = (EEnum) EPackage.Registry.INSTANCE.getEPackage(Ifc2x3tc1Package.eNS_URI)
.getEClassifiers().get(792);
}
return ifcChangeActionEnumEEnum;
} |
java | public CouldBeReloadableDecision couldBeReloadable(String slashedName, boolean usePackageNameDecisionCache) {
if (slashedName == null) {
return CouldBeReloadableDecision.No_BuiltIn;
}
if (slashedName.startsWith("java/")) {
return CouldBeReloadableDecision.No_BuiltIn;
}
char ch = slashedName.charAt(0);
... |
python | def generateImplicitParameters(obj):
"""
Generate a UID if one does not exist.
This is just a dummy implementation, for now.
"""
if not hasattr(obj, 'uid'):
rand = int(random.random() * 100000)
now = datetime.datetime.now(utc)
now = dateTimeTo... |
java | final String debugSchema(JMFSchema schema) {
if (schema != null)
return schema.getName() + "(" + debugId(schema.getID()) + ")";
else
return "<null>";
} |
java | public void marshall(CloudWatchAlarmDefinition cloudWatchAlarmDefinition, ProtocolMarshaller protocolMarshaller) {
if (cloudWatchAlarmDefinition == null) {
throw new SdkClientException("Invalid argument passed to marshall(...)");
}
try {
protocolMarshaller.marshall(clou... |
python | def write(self, filename, format='tar'):
"""
Write template.
:type filename: str
:param filename:
Filename to write to, if it already exists it will be opened and
appended to, otherwise it will be created.
:type format: str
:param format:
... |
java | public static BindingResult bindObjectToInstance(Object object, Object source) {
return bindObjectToInstance(object, source, getBindingIncludeList(object), Collections.emptyList(), null);
} |
java | public void analyzeSelectStmt()
throws EFapsException
{
final Pattern mainPattern = Pattern.compile("[^.]+");
final Pattern attrPattern = Pattern.compile("(?<=\\[)[0-9a-zA-Z_]*(?=\\])");
final Pattern esjpPattern = Pattern.compile("(?<=\\[)[\\w\\d\\s,.\"]*(?=\\])");
final Pat... |
java | public void unregisterTaskManager(InstanceID instanceId, boolean terminated){
Instance instance = registeredHostsById.get(instanceId);
if (instance != null){
registeredHostsById.remove(instance.getId());
registeredHostsByResource.remove(instance.getTaskManagerID());
if (terminated) {
deadHosts.add(in... |
python | def do_forceescape(value):
"""Enforce HTML escaping. This will probably double escape variables."""
if hasattr(value, '__html__'):
value = value.__html__()
return escape(unicode(value)) |
java | public InlineResponse2002 peek(String subscriptionId) throws ApiException {
ApiResponse<InlineResponse2002> resp = peekWithHttpInfo(subscriptionId);
return resp.getData();
} |
python | def diff_values(value_a, value_b, raw=False):
"""Returns a human-readable diff between two values
:param value_a: First value to compare
:param value_b: Second value to compare
:param raw: True to compare the raw values, e.g. UIDs
:returns a list of diff tuples
"""
if not raw:
valu... |
java | public void signalReady() {
Map<String, String> hostTags = this.ec2Context.getInstanceTags();
this.signalReady(hostTags.get(TAG_CLOUDFORMATION_STACK_NAME), hostTags.get(TAG_CLOUDFORMATION_LOGICAL_ID));
} |
python | def treewidth_branch_and_bound(G, elimination_order=None, treewidth_upperbound=None):
"""Computes the treewidth of graph G and a corresponding perfect elimination ordering.
Parameters
----------
G : NetworkX graph
The graph on which to compute the treewidth and perfect elimination ordering.
... |
python | def _getitem_via_pathlist(external_dict,path_list,**kwargs):
'''
y = {'c': {'b': 200}}
_getitem_via_pathlist(y,['c','b'])
'''
if('s2n' in kwargs):
s2n = kwargs['s2n']
else:
s2n = 0
if('n2s' in kwargs):
n2s = kwargs['n2s']
else:
n2s = 0
this = e... |
python | def generate(self, N, *, seed=None, progressbar=False):
"""
Return sequence of `N` elements.
If `seed` is not None, the generator is reset
using this seed before generating the elements.
"""
if seed is not None:
self.reset(seed)
items = islice(self, N... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.