dc7910bfcc1317c1b5bcbd83338510e92608f305,cnvlib/core.py,,fbase,#Any#,208

Before Change



def fbase(fname):
    Strip directory and all extensions from a filename.
    return os.path.basename(fname).split(".", 1)[0]


def rbase(fname):
    Strip directory and final extension from a filename.

After Change



def fbase(fname):
    Strip directory and all extensions from a filename.
    base = os.path.basename(fname)
    // Gzip extension usually follows another extension
    if base.endswith(".gz"):
        base = base[:-3]
    // Cases to drop more than just the last dot
    known_multipart_exts = (
        ".antitargetcoverage.cnn", ".targetcoverage.cnn",
        // Pipeline suffixes
        ".recal.bam", ".deduplicated.realign.bam",
    )
    for ext in known_multipart_exts:
        if base.endswith(ext):
            base = base[:-len(ext)]
            break
    else:
        base = base.rsplit(".", 1)[0]
    return base
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 6

Instances


Project Name: etal/cnvkit
Commit Name: dc7910bfcc1317c1b5bcbd83338510e92608f305
Time: 2016-12-06
Author: eric.talevich@gmail.com
File Name: cnvlib/core.py
Class Name:
Method Name: fbase


Project Name: IDSIA/sacred
Commit Name: 024b07ba113c58e06433890791f01dbbabcc85b8
Time: 2015-09-07
Author: qwlouse@gmail.com
File Name: sacred/commandline_options.py
Class Name: CommandLineOption
Method Name: get_flag


Project Name: deepmind/dm_control
Commit Name: 5bfd14da25c8e55ed9294cdbcb7a3272ef9d0b54
Time: 2018-10-10
Author: alimuldal@google.com
File Name: dm_control/autowrap/codegen_util.py
Class Name:
Method Name: mangle_comment