language stringclasses 2
values | func_code_string stringlengths 63 466k |
|---|---|
python | def build_queue(action, action_space, build_queue_id):
"""Cancel a unit in the build queue."""
del action_space
action.action_ui.production_panel.unit_index = build_queue_id |
java | public static AbstractUserObject getUserObject(final UUID _uuid)
throws EFapsException
{
AbstractUserObject ret = Role.get(_uuid);
if (ret == null) {
ret = Group.get(_uuid);
}
if (ret == null) {
ret = Company.get(_uuid);
}
if (ret == nu... |
python | def setup(app):
"""Register directives.
When sphinx loads the extension (= imports the extension module) it
also executes the setup() function. Setup is the way extension
informs Sphinx about everything that the extension enables: which
config_values are introduced, which custom nodes/directives/ro... |
python | def seek(
self,
subscription,
time=None,
snapshot=None,
retry=google.api_core.gapic_v1.method.DEFAULT,
timeout=google.api_core.gapic_v1.method.DEFAULT,
metadata=None,
):
"""
Seeks an existing subscription to a point in time or to a given snapsh... |
python | def pw(
ctx,
key_pattern,
user_pattern,
mode,
strict_flag,
user_flag,
file,
edit_subcommand,
gen_subcommand,
):
"""Search for USER and KEY in GPG-encrypted password file."""
# install silent Ctrl-C handler
def handle_sigint(*_):
click.echo()
ctx.exit(1)
... |
python | def update(name, mac=None, mtu=None):
'''
Update a nictag
name : string
name of nictag
mac : string
optional new mac for nictag
mtu : int
optional new MTU for nictag
CLI Example:
.. code-block:: bash
salt '*' nictagadm.update trunk mtu=9000
'''
ret... |
python | def main():
"""Script entrypoint."""
# Parse the arguments
parser = argparse.ArgumentParser(
description='Convert MSBuild XML to JSON format')
parser.add_argument(
'-t', '--toolchain', help='The name of the toolchain', required=True)
parser.add_argument(
'-o', '--output', he... |
python | def get_filename(self, **kwargs):
"""Create a filename where output data will be saved.
Args:
kwargs (dict): Attributes and other metadata to use for formatting
the previously provided `filename`.
"""
if self.filename_parser is None:
raise Runtim... |
python | def parse_fn_docstring(fn):
"""Get parameter and return types from function's docstring.
Docstrings must use this format::
:param foo: What is foo
:type foo: int
:return: What is returned
:rtype: double
:return: A map of names, each with keys 'type' and 'desc'.
:rtype: tup... |
java | @Override
protected void checkTransitions(StreamTokenizer streamTokenizer) {
// Only if no states are defined we add all from the transitions we found.
// This is necessary because states are not necessarily defined in FSMs.
if (states.isEmpty()) {
transitions.keySet().forEach(e ... |
java | public void add(String path, V value) {
m_tree.setValue(splitPath(path), value);
} |
python | def unregister_path(self, path):
"""
Unregisters given path.
:param path: Path name.
:type path: unicode
:return: Method success.
:rtype: bool
"""
if not path in self:
raise umbra.exceptions.PathExistsError("{0} | '{1}' path isn't registered!... |
python | def merge_dicts(*args):
r"""
add / concatenate / union / join / merge / combine dictionaries
Copies the first dictionary given and then repeatedly calls update using
the rest of the dicts given in args. Duplicate keys will receive the last
value specified the list of dictionaries.
Returns:
... |
java | @Override
public void deserializeInstance(SerializationStreamReader streamReader, OWLObjectMinCardinalityImpl instance) throws SerializationException {
deserialize(streamReader, instance);
} |
java | protected HashMap readObvData(HashMap brMap) throws IOException {
HashMap files = new HashMap();
HashMap file = new HashMap();
String line;
HashMap mapA;
BufferedReader brA;
Object buf;
LinkedHashMap formats = new LinkedHashMap();
ArrayList titles = new A... |
java | private void obtainRestoreDefaultsButtonText() {
CharSequence text;
try {
text = ThemeUtil.getText(getActivity(), R.attr.restoreDefaultsButtonText);
} catch (NotFoundException e) {
text = getText(R.string.restore_defaults_button_text);
}
setRestoreDefaul... |
python | def update_payment_request(self, tid, currency=None, amount=None,
action=None, ledger=None, callback_uri=None,
display_message_uri=None, capture_id=None,
additional_amount=None, text=None, refund_id=None,
... |
python | def get_orbit(self, component=None, **kwargs):
"""
Shortcut to :meth:`get_component` but with kind='star'
"""
kwargs.setdefault('kind', 'orbit')
return self.get_component(component, **kwargs) |
python | def add_entries_to_gallery(app, doctree, docname):
"""
Add entries to the gallery node
Should happen when all the doctrees have been read
and the gallery entries have been collected. i.e at
doctree-resolved time.
"""
if docname != 'gallery':
return
if not has_gallery(app.builde... |
java | private void defineSeparators(UIDefaults d) {
String c = PAINTER_PREFIX + "SeparatorPainter";
d.put("Separator.contentMargins", new InsetsUIResource(0, 0, 0, 0));
d.put("Separator[Enabled].backgroundPainter", new LazyPainter(c, SeparatorPainter.Which.BACKGROUND_ENABLED));
} |
python | def mkdir(self, path, parents=True, raise_if_exists=False):
"""
No explicit -p switch, this version of Hadoop always creates parent directories.
"""
try:
self.call_check(load_hadoop_cmd() + ['fs', '-mkdir', path])
except hdfs_error.HDFSCliError as ex:
if "... |
python | def convert(self, form):
""" Convert a lazy user to a non-lazy one. The form passed
in is expected to be a ModelForm instance, bound to the user
to be converted.
The converted ``User`` object is returned.
Raises a TypeError if the user is not lazy.
"""
if not is... |
python | def insensitive_comparison(item1, item2, type_insensitive=False, string_insensitive=False):
"""Compare two items without regard to order.
The following rules are used to determine equivalence:
* Items that are not of the same type can be equivalent only when ``type_insensitive=True``.
* Mapping... |
java | public Path getReportDirectory()
{
WindupConfigurationModel cfg = WindupConfigurationService.getConfigurationModel(getGraphContext());
Path path = cfg.getOutputPath().asFile().toPath().resolve(REPORTS_DIR);
createDirectoryIfNeeded(path);
return path.toAbsolutePath();
} |
python | def get_source(self, id, **kwargs): # noqa: E501
"""Get a specific source for a customer # noqa: E501
# noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async_req=True
>>> thread = api.get_source(id, async_... |
java | public void deploy(final DeploymentPhaseContext phaseContext) throws DeploymentUnitProcessingException {
final DeploymentUnit deploymentUnit = phaseContext.getDeploymentUnit();
// we only want to process top level jar deployments
if (deploymentUnit.getParent() != null) {
return;
... |
python | def main_photo(self):
"""Return user's main photo."""
if not self._main_photo:
self._main_photo = self.photos_factory()
return self._main_photo |
java | public void deleteDescriptorIfNecessary() throws CmsException {
if (m_removeDescriptorOnCancel && (m_desc != null)) {
m_cms.deleteResource(m_desc, CmsResourceDeleteMode.valueOf(2));
}
} |
python | def asinh(x):
"""
Inverse hyperbolic sine
"""
if isinstance(x, UncertainFunction):
mcpts = np.arcsinh(x._mcpts)
return UncertainFunction(mcpts)
else:
return np.arcsinh(x) |
python | def set_inasafe_default_value_qsetting(
qsetting, category, inasafe_field_key, value):
"""Helper method to set inasafe default value to qsetting.
:param qsetting: QSettings.
:type qsetting: QSettings
:param category: Category of the default value. It can be global or
recent. Global mea... |
java | private void checkIndex() throws IOException {
boolean isUpToDate = true;
if (!isUpToDate()) {
closeFile();
isUpToDate = false;
}
if (zipRandomFile != null || isUpToDate) {
lastReferenceTimeStamp = System.currentTimeMillis();
return;
... |
java | public static void main(String[] args) {
DependencyRandomIndexingMain drim = new DependencyRandomIndexingMain();
try {
drim.run(args);
}
catch (Throwable t) {
t.printStackTrace();
}
} |
python | def get_specific_subnodes(self, node, name, recursive=0):
"""Given a node and a name, return a list of child `ELEMENT_NODEs`, that
have a `tagName` matching the `name`. Search recursively for `recursive`
levels.
"""
children = [x for x in node.childNodes if x.nodeType == x.ELEMEN... |
java | @Command(name = "UnLockDevice", inTypeDesc = "Str[x] = Device name(s). Lg[0] = Force flag", outTypeDesc = "Device global lock counter")
public int unlockDevice(final DevVarLongStringArray argin) throws DevFailed {
final String[] deviceNames = argin.svalue;
boolean isForced = false;
if (argin... |
python | def get(self):
"""Get quota from Cloud Provider."""
# get all network quota from Cloud Provider.
attrs = ("networks",
"security_groups",
"floating_ips",
"routers",
"internet_gateways")
for attr in attrs:
se... |
java | @Override
public SameDiff importGraph(GRAPH_TYPE tfGraph) {
return importGraph(tfGraph, Collections.<String, OpImportOverride<GRAPH_TYPE,NODE_TYPE,ATTR_TYPE>>emptyMap(), null);
} |
python | async def pulse(self):
"""Send get state request to API to keep the connection alive."""
get_state = GetState(pyvlx=self.pyvlx)
await get_state.do_api_call()
if not get_state.success:
raise PyVLXException("Unable to send get state.") |
python | def aggregate_in(self, On=None, AggFuncDict=None, AggFunc=None,
AggList=None, interspersed=True):
"""
Aggregate a tabarray and include original data in the result.
See the :func:`aggregate` method.
Method wraps::
tabular.summarize.aggregate_in(self, On... |
python | def _password_digest(username, password):
"""Get a password digest to use for authentication.
"""
if not isinstance(password, string_type):
raise TypeError("password must be an "
"instance of %s" % (string_type.__name__,))
if len(password) == 0:
raise ValueError("... |
java | public static String toHex(Color color) {
String R = Integer.toHexString(color.getRed());
R = R.length() < 2 ? ('0' + R) : R;
String G = Integer.toHexString(color.getGreen());
G = G.length() < 2 ? ('0' + G) : G;
String B = Integer.toHexString(color.getBlue());
B = B.length() < 2 ? ('0' + B) : B;
re... |
java | public String toPlainString() {
if(scale==0) {
if(intCompact!=INFLATED) {
return Long.toString(intCompact);
} else {
return intVal.toString();
}
}
if(this.scale<0) { // No decimal point
if(signum()==0) {
... |
python | def get_favourite_accounts(self) -> List[Account]:
""" Provides a list of favourite accounts """
from gnucash_portfolio.lib.settings import Settings
settings = Settings()
favourite_accts = settings.favourite_accounts
accounts = self.get_list(favourite_accts)
return accou... |
java | public S getPrev() {
S result = null;
QueryParameters params = innerGetPrev();
try {
result = processor.toBean(params, this.type);
} catch (MjdbcException ex) {
throw new MjdbcRuntimeException(ex);
}
return result;
} |
python | def applet_run(object_id, input_params={}, always_retry=True, **kwargs):
"""
Invokes the /applet-xxxx/run API method.
For more info, see: https://wiki.dnanexus.com/API-Specification-v1.0.0/Applets-and-Entry-Points#API-method%3A-%2Fapplet-xxxx%2Frun
"""
input_params_cp = Nonce.update_nonce(input_par... |
java | public static ThreadPoolExecutorFactoryBean newThreadPoolExecutorFactoryBean(final ConnectionPoolingProperties config) {
val bean = new ThreadPoolExecutorFactoryBean();
bean.setMaxPoolSize(config.getMaxSize());
bean.setCorePoolSize(config.getMinSize());
return bean;
} |
java | private Map<String, String> toConfigurationItemMap(Set<ConfigurationItem> configurationItems) {
Map<String, String> map = new HashMap<>(configurationItems.size());
for (ConfigurationItem configurationItem : configurationItems) {
map.put(configurationItem.getKey(), configurationItem.getValue... |
python | def get_tunnel_info_input_filter_type_filter_by_cfg_src_config_src(self, **kwargs):
"""Auto Generated Code
"""
config = ET.Element("config")
get_tunnel_info = ET.Element("get_tunnel_info")
config = get_tunnel_info
input = ET.SubElement(get_tunnel_info, "input")
fi... |
python | def get_instance(self, payload):
"""
Build an instance of FaxMediaInstance
:param dict payload: Payload response from the API
:returns: twilio.rest.fax.v1.fax.fax_media.FaxMediaInstance
:rtype: twilio.rest.fax.v1.fax.fax_media.FaxMediaInstance
"""
return FaxMedi... |
python | def qgis_composer_infographic_extractor(impact_report, component_metadata):
"""Extract composer context specific for infographic template.
This method extract necessary context for a given impact report and
component metadata and save the context so it can be used in composer
rendering phase
:para... |
python | def createsnippet(self, project_id, title, file_name, code, visibility_level=0):
"""
Creates an snippet
:param project_id: project id to create the snippet under
:param title: title of the snippet
:param file_name: filename for the snippet
:param code: content of the sni... |
python | def symbol_list(what_list):
'''
provide default symbol lists
Parameters
----------
what_list : string
String name of symbol lists provided; "list1", "list2",
"lines1" or "lines2".
'''
if what_list is "list1":
symbol=['ro','bo','ko','go','mo'\
,'r-','... |
python | def plotly_class(name=None, slug=None, da=None, prefix=None, postfix=None, template_type=None):
'Return a string of space-separated class names'
da, app = _locate_daapp(name, slug, da)
return app.extra_html_properties(prefix=prefix,
postfix=postfix,
... |
python | def autorun():
'''
Call the run method of the decorated class if the current file is the main file
'''
def wrapper(cls):
import inspect
if inspect.getmodule(cls).__name__ == "__main__":
cls().run()
return cls
return wrapper |
python | def use_color(setting):
"""Choose whether to use color based on the command argument.
Args:
setting - Either `auto`, `always`, or `never`
"""
if setting not in COLOR_CHOICES:
raise InvalidColorSetting(setting)
return (
setting == 'always' or
(setting == 'auto' and s... |
python | def set_uuid(obj, uuid=None):
"""Set the uuid attribute of an HDF5 object. Use this method to ensure correct dtype """
from uuid import uuid4, UUID
if uuid is None:
uuid = uuid4()
elif isinstance(uuid, bytes):
if len(uuid) == 16:
uuid = UUID(bytes=uuid)
else:
... |
python | def unpack_scalar(cls, dataset, data):
"""
Given a dataset object and data in the appropriate format for
the interface, return a simple scalar.
"""
if len(data) != 1 or len(data.columns) > 1:
return data
return data.iat[0,0] |
java | public IAtomContainer getSpanningTree() {
IAtomContainer container = molecule.getBuilder().newInstance(IAtomContainer.class);
for (int a = 0; a < totalVertexCount; a++)
container.addAtom(molecule.getAtom(a));
for (int b = 0; b < totalEdgeCount; b++)
if (bondsInTree[b]) co... |
java | public ChannelFuture block(InetAddress multicastAddress,
NetworkInterface networkInterface, InetAddress sourceToBlock) {
if (DetectionUtil.javaVersion() < 7) {
throw new UnsupportedOperationException();
} else {
if (multicastAddress == null) {
... |
python | def truncate(string, maxlen, end=True):
"""Truncate a string.
Parameters
----------
string : `str`
String to truncate.
maxlen : `int`
Maximum string length.
end : `boolean`, optional
Remove characters from the end (default: `True`).
Raises
------
ValueError
... |
java | public static final Integer compare(Object a, Object b) {
if (a==b) return 0;
if (a==null || b==null) return null;
assert a!=null && b!=null;
if (a instanceof Number && b instanceof Number) {
Number an = (Number)a;
Number bn = (Number)b;
if (Double.isN... |
java | public void replay(IDataLoggerReplay replay) throws IOException {
maybeRead();
this.randomAccess.rewind();
while (this.randomAccess.available() > (Integer.SIZE / Byte.SIZE)) {
int length = this.randomAccess.readInt();
short type = this.randomAccess.readShort();
XALogRecordType recordType = XALogRecordTy... |
java | @BetaApi
public final Operation insertHttpsHealthCheck(
String project, HttpsHealthCheck2 httpsHealthCheckResource) {
InsertHttpsHealthCheckHttpRequest request =
InsertHttpsHealthCheckHttpRequest.newBuilder()
.setProject(project)
.setHttpsHealthCheckResource(httpsHealthCheck... |
python | def do_execute(self):
"""
The actual execution of the actor.
:return: None if successful, otherwise error message
:rtype: str
"""
fname = self.input.payload
data = serialization.read_all(fname)
if len(data) == 1:
if is_instance_of(data[0], "we... |
python | def then_by_descending(self, func):
"""
Subsequent sorting function in descending order
:param func: lambda function for secondary sort key
:return: SortedEnumerable instance
"""
if func is None:
raise NullArgumentError(
u"then_by_descending re... |
java | public Path getInputFileForWrite(TaskID mapId, TaskAttemptID reduceTaskId,
long size)
throws IOException {
// TODO *oom* should use a format here
return lDirAlloc.getLocalPathForWrite(TaskTracker.getIntermediateOutputDir(
jobId.toString(), reduceTas... |
java | void reportBoundError(UndetVar uv, InferenceBound ib1, InferenceBound ib2) {
reportInferenceError(
String.format("incompatible.%s.%s.bounds",
StringUtils.toLowerCase(ib1.name()),
StringUtils.toLowerCase(ib2.name())),
uv.qtype,
... |
python | def getDefaultMemberDiscount(self):
"""Compute default member discount if it applies
"""
if hasattr(self, 'getMemberDiscountApplies'):
if self.getMemberDiscountApplies():
settings = self.bika_setup
return settings.getMemberDiscount()
else:
... |
java | public static void notNull(Object... objects) {
notNull((Object) objects);
for (Object object : objects) {
notNull(object);
}
} |
java | public static <T> T refresh(Connection connection, T target) throws SQLException {
return OrmReader.refresh(connection, target);
} |
java | public static double getSystemMemoryInfo() throws Exception {
int total = 0;
Process process = Runtime.getRuntime().exec("tasklist");
String result = IOUtils.read(process.getInputStream(), Charset.defaultCharset().name());
String[] results = result.split("\\n");
for (String str :... |
java | public int add(Object dependency, ValueSet valueSet) {
int returnCode = HTODDynacache.NO_EXCEPTION;
if (dependencyToEntryTable.size() >= this.maxSize) {
returnCode = reduceTableSize();
}
dependencyNotUpdatedTable.put(dependency, valueSet);
dependencyToEntryTable.put(d... |
python | def search_bugs(self, terms):
'''http://bugzilla.readthedocs.org/en/latest/api/core/v1/bug.html#search-bugs
terms = [{'product': 'Infrastructure & Operations'}, {'status': 'NEW'}]'''
params = ''
for i in terms:
k = i.popitem()
params = '{p}&{new}={value}'.format(p... |
python | def check_login_password(request):
"""
Resource check login and password combination is valid.
---
request_serializer: serializers.CheckLoginPassword
response_serializer: serializers.User
responseMessages:
- code: 200
message: Login and password is valid
- code: 400
... |
python | def get_base_info(self, obj):
"""Returns the base info of an object
"""
if obj is None:
return {}
info = {
"id": obj.getId(),
"uid": obj.UID(),
"title": obj.Title(),
"description": obj.Description(),
"url": obj.abso... |
python | def convert_string_to_list(string_val):
"""Helper function to convert string to list.
Used to convert shape attribute string to list format.
"""
result_list = []
list_string = string_val.split(',')
for val in list_string:
val = str(val.strip())
val = val.replace("(", "")
... |
java | private Point3d[] generateSpherePoints(int nSpherePoints) {
Point3d[] points = new Point3d[nSpherePoints];
double inc = Math.PI * (3.0 - Math.sqrt(5.0));
double offset = 2.0 / nSpherePoints;
for (int k=0;k<nSpherePoints;k++) {
double y = k * offset - 1.0 + (offset / 2.0);
double r = Math.sqrt(1.0 - y*y);
... |
python | def get_option_scope_help_info(self, option_registrations_iter):
"""Returns an OptionScopeHelpInfo for the options registered with the (args, kwargs) pairs."""
basic_options = []
recursive_options = []
advanced_options = []
# Sort the arguments, so we display the help in alphabetical order.
for ... |
python | def diff(name_a, name_b=None, **kwargs):
'''
Display the difference between a snapshot of a given filesystem and
another snapshot of that filesystem from a later time or the current
contents of the filesystem.
name_a : string
name of snapshot
name_b : string
(optional) name of s... |
java | protected void percolateUpMaxHeap(final int index) {
int hole = index;
Activation element = elements[hole];
while (hole > 1 && compare(element, elements[hole / 2]) > 0) {
// save element that is being pushed down
// as the element "bubble" is percolated up
fi... |
python | def _pval_from_bootci(boot, estimate):
"""Compute p-value from bootstrap distribution.
Similar to the pval function in the R package mediation.
Note that this is less accurate than a permutation test because the
bootstrap distribution is not conditioned on a true null hypothesis.
"""
if estimate... |
java | @Override
public void emitEquals(final Sink sink, final String indent, Constructor constructor, List<String> typeArguments) {
logger.finest("Generating equals() for " + constructor.name);
sink.write(indent + "@Override\n");
sink.write(indent + "public boolean equals(Object obj) {\n");
s... |
python | def list_datastores_full(kwargs=None, call=None):
'''
List all the datastores for this VMware environment, with extra information
CLI Example:
.. code-block:: bash
salt-cloud -f list_datastores_full my-vmware-config
'''
if call != 'function':
raise SaltCloudSystemExit(
... |
java | @Override
public PathImpl schemeWalk(String userPath,
Map<String,Object> attributes,
String filePath,
int offset)
{
String canonicalPath;
if (offset < filePath.length()
&& (filePath.charAt(offset) == '/'
|| fileP... |
java | @GET
@Path("/{id}")
public Response find(@PathParam("id") final String id)
throws IOException {
return execute(getResourceRequest(RequestTypeEnum.GET, RestOperationTypeEnum.READ).id(id));
} |
java | private void addPostParams(final Request request) {
if (recordingStatusCallbackEvent != null) {
for (String prop : recordingStatusCallbackEvent) {
request.addPostParam("RecordingStatusCallbackEvent", prop);
}
}
if (recordingStatusCallback != null) {
... |
java | public void close(boolean closingConnection)
throws SIResourceException, SIConnectionLostException,
SIErrorException, SIConnectionDroppedException
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(this, tc, "close", closingConnection);
if (executingOnCallb... |
python | def from_source_reference(expnum, ccd, x, y):
"""
Given the location of a source in the image, create an Observation.
"""
image_uri = storage.dbimages_uri(expnum=expnum,
ccd=None,
version='p',
... |
java | public EJBLocalHome getLocalHome(String jndiHomeName) throws
ServiceLocatorException {
Debug.logVerbose("[JdonFramework] -- > getLocalHome.... ", module);
EJBLocalHome home = null;
try {
if (cache.containsKey(jndiHomeName)) {
home = (EJBLocalHome) cache.get(jndiHomeName);
} ... |
java | public void truncateToSequenceNumber(final long truncationSeqNo) throws IOException {
assert(m_memoryDeque.isEmpty());
m_persistentDeque.parseAndTruncate(new BinaryDequeTruncator() {
@Override
public TruncatorResponse parse(BBContainer bbc) {
ByteBuffer b = bbc.b... |
java | public <T> ResultSetIterable<T> executeAndFetchLazy(final ResultSetHandler<T> resultSetHandler) {
final ResultSetHandlerFactory<T> factory = newResultSetHandlerFactory(resultSetHandler);
return executeAndFetchLazy(factory);
} |
python | def recovery(self, using=None, **kwargs):
"""
The indices recovery API provides insight into on-going shard
recoveries for the index.
Any additional keyword arguments will be passed to
``Elasticsearch.indices.recovery`` unchanged.
"""
return self._get_connection(... |
java | public static int safetyLevelToFlickrSafteyLevelId(JinxConstants.SafetyLevel safetyLevel) {
if (safetyLevel == null) {
return -1;
}
int ret;
switch (safetyLevel) {
case safe:
ret = 1;
break;
case moderate:
... |
java | @Override
public byte[] get(String spaceId, String key) throws IOException {
String cacheKey = calcCacheKey(spaceId, key);
byte[] data = getFromCache(getCacheName(), cacheKey, byte[].class);
if (data == null) {
data = kvStorage.get(spaceId, key);
putToCache(getCacheNa... |
java | @Override
public void delete(PropertyData data, ChangedSizeHandler sizeHandler) throws RepositoryException,
UnsupportedOperationException, InvalidItemStateException, IllegalStateException
{
currentItem = data;
try
{
setOperationType(TYPE_DELETE);
super.delete(data, sizeHa... |
python | def replace_fixed_rate_shipping_by_id(cls, fixed_rate_shipping_id, fixed_rate_shipping, **kwargs):
"""Replace FixedRateShipping
Replace all attributes of FixedRateShipping
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async=Tr... |
python | def mmi_to_shapefile(self, force_flag=False):
"""Convert grid.xml's mmi column to a vector shp file using ogr2ogr.
An ESRI shape file will be created.
:param force_flag: bool (Optional). Whether to force the regeneration
of the output file. Defaults to False.
:return: Path... |
python | def get_ips(self, instance_id):
"""
Retrieves all IP addresses associated to a given instance.
:return: tuple (IPs)
"""
self._init_az_api()
cluster_name, node_name = instance_id
# XXX: keep in sync with contents of `vm_deployment_template`
ip_name = ('{no... |
python | def write(self,f):
""" write control data section to a file
Parameters
----------
f: file handle or string filename
"""
if isinstance(f,str):
f = open(f,'w')
f.write("pcf\n")
f.write("* control data\n")
for line in CON... |
java | protected Class[] getInterfaces(TargetMetaDef targetMetaDef) {
Class[] interfaces = targetMetaDef.getInterfaces();
if (interfaces != null)
return interfaces;
try {
interfaces = getPOJOInterfaces(targetMetaDef);
} catch (Exception ex) {
Debug.logError("[JdonFramework] getInterfaces error:" + ex, ... |
python | def ipv6_range_to_list(start_packed, end_packed):
""" Return a list of IPv6 entries from start_packed to end_packed. """
new_list = list()
start = int(binascii.hexlify(start_packed), 16)
end = int(binascii.hexlify(end_packed), 16)
for value in range(start, end + 1):
high = value >> 64
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.