python/replicate/experiment.py
def is_running(self) -> bool:
        """
        Check whether the experiment is running or not.
        If the last heartbeat recorded is greater than the last tolerable
        heartbeat then return False else True
        In case the heartbeat metadata file is not present which means the
        experiment was stopped the function returns False.
        """
        try:
            repository = self._project._get_repository()
            heartbeat_metadata_bytes = repository.get(self._heartbeat_path())
            heartbeat_metadata = json.loads(heartbeat_metadata_bytes)
        except DoesNotExistError as e:
            return False
        except Exception as e:
            console.warn(
                "Failed to load heartbeat metadata from {}: {}".format(
                    self._heartbeat_path(), e
                )
            )
            return False
        now = datetime.datetime.utcnow()
        last_heartbeat = parse_rfc3339(heartbeat_metadata["last_heartbeat"])
        last_tolerable_heartbeat = (
            now - DEFAULT_REFRESH_INTERVAL * HEARTBEAT_MISS_TOLERANCE
        )
        return last_tolerable_heartbeat < last_heartbeat

        Check whether the experiment is running or not.
        If the last heartbeat recorded is greater than the last tolerable
        heartbeat then return False else True
        In case the heartbeat metadata file is not present which means the
        experiment was stopped the function returns False.
        
Check whether the experiment is running or not.
If the last heartbeat recorded is greater than the last tolerable
heartbeat then return False else True
In case the heartbeat metadata file is not present which means the
experiment was stopped the function returns False.
Check whether the experiment is running or not . If the last heartbeat recorded is greater than the last tolerable heartbeat then return False else True In case the heartbeat metadata file is not present which means the experiment was stopped the function returns False .
def is_running(self) -> bool:
        try:
            repository = self._project._get_repository()
            heartbeat_metadata_bytes = repository.get(self._heartbeat_path())
            heartbeat_metadata = json.loads(heartbeat_metadata_bytes)
        except DoesNotExistError as e:
            return False
        except Exception as e:
            console.warn(
                "Failed to load heartbeat metadata from {}: {}".format(
                    self._heartbeat_path(), e
                )
            )
            return False
        now = datetime.datetime.utcnow()
        last_heartbeat = parse_rfc3339(heartbeat_metadata["last_heartbeat"])
        last_tolerable_heartbeat = (
            now - DEFAULT_REFRESH_INTERVAL * HEARTBEAT_MISS_TOLERANCE
        )
        return last_tolerable_heartbeat < last_heartbeat
def is_running ( self ) -> bool : try : repository = self . _project . _get_repository ( ) heartbeat_metadata_bytes = repository . get ( self . _heartbeat_path ( ) ) heartbeat_metadata = json . loads ( heartbeat_metadata_bytes ) except DoesNotExistError as e : return False except Exception as e : console . warn ( "Failed to load heartbeat metadata from {}: {}" . format ( self . _heartbeat_path ( ) , e ) ) return False now = datetime . datetime . utcnow ( ) last_heartbeat = parse_rfc3339 ( heartbeat_metadata [ "last_heartbeat" ] ) last_tolerable_heartbeat = ( now - DEFAULT_REFRESH_INTERVAL * HEARTBEAT_MISS_TOLERANCE ) return last_tolerable_heartbeat < last_heartbeat
Check whether the experiment is running or not.
Check whether the experiment is running or not .
"""
        Check whether the experiment is running or not.
        If the last heartbeat recorded is greater than the last tolerable
        heartbeat then return False else True
        In case the heartbeat metadata file is not present which means the
        experiment was stopped the function returns False.
        """
self