semvec/pypi-packages huggingface dataset:
PyMCT 1.3.0
A simple implement for MCTS algorithm.
Requires Python: >=3.7

# PyMCT
This is a simple implement for Manto Carlo Tree Search algorithm.

# Install
    
    pip install --upgrade PyMCT

## Example
This is a example for searching a randomly generated tree, each transcation to a new state is given with random reward.

Import moudles:

    from random import randint
    from PyMCT.MCT import MCTNode, MCTS, State

create the test case:

    class Test:
        _root:MCTNode
        _MCTS:MCTS
        
        def __init__(self, root_state:int, c:int=2, max_iter:int=10):       
            root_state = State(root_state)
            self._root = MCTNode(state=root_state)
            #Set the serach with max iteration and max tree heights
            self._MCTS = MCTS(self.root,c=c,max_iter=max_iter, max_height=2, debug=True)
            
        #Always return a random reward. Note that the function must take one MCTNode as argument, and return a value.
        def reward_func(slef, node:MCTNode):
            return randint(0, 10)
        
        #Randomly expand the tree with new node. Note that the function must take one MCTNode as argument, and return a list of new states.
        def discover_func(self, node:MCTNode):
            new_states = list()
            for i in range(randint(1,10)):
                new_states.append(State(i))
            return new_states

        def run(self):
            #Pass in the reward and discover function, start the algorithm!
            self.MCTS.iterate(self.reward_func, self.discover_func)
            
            #Find the optimal path.
            self.MCTS.find_optimal_path()
            
            #Display the tree, Note that if no tag is given to MCTNode, a random tag will be generated and display here.
            self.MCTS.render_tree()
            
            #Print the oprimal path. This is the list of MCTNodes.
            print(self.MCTS.optimal_path)
        
        @property
        def root(self):
            return self._root
        
        @property
        def MCTS(self):
            return self._MCTS

run the test:

    if __name__ == '__main__':
        test = Test(0)
        test.run()
example-package-ta1c0000 0.0.1
A small example package
Requires Python: >=3.7

Copyright (c) 2018 The Python Packaging Authority

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
ron-swanson-client 0.1
Ron Swanson quotes API client
Requires Python: >=3.7

# Ron Swanson Client

Python client to the [Ron Swanson](https://github.com/jamesseanwright/ron-swanson-quotes) API.

## Installation

In order to install the package run

```shell
pip install ron-swanson-client
```

## Quickstart

The package is as simple as it is. At first, create the instance of `RonSwanson` class

```python
from ron_swanson.api import RonSwanson

ron = RonSwanson()
```

Then run the method of the `ron` instance to make a call to the API.

There are three methods available. Please, see the full example below.

```python
import typing
from ron_swanson.api import RonSwanson

if __name__ == '__main__':
    ron = RonSwanson()

    # Get single quote of Ron Swanson
    one_quote: str = ron.one()

    # Get five quotes in a list
    five_quotes: typing.List[str] = ron.random(count=5)

    # Search for quotes
    results: typing.List[str] = ron.search(term="food")
```

## License

The project is licensed under [MIT license](LICENSE).