language stringclasses 2
values | func_code_string stringlengths 63 466k |
|---|---|
java | @Override public CharSequence format(final DayOfWeek dayOfWeek) {
return dayOfWeek.getDisplayName(TextStyle.SHORT, Locale.getDefault());
} |
java | protected String extractAttribute(String name, String line) {
int i = line.indexOf(name + "=\"");
i = i == -1 ? i : i + name.length() + 2;
int j = i == -1 ? -1 : line.indexOf("\"", i);
return j == -1 ? null : line.substring(i, j);
} |
java | public static Object[] convertParams(Object[] source, Class<?>[] target) throws ConversionException {
Object[] converted = new Object[target.length];
for (int i = 0; i < target.length; i++) {
converted[i] = convert(source[i], target[i]);
}
return converted;
} |
python | def simplified_pos(pos, tagset=None):
"""
Return a simplified POS tag for a full POS tag `pos` belonging to a tagset `tagset`. By default the WordNet
tagset is assumed.
Does the following conversion by default:
- all N... (noun) tags to 'N'
- all V... (verb) tags to 'V'
- all ADJ... (adjecti... |
java | public void setServiceErrors(java.util.Collection<ServiceError> serviceErrors) {
if (serviceErrors == null) {
this.serviceErrors = null;
return;
}
this.serviceErrors = new com.amazonaws.internal.SdkInternalList<ServiceError>(serviceErrors);
} |
python | def _gtu8(ins):
""" Compares & pops top 2 operands out of the stack, and checks
if the 1st operand > 2nd operand (top of the stack).
Pushes 0 if False, 1 if True.
8 bit unsigned version
"""
output = _8bit_oper(ins.quad[2], ins.quad[3], reversed_=True)
output.append('cp h')
o... |
python | def btc_address_reencode( address, **blockchain_opts ):
"""
Depending on whether or not we're in testnet
or mainnet, re-encode an address accordingly.
"""
# re-encode bitcoin address
network = blockchain_opts.get('network', None)
opt_version_byte = blockchain_opts.get('version_byte', None)
... |
python | def __lists_to_str(self):
"""
There are some data lists that we collected across the dataset that need to be concatenated into a single
string before writing to the text file.
:return none:
"""
# ["archive_type", "sensor_genus", "sensor_species", "investigator"]
i... |
python | def best_descriptive_meta_dict(path_to_bag_of_genomes, cluster_no):
"""
Computes the importance of each metadata by using tf * coverage (the percentage of the term occuring in a cluster)
:param path_to_bag_of_genomes: The directory path
:param cluster_no: cluster number
:param p... |
java | protected static Boolean isCharging(Context ctx) {
try {
Intent intent = ctx.registerReceiver(null, new IntentFilter(Intent.ACTION_BATTERY_CHANGED));
if (intent == null) {
return null;
}
int plugged = intent.getIntExtra(BatteryManager.EXTRA_PLUGGE... |
java | protected Stream<String> lines() throws IOException {
InputStream input = readFiles();
Reader reader = new InputStreamReader(input, UTF_8);
return new BufferedReader(reader).lines().map(String::trim)
.onClose(() -> Closeables.closeQuietly(input));
} |
python | def _from_derivatives(xi, yi, x, order=None, der=0, extrapolate=False):
"""
Convenience function for interpolate.BPoly.from_derivatives.
Construct a piecewise polynomial in the Bernstein basis, compatible
with the specified values and derivatives at breakpoints.
Parameters
----------
xi : ... |
java | public boolean isNew(String identifier)
{
ItemState lastState = changesLog.getItemState(identifier);
if (lastState == null || lastState.isDeleted())
{
return false;
}
return changesLog.getItemState(identifier, ItemState.ADDED) != null;
} |
java | public static Date valueOf(String s) {
final int YEAR_LENGTH = 4;
final int MONTH_LENGTH = 2;
final int DAY_LENGTH = 2;
final int MAX_MONTH = 12;
final int MAX_DAY = 31;
int firstDash;
int secondDash;
Date d = null;
if (s == null) {
th... |
java | @Pure
@Inline(value = "URISchemeType.JAR.isURL($1)", imported = {URISchemeType.class})
public static boolean isJarURL(URL url) {
return URISchemeType.JAR.isURL(url);
} |
java | public void setVariableOptEsc(String variableName, String variableValue) {
setVariable(variableName, escapeHtml(variableValue), true);
} |
python | def generate_prepared_request(method, url, headers, data, params, handlers):
"""Add handlers and prepare a Request.
Parameters
method (str)
HTTP Method. (e.g. 'POST')
headers (dict)
Headers to send.
data (JSON-formatted str)
Body to attach to the requ... |
java | private void fireTangoPeriodicEvent(TangoPeriodic tangoPeriodic, EventData eventData) {
TangoPeriodicEvent tangoPeriodicEvent = new TangoPeriodicEvent(tangoPeriodic, eventData);
// Notifying those that are interested in this event
ArrayList<EventListener> listeners = event_listeners.getListeners... |
java | public DoubleBuffer get(int index, DoubleBuffer dest) {
MemUtil.INSTANCE.put(this, index, dest);
return dest;
} |
java | @SuppressWarnings("unchecked")
protected boolean executeOneCompleteStmt(final String _complStmt,
final List<OneSelect> _oneSelects)
throws EFapsException
{
boolean ret = false;
ConnectionResource con = null;
try {
AbstractP... |
java | @XmlElementDecl(namespace = "http://docs.oasis-open.org/ns/cmis/messaging/200908/", name = "includeRelativePathSegment", scope = GetObjectParents.class)
public JAXBElement<Boolean> createGetObjectParentsIncludeRelativePathSegment(
Boolean value) {
return new JAXBElement<Boolean>(
_GetObjectParentsIncludeR... |
java | @Override
public boolean canHandleData(IoBuffer data) {
boolean result = false;
if (data.limit() > 0) {
// read the first byte and ensure its AVC / h.264 type
result = ((data.get() & 0x0f) == VideoCodec.AVC.getId());
data.rewind();
}
return... |
java | public ProjectTaskInner get(String groupName, String serviceName, String projectName, String taskName) {
return getWithServiceResponseAsync(groupName, serviceName, projectName, taskName).toBlocking().single().body();
} |
python | def _needs_dependencies(p_function):
"""
A decorator that triggers the population of the dependency tree in a
TodoList (and other administration). The decorator should be applied to
methods of TodoList that require dependency information.
"""
def build_dependency_information(p_todolist):
... |
java | private Time parseTime(String timeString)
throws ParseException {
// Return null if no time provided
java.util.Date parsedDate = TimeField.parse(timeString);
if (parsedDate == null)
return null;
// Convert to SQL Time
return new Time(parsedDate.getTime());
... |
java | public final String formatRfc3966(final String pphoneNumber, final String pcountryCode) {
return this.formatRfc3966(this.parsePhoneNumber(pphoneNumber, pcountryCode));
} |
python | async def send_video_note(self, chat_id: typing.Union[base.Integer, base.String],
video_note: typing.Union[base.InputFile, base.String],
duration: typing.Union[base.Integer, None] = None,
length: typing.Union[base.Integer, None] =... |
python | def set_exit_callback(self, callback: Callable[[int], None]) -> None:
"""Runs ``callback`` when this process exits.
The callback takes one argument, the return code of the process.
This method uses a ``SIGCHLD`` handler, which is a global setting
and may conflict if you have other libr... |
java | void verifyProcess(VerifyServer verifyServer, LaunchArguments createOptions) throws LaunchException {
if (verifyServer == null || verifyServer == VerifyServer.SKIP) {
return;
}
boolean generatePassword = createOptions == null || createOptions.getOption("no-password") == null;
... |
java | public void setProperty(String strParam, String strValue)
{
if (strValue != null)
m_properties.put(strParam, strValue);
else
m_properties.remove(strParam);
} |
java | public com.google.api.ads.adwords.axis.v201809.cm.PolicyTopicEntryType getPolicyTopicEntryType() {
return policyTopicEntryType;
} |
java | public void getLegendInfo(String[] ids, Callback<List<Legend>> callback) throws GuildWars2Exception, NullPointerException {
isParamValid(new ParamChecker(ids));
gw2API.getLegendInfo(processIds(ids)).enqueue(callback);
} |
java | public static <T> T[] init(T[] self) {
if (self.length == 0) {
throw new NoSuchElementException("Cannot access init() for an empty Object array");
}
T[] result = createSimilarArray(self, self.length - 1);
System.arraycopy(self, 0, result, 0, self.length - 1);
return r... |
java | private void processProjectProperties() throws SQLException
{
//
// Process common attributes
//
List<Row> rows = getRows("select * from " + m_schema + "project where proj_id=?", m_projectID);
m_reader.processProjectProperties(rows, m_projectID);
//
// Process PMDB-specific... |
python | def update_subnet_db_info(self, tenant_id, direc, net_id, subnet_id):
"""Update the subnet DB with Net and Subnet ID, given the subnet. """
subnet_dict = self.retrieve_dcnm_subnet_info(tenant_id, direc)
if not subnet_dict:
LOG.error("Subnet dict not found for tenant %s", tenant_id)
... |
python | def group_set(self, rule_id, session, add_groups=None, delete_groups=None):
'''taobao.crm.rule.group.set 设置规则适用的分组
将规则应用或取消应用到分组上,add_groups和delete_groups,两个参数最少填写一个。'''
request = TOPRequest('taobao.crm.rule.delete')
request['rule_id'] = rule_id
if add_groups!=None: requ... |
python | def getclientloansurl(idclient, *args, **kwargs):
"""Request Client loans URL.
How to use it? By default MambuLoan uses getloansurl as the urlfunc.
Override that behaviour by sending getclientloansurl (this function)
as the urlfunc to the constructor of MambuLoans (note the final 's')
and voila! yo... |
java | public void initialize(ClientMapInfo mapInfo) {
// remove previous members
super.removeMembers(getMembers());
// add new members
ClientToolbarInfo toolbarInfo = mapInfo.getToolbar();
if (toolbarInfo != null) {
for (ClientToolInfo tool : toolbarInfo.getTools()) {
String id = tool.getToolId();
if (T... |
java | public void run(final String[] args) throws CLIToolException {
PropertyConfigurator.configure(Constants.getLog4jPropertiesFile().getAbsolutePath());
CommandLine cli = parseArgs(args);
validateOptions(cli,args);
go();
} |
java | @Nullable
private Pattern pronomPattern(AnalyzedTokenReadings aToken) {
if (matchPostagRegexp(aToken,VERB_1S) && matchPostagRegexp(aToken,VERB_3S))
return PRONOM_FEBLE_13S;
if (matchPostagRegexp(aToken,VERB_2S) && matchPostagRegexp(aToken,VERB_3S))
return PRONOM_FEBLE_23S;
else if (matchPostag... |
java | @Nullable
public static Long parseUnsignedIntObj (@Nullable final String sStr, @Nullable final Long aDefault)
{
return parseUnsignedIntObj (sStr, DEFAULT_RADIX, aDefault);
} |
java | public void addNavButtons()
{
new SCannedBox(this.getNextLocation(ScreenConstants.FIRST_SCREEN_LOCATION, ScreenConstants.SET_ANCHOR), this, null, ScreenConstants.DEFAULT_DISPLAY, null, null, JCalendarPopup.CALENDAR_ICON, ProjectTask.PROJECT_TASK_CALENDAR_SCREEN, ProjectTask.PROJECT_TASK_CALENDAR_SCREEN);
... |
java | public String trimAndCollapseFrom(CharSequence sequence, char replacement) {
// This implementation avoids unnecessary allocation.
int len = sequence.length();
int first;
int last;
for (first = 0; first < len && matches(sequence.charAt(first)); first++) {}
for (last = len - 1; last > first && m... |
python | def clean_bootstrap_builds(self, _args):
"""Delete all the bootstrap builds."""
if exists(join(self.ctx.build_dir, 'bootstrap_builds')):
shutil.rmtree(join(self.ctx.build_dir, 'bootstrap_builds')) |
python | def _proxy(self):
"""
Generate an instance context for the instance, the context is capable of
performing various actions. All instance actions are proxied to the context
:returns: TaskContext for this TaskInstance
:rtype: twilio.rest.taskrouter.v1.workspace.task.TaskContext
... |
python | def triangle_normal(tri):
""" Computes the (approximate) normal vector of the input triangle.
:param tri: triangle object
:type tri: elements.Triangle
:return: normal vector of the triangle
:rtype: tuple
"""
vec1 = vector_generate(tri.vertices[0].data, tri.vertices[1].data)
vec2 = vecto... |
java | public void closeAll(CmsDbContext dbc, Connection con, Statement stmnt, ResultSet res) {
// NOTE: we have to close Connections/Statements that way, because a dbcp PoolablePreparedStatement
// is not a DelegatedStatement; for that reason its not removed from the trace of the connection when it is closed... |
java | @Override
public CommercePaymentMethodGroupRel remove(Serializable primaryKey)
throws NoSuchPaymentMethodGroupRelException {
Session session = null;
try {
session = openSession();
CommercePaymentMethodGroupRel commercePaymentMethodGroupRel = (CommercePaymentMethodGroupRel)session.get(CommercePaymentMetho... |
python | def insert_ordered(value, array):
"""
This will insert the value into the array, keeping it sorted, and returning the
index where it was inserted
"""
index = 0
# search for the last array item that value is larger than
for n in range(0,len(array)):
if value >= array[n]: index = n+1... |
python | def fix_lockfile(self):
"""Run each line of outfile through fix_pin"""
with open(self.outfile, 'rt') as fp:
lines = [
self.fix_pin(line)
for line in self.concatenated(fp)
]
with open(self.outfile, 'wt') as fp:
fp.writelines([
... |
java | public void paint(Paintable paintable, Object group, MapContext context) {
RasterTile tile = (RasterTile) paintable;
context.getRasterContext().drawImage(tile.getStore().getLayer(),
tile.getCode().toString(), tile.getUrl(), tile.getBounds(), new PictureStyle(1.0));
} |
java | @Nonnull
public String getStringWithFallback (@Nonnull final Charset aFallbackCharset)
{
final String sCharset = getCharSet ();
final Charset aCharset = CharsetHelper.getCharsetFromNameOrDefault (sCharset, aFallbackCharset);
return getString (aCharset);
} |
python | def write(self, char):
""" Display a single character on the display
:type char: str or int
:param char: Character to display
"""
char = str(char).lower()
self.segments.write(self.font[char]) |
java | public void saveReplyDestination(JmsMessage jmsMessage, TestContext context) {
if (jmsMessage.getReplyTo() != null) {
String correlationKeyName = endpointConfiguration.getCorrelator().getCorrelationKeyName(getName());
String correlationKey = endpointConfiguration.getCorrelator().getCorre... |
python | def get_font_path(self):
"""Return the current font path as a list of strings."""
r = request.GetFontPath(display = self.display)
return r.paths |
java | private void initialize() {
this.setLayout(new CardLayout());
this.setName(Constant.messages.getString("variant.options.title"));
this.add(getPanelScanner(), getPanelScanner().getName());
} |
java | @Override
public <T> Streamlet<T> flatMap(
SerializableFunction<R, ? extends Iterable<? extends T>> flatMapFn) {
checkNotNull(flatMapFn, "flatMapFn cannot be null");
FlatMapStreamlet<R, T> retval = new FlatMapStreamlet<>(this, flatMapFn);
addChild(retval);
return retval;
} |
java | protected void prepareMouseEvents(StringBuffer handlers) {
prepareAttribute(handlers, "onclick", getAttribute("onclick"));
prepareAttribute(handlers, "ondblclick", getAttribute("ondblclick"));
prepareAttribute(handlers, "onmouseover", getAttribute("onmouseover"));
prepareAttribute(handlers, "onmouseout", getAtt... |
java | private Map<String, TypeName> convertPropertiesToTypes(Map<String, ExecutableElement> properties) {
Map<String, TypeName> types = new LinkedHashMap<>();
for (Map.Entry<String, ExecutableElement> entry : properties.entrySet()) {
ExecutableElement el = entry.getValue();
types.put(entry.getKey(), TypeN... |
java | static String[] toNoNullStringArray(final Object[] array) {
final List<String> list = new ArrayList<>(array.length);
for (final Object e : array) {
if (e != null) {
list.add(e.toString());
}
}
return list.toArray(ArrayUtils.EMPTY_STRING_ARRAY);
... |
python | def dir_exists(location, use_sudo=False):
"""Tells if there is a remote directory at the given location."""
with settings(hide('running', 'stdout', 'stderr'), warn_only=True):
if use_sudo:
# convert return code 0 to True
return not bool(sudo('test -d %s' % (location)).return_code... |
python | def _highlight_line_difflib(self, line, next):
"""
Highlight inline changes in both lines.
"""
if line['action'] == 'del':
old, new = line, next
else:
old, new = next, line
oldwords = re.split(r'(\W)', old['line'])
newwords = re.split(r'(... |
python | def fence_draw_callback(self, points):
'''callback from drawing a fence'''
self.fenceloader.clear()
if len(points) < 3:
return
self.fenceloader.target_system = self.target_system
self.fenceloader.target_component = self.target_component
bounds = mp_util.polygo... |
python | def setNetworkKey(self, key):
"""set Thread Network master key
Args:
key: Thread Network master key used in secure the MLE/802.15.4 packet
Returns:
True: successful to set the Thread Network master key
False: fail to set the Thread Network master key
... |
java | public List<AlignedExpressionTree> getBestAlignments(AlignmentExample example, int beamSize) {
CfgParser parser = getCfgParser(example);
ExpressionTree tree = example.getTree();
Factor rootFactor = getRootFactor(tree, parser.getParentVariable());
List<CfgParseTree> parseTrees = parser.beamSear... |
python | def da2cf(dataarray, epoch=EPOCH):
"""Convert the dataarray to something cf-compatible."""
new_data = dataarray.copy()
# Remove the area
new_data.attrs.pop('area', None)
anc = [ds.attrs['name']
for ds in new_data.attrs.get('ancillary_variables', [])]
if a... |
python | def unmount(self, allow_lazy=False):
"""Unounts the volume from the filesystem.
:raises SubsystemError: if one of the underlying processes fails
:raises CleanupError: if the cleanup fails
"""
for volume in self.volumes:
try:
volume.unmount(allow_lazy... |
java | @Override
public void delete(final String sagaId) {
checkNotNull(sagaId, "Saga id key must be set.");
synchronized (sync) {
StateStorageItem removedItem = storedStates.remove(sagaId);
if (removedItem != null) {
removeInstancesForItem(removedItem);
... |
python | def quote(self, s):
"""Return a shell-escaped version of the string s."""
if six.PY2:
from pipes import quote
else:
from shlex import quote
return quote(s) |
java | public void setCalendar(int year, int month, int dayOfMonth, int hour, int minute, int second) {
this.year = year;
this.month = month;
this.dayOfMonth = dayOfMonth;
this.hour = hour;
this.minute = minute;
this.second = second;
this.createCalendar();
} |
java | public String getStringMazeFilled(Collection<Point> points, char symbol) {
Map<Point, Character> replacements = new HashMap<Point, Character>();
for (Point p : points) {
replacements.put(p, symbol);
}
return getReplacedMazeString(Collections.singletonList(replacements));
... |
python | def get_heat_capacity(self, temperature, structure, n, u, cutoff=1e2):
"""
Gets the directional heat capacity for a higher order tensor
expansion as a function of direction and polarization.
Args:
temperature (float): Temperature in kelvin
structure (float): Stru... |
python | def use_comparative_assessment_taken_view(self):
"""Pass through to provider AssessmentTakenLookupSession.use_comparative_assessment_taken_view"""
self._object_views['assessment_taken'] = COMPARATIVE
# self._get_provider_session('assessment_taken_lookup_session') # To make sure the session is tr... |
java | public synchronized void resetProcessingShareRequests() {
SQLiteDatabase db = null;
try {
db = getWritableDatabase();
// Update state back to pending.
ContentValues values = new ContentValues();
values.put(ShareRequestTable.COLUMN_STATE, ShareRequest.STAT... |
python | def links(self, r_server=None, mask=None):
"""
Get LINKS information.
Optional arguments:
* r_server=None - Forward the query to this server.
* mask=None - Match mask servers.
"""
with self.lock:
if not r_server:
self.send('LINKS')
... |
python | def add_or_update(user_id, post_id, kind):
'''
Create the record if new, else update it.
'''
rec = MUsage.query_by_signature(user_id, post_id)
cate_rec = MInfor2Catalog.get_first_category(post_id)
if cate_rec:
cat_id = cate_rec.tag_id
else:
... |
java | private void processFile(InputStream is) throws MPXJException
{
int line = 1;
try
{
//
// Test the header and extract the separator. If this is successful,
// we reset the stream back as far as we can. The design of the
// BufferedInputStream class means that we... |
java | final protected AbstractIndexPage getPrevInnerPage(AbstractIndexPage indexPage) {
int pos = getPagePosition(indexPage);
if (pos > 0) {
AbstractIndexPage page = getPageByPos(pos-1);
if (page.isLeaf) {
return null;
}
return page;
}
if (getParent() == null) {
return null;
}
//TODO we really ... |
java | public Observable<List<Domain>> getDomainsAsync() {
return getDomainsWithServiceResponseAsync().map(new Func1<ServiceResponse<List<Domain>>, List<Domain>>() {
@Override
public List<Domain> call(ServiceResponse<List<Domain>> response) {
return response.body();
... |
java | private static String getMethodName(MethodSymbol methodSym) {
return String.format("%s#%s", methodSym.owner, methodSym.getSimpleName());
} |
python | def positional(max_pos_args):
"""A decorator to declare that only the first N arguments may be positional.
Note that for methods, n includes 'self'.
"""
__ndb_debug__ = 'SKIP'
def positional_decorator(wrapped):
if not DEBUG:
return wrapped
__ndb_debug__ = 'SKIP'
@wrapping(wrapped)
def... |
python | def launch_run(self, command, project=None, entity=None, run_id=None):
"""Launch a run in the cloud.
Args:
command (str): The command to run
program (str): The file to run
project (str): The project to scope the runs to
entity (str, optional): The entity ... |
java | public void loadWords(InputStream is, int wordType) throws IOException{
BufferedReader br = new BufferedReader(new InputStreamReader(is));
String w = null;
while ((w=br.readLine()) != null){
// Don't trim it, in case the word itself is blank. w = w.trim();
Word word = new Word();
word.setWord(w);... |
java | public static Name
fromAddress(String addr, int family) throws UnknownHostException {
byte [] array = Address.toByteArray(addr, family);
if (array == null)
throw new UnknownHostException("Invalid IP address");
return fromAddress(array);
} |
java | @Override
public void visit(ControllerModel element, Raml raml) {
raml.setTitle(element.getName());
if (element.getDescription() != null && !element.getDescription().isEmpty()) {
DocumentationItem doc = new DocumentationItem();
doc.setContent(element.getDescription());
... |
java | public T handle(List<QueryParameters> outputList) throws MjdbcException {
return (T) this.outputProcessor.toBean(outputList, this.type);
} |
java | public static LongChromosome of(final LongRange range, final int length) {
return of(range.getMin(), range.getMax(), length);
} |
python | def rank_all(self,roots,optimize=False):
"""Computes rank of all vertices.
add provided roots to rank 0 vertices,
otherwise update ranking from provided roots.
The initial rank is based on precedence relationships,
optimal ranking may be derived from network flow (simplex).
... |
java | public void setMedID(byte[] newMedID) {
byte[] oldMedID = medID;
medID = newMedID;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, AfplibPackage.OBJECT_ORIGIN_IDENTIFIER__MED_ID, oldMedID, medID));
} |
python | def BEDIterator(filehandle, sortedby=None, verbose=False, scoreType=int,
dropAfter=None):
"""
Get an iterator for a BED file
:param filehandle: this can be either a string, or a stream-like object. In
the former case, it is treated as a filename. The format
... |
python | def start(self):
"""
Start the WBEM listener threads, if they are not yet running.
A thread serving CIM-XML over HTTP is started if an HTTP port was
specified for the listener.
A thread serving CIM-XML over HTTPS is started if an HTTPS
port was specified for the listener... |
java | public void addContextMenuTreeListener(
CmsContextMenu.ContextMenuOpenedListener.TreeListener contextMenuTreeListener) {
addListener(
ContextMenuOpenedOnTreeItemEvent.class,
contextMenuTreeListener,
ContextMenuOpenedListener.TreeListener.MENU_OPENED_FROM_TREE_ITEM_ME... |
python | def search_media(self,**kwargs):
"""
mq Search Query in iDigBio Query Format, using Media Query Fields
rq Search Query in iDigBio Query Format, using Record Query Fields
sort field to sort on, pick from Media Query Fields
fields a list of fields to return, s... |
python | def hash_file(path, saltenv='base'):
'''
Return the hash of a file, to get the hash of a file on the
salt master file server prepend the path with salt://<file on server>
otherwise, prepend the file with / for a local file.
CLI Example:
.. code-block:: bash
salt '*' cp.hash_file salt:... |
python | def get_files(cls, folder, session_id=''):
""" Retrieve the list of files the plugin can work on.
Find this list based on the files name, files extension or even
actually by reading in the file.
If a session identifier is specified it will restrict the list
of files returned to t... |
java | public static <T extends ModifierReviewable.OfByteCodeElement> ElementMatcher.Junction<T> isPublic() {
return new ModifierMatcher<T>(ModifierMatcher.Mode.PUBLIC);
} |
java | @SuppressWarnings("unchecked")
@Override
public void eSet(int featureID, Object newValue) {
switch (featureID) {
case AfplibPackage.MBCRG__RG_LENGTH:
setRGLength((Integer)newValue);
return;
case AfplibPackage.MBCRG__TRIPLETS:
getTriplets().clear();
getTriplets().addAll((Collection<? extends Tr... |
java | private int read(byte[] bytes, int offset, int length, Duration receiveTimeout)
throws InterruptedException, TTransportException
{
long timeRemaining = receiveTimeout.roundTo(TimeUnit.NANOSECONDS);
lock.lock();
try {
while (!closed) {
int bytesAvailabl... |
java | public Person getChild() {
final Person toPerson = (Person) find(getToString());
if (toPerson == null) {
return new Person();
}
return toPerson;
} |
python | def get_alert(self, nbprocess=0, countmin=None, countmax=None, header="", log=False):
"""Return the alert status relative to the process number."""
if nbprocess is None:
return 'OK'
if countmin is None:
countmin = nbprocess
if countmax is None:
countma... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.