language stringclasses 2
values | func_code_string stringlengths 63 466k |
|---|---|
java | @Override
public void write (@Nonnull final byte [] aBuf, final int nOfs, final int nLen)
{
// Disable because this can have a performance impact!
if (false)
ValueEnforcer.isArrayOfsLen (aBuf, nOfs, nLen);
if (nLen > 0)
{
final int nNewCount = m_nCount + nLen;
if (nNewCount > m_aBu... |
python | def _resample_samplerate(samples, sr, newsr):
# type: (np.ndarray, int, int, str) -> np.ndarray
"""
Uses https://github.com/tuxu/python-samplerate
"""
try:
from samplerate import resample
except ImportError:
return None
ratio = newsr/sr
return _applyMultichan(samples,
... |
java | @NotNull
public static Stream<Integer> range(final int from, final int to) {
return IntStream.range(from, to).boxed();
} |
java | public Observable<ServiceResponse<KeyBundle>> updateKeyWithServiceResponseAsync(String vaultBaseUrl, String keyName, String keyVersion, List<JsonWebKeyOperation> keyOps, KeyAttributes keyAttributes, Map<String, String> tags) {
if (vaultBaseUrl == null) {
throw new IllegalArgumentException("Parameter... |
python | def update_index(self):
"""
Regenerates the permission index for this set
Called everytime a rule is added / removed / modified in
the set
"""
# update index
idx = {}
for _, p in sorted(self.permissions.items(), key=lambda x: str(x[0])):
bra... |
java | private static void buildHttpClient() {
RequestConfig globalConfig =
RequestConfig.custom().setConnectTimeout(5000)
.setSocketTimeout(5000).build();
CloseableHttpClient httpclient =
HttpClients.custom().setKeepAliveStrategy(new HttpClientKeepAlive... |
java | @Benchmark String charsToBitSet(int reps) {
/*
* This benchmark now measures the complete parsing of a char[] rather than
* a single invocation of {@link BitSet#set}. However this fine because
* it is intended to be a comparative benchmark.
*/
for (int i = 0; i < reps; i++) {
for (int ... |
java | public static void retrieveSnapshotFiles(
File directory,
Map<String, Snapshot> namedSnapshotMap,
FileFilter filter,
boolean validate,
SnapshotPathType stype,
VoltLogger logger) {
NamedSnapshots namedSnapshots = new NamedSnapshots(namedSna... |
java | public Datatype.Builder setNullableBuilderFactory(BuilderFactory builderFactory) {
if (builderFactory != null) {
return setBuilderFactory(builderFactory);
} else {
return clearBuilderFactory();
}
} |
python | def store_config(func):
"""Decorator for storing the configuration in the project's builddir."""
from functools import wraps
@wraps(func)
def wrap_store_config(self, *args, **kwargs):
"""Wrapper that contains the actual storage call for the config."""
CFG.store(local.path(self.builddir)... |
java | protected SibRaStringGenerator getStringGenerator() {
final SibRaStringGenerator generator = new SibRaStringGenerator(this);
generator.addParent("connection", _connection);
generator.addField("session", _session);
return generator;
} |
java | public TransactionInfoBaseMessage nextTask() throws IOException {
if (!hasMoreEntries()) {
return null;
}
ByteBuffer bb = m_container.b();
int position = bb.position();
int length = bb.getInt();
long sourceHSId = bb.getLong();
VoltDbMessageFactory fa... |
java | @POST
@Produces(MediaType.APPLICATION_JSON)
@Consumes(MediaType.APPLICATION_JSON)
@Path("/{alertId}/notifications")
@Description("Creates new notifications for the given alert ID.")
public List<NotificationDto> addNotification(@Context HttpServletRequest req,
@PathParam("alertId") BigInteger alertId, Notificati... |
python | def sync(self, json_obj=None):
"""
synchronize this transport with the Ariane server transport
:return:
"""
LOGGER.debug("Transport.sync")
if json_obj is None:
params = None
if self.id is not None:
params = SessionService.complete_t... |
java | public static com.liferay.commerce.model.CommerceOrder fetchCommerceOrderByUuidAndGroupId(
String uuid, long groupId) {
return getService().fetchCommerceOrderByUuidAndGroupId(uuid, groupId);
} |
python | def boolean_sparse(a, b, operation=np.logical_and):
"""
Find common rows between two arrays very quickly
using 3D boolean sparse matrices.
Parameters
-----------
a: (n, d) int, coordinates in space
b: (m, d) int, coordinates in space
operation: numpy operation function, ie:
... |
python | def create_branch_and_checkout(self, branch_name: str):
"""
Creates a new branch if it doesn't exist
Args:
branch_name: branch name
"""
self.create_branch(branch_name)
self.checkout(branch_name) |
java | static void setAgreeShowDialog(Context context, boolean isAgree) {
SharedPreferences.Editor editor = getPreferencesEditor(context);
editor.putBoolean(PREF_KEY_IS_AGREE_SHOW_DIALOG, isAgree);
editor.apply();
} |
python | def infer_dtype_from_object(dtype):
"""
Get a numpy dtype.type-style object for a dtype object.
This methods also includes handling of the datetime64[ns] and
datetime64[ns, TZ] objects.
If no dtype can be found, we return ``object``.
Parameters
----------
dtype : dtype, type
T... |
python | def calc_parent(self, i, j, h):
"""
Returns get_big_array and end of span of parent sequence that contains given child.
"""
N = self.repo.array_size
c_i = i
c_j = j
c_h = h
# Calculate the number of the sequence in its row (sequences
# with same he... |
java | @Override
public Map<String, String> getValues() {
HashMap<String, String> result = new HashMap<>();
if (status != null && status != MandateStatus.NotSpecified) {
result.put("status", status.name());
}
if (beforeDate != null) result.put("beforeDate", Long.toString(befor... |
python | def _normalize_items(
ctx,
items,
str_to_node=False,
node_to_str=False,
allow_task=False,
):
"""
Normalize given items.
Do several things:
- Ignore None.
- Flatten list.
- Unwrap wrapped item in `_ItemWrapper`.
:param ctx: BuildContext object.
:param it... |
java | @Override
public UpdateRuleGroupResult updateRuleGroup(UpdateRuleGroupRequest request) {
request = beforeClientExecution(request);
return executeUpdateRuleGroup(request);
} |
python | def filter(self, query, output_fields=None):
"""Query the database and return subject information for those
who match the query logic
Parameters
----------
query: Query or QueryGroup
Query(Group) object to process
output_fields: list
The fields de... |
python | def _add_supplemental(data):
"""Add additional supplemental files to CWL sv output, give useful names.
"""
if "supplemental" not in data["sv"]:
data["sv"]["supplemental"] = []
if data["sv"].get("variantcaller"):
cur_name = _useful_basename(data)
for k in ["cns", "vrn_bed"]:
... |
java | @Override
public Collection<V> values() {
List<V> values = new ArrayList<>();
valuesR(root.getLeft(), -1, values);
return values;
} |
java | public EEnum getIfcConnectionTypeEnum() {
if (ifcConnectionTypeEnumEEnum == null) {
ifcConnectionTypeEnumEEnum = (EEnum) EPackage.Registry.INSTANCE.getEPackage(Ifc2x3tc1Package.eNS_URI)
.getEClassifiers().get(798);
}
return ifcConnectionTypeEnumEEnum;
} |
java | public static FunctionalType unaryOperator(TypeMirror type) {
checkArgument(!type.getKind().isPrimitive(), "Unexpected primitive type %s", type);
return new FunctionalType(
QualifiedName.of(UnaryOperator.class).withParameters(type),
"apply",
ImmutableList.of(type),
type);
} |
python | def parsed_whois(self, query, **kwargs):
"""Pass in a domain name"""
return self._results('parsed-whois', '/v1/{0}/whois/parsed'.format(query), cls=ParsedWhois, **kwargs) |
java | public String tokenizeToCoNLLOffsets() {
final StringBuilder sb = new StringBuilder();
final String[] sentences = segmenter.segmentSentence();
final List<List<Token>> tokens = tokenizer.tokenize(sentences);
for (final List<Token> tokSentence : tokens) {
for (final Token token : tokSentence) {
... |
python | def load_mpower_data(filename, convert_times=1000000000.0):
"""
This method loads data in the `mpower <https://www.synapse.org/#!Synapse:syn4993293/wiki/247859>`_ format
The format is like:
.. code-block:: json
[
{
"timestamp":... |
java | public byte[] toBytes() throws IOException {
ByteArrayOutputStream out = new ByteArrayOutputStream();
// 0. write command number
out.write(getCommand());
// 1. write 4 bytes bin-log position to start at
ByteHelper.writeUnsignedIntLittleEndian(binlogPosition, out);
// 2. w... |
python | def update(self):
"""Read raw data and calculate temperature and humidity."""
if not self._ok:
self.log_error("Trying to restore OK mode w/ soft reset")
self._ok = self._soft_reset()
try:
self._bus.write_byte(self._i2c_add, CMD_READ_TEMP_NOHOLD)
sl... |
python | def remove(self, identifier: Union[DataObjectReplica, int]):
"""
Removes a data object from this collection that has the given unique identifier. A `ValueError` will be raised
if a data object with the given identifier does not exist.
:param identifier: the identifier of the data object
... |
java | public void update(String url, int additionalHeight)
{
if (iframe.getSrc() != null && url != null && iframe.getSrc().equals(url))
{
return;
}
if (additionalHeight > -1)
{
this.additionalHeight = additionalHeight;
}
final Style style = iframe.getStyle();
style.setWidth(
... |
java | Observable<ChatConversationBase> getConversation(@NonNull String conversationId) {
return Observable.create(emitter -> storeFactory.execute(new StoreTransaction<ChatStore>() {
@Override
protected void execute(ChatStore store) {
store.open();
ChatConversat... |
java | public static void katakanaToRomaji(Appendable builder, CharSequence s)
throws IOException {
ToStringUtil.getRomanization(builder, s);
} |
java | @Throws(IllegalNullArgumentException.class)
public static <T> T notNull(@Nonnull final T reference, @Nullable final String name) {
if (reference == null) {
throw new IllegalNullArgumentException(name);
}
return reference;
} |
java | @SuppressWarnings("unchecked")
public static <T> T convertValue(JsonNode node, Class<T> clazz) {
if (node instanceof POJONode) {
return convertValue(DPathUtils.extractValue((POJONode) node), clazz);
}
if (clazz == null) {
throw new NullPointerException("Class paramete... |
java | public void create(final DbProduct dbProduct) {
if(repositoryHandler.getProduct(dbProduct.getName()) != null){
throw new WebApplicationException(Response.status(Response.Status.CONFLICT).entity("Product already exist!").build());
}
repositoryHandler.store(dbProduct);
} |
java | public static Map<String, EntryValue> convertBeanToEntryMap(Object bean) {
Map<String, Object> buildAttributeValueMap = BeanUtilsExtended.buildObjectAttributeMap(bean);
return Maps.transformEntries(buildAttributeValueMap, new ObjectToEntryValueTransformer());
} |
java | public static long checkPreconditionL(
final long value,
final boolean condition,
final LongFunction<String> describer)
{
return innerCheckL(value, condition, describer);
} |
python | def _main():
"""Command line interface to the module.
"""
from argparse import ArgumentParser, FileType
from gutenberg import Error
from gutenberg._util.os import reopen_encoded
parser = ArgumentParser(description='Remove headers and footers from a '
'Pr... |
python | def CheckTemplates(self, base_dir, version):
"""Verify we have at least one template that matches maj.minor version."""
major_minor = ".".join(version.split(".")[0:2])
templates = glob.glob(
os.path.join(base_dir, "templates/*%s*.zip" % major_minor))
required_templates = set(
[x.replace(... |
java | public void away (ClientObject caller, String message)
{
BodyObject body = _locator.forClient(caller);
// we modify this field via an invocation service request because a body object is not
// modifiable by the client
body.setAwayMessage(message);
} |
python | def put_text(img, text, org, font_face, font_scale, color, thickness=1, line_type=8, bottom_left_origin=False):
"""Utility for drawing text with line breaks
:param img: Image.
:param text: Text string to be drawn.
:param org: Bottom-left corner of the first line of the text string in the image.
:pa... |
java | public static sslservicegroup_sslcertkey_binding[] get(nitro_service service, String servicegroupname) throws Exception{
sslservicegroup_sslcertkey_binding obj = new sslservicegroup_sslcertkey_binding();
obj.set_servicegroupname(servicegroupname);
sslservicegroup_sslcertkey_binding response[] = (sslservicegroup_s... |
python | def run_bootstrap_post_init(self, config):
"""
runs a script after initdb or custom bootstrap script is called and waits until completion.
"""
cmd = config.get('post_bootstrap') or config.get('post_init')
if cmd:
r = self._local_connect_kwargs
if 'host' i... |
java | public RunAsType<ServletType<T>> getOrCreateRunAs()
{
Node node = childNode.getOrCreate("run-as");
RunAsType<ServletType<T>> runAs = new RunAsTypeImpl<ServletType<T>>(this, "run-as", childNode, node);
return runAs;
} |
java | private Runnable decorateTask(Runnable task, boolean isRepeatingTask) {
Runnable result = TaskUtils.decorateTaskWithErrorHandler(task, this.errorHandler, isRepeatingTask);
if (this.enterpriseConcurrentScheduler) {
result = ManagedTaskBuilder.buildManagedTask(result, task.toString());
... |
python | def pad_to_multiple(self, factor):
"""
Pad the pianoroll with zeros at the end along the time axis with the
minimum length that makes the resulting pianoroll length a multiple of
`factor`.
Parameters
----------
factor : int
The value which the length ... |
java | private double checkThreshold(int value) {
double threshold = (double) value;
try {
if (threshold < 0 || threshold > 100) {
throw new NumberFormatException();
}
LOG.info("Using a threshold of " + threshold);
} catch (NumberFormatException e) {
System.err.println("Expect a dou... |
java | public ServiceEndpointPolicyInner beginCreateOrUpdate(String resourceGroupName, String serviceEndpointPolicyName, ServiceEndpointPolicyInner parameters) {
return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, serviceEndpointPolicyName, parameters).toBlocking().single().body();
} |
java | public static void cleanupActiveSession() {
Session session = AbstractHandler.ACTIVE_SESSION.get();
if (session != null) {
try {
AbstractHandler.ACTIVE_SESSION.remove();
session.logout();
LOGGER.debug("Logged out REST service session");
... |
java | public NfsRmdirResponse rmdir() throws IOException {
NfsRmdirResponse response = getNfs().wrapped_sendRmdir(makeRmdirRequest());
setFileHandle(null);
return response;
} |
python | def read_config(ctx, param, config_path):
"""Callback that is used whenever --config is passed."""
if sys.argv[1] == 'init':
return
cfg = ctx.ensure_object(Config)
if config_path is None:
config_path = path.join(sys.path[0], 'v2ex_config.json')
if not path.exists(config_path):
... |
java | protected MemoryBlock allocatePage(long required) {
MemoryBlock page = taskMemoryManager.allocatePage(Math.max(pageSize, required), this);
if (page == null || page.size() < required) {
throwOom(page, required);
}
used += page.size();
return page;
} |
java | public static RgbaColor fromRgba(String rgba) {
if (rgba.length() == 0) return getDefaultColor();
String[] parts = getRgbaParts(rgba).split(",");
if (parts.length == 4) {
return new RgbaColor(parseInt(parts[0]),
parseInt(parts[1]),
... |
java | public static String getMapParam(Map<String,String[]> queryMap,
String field) {
String arr[] = queryMap.get(field);
if (arr == null || arr.length == 0) {
return null;
}
return arr[0];
} |
java | public EClass getIfcTextStyleWithBoxCharacteristics() {
if (ifcTextStyleWithBoxCharacteristicsEClass == null) {
ifcTextStyleWithBoxCharacteristicsEClass = (EClass) EPackage.Registry.INSTANCE
.getEPackage(Ifc2x3tc1Package.eNS_URI).getEClassifiers().get(607);
}
return ifcTextStyleWithBoxCharacteristics... |
java | private static final HttpMessageConverter<?> getHalConverter(List<MediaType> halFlavours) {
ObjectMapper mapper = new ObjectMapper();
mapper.registerModule(new Jackson2HalModule());
mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);
MappingJackson2HttpMessageConverter converter = new ... |
python | def reportFailed(self, *args, **kwargs):
"""
Report Run Failed
Report a run failed, resolving the run as `failed`. Use this to resolve
a run that failed because the task specific code behaved unexpectedly.
For example the task exited non-zero, or didn't produce expected output.
... |
java | public String getDocid() {
if (Document_Type.featOkTst && ((Document_Type)jcasType).casFeat_docid == null)
jcasType.jcas.throwFeatMissing("docid", "de.julielab.jules.types.ace.Document");
return jcasType.ll_cas.ll_getStringValue(addr, ((Document_Type)jcasType).casFeatCode_docid);} |
python | def check(self, *exc_classes):
"""Check if any of ``exc_classes`` caused the failure.
Arguments of this method can be exception types or type
names (strings **fully qualified**). If captured exception is
an instance of exception of given type, the corresponding argument
is retur... |
python | def solve(self,b):
"""
Solves system Ax=b.
Parameters
----------
b : ndarray
Returns
-------
x : ndarray
"""
x = b.copy()
self.mumps.set_rhs(x)
self.mumps.run(job=3)
return x |
python | def List(column_names, title=None, boolstyle=None, editable=False,
select_col=None, sep='|', data=[], **kwargs):
"""Present a list of items to select.
This will raise a Zenity List Dialog populated with the colomns and rows
specified and return either the cell or row that was selected or Non... |
python | def getArticles(self,
page=1,
count=100,
sortBy = "rel",
sortByAsc = False,
returnInfo=ReturnInfo()):
"""
return a list of articles that match the topic page
@param page: which page of the results to return (default:... |
python | def main():
"""
Run through simple demonstration of alarm concept
"""
alarm = XBeeAlarm('/dev/ttyUSB0', '\x56\x78')
routine = SimpleWakeupRoutine(alarm)
from time import sleep
while True:
"""
Run the routine with 10 second delays
"""
try:
print "W... |
java | public void setMaxSize(long maxSize) {
// if the new maxSize is <= 0, clear keyLRUList
if (maxSize <= 0) {
keyLRUList.clear();
} else if (maxSize > 0 && this.maxSize <= 0) {
// if the new maxSize > 0 and the old is <= 0, fill in LRU list -
// order will be meaningless for now
Iterator keys = ca... |
java | public ValueSetContactComponent addContact() { //3
ValueSetContactComponent t = new ValueSetContactComponent();
if (this.contact == null)
this.contact = new ArrayList<ValueSetContactComponent>();
this.contact.add(t);
return t;
} |
java | public RandomVariable getImpliedBachelierATMOptionVolatility(RandomVariable optionValue, double optionMaturity, double swapAnnuity){
return optionValue.average().mult(Math.sqrt(2.0 * Math.PI / optionMaturity) / swapAnnuity);
} |
java | public List<List<String>> decodeLabeledSequences(List<List<SeqElement>> seqs) {
List<List<List<String>>> n1 = new ArrayList<List<List<String>>>();
for (List<SeqElement> seq : seqs) {
List<List<String>> n2 = new ArrayList<List<String>>();
for (SeqElement el : seq) {
n2.add(el.getFeatures());
}
n1.add... |
python | def worker(self):
"""
Returns the worker object for loading records for this record box.
:return <XOrbLookupWorker>
"""
if self._worker is None:
self._worker = XOrbLookupWorker(self.isThreadEnabled())
self._worker.setBatchSize(self._ba... |
python | def drawCircle(self, center, radius):
"""Draw a circle given its center and radius.
"""
if not radius > 1e-5:
raise ValueError("radius must be postive")
center = Point(center)
p1 = center - (radius, 0)
return self.drawSector(center, p1, 360, fullSector=False) |
python | def bind(topic, signal=None, kind=MIDDLE, nice=-1):
"""
This is a decorator function, so you should use it as:
@bind('init')
def process_init(a, b):
...
"""
def f(func):
if not topic in _receivers:
receivers = _receivers[topic] = []
... |
python | def _sort_layers(self):
"""Sort the layers by depth."""
self._layers = OrderedDict(sorted(self._layers.items(), key=lambda t: t[0])) |
python | def output(self):
"""
Return a 20-byte hash corresponding to this script (or None if not applicable).
"""
hash160 = self._script_info.get("hash160", None)
if hash160:
yield ("hash160", b2h(hash160), None)
address = self.address()
yield ("address", add... |
python | def has_value(self):
"""return True if value has been set"""
try:
if isinstance(self.__value, Expression):
return self.__value.has_value
return True
except AttributeError:
return False |
java | private static byte[] getIPv6ByName(CharSequence ip, boolean ipv4Mapped) {
final byte[] bytes = new byte[IPV6_BYTE_COUNT];
final int ipLength = ip.length();
int compressBegin = 0;
int compressLength = 0;
int currentIndex = 0;
int value = 0;
int begin = -1;
... |
python | async def getitem(self, url: str, url_vars: Dict[str, str] = {},
*, accept: str = sansio.accept_format(),
jwt: Opt[str] = None,
oauth_token: Opt[str] = None
) -> Any:
"""Send a GET request for a single item to the specified ... |
java | @Override
public <T> T convertValue(String rawValue, Class<T> type) {
assertNotClosed();
@SuppressWarnings("unchecked")
T value = (T) getConversionManager().convert(rawValue, type);
return value;
} |
java | public static HELM2Notation readRNA(String notation)
throws FastaFormatException, NotationException, ChemistryException, NucleotideLoadingException {
HELM2Notation helm2notation = new HELM2Notation();
PolymerNotation polymer = new PolymerNotation("RNA1");
if (!(FastaFormat.isNormalDirection(notation))) {
... |
java | public static String replaceHtmlEntities(String content, Map<String, Character> map) {
for (Entry<String, Character> entry : escapeStrings.entrySet()) {
if (content.indexOf(entry.getKey()) != -1) {
content = content.replace(entry.getKey(), String.valueOf(entry.getValue()));
}
... |
python | def glossary(term=None, return_format=None):
"""List of glossary terms and definitions.
:param term: a whole or parital word to "search" in the API
"""
uri = 'glossary'
if term:
uri = '/'.join([uri, term])
return _get(uri, return_format) |
java | public static void toJson(Object object, JsonBuffer output) {
if (object == null) {
return;
}
for (final Method method : object.getClass().getMethods()) {
try {
if (!method.isSynthetic() && !Modifier.isStatic(method.getModifiers()) && method.getParameterCount() == 0
&& (method.getReturnType().isPri... |
java | public JsonPropertyBuilder<T, P> router(JsonCoderRouter<P> router) {
return new JsonPropertyBuilder<T, P>(coderClass, name, null, router);
} |
java | public static void setCurrentPayload(Variables stack, String name, WindupVertexFrame frame)
throws IllegalArgumentException
{
Map<String, Iterable<? extends WindupVertexFrame>> vars = stack.peek();
Iterable<? extends WindupVertexFrame> existingValue = vars.get(name);
if (!(e... |
python | def pause(self, pause=0):
"""Insert a `pause`, in seconds."""
fr = self.frames[-1]
n = int(self.fps * pause)
for i in range(n):
fr2 = "/tmp/vpvid/" + str(len(self.frames)) + ".png"
self.frames.append(fr2)
os.system("cp -f %s %s" % (fr, fr2)) |
java | public static int nextClearBit(long v, int start) {
if(start >= Long.SIZE) {
return -1;
}
start = start < 0 ? 0 : start;
long cur = ~v & (LONG_ALL_BITS << start);
return cur == 0 ? -1 : Long.numberOfTrailingZeros(cur);
} |
java | public void marshall(TargetLocation targetLocation, ProtocolMarshaller protocolMarshaller) {
if (targetLocation == null) {
throw new SdkClientException("Invalid argument passed to marshall(...)");
}
try {
protocolMarshaller.marshall(targetLocation.getAccounts(), ACCOUNT... |
python | def _get_view_result(view, raw_result, **kwargs):
""" Get view results helper. """
if raw_result:
return view(**kwargs)
if kwargs:
return Result(view, **kwargs)
return view.result |
python | def get(self,
variable_path: str,
default: t.Optional[t.Any] = None,
coerce_type: t.Optional[t.Type] = None,
coercer: t.Optional[t.Callable] = None,
**kwargs):
"""
Reads a value of ``variable_path`` from consul kv storage.
:param varia... |
python | def setup_new_conf(self):
# pylint: disable=too-many-branches
"""Setup the new configuration received from Arbiter
This function calls the base satellite treatment and manages the configuration needed
for a simple satellite daemon that executes some actions (eg. poller or reactionner):
... |
python | def capture_delete_records(records):
"""Writes all of our delete events to DynamoDB."""
for record in records:
model = create_delete_model(record)
if model:
try:
model.delete(condition=(CurrentVPCModel.eventTime <= record['detail']['eventTime']))
except De... |
java | public SecurityGroup withIpPermissionsEgress(IpPermission... ipPermissionsEgress) {
if (this.ipPermissionsEgress == null) {
setIpPermissionsEgress(new com.amazonaws.internal.SdkInternalList<IpPermission>(ipPermissionsEgress.length));
}
for (IpPermission ele : ipPermissionsEgress) {
... |
java | public DBCluster withReadReplicaIdentifiers(String... readReplicaIdentifiers) {
if (this.readReplicaIdentifiers == null) {
setReadReplicaIdentifiers(new com.amazonaws.internal.SdkInternalList<String>(readReplicaIdentifiers.length));
}
for (String ele : readReplicaIdentifiers) {
... |
java | private double phi(long timestampMillis) {
long timeDiffMillis;
double meanMillis;
double stdDeviationMillis;
synchronized (heartbeatHistory) {
long lastTimestampMillis = lastHeartbeatMillis;
if (lastTimestampMillis == NO_HEARTBEAT_TIMESTAMP) {
re... |
java | public ServerGroup withServerList(Server... serverList) {
if (this.serverList == null) {
setServerList(new java.util.ArrayList<Server>(serverList.length));
}
for (Server ele : serverList) {
this.serverList.add(ele);
}
return this;
} |
java | private void drawLegend(Graphics g) {
Graphics2D g2 = (Graphics2D) g;
setRenderingHints(g2);
g2.setColor(Color.BLACK);
Font font = g2.getFont();
Font f = new Font(font.getFontName(), Font.BOLD, font.getSize());
g2.setFont(f);
fm = getFontMetrics(f);
int fontHeight = fm.getHeight();
for (int i = 0; i <... |
python | def update(self, data):
"""TODO"""
self.debug(data)
url = "{base}/{uuid}".format(
base=self.local_base_url,
uuid=data.get('uuid')
)
return self.core.update(url, data) |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.