language stringclasses 2
values | func_code_string stringlengths 63 466k |
|---|---|
java | Map<UUID, CacheBucketOffset> getTailHashes(long segmentId) {
return forSegmentCache(segmentId, SegmentKeyCache::getTailBucketOffsets, Collections.emptyMap());
} |
python | def _send(self, message):
"""
Given a message, publish to this topic.
"""
message['command'] = 'zappa.asynchronous.route_sns_task'
payload = json.dumps(message).encode('utf-8')
if len(payload) > LAMBDA_ASYNC_PAYLOAD_LIMIT: # pragma: no cover
raise AsyncExcepti... |
java | protected void quickSearch() {
if ((m_quickSearch != null) && CmsStringUtil.isNotEmptyOrWhitespaceOnly(m_quickSearch.getFormValueAsString())) {
getTabHandler().setSearchQuery(m_quickSearch.getFormValueAsString());
getTabHandler().selectResultTab();
}
} |
python | def sh2(cmd):
"""Execute command in a subshell, return stdout.
Stderr is unbuffered from the subshell.x"""
p = Popen(cmd, stdout=PIPE, shell=True, env=sub_environment())
out = p.communicate()[0]
retcode = p.returncode
if retcode:
raise CalledProcessError(retcode, cmd)
else:
... |
python | def _priority_from_env(self, val):
"""Gets priority pairs from env."""
for part in val.split(':'):
try:
rule, priority = part.split('=')
yield rule, int(priority)
except ValueError:
continue |
python | def derivatives(self, x, y, coeffs, beta, center_x=0, center_y=0):
"""
returns df/dx and df/dy of the function
"""
shapelets = self._createShapelet(coeffs)
r, phi = param_util.cart2polar(x, y, center=np.array([center_x, center_y]))
alpha1_shapelets, alpha2_shapelets = sel... |
java | public Long getRecordIdFromObject(final UUID objectId, final ObjectType objectType, final TenantContext context) {
try {
if (objectBelongsToTheRightTenant(objectId, objectType, context)) {
return nonEntityDao.retrieveRecordIdFromObject(objectId, objectType, recordIdCacheController);
... |
java | public void setTargetedMobileDevices(com.google.api.ads.admanager.axis.v201805.Technology[] targetedMobileDevices) {
this.targetedMobileDevices = targetedMobileDevices;
} |
java | public com.google.api.ads.admanager.axis.v201902.MobileDeviceSubmodelTargeting getMobileDeviceSubmodelTargeting() {
return mobileDeviceSubmodelTargeting;
} |
java | public List<FacesConfigReferencedBeanType<FacesConfigType<T>>> getAllReferencedBean()
{
List<FacesConfigReferencedBeanType<FacesConfigType<T>>> list = new ArrayList<FacesConfigReferencedBeanType<FacesConfigType<T>>>();
List<Node> nodeList = childNode.get("referenced-bean");
for(Node node: nodeList)... |
java | private String doOCR(IIOImage oimage, String filename, Rectangle rect, int pageNum) throws TesseractException {
String text = "";
try {
setImage(oimage.getRenderedImage(), rect);
text = getOCRText(filename, pageNum);
} catch (IOException ioe) {
// skip... |
python | def iterrows(self):
"""
Iterate over DataFrame rows as (index, Series) pairs.
Yields
------
index : label or tuple of label
The index of the row. A tuple for a `MultiIndex`.
data : Series
The data of the row as a Series.
it : generator
... |
python | def gesture(self, start1, start2, *args, **kwargs):
'''
perform two point gesture.
Usage:
d().gesture(startPoint1, startPoint2).to(endPoint1, endPoint2, steps)
d().gesture(startPoint1, startPoint2, endPoint1, endPoint2, steps)
'''
def to(obj_self, end1, end2, step... |
python | def update_port_precommit(self, context):
"""Adds port profile and vlan information to the DB.
Assign a port profile to this port. To do that:
1. Get the vlan_id associated with the bound segment
2. Check if a port profile already exists for this vlan_id
3. If yes, associate tha... |
java | public final Certificate[] getCertificateChain(String alias)
throws KeyStoreException
{
if (!initialized) {
throw new KeyStoreException("Uninitialized keystore");
}
return keyStoreSpi.engineGetCertificateChain(alias);
} |
java | @Initialize
public void init() {
logger.info("Initializing dictionary: {}", this);
Datastore datastore = getDatastore();
DatastoreConnection dataContextProvider = datastore.openConnection();
getDatastoreConnections().add(dataContextProvider);
} |
python | def _coerce_scalar_to_index(self, item):
"""
We need to coerce a scalar to a compat for our index type.
Parameters
----------
item : scalar item to coerce
"""
dtype = self.dtype
if self._is_numeric_dtype and isna(item):
# We can't coerce to t... |
java | public void setTileMatrixSet(TileMatrixSet tileMatrixSet) {
this.tileMatrixSet = tileMatrixSet;
if (tileMatrixSet != null) {
tileMatrixSetName = tileMatrixSet.getTableName();
} else {
tileMatrixSetName = null;
}
} |
java | public void marshall(EnableSharingWithAwsOrganizationRequest enableSharingWithAwsOrganizationRequest, ProtocolMarshaller protocolMarshaller) {
if (enableSharingWithAwsOrganizationRequest == null) {
throw new SdkClientException("Invalid argument passed to marshall(...)");
}
try {
... |
python | def linearToPolar(img, center=None,
final_radius=None,
initial_radius=None,
phase_width=None,
interpolation=cv2.INTER_AREA, maps=None,
borderValue=0, borderMode=cv2.BORDER_REFLECT, **opts):
'''
map a 2d (x,y) Cartes... |
java | public static com.liferay.commerce.price.list.model.CommercePriceList addCommercePriceList(
com.liferay.commerce.price.list.model.CommercePriceList commercePriceList) {
return getService().addCommercePriceList(commercePriceList);
} |
java | private boolean isSingleHeteroAtom(IAtom atom, IAtomContainer container) {
List<IAtom> connected = container.getConnectedAtomsList(atom);
for (IAtom atom1 : connected) {
boolean aromatic = container.getBond(atom, atom1).isAromatic();
// ignoring non-aromatic bonds
... |
python | def add_host(mac, name=None, ip=None, ddns=False, group=None,
supersede_host=False):
'''
Add a host object for the given mac.
CLI Example:
.. code-block:: bash
salt dhcp-server omapi.add_host ab:ab:ab:ab:ab:ab name=host1
Add ddns-hostname and a fixed-ip statements:
.. code-b... |
java | public static void shuffle(short[] shortArray) {
int swapPlace = -1;
for(int i = 0; i < shortArray.length; i++) {
swapPlace = (int) (Math.random() * (shortArray.length - 1 ));
XORSwap.swap(shortArray, i, swapPlace);
}
} |
python | def runner(Options, buffering=True):
"""
Return a standard "run" function that wraps an Options class
If buffering=False, turn off stdout/stderr buffering for this process
"""
def run(argv=None):
if not buffering:
sys.stdout = os.fdopen(sys.stdout.fileno(), 'w', 0)
s... |
java | public boolean complete(Date value) {
return root.complete(new Tree((Tree) null, null, value));
} |
python | def get_bootdev(self):
"""Get current boot device override information.
:raises: PyghmiException on error
:returns: dict
"""
result = self._do_web_request(self.sysurl)
overridestate = result.get('Boot', {}).get(
'BootSourceOverrideEnabled', None)
if o... |
java | public URI resolveUri(URI targetUri, URI srcOrigUri, URI srcId) {
if(targetUri.isAbsolute()) {
return targetUri;
} else if(srcOrigUri==null || !srcOrigUri.isAbsolute()) {
return targetUri;
} else {
return srcOrigUri.resolve(targetUri);
}
} |
java | public void setExecutionSummaries(java.util.Collection<JobExecutionSummaryForJob> executionSummaries) {
if (executionSummaries == null) {
this.executionSummaries = null;
return;
}
this.executionSummaries = new java.util.ArrayList<JobExecutionSummaryForJob>(executionSumma... |
python | def get_symmetrized_structure(self):
"""
Get a symmetrized structure. A symmetrized structure is one where the
sites have been grouped into symmetrically equivalent groups.
Returns:
:class:`pymatgen.symmetry.structure.SymmetrizedStructure` object.
"""
ds = se... |
java | private Map<KeyRange, ServerName> normalizeKeyBounds(NavigableMap<HRegionInfo, ServerName> raw) {
Map.Entry<HRegionInfo, ServerName> nullStart = null;
Map.Entry<HRegionInfo, ServerName> nullEnd = null;
ImmutableMap.Builder<KeyRange, ServerName> b = ImmutableMap.builder();
for (Map.Ent... |
python | def mst(infile, spec_name='unknown', dir_path=".", input_dir_path="",
meas_file="measurements.txt", samp_infile="samples.txt",
user="", specnum=0, samp_con="1", labfield=0.5,
location='unknown', syn=False, data_model_num=3):
"""
Convert MsT data (T,M) to MagIC measurements format files
... |
java | public List processNack(ControlNack nm)
throws SIResourceException
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.entry(tc, "processNack", new Object[] { nm, Boolean.valueOf(false) });
boolean sendPending = false;
ArrayList sendList ... |
java | public String writeStringField() {
final List<String> strs = Lists.newArrayList();
if (sub_expressions != null) {
for (ExpressionTree sub : sub_expressions) {
strs.add(sub.toString());
}
}
if (sub_metric_queries != null) {
final String sub_metrics = clean(sub_metric_queries.va... |
python | def shell(script=None, args=()):
"""
Start an embedded (i)python instance with a global object "o" or
run a Python script in the engine environment.
"""
if script:
sys.argv = sys.argv[2:] # strip ['oq', 'shell']
runpy.run_path(script, run_name='__main__')
return
o = Open... |
python | def srem_if_not_exists(self, key, member, other_key, client=None):
"""
Removes ``member`` from the set ``key`` if ``other_key`` does not
exist (i.e. is empty). Returns the number of removed elements (0 or 1).
"""
return self._srem_if_not_exists(
keys=[key, other_key],... |
python | def findsource(object):
"""Return the entire source file and starting line number for an object.
The argument may be a module, class, method, function, traceback, frame,
or code object. The source code is returned as a list of all the lines
in the file and the line number indexes a line in that list. ... |
python | def parse_longitude(longitude, hemisphere):
"""Parse a NMEA-formatted longitude pair.
Args:
longitude (str): Longitude in DDDMM.MMMM
hemisphere (str): East or West
Returns:
float: Decimal representation of longitude
"""
longitude = int(longitude[:3]) + float(longitude[3:]) ... |
python | def dht_get(self, key, *keys, **kwargs):
"""Queries the DHT for its best value related to given key.
There may be several different values for a given key stored in the
DHT; in this context *best* means the record that is most desirable.
There is no one metric for *best*: it depends ent... |
java | public static transformpolicy_binding get(nitro_service service, String name) throws Exception{
transformpolicy_binding obj = new transformpolicy_binding();
obj.set_name(name);
transformpolicy_binding response = (transformpolicy_binding) obj.get_resource(service);
return response;
} |
java | public OvhAlias serviceName_output_elasticsearch_alias_aliasId_GET(String serviceName, String aliasId) throws IOException {
String qPath = "/dbaas/logs/{serviceName}/output/elasticsearch/alias/{aliasId}";
StringBuilder sb = path(qPath, serviceName, aliasId);
String resp = exec(qPath, "GET", sb.toString(), null);
... |
python | def base_type(self, value):
"""The base_type property.
Args:
value (string). the property value.
"""
if value == self._defaults['baseType'] and 'baseType' in self._values:
del self._values['baseType']
else:
self._values['baseType'] = v... |
java | @Override
public synchronized void delete(int type, String url) throws DatabaseException {
try {
psDeleteUrls.setInt(1, type);
psDeleteUrls.setString(2, url);
psDeleteUrls.executeUpdate();
} catch (SQLException e) {
throw new DatabaseException(e);
}
} |
java | public void duplicateAndMunge (String pattern, String... replace)
{
Pattern pat = makePattern(pattern);
HashSet<String> toMunge = Sets.newHashSet();
for (String name : _imports) {
if (pat.matcher(name).matches()) {
toMunge.add(name);
}
}
... |
java | private int precisionSum(List<UnitFactor> factors) {
return factors.stream().map(f -> totalPrecision(f.rational())).reduce(0, Math::addExact);
} |
java | public Token findVerb(Sentence sentence) {
List<SyntacticChunk> syntChunks = sentence.getSyntacticChunks();
for (int i = 0; i < syntChunks.size(); i++) {
String tag = syntChunks.get(i).getTag();
if (tag.equals("P") || tag.equals("MV") || tag.equals("PMV")
|| tag.equals("AUX") || tag.equa... |
java | @SuppressWarnings("unchecked")
// <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
private void initComponents() {
java.awt.GridBagConstraints gridBagConstraints;
jPanel1 = new javax.swing.JPanel();
jScrollPane1 = new javax.swing.JScrollPane()... |
java | public void loadSystemProperties(String configurationKey) {
String propertyRef = getProperty(configurationKey);
if (propertyRef == null) {
return;
}
if (propertyRef.startsWith("env:")) {
propertyRef = propertyRef.substring(4);
propertyRef = System.get... |
python | def removeFileSafely(filename,clobber=True):
""" Delete the file specified, but only if it exists and clobber is True.
"""
if filename is not None and filename.strip() != '':
if os.path.exists(filename) and clobber: os.remove(filename) |
python | def byte_str(nBytes, unit='bytes', precision=2):
"""
representing the number of bytes with the chosen unit
Returns:
str
"""
#return (nBytes * ureg.byte).to(unit.upper())
if unit.lower().startswith('b'):
nUnit = nBytes
elif unit.lower().startswith('k'):
nUnit = nByte... |
java | public void updateNoDraw() {
if (autoUpdate) {
long now = getTime();
long delta = now - lastUpdate;
if (firstUpdate) {
delta = 0;
firstUpdate = false;
}
lastUpdate = now;
nextFrame(delta);
}
} |
java | public List<InstanceStateChangeType> stopInstances(final Set<String> instanceIDs) {
List<InstanceStateChangeType> ret = new ArrayList<InstanceStateChangeType>();
Collection<AbstractMockEc2Instance> instances = getInstances(instanceIDs);
for (AbstractMockEc2Instance instance : instances) {
... |
java | public SDElement addSDParam(String paramName, String paramValue) {
return addSDParam(new SDParam(paramName, paramValue));
} |
python | def set_guid(self):
"""Parses guid and set value"""
try:
self.guid = self.soup.find('guid').string
except AttributeError:
self.guid = None |
python | def _collect_peers_of_interest(self, new_best_path):
"""Collect all peers that qualify for sharing a path with given RTs.
"""
path_rts = new_best_path.get_rts()
qualified_peers = set(self._peers.values())
# Filter out peers based on RTC_AS setting if path is for RT_NLRI
... |
java | public void pullUpTo(Phase phase)
{
for (Binding<?, ?, V> binding : bindings)
{
binding.pullUpTo(phase);
}
} |
python | def lift(fn=None, state_fn=None):
"""
The lift decorator function will be used to abstract away the management
of the state object used as the intermediate representation of actions.
:param function answer: a function to provide
the result of some action given a value
:p... |
python | def start_ckan(self, production=False, log_syslog=False, paster_reload=True,
interactive=False):
"""
Start the apache server or paster serve
:param log_syslog: A flag to redirect all container logs to host's syslog
:param production: True for apache, False for paster ... |
java | public static CharSequence expandTemplate(CharSequence template,
CharSequence... values) {
if (values.length > 9) {
throw new IllegalArgumentException("max of 9 values are supported");
}
SpannableStringBuilder ssb = new SpannableStringBu... |
python | def sort_func(variant=VARIANT1, case_sensitive=False):
"""A function generator that can be used for sorting.
All keywords are passed to `normalize()` and generate keywords that
can be passed to `sorted()`::
>>> key = sort_func()
>>> print(sorted(["fur", "far"], key=key))
[u'far', u'fur']... |
python | def get_meta(self):
"""Get the metadata object for this Point
Returns a [PointMeta](PointMeta.m.html#IoticAgent.IOT.PointMeta.PointMeta) object - OR -
Raises [IOTException](./Exceptions.m.html#IoticAgent.IOT.Exceptions.IOTException)
containing the error if the infrastructure detects a ... |
python | def unlink(self):
"""
Overrides orm unlink method.
@param self: The object pointer
@return: True/False.
"""
hotel_room_reserv_line_obj = self.env['hotel.room.reservation.line']
for reserv_rec in self:
for rec in reserv_rec.reserve:
hres... |
java | private static String prepareWindowsCommand(List<String> cmd, Map<String, String> childEnv) {
StringBuilder cmdline = new StringBuilder();
for (Map.Entry<String, String> e : childEnv.entrySet()) {
cmdline.append(String.format("set %s=%s", e.getKey(), e.getValue()));
cmdline.append(" && ");
}
... |
python | def eta_bar(msg, max_value):
"""Display an adaptive ETA / countdown bar with a message.
Parameters
----------
msg: str
Message to prefix countdown bar line with
max_value: max_value
The max number of progress bar steps/updates
"""
widgets = [
"{msg}:".format(msg=ms... |
java | public void addTerm(Term term) {
// 是否有数字
if (!hasNum && term.termNatures().numAttr.numFreq > 0) {
hasNum = true;
}
// 是否有人名
if (!hasPerson && term.termNatures().personAttr.flag) {
hasPerson = true;
}
TermUtil.insertTerm(terms, term, Insert... |
java | public Promise waitForServices(long timeoutMillis, String... services) {
return waitForServices(timeoutMillis, Arrays.asList(services));
} |
python | def from_custom_template(cls, searchpath, name):
"""
Factory function for creating a subclass of ``Styler``
with a custom template and Jinja environment.
Parameters
----------
searchpath : str or list
Path or paths of directories containing the templates
... |
java | @SuppressWarnings("unchecked")
@Override
public EList<IfcRelInterferesElements> getIsInterferedByElements() {
return (EList<IfcRelInterferesElements>) eGet(Ifc4Package.Literals.IFC_ELEMENT__IS_INTERFERED_BY_ELEMENTS,
true);
} |
java | public int complete(final String buffer, final int cursor, final List<CharSequence> candidates) {
// buffer could be null
checkNotNull(candidates);
List<Completion> completions = new ArrayList<Completion>(completers.size());
// Run each completer, saving its completion results
... |
python | def _call_marginalizevlos(self,o,integrate_method='dopr54_c',**kwargs):
"""Call the DF, marginalizing over line-of-sight velocity"""
#Get d, l, vperp
l= o.ll(obs=[1.,0.,0.],ro=1.)*_DEGTORAD
vperp= o.vll(ro=1.,vo=1.,obs=[1.,0.,0.,0.,0.,0.])
R= o.R(use_physical=False)
phi= ... |
java | public static String getPrivateKey(Map<String, Object> keyMap) throws Exception {
Key key = (Key) keyMap.get(PRIVATE_KEY);
return String.valueOf(Base64Utils.encode(key.getEncoded()));
} |
python | def _handle_successor(self, job, successor, successors):
"""
Returns a new CFGJob instance for further analysis, or None if there is no immediate state to perform the
analysis on.
:param CFGJob job: The current job.
"""
state = successor
all_successor_states = s... |
python | def DeleteMetricDescriptor(self, request, context):
"""Deletes a metric descriptor. Only user-created
[custom metrics](/monitoring/custom-metrics) can be deleted.
"""
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
context.set_details("Method not implemented!")
raise NotImplement... |
python | def add_column(filename,column,formula,force=False):
""" Add a column to a FITS file.
ADW: Could this be replaced by a ftool?
"""
columns = parse_formula(formula)
logger.info("Running file: %s"%filename)
logger.debug(" Reading columns: %s"%columns)
data = fitsio.read(filename,columns=colum... |
python | def set_query_params(self, query_params):
'''Set the query parameters.
The query parameters should be a dictionary mapping keys to
strings or lists of strings.
:param query_params: query parameters
:type query_params: ``name |--> (str | [str])``
:rtype: :class:`Queryabl... |
java | static <K, V> SerializationProxy<K, V> makeSerializationProxy(
BoundedLocalCache<?, ?> cache, boolean isWeighted) {
SerializationProxy<K, V> proxy = new SerializationProxy<>();
proxy.weakKeys = cache.collectKeys();
proxy.weakValues = cache.nodeFactory.weakValues();
proxy.softValues = cache.nodeFac... |
java | public Policies withOtherPolicies(String... otherPolicies) {
if (this.otherPolicies == null) {
setOtherPolicies(new com.amazonaws.internal.SdkInternalList<String>(otherPolicies.length));
}
for (String ele : otherPolicies) {
this.otherPolicies.add(ele);
}
r... |
java | @Override
public boolean offer(T t) {
if (t == null) {
throw new IllegalArgumentException();
}
boolean ret = false;
synchronized (lock) {
if (t instanceof QueueItem && ((QueueItem) t).isExpedited()) {
if (numberOfUsedExpeditedSlots.get() < ex... |
python | def next(self):
"""
Returns the next row from the Instances object.
:return: the next Instance object
:rtype: Instance
"""
if self.row < self.data.num_instances:
index = self.row
self.row += 1
return self.data.get_instance(index)
... |
java | public ApiResponse<List<CharacterAssetsResponse>> getCharactersCharacterIdAssetsWithHttpInfo(Integer characterId,
String datasource, String ifNoneMatch, Integer page, String token) throws ApiException {
com.squareup.okhttp.Call call = getCharactersCharacterIdAssetsValidateBeforeCall(characterId, dat... |
python | def wait_for_compactions(self, timeout=600):
"""
Wait for all compactions to finish on all nodes.
"""
for node in list(self.nodes.values()):
if node.is_running():
node.wait_for_compactions(timeout)
return self |
java | public <T extends TextView> T searchFor(final Class<T> viewClass, final String regex, int expectedMinimumNumberOfMatches, final long timeout, final boolean scroll, final boolean onlyVisible) {
if(expectedMinimumNumberOfMatches < 1) {
expectedMinimumNumberOfMatches = 1;
}
final Callable<Collection<T>> viewFetc... |
java | public static MozuUrl updateTaxableTerritoriesUrl()
{
UrlFormatter formatter = new UrlFormatter("/api/commerce/settings/general/taxableterritories");
return new MozuUrl(formatter.getResourceUrl(), MozuUrl.UrlLocation.TENANT_POD) ;
} |
python | def logger_usage(client, to_delete):
"""Logger usage."""
LOG_NAME = "logger_usage_%d" % (_millis())
# [START logger_create]
logger = client.logger(LOG_NAME)
# [END logger_create]
to_delete.append(logger)
# [START logger_log_text]
logger.log_text("A simple entry") # API call
# [END... |
python | def knuth_sum(a, b):
"""Error-free transformation of the sum of two floating point numbers
according to
D.E. Knuth.
The Art of Computer Programming: Seminumerical Algorithms, volume 2.
Addison Wesley, Reading, Massachusetts, second edition, 1981.
The underlying problem is that the exact sum a+... |
java | @Override
public ComponentDef createComponentDef(Class<?> componentClass) {
final ComponentDef componentDef = prepareComponentDef(componentClass);
if (componentDef == null) {
return null;
}
checkExtendsAction(componentDef);
checkWebReference(componentDef);
... |
python | def format_help(self, formatter):
"""
Format an option group's help text, outdenting the title so it's
flush with the "SCons Options" title we print at the top.
"""
formatter.dedent()
result = formatter.format_heading(self.title)
formatter.indent()
result ... |
java | public static <E> boolean every(Iterator<E> iterator, Predicate<E> predicate) {
return new Every<E>(predicate).test(iterator);
} |
java | protected NodeList getTagChildren(String tagName, Element element) {
return element.getNamespaceURI() == null ? element.getElementsByTagName(tagName) : element.getElementsByTagNameNS(
element.getNamespaceURI(), tagName);
} |
python | def drop_id_validate(data, schema):
"""
Custom validation function which drops parameter '_id' if present
in data
"""
jsonschema.validate(data, schema)
if data.get('_id') is not None:
del data['_id'] |
java | public DeleteMarkerReplication withStatus(DeleteMarkerReplicationStatus status) {
setStatus(status == null ? null : status.toString());
return this;
} |
python | def _msg_create_line(self, msg, data, key):
"""Create a new line to the Quickview."""
ret = []
ret.append(self.curse_add_line(msg))
ret.append(self.curse_add_line(data.pre_char, decoration='BOLD'))
ret.append(self.curse_add_line(data.get(), self.get_views(key=key, option='decora... |
python | def ani_depthplot2(ani_file='rmag_anisotropy.txt', meas_file='magic_measurements.txt', samp_file='er_samples.txt', age_file=None, sum_file=None, fmt='svg', dmin=-1, dmax=-1, depth_scale='sample_core_depth', dir_path='.'):
"""
returns matplotlib figure with anisotropy data plotted against depth
available dep... |
python | def read_file(file_path, mode = 'rt'):
"""
Read the contents of a file
:param file_path: Path of the file to be read
:return: Contents of the file
"""
contents = ''
with open(file_path, mode) as f:
contents = f.read()
return contents |
python | def get_instance(self, payload):
"""
Build an instance of MachineToMachineInstance
:param dict payload: Payload response from the API
:returns: twilio.rest.api.v2010.account.available_phone_number.machine_to_machine.MachineToMachineInstance
:rtype: twilio.rest.api.v2010.account... |
java | public void registerMetrics(MetricRegistry metricRegistry, String pipelineId) {
meterName = name(Pipeline.class, pipelineId, "stage", String.valueOf(stage()), "executed");
executed = metricRegistry.meter(meterName);
} |
python | def UpdateOsLogin(self, oslogin_desired, two_factor_desired=False):
"""Update whether OS Login is enabled and update NSS cache if necessary.
Args:
oslogin_desired: bool, enable OS Login if True, disable if False.
two_factor_desired: bool, enable two factor if True, disable if False.
Returns:
... |
java | public static Observable<Boolean> flush(final ClusterFacade core, final String bucket, final String password) {
return flush(core, bucket, bucket, password);
} |
java | public static Document parse(URLConnection uc, Element instruction,
PrintWriter logger, TECore core) throws Throwable {
try {
uc.connect();
} catch (SSLProtocolException sslep) {
throw new SSLProtocolException("[SSL ERROR] Failed to connect with the requested URL due to \"Invalid server_name\... |
java | @Override
public UpdateTriggerResult updateTrigger(UpdateTriggerRequest request) {
request = beforeClientExecution(request);
return executeUpdateTrigger(request);
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.