mirror of
https://github.com/pre-commit/pre-commit-hooks.git
synced 2026-04-05 11:36:54 +00:00
159 lines
2.8 KiB
Text
159 lines
2.8 KiB
Text
{
|
|
"cells": [
|
|
{
|
|
"cell_type": "code",
|
|
"execution_count": 1,
|
|
"id": "1a4e6df0",
|
|
"metadata": {},
|
|
"outputs": [],
|
|
"source": [
|
|
"from typing import List, Dict"
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "code",
|
|
"execution_count": 2,
|
|
"id": "d72a909f",
|
|
"metadata": {},
|
|
"outputs": [],
|
|
"source": [
|
|
"def some_function(arg1: List[str], arg2: Dict[str, float]):\n",
|
|
" print(arg1)\n",
|
|
" return arg2"
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "markdown",
|
|
"id": "0040a4f4",
|
|
"metadata": {},
|
|
"source": [
|
|
"## Section 1"
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "code",
|
|
"execution_count": 3,
|
|
"id": "3a1b985c",
|
|
"metadata": {},
|
|
"outputs": [
|
|
{
|
|
"name": "stdout",
|
|
"output_type": "stream",
|
|
"text": [
|
|
"['a', 'b']\n"
|
|
]
|
|
}
|
|
],
|
|
"source": [
|
|
"a = some_function(['a', 'b'], {'c': 0.2})"
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "code",
|
|
"execution_count": 4,
|
|
"id": "2dfd7d0b",
|
|
"metadata": {},
|
|
"outputs": [],
|
|
"source": [
|
|
"assert 3 == 3"
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "markdown",
|
|
"id": "de5a89c9",
|
|
"metadata": {},
|
|
"source": [
|
|
"Here is a math formulas:\n",
|
|
"\n",
|
|
"$$c = \\sqrt{a^2 + b^2}$$"
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "code",
|
|
"execution_count": 5,
|
|
"id": "4952b6de",
|
|
"metadata": {},
|
|
"outputs": [],
|
|
"source": [
|
|
"def some_other_function() -> bool:\n",
|
|
" \"\"\"\n",
|
|
" Some docstring\n",
|
|
" \"\"\"\n",
|
|
" return False"
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "markdown",
|
|
"id": "bf1cb851",
|
|
"metadata": {},
|
|
"source": [
|
|
"There can be double quotes in non-code cells, like this: \"this\". These should not be changed to single quotes."
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "code",
|
|
"execution_count": 6,
|
|
"id": "01224536",
|
|
"metadata": {},
|
|
"outputs": [
|
|
{
|
|
"name": "stdout",
|
|
"output_type": "stream",
|
|
"text": [
|
|
"False\n"
|
|
]
|
|
}
|
|
],
|
|
"source": [
|
|
"print(some_other_function())"
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "markdown",
|
|
"id": "b54d0660",
|
|
"metadata": {},
|
|
"source": [
|
|
"There can also be double quotes in the cell output. Again, they should not be changed to single quotes."
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "code",
|
|
"execution_count": 7,
|
|
"id": "dc0edb11",
|
|
"metadata": {},
|
|
"outputs": [
|
|
{
|
|
"name": "stdout",
|
|
"output_type": "stream",
|
|
"text": [
|
|
"abcd\"efg\".\n"
|
|
]
|
|
}
|
|
],
|
|
"source": [
|
|
"print('abcd\"efg\".')"
|
|
]
|
|
}
|
|
],
|
|
"metadata": {
|
|
"kernelspec": {
|
|
"display_name": "Python 3 (ipykernel)",
|
|
"language": "python",
|
|
"name": "python3"
|
|
},
|
|
"language_info": {
|
|
"codemirror_mode": {
|
|
"name": "ipython",
|
|
"version": 3
|
|
},
|
|
"file_extension": ".py",
|
|
"mimetype": "text/x-python",
|
|
"name": "python",
|
|
"nbconvert_exporter": "python",
|
|
"pygments_lexer": "ipython3",
|
|
"version": "3.9.13"
|
|
}
|
|
},
|
|
"nbformat": 4,
|
|
"nbformat_minor": 5
|
|
}
|