text stringlengths 81 112k |
|---|
Returns the section which contains the data of DataDirectory
def _getSectionForDataDirectoryEntry(self, data_directory_entry, sections):
"""Returns the section which contains the data of DataDirectory"""
for section in sections:
if data_directory_entry.VirtualAddress >= section.header.Virtu... |
Parses the entries of the DataDirectory and returns a list of the content
def _parseDataDirectory(self, data, sections, imageNtHeaders):
"""Parses the entries of the DataDirectory and returns a list of the content"""
data_directory_data_list = [None for i in range(15)]
# parse DataDirectory[Ex... |
Parses the EmportDataDirectory and returns an instance of ExportDirectoryData
def _parseDataDirectoryExport(self, data, dataDirectoryEntry, exportSection):
"""Parses the EmportDataDirectory and returns an instance of ExportDirectoryData"""
if not exportSection:
return
functions = []... |
Parses the ImportDataDirectory and returns a list of ImportDescriptorData
def _parseDataDirectoryImport(self, dataDirectoryEntry, importSection):
"""Parses the ImportDataDirectory and returns a list of ImportDescriptorData"""
if not importSection:
return
raw_bytes = (c_ubyte * dat... |
Parses the thunks and returns a list
def __parseThunks(self, thunkRVA, importSection):
"""Parses the thunks and returns a list"""
offset = to_offset(thunkRVA, importSection)
table_offset = 0
thunks = []
while True:
thunk = IMAGE_THUNK_DATA.from_buffer(importSection.r... |
Parses the data of a thunk and sets the data
def __parseThunkData(self, thunk,importSection):
"""Parses the data of a thunk and sets the data"""
offset = to_offset(thunk.header.AddressOfData, importSection)
if 0xf0000000 & thunk.header.AddressOfData == 0x80000000:
thunk.ordinal = th... |
Returns a void pointer to the data
def get_ptr(data, offset=None, ptr_type=ctypes.c_void_p):
"""Returns a void pointer to the data"""
ptr = ctypes.cast(ctypes.pointer(data), ctypes.c_void_p)
if offset:
ptr = ctypes.c_void_p(ptr.value + offset)
if ptr_type != ctypes.c_void_p:
ptr = cty... |
Returns a c_ubyte_array filled with the given data of a bytearray or bytes
def to_ubyte_array(barray):
"""Returns a c_ubyte_array filled with the given data of a bytearray or bytes"""
bs = (ctypes.c_ubyte * len(barray))()
pack_into('%ds' % len(barray), bs, 0, barray)
return bs |
Returns the bytes of the file.
def _readFile(self, fileName):
"""
Returns the bytes of the file.
"""
with open(fileName, 'rb') as binFile:
b = binFile.read()
return to_ubyte_array(b) |
Returns the class which holds the suitable classes for the loaded file
def _getSuitableClasses(self, data):
"""Returns the class which holds the suitable classes for the loaded file"""
classes = None
if data[EI.CLASS] == ELFCLASS.BITS_32:
if data[EI.DATA] == ELFDATA.LSB:
... |
Returns the elf header
def _parseElfHeader(self, data):
"""Returns the elf header"""
ehdr = self.__classes.EHDR.from_buffer(data)
return EhdrData(header=ehdr) |
Return a list of segments
def _parseSegments(self, data, elfHeader):
"""Return a list of segments"""
offset = elfHeader.header.e_phoff
segments = []
for i in range(elfHeader.header.e_phnum):
phdr = self.__classes.PHDR.from_buffer(data, offset)
segment_bytes = (c_... |
Returns a list of sections
def _parseSections(self, data, elfHeader):
"""Returns a list of sections"""
offset = elfHeader.header.e_shoff
shdrs = []
for i in range(elfHeader.header.e_shnum):
shdr = self.__classes.SHDR.from_buffer(data, offset)
section_bytes = None... |
Sets a list of symbols in each DYNSYM and SYMTAB section
def _parseSymbols(self, sections):
"""Sets a list of symbols in each DYNSYM and SYMTAB section"""
for section in sections:
strtab = sections[section.header.sh_link]
if section.header.sh_type in (int(SHT.DYNSYM), int(SHT.SY... |
Parses the relocations and add those to the section
def _parseRelocations(self, sections):
"""Parses the relocations and add those to the section"""
for section in sections:
if section.header.sh_link != SHN.UNDEF and section.header.sh_type in (SHT.REL, SHT.RELA):
symbols = s... |
Run the model forward, yielding to user code at specified intervals.
Parameters
----------
tsnapstart : int
The timestep at which to begin yielding.
tstapint : int
The interval at which to yield.
def run_with_snapshots(self, tsnapstart=0., tsnapint=432000.):
... |
Calculate standard vertical modes. Simply
the eigenvectors of the stretching matrix S
def vertical_modes(self):
""" Calculate standard vertical modes. Simply
the eigenvectors of the stretching matrix S """
evals,evecs = np.linalg.eig(-self.S)
asort = evals.argsort()
... |
Performs a field p into modal amplitudes pn
using the basis [pmodes]. The inverse
transform calculates p from pn
def modal_projection(self,p,forward=True):
""" Performs a field p into modal amplitudes pn
using the basis [pmodes]. The inverse
trans... |
Set up background state (zonal flow and PV gradients).
def _initialize_background(self):
"""Set up background state (zonal flow and PV gradients)."""
# background vel.
if len(np.shape(self.U)) == 0:
self.U = (self.U * np.ones((self.ny)))
print(np.shape(self.U))
self.s... |
the inversion
def _initialize_inversion_matrix(self):
""" the inversion """
# The sqg model is diagonal. The inversion is simply qh = -kappa**2 ph
self.a = np.asarray(self.Nb*np.sqrt(self.wv2i))[np.newaxis, np.newaxis, :, :] |
Set background zonal flow
def set_U(self, U):
"""Set background zonal flow"""
self.Ubg = np.asarray(U)[np.newaxis,...] |
Advance particles using a function to determine u and v.
Parameters
----------
uv0fun : function
Called like ``uv0fun(x,y)``. Should return the velocity field
u, v at time t.
uv1fun(x,y) : function
Called like ``uv1fun(x,y)``. Should return th... |
Integrates positions x, y using velocity functions
uv0fun, uv1fun. Returns dx and dy, the displacements.
def _rk4_integrate(self, x, y, uv0fun, uv1fun, dt):
"""Integrates positions x, y using velocity functions
uv0fun, uv1fun. Returns dx and dy, the displacements."""
u0, v0 = uv0f... |
Utitlity function to compute distance between points.
def _distance(self, x0, y0, x1, y1):
"""Utitlity function to compute distance between points."""
dx = x1-x0
dy = y1-y0
# roll displacements across the borders
if self.pix:
dx[ dx > self.Lx/2 ] -= self.Lx
... |
Interpolate gridded scalar C to points x,y.
Parameters
----------
x, y : array-like
Points at which to interpolate
c : array-like
The scalar, assumed to be defined on the grid.
order : int
Order of interpolation
pad : int
... |
Advance particles using a gridded velocity field. Because of the
Runga-Kutta timestepping, we need two velocity fields at different
times.
Parameters
----------
U0, V0 : array-like
Gridded velocity fields at time t - dt.
U1, V1 : array-like
... |
Compute variance of ``p`` from Fourier coefficients ``ph``.
Parameters
----------
model : pyqg.Model instance
The model object from which `ph` originates
ph : complex array
The field on which to compute the variance
Returns
-------
var_dens : float
The variance of `... |
Compute total spectral sum of the real spectral quantity``ph^2``.
Parameters
----------
model : pyqg.Model instance
The model object from which `ph` originates
ph2 : real array
The field on which to compute the sum
Returns
-------
var_dens : float
The sum of `ph2`
... |
Compute isotropic spectrum `phr` of `ph` from 2D spectrum.
Parameters
----------
model : pyqg.Model instance
The model object from which `ph` originates
ph : complex array
The field on which to compute the variance
Returns
-------
kr : array
isotropic wavenumber
... |
Set up the stretching matrix
def _initialize_stretching_matrix(self):
""" Set up the stretching matrix """
self.S = np.zeros((self.nz, self.nz))
if (self.nz==2) and (self.rd) and (self.delta):
self.del1 = self.delta/(self.delta+1.)
self.del2 = (self.delta+1.)**-1
... |
Set up background state (zonal flow and PV gradients).
def _initialize_background(self):
"""Set up background state (zonal flow and PV gradients)."""
self.H = self.Hi.sum()
if np.asarray(self.U).ndim == 2:
self.Ubg = self.U * np.ones((self.ny))
else:
self.Ubg = ... |
estimate the eddy turn-over time in days
def _calc_eddy_time(self):
""" estimate the eddy turn-over time in days """
ens = 0.
for j in range(self.nz):
ens = .5*self.Hi[j] * self.spec_var(self.wv2*self.ph[j])
return 2.*pi*np.sqrt( self.H / ens.sum() ) / 86400 |
Extra diagnostics for layered model
def _initialize_model_diagnostics(self):
""" Extra diagnostics for layered model """
self.add_diagnostic('entspec',
description='barotropic enstrophy spectrum',
function= (lambda self:
np.abs((self.Hi[:,np.newaxis,... |
Set up background state (zonal flow and PV gradients).
def _initialize_background(self):
"""Set up background state (zonal flow and PV gradients)."""
# Background zonal flow (m/s):
self.H = self.Hi.sum()
self.set_U1U2(self.U1, self.U2)
self.U = self.U1 - self.U2
# the ... |
Set upper and lower layer PV anomalies.
Parameters
----------
q1 : array-like
Upper layer PV anomaly in spatial coordinates.
q1 : array-like
Lower layer PV anomaly in spatial coordinates.
def set_q1q2(self, q1, q2, check=False):
"""Set upper and lower l... |
Set background zonal flow.
Parameters
----------
U1 : number
Upper layer flow. Units: m/s
U2 : number
Lower layer flow. Units: m/s
def set_U1U2(self, U1, U2):
"""Set background zonal flow.
Parameters
----------
U1 : number
... |
estimate the eddy turn-over time in days
def _calc_eddy_time(self):
""" estimate the eddy turn-over time in days """
ens = .5*self.Hi[0] * self.spec_var(self.wv2*self.ph1) + \
.5*self.Hi[1] * self.spec_var(self.wv2*self.ph2)
return 2.*pi*np.sqrt( self.H / ens ) / 86400 |
Extra diagnostics for two-layer model
def _initialize_model_diagnostics(self):
"""Extra diagnostics for two-layer model"""
self.add_diagnostic('entspec',
description='barotropic enstrophy spectrum',
function= (lambda self:
np.abs(self.del1*self.qh[0] + sel... |
the inversion
def _initialize_inversion_matrix(self):
""" the inversion """
# The bt model is diagonal. The inversion is simply qh = -kappa**2 ph
self.a = -(self.wv2i+self.kd2)[np.newaxis, np.newaxis, :, :] |
estimate the eddy turn-over time in days
def _calc_eddy_time(self):
""" estimate the eddy turn-over time in days """
ens = .5*self.H * self.spec_var(self.wv2*self.ph)
return 2.*pi*np.sqrt( self.H / ens ) / year |
Calculate velocity at x and y points due to vortex velocity field.
Assumes x and y are vortex positions and are ordered the same as
x0 and y0. The ordering is used to neglect to vortex self interaction.
def calc_uv(self, x, y, prev=False):
"""Calculate velocity at x and y points due to vortex v... |
Returns two arrays of u, v
def uv_at_xy(self, x, y, x0, y0, s0):
"""Returns two arrays of u, v"""
dx, dy = self.distance(x0, y0, x, y)
#print 'dx, dy:', dx, dy
rr2 = (dx**2 + dy**2)**-1
u = - s0 * dy * r_twopi * rr2
v = s0 * dx * r_twopi * rr2
#print 'u, v', u, v... |
>>> reduce([(2, 4), (4, 9)])
[(2, 4), (4, 9)]
>>> reduce([(2, 6), (4, 10)])
[(2, 10)]
def reduce(args):
"""
>>> reduce([(2, 4), (4, 9)])
[(2, 4), (4, 9)]
>>> reduce([(2, 6), (4, 10)])
[(2, 10)]
"""
if len(args) < 2: return args
args.sort()
ret = [args[0]]
for next_... |
r"""Add a single (or many) [start, end, \*] item to the tree.
def add(self, ranges):
r"""Add a single (or many) [start, end, \*] item to the tree."""
if len(ranges) and isinstance(ranges[0], int_types):
ranges = [ranges]
iset = self._iset
self._maxlen = max(self._maxlen, max... |
Return an interable of elements that overlap other in the tree.
def find(self, other):
"""Return an interable of elements that overlap other in the tree."""
iset = self._iset
l = binsearch_left_start(iset, other[0] - self._maxlen, 0, len(iset))
r = binsearch_right_end(iset, other[1], 0,... |
Load the dictionary from a specific JSON file.
def loaddict(filename=DICTIONARY):
"""
Load the dictionary from a specific JSON file.
"""
global zhcdicts
if zhcdicts:
return
if filename == _DEFAULT_DICT:
zhcdicts = json.loads(get_module_res(filename).read().decode('utf-8'))
e... |
Generate or get convertion dict cache for certain locale.
Dictionaries are loaded on demand.
def getdict(locale):
"""
Generate or get convertion dict cache for certain locale.
Dictionaries are loaded on demand.
"""
global zhcdicts, dict_zhcn, dict_zhsg, dict_zhtw, dict_zhhk, pfsdict
if zhcd... |
Detect text is whether Simplified Chinese or Traditional Chinese.
Returns True for Simplified; False for Traditional; None for unknown.
If full=False, it returns once first simplified- or traditional-only
character is encountered, so it's for quick and rough identification;
else, it compares the count a... |
Convert a list of conversion dict to a dict for a certain locale.
>>> sorted(convtable2dict([{'zh-hk': '列斯', 'zh-hans': '利兹', 'zh': '利兹', 'zh-tw': '里茲'}, {':uni': '巨集', 'zh-cn': '宏'}], 'zh-cn').items())
[('列斯', '利兹'), ('利兹', '利兹'), ('巨集', '宏'), ('里茲', '利兹')]
def convtable2dict(convtable, locale, update=None):... |
Tokenize `s` according to corresponding locale dictionary.
Don't use this for serious text processing.
def tokenize(s, locale, update=None):
"""
Tokenize `s` according to corresponding locale dictionary.
Don't use this for serious text processing.
"""
zhdict = getdict(locale)
pfset = pfsdic... |
Recognizes MediaWiki's human conversion format.
Use locale='zh' for no conversion.
Reference: (all tests passed)
https://zh.wikipedia.org/wiki/Help:高级字词转换语法
https://www.mediawiki.org/wiki/Writing_systems/Syntax
>>> print(convert_for_mw('在现代,机械计算-{}-机的应用已经完全被电子计算-{}-机所取代', 'zh-hk'))
在現代,機械計算機的應... |
Simple stdin/stdout interface.
def main():
"""
Simple stdin/stdout interface.
"""
if len(sys.argv) == 2 and sys.argv[1] in Locales:
locale = sys.argv[1]
convertfunc = convert
elif len(sys.argv) == 3 and sys.argv[1] == '-w' and sys.argv[2] in Locales:
locale = sys.argv[2]
... |
A generator function for listing keys in a bucket.
def bucket_lister(manager, bucket_name, prefix=None, marker=None, limit=None):
"""
A generator function for listing keys in a bucket.
"""
eof = False
while not eof:
ret, eof, info = manager.list(bucket_name, prefix=prefix, limit=limit,
... |
Get configuration variable from environment variable
or django setting.py
def get_qiniu_config(name, default=None):
"""
Get configuration variable from environment variable
or django setting.py
"""
config = os.environ.get(name, getattr(settings, name, default))
if config is not None:
... |
Performs /register with type: m.login.application_service
Args:
username(str): Username to register.
def register(self, username=""):
"""Performs /register with type: m.login.application_service
Args:
username(str): Username to register.
"""
if not user... |
Load a list of filenames from an external text file.
def load_from_file(filename):
"""
Load a list of filenames from an external text file.
"""
if os.path.isdir(filename):
logger.error("Err: File '%s' is a directory", filename)
return None
if not os.path.isfile(filename):
lo... |
Parse command line arguments. Settings will be stored in the global
variables declared above.
def parse_argv():
"""
Parse command line arguments. Settings will be stored in the global
variables declared above.
"""
parser = argparse.ArgumentParser(description='Find lyrics for a set of mp3'
... |
Main function.
def main():
"""
Main function.
"""
msg = ''
try:
songs = parse_argv()
if not songs:
msg = 'No songs specified'
except ValueError as error:
msg = str(error)
if msg:
logger.error('%s: Error: %s', sys.argv[0], msg)
return 1
... |
Returns the uuid.UUID object represented by the given v4 or "nice" slug
def decode(slug):
"""
Returns the uuid.UUID object represented by the given v4 or "nice" slug
"""
if sys.version_info.major != 2 and isinstance(slug, bytes):
slug = slug.decode('ascii')
slug = slug + '==' # base64 padd... |
Returns a randomly generated uuid v4 compliant slug which conforms to a set
of "nice" properties, at the cost of some entropy. Currently this means one
extra fixed bit (the first bit of the uuid is set to 0) which guarantees the
slug will begin with [A-Za-f]. For example such slugs don't require special
... |
Filters mutations that are in the given normal
def filter_against_normal(self, normal_mutations, maf_min=0.2,
maf_count_threshold=20, count_min=1):
"""Filters mutations that are in the given normal"""
assert(normal_mutations.chrom == self.chrom)
assert(normal_mutat... |
Returns mutation in oncotator input format. Assumes mutations have
vcf/mpileup style positions.
def to_oncotator(self):
"""Returns mutation in oncotator input format. Assumes mutations have
vcf/mpileup style positions."""
if self.type == ".":
ref = self.ref
alt =... |
Adds routes to Application that use specified handlers.
def add_handlers(self, room_handler=None, transaction_handler=None,
user_handler=None):
"""Adds routes to Application that use specified handlers."""
# Add all the normal matrix API routes
if room_handler:
... |
Merges values in place from *right* into *left*.
:param left: mapping to merge into
:param right: mapping to merge from
:param path: `list` of keys processed before (used for error reporting
only, should only need to be provided by recursive calls)
:param conflict: action to be taken on merge c... |
Recursively walks *mapping* to split keys that contain the separator into
nested mappings.
.. note::
Keys not of type `str` are not supported and will raise errors.
:param mapping: the mapping to process
:param separator: the character (sequence) to use as the separator between
keys
... |
simplest monitoring function to be aggregated with sum
def log_mon_value(name, value=1, **kwargs):
"""
simplest monitoring function to be aggregated with sum
"""
message = '{} => {}'.format(name, value)
log_mon.info({'metric_name': name, 'value': value, 'message': message, **kwargs}) |
A helper for setting the _proxy and slapping the store
object for us.
:return: A thread-local storage as a dictionary
def create_store():
"""
A helper for setting the _proxy and slapping the store
object for us.
:return: A thread-local storage as a dictionary
"""
new_storage = _proxy(... |
Validate request (query_params or request body with args from url) with serializer and pass
validated data dict to the view function instead of request object.
def use_form(form_class, request=None, **top_kwargs):
"""
Validate request (query_params or request body with args from url) with serializer and pa... |
Chisel request decorator
def request(request_callback=None, **kwargs):
"""
Chisel request decorator
"""
if request_callback is None:
return lambda fn: request(fn, **kwargs)
else:
return Request(request_callback, **kwargs).decorate_module(request_callback) |
X = [
m1x, m1y,
m2x, m2y,
m3x, m3y,
m4x, m4y,
m1vx, m1vy,
m2vx, m2vy,
m3vx, m3vy,
m4vx, m4vy
]
def dx_orbit_sys(t, X):
'''X = [
m1x, m1y,
m2x, m2y,
m3x, m3y,
m4x, m4y,
m1vx, m1vy,
m2vx, m2vy,
m3vx, m3vy,
m4vx, m4vy
]
'''
(m1x, m1y,
... |
Add a client to the penalty box.
def add(self, client):
"""Add a client to the penalty box."""
if client.pool_id in self._client_ids:
log.info("%r is already in the penalty box. Ignoring.", client)
return
release = time.time() + self._min_wait
heapq.heappush(self... |
Get any clients ready to be used.
:returns: Iterable of redis clients
def get(self):
"""Get any clients ready to be used.
:returns: Iterable of redis clients
"""
now = time.time()
while self._clients and self._clients[0][0] < now:
_, (client, last_wait) = h... |
Validates a given input is of type string.
Example usage::
data = {'a' : 21}
schema = (string, 21)
You can also use this as a decorator, as a way to check for the
input before it even hits a validator you may be writing.
.. note::
If the argument is a callable, the decorating... |
Validates a given input is of type boolean.
Example usage::
data = {'a' : True}
schema = ('a', boolean)
You can also use this as a decorator, as a way to check for the
input before it even hits a validator you may be writing.
.. note::
If the argument is a callable, the decor... |
Validates a given input is of type dictionary.
Example usage::
data = {'a' : {'b': 1}}
schema = ('a', dictionary)
You can also use this as a decorator, as a way to check for the
input before it even hits a validator you may be writing.
.. note::
If the argument is a callable,... |
Validates a given input is of type list.
Example usage::
data = {'a' : [1,2]}
schema = ('a', array)
You can also use this as a decorator, as a way to check for the
input before it even hits a validator you may be writing.
.. note::
If the argument is a callable, the decoratin... |
Validates a given input is of type int..
Example usage::
data = {'a' : 21}
schema = ('a', integer)
You can also use this as a decorator, as a way to check for the
input before it even hits a validator you may be writing.
.. note::
If the argument is a callable, the decorating... |
Returns a constant `value` TensorFluent with given `dtype`.
Args:
value: The constant value.
dtype: The output's data type.
Returns:
A constant TensorFluent.
def constant(cls,
value: Value,
dtype: tf.DType = tf.float32) -> 'TensorFluent':
... |
Returns a TensorFluent for the Bernoulli sampling op with given mean parameter.
Args:
mean: The mean parameter of the Bernoulli distribution.
batch_size: The size of the batch (optional).
Returns:
The Bernoulli distribution and a TensorFluent sample drawn from the d... |
Returns a TensorFluent for the Uniform sampling op with given low and high parameters.
Args:
low: The low parameter of the Uniform distribution.
high: The high parameter of the Uniform distribution.
batch_size: The size of the batch (optional).
Returns:
... |
Returns a TensorFluent for the Normal sampling op with given mean and variance.
Args:
mean: The mean parameter of the Normal distribution.
variance: The variance parameter of the Normal distribution.
batch_size: The size of the batch (optional).
Returns:
... |
Returns a TensorFluent for the Gamma sampling op with given shape and scale parameters.
Args:
shape: The shape parameter of the Gamma distribution.
scale: The scale parameter of the Gamma distribution.
batch_size: The size of the batch (optional).
Returns:
... |
Returns a TensorFluent for the Exponential sampling op with given mean parameter.
Args:
mean: The mean parameter of the Exponential distribution.
batch_size: The size of the batch (optional).
Returns:
The Exponential distribution and a TensorFluent sample drawn from... |
Returns a copy of the input fluent with stop_gradient at tensor level.
Args:
x: The input fluent.
Returns:
A TensorFluent that stops backpropagation of gradient computations.
def stop_gradient(cls, x: 'TensorFluent') -> 'TensorFluent':
'''Returns a copy of the input fl... |
Returns a copy of the inputs fluent with stop_gradient applied at batch level.
Args:
x: The input fluent.
stop_batch: A boolean tf.Tensor with shape=(batch_size, ...)
Returns:
A TensorFluent that conditionally stops backpropagation of gradient computations.
def sto... |
Returns a TensorFluent for the abs function.
Args:
x: The input fluent.
Returns:
A TensorFluent wrapping the abs function.
def abs(cls, x: 'TensorFluent') -> 'TensorFluent':
'''Returns a TensorFluent for the abs function.
Args:
x: The input fluent.... |
Returns a TensorFluent for the exp function.
Args:
x: The input fluent.
Returns:
A TensorFluent wrapping the exp function.
def exp(cls, x: 'TensorFluent') -> 'TensorFluent':
'''Returns a TensorFluent for the exp function.
Args:
x: The input fluent.... |
Returns a TensorFluent for the log function.
Args:
x: The input fluent.
Returns:
A TensorFluent wrapping the log function.
def log(cls, x: 'TensorFluent') -> 'TensorFluent':
'''Returns a TensorFluent for the log function.
Args:
x: The input fluent.... |
Returns a TensorFluent for the sqrt function.
Args:
x: The input fluent.
Returns:
A TensorFluent wrapping the sqrt function.
def sqrt(cls, x: 'TensorFluent') -> 'TensorFluent':
'''Returns a TensorFluent for the sqrt function.
Args:
x: The input flu... |
Returns a TensorFluent for the cos function.
Args:
x: The input fluent.
Returns:
A TensorFluent wrapping the cos function.
def cos(cls, x: 'TensorFluent') -> 'TensorFluent':
'''Returns a TensorFluent for the cos function.
Args:
x: The input fluent.... |
Returns a TensorFluent for the sin function.
Args:
x: The input fluent.
Returns:
A TensorFluent wrapping the sin function.
def sin(cls, x: 'TensorFluent') -> 'TensorFluent':
'''Returns a TensorFluent for the sin function.
Args:
x: The input fluent.... |
Returns a TensorFluent for the tan function.
Args:
x: The input fluent.
Returns:
A TensorFluent wrapping the tan function.
def tan(cls, x: 'TensorFluent') -> 'TensorFluent':
'''Returns a TensorFluent for the tan function.
Args:
x: The input fluent.... |
Returns a TensorFluent for the arccos function.
Args:
x: The input fluent.
Returns:
A TensorFluent wrapping the arccos function.
def acos(cls, x: 'TensorFluent') -> 'TensorFluent':
'''Returns a TensorFluent for the arccos function.
Args:
x: The inp... |
Returns a TensorFluent for the arcsin function.
Args:
x: The input fluent.
Returns:
A TensorFluent wrapping the arcsin function.
def asin(cls, x: 'TensorFluent') -> 'TensorFluent':
'''Returns a TensorFluent for the arcsin function.
Args:
x: The inp... |
Returns a TensorFluent for the arctan function.
Args:
x: The input fluent.
Returns:
A TensorFluent wrapping the arctan function.
def atan(cls, x: 'TensorFluent') -> 'TensorFluent':
'''Returns a TensorFluent for the arctan function.
Args:
x: The inp... |
Returns a TensorFluent for the round function.
Args:
x: The input fluent.
Returns:
A TensorFluent wrapping the round function.
def round(cls, x: 'TensorFluent') -> 'TensorFluent':
'''Returns a TensorFluent for the round function.
Args:
x: The input... |
Returns a TensorFluent for the ceil function.
Args:
x: The input fluent.
Returns:
A TensorFluent wrapping the ceil function.
def ceil(cls, x: 'TensorFluent') -> 'TensorFluent':
'''Returns a TensorFluent for the ceil function.
Args:
x: The input flu... |
Returns a TensorFluent for the floor function.
Args:
x: The input fluent.
Returns:
A TensorFluent wrapping the floor function.
def floor(cls, x: 'TensorFluent') -> 'TensorFluent':
'''Returns a TensorFluent for the floor function.
Args:
x: The input... |
Returns a TensorFluent for the pow function.TensorFluent
Args:
x: The first operand.
y: The second operand.
Returns:
A TensorFluent wrapping the pow function.
def pow(cls, x: 'TensorFluent', y: 'TensorFluent') -> 'TensorFluent':
'''Returns a TensorFluent fo... |
Returns a TensorFluent for the maximum function.TensorFluent
Args:
x: The first operand.
y: The second operand.
Returns:
A TensorFluent wrapping the maximum function.
def max(cls, x: 'TensorFluent', y: 'TensorFluent') -> 'TensorFluent':
'''Returns a TensorF... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.