semvec/pypi-packages huggingface dataset:
NLQF 0.1.7
A tool for fittering code comments

# Code for "On the importance of Building High-quality Training Datasets for Neural Code Search"
This repo contains the source code introduced in our paper.

## Tool: Natural Language Query Filter (NLQF)

NLQF is a tool to filter query-appropriate text for building high-quality code search datasets. It consists of rule-based filering and model-based filtering.

### Installation
To confirm the double-blind policy, we do not provide pip installation. You can directly call the functions in our source code to use this tool.

### Usage
NOTE: To use this tool, you need to prepare the pre-trained model and the word vocabulary in ./resource
```
import nlqf
import torch 
import json

vocab_path = './word_vocab.json'
model_path = './vae.model'
with open(vocab_path, 'r') as f:
    word_vocab = json.load(f)
model = torch.load(model_path)

raw_comments = ['======','create a remote conection','return @test','convert int to string']

# Modify this list to config your ruleset.
rule_list = ['contain_any_url','contain_any_javadoc_tag', 'contain_any_non_English','not_contain_any_letter', 'less_than_three_words', 'end_with_question_mark', 'contain_html_tag', 'remove_brackets', 'remove_html_tag']

# Define your own rule. Return False if you want to remove the comment_str. Return String if you want to modify the comment_str.
def my_rule(comment_str):
    return len(comment_str) < 10

# If the key starts with 'remove', the comment will be modified. 
my_rule_dict = {
    'length_less_than_10':my_rule
}


comments,idx = nlqf.rule_filter(raw_comments,rule_set=rule_list+list(my_rule_dict.keys()),rule_dict=my_rule_dict)
print(comments,idx)
# ['create a remote conection', 'convert int to string'] [1, 3]

comments,idx = nlqf.model_filter(raw_comments, word_vocab, model, with_cuda=True, query_len=20,num_workers=1, max_iter=1000, dividing_proportion=0)
print(comments,idx)
# ['create a remote conection', 'convert int to string'] [1 3]
```

### VAE Model 
To train the filtering model with your own real query corpus, you can refer to the source code of VAE model on our website.
wmath 0.1.0
Another simple mathematical package in the world
Requires Python: >=3.6

# introduction
'wmath' is a simple mathematical package designed by a bored undergraduate who wants to review math and python at the same time.
## features:
- wmath use a class called '**Meta**' to manage the global meta information, which is not allowed to be instantiated. 
- wmath has its own class **Fraction** as one of its basic data types. 
- param '**_new**' is a bool data, included in many methods in wmath, that decides whether to return a brand-new data or apply change on {self}, 
- '**_deepcopy**' is another common bool parameter, which decides whether deepcopy or just copy. in most cases, **_deepcopy** is True default.   
## modules
- meta.py ------ manage the global meta information. 
- number_theory.py ------ handling number theory problems in math. 
- fraction.py ------ the operation in fraction. 
- paradigm.py ------ the basic class of paradigm classes. 
- polynomial.py ------ the related problems in polynomial. 
- matrix.py ------ the problems related to matrix. 
- cross.py ------ define cross functions that involve several classes.  
## [reference](./REFERENCE.md)
laza-common 0.0.3
A python development toolkit
Requires Python: ~=3.9

# Laza Common

A set of common python utility modules.




## Installation

Install from [PyPi](https://pypi.org/project/laza-common/)

```
pip install laza-di
```

Full install. Installs all optional dependencies.
```
pip install laza-common[all]
```


#### Optional Dependencies

The following features/modules have additional dependecies that you might need to install:-

- `json` which requires `orjson`
```
pip install laza-common[json]
```
- `locale` which requires `babel`
```
pip install laza-common[locale]
```
- `moment` which requires `arrow`
```
pip install laza-common[moment]
```
- `money` which requires `py-moneyed`
```
pip install laza-common[money]
```
- `networks` which requires `pydantic[email]`
```
pip install laza-common[networks]
```
- `phone` which requires `phonenumbers`
```
pip install laza-common[phone]
```

or you can pick a set
```
pip install laza-common[phone,json,money]
```



## Documentation

Coming soon.


## Production

__This package is still in active development and should not be used in production environment__
laza-di 0.0.3
Dependency injection library
Requires Python: ~=3.9

# Laza DI

A super fast dependency injection library for python.


```python

from laza.di import IocContainer

ioc = IocContainer()


@ioc.injectable()
class A(object):
    ...


@ioc.injectable(shared=True)
class B(object):
    ...


# Register 
@ioc.injectable()
class C(object):
    def __init__(self, a: A, b: B): # <-- dependencies `A` and `B` are injected automatically
        self.a = a
        self.b = b


@ioc.injectable()
class Service(object):
    def __init__(self, a: A, b: B, c: C):
        self.a = a
        self.b = b
        self.c = c


@ioc.inject
def main(service: Service):
    ...


if __name__ == "__main__":

    main()  # <-- dependency is injected automatically

    # transient dependencies always resolve to a new values
    assert ioc[A] is not ioc[A] is not ioc[A]
    
    # Shared dependencies always resolve to the same value.
    assert ioc[B] is ioc[B] is ioc[B]
    assert ioc[Service] is ioc[Service] is ioc[Service]

```



## Installation

Install from [PyPi](https://pypi.org/project/laza-di/)

```
pip install laza-di
```


## Documentation

Coming soon.


## Production

__This package is still in active development and should not be used in production environment__


<!--
What describes a good DI container#
A good DI container:

* __must not__ be a Service Locator, and that’s easier to get as one might think, just go back to my previous post about this topic
* __must not__ be configurable globally (as a globally available instance), because it introduces problems with the reconfiguration
* __must support__ shared dependencies, so we wouldn’t need to exploit the Singleton Pattern
* __must support__ use of profiles, so we can configure it accordingly on different environments
* __should support__ the Decorator Pattern


## Modularity
The ability to isolate deps within their modules/packages

-->