language stringclasses 2
values | func_code_string stringlengths 63 466k |
|---|---|
python | def referrer_uri(self, value):
"""The referrer_uri property.
Args:
value (string). the property value.
"""
if value == self._defaults['referrerUri'] and 'referrerUri' in self._values:
del self._values['referrerUri']
else:
self._values[... |
java | public static int[] validate2(int[] data, boolean allowSz1, String paramName){
if(data == null) {
return null;
}
if(allowSz1){
Preconditions.checkArgument(data.length == 1 || data.length == 2,
"Need either 1 or 2 %s values, got %s values: %s",
... |
python | def _id_for_pc(self, name):
""" Given the name of the PC, return the database identifier. """
if not name in self.pc2id_lut:
self.c.execute("INSERT INTO pcs (name) VALUES ( ? )", (name,))
self.pc2id_lut[name] = self.c.lastrowid
self.id2pc_lut[self.c.lastrowid] = name
... |
java | public ModifyVpcEndpointServiceConfigurationRequest withAddNetworkLoadBalancerArns(String... addNetworkLoadBalancerArns) {
if (this.addNetworkLoadBalancerArns == null) {
setAddNetworkLoadBalancerArns(new com.amazonaws.internal.SdkInternalList<String>(addNetworkLoadBalancerArns.length));
}
... |
java | @Override
public Collection<PersonDocument> findByFileAndSurname(
final String filename, final String surname) {
if (filename == null || surname == null) {
return Collections.emptyList();
}
final Query searchQuery =
new Query(Criteria.where("surname").... |
java | private boolean checkAppPathsForVia(Set<String> keySet, List<String> errors) {
for (String key : keySet) {
if (!key.equals("defaultKey")) {
File file = new File(key);
if (!file.exists()) {
errors.add("Effective Usage Analysis will not run if the -a... |
python | def after_reject(analysis):
"""Function triggered after the "reject" transition for the analysis passed
in is performed."""
# Remove from the worksheet
remove_analysis_from_worksheet(analysis)
# Reject our dependents (analyses that depend on this analysis)
cascade_to_dependents(analysis, "rejec... |
python | def exists(method,
ip,
port=None,
proto='tcp',
direction='in',
port_origin='d',
ip_origin='d',
ttl=None,
comment=''):
'''
Returns true a rule for the ip already exists
based on the method supplied. Returns false ... |
python | def get_file(cls, filename=None):
"""
Load settings from an rtv configuration file.
"""
if filename is None:
filename = CONFIG
config = configparser.ConfigParser()
if os.path.exists(filename):
with codecs.open(filename, encoding='utf-8') as fp:
... |
java | public boolean removeBusItinerary(BusItinerary itinerary) {
final int index = this.itineraries.indexOf(itinerary);
if (index >= 0) {
return removeBusItinerary(index);
}
return false;
} |
python | def transform(source):
'''Used to convert the source code, making use of known transformers.
"transformers" are modules which must contain a function
transform_source(source)
which returns a tranformed source.
Some transformers (for example, those found in the standard library
... |
python | def n_feature_hash(feature, dims, seeds):
"""N-hot-encoded feature hashing.
Args:
feature (str): Target feature represented as string.
dims (list of int): Number of dimensions for each hash value.
seeds (list of float): Seed of each hash function (mmh3).
Returns:
numpy 1d a... |
java | public void setProperty(Class aClass, Object object, String property, Object newValue, boolean b, boolean b1) {
if (null == interceptor) {
super.setProperty(aClass, object, property, newValue, b, b1);
}
if (interceptor instanceof PropertyAccessInterceptor) {
PropertyAcces... |
java | public ServiceFuture<List<PatternRuleInfo>> getIntentPatternsAsync(UUID appId, String versionId, UUID intentId, GetIntentPatternsOptionalParameter getIntentPatternsOptionalParameter, final ServiceCallback<List<PatternRuleInfo>> serviceCallback) {
return ServiceFuture.fromResponse(getIntentPatternsWithServiceRes... |
java | protected List<String> loadDeps(Scriptable cfg) {
final String methodName = "loadDeps"; //$NON-NLS-1$
Object depsList = cfg.get(DEPS_CONFIGPARAM, cfg);
List<String> deps = new LinkedList<String>();
if (depsList instanceof Scriptable) {
for (Object id : ((Scriptable)depsList).getIds()) {
if (id inst... |
java | public final Cache2kBuilder<K, V> expiryPolicy(ExpiryPolicy<K, V> c) {
config().setExpiryPolicy(wrapCustomizationInstance(c));
return this;
} |
java | public boolean isToggleButtonChecked(String text)
{
if(config.commandLogging){
Log.d(config.commandLoggingTag, "isToggleButtonChecked(\""+text+"\")");
}
return checker.isButtonChecked(ToggleButton.class, text);
} |
java | public ExecutorCommand<V> withBreakerRetryTimeout(long breakerRetryTimeout, TimeUnit breakerRetryTimeUnit) {
config.setBreakerRetryTimeout(breakerRetryTimeUnit.toMillis(breakerRetryTimeout));
return this;
} |
python | def p_program_line_label(p):
""" label_line : LABEL statements
| LABEL co_statements
"""
lbl = make_label(p[1], p.lineno(1))
p[0] = make_block(lbl, p[2]) if len(p) == 3 else lbl |
java | @Override
public boolean hasTileToRetrieve(int x, int y, int zoom) {
return retriever.hasTile(x, y, zoom);
} |
java | @Override
protected Environment createEnvironment() {
HttpServletRequest request = getBackingRequest();
String postPath = getResponseUrl(request);
String baseUrl = getBaseUrl(request);
String userAgent = request.getHeader("user-agent");
/**
* Careful - this won't be serializable
*/
HttpServletEnviro... |
python | def formfield(self, **kwargs):
"""
Get choices from plugins, if necessary.
"""
if self.plugin_class:
self._choices = self.plugin_class.get_all_choices(field=self)
return super(TemplateNameField, self).formfield(**kwargs) |
python | def insert_request_to_batch(self, request):
'''
Adds request to batch operation.
request:
the request to insert, update or delete entity
'''
self.validate_request_table(request)
self.validate_request_partition_key(request)
self.validate_request_row_ke... |
python | def run(self, react=True, strict=True, roles=1):
"""Select a cast and perform the next scene.
:param bool react: If `True`, then Property directives are executed
at the point they are encountered. Pass `False` to skip them
so they can be enacted later on.
:param bool str... |
java | public int[] toArray() {
int[] arr = new int[length()];
for (int i = 0; i < arr.length; ++i)
arr[i] = get(i);
return arr;
} |
java | Path dumpXmlReport(Report report) {
if (!settings.getBoolean(PROPERTY_GENERATE_XML).orElse(false)) {
return null;
}
try {
final String reportAsString = reportToString(report);
final Path reportFile = writeToWorkingDirectory(reportAsString, PMD_RESULT_XML);
... |
java | @Override
public void beforeFirst(SearchRange searchRange) {
if (!searchRange.isValid())
return;
search(searchRange, SearchPurpose.READ);
} |
java | public Builder andCondition(Class<? extends Annotation> condition,
Object... details) {
Assert.notNull(condition, "Condition must not be null");
return andCondition("@" + ClassUtils.getShortName(condition), details);
} |
java | public DescribeTapesResult withTapes(Tape... tapes) {
if (this.tapes == null) {
setTapes(new com.amazonaws.internal.SdkInternalList<Tape>(tapes.length));
}
for (Tape ele : tapes) {
this.tapes.add(ele);
}
return this;
} |
python | def update_preview(self, index=None, scheme_name=None):
"""
Update the color scheme of the preview editor and adds text.
Note
----
'index' is needed, because this is triggered by a signal that sends
the selected index.
"""
text = ('"""A string"""\n\n'
... |
java | protected List<GroovyRowResult> asList(String sql, ResultSet rs,
@ClosureParams(value=SimpleType.class, options="java.sql.ResultSetMetaData") Closure metaClosure) throws SQLException {
return asList(sql, rs, 0, 0, metaClosure);
} |
java | @SuppressWarnings("unchecked")
public EList<IfcProperty> getApprovedProperties() {
return (EList<IfcProperty>) eGet(
Ifc2x3tc1Package.Literals.IFC_APPROVAL_PROPERTY_RELATIONSHIP__APPROVED_PROPERTIES, true);
} |
java | public String getHtmlForDbSelection() {
StringBuffer buf = new StringBuffer(2048);
buf.append(
"<select name=\"fullDatabaseKey\" style=\"width: 250px;\" size=\"1\" onchange=\"location.href='../../step_3_database_selection.jsp?fullDatabaseKey='+this.options[this.selectedIndex].value;\">");
... |
python | def run_forever(self, start_at='once'):
"""
Starts the scheduling engine
@param start_at: 'once' -> start immediately
'next_minute' -> start at the first second of the next minutes
'next_hour' -> start 00:00 (min) next hour
... |
java | public Stream<T> onNext(final Action1<? super T> action) {
return new Stream<T>() {
@Override
public Iterator<T> iterator() {
return new ReadOnlyIterator<T>() {
Iterator<T> iterator = Stream.this.iterator();
@Override
... |
java | public void markNeighbor( DelaunayTriangle t )
{
if( t.contains( points[1], points[2] ) )
{
neighbors[0] = t;
t.markNeighbor( points[1], points[2], this );
}
else if( t.contains( points[0], points[2] ) )
{
neighbors[1] = t;
t.ma... |
python | def _pop_params(cls, kwargs):
"""
Pop entries from the `kwargs` passed to cls.__new__ based on the values
in `cls.params`.
Parameters
----------
kwargs : dict
The kwargs passed to cls.__new__.
Returns
-------
params : list[(str, objec... |
java | public static String getType(String fileStreamHexHead) {
for (Entry<String, String> fileTypeEntry : fileTypeMap.entrySet()) {
if(StrUtil.startWithIgnoreCase(fileStreamHexHead, fileTypeEntry.getKey())) {
return fileTypeEntry.getValue();
}
}
return null;
} |
java | private void generateNextPermutationIndices()
{
if (remainingPermutations == 0)
{
throw new IllegalStateException("There are no permutations remaining. " +
"Generator must be reset to continue using.");
}
else if (remainingPerm... |
python | def on_task_done(self, task):
'''Called when a task is done and success, called by `on_task_status`'''
task['status'] = self.taskdb.SUCCESS
task['lastcrawltime'] = time.time()
if 'schedule' in task:
if task['schedule'].get('auto_recrawl') and 'age' in task['schedule']:
... |
java | public final void entryRuleXSwitchExpression() throws RecognitionException {
try {
// InternalXbaseWithAnnotations.g:1034:1: ( ruleXSwitchExpression EOF )
// InternalXbaseWithAnnotations.g:1035:1: ruleXSwitchExpression EOF
{
if ( state.backtracking==0 ) {
... |
java | protected String getMappingString() {
StringBuilder sb = new StringBuilder();
final int schemaSize = uriMap.size();
final int domainSize = patternMap.size();
int s = 0, d = 0;
for (String schema: uriMap.keySet()) {
if (s > 0) sb.append(", ");
sb.app... |
java | public void firstScan(List<String> packageNameList) throws Exception {
LOGGER.debug("start to scan package: " + packageNameList.toString());
// 获取扫描对象并分析整合
scanModel = scanStaticStrategy.scan(packageNameList);
// 增加非注解的配置
scanModel.setJustHostFiles(DisconfCenterHostFilesStore.... |
python | def as_dict(self):
""" Return the URI object as a dictionary"""
d = {k:v for (k,v) in self.__dict__.items()}
return d |
java | @Override
public GetStreamingDistributionResult getStreamingDistribution(GetStreamingDistributionRequest request) {
request = beforeClientExecution(request);
return executeGetStreamingDistribution(request);
} |
java | public ChannelBuffer formatThreadStatsV1(final List<Map<String, Object>> stats) {
throw new BadRequestException(HttpResponseStatus.NOT_IMPLEMENTED,
"The requested API endpoint has not been implemented",
this.getClass().getCanonicalName() +
" has not implemented formatThreadStatsV1");
} |
java | public static void copyStreamUnsafelyUseWithCaution( InputStream in, OutputStream os ) throws IOException {
byte[] buf = new byte[ 1024 ];
int len;
while((len = in.read( buf )) > 0) {
os.write( buf, 0, len );
}
} |
java | public void contextInitialized(ServletContextEvent servletContextEvent)
{
ServletContext ctx = servletContextEvent.getServletContext();
ctx.log("******* Mounting up GreenPepper-Server");
try
{
URL url = GPServletContextListener.class.getClassLoader().getResource(GREENPEP... |
python | def is_valid(email):
"""Email address validation method.
:param email: Email address to be saved.
:type email: basestring
:returns: True if email address is correct, False otherwise.
:rtype: bool
"""
if isinstance(email, basestring) and EMAIL_RE.match(email):
... |
java | public void marshall(DescribeSecurityProfileRequest describeSecurityProfileRequest, ProtocolMarshaller protocolMarshaller) {
if (describeSecurityProfileRequest == null) {
throw new SdkClientException("Invalid argument passed to marshall(...)");
}
try {
protocolMarshalle... |
python | def on_dn_d_mode_change(self, dnd_mode):
"""Notification when the drag'n drop mode changes.
in dnd_mode of type :class:`DnDMode`
The new mode for drag'n drop.
"""
if not isinstance(dnd_mode, DnDMode):
raise TypeError("dnd_mode can only be an instance of type DnD... |
python | def find_closest_weather(weathers_list, unixtime):
"""
Extracts from the provided list of Weather objects the item which is
closest in time to the provided UNIXtime.
:param weathers_list: a list of *Weather* objects
:type weathers_list: list
:param unixtime: a UNIX time
:type unixtime: int
... |
python | def listen(url, prefix=None, **kwargs):
"""
bind and return a connection instance from url
arguments:
- url (str): xbahn connection url
"""
return listener(url, prefix=get_prefix(prefix), **kwargs) |
python | def resolve_out(self, ins):
"""
Determine which stream the output is synchronised with. If the incoming streams have different sync values, then
it is unknown what synchronisation the outgoing stream should have.
:param ins: dictionary of the incoming streams' sync values
:ret... |
java | public float getSphereBound(float[] sphere)
{
if ((sphere == null) || (sphere.length != 4) ||
((NativeVertexBuffer.getBoundingVolume(getNative(), sphere)) < 0))
{
throw new IllegalArgumentException("Cannot copy sphere bound into array provided");
}
return sphe... |
python | def Task(entry): # pylint: disable=invalid-name
"""
Decorator with which classes, who act as tasks in a `Lane`, must be decorated. When a class is
being decorated, it becomes a child of `LaneTask`.
Parameters
----------
entry: The name of the task's "main" method, i.e. the method which is exec... |
python | def use_plenary_hierarchy_view(self):
"""Pass through to provider HierarchyLookupSession.use_plenary_hierarchy_view"""
self._hierarchy_view = PLENARY
# self._get_provider_session('hierarchy_lookup_session') # To make sure the session is tracked
for session in self._get_provider_sessions(... |
java | public static <T, M extends BytesReader<T> & BytesWriter<? super T>> SetMarshaller<T> of(
M elementMarshaller) {
return of(elementMarshaller, elementMarshaller);
} |
java | public void validateCreate(AppNewForm appNewForm) {
// trim
if (appNewForm.getApp() != null) {
appNewForm.setApp(appNewForm.getApp().trim());
}
if (appNewForm.getDesc() != null) {
appNewForm.setDesc(appNewForm.getDesc().trim());
}
App app = appMg... |
java | public static void checkNode(Node node, Node.Type... validTypes) {
for (Node.Type type : validTypes) {
if (node.getNodeType() == type) {
return;
}
}
StringJoiner sj = new StringJoiner(", ");
for (Node.Type type : validTypes) {
sj.add(type.toString());
}
String nodeName = node.getNodeType().name... |
python | def build_swagger_12_api_declaration_view(api_declaration_json):
"""Thanks to the magic of closures, this means we gracefully return JSON
without file IO at request time.
"""
def view_for_api_declaration(request):
# Note that we rewrite basePath to always point at this server's root.
ret... |
java | public List<CmsBrokenLinkBean> renderBrokenLinkInheritanceGroup(CmsResource target, CmsResource source)
throws CmsException {
List<CmsBrokenLinkBean> result = new ArrayList<CmsBrokenLinkBean>();
try {
Set<String> names = CmsInheritanceGroupUtils.getNamesOfGroupsContainingResource(m... |
java | private void probe(ImmutableMember member) {
LOGGER.trace("{} - Probing {}", localMember.id(), member);
bootstrapService.getMessagingService().sendAndReceive(
member.address(), MEMBERSHIP_PROBE, SERIALIZER.encode(Pair.of(localMember.copy(), member)), false, config.getProbeTimeout())
.whenComplet... |
python | def origin_id_to_name(self, origin):
""" Returns a localized origin name for a given ID """
try:
oid = int(origin)
except (ValueError, TypeError):
return None
return self.origins.get(oid) |
java | @SuppressWarnings({"unchecked", "rawtypes"})
public static <T extends Describable<T>,D extends Descriptor<T>>
DescriptorExtensionList<T,D> createDescriptorList(Jenkins jenkins, Class<T> describableType) {
if (describableType == (Class) Publisher.class) {
return (DescriptorExtensionList) new ... |
python | def get_marshaller_for_type(self, tp):
""" Gets the appropriate marshaller for a type.
Retrieves the marshaller, if any, that can be used to read/write
a Python object with type 'tp'. The modules it requires, if
available, will be loaded.
Parameters
----------
t... |
python | async def StatusHistory(self, requests):
'''
requests : typing.Sequence[~StatusHistoryRequest]
Returns -> typing.Sequence[~StatusHistoryResult]
'''
# map input types to rpc msg
_params = dict()
msg = dict(type='Client',
request='StatusHistory',
... |
python | def delete(self, record_key):
''' a method to delete a file
:param record_key: string with name of file
:return: string reporting outcome
'''
title = '%s.delete' % self.__class__.__name__
key_arg = '%s(record_key="%s")' % (title, record_key)
# validate ... |
python | def wrap_expr(self, src: str, dfltChaining: bool) -> str:
"""Wrap `src` in parentheses if neccessary."""
diff_binding = self.op_man.diff_binding()
if diff_binding < 0 or diff_binding == 0 and not dfltChaining:
return self.parenthesize(src)
else:
return src |
java | public BillingPlanUpdateResponse updatePlan(String accountId, BillingPlanInformation billingPlanInformation) throws ApiException {
return updatePlan(accountId, billingPlanInformation, null);
} |
java | public static Map<String, Object> mapDescribedProperties(final PropertyResolver resolver,
final Description description, final PropertyScope defaultPropertyScope) {
final List<Property> properties = description.getProperties();
return mapProperties(resolver, properties, defaultPropertyScope)... |
python | def setSr(self, fs):
"""Sets the samplerate of the input operation being plotted"""
self.tracePlot.setSr(fs)
self.stimPlot.setSr(fs) |
python | def unassign_hosting_device_from_cfg_agent(self, context, cfg_agent_id,
hosting_device_id):
"""Make config agent handle an (unassigned) hosting device."""
hd_db = self._get_hosting_device(context, hosting_device_id)
if hd_db.cfg_agent_id is None and... |
python | def from_sites(cls, sites, charge=None, validate_proximity=False,
to_unit_cell=False):
"""
Convenience constructor to make a Structure from a list of sites.
Args:
sites: Sequence of PeriodicSites. Sites must have the same
lattice.
valid... |
python | def p_if_stmt(p):
"""
if_stmt : IF expr sep stmt_list_opt elseif_stmt END_STMT
| IF LPAREN expr RPAREN stmt_list_opt elseif_stmt END_STMT
"""
if len(p) == 7:
p[0] = node.if_stmt(cond_expr=p[2], then_stmt=p[4], else_stmt=p[5])
elif len(p) == 8:
p[0] = node.if_stmt(cond_exp... |
java | public DocSample processSample(DocSample sample) {
if (sample.isClearAdaptiveDataSet()) {
this.docClassifier.clearFeatureData();
}
String[] document = sample.getTokens();
String cat = docClassifier.classify(document);
if (sample.getLabel().equals(cat)) {
accuracy.add(1);
}
else... |
java | public static Seconds secondsBetween(ReadablePartial start, ReadablePartial end) {
if (start instanceof LocalTime && end instanceof LocalTime) {
Chronology chrono = DateTimeUtils.getChronology(start.getChronology());
int seconds = chrono.seconds().getDifference(
((L... |
python | def discretize(self, method, *args, **kwargs):
"""
Discretizes the continuous distribution into discrete
probability masses using various methods.
Parameters
----------
method : A Discretizer Class from pgmpy.discretize
*args, **kwargs:
The parameter... |
java | void recycle() {
flushed = false;
closed = false;
out = null;
nextChar = 0;
converterBuffer.clear(); //PM19500
response = null; //PM23029
} |
python | def commit(self):
"""Commit mutations to the database.
:rtype: datetime
:returns: timestamp of the committed changes.
"""
self._check_state()
database = self._session._database
api = database.spanner_api
metadata = _metadata_with_prefix(database.name)
... |
python | def _multiplyThroughputs(self):
''' Overrides base class in order to deal with opaque components.
'''
index = 0
for component in self.components:
if component.throughput != None:
break
index += 1
return BaseObservationMode._multiplyThrough... |
python | def get_address(customer_id, data):
"""
Easier to fetch the addresses of customer and then check one by one.
You can get fancy by using some validation mechanism too
"""
Address = client.model('party.address')
addresses = Address.find(
[('party', '=', customer_id)],
fields=[
... |
java | public Metric getMetricAsync(String metricName) throws ExecutionException, InterruptedException {
// [START getMetricAsync]
Future<Metric> future = logging.getMetricAsync(metricName);
// ...
Metric metric = future.get();
if (metric == null) {
// metric was not found
}
// [END getMetric... |
java | public List<ContactsResponse> getCharactersCharacterIdContacts(Integer characterId, String datasource,
String ifNoneMatch, Integer page, String token) throws ApiException {
ApiResponse<List<ContactsResponse>> resp = getCharactersCharacterIdContactsWithHttpInfo(characterId,
datasource... |
python | async def _async_wait_for_process(
future_process: Any,
out: Optional[Union[TeeCapture, IO[str]]] = sys.stdout,
err: Optional[Union[TeeCapture, IO[str]]] = sys.stderr
) -> CommandOutput:
"""Awaits the creation and completion of an asynchronous process.
Args:
future_process: The ... |
java | public void addPrimaryKeysIfSourced() {
final List<Column> primaryKeyColumns = getTable().getPrimaryKeys();
if (primaryKeyColumns == null || primaryKeyColumns.isEmpty()) {
logger.info("No primary keys defined for table {}, not pre-selecting primary keys", getTable().getName());
r... |
java | @Override
public String parse(JsonPullParser parser, OnJsonObjectAddListener listener)
throws IOException, JsonFormatException {
if (parser == null) {
throw new IllegalArgumentException();
}
State state = parser.getEventType();
switch (state) {
case VALUE_NULL:
return null;
case VALUE_STRING:... |
java | public Map<Integer, int[][]> getGridNodesPerMoneyness() {
//See if the map has already been instantiated.
if(keyMap != null) {
return Collections.unmodifiableMap(keyMap);
}
//Otherwise create the map and return it.
Map<Integer, List<Set<Integer>>> newMap = new HashMap<>();
for(DataKey key : ... |
python | def uri(self):
"""return the uri, which is everything but base (no scheme, host, etc)"""
uristring = self.path
if self.query:
uristring += "?{}".format(self.query)
if self.fragment:
uristring += "#{}".format(self.fragment)
return uristring |
python | def new_item(self, hash_key, range_key=None, attrs=None):
"""
Return an new, unsaved Item which can later be PUT to
Amazon DynamoDB.
"""
return Item(self, hash_key, range_key, attrs) |
python | def load_yaml(filename):
"""Read a YAML document from a file. If the file cannot be read or
parsed, a ConfigReadError is raised.
"""
try:
with open(filename, 'rb') as f:
return yaml.load(f, Loader=Loader)
except (IOError, yaml.error.YAMLError) as exc:
raise ConfigReadErro... |
java | @Nullable
public static <ENUMTYPE extends Enum <ENUMTYPE> & IHasID <String>> ENUMTYPE getFromIDCaseInsensitiveOrNull (@Nonnull final Class <ENUMTYPE> aClass,
@Nullable final String sID)
{
return getFrom... |
python | def build_native_type_dictionary(fields, respect_required=False, wrap_field=True, name=''):
"""
This function takes a list of type summaries and builds a dictionary
with native representations of each entry. Useful for dynamically
building native class records from summaries.
"""
# a... |
java | public void polyAddScaleB(GrowQueue_I8 polyA , GrowQueue_I8 polyB , int scaleB , GrowQueue_I8 output ) {
output.resize(Math.max(polyA.size,polyB.size));
// compute offset that would align the smaller polynomial with the larger polynomial
int offsetA = Math.max(0,polyB.size-polyA.size);
int offsetB = Math.max(0... |
python | def validate_input_source_config_source_candidate_candidate(self, **kwargs):
"""Auto Generated Code
"""
config = ET.Element("config")
validate = ET.Element("validate")
config = validate
input = ET.SubElement(validate, "input")
source = ET.SubElement(input, "source... |
python | def enforce_type(self, attr, val):
"""converts a value to the attribute's type"""
if not attr in self.types:
return utfstr(val)
elif self.types[attr] == 'int':
return int(float(val))
elif self.types[attr] == 'float':
return float(val)
else:
... |
python | def fetch(self):
"""
Fetch a FunctionVersionInstance
:returns: Fetched FunctionVersionInstance
:rtype: twilio.rest.serverless.v1.service.function.function_version.FunctionVersionInstance
"""
params = values.of({})
payload = self._version.fetch(
'GET'... |
python | def _add_image_part(self, image):
"""
Return an |ImagePart| instance newly created from image and appended
to the collection.
"""
partname = self._next_image_partname(image.ext)
image_part = ImagePart.from_image(image, partname)
self.append(image_part)
ret... |
python | def fbp_filter_op(ray_trafo, padding=True, filter_type='Ram-Lak',
frequency_scaling=1.0):
"""Create a filter operator for FBP from a `RayTransform`.
Parameters
----------
ray_trafo : `RayTransform`
The ray transform (forward operator) whose approximate inverse should
b... |
java | public static <T extends ImageGray<T>>T average( ImageMultiBand input , T output ) {
if( input instanceof Planar ) {
return (T)average((Planar)input,output);
} else if( input instanceof ImageInterleaved ) {
return (T)average((ImageInterleaved)input,output);
} else {
throw new RuntimeException("Unknown mu... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.