-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpython.json
More file actions
220 lines (219 loc) · 7.82 KB
/
python.json
File metadata and controls
220 lines (219 loc) · 7.82 KB
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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
{
"main": {
"prefix": "main",
"body": [
"# from typing import Any, Callable, Dict, List, Optional, Tuple, Union",
"\n\ndef main():\n\t...\n\n\nif __name__ == \"__main__\":\n\tmain()\n"
],
"description": "Code snippet for main function"
},
"ifmain": {
"prefix": "ifmain",
"body": ["if __name__ == \"__main__\":\n\t...\n"],
"description": "Code snippet for a `if __name__ == \"__main__\": ...` block"
},
"new class": {
"prefix": "nclass",
"body": ["class ${1:Classname}:\n\n\tdef __init__(self):\n\t\t...\n\n"],
"description": "Code snippet for a new class definition"
},
"from data": {
"prefix": "fromdata",
"body": ["from dataclasses import dataclass"],
"description": "Code snippet for import dataclass"
},
"new data": {
"prefix": "ndata",
"body": ["@dataclass\nclass ${1:DataClassname}:\n\t...\n\n"],
"description": "Code snippet for new dataclass definition"
},
"s": {
"prefix": "s",
"body": ["self.$0"],
"description": "Code snippet for slef"
},
"new enum": {
"prefix": "enum",
"body": [
"from enum import Enum\n\n",
"class ${1:EnumName}(Enum):",
"\t${2:_} = ...",
"\t$0"
],
"description": "Code snippet for enum definition"
},
"from import": {
"prefix": "fim",
"body": "from ${1:package/module} import ${2:names}$0",
"description" : "Code snippet for import"
},
"aep": {
"prefix": "aep",
"body": [
"\"\"\"AyudaEnPython: https://www.facebook.com/groups/ayudapython",
"\"\"\"\n$0"
],
"description": "Code snippet for aep"
},
"solver": {
"prefix": "sol",
"body": [
"from typing import Any, Callable, Dict, List, Optional, Tuple, Union",
"from unittest import main, TestCase\n\n",
"def solver():\n\t...\n\n\ndef main_():\n\t...\n\n",
"class Test(TestCase):\n\n\tdef test_solver():\n\t\t...\n\n",
"if __name__ == \"__main__\":",
"\t# main()",
"\tmain_()"
],
"description": "Code snippet for template 'sol'"
},
"if": {
"prefix": "if",
"body": ["if ${1:expression}:", "\t${2:pass}"],
"description": "Code snippet for an if statement"
},
"if/else": {
"prefix": "if/else",
"body": ["if ${1:condition}:", "\t${2:pass}", "else:", "\t${3:pass}"],
"description": "Code snippet for an if statement with else"
},
"elif": {
"prefix": "elif",
"body": ["elif ${1:expression}:", "\t${2:pass}"],
"description": "Code snippet for an elif"
},
"else": {
"prefix": "else",
"body": ["else:", "\t${1:pass}"],
"description": "Code snippet for an else"
},
"while": {
"prefix": "while",
"body": ["while ${1:expression}:", "\t${2:pass}"],
"description": "Code snippet for a while loop"
},
"while/else": {
"prefix": "while/else",
"body": ["while ${1:expression}:", "\t${2:pass}", "else:", "\t${3:pass}"],
"description": "Code snippet for a while loop with else"
},
"for": {
"prefix": "for",
"body": ["for ${1:target_list} in ${2:expression_list}:", "\t${3:pass}"],
"description": "Code snippet for a for loop"
},
"for/else": {
"prefix": "for/else",
"body": ["for ${1:target_list} in ${2:expression_list}:", "\t${3:pass}", "else:", "\t${4:pass}"],
"description": "Code snippet for a for loop with else"
},
"try/except": {
"prefix": "try/except",
"body": ["try:", "\t${1:pass}", "except ${2:expression} as ${3:identifier}:", "\t${4:pass}"],
"description": "Code snippet for a try/except statement"
},
"try/finally": {
"prefix": "try/finally",
"body": ["try:", "\t${1:pass}", "finally:", "\t${2:pass}"],
"description": "Code snippet for a try/finally statement"
},
"try/except/else": {
"prefix": "try/except/else",
"body": [
"try:",
"\t${1:pass}",
"except ${2:expression} as ${3:identifier}:",
"\t${4:pass}",
"else:",
"\t${5:pass}"
],
"description": "Code snippet for a try/except/else statement"
},
"try/except/finally": {
"prefix": "try/except/finally",
"body": [
"try:",
"\t${1:pass}",
"except ${2:expression} as ${3:identifier}:",
"\t${4:pass}",
"finally:",
"\t${5:pass}"
],
"description": "Code snippet for a try/except/finally statement"
},
"try/except/else/finally": {
"prefix": "try/except/else/finally",
"body": [
"try:",
"\t${1:pass}",
"except ${2:expression} as ${3:identifier}:",
"\t${4:pass}",
"else:",
"\t${5:pass}",
"finally:",
"\t${6:pass}"
],
"description": "Code snippet for a try/except/else/finally statement"
},
"with": {
"prefix": "with",
"body": ["with ${1:expression} as ${2:target}:", "\t${3:pass}"],
"description": "Code snippet for a with statement"
},
"def": {
"prefix": "def",
"body": ["def ${1:funcname}(${2:parameter_list}):", "\t\"\"\"", "\t${3:docstring}", "\t\"\"\"","\t${4:pass}"],
"description": "Code snippet for a function definition"
},
"def(class method)": {
"prefix": "def(class method)",
"body": ["def ${1:funcname}(self, ${2:parameter_list}):", "\t\"\"\"", "\t${3:docstring}", "\t\"\"\"", "\t${4:pass}"],
"description": "Code snippet for a class method"
},
"def(static class method)": {
"prefix": "def(static class method)",
"body": ["@staticmethod", "def ${1:funcname}(${2:parameter_list}):", "\t\"\"\"", "\t${3:docstring}", "\t\"\"\"", "\t${4:pass}"],
"description": "Code snippet for a static class method"
},
"def(abstract class method)": {
"prefix": "def(abstract class method)",
"body": ["def ${1:funcname}(self, ${2:parameter_list}):", "\t\"\"\"", "\t${3:docstring}", "\t\"\"\"", "\traise NotImplementedError"],
"description": "Code snippet for an abstract class method"
},
"class": {
"prefix": "class",
"body": ["class ${1:classname}(${2:object}):", "\t\"\"\"", "\t${3:docstring}", "\t\"\"\"", "\t${4:pass}"],
"description": "Code snippet for a class definition"
},
"lambda": {
"prefix": "lambda",
"body": ["lambda ${1:parameter_list}: ${2:expression}"],
"description": "Code snippet for a lambda statement"
},
"if(main)": {
"prefix": "__main__",
"body": ["if __name__ == \"__main__\":", " ${1:pass}"],
"description": "Code snippet for a `if __name__ == \"__main__\": ...` block"
},
"async/def": {
"prefix": "async/def",
"body": ["async def ${1:funcname}(${2:parameter_list}):", "\t${3:pass}"],
"description": "Code snippet for an async statement"
},
"async/for": {
"prefix": "async/for",
"body": ["async for ${1:target} in ${2:iter}:", "\t${3:block}"],
"description": "Code snippet for an async for statement"
},
"async/for/else": {
"prefix": "async/for/else",
"body": ["async for ${1:target} in ${2:iter}:", "\t${3:block}", "else:", "\t${4:block}"],
"description": "Code snippet for an async for statement with else"
},
"async/with": {
"prefix": "async/with",
"body": ["async with ${1:expr} as ${2:var}:", "\t${3:block}"],
"description": "Code snippet for an async with statement"
}
}