language stringclasses 2
values | func_code_string stringlengths 63 466k |
|---|---|
python | def kmeans(self, maxiter, record_heterogeneity=None, verbose=False):
'''This function runs k-means on given data and initial set of centroids.
maxiter: maximum number of iterations to run.
record_heterogeneity: (optional) a list, to store the history of heterogeneity as function of iterati... |
python | def normalized_term_frequency(self, term, smooth=0.0):
"""
Returns normalized frequency of term in document.
http://nlp.stanford.edu/IR-book/html/htmledition/maximum-tf-normalization-1.html
:parameter float smooth:
0.0 <= smooth <= 1.0, generally set to 0.4, although some
... |
java | public int get(String suffix)
{
suffix = reverse(suffix);
Integer length = trie.get(suffix);
if (length == null) return 0;
return length;
} |
python | def CreateRunner(self, **kw):
"""Make a new runner."""
self.runner = HuntRunner(self, token=self.token, **kw)
return self.runner |
python | async def get_cloud(self):
"""
Get the name of the cloud that this controller lives on.
"""
cloud_facade = client.CloudFacade.from_connection(self.connection())
result = await cloud_facade.Clouds()
cloud = list(result.clouds.keys())[0] # only lives on one cloud
... |
python | def update_instance(self, uid, body):
"""
Update an Model via a PUT request
:param str uid: String identifier for the list resource
:param dict body: Dictionary of items to PUT
"""
uri = "%s/%s" % (self.uri, uid)
response, instance = self.request("PUT", uri, da... |
java | public void eInit(Resource resource, String packageName, IJvmTypeProvider context) {
this.builder.eInit(resource, packageName, context);
} |
python | def _zforce(self,R,z,phi=0.,t=0.,v=None):
"""
NAME:
_zforce
PURPOSE:
evaluate the vertical force for this potential
INPUT:
R - Galactocentric cylindrical radius
z - vertical height
phi - azimuth
t - time
v= curr... |
java | public void visit(NodeData node) throws RepositoryException
{
try
{
entering(node, currentLevel);
if ((maxLevel == -1) || (currentLevel < maxLevel))
{
currentLevel++;
List<PropertyData> properies = new ArrayList<PropertyData>(dataManager.getChildPropert... |
python | def parse_value(proto):
"""
Convers a Protobuf `Value` from the API into a python native value
"""
if proto.HasField('floatValue'):
return proto.floatValue
elif proto.HasField('doubleValue'):
return proto.doubleValue
elif proto.HasField('sint32Value'):
return proto.sint32... |
python | def ParseFileset(self, fileset=None):
"""Process linux system group and gshadow files.
Orchestrates collection of account entries from /etc/group and /etc/gshadow.
The group and gshadow entries are reconciled and member users are added to
the entry.
Args:
fileset: A dict of files mapped from... |
python | def derivative(self, point=None):
"""Return the derivative operator.
The gradient is usually linear, but in case the 'constant'
``pad_mode`` is used with nonzero ``pad_const``, the
derivative is given by the Gradient with ``pad_const=0``.
Parameters
----------
p... |
python | def write_export_node_to_file(file_object, export_elements):
"""
Exporting process to CSV file
:param file_object: object of File class,
:param export_elements: a dictionary object. The key is a node ID, value is a dictionary of parameters that
will be used in exported CS... |
python | def list(self, before_id=None, since_id=None, **kwargs):
"""Return a page of direct messages.
The messages come in reversed order (newest first). Note you can only
provide _one_ of ``before_id``, ``since_id``.
:param str before_id: message ID for paging backwards
:param str sin... |
java | @Override
public void onInterest(Name prefix, Interest interest, Face face, long interestFilterId, InterestFilter filter) {
logger.finer("Serving packet for: " + interest.toUri());
if (interest.getChildSelector() == -1) {
try {
interest.getName().get(-1).toSegment();
} catch (Encoding... |
java | public Session getOpenSession() {
Session openSession = getSession();
if (openSession != null && openSession.isOpened()) {
return openSession;
}
return null;
} |
python | def capture(cb, pool, params):
"""
Renders and saves a screen-sized picture of the current position.
:param cb: Cursebox instance.
:type cb: cursebox.Cursebox
:param params: Current application parameters.
:type params: params.Params
"""
w, h = screen_resolution()
# Re-adapt dimens... |
python | def get_output_jsonpath_field(self, sub_output=None):
"""attempts to create an output jsonpath from a particular ouput field"""
if sub_output is not None:
if self.output_fields is None or\
(isinstance(self.output_fields, dict) and not sub_output in self.output_fields.itervalu... |
python | def _choices(self):
"""
Generate a string of choices as key/value pairs
:return: string
"""
# Generate key/value strings
pairs = []
for key, value in self.choices.items():
pairs.append(str(value) + "=" + str(key))
# Assemble into overall strin... |
java | public static boolean isValidUrl(String url) {
HttpURLConnection huc = null;
boolean isValid = false;
try {
URL u = new URL(url);
huc = (HttpURLConnection) u.openConnection();
huc.setRequestMethod("GET");
huc.connect();
int response = h... |
java | public java.util.List<com.google.api.Distribution.Exemplar> getExemplarsList() {
return exemplars_;
} |
python | def _shutdown_proc(p, timeout):
"""Wait for a proc to shut down, then terminate or kill it after `timeout`."""
freq = 10 # how often to check per second
for _ in range(1 + timeout * freq):
ret = p.poll()
if ret is not None:
logging.info("Shutdown gracefully.")
return ret
time.sleep(1 / fr... |
python | def combine_or(matcher, *more_matchers):
"""Combines more than one matcher together (first that matches wins)."""
def matcher(cause):
for sub_matcher in itertools.chain([matcher], more_matchers):
cause_cls = sub_matcher(cause)
if cause_cls is not None:
return cau... |
python | def insert_text(self, text, at_end=False, error=False, prompt=False):
"""
Insert text at the current cursor position
or at the end of the command line
"""
if at_end:
# Insert text at the end of the command line
self.append_text_to_shell(text, error,... |
java | private static List<FieldItem> collectSelectQueryFields(MySqlSelectQueryBlock sqlSelectQueryBlock) {
return sqlSelectQueryBlock.getSelectList().stream().map(selectItem -> {
FieldItem fieldItem = new FieldItem();
fieldItem.setFieldName(selectItem.getAlias());
fieldItem.setExpr... |
python | def jsonp(data, **json_kwargs):
"""
jsonp is callback key name
"""
from uliweb import request
if 'jsonp' in json_kwargs:
cb = json_kwargs.pop('jsonp')
else:
cb = 'callback'
begin = str(request.GET.get(cb))
if not begin:
raise BadRequest("Can't found ... |
java | @Override
public int countByG_C(long groupId, String couponCode) {
FinderPath finderPath = FINDER_PATH_COUNT_BY_G_C;
Object[] finderArgs = new Object[] { groupId, couponCode };
Long count = (Long)finderCache.getResult(finderPath, finderArgs, this);
if (count == null) {
StringBundler query = new StringBun... |
python | def _compute_non_linear_term(self, C, pga_only, sites):
"""
Compute non-linear term, equation 6, page 970.
"""
Vref = self.CONSTS['Vref']
Vcon = self.CONSTS['Vcon']
c = self.CONSTS['c']
n = self.CONSTS['n']
lnS = np.zeros_like(sites.vs30)
... |
java | public boolean read(DataInputStream daIn, boolean bFixedLength) // Fixed length = false
{
try {
double dData = daIn.readDouble();
Double doData = null;
if (!Double.isNaN(dData))
doData = new Double(dData);
int errorCode = this.setData(doData,... |
java | @Override
protected void initializeDefaultPreferences(IPreferenceStore store)
{
store.setDefault(ICodeGenConstants.GENERATE_CHAR_SEQUENCES_AS_STRINGS, ICodeGenConstants.GENERATE_CHAR_SEQUENCES_AS_STRING_DEFAULT);
store.setDefault(ICodeGenConstants.DISABLE_CLONING, ICodeGenConstants.DISABLE_CLONING_DEFAULT);
sto... |
java | public static void divide( DMatrix5x5 a , double alpha ) {
a.a11 /= alpha; a.a12 /= alpha; a.a13 /= alpha; a.a14 /= alpha; a.a15 /= alpha;
a.a21 /= alpha; a.a22 /= alpha; a.a23 /= alpha; a.a24 /= alpha; a.a25 /= alpha;
a.a31 /= alpha; a.a32 /= alpha; a.a33 /= alpha; a.a34 /= alpha; a.a35 /= alph... |
java | public List<Other> getOther() {
if (others == null) {
others=AttributeList.populateKnownAttributes(this,all, org.openprovenance.prov.model.Other.class);
}
return this.others;
} |
python | async def helo(
self, hostname: str = None, timeout: DefaultNumType = _default
) -> SMTPResponse:
"""
Send the SMTP HELO command.
Hostname to send for this command defaults to the FQDN of the local
host.
:raises SMTPHeloError: on unexpected server response code
... |
java | @Override
protected boolean isErrorResponseStatus () {
int status = getStatus();
return status != NtStatus.NT_STATUS_INVALID_PARAMETER
&& ! ( status == NtStatus.NT_STATUS_INVALID_PARAMETER
&& ( this.ctlCode == Smb2IoctlRequest.FSCTL_SRV_COPYCHUNK || this.ctlCo... |
java | public int getJcrType( PropertyType propertyType ) {
switch (propertyType) {
case BOOLEAN:
return javax.jcr.PropertyType.BOOLEAN;
case DATETIME:
return javax.jcr.PropertyType.DATE;
case DECIMAL:
return javax.jcr.PropertyType.DEC... |
java | public String commitId(final String id) {
return new StringBuilder().append(baseUrl).append("commit/").append(id).toString();
} |
python | def calc_gs_eta(b, ne, delta, sinth, nu):
"""Calculate the gyrosynchrotron emission coefficient η_ν.
This is Dulk (1985) equation 35, which is a fitting function assuming a
power-law electron population. Arguments are:
b
Magnetic field strength in Gauss
ne
The density of electrons per ... |
python | def launch_browser(self, profile, timeout=30):
"""Launches the browser for the given profile name.
It is assumed the profile already exists.
"""
self.profile = profile
self._start_from_profile_path(self.profile.path)
self._wait_until_connectable(timeout=timeout) |
python | def upgrade(self, conn, skip_versions=()):
'''
Upgrade the database from the current version to the maximum
version in the upgrade scripts.
:param conn: a DBAPI 2 connection
:param skip_versions: the versions to skip
'''
db_versions = self.get_db_versions(conn)
... |
java | public com.google.protobuf.ByteString
getContextNameBytes() {
java.lang.Object ref = contextName_;
if (ref instanceof java.lang.String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8(
(java.lang.String) ref);
contextName_ = b;
re... |
python | def FromEncoded(cls, encoded):
"""Create a DataStreamSelector from an encoded 16-bit value.
The binary value must be equivalent to what is produced by
a call to self.encode() and will turn that value back into
a a DataStreamSelector.
Note that the following operation is a no-op... |
python | def simple_spend(from_privkey, to_address, to_satoshis, change_address=None,
privkey_is_compressed=True, min_confirmations=0, api_key=None, coin_symbol='btc'):
'''
Simple method to spend from one single-key address to another.
Signature takes place locally (client-side) after unsigned transaction i... |
python | def _ntowfv2(user_name, password, domain_name):
"""
[MS-NLMP] v28.0 2016-07-14
3.3.2 NTLM v2 Authentication
Same function as NTOWFv2 (and LMOWFv2) in document to create a one way hash
of the password. This combines some extra security features over the v1
calculations used in NTLMv2 auth.
... |
java | protected void load() throws FileNotFoundException {
XMLObjectReader reader = null;
try {
reader = XMLObjectReader.newInstance(new FileInputStream(persistFile.toString()));
reader.setBinding(binding);
load(reader);
} catch (XMLStreamException ex) {
... |
java | public String info(String value) {
LibMediaInfo.INSTANCE.MediaInfo_Option(null, new WString("Inform"), new WString(value));
WString result = LibMediaInfo.INSTANCE.MediaInfo_Inform(handle);
return result != null ? result.toString() : null;
} |
java | public Job createJob(FileSystemDataset dataset) throws IOException {
Configuration conf = HadoopUtils.getConfFromState(state);
// Turn on mapreduce output compression by default
if (conf.get("mapreduce.output.fileoutputformat.compress") == null && conf.get("mapred.output.compress") == null) {
conf.se... |
python | def emit_toi_stats(toi_set, peripherals):
"""
Calculates new TOI stats and emits them via statsd.
"""
count_by_zoom = defaultdict(int)
total = 0
for coord_int in toi_set:
coord = coord_unmarshall_int(coord_int)
count_by_zoom[coord.zoom] += 1
total += 1
peripherals.s... |
python | def make_arousals(events, time, s_freq):
"""Create dict for each arousal, based on events of time points.
Parameters
----------
events : ndarray (dtype='int')
N x 5 matrix with start, end samples
data : ndarray (dtype='float')
vector with the data
time : ndarray (dtype='float')
... |
python | def teardown_handles(self):
"""
If no custom update_handles method is supplied this method
is called to tear down any previous handles before replacing
them.
"""
if not isinstance(self.handles.get('artist'), GoogleTiles):
self.handles['artist'].remove() |
java | @Override
public void initialize() {
final List<IResourceProvider> providers = new ArrayList<IResourceProvider>();
providers.add(new SomeResourceProvider());
setResourceProviders(providers);
registerInterceptor(new ResponseHighlighterInterceptor());
} |
python | def _D_constraint(self, neg_pairs, w):
"""Compute the value, 1st derivative, second derivative (Hessian) of
a dissimilarity constraint function gF(sum_ij distance(d_ij A d_ij))
where A is a diagonal matrix (in the form of a column vector 'w').
"""
diff = neg_pairs[:, 0, :] - neg_pairs[:, 1, :]
d... |
python | def _validate_items(self, path, obj, _):
""" validate option combination of Property object """
errs = []
if obj.type == 'void':
errs.append('void is only allowed in Operation object.')
return path, obj.__class__.__name__, errs |
java | protected void createSREArgsBlock(Composite parent, Font font) {
// Create the block for the SRE
final Group group = new Group(parent, SWT.NONE);
group.setFont(font);
final GridLayout layout = new GridLayout();
group.setLayout(layout);
group.setLayoutData(new GridData(GridData.FILL_BOTH));
// Move the SRE... |
java | protected final PrcPageWithSubaccTypes<RS>
createPutPrcPageWithSubaccTypes(
final Map<String, Object> pAddParam) throws Exception {
PrcPageWithSubaccTypes<RS> proc = new PrcPageWithSubaccTypes<RS>();
PrcEntitiesPage procDlg = (PrcEntitiesPage) this.fctBnProcessors
.lazyGet(pAddParam, PrcEntities... |
python | def save(self, processes=1, manifests=False):
"""
save will persist any changes that have been made to the bag
metadata (self.info).
If you have modified the payload of the bag (added, modified,
removed files in the data directory) and want to regenerate manifests
set th... |
java | public void marshall(CreateDataSourceRequest createDataSourceRequest, ProtocolMarshaller protocolMarshaller) {
if (createDataSourceRequest == null) {
throw new SdkClientException("Invalid argument passed to marshall(...)");
}
try {
protocolMarshaller.marshall(createData... |
python | def get_person_by_netid(self, netid):
"""
Returns a restclients.Person object for the given netid. If the
netid isn't found, or if there is an error communicating with the PWS,
a DataFailureException will be thrown.
"""
if not self.valid_uwnetid(netid):
raise... |
java | public static DiskInfo of(DiskId diskId, DiskConfiguration configuration) {
return newBuilder(diskId, configuration).build();
} |
python | def viewportEvent( self, event ):
"""
Displays the help event for the given index.
:param event | <QHelpEvent>
view | <QAbstractItemView>
option | <QStyleOptionViewItem>
index | <QModelIndex>
... |
python | def do_list(self, line):
"""list [path] Retrieve a list of available Science Data Objects from Member
Node The response is filtered by the from-date, to-date, search, start and count
session variables.
See also: search
"""
path = self._split_args(line, 0, 1, pad=False)
... |
java | public PoolAddHeaders withLastModified(DateTime lastModified) {
if (lastModified == null) {
this.lastModified = null;
} else {
this.lastModified = new DateTimeRfc1123(lastModified);
}
return this;
} |
java | @Override
public EEnum getIfcDerivedUnitEnum() {
if (ifcDerivedUnitEnumEEnum == null) {
ifcDerivedUnitEnumEEnum = (EEnum) EPackage.Registry.INSTANCE.getEPackage(Ifc4Package.eNS_URI)
.getEClassifiers().get(957);
}
return ifcDerivedUnitEnumEEnum;
} |
java | @Override
public WsResource getChild(String name) {
// Return null if the wrapped file is null, if it isn't an existing
// directory,
// or if we don't have a root. We will not resolve resources (or traverse
// parent/child)
// if we aren't associated with a root
if (... |
python | def _infer_tz_from_endpoints(start, end, tz):
"""
If a timezone is not explicitly given via `tz`, see if one can
be inferred from the `start` and `end` endpoints. If more than one
of these inputs provides a timezone, require that they all agree.
Parameters
----------
start : Timestamp
... |
python | def maybe_reverse_features(self, feature_map):
"""Reverse features between inputs and targets if the problem is '_rev'."""
if not self._was_reversed:
return
inputs = feature_map.pop("inputs", None)
targets = feature_map.pop("targets", None)
inputs_seg = feature_map.pop("inputs_segmentation", N... |
python | def check_auto_merge_labeler(repo: GithubRepository, pull_id: int
) -> Optional[CannotAutomergeError]:
"""
References:
https://developer.github.com/v3/issues/events/#list-events-for-an-issue
"""
url = ("https://api.github.com/repos/{}/{}/issues/{}/events"
... |
java | public static <T> T pickRandom (T[] values)
{
return (values == null || values.length == 0) ? null : values[getInt(values.length)];
} |
java | public final void ifStatement() throws RecognitionException {
int ifStatement_StartIndex = input.index();
Token s=null;
Token y=null;
ParserRuleReturnScope x =null;
ParserRuleReturnScope z =null;
JavaIfBlockDescr id = null;
JavaElseBlockDescr ed = null;
try {
if (... |
java | public static List<CPAttachmentFileEntry> toModels(
CPAttachmentFileEntrySoap[] soapModels) {
if (soapModels == null) {
return null;
}
List<CPAttachmentFileEntry> models = new ArrayList<CPAttachmentFileEntry>(soapModels.length);
for (CPAttachmentFileEntrySoap soapModel : soapModels) {
models.add(toMod... |
python | def get_message_type_by_id(self, message_type_id):
"""
Get a message type by message type ID
:param message_type_id: is the message type that
the client wants to retrieve
"""
self._validate_uuid(message_type_id)
url = "/notification/v1/mes... |
python | def fit(self, sequences, y=None):
"""Fit Preprocessing to X.
Parameters
----------
sequences : list of array-like, each of shape [sequence_length, n_features]
A list of multivariate timeseries. Each sequence may have
a different length, bu... |
java | @SuppressWarnings("unchecked")
public static final Map<?, ?> hidePasswords(Map<?, ?> map, int depth)
{
if (map != null && depth > 0) {
map = new HashMap<Object, Object>(map);
for (@SuppressWarnings("rawtypes")
Map.Entry entry : map.entrySet())
if (en... |
java | @SuppressWarnings("unchecked")
public <EngineComponent> EngineComponent[] getEngineComponents(Class<EngineComponent> clazz) {
String thisMethodName = "getEngineComponents";
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) {
SibTr.entry(tc, thisMethodName, clazz);
... |
java | public Observable<ContainerServiceInner> getByResourceGroupAsync(String resourceGroupName, String containerServiceName) {
return getByResourceGroupWithServiceResponseAsync(resourceGroupName, containerServiceName).map(new Func1<ServiceResponse<ContainerServiceInner>, ContainerServiceInner>() {
@Overr... |
java | protected ContextMenu getWeekDayViewMenu(ContextMenuParameter param) {
ContextMenu contextMenu = getDayViewBaseMenu(param);
WeekDayView weekDayView = (WeekDayView) param.getDateControl();
WeekView weekView = weekDayView.getWeekView();
Menu daysMenu = new Menu(Messages.getString("Context... |
java | public void waitForEntityStart() {
if (log.isDebugEnabled()) {
log.debug("waiting to ensure {} doesn't abort prematurely", this);
}
Duration startTimeout = getConfig(START_TIMEOUT);
CountdownTimer timer = startTimeout.countdownTimer();
boolean isRunningResult = false;... |
java | public static URIResolver createSAXURIResolver(Resolver resolver) {
final SAXResolver saxResolver = new SAXResolver(resolver);
return new URIResolver() {
public Source resolve(String href, String base) throws TransformerException {
try {
return saxResolver.resolve(href, base);
}
... |
java | public static <F extends PField> MappedField<F> withColumn(String name, F field) {
return new MappedField<>(name, field);
} |
python | def distance(cls, q0, q1):
"""Quaternion intrinsic distance.
Find the intrinsic geodesic distance between q0 and q1.
Params:
q0: the first quaternion
q1: the second quaternion
Returns:
A positive amount corresponding to the length of the geodesic arc... |
java | @Override
public RecordId getDataRecordId() {
long blkNum = (Long) rf.getVal(SCHEMA_RID_BLOCK).asJavaVal();
int id = (Integer) rf.getVal(SCHEMA_RID_ID).asJavaVal();
return new RecordId(new BlockId(dataFileName, blkNum), id);
} |
java | protected Class<?> loadClass(String name, boolean resolve) throws ClassNotFoundException {
synchronized (SYNCHRONIZATION_STRATEGY.initialize().getClassLoadingLock(this, name)) {
Class<?> type = findLoadedClass(name);
if (type != null) {
return type;
... |
python | def custom_callback(self, view_func):
"""
Wrapper function to use a custom callback.
The custom OIDC callback will get the custom state field passed in with
redirect_to_auth_server.
"""
@wraps(view_func)
def decorated(*args, **kwargs):
plainreturn, dat... |
java | private static void displayCategories(List<CategoryNode> categories, String prefix) {
for (CategoryNode category : categories) {
System.out.printf("%s%s [%s]%n", prefix, category.name, category.id);
displayCategories(category.children, String.format("%s%s > ", prefix, category.name));
}
} |
python | def CreateAllStaticECMWFRAPIDFiles(in_drainage_line,
river_id,
length_id,
slope_id,
next_down_id,
in_catchment,
... |
java | public static ExpressionModel computeExpression(String expression) {
// Si l'expression est vide
if(expression == null || expression.trim().length() == 0) {
// On retourne null
return null;
}
// On Instancie un model d'expression
ExpressionModel expressionModel = new ExpressionModel(... |
java | @NonNull
public static Term function(
@NonNull CqlIdentifier functionId, @NonNull Iterable<Term> arguments) {
return function(null, functionId, arguments);
} |
java | protected Expression transformAsString(Data data, String[] breakConditions) throws TemplateException {
Expression el = null;
// parse the houle Page String
comments(data);
// String
if ((el = string(data)) != null) {
data.mode = STATIC;
return el;
}
// Sharp
if ((el = sharp(data)) != null) {
da... |
java | public PolicyExecutor create(String identifier) {
return new PolicyExecutorImpl((ExecutorServiceImpl) globalExecutor, "PolicyExecutorProvider-" + identifier, null, policyExecutors);
} |
python | def _create_wx_app():
"""
Creates a wx.App instance if it has not been created sofar.
"""
wxapp = wx.GetApp()
if wxapp is None:
wxapp = wx.App(False)
wxapp.SetExitOnFrameDelete(True)
# retain a reference to the app object so it does not get garbage
# collected and cau... |
python | def _print_base64(self, base64_data):
"""
Pipe the binary directly to the label printer. Works under Linux
without requiring PySerial. This is not typically something you
should call directly, unless you have special needs.
@type base64_data: L{str}
@param base64... |
java | private boolean judgeHTMLCode(ArrayList<ArrayList<TextPiece>> wordsByPage) {
ArrayList<TextPiece> wordsOfPageOne = wordsByPage.get(0);
boolean isHTMLCode = true;
int i = 0;
/*
* do not have to check all words, Checking 10 words is enough
*/
while (i < Math.min(20, wordsOfPageOne.size())) {
TextPie... |
java | private String derivePackageName(Service service, Document iddDoc) {
String packageName = service.getPackageName();
if (packageName == null) {
packageName = readNamespaceAttr(iddDoc);
if (packageName == null) {
throw new PluginException("Cannot find a package name "
+ "(not specified in plugin an... |
java | public ListResourceRecordSetsResult withResourceRecordSets(ResourceRecordSet... resourceRecordSets) {
if (this.resourceRecordSets == null) {
setResourceRecordSets(new com.amazonaws.internal.SdkInternalList<ResourceRecordSet>(resourceRecordSets.length));
}
for (ResourceRecordSet ele :... |
python | def validate_metadata_sign(xml, cert=None, fingerprint=None, fingerprintalg='sha1', validatecert=False, debug=False):
"""
Validates a signature of a EntityDescriptor.
:param xml: The element we should validate
:type: string | Document
:param cert: The public cert
:type:... |
java | private List<String> getProjectResources() {
if (m_projectResources == null) {
try {
m_projectResources = getCms().readProjectResources(getReferenceProject());
} catch (Throwable e) {
LOG.error(e.getLocalizedMessage(), e);
// use an empty ... |
python | def show_periodical_tree_by_path(path):
"""
Render tree using it's path.
"""
path = unquote_plus(path)
trees = tree_handler().trees_by_path(path)
if not trees:
path = path.decode("utf-8")
abort(404, "Dokument s názvem '%s' není dostupný." % path)
return render_trees(
... |
java | private void obtainHint(@NonNull final TypedArray typedArray) {
setHint(typedArray.getText(R.styleable.EditTextPreference_android_hint));
} |
python | def delete_group_maintainer(self, grp_name, user):
"""Delete the given user to the named group.
Both group and user must already exist for this to succeed.
Args:
name (string): Name of group.
user (string): User to add to group.
Raises:
requests.HTT... |
python | def remove_old(self, max_log_time):
"""Remove all logs which are older than the specified time."""
files = glob.glob('{}/queue-*'.format(self.log_dir))
files = list(map(lambda x: os.path.basename(x), files))
for log_file in files:
# Get time stamp from filename
n... |
java | public static boolean getBooleanStyleable(Context ctx, @StyleableRes int styleable, boolean def) {
TypedArray ta = ctx.getTheme().obtainStyledAttributes(R.styleable.MaterialDrawer);
return ta.getBoolean(styleable, def);
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.