semvec/pypi-packages huggingface dataset:
py-cryptonight 1.0.0
Python Cryptonight
License: MIT

Python CryptoNight implementation
=================================

|Build Status|

Python binding for Monero hash functions ``cn_fast_hash``,
``cn_slow_hash``.

-  ``cn_fast_hash`` is used mainly for hashing to scalars / EC points.
-  ``cn_slow_hash`` is CryptoNight hash function used for mining and
   encryption key derivation for encrypted wallet files.

   -  Supports CNv1, CNv2, CNv4
   -  JIT tested on OSX + LLVM, experimental

Py2, Py3 compatible + tests with Monero test vectors.

::

   pip install py-cryptonight

Usage
-----

.. code:: python

   import binascii
   import pycryptonight

   pycryptonight.cn_fast_hash(b'1')
   # hexcoded: b'c89efdaa54c0f20c7adf612882df0950f5a951637e0307cdcb4c672f298b8bc6

   pycryptonight.cn_slow_hash(b'1')
   # hexcoded: b'cbdfba46388e040422b4a9daa471726be659ae184ee86420c2795647f0b301d5

   # variant 1:
   pycryptonight.cn_slow_hash(binascii.unhexlify(b'38274c97c45a172cfc97679870422e3a1ab0784960c60514d816271415c306ee3a3ed1a77e31f6a885c3cb'), 1)  # variant 1
   # hexcoded: b'ed082e49dbd5bbe34a3726a0d1dad981146062b39d36d62c71eb1ed8ab49459b

   # variant 2:
   pycryptonight.cn_slow_hash(b'1', 2)  # variant 2
   # hexcoded: b'44016d2376838d89b374e99a20118c0e8916e8c0a5b910744efc7d8f426509ca

   # variant 4:
   pycryptonight.cn_slow_hash(b'1', 4)  # variant 4
   # hexcoded: b'97db7e03629f7c17e4d78b36a2d247d226b88a8df6cf69f2e4cdae1f1b706b4a

   # variant 4, height:
   pycryptonight.cn_slow_hash(b'1', 4, prehashed=0, height=1)  # variant 4, height 1
   # hexcoded: b'09bcf4997132dc3d7980125620724acc9c90dc393cb6694097a7d745c57b6b5b

Build problems
--------------

The extension builds with AES extension by default. To disable this,
rebuild with:

.. code:: bash

   MONERO_NO_AES=1 python setup.py install

JIT
~~~

The JIT optimization is disabled by default as the implementation was
not properly tested. If you want to experiment with JIT you need to
compile with:

.. code:: bash

   MONERO_NO_JIT=0 python setup.py install
   MONERO_USE_CNV4_JIT=1 ./test.sh

To rebuild locally and test:

.. code:: bash

   MONERO_NO_AES=0 MONERO_NO_JIT=0 python setup.py develop
   MONERO_USE_CNV4_JIT=0 ./test.sh  # JIT disabled
   MONERO_USE_CNV4_JIT=1 ./test.sh  # JIT enabled

For more info read `JIT.md <JIT.md>`__

Donations
---------

Thanks for your support!

::

   86SgqL4YwtWBgq65CitxbPC5ChUJrDkTVWJgtenuf6S68GTLWqPh3zydYpoFhr8JyVdWEZmoMMnhjdvoKQ9urZFfCXKmD93

.. |Build Status| image:: https://travis-ci.org/ph4r05/py-cryptonight.svg?branch=master
   :target: https://travis-ci.org/ph4r05/py-cryptonight
pylems-codext101 0.0.1
Python code traversal to XML
License: MIT
Keywords: pylems

### PyLEMS extension for code traversal 

This package is created for code traversal and model's equations and parameters storage. The idea behind it is to 
automatically traverse Python code and find the models and its parameters. Then, depending on the found model, 
alter its default values with the newly-found parameters. Next, create a PyLEMS model supplementing the new values. 
Finally, create the XML file(s) in the specified folder.


### Walk-through

Here is an example taken from `examples/50healthy_code.py`:
```
oscilator = models.ReducedSetHindmarshRose(r=[0.006], a=[1.0], b=[3.0], c=[1.0], d=[5.0], s=[4.0], xo=[-1.6], K11=[0.5],
                                           K12=[0.1], K21=[0.15], sigma=[0.3], mu=[2.2],
                                           variables_of_interest=["xi", "alpha"])
```
pylems-codext123 0.0.1
Python code traversal to XML
License: MIT
Keywords: pylems

### PyLEMS extension for code traversal 

This package is created for code traversal and model's equations and parameters storage. The idea behind it is to 
automatically traverse Python code and find the models and its parameters. Then, depending on the found model, 
alter its default values with the newly-found parameters. Next, create a PyLEMS model supplementing the new values. 
Finally, create the XML file(s) in the specified folder.


### Walk-through

Here is an example taken from `examples/50healthy_code.py`:
```
oscilator = models.ReducedSetHindmarshRose(r=[0.006], a=[1.0], b=[3.0], c=[1.0], d=[5.0], s=[4.0], xo=[-1.6], K11=[0.5],
                                           K12=[0.1], K21=[0.15], sigma=[0.3], mu=[2.2],
                                           variables_of_interest=["xi", "alpha"])
```
scrapyer-rabbitmq-scheduler 1.1.2
Rabbitmq for Distributed scraping
License: MIT

## Scrapy分布式RabbitMQ调度器
## 安装

使用pip安装

```
pip install scrapyer-rabbitmq-scheduler
```

版本:
#### 2022/09/06 更新 1.1.2
- 兼容调度器`scrapy_rabbitmq_scheduler.scheduler.MqMixCache`与中间件`RabbitMQMiddleware`
  - 说明: 由于`MqMixCache`采用双列队, response异常情况将不重新入MQ列队,`RabbitMQMiddleware`将自动失效

#### 2022/09/02 更新 1.1.0
- 新增调度器 `scrapy_rabbitmq_scheduler.scheduler.MqMixCache` MQ列队组合内存列队,将原先SaaS调度器的广度优先调整为深度优先

#### 2021/11/25 更新 1.0.9
- 解决pipelines管道文件链接超时问题

## 使用
### 第一步: 在你的项目中的settings.py中添加配置项
```
# 指定项目的调度器
SCHEDULER = "scrapy_rabbitmq_scheduler.scheduler.MqMixCache"

# 指定rabbitmq的连接DSN
RABBITMQ_CONNECTION_PARAMETERS = 'amqp://guest:guest@localhost:5672/?heartbeat=0'

# 指定重试的http状态码(重新加回队列重试)
SCHEDULER_REQUEUE_ON_STATUS = [500,503]

# 指定下载器中间件, 确认任务是否成功
DOWNLOADER_MIDDLEWARES = {
    'scrapy_rabbitmq_scheduler.middleware.RabbitMQMiddleware': 999
}
# 指定item处理方式, item会加入到rabbitmq中
ITEM_PIPELINES = {
    'scrapy_rabbitmq_scheduler.pipelines.RabbitMQPipeline': 300,
}
```

### 第二步: 修改Spider的继承类
```
import scrapy
from scrapy_rabbitmq_scheduler.spiders import RabbitSpider

class CustomSpider(RabbitSpider):
    name = 'custom_spider'    
    queue_name = 'test_urls' # 指定任务队列的名称
    items_key = 'test_item' # 指定item队列名称

    def parse(self, response):
        item = ... # parse item
        yield item
```

### 第三步: 将任务写入到RabbitMQ队列
```
#!/usr/bin/env python
import pika
import settings

connection = pika.BlockingConnection(pika.URLParameters(settings.RABBITMQ_CONNECTION_PARAMETERS))
channel = connection.channel()

queue_key = 'test_urls'

# 读取文件中的链接并写入到队列中
with open('urls.txt') as f:
    for url in f:
        url = url.strip(' \n\r')
        channel.basic_publish(exchange='',
                        routing_key=queue_key,
                        body=url,
                        properties=pika.BasicProperties(
                            content_type='text/plain',
                            delivery_mode=2
                        ))

connection.close()
```
urls.txt
```text
http://www.baidu.com
```
## 高级特色
### 1. 支持消息优先级
1. 消息优先级的范围为0~255, 数字越大, 优先级越高
```python
yield scrapy.Request(url, priority=优先级)
```
则可以直接指定消息的优先级

### 2. 队列持久化
```python
# settings.py
RABBITMQ_DURABLE = True # 是否持久化队列, True为持久化 False为非持久化, 默认True
```

### 3. 消息确认
```python
# settings.py
RABBITMQ_CONFIRM_DELIVERY = True # 消息是否需要确认, True为需要, False为不需要, 默认是True
```

### 4. 增加消息延时
scrapy-rabbitmq-scheduler的消息延时是使用`rabbitmq-delayed-message-exchange`插件实现的, 所以在使用之前需要先安装以及开启这个插件
`rabbitmq-delayed-message-exchange`: https://github.com/rabbitmq/rabbitmq-delayed-message-exchange

**在spider中开启延时队列**
```python
# -*- coding: utf-8 -*-
import scrapy
from scrapy_rabbitmq_scheduler.spiders import RabbitSpider
from example.items import ArticleItem


class CcidcomSpider(RabbitSpider):
    ....
    # 队列名称
    queue_name = 'ccidcom'
    # 是否是延迟队列
    is_delay_queue = True
    ...
```
`is_delay_queue`设置为True,则自动会开启延时

**使用延时**
```python
yield scrapy.Request('http://www.ccidcom.com/', callback=self.parse, meta={'_delay_time': 10000})
```
在meta中增加`_delay_time`, 指定延时毫秒数, 则自动生效
## TODO
- [x] 支持延时请求
- [x] 增加任务持久化配置
pylems-codext-test 0.0.1
Python code traversal to XML
License: MIT
Keywords: pylems

### PyLEMS extension for code traversal 

This package is created for code traversal and model's equations and parameters storage. The idea behind it is to 
automatically traverse Python code and find the models and its parameters. Then, depending on the found model, 
alter its default values with the newly-found parameters. Next, create a PyLEMS model supplementing the new values. 
Finally, create the XML file(s) in the specified folder.


### Walk-through

Here is an example taken from `examples/50healthy_code.py`:
```
oscilator = models.ReducedSetHindmarshRose(r=[0.006], a=[1.0], b=[3.0], c=[1.0], d=[5.0], s=[4.0], xo=[-1.6], K11=[0.5],
                                           K12=[0.1], K21=[0.15], sigma=[0.3], mu=[2.2],
                                           variables_of_interest=["xi", "alpha"])
```