language stringclasses 2
values | func_code_string stringlengths 63 466k |
|---|---|
python | def refresh_leader_status(self, instance):
"""
calls kubeutil.refresh_leader and compares the resulting
leader status with the previous one.
If it changed, update the event collection logic
"""
if not self.leader_candidate:
return
leader_status = self... |
java | @SuppressWarnings("rawtypes")
@Override
public EntityManagerFactory createEntityManagerFactory(final String unit, final Map map) {
initJpaCounter();
final PersistenceProvider persistenceProvider = findDelegate(map);
final ClassLoader tccl = tccl();
final ClassLoader hack = AccessController.doPrivilege... |
python | def replace_namespaced_service_status(self, name, namespace, body, **kwargs): # noqa: E501
"""replace_namespaced_service_status # noqa: E501
replace status of the specified Service # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP requ... |
python | def temp_output_file(prefix="tmp", suffix="", dir=None, make_parents=False, always_clean=False):
"""
A context manager for convenience in creating a temporary file,
which is deleted when exiting the context.
Usage:
with temp_output_file() as (fd, path):
...
"""
return _temp_output(False, prefix=p... |
java | public Packer putBytesF(final byte[] value) {
putInt(value.length);
ensureCapacity(bufPosition + value.length);
System.arraycopy(value, 0, buf, bufPosition, value.length);
bufPosition += value.length;
return this;
} |
java | void addToRelockList(final DeviceProxy dev, final int validity) throws DevFailed {
// Check if it is the first relock
if (relockMap == null) {
// Create hash table for admin devices object
relockMap = new Hashtable<String, LockedDeviceAmin>();
// Create a thread to u... |
python | def blockcode(self, text, lang):
""" Pass a code fence through pygments """
if lang and self._config.get('highlight_syntax', 'True'):
try:
lexer = pygments.lexers.get_lexer_by_name(lang, stripall=True)
except pygments.lexers.ClassNotFound:
lexer = ... |
java | public T save() {
beforeAll();
if (isNew()) {
beforeInsert();
crudService.insert(entity);
afterInsert();
} else {
beforeUpdate();
entity = crudService.update(entity);
afterUpdate();
}
afterAll();
retu... |
python | def make_stalecheck_middleware(
allowable_delay,
skip_stalecheck_for_methods=SKIP_STALECHECK_FOR_METHODS):
"""
Use to require that a function will run only of the blockchain is recently updated.
This middleware takes an argument, so unlike other middleware, you must make the middleware
... |
java | public Method getMethod(String returnType, String name, String... paramTypeNames) {
final Map<ParamNameList, Map<String, Method>> nameMap = methodsByTypeName.get(name);
if (nameMap == null) {
return null;
}
final Map<String, Method> paramsMap = nameMap.get(createParamNameList... |
java | public SIMPIterator getRemoteSubscriptions()
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.entry(tc, "getRemoteSubscriptions");
List durableConsumers = new LinkedList();
if(_anycastInputHandler!=null)
{
//we have a durable consumer
durableConsumers.add(_... |
java | public static void sortNode(TreeNode node, Comparator comparator) {
TreeNodeList children = (TreeNodeList) node.getChildren();
if (children != null && !children.isEmpty()) {
Object[] childrenArray = children.toArray();
Arrays.sort(childrenArray, comparator);
for (int... |
python | def update_correlated(self, z, R=None, H=None):
""" Add a new measurement (z) to the Kalman filter assuming that
process noise and measurement noise are correlated as defined in
the `self.M` matrix.
If z is None, nothing is changed.
Parameters
----------
z : (di... |
java | static Predicate<DateValue> weekIntervalFilter(final int interval, final DayOfWeek weekStart, final DateValue dtStart) {
return new Predicate<DateValue>() {
private static final long serialVersionUID = 7059994888520369846L;
//the latest day with day of week weekStart on or before dtStart
DateValue wkStart;
... |
python | def OnMoreSquareToggle( self, event ):
"""Toggle the more-square view (better looking, but more likely to filter records)"""
self.squareMap.square_style = not self.squareMap.square_style
self.squareMap.Refresh()
self.moreSquareViewItem.Check(self.squareMap.square_style) |
python | def ParseLocalEntryRow(
self, parser_mediator, query, row, cache=None, database=None,
**unused_kwargs):
"""Parses a local entry row.
Args:
parser_mediator (ParserMediator): mediates interactions between parsers
and other components, such as storage and dfvfs.
query (str): quer... |
python | def rotation_coefs(self):
""" get the rotation coefficents in radians
Returns
-------
rotation_coefs : list
the rotation coefficients implied by Vario2d.bearing
"""
return [np.cos(self.bearing_rads),
np.sin(self.bearing_rads),
... |
python | def toLily(self):
'''
Method which converts the object instance, its attributes and children to a string of lilypond code
:return: str of lilypond code
'''
lilystring = ""
if self.item is not None:
if not isinstance(self.GetChild(0), NoteNode):
... |
java | public Map<String, Object> entityProps(ManagedObjectReference entityMor, String[] props)
throws InvalidPropertyFaultMsg, RuntimeFaultFaultMsg {
final HashMap<String, Object> retVal = new HashMap<>();
// Create PropertyFilterSpec using the PropertySpec and ObjectPec
PropertyFilterSpec... |
java | public final void setColor(Color color, int x, int y) {
int[] pixels = ((DataBufferInt)img.getRaster().getDataBuffer()).getData();
int red = (int)(color.getRed() * 255.0);
int green = (int)(color.getGreen() * 255.0);
int blue = (int)(color.getBlue() * 255.0);
int alpha = (i... |
python | def copy(self):
"""Create a copy of the Vector"""
cpy_vec = Vector4()
cpy_vec.x = self.x
cpy_vec.y = self.y
cpy_vec.z = self.z
cpy_vec.w = self.w
return cpy_vec |
python | def _full_axis_reduce(self, axis, func, alternate_index=None):
"""Applies map that reduce Manager to series but require knowledge of full axis.
Args:
func: Function to reduce the Manager by. This function takes in a Manager.
axis: axis to apply the function to.
alter... |
java | private Type parseReferenceType(EnclosingScope scope) {
int start = index;
match(Ampersand);
// Try to parse an annotated lifetime
int backtrack = index;
Identifier lifetimeIdentifier = parseOptionalLifetimeIdentifier(scope, false);
if (lifetimeIdentifier != null) {
// We cannot allow a newline after th... |
python | def addToNetwork(grph, nds, count, weighted, nodeType, nodeInfo, fullInfo, coreCitesDict, coreValues, detailedValues, addCR, recordToCite = True, headNd = None):
"""Addeds the citations _nds_ to _grph_, according to the rules give by _nodeType_, _fullInfo_, etc.
_headNd_ is the citation of the Record
"""
... |
java | @Override
public RowQuery<K, C> getKey(final K rowKey) {
return new AbstractRowQueryImpl<K, C>(columnFamily.getColumnSerializer()) {
private boolean firstPage = true;
@Override
public ColumnQuery<C> getColumn(final C column) {
return new ColumnQuery<C>() ... |
java | public void setMethodDefaults(String method)
{
String defaultMethod = m_properties.getProperty(OutputKeys.METHOD);
if((null == defaultMethod) || !defaultMethod.equals(method)
// bjm - add the next condition as a hack
// but it is because both output_xml.properties and
// o... |
java | @NullSafe
public static boolean isDigits(String value) {
for (char chr : toCharArray(value)) {
if (!Character.isDigit(chr)) {
return false;
}
}
return hasText(value);
} |
python | def page(self, category=values.unset, start_date=values.unset,
end_date=values.unset, include_subaccounts=values.unset,
page_token=values.unset, page_number=values.unset,
page_size=values.unset):
"""
Retrieve a single page of DailyInstance records from the API.
... |
python | def change_ssh_port():
"""
For security woven changes the default ssh port.
"""
host = normalize(env.host_string)[1]
after = env.port
before = str(env.DEFAULT_SSH_PORT)
host_string=join_host_strings(env.user,host,before)
with settings(host_string=host_string, user=env.user):
... |
python | def updateIncomeProcess(self):
'''
An alternative method for constructing the income process in the infinite horizon model.
Parameters
----------
none
Returns
-------
none
'''
if self.cycles == 0:
tax_rate = (self.IncUnemp*sel... |
java | public String getString(Object node, String expression) {
return (String) evalXPath(expression, node, XPathConstants.STRING);
} |
python | def make_url(url, *paths):
"""Joins individual URL strings together, and returns a single string.
"""
for path in paths:
url = re.sub(r'/?$', re.sub(r'^/?', '/', path), url)
return url |
java | public static <S extends Solution<?>> double[][] distanceMatrix(List<S> solutionSet) {
double[][] distance = new double[solutionSet.size()][solutionSet.size()];
for (int i = 0; i < solutionSet.size(); i++) {
distance[i][i] = 0.0;
for (int j = i + 1; j < solutionSet.size(); j++) {
distance[i]... |
java | public static Map<String, Object> buildEventAttributeMap(final Principal principal,
final Optional<RegisteredService> service,
final MultifactorAuthenticationProvider provider) {
val map = n... |
java | @UiHandler("m_submitButton")
public void onClickSubmit(ClickEvent event) {
String separator = ",";
String selectedValue = m_separator.getText().trim();
if (!CmsStringUtil.isEmptyOrWhitespaceOnly(selectedValue)) {
separator = selectedValue;
}
m_separatorFi... |
java | protected Content getFramesJavaScript() {
HtmlTree scriptTree = HtmlTree.SCRIPT();
String scriptCode = "\n" +
" tmpTargetPage = \"\" + window.location.search;\n" +
" if (tmpTargetPage != \"\" && tmpTargetPage != \"undefined\")\n" +
" tmpTarget... |
java | public void endTiming(String name, float elapsed) {
Counter counter = get(name, CounterType.Interval);
calculateStats(counter, elapsed);
update();
} |
python | def closeEvent(self, event: QCloseEvent):
"""
This function is automatically called when the window is closed using the close [X] button in the window
decorations or by right clicking in the system window list and using the close action, or similar ways to close
the window.
Just ... |
python | def display_xdata(self) -> DataAndMetadata.DataAndMetadata:
"""Return the extended data of this data item display.
Display data will always be 1d or 2d and either int, float, or RGB data type.
.. versionadded:: 1.0
Scriptable: Yes
"""
display_data_channel = self.__disp... |
java | public ServiceFuture<List<EntityRole>> getCustomPrebuiltEntityRolesAsync(UUID appId, String versionId, UUID entityId, final ServiceCallback<List<EntityRole>> serviceCallback) {
return ServiceFuture.fromResponse(getCustomPrebuiltEntityRolesWithServiceResponseAsync(appId, versionId, entityId), serviceCallback);
... |
java | public String convertMappingOptionMapValueToString(EDataType eDataType, Object instanceValue) {
return instanceValue == null ? null : instanceValue.toString();
} |
python | def pipe_strreplace(context=None, _INPUT=None, conf=None, **kwargs):
"""A string module that replaces text. Loopable.
Parameters
----------
context : pipe2py.Context object
_INPUT : iterable of items or strings
conf : {
'RULE': [
{
'param': {'value': <match t... |
java | @Nonnull
private JsonToken nextSymbol() {
lastChar = 0;
return new JsonToken(JsonToken.Type.SYMBOL, buffer, bufferOffset, 1, lineNo, linePos);
} |
python | def setTimeStart( self, timeStart ):
"""
Sets the start time for this item. This will automatically push the
end time to match the length for this item. So if the item starts
at 11a and ends on 1p, and the start time is changed to 12p
the end time will change to 2p. To af... |
python | def xray_botocore_api_call(wrapped, instance, args, kwargs):
"""Wrapper around botocore's base client API call method."""
return generic_xray_wrapper(
wrapped, instance, args, kwargs,
name=get_service_name,
namespace='aws',
metadata_extractor=extract_aws_metadata,
error_h... |
java | public static double[] getOutRectangle( List<GeoPoint> geoPoints )
{
double nwLat = geoPoints.get( 0 ).getLatitude();
double nwLon = geoPoints.get( 0 ).getLongitude();
double seLat = geoPoints.get( 0 ).getLatitude();
double seLon = geoPoints.get( 0 ).getLongitude();
double minLon = 0, maxLon = 0, ... |
java | public static RRSIGRecord
sign(RRset rrset, DNSKEYRecord key, PrivateKey privkey,
Date inception, Date expiration, String provider) throws DNSSECException
{
int alg = key.getAlgorithm();
checkAlgorithm(privkey, alg);
RRSIGRecord rrsig = new RRSIGRecord(rrset.getName(), rrset.getDClass(),
rrset.getTTL(... |
python | def most_visited_pages_stats():
"""
Get stats for most visited pages.
Args:
logs (list): logs data to use.
Returns:
dict: more_than_10 and less_than_10: list of dict (bound + url list).
"""
stats = {'more_than_10': [], 'less_than_10': {}}
counter = Counter(list(RequestLog.... |
python | def display(self, codes=[], fg=None, bg=None):
"""Displays the codes using ANSI escapes
"""
codes, fg, bg = Magic.displayformat(codes, fg, bg)
self.stream.write(Magic.display(codes, fg, bg))
self.flush() |
java | @Nonnull
public static <T> LTieFltConsumer<T> tieFltConsumerFrom(Consumer<LTieFltConsumerBuilder<T>> buildingFunction) {
LTieFltConsumerBuilder builder = new LTieFltConsumerBuilder();
buildingFunction.accept(builder);
return builder.build();
} |
python | def tooltip_queries(self, item, x_coord, y_coord, key_mode, tooltip, text):
"""
The function is used for setting tooltip on menus and submenus
"""
tooltip.set_text(text)
return True |
java | public void doValidRecord(boolean bDisplayOption)
{
if (m_recPackagesExclude == null)
{
RecordOwner recordOwner = this.getOwner().findRecordOwner();
m_recPackagesExclude = new Packages(recordOwner);
if (recordOwner != null)
recordOwner.removeRecord... |
python | def loadstack(self):
print("Loading stack from: %s" % self.stack_fn)
data = np.load(self.stack_fn, encoding='latin1')
#self.fn_list = list([i.decode("utf-8") for i in data['fn_list']])
self.fn_list = data['fn_list']
#Load flags originally used for stack creation
#self.fla... |
java | public void destroy() {
if (mContentView != null) {
if (mGroupBasicAdapter != null) {
mGroupBasicAdapter.destroy();
}
mContentView.setAdapter(null);
mContentView = null;
}
TimerSupport timerSupport = getService(TimerSupport.class);
... |
python | def set_snap_server_variables(host, port, snap_extension='.xml', path=None):
""" Change dynamically port and host variable in xml Snap! project file"""
localdir = os.getcwd()
if path is None:
os.chdir(os.path.dirname(os.path.realpath(__file__)))
else:
os.chdir(path)
xml_files = [f f... |
python | def do_encode(cls, obj):
# type: (Any) -> Any
"""Encodes the passed object into json"""
if isinstance(obj, ConjureBeanType):
return cls.encode_conjure_bean_type(obj)
elif isinstance(obj, ConjureUnionType):
return cls.encode_conjure_union_type(obj)
elif i... |
python | def create_new_client(self, give_focus=True, filename='', is_cython=False,
is_pylab=False, is_sympy=False, given_name=None):
"""Create a new client"""
self.master_clients += 1
client_id = dict(int_id=to_text_string(self.master_clients),
str... |
java | private boolean tryExecutingCommand(Command cmd)
throws IOException,
FTPReplyParseException,
ServerException {
Reply reply = controlChannel.exchange(cmd);
return Reply.isPositiveCompletion(reply);
} |
python | def order_duplicate_volume(self, origin_volume_id, origin_snapshot_id=None,
duplicate_size=None, duplicate_iops=None,
duplicate_tier_level=None,
duplicate_snapshot_size=None,
hourly_billing_flag=F... |
java | public DeleteSessionResponse deleteSession(DeleteSessionRequest request) {
checkNotNull(request, "The parameter request should NOT be null.");
checkStringNotEmpty(request.getSessionId(), "The parameter sessionId should NOT be null or empty string.");
InternalRequest internalRequest = createReque... |
python | def bfs(self, root = None, display = None):
'''
API: bfs(self, root = None, display = None)
Description:
Searches tree starting from node named root using breadth-first
strategy if root argument is provided. Starts search from root node
of the tree otherwise.
... |
java | @Override
public void cleanupSession(long sessionId) {
Set<Long> blockIds;
try (LockResource lr = new LockResource(mLock)) {
blockIds = mSessionIdToBlockIds.get(sessionId);
if (blockIds == null) {
return;
}
}
// Note that, there can be a race condition that blockIds can be st... |
java | public int addNodeInDocOrder(Node node, XPathContext support)
{
if (!m_mutable)
throw new RuntimeException(XSLMessages.createXPATHMessage(XPATHErrorResources.ER_NODESET_NOT_MUTABLE, null)); //"This NodeSet is not mutable!");
return addNodeInDocOrder(node, true, support);
} |
java | public void declare(TypeId<?> type, String sourceFile, int flags,
TypeId<?> supertype, TypeId<?>... interfaces) {
TypeDeclaration declaration = getTypeDeclaration(type);
int supportedFlags = Modifier.PUBLIC | Modifier.FINAL | Modifier.ABSTRACT
| AccessFlags.ACC_SYNTHETIC;
... |
java | public IVersionRange merge(IVersionRange... ranges) {
if (ranges.length < 2) {
return ranges[0];
}
// Check the type of the first range
if (!(ranges[0] instanceof VersionRange)) {
if (!(ranges[0] instanceof OrRange)) {
throw new UnsupportedOperationException("Incorrect type for rang... |
java | public String printHelixSummary() {
StringBuffer g = new StringBuffer(); //3-10 helix
StringBuffer h = new StringBuffer(); //alpha helix
StringBuffer i = new StringBuffer(); //pi-helix
StringBuffer ss = new StringBuffer(); //SS summary
StringBuffer aa = new StringBuffer(); //AA one-letter
String nl = Syste... |
java | public boolean setColumnValue(int iColumnIndex, Object value, boolean bDisplay, int iMoveMode)
{
Convert fieldInfo = this.getFieldInfo(iColumnIndex);
if (fieldInfo != null)
{
Object dataBefore = fieldInfo.getData();
if (!(value instanceof String))
fiel... |
java | public static List<String> splitAsList(String text, String delimiter) {
List<String> answer = new ArrayList<String>();
if (text != null && text.length() > 0) {
answer.addAll(Arrays.asList(text.split(delimiter)));
}
return answer;
} |
python | def show_weights(self, **kwargs):
"""
Call :func:`eli5.show_weights` for the locally-fit
classification pipeline. Keyword arguments are passed
to :func:`eli5.show_weights`.
:func:`fit` must be called before using this method.
"""
self._fix_target_names(kwargs)
... |
java | public void scale(int scale){
parameterSize *= scale;
updaterStateSize *= scale;
workingMemoryFixedInference *= scale;
workingMemoryVariableInference *= scale;
cacheModeMemFixed = scaleEntries(cacheModeMemFixed, scale);
cacheModeMemVariablePerEx = scaleEntries(cacheModeMe... |
java | public static ArrayList<String> fixRequiredByFeature(String fixApar, Map<String, ProvisioningFeatureDefinition> installedFeatures) {
ArrayList<String> dependencies = new ArrayList<String>();
for (ProvisioningFeatureDefinition fd : installedFeatures.values()) {
String requireFixes = fd.getHea... |
python | def add(self, filename, raw_data=None, dx=None):
"""
Generic method to add a file to the session.
This is the main method to use when adding files to a Session!
If an APK file is supplied, all DEX files are analyzed too.
For DEX and ODEX files, only this file is analyzed (what ... |
python | def ethnicities_clean():
""" Get dictionary of unformatted ethnicity types mapped to clean corresponding ethnicity strings """
eths_clean = {}
fname = pkg_resources.resource_filename(__name__, 'resources/Ethnicity_Groups.csv')
with open(fname, 'rU') as csvfile:
reader = csv.reader(csvfile, delimiter = ',')... |
java | public static <T extends CharSequence> T checkNotEmpty(final T reference) {
if (TextUtils.isEmpty(reference)) {
throw new IllegalArgumentException();
}
return reference;
} |
java | private synchronized String publishObject(KeenProject project, URL url,
final Map<String, ?> requestData) throws IOException {
if (requestData == null || requestData.size() == 0) {
KeenLogging.log("No API calls were made because there were no events to u... |
python | def _create_alt_equals_ref_noncds(self):
"""Create an alt seq that matches the reference (for non-cds variants)"""
alt_data = AltTranscriptData(
list(self._transcript_data.transcript_sequence),
self._transcript_data.cds_start,
self._transcript_data.cds_stop,
... |
python | def score_large_straight_yatzy(dice: List[int]) -> int:
"""
Large straight scoring according to yatzy rules
"""
dice_set = set(dice)
if _are_two_sets_equal({2, 3, 4, 5, 6}, dice_set):
return sum(dice)
return 0 |
python | def get_question_passers(self, number: str) -> list:
"""
取得課程中特定題目通過者列表
"""
try:
# 操作所需資訊
params = {
'HW_ID': number
}
# 取得資料
response = self.__session.get(
self.__url + '/success.jsp', params=par... |
java | private void initializeFragmentSwitcher() {
mFragmentSwitcher = (FragmentSwitcher) findViewById(R.id.fragment_switcher);
mFragmentAdapter = new FragmentStateArrayPagerAdapter(getSupportFragmentManager());
mFragmentSwitcher.setAdapter(mFragmentAdapter);
} |
java | public void fill(List<CmsBrokenLinkBean> brokenLinkBeans) {
for (CmsBrokenLinkBean brokenLinkBean : brokenLinkBeans) {
m_linkPanel.add(createTreeItem(brokenLinkBean));
}
} |
java | @Override
public Map<String, Object> toMap() {
Map<String, Object> map = C.newMap();
for (Map.Entry<String, ValueObject> entry : entrySet()) {
map.put(entry.getKey(), entry.getValue().value());
}
return map;
} |
python | def url_to_fn(url):
"""
Convert `url` to filename used to download the datasets.
``http://kitakitsune.org/xe`` -> ``kitakitsune.org_xe``.
Args:
url (str): URL of the resource.
Returns:
str: Normalized URL.
"""
url = url.replace("http://", "").replace("https://", "")
ur... |
python | def ops_entity(self, ops):
''' Returns a new multi-op entity name string that represents
all the given operations and caveats. It returns the same value
regardless of the ordering of the operations. It assumes that the
operations have been canonicalized and that there's at least one
... |
java | public void setApplicationId(String applicationId) {
// Set the application id as a GeoPackage
int applicationIdInt = ByteBuffer.wrap(applicationId.getBytes())
.asIntBuffer().get();
execSQL(String.format("PRAGMA application_id = %d;", applicationIdInt));
} |
java | @Override
public Object getLock() {
ResourceSet resourceSet = this.getResourceSet();
if ((resourceSet instanceof ISynchronizable<?>)) {
return ((ISynchronizable<?>) resourceSet).getLock();
}
return this;
} |
python | def read_graph(filename, directed=False, weighted=False, default_weight=None):
"""Read a graph from a text file
:param filename: plain text file. All numbers are separated by space.
Starts with a line containing n (#vertices) and m (#edges).
Then m lines follow, for each edge.
... |
java | public static base_responses create(nitro_service client, dnskey resources[]) throws Exception {
base_responses result = null;
if (resources != null && resources.length > 0) {
dnskey createresources[] = new dnskey[resources.length];
for (int i=0;i<resources.length;i++){
createresources[i] = new dnskey();
... |
python | def ParseGroupEntry(self, line):
"""Extract the members of a group from /etc/group."""
fields = ("name", "passwd", "gid", "members")
if line:
rslt = dict(zip(fields, line.split(":")))
name = rslt["name"]
group = self.entry.setdefault(name, rdf_client.Group(name=name))
group.pw_entry.... |
java | public Solution getSolution(String id) {
for( Solution s : Solution.all() )
if(s.id.equals(id))
return s;
return null;
} |
java | public static String toGetterName(JavacNode field) {
return HandlerUtil.toGetterName(field.getAst(), getAccessorsForField(field), field.getName(), isBoolean(field));
} |
python | def _set_title(self, item):
"""
attempt to set title from wikidata
"""
title = None
lang = self.params['lang']
label = self.data['label']
if item.get('sitelinks'):
for link in item['sitelinks']:
if link == "%swiki" % lang:
... |
java | public Object getNearObject(Object farObject) {
Object nearObject = null;
if (farObject instanceof BridgeFacet) {
BridgeFacet facet = (BridgeFacet) farObject;
if (facet.hasBridgeFacets()) {
BridgeFacets facets = facet.getBridgeFacets();
if (facets.... |
java | public KerasModelBuilder modelHdf5Filename(String modelHdf5Filename)
throws UnsupportedKerasConfigurationException, InvalidKerasConfigurationException, IOException {
checkForExistence(modelHdf5Filename);
synchronized (Hdf5Archive.LOCK_OBJECT) {
try {
this.weightsA... |
java | public static Date parseDate(String str, Locale locale, String... parsePatterns) throws ParseException {
return parseDateWithLeniency(str, locale, parsePatterns, true);
} |
python | def _send_result_to_redis(self, result):
"""Sends the result of a poll to redis to be used potentially by
another process
@param result: the result retrieved from kafka"""
if self.redis_connected:
self.logger.debug("Sending result to redis")
try:
... |
python | def lock_reward(self, agreement_id, amount, account):
"""
Lock reward condition.
:param agreement_id: id of the agreement, hex str
:param amount: Amount of tokens, int
:param account: Account
:return: bool
"""
return self._keeper.lock_reward_condition.ful... |
java | public Object addMenu(ScreenFieldView sfView)
{
char rgchShortcuts[] = new char[30];
Object menubar = sfView.createMenu();
sfView.addStandardMenu(menubar, MenuConstants.FILE, rgchShortcuts);
sfView.addStandardMenu(menubar, MenuConstants.EDIT, rgchShortcuts);
Object menu = nu... |
java | protected void throwJsonParameterParseFailureException(Object bean, String name, String json, Class<?> propertyType,
RuntimeException e) {
final StringBuilder sb = new StringBuilder();
sb.append("Cannot parse json of the request parameter.");
final Map<String, Object> retryMap = retr... |
python | def count(self, query=None, date=None):
'''
Run a query on the given cube and return only
the count of resulting matches.
:param query: The query in pql
:param date: date (metrique date range) that should be queried
If date==None then the most recent versions... |
java | private VarTensor calcFactorBeliefs(Factor factor) {
if (factor instanceof GlobalFactor) {
log.warn("Getting marginals of a global factor is not supported."
+ " This will require exponential space to store the resulting factor."
+ " This should only be used fo... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.