opto.trace.operators#

Module Contents#

Functions#

clone

This is a clone operator of x.

identity

pos

This is a pos operator of x.

neg

This is a neg operator of x.

abs

This is an abs operator of x.

invert

This is an invert operator of x.

round

This is a round operator of x.

floor

This is a floor operator of x.

ceil

This is a ceil operator of x.

trunc

This is a trunc operator of x.

add

This is an add operator of x and y.

subtract

This is a subtract operator of x and y.

multiply

This is a multiply operator of x and y.

floor_divide

This is a floor_divide operator of x and y.

divide

This is a divide operator of x and y.

mod

This is a mod operator of x and y.

node_divmod

This is a divmod operator of x and y.

power

This is a power operator of x and y.

lshift

This is a lshift operator of x and y.

rshift

This is a rshift operator of x and y.

and_

This is an and operator of x and y.

or_

This is an or operator of x and y.

xor

This is a xor operator of x and y.

lt

This is a lt operator of x and y.

le

This is a le operator of x and y.

eq

This is an eq operator of x and y.

neq

This is a not eq operator of x and y.

ne

This is a ne operator of x and y.

ge

This is a ge operator of x and y.

gt

This is a gt operator of x and y.

cond

This selects x if condition is True, otherwise y.

not_

This is a not operator of x.

is_

Whether x is equal to y.

is_not

Whether x is not equal to y.

in_

Whether x is in y.

not_in

Whether x is not in y.

getitem

This is a getitem operator of x based on index.

pop

This is a pop operator of x based on index.

len_

This is a len operator of x.

ord_

The unicode number of a character.

chr_

The character of a unicode number.

concat

This is a concatenation operator of x and y.

lower

This makes all characters in x lower case.

upper

This makes all characters in x upper case.

title

This makes the first character to upper case and the rest to lower case.

swapcase

Swaps the case of all characters: uppercase character to lowercase and vice-versa.

capitalize

Converts the first character of a string to uppercase.

split

Splits the string by finding a substring y in string x, return the first part and second part of string x without y.

strip

Removes the leading and trailing characters of x.

replace

Replaces all occurrences of substring y in string x with z.

format

Fills in a string template with content, str.format().

node_getattr

This operator gets attr of obj.

call

This operator calls the function fun with args (args_0, args_1, etc.) and kwargs. If there are no args or kwargs, i.e. call(fun=function_name), the function takes no input.

to_list

This converts x to a list.

keys

Return the keys of a dictionary x as a list.

values

Return the values of a dictionary x as a list.

dict_update

Update the dictionary x with the dictionary y.

dict_pop

Pop the key from the dictionary x.

dict_popitem

Pop the last item from the dictionary x.

list_append

Append y to x.

list_clear

Clear x.

list_extend

Extend x with y.

list_insert

Insert y at index in x.

list_pop

Pop the index from x.

list_remove

Remove y from x.

list_reverse

Reverse x.

list_sort

Sort x.

set_add

Add y to x.

set_clear

Clear x.

set_discard

Discard y from x.

set_intersection_update

Update x with the intersection of x and y.

set_pop

Pop an element from x.

set_remove

Remove y from x.

set_symmetric_difference_update

Update x with the symmetric difference of x and y.

set_update

Update x with y.

API#

clone(x: Any)#

This is a clone operator of x.

identity(x: Any)[source]#
pos(x: Any)#

This is a pos operator of x.

neg(x: Any)#

This is a neg operator of x.

abs(x: Any)#

This is an abs operator of x.

invert(x: Any)#

This is an invert operator of x.

round(x: Any, n: Any)#

This is a round operator of x.

floor(x: Any)#

This is a floor operator of x.

ceil(x: Any)#

This is a ceil operator of x.

trunc(x: Any)#

This is a trunc operator of x.

add(x: Any, y: Any)#

This is an add operator of x and y.

subtract(x: Any, y: Any)#

This is a subtract operator of x and y.

multiply(x: Any, y: Any)#

This is a multiply operator of x and y.

floor_divide(x: Any, y: Any)#

This is a floor_divide operator of x and y.

divide(x: Any, y: Any)#

This is a divide operator of x and y.

mod(x: Any, y: Any)#

This is a mod operator of x and y.

node_divmod(x: Any, y: Any)#

This is a divmod operator of x and y.

power(x: Any, y: Any)#

This is a power operator of x and y.

lshift(x: Any, y: Any)#

This is a lshift operator of x and y.

rshift(x: Any, y: Any)#

This is a rshift operator of x and y.

and_(x: Any, y: Any)#

This is an and operator of x and y.

or_(x: Any, y: Any)#

This is an or operator of x and y.

xor(x: Any, y: Any)#

This is a xor operator of x and y.

lt(x: Any, y: Any)#

This is a lt operator of x and y.

le(x: Any, y: Any)#

This is a le operator of x and y.

eq(x: Any, y: Any)#

This is an eq operator of x and y.

neq(x: Any, y: Any)#

This is a not eq operator of x and y.

ne(x: Any, y: Any)#

This is a ne operator of x and y.

ge(x: Any, y: Any)#

This is a ge operator of x and y.

gt(x: Any, y: Any)#

This is a gt operator of x and y.

cond(condition: Any, x: Any, y: Any)#

This selects x if condition is True, otherwise y.

not_(x: Any)#

This is a not operator of x.

is_(x: Any, y: Any)#

Whether x is equal to y.

is_not(x: Any, y: Any)#

Whether x is not equal to y.

in_(x: Any, y: Any)#

Whether x is in y.

not_in(x: Any, y: Any)#

Whether x is not in y.

getitem(x: Any, index: Any)#

This is a getitem operator of x based on index.

pop(x: Any, index: Any)#

This is a pop operator of x based on index.

len_(x: Any)#

This is a len operator of x.

ord_(x: Any)#

The unicode number of a character.

chr_(x: Any)#

The character of a unicode number.

concat(x: Any, y: Any)#

This is a concatenation operator of x and y.

lower(x: Any)#

This makes all characters in x lower case.

upper(x: Any)#

This makes all characters in x upper case.

title(x: Any)#

This makes the first character to upper case and the rest to lower case.

swapcase(x: Any)#

Swaps the case of all characters: uppercase character to lowercase and vice-versa.

capitalize(x: Any)#

Converts the first character of a string to uppercase.

split(x: Any, y: Any, maxsplit: Any = -1)#

Splits the string by finding a substring y in string x, return the first part and second part of string x without y.

strip(x: Any, chars=None)#

Removes the leading and trailing characters of x.

replace(x: Any, old: Any, new: Any, count: Any = -1)#

Replaces all occurrences of substring y in string x with z.

format(x: Any, *args, **kwargs)#

Fills in a string template with content, str.format().

node_getattr(obj: opto.trace.nodes.Node, attr: str)#

This operator gets attr of obj.

call(fun: opto.trace.nodes.Node, *args, **kwargs)#

This operator calls the function fun with args (args_0, args_1, etc.) and kwargs. If there are no args or kwargs, i.e. call(fun=function_name), the function takes no input.

to_list(x: Any)#

This converts x to a list.

keys(x: Dict)#

Return the keys of a dictionary x as a list.

values(x: Dict)#

Return the values of a dictionary x as a list.

dict_update(x: Dict, y: Dict)#

Update the dictionary x with the dictionary y.

dict_pop(x: Dict, key: Any)#

Pop the key from the dictionary x.

dict_popitem(x: Dict)#

Pop the last item from the dictionary x.

list_append(x: Any, y: Any)#

Append y to x.

list_clear(x: Any)#

Clear x.

list_extend(x: Any, y: Any)#

Extend x with y.

list_insert(x: Any, index: Any, y: Any)#

Insert y at index in x.

list_pop(x: Any, index: Any)#

Pop the index from x.

list_remove(x: Any, y: Any)#

Remove y from x.

list_reverse(x: Any)#

Reverse x.

list_sort(x: Any, key: Any = None, reverse: Any = False)#

Sort x.

set_add(x: Any, y: Any)#

Add y to x.

set_clear(x: Any)#

Clear x.

set_discard(x: Any, y: Any)#

Discard y from x.

set_intersection_update(x: Any, y: Any)#

Update x with the intersection of x and y.

set_pop(x: Any)#

Pop an element from x.

set_remove(x: Any, y: Any)#

Remove y from x.

set_symmetric_difference_update(x: Any, y: Any)#

Update x with the symmetric difference of x and y.

set_update(x: Any, y: Any)#

Update x with y.