language stringclasses 2
values | func_code_string stringlengths 63 466k |
|---|---|
java | public Matrix4f translationRotate(float tx, float ty, float tz, float qx, float qy, float qz, float qw) {
float w2 = qw * qw;
float x2 = qx * qx;
float y2 = qy * qy;
float z2 = qz * qz;
float zw = qz * qw;
float xy = qx * qy;
float xz = qx * qz;
float yw =... |
java | public synchronized void updateDeployMode(DeployMode mode) {
mDeployMode = mode;
if (mDeployMode == DeployMode.EMBEDDED) {
// Ensure that the journal properties are set correctly.
for (int i = 0; i < mMasters.size(); i++) {
Master master = mMasters.get(i);
MasterNetAddress address = ... |
java | public Observable<ServiceResponse<ValidateResponseInner>> validateWithServiceResponseAsync(String resourceGroupName, ValidateRequest validateRequest) {
if (resourceGroupName == null) {
throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.");
}
... |
python | def _bnd(self, xloc, cache, **kwargs):
"""
Example:
>>> dist = chaospy.J(chaospy.Uniform(), chaospy.Normal())
>>> print(dist.range([[-0.5, 0.5, 1.5], [-1, 0, 1]]))
[[[ 0. 0. 0. ]
[-7.5 -7.5 -7.5]]
<BLANKLINE>
[[ 1. 1. 1. ... |
python | def sync(self, length):
"""
synchronized weave sync trigger
"""
# go in wave stream to the first bit
try:
self.next()
except StopIteration:
print "Error: no bits identified!"
sys.exit(-1)
log.info("First bit is at: %s" % self.... |
python | def _thresholds_init(self):
"""
Initiate and check any thresholds set
"""
thresholds = getattr(self._py3status_module, "thresholds", [])
self._thresholds = {}
if isinstance(thresholds, list):
try:
thresholds.sort()
except TypeError:... |
java | private void safetyExit(Process process) throws IOException {
process.getErrorStream().close();
process.getInputStream().close();
process.getOutputStream().close();
} |
python | def _get_part(pointlist, strokes):
"""Get some strokes of pointlist
Parameters
----------
pointlist : list of lists of dicts
strokes : list of integers
Returns
-------
list of lists of dicts
"""
result = []
strokes = sorted(strokes)
for stroke_index in strokes:
... |
python | def guest_inspect_vnics(self, userid_list):
"""Get the vnics statistics of the guest virtual machines
:param userid_list: a single userid string or a list of guest userids
:returns: dictionary describing the vnics statistics of the vm
in the form
{'UID1':
... |
python | def add(self, match, handler):
"""Register a handler with the Router.
:param match: The first argument passed to the :meth:`match` method
when checking against this handler.
:param handler: A callable or :class:`Route` instance that will handle
matching calls. If not a R... |
java | public static boolean matches(String[] patterns, String value) {
for (int i = 0; i < patterns.length; i++) {
String pattern = patterns[i];
if (pattern.equals(value)) {
return true;
}
if (pattern.endsWith("*")) {
if (value.sta... |
python | def _cache_dataset(dataset, prefix):
"""Cache the processed npy dataset the dataset into a npz
Parameters
----------
dataset : SimpleDataset
file_path : str
"""
if not os.path.exists(_constants.CACHE_PATH):
os.makedirs(_constants.CACHE_PATH)
src_data = np.concatenate([e[0] for e... |
java | @Override
public <T> void apply(final Query<T> query) {
pathProperties.each(props -> {
String path = props.getPath();
String propsStr = props.getPropertiesAsString();
if (path == null || path.isEmpty()) {
query.select(propsStr);
} else {
... |
java | private static int getHttpTimeout(Storage st) {
if (!(st instanceof NNStorage))
return DFS_IMAGE_TRANSFER_TIMEOUT_DEFAULT;
NNStorage storage = (NNStorage) st;
if (storage == null || storage.getConf() == null) {
return DFS_IMAGE_TRANSFER_TIMEOUT_DEFAULT;
}
return storage.getConf().getInt... |
python | def invoke_task(task, args):
"""
Parse args and invoke task function.
:param task: task function to invoke
:param args: arguments to the task (list of str)
:return: result of task function
:rtype: object
"""
parser, proxy_args = get_task_parser(task)
if proxy_args:
return ta... |
java | private RPC<V> handleLocal() {
assert _dt.getCompleter()==null;
_dt.setCompleter(new H2O.H2OCallback<DTask>() {
@Override public void callback(DTask dt) {
synchronized(RPC.this) {
_done = true;
RPC.this.notifyAll();
}
doAllCompletions();
}
... |
python | def get_hierarchies(self):
"""Gets the hierarchy list resulting from the search.
return: (osid.hierarchy.HierarchyList) - the hierarchy list
raise: IllegalState - the hierarchy list was already retrieved
*compliance: mandatory -- This method must be implemented.*
"""
i... |
python | def get_bit_series(self, bits=None):
"""Get the `StateTimeSeries` for each bit of this `StateVector`.
Parameters
----------
bits : `list`, optional
a list of bit indices or bit names, defaults to all bits
Returns
-------
bitseries : `StateTimeSeriesD... |
python | def bgred(cls, string, auto=False):
"""Color-code entire string.
:param str string: String to colorize.
:param bool auto: Enable auto-color (dark/light terminal).
:return: Class instance for colorized string.
:rtype: Color
"""
return cls.colorize('bgred', string... |
java | private void tryCreateAdapters()
{
Object object = context;
for( int p = 0; p < path.length; p++ )
{
if( object == null )
return;
// if no adapter has yet been created for this pathItem
if( adapters[p] == null )
{
String pathItem = path[p];
// try to find an adapter, otherwise creat... |
java | public Metadata readNextMetadata() throws IOException {
Metadata metadata = null;
boolean isLast = (bitStream.readRawUInt(Metadata.STREAM_METADATA_IS_LAST_LEN) != 0);
int type = bitStream.readRawUInt(Metadata.STREAM_METADATA_TYPE_LEN);
int length = bitStream.readRawUInt(Metadata... |
java | @Override
public T visitExpression(Expression elm, C context) {
if (elm instanceof Code) return visitCode((Code)elm, context);
else if (elm instanceof CodeSystemRef) return visitCodeSystemRef((CodeSystemRef)elm, context);
else if (elm instanceof Concept) return visitConcept((Concept)elm, con... |
python | def transform(testtype):
'''
A lot of these transformations are from tasks before task labels and some of them are if we
grab data directly from Treeherder jobs endpoint instead of runnable jobs API.
'''
# XXX: Evaluate which of these transformations are still valid
if testtype.startswith('[funs... |
python | def area_to_tile_list(self, lat, lon, width, height, ground_width, zoom=None):
'''return a list of TileInfoScaled objects needed for
an area of land, with ground_width in meters, and
width/height in pixels.
lat/lon is the top left corner. If unspecified, the
zoom is automatically chosen to avoid having to gr... |
python | def _checkParam(param, value, paramlimits, paramtypes):
"""Checks if `value` is allowable value for `param`.
Raises except if `value` is not acceptable, otherwise
returns `None` if value is acceptable.
`paramlimits` and `paramtypes` are the `PARAMLIMITS`
and `PARAMTYPES` attributes of a `Model`.
... |
python | def create_tree_view(self, model=None):
"""
Function creates a tree_view with model
"""
tree_view = Gtk.TreeView()
if model is not None:
tree_view.set_model(model)
return tree_view |
python | def is_literal_eval(node_or_string) -> tuple:
"""
Check if an expresion can be literal_eval.
----------
node_or_string :
Input
Returns
-------
tuple
(bool,python object)
If it can be literal_eval the python object is returned. Otherwise None it is returne... |
python | def get_password(request, mapping) -> None:
"""
Resolve the given credential request in the provided mapping definition.
The result is printed automatically.
Args:
request:
The credential request specified as a dict of key-value pairs.
mapping:
The mapping confi... |
python | def data(self):
'''email content for this message'''
# return data after any initial offset, plus content offset to
# skip header, up to the size of this message
return self.mmap[self.content_offset + self._offset: self._offset + self.size] |
python | def is_bbox_not_intersecting(self, other):
"""Returns False iif bounding boxed of self and other intersect"""
self_x_min, self_x_max, self_y_min, self_y_max = self.get_bbox()
other_x_min, other_x_max, other_y_min, other_y_max = other.get_bbox()
return \
self_x_min > other_x... |
java | static public int calculateByteLength(CharSequence charSeq, char[] charBuffer, int charOffset, int charLength) {
int c = 0;
int byteLength = 0;
int charPos = charOffset; // start at char offset
int charAbsLength = charPos + charLength;
if (charBuffer == null) {
... |
java | public synchronized CmsResource createResource(
CmsRequestContext context,
String resourcename,
int type,
byte[] content,
List<CmsProperty> properties)
throws CmsException {
String checkExistsPath = "/".equals(resourcename) ? "/" : CmsFileUtil.removeTrailingSeparator... |
java | public static File getFileIfReadable(String _file) throws IOException {
if (StringUtil.isBlank(_file)) {
throw new IOException("Empty or null string is not a valid file");
}
File file = new File(_file);
if (!file.exists()) {
throw new FileNotFoundException("No s... |
java | static FileStatus[] pruneFileListBySize(long maxFileSize, FileStatus[] origList, FileSystem hdfs,
Path inputPath) {
LOG.info("Pruning orig list of size " + origList.length + " for source" + inputPath.toUri());
long fileSize = 0L;
List<FileStatus> prunedFileList = new ArrayList<FileStatus>();
Se... |
java | public static Point nearestSegmentPoint(double startX, double startY, double endX, double endY, double pointX, double pointY) {
double xDiff = endX - startX;
double yDiff = endY - startY;
double length2 = xDiff * xDiff + yDiff * yDiff;
if (length2 == 0) return new Point(startX, startY);
... |
python | def move_partition(self, rg_destination, victim_partition):
"""Move partition(victim) from current replication-group to destination
replication-group.
Step 1: Evaluate source and destination broker
Step 2: Move partition from source-broker to destination-broker
"""
# Sel... |
java | private static void writeProfileForTree(final PrintWriter writer,
final Map<WComponent, UicStats.Stat> treeStats) {
// Copy all the stats into a list so we can sort and cull.
List<UicStats.Stat> statList = new ArrayList<>(treeStats.values());
Comparator<UicStats.Stat> comparator = new Comparator<UicStats.Stat... |
java | protected OutputStream createOutputStream() throws IOException {
if (asFile().isPresent()) {
return new FileOutputStream(asFile().orElse(null));
}
return null;
} |
python | def load(self):
"""
Load dependencies for all loaded schemas.
This method gets called before any operation that requires dependencies: delete, drop, populate, progress.
"""
# reload from scratch to prevent duplication of renamed edges
self.clear()
# load primary... |
java | @Indexable(type = IndexableType.REINDEX)
@Override
public CommerceOrder addCommerceOrder(CommerceOrder commerceOrder) {
commerceOrder.setNew(true);
return commerceOrderPersistence.update(commerceOrder);
} |
python | def _identify_surface_sites(self, thickness):
"""Label surface sites and add ports above them. """
for atom in self.particles():
if len(self.bond_graph.neighbors(atom)) == 1:
if atom.name == 'O' and atom.pos[2] > thickness:
atom.name = 'OS'
... |
java | public static String concatWithSpaces(final Object... osToString) {
final StringBuilder b = new StringBuilder();
boolean notFirst = false;
if (osToString != null) {
for (final Object o : osToString) {
if (notFirst) {
b.append(" ");
... |
java | @Override
public boolean generateClusterPlugin(String cluster) {
boolean result = false;
PluginUtilityConfigGenerator mBean = this.pluginConfigMbeans.get(PluginUtilityConfigGenerator.Types.COLLECTIVE);
if (mBean != null) {
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEn... |
java | public void updateLastSeenUniqueIds(VoltMessage message)
{
long sequenceWithUniqueId = Long.MIN_VALUE;
boolean commandLog = (message instanceof TransactionInfoBaseMessage &&
(((TransactionInfoBaseMessage)message).isForReplay()));
boolean sentinel = message instanceof MultiP... |
java | public static <T extends View> ArrayList<T> removeInvisibleViews(Iterable<T> viewList) {
ArrayList<T> tmpViewList = new ArrayList<T>();
for (T view : viewList) {
if (view != null && view.isShown()) {
tmpViewList.add(view);
}
}
return tmpViewList;
} |
python | def rigid_transform_from_ros(from_frame, to_frame, service_name='rigid_transforms/rigid_transform_listener', namespace=None):
"""Gets transform from ROS as a rigid transform
Requires ROS rigid_transform_publisher service to be running. Assuming autolab_core is installed as a catkin package,
... |
python | def create(observation_data,
user_id='user_id', item_id='item_id', target=None,
user_data=None, item_data=None,
random_seed=0,
verbose=True):
"""
Create a model that makes recommendations using item popularity. When no
target column is provided, the popularity is ... |
python | def serveDay(self, request, year=None, month=None, dom=None):
"""The events of the day list view."""
myurl = self.get_url(request)
today = timezone.localdate()
if year is None: year = today.year
if month is None: month = today.month
if dom is None: dom = today.day
... |
java | protected void openEditLoginMessageDialog() {
Window window = CmsBasicDialog.prepareWindow();
CmsBasicDialog dialog = new CmsEditLoginView(window);
window.setContent(dialog);
window.setCaption(CmsVaadinUtils.getMessageText(Messages.GUI_MESSAGES_LOGINMESSAGE_TOOL_NAME_0));
dialog... |
java | public java.util.List<? extends com.google.privacy.dlp.v2.FieldIdOrBuilder>
getHeadersOrBuilderList() {
return headers_;
} |
java | @Override
public Set<String> getContextLabels() {
final Set<String> labels = new HashSet<>();
for (final Pair<String, Object> pair : contextValues) {
labels.add(pair.getKey());
}
return labels;
} |
java | static void checkFamilyID(final int familyID) {
final Family family = Family.idToFamily(familyID);
if (!family.equals(Family.QUANTILES)) {
throw new SketchesArgumentException(
"Possible corruption: Invalid Family: " + family.toString());
}
} |
java | public Object get(String propName) {
if (propName.equals("uniqueId")) {
return getUniqueId();
}
if (propName.equals("uniqueName")) {
return getUniqueName();
}
if (propName.equals("externalId")) {
return getExternalId();
}
if (pr... |
python | def send_facebook(self, token):
"""
Tells the server which Facebook account this client uses.
After sending, the server takes some time to
get the data from Facebook.
Seems to be broken in recent versions of the game.
"""
self.send_struct('<B%iB' % len(token), 8... |
java | public static CollectionFactoryManager getInstance() {
if (instance == null) {
synchronized (CollectionFactoryManagerImpl.class) {
if (instance == null) {
CollectionFactoryManagerImpl manager = new CollectionFactoryManagerImpl();
manager.initialize();
instance = manager;... |
python | def main(cls, args, settings=None, userdata=None): # pylint: disable=too-many-branches,too-many-statements
"""Main entry point of this module.
"""
# The command-line client uses Service Account authentication.
logger.info('Using Compute Engine credentials from %s', Focus.info(args.conf.... |
python | def getTriples(pointing):
"""Get all triples of a specified pointing ID.
Defaults is to return a complete list triples."""
sql="SELECT id FROM triples t join triple_members m ON t.id=m.triple"
sql+=" join bucket.exposure e on e.expnum=m.expnum "
sql+=" WHERE pointing=%s group by id order by e.ex... |
java | public static void checkTypeConsistency(Schema schema,
PartitionStrategy strategy,
String fieldName, Object... values) {
Schema fieldSchema = fieldSchema(schema, strategy, fieldName);
for (Object value : values) {
// Spec... |
java | public Number getCurrency(int field) throws MPXJException
{
Number result;
if ((field < m_fields.length) && (m_fields[field].length() != 0))
{
try
{
result = m_formats.getCurrencyFormat().parse(m_fields[field]);
}
catch (ParseException ex)
... |
python | def batch_iter(data, batch_size, num_epochs):
"""Generates a batch iterator for a dataset."""
data = np.array(data)
data_size = len(data)
num_batches_per_epoch = int(len(data)/batch_size) + 1
for epoch in range(num_epochs):
# Shuffle the data at each epoch
shuffle_indices = np.random... |
python | def encoded_query(self):
"""Returns the encoded query string of the URL. This may be different from the rawquery element,
as that contains the query parsed by urllib but unmodified.
The return value takes the form of key=value&key=value, and it never contains a leading question mark.
"""... |
python | def _xml_to_dict(xmltree):
'''
Convert an XML tree into a dict
'''
if sys.version_info < (2, 7):
children_len = len(xmltree.getchildren())
else:
children_len = len(xmltree)
if children_len < 1:
name = xmltree.tag
if '}' in name:
comps = name.split('}'... |
java | public static void get(HttpConsumer<HttpExchange> endpoint, MediaTypes... mediaTypes) {
addResource(Methods.GET, HandlerUtil.BASE_PATH, endpoint, mediaTypes);
} |
python | def fetch(self, filter=None, order_by=None, group_by=[], page=None, page_size=None, query_parameters=None, commit=True, async=False, callback=None):
""" Fetch objects according to given filter and page.
Note:
This method fetches all managed class objects and store them
... |
python | def rewrite_packaging(pkg_files, new_root):
"""
Rewrite imports in packaging to redirect to vendored copies.
"""
for file in pkg_files.glob('*.py'):
text = file.text()
text = re.sub(r' (pyparsing|six)', rf' {new_root}.\1', text)
file.write_text(text) |
java | public Double getValue(GriddedTile griddedTile, float pixelValue) {
Double value = null;
if (!isDataNull(pixelValue)) {
value = pixelValueToValue(griddedTile, new Double(pixelValue));
}
return value;
} |
python | def ConfigureViewTypeChoices( self, event=None ):
"""Configure the set of View types in the toolbar (and menus)"""
self.viewTypeTool.SetItems( getattr( self.loader, 'ROOTS', [] ))
if self.loader and self.viewType in self.loader.ROOTS:
self.viewTypeTool.SetSelection( self.loader.ROOTS... |
java | private String listToCSV(List<String> list) {
String csvStr = "";
for (String item : list) {
csvStr += "," + item;
}
return csvStr.length() > 1 ? csvStr.substring(1) : csvStr;
} |
python | def _set_default_format(self, vmin, vmax):
"Returns the default ticks spacing."
if self.plot_obj.date_axis_info is None:
self.plot_obj.date_axis_info = self.finder(vmin, vmax, self.freq)
info = self.plot_obj.date_axis_info
if self.isminor:
format = np.compress(i... |
java | public Object seek(String strSeekSign, int iOpenMode, String strKeyArea, String strFields, Object objKeyData) throws DBException, RemoteException
{
int iOldOpenMode = this.getMainRecord().getOpenMode();
try {
Utility.getLogger().info("EJB Seek sign: " + strSeekSign + " key: " + strKeyA... |
python | def get_what_txt(self):
"""
Overrides the base behaviour defined in ValidationError in order to add details about the function.
:return:
"""
return 'input [{var}] for function [{func}]'.format(var=self.get_variable_str(),
... |
java | private void setAreaAreaPredicates_() {
m_predicates_half_edge = Predicates.AreaAreaPredicates;
m_max_dim[MatrixPredicate.InteriorInterior] = 2;
m_max_dim[MatrixPredicate.InteriorBoundary] = 1;
m_max_dim[MatrixPredicate.InteriorExterior] = 2;
m_max_dim[MatrixPredicate.BoundaryIn... |
python | def Reverse(self, y):
"""Looks up y and returns the corresponding value of x."""
return self._Bisect(y, self.ys, self.xs) |
java | @SuppressWarnings("fallthrough")
static Map<Method, String> validate(Object subscriber, List<Method> subscriberMethods) {
Map<Method, String> errors = new HashMap<Method, String>(subscriberMethods.size());
for (Method method : subscriberMethods) {
Subscribe subscribeAnnotation = method.g... |
python | def update(self):
"""Updates an instance within a project.
For example:
.. literalinclude:: snippets.py
:start-after: [START bigtable_update_instance]
:end-before: [END bigtable_update_instance]
.. note::
Updates any or all of the following values:... |
java | private DataSet doDelimitedFile(final Reader dataSource, final boolean createMDFromFile) throws IOException {
if (dataSource == null) {
throw new IllegalArgumentException("dataSource is null");
}
final DefaultDataSet ds = new DefaultDataSet(getPzMetaData(), this);
try (B... |
java | public static base_responses delete(nitro_service client, route resources[]) throws Exception {
base_responses result = null;
if (resources != null && resources.length > 0) {
route deleteresources[] = new route[resources.length];
for (int i=0;i<resources.length;i++){
deleteresources[i] = new route();
... |
python | def create_tables(name, runSetResults, rows, rowsDiff, outputPath, outputFilePattern, options):
'''
Create tables and write them to files.
@return a list of futures to allow waiting for completion
'''
# get common folder of sourcefiles
common_prefix = os.path.commonprefix([r.filename for r in r... |
java | public Map<String,Object> asMap(){
if(source == null)
return null;
return (Map<String,Object>)source;
} |
python | def natural(value, argument='argument'):
""" Restrict input type to the natural numbers (0, 1, 2, 3...) """
value = _get_integer(value)
if value < 0:
error = ('Invalid {arg}: {value}. {arg} must be a non-negative '
'integer'.format(arg=argument, value=value))
raise ValueErro... |
java | public static base_responses add(nitro_service client, systemgroup resources[]) throws Exception {
base_responses result = null;
if (resources != null && resources.length > 0) {
systemgroup addresources[] = new systemgroup[resources.length];
for (int i=0;i<resources.length;i++){
addresources[i] = new syst... |
python | def _dict_merge_right(dict_left, dict_right, merge_method):
"""See documentation of mpu.datastructures.dict_merge."""
new_dict = deepcopy(dict_left)
for key, value in dict_right.items():
if key not in new_dict:
new_dict[key] = value
else:
recurse = (merge_method == 't... |
java | public boolean add(final Process process) {
synchronized (processes) {
// if this list is empty, register the shutdown hook
if (processes.size() == 0) {
try {
if(shutDownHookExecuted) {
throw new IllegalStateException();
}
addShutdownHook();
}
... |
python | def assertType(var, *allowedTypes):
"""
Asserts that a variable @var is of an @expectedType. Raises a TypeError
if the assertion fails.
"""
if not isinstance(var, *allowedTypes):
raise NotImplementedError("This operation is only supported for {}. "\
"Instead found {}".format(str(... |
python | def get_tag_value(x, key):
"""Get a value from tag"""
if x is None:
return ''
result = [y['Value'] for y in x if y['Key'] == key]
if result:
return result[0]
return '' |
python | def _media(self):
"""
Returns a forms.Media instance with the basic editor media and media
from all registered extensions.
"""
css = ['markymark/css/markdown-editor.css']
iconlibrary_css = getattr(
settings,
'MARKYMARK_FONTAWESOME_CSS',
... |
python | def transform(self, X):
"""
Parameters
----------
X : array-like, shape [n x m]
The mask in form of n x m array.
"""
if self.binary_:
return (X & self.definition_ > 0).astype(int)
return (X == self.definition_).astype(int) |
java | public void setDisableStaticMappingCache(){
if (this.contextParams != null){
String value = (String) this.contextParams.get("com.ibm.ws.webcontainer.DISABLE_STATIC_MAPPING_CACHE");
if (value != null ){
if (value.equalsIgnoreCase("true")){
if (com.ibm.e... |
python | def _trim_fields(self, docs):
'''
Removes ignore fields from the data that we got from Solr.
'''
for doc in docs:
for field in self._ignore_fields:
if field in doc:
del(doc[field])
return docs |
python | def poll_devices(self):
"""Request status updates from each device."""
for addr in self.devices:
device = self.devices[addr]
if not device.address.is_x10:
device.async_refresh_state() |
python | def _take_screenshot(self):
"""Take a screenshot, also called by Mixin
Args:
- filename(string): file name to save
Returns:
PIL Image object
"""
raw_png = self._wda.screenshot()
img = Image.open(BytesIO(raw_png))
return img |
java | private static SignatureHolder buildSignatureHolder(String privateKey, String publicKey,
Algorithms algorithms) {
log.debug("构建SignatureHolder");
try {
log.debug("构建公钥以及验签器");
RSAPublicKey pubKey = (RSAPublicKey) KeyTools.ge... |
java | public void valueUnbound(HttpSessionBindingEvent event)
{
Utility.getLogger().info("Session Unbound");
if (this.getMainTask() == null)
this.free();
else // Never - This would mean the session was released before the http response was sent (memory leak)
Utility.getL... |
python | def nat_gateway_absent(name=None, subnet_name=None, subnet_id=None,
region=None, key=None, keyid=None, profile=None,
wait_for_delete_retries=0):
'''
Ensure the nat gateway in the named subnet is absent.
This function requires boto3.
.. versionadded:: 2016.... |
python | def render_image(self, rgbobj, dst_x, dst_y):
"""Render the image represented by (rgbobj) at dst_x, dst_y
in the pixel space.
"""
pos = (0, 0)
arr = self.viewer.getwin_array(order=self.rgb_order, alpha=1.0,
dtype=np.uint8)
#pos = (ds... |
python | def fromutc(self, dt):
'''See datetime.tzinfo.fromutc'''
if dt.tzinfo is not None and dt.tzinfo is not self:
raise ValueError('fromutc: dt.tzinfo is not self')
return (dt + self._utcoffset).replace(tzinfo=self) |
python | def _set_fallback(elements, src_field, fallback, dest_field=None):
"""
Helper function used to set the fallback attributes of an element when
they are defined by the configuration as "None" or "-".
"""
if dest_field is None:
dest_field = src_field
if isinstan... |
python | def dropfile(cachedir, user=None):
'''
Set an AES dropfile to request the master update the publish session key
'''
dfn = os.path.join(cachedir, '.dfn')
# set a mask (to avoid a race condition on file creation) and store original.
with salt.utils.files.set_umask(0o277):
log.info('Rotatin... |
python | def do_add(self, subcmd, opts, *args):
"""Put files and directories under version control, scheduling
them for addition to repository. They will be added in next commit.
usage:
add PATH...
${cmd_option_list}
"""
print "'svn %s' opts: %s" % (subcmd, ... |
java | public E pop() {
E obj;
int len = size();
obj = peek();
remove(len - 1);
return obj;
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.