language stringclasses 2
values | func_code_string stringlengths 63 466k |
|---|---|
java | public void setMessage(final String message, final Serializable... args) {
getOrCreateComponentModel().message = I18nUtilities.asMessage(message, args);
} |
python | def crack_egg(egg, subjects=None, lists=None):
'''
Takes an egg and returns a subset of the subjects or lists
Parameters
----------
egg : Egg data object
Egg that you want to crack
subjects : list
List of subject idxs
lists : list
List of lists idxs
Returns
... |
python | def _req(self, req):
"""Send command and wait for response.
The command will be repeated 3 times at most in case data loss of serial port.
Args:
req (str): Command to send, please do not include new line in the end.
Returns:
[str]: The output lines
"""
... |
java | @Override
public String toStringValue() {
GenderTypeEnumeration g = this.getGender();
return g != null ? g.getValue() : null;
} |
python | def update(self, reconfigure=False):
""" update the environment """
try:
self.phase = PHASE.UPDATE
self.logger.info("Updating environment %s..." % self.namespace)
self.install_sandboxes()
self.instantiate_features()
# We don't grab inputs, only... |
java | protected void imageToOutput( double x , double y , Point2D_F64 pt ) {
pt.x = x/scale - tranX/scale;
pt.y = y/scale - tranY/scale;
} |
python | def get_stock_codes(self, cached=True, as_json=False):
"""
returns a dictionary with key as stock code and value as stock name.
It also implements cache functionality and hits the server only
if user insists or cache is empty
:return: dict
"""
url = self.stocks_cs... |
python | def open(filename, frame='unspecified'):
"""Create a NormalCloud from data saved in a file.
Parameters
----------
filename : :obj:`str`
The file to load data from.
frame : :obj:`str`
The frame to apply to the created NormalCloud.
Returns
... |
python | def delete(gandi, resource, background, force):
"""Delete one or more IPs (after detaching them from VMs if necessary).
resource can be an ip id or ip.
"""
resource = sorted(tuple(set(resource)))
possible_resources = gandi.ip.resource_list()
# check that each IP can be deleted
for item in ... |
java | protected <T extends OperationResponse> void completeOperation(OperationResult result, OperationResponse.Builder<?, T> builder, Throwable error, CompletableFuture<T> future) {
if (result != null) {
builder.withIndex(result.index());
builder.withEventIndex(result.eventIndex());
if (result.failed())... |
java | private void reply(final String response, final boolean error,
final String errorMessage, final String stackTrace,
final String statusCode, final int statusCodeInt) {
if (!sentReply) {
//must update sentReply first to avoid duplicated msg.
s... |
java | public ServiceCall<HTMLReturn> convertToHtml(ConvertToHtmlOptions convertToHtmlOptions) {
Validator.notNull(convertToHtmlOptions, "convertToHtmlOptions cannot be null");
String[] pathSegments = { "v1/html_conversion" };
RequestBuilder builder = RequestBuilder.post(RequestBuilder.constructHttpUrl(getEndPoint... |
python | def next_previous(self, options=None, **kwds):
"""
Endpoint: /photo/<id>/nextprevious[/<options>].json
Returns a dict containing the next and previous photo lists
(there may be more than one next/previous photo returned).
"""
return self._client.photo.next_previous(self,... |
java | public static <K1, V1, K2, V2> void setMapperClass(Configuration conf,
Class<? extends BaseMapper<?, ?, ?, ?>> internalMapperClass) {
if (MultithreadedMapper.class.isAssignableFrom(internalMapperClass)) {
throw new IllegalArgumentException("Can't have recursive "
+ "Multithre... |
java | public static SofaResponse buildSofaErrorResponse(String errorMsg) {
SofaResponse sofaResponse = new SofaResponse();
sofaResponse.setErrorMsg(errorMsg);
return sofaResponse;
} |
python | def delete_repo(name, config_path=_DEFAULT_CONFIG_PATH, force=False):
'''
Remove a local package repository.
:param str name: The name of the local repository.
:param str config_path: The path to the configuration file for the aptly instance.
:param bool force: Whether to remove the repository even... |
python | def _parse_length(self, value, font_relative, callback, *args):
'''Parse/calc length, converting to pixels, calls callback(length, *args)
when the length is first computed or changes'''
if value.endswith('%'):
frac = float(value[:-1])/100
if font_relative:
... |
java | public void importFolder(String importFolderName, String importPath, CmsObject cms) throws CmsException {
try {
m_importedResources = new ArrayList<CmsResource>();
m_importFolderName = importFolderName;
m_importPath = importPath;
m_cms = cms;
// open ... |
java | @SuppressWarnings("rawtypes")
public static void configure(
Configuration conf,
String qualifiedOutputTableId,
String outputTableSchemaJson,
String outputGcsPath,
BigQueryFileFormat outputFileFormat,
Class<? extends FileOutputFormat> outputFormatClass)
throws IOException {
... |
java | public PointerDensityHierarchyRepresentationResult run(Database db, Relation<O> relation) {
final DistanceQuery<O> distQ = db.getDistanceQuery(relation, getDistanceFunction());
final KNNQuery<O> knnQ = db.getKNNQuery(distQ, minPts);
// We need array addressing later.
final ArrayDBIDs ids = DBIDUtil.ensu... |
java | public boolean isAbsolute() {
final int start = hasWindowsDrive(uri.getPath(), true) ? 3 : 0;
return uri.getPath().startsWith(SEPARATOR, start);
} |
python | def get_name(self, obj=None, withext=True):
"""Return the filename
:param obj: the fileinfo with information. If None, this will use the stored object of JB_File
:type obj: :class:`FileInfo`
:param withext: If True, return with the fileextension.
:type withext: bool
:ret... |
java | public java.lang.String getPersistenceState() {
java.lang.Object ref = persistenceState_;
if (ref instanceof java.lang.String) {
return (java.lang.String) ref;
} else {
com.google.protobuf.ByteString bs =
(com.google.protobuf.ByteString) ref;
java.lang.String s = bs.toStringUtf8... |
java | public static void generateFieldSerialize(BindTypeContext context, PersistType persistType, BindProperty property, Modifier... modifiers) {
Converter<String, String> format = CaseFormat.LOWER_CAMEL.converterTo(CaseFormat.UPPER_CAMEL);
String methodName = "serialize" + format.convert(property.getName());
MethodS... |
python | def order_by(self, *args):
"""
Applies query ordering.
Args:
**args: Order by fields names.
Defaults to ascending, prepend with hypen (-) for desecending ordering.
Returns:
Self. Queryset object.
Examples:
>>> Person.objects.orde... |
python | def do_POST(self):
"""Upload a file and execute a command."""
logging.debug("New POST request.")
query = parse_qs(urlparse(self.path).query)
sample = query['sample'][0]
async = bool(int(query.get('async', [False])[0]))
path = self.store_file(mkdtemp(), sample)
c... |
python | def _tle_to_keplerian_mean(cls, coord, center):
"""Conversion from the TLE standard format to the Mean Keplerian
see :py:class:`Tle` for more information.
"""
i, Ω, e, ω, M, n = coord
a = (center.µ / n ** 2) ** (1 / 3)
return np.array([a, e, i, Ω, ω, M], dtype=float) |
java | protected String getFilename(HttpServletRequest request,
HttpServletResponse response) throws IOException {
final String filename = request.getParameter("filename");
if (filename == null || filename.length() == 0) {
throw new IOException("Invalid filename");
}
return filename;
} |
python | def _set_used_as_input_variables_by_entity(self) -> Dict[str, List[str]]:
'''Identify and set the good input variables for the different entities'''
if self.used_as_input_variables_by_entity is not None:
return
tax_benefit_system = self.tax_benefit_system
assert set(self.us... |
python | def setCurrentIndex(self, index):
"""
Sets the current index on self and on the tab bar to keep the two insync.
:param index | <int>
"""
super(XViewPanel, self).setCurrentIndex(index)
self.tabBar().setCurrentIndex(index) |
java | @Override
public int indexOf(IBond bond) {
for (int i = 0; i < bondCount; i++) {
if (bonds[i].equals(bond)) return i;
}
return -1;
} |
python | def step_use_log_record_configuration(context):
"""
Define log record configuration parameters.
.. code-block: gherkin
Given I use the log record configuration:
| property | value |
| format | |
| datefmt | |
"""
assert context.table, "REQ... |
java | private Map < String, Object > getProps(
XmlSchemaComplexType xsdComplexType, RootCompositeType compositeTypes) {
String complexTypeName = getComplexTypeName(xsdComplexType);
visit(xsdComplexType, compositeTypes, complexTypeName);
Map < String, Object > props = new LinkedHashMap < ... |
python | def absstart(self):
"""Returns the absolute start of the element by including docstrings
outside of the element definition if applicable."""
if hasattr(self, "docstart") and self.docstart > 0:
return self.docstart
else:
return self.start |
python | def cycle_canceling(self, display):
'''
API:
cycle_canceling(self, display)
Description:
Solves minimum cost feasible flow problem using cycle canceling
algorithm. Returns True when an optimal solution is found, returns
False otherwise. 'flow' attr... |
python | def readConfig(self, configuration):
"""Read configuration from dict.
Read configuration from a JSON configuration file.
:param configuration: configuration to load.
:type configuration: dict.
"""
self.__logger.debug("Reading configuration")
self.city = configur... |
java | public DecimalFormatProperties getDecimalFormat(int i)
throws ArrayIndexOutOfBoundsException
{
if (null == m_DecimalFormatDeclarations)
throw new ArrayIndexOutOfBoundsException();
return (DecimalFormatProperties) m_DecimalFormatDeclarations.elementAt(i);
} |
python | def get_items_by_ids(self, item_ids, item_type=None):
"""Given a list of item ids, return all the Item objects
Args:
item_ids (obj): List of item IDs to query
item_type (str): (optional) Item type to filter results with
Returns:
List of `Item` objects for gi... |
java | public static List<Parameter> collectConstructorParameters(Class<?> cls, Components components, javax.ws.rs.Consumes classConsumes) {
if (cls.isLocalClass() || (cls.isMemberClass() && !Modifier.isStatic(cls.getModifiers()))) {
return Collections.emptyList();
}
List<Parameter> select... |
java | private int getInt() throws IOException {
st.nextToken();
if (st.ttype == StreamTokenizer.TT_WORD)
return Double.valueOf(st.sval).intValue();
else if (st.ttype == StreamTokenizer.TT_EOF)
throw new EOFException("End-of-File encountered during parsing");
else
... |
python | def _propagated_record(self, rdtype, name, content, nameservers=None):
"""
If the publicly propagation check should be done, waits until the domain nameservers
responses with the propagated record type, name & content and returns a boolean,
if the publicly propagation was successful or n... |
python | def drain_OD(q_plant, T, depth_end, SDR):
"""Return the nominal diameter of the entrance tank drain pipe. Depth at the
end of the flocculator is used for headloss and length calculation inputs in
the diam_pipe calculation.
Parameters
----------
q_plant: float
Plant flow rate
T: flo... |
java | @VisibleForTesting
List<File> getProcessConfigFiles() {
// TODO : should use a FileVisitor (Once we update to Java 7)
File[] files;
File configurationDirOrFile = configuration.getProcessConfigDirOrFile();
if (configurationDirOrFile == null) {
throw new IllegalStateException("Configuration should specify con... |
java | public String resolveAliasType(String alias) {
String type = getAliasedType(alias);
return (type == null ? alias: type);
} |
java | public void shutdown() {
getLogger().info("removing receiverJob from the Scheduler.");
if(this.repository instanceof LoggerRepositoryEx) {
Scheduler scheduler = ((LoggerRepositoryEx) repository).getScheduler();
scheduler.delete(customReceiverJob);
}
lastID = -1;
... |
python | def _create_server(host, port):
"""
Helper function. Creates a listening socket on the designated
host and port. Modeled on the socket.create_connection()
function.
"""
exc = socket.error("getaddrinfo returns an empty list")
for res in socket.getaddrinfo(host, port, 0, socket.SOCK_STREAM)... |
java | public double getAverageOccupation() {
calculateOccupied();
double result;
if (occupiedHypercubes() == 0) {
result = 0.0;
} else {
double sum = 0.0;
for (int value : occupied) {
sum += hypercubes[value];
}
result = sum / occupiedHypercubes();
}
... |
python | def execute(self):
"""
Given the command-line arguments, this figures out which subcommand is
being run, creates a parser appropriate to that command, and runs it.
"""
try:
subcommand = self.argv[1]
except IndexError:
subcommand = 'help' # Display... |
java | @Override
@Path("/{ownerType}/{ownerId}")
@ApiOperation(value="Update attributes for an ownerType and ownerId", response=StatusMessage.class)
@ApiImplicitParams({
@ApiImplicitParam(name="Attributes", paramType="body", required=true, dataType="java.lang.Object")})
public JSONObject put(String pat... |
python | def simplesurface(idf, bsd, deletebsd=True, setto000=False):
"""convert a bsd (buildingsurface:detailed) into a simple surface"""
funcs = (wallexterior,
walladiabatic,
wallunderground,
wallinterzone,
roof,
ceilingadiabatic,
ceilinginterzone,
floorgroundcon... |
java | @Override
public void start(BundleContext context) {
initialContextFactories = initServiceTracker(context, InitialContextFactory.class, ServiceTrackerCustomizers.ICF_CACHE);
objectFactories = initServiceTracker(context, ObjectFactory.class, ServiceTrackerCustomizers.URL_FACTORY_CACHE);
icfB... |
python | def merge(cls, *others):
"""
Merge the `others` schema into this instance.
The values will all be read from the provider of the original object.
"""
for other in others:
for k, v in other:
setattr(cls, k, BoundValue(cls, k, v.value)) |
python | def disk_xml(identifier, pool_xml, base_volume_xml, cow):
"""Clones volume_xml updating the required fields.
* name
* target path
* backingStore
"""
pool = etree.fromstring(pool_xml)
base_volume = etree.fromstring(base_volume_xml)
pool_path = pool.find('.//path').text
base_path ... |
java | public ConstraintConnectiveDescr parse( final String text ) {
ConstraintConnectiveDescr constraint = null;
try {
DRLLexer lexer = DRLFactory.getDRLLexer(new ANTLRStringStream(text), languageLevel);
CommonTokenStream input = new CommonTokenStream( lexer );
RecognizerSh... |
python | def instances(self, skip_exist_test=False):
"""
Ask the collection to return a list of instances.
If skip_exist_test is set to True, the instances returned by the
collection won't have their primary key checked for existence.
"""
self.reset_result_type()
self._ins... |
java | public static void setDefaultExecutorService(
ExecutorService defaultExecutorService) {
// If the timer executor service is set to the default
// executor service, adjust it to the new value as well.
if (timerExecutorService == Components.defaultExecutorService) {
timerEx... |
java | public void resize(int maxCacheSize) {
setMaxCacheSize(maxCacheSize);
for (FeatureCache cache : tableCache.values()) {
cache.resize(maxCacheSize);
}
} |
python | def closest(self, tag):
"""Match closest ancestor."""
return CSSMatch(self.selectors, tag, self.namespaces, self.flags).closest() |
java | static AccountingDate ofEpochDay(AccountingChronology chronology, long epochDay) {
EPOCH_DAY.range().checkValidValue(epochDay, EPOCH_DAY); // validate outer bounds
// Use Accounting 1 to help with 0-counts. Leap years can occur at any time.
long accountingEpochDay = epochDay + chronology.getDa... |
python | def to_records(cls, attr_names, value_matrix):
"""
Convert a value matrix to records to be inserted into a database.
:param list attr_names:
List of attributes for the converting records.
:param value_matrix: Values to be converted.
:type value_matrix: list of |dict|... |
python | def _validate_param(param): # pylint: disable=too-many-branches
""" Ensure the filter cast properly according to the operator """
detail = None
if param.oper not in goldman.config.QUERY_FILTERS:
detail = 'The query filter {} is not a supported ' \
'operator. Please change {} & re... |
python | def edges(self, edges):
"""Specify edge list data and associated edge attribute values.
:param edges: Edges and their attributes.
:type point_size: Pandas dataframe, NetworkX graph, or IGraph graph.
:returns: Plotter.
:rtype: Plotter.
**Example**
::
... |
python | def _validate_entity(entity):
'''
Validates the entity dict representation
entity
Dictionary representation of an entity.
See ``_get_entity`` docstrings for format.
'''
#Validate entity:
if entity['type'] == 'cluster':
schema = ESXClusterEntitySchema.serialize()
eli... |
python | def show_tricky_tasks(self, verbose=0):
"""
Print list of tricky tasks i.e. tasks that have been restarted or
launched more than once or tasks with corrections.
Args:
verbose: Verbosity level. If > 0, task history and corrections (if any) are printed.
"""
nid... |
python | def monitor_session_span_command_dest_tengigabitethernet(self, **kwargs):
"""Auto Generated Code
"""
config = ET.Element("config")
monitor = ET.SubElement(config, "monitor", xmlns="urn:brocade.com:mgmt:brocade-span")
session = ET.SubElement(monitor, "session")
session_num... |
java | Object toSimpleValue(Class<?> genericType, Object element, TypeAdapters typeAdapters) {
if (element == null) {
return null;
}
log.info("Convert from " + element.getClass().getName() + " to " + genericType.getName());
if (genericType.isEnum() && (element instanceof String)) {
... |
java | @Override
public JMXConnector newJMXConnector(JMXServiceURL serviceURL, Map<String, ?> environment) throws IOException {
if (serviceURL == null || environment == null)
throw new NullPointerException();
if (!ClientProvider.REST_PROTOCOL.equals(serviceURL.getProtocol()))
throw ... |
python | def forwards(self, orm):
"Write your forwards methods here."
orm['avocado.DataField'].objects.filter(app_name='samples', model_name='cohort',
field_name__in=['investigator', 'notes']).delete() |
python | def load(cls, file_name, model_name='default'):
""" Loads a previously saved PyEMMA object from disk.
Parameters
----------
file_name : str or file like object (has to provide read method).
The file like object tried to be read for a serialized object.
model_name: st... |
python | def parser():
"""Return search query parser."""
query_parser = current_app.config['COLLECTIONS_QUERY_PARSER']
if isinstance(query_parser, six.string_types):
query_parser = import_string(query_parser)
return query_parser |
python | def finished(self, filename):
"""Make Checkystyle ElementTree."""
if len(self.errors) < 1:
return
element = ET.SubElement(self.checkstyle_element, 'file', name=filename)
for error in self.errors:
message = error.code + ' ' + error.text
prefix = error.... |
java | static protected String quote(final String value)
{
final StringBuilder out = new StringBuilder();
AbstractCLA.uncompileQuoter(out, value);
return out.toString();
} |
python | def post(node_name, key, **kwargs):
""" Give the server information about this node
Arguments:
node -- node_name or token for the node this data belongs to
key -- identifiable key, that you use later to retrieve that piece of data
kwargs -- the data you need to store
"""
node =... |
python | def clear_distribute_alterations(self):
"""Removes the distribution rights.
raise: NoAccess - ``Metadata.isRequired()`` is ``true`` or
``Metadata.isReadOnly()`` is ``true``
*compliance: mandatory -- This method must be implemented.*
"""
# Implemented from templ... |
python | def process_timer(self, key, fields):
"""
Process a received timer event
:param key: Key of timer
:param fields: Received fields
"""
try:
if key not in self.timers:
self.timers[key] = []
self.timers[key].append(float(fields[0]))
... |
python | def match_prototype(acallable, arguments):
"""Return tuple (pos args, kwargs) to call given callable
Let's define a callable that will printout
>>> arguments = {'alphonse': 1, 'bertrand': 2, 'charlie': 3}
>>> match_prototype(lambda arguments: None, arguments)
([{'bertrand': 2, 'charlie': 3, 'alph... |
java | public static HttpResponse execute(final String url, final String method) {
return execute(url, method, null, null, new HashMap<>(), new HashMap<>());
} |
java | @Override
public final void filterWrite(NextFilter nextFilter, IoSession session,
WriteRequest writeRequest) {
if (eventTypes.contains(IoEventType.WRITE)) {
IoFilterEvent event = new IoFilterEvent(nextFilter, IoEventType.WRITE, session,
writeRequest);
fir... |
python | def get_uri(self):
"""Return the Item source"""
if self.source_file and os.path.exists(self.source_file.path):
return self.source_file.path
elif self.source_url:
return self.source_url
return None |
python | def is_closing(self) -> bool:
"""Return ``True`` if this connection is closing.
The connection is considered closing if either side has
initiated its closing handshake or if the stream has been
shut down uncleanly.
"""
return self.stream.closed() or self.client_terminate... |
java | protected final PackageDescr compilationUnit(PackageDescrBuilder pkg) throws RecognitionException {
try {
// package declaration?
if (input.LA(1) != DRL6Lexer.EOF && helper.validateIdentifierKey(DroolsSoftKeywords.PACKAGE)) {
String pkgName = packageStatement(pkg);
... |
java | public void setVBaselineIncrement(Integer newVBaselineIncrement) {
Integer oldVBaselineIncrement = vBaselineIncrement;
vBaselineIncrement = newVBaselineIncrement;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, AfplibPackage.METRIC_ADJUSTMENT__VBASELINE_INCREMENT, oldVBaselin... |
python | def consume(self, expect_class=None):
"""Retrieve the current token, then advance the parser.
If an expected class is provided, it will assert that the current token
matches that class (is an instance).
Note that when calling a token's nud() or led() functions, the "current"
to... |
python | def get(tzid):
"""Return timezone data"""
ns = {}
path = os.path.join(DATA_DIR, tzid)
with open(path) as f:
raw_data = f.read()
exec(raw_data, ns, ns)
z = ZoneData()
z.types = [(delta(offset), delta(save), abbr)
for offset, save, abbr in ns['types']]
z.times = [(da... |
java | public String toLoggableString()
{
StringBuilder connectionStringBuilder = new StringBuilder();
if (this.endpoint != null)
{
connectionStringBuilder.append(String.format(Locale.US, "%s%s%s%s", ENDPOINT_CONFIG_NAME, KEY_VALUE_SEPARATOR,
this.endpoint.toString()... |
java | @Override
public void handleMessage(Message message) throws Fault {
for (int i = interceptors.size() - 1; i >= 0; i--) {
try {
interceptors.get(i).prepareContext();
} catch (Throwable t) {
LOG.log(Level.WARNING, "ASYNC_INTERCEPTOR_EXCEPTION_PREPARE_CON... |
java | Optional<String> writeTimeGauge(TimeGauge gauge) {
Double value = gauge.value(getBaseTimeUnit());
if (Double.isFinite(value)) {
return Optional.of(writeDocument(gauge, builder -> {
builder.append(",\"value\":").append(value);
}));
}
return Optional... |
java | public void marshall(ModifyEventSubscriptionRequest modifyEventSubscriptionRequest, ProtocolMarshaller protocolMarshaller) {
if (modifyEventSubscriptionRequest == null) {
throw new SdkClientException("Invalid argument passed to marshall(...)");
}
try {
protocolMarshalle... |
python | def get_manhole_factory(namespace, **passwords):
"""Get a Manhole Factory
"""
realm = manhole_ssh.TerminalRealm()
realm.chainedProtocolFactory.protocolFactory = (
lambda _: EnhancedColoredManhole(namespace)
)
p = portal.Portal(realm)
p.registerChecker(
checkers.InMemoryUser... |
java | public MultiLineString fromTransferObject(MultiLineStringTo input, CrsId crsId) {
if (input == null) { return null; }
crsId = getCrsId(input, crsId);
isValid(input);
LineString[] lineStrings = new LineString[input.getCoordinates().length];
for (int i = 0; i < lineStrings.length... |
java | @Override
public Request<ImportKeyPairRequest> getDryRunRequest() {
Request<ImportKeyPairRequest> request = new ImportKeyPairRequestMarshaller().marshall(this);
request.addParameter("DryRun", Boolean.toString(true));
return request;
} |
python | def _insertions(self, result, dimension, dimension_index):
"""Return list of (idx, sum) pairs representing subtotals.
*idx* is the int offset at which to insert the ndarray subtotal
in *sum*.
"""
def iter_insertions():
for anchor_idx, addend_idxs in dimension.hs_ind... |
java | @Override
public void play2(Number streamId, Map<String, ?> playOptions) {
log.debug("play2 options: {}", playOptions.toString());
/* { streamName=streams/new.flv,
oldStreamName=streams/old.flv,
start=0, len=-1,
offset=12.195,
transition=switc... |
python | def enc(data, **kwargs):
'''
Alias to `{box_type}_encrypt`
box_type: secretbox, sealedbox(default)
'''
if 'keyfile' in kwargs:
salt.utils.versions.warn_until(
'Neon',
'The \'keyfile\' argument has been deprecated and will be removed in Salt '
'{version}. ... |
python | def wider_pre_conv(layer, n_add_filters, weighted=True):
'''wider previous conv layer.
'''
n_dim = get_n_dim(layer)
if not weighted:
return get_conv_class(n_dim)(
layer.input_channel,
layer.filters + n_add_filters,
kernel_size=layer.kernel_size,
)
... |
java | @EventBusListenerMethod(scope = EventScope.UI)
void onEvent(final RolloutEvent event) {
switch (event) {
case FILTER_BY_TEXT:
case CREATE_ROLLOUT:
case UPDATE_ROLLOUT:
case SHOW_ROLLOUTS:
refreshContainer();
break;
default:
break;
... |
python | def get_go2nt(self, usr_go2nt):
"""Combine user namedtuple fields, GO object fields, and format_txt."""
gos_all = self.get_gos_all()
# Minimum set of namedtuple fields available for use with Sorter on grouped GO IDs
prt_flds_all = get_hdridx_flds() + self.gosubdag.prt_attr['flds']
... |
java | @Deprecated
public void setDayNameLength(int length) {
if (length != LENGTH_LONG && length != LENGTH_SHORT) {
throw new IllegalArgumentException("length parameter must be either LENGTH_LONG or LENGTH_SHORT");
}
this.mDayNameLength = length;
} |
python | def ExportClientsByKeywords(keywords, filename, token=None):
r"""A script to export clients summaries selected by a keyword search.
This script does a client search for machines matching all of keywords and
writes a .csv summary of the results to filename. Multi-value fields are '\n'
separated.
Args:
ke... |
python | def _populate_trace(self, graph: TraceGraph, trace_frame_ids: List[int]) -> None:
""" Populates (from the given trace graph) the forward and backward
traces reachable from the given traces (including input trace frames).
Make sure to respect trace kind in successors
"""
while len... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.