language stringclasses 2
values | func_code_string stringlengths 63 466k |
|---|---|
java | protected Instantiator<T> initInstantiator(EnhancedAnnotatedType<T> type, Bean<T> bean, BeanManagerImpl beanManager, Set<InjectionPoint> injectionPoints) {
DefaultInstantiator<T> instantiator = new DefaultInstantiator<T>(type, bean, beanManager);
injectionPoints.addAll(instantiator.getParameterInjection... |
java | private void postProcessSelectorTree(Selector parsed, String fullPath)
throws InvalidXPathSyntaxException
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
tc.entry(cclass,
"postProcessSelectorTree",
"parsed: " + parsed + ", fullPath: " + fullPath);
... |
java | void writeTextContent(String text) throws IOException {
writer.write((String) Strings.escapeXML(text));
} |
python | def symmetry_reduce(tensors, structure, tol=1e-8, **kwargs):
"""
Function that converts a list of tensors corresponding to a structure
and returns a dictionary consisting of unique tensor keys with symmop
values corresponding to transformations that will result in derivative
tensors from the origina... |
python | def _detect_sse3(self):
"Does this compiler support SSE3 intrinsics?"
self._print_support_start('SSE3')
result = self.hasfunction('__m128 v; _mm_hadd_ps(v,v)',
include='<pmmintrin.h>',
extra_postargs=['-msse3'])
self._print_support_en... |
java | public Observable<DomainAvailablilityCheckResultInner> checkAvailabilityAsync(String name) {
return checkAvailabilityWithServiceResponseAsync(name).map(new Func1<ServiceResponse<DomainAvailablilityCheckResultInner>, DomainAvailablilityCheckResultInner>() {
@Override
public DomainAvailabl... |
java | @Override
public Filter adapt(
FilterAdapterContext context,
MultipleColumnPrefixFilter filter) throws IOException {
InterleaveFilter interleave = FILTERS.interleave();
ByteString.Output outputStream = null;
for (byte[] prefix : filter.getPrefix()) {
if (outputStream == null) {
o... |
java | public EEnum getGSLJLINEJOIN() {
if (gsljlinejoinEEnum == null) {
gsljlinejoinEEnum = (EEnum)EPackage.Registry.INSTANCE.getEPackage(AfplibPackage.eNS_URI).getEClassifiers().get(153);
}
return gsljlinejoinEEnum;
} |
java | protected Node getFolderNode()
throws EFapsException, RepositoryException
{
Node ret = getSession().getRootNode();
if (getProperties().containsKey(JCRStoreResource.PROPERTY_BASEFOLDER)) {
if (ret.hasNode(getProperties().get(JCRStoreResource.PROPERTY_BASEFOLDER))) {
... |
java | protected RoleGroup extract(Subject subject) {
Optional<Principal> match = subject.getPrincipals()
.stream()
.filter(g -> g.getName().equals(SecurityConstants.ROLES_IDENTIFIER))
.findFirst();
Group rolesGroup = (Group) match.get();
RoleGroup roles ... |
python | def save(self, *args):
""" Save cache to file using pickle.
Parameters
----------
*args:
All but the last argument are inputs to the cached function. The
last is the actual value of the function.
"""
with open(self.file_root + '.pkl', "wb") as f:
... |
java | public static CPRuleUserSegmentRel findByCPRuleId_Last(long CPRuleId,
OrderByComparator<CPRuleUserSegmentRel> orderByComparator)
throws com.liferay.commerce.product.exception.NoSuchCPRuleUserSegmentRelException {
return getPersistence().findByCPRuleId_Last(CPRuleId, orderByComparator);
} |
python | def _check_transition_validity(self, check_transition):
"""Checks the validity of a transition
Calls further checks to inspect the id, origin, target and connection of the transition.
:param rafcon.core.transition.Transition check_transition: The transition to be checked
:return bool v... |
java | protected void record( final CompilationUnit unit,
final Node compilationUnitNode ) throws Exception {
LOGGER.debug("recording unit comments");
recordComments(unit, compilationUnitNode);
LOGGER.debug("recording unit import nodes");
recordImports(unit, compilat... |
python | def bind(self):
"""Binds reference objects to the proper parse actions."""
self.endline <<= attach(self.endline_ref, self.endline_handle)
self.moduledoc_item <<= trace(attach(self.moduledoc, self.set_docstring))
self.name <<= trace(attach(self.base_name, self.name_check))
# comm... |
python | def pager(__text: str, *, pager: Optional[str] = 'less'):
"""Pass output through pager.
See :manpage:`less(1)`, if you wish to configure the default pager. For
example, you may wish to check ``FRSX`` options.
Args:
__text: Text to page
pager: Pager to use
"""
if pager:
... |
python | def post_task(task_data, task_uri='/tasks'):
"""Create Spinnaker Task.
Args:
task_data (str): Task JSON definition.
Returns:
str: Spinnaker Task ID.
Raises:
AssertionError: Error response from Spinnaker.
"""
url = '{}/{}'.format(API_URL, task_uri.lstrip('/'))
if ... |
python | def __get_edge_by_two_vertices(self, vertex1, vertex2, key=None):
""" Returns an instance of :class:`bg.edge.BBGEdge` edge between to supplied vertices (if ``key`` is supplied, returns a :class:`bg.edge.BBGEdge` instance about specified edge).
Checks that both specified vertices are in current :class:`... |
java | @POST
@Path("/")
@Produces({ "text/plain" })
public void mapReduce(@QueryParam("params") String params, @QueryParam("jobName") String jobName,
@QueryParam("inputKeyspace") String inputKeyspace,
@QueryParam("inputColumnFamily") String inputColumnFamily,
@QueryParam("output... |
java | @Override
public boolean visitTree(VisitContext visitContext, VisitCallback callback) {
// First check to see whether we are visitable. If not
// short-circuit out of this subtree, though allow the
// visit to proceed through to other subtrees.
if (!isVisitable(visitContext)) {
... |
python | async def _reset_protocol(self, exc=None):
"""Reset the protocol if an error occurs."""
# Be responsible and clean up.
protocol = await self._get_protocol()
await protocol.shutdown()
self._protocol = None
# Let any observers know the protocol has been shutdown.
fo... |
java | public Vector3f transformProject(float x, float y, float z, Vector3f dest) {
dest.x = x;
dest.y = y;
dest.z = z;
return dest.mulProject(this);
} |
java | public void marshall(UpdateElasticsearchDomainConfigRequest updateElasticsearchDomainConfigRequest, ProtocolMarshaller protocolMarshaller) {
if (updateElasticsearchDomainConfigRequest == null) {
throw new SdkClientException("Invalid argument passed to marshall(...)");
}
try {
... |
python | def _build_indices(self):
"""Build indices for the different field types"""
result = {key: OrderedDict() for key in LINES_WITH_ID}
for line in self.lines:
if line.key in LINES_WITH_ID:
result.setdefault(line.key, OrderedDict())
if line.mapping["ID"] in... |
java | public static <T> T castIfInstance(Object o, Class<T> c) {
return o != null && c.isInstance(o) ? c.cast(o) : null;
} |
python | def perc(arr, p=95, **kwargs):
"""Create symmetric percentiles, with ``p`` coverage."""
offset = (100 - p) / 2
return np.percentile(arr, (offset, 100 - offset), **kwargs) |
python | def add(self, item_numid, collect_type, shared, session):
'''taobao.favorite.add 添加收藏夹
根据用户昵称和收藏目标的数字id以及收藏目标的类型,实现收藏行为'''
request = TOPRequest('taobao.favorite.add')
request['item_numid'] = item_numid
request['collect_type'] = collect_type
request['shared'] = sh... |
java | @InterfaceAudience.Public
public SavedRevision getCurrentRevision() {
if (currentRevision == null)
currentRevision = getRevision(null);
return currentRevision;
} |
java | public void setRange(final double RANGE) {
this.range = RANGE;
checkForBlips();
init(getInnerBounds().width, getInnerBounds().height);
repaint();
} |
python | def find_fxpeaks(sp,
times_sigma_threshold,
minimum_threshold,
nwinwidth_initial,
nwinwidth_refined,
npix_avoid_border,
nbrightlines,
sigma_gaussian_filtering,
minimum_gaussian_filteri... |
java | public boolean add(Byte value) {
if (value == null) {
stateList.add(Type.NULL);
} else {
stateList.add(Type.LONG);
}
return super.add(value);
} |
python | def form_valid(self,form):
'''
Even if this form is valid, the handlers for this form may have added messages
to the request. In that case, then the page should be handled as if the form
were invalid. Otherwise, update the session data with the form data and then
move to the ne... |
python | def _set_pfiles(dry_run, **kwargs):
"""Set the PFILES env var
Parameters
----------
dry_run : bool
Don't actually run
Keyword arguments
-----------------
pfiles : str
Value to set PFILES
Returns
-------
pfiles_orig : str
Current value of PFILES e... |
java | public WebAppContext addWarApp(String war, String contextPath) throws JettyBootstrapException {
WarAppJettyHandler warAppJettyHandler = new WarAppJettyHandler(getInitializedConfiguration());
warAppJettyHandler.setWar(war);
warAppJettyHandler.setContextPath(contextPath);
WebAppContext we... |
python | def get_surface(shifts, orig_text, item, text):
"""Extract surface from regex hit."""
span = item.span()
logging.debug(u'\tInitial span: %s ("%s")', span, text[span[0]:span[1]])
real_span = (span[0] - shifts[span[0]], span[1] - shifts[span[1] - 1])
surface = orig_text[real_span[0]:real_span[1]]
... |
python | def exponential_sym(target, X, A1='', A2='', A3='', A4='', A5='', A6=''):
r"""
Calculates the rate, as well as slope and intercept of the following
function at the given value of *x*:
.. math::
r = A_{1} A_{2}^{( A_{3} x^{ A_{4} } + A_{5})} + A_{6}
Parameters
----------
A1... |
python | def blockshaped(arr, nrows, ncols):
"""
Return an new array of shape (n, nrows, ncols) where
n * nrows * ncols = arr.size
If arr is a 2D array, the returned array looks like n subblocks with
each subblock preserving the "physical" layout of arr.
"""
h, w = arr.shape
return (arr.reshape(... |
java | public static void storeStatusUpdateTemplateNode(
final AbstractGraphDatabase graphDatabase, final String templateId,
final Node templateNode, final Node previousTemplateNode) {
// remove node of the latest previous template version
if (previousTemplateNode != null) {
INDEX_STATUS_UPDATE_TEMPLATES.remove(p... |
python | def release():
"""Release a new version"""
release_check()
build()
print("Releasing %s version %s." % (env.projname, env.version))
local("git tag %s" % env.version)
local('gpg --detach-sign --armor dist/coursera-*.tar.gz*')
local('twine upload dist/coursera-*.tar.gz*')
local("git push")
... |
java | private RedBlackTreeNode<Key, Value> balance(RedBlackTreeNode<Key, Value> h) {
// assert (h != null);
if (isRed(h.getRight()))
h = rotateLeft(h);
if (isRed(h.getLeft()) && isRed(h.getLeft().getLeft()))
h = rotateRight(h);
if (isRed(h.getLeft()) && isRed(h.getRight()))
flipColors(h);
h.setSize(size... |
java | public Observable<EventsResults> getByTypeAsync(String appId, EventType eventType, String timespan, String filter, String search, String orderby, String select, Integer skip, Integer top, String format, Boolean count, String apply) {
return getByTypeWithServiceResponseAsync(appId, eventType, timespan, filter, s... |
python | def _setContent(self):
'''GED defines element name, so also define typecode aname
'''
kw = KW.copy()
try:
kw.update(dict(klass=self.getClassName(),
element='ElementDeclaration',
literal=self.literalTag(),
su... |
java | public void setOwners(java.util.Collection<String> owners) {
if (owners == null) {
this.owners = null;
return;
}
this.owners = new com.amazonaws.internal.SdkInternalList<String>(owners);
} |
python | def avail_images(call=None, location='local'):
'''
Return a list of the images that are on the provider
CLI Example:
.. code-block:: bash
salt-cloud --list-images my-proxmox-config
'''
if call == 'action':
raise SaltCloudSystemExit(
'The avail_images function must ... |
java | @Nullable
public <V extends FileAttributeView> V getFileAttributeView(FileLookup lookup, Class<V> type) {
return store.getFileAttributeView(lookup, type);
} |
python | def write_cache(cache, opts):
'''
Write the mount cache file.
'''
cache_file = get_cache(opts)
try:
_cache = salt.utils.stringutils.to_bytes(
salt.utils.yaml.safe_dump(cache)
)
with salt.utils.files.fopen(cache_file, 'wb+') as fp_:
fp_.write(_cache)
... |
python | def _get_value(self, entity):
"""Internal helper to get the value for this Property from an entity.
For a repeated Property this initializes the value to an empty
list if it is not set.
"""
if entity._projection:
if self._name not in entity._projection:
raise UnprojectedPropertyError(... |
java | private Command parse() throws ParseException {
command();
while (!is(Token.WHERE, Token.RETURN, Token.EOL)) {
param();
}
if (token == Token.WHERE) {
where();
}
if (token == Token.RETURN) {
returns();
}
expect(Token.EOL... |
java | public void printElement(String elementName, String value, Map<String, String> attributes) {
print("<" + elementName);
for (Entry<String, String> entry : attributes.entrySet()) {
print(" " + entry.getKey() + "=\"" + escape(entry.getValue()) + "\"");
}
if (value != null) {
println(">" + esc... |
java | public void scaleAbsoluteHeight(float newHeight) {
plainHeight = newHeight;
float[] matrix = matrix();
scaledWidth = matrix[DX] - matrix[CX];
scaledHeight = matrix[DY] - matrix[CY];
setWidthPercentage(0);
} |
java | public ServiceFuture<DatabaseAccountInner> createOrUpdateAsync(String resourceGroupName, String accountName, DatabaseAccountCreateUpdateParameters createUpdateParameters, final ServiceCallback<DatabaseAccountInner> serviceCallback) {
return ServiceFuture.fromResponse(createOrUpdateWithServiceResponseAsync(resou... |
java | @Override
public Boolean getValue()
{
if (isParsed())
{
if (getDefaultValues().get(0).equals(Boolean.TRUE))
return Boolean.FALSE;
return Boolean.TRUE;
}
return getDefaultValues().get(0);
} |
java | @Override
public DeleteAppResult deleteApp(DeleteAppRequest request) {
request = beforeClientExecution(request);
return executeDeleteApp(request);
} |
java | public final <T> T getTypedContext(Class<T> key, T defaultValue) {
return UEL.getContext(this, key, defaultValue);
} |
java | private boolean rename(String src, String dst) throws IOException {
IOException te = null;
FileSystem hdfs = getFs();
RetryPolicy retryPolicy = new CountingRetry(MAX_TRY);
while (retryPolicy.attempt()) {
try {
return hdfs.rename(new Path(src), new Path(dst));
} catch (IOException e) ... |
python | def load_swagger_spec(self, filepath=None):
"""
Loads the origin_spec from a local JSON file. If `filepath`
is not provided, then the class `file_spec` format will be used
to create the file-path value.
"""
if filepath is True or filepath is None:
filepath = ... |
python | def render_error_debug(request, exception, is_html):
'''Render the ``exception`` traceback
'''
error = Html('div', cn='well well-lg') if is_html else []
for trace in format_traceback(exception):
counter = 0
for line in trace.split('\n'):
if line.startswith(' '):
... |
java | public void launchPlatform() {
logger.info("Launching Jadex Platform...");
platform = (IExternalAccess) Starter.createPlatform(null).get(
new ThreadSuspendable());
IServiceProvider container = (IServiceProvider) platform
.getServiceProvider();
cmsService =... |
python | def GetEventTagByIdentifier(self, storage_file, event_identifier):
"""Retrieves the most recently updated event tag for an event.
Args:
storage_file (BaseStorageFile): storage file.
event_identifier (AttributeContainerIdentifier): event attribute
container identifier.
Returns:
... |
python | def maybe_call(maybe_fn, kwargs: dict, prefix: str = None) -> 'Any':
"""
If maybe_fn is a function, get its arguments from kwargs and call it, also
searching for prefixed kwargs if prefix is specified. Otherwise, return
maybe_fn.
Used to allow both functions and iterables to be passed into plotting... |
python | def _buildTemplates(self):
"""
OVERRIDING THIS METHOD from Factory
"""
c_mylist = build_D3treeStandard(0, 99, 1,
self.ontospy_graph.toplayer_classes)
p_mylist = build_D3treeStandard(0, 99, 1,
self.on... |
java | @Override
public long incrementColumnValue(byte[] row, byte[] family, byte[] qualifier, long amount)
throws IOException {
LOG.trace("incrementColumnValue(byte[], byte[], byte[], long)");
try (
Scope scope = TRACER.spanBuilder("BigtableTable.incrementColumnValue").startScopedSpan()) {
Incre... |
python | def get_catalog_path(catalog_id, catalogs_dir=CATALOGS_DIR, fmt="json"):
"""Genera el path estándar de un catálogo en un filesystem."""
base_path = os.path.join(catalogs_dir, "catalog", catalog_id)
if fmt == "json":
return os.path.join(base_path, "data.json")
elif fmt == "xlsx":
return ... |
java | protected String getStringFromNode(Object inNode)
{
if (tc.isAnyTracingEnabled() && tc.isEntryEnabled())
tc.entry(cclass, "getStringFromNode", inNode);
String strValue = null;
if (tc.isAnyTracingEnabled() && tc.isEntryEnabled())
tc.exit(cclass, "getStringFromNode", strValue);
ret... |
python | def enable_scp(self, cmd=None):
"""
Enable SCP on remote device.
Defaults to Cisco IOS command
"""
if cmd is None:
cmd = ["ip scp server enable"]
elif not hasattr(cmd, "__iter__"):
cmd = [cmd]
self.ssh_ctl_chan.send_config_set(cmd) |
python | def attribute_value(self, doc: Document, attribute_name: str):
"""
Access data using attribute name rather than the numeric indices
Returns: the value for the attribute
"""
return doc.cdr_document.get(self.header_translation_table[attribute_name]) |
python | def validate(self, val):
"""
Performs basic validation of field value and then passes it for
specific validation.
:param val: field value to validate
:return: error message or None
"""
if self.nullable and val is None:
return
type_er = self._... |
java | @Nullable
@TokenType
private static String asTokenType(@Nullable String possibleTokenType) {
if (possibleTokenType == null || TextUtils.isEmpty(possibleTokenType.trim())) {
return null;
}
if (Token.TYPE_CARD.equals(possibleTokenType)) {
return Token.TYPE_CARD;
... |
java | @Override
public void initialize(Map<String, Object> puProperties)
{
this.externalProperties = puProperties;
this.propertyReader = new ESClientPropertyReader(externalProperties, kunderaMetadata.getApplicationMetadata()
.getPersistenceUnitMetadata(getPersistenceUnit()));
... |
python | def ttl(self, steps, relative_time=None):
'''
Return the ttl given the number of steps, None if steps is not defined
or we're otherwise unable to calculate one. If relative_time is defined,
then return a ttl that is the number of seconds from now that the
record should be expired.
'''
if ste... |
python | def pages_counter(self, total: int, page_size: int = 100) -> int:
"""Simple helper to handle pagination. Returns the number of pages for a
given number of results.
:param int total: count of metadata in a search request
:param int page_size: count of metadata to display in each page
... |
java | private static void getLeafNodes(
TreeModel treeModel, Object node, Collection<Object> leafNodes)
{
if (node == null)
{
return;
}
int childCount = treeModel.getChildCount(node);
if (childCount == 0)
{
leafNodes.add(node);
... |
java | public int getMaxComponentWidth()
{
int maxWidth = 0;
for (int index = 0; ; index++)
{
Component component = this.getComponent(index);
if (component == null)
break;
if (component instanceof JTableHeader)
continue; // Don't... |
java | public void status(int statusTag, Object[] o) {
switch (statusTag) {
case STATUS_INST_BPD_INIT:
getOutStream().println(HBCIUtils.getLocMsg("STATUS_REC_INST_DATA"));
break;
case STATUS_INST_BPD_INIT_DONE:
getOutStream().println(HBCIUtils.get... |
java | public OptionBuilder withLongForm( String longForm )
{
if (option.getLongForm() != null) throw new IllegalArgumentException( "Long form given twice" );
option.setLongForm( longForm );
return this;
} |
python | def create(cls, messageType, extended, hopsleft=3, hopsmax=3):
"""Create message flags.
messageType: integter 0 to 7:
MESSAGE_TYPE_DIRECT_MESSAGE = 0
MESSAGE_TYPE_DIRECT_MESSAGE_ACK = 1
MESSAGE_TYPE_ALL_LINK_CLEANUP = 2
MESSAGE_TYPE_ALL_LINK_CLEANUP_ACK =... |
python | def hurst(X):
""" Compute the Hurst exponent of X. If the output H=0.5,the behavior
of the time-series is similar to random walk. If H<0.5, the time-series
cover less "distance" than a random walk, vice verse.
Parameters
----------
X
list
a time series
Returns
------... |
java | protected Properties setupProperties() {
Properties props = System.getProperties();
// Use the command line options to set the desired properites in the
// constructor. Use the system properties in case these properties were
// set using -Dprop=<value>
if (argOptions.hasOption(... |
java | public List<Integer> getOpportunitiesGroups(String datasource, String ifNoneMatch) throws ApiException {
ApiResponse<List<Integer>> resp = getOpportunitiesGroupsWithHttpInfo(datasource, ifNoneMatch);
return resp.getData();
} |
python | def logger(self):
"""The logger of this organizer"""
if self._experiment:
return logging.getLogger('.'.join([self.name, self.experiment]))
elif self._projectname:
return logging.getLogger('.'.join([self.name, self.projectname]))
else:
return logging.ge... |
java | @Override
public HTTaxinvoiceXMLResponse getXML(String CorpNum, String NTSConfirmNum)
throws PopbillException {
return getXML(CorpNum, NTSConfirmNum, null);
} |
java | public double calcKMeansCosts(double[] center, ClusteringFeature points) {
assert (this.sumPoints.length == center.length &&
this.sumPoints.length == points.sumPoints.length);
return (this.sumSquaredLength + points.sumSquaredLength)
- 2 * Metric.dotProductWithAddition(this.sumPoints,
points.sumPoints,... |
java | public void setFilter(java.util.Map<String, java.util.List<String>> filter) {
this.filter = filter;
} |
python | def trace_line_numbers(filename, reload_on_change=False):
"""Return an Array of breakpoints in filename.
The list will contain an entry for each distinct line event call
so it is possible (and possibly useful) for a line number appear more
than once."""
fullname = cache_file(filename, reload_on_chan... |
python | def iter(self):
"""
Iterate over the sequences in self.file_, yielding each as an
instance of the desired read class.
@raise ValueError: If the input file has an odd number of records or
if any sequence has a different length than its predicted
secondary structur... |
python | def _parse_ldap(ldap_filter):
# type: (str) -> Optional[LDAPFilter]
"""
Parses the given LDAP filter string
:param ldap_filter: An LDAP filter string
:return: An LDAPFilter object, None if the filter was empty
:raise ValueError: The LDAP filter string is invalid
"""
if ldap_filter is No... |
python | def inferObject(exp, objectId, objects, objectName):
"""
Run inference on the given object.
objectName is the name of this object in the experiment.
"""
# Create sequence of random sensations for this object for one column. The
# total number of sensations is equal to the number of points on the object.
... |
java | public static String stringify(int[] raw) {
if (raw == null) {
return "null";
}
StringBuffer buffer = new StringBuffer();
int count = raw.length;
buffer.append("[ ");
for (int i = 0; i < count; i++) {
if (i > 0) {
buffer.append(",... |
java | public JSONObject getErrorJSON(int pErrorCode, Throwable pExp, JmxRequest pJmxReq) {
JSONObject jsonObject = new JSONObject();
jsonObject.put("status",pErrorCode);
jsonObject.put("error",getExceptionMessage(pExp));
jsonObject.put("error_type", pExp.getClass().getName());
addError... |
java | public static byte[] getMD5(byte[] src) {
assert src != null;
try {
return MessageDigest.getInstance("MD5").digest(src);
} catch (NoSuchAlgorithmException ex) {
throw new IllegalArgumentException("Missing 'MD5' algorithm", ex);
}
} |
java | public void marshall(ChannelsResponse channelsResponse, ProtocolMarshaller protocolMarshaller) {
if (channelsResponse == null) {
throw new SdkClientException("Invalid argument passed to marshall(...)");
}
try {
protocolMarshaller.marshall(channelsResponse.getChannels(),... |
java | public Assignments cluster(Matrix matrix, Properties props) {
return cluster(matrix, Integer.MAX_VALUE, props);
} |
java | public SecurityTokenServiceClient buildClientForRelyingPartyTokenResponses(final SecurityToken securityToken,
final WSFederationRegisteredService service) {
val cxfBus = BusFactory.getDefaultBus();
val sts = new SecurityToken... |
python | def create_ui(self):
'''
.. versionchanged:: 0.9
Update device registration in real-time while dragging video
control point to new position.
.. versionchanged:: 0.12
Add ``dynamic_electrode_state_shapes`` layer to show dynamic
electrode actuations... |
java | public void addProperty(String propertyType) {
if (m_properties == null) {
// this list will be used and clean up in the importResource method
m_properties = new HashMap<String, CmsProperty>();
}
try {
if ((m_propertyName == null) || getIgnoredProperties().co... |
python | def _get_batches(self, items):
"""given a list yield list at most self.max_batch_size in size"""
for i in xrange(0, len(items), self.max_batch_size):
yield items[i:i + self.max_batch_size] |
python | def set_expected_lines(self, expected_lines):
"""stub"""
if not self.my_osid_object_form._is_valid_integer(
expected_lines, self.get_expected_lines_metadata()):
raise InvalidArgument('expectedLines')
self.my_osid_object_form._my_map['expectedLines'] = expected_lines |
java | public static byte[] hexToByte(String s) throws IOException {
int l = s.length() / 2;
byte data[] = new byte[l];
int j = 0;
if (s.length() % 2 != 0) {
throw new IOException(
"hexadecimal string with odd number of characters");
... |
python | def generate_sentence(self) -> str:
"""Generate sentence from the parts.
:return: Sentence.
"""
sentences = self._data['sentence']
sentence = [
self.random.choice(sentences[k]) for k
in ('head', 'p1', 'p2', 'tail')
]
return '{0} {1} {2} {3... |
python | def angprofile(self, **kwargs):
""" return the file name for sun or moon angular profiles
"""
kwargs_copy = self.base_dict.copy()
kwargs_copy.update(**kwargs)
self._replace_none(kwargs_copy)
localpath = NameFactory.angprofile_format.format(**kwargs_copy)
i... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.