Skip to content

opto.trace.operators

clone

clone(x: Any)

This is a clone operator of x.

identity

identity(x: Any)

pos

pos(x: Any)

This is a pos operator of x.

neg

neg(x: Any)

This is a neg operator of x.

abs

abs(x: Any)

This is an abs operator of x.

invert

invert(x: Any)

This is an invert operator of x.

round

round(x: Any, n: Any)

This is a round operator of x.

floor

floor(x: Any)

This is a floor operator of x.

ceil

ceil(x: Any)

This is a ceil operator of x.

trunc

trunc(x: Any)

This is a trunc operator of x.

add

add(x: Any, y: Any)

This is an add operator of x and y.

subtract

subtract(x: Any, y: Any)

This is a subtract operator of x and y.

multiply

multiply(x: Any, y: Any)

This is a multiply operator of x and y.

floor_divide

floor_divide(x: Any, y: Any)

This is a floor_divide operator of x and y.

divide

divide(x: Any, y: Any)

This is a divide operator of x and y.

mod

mod(x: Any, y: Any)

This is a mod operator of x and y.

node_divmod

node_divmod(x: Any, y: Any)

This is a divmod operator of x and y.

power

power(x: Any, y: Any)

This is a power operator of x and y.

lshift

lshift(x: Any, y: Any)

This is a lshift operator of x and y.

rshift

rshift(x: Any, y: Any)

This is a rshift operator of x and y.

and_

and_(x: Any, y: Any)

This is an and operator of x and y.

or_

or_(x: Any, y: Any)

This is an or operator of x and y.

xor

xor(x: Any, y: Any)

This is a xor operator of x and y.

lt

lt(x: Any, y: Any)

This is a lt operator of x and y.

le

le(x: Any, y: Any)

This is a le operator of x and y.

eq

eq(x: Any, y: Any)

This is an eq operator of x and y.

neq

neq(x: Any, y: Any)

This is a not eq operator of x and y.

ne

ne(x: Any, y: Any)

This is a ne operator of x and y.

ge

ge(x: Any, y: Any)

This is a ge operator of x and y.

gt

gt(x: Any, y: Any)

This is a gt operator of x and y.

cond

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

This selects x if condition is True, otherwise y.

not_

not_(x: Any)

This is a not operator of x.

is_

is_(x: Any, y: Any)

Whether x is equal to y.

is_not

is_not(x: Any, y: Any)

Whether x is not equal to y.

in_

in_(x: Any, y: Any)

Whether x is in y.

not_in

not_in(x: Any, y: Any)

Whether x is not in y.

getitem

getitem(x: Any, index: Any)

This is a getitem operator of x based on index.

pop

pop(x: Any, index: Any)

This is a pop operator of x based on index.

len_

len_(x: Any)

This is a len operator of x.

ord_

ord_(x: Any)

The unicode number of a character.

chr_

chr_(x: Any)

The character of a unicode number.

concat

concat(x: Any, y: Any)

This is a concatenation operator of x and y.

lower

lower(x: Any)

This makes all characters in x lower case.

upper

upper(x: Any)

This makes all characters in x upper case.

title

title(x: Any)

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

swapcase

swapcase(x: Any)

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

capitalize

capitalize(x: Any)

Converts the first character of a string to uppercase.

split

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

strip(x: Any, chars=None)

Removes the leading and trailing characters of x.

replace

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

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

format

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

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

join

join(x: Any, *y: Any)

Joins a sequence y with different strs with x: " ".join(["a", "b", "c"]) -> "a b c".

node_getattr

node_getattr(obj: Node, attr: str)

This operator gets attr of obj.

call

call(fun: 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

to_list(x: Any)

This converts x to a list.

make_list

make_list(*args)

This creates a list from the arguments.

to_dict

to_dict(x: Any)

This converts x to a dictionary.

make_dict

make_dict(**kwargs)

This creates a dictionary from the keyword arguments.

to_set

to_set(x: Any)

This converts x to a set.

make_set

make_set(*args)

This creates a set from the arguments.

to_tuple

to_tuple(x: Any)

This converts x to a tuple.

make_tuple

make_tuple(*args)

This creates a tuple from the arguments.

keys

keys(x: Dict)

Return the keys of a dictionary x as a list.

values

values(x: Dict)

Return the values of a dictionary x as a list.

dict_update

dict_update(x: Dict, y: Dict)

Update the dictionary x with the dictionary y.

dict_pop

dict_pop(x: Dict, key: Any)

Pop the key from the dictionary x.

dict_popitem

dict_popitem(x: Dict)

Pop the last item from the dictionary x.

list_append

list_append(x: Any, y: Any)

Append y to x.

list_clear

list_clear(x: Any)

Clear x.

list_extend

list_extend(x: Any, y: Any)

Extend x with y.

list_insert

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

Insert y at index in x.

list_pop

list_pop(x: Any, index: Any)

Pop the index from x.

list_remove

list_remove(x: Any, y: Any)

Remove y from x.

list_reverse

list_reverse(x: Any)

Reverse x.

list_sort

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

Sort x.

set_add

set_add(x: Any, y: Any)

Add y to x.

set_clear

set_clear(x: Any)

Clear x.

set_discard

set_discard(x: Any, y: Any)

Discard y from x.

set_intersection_update

set_intersection_update(x: Any, y: Any)

Update x with the intersection of x and y.

set_pop

set_pop(x: Any)

Pop an element from x.

set_remove

set_remove(x: Any, y: Any)

Remove y from x.

set_symmetric_difference_update

set_symmetric_difference_update(x: Any, y: Any)

Update x with the symmetric difference of x and y.

set_update

set_update(x: Any, y: Any)

Update x with y.

call_llm

call_llm(system_prompt, *user_prompts, **kwargs)

Query the language model of system_prompt with user_prompts.