nwo stringlengths 5 58 | sha stringlengths 40 40 | path stringlengths 5 172 | language stringclasses 1
value | identifier stringlengths 1 100 | parameters stringlengths 2 3.5k | argument_list stringclasses 1
value | return_statement stringlengths 0 21.5k | docstring stringlengths 2 17k | docstring_summary stringlengths 0 6.58k | docstring_tokens sequence | function stringlengths 35 55.6k | function_tokens sequence | url stringlengths 89 269 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
redapple0204/my-boring-python | 1ab378e9d4f39ad920ff542ef3b2db68f0575a98 | pythonenv3.8/lib/python3.8/site-packages/pip/_vendor/ipaddress.py | python | _BaseNetwork.num_addresses | (self) | return int(self.broadcast_address) - int(self.network_address) + 1 | Number of hosts in the current subnet. | Number of hosts in the current subnet. | [
"Number",
"of",
"hosts",
"in",
"the",
"current",
"subnet",
"."
] | def num_addresses(self):
"""Number of hosts in the current subnet."""
return int(self.broadcast_address) - int(self.network_address) + 1 | [
"def",
"num_addresses",
"(",
"self",
")",
":",
"return",
"int",
"(",
"self",
".",
"broadcast_address",
")",
"-",
"int",
"(",
"self",
".",
"network_address",
")",
"+",
"1"
] | https://github.com/redapple0204/my-boring-python/blob/1ab378e9d4f39ad920ff542ef3b2db68f0575a98/pythonenv3.8/lib/python3.8/site-packages/pip/_vendor/ipaddress.py#L847-L849 | |
facebookarchive/nuclide | 2a2a0a642d136768b7d2a6d35a652dc5fb77d70a | modules/atom-ide-debugger-python/VendorLib/vs-py-debugger/pythonFiles/experimental/ptvsd/ptvsd/_vendored/pydevd/pydevd_attach_to_process/winappdbg/thread.py | python | Thread.get_stack_trace_with_labels | (self, depth = 16, bMakePretty = True) | return trace | Tries to get a stack trace for the current function.
Only works for functions with standard prologue and epilogue.
@type depth: int
@param depth: Maximum depth of stack trace.
@type bMakePretty: bool
@param bMakePretty:
C{True} for user readable labels,
... | Tries to get a stack trace for the current function.
Only works for functions with standard prologue and epilogue. | [
"Tries",
"to",
"get",
"a",
"stack",
"trace",
"for",
"the",
"current",
"function",
".",
"Only",
"works",
"for",
"functions",
"with",
"standard",
"prologue",
"and",
"epilogue",
"."
] | def get_stack_trace_with_labels(self, depth = 16, bMakePretty = True):
"""
Tries to get a stack trace for the current function.
Only works for functions with standard prologue and epilogue.
@type depth: int
@param depth: Maximum depth of stack trace.
@type bMakePretty... | [
"def",
"get_stack_trace_with_labels",
"(",
"self",
",",
"depth",
"=",
"16",
",",
"bMakePretty",
"=",
"True",
")",
":",
"try",
":",
"trace",
"=",
"self",
".",
"__get_stack_trace",
"(",
"depth",
",",
"True",
",",
"bMakePretty",
")",
"except",
"Exception",
":... | https://github.com/facebookarchive/nuclide/blob/2a2a0a642d136768b7d2a6d35a652dc5fb77d70a/modules/atom-ide-debugger-python/VendorLib/vs-py-debugger/pythonFiles/experimental/ptvsd/ptvsd/_vendored/pydevd/pydevd_attach_to_process/winappdbg/thread.py#L1258-L1286 | |
Opentrons/opentrons | 466e0567065d8773a81c25cd1b5c7998e00adf2c | api/src/opentrons/hardware_control/api.py | python | API.resume | (self, pause_type: PauseType) | Resume motion after a call to :py:meth:`pause`. | Resume motion after a call to :py:meth:`pause`. | [
"Resume",
"motion",
"after",
"a",
"call",
"to",
":",
"py",
":",
"meth",
":",
"pause",
"."
] | def resume(self, pause_type: PauseType):
"""
Resume motion after a call to :py:meth:`pause`.
"""
self._pause_manager.resume(pause_type)
if self._pause_manager.should_pause:
return
# Resume must be called immediately to awaken thread running hardware
... | [
"def",
"resume",
"(",
"self",
",",
"pause_type",
":",
"PauseType",
")",
":",
"self",
".",
"_pause_manager",
".",
"resume",
"(",
"pause_type",
")",
"if",
"self",
".",
"_pause_manager",
".",
"should_pause",
":",
"return",
"# Resume must be called immediately to awak... | https://github.com/Opentrons/opentrons/blob/466e0567065d8773a81c25cd1b5c7998e00adf2c/api/src/opentrons/hardware_control/api.py#L639-L657 | ||
webrtc/apprtc | db975e22ea07a0c11a4179d4beb2feb31cf344f4 | src/third_party/oauth2client/client.py | python | OAuth2WebServerFlow.step2_exchange | (self, code, http=None) | Exhanges a code for OAuth2Credentials.
Args:
code: string or dict, either the code as a string, or a dictionary
of the query parameters to the redirect_uri, which contains
the code.
http: httplib2.Http, optional http instance to use to do the fetch
Returns:
An OAuth2Credentia... | Exhanges a code for OAuth2Credentials. | [
"Exhanges",
"a",
"code",
"for",
"OAuth2Credentials",
"."
] | def step2_exchange(self, code, http=None):
"""Exhanges a code for OAuth2Credentials.
Args:
code: string or dict, either the code as a string, or a dictionary
of the query parameters to the redirect_uri, which contains
the code.
http: httplib2.Http, optional http instance to use to d... | [
"def",
"step2_exchange",
"(",
"self",
",",
"code",
",",
"http",
"=",
"None",
")",
":",
"if",
"not",
"(",
"isinstance",
"(",
"code",
",",
"str",
")",
"or",
"isinstance",
"(",
"code",
",",
"unicode",
")",
")",
":",
"if",
"'code'",
"not",
"in",
"code"... | https://github.com/webrtc/apprtc/blob/db975e22ea07a0c11a4179d4beb2feb31cf344f4/src/third_party/oauth2client/client.py#L1237-L1310 | ||
axa-group/Parsr | 3a2193b15c56a8fbcafe5efbddd83adbb0f8fd9d | clients/python-client/parsr_client/parsr_client.py | python | ParsrClient.set_server | (self, server: str) | Setter for the Parsr server's address | Setter for the Parsr server's address | [
"Setter",
"for",
"the",
"Parsr",
"server",
"s",
"address"
] | def set_server(self, server: str):
"""Setter for the Parsr server's address
"""
self.server = server | [
"def",
"set_server",
"(",
"self",
",",
"server",
":",
"str",
")",
":",
"self",
".",
"server",
"=",
"server"
] | https://github.com/axa-group/Parsr/blob/3a2193b15c56a8fbcafe5efbddd83adbb0f8fd9d/clients/python-client/parsr_client/parsr_client.py#L58-L61 | ||
prometheus-ar/vot.ar | 72d8fa1ea08fe417b64340b98dff68df8364afdf | msa/core/armve/protocol.py | python | Printer.do_print | (self) | Envia el comando CMD_PRINTER_PRINT al ARM. | Envia el comando CMD_PRINTER_PRINT al ARM. | [
"Envia",
"el",
"comando",
"CMD_PRINTER_PRINT",
"al",
"ARM",
"."
] | def do_print(self):
"""Envia el comando CMD_PRINTER_PRINT al ARM."""
self._send_command(CMD_PRINTER_PRINT) | [
"def",
"do_print",
"(",
"self",
")",
":",
"self",
".",
"_send_command",
"(",
"CMD_PRINTER_PRINT",
")"
] | https://github.com/prometheus-ar/vot.ar/blob/72d8fa1ea08fe417b64340b98dff68df8364afdf/msa/core/armve/protocol.py#L1458-L1460 | ||
sagemath/cloud | 054854b87817edfa95e9044c793059bddc361e67 | sage_salvus.py | python | exercise | (code) | r"""
Use the %exercise cell decorator to create interactive exercise
sets. Put %exercise at the top of the cell, then write Sage code
in the cell that defines the following (all are optional):
- a ``question`` variable, as an HTML string with math in dollar
signs
- an ``answer`` variable, w... | r"""
Use the %exercise cell decorator to create interactive exercise
sets. Put %exercise at the top of the cell, then write Sage code
in the cell that defines the following (all are optional): | [
"r",
"Use",
"the",
"%exercise",
"cell",
"decorator",
"to",
"create",
"interactive",
"exercise",
"sets",
".",
"Put",
"%exercise",
"at",
"the",
"top",
"of",
"the",
"cell",
"then",
"write",
"Sage",
"code",
"in",
"the",
"cell",
"that",
"defines",
"the",
"follo... | def exercise(code):
r"""
Use the %exercise cell decorator to create interactive exercise
sets. Put %exercise at the top of the cell, then write Sage code
in the cell that defines the following (all are optional):
- a ``question`` variable, as an HTML string with math in dollar
signs
- a... | [
"def",
"exercise",
"(",
"code",
")",
":",
"f",
"=",
"closure",
"(",
"code",
")",
"def",
"g",
"(",
")",
":",
"x",
"=",
"f",
"(",
")",
"return",
"x",
".",
"get",
"(",
"'title'",
",",
"''",
")",
",",
"x",
".",
"get",
"(",
"'question'",
",",
"'... | https://github.com/sagemath/cloud/blob/054854b87817edfa95e9044c793059bddc361e67/sage_salvus.py#L2498-L2617 | ||
kemayo/maphilight | e00d927f648c00b634470bc6c4750378b4953cc0 | tools/parse_path.py | python | Sequence | (token) | return OneOrMore(token + maybeComma) | A sequence of the token | A sequence of the token | [
"A",
"sequence",
"of",
"the",
"token"
] | def Sequence(token):
""" A sequence of the token"""
return OneOrMore(token + maybeComma) | [
"def",
"Sequence",
"(",
"token",
")",
":",
"return",
"OneOrMore",
"(",
"token",
"+",
"maybeComma",
")"
] | https://github.com/kemayo/maphilight/blob/e00d927f648c00b634470bc6c4750378b4953cc0/tools/parse_path.py#L25-L27 | |
openwisp/openwisp-controller | 0bfda7a28c86092f165b177c551c07babcb40630 | openwisp_controller/subnet_division/rule_types/base.py | python | BaseSubnetDivisionRuleType.should_create_subnets_ips | (cls, instance, **kwargs) | return a boolean value whether subnets and IPs should
be provisioned for "instance" object | return a boolean value whether subnets and IPs should
be provisioned for "instance" object | [
"return",
"a",
"boolean",
"value",
"whether",
"subnets",
"and",
"IPs",
"should",
"be",
"provisioned",
"for",
"instance",
"object"
] | def should_create_subnets_ips(cls, instance, **kwargs):
"""
return a boolean value whether subnets and IPs should
be provisioned for "instance" object
"""
raise NotImplementedError() | [
"def",
"should_create_subnets_ips",
"(",
"cls",
",",
"instance",
",",
"*",
"*",
"kwargs",
")",
":",
"raise",
"NotImplementedError",
"(",
")"
] | https://github.com/openwisp/openwisp-controller/blob/0bfda7a28c86092f165b177c551c07babcb40630/openwisp_controller/subnet_division/rule_types/base.py#L99-L104 | ||
sbrshk/whatever | f7ba72effd6f836ca701ed889c747db804d5ea8f | node_modules/node-gyp/gyp/pylib/gyp/generator/android.py | python | AndroidMkWriter.ComputeAndroidModule | (self, spec) | return ''.join([prefix, middle, suffix]) | Return the Android module name used for a gyp spec.
We use the complete qualified target name to avoid collisions between
duplicate targets in different directories. We also add a suffix to
distinguish gyp-generated module names. | Return the Android module name used for a gyp spec. | [
"Return",
"the",
"Android",
"module",
"name",
"used",
"for",
"a",
"gyp",
"spec",
"."
] | def ComputeAndroidModule(self, spec):
"""Return the Android module name used for a gyp spec.
We use the complete qualified target name to avoid collisions between
duplicate targets in different directories. We also add a suffix to
distinguish gyp-generated module names.
"""
if int(spec.get('an... | [
"def",
"ComputeAndroidModule",
"(",
"self",
",",
"spec",
")",
":",
"if",
"int",
"(",
"spec",
".",
"get",
"(",
"'android_unmangled_name'",
",",
"0",
")",
")",
":",
"assert",
"self",
".",
"type",
"!=",
"'shared_library'",
"or",
"self",
".",
"target",
".",
... | https://github.com/sbrshk/whatever/blob/f7ba72effd6f836ca701ed889c747db804d5ea8f/node_modules/node-gyp/gyp/pylib/gyp/generator/android.py#L585-L614 | |
Nexedi/erp5 | 44df1959c0e21576cf5e9803d602d95efb4b695b | bt5/erp5_big_file/DocumentTemplateItem/portal_components/document.erp5.BigFile.py | python | BigFile._appendData | (self, data_chunk, content_type=None) | append data chunk to the end of the file
NOTE if content_type is specified, it will change content_type for the
whole file. | append data chunk to the end of the file | [
"append",
"data",
"chunk",
"to",
"the",
"end",
"of",
"the",
"file"
] | def _appendData(self, data_chunk, content_type=None):
"""append data chunk to the end of the file
NOTE if content_type is specified, it will change content_type for the
whole file.
"""
data, size = self._read_data(data_chunk, data=self._baseGetData())
content_type=self._get_content_t... | [
"def",
"_appendData",
"(",
"self",
",",
"data_chunk",
",",
"content_type",
"=",
"None",
")",
":",
"data",
",",
"size",
"=",
"self",
".",
"_read_data",
"(",
"data_chunk",
",",
"data",
"=",
"self",
".",
"_baseGetData",
"(",
")",
")",
"content_type",
"=",
... | https://github.com/Nexedi/erp5/blob/44df1959c0e21576cf5e9803d602d95efb4b695b/bt5/erp5_big_file/DocumentTemplateItem/portal_components/document.erp5.BigFile.py#L398-L407 | ||
GoogleCloudPlatform/PerfKitExplorer | 9efa61015d50c25f6d753f0212ad3bf16876d496 | server/perfkit/explorer/samples_mart/explorer_method.py | python | ExplorerQueryBase.__init__ | (self, data_client=None, dataset_name=None) | Create credentials and storage service.
If a data_client is not provided, a credential_file will be used to get
a data connection.
Args:
data_client: A class that provides data connectivity. Typically a
BigQueryClient instance or specialization.
dataset_name: The name of the BigQuer... | Create credentials and storage service. | [
"Create",
"credentials",
"and",
"storage",
"service",
"."
] | def __init__(self, data_client=None, dataset_name=None):
"""Create credentials and storage service.
If a data_client is not provided, a credential_file will be used to get
a data connection.
Args:
data_client: A class that provides data connectivity. Typically a
BigQueryClient instanc... | [
"def",
"__init__",
"(",
"self",
",",
"data_client",
"=",
"None",
",",
"dataset_name",
"=",
"None",
")",
":",
"self",
".",
"_data_client",
"=",
"data_client",
"self",
".",
"dataset_name",
"=",
"dataset_name",
"or",
"big_query_client",
".",
"DATASET_ID",
"self",... | https://github.com/GoogleCloudPlatform/PerfKitExplorer/blob/9efa61015d50c25f6d753f0212ad3bf16876d496/server/perfkit/explorer/samples_mart/explorer_method.py#L49-L63 | ||
replit-archive/jsrepl | 36d79b6288ca5d26208e8bade2a168c6ebcb2376 | extern/python/closured/lib/python2.7/difflib.py | python | unified_diff | (a, b, fromfile='', tofile='', fromfiledate='',
tofiledate='', n=3, lineterm='\n') | r"""
Compare two sequences of lines; generate the delta as a unified diff.
Unified diffs are a compact way of showing line changes and a few
lines of context. The number of context lines is set by 'n' which
defaults to three.
By default, the diff control lines (those with ---, +++, or @@) are
... | r"""
Compare two sequences of lines; generate the delta as a unified diff. | [
"r",
"Compare",
"two",
"sequences",
"of",
"lines",
";",
"generate",
"the",
"delta",
"as",
"a",
"unified",
"diff",
"."
] | def unified_diff(a, b, fromfile='', tofile='', fromfiledate='',
tofiledate='', n=3, lineterm='\n'):
r"""
Compare two sequences of lines; generate the delta as a unified diff.
Unified diffs are a compact way of showing line changes and a few
lines of context. The number of context line... | [
"def",
"unified_diff",
"(",
"a",
",",
"b",
",",
"fromfile",
"=",
"''",
",",
"tofile",
"=",
"''",
",",
"fromfiledate",
"=",
"''",
",",
"tofiledate",
"=",
"''",
",",
"n",
"=",
"3",
",",
"lineterm",
"=",
"'\\n'",
")",
":",
"started",
"=",
"False",
"... | https://github.com/replit-archive/jsrepl/blob/36d79b6288ca5d26208e8bade2a168c6ebcb2376/extern/python/closured/lib/python2.7/difflib.py#L1158-L1223 | ||
oldj/SwitchHosts | d0eb2321fe36780ec32c914cbc69a818fc1918d3 | alfred/workflow/web.py | python | request | (method, url, params=None, data=None, headers=None, cookies=None,
files=None, auth=None, timeout=60, allow_redirects=False,
stream=False) | return Response(req, stream) | Initiate an HTTP(S) request. Returns :class:`Response` object.
:param method: 'GET' or 'POST'
:type method: unicode
:param url: URL to open
:type url: unicode
:param params: mapping of URL parameters
:type params: dict
:param data: mapping of form data ``{'field_name': 'value'}`` or
... | Initiate an HTTP(S) request. Returns :class:`Response` object. | [
"Initiate",
"an",
"HTTP",
"(",
"S",
")",
"request",
".",
"Returns",
":",
"class",
":",
"Response",
"object",
"."
] | def request(method, url, params=None, data=None, headers=None, cookies=None,
files=None, auth=None, timeout=60, allow_redirects=False,
stream=False):
"""Initiate an HTTP(S) request. Returns :class:`Response` object.
:param method: 'GET' or 'POST'
:type method: unicode
:param url... | [
"def",
"request",
"(",
"method",
",",
"url",
",",
"params",
"=",
"None",
",",
"data",
"=",
"None",
",",
"headers",
"=",
"None",
",",
"cookies",
"=",
"None",
",",
"files",
"=",
"None",
",",
"auth",
"=",
"None",
",",
"timeout",
"=",
"60",
",",
"all... | https://github.com/oldj/SwitchHosts/blob/d0eb2321fe36780ec32c914cbc69a818fc1918d3/alfred/workflow/web.py#L482-L591 | |
redapple0204/my-boring-python | 1ab378e9d4f39ad920ff542ef3b2db68f0575a98 | pythonenv3.8/lib/python3.8/site-packages/pip/_internal/utils/temp_dir.py | python | TempDirectory.create | (self) | Create a temporary directory and store its path in self.path | Create a temporary directory and store its path in self.path | [
"Create",
"a",
"temporary",
"directory",
"and",
"store",
"its",
"path",
"in",
"self",
".",
"path"
] | def create(self):
"""Create a temporary directory and store its path in self.path
"""
if self.path is not None:
logger.debug(
"Skipped creation of temporary directory: {}".format(self.path)
)
return
# We realpath here because some syste... | [
"def",
"create",
"(",
"self",
")",
":",
"if",
"self",
".",
"path",
"is",
"not",
"None",
":",
"logger",
".",
"debug",
"(",
"\"Skipped creation of temporary directory: {}\"",
".",
"format",
"(",
"self",
".",
"path",
")",
")",
"return",
"# We realpath here becaus... | https://github.com/redapple0204/my-boring-python/blob/1ab378e9d4f39ad920ff542ef3b2db68f0575a98/pythonenv3.8/lib/python3.8/site-packages/pip/_internal/utils/temp_dir.py#L62-L77 | ||
mdipierro/web2py-appliances | f97658293d51519e5f06e1ed503ee85f8154fcf3 | FacebookConnectExample/modules/plugin_fbconnect/facebook.py | python | PhotosProxy.upload | (self, image, aid=None, caption=None, size=(604, 1024)) | return self._client._parse_response(response, 'facebook.photos.upload') | Facebook API call. See http://developers.facebook.com/documentation.php?v=1.0&method=photos.upload
size -- an optional size (width, height) to resize the image to before uploading. Resizes by default
to Facebook's maximum display width of 604. | Facebook API call. See http://developers.facebook.com/documentation.php?v=1.0&method=photos.upload | [
"Facebook",
"API",
"call",
".",
"See",
"http",
":",
"//",
"developers",
".",
"facebook",
".",
"com",
"/",
"documentation",
".",
"php?v",
"=",
"1",
".",
"0&method",
"=",
"photos",
".",
"upload"
] | def upload(self, image, aid=None, caption=None, size=(604, 1024)):
"""Facebook API call. See http://developers.facebook.com/documentation.php?v=1.0&method=photos.upload
size -- an optional size (width, height) to resize the image to before uploading. Resizes by default
to Facebook's max... | [
"def",
"upload",
"(",
"self",
",",
"image",
",",
"aid",
"=",
"None",
",",
"caption",
"=",
"None",
",",
"size",
"=",
"(",
"604",
",",
"1024",
")",
")",
":",
"args",
"=",
"{",
"}",
"if",
"aid",
"is",
"not",
"None",
":",
"args",
"[",
"'aid'",
"]... | https://github.com/mdipierro/web2py-appliances/blob/f97658293d51519e5f06e1ed503ee85f8154fcf3/FacebookConnectExample/modules/plugin_fbconnect/facebook.py#L471-L520 | |
aosabook/500lines | fba689d101eb5600f5c8f4d7fd79912498e950e2 | contingent/code/contingent/graphlib.py | python | Graph.immediate_consequences_of | (self, task) | return self.sorted(self._consequences_of[task]) | Return the tasks that use `task` as an input. | Return the tasks that use `task` as an input. | [
"Return",
"the",
"tasks",
"that",
"use",
"task",
"as",
"an",
"input",
"."
] | def immediate_consequences_of(self, task):
"""Return the tasks that use `task` as an input."""
return self.sorted(self._consequences_of[task]) | [
"def",
"immediate_consequences_of",
"(",
"self",
",",
"task",
")",
":",
"return",
"self",
".",
"sorted",
"(",
"self",
".",
"_consequences_of",
"[",
"task",
"]",
")"
] | https://github.com/aosabook/500lines/blob/fba689d101eb5600f5c8f4d7fd79912498e950e2/contingent/code/contingent/graphlib.py#L70-L72 | |
SteeltoeOSS/Samples | a27be0f2fd2af0e263f32aceb131df21fb54c82b | steps/browser_steps.py | python | step_impl | (context, data, url) | :type context: behave.runner.Context
:type data: str
:type url: str | :type context: behave.runner.Context
:type data: str
:type url: str | [
":",
"type",
"context",
":",
"behave",
".",
"runner",
".",
"Context",
":",
"type",
"data",
":",
"str",
":",
"type",
"url",
":",
"str"
] | def step_impl(context, data, url):
"""
:type context: behave.runner.Context
:type data: str
:type url: str
"""
url = dns.resolve_url(context, url)
fields = data.split('=')
assert len(fields) == 2, 'Invalid data format: {}'.format(data)
payload = {fields[0]: fields[1]}
context.log... | [
"def",
"step_impl",
"(",
"context",
",",
"data",
",",
"url",
")",
":",
"url",
"=",
"dns",
".",
"resolve_url",
"(",
"context",
",",
"url",
")",
"fields",
"=",
"data",
".",
"split",
"(",
"'='",
")",
"assert",
"len",
"(",
"fields",
")",
"==",
"2",
"... | https://github.com/SteeltoeOSS/Samples/blob/a27be0f2fd2af0e263f32aceb131df21fb54c82b/steps/browser_steps.py#L34-L47 | ||
replit-archive/jsrepl | 36d79b6288ca5d26208e8bade2a168c6ebcb2376 | extern/python/closured/lib/python2.7/xml/dom/expatbuilder.py | python | Namespaces.install | (self, parser) | Insert the namespace-handlers onto the parser. | Insert the namespace-handlers onto the parser. | [
"Insert",
"the",
"namespace",
"-",
"handlers",
"onto",
"the",
"parser",
"."
] | def install(self, parser):
"""Insert the namespace-handlers onto the parser."""
ExpatBuilder.install(self, parser)
if self._options.namespace_declarations:
parser.StartNamespaceDeclHandler = (
self.start_namespace_decl_handler) | [
"def",
"install",
"(",
"self",
",",
"parser",
")",
":",
"ExpatBuilder",
".",
"install",
"(",
"self",
",",
"parser",
")",
"if",
"self",
".",
"_options",
".",
"namespace_declarations",
":",
"parser",
".",
"StartNamespaceDeclHandler",
"=",
"(",
"self",
".",
"... | https://github.com/replit-archive/jsrepl/blob/36d79b6288ca5d26208e8bade2a168c6ebcb2376/extern/python/closured/lib/python2.7/xml/dom/expatbuilder.py#L732-L737 | ||
opencoweb/coweb | 7b3a87ee9eda735a859447d404ee16edde1c5671 | servers/python/coweb/service/manager/object.py | python | ObjectServiceManager.get_manager_id | (self) | return 'object' | Manager id is object matching wrapper module name. | Manager id is object matching wrapper module name. | [
"Manager",
"id",
"is",
"object",
"matching",
"wrapper",
"module",
"name",
"."
] | def get_manager_id(self):
'''Manager id is object matching wrapper module name.'''
return 'object' | [
"def",
"get_manager_id",
"(",
"self",
")",
":",
"return",
"'object'"
] | https://github.com/opencoweb/coweb/blob/7b3a87ee9eda735a859447d404ee16edde1c5671/servers/python/coweb/service/manager/object.py#L10-L12 | |
ctripcorp/tars | d7954fccaf1a17901f22d844d84c5663a3d79c11 | tars/api/views/deployment.py | python | DeploymentViewSet.reset | (self, request, pk=None, format=None) | return self.retrieve(request) | temp for develop | temp for develop | [
"temp",
"for",
"develop"
] | def reset(self, request, pk=None, format=None):
"""
temp for develop
"""
deployment = self.get_object()
deployment.reset()
return self.retrieve(request) | [
"def",
"reset",
"(",
"self",
",",
"request",
",",
"pk",
"=",
"None",
",",
"format",
"=",
"None",
")",
":",
"deployment",
"=",
"self",
".",
"get_object",
"(",
")",
"deployment",
".",
"reset",
"(",
")",
"return",
"self",
".",
"retrieve",
"(",
"request"... | https://github.com/ctripcorp/tars/blob/d7954fccaf1a17901f22d844d84c5663a3d79c11/tars/api/views/deployment.py#L363-L369 | |
xtk/X | 04c1aa856664a8517d23aefd94c470d47130aead | lib/pypng-0.0.9/code/png.py | python | Reader.validate_signature | (self) | If signature (header) has not been read then read and
validate it; otherwise do nothing. | If signature (header) has not been read then read and
validate it; otherwise do nothing. | [
"If",
"signature",
"(",
"header",
")",
"has",
"not",
"been",
"read",
"then",
"read",
"and",
"validate",
"it",
";",
"otherwise",
"do",
"nothing",
"."
] | def validate_signature(self):
"""If signature (header) has not been read then read and
validate it; otherwise do nothing.
"""
if self.signature:
return
self.signature = self.file.read(8)
if self.signature != _signature:
raise FormatError("PNG file... | [
"def",
"validate_signature",
"(",
"self",
")",
":",
"if",
"self",
".",
"signature",
":",
"return",
"self",
".",
"signature",
"=",
"self",
".",
"file",
".",
"read",
"(",
"8",
")",
"if",
"self",
".",
"signature",
"!=",
"_signature",
":",
"raise",
"Format... | https://github.com/xtk/X/blob/04c1aa856664a8517d23aefd94c470d47130aead/lib/pypng-0.0.9/code/png.py#L1428-L1437 | ||
mceSystems/node-jsc | 90634f3064fab8e89a85b3942f0cc5054acc86fa | deps/v8/gypfiles/vs_toolchain.py | python | Update | (force=False) | return 0 | Requests an update of the toolchain to the specific hashes we have at
this revision. The update outputs a .json of the various configuration
information required to pass to gyp which we use in |GetToolchainDir()|. | Requests an update of the toolchain to the specific hashes we have at
this revision. The update outputs a .json of the various configuration
information required to pass to gyp which we use in |GetToolchainDir()|. | [
"Requests",
"an",
"update",
"of",
"the",
"toolchain",
"to",
"the",
"specific",
"hashes",
"we",
"have",
"at",
"this",
"revision",
".",
"The",
"update",
"outputs",
"a",
".",
"json",
"of",
"the",
"various",
"configuration",
"information",
"required",
"to",
"pas... | def Update(force=False):
"""Requests an update of the toolchain to the specific hashes we have at
this revision. The update outputs a .json of the various configuration
information required to pass to gyp which we use in |GetToolchainDir()|.
"""
if force != False and force != '--force':
print >>sys.stderr... | [
"def",
"Update",
"(",
"force",
"=",
"False",
")",
":",
"if",
"force",
"!=",
"False",
"and",
"force",
"!=",
"'--force'",
":",
"print",
">>",
"sys",
".",
"stderr",
",",
"'Unknown parameter \"%s\"'",
"%",
"force",
"return",
"1",
"if",
"force",
"==",
"'--for... | https://github.com/mceSystems/node-jsc/blob/90634f3064fab8e89a85b3942f0cc5054acc86fa/deps/v8/gypfiles/vs_toolchain.py#L294-L325 | |
nodejs/http2 | 734ad72e3939e62bcff0f686b8ec426b8aaa22e3 | deps/npm/node_modules/node-gyp/gyp/pylib/gyp/ordered_dict.py | python | OrderedDict.values | (self) | return [self[key] for key in self] | od.values() -> list of values in od | od.values() -> list of values in od | [
"od",
".",
"values",
"()",
"-",
">",
"list",
"of",
"values",
"in",
"od"
] | def values(self):
'od.values() -> list of values in od'
return [self[key] for key in self] | [
"def",
"values",
"(",
"self",
")",
":",
"return",
"[",
"self",
"[",
"key",
"]",
"for",
"key",
"in",
"self",
"]"
] | https://github.com/nodejs/http2/blob/734ad72e3939e62bcff0f686b8ec426b8aaa22e3/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/ordered_dict.py#L147-L149 | |
agoravoting/agora-ciudadana | a7701035ea77d7a91baa9b5c2d0c05d91d1b4262 | agora_site/agora_core/resources/agora.py | python | AgoraResource.join_action | (self, request, agora, **kwargs) | return self.create_response(request, dict(status="success")) | Action that an user can execute to join an agora if it has permissions | Action that an user can execute to join an agora if it has permissions | [
"Action",
"that",
"an",
"user",
"can",
"execute",
"to",
"join",
"an",
"agora",
"if",
"it",
"has",
"permissions"
] | def join_action(self, request, agora, **kwargs):
'''
Action that an user can execute to join an agora if it has permissions
'''
request.user.get_profile().add_to_agora(agora_id=agora.id, request=request)
return self.create_response(request, dict(status="success")) | [
"def",
"join_action",
"(",
"self",
",",
"request",
",",
"agora",
",",
"*",
"*",
"kwargs",
")",
":",
"request",
".",
"user",
".",
"get_profile",
"(",
")",
".",
"add_to_agora",
"(",
"agora_id",
"=",
"agora",
".",
"id",
",",
"request",
"=",
"request",
"... | https://github.com/agoravoting/agora-ciudadana/blob/a7701035ea77d7a91baa9b5c2d0c05d91d1b4262/agora_site/agora_core/resources/agora.py#L622-L628 | |
odoo/odoo | 8de8c196a137f4ebbf67d7c7c83fee36f873f5c8 | odoo/tools/translate.py | python | trans_load_data | (cr, fileobj, fileformat, lang,
verbose=True, create_empty_translation=False, overwrite=False) | Populates the ir_translation table.
:param fileobj: buffer open to a translation file
:param fileformat: format of the `fielobj` file, one of 'po' or 'csv'
:param lang: language code of the translations contained in `fileobj`
language must be present and activated in the database
:para... | Populates the ir_translation table. | [
"Populates",
"the",
"ir_translation",
"table",
"."
] | def trans_load_data(cr, fileobj, fileformat, lang,
verbose=True, create_empty_translation=False, overwrite=False):
"""Populates the ir_translation table.
:param fileobj: buffer open to a translation file
:param fileformat: format of the `fielobj` file, one of 'po' or 'csv'
:param la... | [
"def",
"trans_load_data",
"(",
"cr",
",",
"fileobj",
",",
"fileformat",
",",
"lang",
",",
"verbose",
"=",
"True",
",",
"create_empty_translation",
"=",
"False",
",",
"overwrite",
"=",
"False",
")",
":",
"if",
"verbose",
":",
"_logger",
".",
"info",
"(",
... | https://github.com/odoo/odoo/blob/8de8c196a137f4ebbf67d7c7c83fee36f873f5c8/odoo/tools/translate.py#L1169-L1230 | ||
nodejs/node-chakracore | 770c8dcd1bc3e0fce2d4497b4eec3fe49d829d43 | deps/chakrashim/third_party/jinja2/jinja2/utils.py | python | LRUCache.__setitem__ | (self, key, value) | Sets the value for an item. Moves the item up so that it
has the highest priority then. | Sets the value for an item. Moves the item up so that it
has the highest priority then. | [
"Sets",
"the",
"value",
"for",
"an",
"item",
".",
"Moves",
"the",
"item",
"up",
"so",
"that",
"it",
"has",
"the",
"highest",
"priority",
"then",
"."
] | def __setitem__(self, key, value):
"""Sets the value for an item. Moves the item up so that it
has the highest priority then.
"""
self._wlock.acquire()
try:
if key in self._mapping:
self._remove(key)
elif len(self._mapping) == self.capacity... | [
"def",
"__setitem__",
"(",
"self",
",",
"key",
",",
"value",
")",
":",
"self",
".",
"_wlock",
".",
"acquire",
"(",
")",
"try",
":",
"if",
"key",
"in",
"self",
".",
"_mapping",
":",
"self",
".",
"_remove",
"(",
"key",
")",
"elif",
"len",
"(",
"sel... | https://github.com/nodejs/node-chakracore/blob/770c8dcd1bc3e0fce2d4497b4eec3fe49d829d43/deps/chakrashim/third_party/jinja2/jinja2/utils.py#L413-L426 | ||
mozilla/spidernode | aafa9e5273f954f272bb4382fc007af14674b4c2 | deps/npm/node_modules/node-gyp/gyp/pylib/gyp/generator/android.py | python | AndroidMkWriter.ComputeOutput | (self, spec) | return os.path.join(path, self.ComputeOutputBasename(spec)) | Return the 'output' (full output path) of a gyp spec.
E.g., the loadable module 'foobar' in directory 'baz' will produce
'$(obj)/baz/libfoobar.so' | Return the 'output' (full output path) of a gyp spec. | [
"Return",
"the",
"output",
"(",
"full",
"output",
"path",
")",
"of",
"a",
"gyp",
"spec",
"."
] | def ComputeOutput(self, spec):
"""Return the 'output' (full output path) of a gyp spec.
E.g., the loadable module 'foobar' in directory 'baz' will produce
'$(obj)/baz/libfoobar.so'
"""
if self.type == 'executable':
# We install host executables into shared_intermediate_dir so they can be
... | [
"def",
"ComputeOutput",
"(",
"self",
",",
"spec",
")",
":",
"if",
"self",
".",
"type",
"==",
"'executable'",
":",
"# We install host executables into shared_intermediate_dir so they can be",
"# run by gyp rules that refer to PRODUCT_DIR.",
"path",
"=",
"'$(gyp_shared_intermedia... | https://github.com/mozilla/spidernode/blob/aafa9e5273f954f272bb4382fc007af14674b4c2/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/generator/android.py#L662-L688 | |
jxcore/jxcore | b05f1f2d2c9d62c813c7d84f3013dbbf30b6e410 | deps/npm/node_modules/node-gyp/gyp/pylib/gyp/msvs_emulation.py | python | MsvsSettings.GetLdflags | (self, config, gyp_to_build_path, expand_special,
manifest_base_name, output_name, is_executable, build_dir) | return ldflags, intermediate_manifest, manifest_files | Returns the flags that need to be added to link commands, and the
manifest files. | Returns the flags that need to be added to link commands, and the
manifest files. | [
"Returns",
"the",
"flags",
"that",
"need",
"to",
"be",
"added",
"to",
"link",
"commands",
"and",
"the",
"manifest",
"files",
"."
] | def GetLdflags(self, config, gyp_to_build_path, expand_special,
manifest_base_name, output_name, is_executable, build_dir):
"""Returns the flags that need to be added to link commands, and the
manifest files."""
config = self._TargetConfig(config)
ldflags = []
ld = self._GetWrapper(... | [
"def",
"GetLdflags",
"(",
"self",
",",
"config",
",",
"gyp_to_build_path",
",",
"expand_special",
",",
"manifest_base_name",
",",
"output_name",
",",
"is_executable",
",",
"build_dir",
")",
":",
"config",
"=",
"self",
".",
"_TargetConfig",
"(",
"config",
")",
... | https://github.com/jxcore/jxcore/blob/b05f1f2d2c9d62c813c7d84f3013dbbf30b6e410/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/msvs_emulation.py#L555-L647 | |
atom-community/ide-python | c046f9c2421713b34baa22648235541c5bb284fe | dist/debugger/VendorLib/vs-py-debugger/pythonFiles/experimental/ptvsd/ptvsd/_vendored/pydevd/_pydev_imps/_pydev_SocketServer.py | python | TCPServer.fileno | (self) | return self.socket.fileno() | Return socket file number.
Interface required by select(). | Return socket file number. | [
"Return",
"socket",
"file",
"number",
"."
] | def fileno(self):
"""Return socket file number.
Interface required by select().
"""
return self.socket.fileno() | [
"def",
"fileno",
"(",
"self",
")",
":",
"return",
"self",
".",
"socket",
".",
"fileno",
"(",
")"
] | https://github.com/atom-community/ide-python/blob/c046f9c2421713b34baa22648235541c5bb284fe/dist/debugger/VendorLib/vs-py-debugger/pythonFiles/experimental/ptvsd/ptvsd/_vendored/pydevd/_pydev_imps/_pydev_SocketServer.py#L438-L444 | |
datahuborg/datahub | f066b472c2b66cc3b868bbe433aed2d4557aea32 | src/examples/python/gen_py/datahub/DataHub.py | python | Iface.create_repo | (self, con, repo_name) | Parameters:
- con
- repo_name | Parameters:
- con
- repo_name | [
"Parameters",
":",
"-",
"con",
"-",
"repo_name"
] | def create_repo(self, con, repo_name):
"""
Parameters:
- con
- repo_name
"""
pass | [
"def",
"create_repo",
"(",
"self",
",",
"con",
",",
"repo_name",
")",
":",
"pass"
] | https://github.com/datahuborg/datahub/blob/f066b472c2b66cc3b868bbe433aed2d4557aea32/src/examples/python/gen_py/datahub/DataHub.py#L31-L37 | ||
replit-archive/jsrepl | 36d79b6288ca5d26208e8bade2a168c6ebcb2376 | extern/python/unclosured/lib/python2.7/urllib.py | python | ftperrors | () | return _ftperrors | Return the set of errors raised by the FTP class. | Return the set of errors raised by the FTP class. | [
"Return",
"the",
"set",
"of",
"errors",
"raised",
"by",
"the",
"FTP",
"class",
"."
] | def ftperrors():
"""Return the set of errors raised by the FTP class."""
global _ftperrors
if _ftperrors is None:
import ftplib
_ftperrors = ftplib.all_errors
return _ftperrors | [
"def",
"ftperrors",
"(",
")",
":",
"global",
"_ftperrors",
"if",
"_ftperrors",
"is",
"None",
":",
"import",
"ftplib",
"_ftperrors",
"=",
"ftplib",
".",
"all_errors",
"return",
"_ftperrors"
] | https://github.com/replit-archive/jsrepl/blob/36d79b6288ca5d26208e8bade2a168c6ebcb2376/extern/python/unclosured/lib/python2.7/urllib.py#L824-L830 | |
ayojs/ayo | 45a1c8cf6384f5bcc81d834343c3ed9d78b97df3 | deps/npm/node_modules/node-gyp/gyp/pylib/gyp/MSVSSettings.py | python | _Type.ValidateMSVS | (self, value) | Verifies that the value is legal for MSVS.
Args:
value: the value to check for this type.
Raises:
ValueError if value is not valid for MSVS. | Verifies that the value is legal for MSVS. | [
"Verifies",
"that",
"the",
"value",
"is",
"legal",
"for",
"MSVS",
"."
] | def ValidateMSVS(self, value):
"""Verifies that the value is legal for MSVS.
Args:
value: the value to check for this type.
Raises:
ValueError if value is not valid for MSVS.
""" | [
"def",
"ValidateMSVS",
"(",
"self",
",",
"value",
")",
":"
] | https://github.com/ayojs/ayo/blob/45a1c8cf6384f5bcc81d834343c3ed9d78b97df3/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/MSVSSettings.py#L70-L78 | ||
xtk/X | 04c1aa856664a8517d23aefd94c470d47130aead | lib/selenium/selenium/webdriver/common/alert.py | python | Alert.accept | (self) | Accepts the alert available | Accepts the alert available | [
"Accepts",
"the",
"alert",
"available"
] | def accept(self):
""" Accepts the alert available """
self.driver.execute(Command.ACCEPT_ALERT) | [
"def",
"accept",
"(",
"self",
")",
":",
"self",
".",
"driver",
".",
"execute",
"(",
"Command",
".",
"ACCEPT_ALERT",
")"
] | https://github.com/xtk/X/blob/04c1aa856664a8517d23aefd94c470d47130aead/lib/selenium/selenium/webdriver/common/alert.py#L33-L35 | ||
CaliOpen/Caliopen | 5361ebc5d4d2c525a87f737468b8a8e2aefbe3e8 | src/backend/components/py.pi/caliopen_pi/qualifiers/base.py | python | BaseQualifier.get_participant | (self, message, participant) | return p, c | Try to find a related contact and return a Participant instance. | Try to find a related contact and return a Participant instance. | [
"Try",
"to",
"find",
"a",
"related",
"contact",
"and",
"return",
"a",
"Participant",
"instance",
"."
] | def get_participant(self, message, participant):
"""Try to find a related contact and return a Participant instance."""
p = Participant()
p.address = participant.address.lower()
p.type = participant.type
p.label = participant.label
p.protocol = message.message_protocol
... | [
"def",
"get_participant",
"(",
"self",
",",
"message",
",",
"participant",
")",
":",
"p",
"=",
"Participant",
"(",
")",
"p",
".",
"address",
"=",
"participant",
".",
"address",
".",
"lower",
"(",
")",
"p",
".",
"type",
"=",
"participant",
".",
"type",
... | https://github.com/CaliOpen/Caliopen/blob/5361ebc5d4d2c525a87f737468b8a8e2aefbe3e8/src/backend/components/py.pi/caliopen_pi/qualifiers/base.py#L59-L78 | |
nodejs/node | ac3c33c1646bf46104c15ae035982c06364da9b8 | tools/gyp/pylib/gyp/generator/ninja.py | python | Target.PreCompileInput | (self) | return self.actions_stamp or self.precompile_stamp | Return the path, if any, that should be used as a dependency of
any dependent compile step. | Return the path, if any, that should be used as a dependency of
any dependent compile step. | [
"Return",
"the",
"path",
"if",
"any",
"that",
"should",
"be",
"used",
"as",
"a",
"dependency",
"of",
"any",
"dependent",
"compile",
"step",
"."
] | def PreCompileInput(self):
"""Return the path, if any, that should be used as a dependency of
any dependent compile step."""
return self.actions_stamp or self.precompile_stamp | [
"def",
"PreCompileInput",
"(",
"self",
")",
":",
"return",
"self",
".",
"actions_stamp",
"or",
"self",
".",
"precompile_stamp"
] | https://github.com/nodejs/node/blob/ac3c33c1646bf46104c15ae035982c06364da9b8/tools/gyp/pylib/gyp/generator/ninja.py#L177-L180 | |
UWFlow/rmc | 00bcc1450ffbec3a6c8d956a2a5d1bb3a04bfcb9 | server/view_helpers.py | python | redirect_to_profile | (user) | Returns a flask.redirect() to a given user's profile.
Basically redirect the request to the /profile endpoint with their ObjectId
Args:
user: The user's profile to redirects to. Should NOT be None. | Returns a flask.redirect() to a given user's profile. | [
"Returns",
"a",
"flask",
".",
"redirect",
"()",
"to",
"a",
"given",
"user",
"s",
"profile",
"."
] | def redirect_to_profile(user):
"""
Returns a flask.redirect() to a given user's profile.
Basically redirect the request to the /profile endpoint with their ObjectId
Args:
user: The user's profile to redirects to. Should NOT be None.
"""
if user is None:
# This should only happe... | [
"def",
"redirect_to_profile",
"(",
"user",
")",
":",
"if",
"user",
"is",
"None",
":",
"# This should only happen during development time...",
"logging",
".",
"error",
"(",
"'redirect_to_profile(user) called with user=None'",
")",
"return",
"flask",
".",
"redirect",
"(",
... | https://github.com/UWFlow/rmc/blob/00bcc1450ffbec3a6c8d956a2a5d1bb3a04bfcb9/server/view_helpers.py#L134-L152 | ||
jxcore/jxcore | b05f1f2d2c9d62c813c7d84f3013dbbf30b6e410 | deps/npm/node_modules/node-gyp/gyp/pylib/gyp/generator/ninja.py | python | Target.PreActionInput | (self, flavor) | return self.FinalOutput() or self.preaction_stamp | Return the path, if any, that should be used as a dependency of
any dependent action step. | Return the path, if any, that should be used as a dependency of
any dependent action step. | [
"Return",
"the",
"path",
"if",
"any",
"that",
"should",
"be",
"used",
"as",
"a",
"dependency",
"of",
"any",
"dependent",
"action",
"step",
"."
] | def PreActionInput(self, flavor):
"""Return the path, if any, that should be used as a dependency of
any dependent action step."""
if self.UsesToc(flavor):
return self.FinalOutput() + '.TOC'
return self.FinalOutput() or self.preaction_stamp | [
"def",
"PreActionInput",
"(",
"self",
",",
"flavor",
")",
":",
"if",
"self",
".",
"UsesToc",
"(",
"flavor",
")",
":",
"return",
"self",
".",
"FinalOutput",
"(",
")",
"+",
"'.TOC'",
"return",
"self",
".",
"FinalOutput",
"(",
")",
"or",
"self",
".",
"p... | https://github.com/jxcore/jxcore/blob/b05f1f2d2c9d62c813c7d84f3013dbbf30b6e410/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/generator/ninja.py#L163-L168 | |
Southpaw-TACTIC/TACTIC | ba9b87aef0ee3b3ea51446f25b285ebbca06f62c | src/pyasm/prod/service/base_xmlrpc.py | python | BaseXMLRPC.create_set | (self, ticket, project_code, set_name, cat_name, selected) | return [xml, asset_code] | an xml to create a new set node | an xml to create a new set node | [
"an",
"xml",
"to",
"create",
"a",
"new",
"set",
"node"
] | def create_set(self, ticket, project_code, set_name, cat_name, selected):
'''an xml to create a new set node'''
xml = ''
asset_code = ''
try:
self.init(ticket)
Project.set_project(project_code)
cmd = MayaSetCreateCmd()
cmd.set_set_name(set_... | [
"def",
"create_set",
"(",
"self",
",",
"ticket",
",",
"project_code",
",",
"set_name",
",",
"cat_name",
",",
"selected",
")",
":",
"xml",
"=",
"''",
"asset_code",
"=",
"''",
"try",
":",
"self",
".",
"init",
"(",
"ticket",
")",
"Project",
".",
"set_proj... | https://github.com/Southpaw-TACTIC/TACTIC/blob/ba9b87aef0ee3b3ea51446f25b285ebbca06f62c/src/pyasm/prod/service/base_xmlrpc.py#L232-L258 | |
jeeliz/jeelizFaceFilter | be3ffa5a76c930a98b2b7895c1dfa1faa4a1fa82 | libs/three/blenderExporter/io_three/exporter/api/object.py | python | _valid_node | (obj, valid_types, options) | return True | :param obj:
:param valid_types:
:param options: | [] | def _valid_node(obj, valid_types, options):
"""
:param obj:
:param valid_types:
:param options:
"""
if obj.type not in valid_types:
return False
# skip objects that are not on visible layers
visible_layers = _visible_scene_layers()
if not _on_visible_layer(obj, visible_lay... | [
"def",
"_valid_node",
"(",
"obj",
",",
"valid_types",
",",
"options",
")",
":",
"if",
"obj",
".",
"type",
"not",
"in",
"valid_types",
":",
"return",
"False",
"# skip objects that are not on visible layers",
"visible_layers",
"=",
"_visible_scene_layers",
"(",
")",
... | https://github.com/jeeliz/jeelizFaceFilter/blob/be3ffa5a76c930a98b2b7895c1dfa1faa4a1fa82/libs/three/blenderExporter/io_three/exporter/api/object.py#L700-L738 | ||
atom-community/ide-python | c046f9c2421713b34baa22648235541c5bb284fe | dist/debugger/VendorLib/vs-py-debugger/pythonFiles/experimental/ptvsd/ptvsd/_vendored/pydevd/third_party/pep8/lib2to3/lib2to3/main.py | python | main | (fixer_pkg, args=None) | return int(bool(rt.errors)) | Main program.
Args:
fixer_pkg: the name of a package where the fixers are located.
args: optional; a list of command line arguments. If omitted,
sys.argv[1:] is used.
Returns a suggested exit status (0, 1, 2). | Main program. | [
"Main",
"program",
"."
] | def main(fixer_pkg, args=None):
"""Main program.
Args:
fixer_pkg: the name of a package where the fixers are located.
args: optional; a list of command line arguments. If omitted,
sys.argv[1:] is used.
Returns a suggested exit status (0, 1, 2).
"""
# Set up option par... | [
"def",
"main",
"(",
"fixer_pkg",
",",
"args",
"=",
"None",
")",
":",
"# Set up option parser",
"parser",
"=",
"optparse",
".",
"OptionParser",
"(",
"usage",
"=",
"\"2to3 [options] file|dir ...\"",
")",
"parser",
".",
"add_option",
"(",
"\"-d\"",
",",
"\"--doctes... | https://github.com/atom-community/ide-python/blob/c046f9c2421713b34baa22648235541c5bb284fe/dist/debugger/VendorLib/vs-py-debugger/pythonFiles/experimental/ptvsd/ptvsd/_vendored/pydevd/third_party/pep8/lib2to3/lib2to3/main.py#L134-L269 | |
NVIDIA-AI-IOT/deepstream_360_d_smart_parking_application | b9b1f9e9aa84e379c573063fc5622ef50d38898d | tracker/code/mctrack/mctracker.py | python | MulticamTracker.select_rep_member_from_list | (self, json_list) | return retval | This method selects one representative dict from the list
of vehicle detections (in json_list)
Returns:
[dict] -- A representative day2 schema dictionary of
selected representative vehicle detection | This method selects one representative dict from the list
of vehicle detections (in json_list) | [
"This",
"method",
"selects",
"one",
"representative",
"dict",
"from",
"the",
"list",
"of",
"vehicle",
"detections",
"(",
"in",
"json_list",
")"
] | def select_rep_member_from_list(self, json_list):
"""
This method selects one representative dict from the list
of vehicle detections (in json_list)
Returns:
[dict] -- A representative day2 schema dictionary of
selected representative vehicle detection
""... | [
"def",
"select_rep_member_from_list",
"(",
"self",
",",
"json_list",
")",
":",
"retval",
"=",
"None",
"if",
"json_list",
":",
"retval",
"=",
"json_list",
"[",
"0",
"]",
"pref",
"=",
"100",
"min_obj_id",
"=",
"None",
"for",
"ele",
"in",
"json_list",
":",
... | https://github.com/NVIDIA-AI-IOT/deepstream_360_d_smart_parking_application/blob/b9b1f9e9aa84e379c573063fc5622ef50d38898d/tracker/code/mctrack/mctracker.py#L554-L582 | |
agoravoting/agora-ciudadana | a7701035ea77d7a91baa9b5c2d0c05d91d1b4262 | agora_site/misc/utils.py | python | rest | (path, query={}, data={}, headers={}, method="GET", request=None) | return (res.status_code, res._container) | Converts a RPC-like call to something like a HttpRequest, passes it
to the right view function (via django's url resolver) and returns
the result.
Args:
path: a uri-like string representing an API endpoint. e.g. /resource/27.
/api/v2/ is automatically prepended to the path.
qu... | Converts a RPC-like call to something like a HttpRequest, passes it
to the right view function (via django's url resolver) and returns
the result. | [
"Converts",
"a",
"RPC",
"-",
"like",
"call",
"to",
"something",
"like",
"a",
"HttpRequest",
"passes",
"it",
"to",
"the",
"right",
"view",
"function",
"(",
"via",
"django",
"s",
"url",
"resolver",
")",
"and",
"returns",
"the",
"result",
"."
] | def rest(path, query={}, data={}, headers={}, method="GET", request=None):
"""
Converts a RPC-like call to something like a HttpRequest, passes it
to the right view function (via django's url resolver) and returns
the result.
Args:
path: a uri-like string representing an API endpoint. e.g. ... | [
"def",
"rest",
"(",
"path",
",",
"query",
"=",
"{",
"}",
",",
"data",
"=",
"{",
"}",
",",
"headers",
"=",
"{",
"}",
",",
"method",
"=",
"\"GET\"",
",",
"request",
"=",
"None",
")",
":",
"#adjust for lack of trailing slash, just in case",
"if",
"path",
... | https://github.com/agoravoting/agora-ciudadana/blob/a7701035ea77d7a91baa9b5c2d0c05d91d1b4262/agora_site/misc/utils.py#L375-L415 | |
CaliOpen/Caliopen | 5361ebc5d4d2c525a87f737468b8a8e2aefbe3e8 | src/backend/tools/py.CLI/caliopen_cli/commands/setup_storage.py | python | setup_storage | (settings=None) | Create cassandra models. | Create cassandra models. | [
"Create",
"cassandra",
"models",
"."
] | def setup_storage(settings=None):
"""Create cassandra models."""
from caliopen_storage.core import core_registry
# Make discovery happen
from caliopen_main.user.core import User
from caliopen_main.user.core import (UserIdentity,
IdentityLookup,
... | [
"def",
"setup_storage",
"(",
"settings",
"=",
"None",
")",
":",
"from",
"caliopen_storage",
".",
"core",
"import",
"core_registry",
"# Make discovery happen",
"from",
"caliopen_main",
".",
"user",
".",
"core",
"import",
"User",
"from",
"caliopen_main",
".",
"user"... | https://github.com/CaliOpen/Caliopen/blob/5361ebc5d4d2c525a87f737468b8a8e2aefbe3e8/src/backend/tools/py.CLI/caliopen_cli/commands/setup_storage.py#L9-L35 | ||
nodejs/quic | 5baab3f3a05548d3b51bea98868412b08766e34d | deps/npm/node_modules/node-gyp/gyp/pylib/gyp/msvs_emulation.py | python | MsvsSettings.AdjustMidlIncludeDirs | (self, midl_include_dirs, config) | return [self.ConvertVSMacros(p, config=config) for p in includes] | Updates midl_include_dirs to expand VS specific paths, and adds the
system include dirs used for platform SDK and similar. | Updates midl_include_dirs to expand VS specific paths, and adds the
system include dirs used for platform SDK and similar. | [
"Updates",
"midl_include_dirs",
"to",
"expand",
"VS",
"specific",
"paths",
"and",
"adds",
"the",
"system",
"include",
"dirs",
"used",
"for",
"platform",
"SDK",
"and",
"similar",
"."
] | def AdjustMidlIncludeDirs(self, midl_include_dirs, config):
"""Updates midl_include_dirs to expand VS specific paths, and adds the
system include dirs used for platform SDK and similar."""
config = self._TargetConfig(config)
includes = midl_include_dirs + self.msvs_system_include_dirs[config]
includ... | [
"def",
"AdjustMidlIncludeDirs",
"(",
"self",
",",
"midl_include_dirs",
",",
"config",
")",
":",
"config",
"=",
"self",
".",
"_TargetConfig",
"(",
"config",
")",
"includes",
"=",
"midl_include_dirs",
"+",
"self",
".",
"msvs_system_include_dirs",
"[",
"config",
"]... | https://github.com/nodejs/quic/blob/5baab3f3a05548d3b51bea98868412b08766e34d/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/msvs_emulation.py#L349-L356 | |
replit-archive/jsrepl | 36d79b6288ca5d26208e8bade2a168c6ebcb2376 | extern/python/reloop-closured/lib/python2.7/smtplib.py | python | SMTP.starttls | (self, keyfile=None, certfile=None) | return (resp, reply) | Puts the connection to the SMTP server into TLS mode.
If there has been no previous EHLO or HELO command this session, this
method tries ESMTP EHLO first.
If the server supports TLS, this will encrypt the rest of the SMTP
session. If you provide the keyfile and certfile parameters,
... | Puts the connection to the SMTP server into TLS mode. | [
"Puts",
"the",
"connection",
"to",
"the",
"SMTP",
"server",
"into",
"TLS",
"mode",
"."
] | def starttls(self, keyfile=None, certfile=None):
"""Puts the connection to the SMTP server into TLS mode.
If there has been no previous EHLO or HELO command this session, this
method tries ESMTP EHLO first.
If the server supports TLS, this will encrypt the rest of the SMTP
sess... | [
"def",
"starttls",
"(",
"self",
",",
"keyfile",
"=",
"None",
",",
"certfile",
"=",
"None",
")",
":",
"self",
".",
"ehlo_or_helo_if_needed",
"(",
")",
"if",
"not",
"self",
".",
"has_extn",
"(",
"\"starttls\"",
")",
":",
"raise",
"SMTPException",
"(",
"\"S... | https://github.com/replit-archive/jsrepl/blob/36d79b6288ca5d26208e8bade2a168c6ebcb2376/extern/python/reloop-closured/lib/python2.7/smtplib.py#L607-L641 | |
replit-archive/jsrepl | 36d79b6288ca5d26208e8bade2a168c6ebcb2376 | extern/python/closured/lib/python2.7/collections.py | python | Counter.__missing__ | (self, key) | return 0 | The count of elements not in the Counter is zero. | The count of elements not in the Counter is zero. | [
"The",
"count",
"of",
"elements",
"not",
"in",
"the",
"Counter",
"is",
"zero",
"."
] | def __missing__(self, key):
'The count of elements not in the Counter is zero.'
# Needed so that self[missing_item] does not raise KeyError
return 0 | [
"def",
"__missing__",
"(",
"self",
",",
"key",
")",
":",
"# Needed so that self[missing_item] does not raise KeyError",
"return",
"0"
] | https://github.com/replit-archive/jsrepl/blob/36d79b6288ca5d26208e8bade2a168c6ebcb2376/extern/python/closured/lib/python2.7/collections.py#L420-L423 | |
nkrode/RedisLive | e1d7763baee558ce4681b7764025d38df5ee5798 | src/dataprovider/redisprovider.py | python | RedisStatsProvider.save_info_command | (self, server, timestamp, info) | Save Redis info command dump
Args:
server (str): id of server
timestamp (datetime): Timestamp.
info (dict): The result of a Redis INFO command. | Save Redis info command dump | [
"Save",
"Redis",
"info",
"command",
"dump"
] | def save_info_command(self, server, timestamp, info):
"""Save Redis info command dump
Args:
server (str): id of server
timestamp (datetime): Timestamp.
info (dict): The result of a Redis INFO command.
"""
self.conn.set(server + ":Info", json.dumps(inf... | [
"def",
"save_info_command",
"(",
"self",
",",
"server",
",",
"timestamp",
",",
"info",
")",
":",
"self",
".",
"conn",
".",
"set",
"(",
"server",
"+",
"\":Info\"",
",",
"json",
".",
"dumps",
"(",
"info",
")",
")"
] | https://github.com/nkrode/RedisLive/blob/e1d7763baee558ce4681b7764025d38df5ee5798/src/dataprovider/redisprovider.py#L32-L40 | ||
replit-archive/jsrepl | 36d79b6288ca5d26208e8bade2a168c6ebcb2376 | extern/python/reloop-closured/lib/python2.7/random.py | python | WichmannHill.seed | (self, a=None) | Initialize internal state from hashable object.
None or no argument seeds from current time or from an operating
system specific randomness source if available.
If a is not None or an int or long, hash(a) is used instead.
If a is an int or long, a is used directly. Distinct values be... | Initialize internal state from hashable object. | [
"Initialize",
"internal",
"state",
"from",
"hashable",
"object",
"."
] | def seed(self, a=None):
"""Initialize internal state from hashable object.
None or no argument seeds from current time or from an operating
system specific randomness source if available.
If a is not None or an int or long, hash(a) is used instead.
If a is an int or long, a is... | [
"def",
"seed",
"(",
"self",
",",
"a",
"=",
"None",
")",
":",
"if",
"a",
"is",
"None",
":",
"try",
":",
"a",
"=",
"long",
"(",
"_hexlify",
"(",
"_urandom",
"(",
"16",
")",
")",
",",
"16",
")",
"except",
"NotImplementedError",
":",
"import",
"time"... | https://github.com/replit-archive/jsrepl/blob/36d79b6288ca5d26208e8bade2a168c6ebcb2376/extern/python/reloop-closured/lib/python2.7/random.py#L657-L686 | ||
atom-community/ide-python | c046f9c2421713b34baa22648235541c5bb284fe | dist/debugger/VendorLib/vs-py-debugger/pythonFiles/experimental/ptvsd/ptvsd/_vendored/pydevd/pydevd_attach_to_process/winappdbg/win32/user32.py | python | Point._as_parameter_ | (self) | return POINT(self.x, self.y) | Compatibility with ctypes.
Allows passing transparently a Point object to an API call. | Compatibility with ctypes.
Allows passing transparently a Point object to an API call. | [
"Compatibility",
"with",
"ctypes",
".",
"Allows",
"passing",
"transparently",
"a",
"Point",
"object",
"to",
"an",
"API",
"call",
"."
] | def _as_parameter_(self):
"""
Compatibility with ctypes.
Allows passing transparently a Point object to an API call.
"""
return POINT(self.x, self.y) | [
"def",
"_as_parameter_",
"(",
"self",
")",
":",
"return",
"POINT",
"(",
"self",
".",
"x",
",",
"self",
".",
"y",
")"
] | https://github.com/atom-community/ide-python/blob/c046f9c2421713b34baa22648235541c5bb284fe/dist/debugger/VendorLib/vs-py-debugger/pythonFiles/experimental/ptvsd/ptvsd/_vendored/pydevd/pydevd_attach_to_process/winappdbg/win32/user32.py#L438-L443 | |
TeamvisionCorp/TeamVision | aa2a57469e430ff50cce21174d8f280efa0a83a7 | distribute/0.0.4/build_shell/teamvision/teamvision/issue/views/dashboard_view.py | python | index | (request,env_id) | return page_worker.get_dashboard_index(request,"all") | index page | index page | [
"index",
"page"
] | def index(request,env_id):
''' index page'''
page_worker=ENVDashBoardPageWorker(request)
return page_worker.get_dashboard_index(request,"all") | [
"def",
"index",
"(",
"request",
",",
"env_id",
")",
":",
"page_worker",
"=",
"ENVDashBoardPageWorker",
"(",
"request",
")",
"return",
"page_worker",
".",
"get_dashboard_index",
"(",
"request",
",",
"\"all\"",
")"
] | https://github.com/TeamvisionCorp/TeamVision/blob/aa2a57469e430ff50cce21174d8f280efa0a83a7/distribute/0.0.4/build_shell/teamvision/teamvision/issue/views/dashboard_view.py#L18-L21 | |
aaPanel/aaPanel | d2a66661dbd66948cce5a074214257550aec91ee | class/pyotp/totp.py | python | TOTP.__init__ | (self, *args, **kwargs) | :param interval: the time interval in seconds
for OTP. This defaults to 30.
:type interval: int | :param interval: the time interval in seconds
for OTP. This defaults to 30.
:type interval: int | [
":",
"param",
"interval",
":",
"the",
"time",
"interval",
"in",
"seconds",
"for",
"OTP",
".",
"This",
"defaults",
"to",
"30",
".",
":",
"type",
"interval",
":",
"int"
] | def __init__(self, *args, **kwargs):
"""
:param interval: the time interval in seconds
for OTP. This defaults to 30.
:type interval: int
"""
self.interval = kwargs.pop('interval', 30)
super(TOTP, self).__init__(*args, **kwargs) | [
"def",
"__init__",
"(",
"self",
",",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"self",
".",
"interval",
"=",
"kwargs",
".",
"pop",
"(",
"'interval'",
",",
"30",
")",
"super",
"(",
"TOTP",
",",
"self",
")",
".",
"__init__",
"(",
"*",
"args",... | https://github.com/aaPanel/aaPanel/blob/d2a66661dbd66948cce5a074214257550aec91ee/class/pyotp/totp.py#L14-L21 | ||
Nexedi/erp5 | 44df1959c0e21576cf5e9803d602d95efb4b695b | product/Zelenium/zuite.py | python | Zuite._getZipFile | ( self, include_selenium=True ) | return stream.getvalue() | Generate a zip file containing both tests and scaffolding. | Generate a zip file containing both tests and scaffolding. | [
"Generate",
"a",
"zip",
"file",
"containing",
"both",
"tests",
"and",
"scaffolding",
"."
] | def _getZipFile( self, include_selenium=True ):
""" Generate a zip file containing both tests and scaffolding.
"""
stream = StringIO.StringIO()
archive = zipfile.ZipFile( stream, 'w' )
def convertToBytes(body):
if isinstance(body, types.UnicodeType):
... | [
"def",
"_getZipFile",
"(",
"self",
",",
"include_selenium",
"=",
"True",
")",
":",
"stream",
"=",
"StringIO",
".",
"StringIO",
"(",
")",
"archive",
"=",
"zipfile",
".",
"ZipFile",
"(",
"stream",
",",
"'w'",
")",
"def",
"convertToBytes",
"(",
"body",
")",... | https://github.com/Nexedi/erp5/blob/44df1959c0e21576cf5e9803d602d95efb4b695b/product/Zelenium/zuite.py#L497-L566 | |
carlosperate/ardublockly | 04fa48273b5651386d0ef1ce6dd446795ffc2594 | ardublocklyserver/local-packages/serial/threaded/__init__.py | python | LineReader.handle_line | (self, line) | Process one line - to be overridden by subclassing | Process one line - to be overridden by subclassing | [
"Process",
"one",
"line",
"-",
"to",
"be",
"overridden",
"by",
"subclassing"
] | def handle_line(self, line):
"""Process one line - to be overridden by subclassing"""
raise NotImplementedError('please implement functionality in handle_line') | [
"def",
"handle_line",
"(",
"self",
",",
"line",
")",
":",
"raise",
"NotImplementedError",
"(",
"'please implement functionality in handle_line'",
")"
] | https://github.com/carlosperate/ardublockly/blob/04fa48273b5651386d0ef1ce6dd446795ffc2594/ardublocklyserver/local-packages/serial/threaded/__init__.py#L134-L136 | ||
aws-samples/aws-lex-web-ui | 370f11286062957faf51448cb3bd93c5776be8e0 | templates/custom-resources/lex-manager.py | python | get_parsed_args | () | return args | Parse arguments passed when running as a shell script | Parse arguments passed when running as a shell script | [
"Parse",
"arguments",
"passed",
"when",
"running",
"as",
"a",
"shell",
"script"
] | def get_parsed_args():
""" Parse arguments passed when running as a shell script
"""
parser = argparse.ArgumentParser(
description='Lex bot manager. Import, export or delete a Lex bot.'
' Used to import/export/delete Lex bots and associated resources'
' (i.e. intents, slot ty... | [
"def",
"get_parsed_args",
"(",
")",
":",
"parser",
"=",
"argparse",
".",
"ArgumentParser",
"(",
"description",
"=",
"'Lex bot manager. Import, export or delete a Lex bot.'",
"' Used to import/export/delete Lex bots and associated resources'",
"' (i.e. intents, slot types).'",
")",
... | https://github.com/aws-samples/aws-lex-web-ui/blob/370f11286062957faf51448cb3bd93c5776be8e0/templates/custom-resources/lex-manager.py#L105-L142 | |
replit-archive/jsrepl | 36d79b6288ca5d26208e8bade2a168c6ebcb2376 | extern/python/unclosured/lib/python2.7/ftplib.py | python | FTP.size | (self, filename) | Retrieve the size of a file. | Retrieve the size of a file. | [
"Retrieve",
"the",
"size",
"of",
"a",
"file",
"."
] | def size(self, filename):
'''Retrieve the size of a file.'''
# The SIZE command is defined in RFC-3659
resp = self.sendcmd('SIZE ' + filename)
if resp[:3] == '213':
s = resp[3:].strip()
try:
return int(s)
except (OverflowError, ValueErr... | [
"def",
"size",
"(",
"self",
",",
"filename",
")",
":",
"# The SIZE command is defined in RFC-3659",
"resp",
"=",
"self",
".",
"sendcmd",
"(",
"'SIZE '",
"+",
"filename",
")",
"if",
"resp",
"[",
":",
"3",
"]",
"==",
"'213'",
":",
"s",
"=",
"resp",
"[",
... | https://github.com/replit-archive/jsrepl/blob/36d79b6288ca5d26208e8bade2a168c6ebcb2376/extern/python/unclosured/lib/python2.7/ftplib.py#L545-L554 | ||
mozilla/spidernode | aafa9e5273f954f272bb4382fc007af14674b4c2 | deps/npm/node_modules/node-gyp/gyp/pylib/gyp/generator/msvs.py | python | _ValidateSourcesForMSVSProject | (spec, version) | Makes sure if duplicate basenames are not specified in the source list.
Arguments:
spec: The target dictionary containing the properties of the target.
version: The VisualStudioVersion object. | Makes sure if duplicate basenames are not specified in the source list. | [
"Makes",
"sure",
"if",
"duplicate",
"basenames",
"are",
"not",
"specified",
"in",
"the",
"source",
"list",
"."
] | def _ValidateSourcesForMSVSProject(spec, version):
"""Makes sure if duplicate basenames are not specified in the source list.
Arguments:
spec: The target dictionary containing the properties of the target.
version: The VisualStudioVersion object.
"""
# This validation should not be applied to MSVC2010 ... | [
"def",
"_ValidateSourcesForMSVSProject",
"(",
"spec",
",",
"version",
")",
":",
"# This validation should not be applied to MSVC2010 and later.",
"assert",
"not",
"version",
".",
"UsesVcxproj",
"(",
")",
"# TODO: Check if MSVC allows this for loadable_module targets.",
"if",
"spe... | https://github.com/mozilla/spidernode/blob/aafa9e5273f954f272bb4382fc007af14674b4c2/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/generator/msvs.py#L947-L979 | ||
atom-community/ide-python | c046f9c2421713b34baa22648235541c5bb284fe | dist/debugger/VendorLib/vs-py-debugger/pythonFiles/PythonTools/visualstudio_py_repl.py | python | ReplBackend.run_command | (self, command) | runs the specified command which is a string containing code | runs the specified command which is a string containing code | [
"runs",
"the",
"specified",
"command",
"which",
"is",
"a",
"string",
"containing",
"code"
] | def run_command(self, command):
"""runs the specified command which is a string containing code"""
raise NotImplementedError | [
"def",
"run_command",
"(",
"self",
",",
"command",
")",
":",
"raise",
"NotImplementedError"
] | https://github.com/atom-community/ide-python/blob/c046f9c2421713b34baa22648235541c5bb284fe/dist/debugger/VendorLib/vs-py-debugger/pythonFiles/PythonTools/visualstudio_py_repl.py#L469-L471 | ||
depjs/dep | cb8def92812d80b1fd8e5ffbbc1ae129a207fff6 | node_modules/node-gyp/gyp/pylib/gyp/generator/ninja.py | python | NinjaWriter.GypPathToNinja | (self, path, env=None) | return os.path.normpath(os.path.join(self.build_to_base, path)) | Translate a gyp path to a ninja path, optionally expanding environment
variable references in |path| with |env|.
See the above discourse on path conversions. | Translate a gyp path to a ninja path, optionally expanding environment
variable references in |path| with |env|. | [
"Translate",
"a",
"gyp",
"path",
"to",
"a",
"ninja",
"path",
"optionally",
"expanding",
"environment",
"variable",
"references",
"in",
"|path|",
"with",
"|env|",
"."
] | def GypPathToNinja(self, path, env=None):
"""Translate a gyp path to a ninja path, optionally expanding environment
variable references in |path| with |env|.
See the above discourse on path conversions."""
if env:
if self.flavor == "mac":
path = gyp.xcode_emulation.E... | [
"def",
"GypPathToNinja",
"(",
"self",
",",
"path",
",",
"env",
"=",
"None",
")",
":",
"if",
"env",
":",
"if",
"self",
".",
"flavor",
"==",
"\"mac\"",
":",
"path",
"=",
"gyp",
".",
"xcode_emulation",
".",
"ExpandEnvVars",
"(",
"path",
",",
"env",
")",... | https://github.com/depjs/dep/blob/cb8def92812d80b1fd8e5ffbbc1ae129a207fff6/node_modules/node-gyp/gyp/pylib/gyp/generator/ninja.py#L304-L322 | |
ipython-contrib/jupyter_contrib_nbextensions | a186b18efaa1f55fba64f08cd9d8bf85cba56d25 | src/jupyter_contrib_nbextensions/application.py | python | BaseContribNbextensionsApp._log_datefmt_default | (self) | return "%H:%M:%S" | Exclude date from timestamp. | Exclude date from timestamp. | [
"Exclude",
"date",
"from",
"timestamp",
"."
] | def _log_datefmt_default(self):
"""Exclude date from timestamp."""
return "%H:%M:%S" | [
"def",
"_log_datefmt_default",
"(",
"self",
")",
":",
"return",
"\"%H:%M:%S\""
] | https://github.com/ipython-contrib/jupyter_contrib_nbextensions/blob/a186b18efaa1f55fba64f08cd9d8bf85cba56d25/src/jupyter_contrib_nbextensions/application.py#L28-L30 | |
ivendrov/order-embedding | 2057e6056a887ea00d304fc43a8a7e4810f4d669 | utils.py | python | ortho_weight | (ndim) | return u.astype('float32') | Orthogonal weight init, for recurrent layers | Orthogonal weight init, for recurrent layers | [
"Orthogonal",
"weight",
"init",
"for",
"recurrent",
"layers"
] | def ortho_weight(ndim):
"""
Orthogonal weight init, for recurrent layers
"""
W = numpy.random.randn(ndim, ndim)
u, s, v = numpy.linalg.svd(W)
return u.astype('float32') | [
"def",
"ortho_weight",
"(",
"ndim",
")",
":",
"W",
"=",
"numpy",
".",
"random",
".",
"randn",
"(",
"ndim",
",",
"ndim",
")",
"u",
",",
"s",
",",
"v",
"=",
"numpy",
".",
"linalg",
".",
"svd",
"(",
"W",
")",
"return",
"u",
".",
"astype",
"(",
"... | https://github.com/ivendrov/order-embedding/blob/2057e6056a887ea00d304fc43a8a7e4810f4d669/utils.py#L61-L67 | |
wtx358/wtxlog | 5e0dd09309ff98b26009a9eac48b01afd344cd99 | wtxlog/main/views.py | python | upload | () | return json.dumps(result) | 文件上传函数 | 文件上传函数 | [
"文件上传函数"
] | def upload():
''' 文件上传函数 '''
result = {"err": "", "msg": {"url": "", "localfile": ""}}
fname = ''
fext = ''
data = None
if request.method == 'POST' and 'filedata' in request.files:
# 传统上传模式,IE浏览器使用这种模式
fileobj = request.files['filedata']
result["msg"]["localfile"] = fil... | [
"def",
"upload",
"(",
")",
":",
"result",
"=",
"{",
"\"err\"",
":",
"\"\"",
",",
"\"msg\"",
":",
"{",
"\"url\"",
":",
"\"\"",
",",
"\"localfile\"",
":",
"\"\"",
"}",
"}",
"fname",
"=",
"''",
"fext",
"=",
"''",
"data",
"=",
"None",
"if",
"request",
... | https://github.com/wtx358/wtxlog/blob/5e0dd09309ff98b26009a9eac48b01afd344cd99/wtxlog/main/views.py#L311-L348 | |
liftoff/GateOne | 6ae1d01f7fe21e2703bdf982df7353e7bb81a500 | termio/termio.py | python | MultiplexPOSIXIOLoop._write | (self, chars) | Writes *chars* to `self.fd` (pretty straightforward). If IOError or
OSError exceptions are encountered, will run `terminate`. All other
exceptions are logged but no action will be taken. | Writes *chars* to `self.fd` (pretty straightforward). If IOError or
OSError exceptions are encountered, will run `terminate`. All other
exceptions are logged but no action will be taken. | [
"Writes",
"*",
"chars",
"*",
"to",
"self",
".",
"fd",
"(",
"pretty",
"straightforward",
")",
".",
"If",
"IOError",
"or",
"OSError",
"exceptions",
"are",
"encountered",
"will",
"run",
"terminate",
".",
"All",
"other",
"exceptions",
"are",
"logged",
"but",
"... | def _write(self, chars):
"""
Writes *chars* to `self.fd` (pretty straightforward). If IOError or
OSError exceptions are encountered, will run `terminate`. All other
exceptions are logged but no action will be taken.
"""
#logging.debug("MultiplexPOSIXIOLoop._write(%s)" %... | [
"def",
"_write",
"(",
"self",
",",
"chars",
")",
":",
"#logging.debug(\"MultiplexPOSIXIOLoop._write(%s)\" % repr(chars))",
"try",
":",
"with",
"io",
".",
"open",
"(",
"self",
".",
"fd",
",",
"'wt'",
",",
"encoding",
"=",
"'UTF-8'",
",",
"closefd",
"=",
"False"... | https://github.com/liftoff/GateOne/blob/6ae1d01f7fe21e2703bdf982df7353e7bb81a500/termio/termio.py#L1750-L1778 | ||
replit-archive/jsrepl | 36d79b6288ca5d26208e8bade2a168c6ebcb2376 | extern/python/unclosured/lib/python2.7/mailbox.py | python | Babyl.__setitem__ | (self, key, message) | Replace the keyed message; raise KeyError if it doesn't exist. | Replace the keyed message; raise KeyError if it doesn't exist. | [
"Replace",
"the",
"keyed",
"message",
";",
"raise",
"KeyError",
"if",
"it",
"doesn",
"t",
"exist",
"."
] | def __setitem__(self, key, message):
"""Replace the keyed message; raise KeyError if it doesn't exist."""
_singlefileMailbox.__setitem__(self, key, message)
if isinstance(message, BabylMessage):
self._labels[key] = message.get_labels() | [
"def",
"__setitem__",
"(",
"self",
",",
"key",
",",
"message",
")",
":",
"_singlefileMailbox",
".",
"__setitem__",
"(",
"self",
",",
"key",
",",
"message",
")",
"if",
"isinstance",
"(",
"message",
",",
"BabylMessage",
")",
":",
"self",
".",
"_labels",
"[... | https://github.com/replit-archive/jsrepl/blob/36d79b6288ca5d26208e8bade2a168c6ebcb2376/extern/python/unclosured/lib/python2.7/mailbox.py#L1192-L1196 | ||
liftoff/GateOne | 6ae1d01f7fe21e2703bdf982df7353e7bb81a500 | termio/termio.py | python | MultiplexPOSIXIOLoop._read | (self, bytes=-1) | return result | Reads at most *bytes* from the incoming stream, writes the result to
the terminal emulator using `term_write`, and returns what was read.
If *bytes* is -1 (default) it will read `self.fd` until there's no more
output.
Returns the result of all that reading.
.. note:: Non-blocki... | Reads at most *bytes* from the incoming stream, writes the result to
the terminal emulator using `term_write`, and returns what was read.
If *bytes* is -1 (default) it will read `self.fd` until there's no more
output. | [
"Reads",
"at",
"most",
"*",
"bytes",
"*",
"from",
"the",
"incoming",
"stream",
"writes",
"the",
"result",
"to",
"the",
"terminal",
"emulator",
"using",
"term_write",
"and",
"returns",
"what",
"was",
"read",
".",
"If",
"*",
"bytes",
"*",
"is",
"-",
"1",
... | def _read(self, bytes=-1):
"""
Reads at most *bytes* from the incoming stream, writes the result to
the terminal emulator using `term_write`, and returns what was read.
If *bytes* is -1 (default) it will read `self.fd` until there's no more
output.
Returns the result of ... | [
"def",
"_read",
"(",
"self",
",",
"bytes",
"=",
"-",
"1",
")",
":",
"# Commented out because it can be really noisy. Uncomment only if you",
"# *really* need to debug this method.",
"#logging.debug(\"MultiplexPOSIXIOLoop._read()\")",
"result",
"=",
"b\"\"",
"def",
"restore_captu... | https://github.com/liftoff/GateOne/blob/6ae1d01f7fe21e2703bdf982df7353e7bb81a500/termio/termio.py#L1583-L1675 | |
romanvm/django-tinymce4-lite | eef7af8ff6e9de844e14e89b084b86c4b2ba8eba | tinymce/views.py | python | spell_check | (request) | return JsonResponse(output, status=status) | Implements the TinyMCE 4 spellchecker protocol
:param request: Django http request with JSON-RPC payload from TinyMCE 4
containing a language code and a text to check for errors.
:type request: django.http.request.HttpRequest
:return: Django http response containing JSON-RPC payload
with sp... | Implements the TinyMCE 4 spellchecker protocol | [
"Implements",
"the",
"TinyMCE",
"4",
"spellchecker",
"protocol"
] | def spell_check(request):
"""
Implements the TinyMCE 4 spellchecker protocol
:param request: Django http request with JSON-RPC payload from TinyMCE 4
containing a language code and a text to check for errors.
:type request: django.http.request.HttpRequest
:return: Django http response conta... | [
"def",
"spell_check",
"(",
"request",
")",
":",
"data",
"=",
"json",
".",
"loads",
"(",
"request",
".",
"body",
".",
"decode",
"(",
"'utf-8'",
")",
")",
"output",
"=",
"{",
"'id'",
":",
"data",
"[",
"'id'",
"]",
"}",
"error",
"=",
"None",
"status",... | https://github.com/romanvm/django-tinymce4-lite/blob/eef7af8ff6e9de844e14e89b084b86c4b2ba8eba/tinymce/views.py#L25-L59 |
End of preview. Expand in Data Studio
No dataset card yet
- Downloads last month
- 36