

def strip_hashcomments(value):
    lines = value.splitlines()
    result = []
    if (lines and (lines[0].rstrip() in ('#!/bin/sh', '#!/bin/bash'))):
        for (index, line) in enumerate(lines):
            if ((index > 0) and line.strip().startswith('#')):
                continue
            result.append(line)
    else:
        return '\n'.join(lines)
    return '\n'.join(result)

dataset/ETHPy150Open ployground/ploy/ploy/common.py strip_hashcomments/original