hexsha
stringlengths
40
40
repo
stringlengths
7
114
path
stringlengths
4
124
license
listlengths
1
9
language
stringclasses
1 value
identifier
stringlengths
1
71
return_type
stringlengths
1
749
original_string
stringlengths
76
22.7k
original_docstring
stringlengths
16
7.61k
docstring
stringlengths
16
2.47k
docstring_tokens
listlengths
6
477
code
stringlengths
14
10.2k
code_tokens
listlengths
6
996
short_docstring
stringlengths
2
644
short_docstring_tokens
listlengths
1
116
comment
listlengths
1
89
parameters
listlengths
0
64
docstring_params
dict
f697638db76b9fc35cd762f0cbbb058c9ee6f5b1
sed-i/python-libjuju
juju/client/_client2.py
[ "Apache-2.0" ]
Python
WatchRemoteApplicationRelations
<not_specific>
async def WatchRemoteApplicationRelations(self, entities=None): ''' WatchRemoteApplicationRelations starts a StringsWatcher for watching the relations of each specified application in the local model, and returns the watcher IDs and initial values, or an error if the services' relations ...
WatchRemoteApplicationRelations starts a StringsWatcher for watching the relations of each specified application in the local model, and returns the watcher IDs and initial values, or an error if the services' relations could not be watched. entities : typing.Sequence[~Entity] ...
WatchRemoteApplicationRelations starts a StringsWatcher for watching the relations of each specified application in the local model, and returns the watcher IDs and initial values, or an error if the services' relations could not be watched. entities : typing.Sequence[~Entity] Returns -> StringsWatchResults
[ "WatchRemoteApplicationRelations", "starts", "a", "StringsWatcher", "for", "watching", "the", "relations", "of", "each", "specified", "application", "in", "the", "local", "model", "and", "returns", "the", "watcher", "IDs", "and", "initial", "values", "or", "an", "...
async def WatchRemoteApplicationRelations(self, entities=None): if entities is not None and not isinstance(entities, (bytes, str, list)): raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) _params = dict() msg = dict(type='RemoteRelations', ...
[ "async", "def", "WatchRemoteApplicationRelations", "(", "self", ",", "entities", "=", "None", ")", ":", "if", "entities", "is", "not", "None", "and", "not", "isinstance", "(", "entities", ",", "(", "bytes", ",", "str", ",", "list", ")", ")", ":", "raise"...
WatchRemoteApplicationRelations starts a StringsWatcher for watching the relations of each specified application in the local model, and returns the watcher IDs and initial values, or an error if the services' relations could not be watched.
[ "WatchRemoteApplicationRelations", "starts", "a", "StringsWatcher", "for", "watching", "the", "relations", "of", "each", "specified", "application", "in", "the", "local", "model", "and", "returns", "the", "watcher", "IDs", "and", "initial", "values", "or", "an", "...
[ "'''\n WatchRemoteApplicationRelations starts a StringsWatcher for watching the relations of\n each specified application in the local model, and returns the watcher IDs\n and initial values, or an error if the services' relations could not be\n watched.\n\n entities : typing.Sequ...
[ { "param": "self", "type": null }, { "param": "entities", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "entities", "type": null, "docstring": null, "docstring_tokens...
f697638db76b9fc35cd762f0cbbb058c9ee6f5b1
sed-i/python-libjuju
juju/client/_client2.py
[ "Apache-2.0" ]
Python
WatchRemoteApplications
<not_specific>
async def WatchRemoteApplications(self): ''' WatchRemoteApplications starts a strings watcher that notifies of the addition, removal, and lifecycle changes of remote applications in the model; and returns the watcher ID and initial IDs of remote applications, or an error if watch...
WatchRemoteApplications starts a strings watcher that notifies of the addition, removal, and lifecycle changes of remote applications in the model; and returns the watcher ID and initial IDs of remote applications, or an error if watching failed. Returns -> StringsWatchResult ...
WatchRemoteApplications starts a strings watcher that notifies of the addition, removal, and lifecycle changes of remote applications in the model; and returns the watcher ID and initial IDs of remote applications, or an error if watching failed.
[ "WatchRemoteApplications", "starts", "a", "strings", "watcher", "that", "notifies", "of", "the", "addition", "removal", "and", "lifecycle", "changes", "of", "remote", "applications", "in", "the", "model", ";", "and", "returns", "the", "watcher", "ID", "and", "in...
async def WatchRemoteApplications(self): _params = dict() msg = dict(type='RemoteRelations', request='WatchRemoteApplications', version=2, params=_params) reply = await self.rpc(msg) return reply
[ "async", "def", "WatchRemoteApplications", "(", "self", ")", ":", "_params", "=", "dict", "(", ")", "msg", "=", "dict", "(", "type", "=", "'RemoteRelations'", ",", "request", "=", "'WatchRemoteApplications'", ",", "version", "=", "2", ",", "params", "=", "...
WatchRemoteApplications starts a strings watcher that notifies of the addition, removal, and lifecycle changes of remote applications in the model; and returns the watcher ID and initial IDs of remote applications, or an error if watching failed.
[ "WatchRemoteApplications", "starts", "a", "strings", "watcher", "that", "notifies", "of", "the", "addition", "removal", "and", "lifecycle", "changes", "of", "remote", "applications", "in", "the", "model", ";", "and", "returns", "the", "watcher", "ID", "and", "in...
[ "'''\n WatchRemoteApplications starts a strings watcher that notifies of the addition,\n removal, and lifecycle changes of remote applications in the model; and\n returns the watcher ID and initial IDs of remote applications, or an error if\n watching failed.\n\n\n Returns -> Stri...
[ { "param": "self", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
f697638db76b9fc35cd762f0cbbb058c9ee6f5b1
sed-i/python-libjuju
juju/client/_client2.py
[ "Apache-2.0" ]
Python
WatchRemoteRelations
<not_specific>
async def WatchRemoteRelations(self): ''' WatchRemoteRelations starts a strings watcher that notifies of the addition, removal, and lifecycle changes of remote relations in the model; and returns the watcher ID and initial IDs of remote relations, or an error if watching failed. ...
WatchRemoteRelations starts a strings watcher that notifies of the addition, removal, and lifecycle changes of remote relations in the model; and returns the watcher ID and initial IDs of remote relations, or an error if watching failed. Returns -> StringsWatchResult
WatchRemoteRelations starts a strings watcher that notifies of the addition, removal, and lifecycle changes of remote relations in the model; and returns the watcher ID and initial IDs of remote relations, or an error if watching failed.
[ "WatchRemoteRelations", "starts", "a", "strings", "watcher", "that", "notifies", "of", "the", "addition", "removal", "and", "lifecycle", "changes", "of", "remote", "relations", "in", "the", "model", ";", "and", "returns", "the", "watcher", "ID", "and", "initial"...
async def WatchRemoteRelations(self): _params = dict() msg = dict(type='RemoteRelations', request='WatchRemoteRelations', version=2, params=_params) reply = await self.rpc(msg) return reply
[ "async", "def", "WatchRemoteRelations", "(", "self", ")", ":", "_params", "=", "dict", "(", ")", "msg", "=", "dict", "(", "type", "=", "'RemoteRelations'", ",", "request", "=", "'WatchRemoteRelations'", ",", "version", "=", "2", ",", "params", "=", "_param...
WatchRemoteRelations starts a strings watcher that notifies of the addition, removal, and lifecycle changes of remote relations in the model; and returns the watcher ID and initial IDs of remote relations, or an error if watching failed.
[ "WatchRemoteRelations", "starts", "a", "strings", "watcher", "that", "notifies", "of", "the", "addition", "removal", "and", "lifecycle", "changes", "of", "remote", "relations", "in", "the", "model", ";", "and", "returns", "the", "watcher", "ID", "and", "initial"...
[ "'''\n WatchRemoteRelations starts a strings watcher that notifies of the addition,\n removal, and lifecycle changes of remote relations in the model; and\n returns the watcher ID and initial IDs of remote relations, or an error if\n watching failed.\n\n\n Returns -> StringsWatchR...
[ { "param": "self", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
f697638db76b9fc35cd762f0cbbb058c9ee6f5b1
sed-i/python-libjuju
juju/client/_client2.py
[ "Apache-2.0" ]
Python
AddPendingResources
<not_specific>
async def AddPendingResources(self, entity=None, charm_origin=None, macaroon=None, resources=None, tag=None, url=None): ''' AddPendingResources adds the provided resources (info) to the Juju model in a pending state, meaning they are not available until resolved. Handles CharmHub, CharmS...
AddPendingResources adds the provided resources (info) to the Juju model in a pending state, meaning they are not available until resolved. Handles CharmHub, CharmStore and Local charms. entity : Entity charm_origin : CharmOrigin macaroon : Macaroon resources : ...
AddPendingResources adds the provided resources (info) to the Juju model in a pending state, meaning they are not available until resolved.
[ "AddPendingResources", "adds", "the", "provided", "resources", "(", "info", ")", "to", "the", "Juju", "model", "in", "a", "pending", "state", "meaning", "they", "are", "not", "available", "until", "resolved", "." ]
async def AddPendingResources(self, entity=None, charm_origin=None, macaroon=None, resources=None, tag=None, url=None): if entity is not None and not isinstance(entity, (dict, Entity)): raise Exception("Expected entity to be a Entity, received: {}".format(type(entity))) if charm_origin is no...
[ "async", "def", "AddPendingResources", "(", "self", ",", "entity", "=", "None", ",", "charm_origin", "=", "None", ",", "macaroon", "=", "None", ",", "resources", "=", "None", ",", "tag", "=", "None", ",", "url", "=", "None", ")", ":", "if", "entity", ...
AddPendingResources adds the provided resources (info) to the Juju model in a pending state, meaning they are not available until resolved.
[ "AddPendingResources", "adds", "the", "provided", "resources", "(", "info", ")", "to", "the", "Juju", "model", "in", "a", "pending", "state", "meaning", "they", "are", "not", "available", "until", "resolved", "." ]
[ "'''\n AddPendingResources adds the provided resources (info) to the Juju\n model in a pending state, meaning they are not available until\n resolved. Handles CharmHub, CharmStore and Local charms.\n\n entity : Entity\n charm_origin : CharmOrigin\n macaroon : Macaroon\n ...
[ { "param": "self", "type": null }, { "param": "entity", "type": null }, { "param": "charm_origin", "type": null }, { "param": "macaroon", "type": null }, { "param": "resources", "type": null }, { "param": "tag", "type": null }, { "param": "...
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "entity", "type": null, "docstring": null, "docstring_tokens":...
f697638db76b9fc35cd762f0cbbb058c9ee6f5b1
sed-i/python-libjuju
juju/client/_client2.py
[ "Apache-2.0" ]
Python
ListResources
<not_specific>
async def ListResources(self, entities=None): ''' ListResources returns the list of resources for the given application. entities : typing.Sequence[~Entity] Returns -> ResourcesResults ''' if entities is not None and not isinstance(entities, (bytes, str, list)): ...
ListResources returns the list of resources for the given application. entities : typing.Sequence[~Entity] Returns -> ResourcesResults
ListResources returns the list of resources for the given application. entities : typing.Sequence[~Entity] Returns -> ResourcesResults
[ "ListResources", "returns", "the", "list", "of", "resources", "for", "the", "given", "application", ".", "entities", ":", "typing", ".", "Sequence", "[", "~Entity", "]", "Returns", "-", ">", "ResourcesResults" ]
async def ListResources(self, entities=None): if entities is not None and not isinstance(entities, (bytes, str, list)): raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) _params = dict() msg = dict(type='Resources', request=...
[ "async", "def", "ListResources", "(", "self", ",", "entities", "=", "None", ")", ":", "if", "entities", "is", "not", "None", "and", "not", "isinstance", "(", "entities", ",", "(", "bytes", ",", "str", ",", "list", ")", ")", ":", "raise", "Exception", ...
ListResources returns the list of resources for the given application.
[ "ListResources", "returns", "the", "list", "of", "resources", "for", "the", "given", "application", "." ]
[ "'''\n ListResources returns the list of resources for the given application.\n\n entities : typing.Sequence[~Entity]\n Returns -> ResourcesResults\n '''", "# map input types to rpc msg" ]
[ { "param": "self", "type": null }, { "param": "entities", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "entities", "type": null, "docstring": null, "docstring_tokens...
f697638db76b9fc35cd762f0cbbb058c9ee6f5b1
sed-i/python-libjuju
juju/client/_client2.py
[ "Apache-2.0" ]
Python
AllAddresses
<not_specific>
async def AllAddresses(self, entities=None): ''' AllAddresses reports all addresses that might have SSH listening for each given entity in args. Machines and units are supported as entity types. TODO(wpk): 2017-05-17 This is a temporary solution, we should not fetch environ here ...
AllAddresses reports all addresses that might have SSH listening for each given entity in args. Machines and units are supported as entity types. TODO(wpk): 2017-05-17 This is a temporary solution, we should not fetch environ here but get the addresses from state. We will be changing it...
AllAddresses reports all addresses that might have SSH listening for each given entity in args. Machines and units are supported as entity types. TODO(wpk): 2017-05-17 This is a temporary solution, we should not fetch environ here but get the addresses from state. We will be changing it since we want to have space-awar...
[ "AllAddresses", "reports", "all", "addresses", "that", "might", "have", "SSH", "listening", "for", "each", "given", "entity", "in", "args", ".", "Machines", "and", "units", "are", "supported", "as", "entity", "types", ".", "TODO", "(", "wpk", ")", ":", "20...
async def AllAddresses(self, entities=None): if entities is not None and not isinstance(entities, (bytes, str, list)): raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) _params = dict() msg = dict(type='SSHClient', request='...
[ "async", "def", "AllAddresses", "(", "self", ",", "entities", "=", "None", ")", ":", "if", "entities", "is", "not", "None", "and", "not", "isinstance", "(", "entities", ",", "(", "bytes", ",", "str", ",", "list", ")", ")", ":", "raise", "Exception", ...
AllAddresses reports all addresses that might have SSH listening for each given entity in args.
[ "AllAddresses", "reports", "all", "addresses", "that", "might", "have", "SSH", "listening", "for", "each", "given", "entity", "in", "args", "." ]
[ "'''\n AllAddresses reports all addresses that might have SSH listening for each given\n entity in args. Machines and units are supported as entity types.\n TODO(wpk): 2017-05-17 This is a temporary solution, we should not fetch environ here\n but get the addresses from state. We will be...
[ { "param": "self", "type": null }, { "param": "entities", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "entities", "type": null, "docstring": null, "docstring_tokens...
f697638db76b9fc35cd762f0cbbb058c9ee6f5b1
sed-i/python-libjuju
juju/client/_client2.py
[ "Apache-2.0" ]
Python
PrivateAddress
<not_specific>
async def PrivateAddress(self, entities=None): ''' PrivateAddress reports the preferred private network address for one or more entities. Machines and units are supported. entities : typing.Sequence[~Entity] Returns -> SSHAddressResults ''' if entities is not Non...
PrivateAddress reports the preferred private network address for one or more entities. Machines and units are supported. entities : typing.Sequence[~Entity] Returns -> SSHAddressResults
PrivateAddress reports the preferred private network address for one or more entities. Machines and units are supported. entities : typing.Sequence[~Entity] Returns -> SSHAddressResults
[ "PrivateAddress", "reports", "the", "preferred", "private", "network", "address", "for", "one", "or", "more", "entities", ".", "Machines", "and", "units", "are", "supported", ".", "entities", ":", "typing", ".", "Sequence", "[", "~Entity", "]", "Returns", "-",...
async def PrivateAddress(self, entities=None): if entities is not None and not isinstance(entities, (bytes, str, list)): raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) _params = dict() msg = dict(type='SSHClient', request...
[ "async", "def", "PrivateAddress", "(", "self", ",", "entities", "=", "None", ")", ":", "if", "entities", "is", "not", "None", "and", "not", "isinstance", "(", "entities", ",", "(", "bytes", ",", "str", ",", "list", ")", ")", ":", "raise", "Exception", ...
PrivateAddress reports the preferred private network address for one or more entities.
[ "PrivateAddress", "reports", "the", "preferred", "private", "network", "address", "for", "one", "or", "more", "entities", "." ]
[ "'''\n PrivateAddress reports the preferred private network address for one or\n more entities. Machines and units are supported.\n\n entities : typing.Sequence[~Entity]\n Returns -> SSHAddressResults\n '''", "# map input types to rpc msg" ]
[ { "param": "self", "type": null }, { "param": "entities", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "entities", "type": null, "docstring": null, "docstring_tokens...
f697638db76b9fc35cd762f0cbbb058c9ee6f5b1
sed-i/python-libjuju
juju/client/_client2.py
[ "Apache-2.0" ]
Python
Proxy
<not_specific>
async def Proxy(self): ''' Proxy returns whether SSH connections should be proxied through the controller hosts for the model associated with the API connection. Returns -> SSHProxyResult ''' # map input types to rpc msg _params = dict() msg = dict(type...
Proxy returns whether SSH connections should be proxied through the controller hosts for the model associated with the API connection. Returns -> SSHProxyResult
Proxy returns whether SSH connections should be proxied through the controller hosts for the model associated with the API connection.
[ "Proxy", "returns", "whether", "SSH", "connections", "should", "be", "proxied", "through", "the", "controller", "hosts", "for", "the", "model", "associated", "with", "the", "API", "connection", "." ]
async def Proxy(self): _params = dict() msg = dict(type='SSHClient', request='Proxy', version=2, params=_params) reply = await self.rpc(msg) return reply
[ "async", "def", "Proxy", "(", "self", ")", ":", "_params", "=", "dict", "(", ")", "msg", "=", "dict", "(", "type", "=", "'SSHClient'", ",", "request", "=", "'Proxy'", ",", "version", "=", "2", ",", "params", "=", "_params", ")", "reply", "=", "awai...
Proxy returns whether SSH connections should be proxied through the controller hosts for the model associated with the API connection.
[ "Proxy", "returns", "whether", "SSH", "connections", "should", "be", "proxied", "through", "the", "controller", "hosts", "for", "the", "model", "associated", "with", "the", "API", "connection", "." ]
[ "'''\n Proxy returns whether SSH connections should be proxied through the\n controller hosts for the model associated with the API connection.\n\n\n Returns -> SSHProxyResult\n '''", "# map input types to rpc msg" ]
[ { "param": "self", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
f697638db76b9fc35cd762f0cbbb058c9ee6f5b1
sed-i/python-libjuju
juju/client/_client2.py
[ "Apache-2.0" ]
Python
PublicAddress
<not_specific>
async def PublicAddress(self, entities=None): ''' PublicAddress reports the preferred public network address for one or more entities. Machines and units are suppored. entities : typing.Sequence[~Entity] Returns -> SSHAddressResults ''' if entities is not None an...
PublicAddress reports the preferred public network address for one or more entities. Machines and units are suppored. entities : typing.Sequence[~Entity] Returns -> SSHAddressResults
PublicAddress reports the preferred public network address for one or more entities. Machines and units are suppored. entities : typing.Sequence[~Entity] Returns -> SSHAddressResults
[ "PublicAddress", "reports", "the", "preferred", "public", "network", "address", "for", "one", "or", "more", "entities", ".", "Machines", "and", "units", "are", "suppored", ".", "entities", ":", "typing", ".", "Sequence", "[", "~Entity", "]", "Returns", "-", ...
async def PublicAddress(self, entities=None): if entities is not None and not isinstance(entities, (bytes, str, list)): raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) _params = dict() msg = dict(type='SSHClient', request=...
[ "async", "def", "PublicAddress", "(", "self", ",", "entities", "=", "None", ")", ":", "if", "entities", "is", "not", "None", "and", "not", "isinstance", "(", "entities", ",", "(", "bytes", ",", "str", ",", "list", ")", ")", ":", "raise", "Exception", ...
PublicAddress reports the preferred public network address for one or more entities.
[ "PublicAddress", "reports", "the", "preferred", "public", "network", "address", "for", "one", "or", "more", "entities", "." ]
[ "'''\n PublicAddress reports the preferred public network address for one\n or more entities. Machines and units are suppored.\n\n entities : typing.Sequence[~Entity]\n Returns -> SSHAddressResults\n '''", "# map input types to rpc msg" ]
[ { "param": "self", "type": null }, { "param": "entities", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "entities", "type": null, "docstring": null, "docstring_tokens...
f697638db76b9fc35cd762f0cbbb058c9ee6f5b1
sed-i/python-libjuju
juju/client/_client2.py
[ "Apache-2.0" ]
Python
PublicKeys
<not_specific>
async def PublicKeys(self, entities=None): ''' PublicKeys returns the public SSH hosts for one or more entities. Machines and units are supported. entities : typing.Sequence[~Entity] Returns -> SSHPublicKeysResults ''' if entities is not None and not isinstance(e...
PublicKeys returns the public SSH hosts for one or more entities. Machines and units are supported. entities : typing.Sequence[~Entity] Returns -> SSHPublicKeysResults
PublicKeys returns the public SSH hosts for one or more entities. Machines and units are supported. entities : typing.Sequence[~Entity] Returns -> SSHPublicKeysResults
[ "PublicKeys", "returns", "the", "public", "SSH", "hosts", "for", "one", "or", "more", "entities", ".", "Machines", "and", "units", "are", "supported", ".", "entities", ":", "typing", ".", "Sequence", "[", "~Entity", "]", "Returns", "-", ">", "SSHPublicKeysRe...
async def PublicKeys(self, entities=None): if entities is not None and not isinstance(entities, (bytes, str, list)): raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) _params = dict() msg = dict(type='SSHClient', request='Pu...
[ "async", "def", "PublicKeys", "(", "self", ",", "entities", "=", "None", ")", ":", "if", "entities", "is", "not", "None", "and", "not", "isinstance", "(", "entities", ",", "(", "bytes", ",", "str", ",", "list", ")", ")", ":", "raise", "Exception", "(...
PublicKeys returns the public SSH hosts for one or more entities.
[ "PublicKeys", "returns", "the", "public", "SSH", "hosts", "for", "one", "or", "more", "entities", "." ]
[ "'''\n PublicKeys returns the public SSH hosts for one or more\n entities. Machines and units are supported.\n\n entities : typing.Sequence[~Entity]\n Returns -> SSHPublicKeysResults\n '''", "# map input types to rpc msg" ]
[ { "param": "self", "type": null }, { "param": "entities", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "entities", "type": null, "docstring": null, "docstring_tokens...
f697638db76b9fc35cd762f0cbbb058c9ee6f5b1
sed-i/python-libjuju
juju/client/_client2.py
[ "Apache-2.0" ]
Python
Claim
<not_specific>
async def Claim(self, claims=None): ''' Claim makes the supplied singular-controller lease requests. (In practice, any requests not for the connection's model or controller, or not on behalf of the connected ModelManager machine, will be rejected.) claims : typing.Sequence[~Sing...
Claim makes the supplied singular-controller lease requests. (In practice, any requests not for the connection's model or controller, or not on behalf of the connected ModelManager machine, will be rejected.) claims : typing.Sequence[~SingularClaim] Returns -> ErrorResults ...
Claim makes the supplied singular-controller lease requests. (In practice, any requests not for the connection's model or controller, or not on behalf of the connected ModelManager machine, will be rejected.)
[ "Claim", "makes", "the", "supplied", "singular", "-", "controller", "lease", "requests", ".", "(", "In", "practice", "any", "requests", "not", "for", "the", "connection", "'", "s", "model", "or", "controller", "or", "not", "on", "behalf", "of", "the", "con...
async def Claim(self, claims=None): if claims is not None and not isinstance(claims, (bytes, str, list)): raise Exception("Expected claims to be a Sequence, received: {}".format(type(claims))) _params = dict() msg = dict(type='Singular', request='Claim', ...
[ "async", "def", "Claim", "(", "self", ",", "claims", "=", "None", ")", ":", "if", "claims", "is", "not", "None", "and", "not", "isinstance", "(", "claims", ",", "(", "bytes", ",", "str", ",", "list", ")", ")", ":", "raise", "Exception", "(", "\"Exp...
Claim makes the supplied singular-controller lease requests.
[ "Claim", "makes", "the", "supplied", "singular", "-", "controller", "lease", "requests", "." ]
[ "'''\n Claim makes the supplied singular-controller lease requests. (In practice,\n any requests not for the connection's model or controller, or not on behalf\n of the connected ModelManager machine, will be rejected.)\n\n claims : typing.Sequence[~SingularClaim]\n Returns -> Err...
[ { "param": "self", "type": null }, { "param": "claims", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "claims", "type": null, "docstring": null, "docstring_tokens":...
f697638db76b9fc35cd762f0cbbb058c9ee6f5b1
sed-i/python-libjuju
juju/client/_client2.py
[ "Apache-2.0" ]
Python
Wait
<not_specific>
async def Wait(self, entities=None): ''' Wait waits for the singular-controller lease to expire for all supplied entities. (In practice, any requests that do not refer to the connection's model or controller will be rejected.) entities : typing.Sequence[~Entity] Returns ...
Wait waits for the singular-controller lease to expire for all supplied entities. (In practice, any requests that do not refer to the connection's model or controller will be rejected.) entities : typing.Sequence[~Entity] Returns -> ErrorResults
Wait waits for the singular-controller lease to expire for all supplied entities. (In practice, any requests that do not refer to the connection's model or controller will be rejected.) entities : typing.Sequence[~Entity] Returns -> ErrorResults
[ "Wait", "waits", "for", "the", "singular", "-", "controller", "lease", "to", "expire", "for", "all", "supplied", "entities", ".", "(", "In", "practice", "any", "requests", "that", "do", "not", "refer", "to", "the", "connection", "'", "s", "model", "or", ...
async def Wait(self, entities=None): if entities is not None and not isinstance(entities, (bytes, str, list)): raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) _params = dict() msg = dict(type='Singular', request='Wait', ...
[ "async", "def", "Wait", "(", "self", ",", "entities", "=", "None", ")", ":", "if", "entities", "is", "not", "None", "and", "not", "isinstance", "(", "entities", ",", "(", "bytes", ",", "str", ",", "list", ")", ")", ":", "raise", "Exception", "(", "...
Wait waits for the singular-controller lease to expire for all supplied entities.
[ "Wait", "waits", "for", "the", "singular", "-", "controller", "lease", "to", "expire", "for", "all", "supplied", "entities", "." ]
[ "'''\n Wait waits for the singular-controller lease to expire for all supplied\n entities. (In practice, any requests that do not refer to the connection's\n model or controller will be rejected.)\n\n entities : typing.Sequence[~Entity]\n Returns -> ErrorResults\n '''", "...
[ { "param": "self", "type": null }, { "param": "entities", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "entities", "type": null, "docstring": null, "docstring_tokens...
f697638db76b9fc35cd762f0cbbb058c9ee6f5b1
sed-i/python-libjuju
juju/client/_client2.py
[ "Apache-2.0" ]
Python
ModelConfig
<not_specific>
async def ModelConfig(self): ''' ModelConfig returns the current model's configuration. Returns -> ModelConfigResult ''' # map input types to rpc msg _params = dict() msg = dict(type='StatusHistory', request='ModelConfig', ...
ModelConfig returns the current model's configuration. Returns -> ModelConfigResult
ModelConfig returns the current model's configuration.
[ "ModelConfig", "returns", "the", "current", "model", "'", "s", "configuration", "." ]
async def ModelConfig(self): _params = dict() msg = dict(type='StatusHistory', request='ModelConfig', version=2, params=_params) reply = await self.rpc(msg) return reply
[ "async", "def", "ModelConfig", "(", "self", ")", ":", "_params", "=", "dict", "(", ")", "msg", "=", "dict", "(", "type", "=", "'StatusHistory'", ",", "request", "=", "'ModelConfig'", ",", "version", "=", "2", ",", "params", "=", "_params", ")", "reply"...
ModelConfig returns the current model's configuration.
[ "ModelConfig", "returns", "the", "current", "model", "'", "s", "configuration", "." ]
[ "'''\n ModelConfig returns the current model's configuration.\n\n\n Returns -> ModelConfigResult\n '''", "# map input types to rpc msg" ]
[ { "param": "self", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
f697638db76b9fc35cd762f0cbbb058c9ee6f5b1
sed-i/python-libjuju
juju/client/_client2.py
[ "Apache-2.0" ]
Python
Prune
<not_specific>
async def Prune(self, max_history_mb=None, max_history_time=None): ''' Prune endpoint removes status history entries until only the ones newer than now - p.MaxHistoryTime remain and the history is smaller than p.MaxHistoryMB. max_history_mb : int max_history_time : int ...
Prune endpoint removes status history entries until only the ones newer than now - p.MaxHistoryTime remain and the history is smaller than p.MaxHistoryMB. max_history_mb : int max_history_time : int Returns -> None
Prune endpoint removes status history entries until only the ones newer than now - p.MaxHistoryTime remain and the history is smaller than p.MaxHistoryMB. max_history_mb : int max_history_time : int Returns -> None
[ "Prune", "endpoint", "removes", "status", "history", "entries", "until", "only", "the", "ones", "newer", "than", "now", "-", "p", ".", "MaxHistoryTime", "remain", "and", "the", "history", "is", "smaller", "than", "p", ".", "MaxHistoryMB", ".", "max_history_mb"...
async def Prune(self, max_history_mb=None, max_history_time=None): if max_history_mb is not None and not isinstance(max_history_mb, int): raise Exception("Expected max_history_mb to be a int, received: {}".format(type(max_history_mb))) if max_history_time is not None and not isinstance(max_h...
[ "async", "def", "Prune", "(", "self", ",", "max_history_mb", "=", "None", ",", "max_history_time", "=", "None", ")", ":", "if", "max_history_mb", "is", "not", "None", "and", "not", "isinstance", "(", "max_history_mb", ",", "int", ")", ":", "raise", "Except...
Prune endpoint removes status history entries until only the ones newer than now - p.MaxHistoryTime remain and the history is smaller than p.MaxHistoryMB.
[ "Prune", "endpoint", "removes", "status", "history", "entries", "until", "only", "the", "ones", "newer", "than", "now", "-", "p", ".", "MaxHistoryTime", "remain", "and", "the", "history", "is", "smaller", "than", "p", ".", "MaxHistoryMB", "." ]
[ "'''\n Prune endpoint removes status history entries until\n only the ones newer than now - p.MaxHistoryTime remain and\n the history is smaller than p.MaxHistoryMB.\n\n max_history_mb : int\n max_history_time : int\n Returns -> None\n '''", "# map input types to r...
[ { "param": "self", "type": null }, { "param": "max_history_mb", "type": null }, { "param": "max_history_time", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "max_history_mb", "type": null, "docstring": null, "docstring_...
f697638db76b9fc35cd762f0cbbb058c9ee6f5b1
sed-i/python-libjuju
juju/client/_client2.py
[ "Apache-2.0" ]
Python
WatchForModelConfigChanges
<not_specific>
async def WatchForModelConfigChanges(self): ''' WatchForModelConfigChanges returns a NotifyWatcher that observes changes to the model configuration. Note that although the NotifyWatchResult contains an Error field, it's not used because we are only returning a single watcher, ...
WatchForModelConfigChanges returns a NotifyWatcher that observes changes to the model configuration. Note that although the NotifyWatchResult contains an Error field, it's not used because we are only returning a single watcher, so we use the regular error return. Retu...
WatchForModelConfigChanges returns a NotifyWatcher that observes changes to the model configuration. Note that although the NotifyWatchResult contains an Error field, it's not used because we are only returning a single watcher, so we use the regular error return.
[ "WatchForModelConfigChanges", "returns", "a", "NotifyWatcher", "that", "observes", "changes", "to", "the", "model", "configuration", ".", "Note", "that", "although", "the", "NotifyWatchResult", "contains", "an", "Error", "field", "it", "'", "s", "not", "used", "be...
async def WatchForModelConfigChanges(self): _params = dict() msg = dict(type='StatusHistory', request='WatchForModelConfigChanges', version=2, params=_params) reply = await self.rpc(msg) return reply
[ "async", "def", "WatchForModelConfigChanges", "(", "self", ")", ":", "_params", "=", "dict", "(", ")", "msg", "=", "dict", "(", "type", "=", "'StatusHistory'", ",", "request", "=", "'WatchForModelConfigChanges'", ",", "version", "=", "2", ",", "params", "=",...
WatchForModelConfigChanges returns a NotifyWatcher that observes changes to the model configuration.
[ "WatchForModelConfigChanges", "returns", "a", "NotifyWatcher", "that", "observes", "changes", "to", "the", "model", "configuration", "." ]
[ "'''\n WatchForModelConfigChanges returns a NotifyWatcher that observes\n changes to the model configuration.\n Note that although the NotifyWatchResult contains an Error field,\n it's not used because we are only returning a single watcher,\n so we use the regular error return.\n...
[ { "param": "self", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
f697638db76b9fc35cd762f0cbbb058c9ee6f5b1
sed-i/python-libjuju
juju/client/_client2.py
[ "Apache-2.0" ]
Python
CurrentSeries
<not_specific>
async def CurrentSeries(self, entities=None): ''' CurrentSeries returns what Juju thinks the current series of the machine is. Note that a machine could have been upgraded out-of-band by running do-release-upgrade outside of the upgrade-series workflow, making this value incorrec...
CurrentSeries returns what Juju thinks the current series of the machine is. Note that a machine could have been upgraded out-of-band by running do-release-upgrade outside of the upgrade-series workflow, making this value incorrect. entities : typing.Sequence[~Entity] R...
CurrentSeries returns what Juju thinks the current series of the machine is. entities : typing.Sequence[~Entity] Returns -> StringResults
[ "CurrentSeries", "returns", "what", "Juju", "thinks", "the", "current", "series", "of", "the", "machine", "is", ".", "entities", ":", "typing", ".", "Sequence", "[", "~Entity", "]", "Returns", "-", ">", "StringResults" ]
async def CurrentSeries(self, entities=None): if entities is not None and not isinstance(entities, (bytes, str, list)): raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) _params = dict() msg = dict(type='UpgradeSeries', requ...
[ "async", "def", "CurrentSeries", "(", "self", ",", "entities", "=", "None", ")", ":", "if", "entities", "is", "not", "None", "and", "not", "isinstance", "(", "entities", ",", "(", "bytes", ",", "str", ",", "list", ")", ")", ":", "raise", "Exception", ...
CurrentSeries returns what Juju thinks the current series of the machine is.
[ "CurrentSeries", "returns", "what", "Juju", "thinks", "the", "current", "series", "of", "the", "machine", "is", "." ]
[ "'''\n CurrentSeries returns what Juju thinks the current series of the machine is.\n Note that a machine could have been upgraded out-of-band by running\n do-release-upgrade outside of the upgrade-series workflow,\n making this value incorrect.\n\n entities : typing.Sequence[~Ent...
[ { "param": "self", "type": null }, { "param": "entities", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "entities", "type": null, "docstring": null, "docstring_tokens...
f697638db76b9fc35cd762f0cbbb058c9ee6f5b1
sed-i/python-libjuju
juju/client/_client2.py
[ "Apache-2.0" ]
Python
FinishUpgradeSeries
<not_specific>
async def FinishUpgradeSeries(self, args=None): ''' FinishUpgradeSeries is the last action in the upgrade workflow and is called after all machine and unit statuses are "completed". It updates the machine series to reflect the completed upgrade, then removes the upgrade-series lo...
FinishUpgradeSeries is the last action in the upgrade workflow and is called after all machine and unit statuses are "completed". It updates the machine series to reflect the completed upgrade, then removes the upgrade-series lock. args : typing.Sequence[~UpdateSeriesArg] ...
FinishUpgradeSeries is the last action in the upgrade workflow and is called after all machine and unit statuses are "completed". It updates the machine series to reflect the completed upgrade, then removes the upgrade-series lock.
[ "FinishUpgradeSeries", "is", "the", "last", "action", "in", "the", "upgrade", "workflow", "and", "is", "called", "after", "all", "machine", "and", "unit", "statuses", "are", "\"", "completed", "\"", ".", "It", "updates", "the", "machine", "series", "to", "re...
async def FinishUpgradeSeries(self, args=None): if args is not None and not isinstance(args, (bytes, str, list)): raise Exception("Expected args to be a Sequence, received: {}".format(type(args))) _params = dict() msg = dict(type='UpgradeSeries', request='FinishUpg...
[ "async", "def", "FinishUpgradeSeries", "(", "self", ",", "args", "=", "None", ")", ":", "if", "args", "is", "not", "None", "and", "not", "isinstance", "(", "args", ",", "(", "bytes", ",", "str", ",", "list", ")", ")", ":", "raise", "Exception", "(", ...
FinishUpgradeSeries is the last action in the upgrade workflow and is called after all machine and unit statuses are "completed".
[ "FinishUpgradeSeries", "is", "the", "last", "action", "in", "the", "upgrade", "workflow", "and", "is", "called", "after", "all", "machine", "and", "unit", "statuses", "are", "\"", "completed", "\"", "." ]
[ "'''\n FinishUpgradeSeries is the last action in the upgrade workflow and is\n called after all machine and unit statuses are \"completed\".\n It updates the machine series to reflect the completed upgrade, then\n removes the upgrade-series lock.\n\n args : typing.Sequence[~Update...
[ { "param": "self", "type": null }, { "param": "args", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "args", "type": null, "docstring": null, "docstring_tokens": [...
f697638db76b9fc35cd762f0cbbb058c9ee6f5b1
sed-i/python-libjuju
juju/client/_client2.py
[ "Apache-2.0" ]
Python
MachineStatus
<not_specific>
async def MachineStatus(self, entities=None): ''' MachineStatus gets the current upgrade-series status of a machine. entities : typing.Sequence[~Entity] Returns -> UpgradeSeriesStatusResults ''' if entities is not None and not isinstance(entities, (bytes, str, list)): ...
MachineStatus gets the current upgrade-series status of a machine. entities : typing.Sequence[~Entity] Returns -> UpgradeSeriesStatusResults
MachineStatus gets the current upgrade-series status of a machine. entities : typing.Sequence[~Entity] Returns -> UpgradeSeriesStatusResults
[ "MachineStatus", "gets", "the", "current", "upgrade", "-", "series", "status", "of", "a", "machine", ".", "entities", ":", "typing", ".", "Sequence", "[", "~Entity", "]", "Returns", "-", ">", "UpgradeSeriesStatusResults" ]
async def MachineStatus(self, entities=None): if entities is not None and not isinstance(entities, (bytes, str, list)): raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) _params = dict() msg = dict(type='UpgradeSeries', requ...
[ "async", "def", "MachineStatus", "(", "self", ",", "entities", "=", "None", ")", ":", "if", "entities", "is", "not", "None", "and", "not", "isinstance", "(", "entities", ",", "(", "bytes", ",", "str", ",", "list", ")", ")", ":", "raise", "Exception", ...
MachineStatus gets the current upgrade-series status of a machine.
[ "MachineStatus", "gets", "the", "current", "upgrade", "-", "series", "status", "of", "a", "machine", "." ]
[ "'''\n MachineStatus gets the current upgrade-series status of a machine.\n\n entities : typing.Sequence[~Entity]\n Returns -> UpgradeSeriesStatusResults\n '''", "# map input types to rpc msg" ]
[ { "param": "self", "type": null }, { "param": "entities", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "entities", "type": null, "docstring": null, "docstring_tokens...
f697638db76b9fc35cd762f0cbbb058c9ee6f5b1
sed-i/python-libjuju
juju/client/_client2.py
[ "Apache-2.0" ]
Python
PinMachineApplications
<not_specific>
async def PinMachineApplications(self): ''' PinMachineApplications pins leadership for applications represented by units running on the auth'd machine. Returns -> PinApplicationsResults ''' # map input types to rpc msg _params = dict() msg = dict(type='...
PinMachineApplications pins leadership for applications represented by units running on the auth'd machine. Returns -> PinApplicationsResults
PinMachineApplications pins leadership for applications represented by units running on the auth'd machine.
[ "PinMachineApplications", "pins", "leadership", "for", "applications", "represented", "by", "units", "running", "on", "the", "auth", "'", "d", "machine", "." ]
async def PinMachineApplications(self): _params = dict() msg = dict(type='UpgradeSeries', request='PinMachineApplications', version=2, params=_params) reply = await self.rpc(msg) return reply
[ "async", "def", "PinMachineApplications", "(", "self", ")", ":", "_params", "=", "dict", "(", ")", "msg", "=", "dict", "(", "type", "=", "'UpgradeSeries'", ",", "request", "=", "'PinMachineApplications'", ",", "version", "=", "2", ",", "params", "=", "_par...
PinMachineApplications pins leadership for applications represented by units running on the auth'd machine.
[ "PinMachineApplications", "pins", "leadership", "for", "applications", "represented", "by", "units", "running", "on", "the", "auth", "'", "d", "machine", "." ]
[ "'''\n PinMachineApplications pins leadership for applications represented by units\n running on the auth'd machine.\n\n\n Returns -> PinApplicationsResults\n '''", "# map input types to rpc msg" ]
[ { "param": "self", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
f697638db76b9fc35cd762f0cbbb058c9ee6f5b1
sed-i/python-libjuju
juju/client/_client2.py
[ "Apache-2.0" ]
Python
PinnedLeadership
<not_specific>
async def PinnedLeadership(self): ''' PinnedLeadership returns all pinned applications and the entities that require their pinned behaviour, for leadership in the current model. Returns -> PinnedLeadershipResult ''' # map input types to rpc msg _params = dict()...
PinnedLeadership returns all pinned applications and the entities that require their pinned behaviour, for leadership in the current model. Returns -> PinnedLeadershipResult
PinnedLeadership returns all pinned applications and the entities that require their pinned behaviour, for leadership in the current model.
[ "PinnedLeadership", "returns", "all", "pinned", "applications", "and", "the", "entities", "that", "require", "their", "pinned", "behaviour", "for", "leadership", "in", "the", "current", "model", "." ]
async def PinnedLeadership(self): _params = dict() msg = dict(type='UpgradeSeries', request='PinnedLeadership', version=2, params=_params) reply = await self.rpc(msg) return reply
[ "async", "def", "PinnedLeadership", "(", "self", ")", ":", "_params", "=", "dict", "(", ")", "msg", "=", "dict", "(", "type", "=", "'UpgradeSeries'", ",", "request", "=", "'PinnedLeadership'", ",", "version", "=", "2", ",", "params", "=", "_params", ")",...
PinnedLeadership returns all pinned applications and the entities that require their pinned behaviour, for leadership in the current model.
[ "PinnedLeadership", "returns", "all", "pinned", "applications", "and", "the", "entities", "that", "require", "their", "pinned", "behaviour", "for", "leadership", "in", "the", "current", "model", "." ]
[ "'''\n PinnedLeadership returns all pinned applications and the entities that\n require their pinned behaviour, for leadership in the current model.\n\n\n Returns -> PinnedLeadershipResult\n '''", "# map input types to rpc msg" ]
[ { "param": "self", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
f697638db76b9fc35cd762f0cbbb058c9ee6f5b1
sed-i/python-libjuju
juju/client/_client2.py
[ "Apache-2.0" ]
Python
SetMachineStatus
<not_specific>
async def SetMachineStatus(self, params=None): ''' SetMachineStatus sets the current upgrade-series status of a machine. params : typing.Sequence[~UpgradeSeriesStatusParam] Returns -> ErrorResults ''' if params is not None and not isinstance(params, (bytes, str, list)): ...
SetMachineStatus sets the current upgrade-series status of a machine. params : typing.Sequence[~UpgradeSeriesStatusParam] Returns -> ErrorResults
SetMachineStatus sets the current upgrade-series status of a machine.
[ "SetMachineStatus", "sets", "the", "current", "upgrade", "-", "series", "status", "of", "a", "machine", "." ]
async def SetMachineStatus(self, params=None): if params is not None and not isinstance(params, (bytes, str, list)): raise Exception("Expected params to be a Sequence, received: {}".format(type(params))) _params = dict() msg = dict(type='UpgradeSeries', request='Se...
[ "async", "def", "SetMachineStatus", "(", "self", ",", "params", "=", "None", ")", ":", "if", "params", "is", "not", "None", "and", "not", "isinstance", "(", "params", ",", "(", "bytes", ",", "str", ",", "list", ")", ")", ":", "raise", "Exception", "(...
SetMachineStatus sets the current upgrade-series status of a machine.
[ "SetMachineStatus", "sets", "the", "current", "upgrade", "-", "series", "status", "of", "a", "machine", "." ]
[ "'''\n SetMachineStatus sets the current upgrade-series status of a machine.\n\n params : typing.Sequence[~UpgradeSeriesStatusParam]\n Returns -> ErrorResults\n '''", "# map input types to rpc msg" ]
[ { "param": "self", "type": null }, { "param": "params", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "params", "type": null, "docstring": null, "docstring_tokens":...
f697638db76b9fc35cd762f0cbbb058c9ee6f5b1
sed-i/python-libjuju
juju/client/_client2.py
[ "Apache-2.0" ]
Python
SetUpgradeSeriesUnitStatus
<not_specific>
async def SetUpgradeSeriesUnitStatus(self, params=None): ''' SetUpgradeSeriesUnitStatus sets the upgrade series status of the unit. If no upgrade is in progress an error is returned instead. params : typing.Sequence[~UpgradeSeriesStatusParam] Returns -> ErrorResults ''' ...
SetUpgradeSeriesUnitStatus sets the upgrade series status of the unit. If no upgrade is in progress an error is returned instead. params : typing.Sequence[~UpgradeSeriesStatusParam] Returns -> ErrorResults
SetUpgradeSeriesUnitStatus sets the upgrade series status of the unit. If no upgrade is in progress an error is returned instead.
[ "SetUpgradeSeriesUnitStatus", "sets", "the", "upgrade", "series", "status", "of", "the", "unit", ".", "If", "no", "upgrade", "is", "in", "progress", "an", "error", "is", "returned", "instead", "." ]
async def SetUpgradeSeriesUnitStatus(self, params=None): if params is not None and not isinstance(params, (bytes, str, list)): raise Exception("Expected params to be a Sequence, received: {}".format(type(params))) _params = dict() msg = dict(type='UpgradeSeries', r...
[ "async", "def", "SetUpgradeSeriesUnitStatus", "(", "self", ",", "params", "=", "None", ")", ":", "if", "params", "is", "not", "None", "and", "not", "isinstance", "(", "params", ",", "(", "bytes", ",", "str", ",", "list", ")", ")", ":", "raise", "Except...
SetUpgradeSeriesUnitStatus sets the upgrade series status of the unit.
[ "SetUpgradeSeriesUnitStatus", "sets", "the", "upgrade", "series", "status", "of", "the", "unit", "." ]
[ "'''\n SetUpgradeSeriesUnitStatus sets the upgrade series status of the unit.\n If no upgrade is in progress an error is returned instead.\n\n params : typing.Sequence[~UpgradeSeriesStatusParam]\n Returns -> ErrorResults\n '''", "# map input types to rpc msg" ]
[ { "param": "self", "type": null }, { "param": "params", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "params", "type": null, "docstring": null, "docstring_tokens":...
f697638db76b9fc35cd762f0cbbb058c9ee6f5b1
sed-i/python-libjuju
juju/client/_client2.py
[ "Apache-2.0" ]
Python
StartUnitCompletion
<not_specific>
async def StartUnitCompletion(self, entities=None, message=None): ''' StartUnitCompletion starts the upgrade series completion phase for all subordinate units of a given machine. entities : typing.Sequence[~Entity] message : str Returns -> ErrorResults ''' ...
StartUnitCompletion starts the upgrade series completion phase for all subordinate units of a given machine. entities : typing.Sequence[~Entity] message : str Returns -> ErrorResults
StartUnitCompletion starts the upgrade series completion phase for all subordinate units of a given machine. entities : typing.Sequence[~Entity] message : str Returns -> ErrorResults
[ "StartUnitCompletion", "starts", "the", "upgrade", "series", "completion", "phase", "for", "all", "subordinate", "units", "of", "a", "given", "machine", ".", "entities", ":", "typing", ".", "Sequence", "[", "~Entity", "]", "message", ":", "str", "Returns", "-"...
async def StartUnitCompletion(self, entities=None, message=None): if entities is not None and not isinstance(entities, (bytes, str, list)): raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) if message is not None and not isinstance(message, (bytes, st...
[ "async", "def", "StartUnitCompletion", "(", "self", ",", "entities", "=", "None", ",", "message", "=", "None", ")", ":", "if", "entities", "is", "not", "None", "and", "not", "isinstance", "(", "entities", ",", "(", "bytes", ",", "str", ",", "list", ")"...
StartUnitCompletion starts the upgrade series completion phase for all subordinate units of a given machine.
[ "StartUnitCompletion", "starts", "the", "upgrade", "series", "completion", "phase", "for", "all", "subordinate", "units", "of", "a", "given", "machine", "." ]
[ "'''\n StartUnitCompletion starts the upgrade series completion phase for all subordinate\n units of a given machine.\n\n entities : typing.Sequence[~Entity]\n message : str\n Returns -> ErrorResults\n '''", "# map input types to rpc msg" ]
[ { "param": "self", "type": null }, { "param": "entities", "type": null }, { "param": "message", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "entities", "type": null, "docstring": null, "docstring_tokens...
f697638db76b9fc35cd762f0cbbb058c9ee6f5b1
sed-i/python-libjuju
juju/client/_client2.py
[ "Apache-2.0" ]
Python
TargetSeries
<not_specific>
async def TargetSeries(self, entities=None): ''' TargetSeries returns the series that a machine has been locked for upgrading to. entities : typing.Sequence[~Entity] Returns -> StringResults ''' if entities is not None and not isinstance(entities, (bytes, str, li...
TargetSeries returns the series that a machine has been locked for upgrading to. entities : typing.Sequence[~Entity] Returns -> StringResults
TargetSeries returns the series that a machine has been locked for upgrading to. entities : typing.Sequence[~Entity] Returns -> StringResults
[ "TargetSeries", "returns", "the", "series", "that", "a", "machine", "has", "been", "locked", "for", "upgrading", "to", ".", "entities", ":", "typing", ".", "Sequence", "[", "~Entity", "]", "Returns", "-", ">", "StringResults" ]
async def TargetSeries(self, entities=None): if entities is not None and not isinstance(entities, (bytes, str, list)): raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) _params = dict() msg = dict(type='UpgradeSeries', reque...
[ "async", "def", "TargetSeries", "(", "self", ",", "entities", "=", "None", ")", ":", "if", "entities", "is", "not", "None", "and", "not", "isinstance", "(", "entities", ",", "(", "bytes", ",", "str", ",", "list", ")", ")", ":", "raise", "Exception", ...
TargetSeries returns the series that a machine has been locked for upgrading to.
[ "TargetSeries", "returns", "the", "series", "that", "a", "machine", "has", "been", "locked", "for", "upgrading", "to", "." ]
[ "'''\n TargetSeries returns the series that a machine has been locked\n for upgrading to.\n\n entities : typing.Sequence[~Entity]\n Returns -> StringResults\n '''", "# map input types to rpc msg" ]
[ { "param": "self", "type": null }, { "param": "entities", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "entities", "type": null, "docstring": null, "docstring_tokens...
f697638db76b9fc35cd762f0cbbb058c9ee6f5b1
sed-i/python-libjuju
juju/client/_client2.py
[ "Apache-2.0" ]
Python
UnitsCompleted
<not_specific>
async def UnitsCompleted(self, entities=None): ''' UnitsCompleted returns the units running on this machine that have completed the upgrade-series workflow and are in their normal running state. entities : typing.Sequence[~Entity] Returns -> EntitiesResults ''' i...
UnitsCompleted returns the units running on this machine that have completed the upgrade-series workflow and are in their normal running state. entities : typing.Sequence[~Entity] Returns -> EntitiesResults
UnitsCompleted returns the units running on this machine that have completed the upgrade-series workflow and are in their normal running state. entities : typing.Sequence[~Entity] Returns -> EntitiesResults
[ "UnitsCompleted", "returns", "the", "units", "running", "on", "this", "machine", "that", "have", "completed", "the", "upgrade", "-", "series", "workflow", "and", "are", "in", "their", "normal", "running", "state", ".", "entities", ":", "typing", ".", "Sequence...
async def UnitsCompleted(self, entities=None): if entities is not None and not isinstance(entities, (bytes, str, list)): raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) _params = dict() msg = dict(type='UpgradeSeries', req...
[ "async", "def", "UnitsCompleted", "(", "self", ",", "entities", "=", "None", ")", ":", "if", "entities", "is", "not", "None", "and", "not", "isinstance", "(", "entities", ",", "(", "bytes", ",", "str", ",", "list", ")", ")", ":", "raise", "Exception", ...
UnitsCompleted returns the units running on this machine that have completed the upgrade-series workflow and are in their normal running state.
[ "UnitsCompleted", "returns", "the", "units", "running", "on", "this", "machine", "that", "have", "completed", "the", "upgrade", "-", "series", "workflow", "and", "are", "in", "their", "normal", "running", "state", "." ]
[ "'''\n UnitsCompleted returns the units running on this machine that have completed\n the upgrade-series workflow and are in their normal running state.\n\n entities : typing.Sequence[~Entity]\n Returns -> EntitiesResults\n '''", "# map input types to rpc msg" ]
[ { "param": "self", "type": null }, { "param": "entities", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "entities", "type": null, "docstring": null, "docstring_tokens...
f697638db76b9fc35cd762f0cbbb058c9ee6f5b1
sed-i/python-libjuju
juju/client/_client2.py
[ "Apache-2.0" ]
Python
UnitsPrepared
<not_specific>
async def UnitsPrepared(self, entities=None): ''' UnitsPrepared returns the units running on this machine that have completed their upgrade-series preparation, and are ready to be stopped and have their unit agent services converted for the target series. entities : typing.Seque...
UnitsPrepared returns the units running on this machine that have completed their upgrade-series preparation, and are ready to be stopped and have their unit agent services converted for the target series. entities : typing.Sequence[~Entity] Returns -> EntitiesResults
UnitsPrepared returns the units running on this machine that have completed their upgrade-series preparation, and are ready to be stopped and have their unit agent services converted for the target series. entities : typing.Sequence[~Entity] Returns -> EntitiesResults
[ "UnitsPrepared", "returns", "the", "units", "running", "on", "this", "machine", "that", "have", "completed", "their", "upgrade", "-", "series", "preparation", "and", "are", "ready", "to", "be", "stopped", "and", "have", "their", "unit", "agent", "services", "c...
async def UnitsPrepared(self, entities=None): if entities is not None and not isinstance(entities, (bytes, str, list)): raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) _params = dict() msg = dict(type='UpgradeSeries', requ...
[ "async", "def", "UnitsPrepared", "(", "self", ",", "entities", "=", "None", ")", ":", "if", "entities", "is", "not", "None", "and", "not", "isinstance", "(", "entities", ",", "(", "bytes", ",", "str", ",", "list", ")", ")", ":", "raise", "Exception", ...
UnitsPrepared returns the units running on this machine that have completed their upgrade-series preparation, and are ready to be stopped and have their unit agent services converted for the target series.
[ "UnitsPrepared", "returns", "the", "units", "running", "on", "this", "machine", "that", "have", "completed", "their", "upgrade", "-", "series", "preparation", "and", "are", "ready", "to", "be", "stopped", "and", "have", "their", "unit", "agent", "services", "c...
[ "'''\n UnitsPrepared returns the units running on this machine that have completed\n their upgrade-series preparation, and are ready to be stopped and have their\n unit agent services converted for the target series.\n\n entities : typing.Sequence[~Entity]\n Returns -> EntitiesRes...
[ { "param": "self", "type": null }, { "param": "entities", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "entities", "type": null, "docstring": null, "docstring_tokens...
f697638db76b9fc35cd762f0cbbb058c9ee6f5b1
sed-i/python-libjuju
juju/client/_client2.py
[ "Apache-2.0" ]
Python
UnpinMachineApplications
<not_specific>
async def UnpinMachineApplications(self): ''' UnpinMachineApplications unpins leadership for applications represented by units running on the auth'd machine. Returns -> PinApplicationsResults ''' # map input types to rpc msg _params = dict() msg = dict(...
UnpinMachineApplications unpins leadership for applications represented by units running on the auth'd machine. Returns -> PinApplicationsResults
UnpinMachineApplications unpins leadership for applications represented by units running on the auth'd machine.
[ "UnpinMachineApplications", "unpins", "leadership", "for", "applications", "represented", "by", "units", "running", "on", "the", "auth", "'", "d", "machine", "." ]
async def UnpinMachineApplications(self): _params = dict() msg = dict(type='UpgradeSeries', request='UnpinMachineApplications', version=2, params=_params) reply = await self.rpc(msg) return reply
[ "async", "def", "UnpinMachineApplications", "(", "self", ")", ":", "_params", "=", "dict", "(", ")", "msg", "=", "dict", "(", "type", "=", "'UpgradeSeries'", ",", "request", "=", "'UnpinMachineApplications'", ",", "version", "=", "2", ",", "params", "=", "...
UnpinMachineApplications unpins leadership for applications represented by units running on the auth'd machine.
[ "UnpinMachineApplications", "unpins", "leadership", "for", "applications", "represented", "by", "units", "running", "on", "the", "auth", "'", "d", "machine", "." ]
[ "'''\n UnpinMachineApplications unpins leadership for applications represented by\n units running on the auth'd machine.\n\n\n Returns -> PinApplicationsResults\n '''", "# map input types to rpc msg" ]
[ { "param": "self", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
f697638db76b9fc35cd762f0cbbb058c9ee6f5b1
sed-i/python-libjuju
juju/client/_client2.py
[ "Apache-2.0" ]
Python
UpgradeSeriesUnitStatus
<not_specific>
async def UpgradeSeriesUnitStatus(self, entities=None): ''' UpgradeSeriesUnitStatus returns the current preparation status of an upgrading unit. If no series upgrade is in progress an error is returned instead. entities : typing.Sequence[~Entity] Returns -> UpgradeSeries...
UpgradeSeriesUnitStatus returns the current preparation status of an upgrading unit. If no series upgrade is in progress an error is returned instead. entities : typing.Sequence[~Entity] Returns -> UpgradeSeriesStatusResults
UpgradeSeriesUnitStatus returns the current preparation status of an upgrading unit. If no series upgrade is in progress an error is returned instead. entities : typing.Sequence[~Entity] Returns -> UpgradeSeriesStatusResults
[ "UpgradeSeriesUnitStatus", "returns", "the", "current", "preparation", "status", "of", "an", "upgrading", "unit", ".", "If", "no", "series", "upgrade", "is", "in", "progress", "an", "error", "is", "returned", "instead", ".", "entities", ":", "typing", ".", "Se...
async def UpgradeSeriesUnitStatus(self, entities=None): if entities is not None and not isinstance(entities, (bytes, str, list)): raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) _params = dict() msg = dict(type='UpgradeSeries', ...
[ "async", "def", "UpgradeSeriesUnitStatus", "(", "self", ",", "entities", "=", "None", ")", ":", "if", "entities", "is", "not", "None", "and", "not", "isinstance", "(", "entities", ",", "(", "bytes", ",", "str", ",", "list", ")", ")", ":", "raise", "Exc...
UpgradeSeriesUnitStatus returns the current preparation status of an upgrading unit.
[ "UpgradeSeriesUnitStatus", "returns", "the", "current", "preparation", "status", "of", "an", "upgrading", "unit", "." ]
[ "'''\n UpgradeSeriesUnitStatus returns the current preparation status of an\n upgrading unit.\n If no series upgrade is in progress an error is returned instead.\n\n entities : typing.Sequence[~Entity]\n Returns -> UpgradeSeriesStatusResults\n '''", "# map input types to ...
[ { "param": "self", "type": null }, { "param": "entities", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "entities", "type": null, "docstring": null, "docstring_tokens...
f697638db76b9fc35cd762f0cbbb058c9ee6f5b1
sed-i/python-libjuju
juju/client/_client2.py
[ "Apache-2.0" ]
Python
WatchUpgradeSeriesNotifications
<not_specific>
async def WatchUpgradeSeriesNotifications(self, entities=None): ''' WatchUpgradeSeriesNotifications returns a NotifyWatcher for observing changes to upgrade series locks. entities : typing.Sequence[~Entity] Returns -> NotifyWatchResults ''' if entities is not None and no...
WatchUpgradeSeriesNotifications returns a NotifyWatcher for observing changes to upgrade series locks. entities : typing.Sequence[~Entity] Returns -> NotifyWatchResults
WatchUpgradeSeriesNotifications returns a NotifyWatcher for observing changes to upgrade series locks. entities : typing.Sequence[~Entity] Returns -> NotifyWatchResults
[ "WatchUpgradeSeriesNotifications", "returns", "a", "NotifyWatcher", "for", "observing", "changes", "to", "upgrade", "series", "locks", ".", "entities", ":", "typing", ".", "Sequence", "[", "~Entity", "]", "Returns", "-", ">", "NotifyWatchResults" ]
async def WatchUpgradeSeriesNotifications(self, entities=None): if entities is not None and not isinstance(entities, (bytes, str, list)): raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) _params = dict() msg = dict(type='UpgradeSeries', ...
[ "async", "def", "WatchUpgradeSeriesNotifications", "(", "self", ",", "entities", "=", "None", ")", ":", "if", "entities", "is", "not", "None", "and", "not", "isinstance", "(", "entities", ",", "(", "bytes", ",", "str", ",", "list", ")", ")", ":", "raise"...
WatchUpgradeSeriesNotifications returns a NotifyWatcher for observing changes to upgrade series locks.
[ "WatchUpgradeSeriesNotifications", "returns", "a", "NotifyWatcher", "for", "observing", "changes", "to", "upgrade", "series", "locks", "." ]
[ "'''\n WatchUpgradeSeriesNotifications returns a NotifyWatcher for observing changes to upgrade series locks.\n\n entities : typing.Sequence[~Entity]\n Returns -> NotifyWatchResults\n '''", "# map input types to rpc msg" ]
[ { "param": "self", "type": null }, { "param": "entities", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "entities", "type": null, "docstring": null, "docstring_tokens...
f697638db76b9fc35cd762f0cbbb058c9ee6f5b1
sed-i/python-libjuju
juju/client/_client2.py
[ "Apache-2.0" ]
Python
ResetKVMMachineModificationStatusIdle
<not_specific>
async def ResetKVMMachineModificationStatusIdle(self, tag=None): ''' ResetKVMMachineModificationStatusIdle sets the modification status of a kvm machine to idle if it is in an error state before upgrade. Related to lp:1829393. tag : str Returns -> ErrorResult '''...
ResetKVMMachineModificationStatusIdle sets the modification status of a kvm machine to idle if it is in an error state before upgrade. Related to lp:1829393. tag : str Returns -> ErrorResult
ResetKVMMachineModificationStatusIdle sets the modification status of a kvm machine to idle if it is in an error state before upgrade. tag : str Returns -> ErrorResult
[ "ResetKVMMachineModificationStatusIdle", "sets", "the", "modification", "status", "of", "a", "kvm", "machine", "to", "idle", "if", "it", "is", "in", "an", "error", "state", "before", "upgrade", ".", "tag", ":", "str", "Returns", "-", ">", "ErrorResult" ]
async def ResetKVMMachineModificationStatusIdle(self, tag=None): if tag is not None and not isinstance(tag, (bytes, str)): raise Exception("Expected tag to be a str, received: {}".format(type(tag))) _params = dict() msg = dict(type='UpgradeSteps', request='ResetKVM...
[ "async", "def", "ResetKVMMachineModificationStatusIdle", "(", "self", ",", "tag", "=", "None", ")", ":", "if", "tag", "is", "not", "None", "and", "not", "isinstance", "(", "tag", ",", "(", "bytes", ",", "str", ")", ")", ":", "raise", "Exception", "(", ...
ResetKVMMachineModificationStatusIdle sets the modification status of a kvm machine to idle if it is in an error state before upgrade.
[ "ResetKVMMachineModificationStatusIdle", "sets", "the", "modification", "status", "of", "a", "kvm", "machine", "to", "idle", "if", "it", "is", "in", "an", "error", "state", "before", "upgrade", "." ]
[ "'''\n ResetKVMMachineModificationStatusIdle sets the modification status\n of a kvm machine to idle if it is in an error state before upgrade.\n Related to lp:1829393.\n\n tag : str\n Returns -> ErrorResult\n '''", "# map input types to rpc msg" ]
[ { "param": "self", "type": null }, { "param": "tag", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "tag", "type": null, "docstring": null, "docstring_tokens": []...
f697638db76b9fc35cd762f0cbbb058c9ee6f5b1
sed-i/python-libjuju
juju/client/_client2.py
[ "Apache-2.0" ]
Python
WriteAgentState
<not_specific>
async def WriteAgentState(self, args=None): ''' WriteAgentState writes the agent state for the set of units provided. This call presently deals with the state for the unit agent. args : typing.Sequence[~SetUnitStateArg] Returns -> ErrorResults ''' if args is not ...
WriteAgentState writes the agent state for the set of units provided. This call presently deals with the state for the unit agent. args : typing.Sequence[~SetUnitStateArg] Returns -> ErrorResults
WriteAgentState writes the agent state for the set of units provided. This call presently deals with the state for the unit agent.
[ "WriteAgentState", "writes", "the", "agent", "state", "for", "the", "set", "of", "units", "provided", ".", "This", "call", "presently", "deals", "with", "the", "state", "for", "the", "unit", "agent", "." ]
async def WriteAgentState(self, args=None): if args is not None and not isinstance(args, (bytes, str, list)): raise Exception("Expected args to be a Sequence, received: {}".format(type(args))) _params = dict() msg = dict(type='UpgradeSteps', request='WriteAgentStat...
[ "async", "def", "WriteAgentState", "(", "self", ",", "args", "=", "None", ")", ":", "if", "args", "is", "not", "None", "and", "not", "isinstance", "(", "args", ",", "(", "bytes", ",", "str", ",", "list", ")", ")", ":", "raise", "Exception", "(", "\...
WriteAgentState writes the agent state for the set of units provided.
[ "WriteAgentState", "writes", "the", "agent", "state", "for", "the", "set", "of", "units", "provided", "." ]
[ "'''\n WriteAgentState writes the agent state for the set of units provided. This\n call presently deals with the state for the unit agent.\n\n args : typing.Sequence[~SetUnitStateArg]\n Returns -> ErrorResults\n '''", "# map input types to rpc msg" ]
[ { "param": "self", "type": null }, { "param": "args", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "args", "type": null, "docstring": null, "docstring_tokens": [...
f697638db76b9fc35cd762f0cbbb058c9ee6f5b1
sed-i/python-libjuju
juju/client/_client2.py
[ "Apache-2.0" ]
Python
AddUser
<not_specific>
async def AddUser(self, users=None): ''' AddUser adds a user with a username, and either a password or a randomly generated secret key which will be returned. users : typing.Sequence[~AddUser] Returns -> AddUserResults ''' if users is not None and not isinstance(...
AddUser adds a user with a username, and either a password or a randomly generated secret key which will be returned. users : typing.Sequence[~AddUser] Returns -> AddUserResults
AddUser adds a user with a username, and either a password or a randomly generated secret key which will be returned.
[ "AddUser", "adds", "a", "user", "with", "a", "username", "and", "either", "a", "password", "or", "a", "randomly", "generated", "secret", "key", "which", "will", "be", "returned", "." ]
async def AddUser(self, users=None): if users is not None and not isinstance(users, (bytes, str, list)): raise Exception("Expected users to be a Sequence, received: {}".format(type(users))) _params = dict() msg = dict(type='UserManager', request='AddUser', ...
[ "async", "def", "AddUser", "(", "self", ",", "users", "=", "None", ")", ":", "if", "users", "is", "not", "None", "and", "not", "isinstance", "(", "users", ",", "(", "bytes", ",", "str", ",", "list", ")", ")", ":", "raise", "Exception", "(", "\"Expe...
AddUser adds a user with a username, and either a password or a randomly generated secret key which will be returned.
[ "AddUser", "adds", "a", "user", "with", "a", "username", "and", "either", "a", "password", "or", "a", "randomly", "generated", "secret", "key", "which", "will", "be", "returned", "." ]
[ "'''\n AddUser adds a user with a username, and either a password or\n a randomly generated secret key which will be returned.\n\n users : typing.Sequence[~AddUser]\n Returns -> AddUserResults\n '''", "# map input types to rpc msg" ]
[ { "param": "self", "type": null }, { "param": "users", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "users", "type": null, "docstring": null, "docstring_tokens": ...
f697638db76b9fc35cd762f0cbbb058c9ee6f5b1
sed-i/python-libjuju
juju/client/_client2.py
[ "Apache-2.0" ]
Python
DisableUser
<not_specific>
async def DisableUser(self, entities=None): ''' DisableUser disables one or more users. If the user is already disabled, the action is considered a success. entities : typing.Sequence[~Entity] Returns -> ErrorResults ''' if entities is not None and not isinstanc...
DisableUser disables one or more users. If the user is already disabled, the action is considered a success. entities : typing.Sequence[~Entity] Returns -> ErrorResults
DisableUser disables one or more users. If the user is already disabled, the action is considered a success. entities : typing.Sequence[~Entity] Returns -> ErrorResults
[ "DisableUser", "disables", "one", "or", "more", "users", ".", "If", "the", "user", "is", "already", "disabled", "the", "action", "is", "considered", "a", "success", ".", "entities", ":", "typing", ".", "Sequence", "[", "~Entity", "]", "Returns", "-", ">", ...
async def DisableUser(self, entities=None): if entities is not None and not isinstance(entities, (bytes, str, list)): raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) _params = dict() msg = dict(type='UserManager', request=...
[ "async", "def", "DisableUser", "(", "self", ",", "entities", "=", "None", ")", ":", "if", "entities", "is", "not", "None", "and", "not", "isinstance", "(", "entities", ",", "(", "bytes", ",", "str", ",", "list", ")", ")", ":", "raise", "Exception", "...
DisableUser disables one or more users.
[ "DisableUser", "disables", "one", "or", "more", "users", "." ]
[ "'''\n DisableUser disables one or more users. If the user is already disabled,\n the action is considered a success.\n\n entities : typing.Sequence[~Entity]\n Returns -> ErrorResults\n '''", "# map input types to rpc msg" ]
[ { "param": "self", "type": null }, { "param": "entities", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "entities", "type": null, "docstring": null, "docstring_tokens...
f697638db76b9fc35cd762f0cbbb058c9ee6f5b1
sed-i/python-libjuju
juju/client/_client2.py
[ "Apache-2.0" ]
Python
EnableUser
<not_specific>
async def EnableUser(self, entities=None): ''' EnableUser enables one or more users. If the user is already enabled, the action is considered a success. entities : typing.Sequence[~Entity] Returns -> ErrorResults ''' if entities is not None and not isinstance(en...
EnableUser enables one or more users. If the user is already enabled, the action is considered a success. entities : typing.Sequence[~Entity] Returns -> ErrorResults
EnableUser enables one or more users. If the user is already enabled, the action is considered a success. entities : typing.Sequence[~Entity] Returns -> ErrorResults
[ "EnableUser", "enables", "one", "or", "more", "users", ".", "If", "the", "user", "is", "already", "enabled", "the", "action", "is", "considered", "a", "success", ".", "entities", ":", "typing", ".", "Sequence", "[", "~Entity", "]", "Returns", "-", ">", "...
async def EnableUser(self, entities=None): if entities is not None and not isinstance(entities, (bytes, str, list)): raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) _params = dict() msg = dict(type='UserManager', request='...
[ "async", "def", "EnableUser", "(", "self", ",", "entities", "=", "None", ")", ":", "if", "entities", "is", "not", "None", "and", "not", "isinstance", "(", "entities", ",", "(", "bytes", ",", "str", ",", "list", ")", ")", ":", "raise", "Exception", "(...
EnableUser enables one or more users.
[ "EnableUser", "enables", "one", "or", "more", "users", "." ]
[ "'''\n EnableUser enables one or more users. If the user is already enabled,\n the action is considered a success.\n\n entities : typing.Sequence[~Entity]\n Returns -> ErrorResults\n '''", "# map input types to rpc msg" ]
[ { "param": "self", "type": null }, { "param": "entities", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "entities", "type": null, "docstring": null, "docstring_tokens...
f697638db76b9fc35cd762f0cbbb058c9ee6f5b1
sed-i/python-libjuju
juju/client/_client2.py
[ "Apache-2.0" ]
Python
RemoveUser
<not_specific>
async def RemoveUser(self, entities=None): ''' RemoveUser permanently removes a user from the current controller for each entity provided. While the user is permanently removed we keep it's information around for auditing purposes. TODO(redir): Add information about getting delet...
RemoveUser permanently removes a user from the current controller for each entity provided. While the user is permanently removed we keep it's information around for auditing purposes. TODO(redir): Add information about getting deleted user information when we add that capabilit...
RemoveUser permanently removes a user from the current controller for each entity provided. While the user is permanently removed we keep it's information around for auditing purposes. TODO(redir): Add information about getting deleted user information when we add that capability. entities : typing.Sequence[~Entity] R...
[ "RemoveUser", "permanently", "removes", "a", "user", "from", "the", "current", "controller", "for", "each", "entity", "provided", ".", "While", "the", "user", "is", "permanently", "removed", "we", "keep", "it", "'", "s", "information", "around", "for", "auditi...
async def RemoveUser(self, entities=None): if entities is not None and not isinstance(entities, (bytes, str, list)): raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) _params = dict() msg = dict(type='UserManager', request='...
[ "async", "def", "RemoveUser", "(", "self", ",", "entities", "=", "None", ")", ":", "if", "entities", "is", "not", "None", "and", "not", "isinstance", "(", "entities", ",", "(", "bytes", ",", "str", ",", "list", ")", ")", ":", "raise", "Exception", "(...
RemoveUser permanently removes a user from the current controller for each entity provided.
[ "RemoveUser", "permanently", "removes", "a", "user", "from", "the", "current", "controller", "for", "each", "entity", "provided", "." ]
[ "'''\n RemoveUser permanently removes a user from the current controller for each\n entity provided. While the user is permanently removed we keep it's\n information around for auditing purposes.\n TODO(redir): Add information about getting deleted user information when we\n add t...
[ { "param": "self", "type": null }, { "param": "entities", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "entities", "type": null, "docstring": null, "docstring_tokens...
f697638db76b9fc35cd762f0cbbb058c9ee6f5b1
sed-i/python-libjuju
juju/client/_client2.py
[ "Apache-2.0" ]
Python
ResetPassword
<not_specific>
async def ResetPassword(self, entities=None): ''' ResetPassword resets password for supplied users by invalidating current passwords (if any) and generating new random secret keys which will be returned. Users cannot reset their own password. entities : typing.Sequence[~...
ResetPassword resets password for supplied users by invalidating current passwords (if any) and generating new random secret keys which will be returned. Users cannot reset their own password. entities : typing.Sequence[~Entity] Returns -> AddUserResults
ResetPassword resets password for supplied users by invalidating current passwords (if any) and generating new random secret keys which will be returned. Users cannot reset their own password. entities : typing.Sequence[~Entity] Returns -> AddUserResults
[ "ResetPassword", "resets", "password", "for", "supplied", "users", "by", "invalidating", "current", "passwords", "(", "if", "any", ")", "and", "generating", "new", "random", "secret", "keys", "which", "will", "be", "returned", ".", "Users", "cannot", "reset", ...
async def ResetPassword(self, entities=None): if entities is not None and not isinstance(entities, (bytes, str, list)): raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) _params = dict() msg = dict(type='UserManager', reques...
[ "async", "def", "ResetPassword", "(", "self", ",", "entities", "=", "None", ")", ":", "if", "entities", "is", "not", "None", "and", "not", "isinstance", "(", "entities", ",", "(", "bytes", ",", "str", ",", "list", ")", ")", ":", "raise", "Exception", ...
ResetPassword resets password for supplied users by invalidating current passwords (if any) and generating new random secret keys which will be returned.
[ "ResetPassword", "resets", "password", "for", "supplied", "users", "by", "invalidating", "current", "passwords", "(", "if", "any", ")", "and", "generating", "new", "random", "secret", "keys", "which", "will", "be", "returned", "." ]
[ "'''\n ResetPassword resets password for supplied users by\n invalidating current passwords (if any) and generating\n new random secret keys which will be returned.\n Users cannot reset their own password.\n\n entities : typing.Sequence[~Entity]\n Returns -> AddUserResults\...
[ { "param": "self", "type": null }, { "param": "entities", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "entities", "type": null, "docstring": null, "docstring_tokens...
f697638db76b9fc35cd762f0cbbb058c9ee6f5b1
sed-i/python-libjuju
juju/client/_client2.py
[ "Apache-2.0" ]
Python
SetPassword
<not_specific>
async def SetPassword(self, changes=None): ''' SetPassword changes the stored password for the specified users. changes : typing.Sequence[~EntityPassword] Returns -> ErrorResults ''' if changes is not None and not isinstance(changes, (bytes, str, list)): rais...
SetPassword changes the stored password for the specified users. changes : typing.Sequence[~EntityPassword] Returns -> ErrorResults
SetPassword changes the stored password for the specified users.
[ "SetPassword", "changes", "the", "stored", "password", "for", "the", "specified", "users", "." ]
async def SetPassword(self, changes=None): if changes is not None and not isinstance(changes, (bytes, str, list)): raise Exception("Expected changes to be a Sequence, received: {}".format(type(changes))) _params = dict() msg = dict(type='UserManager', request='SetP...
[ "async", "def", "SetPassword", "(", "self", ",", "changes", "=", "None", ")", ":", "if", "changes", "is", "not", "None", "and", "not", "isinstance", "(", "changes", ",", "(", "bytes", ",", "str", ",", "list", ")", ")", ":", "raise", "Exception", "(",...
SetPassword changes the stored password for the specified users.
[ "SetPassword", "changes", "the", "stored", "password", "for", "the", "specified", "users", "." ]
[ "'''\n SetPassword changes the stored password for the specified users.\n\n changes : typing.Sequence[~EntityPassword]\n Returns -> ErrorResults\n '''", "# map input types to rpc msg" ]
[ { "param": "self", "type": null }, { "param": "changes", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "changes", "type": null, "docstring": null, "docstring_tokens"...
f697638db76b9fc35cd762f0cbbb058c9ee6f5b1
sed-i/python-libjuju
juju/client/_client2.py
[ "Apache-2.0" ]
Python
Next
<not_specific>
async def Next(self): ''' Next returns when a change has occurred to an entity of the collection being watched since the most recent call to Next or the Watch call that created the srvMachineStorageIdsWatcher. Returns -> MachineStorageIdsWatchResult ''' # map i...
Next returns when a change has occurred to an entity of the collection being watched since the most recent call to Next or the Watch call that created the srvMachineStorageIdsWatcher. Returns -> MachineStorageIdsWatchResult
Next returns when a change has occurred to an entity of the collection being watched since the most recent call to Next or the Watch call that created the srvMachineStorageIdsWatcher.
[ "Next", "returns", "when", "a", "change", "has", "occurred", "to", "an", "entity", "of", "the", "collection", "being", "watched", "since", "the", "most", "recent", "call", "to", "Next", "or", "the", "Watch", "call", "that", "created", "the", "srvMachineStora...
async def Next(self): _params = dict() msg = dict(type='VolumeAttachmentsWatcher', request='Next', version=2, params=_params) reply = await self.rpc(msg) return reply
[ "async", "def", "Next", "(", "self", ")", ":", "_params", "=", "dict", "(", ")", "msg", "=", "dict", "(", "type", "=", "'VolumeAttachmentsWatcher'", ",", "request", "=", "'Next'", ",", "version", "=", "2", ",", "params", "=", "_params", ")", "reply", ...
Next returns when a change has occurred to an entity of the collection being watched since the most recent call to Next or the Watch call that created the srvMachineStorageIdsWatcher.
[ "Next", "returns", "when", "a", "change", "has", "occurred", "to", "an", "entity", "of", "the", "collection", "being", "watched", "since", "the", "most", "recent", "call", "to", "Next", "or", "the", "Watch", "call", "that", "created", "the", "srvMachineStora...
[ "'''\n Next returns when a change has occurred to an entity of the\n collection being watched since the most recent call to Next\n or the Watch call that created the srvMachineStorageIdsWatcher.\n\n\n Returns -> MachineStorageIdsWatchResult\n '''", "# map input types to rpc msg"...
[ { "param": "self", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
94fdaa8e229e04d78b10cd17a34001cb769e38e0
sed-i/python-libjuju
juju/client/_client.py
[ "Apache-2.0" ]
Python
best_facade_version
<not_specific>
def best_facade_version(cls, connection): """ Returns the best facade version for a given facade. This will help with trying to provide different functionality for different facade versions. @param connection: initialized Connection object. """ facade_name = cls.__name__...
Returns the best facade version for a given facade. This will help with trying to provide different functionality for different facade versions. @param connection: initialized Connection object.
Returns the best facade version for a given facade. This will help with trying to provide different functionality for different facade versions.
[ "Returns", "the", "best", "facade", "version", "for", "a", "given", "facade", ".", "This", "will", "help", "with", "trying", "to", "provide", "different", "functionality", "for", "different", "facade", "versions", "." ]
def best_facade_version(cls, connection): facade_name = cls.__name__ if not facade_name.endswith('Facade'): raise TypeError('Unexpected class name: {}'.format(facade_name)) facade_name = facade_name[:-len('Facade')] return connection.facades.get(facade_name)
[ "def", "best_facade_version", "(", "cls", ",", "connection", ")", ":", "facade_name", "=", "cls", ".", "__name__", "if", "not", "facade_name", ".", "endswith", "(", "'Facade'", ")", ":", "raise", "TypeError", "(", "'Unexpected class name: {}'", ".", "format", ...
Returns the best facade version for a given facade.
[ "Returns", "the", "best", "facade", "version", "for", "a", "given", "facade", "." ]
[ "\"\"\"\n Returns the best facade version for a given facade. This will help with\n trying to provide different functionality for different facade versions.\n\n @param connection: initialized Connection object.\n \"\"\"" ]
[ { "param": "cls", "type": null }, { "param": "connection", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "cls", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "connection", "type": null, "docstring": "initialized Connection obje...
d0181fbbb9e1962f45a9a27b5cb597fc2211506a
sed-i/python-libjuju
juju/client/_client11.py
[ "Apache-2.0" ]
Python
UpdateStatus
<not_specific>
async def UpdateStatus(self, entities=None): ''' UpdateStatus updates the status data of each given entity. TODO(fwereade): WTF. This method exists *only* for the convenience of the *client* API -- and is itself completely broken -- but we still expose it in every facade with a S...
UpdateStatus updates the status data of each given entity. TODO(fwereade): WTF. This method exists *only* for the convenience of the *client* API -- and is itself completely broken -- but we still expose it in every facade with a StatusSetter? FFS. entities : typing.Sequence[~E...
UpdateStatus updates the status data of each given entity.
[ "UpdateStatus", "updates", "the", "status", "data", "of", "each", "given", "entity", "." ]
async def UpdateStatus(self, entities=None): if entities is not None and not isinstance(entities, (bytes, str, list)): raise Exception("Expected entities to be a Sequence, received: {}".format(type(entities))) _params = dict() msg = dict(type='Provisioner', request...
[ "async", "def", "UpdateStatus", "(", "self", ",", "entities", "=", "None", ")", ":", "if", "entities", "is", "not", "None", "and", "not", "isinstance", "(", "entities", ",", "(", "bytes", ",", "str", ",", "list", ")", ")", ":", "raise", "Exception", ...
UpdateStatus updates the status data of each given entity.
[ "UpdateStatus", "updates", "the", "status", "data", "of", "each", "given", "entity", "." ]
[ "'''\n UpdateStatus updates the status data of each given entity.\n TODO(fwereade): WTF. This method exists *only* for the convenience of the\n *client* API -- and is itself completely broken -- but we still expose it\n in every facade with a StatusSetter? FFS.\n\n entities : typi...
[ { "param": "self", "type": null }, { "param": "entities", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "entities", "type": null, "docstring": null, "docstring_tokens...
49e2b08e8d4fb4f27ea912f63cede4335288fba3
wescpy/migrate-python2-appengine
mod7-gaetasks/main.py
[ "Apache-2.0" ]
Python
fetch_visits
<not_specific>
def fetch_visits(limit): 'get most recent visits & add task to delete older visits' data = Visit.query().order(-Visit.timestamp).fetch(limit) oldest = time.mktime(data[-1].timestamp.timetuple()) oldest_str = time.ctime(oldest) logging.info('Delete entities older than %s' % oldest_str) taskqueue....
get most recent visits & add task to delete older visits
get most recent visits & add task to delete older visits
[ "get", "most", "recent", "visits", "&", "add", "task", "to", "delete", "older", "visits" ]
def fetch_visits(limit): data = Visit.query().order(-Visit.timestamp).fetch(limit) oldest = time.mktime(data[-1].timestamp.timetuple()) oldest_str = time.ctime(oldest) logging.info('Delete entities older than %s' % oldest_str) taskqueue.add(url='/trim', params={'oldest': oldest}) return (v.to_di...
[ "def", "fetch_visits", "(", "limit", ")", ":", "data", "=", "Visit", ".", "query", "(", ")", ".", "order", "(", "-", "Visit", ".", "timestamp", ")", ".", "fetch", "(", "limit", ")", "oldest", "=", "time", ".", "mktime", "(", "data", "[", "-", "1"...
get most recent visits & add task to delete older visits
[ "get", "most", "recent", "visits", "&", "add", "task", "to", "delete", "older", "visits" ]
[ "'get most recent visits & add task to delete older visits'" ]
[ { "param": "limit", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "limit", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
49e2b08e8d4fb4f27ea912f63cede4335288fba3
wescpy/migrate-python2-appengine
mod7-gaetasks/main.py
[ "Apache-2.0" ]
Python
trim
<not_specific>
def trim(): '(push) task queue handler to delete oldest visits' oldest = request.form.get('oldest', type=float) keys = Visit.query( Visit.timestamp < datetime.fromtimestamp(oldest) ).fetch(keys_only=True) nkeys = len(keys) if nkeys: logging.info('Deleting %d entities: %s' % (...
(push) task queue handler to delete oldest visits
(push) task queue handler to delete oldest visits
[ "(", "push", ")", "task", "queue", "handler", "to", "delete", "oldest", "visits" ]
def trim(): oldest = request.form.get('oldest', type=float) keys = Visit.query( Visit.timestamp < datetime.fromtimestamp(oldest) ).fetch(keys_only=True) nkeys = len(keys) if nkeys: logging.info('Deleting %d entities: %s' % ( nkeys, ', '.join(str(k.id()) for k in k...
[ "def", "trim", "(", ")", ":", "oldest", "=", "request", ".", "form", ".", "get", "(", "'oldest'", ",", "type", "=", "float", ")", "keys", "=", "Visit", ".", "query", "(", "Visit", ".", "timestamp", "<", "datetime", ".", "fromtimestamp", "(", "oldest"...
(push) task queue handler to delete oldest visits
[ "(", "push", ")", "task", "queue", "handler", "to", "delete", "oldest", "visits" ]
[ "'(push) task queue handler to delete oldest visits'" ]
[]
{ "returns": [], "raises": [], "params": [], "outlier_params": [], "others": [] }
49e2b08e8d4fb4f27ea912f63cede4335288fba3
wescpy/migrate-python2-appengine
mod7-gaetasks/main.py
[ "Apache-2.0" ]
Python
root
<not_specific>
def root(): 'main application (GET) handler' store_visit(request.remote_addr, request.user_agent) visits, oldest = fetch_visits(10) context = {'visits': visits, 'oldest': oldest} return render_template('index.html', **context)
main application (GET) handler
main application (GET) handler
[ "main", "application", "(", "GET", ")", "handler" ]
def root(): store_visit(request.remote_addr, request.user_agent) visits, oldest = fetch_visits(10) context = {'visits': visits, 'oldest': oldest} return render_template('index.html', **context)
[ "def", "root", "(", ")", ":", "store_visit", "(", "request", ".", "remote_addr", ",", "request", ".", "user_agent", ")", "visits", ",", "oldest", "=", "fetch_visits", "(", "10", ")", "context", "=", "{", "'visits'", ":", "visits", ",", "'oldest'", ":", ...
main application (GET) handler
[ "main", "application", "(", "GET", ")", "handler" ]
[ "'main application (GET) handler'" ]
[]
{ "returns": [], "raises": [], "params": [], "outlier_params": [], "others": [] }
73a8eeb56fe26e90ff164346eb3983fd13b731c2
wescpy/migrate-python2-appengine
mod4b-rundocker/main.py
[ "Apache-2.0" ]
Python
store_visit
null
def store_visit(remote_addr, user_agent): 'create new Visit entity in Datastore' entity = datastore.Entity(key=ds_client.key('Visit')) entity.update({ 'timestamp': datetime.now(), 'visitor': '{}: {}'.format(remote_addr, user_agent), }) ds_client.put(entity)
create new Visit entity in Datastore
create new Visit entity in Datastore
[ "create", "new", "Visit", "entity", "in", "Datastore" ]
def store_visit(remote_addr, user_agent): entity = datastore.Entity(key=ds_client.key('Visit')) entity.update({ 'timestamp': datetime.now(), 'visitor': '{}: {}'.format(remote_addr, user_agent), }) ds_client.put(entity)
[ "def", "store_visit", "(", "remote_addr", ",", "user_agent", ")", ":", "entity", "=", "datastore", ".", "Entity", "(", "key", "=", "ds_client", ".", "key", "(", "'Visit'", ")", ")", "entity", ".", "update", "(", "{", "'timestamp'", ":", "datetime", ".", ...
create new Visit entity in Datastore
[ "create", "new", "Visit", "entity", "in", "Datastore" ]
[ "'create new Visit entity in Datastore'" ]
[ { "param": "remote_addr", "type": null }, { "param": "user_agent", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "remote_addr", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "user_agent", "type": null, "docstring": null, "docstri...
10a10853f4f1c71b51d7c77266ca9f1519563035
wescpy/migrate-python2-appengine
mod8-cloudtasks/main.py
[ "Apache-2.0" ]
Python
fetch_visits
<not_specific>
def fetch_visits(limit): 'get most recent visits & add task to delete older visits' with ds_client.context(): data = Visit.query().order(-Visit.timestamp).fetch(limit) oldest = time.mktime(data[-1].timestamp.timetuple()) oldest_str = time.ctime(oldest) logging.info('Delete entities older tha...
get most recent visits & add task to delete older visits
get most recent visits & add task to delete older visits
[ "get", "most", "recent", "visits", "&", "add", "task", "to", "delete", "older", "visits" ]
def fetch_visits(limit): with ds_client.context(): data = Visit.query().order(-Visit.timestamp).fetch(limit) oldest = time.mktime(data[-1].timestamp.timetuple()) oldest_str = time.ctime(oldest) logging.info('Delete entities older than %s' % oldest_str) task = { 'app_engine_http_reque...
[ "def", "fetch_visits", "(", "limit", ")", ":", "with", "ds_client", ".", "context", "(", ")", ":", "data", "=", "Visit", ".", "query", "(", ")", ".", "order", "(", "-", "Visit", ".", "timestamp", ")", ".", "fetch", "(", "limit", ")", "oldest", "=",...
get most recent visits & add task to delete older visits
[ "get", "most", "recent", "visits", "&", "add", "task", "to", "delete", "older", "visits" ]
[ "'get most recent visits & add task to delete older visits'" ]
[ { "param": "limit", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "limit", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
10a10853f4f1c71b51d7c77266ca9f1519563035
wescpy/migrate-python2-appengine
mod8-cloudtasks/main.py
[ "Apache-2.0" ]
Python
trim
<not_specific>
def trim(): '(push) task queue handler to delete oldest visits' oldest = float(request.get_json().get('oldest')) with ds_client.context(): keys = Visit.query( Visit.timestamp < datetime.fromtimestamp(oldest) ).fetch(keys_only=True) nkeys = len(keys) if nkeys: ...
(push) task queue handler to delete oldest visits
(push) task queue handler to delete oldest visits
[ "(", "push", ")", "task", "queue", "handler", "to", "delete", "oldest", "visits" ]
def trim(): oldest = float(request.get_json().get('oldest')) with ds_client.context(): keys = Visit.query( Visit.timestamp < datetime.fromtimestamp(oldest) ).fetch(keys_only=True) nkeys = len(keys) if nkeys: logging.info('Deleting %d entities: %s' % ( ...
[ "def", "trim", "(", ")", ":", "oldest", "=", "float", "(", "request", ".", "get_json", "(", ")", ".", "get", "(", "'oldest'", ")", ")", "with", "ds_client", ".", "context", "(", ")", ":", "keys", "=", "Visit", ".", "query", "(", "Visit", ".", "ti...
(push) task queue handler to delete oldest visits
[ "(", "push", ")", "task", "queue", "handler", "to", "delete", "oldest", "visits" ]
[ "'(push) task queue handler to delete oldest visits'" ]
[]
{ "returns": [], "raises": [], "params": [], "outlier_params": [], "others": [] }
0f7b12ca2ea3acebc1bb8e7b5e21b048f2f963b9
wescpy/migrate-python2-appengine
mod9-py3fstasks/main.py
[ "Apache-2.0" ]
Python
_create_queue_if
<not_specific>
def _create_queue_if(): 'app-internal function creating default queue if it does not exist' try: ts_client.get_queue(name=QUEUE_PATH) except Exception as e: if 'does not exist' in str(e): ts_client.create_queue(parent=PATH_PREFIX, queue={'name': QUEUE_PATH}) ...
app-internal function creating default queue if it does not exist
app-internal function creating default queue if it does not exist
[ "app", "-", "internal", "function", "creating", "default", "queue", "if", "it", "does", "not", "exist" ]
def _create_queue_if(): try: ts_client.get_queue(name=QUEUE_PATH) except Exception as e: if 'does not exist' in str(e): ts_client.create_queue(parent=PATH_PREFIX, queue={'name': QUEUE_PATH}) return True
[ "def", "_create_queue_if", "(", ")", ":", "try", ":", "ts_client", ".", "get_queue", "(", "name", "=", "QUEUE_PATH", ")", "except", "Exception", "as", "e", ":", "if", "'does not exist'", "in", "str", "(", "e", ")", ":", "ts_client", ".", "create_queue", ...
app-internal function creating default queue if it does not exist
[ "app", "-", "internal", "function", "creating", "default", "queue", "if", "it", "does", "not", "exist" ]
[ "'app-internal function creating default queue if it does not exist'" ]
[]
{ "returns": [], "raises": [], "params": [], "outlier_params": [], "others": [] }
0f7b12ca2ea3acebc1bb8e7b5e21b048f2f963b9
wescpy/migrate-python2-appengine
mod9-py3fstasks/main.py
[ "Apache-2.0" ]
Python
fetch_visits
<not_specific>
def fetch_visits(limit): 'get most recent visits & add task to delete older visits' visits_ref = fs_client.collection('Visit') visits = list(v.to_dict() for v in visits_ref.order_by('timestamp', direction=firestore.Query.DESCENDING).limit(limit).stream()) oldest = time.mktime(visits[-1]['tim...
get most recent visits & add task to delete older visits
get most recent visits & add task to delete older visits
[ "get", "most", "recent", "visits", "&", "add", "task", "to", "delete", "older", "visits" ]
def fetch_visits(limit): visits_ref = fs_client.collection('Visit') visits = list(v.to_dict() for v in visits_ref.order_by('timestamp', direction=firestore.Query.DESCENDING).limit(limit).stream()) oldest = time.mktime(visits[-1]['timestamp'].timetuple()) oldest_str = time.ctime(oldest) p...
[ "def", "fetch_visits", "(", "limit", ")", ":", "visits_ref", "=", "fs_client", ".", "collection", "(", "'Visit'", ")", "visits", "=", "list", "(", "v", ".", "to_dict", "(", ")", "for", "v", "in", "visits_ref", ".", "order_by", "(", "'timestamp'", ",", ...
get most recent visits & add task to delete older visits
[ "get", "most", "recent", "visits", "&", "add", "task", "to", "delete", "older", "visits" ]
[ "'get most recent visits & add task to delete older visits'" ]
[ { "param": "limit", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "limit", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
0f7b12ca2ea3acebc1bb8e7b5e21b048f2f963b9
wescpy/migrate-python2-appengine
mod9-py3fstasks/main.py
[ "Apache-2.0" ]
Python
_delete_docs
null
def _delete_docs(visits): 'app-internal generator deleting old FS visit documents' for visit in visits: visit.reference.delete() yield visit.id
app-internal generator deleting old FS visit documents
app-internal generator deleting old FS visit documents
[ "app", "-", "internal", "generator", "deleting", "old", "FS", "visit", "documents" ]
def _delete_docs(visits): for visit in visits: visit.reference.delete() yield visit.id
[ "def", "_delete_docs", "(", "visits", ")", ":", "for", "visit", "in", "visits", ":", "visit", ".", "reference", ".", "delete", "(", ")", "yield", "visit", ".", "id" ]
app-internal generator deleting old FS visit documents
[ "app", "-", "internal", "generator", "deleting", "old", "FS", "visit", "documents" ]
[ "'app-internal generator deleting old FS visit documents'" ]
[ { "param": "visits", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "visits", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
0f7b12ca2ea3acebc1bb8e7b5e21b048f2f963b9
wescpy/migrate-python2-appengine
mod9-py3fstasks/main.py
[ "Apache-2.0" ]
Python
trim
<not_specific>
def trim(): '(push) task queue handler to delete oldest visits' oldest = float(request.get_json().get('oldest')) query = fs_client.collection('Visit') visits = query.where('timestamp', '<', datetime.fromtimestamp(oldest)).stream() dlist = ', '.join(str(v_id) for v_id in _delete_docs(visi...
(push) task queue handler to delete oldest visits
(push) task queue handler to delete oldest visits
[ "(", "push", ")", "task", "queue", "handler", "to", "delete", "oldest", "visits" ]
def trim(): oldest = float(request.get_json().get('oldest')) query = fs_client.collection('Visit') visits = query.where('timestamp', '<', datetime.fromtimestamp(oldest)).stream() dlist = ', '.join(str(v_id) for v_id in _delete_docs(visits)) if dlist: print('Deleting %d entities: ...
[ "def", "trim", "(", ")", ":", "oldest", "=", "float", "(", "request", ".", "get_json", "(", ")", ".", "get", "(", "'oldest'", ")", ")", "query", "=", "fs_client", ".", "collection", "(", "'Visit'", ")", "visits", "=", "query", ".", "where", "(", "'...
(push) task queue handler to delete oldest visits
[ "(", "push", ")", "task", "queue", "handler", "to", "delete", "oldest", "visits" ]
[ "'(push) task queue handler to delete oldest visits'" ]
[]
{ "returns": [], "raises": [], "params": [], "outlier_params": [], "others": [] }
9455eb29c6d0de6c586e4f209f202996dc497666
wescpy/migrate-python2-appengine
mod13b-memorystore/main.py
[ "Apache-2.0" ]
Python
root
<not_specific>
def root(): 'main application (GET) handler' # check for (hour-)cached visits ip_addr, usr_agt = request.remote_addr, request.user_agent visitor = '{}: {}'.format(ip_addr, usr_agt) rsp = REDIS.get('visits') visits = pickle.loads(rsp) if rsp else None # register visit & run DB query if cache...
main application (GET) handler
main application (GET) handler
[ "main", "application", "(", "GET", ")", "handler" ]
def root(): ip_addr, usr_agt = request.remote_addr, request.user_agent visitor = '{}: {}'.format(ip_addr, usr_agt) rsp = REDIS.get('visits') visits = pickle.loads(rsp) if rsp else None if not visits or visits[0]['visitor'] != visitor: store_visit(ip_addr, usr_agt) visits = list(fetch...
[ "def", "root", "(", ")", ":", "ip_addr", ",", "usr_agt", "=", "request", ".", "remote_addr", ",", "request", ".", "user_agent", "visitor", "=", "'{}: {}'", ".", "format", "(", "ip_addr", ",", "usr_agt", ")", "rsp", "=", "REDIS", ".", "get", "(", "'visi...
main application (GET) handler
[ "main", "application", "(", "GET", ")", "handler" ]
[ "'main application (GET) handler'", "# check for (hour-)cached visits", "# register visit & run DB query if cache empty or new visitor" ]
[]
{ "returns": [], "raises": [], "params": [], "outlier_params": [], "others": [] }
b78b2f0b5c333eb74cb8ff5e6bdfcb814b5e79a7
JackSomm/speed-typing
game.py
[ "MIT" ]
Python
count
null
def count(self, timer): """ Counts the timer down starting from where the user sets the time at """ if self.running: if timer > -1: mins, secs = divmod(timer, 60) self.minutes.set(f"{mins}") self.seconds.set(f"{secs}") ...
Counts the timer down starting from where the user sets the time at
Counts the timer down starting from where the user sets the time at
[ "Counts", "the", "timer", "down", "starting", "from", "where", "the", "user", "sets", "the", "time", "at" ]
def count(self, timer): if self.running: if timer > -1: mins, secs = divmod(timer, 60) self.minutes.set(f"{mins}") self.seconds.set(f"{secs}") self.timer = timer self.after_loop = self.root.after(1000, self.count, timer-1) ...
[ "def", "count", "(", "self", ",", "timer", ")", ":", "if", "self", ".", "running", ":", "if", "timer", ">", "-", "1", ":", "mins", ",", "secs", "=", "divmod", "(", "timer", ",", "60", ")", "self", ".", "minutes", ".", "set", "(", "f\"{mins}\"", ...
Counts the timer down starting from where the user sets the time at
[ "Counts", "the", "timer", "down", "starting", "from", "where", "the", "user", "sets", "the", "time", "at" ]
[ "\"\"\"\n Counts the timer down starting from where the user sets the time at\n \"\"\"" ]
[ { "param": "self", "type": null }, { "param": "timer", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "timer", "type": null, "docstring": null, "docstring_tokens": ...
b78b2f0b5c333eb74cb8ff5e6bdfcb814b5e79a7
JackSomm/speed-typing
game.py
[ "MIT" ]
Python
start
null
def start(self, event): """ Starts the game once the user presses the Tab key """ if not self.running: self.running = True # Start the timer self.counter = int(self.minutes.get())*60 + int(self.seconds.get()) self.count(self.counter) ...
Starts the game once the user presses the Tab key
Starts the game once the user presses the Tab key
[ "Starts", "the", "game", "once", "the", "user", "presses", "the", "Tab", "key" ]
def start(self, event): if not self.running: self.running = True self.counter = int(self.minutes.get())*60 + int(self.seconds.get()) self.count(self.counter) self.calc_thread = threading.Thread(target=self.calc_stats) self.calc_thread.start()
[ "def", "start", "(", "self", ",", "event", ")", ":", "if", "not", "self", ".", "running", ":", "self", ".", "running", "=", "True", "self", ".", "counter", "=", "int", "(", "self", ".", "minutes", ".", "get", "(", ")", ")", "*", "60", "+", "int...
Starts the game once the user presses the Tab key
[ "Starts", "the", "game", "once", "the", "user", "presses", "the", "Tab", "key" ]
[ "\"\"\"\n Starts the game once the user presses the Tab key\n \"\"\"", "# Start the timer", "# Start the stat calculation thread" ]
[ { "param": "self", "type": null }, { "param": "event", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "event", "type": null, "docstring": null, "docstring_tokens": ...
b78b2f0b5c333eb74cb8ff5e6bdfcb814b5e79a7
JackSomm/speed-typing
game.py
[ "MIT" ]
Python
calc_stats
null
def calc_stats(self): """ Calculate character per minute/second """ while self.running: time.sleep(0.1) self.counter += 0.1 cps = len(self.type_area.get()) / self.counter cpm = cps * 60 self.speed_label.config(text=f"Speed: \n{cps:.2f} CPS\n{cp...
Calculate character per minute/second
Calculate character per minute/second
[ "Calculate", "character", "per", "minute", "/", "second" ]
def calc_stats(self): while self.running: time.sleep(0.1) self.counter += 0.1 cps = len(self.type_area.get()) / self.counter cpm = cps * 60 self.speed_label.config(text=f"Speed: \n{cps:.2f} CPS\n{cpm:.2f} CPM")
[ "def", "calc_stats", "(", "self", ")", ":", "while", "self", ".", "running", ":", "time", ".", "sleep", "(", "0.1", ")", "self", ".", "counter", "+=", "0.1", "cps", "=", "len", "(", "self", ".", "type_area", ".", "get", "(", ")", ")", "/", "self"...
Calculate character per minute/second
[ "Calculate", "character", "per", "minute", "/", "second" ]
[ "\"\"\" Calculate character per minute/second \"\"\"" ]
[ { "param": "self", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
febf7bcb3656dab762c96b168c6946005b8addc2
stackhpc/lustre-tools
nodemap.py
[ "Apache-2.0" ]
Python
cmd
<not_specific>
def cmd(cmdline): """ Run a space-separated command and return its stdout/stderr. Uses shell, blocks until subprocess returns. """ proc = subprocess.Popen(cmdline, shell=True, stdin=subprocess.PIPE, stdout=subprocess.PIPE) # need shell else lctl not found stdout, stderr = proc.communicate() ...
Run a space-separated command and return its stdout/stderr. Uses shell, blocks until subprocess returns.
Run a space-separated command and return its stdout/stderr. Uses shell, blocks until subprocess returns.
[ "Run", "a", "space", "-", "separated", "command", "and", "return", "its", "stdout", "/", "stderr", ".", "Uses", "shell", "blocks", "until", "subprocess", "returns", "." ]
def cmd(cmdline): proc = subprocess.Popen(cmdline, shell=True, stdin=subprocess.PIPE, stdout=subprocess.PIPE) stdout, stderr = proc.communicate() return stdout, stderr
[ "def", "cmd", "(", "cmdline", ")", ":", "proc", "=", "subprocess", ".", "Popen", "(", "cmdline", ",", "shell", "=", "True", ",", "stdin", "=", "subprocess", ".", "PIPE", ",", "stdout", "=", "subprocess", ".", "PIPE", ")", "stdout", ",", "stderr", "="...
Run a space-separated command and return its stdout/stderr.
[ "Run", "a", "space", "-", "separated", "command", "and", "return", "its", "stdout", "/", "stderr", "." ]
[ "\"\"\" Run a space-separated command and return its stdout/stderr.\n\n Uses shell, blocks until subprocess returns.\n \"\"\"", "# need shell else lctl not found" ]
[ { "param": "cmdline", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "cmdline", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
febf7bcb3656dab762c96b168c6946005b8addc2
stackhpc/lustre-tools
nodemap.py
[ "Apache-2.0" ]
Python
load_live
<not_specific>
def load_live(): """ Load live nodemap information. Returns a nested datastructure in normalised form. """ output = {} lctl_get_param("nodemap.*", output) s, e = cmd("lctl nodemap_info",) # need quoting to avoid shell expansion! nodemaps = [n.split('.')[-1] for n in s.strip().split(...
Load live nodemap information. Returns a nested datastructure in normalised form.
Load live nodemap information. Returns a nested datastructure in normalised form.
[ "Load", "live", "nodemap", "information", ".", "Returns", "a", "nested", "datastructure", "in", "normalised", "form", "." ]
def load_live(): output = {} lctl_get_param("nodemap.*", output) s, e = cmd("lctl nodemap_info",) nodemaps = [n.split('.')[-1] for n in s.strip().split('\n')] for nmap in nodemaps: lctl_get_param("nodemap.{nmap}.*".format(nmap=nmap), output) to_int(output) deep_sort(output) retu...
[ "def", "load_live", "(", ")", ":", "output", "=", "{", "}", "lctl_get_param", "(", "\"nodemap.*\"", ",", "output", ")", "s", ",", "e", "=", "cmd", "(", "\"lctl nodemap_info\"", ",", ")", "nodemaps", "=", "[", "n", ".", "split", "(", "'.'", ")", "[", ...
Load live nodemap information.
[ "Load", "live", "nodemap", "information", "." ]
[ "\"\"\" Load live nodemap information.\n \n Returns a nested datastructure in normalised form.\n \"\"\"", "# need quoting to avoid shell expansion!", "#print(nodemaps)" ]
[]
{ "returns": [], "raises": [], "params": [], "outlier_params": [], "others": [] }
febf7bcb3656dab762c96b168c6946005b8addc2
stackhpc/lustre-tools
nodemap.py
[ "Apache-2.0" ]
Python
load_from_file
<not_specific>
def load_from_file(path): """ Load nodemap info from a file. Returns a nested datastructure in normalised form. """ with open(path) as f: nodemap = load(f.read(), Loader=Loader) deep_sort(nodemap) # to_int() not needed as file will have been saved with ints return no...
Load nodemap info from a file. Returns a nested datastructure in normalised form.
Load nodemap info from a file. Returns a nested datastructure in normalised form.
[ "Load", "nodemap", "info", "from", "a", "file", ".", "Returns", "a", "nested", "datastructure", "in", "normalised", "form", "." ]
def load_from_file(path): with open(path) as f: nodemap = load(f.read(), Loader=Loader) deep_sort(nodemap) return nodemap
[ "def", "load_from_file", "(", "path", ")", ":", "with", "open", "(", "path", ")", "as", "f", ":", "nodemap", "=", "load", "(", "f", ".", "read", "(", ")", ",", "Loader", "=", "Loader", ")", "deep_sort", "(", "nodemap", ")", "return", "nodemap" ]
Load nodemap info from a file.
[ "Load", "nodemap", "info", "from", "a", "file", "." ]
[ "\"\"\" Load nodemap info from a file.\n \n Returns a nested datastructure in normalised form.\n \"\"\"", "# to_int() not needed as file will have been saved with ints" ]
[ { "param": "path", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "path", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
febf7bcb3656dab762c96b168c6946005b8addc2
stackhpc/lustre-tools
nodemap.py
[ "Apache-2.0" ]
Python
deep_sort
<not_specific>
def deep_sort(data): """ In-place sort of any lists in a nested dict/list datastructure. """ if isinstance(data, list): data.sort() for item in data: deep_sort(item) elif isinstance(data, dict): for item in data.itervalues(): deep_sort(item) return None
In-place sort of any lists in a nested dict/list datastructure.
In-place sort of any lists in a nested dict/list datastructure.
[ "In", "-", "place", "sort", "of", "any", "lists", "in", "a", "nested", "dict", "/", "list", "datastructure", "." ]
def deep_sort(data): if isinstance(data, list): data.sort() for item in data: deep_sort(item) elif isinstance(data, dict): for item in data.itervalues(): deep_sort(item) return None
[ "def", "deep_sort", "(", "data", ")", ":", "if", "isinstance", "(", "data", ",", "list", ")", ":", "data", ".", "sort", "(", ")", "for", "item", "in", "data", ":", "deep_sort", "(", "item", ")", "elif", "isinstance", "(", "data", ",", "dict", ")", ...
In-place sort of any lists in a nested dict/list datastructure.
[ "In", "-", "place", "sort", "of", "any", "lists", "in", "a", "nested", "dict", "/", "list", "datastructure", "." ]
[ "\"\"\" In-place sort of any lists in a nested dict/list datastructure. \"\"\"" ]
[ { "param": "data", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "data", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
febf7bcb3656dab762c96b168c6946005b8addc2
stackhpc/lustre-tools
nodemap.py
[ "Apache-2.0" ]
Python
to_int
<not_specific>
def to_int(data, key_or_idx=None): """ Change ints-as-strs in nested python lists/dicts to ints NB: modifies data in place and returns None """ if key_or_idx is None: value = data else: value = data[key_or_idx] if isinstance(value, list): for idx, v in enumerate(...
Change ints-as-strs in nested python lists/dicts to ints NB: modifies data in place and returns None
Change ints-as-strs in nested python lists/dicts to ints NB: modifies data in place and returns None
[ "Change", "ints", "-", "as", "-", "strs", "in", "nested", "python", "lists", "/", "dicts", "to", "ints", "NB", ":", "modifies", "data", "in", "place", "and", "returns", "None" ]
def to_int(data, key_or_idx=None): if key_or_idx is None: value = data else: value = data[key_or_idx] if isinstance(value, list): for idx, v in enumerate(value): to_int(value, idx) elif isinstance(value, dict): for k, v in value.iteritems(): to_int...
[ "def", "to_int", "(", "data", ",", "key_or_idx", "=", "None", ")", ":", "if", "key_or_idx", "is", "None", ":", "value", "=", "data", "else", ":", "value", "=", "data", "[", "key_or_idx", "]", "if", "isinstance", "(", "value", ",", "list", ")", ":", ...
Change ints-as-strs in nested python lists/dicts to ints NB: modifies data in place and returns None
[ "Change", "ints", "-", "as", "-", "strs", "in", "nested", "python", "lists", "/", "dicts", "to", "ints", "NB", ":", "modifies", "data", "in", "place", "and", "returns", "None" ]
[ "\"\"\" Change ints-as-strs in nested python lists/dicts to ints\n \n NB: modifies data in place and returns None\n \"\"\"" ]
[ { "param": "data", "type": null }, { "param": "key_or_idx", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "data", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "key_or_idx", "type": null, "docstring": null, "docstring_toke...
febf7bcb3656dab762c96b168c6946005b8addc2
stackhpc/lustre-tools
nodemap.py
[ "Apache-2.0" ]
Python
flatten
<not_specific>
def flatten(data): """ Flatten a nested dict into a sequence of (keypath, value). - `keypath` is a list giving the keys to get to the corresponding value - `value` is the value at this keypath - if this is a nested dict then it is shown as an empty dict {} with the nested values shown at...
Flatten a nested dict into a sequence of (keypath, value). - `keypath` is a list giving the keys to get to the corresponding value - `value` is the value at this keypath - if this is a nested dict then it is shown as an empty dict {} with the nested values shown at their corresponding keypa...
Flatten a nested dict into a sequence of (keypath, value). `keypath` is a list giving the keys to get to the corresponding value `value` is the value at this keypath - if this is a nested dict then it is shown as an empty dict {} with the nested values shown at their corresponding keypaths.
[ "Flatten", "a", "nested", "dict", "into", "a", "sequence", "of", "(", "keypath", "value", ")", ".", "`", "keypath", "`", "is", "a", "list", "giving", "the", "keys", "to", "get", "to", "the", "corresponding", "value", "`", "value", "`", "is", "the", "...
def flatten(data): stack = [([], data)] results = [] while stack: keyparts, data = stack.pop(0) if isinstance(data, dict): if keyparts != []: results.append((tuple(keyparts), {})) for k in sorted(data.keys()): stack.append((keyparts + [...
[ "def", "flatten", "(", "data", ")", ":", "stack", "=", "[", "(", "[", "]", ",", "data", ")", "]", "results", "=", "[", "]", "while", "stack", ":", "keyparts", ",", "data", "=", "stack", ".", "pop", "(", "0", ")", "if", "isinstance", "(", "data"...
Flatten a nested dict into a sequence of (keypath, value).
[ "Flatten", "a", "nested", "dict", "into", "a", "sequence", "of", "(", "keypath", "value", ")", "." ]
[ "\"\"\" Flatten a nested dict into a sequence of (keypath, value).\n\n - `keypath` is a list giving the keys to get to the corresponding value\n - `value` is the value at this keypath - if this is a nested dict then it is shown as an empty dict {}\n with the nested values shown at their corr...
[ { "param": "data", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "data", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
febf7bcb3656dab762c96b168c6946005b8addc2
stackhpc/lustre-tools
nodemap.py
[ "Apache-2.0" ]
Python
strip_range_id
null
def strip_range_id(ranges): """ Remove `id` field from ranges in nodemap range list Works in place, returns None. """ for r in ranges: if 'id' in r: del r['id']
Remove `id` field from ranges in nodemap range list Works in place, returns None.
Remove `id` field from ranges in nodemap range list Works in place, returns None.
[ "Remove", "`", "id", "`", "field", "from", "ranges", "in", "nodemap", "range", "list", "Works", "in", "place", "returns", "None", "." ]
def strip_range_id(ranges): for r in ranges: if 'id' in r: del r['id']
[ "def", "strip_range_id", "(", "ranges", ")", ":", "for", "r", "in", "ranges", ":", "if", "'id'", "in", "r", ":", "del", "r", "[", "'id'", "]" ]
Remove `id` field from ranges in nodemap range list Works in place, returns None.
[ "Remove", "`", "id", "`", "field", "from", "ranges", "in", "nodemap", "range", "list", "Works", "in", "place", "returns", "None", "." ]
[ "\"\"\" Remove `id` field from ranges in nodemap range list\n \n Works in place, returns None.\n \"\"\"" ]
[ { "param": "ranges", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "ranges", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
febf7bcb3656dab762c96b168c6946005b8addc2
stackhpc/lustre-tools
nodemap.py
[ "Apache-2.0" ]
Python
make_changes
null
def make_changes(changes, func=call): """ Make changes to the live nodemap config as output from diff(). Pass a print function as `func` to output the commands which would normally be run. """ # Unlike other diff functions this is more nodemap-specific, e.g. knows that when nodemap don't need ...
Make changes to the live nodemap config as output from diff(). Pass a print function as `func` to output the commands which would normally be run.
Make changes to the live nodemap config as output from diff(). Pass a print function as `func` to output the commands which would normally be run.
[ "Make", "changes", "to", "the", "live", "nodemap", "config", "as", "output", "from", "diff", "()", ".", "Pass", "a", "print", "function", "as", "`", "func", "`", "to", "output", "the", "commands", "which", "would", "normally", "be", "run", "." ]
def make_changes(changes, func=call): deleted_nodemaps = [] for (keypath, action, value) in changes: if keypath[0] != 'nodemap': raise ValueError("'nodemap' not at start of key path %s: is this a nodemap diff?" % keypath) nodemap = keypath[1] if len(keypath) == 2: ...
[ "def", "make_changes", "(", "changes", ",", "func", "=", "call", ")", ":", "deleted_nodemaps", "=", "[", "]", "for", "(", "keypath", ",", "action", ",", "value", ")", "in", "changes", ":", "if", "keypath", "[", "0", "]", "!=", "'nodemap'", ":", "rais...
Make changes to the live nodemap config as output from diff().
[ "Make", "changes", "to", "the", "live", "nodemap", "config", "as", "output", "from", "diff", "()", "." ]
[ "\"\"\" Make changes to the live nodemap config as output from diff().\n \n Pass a print function as `func` to output the commands which would normally be run.\n \"\"\"", "# Unlike other diff functions this is more nodemap-specific, e.g. knows that when nodemap don't need to recurse into parameters, ...
[ { "param": "changes", "type": null }, { "param": "func", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "changes", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "func", "type": null, "docstring": null, "docstring_tokens"...
febf7bcb3656dab762c96b168c6946005b8addc2
stackhpc/lustre-tools
nodemap.py
[ "Apache-2.0" ]
Python
changes_to_yaml
<not_specific>
def changes_to_yaml(changes): """ Return a multi-line string of pseudo-yaml from a nested dict produced by `diff()`. Output is like a yaml version of the original dicts, except that deletions are prefixed with '<' and additions with '>'. Note that: - Modified values are shown as a d...
Return a multi-line string of pseudo-yaml from a nested dict produced by `diff()`. Output is like a yaml version of the original dicts, except that deletions are prefixed with '<' and additions with '>'. Note that: - Modified values are shown as a deletion and addition. - K...
Return a multi-line string of pseudo-yaml from a nested dict produced by `diff()`. Output is like a yaml version of the original dicts, except that deletions are prefixed with '<' and additions with '>'. Note that: Modified values are shown as a deletion and addition. Keys present in both "left" and "right" sides are ...
[ "Return", "a", "multi", "-", "line", "string", "of", "pseudo", "-", "yaml", "from", "a", "nested", "dict", "produced", "by", "`", "diff", "()", "`", ".", "Output", "is", "like", "a", "yaml", "version", "of", "the", "original", "dicts", "except", "that"...
def changes_to_yaml(changes): lines = [] nindent = 4 curr_keypath = [] for (keypath, action, value) in changes: common = [a for a, b in zip(curr_keypath, keypath) if a == b] new = keypath[len(common):] level = len(keypath) - 2 for i, k in enumerate(new[:-1]): ...
[ "def", "changes_to_yaml", "(", "changes", ")", ":", "lines", "=", "[", "]", "nindent", "=", "4", "curr_keypath", "=", "[", "]", "for", "(", "keypath", ",", "action", ",", "value", ")", "in", "changes", ":", "common", "=", "[", "a", "for", "a", ",",...
Return a multi-line string of pseudo-yaml from a nested dict produced by `diff()`.
[ "Return", "a", "multi", "-", "line", "string", "of", "pseudo", "-", "yaml", "from", "a", "nested", "dict", "produced", "by", "`", "diff", "()", "`", "." ]
[ "\"\"\" Return a multi-line string of pseudo-yaml from a nested dict produced by `diff()`.\n \n Output is like a yaml version of the original dicts, except that deletions are prefixed with '<'\n and additions with '>'. Note that:\n - Modified values are shown as a deletion and addition.\...
[ { "param": "changes", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "changes", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
9a9ff7ed373fbc6d7d266297e44716e6074c18e9
kermit1313/TogglSync
togglsync/toggl.py
[ "MIT" ]
Python
filter_valid_entries
<not_specific>
def filter_valid_entries(entries): """ Filters toggl entries - only with issue id - only with positive duration """ return [e for e in entries if e.is_valid()]
Filters toggl entries - only with issue id - only with positive duration
Filters toggl entries only with issue id only with positive duration
[ "Filters", "toggl", "entries", "only", "with", "issue", "id", "only", "with", "positive", "duration" ]
def filter_valid_entries(entries): return [e for e in entries if e.is_valid()]
[ "def", "filter_valid_entries", "(", "entries", ")", ":", "return", "[", "e", "for", "e", "in", "entries", "if", "e", ".", "is_valid", "(", ")", "]" ]
Filters toggl entries only with issue id only with positive duration
[ "Filters", "toggl", "entries", "only", "with", "issue", "id", "only", "with", "positive", "duration" ]
[ "\"\"\"\n Filters toggl entries\n\n - only with issue id\n - only with positive duration\n \"\"\"" ]
[ { "param": "entries", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "entries", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
7f12b94cad297e9f347da83822a4d74fd2c37c55
nicole814/scattertext
scattertext/__init__.py
[ "Apache-2.0" ]
Python
produce_semiotic_square_explorer
<not_specific>
def produce_semiotic_square_explorer(semiotic_square, x_label, y_label, category_name=None, not_category_name=None, neutral_category_na...
Produces a semiotic square visualization. Parameters ---------- semiotic_square : SemioticSquare The basis of the visualization x_label : str The x-axis label in the scatter plot. Relationship between `category_a` and `category_b`. y_label The y-axis label in the scatt...
Produces a semiotic square visualization. Parameters semiotic_square : SemioticSquare The basis of the visualization x_label : str The x-axis label in the scatter plot. Returns str, html of visualization
[ "Produces", "a", "semiotic", "square", "visualization", ".", "Parameters", "semiotic_square", ":", "SemioticSquare", "The", "basis", "of", "the", "visualization", "x_label", ":", "str", "The", "x", "-", "axis", "label", "in", "the", "scatter", "plot", ".", "Re...
def produce_semiotic_square_explorer(semiotic_square, x_label, y_label, category_name=None, not_category_name=None, neutral_category_na...
[ "def", "produce_semiotic_square_explorer", "(", "semiotic_square", ",", "x_label", ",", "y_label", ",", "category_name", "=", "None", ",", "not_category_name", "=", "None", ",", "neutral_category_name", "=", "None", ",", "num_terms_semiotic_square", "=", "None", ",", ...
Produces a semiotic square visualization.
[ "Produces", "a", "semiotic", "square", "visualization", "." ]
[ "'''\n Produces a semiotic square visualization.\n\n Parameters\n ----------\n semiotic_square : SemioticSquare\n The basis of the visualization\n x_label : str\n The x-axis label in the scatter plot. Relationship between `category_a` and `category_b`.\n y_label\n The y-axis ...
[ { "param": "semiotic_square", "type": null }, { "param": "x_label", "type": null }, { "param": "y_label", "type": null }, { "param": "category_name", "type": null }, { "param": "not_category_name", "type": null }, { "param": "neutral_category_name", ...
{ "returns": [], "raises": [], "params": [ { "identifier": "semiotic_square", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "x_label", "type": null, "docstring": null, "docstr...
7f12b94cad297e9f347da83822a4d74fd2c37c55
nicole814/scattertext
scattertext/__init__.py
[ "Apache-2.0" ]
Python
produce_four_square_axes_explorer
<not_specific>
def produce_four_square_axes_explorer(four_square_axes, x_label=None, y_label=None, num_terms_semiotic_square=None, get_tooltip_content=None, ...
Produces a semiotic square visualization. Parameters ---------- four_square : FourSquareAxes The basis of the visualization x_label : str The x-axis label in the scatter plot. Relationship between `category_a` and `category_b`. y_label The y-axis label in the scatter p...
Produces a semiotic square visualization. Parameters four_square : FourSquareAxes The basis of the visualization x_label : str The x-axis label in the scatter plot. Returns str, html of visualization
[ "Produces", "a", "semiotic", "square", "visualization", ".", "Parameters", "four_square", ":", "FourSquareAxes", "The", "basis", "of", "the", "visualization", "x_label", ":", "str", "The", "x", "-", "axis", "label", "in", "the", "scatter", "plot", ".", "Return...
def produce_four_square_axes_explorer(four_square_axes, x_label=None, y_label=None, num_terms_semiotic_square=None, get_tooltip_content=None, ...
[ "def", "produce_four_square_axes_explorer", "(", "four_square_axes", ",", "x_label", "=", "None", ",", "y_label", "=", "None", ",", "num_terms_semiotic_square", "=", "None", ",", "get_tooltip_content", "=", "None", ",", "x_axis_values", "=", "None", ",", "y_axis_val...
Produces a semiotic square visualization.
[ "Produces", "a", "semiotic", "square", "visualization", "." ]
[ "'''\n Produces a semiotic square visualization.\n\n Parameters\n ----------\n four_square : FourSquareAxes\n The basis of the visualization\n x_label : str\n The x-axis label in the scatter plot. Relationship between `category_a` and `category_b`.\n y_label\n The y-axis labe...
[ { "param": "four_square_axes", "type": null }, { "param": "x_label", "type": null }, { "param": "y_label", "type": null }, { "param": "num_terms_semiotic_square", "type": null }, { "param": "get_tooltip_content", "type": null }, { "param": "x_axis_valu...
{ "returns": [], "raises": [], "params": [ { "identifier": "four_square_axes", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "x_label", "type": null, "docstring": null, "docst...
7f12b94cad297e9f347da83822a4d74fd2c37c55
nicole814/scattertext
scattertext/__init__.py
[ "Apache-2.0" ]
Python
produce_projection_explorer
<not_specific>
def produce_projection_explorer(corpus, category, word2vec_model=None, projection_model=None, embeddings=None, term_acceptance_re=re.compile('[a-z]{3,}'), ...
Parameters ---------- corpus : ParsedCorpus It is highly recommended to use a stoplisted, unigram corpus-- `corpus.get_stoplisted_unigram_corpus()` category : str word2vec_model : Word2Vec A gensim word2vec model. A default model will be used instead. See Word2VecFromParsedCorpus f...
Parameters corpus : ParsedCorpus It is highly recommended to use a stoplisted, unigram corpus-- `corpus.get_stoplisted_unigram_corpus()` category : str word2vec_model : Word2Vec A gensim word2vec model. A default model will be used instead. See Word2VecFromParsedCorpus for the default model. projection_model : sklearn...
[ "Parameters", "corpus", ":", "ParsedCorpus", "It", "is", "highly", "recommended", "to", "use", "a", "stoplisted", "unigram", "corpus", "--", "`", "corpus", ".", "get_stoplisted_unigram_corpus", "()", "`", "category", ":", "str", "word2vec_model", ":", "Word2Vec", ...
def produce_projection_explorer(corpus, category, word2vec_model=None, projection_model=None, embeddings=None, term_acceptance_re=re.compile('[a-z]{3,}'), ...
[ "def", "produce_projection_explorer", "(", "corpus", ",", "category", ",", "word2vec_model", "=", "None", ",", "projection_model", "=", "None", ",", "embeddings", "=", "None", ",", "term_acceptance_re", "=", "re", ".", "compile", "(", "'[a-z]{3,}'", ")", ",", ...
Parameters corpus : ParsedCorpus It is highly recommended to use a stoplisted, unigram corpus-- `corpus.get_stoplisted_unigram_corpus()` category : str word2vec_model : Word2Vec A gensim word2vec model.
[ "Parameters", "corpus", ":", "ParsedCorpus", "It", "is", "highly", "recommended", "to", "use", "a", "stoplisted", "unigram", "corpus", "--", "`", "corpus", ".", "get_stoplisted_unigram_corpus", "()", "`", "category", ":", "str", "word2vec_model", ":", "Word2Vec", ...
[ "'''\n Parameters\n ----------\n corpus : ParsedCorpus\n It is highly recommended to use a stoplisted, unigram corpus-- `corpus.get_stoplisted_unigram_corpus()`\n category : str\n word2vec_model : Word2Vec\n A gensim word2vec model. A default model will be used instead. See Word2VecFro...
[ { "param": "corpus", "type": null }, { "param": "category", "type": null }, { "param": "word2vec_model", "type": null }, { "param": "projection_model", "type": null }, { "param": "embeddings", "type": null }, { "param": "term_acceptance_re", "type"...
{ "returns": [], "raises": [], "params": [ { "identifier": "corpus", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "category", "type": null, "docstring": null, "docstring_toke...
fc37dfe31d2d8f95cdc81073d384b247752540a5
sergeii/swat-http
fabfile/server.py
[ "MIT" ]
Python
all
null
def all(): """Set up the compiled packages on a clean server, then launch it.""" setup() install() launch()
Set up the compiled packages on a clean server, then launch it.
Set up the compiled packages on a clean server, then launch it.
[ "Set", "up", "the", "compiled", "packages", "on", "a", "clean", "server", "then", "launch", "it", "." ]
def all(): setup() install() launch()
[ "def", "all", "(", ")", ":", "setup", "(", ")", "install", "(", ")", "launch", "(", ")" ]
Set up the compiled packages on a clean server, then launch it.
[ "Set", "up", "the", "compiled", "packages", "on", "a", "clean", "server", "then", "launch", "it", "." ]
[ "\"\"\"Set up the compiled packages on a clean server, then launch it.\"\"\"" ]
[]
{ "returns": [], "raises": [], "params": [], "outlier_params": [], "others": [] }
fc37dfe31d2d8f95cdc81073d384b247752540a5
sergeii/swat-http
fabfile/server.py
[ "MIT" ]
Python
install
null
def install(kits=_kits): """Install the compiled packages on a test server.""" with quiet(): # configure separate servers for every listed kit for kit in kits: with cd(env.server['path'].child(env.kits[kit]['content'], 'System')): # transfer compiled packages ...
Install the compiled packages on a test server.
Install the compiled packages on a test server.
[ "Install", "the", "compiled", "packages", "on", "a", "test", "server", "." ]
def install(kits=_kits): with quiet(): for kit in kits: with cd(env.server['path'].child(env.kits[kit]['content'], 'System')): for package, _ in env.ucc['packages']: put(env.paths['compiled'].child(kit, '{}.u'.format(package)), '.') with edit_i...
[ "def", "install", "(", "kits", "=", "_kits", ")", ":", "with", "quiet", "(", ")", ":", "for", "kit", "in", "kits", ":", "with", "cd", "(", "env", ".", "server", "[", "'path'", "]", ".", "child", "(", "env", ".", "kits", "[", "kit", "]", "[", ...
Install the compiled packages on a test server.
[ "Install", "the", "compiled", "packages", "on", "a", "test", "server", "." ]
[ "\"\"\"Install the compiled packages on a test server.\"\"\"", "# configure separate servers for every listed kit", "# transfer compiled packages", "# edit Swat4DedicatedServer.ini", "# append extra lines to a section", "# set/replace section" ]
[ { "param": "kits", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "kits", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
fc37dfe31d2d8f95cdc81073d384b247752540a5
sergeii/swat-http
fabfile/server.py
[ "MIT" ]
Python
launch
null
def launch(kits=_kits): """Run a swat demo server.""" # configure a separate server for every listed kit for kit in kits: puts('Starting {}'.format(env.kits[kit]['server'])) with cd(env.server['path'].child(env.kits[kit]['content'], 'System')): run('DISPLAY=:0 screen -d -m wine {...
Run a swat demo server.
Run a swat demo server.
[ "Run", "a", "swat", "demo", "server", "." ]
def launch(kits=_kits): for kit in kits: puts('Starting {}'.format(env.kits[kit]['server'])) with cd(env.server['path'].child(env.kits[kit]['content'], 'System')): run('DISPLAY=:0 screen -d -m wine {}'.format(env.kits[kit]['server'])) if prompt('Stop the servers?', default='y').lower...
[ "def", "launch", "(", "kits", "=", "_kits", ")", ":", "for", "kit", "in", "kits", ":", "puts", "(", "'Starting {}'", ".", "format", "(", "env", ".", "kits", "[", "kit", "]", "[", "'server'", "]", ")", ")", "with", "cd", "(", "env", ".", "server",...
Run a swat demo server.
[ "Run", "a", "swat", "demo", "server", "." ]
[ "\"\"\"Run a swat demo server.\"\"\"", "# configure a separate server for every listed kit" ]
[ { "param": "kits", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "kits", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
d9351f21461753379cc4ab2c59e0b35eba42a52e
sergeii/swat-http
fabfile/utils.py
[ "MIT" ]
Python
checkout
null
def checkout(remote, local): """ Clone a remote repository `remote` to `local` and checkout origin/master. If the `remote` argument contains an optional extension `#revision`, then the specified revision will be checked out instead. """ path, revision = (remote.split('#', 1) + [None])[:2] i...
Clone a remote repository `remote` to `local` and checkout origin/master. If the `remote` argument contains an optional extension `#revision`, then the specified revision will be checked out instead.
Clone a remote repository `remote` to `local` and checkout origin/master. If the `remote` argument contains an optional extension `#revision`, then the specified revision will be checked out instead.
[ "Clone", "a", "remote", "repository", "`", "remote", "`", "to", "`", "local", "`", "and", "checkout", "origin", "/", "master", ".", "If", "the", "`", "remote", "`", "argument", "contains", "an", "optional", "extension", "`", "#revision", "`", "then", "th...
def checkout(remote, local): path, revision = (remote.split('#', 1) + [None])[:2] if not exists(local): git('clone {} {}'.format(path, local)) with cd(local): rev = revision if revision else 'origin/master' git('fetch origin') git('checkout --force {}'.format(rev)) gi...
[ "def", "checkout", "(", "remote", ",", "local", ")", ":", "path", ",", "revision", "=", "(", "remote", ".", "split", "(", "'#'", ",", "1", ")", "+", "[", "None", "]", ")", "[", ":", "2", "]", "if", "not", "exists", "(", "local", ")", ":", "gi...
Clone a remote repository `remote` to `local` and checkout origin/master.
[ "Clone", "a", "remote", "repository", "`", "remote", "`", "to", "`", "local", "`", "and", "checkout", "origin", "/", "master", "." ]
[ "\"\"\"\n Clone a remote repository `remote` to `local` and checkout origin/master.\n\n If the `remote` argument contains an optional extension `#revision`,\n then the specified revision will be checked out instead.\n \"\"\"", "# --mixed?" ]
[ { "param": "remote", "type": null }, { "param": "local", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "remote", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "local", "type": null, "docstring": null, "docstring_tokens"...
d9351f21461753379cc4ab2c59e0b35eba42a52e
sergeii/swat-http
fabfile/utils.py
[ "MIT" ]
Python
edit_ini
null
def edit_ini(path): """Yield an IniFile object for the given ini remote file path.""" tmp_file = tmp() # copy the remote file to the local /tmp dir get(path, tmp_file) # get an ini file manager ini = IniFile(tmp_file) # let the invoker modify file contents yield ini fobj = Strin...
Yield an IniFile object for the given ini remote file path.
Yield an IniFile object for the given ini remote file path.
[ "Yield", "an", "IniFile", "object", "for", "the", "given", "ini", "remote", "file", "path", "." ]
def edit_ini(path): tmp_file = tmp() get(path, tmp_file) ini = IniFile(tmp_file) yield ini fobj = StringIO() fobj.write(ini.get_contents()) put(fobj, path) fobj.close()
[ "def", "edit_ini", "(", "path", ")", ":", "tmp_file", "=", "tmp", "(", ")", "get", "(", "path", ",", "tmp_file", ")", "ini", "=", "IniFile", "(", "tmp_file", ")", "yield", "ini", "fobj", "=", "StringIO", "(", ")", "fobj", ".", "write", "(", "ini", ...
Yield an IniFile object for the given ini remote file path.
[ "Yield", "an", "IniFile", "object", "for", "the", "given", "ini", "remote", "file", "path", "." ]
[ "\"\"\"Yield an IniFile object for the given ini remote file path.\"\"\"", "# copy the remote file to the local /tmp dir", "# get an ini file manager", "# let the invoker modify file contents", "# transfer it back to the remote machine" ]
[ { "param": "path", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "path", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
af63b133e1337bf4cb47e44ff076251eb48987c3
FlipWebApps/computer-vision-playground
GAN/Architectures/models/acgan.py
[ "MIT" ]
Python
build_discriminator
null
def build_discriminator(self): """Override building of the discriminator.""" # weight initialization init = RandomNormal(stddev=0.02) # image input in_image = Input(shape=self.in_shape) # downsample to 14x14 fe = Conv2D(32, (3,3), strides=(2,2), padding='same', ke...
Override building of the discriminator.
Override building of the discriminator.
[ "Override", "building", "of", "the", "discriminator", "." ]
def build_discriminator(self): init = RandomNormal(stddev=0.02) in_image = Input(shape=self.in_shape) fe = Conv2D(32, (3,3), strides=(2,2), padding='same', kernel_initializer=init)(in_image) fe = LeakyReLU(alpha=0.2)(fe) fe = Dropout(0.5)(fe) fe = Conv2D(64, (3,3), paddin...
[ "def", "build_discriminator", "(", "self", ")", ":", "init", "=", "RandomNormal", "(", "stddev", "=", "0.02", ")", "in_image", "=", "Input", "(", "shape", "=", "self", ".", "in_shape", ")", "fe", "=", "Conv2D", "(", "32", ",", "(", "3", ",", "3", "...
Override building of the discriminator.
[ "Override", "building", "of", "the", "discriminator", "." ]
[ "\"\"\"Override building of the discriminator.\"\"\"", "# weight initialization", "# image input", "# downsample to 14x14", "# normal", "# downsample to 7x7", "# normal", "# flatten feature maps", "# real/fake output", "# class label output", "# define model", "# compile model" ]
[ { "param": "self", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
af63b133e1337bf4cb47e44ff076251eb48987c3
FlipWebApps/computer-vision-playground
GAN/Architectures/models/acgan.py
[ "MIT" ]
Python
build_generator
null
def build_generator(self): """Override building the standalone generator model""" # weight initialization init = RandomNormal(stddev=0.02) # label input in_label = Input(shape=(1,)) # embedding for categorical input li = Embedding(self.n_classes, 50)(in_label) ...
Override building the standalone generator model
Override building the standalone generator model
[ "Override", "building", "the", "standalone", "generator", "model" ]
def build_generator(self): init = RandomNormal(stddev=0.02) in_label = Input(shape=(1,)) li = Embedding(self.n_classes, 50)(in_label) n_nodes = 7 * 7 li = Dense(n_nodes, kernel_initializer=init)(li) li = Reshape((7, 7, 1))(li) in_lat = Input(shape=(self.latent_dim...
[ "def", "build_generator", "(", "self", ")", ":", "init", "=", "RandomNormal", "(", "stddev", "=", "0.02", ")", "in_label", "=", "Input", "(", "shape", "=", "(", "1", ",", ")", ")", "li", "=", "Embedding", "(", "self", ".", "n_classes", ",", "50", "...
Override building the standalone generator model
[ "Override", "building", "the", "standalone", "generator", "model" ]
[ "\"\"\"Override building the standalone generator model\"\"\"", "# weight initialization", "# label input", "# embedding for categorical input", "# linear multiplication", "# reshape to additional channel", "# image generator input", "# foundation for 7x7 image", "# merge image gen and label input",...
[ { "param": "self", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
af63b133e1337bf4cb47e44ff076251eb48987c3
FlipWebApps/computer-vision-playground
GAN/Architectures/models/acgan.py
[ "MIT" ]
Python
build_gan
null
def build_gan(self): """override defining of the combined generator and discriminator model, for updating the generator""" # make weights in the discriminator not trainable self.d_model.trainable = False # connect the outputs of the generator to the inputs of the discriminator ga...
override defining of the combined generator and discriminator model, for updating the generator
override defining of the combined generator and discriminator model, for updating the generator
[ "override", "defining", "of", "the", "combined", "generator", "and", "discriminator", "model", "for", "updating", "the", "generator" ]
def build_gan(self): self.d_model.trainable = False gan_output = self.d_model(self.g_model.output) self.gan_model = Model(self.g_model.input, gan_output) opt = Adam(lr=0.0002, beta_1=0.5) self.gan_model.compile(loss=['binary_crossentropy', 'sparse_categorical_crossentropy'], opti...
[ "def", "build_gan", "(", "self", ")", ":", "self", ".", "d_model", ".", "trainable", "=", "False", "gan_output", "=", "self", ".", "d_model", "(", "self", ".", "g_model", ".", "output", ")", "self", ".", "gan_model", "=", "Model", "(", "self", ".", "...
override defining of the combined generator and discriminator model, for updating the generator
[ "override", "defining", "of", "the", "combined", "generator", "and", "discriminator", "model", "for", "updating", "the", "generator" ]
[ "\"\"\"override defining of the combined generator and discriminator model, for updating the generator\"\"\"", "# make weights in the discriminator not trainable", "# connect the outputs of the generator to the inputs of the discriminator", "# define gan model as taking noise and label and outputting real/fak...
[ { "param": "self", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
df4cf960f5cccdcad0be7331412c12f64dc1a259
FlipWebApps/computer-vision-playground
GAN/Architectures/models/conditional_gan.py
[ "MIT" ]
Python
build_gan
null
def build_gan(self): """define the combined generator and discriminator model, for updating the generator""" # make weights in the discriminator not trainable self.d_model.trainable = False # get noise and label inputs from generator model gen_noise, gen_label = self.g_model.inpu...
define the combined generator and discriminator model, for updating the generator
define the combined generator and discriminator model, for updating the generator
[ "define", "the", "combined", "generator", "and", "discriminator", "model", "for", "updating", "the", "generator" ]
def build_gan(self): self.d_model.trainable = False gen_noise, gen_label = self.g_model.input gen_output = self.g_model.output gan_output = self.d_model([gen_output, gen_label]) self.gan_model = Model([gen_noise, gen_label], gan_output) opt = Adam(lr=0.0002, beta_1=0.5) ...
[ "def", "build_gan", "(", "self", ")", ":", "self", ".", "d_model", ".", "trainable", "=", "False", "gen_noise", ",", "gen_label", "=", "self", ".", "g_model", ".", "input", "gen_output", "=", "self", ".", "g_model", ".", "output", "gan_output", "=", "sel...
define the combined generator and discriminator model, for updating the generator
[ "define", "the", "combined", "generator", "and", "discriminator", "model", "for", "updating", "the", "generator" ]
[ "\"\"\"define the combined generator and discriminator model, for updating the generator\"\"\"", "# make weights in the discriminator not trainable", "# get noise and label inputs from generator model", "# get image output from the generator model", "# connect image output and label input from generator as ...
[ { "param": "self", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
df4cf960f5cccdcad0be7331412c12f64dc1a259
FlipWebApps/computer-vision-playground
GAN/Architectures/models/conditional_gan.py
[ "MIT" ]
Python
generate_latent_points
<not_specific>
def generate_latent_points(self, n_samples): """generate points in latent space as input for the generator""" # generate points in the latent space latent_points = super().generate_latent_points(n_samples) # generate labels labels = np.random.randint(0, self.n_classes, n_samples)...
generate points in latent space as input for the generator
generate points in latent space as input for the generator
[ "generate", "points", "in", "latent", "space", "as", "input", "for", "the", "generator" ]
def generate_latent_points(self, n_samples): latent_points = super().generate_latent_points(n_samples) labels = np.random.randint(0, self.n_classes, n_samples) return [latent_points, labels]
[ "def", "generate_latent_points", "(", "self", ",", "n_samples", ")", ":", "latent_points", "=", "super", "(", ")", ".", "generate_latent_points", "(", "n_samples", ")", "labels", "=", "np", ".", "random", ".", "randint", "(", "0", ",", "self", ".", "n_clas...
generate points in latent space as input for the generator
[ "generate", "points", "in", "latent", "space", "as", "input", "for", "the", "generator" ]
[ "\"\"\"generate points in latent space as input for the generator\"\"\"", "# generate points in the latent space", "# generate labels" ]
[ { "param": "self", "type": null }, { "param": "n_samples", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "n_samples", "type": null, "docstring": null, "docstring_token...
df4cf960f5cccdcad0be7331412c12f64dc1a259
FlipWebApps/computer-vision-playground
GAN/Architectures/models/conditional_gan.py
[ "MIT" ]
Python
generate_generator_prediction_samples
<not_specific>
def generate_generator_prediction_samples(self, n_samples): """use the generator to generate n fake examples""" # generate points in latent space latent_points, labels = self.generate_latent_points(n_samples) # predict outputs X = self.generator_prediction(latent_points, labels) ...
use the generator to generate n fake examples
use the generator to generate n fake examples
[ "use", "the", "generator", "to", "generate", "n", "fake", "examples" ]
def generate_generator_prediction_samples(self, n_samples): latent_points, labels = self.generate_latent_points(n_samples) X = self.generator_prediction(latent_points, labels) y = np.zeros((n_samples, 1)) return [X, labels], y
[ "def", "generate_generator_prediction_samples", "(", "self", ",", "n_samples", ")", ":", "latent_points", ",", "labels", "=", "self", ".", "generate_latent_points", "(", "n_samples", ")", "X", "=", "self", ".", "generator_prediction", "(", "latent_points", ",", "l...
use the generator to generate n fake examples
[ "use", "the", "generator", "to", "generate", "n", "fake", "examples" ]
[ "\"\"\"use the generator to generate n fake examples\"\"\"", "# generate points in latent space", "# predict outputs", "# create class labels" ]
[ { "param": "self", "type": null }, { "param": "n_samples", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "n_samples", "type": null, "docstring": null, "docstring_token...
df4cf960f5cccdcad0be7331412c12f64dc1a259
FlipWebApps/computer-vision-playground
GAN/Architectures/models/conditional_gan.py
[ "MIT" ]
Python
plot_random_generated_images
null
def plot_random_generated_images(self): """create a plot of randomly generated images (reversed grayscale)""" dimensions=(10, 10) figsize=(10, 10) n_samples=100 (X, _), _ = self.generate_generator_prediction_samples(n_samples) self.grid_plot(X, dimen...
create a plot of randomly generated images (reversed grayscale)
create a plot of randomly generated images (reversed grayscale)
[ "create", "a", "plot", "of", "randomly", "generated", "images", "(", "reversed", "grayscale", ")" ]
def plot_random_generated_images(self): dimensions=(10, 10) figsize=(10, 10) n_samples=100 (X, _), _ = self.generate_generator_prediction_samples(n_samples) self.grid_plot(X, dimensions=dimensions, figsize=figsize)
[ "def", "plot_random_generated_images", "(", "self", ")", ":", "dimensions", "=", "(", "10", ",", "10", ")", "figsize", "=", "(", "10", ",", "10", ")", "n_samples", "=", "100", "(", "X", ",", "_", ")", ",", "_", "=", "self", ".", "generate_generator_p...
create a plot of randomly generated images (reversed grayscale)
[ "create", "a", "plot", "of", "randomly", "generated", "images", "(", "reversed", "grayscale", ")" ]
[ "\"\"\"create a plot of randomly generated images (reversed grayscale)\"\"\"" ]
[ { "param": "self", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
b4e6b70be289efaf4922d3a3c673fffe1f102298
FlipWebApps/computer-vision-playground
GAN/Architectures/models/infogan.py
[ "MIT" ]
Python
build_discriminator
null
def build_discriminator(self): """Override building of the discriminator. We add an auxilaty model q for predicting the value of the categorical variable. This isn't compiled as it is never used in a standalone manner, only as part of the final gan.""" # weight initialization ...
Override building of the discriminator. We add an auxilaty model q for predicting the value of the categorical variable. This isn't compiled as it is never used in a standalone manner, only as part of the final gan.
Override building of the discriminator. We add an auxilaty model q for predicting the value of the categorical variable. This isn't compiled as it is never used in a standalone manner, only as part of the final gan.
[ "Override", "building", "of", "the", "discriminator", ".", "We", "add", "an", "auxilaty", "model", "q", "for", "predicting", "the", "value", "of", "the", "categorical", "variable", ".", "This", "isn", "'", "t", "compiled", "as", "it", "is", "never", "used"...
def build_discriminator(self): init = RandomNormal(stddev=0.02) in_image = Input(shape=self.in_shape) d = Conv2D(64, (4,4), strides=(2,2), padding='same', kernel_initializer=init)(in_image) d = LeakyReLU(alpha=0.1)(d) d = Conv2D(128, (4,4), strides=(2,2), padding='same', kernel_i...
[ "def", "build_discriminator", "(", "self", ")", ":", "init", "=", "RandomNormal", "(", "stddev", "=", "0.02", ")", "in_image", "=", "Input", "(", "shape", "=", "self", ".", "in_shape", ")", "d", "=", "Conv2D", "(", "64", ",", "(", "4", ",", "4", ")...
Override building of the discriminator.
[ "Override", "building", "of", "the", "discriminator", "." ]
[ "\"\"\"Override building of the discriminator. \n \n We add an auxilaty model q for predicting the value of the categorical variable. This isn't\n compiled as it is never used in a standalone manner, only as part of the final gan.\"\"\"", "# weight initialization", "# image input", "# dow...
[ { "param": "self", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
b4e6b70be289efaf4922d3a3c673fffe1f102298
FlipWebApps/computer-vision-playground
GAN/Architectures/models/infogan.py
[ "MIT" ]
Python
build_generator
null
def build_generator(self): """Override building the standalone generator model. This will take latent space like a conditional gan and the n_cat control variables.""" gen_input_size = self.latent_dim + self.n_cat # weight initialization init = RandomNormal(stddev=0.02) ...
Override building the standalone generator model. This will take latent space like a conditional gan and the n_cat control variables.
Override building the standalone generator model. This will take latent space like a conditional gan and the n_cat control variables.
[ "Override", "building", "the", "standalone", "generator", "model", ".", "This", "will", "take", "latent", "space", "like", "a", "conditional", "gan", "and", "the", "n_cat", "control", "variables", "." ]
def build_generator(self): gen_input_size = self.latent_dim + self.n_cat init = RandomNormal(stddev=0.02) in_lat = Input(shape=(gen_input_size,)) n_nodes = 512 * 7 * 7 gen = Dense(n_nodes, kernel_initializer=init)(in_lat) gen = Activation('relu')(gen) gen = BatchN...
[ "def", "build_generator", "(", "self", ")", ":", "gen_input_size", "=", "self", ".", "latent_dim", "+", "self", ".", "n_cat", "init", "=", "RandomNormal", "(", "stddev", "=", "0.02", ")", "in_lat", "=", "Input", "(", "shape", "=", "(", "gen_input_size", ...
Override building the standalone generator model.
[ "Override", "building", "the", "standalone", "generator", "model", "." ]
[ "\"\"\"Override building the standalone generator model.\n \n This will take latent space like a conditional gan and the n_cat control variables.\"\"\"", "# weight initialization", "# image generator input", "# foundation for 7x7 image", "# normal", "# upsample to 14x14", "# upsample to 28...
[ { "param": "self", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
b4e6b70be289efaf4922d3a3c673fffe1f102298
FlipWebApps/computer-vision-playground
GAN/Architectures/models/infogan.py
[ "MIT" ]
Python
build_gan
null
def build_gan(self): """override defining of the combined generator and discriminator model, for updating the generator""" # make weights in the discriminator (some shared with the q model) as not trainable self.d_model.trainable = False # connect g outputs to d inputs d_output =...
override defining of the combined generator and discriminator model, for updating the generator
override defining of the combined generator and discriminator model, for updating the generator
[ "override", "defining", "of", "the", "combined", "generator", "and", "discriminator", "model", "for", "updating", "the", "generator" ]
def build_gan(self): self.d_model.trainable = False d_output = self.d_model(self.g_model.output) q_output = self.q_model(self.g_model.output) self.gan_model = Model(self.g_model.input, [d_output, q_output]) opt = Adam(lr=0.0002, beta_1=0.5) self.gan_model.compile(loss=['b...
[ "def", "build_gan", "(", "self", ")", ":", "self", ".", "d_model", ".", "trainable", "=", "False", "d_output", "=", "self", ".", "d_model", "(", "self", ".", "g_model", ".", "output", ")", "q_output", "=", "self", ".", "q_model", "(", "self", ".", "g...
override defining of the combined generator and discriminator model, for updating the generator
[ "override", "defining", "of", "the", "combined", "generator", "and", "discriminator", "model", "for", "updating", "the", "generator" ]
[ "\"\"\"override defining of the combined generator and discriminator model, for updating the generator\"\"\"", "# make weights in the discriminator (some shared with the q model) as not trainable", "# connect g outputs to d inputs", "# connect g outputs to q inputs", "# define composite model", "# compile...
[ { "param": "self", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
b4e6b70be289efaf4922d3a3c673fffe1f102298
FlipWebApps/computer-vision-playground
GAN/Architectures/models/infogan.py
[ "MIT" ]
Python
generate_latent_points
<not_specific>
def generate_latent_points(self, n_samples): """generate points in latent space as input for the generator. we concatonate with control codes""" # generate points in the latent space latent_points = super().generate_latent_points(n_samples) # reshape into a batch of inputs for the networ...
generate points in latent space as input for the generator. we concatonate with control codes
generate points in latent space as input for the generator. we concatonate with control codes
[ "generate", "points", "in", "latent", "space", "as", "input", "for", "the", "generator", ".", "we", "concatonate", "with", "control", "codes" ]
def generate_latent_points(self, n_samples): latent_points = super().generate_latent_points(n_samples) latent_points = latent_points.reshape(n_samples, self.latent_dim) cat_codes = np.random.randint(0, self.n_cat, n_samples) cat_codes = to_categorical(cat_codes, num_classes=self.n_cat) ...
[ "def", "generate_latent_points", "(", "self", ",", "n_samples", ")", ":", "latent_points", "=", "super", "(", ")", ".", "generate_latent_points", "(", "n_samples", ")", "latent_points", "=", "latent_points", ".", "reshape", "(", "n_samples", ",", "self", ".", ...
generate points in latent space as input for the generator.
[ "generate", "points", "in", "latent", "space", "as", "input", "for", "the", "generator", "." ]
[ "\"\"\"generate points in latent space as input for the generator. we concatonate with control codes\"\"\"", "# generate points in the latent space", "# reshape into a batch of inputs for the network", "# generate categorical codes", "# one hot encode", "# concatenate latent points and control codes" ]
[ { "param": "self", "type": null }, { "param": "n_samples", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "n_samples", "type": null, "docstring": null, "docstring_token...
b4e6b70be289efaf4922d3a3c673fffe1f102298
FlipWebApps/computer-vision-playground
GAN/Architectures/models/infogan.py
[ "MIT" ]
Python
generate_generator_prediction_samples
<not_specific>
def generate_generator_prediction_samples(self, n_samples): """use the generator to generate n fake examples""" # generate points in latent space and control codes z_input, _ = self.generate_latent_points(n_samples) # predict outputs images = self.generator_prediction(z_input) ...
use the generator to generate n fake examples
use the generator to generate n fake examples
[ "use", "the", "generator", "to", "generate", "n", "fake", "examples" ]
def generate_generator_prediction_samples(self, n_samples): z_input, _ = self.generate_latent_points(n_samples) images = self.generator_prediction(z_input) y = np.zeros((n_samples, 1)) return images, y
[ "def", "generate_generator_prediction_samples", "(", "self", ",", "n_samples", ")", ":", "z_input", ",", "_", "=", "self", ".", "generate_latent_points", "(", "n_samples", ")", "images", "=", "self", ".", "generator_prediction", "(", "z_input", ")", "y", "=", ...
use the generator to generate n fake examples
[ "use", "the", "generator", "to", "generate", "n", "fake", "examples" ]
[ "\"\"\"use the generator to generate n fake examples\"\"\"", "# generate points in latent space and control codes", "# predict outputs", "# create class labels" ]
[ { "param": "self", "type": null }, { "param": "n_samples", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "n_samples", "type": null, "docstring": null, "docstring_token...
6ed5a2da25606a1cc497ab5c389f215b512cff2a
FlipWebApps/computer-vision-playground
GAN/Architectures/models/gan.py
[ "MIT" ]
Python
plot_model
<not_specific>
def plot_model(model, filename=None): """Plot the specified model, either to file, or return as an SVG if no filename is specified""" if filename is None: return(SVG(model_to_dot(model, show_shapes=True, show_layer_names=True).create(prog='dot', format='svg'))) else: plot...
Plot the specified model, either to file, or return as an SVG if no filename is specified
Plot the specified model, either to file, or return as an SVG if no filename is specified
[ "Plot", "the", "specified", "model", "either", "to", "file", "or", "return", "as", "an", "SVG", "if", "no", "filename", "is", "specified" ]
def plot_model(model, filename=None): if filename is None: return(SVG(model_to_dot(model, show_shapes=True, show_layer_names=True).create(prog='dot', format='svg'))) else: plot_model(model, to_file=filename, show_shapes=True, show_layer_names=True)
[ "def", "plot_model", "(", "model", ",", "filename", "=", "None", ")", ":", "if", "filename", "is", "None", ":", "return", "(", "SVG", "(", "model_to_dot", "(", "model", ",", "show_shapes", "=", "True", ",", "show_layer_names", "=", "True", ")", ".", "c...
Plot the specified model, either to file, or return as an SVG if no filename is specified
[ "Plot", "the", "specified", "model", "either", "to", "file", "or", "return", "as", "an", "SVG", "if", "no", "filename", "is", "specified" ]
[ "\"\"\"Plot the specified model, either to file, or return as an SVG if no filename is specified\"\"\"" ]
[ { "param": "model", "type": null }, { "param": "filename", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "model", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "filename", "type": null, "docstring": null, "docstring_token...
6ed5a2da25606a1cc497ab5c389f215b512cff2a
FlipWebApps/computer-vision-playground
GAN/Architectures/models/gan.py
[ "MIT" ]
Python
generate_latent_points
<not_specific>
def generate_latent_points(self, n_samples): """generate points in latent space as input for the generator""" # generate points in the latent space latent_points = np.random.randn(self.latent_dim * n_samples) # reshape into a batch of inputs for the network latent_points = latent...
generate points in latent space as input for the generator
generate points in latent space as input for the generator
[ "generate", "points", "in", "latent", "space", "as", "input", "for", "the", "generator" ]
def generate_latent_points(self, n_samples): latent_points = np.random.randn(self.latent_dim * n_samples) latent_points = latent_points.reshape(n_samples, self.latent_dim) return latent_points
[ "def", "generate_latent_points", "(", "self", ",", "n_samples", ")", ":", "latent_points", "=", "np", ".", "random", ".", "randn", "(", "self", ".", "latent_dim", "*", "n_samples", ")", "latent_points", "=", "latent_points", ".", "reshape", "(", "n_samples", ...
generate points in latent space as input for the generator
[ "generate", "points", "in", "latent", "space", "as", "input", "for", "the", "generator" ]
[ "\"\"\"generate points in latent space as input for the generator\"\"\"", "# generate points in the latent space", "# reshape into a batch of inputs for the network" ]
[ { "param": "self", "type": null }, { "param": "n_samples", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "n_samples", "type": null, "docstring": null, "docstring_token...
6ed5a2da25606a1cc497ab5c389f215b512cff2a
FlipWebApps/computer-vision-playground
GAN/Architectures/models/gan.py
[ "MIT" ]
Python
generate_generator_prediction_samples
<not_specific>
def generate_generator_prediction_samples(self, n_samples): """use the generator to generate n fake examples""" # generate points in latent space latent_points = self.generate_latent_points(n_samples) # predict outputs X = self.generator_prediction(latent_points) # create...
use the generator to generate n fake examples
use the generator to generate n fake examples
[ "use", "the", "generator", "to", "generate", "n", "fake", "examples" ]
def generate_generator_prediction_samples(self, n_samples): latent_points = self.generate_latent_points(n_samples) X = self.generator_prediction(latent_points) y = np.zeros((n_samples, 1)) return X, y
[ "def", "generate_generator_prediction_samples", "(", "self", ",", "n_samples", ")", ":", "latent_points", "=", "self", ".", "generate_latent_points", "(", "n_samples", ")", "X", "=", "self", ".", "generator_prediction", "(", "latent_points", ")", "y", "=", "np", ...
use the generator to generate n fake examples
[ "use", "the", "generator", "to", "generate", "n", "fake", "examples" ]
[ "\"\"\"use the generator to generate n fake examples\"\"\"", "# generate points in latent space", "# predict outputs", "# create class labels" ]
[ { "param": "self", "type": null }, { "param": "n_samples", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "n_samples", "type": null, "docstring": null, "docstring_token...
6ed5a2da25606a1cc497ab5c389f215b512cff2a
FlipWebApps/computer-vision-playground
GAN/Architectures/models/gan.py
[ "MIT" ]
Python
summarize_performance
null
def summarize_performance(self, epoch, filename_base): """generate samples and save as a plot and save the model""" self.plot_random_generated_images() # save the plot filename1 = '{}_generated_plot_{:04d}.png'.format(filename_base, epoch) pyplot.savefig(filename1) ...
generate samples and save as a plot and save the model
generate samples and save as a plot and save the model
[ "generate", "samples", "and", "save", "as", "a", "plot", "and", "save", "the", "model" ]
def summarize_performance(self, epoch, filename_base): self.plot_random_generated_images() filename1 = '{}_generated_plot_{:04d}.png'.format(filename_base, epoch) pyplot.savefig(filename1) pyplot.close() filename2 = '{}_generator_model_{:04d}.h5'.format(filename_base, epoch) ...
[ "def", "summarize_performance", "(", "self", ",", "epoch", ",", "filename_base", ")", ":", "self", ".", "plot_random_generated_images", "(", ")", "filename1", "=", "'{}_generated_plot_{:04d}.png'", ".", "format", "(", "filename_base", ",", "epoch", ")", "pyplot", ...
generate samples and save as a plot and save the model
[ "generate", "samples", "and", "save", "as", "a", "plot", "and", "save", "the", "model" ]
[ "\"\"\"generate samples and save as a plot and save the model\"\"\"", "# save the plot", "# save the generator model" ]
[ { "param": "self", "type": null }, { "param": "epoch", "type": null }, { "param": "filename_base", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "epoch", "type": null, "docstring": null, "docstring_tokens": ...
6ed5a2da25606a1cc497ab5c389f215b512cff2a
FlipWebApps/computer-vision-playground
GAN/Architectures/models/gan.py
[ "MIT" ]
Python
grid_plot
null
def grid_plot(examples, dimensions=(10, 10), figsize=(10, 10), cmap='gray_r'): """create a grid plot of multiple images""" pyplot.figure(figsize=figsize) for i in range(dimensions[0] * dimensions[1]): pyplot.subplot(dimensions[0], dimensions[1], 1 + i) pyplot.axis('off') ...
create a grid plot of multiple images
create a grid plot of multiple images
[ "create", "a", "grid", "plot", "of", "multiple", "images" ]
def grid_plot(examples, dimensions=(10, 10), figsize=(10, 10), cmap='gray_r'): pyplot.figure(figsize=figsize) for i in range(dimensions[0] * dimensions[1]): pyplot.subplot(dimensions[0], dimensions[1], 1 + i) pyplot.axis('off') pyplot.imshow(np.squeeze(examples[i]), i...
[ "def", "grid_plot", "(", "examples", ",", "dimensions", "=", "(", "10", ",", "10", ")", ",", "figsize", "=", "(", "10", ",", "10", ")", ",", "cmap", "=", "'gray_r'", ")", ":", "pyplot", ".", "figure", "(", "figsize", "=", "figsize", ")", "for", "...
create a grid plot of multiple images
[ "create", "a", "grid", "plot", "of", "multiple", "images" ]
[ "\"\"\"create a grid plot of multiple images\"\"\"" ]
[ { "param": "examples", "type": null }, { "param": "dimensions", "type": null }, { "param": "figsize", "type": null }, { "param": "cmap", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "examples", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "dimensions", "type": null, "docstring": null, "docstring_...
6ed5a2da25606a1cc497ab5c389f215b512cff2a
FlipWebApps/computer-vision-playground
GAN/Architectures/models/gan.py
[ "MIT" ]
Python
plot_random_generated_images
null
def plot_random_generated_images(self): """create a plot of randomly generated images (reversed grayscale)""" dimensions=(10, 10) figsize=(10, 10) n_samples=100 X, _ = self.generate_generator_prediction_samples(n_samples) self.grid_plot(X, dimensions...
create a plot of randomly generated images (reversed grayscale)
create a plot of randomly generated images (reversed grayscale)
[ "create", "a", "plot", "of", "randomly", "generated", "images", "(", "reversed", "grayscale", ")" ]
def plot_random_generated_images(self): dimensions=(10, 10) figsize=(10, 10) n_samples=100 X, _ = self.generate_generator_prediction_samples(n_samples) self.grid_plot(X, dimensions=dimensions, figsize=figsize)
[ "def", "plot_random_generated_images", "(", "self", ")", ":", "dimensions", "=", "(", "10", ",", "10", ")", "figsize", "=", "(", "10", ",", "10", ")", "n_samples", "=", "100", "X", ",", "_", "=", "self", ".", "generate_generator_prediction_samples", "(", ...
create a plot of randomly generated images (reversed grayscale)
[ "create", "a", "plot", "of", "randomly", "generated", "images", "(", "reversed", "grayscale", ")" ]
[ "\"\"\"create a plot of randomly generated images (reversed grayscale)\"\"\"", "#filename = '%s_generated_plot_e%03d.png' % (identifier, epoch+1)", "#pyplot.savefig(filename)", "#pyplot.close()" ]
[ { "param": "self", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
994547c1e3e8f8a3e785cf22c54841d794cfa2df
thekitbag/todoodleoo-server
tests/functional/test_unhappy_path.py
[ "Apache-2.0" ]
Python
add_project_not_logged_in
null
def add_project_not_logged_in(test_client): """ GIVEN a non logged in user WHEN add project is called with valid data THEN a 401 is returned """ data = {'title': 'my new project'} r = test_client.post('/add_project', json=data) assert r.status_code == 401
GIVEN a non logged in user WHEN add project is called with valid data THEN a 401 is returned
GIVEN a non logged in user WHEN add project is called with valid data THEN a 401 is returned
[ "GIVEN", "a", "non", "logged", "in", "user", "WHEN", "add", "project", "is", "called", "with", "valid", "data", "THEN", "a", "401", "is", "returned" ]
def add_project_not_logged_in(test_client): data = {'title': 'my new project'} r = test_client.post('/add_project', json=data) assert r.status_code == 401
[ "def", "add_project_not_logged_in", "(", "test_client", ")", ":", "data", "=", "{", "'title'", ":", "'my new project'", "}", "r", "=", "test_client", ".", "post", "(", "'/add_project'", ",", "json", "=", "data", ")", "assert", "r", ".", "status_code", "==", ...
GIVEN a non logged in user WHEN add project is called with valid data THEN a 401 is returned
[ "GIVEN", "a", "non", "logged", "in", "user", "WHEN", "add", "project", "is", "called", "with", "valid", "data", "THEN", "a", "401", "is", "returned" ]
[ "\"\"\"\n\tGIVEN a non logged in user\n\tWHEN add project is called with valid data\n\tTHEN a 401 is returned\n\t\"\"\"" ]
[ { "param": "test_client", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "test_client", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
207b87e5200b38f391d099f59e090a66256c872d
thekitbag/todoodleoo-server
webapp/models.py
[ "Apache-2.0" ]
Python
delete
null
def delete(self): """deletes the timebox and returns all not done tasks to the backlog""" backlog = db.session.query(Timebox).filter(Timebox.title=='Backlog').filter(Timebox.project_id==self.project_id).first() for task in self.tasks.all(): if task.status != 'Done': ...
deletes the timebox and returns all not done tasks to the backlog
deletes the timebox and returns all not done tasks to the backlog
[ "deletes", "the", "timebox", "and", "returns", "all", "not", "done", "tasks", "to", "the", "backlog" ]
def delete(self): backlog = db.session.query(Timebox).filter(Timebox.title=='Backlog').filter(Timebox.project_id==self.project_id).first() for task in self.tasks.all(): if task.status != 'Done': task.add_to_timebox(backlog) db.session.delete(self) db.session.c...
[ "def", "delete", "(", "self", ")", ":", "backlog", "=", "db", ".", "session", ".", "query", "(", "Timebox", ")", ".", "filter", "(", "Timebox", ".", "title", "==", "'Backlog'", ")", ".", "filter", "(", "Timebox", ".", "project_id", "==", "self", ".",...
deletes the timebox and returns all not done tasks to the backlog
[ "deletes", "the", "timebox", "and", "returns", "all", "not", "done", "tasks", "to", "the", "backlog" ]
[ "\"\"\"deletes the timebox and returns all not done tasks\n to the backlog\"\"\"" ]
[ { "param": "self", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
207b87e5200b38f391d099f59e090a66256c872d
thekitbag/todoodleoo-server
webapp/models.py
[ "Apache-2.0" ]
Python
change_status
null
def change_status(self, target_status): """ changes the timebox to the desired status if the target status is Done then all non-done tasks in the timebox will be returned to the Backlog """ backlog = db.session.query(Timebox).filter(Timebox.title=='Backlog').filter(Timebo...
changes the timebox to the desired status if the target status is Done then all non-done tasks in the timebox will be returned to the Backlog
changes the timebox to the desired status if the target status is Done then all non-done tasks in the timebox will be returned to the Backlog
[ "changes", "the", "timebox", "to", "the", "desired", "status", "if", "the", "target", "status", "is", "Done", "then", "all", "non", "-", "done", "tasks", "in", "the", "timebox", "will", "be", "returned", "to", "the", "Backlog" ]
def change_status(self, target_status): backlog = db.session.query(Timebox).filter(Timebox.title=='Backlog').filter(Timebox.project_id==self.project_id).first() for task in self.tasks.all(): if task.status != 'Done': task.add_to_timebox(backlog) self.status = target_s...
[ "def", "change_status", "(", "self", ",", "target_status", ")", ":", "backlog", "=", "db", ".", "session", ".", "query", "(", "Timebox", ")", ".", "filter", "(", "Timebox", ".", "title", "==", "'Backlog'", ")", ".", "filter", "(", "Timebox", ".", "proj...
changes the timebox to the desired status if the target status is Done then all non-done tasks in the timebox will be returned to the Backlog
[ "changes", "the", "timebox", "to", "the", "desired", "status", "if", "the", "target", "status", "is", "Done", "then", "all", "non", "-", "done", "tasks", "in", "the", "timebox", "will", "be", "returned", "to", "the", "Backlog" ]
[ "\"\"\"\n changes the timebox to the desired status\n if the target status is Done then all non-done tasks in the timebox\n will be returned to the Backlog\n \"\"\"" ]
[ { "param": "self", "type": null }, { "param": "target_status", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "target_status", "type": null, "docstring": null, "docstring_t...
9f4b3aceae2fa0703046c4c88204048e15a0a77b
gitCyan/uvm-python
src/uvm/base/uvm_queue.py
[ "Apache-2.0" ]
Python
insert
<not_specific>
def insert(self, index, item): """ Function: insert Inserts the item at the given `index` in the queue. Args: index: item: """ if index >= self.size() or index < 0: uvm_report_warning("QUEUEINS", "insert: given index {}...
Function: insert Inserts the item at the given `index` in the queue. Args: index: item:
insert Inserts the item at the given `index` in the queue.
[ "insert", "Inserts", "the", "item", "at", "the", "given", "`", "index", "`", "in", "the", "queue", "." ]
def insert(self, index, item): if index >= self.size() or index < 0: uvm_report_warning("QUEUEINS", "insert: given index {} out of range for queue of size {}. Ignoring insert request" .format(index, self.size())) return self.queue.insert(index,item...
[ "def", "insert", "(", "self", ",", "index", ",", "item", ")", ":", "if", "index", ">=", "self", ".", "size", "(", ")", "or", "index", "<", "0", ":", "uvm_report_warning", "(", "\"QUEUEINS\"", ",", "\"insert: given index {} out of range for queue of size {}. Igno...
Function: insert Inserts the item at the given `index` in the queue.
[ "Function", ":", "insert", "Inserts", "the", "item", "at", "the", "given", "`", "index", "`", "in", "the", "queue", "." ]
[ "\"\"\"\n Function: insert\n\n Inserts the item at the given `index` in the queue.\n Args:\n index:\n item:\n \"\"\"" ]
[ { "param": "self", "type": null }, { "param": "index", "type": null }, { "param": "item", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "index", "type": null, "docstring": null, "docstring_tokens": ...
9f4b3aceae2fa0703046c4c88204048e15a0a77b
gitCyan/uvm-python
src/uvm/base/uvm_queue.py
[ "Apache-2.0" ]
Python
delete
<not_specific>
def delete(self, index=-1): """ Function: delete Removes the item at the given `index` from the queue; if `index` is not provided, the entire contents of the queue are deleted. Args: index: """ if index >= self.size() or index < -1: uvm_re...
Function: delete Removes the item at the given `index` from the queue; if `index` is not provided, the entire contents of the queue are deleted. Args: index:
delete Removes the item at the given `index` from the queue; if `index` is not provided, the entire contents of the queue are deleted.
[ "delete", "Removes", "the", "item", "at", "the", "given", "`", "index", "`", "from", "the", "queue", ";", "if", "`", "index", "`", "is", "not", "provided", "the", "entire", "contents", "of", "the", "queue", "are", "deleted", "." ]
def delete(self, index=-1): if index >= self.size() or index < -1: uvm_report_warning("QUEUEDEL", "delete: given index out of range for queue of size {}. Ignoring delete request" .format(self.size())) return if index == -1: self.queue =...
[ "def", "delete", "(", "self", ",", "index", "=", "-", "1", ")", ":", "if", "index", ">=", "self", ".", "size", "(", ")", "or", "index", "<", "-", "1", ":", "uvm_report_warning", "(", "\"QUEUEDEL\"", ",", "\"delete: given index out of range for queue of size ...
Function: delete Removes the item at the given `index` from the queue; if `index` is not provided, the entire contents of the queue are deleted.
[ "Function", ":", "delete", "Removes", "the", "item", "at", "the", "given", "`", "index", "`", "from", "the", "queue", ";", "if", "`", "index", "`", "is", "not", "provided", "the", "entire", "contents", "of", "the", "queue", "are", "deleted", "." ]
[ "\"\"\"\n Function: delete\n\n Removes the item at the given `index` from the queue; if `index` is\n not provided, the entire contents of the queue are deleted.\n Args:\n index:\n \"\"\"" ]
[ { "param": "self", "type": null }, { "param": "index", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "index", "type": null, "docstring": null, "docstring_tokens": ...
9f4b3aceae2fa0703046c4c88204048e15a0a77b
gitCyan/uvm-python
src/uvm/base/uvm_queue.py
[ "Apache-2.0" ]
Python
push_front
null
def push_front(self, item): """ Function: push_front Inserts the given `item` at the front of the queue. Args: item: """ self.queue.insert(0, item)
Function: push_front Inserts the given `item` at the front of the queue. Args: item:
push_front Inserts the given `item` at the front of the queue.
[ "push_front", "Inserts", "the", "given", "`", "item", "`", "at", "the", "front", "of", "the", "queue", "." ]
def push_front(self, item): self.queue.insert(0, item)
[ "def", "push_front", "(", "self", ",", "item", ")", ":", "self", ".", "queue", ".", "insert", "(", "0", ",", "item", ")" ]
Function: push_front Inserts the given `item` at the front of the queue.
[ "Function", ":", "push_front", "Inserts", "the", "given", "`", "item", "`", "at", "the", "front", "of", "the", "queue", "." ]
[ "\"\"\"\n Function: push_front\n\n Inserts the given `item` at the front of the queue.\n Args:\n item:\n \"\"\"" ]
[ { "param": "self", "type": null }, { "param": "item", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "item", "type": null, "docstring": null, "docstring_tokens": [...
9f4b3aceae2fa0703046c4c88204048e15a0a77b
gitCyan/uvm-python
src/uvm/base/uvm_queue.py
[ "Apache-2.0" ]
Python
push_back
null
def push_back(self, item): """ Function: push_back Inserts the given `item` at the back of the queue. Args: item: """ self.queue.append(item)
Function: push_back Inserts the given `item` at the back of the queue. Args: item:
push_back Inserts the given `item` at the back of the queue.
[ "push_back", "Inserts", "the", "given", "`", "item", "`", "at", "the", "back", "of", "the", "queue", "." ]
def push_back(self, item): self.queue.append(item)
[ "def", "push_back", "(", "self", ",", "item", ")", ":", "self", ".", "queue", ".", "append", "(", "item", ")" ]
Function: push_back Inserts the given `item` at the back of the queue.
[ "Function", ":", "push_back", "Inserts", "the", "given", "`", "item", "`", "at", "the", "back", "of", "the", "queue", "." ]
[ "\"\"\"\n Function: push_back\n\n Inserts the given `item` at the back of the queue.\n Args:\n item:\n \"\"\"" ]
[ { "param": "self", "type": null }, { "param": "item", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "item", "type": null, "docstring": null, "docstring_tokens": [...
9f4b3aceae2fa0703046c4c88204048e15a0a77b
gitCyan/uvm-python
src/uvm/base/uvm_queue.py
[ "Apache-2.0" ]
Python
find_with
<not_specific>
def find_with(self, find_func): """ Group: find functions Added by tpoikela to mimic SystemVerilog find API Args: find_func: Returns: """ qq = UVMQueue() for ee in self.queue: if find_func(ee): qq.push_back(ee) ...
Group: find functions Added by tpoikela to mimic SystemVerilog find API Args: find_func: Returns:
find functions Added by tpoikela to mimic SystemVerilog find API
[ "find", "functions", "Added", "by", "tpoikela", "to", "mimic", "SystemVerilog", "find", "API" ]
def find_with(self, find_func): qq = UVMQueue() for ee in self.queue: if find_func(ee): qq.push_back(ee) return qq
[ "def", "find_with", "(", "self", ",", "find_func", ")", ":", "qq", "=", "UVMQueue", "(", ")", "for", "ee", "in", "self", ".", "queue", ":", "if", "find_func", "(", "ee", ")", ":", "qq", ".", "push_back", "(", "ee", ")", "return", "qq" ]
Group: find functions Added by tpoikela to mimic SystemVerilog find API
[ "Group", ":", "find", "functions", "Added", "by", "tpoikela", "to", "mimic", "SystemVerilog", "find", "API" ]
[ "\"\"\"\n Group: find functions\n Added by tpoikela to mimic SystemVerilog find API\n Args:\n find_func:\n Returns:\n \"\"\"" ]
[ { "param": "self", "type": null }, { "param": "find_func", "type": null } ]
{ "returns": [ { "docstring": null, "docstring_tokens": [ "None" ], "type": null } ], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null ...
10139ae4599ac3780de1be6d0b378be4f77ebc3a
mqtlam/dcgan-tfslim
image_ops.py
[ "MIT" ]
Python
save_image
null
def save_image(image, image_path): """Save an image. Postconditions: saves to image file Args: images: one image image_path: path to save image """ # transform back from [-1,1] to [0,1] img = (image+1.)/2. # save image im = Image.fromarray(np.uint8(img*255)) ...
Save an image. Postconditions: saves to image file Args: images: one image image_path: path to save image
Save an image. Postconditions: saves to image file
[ "Save", "an", "image", ".", "Postconditions", ":", "saves", "to", "image", "file" ]
def save_image(image, image_path): img = (image+1.)/2. im = Image.fromarray(np.uint8(img*255)) im.save(image_path)
[ "def", "save_image", "(", "image", ",", "image_path", ")", ":", "img", "=", "(", "image", "+", "1.", ")", "/", "2.", "im", "=", "Image", ".", "fromarray", "(", "np", ".", "uint8", "(", "img", "*", "255", ")", ")", "im", ".", "save", "(", "image...
Save an image.
[ "Save", "an", "image", "." ]
[ "\"\"\"Save an image.\n\n Postconditions:\n saves to image file\n\n Args:\n images: one image\n image_path: path to save image\n \"\"\"", "# transform back from [-1,1] to [0,1]", "# save image" ]
[ { "param": "image", "type": null }, { "param": "image_path", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "image", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "image_path", "type": null, "docstring": "path to save image", ...
10139ae4599ac3780de1be6d0b378be4f77ebc3a
mqtlam/dcgan-tfslim
image_ops.py
[ "MIT" ]
Python
save_images
null
def save_images(images, image_path): """Save images. Postconditions: saves to image file Args: images: list of images image_path: path to save image """ # transform back from [-1,1] to [0,1] images = (images+1.)/2. # determine tiled image shape num_cols = int(c...
Save images. Postconditions: saves to image file Args: images: list of images image_path: path to save image
Save images. Postconditions: saves to image file
[ "Save", "images", ".", "Postconditions", ":", "saves", "to", "image", "file" ]
def save_images(images, image_path): images = (images+1.)/2. num_cols = int(ceil(sqrt(len(images)))) num_rows = int(ceil(1.*len(images)/num_cols)) h, w = images.shape[1], images.shape[2] img = np.zeros((h * num_rows, w * num_cols, 3)) for i, image in enumerate(images): c = i % num_cols ...
[ "def", "save_images", "(", "images", ",", "image_path", ")", ":", "images", "=", "(", "images", "+", "1.", ")", "/", "2.", "num_cols", "=", "int", "(", "ceil", "(", "sqrt", "(", "len", "(", "images", ")", ")", ")", ")", "num_rows", "=", "int", "(...
Save images.
[ "Save", "images", "." ]
[ "\"\"\"Save images.\n\n Postconditions:\n saves to image file\n\n Args:\n images: list of images\n image_path: path to save image\n \"\"\"", "# transform back from [-1,1] to [0,1]", "# determine tiled image shape", "# create new tiled image", "# save image" ]
[ { "param": "images", "type": null }, { "param": "image_path", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "images", "type": null, "docstring": "list of images", "docstring_tokens": [ "list", "of", "images" ], "default": null, "is_optional": null }, { "identifier": "image_path"...