language stringclasses 2
values | func_code_string stringlengths 63 466k |
|---|---|
java | public String[] sequencesToTexts(Integer[][] sequences) {
Integer oovTokenIndex = wordIndex.get(outOfVocabularyToken);
ArrayList<String> texts = new ArrayList<>();
for (Integer[] sequence: sequences) {
ArrayList<String> wordVector = new ArrayList<>();
for (Integer index:... |
python | def encipher(self,string,keep_punct=False):
"""Encipher string using Atbash cipher.
Example::
ciphertext = Atbash().encipher(plaintext)
:param string: The string to encipher.
:param keep_punct: if true, punctuation and spacing are retained. If false, it is all removed... |
java | @Override
public GetClassifierResult getClassifier(GetClassifierRequest request) {
request = beforeClientExecution(request);
return executeGetClassifier(request);
} |
python | def stop(self):
'''
Stop the fuzzing session
'''
self.logger.info('Stopping client fuzzer')
self._target_control_thread.stop()
self.target.signal_mutated()
super(ClientFuzzer, self).stop() |
java | public void setArduinoEnabled(boolean enable) {
Buffer buffer = new Buffer();
buffer.writeByte(enable ? 1 : 0);
sendMessage(BeanMessageID.CC_POWER_ARDUINO, buffer);
} |
java | protected boolean isSymbolicLink(File file) throws IOException {
if (IS_WINDOWS) {
return false;
}
File canonical = file;
if (file.getParent() != null) {
canonical = new File(file.getParentFile().getCanonicalFile(), file.getName());
}
return !canonical.getCanonicalFile().equals(cano... |
java | private CellFormatResult getErrorCellValue(final Cell cell, final Locale locale, final boolean isStartDate1904) {
final CellFormatResult result = new CellFormatResult();
result.setCellType(FormatCellType.Error);
final ErrorCell errorCell = (ErrorCell) cell;
final ... |
python | def deserialize_dtype(d):
"""
Deserializes a JSONified :obj:`numpy.dtype`.
Args:
d (:obj:`dict`): A dictionary representation of a :obj:`dtype` object.
Returns:
A :obj:`dtype` object.
"""
if isinstance(d['descr'], six.string_types):
return np.dtype(d['descr'])
descr... |
python | def plainica(x, reducedim=0.99, backend=None, random_state=None):
""" Source decomposition with ICA.
Apply ICA to the data x, with optional PCA dimensionality reduction.
Parameters
----------
x : array, shape (n_trials, n_channels, n_samples) or (n_channels, n_samples)
data set
reduced... |
java | public ClassFile getClassFile(String name) throws IOException {
if (name.indexOf('.') > 0) {
int i = name.lastIndexOf('.');
String pathname = name.replace('.', File.separatorChar) + ".class";
if (baseFileName.equals(pathname) ||
baseFileName.equals(pathnam... |
java | protected void modified(String id, Map<String, Object> properties) {
if (TraceComponent.isAnyTracingEnabled() && tc.isEventEnabled()) {
Tr.event(this, tc, "modified " + id, properties);
}
config = properties;
myProps = null;
} |
python | def hexbin(x, y, color="purple", **kwargs):
"""Seaborn-compatible hexbin plot.
See also: http://seaborn.pydata.org/tutorial/axis_grids.html#mapping-custom-functions-onto-the-grid
"""
if HAS_SEABORN:
cmap = sns.light_palette(color, as_cmap=True)
else:
cmap = "Purples"
plt.hexbin(... |
java | public DataLakeAnalyticsAccountInner update(String resourceGroupName, String name, DataLakeAnalyticsAccountInner parameters) {
return updateWithServiceResponseAsync(resourceGroupName, name, parameters).toBlocking().last().body();
} |
java | public synchronized I_CmsLruCacheObject remove(I_CmsLruCacheObject theCacheObject) {
if (!isCached(theCacheObject)) {
// theCacheObject is null or not inside the cache
return null;
}
// set the list pointers correct
boolean nextNull = (theCacheObject.getNextLruO... |
java | private void mergeEngineeringObjectWithReferencedModel(Field field, EngineeringObjectModelWrapper model) {
AdvancedModelWrapper result = performMerge(loadReferencedModel(model, field), model);
if (result != null) {
model = result.toEngineeringObject();
}
} |
python | def from_numpy_arrays(freq_data, noise_data, length, delta_f, low_freq_cutoff):
"""Interpolate n PSD (as two 1-dimensional arrays of frequency and data)
to the desired length, delta_f and low frequency cutoff.
Parameters
----------
freq_data : array
Array of frequencies.
noise_data : ar... |
python | def fast_inhomo_bloch_equations(Ep, epsilonp, detuning_knob, T, gamma,
omega_level, rm, xi, theta,
unfolding, inhomogeneity, matrix_form=False,
file_name=None, return_code=False):
r"""Return a fast function that returns ... |
java | public static BackendUser from(ValidCredentials credentials){
BackendUser beu = new BackendUser();
beu.initFrom(credentials);
return beu;
} |
java | public static final Date parseExtendedAttributeDate(String value)
{
Date result = null;
if (value != null)
{
try
{
result = DATE_FORMAT.get().parse(value);
}
catch (ParseException ex)
{
// ignore exceptions
}
}
... |
java | public Observable<ServiceResponse<ResourceHealthMetadataInner>> getBySiteWithServiceResponseAsync(String resourceGroupName, String name) {
if (resourceGroupName == null) {
throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.");
}
if (name ==... |
python | def _dt_array_cmp(cls, op):
"""
Wrap comparison operations to convert datetime-like to datetime64
"""
opname = '__{name}__'.format(name=op.__name__)
nat_result = opname == '__ne__'
def wrapper(self, other):
if isinstance(other, (ABCDataFrame, ABCSeries, ABCIndexClass)):
retu... |
java | @Deprecated
public static URL buildUrl(String host, int port, String path, Map<String, String> parameters) throws MalformedURLException {
return buildUrl("http", port, path, parameters);
} |
python | def post_handler_err(self, function_arn, invocation_id, handler_err):
"""
Post the error message from executing the function handler for :code:`function_arn`
with specifid :code:`invocation_id`
:param function_arn: Arn of the Lambda function which has the handler error message.
... |
python | def _compute_quads(self, element, data, mapping):
"""
Computes the node quad glyph data.x
"""
quad_mapping = {'left': 'x0', 'right': 'x1', 'bottom': 'y0', 'top': 'y1'}
quad_data = dict(data['scatter_1'])
quad_data.update({'x0': [], 'x1': [], 'y0': [], 'y1': []})
f... |
java | private int staticEncodingLength(GenericPropertyInfo info) {
TypeDesc type = info.getStorageType();
TypeDesc primType = type.toPrimitiveType();
if (primType == null) {
if (info.isLob()) {
// Lob locator is stored as a long.
return 8;
... |
python | def rotvec(v1, angle, iaxis):
"""
Transform a vector to a new coordinate system rotated by angle
radians about axis iaxis. This transformation rotates v1 by
angle radians about the specified axis.
http://naif.jpl.nasa.gov/pub/naif/toolkit_docs/C/cspice/rotvec_c.html
:param v1: Vector whose co... |
java | protected BlockStmt returnField(String fieldName) {
BlockStmt body = new BlockStmt();
body.addStatement(new ReturnStmt(fieldName));
return body;
} |
python | def _flatten_mesh(self, Xs, term):
"""flatten the mesh and distribute into a feature matrix"""
n = Xs[0].size
if self.terms[term].istensor:
terms = self.terms[term]
else:
terms = [self.terms[term]]
X = np.zeros((n, self.statistics_['m_features']))
... |
python | def detect_cid_in_current_path(i):
"""
Input: {
(path) - path, otherwise current directory
}
Output: {
return - return code = 0, if successful
> 0, if error
(error) - error text if return ... |
java | public static <Type extends Message>
RpcCallback<Message> generalizeCallback(
final RpcCallback<Type> originalCallback,
final Class<Type> originalClass,
final Type defaultInstance) {
return new RpcCallback<Message>() {
public void run(final Message parameter) {
Type typedParameter;... |
java | @SuppressWarnings("unchecked")
@Override
public EList<String> getTelephoneNumbers() {
return (EList<String>) eGet(Ifc4Package.Literals.IFC_TELECOM_ADDRESS__TELEPHONE_NUMBERS, true);
} |
python | async def _process_2auth_form(self, html: str) -> (str, str):
"""
Parsing two-factor authorization page and filling the code
:param html: html page
:return: url and html from redirected page
"""
# Parse page
p = TwoFactorCodePageParser()
p.feed(html)
... |
python | def sample_path(alpha, A, pobs, T=None):
""" Sample the hidden pathway S from the conditional distribution P ( S | Parameters, Observations )
Parameters
----------
alpha : ndarray((T,N), dtype = float), optional, default = None
alpha[t,i] is the ith forward coefficient of time t.
A : ndarra... |
python | def _remove(self, obj):
"""Python 2.4 compatibility."""
for idx, item in enumerate(self._queue):
if item == obj:
del self._queue[idx]
break |
java | public static <R> Stream<R> zip(final char[] a, final char[] b, final char[] c, final char valueForNoneA, final char valueForNoneB,
final char valueForNoneC, final CharTriFunction<R> zipFunction) {
return zip(CharIteratorEx.of(a), CharIteratorEx.of(b), CharIteratorEx.of(c), valueForNoneA, valueFor... |
java | public CharSequence process(CharSequence source) {
CharSequence target = source;
for (TextProcessor processor : processors) {
target = processor.process(target);
}
return target;
} |
java | public static List<Element> getDescriptorElements(InputStream xmlDescriptorIn)
throws IOException {
List<Element> elements = new ArrayList<>();
org.w3c.dom.Document xmlDescriptorDOM = createDOM(xmlDescriptorIn);
XPath xPath = XPathFactory.newInstance().newXPath();
NodeList allElements;
try {
... |
python | def convert(self, value, view):
"""Check that the value is a string and matches the pattern.
"""
if isinstance(value, BASESTRING):
if self.pattern and not self.regex.match(value):
self.fail(
u"must match the pattern {0}".format(self.pattern),
... |
java | public Observable<ServiceResponse<Page<PublicIPAddressInner>>> listVirtualMachineScaleSetVMPublicIPAddressesSinglePageAsync(final String resourceGroupName, final String virtualMachineScaleSetName, final String virtualmachineIndex, final String networkInterfaceName, final String ipConfigurationName) {
if (resour... |
python | def NewFromJSON(data):
"""
Create a new SharedFile instance from a JSON dict.
Args:
data (dict): JSON dictionary representing a SharedFile.
Returns:
A SharedFile instance.
"""
return SharedFile(
sharekey=data.get('sharekey', None),
... |
java | public boolean setBooleanValue(boolean value) throws IOException, SaneException {
ControlOptionResult result = writeOption(SaneWord.forInt(value ? 1 : 0));
Preconditions.checkState(result.getType() == OptionValueType.BOOLEAN);
return SaneWord.fromBytes(result.getValue()).integerValue() != 0;
} |
java | protected static void reportError(ParsingContext context, String message, Object... parameter) {
final File file = context.getCurrentFile();
final int offset = context.getMatcher().start() + context.getStartIndex();
final int lineno = context.getLineNo();
Throwable cause = null;
for (final Object param :... |
java | private void cancelNameResolverBackoff() {
syncContext.throwIfNotInThisSynchronizationContext();
if (scheduledNameResolverRefresh != null) {
scheduledNameResolverRefresh.cancel();
scheduledNameResolverRefresh = null;
nameResolverBackoffPolicy = null;
}
} |
java | private boolean importConfigurations() {
// Create a set of files in the inventory
Set<File> files = inventory.entries().stream().map(v->v.getPath()).collect(Collectors.toSet());
List<File> entriesToImport = Arrays.asList(baseDir.listFiles(f->
f.isFile()
&& !f.equals(catalog) // Exclude the master catalog (... |
java | public Map<String, Metamodel> getMetamodelMap()
{
if (metamodelMap == null)
{
metamodelMap = new HashMap<String, Metamodel>();
}
return metamodelMap;
} |
python | def join_all(domain, *parts):
"""
Join all url components.
Example::
>>> join_all("https://www.apple.com", "iphone")
https://www.apple.com/iphone
:param domain: Domain parts, example: https://www.python.org
:param parts: Other parts, example: "/doc", "/py27"
:return: url
"... |
java | protected void record( final AnnotationTypeMemberDeclaration annotationTypeMember,
final Node parentNode ) throws Exception {
final Node memberNode = parentNode.addNode(ClassFileSequencerLexicon.ANNOTATION_TYPE_MEMBER,
ClassFileSequen... |
java | public RegexPatternSet withRegexPatternStrings(String... regexPatternStrings) {
if (this.regexPatternStrings == null) {
setRegexPatternStrings(new java.util.ArrayList<String>(regexPatternStrings.length));
}
for (String ele : regexPatternStrings) {
this.regexPatternStrings... |
java | public com.google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.KMapEstimationResultOrBuilder
getKMapEstimationResultOrBuilder() {
if (resultCase_ == 7) {
return (com.google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.KMapEstimationResult) result_;
}
return com.google.privacy.dlp.v2.AnalyzeDataSou... |
java | private void generateScenes(final Metadata m, final Element e) {
final Element scenesElement = new Element("scenes", NS);
for (final Scene scene : m.getScenes()) {
final Element sceneElement = new Element("scene", NS);
addNotNullElement(sceneElement, "sceneTitle", scene.getTitle(... |
java | public String getMessageAndLocation() {
StringBuilder sbuffer = new StringBuilder();
String message = super.getMessage();
if (null != message) {
sbuffer.append(message);
}
if (null != locator) {
String systemID = locator.getSystemId();
... |
java | public void drawItemStack(ItemStack itemStack, int x, int y, String label)
{
drawItemStack(itemStack, x, y, label, null, true);
} |
java | @Override
@SuppressWarnings("unchecked")
public void start() {
if (isStopped()) return;
logger().log("Inbound stream listening: for '" + reader.name() + "'");
try {
reader.openFor(this);
} catch (Exception e) {
reader.close();
e.printStackTrace();
throw new IllegalS... |
python | def _determine_scaling_policies(scaling_policies, scaling_policies_from_pillar):
'''
helper method for present. ensure that scaling_policies are set
'''
pillar_scaling_policies = copy.deepcopy(
__salt__['config.option'](scaling_policies_from_pillar, {})
)
if not scaling_policies and pil... |
java | public static dnssrvrec[] get_filtered(nitro_service service, String filter) throws Exception{
dnssrvrec obj = new dnssrvrec();
options option = new options();
option.set_filter(filter);
dnssrvrec[] response = (dnssrvrec[]) obj.getfiltered(service, option);
return response;
} |
java | public JSONObject getFullPresence()
{
JSONObject game = getGameJson(this.game);
return new JSONObject()
.put("afk", idle)
.put("since", System.currentTimeMillis())
.put("game", game == null ? JSONObject.NULL : game)
.put("status", getStatus().g... |
java | public AbucoinsTicker getAbucoinsTicker(String productID) throws IOException {
AbucoinsTicker abucoinsTicker = abucoins.getTicker(productID);
return abucoinsTicker;
} |
python | def move(self, x, y):
"""Changes the overlay's position relative to the IFramebuffer.
in x of type int
in y of type int
"""
if not isinstance(x, baseinteger):
raise TypeError("x can only be an instance of type baseinteger")
if not isinstance(y, baseinteger)... |
python | def plotloc(data, circleinds=[], crossinds=[], edgeinds=[], url_path=None, fileroot=None,
tools="hover,tap,pan,box_select,wheel_zoom,reset", plot_width=450, plot_height=400):
""" Make a light-weight loc figure """
fields = ['l1', 'm1', 'sizes', 'colors', 'snrs', 'key']
if not circleinds: circl... |
python | def inicap_string(string,
cleanse=False):
"""
Convert the first letter of each word to capital letter without
touching the rest of the word.
@param string: a string.
@param cleanse: ``True`` to remove any separator character from the
string, such as comma; ``False`` to keeps any ch... |
python | def _makemasks(self, index=None, level=0):
"""
Internal function for generating masks for selecting values based on multi-index values.
As all other multi-index functions will call this function, basic type-checking is also
performed at this stage.
"""
if index is None:
... |
python | def ReadCompletedRequests(self, session_id, timestamp=None, limit=None):
"""Fetches all the requests with a status message queued for them."""
subject = session_id.Add("state")
requests = {}
status = {}
for predicate, serialized, _ in self.ResolvePrefix(
subject, [self.FLOW_REQUEST_PREFIX, ... |
java | @Override
public boolean releasePeerLease(String recoveryIdentity) throws Exception {
if (tc.isEntryEnabled())
Tr.entry(tc, "releasePeerLease", new Object[] { recoveryIdentity, this });
// Release the lock - if it is not null!
FileLock fLock = null;
FileChannel fChannel =... |
java | public IntIntSortedVector getSum(IntIntVector other) {
IntIntSortedVector sum = new IntIntSortedVector(this);
sum.add(other);
return sum;
} |
java | public static UTF8JsonGenerator newJsonGenerator(OutputStream out, byte[] buf)
{
return newJsonGenerator(out, buf, 0, false, new IOContext(
DEFAULT_JSON_FACTORY._getBufferRecycler(), out, false));
} |
python | def emit(self, record):
"""Prints a record out to some streams.
If FLAGS.logtostderr is set, it will print to sys.stderr ONLY.
If FLAGS.alsologtostderr is set, it will print to sys.stderr.
If FLAGS.logtostderr is not set, it will log to the stream
associated with the current thread.
Args:
... |
java | private String nodeTabs() {
StringBuilder builder = new StringBuilder();
builder.append("<div class='tabs'>");
builder.append("<ul>");
builder
.append("<li class='tab' type='browsers'><a title='test slots' href='#'>Browsers</a></li>");
builder
.append("<li class='tab' type='config'><... |
java | @XmlElementDecl(namespace = "http://schema.intuit.com/finance/v3", name = "TaxCode", substitutionHeadNamespace = "http://schema.intuit.com/finance/v3", substitutionHeadName = "IntuitObject")
public JAXBElement<TaxCode> createTaxCode(TaxCode value) {
return new JAXBElement<TaxCode>(_TaxCode_QNAME, TaxCode.cl... |
java | public static List<String> splitEqually(String _text, int _len) {
if (_text == null) {
return null;
}
List<String> ret = new ArrayList<String>((_text.length() + _len - 1) / _len);
for (int start = 0; start < _text.length(); start += _len) {
ret.add(_text.substrin... |
java | public int lookupIndex(short value) {
for (int i=0; i<elements.length; i++) {
if (elements[i] == value) {
return i;
}
}
return -1;
} |
python | def expect(self, c):
"""
If the current position doesn't hold the specified c character then it raises an
exception, otherwise it skips the specified character (moves the current position forward).
"""
if self.peek() != c:
self.error('Expected "%c"' % (c,))
se... |
python | def set_parallel_value_for_key(self, key, value):
"""
Set a globally available key and value that can be accessed
from all the pabot processes.
"""
if self._remotelib:
self._remotelib.run_keyword('set_parallel_value_for_key',
[k... |
python | def set_aliases_and_defaults(self, aliases_config=None,
default_properties=None):
"""
Set the alias config and defaults to use. Typically used when
switching to a collection with a different schema.
Args:
aliases_config:
An al... |
java | protected FieldDescriptor[] buildFieldsForSelect(ClassDescriptor cld)
{
DescriptorRepository repository = cld.getRepository();
Set fields = new ListOrderedSet(); // keep the order of the fields
// add Standard Fields
// MBAIRD: if the object being queried on has mult... |
java | private String getValue(final List<String> attributes,final List<Class<?>> classes,String value,final String mappedFieldName,final Class<?> configuredClass,final Class<?> targetClass){
String regex = getValue(value,mappedFieldName);
String mappedClassName = configuredClass.getSimpleName();
String targetCla... |
python | def connect(self, coro):
"""
The coroutine `coro` is connected to the signal. The coroutine must
return a true value, unless it wants to be disconnected from the
signal.
.. note::
This is different from the return value convention with
:attr:`AdHocSignal.S... |
python | def calc_max_flexural_wavelength(self):
"""
Returns the approximate maximum flexural wavelength
This is important when padding of the grid is required: in Flexure (this
code), grids are padded out to one maximum flexural wavelength, but in any
case, the flexural wavelength is a good characteristic... |
java | @Deprecated
public void update(String projectKey, WikiPageDetail detail) throws RedmineException {
String urlSafeTitle = WikiPageDetail.getUrlSafeString(detail.getTitle());
transport.updateChildEntry(Project.class, projectKey, detail, urlSafeTitle);
} |
python | def discover_OP_information(OP_uri):
"""
Discovers information about the provided OpenID Provider.
:param OP_uri: The base URI of the Provider information is requested for.
:type OP_uri: str
:returns: The contents of the Provider metadata document.
:rtype: dict
.. versionadded:: 1.0
""... |
java | public void forEach(final CounterConsumer consumer)
{
int counterId = 0;
final AtomicBuffer metaDataBuffer = this.metaDataBuffer;
final AtomicBuffer valuesBuffer = this.valuesBuffer;
for (int i = 0, capacity = metaDataBuffer.capacity(); i < capacity; i += METADATA_LENGTH)
{... |
python | def NetFxSdkDir(self):
"""
Microsoft .NET Framework SDK directory.
"""
for ver in self.NetFxSdkVersion:
loc = os.path.join(self.ri.netfx_sdk, ver)
sdkdir = self.ri.lookup(loc, 'kitsinstallationfolder')
if sdkdir:
break
return sd... |
java | public static void release(ClassLoader classLoader) {
// JULI's log manager looks at the current classLoader so there is no
// need to use the passed in classLoader, the default implementation
// does not so calling reset in that case will break things
if (!LogManager.getLogManager().getClass().getName().equals... |
python | def clean(self, value, initial=None):
"""
Most part of this method is a copy of
django.forms.MultiValueField.clean, with the exception of initial
value handling (this need for correct processing FileField's).
All original comments saved.
"""
if initial is None:
... |
python | def actor(fn=None, *, actor_class=Actor, actor_name=None, queue_name="default", priority=0, broker=None, **options):
"""Declare an actor.
Examples:
>>> import dramatiq
>>> @dramatiq.actor
... def add(x, y):
... print(x + y)
...
>>> add
Actor(<function add at 0x10... |
java | @Override
protected void initialize() throws Exception {
super.initialize();
// sanity check: the tail has to update either the workset or the solution set
if (!isWorksetUpdate && !isSolutionSetUpdate) {
throw new RuntimeException("The iteration tail doesn't update workset or the solution set.");
}
// s... |
python | def get_genres(self):
"""
Grab genre URLs from iTunes Podcast preview
"""
page = r.get(ITUNES_GENRES_URL)
tree = html.fromstring(page.content)
elements = tree.xpath("//a[@class='top-level-genre']")
return [e.attrib['href'] for e in elements] |
python | def send_measurement(self, measurement):
"""
Posts the provided Measurement object's data to the Station API.
:param measurement: the *pyowm.stationsapi30.measurement.Measurement*
object to be posted
:type measurement: *pyowm.stationsapi30.measurement.Measurement* instance
... |
java | public void processResources(List<Row> rows)
{
for (Row row : rows)
{
Resource resource = m_project.addResource();
processFields(m_resourceFields, row, resource);
resource.setResourceCalendar(getResourceCalendar(row.getInteger("clndr_id")));
// Even though we're not f... |
python | def tryCommit(self, prepare: Prepare):
"""
Try to commit if the Prepare message is ready to be passed into the
commit phase.
"""
rv, reason = self.canCommit(prepare)
if rv:
self.doCommit(prepare)
else:
self.logger.debug("{} cannot send COMM... |
java | private boolean updateTintColor(int[] state) {
final int trackColor = mTrackStateList.getColorForState(state, mTrackColor);
final int scrubberColor = mScrubberStateList.getColorForState(state, mScrubberColor);
final int thumbColor = mThumbStateList.getColorForState(state, mThumbColor);
... |
python | def dead_chips(self):
"""Generate the coordinates of all dead chips.
Yields
------
(x, y)
The coordinate of a dead chip.
"""
for x in range(self.width):
for y in range(self.height):
if (x, y) not in self:
yield ... |
python | def string_avg(strings, binary=True):
"""
Takes a list of strings of equal length and returns a string containing
the most common value from each index in the string.
Optional argument: binary - a boolean indicating whether or not to treat
strings as binary numbers (fill in leading zeros if lengths... |
python | def update_model(self, tfi):
"""Update the model for the given tfi
:param tfi: taskfile info
:type tfi: :class:`TaskFileInfo`
:returns: None
:rtype: None
:raises: None
"""
if tfi.task.department.assetflag:
browser = self.assetbrws
else... |
java | public JComponent learn() {
double[][] data = dataset[datasetIndex].toArray(new double[dataset[datasetIndex].size()][]);
String[] names = dataset[datasetIndex].toArray(new String[dataset[datasetIndex].size()]);
if (names[0] == null) {
names = null;
}
int[] l... |
python | def get_residue_annotations(self, start_resnum, end_resnum=None):
"""Retrieve letter annotations for a residue or a range of residues
Args:
start_resnum (int): Residue number
end_resnum (int): Optional residue number, specify if a range is desired
Returns:
d... |
python | def check(*args, **kwds):
"""Check wrapper, a factory for FontBakeryCheck
Requires all arguments of FontBakeryCheck but not `checkfunc`
which is passed via the decorator syntax.
"""
def wrapper(checkfunc):
return wraps(checkfunc)(FontBakeryCheck(checkfunc, *args, **kwds))
return wrapper |
python | def p_expr_EQ_expr(p):
""" expr : expr EQ expr
"""
p[0] = make_binary(p.lineno(2), 'EQ', p[1], p[3], lambda x, y: x == y) |
java | @Override
public final Iterable<T> children(final T root) {
checkNotNull(root);
return new FluentIterable<T>() {
@Override
public Iterator<T> iterator() {
return new AbstractIterator<T>() {
boolean doneLeft;
boolean doneRight;
@Override
protected T ... |
java | public static <S1, I1, T1, S2, I2, T2, SP2, TP2> Mapping<S1, S2> rawCopy(TSTraversalMethod method,
TransitionSystem<S1, ? super I1, T1> in,
int limit,
... |
python | def get_tl(self):
"""Returns the top left border of the cell"""
cell_above_left = CellBorders(self.cell_attributes,
*self.cell.get_above_left_key_rect())
return cell_above_left.get_r() |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.