

def _get_first_comment(self):
    'Gets the first comment in a Lua file.\n\n        This only applie to the first _inline_ comment (the ones started with\n        two dashes), block comments are not picked up.\n        '
    comment_pattern = re.compile('^--\\s+')
    found_first_comment = False
    comment_lines = []
    with open(self.path) as f:
        for line in f:
            is_comment = comment_pattern.match(line)
            if is_comment:
                found_first_comment = True
                comment_lines.append(line)
            elif ((not is_comment) and found_first_comment):
                return ''.join(comment_lines)

dataset/ETHPy150Open VoxelDavid/elixir/elixir/rbx.py Script._get_first_comment/original