language stringclasses 2
values | func_code_string stringlengths 63 466k |
|---|---|
java | public void bindUpTo(Phase phase)
{
for (Binding<?, ?, V> binding : bindings)
{
binding.bindUpTo(phase);
}
} |
python | def polygon(self, edge_style, pat, points, shadow=None):
"""Draw a polygon with EDGE_STYLE, fill with PAT, and the edges
POINTS. POINTS is a sequence of coordinates, e.g., ((10,10), (15,5),
(20,8)). SHADOW is either None or a tuple (XDELTA, YDELTA,
fillstyle). If non-null, a shadow of FI... |
java | @Nonnull
public static <T> LToByteFunctionBuilder<T> toByteFunction(Consumer<LToByteFunction<T>> consumer) {
return new LToByteFunctionBuilder(consumer);
} |
python | def _readClusterSettings(self):
"""
Reads the cluster settings from the instance metadata, which assumes the instance
is the leader.
"""
instanceMetaData = get_instance_metadata()
region = zoneToRegion(self._zone)
conn = boto.ec2.connect_to_region(region)
... |
python | def commandline (self, argv):
"""Run as if invoked from the command line. 'argv' is a Unix-style list of
arguments, where the zeroth item is the program name (which is ignored
here). Usage help is printed if deemed appropriate (e.g., no arguments
are given). This function always terminat... |
python | def compare_csv_decimal_files(file1, file2, header=True, timeseries=False):
"""
This function compares two csv files
"""
# CHECK NUM LINES
with open_csv(file1) as fh1, \
open_csv(file2) as fh2:
assert sum(1 for _ in fh1) == sum(1 for _ in fh2)
with open_csv(file1) as fh1, \
... |
java | public final void addBin(@NotNull final BinClasspathEntry entry) {
Contract.requireArgNotNull("entry", entry);
if (binList == null) {
binList = new ArrayList<>();
}
binList.add(entry);
} |
python | def process_app_config(config, config_data):
""" Populates config with data from the configuration data dict. It handles
everything that process_config does plus application section.
:param config: The config reference of the object that will hold the
configuration data from the config_data.
:param... |
java | @NotNull
public ByteBuf take() {
assert hasRemaining();
ByteBuf buf = bufs[first];
first = next(first);
return buf;
} |
java | @Override
public IPortalUrlBuilder getPortalUrlBuilderByPortletFName(
HttpServletRequest request, String portletFName, UrlType urlType) {
final IPortletWindow portletWindow =
this.portletWindowRegistry.getOrCreateDefaultPortletWindowByFname(
request, portl... |
python | def addTurtlePathToSVG(self, svgContainer):
"""Adds the paths of the turtle to an existing svg container.
"""
for element in self.getSVGElements():
svgContainer.addElement(element)
return svgContainer |
java | public void processResources(List<Row> permanentRows, List<Row> consumableRows)
{
//
// Process permanent resources
//
for (Row row : permanentRows)
{
Resource resource = m_project.addResource();
resource.setType(ResourceType.WORK);
resource.setUniqueID(row.ge... |
python | def set_categories(self,
category_name,
not_category_names=[],
neutral_category_names=[]):
'''
Specify the category to score. Optionally, score against a specific set of categories.
'''
tdf = self.term_ranker_.get_ranks... |
java | @Override
public void init(ServletConfig servletConfig) throws ServletException {
this.servletConfig = servletConfig;
String isDisableAddressUpdates = servletConfig.getInitParameter(DISABLE_ADDRESS_UPDATES);
if (!StringUtils.isEmpty(isDisableAddressUpdates)) {
this.disableAddres... |
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: WorkerStatisticsContext for this WorkerStatisticsInstance
:rtype: twilio.rest.taskrouter.v1.works... |
java | public static RAExpression naturalJoin(RAExpression re1, RAExpression re2, TermFactory termFactory) throws IllegalJoinException {
ImmutableSet<QuotedID> shared =
RAExpressionAttributes.getShared(re1.attributes, re2.attributes);
RAExpressionAttributes attributes =
RAExpr... |
java | public void add(Key k, byte[] vByte) throws IllegalArgumentException {
vByte = Arrays.copyOf(vByte, vByte.length);
if (key == null) {
key = new Key(k);
add(k.getTimestamp(), vByte);
} else if (key.equals(k, PartialKey.ROW_COLFAM_COLQUAL_COLVIS)) {
add(k.getTimestamp(), vByte);
} else ... |
java | private Object[] findIdsByColumn(String tableName, String columnName, Object columnValue)
{
Object connection = null;
try
{
connection = getConnection();
String valueAsStr = PropertyAccessorHelper.getString(columnValue);
Set<String> results = null;
... |
python | def list_mutable_configs(pipette_id: str) -> Dict[str, Any]:
"""
Returns dict of mutable configs only.
"""
cfg: Dict[str, Any] = {}
if pipette_id in known_pipettes():
config = load_config_dict(pipette_id)
else:
log.info('Pipette id {} not found'.format(pipette_id))
retur... |
java | public final void execute () throws InternetSCSIException {
final SettingsMap loginParameters = connection.getSettings();
LOGGER.info("Sending these login parameters:\n" + loginParameters);
final int maxRecvDataSegmentLength = connection.getSettingAsInt(OperationalTextKey.MAX_RECV_DATA_SEGMENT... |
java | @Subscribe
public synchronized void renew(final MasterSlaveRuleChangedEvent masterSlaveRuleChangedEvent) {
if (getName().equals(masterSlaveRuleChangedEvent.getShardingSchemaName())) {
masterSlaveRule = new OrchestrationMasterSlaveRule(masterSlaveRuleChangedEvent.getMasterSlaveRuleConfiguration()... |
python | def execute_all(self):
"""
Execute all workflows
"""
for workflow_id in self.workflows:
if self.workflows[workflow_id].online:
for interval in self.workflows[workflow_id].requested_intervals:
logging.info("Executing workflow {} over interva... |
java | public boolean setPublicKey (String key)
{
return key == null ? false : setPublicKey(SecureUtil.stringToRSAPublicKey(key));
} |
java | public void pivot(final Sheet pivotSourceSheet, final Sheet pivotTargetSheet) {
sourceSheet = pivotSourceSheet;
targetSheet = pivotTargetSheet;
annotations = new AnnotationList(new ArrayList<AnnotationTriplet>());
getAnnotationsFromSource();
setOffsets();
validateAndAda... |
java | SignerInfo verify(PKCS7 block, InputStream inputStream)
throws NoSuchAlgorithmException, SignatureException, IOException {
try {
ContentInfo content = block.getContentInfo();
if (inputStream == null) {
inputStream = new ByteArrayInputStream(content.getContentBytes())... |
java | protected String getCNonce(){
Double d = Math.floor(Math.random()*16777215);
return Long.toHexString(Double.doubleToRawLongBits( d ));
} |
java | private static String normalizePath(String path) {
if (path == null || path.isEmpty() || "/".equals(path)) {
return "/*";
}
if (isValidFilePath(path)) {
return path;
}
if (isValidDirPath(path)) {
if (path.endsWith("/")) {
return... |
java | protected void initializeAdbConnection() {
// Get a device bridge instance. Initialize, create and restart.
try {
AndroidDebugBridge.init(false);
} catch (IllegalStateException e) {
if (!shouldKeepAdbAlive) {
log.log(
Level.WARNING,
"AndroidDebugBridge may have be... |
python | def _format_count_file(count_file, data):
"""
this cuts the count file produced from featureCounts down to
a two column file of gene ids and number of reads mapping to
each gene
"""
COUNT_COLUMN = 5
out_file = os.path.splitext(count_file)[0] + ".fixed.counts"
if file_exists(out_file):
... |
python | def record_set_properties(object_id, input_params={}, always_retry=True, **kwargs):
"""
Invokes the /record-xxxx/setProperties API method.
For more info, see: https://wiki.dnanexus.com/API-Specification-v1.0.0/Properties#API-method%3A-%2Fclass-xxxx%2FsetProperties
"""
return DXHTTPRequest('/%s/setP... |
python | def python_details():
"""
Returns a dictionary containing details about the Python interpreter
"""
build_no, build_date = platform.python_build()
results = {
# Version of interpreter
"build.number": build_no,
"build.date": build_date,
... |
java | public static Key<String> getPropertyKey(String propertyName) {
return Key.get(String.class, Names.named(propertyName));
} |
java | void handleException(EJBKey key, TxCookieImpl txCookie,
ExceptionType type, EJBMethodInfoImpl methodInfo)
throws CSIException
{
if (type == ExceptionType.CHECKED_EXCEPTION) {
// Checked exceptions always result in "normal" transaction
//... |
java | private void startEvictor() {
cancelEvictor();
if (evictorCheckPeriodSeconds > 0) {
logger.info("Start redis client evictor...");
evictor = new Evictor(getClientList(), evictorFailedTimesToBeTickOut);
EvictionTimer.schedule(evictor, evictorDelayCheckSeconds, evictorCh... |
python | def build_subtree_strut(self, result, *args, **kwargs):
"""
Returns a dictionary in form of
{node:Resource, children:{node_id: Resource}}
:param result:
:return:
"""
items = list(result)
root_elem = {"node": None, "children": OrderedDict()}
if len... |
java | public void addConsumerToRegisteredMonitors(
MonitoredConsumer mc,
ArrayList exactMonitorList,
ArrayList wildcardMonitorList)
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.entry(
tc,
"addConsumerToRegisteredMonitors",
new Object[] { mc,
... |
java | public HSBColor getComplementaryColor() {
double[] rgb = HSBColor.getRGB(hue, saturation, brightness);
double[] hsb = HSBColor.getHSB(1.0 - rgb[0], 1.0 - rgb[1], 1.0 - rgb[2]);
return new HSBColor(hsb[0], hsb[1], hsb[2]);
} |
python | def random_string_alphanumeric(size):
"""
Generate a random string of *size* length consisting of mixed case letters
and numbers. This function is not meant for cryptographic purposes.
:param int size: The length of the string to return.
:return: A string consisting of random characters.
:rtype: str
"""
# requ... |
java | public QueryHits execute(JcrIndexSearcher searcher, SessionImpl session, Sort sort) throws IOException
{
if (sort.getSort().length == 0 && matchesAnyChildNode())
{
Query context = getContextQuery();
return new ChildNodesQueryHits(searcher.evaluate(context), session, indexConfig);
... |
java | public static ByteBuffer clearAndEnsureCapacity(ByteBuffer buffer, int elements) {
if (buffer == null || buffer.capacity() < elements) {
buffer = ByteBuffer.allocate(elements);
} else {
buffer.clear();
}
return buffer;
} |
java | public static synchronized void mockStaticPartialNice(Class<?> clazz, String... methodNames) {
mockStaticNice(clazz, Whitebox.getMethods(clazz, methodNames));
} |
python | def set_stream_logger(log_level=logging.DEBUG, format_string=None, logger_name='smc'):
"""
Stream logger convenience function to log to console
:param int log_level: A log level as specified in the `logging` module
:param str format_string: Optional format string as specified in the
`log... |
python | def groups_open(self, room_id, **kwargs):
"""Adds the private group back to the user’s list of private groups."""
return self.__call_api_post('groups.open', roomId=room_id, kwargs=kwargs) |
java | public static List<ZipExtraField> parse(byte[] data) throws ZipException {
List<ZipExtraField> v = new ArrayList<ZipExtraField>();
if (data == null) {
return v;
}
int start = 0;
while (start <= data.length - WORD) {
ZipShort headerId = new ZipShort(data, start);
int length = (new Z... |
java | @Override
public <E> List<E> findAll(Class<E> entityClass, String[] columnsToSelect, Object... keys)
{
List<E> results = new ArrayList<E>();
if (columnsToSelect == null)
{
columnsToSelect = new String[0];
}
if (keys == null)
{
EntityMetad... |
python | def set_transmit_mode(self, mode):
""" set port transmit mode
:param mode: request transmit mode
:type mode: ixexplorer.ixe_port.IxeTransmitMode
"""
self.api.call_rc('port setTransmitMode {} {}'.format(mode, self.uri)) |
java | public MultiLineStringTo toTransferObject(MultiLineString input) {
MultiLineStringTo result = new MultiLineStringTo();
double[][][] resultCoordinates = new double[input.getNumGeometries()][][];
for (int i = 0; i < input.getNumGeometries(); i++) {
resultCoordinates[i] = getPoints(inpu... |
python | def standardize(self):
"""
standardize functional groups
:return: number of found groups
"""
self.reset_query_marks()
seen = set()
total = 0
for n, atom in self.atoms():
if n in seen:
continue
for k, center in centr... |
python | def random(cls, span=1, seed=None):
"""
Creates a randomized coordinate system.
Useful for confirming that an *assembly* does not rely on its
origin coordinate system to remain intact.
For example, the :class:`CoordSysIndicator` *assembly* aligns 3 boxes
along each of t... |
java | public EList<JvmTypeReference> getValues()
{
if (values == null)
{
values = new EObjectContainmentEList<JvmTypeReference>(JvmTypeReference.class, this, TypesPackage.JVM_TYPE_ANNOTATION_VALUE__VALUES);
}
return values;
} |
java | private static void copyHeader(
final Document doc,
final Document ndoc) {
NodeList headnl = doc.getElementsByTagName("head");
if (headnl.getLength() > 0) {
Element head = (Element) headnl.item(0);
ndoc.getDocumentElement()
.insertBefore(ndoc.adoptNode(head.cloneNode(true)),
ndoc.getDocumentEle... |
python | def serialize_object(self, attr, **kwargs):
"""Serialize a generic object.
This will be handled as a dictionary. If object passed in is not
a basic type (str, int, float, dict, list) it will simply be
cast to str.
:param dict attr: Object to be serialized.
:rtype: dict o... |
python | def Update(self):
"""Commit current PublicIP definition to cloud.
Usually called by the class to commit changes to port and source restriction policies.
>>> clc.v2.Server("WA1BTDIX01").PublicIPs().public_ips[0].Update().WaitUntilComplete()
0
"""
return(clc.v2.Requests(clc.v2.API.Call('PUT','servers/%s/... |
java | @Override
protected void checkPrimitiveValidity() {
BusPrimitiveInvalidity invalidityReason = null;
if (this.position == null) {
invalidityReason =
new BusPrimitiveInvalidity(
BusPrimitiveInvalidityType.NO_STOP_POSITION,
null);
} else {
final BusNetwork busNetwork = getBusNetwork();
i... |
python | def read_cdx(file, encoding='utf8'):
'''Iterate CDX file.
Args:
file (str): A file object.
encoding (str): The encoding of the file.
Returns:
iterator: Each item is a dict that maps from field key to value.
'''
with codecs.getreader(encoding)(file) as stream:
header... |
java | public static <K,V> Relation<K,V> unmodifiableRelation(final Relation<K,V> rel) {
return new UnmodifiableRelation<K,V>(rel);
} |
java | @Override
public boolean applyAction(Model c) {
Mapping map = c.getMapping();
return !map.isOffline(node) && map.addOfflineNode(node);
} |
python | def permute(sequence, permutation):
"""Apply a permutation sigma({j}) to an arbitrary sequence.
:param sequence: Any finite length sequence ``[l_1,l_2,...l_n]``. If it is a list, tuple or str, the return type will be the same.
:param permutation: permutation image tuple
:type permutation: tuple
:re... |
java | @Override
public CompletableFuture<Void> createTable(TableDescriptor desc, byte[][] splitKeys) {
// wraps exceptions in a CF (CompletableFuture). No null check here on desc to match Hbase impl
if (desc.getTableName() == null) {
return failedFuture(new IllegalArgumentException("TableName cannot be null")... |
python | def find_next_joint(root, current_link, next_joint_name):
"""
Find the next joint in the URDF tree
Parameters
----------
root
current_link: xml.etree.ElementTree
The current URDF link
next_joint_name: str
Optional : The name of the next joint. If not provided, find it automa... |
java | protected Transformer findTransformer(Class<?> clazz) {
Transformer answer = transformers.get(clazz);
if(answer == null)
throw new IllegalArgumentException("Can not transform value of " + clazz);
return answer;
} |
python | def _load_disktype_data(self):
"""Calls the :command:`disktype` command and obtains the disk GUID from GPT volume systems. As we
are running the tool anyway, the label is also extracted from the tool if it is not yet set.
The disktype data is only loaded and not assigned to volumes yet.
... |
java | public Observable<ProjectTaskInner> getAsync(String groupName, String serviceName, String projectName, String taskName) {
return getWithServiceResponseAsync(groupName, serviceName, projectName, taskName).map(new Func1<ServiceResponse<ProjectTaskInner>, ProjectTaskInner>() {
@Override
pub... |
python | def set_known_host(user=None,
hostname=None,
fingerprint=None,
key=None,
port=None,
enc=None,
config=None,
hash_known_hosts=True,
timeout=5,
fingerpr... |
java | public static dnsnsrec[] get_filtered(nitro_service service, String filter) throws Exception{
dnsnsrec obj = new dnsnsrec();
options option = new options();
option.set_filter(filter);
dnsnsrec[] response = (dnsnsrec[]) obj.getfiltered(service, option);
return response;
} |
python | def check_user_can_vote(cmt_id, client_ip_address, uid=-1):
""" Checks if a user hasn't already voted
:param cmt_id: comment id
:param client_ip_address: IP => use: str(req.remote_ip)
:param uid: user id, as given by invenio.legacy.webuser.getUid(req)
"""
cmt_id = wash_url_argument(cmt_id, 'int'... |
java | @Override
public void info(final MessageItem messageItem) {
getLogger().info(messageItem.getMarker(), messageItem.getText());
} |
python | def remove(self, *terminals):
# type: (Iterable[Any]) -> None
"""
Remove terminals from the set.
Removes also rules using this terminal.
:param terminals: Terminals to remove.
:raise KeyError if the object is not in the set.
"""
for term in set(terminals):... |
python | def _add_auth_role_arg(arg_parser, default_permissions):
"""
Adds optional auth_role parameter to a parser.
:param arg_parser: ArgumentParser parser to add this argument to.
:param default_permissions: default value to use for this argument
"""
help_text = "Specifies which project permissions to... |
java | public RemoveUsersSavedTracksRequest.Builder removeUsersSavedTracks(String... ids) {
return new RemoveUsersSavedTracksRequest.Builder(accessToken)
.setDefaults(httpManager, scheme, host, port)
.ids(concat(ids, ','));
} |
python | def to_yaml(self):
"""Store an instance to the referenced YAML file."""
import yaml
with self.__reference__.open('w') as fp:
yaml.dump(self.asjsonld(), fp, default_flow_style=False) |
java | public PoolRemoveNodesOptions withOcpDate(DateTime ocpDate) {
if (ocpDate == null) {
this.ocpDate = null;
} else {
this.ocpDate = new DateTimeRfc1123(ocpDate);
}
return this;
} |
python | def reconcile_extend(self, high):
'''
Pull the extend data and add it to the respective high data
'''
errors = []
if '__extend__' not in high:
return high, errors
ext = high.pop('__extend__')
for ext_chunk in ext:
for name, body in six.iter... |
java | public void setCellRenderer(ListCellRenderer cellRenderer) {
// Apply this to both lists
sourceList.setCellRenderer(cellRenderer);
chosenList.setCellRenderer(cellRenderer);
helperList.setCellRenderer(cellRenderer);
} |
java | public void wait(int retry) {
long sleepMillis = BACKOFF[Math.min(retry, BACKOFF.length - 1)] * 1000L;
try {
Thread.sleep(sleepMillis);
} catch (InterruptedException ie) {
Thread.currentThread().interrupt();
throw new WebbException(ie);
}
} |
python | async def on_raw_quit(self, message):
""" QUIT command. """
nick, metadata = self._parse_user(message.source)
self._sync_user(nick, metadata)
if message.params:
reason = message.params[0]
else:
reason = None
await self.on_quit(nick, reason)
... |
python | def cohensutherland(xmin, ymax, xmax, ymin, x1, y1, x2, y2):
"""Clips a line to a rectangular area.
This implements the Cohen-Sutherland line clipping algorithm. xmin,
ymax, xmax and ymin denote the clipping area, into which the line
defined by x1, y1 (start point) and x2, y2 (end point) will be
c... |
java | private void processINodesUC(DataInputStream in, ImageVisitor v,
boolean skipBlocks) throws IOException {
int numINUC = in.readInt();
v.visitEnclosingElement(ImageElement.INODES_UNDER_CONSTRUCTION,
ImageElement.NUM_INODES_UNDER_CONSTRUCTION, numINUC);
for(int i = 0; i < nu... |
java | private static void addFileToZip(String path, File file, ZipOutputStream zos) throws IOException {
String currentPath = StringUtils.isNotEmpty(path)? path + "/" + file.getName(): file.getName();
zos.putNextEntry(new ZipEntry(currentPath));
InputStream is = new BufferedInputStream(new FileInput... |
python | def detach(self, connection_info):
"""Detach a volume from a guest
"""
fcp = connection_info['zvm_fcp']
fcp = fcp.lower()
target_wwpn = connection_info['target_wwpn']
target_lun = connection_info['target_lun']
assigner_id = connection_info['assigner_id']
a... |
java | public void putCacheField()
{
try {
Record record = this.getOwner();
Object objKey = record.getHandle(DBConstants.OBJECT_ID_HANDLE);
m_hsCache.add(objKey);
} catch (DBException ex) {
ex.printStackTrace();
}
} |
python | def mol_supplier(lines, no_halt, assign_descriptors):
"""Yields molecules generated from CTAB text
Args:
lines (iterable): CTAB text lines
no_halt (boolean):
True: shows warning messages for invalid format and go on.
False: throws an exception for it and stop parsing.
... |
java | public static String[] readListFile( URL listFile )
throws IOException
{
ArrayList<String> list = new ArrayList<String>();
InputStream stream = listFile.openStream();
try
{
InputStreamReader isr = new InputStreamReader( stream, "UTF-8" );
BufferedReade... |
java | public void renderFrame(int frameNumber, Bitmap bitmap) {
Canvas canvas = new Canvas(bitmap);
canvas.drawColor(Color.TRANSPARENT, PorterDuff.Mode.SRC);
// If blending is required, prepare the canvas with the nearest cached frame.
int nextIndex;
if (!isKeyFrame(frameNumber)) {
// Blending is r... |
java | public static ImageWriter getImageWriter(ImageReader reader) {
if (reader == null) {
throw new IllegalArgumentException("reader == null!");
}
ImageReaderSpi readerSpi = reader.getOriginatingProvider();
if (readerSpi == null) {
Iterator readerSpiIter;
// Ensure category is present
try {
... |
python | def extend(self):
"""Extend the OAuth token."""
graph = GraphAPI()
response = graph.get('oauth/access_token',
client_id = FACEBOOK_APPLICATION_ID,
client_secret = FACEBOOK_APPLICATION_SECRET_KEY,
grant_type = 'fb_exchange_token',
fb_exchange_token... |
java | public void invoke(InputStream is, OutputStream os,
SerializerFactory serializerFactory)
throws Exception
{
boolean isDebug = false;
if (isDebugInvoke()) {
isDebug = true;
PrintWriter dbg = createDebugPrintWriter();
HessianDebugInp... |
python | def _merge_dict(self, global_dict, local_dict):
"""
Merges the two dictionaries together
:param global_dict: Global dictionary to be merged
:param local_dict: Local dictionary to be merged
:return: New merged dictionary with values shallow copied
"""
# Local has... |
python | def get_serializer(self, *args, **kwargs):
"""Get an instance of the child serializer."""
init_args = {
k: v for k, v in six.iteritems(self.kwargs)
if k in self.SERIALIZER_KWARGS
}
kwargs = self._inherit_parent_kwargs(kwargs)
init_args.update(kwargs)
... |
java | public DescribeProvisioningParametersResult withConstraintSummaries(ConstraintSummary... constraintSummaries) {
if (this.constraintSummaries == null) {
setConstraintSummaries(new java.util.ArrayList<ConstraintSummary>(constraintSummaries.length));
}
for (ConstraintSummary ele : const... |
python | def TargetDirectory(ID, season, relative=False, **kwargs):
'''
Returns the location of the :py:mod:`everest` data on disk
for a given target.
:param ID: The target ID
:param int season: The target season number
:param bool relative: Relative path? Default :py:obj:`False`
'''
if season... |
python | def visitMultiElementGroup(self, ctx: ShExDocParser.MultiElementGroupContext):
""" multiElementGroup: unaryShape (';' unaryShape)+ ';'? """
self.expression = EachOf(expressions=[])
for us in ctx.unaryShape():
parser = ShexOneOfShapeParser(self.context)
parser.visit(us)
... |
java | public static String printFlag(int flags)
{
StringBuffer sb = new StringBuffer();
sb.append(Integer.toHexString(flags));
sb.append("=");
if (flags == XAResource.TMNOFLAGS)
{
sb.append("TMNOFLAGS");
}
else
{
if ((flags & XAResou... |
python | def find_packages_under(path):
""" Recursive list all of the packages under a specific package."""
all_packages = setuptools.find_packages()
packages = []
for package in all_packages:
package_split = package.split(".")
if package_split[0] == path:
packages.append(package)
... |
java | @Override
public boolean contains(final ENTRY entry) throws CouldNotPerformException {
if (entry == null) {
throw new NotAvailableException("entry");
}
return contains(entry.getId());
} |
java | public String convertIfcSlabTypeEnumToString(EDataType eDataType, Object instanceValue) {
return instanceValue == null ? null : instanceValue.toString();
} |
java | public void marshall(UpdateDomainNameserversRequest updateDomainNameserversRequest, ProtocolMarshaller protocolMarshaller) {
if (updateDomainNameserversRequest == null) {
throw new SdkClientException("Invalid argument passed to marshall(...)");
}
try {
protocolMarshalle... |
python | def read_lsm_channelcolors(fh):
"""Read LSM ChannelColors structure from file and return as dict."""
result = {'Mono': False, 'Colors': [], 'ColorNames': []}
pos = fh.tell()
(size, ncolors, nnames,
coffset, noffset, mono) = struct.unpack('<IIIIII', fh.read(24))
if ncolors != nnames:
log... |
java | public void saveRequestUrlAndParameters(HttpServletRequest request, HttpServletResponse response) {
String cookieName = ReferrerURLCookieHandler.REFERRER_URL_COOKIENAME;
ReferrerURLCookieHandler referrerURLCookieHandler = getCookieHandler();
Cookie c = referrerURLCookieHandler.createCookie(cooki... |
java | @Deprecated
public GetJobResponse getJob(GetJobRequest request) {
checkNotNull(request, "The parameter request should NOT be null.");
checkStringNotEmpty(request.getJobId(), "The parameter jobId should NOT be null or empty string.");
InternalRequest internalRequest = createRequest(HttpMethod... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.