semvec/pypi-packages huggingface dataset:
messageboard 0.1.0a0
A synchronization primitive containing a value, allowing threads to concurrently set the value and peek the most recently set value.
Requires Python: >=2

# `messageboard`

A synchronization primitive containing a value, allowing threads to concurrently set the value and peek the most recently set value.

## Features

- Thread-safe.
- `.set(value)` sets the value.
- `.peek()` peeks the most recently set value. If no value is set yet, `.peek()` blocks until a value is set.

## Usage

```python
from __future__ import print_function
import random

random.seed(42)
import threading
import time

from messageboard import MessageBoard


def writer(message_board):
    for i in range(10):
        message_board.set(i)
        print('Written', i)
        time.sleep(1)


def reader(sticky_value):
    for i in range(10):
        if random.random() > 0.5:
            sticky_value.peek()
            print('Peeked', i)
        time.sleep(1)


board = MessageBoard()

writer_thread = threading.Thread(target=writer, args=(board,))
writer_thread.daemon = True

reader_thread = threading.Thread(target=reader, args=(board,))
reader_thread.daemon = True

writer_thread.start()
reader_thread.start()

writer_thread.join()
reader_thread.join()
```

This produces the following output:

```
Written 0
Peeked 0
Written 1
Written 2
Written 3
Written 4
Peeked 4
Written 5
Peeked 5
Written 6
Peeked 6
Written 7
Written 8
Written 9
```

## Contributing

Contributions are welcome! Please submit pull requests or open issues on the GitHub repository.

## License

This project is licensed under the [MIT License](LICENSE).
datafed-test 3.1.0rc16781
DataFed CLI and API

# Description

DataFed is a federated scientific data management system developed by Oak Ridge
National Laboratories to facilitate FAIR data practices within supported
experimental, compute, and analytics environments. The DataFed Python package
provides both a command-line-interface (CLI) and a programming API for
interacting with DataFed services.

# Developers

For running datafed directly from the source folder located in the DataFed
GitHub repository, without running a pip install of the package. Activate the
python env. This might be installed at /opt/datafed/dependencies/python/bin if
you used DataFed's provided dependency install scripts with the default
location.

```
source /opt/datafed/dependencies/python/bin/activate
```

Run the following from the root of the DataFed repo. The generate_datafed 
script will generate default settings. the ENABLE_PYTHON_CLIENT is to make
sure you actually build the python client. Many other default flags may be
turned on, you can disable them if needed.

The build target will "pydatafed" is needed for compiling the protobuf files
to python, you will need protobuf to be installed.

NOTE - You will need to rerun this command any times changes are made to the
.proto files.

```
./scripts/generated_datafed.sh
/opt/datafed/dependencies/bin/cmake -S. -B build -DENABLE_PYTHON_CLIENT=ON
/opt/datafed/dependencies/bin/cmake --build build --target pydatafed
```

Move into the python/datafed_pkg folder and then you can execute the python
cli tool directly with.

```
PYTHON_PATH=. ./scripts/datafed
```