prefix
dict
middle
dict
suffix
dict
file_path
dict
repo_name
dict
context
dict
lang
dict
row_idx
dict
{ "stringlengths": 21, "value": "#!/usr/bin/env python" }
{ "stringlengths": 624, "value": "# coding: utf-8\n\n\"\"\"\n The approach taken is explained below. I decided to do it simply.\n Initially I was considering parsing the data into some sort of\n structure and then generating an appropriate README. I am still\n considering doing it - but for now this sho...
{ "stringlengths": 504, "value": "\ndef sort_blocks():\n # First, we load the current README into memory\n with open('README.md', 'r') as read_me_file:\n read_me = read_me_file.read()\n\n # Separating the 'table of contents' from the contents (blocks)\n table_of_contents = ''.join(read_me.split('...
{ "stringlengths": 35, "value": "./temp_repos/awesome-python\\sort.py" }
{ "stringlengths": 14, "value": "awesome-python" }
{ "listlengths": 1, "value": [ { "filename": "sort.py", "retrieved_chunk": "#!/usr/bin/env python\n# coding: utf-8\n\n\"\"\"\n The approach taken is explained below. I decided to do it simply.\n Initially I was considering parsing the data into some sort of\n structure and then generating a...
{ "stringclasses": "py", "value": "py" }
{ "int64": 14 }
{ "stringlengths": 21, "value": "#!/usr/bin/env python" }
{ "stringlengths": 625, "value": "# coding: utf-8\n\n\"\"\"\n The approach taken is explained below. I decided to do it simply.\n Initially I was considering parsing the data into some sort of\n structure and then generating an appropriate README. I am still\n considering doing it - but for now this sho...
{ "stringlengths": 531, "value": "def sort_blocks():\n # First, we load the current README into memory\n with open('README.md', 'r') as read_me_file:\n read_me = read_me_file.read()\n\n # Separating the 'table of contents' from the contents (blocks)\n table_of_contents = ''.join(read_me.split('- ...
{ "stringlengths": 35, "value": "./temp_repos/awesome-python\\sort.py" }
{ "stringlengths": 14, "value": "awesome-python" }
{ "listlengths": 1, "value": [ { "filename": "sort.py", "retrieved_chunk": "#!/usr/bin/env python\n# coding: utf-8\n\n\"\"\"\n The approach taken is explained below. I decided to do it simply.\n Initially I was considering parsing the data into some sort of\n structure and then generating a...
{ "stringclasses": "py", "value": "py" }
{ "int64": 15 }
{ "stringlengths": 21, "value": "#!/usr/bin/env python" }
{ "stringlengths": 783, "value": "# coding: utf-8\n\n\"\"\"\n The approach taken is explained below. I decided to do it simply.\n Initially I was considering parsing the data into some sort of\n structure and then generating an appropriate README. I am still\n considering doing it - but for now this sho...
{ "stringlengths": 555, "value": "\n # Separating the 'table of contents' from the contents (blocks)\n table_of_contents = ''.join(read_me.split('- - -')[0])\n blocks = ''.join(read_me.split('- - -')[1]).split('\\n# ')\n for i in range(len(blocks)):\n if i == 0:\n blocks[i] = blocks[i]...
{ "stringlengths": 35, "value": "./temp_repos/awesome-python\\sort.py" }
{ "stringlengths": 14, "value": "awesome-python" }
{ "listlengths": 1, "value": [ { "filename": "sort.py", "retrieved_chunk": "#!/usr/bin/env python\n# coding: utf-8\n\n\"\"\"\n The approach taken is explained below. I decided to do it simply.\n Initially I was considering parsing the data into some sort of\n structure and then generating a...
{ "stringclasses": "py", "value": "py" }
{ "int64": 16 }
{ "stringlengths": 21, "value": "#!/usr/bin/env python" }
{ "stringlengths": 784, "value": "# coding: utf-8\n\n\"\"\"\n The approach taken is explained below. I decided to do it simply.\n Initially I was considering parsing the data into some sort of\n structure and then generating an appropriate README. I am still\n considering doing it - but for now this sho...
{ "stringlengths": 595, "value": " # Separating the 'table of contents' from the contents (blocks)\n table_of_contents = ''.join(read_me.split('- - -')[0])\n blocks = ''.join(read_me.split('- - -')[1]).split('\\n# ')\n for i in range(len(blocks)):\n if i == 0:\n blocks[i] = blocks[i] +...
{ "stringlengths": 35, "value": "./temp_repos/awesome-python\\sort.py" }
{ "stringlengths": 14, "value": "awesome-python" }
{ "listlengths": 1, "value": [ { "filename": "sort.py", "retrieved_chunk": "#!/usr/bin/env python\n# coding: utf-8\n\n\"\"\"\n The approach taken is explained below. I decided to do it simply.\n Initially I was considering parsing the data into some sort of\n structure and then generating a...
{ "stringclasses": "py", "value": "py" }
{ "int64": 17 }
{ "stringlengths": 21, "value": "#!/usr/bin/env python" }
{ "stringlengths": 852, "value": "# coding: utf-8\n\n\"\"\"\n The approach taken is explained below. I decided to do it simply.\n Initially I was considering parsing the data into some sort of\n structure and then generating an appropriate README. I am still\n considering doing it - but for now this sho...
{ "stringlengths": 528, "value": " table_of_contents = ''.join(read_me.split('- - -')[0])\n blocks = ''.join(read_me.split('- - -')[1]).split('\\n# ')\n for i in range(len(blocks)):\n if i == 0:\n blocks[i] = blocks[i] + '\\n'\n else:\n blocks[i] = '# ' + blocks[i] + '\\...
{ "stringlengths": 35, "value": "./temp_repos/awesome-python\\sort.py" }
{ "stringlengths": 14, "value": "awesome-python" }
{ "listlengths": 1, "value": [ { "filename": "sort.py", "retrieved_chunk": "#!/usr/bin/env python\n# coding: utf-8\n\n\"\"\"\n The approach taken is explained below. I decided to do it simply.\n Initially I was considering parsing the data into some sort of\n structure and then generating a...
{ "stringclasses": "py", "value": "py" }
{ "int64": 18 }
{ "stringlengths": 21, "value": "#!/usr/bin/env python" }
{ "stringlengths": 911, "value": "# coding: utf-8\n\n\"\"\"\n The approach taken is explained below. I decided to do it simply.\n Initially I was considering parsing the data into some sort of\n structure and then generating an appropriate README. I am still\n considering doing it - but for now this sho...
{ "stringlengths": 572, "value": " blocks = ''.join(read_me.split('- - -')[1]).split('\\n# ')\n for i in range(len(blocks)):\n if i == 0:\n blocks[i] = blocks[i] + '\\n'\n else:\n blocks[i] = '# ' + blocks[i] + '\\n'\n\n # Sorting the libraries\n inner_blocks = sorted...
{ "stringlengths": 35, "value": "./temp_repos/awesome-python\\sort.py" }
{ "stringlengths": 14, "value": "awesome-python" }
{ "listlengths": 1, "value": [ { "filename": "sort.py", "retrieved_chunk": "#!/usr/bin/env python\n# coding: utf-8\n\n\"\"\"\n The approach taken is explained below. I decided to do it simply.\n Initially I was considering parsing the data into some sort of\n structure and then generating a...
{ "stringclasses": "py", "value": "py" }
{ "int64": 19 }
{ "stringlengths": 21, "value": "#!/usr/bin/env python" }
{ "stringlengths": 973, "value": "# coding: utf-8\n\n\"\"\"\n The approach taken is explained below. I decided to do it simply.\n Initially I was considering parsing the data into some sort of\n structure and then generating an appropriate README. I am still\n considering doing it - but for now this sho...
{ "stringlengths": 539, "value": " for i in range(len(blocks)):\n if i == 0:\n blocks[i] = blocks[i] + '\\n'\n else:\n blocks[i] = '# ' + blocks[i] + '\\n'\n\n # Sorting the libraries\n inner_blocks = sorted(blocks[0].split('##'))\n for i in range(1, len(inner_blocks)...
{ "stringlengths": 35, "value": "./temp_repos/awesome-python\\sort.py" }
{ "stringlengths": 14, "value": "awesome-python" }
{ "listlengths": 1, "value": [ { "filename": "sort.py", "retrieved_chunk": "#!/usr/bin/env python\n# coding: utf-8\n\n\"\"\"\n The approach taken is explained below. I decided to do it simply.\n Initially I was considering parsing the data into some sort of\n structure and then generating a...
{ "stringclasses": "py", "value": "py" }
{ "int64": 20 }
{ "stringlengths": 21, "value": "#!/usr/bin/env python" }
{ "stringlengths": 1066, "value": "# coding: utf-8\n\n\"\"\"\n The approach taken is explained below. I decided to do it simply.\n Initially I was considering parsing the data into some sort of\n structure and then generating an appropriate README. I am still\n considering doing it - but for now this sh...
{ "stringlengths": 561, "value": " else:\n blocks[i] = '# ' + blocks[i] + '\\n'\n\n # Sorting the libraries\n inner_blocks = sorted(blocks[0].split('##'))\n for i in range(1, len(inner_blocks)):\n if inner_blocks[i][0] != '#':\n inner_blocks[i] = '##' + inner_blocks[i]\n...
{ "stringlengths": 35, "value": "./temp_repos/awesome-python\\sort.py" }
{ "stringlengths": 14, "value": "awesome-python" }
{ "listlengths": 1, "value": [ { "filename": "sort.py", "retrieved_chunk": "#!/usr/bin/env python\n# coding: utf-8\n\n\"\"\"\n The approach taken is explained below. I decided to do it simply.\n Initially I was considering parsing the data into some sort of\n structure and then generating a...
{ "stringclasses": "py", "value": "py" }
{ "int64": 21 }
{ "stringlengths": 21, "value": "#!/usr/bin/env python" }
{ "stringlengths": 1128, "value": "# coding: utf-8\n\n\"\"\"\n The approach taken is explained below. I decided to do it simply.\n Initially I was considering parsing the data into some sort of\n structure and then generating an appropriate README. I am still\n considering doing it - but for now this sh...
{ "stringlengths": 540, "value": "\n # Sorting the libraries\n inner_blocks = sorted(blocks[0].split('##'))\n for i in range(1, len(inner_blocks)):\n if inner_blocks[i][0] != '#':\n inner_blocks[i] = '##' + inner_blocks[i]\n inner_blocks = ''.join(inner_blocks)\n\n # Replacing the n...
{ "stringlengths": 35, "value": "./temp_repos/awesome-python\\sort.py" }
{ "stringlengths": 14, "value": "awesome-python" }
{ "listlengths": 1, "value": [ { "filename": "sort.py", "retrieved_chunk": "#!/usr/bin/env python\n# coding: utf-8\n\n\"\"\"\n The approach taken is explained below. I decided to do it simply.\n Initially I was considering parsing the data into some sort of\n structure and then generating a...
{ "stringclasses": "py", "value": "py" }
{ "int64": 22 }
{ "stringlengths": 21, "value": "#!/usr/bin/env python" }
{ "stringlengths": 1129, "value": "# coding: utf-8\n\n\"\"\"\n The approach taken is explained below. I decided to do it simply.\n Initially I was considering parsing the data into some sort of\n structure and then generating an appropriate README. I am still\n considering doing it - but for now this sh...
{ "stringlengths": 551, "value": " # Sorting the libraries\n inner_blocks = sorted(blocks[0].split('##'))\n for i in range(1, len(inner_blocks)):\n if inner_blocks[i][0] != '#':\n inner_blocks[i] = '##' + inner_blocks[i]\n inner_blocks = ''.join(inner_blocks)\n\n # Replacing the non...
{ "stringlengths": 35, "value": "./temp_repos/awesome-python\\sort.py" }
{ "stringlengths": 14, "value": "awesome-python" }
{ "listlengths": 1, "value": [ { "filename": "sort.py", "retrieved_chunk": "#!/usr/bin/env python\n# coding: utf-8\n\n\"\"\"\n The approach taken is explained below. I decided to do it simply.\n Initially I was considering parsing the data into some sort of\n structure and then generating a...
{ "stringclasses": "py", "value": "py" }
{ "int64": 23 }
{ "stringlengths": 37, "value": "#!/usr/bin/env python\n# coding: utf-8" }
{ "stringlengths": 608, "value": "\n\"\"\"\n The approach taken is explained below. I decided to do it simply.\n Initially I was considering parsing the data into some sort of\n structure and then generating an appropriate README. I am still\n considering doing it - but for now this should work. The onl...
{ "stringlengths": 504, "value": "\ndef sort_blocks():\n # First, we load the current README into memory\n with open('README.md', 'r') as read_me_file:\n read_me = read_me_file.read()\n\n # Separating the 'table of contents' from the contents (blocks)\n table_of_contents = ''.join(read_me.split('...
{ "stringlengths": 35, "value": "./temp_repos/awesome-python\\sort.py" }
{ "stringlengths": 14, "value": "awesome-python" }
{ "listlengths": 1, "value": [ { "filename": "sort.py", "retrieved_chunk": "#!/usr/bin/env python\n# coding: utf-8\n\n\"\"\"\n The approach taken is explained below. I decided to do it simply.\n Initially I was considering parsing the data into some sort of\n structure and then generating a...
{ "stringclasses": "py", "value": "py" }
{ "int64": 24 }
{ "stringlengths": 37, "value": "#!/usr/bin/env python\n# coding: utf-8" }
{ "stringlengths": 609, "value": "\n\"\"\"\n The approach taken is explained below. I decided to do it simply.\n Initially I was considering parsing the data into some sort of\n structure and then generating an appropriate README. I am still\n considering doing it - but for now this should work. The onl...
{ "stringlengths": 531, "value": "def sort_blocks():\n # First, we load the current README into memory\n with open('README.md', 'r') as read_me_file:\n read_me = read_me_file.read()\n\n # Separating the 'table of contents' from the contents (blocks)\n table_of_contents = ''.join(read_me.split('- ...
{ "stringlengths": 35, "value": "./temp_repos/awesome-python\\sort.py" }
{ "stringlengths": 14, "value": "awesome-python" }
{ "listlengths": 1, "value": [ { "filename": "sort.py", "retrieved_chunk": "#!/usr/bin/env python\n# coding: utf-8\n\n\"\"\"\n The approach taken is explained below. I decided to do it simply.\n Initially I was considering parsing the data into some sort of\n structure and then generating a...
{ "stringclasses": "py", "value": "py" }
{ "int64": 25 }
{ "stringlengths": 37, "value": "#!/usr/bin/env python\n# coding: utf-8" }
{ "stringlengths": 767, "value": "\n\"\"\"\n The approach taken is explained below. I decided to do it simply.\n Initially I was considering parsing the data into some sort of\n structure and then generating an appropriate README. I am still\n considering doing it - but for now this should work. The onl...
{ "stringlengths": 555, "value": "\n # Separating the 'table of contents' from the contents (blocks)\n table_of_contents = ''.join(read_me.split('- - -')[0])\n blocks = ''.join(read_me.split('- - -')[1]).split('\\n# ')\n for i in range(len(blocks)):\n if i == 0:\n blocks[i] = blocks[i]...
{ "stringlengths": 35, "value": "./temp_repos/awesome-python\\sort.py" }
{ "stringlengths": 14, "value": "awesome-python" }
{ "listlengths": 1, "value": [ { "filename": "sort.py", "retrieved_chunk": "#!/usr/bin/env python\n# coding: utf-8\n\n\"\"\"\n The approach taken is explained below. I decided to do it simply.\n Initially I was considering parsing the data into some sort of\n structure and then generating a...
{ "stringclasses": "py", "value": "py" }
{ "int64": 26 }
{ "stringlengths": 37, "value": "#!/usr/bin/env python\n# coding: utf-8" }
{ "stringlengths": 768, "value": "\n\"\"\"\n The approach taken is explained below. I decided to do it simply.\n Initially I was considering parsing the data into some sort of\n structure and then generating an appropriate README. I am still\n considering doing it - but for now this should work. The onl...
{ "stringlengths": 595, "value": " # Separating the 'table of contents' from the contents (blocks)\n table_of_contents = ''.join(read_me.split('- - -')[0])\n blocks = ''.join(read_me.split('- - -')[1]).split('\\n# ')\n for i in range(len(blocks)):\n if i == 0:\n blocks[i] = blocks[i] +...
{ "stringlengths": 35, "value": "./temp_repos/awesome-python\\sort.py" }
{ "stringlengths": 14, "value": "awesome-python" }
{ "listlengths": 1, "value": [ { "filename": "sort.py", "retrieved_chunk": "#!/usr/bin/env python\n# coding: utf-8\n\n\"\"\"\n The approach taken is explained below. I decided to do it simply.\n Initially I was considering parsing the data into some sort of\n structure and then generating a...
{ "stringclasses": "py", "value": "py" }
{ "int64": 27 }
{ "stringlengths": 37, "value": "#!/usr/bin/env python\n# coding: utf-8" }
{ "stringlengths": 836, "value": "\n\"\"\"\n The approach taken is explained below. I decided to do it simply.\n Initially I was considering parsing the data into some sort of\n structure and then generating an appropriate README. I am still\n considering doing it - but for now this should work. The onl...
{ "stringlengths": 528, "value": " table_of_contents = ''.join(read_me.split('- - -')[0])\n blocks = ''.join(read_me.split('- - -')[1]).split('\\n# ')\n for i in range(len(blocks)):\n if i == 0:\n blocks[i] = blocks[i] + '\\n'\n else:\n blocks[i] = '# ' + blocks[i] + '\\...
{ "stringlengths": 35, "value": "./temp_repos/awesome-python\\sort.py" }
{ "stringlengths": 14, "value": "awesome-python" }
{ "listlengths": 1, "value": [ { "filename": "sort.py", "retrieved_chunk": "#!/usr/bin/env python\n# coding: utf-8\n\n\"\"\"\n The approach taken is explained below. I decided to do it simply.\n Initially I was considering parsing the data into some sort of\n structure and then generating a...
{ "stringclasses": "py", "value": "py" }
{ "int64": 28 }
{ "stringlengths": 37, "value": "#!/usr/bin/env python\n# coding: utf-8" }
{ "stringlengths": 895, "value": "\n\"\"\"\n The approach taken is explained below. I decided to do it simply.\n Initially I was considering parsing the data into some sort of\n structure and then generating an appropriate README. I am still\n considering doing it - but for now this should work. The onl...
{ "stringlengths": 572, "value": " blocks = ''.join(read_me.split('- - -')[1]).split('\\n# ')\n for i in range(len(blocks)):\n if i == 0:\n blocks[i] = blocks[i] + '\\n'\n else:\n blocks[i] = '# ' + blocks[i] + '\\n'\n\n # Sorting the libraries\n inner_blocks = sorted...
{ "stringlengths": 35, "value": "./temp_repos/awesome-python\\sort.py" }
{ "stringlengths": 14, "value": "awesome-python" }
{ "listlengths": 1, "value": [ { "filename": "sort.py", "retrieved_chunk": "#!/usr/bin/env python\n# coding: utf-8\n\n\"\"\"\n The approach taken is explained below. I decided to do it simply.\n Initially I was considering parsing the data into some sort of\n structure and then generating a...
{ "stringclasses": "py", "value": "py" }
{ "int64": 29 }
{ "stringlengths": 37, "value": "#!/usr/bin/env python\n# coding: utf-8" }
{ "stringlengths": 957, "value": "\n\"\"\"\n The approach taken is explained below. I decided to do it simply.\n Initially I was considering parsing the data into some sort of\n structure and then generating an appropriate README. I am still\n considering doing it - but for now this should work. The onl...
{ "stringlengths": 539, "value": " for i in range(len(blocks)):\n if i == 0:\n blocks[i] = blocks[i] + '\\n'\n else:\n blocks[i] = '# ' + blocks[i] + '\\n'\n\n # Sorting the libraries\n inner_blocks = sorted(blocks[0].split('##'))\n for i in range(1, len(inner_blocks)...
{ "stringlengths": 35, "value": "./temp_repos/awesome-python\\sort.py" }
{ "stringlengths": 14, "value": "awesome-python" }
{ "listlengths": 1, "value": [ { "filename": "sort.py", "retrieved_chunk": "#!/usr/bin/env python\n# coding: utf-8\n\n\"\"\"\n The approach taken is explained below. I decided to do it simply.\n Initially I was considering parsing the data into some sort of\n structure and then generating a...
{ "stringclasses": "py", "value": "py" }
{ "int64": 30 }
{ "stringlengths": 37, "value": "#!/usr/bin/env python\n# coding: utf-8" }
{ "stringlengths": 1050, "value": "\n\"\"\"\n The approach taken is explained below. I decided to do it simply.\n Initially I was considering parsing the data into some sort of\n structure and then generating an appropriate README. I am still\n considering doing it - but for now this should work. The on...
{ "stringlengths": 561, "value": " else:\n blocks[i] = '# ' + blocks[i] + '\\n'\n\n # Sorting the libraries\n inner_blocks = sorted(blocks[0].split('##'))\n for i in range(1, len(inner_blocks)):\n if inner_blocks[i][0] != '#':\n inner_blocks[i] = '##' + inner_blocks[i]\n...
{ "stringlengths": 35, "value": "./temp_repos/awesome-python\\sort.py" }
{ "stringlengths": 14, "value": "awesome-python" }
{ "listlengths": 1, "value": [ { "filename": "sort.py", "retrieved_chunk": "#!/usr/bin/env python\n# coding: utf-8\n\n\"\"\"\n The approach taken is explained below. I decided to do it simply.\n Initially I was considering parsing the data into some sort of\n structure and then generating a...
{ "stringclasses": "py", "value": "py" }
{ "int64": 31 }
{ "stringlengths": 37, "value": "#!/usr/bin/env python\n# coding: utf-8" }
{ "stringlengths": 1112, "value": "\n\"\"\"\n The approach taken is explained below. I decided to do it simply.\n Initially I was considering parsing the data into some sort of\n structure and then generating an appropriate README. I am still\n considering doing it - but for now this should work. The on...
{ "stringlengths": 540, "value": "\n # Sorting the libraries\n inner_blocks = sorted(blocks[0].split('##'))\n for i in range(1, len(inner_blocks)):\n if inner_blocks[i][0] != '#':\n inner_blocks[i] = '##' + inner_blocks[i]\n inner_blocks = ''.join(inner_blocks)\n\n # Replacing the n...
{ "stringlengths": 35, "value": "./temp_repos/awesome-python\\sort.py" }
{ "stringlengths": 14, "value": "awesome-python" }
{ "listlengths": 1, "value": [ { "filename": "sort.py", "retrieved_chunk": "#!/usr/bin/env python\n# coding: utf-8\n\n\"\"\"\n The approach taken is explained below. I decided to do it simply.\n Initially I was considering parsing the data into some sort of\n structure and then generating a...
{ "stringclasses": "py", "value": "py" }
{ "int64": 32 }
{ "stringlengths": 37, "value": "#!/usr/bin/env python\n# coding: utf-8" }
{ "stringlengths": 1113, "value": "\n\"\"\"\n The approach taken is explained below. I decided to do it simply.\n Initially I was considering parsing the data into some sort of\n structure and then generating an appropriate README. I am still\n considering doing it - but for now this should work. The on...
{ "stringlengths": 551, "value": " # Sorting the libraries\n inner_blocks = sorted(blocks[0].split('##'))\n for i in range(1, len(inner_blocks)):\n if inner_blocks[i][0] != '#':\n inner_blocks[i] = '##' + inner_blocks[i]\n inner_blocks = ''.join(inner_blocks)\n\n # Replacing the non...
{ "stringlengths": 35, "value": "./temp_repos/awesome-python\\sort.py" }
{ "stringlengths": 14, "value": "awesome-python" }
{ "listlengths": 1, "value": [ { "filename": "sort.py", "retrieved_chunk": "#!/usr/bin/env python\n# coding: utf-8\n\n\"\"\"\n The approach taken is explained below. I decided to do it simply.\n Initially I was considering parsing the data into some sort of\n structure and then generating a...
{ "stringclasses": "py", "value": "py" }
{ "int64": 33 }
{ "stringlengths": 37, "value": "#!/usr/bin/env python\n# coding: utf-8" }
{ "stringlengths": 1141, "value": "\n\"\"\"\n The approach taken is explained below. I decided to do it simply.\n Initially I was considering parsing the data into some sort of\n structure and then generating an appropriate README. I am still\n considering doing it - but for now this should work. The on...
{ "stringlengths": 596, "value": " inner_blocks = sorted(blocks[0].split('##'))\n for i in range(1, len(inner_blocks)):\n if inner_blocks[i][0] != '#':\n inner_blocks[i] = '##' + inner_blocks[i]\n inner_blocks = ''.join(inner_blocks)\n\n # Replacing the non-sorted libraries by the sort...
{ "stringlengths": 35, "value": "./temp_repos/awesome-python\\sort.py" }
{ "stringlengths": 14, "value": "awesome-python" }
{ "listlengths": 1, "value": [ { "filename": "sort.py", "retrieved_chunk": "#!/usr/bin/env python\n# coding: utf-8\n\n\"\"\"\n The approach taken is explained below. I decided to do it simply.\n Initially I was considering parsing the data into some sort of\n structure and then generating a...
{ "stringclasses": "py", "value": "py" }
{ "int64": 34 }
{ "stringlengths": 38, "value": "#!/usr/bin/env python\n# coding: utf-8\n" }
{ "stringlengths": 1189, "value": "\"\"\"\n The approach taken is explained below. I decided to do it simply.\n Initially I was considering parsing the data into some sort of\n structure and then generating an appropriate README. I am still\n considering doing it - but for now this should work. The only...
{ "stringlengths": 596, "value": " for i in range(1, len(inner_blocks)):\n if inner_blocks[i][0] != '#':\n inner_blocks[i] = '##' + inner_blocks[i]\n inner_blocks = ''.join(inner_blocks)\n\n # Replacing the non-sorted libraries by the sorted ones and gathering all at the final_README file...
{ "stringlengths": 35, "value": "./temp_repos/awesome-python\\sort.py" }
{ "stringlengths": 14, "value": "awesome-python" }
{ "listlengths": 1, "value": [ { "filename": "sort.py", "retrieved_chunk": "#!/usr/bin/env python\n# coding: utf-8\n\n\"\"\"\n The approach taken is explained below. I decided to do it simply.\n Initially I was considering parsing the data into some sort of\n structure and then generating a...
{ "stringclasses": "py", "value": "py" }
{ "int64": 46 }
{ "stringlengths": 646, "value": "#!/usr/bin/env python\n# coding: utf-8\n\n\"\"\"\n The approach taken is explained below. I decided to do it simply.\n Initially I was considering parsing the data into some sort of\n structure and then generating an appropriate README. I am still\n considering doing it...
{ "stringlengths": 158, "value": "\ndef sort_blocks():\n # First, we load the current README into memory\n with open('README.md', 'r') as read_me_file:\n read_me = read_me_file.read()" }
{ "stringlengths": 555, "value": "\n # Separating the 'table of contents' from the contents (blocks)\n table_of_contents = ''.join(read_me.split('- - -')[0])\n blocks = ''.join(read_me.split('- - -')[1]).split('\\n# ')\n for i in range(len(blocks)):\n if i == 0:\n blocks[i] = blocks[i]...
{ "stringlengths": 35, "value": "./temp_repos/awesome-python\\sort.py" }
{ "stringlengths": 14, "value": "awesome-python" }
{ "listlengths": 1, "value": [ { "filename": "sort.py", "retrieved_chunk": "#!/usr/bin/env python\n# coding: utf-8\n\n\"\"\"\n The approach taken is explained below. I decided to do it simply.\n Initially I was considering parsing the data into some sort of\n structure and then generating a...
{ "stringclasses": "py", "value": "py" }
{ "int64": 47 }
{ "stringlengths": 646, "value": "#!/usr/bin/env python\n# coding: utf-8\n\n\"\"\"\n The approach taken is explained below. I decided to do it simply.\n Initially I was considering parsing the data into some sort of\n structure and then generating an appropriate README. I am still\n considering doing it...
{ "stringlengths": 159, "value": "\ndef sort_blocks():\n # First, we load the current README into memory\n with open('README.md', 'r') as read_me_file:\n read_me = read_me_file.read()\n" }
{ "stringlengths": 595, "value": " # Separating the 'table of contents' from the contents (blocks)\n table_of_contents = ''.join(read_me.split('- - -')[0])\n blocks = ''.join(read_me.split('- - -')[1]).split('\\n# ')\n for i in range(len(blocks)):\n if i == 0:\n blocks[i] = blocks[i] +...
{ "stringlengths": 35, "value": "./temp_repos/awesome-python\\sort.py" }
{ "stringlengths": 14, "value": "awesome-python" }
{ "listlengths": 1, "value": [ { "filename": "sort.py", "retrieved_chunk": "#!/usr/bin/env python\n# coding: utf-8\n\n\"\"\"\n The approach taken is explained below. I decided to do it simply.\n Initially I was considering parsing the data into some sort of\n structure and then generating a...
{ "stringclasses": "py", "value": "py" }
{ "int64": 48 }
{ "stringlengths": 646, "value": "#!/usr/bin/env python\n# coding: utf-8\n\n\"\"\"\n The approach taken is explained below. I decided to do it simply.\n Initially I was considering parsing the data into some sort of\n structure and then generating an appropriate README. I am still\n considering doing it...
{ "stringlengths": 227, "value": "\ndef sort_blocks():\n # First, we load the current README into memory\n with open('README.md', 'r') as read_me_file:\n read_me = read_me_file.read()\n\n # Separating the 'table of contents' from the contents (blocks)" }
{ "stringlengths": 528, "value": " table_of_contents = ''.join(read_me.split('- - -')[0])\n blocks = ''.join(read_me.split('- - -')[1]).split('\\n# ')\n for i in range(len(blocks)):\n if i == 0:\n blocks[i] = blocks[i] + '\\n'\n else:\n blocks[i] = '# ' + blocks[i] + '\\...
{ "stringlengths": 35, "value": "./temp_repos/awesome-python\\sort.py" }
{ "stringlengths": 14, "value": "awesome-python" }
{ "listlengths": 1, "value": [ { "filename": "sort.py", "retrieved_chunk": "#!/usr/bin/env python\n# coding: utf-8\n\n\"\"\"\n The approach taken is explained below. I decided to do it simply.\n Initially I was considering parsing the data into some sort of\n structure and then generating a...
{ "stringclasses": "py", "value": "py" }
{ "int64": 49 }
{ "stringlengths": 646, "value": "#!/usr/bin/env python\n# coding: utf-8\n\n\"\"\"\n The approach taken is explained below. I decided to do it simply.\n Initially I was considering parsing the data into some sort of\n structure and then generating an appropriate README. I am still\n considering doing it...
{ "stringlengths": 286, "value": "\ndef sort_blocks():\n # First, we load the current README into memory\n with open('README.md', 'r') as read_me_file:\n read_me = read_me_file.read()\n\n # Separating the 'table of contents' from the contents (blocks)\n table_of_contents = ''.join(read_me.split('...
{ "stringlengths": 572, "value": " blocks = ''.join(read_me.split('- - -')[1]).split('\\n# ')\n for i in range(len(blocks)):\n if i == 0:\n blocks[i] = blocks[i] + '\\n'\n else:\n blocks[i] = '# ' + blocks[i] + '\\n'\n\n # Sorting the libraries\n inner_blocks = sorted...
{ "stringlengths": 35, "value": "./temp_repos/awesome-python\\sort.py" }
{ "stringlengths": 14, "value": "awesome-python" }
{ "listlengths": 1, "value": [ { "filename": "sort.py", "retrieved_chunk": "#!/usr/bin/env python\n# coding: utf-8\n\n\"\"\"\n The approach taken is explained below. I decided to do it simply.\n Initially I was considering parsing the data into some sort of\n structure and then generating a...
{ "stringclasses": "py", "value": "py" }
{ "int64": 50 }
{ "stringlengths": 646, "value": "#!/usr/bin/env python\n# coding: utf-8\n\n\"\"\"\n The approach taken is explained below. I decided to do it simply.\n Initially I was considering parsing the data into some sort of\n structure and then generating an appropriate README. I am still\n considering doing it...
{ "stringlengths": 348, "value": "\ndef sort_blocks():\n # First, we load the current README into memory\n with open('README.md', 'r') as read_me_file:\n read_me = read_me_file.read()\n\n # Separating the 'table of contents' from the contents (blocks)\n table_of_contents = ''.join(read_me.split('...
{ "stringlengths": 539, "value": " for i in range(len(blocks)):\n if i == 0:\n blocks[i] = blocks[i] + '\\n'\n else:\n blocks[i] = '# ' + blocks[i] + '\\n'\n\n # Sorting the libraries\n inner_blocks = sorted(blocks[0].split('##'))\n for i in range(1, len(inner_blocks)...
{ "stringlengths": 35, "value": "./temp_repos/awesome-python\\sort.py" }
{ "stringlengths": 14, "value": "awesome-python" }
{ "listlengths": 1, "value": [ { "filename": "sort.py", "retrieved_chunk": "#!/usr/bin/env python\n# coding: utf-8\n\n\"\"\"\n The approach taken is explained below. I decided to do it simply.\n Initially I was considering parsing the data into some sort of\n structure and then generating a...
{ "stringclasses": "py", "value": "py" }
{ "int64": 51 }
{ "stringlengths": 646, "value": "#!/usr/bin/env python\n# coding: utf-8\n\n\"\"\"\n The approach taken is explained below. I decided to do it simply.\n Initially I was considering parsing the data into some sort of\n structure and then generating an appropriate README. I am still\n considering doing it...
{ "stringlengths": 441, "value": "\ndef sort_blocks():\n # First, we load the current README into memory\n with open('README.md', 'r') as read_me_file:\n read_me = read_me_file.read()\n\n # Separating the 'table of contents' from the contents (blocks)\n table_of_contents = ''.join(read_me.split('...
{ "stringlengths": 561, "value": " else:\n blocks[i] = '# ' + blocks[i] + '\\n'\n\n # Sorting the libraries\n inner_blocks = sorted(blocks[0].split('##'))\n for i in range(1, len(inner_blocks)):\n if inner_blocks[i][0] != '#':\n inner_blocks[i] = '##' + inner_blocks[i]\n...
{ "stringlengths": 35, "value": "./temp_repos/awesome-python\\sort.py" }
{ "stringlengths": 14, "value": "awesome-python" }
{ "listlengths": 1, "value": [ { "filename": "sort.py", "retrieved_chunk": "#!/usr/bin/env python\n# coding: utf-8\n\n\"\"\"\n The approach taken is explained below. I decided to do it simply.\n Initially I was considering parsing the data into some sort of\n structure and then generating a...
{ "stringclasses": "py", "value": "py" }
{ "int64": 52 }
{ "stringlengths": 646, "value": "#!/usr/bin/env python\n# coding: utf-8\n\n\"\"\"\n The approach taken is explained below. I decided to do it simply.\n Initially I was considering parsing the data into some sort of\n structure and then generating an appropriate README. I am still\n considering doing it...
{ "stringlengths": 503, "value": "\ndef sort_blocks():\n # First, we load the current README into memory\n with open('README.md', 'r') as read_me_file:\n read_me = read_me_file.read()\n\n # Separating the 'table of contents' from the contents (blocks)\n table_of_contents = ''.join(read_me.split('...
{ "stringlengths": 540, "value": "\n # Sorting the libraries\n inner_blocks = sorted(blocks[0].split('##'))\n for i in range(1, len(inner_blocks)):\n if inner_blocks[i][0] != '#':\n inner_blocks[i] = '##' + inner_blocks[i]\n inner_blocks = ''.join(inner_blocks)\n\n # Replacing the n...
{ "stringlengths": 35, "value": "./temp_repos/awesome-python\\sort.py" }
{ "stringlengths": 14, "value": "awesome-python" }
{ "listlengths": 1, "value": [ { "filename": "sort.py", "retrieved_chunk": "#!/usr/bin/env python\n# coding: utf-8\n\n\"\"\"\n The approach taken is explained below. I decided to do it simply.\n Initially I was considering parsing the data into some sort of\n structure and then generating a...
{ "stringclasses": "py", "value": "py" }
{ "int64": 53 }
{ "stringlengths": 646, "value": "#!/usr/bin/env python\n# coding: utf-8\n\n\"\"\"\n The approach taken is explained below. I decided to do it simply.\n Initially I was considering parsing the data into some sort of\n structure and then generating an appropriate README. I am still\n considering doing it...
{ "stringlengths": 504, "value": "\ndef sort_blocks():\n # First, we load the current README into memory\n with open('README.md', 'r') as read_me_file:\n read_me = read_me_file.read()\n\n # Separating the 'table of contents' from the contents (blocks)\n table_of_contents = ''.join(read_me.split('...
{ "stringlengths": 551, "value": " # Sorting the libraries\n inner_blocks = sorted(blocks[0].split('##'))\n for i in range(1, len(inner_blocks)):\n if inner_blocks[i][0] != '#':\n inner_blocks[i] = '##' + inner_blocks[i]\n inner_blocks = ''.join(inner_blocks)\n\n # Replacing the non...
{ "stringlengths": 35, "value": "./temp_repos/awesome-python\\sort.py" }
{ "stringlengths": 14, "value": "awesome-python" }
{ "listlengths": 1, "value": [ { "filename": "sort.py", "retrieved_chunk": "#!/usr/bin/env python\n# coding: utf-8\n\n\"\"\"\n The approach taken is explained below. I decided to do it simply.\n Initially I was considering parsing the data into some sort of\n structure and then generating a...
{ "stringclasses": "py", "value": "py" }
{ "int64": 54 }
{ "stringlengths": 646, "value": "#!/usr/bin/env python\n# coding: utf-8\n\n\"\"\"\n The approach taken is explained below. I decided to do it simply.\n Initially I was considering parsing the data into some sort of\n structure and then generating an appropriate README. I am still\n considering doing it...
{ "stringlengths": 532, "value": "\ndef sort_blocks():\n # First, we load the current README into memory\n with open('README.md', 'r') as read_me_file:\n read_me = read_me_file.read()\n\n # Separating the 'table of contents' from the contents (blocks)\n table_of_contents = ''.join(read_me.split('...
{ "stringlengths": 596, "value": " inner_blocks = sorted(blocks[0].split('##'))\n for i in range(1, len(inner_blocks)):\n if inner_blocks[i][0] != '#':\n inner_blocks[i] = '##' + inner_blocks[i]\n inner_blocks = ''.join(inner_blocks)\n\n # Replacing the non-sorted libraries by the sort...
{ "stringlengths": 35, "value": "./temp_repos/awesome-python\\sort.py" }
{ "stringlengths": 14, "value": "awesome-python" }
{ "listlengths": 1, "value": [ { "filename": "sort.py", "retrieved_chunk": "#!/usr/bin/env python\n# coding: utf-8\n\n\"\"\"\n The approach taken is explained below. I decided to do it simply.\n Initially I was considering parsing the data into some sort of\n structure and then generating a...
{ "stringclasses": "py", "value": "py" }
{ "int64": 55 }
{ "stringlengths": 646, "value": "#!/usr/bin/env python\n# coding: utf-8\n\n\"\"\"\n The approach taken is explained below. I decided to do it simply.\n Initially I was considering parsing the data into some sort of\n structure and then generating an appropriate README. I am still\n considering doing it...
{ "stringlengths": 581, "value": "\ndef sort_blocks():\n # First, we load the current README into memory\n with open('README.md', 'r') as read_me_file:\n read_me = read_me_file.read()\n\n # Separating the 'table of contents' from the contents (blocks)\n table_of_contents = ''.join(read_me.split('...
{ "stringlengths": 596, "value": " for i in range(1, len(inner_blocks)):\n if inner_blocks[i][0] != '#':\n inner_blocks[i] = '##' + inner_blocks[i]\n inner_blocks = ''.join(inner_blocks)\n\n # Replacing the non-sorted libraries by the sorted ones and gathering all at the final_README file...
{ "stringlengths": 35, "value": "./temp_repos/awesome-python\\sort.py" }
{ "stringlengths": 14, "value": "awesome-python" }
{ "listlengths": 1, "value": [ { "filename": "sort.py", "retrieved_chunk": "#!/usr/bin/env python\n# coding: utf-8\n\n\"\"\"\n The approach taken is explained below. I decided to do it simply.\n Initially I was considering parsing the data into some sort of\n structure and then generating a...
{ "stringclasses": "py", "value": "py" }
{ "int64": 56 }
{ "stringlengths": 646, "value": "#!/usr/bin/env python\n# coding: utf-8\n\n\"\"\"\n The approach taken is explained below. I decided to do it simply.\n Initially I was considering parsing the data into some sort of\n structure and then generating an appropriate README. I am still\n considering doing it...
{ "stringlengths": 714, "value": "\ndef sort_blocks():\n # First, we load the current README into memory\n with open('README.md', 'r') as read_me_file:\n read_me = read_me_file.read()\n\n # Separating the 'table of contents' from the contents (blocks)\n table_of_contents = ''.join(read_me.split('...
{ "stringlengths": 558, "value": " inner_blocks = ''.join(inner_blocks)\n\n # Replacing the non-sorted libraries by the sorted ones and gathering all at the final_README file\n blocks[0] = inner_blocks\n final_README = table_of_contents + '- - -' + ''.join(blocks)\n\n with open('README.md', 'w+') as ...
{ "stringlengths": 35, "value": "./temp_repos/awesome-python\\sort.py" }
{ "stringlengths": 14, "value": "awesome-python" }
{ "listlengths": 1, "value": [ { "filename": "sort.py", "retrieved_chunk": "#!/usr/bin/env python\n# coding: utf-8\n\n\"\"\"\n The approach taken is explained below. I decided to do it simply.\n Initially I was considering parsing the data into some sort of\n structure and then generating a...
{ "stringclasses": "py", "value": "py" }
{ "int64": 57 }
{ "stringlengths": 646, "value": "#!/usr/bin/env python\n# coding: utf-8\n\n\"\"\"\n The approach taken is explained below. I decided to do it simply.\n Initially I was considering parsing the data into some sort of\n structure and then generating an appropriate README. I am still\n considering doing it...
{ "stringlengths": 755, "value": "\ndef sort_blocks():\n # First, we load the current README into memory\n with open('README.md', 'r') as read_me_file:\n read_me = read_me_file.read()\n\n # Separating the 'table of contents' from the contents (blocks)\n table_of_contents = ''.join(read_me.split('...
{ "stringlengths": 589, "value": "\n # Replacing the non-sorted libraries by the sorted ones and gathering all at the final_README file\n blocks[0] = inner_blocks\n final_README = table_of_contents + '- - -' + ''.join(blocks)\n\n with open('README.md', 'w+') as sorted_file:\n sorted_file.write(fi...
{ "stringlengths": 35, "value": "./temp_repos/awesome-python\\sort.py" }
{ "stringlengths": 14, "value": "awesome-python" }
{ "listlengths": 1, "value": [ { "filename": "sort.py", "retrieved_chunk": "#!/usr/bin/env python\n# coding: utf-8\n\n\"\"\"\n The approach taken is explained below. I decided to do it simply.\n Initially I was considering parsing the data into some sort of\n structure and then generating a...
{ "stringclasses": "py", "value": "py" }
{ "int64": 58 }
{ "stringlengths": 646, "value": "#!/usr/bin/env python\n# coding: utf-8\n\n\"\"\"\n The approach taken is explained below. I decided to do it simply.\n Initially I was considering parsing the data into some sort of\n structure and then generating an appropriate README. I am still\n considering doing it...
{ "stringlengths": 756, "value": "\ndef sort_blocks():\n # First, we load the current README into memory\n with open('README.md', 'r') as read_me_file:\n read_me = read_me_file.read()\n\n # Separating the 'table of contents' from the contents (blocks)\n table_of_contents = ''.join(read_me.split('...
{ "stringlengths": 667, "value": " # Replacing the non-sorted libraries by the sorted ones and gathering all at the final_README file\n blocks[0] = inner_blocks\n final_README = table_of_contents + '- - -' + ''.join(blocks)\n\n with open('README.md', 'w+') as sorted_file:\n sorted_file.write(fina...
{ "stringlengths": 35, "value": "./temp_repos/awesome-python\\sort.py" }
{ "stringlengths": 14, "value": "awesome-python" }
{ "listlengths": 1, "value": [ { "filename": "sort.py", "retrieved_chunk": "#!/usr/bin/env python\n# coding: utf-8\n\n\"\"\"\n The approach taken is explained below. I decided to do it simply.\n Initially I was considering parsing the data into some sort of\n structure and then generating a...
{ "stringclasses": "py", "value": "py" }
{ "int64": 59 }
{ "stringlengths": 646, "value": "#!/usr/bin/env python\n# coding: utf-8\n\n\"\"\"\n The approach taken is explained below. I decided to do it simply.\n Initially I was considering parsing the data into some sort of\n structure and then generating an appropriate README. I am still\n considering doing it...
{ "stringlengths": 859, "value": "\ndef sort_blocks():\n # First, we load the current README into memory\n with open('README.md', 'r') as read_me_file:\n read_me = read_me_file.read()\n\n # Separating the 'table of contents' from the contents (blocks)\n table_of_contents = ''.join(read_me.split('...
{ "stringlengths": 604, "value": " blocks[0] = inner_blocks\n final_README = table_of_contents + '- - -' + ''.join(blocks)\n\n with open('README.md', 'w+') as sorted_file:\n sorted_file.write(final_README)\n\ndef main():\n # First, we load the current README into memory as an array of lines\n ...
{ "stringlengths": 35, "value": "./temp_repos/awesome-python\\sort.py" }
{ "stringlengths": 14, "value": "awesome-python" }
{ "listlengths": 1, "value": [ { "filename": "sort.py", "retrieved_chunk": "#!/usr/bin/env python\n# coding: utf-8\n\n\"\"\"\n The approach taken is explained below. I decided to do it simply.\n Initially I was considering parsing the data into some sort of\n structure and then generating a...
{ "stringclasses": "py", "value": "py" }
{ "int64": 60 }
{ "stringlengths": 646, "value": "#!/usr/bin/env python\n# coding: utf-8\n\n\"\"\"\n The approach taken is explained below. I decided to do it simply.\n Initially I was considering parsing the data into some sort of\n structure and then generating an appropriate README. I am still\n considering doing it...
{ "stringlengths": 888, "value": "\ndef sort_blocks():\n # First, we load the current README into memory\n with open('README.md', 'r') as read_me_file:\n read_me = read_me_file.read()\n\n # Separating the 'table of contents' from the contents (blocks)\n table_of_contents = ''.join(read_me.split('...
{ "stringlengths": 591, "value": " final_README = table_of_contents + '- - -' + ''.join(blocks)\n\n with open('README.md', 'w+') as sorted_file:\n sorted_file.write(final_README)\n\ndef main():\n # First, we load the current README into memory as an array of lines\n with open('README.md', 'r') as...
{ "stringlengths": 35, "value": "./temp_repos/awesome-python\\sort.py" }
{ "stringlengths": 14, "value": "awesome-python" }
{ "listlengths": 1, "value": [ { "filename": "sort.py", "retrieved_chunk": "#!/usr/bin/env python\n# coding: utf-8\n\n\"\"\"\n The approach taken is explained below. I decided to do it simply.\n Initially I was considering parsing the data into some sort of\n structure and then generating a...
{ "stringclasses": "py", "value": "py" }
{ "int64": 61 }
{ "stringlengths": 646, "value": "#!/usr/bin/env python\n# coding: utf-8\n\n\"\"\"\n The approach taken is explained below. I decided to do it simply.\n Initially I was considering parsing the data into some sort of\n structure and then generating an appropriate README. I am still\n considering doing it...
{ "stringlengths": 953, "value": "\ndef sort_blocks():\n # First, we load the current README into memory\n with open('README.md', 'r') as read_me_file:\n read_me = read_me_file.read()\n\n # Separating the 'table of contents' from the contents (blocks)\n table_of_contents = ''.join(read_me.split('...
{ "stringlengths": 549, "value": "\n with open('README.md', 'w+') as sorted_file:\n sorted_file.write(final_README)\n\ndef main():\n # First, we load the current README into memory as an array of lines\n with open('README.md', 'r') as read_me_file:\n read_me = read_me_file.readlines()\n\n ...
{ "stringlengths": 35, "value": "./temp_repos/awesome-python\\sort.py" }
{ "stringlengths": 14, "value": "awesome-python" }
{ "listlengths": 1, "value": [ { "filename": "sort.py", "retrieved_chunk": "#!/usr/bin/env python\n# coding: utf-8\n\n\"\"\"\n The approach taken is explained below. I decided to do it simply.\n Initially I was considering parsing the data into some sort of\n structure and then generating a...
{ "stringclasses": "py", "value": "py" }
{ "int64": 62 }
{ "stringlengths": 646, "value": "#!/usr/bin/env python\n# coding: utf-8\n\n\"\"\"\n The approach taken is explained below. I decided to do it simply.\n Initially I was considering parsing the data into some sort of\n structure and then generating an appropriate README. I am still\n considering doing it...
{ "stringlengths": 954, "value": "\ndef sort_blocks():\n # First, we load the current README into memory\n with open('README.md', 'r') as read_me_file:\n read_me = read_me_file.read()\n\n # Separating the 'table of contents' from the contents (blocks)\n table_of_contents = ''.join(read_me.split('...
{ "stringlengths": 573, "value": " with open('README.md', 'w+') as sorted_file:\n sorted_file.write(final_README)\n\ndef main():\n # First, we load the current README into memory as an array of lines\n with open('README.md', 'r') as read_me_file:\n read_me = read_me_file.readlines()\n\n # ...
{ "stringlengths": 35, "value": "./temp_repos/awesome-python\\sort.py" }
{ "stringlengths": 14, "value": "awesome-python" }
{ "listlengths": 1, "value": [ { "filename": "sort.py", "retrieved_chunk": "#!/usr/bin/env python\n# coding: utf-8\n\n\"\"\"\n The approach taken is explained below. I decided to do it simply.\n Initially I was considering parsing the data into some sort of\n structure and then generating a...
{ "stringclasses": "py", "value": "py" }
{ "int64": 63 }
{ "stringlengths": 646, "value": "#!/usr/bin/env python\n# coding: utf-8\n\n\"\"\"\n The approach taken is explained below. I decided to do it simply.\n Initially I was considering parsing the data into some sort of\n structure and then generating an appropriate README. I am still\n considering doing it...
{ "stringlengths": 1043, "value": "\ndef sort_blocks():\n # First, we load the current README into memory\n with open('README.md', 'r') as read_me_file:\n read_me = read_me_file.read()\n\n # Separating the 'table of contents' from the contents (blocks)\n table_of_contents = ''.join(read_me.split(...
{ "stringlengths": 556, "value": "\ndef main():\n # First, we load the current README into memory as an array of lines\n with open('README.md', 'r') as read_me_file:\n read_me = read_me_file.readlines()\n\n # Then we cluster the lines together as blocks\n # Each block represents a collection of l...
{ "stringlengths": 35, "value": "./temp_repos/awesome-python\\sort.py" }
{ "stringlengths": 14, "value": "awesome-python" }
{ "listlengths": 1, "value": [ { "filename": "sort.py", "retrieved_chunk": "#!/usr/bin/env python\n# coding: utf-8\n\n\"\"\"\n The approach taken is explained below. I decided to do it simply.\n Initially I was considering parsing the data into some sort of\n structure and then generating a...
{ "stringclasses": "py", "value": "py" }
{ "int64": 64 }
{ "stringlengths": 625, "value": "# coding: utf-8\n\n\"\"\"\n The approach taken is explained below. I decided to do it simply.\n Initially I was considering parsing the data into some sort of\n structure and then generating an appropriate README. I am still\n considering doing it - but for now this sho...
{ "stringlengths": 157, "value": "def sort_blocks():\n # First, we load the current README into memory\n with open('README.md', 'r') as read_me_file:\n read_me = read_me_file.read()" }
{ "stringlengths": 555, "value": "\n # Separating the 'table of contents' from the contents (blocks)\n table_of_contents = ''.join(read_me.split('- - -')[0])\n blocks = ''.join(read_me.split('- - -')[1]).split('\\n# ')\n for i in range(len(blocks)):\n if i == 0:\n blocks[i] = blocks[i]...
{ "stringlengths": 35, "value": "./temp_repos/awesome-python\\sort.py" }
{ "stringlengths": 14, "value": "awesome-python" }
{ "listlengths": 1, "value": [ { "filename": "sort.py", "retrieved_chunk": "#!/usr/bin/env python\n# coding: utf-8\n\n\"\"\"\n The approach taken is explained below. I decided to do it simply.\n Initially I was considering parsing the data into some sort of\n structure and then generating a...
{ "stringclasses": "py", "value": "py" }
{ "int64": 66 }
{ "stringlengths": 625, "value": "# coding: utf-8\n\n\"\"\"\n The approach taken is explained below. I decided to do it simply.\n Initially I was considering parsing the data into some sort of\n structure and then generating an appropriate README. I am still\n considering doing it - but for now this sho...
{ "stringlengths": 158, "value": "def sort_blocks():\n # First, we load the current README into memory\n with open('README.md', 'r') as read_me_file:\n read_me = read_me_file.read()\n" }
{ "stringlengths": 595, "value": " # Separating the 'table of contents' from the contents (blocks)\n table_of_contents = ''.join(read_me.split('- - -')[0])\n blocks = ''.join(read_me.split('- - -')[1]).split('\\n# ')\n for i in range(len(blocks)):\n if i == 0:\n blocks[i] = blocks[i] +...
{ "stringlengths": 35, "value": "./temp_repos/awesome-python\\sort.py" }
{ "stringlengths": 14, "value": "awesome-python" }
{ "listlengths": 1, "value": [ { "filename": "sort.py", "retrieved_chunk": "#!/usr/bin/env python\n# coding: utf-8\n\n\"\"\"\n The approach taken is explained below. I decided to do it simply.\n Initially I was considering parsing the data into some sort of\n structure and then generating a...
{ "stringclasses": "py", "value": "py" }
{ "int64": 67 }
{ "stringlengths": 625, "value": "# coding: utf-8\n\n\"\"\"\n The approach taken is explained below. I decided to do it simply.\n Initially I was considering parsing the data into some sort of\n structure and then generating an appropriate README. I am still\n considering doing it - but for now this sho...
{ "stringlengths": 226, "value": "def sort_blocks():\n # First, we load the current README into memory\n with open('README.md', 'r') as read_me_file:\n read_me = read_me_file.read()\n\n # Separating the 'table of contents' from the contents (blocks)" }
{ "stringlengths": 528, "value": " table_of_contents = ''.join(read_me.split('- - -')[0])\n blocks = ''.join(read_me.split('- - -')[1]).split('\\n# ')\n for i in range(len(blocks)):\n if i == 0:\n blocks[i] = blocks[i] + '\\n'\n else:\n blocks[i] = '# ' + blocks[i] + '\\...
{ "stringlengths": 35, "value": "./temp_repos/awesome-python\\sort.py" }
{ "stringlengths": 14, "value": "awesome-python" }
{ "listlengths": 1, "value": [ { "filename": "sort.py", "retrieved_chunk": "#!/usr/bin/env python\n# coding: utf-8\n\n\"\"\"\n The approach taken is explained below. I decided to do it simply.\n Initially I was considering parsing the data into some sort of\n structure and then generating a...
{ "stringclasses": "py", "value": "py" }
{ "int64": 68 }
{ "stringlengths": 625, "value": "# coding: utf-8\n\n\"\"\"\n The approach taken is explained below. I decided to do it simply.\n Initially I was considering parsing the data into some sort of\n structure and then generating an appropriate README. I am still\n considering doing it - but for now this sho...
{ "stringlengths": 285, "value": "def sort_blocks():\n # First, we load the current README into memory\n with open('README.md', 'r') as read_me_file:\n read_me = read_me_file.read()\n\n # Separating the 'table of contents' from the contents (blocks)\n table_of_contents = ''.join(read_me.split('- ...
{ "stringlengths": 572, "value": " blocks = ''.join(read_me.split('- - -')[1]).split('\\n# ')\n for i in range(len(blocks)):\n if i == 0:\n blocks[i] = blocks[i] + '\\n'\n else:\n blocks[i] = '# ' + blocks[i] + '\\n'\n\n # Sorting the libraries\n inner_blocks = sorted...
{ "stringlengths": 35, "value": "./temp_repos/awesome-python\\sort.py" }
{ "stringlengths": 14, "value": "awesome-python" }
{ "listlengths": 1, "value": [ { "filename": "sort.py", "retrieved_chunk": "#!/usr/bin/env python\n# coding: utf-8\n\n\"\"\"\n The approach taken is explained below. I decided to do it simply.\n Initially I was considering parsing the data into some sort of\n structure and then generating a...
{ "stringclasses": "py", "value": "py" }
{ "int64": 69 }
{ "stringlengths": 625, "value": "# coding: utf-8\n\n\"\"\"\n The approach taken is explained below. I decided to do it simply.\n Initially I was considering parsing the data into some sort of\n structure and then generating an appropriate README. I am still\n considering doing it - but for now this sho...
{ "stringlengths": 347, "value": "def sort_blocks():\n # First, we load the current README into memory\n with open('README.md', 'r') as read_me_file:\n read_me = read_me_file.read()\n\n # Separating the 'table of contents' from the contents (blocks)\n table_of_contents = ''.join(read_me.split('- ...
{ "stringlengths": 539, "value": " for i in range(len(blocks)):\n if i == 0:\n blocks[i] = blocks[i] + '\\n'\n else:\n blocks[i] = '# ' + blocks[i] + '\\n'\n\n # Sorting the libraries\n inner_blocks = sorted(blocks[0].split('##'))\n for i in range(1, len(inner_blocks)...
{ "stringlengths": 35, "value": "./temp_repos/awesome-python\\sort.py" }
{ "stringlengths": 14, "value": "awesome-python" }
{ "listlengths": 1, "value": [ { "filename": "sort.py", "retrieved_chunk": "#!/usr/bin/env python\n# coding: utf-8\n\n\"\"\"\n The approach taken is explained below. I decided to do it simply.\n Initially I was considering parsing the data into some sort of\n structure and then generating a...
{ "stringclasses": "py", "value": "py" }
{ "int64": 70 }
{ "stringlengths": 625, "value": "# coding: utf-8\n\n\"\"\"\n The approach taken is explained below. I decided to do it simply.\n Initially I was considering parsing the data into some sort of\n structure and then generating an appropriate README. I am still\n considering doing it - but for now this sho...
{ "stringlengths": 440, "value": "def sort_blocks():\n # First, we load the current README into memory\n with open('README.md', 'r') as read_me_file:\n read_me = read_me_file.read()\n\n # Separating the 'table of contents' from the contents (blocks)\n table_of_contents = ''.join(read_me.split('- ...
{ "stringlengths": 561, "value": " else:\n blocks[i] = '# ' + blocks[i] + '\\n'\n\n # Sorting the libraries\n inner_blocks = sorted(blocks[0].split('##'))\n for i in range(1, len(inner_blocks)):\n if inner_blocks[i][0] != '#':\n inner_blocks[i] = '##' + inner_blocks[i]\n...
{ "stringlengths": 35, "value": "./temp_repos/awesome-python\\sort.py" }
{ "stringlengths": 14, "value": "awesome-python" }
{ "listlengths": 1, "value": [ { "filename": "sort.py", "retrieved_chunk": "#!/usr/bin/env python\n# coding: utf-8\n\n\"\"\"\n The approach taken is explained below. I decided to do it simply.\n Initially I was considering parsing the data into some sort of\n structure and then generating a...
{ "stringclasses": "py", "value": "py" }
{ "int64": 71 }
{ "stringlengths": 625, "value": "# coding: utf-8\n\n\"\"\"\n The approach taken is explained below. I decided to do it simply.\n Initially I was considering parsing the data into some sort of\n structure and then generating an appropriate README. I am still\n considering doing it - but for now this sho...
{ "stringlengths": 502, "value": "def sort_blocks():\n # First, we load the current README into memory\n with open('README.md', 'r') as read_me_file:\n read_me = read_me_file.read()\n\n # Separating the 'table of contents' from the contents (blocks)\n table_of_contents = ''.join(read_me.split('- ...
{ "stringlengths": 540, "value": "\n # Sorting the libraries\n inner_blocks = sorted(blocks[0].split('##'))\n for i in range(1, len(inner_blocks)):\n if inner_blocks[i][0] != '#':\n inner_blocks[i] = '##' + inner_blocks[i]\n inner_blocks = ''.join(inner_blocks)\n\n # Replacing the n...
{ "stringlengths": 35, "value": "./temp_repos/awesome-python\\sort.py" }
{ "stringlengths": 14, "value": "awesome-python" }
{ "listlengths": 1, "value": [ { "filename": "sort.py", "retrieved_chunk": "#!/usr/bin/env python\n# coding: utf-8\n\n\"\"\"\n The approach taken is explained below. I decided to do it simply.\n Initially I was considering parsing the data into some sort of\n structure and then generating a...
{ "stringclasses": "py", "value": "py" }
{ "int64": 72 }
{ "stringlengths": 625, "value": "# coding: utf-8\n\n\"\"\"\n The approach taken is explained below. I decided to do it simply.\n Initially I was considering parsing the data into some sort of\n structure and then generating an appropriate README. I am still\n considering doing it - but for now this sho...
{ "stringlengths": 503, "value": "def sort_blocks():\n # First, we load the current README into memory\n with open('README.md', 'r') as read_me_file:\n read_me = read_me_file.read()\n\n # Separating the 'table of contents' from the contents (blocks)\n table_of_contents = ''.join(read_me.split('- ...
{ "stringlengths": 551, "value": " # Sorting the libraries\n inner_blocks = sorted(blocks[0].split('##'))\n for i in range(1, len(inner_blocks)):\n if inner_blocks[i][0] != '#':\n inner_blocks[i] = '##' + inner_blocks[i]\n inner_blocks = ''.join(inner_blocks)\n\n # Replacing the non...
{ "stringlengths": 35, "value": "./temp_repos/awesome-python\\sort.py" }
{ "stringlengths": 14, "value": "awesome-python" }
{ "listlengths": 1, "value": [ { "filename": "sort.py", "retrieved_chunk": "#!/usr/bin/env python\n# coding: utf-8\n\n\"\"\"\n The approach taken is explained below. I decided to do it simply.\n Initially I was considering parsing the data into some sort of\n structure and then generating a...
{ "stringclasses": "py", "value": "py" }
{ "int64": 73 }
{ "stringlengths": 625, "value": "# coding: utf-8\n\n\"\"\"\n The approach taken is explained below. I decided to do it simply.\n Initially I was considering parsing the data into some sort of\n structure and then generating an appropriate README. I am still\n considering doing it - but for now this sho...
{ "stringlengths": 531, "value": "def sort_blocks():\n # First, we load the current README into memory\n with open('README.md', 'r') as read_me_file:\n read_me = read_me_file.read()\n\n # Separating the 'table of contents' from the contents (blocks)\n table_of_contents = ''.join(read_me.split('- ...
{ "stringlengths": 596, "value": " inner_blocks = sorted(blocks[0].split('##'))\n for i in range(1, len(inner_blocks)):\n if inner_blocks[i][0] != '#':\n inner_blocks[i] = '##' + inner_blocks[i]\n inner_blocks = ''.join(inner_blocks)\n\n # Replacing the non-sorted libraries by the sort...
{ "stringlengths": 35, "value": "./temp_repos/awesome-python\\sort.py" }
{ "stringlengths": 14, "value": "awesome-python" }
{ "listlengths": 1, "value": [ { "filename": "sort.py", "retrieved_chunk": "#!/usr/bin/env python\n# coding: utf-8\n\n\"\"\"\n The approach taken is explained below. I decided to do it simply.\n Initially I was considering parsing the data into some sort of\n structure and then generating a...
{ "stringclasses": "py", "value": "py" }
{ "int64": 74 }
{ "stringlengths": 625, "value": "# coding: utf-8\n\n\"\"\"\n The approach taken is explained below. I decided to do it simply.\n Initially I was considering parsing the data into some sort of\n structure and then generating an appropriate README. I am still\n considering doing it - but for now this sho...
{ "stringlengths": 580, "value": "def sort_blocks():\n # First, we load the current README into memory\n with open('README.md', 'r') as read_me_file:\n read_me = read_me_file.read()\n\n # Separating the 'table of contents' from the contents (blocks)\n table_of_contents = ''.join(read_me.split('- ...
{ "stringlengths": 596, "value": " for i in range(1, len(inner_blocks)):\n if inner_blocks[i][0] != '#':\n inner_blocks[i] = '##' + inner_blocks[i]\n inner_blocks = ''.join(inner_blocks)\n\n # Replacing the non-sorted libraries by the sorted ones and gathering all at the final_README file...
{ "stringlengths": 35, "value": "./temp_repos/awesome-python\\sort.py" }
{ "stringlengths": 14, "value": "awesome-python" }
{ "listlengths": 1, "value": [ { "filename": "sort.py", "retrieved_chunk": "#!/usr/bin/env python\n# coding: utf-8\n\n\"\"\"\n The approach taken is explained below. I decided to do it simply.\n Initially I was considering parsing the data into some sort of\n structure and then generating a...
{ "stringclasses": "py", "value": "py" }
{ "int64": 75 }
{ "stringlengths": 625, "value": "# coding: utf-8\n\n\"\"\"\n The approach taken is explained below. I decided to do it simply.\n Initially I was considering parsing the data into some sort of\n structure and then generating an appropriate README. I am still\n considering doing it - but for now this sho...
{ "stringlengths": 713, "value": "def sort_blocks():\n # First, we load the current README into memory\n with open('README.md', 'r') as read_me_file:\n read_me = read_me_file.read()\n\n # Separating the 'table of contents' from the contents (blocks)\n table_of_contents = ''.join(read_me.split('- ...
{ "stringlengths": 558, "value": " inner_blocks = ''.join(inner_blocks)\n\n # Replacing the non-sorted libraries by the sorted ones and gathering all at the final_README file\n blocks[0] = inner_blocks\n final_README = table_of_contents + '- - -' + ''.join(blocks)\n\n with open('README.md', 'w+') as ...
{ "stringlengths": 35, "value": "./temp_repos/awesome-python\\sort.py" }
{ "stringlengths": 14, "value": "awesome-python" }
{ "listlengths": 1, "value": [ { "filename": "sort.py", "retrieved_chunk": "#!/usr/bin/env python\n# coding: utf-8\n\n\"\"\"\n The approach taken is explained below. I decided to do it simply.\n Initially I was considering parsing the data into some sort of\n structure and then generating a...
{ "stringclasses": "py", "value": "py" }
{ "int64": 76 }
{ "stringlengths": 625, "value": "# coding: utf-8\n\n\"\"\"\n The approach taken is explained below. I decided to do it simply.\n Initially I was considering parsing the data into some sort of\n structure and then generating an appropriate README. I am still\n considering doing it - but for now this sho...
{ "stringlengths": 754, "value": "def sort_blocks():\n # First, we load the current README into memory\n with open('README.md', 'r') as read_me_file:\n read_me = read_me_file.read()\n\n # Separating the 'table of contents' from the contents (blocks)\n table_of_contents = ''.join(read_me.split('- ...
{ "stringlengths": 589, "value": "\n # Replacing the non-sorted libraries by the sorted ones and gathering all at the final_README file\n blocks[0] = inner_blocks\n final_README = table_of_contents + '- - -' + ''.join(blocks)\n\n with open('README.md', 'w+') as sorted_file:\n sorted_file.write(fi...
{ "stringlengths": 35, "value": "./temp_repos/awesome-python\\sort.py" }
{ "stringlengths": 14, "value": "awesome-python" }
{ "listlengths": 1, "value": [ { "filename": "sort.py", "retrieved_chunk": "#!/usr/bin/env python\n# coding: utf-8\n\n\"\"\"\n The approach taken is explained below. I decided to do it simply.\n Initially I was considering parsing the data into some sort of\n structure and then generating a...
{ "stringclasses": "py", "value": "py" }
{ "int64": 77 }
{ "stringlengths": 625, "value": "# coding: utf-8\n\n\"\"\"\n The approach taken is explained below. I decided to do it simply.\n Initially I was considering parsing the data into some sort of\n structure and then generating an appropriate README. I am still\n considering doing it - but for now this sho...
{ "stringlengths": 755, "value": "def sort_blocks():\n # First, we load the current README into memory\n with open('README.md', 'r') as read_me_file:\n read_me = read_me_file.read()\n\n # Separating the 'table of contents' from the contents (blocks)\n table_of_contents = ''.join(read_me.split('- ...
{ "stringlengths": 667, "value": " # Replacing the non-sorted libraries by the sorted ones and gathering all at the final_README file\n blocks[0] = inner_blocks\n final_README = table_of_contents + '- - -' + ''.join(blocks)\n\n with open('README.md', 'w+') as sorted_file:\n sorted_file.write(fina...
{ "stringlengths": 35, "value": "./temp_repos/awesome-python\\sort.py" }
{ "stringlengths": 14, "value": "awesome-python" }
{ "listlengths": 1, "value": [ { "filename": "sort.py", "retrieved_chunk": "#!/usr/bin/env python\n# coding: utf-8\n\n\"\"\"\n The approach taken is explained below. I decided to do it simply.\n Initially I was considering parsing the data into some sort of\n structure and then generating a...
{ "stringclasses": "py", "value": "py" }
{ "int64": 78 }
{ "stringlengths": 625, "value": "# coding: utf-8\n\n\"\"\"\n The approach taken is explained below. I decided to do it simply.\n Initially I was considering parsing the data into some sort of\n structure and then generating an appropriate README. I am still\n considering doing it - but for now this sho...
{ "stringlengths": 858, "value": "def sort_blocks():\n # First, we load the current README into memory\n with open('README.md', 'r') as read_me_file:\n read_me = read_me_file.read()\n\n # Separating the 'table of contents' from the contents (blocks)\n table_of_contents = ''.join(read_me.split('- ...
{ "stringlengths": 604, "value": " blocks[0] = inner_blocks\n final_README = table_of_contents + '- - -' + ''.join(blocks)\n\n with open('README.md', 'w+') as sorted_file:\n sorted_file.write(final_README)\n\ndef main():\n # First, we load the current README into memory as an array of lines\n ...
{ "stringlengths": 35, "value": "./temp_repos/awesome-python\\sort.py" }
{ "stringlengths": 14, "value": "awesome-python" }
{ "listlengths": 1, "value": [ { "filename": "sort.py", "retrieved_chunk": "#!/usr/bin/env python\n# coding: utf-8\n\n\"\"\"\n The approach taken is explained below. I decided to do it simply.\n Initially I was considering parsing the data into some sort of\n structure and then generating a...
{ "stringclasses": "py", "value": "py" }
{ "int64": 79 }
{ "stringlengths": 625, "value": "# coding: utf-8\n\n\"\"\"\n The approach taken is explained below. I decided to do it simply.\n Initially I was considering parsing the data into some sort of\n structure and then generating an appropriate README. I am still\n considering doing it - but for now this sho...
{ "stringlengths": 887, "value": "def sort_blocks():\n # First, we load the current README into memory\n with open('README.md', 'r') as read_me_file:\n read_me = read_me_file.read()\n\n # Separating the 'table of contents' from the contents (blocks)\n table_of_contents = ''.join(read_me.split('- ...
{ "stringlengths": 591, "value": " final_README = table_of_contents + '- - -' + ''.join(blocks)\n\n with open('README.md', 'w+') as sorted_file:\n sorted_file.write(final_README)\n\ndef main():\n # First, we load the current README into memory as an array of lines\n with open('README.md', 'r') as...
{ "stringlengths": 35, "value": "./temp_repos/awesome-python\\sort.py" }
{ "stringlengths": 14, "value": "awesome-python" }
{ "listlengths": 1, "value": [ { "filename": "sort.py", "retrieved_chunk": "#!/usr/bin/env python\n# coding: utf-8\n\n\"\"\"\n The approach taken is explained below. I decided to do it simply.\n Initially I was considering parsing the data into some sort of\n structure and then generating a...
{ "stringclasses": "py", "value": "py" }
{ "int64": 80 }
{ "stringlengths": 625, "value": "# coding: utf-8\n\n\"\"\"\n The approach taken is explained below. I decided to do it simply.\n Initially I was considering parsing the data into some sort of\n structure and then generating an appropriate README. I am still\n considering doing it - but for now this sho...
{ "stringlengths": 952, "value": "def sort_blocks():\n # First, we load the current README into memory\n with open('README.md', 'r') as read_me_file:\n read_me = read_me_file.read()\n\n # Separating the 'table of contents' from the contents (blocks)\n table_of_contents = ''.join(read_me.split('- ...
{ "stringlengths": 549, "value": "\n with open('README.md', 'w+') as sorted_file:\n sorted_file.write(final_README)\n\ndef main():\n # First, we load the current README into memory as an array of lines\n with open('README.md', 'r') as read_me_file:\n read_me = read_me_file.readlines()\n\n ...
{ "stringlengths": 35, "value": "./temp_repos/awesome-python\\sort.py" }
{ "stringlengths": 14, "value": "awesome-python" }
{ "listlengths": 1, "value": [ { "filename": "sort.py", "retrieved_chunk": "#!/usr/bin/env python\n# coding: utf-8\n\n\"\"\"\n The approach taken is explained below. I decided to do it simply.\n Initially I was considering parsing the data into some sort of\n structure and then generating a...
{ "stringclasses": "py", "value": "py" }
{ "int64": 81 }
{ "stringlengths": 625, "value": "# coding: utf-8\n\n\"\"\"\n The approach taken is explained below. I decided to do it simply.\n Initially I was considering parsing the data into some sort of\n structure and then generating an appropriate README. I am still\n considering doing it - but for now this sho...
{ "stringlengths": 953, "value": "def sort_blocks():\n # First, we load the current README into memory\n with open('README.md', 'r') as read_me_file:\n read_me = read_me_file.read()\n\n # Separating the 'table of contents' from the contents (blocks)\n table_of_contents = ''.join(read_me.split('- ...
{ "stringlengths": 573, "value": " with open('README.md', 'w+') as sorted_file:\n sorted_file.write(final_README)\n\ndef main():\n # First, we load the current README into memory as an array of lines\n with open('README.md', 'r') as read_me_file:\n read_me = read_me_file.readlines()\n\n # ...
{ "stringlengths": 35, "value": "./temp_repos/awesome-python\\sort.py" }
{ "stringlengths": 14, "value": "awesome-python" }
{ "listlengths": 1, "value": [ { "filename": "sort.py", "retrieved_chunk": "#!/usr/bin/env python\n# coding: utf-8\n\n\"\"\"\n The approach taken is explained below. I decided to do it simply.\n Initially I was considering parsing the data into some sort of\n structure and then generating a...
{ "stringclasses": "py", "value": "py" }
{ "int64": 82 }
{ "stringlengths": 625, "value": "# coding: utf-8\n\n\"\"\"\n The approach taken is explained below. I decided to do it simply.\n Initially I was considering parsing the data into some sort of\n structure and then generating an appropriate README. I am still\n considering doing it - but for now this sho...
{ "stringlengths": 1042, "value": "def sort_blocks():\n # First, we load the current README into memory\n with open('README.md', 'r') as read_me_file:\n read_me = read_me_file.read()\n\n # Separating the 'table of contents' from the contents (blocks)\n table_of_contents = ''.join(read_me.split('-...
{ "stringlengths": 556, "value": "\ndef main():\n # First, we load the current README into memory as an array of lines\n with open('README.md', 'r') as read_me_file:\n read_me = read_me_file.readlines()\n\n # Then we cluster the lines together as blocks\n # Each block represents a collection of l...
{ "stringlengths": 35, "value": "./temp_repos/awesome-python\\sort.py" }
{ "stringlengths": 14, "value": "awesome-python" }
{ "listlengths": 1, "value": [ { "filename": "sort.py", "retrieved_chunk": "#!/usr/bin/env python\n# coding: utf-8\n\n\"\"\"\n The approach taken is explained below. I decided to do it simply.\n Initially I was considering parsing the data into some sort of\n structure and then generating a...
{ "stringclasses": "py", "value": "py" }
{ "int64": 83 }
{ "stringlengths": 692, "value": " Initially I was considering parsing the data into some sort of\n structure and then generating an appropriate README. I am still\n considering doing it - but for now this should work. The only issue\n I see is that it only sorts the entries at the lowest level, and tha...
{ "stringlengths": 68, "value": "\n # Separating the 'table of contents' from the contents (blocks)" }
{ "stringlengths": 528, "value": " table_of_contents = ''.join(read_me.split('- - -')[0])\n blocks = ''.join(read_me.split('- - -')[1]).split('\\n# ')\n for i in range(len(blocks)):\n if i == 0:\n blocks[i] = blocks[i] + '\\n'\n else:\n blocks[i] = '# ' + blocks[i] + '\\...
{ "stringlengths": 35, "value": "./temp_repos/awesome-python\\sort.py" }
{ "stringlengths": 14, "value": "awesome-python" }
{ "listlengths": 1, "value": [ { "filename": "sort.py", "retrieved_chunk": "#!/usr/bin/env python\n# coding: utf-8\n\n\"\"\"\n The approach taken is explained below. I decided to do it simply.\n Initially I was considering parsing the data into some sort of\n structure and then generating a...
{ "stringclasses": "py", "value": "py" }
{ "int64": 86 }
{ "stringlengths": 626, "value": " structure and then generating an appropriate README. I am still\n considering doing it - but for now this should work. The only issue\n I see is that it only sorts the entries at the lowest level, and that\n the order of the top-level contents do not match the order of...
{ "stringlengths": 67, "value": " # Separating the 'table of contents' from the contents (blocks)" }
{ "stringlengths": 528, "value": " table_of_contents = ''.join(read_me.split('- - -')[0])\n blocks = ''.join(read_me.split('- - -')[1]).split('\\n# ')\n for i in range(len(blocks)):\n if i == 0:\n blocks[i] = blocks[i] + '\\n'\n else:\n blocks[i] = '# ' + blocks[i] + '\\...
{ "stringlengths": 35, "value": "./temp_repos/awesome-python\\sort.py" }
{ "stringlengths": 14, "value": "awesome-python" }
{ "listlengths": 1, "value": [ { "filename": "sort.py", "retrieved_chunk": "#!/usr/bin/env python\n# coding: utf-8\n\n\"\"\"\n The approach taken is explained below. I decided to do it simply.\n Initially I was considering parsing the data into some sort of\n structure and then generating a...
{ "stringclasses": "py", "value": "py" }
{ "int64": 87 }
{ "stringlengths": 595, "value": " # Separating the 'table of contents' from the contents (blocks)\n table_of_contents = ''.join(read_me.split('- - -')[0])\n blocks = ''.join(read_me.split('- - -')[1]).split('\\n# ')\n for i in range(len(blocks)):\n if i == 0:\n blocks[i] = blocks[i] +...
{ "stringlengths": 103, "value": "\n # Replacing the non-sorted libraries by the sorted ones and gathering all at the final_README file" }
{ "stringlengths": 604, "value": " blocks[0] = inner_blocks\n final_README = table_of_contents + '- - -' + ''.join(blocks)\n\n with open('README.md', 'w+') as sorted_file:\n sorted_file.write(final_README)\n\ndef main():\n # First, we load the current README into memory as an array of lines\n ...
{ "stringlengths": 35, "value": "./temp_repos/awesome-python\\sort.py" }
{ "stringlengths": 14, "value": "awesome-python" }
{ "listlengths": 1, "value": [ { "filename": "sort.py", "retrieved_chunk": "#!/usr/bin/env python\n# coding: utf-8\n\n\"\"\"\n The approach taken is explained below. I decided to do it simply.\n Initially I was considering parsing the data into some sort of\n structure and then generating a...
{ "stringclasses": "py", "value": "py" }
{ "int64": 90 }
{ "stringlengths": 528, "value": " table_of_contents = ''.join(read_me.split('- - -')[0])\n blocks = ''.join(read_me.split('- - -')[1]).split('\\n# ')\n for i in range(len(blocks)):\n if i == 0:\n blocks[i] = blocks[i] + '\\n'\n else:\n blocks[i] = '# ' + blocks[i] + '\\...
{ "stringlengths": 102, "value": " # Replacing the non-sorted libraries by the sorted ones and gathering all at the final_README file" }
{ "stringlengths": 604, "value": " blocks[0] = inner_blocks\n final_README = table_of_contents + '- - -' + ''.join(blocks)\n\n with open('README.md', 'w+') as sorted_file:\n sorted_file.write(final_README)\n\ndef main():\n # First, we load the current README into memory as an array of lines\n ...
{ "stringlengths": 35, "value": "./temp_repos/awesome-python\\sort.py" }
{ "stringlengths": 14, "value": "awesome-python" }
{ "listlengths": 1, "value": [ { "filename": "sort.py", "retrieved_chunk": "#!/usr/bin/env python\n# coding: utf-8\n\n\"\"\"\n The approach taken is explained below. I decided to do it simply.\n Initially I was considering parsing the data into some sort of\n structure and then generating a...
{ "stringclasses": "py", "value": "py" }
{ "int64": 91 }
{ "stringlengths": 587, "value": " blocks[i] = '# ' + blocks[i] + '\\n'\n\n # Sorting the libraries\n inner_blocks = sorted(blocks[0].split('##'))\n for i in range(1, len(inner_blocks)):\n if inner_blocks[i][0] != '#':\n inner_blocks[i] = '##' + inner_blocks[i]\n inner_block...
{ "stringlengths": 177, "value": "\ndef main():\n # First, we load the current README into memory as an array of lines\n with open('README.md', 'r') as read_me_file:\n read_me = read_me_file.readlines()" }
{ "stringlengths": 539, "value": "\n # Then we cluster the lines together as blocks\n # Each block represents a collection of lines that should be sorted\n # This was done by assuming only links ([...](...)) are meant to be sorted\n # Clustering is done by indentation\n blocks = []\n last_indent =...
{ "stringlengths": 35, "value": "./temp_repos/awesome-python\\sort.py" }
{ "stringlengths": 14, "value": "awesome-python" }
{ "listlengths": 1, "value": [ { "filename": "sort.py", "retrieved_chunk": "#!/usr/bin/env python\n# coding: utf-8\n\n\"\"\"\n The approach taken is explained below. I decided to do it simply.\n Initially I was considering parsing the data into some sort of\n structure and then generating a...
{ "stringclasses": "py", "value": "py" }
{ "int64": 92 }
{ "stringlengths": 587, "value": " blocks[i] = '# ' + blocks[i] + '\\n'\n\n # Sorting the libraries\n inner_blocks = sorted(blocks[0].split('##'))\n for i in range(1, len(inner_blocks)):\n if inner_blocks[i][0] != '#':\n inner_blocks[i] = '##' + inner_blocks[i]\n inner_block...
{ "stringlengths": 178, "value": "\ndef main():\n # First, we load the current README into memory as an array of lines\n with open('README.md', 'r') as read_me_file:\n read_me = read_me_file.readlines()\n" }
{ "stringlengths": 576, "value": " # Then we cluster the lines together as blocks\n # Each block represents a collection of lines that should be sorted\n # This was done by assuming only links ([...](...)) are meant to be sorted\n # Clustering is done by indentation\n blocks = []\n last_indent = N...
{ "stringlengths": 35, "value": "./temp_repos/awesome-python\\sort.py" }
{ "stringlengths": 14, "value": "awesome-python" }
{ "listlengths": 1, "value": [ { "filename": "sort.py", "retrieved_chunk": "#!/usr/bin/env python\n# coding: utf-8\n\n\"\"\"\n The approach taken is explained below. I decided to do it simply.\n Initially I was considering parsing the data into some sort of\n structure and then generating a...
{ "stringclasses": "py", "value": "py" }
{ "int64": 93 }
{ "stringlengths": 587, "value": " blocks[i] = '# ' + blocks[i] + '\\n'\n\n # Sorting the libraries\n inner_blocks = sorted(blocks[0].split('##'))\n for i in range(1, len(inner_blocks)):\n if inner_blocks[i][0] != '#':\n inner_blocks[i] = '##' + inner_blocks[i]\n inner_block...
{ "stringlengths": 229, "value": "\ndef main():\n # First, we load the current README into memory as an array of lines\n with open('README.md', 'r') as read_me_file:\n read_me = read_me_file.readlines()\n\n # Then we cluster the lines together as blocks" }
{ "stringlengths": 558, "value": " # Each block represents a collection of lines that should be sorted\n # This was done by assuming only links ([...](...)) are meant to be sorted\n # Clustering is done by indentation\n blocks = []\n last_indent = None\n for line in read_me:\n s_line = line...
{ "stringlengths": 35, "value": "./temp_repos/awesome-python\\sort.py" }
{ "stringlengths": 14, "value": "awesome-python" }
{ "listlengths": 1, "value": [ { "filename": "sort.py", "retrieved_chunk": "#!/usr/bin/env python\n# coding: utf-8\n\n\"\"\"\n The approach taken is explained below. I decided to do it simply.\n Initially I was considering parsing the data into some sort of\n structure and then generating a...
{ "stringclasses": "py", "value": "py" }
{ "int64": 94 }
{ "stringlengths": 587, "value": " blocks[i] = '# ' + blocks[i] + '\\n'\n\n # Sorting the libraries\n inner_blocks = sorted(blocks[0].split('##'))\n for i in range(1, len(inner_blocks)):\n if inner_blocks[i][0] != '#':\n inner_blocks[i] = '##' + inner_blocks[i]\n inner_block...
{ "stringlengths": 301, "value": "\ndef main():\n # First, we load the current README into memory as an array of lines\n with open('README.md', 'r') as read_me_file:\n read_me = read_me_file.readlines()\n\n # Then we cluster the lines together as blocks\n # Each block represents a collection of l...
{ "stringlengths": 500, "value": " # This was done by assuming only links ([...](...)) are meant to be sorted\n # Clustering is done by indentation\n blocks = []\n last_indent = None\n for line in read_me:\n s_line = line.lstrip()\n indent = len(line) - len(s_line)\n\n if any([s_...
{ "stringlengths": 35, "value": "./temp_repos/awesome-python\\sort.py" }
{ "stringlengths": 14, "value": "awesome-python" }
{ "listlengths": 1, "value": [ { "filename": "sort.py", "retrieved_chunk": "#!/usr/bin/env python\n# coding: utf-8\n\n\"\"\"\n The approach taken is explained below. I decided to do it simply.\n Initially I was considering parsing the data into some sort of\n structure and then generating a...
{ "stringclasses": "py", "value": "py" }
{ "int64": 95 }
{ "stringlengths": 587, "value": " blocks[i] = '# ' + blocks[i] + '\\n'\n\n # Sorting the libraries\n inner_blocks = sorted(blocks[0].split('##'))\n for i in range(1, len(inner_blocks)):\n if inner_blocks[i][0] != '#':\n inner_blocks[i] = '##' + inner_blocks[i]\n inner_block...
{ "stringlengths": 380, "value": "\ndef main():\n # First, we load the current README into memory as an array of lines\n with open('README.md', 'r') as read_me_file:\n read_me = read_me_file.readlines()\n\n # Then we cluster the lines together as blocks\n # Each block represents a collection of l...
{ "stringlengths": 455, "value": " # Clustering is done by indentation\n blocks = []\n last_indent = None\n for line in read_me:\n s_line = line.lstrip()\n indent = len(line) - len(s_line)\n\n if any([s_line.startswith(s) for s in ['* [', '- [']]):\n if indent == last_ind...
{ "stringlengths": 35, "value": "./temp_repos/awesome-python\\sort.py" }
{ "stringlengths": 14, "value": "awesome-python" }
{ "listlengths": 1, "value": [ { "filename": "sort.py", "retrieved_chunk": "#!/usr/bin/env python\n# coding: utf-8\n\n\"\"\"\n The approach taken is explained below. I decided to do it simply.\n Initially I was considering parsing the data into some sort of\n structure and then generating a...
{ "stringclasses": "py", "value": "py" }
{ "int64": 96 }
{ "stringlengths": 587, "value": " blocks[i] = '# ' + blocks[i] + '\\n'\n\n # Sorting the libraries\n inner_blocks = sorted(blocks[0].split('##'))\n for i in range(1, len(inner_blocks)):\n if inner_blocks[i][0] != '#':\n inner_blocks[i] = '##' + inner_blocks[i]\n inner_block...
{ "stringlengths": 420, "value": "\ndef main():\n # First, we load the current README into memory as an array of lines\n with open('README.md', 'r') as read_me_file:\n read_me = read_me_file.readlines()\n\n # Then we cluster the lines together as blocks\n # Each block represents a collection of l...
{ "stringlengths": 446, "value": " blocks = []\n last_indent = None\n for line in read_me:\n s_line = line.lstrip()\n indent = len(line) - len(s_line)\n\n if any([s_line.startswith(s) for s in ['* [', '- [']]):\n if indent == last_indent:\n blocks[-1].append(l...
{ "stringlengths": 35, "value": "./temp_repos/awesome-python\\sort.py" }
{ "stringlengths": 14, "value": "awesome-python" }
{ "listlengths": 1, "value": [ { "filename": "sort.py", "retrieved_chunk": "#!/usr/bin/env python\n# coding: utf-8\n\n\"\"\"\n The approach taken is explained below. I decided to do it simply.\n Initially I was considering parsing the data into some sort of\n structure and then generating a...
{ "stringclasses": "py", "value": "py" }
{ "int64": 97 }
{ "stringlengths": 587, "value": " blocks[i] = '# ' + blocks[i] + '\\n'\n\n # Sorting the libraries\n inner_blocks = sorted(blocks[0].split('##'))\n for i in range(1, len(inner_blocks)):\n if inner_blocks[i][0] != '#':\n inner_blocks[i] = '##' + inner_blocks[i]\n inner_block...
{ "stringlengths": 436, "value": "\ndef main():\n # First, we load the current README into memory as an array of lines\n with open('README.md', 'r') as read_me_file:\n read_me = read_me_file.readlines()\n\n # Then we cluster the lines together as blocks\n # Each block represents a collection of l...
{ "stringlengths": 431, "value": " last_indent = None\n for line in read_me:\n s_line = line.lstrip()\n indent = len(line) - len(s_line)\n\n if any([s_line.startswith(s) for s in ['* [', '- [']]):\n if indent == last_indent:\n blocks[-1].append(line)\n ...
{ "stringlengths": 35, "value": "./temp_repos/awesome-python\\sort.py" }
{ "stringlengths": 14, "value": "awesome-python" }
{ "listlengths": 1, "value": [ { "filename": "sort.py", "retrieved_chunk": "#!/usr/bin/env python\n# coding: utf-8\n\n\"\"\"\n The approach taken is explained below. I decided to do it simply.\n Initially I was considering parsing the data into some sort of\n structure and then generating a...
{ "stringclasses": "py", "value": "py" }
{ "int64": 98 }
{ "stringlengths": 587, "value": " blocks[i] = '# ' + blocks[i] + '\\n'\n\n # Sorting the libraries\n inner_blocks = sorted(blocks[0].split('##'))\n for i in range(1, len(inner_blocks)):\n if inner_blocks[i][0] != '#':\n inner_blocks[i] = '##' + inner_blocks[i]\n inner_block...
{ "stringlengths": 459, "value": "\ndef main():\n # First, we load the current README into memory as an array of lines\n with open('README.md', 'r') as read_me_file:\n read_me = read_me_file.readlines()\n\n # Then we cluster the lines together as blocks\n # Each block represents a collection of l...
{ "stringlengths": 457, "value": " for line in read_me:\n s_line = line.lstrip()\n indent = len(line) - len(s_line)\n\n if any([s_line.startswith(s) for s in ['* [', '- [']]):\n if indent == last_indent:\n blocks[-1].append(line)\n else:\n ...
{ "stringlengths": 35, "value": "./temp_repos/awesome-python\\sort.py" }
{ "stringlengths": 14, "value": "awesome-python" }
{ "listlengths": 1, "value": [ { "filename": "sort.py", "retrieved_chunk": "#!/usr/bin/env python\n# coding: utf-8\n\n\"\"\"\n The approach taken is explained below. I decided to do it simply.\n Initially I was considering parsing the data into some sort of\n structure and then generating a...
{ "stringclasses": "py", "value": "py" }
{ "int64": 99 }
{ "stringlengths": 587, "value": " blocks[i] = '# ' + blocks[i] + '\\n'\n\n # Sorting the libraries\n inner_blocks = sorted(blocks[0].split('##'))\n for i in range(1, len(inner_blocks)):\n if inner_blocks[i][0] != '#':\n inner_blocks[i] = '##' + inner_blocks[i]\n inner_block...
{ "stringlengths": 515, "value": "\ndef main():\n # First, we load the current README into memory as an array of lines\n with open('README.md', 'r') as read_me_file:\n read_me = read_me_file.readlines()\n\n # Then we cluster the lines together as blocks\n # Each block represents a collection of l...
{ "stringlengths": 477, "value": " indent = len(line) - len(s_line)\n\n if any([s_line.startswith(s) for s in ['* [', '- [']]):\n if indent == last_indent:\n blocks[-1].append(line)\n else:\n blocks.append([line])\n last_indent = indent\n ...
{ "stringlengths": 35, "value": "./temp_repos/awesome-python\\sort.py" }
{ "stringlengths": 14, "value": "awesome-python" }
{ "listlengths": 1, "value": [ { "filename": "sort.py", "retrieved_chunk": "#!/usr/bin/env python\n# coding: utf-8\n\n\"\"\"\n The approach taken is explained below. I decided to do it simply.\n Initially I was considering parsing the data into some sort of\n structure and then generating a...
{ "stringclasses": "py", "value": "py" }
{ "int64": 100 }
{ "stringlengths": 587, "value": " blocks[i] = '# ' + blocks[i] + '\\n'\n\n # Sorting the libraries\n inner_blocks = sorted(blocks[0].split('##'))\n for i in range(1, len(inner_blocks)):\n if inner_blocks[i][0] != '#':\n inner_blocks[i] = '##' + inner_blocks[i]\n inner_block...
{ "stringlengths": 556, "value": "\ndef main():\n # First, we load the current README into memory as an array of lines\n with open('README.md', 'r') as read_me_file:\n read_me = read_me_file.readlines()\n\n # Then we cluster the lines together as blocks\n # Each block represents a collection of l...
{ "stringlengths": 506, "value": "\n if any([s_line.startswith(s) for s in ['* [', '- [']]):\n if indent == last_indent:\n blocks[-1].append(line)\n else:\n blocks.append([line])\n last_indent = indent\n else:\n blocks.append([l...
{ "stringlengths": 35, "value": "./temp_repos/awesome-python\\sort.py" }
{ "stringlengths": 14, "value": "awesome-python" }
{ "listlengths": 1, "value": [ { "filename": "sort.py", "retrieved_chunk": "#!/usr/bin/env python\n# coding: utf-8\n\n\"\"\"\n The approach taken is explained below. I decided to do it simply.\n Initially I was considering parsing the data into some sort of\n structure and then generating a...
{ "stringclasses": "py", "value": "py" }
{ "int64": 101 }
{ "stringlengths": 587, "value": " blocks[i] = '# ' + blocks[i] + '\\n'\n\n # Sorting the libraries\n inner_blocks = sorted(blocks[0].split('##'))\n for i in range(1, len(inner_blocks)):\n if inner_blocks[i][0] != '#':\n inner_blocks[i] = '##' + inner_blocks[i]\n inner_block...
{ "stringlengths": 557, "value": "\ndef main():\n # First, we load the current README into memory as an array of lines\n with open('README.md', 'r') as read_me_file:\n read_me = read_me_file.readlines()\n\n # Then we cluster the lines together as blocks\n # Each block represents a collection of l...
{ "stringlengths": 515, "value": " if any([s_line.startswith(s) for s in ['* [', '- [']]):\n if indent == last_indent:\n blocks[-1].append(line)\n else:\n blocks.append([line])\n last_indent = indent\n else:\n blocks.append([lin...
{ "stringlengths": 35, "value": "./temp_repos/awesome-python\\sort.py" }
{ "stringlengths": 14, "value": "awesome-python" }
{ "listlengths": 1, "value": [ { "filename": "sort.py", "retrieved_chunk": "#!/usr/bin/env python\n# coding: utf-8\n\n\"\"\"\n The approach taken is explained below. I decided to do it simply.\n Initially I was considering parsing the data into some sort of\n structure and then generating a...
{ "stringclasses": "py", "value": "py" }
{ "int64": 102 }
{ "stringlengths": 587, "value": " blocks[i] = '# ' + blocks[i] + '\\n'\n\n # Sorting the libraries\n inner_blocks = sorted(blocks[0].split('##'))\n for i in range(1, len(inner_blocks)):\n if inner_blocks[i][0] != '#':\n inner_blocks[i] = '##' + inner_blocks[i]\n inner_block...
{ "stringlengths": 699, "value": "\ndef main():\n # First, we load the current README into memory as an array of lines\n with open('README.md', 'r') as read_me_file:\n read_me = read_me_file.readlines()\n\n # Then we cluster the lines together as blocks\n # Each block represents a collection of l...
{ "stringlengths": 471, "value": " else:\n blocks.append([line])\n last_indent = indent\n else:\n blocks.append([line])\n last_indent = None\n\n with open('README.md', 'w+') as sorted_file:\n # Then all of the blocks are sorted individually...
{ "stringlengths": 35, "value": "./temp_repos/awesome-python\\sort.py" }
{ "stringlengths": 14, "value": "awesome-python" }
{ "listlengths": 1, "value": [ { "filename": "sort.py", "retrieved_chunk": "#!/usr/bin/env python\n# coding: utf-8\n\n\"\"\"\n The approach taken is explained below. I decided to do it simply.\n Initially I was considering parsing the data into some sort of\n structure and then generating a...
{ "stringclasses": "py", "value": "py" }
{ "int64": 103 }
{ "stringlengths": 587, "value": " blocks[i] = '# ' + blocks[i] + '\\n'\n\n # Sorting the libraries\n inner_blocks = sorted(blocks[0].split('##'))\n for i in range(1, len(inner_blocks)):\n if inner_blocks[i][0] != '#':\n inner_blocks[i] = '##' + inner_blocks[i]\n inner_block...
{ "stringlengths": 755, "value": "\ndef main():\n # First, we load the current README into memory as an array of lines\n with open('README.md', 'r') as read_me_file:\n read_me = read_me_file.readlines()\n\n # Then we cluster the lines together as blocks\n # Each block represents a collection of l...
{ "stringlengths": 471, "value": " last_indent = indent\n else:\n blocks.append([line])\n last_indent = None\n\n with open('README.md', 'w+') as sorted_file:\n # Then all of the blocks are sorted individually\n blocks = [\n ''.join(sorted(block, ke...
{ "stringlengths": 35, "value": "./temp_repos/awesome-python\\sort.py" }
{ "stringlengths": 14, "value": "awesome-python" }
{ "listlengths": 1, "value": [ { "filename": "sort.py", "retrieved_chunk": "#!/usr/bin/env python\n# coding: utf-8\n\n\"\"\"\n The approach taken is explained below. I decided to do it simply.\n Initially I was considering parsing the data into some sort of\n structure and then generating a...
{ "stringclasses": "py", "value": "py" }
{ "int64": 104 }
{ "stringlengths": 587, "value": " blocks[i] = '# ' + blocks[i] + '\\n'\n\n # Sorting the libraries\n inner_blocks = sorted(blocks[0].split('##'))\n for i in range(1, len(inner_blocks)):\n if inner_blocks[i][0] != '#':\n inner_blocks[i] = '##' + inner_blocks[i]\n inner_block...
{ "stringlengths": 788, "value": "\ndef main():\n # First, we load the current README into memory as an array of lines\n with open('README.md', 'r') as read_me_file:\n read_me = read_me_file.readlines()\n\n # Then we cluster the lines together as blocks\n # Each block represents a collection of l...
{ "stringlengths": 439, "value": " else:\n blocks.append([line])\n last_indent = None\n\n with open('README.md', 'w+') as sorted_file:\n # Then all of the blocks are sorted individually\n blocks = [\n ''.join(sorted(block, key=str.lower)) for block in blocks\...
{ "stringlengths": 35, "value": "./temp_repos/awesome-python\\sort.py" }
{ "stringlengths": 14, "value": "awesome-python" }
{ "listlengths": 1, "value": [ { "filename": "sort.py", "retrieved_chunk": "#!/usr/bin/env python\n# coding: utf-8\n\n\"\"\"\n The approach taken is explained below. I decided to do it simply.\n Initially I was considering parsing the data into some sort of\n structure and then generating a...
{ "stringclasses": "py", "value": "py" }
{ "int64": 105 }
{ "stringlengths": 587, "value": " blocks[i] = '# ' + blocks[i] + '\\n'\n\n # Sorting the libraries\n inner_blocks = sorted(blocks[0].split('##'))\n for i in range(1, len(inner_blocks)):\n if inner_blocks[i][0] != '#':\n inner_blocks[i] = '##' + inner_blocks[i]\n inner_block...
{ "stringlengths": 836, "value": "\ndef main():\n # First, we load the current README into memory as an array of lines\n with open('README.md', 'r') as read_me_file:\n read_me = read_me_file.readlines()\n\n # Then we cluster the lines together as blocks\n # Each block represents a collection of l...
{ "stringlengths": 419, "value": " last_indent = None\n\n with open('README.md', 'w+') as sorted_file:\n # Then all of the blocks are sorted individually\n blocks = [\n ''.join(sorted(block, key=str.lower)) for block in blocks\n ]\n # And the result is written ba...
{ "stringlengths": 35, "value": "./temp_repos/awesome-python\\sort.py" }
{ "stringlengths": 14, "value": "awesome-python" }
{ "listlengths": 1, "value": [ { "filename": "sort.py", "retrieved_chunk": "#!/usr/bin/env python\n# coding: utf-8\n\n\"\"\"\n The approach taken is explained below. I decided to do it simply.\n Initially I was considering parsing the data into some sort of\n structure and then generating a...
{ "stringclasses": "py", "value": "py" }
{ "int64": 106 }
{ "stringlengths": 587, "value": " blocks[i] = '# ' + blocks[i] + '\\n'\n\n # Sorting the libraries\n inner_blocks = sorted(blocks[0].split('##'))\n for i in range(1, len(inner_blocks)):\n if inner_blocks[i][0] != '#':\n inner_blocks[i] = '##' + inner_blocks[i]\n inner_block...
{ "stringlengths": 867, "value": "\ndef main():\n # First, we load the current README into memory as an array of lines\n with open('README.md', 'r') as read_me_file:\n read_me = read_me_file.readlines()\n\n # Then we cluster the lines together as blocks\n # Each block represents a collection of l...
{ "stringlengths": 399, "value": "\n with open('README.md', 'w+') as sorted_file:\n # Then all of the blocks are sorted individually\n blocks = [\n ''.join(sorted(block, key=str.lower)) for block in blocks\n ]\n # And the result is written back to README.md\n sorted_...
{ "stringlengths": 35, "value": "./temp_repos/awesome-python\\sort.py" }
{ "stringlengths": 14, "value": "awesome-python" }
{ "listlengths": 1, "value": [ { "filename": "sort.py", "retrieved_chunk": "#!/usr/bin/env python\n# coding: utf-8\n\n\"\"\"\n The approach taken is explained below. I decided to do it simply.\n Initially I was considering parsing the data into some sort of\n structure and then generating a...
{ "stringclasses": "py", "value": "py" }
{ "int64": 107 }
{ "stringlengths": 540, "value": "\n # Sorting the libraries\n inner_blocks = sorted(blocks[0].split('##'))\n for i in range(1, len(inner_blocks)):\n if inner_blocks[i][0] != '#':\n inner_blocks[i] = '##' + inner_blocks[i]\n inner_blocks = ''.join(inner_blocks)\n\n # Replacing the n...
{ "stringlengths": 176, "value": "def main():\n # First, we load the current README into memory as an array of lines\n with open('README.md', 'r') as read_me_file:\n read_me = read_me_file.readlines()" }
{ "stringlengths": 539, "value": "\n # Then we cluster the lines together as blocks\n # Each block represents a collection of lines that should be sorted\n # This was done by assuming only links ([...](...)) are meant to be sorted\n # Clustering is done by indentation\n blocks = []\n last_indent =...
{ "stringlengths": 35, "value": "./temp_repos/awesome-python\\sort.py" }
{ "stringlengths": 14, "value": "awesome-python" }
{ "listlengths": 1, "value": [ { "filename": "sort.py", "retrieved_chunk": "#!/usr/bin/env python\n# coding: utf-8\n\n\"\"\"\n The approach taken is explained below. I decided to do it simply.\n Initially I was considering parsing the data into some sort of\n structure and then generating a...
{ "stringclasses": "py", "value": "py" }
{ "int64": 109 }
{ "stringlengths": 540, "value": "\n # Sorting the libraries\n inner_blocks = sorted(blocks[0].split('##'))\n for i in range(1, len(inner_blocks)):\n if inner_blocks[i][0] != '#':\n inner_blocks[i] = '##' + inner_blocks[i]\n inner_blocks = ''.join(inner_blocks)\n\n # Replacing the n...
{ "stringlengths": 177, "value": "def main():\n # First, we load the current README into memory as an array of lines\n with open('README.md', 'r') as read_me_file:\n read_me = read_me_file.readlines()\n" }
{ "stringlengths": 576, "value": " # Then we cluster the lines together as blocks\n # Each block represents a collection of lines that should be sorted\n # This was done by assuming only links ([...](...)) are meant to be sorted\n # Clustering is done by indentation\n blocks = []\n last_indent = N...
{ "stringlengths": 35, "value": "./temp_repos/awesome-python\\sort.py" }
{ "stringlengths": 14, "value": "awesome-python" }
{ "listlengths": 1, "value": [ { "filename": "sort.py", "retrieved_chunk": "#!/usr/bin/env python\n# coding: utf-8\n\n\"\"\"\n The approach taken is explained below. I decided to do it simply.\n Initially I was considering parsing the data into some sort of\n structure and then generating a...
{ "stringclasses": "py", "value": "py" }
{ "int64": 110 }
{ "stringlengths": 540, "value": "\n # Sorting the libraries\n inner_blocks = sorted(blocks[0].split('##'))\n for i in range(1, len(inner_blocks)):\n if inner_blocks[i][0] != '#':\n inner_blocks[i] = '##' + inner_blocks[i]\n inner_blocks = ''.join(inner_blocks)\n\n # Replacing the n...
{ "stringlengths": 228, "value": "def main():\n # First, we load the current README into memory as an array of lines\n with open('README.md', 'r') as read_me_file:\n read_me = read_me_file.readlines()\n\n # Then we cluster the lines together as blocks" }
{ "stringlengths": 558, "value": " # Each block represents a collection of lines that should be sorted\n # This was done by assuming only links ([...](...)) are meant to be sorted\n # Clustering is done by indentation\n blocks = []\n last_indent = None\n for line in read_me:\n s_line = line...
{ "stringlengths": 35, "value": "./temp_repos/awesome-python\\sort.py" }
{ "stringlengths": 14, "value": "awesome-python" }
{ "listlengths": 1, "value": [ { "filename": "sort.py", "retrieved_chunk": "#!/usr/bin/env python\n# coding: utf-8\n\n\"\"\"\n The approach taken is explained below. I decided to do it simply.\n Initially I was considering parsing the data into some sort of\n structure and then generating a...
{ "stringclasses": "py", "value": "py" }
{ "int64": 111 }
{ "stringlengths": 540, "value": "\n # Sorting the libraries\n inner_blocks = sorted(blocks[0].split('##'))\n for i in range(1, len(inner_blocks)):\n if inner_blocks[i][0] != '#':\n inner_blocks[i] = '##' + inner_blocks[i]\n inner_blocks = ''.join(inner_blocks)\n\n # Replacing the n...
{ "stringlengths": 300, "value": "def main():\n # First, we load the current README into memory as an array of lines\n with open('README.md', 'r') as read_me_file:\n read_me = read_me_file.readlines()\n\n # Then we cluster the lines together as blocks\n # Each block represents a collection of lin...
{ "stringlengths": 500, "value": " # This was done by assuming only links ([...](...)) are meant to be sorted\n # Clustering is done by indentation\n blocks = []\n last_indent = None\n for line in read_me:\n s_line = line.lstrip()\n indent = len(line) - len(s_line)\n\n if any([s_...
{ "stringlengths": 35, "value": "./temp_repos/awesome-python\\sort.py" }
{ "stringlengths": 14, "value": "awesome-python" }
{ "listlengths": 1, "value": [ { "filename": "sort.py", "retrieved_chunk": "#!/usr/bin/env python\n# coding: utf-8\n\n\"\"\"\n The approach taken is explained below. I decided to do it simply.\n Initially I was considering parsing the data into some sort of\n structure and then generating a...
{ "stringclasses": "py", "value": "py" }
{ "int64": 112 }
{ "stringlengths": 540, "value": "\n # Sorting the libraries\n inner_blocks = sorted(blocks[0].split('##'))\n for i in range(1, len(inner_blocks)):\n if inner_blocks[i][0] != '#':\n inner_blocks[i] = '##' + inner_blocks[i]\n inner_blocks = ''.join(inner_blocks)\n\n # Replacing the n...
{ "stringlengths": 379, "value": "def main():\n # First, we load the current README into memory as an array of lines\n with open('README.md', 'r') as read_me_file:\n read_me = read_me_file.readlines()\n\n # Then we cluster the lines together as blocks\n # Each block represents a collection of lin...
{ "stringlengths": 455, "value": " # Clustering is done by indentation\n blocks = []\n last_indent = None\n for line in read_me:\n s_line = line.lstrip()\n indent = len(line) - len(s_line)\n\n if any([s_line.startswith(s) for s in ['* [', '- [']]):\n if indent == last_ind...
{ "stringlengths": 35, "value": "./temp_repos/awesome-python\\sort.py" }
{ "stringlengths": 14, "value": "awesome-python" }
{ "listlengths": 1, "value": [ { "filename": "sort.py", "retrieved_chunk": "#!/usr/bin/env python\n# coding: utf-8\n\n\"\"\"\n The approach taken is explained below. I decided to do it simply.\n Initially I was considering parsing the data into some sort of\n structure and then generating a...
{ "stringclasses": "py", "value": "py" }
{ "int64": 113 }
{ "stringlengths": 540, "value": "\n # Sorting the libraries\n inner_blocks = sorted(blocks[0].split('##'))\n for i in range(1, len(inner_blocks)):\n if inner_blocks[i][0] != '#':\n inner_blocks[i] = '##' + inner_blocks[i]\n inner_blocks = ''.join(inner_blocks)\n\n # Replacing the n...
{ "stringlengths": 419, "value": "def main():\n # First, we load the current README into memory as an array of lines\n with open('README.md', 'r') as read_me_file:\n read_me = read_me_file.readlines()\n\n # Then we cluster the lines together as blocks\n # Each block represents a collection of lin...
{ "stringlengths": 446, "value": " blocks = []\n last_indent = None\n for line in read_me:\n s_line = line.lstrip()\n indent = len(line) - len(s_line)\n\n if any([s_line.startswith(s) for s in ['* [', '- [']]):\n if indent == last_indent:\n blocks[-1].append(l...
{ "stringlengths": 35, "value": "./temp_repos/awesome-python\\sort.py" }
{ "stringlengths": 14, "value": "awesome-python" }
{ "listlengths": 1, "value": [ { "filename": "sort.py", "retrieved_chunk": "#!/usr/bin/env python\n# coding: utf-8\n\n\"\"\"\n The approach taken is explained below. I decided to do it simply.\n Initially I was considering parsing the data into some sort of\n structure and then generating a...
{ "stringclasses": "py", "value": "py" }
{ "int64": 114 }
{ "stringlengths": 540, "value": "\n # Sorting the libraries\n inner_blocks = sorted(blocks[0].split('##'))\n for i in range(1, len(inner_blocks)):\n if inner_blocks[i][0] != '#':\n inner_blocks[i] = '##' + inner_blocks[i]\n inner_blocks = ''.join(inner_blocks)\n\n # Replacing the n...
{ "stringlengths": 435, "value": "def main():\n # First, we load the current README into memory as an array of lines\n with open('README.md', 'r') as read_me_file:\n read_me = read_me_file.readlines()\n\n # Then we cluster the lines together as blocks\n # Each block represents a collection of lin...
{ "stringlengths": 431, "value": " last_indent = None\n for line in read_me:\n s_line = line.lstrip()\n indent = len(line) - len(s_line)\n\n if any([s_line.startswith(s) for s in ['* [', '- [']]):\n if indent == last_indent:\n blocks[-1].append(line)\n ...
{ "stringlengths": 35, "value": "./temp_repos/awesome-python\\sort.py" }
{ "stringlengths": 14, "value": "awesome-python" }
{ "listlengths": 1, "value": [ { "filename": "sort.py", "retrieved_chunk": "#!/usr/bin/env python\n# coding: utf-8\n\n\"\"\"\n The approach taken is explained below. I decided to do it simply.\n Initially I was considering parsing the data into some sort of\n structure and then generating a...
{ "stringclasses": "py", "value": "py" }
{ "int64": 115 }
{ "stringlengths": 540, "value": "\n # Sorting the libraries\n inner_blocks = sorted(blocks[0].split('##'))\n for i in range(1, len(inner_blocks)):\n if inner_blocks[i][0] != '#':\n inner_blocks[i] = '##' + inner_blocks[i]\n inner_blocks = ''.join(inner_blocks)\n\n # Replacing the n...
{ "stringlengths": 458, "value": "def main():\n # First, we load the current README into memory as an array of lines\n with open('README.md', 'r') as read_me_file:\n read_me = read_me_file.readlines()\n\n # Then we cluster the lines together as blocks\n # Each block represents a collection of lin...
{ "stringlengths": 457, "value": " for line in read_me:\n s_line = line.lstrip()\n indent = len(line) - len(s_line)\n\n if any([s_line.startswith(s) for s in ['* [', '- [']]):\n if indent == last_indent:\n blocks[-1].append(line)\n else:\n ...
{ "stringlengths": 35, "value": "./temp_repos/awesome-python\\sort.py" }
{ "stringlengths": 14, "value": "awesome-python" }
{ "listlengths": 1, "value": [ { "filename": "sort.py", "retrieved_chunk": "#!/usr/bin/env python\n# coding: utf-8\n\n\"\"\"\n The approach taken is explained below. I decided to do it simply.\n Initially I was considering parsing the data into some sort of\n structure and then generating a...
{ "stringclasses": "py", "value": "py" }
{ "int64": 116 }
{ "stringlengths": 540, "value": "\n # Sorting the libraries\n inner_blocks = sorted(blocks[0].split('##'))\n for i in range(1, len(inner_blocks)):\n if inner_blocks[i][0] != '#':\n inner_blocks[i] = '##' + inner_blocks[i]\n inner_blocks = ''.join(inner_blocks)\n\n # Replacing the n...
{ "stringlengths": 514, "value": "def main():\n # First, we load the current README into memory as an array of lines\n with open('README.md', 'r') as read_me_file:\n read_me = read_me_file.readlines()\n\n # Then we cluster the lines together as blocks\n # Each block represents a collection of lin...
{ "stringlengths": 477, "value": " indent = len(line) - len(s_line)\n\n if any([s_line.startswith(s) for s in ['* [', '- [']]):\n if indent == last_indent:\n blocks[-1].append(line)\n else:\n blocks.append([line])\n last_indent = indent\n ...
{ "stringlengths": 35, "value": "./temp_repos/awesome-python\\sort.py" }
{ "stringlengths": 14, "value": "awesome-python" }
{ "listlengths": 1, "value": [ { "filename": "sort.py", "retrieved_chunk": "#!/usr/bin/env python\n# coding: utf-8\n\n\"\"\"\n The approach taken is explained below. I decided to do it simply.\n Initially I was considering parsing the data into some sort of\n structure and then generating a...
{ "stringclasses": "py", "value": "py" }
{ "int64": 117 }
{ "stringlengths": 540, "value": "\n # Sorting the libraries\n inner_blocks = sorted(blocks[0].split('##'))\n for i in range(1, len(inner_blocks)):\n if inner_blocks[i][0] != '#':\n inner_blocks[i] = '##' + inner_blocks[i]\n inner_blocks = ''.join(inner_blocks)\n\n # Replacing the n...
{ "stringlengths": 555, "value": "def main():\n # First, we load the current README into memory as an array of lines\n with open('README.md', 'r') as read_me_file:\n read_me = read_me_file.readlines()\n\n # Then we cluster the lines together as blocks\n # Each block represents a collection of lin...
{ "stringlengths": 506, "value": "\n if any([s_line.startswith(s) for s in ['* [', '- [']]):\n if indent == last_indent:\n blocks[-1].append(line)\n else:\n blocks.append([line])\n last_indent = indent\n else:\n blocks.append([l...
{ "stringlengths": 35, "value": "./temp_repos/awesome-python\\sort.py" }
{ "stringlengths": 14, "value": "awesome-python" }
{ "listlengths": 1, "value": [ { "filename": "sort.py", "retrieved_chunk": "#!/usr/bin/env python\n# coding: utf-8\n\n\"\"\"\n The approach taken is explained below. I decided to do it simply.\n Initially I was considering parsing the data into some sort of\n structure and then generating a...
{ "stringclasses": "py", "value": "py" }
{ "int64": 118 }
{ "stringlengths": 540, "value": "\n # Sorting the libraries\n inner_blocks = sorted(blocks[0].split('##'))\n for i in range(1, len(inner_blocks)):\n if inner_blocks[i][0] != '#':\n inner_blocks[i] = '##' + inner_blocks[i]\n inner_blocks = ''.join(inner_blocks)\n\n # Replacing the n...
{ "stringlengths": 556, "value": "def main():\n # First, we load the current README into memory as an array of lines\n with open('README.md', 'r') as read_me_file:\n read_me = read_me_file.readlines()\n\n # Then we cluster the lines together as blocks\n # Each block represents a collection of lin...
{ "stringlengths": 515, "value": " if any([s_line.startswith(s) for s in ['* [', '- [']]):\n if indent == last_indent:\n blocks[-1].append(line)\n else:\n blocks.append([line])\n last_indent = indent\n else:\n blocks.append([lin...
{ "stringlengths": 35, "value": "./temp_repos/awesome-python\\sort.py" }
{ "stringlengths": 14, "value": "awesome-python" }
{ "listlengths": 1, "value": [ { "filename": "sort.py", "retrieved_chunk": "#!/usr/bin/env python\n# coding: utf-8\n\n\"\"\"\n The approach taken is explained below. I decided to do it simply.\n Initially I was considering parsing the data into some sort of\n structure and then generating a...
{ "stringclasses": "py", "value": "py" }
{ "int64": 119 }
{ "stringlengths": 540, "value": "\n # Sorting the libraries\n inner_blocks = sorted(blocks[0].split('##'))\n for i in range(1, len(inner_blocks)):\n if inner_blocks[i][0] != '#':\n inner_blocks[i] = '##' + inner_blocks[i]\n inner_blocks = ''.join(inner_blocks)\n\n # Replacing the n...
{ "stringlengths": 698, "value": "def main():\n # First, we load the current README into memory as an array of lines\n with open('README.md', 'r') as read_me_file:\n read_me = read_me_file.readlines()\n\n # Then we cluster the lines together as blocks\n # Each block represents a collection of lin...
{ "stringlengths": 471, "value": " else:\n blocks.append([line])\n last_indent = indent\n else:\n blocks.append([line])\n last_indent = None\n\n with open('README.md', 'w+') as sorted_file:\n # Then all of the blocks are sorted individually...
{ "stringlengths": 35, "value": "./temp_repos/awesome-python\\sort.py" }
{ "stringlengths": 14, "value": "awesome-python" }
{ "listlengths": 1, "value": [ { "filename": "sort.py", "retrieved_chunk": "#!/usr/bin/env python\n# coding: utf-8\n\n\"\"\"\n The approach taken is explained below. I decided to do it simply.\n Initially I was considering parsing the data into some sort of\n structure and then generating a...
{ "stringclasses": "py", "value": "py" }
{ "int64": 120 }
{ "stringlengths": 540, "value": "\n # Sorting the libraries\n inner_blocks = sorted(blocks[0].split('##'))\n for i in range(1, len(inner_blocks)):\n if inner_blocks[i][0] != '#':\n inner_blocks[i] = '##' + inner_blocks[i]\n inner_blocks = ''.join(inner_blocks)\n\n # Replacing the n...
{ "stringlengths": 754, "value": "def main():\n # First, we load the current README into memory as an array of lines\n with open('README.md', 'r') as read_me_file:\n read_me = read_me_file.readlines()\n\n # Then we cluster the lines together as blocks\n # Each block represents a collection of lin...
{ "stringlengths": 471, "value": " last_indent = indent\n else:\n blocks.append([line])\n last_indent = None\n\n with open('README.md', 'w+') as sorted_file:\n # Then all of the blocks are sorted individually\n blocks = [\n ''.join(sorted(block, ke...
{ "stringlengths": 35, "value": "./temp_repos/awesome-python\\sort.py" }
{ "stringlengths": 14, "value": "awesome-python" }
{ "listlengths": 1, "value": [ { "filename": "sort.py", "retrieved_chunk": "#!/usr/bin/env python\n# coding: utf-8\n\n\"\"\"\n The approach taken is explained below. I decided to do it simply.\n Initially I was considering parsing the data into some sort of\n structure and then generating a...
{ "stringclasses": "py", "value": "py" }
{ "int64": 121 }
{ "stringlengths": 540, "value": "\n # Sorting the libraries\n inner_blocks = sorted(blocks[0].split('##'))\n for i in range(1, len(inner_blocks)):\n if inner_blocks[i][0] != '#':\n inner_blocks[i] = '##' + inner_blocks[i]\n inner_blocks = ''.join(inner_blocks)\n\n # Replacing the n...
{ "stringlengths": 787, "value": "def main():\n # First, we load the current README into memory as an array of lines\n with open('README.md', 'r') as read_me_file:\n read_me = read_me_file.readlines()\n\n # Then we cluster the lines together as blocks\n # Each block represents a collection of lin...
{ "stringlengths": 439, "value": " else:\n blocks.append([line])\n last_indent = None\n\n with open('README.md', 'w+') as sorted_file:\n # Then all of the blocks are sorted individually\n blocks = [\n ''.join(sorted(block, key=str.lower)) for block in blocks\...
{ "stringlengths": 35, "value": "./temp_repos/awesome-python\\sort.py" }
{ "stringlengths": 14, "value": "awesome-python" }
{ "listlengths": 1, "value": [ { "filename": "sort.py", "retrieved_chunk": "#!/usr/bin/env python\n# coding: utf-8\n\n\"\"\"\n The approach taken is explained below. I decided to do it simply.\n Initially I was considering parsing the data into some sort of\n structure and then generating a...
{ "stringclasses": "py", "value": "py" }
{ "int64": 122 }
{ "stringlengths": 540, "value": "\n # Sorting the libraries\n inner_blocks = sorted(blocks[0].split('##'))\n for i in range(1, len(inner_blocks)):\n if inner_blocks[i][0] != '#':\n inner_blocks[i] = '##' + inner_blocks[i]\n inner_blocks = ''.join(inner_blocks)\n\n # Replacing the n...
{ "stringlengths": 835, "value": "def main():\n # First, we load the current README into memory as an array of lines\n with open('README.md', 'r') as read_me_file:\n read_me = read_me_file.readlines()\n\n # Then we cluster the lines together as blocks\n # Each block represents a collection of lin...
{ "stringlengths": 419, "value": " last_indent = None\n\n with open('README.md', 'w+') as sorted_file:\n # Then all of the blocks are sorted individually\n blocks = [\n ''.join(sorted(block, key=str.lower)) for block in blocks\n ]\n # And the result is written ba...
{ "stringlengths": 35, "value": "./temp_repos/awesome-python\\sort.py" }
{ "stringlengths": 14, "value": "awesome-python" }
{ "listlengths": 1, "value": [ { "filename": "sort.py", "retrieved_chunk": "#!/usr/bin/env python\n# coding: utf-8\n\n\"\"\"\n The approach taken is explained below. I decided to do it simply.\n Initially I was considering parsing the data into some sort of\n structure and then generating a...
{ "stringclasses": "py", "value": "py" }
{ "int64": 123 }
{ "stringlengths": 540, "value": "\n # Sorting the libraries\n inner_blocks = sorted(blocks[0].split('##'))\n for i in range(1, len(inner_blocks)):\n if inner_blocks[i][0] != '#':\n inner_blocks[i] = '##' + inner_blocks[i]\n inner_blocks = ''.join(inner_blocks)\n\n # Replacing the n...
{ "stringlengths": 866, "value": "def main():\n # First, we load the current README into memory as an array of lines\n with open('README.md', 'r') as read_me_file:\n read_me = read_me_file.readlines()\n\n # Then we cluster the lines together as blocks\n # Each block represents a collection of lin...
{ "stringlengths": 399, "value": "\n with open('README.md', 'w+') as sorted_file:\n # Then all of the blocks are sorted individually\n blocks = [\n ''.join(sorted(block, key=str.lower)) for block in blocks\n ]\n # And the result is written back to README.md\n sorted_...
{ "stringlengths": 35, "value": "./temp_repos/awesome-python\\sort.py" }
{ "stringlengths": 14, "value": "awesome-python" }
{ "listlengths": 1, "value": [ { "filename": "sort.py", "retrieved_chunk": "#!/usr/bin/env python\n# coding: utf-8\n\n\"\"\"\n The approach taken is explained below. I decided to do it simply.\n Initially I was considering parsing the data into some sort of\n structure and then generating a...
{ "stringclasses": "py", "value": "py" }
{ "int64": 124 }
{ "stringlengths": 551, "value": " # Sorting the libraries\n inner_blocks = sorted(blocks[0].split('##'))\n for i in range(1, len(inner_blocks)):\n if inner_blocks[i][0] != '#':\n inner_blocks[i] = '##' + inner_blocks[i]\n inner_blocks = ''.join(inner_blocks)\n\n # Replacing the non...
{ "stringlengths": 72, "value": " # First, we load the current README into memory as an array of lines" }
{ "stringlengths": 573, "value": " with open('README.md', 'r') as read_me_file:\n read_me = read_me_file.readlines()\n\n # Then we cluster the lines together as blocks\n # Each block represents a collection of lines that should be sorted\n # This was done by assuming only links ([...](...)) are m...
{ "stringlengths": 35, "value": "./temp_repos/awesome-python\\sort.py" }
{ "stringlengths": 14, "value": "awesome-python" }
{ "listlengths": 1, "value": [ { "filename": "sort.py", "retrieved_chunk": "#!/usr/bin/env python\n# coding: utf-8\n\n\"\"\"\n The approach taken is explained below. I decided to do it simply.\n Initially I was considering parsing the data into some sort of\n structure and then generating a...
{ "stringclasses": "py", "value": "py" }
{ "int64": 126 }
{ "stringlengths": 597, "value": " if inner_blocks[i][0] != '#':\n inner_blocks[i] = '##' + inner_blocks[i]\n inner_blocks = ''.join(inner_blocks)\n\n # Replacing the non-sorted libraries by the sorted ones and gathering all at the final_README file\n blocks[0] = inner_blocks\n final_R...
{ "stringlengths": 51, "value": "\n # Then we cluster the lines together as blocks" }
{ "stringlengths": 558, "value": " # Each block represents a collection of lines that should be sorted\n # This was done by assuming only links ([...](...)) are meant to be sorted\n # Clustering is done by indentation\n blocks = []\n last_indent = None\n for line in read_me:\n s_line = line...
{ "stringlengths": 35, "value": "./temp_repos/awesome-python\\sort.py" }
{ "stringlengths": 14, "value": "awesome-python" }
{ "listlengths": 1, "value": [ { "filename": "sort.py", "retrieved_chunk": "#!/usr/bin/env python\n# coding: utf-8\n\n\"\"\"\n The approach taken is explained below. I decided to do it simply.\n Initially I was considering parsing the data into some sort of\n structure and then generating a...
{ "stringclasses": "py", "value": "py" }
{ "int64": 127 }
{ "stringlengths": 597, "value": " if inner_blocks[i][0] != '#':\n inner_blocks[i] = '##' + inner_blocks[i]\n inner_blocks = ''.join(inner_blocks)\n\n # Replacing the non-sorted libraries by the sorted ones and gathering all at the final_README file\n blocks[0] = inner_blocks\n final_R...
{ "stringlengths": 123, "value": "\n # Then we cluster the lines together as blocks\n # Each block represents a collection of lines that should be sorted" }
{ "stringlengths": 500, "value": " # This was done by assuming only links ([...](...)) are meant to be sorted\n # Clustering is done by indentation\n blocks = []\n last_indent = None\n for line in read_me:\n s_line = line.lstrip()\n indent = len(line) - len(s_line)\n\n if any([s_...
{ "stringlengths": 35, "value": "./temp_repos/awesome-python\\sort.py" }
{ "stringlengths": 14, "value": "awesome-python" }
{ "listlengths": 1, "value": [ { "filename": "sort.py", "retrieved_chunk": "#!/usr/bin/env python\n# coding: utf-8\n\n\"\"\"\n The approach taken is explained below. I decided to do it simply.\n Initially I was considering parsing the data into some sort of\n structure and then generating a...
{ "stringclasses": "py", "value": "py" }
{ "int64": 128 }
{ "stringlengths": 597, "value": " if inner_blocks[i][0] != '#':\n inner_blocks[i] = '##' + inner_blocks[i]\n inner_blocks = ''.join(inner_blocks)\n\n # Replacing the non-sorted libraries by the sorted ones and gathering all at the final_README file\n blocks[0] = inner_blocks\n final_R...
{ "stringlengths": 202, "value": "\n # Then we cluster the lines together as blocks\n # Each block represents a collection of lines that should be sorted\n # This was done by assuming only links ([...](...)) are meant to be sorted" }
{ "stringlengths": 455, "value": " # Clustering is done by indentation\n blocks = []\n last_indent = None\n for line in read_me:\n s_line = line.lstrip()\n indent = len(line) - len(s_line)\n\n if any([s_line.startswith(s) for s in ['* [', '- [']]):\n if indent == last_ind...
{ "stringlengths": 35, "value": "./temp_repos/awesome-python\\sort.py" }
{ "stringlengths": 14, "value": "awesome-python" }
{ "listlengths": 1, "value": [ { "filename": "sort.py", "retrieved_chunk": "#!/usr/bin/env python\n# coding: utf-8\n\n\"\"\"\n The approach taken is explained below. I decided to do it simply.\n Initially I was considering parsing the data into some sort of\n structure and then generating a...
{ "stringclasses": "py", "value": "py" }
{ "int64": 129 }
{ "stringlengths": 597, "value": " if inner_blocks[i][0] != '#':\n inner_blocks[i] = '##' + inner_blocks[i]\n inner_blocks = ''.join(inner_blocks)\n\n # Replacing the non-sorted libraries by the sorted ones and gathering all at the final_README file\n blocks[0] = inner_blocks\n final_R...
{ "stringlengths": 242, "value": "\n # Then we cluster the lines together as blocks\n # Each block represents a collection of lines that should be sorted\n # This was done by assuming only links ([...](...)) are meant to be sorted\n # Clustering is done by indentation" }
{ "stringlengths": 446, "value": " blocks = []\n last_indent = None\n for line in read_me:\n s_line = line.lstrip()\n indent = len(line) - len(s_line)\n\n if any([s_line.startswith(s) for s in ['* [', '- [']]):\n if indent == last_indent:\n blocks[-1].append(l...
{ "stringlengths": 35, "value": "./temp_repos/awesome-python\\sort.py" }
{ "stringlengths": 14, "value": "awesome-python" }
{ "listlengths": 1, "value": [ { "filename": "sort.py", "retrieved_chunk": "#!/usr/bin/env python\n# coding: utf-8\n\n\"\"\"\n The approach taken is explained below. I decided to do it simply.\n Initially I was considering parsing the data into some sort of\n structure and then generating a...
{ "stringclasses": "py", "value": "py" }
{ "int64": 130 }
{ "stringlengths": 560, "value": " inner_blocks[i] = '##' + inner_blocks[i]\n inner_blocks = ''.join(inner_blocks)\n\n # Replacing the non-sorted libraries by the sorted ones and gathering all at the final_README file\n blocks[0] = inner_blocks\n final_README = table_of_contents + '- - -' + '...
{ "stringlengths": 50, "value": " # Then we cluster the lines together as blocks" }
{ "stringlengths": 558, "value": " # Each block represents a collection of lines that should be sorted\n # This was done by assuming only links ([...](...)) are meant to be sorted\n # Clustering is done by indentation\n blocks = []\n last_indent = None\n for line in read_me:\n s_line = line...
{ "stringlengths": 35, "value": "./temp_repos/awesome-python\\sort.py" }
{ "stringlengths": 14, "value": "awesome-python" }
{ "listlengths": 1, "value": [ { "filename": "sort.py", "retrieved_chunk": "#!/usr/bin/env python\n# coding: utf-8\n\n\"\"\"\n The approach taken is explained below. I decided to do it simply.\n Initially I was considering parsing the data into some sort of\n structure and then generating a...
{ "stringclasses": "py", "value": "py" }
{ "int64": 131 }