Skip to main content

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)

Source distribution for commented-out-code 0.0.5
File Size Uploaded
commented_out_code-0.0.5.tar.gz 5.2 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for commented-out-code 0.0.5
File Interpreter ABI Platform
commented_out_code-0.0.5-py3-none-any.whl Python 3 none any Details

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

Release history Release notifications | RSS feed

This release

0.0.5 This release

2 release files

0.0.4

2 release files

0.0.3

2 release files

0.0.2

2 release files

0.0.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page