<commit_before>import sublime, sublime_plugin

class DuplicateLinesCommand(sublime_plugin.TextCommand):
    def run(self, edit):
        for region in self.view.sel():
            if region.empty():
                line = self.view.line(region)
                line_contents = self.view.substr(line) + '\n'
                self.view.insert(edit, line.begin(), line_contents)
            else:
                line = self.view.line(region)
                self.view.run_command("expand_selection", {"to": line.begin()})
                region_contents = self.view.substr(self.view.line(region)) + '\n'
                self.view.insert(edit, line.begin(), region_contents)
<commit_msg>Add ability to perform 'duplicate up'.<commit_after>import sublime, sublime_plugin

class DuplicateLinesCommand(sublime_plugin.TextCommand):
    def run(self, edit, **args):
        for region in self.view.sel():
            line = self.view.full_line(region)
            line_contents = self.view.substr(line)
            self.view.insert(edit, line.end() if args.get('up', False) else line.begin(), line_contents)

{'fraction_non_alphanumeric': 0.12556869881710647, 'fraction_numerical': 0.0, 'mean_word_length': 2.559870550161812, 'pattern_counts': {'":': 1, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1632641', 'n_tokens_mistral': 326, 'n_tokens_neox': 314, 'n_words': 64}