_id stringlengths 5 9 | text stringlengths 5 385k | title stringclasses 1
value |
|---|---|---|
doc_24700 | 10000 loops, best of 5: 30.2 usec per loop
$ python3 -m timeit '"-".join([str(n) for n in range(100)])'
10000 loops, best of 5: 27.5 usec per loop
$ python3 -m timeit '"-".join(map(str, range(100)))'
10000 loops, best of 5: 23.2 usec per loop
This can be achieved from the Python Interface with: >>> import timeit
>>> t... | |
doc_24701 |
Creates a criterion that optimizes a two-class classification logistic loss between input tensor xx and target tensor yy (containing 1 or -1). loss(x,y)=∑ilog(1+exp(−y[i]∗x[i]))x.nelement()\text{loss}(x, y) = \sum_i \frac{\log(1 + \exp(-y[i]*x[i]))}{\text{x.nelement}()}
Parameters
size_average (bool, optio... | |
doc_24702 |
Registry of available writer classes by human readable name. __init__()[source]
Methods
__init__()
is_available(name) Check if given writer is available by name.
list() Get a list of available MovieWriters.
register(name) Decorator for registering a class under a name. is_available(name)[source]
Ch... | |
doc_24703 |
Returns a copy of the calling offset object with n=1 and all other attributes equal. | |
doc_24704 | A bytes object which contains any bytes past the end of the compressed data. That is, this remains b"" until the last byte that contains compression data is available. If the whole bytestring turned out to contain compressed data, this is b"", an empty bytes object. | |
doc_24705 |
Adds a parameter to the module. The parameter can be accessed as an attribute using given name. Parameters
name (string) – name of the parameter. The parameter can be accessed from this module using the given name
param (Parameter) – parameter to be added to the module. | |
doc_24706 | In-place version of ldexp() | |
doc_24707 |
Immutable sequence used for indexing and alignment. The basic object storing axis labels for all pandas objects. UInt64Index is a special case of Index with purely unsigned integer labels. . Deprecated since version 1.4.0: In pandas v2.0 UInt64Index will be removed and NumericIndex used instead. UInt64Index will rem... | |
doc_24708 |
Draw the Artist (and its children) using the given renderer. This has no effect if the artist is not visible (Artist.get_visible returns False). Parameters
rendererRendererBase subclass.
Notes This method is overridden in the Artist subclasses. | |
doc_24709 | Alias for torch.div() with rounding_mode=None. | |
doc_24710 |
@dataclass
class InventoryItem:
"""Class for keeping track of an item in inventory."""
name: str
unit_price: float
quantity_on_hand: int = 0
def total_cost(self) -> float:
return self.unit_price * self.quantity_on_hand
Will add, among other things, a __init__() that looks like: def __init... | |
doc_24711 |
The number of output dimensions of this transform. Must be overridden (with integers) in the subclass. | |
doc_24712 |
Bases: object apply_aspect(position=None)[source]
cla()[source]
get_images_artists()[source]
[Deprecated] Notes Deprecated since version 3.5:
get_viewlim_mode()[source]
pick(mouseevent)[source]
set_viewlim_mode(mode)[source]
update_viewlim()[source]
[Deprecated] Notes Deprecated sinc... | |
doc_24713 | eject or open the cdrom drive eject() -> None This will open the cdrom drive and eject the cdrom. If the drive is playing or paused it will be stopped. | |
doc_24714 | See Migration guide for more details. tf.compat.v1.keras.layers.experimental.preprocessing.RandomTranslation
tf.keras.layers.experimental.preprocessing.RandomTranslation(
height_factor, width_factor, fill_mode='reflect',
interpolation='bilinear', seed=None, name=None, fill_value=0.0,
**kwargs
)
Argu... | |
doc_24715 | This method is called when an unrecognized declaration is read by the parser. The data parameter will be the entire contents of the declaration inside the <![...]> markup. It is sometimes useful to be overridden by a derived class. The base class implementation does nothing. | |
doc_24716 | os.MFD_ALLOW_SEALING
os.MFD_HUGETLB
os.MFD_HUGE_SHIFT
os.MFD_HUGE_MASK
os.MFD_HUGE_64KB
os.MFD_HUGE_512KB
os.MFD_HUGE_1MB
os.MFD_HUGE_2MB
os.MFD_HUGE_8MB
os.MFD_HUGE_16MB
os.MFD_HUGE_32MB
os.MFD_HUGE_256MB
os.MFD_HUGE_512MB
os.MFD_HUGE_1GB
os.MFD_HUGE_2GB
os.MFD_HUGE_16GB
These flags can... | |
doc_24717 | An assertion. test holds the condition, such as a Compare node. msg holds the failure message. >>> print(ast.dump(ast.parse('assert x,y'), indent=4))
Module(
body=[
Assert(
test=Name(id='x', ctx=Load()),
msg=Name(id='y', ctx=Load()))],
type_ignores=[]) | |
doc_24718 | Allows control over sharing of browsing context group with cross-origin documents. Values must be a member of the werkzeug.http.COOP enum. | |
doc_24719 | See torch.matmul() | |
doc_24720 | tf.math.count_nonzero(
input, axis=None, keepdims=None, dtype=tf.dtypes.int64, name=None
)
Reduces input along the dimensions given in axis. Unless keepdims is true, the rank of the tensor is reduced by 1 for each entry in axis. If keepdims is true, the reduced dimensions are retained with length 1. If axis has no... | |
doc_24721 | See Migration guide for more details. tf.compat.v1.linalg.tridiagonal_matmul
tf.linalg.tridiagonal_matmul(
diagonals, rhs, diagonals_format='compact', name=None
)
diagonals is representation of 3-diagonal NxN matrix, which depends on diagonals_format. In matrix format, diagonals must be a tensor of shape [..., M... | |
doc_24722 |
Write out the xref table. | |
doc_24723 |
Alias for set_antialiased. | |
doc_24724 | A dictionary. keys and values hold lists of nodes representing the keys and the values respectively, in matching order (what would be returned when calling dictionary.keys() and dictionary.values()). When doing dictionary unpacking using dictionary literals the expression to be expanded goes in the values list, with a ... | |
doc_24725 | An attribute value that must be a tuple listing valid path portions of the URL for receiving XML-RPC requests. Requests posted to other paths will result in a 404 “no such page” HTTP error. If this tuple is empty, all paths will be considered valid. The default value is ('/', '/RPC2'). | |
doc_24726 | 'blogs.blog': lambda o: "/blogs/%s/" % o.slug,
'news.story': lambda o: "/stories/%s/%s/" % (o.pub_year, o.slug),
}
The model name used in this setting should be all lowercase, regardless of the case of the actual model class name. ADMINS Default: [] (Empty list) A list of all the people who get code error noti... | |
doc_24727 | See Migration guide for more details. tf.compat.v1.linalg.LinearOperatorKronecker
tf.linalg.LinearOperatorKronecker(
operators, is_non_singular=None, is_self_adjoint=None,
is_positive_definite=None, is_square=None, name=None
)
This operator composes one or more linear operators [op1,...,opJ], building a new ... | |
doc_24728 | The cursor method accepts a single optional parameter factory. If supplied, this must be a callable returning an instance of Cursor or its subclasses. | |
doc_24729 |
l1-penalized covariance estimator Read more in the User Guide. Changed in version v0.20: graph_lasso has been renamed to graphical_lasso Parameters
emp_covndarray of shape (n_features, n_features)
Empirical covariance from which to compute the covariance estimate.
alphafloat
The regularization parameter: ... | |
doc_24730 | Dictionary mapping names accepted by sysconf() to the integer values defined for those names by the host operating system. This can be used to determine the set of names known to the system. Availability: Unix. | |
doc_24731 | The character used by the operating system to separate pathname components. This is '/' for POSIX and '\\' for Windows. Note that knowing this is not sufficient to be able to parse or concatenate pathnames — use os.path.split() and os.path.join() — but it is occasionally useful. Also available via os.path. | |
doc_24732 | Auto-negotiate the highest protocol version like PROTOCOL_TLS, but only support client-side SSLSocket connections. The protocol enables CERT_REQUIRED and check_hostname by default. New in version 3.6. | |
doc_24733 |
An ExtensionDtype for uint16 integer data. Changed in version 1.0.0: Now uses pandas.NA as its missing value, rather than numpy.nan. Attributes
None Methods
None | |
doc_24734 |
Alias for set_antialiased. | |
doc_24735 | Return the “protected” _info variable, a dictionary containing the metadata found in the message catalog file. | |
doc_24736 |
Remove key from the ParameterDict and return its parameter. Parameters
key (string) – key to pop from the ParameterDict | |
doc_24737 | class ast.Tuple(elts, ctx)
A list or tuple. elts holds a list of nodes representing the elements. ctx is Store if the container is an assignment target (i.e. (x,y)=something), and Load otherwise. >>> print(ast.dump(ast.parse('[1, 2, 3]', mode='eval'), indent=4))
Expression(
body=List(
elts=[
C... | |
doc_24738 | See Migration guide for more details. tf.compat.v1.raw_ops.TensorListStack
tf.raw_ops.TensorListStack(
input_handle, element_shape, element_dtype, num_elements=-1, name=None
)
Requires that all tensors have the same shape. input_handle: the input list tensor: the gathered result num_elements: optional. If not -1... | |
doc_24739 | Get a string that can be used as a format string for time.strftime() to represent a time in a locale-specific way. | |
doc_24740 |
Add a callback function that will be called whenever one of the Artist's properties changes. Parameters
funccallable
The callback function. It must have the signature: def func(artist: Artist) -> Any
where artist is the calling Artist. Return values may exist but are ignored. Returns
int
The observer id ... | |
doc_24741 | Generate a random UUID. | |
doc_24742 | Return a list of all the message’s header field names. | |
doc_24743 | Takes a set of valid lookup arguments for the model the ContentType represents, and does a get() lookup on that model, returning the corresponding object. | |
doc_24744 |
For GUI backends, show the figure window and redraw. For non-GUI backends, raise an exception, unless running headless (i.e. on Linux with an unset DISPLAY); this exception is converted to a warning in Figure.show. | |
doc_24745 |
Marching cubes algorithm to find surfaces in 3d volumetric data. In contrast with Lorensen et al. approach [2], Lewiner et al. algorithm is faster, resolves ambiguities, and guarantees topologically correct results. Therefore, this algorithm generally a better choice. Parameters
volume(M, N, P) array
Input data... | |
doc_24746 |
Get parameters for this estimator. Parameters
deepbool, default=True
If True, will return the parameters for this estimator and contained subobjects that are estimators. Returns
paramsdict
Parameter names mapped to their values. | |
doc_24747 |
Reseed a legacy MT19937 BitGenerator Notes This is a convenience, legacy function. The best practice is to not reseed a BitGenerator, rather to recreate a new one. This method is here for legacy reasons. This example demonstrates best practice. >>> from numpy.random import MT19937
>>> from numpy.random import RandomS... | |
doc_24748 | initialize the font module init() -> None This method is called automatically by pygame.init(). It initializes the font module. The module must be initialized before any other functions will work. It is safe to call this function more than once. | |
doc_24749 |
Draw a Gouraud-shaded triangle. Parameters
gcGraphicsContextBase
The graphics context.
points(3, 2) array-like
Array of (x, y) points for the triangle.
colors(3, 4) array-like
RGBA colors for each point of the triangle.
transformmatplotlib.transforms.Transform
An affine transform to apply to the poi... | |
doc_24750 | sklearn.datasets.load_iris(*, return_X_y=False, as_frame=False) [source]
Load and return the iris dataset (classification). The iris dataset is a classic and very easy multi-class classification dataset.
Classes 3
Samples per class 50
Samples total 150
Dimensionality 4
Features real, positive Read more in... | |
doc_24751 | Returns a dictionary of each lookup name registered in the class mapped to the Lookup class. | |
doc_24752 |
Bases: matplotlib.backend_tools.ZoomPanBase A Tool for zooming using a rectangle selector. cursor=3[source]
Cursor to use when the tool is active.
default_keymap=['o']
Keymap to associate with this tool. list[str]: List of keys that will trigger this tool when a keypress event is emitted on self.figure.canv... | |
doc_24753 |
Predict using the linear model. In addition to the mean of the predictive distribution, also its standard deviation can be returned. Parameters
X{array-like, sparse matrix} of shape (n_samples, n_features)
Samples.
return_stdbool, default=False
Whether to return the standard deviation of posterior predictio... | |
doc_24754 |
Construct a record array from a wide-variety of objects. A general-purpose record array constructor that dispatches to the appropriate recarray creation function based on the inputs (see Notes). Parameters
objany
Input object. See Notes for details on how various input types are treated.
dtypedata-type, optio... | |
doc_24755 | See Migration guide for more details. tf.compat.v1.TensorArraySpec
tf.TensorArraySpec(
element_shape=None, dtype=tf.dtypes.float32, dynamic_size=False,
infer_shape=True
)
Args
element_shape The shape of each element in the TensorArray.
dtype Data type of the TensorArray.
dynamic_size Whe... | |
doc_24756 |
Detect oriented FAST keypoints along with the corresponding scale. Parameters
image2D array
Input image. | |
doc_24757 | New in Django 4.0. Return context for rendering of errors in a template. The available context is:
errors : A list of the errors.
error_class : A string of CSS classes. | |
doc_24758 | Plus corresponds to the unary prefix plus operator in Python. This operation applies the context precision and rounding, so it is not an identity operation. | |
doc_24759 | This method takes one parameter, the name of a method implemented by the XML-RPC server. It returns an array of possible signatures for this method. A signature is an array of types. The first of these types is the return type of the method, the rest are parameters. Because multiple signatures (ie. overloading) is perm... | |
doc_24760 | The expression following from must be an exception or None. It will be set as __cause__ on the raised exception. Setting __cause__ also implicitly sets the __suppress_context__ attribute to True, so that using raise new_exc from None effectively replaces the old exception with the new one for display purposes (e.g. co... | |
doc_24761 | Flip tensor in the up/down direction, returning a new tensor. Flip the entries in each column in the up/down direction. Rows are preserved, but appear in a different order than before. Note Requires the tensor to be at least 1-D. Note torch.flipud makes a copy of input’s data. This is different from NumPy’s np.flipu... | |
doc_24762 |
Bases: matplotlib.ticker.Locator Place a tick on every multiple of some base number of points plotted, e.g., on every 5th point. It is assumed that you are doing index plotting; i.e., the axis is 0, len(data). This is mainly useful for x ticks. Place ticks every base data point, starting at offset. set_params(base=... | |
doc_24763 | Packs a fixed length string, s. n is the length of the string but it is not packed into the data buffer. The string is padded with null bytes if necessary to guaranteed 4 byte alignment. | |
doc_24764 |
Take NN tensors, each of which can be either scalar or 1-dimensional vector, and create NN N-dimensional grids, where the ii th grid is defined by expanding the ii th input over dimensions defined by other inputs. Parameters
tensors (list of Tensor) – list of scalars or 1 dimensional tensors. Scalars will be tr... | |
doc_24765 | get the height of the Surface get_height() -> height Return the height of the Surface in pixels. | |
doc_24766 | In-place version of baddbmm() | |
doc_24767 |
Generator on parameters sampled from given distributions. Non-deterministic iterable over random candidate combinations for hyper- parameter search. If all parameters are presented as a list, sampling without replacement is performed. If at least one parameter is given as a distribution, sampling with replacement is ... | |
doc_24768 | Optional. Either True or False. Default is False. Specifies whether folders in the specified location should be included. Either this or allow_files must be True. | |
doc_24769 | Fills self tensor with numbers sampled from the discrete uniform distribution over [from, to - 1]. If not specified, the values are usually only bounded by self tensor’s data type. However, for floating point types, if unspecified, range will be [0, 2^mantissa] to ensure that every value is representable. For example, ... | |
doc_24770 |
Applies a 2D average pooling over an input signal composed of several input planes. In the simplest case, the output value of the layer with input size (N,C,H,W)(N, C, H, W) , output (N,C,Hout,Wout)(N, C, H_{out}, W_{out}) and kernel_size (kH,kW)(kH, kW) can be precisely described as: out(Ni,Cj,h,w)=1kH∗kW∑m=0kH−1... | |
doc_24771 | The address used by the manager. | |
doc_24772 |
Start filtering. It simply create a new canvas (the old one is saved). | |
doc_24773 | class ast.Sub
class ast.Mult
class ast.Div
class ast.FloorDiv
class ast.Mod
class ast.Pow
class ast.LShift
class ast.RShift
class ast.BitOr
class ast.BitXor
class ast.BitAnd
class ast.MatMult
Binary operator tokens. | |
doc_24774 | self.bfloat16() is equivalent to self.to(torch.bfloat16). See to(). Parameters
memory_format (torch.memory_format, optional) – the desired memory format of returned Tensor. Default: torch.preserve_format. | |
doc_24775 |
The imaginary part of the array. Examples >>> x = np.sqrt([1+0j, 0+1j])
>>> x.imag
array([ 0. , 0.70710678])
>>> x.imag.dtype
dtype('float64') | |
doc_24776 | update the clock tick_busy_loop(framerate=0) -> milliseconds This method should be called once per frame. It will compute how many milliseconds have passed since the previous call. If you pass the optional framerate argument the function will delay to keep the game running slower than the given ticks per second. This... | |
doc_24777 | tf.compat.v1.tpu.experimental.embedding_column(
categorical_column, dimension, combiner='mean', initializer=None,
max_sequence_length=0, learning_rate_fn=None, embedding_lookup_device=None,
tensor_core_shape=None, use_safe_embedding_lookup=True
)
Note that the interface for tf.tpu.experimental.embedding_co... | |
doc_24778 |
Return the picking behavior of the artist. The possible values are described in set_picker. See also
set_picker, pickable, pick | |
doc_24779 | Parameters
rmode – one of the strings “auto”, “user”, “noresize” Set resizemode to one of the values: “auto”, “user”, “noresize”. If rmode is not given, return current resizemode. Different resizemodes have the following effects: “auto”: adapts the appearance of the turtle corresponding to the value of pensize. “u... | |
doc_24780 | The Location response-header field is used to redirect the recipient to a location other than the Request-URI for completion of the request or identification of a new resource. | |
doc_24781 | tf.compat.v1.layers.conv2d_transpose(
inputs, filters, kernel_size, strides=(1, 1), padding='valid',
data_format='channels_last', activation=None, use_bias=True,
kernel_initializer=None, bias_initializer=tf.zeros_initializer(),
kernel_regularizer=None, bias_regularizer=None, activity_regularizer=None,
... | |
doc_24782 |
Alias for set_ylim3d. | |
doc_24783 |
Create a new instance of ‘CCompilerOpt’ and generate the dispatch header which contains the #definitions and headers of platform-specific instruction-sets for the enabled CPU baseline and dispatch-able features. Parameters
compilerCCompiler instance
dispatch_hpathstr
path of the dispatch header **kwargs: pas... | |
doc_24784 |
Bases: matplotlib.offsetbox.DraggableBase save_offset()[source]
update_offset(dx, dy)[source] | |
doc_24785 | Call the system call setpgrp() or setpgrp(0, 0) depending on which version is implemented (if any). See the Unix manual for the semantics. Availability: Unix. | |
doc_24786 |
Generate a Legendre series with given roots. The function returns the coefficients of the polynomial \[p(x) = (x - r_0) * (x - r_1) * ... * (x - r_n),\] in Legendre form, where the r_n are the roots specified in roots. If a zero has multiplicity n, then it must appear in roots n times. For instance, if 2 is a root o... | |
doc_24787 | See torch.neg() | |
doc_24788 | See Migration guide for more details. tf.compat.v1.data.experimental.unbatch
tf.data.experimental.unbatch()
Warning: THIS FUNCTION IS DEPRECATED. It will be removed in a future version. Instructions for updating: Use tf.data.Dataset.unbatch(). For example, if elements of the dataset are shaped [B, a0, a1, ...], wher... | |
doc_24789 |
Log loss, aka logistic loss or cross-entropy loss. This is the loss function used in (multinomial) logistic regression and extensions of it such as neural networks, defined as the negative log-likelihood of a logistic model that returns y_pred probabilities for its training data y_true. The log loss is only defined f... | |
doc_24790 |
Replace a positional slice of a string with another value. Parameters
start:int, optional
Left index position to use for the slice. If not specified (None), the slice is unbounded on the left, i.e. slice from the start of the string.
stop:int, optional
Right index position to use for the slice. If not speci... | |
doc_24791 | See Migration guide for more details. tf.compat.v1.raw_ops.ReaderSerializeState
tf.raw_ops.ReaderSerializeState(
reader_handle, name=None
)
Not all Readers support being serialized, so this can produce an Unimplemented error.
Args
reader_handle A Tensor of type mutable string. Handle to a Reader.
na... | |
doc_24792 | class mmap.mmap(fileno, length, tagname=None, access=ACCESS_DEFAULT[, offset])
(Windows version) Maps length bytes from the file specified by the file handle fileno, and creates a mmap object. If length is larger than the current size of the file, the file is extended to contain length bytes. If length is 0, the maxi... | |
doc_24793 | sys.stdout
sys.stderr
File objects used by the interpreter for standard input, output and errors:
stdin is used for all interactive input (including calls to input());
stdout is used for the output of print() and expression statements and for the prompts of input(); The interpreter’s own prompts and its error me... | |
doc_24794 | Set maximum number of cached connections to m. | |
doc_24795 | Moves and/or casts the parameters and buffers. This can be called as
to(device=None, dtype=None, non_blocking=False)
to(dtype, non_blocking=False)
to(tensor, non_blocking=False)
to(memory_format=torch.channels_last)
Its signature is similar to torch.Tensor.to(), but only accepts floating point or comple... | |
doc_24796 | See Migration guide for more details. tf.compat.v1.math.xdivy
tf.math.xdivy(
x, y, name=None
)
Args
x A Tensor. Must be one of the following types: half, float32, float64, complex64, complex128.
y A Tensor. Must have the same type as x.
name A name for the operation (optional).
Retur... | |
doc_24797 | tf.keras.applications.mobilenet_v2.MobileNetV2 Compat aliases for migration See Migration guide for more details. tf.compat.v1.keras.applications.MobileNetV2, tf.compat.v1.keras.applications.mobilenet_v2.MobileNetV2
tf.keras.applications.MobileNetV2(
input_shape=None, alpha=1.0, include_top=True, weights='imagene... | |
doc_24798 |
Shift the zero-frequency component to the center of the spectrum. This function swaps half-spaces for all axes listed (defaults to all). Note that y[0] is the Nyquist component only if len(x) is even. Parameters
xarray_like
Input array.
axesint or shape tuple, optional
Axes over which to shift. Default is N... | |
doc_24799 | tf.compat.v1.layers.conv3d_transpose(
inputs, filters, kernel_size, strides=(1, 1, 1), padding='valid',
data_format='channels_last', activation=None, use_bias=True,
kernel_initializer=None, bias_initializer=tf.zeros_initializer(),
kernel_regularizer=None, bias_regularizer=None, activity_regularizer=None... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.