language stringclasses 2
values | func_code_string stringlengths 63 466k |
|---|---|
python | def step(self):
"""Grab a new message and dispatch it to the handler.
This method should not be extended or overwritten. Instead,
implementations of this daemon should implement the 'get_message()'
and 'handle_message()' methods.
"""
message = self.get_message()
... |
python | def get_relation_by_type_list(parser, token):
"""Gets list of relations from object identified by a content type.
Syntax::
{% get_relation_list [content_type_app_label.content_type_model] for [object] as [varname] [direction] %}
"""
tokens = token.contents.split()
if len(tokens) not in (6,... |
java | public CsvFieldError getFirstFieldError(final String path) {
ArgUtils.notEmpty(path, "path");
for(CsvError item : this.errors) {
if(item instanceof CsvFieldError && isMatchingFieldError(path, (CsvFieldError) item)) {
return (CsvFieldError) item;
}
... |
java | boolean endEntry(boolean endOfRecord) {
// Check to see if we actually have an entry started.
if (this.writeEntryStartIndex >= 0) {
int entryLength = this.writePosition - this.writeEntryStartIndex - WriteEntryHeader.HEADER_SIZE;
assert entryLength >= 0 : "entryLength is negative.... |
python | def make_fileitem_peinfo_detectedanomalies_string(anomaly, condition='is', negate=False, preserve_case=False):
"""
Create a node for FileItem/PEInfo/DetectedAnomalies/string
:return: A IndicatorItem represented as an Element node
"""
document = 'FileItem'
search = 'FileItem/PEInfo/DetectedA... |
java | public Matrix3f set(Matrix4x3fc m) {
m00 = m.m00();
m01 = m.m01();
m02 = m.m02();
m10 = m.m10();
m11 = m.m11();
m12 = m.m12();
m20 = m.m20();
m21 = m.m21();
m22 = m.m22();
return this;
} |
java | protected byte[] getFileBytes(ClassFile classFile) throws IOException {
File file = new File(classFile.getFilePath());
FileInputStream fin = new FileInputStream(file);
byte[] raw=InputStreamUtils.getBytes(fin);
fin.close();
return raw;
} |
java | public static <T> GenericResponseBuilder<T> notModified(EntityTag tag) {
return GenericResponses.<T>notModified().tag(tag);
} |
java | public KeyField getKeyField(int iKeyFieldSeq, boolean bForceUniqueKey)
{
KeyField keyField = null;
if (iKeyFieldSeq != this.getKeyFields(false, true))
keyField = this.getKeyField(iKeyFieldSeq);
else
keyField = this.getRecord().getKeyArea(0).getKeyField(0); // Special... |
python | def set_comment(self, key_name, new_comment):
"""Sets the comment of key."""
kf = self.dct[key_name]
kf['comment'] = new_comment |
python | def getShocks(self):
'''
Gets new Markov states and permanent and transitory income shocks for this period. Samples
from IncomeDstn for each period-state in the cycle.
Parameters
----------
None
Returns
-------
None
'''
# Get new... |
java | public void addPersistentDestinationData(HashMap<String, Object> hm)
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.entry(tc, "addPersistentDestinationData", hm);
hm.put("messagingEngineUuid", getLocalizingMEUuid().toByteArray());
hm.put("toBeDeleted", toBeDelete... |
python | def getSynchronizationSources(self):
"""
Returns a :class:`RTCRtpSynchronizationSource` for each unique SSRC identifier
received in the last 10 seconds.
"""
cutoff = clock.current_datetime() - datetime.timedelta(seconds=10)
sources = []
for source, timestamp in se... |
python | def _GetIdentifierFromPath(self, parser_mediator):
"""Extracts a container or a graph ID from a JSON file's path.
Args:
parser_mediator (ParserMediator): mediates interactions between parsers
and other components, such as storage and dfvfs.
Returns:
str: container or graph identifier... |
python | def scrollbar_toggled(self, settings, key, user_data):
"""If the gconf var use_scrollbar be changed, this method will
be called and will show/hide scrollbars of all terminals open.
"""
for term in self.guake.notebook_manager.iter_terminals():
# There is an hbox in each tab of... |
python | def get_range(self, name_prefix, vlan_id_range):
"""
Gets a list of Ethernet Networks that match the 'given name_prefix' and the 'vlan_id_range'.
Examples:
>>> enet.get_range('Enet_name', '1-2,5')
# The result contains the ethernet network with names:
... |
java | public void replaceLines(int startLine, int endLine, List<String> replacementLines) {
Preconditions.checkArgument(startLine <= endLine);
List<String> originalLines = getLines();
List<String> newLines = new ArrayList<>();
for (int i = 0; i < originalLines.size(); i++) {
int lineNum = i + 1;
i... |
java | public java.util.List<String> getNodeGroupsToRemove() {
if (nodeGroupsToRemove == null) {
nodeGroupsToRemove = new com.amazonaws.internal.SdkInternalList<String>();
}
return nodeGroupsToRemove;
} |
java | public static Writer getOutputStreamWriter(OutputStream out) {
try {
return new OutputStreamWriter(out, "UTF-8");
}
catch (UnsupportedEncodingException ex) {
throw new RuntimeException(ex); // shouldn't happen since UTF-8 is supported by all JVMs per spec
}
} |
java | public static Object createInstance(String name, String library, Object... args) throws Exception {
Class<?> type = getType(name, library);
if (type == null)
throw new NotFoundException(null, "TYPE_NOT_FOUND", "Type " + name + "," + library + " was not found")
.withDetails("type", name).withDetails("library... |
python | def read_data(meta, path_dir, sample_f=1, decimate=False, overwrite=False):
'''Read accelerometry data from leonardo txt files
Args
----
meta: dict
Dictionary of meta data from header lines of lleo data files
path_dir: str
Parent directory containing lleo data files
sample_f: in... |
java | private void insert(ESSyncConfig config, Dml dml) {
List<Map<String, Object>> dataList = dml.getData();
if (dataList == null || dataList.isEmpty()) {
return;
}
SchemaItem schemaItem = config.getEsMapping().getSchemaItem();
for (Map<String, Object> data : dataList) {
... |
java | public final FFDCLogger introspect(String description, Object value)
{
if (value instanceof FFDCSelfIntrospectable)
append(((FFDCSelfIntrospectable) value).introspectSelf());
else
append(description, value);
return this;
} |
java | public DescribeTrailsRequest withTrailNameList(String... trailNameList) {
if (this.trailNameList == null) {
setTrailNameList(new com.amazonaws.internal.SdkInternalList<String>(trailNameList.length));
}
for (String ele : trailNameList) {
this.trailNameList.add(ele);
... |
java | public LDAPQuery setAttributes(String... attributes) {
if(attributes != null && attributes.length > 0) {
this.attributes = attributes;
} else {
this.attributes = ALL_ATTRIBUTES;
}
return this;
} |
java | public static final double getDoubleAttribute(Path path, String attribute, LinkOption... options) throws IOException
{
return getDoubleAttribute(path, attribute, Double.NaN, options);
} |
java | public Set<Axiom> getStatedAxioms() {
Set<Axiom> res = new HashSet<Axiom>();
// These terms are of the form A n Bi [ B and are indexed by A.
for(IntIterator it = ontologyNF1.keyIterator(); it.hasNext(); ) {
int a = it.next();
MonotonicCollection<IConjunctionQueueEntry> mc... |
python | def get_boto_ses_connection():
"""
Shortcut for instantiating and returning a boto SESConnection object.
:rtype: boto.ses.SESConnection
:returns: A boto SESConnection object, from which email sending is done.
"""
access_key_id = getattr(
settings, 'CUCUMBER_SES_ACCESS_KEY_ID',
... |
java | protected void invokeHandler(HttpServletRequest req, HttpServletResponse res) throws IOException, ServletException {
String name = OpenCmsCore.getInstance().getPathInfo(req).substring(HANDLE_PATH.length());
I_CmsRequestHandler handler = OpenCmsCore.getInstance().getRequestHandler(name);
if ((ha... |
python | def solarReturnJD(jd, lon, forward=True):
""" Finds the julian date before or after
'jd' when the sun is at longitude 'lon'.
It searches forward by default.
"""
sun = swe.sweObjectLon(const.SUN, jd)
if forward:
dist = angle.distance(sun, lon)
else:
dist = -angle.distan... |
python | def clip_range(nodes1, nodes2):
r"""Reduce the parameter range where two curves can intersect.
Does so by using the "fat line" for ``nodes1`` and computing the
distance polynomial against ``nodes2``.
.. note::
This assumes, but does not check that the curves being considered
will only h... |
java | @Override
public void encodeUtf8(CharSequence in, ByteBuffer out) {
if (out.hasArray()) {
int start = out.arrayOffset();
int end = encodeUtf8Array(in, out.array(), start + out.position(),
out.remaining());
out.position(end - start);
} else {
encodeUtf8Buffer(in, out);
}
... |
python | def PostUnregistration(method):
# pylint: disable=C0103
"""
The service post-unregistration callback decorator is called after a service
of the component has been unregistered from the framework.
The decorated method must accept the
:class:`~pelix.framework.ServiceReference` of the registered
... |
python | def scale(self, s=None):
"""Set/get actor's scaling factor.
:param s: scaling factor(s).
:type s: float, list
.. note:: if `s==(sx,sy,sz)` scale differently in the three coordinates."""
if s is None:
return np.array(self.GetScale())
self.SetScale(s)
... |
python | def disco_loop_asm_format(opc, version, co, real_out,
fn_name_map, all_fns):
"""Produces disassembly in a format more conducive to
automatic assembly by producing inner modules before they are
used by outer ones. Since this is recusive, we'll
use more stack space at runtime.
... |
java | public void getElementWithSettings(
final String clientId,
final Map<String, String> settings,
final I_CmsSimpleCallback<CmsContainerElementData> callback) {
CmsRpcAction<CmsContainerElementData> action = new CmsRpcAction<CmsContainerElementData>() {
/**
* @see... |
java | @Override
public List<FileSource> createSources(String srcName) {
final File dirOrFile = new File(srcName);
final File[] files = dirOrFile.listFiles(FILTER);
if (files != null) {
final List<FileSource> sources = new ArrayList<FileSource>(files.length);
for (File file... |
java | String readWord(BufferedReader raf) throws IOException
{
while (true)
{
// check the buffer first
if (wbp < wordsBuffer.length)
{
return wordsBuffer[wbp++];
}
String line = raf.readLine();
if (line == null)
... |
python | def move(self, from_stash, to_stash, filter_func=None):
"""
Move states from one stash to another.
:param from_stash: Take matching states from this stash.
:param to_stash: Put matching states into this stash.
:param filter_func: Stash states that match this filter. Should b... |
java | public void setExpansion(double expansion)
{
if(expansion <= 1 || Double.isNaN(expansion) || Double.isInfinite(expansion) )
throw new ArithmeticException("Expansion constant must be > 1, not " + expansion);
else if(expansion <= reflection)
throw new ArithmeticException("Expa... |
java | public void setTrainingLabel(int variable, int value) {
getVariableMetaDataByReference(variable).put(LogLikelihoodDifferentiableFunction.VARIABLE_TRAINING_VALUE, Integer.toString(value));
} |
python | def _attachment_uri(self, attachid):
"""
Returns the URI for the given attachment ID.
"""
att_uri = self.url.replace('xmlrpc.cgi', 'attachment.cgi')
att_uri = att_uri + '?id=%s' % attachid
return att_uri |
python | def density(self):
"""Stellar density in CGS units
"""
r = self.radius * _Rsun
m = self.mass * _Msun
return 0.75 * m / (np.pi * r * r * r) |
java | public final void setConfiguration(final File newConfigFile) throws IOException {
setConfiguration(newConfigFile.toURI(), Files.readAllBytes(newConfigFile.toPath()));
} |
java | @Override
public List<T> findByNamedQuery(String queryName, Object... params) {
return getPersistenceProvider().findByNamedQuery(persistenceClass, queryName, params);
} |
java | public XObject execute(XPathContext xctxt) throws javax.xml.transform.TransformerException
{
if (!m_doneEval)
{
this.m_transformer.getMsgMgr().error
(xctxt.getSAXLocator(), XSLTErrorResources.ER_REFERENCING_ITSELF,
new Object[]{((ElemVariable)this.object()).getName().getLocalNa... |
python | def print_diff(self, ignore=[]):
"""Print the diff to the last time the state of objects was measured.
keyword arguments
ignore -- list of objects to ignore
"""
# ignore this and the caller frame
ignore.append(inspect.currentframe()) #PYCHOK change ignore
diff = ... |
python | def attach_attachment(self, analysis, attachment):
"""
Attach a file or a given set of files to an analysis
:param analysis: analysis where the files are to be attached
:param attachment: files to be attached. This can be either a
single file or a list of files
:return: ... |
java | public Future<AuthenticationResult> acquireToken(final String resource,
final AsymmetricKeyCredential credential,
final AuthenticationCallback callback)
throws AuthenticationException {
return this.acquireToken(resource, JwtHelper.buildJwt(credential,
thi... |
java | public ComputeNodeEnableSchedulingHeaders withLastModified(DateTime lastModified) {
if (lastModified == null) {
this.lastModified = null;
} else {
this.lastModified = new DateTimeRfc1123(lastModified);
}
return this;
} |
python | def _read_composites(self, compositor_nodes):
"""Read (generate) composites."""
keepables = set()
for item in compositor_nodes:
self._generate_composite(item, keepables)
return keepables |
java | String createKey(CmsRelation relation) {
return createKey(relation.getSourceId(), relation.getTargetId(), relation.getType().getName());
} |
java | public static List<String> getFindedAllSensitive(String text, boolean isDensityMatch, boolean isGreedMatch){
return sensitiveTree.matchAll(text, -1, isDensityMatch, isGreedMatch);
} |
java | public synchronized void start(StartContext context) throws StartException {
// FIXME: kakonyii
// if (org.apache.tomcat.util.Constants.ENABLE_MODELER) {
// Set the MBeanServer
final MBeanServer mbeanServer = this.mbeanServer.getOptionalValue();
if (mbeanServer != null) {
... |
java | public boolean evaluate(List<Object> objects, String sql) throws SQLException {
synchronized (this) {
String actualSql = sql == null ? this.sql : sql;
PreparedStatement actualStmnt = null;
try {
actualStmnt = sql == null ? this.stmnt : prepareStatement(sql);
this.objects = objects;
actualStmnt.e... |
python | def to_representation(self, instance):
"""
Object instance -> Dict of primitive datatypes.
"""
ret = OrderedDict()
readable_fields = [
field for field in self.fields.values()
if not field.write_only
]
for field in readable_fields:
... |
java | private DirectCompilerResult buildFunctionCall(ParserRuleContext ctx, DirectCompilerResult name, ParseTree params) {
DirectCompilerResult parameters = visit(params);
MethodCallExpr invokeCall = new MethodCallExpr(new NameExpr(CompiledFEELSupport.class.getSimpleName()), "invoke");
invokeCall.addA... |
java | public static XMLBuilder parse(String xmlString)
throws ParserConfigurationException, SAXException, IOException
{
return XMLBuilder.parse(xmlString, false, true);
} |
python | def getIncludedInBuilds(self):
"""Get all :class:`rtcclient.models.IncludedInBuild` objects that
have already included this workitem
WARNING: If one of the IncludedInBuilds is removed or cannot be
retrieved/found correctly, then 404 error will be raised.
:return: a :class:`list... |
java | @Override
public long dynamicQueryCount(DynamicQuery dynamicQuery,
Projection projection) {
return cpDisplayLayoutPersistence.countWithDynamicQuery(dynamicQuery,
projection);
} |
python | def _limit_value(value, upper=1.0, lower=0.0):
"""
Returs value (such as amplitude) to upper and lower value
>>> _limit_value(0.5)
0.5
>>> _limit_value(1.5)
1.0
>>> _limit_value(-1.5)
0.0
"""
if value > upper:
return(upper)
if value < lower:
return(lower)
... |
python | def listen(self):
"""
Listen for clients. This method causes the SimpleRPC object
to switch to server mode. One thread will be created for each
client.
"""
# Make sure we're in server mode
if self.mode and self.mode != 'server':
raise ValueError("%s... |
java | public synchronized void start(StartContext startContext) throws StartException {
if (sipContext == null) {
this.sipContext = anchorDu.getAttachment(SIPWebContext.ATTACHMENT_KEY);
}
} |
python | def sendMMS_Multi(self, CorpNum, Sender, Subject, Contents, Messages, FilePath, reserveDT, adsYN=False, UserID=None,
RequestNum=None):
""" 멀티 문자메시지 다량 전송
args
CorpNum : 팝빌회원 사업자번호
Sender : 발신자번호 (동보전송용)
Subject : 장문 메시지 제목 (... |
java | public TimeOfDay withFieldAdded(DurationFieldType fieldType, int amount) {
int index = indexOfSupported(fieldType);
if (amount == 0) {
return this;
}
int[] newValues = getValues();
newValues = getField(index).addWrapPartial(this, index, newValues, amount);
ret... |
java | protected void attemptFlush() throws SIRollbackException, SIConnectionLostException, SIResourceException, SIErrorException
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.entry(tc,"attemptFlush");
//The FlushComplete callback
FlushComplete callback = null;
//The old set... |
java | private List<ConfigAttribute> getConfigAttributeDefinition(Authorizable controlledObject)
{
// first check on global override
if (configAttributeDefinition != null)
return configAttributeDefinition;
if (controlledObject instanceof Secured)
{
Secured securedOb... |
java | public void startProcessInstanceByKeyForm() {
if (FacesContext.getCurrentInstance().isPostback()) {
// if this is an AJAX request ignore it, since we will receive multiple calls to this bean if it is added
// as preRenderView event
// see http://stackoverflow.com/questions/2830834/jsf-fevent-prere... |
java | public static String getUrlParam(String name, String val) {
return val == null ? "" : "&" + name + "=" + val;
} |
python | def setFlag(self, flag, state=True):
"""
Sets whether or not this flag should be on.
:param flag | <Column.Flags>
state | <bool>
"""
if state:
self.__flags |= flag
else:
self.__flags &= ~flag |
python | def yaml_loc_join(l, n):
'''
YAML loader to join paths
The keywords come directly from :func:`util.locations.get_locations`.
See there!
:returns:
A `path seperator` (``/``) joined string |yaml_loader_returns|
.. seealso:: |yaml_loader_seealso|
'''
from photon.util.locations i... |
java | public static String inputStreamToString(InputStream in) throws Exception {
BufferedReader br = new BufferedReader(new InputStreamReader(in));
StringBuffer buffer = new StringBuffer();
String line;
while ((line = br.readLine()) != null) {
buffer.append(line);
}
return buffer.toString();
} |
python | def show(self):
"""
The representation of an Varout object
:return: the full result matrix (for use with PyCharm viewer)
:rtype: np.array
"""
out = []
for item in self.vars:
out.append(list(item))
return np.array(out) |
python | def _numba_linalg_solve(a, b):
"""
Solve the linear equation ax = b directly calling a Numba internal
function. The data in `a` and `b` are interpreted in Fortran order,
and dtype of `a` and `b` must be the same, one of {float32, float64,
complex64, complex128}. `a` and `b` are modified in place, an... |
java | Map<Object, Object> createOrRestoreMap(FacesContext context, String prefix,
boolean create)
{
ExternalContext external = context.getExternalContext();
Map<String, Object> sessionMap = external.getSessionMap();
Map<Object, Object> map = (Map<Object, Object>) sessionMap.get(prefix);
... |
python | def step(self, t, w, dt):
""" Step forward the vector w by the given timestep.
Parameters
----------
dt : numeric
The timestep to move forward.
"""
# Runge-Kutta Fehlberg formulas (see: Numerical Recipes)
F = lambda t, w: self.F(t, w,... |
python | def _match_tag_regex(self, event_tag, search_tag):
'''
Check if the event_tag matches the search check.
Uses regular expression search to check.
Return True (matches) or False (no match)
'''
return self.cache_regex.get(search_tag).search(event_tag) is not None |
python | def add_metric(*args, **kwargs):
"""Add metric values. Values may be expressed with keyword arguments. For
metric names containing dashes, these may be expressed as one or more
'key=value' positional arguments. May only be called from the collect-metrics
hook."""
_args = ['add-metric']
_kvpairs ... |
java | public DescribeDirectConnectGatewayAssociationProposalsResult withDirectConnectGatewayAssociationProposals(
DirectConnectGatewayAssociationProposal... directConnectGatewayAssociationProposals) {
if (this.directConnectGatewayAssociationProposals == null) {
setDirectConnectGatewayAssociati... |
java | public TableMetadata getTableMetadata(String tableName){
if(tableName == null) return null;
try {
tableMetadataStatement.setInt(1, tableName.hashCode());
ResultSet set = tableMetadataStatement.executeQuery();
return transformToTableMetadata(set);
} catch (SQLException e) {
throw new BackendExce... |
java | public void reconstitute(BaseDestinationHandler destinationHandler) throws SIResourceException
{
if (tc.isEntryEnabled())
SibTr.entry(tc, "reconstitute", destinationHandler);
super.reconstitute(destinationHandler);
if (tc.isEntryEnabled())
{
SibTr.exit(tc, "reconstitute"); ... |
java | @Override
public void run() {
int numItemsToWorkOn = 0;
long lastPruneTime = 0;
long lastCheckTime = 0;
int listSize = 1;
int i = 0;
int sleepTime = AsyncProperties.timerSleepTime;
int batchLimitSize = AsyncProperties.timerBatchSize;
boolean sleepAlwa... |
java | public String[] getLabel(InstanceSet set) {
String[] pred= new String[set.size()];
for(int i=0;i<set.size();i++){
pred[i]= getStringLabel(set.getInstance(i));
}
return pred;
} |
python | def lazy_constant(fn):
"""Decorator to make a function that takes no arguments use the LazyConstant class."""
class NewLazyConstant(LazyConstant):
@functools.wraps(fn)
def __call__(self):
return self.get_value()
return NewLazyConstant(fn) |
java | protected final void updateState(int shardStateIndex, SequenceNumber lastSequenceNumber) {
synchronized (checkpointLock) {
subscribedShardsState.get(shardStateIndex).setLastProcessedSequenceNum(lastSequenceNumber);
// if a shard's state is updated to be SENTINEL_SHARD_ENDING_SEQUENCE_NUM by its consumer thread... |
python | def deg2fmt(ra_deg, dec_deg, format):
"""Format coordinates."""
rhr, rmn, rsec = degToHms(ra_deg)
dsgn, ddeg, dmn, dsec = degToDms(dec_deg)
if format == 'hms':
return rhr, rmn, rsec, dsgn, ddeg, dmn, dsec
elif format == 'str':
#ra_txt = '%02d:%02d:%06.3f' % (rhr, rmn, rsec)
... |
java | public static List<Point> getPath (
TraversalPred tpred, Object trav, int longest,
int ax, int ay, int bx, int by, boolean partial)
{
return getPath(tpred, new Stepper(), trav, longest, ax, ay, bx, by, partial);
} |
python | def join(self):
""" Waits until the state finished execution.
"""
if self.thread:
self.thread.join()
self.thread = None
else:
logger.debug("Cannot join {0}, as the state hasn't been started, yet or is already finished!".format(self)) |
java | @Override
public Chat getChat(ChatId chat_id) throws IOException {
AnalyticsData data = new AnalyticsData("getChat");
IOException ioException = null;
Chat chat = null;
data.setValue("chat_id", chat_id);
try {
chat = bot.getChat(chat_id);
data.setReturn... |
java | public int unmapClass(int clazz) {
Col c = _c[_c.length-1];
if (c._isByte)
return clazz;
else {
// OK, this is not fully correct bad handle corner-cases like for example dataset uses classes only
// with 0 and 3. Our API reports that there are 4 classes but in fact there are only 2 classes... |
python | def image(request, data):
"""
Generates identicon image based on passed data.
Arguments:
data - Data which should be used for generating an identicon. This data
will be used in order to create a digest which is used for generating the
identicon. If the data passed is a hex digest already... |
python | def _new_empty_handle():
"""Returns a new empty handle.
Empty handle can be used to hold a result.
Returns
-------
handle
A new empty `NDArray` handle.
"""
hdl = NDArrayHandle()
check_call(_LIB.MXNDArrayCreateNone(ctypes.byref(hdl)))
return hdl |
java | public ClasspathScanDescriptorProvider scanPackage(final String packageName, final boolean recursive,
final ClassLoader classLoader, final boolean strictClassLoader, final File[] jarFiles) {
_tasksPending.incrementAndGet();
final TaskListener listener = new TaskListener() {
@Over... |
python | def update(gandi, resource, memory, cores, console, password, background,
reboot):
"""Update a virtual machine.
Resource can be a Hostname or an ID
"""
pwd = None
if password:
pwd = click.prompt('password', hide_input=True,
confirmation_prompt=True)
... |
python | def fit(self, X, y):
"""Scikit-learn required: Computes the feature importance scores from the training data.
Parameters
----------
X: array-like {n_samples, n_features}
Training instances to compute the feature importance scores from
y: array-like {n_samples}
... |
java | public synchronized void close() throws IOException {
// reject modification of already closed node
if(isOpen==false) {
throw new IOException("Attempted to close already closed tag '" + name + "'!");
}
// close previously opened child node, if present
if(lastChildNode!=null) {
// close regular child nod... |
java | @Override
public FilterTranslator<Operand> createFilterTranslator(
final ObjectClass oclass,
final OperationOptions options) {
if (oclass == null || (!oclass.equals(ObjectClass.ACCOUNT))) {
throw new IllegalArgumentException("Invalid objectclass");
}
ret... |
java | protected static void classifyJoinExpressions(Collection<AbstractExpression> exprList,
Collection<String> outerTables, Collection<String> innerTables,
List<AbstractExpression> outerList, List<AbstractExpression> innerList,
List<AbstractExpression> innerOuterList, List<AbstractExpress... |
python | def save_arguments(module_name, elements):
""" Recursively save arguments name and default value. """
for elem, signature in elements.items():
if isinstance(signature, dict): # Submodule case
save_arguments(module_name + (elem,), signature)
else:
# use introspection to g... |
python | def append_text_to_shell(self, text, error, prompt):
"""
Append text to Python shell
In a way, this method overrides the method 'insert_text' when text is
inserted at the end of the text widget for a Python shell
Handles error messages and show blue underlined links
Hand... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.