text
stringlengths
81
112k
Returns a TensorFluent for the minimum function. Args: x: The first operand. y: The second operand. Returns: A TensorFluent wrapping the minimum function. def min(cls, x: 'TensorFluent', y: 'TensorFluent') -> 'TensorFluent': '''Returns a TensorFluent for th...
Returns a TensorFluent for the control op if-then-else. Args: condition: Boolean fluent for the if condition. true_case: Fluent returned in the true clause. false_case: Fluent returned in the false clause. Returns: A TensorFluent wrapping the if-then-els...
Returns a TensorFluent for the binary `op` applied to fluents `x` and `y`. Args: x: The first operand. y: The second operand. op: The binary operator. dtype: The output's data type. Returns: A TensorFluent wrapping the binary operator's outpu...
Returns a TensorFluent for the unary `op` applied to fluent `x`. Args: x: The input fluent. op: The unary operation. dtype: The output's data type. Returns: A TensorFluent wrapping the unary operator's output. def _unary_op(cls, x: 'TensorFl...
Returns a TensorFluent for the aggregation `op` applied to fluent `x`. Args: op: The aggregation operation. x: The input fluent. vars_list: The list of variables to be aggregated over. Returns: A TensorFluent wrapping the aggregation operator's output. ...
Maps the `vars_list` into a list of axis indices corresponding to the `fluent` scope. Args: x: The fluent. vars_list: The list of variables to be aggregated over. Returns: List[int]: a list of axis. def _varslist2axis(cls, fluent: 'TensorFluent', vars_list:...
Returns a TensorFluent for the cast operation with given `dtype`. Args: dtype: The output's data type. Returns: A TensorFluent wrapping the cast operation. def cast(self, dtype: tf.DType) -> 'TensorFluent': '''Returns a TensorFluent for the cast operation with given `d...
Returns a TensorFluent for the reshape operation with given `shape`. Args: shape: The output's shape. Returns: A TensorFluent wrapping the reshape operation. def reshape(self, shape: tf.TensorShape) -> 'TensorFluent': '''Returns a TensorFluent for the reshape operation...
Returns a TensorFluent for the transpose operation with given `permutation`. Args: permutation: The output's shape permutation. Returns: A TensorFluent wrapping the transpose operation. def transpose(self, permutation: Optional[List[int]] = None) -> 'TensorFluent': '''...
Returns the TensorFluent for the sum aggregation function. Args: vars_list: The list of variables to be aggregated over. Returns: A TensorFluent wrapping the sum aggregation function. def sum(self, vars_list: List[str]) -> 'TensorFluent': '''Returns the TensorFluent fo...
Returns the TensorFluent for the avg aggregation function. Args: vars_list: The list of variables to be aggregated over. Returns: A TensorFluent wrapping the avg aggregation function. def avg(self, vars_list: List[str]) -> 'TensorFluent': '''Returns the TensorFluent fo...
Returns the TensorFluent for the prod aggregation function. Args: vars_list: The list of variables to be aggregated over. Returns: A TensorFluent wrapping the prod aggregation function. def prod(self, vars_list: List[str]) -> 'TensorFluent': '''Returns the TensorFluent...
Returns the TensorFluent for the maximum aggregation function. Args: vars_list: The list of variables to be aggregated over. Returns: A TensorFluent wrapping the maximum aggregation function. def maximum(self, vars_list: List[str]) -> 'TensorFluent': '''Returns the Ten...
Returns the TensorFluent for the minimum aggregation function. Args: vars_list: The list of variables to be aggregated over. Returns: A TensorFluent wrapping the minimum aggregation function. def minimum(self, vars_list: List[str]) -> 'TensorFluent': '''Returns the Ten...
Returns the TensorFluent for the forall aggregation function. Args: vars_list: The list of variables to be aggregated over. Returns: A TensorFluent wrapping the forall aggregation function. def forall(self, vars_list: List[str]) -> 'TensorFluent': '''Returns the Tensor...
Returns the TensorFluent for the exists aggregation function. Args: vars_list: The list of variables to be aggregated over. Returns: A TensorFluent wrapping the exists aggregation function. def exists(self, vars_list: List[str]) -> 'TensorFluent': '''Returns the Tensor...
Returns a narrower list of sources. If the exclude parameter is a list, every one of its items will be removed from the returned list. If it's just a function (or a function's name) and 'section' is set to False (default), a copy of the sources list without this element will be returned. If it'...
Searches for lyrics of a single song and returns a Result object with the various stats collected in the process. The optional parameter 'sources' specifies an alternative list of sources. If not present, the main list will be used. def get_lyrics(song, l_sources=None): """ Searches for lyrics of ...
Launches a pool of threads to search for the lyrics of a single song. The optional parameter 'sources' specifies an alternative list of sources. If not present, the main list will be used. def get_lyrics_threaded(song, l_sources=None): """ Launches a pool of threads to search for the lyrics of a singl...
Process a result object by: 1. Saving the lyrics to the corresponding file(if applicable). 2. Printing the lyrics or the corresponding error/success message. 3. Returning a boolean indicating if the lyrics were found or not. def process_result(result): """ Process a result object by: ...
Calls get_lyrics_threaded for a song or list of songs. def run(songs): """ Calls get_lyrics_threaded for a song or list of songs. """ if not hasattr(songs, '__iter__'): result = get_lyrics_threaded(songs) process_result(result) else: start = time.time() stats = run_m...
Concurrently calls get_lyrics to fetch the lyrics of a large list of songs. def run_mp(songs): """ Concurrently calls get_lyrics to fetch the lyrics of a large list of songs. """ stats = Stats() if CONFIG['debug']: good = open('found', 'w') bad = open('notfound', 'w') logger.de...
Convert potentially a list of commands into a single string. This creates a single string with newlines between each element of the list so that they will all run after each other in a bash script. def parse_setup(options: Union[List, str]) -> str: """Convert potentially a list of commands into a single s...
Substitute values into a template scheduler file. def create_scheduler_file(scheduler: str, job: Job) -> str: """Substitute values into a template scheduler file.""" logger.debug("Create Scheduler File Function") if job.scheduler_options is None: scheduler_options: Dict[str, Any] = {} else: ...
Call this to initialize the state of the UI after everything has been connected. def initialize_state(self): """ Call this to initialize the state of the UI after everything has been connected. """ if self.__hardware_source: self.__data_item_states_changed_event_listener = self.__hardware_s...
Call this when the user clicks the play/pause button. def handle_play_clicked(self): """ Call this when the user clicks the play/pause button. """ if self.__hardware_source: if self.is_playing: self.__hardware_source.stop_playing() else: self.__ha...
Maps RDDL range types to TensorFlow dtypes. def range_type_to_dtype(range_type: str) -> Optional[tf.DType]: '''Maps RDDL range types to TensorFlow dtypes.''' range2dtype = { 'real': tf.float32, 'int': tf.int32, 'bool': tf.bool } return range2dtype[range_type]
Maps python types to TensorFlow dtypes. def python_type_to_dtype(python_type: type) -> Optional[tf.DType]: '''Maps python types to TensorFlow dtypes.''' dtype = None if python_type == float: dtype = tf.float32 elif python_type == int: dtype = tf.int32 elif python_type == bool: ...
Get the dependency type string for SlurmPrinter :rtype: str def get_dependency_type(_type): """ Get the dependency type string for SlurmPrinter :rtype: str """ if _type == DependencyTypes.AFTER: return 'after' elif _type == DependencyTypes.AFTER_ANY...
Makes the header section for the scripts :rtype: str def get_header(): """ Makes the header section for the scripts :rtype: str """ username, userid, uname = get_user_information() header = '''\ # This Slurm batch script was generated # By user: %s (%s) # On h...
Generates a job submission script from a job object :param job: An instance of JobInterface :type job: pyqueue.job.JobInterface def generate(self, job): """ Generates a job submission script from a job object :param job: An instance of JobInterface :type job: pyqueue.j...
Submits a given job :param job: The job to submit :type job: pyqueue.job.JobInterface def submit(self, job): """ Submits a given job :param job: The job to submit :type job: pyqueue.job.JobInterface """ from subprocess import Popen, PIPE script ...
Submits a given job :param job: The job to submit :type job: pyqueue.job.JobInterface def submit(self, job): """ Submits a given job :param job: The job to submit :type job: pyqueue.job.JobInterface """ script = self._printer.generate(job) stdin...
Get the current playing song from an mpris2 compliant player. def get_info_mpris2(name): """ Get the current playing song from an mpris2 compliant player. """ # qdbus org.mpris.MediaPlayer2.<name> /org/mpris/MediaPlayer2\ # org.freedesktop.DBus.Properties.Get org.mpris.MediaPlayer2.Player Metadat ...
Get the current song from clementine. def get_current_clementine(): """ Get the current song from clementine. """ # mpris_version 2 try: return get_info_mpris2('clementine') except DBusErrorResponse: bus_name = 'org.mpris.clementine' path = '/Player' interface = ...
Get the current song from cmus. def get_current_cmus(): """ Get the current song from cmus. """ result = subprocess.run('cmus-remote -Q'.split(' '), check=True, stdout=subprocess.PIPE, stderr=subprocess.DEVNULL) info = {} for line in result.stdout.decode().split('\n'...
Class constructor using the path to the corresponding mp3 file. The metadata will be read from this file to create the song object, so it must at least contain valid ID3 tags for artist and title. def from_filename(cls, filename): """ Class constructor using the path to the correspondin...
Class constructor using a string with the artist and title. This should be used when parsing user input, since all the information must be specified in a single string formatted as: '{artist} - {title}'. def from_string(cls, name, separator='-', reverse=False): """ Class constructor usi...
Get the name of the album from lastfm. def fetch_album_name(self): """ Get the name of the album from lastfm. """ response = get_lastfm('track.getInfo', artist=self.artist, track=self.title) if response: try: self.album =...
Gets the closest monday to the date provided. def _get_closest_week(self, metric_date): """ Gets the closest monday to the date provided. """ #find the offset to the closest monday days_after_monday = metric_date.isoweekday() - 1 return metric_date - datetime.timedelta(...
Get the range of months that we need to use as keys to scan redis. def _get_daily_date_range(self, metric_date, delta): """ Get the range of months that we need to use as keys to scan redis. """ dates = [metric_date] start_date = metric_date end_date = metric_date + delt...
Gets the range of years that we need to use as keys to get metrics from redis. def _get_weekly_date_range(self, metric_date, delta): """ Gets the range of years that we need to use as keys to get metrics from redis. """ dates = [metric_date] end_date = metric_date + delta ...
Deletes all ``sandsnake`` related data from redis. .. warning:: Very expensive and destructive operation. Use with causion def clear_all(self): """ Deletes all ``sandsnake`` related data from redis. .. warning:: Very expensive and destructive operation. Use w...
Tracks a metric just by count. If you track a metric this way, you won't be able to query the metric by day, week or month. :param unique_identifier: Unique string indetifying the object this metric is for :param metric: A unique name for the metric you want to track :param inc_amt: The...
Tracks a metric for a specific ``unique_identifier`` for a certain date. The redis backend supports lists for both ``unique_identifier`` and ``metric`` allowing for tracking of multiple metrics for multiple unique_identifiers efficiently. Not all backends may support this. :param unique_identif...
Returns the ``metric`` for ``unique_identifier`` segmented by day starting from``from_date`` :param unique_identifier: Unique string indetifying the object this metric is for :param metric: A unique name for the metric you want to track :param from_date: A python date object :pa...
Returns the ``metric`` for ``unique_identifier`` segmented by week starting from``from_date`` :param unique_identifier: Unique string indetifying the object this metric is for :param metric: A unique name for the metric you want to track :param from_date: A python date object :p...
Returns the ``metric`` for ``unique_identifier`` segmented by month starting from``from_date``. It will retrieve metrics data starting from the 1st of the month specified in ``from_date`` :param unique_identifier: Unique string indetifying the object this metric is for :param metric: A ...
Retrieves a multiple metrics as efficiently as possible. :param metric_identifiers: a list of tuples of the form `(unique_identifier, metric_name`) identifying which metrics to retrieve. For example [('user:1', 'people_invited',), ('user:2', 'people_invited',), ('user:1', 'comments_posted',), ('user:2'...
Gets the count for the ``metric`` for ``unique_identifier``. You can specify a ``start_date`` and an ``end_date``, to only get metrics within that time range. :param unique_identifier: Unique string indetifying the object this metric is for :param metric: A unique name for the metric you want t...
Retrieves a multiple metrics as efficiently as possible. :param metric_identifiers: a list of tuples of the form `(unique_identifier, metric_name`) identifying which metrics to retrieve. For example [('user:1', 'people_invited',), ('user:2', 'people_invited',), ('user:1', 'comments_posted',), ('user:2'...
Sets the count for the ``metric`` for ``unique_identifier``. You must specify a ``date`` for the ``count`` to be set on. Useful for resetting a metric count to 0 or decrementing a metric. The redis backend supports lists for both ``unique_identifier`` and ``metric`` allowing for the setting of ...
Uses the count for each day in the date range to recalculate the counters for the associated weeks and months for the ``metric`` for ``unique_identifier``. Useful for updating the counters for week and month after using set_metric_by_day. The redis backend supports lists for both ``unique_identifier`` ...
Uses the count for each day in the date range to recalculate the counters for the weeks for the ``metric`` for ``unique_identifier``. Useful for updating the counters for week and month after using set_metric_by_day. The redis backend supports lists for both ``unique_identifier`` and ``metric``...
Uses the count for each day in the date range to recalculate the counters for the months for the ``metric`` for ``unique_identifier``. Useful for updating the counters for week and month after using set_metric_by_day. The redis backend supports lists for both ``unique_identifier`` and ``metric`` allowi...
Returns True if a string is a valid mxid. def is_full_mxid(user_string): """Returns True if a string is a valid mxid.""" if not user_string[0] == "@": return False parts = user_string[1:].split(":") localpart_chars = ascii_lowercase + digits + "._-=" if not (len(parts) == 2 and all([i in lo...
Helps object methods handle MatrixRequestError. Args: method(function): Object method to be wrapped Method's object must have _handle_request_exception method that deals with specific status codes and errcodes. def intent(method): """Helps object methods handle MatrixRequestError. Args: ...
Find all the variables specified in a format string. This returns a list of all the different variables specified in a format string, that is the variables inside the braces. def get_variables(self) -> Set[str]: """Find all the variables specified in a format string. This returns a li...
Return a representation as a bash array. This creates a string formatted as a bash array containing all the commands in the job. def as_bash_array(self) -> str: """Return a representation as a bash array. This creates a string formatted as a bash array containing all the commands in the job. ...
Parse docstrings to dict, it should look like: key: value def parse_doc(doc): """ Parse docstrings to dict, it should look like: key: value """ if not doc: return {} out = {} for s in doc.split('\n'): s = s.strip().split(':', maxsplit=1) if len(s) == 2: ...
Merge a list of dictionaries into a single dictionary. Where there are collisions the first value in the list will be set as this function is using ChainMap to combine the dicts. def combine_dictionaries(dicts: List[Dict[str, Any]]) -> Dict[str, Any]: """Merge a list of dictionaries into a single dictiona...
Apply the zip operator to a set of variables. This uses the python zip iterator to combine multiple lists of variables such that the nth variable in each list is aligned. Args: variables: The variables object parent: Unused def iterator_zip(variables: VarType, parent: str = None) -> Itera...
Apply the product operator to a set of variables. This uses the python itertools.product iterator to combine multiple variables such that all possible combinations are generated. This is the default iterator however this is a method of manually specifying the option. Args: variables: The varia...
This successively appends each element of an array to a single list of values. This takes a list of values and puts all the values generated for each element in the list into a single list of values. It uses the :func:`itertools.chain` function to achieve this. This function is particularly useful for spec...
Create a list of values using the :func:`numpy.arange` function. Args: variables: The input variables for the creation of the range parent: The variable for which the values are being generated. Returns: A list of dictionaries mapping the parent to each value. def iterator_arange(variables: V...
Cycle through a list of values a specified number of times Args: variables: The input variables for the creation of the range parent: The variable for which the values are being generated. Returns: A list of dictionaries mapping the parent to each value. def iterator_cycle(variables: VarType,...
Process the variables into a list of the appropriate combinations. This function performs recursive processing of the input variables, creating an iterator which has all the combinations of variables specified in the input. def variable_matrix( variables: VarType, parent: str = None, iterator: str = "prod...
Remove duplicate entries in a list retaining order. def uniqueify(my_list: Any) -> List[Any]: """Remove duplicate entries in a list retaining order.""" if sys.version_info >= (3, 6): # An implementation specific detail of py3.6 is the retention of order # within a dictionary. In py3.7 this beco...
Generate all combinations of commands given a variable matrix. Processes the commands to be sequences of strings. def process_command(command: CommandInput, matrix: VarMatrix) -> List[Command]: """Generate all combinations of commands given a variable matrix. Processes the commands to be sequences of str...
Read and parse yaml file. def read_file(filename: PathLike = "experiment.yml") -> Dict[str, Any]: """Read and parse yaml file.""" logger.debug("Input file: %s", filename) with open(filename, "r") as stream: structure = yaml.safe_load(stream) return structure
Submit commands to the bash shell. This function runs the commands iteratively but handles errors in the same way as with the pbs_commands function. A command will run for all combinations of variables in the variable matrix, however if any one of those commands fails then the next command will not run...
Submit a series of commands to a batch scheduler. This takes a list of strings which are the contents of the pbs files, writes the files to disk and submits the job to the scheduler. Files which match the pattern of the resulting files <basename>_<index>.pbs are deleted before writing the new files. T...
Determine the scheduler to use to run the jobs. def determine_scheduler( scheduler: Optional[str], experiment_definition: Dict[str, YamlValue] ) -> str: """Determine the scheduler to use to run the jobs.""" # Scheduler value from command line has first priority if scheduler is not None: if sch...
Make sure that the incoming data complies with the class type we are expecting it to be. In this case, classes that inherit from this base class expect data to be of type ``list``. def safe_type(self, data, tree): """ Make sure that the incoming data complies with the class type we ...
An internal context generator. Accepts a CKAN context. CKAN's internals put various things into the context which makes reusing it for multiple API calls inadvisable. This function adds more fine grain control on the context from our plugin logic side. def get_context(context): """An internal cont...
return unique dict for each uwsgi request. note: won't work on non-uwsgi cases def request_uniq(func): """ return unique dict for each uwsgi request. note: won't work on non-uwsgi cases """ def _wrapped(*args, **kwargs): data = _get_request_unique_cache() return func(data, *arg...
Try to get ``__name__`` first, ``__class__.__name__`` second and finally, if we can't get anything acceptable, fallback to user a ``repr()`` call. def safe_repr(obj): """ Try to get ``__name__`` first, ``__class__.__name__`` second and finally, if we can't get anything acceptable, fallback to u...
A data with keys that are not enumerated sequentially will be re sorted and sequentially ordered. For example:: >>> data = {16: ('1', 'b'), 3: ('1', 'a')} >>> re_sort(data) >>> {0: ('1', 'a'), 1: ('1', 'b')} def re_sort(data): """ A data with keys that are not enumerated seque...
Receive a ``data`` object that will be in the form of a normalized structure (e.g. ``{0: {'a': 0}}``) and filter out keys that match the ``required_items``. def sift(data, required_items=None): """ Receive a ``data`` object that will be in the form of a normalized structure (e.g. ``{0: {'a': 0}}``)...
When trying to return a meaningful error about an unexpected data item we cannot just `repr(data)` as that could show a gigantic data struture. This utility should try to get the key of the first item or the single item in the data structure. def data_item(data): """ When trying to return a meanin...
Checks an assertion argument for truth-ness. Will return ``True`` or explicitly raise ``AssertionError``. This is to deal with environments using ``python -O` or ``PYTHONOPTIMIZE=``. :param assertion: some value to evaluate for truth-ness :param message: optional message used for raising AssertionError...
Returns a copy of the fluent shape, ignoring batch size if in batch mode. def fluent_shape(self) -> Sequence[int]: '''Returns a copy of the fluent shape, ignoring batch size if in batch mode.''' return tuple(self._shape.as_list()[1:] if self._batch else self._shape.as_list()[:])
It broadcasts the fluent shapes if any input is in batch mode. It handles input shapes in different modes, expanding its dimensions if necessary. It outputs a tuple with new shapes. If no input shape is in batch mode, return (None, None). If an input shape does not need to be changed, r...
Run mpileup on given chrom and pos def run(bam, chrom, pos1, pos2, reffa, chr_reffa, parameters): """Run mpileup on given chrom and pos""" # check for chr ref is_chr_query = chrom.startswith('chr') if is_chr_query and chr_reffa is None: chr_reffa = reffa # check bam ref type bam_heade...
Usage: execfile('path/to/file.py', globals(), locals()) def execfile(fname, _globals, _locals): """ Usage: execfile('path/to/file.py', globals(), locals()) """ if os.path.exists(fname): with open(fname) as f: code = compile(f.read(), os.path.basename(fname), 'exec') exec...
if you're using py.path you make do that as: py.path.local(full_path).ensure_dir() def auto_directory(rel_name): """ if you're using py.path you make do that as: py.path.local(full_path).ensure_dir() """ dir_name = rel_path(rel_name, check=False) if not os.path.exists(dir_name): os....
Parse an ISO 8601 date string def parse_iso8601_date(string): """ Parse an ISO 8601 date string """ # Match ISO 8601? match = _RE_ISO8601_DATE.search(string) if not match: raise ValueError('Expected ISO 8601 date') # Extract ISO 8601 components year = int(match.group('year')) ...
Parse an ISO 8601 date/time string def parse_iso8601_datetime(string): """ Parse an ISO 8601 date/time string """ # Match ISO 8601? match = _RE_ISO8601_DATETIME.search(string) if not match: raise ValueError('Expected ISO 8601 date/time') # Extract ISO 8601 components year = in...
Generator which imports all submodules of a module, recursively, including subpackages :param package: package name (e.g 'chisel.util'); may be relative if parent_package is provided :type package: str :param parent_package: parent package name (e.g 'chisel') :type package: str :rtype: iterator of ...
Returns a tuple of tensors representing the initial state fluents. Args: batch_size (Optional[int]): The batch size. Returns: Sequence[tf.Tensor]: A tuple of tensors. def compile_initial_state(self, batch_size: Optional[int] = None) -> Sequence[tf.Tensor]: '''Returns a...
Returns a tuple of tensors representing the default action fluents. Args: batch_size (int): The batch size. Returns: Sequence[tf.Tensor]: A tuple of tensors. def compile_default_action(self, batch_size: Optional[int] = None) -> Sequence[tf.Tensor]: '''Returns a tuple o...
Compiles the intermediate and next state fluent CPFs given the current `state` and `action`. Args: state (Sequence[tf.Tensor]): A tuple of state tensors. action (Sequence[tf.Tensor]): A tuple of action tensors. Returns: Tuple[List[TensorFluent], List[TensorF...
Compiles the reward function given the current `state`, `action` and `next_state`. Args: state (Sequence[tf.Tensor]): A tuple of current state tensors. action (Sequence[tf.Tensor]): A tuple of action tensors. next_state (Sequence[tf.Tensor]): A tuple of next state te...
Compiles the intermediate and next state fluent CPFs given the current `state` and `action` scope. Args: scope (Dict[str, :obj:`rddl2tf.fluent.TensorFluent`]): The fluent scope for CPF evaluation. batch_size (Optional[int]): The batch size. Returns: Tuple[List[CPFPa...
Compiles the intermediate fluent CPFs given the current `state` and `action` scope. Args: scope (Dict[str, :obj:`rddl2tf.fluent.TensorFluent`]): The fluent scope for CPF evaluation. batch_size (Optional[int]): The batch size. Returns: A list of intermediate fluent C...
Compiles the next state fluent CPFs given the current `state` and `action` scope. Args: scope (Dict[str, :obj:`rddl2tf.fluent.TensorFluent`]): The fluent scope for CPF evaluation. batch_size (Optional[int]): The batch size. Returns: A list of state fluent CPFs compi...
Compiles the reward function given the fluent `scope`. Args: scope (Dict[str, :obj:`rddl2tf.fluent.TensorFluent`]): The fluent scope for reward evaluation. Returns: A :obj:`rddl2tf.fluent.TensorFluent` representing the reward function. def compile_reward(self, scope: Dict[str,...
Compiles the state-action constraints given current `state` and `action` fluents. Args: state (Sequence[tf.Tensor]): The current state fluents. action (Sequence[tf.Tensor]): The action fluents. Returns: A list of :obj:`rddl2tf.fluent.TensorFluent`. def compile_stat...
Compiles the action preconditions given current `state` and `action` fluents. Args: state (Sequence[tf.Tensor]): The current state fluents. action (Sequence[tf.Tensor]): The action fluents. Returns: A list of :obj:`rddl2tf.fluent.TensorFluent`. def compile_action_p...
Compiles the state invarints given current `state` fluents. Args: state (Sequence[tf.Tensor]): The current state fluents. Returns: A list of :obj:`rddl2tf.fluent.TensorFluent`. def compile_state_invariants(self, state: Sequence[tf.Tensor]) -> List[TensorFluent]: ...