nwo stringlengths 5 106 | sha stringlengths 40 40 | path stringlengths 4 174 | language stringclasses 1
value | identifier stringlengths 1 140 | parameters stringlengths 0 87.7k | argument_list stringclasses 1
value | return_statement stringlengths 0 426k | docstring stringlengths 0 64.3k | docstring_summary stringlengths 0 26.3k | docstring_tokens list | function stringlengths 18 4.83M | function_tokens list | url stringlengths 83 304 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
twilio/twilio-python | 6e1e811ea57a1edfadd5161ace87397c563f6915 | twilio/rest/autopilot/v1/assistant/style_sheet.py | python | StyleSheetList.get | (self) | return StyleSheetContext(self._version, assistant_sid=self._solution['assistant_sid'], ) | Constructs a StyleSheetContext
:returns: twilio.rest.autopilot.v1.assistant.style_sheet.StyleSheetContext
:rtype: twilio.rest.autopilot.v1.assistant.style_sheet.StyleSheetContext | Constructs a StyleSheetContext | [
"Constructs",
"a",
"StyleSheetContext"
] | def get(self):
"""
Constructs a StyleSheetContext
:returns: twilio.rest.autopilot.v1.assistant.style_sheet.StyleSheetContext
:rtype: twilio.rest.autopilot.v1.assistant.style_sheet.StyleSheetContext
"""
return StyleSheetContext(self._version, assistant_sid=self._solution['assistant_sid'], ) | [
"def",
"get",
"(",
"self",
")",
":",
"return",
"StyleSheetContext",
"(",
"self",
".",
"_version",
",",
"assistant_sid",
"=",
"self",
".",
"_solution",
"[",
"'assistant_sid'",
"]",
",",
")"
] | https://github.com/twilio/twilio-python/blob/6e1e811ea57a1edfadd5161ace87397c563f6915/twilio/rest/autopilot/v1/assistant/style_sheet.py#L37-L44 | |
holzschu/Carnets | 44effb10ddfc6aa5c8b0687582a724ba82c6b547 | Library/lib/python3.7/site-packages/matplotlib-3.0.3-py3.7-macosx-10.9-x86_64.egg/matplotlib/pyplot.py | python | show | (*args, **kw) | return _show(*args, **kw) | Display a figure.
When running in ipython with its pylab mode, display all
figures and return to the ipython prompt.
In non-interactive mode, display all figures and block until
the figures have been closed; in interactive mode it has no
effect unless figures were created prior to a change from
non-interactive to interactive mode (not recommended). In
that case it displays the figures but does not block.
A single experimental keyword argument, *block*, may be
set to True or False to override the blocking behavior
described above. | Display a figure.
When running in ipython with its pylab mode, display all
figures and return to the ipython prompt. | [
"Display",
"a",
"figure",
".",
"When",
"running",
"in",
"ipython",
"with",
"its",
"pylab",
"mode",
"display",
"all",
"figures",
"and",
"return",
"to",
"the",
"ipython",
"prompt",
"."
] | def show(*args, **kw):
"""
Display a figure.
When running in ipython with its pylab mode, display all
figures and return to the ipython prompt.
In non-interactive mode, display all figures and block until
the figures have been closed; in interactive mode it has no
effect unless figures were created prior to a change from
non-interactive to interactive mode (not recommended). In
that case it displays the figures but does not block.
A single experimental keyword argument, *block*, may be
set to True or False to override the blocking behavior
described above.
"""
global _show
return _show(*args, **kw) | [
"def",
"show",
"(",
"*",
"args",
",",
"*",
"*",
"kw",
")",
":",
"global",
"_show",
"return",
"_show",
"(",
"*",
"args",
",",
"*",
"*",
"kw",
")"
] | https://github.com/holzschu/Carnets/blob/44effb10ddfc6aa5c8b0687582a724ba82c6b547/Library/lib/python3.7/site-packages/matplotlib-3.0.3-py3.7-macosx-10.9-x86_64.egg/matplotlib/pyplot.py#L237-L254 | |
friends-of-freeswitch/switchio | dee6e9addcf881b2b411ec1dbb397b0acfbb78cf | switchio/models.py | python | Session.__getitem__ | (self, key) | [] | def __getitem__(self, key):
try:
return self.events[key]
except KeyError:
raise KeyError("'{}' not found for session '{}'"
.format(key, self.uuid)) | [
"def",
"__getitem__",
"(",
"self",
",",
"key",
")",
":",
"try",
":",
"return",
"self",
".",
"events",
"[",
"key",
"]",
"except",
"KeyError",
":",
"raise",
"KeyError",
"(",
"\"'{}' not found for session '{}'\"",
".",
"format",
"(",
"key",
",",
"self",
".",
... | https://github.com/friends-of-freeswitch/switchio/blob/dee6e9addcf881b2b411ec1dbb397b0acfbb78cf/switchio/models.py#L132-L137 | ||||
chainer/chainercv | 7159616642e0be7c5b3ef380b848e16b7e99355b | chainercv/experimental/links/model/fcis/fcis_resnet101.py | python | ResNet101Extractor.forward | (self, x) | return res4, res5 | Forward the chain.
Args:
x (~chainer.Variable): 4D image variable. | Forward the chain. | [
"Forward",
"the",
"chain",
"."
] | def forward(self, x):
"""Forward the chain.
Args:
x (~chainer.Variable): 4D image variable.
"""
with chainer.using_config('train', False):
h = self.pool1(self.conv1(x))
h = self.res2(h)
h.unchain_backward()
h = self.res3(h)
res4 = self.res4(h)
res5 = self.res5(res4)
return res4, res5 | [
"def",
"forward",
"(",
"self",
",",
"x",
")",
":",
"with",
"chainer",
".",
"using_config",
"(",
"'train'",
",",
"False",
")",
":",
"h",
"=",
"self",
".",
"pool1",
"(",
"self",
".",
"conv1",
"(",
"x",
")",
")",
"h",
"=",
"self",
".",
"res2",
"("... | https://github.com/chainer/chainercv/blob/7159616642e0be7c5b3ef380b848e16b7e99355b/chainercv/experimental/links/model/fcis/fcis_resnet101.py#L235-L250 | |
Rapptz/discord.py | 45d498c1b76deaf3b394d17ccf56112fa691d160 | discord/user.py | python | BaseUser.colour | (self) | return Colour.default() | :class:`Colour`: A property that returns a colour denoting the rendered colour
for the user. This always returns :meth:`Colour.default`.
There is an alias for this named :attr:`color`. | :class:`Colour`: A property that returns a colour denoting the rendered colour
for the user. This always returns :meth:`Colour.default`. | [
":",
"class",
":",
"Colour",
":",
"A",
"property",
"that",
"returns",
"a",
"colour",
"denoting",
"the",
"rendered",
"colour",
"for",
"the",
"user",
".",
"This",
"always",
"returns",
":",
"meth",
":",
"Colour",
".",
"default",
"."
] | def colour(self) -> Colour:
""":class:`Colour`: A property that returns a colour denoting the rendered colour
for the user. This always returns :meth:`Colour.default`.
There is an alias for this named :attr:`color`.
"""
return Colour.default() | [
"def",
"colour",
"(",
"self",
")",
"->",
"Colour",
":",
"return",
"Colour",
".",
"default",
"(",
")"
] | https://github.com/Rapptz/discord.py/blob/45d498c1b76deaf3b394d17ccf56112fa691d160/discord/user.py#L220-L226 | |
microsoft/azure-devops-python-api | 451cade4c475482792cbe9e522c1fee32393139e | azure-devops/azure/devops/v6_0/gallery/gallery_client.py | python | GalleryClient.get_asset_from_edit_extension_draft | (self, publisher_name, draft_id, asset_type, extension_name, **kwargs) | return self._client.stream_download(response, callback=callback) | GetAssetFromEditExtensionDraft.
[Preview API]
:param str publisher_name:
:param str draft_id:
:param str asset_type:
:param str extension_name:
:rtype: object | GetAssetFromEditExtensionDraft.
[Preview API]
:param str publisher_name:
:param str draft_id:
:param str asset_type:
:param str extension_name:
:rtype: object | [
"GetAssetFromEditExtensionDraft",
".",
"[",
"Preview",
"API",
"]",
":",
"param",
"str",
"publisher_name",
":",
":",
"param",
"str",
"draft_id",
":",
":",
"param",
"str",
"asset_type",
":",
":",
"param",
"str",
"extension_name",
":",
":",
"rtype",
":",
"objec... | def get_asset_from_edit_extension_draft(self, publisher_name, draft_id, asset_type, extension_name, **kwargs):
"""GetAssetFromEditExtensionDraft.
[Preview API]
:param str publisher_name:
:param str draft_id:
:param str asset_type:
:param str extension_name:
:rtype: object
"""
route_values = {}
if publisher_name is not None:
route_values['publisherName'] = self._serialize.url('publisher_name', publisher_name, 'str')
if draft_id is not None:
route_values['draftId'] = self._serialize.url('draft_id', draft_id, 'str')
if asset_type is not None:
route_values['assetType'] = self._serialize.url('asset_type', asset_type, 'str')
query_parameters = {}
if extension_name is not None:
query_parameters['extensionName'] = self._serialize.query('extension_name', extension_name, 'str')
response = self._send(http_method='GET',
location_id='88c0b1c8-b4f1-498a-9b2a-8446ef9f32e7',
version='6.0-preview.1',
route_values=route_values,
query_parameters=query_parameters,
accept_media_type='application/octet-stream')
if "callback" in kwargs:
callback = kwargs["callback"]
else:
callback = None
return self._client.stream_download(response, callback=callback) | [
"def",
"get_asset_from_edit_extension_draft",
"(",
"self",
",",
"publisher_name",
",",
"draft_id",
",",
"asset_type",
",",
"extension_name",
",",
"*",
"*",
"kwargs",
")",
":",
"route_values",
"=",
"{",
"}",
"if",
"publisher_name",
"is",
"not",
"None",
":",
"ro... | https://github.com/microsoft/azure-devops-python-api/blob/451cade4c475482792cbe9e522c1fee32393139e/azure-devops/azure/devops/v6_0/gallery/gallery_client.py#L666-L695 | |
tdamdouni/Pythonista | 3e082d53b6b9b501a3c8cf3251a8ad4c8be9c2ad | tasks/RobinsieblerTaskList/tasklist.py | python | TaskList.delete_task | (self, task_id) | Delete the given task.
:param task_id: id of the task to delete | Delete the given task. | [
"Delete",
"the",
"given",
"task",
"."
] | def delete_task(self, task_id):
"""Delete the given task.
:param task_id: id of the task to delete
"""
task = self._find_task(task_id)
if task:
self.tasks.remove(task) | [
"def",
"delete_task",
"(",
"self",
",",
"task_id",
")",
":",
"task",
"=",
"self",
".",
"_find_task",
"(",
"task_id",
")",
"if",
"task",
":",
"self",
".",
"tasks",
".",
"remove",
"(",
"task",
")"
] | https://github.com/tdamdouni/Pythonista/blob/3e082d53b6b9b501a3c8cf3251a8ad4c8be9c2ad/tasks/RobinsieblerTaskList/tasklist.py#L62-L70 | ||
IronLanguages/ironpython2 | 51fdedeeda15727717fb8268a805f71b06c0b9f1 | Src/StdLib/Lib/email/iterators.py | python | typed_subpart_iterator | (msg, maintype='text', subtype=None) | Iterate over the subparts with a given MIME type.
Use `maintype' as the main MIME type to match against; this defaults to
"text". Optional `subtype' is the MIME subtype to match against; if
omitted, only the main type is matched. | Iterate over the subparts with a given MIME type. | [
"Iterate",
"over",
"the",
"subparts",
"with",
"a",
"given",
"MIME",
"type",
"."
] | def typed_subpart_iterator(msg, maintype='text', subtype=None):
"""Iterate over the subparts with a given MIME type.
Use `maintype' as the main MIME type to match against; this defaults to
"text". Optional `subtype' is the MIME subtype to match against; if
omitted, only the main type is matched.
"""
for subpart in msg.walk():
if subpart.get_content_maintype() == maintype:
if subtype is None or subpart.get_content_subtype() == subtype:
yield subpart | [
"def",
"typed_subpart_iterator",
"(",
"msg",
",",
"maintype",
"=",
"'text'",
",",
"subtype",
"=",
"None",
")",
":",
"for",
"subpart",
"in",
"msg",
".",
"walk",
"(",
")",
":",
"if",
"subpart",
".",
"get_content_maintype",
"(",
")",
"==",
"maintype",
":",
... | https://github.com/IronLanguages/ironpython2/blob/51fdedeeda15727717fb8268a805f71b06c0b9f1/Src/StdLib/Lib/email/iterators.py#L47-L57 | ||
dimagi/commcare-hq | d67ff1d3b4c51fa050c19e60c3253a79d3452a39 | corehq/apps/app_manager/views/cli.py | python | list_apps | (request, domain) | return JsonResponse({
'status': 'success',
'applications': list(map(app_to_json, applications)),
}) | [] | def list_apps(request, domain):
def app_to_json(app):
return {
'name': app.name,
'version': app.version,
'app_id': app.get_id,
'download_url': absolute_reverse('direct_ccz', args=[domain],
params={'app_id': app.get_id})
}
applications = Domain.get_by_name(domain).applications()
return JsonResponse({
'status': 'success',
'applications': list(map(app_to_json, applications)),
}) | [
"def",
"list_apps",
"(",
"request",
",",
"domain",
")",
":",
"def",
"app_to_json",
"(",
"app",
")",
":",
"return",
"{",
"'name'",
":",
"app",
".",
"name",
",",
"'version'",
":",
"app",
".",
"version",
",",
"'app_id'",
":",
"app",
".",
"get_id",
",",
... | https://github.com/dimagi/commcare-hq/blob/d67ff1d3b4c51fa050c19e60c3253a79d3452a39/corehq/apps/app_manager/views/cli.py#L28-L41 | |||
SublimeText/ColdFusion | dbe2f76038fe77fe90b4cc4a0651aa817f14f1a3 | taglib/cf9.py | python | tags.__init__ | (self) | [] | def __init__(self):
super(tags, self).__init__()
self.completions['cfapplication'] = {
'completions': [
("name\t@name", "name=\"$1\"$0"),
("loginstorage\t@loginstorage", "loginstorage=\"$1\"$0"),
("loginstorage=\"cookie\"\tloginstorage", "loginstorage=\"${1:cookie}\"$0"),
("loginstorage=\"session\"\tloginstorage", "loginstorage=\"${1:session}\"$0"),
("clientmanagement\t@clientmanagement", "clientmanagement=\"$1\"$0"),
("clientmanagement=\"true\"\tclientmanagement", "clientmanagement=\"${1:true}\"$0"),
("clientmanagement=\"false\"\tclientmanagement", "clientmanagement=\"${1:false}\"$0"),
("clientstorage\t@clientstorage", "clientstorage=\"$1\"$0"),
("clientstorage=\"cookie\"\tclientstorage", "clientstorage=\"${1:cookie}\"$0"),
("clientstorage=\"registry\"\tclientstorage", "clientstorage=\"${1:registry}\"$0"),
("clientstorage=\"datasource_name\"\tclientstorage", "clientstorage=\"${1:datasource_name}\"$0"),
("setclientcookies\t@setclientcookies", "setclientcookies=\"$1\"$0"),
("setclientcookies=\"true\"\tsetclientcookies", "setclientcookies=\"${1:true}\"$0"),
("setclientcookies=\"false\"\tsetclientcookies", "setclientcookies=\"${1:false}\"$0"),
("sessionmanagement\t@sessionmanagement", "sessionmanagement=\"$1\"$0"),
("sessionmanagement=\"true\"\tsessionmanagement", "sessionmanagement=\"${1:true}\"$0"),
("sessionmanagement=\"false\"\tsessionmanagement", "sessionmanagement=\"${1:false}\"$0"),
("sessiontimeout\t@sessiontimeout", "sessiontimeout=\"$1\"$0"),
("applicationtimeout\t@applicationtimeout", "applicationtimeout=\"$1\"$0"),
("setdomaincookies\t@setdomaincookies", "setdomaincookies=\"$1\"$0"),
("setdomaincookies=\"true\"\tsetdomaincookies", "setdomaincookies=\"${1:true}\"$0"),
("setdomaincookies=\"false\"\tsetdomaincookies", "setdomaincookies=\"${1:false}\"$0"),
("scriptprotect\t@scriptprotect", "scriptprotect=\"$1\"$0"),
("scriptprotect=\"none\"\tscriptprotect", "scriptprotect=\"${1:none}\"$0"),
("scriptprotect=\"all\"\tscriptprotect", "scriptprotect=\"${1:all}\"$0"),
("scriptprotect=\"form\"\tscriptprotect", "scriptprotect=\"${1:form}\"$0"),
("scriptprotect=\"url\"\tscriptprotect", "scriptprotect=\"${1:url}\"$0"),
("scriptprotect=\"cookie\"\tscriptprotect", "scriptprotect=\"${1:cookie}\"$0"),
("scriptprotect=\"cgi\"\tscriptprotect", "scriptprotect=\"${1:cgi}\"$0"),
("scriptprotect=\"form,url\"\tscriptprotect", "scriptprotect=\"${1:form,url}\"$0"),
("scriptprotect=\"form,url,cookie\"\tscriptprotect", "scriptprotect=\"${1:form,url,cookie}\"$0"),
("scriptprotect=\"form,url,cookie,cgi\"\tscriptprotect", "scriptprotect=\"${1:form,url,cookie,cgi}\"$0"),
("securejsonprefix\t@securejsonprefix", "securejsonprefix=\"$1\"$0"),
("securejsonprefix=\"true\"\tsecurejsonprefix", "securejsonprefix=\"${1:true}\"$0"),
("securejsonprefix=\"false\"\tsecurejsonprefix", "securejsonprefix=\"${1:false}\"$0"),
("securejson\t@securejson", "securejson=\"$1\"$0"),
("securejson=\"true\"\tsecurejson", "securejson=\"${1:true}\"$0"),
("securejson=\"false\"\tsecurejson", "securejson=\"${1:false}\"$0"),
("serverSideFormValidation\t@serverSideFormValidation", "serverSideFormValidation=\"$1\"$0"),
("serverSideFormValidation=\"true\"\tserverSideFormValidation", "serverSideFormValidation=\"${1:true}\"$0"),
("serverSideFormValidation=\"false\"\tserverSideFormValidation", "serverSideFormValidation=\"${1:false}\"$0"),
("datasource\t@datasource", "datasource=\"$1\"$0")
],
'attributes': [
"setclientcookies",
"datasource",
"name",
"scriptprotect",
"sessiontimeout",
"setdomaincookies",
"loginstorage",
"sessionmanagement",
"securejson",
"serverSideFormValidation",
"clientmanagement",
"clientstorage",
"applicationtimeout",
"securejsonprefix"
]
}
self.completions['cfargument'] = {
'completions': [
("name\t@name", "name=\"$1\"$0"),
("type\t@type", "type=\"$1\"$0"),
("type=\"any\"\ttype", "type=\"${1:any}\"$0"),
("type=\"array\"\ttype", "type=\"${1:array}\"$0"),
("type=\"binary\"\ttype", "type=\"${1:binary}\"$0"),
("type=\"boolean\"\ttype", "type=\"${1:boolean}\"$0"),
("type=\"date\"\ttype", "type=\"${1:date}\"$0"),
("type=\"guid\"\ttype", "type=\"${1:guid}\"$0"),
("type=\"numeric\"\ttype", "type=\"${1:numeric}\"$0"),
("type=\"query\"\ttype", "type=\"${1:query}\"$0"),
("type=\"string\"\ttype", "type=\"${1:string}\"$0"),
("type=\"struct\"\ttype", "type=\"${1:struct}\"$0"),
("type=\"uuid\"\ttype", "type=\"${1:uuid}\"$0"),
("type=\"xml\"\ttype", "type=\"${1:xml}\"$0"),
("type=\"variablename\"\ttype", "type=\"${1:variablename}\"$0"),
("type=\"(component name)\"\ttype", "type=\"${1:(component name)}\"$0"),
("required\t@required", "required=\"$1\"$0"),
("required=\"true\"\trequired", "required=\"${1:true}\"$0"),
("required=\"false\"\trequired", "required=\"${1:false}\"$0"),
("default\t@default", "default=\"$1\"$0"),
("displayname\t@displayname", "displayname=\"$1\"$0"),
("hint\t@hint", "hint=\"$1\"$0")
],
'attributes': [
"hint",
"displayname",
"name",
"type",
"default",
"required"
]
}
self.completions['cfcache'] = {
'completions': [
("action\t@action", "action=\"$1\"$0"),
("action=\"cache\"\taction", "action=\"${1:cache}\"$0"),
("action=\"flush\"\taction", "action=\"${1:flush}\"$0"),
("action=\"clientcache\"\taction", "action=\"${1:clientcache}\"$0"),
("action=\"servercache\"\taction", "action=\"${1:servercache}\"$0"),
("action=\"optimal\"\taction", "action=\"${1:optimal}\"$0"),
("action=\"get\"\taction", "action=\"${1:get}\"$0"),
("action=\"put\"\taction", "action=\"${1:put}\"$0"),
("directory\t@directory", "directory=\"$1\"$0"),
("timespan\t@timespan", "timespan=\"$1\"$0"),
("expireurl\t@expireurl", "expireurl=\"$1\"$0"),
("username\t@username", "username=\"$1\"$0"),
("password\t@password", "password=\"$1\"$0"),
("port\t@port", "port=\"$1\"$0"),
("protocol\t@protocol", "protocol=\"$1\"$0"),
("protocol=\"http://\"\tprotocol", "protocol=\"${1:http://}\"$0"),
("protocol=\"https://\"\tprotocol", "protocol=\"${1:https://}\"$0"),
("value\t@value", "value=\"$1\"$0"),
("metadata\t@metadata", "metadata=\"$1\"$0"),
("stripwhitespace\t@stripwhitespace", "stripwhitespace=\"$1\"$0"),
("stripwhitespace=\"true\"\tstripwhitespace", "stripwhitespace=\"${1:true}\"$0"),
("stripwhitespace=\"false\"\tstripwhitespace", "stripwhitespace=\"${1:false}\"$0"),
("throwonerror\t@throwonerror", "throwonerror=\"$1\"$0"),
("throwonerror=\"true\"\tthrowonerror", "throwonerror=\"${1:true}\"$0"),
("throwonerror=\"false\"\tthrowonerror", "throwonerror=\"${1:false}\"$0"),
("id\t@id", "id=\"$1\"$0"),
("key\t@key", "key=\"$1\"$0"),
("usecache\t@usecache", "usecache=\"$1\"$0"),
("usecache=\"true\"\tusecache", "usecache=\"${1:true}\"$0"),
("usecache=\"false\"\tusecache", "usecache=\"${1:false}\"$0"),
("dependson\t@dependson", "dependson=\"$1\"$0"),
("idletime\t@idletime", "idletime=\"$1\"$0"),
("name\t@name", "name=\"$1\"$0"),
("useQueryString\t@useQueryString", "useQueryString=\"$1\"$0"),
("useQueryString=\"true\"\tuseQueryString", "useQueryString=\"${1:true}\"$0"),
("useQueryString=\"false\"\tuseQueryString", "useQueryString=\"${1:false}\"$0")
],
'attributes': [
"name",
"key",
"timespan",
"stripwhitespace",
"port",
"directory",
"useQueryString",
"value",
"idletime",
"dependson",
"usecache",
"metadata",
"throwonerror",
"id",
"username",
"protocol",
"password",
"action",
"expireurl"
]
}
self.completions['cfcatch'] = {
'completions': [
("type\t@type", "type=\"$1\"$0"),
("type=\"application\"\ttype", "type=\"${1:application}\"$0"),
("type=\"database\"\ttype", "type=\"${1:database}\"$0"),
("type=\"template\"\ttype", "type=\"${1:template}\"$0"),
("type=\"security\"\ttype", "type=\"${1:security}\"$0"),
("type=\"object\"\ttype", "type=\"${1:object}\"$0"),
("type=\"missinginclude\"\ttype", "type=\"${1:missinginclude}\"$0"),
("type=\"expression\"\ttype", "type=\"${1:expression}\"$0"),
("type=\"lock\"\ttype", "type=\"${1:lock}\"$0"),
("type=\"custom_type\"\ttype", "type=\"${1:custom_type}\"$0"),
("type=\"searchengine\"\ttype", "type=\"${1:searchengine}\"$0"),
("type=\"any\"\ttype", "type=\"${1:any}\"$0")
],
'attributes': [
"type"
]
}
self.completions['cfchart'] = {
'completions': [
("format\t@format", "format=\"$1\"$0"),
("format=\"flash\"\tformat", "format=\"${1:flash}\"$0"),
("format=\"jpg\"\tformat", "format=\"${1:jpg}\"$0"),
("format=\"png\"\tformat", "format=\"${1:png}\"$0"),
("chartheight\t@chartheight", "chartheight=\"$1\"$0"),
("chartwidth\t@chartwidth", "chartwidth=\"$1\"$0"),
("scalefrom\t@scalefrom", "scalefrom=\"$1\"$0"),
("scaleto\t@scaleto", "scaleto=\"$1\"$0"),
("showxgridlines\t@showxgridlines", "showxgridlines=\"$1\"$0"),
("showxgridlines=\"true\"\tshowxgridlines", "showxgridlines=\"${1:true}\"$0"),
("showxgridlines=\"false\"\tshowxgridlines", "showxgridlines=\"${1:false}\"$0"),
("showygridlines\t@showygridlines", "showygridlines=\"$1\"$0"),
("showygridlines=\"true\"\tshowygridlines", "showygridlines=\"${1:true}\"$0"),
("showygridlines=\"false\"\tshowygridlines", "showygridlines=\"${1:false}\"$0"),
("gridlines\t@gridlines", "gridlines=\"$1\"$0"),
("seriesplacement\t@seriesplacement", "seriesplacement=\"$1\"$0"),
("seriesplacement=\"default\"\tseriesplacement", "seriesplacement=\"${1:default}\"$0"),
("seriesplacement=\"cluster\"\tseriesplacement", "seriesplacement=\"${1:cluster}\"$0"),
("seriesplacement=\"stacked\"\tseriesplacement", "seriesplacement=\"${1:stacked}\"$0"),
("seriesplacement=\"percent\"\tseriesplacement", "seriesplacement=\"${1:percent}\"$0"),
("foregroundcolor\t@foregroundcolor", "foregroundcolor=\"$1\"$0"),
("foregroundcolor=\"aqua\"\tforegroundcolor", "foregroundcolor=\"${1:aqua}\"$0"),
("foregroundcolor=\"black\"\tforegroundcolor", "foregroundcolor=\"${1:black}\"$0"),
("foregroundcolor=\"blue\"\tforegroundcolor", "foregroundcolor=\"${1:blue}\"$0"),
("foregroundcolor=\"fuchsia\"\tforegroundcolor", "foregroundcolor=\"${1:fuchsia}\"$0"),
("foregroundcolor=\"grey\"\tforegroundcolor", "foregroundcolor=\"${1:grey}\"$0"),
("foregroundcolor=\"green\"\tforegroundcolor", "foregroundcolor=\"${1:green}\"$0"),
("foregroundcolor=\"lime\"\tforegroundcolor", "foregroundcolor=\"${1:lime}\"$0"),
("foregroundcolor=\"maroon\"\tforegroundcolor", "foregroundcolor=\"${1:maroon}\"$0"),
("foregroundcolor=\"navy\"\tforegroundcolor", "foregroundcolor=\"${1:navy}\"$0"),
("foregroundcolor=\"olive\"\tforegroundcolor", "foregroundcolor=\"${1:olive}\"$0"),
("foregroundcolor=\"purple\"\tforegroundcolor", "foregroundcolor=\"${1:purple}\"$0"),
("foregroundcolor=\"red\"\tforegroundcolor", "foregroundcolor=\"${1:red}\"$0"),
("foregroundcolor=\"silver\"\tforegroundcolor", "foregroundcolor=\"${1:silver}\"$0"),
("foregroundcolor=\"teal\"\tforegroundcolor", "foregroundcolor=\"${1:teal}\"$0"),
("foregroundcolor=\"white\"\tforegroundcolor", "foregroundcolor=\"${1:white}\"$0"),
("foregroundcolor=\"yellow\"\tforegroundcolor", "foregroundcolor=\"${1:yellow}\"$0"),
("backgroundcolor\t@backgroundcolor", "backgroundcolor=\"$1\"$0"),
("backgroundcolor=\"aqua\"\tbackgroundcolor", "backgroundcolor=\"${1:aqua}\"$0"),
("backgroundcolor=\"black\"\tbackgroundcolor", "backgroundcolor=\"${1:black}\"$0"),
("backgroundcolor=\"blue\"\tbackgroundcolor", "backgroundcolor=\"${1:blue}\"$0"),
("backgroundcolor=\"fuchsia\"\tbackgroundcolor", "backgroundcolor=\"${1:fuchsia}\"$0"),
("backgroundcolor=\"grey\"\tbackgroundcolor", "backgroundcolor=\"${1:grey}\"$0"),
("backgroundcolor=\"green\"\tbackgroundcolor", "backgroundcolor=\"${1:green}\"$0"),
("backgroundcolor=\"lime\"\tbackgroundcolor", "backgroundcolor=\"${1:lime}\"$0"),
("backgroundcolor=\"maroon\"\tbackgroundcolor", "backgroundcolor=\"${1:maroon}\"$0"),
("backgroundcolor=\"navy\"\tbackgroundcolor", "backgroundcolor=\"${1:navy}\"$0"),
("backgroundcolor=\"olive\"\tbackgroundcolor", "backgroundcolor=\"${1:olive}\"$0"),
("backgroundcolor=\"purple\"\tbackgroundcolor", "backgroundcolor=\"${1:purple}\"$0"),
("backgroundcolor=\"red\"\tbackgroundcolor", "backgroundcolor=\"${1:red}\"$0"),
("backgroundcolor=\"silver\"\tbackgroundcolor", "backgroundcolor=\"${1:silver}\"$0"),
("backgroundcolor=\"teal\"\tbackgroundcolor", "backgroundcolor=\"${1:teal}\"$0"),
("backgroundcolor=\"white\"\tbackgroundcolor", "backgroundcolor=\"${1:white}\"$0"),
("backgroundcolor=\"yellow\"\tbackgroundcolor", "backgroundcolor=\"${1:yellow}\"$0"),
("showborder\t@showborder", "showborder=\"$1\"$0"),
("showborder=\"true\"\tshowborder", "showborder=\"${1:true}\"$0"),
("showborder=\"false\"\tshowborder", "showborder=\"${1:false}\"$0"),
("databackgroundcolor\t@databackgroundcolor", "databackgroundcolor=\"$1\"$0"),
("databackgroundcolor=\"aqua\"\tdatabackgroundcolor", "databackgroundcolor=\"${1:aqua}\"$0"),
("databackgroundcolor=\"black\"\tdatabackgroundcolor", "databackgroundcolor=\"${1:black}\"$0"),
("databackgroundcolor=\"blue\"\tdatabackgroundcolor", "databackgroundcolor=\"${1:blue}\"$0"),
("databackgroundcolor=\"fuchsia\"\tdatabackgroundcolor", "databackgroundcolor=\"${1:fuchsia}\"$0"),
("databackgroundcolor=\"grey\"\tdatabackgroundcolor", "databackgroundcolor=\"${1:grey}\"$0"),
("databackgroundcolor=\"green\"\tdatabackgroundcolor", "databackgroundcolor=\"${1:green}\"$0"),
("databackgroundcolor=\"lime\"\tdatabackgroundcolor", "databackgroundcolor=\"${1:lime}\"$0"),
("databackgroundcolor=\"maroon\"\tdatabackgroundcolor", "databackgroundcolor=\"${1:maroon}\"$0"),
("databackgroundcolor=\"navy\"\tdatabackgroundcolor", "databackgroundcolor=\"${1:navy}\"$0"),
("databackgroundcolor=\"olive\"\tdatabackgroundcolor", "databackgroundcolor=\"${1:olive}\"$0"),
("databackgroundcolor=\"purple\"\tdatabackgroundcolor", "databackgroundcolor=\"${1:purple}\"$0"),
("databackgroundcolor=\"red\"\tdatabackgroundcolor", "databackgroundcolor=\"${1:red}\"$0"),
("databackgroundcolor=\"silver\"\tdatabackgroundcolor", "databackgroundcolor=\"${1:silver}\"$0"),
("databackgroundcolor=\"teal\"\tdatabackgroundcolor", "databackgroundcolor=\"${1:teal}\"$0"),
("databackgroundcolor=\"white\"\tdatabackgroundcolor", "databackgroundcolor=\"${1:white}\"$0"),
("databackgroundcolor=\"yellow\"\tdatabackgroundcolor", "databackgroundcolor=\"${1:yellow}\"$0"),
("font\t@font", "font=\"$1\"$0"),
("font=\"arial\"\tfont", "font=\"${1:arial}\"$0"),
("font=\"times\"\tfont", "font=\"${1:times}\"$0"),
("font=\"courier\"\tfont", "font=\"${1:courier}\"$0"),
("font=\"arialunicodeMS\"\tfont", "font=\"${1:arialunicodeMS}\"$0"),
("fontsize\t@fontsize", "fontsize=\"$1\"$0"),
("fontitalic\t@fontitalic", "fontitalic=\"$1\"$0"),
("fontitalic=\"true\"\tfontitalic", "fontitalic=\"${1:true}\"$0"),
("fontitalic=\"false\"\tfontitalic", "fontitalic=\"${1:false}\"$0"),
("fontbold\t@fontbold", "fontbold=\"$1\"$0"),
("fontbold=\"true\"\tfontbold", "fontbold=\"${1:true}\"$0"),
("fontbold=\"false\"\tfontbold", "fontbold=\"${1:false}\"$0"),
("labelformat\t@labelformat", "labelformat=\"$1\"$0"),
("labelformat=\"number\"\tlabelformat", "labelformat=\"${1:number}\"$0"),
("labelformat=\"currency\"\tlabelformat", "labelformat=\"${1:currency}\"$0"),
("labelformat=\"percent\"\tlabelformat", "labelformat=\"${1:percent}\"$0"),
("labelformat=\"date\"\tlabelformat", "labelformat=\"${1:date}\"$0"),
("xaxistitle\t@xaxistitle", "xaxistitle=\"$1\"$0"),
("yaxistitle\t@yaxistitle", "yaxistitle=\"$1\"$0"),
("xaxistype\t@xaxistype", "xaxistype=\"$1\"$0"),
("xaxistype=\"category\"\txaxistype", "xaxistype=\"${1:category}\"$0"),
("xaxistype=\"scale\"\txaxistype", "xaxistype=\"${1:scale}\"$0"),
("yaxistype\t@yaxistype", "yaxistype=\"$1\"$0"),
("yaxistype=\"category\"\tyaxistype", "yaxistype=\"${1:category}\"$0"),
("yaxistype=\"scale\"\tyaxistype", "yaxistype=\"${1:scale}\"$0"),
("sortxaxis\t@sortxaxis", "sortxaxis=\"$1\"$0"),
("sortxaxis=\"true\"\tsortxaxis", "sortxaxis=\"${1:true}\"$0"),
("sortxaxis=\"false\"\tsortxaxis", "sortxaxis=\"${1:false}\"$0"),
("show3d\t@show3d", "show3d=\"$1\"$0"),
("show3d=\"true\"\tshow3d", "show3d=\"${1:true}\"$0"),
("show3d=\"false\"\tshow3d", "show3d=\"${1:false}\"$0"),
("xoffset\t@xoffset", "xoffset=\"$1\"$0"),
("yoffset\t@yoffset", "yoffset=\"$1\"$0"),
("showlegend\t@showlegend", "showlegend=\"$1\"$0"),
("showlegend=\"true\"\tshowlegend", "showlegend=\"${1:true}\"$0"),
("showlegend=\"false\"\tshowlegend", "showlegend=\"${1:false}\"$0"),
("tipstyle\t@tipstyle", "tipstyle=\"$1\"$0"),
("tipstyle=\"mouseDown\"\ttipstyle", "tipstyle=\"${1:mouseDown}\"$0"),
("tipstyle=\"mouseOver\"\ttipstyle", "tipstyle=\"${1:mouseOver}\"$0"),
("tipstyle=\"none\"\ttipstyle", "tipstyle=\"${1:none}\"$0"),
("tipbgcolor\t@tipbgcolor", "tipbgcolor=\"$1\"$0"),
("tipbgcolor=\"aqua\"\ttipbgcolor", "tipbgcolor=\"${1:aqua}\"$0"),
("tipbgcolor=\"black\"\ttipbgcolor", "tipbgcolor=\"${1:black}\"$0"),
("tipbgcolor=\"blue\"\ttipbgcolor", "tipbgcolor=\"${1:blue}\"$0"),
("tipbgcolor=\"fuchsia\"\ttipbgcolor", "tipbgcolor=\"${1:fuchsia}\"$0"),
("tipbgcolor=\"grey\"\ttipbgcolor", "tipbgcolor=\"${1:grey}\"$0"),
("tipbgcolor=\"green\"\ttipbgcolor", "tipbgcolor=\"${1:green}\"$0"),
("tipbgcolor=\"lime\"\ttipbgcolor", "tipbgcolor=\"${1:lime}\"$0"),
("tipbgcolor=\"maroon\"\ttipbgcolor", "tipbgcolor=\"${1:maroon}\"$0"),
("tipbgcolor=\"navy\"\ttipbgcolor", "tipbgcolor=\"${1:navy}\"$0"),
("tipbgcolor=\"olive\"\ttipbgcolor", "tipbgcolor=\"${1:olive}\"$0"),
("tipbgcolor=\"purple\"\ttipbgcolor", "tipbgcolor=\"${1:purple}\"$0"),
("tipbgcolor=\"red\"\ttipbgcolor", "tipbgcolor=\"${1:red}\"$0"),
("tipbgcolor=\"silver\"\ttipbgcolor", "tipbgcolor=\"${1:silver}\"$0"),
("tipbgcolor=\"teal\"\ttipbgcolor", "tipbgcolor=\"${1:teal}\"$0"),
("tipbgcolor=\"white\"\ttipbgcolor", "tipbgcolor=\"${1:white}\"$0"),
("tipbgcolor=\"yellow\"\ttipbgcolor", "tipbgcolor=\"${1:yellow}\"$0"),
("showmarkers\t@showmarkers", "showmarkers=\"$1\"$0"),
("showmarkers=\"true\"\tshowmarkers", "showmarkers=\"${1:true}\"$0"),
("showmarkers=\"false\"\tshowmarkers", "showmarkers=\"${1:false}\"$0"),
("markersize\t@markersize", "markersize=\"$1\"$0"),
("pieslicestyle\t@pieslicestyle", "pieslicestyle=\"$1\"$0"),
("pieslicestyle=\"solid\"\tpieslicestyle", "pieslicestyle=\"${1:solid}\"$0"),
("pieslicestyle=\"sliced\"\tpieslicestyle", "pieslicestyle=\"${1:sliced}\"$0"),
("URL\t@URL", "URL=\"$1\"$0"),
("name\t@name", "name=\"$1\"$0"),
("style\t@style", "style=\"$1\"$0"),
("style=\"beige\"\tstyle", "style=\"${1:beige}\"$0"),
("style=\"blue\"\tstyle", "style=\"${1:blue}\"$0"),
("style=\"default\"\tstyle", "style=\"${1:default}\"$0"),
("style=\"red\"\tstyle", "style=\"${1:red}\"$0"),
("style=\"silver\"\tstyle", "style=\"${1:silver}\"$0"),
("style=\"yellow\"\tstyle", "style=\"${1:yellow}\"$0"),
("title\t@title", "title=\"$1\"$0")
],
'attributes': [
"xaxistype",
"pieslicestyle",
"fontbold",
"sortxaxis",
"showxgridlines",
"showmarkers",
"databackgroundcolor",
"chartheight",
"tipstyle",
"URL",
"chartwidth",
"gridlines",
"xoffset",
"show3d",
"tipbgcolor",
"name",
"yaxistype",
"showygridlines",
"markersize",
"showborder",
"yaxistitle",
"foregroundcolor",
"scalefrom",
"fontsize",
"style",
"scaleto",
"seriesplacement",
"font",
"yoffset",
"format",
"showlegend",
"backgroundcolor",
"fontitalic",
"labelformat",
"xaxistitle",
"title"
]
}
self.completions['cfchartseries'] = {
'completions': [
("type\t@type", "type=\"$1\"$0"),
("type=\"bar\"\ttype", "type=\"${1:bar}\"$0"),
("type=\"line\"\ttype", "type=\"${1:line}\"$0"),
("type=\"pyramid\"\ttype", "type=\"${1:pyramid}\"$0"),
("type=\"area\"\ttype", "type=\"${1:area}\"$0"),
("type=\"horizontalbar\"\ttype", "type=\"${1:horizontalbar}\"$0"),
("type=\"cone\"\ttype", "type=\"${1:cone}\"$0"),
("type=\"curve\"\ttype", "type=\"${1:curve}\"$0"),
("type=\"cylinder\"\ttype", "type=\"${1:cylinder}\"$0"),
("type=\"step\"\ttype", "type=\"${1:step}\"$0"),
("type=\"scatter\"\ttype", "type=\"${1:scatter}\"$0"),
("type=\"pie\"\ttype", "type=\"${1:pie}\"$0"),
("query\t@query", "query=\"$1\"$0"),
("itemcolumn\t@itemcolumn", "itemcolumn=\"$1\"$0"),
("valuecolumn\t@valuecolumn", "valuecolumn=\"$1\"$0"),
("serieslabel\t@serieslabel", "serieslabel=\"$1\"$0"),
("seriescolor\t@seriescolor", "seriescolor=\"$1\"$0"),
("paintstyle\t@paintstyle", "paintstyle=\"$1\"$0"),
("paintstyle=\"plain\"\tpaintstyle", "paintstyle=\"${1:plain}\"$0"),
("paintstyle=\"raise\"\tpaintstyle", "paintstyle=\"${1:raise}\"$0"),
("paintstyle=\"shade\"\tpaintstyle", "paintstyle=\"${1:shade}\"$0"),
("paintstyle=\"light\"\tpaintstyle", "paintstyle=\"${1:light}\"$0"),
("markerstyle\t@markerstyle", "markerstyle=\"$1\"$0"),
("markerstyle=\"rectangle\"\tmarkerstyle", "markerstyle=\"${1:rectangle}\"$0"),
("markerstyle=\"triangle\"\tmarkerstyle", "markerstyle=\"${1:triangle}\"$0"),
("markerstyle=\"diamond\"\tmarkerstyle", "markerstyle=\"${1:diamond}\"$0"),
("markerstyle=\"circle\"\tmarkerstyle", "markerstyle=\"${1:circle}\"$0"),
("markerstyle=\"letter\"\tmarkerstyle", "markerstyle=\"${1:letter}\"$0"),
("markerstyle=\"mcross\"\tmarkerstyle", "markerstyle=\"${1:mcross}\"$0"),
("markerstyle=\"snow\"\tmarkerstyle", "markerstyle=\"${1:snow}\"$0"),
("markerstyle=\"rcross\"\tmarkerstyle", "markerstyle=\"${1:rcross}\"$0"),
("colorlist\t@colorlist", "colorlist=\"$1\"$0"),
("datalabelstyle\t@datalabelstyle", "datalabelstyle=\"$1\"$0"),
("datalabelstyle=\"none\"\tdatalabelstyle", "datalabelstyle=\"${1:none}\"$0"),
("datalabelstyle=\"value\"\tdatalabelstyle", "datalabelstyle=\"${1:value}\"$0"),
("datalabelstyle=\"rowlabel\"\tdatalabelstyle", "datalabelstyle=\"${1:rowlabel}\"$0"),
("datalabelstyle=\"columnlabel\"\tdatalabelstyle", "datalabelstyle=\"${1:columnlabel}\"$0"),
("datalabelstyle=\"pattern\"\tdatalabelstyle", "datalabelstyle=\"${1:pattern}\"$0")
],
'attributes': [
"datalabelstyle",
"query",
"paintstyle",
"valuecolumn",
"itemcolumn",
"colorlist",
"type",
"serieslabel",
"seriescolor",
"markerstyle"
]
}
self.completions['cfcollection'] = {
'completions': [
("action\t@action", "action=\"$1\"$0"),
("action=\"categorylist\"\taction", "action=\"${1:categorylist}\"$0"),
("action=\"create\"\taction", "action=\"${1:create}\"$0"),
("action=\"delete\"\taction", "action=\"${1:delete}\"$0"),
("action=\"optimize\"\taction", "action=\"${1:optimize}\"$0"),
("action=\"list\"\taction", "action=\"${1:list}\"$0"),
("action=\"map\"\taction", "action=\"${1:map}\"$0"),
("action=\"repair\"\taction", "action=\"${1:repair}\"$0"),
("collection\t@collection", "collection=\"$1\"$0"),
("path\t@path", "path=\"$1\"$0"),
("language\t@language", "language=\"$1\"$0"),
("name\t@name", "name=\"$1\"$0"),
("categories\t@categories", "categories=\"$1\"$0"),
("categories=\"true\"\tcategories", "categories=\"${1:true}\"$0"),
("categories=\"false\"\tcategories", "categories=\"${1:false}\"$0"),
("engine\t@engine", "engine=\"$1\"$0"),
("engine=\"verity\"\tengine", "engine=\"${1:verity}\"$0"),
("engine=\"solr\"\tengine", "engine=\"${1:solr}\"$0")
],
'attributes': [
"name",
"language",
"collection",
"path",
"categories",
"action",
"engine"
]
}
self.completions['cfcomponent'] = {
'completions': [
("extends\t@extends", "extends=\"$1\"$0"),
("initmethod\t@initmethod", "initmethod=\"$1\"$0"),
("implements\t@implements", "implements=\"$1\"$0"),
("output\t@output", "output=\"$1\"$0"),
("output=\"true\"\toutput", "output=\"${1:true}\"$0"),
("output=\"false\"\toutput", "output=\"${1:false}\"$0"),
("displayname\t@displayname", "displayname=\"$1\"$0"),
("hint\t@hint", "hint=\"$1\"$0"),
("style\t@style", "style=\"$1\"$0"),
("style=\"rpc\"\tstyle", "style=\"${1:rpc}\"$0"),
("style=\"document\"\tstyle", "style=\"${1:document}\"$0"),
("namespace\t@namespace", "namespace=\"$1\"$0"),
("serviceportname\t@serviceportname", "serviceportname=\"$1\"$0"),
("porttypename\t@porttypename", "porttypename=\"$1\"$0"),
("bindingname\t@bindingname", "bindingname=\"$1\"$0"),
("wsdlfile\t@wsdlfile", "wsdlfile=\"$1\"$0"),
("serviceaddress\t@serviceaddress", "serviceaddress=\"$1\"$0"),
("persistent\t@persistent", "persistent=\"$1\"$0"),
("persistent=\"true\"\tpersistent", "persistent=\"${1:true}\"$0"),
("persistent=\"false\"\tpersistent", "persistent=\"${1:false}\"$0"),
("entityName\t@entityName", "entityName=\"$1\"$0"),
("table\t@table", "table=\"$1\"$0"),
("schema\t@schema", "schema=\"$1\"$0"),
("catalog\t@catalog", "catalog=\"$1\"$0"),
("dynamicinsert\t@dynamicinsert", "dynamicinsert=\"$1\"$0"),
("dynamicinsert=\"true\"\tdynamicinsert", "dynamicinsert=\"${1:true}\"$0"),
("dynamicinsert=\"false\"\tdynamicinsert", "dynamicinsert=\"${1:false}\"$0"),
("dynamicupdate\t@dynamicupdate", "dynamicupdate=\"$1\"$0"),
("dynamicupdate=\"true\"\tdynamicupdate", "dynamicupdate=\"${1:true}\"$0"),
("dynamicupdate=\"false\"\tdynamicupdate", "dynamicupdate=\"${1:false}\"$0"),
("readonly\t@readonly", "readonly=\"$1\"$0"),
("readonly=\"true\"\treadonly", "readonly=\"${1:true}\"$0"),
("readonly=\"false\"\treadonly", "readonly=\"${1:false}\"$0"),
("selectbeforeupdate\t@selectbeforeupdate", "selectbeforeupdate=\"$1\"$0"),
("selectbeforeupdate=\"true\"\tselectbeforeupdate", "selectbeforeupdate=\"${1:true}\"$0"),
("selectbeforeupdate=\"false\"\tselectbeforeupdate", "selectbeforeupdate=\"${1:false}\"$0"),
("batchsize\t@batchsize", "batchsize=\"$1\"$0"),
("optimisticlock\t@optimisticlock", "optimisticlock=\"$1\"$0"),
("optimisticlock=\"none\"\toptimisticlock", "optimisticlock=\"${1:none}\"$0"),
("optimisticlock=\"dirty\"\toptimisticlock", "optimisticlock=\"${1:dirty}\"$0"),
("optimisticlock=\"all\"\toptimisticlock", "optimisticlock=\"${1:all}\"$0"),
("optimisticlock=\"version\"\toptimisticlock", "optimisticlock=\"${1:version}\"$0"),
("lazy\t@lazy", "lazy=\"$1\"$0"),
("lazy=\"true\"\tlazy", "lazy=\"${1:true}\"$0"),
("lazy=\"false\"\tlazy", "lazy=\"${1:false}\"$0"),
("rowid\t@rowid", "rowid=\"$1\"$0"),
("discriminatorColumn\t@discriminatorColumn", "discriminatorColumn=\"$1\"$0"),
("discriminatorValue\t@discriminatorValue", "discriminatorValue=\"$1\"$0"),
("joinColumn\t@joinColumn", "joinColumn=\"$1\"$0"),
("embedded\t@embedded", "embedded=\"$1\"$0"),
("embedded=\"true\"\tembedded", "embedded=\"${1:true}\"$0"),
("embedded=\"false\"\tembedded", "embedded=\"${1:false}\"$0"),
("cacheUse\t@cacheUse", "cacheUse=\"$1\"$0"),
("cacheUse=\"read-only\"\tcacheUse", "cacheUse=\"${1:read-only}\"$0"),
("cacheUse=\"nonstrict-read-write\"\tcacheUse", "cacheUse=\"${1:nonstrict-read-write}\"$0"),
("cacheUse=\"read-write\"\tcacheUse", "cacheUse=\"${1:read-write}\"$0"),
("cacheUse=\"transactional\"\tcacheUse", "cacheUse=\"${1:transactional}\"$0"),
("cacheName\t@cacheName", "cacheName=\"$1\"$0"),
("saveMapping\t@saveMapping", "saveMapping=\"$1\"$0"),
("saveMapping=\"true\"\tsaveMapping", "saveMapping=\"${1:true}\"$0"),
("saveMapping=\"false\"\tsaveMapping", "saveMapping=\"${1:false}\"$0"),
("accessors\t@accessors", "accessors=\"$1\"$0"),
("accessors=\"true\"\taccessors", "accessors=\"${1:true}\"$0"),
("accessors=\"false\"\taccessors", "accessors=\"${1:false}\"$0"),
("serializable\t@serializable", "serializable=\"$1\"$0"),
("serializable=\"true\"\tserializable", "serializable=\"${1:true}\"$0"),
("serializable=\"false\"\tserializable", "serializable=\"${1:false}\"$0"),
("alias\t@alias", "alias=\"$1\"$0"),
("datasource\t@datasource", "datasource=\"$1\"$0"),
("mappedSuperClass\t@mappedSuperClass", "mappedSuperClass=\"$1\"$0"),
("mappedSuperClass=\"true\"\tmappedSuperClass", "mappedSuperClass=\"${1:true}\"$0"),
("mappedSuperClass=\"false\"\tmappedSuperClass", "mappedSuperClass=\"${1:false}\"$0")
],
'attributes': [
"dynamicupdate",
"serializable",
"lazy",
"batchsize",
"persistent",
"serviceaddress",
"optimisticlock",
"serviceportname",
"table",
"catalog",
"discriminatorValue",
"mappedSuperClass",
"readonly",
"namespace",
"accessors",
"selectbeforeupdate",
"datasource",
"cacheUse",
"schema",
"implements",
"saveMapping",
"joinColumn",
"initmethod",
"alias",
"rowid",
"style",
"wsdlfile",
"displayname",
"embedded",
"dynamicinsert",
"hint",
"porttypename",
"extends",
"discriminatorColumn",
"output",
"entityName",
"bindingname",
"cacheName"
]
}
self.completions['cfcookie'] = {
'completions': [
("name\t@name", "name=\"$1\"$0"),
("value\t@value", "value=\"$1\"$0"),
("expires\t@expires", "expires=\"$1\"$0"),
("secure\t@secure", "secure=\"$1\"$0"),
("secure=\"true\"\tsecure", "secure=\"${1:true}\"$0"),
("secure=\"false\"\tsecure", "secure=\"${1:false}\"$0"),
("path\t@path", "path=\"$1\"$0"),
("domain\t@domain", "domain=\"$1\"$0"),
("httpOnly\t@httpOnly", "httpOnly=\"$1\"$0"),
("httpOnly=\"true\"\thttpOnly", "httpOnly=\"${1:true}\"$0"),
("httpOnly=\"false\"\thttpOnly", "httpOnly=\"${1:false}\"$0")
],
'attributes': [
"expires",
"name",
"httpOnly",
"value",
"path",
"domain",
"secure"
]
}
self.completions['cfdbinfo'] = {
'completions': [
("type\t@type", "type=\"$1\"$0"),
("type=\"Columns\"\ttype", "type=\"${1:Columns}\"$0"),
("type=\"DBNames\"\ttype", "type=\"${1:DBNames}\"$0"),
("type=\"Tables\"\ttype", "type=\"${1:Tables}\"$0"),
("type=\"Foreignkeys\"\ttype", "type=\"${1:Foreignkeys}\"$0"),
("type=\"Index\"\ttype", "type=\"${1:Index}\"$0"),
("type=\"Procedures\"\ttype", "type=\"${1:Procedures}\"$0"),
("type=\"Version\"\ttype", "type=\"${1:Version}\"$0"),
("datasource\t@datasource", "datasource=\"$1\"$0"),
("name\t@name", "name=\"$1\"$0"),
("dbname\t@dbname", "dbname=\"$1\"$0"),
("username\t@username", "username=\"$1\"$0"),
("password\t@password", "password=\"$1\"$0"),
("pattern\t@pattern", "pattern=\"$1\"$0"),
("table\t@table", "table=\"$1\"$0")
],
'attributes': [
"pattern",
"table",
"name",
"datasource",
"username",
"password",
"type",
"dbname"
]
}
self.completions['cfdirectory'] = {
'completions': [
("action\t@action", "action=\"$1\"$0"),
("action=\"list\"\taction", "action=\"${1:list}\"$0"),
("action=\"create\"\taction", "action=\"${1:create}\"$0"),
("action=\"delete\"\taction", "action=\"${1:delete}\"$0"),
("action=\"rename\"\taction", "action=\"${1:rename}\"$0"),
("directory\t@directory", "directory=\"$1\"$0"),
("name\t@name", "name=\"$1\"$0"),
("filter\t@filter", "filter=\"$1\"$0"),
("mode\t@mode", "mode=\"$1\"$0"),
("sort\t@sort", "sort=\"$1\"$0"),
("sort=\"asc\"\tsort", "sort=\"${1:asc}\"$0"),
("sort=\"desc\"\tsort", "sort=\"${1:desc}\"$0"),
("newdirectory\t@newdirectory", "newdirectory=\"$1\"$0"),
("recurse\t@recurse", "recurse=\"$1\"$0"),
("recurse=\"true\"\trecurse", "recurse=\"${1:true}\"$0"),
("recurse=\"false\"\trecurse", "recurse=\"${1:false}\"$0"),
("type\t@type", "type=\"$1\"$0"),
("type=\"dir\"\ttype", "type=\"${1:dir}\"$0"),
("type=\"file\"\ttype", "type=\"${1:file}\"$0"),
("type=\"all\"\ttype", "type=\"${1:all}\"$0"),
("listinfo\t@listinfo", "listinfo=\"$1\"$0"),
("listinfo=\"name\"\tlistinfo", "listinfo=\"${1:name}\"$0"),
("listinfo=\"all\"\tlistinfo", "listinfo=\"${1:all}\"$0"),
("storeLocation\t@storeLocation", "storeLocation=\"$1\"$0"),
("storeLocation=\"EU\"\tstoreLocation", "storeLocation=\"${1:EU}\"$0"),
("storeLocation=\"US\"\tstoreLocation", "storeLocation=\"${1:US}\"$0"),
("storeACL\t@storeACL", "storeACL=\"$1\"$0")
],
'attributes': [
"storeLocation",
"directory",
"sort",
"name",
"recurse",
"storeACL",
"listinfo",
"mode",
"action",
"type",
"newdirectory",
"filter"
]
}
self.completions['cffile'] = {
'completions': [
("action\t@action", "action=\"$1\"$0"),
("action=\"append\"\taction", "action=\"${1:append}\"$0"),
("action=\"copy\"\taction", "action=\"${1:copy}\"$0"),
("action=\"delete\"\taction", "action=\"${1:delete}\"$0"),
("action=\"move\"\taction", "action=\"${1:move}\"$0"),
("action=\"read\"\taction", "action=\"${1:read}\"$0"),
("action=\"readbinary\"\taction", "action=\"${1:readbinary}\"$0"),
("action=\"rename\"\taction", "action=\"${1:rename}\"$0"),
("action=\"upload\"\taction", "action=\"${1:upload}\"$0"),
("action=\"uploadall\"\taction", "action=\"${1:uploadall}\"$0"),
("action=\"write\"\taction", "action=\"${1:write}\"$0"),
("file\t@file", "file=\"$1\"$0"),
("mode\t@mode", "mode=\"$1\"$0"),
("output\t@output", "output=\"$1\"$0"),
("addnewline\t@addnewline", "addnewline=\"$1\"$0"),
("addnewline=\"true\"\taddnewline", "addnewline=\"${1:true}\"$0"),
("addnewline=\"false\"\taddnewline", "addnewline=\"${1:false}\"$0"),
("attributes\t@attributes", "attributes=\"$1\"$0"),
("attributes=\"readonly\"\tattributes", "attributes=\"${1:readonly}\"$0"),
("attributes=\"hidden\"\tattributes", "attributes=\"${1:hidden}\"$0"),
("attributes=\"normal\"\tattributes", "attributes=\"${1:normal}\"$0"),
("attributes=\"system\"\tattributes", "attributes=\"${1:system}\"$0"),
("attributes=\"temporary\"\tattributes", "attributes=\"${1:temporary}\"$0"),
("charset\t@charset", "charset=\"$1\"$0"),
("charset=\"utf-8\"\tcharset", "charset=\"${1:utf-8}\"$0"),
("charset=\"iso-8859-1\"\tcharset", "charset=\"${1:iso-8859-1}\"$0"),
("charset=\"windows-1252\"\tcharset", "charset=\"${1:windows-1252}\"$0"),
("charset=\"us-ascii\"\tcharset", "charset=\"${1:us-ascii}\"$0"),
("charset=\"shift_jis\"\tcharset", "charset=\"${1:shift_jis}\"$0"),
("charset=\"iso-2022-jp\"\tcharset", "charset=\"${1:iso-2022-jp}\"$0"),
("charset=\"euc-jp\"\tcharset", "charset=\"${1:euc-jp}\"$0"),
("charset=\"euc-kr\"\tcharset", "charset=\"${1:euc-kr}\"$0"),
("charset=\"big5\"\tcharset", "charset=\"${1:big5}\"$0"),
("charset=\"euc-cn\"\tcharset", "charset=\"${1:euc-cn}\"$0"),
("charset=\"utf-16\"\tcharset", "charset=\"${1:utf-16}\"$0"),
("source\t@source", "source=\"$1\"$0"),
("destination\t@destination", "destination=\"$1\"$0"),
("variable\t@variable", "variable=\"$1\"$0"),
("filefield\t@filefield", "filefield=\"$1\"$0"),
("nameconflict\t@nameconflict", "nameconflict=\"$1\"$0"),
("nameconflict=\"error\"\tnameconflict", "nameconflict=\"${1:error}\"$0"),
("nameconflict=\"skip\"\tnameconflict", "nameconflict=\"${1:skip}\"$0"),
("nameconflict=\"overwrite\"\tnameconflict", "nameconflict=\"${1:overwrite}\"$0"),
("nameconflict=\"makeunique\"\tnameconflict", "nameconflict=\"${1:makeunique}\"$0"),
("accept\t@accept", "accept=\"$1\"$0"),
("result\t@result", "result=\"$1\"$0"),
("fixnewline\t@fixnewline", "fixnewline=\"$1\"$0"),
("fixnewline=\"true\"\tfixnewline", "fixnewline=\"${1:true}\"$0"),
("fixnewline=\"false\"\tfixnewline", "fixnewline=\"${1:false}\"$0")
],
'attributes': [
"attributes",
"variable",
"destination",
"addnewline",
"source",
"result",
"fixnewline",
"charset",
"file",
"accept",
"mode",
"output",
"action",
"filefield",
"nameconflict"
]
}
self.completions['cfform'] = {
'completions': [
("name\t@name", "name=\"$1\"$0"),
("action\t@action", "action=\"$1\"$0"),
("method\t@method", "method=\"$1\"$0"),
("method=\"post\"\tmethod", "method=\"${1:post}\"$0"),
("method=\"get\"\tmethod", "method=\"${1:get}\"$0"),
("format\t@format", "format=\"$1\"$0"),
("format=\"html\"\tformat", "format=\"${1:html}\"$0"),
("format=\"flash\"\tformat", "format=\"${1:flash}\"$0"),
("format=\"xml\"\tformat", "format=\"${1:xml}\"$0"),
("skin\t@skin", "skin=\"$1\"$0"),
("skin=\"haloSilver\"\tskin", "skin=\"${1:haloSilver}\"$0"),
("skin=\"haloBlue\"\tskin", "skin=\"${1:haloBlue}\"$0"),
("skin=\"haloGreen\"\tskin", "skin=\"${1:haloGreen}\"$0"),
("skin=\"haloOrange\"\tskin", "skin=\"${1:haloOrange}\"$0"),
("skin=\"beige\"\tskin", "skin=\"${1:beige}\"$0"),
("skin=\"blue\"\tskin", "skin=\"${1:blue}\"$0"),
("skin=\"bluegray\"\tskin", "skin=\"${1:bluegray}\"$0"),
("skin=\"lightgray\"\tskin", "skin=\"${1:lightgray}\"$0"),
("skin=\"red\"\tskin", "skin=\"${1:red}\"$0"),
("skin=\"silver\"\tskin", "skin=\"${1:silver}\"$0"),
("skin=\"none\"\tskin", "skin=\"${1:none}\"$0"),
("skin=\"default\"\tskin", "skin=\"${1:default}\"$0"),
("skin=\"basic\"\tskin", "skin=\"${1:basic}\"$0"),
("skin=\"basiccss\"\tskin", "skin=\"${1:basiccss}\"$0"),
("preservedata\t@preservedata", "preservedata=\"$1\"$0"),
("preservedata=\"true\"\tpreservedata", "preservedata=\"${1:true}\"$0"),
("preservedata=\"false\"\tpreservedata", "preservedata=\"${1:false}\"$0"),
("onload\t@onload", "onload=\"$1\"$0"),
("onsubmit\t@onsubmit", "onsubmit=\"$1\"$0"),
("codebase\t@codebase", "codebase=\"$1\"$0"),
("archive\t@archive", "archive=\"$1\"$0"),
("height\t@height", "height=\"$1\"$0"),
("width\t@width", "width=\"$1\"$0"),
("onerror\t@onerror", "onerror=\"$1\"$0"),
("wmode\t@wmode", "wmode=\"$1\"$0"),
("wmode=\"window\"\twmode", "wmode=\"${1:window}\"$0"),
("wmode=\"transparent\"\twmode", "wmode=\"${1:transparent}\"$0"),
("wmode=\"opaque\"\twmode", "wmode=\"${1:opaque}\"$0"),
("accessible\t@accessible", "accessible=\"$1\"$0"),
("accessible=\"true\"\taccessible", "accessible=\"${1:true}\"$0"),
("accessible=\"false\"\taccessible", "accessible=\"${1:false}\"$0"),
("preloader\t@preloader", "preloader=\"$1\"$0"),
("preloader=\"true\"\tpreloader", "preloader=\"${1:true}\"$0"),
("preloader=\"false\"\tpreloader", "preloader=\"${1:false}\"$0"),
("timeout\t@timeout", "timeout=\"$1\"$0"),
("scriptsrc\t@scriptsrc", "scriptsrc=\"$1\"$0"),
("style\t@style", "style=\"$1\"$0"),
("onreset\t@onreset", "onreset=\"$1\"$0"),
("id\t@id", "id=\"$1\"$0"),
("target\t@target", "target=\"$1\"$0"),
("passthrough\t@passthrough", "passthrough=\"$1\"$0"),
("onsuccess\t@onsuccess", "onsuccess=\"$1\"$0")
],
'attributes': [
"onsubmit",
"preloader",
"name",
"onsuccess",
"onload",
"archive",
"height",
"scriptsrc",
"accessible",
"width",
"style",
"preservedata",
"target",
"format",
"codebase",
"onerror",
"id",
"onreset",
"wmode",
"method",
"passthrough",
"action",
"skin",
"timeout"
]
}
self.completions['cffunction'] = {
'completions': [
("name\t@name", "name=\"$1\"$0"),
("returntype\t@returntype", "returntype=\"$1\"$0"),
("returntype=\"Any\"\treturntype", "returntype=\"${1:Any}\"$0"),
("returntype=\"Array\"\treturntype", "returntype=\"${1:Array}\"$0"),
("returntype=\"Binary\"\treturntype", "returntype=\"${1:Binary}\"$0"),
("returntype=\"boolean\"\treturntype", "returntype=\"${1:boolean}\"$0"),
("returntype=\"date\"\treturntype", "returntype=\"${1:date}\"$0"),
("returntype=\"guid\"\treturntype", "returntype=\"${1:guid}\"$0"),
("returntype=\"Numeric\"\treturntype", "returntype=\"${1:Numeric}\"$0"),
("returntype=\"Query\"\treturntype", "returntype=\"${1:Query}\"$0"),
("returntype=\"String\"\treturntype", "returntype=\"${1:String}\"$0"),
("returntype=\"Struct\"\treturntype", "returntype=\"${1:Struct}\"$0"),
("returntype=\"UUID\"\treturntype", "returntype=\"${1:UUID}\"$0"),
("returntype=\"variablename\"\treturntype", "returntype=\"${1:variablename}\"$0"),
("returntype=\"void\"\treturntype", "returntype=\"${1:void}\"$0"),
("returntype=\"xml\"\treturntype", "returntype=\"${1:xml}\"$0"),
("returntype=\"(component name)\"\treturntype", "returntype=\"${1:(component name)}\"$0"),
("roles\t@roles", "roles=\"$1\"$0"),
("access\t@access", "access=\"$1\"$0"),
("access=\"private\"\taccess", "access=\"${1:private}\"$0"),
("access=\"package\"\taccess", "access=\"${1:package}\"$0"),
("access=\"public\"\taccess", "access=\"${1:public}\"$0"),
("access=\"remote\"\taccess", "access=\"${1:remote}\"$0"),
("output\t@output", "output=\"$1\"$0"),
("output=\"true\"\toutput", "output=\"${1:true}\"$0"),
("output=\"false\"\toutput", "output=\"${1:false}\"$0"),
("displayname\t@displayname", "displayname=\"$1\"$0"),
("hint\t@hint", "hint=\"$1\"$0"),
("description\t@description", "description=\"$1\"$0"),
("returnformat\t@returnformat", "returnformat=\"$1\"$0"),
("returnformat=\"JSON\"\treturnformat", "returnformat=\"${1:JSON}\"$0"),
("returnformat=\"plain\"\treturnformat", "returnformat=\"${1:plain}\"$0"),
("returnformat=\"WDDX\"\treturnformat", "returnformat=\"${1:WDDX}\"$0"),
("securejson\t@securejson", "securejson=\"$1\"$0"),
("securejson=\"true\"\tsecurejson", "securejson=\"${1:true}\"$0"),
("securejson=\"false\"\tsecurejson", "securejson=\"${1:false}\"$0"),
("verifyclient\t@verifyclient", "verifyclient=\"$1\"$0"),
("verifyclient=\"true\"\tverifyclient", "verifyclient=\"${1:true}\"$0"),
("verifyclient=\"false\"\tverifyclient", "verifyclient=\"${1:false}\"$0")
],
'attributes': [
"access",
"displayname",
"roles",
"name",
"returntype",
"verifyclient",
"description",
"hint",
"securejson",
"output",
"returnformat"
]
}
self.completions['cfgridupdate'] = {
'completions': [
("grid\t@grid", "grid=\"$1\"$0"),
("datasource\t@datasource", "datasource=\"$1\"$0"),
("tablename\t@tablename", "tablename=\"$1\"$0"),
("username\t@username", "username=\"$1\"$0"),
("password\t@password", "password=\"$1\"$0"),
("tableowner\t@tableowner", "tableowner=\"$1\"$0"),
("tablequalifier\t@tablequalifier", "tablequalifier=\"$1\"$0"),
("keyonly\t@keyonly", "keyonly=\"$1\"$0"),
("keyonly=\"true\"\tkeyonly", "keyonly=\"${1:true}\"$0"),
("keyonly=\"false\"\tkeyonly", "keyonly=\"${1:false}\"$0")
],
'attributes': [
"tablequalifier",
"datasource",
"keyonly",
"username",
"tablename",
"grid",
"password",
"tableowner"
]
}
self.completions['cfhttp'] = {
'completions': [
("url\t@url", "url=\"$1\"$0"),
("port\t@port", "port=\"$1\"$0"),
("method\t@method", "method=\"$1\"$0"),
("method=\"get\"\tmethod", "method=\"${1:get}\"$0"),
("method=\"post\"\tmethod", "method=\"${1:post}\"$0"),
("method=\"put\"\tmethod", "method=\"${1:put}\"$0"),
("method=\"delete\"\tmethod", "method=\"${1:delete}\"$0"),
("method=\"head\"\tmethod", "method=\"${1:head}\"$0"),
("method=\"trace\"\tmethod", "method=\"${1:trace}\"$0"),
("method=\"options\"\tmethod", "method=\"${1:options}\"$0"),
("proxyserver\t@proxyserver", "proxyserver=\"$1\"$0"),
("proxyport\t@proxyport", "proxyport=\"$1\"$0"),
("proxyuser\t@proxyuser", "proxyuser=\"$1\"$0"),
("proxypassword\t@proxypassword", "proxypassword=\"$1\"$0"),
("username\t@username", "username=\"$1\"$0"),
("password\t@password", "password=\"$1\"$0"),
("useragent\t@useragent", "useragent=\"$1\"$0"),
("charset\t@charset", "charset=\"$1\"$0"),
("charset=\"utf-8\"\tcharset", "charset=\"${1:utf-8}\"$0"),
("charset=\"iso-8859-1\"\tcharset", "charset=\"${1:iso-8859-1}\"$0"),
("charset=\"windows-1252\"\tcharset", "charset=\"${1:windows-1252}\"$0"),
("charset=\"us-ascii\"\tcharset", "charset=\"${1:us-ascii}\"$0"),
("charset=\"shift_jis\"\tcharset", "charset=\"${1:shift_jis}\"$0"),
("charset=\"iso-2022-jp\"\tcharset", "charset=\"${1:iso-2022-jp}\"$0"),
("charset=\"euc-jp\"\tcharset", "charset=\"${1:euc-jp}\"$0"),
("charset=\"euc-kr\"\tcharset", "charset=\"${1:euc-kr}\"$0"),
("charset=\"big5\"\tcharset", "charset=\"${1:big5}\"$0"),
("charset=\"euc-cn\"\tcharset", "charset=\"${1:euc-cn}\"$0"),
("charset=\"utf-16\"\tcharset", "charset=\"${1:utf-16}\"$0"),
("resolveurl\t@resolveurl", "resolveurl=\"$1\"$0"),
("resolveurl=\"true\"\tresolveurl", "resolveurl=\"${1:true}\"$0"),
("resolveurl=\"false\"\tresolveurl", "resolveurl=\"${1:false}\"$0"),
("throwonerror\t@throwonerror", "throwonerror=\"$1\"$0"),
("throwonerror=\"true\"\tthrowonerror", "throwonerror=\"${1:true}\"$0"),
("throwonerror=\"false\"\tthrowonerror", "throwonerror=\"${1:false}\"$0"),
("redirect\t@redirect", "redirect=\"$1\"$0"),
("redirect=\"true\"\tredirect", "redirect=\"${1:true}\"$0"),
("redirect=\"false\"\tredirect", "redirect=\"${1:false}\"$0"),
("timeout\t@timeout", "timeout=\"$1\"$0"),
("getasbinary\t@getasbinary", "getasbinary=\"$1\"$0"),
("getasbinary=\"auto\"\tgetasbinary", "getasbinary=\"${1:auto}\"$0"),
("getasbinary=\"yes\"\tgetasbinary", "getasbinary=\"${1:yes}\"$0"),
("getasbinary=\"no\"\tgetasbinary", "getasbinary=\"${1:no}\"$0"),
("getasbinary=\"never\"\tgetasbinary", "getasbinary=\"${1:never}\"$0"),
("result\t@result", "result=\"$1\"$0"),
("delimiter\t@delimiter", "delimiter=\"$1\"$0"),
("delimiter=\",\"\tdelimiter", "delimiter=\"${1:,}\"$0"),
("delimiter=\";\"\tdelimiter", "delimiter=\"${1:;}\"$0"),
("delimiter=\"|\"\tdelimiter", "delimiter=\"${1:|}\"$0"),
("delimiter=\":\"\tdelimiter", "delimiter=\"${1::}\"$0"),
("name\t@name", "name=\"$1\"$0"),
("columns\t@columns", "columns=\"$1\"$0"),
("firstrowasheaders\t@firstrowasheaders", "firstrowasheaders=\"$1\"$0"),
("firstrowasheaders=\"true\"\tfirstrowasheaders", "firstrowasheaders=\"${1:true}\"$0"),
("firstrowasheaders=\"false\"\tfirstrowasheaders", "firstrowasheaders=\"${1:false}\"$0"),
("textqualifier\t@textqualifier", "textqualifier=\"$1\"$0"),
("textqualifier=\"\"\ttextqualifier", "textqualifier=\"${1:}\"$0"),
("textqualifier=\"'\"\ttextqualifier", "textqualifier=\"${1:'}\"$0"),
("file\t@file", "file=\"$1\"$0"),
("multipart\t@multipart", "multipart=\"$1\"$0"),
("multipart=\"true\"\tmultipart", "multipart=\"${1:true}\"$0"),
("multipart=\"false\"\tmultipart", "multipart=\"${1:false}\"$0"),
("clientcertpassword\t@clientcertpassword", "clientcertpassword=\"$1\"$0"),
("path\t@path", "path=\"$1\"$0"),
("clientcert\t@clientcert", "clientcert=\"$1\"$0"),
("compression\t@compression", "compression=\"$1\"$0")
],
'attributes': [
"proxyport",
"multipart",
"resolveurl",
"proxyuser",
"getasbinary",
"port",
"result",
"clientcert",
"throwonerror",
"charset",
"file",
"clientcertpassword",
"compression",
"password",
"url",
"proxyserver",
"columns",
"useragent",
"name",
"textqualifier",
"proxypassword",
"redirect",
"path",
"firstrowasheaders",
"username",
"method",
"delimiter",
"timeout"
]
}
self.completions['cfinclude'] = {
'completions': [
("template\t@template", "template=\"$1\"$0")
],
'attributes': [
"template"
]
}
self.completions['cfindex'] = {
'completions': [
("collection\t@collection", "collection=\"$1\"$0"),
("action\t@action", "action=\"$1\"$0"),
("action=\"update\"\taction", "action=\"${1:update}\"$0"),
("action=\"delete\"\taction", "action=\"${1:delete}\"$0"),
("action=\"purge\"\taction", "action=\"${1:purge}\"$0"),
("action=\"refresh\"\taction", "action=\"${1:refresh}\"$0"),
("type\t@type", "type=\"$1\"$0"),
("type=\"file\"\ttype", "type=\"${1:file}\"$0"),
("type=\"path\"\ttype", "type=\"${1:path}\"$0"),
("type=\"custom\"\ttype", "type=\"${1:custom}\"$0"),
("title\t@title", "title=\"$1\"$0"),
("key\t@key", "key=\"$1\"$0"),
("body\t@body", "body=\"$1\"$0"),
("custom1\t@custom1", "custom1=\"$1\"$0"),
("custom2\t@custom2", "custom2=\"$1\"$0"),
("custom3\t@custom3", "custom3=\"$1\"$0"),
("custom4\t@custom4", "custom4=\"$1\"$0"),
("category\t@category", "category=\"$1\"$0"),
("categoryTree\t@categoryTree", "categoryTree=\"$1\"$0"),
("urlpath\t@urlpath", "urlpath=\"$1\"$0"),
("extensions\t@extensions", "extensions=\"$1\"$0"),
("query\t@query", "query=\"$1\"$0"),
("recurse\t@recurse", "recurse=\"$1\"$0"),
("recurse=\"true\"\trecurse", "recurse=\"${1:true}\"$0"),
("recurse=\"false\"\trecurse", "recurse=\"${1:false}\"$0"),
("language\t@language", "language=\"$1\"$0"),
("status\t@status", "status=\"$1\"$0"),
("prefix\t@prefix", "prefix=\"$1\"$0")
],
'attributes': [
"prefix",
"language",
"extensions",
"recurse",
"categoryTree",
"key",
"status",
"custom1",
"custom2",
"query",
"custom3",
"category",
"custom4",
"body",
"collection",
"action",
"urlpath",
"type",
"title"
]
}
self.completions['cfinsert'] = {
'completions': [
("datasource\t@datasource", "datasource=\"$1\"$0"),
("tablename\t@tablename", "tablename=\"$1\"$0"),
("tableowner\t@tableowner", "tableowner=\"$1\"$0"),
("tablequalifier\t@tablequalifier", "tablequalifier=\"$1\"$0"),
("username\t@username", "username=\"$1\"$0"),
("password\t@password", "password=\"$1\"$0"),
("formfields\t@formfields", "formfields=\"$1\"$0"),
("providerdsn\t@providerdsn", "providerdsn=\"$1\"$0"),
("dbtype\t@dbtype", "dbtype=\"$1\"$0"),
("dbname\t@dbname", "dbname=\"$1\"$0"),
("dbserver\t@dbserver", "dbserver=\"$1\"$0"),
("provider\t@provider", "provider=\"$1\"$0")
],
'attributes': [
"tablequalifier",
"datasource",
"providerdsn",
"username",
"provider",
"dbserver",
"tablename",
"password",
"formfields",
"dbtype",
"dbname",
"tableowner"
]
}
self.completions['cfinvoke'] = {
'completions': [
("component\t@component", "component=\"$1\"$0"),
("method\t@method", "method=\"$1\"$0"),
("returnvariable\t@returnvariable", "returnvariable=\"$1\"$0"),
("argumentcollection\t@argumentcollection", "argumentcollection=\"$1\"$0"),
("username\t@username", "username=\"$1\"$0"),
("password\t@password", "password=\"$1\"$0"),
("webservice\t@webservice", "webservice=\"$1\"$0"),
("timeout\t@timeout", "timeout=\"$1\"$0"),
("proxyserver\t@proxyserver", "proxyserver=\"$1\"$0"),
("proxyport\t@proxyport", "proxyport=\"$1\"$0"),
("proxyuser\t@proxyuser", "proxyuser=\"$1\"$0"),
("proxypassword\t@proxypassword", "proxypassword=\"$1\"$0"),
("serviceport\t@serviceport", "serviceport=\"$1\"$0"),
("refreshwsdl\t@refreshwsdl", "refreshwsdl=\"$1\"$0"),
("refreshwsdl=\"true\"\trefreshwsdl", "refreshwsdl=\"${1:true}\"$0"),
("refreshwsdl=\"false\"\trefreshwsdl", "refreshwsdl=\"${1:false}\"$0"),
("wsdl2javaargs\t@wsdl2javaargs", "wsdl2javaargs=\"$1\"$0")
],
'attributes': [
"argumentcollection",
"proxyport",
"proxypassword",
"refreshwsdl",
"proxyuser",
"returnvariable",
"username",
"component",
"method",
"password",
"wsdl2javaargs",
"webservice",
"proxyserver",
"timeout",
"serviceport"
]
}
self.completions['cflayout'] = {
'completions': [
("type\t@type", "type=\"$1\"$0"),
("type=\"accordion\"\ttype", "type=\"${1:accordion}\"$0"),
("type=\"border\"\ttype", "type=\"${1:border}\"$0"),
("type=\"hbox\"\ttype", "type=\"${1:hbox}\"$0"),
("type=\"tab\"\ttype", "type=\"${1:tab}\"$0"),
("type=\"vbox\"\ttype", "type=\"${1:vbox}\"$0"),
("align\t@align", "align=\"$1\"$0"),
("align=\"center\"\talign", "align=\"${1:center}\"$0"),
("align=\"justify\"\talign", "align=\"${1:justify}\"$0"),
("align=\"left\"\talign", "align=\"${1:left}\"$0"),
("align=\"right\"\talign", "align=\"${1:right}\"$0"),
("name\t@name", "name=\"$1\"$0"),
("padding\t@padding", "padding=\"$1\"$0"),
("style\t@style", "style=\"$1\"$0"),
("tabheight\t@tabheight", "tabheight=\"$1\"$0"),
("tabposition\t@tabposition", "tabposition=\"$1\"$0"),
("titlecollapse\t@titlecollapse", "titlecollapse=\"$1\"$0"),
("titlecollapse=\"true\"\ttitlecollapse", "titlecollapse=\"${1:true}\"$0"),
("titlecollapse=\"false\"\ttitlecollapse", "titlecollapse=\"${1:false}\"$0"),
("activeontop\t@activeontop", "activeontop=\"$1\"$0"),
("activeontop=\"true\"\tactiveontop", "activeontop=\"${1:true}\"$0"),
("activeontop=\"false\"\tactiveontop", "activeontop=\"${1:false}\"$0"),
("fillheight\t@fillheight", "fillheight=\"$1\"$0"),
("fillheight=\"true\"\tfillheight", "fillheight=\"${1:true}\"$0"),
("fillheight=\"false\"\tfillheight", "fillheight=\"${1:false}\"$0"),
("fitToWindow\t@fitToWindow", "fitToWindow=\"$1\"$0"),
("fitToWindow=\"true\"\tfitToWindow", "fitToWindow=\"${1:true}\"$0"),
("fitToWindow=\"false\"\tfitToWindow", "fitToWindow=\"${1:false}\"$0"),
("height\t@height", "height=\"$1\"$0"),
("width\t@width", "width=\"$1\"$0"),
("buttonStyle\t@buttonStyle", "buttonStyle=\"$1\"$0")
],
'attributes': [
"activeontop",
"name",
"height",
"fitToWindow",
"buttonStyle",
"tabheight",
"width",
"style",
"align",
"fillheight",
"tabposition",
"titlecollapse",
"type",
"padding"
]
}
self.completions['cflayoutarea'] = {
'completions': [
("position\t@position", "position=\"$1\"$0"),
("position=\"bottom\"\tposition", "position=\"${1:bottom}\"$0"),
("position=\"center\"\tposition", "position=\"${1:center}\"$0"),
("position=\"left\"\tposition", "position=\"${1:left}\"$0"),
("position=\"right\"\tposition", "position=\"${1:right}\"$0"),
("position=\"top\"\tposition", "position=\"${1:top}\"$0"),
("align\t@align", "align=\"$1\"$0"),
("align=\"center\"\talign", "align=\"${1:center}\"$0"),
("align=\"justify\"\talign", "align=\"${1:justify}\"$0"),
("align=\"left\"\talign", "align=\"${1:left}\"$0"),
("align=\"right\"\talign", "align=\"${1:right}\"$0"),
("closable\t@closable", "closable=\"$1\"$0"),
("closable=\"true\"\tclosable", "closable=\"${1:true}\"$0"),
("closable=\"false\"\tclosable", "closable=\"${1:false}\"$0"),
("collapsible\t@collapsible", "collapsible=\"$1\"$0"),
("collapsible=\"true\"\tcollapsible", "collapsible=\"${1:true}\"$0"),
("collapsible=\"false\"\tcollapsible", "collapsible=\"${1:false}\"$0"),
("disabled\t@disabled", "disabled=\"$1\"$0"),
("disabled=\"true\"\tdisabled", "disabled=\"${1:true}\"$0"),
("disabled=\"false\"\tdisabled", "disabled=\"${1:false}\"$0"),
("initCollapsed\t@initCollapsed", "initCollapsed=\"$1\"$0"),
("initCollapsed=\"true\"\tinitCollapsed", "initCollapsed=\"${1:true}\"$0"),
("initCollapsed=\"false\"\tinitCollapsed", "initCollapsed=\"${1:false}\"$0"),
("initHide\t@initHide", "initHide=\"$1\"$0"),
("initHide=\"true\"\tinitHide", "initHide=\"${1:true}\"$0"),
("initHide=\"false\"\tinitHide", "initHide=\"${1:false}\"$0"),
("maxSize\t@maxSize", "maxSize=\"$1\"$0"),
("minSize\t@minSize", "minSize=\"$1\"$0"),
("name\t@name", "name=\"$1\"$0"),
("onBindError\t@onBindError", "onBindError=\"$1\"$0"),
("overflow\t@overflow", "overflow=\"$1\"$0"),
("overflow=\"auto\"\toverflow", "overflow=\"${1:auto}\"$0"),
("overflow=\"hidden\"\toverflow", "overflow=\"${1:hidden}\"$0"),
("overflow=\"scroll\"\toverflow", "overflow=\"${1:scroll}\"$0"),
("overflow=\"visible\"\toverflow", "overflow=\"${1:visible}\"$0"),
("selected\t@selected", "selected=\"$1\"$0"),
("selected=\"true\"\tselected", "selected=\"${1:true}\"$0"),
("selected=\"false\"\tselected", "selected=\"${1:false}\"$0"),
("size\t@size", "size=\"$1\"$0"),
("source\t@source", "source=\"$1\"$0"),
("splitter\t@splitter", "splitter=\"$1\"$0"),
("splitter=\"true\"\tsplitter", "splitter=\"${1:true}\"$0"),
("splitter=\"false\"\tsplitter", "splitter=\"${1:false}\"$0"),
("style\t@style", "style=\"$1\"$0"),
("title\t@title", "title=\"$1\"$0"),
("refreshonactivate\t@refreshonactivate", "refreshonactivate=\"$1\"$0"),
("refreshonactivate=\"true\"\trefreshonactivate", "refreshonactivate=\"${1:true}\"$0"),
("refreshonactivate=\"false\"\trefreshonactivate", "refreshonactivate=\"${1:false}\"$0"),
("titleIcon\t@titleIcon", "titleIcon=\"$1\"$0"),
("bindOnLoad\t@bindOnLoad", "bindOnLoad=\"$1\"$0"),
("bindOnLoad=\"true\"\tbindOnLoad", "bindOnLoad=\"${1:true}\"$0"),
("bindOnLoad=\"false\"\tbindOnLoad", "bindOnLoad=\"${1:false}\"$0")
],
'attributes': [
"minSize",
"name",
"refreshonactivate",
"overflow",
"closable",
"bindOnLoad",
"disabled",
"style",
"source",
"splitter",
"titleIcon",
"align",
"selected",
"initHide",
"initCollapsed",
"collapsible",
"onBindError",
"size",
"maxSize",
"position",
"title"
]
}
self.completions['cfloop'] = {
'completions': [
("index\t@index", "index=\"$1\"$0"),
("to\t@to", "to=\"$1\"$0"),
("from\t@from", "from=\"$1\"$0"),
("step\t@step", "step=\"$1\"$0"),
("condition\t@condition", "condition=\"$1\"$0"),
("query\t@query", "query=\"$1\"$0"),
("startrow\t@startrow", "startrow=\"$1\"$0"),
("endrow\t@endrow", "endrow=\"$1\"$0"),
("list\t@list", "list=\"$1\"$0"),
("delimiters\t@delimiters", "delimiters=\"$1\"$0"),
("delimiters=\",\"\tdelimiters", "delimiters=\"${1:,}\"$0"),
("delimiters=\";\"\tdelimiters", "delimiters=\"${1:;}\"$0"),
("delimiters=\"|\"\tdelimiters", "delimiters=\"${1:|}\"$0"),
("delimiters=\":\"\tdelimiters", "delimiters=\"${1::}\"$0"),
("collection\t@collection", "collection=\"$1\"$0"),
("item\t@item", "item=\"$1\"$0"),
("array\t@array", "array=\"$1\"$0"),
("characters\t@characters", "characters=\"$1\"$0"),
("file\t@file", "file=\"$1\"$0")
],
'attributes': [
"delimiters",
"characters",
"index",
"item",
"to",
"endrow",
"query",
"step",
"condition",
"collection",
"startrow",
"from",
"file",
"list",
"array"
]
}
self.completions['cfobject'] = {
'completions': [
("type\t@type", "type=\"$1\"$0"),
("type=\"com\"\ttype", "type=\"${1:com}\"$0"),
("type=\"component\"\ttype", "type=\"${1:component}\"$0"),
("type=\"corba\"\ttype", "type=\"${1:corba}\"$0"),
("type=\"java\"\ttype", "type=\"${1:java}\"$0"),
("type=\"dotnet\"\ttype", "type=\"${1:dotnet}\"$0"),
("type=\"webservice\"\ttype", "type=\"${1:webservice}\"$0"),
("action\t@action", "action=\"$1\"$0"),
("action=\"create\"\taction", "action=\"${1:create}\"$0"),
("action=\"connect\"\taction", "action=\"${1:connect}\"$0"),
("class\t@class", "class=\"$1\"$0"),
("name\t@name", "name=\"$1\"$0"),
("context\t@context", "context=\"$1\"$0"),
("context=\"inproc\"\tcontext", "context=\"${1:inproc}\"$0"),
("context=\"local\"\tcontext", "context=\"${1:local}\"$0"),
("context=\"remote\"\tcontext", "context=\"${1:remote}\"$0"),
("context=\"ior\"\tcontext", "context=\"${1:ior}\"$0"),
("context=\"nameservice\"\tcontext", "context=\"${1:nameservice}\"$0"),
("server\t@server", "server=\"$1\"$0"),
("component\t@component", "component=\"$1\"$0"),
("locale\t@locale", "locale=\"$1\"$0"),
("webservice\t@webservice", "webservice=\"$1\"$0"),
("password\t@password", "password=\"$1\"$0"),
("secure\t@secure", "secure=\"$1\"$0"),
("secure=\"true\"\tsecure", "secure=\"${1:true}\"$0"),
("secure=\"false\"\tsecure", "secure=\"${1:false}\"$0"),
("protocol\t@protocol", "protocol=\"$1\"$0"),
("protocol=\"tcp\"\tprotocol", "protocol=\"${1:tcp}\"$0"),
("protocol=\"http\"\tprotocol", "protocol=\"${1:http}\"$0"),
("proxyserver\t@proxyserver", "proxyserver=\"$1\"$0"),
("refreshwsdl\t@refreshwsdl", "refreshwsdl=\"$1\"$0"),
("refreshwsdl=\"true\"\trefreshwsdl", "refreshwsdl=\"${1:true}\"$0"),
("refreshwsdl=\"false\"\trefreshwsdl", "refreshwsdl=\"${1:false}\"$0"),
("wsportname\t@wsportname", "wsportname=\"$1\"$0"),
("wsdl2javaargs\t@wsdl2javaargs", "wsdl2javaargs=\"$1\"$0"),
("proxyport\t@proxyport", "proxyport=\"$1\"$0"),
("port\t@port", "port=\"$1\"$0"),
("proxypassword\t@proxypassword", "proxypassword=\"$1\"$0"),
("assembly\t@assembly", "assembly=\"$1\"$0"),
("username\t@username", "username=\"$1\"$0"),
("proxyuser\t@proxyuser", "proxyuser=\"$1\"$0")
],
'attributes': [
"class",
"name",
"proxyport",
"proxypassword",
"refreshwsdl",
"proxyuser",
"port",
"locale",
"assembly",
"username",
"wsportname",
"component",
"protocol",
"action",
"password",
"context",
"wsdl2javaargs",
"server",
"type",
"webservice",
"secure",
"proxyserver"
]
}
self.completions['cfparam'] = {
'completions': [
("name\t@name", "name=\"$1\"$0"),
("type\t@type", "type=\"$1\"$0"),
("type=\"any\"\ttype", "type=\"${1:any}\"$0"),
("type=\"array\"\ttype", "type=\"${1:array}\"$0"),
("type=\"binary\"\ttype", "type=\"${1:binary}\"$0"),
("type=\"boolean\"\ttype", "type=\"${1:boolean}\"$0"),
("type=\"creditcard\"\ttype", "type=\"${1:creditcard}\"$0"),
("type=\"date\"\ttype", "type=\"${1:date}\"$0"),
("type=\"time\"\ttype", "type=\"${1:time}\"$0"),
("type=\"email\"\ttype", "type=\"${1:email}\"$0"),
("type=\"eurodate\"\ttype", "type=\"${1:eurodate}\"$0"),
("type=\"float\"\ttype", "type=\"${1:float}\"$0"),
("type=\"numeric\"\ttype", "type=\"${1:numeric}\"$0"),
("type=\"guid\"\ttype", "type=\"${1:guid}\"$0"),
("type=\"integer\"\ttype", "type=\"${1:integer}\"$0"),
("type=\"query\"\ttype", "type=\"${1:query}\"$0"),
("type=\"range\"\ttype", "type=\"${1:range}\"$0"),
("type=\"regex\"\ttype", "type=\"${1:regex}\"$0"),
("type=\"regular_expression\"\ttype", "type=\"${1:regular_expression}\"$0"),
("type=\"ssn\"\ttype", "type=\"${1:ssn}\"$0"),
("type=\"social_security_number\"\ttype", "type=\"${1:social_security_number}\"$0"),
("type=\"string\"\ttype", "type=\"${1:string}\"$0"),
("type=\"struct\"\ttype", "type=\"${1:struct}\"$0"),
("type=\"telephone\"\ttype", "type=\"${1:telephone}\"$0"),
("type=\"url\"\ttype", "type=\"${1:url}\"$0"),
("type=\"uuid\"\ttype", "type=\"${1:uuid}\"$0"),
("type=\"usdate\"\ttype", "type=\"${1:usdate}\"$0"),
("type=\"variablename\"\ttype", "type=\"${1:variablename}\"$0"),
("type=\"xml\"\ttype", "type=\"${1:xml}\"$0"),
("type=\"zipcode\"\ttype", "type=\"${1:zipcode}\"$0"),
("default\t@default", "default=\"$1\"$0"),
("max\t@max", "max=\"$1\"$0"),
("min\t@min", "min=\"$1\"$0"),
("pattern\t@pattern", "pattern=\"$1\"$0")
],
'attributes': [
"pattern",
"max",
"name",
"min",
"type",
"default"
]
}
self.completions['cfpop'] = {
'completions': [
("server\t@server", "server=\"$1\"$0"),
("port\t@port", "port=\"$1\"$0"),
("username\t@username", "username=\"$1\"$0"),
("password\t@password", "password=\"$1\"$0"),
("action\t@action", "action=\"$1\"$0"),
("action=\"getHeaderOnly\"\taction", "action=\"${1:getHeaderOnly}\"$0"),
("action=\"getAll\"\taction", "action=\"${1:getAll}\"$0"),
("action=\"delete\"\taction", "action=\"${1:delete}\"$0"),
("name\t@name", "name=\"$1\"$0"),
("messagenumber\t@messagenumber", "messagenumber=\"$1\"$0"),
("uid\t@uid", "uid=\"$1\"$0"),
("attachmentpath\t@attachmentpath", "attachmentpath=\"$1\"$0"),
("timeout\t@timeout", "timeout=\"$1\"$0"),
("maxrows\t@maxrows", "maxrows=\"$1\"$0"),
("startrow\t@startrow", "startrow=\"$1\"$0"),
("generateUniqueFileNames\t@generateUniqueFileNames", "generateUniqueFileNames=\"$1\"$0"),
("generateUniqueFileNames=\"true\"\tgenerateUniqueFileNames", "generateUniqueFileNames=\"${1:true}\"$0"),
("generateUniqueFileNames=\"false\"\tgenerateUniqueFileNames", "generateUniqueFileNames=\"${1:false}\"$0")
],
'attributes': [
"name",
"attachmentpath",
"generateUniqueFileNames",
"maxrows",
"port",
"messagenumber",
"uid",
"startrow",
"username",
"action",
"password",
"server",
"timeout"
]
}
self.completions['cfprocparam'] = {
'completions': [
("type\t@type", "type=\"$1\"$0"),
("type=\"in\"\ttype", "type=\"${1:in}\"$0"),
("type=\"out\"\ttype", "type=\"${1:out}\"$0"),
("type=\"inout\"\ttype", "type=\"${1:inout}\"$0"),
("variable\t@variable", "variable=\"$1\"$0"),
("value\t@value", "value=\"$1\"$0"),
("cfsqltype\t@cfsqltype", "cfsqltype=\"$1\"$0"),
("cfsqltype=\"CF_SQL_BIGINT\"\tcfsqltype", "cfsqltype=\"${1:CF_SQL_BIGINT}\"$0"),
("cfsqltype=\"CF_SQL_BIT\"\tcfsqltype", "cfsqltype=\"${1:CF_SQL_BIT}\"$0"),
("cfsqltype=\"CF_SQL_CHAR\"\tcfsqltype", "cfsqltype=\"${1:CF_SQL_CHAR}\"$0"),
("cfsqltype=\"CF_SQL_BLOB\"\tcfsqltype", "cfsqltype=\"${1:CF_SQL_BLOB}\"$0"),
("cfsqltype=\"CF_SQL_CLOB\"\tcfsqltype", "cfsqltype=\"${1:CF_SQL_CLOB}\"$0"),
("cfsqltype=\"CF_SQL_DATE\"\tcfsqltype", "cfsqltype=\"${1:CF_SQL_DATE}\"$0"),
("cfsqltype=\"CF_SQL_DECIMAL\"\tcfsqltype", "cfsqltype=\"${1:CF_SQL_DECIMAL}\"$0"),
("cfsqltype=\"CF_SQL_DOUBLE\"\tcfsqltype", "cfsqltype=\"${1:CF_SQL_DOUBLE}\"$0"),
("cfsqltype=\"CF_SQL_FLOAT\"\tcfsqltype", "cfsqltype=\"${1:CF_SQL_FLOAT}\"$0"),
("cfsqltype=\"CF_SQL_IDSTAMP\"\tcfsqltype", "cfsqltype=\"${1:CF_SQL_IDSTAMP}\"$0"),
("cfsqltype=\"CF_SQL_INTEGER\"\tcfsqltype", "cfsqltype=\"${1:CF_SQL_INTEGER}\"$0"),
("cfsqltype=\"CF_SQL_LONGVARCHAR\"\tcfsqltype", "cfsqltype=\"${1:CF_SQL_LONGVARCHAR}\"$0"),
("cfsqltype=\"CF_SQL_MONEY\"\tcfsqltype", "cfsqltype=\"${1:CF_SQL_MONEY}\"$0"),
("cfsqltype=\"CF_SQL_MONEY4\"\tcfsqltype", "cfsqltype=\"${1:CF_SQL_MONEY4}\"$0"),
("cfsqltype=\"CF_SQL_NUMERIC\"\tcfsqltype", "cfsqltype=\"${1:CF_SQL_NUMERIC}\"$0"),
("cfsqltype=\"CF_SQL_REAL\"\tcfsqltype", "cfsqltype=\"${1:CF_SQL_REAL}\"$0"),
("cfsqltype=\"CF_SQL_REFCURSOR\"\tcfsqltype", "cfsqltype=\"${1:CF_SQL_REFCURSOR}\"$0"),
("cfsqltype=\"CF_SQL_SMALLINT\"\tcfsqltype", "cfsqltype=\"${1:CF_SQL_SMALLINT}\"$0"),
("cfsqltype=\"CF_SQL_TIME\"\tcfsqltype", "cfsqltype=\"${1:CF_SQL_TIME}\"$0"),
("cfsqltype=\"CF_SQL_TIMESTAMP\"\tcfsqltype", "cfsqltype=\"${1:CF_SQL_TIMESTAMP}\"$0"),
("cfsqltype=\"CF_SQL_TINYINT\"\tcfsqltype", "cfsqltype=\"${1:CF_SQL_TINYINT}\"$0"),
("cfsqltype=\"CF_SQL_VARCHAR\"\tcfsqltype", "cfsqltype=\"${1:CF_SQL_VARCHAR}\"$0"),
("maxlength\t@maxlength", "maxlength=\"$1\"$0"),
("scale\t@scale", "scale=\"$1\"$0"),
("null\t@null", "null=\"$1\"$0"),
("null=\"true\"\tnull", "null=\"${1:true}\"$0"),
("null=\"false\"\tnull", "null=\"${1:false}\"$0")
],
'attributes': [
"maxlength",
"cfsqltype",
"scale",
"variable",
"value",
"null",
"type"
]
}
self.completions['cfproperty'] = {
'completions': [
("name\t@name", "name=\"$1\"$0"),
("type\t@type", "type=\"$1\"$0"),
("type=\"any\"\ttype", "type=\"${1:any}\"$0"),
("type=\"array\"\ttype", "type=\"${1:array}\"$0"),
("type=\"binary\"\ttype", "type=\"${1:binary}\"$0"),
("type=\"boolean\"\ttype", "type=\"${1:boolean}\"$0"),
("type=\"date\"\ttype", "type=\"${1:date}\"$0"),
("type=\"guid\"\ttype", "type=\"${1:guid}\"$0"),
("type=\"numeric\"\ttype", "type=\"${1:numeric}\"$0"),
("type=\"query\"\ttype", "type=\"${1:query}\"$0"),
("type=\"string\"\ttype", "type=\"${1:string}\"$0"),
("type=\"struct\"\ttype", "type=\"${1:struct}\"$0"),
("type=\"uuid\"\ttype", "type=\"${1:uuid}\"$0"),
("type=\"variablename\"\ttype", "type=\"${1:variablename}\"$0"),
("required\t@required", "required=\"$1\"$0"),
("required=\"true\"\trequired", "required=\"${1:true}\"$0"),
("required=\"false\"\trequired", "required=\"${1:false}\"$0"),
("default\t@default", "default=\"$1\"$0"),
("displayname\t@displayname", "displayname=\"$1\"$0"),
("hint\t@hint", "hint=\"$1\"$0"),
("fieldtype\t@fieldtype", "fieldtype=\"$1\"$0"),
("fieldtype=\"id\"\tfieldtype", "fieldtype=\"${1:id}\"$0"),
("fieldtype=\"column\"\tfieldtype", "fieldtype=\"${1:column}\"$0"),
("fieldtype=\"one-to-one\"\tfieldtype", "fieldtype=\"${1:one-to-one}\"$0"),
("fieldtype=\"one-to-many\"\tfieldtype", "fieldtype=\"${1:one-to-many}\"$0"),
("fieldtype=\"many-to-many\"\tfieldtype", "fieldtype=\"${1:many-to-many}\"$0"),
("fieldtype=\"many-to-one\"\tfieldtype", "fieldtype=\"${1:many-to-one}\"$0"),
("fieldtype=\"collection\"\tfieldtype", "fieldtype=\"${1:collection}\"$0"),
("fieldtype=\"timestamp\"\tfieldtype", "fieldtype=\"${1:timestamp}\"$0"),
("fieldtype=\"version\"\tfieldtype", "fieldtype=\"${1:version}\"$0"),
("ormType\t@ormType", "ormType=\"$1\"$0"),
("ormType=\"string\"\tormType", "ormType=\"${1:string}\"$0"),
("ormType=\"character\"\tormType", "ormType=\"${1:character}\"$0"),
("ormType=\"char\"\tormType", "ormType=\"${1:char}\"$0"),
("ormType=\"short\"\tormType", "ormType=\"${1:short}\"$0"),
("ormType=\"integer\"\tormType", "ormType=\"${1:integer}\"$0"),
("ormType=\"int\"\tormType", "ormType=\"${1:int}\"$0"),
("ormType=\"long\"\tormType", "ormType=\"${1:long}\"$0"),
("ormType=\"big_decimal\"\tormType", "ormType=\"${1:big_decimal}\"$0"),
("ormType=\"float\"\tormType", "ormType=\"${1:float}\"$0"),
("ormType=\"double\"\tormType", "ormType=\"${1:double}\"$0"),
("ormType=\"boolean\"\tormType", "ormType=\"${1:boolean}\"$0"),
("ormType=\"yes_no\"\tormType", "ormType=\"${1:yes_no}\"$0"),
("ormType=\"true_false\"\tormType", "ormType=\"${1:true_false}\"$0"),
("ormType=\"text\"\tormType", "ormType=\"${1:text}\"$0"),
("ormType=\"date\"\tormType", "ormType=\"${1:date}\"$0"),
("ormType=\"timestamp\"\tormType", "ormType=\"${1:timestamp}\"$0"),
("ormType=\"binary\"\tormType", "ormType=\"${1:binary}\"$0"),
("ormType=\"serializable\"\tormType", "ormType=\"${1:serializable}\"$0"),
("ormType=\"blob\"\tormType", "ormType=\"${1:blob}\"$0"),
("ormType=\"clob\"\tormType", "ormType=\"${1:clob}\"$0"),
("column\t@column", "column=\"$1\"$0"),
("generator\t@generator", "generator=\"$1\"$0"),
("generator=\"increment\"\tgenerator", "generator=\"${1:increment}\"$0"),
("generator=\"identity\"\tgenerator", "generator=\"${1:identity}\"$0"),
("generator=\"sequence\"\tgenerator", "generator=\"${1:sequence}\"$0"),
("generator=\"seqhilo\"\tgenerator", "generator=\"${1:seqhilo}\"$0"),
("generator=\"uuid\"\tgenerator", "generator=\"${1:uuid}\"$0"),
("generator=\"guid\"\tgenerator", "generator=\"${1:guid}\"$0"),
("generator=\"native\"\tgenerator", "generator=\"${1:native}\"$0"),
("generator=\"assigned\"\tgenerator", "generator=\"${1:assigned}\"$0"),
("generator=\"select\"\tgenerator", "generator=\"${1:select}\"$0"),
("generator=\"foreign\"\tgenerator", "generator=\"${1:foreign}\"$0"),
("generator=\"sequence-indentity\"\tgenerator", "generator=\"${1:sequence-indentity}\"$0"),
("sequence\t@sequence", "sequence=\"$1\"$0"),
("selectkey\t@selectkey", "selectkey=\"$1\"$0"),
("params\t@params", "params=\"$1\"$0"),
("length\t@length", "length=\"$1\"$0"),
("precision\t@precision", "precision=\"$1\"$0"),
("index\t@index", "index=\"$1\"$0"),
("setter\t@setter", "setter=\"$1\"$0"),
("setter=\"true\"\tsetter", "setter=\"${1:true}\"$0"),
("setter=\"false\"\tsetter", "setter=\"${1:false}\"$0"),
("getter\t@getter", "getter=\"$1\"$0"),
("getter=\"true\"\tgetter", "getter=\"${1:true}\"$0"),
("getter=\"false\"\tgetter", "getter=\"${1:false}\"$0"),
("source\t@source", "source=\"$1\"$0"),
("source=\"vm\"\tsource", "source=\"${1:vm}\"$0"),
("source=\"db\"\tsource", "source=\"${1:db}\"$0"),
("elementcolumn\t@elementcolumn", "elementcolumn=\"$1\"$0"),
("elementtype\t@elementtype", "elementtype=\"$1\"$0"),
("elementtype=\"string\"\telementtype", "elementtype=\"${1:string}\"$0"),
("elementtype=\"character\"\telementtype", "elementtype=\"${1:character}\"$0"),
("elementtype=\"char\"\telementtype", "elementtype=\"${1:char}\"$0"),
("elementtype=\"short\"\telementtype", "elementtype=\"${1:short}\"$0"),
("elementtype=\"integer\"\telementtype", "elementtype=\"${1:integer}\"$0"),
("elementtype=\"int\"\telementtype", "elementtype=\"${1:int}\"$0"),
("elementtype=\"long\"\telementtype", "elementtype=\"${1:long}\"$0"),
("elementtype=\"big_decimal\"\telementtype", "elementtype=\"${1:big_decimal}\"$0"),
("elementtype=\"float\"\telementtype", "elementtype=\"${1:float}\"$0"),
("elementtype=\"double\"\telementtype", "elementtype=\"${1:double}\"$0"),
("elementtype=\"boolean\"\telementtype", "elementtype=\"${1:boolean}\"$0"),
("elementtype=\"yes_no\"\telementtype", "elementtype=\"${1:yes_no}\"$0"),
("elementtype=\"true_false\"\telementtype", "elementtype=\"${1:true_false}\"$0"),
("elementtype=\"text\"\telementtype", "elementtype=\"${1:text}\"$0"),
("elementtype=\"date\"\telementtype", "elementtype=\"${1:date}\"$0"),
("elementtype=\"timestamp\"\telementtype", "elementtype=\"${1:timestamp}\"$0"),
("elementtype=\"binary\"\telementtype", "elementtype=\"${1:binary}\"$0"),
("elementtype=\"serializable\"\telementtype", "elementtype=\"${1:serializable}\"$0"),
("elementtype=\"blob\"\telementtype", "elementtype=\"${1:blob}\"$0"),
("elementtype=\"clob\"\telementtype", "elementtype=\"${1:clob}\"$0"),
("structkeytype\t@structkeytype", "structkeytype=\"$1\"$0"),
("structkeytype=\"string\"\tstructkeytype", "structkeytype=\"${1:string}\"$0"),
("structkeytype=\"character\"\tstructkeytype", "structkeytype=\"${1:character}\"$0"),
("structkeytype=\"char\"\tstructkeytype", "structkeytype=\"${1:char}\"$0"),
("structkeytype=\"short\"\tstructkeytype", "structkeytype=\"${1:short}\"$0"),
("structkeytype=\"integer\"\tstructkeytype", "structkeytype=\"${1:integer}\"$0"),
("structkeytype=\"int\"\tstructkeytype", "structkeytype=\"${1:int}\"$0"),
("structkeytype=\"long\"\tstructkeytype", "structkeytype=\"${1:long}\"$0"),
("structkeytype=\"big_decimal\"\tstructkeytype", "structkeytype=\"${1:big_decimal}\"$0"),
("structkeytype=\"float\"\tstructkeytype", "structkeytype=\"${1:float}\"$0"),
("structkeytype=\"double\"\tstructkeytype", "structkeytype=\"${1:double}\"$0"),
("structkeytype=\"boolean\"\tstructkeytype", "structkeytype=\"${1:boolean}\"$0"),
("structkeytype=\"yes_no\"\tstructkeytype", "structkeytype=\"${1:yes_no}\"$0"),
("structkeytype=\"true_false\"\tstructkeytype", "structkeytype=\"${1:true_false}\"$0"),
("structkeytype=\"text\"\tstructkeytype", "structkeytype=\"${1:text}\"$0"),
("structkeytype=\"date\"\tstructkeytype", "structkeytype=\"${1:date}\"$0"),
("structkeytype=\"timestamp\"\tstructkeytype", "structkeytype=\"${1:timestamp}\"$0"),
("structkeytype=\"binary\"\tstructkeytype", "structkeytype=\"${1:binary}\"$0"),
("structkeytype=\"serializable\"\tstructkeytype", "structkeytype=\"${1:serializable}\"$0"),
("structkeytype=\"blob\"\tstructkeytype", "structkeytype=\"${1:blob}\"$0"),
("structkeytype=\"clob\"\tstructkeytype", "structkeytype=\"${1:clob}\"$0"),
("structkeycolumn\t@structkeycolumn", "structkeycolumn=\"$1\"$0"),
("inversejoincolumn\t@inversejoincolumn", "inversejoincolumn=\"$1\"$0"),
("linkschema\t@linkschema", "linkschema=\"$1\"$0"),
("linkcatalog\t@linkcatalog", "linkcatalog=\"$1\"$0"),
("linktable\t@linktable", "linktable=\"$1\"$0"),
("missingRowIgnored\t@missingRowIgnored", "missingRowIgnored=\"$1\"$0"),
("missingRowIgnored=\"true\"\tmissingRowIgnored", "missingRowIgnored=\"${1:true}\"$0"),
("missingRowIgnored=\"false\"\tmissingRowIgnored", "missingRowIgnored=\"${1:false}\"$0"),
("inverse\t@inverse", "inverse=\"$1\"$0"),
("inverse=\"true\"\tinverse", "inverse=\"${1:true}\"$0"),
("inverse=\"false\"\tinverse", "inverse=\"${1:false}\"$0"),
("orderby\t@orderby", "orderby=\"$1\"$0"),
("fkcolumn\t@fkcolumn", "fkcolumn=\"$1\"$0"),
("fetch\t@fetch", "fetch=\"$1\"$0"),
("fetch=\"join\"\tfetch", "fetch=\"${1:join}\"$0"),
("fetch=\"select\"\tfetch", "fetch=\"${1:select}\"$0"),
("cascade\t@cascade", "cascade=\"$1\"$0"),
("cascade=\"all\"\tcascade", "cascade=\"${1:all}\"$0"),
("cascade=\"none\"\tcascade", "cascade=\"${1:none}\"$0"),
("cascade=\"save-update\"\tcascade", "cascade=\"${1:save-update}\"$0"),
("cascade=\"delete\"\tcascade", "cascade=\"${1:delete}\"$0"),
("cascade=\"all-delete-orphan\"\tcascade", "cascade=\"${1:all-delete-orphan}\"$0"),
("cascade=\"delete-orphan\"\tcascade", "cascade=\"${1:delete-orphan}\"$0"),
("cascade=\"create\"\tcascade", "cascade=\"${1:create}\"$0"),
("cascade=\"merge\"\tcascade", "cascade=\"${1:merge}\"$0"),
("cascade=\"lock\"\tcascade", "cascade=\"${1:lock}\"$0"),
("cascade=\"refresh\"\tcascade", "cascade=\"${1:refresh}\"$0"),
("cascade=\"evict\"\tcascade", "cascade=\"${1:evict}\"$0"),
("cascade=\"replicate\"\tcascade", "cascade=\"${1:replicate}\"$0"),
("constrained\t@constrained", "constrained=\"$1\"$0"),
("constrained=\"true\"\tconstrained", "constrained=\"${1:true}\"$0"),
("constrained=\"false\"\tconstrained", "constrained=\"${1:false}\"$0"),
("unique\t@unique", "unique=\"$1\"$0"),
("unique=\"true\"\tunique", "unique=\"${1:true}\"$0"),
("unique=\"false\"\tunique", "unique=\"${1:false}\"$0"),
("uniquekey\t@uniquekey", "uniquekey=\"$1\"$0"),
("notnull\t@notnull", "notnull=\"$1\"$0"),
("notnull=\"true\"\tnotnull", "notnull=\"${1:true}\"$0"),
("notnull=\"false\"\tnotnull", "notnull=\"${1:false}\"$0"),
("update\t@update", "update=\"$1\"$0"),
("update=\"true\"\tupdate", "update=\"${1:true}\"$0"),
("update=\"false\"\tupdate", "update=\"${1:false}\"$0"),
("insert\t@insert", "insert=\"$1\"$0"),
("insert=\"true\"\tinsert", "insert=\"${1:true}\"$0"),
("insert=\"false\"\tinsert", "insert=\"${1:false}\"$0"),
("generated\t@generated", "generated=\"$1\"$0"),
("generated=\"never\"\tgenerated", "generated=\"${1:never}\"$0"),
("generated=\"insert\"\tgenerated", "generated=\"${1:insert}\"$0"),
("generated=\"always\"\tgenerated", "generated=\"${1:always}\"$0"),
("formula\t@formula", "formula=\"$1\"$0"),
("lazy\t@lazy", "lazy=\"$1\"$0"),
("lazy=\"true\"\tlazy", "lazy=\"${1:true}\"$0"),
("lazy=\"false\"\tlazy", "lazy=\"${1:false}\"$0"),
("lazy=\"extra\"\tlazy", "lazy=\"${1:extra}\"$0"),
("optimisticLock\t@optimisticLock", "optimisticLock=\"$1\"$0"),
("optimisticLock=\"true\"\toptimisticLock", "optimisticLock=\"${1:true}\"$0"),
("optimisticLock=\"false\"\toptimisticLock", "optimisticLock=\"${1:false}\"$0"),
("scale\t@scale", "scale=\"$1\"$0"),
("mappedby\t@mappedby", "mappedby=\"$1\"$0"),
("cfc\t@cfc", "cfc=\"$1\"$0"),
("joinColumn\t@joinColumn", "joinColumn=\"$1\"$0"),
("validate\t@validate", "validate=\"$1\"$0"),
("validate=\"string\"\tvalidate", "validate=\"${1:string}\"$0"),
("validate=\"boolean\"\tvalidate", "validate=\"${1:boolean}\"$0"),
("validate=\"integer\"\tvalidate", "validate=\"${1:integer}\"$0"),
("validate=\"numeric\"\tvalidate", "validate=\"${1:numeric}\"$0"),
("validate=\"date\"\tvalidate", "validate=\"${1:date}\"$0"),
("validate=\"time\"\tvalidate", "validate=\"${1:time}\"$0"),
("validate=\"creditcard\"\tvalidate", "validate=\"${1:creditcard}\"$0"),
("validate=\"email\"\tvalidate", "validate=\"${1:email}\"$0"),
("validate=\"eurodate\"\tvalidate", "validate=\"${1:eurodate}\"$0"),
("validate=\"regex\"\tvalidate", "validate=\"${1:regex}\"$0"),
("validate=\"ssn\"\tvalidate", "validate=\"${1:ssn}\"$0"),
("validate=\"telephone\"\tvalidate", "validate=\"${1:telephone}\"$0"),
("validate=\"UUID\"\tvalidate", "validate=\"${1:UUID}\"$0"),
("validate=\"guid\"\tvalidate", "validate=\"${1:guid}\"$0"),
("validate=\"zipcode\"\tvalidate", "validate=\"${1:zipcode}\"$0"),
("validateParams\t@validateParams", "validateParams=\"$1\"$0"),
("cacheUse\t@cacheUse", "cacheUse=\"$1\"$0"),
("cacheUse=\"read-only\"\tcacheUse", "cacheUse=\"${1:read-only}\"$0"),
("cacheUse=\"nonstrict-read-write\"\tcacheUse", "cacheUse=\"${1:nonstrict-read-write}\"$0"),
("cacheUse=\"read-write\"\tcacheUse", "cacheUse=\"${1:read-write}\"$0"),
("cacheUse=\"transactional\"\tcacheUse", "cacheUse=\"${1:transactional}\"$0"),
("sqlType\t@sqlType", "sqlType=\"$1\"$0"),
("dbDefault\t@dbDefault", "dbDefault=\"$1\"$0"),
("where\t@where", "where=\"$1\"$0"),
("persistent\t@persistent", "persistent=\"$1\"$0"),
("persistent=\"true\"\tpersistent", "persistent=\"${1:true}\"$0"),
("persistent=\"false\"\tpersistent", "persistent=\"${1:false}\"$0"),
("unSavedValue\t@unSavedValue", "unSavedValue=\"$1\"$0"),
("serializable\t@serializable", "serializable=\"$1\"$0"),
("serializable=\"true\"\tserializable", "serializable=\"${1:true}\"$0"),
("serializable=\"false\"\tserializable", "serializable=\"${1:false}\"$0"),
("singularname\t@singularname", "singularname=\"$1\"$0"),
("remotingFetch\t@remotingFetch", "remotingFetch=\"$1\"$0"),
("remotingFetch=\"true\"\tremotingFetch", "remotingFetch=\"${1:true}\"$0"),
("remotingFetch=\"false\"\tremotingFetch", "remotingFetch=\"${1:false}\"$0"),
("table\t@table", "table=\"$1\"$0")
],
'attributes': [
"where",
"constrained",
"formula",
"generated",
"precision",
"persistent",
"optimisticLock",
"table",
"update",
"source",
"missingRowIgnored",
"fieldtype",
"orderby",
"structkeycolumn",
"cascade",
"notnull",
"uniquekey",
"length",
"cfc",
"type",
"linkcatalog",
"fkcolumn",
"index",
"cacheUse",
"name",
"insert",
"unSavedValue",
"elementcolumn",
"column",
"displayname",
"singularname",
"params",
"unique",
"ormType",
"serializable",
"getter",
"lazy",
"default",
"structkeytype",
"sqlType",
"inversejoincolumn",
"required",
"selectkey",
"elementtype",
"generator",
"sequence",
"inverse",
"validateParams",
"remotingFetch",
"scale",
"fetch",
"mappedby",
"dbDefault",
"validate",
"joinColumn",
"setter",
"linktable",
"linkschema",
"hint"
]
}
self.completions['cfquery'] = {
'completions': [
("name\t@name", "name=\"$1\"$0"),
("datasource\t@datasource", "datasource=\"$1\"$0"),
("ormoptions\t@ormoptions", "ormoptions=\"$1\"$0"),
("dbtype\t@dbtype", "dbtype=\"$1\"$0"),
("dbtype=\"query\"\tdbtype", "dbtype=\"${1:query}\"$0"),
("dbtype=\"hql\"\tdbtype", "dbtype=\"${1:hql}\"$0"),
("username\t@username", "username=\"$1\"$0"),
("password\t@password", "password=\"$1\"$0"),
("maxrows\t@maxrows", "maxrows=\"$1\"$0"),
("blockfactor\t@blockfactor", "blockfactor=\"$1\"$0"),
("timeout\t@timeout", "timeout=\"$1\"$0"),
("cachedafter\t@cachedafter", "cachedafter=\"$1\"$0"),
("cachedwithin\t@cachedwithin", "cachedwithin=\"$1\"$0"),
("debug\t@debug", "debug=\"$1\"$0"),
("debug=\"true\"\tdebug", "debug=\"${1:true}\"$0"),
("debug=\"false\"\tdebug", "debug=\"${1:false}\"$0"),
("result\t@result", "result=\"$1\"$0")
],
'attributes': [
"datasource",
"name",
"blockfactor",
"dbtype",
"ormoptions",
"maxrows",
"result",
"cachedwithin",
"username",
"password",
"cachedafter",
"debug",
"timeout"
]
}
self.completions['cfschedule'] = {
'completions': [
("action\t@action", "action=\"$1\"$0"),
("action=\"delete\"\taction", "action=\"${1:delete}\"$0"),
("action=\"update\"\taction", "action=\"${1:update}\"$0"),
("action=\"run\"\taction", "action=\"${1:run}\"$0"),
("action=\"pause\"\taction", "action=\"${1:pause}\"$0"),
("action=\"resume\"\taction", "action=\"${1:resume}\"$0"),
("task\t@task", "task=\"$1\"$0"),
("operation\t@operation", "operation=\"$1\"$0"),
("operation=\"HTTPRequest\"\toperation", "operation=\"${1:HTTPRequest}\"$0"),
("file\t@file", "file=\"$1\"$0"),
("path\t@path", "path=\"$1\"$0"),
("startdate\t@startdate", "startdate=\"$1\"$0"),
("starttime\t@starttime", "starttime=\"$1\"$0"),
("URL\t@URL", "URL=\"$1\"$0"),
("port\t@port", "port=\"$1\"$0"),
("publish\t@publish", "publish=\"$1\"$0"),
("publish=\"true\"\tpublish", "publish=\"${1:true}\"$0"),
("publish=\"false\"\tpublish", "publish=\"${1:false}\"$0"),
("endDate\t@endDate", "endDate=\"$1\"$0"),
("endTime\t@endTime", "endTime=\"$1\"$0"),
("interval\t@interval", "interval=\"$1\"$0"),
("interval=\"once\"\tinterval", "interval=\"${1:once}\"$0"),
("interval=\"daily\"\tinterval", "interval=\"${1:daily}\"$0"),
("interval=\"weekly\"\tinterval", "interval=\"${1:weekly}\"$0"),
("interval=\"monthly\"\tinterval", "interval=\"${1:monthly}\"$0"),
("requesttimeout\t@requesttimeout", "requesttimeout=\"$1\"$0"),
("username\t@username", "username=\"$1\"$0"),
("password\t@password", "password=\"$1\"$0"),
("proxyserver\t@proxyserver", "proxyserver=\"$1\"$0"),
("proxyport\t@proxyport", "proxyport=\"$1\"$0"),
("proxyuser\t@proxyuser", "proxyuser=\"$1\"$0"),
("proxypassword\t@proxypassword", "proxypassword=\"$1\"$0"),
("resolveurl\t@resolveurl", "resolveurl=\"$1\"$0"),
("resolveurl=\"true\"\tresolveurl", "resolveurl=\"${1:true}\"$0"),
("resolveurl=\"false\"\tresolveurl", "resolveurl=\"${1:false}\"$0")
],
'attributes': [
"proxyport",
"proxypassword",
"path",
"starttime",
"requesttimeout",
"resolveurl",
"proxyuser",
"port",
"startdate",
"task",
"operation",
"file",
"username",
"endTime",
"password",
"action",
"URL",
"interval",
"publish",
"proxyserver",
"endDate"
]
}
self.completions['cfsearch'] = {
'completions': [
("name\t@name", "name=\"$1\"$0"),
("collection\t@collection", "collection=\"$1\"$0"),
("category\t@category", "category=\"$1\"$0"),
("categorytree\t@categorytree", "categorytree=\"$1\"$0"),
("status\t@status", "status=\"$1\"$0"),
("type\t@type", "type=\"$1\"$0"),
("type=\"simple\"\ttype", "type=\"${1:simple}\"$0"),
("type=\"explicit\"\ttype", "type=\"${1:explicit}\"$0"),
("type=\"internet\"\ttype", "type=\"${1:internet}\"$0"),
("type=\"internet_basic\"\ttype", "type=\"${1:internet_basic}\"$0"),
("type=\"natural\"\ttype", "type=\"${1:natural}\"$0"),
("type=\"standard\"\ttype", "type=\"${1:standard}\"$0"),
("type=\"dismax\"\ttype", "type=\"${1:dismax}\"$0"),
("criteria\t@criteria", "criteria=\"$1\"$0"),
("maxrows\t@maxrows", "maxrows=\"$1\"$0"),
("startrow\t@startrow", "startrow=\"$1\"$0"),
("suggestions\t@suggestions", "suggestions=\"$1\"$0"),
("suggestions=\"always\"\tsuggestions", "suggestions=\"${1:always}\"$0"),
("suggestions=\"never\"\tsuggestions", "suggestions=\"${1:never}\"$0"),
("suggestions=\"5\"\tsuggestions", "suggestions=\"${1:5}\"$0"),
("suggestions=\"10\"\tsuggestions", "suggestions=\"${1:10}\"$0"),
("contextPassages\t@contextPassages", "contextPassages=\"$1\"$0"),
("contextBytes\t@contextBytes", "contextBytes=\"$1\"$0"),
("contextHighlightBegin\t@contextHighlightBegin", "contextHighlightBegin=\"$1\"$0"),
("contextHighlightBegin=\"\"\tcontextHighlightBegin", "contextHighlightBegin=\"${1:}\"$0"),
("contextHighlightBegin=\"\"\tcontextHighlightBegin", "contextHighlightBegin=\"${1:}\"$0"),
("contextHighlightBegin=\"\"\tcontextHighlightBegin", "contextHighlightBegin=\"${1:}\"$0"),
("contextHighlightEnd\t@contextHighlightEnd", "contextHighlightEnd=\"$1\"$0"),
("contextHighlightEnd=\"\"\tcontextHighlightEnd", "contextHighlightEnd=\"${1:}\"$0"),
("contextHighlightEnd=\"\"\tcontextHighlightEnd", "contextHighlightEnd=\"${1:}\"$0"),
("contextHighlightEnd=\"\"\tcontextHighlightEnd", "contextHighlightEnd=\"${1:}\"$0"),
("previousCriteria\t@previousCriteria", "previousCriteria=\"$1\"$0"),
("language\t@language", "language=\"$1\"$0")
],
'attributes': [
"name",
"language",
"previousCriteria",
"categorytree",
"status",
"maxrows",
"criteria",
"contextPassages",
"category",
"contextHighlightEnd",
"collection",
"suggestions",
"contextHighlightBegin",
"startrow",
"contextBytes",
"type"
]
}
self.completions['cfstoredproc'] = {
'completions': [
("procedure\t@procedure", "procedure=\"$1\"$0"),
("datasource\t@datasource", "datasource=\"$1\"$0"),
("username\t@username", "username=\"$1\"$0"),
("password\t@password", "password=\"$1\"$0"),
("blockfactor\t@blockfactor", "blockfactor=\"$1\"$0"),
("debug\t@debug", "debug=\"$1\"$0"),
("debug=\"true\"\tdebug", "debug=\"${1:true}\"$0"),
("debug=\"false\"\tdebug", "debug=\"${1:false}\"$0"),
("returncode\t@returncode", "returncode=\"$1\"$0"),
("returncode=\"true\"\treturncode", "returncode=\"${1:true}\"$0"),
("returncode=\"false\"\treturncode", "returncode=\"${1:false}\"$0"),
("result\t@result", "result=\"$1\"$0")
],
'attributes': [
"returncode",
"result",
"datasource",
"blockfactor",
"username",
"procedure",
"password",
"debug"
]
}
self.completions['cfupdate'] = {
'completions': [
("datasource\t@datasource", "datasource=\"$1\"$0"),
("tablename\t@tablename", "tablename=\"$1\"$0"),
("tableowner\t@tableowner", "tableowner=\"$1\"$0"),
("tablequalifier\t@tablequalifier", "tablequalifier=\"$1\"$0"),
("username\t@username", "username=\"$1\"$0"),
("password\t@password", "password=\"$1\"$0"),
("formfields\t@formfields", "formfields=\"$1\"$0")
],
'attributes': [
"tablequalifier",
"datasource",
"username",
"tablename",
"password",
"formfields",
"tableowner"
]
}
self.completions['cfajaximport'] = {
'completions': [
("scriptsrc\t@scriptsrc", "scriptsrc=\"$1\"$0"),
("csssrc\t@csssrc", "csssrc=\"$1\"$0"),
("tags\t@tags", "tags=\"$1\"$0")
],
'attributes': [
"scriptsrc",
"csssrc",
"tags"
]
}
self.completions['cfexchangecalendar'] = {
'completions': [
("action\t@action", "action=\"$1\"$0"),
("action=\"create\"\taction", "action=\"${1:create}\"$0"),
("action=\"delete\"\taction", "action=\"${1:delete}\"$0"),
("action=\"deleteAttachments\"\taction", "action=\"${1:deleteAttachments}\"$0"),
("action=\"get\"\taction", "action=\"${1:get}\"$0"),
("action=\"getAttachments\"\taction", "action=\"${1:getAttachments}\"$0"),
("action=\"modify\"\taction", "action=\"${1:modify}\"$0"),
("action=\"respond\"\taction", "action=\"${1:respond}\"$0"),
("attachmentpath\t@attachmentpath", "attachmentpath=\"$1\"$0"),
("connection\t@connection", "connection=\"$1\"$0"),
("event\t@event", "event=\"$1\"$0"),
("generateUniquefilenames\t@generateUniquefilenames", "generateUniquefilenames=\"$1\"$0"),
("generateUniquefilenames=\"true\"\tgenerateUniquefilenames", "generateUniquefilenames=\"${1:true}\"$0"),
("generateUniquefilenames=\"false\"\tgenerateUniquefilenames", "generateUniquefilenames=\"${1:false}\"$0"),
("message\t@message", "message=\"$1\"$0"),
("name\t@name", "name=\"$1\"$0"),
("notify\t@notify", "notify=\"$1\"$0"),
("notify=\"true\"\tnotify", "notify=\"${1:true}\"$0"),
("notify=\"false\"\tnotify", "notify=\"${1:false}\"$0"),
("responseType\t@responseType", "responseType=\"$1\"$0"),
("responseType=\"accept\"\tresponseType", "responseType=\"${1:accept}\"$0"),
("responseType=\"decline\"\tresponseType", "responseType=\"${1:decline}\"$0"),
("responseType=\"tentative\"\tresponseType", "responseType=\"${1:tentative}\"$0"),
("result\t@result", "result=\"$1\"$0"),
("uid\t@uid", "uid=\"$1\"$0")
],
'attributes': [
"connection",
"message",
"result",
"name",
"uid",
"event",
"responseType",
"notify",
"action",
"attachmentpath",
"generateUniquefilenames"
]
}
self.completions['cfexchangeconnection'] = {
'completions': [
("action\t@action", "action=\"$1\"$0"),
("action=\"open\"\taction", "action=\"${1:open}\"$0"),
("action=\"close\"\taction", "action=\"${1:close}\"$0"),
("action=\"getsubfolders\"\taction", "action=\"${1:getsubfolders}\"$0"),
("connection\t@connection", "connection=\"$1\"$0"),
("mailboxName\t@mailboxName", "mailboxName=\"$1\"$0"),
("password\t@password", "password=\"$1\"$0"),
("port\t@port", "port=\"$1\"$0"),
("protocol\t@protocol", "protocol=\"$1\"$0"),
("protocol=\"http\"\tprotocol", "protocol=\"${1:http}\"$0"),
("protocol=\"https\"\tprotocol", "protocol=\"${1:https}\"$0"),
("proxyHost\t@proxyHost", "proxyHost=\"$1\"$0"),
("proxyPort\t@proxyPort", "proxyPort=\"$1\"$0"),
("server\t@server", "server=\"$1\"$0"),
("username\t@username", "username=\"$1\"$0"),
("folder\t@folder", "folder=\"$1\"$0"),
("recurse\t@recurse", "recurse=\"$1\"$0"),
("recurse=\"true\"\trecurse", "recurse=\"${1:true}\"$0"),
("recurse=\"false\"\trecurse", "recurse=\"${1:false}\"$0"),
("name\t@name", "name=\"$1\"$0"),
("exchangeServerLanguage\t@exchangeServerLanguage", "exchangeServerLanguage=\"$1\"$0"),
("formBasedAuthentication\t@formBasedAuthentication", "formBasedAuthentication=\"$1\"$0"),
("formBasedAuthentication=\"true\"\tformBasedAuthentication", "formBasedAuthentication=\"${1:true}\"$0"),
("formBasedAuthentication=\"false\"\tformBasedAuthentication", "formBasedAuthentication=\"${1:false}\"$0")
],
'attributes': [
"connection",
"name",
"proxyPort",
"recurse",
"proxyHost",
"folder",
"port",
"exchangeServerLanguage",
"formBasedAuthentication",
"mailboxName",
"username",
"protocol",
"action",
"password",
"server"
]
}
self.completions['cfexchangetask'] = {
'completions': [
("action\t@action", "action=\"$1\"$0"),
("action=\"create\"\taction", "action=\"${1:create}\"$0"),
("action=\"delete\"\taction", "action=\"${1:delete}\"$0"),
("action=\"deleteAttachments\"\taction", "action=\"${1:deleteAttachments}\"$0"),
("action=\"get\"\taction", "action=\"${1:get}\"$0"),
("action=\"getAttachments\"\taction", "action=\"${1:getAttachments}\"$0"),
("action=\"modify\"\taction", "action=\"${1:modify}\"$0"),
("attachmentPath\t@attachmentPath", "attachmentPath=\"$1\"$0"),
("connection\t@connection", "connection=\"$1\"$0"),
("task\t@task", "task=\"$1\"$0"),
("name\t@name", "name=\"$1\"$0"),
("results\t@results", "results=\"$1\"$0"),
("uid\t@uid", "uid=\"$1\"$0"),
("result\t@result", "result=\"$1\"$0")
],
'attributes': [
"connection",
"result",
"name",
"task",
"uid",
"results",
"action",
"attachmentPath"
]
}
del self.completions['cfexchangefolder']
del self.completions['cfexchangeconversation']
self.completions['cfimage'] = {
'completions': [
("action\t@action", "action=\"$1\"$0"),
("action=\"border\"\taction", "action=\"${1:border}\"$0"),
("action=\"captcha\"\taction", "action=\"${1:captcha}\"$0"),
("action=\"convert\"\taction", "action=\"${1:convert}\"$0"),
("action=\"info\"\taction", "action=\"${1:info}\"$0"),
("action=\"read\"\taction", "action=\"${1:read}\"$0"),
("action=\"resize\"\taction", "action=\"${1:resize}\"$0"),
("action=\"rotate\"\taction", "action=\"${1:rotate}\"$0"),
("action=\"write\"\taction", "action=\"${1:write}\"$0"),
("action=\"writeToBrowser\"\taction", "action=\"${1:writeToBrowser}\"$0"),
("angle\t@angle", "angle=\"$1\"$0"),
("color\t@color", "color=\"$1\"$0"),
("destination\t@destination", "destination=\"$1\"$0"),
("difficulty\t@difficulty", "difficulty=\"$1\"$0"),
("difficulty=\"high\"\tdifficulty", "difficulty=\"${1:high}\"$0"),
("difficulty=\"medium\"\tdifficulty", "difficulty=\"${1:medium}\"$0"),
("difficulty=\"low\"\tdifficulty", "difficulty=\"${1:low}\"$0"),
("fontSize\t@fontSize", "fontSize=\"$1\"$0"),
("format\t@format", "format=\"$1\"$0"),
("format=\"PNG\"\tformat", "format=\"${1:PNG}\"$0"),
("format=\"jpg\"\tformat", "format=\"${1:jpg}\"$0"),
("format=\"jpeg\"\tformat", "format=\"${1:jpeg}\"$0"),
("height\t@height", "height=\"$1\"$0"),
("isBase64\t@isBase64", "isBase64=\"$1\"$0"),
("isBase64=\"true\"\tisBase64", "isBase64=\"${1:true}\"$0"),
("isBase64=\"false\"\tisBase64", "isBase64=\"${1:false}\"$0"),
("name\t@name", "name=\"$1\"$0"),
("overwrite\t@overwrite", "overwrite=\"$1\"$0"),
("overwrite=\"true\"\toverwrite", "overwrite=\"${1:true}\"$0"),
("overwrite=\"false\"\toverwrite", "overwrite=\"${1:false}\"$0"),
("quality\t@quality", "quality=\"$1\"$0"),
("source\t@source", "source=\"$1\"$0"),
("structName\t@structName", "structName=\"$1\"$0"),
("text\t@text", "text=\"$1\"$0"),
("thickness\t@thickness", "thickness=\"$1\"$0"),
("width\t@width", "width=\"$1\"$0"),
("fonts\t@fonts", "fonts=\"$1\"$0")
],
'attributes': [
"structName",
"quality",
"thickness",
"name",
"overwrite",
"angle",
"destination",
"height",
"fontSize",
"width",
"isBase64",
"source",
"fonts",
"difficulty",
"format",
"text",
"color",
"action"
]
}
self.completions['cfpdf'] = {
'completions': [
("action\t@action", "action=\"$1\"$0"),
("action=\"addwatermark\"\taction", "action=\"${1:addwatermark}\"$0"),
("action=\"deletepages\"\taction", "action=\"${1:deletepages}\"$0"),
("action=\"getinfo\"\taction", "action=\"${1:getinfo}\"$0"),
("action=\"merge\"\taction", "action=\"${1:merge}\"$0"),
("action=\"protect\"\taction", "action=\"${1:protect}\"$0"),
("action=\"processddx\"\taction", "action=\"${1:processddx}\"$0"),
("action=\"read\"\taction", "action=\"${1:read}\"$0"),
("action=\"removewatermark\"\taction", "action=\"${1:removewatermark}\"$0"),
("action=\"setinfo\"\taction", "action=\"${1:setinfo}\"$0"),
("action=\"thumbnail\"\taction", "action=\"${1:thumbnail}\"$0"),
("action=\"write\"\taction", "action=\"${1:write}\"$0"),
("action=\"extracttext\"\taction", "action=\"${1:extracttext}\"$0"),
("action=\"extractimage\"\taction", "action=\"${1:extractimage}\"$0"),
("action=\"addheader\"\taction", "action=\"${1:addheader}\"$0"),
("action=\"addfooter\"\taction", "action=\"${1:addfooter}\"$0"),
("action=\"removeheaderfooter\"\taction", "action=\"${1:removeheaderfooter}\"$0"),
("action=\"optimize\"\taction", "action=\"${1:optimize}\"$0"),
("action=\"transform\"\taction", "action=\"${1:transform}\"$0"),
("ascending\t@ascending", "ascending=\"$1\"$0"),
("ascending=\"true\"\tascending", "ascending=\"${1:true}\"$0"),
("ascending=\"false\"\tascending", "ascending=\"${1:false}\"$0"),
("copyfrom\t@copyfrom", "copyfrom=\"$1\"$0"),
("destination\t@destination", "destination=\"$1\"$0"),
("directory\t@directory", "directory=\"$1\"$0"),
("encrypt\t@encrypt", "encrypt=\"$1\"$0"),
("encrypt=\"RC4_40\"\tencrypt", "encrypt=\"${1:RC4_40}\"$0"),
("encrypt=\"RC4_128\"\tencrypt", "encrypt=\"${1:RC4_128}\"$0"),
("encrypt=\"RC4_128M\"\tencrypt", "encrypt=\"${1:RC4_128M}\"$0"),
("encrypt=\"AES_128\"\tencrypt", "encrypt=\"${1:AES_128}\"$0"),
("encrypt=\"none\"\tencrypt", "encrypt=\"${1:none}\"$0"),
("flatten\t@flatten", "flatten=\"$1\"$0"),
("flatten=\"true\"\tflatten", "flatten=\"${1:true}\"$0"),
("flatten=\"false\"\tflatten", "flatten=\"${1:false}\"$0"),
("foreground\t@foreground", "foreground=\"$1\"$0"),
("foreground=\"true\"\tforeground", "foreground=\"${1:true}\"$0"),
("foreground=\"false\"\tforeground", "foreground=\"${1:false}\"$0"),
("image\t@image", "image=\"$1\"$0"),
("info\t@info", "info=\"$1\"$0"),
("isBase64\t@isBase64", "isBase64=\"$1\"$0"),
("isBase64=\"true\"\tisBase64", "isBase64=\"${1:true}\"$0"),
("isBase64=\"false\"\tisBase64", "isBase64=\"${1:false}\"$0"),
("keepbookmark\t@keepbookmark", "keepbookmark=\"$1\"$0"),
("keepbookmark=\"true\"\tkeepbookmark", "keepbookmark=\"${1:true}\"$0"),
("keepbookmark=\"false\"\tkeepbookmark", "keepbookmark=\"${1:false}\"$0"),
("name\t@name", "name=\"$1\"$0"),
("newOwnerPassword\t@newOwnerPassword", "newOwnerPassword=\"$1\"$0"),
("newUserPassword\t@newUserPassword", "newUserPassword=\"$1\"$0"),
("opacity\t@opacity", "opacity=\"$1\"$0"),
("order\t@order", "order=\"$1\"$0"),
("order=\"name\"\torder", "order=\"${1:name}\"$0"),
("order=\"time\"\torder", "order=\"${1:time}\"$0"),
("overwrite\t@overwrite", "overwrite=\"$1\"$0"),
("overwrite=\"yes\"\toverwrite", "overwrite=\"${1:yes}\"$0"),
("overwrite=\"no\"\toverwrite", "overwrite=\"${1:no}\"$0"),
("password\t@password", "password=\"$1\"$0"),
("permissions\t@permissions", "permissions=\"$1\"$0"),
("permissions=\"all\"\tpermissions", "permissions=\"${1:all}\"$0"),
("permissions=\"allowassembly\"\tpermissions", "permissions=\"${1:allowassembly}\"$0"),
("permissions=\"allowcopy\"\tpermissions", "permissions=\"${1:allowcopy}\"$0"),
("permissions=\"AllowDegradedPrinting\"\tpermissions", "permissions=\"${1:AllowDegradedPrinting}\"$0"),
("permissions=\"AllowFillIn\"\tpermissions", "permissions=\"${1:AllowFillIn}\"$0"),
("permissions=\"AllowModifyAnnotations\"\tpermissions", "permissions=\"${1:AllowModifyAnnotations}\"$0"),
("permissions=\"AllowModifyContents\"\tpermissions", "permissions=\"${1:AllowModifyContents}\"$0"),
("permissions=\"AllowPrinting\"\tpermissions", "permissions=\"${1:AllowPrinting}\"$0"),
("permissions=\"AllowScreenReaders\"\tpermissions", "permissions=\"${1:AllowScreenReaders}\"$0"),
("permissions=\"AllowSecure\"\tpermissions", "permissions=\"${1:AllowSecure}\"$0"),
("permissions=\"none\"\tpermissions", "permissions=\"${1:none}\"$0"),
("position\t@position", "position=\"$1\"$0"),
("rotation\t@rotation", "rotation=\"$1\"$0"),
("showonprint\t@showonprint", "showonprint=\"$1\"$0"),
("showonprint=\"yes\"\tshowonprint", "showonprint=\"${1:yes}\"$0"),
("showonprint=\"no\"\tshowonprint", "showonprint=\"${1:no}\"$0"),
("source\t@source", "source=\"$1\"$0"),
("type\t@type", "type=\"$1\"$0"),
("type=\"string\"\ttype", "type=\"${1:string}\"$0"),
("type=\"xml\"\ttype", "type=\"${1:xml}\"$0"),
("version\t@version", "version=\"$1\"$0"),
("version=\"1.1\"\tversion", "version=\"${1:1.1}\"$0"),
("version=\"1.2\"\tversion", "version=\"${1:1.2}\"$0"),
("version=\"1.3\"\tversion", "version=\"${1:1.3}\"$0"),
("version=\"1.4\"\tversion", "version=\"${1:1.4}\"$0"),
("version=\"1.5\"\tversion", "version=\"${1:1.5}\"$0"),
("version=\"1.6\"\tversion", "version=\"${1:1.6}\"$0"),
("transparent\t@transparent", "transparent=\"$1\"$0"),
("transparent=\"true\"\ttransparent", "transparent=\"${1:true}\"$0"),
("transparent=\"false\"\ttransparent", "transparent=\"${1:false}\"$0"),
("resolution\t@resolution", "resolution=\"$1\"$0"),
("stoponerror\t@stoponerror", "stoponerror=\"$1\"$0"),
("stoponerror=\"true\"\tstoponerror", "stoponerror=\"${1:true}\"$0"),
("stoponerror=\"false\"\tstoponerror", "stoponerror=\"${1:false}\"$0"),
("inputfiles\t@inputfiles", "inputfiles=\"$1\"$0"),
("scale\t@scale", "scale=\"$1\"$0"),
("imageprefix\t@imageprefix", "imageprefix=\"$1\"$0"),
("outputfiles\t@outputfiles", "outputfiles=\"$1\"$0"),
("pages\t@pages", "pages=\"$1\"$0"),
("ddxfile\t@ddxfile", "ddxfile=\"$1\"$0"),
("saveoption\t@saveoption", "saveoption=\"$1\"$0"),
("saveoption=\"full\"\tsaveoption", "saveoption=\"${1:full}\"$0"),
("saveoption=\"incremental\"\tsaveoption", "saveoption=\"${1:incremental}\"$0"),
("saveoption=\"linear\"\tsaveoption", "saveoption=\"${1:linear}\"$0"),
("format\t@format", "format=\"$1\"$0"),
("format=\"jpg\"\tformat", "format=\"${1:jpg}\"$0"),
("format=\"tiff\"\tformat", "format=\"${1:tiff}\"$0"),
("format=\"png\"\tformat", "format=\"${1:png}\"$0"),
("hires\t@hires", "hires=\"$1\"$0"),
("hires=\"true\"\thires", "hires=\"${1:true}\"$0"),
("hires=\"false\"\thires", "hires=\"${1:false}\"$0"),
("maxScale\t@maxScale", "maxScale=\"$1\"$0"),
("maxBreadth\t@maxBreadth", "maxBreadth=\"$1\"$0"),
("maxLength\t@maxLength", "maxLength=\"$1\"$0"),
("compressTIFFs\t@compressTIFFs", "compressTIFFs=\"$1\"$0"),
("compressTIFFs=\"true\"\tcompressTIFFs", "compressTIFFs=\"${1:true}\"$0"),
("compressTIFFs=\"false\"\tcompressTIFFs", "compressTIFFs=\"${1:false}\"$0"),
("overridepage\t@overridepage", "overridepage=\"$1\"$0"),
("overridepage=\"true\"\toverridepage", "overridepage=\"${1:true}\"$0"),
("overridepage=\"false\"\toverridepage", "overridepage=\"${1:false}\"$0"),
("package\t@package", "package=\"$1\"$0"),
("package=\"true\"\tpackage", "package=\"${1:true}\"$0"),
("package=\"false\"\tpackage", "package=\"${1:false}\"$0"),
("hScale\t@hScale", "hScale=\"$1\"$0"),
("vScale\t@vScale", "vScale=\"$1\"$0"),
("noBookMarks\t@noBookMarks", "noBookMarks=\"$1\"$0"),
("noBookMarks=\"true\"\tnoBookMarks", "noBookMarks=\"${1:true}\"$0"),
("noBookMarks=\"false\"\tnoBookMarks", "noBookMarks=\"${1:false}\"$0"),
("noAttachments\t@noAttachments", "noAttachments=\"$1\"$0"),
("noAttachments=\"true\"\tnoAttachments", "noAttachments=\"${1:true}\"$0"),
("noAttachments=\"false\"\tnoAttachments", "noAttachments=\"${1:false}\"$0"),
("noComments\t@noComments", "noComments=\"$1\"$0"),
("noComments=\"true\"\tnoComments", "noComments=\"${1:true}\"$0"),
("noComments=\"false\"\tnoComments", "noComments=\"${1:false}\"$0"),
("noJavaScripts\t@noJavaScripts", "noJavaScripts=\"$1\"$0"),
("noJavaScripts=\"true\"\tnoJavaScripts", "noJavaScripts=\"${1:true}\"$0"),
("noJavaScripts=\"false\"\tnoJavaScripts", "noJavaScripts=\"${1:false}\"$0"),
("noLinks\t@noLinks", "noLinks=\"$1\"$0"),
("noLinks=\"true\"\tnoLinks", "noLinks=\"${1:true}\"$0"),
("noLinks=\"false\"\tnoLinks", "noLinks=\"${1:false}\"$0"),
("noMetadata\t@noMetadata", "noMetadata=\"$1\"$0"),
("noMetadata=\"true\"\tnoMetadata", "noMetadata=\"${1:true}\"$0"),
("noMetadata=\"false\"\tnoMetadata", "noMetadata=\"${1:false}\"$0"),
("noThumbnails\t@noThumbnails", "noThumbnails=\"$1\"$0"),
("noThumbnails=\"true\"\tnoThumbnails", "noThumbnails=\"${1:true}\"$0"),
("noThumbnails=\"false\"\tnoThumbnails", "noThumbnails=\"${1:false}\"$0"),
("noFonts\t@noFonts", "noFonts=\"$1\"$0"),
("noFonts=\"true\"\tnoFonts", "noFonts=\"${1:true}\"$0"),
("noFonts=\"false\"\tnoFonts", "noFonts=\"${1:false}\"$0"),
("algo\t@algo", "algo=\"$1\"$0"),
("algo=\"Bicubic\"\talgo", "algo=\"${1:Bicubic}\"$0"),
("algo=\"Bilinear\"\talgo", "algo=\"${1:Bilinear}\"$0"),
("algo=\"Nearest_Neighbour\"\talgo", "algo=\"${1:Nearest_Neighbour}\"$0"),
("topMargin\t@topMargin", "topMargin=\"$1\"$0"),
("leftMargin\t@leftMargin", "leftMargin=\"$1\"$0"),
("rightMargin\t@rightMargin", "rightMargin=\"$1\"$0"),
("bottomMargin\t@bottomMargin", "bottomMargin=\"$1\"$0"),
("numberFormat\t@numberFormat", "numberFormat=\"$1\"$0"),
("numberFormat=\"NUMERIC\"\tnumberFormat", "numberFormat=\"${1:NUMERIC}\"$0"),
("numberFormat=\"LOWERCASEROMAN\"\tnumberFormat", "numberFormat=\"${1:LOWERCASEROMAN}\"$0"),
("numberFormat=\"UPPERCASEROMAN\"\tnumberFormat", "numberFormat=\"${1:UPPERCASEROMAN}\"$0"),
("align\t@align", "align=\"$1\"$0"),
("align=\"right\"\talign", "align=\"${1:right}\"$0"),
("align=\"left\"\talign", "align=\"${1:left}\"$0"),
("align=\"center\"\talign", "align=\"${1:center}\"$0"),
("honourspaces\t@honourspaces", "honourspaces=\"$1\"$0"),
("honourspaces=\"true\"\thonourspaces", "honourspaces=\"${1:true}\"$0"),
("honourspaces=\"false\"\thonourspaces", "honourspaces=\"${1:false}\"$0"),
("addQuads\t@addQuads", "addQuads=\"$1\"$0"),
("addQuads=\"true\"\taddQuads", "addQuads=\"${1:true}\"$0"),
("addQuads=\"false\"\taddQuads", "addQuads=\"${1:false}\"$0"),
("text\t@text", "text=\"$1\"$0"),
("text=\"_PAGELABEL\"\ttext", "text=\"${1:_PAGELABEL}\"$0"),
("text=\"_LASTPAGELABEL\"\ttext", "text=\"${1:_LASTPAGELABEL}\"$0"),
("text=\"_PAGENUMBER\"\ttext", "text=\"${1:_PAGENUMBER}\"$0"),
("text=\"_LASTPAGENUMBER\"\ttext", "text=\"${1:_LASTPAGENUMBER}\"$0"),
("useStructure\t@useStructure", "useStructure=\"$1\"$0"),
("useStructure=\"true\"\tuseStructure", "useStructure=\"${1:true}\"$0"),
("useStructure=\"false\"\tuseStructure", "useStructure=\"${1:false}\"$0"),
("jpgdpi\t@jpgdpi", "jpgdpi=\"$1\"$0"),
("encodeAll\t@encodeAll", "encodeAll=\"$1\"$0"),
("encodeAll=\"true\"\tencodeAll", "encodeAll=\"${1:true}\"$0"),
("encodeAll=\"false\"\tencodeAll", "encodeAll=\"${1:false}\"$0")
],
'attributes': [
"package",
"overwrite",
"noBookMarks",
"order",
"isBase64",
"source",
"version",
"newUserPassword",
"ascending",
"action",
"position",
"type",
"maxScale",
"vScale",
"name",
"maxBreadth",
"image",
"stoponerror",
"saveoption",
"noJavaScripts",
"compressTIFFs",
"align",
"noThumbnails",
"pages",
"useStructure",
"topMargin",
"numberFormat",
"imageprefix",
"noLinks",
"overridepage",
"destination",
"noFonts",
"honourspaces",
"rotation",
"resolution",
"encodeAll",
"leftMargin",
"jpgdpi",
"text",
"rightMargin",
"showonprint",
"password",
"info",
"hires",
"scale",
"noAttachments",
"algo",
"permissions",
"outputfiles",
"encrypt",
"keepbookmark",
"noMetadata",
"ddxfile",
"hScale",
"flatten",
"copyfrom",
"bottomMargin",
"maxLength",
"opacity",
"directory",
"transparent",
"format",
"addQuads",
"newOwnerPassword",
"inputfiles",
"foreground",
"noComments"
]
}
self.completions['cfpdfform'] = {
'completions': [
("action\t@action", "action=\"$1\"$0"),
("action=\"populate\"\taction", "action=\"${1:populate}\"$0"),
("action=\"read\"\taction", "action=\"${1:read}\"$0"),
("datafile\t@datafile", "datafile=\"$1\"$0"),
("destination\t@destination", "destination=\"$1\"$0"),
("overwrite\t@overwrite", "overwrite=\"$1\"$0"),
("overwrite=\"true\"\toverwrite", "overwrite=\"${1:true}\"$0"),
("overwrite=\"false\"\toverwrite", "overwrite=\"${1:false}\"$0"),
("overwritedata\t@overwritedata", "overwritedata=\"$1\"$0"),
("overwritedata=\"true\"\toverwritedata", "overwritedata=\"${1:true}\"$0"),
("overwritedata=\"false\"\toverwritedata", "overwritedata=\"${1:false}\"$0"),
("result\t@result", "result=\"$1\"$0"),
("source\t@source", "source=\"$1\"$0"),
("xmldata\t@xmldata", "xmldata=\"$1\"$0"),
("xmldata=\"true\"\txmldata", "xmldata=\"${1:true}\"$0"),
("xmldata=\"false\"\txmldata", "xmldata=\"${1:false}\"$0"),
("name\t@name", "name=\"$1\"$0"),
("fdf\t@fdf", "fdf=\"$1\"$0"),
("fdf=\"true\"\tfdf", "fdf=\"${1:true}\"$0"),
("fdf=\"false\"\tfdf", "fdf=\"${1:false}\"$0"),
("fdfData\t@fdfData", "fdfData=\"$1\"$0")
],
'attributes': [
"fdfData",
"source",
"fdf",
"name",
"result",
"overwrite",
"destination",
"xmldata",
"action",
"overwritedata",
"datafile"
]
}
self.completions['cfpdfformparam'] = {
'completions': [
("index\t@index", "index=\"$1\"$0"),
("name\t@name", "name=\"$1\"$0"),
("value\t@value", "value=\"$1\"$0")
],
'attributes': [
"index",
"value",
"name"
]
}
self.completions['cfpresentationslide'] = {
'completions': [
("audio\t@audio", "audio=\"$1\"$0"),
("bottomMargin\t@bottomMargin", "bottomMargin=\"$1\"$0"),
("duration\t@duration", "duration=\"$1\"$0"),
("notes\t@notes", "notes=\"$1\"$0"),
("presenter\t@presenter", "presenter=\"$1\"$0"),
("rightMargin\t@rightMargin", "rightMargin=\"$1\"$0"),
("scale\t@scale", "scale=\"$1\"$0"),
("src\t@src", "src=\"$1\"$0"),
("title\t@title", "title=\"$1\"$0"),
("topMargin\t@topMargin", "topMargin=\"$1\"$0"),
("video\t@video", "video=\"$1\"$0"),
("advance\t@advance", "advance=\"$1\"$0"),
("advance=\"auto\"\tadvance", "advance=\"${1:auto}\"$0"),
("advance=\"never\"\tadvance", "advance=\"${1:never}\"$0"),
("advance=\"click\"\tadvance", "advance=\"${1:click}\"$0"),
("authpassword\t@authpassword", "authpassword=\"$1\"$0"),
("authuser\t@authuser", "authuser=\"$1\"$0"),
("marginbottom\t@marginbottom", "marginbottom=\"$1\"$0"),
("marginleft\t@marginleft", "marginleft=\"$1\"$0"),
("marginright\t@marginright", "marginright=\"$1\"$0"),
("margintop\t@margintop", "margintop=\"$1\"$0"),
("useragent\t@useragent", "useragent=\"$1\"$0"),
("slides\t@slides", "slides=\"$1\"$0")
],
'attributes': [
"useragent",
"scale",
"advance",
"audio",
"video",
"marginright",
"src",
"authuser",
"presenter",
"bottomMargin",
"marginbottom",
"slides",
"margintop",
"marginleft",
"rightMargin",
"authpassword",
"topMargin",
"duration",
"notes",
"title"
]
}
self.completions['cfmediaplayer'] = {
'completions': [
("width\t@width", "width=\"$1\"$0"),
("height\t@height", "height=\"$1\"$0"),
("fullscreencontrol\t@fullscreencontrol", "fullscreencontrol=\"$1\"$0"),
("fullscreencontrol=\"true\"\tfullscreencontrol", "fullscreencontrol=\"${1:true}\"$0"),
("fullscreencontrol=\"false\"\tfullscreencontrol", "fullscreencontrol=\"${1:false}\"$0"),
("hideBorder\t@hideBorder", "hideBorder=\"$1\"$0"),
("hideBorder=\"true\"\thideBorder", "hideBorder=\"${1:true}\"$0"),
("hideBorder=\"false\"\thideBorder", "hideBorder=\"${1:false}\"$0"),
("controlbar\t@controlbar", "controlbar=\"$1\"$0"),
("controlbar=\"true\"\tcontrolbar", "controlbar=\"${1:true}\"$0"),
("controlbar=\"false\"\tcontrolbar", "controlbar=\"${1:false}\"$0"),
("align\t@align", "align=\"$1\"$0"),
("align=\"left\"\talign", "align=\"${1:left}\"$0"),
("align=\"right\"\talign", "align=\"${1:right}\"$0"),
("align=\"center\"\talign", "align=\"${1:center}\"$0"),
("onload\t@onload", "onload=\"$1\"$0"),
("bgcolor\t@bgcolor", "bgcolor=\"$1\"$0"),
("source\t@source", "source=\"$1\"$0"),
("name\t@name", "name=\"$1\"$0"),
("quality\t@quality", "quality=\"$1\"$0"),
("quality=\"high\"\tquality", "quality=\"${1:high}\"$0"),
("quality=\"medium\"\tquality", "quality=\"${1:medium}\"$0"),
("quality=\"low\"\tquality", "quality=\"${1:low}\"$0"),
("hideTitle\t@hideTitle", "hideTitle=\"$1\"$0"),
("hideTitle=\"true\"\thideTitle", "hideTitle=\"${1:true}\"$0"),
("hideTitle=\"false\"\thideTitle", "hideTitle=\"${1:false}\"$0"),
("oncomplete\t@oncomplete", "oncomplete=\"$1\"$0"),
("onstart\t@onstart", "onstart=\"$1\"$0"),
("wmode\t@wmode", "wmode=\"$1\"$0"),
("wmode=\"opaque\"\twmode", "wmode=\"${1:opaque}\"$0"),
("wmode=\"transparent\"\twmode", "wmode=\"${1:transparent}\"$0"),
("wmode=\"window\"\twmode", "wmode=\"${1:window}\"$0"),
("autoPlay\t@autoPlay", "autoPlay=\"$1\"$0"),
("autoPlay=\"true\"\tautoPlay", "autoPlay=\"${1:true}\"$0"),
("autoPlay=\"false\"\tautoPlay", "autoPlay=\"${1:false}\"$0"),
("style\t@style", "style=\"$1\"$0")
],
'attributes': [
"bgcolor",
"oncomplete",
"quality",
"name",
"hideTitle",
"hideBorder",
"onload",
"height",
"onstart",
"controlbar",
"width",
"style",
"source",
"align",
"autoPlay",
"wmode",
"fullscreencontrol"
]
}
self.completions['cfmapitem'] = {
'completions': [
("longitude\t@longitude", "longitude=\"$1\"$0"),
("address\t@address", "address=\"$1\"$0"),
("tip\t@tip", "tip=\"$1\"$0"),
("latitude\t@latitude", "latitude=\"$1\"$0"),
("name\t@name", "name=\"$1\"$0"),
("showMarkerWindow\t@showMarkerWindow", "showMarkerWindow=\"$1\"$0"),
("showMarkerWindow=\"true\"\tshowMarkerWindow", "showMarkerWindow=\"${1:true}\"$0"),
("showMarkerWindow=\"false\"\tshowMarkerWindow", "showMarkerWindow=\"${1:false}\"$0"),
("markerWindowContent\t@markerWindowContent", "markerWindowContent=\"$1\"$0"),
("markerIcon\t@markerIcon", "markerIcon=\"$1\"$0"),
("markerColor\t@markerColor", "markerColor=\"$1\"$0")
],
'attributes': [
"tip",
"name",
"showMarkerWindow",
"markerIcon",
"address",
"longitude",
"markerColor",
"latitude",
"markerWindowContent"
]
}
self.completions['cfmap'] = {
'completions': [
("width\t@width", "width=\"$1\"$0"),
("centerlongitude\t@centerlongitude", "centerlongitude=\"$1\"$0"),
("centeraddress\t@centeraddress", "centeraddress=\"$1\"$0"),
("continuouszoom\t@continuouszoom", "continuouszoom=\"$1\"$0"),
("continuouszoom=\"true\"\tcontinuouszoom", "continuouszoom=\"${1:true}\"$0"),
("continuouszoom=\"false\"\tcontinuouszoom", "continuouszoom=\"${1:false}\"$0"),
("type\t@type", "type=\"$1\"$0"),
("type=\"map\"\ttype", "type=\"${1:map}\"$0"),
("type=\"satellite\"\ttype", "type=\"${1:satellite}\"$0"),
("type=\"hybrid\"\ttype", "type=\"${1:hybrid}\"$0"),
("type=\"earth\"\ttype", "type=\"${1:earth}\"$0"),
("type=\"terrain\"\ttype", "type=\"${1:terrain}\"$0"),
("title\t@title", "title=\"$1\"$0"),
("zoomcontrol\t@zoomcontrol", "zoomcontrol=\"$1\"$0"),
("zoomcontrol=\"none\"\tzoomcontrol", "zoomcontrol=\"${1:none}\"$0"),
("zoomcontrol=\"small\"\tzoomcontrol", "zoomcontrol=\"${1:small}\"$0"),
("zoomcontrol=\"large\"\tzoomcontrol", "zoomcontrol=\"${1:large}\"$0"),
("zoomcontrol=\"small3D\"\tzoomcontrol", "zoomcontrol=\"${1:small3D}\"$0"),
("zoomcontrol=\"large3D\"\tzoomcontrol", "zoomcontrol=\"${1:large3D}\"$0"),
("tip\t@tip", "tip=\"$1\"$0"),
("tip=\"true\"\ttip", "tip=\"${1:true}\"$0"),
("tip=\"false\"\ttip", "tip=\"${1:false}\"$0"),
("overview\t@overview", "overview=\"$1\"$0"),
("overview=\"true\"\toverview", "overview=\"${1:true}\"$0"),
("overview=\"false\"\toverview", "overview=\"${1:false}\"$0"),
("hideborder\t@hideborder", "hideborder=\"$1\"$0"),
("hideborder=\"true\"\thideborder", "hideborder=\"${1:true}\"$0"),
("hideborder=\"false\"\thideborder", "hideborder=\"${1:false}\"$0"),
("doubleclickzoom\t@doubleclickzoom", "doubleclickzoom=\"$1\"$0"),
("doubleclickzoom=\"true\"\tdoubleclickzoom", "doubleclickzoom=\"${1:true}\"$0"),
("doubleclickzoom=\"false\"\tdoubleclickzoom", "doubleclickzoom=\"${1:false}\"$0"),
("key\t@key", "key=\"$1\"$0"),
("collapsible\t@collapsible", "collapsible=\"$1\"$0"),
("collapsible=\"true\"\tcollapsible", "collapsible=\"${1:true}\"$0"),
("collapsible=\"false\"\tcollapsible", "collapsible=\"${1:false}\"$0"),
("zoomlevel\t@zoomlevel", "zoomlevel=\"$1\"$0"),
("height\t@height", "height=\"$1\"$0"),
("centerlatitude\t@centerlatitude", "centerlatitude=\"$1\"$0"),
("onload\t@onload", "onload=\"$1\"$0"),
("typecontrol\t@typecontrol", "typecontrol=\"$1\"$0"),
("typecontrol=\"none\"\ttypecontrol", "typecontrol=\"${1:none}\"$0"),
("typecontrol=\"basic\"\ttypecontrol", "typecontrol=\"${1:basic}\"$0"),
("typecontrol=\"advanced\"\ttypecontrol", "typecontrol=\"${1:advanced}\"$0"),
("displayscale\t@displayscale", "displayscale=\"$1\"$0"),
("displayscale=\"true\"\tdisplayscale", "displayscale=\"${1:true}\"$0"),
("displayscale=\"false\"\tdisplayscale", "displayscale=\"${1:false}\"$0"),
("name\t@name", "name=\"$1\"$0"),
("scrollwheelzoom\t@scrollwheelzoom", "scrollwheelzoom=\"$1\"$0"),
("scrollwheelzoom=\"true\"\tscrollwheelzoom", "scrollwheelzoom=\"${1:true}\"$0"),
("scrollwheelzoom=\"false\"\tscrollwheelzoom", "scrollwheelzoom=\"${1:false}\"$0"),
("markerBind\t@markerBind", "markerBind=\"$1\"$0"),
("showMarkerWindow\t@showMarkerWindow", "showMarkerWindow=\"$1\"$0"),
("showMarkerWindow=\"true\"\tshowMarkerWindow", "showMarkerWindow=\"${1:true}\"$0"),
("showMarkerWindow=\"false\"\tshowMarkerWindow", "showMarkerWindow=\"${1:false}\"$0"),
("markerWindowContent\t@markerWindowContent", "markerWindowContent=\"$1\"$0"),
("markerIcon\t@markerIcon", "markerIcon=\"$1\"$0"),
("markerColor\t@markerColor", "markerColor=\"$1\"$0"),
("onError\t@onError", "onError=\"$1\"$0"),
("showCenterMarker\t@showCenterMarker", "showCenterMarker=\"$1\"$0"),
("showCenterMarker=\"true\"\tshowCenterMarker", "showCenterMarker=\"${1:true}\"$0"),
("showCenterMarker=\"false\"\tshowCenterMarker", "showCenterMarker=\"${1:false}\"$0"),
("showScale\t@showScale", "showScale=\"$1\"$0"),
("showScale=\"true\"\tshowScale", "showScale=\"${1:true}\"$0"),
("showScale=\"false\"\tshowScale", "showScale=\"${1:false}\"$0"),
("initshow\t@initshow", "initshow=\"$1\"$0"),
("initshow=\"true\"\tinitshow", "initshow=\"${1:true}\"$0"),
("initshow=\"false\"\tinitshow", "initshow=\"${1:false}\"$0")
],
'attributes': [
"displayscale",
"centeraddress",
"markerIcon",
"height",
"key",
"scrollwheelzoom",
"markerWindowContent",
"centerlongitude",
"continuouszoom",
"zoomcontrol",
"centerlatitude",
"zoomlevel",
"onError",
"markerColor",
"type",
"tip",
"name",
"overview",
"hideborder",
"onload",
"initshow",
"doubleclickzoom",
"width",
"showScale",
"typecontrol",
"markerBind",
"showMarkerWindow",
"collapsible",
"showCenterMarker",
"title"
]
}
del self.completions['cfwebsocket'] | [
"def",
"__init__",
"(",
"self",
")",
":",
"super",
"(",
"tags",
",",
"self",
")",
".",
"__init__",
"(",
")",
"self",
".",
"completions",
"[",
"'cfapplication'",
"]",
"=",
"{",
"'completions'",
":",
"[",
"(",
"\"name\\t@name\"",
",",
"\"name=\\\"$1\\\"$0\""... | https://github.com/SublimeText/ColdFusion/blob/dbe2f76038fe77fe90b4cc4a0651aa817f14f1a3/taglib/cf9.py#L3-L2714 | ||||
carbonblack/cbapi-python | 24d677ffd99aee911c2c76ecb5528e4e9320c7cc | src/cbapi/psc/threathunter/models.py | python | Process._query_implementation | (cls, cb) | return AsyncProcessQuery(cls, cb) | [] | def _query_implementation(cls, cb):
# This will emulate a synchronous process query, for now.
return AsyncProcessQuery(cls, cb) | [
"def",
"_query_implementation",
"(",
"cls",
",",
"cb",
")",
":",
"# This will emulate a synchronous process query, for now.",
"return",
"AsyncProcessQuery",
"(",
"cls",
",",
"cb",
")"
] | https://github.com/carbonblack/cbapi-python/blob/24d677ffd99aee911c2c76ecb5528e4e9320c7cc/src/cbapi/psc/threathunter/models.py#L48-L50 | |||
Azure/azure-devops-cli-extension | 11334cd55806bef0b99c3bee5a438eed71e44037 | azure-devops/azext_devops/devops_sdk/v6_0/build/build_client.py | python | BuildClient.get_artifact | (self, project, build_id, artifact_name) | return self._deserialize('BuildArtifact', response) | GetArtifact.
[Preview API] Gets a specific artifact for a build.
:param str project: Project ID or project name
:param int build_id: The ID of the build.
:param str artifact_name: The name of the artifact.
:rtype: :class:`<BuildArtifact> <azure.devops.v6_0.build.models.BuildArtifact>` | GetArtifact.
[Preview API] Gets a specific artifact for a build.
:param str project: Project ID or project name
:param int build_id: The ID of the build.
:param str artifact_name: The name of the artifact.
:rtype: :class:`<BuildArtifact> <azure.devops.v6_0.build.models.BuildArtifact>` | [
"GetArtifact",
".",
"[",
"Preview",
"API",
"]",
"Gets",
"a",
"specific",
"artifact",
"for",
"a",
"build",
".",
":",
"param",
"str",
"project",
":",
"Project",
"ID",
"or",
"project",
"name",
":",
"param",
"int",
"build_id",
":",
"The",
"ID",
"of",
"the"... | def get_artifact(self, project, build_id, artifact_name):
"""GetArtifact.
[Preview API] Gets a specific artifact for a build.
:param str project: Project ID or project name
:param int build_id: The ID of the build.
:param str artifact_name: The name of the artifact.
:rtype: :class:`<BuildArtifact> <azure.devops.v6_0.build.models.BuildArtifact>`
"""
route_values = {}
if project is not None:
route_values['project'] = self._serialize.url('project', project, 'str')
if build_id is not None:
route_values['buildId'] = self._serialize.url('build_id', build_id, 'int')
query_parameters = {}
if artifact_name is not None:
query_parameters['artifactName'] = self._serialize.query('artifact_name', artifact_name, 'str')
response = self._send(http_method='GET',
location_id='1db06c96-014e-44e1-ac91-90b2d4b3e984',
version='6.0-preview.5',
route_values=route_values,
query_parameters=query_parameters)
return self._deserialize('BuildArtifact', response) | [
"def",
"get_artifact",
"(",
"self",
",",
"project",
",",
"build_id",
",",
"artifact_name",
")",
":",
"route_values",
"=",
"{",
"}",
"if",
"project",
"is",
"not",
"None",
":",
"route_values",
"[",
"'project'",
"]",
"=",
"self",
".",
"_serialize",
".",
"ur... | https://github.com/Azure/azure-devops-cli-extension/blob/11334cd55806bef0b99c3bee5a438eed71e44037/azure-devops/azext_devops/devops_sdk/v6_0/build/build_client.py#L49-L70 | |
tomplus/kubernetes_asyncio | f028cc793e3a2c519be6a52a49fb77ff0b014c9b | kubernetes_asyncio/client/api/policy_v1beta1_api.py | python | PolicyV1beta1Api.delete_collection_namespaced_pod_disruption_budget_with_http_info | (self, namespace, **kwargs) | return self.api_client.call_api(
'/apis/policy/v1beta1/namespaces/{namespace}/poddisruptionbudgets', 'DELETE',
path_params,
query_params,
header_params,
body=body_params,
post_params=form_params,
files=local_var_files,
response_type='V1Status', # noqa: E501
auth_settings=auth_settings,
async_req=local_var_params.get('async_req'),
_return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501
_preload_content=local_var_params.get('_preload_content', True),
_request_timeout=local_var_params.get('_request_timeout'),
collection_formats=collection_formats) | delete_collection_namespaced_pod_disruption_budget # noqa: E501
delete collection of PodDisruptionBudget # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async_req=True
>>> thread = api.delete_collection_namespaced_pod_disruption_budget_with_http_info(namespace, async_req=True)
>>> result = thread.get()
:param async_req bool: execute request asynchronously
:param str namespace: object name and auth scope, such as for teams and projects (required)
:param str pretty: If 'true', then the output is pretty printed.
:param str _continue: The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.
:param str dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed
:param str field_selector: A selector to restrict the list of returned objects by their fields. Defaults to everything.
:param int grace_period_seconds: The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately.
:param str label_selector: A selector to restrict the list of returned objects by their labels. Defaults to everything.
:param int limit: limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.
:param bool orphan_dependents: Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both.
:param str propagation_policy: Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground.
:param str resource_version: resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset
:param str resource_version_match: resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset
:param int timeout_seconds: Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.
:param V1DeleteOptions body:
:param _return_http_data_only: response data without head status code
and headers
:param _preload_content: if False, the urllib3.HTTPResponse object will
be returned without reading/decoding response
data. Default is True.
:param _request_timeout: timeout setting for this request. If one
number provided, it will be total request
timeout. It can also be a pair (tuple) of
(connection, read) timeouts.
:return: tuple(V1Status, status_code(int), headers(HTTPHeaderDict))
If the method is called asynchronously,
returns the request thread. | delete_collection_namespaced_pod_disruption_budget # noqa: E501 | [
"delete_collection_namespaced_pod_disruption_budget",
"#",
"noqa",
":",
"E501"
] | def delete_collection_namespaced_pod_disruption_budget_with_http_info(self, namespace, **kwargs): # noqa: E501
"""delete_collection_namespaced_pod_disruption_budget # noqa: E501
delete collection of PodDisruptionBudget # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async_req=True
>>> thread = api.delete_collection_namespaced_pod_disruption_budget_with_http_info(namespace, async_req=True)
>>> result = thread.get()
:param async_req bool: execute request asynchronously
:param str namespace: object name and auth scope, such as for teams and projects (required)
:param str pretty: If 'true', then the output is pretty printed.
:param str _continue: The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \"next key\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.
:param str dry_run: When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed
:param str field_selector: A selector to restrict the list of returned objects by their fields. Defaults to everything.
:param int grace_period_seconds: The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately.
:param str label_selector: A selector to restrict the list of returned objects by their labels. Defaults to everything.
:param int limit: limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.
:param bool orphan_dependents: Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \"orphan\" finalizer will be added to/removed from the object's finalizers list. Either this field or PropagationPolicy may be set, but not both.
:param str propagation_policy: Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground.
:param str resource_version: resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset
:param str resource_version_match: resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset
:param int timeout_seconds: Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.
:param V1DeleteOptions body:
:param _return_http_data_only: response data without head status code
and headers
:param _preload_content: if False, the urllib3.HTTPResponse object will
be returned without reading/decoding response
data. Default is True.
:param _request_timeout: timeout setting for this request. If one
number provided, it will be total request
timeout. It can also be a pair (tuple) of
(connection, read) timeouts.
:return: tuple(V1Status, status_code(int), headers(HTTPHeaderDict))
If the method is called asynchronously,
returns the request thread.
"""
local_var_params = locals()
all_params = [
'namespace',
'pretty',
'_continue',
'dry_run',
'field_selector',
'grace_period_seconds',
'label_selector',
'limit',
'orphan_dependents',
'propagation_policy',
'resource_version',
'resource_version_match',
'timeout_seconds',
'body'
]
all_params.extend(
[
'async_req',
'_return_http_data_only',
'_preload_content',
'_request_timeout'
]
)
for key, val in six.iteritems(local_var_params['kwargs']):
if key not in all_params:
raise ApiTypeError(
"Got an unexpected keyword argument '%s'"
" to method delete_collection_namespaced_pod_disruption_budget" % key
)
local_var_params[key] = val
del local_var_params['kwargs']
# verify the required parameter 'namespace' is set
if self.api_client.client_side_validation and ('namespace' not in local_var_params or # noqa: E501
local_var_params['namespace'] is None): # noqa: E501
raise ApiValueError("Missing the required parameter `namespace` when calling `delete_collection_namespaced_pod_disruption_budget`") # noqa: E501
collection_formats = {}
path_params = {}
if 'namespace' in local_var_params:
path_params['namespace'] = local_var_params['namespace'] # noqa: E501
query_params = []
if 'pretty' in local_var_params and local_var_params['pretty'] is not None: # noqa: E501
query_params.append(('pretty', local_var_params['pretty'])) # noqa: E501
if '_continue' in local_var_params and local_var_params['_continue'] is not None: # noqa: E501
query_params.append(('continue', local_var_params['_continue'])) # noqa: E501
if 'dry_run' in local_var_params and local_var_params['dry_run'] is not None: # noqa: E501
query_params.append(('dryRun', local_var_params['dry_run'])) # noqa: E501
if 'field_selector' in local_var_params and local_var_params['field_selector'] is not None: # noqa: E501
query_params.append(('fieldSelector', local_var_params['field_selector'])) # noqa: E501
if 'grace_period_seconds' in local_var_params and local_var_params['grace_period_seconds'] is not None: # noqa: E501
query_params.append(('gracePeriodSeconds', local_var_params['grace_period_seconds'])) # noqa: E501
if 'label_selector' in local_var_params and local_var_params['label_selector'] is not None: # noqa: E501
query_params.append(('labelSelector', local_var_params['label_selector'])) # noqa: E501
if 'limit' in local_var_params and local_var_params['limit'] is not None: # noqa: E501
query_params.append(('limit', local_var_params['limit'])) # noqa: E501
if 'orphan_dependents' in local_var_params and local_var_params['orphan_dependents'] is not None: # noqa: E501
query_params.append(('orphanDependents', local_var_params['orphan_dependents'])) # noqa: E501
if 'propagation_policy' in local_var_params and local_var_params['propagation_policy'] is not None: # noqa: E501
query_params.append(('propagationPolicy', local_var_params['propagation_policy'])) # noqa: E501
if 'resource_version' in local_var_params and local_var_params['resource_version'] is not None: # noqa: E501
query_params.append(('resourceVersion', local_var_params['resource_version'])) # noqa: E501
if 'resource_version_match' in local_var_params and local_var_params['resource_version_match'] is not None: # noqa: E501
query_params.append(('resourceVersionMatch', local_var_params['resource_version_match'])) # noqa: E501
if 'timeout_seconds' in local_var_params and local_var_params['timeout_seconds'] is not None: # noqa: E501
query_params.append(('timeoutSeconds', local_var_params['timeout_seconds'])) # noqa: E501
header_params = {}
form_params = []
local_var_files = {}
body_params = None
if 'body' in local_var_params:
body_params = local_var_params['body']
# HTTP header `Accept`
header_params['Accept'] = self.api_client.select_header_accept(
['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf']) # noqa: E501
# Authentication setting
auth_settings = ['BearerToken'] # noqa: E501
return self.api_client.call_api(
'/apis/policy/v1beta1/namespaces/{namespace}/poddisruptionbudgets', 'DELETE',
path_params,
query_params,
header_params,
body=body_params,
post_params=form_params,
files=local_var_files,
response_type='V1Status', # noqa: E501
auth_settings=auth_settings,
async_req=local_var_params.get('async_req'),
_return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501
_preload_content=local_var_params.get('_preload_content', True),
_request_timeout=local_var_params.get('_request_timeout'),
collection_formats=collection_formats) | [
"def",
"delete_collection_namespaced_pod_disruption_budget_with_http_info",
"(",
"self",
",",
"namespace",
",",
"*",
"*",
"kwargs",
")",
":",
"# noqa: E501",
"local_var_params",
"=",
"locals",
"(",
")",
"all_params",
"=",
"[",
"'namespace'",
",",
"'pretty'",
",",
"'... | https://github.com/tomplus/kubernetes_asyncio/blob/f028cc793e3a2c519be6a52a49fb77ff0b014c9b/kubernetes_asyncio/client/api/policy_v1beta1_api.py#L344-L483 | |
JaniceWuo/MovieRecommend | 4c86db64ca45598917d304f535413df3bc9fea65 | movierecommend/venv1/Lib/site-packages/django/contrib/sessions/backends/base.py | python | SessionBase.decode | (self, session_data) | [] | def decode(self, session_data):
encoded_data = base64.b64decode(force_bytes(session_data))
try:
# could produce ValueError if there is no ':'
hash, serialized = encoded_data.split(b':', 1)
expected_hash = self._hash(serialized)
if not constant_time_compare(hash.decode(), expected_hash):
raise SuspiciousSession("Session data corrupted")
else:
return self.serializer().loads(serialized)
except Exception as e:
# ValueError, SuspiciousOperation, unpickling exceptions. If any of
# these happen, just return an empty dictionary (an empty session).
if isinstance(e, SuspiciousOperation):
logger = logging.getLogger('django.security.%s' % e.__class__.__name__)
logger.warning(force_text(e))
return {} | [
"def",
"decode",
"(",
"self",
",",
"session_data",
")",
":",
"encoded_data",
"=",
"base64",
".",
"b64decode",
"(",
"force_bytes",
"(",
"session_data",
")",
")",
"try",
":",
"# could produce ValueError if there is no ':'",
"hash",
",",
"serialized",
"=",
"encoded_d... | https://github.com/JaniceWuo/MovieRecommend/blob/4c86db64ca45598917d304f535413df3bc9fea65/movierecommend/venv1/Lib/site-packages/django/contrib/sessions/backends/base.py#L102-L118 | ||||
theotherp/nzbhydra | 4b03d7f769384b97dfc60dade4806c0fc987514e | libs/site.py | python | setquit | () | Define new builtins 'quit' and 'exit'.
These are objects which make the interpreter exit when called.
The repr of each object contains a hint at how it works. | Define new builtins 'quit' and 'exit'. | [
"Define",
"new",
"builtins",
"quit",
"and",
"exit",
"."
] | def setquit():
"""Define new builtins 'quit' and 'exit'.
These are objects which make the interpreter exit when called.
The repr of each object contains a hint at how it works.
"""
if os.sep == ':':
eof = 'Cmd-Q'
elif os.sep == '\\':
eof = 'Ctrl-Z plus Return'
else:
eof = 'Ctrl-D (i.e. EOF)'
class Quitter(object):
def __init__(self, name):
self.name = name
def __repr__(self):
return 'Use %s() or %s to exit' % (self.name, eof)
def __call__(self, code=None):
# Shells like IDLE catch the SystemExit, but listen when their
# stdin wrapper is closed.
try:
sys.stdin.close()
except:
pass
raise SystemExit(code)
__builtin__.quit = Quitter('quit')
__builtin__.exit = Quitter('exit') | [
"def",
"setquit",
"(",
")",
":",
"if",
"os",
".",
"sep",
"==",
"':'",
":",
"eof",
"=",
"'Cmd-Q'",
"elif",
"os",
".",
"sep",
"==",
"'\\\\'",
":",
"eof",
"=",
"'Ctrl-Z plus Return'",
"else",
":",
"eof",
"=",
"'Ctrl-D (i.e. EOF)'",
"class",
"Quitter",
"("... | https://github.com/theotherp/nzbhydra/blob/4b03d7f769384b97dfc60dade4806c0fc987514e/libs/site.py#L334-L362 | ||
mozilla/PyPOM | 9cb84df9d27b428b4e7423d1bbe6502e92990154 | src/pypom/view.py | python | WebView.selenium | (self) | return self.driver | Backwards compatibility attribute | Backwards compatibility attribute | [
"Backwards",
"compatibility",
"attribute"
] | def selenium(self):
"""Backwards compatibility attribute"""
warn("use driver instead", DeprecationWarning, stacklevel=2)
return self.driver | [
"def",
"selenium",
"(",
"self",
")",
":",
"warn",
"(",
"\"use driver instead\"",
",",
"DeprecationWarning",
",",
"stacklevel",
"=",
"2",
")",
"return",
"self",
".",
"driver"
] | https://github.com/mozilla/PyPOM/blob/9cb84df9d27b428b4e7423d1bbe6502e92990154/src/pypom/view.py#L28-L31 | |
JinpengLI/deep_ocr | 450148c0c51b3565a96ac2f3c94ee33022e55307 | deep_ocr/ocrolib/common.py | python | glob_all | (args) | return result | Given a list of command line arguments, expand all of them with glob. | Given a list of command line arguments, expand all of them with glob. | [
"Given",
"a",
"list",
"of",
"command",
"line",
"arguments",
"expand",
"all",
"of",
"them",
"with",
"glob",
"."
] | def glob_all(args):
"""Given a list of command line arguments, expand all of them with glob."""
result = []
for arg in args:
if arg[0]=="@":
with open(arg[1:],"r") as stream:
expanded = stream.read().split("\n")
expanded = [s for s in expanded if s!=""]
else:
expanded = sorted(glob.glob(arg))
if len(expanded)<1:
raise FileNotFound("%s: expansion did not yield any files"%arg)
result += expanded
return result | [
"def",
"glob_all",
"(",
"args",
")",
":",
"result",
"=",
"[",
"]",
"for",
"arg",
"in",
"args",
":",
"if",
"arg",
"[",
"0",
"]",
"==",
"\"@\"",
":",
"with",
"open",
"(",
"arg",
"[",
"1",
":",
"]",
",",
"\"r\"",
")",
"as",
"stream",
":",
"expan... | https://github.com/JinpengLI/deep_ocr/blob/450148c0c51b3565a96ac2f3c94ee33022e55307/deep_ocr/ocrolib/common.py#L562-L575 | |
seleniumbase/SeleniumBase | 0d1de7238bfafe4b7309fec6f735dcd0dc4538a8 | seleniumbase/fixtures/base_case.py | python | BaseCase.deferred_assert_exact_text | (
self, text, selector="html", by=By.CSS_SELECTOR, timeout=None
) | A non-terminating assertion for exact text from an element.
Failures will be saved until the process_deferred_asserts()
method is called from inside a test, likely at the end of it. | A non-terminating assertion for exact text from an element.
Failures will be saved until the process_deferred_asserts()
method is called from inside a test, likely at the end of it. | [
"A",
"non",
"-",
"terminating",
"assertion",
"for",
"exact",
"text",
"from",
"an",
"element",
".",
"Failures",
"will",
"be",
"saved",
"until",
"the",
"process_deferred_asserts",
"()",
"method",
"is",
"called",
"from",
"inside",
"a",
"test",
"likely",
"at",
"... | def deferred_assert_exact_text(
self, text, selector="html", by=By.CSS_SELECTOR, timeout=None
):
"""A non-terminating assertion for exact text from an element.
Failures will be saved until the process_deferred_asserts()
method is called from inside a test, likely at the end of it."""
self.__check_scope()
if not timeout:
timeout = settings.MINI_TIMEOUT
if self.timeout_multiplier and timeout == settings.MINI_TIMEOUT:
timeout = self.__get_new_timeout(timeout)
self.__deferred_assert_count += 1
try:
url = self.get_current_url()
if url == self.__last_url_of_deferred_assert:
timeout = 1 # Was already on page (full wait not needed)
else:
self.__last_url_of_deferred_assert = url
except Exception:
pass
try:
self.wait_for_exact_text_visible(
text, selector, by=by, timeout=timeout
)
return True
except Exception:
self.__add_deferred_assert_failure()
return False | [
"def",
"deferred_assert_exact_text",
"(",
"self",
",",
"text",
",",
"selector",
"=",
"\"html\"",
",",
"by",
"=",
"By",
".",
"CSS_SELECTOR",
",",
"timeout",
"=",
"None",
")",
":",
"self",
".",
"__check_scope",
"(",
")",
"if",
"not",
"timeout",
":",
"timeo... | https://github.com/seleniumbase/SeleniumBase/blob/0d1de7238bfafe4b7309fec6f735dcd0dc4538a8/seleniumbase/fixtures/base_case.py#L10129-L10156 | ||
RTIInternational/gobbli | d9ec8132f74ce49dc4bead2fad25b661bcef6e76 | gobbli/model/bert/src/modeling.py | python | get_shape_list | (tensor, expected_rank=None, name=None) | return shape | Returns a list of the shape of tensor, preferring static dimensions.
Args:
tensor: A tf.Tensor object to find the shape of.
expected_rank: (optional) int. The expected rank of `tensor`. If this is
specified and the `tensor` has a different rank, and exception will be
thrown.
name: Optional name of the tensor for the error message.
Returns:
A list of dimensions of the shape of tensor. All static dimensions will
be returned as python integers, and dynamic dimensions will be returned
as tf.Tensor scalars. | Returns a list of the shape of tensor, preferring static dimensions. | [
"Returns",
"a",
"list",
"of",
"the",
"shape",
"of",
"tensor",
"preferring",
"static",
"dimensions",
"."
] | def get_shape_list(tensor, expected_rank=None, name=None):
"""Returns a list of the shape of tensor, preferring static dimensions.
Args:
tensor: A tf.Tensor object to find the shape of.
expected_rank: (optional) int. The expected rank of `tensor`. If this is
specified and the `tensor` has a different rank, and exception will be
thrown.
name: Optional name of the tensor for the error message.
Returns:
A list of dimensions of the shape of tensor. All static dimensions will
be returned as python integers, and dynamic dimensions will be returned
as tf.Tensor scalars.
"""
if name is None:
name = tensor.name
if expected_rank is not None:
assert_rank(tensor, expected_rank, name)
shape = tensor.shape.as_list()
non_static_indexes = []
for (index, dim) in enumerate(shape):
if dim is None:
non_static_indexes.append(index)
if not non_static_indexes:
return shape
dyn_shape = tf.shape(tensor)
for index in non_static_indexes:
shape[index] = dyn_shape[index]
return shape | [
"def",
"get_shape_list",
"(",
"tensor",
",",
"expected_rank",
"=",
"None",
",",
"name",
"=",
"None",
")",
":",
"if",
"name",
"is",
"None",
":",
"name",
"=",
"tensor",
".",
"name",
"if",
"expected_rank",
"is",
"not",
"None",
":",
"assert_rank",
"(",
"te... | https://github.com/RTIInternational/gobbli/blob/d9ec8132f74ce49dc4bead2fad25b661bcef6e76/gobbli/model/bert/src/modeling.py#L895-L929 | |
1040003585/WebScrapingWithPython | a770fa5b03894076c8c9539b1ffff34424ffc016 | portia_examle/lib/python2.7/locale.py | python | getdefaultlocale | (envvars=('LC_ALL', 'LC_CTYPE', 'LANG', 'LANGUAGE')) | return _parse_localename(localename) | Tries to determine the default locale settings and returns
them as tuple (language code, encoding).
According to POSIX, a program which has not called
setlocale(LC_ALL, "") runs using the portable 'C' locale.
Calling setlocale(LC_ALL, "") lets it use the default locale as
defined by the LANG variable. Since we don't want to interfere
with the current locale setting we thus emulate the behavior
in the way described above.
To maintain compatibility with other platforms, not only the
LANG variable is tested, but a list of variables given as
envvars parameter. The first found to be defined will be
used. envvars defaults to the search path used in GNU gettext;
it must always contain the variable name 'LANG'.
Except for the code 'C', the language code corresponds to RFC
1766. code and encoding can be None in case the values cannot
be determined. | Tries to determine the default locale settings and returns
them as tuple (language code, encoding). | [
"Tries",
"to",
"determine",
"the",
"default",
"locale",
"settings",
"and",
"returns",
"them",
"as",
"tuple",
"(",
"language",
"code",
"encoding",
")",
"."
] | def getdefaultlocale(envvars=('LC_ALL', 'LC_CTYPE', 'LANG', 'LANGUAGE')):
""" Tries to determine the default locale settings and returns
them as tuple (language code, encoding).
According to POSIX, a program which has not called
setlocale(LC_ALL, "") runs using the portable 'C' locale.
Calling setlocale(LC_ALL, "") lets it use the default locale as
defined by the LANG variable. Since we don't want to interfere
with the current locale setting we thus emulate the behavior
in the way described above.
To maintain compatibility with other platforms, not only the
LANG variable is tested, but a list of variables given as
envvars parameter. The first found to be defined will be
used. envvars defaults to the search path used in GNU gettext;
it must always contain the variable name 'LANG'.
Except for the code 'C', the language code corresponds to RFC
1766. code and encoding can be None in case the values cannot
be determined.
"""
try:
# check if it's supported by the _locale module
import _locale
code, encoding = _locale._getdefaultlocale()
except (ImportError, AttributeError):
pass
else:
# make sure the code/encoding values are valid
if sys.platform == "win32" and code and code[:2] == "0x":
# map windows language identifier to language name
code = windows_locale.get(int(code, 0))
# ...add other platform-specific processing here, if
# necessary...
return code, encoding
# fall back on POSIX behaviour
import os
lookup = os.environ.get
for variable in envvars:
localename = lookup(variable,None)
if localename:
if variable == 'LANGUAGE':
localename = localename.split(':')[0]
break
else:
localename = 'C'
return _parse_localename(localename) | [
"def",
"getdefaultlocale",
"(",
"envvars",
"=",
"(",
"'LC_ALL'",
",",
"'LC_CTYPE'",
",",
"'LANG'",
",",
"'LANGUAGE'",
")",
")",
":",
"try",
":",
"# check if it's supported by the _locale module",
"import",
"_locale",
"code",
",",
"encoding",
"=",
"_locale",
".",
... | https://github.com/1040003585/WebScrapingWithPython/blob/a770fa5b03894076c8c9539b1ffff34424ffc016/portia_examle/lib/python2.7/locale.py#L495-L545 | |
PaddlePaddle/PaddleDetection | 635e3e0a80f3d05751cdcfca8af04ee17c601a92 | static/ppdet/data/parallel_map.py | python | ParallelMap.stop | (self) | notify to exit | notify to exit | [
"notify",
"to",
"exit"
] | def stop(self):
""" notify to exit
"""
self._exit = True
self._feeding_ev.set()
for _ in range(len(self._consumers)):
self._inq.put(EndSignal(0, "notify consumers to exit")) | [
"def",
"stop",
"(",
"self",
")",
":",
"self",
".",
"_exit",
"=",
"True",
"self",
".",
"_feeding_ev",
".",
"set",
"(",
")",
"for",
"_",
"in",
"range",
"(",
"len",
"(",
"self",
".",
"_consumers",
")",
")",
":",
"self",
".",
"_inq",
".",
"put",
"(... | https://github.com/PaddlePaddle/PaddleDetection/blob/635e3e0a80f3d05751cdcfca8af04ee17c601a92/static/ppdet/data/parallel_map.py#L194-L200 | ||
translate/pootle | 742c08fce1a0dc16e6ab8d2494eb867c8879205d | docs/server/apache-wsgi.py | python | application | (environ, start_response) | return _wsgi_application(environ, start_response) | Wrapper for Django's WSGIHandler().
This allows to get values specified by SetEnv in the Apache
configuration or interpose other changes to that environment, like
installing middleware. | Wrapper for Django's WSGIHandler(). | [
"Wrapper",
"for",
"Django",
"s",
"WSGIHandler",
"()",
"."
] | def application(environ, start_response):
"""Wrapper for Django's WSGIHandler().
This allows to get values specified by SetEnv in the Apache
configuration or interpose other changes to that environment, like
installing middleware.
"""
try:
os.environ['POOTLE_SETTINGS'] = environ['POOTLE_SETTINGS']
except KeyError:
pass
from django.core.wsgi import get_wsgi_application
_wsgi_application = get_wsgi_application()
return _wsgi_application(environ, start_response) | [
"def",
"application",
"(",
"environ",
",",
"start_response",
")",
":",
"try",
":",
"os",
".",
"environ",
"[",
"'POOTLE_SETTINGS'",
"]",
"=",
"environ",
"[",
"'POOTLE_SETTINGS'",
"]",
"except",
"KeyError",
":",
"pass",
"from",
"django",
".",
"core",
".",
"w... | https://github.com/translate/pootle/blob/742c08fce1a0dc16e6ab8d2494eb867c8879205d/docs/server/apache-wsgi.py#L38-L52 | |
jython/jython3 | def4f8ec47cb7a9c799ea4c745f12badf92c5769 | lib-python/3.5.1/tkinter/ttk.py | python | Notebook.__init__ | (self, master=None, **kw) | Construct a Ttk Notebook with parent master.
STANDARD OPTIONS
class, cursor, style, takefocus
WIDGET-SPECIFIC OPTIONS
height, padding, width
TAB OPTIONS
state, sticky, padding, text, image, compound, underline
TAB IDENTIFIERS (tab_id)
The tab_id argument found in several methods may take any of
the following forms:
* An integer between zero and the number of tabs
* The name of a child window
* A positional specification of the form "@x,y", which
defines the tab
* The string "current", which identifies the
currently-selected tab
* The string "end", which returns the number of tabs (only
valid for method index) | Construct a Ttk Notebook with parent master. | [
"Construct",
"a",
"Ttk",
"Notebook",
"with",
"parent",
"master",
"."
] | def __init__(self, master=None, **kw):
"""Construct a Ttk Notebook with parent master.
STANDARD OPTIONS
class, cursor, style, takefocus
WIDGET-SPECIFIC OPTIONS
height, padding, width
TAB OPTIONS
state, sticky, padding, text, image, compound, underline
TAB IDENTIFIERS (tab_id)
The tab_id argument found in several methods may take any of
the following forms:
* An integer between zero and the number of tabs
* The name of a child window
* A positional specification of the form "@x,y", which
defines the tab
* The string "current", which identifies the
currently-selected tab
* The string "end", which returns the number of tabs (only
valid for method index)
"""
Widget.__init__(self, master, "ttk::notebook", kw) | [
"def",
"__init__",
"(",
"self",
",",
"master",
"=",
"None",
",",
"*",
"*",
"kw",
")",
":",
"Widget",
".",
"__init__",
"(",
"self",
",",
"master",
",",
"\"ttk::notebook\"",
",",
"kw",
")"
] | https://github.com/jython/jython3/blob/def4f8ec47cb7a9c799ea4c745f12badf92c5769/lib-python/3.5.1/tkinter/ttk.py#L803-L832 | ||
sidewalklabs/s2sphere | d1d067e8c06e5fbaf0cc0158bade947b4a03a438 | s2sphere/sphere.py | python | RegionCoverer.__max_children_shift | (self) | return 2 * self.__level_mod | [] | def __max_children_shift(self):
return 2 * self.__level_mod | [
"def",
"__max_children_shift",
"(",
"self",
")",
":",
"return",
"2",
"*",
"self",
".",
"__level_mod"
] | https://github.com/sidewalklabs/s2sphere/blob/d1d067e8c06e5fbaf0cc0158bade947b4a03a438/s2sphere/sphere.py#L2943-L2944 | |||
openstack/manila | 142990edc027e14839d5deaf4954dd6fc88de15e | manila/api/views/services.py | python | ViewBuilder.summary | (self, service) | return {key: service.get(key) for key in keys} | Summary view of a single service. | Summary view of a single service. | [
"Summary",
"view",
"of",
"a",
"single",
"service",
"."
] | def summary(self, service):
"""Summary view of a single service."""
keys = 'host', 'binary', 'disabled'
return {key: service.get(key) for key in keys} | [
"def",
"summary",
"(",
"self",
",",
"service",
")",
":",
"keys",
"=",
"'host'",
",",
"'binary'",
",",
"'disabled'",
"return",
"{",
"key",
":",
"service",
".",
"get",
"(",
"key",
")",
"for",
"key",
"in",
"keys",
"}"
] | https://github.com/openstack/manila/blob/142990edc027e14839d5deaf4954dd6fc88de15e/manila/api/views/services.py#L23-L26 | |
edisonlz/fastor | 342078a18363ac41d3c6b1ab29dbdd44fdb0b7b3 | base/site-packages/notification/lockfile.py | python | LockBase.__enter__ | (self) | return self | Context manager support. | Context manager support. | [
"Context",
"manager",
"support",
"."
] | def __enter__(self):
"""
Context manager support.
"""
self.acquire()
return self | [
"def",
"__enter__",
"(",
"self",
")",
":",
"self",
".",
"acquire",
"(",
")",
"return",
"self"
] | https://github.com/edisonlz/fastor/blob/342078a18363ac41d3c6b1ab29dbdd44fdb0b7b3/base/site-packages/notification/lockfile.py#L221-L226 | |
oracle/graalpython | 577e02da9755d916056184ec441c26e00b70145c | graalpython/lib-python/3/turtle.py | python | TurtleScreenBase._drawline | (self, lineitem, coordlist=None,
fill=None, width=None, top=False) | Configure lineitem according to provided arguments:
coordlist is sequence of coordinates
fill is drawing color
width is width of drawn line.
top is a boolean value, which specifies if polyitem
will be put on top of the canvas' displaylist so it
will not be covered by other items. | Configure lineitem according to provided arguments:
coordlist is sequence of coordinates
fill is drawing color
width is width of drawn line.
top is a boolean value, which specifies if polyitem
will be put on top of the canvas' displaylist so it
will not be covered by other items. | [
"Configure",
"lineitem",
"according",
"to",
"provided",
"arguments",
":",
"coordlist",
"is",
"sequence",
"of",
"coordinates",
"fill",
"is",
"drawing",
"color",
"width",
"is",
"width",
"of",
"drawn",
"line",
".",
"top",
"is",
"a",
"boolean",
"value",
"which",
... | def _drawline(self, lineitem, coordlist=None,
fill=None, width=None, top=False):
"""Configure lineitem according to provided arguments:
coordlist is sequence of coordinates
fill is drawing color
width is width of drawn line.
top is a boolean value, which specifies if polyitem
will be put on top of the canvas' displaylist so it
will not be covered by other items.
"""
if coordlist is not None:
cl = []
for x, y in coordlist:
cl.append(x * self.xscale)
cl.append(-y * self.yscale)
self.cv.coords(lineitem, *cl)
if fill is not None:
self.cv.itemconfigure(lineitem, fill=fill)
if width is not None:
self.cv.itemconfigure(lineitem, width=width)
if top:
self.cv.tag_raise(lineitem) | [
"def",
"_drawline",
"(",
"self",
",",
"lineitem",
",",
"coordlist",
"=",
"None",
",",
"fill",
"=",
"None",
",",
"width",
"=",
"None",
",",
"top",
"=",
"False",
")",
":",
"if",
"coordlist",
"is",
"not",
"None",
":",
"cl",
"=",
"[",
"]",
"for",
"x"... | https://github.com/oracle/graalpython/blob/577e02da9755d916056184ec441c26e00b70145c/graalpython/lib-python/3/turtle.py#L530-L551 | ||
Kozea/WeasyPrint | 6cce2978165134e37683cb5b3d156cac6a11a7f9 | weasyprint/layout/preferred.py | python | min_max | (box, width) | return max(min_width, min(width, max_width)) | Get box width from given width and box min- and max-widths. | Get box width from given width and box min- and max-widths. | [
"Get",
"box",
"width",
"from",
"given",
"width",
"and",
"box",
"min",
"-",
"and",
"max",
"-",
"widths",
"."
] | def min_max(box, width):
"""Get box width from given width and box min- and max-widths."""
min_width = box.style['min_width']
max_width = box.style['max_width']
if min_width == 'auto' or min_width.unit == '%':
min_width = 0
else:
min_width = min_width.value
if max_width == 'auto' or max_width.unit == '%':
max_width = float('inf')
else:
max_width = max_width.value
if isinstance(box, boxes.ReplacedBox):
_, _, ratio = box.replacement.get_intrinsic_size(
1, box.style['font_size'])
if ratio is not None:
min_height = box.style['min_height']
if min_height != 'auto' and min_height.unit != '%':
min_width = max(min_width, min_height.value * ratio)
max_height = box.style['max_height']
if max_height != 'auto' and max_height.unit != '%':
max_width = min(max_width, max_height.value * ratio)
return max(min_width, min(width, max_width)) | [
"def",
"min_max",
"(",
"box",
",",
"width",
")",
":",
"min_width",
"=",
"box",
".",
"style",
"[",
"'min_width'",
"]",
"max_width",
"=",
"box",
".",
"style",
"[",
"'max_width'",
"]",
"if",
"min_width",
"==",
"'auto'",
"or",
"min_width",
".",
"unit",
"==... | https://github.com/Kozea/WeasyPrint/blob/6cce2978165134e37683cb5b3d156cac6a11a7f9/weasyprint/layout/preferred.py#L108-L132 | |
IJDykeman/wangTiles | 7c1ee2095ebdf7f72bce07d94c6484915d5cae8b | experimental_code/tiles_3d/venv_mac/lib/python2.7/site-packages/pkg_resources/_vendor/packaging/_compat.py | python | with_metaclass | (meta, *bases) | return type.__new__(metaclass, 'temporary_class', (), {}) | Create a base class with a metaclass. | Create a base class with a metaclass. | [
"Create",
"a",
"base",
"class",
"with",
"a",
"metaclass",
"."
] | def with_metaclass(meta, *bases):
"""
Create a base class with a metaclass.
"""
# This requires a bit of explanation: the basic idea is to make a dummy
# metaclass for one level of class instantiation that replaces itself with
# the actual metaclass.
class metaclass(meta):
def __new__(cls, name, this_bases, d):
return meta(name, bases, d)
return type.__new__(metaclass, 'temporary_class', (), {}) | [
"def",
"with_metaclass",
"(",
"meta",
",",
"*",
"bases",
")",
":",
"# This requires a bit of explanation: the basic idea is to make a dummy",
"# metaclass for one level of class instantiation that replaces itself with",
"# the actual metaclass.",
"class",
"metaclass",
"(",
"meta",
")... | https://github.com/IJDykeman/wangTiles/blob/7c1ee2095ebdf7f72bce07d94c6484915d5cae8b/experimental_code/tiles_3d/venv_mac/lib/python2.7/site-packages/pkg_resources/_vendor/packaging/_compat.py#L20-L30 | |
dickreuter/neuron_poker | 9f841e5aeead681fa1fb2955524c53081fba2078 | agents/agent_keras_rl_dqn.py | python | Player.initiate_agent | (self, env) | initiate a deep Q agent | initiate a deep Q agent | [
"initiate",
"a",
"deep",
"Q",
"agent"
] | def initiate_agent(self, env):
"""initiate a deep Q agent"""
tf.compat.v1.disable_eager_execution()
self.env = env
nb_actions = self.env.action_space.n
self.model = Sequential()
self.model.add(Dense(512, activation='relu', input_shape=env.observation_space))
self.model.add(Dropout(0.2))
self.model.add(Dense(512, activation='relu'))
self.model.add(Dropout(0.2))
self.model.add(Dense(512, activation='relu'))
self.model.add(Dropout(0.2))
self.model.add(Dense(nb_actions, activation='linear'))
# Finally, we configure and compile our agent. You can use every built-in Keras optimizer and
# even the metrics!
memory = SequentialMemory(limit=memory_limit, window_length=window_length)
policy = TrumpPolicy()
nb_actions = env.action_space.n
self.dqn = DQNAgent(model=self.model, nb_actions=nb_actions, memory=memory, nb_steps_warmup=nb_steps_warmup,
target_model_update=1e-2, policy=policy,
processor=CustomProcessor(),
batch_size=batch_size, train_interval=train_interval, enable_double_dqn=enable_double_dqn)
self.dqn.compile(Adam(lr=1e-3), metrics=['mae']) | [
"def",
"initiate_agent",
"(",
"self",
",",
"env",
")",
":",
"tf",
".",
"compat",
".",
"v1",
".",
"disable_eager_execution",
"(",
")",
"self",
".",
"env",
"=",
"env",
"nb_actions",
"=",
"self",
".",
"env",
".",
"action_space",
".",
"n",
"self",
".",
"... | https://github.com/dickreuter/neuron_poker/blob/9f841e5aeead681fa1fb2955524c53081fba2078/agents/agent_keras_rl_dqn.py#L56-L84 | ||
yongzhuo/Keras-TextClassification | 640e3f44f90d9d8046546f7e1a93a29ebe5c8d30 | keras_textclassification/data_preprocess/text_preprocess.py | python | get_ngram | (text, ns=[1]) | return ngrams | 获取文本的ngram等特征
:param text: str
:return: list | 获取文本的ngram等特征
:param text: str
:return: list | [
"获取文本的ngram等特征",
":",
"param",
"text",
":",
"str",
":",
"return",
":",
"list"
] | def get_ngram(text, ns=[1]):
"""
获取文本的ngram等特征
:param text: str
:return: list
"""
if type(ns) != list:
raise RuntimeError("ns of function get_ngram() must be list!")
for n in ns:
if n < 1:
raise RuntimeError("enum of ns must '>1'!")
len_text = len(text)
ngrams = []
for n in ns:
ngram_n = []
for i in range(len_text):
if i + n <= len_text:
ngram_n.append(text[i:i+n])
else:
break
if not ngram_n:
ngram_n.append(text)
ngrams += ngram_n
return ngrams | [
"def",
"get_ngram",
"(",
"text",
",",
"ns",
"=",
"[",
"1",
"]",
")",
":",
"if",
"type",
"(",
"ns",
")",
"!=",
"list",
":",
"raise",
"RuntimeError",
"(",
"\"ns of function get_ngram() must be list!\"",
")",
"for",
"n",
"in",
"ns",
":",
"if",
"n",
"<",
... | https://github.com/yongzhuo/Keras-TextClassification/blob/640e3f44f90d9d8046546f7e1a93a29ebe5c8d30/keras_textclassification/data_preprocess/text_preprocess.py#L157-L180 | |
tdamdouni/Pythonista | 3e082d53b6b9b501a3c8cf3251a8ad4c8be9c2ad | markdown/markdown2pdf/reportlab/graphics/charts/axes.py | python | sample5d | () | return drawing | Sample drawing, xvalue/yvalue axes, y connected at left of x. | Sample drawing, xvalue/yvalue axes, y connected at left of x. | [
"Sample",
"drawing",
"xvalue",
"/",
"yvalue",
"axes",
"y",
"connected",
"at",
"left",
"of",
"x",
"."
] | def sample5d():
"Sample drawing, xvalue/yvalue axes, y connected at left of x."
drawing = Drawing(400, 200)
data = [(10, 20, 30, 42)]
xAxis = XValueAxis()
xAxis.setPosition(50, 50, 300)
xAxis.configure(data)
yAxis = YValueAxis()
yAxis.setPosition(50, 50, 125)
yAxis.joinAxis = xAxis
yAxis.joinAxisMode = 'left'
yAxis.configure(data)
drawing.add(xAxis)
drawing.add(yAxis)
return drawing | [
"def",
"sample5d",
"(",
")",
":",
"drawing",
"=",
"Drawing",
"(",
"400",
",",
"200",
")",
"data",
"=",
"[",
"(",
"10",
",",
"20",
",",
"30",
",",
"42",
")",
"]",
"xAxis",
"=",
"XValueAxis",
"(",
")",
"xAxis",
".",
"setPosition",
"(",
"50",
",",... | https://github.com/tdamdouni/Pythonista/blob/3e082d53b6b9b501a3c8cf3251a8ad4c8be9c2ad/markdown/markdown2pdf/reportlab/graphics/charts/axes.py#L2165-L2179 | |
lovelylain/pyctp | fd304de4b50c4ddc31a4190b1caaeb5dec66bc5d | futures2/ctp/__init__.py | python | MdApi.OnFrontConnected | (self) | 当客户端与交易后台建立起通信连接时(还未登录前),该方法被调用。 | 当客户端与交易后台建立起通信连接时(还未登录前),该方法被调用。 | [
"当客户端与交易后台建立起通信连接时(还未登录前),该方法被调用。"
] | def OnFrontConnected(self):
"""当客户端与交易后台建立起通信连接时(还未登录前),该方法被调用。""" | [
"def",
"OnFrontConnected",
"(",
"self",
")",
":"
] | https://github.com/lovelylain/pyctp/blob/fd304de4b50c4ddc31a4190b1caaeb5dec66bc5d/futures2/ctp/__init__.py#L109-L110 | ||
syrusakbary/Flask-SuperAdmin | e325e57e0c96a195f4e3bc932c19670968661531 | flask_superadmin/contrib/fileadmin.py | python | FileAdmin.__init__ | (self, base_path, base_url,
name=None, category=None, endpoint=None, url=None) | Constructor.
`base_path`
Base file storage location
`base_url`
Base URL for the files
`name`
Name of this view. If not provided,
will be defaulted to the class name.
`category`
View category
`endpoint`
Endpoint name for the view
`url`
URL for view | Constructor. | [
"Constructor",
"."
] | def __init__(self, base_path, base_url,
name=None, category=None, endpoint=None, url=None):
"""
Constructor.
`base_path`
Base file storage location
`base_url`
Base URL for the files
`name`
Name of this view. If not provided,
will be defaulted to the class name.
`category`
View category
`endpoint`
Endpoint name for the view
`url`
URL for view
"""
self.base_path = base_path
self.base_url = base_url
self._on_windows = platform.system() == 'Windows'
# Convert allowed_extensions to set for quick validation
if (self.allowed_extensions
and not isinstance(self.allowed_extensions, set)):
self.allowed_extensions = set(self.allowed_extensions)
super(FileAdmin, self).__init__(name, category, endpoint, url) | [
"def",
"__init__",
"(",
"self",
",",
"base_path",
",",
"base_url",
",",
"name",
"=",
"None",
",",
"category",
"=",
"None",
",",
"endpoint",
"=",
"None",
",",
"url",
"=",
"None",
")",
":",
"self",
".",
"base_path",
"=",
"base_path",
"self",
".",
"base... | https://github.com/syrusakbary/Flask-SuperAdmin/blob/e325e57e0c96a195f4e3bc932c19670968661531/flask_superadmin/contrib/fileadmin.py#L135-L164 | ||
airbnb/streamalert | 26cf1d08432ca285fd4f7410511a6198ca104bbb | streamalert/rule_promotion/promoter.py | python | RulePromoter._update_alert_count | (self) | Transform Athena query results into alert counts for rules_engine
Args:
query (str): Athena query to run and wait for results
Returns:
dict: Representation of alert counts, where key is the rule name
and value is the alert count (int) since this rule was staged | Transform Athena query results into alert counts for rules_engine | [
"Transform",
"Athena",
"query",
"results",
"into",
"alert",
"counts",
"for",
"rules_engine"
] | def _update_alert_count(self):
"""Transform Athena query results into alert counts for rules_engine
Args:
query (str): Athena query to run and wait for results
Returns:
dict: Representation of alert counts, where key is the rule name
and value is the alert count (int) since this rule was staged
"""
query = StagingStatistic.construct_compound_count_query(list(self._staging_stats.values()))
LOGGER.debug('Running compound query for alert count: \'%s\'', query)
for page, results in enumerate(self._athena_client.query_result_paginator(query)):
for i, row in enumerate(results['ResultSet']['Rows']):
if page == 0 and i == 0: # skip header row included in first page only
continue
row_values = [list(data.values())[0] for data in row['Data']]
rule_name, alert_count = row_values[0], int(row_values[1])
LOGGER.debug('Found %d alerts for rule \'%s\'', alert_count, rule_name)
self._staging_stats[rule_name].alert_count = alert_count | [
"def",
"_update_alert_count",
"(",
"self",
")",
":",
"query",
"=",
"StagingStatistic",
".",
"construct_compound_count_query",
"(",
"list",
"(",
"self",
".",
"_staging_stats",
".",
"values",
"(",
")",
")",
")",
"LOGGER",
".",
"debug",
"(",
"'Running compound quer... | https://github.com/airbnb/streamalert/blob/26cf1d08432ca285fd4f7410511a6198ca104bbb/streamalert/rule_promotion/promoter.py#L85-L107 | ||
jgagneastro/coffeegrindsize | 22661ebd21831dba4cf32bfc6ba59fe3d49f879c | App/dist/coffeegrindsize.app/Contents/Resources/lib/python3.7/numpy/fft/fftpack.py | python | fft2 | (a, s=None, axes=(-2, -1), norm=None) | return _raw_fftnd(a, s, axes, fft, norm) | Compute the 2-dimensional discrete Fourier Transform
This function computes the *n*-dimensional discrete Fourier Transform
over any axes in an *M*-dimensional array by means of the
Fast Fourier Transform (FFT). By default, the transform is computed over
the last two axes of the input array, i.e., a 2-dimensional FFT.
Parameters
----------
a : array_like
Input array, can be complex
s : sequence of ints, optional
Shape (length of each transformed axis) of the output
(``s[0]`` refers to axis 0, ``s[1]`` to axis 1, etc.).
This corresponds to ``n`` for ``fft(x, n)``.
Along each axis, if the given shape is smaller than that of the input,
the input is cropped. If it is larger, the input is padded with zeros.
if `s` is not given, the shape of the input along the axes specified
by `axes` is used.
axes : sequence of ints, optional
Axes over which to compute the FFT. If not given, the last two
axes are used. A repeated index in `axes` means the transform over
that axis is performed multiple times. A one-element sequence means
that a one-dimensional FFT is performed.
norm : {None, "ortho"}, optional
.. versionadded:: 1.10.0
Normalization mode (see `numpy.fft`). Default is None.
Returns
-------
out : complex ndarray
The truncated or zero-padded input, transformed along the axes
indicated by `axes`, or the last two axes if `axes` is not given.
Raises
------
ValueError
If `s` and `axes` have different length, or `axes` not given and
``len(s) != 2``.
IndexError
If an element of `axes` is larger than than the number of axes of `a`.
See Also
--------
numpy.fft : Overall view of discrete Fourier transforms, with definitions
and conventions used.
ifft2 : The inverse two-dimensional FFT.
fft : The one-dimensional FFT.
fftn : The *n*-dimensional FFT.
fftshift : Shifts zero-frequency terms to the center of the array.
For two-dimensional input, swaps first and third quadrants, and second
and fourth quadrants.
Notes
-----
`fft2` is just `fftn` with a different default for `axes`.
The output, analogously to `fft`, contains the term for zero frequency in
the low-order corner of the transformed axes, the positive frequency terms
in the first half of these axes, the term for the Nyquist frequency in the
middle of the axes and the negative frequency terms in the second half of
the axes, in order of decreasingly negative frequency.
See `fftn` for details and a plotting example, and `numpy.fft` for
definitions and conventions used.
Examples
--------
>>> a = np.mgrid[:5, :5][0]
>>> np.fft.fft2(a)
array([[ 50.0 +0.j , 0.0 +0.j , 0.0 +0.j ,
0.0 +0.j , 0.0 +0.j ],
[-12.5+17.20477401j, 0.0 +0.j , 0.0 +0.j ,
0.0 +0.j , 0.0 +0.j ],
[-12.5 +4.0614962j , 0.0 +0.j , 0.0 +0.j ,
0.0 +0.j , 0.0 +0.j ],
[-12.5 -4.0614962j , 0.0 +0.j , 0.0 +0.j ,
0.0 +0.j , 0.0 +0.j ],
[-12.5-17.20477401j, 0.0 +0.j , 0.0 +0.j ,
0.0 +0.j , 0.0 +0.j ]]) | Compute the 2-dimensional discrete Fourier Transform | [
"Compute",
"the",
"2",
"-",
"dimensional",
"discrete",
"Fourier",
"Transform"
] | def fft2(a, s=None, axes=(-2, -1), norm=None):
"""
Compute the 2-dimensional discrete Fourier Transform
This function computes the *n*-dimensional discrete Fourier Transform
over any axes in an *M*-dimensional array by means of the
Fast Fourier Transform (FFT). By default, the transform is computed over
the last two axes of the input array, i.e., a 2-dimensional FFT.
Parameters
----------
a : array_like
Input array, can be complex
s : sequence of ints, optional
Shape (length of each transformed axis) of the output
(``s[0]`` refers to axis 0, ``s[1]`` to axis 1, etc.).
This corresponds to ``n`` for ``fft(x, n)``.
Along each axis, if the given shape is smaller than that of the input,
the input is cropped. If it is larger, the input is padded with zeros.
if `s` is not given, the shape of the input along the axes specified
by `axes` is used.
axes : sequence of ints, optional
Axes over which to compute the FFT. If not given, the last two
axes are used. A repeated index in `axes` means the transform over
that axis is performed multiple times. A one-element sequence means
that a one-dimensional FFT is performed.
norm : {None, "ortho"}, optional
.. versionadded:: 1.10.0
Normalization mode (see `numpy.fft`). Default is None.
Returns
-------
out : complex ndarray
The truncated or zero-padded input, transformed along the axes
indicated by `axes`, or the last two axes if `axes` is not given.
Raises
------
ValueError
If `s` and `axes` have different length, or `axes` not given and
``len(s) != 2``.
IndexError
If an element of `axes` is larger than than the number of axes of `a`.
See Also
--------
numpy.fft : Overall view of discrete Fourier transforms, with definitions
and conventions used.
ifft2 : The inverse two-dimensional FFT.
fft : The one-dimensional FFT.
fftn : The *n*-dimensional FFT.
fftshift : Shifts zero-frequency terms to the center of the array.
For two-dimensional input, swaps first and third quadrants, and second
and fourth quadrants.
Notes
-----
`fft2` is just `fftn` with a different default for `axes`.
The output, analogously to `fft`, contains the term for zero frequency in
the low-order corner of the transformed axes, the positive frequency terms
in the first half of these axes, the term for the Nyquist frequency in the
middle of the axes and the negative frequency terms in the second half of
the axes, in order of decreasingly negative frequency.
See `fftn` for details and a plotting example, and `numpy.fft` for
definitions and conventions used.
Examples
--------
>>> a = np.mgrid[:5, :5][0]
>>> np.fft.fft2(a)
array([[ 50.0 +0.j , 0.0 +0.j , 0.0 +0.j ,
0.0 +0.j , 0.0 +0.j ],
[-12.5+17.20477401j, 0.0 +0.j , 0.0 +0.j ,
0.0 +0.j , 0.0 +0.j ],
[-12.5 +4.0614962j , 0.0 +0.j , 0.0 +0.j ,
0.0 +0.j , 0.0 +0.j ],
[-12.5 -4.0614962j , 0.0 +0.j , 0.0 +0.j ,
0.0 +0.j , 0.0 +0.j ],
[-12.5-17.20477401j, 0.0 +0.j , 0.0 +0.j ,
0.0 +0.j , 0.0 +0.j ]])
"""
return _raw_fftnd(a, s, axes, fft, norm) | [
"def",
"fft2",
"(",
"a",
",",
"s",
"=",
"None",
",",
"axes",
"=",
"(",
"-",
"2",
",",
"-",
"1",
")",
",",
"norm",
"=",
"None",
")",
":",
"return",
"_raw_fftnd",
"(",
"a",
",",
"s",
",",
"axes",
",",
"fft",
",",
"norm",
")"
] | https://github.com/jgagneastro/coffeegrindsize/blob/22661ebd21831dba4cf32bfc6ba59fe3d49f879c/App/dist/coffeegrindsize.app/Contents/Resources/lib/python3.7/numpy/fft/fftpack.py#L863-L950 | |
wger-project/wger | 3a17a2cf133d242d1f8c357faa53cf675a7b3223 | wger/manager/views/ical.py | python | get_calendar | () | return calendar | Creates and returns a calendar object
:return: Calendar | Creates and returns a calendar object | [
"Creates",
"and",
"returns",
"a",
"calendar",
"object"
] | def get_calendar():
"""
Creates and returns a calendar object
:return: Calendar
"""
calendar = Calendar()
calendar.add('prodid', '-//wger Workout Manager//wger.de//')
calendar.add('version', get_version())
return calendar | [
"def",
"get_calendar",
"(",
")",
":",
"calendar",
"=",
"Calendar",
"(",
")",
"calendar",
".",
"add",
"(",
"'prodid'",
",",
"'-//wger Workout Manager//wger.de//'",
")",
"calendar",
".",
"add",
"(",
"'version'",
",",
"get_version",
"(",
")",
")",
"return",
"ca... | https://github.com/wger-project/wger/blob/3a17a2cf133d242d1f8c357faa53cf675a7b3223/wger/manager/views/ical.py#L63-L72 | |
tensorflow/lattice | 784eca50cbdfedf39f183cc7d298c9fe376b69c0 | tensorflow_lattice/python/pwl_calibration_layer.py | python | PWLCalibrationConstraints.__init__ | (
self,
monotonicity="none",
convexity="none",
lengths=None,
output_min=None,
output_max=None,
output_min_constraints=pwl_calibration_lib.BoundConstraintsType.NONE,
output_max_constraints=pwl_calibration_lib.BoundConstraintsType.NONE,
num_projection_iterations=8) | Initializes an instance of `PWLCalibration`.
Args:
monotonicity: Same meaning as corresponding parameter of `PWLCalibration`.
convexity: Same meaning as corresponding parameter of `PWLCalibration`.
lengths: Lengths of pieces of piecewise linear function. Needed only if
convexity is specified.
output_min: Minimum possible output of pwl function.
output_max: Maximum possible output of pwl function.
output_min_constraints: A `tfl.pwl_calibration_lib.BoundConstraintsType`
describing the constraints on the layer's minimum value.
output_max_constraints: A `tfl.pwl_calibration_lib.BoundConstraintsType`
describing the constraints on the layer's maximum value.
num_projection_iterations: Same meaning as corresponding parameter of
`PWLCalibration`. | Initializes an instance of `PWLCalibration`. | [
"Initializes",
"an",
"instance",
"of",
"PWLCalibration",
"."
] | def __init__(
self,
monotonicity="none",
convexity="none",
lengths=None,
output_min=None,
output_max=None,
output_min_constraints=pwl_calibration_lib.BoundConstraintsType.NONE,
output_max_constraints=pwl_calibration_lib.BoundConstraintsType.NONE,
num_projection_iterations=8):
"""Initializes an instance of `PWLCalibration`.
Args:
monotonicity: Same meaning as corresponding parameter of `PWLCalibration`.
convexity: Same meaning as corresponding parameter of `PWLCalibration`.
lengths: Lengths of pieces of piecewise linear function. Needed only if
convexity is specified.
output_min: Minimum possible output of pwl function.
output_max: Maximum possible output of pwl function.
output_min_constraints: A `tfl.pwl_calibration_lib.BoundConstraintsType`
describing the constraints on the layer's minimum value.
output_max_constraints: A `tfl.pwl_calibration_lib.BoundConstraintsType`
describing the constraints on the layer's maximum value.
num_projection_iterations: Same meaning as corresponding parameter of
`PWLCalibration`.
"""
pwl_calibration_lib.verify_hyperparameters(
output_min=output_min,
output_max=output_max,
monotonicity=monotonicity,
convexity=convexity,
lengths=lengths)
self.monotonicity = monotonicity
self.convexity = convexity
self.lengths = lengths
self.output_min = output_min
self.output_max = output_max
self.output_min_constraints = output_min_constraints
self.output_max_constraints = output_max_constraints
self.num_projection_iterations = num_projection_iterations
canonical_convexity = utils.canonicalize_convexity(self.convexity)
canonical_monotonicity = utils.canonicalize_monotonicity(self.monotonicity)
if (canonical_convexity != 0 and canonical_monotonicity == 0 and
(output_min_constraints != pwl_calibration_lib.BoundConstraintsType.NONE
or output_max_constraints !=
pwl_calibration_lib.BoundConstraintsType.NONE)):
logging.warning("Convexity constraints are specified with bounds "
"constraints, but without monotonicity. Such combination "
"might lead to convexity being slightly violated. "
"Consider increasing num_projection_iterations to "
"reduce violation.") | [
"def",
"__init__",
"(",
"self",
",",
"monotonicity",
"=",
"\"none\"",
",",
"convexity",
"=",
"\"none\"",
",",
"lengths",
"=",
"None",
",",
"output_min",
"=",
"None",
",",
"output_max",
"=",
"None",
",",
"output_min_constraints",
"=",
"pwl_calibration_lib",
"."... | https://github.com/tensorflow/lattice/blob/784eca50cbdfedf39f183cc7d298c9fe376b69c0/tensorflow_lattice/python/pwl_calibration_layer.py#L693-L744 | ||
SebKuzminsky/pycam | 55e3129f518e470040e79bb00515b4bfcf36c172 | pycam/Toolpath/__init__.py | python | Toolpath.maxz | (self) | return self._maxz | [] | def maxz(self):
if self._maxz is None:
self._maxz = self._get_limit_generic(2, max)
return self._maxz | [
"def",
"maxz",
"(",
"self",
")",
":",
"if",
"self",
".",
"_maxz",
"is",
"None",
":",
"self",
".",
"_maxz",
"=",
"self",
".",
"_get_limit_generic",
"(",
"2",
",",
"max",
")",
"return",
"self",
".",
"_maxz"
] | https://github.com/SebKuzminsky/pycam/blob/55e3129f518e470040e79bb00515b4bfcf36c172/pycam/Toolpath/__init__.py#L169-L172 | |||
chenxuuu/24h-raspberry-live-on-bilibili | 09feeb3350a64d9f1c4706c54038ed90462ffe8d | bilibiliClient.py | python | bilibiliClient.SendSocketData | (self, packetlength, magic, ver, action, param, body) | [] | async def SendSocketData(self, packetlength, magic, ver, action, param, body):
bytearr = body.encode('utf-8')
if packetlength == 0:
packetlength = len(bytearr) + 16
sendbytes = pack('!IHHII', packetlength, magic, ver, action, param)
if len(bytearr) != 0:
sendbytes = sendbytes + bytearr
self._writer.write(sendbytes)
await self._writer.drain() | [
"async",
"def",
"SendSocketData",
"(",
"self",
",",
"packetlength",
",",
"magic",
",",
"ver",
",",
"action",
",",
"param",
",",
"body",
")",
":",
"bytearr",
"=",
"body",
".",
"encode",
"(",
"'utf-8'",
")",
"if",
"packetlength",
"==",
"0",
":",
"packetl... | https://github.com/chenxuuu/24h-raspberry-live-on-bilibili/blob/09feeb3350a64d9f1c4706c54038ed90462ffe8d/bilibiliClient.py#L79-L87 | ||||
Rudrabha/Lip2Wav | 95d923f130e4cce93fdffbf67d2ec2d66eef933a | synthesizer/models/modules.py | python | ZoneoutLSTMCell.__init__ | (self, num_units, is_training, zoneout_factor_cell=0., zoneout_factor_output=0.,
state_is_tuple=True, name=None) | Initializer with possibility to set different zoneout values for cell/hidden states. | Initializer with possibility to set different zoneout values for cell/hidden states. | [
"Initializer",
"with",
"possibility",
"to",
"set",
"different",
"zoneout",
"values",
"for",
"cell",
"/",
"hidden",
"states",
"."
] | def __init__(self, num_units, is_training, zoneout_factor_cell=0., zoneout_factor_output=0.,
state_is_tuple=True, name=None):
"""Initializer with possibility to set different zoneout values for cell/hidden states.
"""
zm = min(zoneout_factor_output, zoneout_factor_cell)
zs = max(zoneout_factor_output, zoneout_factor_cell)
if zm < 0. or zs > 1.:
raise ValueError("One/both provided Zoneout factors are not in [0, 1]")
self._cell = tf.nn.rnn_cell.LSTMCell(num_units, state_is_tuple=state_is_tuple, name=name)
self._zoneout_cell = zoneout_factor_cell
self._zoneout_outputs = zoneout_factor_output
self.is_training = is_training
self.state_is_tuple = state_is_tuple | [
"def",
"__init__",
"(",
"self",
",",
"num_units",
",",
"is_training",
",",
"zoneout_factor_cell",
"=",
"0.",
",",
"zoneout_factor_output",
"=",
"0.",
",",
"state_is_tuple",
"=",
"True",
",",
"name",
"=",
"None",
")",
":",
"zm",
"=",
"min",
"(",
"zoneout_fa... | https://github.com/Rudrabha/Lip2Wav/blob/95d923f130e4cce93fdffbf67d2ec2d66eef933a/synthesizer/models/modules.py#L102-L116 | ||
openhatch/oh-mainline | ce29352a034e1223141dcc2f317030bbc3359a51 | vendor/packages/sphinx/sphinx/environment.py | python | BuildEnvironment.process_refonly_bullet_lists | (self, docname, doctree) | Change refonly bullet lists to use compact_paragraphs.
Specifically implemented for 'Indices and Tables' section, which looks
odd when html_compact_lists is false. | Change refonly bullet lists to use compact_paragraphs. | [
"Change",
"refonly",
"bullet",
"lists",
"to",
"use",
"compact_paragraphs",
"."
] | def process_refonly_bullet_lists(self, docname, doctree):
"""Change refonly bullet lists to use compact_paragraphs.
Specifically implemented for 'Indices and Tables' section, which looks
odd when html_compact_lists is false.
"""
if self.config.html_compact_lists:
return
class RefOnlyListChecker(nodes.GenericNodeVisitor):
"""Raise `nodes.NodeFound` if non-simple list item is encountered.
Here 'simple' means a list item containing only a paragraph with a
single reference in it.
"""
def default_visit(self, node):
raise nodes.NodeFound
def visit_bullet_list(self, node):
pass
def visit_list_item(self, node):
children = []
for child in node.children:
if not isinstance(child, nodes.Invisible):
children.append(child)
if len(children) != 1:
raise nodes.NodeFound
if not isinstance(children[0], nodes.paragraph):
raise nodes.NodeFound
para = children[0]
if len(para) != 1:
raise nodes.NodeFound
if not isinstance(para[0], addnodes.pending_xref):
raise nodes.NodeFound
raise nodes.SkipChildren
def invisible_visit(self, node):
"""Invisible nodes should be ignored."""
pass
def check_refonly_list(node):
"""Check for list with only references in it."""
visitor = RefOnlyListChecker(doctree)
try:
node.walk(visitor)
except nodes.NodeFound:
return False
else:
return True
for node in doctree.traverse(nodes.bullet_list):
if check_refonly_list(node):
for item in node.traverse(nodes.list_item):
para = item[0]
ref = para[0]
compact_para = addnodes.compact_paragraph()
compact_para += ref
item.replace(para, compact_para) | [
"def",
"process_refonly_bullet_lists",
"(",
"self",
",",
"docname",
",",
"doctree",
")",
":",
"if",
"self",
".",
"config",
".",
"html_compact_lists",
":",
"return",
"class",
"RefOnlyListChecker",
"(",
"nodes",
".",
"GenericNodeVisitor",
")",
":",
"\"\"\"Raise `nod... | https://github.com/openhatch/oh-mainline/blob/ce29352a034e1223141dcc2f317030bbc3359a51/vendor/packages/sphinx/sphinx/environment.py#L841-L900 | ||
wistbean/learn_python3_spider | 73c873f4845f4385f097e5057407d03dd37a117b | stackoverflow/venv/lib/python3.6/site-packages/twisted/protocols/loopback.py | python | collapsingPumpPolicy | (queue, target) | L{collapsingPumpPolicy} is a policy which collapses all outstanding chunks
into a single string and delivers it to the target.
@see: L{loopbackAsync} | L{collapsingPumpPolicy} is a policy which collapses all outstanding chunks
into a single string and delivers it to the target. | [
"L",
"{",
"collapsingPumpPolicy",
"}",
"is",
"a",
"policy",
"which",
"collapses",
"all",
"outstanding",
"chunks",
"into",
"a",
"single",
"string",
"and",
"delivers",
"it",
"to",
"the",
"target",
"."
] | def collapsingPumpPolicy(queue, target):
"""
L{collapsingPumpPolicy} is a policy which collapses all outstanding chunks
into a single string and delivers it to the target.
@see: L{loopbackAsync}
"""
bytes = []
while queue:
chunk = queue.get()
if chunk is None:
break
bytes.append(chunk)
if bytes:
target.dataReceived(b''.join(bytes)) | [
"def",
"collapsingPumpPolicy",
"(",
"queue",
",",
"target",
")",
":",
"bytes",
"=",
"[",
"]",
"while",
"queue",
":",
"chunk",
"=",
"queue",
".",
"get",
"(",
")",
"if",
"chunk",
"is",
"None",
":",
"break",
"bytes",
".",
"append",
"(",
"chunk",
")",
... | https://github.com/wistbean/learn_python3_spider/blob/73c873f4845f4385f097e5057407d03dd37a117b/stackoverflow/venv/lib/python3.6/site-packages/twisted/protocols/loopback.py#L130-L144 | ||
huggingface/transformers | 623b4f7c63f60cce917677ee704d6c93ee960b4b | src/transformers/models/unispeech_sat/modeling_unispeech_sat.py | python | UniSpeechSatEncoderStableLayerNorm.forward | (
self,
hidden_states,
attention_mask=None,
output_attentions=False,
output_hidden_states=False,
return_dict=True,
) | return BaseModelOutput(
last_hidden_state=hidden_states,
hidden_states=all_hidden_states,
attentions=all_self_attentions,
) | [] | def forward(
self,
hidden_states,
attention_mask=None,
output_attentions=False,
output_hidden_states=False,
return_dict=True,
):
all_hidden_states = () if output_hidden_states else None
all_self_attentions = () if output_attentions else None
if attention_mask is not None:
# make sure padded tokens are not attended to
hidden_states[~attention_mask] = 0
# extend attention_mask
attention_mask = (1.0 - attention_mask[:, None, None, :].to(dtype=hidden_states.dtype)) * -10000.0
attention_mask = attention_mask.expand(
attention_mask.shape[0], 1, attention_mask.shape[-1], attention_mask.shape[-1]
)
position_embeddings = self.pos_conv_embed(hidden_states)
hidden_states = hidden_states + position_embeddings
hidden_states = self.dropout(hidden_states)
deepspeed_zero3_is_enabled = is_deepspeed_zero3_enabled()
for layer in self.layers:
if output_hidden_states:
all_hidden_states = all_hidden_states + (hidden_states,)
# add LayerDrop (see https://arxiv.org/abs/1909.11556 for description)
dropout_probability = np.random.uniform(0, 1)
skip_the_layer = True if self.training and (dropout_probability < self.config.layerdrop) else False
if not skip_the_layer or deepspeed_zero3_is_enabled:
# under deepspeed zero3 all gpus must run in sync
# XXX: could optimize this like synced_gpus in generate_utils but not sure if it's worth the code complication
if self.gradient_checkpointing and self.training:
# create gradient checkpointing function
def create_custom_forward(module):
def custom_forward(*inputs):
return module(*inputs, output_attentions)
return custom_forward
layer_outputs = torch.utils.checkpoint.checkpoint(
create_custom_forward(layer),
hidden_states,
attention_mask,
)
else:
layer_outputs = layer(
hidden_states, attention_mask=attention_mask, output_attentions=output_attentions
)
hidden_states = layer_outputs[0]
if skip_the_layer:
layer_outputs = (None, None)
if output_attentions:
all_self_attentions = all_self_attentions + (layer_outputs[1],)
hidden_states = self.layer_norm(hidden_states)
if output_hidden_states:
all_hidden_states = all_hidden_states + (hidden_states,)
if not return_dict:
return tuple(v for v in [hidden_states, all_hidden_states, all_self_attentions] if v is not None)
return BaseModelOutput(
last_hidden_state=hidden_states,
hidden_states=all_hidden_states,
attentions=all_self_attentions,
) | [
"def",
"forward",
"(",
"self",
",",
"hidden_states",
",",
"attention_mask",
"=",
"None",
",",
"output_attentions",
"=",
"False",
",",
"output_hidden_states",
"=",
"False",
",",
"return_dict",
"=",
"True",
",",
")",
":",
"all_hidden_states",
"=",
"(",
")",
"i... | https://github.com/huggingface/transformers/blob/623b4f7c63f60cce917677ee704d6c93ee960b4b/src/transformers/models/unispeech_sat/modeling_unispeech_sat.py#L808-L882 | |||
jazdev/genreXpose | 383600a6969af5451647702ad88ed0fe07af1bf3 | genreXpose/utils.py | python | convert_any_to_wav | (filename) | Converts the input file to the WAV format. | Converts the input file to the WAV format. | [
"Converts",
"the",
"input",
"file",
"to",
"the",
"WAV",
"format",
"."
] | def convert_any_to_wav(filename):
"""
Converts the input file to the WAV format.
"""
pass | [
"def",
"convert_any_to_wav",
"(",
"filename",
")",
":",
"pass"
] | https://github.com/jazdev/genreXpose/blob/383600a6969af5451647702ad88ed0fe07af1bf3/genreXpose/utils.py#L49-L53 | ||
rhinstaller/anaconda | 63edc8680f1b05cbfe11bef28703acba808c5174 | pyanaconda/threading.py | python | ThreadManager.running | (self) | Return the number of running threads.
:returns: number of running threads
:rtype: int | Return the number of running threads. | [
"Return",
"the",
"number",
"of",
"running",
"threads",
"."
] | def running(self):
""" Return the number of running threads.
:returns: number of running threads
:rtype: int
"""
with self._objs_lock:
return len(self._objs) | [
"def",
"running",
"(",
"self",
")",
":",
"with",
"self",
".",
"_objs_lock",
":",
"return",
"len",
"(",
"self",
".",
"_objs",
")"
] | https://github.com/rhinstaller/anaconda/blob/63edc8680f1b05cbfe11bef28703acba808c5174/pyanaconda/threading.py#L173-L180 | ||
aliles/begins | 23bc0d802198831375f4286a7e22377a1a1bf952 | docs/examples/flask_quickstart.py | python | main | (host='127.0.0.1', port=8080, debug=False) | [] | def main(host='127.0.0.1', port=8080, debug=False):
app.run(host=host, port=port, debug=debug) | [
"def",
"main",
"(",
"host",
"=",
"'127.0.0.1'",
",",
"port",
"=",
"8080",
",",
"debug",
"=",
"False",
")",
":",
"app",
".",
"run",
"(",
"host",
"=",
"host",
",",
"port",
"=",
"port",
",",
"debug",
"=",
"debug",
")"
] | https://github.com/aliles/begins/blob/23bc0d802198831375f4286a7e22377a1a1bf952/docs/examples/flask_quickstart.py#L12-L13 | ||||
LinOTP/LinOTP | bb3940bbaccea99550e6c063ff824f258dd6d6d7 | linotp/controllers/error.py | python | ErrorController.document | (self) | return page | Render the error document | Render the error document | [
"Render",
"the",
"error",
"document"
] | def document(self):
"""Render the error document"""
# TODO: this will break - adjust to flask response
resp = request.environ.get("pylons.original_response")
if resp is not None:
unicode_body = str2unicode(resp.body)
content = literal(unicode_body)
else:
message = request.GET.get(
"message", request.POST.get("message", "")
)
content = escape(message)
code = request.GET.get(
"code", request.POST.get("code", str(resp.status_int))
)
page = error_document_template % dict(
prefix=request.environ.get("SCRIPT_NAME", ""),
code=escape(code),
message=content,
)
return page | [
"def",
"document",
"(",
"self",
")",
":",
"# TODO: this will break - adjust to flask response",
"resp",
"=",
"request",
".",
"environ",
".",
"get",
"(",
"\"pylons.original_response\"",
")",
"if",
"resp",
"is",
"not",
"None",
":",
"unicode_body",
"=",
"str2unicode",
... | https://github.com/LinOTP/LinOTP/blob/bb3940bbaccea99550e6c063ff824f258dd6d6d7/linotp/controllers/error.py#L45-L69 | |
mit-han-lab/data-efficient-gans | 6858275f08f43a33026844c8c2ac4e703e8a07ba | DiffAugment-biggan-cifar/layers.py | python | SN.__init__ | (self, num_svs, num_itrs, num_outputs, transpose=False, eps=1e-12) | [] | def __init__(self, num_svs, num_itrs, num_outputs, transpose=False, eps=1e-12):
# Number of power iterations per step
self.num_itrs = num_itrs
# Number of singular values
self.num_svs = num_svs
# Transposed?
self.transpose = transpose
# Epsilon value for avoiding divide-by-0
self.eps = eps
# Register a singular vector for each sv
for i in range(self.num_svs):
self.register_buffer('u%d' % i, torch.randn(1, num_outputs))
self.register_buffer('sv%d' % i, torch.ones(1)) | [
"def",
"__init__",
"(",
"self",
",",
"num_svs",
",",
"num_itrs",
",",
"num_outputs",
",",
"transpose",
"=",
"False",
",",
"eps",
"=",
"1e-12",
")",
":",
"# Number of power iterations per step",
"self",
".",
"num_itrs",
"=",
"num_itrs",
"# Number of singular values... | https://github.com/mit-han-lab/data-efficient-gans/blob/6858275f08f43a33026844c8c2ac4e703e8a07ba/DiffAugment-biggan-cifar/layers.py#L59-L71 | ||||
digidotcom/xbee-python | 0757f4be0017530c205175fbee8f9f61be9614d1 | digi/xbee/firmware.py | python | _XBeeFirmwareUpdater._check_bootloader_update_required | (self) | return self._xml_bootloader_version > self._target_bootloader_version | Checks whether the bootloader needs to be updated.
Returns:
Boolean: `True` if the bootloader needs to be updated, `False` otherwise. | Checks whether the bootloader needs to be updated. | [
"Checks",
"whether",
"the",
"bootloader",
"needs",
"to",
"be",
"updated",
"."
] | def _check_bootloader_update_required(self):
"""
Checks whether the bootloader needs to be updated.
Returns:
Boolean: `True` if the bootloader needs to be updated, `False` otherwise.
"""
# If any bootloader version is None (the XML firmware file one or the
# device one), update is not required.
if None in (self._xml_bootloader_version, self._target_bootloader_version):
return False
# At this point we can ensure both bootloader versions are not None and
# they are 3 bytes long. Since the bootloader cannot be downgraded, the
# XML specifies the minimum required bootloader version to update the
# firmware. Return `True` only if the specified XML bootloader version
# is greater than the target one.
return self._xml_bootloader_version > self._target_bootloader_version | [
"def",
"_check_bootloader_update_required",
"(",
"self",
")",
":",
"# If any bootloader version is None (the XML firmware file one or the",
"# device one), update is not required.",
"if",
"None",
"in",
"(",
"self",
".",
"_xml_bootloader_version",
",",
"self",
".",
"_target_bootlo... | https://github.com/digidotcom/xbee-python/blob/0757f4be0017530c205175fbee8f9f61be9614d1/digi/xbee/firmware.py#L2562-L2579 | |
ARM-DOE/pyart | 72affe5b669f1996cd3cc39ec7d8dd29b838bd48 | pyart/util/xsect.py | python | cross_section_rhi | (radar, target_elevations, el_tol=None) | return radar_ppi | Extract cross sections from an RHI volume along one or more elevation
angles.
Parameters
----------
radar : Radar
Radar volume containing RHI sweeps from which azimuthal
cross sections will be extracted.
target_elevations : list
Elevation angles in degrees where cross sections will be taken.
el_tol : float, optional
Elevation angle tolerance in degrees. If none the nearest angle is
used. If valid only angles within the tolerance distance are
considered.
Returns
-------
radar_ppi : Radar
Radar volume containing PPI sweeps which contain azimuthal
cross sections from the original RHI volume. | Extract cross sections from an RHI volume along one or more elevation
angles. | [
"Extract",
"cross",
"sections",
"from",
"an",
"RHI",
"volume",
"along",
"one",
"or",
"more",
"elevation",
"angles",
"."
] | def cross_section_rhi(radar, target_elevations, el_tol=None):
"""
Extract cross sections from an RHI volume along one or more elevation
angles.
Parameters
----------
radar : Radar
Radar volume containing RHI sweeps from which azimuthal
cross sections will be extracted.
target_elevations : list
Elevation angles in degrees where cross sections will be taken.
el_tol : float, optional
Elevation angle tolerance in degrees. If none the nearest angle is
used. If valid only angles within the tolerance distance are
considered.
Returns
-------
radar_ppi : Radar
Radar volume containing PPI sweeps which contain azimuthal
cross sections from the original RHI volume.
"""
# determine which rays from the rhi radar make up the pseudo PPI
pppi_rays = []
valid_elevations = []
for target_elevation in target_elevations:
for sweep_slice in radar.iter_slice():
sweep_elevations = radar.elevation['data'][sweep_slice]
d_el = np.abs(sweep_elevations - target_elevation)
if el_tol is None:
ray_number = np.argmin(d_el)
pppi_rays.append(ray_number + sweep_slice.start)
valid_elevations.append(target_elevation)
else:
d_el_min = np.min(d_el)
if d_el_min > el_tol:
warn('WARNING: No elevation found whithin tolerance '
+ 'for angle '+str(target_elevation)
+ '. Minimum distance to radar elevation '
+ str(d_el_min) + ' larger than tolerance '
+ str(el_tol))
else:
ray_number = np.argmin(d_el)
pppi_rays.append(ray_number + sweep_slice.start)
valid_elevations.append(target_elevation)
ppi_nsweeps = len(valid_elevations)
if ppi_nsweeps == 0:
raise ValueError('No elevation found within tolerance')
radar_ppi = _construct_xsect_radar(
radar, 'ppi', pppi_rays, ppi_nsweeps, valid_elevations)
return radar_ppi | [
"def",
"cross_section_rhi",
"(",
"radar",
",",
"target_elevations",
",",
"el_tol",
"=",
"None",
")",
":",
"# determine which rays from the rhi radar make up the pseudo PPI",
"pppi_rays",
"=",
"[",
"]",
"valid_elevations",
"=",
"[",
"]",
"for",
"target_elevation",
"in",
... | https://github.com/ARM-DOE/pyart/blob/72affe5b669f1996cd3cc39ec7d8dd29b838bd48/pyart/util/xsect.py#L70-L126 | |
dmlc/dgl | 8d14a739bc9e446d6c92ef83eafe5782398118de | python/dgl/data/citation_graph.py | python | load_citeseer | (raw_dir=None, force_reload=False, verbose=True, reverse_edge=True) | return data | Get CiteseerGraphDataset
Parameters
-----------
raw_dir : str
Raw file directory to download/contains the input data directory.
Default: ~/.dgl/
force_reload : bool
Whether to reload the dataset. Default: False
verbose: bool
Whether to print out progress information. Default: True.
reverse_edge: bool
Whether to add reverse edges in graph. Default: True.
Return
-------
CiteseerGraphDataset | Get CiteseerGraphDataset | [
"Get",
"CiteseerGraphDataset"
] | def load_citeseer(raw_dir=None, force_reload=False, verbose=True, reverse_edge=True):
"""Get CiteseerGraphDataset
Parameters
-----------
raw_dir : str
Raw file directory to download/contains the input data directory.
Default: ~/.dgl/
force_reload : bool
Whether to reload the dataset. Default: False
verbose: bool
Whether to print out progress information. Default: True.
reverse_edge: bool
Whether to add reverse edges in graph. Default: True.
Return
-------
CiteseerGraphDataset
"""
data = CiteseerGraphDataset(raw_dir, force_reload, verbose, reverse_edge)
return data | [
"def",
"load_citeseer",
"(",
"raw_dir",
"=",
"None",
",",
"force_reload",
"=",
"False",
",",
"verbose",
"=",
"True",
",",
"reverse_edge",
"=",
"True",
")",
":",
"data",
"=",
"CiteseerGraphDataset",
"(",
"raw_dir",
",",
"force_reload",
",",
"verbose",
",",
... | https://github.com/dmlc/dgl/blob/8d14a739bc9e446d6c92ef83eafe5782398118de/python/dgl/data/citation_graph.py#L739-L759 | |
pyrogram/pyrogram | e67fd6efbb93e5ba6307fe4c20ea8051c5583d85 | pyrogram/methods/invite_links/export_chat_invite_link.py | python | ExportChatInviteLink.export_chat_invite_link | (
self,
chat_id: Union[int, str],
) | return r.link | Generate a new primary invite link for a chat; any previously generated primary link is revoked.
You must be an administrator in the chat for this to work and must have the appropriate admin rights.
.. note ::
Each administrator in a chat generates their own invite links. Bots can't use invite links generated by
other administrators. If you want your bot to work with invite links, it will need to generate its own link
using this method – after this the link will become available to the bot via the
:meth:`~pyrogram.Client.get_chat` method. If your bot needs to generate a new invite link replacing its
previous one, use this method again.
Parameters:
chat_id (``int`` | ``str``):
Unique identifier for the target chat or username of the target channel/supergroup
(in the format @username).
Returns:
``str``: On success, the new invite link as string is returned.
Example:
.. code-block:: python
# Generate a new primary link
link = app.export_chat_invite_link(chat_id) | Generate a new primary invite link for a chat; any previously generated primary link is revoked. | [
"Generate",
"a",
"new",
"primary",
"invite",
"link",
"for",
"a",
"chat",
";",
"any",
"previously",
"generated",
"primary",
"link",
"is",
"revoked",
"."
] | async def export_chat_invite_link(
self,
chat_id: Union[int, str],
) -> "types.ChatInviteLink":
"""Generate a new primary invite link for a chat; any previously generated primary link is revoked.
You must be an administrator in the chat for this to work and must have the appropriate admin rights.
.. note ::
Each administrator in a chat generates their own invite links. Bots can't use invite links generated by
other administrators. If you want your bot to work with invite links, it will need to generate its own link
using this method – after this the link will become available to the bot via the
:meth:`~pyrogram.Client.get_chat` method. If your bot needs to generate a new invite link replacing its
previous one, use this method again.
Parameters:
chat_id (``int`` | ``str``):
Unique identifier for the target chat or username of the target channel/supergroup
(in the format @username).
Returns:
``str``: On success, the new invite link as string is returned.
Example:
.. code-block:: python
# Generate a new primary link
link = app.export_chat_invite_link(chat_id)
"""
r = await self.send(
raw.functions.messages.ExportChatInvite(
peer=await self.resolve_peer(chat_id),
legacy_revoke_permanent=True
)
)
return r.link | [
"async",
"def",
"export_chat_invite_link",
"(",
"self",
",",
"chat_id",
":",
"Union",
"[",
"int",
",",
"str",
"]",
",",
")",
"->",
"\"types.ChatInviteLink\"",
":",
"r",
"=",
"await",
"self",
".",
"send",
"(",
"raw",
".",
"functions",
".",
"messages",
"."... | https://github.com/pyrogram/pyrogram/blob/e67fd6efbb93e5ba6307fe4c20ea8051c5583d85/pyrogram/methods/invite_links/export_chat_invite_link.py#L27-L63 | |
hkust-vgd/scanobjectnn | fe60aeade9ceb8882bc3f1bc40612e65469d7e77 | pointnet/utils/tf_util.py | python | _variable_on_cpu | (name, shape, initializer, use_fp16=False) | return var | Helper to create a Variable stored on CPU memory.
Args:
name: name of the variable
shape: list of ints
initializer: initializer for Variable
Returns:
Variable Tensor | Helper to create a Variable stored on CPU memory.
Args:
name: name of the variable
shape: list of ints
initializer: initializer for Variable
Returns:
Variable Tensor | [
"Helper",
"to",
"create",
"a",
"Variable",
"stored",
"on",
"CPU",
"memory",
".",
"Args",
":",
"name",
":",
"name",
"of",
"the",
"variable",
"shape",
":",
"list",
"of",
"ints",
"initializer",
":",
"initializer",
"for",
"Variable",
"Returns",
":",
"Variable"... | def _variable_on_cpu(name, shape, initializer, use_fp16=False):
"""Helper to create a Variable stored on CPU memory.
Args:
name: name of the variable
shape: list of ints
initializer: initializer for Variable
Returns:
Variable Tensor
"""
with tf.device('/cpu:0'):
dtype = tf.float16 if use_fp16 else tf.float32
var = tf.get_variable(name, shape, initializer=initializer, dtype=dtype)
return var | [
"def",
"_variable_on_cpu",
"(",
"name",
",",
"shape",
",",
"initializer",
",",
"use_fp16",
"=",
"False",
")",
":",
"with",
"tf",
".",
"device",
"(",
"'/cpu:0'",
")",
":",
"dtype",
"=",
"tf",
".",
"float16",
"if",
"use_fp16",
"else",
"tf",
".",
"float32... | https://github.com/hkust-vgd/scanobjectnn/blob/fe60aeade9ceb8882bc3f1bc40612e65469d7e77/pointnet/utils/tf_util.py#L10-L22 | |
amimo/dcc | 114326ab5a082a42c7728a375726489e4709ca29 | androguard/core/bytecodes/apk.py | python | APK._get_crc32 | (self, filename) | return buffer | Calculates and compares the CRC32 and returns the raw buffer.
The CRC32 is added to `files_crc32` dictionary, if not present.
:param filename: filename inside the zipfile
:rtype: bytes | Calculates and compares the CRC32 and returns the raw buffer. | [
"Calculates",
"and",
"compares",
"the",
"CRC32",
"and",
"returns",
"the",
"raw",
"buffer",
"."
] | def _get_crc32(self, filename):
"""
Calculates and compares the CRC32 and returns the raw buffer.
The CRC32 is added to `files_crc32` dictionary, if not present.
:param filename: filename inside the zipfile
:rtype: bytes
"""
buffer = self.zip.read(filename)
if filename not in self.files_crc32:
self.files_crc32[filename] = crc32(buffer)
if self.files_crc32[filename] != self.zip.getinfo(filename).CRC:
log.error("File '{}' has different CRC32 after unpacking! "
"Declared: {:08x}, Calculated: {:08x}".format(filename,
self.zip.getinfo(filename).CRC,
self.files_crc32[filename]))
return buffer | [
"def",
"_get_crc32",
"(",
"self",
",",
"filename",
")",
":",
"buffer",
"=",
"self",
".",
"zip",
".",
"read",
"(",
"filename",
")",
"if",
"filename",
"not",
"in",
"self",
".",
"files_crc32",
":",
"self",
".",
"files_crc32",
"[",
"filename",
"]",
"=",
... | https://github.com/amimo/dcc/blob/114326ab5a082a42c7728a375726489e4709ca29/androguard/core/bytecodes/apk.py#L715-L732 | |
StyraHem/ShellyForHASS | 902c04ab25b0a7667718eeef53bb6ad43614fe2f | custom_components/shelly/device.py | python | ShellyDevice.name | (self) | return name | Return the display name of this device. | Return the display name of this device. | [
"Return",
"the",
"display",
"name",
"of",
"this",
"device",
"."
] | def name(self):
"""Return the display name of this device."""
if self._name is None:
name = self._dev.friendly_name()
else:
name = self._name
if self._name_ext:
name += ' - ' + self._name_ext
if self._show_id_in_name:
name += " [" + self._dev.id + "]"
return name | [
"def",
"name",
"(",
"self",
")",
":",
"if",
"self",
".",
"_name",
"is",
"None",
":",
"name",
"=",
"self",
".",
"_dev",
".",
"friendly_name",
"(",
")",
"else",
":",
"name",
"=",
"self",
".",
"_name",
"if",
"self",
".",
"_name_ext",
":",
"name",
"+... | https://github.com/StyraHem/ShellyForHASS/blob/902c04ab25b0a7667718eeef53bb6ad43614fe2f/custom_components/shelly/device.py#L77-L87 | |
graalvm/mx | 29c0debab406352df3af246be2f8973be5db69ae | mx_ide_eclipse.py | python | _add_eclipse_linked_resources | (xml_doc, project_loc, linked_resources, absolutePaths=False) | Adds a ``linkedResources`` element to `xml_doc` for the resources described by `linked_resources`.
:param project_loc: directory containing ``.project`` file containing the content of `xml_doc` | Adds a ``linkedResources`` element to `xml_doc` for the resources described by `linked_resources`. | [
"Adds",
"a",
"linkedResources",
"element",
"to",
"xml_doc",
"for",
"the",
"resources",
"described",
"by",
"linked_resources",
"."
] | def _add_eclipse_linked_resources(xml_doc, project_loc, linked_resources, absolutePaths=False):
"""
Adds a ``linkedResources`` element to `xml_doc` for the resources described by `linked_resources`.
:param project_loc: directory containing ``.project`` file containing the content of `xml_doc`
"""
if linked_resources:
xml_doc.open('linkedResources')
for lr in linked_resources:
xml_doc.open('link')
xml_doc.element('name', data=lr.name)
xml_doc.element('type', data=lr.type)
xml_doc.element('locationURI', data=get_eclipse_project_rel_locationURI(lr.location, project_loc) if not absolutePaths else lr.location)
xml_doc.close('link')
xml_doc.close('linkedResources') | [
"def",
"_add_eclipse_linked_resources",
"(",
"xml_doc",
",",
"project_loc",
",",
"linked_resources",
",",
"absolutePaths",
"=",
"False",
")",
":",
"if",
"linked_resources",
":",
"xml_doc",
".",
"open",
"(",
"'linkedResources'",
")",
"for",
"lr",
"in",
"linked_reso... | https://github.com/graalvm/mx/blob/29c0debab406352df3af246be2f8973be5db69ae/mx_ide_eclipse.py#L552-L566 | ||
funnyzhou/FPN-Pytorch | 423a4499c4e826d17367762e821b51b9b1b0f2f3 | tools/download_imagenet_weights.py | python | parse_args | () | return parser.parse_args() | Parser command line argumnets | Parser command line argumnets | [
"Parser",
"command",
"line",
"argumnets"
] | def parse_args():
"""Parser command line argumnets"""
parser = argparse.ArgumentParser(formatter_class=ColorHelpFormatter)
parser.add_argument('--output_dir', help='Directory to save downloaded weight files',
default=os.path.join(cfg.DATA_DIR, 'pretrained_model'))
parser.add_argument('-t', '--targets', nargs='+', metavar='file_name',
help='Files to download. Allowed values are: ' +
', '.join(map(lambda s: Fore.YELLOW + s + Fore.RESET,
list(PRETRAINED_WEIGHTS.keys()))),
choices=list(PRETRAINED_WEIGHTS.keys()),
default=list(PRETRAINED_WEIGHTS.keys()))
return parser.parse_args() | [
"def",
"parse_args",
"(",
")",
":",
"parser",
"=",
"argparse",
".",
"ArgumentParser",
"(",
"formatter_class",
"=",
"ColorHelpFormatter",
")",
"parser",
".",
"add_argument",
"(",
"'--output_dir'",
",",
"help",
"=",
"'Directory to save downloaded weight files'",
",",
... | https://github.com/funnyzhou/FPN-Pytorch/blob/423a4499c4e826d17367762e821b51b9b1b0f2f3/tools/download_imagenet_weights.py#L17-L28 | |
cdhigh/KindleEar | 7c4ecf9625239f12a829210d1760b863ef5a23aa | lib/calibre/ebooks/oeb/base.py | python | TOC.add | (self, title, href, klass=None, id=None, play_order=0, author=None, description=None, toc_thumbnail=None) | return node | Create and return a new sub-node of this node. | Create and return a new sub-node of this node. | [
"Create",
"and",
"return",
"a",
"new",
"sub",
"-",
"node",
"of",
"this",
"node",
"."
] | def add(self, title, href, klass=None, id=None, play_order=0, author=None, description=None, toc_thumbnail=None):
"""Create and return a new sub-node of this node."""
node = TOC(title, href, klass, id, play_order, author, description, toc_thumbnail)
self.nodes.append(node)
return node | [
"def",
"add",
"(",
"self",
",",
"title",
",",
"href",
",",
"klass",
"=",
"None",
",",
"id",
"=",
"None",
",",
"play_order",
"=",
"0",
",",
"author",
"=",
"None",
",",
"description",
"=",
"None",
",",
"toc_thumbnail",
"=",
"None",
")",
":",
"node",
... | https://github.com/cdhigh/KindleEar/blob/7c4ecf9625239f12a829210d1760b863ef5a23aa/lib/calibre/ebooks/oeb/base.py#L1397-L1401 | |
caffeinehit/django-oauth2-provider | 6b5bc0d3ad706d2aaa47fa476f38406cddd01236 | provider/views.py | python | AccessToken.invalidate_refresh_token | (self, refresh_token) | Override to handle refresh token invalidation. When requesting a new
access token from a refresh token, the old one is *always* invalidated.
:return None: | Override to handle refresh token invalidation. When requesting a new
access token from a refresh token, the old one is *always* invalidated. | [
"Override",
"to",
"handle",
"refresh",
"token",
"invalidation",
".",
"When",
"requesting",
"a",
"new",
"access",
"token",
"from",
"a",
"refresh",
"token",
"the",
"old",
"one",
"is",
"*",
"always",
"*",
"invalidated",
"."
] | def invalidate_refresh_token(self, refresh_token):
"""
Override to handle refresh token invalidation. When requesting a new
access token from a refresh token, the old one is *always* invalidated.
:return None:
"""
raise NotImplementedError | [
"def",
"invalidate_refresh_token",
"(",
"self",
",",
"refresh_token",
")",
":",
"raise",
"NotImplementedError"
] | https://github.com/caffeinehit/django-oauth2-provider/blob/6b5bc0d3ad706d2aaa47fa476f38406cddd01236/provider/views.py#L442-L449 | ||
smart-mobile-software/gitstack | d9fee8f414f202143eb6e620529e8e5539a2af56 | python/Lib/site-packages/django/contrib/gis/db/models/query.py | python | GeoQuerySet.intersection | (self, geom, **kwargs) | return self._geomset_attribute('intersection', geom, **kwargs) | Returns the spatial intersection of the Geometry field in
an `intersection` attribute on each element of this
GeoQuerySet. | Returns the spatial intersection of the Geometry field in
an `intersection` attribute on each element of this
GeoQuerySet. | [
"Returns",
"the",
"spatial",
"intersection",
"of",
"the",
"Geometry",
"field",
"in",
"an",
"intersection",
"attribute",
"on",
"each",
"element",
"of",
"this",
"GeoQuerySet",
"."
] | def intersection(self, geom, **kwargs):
"""
Returns the spatial intersection of the Geometry field in
an `intersection` attribute on each element of this
GeoQuerySet.
"""
return self._geomset_attribute('intersection', geom, **kwargs) | [
"def",
"intersection",
"(",
"self",
",",
"geom",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"self",
".",
"_geomset_attribute",
"(",
"'intersection'",
",",
"geom",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/smart-mobile-software/gitstack/blob/d9fee8f414f202143eb6e620529e8e5539a2af56/python/Lib/site-packages/django/contrib/gis/db/models/query.py#L200-L206 | |
microsoft/azure-devops-python-api | 451cade4c475482792cbe9e522c1fee32393139e | azure-devops/azure/devops/v5_1/git/git_client_base.py | python | GitClientBase.create_pull_request | (self, git_pull_request_to_create, repository_id, project=None, supports_iterations=None) | return self._deserialize('GitPullRequest', response) | CreatePullRequest.
Create a pull request.
:param :class:`<GitPullRequest> <azure.devops.v5_1.git.models.GitPullRequest>` git_pull_request_to_create: The pull request to create.
:param str repository_id: The repository ID of the pull request's target branch.
:param str project: Project ID or project name
:param bool supports_iterations: If true, subsequent pushes to the pull request will be individually reviewable. Set this to false for large pull requests for performance reasons if this functionality is not needed.
:rtype: :class:`<GitPullRequest> <azure.devops.v5_1.git.models.GitPullRequest>` | CreatePullRequest.
Create a pull request.
:param :class:`<GitPullRequest> <azure.devops.v5_1.git.models.GitPullRequest>` git_pull_request_to_create: The pull request to create.
:param str repository_id: The repository ID of the pull request's target branch.
:param str project: Project ID or project name
:param bool supports_iterations: If true, subsequent pushes to the pull request will be individually reviewable. Set this to false for large pull requests for performance reasons if this functionality is not needed.
:rtype: :class:`<GitPullRequest> <azure.devops.v5_1.git.models.GitPullRequest>` | [
"CreatePullRequest",
".",
"Create",
"a",
"pull",
"request",
".",
":",
"param",
":",
"class",
":",
"<GitPullRequest",
">",
"<azure",
".",
"devops",
".",
"v5_1",
".",
"git",
".",
"models",
".",
"GitPullRequest",
">",
"git_pull_request_to_create",
":",
"The",
"... | def create_pull_request(self, git_pull_request_to_create, repository_id, project=None, supports_iterations=None):
"""CreatePullRequest.
Create a pull request.
:param :class:`<GitPullRequest> <azure.devops.v5_1.git.models.GitPullRequest>` git_pull_request_to_create: The pull request to create.
:param str repository_id: The repository ID of the pull request's target branch.
:param str project: Project ID or project name
:param bool supports_iterations: If true, subsequent pushes to the pull request will be individually reviewable. Set this to false for large pull requests for performance reasons if this functionality is not needed.
:rtype: :class:`<GitPullRequest> <azure.devops.v5_1.git.models.GitPullRequest>`
"""
route_values = {}
if project is not None:
route_values['project'] = self._serialize.url('project', project, 'str')
if repository_id is not None:
route_values['repositoryId'] = self._serialize.url('repository_id', repository_id, 'str')
query_parameters = {}
if supports_iterations is not None:
query_parameters['supportsIterations'] = self._serialize.query('supports_iterations', supports_iterations, 'bool')
content = self._serialize.body(git_pull_request_to_create, 'GitPullRequest')
response = self._send(http_method='POST',
location_id='9946fd70-0d40-406e-b686-b4744cbbcc37',
version='5.1',
route_values=route_values,
query_parameters=query_parameters,
content=content)
return self._deserialize('GitPullRequest', response) | [
"def",
"create_pull_request",
"(",
"self",
",",
"git_pull_request_to_create",
",",
"repository_id",
",",
"project",
"=",
"None",
",",
"supports_iterations",
"=",
"None",
")",
":",
"route_values",
"=",
"{",
"}",
"if",
"project",
"is",
"not",
"None",
":",
"route... | https://github.com/microsoft/azure-devops-python-api/blob/451cade4c475482792cbe9e522c1fee32393139e/azure-devops/azure/devops/v5_1/git/git_client_base.py#L2066-L2090 | |
osmr/imgclsmob | f2993d3ce73a2f7ddba05da3891defb08547d504 | pytorch/pytorchcv/models/drn.py | python | drnc58 | (**kwargs) | return get_drn(blocks=58, model_name="drnc58", **kwargs) | DRN-C-58 model from 'Dilated Residual Networks,' https://arxiv.org/abs/1705.09914.
Parameters:
----------
pretrained : bool, default False
Whether to load the pretrained weights for model.
root : str, default '~/.torch/models'
Location for keeping the model parameters. | DRN-C-58 model from 'Dilated Residual Networks,' https://arxiv.org/abs/1705.09914. | [
"DRN",
"-",
"C",
"-",
"58",
"model",
"from",
"Dilated",
"Residual",
"Networks",
"https",
":",
"//",
"arxiv",
".",
"org",
"/",
"abs",
"/",
"1705",
".",
"09914",
"."
] | def drnc58(**kwargs):
"""
DRN-C-58 model from 'Dilated Residual Networks,' https://arxiv.org/abs/1705.09914.
Parameters:
----------
pretrained : bool, default False
Whether to load the pretrained weights for model.
root : str, default '~/.torch/models'
Location for keeping the model parameters.
"""
return get_drn(blocks=58, model_name="drnc58", **kwargs) | [
"def",
"drnc58",
"(",
"*",
"*",
"kwargs",
")",
":",
"return",
"get_drn",
"(",
"blocks",
"=",
"58",
",",
"model_name",
"=",
"\"drnc58\"",
",",
"*",
"*",
"kwargs",
")"
] | https://github.com/osmr/imgclsmob/blob/f2993d3ce73a2f7ddba05da3891defb08547d504/pytorch/pytorchcv/models/drn.py#L516-L527 | |
dimagi/commcare-hq | d67ff1d3b4c51fa050c19e60c3253a79d3452a39 | corehq/apps/reports/lookup.py | python | get_full_report_name | (report) | return report.__module__ + '.' + report.__name__ | [] | def get_full_report_name(report):
if not report:
return ''
return report.__module__ + '.' + report.__name__ | [
"def",
"get_full_report_name",
"(",
"report",
")",
":",
"if",
"not",
"report",
":",
"return",
"''",
"return",
"report",
".",
"__module__",
"+",
"'.'",
"+",
"report",
".",
"__name__"
] | https://github.com/dimagi/commcare-hq/blob/d67ff1d3b4c51fa050c19e60c3253a79d3452a39/corehq/apps/reports/lookup.py#L54-L58 | |||
holzschu/Carnets | 44effb10ddfc6aa5c8b0687582a724ba82c6b547 | Library/lib/python3.7/site-packages/pip/_vendor/pyparsing.py | python | originalTextFor | (expr, asString=True) | return matchExpr | Helper to return the original, untokenized text for a given
expression. Useful to restore the parsed fields of an HTML start
tag into the raw tag text itself, or to revert separate tokens with
intervening whitespace back to the original matching input text. By
default, returns astring containing the original parsed text.
If the optional ``asString`` argument is passed as
``False``, then the return value is
a :class:`ParseResults` containing any results names that
were originally matched, and a single token containing the original
matched text from the input string. So if the expression passed to
:class:`originalTextFor` contains expressions with defined
results names, you must set ``asString`` to ``False`` if you
want to preserve those results name values.
Example::
src = "this is test <b> bold <i>text</i> </b> normal text "
for tag in ("b","i"):
opener,closer = makeHTMLTags(tag)
patt = originalTextFor(opener + SkipTo(closer) + closer)
print(patt.searchString(src)[0])
prints::
['<b> bold <i>text</i> </b>']
['<i>text</i>'] | Helper to return the original, untokenized text for a given
expression. Useful to restore the parsed fields of an HTML start
tag into the raw tag text itself, or to revert separate tokens with
intervening whitespace back to the original matching input text. By
default, returns astring containing the original parsed text. | [
"Helper",
"to",
"return",
"the",
"original",
"untokenized",
"text",
"for",
"a",
"given",
"expression",
".",
"Useful",
"to",
"restore",
"the",
"parsed",
"fields",
"of",
"an",
"HTML",
"start",
"tag",
"into",
"the",
"raw",
"tag",
"text",
"itself",
"or",
"to",... | def originalTextFor(expr, asString=True):
"""Helper to return the original, untokenized text for a given
expression. Useful to restore the parsed fields of an HTML start
tag into the raw tag text itself, or to revert separate tokens with
intervening whitespace back to the original matching input text. By
default, returns astring containing the original parsed text.
If the optional ``asString`` argument is passed as
``False``, then the return value is
a :class:`ParseResults` containing any results names that
were originally matched, and a single token containing the original
matched text from the input string. So if the expression passed to
:class:`originalTextFor` contains expressions with defined
results names, you must set ``asString`` to ``False`` if you
want to preserve those results name values.
Example::
src = "this is test <b> bold <i>text</i> </b> normal text "
for tag in ("b","i"):
opener,closer = makeHTMLTags(tag)
patt = originalTextFor(opener + SkipTo(closer) + closer)
print(patt.searchString(src)[0])
prints::
['<b> bold <i>text</i> </b>']
['<i>text</i>']
"""
locMarker = Empty().setParseAction(lambda s,loc,t: loc)
endlocMarker = locMarker.copy()
endlocMarker.callPreparse = False
matchExpr = locMarker("_original_start") + expr + endlocMarker("_original_end")
if asString:
extractText = lambda s,l,t: s[t._original_start:t._original_end]
else:
def extractText(s,l,t):
t[:] = [s[t.pop('_original_start'):t.pop('_original_end')]]
matchExpr.setParseAction(extractText)
matchExpr.ignoreExprs = expr.ignoreExprs
return matchExpr | [
"def",
"originalTextFor",
"(",
"expr",
",",
"asString",
"=",
"True",
")",
":",
"locMarker",
"=",
"Empty",
"(",
")",
".",
"setParseAction",
"(",
"lambda",
"s",
",",
"loc",
",",
"t",
":",
"loc",
")",
"endlocMarker",
"=",
"locMarker",
".",
"copy",
"(",
... | https://github.com/holzschu/Carnets/blob/44effb10ddfc6aa5c8b0687582a724ba82c6b547/Library/lib/python3.7/site-packages/pip/_vendor/pyparsing.py#L5173-L5213 | |
zatosource/zato | 2a9d273f06f9d776fbfeb53e73855af6e40fa208 | code/zato-server/src/zato/server/connection/connector/subprocess_/base.py | python | BaseConnectionContainer.handle_http_request | (self, path, msg, ok=b'OK') | Dispatches incoming HTTP requests - either reconfigures the connector or puts messages to queues. | Dispatches incoming HTTP requests - either reconfigures the connector or puts messages to queues. | [
"Dispatches",
"incoming",
"HTTP",
"requests",
"-",
"either",
"reconfigures",
"the",
"connector",
"or",
"puts",
"messages",
"to",
"queues",
"."
] | def handle_http_request(self, path, msg, ok=b'OK'):
""" Dispatches incoming HTTP requests - either reconfigures the connector or puts messages to queues.
"""
self.logger.info('MSG received %s %s', path, msg)
if path == _path_ping:
return Response()
else:
msg = msg.decode('utf8')
msg = loads(msg)
msg = bunchify(msg)
# Delete what handlers don't need
msg.pop('msg_type', None) # Optional if message was sent by a server that is starting up vs. API call
action = msg.pop('action')
handler = getattr(self, '_on_{}'.format(code_to_name[action]))
return handler(msg) | [
"def",
"handle_http_request",
"(",
"self",
",",
"path",
",",
"msg",
",",
"ok",
"=",
"b'OK'",
")",
":",
"self",
".",
"logger",
".",
"info",
"(",
"'MSG received %s %s'",
",",
"path",
",",
"msg",
")",
"if",
"path",
"==",
"_path_ping",
":",
"return",
"Resp... | https://github.com/zatosource/zato/blob/2a9d273f06f9d776fbfeb53e73855af6e40fa208/code/zato-server/src/zato/server/connection/connector/subprocess_/base.py#L415-L432 | ||
dfunckt/django-rules | 2b79375a8ca2f4a2ded97feba0411f837ae7f80b | rules/contrib/models.py | python | RulesModelMixin.get_perm | (cls, perm_type) | return "%s.%s_%s" % (cls._meta.app_label, perm_type, cls._meta.model_name) | Converts permission type ("add") to permission name ("app.add_modelname")
:param perm_type: "add", "change", etc., or custom value
:type perm_type: str
:returns str: | Converts permission type ("add") to permission name ("app.add_modelname") | [
"Converts",
"permission",
"type",
"(",
"add",
")",
"to",
"permission",
"name",
"(",
"app",
".",
"add_modelname",
")"
] | def get_perm(cls, perm_type):
"""Converts permission type ("add") to permission name ("app.add_modelname")
:param perm_type: "add", "change", etc., or custom value
:type perm_type: str
:returns str:
"""
return "%s.%s_%s" % (cls._meta.app_label, perm_type, cls._meta.model_name) | [
"def",
"get_perm",
"(",
"cls",
",",
"perm_type",
")",
":",
"return",
"\"%s.%s_%s\"",
"%",
"(",
"cls",
".",
"_meta",
".",
"app_label",
",",
"perm_type",
",",
"cls",
".",
"_meta",
".",
"model_name",
")"
] | https://github.com/dfunckt/django-rules/blob/2b79375a8ca2f4a2ded97feba0411f837ae7f80b/rules/contrib/models.py#L59-L66 | |
CedricGuillemet/Imogen | ee417b42747ed5b46cb11b02ef0c3630000085b3 | bin/Lib/lib2to3/refactor.py | python | RefactoringTool.print_output | (self, old_text, new_text, filename, equal) | Called with the old version, new version, and filename of a
refactored file. | Called with the old version, new version, and filename of a
refactored file. | [
"Called",
"with",
"the",
"old",
"version",
"new",
"version",
"and",
"filename",
"of",
"a",
"refactored",
"file",
"."
] | def print_output(self, old_text, new_text, filename, equal):
"""Called with the old version, new version, and filename of a
refactored file."""
pass | [
"def",
"print_output",
"(",
"self",
",",
"old_text",
",",
"new_text",
",",
"filename",
",",
"equal",
")",
":",
"pass"
] | https://github.com/CedricGuillemet/Imogen/blob/ee417b42747ed5b46cb11b02ef0c3630000085b3/bin/Lib/lib2to3/refactor.py#L270-L273 | ||
tp4a/teleport | 1fafd34f1f775d2cf80ea4af6e44468d8e0b24ad | server/www/packages/packages-darwin/x64/mako/exceptions.py | python | RichTraceback.traceback | (self) | return list(self._get_reformatted_records(self.records)) | Return a list of 4-tuple traceback records (i.e. normal python
format) with template-corresponding lines remapped to the originating
template. | Return a list of 4-tuple traceback records (i.e. normal python
format) with template-corresponding lines remapped to the originating
template. | [
"Return",
"a",
"list",
"of",
"4",
"-",
"tuple",
"traceback",
"records",
"(",
"i",
".",
"e",
".",
"normal",
"python",
"format",
")",
"with",
"template",
"-",
"corresponding",
"lines",
"remapped",
"to",
"the",
"originating",
"template",
"."
] | def traceback(self):
"""Return a list of 4-tuple traceback records (i.e. normal python
format) with template-corresponding lines remapped to the originating
template.
"""
return list(self._get_reformatted_records(self.records)) | [
"def",
"traceback",
"(",
"self",
")",
":",
"return",
"list",
"(",
"self",
".",
"_get_reformatted_records",
"(",
"self",
".",
"records",
")",
")"
] | https://github.com/tp4a/teleport/blob/1fafd34f1f775d2cf80ea4af6e44468d8e0b24ad/server/www/packages/packages-darwin/x64/mako/exceptions.py#L128-L134 | |
bwohlberg/sporco | df67462abcf83af6ab1961bcb0d51b87a66483fa | sporco/admm/admm.py | python | ADMMConsensus.rsdl_rn | (self, AX, Y) | return max((np.linalg.norm(AX), np.sqrt(self.Nb) * np.linalg.norm(Y))) | Compute primal residual normalisation term. | Compute primal residual normalisation term. | [
"Compute",
"primal",
"residual",
"normalisation",
"term",
"."
] | def rsdl_rn(self, AX, Y):
"""Compute primal residual normalisation term."""
# The primal residual normalisation term is
# max( ||A x^(k)||_2, ||B y^(k)||_2 ) and B = -(I I I ...)^T.
# The scaling by sqrt(Nb) of the l2 norm of Y accounts for the
# block replication introduced by multiplication by B
return max((np.linalg.norm(AX), np.sqrt(self.Nb) * np.linalg.norm(Y))) | [
"def",
"rsdl_rn",
"(",
"self",
",",
"AX",
",",
"Y",
")",
":",
"# The primal residual normalisation term is",
"# max( ||A x^(k)||_2, ||B y^(k)||_2 ) and B = -(I I I ...)^T.",
"# The scaling by sqrt(Nb) of the l2 norm of Y accounts for the",
"# block replication introduced by multiplication ... | https://github.com/bwohlberg/sporco/blob/df67462abcf83af6ab1961bcb0d51b87a66483fa/sporco/admm/admm.py#L1693-L1700 | |
jython/frozen-mirror | b8d7aa4cee50c0c0fe2f4b235dd62922dd0f3f99 | src/shell/jython.py | python | parse_launcher_args | (args) | return parsed, unparsed | Process the given argument list into two objects, the first part being
a namespace of checked arguments to the interpreter itself, and the rest
being the Python program it will run and its arguments. | Process the given argument list into two objects, the first part being
a namespace of checked arguments to the interpreter itself, and the rest
being the Python program it will run and its arguments. | [
"Process",
"the",
"given",
"argument",
"list",
"into",
"two",
"objects",
"the",
"first",
"part",
"being",
"a",
"namespace",
"of",
"checked",
"arguments",
"to",
"the",
"interpreter",
"itself",
"and",
"the",
"rest",
"being",
"the",
"Python",
"program",
"it",
"... | def parse_launcher_args(args):
""" Process the given argument list into two objects, the first part being
a namespace of checked arguments to the interpreter itself, and the rest
being the Python program it will run and its arguments.
"""
class Namespace(object):
pass
parsed = Namespace()
parsed.boot = False # --boot flag given
parsed.jdb = False # --jdb flag given
parsed.help = False # --help or -h flag given
parsed.print_requested = False # --print flag given
parsed.profile = False # --profile flag given
parsed.properties = OrderedDict() # properties to give the JVM
parsed.java = [] # any other arguments to give the JVM
unparsed = list()
it = iter(args)
next(it) # ignore sys.argv[0]
i = 1
while True:
try:
arg = next(it)
except StopIteration:
break
if arg.startswith(u"-D"):
k, v = arg[2:].split(u"=")
parsed.properties[k] = v
i += 1
elif arg in (u"-J-classpath", u"-J-cp"):
try:
next_arg = next(it)
except StopIteration:
bad_option("Argument expected for -J-classpath option")
if next_arg.startswith("-"):
bad_option("Bad option for -J-classpath")
parsed.classpath = next_arg
i += 2
elif arg.startswith(u"-J-Xmx"):
parsed.mem = arg[2:]
i += 1
elif arg.startswith(u"-J-Xss"):
parsed.stack = arg[2:]
i += 1
elif arg.startswith(u"-J"):
parsed.java.append(arg[2:])
i += 1
elif arg == u"--print":
parsed.print_requested = True
i += 1
elif arg in (u"-h", u"--help"):
parsed.help = True
elif arg in (u"--boot", u"--jdb", u"--profile"):
setattr(parsed, arg[2:], True)
i += 1
elif len(arg) >= 2 and arg[0] == u'-' and arg[1] in u"BEisSuvV3":
unparsed.append(arg)
i += 1
elif arg == u"--":
i += 1
break
else:
break
unparsed.extend(args[i:])
return parsed, unparsed | [
"def",
"parse_launcher_args",
"(",
"args",
")",
":",
"class",
"Namespace",
"(",
"object",
")",
":",
"pass",
"parsed",
"=",
"Namespace",
"(",
")",
"parsed",
".",
"boot",
"=",
"False",
"# --boot flag given",
"parsed",
".",
"jdb",
"=",
"False",
"# --jdb flag gi... | https://github.com/jython/frozen-mirror/blob/b8d7aa4cee50c0c0fe2f4b235dd62922dd0f3f99/src/shell/jython.py#L90-L155 | |
python/cpython | e13cdca0f5224ec4e23bdd04bb3120506964bc8b | Lib/logging/handlers.py | python | QueueListener.stop | (self) | Stop the listener.
This asks the thread to terminate, and then waits for it to do so.
Note that if you don't call this before your application exits, there
may be some records still left on the queue, which won't be processed. | Stop the listener. | [
"Stop",
"the",
"listener",
"."
] | def stop(self):
"""
Stop the listener.
This asks the thread to terminate, and then waits for it to do so.
Note that if you don't call this before your application exits, there
may be some records still left on the queue, which won't be processed.
"""
self.enqueue_sentinel()
self._thread.join()
self._thread = None | [
"def",
"stop",
"(",
"self",
")",
":",
"self",
".",
"enqueue_sentinel",
"(",
")",
"self",
".",
"_thread",
".",
"join",
"(",
")",
"self",
".",
"_thread",
"=",
"None"
] | https://github.com/python/cpython/blob/e13cdca0f5224ec4e23bdd04bb3120506964bc8b/Lib/logging/handlers.py#L1579-L1589 | ||
jason9693/MusicTransformer-tensorflow2.0 | f7c06c0cb2e9cdddcbf6db779cb39cd650282778 | custom/layers.py | python | BaselineAttention.__init__ | (self, h, d, max_seq=2048, **kwargs) | [] | def __init__(self, h, d, max_seq=2048, **kwargs):
super().__init__(**kwargs)
self.len_k = None
self.max_seq = None
self.E = None
self.h = h
self.d = d
self.dh = d // h
self.Wq = keras.layers.Dense(int(self.d / 2))
self.Wk = keras.layers.Dense(int(self.d / 2))
self.Wv = keras.layers.Dense(int(self.d))
self.fc = keras.layers.Dense(d)
self.max_seq = max_seq | [
"def",
"__init__",
"(",
"self",
",",
"h",
",",
"d",
",",
"max_seq",
"=",
"2048",
",",
"*",
"*",
"kwargs",
")",
":",
"super",
"(",
")",
".",
"__init__",
"(",
"*",
"*",
"kwargs",
")",
"self",
".",
"len_k",
"=",
"None",
"self",
".",
"max_seq",
"="... | https://github.com/jason9693/MusicTransformer-tensorflow2.0/blob/f7c06c0cb2e9cdddcbf6db779cb39cd650282778/custom/layers.py#L98-L110 | ||||
bruderstein/PythonScript | df9f7071ddf3a079e3a301b9b53a6dc78cf1208f | PythonLib/full/_pydecimal.py | python | _format_sign | (is_negative, spec) | Determine sign character. | Determine sign character. | [
"Determine",
"sign",
"character",
"."
] | def _format_sign(is_negative, spec):
"""Determine sign character."""
if is_negative:
return '-'
elif spec['sign'] in ' +':
return spec['sign']
else:
return '' | [
"def",
"_format_sign",
"(",
"is_negative",
",",
"spec",
")",
":",
"if",
"is_negative",
":",
"return",
"'-'",
"elif",
"spec",
"[",
"'sign'",
"]",
"in",
"' +'",
":",
"return",
"spec",
"[",
"'sign'",
"]",
"else",
":",
"return",
"''"
] | https://github.com/bruderstein/PythonScript/blob/df9f7071ddf3a079e3a301b9b53a6dc78cf1208f/PythonLib/full/_pydecimal.py#L6340-L6348 | ||
openstack/kuryr-kubernetes | 513ada72685ef02cd9f3aca418ac1b2e0dc1b8ba | kuryr_kubernetes/cni/binding/sriov.py | python | VIFSriovDriver._make_annotation_name | (self, neutron_port) | return annot_name | [] | def _make_annotation_name(self, neutron_port):
annot_name = constants.K8S_ANNOTATION_NODE_PCI_DEVICE_INFO
annot_name = annot_name.replace('/', '~1')
annot_name = annot_name + '-' + neutron_port
return annot_name | [
"def",
"_make_annotation_name",
"(",
"self",
",",
"neutron_port",
")",
":",
"annot_name",
"=",
"constants",
".",
"K8S_ANNOTATION_NODE_PCI_DEVICE_INFO",
"annot_name",
"=",
"annot_name",
".",
"replace",
"(",
"'/'",
",",
"'~1'",
")",
"annot_name",
"=",
"annot_name",
... | https://github.com/openstack/kuryr-kubernetes/blob/513ada72685ef02cd9f3aca418ac1b2e0dc1b8ba/kuryr_kubernetes/cni/binding/sriov.py#L323-L327 | |||
ChineseGLUE/ChineseGLUE | 1591b85cf5427c2ff60f718d359ecb71d2b44879 | baselines/models/roberta/tf_metrics.py | python | f1 | (labels, predictions, num_classes, pos_indices=None, weights=None,
average='micro') | return fbeta(labels, predictions, num_classes, pos_indices, weights,
average) | [] | def f1(labels, predictions, num_classes, pos_indices=None, weights=None,
average='micro'):
return fbeta(labels, predictions, num_classes, pos_indices, weights,
average) | [
"def",
"f1",
"(",
"labels",
",",
"predictions",
",",
"num_classes",
",",
"pos_indices",
"=",
"None",
",",
"weights",
"=",
"None",
",",
"average",
"=",
"'micro'",
")",
":",
"return",
"fbeta",
"(",
"labels",
",",
"predictions",
",",
"num_classes",
",",
"po... | https://github.com/ChineseGLUE/ChineseGLUE/blob/1591b85cf5427c2ff60f718d359ecb71d2b44879/baselines/models/roberta/tf_metrics.py#L91-L94 | |||
oracle/graalpython | 577e02da9755d916056184ec441c26e00b70145c | graalpython/lib-python/3/__future__.py | python | _Feature.__repr__ | (self) | return "_Feature" + repr((self.optional,
self.mandatory,
self.compiler_flag)) | [] | def __repr__(self):
return "_Feature" + repr((self.optional,
self.mandatory,
self.compiler_flag)) | [
"def",
"__repr__",
"(",
"self",
")",
":",
"return",
"\"_Feature\"",
"+",
"repr",
"(",
"(",
"self",
".",
"optional",
",",
"self",
".",
"mandatory",
",",
"self",
".",
"compiler_flag",
")",
")"
] | https://github.com/oracle/graalpython/blob/577e02da9755d916056184ec441c26e00b70145c/graalpython/lib-python/3/__future__.py#L103-L106 | |||
DataDog/integrations-core | 934674b29d94b70ccc008f76ea172d0cdae05e1e | openstack_controller/datadog_checks/openstack_controller/openstack_controller.py | python | OpenStackControllerCheck.update_servers_cache | (self, cached_servers, tenant_to_name, changes_since) | return servers | [] | def update_servers_cache(self, cached_servers, tenant_to_name, changes_since):
servers = copy.deepcopy(cached_servers)
query_params = {"all_tenants": True, 'changes-since': changes_since}
updated_servers = self.get_servers_detail(query_params)
# For each updated servers, we update the servers cache accordingly
for updated_server in updated_servers:
updated_server_status = updated_server.get('status')
updated_server_id = updated_server.get('id')
if updated_server_status == 'ACTIVE':
# Add or update the cache
if tenant_to_name.get(updated_server.get('tenant_id')):
servers[updated_server_id] = self.create_server_object(updated_server, tenant_to_name)
else:
# Remove from the cache if it exists
if updated_server_id in servers:
del servers[updated_server_id]
return servers | [
"def",
"update_servers_cache",
"(",
"self",
",",
"cached_servers",
",",
"tenant_to_name",
",",
"changes_since",
")",
":",
"servers",
"=",
"copy",
".",
"deepcopy",
"(",
"cached_servers",
")",
"query_params",
"=",
"{",
"\"all_tenants\"",
":",
"True",
",",
"'change... | https://github.com/DataDog/integrations-core/blob/934674b29d94b70ccc008f76ea172d0cdae05e1e/openstack_controller/datadog_checks/openstack_controller/openstack_controller.py#L310-L329 | |||
pithos/pithos | fff93d0740ad752d53027732467155219c20acb2 | pithos/plugins/mpris.py | python | PithosMprisService.PropertiesChanged | (self, interface, changed, invalidated) | Emits mpris Property changes. | Emits mpris Property changes. | [
"Emits",
"mpris",
"Property",
"changes",
"."
] | def PropertiesChanged(self, interface, changed, invalidated):
'''Emits mpris Property changes.'''
try:
self.connection.emit_signal(None, '/org/mpris/MediaPlayer2',
'org.freedesktop.DBus.Properties',
'PropertiesChanged',
GLib.Variant.new_tuple(
GLib.Variant('s', interface),
GLib.Variant('a{sv}', changed),
GLib.Variant('as', invalidated)
))
except GLib.Error as e:
logging.warning(e) | [
"def",
"PropertiesChanged",
"(",
"self",
",",
"interface",
",",
"changed",
",",
"invalidated",
")",
":",
"try",
":",
"self",
".",
"connection",
".",
"emit_signal",
"(",
"None",
",",
"'/org/mpris/MediaPlayer2'",
",",
"'org.freedesktop.DBus.Properties'",
",",
"'Prop... | https://github.com/pithos/pithos/blob/fff93d0740ad752d53027732467155219c20acb2/pithos/plugins/mpris.py#L813-L825 | ||
mher/tornado-celery | b4aeaf7abe4ffc60cfc99a6a851a77d20b498a5b | tcelery/result.py | python | AsyncResult.result | (self) | return self._result or super(AsyncResult, self).result | [] | def result(self):
return self._result or super(AsyncResult, self).result | [
"def",
"result",
"(",
"self",
")",
":",
"return",
"self",
".",
"_result",
"or",
"super",
"(",
"AsyncResult",
",",
"self",
")",
".",
"result"
] | https://github.com/mher/tornado-celery/blob/b4aeaf7abe4ffc60cfc99a6a851a77d20b498a5b/tcelery/result.py#L28-L29 | |||
openstack/swift | b8d7c3dcb817504dcc0959ba52cc4ed2cf66c100 | swift/container/backend.py | python | ContainerBroker.get_own_shard_range | (self, no_default=False) | return own_shard_range | Returns a shard range representing this broker's own shard range. If no
such range has been persisted in the broker's shard ranges table then a
default shard range representing the entire namespace will be returned.
The returned shard range will be updated with the current object stats
for this broker and a meta timestamp set to the current time. For these
values to be persisted the caller must merge the shard range.
:param no_default: if True and the broker's own shard range is not
found in the shard ranges table then None is returned, otherwise a
default shard range is returned.
:return: an instance of :class:`~swift.common.utils.ShardRange` | Returns a shard range representing this broker's own shard range. If no
such range has been persisted in the broker's shard ranges table then a
default shard range representing the entire namespace will be returned. | [
"Returns",
"a",
"shard",
"range",
"representing",
"this",
"broker",
"s",
"own",
"shard",
"range",
".",
"If",
"no",
"such",
"range",
"has",
"been",
"persisted",
"in",
"the",
"broker",
"s",
"shard",
"ranges",
"table",
"then",
"a",
"default",
"shard",
"range"... | def get_own_shard_range(self, no_default=False):
"""
Returns a shard range representing this broker's own shard range. If no
such range has been persisted in the broker's shard ranges table then a
default shard range representing the entire namespace will be returned.
The returned shard range will be updated with the current object stats
for this broker and a meta timestamp set to the current time. For these
values to be persisted the caller must merge the shard range.
:param no_default: if True and the broker's own shard range is not
found in the shard ranges table then None is returned, otherwise a
default shard range is returned.
:return: an instance of :class:`~swift.common.utils.ShardRange`
"""
own_shard_range = self._own_shard_range(no_default=no_default)
if own_shard_range:
info = self.get_info()
own_shard_range.update_meta(
info['object_count'], info['bytes_used'])
return own_shard_range | [
"def",
"get_own_shard_range",
"(",
"self",
",",
"no_default",
"=",
"False",
")",
":",
"own_shard_range",
"=",
"self",
".",
"_own_shard_range",
"(",
"no_default",
"=",
"no_default",
")",
"if",
"own_shard_range",
":",
"info",
"=",
"self",
".",
"get_info",
"(",
... | https://github.com/openstack/swift/blob/b8d7c3dcb817504dcc0959ba52cc4ed2cf66c100/swift/container/backend.py#L1879-L1899 | |
kyuupichan/electrumx | ab9024f74a034e634a518cfbcdb1fcd911e62f00 | electrumx/lib/coins.py | python | Coin.hashX_from_script | (cls, script) | return sha256(script).digest()[:HASHX_LEN] | Returns a hashX from a script. | Returns a hashX from a script. | [
"Returns",
"a",
"hashX",
"from",
"a",
"script",
"."
] | def hashX_from_script(cls, script):
'''Returns a hashX from a script.'''
return sha256(script).digest()[:HASHX_LEN] | [
"def",
"hashX_from_script",
"(",
"cls",
",",
"script",
")",
":",
"return",
"sha256",
"(",
"script",
")",
".",
"digest",
"(",
")",
"[",
":",
"HASHX_LEN",
"]"
] | https://github.com/kyuupichan/electrumx/blob/ab9024f74a034e634a518cfbcdb1fcd911e62f00/electrumx/lib/coins.py#L82-L84 | |
gammapy/gammapy | 735b25cd5bbed35e2004d633621896dcd5295e8b | gammapy/datasets/spectrum.py | python | PlotMixin.plot_counts | (
self, ax=None, kwargs_counts=None, kwargs_background=None, **kwargs
) | return ax | Plot counts and background.
Parameters
----------
ax : `~matplotlib.axes.Axes`
Axes to plot on.
kwargs_counts: dict
Keyword arguments passed to `~matplotlib.axes.Axes.hist` for the counts.
kwargs_background: dict
Keyword arguments passed to `~matplotlib.axes.Axes.hist` for the background.
**kwargs: dict
Keyword arguments passed to both `~matplotlib.axes.Axes.hist`.
Returns
-------
ax : `~matplotlib.axes.Axes`
Axes object. | Plot counts and background. | [
"Plot",
"counts",
"and",
"background",
"."
] | def plot_counts(
self, ax=None, kwargs_counts=None, kwargs_background=None, **kwargs
):
"""Plot counts and background.
Parameters
----------
ax : `~matplotlib.axes.Axes`
Axes to plot on.
kwargs_counts: dict
Keyword arguments passed to `~matplotlib.axes.Axes.hist` for the counts.
kwargs_background: dict
Keyword arguments passed to `~matplotlib.axes.Axes.hist` for the background.
**kwargs: dict
Keyword arguments passed to both `~matplotlib.axes.Axes.hist`.
Returns
-------
ax : `~matplotlib.axes.Axes`
Axes object.
"""
kwargs_counts = kwargs_counts or {}
kwargs_background = kwargs_background or {}
plot_kwargs = kwargs.copy()
plot_kwargs.update(kwargs_counts)
plot_kwargs.setdefault("label", "Counts")
ax = self.counts.plot_hist(ax=ax, **plot_kwargs)
plot_kwargs = kwargs.copy()
plot_kwargs.update(kwargs_background)
plot_kwargs.setdefault("label", "Background")
self.background.plot_hist(ax=ax, **plot_kwargs)
ax.legend(numpoints=1)
return ax | [
"def",
"plot_counts",
"(",
"self",
",",
"ax",
"=",
"None",
",",
"kwargs_counts",
"=",
"None",
",",
"kwargs_background",
"=",
"None",
",",
"*",
"*",
"kwargs",
")",
":",
"kwargs_counts",
"=",
"kwargs_counts",
"or",
"{",
"}",
"kwargs_background",
"=",
"kwargs... | https://github.com/gammapy/gammapy/blob/735b25cd5bbed35e2004d633621896dcd5295e8b/gammapy/datasets/spectrum.py#L68-L104 | |
shchur/gnn-benchmark | 1e72912a0810cdf27ae54fd589a3b43358a2b161 | gnnbench/models/base_model.py | python | GNNModel._preprocess_features | (self, features) | Preprocessing function for the features. Called by the constructor. Even if no preprocessing is needed, the
features might need to be converted to a tf.SparseTensor in this method using the function
util.to_sparse_tensor.
Returns
-------
features_tensor : tf.Tensor or tf.SparseTensor
The features as a (sparse) tensor. | Preprocessing function for the features. Called by the constructor. Even if no preprocessing is needed, the
features might need to be converted to a tf.SparseTensor in this method using the function
util.to_sparse_tensor. | [
"Preprocessing",
"function",
"for",
"the",
"features",
".",
"Called",
"by",
"the",
"constructor",
".",
"Even",
"if",
"no",
"preprocessing",
"is",
"needed",
"the",
"features",
"might",
"need",
"to",
"be",
"converted",
"to",
"a",
"tf",
".",
"SparseTensor",
"in... | def _preprocess_features(self, features):
"""
Preprocessing function for the features. Called by the constructor. Even if no preprocessing is needed, the
features might need to be converted to a tf.SparseTensor in this method using the function
util.to_sparse_tensor.
Returns
-------
features_tensor : tf.Tensor or tf.SparseTensor
The features as a (sparse) tensor.
"""
raise NotImplementedError | [
"def",
"_preprocess_features",
"(",
"self",
",",
"features",
")",
":",
"raise",
"NotImplementedError"
] | https://github.com/shchur/gnn-benchmark/blob/1e72912a0810cdf27ae54fd589a3b43358a2b161/gnnbench/models/base_model.py#L78-L89 | ||
dimagi/commcare-hq | d67ff1d3b4c51fa050c19e60c3253a79d3452a39 | custom/abt/reports/filters.py | python | UserFilterDataSource.order_by | (self) | return [OrderBy('username')] | [] | def order_by(self):
return [OrderBy('username')] | [
"def",
"order_by",
"(",
"self",
")",
":",
"return",
"[",
"OrderBy",
"(",
"'username'",
")",
"]"
] | https://github.com/dimagi/commcare-hq/blob/d67ff1d3b4c51fa050c19e60c3253a79d3452a39/custom/abt/reports/filters.py#L65-L66 | |||
yuzcccc/vqa-mfb | 7fab8dddca5924ed1023149795cdaeacf029ff34 | mfh_baseline/vqa_data_layer.py | python | VQADataProvider.extract_answer_prob | (self,answer_obj) | Return the most popular answer in string. | Return the most popular answer in string. | [
"Return",
"the",
"most",
"popular",
"answer",
"in",
"string",
"."
] | def extract_answer_prob(self,answer_obj):
""" Return the most popular answer in string."""
if self.mode == 'test-dev' or self.mode == 'test':
return -1
answer_list = [ ans['answer'] for ans in answer_obj]
prob_answer_list = []
for ans in answer_list:
if self.adict.has_key(ans):
prob_answer_list.append(ans)
if len(prob_answer_list) == 0:
if self.mode == 'val' or self.mode == 'test-dev' or self.mode == 'test':
return 'hoge'
else:
raise Exception("This should not happen.")
else:
return random.choice(prob_answer_list) | [
"def",
"extract_answer_prob",
"(",
"self",
",",
"answer_obj",
")",
":",
"if",
"self",
".",
"mode",
"==",
"'test-dev'",
"or",
"self",
".",
"mode",
"==",
"'test'",
":",
"return",
"-",
"1",
"answer_list",
"=",
"[",
"ans",
"[",
"'answer'",
"]",
"for",
"ans... | https://github.com/yuzcccc/vqa-mfb/blob/7fab8dddca5924ed1023149795cdaeacf029ff34/mfh_baseline/vqa_data_layer.py#L127-L144 | ||
biolab/orange3 | 41685e1c7b1d1babe680113685a2d44bcc9fec0b | Orange/widgets/data/owtable.py | python | OWDataTable.set_dataset | (self, index: int, data: Table) | Set the input dataset. | Set the input dataset. | [
"Set",
"the",
"input",
"dataset",
"."
] | def set_dataset(self, index: int, data: Table):
"""Set the input dataset."""
datasetname = getattr(data, "name", "Data")
slot = self._inputs[index]
view = slot.view
# reset the (header) view state.
view.setModel(None)
view.horizontalHeader().setSortIndicator(-1, Qt.AscendingOrder)
assert self.tabs.indexOf(view) != -1
self.tabs.setTabText(self.tabs.indexOf(view), datasetname)
view.dataset = data
slot = TableSlot(index, data, table_summary(data), view)
view.input_slot = slot
self._inputs[index] = slot
self._setup_table_view(view, data)
self.tabs.setCurrentWidget(view) | [
"def",
"set_dataset",
"(",
"self",
",",
"index",
":",
"int",
",",
"data",
":",
"Table",
")",
":",
"datasetname",
"=",
"getattr",
"(",
"data",
",",
"\"name\"",
",",
"\"Data\"",
")",
"slot",
"=",
"self",
".",
"_inputs",
"[",
"index",
"]",
"view",
"=",
... | https://github.com/biolab/orange3/blob/41685e1c7b1d1babe680113685a2d44bcc9fec0b/Orange/widgets/data/owtable.py#L282-L297 | ||
omz/PythonistaAppTemplate | f560f93f8876d82a21d108977f90583df08d55af | PythonistaAppTemplate/PythonistaKit.framework/pylib_ext/mpmath/matrices/calculus.py | python | MatrixCalculusMethods.logm | (ctx, A) | return L | r"""
Computes a logarithm of the square matrix `A`, i.e. returns
a matrix `B = \log(A)` such that `\exp(B) = A`. The logarithm
of a matrix, if it exists, is not unique.
**Examples**
Logarithms of some simple matrices::
>>> from mpmath import *
>>> mp.dps = 15; mp.pretty = True
>>> X = eye(3)
>>> logm(X)
[0.0 0.0 0.0]
[0.0 0.0 0.0]
[0.0 0.0 0.0]
>>> logm(2*X)
[0.693147180559945 0.0 0.0]
[ 0.0 0.693147180559945 0.0]
[ 0.0 0.0 0.693147180559945]
>>> logm(expm(X))
[1.0 0.0 0.0]
[0.0 1.0 0.0]
[0.0 0.0 1.0]
A logarithm of a complex matrix::
>>> X = matrix([[2+j, 1, 3], [1-j, 1-2*j, 1], [-4, -5, j]])
>>> B = logm(X)
>>> nprint(B)
[ (0.808757 + 0.107759j) (2.20752 + 0.202762j) (1.07376 - 0.773874j)]
[ (0.905709 - 0.107795j) (0.0287395 - 0.824993j) (0.111619 + 0.514272j)]
[(-0.930151 + 0.399512j) (-2.06266 - 0.674397j) (0.791552 + 0.519839j)]
>>> chop(expm(B))
[(2.0 + 1.0j) 1.0 3.0]
[(1.0 - 1.0j) (1.0 - 2.0j) 1.0]
[ -4.0 -5.0 (0.0 + 1.0j)]
A matrix `X` close to the identity matrix, for which
`\log(\exp(X)) = \exp(\log(X)) = X` holds::
>>> X = eye(3) + hilbert(3)/4
>>> X
[ 1.25 0.125 0.0833333333333333]
[ 0.125 1.08333333333333 0.0625]
[0.0833333333333333 0.0625 1.05]
>>> logm(expm(X))
[ 1.25 0.125 0.0833333333333333]
[ 0.125 1.08333333333333 0.0625]
[0.0833333333333333 0.0625 1.05]
>>> expm(logm(X))
[ 1.25 0.125 0.0833333333333333]
[ 0.125 1.08333333333333 0.0625]
[0.0833333333333333 0.0625 1.05]
A logarithm of a rotation matrix, giving back the angle of
the rotation::
>>> t = 3.7
>>> A = matrix([[cos(t),sin(t)],[-sin(t),cos(t)]])
>>> chop(logm(A))
[ 0.0 -2.58318530717959]
[2.58318530717959 0.0]
>>> (2*pi-t)
2.58318530717959
For some matrices, a logarithm does not exist::
>>> logm([[1,0], [0,0]])
Traceback (most recent call last):
...
ZeroDivisionError: matrix is numerically singular
Logarithm of a matrix with large entries::
>>> logm(hilbert(3) * 10**20).apply(re)
[ 45.5597513593433 1.27721006042799 0.317662687717978]
[ 1.27721006042799 42.5222778973542 2.24003708791604]
[0.317662687717978 2.24003708791604 42.395212822267] | r"""
Computes a logarithm of the square matrix `A`, i.e. returns
a matrix `B = \log(A)` such that `\exp(B) = A`. The logarithm
of a matrix, if it exists, is not unique. | [
"r",
"Computes",
"a",
"logarithm",
"of",
"the",
"square",
"matrix",
"A",
"i",
".",
"e",
".",
"returns",
"a",
"matrix",
"B",
"=",
"\\",
"log",
"(",
"A",
")",
"such",
"that",
"\\",
"exp",
"(",
"B",
")",
"=",
"A",
".",
"The",
"logarithm",
"of",
"a... | def logm(ctx, A):
r"""
Computes a logarithm of the square matrix `A`, i.e. returns
a matrix `B = \log(A)` such that `\exp(B) = A`. The logarithm
of a matrix, if it exists, is not unique.
**Examples**
Logarithms of some simple matrices::
>>> from mpmath import *
>>> mp.dps = 15; mp.pretty = True
>>> X = eye(3)
>>> logm(X)
[0.0 0.0 0.0]
[0.0 0.0 0.0]
[0.0 0.0 0.0]
>>> logm(2*X)
[0.693147180559945 0.0 0.0]
[ 0.0 0.693147180559945 0.0]
[ 0.0 0.0 0.693147180559945]
>>> logm(expm(X))
[1.0 0.0 0.0]
[0.0 1.0 0.0]
[0.0 0.0 1.0]
A logarithm of a complex matrix::
>>> X = matrix([[2+j, 1, 3], [1-j, 1-2*j, 1], [-4, -5, j]])
>>> B = logm(X)
>>> nprint(B)
[ (0.808757 + 0.107759j) (2.20752 + 0.202762j) (1.07376 - 0.773874j)]
[ (0.905709 - 0.107795j) (0.0287395 - 0.824993j) (0.111619 + 0.514272j)]
[(-0.930151 + 0.399512j) (-2.06266 - 0.674397j) (0.791552 + 0.519839j)]
>>> chop(expm(B))
[(2.0 + 1.0j) 1.0 3.0]
[(1.0 - 1.0j) (1.0 - 2.0j) 1.0]
[ -4.0 -5.0 (0.0 + 1.0j)]
A matrix `X` close to the identity matrix, for which
`\log(\exp(X)) = \exp(\log(X)) = X` holds::
>>> X = eye(3) + hilbert(3)/4
>>> X
[ 1.25 0.125 0.0833333333333333]
[ 0.125 1.08333333333333 0.0625]
[0.0833333333333333 0.0625 1.05]
>>> logm(expm(X))
[ 1.25 0.125 0.0833333333333333]
[ 0.125 1.08333333333333 0.0625]
[0.0833333333333333 0.0625 1.05]
>>> expm(logm(X))
[ 1.25 0.125 0.0833333333333333]
[ 0.125 1.08333333333333 0.0625]
[0.0833333333333333 0.0625 1.05]
A logarithm of a rotation matrix, giving back the angle of
the rotation::
>>> t = 3.7
>>> A = matrix([[cos(t),sin(t)],[-sin(t),cos(t)]])
>>> chop(logm(A))
[ 0.0 -2.58318530717959]
[2.58318530717959 0.0]
>>> (2*pi-t)
2.58318530717959
For some matrices, a logarithm does not exist::
>>> logm([[1,0], [0,0]])
Traceback (most recent call last):
...
ZeroDivisionError: matrix is numerically singular
Logarithm of a matrix with large entries::
>>> logm(hilbert(3) * 10**20).apply(re)
[ 45.5597513593433 1.27721006042799 0.317662687717978]
[ 1.27721006042799 42.5222778973542 2.24003708791604]
[0.317662687717978 2.24003708791604 42.395212822267]
"""
A = ctx.matrix(A)
prec = ctx.prec
try:
ctx.prec += 10
tol = ctx.eps * 128
I = A**0
B = A
n = 0
while 1:
B = ctx.sqrtm(B)
n += 1
if ctx.mnorm(B-I, 'inf') < 0.125:
break
T = X = B-I
L = X*0
k = 1
while 1:
if k & 1:
L += T / k
else:
L -= T / k
T *= X
if ctx.mnorm(T, 'inf') < tol:
break
k += 1
if k > ctx.prec:
raise ctx.NoConvergence
finally:
ctx.prec = prec
L *= 2**n
return L | [
"def",
"logm",
"(",
"ctx",
",",
"A",
")",
":",
"A",
"=",
"ctx",
".",
"matrix",
"(",
"A",
")",
"prec",
"=",
"ctx",
".",
"prec",
"try",
":",
"ctx",
".",
"prec",
"+=",
"10",
"tol",
"=",
"ctx",
".",
"eps",
"*",
"128",
"I",
"=",
"A",
"**",
"0"... | https://github.com/omz/PythonistaAppTemplate/blob/f560f93f8876d82a21d108977f90583df08d55af/PythonistaAppTemplate/PythonistaKit.framework/pylib_ext/mpmath/matrices/calculus.py#L350-L462 | |
KalleHallden/AutoTimer | 2d954216700c4930baa154e28dbddc34609af7ce | env/lib/python2.7/site-packages/pip/_vendor/packaging/version.py | python | _parse_version_parts | (s) | [] | def _parse_version_parts(s):
for part in _legacy_version_component_re.split(s):
part = _legacy_version_replacement_map.get(part, part)
if not part or part == ".":
continue
if part[:1] in "0123456789":
# pad for numeric comparison
yield part.zfill(8)
else:
yield "*" + part
# ensure that alpha/beta/candidate are before final
yield "*final" | [
"def",
"_parse_version_parts",
"(",
"s",
")",
":",
"for",
"part",
"in",
"_legacy_version_component_re",
".",
"split",
"(",
"s",
")",
":",
"part",
"=",
"_legacy_version_replacement_map",
".",
"get",
"(",
"part",
",",
"part",
")",
"if",
"not",
"part",
"or",
... | https://github.com/KalleHallden/AutoTimer/blob/2d954216700c4930baa154e28dbddc34609af7ce/env/lib/python2.7/site-packages/pip/_vendor/packaging/version.py#L135-L149 | ||||
SteveDoyle2/pyNastran | eda651ac2d4883d95a34951f8a002ff94f642a1a | pyNastran/gui/menus/legend/qt_legend.py | python | LegendPropertiesWindow.on_default_arrow_scale | (self) | action when user clicks 'Default' for arrow_scale factor | action when user clicks 'Default' for arrow_scale factor | [
"action",
"when",
"user",
"clicks",
"Default",
"for",
"arrow_scale",
"factor"
] | def on_default_arrow_scale(self):
"""action when user clicks 'Default' for arrow_scale factor"""
self.arrow_scale_edit.setText(func_str_or_none(self._default_arrow_scale))
self.arrow_scale_edit.setStyleSheet("QLineEdit{background: white;}") | [
"def",
"on_default_arrow_scale",
"(",
"self",
")",
":",
"self",
".",
"arrow_scale_edit",
".",
"setText",
"(",
"func_str_or_none",
"(",
"self",
".",
"_default_arrow_scale",
")",
")",
"self",
".",
"arrow_scale_edit",
".",
"setStyleSheet",
"(",
"\"QLineEdit{background:... | https://github.com/SteveDoyle2/pyNastran/blob/eda651ac2d4883d95a34951f8a002ff94f642a1a/pyNastran/gui/menus/legend/qt_legend.py#L734-L737 | ||
clinton-hall/nzbToMedia | 27669389216902d1085660167e7bda0bd8527ecf | libs/common/click/globals.py | python | push_context | (ctx) | Pushes a new context to the current stack. | Pushes a new context to the current stack. | [
"Pushes",
"a",
"new",
"context",
"to",
"the",
"current",
"stack",
"."
] | def push_context(ctx):
"""Pushes a new context to the current stack."""
_local.__dict__.setdefault('stack', []).append(ctx) | [
"def",
"push_context",
"(",
"ctx",
")",
":",
"_local",
".",
"__dict__",
".",
"setdefault",
"(",
"'stack'",
",",
"[",
"]",
")",
".",
"append",
"(",
"ctx",
")"
] | https://github.com/clinton-hall/nzbToMedia/blob/27669389216902d1085660167e7bda0bd8527ecf/libs/common/click/globals.py#L29-L31 | ||
khanhnamle1994/natural-language-processing | 01d450d5ac002b0156ef4cf93a07cb508c1bcdc5 | assignment1/.env/lib/python2.7/site-packages/IPython/external/pexpect/_pexpect.py | python | searcher_string.search | (self, buffer, freshlen, searchwindowsize=None) | return best_index | This searches 'buffer' for the first occurence of one of the search
strings. 'freshlen' must indicate the number of bytes at the end of
'buffer' which have not been searched before. It helps to avoid
searching the same, possibly big, buffer over and over again.
See class spawn for the 'searchwindowsize' argument.
If there is a match this returns the index of that string, and sets
'start', 'end' and 'match'. Otherwise, this returns -1. | This searches 'buffer' for the first occurence of one of the search
strings. 'freshlen' must indicate the number of bytes at the end of
'buffer' which have not been searched before. It helps to avoid
searching the same, possibly big, buffer over and over again. | [
"This",
"searches",
"buffer",
"for",
"the",
"first",
"occurence",
"of",
"one",
"of",
"the",
"search",
"strings",
".",
"freshlen",
"must",
"indicate",
"the",
"number",
"of",
"bytes",
"at",
"the",
"end",
"of",
"buffer",
"which",
"have",
"not",
"been",
"searc... | def search(self, buffer, freshlen, searchwindowsize=None):
"""This searches 'buffer' for the first occurence of one of the search
strings. 'freshlen' must indicate the number of bytes at the end of
'buffer' which have not been searched before. It helps to avoid
searching the same, possibly big, buffer over and over again.
See class spawn for the 'searchwindowsize' argument.
If there is a match this returns the index of that string, and sets
'start', 'end' and 'match'. Otherwise, this returns -1. """
absurd_match = len(buffer)
first_match = absurd_match
# 'freshlen' helps a lot here. Further optimizations could
# possibly include:
#
# using something like the Boyer-Moore Fast String Searching
# Algorithm; pre-compiling the search through a list of
# strings into something that can scan the input once to
# search for all N strings; realize that if we search for
# ['bar', 'baz'] and the input is '...foo' we need not bother
# rescanning until we've read three more bytes.
#
# Sadly, I don't know enough about this interesting topic. /grahn
for index, s in self._strings:
if searchwindowsize is None:
# the match, if any, can only be in the fresh data,
# or at the very end of the old data
offset = -(freshlen+len(s))
else:
# better obey searchwindowsize
offset = -searchwindowsize
n = buffer.find(s, offset)
if n >= 0 and n < first_match:
first_match = n
best_index, best_match = index, s
if first_match == absurd_match:
return -1
self.match = best_match
self.start = first_match
self.end = self.start + len(self.match)
return best_index | [
"def",
"search",
"(",
"self",
",",
"buffer",
",",
"freshlen",
",",
"searchwindowsize",
"=",
"None",
")",
":",
"absurd_match",
"=",
"len",
"(",
"buffer",
")",
"first_match",
"=",
"absurd_match",
"# 'freshlen' helps a lot here. Further optimizations could",
"# possibly ... | https://github.com/khanhnamle1994/natural-language-processing/blob/01d450d5ac002b0156ef4cf93a07cb508c1bcdc5/assignment1/.env/lib/python2.7/site-packages/IPython/external/pexpect/_pexpect.py#L1694-L1738 | |
aws/serverless-application-model | ab6943a340a3f489af62b8c70c1366242b2887fe | samtranslator/feature_toggle/feature_toggle.py | python | FeatureToggle._get_dialup | (self, region_config, feature_name) | return DisabledDialup(region_config) | get the right dialup instance
if no dialup type is provided or the specified dialup is not supported,
an instance of DisabledDialup will be returned
:param region_config: region config
:param feature_name: feature_name
:return: an instance of | get the right dialup instance
if no dialup type is provided or the specified dialup is not supported,
an instance of DisabledDialup will be returned | [
"get",
"the",
"right",
"dialup",
"instance",
"if",
"no",
"dialup",
"type",
"is",
"provided",
"or",
"the",
"specified",
"dialup",
"is",
"not",
"supported",
"an",
"instance",
"of",
"DisabledDialup",
"will",
"be",
"returned"
] | def _get_dialup(self, region_config, feature_name):
"""
get the right dialup instance
if no dialup type is provided or the specified dialup is not supported,
an instance of DisabledDialup will be returned
:param region_config: region config
:param feature_name: feature_name
:return: an instance of
"""
dialup_type = region_config.get("type")
if dialup_type in FeatureToggle.DIALUP_RESOLVER:
return FeatureToggle.DIALUP_RESOLVER[dialup_type](
region_config, account_id=self.account_id, feature_name=feature_name
)
LOG.warning("Dialup type '{}' is None or is not supported.".format(dialup_type))
return DisabledDialup(region_config) | [
"def",
"_get_dialup",
"(",
"self",
",",
"region_config",
",",
"feature_name",
")",
":",
"dialup_type",
"=",
"region_config",
".",
"get",
"(",
"\"type\"",
")",
"if",
"dialup_type",
"in",
"FeatureToggle",
".",
"DIALUP_RESOLVER",
":",
"return",
"FeatureToggle",
"."... | https://github.com/aws/serverless-application-model/blob/ab6943a340a3f489af62b8c70c1366242b2887fe/samtranslator/feature_toggle/feature_toggle.py#L39-L55 | |
PaddlePaddle/PaddleSeg | 8a9196177c9e4b0187f90cbc6a6bc38a652eba73 | paddleseg/utils/ema.py | python | EMA.apply | (self) | Save the origin data and use the EMA data to replace the origin data. | Save the origin data and use the EMA data to replace the origin data. | [
"Save",
"the",
"origin",
"data",
"and",
"use",
"the",
"EMA",
"data",
"to",
"replace",
"the",
"origin",
"data",
"."
] | def apply(self):
"""
Save the origin data and use the EMA data to replace the origin data.
"""
for name, param in self._model.named_parameters():
if not param.stop_gradient:
assert name in self._ema_data, \
"The param ({}) isn't in the model".format(name)
self._backup_data[name] = param.numpy()
param.set_value(self._ema_data[name]) | [
"def",
"apply",
"(",
"self",
")",
":",
"for",
"name",
",",
"param",
"in",
"self",
".",
"_model",
".",
"named_parameters",
"(",
")",
":",
"if",
"not",
"param",
".",
"stop_gradient",
":",
"assert",
"name",
"in",
"self",
".",
"_ema_data",
",",
"\"The para... | https://github.com/PaddlePaddle/PaddleSeg/blob/8a9196177c9e4b0187f90cbc6a6bc38a652eba73/paddleseg/utils/ema.py#L82-L91 | ||
eirannejad/pyRevit | 49c0b7eb54eb343458ce1365425e6552d0c47d44 | site-packages/sqlalchemy/orm/relationships.py | python | JoinCondition._annotate_fks | (self) | Annotate the primaryjoin and secondaryjoin
structures with 'foreign' annotations marking columns
considered as foreign. | Annotate the primaryjoin and secondaryjoin
structures with 'foreign' annotations marking columns
considered as foreign. | [
"Annotate",
"the",
"primaryjoin",
"and",
"secondaryjoin",
"structures",
"with",
"foreign",
"annotations",
"marking",
"columns",
"considered",
"as",
"foreign",
"."
] | def _annotate_fks(self):
"""Annotate the primaryjoin and secondaryjoin
structures with 'foreign' annotations marking columns
considered as foreign.
"""
if self._has_foreign_annotations:
return
if self.consider_as_foreign_keys:
self._annotate_from_fk_list()
else:
self._annotate_present_fks() | [
"def",
"_annotate_fks",
"(",
"self",
")",
":",
"if",
"self",
".",
"_has_foreign_annotations",
":",
"return",
"if",
"self",
".",
"consider_as_foreign_keys",
":",
"self",
".",
"_annotate_from_fk_list",
"(",
")",
"else",
":",
"self",
".",
"_annotate_present_fks",
"... | https://github.com/eirannejad/pyRevit/blob/49c0b7eb54eb343458ce1365425e6552d0c47d44/site-packages/sqlalchemy/orm/relationships.py#L2173-L2185 | ||
jhorey/ferry | bbaa047df08386e17130a939e20fde5e840d1ffa | ferry/fabric/local.py | python | LocalFabric.alloc | (self, cluster_uuid, service_uuid, container_info, ctype) | return containers | Allocate several instances. | Allocate several instances. | [
"Allocate",
"several",
"instances",
"."
] | def alloc(self, cluster_uuid, service_uuid, container_info, ctype):
"""
Allocate several instances.
"""
containers = []
mounts = {}
for c in container_info:
# Get a new IP address for this container and construct
# a default command.
gw = ferry.install._get_gateway().split("/")[0]
# Check if we should use the manual LXC option.
if not 'netenable' in c:
ip = self.network.assign_ip(c)
lxc_opts = ["lxc.network.type = veth",
"lxc.network.ipv4 = %s/24" % ip,
"lxc.network.ipv4.gateway = %s" % gw,
"lxc.network.link = ferry0",
"lxc.network.name = eth0",
"lxc.network.flags = up"]
# Check if we need to forward any ports.
host_map = {}
for p in c['ports']:
p = str(p)
s = p.split(":")
if len(s) > 1:
host = s[0]
dest = s[1]
else:
host = self.network.random_port()
dest = s[0]
host_map[dest] = [{'HostIp' : '0.0.0.0',
'HostPort' : host}]
self.network.forward_rule('0.0.0.0/0', host, ip, dest)
host_map_keys = host_map.keys()
else:
lxc_opts = None
host_map = None
host_map_keys = []
# Start a container with a specific image, in daemon mode,
# without TTY, and on a specific port
if not 'default_cmd' in c:
c['default_cmd'] = "/service/sbin/startnode init"
container = self.cli.run(service_type = c['type'],
image = c['image'],
volumes = c['volumes'],
keydir = c['keydir'],
keyname = c['keyname'],
privatekey = c['privatekey'],
open_ports = host_map_keys,
host_map = host_map,
expose_group = c['exposed'],
hostname = c['hostname'],
default_cmd = c['default_cmd'],
args= c['args'],
lxc_opts = lxc_opts,
inspector = self.inspector,
background = False)
if container:
container.default_user = self.docker_user
containers.append(container)
if not 'netenable' in c:
container.internal_ip = ip
container.external_ip = ip
self.network.set_owner(ip, container.container)
if 'name' in c:
container.name = c['name']
if 'volume_user' in c:
mounts[container] = {'user':c['volume_user'],
'vols':c['volumes'].items()}
# We should wait for a second to let the ssh server start
# on the containers (otherwise sometimes we get a connection refused)
time.sleep(3)
# Check if we need to set the file permissions
# for the mounted volumes.
for c, i in mounts.items():
for _, v in i['vols']:
self.cmd([c], 'chown -R %s %s' % (i['user'], v))
return containers | [
"def",
"alloc",
"(",
"self",
",",
"cluster_uuid",
",",
"service_uuid",
",",
"container_info",
",",
"ctype",
")",
":",
"containers",
"=",
"[",
"]",
"mounts",
"=",
"{",
"}",
"for",
"c",
"in",
"container_info",
":",
"# Get a new IP address for this container and co... | https://github.com/jhorey/ferry/blob/bbaa047df08386e17130a939e20fde5e840d1ffa/ferry/fabric/local.py#L115-L200 | |
apple/coremltools | 141a83af482fcbdd5179807c9eaff9a7999c2c49 | coremltools/converters/onnx/_operators_nd.py | python | _convert_clip | (builder, node, graph, err) | convert to CoreML Clip Layer:
https://github.com/apple/coremltools/blob/655b3be5cc0d42c3c4fa49f0f0e4a93a26b3e492/mlmodel/format/NeuralNetwork.proto#L5066 | convert to CoreML Clip Layer:
https://github.com/apple/coremltools/blob/655b3be5cc0d42c3c4fa49f0f0e4a93a26b3e492/mlmodel/format/NeuralNetwork.proto#L5066 | [
"convert",
"to",
"CoreML",
"Clip",
"Layer",
":",
"https",
":",
"//",
"github",
".",
"com",
"/",
"apple",
"/",
"coremltools",
"/",
"blob",
"/",
"655b3be5cc0d42c3c4fa49f0f0e4a93a26b3e492",
"/",
"mlmodel",
"/",
"format",
"/",
"NeuralNetwork",
".",
"proto#L5066"
] | def _convert_clip(builder, node, graph, err):
"""
convert to CoreML Clip Layer:
https://github.com/apple/coremltools/blob/655b3be5cc0d42c3c4fa49f0f0e4a93a26b3e492/mlmodel/format/NeuralNetwork.proto#L5066
"""
max_value = node.attrs.get("max", 3.4028234663852886e38)
min_value = node.attrs.get("min", -3.4028234663852886e38)
builder.add_clip(
name=node.name,
input_name=node.inputs[0],
output_name=node.outputs[0],
min_value=min_value,
max_value=max_value,
) | [
"def",
"_convert_clip",
"(",
"builder",
",",
"node",
",",
"graph",
",",
"err",
")",
":",
"max_value",
"=",
"node",
".",
"attrs",
".",
"get",
"(",
"\"max\"",
",",
"3.4028234663852886e38",
")",
"min_value",
"=",
"node",
".",
"attrs",
".",
"get",
"(",
"\"... | https://github.com/apple/coremltools/blob/141a83af482fcbdd5179807c9eaff9a7999c2c49/coremltools/converters/onnx/_operators_nd.py#L502-L515 | ||
GoogleCloudPlatform/PerfKitBenchmarker | 6e3412d7d5e414b8ca30ed5eaf970cef1d919a67 | perfkitbenchmarker/providers/azure/azure_virtual_machine.py | python | AzureVirtualMachine._Create | (self) | See base class. | See base class. | [
"See",
"base",
"class",
"."
] | def _Create(self):
"""See base class."""
if self.os_disk.disk_size:
disk_size_args = ['--os-disk-size-gb', str(self.os_disk.disk_size)]
else:
disk_size_args = []
tags = {}
tags.update(self.vm_metadata)
tags.update(util.GetResourceTags(self.resource_group.timeout_minutes))
tag_args = ['--tags'] + util.FormatTags(tags)
create_cmd = ([
azure.AZURE_PATH, 'vm', 'create', '--location', self.region,
'--image', self.image, '--size', self.machine_type, '--admin-username',
self.user_name, '--storage-sku', self.os_disk.disk_type, '--name',
self.name
] + disk_size_args + self.resource_group.args + self.nic.args + tag_args)
if self._RequiresUltraDisk():
self.ultra_ssd_enabled = True
create_cmd.extend(['--ultra-ssd-enabled'])
if self.availability_zone:
create_cmd.extend(['--zone', self.availability_zone])
# Resources in Availability Set are not allowed to be
# deployed to particular hosts.
if self.use_dedicated_host:
create_cmd.extend(
['--host-group', self.host.host_group, '--host', self.host.name])
num_hosts = len(self.host_list)
if self.network.placement_group:
create_cmd.extend(self.network.placement_group.AddVmArgs())
if self.low_priority:
create_cmd.extend(['--priority', 'Spot'])
if self.password:
create_cmd.extend(['--admin-password', self.password])
else:
create_cmd.extend(['--ssh-key-value', self.ssh_public_key])
# Uses a custom default because create has a very long tail.
azure_vm_create_timeout = 1800
_, stderr, retcode = vm_util.IssueCommand(
create_cmd, timeout=azure_vm_create_timeout, raise_on_failure=False)
if retcode:
if 'quota' in stderr.lower():
raise errors.Benchmarks.QuotaFailure(
virtual_machine.QUOTA_EXCEEDED_MESSAGE + stderr)
elif self.low_priority and 'OverconstrainedAllocationRequest' in stderr:
raise errors.Benchmarks.InsufficientCapacityCloudFailure(stderr)
# TODO(buggay) refactor to share code with gcp_virtual_machine.py
if (self.use_dedicated_host and retcode and
'AllocationFailed' in stderr):
if self.num_vms_per_host:
raise errors.Resource.CreationError(
'Failed to create host: %d vms of type %s per host exceeds '
'memory capacity limits of the host' %
(self.num_vms_per_host, self.machine_type))
else:
logging.warning(
'Creation failed due to insufficient host capacity. A new host will '
'be created and instance creation will be retried.')
with self._lock:
if num_hosts == len(self.host_list):
new_host = AzureDedicatedHost(self.name, self.region,
self.resource_group,
self.host_series_sku,
self.availability_zone)
self.host_list.append(new_host)
new_host.Create()
self.host = self.host_list[-1]
raise errors.Resource.RetryableCreationError()
if (not self.use_dedicated_host and retcode and
('AllocationFailed' in stderr or
'OverconstrainedZonalAllocationRequest' in stderr)):
raise errors.Benchmarks.InsufficientCapacityCloudFailure(stderr)
if retcode:
raise errors.Resource.CreationError(
'Failed to create VM: %s return code: %s' % (stderr, retcode)) | [
"def",
"_Create",
"(",
"self",
")",
":",
"if",
"self",
".",
"os_disk",
".",
"disk_size",
":",
"disk_size_args",
"=",
"[",
"'--os-disk-size-gb'",
",",
"str",
"(",
"self",
".",
"os_disk",
".",
"disk_size",
")",
"]",
"else",
":",
"disk_size_args",
"=",
"[",... | https://github.com/GoogleCloudPlatform/PerfKitBenchmarker/blob/6e3412d7d5e414b8ca30ed5eaf970cef1d919a67/perfkitbenchmarker/providers/azure/azure_virtual_machine.py#L550-L632 | ||
TencentCloud/tencentcloud-sdk-python | 3677fd1cdc8c5fd626ce001c13fd3b59d1f279d2 | tencentcloud/dayu/v20180709/dayu_client.py | python | DayuClient.DeleteL7Rules | (self, request) | 删除七层转发规则
:param request: Request instance for DeleteL7Rules.
:type request: :class:`tencentcloud.dayu.v20180709.models.DeleteL7RulesRequest`
:rtype: :class:`tencentcloud.dayu.v20180709.models.DeleteL7RulesResponse` | 删除七层转发规则 | [
"删除七层转发规则"
] | def DeleteL7Rules(self, request):
"""删除七层转发规则
:param request: Request instance for DeleteL7Rules.
:type request: :class:`tencentcloud.dayu.v20180709.models.DeleteL7RulesRequest`
:rtype: :class:`tencentcloud.dayu.v20180709.models.DeleteL7RulesResponse`
"""
try:
params = request._serialize()
body = self.call("DeleteL7Rules", params)
response = json.loads(body)
if "Error" not in response["Response"]:
model = models.DeleteL7RulesResponse()
model._deserialize(response["Response"])
return model
else:
code = response["Response"]["Error"]["Code"]
message = response["Response"]["Error"]["Message"]
reqid = response["Response"]["RequestId"]
raise TencentCloudSDKException(code, message, reqid)
except Exception as e:
if isinstance(e, TencentCloudSDKException):
raise
else:
raise TencentCloudSDKException(e.message, e.message) | [
"def",
"DeleteL7Rules",
"(",
"self",
",",
"request",
")",
":",
"try",
":",
"params",
"=",
"request",
".",
"_serialize",
"(",
")",
"body",
"=",
"self",
".",
"call",
"(",
"\"DeleteL7Rules\"",
",",
"params",
")",
"response",
"=",
"json",
".",
"loads",
"("... | https://github.com/TencentCloud/tencentcloud-sdk-python/blob/3677fd1cdc8c5fd626ce001c13fd3b59d1f279d2/tencentcloud/dayu/v20180709/dayu_client.py#L701-L726 | ||
firedrakeproject/firedrake | 06ab4975c14c0d4dcb79be55821f8b9e41554125 | firedrake/preconditioners/fdm.py | python | FDMPC.get_interior_facet_maps | (V) | return facet_to_nodes_fun, local_facet_data_fun, nfacets | Extrude V.interior_facet_node_map and V.ufl_domain().interior_facets.local_facet_dat
:arg V: a :class:`FunctionSpace`
:returns: the 3-tuple of
facet_to_nodes_fun: maps interior facets to the nodes of the two cells sharing it,
local_facet_data_fun: maps interior facets to the local facet numbering in the two cells sharing it,
nfacets: the total number of interior facets owned by this process | Extrude V.interior_facet_node_map and V.ufl_domain().interior_facets.local_facet_dat | [
"Extrude",
"V",
".",
"interior_facet_node_map",
"and",
"V",
".",
"ufl_domain",
"()",
".",
"interior_facets",
".",
"local_facet_dat"
] | def get_interior_facet_maps(V):
"""
Extrude V.interior_facet_node_map and V.ufl_domain().interior_facets.local_facet_dat
:arg V: a :class:`FunctionSpace`
:returns: the 3-tuple of
facet_to_nodes_fun: maps interior facets to the nodes of the two cells sharing it,
local_facet_data_fun: maps interior facets to the local facet numbering in the two cells sharing it,
nfacets: the total number of interior facets owned by this process
"""
mesh = V.ufl_domain()
intfacets = mesh.interior_facets
facet_to_cells = intfacets.facet_cell_map.values
local_facet_data = intfacets.local_facet_dat.data_ro
facet_node_map = V.interior_facet_node_map()
facet_to_nodes = facet_node_map.values
nbase = facet_to_nodes.shape[0]
if mesh.cell_set._extruded:
facet_offset = facet_node_map.offset
local_facet_data_h = numpy.array([5, 4], local_facet_data.dtype)
cell_node_map = V.cell_node_map()
cell_to_nodes = cell_node_map.values_with_halo
cell_offset = cell_node_map.offset
nelv = cell_node_map.values.shape[0]
layers = facet_node_map.iterset.layers_array
itype = cell_offset.dtype
shift_h = numpy.array([[0], [1]], itype)
if mesh.variable_layers:
nv = 0
to_base = []
to_layer = []
for f, cells in enumerate(facet_to_cells):
istart = max(layers[cells, 0])
iend = min(layers[cells, 1])
nz = iend-istart-1
nv += nz
to_base.append(numpy.full((nz,), f, itype))
to_layer.append(numpy.arange(nz, dtype=itype))
nh = layers[:, 1]-layers[:, 0]-2
to_base.append(numpy.repeat(numpy.arange(len(nh), dtype=itype), nh))
to_layer += [numpy.arange(nf, dtype=itype) for nf in nh]
to_base = numpy.concatenate(to_base)
to_layer = numpy.concatenate(to_layer)
nfacets = nv + sum(nh[:nelv])
local_facet_data_fun = lambda e: local_facet_data[to_base[e]] if e < nv else local_facet_data_h
facet_to_nodes_fun = lambda e: facet_to_nodes[to_base[e]] + to_layer[e]*facet_offset if e < nv else numpy.reshape(cell_to_nodes[to_base[e]] + numpy.kron(to_layer[e]+shift_h, cell_offset), (-1,))
else:
nelz = layers[0, 1]-layers[0, 0]-1
nv = nbase * nelz
nh = nelv * (nelz-1)
nfacets = nv + nh
local_facet_data_fun = lambda e: local_facet_data[e//nelz] if e < nv else local_facet_data_h
facet_to_nodes_fun = lambda e: facet_to_nodes[e//nelz] + (e % nelz)*facet_offset if e < nv else numpy.reshape(cell_to_nodes[(e-nv)//(nelz-1)] + numpy.kron(((e-nv) % (nelz-1))+shift_h, cell_offset), (-1,))
else:
facet_to_nodes_fun = lambda e: facet_to_nodes[e]
local_facet_data_fun = lambda e: local_facet_data[e]
nfacets = nbase
return facet_to_nodes_fun, local_facet_data_fun, nfacets | [
"def",
"get_interior_facet_maps",
"(",
"V",
")",
":",
"mesh",
"=",
"V",
".",
"ufl_domain",
"(",
")",
"intfacets",
"=",
"mesh",
".",
"interior_facets",
"facet_to_cells",
"=",
"intfacets",
".",
"facet_cell_map",
".",
"values",
"local_facet_data",
"=",
"intfacets",... | https://github.com/firedrakeproject/firedrake/blob/06ab4975c14c0d4dcb79be55821f8b9e41554125/firedrake/preconditioners/fdm.py#L912-L980 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.