language stringclasses 2
values | func_code_string stringlengths 63 466k |
|---|---|
java | public void ffdcDumpDefault(Throwable th, IncidentStream is,
Object callerThis, Object[] o,
String sourceId)
{
// Currently, DiagnosticEngine will already dump:
// Exception Name
// Source ID
// Probe ID
... |
java | @SuppressWarnings("unchecked")
@Override
public T greaterEqual(final String col, final Object value) {
context().param(CaseFormat.CAMEL_CASE.convert(col), new GreaterEqual(col, value));
this.useOperator = true;
return (T) this;
} |
python | def cublasSsymv(handle, uplo, n, alpha, A, lda, x, incx, beta, y, incy):
"""
Matrix-vector product for real symmetric matrix.
"""
status = _libcublas.cublasSsymv_v2(handle,
_CUBLAS_FILL_MODE[uplo], n,
ctypes.byref(... |
python | def get_data(self, sheet, find=False, begin=1):
"""
Extract data from sheet
:param find: 查找模式.缺省为False.为True时,将进行递归查找
:param begin: 开始行号
"""
line = begin
for row in sheet.rows:
if self.match(row):
d = self.extract_data(sheet, line)
... |
python | def get_display_name(self, room=None):
"""Get this user's display name.
Args:
room (Room): Optional. When specified, return the display name of the user
in this room.
Returns:
The display name. Defaults to the user ID if not set.
"""
if r... |
java | public JPanel getPaneDisplay() {
if (paneDisplay == null) {
paneDisplay = new JPanel();
paneDisplay.setLayout(new CardLayout());
paneDisplay.setName("paneDisplay");
paneDisplay.add(getWorkbench(), getWorkbench().getName());
}
return paneDisplay;
} |
java | @SuppressWarnings("unchecked")
public static Type getSuperclassTypeParameter(Class<?> subclass) {
Type superclass = subclass.getGenericSuperclass();
if (superclass instanceof Class) {
throw new RuntimeException("Missing type parameter.");
}
return ((ParameterizedType) superclass).getActualTypeArguments()[0]... |
python | def _load_commands(root):
"""Returns {name: Command}"""
def proto_text(t):
if t.tag == 'name':
return '{name}'
elif t.tag == 'ptype':
return '{type}'
out = []
if t.text:
out.append(_escape_tpl_str(t.text))
for x in t:
out.ap... |
python | def loadRectilinearGrid(filename): # not tested
"""Load a ``vtkRectilinearGrid`` object from file and return a ``Actor(vtkActor)`` object."""
reader = vtk.vtkRectilinearGridReader()
reader.SetFileName(filename)
reader.Update()
gf = vtk.vtkRectilinearGridGeometryFilter()
gf.SetInputConnection(re... |
java | public synchronized void loadAll(){
group.clear();
count=0;
List<File> files = MyFiles.getAllFiles(fileName, ".txt");
if(files==null||files.size()==0){
System.err.println("模板为空");
}
try {
for(int i=0;i<files.size();i++){
read(files.get(i).toString());
//记录文件修改时间
lastModTime.put(files.... |
python | def path(self, which=None):
"""Extend ``nailgun.entity_mixins.Entity.path``.
The format of the returned path depends on the value of ``which``:
deploy
/deployments/<id>/deploy
``super`` is called otherwise.
"""
if which == 'deploy':
return '{0}... |
java | @Override
public void flush() throws IOException
{
if (deflater != null)
{
writeTrailer();
}
else
{
if (inflater != null)
{
if (inflater.finished() && !trailerRead)
{
Byte... |
java | public static void copyRecursive(Resource src, Resource trg) throws IOException {
copyRecursive(src, trg, null);
} |
java | public MethodDelegationBinder.Record compile(MethodDescription candidate) {
if (IgnoreForBinding.Verifier.check(candidate)) {
return MethodDelegationBinder.Record.Illegal.INSTANCE;
}
List<DelegationProcessor.Handler> handlers = new ArrayList<DelegationProcessor.Handler>(candidate.get... |
python | def column(self, colregex):
'Return first column whose Column.name matches colregex.'
for c in self.columns:
if re.search(colregex, c.name, regex_flags()):
return c |
java | private String getRequestLine(HttpConnection conn) {
return HttpMethodBase.generateRequestLine(conn, getName(),
getPath(), getQueryString(), this.effectiveVersion.toString());
} |
python | def del_resource(self, service_name, resource_name, base_class=None):
"""
Deletes a resource class for a given service.
Fails silently if no connection is found in the cache.
:param service_name: The service a given ``Resource`` talks to. Ex.
``sqs``, ``sns``, ``dynamodb``,... |
python | def reset(self,):
""" Reset the state of all cells.
This is normally used between sequences while training. All internal states
are reset to 0.
"""
self.activeState['t-1'].fill(0)
self.activeState['t'].fill(0)
self.predictedState['t-1'].fill(0)
self.predictedState['t'].fill(0)
self.... |
java | @Nonnull
public FineUploader5Validation addAllowedExtension (@Nonnull @Nonempty final String sAllowedExtension)
{
ValueEnforcer.notEmpty (sAllowedExtension, "AllowedExtension");
m_aValidationAllowedExtensions.add (sAllowedExtension);
return this;
} |
java | @Override
protected void prepareGUI(Container container)
{
sudokuView = new SudokuView();
container.add(createControls(), BorderLayout.NORTH);
container.add(sudokuView, BorderLayout.CENTER);
statusBar = new StatusBar();
container.add(statusBar, BorderLayout.SOUTH);
... |
java | public static StorageKey copy(StorageKey toCopy) {
return new StorageKey(toCopy.strategy, Lists.newArrayList(toCopy.values));
} |
python | def fromguess(cls, name, guess):
"""Create an :class:`Episode` or a :class:`Movie` with the given `name` based on the `guess`.
:param str name: name of the video.
:param dict guess: guessed data.
:raise: :class:`ValueError` if the `type` of the `guess` is invalid
"""
if... |
java | public final void setAnimation(Animation enter, Animation exit) {
setAnimation((enter != null) ? enter.getCssName() : Animation.NO_ANIMATION.getCssName(),
(exit != null) ? exit.getCssName() : Animation.NO_ANIMATION.getCssName());
} |
java | public void installationTemplate_POST(String baseTemplateName, OvhTemplateOsLanguageEnum defaultLanguage, String name) throws IOException {
String qPath = "/me/installationTemplate";
StringBuilder sb = path(qPath);
HashMap<String, Object>o = new HashMap<String, Object>();
addBody(o, "baseTemplateName", baseTemp... |
java | public String getNullElement() {
if (PTBConstituent_Type.featOkTst && ((PTBConstituent_Type)jcasType).casFeat_nullElement == null)
jcasType.jcas.throwFeatMissing("nullElement", "de.julielab.jules.types.PTBConstituent");
return jcasType.ll_cas.ll_getStringValue(addr, ((PTBConstituent_Type)jcasType).casFeat... |
python | def get_quant_NAs(quantdata, quantheader):
"""Takes quantdata in a dict and header with quantkeys
(eg iTRAQ isotopes). Returns dict of quant intensities
with missing keys set to NA."""
out = {}
for qkey in quantheader:
out[qkey] = quantdata.get(qkey, 'NA')
return out |
java | public boolean process(@Nullable String eTag, long lastModified) {
if (isNotModified) return true;
// See https://tools.ietf.org/html/rfc7232#section-6
if (validateIfUnmodifiedSince(lastModified)) {
if (!isNotModified) {
mResponse.setStatus(StatusCode.SC_LENGTH_REQUI... |
python | def movies_directed_by(self, director):
"""Return list of movies that were directed by certain person.
:param director: Director's name
:type director: str
:rtype: list[movies.models.Movie]
:return: List of movie instances.
"""
return [movie for movie in self._m... |
java | public static boolean hasRequestedPermission(@NotNull Context context, @NotNull final String permission) {
boolean hasRequestedPermission = false;
if (TextUtils.isEmpty(permission)) {
throw new IllegalArgumentException("Permission can't be null or empty.");
}
try {
... |
python | def treeboost(self, data: ['SASdata', str] = None,
assess: str = None,
code: str = None,
freq: str = None,
importance: str = None,
input: [str, list, dict] = None,
performance: str = None,
save:... |
python | def fetch_file(self, in_path, out_path):
''' fetch a file from remote to local '''
vvv("FETCH %s TO %s" % (in_path, out_path), host=self.host)
cmd = self._password_cmd()
if C.DEFAULT_SCP_IF_SSH:
cmd += ["scp"] + self.common_args
cmd += [self.host + ":" + in_path,... |
java | public static <E> Collection<E> checkedCollection(Collection<E> c,
Class<E> type) {
return new CheckedCollection<>(c, type);
} |
java | public static Serializer getSerializer(Class<?> type) {
Class<?> serializable = lookupSerializableType(type);
Serializer serializer = serializers.get(serializable);
if (serializer == null) {
serializer = getInstance().createSerializer(serializable);
serializers.put(serializable, serializer);
... |
python | def register_xml_mapping(self, clsdict):
"""
Add XML mappings to the enumeration class state for this member.
"""
member_to_xml = self._get_or_add_member_to_xml(clsdict)
member_to_xml[self.value] = self.xml_value
xml_to_member = self._get_or_add_xml_to_member(clsdict)
... |
java | public static double root(double eps, int maxIterations, double a, double b, Function1D f)
{
double x1 = a;
double x2 = b;
double fx1 = f.f(x1);
double fx2 = f.f(x2);
double halfEps = eps*0.5;
if(fx1* fx2 >= 0)
throw new ArithmeticException("The g... |
python | def dump_frame(frame, label=""):
"""Dump interesting information about this frame."""
locals = dict(frame.f_locals)
self = locals.get('self', None)
context = locals.get('context', None)
if "__builtins__" in locals:
del locals["__builtins__"]
if label:
label = " ( %s ) " % label
... |
python | def run(self):
"""
Start the proxy.
"""
server_address = (self.ip, self.hc_port)
hc_proxy = HTTPServer(server_address, HCProxyHandler)
logger.info('Starting HTTP-CoAP Proxy...')
hc_proxy.serve_forever() |
java | private WvWMatchDetail getWvWMatchInfoUsingWorld(int worldID) throws GuildWars2Exception {
try {
Response<WvWMatchDetail> response = gw2API.getWvWMatchInfoUsingWorld(Integer.toString(worldID)).execute();
if (!response.isSuccessful()) throwError(response.code(), response.errorBody());
return response.body();
... |
python | def prefixed_collapsible_map(m, prefix):
"""
Return a dict of params corresponding to those in m with the added prefix
"""
if m == values.unset:
return {}
def flatten_dict(d, result={}, prv_keys=[]):
for k, v in d.items():
if isinstance(v, dict):
flatten_... |
java | public void setCdnConfigurationStatus(com.google.api.ads.admanager.axis.v201808.CdnConfigurationStatus cdnConfigurationStatus) {
this.cdnConfigurationStatus = cdnConfigurationStatus;
} |
java | void loadAutogenExportTableSchema(Database db, Database previousDBIfAny,
DdlProceduresToLoad whichProcs, boolean isCurrentXDCR)
throws VoltCompilerException {
Reader reader = new VoltCompilerStringReader(null, generateDDLForDRConflictsTable(db, previousDBIfAny, isCurrentXDCR));
l... |
java | private static int applyMaskPenaltyRule1Internal(ByteMatrix matrix, boolean isHorizontal) {
int penalty = 0;
int iLimit = isHorizontal ? matrix.getHeight() : matrix.getWidth();
int jLimit = isHorizontal ? matrix.getWidth() : matrix.getHeight();
byte[][] array = matrix.getArray();
for (int i = 0; i <... |
python | def _extract_stack(limit=10):
"""Replacement for traceback.extract_stack() that only does the
necessary work for asyncio debug mode.
"""
frame = sys._getframe().f_back
try:
stack = traceback.StackSummary.extract(
traceback.walk_stack(frame), lookup_lines=False)
finally:
... |
python | def convert_unicode(text):
"""
converts unicode HTML to real Unicode
"""
if isPython2:
h = HTMLParser()
s = h.unescape(text)
else:
try:
s = unescape(text)
except Exception:
# Python 3.3 and below
# https://stackoverflow.com/a/2360639/2295672
s = HTMLParser().unescape(text)
return s |
java | @SuppressWarnings({"UnusedReturnValue", "WeakerAccess"})
public PagerFragment addFragment(String title, Fragment fragment) {
this.mFragmentTitles.add(title);
this.mFragments.add(fragment);
return this;
} |
java | public void onProfileClick() {
//crossfade if we are cross faded
if (mCrossFader != null) {
if (mCrossFader.isCrossfaded()) {
mCrossFader.crossfade();
}
}
//update the current profile
if (mAccountHeader != null) {
IProfile prof... |
java | public static String md5File(String filePath) {
File file = StringKit.isBlank(filePath) ? null : new File(filePath);
return md5File(file);
} |
python | def add_user(user, **kwargs):
"""
Add a user
"""
#check_perm(kwargs.get('user_id'), 'add_user')
u = User()
u.username = user.username
u.display_name = user.display_name
user_id = _get_user_id(u.username)
#If the user is already there, cannot add another with
#the same ... |
python | def get_authorisation_url(self, reset=False):
""" Initialises the OAuth2 Process by asking the auth server for a login URL.
Once called, the user can login by being redirected to the url returned by
this function.
If there is an error during authorisation, None is returned.""... |
java | public void printStartRecordGridData(PrintWriter out, int iPrintOptions)
{
if ((iPrintOptions & HtmlConstants.DETAIL_SCREEN) == HtmlConstants.DETAIL_SCREEN)
{
out.println("<tr>\n<td colspan=\"20\">");
}
out.println("<table border=\"1\">");
} |
python | def set_row_stretch(self, row=0, stretch=10):
"""
Sets the row stretch. Larger numbers mean it will expand more to fill
space.
"""
self._layout.setRowStretch(row, stretch)
return self |
python | def club(self,cid):
'''
Get info by real team using a ID
@return: name,[player list]
'''
headers = {"Content-type": "application/x-www-form-urlencoded","Accept": "text/plain",'Referer': 'http://'+self.domain+'/',"User-Agent": user_agent}
req = self.session.get('http://'+s... |
python | def help(ctx, topic, **kw):
"""Show help for any command.
"""
# The help command implementation is taken from
# https://www.burgundywall.com/post/having-click-help-subcommand
if topic is None:
click.echo(ctx.parent.get_help())
else:
click.echo(main.commands[topic].get_help(ctx)) |
python | def close(self):
"""
Close the HDFS handle (disconnect).
"""
self.__status.refcount -= 1
if self.refcount == 0:
self.fs.close()
for k, status in list(self._CACHE.items()): # yes, we want a copy
if status.refcount == 0:
... |
python | def _get_listeners(instance, change):
"""Gets listeners of changed Property on a HasProperties instance"""
if (
change['mode'] not in listeners_disabled._quarantine and #pylint: disable=protected-access
change['name'] in instance._listeners
):
return instance._liste... |
python | def _build_url(self, endpoint):
""" Build complete URL """
if not issubclass(type(self), ChatApiBase) and not self.subdomain:
raise ZenpyException("subdomain is required when accessing the Zendesk API!")
if self.subdomain:
endpoint.netloc = '{}.{}'.format(self.subdomain,... |
java | public Vector2f fma(Vector2fc a, Vector2fc b) {
return fma(a, b, thisOrNew());
} |
python | def _conv_which_data(which_data):
"""Convert which data to string or tuple
This function improves user convenience,
as `which_data` may be of several types
(str, ,str with spaces and commas, list, tuple) which
is internally handled by this method.
"""
if isinstan... |
java | public static double relativeOverlap(SpatialComparable box1, SpatialComparable box2) {
final int dim = assertSameDimensionality(box1, box2);
// the overlap volume
double overlap = 1.;
double vol1 = 1.;
double vol2 = 1.;
for(int i = 0; i < dim; i++) {
final double box1min = box1.getMin(i)... |
python | def filter_keys(d, keys, use_wildcards=False,
list_of_dicts=False, deepcopy=True):
""" filter dict by certain keys
Parameters
----------
d : dict
keys: list
use_wildcards : bool
if true, can use * (matches everything)
and ? (matches any single character)
list... |
python | def _to_dict(self):
"""Return a json dictionary representing this model."""
_dict = {}
if hasattr(self, 'text') and self.text is not None:
_dict['text'] = self.text
if hasattr(self, 'keywords') and self.keywords is not None:
_dict['keywords'] = [x._to_dict() for x... |
java | public void dispatchAsynchException(ProxyQueue proxyQueue, Exception exception)
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(tc, "dispatchAsynchException",
new Object[] { proxyQueue, exception });
// Create a runnable with the ... |
java | private static Properties _newInitedProp(String templateDir, String charset) {
final Properties properties = new Properties();
properties.setProperty(Velocity.FILE_RESOURCE_LOADER_PATH, templateDir);
properties.setProperty(Velocity.ENCODING_DEFAULT, charset);
properties.setProperty(Velocity.INPUT_ENCODING... |
java | @Override
public boolean next() throws JRException {
List<BandData> children = currentBand.getChildrenList();
if (children != null && !children.isEmpty() && !visitedBands.containsKey(currentBand)) {
currentIterator = children.iterator();
visitedBands.put(currentBand, current... |
python | def set_origin(self, offset):
"""Applies a constant offset to all objects."""
offset = np.array(offset)
for node in self.worldbody.findall("./*[@pos]"):
cur_pos = string_to_array(node.get("pos"))
new_pos = cur_pos + offset
node.set("pos", array_to_string(new_p... |
python | def inc_n(self, n, exception=None): # type: (int, Exception) -> bool
"""
Increments the parser by n characters
if the end of the input has not been reached.
"""
for _ in range(n):
if not self.inc(exception=exception):
return False
return True |
java | private void setNumeric(PreparedStatement stmt,
int varIndex,
String columnName,
String value) throws SQLException {
try {
stmt.setInt(varIndex, Integer.parseInt(value));
} catch (NumberFormatException e) {
... |
python | def _get_next_token(self, string):
"""
"eats" up the string until it hits an ending character to get valid leaf expressions.
For example, given \\Phi_{z}(L) = \\sum_{i=1}^{N} \\frac{1}{C_{i} \\times V_{\\rm max, i}},
this function would pull out \\Phi, stopping at _
@ string: str... |
python | def handle_modifier_up(self, modifier):
"""
Updates the state of the given modifier key to 'released'.
"""
_logger.debug("%s released", modifier)
# Caps and num lock are handled on key down only
if modifier not in (Key.CAPSLOCK, Key.NUMLOCK):
self.modifiers[mo... |
python | def cscore(args):
"""
%prog cscore blastfile > cscoreOut
See supplementary info for sea anemone genome paper, C-score formula:
cscore(A,B) = score(A,B) /
max(best score for A, best score for B)
A C-score of one is the same as reciprocal best hit (RBH).
Output file will be 3-... |
java | public void displayImage(String uri, ImageView imageView, ImageLoadingListener listener) {
displayImage(uri, new ImageViewAware(imageView), null, listener, null);
} |
java | protected boolean isValidQuery(String query) {
if (query == null) {
return true;
}
return QUERY_PATTERN.matcher(query).matches();
} |
java | @VisibleForTesting
Pair<List<WorkflowTask>, Map<String, Map<String, Object>>> getDynamicForkJoinTasksAndInput(WorkflowTask taskToSchedule, Workflow workflowInstance) throws TerminateWorkflowException {
String dynamicForkJoinTaskParam = taskToSchedule.getDynamicForkJoinTasksParam();
Map<String, Objec... |
python | def _ip_int_from_string(self, ip_str):
"""Turn the given IP string into an integer for comparison.
Args:
ip_str: A string, the IP ip_str.
Returns:
The IP ip_str as an integer.
Raises:
AddressValueError: if ip_str isn't a valid IPv4 Address.
... |
python | def _to_str(uniq):
"""
Serializes a MOC to the STRING format.
HEALPix cells are separated by a comma. The HEALPix cell at order 0 and number 10 is encoded
by the string: "0/10", the first digit representing the depth and the second the HEALPix cell number
for this depth. HEALPix... |
python | def fetch_friend_ids(self, user):
"""
fetches friend email's from g+
Return:
collection of friend emails (ids)
"""
friends = self.fetch_friends(user)
return [friend['ns1_email']['address']
for friend in friends
if 'ns1_email' ... |
java | static public String createString(Operation operation) throws SxmpErrorException, IOException {
StringWriter sw = new StringWriter(1000);
SxmpWriter.write(sw, operation);
return sw.toString();
} |
java | @Override
public CommercePriceEntry findByCPInstanceUuid_Last(String CPInstanceUuid,
OrderByComparator<CommercePriceEntry> orderByComparator)
throws NoSuchPriceEntryException {
CommercePriceEntry commercePriceEntry = fetchByCPInstanceUuid_Last(CPInstanceUuid,
orderByComparator);
if (commercePriceEntry != ... |
python | def mavflightview_mav(mlog, options=None, flightmode_selections=[]):
'''create a map for a log file'''
wp = mavwp.MAVWPLoader()
if options.mission is not None:
wp.load(options.mission)
fen = mavwp.MAVFenceLoader()
if options.fence is not None:
fen.load(options.fence)
all_false = ... |
java | public static void checkCompatible(DatasetDescriptor existing,
DatasetDescriptor test) {
checkNotChanged("format", existing.getFormat(), test.getFormat());
checkNotChanged("partitioning",
existing.isPartitioned(), test.isPartitioned());
if (existing.isPartition... |
python | def raise_io_error(self, errno, filename=None):
"""Raises IOError.
The error message is constructed from the given error code and shall
start with the error in the real system.
Args:
errno: A numeric error code from the C variable errno.
filename: The name of the... |
java | @Override
public void stop() {
super.stop();
try {
getContext().unregisterReceiver(mBroadcastReceiver);
} catch(IllegalArgumentException e) {
Log.d(TAG, "Unable to unregister receiver when stopping, probably not registered");
}
} |
java | public IssuerBundle updateCertificateIssuer(String vaultBaseUrl, String issuerName, String provider, IssuerCredentials credentials, OrganizationDetails organizationDetails, IssuerAttributes attributes) {
return updateCertificateIssuerWithServiceResponseAsync(vaultBaseUrl, issuerName, provider, credentials, orga... |
java | private void stopThreads(long closeDelay)
{
ReadingThread readingThread;
WritingThread writingThread;
synchronized (mThreadsLock)
{
readingThread = mReadingThread;
writingThread = mWritingThread;
mReadingThread = null;
mWritingThread ... |
java | public java.util.Map<String, java.util.Map<String, MethodSnapshot>> getApiSummary() {
return apiSummary;
} |
python | def _pot_update_emitter(target, source, env):
""" Emitter function for `POTUpdate` builder """
from SCons.Tool.GettextCommon import _POTargetFactory
import SCons.Util
import SCons.Node.FS
if 'XGETTEXTFROM' in env:
xfrom = env['XGETTEXTFROM']
else:
return target, source
if no... |
python | def cigar_array(self):
"""cache this one to speed things up a bit"""
if self._cigar: return self._cigar
self._cigar = [CIGARDatum(int(m[0]),m[1]) for m in re.findall('([0-9]+)([MIDNSHP=X]+)',self.entries.cigar)]
return self._cigar |
java | public final void deleteSessionEntityType(SessionEntityTypeName name) {
DeleteSessionEntityTypeRequest request =
DeleteSessionEntityTypeRequest.newBuilder()
.setName(name == null ? null : name.toString())
.build();
deleteSessionEntityType(request);
} |
python | def format_as_dataframe(explanation):
# type: (Explanation) -> Optional[pd.DataFrame]
""" Export an explanation to a single ``pandas.DataFrame``.
In case several dataframes could be exported by
:func:`eli5.formatters.as_dataframe.format_as_dataframes`,
a warning is raised. If no dataframe can be exp... |
python | def _one_body_mapping(a_i, a_j, threshold=0.000001):
"""
Subroutine for one body mapping.
Args:
a_i (Pauli): pauli at index i
a_j (Pauli): pauli at index j
threshold: (float): threshold to remove a pauli
Returns:
Operator: Operator for thos... |
python | def read_chunks(file, size=io.DEFAULT_BUFFER_SIZE):
"""Yield pieces of data from a file-like object until EOF."""
while True:
chunk = file.read(size)
if not chunk:
break
yield chunk |
java | protected String createExceptionMessage(Throwable exception, Request request, Response response)
{
StringBuilder sb = new StringBuilder(request.getEffectiveHttpMethod().toString());
sb.append(' ');
sb.append(request.getUrl());
sb.append(" threw exception: ");
sb.append(exception.getClass().getSimpleName()... |
python | def set_flow_node_ref_list(self, value):
"""
Setter for 'flow_node_ref' field.
:param value - a new value of 'flow_node_ref' field. Must be a list of String objects (ID of referenced nodes).
"""
if value is None or not isinstance(value, list):
raise TypeError("FlowNod... |
python | def walk(self, root="~/"):
"""Emulation of os.walk behavior against Device Cloud filedata store
This method will yield tuples in the form ``(dirpath, FileDataDirectory's, FileData's)``
recursively in pre-order (depth first from top down).
:param str root: The root path from which the s... |
java | public String getToViewId(FacesContext context) {
if (toViewIdExpr == null) {
ExpressionFactory factory =
context.getApplication().getExpressionFactory();
toViewIdExpr = factory.createValueExpression(context.getELContext(),
... |
java | public void setBytes(final int parameterIndex, final byte[] x) throws SQLException {
if(x == null) {
setNull(parameterIndex, Types.BLOB);
return;
}
setParameter(parameterIndex, new ByteParameter(x));
} |
python | def get_club_members(self, club_id, limit=None):
"""
Gets the member objects for specified club ID.
http://strava.github.io/api/v3/clubs/#get-members
:param club_id: The numeric ID for the club.
:type club_id: int
:param limit: Maximum number of athletes to return. (de... |
python | def connection_lost(self, exc):
"""Log when connection is closed, if needed call callback."""
if exc:
self.logger.error('disconnected due to error')
else:
self.logger.info('disconnected because of close/abort.')
if self.disconnect_callback:
asyncio.ens... |
python | def unescape_unicode(string):
"""Python2.7's re module chokes when compiling patterns that have ranges
between escaped unicode codepoints if the two codepoints are unrecognised
in the unicode database. For instance:
re.compile('[\\uAA77-\\uAA79]').findall("hello")
Ends up matching every charac... |
java | public boolean containsDTOFor(JavaClass<?> entity, boolean root)
{
if (dtos.get(entity) == null)
{
return false;
}
return (root ? (dtos.get(entity).rootDTO != null) : (dtos.get(entity).nestedDTO != null));
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.