From 31a62a02c0a34ac785e51529b73184b49cc21d26 Mon Sep 17 00:00:00 2001 From: "penify-dev[bot]" <146478655+penify-dev[bot]@users.noreply.github.com> Date: Tue, 3 Dec 2024 02:43:27 +0000 Subject: [PATCH 1/3] penify/config_25e84 master --- .../workflows/snorkell-auto-documentation.yml | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 .github/workflows/snorkell-auto-documentation.yml diff --git a/.github/workflows/snorkell-auto-documentation.yml b/.github/workflows/snorkell-auto-documentation.yml new file mode 100644 index 0000000..34c752f --- /dev/null +++ b/.github/workflows/snorkell-auto-documentation.yml @@ -0,0 +1,19 @@ +# This workflow will improvise current file with AI genereated documentation and Create new PR + +name: Penify - Revolutionizing Documentation on GitHub + +on: + push: + branches: ["master"] + workflow_dispatch: + +jobs: + Documentation: + runs-on: ubuntu-latest + steps: + - name: Penify DocGen Client + uses: SingularityX-ai/snorkell-documentation-client@v1.0.0 + with: + client_id: ${{ secrets.SNORKELL_CLIENT_ID }} + api_key: ${{ secrets.SNORKELL_API_KEY }} + branch_name: "master" \ No newline at end of file From b2a3fe3494aa85e5086785e82a3a9abb5edfa18c Mon Sep 17 00:00:00 2001 From: dbigman Date: Tue, 3 Dec 2024 00:02:52 -0300 Subject: [PATCH 2/3] my answers --- your-code/main.ipynb | 260 ++++++++++++++++++++++++++++++++++++++----- 1 file changed, 231 insertions(+), 29 deletions(-) diff --git a/your-code/main.ipynb b/your-code/main.ipynb index d584552..6d76f1f 100644 --- a/your-code/main.ipynb +++ b/your-code/main.ipynb @@ -11,7 +11,7 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 26, "metadata": {}, "outputs": [], "source": [ @@ -27,11 +27,20 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 27, "metadata": {}, - "outputs": [], + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50]\n" + ] + } + ], "source": [ - "#your code here" + "consecutive_integers = [i for i in range(1, 51)]\n", + "print(consecutive_integers)\n" ] }, { @@ -43,11 +52,21 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 28, "metadata": {}, - "outputs": [], + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "[2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28, 30, 32, 34, 36, 38, 40, 42, 44, 46, 48, 50, 52, 54, 56, 58, 60, 62, 64, 66, 68, 70, 72, 74, 76, 78, 80, 82, 84, 86, 88, 90, 92, 94, 96, 98, 100, 102, 104, 106, 108, 110, 112, 114, 116, 118, 120, 122, 124, 126, 128, 130, 132, 134, 136, 138, 140, 142, 144, 146, 148, 150, 152, 154, 156, 158, 160, 162, 164, 166, 168, 170, 172, 174, 176, 178, 180, 182, 184, 186, 188, 190, 192, 194, 196, 198, 200]\n" + ] + } + ], "source": [ - "#your code here" + "even_numbers_2_to_200 = [i for i in range(2, 201) if i % 2 == 0]\n", + "\n", + "print(even_numbers_2_to_200)" ] }, { @@ -59,7 +78,7 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 29, "metadata": {}, "outputs": [], "source": [ @@ -72,16 +91,78 @@ " [0.71725408, 0.87702738, 0.31244595, 0.76615487],\n", " [0.20754036, 0.57871812, 0.07214068, 0.40356048],\n", " [0.12149553, 0.53222417, 0.9976855 , 0.12536346],\n", - " [0.80930099, 0.50962849, 0.94555126, 0.33364763]];" + " [0.80930099, 0.50962849, 0.94555126, 0.33364763]]" ] }, { "cell_type": "code", - "execution_count": null, + "execution_count": 30, "metadata": {}, - "outputs": [], + "outputs": [ + { + "data": { + "text/plain": [ + "[0.84062117,\n", + " 0.48006452,\n", + " 0.7876326,\n", + " 0.77109654,\n", + " 0.44409793,\n", + " 0.09014516,\n", + " 0.81835917,\n", + " 0.87645456,\n", + " 0.7066597,\n", + " 0.09610873,\n", + " 0.41247947,\n", + " 0.57433389,\n", + " 0.29960807,\n", + " 0.42315023,\n", + " 0.34452557,\n", + " 0.4751035,\n", + " 0.17003563,\n", + " 0.46843998,\n", + " 0.92796258,\n", + " 0.69814654,\n", + " 0.41290051,\n", + " 0.19561071,\n", + " 0.16284783,\n", + " 0.97016248,\n", + " 0.71725408,\n", + " 0.87702738,\n", + " 0.31244595,\n", + " 0.76615487,\n", + " 0.20754036,\n", + " 0.57871812,\n", + " 0.07214068,\n", + " 0.40356048,\n", + " 0.12149553,\n", + " 0.53222417,\n", + " 0.9976855,\n", + " 0.12536346,\n", + " 0.80930099,\n", + " 0.50962849,\n", + " 0.94555126,\n", + " 0.33364763]" + ] + }, + "execution_count": 30, + "metadata": {}, + "output_type": "execute_result" + } + ], "source": [ - "#your code here" + "# print(len(a))\n", + "# print(len(a[0]))\n", + "# print(a[0][0])\n", + "\n", + "# array_list = []\n", + "\n", + "# for j in range(0, len(a)):\n", + "# array_list += [a[j][i] for i in range(0, len(a[0]))]\n", + " \n", + "# print(array_list)\n", + "\n", + "array_list = [element for row in a for element in row]\n", + "array_list\n" ] }, { @@ -93,11 +174,52 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 32, "metadata": {}, - "outputs": [], + "outputs": [ + { + "data": { + "text/plain": [ + "[0.84062117,\n", + " 0.7876326,\n", + " 0.77109654,\n", + " 0.81835917,\n", + " 0.87645456,\n", + " 0.7066597,\n", + " 0.57433389,\n", + " 0.92796258,\n", + " 0.69814654,\n", + " 0.97016248,\n", + " 0.71725408,\n", + " 0.87702738,\n", + " 0.76615487,\n", + " 0.57871812,\n", + " 0.53222417,\n", + " 0.9976855,\n", + " 0.80930099,\n", + " 0.50962849,\n", + " 0.94555126]" + ] + }, + "execution_count": 32, + "metadata": {}, + "output_type": "execute_result" + } + ], "source": [ - "#your code here" + "# print(len(a))\n", + "# print(len(a[0]))\n", + "# print(a[0][0])\n", + "\n", + "# array_list = []\n", + "\n", + "# for j in range(0, len(a)):\n", + "# array_list += [a[j][i] for i in range(0, len(a[0]))]\n", + " \n", + "# print(array_list)\n", + "\n", + "array_list_greater_than_ = [element for row in a for element in row if element > 0.5]\n", + "array_list_greater_than_" ] }, { @@ -109,7 +231,7 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 34, "metadata": {}, "outputs": [], "source": [ @@ -131,11 +253,25 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 38, "metadata": {}, - "outputs": [], + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "[0.55867166, 0.06210792, 0.08147297, 0.82579068, 0.91512478, 0.06833034, 0.05440634, 0.65857693, 0.30296619, 0.06769833, 0.96031863, 0.51293743, 0.09143215, 0.71893382, 0.45850679, 0.58256464, 0.59005654, 0.56266457, 0.71600294, 0.87392666, 0.11434044, 0.8694668, 0.65669313, 0.10708681, 0.07529684, 0.46470767, 0.47984544, 0.65368638, 0.14901286, 0.23760688]\n" + ] + } + ], "source": [ - "#your code here" + "# b1 = [element for row in b for element in row]\n", + "# array_list_b = [element for row in b1 for element in row]\n", + "\n", + "array_list_b = [element for b1 in b for row in b1 for element in row]\n", + "\n", + "\n", + "print(array_list_b)\n" ] }, { @@ -147,11 +283,20 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 39, "metadata": {}, - "outputs": [], + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "[0.06210792, 0.08147297, 0.06833034, 0.05440634, 0.30296619, 0.06769833, 0.09143215, 0.45850679, 0.11434044, 0.10708681, 0.07529684, 0.46470767, 0.47984544, 0.14901286, 0.23760688]\n" + ] + } + ], "source": [ - "#your code here" + "array_list_b_less_than_ = [element for b1 in b for row in b1 for element in row if element <= 0.5]\n", + "print(array_list_b_less_than_)" ] }, { @@ -187,11 +332,73 @@ "**Advanced**\n", "- [Queue time counter](https://www.codewars.com/kata/queue-time-counter)" ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Description:\n", + "Given a set of numbers, return the additive inverse of each. Each positive becomes negatives, and the negatives become positives.\n", + "\n", + "[1, 2, 3, 4, 5] --> [-1, -2, -3, -4, -5]\n", + "[1, -2, 3, -4, 5] --> [-1, 2, -3, 4, -5]\n", + "[] --> []" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "{0, 2, 12, 16, 21, 25, 28, 29, -99, 30, -96, -95, 31, -93, -100, 32, 38, 39, -88, -91, 42, -83, 46, 45, -79, 52, -74, 55, 59, -68, -67, -66, 65, 66, -61, 68, 67, -55, 73, -53, -52, -51, 78, -49, 75, -44, -43, 87, 88, -41, 90, -36, 94, 96, -31, 97, 99, 100, -26, -23, -21, -16, -14, -11, -10, -9, -8, -7, -6, -5, -2}\n", + "[0, -2, -12, -16, -21, -25, -28, -29, 99, -30, 96, 95, -31, 93, 100, -32, -38, -39, 88, 91, -42, 83, -46, -45, 79, -52, 74, -55, -59, 68, 67, 66, -65, -66, 61, -68, -67, 55, -73, 53, 52, 51, -78, 49, -75, 44, 43, -87, -88, 41, -90, 36, -94, -96, 31, -97, -99, -100, 26, 23, 21, 16, 14, 11, 10, 9, 8, 7, 6, 5, 2]\n" + ] + } + ], + "source": [ + "# Generate a set of random integers\n", + "import random\n", + "\n", + "random_integers = {random.randint(-100, 100) for _ in range(random.randint(1,100))} # Generate a random amount of unique random integers\n", + "\n", + "\n", + "\n", + "additive_inverse = [-1 * i for i in random_integers]\n", + "print(random_integers)\n", + "print(additive_inverse)\n", + "\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Description:\n", + "Given an array of integers.\n", + "\n", + "Return an array, where the first element is the count of positives numbers and the second element is sum of negative numbers. 0 is neither positive nor negative.\n", + "\n", + "If the input is an empty array or is null, return an empty array.\n", + "\n", + "Example\n", + "For input [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, -11, -12, -13, -14, -15], you should return [10, -65]." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [] } ], "metadata": { "kernelspec": { - "display_name": "Python 3 (ipykernel)", + "display_name": "Python 3", "language": "python", "name": "python3" }, @@ -205,12 +412,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.9.13" - }, - "vscode": { - "interpreter": { - "hash": "aee8b7b246df8f9039afb4144a1f6fd8d2ca17a180786b69acc140d282b71a49" - } + "version": "3.10.10" } }, "nbformat": 4, From 961ddc23a1993dec265434398ac4230969485eac Mon Sep 17 00:00:00 2001 From: dbigman Date: Tue, 3 Dec 2024 16:30:57 -0400 Subject: [PATCH 3/3] update to 6 --- your-code/main.ipynb | 27 ++++++++++++++------------- 1 file changed, 14 insertions(+), 13 deletions(-) diff --git a/your-code/main.ipynb b/your-code/main.ipynb index 6d76f1f..e91709c 100644 --- a/your-code/main.ipynb +++ b/your-code/main.ipynb @@ -11,7 +11,7 @@ }, { "cell_type": "code", - "execution_count": 26, + "execution_count": 2, "metadata": {}, "outputs": [], "source": [ @@ -27,7 +27,7 @@ }, { "cell_type": "code", - "execution_count": 27, + "execution_count": 3, "metadata": {}, "outputs": [ { @@ -52,7 +52,7 @@ }, { "cell_type": "code", - "execution_count": 28, + "execution_count": 4, "metadata": {}, "outputs": [ { @@ -78,7 +78,7 @@ }, { "cell_type": "code", - "execution_count": 29, + "execution_count": 5, "metadata": {}, "outputs": [], "source": [ @@ -96,7 +96,7 @@ }, { "cell_type": "code", - "execution_count": 30, + "execution_count": 6, "metadata": {}, "outputs": [ { @@ -144,7 +144,7 @@ " 0.33364763]" ] }, - "execution_count": 30, + "execution_count": 6, "metadata": {}, "output_type": "execute_result" } @@ -174,7 +174,7 @@ }, { "cell_type": "code", - "execution_count": 32, + "execution_count": 7, "metadata": {}, "outputs": [ { @@ -201,7 +201,7 @@ " 0.94555126]" ] }, - "execution_count": 32, + "execution_count": 7, "metadata": {}, "output_type": "execute_result" } @@ -231,7 +231,7 @@ }, { "cell_type": "code", - "execution_count": 34, + "execution_count": 8, "metadata": {}, "outputs": [], "source": [ @@ -253,7 +253,7 @@ }, { "cell_type": "code", - "execution_count": 38, + "execution_count": 9, "metadata": {}, "outputs": [ { @@ -283,19 +283,20 @@ }, { "cell_type": "code", - "execution_count": 39, + "execution_count": 12, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ - "[0.06210792, 0.08147297, 0.06833034, 0.05440634, 0.30296619, 0.06769833, 0.09143215, 0.45850679, 0.11434044, 0.10708681, 0.07529684, 0.46470767, 0.47984544, 0.14901286, 0.23760688]\n" + "[0.08147297, 0.06833034, 0.30296619, 0.45850679, 0.11434044, 0.10708681, 0.47984544, 0.23760688]\n" ] } ], "source": [ - "array_list_b_less_than_ = [element for b1 in b for row in b1 for element in row if element <= 0.5]\n", + "# array_list_b_less_than_ = [element for b1 in b for row in b1 for element in row if element <= 0.5]\n", + "array_list_b_less_than_ = [row[-1] for b1 in b for row in b1 if row[-1] <= 0.5]\n", "print(array_list_b_less_than_)" ] },