semvec/pypi-packages huggingface dataset:
ibm-cpp-orchestration 0.1.0
Supports users in usage of CPD Orchestration
Requires Python: >=3.7

# IBM CPD Orchestration Python Client

This package supports users in usage of CPD Orchestration.
It's primary usage is to enable users to store artifact results
of a Orchestration Flow run.


## Usage

### Client construction

`CPDOrchestration` client is constructed from IAM APIKEY, which can be provided
in a few ways:

* explicitly:

  ```python
  from ibm_cpp_orchestration import CPDOrchestration
  
  client = CPDOrchestration(apikey)
  # or
  client = CPDOrchestration.from_apikey(apikey)
  ```

* implicitly:

  ```bash
  APIKEY=...
  export APIKEY
  ```

  ```python
  from ibm_cpp_orchestration import CPDOrchestration

  client = CPDOrchestration()
  # or
  client = CPDOrchestration.new_instance()
  # or
  client = CPDOrchestration.from_apikey()
  ```

All of the above may also define `service_name` and `url`.


### Usage in Python notebooks

Notebooks run in Orchestration Platform get inputs and expose outputs
as a node in Orchestration Flow:

```
{
  "id": ...,
  "type": "execution_node",
  "op": "run_container",
  "app_data": {
    "pipeline_data": {
      "name": ...,
      "config": {
        "link": {
          "component_id_ref": "run-notebook"
        }
      },
      "inputs": [
        ...,
        {
          "name": "model_name",
          "group": "env_variables",
          "type": "String",
          "value_from": ...
        }
      ],
      "outputs": [
        {
          "name": "trained_model",
          "group": "output_variables",
          "type": {
            "CPDPath": {
              "path_type": "resource",
              "resource_type": "asset",
              "asset_type": "wml_model"
            }
          }
        }
      ]
    }
  },
  ...
}
```

Inside of the notebook, inputs are available as environmental
variables:

```python
model_name = os.environ['model_name']
```

Outputs are exposed using sdk method, `store_results`:

```python
client = CPDOrchestration.from_apikey(...)
client.store_results({
  "trained_model": ... // cpd path to the trained model
})
```


### Other features

Client also provides a method to get WML instance credentials:

```python
client.get_wml_credentials() # the scope passed in notebook
# or
client.get_wml_credentials("cpd://projects/123456789")
```


## Contribution

See a separate [document on contribution](CONTRIBUTING.md).
mys-random 0.15.0
Random numbers.

Random
======

Random numbers in the `Mys programming language`_.

Examples
========

Cheap pseudo random numbers.

.. code-block:: python

   from random.pseudo import random
   from random.pseudo import randint
   from random.pseudo import randfloat
   from random.pseudo import randbytes

   def main():
       print('random():            ', random())
       print('randint(-5, 10):     ', randint(-5, 10))
       print('randfloat(-1.0, 3.5):', randfloat(-1.0, 3.5))
       print('randbytes(5):        ', randbytes(5))

.. code-block:: text

    random():             0.223932
    randint(-5, 10):      3
    randfloat(-1.0, 3.5): -0.31123
    randbytes(5):         b'\x34\xf4\x11\x92\xaa'

Random numbers that should be cryptographically safe. Much slower than
pseudo random numbers.

.. code-block:: python

   from random.crypto import random
   from random.crypto import randint
   from random.crypto import randfloat
   from random.crypto import randbytes

   def main():
       print('random():            ', random())
       print('randint(-5, 10):     ', randint(-5, 10))
       print('randfloat(-1.0, 3.5):', randfloat(-1.0, 3.5))
       print('randbytes(5):        ', randbytes(5))

.. code-block:: text

    random():             0.984442
    randint(-5, 10):      -5
    randfloat(-1.0, 3.5): 3.23477
    randbytes(5):         b'\x42\xff\x51\x89\xab'

.. _Mys programming language: https://github.com/mys-lang/mys