opto.trace.operators
#
Module Contents#
Functions#
This is a clone operator of x. |
|
This is a pos operator of x. |
|
This is a neg operator of x. |
|
This is an abs operator of x. |
|
This is an invert operator of x. |
|
This is a round operator of x. |
|
This is a floor operator of x. |
|
This is a ceil operator of x. |
|
This is a trunc operator of x. |
|
This is an add operator of x and y. |
|
This is a subtract operator of x and y. |
|
This is a multiply operator of x and y. |
|
This is a floor_divide operator of x and y. |
|
This is a divide operator of x and y. |
|
This is a mod operator of x and y. |
|
This is a divmod operator of x and y. |
|
This is a power operator of x and y. |
|
This is a lshift operator of x and y. |
|
This is a rshift operator of x and y. |
|
This is an and operator of x and y. |
|
This is an or operator of x and y. |
|
This is a xor operator of x and y. |
|
This is a lt operator of x and y. |
|
This is a le operator of x and y. |
|
This is an eq operator of x and y. |
|
This is a not eq operator of x and y. |
|
This is a ne operator of x and y. |
|
This is a ge operator of x and y. |
|
This is a gt operator of x and y. |
|
This selects x if condition is True, otherwise y. |
|
This is a not operator of x. |
|
Whether x is equal to y. |
|
Whether x is not equal to y. |
|
Whether x is in y. |
|
Whether x is not in y. |
|
This is a getitem operator of x based on index. |
|
This is a pop operator of x based on index. |
|
This is a len operator of x. |
|
The unicode number of a character. |
|
The character of a unicode number. |
|
This is a concatenation operator of x and y. |
|
This makes all characters in x lower case. |
|
This makes all characters in x upper case. |
|
This makes the first character to upper case and the rest to lower case. |
|
Swaps the case of all characters: uppercase character to lowercase and vice-versa. |
|
Converts the first character of a string to uppercase. |
|
Splits the string by finding a substring y in string x, return the first part and second part of string x without y. |
|
Removes the leading and trailing characters of x. |
|
Replaces all occurrences of substring y in string x with z. |
|
Fills in a string template with content, str.format(). |
|
This operator gets attr of obj. |
|
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. |
|
This converts x to a list. |
|
Return the keys of a dictionary x as a list. |
|
Return the values of a dictionary x as a list. |
|
Update the dictionary x with the dictionary y. |
|
Pop the key from the dictionary x. |
|
Pop the last item from the dictionary x. |
|
Append y to x. |
|
Clear x. |
|
Extend x with y. |
|
Insert y at index in x. |
|
Pop the index from x. |
|
Remove y from x. |
|
Reverse x. |
|
Sort x. |
|
Add y to x. |
|
Clear x. |
|
Discard y from x. |
|
Update x with the intersection of x and y. |
|
Pop an element from x. |
|
Remove y from x. |
|
Update x with the symmetric difference of x and y. |
|
Update x with y. |
API#
- clone(x: Any)#
This is a clone operator of x.
- 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.