language stringclasses 2
values | func_code_string stringlengths 63 466k |
|---|---|
java | int readResults(byte[] b, int bPos, int bAvail) {
if (buffer != null) {
int len = Math.min(avail(), bAvail);
if (buffer != b) {
System.arraycopy(buffer, readPos, b, bPos, len);
readPos += len;
if (readPos >= pos) {
buffe... |
java | public static INDArray pLeftInvert(INDArray arr, boolean inPlace) {
try {
final INDArray inv = invert(arr.transpose().mmul(arr), inPlace).mmul(arr.transpose());
if (inPlace) arr.assign(inv);
return inv;
} catch (SingularMatrixException e) {
throw new IllegalArgume... |
python | def OnReaderComboBox(self, event):
"""Called when the user activates a reader in the toolbar combo box."""
cb = event.GetEventObject()
reader = cb.GetClientData(cb.GetSelection())
if isinstance(reader, smartcard.reader.Reader.Reader):
self.treeuserpanel.dialogpanel.OnActivate... |
java | public static LoggerContext getContext(final boolean currentContext) {
// TODO: would it be a terrible idea to try and find the caller ClassLoader here?
try {
return factory.getContext(FQCN, null, null, currentContext, null, null);
} catch (final IllegalStateException ex) {
... |
java | private Content linkToUndocumentedDeclaredExceptions(
Type[] declaredExceptionTypes, Set<String> alreadyDocumented,
TagletWriter writer) {
Content result = writer.getOutputInstance();
//Add links to the exceptions declared but not documented.
for (int i = 0; i < declaredE... |
java | public ModelNode findNodeInList(Address addr, String haystack, String needle) throws Exception {
final ModelNode queryNode = createRequest(READ_RESOURCE, addr);
final ModelNode results = execute(queryNode);
if (isSuccess(results)) {
final ModelNode haystackNode = getResults(results).... |
python | def fields(self) -> GraphQLFieldMap:
"""Get provided fields, wrapping them as GraphQLFields if needed."""
try:
fields = resolve_thunk(self._fields)
except GraphQLError:
raise
except Exception as error:
raise TypeError(f"{self.name} fields cannot be res... |
python | def info(self):
"""get information about the terms in the term list
Parameters
----------
Returns
-------
dict containing information to duplicate the term list
"""
info = {'term_type': 'term_list', 'verbose': self.verbose}
info.update({'terms':[... |
java | public static int cusolverSpXcsrsymmdqHost(
cusolverSpHandle handle,
int n,
int nnzA,
cusparseMatDescr descrA,
Pointer csrRowPtrA,
Pointer csrColIndA,
Pointer p)
{
return checkResult(cusolverSpXcsrsymmdqHostNative(handle, n, nnzA, descrA... |
python | def _validate_data_dep_params(self, X):
"""method to validate and prepare data-dependent parameters
Parameters
---------
X : array-like
containing the input dataset
Returns
-------
None
"""
n_samples, m_features = X.shape
# t... |
python | def setup(self, proxystr='', prompting=True):
"""
Sets the proxy handler given the option passed on the command
line. If an empty string is passed it looks at the HTTP_PROXY
environment variable.
"""
self.prompting = prompting
proxy = self.get_proxy(proxystr)
... |
java | public static <T> boolean isSubList(List<T> l1, List<? super T> l) {
Iterator<? super T> it = l.iterator();
Iterator<T> it1 = l1.iterator();
while (it1.hasNext()) {
Object o1 = it1.next();
if (!it.hasNext())
return false;
Object o = it.next();
while ((o == null && !(o... |
python | def do_map(input_dict, feature_format, positive_class=None):
'''
Maps a new example to a set of features.
'''
# Context of the unseen example(s)
train_context = input_dict['train_ctx']
test_context = input_dict['test_ctx']
# Currently known examples & background knowledge
features = inp... |
java | void saveFrame(ByteBuf frame) {
if (upstreamFrameRefCnt == 0) {
upstreamFrameRefCnt = frame.refCnt();
}
int frameSize = frame.readableBytes();
long availableSize = cacheLimit - cacheSize;
while (availableSize < frameSize) {
ByteBuf cachedFrame = cachedFrames.poll();
if (cachedFram... |
python | def vprjp(vin, plane):
"""
Project a vector onto a specified plane, orthogonally.
http://naif.jpl.nasa.gov/pub/naif/toolkit_docs/C/cspice/vprjp_c.html
:param vin: The projected vector.
:type vin: 3-Element Array of floats
:param plane: Plane containing vin.
:type plane: spiceypy.utils.su... |
java | public boolean remove( C consumer ) {
if (consumer != null) {
// Iterate through the map to find the runner that owns this consumer ...
ConsumerRunner match = null;
for (ConsumerRunner runner : consumers) {
if (runner.getConsumer().equals(consumer)) {
... |
python | def find_saas_perform_space_price(package, size):
"""Find the SaaS performance storage space price for the given size
:param package: The Storage As A Service product package
:param size: The volume size for which a price is desired
:return: Returns the price for the size and tier, or an error if not f... |
java | @Override
public void eSet(int featureID, Object newValue) {
switch (featureID) {
case BpsimPackage.FLOATING_PARAMETER_TYPE__CURRENCY_UNIT:
setCurrencyUnit((String)newValue);
return;
case BpsimPackage.FLOATING_PARAMETER_TYPE__TIME_UNIT:
setTimeUnit((TimeUnit)newValue);
return;
case BpsimPack... |
python | def _multiseries(self, col, x, y, ctype, rsum, rmean):
"""
Chart multiple series from a column distinct values
"""
self.autoprint = False
x, y = self._check_fields(x, y)
chart = None
series = self.split_(col)
for key in series:
instance = series[key]
if rsum is not None:
instance.rsum(rsum, in... |
python | def get_symbols(self, site='Pro', _async=False):
"""
获取 支持的交易对
:param site:
:return:
"""
assert site in ['Pro', 'HADAX']
params = {}
path = f'/v1{"/" if site == "Pro" else "/hadax/"}common/symbols'
return api_key_get(params, path, _async=_async) |
python | def add_postfix(file_path, postfix):
# type: (AnyStr, AnyStr) -> AnyStr
"""Add postfix for a full file path.
Examples:
>>> FileClass.add_postfix('/home/zhulj/dem.tif', 'filled')
'/home/zhulj/dem_filled.tif'
>>> FileClass.add_postfix('dem.tif', 'filled')
... |
java | private static Direction direction(Point2d centerXy, Point2d substituentXy, Point2d horizontalXy, boolean haworth) {
double deltaX = substituentXy.x - centerXy.x;
double deltaY = substituentXy.y - centerXy.y;
// normalise vector length so threshold is independent of length
double mag =... |
java | public static Map<String, Object> createProxyClientConfig(String proxyUri, String username, String password) {
Map<String, Object> clientConfig = new HashMap<>();
clientConfig.put(ClientProperties.PROXY_URI, proxyUri);
if (username != null && username.trim().length() > 0) {
c... |
python | def npm_install(package, flags=None):
"""Install a package from NPM."""
command = u'install %s %s' % (package, flags or u'')
npm_command(command.strip()) |
python | def get_variation(self, experiment, user_id, attributes, ignore_user_profile=False):
""" Top-level function to help determine variation user should be put in.
First, check if experiment is running.
Second, check if user is forced in a variation.
Third, check if there is a stored decision for the user a... |
python | def items(self, section=_UNSET, raw=False, vars=None):
"""Return a list of (name, value) tuples for each option in a section.
All % interpolations are expanded in the return values, based on the
defaults passed into the constructor, unless the optional argument
`raw' is true. Additiona... |
python | def calculate_size(name, data_list):
""" Calculates the request payload size"""
data_size = 0
data_size += calculate_size_str(name)
data_size += INT_SIZE_IN_BYTES
for data_list_item in data_list:
data_size += calculate_size_data(data_list_item)
return data_size |
java | public static boolean isValidName( String name ) {
if (name == null || name.length() == 0) return false;
CharacterIterator iter = new StringCharacterIterator(name);
char c = iter.first();
if (!isValidNameStart(c)) return false;
while (c != CharacterIterator.DONE) {
if... |
python | def unzip(filepath, output_path):
"""
Unzip an archive file
"""
filename = os.path.split(filepath)[1]
(name, extension) = os.path.splitext(filename)
extension = extension[1:].lower()
extension2 = os.path.splitext(name)[1][1:].lower()
if extension not in ZIP_EXTENSIONS:
raise Exc... |
java | public Observable<NamespaceResourceInner> getByResourceGroupAsync(String resourceGroupName, String namespaceName) {
return getByResourceGroupWithServiceResponseAsync(resourceGroupName, namespaceName).map(new Func1<ServiceResponse<NamespaceResourceInner>, NamespaceResourceInner>() {
@Override
... |
java | public static ArrayList<Method> getNonPublicMethods(final Class<?> ejbClass,
final Method[] publicMethods)
{
return AccessController.doPrivileged(new PrivilegedAction<ArrayList<Method>>() {
@Override
public ArrayList<Method> ru... |
java | public WellRestedRequestBuilder addGlobalHeader(String name, String value) {
if (this.globalHeaders == null) {
this.globalHeaders = new ArrayList<>();
}
this.globalHeaders.add(new BasicHeader(name, value));
return this;
} |
java | public ConnectionSharedKeyInner beginSetSharedKey(String resourceGroupName, String virtualNetworkGatewayConnectionName, String value) {
return beginSetSharedKeyWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayConnectionName, value).toBlocking().single().body();
} |
python | def integer_ceil(a, b):
'''Return the ceil integer of a div b.'''
quanta, mod = divmod(a, b)
if mod:
quanta += 1
return quanta |
java | @Override
public DescribeNotificationConfigurationsResult describeNotificationConfigurations(DescribeNotificationConfigurationsRequest request) {
request = beforeClientExecution(request);
return executeDescribeNotificationConfigurations(request);
} |
java | public MachineTime<U> dividedBy(
long divisor,
RoundingMode roundingMode
) {
if (divisor == 1) {
return this;
}
BigDecimal value =
this.toBigDecimal().setScale(9, RoundingMode.FLOOR).divide(new BigDecimal(divisor), roundingMode);
MachineTime<... |
python | def _add_seg_to_output(out, data, enumerate_chroms=False):
"""Export outputs to 'seg' format compatible with IGV and GenePattern.
"""
out_file = "%s.seg" % os.path.splitext(out["cns"])[0]
if not utils.file_exists(out_file):
with file_transaction(data, out_file) as tx_out_file:
cmd = ... |
java | public static CPMeasurementUnit fetchByUuid_First(String uuid,
OrderByComparator<CPMeasurementUnit> orderByComparator) {
return getPersistence().fetchByUuid_First(uuid, orderByComparator);
} |
python | def update_mapping(self, mapping: Dict[ops.Qid, LogicalIndex],
keys: Sequence[ops.Qid]
) -> None:
"""Updates a mapping (in place) from qubits to logical indices.
Args:
mapping: The mapping to update.
keys: The qubits acted on by the ... |
java | public CreateVpcResponse createVpc(String name, String cidr) {
CreateVpcRequest request = new CreateVpcRequest();
request.withName(name).withCidr(cidr);
return createVpc(request);
} |
java | private LNGIntVector generateClauseVector(final Collection<Literal> literals) {
final LNGIntVector clauseVec = new LNGIntVector(literals.size());
for (final Literal lit : literals) {
int index = this.solver.idxForName(lit.name());
if (index == -1) {
index = this.solver.newVar(!this.initialPh... |
java | public void setAddTags(java.util.Collection<Tag> addTags) {
if (addTags == null) {
this.addTags = null;
return;
}
this.addTags = new com.amazonaws.internal.SdkInternalList<Tag>(addTags);
} |
java | public static boolean isConnectionReset(Throwable err) {
return err instanceof AbortedException ||
(err instanceof IOException && (err.getMessage() == null ||
err.getMessage()
.contains("Broken pipe") ||
... |
java | public static final ApiRequestPathInfo parseApiRequestPath(String apiVersionHeader, String acceptHeader, String pathInfo) {
ApiRequestPathInfo info = new ApiRequestPathInfo();
boolean versionFound = false;
if (apiVersionHeader != null && apiVersionHeader.trim().length() > 0) {
info... |
java | @Override
public String getSchemaName() {
return template
.execute(solrClient -> new SchemaRequest.SchemaName().process(solrClient, collection).getSchemaName());
} |
python | def ads_use_dev_spaces(cluster_name, resource_group_name, update=False, space_name=None, do_not_prompt=False):
"""
Use Azure Dev Spaces with a managed Kubernetes cluster.
:param cluster_name: Name of the managed cluster.
:type cluster_name: String
:param resource_group_name: Name of resource group.... |
python | def _challenge_response(self, challenge, mode, slot, variable, may_block):
""" Do challenge-response with a YubiKey > 2.0. """
# Check length and pad challenge if appropriate
if mode == 'HMAC':
if len(challenge) > yubikey_defs.SHA1_MAX_BLOCK_SIZE:
raise yubico_except... |
java | @SuppressWarnings("fallthrough")
public String read_atom() throws OtpErlangDecodeException {
int tag;
int len = -1;
byte[] strbuf;
String atom;
tag = read1skip_version();
switch (tag) {
case OtpExternal.atomTag:
len = read2BE();
strb... |
java | protected FieldMetadata processPrimitiveType( FieldDeclaration fieldDeclaration ) {
PrimitiveType primitiveType = (PrimitiveType)fieldDeclaration.getType();
FieldMetadata primitiveFieldMetadata = FieldMetadata.primitiveType(primitiveType.getPrimitiveTypeCode().toString());
primitiveFieldMetadata... |
python | def bitlist_to_int(bitlist: Sequence[int]) -> int:
"""Converts a sequence of bits to an integer.
>>> from quantumflow.utils import bitlist_to_int
>>> bitlist_to_int([1, 0, 0])
4
"""
return int(''.join([str(d) for d in bitlist]), 2) |
java | private void pinDayOfMonth() {
int year = internalGet(YEAR);
int monthLen;
if (year > gregorianCutoverYear || year < gregorianCutoverYearJulian) {
monthLen = monthLength(internalGet(MONTH));
} else {
GregorianCalendar gc = getNormalizedCalendar();
mont... |
java | public static void copyPath(FileSystem srcFs, Path src, FileSystem dstFs, Path dst, boolean overwrite,
Configuration conf) throws IOException {
copyPath(srcFs, src, dstFs, dst, false, overwrite, conf);
} |
python | def _interpret_as_minutes(sval, mdict):
"""
Times like "1:22" are ambiguous; do they represent minutes and seconds
or hours and minutes? By default, timeparse assumes the latter. Call
this function after parsing out a dictionary to change that assumption.
>>> import pprint
>>> pprint.ppri... |
python | def build_disagg_matrix(bdata, bin_edges, sid, mon=Monitor):
"""
:param bdata: a dictionary of probabilities of no exceedence
:param bin_edges: bin edges
:param sid: site index
:param mon: a Monitor instance
:returns: a dictionary key -> matrix|pmf for each key in bdata
"""
with mon('bui... |
java | @NonNull
public Transition setPathMotion(@Nullable PathMotion pathMotion) {
if (pathMotion == null) {
mPathMotion = PathMotion.STRAIGHT_PATH_MOTION;
} else {
mPathMotion = pathMotion;
}
return this;
} |
java | @Given("^json (.+?) matches schema (.+?)$")
public void jsonMatchesSchema(String json, String schema) throws Exception {
JSONObject jsonschema = new JSONObject(schema);
JSONObject jsondeploy = new JSONObject(json);
commonspec.matchJsonToSchema(jsonschema, jsondeploy);
} |
java | protected double splitThresholdSq( Point2D_I32 a , Point2D_I32 b ) {
return Math.max(2,a.distance2(b)* toleranceFractionSq);
} |
java | public static void read(FSDataInputStream file, long fileOffset, byte[] array, int arrayOffset,
int length) throws IOException {
file.seek(fileOffset);
file.readFully(array, arrayOffset, length);
} |
python | def empty( self, node ):
"""Calculate empty space as a fraction of total space"""
overall = self.overall( node )
if overall:
return (overall - self.children_sum( self.children(node), node))/float(overall)
return 0 |
java | public void postConstruct() throws URISyntaxException {
WmsVersion.lookup(this.version);
Assert.isTrue(validateBaseUrl(), "invalid baseURL");
Assert.isTrue(this.layers.length > 0, "There must be at least one layer defined for a WMS request" +
" to make sense");
// OpenL... |
java | @Override
public boolean simpleEvaluation(Agent agent) {
Node device = agent.getAgentsAppState().getDevicesAppState().getDevice(deviceId);
if (device != null) {
PHATDoorSensor psControl = device.getControl(PHATDoorSensor.class);
if (psControl != null) {
DoorDa... |
python | def character_offset_end(self):
"""
Lazy-loads character offset end node
:getter: Returns the integer value of the ending offset
:type: int
"""
if self._character_offset_end is None:
offsets = self._element.xpath('CharacterOffsetEnd/text()')
if l... |
python | def in_lamp_reach(p):
''' Check if the provided XYPoint can be recreated by a Hue lamp. '''
v1 = XYPoint(Lime.x - Red.x, Lime.y - Red.y)
v2 = XYPoint(Blue.x - Red.x, Blue.y - Red.y)
q = XYPoint(p.x - Red.x, p.y - Red.y)
s = cross_product(q, v2) / cross_product(v1, v2)
t = cross_product(v1, q) /... |
java | public void addTexture(String name, BufferedImage image) throws TextureTooBigException {
final RegionData data = findUsableRegion(image.getWidth(), image.getHeight());
if (data == null) {
throw new TextureTooBigException();
}
this.regions.put(name, data);
final int[] ... |
java | protected byte[] getSpecial( final int tag, final int count) {
final ByteBuffer buffer = ByteBuffer.allocate( 16);
buffer.putInt( tag);
buffer.putInt( 0x00000007);
buffer.putInt( count * -16);
buffer.putInt( 0x00000010);
return buffer.array();
} |
java | public Integer getNewTableIndex(final String _tableName,
final String _column,
final Integer _relIndex,
final Long _clazzId)
{
this.tableIndex++;
this.sqlTable2Index.put(_relIndex + "__" + _ta... |
java | public static Date setMinutes(@NotNull final Date date, int amount) {
return DateUtils.setMinutes(date, amount);
} |
python | def integrate(self, mass_min, mass_max, log_mode=True, weight=False, steps=1e4):
""" Numerical Riemannn integral of the IMF (stupid simple).
Parameters:
-----------
mass_min: minimum mass bound for integration (solar masses)
mass_max: maximum mass bound for integration (solar ma... |
python | def get_container_at(self, slot):
"""Returns the container object assigned to the slot passed in
:param slot: the slot where the analyses are located
:type slot: int
:return: the container (analysis request, reference sample, etc.)
"""
# ensure we have an integer
... |
python | def get(self, item, default=0, normalized=False):
'''
When we have the stream of data pushed in the chunk
we can retrive count of an item using this method.
>>> stream_counter_obj = StreamCounter(5,5)
>>> data_stream = ['a','b','c']
>>> for item in data_stream:
..... |
python | def xstep(self):
r"""Minimise Augmented Lagrangian with respect to
:math:`\mathbf{x}`.
"""
self.X, self.ss = sp.prox_nuclear(self.S - self.Y - self.U,
1/self.rho) |
java | private void printDestinationPermissions(Map<String, ?> destinationPermissions) {
Set<String> destinations = destinationPermissions.keySet();
for (String destination : destinations) {
SibTr.debug(tc, CLASS_NAME + " Destination: " + destination);
Permission permission = (Permissio... |
python | def create_object(object_type, data, **api_opts):
'''
Create raw infoblox object. This is a low level api call.
CLI Example:
.. code-block:: bash
salt-call infoblox.update_object object_type=record:host data={}
'''
if '__opts__' in globals() and __opts__['test']:
return {'Tes... |
python | def distanceToMesh(self, actor, signed=False, negate=False):
'''
Computes the (signed) distance from one mesh to another.
.. hint:: |distance2mesh| |distance2mesh.py|_
'''
poly1 = self.polydata()
poly2 = actor.polydata()
df = vtk.vtkDistancePolyDataFilter... |
python | def arange(start, stop=None, step=1.0, repeat=1, infer_range=False, name=None, dtype=None):
"""Returns evenly spaced values within a given interval.
Values are generated within the half-open interval [`start`, `stop`). In other
words, the interval includes `start` but excludes `stop`. The function is
s... |
java | @Override
public CommercePriceListAccountRel fetchByC_C(long commerceAccountId,
long commercePriceListId, boolean retrieveFromCache) {
Object[] finderArgs = new Object[] {
commerceAccountId, commercePriceListId
};
Object result = null;
if (retrieveFromCache) {
result = finderCache.getResult(FINDER_... |
python | def last_date_in_output_for_sid(self, sid):
"""
Parameters
----------
sid : int
Asset identifier.
Returns
-------
out : pd.Timestamp
The midnight of the last date written in to the output for the
given sid.
"""
... |
java | public SceneManager setWindowForTerminating(Window window) {
this.window = window;
window.addWindowListener(new WindowAdapter() {
@Override
public void windowClosing(WindowEvent e) {
terminate();
}
@Override
public void windowClosed(WindowEvent e) {
terminate();
... |
python | def _forward_backward(self, itraj):
"""
Estimation step: Runs the forward-back algorithm on trajectory with index itraj
Parameters
----------
itraj : int
index of the observation trajectory to process
Results
-------
logprob : float
... |
python | def OnSelectCard(self, card):
"""Called when a card is selected by clicking on the card or
reader tree control or toolbar."""
SimpleSCardAppEventObserver.OnSelectCard(self, card)
self.feedbacktext.SetLabel('Selected card: ' + repr(card)) |
java | private void logPerformance(ServletResponse response, long startTime, String url, Throwable error) {
long endTime, duration;
int statusCode = ((HttpServletResponse) response).getStatus();
endTime = System.nanoTime();
duration = TimeUnit.MILLISECONDS.convert(endTime - startTime, TimeUnit.NANOSECONDS);
... |
java | public int run() throws IOException {
mMetricsMap = new TreeMap<>(mMetaMasterClient.getMetrics());
Long bytesReadLocal =
mMetricsMap.getOrDefault(MetricsSystem.getClusterMetricName(ClientMetrics.BYTES_READ_LOCAL),
MetricValue.newBuilder().setLongValue(0L).build()).getLongValue();
Long by... |
java | public com.google.api.ads.adwords.axis.v201809.cm.Setting[] getSettings() {
return settings;
} |
java | public static ExtendedTransactionManager getClientTransactionManager() {
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
Tr.entry(tc, "getClientTransactionManager");
if (_tranManager == null) {
loadEmbeddableTranManager(clientTMKey);
}
if (Trace... |
python | def _GetLink(self):
"""Retrieves the link.
Returns:
str: path of the linked file.
"""
if self._link is None:
self._link = ''
if self.entry_type != definitions.FILE_ENTRY_TYPE_LINK:
return self._link
link = self._fsapfs_file_entry.symbolic_link_target
if link and l... |
java | public boolean destroyGuacamoleSession(String authToken) {
// Remove corresponding GuacamoleSession if the token is valid
GuacamoleSession session = tokenSessionMap.remove(authToken);
if (session == null)
return false;
// Invalidate the removed session
session.inval... |
java | public static CmsRectangle fromLeftTopWidthHeight(double left, double top, double width, double height) {
CmsRectangle result = new CmsRectangle();
result.m_left = left;
result.m_top = top;
result.m_width = width;
result.m_height = height;
return result;
} |
python | def _add_warp_ctc_loss(pred, seq_len, num_label, label):
""" Adds Symbol.contrib.ctc_loss on top of pred symbol and returns the resulting symbol """
label = mx.sym.Reshape(data=label, shape=(-1,))
label = mx.sym.Cast(data=label, dtype='int32')
return mx.sym.WarpCTC(data=pred, label=label, label_length=n... |
python | def add_user_entitlement(self, user_entitlement):
"""AddUserEntitlement.
[Preview API] Add a user, assign license and extensions and make them a member of a project group in an account.
:param :class:`<UserEntitlement> <azure.devops.v5_0.member_entitlement_management.models.UserEntitlement>` use... |
java | public int doEndTag() throws JspException
{
String scriptId = null;
ServletRequest req = pageContext.getRequest();
if ((hasErrors()) || _hasError) {
localRelease();
return EVAL_PAGE;
}
// the parent was validated in the doStartTag call
Tag p... |
java | public static List<ImageConfiguration> resolveImages(Logger logger,
List<ImageConfiguration> images,
Resolver imageResolver,
String imageNameFilter,
... |
python | def confd_state_epoll(self, **kwargs):
"""Auto Generated Code
"""
config = ET.Element("config")
confd_state = ET.SubElement(config, "confd-state", xmlns="http://tail-f.com/yang/confd-monitoring")
epoll = ET.SubElement(confd_state, "epoll")
epoll.text = kwargs.pop('epoll')... |
python | def plot_spatial_firing_rate(self,label_x='x',label_y='y',bins=None,resolution=1.0,geometry=None,weight_function=None,normalize_time=True,normalize_n=False,start_units_with_0=True,**kwargs):
"""
Plots a two dimensional representation of the firing rates.
Each spike is binned according to... |
python | def sort_orbitals(element_pdos):
"""Sort the orbitals of an element's projected density of states.
Sorts the orbitals based on a standard format. E.g. s < p < d.
Will also sort lm decomposed orbitals. This is useful for plotting/saving.
Args:
element_pdos (dict): An element's pdos. Should be f... |
python | def remove_bad_sequence(codon_list, bad_seq, bad_seqs):
"""
Make a silent mutation to the given codon list to remove the first instance
of the given bad sequence found in the gene sequence. If the bad sequence
isn't found, nothing happens and the function returns false. Otherwise the
function r... |
python | def gff(args):
"""
%prog gff btabfile
Convert btab file generated by AAT to gff3 format.
"""
from jcvi.utils.range import range_minmax
from jcvi.formats.gff import valid_gff_parent_child, valid_gff_type
p = OptionParser(gff.__doc__)
p.add_option("--source", default=None, help="Specify ... |
java | public void compareFilter(String ElementName, String value, int oper) throws DBException
{
// Delete the old search filter
m_filter = null;
// If this is not a binary operator, throw an exception
if ((oper & BINARY_OPER_MASK) == 0)
{
throw new DBException()... |
python | def create_repository(self, git_repository_to_create, project=None, source_ref=None):
"""CreateRepository.
[Preview API] Create a git repository in a team project.
:param :class:`<GitRepositoryCreateOptions> <azure.devops.v5_1.git.models.GitRepositoryCreateOptions>` git_repository_to_create: Spe... |
python | def edit(self, sha, force=github.GithubObject.NotSet):
"""
:calls: `PATCH /repos/:owner/:repo/git/refs/:ref <http://developer.github.com/v3/git/refs>`_
:param sha: string
:param force: bool
:rtype: None
"""
assert isinstance(sha, (str, unicode)), sha
asser... |
java | protected boolean loadFilters(final boolean cleanOnFail, boolean asynchronous)
{
if (!filtersSupported.get())
{
if (LOG.isWarnEnabled())
{
LOG.warn("The bloom filters are not supported therefore they cannot be reloaded");
}
return false;
}
filte... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.