semvec/pypi-packages huggingface dataset:
HadoopYarnClusterCheckerLib 49
fires an event if your hadoop-yarn cluster becomes empty

Sends event if the yarn-cluster is empty/free to trigger other stuff (e.g. send you an email or start another application)

The HadoopYarnClusterChecker-Class checks your cluster if there is any application run on it. In case your cluster is free it fires an event.

# how it works:
* it's false positive: if there is any error like it can not connect to your yarn-rest-api it sends the event.
* algorithm:
  * receive data from: "/ws/v1/cluster/apps"-REST endpoint
  * are there applications with the state "running"?
    * Yes: Is this application excluded?
    * Yes: Are there more running applications?
      * No: send the event
      * Yes: sleep for the intervall & start with the first bulletin-point
# Excludes
* has to be a String
* excludes for state-attribute are forbidden!
* don't forget to escape the \"
* JSON-Notation:
  * Array
  * Key-Value-Object
  * Key: XML-Tag from the Yarn-Api
  * example: 
  ```json
  "[
  {\"name\":\"Zeppelin\"},
  {\"name\":\"Zeppelin1\"}
  ]"
  ```
    * meaning: all Applications with the Name "Zeppelin" and "Zeppelin1" will be excluded in case they're running
    * filtering:
      * for state-attribute is forbidden!
      * for multiple attributes like an AND should work:
        ```json
        [
         {
          "name":"Zeppelin", 
          "priority":0
          }
        ]
        ```

# How to use it:

```python
import hadoop-yarn-cluster-checker-lib

checker = HadoopYarnClusterChecker(server=args.server, path=args.path, intervall=args.intervall, log=args.log,
                                                               excludes=args.excludes)
checker.on_empty_cluster += event_empty
```

# Donations
[![paypal](https://www.paypalobjects.com/en_US/DK/i/btn/btn_donateCC_LG.gif)](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=EN22Z95HKGD74&source=url) 

# Cheatsheet for me
lore ipsem
## Twine
only works with: twine upload --repository-url https://test.pypi.org/legacy/ dist/*
pyhooks 1.0.3
Python hooks for methods

#######
PyHooks
#######

.. image:: https://img.shields.io/travis/Shir0kamii/pyhooks/master.svg
    :target: https://travis-ci.org/Shir0kamii/pyhooks
.. image:: https://img.shields.io/coveralls/Shir0kamii/pyhooks/master.svg
.. image:: https://img.shields.io/codeclimate/github/Shir0kamii/pyhooks.svg
    :alt:

PyHooks is meant to expose method hook for classes

======
Status
======

This project is maintained, feel free to open issues or pull requests.

=======
Purpose
=======

Have you ever wanted to execute code before or after a method ? PyHooks solve
this exact problem taking inspiration from marshmallow's hook system.

============
Installation
============

Like any other published python package, you can install it via `pip` : 

.. code-block:: bash

    pip install pyhooks


============
How to use ?
============

To use it, you first need to implement a hooked method. You do this by
decorating the method with `@Hook`.

For example, suppose you have a class that at some moment save your data (such
as a database). If you want to be able to plug new behavior, your code
will look like this:

.. code-block:: python 

    from pyhooks import Hook


    class DatabaseEntry(object):
        @Hook
        def save(self):
            pass # save implementation here

Thanks to the `@Hook` line, you will now be able to add functions that execute
before and after the `save` method using the decorators `@precall_register` 
and `@postcall_register`.

For instance, if you want to increment a version variable before 
saving, you could do:

.. code-block:: python

    from pyhooks import precall_register


    class VersionnedEntry(DatabaseEntry):
        @precall_register("save")
        def increment_version(self):
            self.version += 1


The decorator directive indicates to your class that `increment_version` should
be run before the `save` method that is passed to the decorator as argument.


========
Examples
========

You can find some more examples in the `examples/` directory of this
repository.

==============
Advanced usage
==============

You can specialize a register decorator by calling it outside of a decorator
context. The last example would yield:

.. code-block:: python

    from pyhooks import precall_register

    pre_save = precall_register("save")


    class VersionnedEntry(DatabaseEntry):
        @pre_save
        def increment_version(self):
            self.version += 1