semvec/pypi-packages huggingface dataset:
safe_redis_lock 0.1
a safe redis lock in Single node Redis
License: MIT

safe_redis_lock
~~~~~~~~~~~~~~~

项目描述

-  一个单机版的redis分布式锁( A single redis distributed lock)
-  项目使用set命令来加锁
-  使用lua脚本来释放锁以保证原子性
-  注意事项,传入的redis连接池需要必须参数一样,同一个redis数据库
-  当block=False的时候如果没有获得锁则返回一个AcquireFailException异常
-  acquire方法返回True时候则说明获得锁成功

使用方法一

-  装饰器使用方法

-  新建一个RedisLock对象.使用RedisLock的lock装饰器来装饰需要保证原子性的函数

-  注意该函数不能是阻塞的

-  .. code:: python

      import threading
      import redis

      from safe_redis_lock import RedisLock
      pool = redis.ConnectionPool(host='127.0.0.1', port=6379, password='lyc', db=0)

      conn = redis.Redis(connection_pool=pool)

      conn.set('producer', 10000)
      redis_lock_ = RedisLock(lock_timeout=5, pool=pool, block=True)


      @redis_lock_.lock
      def consumer_pp(conn):
          num = int(conn.get('producer'))
          if num == 0:
              return True
          else:
              print(f'we consumer one left --> {num}')
              conn.set('producer', num - 1)


      def consumer():
          pool = redis.ConnectionPool(host='127.0.0.1', port=6379, password='lyc', db=0)
          while True:
              conn = redis.Redis(connection_pool=pool)
              if consumer_pp(conn):
                  break


      def consumer_thread():
          from threading import Thread
          for i in range(20):
              Thread(target=consumer).start()


      consumer_thread()

使用方法二:

-

.. code:: python

   from safe_redis_lock import RedisLock,AcquireFailException

   import redis
   import threading
   import os
   pool = redis.ConnectionPool(host='127.0.0.1', port=6379, password='lyc', db=0)

   conn = redis.Redis(connection_pool=pool)

   conn.set('producer', 10000)
   redis_lock_ = RedisLock(lock_timeout=5, pool=pool, block=True)


   def consumer_pp(conn):
       num = int(conn.get('producer'))
       if num == 0:
           return True
       else:
           print(f'we consumer one left --> {num}')
           conn.set('producer', num - 1)


   def consumer():
       pool = redis.ConnectionPool(host='127.0.0.1', port=6379, password='lyc', db=0)
       while True:
           conn = redis.Redis(connection_pool=pool)
           value = f'{threading.current_thread().ident}-{os.getpid()}'
           get_lock = False
           try:
               get_lock = redis_lock_.acquire(value = value)
               if get_lock:
                   if consumer_pp(conn):
                       break
           except AcquireFailException:
               print('can not get the lock')
           finally:
               if get_lock:
                   redis_lock_.release(value)


   def consumer_thread():
       from threading import Thread
       for i in range(20):
           Thread(target=consumer).start()


   consumer_thread()
polarion-docstrings 0.26.0
Reads Polarion docstrings and validates them using flake8
License: MIT
Keywords: polarion,testing

polarion-docstrings
===================

.. image:: https://gitlab.com/mkourim/polarion_docstrings/badges/master/pipeline.svg
    :target: https://gitlab.com/mkourim/polarion_docstrings/commits/master
    :alt: Pipeline status

.. image:: https://gitlab.com/mkourim/polarion_docstrings/badges/master/coverage.svg
    :target: https://gitlab.com/mkourim/polarion_docstrings/commits/master
    :alt: Coverage report

.. image:: https://img.shields.io/pypi/v/polarion-docstrings.svg
    :target: https://pypi.python.org/pypi/polarion-docstrings
    :alt: Version

.. image:: https://img.shields.io/pypi/pyversions/polarion-docstrings.svg
    :target: https://pypi.python.org/pypi/polarion-docstrings
    :alt: Supported Python versions

.. image:: https://img.shields.io/badge/code%20style-black-000000.svg
    :target: https://github.com/ambv/black
    :alt: Code style: black

Description
-----------
Library for reading Polarion docstrings used in Insights and CFME QE. Includes a flake8 extension for validating the docstrings.

Install
-------
To install the package to your virtualenv, run

.. code-block::

    pip install polarion-docstrings

or install it from cloned directory

.. code-block::

    pip install -e .

Package on PyPI <https://pypi.python.org/pypi/polarion-docstrings>
opy-logger 2.1
Used for simple log output.
License: MIT
Keywords: log,logger,simple

# Opy-logger

Opy-logger, uygulamalar için günlük kaydı tutmanıza imkan tanıyan Python kütüphanesidir.


# Kurulumu

Opy-logger kurulumu için pip deposunu kullanabilirsiniz. 

	pip install opy-logger


# Kullanımı

Opy-logger kullanımı için Wiki sayfasını inceleyebilirsiniz. Size en iyi bilgiyi [Wiki](https://github.com/muhammedcamsari/opy-logger/wiki) sunar!


# 2.x sürümündeki değişiklikler

Bu sürümde, günlük kaydı tutma özelliğini ekledim. Artık çıktılar dosyaya yazılabilecek. 1.x serisi, bu özelliği desteklemiyordu.

Opy-logger, bu sürüm itibariyle yerelleştirmeyi destekliyor. Bu yüzden çıktı kategorilerindeki metinleri türkçeleştirdim. İngilizce, Fransızca, Almanca ve Rusça dil desteği yakında eklenecek. 

init() argümanını bu sürümde kaldırdım, yerine appinfo() argümanını ekledim. Artık kütüphaneniz yada uygulamanız hakkında bilgi vermek istediğinizde appinfo() kullanmalısınız. Bu argümanı kullanırken satır tipini belirlemelisiniz. (satır ve boşluk destekler) Üstelik E-Mail, lisans gibi bilgileri de destekliyor.

Artık loglardaki tarih görünürlüğünü tek bir argüman ile belirleyebiliyorsunuz. Satır sonuna date=False ifadesini eklemek zorunda değilsiniz.

Renklendirme seçeneğini de atlamadım. Artık tek bir argüman ile renklendirmeyi kapatabiliyorsunuz.

2.1 sürümüyle birlikte gizlenebilen çıktılar özelliğini ekledik. Bu özellik sayesinde çıktılar ekrana yazdırılmadan log dosyasına yazılabilecek.


# Destek Ver

opy-logger modülünü kullanmak en büyük desteğinizdir. Geribildirimler için muhammedcamsari@icloud.com mail adresini kullanabilirsiniz.
sp-health 0.2.8
Sharepoint health monitor nagios plugin
License: MIT

Sharepoint HealthPlugin
=======================

Checks sharepoint HealthMonitor reports list and raise an alert if some is found.

`VERSION  <burp_reports/VERSION>`__

Install
=======

Linux::

    sudo pip3 install sp-health --upgrade

Also is possible to use::

    sudo python3 -m pip install sp-health --upgrade

On windows with python3.5::

    pip install sp-health --upgrade

For proxies add::

    --proxy='http://user:passw@server:port'

Usage
=====

Use the command line::

    sphealth --help

    usage: sphealth [-h] [-u [USER]] [-p [PASSWORD]] [-s [SITE_URL]]

    optional arguments:
    -h, --help            show this help message and exit
    -u [USER], --user [USER]
                            Username for Ntlm auth like domain\user
    -p [PASSWORD], --password [PASSWORD]
                            Password for Ntlm Auth like
    -s [SITE_URL], --site [SITE_URL]
                            site url for sharepoint HealthMonitor, ex: http://site:9876

Example usage
=============

Example use::

    > sphealth -u domain\user -p pass -s http://spurl:9876
    Information: http://spurl:9876 |alerts=9;1;2;0;

Example Command and service
===========================

Example host::

    # https://assets.nagios.com/downloads/nagioscore/docs/nagioscore/4/en/macros.html#Custom%20Variable%20Macros
    # we use CUSTOM MACRO for these Sharepoint SERVERS
    # ADD _SPURLMON for each host
    # Where _SPURLMON is the name of the root URL for Sharepoint Central Administration (without /HealthReports)
    # Also add _SPUSER and _SPPASSWORD
    # https://github.com/pablodav/sharepoint_health_mon_plugin

    define host
        host_name		HOSTXX1
        alias 			Sharepoint Host XX1
        parents			SOMEDEVICE
        _SPURLMON	    http://spurlfqdn:9876
        _SPUSER         domain\username
        _SPPASSWORD     somepassword
        address			IP.ADD.RR.ESS
        use			    generic-host
    }

Example group::

    define hostgroup {
        hostgroup_name  sharepoint_servers
        alias			Sharepoint servers
        members			HOSTXX1,HOSTXX2
    }

Example command::

    define command{
        command_name  check_sphealth
        command_line  /usr/local/bin/sphealth -u '$ARG1$' -p '$ARG2$' -s '$ARG3$'
    }

Example service::

    define service {
        hostgroup_name          sharepoint_servers
        service_description     Sharepoint_HealthMonitor
        check_command           check_sphealth!$_HOSTSPUSER$!$_HOSTSPPASSWORD$!$_HOSTSPURLMON$
        notes                   Check the alerts from $_HOSTSPURLMON$ for sharepoint HealthMonitor
        use                     generic-service
    }

TODO
====

* Use hash passwords
* Add Unit tests?

Notes
=====

This command is installed and added in project: https://github.com/CoffeeITWorks/ansible_nagios4_server_plugins
chart-studio 1.1.0
Utilities for interfacing with plotly's Chart Studio
License: MIT

# chart-studio
This package contains utilities for interfacing with Plotly's Chart Studio service (both Chart Studio cloud and Chart Studio On-Prem).  Prior to plotly.py version 4, This functionality was included in the `plotly` package under the `plotly.plotly` module. As part of plotly.py version 4, the Chart Studio functionality was removed from the `plotly` package and released in this `chart-studio` package.