language stringclasses 2
values | func_code_string stringlengths 63 466k |
|---|---|
python | def make_stack(env, stage, segment):
"""For each transform segment, create the code in the try/except block with the
assignements for pipes in the segment """
import string
import random
from ambry.valuetype import ValueType
column = segment['column']
def make_line(column, t):
pre... |
python | def get_template_dir():
"""Find and return the ntc-templates/templates dir."""
try:
template_dir = os.path.expanduser(os.environ["NET_TEXTFSM"])
index = os.path.join(template_dir, "index")
if not os.path.isfile(index):
# Assume only base ./ntc-templates specified
... |
python | def create_widget(self):
""" Create the underlying widget.
"""
d = self.declaration
self.widget = DrawerLayout(self.get_context(), None, d.style) |
python | def _SetSshHostKeys(self, host_key_types=None):
"""Regenerates SSH host keys when the VM is restarted with a new IP address.
Booting a VM from an image with a known SSH key allows a number of attacks.
This function will regenerating the host key whenever the IP address
changes. This applies the first t... |
java | public BoxRequestsFolder.GetCollaborations getCollaborationsRequest(String id) {
BoxRequestsFolder.GetCollaborations request = new BoxRequestsFolder.GetCollaborations(id, getFolderCollaborationsUrl(id), mSession);
return request;
} |
python | def key2str(target):
"""
In ``symfit`` there are many dicts with symbol: value pairs.
These can not be used immediately as \*\*kwargs, even though this would make
a lot of sense from the context.
This function wraps such dict to make them usable as \*\*kwargs immediately.
:param target: `Mappin... |
java | public Object opt(String key) {
return key == null ? null : this.myHashMap.get(key);
} |
python | def __sendCommand(self, cmd):
"""send specific command to reference unit over serial port
Args:
cmd: OpenThread_WpanCtl command string
Returns:
Fail: Failed to send the command to reference unit and parse it
Value: successfully retrieve the desired value fro... |
java | public static ViewFactory getViewFactory(String strSubPackage, char chPrefix)
{
ViewFactory viewFactory = null;
viewFactory = (ViewFactory)m_htFactories.get(strSubPackage);
if (viewFactory == null)
{
viewFactory = new ViewFactory(strSubPackage, chPrefix);
m_ht... |
python | def add_plugin(self, phase, name, args, reason=None):
"""
if config has plugin, override it, else add it
"""
plugin_modified = False
for plugin in self.template[phase]:
if plugin['name'] == name:
plugin['args'] = args
plugin_modified =... |
java | public RecordSetInner createOrUpdate(String resourceGroupName, String zoneName, String relativeRecordSetName, RecordType recordType, RecordSetInner parameters, String ifMatch, String ifNoneMatch) {
return createOrUpdateWithServiceResponseAsync(resourceGroupName, zoneName, relativeRecordSetName, recordType, para... |
python | def get_lldp_neighbor_detail_input_request_type_get_next_request_last_rcvd_ifindex(self, **kwargs):
"""Auto Generated Code
"""
config = ET.Element("config")
get_lldp_neighbor_detail = ET.Element("get_lldp_neighbor_detail")
config = get_lldp_neighbor_detail
input = ET.SubE... |
python | def get_sources_by_name(self, name):
"""Return a list of sources in the ROI matching the given
name. The input name string can match any of the strings in
the names property of the source object. Case and whitespace
are ignored when matching name strings.
Parameters
--... |
python | def reload_source(self, name):
"""Recompute the source map for a single source in the model.
"""
src = self.roi.get_source_by_name(name)
if hasattr(self.like.logLike, 'loadSourceMap'):
self.like.logLike.loadSourceMap(str(name), True, False)
srcmap_utils.delete_s... |
java | protected <T> void bindDynamicProvider(TypeLiteral<T> typeLiteral) {
DynamicAnnotations.bindDynamicProvider(binder(), Key.get(typeLiteral, getBindingAnnotation()));
} |
python | def space_search(args):
""" Search for workspaces matching certain criteria """
r = fapi.list_workspaces()
fapi._check_response_code(r, 200)
# Parse the JSON for workspace + namespace; then filter by
# search terms: each term is treated as a regular expression
workspaces = r.json()
extra_te... |
python | def write_fastq(filename):
"""
return a handle for FASTQ writing, handling gzipped files
"""
if filename:
if filename.endswith('gz'):
filename_fh = gzip.open(filename, mode='wb')
else:
filename_fh = open(filename, mode='w')
else:
filename_fh = None
... |
java | protected Pattern translateMaskIntoRegex(FacesContext context, String mask) {
StringBuilder regex = SharedStringBuilder.get(context, SB_PATTERN);
boolean optionalFound = false;
for (char c : mask.toCharArray()) {
if (c == '?') {
optionalFound = true;
}
... |
java | public GitlabJob eraseJob(Integer projectId, Integer jobId) throws IOException {
String tailUrl = GitlabProject.URL + "/" + sanitizeProjectId(projectId) + GitlabJob.URL + "/" + sanitizeId(jobId, "JobID") + "/erase";
return dispatch().to(tailUrl, GitlabJob.class);
} |
java | public static nssimpleacl6 get(nitro_service service, String aclname) throws Exception{
nssimpleacl6 obj = new nssimpleacl6();
obj.set_aclname(aclname);
nssimpleacl6 response = (nssimpleacl6) obj.get_resource(service);
return response;
} |
java | @JSONField(serialize = false)
public String[] getSequentialNames() {
List<Obj> sequential = getSequential();
String[] sequentialNames = new String[sequential.size()];
for (int i = 0; i < sequential.size(); i++) {
sequentialNames[i] = sequential.get(i).getName();
}
... |
java | public static BaseResult kfsessionClose(String access_token, String kf_account, String openid, String text) {
String postJsonData = String.format("{\"kf_account\":\"%1s\",\"openid\":\"%2s\",\"text\":\"%3s\"}",
kf_account,
openid,
text);
HttpUriRequest httpUriRequest = RequestBuilder.post()
... |
python | def is_session_active(self):
"""
:rtype: bool
"""
if self.session_context is None:
return False
time_now = datetime.datetime.now()
time_to_expiry = self.session_context.expiry_time - time_now
time_to_expiry_minimum = datetime.timedelta(
s... |
python | def get_build_controller(self, controller_id):
"""GetBuildController.
Gets a controller
:param int controller_id:
:rtype: :class:`<BuildController> <azure.devops.v5_0.build.models.BuildController>`
"""
route_values = {}
if controller_id is not None:
ro... |
java | public static ControlBean instantiate( ClassLoader cl,
String beanName,
PropertyMap props )
throws ClassNotFoundException
{
return instantiate( cl, beanName, props, null, null );
} |
java | private static RecursiveDeleteResult recursiveDeleteFiles(HdfsEnvironment hdfsEnvironment, HdfsContext context, Path directory, List<String> filePrefixes, boolean deleteEmptyDirectories)
{
FileSystem fileSystem;
try {
fileSystem = hdfsEnvironment.getFileSystem(context, directory);
... |
java | private ArrayList<Rect> calculateAllBounds(Paint paint) {
ArrayList<Rect> list = new ArrayList<Rect>();
//For each views (If no values then add a fake one)
final int count = mRecyclerView.getAdapter().getItemCount();
final int width = getWidth();
final int halfWidth = width / 2;
... |
python | def trades(self, symbol='btcusd', since=0, limit_trades=50,
include_breaks=0):
"""
Send a request to get all public trades, return the response.
Arguments:
symbol -- currency symbol (default 'btcusd')
since -- only return trades after this unix timestamp (default ... |
java | static JmsMessageImpl messageToJmsMessageImpl(Message message) throws JMSException {
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.entry(tc, "messageToJmsMessageImpl", message);
JmsMessageImpl jmsMessage = null;
if (message instanceof BytesMessage) {
... |
python | def get_parsed_value(self, value):
"""
Helper to cast string to datetime using :member:`parse_format`.
:param value: String representing a datetime
:type value: str
:return: datetime
"""
def get_parser(parser_desc):
try:
return parser... |
java | private Billing generateDefaultReservation() {
Billing billing = new Billing();
Billing.Reservation reservation = new Billing.Reservation();
billing.setReservation(reservation);
reservation.setReservationLength(1);
return billing;
} |
java | public static double logpdf(double val, double loc, double scale, double shape1, double shape2) {
val = (val - loc) / scale;
final double logc = logcdf(val, shape1, shape2);
if(shape1 != 0.) {
val = shape1 * val;
if(val >= 1) {
return Double.NEGATIVE_INFINITY;
}
val = (1. - 1... |
python | def iter_languages(self, number=-1, etag=None):
"""Iterate over the programming languages used in the repository.
:param int number: (optional), number of languages to return. Default:
-1 returns all used languages
:param str etag: (optional), ETag from a previous request to the sam... |
java | protected void unpackXARToOutputDirectory(Artifact artifact, String[] includes, String[] excludes)
throws MojoExecutionException
{
if (!this.outputBuildDirectory.exists()) {
this.outputBuildDirectory.mkdirs();
}
File file = artifact.getFile();
unpack(file, this.o... |
java | @Override protected Split eqSplit(int col, Data d, int[] dist, int distWeight, Random rand) {
final int[] distR = new int[d.classes()], distL = dist.clone();
final double upperBoundReduction = upperBoundReduction(d.classes());
double maxReduction = -1;
int bestSplit = -1;
int min = d.colMinIdx(col);... |
java | public static Response put(String uriString) throws URISyntaxException, HttpException {
return putBody(new HttpPut(uriString), null, null, null, null);
} |
python | def libvlc_video_set_deinterlace(p_mi, psz_mode):
'''Enable or disable deinterlace filter.
@param p_mi: libvlc media player.
@param psz_mode: type of deinterlace filter, NULL to disable.
'''
f = _Cfunctions.get('libvlc_video_set_deinterlace', None) or \
_Cfunction('libvlc_video_set_deinterla... |
java | @Override
public Iterator<T> iterator()
{
writeLock.lock();
if (iterator == null)
{
iterator = new Iter();
}
else
{
iterator.reset();
}
return iterator;
} |
python | def encode(self, value):
"""Encode value."""
value = self.serialize(value)
if self.encoding:
value = value.encode(self.encoding)
return value |
java | protected void addSRE() {
final AddSREInstallWizard wizard = new AddSREInstallWizard(
createUniqueIdentifier(),
this.sreArray.toArray(new ISREInstall[this.sreArray.size()]));
final WizardDialog dialog = new WizardDialog(getShell(), wizard);
if (dialog.open() == Window.OK) {
final ISREInstall result = w... |
java | private void disposeTasks(Collection<Runnable>... tasks) {
for (Collection<Runnable> task : tasks) {
for (Runnable runnable : task) {
if (runnable instanceof Disposable) {
((Disposable) runnable).dispose();
}
}
}
} |
java | public static <T> List<T> toSorted(Iterable<T> self) {
return toSorted(self, new NumberAwareComparator<T>());
} |
python | def pip_remove(self, name=None, prefix=None, pkgs=None):
"""Remove a pip package in given environment by `name` or `prefix`."""
logger.debug(str((prefix, pkgs)))
if isinstance(pkgs, (list, tuple)):
pkg = ' '.join(pkgs)
else:
pkg = pkgs
extra_args = ['uni... |
java | private Bean<RemoteCacheManager> createDefaultRemoteCacheManagerBean(BeanManager beanManager) {
return new BeanBuilder<RemoteCacheManager>(beanManager)
.beanClass(InfinispanExtensionRemote.class)
.addTypes(Object.class, RemoteCacheManager.class)
.scope(Application... |
java | @Override
public String getParameter(String name) {
String[] vals = getParameterMap().get(name);
return (vals != null && vals.length > 0) ? vals[0] : null;
} |
java | static Collection<RoboconfError> validateRecipesSpecifics( MavenProject project, ApplicationTemplate tpl, boolean official ) {
Collection<RoboconfError> result = new ArrayList<> ();
if( ! project.getArtifactId().equals( project.getArtifactId().toLowerCase()))
result.add( new RoboconfError( ErrorCode.REC_ARTIFAC... |
java | private static void initFromPackageInfo(PackageDescriptor pd,
Class<?> packageInfoClass)
throws Exception {
pd.setExists(true);
Class<?>[] ca = new Class[0];
Object[] oa = new Object[0];
pd.setSpecificationTitle(
(String) (... |
python | def blobs(shape: List[int], porosity: float = 0.5, blobiness: int = 1):
"""
Generates an image containing amorphous blobs
Parameters
----------
shape : list
The size of the image to generate in [Nx, Ny, Nz] where N is the
number of voxels
porosity : float
If specified, ... |
java | public DbDatum getClassPipeProperty(String className, String pipeName, String propertyName) throws DevFailed {
DbPipe dbPipe = databaseDAO.getClassPipeProperties(this, className, pipeName);
DbDatum datum = dbPipe.getDatum(propertyName);
if (datum==null)
Except.throw_exception("TangoA... |
python | def severity(self):
"""Retrieves the severity for the incident/incidents from the
output response
Returns:
severity(namedtuple): List of named tuples of severity for the
incident/incidents
"""
resource_list = self.traffic_incident()
severity = nam... |
java | private long getProcessInstanceId(String instanceId) throws NumberFormatException {
int endIndx = instanceId.indexOf("/");
if (endIndx > -1) {
return Long.parseLong(instanceId.substring(0, endIndx));
}
return Long.parseLong(instanceId);
} |
java | private boolean isObjectTypeWithNonStringifiableKey(JSType type) {
if (!type.isTemplatizedType()) {
return false;
}
TemplatizedType templatizedType = type.toMaybeTemplatizedType();
if (templatizedType.getReferencedType().isNativeObjectType()
&& templatizedType.getTemplateTypes().size() > 1... |
java | private CounterMetricFamily fromCounter(List<Map.Entry<MetricName, Counter>> countersWithSameName) {
final Map.Entry<MetricName, Counter> first = countersWithSameName.get(0);
final MetricName firstName = first.getKey();
final CounterMetricFamily metricFamily = new CounterMetricFamily(firstName.getName(), getHelpM... |
python | def post_save(sender, instance, created, **kwargs):
"""
After save create order instance for sending instance for orderable models.
"""
# Only create order model instances for
# those modules specified in settings.
model_label = '.'.join([sender._meta.app_label, sender._meta.object_name])
la... |
java | private void mapAttributes(List<Attribute> input, Map<String, List<Attribute>> output) {
Iterator<Attribute> it = input.iterator();
while (it.hasNext()) {
Attribute attr = it.next();
String id = attr.getId().toString();
if (output.containsKey(id)) {
L... |
java | public static boolean distributeAndCheckResponse(DistributionBuilder distributionBuilder, ArtifactoryBuildInfoClient client, TaskListener listener,
String buildName, String buildNumber, boolean dryRun) throws IOException {
// do a dry run first
listen... |
java | static long getGenerationStampFromSeperateChecksumFile(String[] listdir, String blockName) {
for (int j = 0; j < listdir.length; j++) {
String path = listdir[j];
if (!path.startsWith(blockName)) {
continue;
}
String[] vals = StringUtils.split(path, '_');
if (vals.length != 3) {... |
java | private void paintCell(SeaGlassContext context, Graphics g, Rectangle cellRect, int row, int column) {
if (table.isEditing() && table.getEditingRow() == row && table.getEditingColumn() == column) {
Component component = table.getEditorComponent();
component.setBounds(cellRect);
... |
java | @Pure
public Direction1D getRoadSegmentDirectionAt(int index) {
if (index >= 0) {
int b = 0;
for (final RoadPath p : this.paths) {
final int e = b + p.size();
if (index < e) {
return p.getSegmentDirectionAt(index - b);
}
b = e;
}
}
throw new IndexOutOfBoundsException();
} |
python | def get_session(self, token):
'''
The token parameter should be `oFlyUserid`. This is used to initialize
an authenticated session instance. Returns an instance of
:attr:`session_obj`.
:param token: A token with which to initialize the session with, e.g.
:attr:`OflySe... |
java | private UndiGraph<Var, Void> computeVariableNamesInterferenceGraph(
ControlFlowGraph<Node> cfg, Set<? extends Var> escaped) {
UndiGraph<Var, Void> interferenceGraph = LinkedUndirectedGraph.create();
// First create a node for each non-escaped variable. We add these nodes in the order in which
// they... |
python | def lan(self, move: Move) -> str:
"""
Gets the long algebraic notation of the given move in the context of
the current position.
"""
return self._algebraic(move, long=True) |
python | def free_cache(ctx, *elts):
"""Free properties bound to input cached elts. If empty, free the whole
cache.
"""
for elt in elts:
if isinstance(elt, Hashable):
cache = __STATIC_ELEMENTS_CACHE__
else:
cache = __UNHASHABLE_ELTS_CACHE__
elt = id(elt)
... |
java | public boolean isUserTempDisabled(String username) {
Set<CmsUserData> data = TEMP_DISABLED_USER.get(username);
if (data == null) {
return false;
}
for (CmsUserData userData : data) {
if (!userData.isDisabled()) {
data.remove(userData);
... |
java | public static int getAStoreReg(final DismantleBytecode dbc, final int seen) {
if (seen == Const.ASTORE) {
return dbc.getRegisterOperand();
}
if (OpcodeUtils.isAStore(seen)) {
return seen - Const.ASTORE_0;
}
return -1;
} |
python | def long_encode(input, errors='strict'):
"""Transliterate to 8 bit using as many letters as needed.
For example, \u00e4 LATIN SMALL LETTER A WITH DIAERESIS ``ä`` will
be replaced with ``ae``.
"""
if not isinstance(input, text_type):
input = text_type(input, sys.getdefaultencoding(), errors... |
java | private int numberOfSessionsInTransaction(String xferId) {
int sessionCount = 0;
List<String> sessions = transactionSessions.get(xferId);
if(sessions != null)
sessionCount = sessions.size();
return sessionCount;
} |
python | def _check_and_flip(arr):
"""Transpose array or list of arrays if they are 2D."""
if hasattr(arr, 'ndim'):
if arr.ndim >= 2:
return arr.T
else:
return arr
elif not is_string_like(arr) and iterable(arr):
return tuple(_check_and_flip(a) for a in arr)
else:
... |
python | def rgb2hex(r: int, g: int, b: int) -> str:
""" Convert rgb values to a hex code. """
return '{:02x}{:02x}{:02x}'.format(r, g, b) |
python | def diskusage(*args):
'''
Return the disk usage for this minion
Usage::
salt '*' status.diskusage [paths and/or filesystem types]
CLI Example:
.. code-block:: bash
salt '*' status.diskusage # usage for all filesystems
salt '*' status.diskusage / /tmp # usage for... |
python | def copy(self, copy_backends=True, copy_default_backend=True,
copy_cache=None, copy_history=None):
"""Copy the circuit.
:params
copy_backends :bool copy backends if True.
copy_default_backend :bool copy default_backend if True.
"""
copied = Circuit(self.n_qu... |
java | @Override
public FlushModeType getFlushMode()
{
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
Tr.debug(tc, "em.getFlushMode() + getEmDebugString();\n" + toString());
return getEMInvocationInfo(false).getFlushMode();
} |
python | def _helioXYZ(self,*args,**kwargs):
"""Calculate heliocentric rectangular coordinates"""
obs, ro, vo= self._parse_radec_kwargs(kwargs)
thiso= self(*args,**kwargs)
if not len(thiso.shape) == 2: thiso= thiso.reshape((thiso.shape[0],1))
if len(thiso[:,0]) != 4 and len(thiso[:,0]) !=... |
python | def get_data(context, id, keys):
"""get_data(context, id, keys)
Retrieve data field from a remoteci.
>>> dcictl remoteci-get-data [OPTIONS]
:param string id: ID of the remote CI to show [required]
:param string id: Keys of the data field to retrieve [optional]
"""
if keys:
keys =... |
java | public void createInsertionSql(Database model, Platform platform, Writer writer) throws IOException
{
for (Iterator it = _beans.iterator(); it.hasNext();)
{
writer.write(platform.getInsertSql(model, (DynaBean)it.next()));
if (it.hasNext())
{
... |
java | public final void clear() {
items.clear();
iconCount = 0;
dividerCount = 0;
if (rawItems != null) {
rawItems.clear();
}
notifyOnDataSetChanged();
} |
python | def to_sint(self):
"""Converts the word to a BinInt, treating it as a signed number."""
if self._width == 0:
return BinInt(0)
sbit = 1 << (self._width - 1)
return BinInt((self._val - sbit) ^ -sbit) |
java | public void stop() {
if (log.isDebugEnabled()) {
log.debug("stop");
}
try {
engine.stop();
} catch (IllegalStateException e) {
if (log.isTraceEnabled()) {
log.warn("stop caught an IllegalStateException", e);
} else ... |
java | @Override
protected void doStart() {
log.info("{}: Starting.", this.traceObjectId);
Services.startAsync(this.durableLog, this.executor)
.thenComposeAsync(v -> startWhenDurableLogOnline(), this.executor)
.whenComplete((v, ex) -> {
if (ex == null) {... |
java | public static String checkSameNameRule( List<RuleWrapper> rulesWrapper, String ruleName ) {
int index = 1;
String name = ruleName.trim();
for( int i = 0; i < rulesWrapper.size(); i++ ) {
RuleWrapper ruleWrapper = rulesWrapper.get(i);
String tmpName = ruleWrapper.getName()... |
java | public static final String extractPackageName(String className) {
if (className == null || className.trim().isEmpty()) {
return "";
}
final int idx = className.lastIndexOf('.');
if (idx == -1) {
return "";
} else {
return className.substring(0, idx);
}
} |
python | def sbo_search_pkg(name):
"""Search for package path from SLACKBUILDS.TXT file and
return url
"""
repo = Repo().default_repository()["sbo"]
sbo_url = "{0}{1}/".format(repo, slack_ver())
SLACKBUILDS_TXT = Utils().read_file(
_meta_.lib_path + "sbo_repo/SLACKBUILDS.TXT")
for line in SLA... |
java | private boolean gatherCandidate(IceComponent component, InetAddress address, int startingPort, RtpPortManager portManager, Selector selector) {
// Recursion stop criteria
if(startingPort == portManager.peek()) {
return false;
}
// Gather the candidate using current port
try {
int port = portManager.c... |
java | @Override
public void initializeSpectator(TagList tags) {
Number n = numberRef.get();
if (n != null) {
SpectatorContext.polledGauge(baseConfig.withAdditionalTags(tags)).monitorValue(n);
}
} |
python | def checkInputParameter(method, parameters, validParameters, requiredParameters=None):
"""
Helper function to check input by using before sending to the server
:param method: Name of the API
:type method: str
:param validParameters: Allow parameters for the API call
:type validParameters: list
... |
python | def get_pij_matrix(t, diag, A, A_inv):
"""
Calculates the probability matrix of substitutions i->j over time t,
given the normalised generator diagonalisation.
:param t: time
:type t: float
:return: probability matrix
:rtype: numpy.ndarray
"""
return A.dot(np.diag(np.exp(diag * t))... |
java | SVG parse(InputStream is, boolean enableInternalEntities) throws SVGParseException
{
// Transparently handle zipped files (.svgz)
if (!is.markSupported()) {
// We need a a buffered stream so we can use mark() and reset()
is = new BufferedInputStream(is);
}
try
... |
java | public void processSpace(Properties properties) {
SparseDoubleVector empty = new CompactSparseVector();
for (Map.Entry<RelationTuple, SparseDoubleVector> e :
relationVectors.entrySet()) {
RelationTuple relation = e.getKey();
SparseDoubleVector relationCounts = e.g... |
java | public static BlockMasterInfo fromProto(alluxio.grpc.BlockMasterInfo info) {
return new BlockMasterInfo()
.setCapacityBytes(info.getCapacityBytes())
.setCapacityBytesOnTiers(info.getCapacityBytesOnTiersMap())
.setFreeBytes(info.getFreeBytes())
.setLiveWorkerNum(info.getLiveWorkerNum(... |
python | def perform_import(val, setting_name):
"""
If the given setting is a string import notation,
then perform the necessary import or imports.
"""
if val is None:
return None
elif isinstance(val, six.string_types):
return import_from_string(val, setting_name)
elif isinstance(val,... |
java | protected void executeWithNamedTemplate(Context context, String name)
throws EvaluationException {
assert (context != null);
assert (name != null);
Template template = null;
boolean runStatic = false;
try {
template = context.localLoad(name);
if (template == null) {
template = context.globalLo... |
python | def broadcast(cls, s1: ParamsList, s2: ParamsList) -> BroadcastTuple:
'''It broadcasts the smaller scope over the larger scope.
It handles scope intersection as well as differences in scopes
in order to output a resulting scope so that input scopes are
contained within it (i.e., input s... |
python | def get_attribute(self, name):
"""
Get (find) a I{non-attribute} attribute by name.
@param name: A attribute name.
@type name: str
@return: A tuple: the requested (attribute, ancestry).
@rtype: (L{SchemaObject}, [L{SchemaObject},..])
"""
for child, ancestr... |
java | public PropertyBuilder integer(final String name) {
name(name);
type(Property.Type.Integer);
return this;
} |
java | public BeanMappingObject getBeanMapObject(Class src, Class target, boolean autoRegister) {
BeanMappingObject object = autoRepository.getBeanMappingObject(src, target);
if (object == null && autoRegister) {
if (isMap(src)) {// 判断是否为map接口的子类
autoRepository.registerMap(target);
... |
python | def nps_surveys_1_update(self, data, **kwargs):
"https://developer.zendesk.com/rest_api/docs/nps-api/surveys#update-survey"
api_path = "/api/v2/nps/surveys/1"
return self.call(api_path, method="PUT", data=data, **kwargs) |
python | def export_public_key(user_id, env=None, sp=subprocess):
"""Export GPG public key for specified `user_id`."""
args = gpg_command(['--export', user_id])
result = check_output(args=args, env=env, sp=sp)
if not result:
log.error('could not find public key %r in local GPG keyring', user_id)
... |
python | def element_data_str(z, eldata):
'''Return a string with all data for an element
This includes shell and ECP potential data
Parameters
----------
z : int or str
Element Z-number
eldata: dict
Data for the element to be printed
'''
sym = lut.element_sym_from_Z(z, True)
... |
java | public void marshall(GetDeviceInstanceRequest getDeviceInstanceRequest, ProtocolMarshaller protocolMarshaller) {
if (getDeviceInstanceRequest == null) {
throw new SdkClientException("Invalid argument passed to marshall(...)");
}
try {
protocolMarshaller.marshall(getDevi... |
java | public static <T extends TypeDescription> ElementMatcher.Junction<T> isSuperTypeOf(TypeDescription type) {
return new SuperTypeMatcher<T>(type);
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.