semvec/pypi-packages huggingface dataset:
interval-repeat-decorator 0.10
Run code asynchronously to the main code execution
License: MIT
Keywords: decorator,asynchronously,execution,threading


### Run code asynchronously to the main code execution

```python
pip install interval-repeat-decorator

from interval_repeat_decorator import repeat_action
from threading import Lock
lock = Lock()
@repeat_action(
    print_exception=True,
    exception_value="FTW",
    break_on_exceptions=False,
    interval=.1,
    threadlock=lock,
    kill_thread="ctrl+x",
    number_of_executions=10,
)
def testest(number):
    if number == 0:
        print(number)
        return True
    elif number == 1:
        print(number / 0)
    return True
@repeat_action(
    print_exception=True,
    exception_value="FTW",
    break_on_exceptions=False,
    interval=.2,
    threadlock=lock,
    kill_thread="ctrl+y",
    number_of_executions=5,
)
def testest2(number):
    if number == 0:
        print(number)
        return True
    elif number == 1:
        print(number / 0)
    return True
testex = testest(number=0)
testex2 = testest2(number=1)
print(f"{testex=}\n{testex2=}") #returns the first result only, but will keep on executing!  
0
division by zero
testex=True
testex2='FTW'
0
division by zero
0
0
division by zero
0
0
division by zero
0
0
division by zero
0
0
testex
Out[3]: True
testex2
Out[4]: 'FTW'


```
pdm-mypyc 0.1.0
A PDM build hook to compile source files with mypyc
License: MIT
Requires Python: >=3.7

# pdm-mypyc

`pdm-mypyc` is a build hook for [pdm-backend](https://github.com/pdm-project/pdm-backend) to compile source files with
[mypyc](https://mypyc.readthedocs.io/).

## Activate the hook

To enable the hook, simply add it to the `build-system.requires`:

```toml
[build-system]
requires = ["pdm-mypyc", "pdm-backend"]
build-backend = "pdm.backend"
```

Besides, you can also disable it temporarily by setting environment variable `PDM_BUILD_WITHOUT_MYPYC` to `1`.

## Configuration

### Include and exclude files

By default, all `.py` files included by the `tool.pdm.build` configuration will be compiled with mypyc. You can override
it with the `includes` and `excludes` settings under `tool.pdm.build.hooks.mypyc` table:

```toml
[tool.pdm.build.hooks.mypyc]
includes = ["src/**/*.py"]
excludes = ["src/**/tests/*.py"]  # these files will be excluded **in addition to** the excluded files in the build config
```

### Mypy arguments

You can supply supported [mypy command line options](https://mypy.readthedocs.io/en/stable/command_line.html) to the `mypycify` function with `mypy-args` setting:

```toml
[tool.pdm.build.hooks.mypyc]
mypy-args = ["--disallow-untyped-defs", "--disallow-any-generics"]
```

### Options

You can specify options to pass to the [mypycify](https://github.com/python/mypy/blob/v0.930/mypyc/build.py#L429) function.

```toml
[tool.pdm.build.hooks.mypyc.options]
opt_level = "3"
```