language stringclasses 2
values | func_code_string stringlengths 63 466k |
|---|---|
java | public void put(String string,Object value)
{
if (frozen) throw new IllegalStateException("can't add new values to a frozen dictionary");
Set valset = (Set)valueMap.get(string);
if (valset==null) valueMap.put(string, (valset=new HashSet()));
valset.add( value );
} |
java | private double subspaceOutlierDegree(V queryObject, double[] center, long[] weightVector) {
final int card = BitsUtil.cardinality(weightVector);
if(card == 0) {
return 0;
}
final SubspaceEuclideanDistanceFunction df = new SubspaceEuclideanDistanceFunction(weightVector);
return df.distance(quer... |
java | public final boolean isRawTargetClassAnyOf(Class<?>... types) {
for (Class<?> type : types) {
if (type.equals(tt.rawTargetType())) {
return true;
}
}
return false;
} |
java | public void setStringAttribute(String name, String value) {
ensureValue();
Attribute attribute = new StringAttribute(value);
attribute.setEditable(isEditable(name));
getValue().getAllAttributes().put(name, attribute);
} |
java | @Override
public void paint(IReactionSet reactionSet, IDrawVisitor drawVisitor, Rectangle2D bounds, boolean resetCenter) {
// total up the bounding boxes
Rectangle2D totalBounds = BoundsCalculator.calculateBounds(reactionSet);
this.setupTransformToFit(bounds, totalBounds,
A... |
java | public static Pair<Optional<Table>, Optional<List<Partition>>> getDestinationTableMeta(String dbName,
String tableName, Properties props) {
Optional<Table> table = Optional.<Table>absent();
Optional<List<Partition>> partitions = Optional.<List<Partition>>absent();
try {
HiveMetastoreClientPool... |
java | public AppHelper add(String name, String displayValue, String description, Object defaultValue)
{
add(name, displayValue, description, defaultValue.toString());
return this;
} |
java | public void add(int field, int amount)
{
switch (field) {
case MONTH:
{
// We can't just do a set(MONTH, get(MONTH) + amount). The
// reason is ADAR_1. Suppose amount is +2 and we land in
// ADAR_1 -- then we have to bump to ADAR_2 aka A... |
java | public BufferResult getBody() {
BufferResult b = body;
if(b == null) return EmptyResult.getInstance();
return b;
} |
python | def set(self, obj, value):
"""Set value for obj's attribute.
:param obj: Result object or dict to assign the attribute to.
:param value: Value to be assigned.
"""
assert self.setter is not None, "Setter accessor is not specified."
if callable(self.setter):
re... |
java | @SuppressWarnings("unchecked")
private String keyspaceDefaultsToCQLString() {
// Default defaults:
boolean durable_writes = true;
Map<String, Object> replication = new HashMap<String, Object>();
replication.put("class", "SimpleStrategy");
replication.put("replication_factor",... |
java | @Indexable(type = IndexableType.REINDEX)
@Override
public CommerceNotificationQueueEntry updateCommerceNotificationQueueEntry(
CommerceNotificationQueueEntry commerceNotificationQueueEntry) {
return commerceNotificationQueueEntryPersistence.update(commerceNotificationQueueEntry);
} |
java | public static Object getValue(final Object current, final String property) {
return getDefinedValue(current, property).getValueResult().getOrElse(null);
} |
python | def get_stopbits():
"""
Returns supported stop bit lengths in a Django-like choices tuples.
"""
stopbits = []
s = pyserial.Serial()
for name, value in s.getSupportedStopbits():
stopbits.append((value, name,))
return tuple(stopbits) |
java | private synchronized Set<FilterModel> findFilterModels(
final Class<? extends Filter> filterClass) {
Set<FilterModel> foundFilterModels = null;
for (FilterModel filterModel : filterModels.values()) {
if (filterModel.getFilterClass() != null
&& filterModel.getFilterClass().equals(filterClass)) {
if (f... |
java | void firePropertyChildRemoved(TreeNodeRemovedEvent event) {
if (this.nodeListeners != null) {
for (final TreeNodeListener listener : this.nodeListeners) {
if (listener != null) {
listener.treeNodeChildRemoved(event);
}
}
}
final N parentNode = getParentNode();
if (parentNode != null) {
par... |
java | private Binding<?> createBinding(String key, Object requiredBy, ClassLoader classLoader,
boolean mustHaveInjections) {
String builtInBindingsKey = Keys.getBuiltInBindingsKey(key);
if (builtInBindingsKey != null) {
return new BuiltInBinding<Object>(key, requiredBy, classLoader, builtInBindingsKey);
... |
java | @Override
public boolean eIsSet(int featureID) {
switch (featureID) {
case AfplibPackage.GLINERG__XPOS:
return XPOS_EDEFAULT == null ? xpos != null : !XPOS_EDEFAULT.equals(xpos);
case AfplibPackage.GLINERG__YPOS:
return YPOS_EDEFAULT == null ? ypos != null : !YPOS_EDEFAULT.equals(ypos);
}
return su... |
java | public static Locale getLocale() {
String tag = Configuration.get("locale");
if (tag == null) {
return Locale.ROOT;
} else {
String[] splittedTag = tag.split("_", MAX_LOCALE_ARGUMENTS);
if (splittedTag.length == 1) {
return new Locale(splittedTag[0]);
} else if (splittedTag.length == 2) {
retu... |
python | def republish_collection(submitter, submitlog, next_minor_version,
collection_ident, plpy, revised=None):
"""Insert a new row for collection_ident with a new version.
Returns the module_ident of the row inserted.
"""
sql = '''
INSERT INTO modules (portal_type, moduleid, uui... |
java | public java.lang.String getVisibleDeviceList() {
java.lang.Object ref = visibleDeviceList_;
if (ref instanceof java.lang.String) {
return (java.lang.String) ref;
} else {
com.google.protobuf.ByteString bs =
(com.google.protobuf.ByteString) ref;
java.lang.String s = bs.toStringUt... |
java | public Vector<Object> getRequirementReferences(Vector<Object> requirementParams)
{
try
{
Requirement requirement = XmlRpcDataMarshaller.toRequirement( requirementParams );
List<Reference> references = service.getRequirementReferences( requirement );
log.debug( "... |
python | def keyPressEvent( self, event ):
"""
Overloads the keyPressEvent method to support backtab operations.
:param event | <QKeyPressEvent>
"""
if ( event.key() == Qt.Key_Backtab ):
self.unindentSelection()
else:
super(XScintilla... |
python | def handle_get_version_command(self):
""" Handles <get_version> command.
@return: Response string for <get_version> command.
"""
protocol = Element('protocol')
for name, value in [('name', 'OSP'), ('version', self.get_protocol_version())]:
elem = SubElement(protocol,... |
java | protected StringBuffer getHeaderSection(HttpServletRequest request) {
StringBuffer sb = new StringBuffer(mainScriptTemplate.toString());
sb.append("JAWR.app_context_path='").append(request.getContextPath()).append("';\n");
return sb;
} |
java | public static boolean isStaticWebpFormat(ImageFormat imageFormat) {
return imageFormat == WEBP_SIMPLE ||
imageFormat == WEBP_LOSSLESS ||
imageFormat == WEBP_EXTENDED ||
imageFormat == WEBP_EXTENDED_WITH_ALPHA;
} |
java | public static Locale getLocaleForName(String name) {
String suffix = getLocaleSuffixForName(CmsResource.getName(name));
if (suffix != null) {
String laguageString = suffix.substring(0, 2);
return suffix.length() == 5 ? new Locale(laguageString, suffix.substring(3, 5)) : new Loca... |
java | public Pooled<T> get(LogTarget lt) throws APIException {
Pooled<T> pt;
synchronized (list) {
if (list.isEmpty()) {
pt = null;
} else {
pt = list.remove();
--count;
creator.reuse(pt.content);
}
}
if (pt == null) {
if (spares < max_range)
++spares;
pt = new Pooled<T>(creator.cre... |
java | public void register(final String word, final String replacement) {
ArgUtils.notEmpty(word, "word");
ArgUtils.notNull(replacement, "replacement");
if(word.length() == 1) {
singles.computeIfAbsent(word.charAt(0), key -> replacement);
} else {
... |
java | public SDVariable var(@NonNull final SDVariable v) {
if (variables.containsKey(v.getVarName()) && variables.get(v.getVarName()).getVariable().getArr() != null)
return variables.get(v.getVarName()).getVariable();
if (v.getVarName() == null || v.getVarName().length() < 1)
throw ne... |
java | <T> WABTracker<T> getTracker(BundleTrackerCustomizer<T> wabTrackerCustomizer) {
try {
//we are interested in WABs that are starting (could be lazy activation)
//or already active
int mask = Bundle.STARTING | Bundle.ACTIVE;
return new WABTracker<T>(ctx, mask, wabTr... |
java | @Override
public void removeFrameworkProject(final String projectName){
synchronized (projectCache) {
removeSubDir(projectName);
projectCache.remove(projectName);
}
} |
python | def _objectify(self, node, binding, depth, path):
""" Given an RDF node URI (and it's associated schema), return an
object from the ``graph`` that represents the information available
about this node. """
if binding.is_object:
obj = {'$schema': binding.path}
for (... |
python | def copy_style():
r'''
Write all goose-styles to the relevant matplotlib configuration directory.
'''
import os
import matplotlib
# style definitions
# -----------------
styles = {}
styles['goose.mplstyle'] = '''
figure.figsize : 8,6
font.weight : normal
font.size : 16
axes... |
python | def getent(refresh=False, root=None):
'''
Return info on all groups
refresh
Force a refresh of group information
root
Directory to chroot into
CLI Example:
.. code-block:: bash
salt '*' group.getent
'''
if 'group.getent' in __context__ and not refresh:
... |
python | def flatten_op_tree(root: OP_TREE,
preserve_moments: bool = False
) -> Iterable[Union[Operation, Moment]]:
"""Performs an in-order iteration of the operations (leaves) in an OP_TREE.
Args:
root: The operation or tree of operations to iterate.
preserve_mom... |
python | async def register_user(self, password, **kwds):
"""
This function is used to provide a sessionToken for later requests.
Args:
uid (str): The
"""
# so make one
user = await self._create_remote_user(password=password, **kwds)
# if there is ... |
java | public static <I, O> JMConcurrentProcessor<I, O> buildWithThreadPool(
int workers, Function<I, O> transformerFunction) {
return new JMConcurrentProcessor<>(workers, transformerFunction);
} |
java | @Override
public void write (final byte [] aBuf, final int nOfs, final int nLen) throws IOException
{
if (nLen >= m_aBuf.length)
{
/*
* If the request length exceeds the size of the output buffer, flush the
* output buffer and then write the data directly. In this way buffered
* s... |
python | def _transform_value(value, policy, transform_type):
'''
helper function to transform the policy value into something that more
closely matches how the policy is displayed in the gpedit GUI
'''
t_kwargs = {}
if 'Transform' in policy:
if transform_type in policy['Transform']:
... |
java | public void marshall(SignOutUserRequest signOutUserRequest, ProtocolMarshaller protocolMarshaller) {
if (signOutUserRequest == null) {
throw new SdkClientException("Invalid argument passed to marshall(...)");
}
try {
protocolMarshaller.marshall(signOutUserRequest.getFle... |
java | public static String getArtifactoryDetailsLabelId(final String name, final VaadinMessageSource i18n) {
String caption;
if (StringUtils.hasText(name)) {
caption = i18n.getMessage(UIMessageIdProvider.CAPTION_ARTIFACT_DETAILS_OF,
HawkbitCommonUtil.getBoldHTMLText(name));
... |
python | def plot(self):
"""
After model execution, print the dataset, curve-fit, BMD, and BMDL.
Example
-------
>>> import os
>>> fn = os.path.expanduser('~/Desktop/image.png')
>>> fig = model.plot()
>>> fig.savefig(fn)
>>> fig.clear()
.. figure... |
java | public ConstructorWriterImpl getConstructorWriter(ClassWriter classWriter)
throws Exception {
return new ConstructorWriterImpl((SubWriterHolderWriter) classWriter,
classWriter.getClassDoc());
} |
java | private void setUpChild(View child) {
// Respect layout params that are already in the view. Otherwise
// make some up...
ViewGroup.LayoutParams lp = child.getLayoutParams();
if (lp == null) {
lp = generateDefaultLayoutParams();
}
addViewInLayout(child, 0, l... |
java | public int getEmptySize()
{
int size = 0;
for (int i = 0; i < getBaseArraySize(); i++)
{
if (isEmpty(i))
{
++size;
}
}
return size;
} |
python | def zGetUpdate(self):
"""Update the lens"""
status,ret = -998, None
ret = self._sendDDEcommand("GetUpdate")
if ret != None:
status = int(ret) #Note: Zemax returns -1 if GetUpdate fails.
return status |
java | public static CompletableFuture<Void> runAfterwardsAsync(
CompletableFuture<?> future,
RunnableWithException runnable,
Executor executor) {
final CompletableFuture<Void> resultFuture = new CompletableFuture<>();
future.whenCompleteAsync(
(Object ignored, Throwable throwable) -> {
try {
runnable.r... |
python | def get_rgb_image_as_bytes(self, format='png', quality=90):
"""Get the current image shown in the viewer, with any overlaid
graphics, in the form of a buffer in the form of bytes.
Parameters
----------
format : str
See :meth:`get_rgb_image_as_buffer`.
qualit... |
java | public void processRequest(String requestedPath, HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
StopWatch stopWatch = new StopWatch("Request Handling for '" + requestedPath + "'");
ThreadLocalJawrContext.setStopWatch(stopWatch);
stopWatch.start("Process reques... |
python | def _get_net_runner_opts():
'''
Return the net.find runner options.
'''
runner_opts = __opts__.get('runners', {}).get('net.find', {})
return {
'target': runner_opts.get('target', _DEFAULT_TARGET),
'expr_form': runner_opts.get('expr_form', _DEFAULT_EXPR_FORM),
'ignore_interfac... |
java | public static void parseUserInfo(String userInfo,
GuacamoleConfiguration config)
throws UnsupportedEncodingException {
Matcher userinfoMatcher = userinfoPattern.matcher(userInfo);
if (userinfoMatcher.matches()) {
String username = userinfoMatcher.group(USERNAME_GRO... |
java | public ServerHandle detect(MBeanServerExecutor pMBeanServerExecutor) {
String version = getSingleStringAttribute(pMBeanServerExecutor, "org.apache.activemq:type=Broker,*", "BrokerVersion");
if (version == null) {
return null;
}
return new ServerHandle("Apache","activemq",vers... |
python | def savePkeyPem(self, pkey, path):
'''
Save a private key in PEM format to a file outside the certdir.
'''
with s_common.genfile(path) as fd:
fd.write(crypto.dump_privatekey(crypto.FILETYPE_PEM, pkey)) |
python | def grid_track_backbone(lat,lon,sla,backlat,backlon,fill=None):
"""
# GRID_TRACK_BACKBONE
# @summary: This function allow detecting gaps in a set of altimetry data and rebin this data regularlyy, with informations on gaps.
# @param dst {type:numeric} : along-track distance.
# @param lat {type:n... |
python | def parse_param_signature(sig):
""" Parse a parameter signature of the form: type name (= default)? """
match = PARAM_SIG_RE.match(sig.strip())
if not match:
raise RuntimeError('Parameter signature invalid, got ' + sig)
groups = match.groups()
modifiers = groups[0].split()
typ, name, _, ... |
python | def get_task(config):
"""Read the task.json from work_dir.
Args:
config (dict): the running config, to find work_dir.
Returns:
dict: the contents of task.json
Raises:
ScriptWorkerTaskException: on error.
"""
path = os.path.join(config['work_dir'], "task.json")
mes... |
python | def _validate_auths(self, path, obj, app):
""" make sure that apiKey and basicAuth are empty list
in Operation object.
"""
errs = []
for k, v in six.iteritems(obj.authorizations or {}):
if k not in app.raw.authorizations:
errs.append('auth {0} not fou... |
java | protected void traceJobXML(String jobXML) {
if (logger.isLoggable(Level.FINE)) {
int concatLen = jobXML.length() > 200 ? 200 : jobXML.length();
logger.fine("Starting job: " + jobXML.substring(0, concatLen) + "... truncated ...");
}
} |
java | protected int getValueForInput(FacesContext context, UIInput component, String itemValue, Map<String, Object> valueArray,
Converter converter) {
try {
int retInt = 0;
if (itemValue == null || valueArray == null) {
return retInt;
}
... |
python | def cone_beam_geometry(space, src_radius, det_radius, num_angles=None,
short_scan=False, det_shape=None):
r"""Create a default fan or cone beam geometry from ``space``.
This function is intended for simple test cases where users do not
need the full flexibility of the geometries, but... |
python | def _rewrite_source(self, s):
"""
Mutate the source according to the per-task parameters.
"""
# While Ansible rewrites the #! using ansible_*_interpreter, it is
# never actually used to execute the script, instead it is a shell
# fragment consumed by shell/__init__.py::bu... |
python | def _reset(self, **kwargs):
"""
Reset after repopulating from API (or when initializing).
"""
# set object attributes from params
for key in kwargs:
setattr(self, key, kwargs[key])
# set defaults (if need be) where the default is not None
for attr in ... |
python | def setReadOnly(self, state):
"""
Sets whether or not this edit is read only.
:param state | <bool>
"""
self._readOnly = state
for editor in self.editors():
editor.setReadOnly(state) |
python | def compile(self, session=None):
"""
Before calling the standard compile function, check to see if the size
of the data has changed and add parameters appropriately.
This is necessary because the shape of the parameters depends on the
shape of the data.
"""
if no... |
java | double getRingArea(int path) {
if (isRingAreaValid_(path))
return m_path_areas.get(getPathIndex_(path));
Line line = new Line();
int vertex = getFirstVertex(path);
if (vertex == -1)
return 0;
Point2D pt0 = new Point2D();
getXY(vertex, pt0);
double area = 0;
for (int i = 0, n = getPathSize(path); ... |
python | def should_exclude(self, filename) -> bool:
"""
Should we exclude this file from consideration?
"""
for skip_glob in self.skip_globs:
if self.filename_matches_glob(filename, skip_glob):
return True
return False |
python | def PartialDynamicSystem(self, ieq, variable):
"""
returns dynamical system blocks associated to output variable
"""
if ieq == 0:
# U1=0
if variable == self.variables[0]:
return[Gain(self.commands[0], variable, -self.Tmax)] |
java | private void collectTransitiveCallees(TemplateData templateData, Set<TemplateData> visited) {
if (!visited.add(templateData)) {
return; // avoids chasing recursive cycles
}
for (String callee : templateData.callees) {
collectTransitiveCallees(getTemplateData(callee), visited);
}
for (Str... |
java | public static CloseableJobListener parallelJobListener(List<JobListener> jobListeners) {
Iterables.removeIf(jobListeners, Predicates.isNull());
return new ParallelJobListener(jobListeners);
} |
java | static <T, I extends ChronoInterval<T>> I parsePattern(
CharSequence text,
IntervalCreator<T, I> factory,
ChronoParser<T> parser,
String pattern
) throws ParseException {
ParseLog plog = new ParseLog();
String[] components = pattern.split("\\|");
for (String... |
java | public static Object streamIn(byte[] bytes, ClassLoader classLoader, boolean compressed)
throws IOException, ClassNotFoundException {
return streamIn(new ByteArrayInputStream(bytes), classLoader, compressed);
} |
java | @Override
public ListInstanceFleetsResult listInstanceFleets(ListInstanceFleetsRequest request) {
request = beforeClientExecution(request);
return executeListInstanceFleets(request);
} |
java | public ContentPackageBuilder property(String property, Object value) {
metadata.addProperty(property, value);
return this;
} |
java | public static double J(int n, double x) {
int j, m;
double ax, bj, bjm, bjp, sum, tox, ans;
boolean jsum;
double ACC = 40.0;
double BIGNO = 1.0e+10;
double BIGNI = 1.0e-10;
if (n == 0) return J0(x);
if (n == 1) return J(x);
ax = Math... |
python | def get_instance(self, payload):
"""
Build an instance of AssignedAddOnExtensionInstance
:param dict payload: Payload response from the API
:returns: twilio.rest.api.v2010.account.incoming_phone_number.assigned_add_on.assigned_add_on_extension.AssignedAddOnExtensionInstance
:rt... |
java | @Override
public void readExternal(ObjectInput in)
throws IOException, ClassNotFoundException {
int header = in.readByte();
switch (header) {
case NEGATIVE_DAY_OF_MONTH_PATTERN_TYPE:
this.obj = readPattern(in);
break;
default:
... |
python | def memoized_method(method=None, cache_factory=None):
""" Memoize a class's method.
Arguments are similar to to `memoized`, except that the cache container is
specified with `cache_factory`: a function called with no arguments to
create the caching container for the instance.
Note that, unlike `me... |
java | public Set<IoEventType> getEventsToProfile() {
Set<IoEventType> set = new HashSet<>();
if ( profileMessageReceived ) {
set.add(IoEventType.MESSAGE_RECEIVED);
}
if ( profileMessageSent) {
set.add(IoEventType.MESSAGE_SENT);
}
... |
python | def _toggle_autoescape(context, escape_on=True):
'''
Internal method to toggle autoescaping on or off. This function
needs access to the caller, so the calling method must be
decorated with @supports_caller.
'''
previous = is_autoescape(context)
setattr(context.caller_stack, AUTOESCAPE_KEY, ... |
java | public OvhAccountFullAccess service_account_email_fullAccess_allowedAccountId_GET(String service, String email, Long allowedAccountId) throws IOException {
String qPath = "/email/pro/{service}/account/{email}/fullAccess/{allowedAccountId}";
StringBuilder sb = path(qPath, service, email, allowedAccountId);
String ... |
python | def embedding_plot(ind, shap_values, feature_names=None, method="pca", alpha=1.0, show=True):
""" Use the SHAP values as an embedding which we project to 2D for visualization.
Parameters
----------
ind : int or string
If this is an int it is the index of the feature to use to color the embeddin... |
python | def addWCSKeywords(wcs,hdr,blot=False,single=False,after=None):
""" Update input header 'hdr' with WCS keywords.
"""
wname = wcs.wcs.name
if not single:
wname = 'DRZWCS'
# Update WCS Keywords based on PyDrizzle product's value
# since 'drizzle' itself doesn't update that keyword.
hd... |
python | def edit_preferences(self):
"""Edit Spyder preferences"""
from spyder.preferences.configdialog import ConfigDialog
dlg = ConfigDialog(self)
dlg.size_change.connect(self.set_prefs_size)
if self.prefs_dialog_size is not None:
dlg.resize(self.prefs_dialog_size)
... |
java | public static KeyStore load(InputStream in, char[] password) {
try {
KeyStore myTrustStore = KeyStore.getInstance(KeyStore.getDefaultType());
myTrustStore.load(in, password);
return myTrustStore;
} catch (CertificateException | NoSuchAlgorithmException | KeyStoreExce... |
java | @PostMapping("/importFile")
public ResponseEntity<String> importFile(
HttpServletRequest request,
@RequestParam(value = "file") MultipartFile file,
@RequestParam(value = "entityTypeId", required = false) String entityTypeId,
@RequestParam(value = "packageId", required = false) String packageId... |
python | def next_history(self, e): # (C-n)
u'''Move forward through the history list, fetching the next
command. '''
self._history.next_history(self.l_buffer)
self.finalize() |
python | def _load_strain_sequences(self, strain_gempro):
"""Load strain sequences from the orthology matrix into the base model for comparisons, and into the
strain-specific model itself.
"""
if self._orthology_matrix_has_sequences: # Load directly from the orthology matrix if it contains sequ... |
python | def _validate(self, writing=False):
"""Verify that the box obeys the specifications."""
if ((len(self.bits_per_component) != len(self.signed)) or
(len(self.signed) != self.palette.shape[1])):
msg = ("The length of the 'bits_per_component' and the 'signed' "
... |
python | def _replaceRenamedPairMembers(kerning, leftRename, rightRename):
"""
Populate the renamed pair members into the kerning.
"""
renamedKerning = {}
for (left, right), value in kerning.items():
left = leftRename.get(left, left)
right = rightRename.get(right, right)
renamedKernin... |
python | def get_config_value(self, section, name=None, config_file=None):
"""
Returns configuration value for a given [``section``] and ``name``.
:param section: Section we want to retrieve value from
:param name: Name of configuration we want to retrieve
:param config_file: A path to f... |
java | public SelectBuilder format(final String _pattern)
{
addPoint();
this.bldr.append("format[").append(_pattern).append("]");
return this;
} |
java | public static List<DCSubject> convertElementsSyndCategoryToSubject(final List<SyndCategory> cList) {
List<DCSubject> sList = null;
if (cList != null) {
sList = new ArrayList<DCSubject>();
for (int i = 0; i < cList.size(); i++) {
final SyndCategoryImpl sCat = (Synd... |
java | protected void setConflictAttributes(Change change) throws IllegalArgumentException {
// default values
change.setAcceptStatus(change.getImportedStatus());
change.setAcceptValue(change.getImportedValue());
if (useMasterValueFromFile) {
change.setAcceptMasterValue(change.getImportedMasterValue());
... |
java | public static String cleanString(String pStr) {
if (pStr == null || pStr.equals("")) {
return pStr;
}
StringBuffer buff = new StringBuffer();
for (int i = 0; i < pStr.length(); i++) {
char aChar = pStr.charAt(i);
if (Character.isLetterOrDigit(aChar)) {... |
java | @Nullable
@Override
public <FieldType> FieldType readValue(@NotNull Object object) {
Method readMethod = getReadMethod();
try {
return (FieldType) readMethod.invoke(object);
} catch (IllegalAccessException | InvocationTargetException | ClassCastException e) {
LOG... |
java | public static DesignContextMenu getInstance() {
Page page = ExecutionContext.getPage();
DesignContextMenu contextMenu = page.getAttribute(DesignConstants.ATTR_DESIGN_MENU, DesignContextMenu.class);
if (contextMenu == null) {
contextMenu = create();
page.setAttribute(Desi... |
python | def run(program, *args, **kwargs):
"""Run 'program' with 'args'"""
args = flattened(args, split=SHELL)
full_path = which(program)
logger = kwargs.pop("logger", LOG.debug)
fatal = kwargs.pop("fatal", True)
dryrun = kwargs.pop("dryrun", is_dryrun())
include_error = kwargs.pop("include_error",... |
python | def get_ap(self, apid):
"""查看接入点
给出接入点的域名或IP,查看配置信息,包括所有监听端口的配置。
Args:
- apid: 接入点ID
Returns:
返回一个tuple对象,其格式为(<result>, <ResponseInfo>)
- result 成功返回接入点信息,失败返回{"error": "<errMsg string>"}
- ResponseInfo 请求的Response信息
... |
java | static public int getAnalysisBitFromAxes(int axis)
{
switch (axis) // Generate new traverser
{
case Axis.ANCESTOR :
return BIT_ANCESTOR;
case Axis.ANCESTORORSELF :
return BIT_ANCESTOR_OR_SELF;
case Axis.ATTRIBUTE :
return BIT_ATTRIBUTE;
cas... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.