semvec/pypi-packages huggingface dataset:
ElegansBot 1.0.2
Newtonian Mechanics Model for C. elegans Locomotion

# ElegansBot
Newtonian Mechanics Model for C. elegans Locomotion  

https://github.com/TaegonChung/elegansbot/assets/29942136/ca554471-4397-4e19-bbf3-e83e2ce5ed81

(Left: Experimental video from [1], Right: ElegansBot)
```
[1] Broekmans, O. D., Rodgers, J. B., Ryu, W. S., & Stephens, G. J. (2016). Resolving coiled shapes reveals new reorientation behaviors in C. elegans. ELife, 5, e17227. https://doi.org/10.7554/eLife.17227
```
## Web Demo
- https://taegonchung.github.io/elegansbot/
    - Use the sliders to observe the worm's movement changes.
        - Water-Agar Slider: Adjust this to modify the ground's frictional coefficients.
        - Swim-Crawl Slider: This slider alters the period and linear wave number of C. elegans' locomotion.

## Requirements
- Python (version 3)
- NumPy
- Numba
    - SciPy (required as a dependency of numba)
- Matplotlib  

**(Optional)**
- FFmpeg (for saving a video.)
- Jupyter Notebook (for interactive block coding)

## Tested Environment
Please, check "https://github.com/TaegonChung/ElegansBot/tested_environments.txt".  

## Usage
1. Install library by `pip install elegansbot`.
2. Use `from elegansbot import Worm` to import the library.
3. Refer to the detailed instructions in the docstring of the "Worm" class. Below is a brief overview of potential use-cases:
    - If you want to determine $\theta_{\mathrm{ctrl}}$ dynamically, it's advised to update "act" (equivalent to theta_ctrl) manually and then invoke the "steps" method on an instance of the "Worm" class.
    - If you wish to use ElegansBot with a pre-determined $\theta_{\mathrm{ctrl}}$ (kymogram), it's recommended to utilize the "run" method of an instance of the "Worm" class.

## Examples
You may want to check out examples in the "examples/" directory.  
For instance, you can execute the example code with:  
`python examples/example01.py`

Files:
- examples/example01.py : Dynamic input  
- examples/example02.py : Kymogram input  
- examples/example03.py : Kymogram input (Omega-turn)
- examples/example04.py : Kymogram input (Delta-turn)
- examples/example05.py : Frictional forces, power, and behavioral classification

## Local Demo
Execute the following command:
```
python -m elegansbot.elegansbot
```

## File Description
- `elegansbot.py` : Main code
- `Video_S1_omega_turn.avi` : Video from the supplementary section of our paper.
- `Video_S2_delta_turn.avi` : Another video from the supplementary section of our paper.

## Citing ElegansBot
- If ElegansBot has been significant in your research, and you would like to acknowledge this work in your academic publication, we suggest citing [the following paper](https://elifesciences.org/articles/92562):
```
Taegon Chung, Iksoo Chang, Sangyeol Kim (2024) Development of equation of motion deciphering locomotion including omega turns of Caenorhabditis elegans eLife 12:RP92562 https://doi.org/10.7554/eLife.92562
```
failsafe 0.1.0
A Python module that executes a callback script if a password is not entered within a specified time interval
Requires Python: >=3.6

# Failsafe

A Python module that executes a callback script if a password is not entered within a specified time interval. This security feature acts as a failsafe mechanism to protect sensitive systems and data.

## Features

- Configurable timeout period
- Thread-based asynchronous execution
- Customizable callback script
- Password verification system
- Logging functionality

## Requirements

- Python 3.6 or higher
- No external dependencies required

## Files

- `failsafe.py`: Core module implementing the failsafe timer functionality
- `example.py`: Example implementation showing how to use the failsafe module
- `callback_script.py`: Example callback script that logs failsafe trigger events

## Installation

No installation required. Simply copy the files to your project directory.

## Usage

1. Import the FailSafe class:
```python
from failsafe import FailSafe
```

2. Create a failsafe timer instance:
```python
timer = FailSafe(timeout_seconds=300, callback_script='your_callback_script.py')
```

3. Start the failsafe timer:
```python
timer.start()
```

4. Update the timer when correct password is entered:
```python
timer.update_password_time()
```

5. Stop the failsafe timer when done:
```python
timer.stop()
```

## Example

```python
from failsafe import FailSafe

# Create failsafe timer with 5 minutes timeout
timer = FailSafe(timeout_seconds=300, callback_script='callback_script.py')
timer.start()

# Get password input
password = input("Enter password: ")
if password == "correct_password":
    timer.update_password_time()
```

## Callback Script

The failsafe callback script is executed when the password timeout occurs. You can customize the callback script to perform various security actions such as:
- System logout
- Screen lock
- Send security notifications
- Log security events
- Execute emergency security measures

Example failsafe callback script:
```python
from datetime import datetime

def main():
    log_file = "failsafe_timeout.log"
    current_time = datetime.now().strftime("%Y-%m-%d %H:%M:%S")
    
    with open(log_file, "a") as f:
        f.write(f"[{current_time}] Failsafe callback script executed due to password timeout.\n")

if __name__ == "__main__":
    main()
```

## Security Considerations

1. Implement proper password validation in your application
2. Secure the failsafe callback script to prevent unauthorized access
3. Consider encrypting sensitive data in logs
4. Implement appropriate error handling
5. Use secure methods for password storage and verification
6. Regularly test the failsafe mechanism to ensure it works as expected

## Contributing

Feel free to submit issues and enhancement requests to improve the failsafe mechanism.

## License

This project is open source and available under the MIT License.