language stringclasses 2
values | func_code_string stringlengths 63 466k |
|---|---|
python | def And(*xs, simplify=True):
"""Expression conjunction (product, AND) operator
If *simplify* is ``True``, return a simplified expression.
"""
xs = [Expression.box(x).node for x in xs]
y = exprnode.and_(*xs)
if simplify:
y = y.simplify()
return _expr(y) |
python | def reactivate(self):
"""
Reactivates this subscription.
If a customer's subscription is canceled with ``at_period_end`` set to True and it has not yet reached the end
of the billing period, it can be reactivated. Subscriptions canceled immediately cannot be reactivated.
(Source: https://stripe.com/docs/subs... |
python | def run(self):
'''
Execute the salt call logic
'''
profiling_enabled = self.opts.get('profiling_enabled', False)
try:
pr = salt.utils.profile.activate_profile(profiling_enabled)
try:
ret = self.call()
finally:
sa... |
java | public static Element appendElement(Element parent, String tagName) {
Element child = parent.getOwnerDocument().createElement(tagName);
parent.appendChild(child);
return child;
} |
java | @SuppressFBWarnings("ST_WRITE_TO_STATIC_FROM_INSTANCE_METHOD")
public void execute() throws ClassNotFoundException {
Set<Edge> deletedEdgeSet = new HashSet<>();
List<MarkedEdge> markedEdgeList = new LinkedList<>();
// Mark edges to delete,
// mark edges to set properties of
... |
java | public void setFile(File file) {
String fileName = file.getName().toLowerCase(Locale.ROOT);
if (fileName.matches(".*\\.htm(l)?$")) {
method = OutputMethod.HTML;
} else {
if (fileName.matches(".*\\.jsonp")) {
method = OutputMethod.JSONP;
} else {
method = OutputMethod.JSON;
... |
java | public ManagedEntity findByUuid(Datacenter datacenter, String uuid, boolean vmOnly) throws RuntimeFault, RemoteException {
return findByUuid(datacenter, uuid, vmOnly, null);
} |
python | def stop_pipeline(url, pipeline_id, auth, verify_ssl):
"""Stop a running pipeline. The API waits for the pipeline to be 'STOPPED' before returning.
Args:
url (str): the host url in the form 'http://host:port/'.
pipeline_id (str): the ID of of the exported pipeline.
auth (tu... |
java | @CheckReturnValue
public AuditableRestAction<Void> ban(User user, int delDays, String reason)
{
Checks.notNull(user, "User");
checkPermission(Permission.BAN_MEMBERS);
if (getGuild().isMember(user)) // If user is in guild. Check if we are able to ban.
checkPosition(getGuild()... |
python | def _nxapi_request(commands, method='cli_conf', **kwargs):
'''
Executes an nxapi_request request over NX-API.
commands
The exec or config commands to be sent.
method: ``cli_show``
``cli_show_ascii``: Return raw test or unstructured output.
``cli_show``: Return structured output... |
java | @VisibleForTesting
static String packageName(String source) {
try (StringReader r = new StringReader(source)) {
StreamTokenizer tokenizer = new StreamTokenizer(r);
tokenizer.slashSlashComments(true);
tokenizer.slashStarComments(true);
StringBuilder sb = new StringBuilder();
boolean i... |
python | def acquire(
self, timeout: Union[float, datetime.timedelta] = None
) -> Awaitable[_ReleasingContextManager]:
"""Decrement the counter. Returns an awaitable.
Block if the counter is zero and wait for a `.release`. The awaitable
raises `.TimeoutError` after the deadline.
"""
... |
python | def annotate_filter(**decargs):
"""Add input and output watermarks to filtered events."""
def decorator(func):
"""Annotate events with entry and/or exit timestamps."""
def wrapper(event, *args, **kwargs):
"""Add enter and exit annotations to the processed event."""
funcna... |
java | @Override protected void resizeDynamicText() {
double maxWidth = unitText.isManaged() ? width - size * 0.275 : width - size * 0.1;
double fontSize = size * 0.24;
valueText.setFont(Fonts.latoRegular(fontSize));
if (valueText.getLayoutBounds().getWidth() > maxWidth) { Helper.adjustTextSize... |
java | @Override
public $.Option<T> findOne($.Function<? super T, Boolean> predicate) {
for (T t : this) {
if (predicate.apply(t)) {
return $.some(t);
}
}
return $.none();
} |
java | private static OkHttpClient createOkHttpClient(Long timeoutSeconds) {
OkHttpClient.Builder builder = new OkHttpClient.Builder();
if (timeoutSeconds != null) {
builder.connectTimeout(timeoutSeconds, TimeUnit.SECONDS);
builder.readTimeout(timeoutSeconds, TimeUnit.SECONDS);
... |
python | def marker_for_line(self, line):
"""
Returns the marker that is displayed at the specified line number if
any.
:param line: The marker line.
:return: Marker of None
:rtype: pyqode.core.Marker
"""
markers = []
for marker in self._markers:
... |
python | def _from_binary_acl(cls, binary_stream):
"""See base class."""
''' Revision number - 1
Padding - 1
Size - 2
ACE Count - 2
Padding - 2
'''
rev_number, size, ace_len = cls._REPR.unpack(binary_stream[:cls._REPR.size])
#content = cls._REPR.unpack(binary_stream[:cls._REPR... |
java | private static Map<String, String> convertHeaders(Header[] headers) {
Map<String, String> result = new HashMap<String, String>(headers.length);
for (Header header : headers) {
result.put(header.getName(), header.getValue());
}
return result;
} |
java | public synchronized SSLConfig getSSLConfig(String alias) throws IllegalArgumentException {
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
Tr.entry(tc, "getSSLConfig: " + alias);
SSLConfig rc = null;
if (alias == null || alias.equals("")) {
rc = getDefau... |
java | private static void idString(ByteBuffer buffer, StringBuilder out) {
out.append(buffer.getClass().getSimpleName());
out.append("@");
if (buffer.hasArray() && buffer.arrayOffset() == 4) {
out.append('T');
byte[] array = buffer.array();
TypeUtils.toHex(array[0],... |
python | def process_pulls(self, testpulls=None, testarchive=None, expected=None):
"""Runs self.find_pulls() *and* processes the pull requests unit tests,
status updates and wiki page creations.
:arg expected: for unit testing the output results that would be returned
from running the tests in... |
java | protected final String getClassMessage(String className, String key) {
registry.load(locale, Strings.substringBeforeLast(className, ".") + ".package");
Option<TextBundle> bundle = registry.load(locale, className);
return bundle.isDefined() ? bundle.get().getText(key) : null;
} |
java | private static List<String> splitAddress(String addresses){
if(StrUtil.isBlank(addresses)) {
return null;
}
List<String> result;
if(StrUtil.contains(addresses, ',')) {
result = StrUtil.splitTrim(addresses, ',');
}else if(StrUtil.contains(addresses, ';')) {
result = StrUtil.splitTrim(addre... |
python | def __EncodedAttribute_decode_rgb32(self, da, extract_as=ExtractAs.Numpy):
"""Decode a color image (JPEG_RGB or RGB24) and returns a 32 bits RGB image.
:param da: :class:`DeviceAttribute` that contains the image
:type da: :class:`DeviceAttribute`
:param extract_as: defaults to ExtractAs.Num... |
java | public int getAvailableHeight(int fixedContentHeight) {
if (m_buttonPanel.isVisible()) {
fixedContentHeight += m_buttonPanel.getOffsetHeight();
}
return Window.getClientHeight() - 150 - fixedContentHeight;
} |
python | def _load(self):
"""
Load the database from its ``dbfile`` if it has one
"""
if self.dbfile is not None:
with open(self.dbfile, 'r') as f:
self._db = json.loads(f.read())
else:
self._db = {} |
java | private void parseErrorLog(Map<String, Object> config) {
String filename = (String) config.get("error.filePath");
if (null == filename || 0 == filename.trim().length()) {
return;
}
try {
this.debugLog = new DebugLogger(filename);
} catch (Throwable t) {
... |
java | private void appendConsoleLogging(Node root) {
if (logDebug && consoleDebugOutput.size() > 0) {
// Emit code to call console.log on the client
Node node = root;
if (node.getType() == Token.BLOCK) {
node = node.getFirstChild();
}
if (node.getType() == Token.SCRIPT) {
if (source == null) ... |
java | private double getHydrograph( int k, double[][] Qpartial, double localdelay, double delay, int tp )
{
double Qmax = 0;
double tmin = rainData[0][0]; /* [min] */
int j = 0;
double t = tmin;
double Q;
double rain;
int maxRain = 0;
if (tMax == tpMaxCali... |
java | public void onFailure(Throwable t) {
if ((t instanceof StatusCodeException) && (((StatusCodeException)t).getStatusCode() == 0)) {
// a status code 0 indicates the client aborted the request, most likely when leaving the page, this should be ignored
return;
} else if ((t instance... |
java | public boolean isInstanceOf(ObjectName name, String className) throws InstanceNotFoundException {
return delegate.isInstanceOf(name, className);
} |
java | public Long getFileSize() {
Long fileSize = 0L;
if (items.size() != 0) {
for (TableStat item : items) {
fileSize += item.getFileSize();
}
}
return fileSize;
} |
java | public InputStream openInputStream() throws FetchException {
try {
return getInternalBlobForFetch().getBinaryStream();
} catch (SQLException e) {
throw mRepo.toFetchException(e);
}
} |
java | @Override
public void removeAtom(IAtom atom) {
int position = getAtomNumber(atom);
if (position != -1) {
for (int i = 0; i < bondCount; i++) {
if (bonds[i].contains(atom)) {
removeBond(i);
--i;
}
}
... |
java | public void localRollback()
{
log.info("Rollback was called, do rollback on current connection " + con);
if (!this.isInLocalTransaction)
{
throw new PersistenceBrokerException("Not in transaction, cannot abort");
}
try
{
//truncate the... |
python | def col_to_dt(df,col_name,set_format = None,infer_format = True, dest = False):
""" Coerces a column in a DataFrame to datetime
Parameters:
df - DataFrame
DataFrame to operate on
col_name - string
Name of column to coerce
dest - bool, default False
Whether to apply the result... |
java | @Override
public InetSocketAddress lookup(final Identifier id) throws Exception {
return cache.get(id, new Callable<InetSocketAddress>() {
@Override
public InetSocketAddress call() throws Exception {
final int origRetryCount = NameLookupClient.this.retryCount;
int retriesLeft = origR... |
java | public ProcessStarter sysProp(String name, Object value) {
this.systemProps.put(name, value.toString());
return this;
} |
python | def read_int16(self, little_endian=True):
"""
Read 2 byte as a signed integer value from the stream.
Args:
little_endian (bool): specify the endianness. (Default) Little endian.
Returns:
int:
"""
if little_endian:
endian = "<"
... |
java | public boolean hasRole(CmsObject cms, CmsRole role) {
return m_securityManager.hasRole(cms.getRequestContext(), cms.getRequestContext().getCurrentUser(), role);
} |
python | def choice(self,arr):
"""Uniform random selection of a member of an list
:param arr: list you want to select an element from
:type arr: list
:return: one element from the list
"""
ind = self.randint(0,len(arr)-1)
return arr[ind] |
python | def _requested_name(self, name, action=None, func=None):
"""Create a unique name for an operator or a stream.
"""
if name is not None:
if name in self._used_names:
# start at 2 for the "second" one of this name
n = 2
while True:
... |
java | public ProcessingConfiguration withProcessors(Processor... processors) {
if (this.processors == null) {
setProcessors(new java.util.ArrayList<Processor>(processors.length));
}
for (Processor ele : processors) {
this.processors.add(ele);
}
return this;
... |
java | public void onlineTrain(final double[] x, final int labelIndex) {
Map<Integer, Double> result = predict(x);
Map.Entry<Integer, Double> maxResult = result.entrySet().stream().max((e1, e2) -> e1.getValue().compareTo(e2.getValue())).orElse(null);
if (maxResult.getKey() != labelIndex) {
... |
java | public int authenticate(AuthenticationClient auth, String servicename)
throws SshException {
try {
auth.authenticate(this, servicename);
readMessage();
transport
.disconnect(TransportProtocol.PROTOCOL_ERROR,
"Unexpected response received from Authentication Protocol");
throw new SshExceptio... |
java | private Collection<ClassDescriptor> extractReferencedClasses() throws InvalidClassFileFormatException {
Set<ClassDescriptor> referencedClassSet = new HashSet<>();
for (Constant constant : constantPool) {
if (constant == null) {
continue;
}
if (constant... |
java | public static String getExtension(String path) {
int idx = path.lastIndexOf("/"); //$NON-NLS-1$
String filename = idx == -1 ? path : path.substring(idx+1);
idx = filename.lastIndexOf("."); //$NON-NLS-1$
return idx == -1 ? "" : filename.substring(idx+1); //$NON-NLS-1$
} |
java | public static List<CommerceDiscountRel> findByCommerceDiscountId(
long commerceDiscountId, int start, int end) {
return getPersistence()
.findByCommerceDiscountId(commerceDiscountId, start, end);
} |
python | def get_pelecs_and_pions(self, convert_to_muC_per_cm2=False):
"""
Get the electronic and ionic dipole moments / polarizations.
convert_to_muC_per_cm2: Convert from electron * Angstroms to microCoulomb
per centimeter**2
"""
if not convert_to_muC_per_cm2:
... |
java | private CanInlineResult canInlineReferenceDirectly(
Reference ref, Node fnNode, Set<String> namesToAlias) {
if (!isDirectCallNodeReplacementPossible(fnNode)) {
return CanInlineResult.NO;
}
// CALL NODE: [ NAME, ARG1, ARG2, ... ]
Node callNode = ref.callNode;
Node cArg = callNode.getSeco... |
python | def fallback(cache):
"""
Caches content retrieved by the client, thus allowing the cached
content to be used later if the live content cannot be retrieved.
"""
log_filter = ThrottlingFilter(cache=cache)
logger.filters = []
logger.addFilter(log_filter)
def get_cache_response(cache_key)... |
python | def beacon(config):
'''
Poll imgadm and compare available images
'''
ret = []
# NOTE: lookup current images
current_images = __salt__['imgadm.list'](verbose=True)
# NOTE: apply configuration
if IMGADM_STATE['first_run']:
log.info('Applying configuration for imgadm beacon')
... |
python | def _validate_filter(self, keys, filterset_class):
"""
Check that all the filter[key] are valid.
:param keys: list of FilterSet keys
:param filterset_class: :py:class:`django_filters.rest_framework.FilterSet`
:raises ValidationError: if key not in FilterSet keys or no FilterSet.... |
python | def print_plugins(folders, exit_code=0):
"""Print available plugins and exit."""
modules = plugins.get_plugin_modules(folders)
pluginclasses = sorted(plugins.get_plugin_classes(modules), key=lambda x: x.__name__)
for pluginclass in pluginclasses:
print(pluginclass.__name__)
doc = strfor... |
python | def _get_proj_convex_hull(self):
"""
Create a projection centered in the center of this mesh and define
a convex polygon in that projection, enveloping all the points
of the mesh.
:returns:
Tuple of two items: projection function and shapely 2d polygon.
N... |
java | @Override
public void handlePopups() {
/*
* try { executeJavaScript("window.alert = function(msg){return true;};" +
* "window.confirm = function(msg){return true;};" +
* "window.prompt = function(msg){return true;};"); } catch (CrawljaxException e) {
* LOGGER.error("Handling of PopUp windows failed", e);... |
java | public static void addId(Entry entry, boolean updateRdn) {
String uuid = newUUID().toString();
try {
entry.add(SchemaConstants.OBJECT_CLASS_ATTRIBUTE, UNIQUE_OBJECT_OC);
entry.add(ID_ATTRIBUTE, uuid);
} catch (LdapException e) {
throw new LdapRuntimeException(... |
java | public void abort(Executor executor) throws SQLException {
if (this.isClosed()) {
return;
}
SQLPermission sqlPermission = new SQLPermission("callAbort");
SecurityManager securityManager = System.getSecurityManager();
if (securityManager != null) {
securityManager.checkPermission(sqlPerm... |
java | protected RadialGradientPaint createArea3DEffectGradient(final int WIDTH, final float RADIUS_FACTOR) {
final float[] FRACTIONS;
final Color[] COLORS;
FRACTIONS = new float[]{
0.0f,
0.6f,
1.0f
};
COLORS = new Color[]{
new Color(1.0f... |
java | @Override
public boolean incomingServerRequestMatchesMethod(RequestDetails theRequest) {
if (!Constants.PARAM_HISTORY.equals(theRequest.getOperation())) {
return false;
}
if (theRequest.getResourceName() == null) {
return myResourceOperationType == RestOperationTypeEnum.HISTORY_SYSTEM;
}
if (!StringUti... |
python | def spin2_a(self):
"""Returns the dimensionless spin magnitude of mass 2."""
return coordinates.cartesian_to_spherical_rho(
self.spin1x, self.spin1y, self.spin1z) |
python | def send(self, request_id, payload):
"""
Send a request to Kafka
Arguments::
request_id (int): can be any int (used only for debug logging...)
payload: an encoded kafka packet (see KafkaProtocol)
"""
log.debug("About to send %d bytes to Kafka, request %d... |
java | protected void process(HttpServletRequest request, HttpServletResponse response, String fileName)
throws IOException {
// TODO put this html code in a template
response.setContentType("text/html");
response.setCharacterEncoding("UTF-8");
response.setStatus(200);
FileB... |
python | def client_unenroll(self, client):
"""
Unenroll a client. Uses DELETE to /clients/<client> interface.
:Args:
* *client*: (str) Client's ID
"""
client = self._client_id(client)
response = self._delete(url.clients_id.format(id=client))
self._check_resp... |
java | @SuppressWarnings("unchecked")
@Override
public void eSet(int featureID, Object newValue) {
switch (featureID) {
case AfplibPackage.BFN__RS_NAME:
setRSName((String)newValue);
return;
case AfplibPackage.BFN__TRIPLETS:
getTriplets().clear();
getTriplets().addAll((Collection<? extends Triplet>)ne... |
java | protected Map<String,String> getAttributeTable(String tableName) {
String prefix = contextName + "." + tableName + ".";
Map<String,String> result = new HashMap<String,String>();
for (String attributeName : factory.getAttributeNames()) {
if (attributeName.startsWith(prefix)) {
String name ... |
java | public boolean isValueKnown() {
Type type = getType();
if (type != null) {
Class<?> clazz = type.getObjectClass();
return Number.class.isAssignableFrom(clazz) ||
clazz.isAssignableFrom(Number.class);
}
else {
return false;
}
... |
python | def remove(self, force=False):
"""
Remove the plugin from the server.
Args:
force (bool): Remove even if the plugin is enabled.
Default: False
Raises:
:py:class:`docker.errors.APIError`
If the server re... |
java | public String getFieldName() {
if (!visitingField) {
throw new IllegalStateException("getFieldName called while not visiting field");
}
if (fieldName == null) {
fieldName = getStringFromIndex(field.getNameIndex());
}
return fieldName;
} |
python | def WaitUntilNoFlowsToProcess(self, timeout=None):
"""Waits until flow processing thread is done processing flows.
Args:
timeout: If specified, is a max number of seconds to spend waiting.
Raises:
TimeOutWhileWaitingForFlowsToBeProcessedError: if timeout is reached.
"""
t = self.flow_h... |
python | def unstem(self, term):
"""
Given a stemmed term, get the most common unstemmed variant.
Args:
term (str): A stemmed term.
Returns:
str: The unstemmed token.
"""
originals = []
for i in self.terms[term]:
originals.append(sel... |
python | def stack(self, level=-1, dropna=True):
"""
Stack the prescribed level(s) from columns to index.
Return a reshaped DataFrame or Series having a multi-level
index with one or more new inner-most levels compared to the current
DataFrame. The new inner-most levels are created by pi... |
python | def get_matching_prefix(self, namespace, stream):
"""
We look at the stream prefixs configured in stream.yaml and match stream
to the longest prefix.
"""
validate_stream(stream)
default_prefix = ''
longest_prefix = default_prefix
for prefix in self.prefix_confs[namespace]:
if prefi... |
python | def safe_repr(source, max_length=0):
"""Wrapper for repr() that catches exceptions."""
try:
return ellipsis(repr(source), max_length)
except Exception as e:
return ellipsis("<n/a: repr(...) raised %s>" % e, max_length) |
java | public final int getIndex( int coordinate[] ) {
int index = coordinate[0]*strides[0];
for (int i = 1; i < coordinate.length; i++) {
index += strides[i]*coordinate[i];
}
return index;
} |
java | public static String getErrorMessage(final int code)
{
switch (code) {
case NO_ERROR:
return "success";
case HOST_PROTOCOL_TYPE:
return "host protocol type not supported";
case VERSION_NOT_SUPPORTED:
return "protocol version not supported";
case SEQUENCE_NUMBER:
return "sequence number out of ord... |
java | public void beforeClosingBrace(StringBuilder sb, boolean pretty, String indent, String... attributeNames) {
StringWriter writer = new StringWriter();
beforeClosingBrace(pretty, indent, writer);
sb.append(writer.toString());
} |
java | protected boolean checkNewEntry(String name, int arrayPosition) {
m_errorMessages.clear();
boolean inArray = false;
if (getTypes(false)[arrayPosition] != null) {
inArray = true;
}
if (!inArray) {
m_errorMessages.add(key(Messages.ERR_PERMISSION_SELECT_TYPE... |
java | @Override
public boolean eIsSet(int featureID) {
switch (featureID) {
case ColorPackage.DOCUMENT_ROOT__MIXED:
return mixed != null && !mixed.isEmpty();
case ColorPackage.DOCUMENT_ROOT__XMLNS_PREFIX_MAP:
return xMLNSPrefixMap != null && !xMLNSPrefixMap.isEmpty();
case ColorPackage.DOCUMENT_ROOT__XSI_... |
java | public EventDefinitionReferenceType<PortletType<T>> getOrCreateSupportedPublishingEvent()
{
List<Node> nodeList = childNode.get("supported-publishing-event");
if (nodeList != null && nodeList.size() > 0)
{
return new EventDefinitionReferenceTypeImpl<PortletType<T>>(this, "supported-publis... |
python | def load_vectors(self, vectors, **kwargs):
"""
Arguments:
vectors: one of or a list containing instantiations of the
GloVe, CharNGram, or Vectors classes. Alternatively, one
of or a list of available pretrained vectors:
charngram.100d
... |
java | public static <T> T[] defaultIfEmpty(T[] array, T[] defaultArray) {
return isNotEmpty(array) ? array : defaultArray;
} |
java | public void invalidateCookie(HttpServletRequest req, HttpServletResponse res, String cookieName, boolean enableHttpOnly) {
Cookie c = new Cookie(cookieName, "");
if (cookieName.equals("WASReqURL")) {
c.setPath(getPathName(req));
} else {
c.setPath("/");
}
... |
java | public static SpannableString getEmojiString(Context context, String string, boolean adjustEmoji) {
if (null == EmojiList) {
initEmojiItems(context);
}
// 转换 Html,去掉两个表情之间的多个空格
Spanned spanned = Html.fromHtml(string.replace(" ", ""));
SpannableString spanna... |
python | def merge(dst, src, separator="/", afilter=None, flags=MERGE_ADDITIVE, _path=""):
"""Merge source into destination. Like dict.update() but performs
deep merging.
flags is an OR'ed combination of MERGE_ADDITIVE, MERGE_REPLACE, or
MERGE_TYPESAFE.
* MERGE_ADDITIVE : List objects are combined onto ... |
python | def __expand_subfeatures_aux (property_, dont_validate = False):
""" Helper for expand_subfeatures.
Given a feature and value, or just a value corresponding to an
implicit feature, returns a property set consisting of all component
subfeatures and their values. For example:
expand... |
python | def put(self, uri_pattern, body, headers=None, parameters=None, **kwargs):
"""
Launch HTTP PUT request to the API with given arguments
:param uri_pattern: string pattern of the full API url with keyword arguments (format string syntax)
:param body: Raw Body content (string) (Plain/XML/JS... |
python | def get_bewit(resource):
"""
Returns a bewit identifier for the resource as a string.
:param resource:
Resource to generate a bewit for
:type resource: `mohawk.base.Resource`
"""
if resource.method != 'GET':
raise ValueError('bewits can only be generated for GET requests')
i... |
python | def rate(base, target, error_log=None):
"""Get current exchange rate.
:param base: A base currency
:param target: Convert to the target currency
:param error_log: A callable function to track the exception
It parses current exchange rate from these services:
1) Yahoo finance
2) fi... |
java | public void marshall(SetVisibleToAllUsersRequest setVisibleToAllUsersRequest, ProtocolMarshaller protocolMarshaller) {
if (setVisibleToAllUsersRequest == null) {
throw new SdkClientException("Invalid argument passed to marshall(...)");
}
try {
protocolMarshaller.marshal... |
python | def diff_snapshots(self,snapshot_a,snapshot_b,save = True, diff=None):
"""
Returns a list of
"""
file_revisions_a = snapshot_a.file_revisions
file_revisions_b = snapshot_b.file_revisions
file_revisions_diff = diff_objects(file_revisions_a,
... |
java | void start() {
/* make sure any currently running dispatchers are stopped */
stop();
/* create the download dispatcher and start it. */
for (int i = 0; i < dispatchers.length; i++) {
DownloadDispatcher dispatcher = new DownloadDispatcher(downloadQueue, delivery, logger);
dispatchers[i] = di... |
java | private String getRunDate(GitHubRepo repo, boolean firstRun, boolean missingCommits) {
if (missingCommits) {
long repoOffsetTime = getRepoOffsetTime(repo);
if (repoOffsetTime > 0) {
return getDate(new DateTime(getRepoOffsetTime(repo)), 0, settings.getOffsetMinutes()).toSt... |
java | public static Connection getConnection(final String jdbcURL) throws SQLException {
try {
return getRealConnection(jdbcURL);
} catch (final SQLException sqlException) {
try {
return (Connection) AccessController.doPrivileged(new PrivilegedExceptionAction() {
... |
java | protected static Cpe parse22(String cpeString, boolean lenient) throws CpeParsingException {
if (cpeString == null || cpeString.isEmpty()) {
throw new CpeParsingException("CPE String is null ir enpty - unable to parse");
}
CpeBuilder cb = new CpeBuilder();
String[] parts = cp... |
java | public URL[] resolveToURLs(GAV gav) throws IOException, RepositoryException {
List<URL> jars = new ArrayList<URL>();
for (File f : resolve(gav)) {
jars.add(f.toURI().toURL());
}
return jars.toArray(new URL[jars.size()]);
} |
python | def create(self, customer_name, street, city, region, postal_code, iso_country,
friendly_name=values.unset, emergency_enabled=values.unset,
auto_correct_address=values.unset):
"""
Create a new AddressInstance
:param unicode customer_name: The name to associate with... |
java | public String[] parseClassName(String fullClassName) {
int dotIndex = fullClassName.lastIndexOf(".");
String packageName = null;
String className = fullClassName;
if (dotIndex > 0) {
packageName = fullClassName.substring(0, dotIndex);
className = fullClassName.s... |
python | def get_auth_server_name(host_override=None, port_override=None, protocol='https'):
"""
Chooses the auth server name from the currently configured API server name.
Raises DXError if the auth server name cannot be guessed and the overrides
are not provided (or improperly provided).
"""
if host_o... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.