language stringclasses 2
values | func_code_string stringlengths 63 466k |
|---|---|
python | def ReadAllFlowObjects(self,
client_id = None,
min_create_time = None,
max_create_time = None,
include_child_flows = True,
cursor=None):
"""Returns all flow objects."""
conditions = []
... |
java | public static Key[] globalKeysOfClass(final Class clz) {
return KeySnapshot.globalSnapshot().filter(new KeySnapshot.KVFilter() {
@Override public boolean filter(KeySnapshot.KeyInfo k) { return Value.isSubclassOf(k._type, clz); }
}).keys();
} |
java | public void subtractValue(int idx, double val) {
int c = get1dConfigIdx(idx);
values.set(c, s.minus(values.get(c), val));
} |
python | def set_rate(self, param):
"""
Models "Rate Command" functionality of device.
Sets the target rate of temperature change.
:param param: Rate of temperature change in C/min, multiplied by 100, as a string.
Must be positive.
:return: Empty string.
"""
# TO... |
python | def set(self, key, value=None, dir=False, refresh=False, ttl=None,
prev_value=None, prev_index=None, prev_exist=None, timeout=None):
"""Requests to create an ordered node into a node by the given key."""
url = self.make_key_url(key)
data = self.build_args({
'value': (six.... |
java | private TimephasedCost[] splitFirstDay(ProjectCalendar calendar, TimephasedCost assignment)
{
TimephasedCost[] result = new TimephasedCost[2];
//
// Retrieve data used to calculate the pro-rata work split
//
Date assignmentStart = assignment.getStart();
Date assignmentFinish = as... |
java | protected <E extends Throwable, V extends ATSecDBValidator> Set<ATError> handleException(E e, Log logger, V validator,
String key, String suffix, String defaultMessagePrefix) {
return handleException(e, logger, validator, key, suffix, defaultMessagePrefix, new Object[] {});
} |
java | static String [] searchJrtFSForClasses( URL url ) throws IOException {
try {
Path path = FileSystems.getFileSystem(new URI("jrt:/")).getPath("modules", url.getPath());
return Files.walk(path).map(Path::toString)
.filter(BshClassPath::isClassFileName)
... |
java | public Object setState(final Object state) {
final Object oldState = this.state;
this.state = state;
return oldState;
} |
java | @SuppressWarnings("unchecked")
public static boolean findClass(String className) {
try {
return getClassLoader().loadClass(className) != null;
} catch (ClassNotFoundException e) {
return false;
} catch (NoClassDefFoundError e) {
return false;
}
... |
java | private void handleAttlistDecl()
throws XMLStreamException
{
/* This method will handle PEs that contain the whole element
* name. Since it's illegal to have partials, we can then proceed
* to just use normal parsing...
*/
char c = skipObligatoryDtdWs();
fi... |
python | def poke_64(library, session, address, data):
"""Write an 64-bit value from the specified address.
Corresponds to viPoke64 function of the VISA library.
:param library: the visa library wrapped by ctypes.
:param session: Unique logical identifier to a session.
:param address: Source address to rea... |
java | private boolean lookAheadFor(char expect) {
boolean matched = false;
int c;
while (true) {
c = stream.getChar();
if (c == ' ') {
continue;
} else if (c == expect) {
matched = true;
break;
} else {
break;
}
}
stream.ungetChar(c);
retur... |
python | def trainSequences(sequences, exp, idOffset=0):
"""Train the network on all the sequences"""
for seqId in sequences:
# Make sure we learn enough times to deal with high order sequences and
# remove extra predictions.
iterations = 3*len(sequences[seqId])
for p in range(iterations):
# Ensure we... |
python | def _accept(random_sample: float, cost_diff: float,
temp: float) -> Tuple[bool, float]:
"""Calculates probability and draws if solution should be accepted.
Based on exp(-Delta*E/T) formula.
Args:
random_sample: Uniformly distributed random number in the range [0, 1).
cost_diff:... |
python | def list_event_types(self, publisher_id):
"""ListEventTypes.
Get the event types for a specific publisher.
:param str publisher_id: ID for a publisher.
:rtype: [EventTypeDescriptor]
"""
route_values = {}
if publisher_id is not None:
route_values['publi... |
python | def run_std_server(self):
"""Starts a TensorFlow server and joins the serving thread.
Typically used for parameter servers.
Raises:
ValueError: if not enough information is available in the estimator's
config to create a server.
"""
config = tf.estimator.RunConfig()
server = tf.t... |
java | @Nonnull
private static Image makeBadgedImage(@Nonnull final Image original){
final BufferedImage result = new BufferedImage(original.getWidth(null), original.getHeight(null), BufferedImage.TYPE_INT_ARGB);
final Graphics2D gfx = result.createGraphics();
try{
gfx.setRenderingHint(RenderingHints.KEY_A... |
python | def add_subroute(self, pattern: str) -> "URLDispatcher":
""" create new URLDispatcher routed by pattern """
return URLDispatcher(
urlmapper=self.urlmapper,
prefix=self.prefix + pattern,
applications=self.applications,
extra_environ=self.extra_environ) |
java | public static double method2(ICountFingerprint fp1, ICountFingerprint fp2) {
long maxSum = 0, minSum = 0;
int i = 0, j = 0;
while (i < fp1.numOfPopulatedbins() || j < fp2.numOfPopulatedbins()) {
Integer hash1 = i < fp1.numOfPopulatedbins() ? fp1.getHash(i) : null;
Intege... |
python | def _execute_lua(self, keys, args, client):
"""
Sets KEYS and ARGV alongwith redis.call() function in lua globals
and executes the lua redis script
"""
lua, lua_globals = Script._import_lua(self.load_dependencies)
lua_globals.KEYS = self._python_to_lua(keys)
lua_g... |
java | private void setMandatoryAttachments(CareerDevelopmentAwardAttachments careerDevelopmentAwardAttachments) {
if (careerDevelopmentAwardAttachments.getResearchStrategy() == null) {
careerDevelopmentAwardAttachments.setResearchStrategy(ResearchStrategy.Factory.newInstance());
}
} |
python | def get(self, key):
"""Gets a value by a key.
Args:
key (str): Key to retrieve the value.
Returns: Retrieved value.
"""
self._create_file_if_none_exists()
with open(self.filename, 'rb') as file_object:
cache_pickle = pickle.load(file_object)
val = cache_pickle.get(key, None)
... |
java | public int prepare(Xid xid) throws XAException
{
if (!warned)
{
log.prepareCalledOnLocaltx();
}
warned = true;
return XAResource.XA_OK;
} |
java | public void marshall(DeleteHsmRequest deleteHsmRequest, ProtocolMarshaller protocolMarshaller) {
if (deleteHsmRequest == null) {
throw new SdkClientException("Invalid argument passed to marshall(...)");
}
try {
protocolMarshaller.marshall(deleteHsmRequest.getClusterId()... |
python | def get_data_path(module_id: str) -> Path:
"""
Get the path for persistent storage of a module.
This method creates the queried path if not existing.
Args:
module_id (str): Module ID
Returns:
The data path of indicated module.
"""
profile = coordinator.profile
... |
python | def get_train_op(loss, params):
"""Generate training operation that updates variables based on loss."""
with tf.variable_scope("get_train_op"):
mlperf_log.transformer_print(
key=mlperf_log.OPT_LR_WARMUP_STEPS,
value=params.learning_rate_warmup_steps)
learning_rate = get_learning_rate(
... |
java | public static int correctDCH( int N , int messageNoMask , int generator , int totalBits, int dataBits) {
int bestHamming = 255;
int bestMessage = -1;
int errorBits = totalBits-dataBits;
// exhaustively check all possibilities
for (int i = 0; i < N; i++) {
int test = i << errorBits;
test = test ^ bitPo... |
java | public static SipSessionKey getSipSessionKey(final String applicationSessionId, final String applicationName, final Message message, boolean inverted) {
if (logger.isDebugEnabled()){
logger.debug("getSipSessionKey - applicationSessionId=" + applicationSessionId + ", applicationName=" + applicationName + ", messa... |
python | def _generate_delete_sql(self, delete_keys):
"""
Generate forward delete operations for SQL items.
"""
for key in delete_keys:
app_label, sql_name = key
old_node = self.from_sql_graph.nodes[key]
operation = DeleteSQL(sql_name, old_node.reverse_sql, rev... |
java | public void addMetricsGraph(String title, String value) {
if (metrics != null) {
Metrics.Graph graph = metrics.createGraph(title);
graph.addPlotter(new Metrics.Plotter(value) {
@Override
public int getValue() {
return 1;
... |
python | def sasdata2dataframe(self, table: str, libref: str ='', dsopts: dict = None, rowsep: str = '\x01', colsep: str = '\x02', **kwargs) -> '<Pandas Data Frame object>':
"""
This method exports the SAS Data Set to a Pandas Data Frame, returning the Data Frame object.
table - the name of the SAS Data Set ... |
python | def load_user():
"""Read user config file and return it as a dict."""
config_path = get_user_config_path()
config = {}
# TODO: This may be overkill and too slow just for reading a config file
with open(config_path) as f:
code = compile(f.read(), config_path, 'exec')
exec(code, config)
... |
java | @RequirePOST
public HttpResponse doUpgrade(StaplerRequest req, StaplerResponse rsp) {
final String thruVerParam = req.getParameter("thruVer");
final VersionNumber thruVer = thruVerParam.equals("all") ? null : new VersionNumber(thruVerParam);
saveAndRemoveEntries(new Predicate<Map.Entry<Save... |
python | def _parse_json(self, resources, exactly_one=True):
"""
Parse type, words, latitude, and longitude and language from a
JSON response.
"""
code = resources['status'].get('code')
if code:
# https://docs.what3words.com/api/v2/#errors
exc_msg = "Erro... |
java | public Observable<Void> resendRequestEmailsAsync(String resourceGroupName, String certificateOrderName, String name) {
return resendRequestEmailsWithServiceResponseAsync(resourceGroupName, certificateOrderName, name).map(new Func1<ServiceResponse<Void>, Void>() {
@Override
public Void ca... |
java | @Override
public String remove(Object key) {
String result = m_configurationStrings.remove(key);
m_configurationObjects.remove(key);
return result;
} |
java | protected ConnectionListener validateConnectionListener(Collection<ConnectionListener> listeners,
ConnectionListener cl,
int newState)
{
ManagedConnectionFactory mcf = pool.getConnectionManager... |
java | @Nullable
public static SSLSession findSslSession(@Nullable Channel channel) {
if (channel == null) {
return null;
}
final SslHandler sslHandler = channel.pipeline().get(SslHandler.class);
return sslHandler != null ? sslHandler.engine().getSession() : null;
} |
java | @PostConstruct
public synchronized void initialize() {
final FwWebDirection direction = assistWebDirection();
final SessionResourceProvider provider = direction.assistSessionResourceProvider();
sessionSharedStorage = prepareSessionSharedStorage(provider);
httpSessionArranger = prepar... |
java | @MustBeLocked (ELockType.WRITE)
@Nonnull
protected final IMPLTYPE internalCreateItem (@Nonnull final IMPLTYPE aNewItem)
{
return internalCreateItem (aNewItem, true);
} |
java | int addElement(Object element, int column) {
if (element == null) throw new NullPointerException("addCell - null argument");
if ((column < 0) || (column > columns)) throw new IndexOutOfBoundsException("addCell - illegal column argument");
if ( !((getObjectID(element) == CELL) || (getObjectID(ele... |
java | public CmsPublishList fillPublishList(CmsRequestContext context, CmsPublishList publishList) throws CmsException {
CmsDbContext dbc = m_dbContextFactory.getDbContext(context);
try {
m_driverManager.fillPublishList(dbc, publishList);
checkPublishPermissions(dbc, publishList);
... |
python | def is_aka_dora(tile, aka_enabled):
"""
:param tile: int 136 tiles format
:param aka_enabled: depends on table rules
:return: boolean
"""
if not aka_enabled:
return False
if tile in [FIVE_RED_MAN, FIVE_RED_PIN, FIVE_RED_SOU]:
return True
return False |
java | private boolean matchesFilter(Category cat, List<String> filterList) throws WikiTitleParsingException {
String categoryTitle = cat.getTitle().getPlainTitle();
for (String filter : filterList) {
if (categoryTitle.startsWith(filter)) {
logger.info(categoryTitle + " starts with ... |
python | def load_settings(path, setttings_only = True):
"""
loads the settings that has been save with Script.save_b26.
Args:
path: path to folder saved by Script.save_b26
setttings_only: if true returns only the settings if the .b26 file contains only a single script
Ret... |
python | def _notify_listeners(self, sender, message):
"""
Notifies listeners of a new message
"""
uid = message['uid']
msg_topic = message['topic']
self._ack(sender, uid, 'fire')
all_listeners = set()
for lst_topic, listeners in self.__listeners.items():
... |
python | def updateattachmentflags(self, bugid, attachid, flagname, **kwargs):
"""
Updates a flag for the given attachment ID.
Optional keyword args are:
status: new status for the flag ('-', '+', '?', 'X')
requestee: new requestee for the flag
"""
# Bug ID was ... |
java | public void marshall(ListSourceCredentialsRequest listSourceCredentialsRequest, ProtocolMarshaller protocolMarshaller) {
if (listSourceCredentialsRequest == null) {
throw new SdkClientException("Invalid argument passed to marshall(...)");
}
try {
} catch (Exception e) {
... |
java | public int getLength() {
int count=0;
for (int handle=m_firstChild;
handle!=DTM.NULL;
handle=m_parentDTM.getNextSibling(handle)) {
++count;
}
return count;
} |
java | private boolean hasTemplate(String href) {
if (href == null) {
return false;
}
return URI_TEMPLATE_PATTERN.matcher(href).find();
} |
java | @Nonnull
public static <T> LOiToFltFunctionBuilder<T> oiToFltFunction(Consumer<LOiToFltFunction<T>> consumer) {
return new LOiToFltFunctionBuilder(consumer);
} |
java | public void setExecutionSummaries(java.util.Collection<JobExecutionSummaryForThing> executionSummaries) {
if (executionSummaries == null) {
this.executionSummaries = null;
return;
}
this.executionSummaries = new java.util.ArrayList<JobExecutionSummaryForThing>(executionS... |
python | def set_dimension(tensor, axis, value):
"""Set the length of a tensor along the specified dimension.
Args:
tensor: Tensor to define shape of.
axis: Dimension to set the static shape for.
value: Integer holding the length.
Raises:
ValueError: When the tensor already has a different length specifi... |
java | @Activate
protected void activate(ComponentContext context) {
if (TraceComponent.isAnyTracingEnabled() && tc.isEventEnabled())
Tr.event(tc, "activate", context);
} |
java | public static void addManifestLocations(VirtualFile file, List<VirtualFile> paths) throws IOException {
if (file == null) {
throw MESSAGES.nullArgument("file");
}
if (paths == null) {
throw MESSAGES.nullArgument("paths");
}
boolean trace = VFSLogger.ROOT_L... |
java | private Document parse(File file) {
try {
DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
DocumentBuilder builder = factory.newDocumentBuilder();
builder.setEntityResolver(new EntityResolver() {
@Override
public Inp... |
java | @Override
public Query createNamedQuery(String name)
{
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
Tr.debug(tc, "em.createNamedQuery(" + name + ");\n" + toString());
return getEMInvocationInfo(false).createNamedQuery(name);
} |
python | def _publish_replset(self, data, base_prefix):
""" Given a response to replSetGetStatus, publishes all numeric values
of the instance, aggregate stats of healthy nodes vs total nodes,
and the observed statuses of all nodes in the replica set.
"""
prefix = base_prefix + ['... |
python | def requestAvatarId(self, credentials):
"""
Return the ID associated with these credentials.
@param credentials: something which implements one of the interfaces in
self.credentialInterfaces.
@return: a Deferred which will fire a string which identifies an
avatar, an em... |
java | @SuppressWarnings("rawtypes")
public Collection getCMP20Collection(Collection keys)
throws FinderException,
RemoteException
{
return ivEntityHelper.getCMP20Collection(this, keys);
} |
java | private RSAPrivateKey loadPrivateKeyFromPEMFile(String filename) {
try {
String publicKeyFile = FileReader.readFileFromClassPathOrPath(filename);
byte[] publicKeyBytes = DatatypeConverter.parseBase64Binary(publicKeyFile.replace("-----BEGIN RSA PRIVATE KEY-----", "").replace("-----END RSA... |
python | def render_tree(self, **kwargs):
"""Render the graph, and return (l)xml etree"""
self.setup(**kwargs)
svg = self.svg.root
for f in self.xml_filters:
svg = f(svg)
self.teardown()
return svg |
java | @Override
public void validate(ValidationHelper helper, Context context, String key, ServerVariables t) {
if (t != null) {
boolean mapContainsInvalidKey = false;
for (String k : t.keySet()) {
if (k == null || k.isEmpty()) {
mapContainsInvalidKey = ... |
java | @Override
public T transformElement(Tuple2<AerospikeKey, AerospikeRecord> tuple, DeepJobConfig<T, ? extends DeepJobConfig> config) {
try {
return (T) UtilAerospike.getObjectFromAerospikeRecord(config.getEntityClass(), tuple._2(),
(AerospikeDeepJobConfig) this.deepJobConfig);
... |
java | @Override
public void loadModel(InputStream modelIs) {
ByteArrayOutputStream baos = new ByteArrayOutputStream();
try {
IOUtils.copy(modelIs, baos);
} catch (IOException e) {
LOG.error("Load model err.", e);
}
InputStream isForSVMLoad = new ByteArrayI... |
java | public String getDetailName(CmsResource res, Locale locale, List<Locale> defaultLocales) throws CmsException {
String urlName = readBestUrlName(res.getStructureId(), locale, defaultLocales);
if (urlName == null) {
urlName = res.getStructureId().toString();
}
return urlName;
... |
python | def get_next_invalid_time_from_t(self, timestamp):
"""Get next invalid time for time range
:param timestamp: time we compute from
:type timestamp: int
:return: timestamp of the next invalid time (LOCAL TIME)
:rtype: int
"""
if not self.is_time_valid(timestamp):
... |
java | @Deprecated
public void sendRow(long sheetId, long rowId, RowEmail email) throws SmartsheetException {
this.createResource("sheets/" + sheetId + "/rows/" + rowId + "/emails", RowEmail.class, email);
} |
java | protected boolean txWarning(List<ValidationMessage> errors, String txLink, IssueType type, int line, int col, String path, boolean thePass, String msg, Object... theMessageArguments) {
if (!thePass) {
msg = formatMessage(msg, theMessageArguments);
errors.add(new ValidationMessage(Source.TerminologyEngin... |
java | public static ProtoFile parse(String name, String data) {
return new ProtoParser(name, data.toCharArray()).readProtoFile();
} |
java | @Override
public final void handleMessage(Exchange exchange) throws HandlerException {
if (ExchangePhase.IN.equals(exchange.getPhase())) {
ExchangeContract contract = exchange.getContract();
KnowledgeOperation operation = getOperation(contract.getProviderOperation());
if ... |
python | async def flush(self, request: Request, stacks: List[Stack]):
"""
For all stacks to be sent, append a pause after each text layer.
"""
ns = await self.expand_stacks(request, stacks)
ns = self.split_stacks(ns)
ns = self.clean_stacks(ns)
await self.next(request, [... |
python | def parse_url_query_params(url, fragment=True):
"""Parse url query params
:param fragment: bool: flag is used for parsing oauth url
:param url: str: url string
:return: dict
"""
parsed_url = urlparse(url)
if fragment:
url_query = parse_qsl(parsed_url.fragment)
else:
url_... |
java | @Override
public <C extends CrudResponse, T extends AssociationEntity> C disassociateWithEntity(Class<T> type, Integer entityId,
AssociationField<T, ? extends BullhornEntity> associationName, Set<Integer> associationIds) {
... |
java | protected Pair<Integer, FlatBufferBuilder> encodeStaticHeader(byte type) {
FlatBufferBuilder fbb = new FlatBufferBuilder(12);
int staticInfoOffset = UIStaticInfoRecord.createUIStaticInfoRecord(fbb, type);
fbb.finish(staticInfoOffset);
int lengthHeader = fbb.offset(); //MUST be cal... |
java | private String antToRegexConverter(String antStyleLocationPattern) {
String regexStyleLocationPattern = antStyleLocationPattern.replace("\\", "/");
regexStyleLocationPattern = regexStyleLocationPattern.replaceAll("\\.", "\\\\."); // replace . with \\.
regexStyleLocationPattern = regexStyleLocati... |
python | def parse_all_data(self):
"""Parses the master df."""
self._master_df.columns = ["domain", "entity", "state", "last_changed"]
# Check if state is float and store in numericals category.
self._master_df["numerical"] = self._master_df["state"].apply(
lambda x: functions.isfloa... |
python | def is_ternary(self, keyword):
"""return true if the given keyword is a ternary keyword
for this ControlLine"""
return keyword in {
'if':set(['else', 'elif']),
'try':set(['except', 'finally']),
'for':set(['else'])
}.get(self.keyword, []) |
java | public Request makeRequest(HttpMethod httpMethod, String urlPath, boolean cached) throws IOException
{
Preconditions.checkState(lifecycleLock.awaitStarted(1, TimeUnit.MILLISECONDS));
return new Request(httpMethod, new URL(StringUtils.format("%s%s", getCurrentKnownLeader(cached), urlPath)));
} |
python | def get_version(package):
"""
Return package version as listed in `__version__` in `init.py`.
"""
init_py = codecs.open(os.path.join(package, '__init__.py'), encoding='utf-8').read()
return re.search("^__version__ = ['\"]([^'\"]+)['\"]", init_py, re.MULTILINE).group(1) |
python | def read_actions():
"""Yields actions for pressed keys."""
while True:
key = get_key()
# Handle arrows, j/k (qwerty), and n/e (colemak)
if key in (const.KEY_UP, const.KEY_CTRL_N, 'k', 'e'):
yield const.ACTION_PREVIOUS
elif key in (const.KEY_DOWN, const.KEY_CTRL_P, 'j... |
python | def fill_with_sample_data(self):
"""This function fills the corresponding object with sample data."""
# replace these sample data with another dataset later
# this function is deprecated as soon as a common file format for this
# type of data will be available
self.p01 = np.array... |
python | def show_firmware_version_output_show_firmware_version_copy_right_info(self, **kwargs):
"""Auto Generated Code
"""
config = ET.Element("config")
show_firmware_version = ET.Element("show_firmware_version")
config = show_firmware_version
output = ET.SubElement(show_firmware... |
java | public void setComparator(int index, Comparator<T> comparator) {
if (comparator instanceof InvertibleComparator) {
this.comparators.set(index, (InvertibleComparator<T>) comparator);
}
else {
this.comparators.set(index, new InvertibleComparator<T>(comparator));
}
} |
java | public static Trades adaptTrades(
BitcoindeTradesWrapper bitcoindeTradesWrapper, CurrencyPair currencyPair) {
List<Trade> trades = new ArrayList<>();
long lastTradeId = 0;
for (BitcoindeTrade bitcoindeTrade : bitcoindeTradesWrapper.getTrades()) {
final long tid = bitcoindeTrade.getTid();
... |
python | def set_enable_flag_keep_rect_within_constraints(self, enable):
""" Enable/disables the KeepRectangleWithinConstraint for child states """
for child_state_v in self.child_state_views():
self.keep_rect_constraints[child_state_v].enable = enable
child_state_v.keep_rect_constraints[... |
python | def remove_node(self, node):
"""
Removes node from circle and rebuild it.
"""
try:
self._nodes.remove(node)
del self._weights[node]
except (KeyError, ValueError):
pass
self._hashring = dict()
self._sorted_keys = []
... |
java | public GitlabMergeRequestApprovals setMergeRequestApprovers(GitlabMergeRequest mr,
Collection<Integer> userApproverIds,
Collection<Integer> groupApproverIds) throws IOException {
Strin... |
python | def get_default_config_filename():
"""Returns the configuration filepath.
If PEYOTL_CONFIG_FILE is in the env that is the preferred choice; otherwise ~/.peyotl/config is preferred.
If the preferred file does not exist, then the packaged peyotl/default.conf from the installation of peyotl is
used.
A... |
java | public static String[] readStringArray(DataInput in) throws IOException {
int len = in.readInt();
if (len == -1)
return null;
String[] s = new String[len];
for (int i = 0; i < len; i++) {
s[i] = readString(in);
}
return s;
} |
python | def CollectMetrics(self, request, context):
"""Dispatches the request to the plugins collect method"""
LOG.debug("CollectMetrics called")
try:
metrics_to_collect = []
for metric in request.metrics:
metrics_to_collect.append(Metric(pb=metric))
m... |
java | public void clearPersonData() {
this.rollbar.configure(new ConfigProvider() {
@Override
public Config provide(ConfigBuilder builder) {
return builder
.person(null)
.build();
}
});
} |
java | public void similar(IMatrix U, IMatrix result) {
if ((result.rows != U.columns) || (result.columns != U.columns)) result.reshape(U.columns, U.columns);
double realsum, imagsum, realinnersum, imaginnersum;
for (int i = 0; i < U.columns; i++)
for (int j = 0; j < U.columns; j++) {
... |
java | public boolean check(ByteBuffer data)
{
assert (data != null);
int size = data.limit();
// This function is on critical path. It deliberately doesn't use
// recursion to get a bit better performance.
Trie current = this;
int start = 0;
while (true) {
... |
python | def add_existing_session(self, dwProcessId, bStarted = False):
"""
Use this method only when for some reason the debugger's been attached
to the target outside of WinAppDbg (for example when integrating with
other tools).
You don't normally need to call this method. Most users s... |
java | private void scheduleEvictionTask(long timeoutInMilliSeconds) {
EvictionTask evictionTask = new EvictionTask();
// Before creating new Timers, which create new Threads, we
// must ensure that we are not using any application classloader
// as the current thread's context classloader. O... |
java | protected ZooKeeperServer createZookeeperServer(File logDir) {
try {
return new ZooKeeperServer(logDir, logDir, 2000);
} catch (IOException e) {
throw new CitrusRuntimeException("Failed to create embedded zookeeper server", e);
}
} |
java | public com.google.protobuf.ByteString
getDeviceTypeBytes() {
java.lang.Object ref = deviceType_;
if (ref instanceof java.lang.String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8(
(java.lang.String) ref);
deviceType_ = b;
retur... |
java | public void init(Object env, Map<String,Object> properties, Object applet)
{
m_resources = null;
super.init(env, properties, applet);
if (m_env == null)
{
if (env != null)
m_env = (Environment)env;
else
m_env = this.getEnvironme... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.