language stringclasses 2
values | func_code_string stringlengths 63 466k |
|---|---|
java | private void readObject(final ObjectInputStream in) throws IOException, ClassNotFoundException {
in.defaultReadObject();
final Calendar definingCalendar = Calendar.getInstance(timeZone, locale);
init(definingCalendar);
} |
java | public synchronized void submitRunTaskCommand(long jobId, int taskId, JobConfig jobConfig,
Object taskArgs, long workerId) {
RunTaskCommand.Builder runTaskCommand = RunTaskCommand.newBuilder();
runTaskCommand.setJobId(jobId);
runTaskCommand.setTaskId(taskId);
try {
runTaskCommand.setJobConfi... |
python | def _set_raw_raise(self, sep):
"""Set the output raw exception section
:param sep: the separator of current style
"""
raw = ''
if self.dst.style['out'] == 'numpydoc':
if 'raise' not in self.dst.numpydoc.get_excluded_sections():
raw += '\n'
... |
java | @Override
public synchronized boolean truncate() throws TTException {
mDatabase.close();
if (mEnv.getDatabaseNames().contains(NAME)) {
mEnv.removeDatabase(null, NAME);
}
mEnv.close();
return IOUtils.recursiveDelete(mFile);
} |
python | def prettyln(text, fill='-', align='^', prefix='[ ', suffix=' ]', length=69):
"""Wrap `text` in a pretty line with maximum length."""
text = '{prefix}{0}{suffix}'.format(text, prefix=prefix, suffix=suffix)
print(
"{0:{fill}{align}{length}}".format(
text, fill=fill, align=align, length=le... |
python | def init(self, switch_configuration, terminal_controller, logger, piping_processor, *args):
"""
:type switch_configuration: fake_switches.switch_configuration.SwitchConfiguration
:type terminal_controller: fake_switches.terminal.TerminalController
:type logger: logging.Logger
:ty... |
python | def inner_contains(self, time_point):
"""
Returns ``True`` if this interval contains the given time point,
excluding its extrema (begin and end).
:param time_point: the time point to test
:type time_point: :class:`~aeneas.exacttiming.TimeValue`
:rtype: bool
"""
... |
java | protected Object handleException(Exception ex, Method method, Object[] params) throws Exception {
throw ex;
} |
java | private String getSha1FromRegistryPackageUrl(String registryPackageUrl, boolean isScopeDep, String versionOfPackage, RegistryType registryType, String npmAccessToken) {
String uriScopeDep = registryPackageUrl;
if (isScopeDep) {
try {
uriScopeDep = registryPackageUrl.replace(... |
java | public static ManifestVersion get(final Class<?> clazz)
{
final String manifestUrl = ClassExtensions.getManifestUrl(clazz);
try
{
return of(manifestUrl != null ? new URL(manifestUrl) : null);
}
catch (final MalformedURLException ignore)
{
return of(null);
}
} |
java | public String[] arrayDefaultString(final Object[] target, final Object defaultValue) {
if (target == null) {
return null;
}
final String[] result = new String[target.length];
for (int i = 0; i < target.length; i++) {
result[i] = defaultString(target[i], defaultVal... |
python | def has_flag(compiler, flagname):
"""Return a boolean indicating whether a flag name is supported on
the specified compiler.
"""
with TemporaryDirectory() as tmpdir, \
stdchannel_redirected(sys.stderr, os.devnull), \
stdchannel_redirected(sys.stdout, os.devnull):
f = temp... |
python | def get(self, name, *default):
# type: (str, Any) -> Any
""" Get context value with the given name and optional default.
Args:
name (str):
The name of the context value.
*default (Any):
If given and the key doesn't not exist, this will be ... |
java | public int getContentLength() {
try {
getInputStream();
} catch (Exception e) {
return -1;
}
int l = contentLength;
if (l < 0) {
try {
l = Integer.parseInt(properties.findValue("content-length"));
setContentLengt... |
python | def matchfirst(self, event):
'''
Return first match for this event
:param event: an input event
'''
# 1. matches(self.index[ind], event)
# 2. matches(self.any, event)
# 3. self.matches
if self.depth < len(event.indices):
ind = event.in... |
python | def process(self):
'''Run all tag processors.'''
for tag_proc in self.tag_procs:
before_count = self.entry_count
self.run_tag_processor(tag_proc)
after_count = self.entry_count
if self.verbose:
print('Inserted %d entries for "%s" tag proce... |
python | def give_zip_element_z_and_names(element_name):
''' create 2 indexes that, given the name of the element/specie, give the atomic number.'''
#import numpy as np
global z_bismuth
z_bismuth = 83
global z_for_elem
z_for_elem = []
global index_stable
index_stable = []
i_for_stable = 1
... |
java | public ServiceFuture<DeletedCertificateBundle> getDeletedCertificateAsync(String vaultBaseUrl, String certificateName, final ServiceCallback<DeletedCertificateBundle> serviceCallback) {
return ServiceFuture.fromResponse(getDeletedCertificateWithServiceResponseAsync(vaultBaseUrl, certificateName), serviceCallbac... |
python | def from_dict(cls, d, ignore=()):
"""Create an instance from a serialized version of cls
Args:
d(dict): Endpoints of cls to set
ignore(tuple): Keys to ignore
Returns:
Instance of this class
"""
filtered = {}
for k, v in d.items():
... |
python | def are_worth_chaining(left_converter, right_converter) -> bool:
"""
Utility method to check if it makes sense to chain these two converters. Returns True if it brings value to
chain the first converter with the second converter. To bring value,
* the second converter's input should not ... |
python | def delete(names, yes):
"""
Delete a training job.
"""
failures = False
for name in names:
try:
experiment = ExperimentClient().get(normalize_job_name(name))
except FloydException:
experiment = ExperimentClient().get(name)
if not experiment:
... |
python | def Sun_Mishima(m, D, rhol, rhog, mul, kl, Hvap, sigma, q=None, Te=None):
r'''Calculates heat transfer coefficient for film boiling of saturated
fluid in any orientation of flow. Correlation
is as shown in [1]_, and also reviewed in [2]_ and [3]_.
Either the heat flux or excess temperature is requi... |
java | public void delete_class_attribute_property(Database database, String name, String attname, String propname)
throws DevFailed {
String[] array = new String[1];
array[0] = propname;
delete_class_attribute_property(database, name, attname, array);
} |
python | def assert_valid(self, instance, value=None):
"""Checks if valid, including HasProperty instances pass validation"""
valid = super(Instance, self).assert_valid(instance, value)
if not valid:
return False
if value is None:
value = instance._get(self.name)
i... |
python | def List(device, device_path):
"""Prints a directory listing.
Args:
device_path: Directory to list.
"""
files = device.List(device_path)
files.sort(key=lambda x: x.filename)
maxname = max(len(f.filename) for f in files)
maxsize = max(len(str(f.size)) for f in files)
for f in files... |
java | public void setResolved(String v) {
if (Coordination_Type.featOkTst && ((Coordination_Type)jcasType).casFeat_resolved == null)
jcasType.jcas.throwFeatMissing("resolved", "de.julielab.jules.types.Coordination");
jcasType.ll_cas.ll_setStringValue(addr, ((Coordination_Type)jcasType).casFeatCode_resolved, v);... |
python | def _create_initstate_and_embeddings(self):
"""Create the initial state for the cell and the data embeddings."""
self._init_state = self.cell.zero_state(self.batch_size, tf.float32)
embedding = tf.get_variable(
"embedding", [self.vocab_size, self.num_hidden])
inputs = tf.nn.e... |
python | def cli(env):
"""Prints some various bits of information about an account"""
manager = AccountManager(env.client)
summary = manager.get_summary()
env.fout(get_snapshot_table(summary)) |
python | def visit_slot(self, slot_name: str, slot: SlotDefinition) -> None:
""" Add a slot definition per slot
@param slot_name:
@param slot:
@return:
"""
# Note: We use the raw name in OWL and add a subProperty arc
slot_uri = self.prop_uri(slot.name)
# Parent s... |
java | public void resume(String resourceGroupName, String automationAccountName, UUID jobId) {
resumeWithServiceResponseAsync(resourceGroupName, automationAccountName, jobId).toBlocking().single().body();
} |
java | public static LinkedHashMap<String, ArrayList<Row>> parseSalt(
VisualizerInput input, boolean showSpanAnnos, boolean showTokenAnnos,
List<String> annotationNames,
Set<String> mediaLayer, boolean replaceValueWithMediaIcon,
long startTokenIndex, long endTokenIndex,
PDFCo... |
java | public void encode(DerOutputStream out) throws IOException {
DerOutputStream tmp = new DerOutputStream();
policyIdentifier.encode(tmp);
if (!policyQualifiers.isEmpty()) {
DerOutputStream tmp2 = new DerOutputStream();
for (PolicyQualifierInfo pq : policyQualifiers) {
... |
python | def retryable(retryer=retry_ex, times=3, cap=120000):
"""
A decorator to make a function retry. By default the retry
occurs when an exception is thrown, but this may be changed
by modifying the ``retryer`` argument.
See also :py:func:`retry_ex` and :py:func:`retry_bool`. By
default :py:func:`re... |
python | def do_grep(self, params):
"""
\x1b[1mNAME\x1b[0m
grep - Prints znodes with a value matching the given text
\x1b[1mSYNOPSIS\x1b[0m
grep [path] <content> [show_matches]
\x1b[1mOPTIONS\x1b[0m
* path: the path (default: cwd)
* show_matches: show the content that matched (default: ... |
java | public static final Long date2utc(Date date) {
// use null for a null date
if (date == null) return null;
long time = date.getTime();
// remove the timezone offset
time -= timezoneOffsetMillis(date);
return time;
} |
java | public BigMoney plus(Iterable<? extends BigMoneyProvider> moniesToAdd) {
BigDecimal total = amount;
for (BigMoneyProvider moneyProvider : moniesToAdd) {
BigMoney money = checkCurrencyEqual(moneyProvider);
total = total.add(money.amount);
}
return with(total)... |
java | @Override
public List<AnalyzedTokenReadings> tag(List<String> sentenceTokens, boolean ignoreCase) throws IOException {
List<AnalyzedTokenReadings> tokens = super.tag(sentenceTokens, ignoreCase);
for (int i = 0; i < tokens.size(); i++) {
AnalyzedTokenReadings reading = tokens.get(i);
if (reading != n... |
java | public void add(String typeName, PropertySerializer<?> serializer, Class<? extends PropertyEditorBase<?>> editorClass) {
if (get(typeName) == null) {
register(new PropertyType(typeName, serializer, editorClass));
}
} |
java | public static CcgUnaryRule parseFrom(String line) {
String[] chunks = new CsvParser(CsvParser.DEFAULT_SEPARATOR,
CsvParser.DEFAULT_QUOTE, CsvParser.NULL_ESCAPE).parseLine(line.trim());
Preconditions.checkArgument(chunks.length >= 1, "Illegal unary rule string: %s", line);
String[] syntacticParts = ... |
python | def similarity1DdiffShapedArrays(arr1, arr2, normalize=False):
"""
compare two strictly monotonous increasing 1d arrays
of same or different size
return a similarity index-> 0=identical
"""
# assign longer and shorter here, because jit cannot do it
if len(arr1) < len(arr2):
arr1, arr... |
java | private boolean intersects(Point point, int fudge, QuadCurve2D.Float c) {
if (!c.intersects(point.x - fudge, point.y - fudge, fudge << 1,
fudge << 1))
return false;
if (c.getFlatness() < fudge)
return true;
QuadCurve2D.Float f1 = new QuadCurve2D.Float(), f2 = new QuadCurve2D.Float();
c.subdivide(f1, f... |
java | public void attachUI(final WComponent ui) {
if (backing == null || backing instanceof WComponent) {
backing = ui;
} else if (backing instanceof InterceptorComponent) {
((InterceptorComponent) backing).attachUI(ui);
} else {
throw new IllegalStateException(
"Unable to attachUI. Unknown type of WebCom... |
python | async def replication(self, *, dc=None):
"""Checks status of ACL replication
Parameters:
dc (str): Specify datacenter that will be used.
Defaults to the agent's local datacenter.
Returns:
Object: Replication information
Returns the status o... |
python | def _get_aws_variables(self):
"""
Returns the AWS specific environment variables that should be available in the Lambda runtime.
They are prefixed it "AWS_*".
:return dict: Name and value of AWS environment variable
"""
result = {
# Variable that says this f... |
java | @SuppressWarnings("unchecked")
public <T> ProxyHandler<T> proxify(final Class<T> clazz) {
return (ProxyHandler<T>) proxify(new Class[] { clazz });
} |
java | private ControllerErrorHandler getContextErrorHandler(XmlWebApplicationContext context) {
ControllerErrorHandler errorHandler = null;
String[] names = context.getBeanNamesForType(ControllerErrorHandler.class);
for (int i = 0; errorHandler == null && i < names.length; i++) {
errorHand... |
java | @Override
public UpdateContainerInstancesStateResult updateContainerInstancesState(UpdateContainerInstancesStateRequest request) {
request = beforeClientExecution(request);
return executeUpdateContainerInstancesState(request);
} |
java | protected BigDecimal valueOrNull(final Double source) {
if (source != null) {
return BigDecimal.valueOf(source);
}
return null;
} |
python | def _parseAttrVal(self, attrStr):
"""
Returns tuple of tuple of (attr, value), multiple are returned to
handle multi-value attributes.
"""
m = self.SPLIT_ATTR_RE.match(attrStr)
if m is None:
raise GFF3Exception(
"can't parse attribute/value: '"... |
python | def all(self):
" execute query, get all list of lists"
query,inputs = self._toedn()
return self.db.q(query,
inputs = inputs,
limit = self._limit,
offset = self._offset,
history = self._history) |
python | def get_config_file():
# type: () -> AnyStr
"""Get model configuration file name from argv"""
parser = argparse.ArgumentParser(description="Read configuration file.")
parser.add_argument('-ini', help="Full path of configuration file")
args = parser.parse_args()
ini_file = args.ini
if not Fil... |
java | public static Object toPrimitiveArray(Object[] array) {
Class primitiveType;
if (array.length > 0) {
LOG.debug("很可能array是用new Object[length]()构造的,这个时候array.getClass().getComponentType()返回的是Object类型,这不是我们期望的" +
"我们希望使用元素的实际类型,这里有一个风险点,即数组类型不一致,后面可能就会抛出类型转换异常");
... |
java | public void verifyMessageSize(int maxMessageSize) {
Iterator<MessageAndOffset> shallowIter = internalIterator(true);
while(shallowIter.hasNext()) {
MessageAndOffset messageAndOffset = shallowIter.next();
int payloadSize = messageAndOffset.message.payloadSize();
if(payload... |
python | async def wait_until_ready(
self, timeout: Optional[float] = None, no_raise: bool = False
) -> bool:
"""
Waits for the underlying node to become ready.
If no_raise is set, returns false when a timeout occurs instead of propogating TimeoutError.
A timeout of None means to wai... |
java | public static ProjectReader getProjectReader(String name) throws MPXJException
{
int index = name.lastIndexOf('.');
if (index == -1)
{
throw new IllegalArgumentException("Filename has no extension: " + name);
}
String extension = name.substring(index + 1).toUpperCase();
... |
java | public static Whitelist relaxed() {
return new Whitelist()
.addTags(
"a", "b", "blockquote", "br", "caption", "cite", "code", "col",
"colgroup", "dd", "div", "dl", "dt", "em", "h1", "h2", "h3", "h4", "h5", "h6",
"i", "img", ... |
java | public LocalDateTime withMinute(int minute) {
LocalTime newTime = time.withMinute(minute);
return with(date, newTime);
} |
java | public static SwapFile createTempFile(String prefix, String suffix, File directory) throws IOException
{
throw new IOException("Not applicable. Call get(File, String) method instead");
} |
java | protected static Event.Level formatLevel(Level level) {
if (level.isGreaterOrEqual(Level.ERROR)) {
return Event.Level.ERROR;
} else if (level.isGreaterOrEqual(Level.WARN)) {
return Event.Level.WARNING;
} else if (level.isGreaterOrEqual(Level.INFO)) {
return Ev... |
java | CompletableFuture<Void> resetIndexes(SessionId sessionId) {
RaftSessionState sessionState = sessions.get(sessionId.id());
if (sessionState == null) {
return Futures.exceptionalFuture(new IllegalArgumentException("Unknown session: " + sessionId));
}
CompletableFuture<Void> future = new Completable... |
python | def out_of_date(original, derived):
"""
Returns True if derivative is out-of-date wrt original,
both of which are full file paths.
"""
return (not os.path.exists(derived)
or os.stat(derived).st_mtime < os.stat(original).st_mtime) |
python | def parse_address(text: str) -> Tuple[str, int]:
'''Parse PASV address.'''
match = re.search(
r'\('
r'(\d{1,3})\s*,'
r'\s*(\d{1,3})\s*,'
r'\s*(\d{1,3})\s*,'
r'\s*(\d{1,3})\s*,'
r'\s*(\d{1,3})\s*,'
r'\s*(\d{1,3})\s*'
r'\)',
text)
if mat... |
python | def _create_union_types_specification(schema_graph, graphql_types, hidden_classes, base_name):
"""Return a function that gives the types in the union type rooted at base_name."""
# When edges point to vertices of type base_name, and base_name is both non-abstract and
# has subclasses, we need to represent t... |
java | public OvhReceiver serviceName_users_login_receivers_POST(String serviceName, String login, Boolean autoUpdate, String csvUrl, String description, String documentId, Long slotId) throws IOException {
String qPath = "/sms/{serviceName}/users/{login}/receivers";
StringBuilder sb = path(qPath, serviceName, login);
H... |
java | public static Hashtable<String, String[]> parseQueryString(String s) {
String valArray[] = null;
if (s == null) {
throw new IllegalArgumentException();
}
Hashtable<String, String[]> ht = new Hashtable<String, String[]>();
StringBuilder sb = new StringBuilder();
... |
java | private ArrayList<IIOMetadata> readExif( IIOMetadataNode app1EXIFNode ) {
// Set up input skipping EXIF ID 6-byte sequence.
byte[] app1Params = (byte[]) app1EXIFNode.getUserObject();
MemoryCacheImageInputStream app1EXIFInput = new MemoryCacheImageInputStream(new ByteArrayInputStream(app1Params,... |
python | def runExperiment6(dirName):
"""
This runs the experiment the section "Simulations with Combined Sequences",
an example stream containing a mixture of temporal and sensorimotor sequences.
"""
# Results are put into a pkl file which can be used to generate the plots.
# dirName is the absolute path where the ... |
java | private void init(Symtab syms, boolean definitive) {
if (classes != null) return;
if (definitive) {
Assert.check(packages == null || packages == syms.packages);
packages = syms.packages;
Assert.check(classes == null || classes == syms.classes);
classes = ... |
java | @Override
public long position() throws IOException
{
if (inflater == null && deflater == null)
{
return 0;
}
if (inflater != null)
{
return inflater.getBytesWritten();
}
else
{
return deflater.getBy... |
java | @Override
public List<List<LogTrace<LogEntry>>> parse(InputStream inputStream, ParsingMode parsingMode) throws ParameterException, ParserException {
try {
inputStream.available();
} catch (IOException e) {
throw new ParameterException("Unable to read input file: " + e.getMessage());
}
Collection<XLog> l... |
java | private List<InetAddress> findAddresses() throws HarvestException {
// Stores found addresses
List<InetAddress> found = new ArrayList<InetAddress>(3);
// Retrieve list of available network interfaces
Enumeration<NetworkInterface> interfaces = getNetworkInterfaces();
while (interfaces.hasMoreElements()) {
... |
python | def AddKeyByPath(self, key_path, registry_key):
"""Adds a Windows Registry key for a specific key path.
Args:
key_path (str): Windows Registry key path to add the key.
registry_key (WinRegistryKey): Windows Registry key.
Raises:
KeyError: if the subkey already exists.
ValueError: i... |
java | static boolean load(String path)
{
if (loadDat(path)) return true;
// 从文本中载入并且尝试生成dat
StringDictionary dictionary = new StringDictionary("=");
if (!dictionary.load(path)) return false;
TreeMap<String, Pinyin[]> map = new TreeMap<String, Pinyin[]>();
for (Map.Entry<Str... |
java | public static FieldMarshaller getFieldMarshaller (Field field)
{
if (_marshallers == null) {
// multiple threads may attempt to create the stock marshallers, but they'll just do
// extra work and _marshallers will only ever contain a fully populated table
_marshallers = c... |
java | private void setNewObjectMapper() {
mapper = new ObjectMapper();
if (!serializeNullValues) {
mapper.setSerializationInclusion(JsonInclude.Include.NON_NULL);
if (ignoreUnknownProperties) {
mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);
... |
java | @Override
public void run() {
getReport().println(
Messages.get().container(Messages.RPT_REBUILD_SEARCH_INDEXES_BEGIN_0),
I_CmsReport.FORMAT_HEADLINE);
try {
Map<String, Object> params = new HashMap<String, Object>();
params.put(I_CmsEventListener.KE... |
python | def add_view_no_menu(self, baseview, endpoint=None, static_folder=None):
"""
Add your views without creating a menu.
:param baseview:
A BaseView type class instantiated.
"""
baseview = self._check_and_init(baseview)
log.info(LOGMSG_INF_FAB_ADD_VIEW.forma... |
java | @FFDCIgnore(JAXBException.class)
public static Object parseRaDeploymentDescriptor(com.ibm.wsspi.adaptable.module.Entry ddEntry) throws JAXBException, SAXException, ParserConfigurationException, UnableToAdaptException {
Object connector = null;
try {
connector = parseResourceAdapterXml(dd... |
java | public void becomeCloneOf(ManagedObject clone)
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(tc, "becomeCloneOf", "Clone="+clone);
PersistableRawData object = (PersistableRawData)clone;
_data = object._data;
if (TraceComponent.isAnyTracingEnabled()... |
java | public static EntityType getAndCheckEntityType(EntityDataModel entityDataModel, String typeName) {
return checkIsEntityType(getAndCheckType(entityDataModel, typeName));
} |
python | def _missing_imageinfo(self):
"""
returns list of image filenames that are missing info
"""
if 'image' not in self.data:
return
missing = []
for img in self.data['image']:
if 'url' not in img:
missing.append(img['file'])
ret... |
java | public IWord findFirstWordByLabel(String label)
{
for (IWord word : this)
{
if (label.equals(word.getLabel()))
{
return word;
}
}
return null;
} |
java | public ArrayList<PayloadType.Audio> getAudioPayloadTypesList() {
ArrayList<PayloadType.Audio> result = new ArrayList<>();
Iterator<JinglePayloadType> jinglePtsIter = getJinglePayloadTypes();
while (jinglePtsIter.hasNext()) {
JinglePayloadType jpt = jinglePtsIter.next();
... |
java | public static MySQLBinaryProtocolValue getBinaryProtocolValue(final MySQLColumnType columnType) {
Preconditions.checkArgument(BINARY_PROTOCOL_VALUES.containsKey(columnType), "Cannot find MySQL type '%s' in column type when process binary protocol value", columnType);
return BINARY_PROTOCOL_VALUES.get(co... |
python | def build_stack_docs(root_project_dir, skippedNames=None):
"""Build stack Sphinx documentation (main entrypoint).
Parameters
----------
root_project_dir : `str`
Path to the root directory of the main documentation project. This
is the directory containing the ``conf.py`` file.
skipp... |
java | @SuppressWarnings("unchecked")
protected Map<String, Object> handleGetSettingsData(Set<String> settingSet) {
if(settingSet == null || settingSet.size() == 0){
throw new NotEnoughFieldsSpecifiedException("At least one settings field needs to passed in as an argument.");
}
Map<St... |
java | public static String getStatusText(int nHttpStatusCode) {
Integer intKey = new Integer(nHttpStatusCode);
if (!mapStatusCodes.containsKey(intKey)) {
return "";
} else {
return mapStatusCodes.get(intKey);
}
} |
java | public static String readInputStreamBufferedAsString(final InputStream in, final String charset) throws IOException {
BufferedReader reader = null;
try {
reader = new BufferedReader(new UnicodeReader(in, charset));
StringBuilder result = new StringBuilder();
char[] cbuf = new char[2048];
int read;
wh... |
java | public static String encode(Object o) {
Type type = typeOf(o);
return type.encode(o);
} |
python | def randomWalkFunction(requestContext, name, step=60):
"""
Short Alias: randomWalk()
Returns a random walk starting at 0. This is great for testing when there
is no real data in whisper.
Example::
&target=randomWalk("The.time.series")
This would create a series named "The.time.series... |
java | WComponent getChildAt(final int index) {
ComponentModel model = getComponentModel();
return model.getChildren().get(index);
} |
python | def queueMessage(self, sender, target, value,
consequence=None):
"""
Queue a persistent outgoing message.
@param sender: The a description of the shared item that is the sender
of the message.
@type sender: L{xmantissa.sharing.Identifier}
@param tar... |
java | protected void destroyConnection(ThriftConnectionHandle<T> conn) {
postDestroyConnection(conn);
try {
conn.internalClose();
} catch (ThriftConnectionPoolException e) {
logger.error("Error in attempting to close connection", e);
}
} |
java | @Override
public void extinguish() {
logger.info(">>> {} shutting down ...", NAME);
try {
if (server != null) {
server.stop();
}
} catch (Exception e) {
logger.error("stop failed", e);
System.exit(100); // NOSONAR
}
... |
java | public Vector4d set(Vector4fc v) {
return set(v.x(), v.y(), v.z(), v.w());
} |
python | def _loopreport(self):
'''
Loop over the report progress
'''
while 1:
eventlet.sleep(0.2)
ac2popenlist = {}
for action in self.session._actions:
for popen in action._popenlist:
if popen.poll() is None:
... |
java | public double det() {
int m = lu.nrows();
int n = lu.ncols();
if (m != n)
throw new IllegalArgumentException(String.format("Matrix is not square: %d x %d", m, n));
double d = (double) pivsign;
for (int j = 0; j < n; j++) {
d *= lu.get(j, j);
}
... |
python | def is_callable_tag(tag):
""" Determine whether :tag: is a valid callable string tag.
String is assumed to be valid callable if it starts with '{{'
and ends with '}}'.
:param tag: String name of tag.
"""
return (isinstance(tag, six.string_types) and
tag.strip().startswith('{{') and... |
java | static void uninitialize() {
// get the appcontext that we've stored data in
AppContext ctx = AppContext.getAppContext();
// get the pcl stored in app context
PropertyChangeListener pcl = (PropertyChangeListener) ctx.get("SeaGlassStyle.defaults.pcl");
// if the pcl exists, unin... |
java | private static void fillValue2Node(List<MetricInfo> componentMetrics, Map<String, TopologyNode> nodes) {
String NODE_DIM = MetricDef.EMMITTED_NUM;
List<String> FILTER = Arrays.asList(MetricDef.EMMITTED_NUM, MetricDef.SEND_TPS, MetricDef.RECV_TPS);
for (MetricInfo info : componentMetrics) {
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.