commented out code
This library can detect both inline or block commented out code.
It sends rpc to the server which uses LSTM model to predict commented out code. The server runs on my school data center, and will be migrated to a private machine.
Only support c/c++ now. More language support is about to come
How to use
sample code
text = '''
void DropoutLayer::updateB(){
int num = this->numUnit;
//cout<<"Error!!!!!!!!!!!!!!!!in DropoutLayer!!!!!!!"<<endl;
if (this->z == NULL){ // embeddings
// gradB += dE_dy, because y = b
iXpY( num , this->dE_dy, gradBiases + bidx );
return;
}
if (fprime != dummy){
// dy_dz = f', evaluated at y
( * this->fprime)(this->y, this->dy_dz, num);
// dE_dz = dE_dy .* dy_dz
pointwise_dot(this->dE_dy, this->dy_dz, this->dE_dz, num);
//cout<<"dropout backward"<<endl;
for( int i = 0; i < num; ++i){
this->dE_dz[i] *= this->indicator[i];
}
}// else if fprime == softmaxprime{
// do nothing, because we assume dE_dz is given by softmax
//}
// ReLUPrime(float * y, float * dy_dz, int n);
}
'''
print(client.search(text, 'cpp')) # return OrderedDict object, key is line_number, value is the commented code itself
# output
# OrderedDict([(4, 'cout<<"Error!!!!!!!!!!!!!!!!in DropoutLayer!!!!!!!"<<endl;'),
# (19, 'cout<<"dropout backward"<<endl;'),
# (26, 'else if fprime == softmaxprime{'),
# (29, '}'),
# (31, 'ReLUPrime(float * y, float * dy_dz, int n);')])
Metadata
Release files for commented-out-code 0.0.5
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| commented_out_code-0.0.5.tar.gz | 5.2 kB | Without provenance | Details for commented_out_code-0.0.5.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| commented_out_code-0.0.5-py3-none-any.whl | Python 3 | none | any | Details for commented_out_code-0.0.5-py3-none-any.whl |
Total release size: 11.8 kB
Release files / commented_out_code-0.0.5.tar.gz
| Download URL | commented_out_code-0.0.5.tar.gz |
|---|---|
| Size | 5.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
d0db30e15e9077e4c635a221906df4a46dd6bfe5579034ec3faf50ea7ee1620d
|
|
BLAKE2b-256 checksum How to use checksums |
bf34cd734581942bd5c6db1e248328e93f6acab57fd8dc3f361990e4c6cb1753
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.5.2
|
Release files / commented_out_code-0.0.5-py3-none-any.whl
| Download URL | commented_out_code-0.0.5-py3-none-any.whl |
|---|---|
| Size | 6.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
7b919593f51471d2a3daeda6a000bd1926fa51f236979522e320f43515fbdb4f
|
|
BLAKE2b-256 checksum How to use checksums |
70d13b6731d3ce64ec9a3120318f064301f6c5e51e4c24cb22cfb7f81b02279b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.5.2
|
Security for commented-out-code 0.0.5
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.