language stringclasses 2
values | func_code_string stringlengths 63 466k |
|---|---|
java | public IfcWindowStyleConstructionEnum createIfcWindowStyleConstructionEnumFromString(EDataType eDataType,
String initialValue) {
IfcWindowStyleConstructionEnum result = IfcWindowStyleConstructionEnum.get(initialValue);
if (result == null)
throw new IllegalArgumentException(
"The value '" + initialVa... |
java | public String getNextStringParam(String strName)
{
String string = this.getProperty(strName);
if (NULL.equals(string))
string = null;
return string;
} |
python | def evaluate(self, x):
r"""Evaluate the kernels at given frequencies.
Parameters
----------
x : array_like
Graph frequencies at which to evaluate the filter.
Returns
-------
y : ndarray
Frequency response of the filters. Shape ``(g.Nf, le... |
java | public static void process(GrayU8 orig, GrayS16 derivX, GrayS16 derivY, @Nullable ImageBorder_S32 border ) {
InputSanityCheck.reshapeOneIn(orig, derivX, derivY);
if( BoofConcurrency.USE_CONCURRENT ) {
GradientPrewitt_Shared_MT.process(orig, derivX, derivY);
} else {
GradientPrewitt_Shared.process(orig, der... |
java | public final EntityType getEntityType(EntityTypeName name) {
GetEntityTypeRequest request =
GetEntityTypeRequest.newBuilder().setName(name == null ? null : name.toString()).build();
return getEntityType(request);
} |
python | def _parse_extra_features(node, NHX_string):
"""
Reads node's extra data form its NHX string. NHX uses this
format: [&&NHX:prop1=value1:prop2=value2]
"""
NHX_string = NHX_string.replace("[&&NHX:", "")
NHX_string = NHX_string.replace("]", "")
for field in NHX_string.split(":"):
try... |
java | public static MountPointInfo fromProto(alluxio.grpc.MountPointInfo mountPointPInfo) {
return new MountPointInfo().setUfsUri(mountPointPInfo.getUfsUri())
.setUfsType(mountPointPInfo.getUfsType())
.setUfsCapacityBytes(mountPointPInfo.getUfsCapacityBytes())
.setUfsUsedBytes(mountPointPInfo.getU... |
java | public boolean computeErrorLocations(int[] data,
Set<Integer> errorLocations) {
assert(data.length == paritySize + stripeSize && errorLocations != null);
errorLocations.clear();
int maxError = paritySize / 2;
int[][] syndromeMatrix = new int[maxError][];
for (int i = 0; i < syndromeMatrix.leng... |
java | private void openStream() throws IOException {
if (mIn != null) { // stream is already open
return;
}
GetObjectRequest getReq = new GetObjectRequest(mBucketName, mKey);
// If the position is 0, setting range is redundant and causes an error if the file is 0 length
if (mPos > 0) {
getReq.... |
java | public static ExtensibleConfigurationPersister createHostXmlConfigurationPersister(final ConfigurationFile file, final HostControllerEnvironment environment,
final ExecutorService executorService, final ExtensionRegistry hostExtensio... |
java | public void stop(int requestNumber)
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(this, tc, "stop", requestNumber);
// We need to lock this down with a semaphore here to ensure that the 'started' flag is
// correct by callers of isStarted() - see defect 347591
... |
python | def read_legacy_cfg_files(self, cfg_files, alignak_env_files=None):
# pylint: disable=too-many-nested-blocks,too-many-statements
# pylint: disable=too-many-branches, too-many-locals
"""Read and parse the Nagios legacy configuration files
and store their content into a StringIO object whi... |
java | public Content getResource(String key) {
Content c = newContent();
c.addContent(getText(key));
return c;
} |
java | private void waitForAttributePatternMatcher(String attributeName, String pattern, long timeout, boolean waitCondition) throws WidgetException {
long start = System.currentTimeMillis();
long end = start + timeout;
while (System.currentTimeMillis() < end) {
String attribute = getAttribute(attributeName);
if (... |
python | def get_labels(self, depth=None):
"""
Returns a list with a copy of the labels in this cell.
Parameters
----------
depth : integer or ``None``
If not ``None``, defines from how many reference levels to
retrieve labels from.
Returns
------... |
python | def source_channels(self):
""" Returns a set describing the source channels on which the gate is defined. """
source_channels = [v.coordinates.keys() for v in self.verts]
return set(itertools.chain(*source_channels)) |
python | def unproject(self, x, y, z=-1.0):
"""Receive x and y as screen coordinates and returns a point
in world coordinates.
This function comes in handy each time we have to convert a 2d
mouse click to a 3d point in our space.
**Parameters**
x: float in the interval ... |
java | void interpolateDeformedPoint(float v_x , float v_y , Point2D_F32 deformed ) {
// sample the closest point and x+1,y+1
int x0 = (int)v_x;
int y0 = (int)v_y;
int x1 = x0+1;
int y1 = y0+1;
// make sure the 4 sample points are in bounds
if( x1 >= gridCols )
x1 = gridCols-1;
if( y1 >= gridRows )
y1 ... |
java | @Override
public CompletableFuture<Void> completeCommittingTransactions(VersionedMetadata<CommittingTransactionsRecord> record) {
// create all transaction entries in committing txn list.
// remove all entries from active txn in epoch.
// reset CommittingTxnRecord
long time = Syste... |
java | private Transport createTransport(final String profile) {
if (getCaCapabilities(profile).isPostSupported()) {
return transportFactory.forMethod(Method.POST, url);
} else {
return transportFactory.forMethod(Method.GET, url);
}
} |
java | @Generated(value={"com.threerings.presents.tools.GenDObjectTask"})
public void setReleasingLock (NodeObject.Lock value)
{
NodeObject.Lock ovalue = this.releasingLock;
requestAttributeChange(
RELEASING_LOCK, value, ovalue);
this.releasingLock = value;
} |
java | public GitlabMergeRequest getMergeRequestByIid(Serializable projectId, Integer mergeRequestIid) throws IOException {
String tailUrl = GitlabProject.URL + "/" + sanitizeProjectId(projectId) + GitlabMergeRequest.URL + "/" + mergeRequestIid;
return retrieve().to(tailUrl, GitlabMergeRequest.class);
} |
python | def _parse_coc_segment(self, fptr):
"""Parse the COC marker segment.
Parameters
----------
fptr : file
Open file object.
Returns
-------
COCSegment
The current COC segment.
"""
kwargs = {}
offset = fptr.tell() - 2
... |
java | public void put(double[] key, E value) {
int index = keys.size();
keys.add(key);
data.add(value);
for (Hash h : hash) {
h.add(index, key, value);
}
} |
python | def clean_pages_from_space(confluence, space_key, limit=500):
"""
Remove all pages from trash for related space
:param limit:
:param confluence:
:param space_key:
:return:
"""
flag = True
while flag:
values = confluence.get_all_pages_from_space_trash(space=space_key, start=0,... |
java | public NumberExpression<Integer> indexOf(String str, int i) {
return indexOf(ConstantImpl.create(str), i);
} |
java | @UserFunction( "apoc.temporal.formatDuration" )
@Description( "apoc.temporal.formatDuration(input, format) | Format a Duration" )
public String formatDuration(
@Name("input") Object input,
@Name("format") String format
) {
try {
LocalDateTime midnight = LocalDateT... |
python | def dprint(s):
'''Prints `s` with additional debugging informations'''
import inspect
frameinfo = inspect.stack()[1]
callerframe = frameinfo.frame
d = callerframe.f_locals
if (isinstance(s,str)):
val = eval(s, d)
else:
val = s
cc = frameinfo.code_context[0]
... |
java | @Override
public boolean isSupported(Task task) {
return task.getType().equals(Task.Type.AUDIT);
} |
java | @GET
@Produces(MediaType.APPLICATION_JSON)
@Path("/{dashboardId}")
@Description("Returns a dashboard by its ID.")
public DashboardDto getDashboardByID(@Context HttpServletRequest req,
@PathParam("dashboardId") BigInteger dashboardId) {
if (dashboardId == null || dashboardId.compareTo(BigInteger.ZERO) < 1) {
... |
python | def connect(self, addr=None, userinfo=None):
"""Initiate a connection request to the device."""
if _debug: ProxyClientService._debug("connect addr=%r", addr)
# if the address was provided, use it
if addr:
self.address = addr
else:
addr = self.address
... |
java | protected static void dateFormat(String pattern, String... attributeNames) {
ModelDelegate.dateFormat(modelClass(), pattern, attributeNames);
} |
python | def _find_conflicts_within_selection_set(
context, # type: ValidationContext
cached_fields_and_fragment_names, # type: Dict[SelectionSet, Tuple[Dict[str, List[Tuple[Union[GraphQLInterfaceType, GraphQLObjectType, None], Field, GraphQLField]]], List[str]]]
compared_fragments, # type: PairSet
parent_typ... |
java | @Override
public char[] read(ScanBuffer buffer) {
int length = getLength(buffer);
if (length<0) return null;
return buffer.getChars(length);
} |
java | protected ExitStatus run(String... args) throws Exception {
if (args.length == 0) {
throw new NoArgumentsException();
}
String commandName = args[0];
String[] commandArguments = Arrays.copyOfRange(args, 1, args.length);
Command command = findCommand(commandName);
if (command == null) {
throw new NoSuc... |
python | def getError(self, device=DEFAULT_DEVICE_ID, message=True):
"""
Get the error message or value stored in the Qik 2s9v1 hardware.
:Keywords:
device : `int`
The device is the integer number of the hardware devices ID and
is only used with the Pololu Protocol. Def... |
java | public T multiply(T multiplier) {
if (multiplier == null) {
throw new IllegalArgumentException("invalid (null) multiplier");
}
BigDecimal product = this.value.multiply(multiplier.value);
return newInstance(product, this.value.scale());
} |
java | public static Map<Locale, QualityValue> getLocaleQualityValues(String header)
{
Map<String, QualityValue> stringResult = getStringQualityValues(header);
if (stringResult == null)
return null;
Map<Locale, QualityValue> result = new LinkedHashMap<Locale, QualityValue>(stringResult.size() * 2... |
python | def more_statements(self, more_url):
"""Query the LRS for more statements
:param more_url: URL from a StatementsResult object used to retrieve more statements
:type more_url: str | unicode
:return: LRS Response object with the returned StatementsResult object as content
:rtype: ... |
java | public void setSparseFeature(ConcatVector vector, String featureName, Map<String,Double> sparseFeatures) {
int[] indices = new int[sparseFeatures.size()];
double[] values = new double[sparseFeatures.size()];
int offset = 0;
for (String index : sparseFeatures.keySet()) {
indic... |
java | @Override
public void relocate()
{
int w = 310, h = 255;
int x = (this.getWidth() - w) / 2, y = (this.getHeight() - h) / 2;
taskLimitationsLabel.setLocation(x, y);
articleTaskLabel.setLocation(x, y + 30);
articleTaskLimitField.setLocation(x + 110, y + 30);
diffTaskLabel.setLocation(x, y + 60);
diffTas... |
java | public CmsLogFilter excludeType(CmsLogEntryType type) {
CmsLogFilter filter = (CmsLogFilter)clone();
filter.m_excludeTypes.add(type);
return filter;
} |
java | protected synchronized void fireAttributeAddedEvent(String name, AttributeValue attr) {
if (this.listenerList != null && isEventFirable()) {
final AttributeChangeListener[] list = new AttributeChangeListener[this.listenerList.size()];
this.listenerList.toArray(list);
final AttributeChangeEvent event = new At... |
python | def clear(self):
"""
clears all child changes and drops the reference to them
"""
super(SuperChange, self).clear()
for c in self.changes:
c.clear()
self.changes = tuple() |
python | def is_open(self,id,time,day):
"""
Checks if the venue is open at the time of day given a venue id.
args:
id: string of venue id
time: string of the format ex: "12:00:00"
day: string of weekday ex: "Monday"
returns:
... |
python | def parse_input_args(input_args):
""" Parses EOWorkflow input arguments provided by user and raises an error if something is wrong. This is
done automatically in the process of workflow execution
"""
input_args = input_args if input_args else {}
for task, args in input_args.... |
java | @SuppressWarnings("rawtypes")
public DefaultResilienceStrategyProviderConfiguration addResilienceStrategyFor(String alias, Class<? extends ResilienceStrategy> clazz, Object... arguments) {
getDefaults().put(alias, new DefaultResilienceStrategyConfiguration(clazz, arguments));
return this;
} |
python | def _precompile_substitution(self, kind, pattern):
"""Pre-compile the regexp for a substitution pattern.
This will speed up the substitutions that happen at the beginning of
the reply fetching process. With the default brain, this took the
time for _substitute down from 0.08s to 0.02s
... |
java | private void encodeScript(final FacesContext context, final Github github) throws IOException {
final WidgetBuilder wb = getWidgetBuilder(context);
final String clientId = github.getClientId(context);
wb.init("ExtGitHub", github.resolveWidgetVar(), clientId);
wb.attr("iconForks", github.... |
java | @Override
public boolean add(String i_newElement) {
for (int offset = 0; offset < this.size; offset++) {
//Note that this LOOKS like improper string comparison, but since we are using interned strings
//(i_strings) it's OK. The entire point of this data structure is that passed in st... |
python | def find_organization(session, name):
"""Find an organization.
Find an organization by its `name` using the given `session`.
When the organization does not exist the function will
return `None`.
:param session: database session
:param name: name of the organization to find
:returns: an or... |
java | public alluxio.grpc.PMode getMode() {
return mode_ == null ? alluxio.grpc.PMode.getDefaultInstance() : mode_;
} |
python | def urls(order_by: Optional[str] = None):
"""List all URLs registered with the app."""
url_rules: List[Rule] = current_app.url_map._rules
# sort the rules. by default they're sorted by priority,
# ie in the order they were registered with the app
if order_by == 'view':
url_rules = sorted(ur... |
java | public final Mono<String> asString(Charset charset) {
return handle((bb, sink) -> {
try {
sink.next(bb.readCharSequence(bb.readableBytes(), charset).toString());
}
catch (IllegalReferenceCountException e) {
sink.complete();
}
});
} |
java | public String evaluate(String select, Document document)
throws ConfigurationException, XpathException {
try {
StringWriter writer = new StringWriter();
StreamResult result = new StreamResult(writer);
performTransform(getValueTransformation(select), document, result);... |
python | def post(self, url, data):
"""Http post method wrapper, to support insert.
"""
try:
res = requests.post(
url, headers=self.headers, data=json.dumps(data))
return json.loads(res.text)
except Exception as e:
print(e)
return "e... |
python | async def get_target(config, url):
""" Given a URL, get the webmention endpoint """
previous = config.cache.get(
'target', url, schema_version=SCHEMA_VERSION) if config.cache else None
headers = previous.caching if previous else None
request = await utils.retry_get(config, url, headers=header... |
java | @BetaApi(
"The surface for long-running operations is not stable yet and may change in the future.")
public final OperationFuture<Document, KnowledgeOperationMetadata> createDocumentAsync(
KnowledgeBaseName parent, Document document) {
CreateDocumentRequest request =
CreateDocumentRequest.new... |
python | def blit_np_array(self, array):
"""Fill this surface using the contents of a numpy array."""
with sw("make_surface"):
raw_surface = pygame.surfarray.make_surface(array.transpose([1, 0, 2]))
with sw("draw"):
pygame.transform.scale(raw_surface, self.surf.get_size(), self.surf) |
java | @Nonnull
public <V1 extends T1, V2 extends T2> LBiObjDblConsumerBuilder<T1, T2> casesOf(Class<V1> argC1, Class<V2> argC2, Consumer<LBiObjDblConsumerBuilder<V1, V2>> pcpConsumer) {
PartialCase.The pc = partialCaseFactoryMethod((a1, a2, a3) -> (argC1 == null || argC1.isInstance(a1)) && (argC2 == null || argC2.isInstan... |
java | public Interceptor[] createServiceInterceptor(Class<?> serviceClass) {
Interceptor[] result = serviceClassInters.get(serviceClass);
if (result == null) {
result = createInterceptor(serviceClass.getAnnotation(Before.class));
serviceClassInters.put(serviceClass, result);
}
return result;
} |
java | @Override
public void removeByG_S_A(long groupId, boolean shippingAllowed,
boolean active) {
for (CommerceCountry commerceCountry : findByG_S_A(groupId,
shippingAllowed, active, QueryUtil.ALL_POS, QueryUtil.ALL_POS,
null)) {
remove(commerceCountry);
}
} |
python | def make_bound(self, for_instance):
"""
Create a new :ref:`bound field class <api-aioxmpp.forms-bound-fields>`
or return an existing one for the given form object.
:param for_instance: The form instance to which the bound field should
be bound.
If n... |
python | def comments_are_open(content_object):
"""
Return whether comments are still open for a given target object.
"""
moderator = get_model_moderator(content_object.__class__)
if moderator is None:
return True
# Check the 'enable_field', 'auto_close_field' and 'close_after',
# by reusing... |
java | public T createImage( int width , int height ) {
switch( family ) {
case GRAY:
return (T)GeneralizedImageOps.createSingleBand(getImageClass(),width,height);
case INTERLEAVED:
return (T)GeneralizedImageOps.createInterleaved(getImageClass(), width, height, numBands);
case PLANAR:
return (T)new Pl... |
java | public static List<AtomSite> convertChainToAtomSites(Chain c, int model, String chainName, String chainId) {
List<AtomSite> list = new ArrayList<>();
if (c.getEntityInfo()==null) {
logger.warn("No entity found for chain {}: entity_id will be set to 0, label_seq_id will be the same as auth_seq_id", c.getName())... |
python | def branches(remotes=False):
"""Return a list of all local branches in the repo
If remotes is true then also include remote branches
Note: the normal '*' indicator for current branch is removed
this method just gives a list of branch names
Use branch() method to determine the current branch
... |
java | @Override
public List<CommerceShippingFixedOption> findByCommerceShippingMethodId(
long commerceShippingMethodId) {
return findByCommerceShippingMethodId(commerceShippingMethodId,
QueryUtil.ALL_POS, QueryUtil.ALL_POS, null);
} |
java | public static <T, A1, A2, R1, R2, R> Collector<T, ?, R> pairing(Collector<? super T, A1, R1> c1,
Collector<? super T, A2, R2> c2, BiFunction<? super R1, ? super R2, ? extends R> finisher) {
EnumSet<Characteristics> c = EnumSet.noneOf(Characteristics.class);
c.addAll(c1.characteristics());... |
java | protected PrimaryTerm getTerm(Commit<? extends PrimaryElectorOperations.GetTerm> commit) {
PartitionId partitionId = commit.value().partitionId();
try {
return term(partitionId);
} catch (Exception e) {
getLogger().error("State machine operation failed", e);
throwIfUnchecked(e);
thro... |
python | def hydrate_time(nanoseconds, tz=None):
""" Hydrator for `Time` and `LocalTime` values.
:param nanoseconds:
:param tz:
:return: Time
"""
seconds, nanoseconds = map(int, divmod(nanoseconds, 1000000000))
minutes, seconds = map(int, divmod(seconds, 60))
hours, minutes = map(int, divmod(min... |
java | public RequestContext renderPretty() {
if (renderer instanceof JsonRenderer) {
final JsonRenderer r = (JsonRenderer) renderer;
r.setPretty(true);
}
return this;
} |
java | public SIDestinationAddress[] getDefaultForwardRoutingPath()
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
{
SibTr.entry(tc, "getDefaultForwardRoutingPath");
SibTr.exit(tc, "getDefaultForwardRoutingPath", null);
}
// No op for foreign destinations
// TODO: It is po... |
python | def ConsultarCodigoGradoReferencia(self, sep="||"):
"Consulta de Grados según Grano."
ret = self.client.codigoGradoReferenciaConsultar(
auth={
'token': self.Token, 'sign': self.Sign,
'cuit': self.Cuit, },
... |
java | public static Supplier<ColumnarFloats> getFloatSupplier(
int totalSize,
int sizePer,
ByteBuffer fromBuffer,
ByteOrder order,
CompressionStrategy strategy
)
{
if (strategy == CompressionStrategy.NONE) {
return new EntireLayoutColumnarFloatsSupplier(totalSize, fromBuffer, order... |
python | def _stop(self):
"""
Stops the instantiation queue (called by its bundle activator)
"""
# Unregisters the iPOPO service listener
self.__context.remove_service_listener(self)
try:
# Try to register to factory events
with use_ipopo(self.__context) a... |
python | def setConnection(self, connection):
"""
Assigns the backend connection for this database instance.
:param connection: <str> || <orb.Connection>
"""
# define custom properties
if not isinstance(connection, orb.Connection):
conn = orb.Connection.byName(connect... |
python | def get_scalar_mirrored_target_option(self, option_name, target):
"""Get the attribute `field_name` from `target` if set, else from this subsystem's options."""
mirrored_option_declaration = self._mirrored_option_declarations[option_name]
return mirrored_option_declaration.get_mirrored_scalar_option_value(t... |
python | def add_menu(self, name):
"""Add a menu with name `name` to the global menu bar.
Returns a menu widget.
"""
if self.menubar is None:
raise ValueError("No menu bar configured")
return self.menubar.add_name(name) |
java | @Nonnull
public static LLongToByteFunction longToByteFunctionFrom(Consumer<LLongToByteFunctionBuilder> buildingFunction) {
LLongToByteFunctionBuilder builder = new LLongToByteFunctionBuilder();
buildingFunction.accept(builder);
return builder.build();
} |
python | def create_censor_file(input_dset,out_prefix=None,fraction=0.1,clip_to=0.1,max_exclude=0.3,motion_file=None,motion_exclude=1.0):
'''create a binary censor file using 3dToutcount
:input_dset: the input dataset
:prefix: output 1D file (default: ``prefix(input_dset)`` + ``.1D``)
:fractio... |
python | def update_field_names(self, data, matching):
""" This method updates the names of the fields according to matching
:param data: original Pandas dataframe
:param matching: dictionary of matchings between old and new values
:type data: pandas.DataFrame
:type matching: dictionary
... |
java | public java.util.List<String> getAvailabilityZones() {
if (availabilityZones == null) {
availabilityZones = new com.amazonaws.internal.SdkInternalList<String>();
}
return availabilityZones;
} |
python | def tokenize(s):
"""
A simple tokneizer
"""
s = re.sub(r'(?a)(\w+)\'s', r'\1', s) # clean the 's from Crohn's disease
#s = re.sub(r'(?a)\b', ' ', s) # split the borders of chinese and english chars
split_pattern = r'[{} ]+'.format(re.escape(STOPCHARS))
tokens = [token for token in re.split(... |
java | public static Message buildRequest(ByteBuffer request) {
Request req = Request.newBuilder()
.setRequest(ByteString.copyFrom(request))
.build();
return Message.newBuilder().setType(MessageType.REQUEST)
.setRequest(req)
... |
python | def _summarize_simulations(self, mean_values, sim_vector, date_index, h, past_values):
""" Produces forecasted values to plot, along with prediction intervals
This is a utility function that constructs the prediction intervals and other quantities
used for plot_predict() in particular.
... |
python | def get_net_imbalance(count_per_broker):
"""Calculate and return net imbalance based on given count of
partitions or leaders per broker.
Net-imbalance in case of partitions implies total number of
extra partitions from optimal count over all brokers.
This is also implies, the minimum number of part... |
python | def update_course_settings(self, course_id, allow_student_discussion_editing=None, allow_student_discussion_topics=None, allow_student_forum_attachments=None, allow_student_organized_groups=None, hide_distribution_graphs=None, hide_final_grades=None, home_page_announcement_limit=None, lock_all_announcements=None, restr... |
python | def show(uuid):
'''
Display log details
uuid: string
uuid of fault
CLI Example:
.. code-block:: bash
salt '*' fmadm.show 11b4070f-4358-62fa-9e1e-998f485977e1
'''
ret = {}
fmdump = _check_fmdump()
cmd = '{cmd} -u {uuid} -V'.format(
cmd=fmdump,
uuid=... |
java | public static Object get(Object array, int index) {
return java.lang.reflect.Array.get(array, index);
} |
java | public static void multAddOuter( double alpha , DMatrix2x2 A , double beta , DMatrix2 u , DMatrix2 v , DMatrix2x2 C ) {
C.a11 = alpha*A.a11 + beta*u.a1*v.a1;
C.a12 = alpha*A.a12 + beta*u.a1*v.a2;
C.a21 = alpha*A.a21 + beta*u.a2*v.a1;
C.a22 = alpha*A.a22 + beta*u.a2*v.a2;
} |
python | def combine_results(self, results):
"""Combine results from different batches of filtering"""
result = {}
for key in results[0]:
result[key] = numpy.concatenate([r[key] for r in results])
return result |
java | protected void iterateResult(ResultSet resSet, QueryResultTO resultTO, StatementTO statementTO) {
try {
if (resSet != null && !resSet.isClosed()) {
ResultSetMetaData metaData = resSet.getMetaData();
int cols = metaData.getColumnCount();
Map<Integer, Integer> type = new HashMap<Integer... |
python | def __plain_bfs(adj, source):
"""modified NX fast BFS node generator"""
seen = set()
nextlevel = {source}
while nextlevel:
thislevel = nextlevel
nextlevel = set()
for v in thislevel:
if v not in seen:
yield v
... |
python | def use(self, algorithm):
"""Change the hash algorithm you gonna use.
"""
try:
self.hash_algo = self._mapper[algorithm.strip().lower()]
except IndexError: # pragma: no cover
template = "'%s' is not supported, try one of %s."
raise ValueError(template ... |
python | def convert_list(self, list_input):
"""
Iterate over the JSON list and process it
to generate either an HTML table or a HTML list, depending on what's inside.
If suppose some key has array of objects and all the keys are same,
instead of creating a new row for eac... |
java | private Object populateEntityFromDataFrame(EntityMetadata m, Map<String, Integer> columnIndexMap, Row row)
{
try
{
// create entity instance
Object entity = KunderaCoreUtils.createNewInstance(m.getEntityClazz());
// handle relations
Map<String, Object>... |
python | def copy(self, bucket=None, key=None):
"""Copy an object version to a given bucket + object key.
The copy operation is handled completely at the metadata level. The
actual data on disk is not copied. Instead, the two object versions
will point to the same physical file (via the same Fil... |
python | def CompleteTask(self, task):
"""Completes a task.
The task is complete and can be removed from the task manager.
Args:
task (Task): task.
Raises:
KeyError: if the task was not merging.
"""
with self._lock:
if task.identifier not in self._tasks_merging:
raise KeyErro... |
java | public synchronized Map.Entry<Short, Packet<T>> send(T data, ObjectOutput objectOutput) throws IOException {
Map.Entry<Short, Packet<T>> packetEntry = send(data);
Packet.<T>writeExternalStatic(packetEntry.getValue(), objectOutput);
return packetEntry;
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.