language stringclasses 2
values | func_code_string stringlengths 63 466k |
|---|---|
python | def url_for(endpoint_or_url_or_config_key: str,
_anchor: Optional[str] = None,
_cls: Optional[Union[object, type]] = None,
_external: Optional[bool] = False,
_external_host: Optional[str] = None,
_method: Optional[str] = None,
_scheme: Optional[str... |
python | def s(self, data, errors='strict'):
"""Decode value using correct Python 2/3 method.
This method is intended to replace the :py:meth:`~tcex.tcex.TcEx.to_string` method with
better logic to handle poorly encoded unicode data in Python2 and still work in Python3.
Args:
data (... |
python | def find_skill(self, param, author=None, skills=None):
# type: (str, str, List[SkillEntry]) -> SkillEntry
"""Find skill by name or url"""
if param.startswith('https://') or param.startswith('http://'):
repo_id = SkillEntry.extract_repo_id(param)
for skill in self.list():
... |
python | def fetchmany(self, size=None):
"""Fetch many"""
self._check_executed()
if size is None:
size = self.arraysize
rows = []
for i in range_type(size):
row = self.read_next()
if row is None:
break
rows.append(row)
... |
java | protected MetaMatcher createMetaMatcher(String filterAsString, Map<String, MetaMatcher> metaMatchers) {
for ( String key : metaMatchers.keySet() ){
if ( filterAsString.startsWith(key)){
return metaMatchers.get(key);
}
}
if (filterAsString.startsWith(GROOVY)) {
return new... |
java | public void marshall(ListLunaClientsRequest listLunaClientsRequest, ProtocolMarshaller protocolMarshaller) {
if (listLunaClientsRequest == null) {
throw new SdkClientException("Invalid argument passed to marshall(...)");
}
try {
protocolMarshaller.marshall(listLunaClien... |
java | public static ParsedPath toEntry(String rawPath) {
final String path = rawPath.trim();
final boolean startsWithDelimiter = path.startsWith("/");
// Keep the trailing delimiter.
// This allows us to treat paths that end with a delimiter differently from paths that don't.
// i.e.... |
java | public java.rmi.Remote getPort(Class serviceEndpointInterface) throws javax.xml.rpc.ServiceException {
try {
if (com.google.api.ads.admanager.axis.v201811.ProposalServiceInterface.class.isAssignableFrom(serviceEndpointInterface)) {
com.google.api.ads.admanager.axis.v201811.ProposalSe... |
java | public Object setValue(final Object value) {
final Object answer = this.value;
this.value = value;
return answer;
} |
java | boolean isLocked(final DeviceProxy deviceProxy) throws DevFailed {
final LockerInfo info = getLockerInfo(deviceProxy);
return info.isLocked();
} |
python | def load(self):
""" Loads a task if the active file is available.
"""
try:
_parser = parser.parse_config(self._paths['active_file'],
self.HEADER_ACTIVE_FILE)
# parse expected options into a dict to de-dupe
keys =... |
java | protected WebArchive genericCreateArchiveWithPems(String sourceWarName, String baseWarName, List<String> classList) throws Exception {
try {
String warName = baseWarName + ".war";
WebArchive newWar = ShrinkWrap.create(WebArchive.class, warName);
addDefaultFileAssetsForAppsToW... |
java | public void printControlEndForm(PrintWriter out, int iPrintOptions)
{
out.println(Utility.endTag(XMLTags.CONTROLS));
} |
java | public boolean hasUpgradeRan(final Class<? extends UpgradeItem> upgradeClass) throws SQLException {
PreparedStatement statement = null;
ResultSet results = null;
try {
statement = connection.prepareStatement("SELECT \"UPGRADECLASS\" FROM \"INSTALLEDUPGRADES\" WHERE \"UPGRADECLASS\" =... |
python | def parse_coordinate(string_rep, unit):
"""
Parse a single coordinate
"""
# explicit radian ('r') value
if string_rep[-1] == 'r':
return coordinates.Angle(string_rep[:-1], unit=u.rad)
# explicit image ('i') and physical ('p') pixels
elif string_rep[-1]... |
java | public Object next()
{
if(TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.entry(tc, "next");
StreamSet sourceStreamSet = (StreamSet)super.next();
SIMPPtoPOutboundTransmitControllable sourceStreamSetControl =
(SIMPPtoPOutboundTransmitControllable)sourceStreamSet.getCont... |
java | public static void colorizeToolbar(Toolbar toolbarView, int toolbarIconsColor, Activity activity) {
final PorterDuffColorFilter colorFilter
= new PorterDuffColorFilter(toolbarIconsColor, PorterDuff.Mode.SRC_IN);
for (int i = 0; i < toolbarView.getChildCount(); i++) {
final V... |
python | def lock_channel(self, channel, owner):
'''
Tag all files in channel <channel> also as channel <to_channel>
:param channel: channel to copy
:param owner: Perform this operation on all packages of this user
:param to_channel: Destination name (may be a channel that alrea... |
java | public static void debug(String format, Object... arguments) {
debug(LogFactory.indirectGet(), format, arguments);
} |
java | private String locateConfigFileName(String configDir, String configFileName) throws IOException {
String curDir = new File(".").getCanonicalPath();
String path = null;
// Go for at most 10 levels up
for (int i = 0; i < 10; i++) {
path = String.format("%s/%s", curDir, configFileName);
if (U... |
java | protected Component lookForComponent(String name, Component[] components) {
for (int i = 0; i < components.length && !mFindWithEqual; i++) {
//String componentName = ComponentNamer.getInstance().getNameForComponent(components[c]);
Component c = components[i];
checkName(name, ... |
python | def export(self, name, columns, points):
"""Write the points in MQTT."""
WHITELIST = '_-' + string.ascii_letters + string.digits
SUBSTITUTE = '_'
def whitelisted(s,
whitelist=WHITELIST,
substitute=SUBSTITUTE):
return ''.join(c... |
java | public static String resolveRelativeVolumeBinding(File baseDir, String bindingString) {
// a 'services:' -> service -> 'volumes:' may be formatted as:
// (https://docs.docker.com/compose/compose-file/compose-file-v2/#volumes-volume_driver)
//
// volumes:
// # Just specify a pat... |
java | public static void destroyAllActive(ContextualStorage storage)
{
Map<Object, ContextualInstanceInfo<?>> contextMap = storage.getStorage();
for (Map.Entry<Object, ContextualInstanceInfo<?>> entry : contextMap.entrySet())
{
Contextual bean = storage.getBean(entry.getKey());
... |
java | private void passViolations(ConstraintValidatorContext context,
Set<ConstraintViolation<Object>> source) {
for (final ConstraintViolation<Object> violation : source) {
final Iterator<Node> nodeIter = violation.getPropertyPath()
.iterator();
... |
python | def get_edges(self):
"""
Returns a list of tuples. Each tuple contains two elements (parent, child) for each edge.
Examples
--------
>>> reader = XBNReader('xbn_test.xml')
>>> reader.get_edges()
[('a', 'b'), ('a', 'c'), ('b', 'd'), ('c', 'd'), ('c', 'e')]
... |
python | def remove(self, **kwargs):
'''
:raises: :exc:`~dxpy.exceptions.DXError` if no project is associated with the object
Permanently removes the associated remote object from the
associated project.
'''
if self._proj is None:
raise DXError("Remove called when a ... |
python | def convert_values(self):
"""Convert datetimes to a comparable value in an expression.
"""
def stringify(value):
if self.encoding is not None:
encoder = partial(pprint_thing_encoded,
encoding=self.encoding)
else:
... |
python | def _advance_params(self):
"""
Explicitly generate new values for these parameters only
when appropriate.
"""
for p in ['x','y','direction']:
self.force_new_dynamic_value(p)
self.last_time = self.time_fn() |
java | public synchronized void stop() {
if (isRunning()) {
running.set(false);
DeviceFinder.getInstance().removeDeviceAnnouncementListener(announcementListener);
dbServerPorts.clear();
for (Client client : openClients.values()) {
try {
... |
python | def pretty_print_list_info(num_results, page_info=None, suffix=None):
"""Pretty print list info, with pagination, for user display."""
num_results_fg = "green" if num_results else "red"
num_results_text = click.style(str(num_results), fg=num_results_fg)
if page_info and page_info.is_valid:
page... |
java | public DscNodeConfigurationInner get(String resourceGroupName, String automationAccountName, String nodeConfigurationName) {
return getWithServiceResponseAsync(resourceGroupName, automationAccountName, nodeConfigurationName).toBlocking().single().body();
} |
java | public HttpServerExchange addResponseWrapper(final ConduitWrapper<StreamSinkConduit> wrapper) {
ConduitWrapper<StreamSinkConduit>[] wrappers = responseWrappers;
if (responseChannel != null) {
throw UndertowMessages.MESSAGES.responseChannelAlreadyProvided();
}
if(wrappers == n... |
python | def _compute_asset_ids(cls, inputs, marker_output_index, outputs, asset_quantities):
"""
Computes the asset IDs of every output in a transaction.
:param list[TransactionOutput] inputs: The outputs referenced by the inputs of the transaction.
:param int marker_output_index: The position ... |
java | public static DisqueClient create(ClientResources clientResources, DisqueURI disqueURI) {
assertNotNull(clientResources);
assertNotNull(disqueURI);
return new DisqueClient(clientResources, disqueURI);
} |
java | public static BOMInputStream getBOMInputStream(File file) throws IORuntimeException {
try {
return new BOMInputStream(new FileInputStream(file));
} catch (IOException e) {
throw new IORuntimeException(e);
}
} |
java | @Override
public CompletableFuture<DeleteScopeStatus> deleteScope(final String scopeName) {
return getScope(scopeName).deleteScope().handle((result, e) -> {
Throwable ex = Exceptions.unwrap(e);
if (ex == null) {
return DeleteScopeStatus.newBuilder().setStatus(DeleteSc... |
java | protected void clearReferences() {
// Unregister any JDBC drivers loaded by this classloader
Enumeration drivers = DriverManager.getDrivers();
while (drivers.hasMoreElements()) {
Driver driver = (Driver) drivers.nextElement();
if (driver.getClass().getClassLoader() == th... |
python | def request_url(self, request, proxies):
"""Obtain the url to use when making the final request.
If the message is being sent through a HTTP proxy, the full URL has to
be used. Otherwise, we should only use the path portion of the URL.
This should not be called from user code, and is o... |
java | @Deprecated
public static void writeWordVectors(@NonNull ParagraphVectors vectors, @NonNull File path) {
try (FileOutputStream fos = new FileOutputStream(path)) {
writeWordVectors(vectors, fos);
} catch (Exception e) {
throw new RuntimeException(e);
}
} |
python | def set_message(self, title, msg, typ, url=None):
"""
Sets user notification message.
Args:
title: Msg. title
msg: Msg. text
typ: Msg. type
url: Additional URL (if exists)
Returns:
Message ID.
"""
return self.... |
python | def remove_from_queue(self, index):
"""Remove a track from the queue by index. The index number is
required as an argument, where the first index is 0.
Args:
index (int): The (0-based) index of the track to remove
"""
# TODO: what do these parameters actually do?
... |
python | def _gettext_catalog(self, domain, language):
"""
Overrides jarn.jsi18n.view.jsi18n
See:
https://github.com/collective/jarn.jsi18n/issues/1
https://github.com/collective/jarn.jsi18n/pull/2
:param domain: translation domain
:param language: iso code for la... |
java | public String getValue(String key) throws IOException {
JsonParser p = this.getParser();
JsonToken t;
t = p.nextToken();
while (t != null) {
if (t == JsonToken.FIELD_NAME && p.getCurrentName().equals(key)) {
String value = p.nextTextValue();
p.close();
return value;
... |
java | public void replaceRowTab(String tabLabel, Component object, String toolTipText) {
int index = indexOfComponent(rowsTab);
remove(index);
ImageIcon rowsIcon = createImageIcon("/kg/apc/jmeter/img/checks.png");
insertTab(tabLabel, rowsIcon, object, toolTipText, index);
} |
python | def qbe_tree(graph, nodes, root=None):
"""
Given a graph, nodes to explore and an optinal root, do a breadth-first
search in order to return the tree.
"""
if root:
start = root
else:
index = random.randint(0, len(nodes) - 1)
start = nodes[index]
# A queue to BFS inste... |
java | public static Set<String> findFullPrefixKeys(Properties properties,
Optional<String> keyPrefix) {
TreeSet<String> propNames = new TreeSet<>();
for (Map.Entry<Object, Object> entry : properties.entrySet()) {
String entryKey = entry.getKey().toString();
i... |
java | private void populateStep4() {
this.insertRoadmapItem(3, true, I18nLabelsLoader.REPORT_STEP_THANKS, 4);
int y = 6;
// thanks
this.insertFixedTextBold(this, DEFAULT_PosX, y, DEFAULT_WIDTH_LARGE, STEP_THANKS, I18nLabelsLoader.REPORT_STEP_THANKS);
y += 12; // plus one line
... |
java | public void marshall(CreateRelationalDatabaseRequest createRelationalDatabaseRequest, ProtocolMarshaller protocolMarshaller) {
if (createRelationalDatabaseRequest == null) {
throw new SdkClientException("Invalid argument passed to marshall(...)");
}
try {
protocolMarsha... |
python | def write_aims(filename, atoms):
"""Method to write FHI-aims geometry files in phonopy context."""
lines = ""
lines += "# geometry.in for FHI-aims \n"
lines += "# | generated by phonopy.FHIaims.write_aims() \n"
lattice_vector_line = "lattice_vector " + "%16.16f "*3 + "\n"
for vec in atoms.get_... |
java | public final ColumnSpec getColumnSpec(String name) {
GetColumnSpecRequest request = GetColumnSpecRequest.newBuilder().setName(name).build();
return getColumnSpec(request);
} |
java | protected void fillStatement(PreparedStatement stmt, Object[] params)
throws SQLException {
fillStatement(stmt, params, null);
} |
java | private void readConfig(){
configuration = MoskitoConfigurationHolder.getConfiguration();
ThresholdsConfig config = configuration.getThresholdsConfig();
ThresholdConfig[] tcs = config.getThresholds();
if (tcs!=null && tcs.length>0){
for (ThresholdConfig tc : tcs){
ThresholdDefinition td = new ThresholdD... |
java | public static <O> ParametricFactorGraph buildFeaturizedSequenceModel(DiscreteVariable inputType,
DiscreteVariable labelType, DiscreteVariable featureDictionary, Tensor labelRestrictions,
boolean noTransitions, boolean locallyNormalized) {
ObjectVariable inputVectorType = new ObjectVariable(Tensor.class... |
java | private Set<OmemoDevice> buildMissingSessionsWithDevices(XMPPConnection connection,
OmemoDevice userDevice,
Set<OmemoDevice> devices)
throws SmackException.NotConnectedException, Interru... |
java | public static <M extends Model> Updater<M> withUpdater(String sql) {
return withUpdater(DataSourceManager.getDefaultDataSourceName(), sql);
} |
python | def _diff_signatures(self, type_):
"""
Diff our method signatures against the methods provided by type_.
Parameters
----------
type_ : type
The type to check.
Returns
-------
missing, mistyped, mismatched : list[str], dict[str -> type], dict[s... |
java | protected Object[] getBatch() {
Object[] objectArray = new Object[batchSize];
objectArray[0] = get(); // always attempt to get at least 1, get() could
// return null
// if no factory was defined when instantiated.
int numElements ... |
java | private static final <T extends Appendable> void encodeRun(T buffer, int value, int length) {
if (length < 4) {
for (int j=0; j<length; ++j) {
if (value == ESCAPE) {
appendInt(buffer, value);
}
appendInt(buffer, value);
... |
python | def _init_map(self, record_types=None, **kwargs):
"""Initialize form map"""
osid_objects.OsidContainableForm._init_map(self)
osid_objects.OsidSourceableForm._init_map(self)
osid_objects.OsidObjectForm._init_map(self, record_types=record_types)
self._my_map['childIds'] = self._ch... |
python | def index_impute2(fn):
"""Indexes an IMPUTE2 file.
Args:
fn (str): The name of the IMPUTE2 file.
"""
logger.info("Indexing {} (IMPUTE2)".format(fn))
impute2_index(fn, cols=[0, 1, 2], names=["chrom", "name", "pos"], sep=" ")
logger.info("Index generated") |
python | def has_snp(self, individual=0):
"""Returns a boolean list of SNP status, ordered by samples"""
if isinstance(individual, str):
individual = self.individuals[individual]
alts = self.get_alt(individual=individual)
if alts:
return [i != self.ref and len(i) == len(se... |
python | def load_plugins(self):
"""Refresh the list of available collectors and auditors
Returns:
`None`
"""
for entry_point in CINQ_PLUGINS['cloud_inquisitor.plugins.collectors']['plugins']:
cls = entry_point.load()
if cls.enabled():
self.log... |
python | def refresh(self):
"""
explicitely refresh user interface; useful when changing widgets dynamically
"""
logger.debug("refresh user interface")
try:
with self.refresh_lock:
self.draw_screen()
except AssertionError:
logger.warning("ap... |
java | protected Node<K, V> unlinkAndUnionChildren(Node<K, V> n) {
// disconnect children
Node<K, V> child1 = n.o_c;
if (child1 == null) {
return null;
}
n.o_c = null;
Node<K, V> child2 = child1.y_s;
if (child2 == n) {
child2 = null;
} el... |
java | private static Path[] getChunkFilePaths(Configuration conf,
FileSystem dstfs, Path chunkFileDir, int chunkNum) throws IOException{
FileStatus [] chunkFileStatus = dstfs.listStatus(chunkFileDir);
HashSet <String> chunkFilePathSet = new HashSet<String>(chunkFileStatus.length);
for(FileStatus chunkfs:chu... |
java | private void positionalConstraints(PatternDescrBuilder<?> pattern) throws RecognitionException {
constraint(pattern,
true,
"");
if (state.failed)
return;
while (input.LA(1) == DRL6Lexer.COMMA) {
match(input,
DRL6Lexer.C... |
python | def authorize(self, authentication_request, # type: oic.oic.message.AuthorizationRequest
user_id, # type: str
extra_id_token_claims=None
# type: Optional[Union[Mapping[str, Union[str, List[str]]], Callable[[str, str], Mapping[str, Union[str, List[str]]]]]
... |
python | def write_csv(graph, prefix):
"""
Write ``graph`` as tables of nodes (``prefix-nodes.csv``) and edges
(``prefix-edges.csv``).
Parameters
----------
graph : :ref:`networkx.Graph <networkx:graph>`
prefix : str
"""
node_headers = list(set([a for n, attrs in graph.nodes(data=True)
... |
python | def is_available_extension(name,
user=None,
host=None,
port=None,
maintenance_db=None,
password=None,
runas=None):
'''
Test if a specific extension is... |
python | def rgbline(x, y, red, green, blue, alpha=1, linestyles="solid",
linewidth=2.5):
"""Get a RGB coloured line for plotting.
Args:
x (list): x-axis data.
y (list): y-axis data (can be multidimensional array).
red (list): Red data (must have same shape as ``y``).
green (... |
python | def _Open(self, path_spec=None, mode='rb'):
"""Opens the file-like object defined by path specification.
Args:
path_spec (Optional[PathSpec]): path specification.
mode (Optional[str]): file access mode.
Raises:
AccessError: if the access to open the file was denied.
IOError: if the... |
java | private void loadOptionsFromFile(String filepath){
try {
BufferedReader in = new BufferedReader(new FileReader(filepath));
String stream0 = in.readLine();
outlierAlgoPanel0.setStreamValueAsCLIString(stream0);
String algo0 = in.readLine();
outlierAlgo... |
python | def get_records(self, records=None, timeout=1.0):
"""Get NDEF message records from a SNEP Server.
.. versionadded:: 0.13
The :class:`ndef.Record` list given by *records* is encoded as
the request message octets input to :meth:`get_octets`. The
return value is an :class:`ndef.Re... |
python | def get_message_dict(self):
"""
Generate the various parts of the message and return them in a
dictionary, suitable for passing directly as keyword arguments
to ``django.core.mail.send_mail()``.
By default, the following values are returned:
* ``from_email``
* ... |
python | def send_venue(self, chat_id, latitude, longitude, title, address, foursquare_id=None, disable_notification=None,
reply_to_message_id=None, reply_markup=None):
"""
Use this method to send information about a venue.
:param chat_id: Integer or String : Unique identifier for the ... |
java | public final void taggedValue(String tag, long value) throws IOException {
startTag(tag);
write(Long.toString(value));
endTag(tag);
} |
python | def _srm(self, data):
"""Expectation-Maximization algorithm for fitting the probabilistic SRM.
Parameters
----------
data : list of 2D arrays, element i has shape=[voxels_i, samples]
Each element in the list contains the fMRI data of one subject.
Returns
-... |
python | def translate(remarks: str) -> typing.Dict[str, str]: # noqa
"""
Translates elements in the remarks string
"""
ret = {}
# Add and replace static multi-word elements
for key in REMARKS_GROUPS:
if key in remarks:
ret[key.strip()] = REMARKS_GROUPS[key]
remarks.repla... |
python | def put_object(ACL=None, Body=None, Bucket=None, CacheControl=None, ContentDisposition=None, ContentEncoding=None, ContentLanguage=None, ContentLength=None, ContentMD5=None, ContentType=None, Expires=None, GrantFullControl=None, GrantRead=None, GrantReadACP=None, GrantWriteACP=None, Key=None, Metadata=None, ServerSideE... |
java | public void setLeft(AstNode left) {
assertNotNull(left);
this.left = left;
// line number should agree with source position
setLineno(left.getLineno());
left.setParent(this);
} |
java | public Content getSummaryTableHeader(List<String> header, String scope) {
Content tr = new HtmlTree(HtmlTag.TR);
final int size = header.size();
Content tableHeader;
if (size == 2) {
tableHeader = new StringContent(header.get(0));
tr.addContent(HtmlTree.TH(HtmlSty... |
java | public static cmppolicy_stats[] get(nitro_service service) throws Exception{
cmppolicy_stats obj = new cmppolicy_stats();
cmppolicy_stats[] response = (cmppolicy_stats[])obj.stat_resources(service);
return response;
} |
java | public void zSetAppropriateTextFieldMinimumWidth() {
Integer programmerSuppliedWidth = settings.getSizeTextFieldMinimumWidth();
// Determine the appropriate minimum width for the text field.
int minimumWidthPixels = CalculateMinimumTimeFieldSize.getFormattedTimeWidthInPixels(
set... |
java | public void cache(Map<String, Object> resources) {
verifyState();
if (!cacheLocked.get()) {
resourceCache.get().putAll(resources);
}
} |
python | async def on_error(self, event_method, *args, **kwargs):
"""|coro|
The default error handler provided by the client.
By default this prints to :data:`sys.stderr` however it could be
overridden to have a different implementation.
Check :func:`discord.on_error` for more details.
... |
java | public Waiter<GetRoleRequest> roleExists() {
return new WaiterBuilder<GetRoleRequest, GetRoleResult>().withSdkFunction(new GetRoleFunction(client))
.withAcceptors(new HttpSuccessStatusAcceptor(WaiterState.SUCCESS), new RoleExists.IsNoSuchEntityMatcher())
.withDefaultPollingStrat... |
java | public void marshall(PutApprovalResultRequest putApprovalResultRequest, ProtocolMarshaller protocolMarshaller) {
if (putApprovalResultRequest == null) {
throw new SdkClientException("Invalid argument passed to marshall(...)");
}
try {
protocolMarshaller.marshall(putAppr... |
python | def sample(self, size=1):
""" Sample rigid transform random variables.
Parameters
----------
size : int
number of sample to take
Returns
-------
:obj:`list` of :obj:`RigidTransform`
sampled rigid transformations
"""
... |
java | @SuppressWarnings("unchecked")
public ConfigProperty getConfigProperty(final String groupName, final String propertyName) {
final Query query = pm.newQuery(ConfigProperty.class, "groupName == :groupName && propertyName == :propertyName");
final List<ConfigProperty> result = (List<ConfigProperty>) qu... |
python | def _str(self, phi_or_p="phi", tablefmt="grid", print_state_names=True):
"""
Generate the string from `__str__` method.
Parameters
----------
phi_or_p: 'phi' | 'p'
'phi': When used for Factors.
'p': When used for CPDs.
print_state_names:... |
python | def _handle_signatures(original, message, params):
"""Shared code for handling message signatures.
RFC 3156 is quite strict:
* exactly two messages
* the second is of type 'application/pgp-signature'
* the second contains the detached signature
:param original: The original top-level mail. Thi... |
python | def all(cls):
"""
Returns a list of all configured endpoints the server is listening on. For each endpoint,
the list of allowed databases is returned too if set.
The result is a JSON hash which has the endpoints as keys, and the list of
mapped database names as v... |
python | def search_meta(self, attr, value=None, stronly=False):
""" Get a list of Symbols by searching a specific meta
attribute, and optionally the value.
Parameters
----------
attr : str
The meta attribute to query.
value : None, str or list
... |
java | public void serialize(Output output) throws IOException {
log.debug("serialize - name: {}", name);
Serializer.serialize(output, getName());
Map<String, Object> map = getAttributes();
if (log.isTraceEnabled()) {
log.trace("Attributes: {}", map);
}
Serial... |
python | def from_graphtool(cls, graph, weight='weight'):
r"""Import a graph from graph-tool.
Edge weights are retrieved as an edge property,
under the name specified by the ``weight`` parameter.
Signals are retrieved from node properties,
and stored in the :attr:`signals` dictionary un... |
python | def network(n):
"""Validate a |Network|.
Checks the TPM and connectivity matrix.
"""
tpm(n.tpm)
connectivity_matrix(n.cm)
if n.cm.shape[0] != n.size:
raise ValueError("Connectivity matrix must be NxN, where N is the "
"number of nodes in the network.")
retur... |
java | public static double uniform(Random rng, double min, double max) {
return rng.nextDouble() * (max - min) + min;
} |
java | protected MethodMetadata getMethodMetadataFrom( MethodDeclaration methodDeclaration ) {
if (methodDeclaration != null) {
if (methodDeclaration.isConstructor()) {
return getConstructorMetadataFrom(methodDeclaration);
}
return getMethodTypeMemberMetadataFrom(met... |
java | private String getServerId() {
UUID fullServerId = null;
WsLocationAdmin locationService = this.wsLocationAdmin;
if (locationService != null) {
fullServerId = locationService.getServerId();
}
if (fullServerId == null) {
fullServerId = UUID.randomUUID(); //... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.