id
int32
0
252k
repo
stringlengths
7
55
path
stringlengths
4
127
func_name
stringlengths
1
88
original_string
stringlengths
75
19.8k
language
stringclasses
1 value
code
stringlengths
75
19.8k
code_tokens
list
docstring
stringlengths
3
17.3k
docstring_tokens
list
sha
stringlengths
40
40
url
stringlengths
87
242
238,100
JukeboxPipeline/jukebox-core
src/jukeboxcore/reftrack.py
Reftrack.reference
def reference(self, taskfileinfo): """Reference the entity into the scene. Only possible if the current status is None. This will create a new refobject, then call :meth:`RefobjInterface.reference` and afterwards set the refobj on the :class:`Reftrack` instance. :param taskfileinfo: th...
python
def reference(self, taskfileinfo): """Reference the entity into the scene. Only possible if the current status is None. This will create a new refobject, then call :meth:`RefobjInterface.reference` and afterwards set the refobj on the :class:`Reftrack` instance. :param taskfileinfo: th...
[ "def", "reference", "(", "self", ",", "taskfileinfo", ")", ":", "assert", "self", ".", "status", "(", ")", "is", "None", ",", "\"Can only reference, if the entity is not already referenced/imported. Use replace instead.\"", "refobj", "=", "self", ".", "create_refobject", ...
Reference the entity into the scene. Only possible if the current status is None. This will create a new refobject, then call :meth:`RefobjInterface.reference` and afterwards set the refobj on the :class:`Reftrack` instance. :param taskfileinfo: the taskfileinfo to reference :type task...
[ "Reference", "the", "entity", "into", "the", "scene", ".", "Only", "possible", "if", "the", "current", "status", "is", "None", "." ]
bac2280ca49940355270e4b69400ce9976ab2e6f
https://github.com/JukeboxPipeline/jukebox-core/blob/bac2280ca49940355270e4b69400ce9976ab2e6f/src/jukeboxcore/reftrack.py#L1116-L1136
238,101
JukeboxPipeline/jukebox-core
src/jukeboxcore/reftrack.py
Reftrack.load
def load(self, ): """If the reference is in the scene but unloaded, load it. .. Note:: Do not confuse this with reference or import. Load means that it is already referenced. But the data from the reference was not read until now. Load loads the data from the reference. This ...
python
def load(self, ): """If the reference is in the scene but unloaded, load it. .. Note:: Do not confuse this with reference or import. Load means that it is already referenced. But the data from the reference was not read until now. Load loads the data from the reference. This ...
[ "def", "load", "(", "self", ",", ")", ":", "assert", "self", ".", "status", "(", ")", "==", "self", ".", "UNLOADED", ",", "\"Cannot load if there is no unloaded reference. Use reference instead.\"", "self", ".", "get_refobjinter", "(", ")", ".", "load", "(", "se...
If the reference is in the scene but unloaded, load it. .. Note:: Do not confuse this with reference or import. Load means that it is already referenced. But the data from the reference was not read until now. Load loads the data from the reference. This will call :meth:`RefobjInterf...
[ "If", "the", "reference", "is", "in", "the", "scene", "but", "unloaded", "load", "it", "." ]
bac2280ca49940355270e4b69400ce9976ab2e6f
https://github.com/JukeboxPipeline/jukebox-core/blob/bac2280ca49940355270e4b69400ce9976ab2e6f/src/jukeboxcore/reftrack.py#L1139-L1157
238,102
JukeboxPipeline/jukebox-core
src/jukeboxcore/reftrack.py
Reftrack.unload
def unload(self, ): """If the reference is loaded, unload it. .. Note:: Do not confuse this with a delete. This means, that the reference stays in the scene, but no data is read from the reference. This will call :meth:`RefobjInterface.unload` and set the status to :data:`Ref...
python
def unload(self, ): """If the reference is loaded, unload it. .. Note:: Do not confuse this with a delete. This means, that the reference stays in the scene, but no data is read from the reference. This will call :meth:`RefobjInterface.unload` and set the status to :data:`Ref...
[ "def", "unload", "(", "self", ",", ")", ":", "assert", "self", ".", "status", "(", ")", "==", "self", ".", "LOADED", ",", "\"Cannot unload if there is no loaded reference. \\\nUse delete if you want to get rid of a reference or import.\"", "childrentodelete", "=", "self", ...
If the reference is loaded, unload it. .. Note:: Do not confuse this with a delete. This means, that the reference stays in the scene, but no data is read from the reference. This will call :meth:`RefobjInterface.unload` and set the status to :data:`Reftrack.UNLOADED`. It wil...
[ "If", "the", "reference", "is", "loaded", "unload", "it", "." ]
bac2280ca49940355270e4b69400ce9976ab2e6f
https://github.com/JukeboxPipeline/jukebox-core/blob/bac2280ca49940355270e4b69400ce9976ab2e6f/src/jukeboxcore/reftrack.py#L1160-L1190
238,103
JukeboxPipeline/jukebox-core
src/jukeboxcore/reftrack.py
Reftrack.import_file
def import_file(self, taskfileinfo): """Import the file for the given taskfileinfo This will also update the status to :data:`Reftrack.IMPORTED`. This will also call :meth:`fetch_new_children`. Because after the import, we might have new children. :param taskfileinfo: the taskfileinfo ...
python
def import_file(self, taskfileinfo): """Import the file for the given taskfileinfo This will also update the status to :data:`Reftrack.IMPORTED`. This will also call :meth:`fetch_new_children`. Because after the import, we might have new children. :param taskfileinfo: the taskfileinfo ...
[ "def", "import_file", "(", "self", ",", "taskfileinfo", ")", ":", "assert", "self", ".", "status", "(", ")", "is", "None", ",", "\"Entity is already in scene. Use replace instead.\"", "refobjinter", "=", "self", ".", "get_refobjinter", "(", ")", "refobj", "=", "...
Import the file for the given taskfileinfo This will also update the status to :data:`Reftrack.IMPORTED`. This will also call :meth:`fetch_new_children`. Because after the import, we might have new children. :param taskfileinfo: the taskfileinfo to import. If None is given, try to import ...
[ "Import", "the", "file", "for", "the", "given", "taskfileinfo" ]
bac2280ca49940355270e4b69400ce9976ab2e6f
https://github.com/JukeboxPipeline/jukebox-core/blob/bac2280ca49940355270e4b69400ce9976ab2e6f/src/jukeboxcore/reftrack.py#L1193-L1216
238,104
JukeboxPipeline/jukebox-core
src/jukeboxcore/reftrack.py
Reftrack.import_reference
def import_reference(self, ): """Import the currently loaded reference This will also update the status to :data:`Reftrack.IMPORTED`. :returns: None :rtype: None :raises: :class:`ReftrackIntegrityError` """ assert self.status() in (self.LOADED, self.UNLOADED),\ ...
python
def import_reference(self, ): """Import the currently loaded reference This will also update the status to :data:`Reftrack.IMPORTED`. :returns: None :rtype: None :raises: :class:`ReftrackIntegrityError` """ assert self.status() in (self.LOADED, self.UNLOADED),\ ...
[ "def", "import_reference", "(", "self", ",", ")", ":", "assert", "self", ".", "status", "(", ")", "in", "(", "self", ".", "LOADED", ",", "self", ".", "UNLOADED", ")", ",", "\"There is no reference for this entity.\"", "refobjinter", "=", "self", ".", "get_re...
Import the currently loaded reference This will also update the status to :data:`Reftrack.IMPORTED`. :returns: None :rtype: None :raises: :class:`ReftrackIntegrityError`
[ "Import", "the", "currently", "loaded", "reference" ]
bac2280ca49940355270e4b69400ce9976ab2e6f
https://github.com/JukeboxPipeline/jukebox-core/blob/bac2280ca49940355270e4b69400ce9976ab2e6f/src/jukeboxcore/reftrack.py#L1219-L1236
238,105
JukeboxPipeline/jukebox-core
src/jukeboxcore/reftrack.py
Reftrack.replace
def replace(self, taskfileinfo): """Replace the current reference or imported entity. If the given refobj is not replaceable, e.g. it might be imported or it is not possible to switch the data, then the entity will be deleted, then referenced or imported again, depending on the current ...
python
def replace(self, taskfileinfo): """Replace the current reference or imported entity. If the given refobj is not replaceable, e.g. it might be imported or it is not possible to switch the data, then the entity will be deleted, then referenced or imported again, depending on the current ...
[ "def", "replace", "(", "self", ",", "taskfileinfo", ")", ":", "assert", "self", ".", "status", "(", ")", "is", "not", "None", ",", "\"Can only replace entities that are already in the scene.\"", "refobjinter", "=", "self", ".", "get_refobjinter", "(", ")", "refobj...
Replace the current reference or imported entity. If the given refobj is not replaceable, e.g. it might be imported or it is not possible to switch the data, then the entity will be deleted, then referenced or imported again, depending on the current status. A replaced entity might hav...
[ "Replace", "the", "current", "reference", "or", "imported", "entity", "." ]
bac2280ca49940355270e4b69400ce9976ab2e6f
https://github.com/JukeboxPipeline/jukebox-core/blob/bac2280ca49940355270e4b69400ce9976ab2e6f/src/jukeboxcore/reftrack.py#L1239-L1299
238,106
JukeboxPipeline/jukebox-core
src/jukeboxcore/reftrack.py
Reftrack._delete
def _delete(self, ): """Internal implementation for deleting a reftrack. This will just delete the reftrack, set the children to None, update the status, and the rootobject. If the object is an alien, it will also set the parent to None, so it dissapears from the model. :return...
python
def _delete(self, ): """Internal implementation for deleting a reftrack. This will just delete the reftrack, set the children to None, update the status, and the rootobject. If the object is an alien, it will also set the parent to None, so it dissapears from the model. :return...
[ "def", "_delete", "(", "self", ",", ")", ":", "refobjinter", "=", "self", ".", "get_refobjinter", "(", ")", "refobjinter", ".", "delete", "(", "self", ".", "get_refobj", "(", ")", ")", "self", ".", "set_refobj", "(", "None", ",", "setParent", "=", "Fal...
Internal implementation for deleting a reftrack. This will just delete the reftrack, set the children to None, update the status, and the rootobject. If the object is an alien, it will also set the parent to None, so it dissapears from the model. :returns: None :rtype: None ...
[ "Internal", "implementation", "for", "deleting", "a", "reftrack", "." ]
bac2280ca49940355270e4b69400ce9976ab2e6f
https://github.com/JukeboxPipeline/jukebox-core/blob/bac2280ca49940355270e4b69400ce9976ab2e6f/src/jukeboxcore/reftrack.py#L1338-L1367
238,107
JukeboxPipeline/jukebox-core
src/jukeboxcore/reftrack.py
Reftrack.get_all_children
def get_all_children(self): """Get all children including children of children :returns: all children including children of children :rtype: list of :class:`Reftrack` :raises: None """ children = self._children[:] oldlen = 0 newlen = len(children) ...
python
def get_all_children(self): """Get all children including children of children :returns: all children including children of children :rtype: list of :class:`Reftrack` :raises: None """ children = self._children[:] oldlen = 0 newlen = len(children) ...
[ "def", "get_all_children", "(", "self", ")", ":", "children", "=", "self", ".", "_children", "[", ":", "]", "oldlen", "=", "0", "newlen", "=", "len", "(", "children", ")", "while", "oldlen", "!=", "newlen", ":", "start", "=", "oldlen", "oldlen", "=", ...
Get all children including children of children :returns: all children including children of children :rtype: list of :class:`Reftrack` :raises: None
[ "Get", "all", "children", "including", "children", "of", "children" ]
bac2280ca49940355270e4b69400ce9976ab2e6f
https://github.com/JukeboxPipeline/jukebox-core/blob/bac2280ca49940355270e4b69400ce9976ab2e6f/src/jukeboxcore/reftrack.py#L1383-L1399
238,108
JukeboxPipeline/jukebox-core
src/jukeboxcore/reftrack.py
Reftrack.get_children_to_delete
def get_children_to_delete(self): """Return all children that are not referenced :returns: list or :class:`Reftrack` :rtype: list :raises: None """ refobjinter = self.get_refobjinter() children = self.get_all_children() todelete = [] for c in chi...
python
def get_children_to_delete(self): """Return all children that are not referenced :returns: list or :class:`Reftrack` :rtype: list :raises: None """ refobjinter = self.get_refobjinter() children = self.get_all_children() todelete = [] for c in chi...
[ "def", "get_children_to_delete", "(", "self", ")", ":", "refobjinter", "=", "self", ".", "get_refobjinter", "(", ")", "children", "=", "self", ".", "get_all_children", "(", ")", "todelete", "=", "[", "]", "for", "c", "in", "children", ":", "if", "c", "."...
Return all children that are not referenced :returns: list or :class:`Reftrack` :rtype: list :raises: None
[ "Return", "all", "children", "that", "are", "not", "referenced" ]
bac2280ca49940355270e4b69400ce9976ab2e6f
https://github.com/JukeboxPipeline/jukebox-core/blob/bac2280ca49940355270e4b69400ce9976ab2e6f/src/jukeboxcore/reftrack.py#L1401-L1435
238,109
JukeboxPipeline/jukebox-core
src/jukeboxcore/reftrack.py
Reftrack.fetch_new_children
def fetch_new_children(self, ): """Collect all new children and add the suggestions to the children as well When an entity is loaded, referenced, imported etc there might be new children. Also it might want to suggest children itself, like a Shader for an asset. First we wrap all unwra...
python
def fetch_new_children(self, ): """Collect all new children and add the suggestions to the children as well When an entity is loaded, referenced, imported etc there might be new children. Also it might want to suggest children itself, like a Shader for an asset. First we wrap all unwra...
[ "def", "fetch_new_children", "(", "self", ",", ")", ":", "root", "=", "self", ".", "get_root", "(", ")", "refobjinter", "=", "self", ".", "get_refobjinter", "(", ")", "unwrapped", "=", "self", ".", "get_unwrapped", "(", "root", ",", "refobjinter", ")", "...
Collect all new children and add the suggestions to the children as well When an entity is loaded, referenced, imported etc there might be new children. Also it might want to suggest children itself, like a Shader for an asset. First we wrap all unwrapped children. See: :meth:`Reftrack.get_unw...
[ "Collect", "all", "new", "children", "and", "add", "the", "suggestions", "to", "the", "children", "as", "well" ]
bac2280ca49940355270e4b69400ce9976ab2e6f
https://github.com/JukeboxPipeline/jukebox-core/blob/bac2280ca49940355270e4b69400ce9976ab2e6f/src/jukeboxcore/reftrack.py#L1459-L1485
238,110
JukeboxPipeline/jukebox-core
src/jukeboxcore/reftrack.py
Reftrack.set_parent_on_new
def set_parent_on_new(self, parentrefobj): """Contextmanager that on close will get all new unwrapped refobjects, and for every refobject with no parent sets is to the given one. :returns: None :rtype: None :raises: None """ refobjinter = self.get_refobji...
python
def set_parent_on_new(self, parentrefobj): """Contextmanager that on close will get all new unwrapped refobjects, and for every refobject with no parent sets is to the given one. :returns: None :rtype: None :raises: None """ refobjinter = self.get_refobji...
[ "def", "set_parent_on_new", "(", "self", ",", "parentrefobj", ")", ":", "refobjinter", "=", "self", ".", "get_refobjinter", "(", ")", "# to make sure we only get the new one", "# we get all current unwrapped first", "old", "=", "self", ".", "get_unwrapped", "(", "self",...
Contextmanager that on close will get all new unwrapped refobjects, and for every refobject with no parent sets is to the given one. :returns: None :rtype: None :raises: None
[ "Contextmanager", "that", "on", "close", "will", "get", "all", "new", "unwrapped", "refobjects", "and", "for", "every", "refobject", "with", "no", "parent", "sets", "is", "to", "the", "given", "one", "." ]
bac2280ca49940355270e4b69400ce9976ab2e6f
https://github.com/JukeboxPipeline/jukebox-core/blob/bac2280ca49940355270e4b69400ce9976ab2e6f/src/jukeboxcore/reftrack.py#L1506-L1523
238,111
JukeboxPipeline/jukebox-core
src/jukeboxcore/reftrack.py
Reftrack.set_restricted
def set_restricted(self, obj, restricted): """Set the restriction on the given object. You can use this to signal that a certain function is restricted. Then you can query the restriction later with :meth:`Reftrack.is_restricted`. :param obj: a hashable object :param restricted...
python
def set_restricted(self, obj, restricted): """Set the restriction on the given object. You can use this to signal that a certain function is restricted. Then you can query the restriction later with :meth:`Reftrack.is_restricted`. :param obj: a hashable object :param restricted...
[ "def", "set_restricted", "(", "self", ",", "obj", ",", "restricted", ")", ":", "if", "restricted", ":", "self", ".", "_restricted", ".", "add", "(", "obj", ")", "elif", "obj", "in", "self", ".", "_restricted", ":", "self", ".", "_restricted", ".", "rem...
Set the restriction on the given object. You can use this to signal that a certain function is restricted. Then you can query the restriction later with :meth:`Reftrack.is_restricted`. :param obj: a hashable object :param restricted: True, if you want to restrict the object. :t...
[ "Set", "the", "restriction", "on", "the", "given", "object", "." ]
bac2280ca49940355270e4b69400ce9976ab2e6f
https://github.com/JukeboxPipeline/jukebox-core/blob/bac2280ca49940355270e4b69400ce9976ab2e6f/src/jukeboxcore/reftrack.py#L1537-L1553
238,112
JukeboxPipeline/jukebox-core
src/jukeboxcore/reftrack.py
Reftrack.fetch_reference_restriction
def fetch_reference_restriction(self, ): """Fetch whether referencing is restricted :returns: True, if referencing is restricted :rtype: :class:`bool` :raises: None """ inter = self.get_refobjinter() restricted = self.status() is not None return restricte...
python
def fetch_reference_restriction(self, ): """Fetch whether referencing is restricted :returns: True, if referencing is restricted :rtype: :class:`bool` :raises: None """ inter = self.get_refobjinter() restricted = self.status() is not None return restricte...
[ "def", "fetch_reference_restriction", "(", "self", ",", ")", ":", "inter", "=", "self", ".", "get_refobjinter", "(", ")", "restricted", "=", "self", ".", "status", "(", ")", "is", "not", "None", "return", "restricted", "or", "inter", ".", "fetch_action_restr...
Fetch whether referencing is restricted :returns: True, if referencing is restricted :rtype: :class:`bool` :raises: None
[ "Fetch", "whether", "referencing", "is", "restricted" ]
bac2280ca49940355270e4b69400ce9976ab2e6f
https://github.com/JukeboxPipeline/jukebox-core/blob/bac2280ca49940355270e4b69400ce9976ab2e6f/src/jukeboxcore/reftrack.py#L1579-L1588
238,113
JukeboxPipeline/jukebox-core
src/jukeboxcore/reftrack.py
Reftrack.fetch_load_restriction
def fetch_load_restriction(self, ): """Fetch whether loading is restricted :returns: True, if loading is restricted :rtype: :class:`bool` :raises: None """ inter = self.get_refobjinter() restricted = self.status() != self.UNLOADED return restricted or int...
python
def fetch_load_restriction(self, ): """Fetch whether loading is restricted :returns: True, if loading is restricted :rtype: :class:`bool` :raises: None """ inter = self.get_refobjinter() restricted = self.status() != self.UNLOADED return restricted or int...
[ "def", "fetch_load_restriction", "(", "self", ",", ")", ":", "inter", "=", "self", ".", "get_refobjinter", "(", ")", "restricted", "=", "self", ".", "status", "(", ")", "!=", "self", ".", "UNLOADED", "return", "restricted", "or", "inter", ".", "fetch_actio...
Fetch whether loading is restricted :returns: True, if loading is restricted :rtype: :class:`bool` :raises: None
[ "Fetch", "whether", "loading", "is", "restricted" ]
bac2280ca49940355270e4b69400ce9976ab2e6f
https://github.com/JukeboxPipeline/jukebox-core/blob/bac2280ca49940355270e4b69400ce9976ab2e6f/src/jukeboxcore/reftrack.py#L1590-L1599
238,114
JukeboxPipeline/jukebox-core
src/jukeboxcore/reftrack.py
Reftrack.fetch_import_ref_restriction
def fetch_import_ref_restriction(self,): """Fetch whether importing the reference is restricted :returns: True, if importing the reference is restricted :rtype: :class:`bool` :raises: None """ inter = self.get_refobjinter() restricted = self.status() not in (self...
python
def fetch_import_ref_restriction(self,): """Fetch whether importing the reference is restricted :returns: True, if importing the reference is restricted :rtype: :class:`bool` :raises: None """ inter = self.get_refobjinter() restricted = self.status() not in (self...
[ "def", "fetch_import_ref_restriction", "(", "self", ",", ")", ":", "inter", "=", "self", ".", "get_refobjinter", "(", ")", "restricted", "=", "self", ".", "status", "(", ")", "not", "in", "(", "self", ".", "LOADED", ",", "self", ".", "UNLOADED", ")", "...
Fetch whether importing the reference is restricted :returns: True, if importing the reference is restricted :rtype: :class:`bool` :raises: None
[ "Fetch", "whether", "importing", "the", "reference", "is", "restricted" ]
bac2280ca49940355270e4b69400ce9976ab2e6f
https://github.com/JukeboxPipeline/jukebox-core/blob/bac2280ca49940355270e4b69400ce9976ab2e6f/src/jukeboxcore/reftrack.py#L1612-L1621
238,115
JukeboxPipeline/jukebox-core
src/jukeboxcore/reftrack.py
Reftrack.fetch_import_f_restriction
def fetch_import_f_restriction(self,): """Fetch whether importing a file is restricted :returns: True, if import is restricted :rtype: :class:`bool` :raises: None """ inter = self.get_refobjinter() restricted = self.status() is not None return restricted ...
python
def fetch_import_f_restriction(self,): """Fetch whether importing a file is restricted :returns: True, if import is restricted :rtype: :class:`bool` :raises: None """ inter = self.get_refobjinter() restricted = self.status() is not None return restricted ...
[ "def", "fetch_import_f_restriction", "(", "self", ",", ")", ":", "inter", "=", "self", ".", "get_refobjinter", "(", ")", "restricted", "=", "self", ".", "status", "(", ")", "is", "not", "None", "return", "restricted", "or", "inter", ".", "fetch_action_restri...
Fetch whether importing a file is restricted :returns: True, if import is restricted :rtype: :class:`bool` :raises: None
[ "Fetch", "whether", "importing", "a", "file", "is", "restricted" ]
bac2280ca49940355270e4b69400ce9976ab2e6f
https://github.com/JukeboxPipeline/jukebox-core/blob/bac2280ca49940355270e4b69400ce9976ab2e6f/src/jukeboxcore/reftrack.py#L1623-L1632
238,116
JukeboxPipeline/jukebox-core
src/jukeboxcore/reftrack.py
Reftrack.emit_data_changed
def emit_data_changed(self): """Emit the data changed signal on the model of the treeitem if the treeitem has a model. :returns: None :rtype: None :raises: None """ item = self.get_treeitem() m = item.get_model() if m: start = m.index_...
python
def emit_data_changed(self): """Emit the data changed signal on the model of the treeitem if the treeitem has a model. :returns: None :rtype: None :raises: None """ item = self.get_treeitem() m = item.get_model() if m: start = m.index_...
[ "def", "emit_data_changed", "(", "self", ")", ":", "item", "=", "self", ".", "get_treeitem", "(", ")", "m", "=", "item", ".", "get_model", "(", ")", "if", "m", ":", "start", "=", "m", ".", "index_of_item", "(", "item", ")", "parent", "=", "start", ...
Emit the data changed signal on the model of the treeitem if the treeitem has a model. :returns: None :rtype: None :raises: None
[ "Emit", "the", "data", "changed", "signal", "on", "the", "model", "of", "the", "treeitem", "if", "the", "treeitem", "has", "a", "model", "." ]
bac2280ca49940355270e4b69400ce9976ab2e6f
https://github.com/JukeboxPipeline/jukebox-core/blob/bac2280ca49940355270e4b69400ce9976ab2e6f/src/jukeboxcore/reftrack.py#L1655-L1669
238,117
JukeboxPipeline/jukebox-core
src/jukeboxcore/reftrack.py
RefobjInterface.create
def create(self, typ, identifier, parent=None): """Create a new refobj with the given typ and parent :param typ: the entity type :type typ: str :param identifier: the refobj id. Used to identify refobjects of the same parent, element and type in the UI :type identifier: int ...
python
def create(self, typ, identifier, parent=None): """Create a new refobj with the given typ and parent :param typ: the entity type :type typ: str :param identifier: the refobj id. Used to identify refobjects of the same parent, element and type in the UI :type identifier: int ...
[ "def", "create", "(", "self", ",", "typ", ",", "identifier", ",", "parent", "=", "None", ")", ":", "refobj", "=", "self", ".", "create_refobj", "(", ")", "self", ".", "set_typ", "(", "refobj", ",", "typ", ")", "self", ".", "set_id", "(", "refobj", ...
Create a new refobj with the given typ and parent :param typ: the entity type :type typ: str :param identifier: the refobj id. Used to identify refobjects of the same parent, element and type in the UI :type identifier: int :param parent: the parent refobject :type paren...
[ "Create", "a", "new", "refobj", "with", "the", "given", "typ", "and", "parent" ]
bac2280ca49940355270e4b69400ce9976ab2e6f
https://github.com/JukeboxPipeline/jukebox-core/blob/bac2280ca49940355270e4b69400ce9976ab2e6f/src/jukeboxcore/reftrack.py#L1903-L1921
238,118
JukeboxPipeline/jukebox-core
src/jukeboxcore/reftrack.py
RefobjInterface.delete
def delete(self, refobj): """Delete the given refobj and the contents of the entity :param refobj: the refobj to delete :type refobj: refobj :returns: None :rtype: None :raises: None """ i = self.get_typ_interface(self.get_typ(refobj)) i.delete(re...
python
def delete(self, refobj): """Delete the given refobj and the contents of the entity :param refobj: the refobj to delete :type refobj: refobj :returns: None :rtype: None :raises: None """ i = self.get_typ_interface(self.get_typ(refobj)) i.delete(re...
[ "def", "delete", "(", "self", ",", "refobj", ")", ":", "i", "=", "self", ".", "get_typ_interface", "(", "self", ".", "get_typ", "(", "refobj", ")", ")", "i", ".", "delete", "(", "refobj", ")", "self", ".", "delete_refobj", "(", "refobj", ")" ]
Delete the given refobj and the contents of the entity :param refobj: the refobj to delete :type refobj: refobj :returns: None :rtype: None :raises: None
[ "Delete", "the", "given", "refobj", "and", "the", "contents", "of", "the", "entity" ]
bac2280ca49940355270e4b69400ce9976ab2e6f
https://github.com/JukeboxPipeline/jukebox-core/blob/bac2280ca49940355270e4b69400ce9976ab2e6f/src/jukeboxcore/reftrack.py#L1935-L1946
238,119
JukeboxPipeline/jukebox-core
src/jukeboxcore/reftrack.py
RefobjInterface.reference
def reference(self, taskfileinfo, refobj): """Reference the given taskfile info and set the created reference on the refobj This will call :meth:`ReftypeInterface.reference`, then :meth:`ReftypeInterface.set_reference`. :param taskfileinfo: The taskfileinfo that holds the information f...
python
def reference(self, taskfileinfo, refobj): """Reference the given taskfile info and set the created reference on the refobj This will call :meth:`ReftypeInterface.reference`, then :meth:`ReftypeInterface.set_reference`. :param taskfileinfo: The taskfileinfo that holds the information f...
[ "def", "reference", "(", "self", ",", "taskfileinfo", ",", "refobj", ")", ":", "inter", "=", "self", ".", "get_typ_interface", "(", "self", ".", "get_typ", "(", "refobj", ")", ")", "ref", "=", "inter", ".", "reference", "(", "refobj", ",", "taskfileinfo"...
Reference the given taskfile info and set the created reference on the refobj This will call :meth:`ReftypeInterface.reference`, then :meth:`ReftypeInterface.set_reference`. :param taskfileinfo: The taskfileinfo that holds the information for what to reference :type taskfileinfo: :clas...
[ "Reference", "the", "given", "taskfile", "info", "and", "set", "the", "created", "reference", "on", "the", "refobj" ]
bac2280ca49940355270e4b69400ce9976ab2e6f
https://github.com/JukeboxPipeline/jukebox-core/blob/bac2280ca49940355270e4b69400ce9976ab2e6f/src/jukeboxcore/reftrack.py#L1999-L2015
238,120
JukeboxPipeline/jukebox-core
src/jukeboxcore/reftrack.py
RefobjInterface.replace
def replace(self, refobj, taskfileinfo): """Replace the given refobjs reference with the taskfileinfo This will call :meth:`ReftypeInterface.replace`. :param refobj: the refobject :type refobj: refobj :param taskfileinfo: the taskfileinfo that will replace the old entity ...
python
def replace(self, refobj, taskfileinfo): """Replace the given refobjs reference with the taskfileinfo This will call :meth:`ReftypeInterface.replace`. :param refobj: the refobject :type refobj: refobj :param taskfileinfo: the taskfileinfo that will replace the old entity ...
[ "def", "replace", "(", "self", ",", "refobj", ",", "taskfileinfo", ")", ":", "inter", "=", "self", ".", "get_typ_interface", "(", "self", ".", "get_typ", "(", "refobj", ")", ")", "ref", "=", "self", ".", "get_reference", "(", "refobj", ")", "inter", "....
Replace the given refobjs reference with the taskfileinfo This will call :meth:`ReftypeInterface.replace`. :param refobj: the refobject :type refobj: refobj :param taskfileinfo: the taskfileinfo that will replace the old entity :type taskfileinfo: :class:`jukeboxcore.filesys.Ta...
[ "Replace", "the", "given", "refobjs", "reference", "with", "the", "taskfileinfo" ]
bac2280ca49940355270e4b69400ce9976ab2e6f
https://github.com/JukeboxPipeline/jukebox-core/blob/bac2280ca49940355270e4b69400ce9976ab2e6f/src/jukeboxcore/reftrack.py#L2055-L2070
238,121
JukeboxPipeline/jukebox-core
src/jukeboxcore/reftrack.py
RefobjInterface.is_replaceable
def is_replaceable(self, refobj): """Return whether the given reference of the refobject is replaceable or if it should just get deleted and loaded again. This will call :meth:`ReftypeInterface.is_replaceable`. :param refobj: the refobject to query :type refobj: refobj ...
python
def is_replaceable(self, refobj): """Return whether the given reference of the refobject is replaceable or if it should just get deleted and loaded again. This will call :meth:`ReftypeInterface.is_replaceable`. :param refobj: the refobject to query :type refobj: refobj ...
[ "def", "is_replaceable", "(", "self", ",", "refobj", ")", ":", "inter", "=", "self", ".", "get_typ_interface", "(", "self", ".", "get_typ", "(", "refobj", ")", ")", "return", "inter", ".", "is_replaceable", "(", "refobj", ")" ]
Return whether the given reference of the refobject is replaceable or if it should just get deleted and loaded again. This will call :meth:`ReftypeInterface.is_replaceable`. :param refobj: the refobject to query :type refobj: refobj :returns: True, if replaceable :rtype...
[ "Return", "whether", "the", "given", "reference", "of", "the", "refobject", "is", "replaceable", "or", "if", "it", "should", "just", "get", "deleted", "and", "loaded", "again", "." ]
bac2280ca49940355270e4b69400ce9976ab2e6f
https://github.com/JukeboxPipeline/jukebox-core/blob/bac2280ca49940355270e4b69400ce9976ab2e6f/src/jukeboxcore/reftrack.py#L2072-L2085
238,122
JukeboxPipeline/jukebox-core
src/jukeboxcore/reftrack.py
RefobjInterface.import_reference
def import_reference(self, refobj): """Import the reference of the given refobj Here we assume, that the reference is already in the scene and we break the encapsulation and pull the data from the reference into the current scene. This will call :meth:`ReftypeInterface.import_re...
python
def import_reference(self, refobj): """Import the reference of the given refobj Here we assume, that the reference is already in the scene and we break the encapsulation and pull the data from the reference into the current scene. This will call :meth:`ReftypeInterface.import_re...
[ "def", "import_reference", "(", "self", ",", "refobj", ")", ":", "inter", "=", "self", ".", "get_typ_interface", "(", "self", ".", "get_typ", "(", "refobj", ")", ")", "ref", "=", "self", ".", "get_reference", "(", "refobj", ")", "inter", ".", "import_ref...
Import the reference of the given refobj Here we assume, that the reference is already in the scene and we break the encapsulation and pull the data from the reference into the current scene. This will call :meth:`ReftypeInterface.import_reference` and set the reference on the r...
[ "Import", "the", "reference", "of", "the", "given", "refobj" ]
bac2280ca49940355270e4b69400ce9976ab2e6f
https://github.com/JukeboxPipeline/jukebox-core/blob/bac2280ca49940355270e4b69400ce9976ab2e6f/src/jukeboxcore/reftrack.py#L2087-L2105
238,123
JukeboxPipeline/jukebox-core
src/jukeboxcore/reftrack.py
RefobjInterface.get_element
def get_element(self, refobj): """Return the element the refobj represents. The element is either an Asset or a Shot. :param refobj: the refobject to query :type refobj: refobj :returns: The element the reftrack represents :rtype: :class:`jukeboxcore.djadapter.models.As...
python
def get_element(self, refobj): """Return the element the refobj represents. The element is either an Asset or a Shot. :param refobj: the refobject to query :type refobj: refobj :returns: The element the reftrack represents :rtype: :class:`jukeboxcore.djadapter.models.As...
[ "def", "get_element", "(", "self", ",", "refobj", ")", ":", "tf", "=", "self", ".", "get_taskfile", "(", "refobj", ")", "return", "tf", ".", "task", ".", "element" ]
Return the element the refobj represents. The element is either an Asset or a Shot. :param refobj: the refobject to query :type refobj: refobj :returns: The element the reftrack represents :rtype: :class:`jukeboxcore.djadapter.models.Asset` | :class:`jukeboxcore.djadapter.model...
[ "Return", "the", "element", "the", "refobj", "represents", "." ]
bac2280ca49940355270e4b69400ce9976ab2e6f
https://github.com/JukeboxPipeline/jukebox-core/blob/bac2280ca49940355270e4b69400ce9976ab2e6f/src/jukeboxcore/reftrack.py#L2162-L2174
238,124
JukeboxPipeline/jukebox-core
src/jukeboxcore/reftrack.py
RefobjInterface.get_option_labels
def get_option_labels(self, typ, element): """Return labels for each level of the option model. The options returned by :meth:`RefobjInterface.fetch_options` is a treemodel with ``n`` levels. Each level should get a label to describe what is displays. E.g. if you organize your options,...
python
def get_option_labels(self, typ, element): """Return labels for each level of the option model. The options returned by :meth:`RefobjInterface.fetch_options` is a treemodel with ``n`` levels. Each level should get a label to describe what is displays. E.g. if you organize your options,...
[ "def", "get_option_labels", "(", "self", ",", "typ", ",", "element", ")", ":", "inter", "=", "self", ".", "get_typ_interface", "(", "typ", ")", "return", "inter", ".", "get_option_labels", "(", "element", ")" ]
Return labels for each level of the option model. The options returned by :meth:`RefobjInterface.fetch_options` is a treemodel with ``n`` levels. Each level should get a label to describe what is displays. E.g. if you organize your options, so that the first level shows the tasks, the second ...
[ "Return", "labels", "for", "each", "level", "of", "the", "option", "model", "." ]
bac2280ca49940355270e4b69400ce9976ab2e6f
https://github.com/JukeboxPipeline/jukebox-core/blob/bac2280ca49940355270e4b69400ce9976ab2e6f/src/jukeboxcore/reftrack.py#L2208-L2227
238,125
JukeboxPipeline/jukebox-core
src/jukeboxcore/reftrack.py
RefobjInterface.get_option_columns
def get_option_columns(self, typ, element): """Return the column of the model to show for each level Because each level might be displayed in a combobox. So you might want to provide the column to show. :param typ: the typ of options. E.g. Asset, Alembic, Camera etc :type typ: ...
python
def get_option_columns(self, typ, element): """Return the column of the model to show for each level Because each level might be displayed in a combobox. So you might want to provide the column to show. :param typ: the typ of options. E.g. Asset, Alembic, Camera etc :type typ: ...
[ "def", "get_option_columns", "(", "self", ",", "typ", ",", "element", ")", ":", "inter", "=", "self", ".", "get_typ_interface", "(", "typ", ")", "return", "inter", ".", "get_option_columns", "(", "element", ")" ]
Return the column of the model to show for each level Because each level might be displayed in a combobox. So you might want to provide the column to show. :param typ: the typ of options. E.g. Asset, Alembic, Camera etc :type typ: str :param element: The element for wich the op...
[ "Return", "the", "column", "of", "the", "model", "to", "show", "for", "each", "level" ]
bac2280ca49940355270e4b69400ce9976ab2e6f
https://github.com/JukeboxPipeline/jukebox-core/blob/bac2280ca49940355270e4b69400ce9976ab2e6f/src/jukeboxcore/reftrack.py#L2229-L2244
238,126
JukeboxPipeline/jukebox-core
src/jukeboxcore/reftrack.py
RefobjInterface.get_suggestions
def get_suggestions(self, reftrack): """Return a list with possible children for this reftrack Each Reftrack may want different children. E.g. a Asset wants to suggest a shader for itself and all assets that are linked in to it in the database. Suggestions only apply for enities with st...
python
def get_suggestions(self, reftrack): """Return a list with possible children for this reftrack Each Reftrack may want different children. E.g. a Asset wants to suggest a shader for itself and all assets that are linked in to it in the database. Suggestions only apply for enities with st...
[ "def", "get_suggestions", "(", "self", ",", "reftrack", ")", ":", "inter", "=", "self", ".", "get_typ_interface", "(", "reftrack", ".", "get_typ", "(", ")", ")", "return", "inter", ".", "get_suggestions", "(", "reftrack", ")" ]
Return a list with possible children for this reftrack Each Reftrack may want different children. E.g. a Asset wants to suggest a shader for itself and all assets that are linked in to it in the database. Suggestions only apply for enities with status other than None. A suggest...
[ "Return", "a", "list", "with", "possible", "children", "for", "this", "reftrack" ]
bac2280ca49940355270e4b69400ce9976ab2e6f
https://github.com/JukeboxPipeline/jukebox-core/blob/bac2280ca49940355270e4b69400ce9976ab2e6f/src/jukeboxcore/reftrack.py#L2246-L2269
238,127
JukeboxPipeline/jukebox-core
src/jukeboxcore/reftrack.py
RefobjInterface.get_available_types_for_scene
def get_available_types_for_scene(self, element): """Return a list of types that can be used in combination with the given element to add new reftracks to the scene. This allows for example the user, to add new reftracks (aliens) to the scene. So e.g. for a shader, it wouldn't make sens...
python
def get_available_types_for_scene(self, element): """Return a list of types that can be used in combination with the given element to add new reftracks to the scene. This allows for example the user, to add new reftracks (aliens) to the scene. So e.g. for a shader, it wouldn't make sens...
[ "def", "get_available_types_for_scene", "(", "self", ",", "element", ")", ":", "available", "=", "[", "]", "for", "typ", ",", "inter", "in", "self", ".", "types", ".", "items", "(", ")", ":", "if", "inter", "(", "self", ")", ".", "is_available_for_scene"...
Return a list of types that can be used in combination with the given element to add new reftracks to the scene. This allows for example the user, to add new reftracks (aliens) to the scene. So e.g. for a shader, it wouldn't make sense to make it available to be added to the scene, because ...
[ "Return", "a", "list", "of", "types", "that", "can", "be", "used", "in", "combination", "with", "the", "given", "element", "to", "add", "new", "reftracks", "to", "the", "scene", "." ]
bac2280ca49940355270e4b69400ce9976ab2e6f
https://github.com/JukeboxPipeline/jukebox-core/blob/bac2280ca49940355270e4b69400ce9976ab2e6f/src/jukeboxcore/reftrack.py#L2330-L2349
238,128
SeabornGames/RequestClient
seaborn/request_client/connection_endpoint.py
ConnectionEndpoint._pre_process_call
def _pre_process_call(self, name="Unknown", endpoint_params=None): """ This is called by the method_decorator within the Endpoint. The point is to capture a slot for the endpoint.method to put it's final _calls. It also allows for some special new arguments that will be extracted...
python
def _pre_process_call(self, name="Unknown", endpoint_params=None): """ This is called by the method_decorator within the Endpoint. The point is to capture a slot for the endpoint.method to put it's final _calls. It also allows for some special new arguments that will be extracted...
[ "def", "_pre_process_call", "(", "self", ",", "name", "=", "\"Unknown\"", ",", "endpoint_params", "=", "None", ")", ":", "call_temps", "=", "self", ".", "_call_temps", ".", "get", "(", "self", ".", "_get_thread_id", "(", ")", ",", "None", ")", "call_params...
This is called by the method_decorator within the Endpoint. The point is to capture a slot for the endpoint.method to put it's final _calls. It also allows for some special new arguments that will be extracted before the endpoint is called :param name: str of the name of the end...
[ "This", "is", "called", "by", "the", "method_decorator", "within", "the", "Endpoint", ".", "The", "point", "is", "to", "capture", "a", "slot", "for", "the", "endpoint", ".", "method", "to", "put", "it", "s", "final", "_calls", ".", "It", "also", "allows"...
21aeb951ddfdb6ee453ad0edc896ff224e06425d
https://github.com/SeabornGames/RequestClient/blob/21aeb951ddfdb6ee453ad0edc896ff224e06425d/seaborn/request_client/connection_endpoint.py#L70-L121
238,129
limodou/ido
ido/utils.py
function
def function(fname): """ Make a function to Function class """ def _f(func): class WrapFunction(Function): name = fname def __call__(self, *args, **kwargs): return func(*args, **kwargs) return WrapFunction return _f
python
def function(fname): """ Make a function to Function class """ def _f(func): class WrapFunction(Function): name = fname def __call__(self, *args, **kwargs): return func(*args, **kwargs) return WrapFunction return _f
[ "def", "function", "(", "fname", ")", ":", "def", "_f", "(", "func", ")", ":", "class", "WrapFunction", "(", "Function", ")", ":", "name", "=", "fname", "def", "__call__", "(", "self", ",", "*", "args", ",", "*", "*", "kwargs", ")", ":", "return", ...
Make a function to Function class
[ "Make", "a", "function", "to", "Function", "class" ]
7fcf5c20b47993b6c16eb6007f77ad1c868a6d68
https://github.com/limodou/ido/blob/7fcf5c20b47993b6c16eb6007f77ad1c868a6d68/ido/utils.py#L56-L69
238,130
ericflo/hurricane
hurricane/handlers/comet/utils.py
parse_cookie
def parse_cookie(header, charset='utf-8', errors='ignore'): """Parse a cookie. :param header: the header to be used to parse the cookie. :param charset: the charset for the cookie values. :param errors: the error behavior for the charset decoding. """ cookie = _ExtendedCookie() if header: ...
python
def parse_cookie(header, charset='utf-8', errors='ignore'): """Parse a cookie. :param header: the header to be used to parse the cookie. :param charset: the charset for the cookie values. :param errors: the error behavior for the charset decoding. """ cookie = _ExtendedCookie() if header: ...
[ "def", "parse_cookie", "(", "header", ",", "charset", "=", "'utf-8'", ",", "errors", "=", "'ignore'", ")", ":", "cookie", "=", "_ExtendedCookie", "(", ")", "if", "header", ":", "cookie", ".", "load", "(", "header", ")", "result", "=", "{", "}", "# deco...
Parse a cookie. :param header: the header to be used to parse the cookie. :param charset: the charset for the cookie values. :param errors: the error behavior for the charset decoding.
[ "Parse", "a", "cookie", "." ]
c192b711b2b1c06a386d1a1a47f538b13a659cde
https://github.com/ericflo/hurricane/blob/c192b711b2b1c06a386d1a1a47f538b13a659cde/hurricane/handlers/comet/utils.py#L58-L78
238,131
pip-services3-python/pip-services3-commons-python
pip_services3_commons/data/AnyValue.py
AnyValue.equals_as
def equals_as(self, value_type, other): """ Compares this object value to specified specified value. When direct comparison gives negative results it converts values to type specified by type code and compare them again. :param value_type: the Typecode type that defined the type...
python
def equals_as(self, value_type, other): """ Compares this object value to specified specified value. When direct comparison gives negative results it converts values to type specified by type code and compare them again. :param value_type: the Typecode type that defined the type...
[ "def", "equals_as", "(", "self", ",", "value_type", ",", "other", ")", ":", "if", "other", "==", "None", "and", "self", ".", "value", "==", "None", ":", "return", "True", "if", "other", "==", "None", "or", "self", ".", "value", "==", "None", ":", "...
Compares this object value to specified specified value. When direct comparison gives negative results it converts values to type specified by type code and compare them again. :param value_type: the Typecode type that defined the type of the result :param other: the value to be compar...
[ "Compares", "this", "object", "value", "to", "specified", "specified", "value", ".", "When", "direct", "comparison", "gives", "negative", "results", "it", "converts", "values", "to", "type", "specified", "by", "type", "code", "and", "compare", "them", "again", ...
22cbbb3e91e49717f65c083d36147fdb07ba9e3b
https://github.com/pip-services3-python/pip-services3-commons-python/blob/22cbbb3e91e49717f65c083d36147fdb07ba9e3b/pip_services3_commons/data/AnyValue.py#L296-L325
238,132
foliant-docs/foliantcontrib.mkdocs
foliant/preprocessors/mkdocs.py
Preprocessor._collect_images
def _collect_images(self, content: str, md_file_path: Path) -> str: '''Find images outside the source directory, copy them into the source directory, and replace the paths in the source. This is necessary because MkDocs can't deal with images outside the project's doc_dir. :param conte...
python
def _collect_images(self, content: str, md_file_path: Path) -> str: '''Find images outside the source directory, copy them into the source directory, and replace the paths in the source. This is necessary because MkDocs can't deal with images outside the project's doc_dir. :param conte...
[ "def", "_collect_images", "(", "self", ",", "content", ":", "str", ",", "md_file_path", ":", "Path", ")", "->", "str", ":", "self", ".", "logger", ".", "debug", "(", "f'Looking for images in {md_file_path}.'", ")", "def", "_sub", "(", "image", ")", ":", "i...
Find images outside the source directory, copy them into the source directory, and replace the paths in the source. This is necessary because MkDocs can't deal with images outside the project's doc_dir. :param content: Markdown content :param md_file_path: Path to the Markdown file wit...
[ "Find", "images", "outside", "the", "source", "directory", "copy", "them", "into", "the", "source", "directory", "and", "replace", "the", "paths", "in", "the", "source", "." ]
5f71a47139ab1cb630f1b61d4cef1c0657001272
https://github.com/foliant-docs/foliantcontrib.mkdocs/blob/5f71a47139ab1cb630f1b61d4cef1c0657001272/foliant/preprocessors/mkdocs.py#L15-L60
238,133
roboogle/gtkmvc3
gtkmvco/gtkmvc3/support/metaclasses.py
PropertyMeta.has_prop_attribute
def has_prop_attribute(cls, prop_name): # @NoSelf """This methods returns True if there exists a class attribute for the given property. The attribute is searched locally only""" return (prop_name in cls.__dict__ and not isinstance(cls.__dict__[prop_name], types.Function...
python
def has_prop_attribute(cls, prop_name): # @NoSelf """This methods returns True if there exists a class attribute for the given property. The attribute is searched locally only""" return (prop_name in cls.__dict__ and not isinstance(cls.__dict__[prop_name], types.Function...
[ "def", "has_prop_attribute", "(", "cls", ",", "prop_name", ")", ":", "# @NoSelf", "return", "(", "prop_name", "in", "cls", ".", "__dict__", "and", "not", "isinstance", "(", "cls", ".", "__dict__", "[", "prop_name", "]", ",", "types", ".", "FunctionType", "...
This methods returns True if there exists a class attribute for the given property. The attribute is searched locally only
[ "This", "methods", "returns", "True", "if", "there", "exists", "a", "class", "attribute", "for", "the", "given", "property", ".", "The", "attribute", "is", "searched", "locally", "only" ]
63405fd8d2056be26af49103b13a8d5e57fe4dff
https://github.com/roboogle/gtkmvc3/blob/63405fd8d2056be26af49103b13a8d5e57fe4dff/gtkmvco/gtkmvc3/support/metaclasses.py#L421-L426
238,134
roboogle/gtkmvc3
gtkmvco/gtkmvc3/support/metaclasses.py
PropertyMeta.check_value_change
def check_value_change(cls, old, new): # @NoSelf """Checks whether the value of the property changed in type or if the instance has been changed to a different instance. If true, a call to model._reset_property_notification should be called in order to re-register the new property insta...
python
def check_value_change(cls, old, new): # @NoSelf """Checks whether the value of the property changed in type or if the instance has been changed to a different instance. If true, a call to model._reset_property_notification should be called in order to re-register the new property insta...
[ "def", "check_value_change", "(", "cls", ",", "old", ",", "new", ")", ":", "# @NoSelf", "return", "(", "type", "(", "old", ")", "!=", "type", "(", "new", ")", "or", "isinstance", "(", "old", ",", "wrappers", ".", "ObsWrapperBase", ")", "and", "old", ...
Checks whether the value of the property changed in type or if the instance has been changed to a different instance. If true, a call to model._reset_property_notification should be called in order to re-register the new property instance or type
[ "Checks", "whether", "the", "value", "of", "the", "property", "changed", "in", "type", "or", "if", "the", "instance", "has", "been", "changed", "to", "a", "different", "instance", ".", "If", "true", "a", "call", "to", "model", ".", "_reset_property_notificat...
63405fd8d2056be26af49103b13a8d5e57fe4dff
https://github.com/roboogle/gtkmvc3/blob/63405fd8d2056be26af49103b13a8d5e57fe4dff/gtkmvco/gtkmvc3/support/metaclasses.py#L428-L435
238,135
roboogle/gtkmvc3
gtkmvco/gtkmvc3/support/metaclasses.py
PropertyMeta.get_getter
def get_getter(cls, prop_name, # @NoSelf user_getter=None, getter_takes_name=False): """Returns a function wich is a getter for a property. prop_name is the name off the property. user_getter is an optional function doing the work. If specified, that function will be...
python
def get_getter(cls, prop_name, # @NoSelf user_getter=None, getter_takes_name=False): """Returns a function wich is a getter for a property. prop_name is the name off the property. user_getter is an optional function doing the work. If specified, that function will be...
[ "def", "get_getter", "(", "cls", ",", "prop_name", ",", "# @NoSelf", "user_getter", "=", "None", ",", "getter_takes_name", "=", "False", ")", ":", "if", "user_getter", ":", "if", "getter_takes_name", ":", "# wraps the property name", "_deps", "=", "type", "(", ...
Returns a function wich is a getter for a property. prop_name is the name off the property. user_getter is an optional function doing the work. If specified, that function will be called instead of getting the attribute whose name is in 'prop_name'. If user_getter is specified ...
[ "Returns", "a", "function", "wich", "is", "a", "getter", "for", "a", "property", ".", "prop_name", "is", "the", "name", "off", "the", "property", "." ]
63405fd8d2056be26af49103b13a8d5e57fe4dff
https://github.com/roboogle/gtkmvc3/blob/63405fd8d2056be26af49103b13a8d5e57fe4dff/gtkmvco/gtkmvc3/support/metaclasses.py#L489-L519
238,136
zkbt/the-friendly-stars
thefriendlystars/constellations/others.py
GALEX.coneSearch
def coneSearch(self, center, radius=3*u.arcmin, magnitudelimit=25): ''' Run a cone search of the GALEX archive ''' self.magnitudelimit = magnitudelimit # run the query self.speak('querying GALEX, centered on {} with radius {}'.format(center, radius, magnitudelimit)) ...
python
def coneSearch(self, center, radius=3*u.arcmin, magnitudelimit=25): ''' Run a cone search of the GALEX archive ''' self.magnitudelimit = magnitudelimit # run the query self.speak('querying GALEX, centered on {} with radius {}'.format(center, radius, magnitudelimit)) ...
[ "def", "coneSearch", "(", "self", ",", "center", ",", "radius", "=", "3", "*", "u", ".", "arcmin", ",", "magnitudelimit", "=", "25", ")", ":", "self", ".", "magnitudelimit", "=", "magnitudelimit", "# run the query", "self", ".", "speak", "(", "'querying GA...
Run a cone search of the GALEX archive
[ "Run", "a", "cone", "search", "of", "the", "GALEX", "archive" ]
50d3f979e79e63c66629065c75595696dc79802e
https://github.com/zkbt/the-friendly-stars/blob/50d3f979e79e63c66629065c75595696dc79802e/thefriendlystars/constellations/others.py#L10-L35
238,137
mlavin/argyle
argyle/nginx.py
upload_nginx_site_conf
def upload_nginx_site_conf(site_name, template_name=None, context=None, enable=True): """Upload Nginx site configuration from a template.""" template_name = template_name or [u'nginx/%s.conf' % site_name, u'nginx/site.conf'] site_available = u'/etc/nginx/sites-available/%s' % site_name upload_templ...
python
def upload_nginx_site_conf(site_name, template_name=None, context=None, enable=True): """Upload Nginx site configuration from a template.""" template_name = template_name or [u'nginx/%s.conf' % site_name, u'nginx/site.conf'] site_available = u'/etc/nginx/sites-available/%s' % site_name upload_templ...
[ "def", "upload_nginx_site_conf", "(", "site_name", ",", "template_name", "=", "None", ",", "context", "=", "None", ",", "enable", "=", "True", ")", ":", "template_name", "=", "template_name", "or", "[", "u'nginx/%s.conf'", "%", "site_name", ",", "u'nginx/site.co...
Upload Nginx site configuration from a template.
[ "Upload", "Nginx", "site", "configuration", "from", "a", "template", "." ]
92cc6e1dd9b8e7cb41c5098a79d05e14b8243d72
https://github.com/mlavin/argyle/blob/92cc6e1dd9b8e7cb41c5098a79d05e14b8243d72/argyle/nginx.py#L15-L22
238,138
mlavin/argyle
argyle/nginx.py
enable_site
def enable_site(site_name): """Enable an available Nginx site.""" site_available = u'/etc/nginx/sites-available/%s' % site_name site_enabled = u'/etc/nginx/sites-enabled/%s' % site_name if files.exists(site_available): sudo(u'ln -s -f %s %s' % (site_available, site_enabled)) restart_ser...
python
def enable_site(site_name): """Enable an available Nginx site.""" site_available = u'/etc/nginx/sites-available/%s' % site_name site_enabled = u'/etc/nginx/sites-enabled/%s' % site_name if files.exists(site_available): sudo(u'ln -s -f %s %s' % (site_available, site_enabled)) restart_ser...
[ "def", "enable_site", "(", "site_name", ")", ":", "site_available", "=", "u'/etc/nginx/sites-available/%s'", "%", "site_name", "site_enabled", "=", "u'/etc/nginx/sites-enabled/%s'", "%", "site_name", "if", "files", ".", "exists", "(", "site_available", ")", ":", "sudo...
Enable an available Nginx site.
[ "Enable", "an", "available", "Nginx", "site", "." ]
92cc6e1dd9b8e7cb41c5098a79d05e14b8243d72
https://github.com/mlavin/argyle/blob/92cc6e1dd9b8e7cb41c5098a79d05e14b8243d72/argyle/nginx.py#L26-L35
238,139
mlavin/argyle
argyle/nginx.py
disable_site
def disable_site(site_name): """Disables Nginx site configuration.""" site = u'/etc/nginx/sites-enabled/%s' % site_name if files.exists(site): sudo(u'rm %s' % site) restart_service(u'nginx')
python
def disable_site(site_name): """Disables Nginx site configuration.""" site = u'/etc/nginx/sites-enabled/%s' % site_name if files.exists(site): sudo(u'rm %s' % site) restart_service(u'nginx')
[ "def", "disable_site", "(", "site_name", ")", ":", "site", "=", "u'/etc/nginx/sites-enabled/%s'", "%", "site_name", "if", "files", ".", "exists", "(", "site", ")", ":", "sudo", "(", "u'rm %s'", "%", "site", ")", "restart_service", "(", "u'nginx'", ")" ]
Disables Nginx site configuration.
[ "Disables", "Nginx", "site", "configuration", "." ]
92cc6e1dd9b8e7cb41c5098a79d05e14b8243d72
https://github.com/mlavin/argyle/blob/92cc6e1dd9b8e7cb41c5098a79d05e14b8243d72/argyle/nginx.py#L39-L45
238,140
host-anshu/simpleInterceptor
example/call_graph/utils.py
suppressConsoleOut
def suppressConsoleOut(meth): """Disable console output during the method is run.""" @wraps(meth) def decorate(*args, **kwargs): """Decorate""" # Disable ansible console output _stdout = sys.stdout fptr = open(os.devnull, 'w') sys.stdout = fptr try: ...
python
def suppressConsoleOut(meth): """Disable console output during the method is run.""" @wraps(meth) def decorate(*args, **kwargs): """Decorate""" # Disable ansible console output _stdout = sys.stdout fptr = open(os.devnull, 'w') sys.stdout = fptr try: ...
[ "def", "suppressConsoleOut", "(", "meth", ")", ":", "@", "wraps", "(", "meth", ")", "def", "decorate", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "\"\"\"Decorate\"\"\"", "# Disable ansible console output", "_stdout", "=", "sys", ".", "stdout", "fpt...
Disable console output during the method is run.
[ "Disable", "console", "output", "during", "the", "method", "is", "run", "." ]
71238fed57c62b5f77ce32d0c9b98acad73ab6a8
https://github.com/host-anshu/simpleInterceptor/blob/71238fed57c62b5f77ce32d0c9b98acad73ab6a8/example/call_graph/utils.py#L8-L24
238,141
ravenac95/overlay4u
overlay4u/overlay.py
OverlayFS.mount
def mount(cls, mount_point, lower_dir, upper_dir, mount_table=None): """Execute the mount. This requires root""" ensure_directories(mount_point, lower_dir, upper_dir) # Load the mount table if it isn't given if not mount_table: mount_table = MountTable.load() # Check ...
python
def mount(cls, mount_point, lower_dir, upper_dir, mount_table=None): """Execute the mount. This requires root""" ensure_directories(mount_point, lower_dir, upper_dir) # Load the mount table if it isn't given if not mount_table: mount_table = MountTable.load() # Check ...
[ "def", "mount", "(", "cls", ",", "mount_point", ",", "lower_dir", ",", "upper_dir", ",", "mount_table", "=", "None", ")", ":", "ensure_directories", "(", "mount_point", ",", "lower_dir", ",", "upper_dir", ")", "# Load the mount table if it isn't given", "if", "not...
Execute the mount. This requires root
[ "Execute", "the", "mount", ".", "This", "requires", "root" ]
621eecc0d4d40951aa8afcb533b5eec5d91c73cc
https://github.com/ravenac95/overlay4u/blob/621eecc0d4d40951aa8afcb533b5eec5d91c73cc/overlay4u/overlay.py#L21-L36
238,142
pip-services3-python/pip-services3-commons-python
pip_services3_commons/run/Opener.py
Opener.is_opened
def is_opened(components): """ Checks if all components are opened. To be checked components must implement [[IOpenable]] interface. If they don't the call to this method returns true. :param components: a list of components that are to be checked. :return: true if all...
python
def is_opened(components): """ Checks if all components are opened. To be checked components must implement [[IOpenable]] interface. If they don't the call to this method returns true. :param components: a list of components that are to be checked. :return: true if all...
[ "def", "is_opened", "(", "components", ")", ":", "if", "components", "==", "None", ":", "return", "True", "result", "=", "True", "for", "component", "in", "components", ":", "result", "=", "result", "and", "Opener", ".", "is_opened_one", "(", "component", ...
Checks if all components are opened. To be checked components must implement [[IOpenable]] interface. If they don't the call to this method returns true. :param components: a list of components that are to be checked. :return: true if all components are opened and false if at least on...
[ "Checks", "if", "all", "components", "are", "opened", "." ]
22cbbb3e91e49717f65c083d36147fdb07ba9e3b
https://github.com/pip-services3-python/pip-services3-commons-python/blob/22cbbb3e91e49717f65c083d36147fdb07ba9e3b/pip_services3_commons/run/Opener.py#L36-L54
238,143
pip-services3-python/pip-services3-commons-python
pip_services3_commons/run/Opener.py
Opener.open
def open(correlation_id, components): """ Opens multiple components. To be opened components must implement [[IOpenable]] interface. If they don't the call to this method has no effect. :param correlation_id: (optional) transaction id to trace execution through call chain. ...
python
def open(correlation_id, components): """ Opens multiple components. To be opened components must implement [[IOpenable]] interface. If they don't the call to this method has no effect. :param correlation_id: (optional) transaction id to trace execution through call chain. ...
[ "def", "open", "(", "correlation_id", ",", "components", ")", ":", "if", "components", "==", "None", ":", "return", "for", "component", "in", "components", ":", "Opener", ".", "open_one", "(", "correlation_id", ",", "component", ")" ]
Opens multiple components. To be opened components must implement [[IOpenable]] interface. If they don't the call to this method has no effect. :param correlation_id: (optional) transaction id to trace execution through call chain. :param components: the list of components that are to...
[ "Opens", "multiple", "components", "." ]
22cbbb3e91e49717f65c083d36147fdb07ba9e3b
https://github.com/pip-services3-python/pip-services3-commons-python/blob/22cbbb3e91e49717f65c083d36147fdb07ba9e3b/pip_services3_commons/run/Opener.py#L72-L87
238,144
kervi/kervi-devices
kervi/devices/sensors/BMP085.py
BMP085DeviceDriver.read_temperature
def read_temperature(self): """Gets the compensated temperature in degrees celsius.""" UT = self.read_raw_temp() # Datasheet value for debugging: #UT = 27898 # Calculations below are taken straight from section 3.5 of the datasheet. X1 = ((UT - self.cal_AC6) * self.cal_AC...
python
def read_temperature(self): """Gets the compensated temperature in degrees celsius.""" UT = self.read_raw_temp() # Datasheet value for debugging: #UT = 27898 # Calculations below are taken straight from section 3.5 of the datasheet. X1 = ((UT - self.cal_AC6) * self.cal_AC...
[ "def", "read_temperature", "(", "self", ")", ":", "UT", "=", "self", ".", "read_raw_temp", "(", ")", "# Datasheet value for debugging:", "#UT = 27898", "# Calculations below are taken straight from section 3.5 of the datasheet.", "X1", "=", "(", "(", "UT", "-", "self", ...
Gets the compensated temperature in degrees celsius.
[ "Gets", "the", "compensated", "temperature", "in", "degrees", "celsius", "." ]
c6aaddc6da1d0bce0ea2b0c6eb8393ba10aefa56
https://github.com/kervi/kervi-devices/blob/c6aaddc6da1d0bce0ea2b0c6eb8393ba10aefa56/kervi/devices/sensors/BMP085.py#L130-L141
238,145
kervi/kervi-devices
kervi/devices/sensors/BMP085.py
BMP085DeviceDriver.read_pressure
def read_pressure(self): """Gets the compensated pressure in Pascals.""" UT = self.read_raw_temp() UP = self.read_raw_pressure() # Datasheet values for debugging: #UT = 27898 #UP = 23843 # Calculations below are taken straight from section 3.5 of the datasheet. ...
python
def read_pressure(self): """Gets the compensated pressure in Pascals.""" UT = self.read_raw_temp() UP = self.read_raw_pressure() # Datasheet values for debugging: #UT = 27898 #UP = 23843 # Calculations below are taken straight from section 3.5 of the datasheet. ...
[ "def", "read_pressure", "(", "self", ")", ":", "UT", "=", "self", ".", "read_raw_temp", "(", ")", "UP", "=", "self", ".", "read_raw_pressure", "(", ")", "# Datasheet values for debugging:", "#UT = 27898", "#UP = 23843", "# Calculations below are taken straight from sect...
Gets the compensated pressure in Pascals.
[ "Gets", "the", "compensated", "pressure", "in", "Pascals", "." ]
c6aaddc6da1d0bce0ea2b0c6eb8393ba10aefa56
https://github.com/kervi/kervi-devices/blob/c6aaddc6da1d0bce0ea2b0c6eb8393ba10aefa56/kervi/devices/sensors/BMP085.py#L143-L180
238,146
rouk1/django-image-renderer
renderer/views.py
get_rendition_url
def get_rendition_url(request, image_id, target_width=0, target_height=0): ''' get a rendition url if the rendition does nto exist it will be created in the storage if dimensions do not fit master's aspect ratio then image will be cropped with a centered anchor if one dimensions is omitted (0)...
python
def get_rendition_url(request, image_id, target_width=0, target_height=0): ''' get a rendition url if the rendition does nto exist it will be created in the storage if dimensions do not fit master's aspect ratio then image will be cropped with a centered anchor if one dimensions is omitted (0)...
[ "def", "get_rendition_url", "(", "request", ",", "image_id", ",", "target_width", "=", "0", ",", "target_height", "=", "0", ")", ":", "im", "=", "get_object_or_404", "(", "MasterImage", ",", "pk", "=", "image_id", ")", "return", "JsonResponse", "(", "{", "...
get a rendition url if the rendition does nto exist it will be created in the storage if dimensions do not fit master's aspect ratio then image will be cropped with a centered anchor if one dimensions is omitted (0) the other one will be generated accordind to master's aspect ratio :param req...
[ "get", "a", "rendition", "url" ]
6a4326b77709601e18ee04f5626cf475c5ea0bb5
https://github.com/rouk1/django-image-renderer/blob/6a4326b77709601e18ee04f5626cf475c5ea0bb5/renderer/views.py#L13-L39
238,147
rouk1/django-image-renderer
renderer/views.py
get_master_url
def get_master_url(request, image_id): ''' get image's master url ... :param request: http GET request /renderer/master/url/<image_id>/ :param image_id: the master image primary key :return: master url in a json dictionary ''' im = get_object_or_404(MasterImage, pk=image_id) retur...
python
def get_master_url(request, image_id): ''' get image's master url ... :param request: http GET request /renderer/master/url/<image_id>/ :param image_id: the master image primary key :return: master url in a json dictionary ''' im = get_object_or_404(MasterImage, pk=image_id) retur...
[ "def", "get_master_url", "(", "request", ",", "image_id", ")", ":", "im", "=", "get_object_or_404", "(", "MasterImage", ",", "pk", "=", "image_id", ")", "return", "JsonResponse", "(", "{", "'url'", ":", "im", ".", "get_master_url", "(", ")", "}", ")" ]
get image's master url ... :param request: http GET request /renderer/master/url/<image_id>/ :param image_id: the master image primary key :return: master url in a json dictionary
[ "get", "image", "s", "master", "url" ]
6a4326b77709601e18ee04f5626cf475c5ea0bb5
https://github.com/rouk1/django-image-renderer/blob/6a4326b77709601e18ee04f5626cf475c5ea0bb5/renderer/views.py#L43-L55
238,148
adsabs/adsutils
adsutils/utils.py
Resolver.__parse_results
def __parse_results(self,results): """ The resolve server responds with some basic HTML formatting, where the actual results are listed as an HTML list. The regular expression RE_RESULT captures each entry """ reslist = [] cursor = 0 match = RE_RESULTS.se...
python
def __parse_results(self,results): """ The resolve server responds with some basic HTML formatting, where the actual results are listed as an HTML list. The regular expression RE_RESULT captures each entry """ reslist = [] cursor = 0 match = RE_RESULTS.se...
[ "def", "__parse_results", "(", "self", ",", "results", ")", ":", "reslist", "=", "[", "]", "cursor", "=", "0", "match", "=", "RE_RESULTS", ".", "search", "(", "results", ",", "cursor", ")", "while", "match", ":", "doc", "=", "{", "}", "doc", "[", "...
The resolve server responds with some basic HTML formatting, where the actual results are listed as an HTML list. The regular expression RE_RESULT captures each entry
[ "The", "resolve", "server", "responds", "with", "some", "basic", "HTML", "formatting", "where", "the", "actual", "results", "are", "listed", "as", "an", "HTML", "list", ".", "The", "regular", "expression", "RE_RESULT", "captures", "each", "entry" ]
fb9d6b4f6ed5e6ca19c552efc3cdd6466c587fdb
https://github.com/adsabs/adsutils/blob/fb9d6b4f6ed5e6ca19c552efc3cdd6466c587fdb/adsutils/utils.py#L205-L222
238,149
pawel-kow/domainconnect_python
domainconnect/domainconnect.py
DomainConnect.get_domain_config
def get_domain_config(self, domain): """Makes a discovery of domain name and resolves configuration of DNS provider :param domain: str domain name :return: DomainConnectConfig domain connect config :raises: NoDomainConnectRecordException when no _doma...
python
def get_domain_config(self, domain): """Makes a discovery of domain name and resolves configuration of DNS provider :param domain: str domain name :return: DomainConnectConfig domain connect config :raises: NoDomainConnectRecordException when no _doma...
[ "def", "get_domain_config", "(", "self", ",", "domain", ")", ":", "domain_root", "=", "self", ".", "identify_domain_root", "(", "domain", ")", "host", "=", "''", "if", "len", "(", "domain_root", ")", "!=", "len", "(", "domain", ")", ":", "host", "=", "...
Makes a discovery of domain name and resolves configuration of DNS provider :param domain: str domain name :return: DomainConnectConfig domain connect config :raises: NoDomainConnectRecordException when no _domainconnect record found :raises: NoDomain...
[ "Makes", "a", "discovery", "of", "domain", "name", "and", "resolves", "configuration", "of", "DNS", "provider" ]
2467093cc4e997234e0fb5c55e71f76b856c1ab1
https://github.com/pawel-kow/domainconnect_python/blob/2467093cc4e997234e0fb5c55e71f76b856c1ab1/domainconnect/domainconnect.py#L218-L239
238,150
pawel-kow/domainconnect_python
domainconnect/domainconnect.py
DomainConnect.get_domain_connect_template_sync_url
def get_domain_connect_template_sync_url(self, domain, provider_id, service_id, redirect_uri=None, params=None, state=None, group_ids=None): """Makes full Domain Connect discovery of a domain and returns full url to request sync consent. :param domain: str ...
python
def get_domain_connect_template_sync_url(self, domain, provider_id, service_id, redirect_uri=None, params=None, state=None, group_ids=None): """Makes full Domain Connect discovery of a domain and returns full url to request sync consent. :param domain: str ...
[ "def", "get_domain_connect_template_sync_url", "(", "self", ",", "domain", ",", "provider_id", ",", "service_id", ",", "redirect_uri", "=", "None", ",", "params", "=", "None", ",", "state", "=", "None", ",", "group_ids", "=", "None", ")", ":", "# TODO: support...
Makes full Domain Connect discovery of a domain and returns full url to request sync consent. :param domain: str :param provider_id: str :param service_id: str :param redirect_uri: str :param params: dict :param state: str :param group_ids: list(str) :ret...
[ "Makes", "full", "Domain", "Connect", "discovery", "of", "a", "domain", "and", "returns", "full", "url", "to", "request", "sync", "consent", "." ]
2467093cc4e997234e0fb5c55e71f76b856c1ab1
https://github.com/pawel-kow/domainconnect_python/blob/2467093cc4e997234e0fb5c55e71f76b856c1ab1/domainconnect/domainconnect.py#L297-L342
238,151
pawel-kow/domainconnect_python
domainconnect/domainconnect.py
DomainConnect.get_domain_connect_template_async_context
def get_domain_connect_template_async_context(self, domain, provider_id, service_id, redirect_uri, params=None, state=None, service_id_in_path=False): """Makes full Domain Connect discovery of a domain and returns full context to request async consent. ...
python
def get_domain_connect_template_async_context(self, domain, provider_id, service_id, redirect_uri, params=None, state=None, service_id_in_path=False): """Makes full Domain Connect discovery of a domain and returns full context to request async consent. ...
[ "def", "get_domain_connect_template_async_context", "(", "self", ",", "domain", ",", "provider_id", ",", "service_id", ",", "redirect_uri", ",", "params", "=", "None", ",", "state", "=", "None", ",", "service_id_in_path", "=", "False", ")", ":", "if", "params", ...
Makes full Domain Connect discovery of a domain and returns full context to request async consent. :param domain: str :param provider_id: str :param service_id: str :param redirect_uri: str :param params: dict :param state: str :param service_id_in_path: bool ...
[ "Makes", "full", "Domain", "Connect", "discovery", "of", "a", "domain", "and", "returns", "full", "context", "to", "request", "async", "consent", "." ]
2467093cc4e997234e0fb5c55e71f76b856c1ab1
https://github.com/pawel-kow/domainconnect_python/blob/2467093cc4e997234e0fb5c55e71f76b856c1ab1/domainconnect/domainconnect.py#L344-L400
238,152
pawel-kow/domainconnect_python
domainconnect/domainconnect.py
DomainConnect.get_async_token
def get_async_token(self, context, credentials): """Gets access_token in async process :param context: DomainConnectAsyncContext :param credentials: DomainConnectAsyncCredentials :return: DomainConnectAsyncContext context enriched with access_token and refresh_token if exist...
python
def get_async_token(self, context, credentials): """Gets access_token in async process :param context: DomainConnectAsyncContext :param credentials: DomainConnectAsyncCredentials :return: DomainConnectAsyncContext context enriched with access_token and refresh_token if exist...
[ "def", "get_async_token", "(", "self", ",", "context", ",", "credentials", ")", ":", "params", "=", "{", "'code'", ":", "context", ".", "code", ",", "'grant_type'", ":", "'authorization_code'", "}", "if", "getattr", "(", "context", ",", "'iat'", ",", "None...
Gets access_token in async process :param context: DomainConnectAsyncContext :param credentials: DomainConnectAsyncCredentials :return: DomainConnectAsyncContext context enriched with access_token and refresh_token if existing :raises: AsyncTokenException
[ "Gets", "access_token", "in", "async", "process" ]
2467093cc4e997234e0fb5c55e71f76b856c1ab1
https://github.com/pawel-kow/domainconnect_python/blob/2467093cc4e997234e0fb5c55e71f76b856c1ab1/domainconnect/domainconnect.py#L438-L494
238,153
TestInABox/stackInABox
stackinabox/util/httpretty/core.py
httpretty_callback
def httpretty_callback(request, uri, headers): """httpretty request handler. converts a call intercepted by httpretty to the stack-in-a-box infrastructure :param request: request object :param uri: the uri of the request :param headers: headers for the response :returns: tuple - (int, dic...
python
def httpretty_callback(request, uri, headers): """httpretty request handler. converts a call intercepted by httpretty to the stack-in-a-box infrastructure :param request: request object :param uri: the uri of the request :param headers: headers for the response :returns: tuple - (int, dic...
[ "def", "httpretty_callback", "(", "request", ",", "uri", ",", "headers", ")", ":", "method", "=", "request", ".", "method", "response_headers", "=", "CaseInsensitiveDict", "(", ")", "response_headers", ".", "update", "(", "headers", ")", "request_headers", "=", ...
httpretty request handler. converts a call intercepted by httpretty to the stack-in-a-box infrastructure :param request: request object :param uri: the uri of the request :param headers: headers for the response :returns: tuple - (int, dict, string) containing: int - the...
[ "httpretty", "request", "handler", "." ]
63ee457401e9a88d987f85f513eb512dcb12d984
https://github.com/TestInABox/stackInABox/blob/63ee457401e9a88d987f85f513eb512dcb12d984/stackinabox/util/httpretty/core.py#L22-L47
238,154
TestInABox/stackInABox
stackinabox/util/httpretty/core.py
registration
def registration(uri): """httpretty handler registration. registers a handler for a given uri with httpretty so that it can be intercepted and handed to stack-in-a-box. :param uri: uri used for the base of the http requests :returns: n/a """ # add the stack-in-a-box specific respons...
python
def registration(uri): """httpretty handler registration. registers a handler for a given uri with httpretty so that it can be intercepted and handed to stack-in-a-box. :param uri: uri used for the base of the http requests :returns: n/a """ # add the stack-in-a-box specific respons...
[ "def", "registration", "(", "uri", ")", ":", "# add the stack-in-a-box specific response codes to", "# http's status information", "status_data", "=", "{", "595", ":", "'StackInABoxService - Unknown Route'", ",", "596", ":", "'StackInABox - Exception in Service Handler'", ",", ...
httpretty handler registration. registers a handler for a given uri with httpretty so that it can be intercepted and handed to stack-in-a-box. :param uri: uri used for the base of the http requests :returns: n/a
[ "httpretty", "handler", "registration", "." ]
63ee457401e9a88d987f85f513eb512dcb12d984
https://github.com/TestInABox/stackInABox/blob/63ee457401e9a88d987f85f513eb512dcb12d984/stackinabox/util/httpretty/core.py#L50-L85
238,155
FujiMakoto/AgentML
agentml/parser/tags/redirect.py
Redirect.value
def value(self): """ Return the value of the redirect response """ user = self.trigger.agentml.request_log.most_recent().user groups = self.trigger.agentml.request_log.most_recent().groups # Does the redirect statement have tags to parse? if len(self._element): ...
python
def value(self): """ Return the value of the redirect response """ user = self.trigger.agentml.request_log.most_recent().user groups = self.trigger.agentml.request_log.most_recent().groups # Does the redirect statement have tags to parse? if len(self._element): ...
[ "def", "value", "(", "self", ")", ":", "user", "=", "self", ".", "trigger", ".", "agentml", ".", "request_log", ".", "most_recent", "(", ")", ".", "user", "groups", "=", "self", ".", "trigger", ".", "agentml", ".", "request_log", ".", "most_recent", "(...
Return the value of the redirect response
[ "Return", "the", "value", "of", "the", "redirect", "response" ]
c8cb64b460d876666bf29ea2c682189874c7c403
https://github.com/FujiMakoto/AgentML/blob/c8cb64b460d876666bf29ea2c682189874c7c403/agentml/parser/tags/redirect.py#L24-L41
238,156
lgfausak/sqlauth
sqlauth/scripts/sqlauthrouter.py
MyRouterSession.onHello
def onHello(self, realm, details): """ Callback fired when client wants to attach session. """ log.msg("onHello: {} {}".format(realm, details)) self._pending_auth = None if details.authmethods: for authmethod in details.authmethods: if authme...
python
def onHello(self, realm, details): """ Callback fired when client wants to attach session. """ log.msg("onHello: {} {}".format(realm, details)) self._pending_auth = None if details.authmethods: for authmethod in details.authmethods: if authme...
[ "def", "onHello", "(", "self", ",", "realm", ",", "details", ")", ":", "log", ".", "msg", "(", "\"onHello: {} {}\"", ".", "format", "(", "realm", ",", "details", ")", ")", "self", ".", "_pending_auth", "=", "None", "if", "details", ".", "authmethods", ...
Callback fired when client wants to attach session.
[ "Callback", "fired", "when", "client", "wants", "to", "attach", "session", "." ]
e79237e5790b989ad327c17698b295d14d25b63f
https://github.com/lgfausak/sqlauth/blob/e79237e5790b989ad327c17698b295d14d25b63f/sqlauth/scripts/sqlauthrouter.py#L151-L192
238,157
lgfausak/sqlauth
sqlauth/scripts/sqlauthrouter.py
MyRouterSession.onAuthenticate
def onAuthenticate(self, signature, extra): """ Callback fired when a client responds to an authentication challenge. """ log.msg("onAuthenticate: {} {}".format(signature, extra)) ## if there is a pending auth, and the signature provided by client matches .. if self._pen...
python
def onAuthenticate(self, signature, extra): """ Callback fired when a client responds to an authentication challenge. """ log.msg("onAuthenticate: {} {}".format(signature, extra)) ## if there is a pending auth, and the signature provided by client matches .. if self._pen...
[ "def", "onAuthenticate", "(", "self", ",", "signature", ",", "extra", ")", ":", "log", ".", "msg", "(", "\"onAuthenticate: {} {}\"", ".", "format", "(", "signature", ",", "extra", ")", ")", "## if there is a pending auth, and the signature provided by client matches .."...
Callback fired when a client responds to an authentication challenge.
[ "Callback", "fired", "when", "a", "client", "responds", "to", "an", "authentication", "challenge", "." ]
e79237e5790b989ad327c17698b295d14d25b63f
https://github.com/lgfausak/sqlauth/blob/e79237e5790b989ad327c17698b295d14d25b63f/sqlauth/scripts/sqlauthrouter.py#L195-L218
238,158
cltrudeau/wrench
wrench/logtools/utils.py
configure_stdout_logger
def configure_stdout_logger(log_level=logging.DEBUG): """Configures logging to use STDOUT""" root = logging.getLogger() root.setLevel(log_level) handler = logging.StreamHandler() handler.setLevel(log_level) handler.setFormatter(logging.Formatter(LOG_FORMAT_ESCAPED)) root.addHandler(handler...
python
def configure_stdout_logger(log_level=logging.DEBUG): """Configures logging to use STDOUT""" root = logging.getLogger() root.setLevel(log_level) handler = logging.StreamHandler() handler.setLevel(log_level) handler.setFormatter(logging.Formatter(LOG_FORMAT_ESCAPED)) root.addHandler(handler...
[ "def", "configure_stdout_logger", "(", "log_level", "=", "logging", ".", "DEBUG", ")", ":", "root", "=", "logging", ".", "getLogger", "(", ")", "root", ".", "setLevel", "(", "log_level", ")", "handler", "=", "logging", ".", "StreamHandler", "(", ")", "hand...
Configures logging to use STDOUT
[ "Configures", "logging", "to", "use", "STDOUT" ]
bc231dd085050a63a87ff3eb8f0a863928f65a41
https://github.com/cltrudeau/wrench/blob/bc231dd085050a63a87ff3eb8f0a863928f65a41/wrench/logtools/utils.py#L32-L41
238,159
cltrudeau/wrench
wrench/logtools/utils.py
silence_logging
def silence_logging(method): """Disables logging for the duration of what is being wrapped. This is particularly useful when testing if a test method is supposed to issue an error message which is confusing that the error shows for a successful test. """ @wraps(method) def wrapper(*args, **...
python
def silence_logging(method): """Disables logging for the duration of what is being wrapped. This is particularly useful when testing if a test method is supposed to issue an error message which is confusing that the error shows for a successful test. """ @wraps(method) def wrapper(*args, **...
[ "def", "silence_logging", "(", "method", ")", ":", "@", "wraps", "(", "method", ")", "def", "wrapper", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "logging", ".", "disable", "(", "logging", ".", "ERROR", ")", "result", "=", "method", "(", ...
Disables logging for the duration of what is being wrapped. This is particularly useful when testing if a test method is supposed to issue an error message which is confusing that the error shows for a successful test.
[ "Disables", "logging", "for", "the", "duration", "of", "what", "is", "being", "wrapped", ".", "This", "is", "particularly", "useful", "when", "testing", "if", "a", "test", "method", "is", "supposed", "to", "issue", "an", "error", "message", "which", "is", ...
bc231dd085050a63a87ff3eb8f0a863928f65a41
https://github.com/cltrudeau/wrench/blob/bc231dd085050a63a87ff3eb8f0a863928f65a41/wrench/logtools/utils.py#L96-L108
238,160
roboogle/gtkmvc3
gtkmvco/examples/uimanager/subviews/spintool.py
SpinToolAction.do_create_tool_item
def do_create_tool_item(self): """This is called by the UIManager when it is time to instantiate the proxy""" proxy = SpinToolItem(*self._args_for_toolitem) self.connect_proxy(proxy) return proxy
python
def do_create_tool_item(self): """This is called by the UIManager when it is time to instantiate the proxy""" proxy = SpinToolItem(*self._args_for_toolitem) self.connect_proxy(proxy) return proxy
[ "def", "do_create_tool_item", "(", "self", ")", ":", "proxy", "=", "SpinToolItem", "(", "*", "self", ".", "_args_for_toolitem", ")", "self", ".", "connect_proxy", "(", "proxy", ")", "return", "proxy" ]
This is called by the UIManager when it is time to instantiate the proxy
[ "This", "is", "called", "by", "the", "UIManager", "when", "it", "is", "time", "to", "instantiate", "the", "proxy" ]
63405fd8d2056be26af49103b13a8d5e57fe4dff
https://github.com/roboogle/gtkmvc3/blob/63405fd8d2056be26af49103b13a8d5e57fe4dff/gtkmvco/examples/uimanager/subviews/spintool.py#L109-L114
238,161
roboogle/gtkmvc3
gtkmvco/examples/uimanager/subviews/spintool.py
SpinToolAction.set_value
def set_value(self, value): """Set value to action.""" self._value = value for proxy in self.get_proxies(): proxy.handler_block(self._changed_handlers[proxy]) proxy.set_value(self._value) proxy.handler_unblock(self._changed_handlers[proxy]) pass ...
python
def set_value(self, value): """Set value to action.""" self._value = value for proxy in self.get_proxies(): proxy.handler_block(self._changed_handlers[proxy]) proxy.set_value(self._value) proxy.handler_unblock(self._changed_handlers[proxy]) pass ...
[ "def", "set_value", "(", "self", ",", "value", ")", ":", "self", ".", "_value", "=", "value", "for", "proxy", "in", "self", ".", "get_proxies", "(", ")", ":", "proxy", ".", "handler_block", "(", "self", ".", "_changed_handlers", "[", "proxy", "]", ")",...
Set value to action.
[ "Set", "value", "to", "action", "." ]
63405fd8d2056be26af49103b13a8d5e57fe4dff
https://github.com/roboogle/gtkmvc3/blob/63405fd8d2056be26af49103b13a8d5e57fe4dff/gtkmvco/examples/uimanager/subviews/spintool.py#L129-L140
238,162
samuel-phan/mssh-copy-id
tasks.py
clean
def clean(ctx): """ clean generated project files """ os.chdir(PROJECT_DIR) patterns = ['.cache', '.coverage', '.eggs', 'build', 'dist'] ctx.run('rm -vrf {0}'.format(' '.join(patterns))) ctx.run('''find . \( -name '*,cover' -o -...
python
def clean(ctx): """ clean generated project files """ os.chdir(PROJECT_DIR) patterns = ['.cache', '.coverage', '.eggs', 'build', 'dist'] ctx.run('rm -vrf {0}'.format(' '.join(patterns))) ctx.run('''find . \( -name '*,cover' -o -...
[ "def", "clean", "(", "ctx", ")", ":", "os", ".", "chdir", "(", "PROJECT_DIR", ")", "patterns", "=", "[", "'.cache'", ",", "'.coverage'", ",", "'.eggs'", ",", "'build'", ",", "'dist'", "]", "ctx", ".", "run", "(", "'rm -vrf {0}'", ".", "format", "(", ...
clean generated project files
[ "clean", "generated", "project", "files" ]
59c50eabb74c4e0eeb729266df57c285e6661b0b
https://github.com/samuel-phan/mssh-copy-id/blob/59c50eabb74c4e0eeb729266df57c285e6661b0b/tasks.py#L36-L48
238,163
samuel-phan/mssh-copy-id
tasks.py
build_docker_sshd
def build_docker_sshd(ctx): """ build docker image sshd-mssh-copy-id """ dinfo = DOCKER_SSHD_IMG ctx.run('docker rmi -f {0}'.format(dinfo['name']), warn=True) ctx.run('docker build -t {0} {1}'.format(dinfo['name'], dinfo['path']))
python
def build_docker_sshd(ctx): """ build docker image sshd-mssh-copy-id """ dinfo = DOCKER_SSHD_IMG ctx.run('docker rmi -f {0}'.format(dinfo['name']), warn=True) ctx.run('docker build -t {0} {1}'.format(dinfo['name'], dinfo['path']))
[ "def", "build_docker_sshd", "(", "ctx", ")", ":", "dinfo", "=", "DOCKER_SSHD_IMG", "ctx", ".", "run", "(", "'docker rmi -f {0}'", ".", "format", "(", "dinfo", "[", "'name'", "]", ")", ",", "warn", "=", "True", ")", "ctx", ".", "run", "(", "'docker build ...
build docker image sshd-mssh-copy-id
[ "build", "docker", "image", "sshd", "-", "mssh", "-", "copy", "-", "id" ]
59c50eabb74c4e0eeb729266df57c285e6661b0b
https://github.com/samuel-phan/mssh-copy-id/blob/59c50eabb74c4e0eeb729266df57c285e6661b0b/tasks.py#L52-L58
238,164
samuel-phan/mssh-copy-id
tasks.py
build_docker
def build_docker(ctx, image): """ build docker images """ if image not in DOCKER_IMGS: print('Error: unknown docker image "{0}"!'.format(image), file=sys.stderr) sys.exit(1) dinfo = DOCKER_IMGS[image] ctx.run('docker rmi -f {0}'.format(dinfo['name']), warn=True) dinfo_work_d...
python
def build_docker(ctx, image): """ build docker images """ if image not in DOCKER_IMGS: print('Error: unknown docker image "{0}"!'.format(image), file=sys.stderr) sys.exit(1) dinfo = DOCKER_IMGS[image] ctx.run('docker rmi -f {0}'.format(dinfo['name']), warn=True) dinfo_work_d...
[ "def", "build_docker", "(", "ctx", ",", "image", ")", ":", "if", "image", "not", "in", "DOCKER_IMGS", ":", "print", "(", "'Error: unknown docker image \"{0}\"!'", ".", "format", "(", "image", ")", ",", "file", "=", "sys", ".", "stderr", ")", "sys", ".", ...
build docker images
[ "build", "docker", "images" ]
59c50eabb74c4e0eeb729266df57c285e6661b0b
https://github.com/samuel-phan/mssh-copy-id/blob/59c50eabb74c4e0eeb729266df57c285e6661b0b/tasks.py#L62-L75
238,165
samuel-phan/mssh-copy-id
tasks.py
build_deb
def build_deb(ctx, target): """ build a deb package """ if target not in ('ubuntu-trusty',): print('Error: unknown target "{0}"!'.format(target), file=sys.stderr) sys.exit(1) os.chdir(PROJECT_DIR) debbuild_dir = os.path.join(DIST_DIR, 'deb') # Create directories layout ...
python
def build_deb(ctx, target): """ build a deb package """ if target not in ('ubuntu-trusty',): print('Error: unknown target "{0}"!'.format(target), file=sys.stderr) sys.exit(1) os.chdir(PROJECT_DIR) debbuild_dir = os.path.join(DIST_DIR, 'deb') # Create directories layout ...
[ "def", "build_deb", "(", "ctx", ",", "target", ")", ":", "if", "target", "not", "in", "(", "'ubuntu-trusty'", ",", ")", ":", "print", "(", "'Error: unknown target \"{0}\"!'", ".", "format", "(", "target", ")", ",", "file", "=", "sys", ".", "stderr", ")",...
build a deb package
[ "build", "a", "deb", "package" ]
59c50eabb74c4e0eeb729266df57c285e6661b0b
https://github.com/samuel-phan/mssh-copy-id/blob/59c50eabb74c4e0eeb729266df57c285e6661b0b/tasks.py#L79-L107
238,166
samuel-phan/mssh-copy-id
tasks.py
build_rpm
def build_rpm(ctx, target): """ build an RPM package """ if target not in ('centos6', 'centos7'): print('Error: unknown target "{0}"!'.format(target), file=sys.stderr) sys.exit(1) os.chdir(PROJECT_DIR) rpmbuild_dir = os.path.join(DIST_DIR, 'rpmbuild') # Create directories l...
python
def build_rpm(ctx, target): """ build an RPM package """ if target not in ('centos6', 'centos7'): print('Error: unknown target "{0}"!'.format(target), file=sys.stderr) sys.exit(1) os.chdir(PROJECT_DIR) rpmbuild_dir = os.path.join(DIST_DIR, 'rpmbuild') # Create directories l...
[ "def", "build_rpm", "(", "ctx", ",", "target", ")", ":", "if", "target", "not", "in", "(", "'centos6'", ",", "'centos7'", ")", ":", "print", "(", "'Error: unknown target \"{0}\"!'", ".", "format", "(", "target", ")", ",", "file", "=", "sys", ".", "stderr...
build an RPM package
[ "build", "an", "RPM", "package" ]
59c50eabb74c4e0eeb729266df57c285e6661b0b
https://github.com/samuel-phan/mssh-copy-id/blob/59c50eabb74c4e0eeb729266df57c285e6661b0b/tasks.py#L111-L138
238,167
samuel-phan/mssh-copy-id
tasks.py
build_src
def build_src(ctx, dest=None): """ build source archive """ if dest: if not dest.startswith('/'): # Relative dest = os.path.join(os.getcwd(), dest) os.chdir(PROJECT_DIR) ctx.run('python setup.py sdist --dist-dir {0}'.format(dest)) else: os.chd...
python
def build_src(ctx, dest=None): """ build source archive """ if dest: if not dest.startswith('/'): # Relative dest = os.path.join(os.getcwd(), dest) os.chdir(PROJECT_DIR) ctx.run('python setup.py sdist --dist-dir {0}'.format(dest)) else: os.chd...
[ "def", "build_src", "(", "ctx", ",", "dest", "=", "None", ")", ":", "if", "dest", ":", "if", "not", "dest", ".", "startswith", "(", "'/'", ")", ":", "# Relative", "dest", "=", "os", ".", "path", ".", "join", "(", "os", ".", "getcwd", "(", ")", ...
build source archive
[ "build", "source", "archive" ]
59c50eabb74c4e0eeb729266df57c285e6661b0b
https://github.com/samuel-phan/mssh-copy-id/blob/59c50eabb74c4e0eeb729266df57c285e6661b0b/tasks.py#L142-L155
238,168
JukeboxPipeline/jukebox-core
docs/updatedoc.py
run_gendoc
def run_gendoc(source, dest, args): """Starts gendoc which reads source and creates rst files in dest with the given args. :param source: The python source directory for gendoc. Can be a relative path. :type source: str :param dest: The destination for the rst files. Can be a relative path. :type d...
python
def run_gendoc(source, dest, args): """Starts gendoc which reads source and creates rst files in dest with the given args. :param source: The python source directory for gendoc. Can be a relative path. :type source: str :param dest: The destination for the rst files. Can be a relative path. :type d...
[ "def", "run_gendoc", "(", "source", ",", "dest", ",", "args", ")", ":", "args", ".", "insert", "(", "0", ",", "'gendoc.py'", ")", "args", ".", "append", "(", "dest", ")", "args", ".", "append", "(", "source", ")", "print", "'Running gendoc.main with: %s'...
Starts gendoc which reads source and creates rst files in dest with the given args. :param source: The python source directory for gendoc. Can be a relative path. :type source: str :param dest: The destination for the rst files. Can be a relative path. :type dest: str :param args: Arguments for gen...
[ "Starts", "gendoc", "which", "reads", "source", "and", "creates", "rst", "files", "in", "dest", "with", "the", "given", "args", "." ]
bac2280ca49940355270e4b69400ce9976ab2e6f
https://github.com/JukeboxPipeline/jukebox-core/blob/bac2280ca49940355270e4b69400ce9976ab2e6f/docs/updatedoc.py#L84-L101
238,169
JukeboxPipeline/jukebox-core
docs/updatedoc.py
main
def main(argv=sys.argv[1:]): """Parse commandline arguments and run the tool :param argv: the commandline arguments. :type argv: list :returns: None :rtype: None :raises: None """ parser = setup_argparse() args = parser.parse_args(argv) if args.gendochelp: sys.argv[0] = ...
python
def main(argv=sys.argv[1:]): """Parse commandline arguments and run the tool :param argv: the commandline arguments. :type argv: list :returns: None :rtype: None :raises: None """ parser = setup_argparse() args = parser.parse_args(argv) if args.gendochelp: sys.argv[0] = ...
[ "def", "main", "(", "argv", "=", "sys", ".", "argv", "[", "1", ":", "]", ")", ":", "parser", "=", "setup_argparse", "(", ")", "args", "=", "parser", ".", "parse_args", "(", "argv", ")", "if", "args", ".", "gendochelp", ":", "sys", ".", "argv", "[...
Parse commandline arguments and run the tool :param argv: the commandline arguments. :type argv: list :returns: None :rtype: None :raises: None
[ "Parse", "commandline", "arguments", "and", "run", "the", "tool" ]
bac2280ca49940355270e4b69400ce9976ab2e6f
https://github.com/JukeboxPipeline/jukebox-core/blob/bac2280ca49940355270e4b69400ce9976ab2e6f/docs/updatedoc.py#L104-L131
238,170
Checksum/landfill
landfill.py
get_migrations
def get_migrations(path): ''' In the specified directory, get all the files which match the pattern 0001_migration.py ''' pattern = re.compile(r"\d+_[\w\d]+") modules = [name for _, name, _ in pkgutil.iter_modules([path]) if pattern.match(name) ] return sorted(mo...
python
def get_migrations(path): ''' In the specified directory, get all the files which match the pattern 0001_migration.py ''' pattern = re.compile(r"\d+_[\w\d]+") modules = [name for _, name, _ in pkgutil.iter_modules([path]) if pattern.match(name) ] return sorted(mo...
[ "def", "get_migrations", "(", "path", ")", ":", "pattern", "=", "re", ".", "compile", "(", "r\"\\d+_[\\w\\d]+\"", ")", "modules", "=", "[", "name", "for", "_", ",", "name", ",", "_", "in", "pkgutil", ".", "iter_modules", "(", "[", "path", "]", ")", "...
In the specified directory, get all the files which match the pattern 0001_migration.py
[ "In", "the", "specified", "directory", "get", "all", "the", "files", "which", "match", "the", "pattern", "0001_migration", ".", "py" ]
bf1ea36042a00dc848e1380b8dc0153bb7e89fea
https://github.com/Checksum/landfill/blob/bf1ea36042a00dc848e1380b8dc0153bb7e89fea/landfill.py#L398-L408
238,171
Checksum/landfill
landfill.py
migrate
def migrate(engine, database, module, **kwargs): ''' Execute the migrations. Pass in kwargs ''' validate_args(engine, database, module) options = { 'direction': kwargs.get('direction', 'up'), 'fake': kwargs.get('fake', False), 'force': kwargs.get('force', False), 'mi...
python
def migrate(engine, database, module, **kwargs): ''' Execute the migrations. Pass in kwargs ''' validate_args(engine, database, module) options = { 'direction': kwargs.get('direction', 'up'), 'fake': kwargs.get('fake', False), 'force': kwargs.get('force', False), 'mi...
[ "def", "migrate", "(", "engine", ",", "database", ",", "module", ",", "*", "*", "kwargs", ")", ":", "validate_args", "(", "engine", ",", "database", ",", "module", ")", "options", "=", "{", "'direction'", ":", "kwargs", ".", "get", "(", "'direction'", ...
Execute the migrations. Pass in kwargs
[ "Execute", "the", "migrations", ".", "Pass", "in", "kwargs" ]
bf1ea36042a00dc848e1380b8dc0153bb7e89fea
https://github.com/Checksum/landfill/blob/bf1ea36042a00dc848e1380b8dc0153bb7e89fea/landfill.py#L423-L439
238,172
Checksum/landfill
landfill.py
generate
def generate(engine, database, models, **kwargs): ''' Generate the migrations by introspecting the db ''' validate_args(engine, database, models) generator = Generator(engine, database, models) generator.run()
python
def generate(engine, database, models, **kwargs): ''' Generate the migrations by introspecting the db ''' validate_args(engine, database, models) generator = Generator(engine, database, models) generator.run()
[ "def", "generate", "(", "engine", ",", "database", ",", "models", ",", "*", "*", "kwargs", ")", ":", "validate_args", "(", "engine", ",", "database", ",", "models", ")", "generator", "=", "Generator", "(", "engine", ",", "database", ",", "models", ")", ...
Generate the migrations by introspecting the db
[ "Generate", "the", "migrations", "by", "introspecting", "the", "db" ]
bf1ea36042a00dc848e1380b8dc0153bb7e89fea
https://github.com/Checksum/landfill/blob/bf1ea36042a00dc848e1380b8dc0153bb7e89fea/landfill.py#L441-L447
238,173
Checksum/landfill
landfill.py
CustomMigrator.apply_migration
def apply_migration(self, migration, **kwargs): ''' Apply a particular migration ''' cprint("\nAttempting to run %s" % migration, "cyan") # First check if the migration has already been applied exists = Migration.select().where(Migration.name == migration).limit(1).first(...
python
def apply_migration(self, migration, **kwargs): ''' Apply a particular migration ''' cprint("\nAttempting to run %s" % migration, "cyan") # First check if the migration has already been applied exists = Migration.select().where(Migration.name == migration).limit(1).first(...
[ "def", "apply_migration", "(", "self", ",", "migration", ",", "*", "*", "kwargs", ")", ":", "cprint", "(", "\"\\nAttempting to run %s\"", "%", "migration", ",", "\"cyan\"", ")", "# First check if the migration has already been applied", "exists", "=", "Migration", "."...
Apply a particular migration
[ "Apply", "a", "particular", "migration" ]
bf1ea36042a00dc848e1380b8dc0153bb7e89fea
https://github.com/Checksum/landfill/blob/bf1ea36042a00dc848e1380b8dc0153bb7e89fea/landfill.py#L162-L203
238,174
Checksum/landfill
landfill.py
Generator.get_tables
def get_tables(self, models): ''' Extract all peewee models from the passed in module ''' return { obj._meta.db_table : obj for obj in models.__dict__.itervalues() if isinstance(obj, peewee.BaseModel) and len(obj._meta.fields) > 1 ...
python
def get_tables(self, models): ''' Extract all peewee models from the passed in module ''' return { obj._meta.db_table : obj for obj in models.__dict__.itervalues() if isinstance(obj, peewee.BaseModel) and len(obj._meta.fields) > 1 ...
[ "def", "get_tables", "(", "self", ",", "models", ")", ":", "return", "{", "obj", ".", "_meta", ".", "db_table", ":", "obj", "for", "obj", "in", "models", ".", "__dict__", ".", "itervalues", "(", ")", "if", "isinstance", "(", "obj", ",", "peewee", "."...
Extract all peewee models from the passed in module
[ "Extract", "all", "peewee", "models", "from", "the", "passed", "in", "module" ]
bf1ea36042a00dc848e1380b8dc0153bb7e89fea
https://github.com/Checksum/landfill/blob/bf1ea36042a00dc848e1380b8dc0153bb7e89fea/landfill.py#L274-L282
238,175
Checksum/landfill
landfill.py
Generator.get_pwiz_tables
def get_pwiz_tables(self, engine, database): ''' Run the pwiz introspector and get the models defined in the DB. ''' introspector = pwiz.make_introspector(engine, database.database, **database.connect_kwargs) out_file = '/tmp/db_models.py' with Captur...
python
def get_pwiz_tables(self, engine, database): ''' Run the pwiz introspector and get the models defined in the DB. ''' introspector = pwiz.make_introspector(engine, database.database, **database.connect_kwargs) out_file = '/tmp/db_models.py' with Captur...
[ "def", "get_pwiz_tables", "(", "self", ",", "engine", ",", "database", ")", ":", "introspector", "=", "pwiz", ".", "make_introspector", "(", "engine", ",", "database", ".", "database", ",", "*", "*", "database", ".", "connect_kwargs", ")", "out_file", "=", ...
Run the pwiz introspector and get the models defined in the DB.
[ "Run", "the", "pwiz", "introspector", "and", "get", "the", "models", "defined", "in", "the", "DB", "." ]
bf1ea36042a00dc848e1380b8dc0153bb7e89fea
https://github.com/Checksum/landfill/blob/bf1ea36042a00dc848e1380b8dc0153bb7e89fea/landfill.py#L284-L303
238,176
botswana-harvard/edc-registration
edc_registration/model_mixins/registered_subject_model_mixin.py
RegisteredSubjectModelMixin.update_subject_identifier_on_save
def update_subject_identifier_on_save(self): """Overridden to not set the subject identifier on save. """ if not self.subject_identifier: self.subject_identifier = self.subject_identifier_as_pk.hex elif re.match(UUID_PATTERN, self.subject_identifier): pass ...
python
def update_subject_identifier_on_save(self): """Overridden to not set the subject identifier on save. """ if not self.subject_identifier: self.subject_identifier = self.subject_identifier_as_pk.hex elif re.match(UUID_PATTERN, self.subject_identifier): pass ...
[ "def", "update_subject_identifier_on_save", "(", "self", ")", ":", "if", "not", "self", ".", "subject_identifier", ":", "self", ".", "subject_identifier", "=", "self", ".", "subject_identifier_as_pk", ".", "hex", "elif", "re", ".", "match", "(", "UUID_PATTERN", ...
Overridden to not set the subject identifier on save.
[ "Overridden", "to", "not", "set", "the", "subject", "identifier", "on", "save", "." ]
3daca624a496945fd4536488f6f80790bbecc081
https://github.com/botswana-harvard/edc-registration/blob/3daca624a496945fd4536488f6f80790bbecc081/edc_registration/model_mixins/registered_subject_model_mixin.py#L186-L193
238,177
botswana-harvard/edc-registration
edc_registration/model_mixins/registered_subject_model_mixin.py
RegisteredSubjectModelMixin.raise_on_changed_subject_identifier
def raise_on_changed_subject_identifier(self): """Raises an exception if there is an attempt to change the subject identifier for an existing instance if the subject identifier is already set. """ if self.id and self.subject_identifier_is_set(): with transaction.atomi...
python
def raise_on_changed_subject_identifier(self): """Raises an exception if there is an attempt to change the subject identifier for an existing instance if the subject identifier is already set. """ if self.id and self.subject_identifier_is_set(): with transaction.atomi...
[ "def", "raise_on_changed_subject_identifier", "(", "self", ")", ":", "if", "self", ".", "id", "and", "self", ".", "subject_identifier_is_set", "(", ")", ":", "with", "transaction", ".", "atomic", "(", ")", ":", "obj", "=", "self", ".", "__class__", ".", "o...
Raises an exception if there is an attempt to change the subject identifier for an existing instance if the subject identifier is already set.
[ "Raises", "an", "exception", "if", "there", "is", "an", "attempt", "to", "change", "the", "subject", "identifier", "for", "an", "existing", "instance", "if", "the", "subject", "identifier", "is", "already", "set", "." ]
3daca624a496945fd4536488f6f80790bbecc081
https://github.com/botswana-harvard/edc-registration/blob/3daca624a496945fd4536488f6f80790bbecc081/edc_registration/model_mixins/registered_subject_model_mixin.py#L209-L222
238,178
pip-services3-python/pip-services3-commons-python
pip_services3_commons/config/NameResolver.py
NameResolver.resolve
def resolve(config, default_name = None): """ Resolves a component name from configuration parameters. The name can be stored in "id", "name" fields or inside a component descriptor. If name cannot be determined it returns a defaultName. :param config: configuration parameters t...
python
def resolve(config, default_name = None): """ Resolves a component name from configuration parameters. The name can be stored in "id", "name" fields or inside a component descriptor. If name cannot be determined it returns a defaultName. :param config: configuration parameters t...
[ "def", "resolve", "(", "config", ",", "default_name", "=", "None", ")", ":", "name", "=", "config", ".", "get_as_nullable_string", "(", "\"name\"", ")", "name", "=", "name", "if", "name", "!=", "None", "else", "config", ".", "get_as_nullable_string", "(", ...
Resolves a component name from configuration parameters. The name can be stored in "id", "name" fields or inside a component descriptor. If name cannot be determined it returns a defaultName. :param config: configuration parameters that may contain a component name. :param default_name...
[ "Resolves", "a", "component", "name", "from", "configuration", "parameters", ".", "The", "name", "can", "be", "stored", "in", "id", "name", "fields", "or", "inside", "a", "component", "descriptor", ".", "If", "name", "cannot", "be", "determined", "it", "retu...
22cbbb3e91e49717f65c083d36147fdb07ba9e3b
https://github.com/pip-services3-python/pip-services3-commons-python/blob/22cbbb3e91e49717f65c083d36147fdb07ba9e3b/pip_services3_commons/config/NameResolver.py#L30-L51
238,179
mikicz/arca
arca/backend/current_environment.py
CurrentEnvironmentBackend.get_or_create_environment
def get_or_create_environment(self, repo: str, branch: str, git_repo: Repo, repo_path: Path) -> str: """ Returns the path to the current Python executable. """ return sys.executable
python
def get_or_create_environment(self, repo: str, branch: str, git_repo: Repo, repo_path: Path) -> str: """ Returns the path to the current Python executable. """ return sys.executable
[ "def", "get_or_create_environment", "(", "self", ",", "repo", ":", "str", ",", "branch", ":", "str", ",", "git_repo", ":", "Repo", ",", "repo_path", ":", "Path", ")", "->", "str", ":", "return", "sys", ".", "executable" ]
Returns the path to the current Python executable.
[ "Returns", "the", "path", "to", "the", "current", "Python", "executable", "." ]
e67fdc00be473ecf8ec16d024e1a3f2c47ca882c
https://github.com/mikicz/arca/blob/e67fdc00be473ecf8ec16d024e1a3f2c47ca882c/arca/backend/current_environment.py#L15-L18
238,180
roboogle/gtkmvc3
gtkmvco/gtkmvc3/model.py
count_leaves
def count_leaves(x): """ Return the number of non-sequence items in a given recursive sequence. """ if hasattr(x, 'keys'): x = list(x.values()) if hasattr(x, '__getitem__'): return sum(map(count_leaves, x)) return 1
python
def count_leaves(x): """ Return the number of non-sequence items in a given recursive sequence. """ if hasattr(x, 'keys'): x = list(x.values()) if hasattr(x, '__getitem__'): return sum(map(count_leaves, x)) return 1
[ "def", "count_leaves", "(", "x", ")", ":", "if", "hasattr", "(", "x", ",", "'keys'", ")", ":", "x", "=", "list", "(", "x", ".", "values", "(", ")", ")", "if", "hasattr", "(", "x", ",", "'__getitem__'", ")", ":", "return", "sum", "(", "map", "("...
Return the number of non-sequence items in a given recursive sequence.
[ "Return", "the", "number", "of", "non", "-", "sequence", "items", "in", "a", "given", "recursive", "sequence", "." ]
63405fd8d2056be26af49103b13a8d5e57fe4dff
https://github.com/roboogle/gtkmvc3/blob/63405fd8d2056be26af49103b13a8d5e57fe4dff/gtkmvco/gtkmvc3/model.py#L46-L55
238,181
ask/literal.py
literal/__init__.py
reprkwargs
def reprkwargs(kwargs, sep=', ', fmt="{0!s}={1!r}"): """Display kwargs.""" return sep.join(fmt.format(k, v) for k, v in kwargs.iteritems())
python
def reprkwargs(kwargs, sep=', ', fmt="{0!s}={1!r}"): """Display kwargs.""" return sep.join(fmt.format(k, v) for k, v in kwargs.iteritems())
[ "def", "reprkwargs", "(", "kwargs", ",", "sep", "=", "', '", ",", "fmt", "=", "\"{0!s}={1!r}\"", ")", ":", "return", "sep", ".", "join", "(", "fmt", ".", "format", "(", "k", ",", "v", ")", "for", "k", ",", "v", "in", "kwargs", ".", "iteritems", "...
Display kwargs.
[ "Display", "kwargs", "." ]
b3c48b4b82edf408ce3bdf2639dae6daec483b24
https://github.com/ask/literal.py/blob/b3c48b4b82edf408ce3bdf2639dae6daec483b24/literal/__init__.py#L62-L64
238,182
ask/literal.py
literal/__init__.py
reprcall
def reprcall(name, args=(), kwargs=(), keywords='', sep=', ', argfilter=repr): """Format a function call for display.""" if keywords: keywords = ((', ' if (args or kwargs) else '') + '**' + keywords) argfilter = argfilter or repr return "{name}({args}{sep}{kwargs}{key...
python
def reprcall(name, args=(), kwargs=(), keywords='', sep=', ', argfilter=repr): """Format a function call for display.""" if keywords: keywords = ((', ' if (args or kwargs) else '') + '**' + keywords) argfilter = argfilter or repr return "{name}({args}{sep}{kwargs}{key...
[ "def", "reprcall", "(", "name", ",", "args", "=", "(", ")", ",", "kwargs", "=", "(", ")", ",", "keywords", "=", "''", ",", "sep", "=", "', '", ",", "argfilter", "=", "repr", ")", ":", "if", "keywords", ":", "keywords", "=", "(", "(", "', '", "i...
Format a function call for display.
[ "Format", "a", "function", "call", "for", "display", "." ]
b3c48b4b82edf408ce3bdf2639dae6daec483b24
https://github.com/ask/literal.py/blob/b3c48b4b82edf408ce3bdf2639dae6daec483b24/literal/__init__.py#L71-L81
238,183
ask/literal.py
literal/__init__.py
reprsig
def reprsig(fun, name=None, method=False): """Format a methods signature for display.""" args, varargs, keywords, defs, kwargs = [], [], None, [], {} argspec = fun if callable(fun): name = fun.__name__ if name is None else name argspec = getargspec(fun) try: args = argspec[0]...
python
def reprsig(fun, name=None, method=False): """Format a methods signature for display.""" args, varargs, keywords, defs, kwargs = [], [], None, [], {} argspec = fun if callable(fun): name = fun.__name__ if name is None else name argspec = getargspec(fun) try: args = argspec[0]...
[ "def", "reprsig", "(", "fun", ",", "name", "=", "None", ",", "method", "=", "False", ")", ":", "args", ",", "varargs", ",", "keywords", ",", "defs", ",", "kwargs", "=", "[", "]", ",", "[", "]", ",", "None", ",", "[", "]", ",", "{", "}", "args...
Format a methods signature for display.
[ "Format", "a", "methods", "signature", "for", "display", "." ]
b3c48b4b82edf408ce3bdf2639dae6daec483b24
https://github.com/ask/literal.py/blob/b3c48b4b82edf408ce3bdf2639dae6daec483b24/literal/__init__.py#L84-L106
238,184
mapmyfitness/jtime
jtime/utils.py
get_input
def get_input(input_func, input_str): """ Get input from the user given an input function and an input string """ val = input_func("Please enter your {0}: ".format(input_str)) while not val or not len(val.strip()): val = input_func("You didn't enter a valid {0}, please try again: ".format(in...
python
def get_input(input_func, input_str): """ Get input from the user given an input function and an input string """ val = input_func("Please enter your {0}: ".format(input_str)) while not val or not len(val.strip()): val = input_func("You didn't enter a valid {0}, please try again: ".format(in...
[ "def", "get_input", "(", "input_func", ",", "input_str", ")", ":", "val", "=", "input_func", "(", "\"Please enter your {0}: \"", ".", "format", "(", "input_str", ")", ")", "while", "not", "val", "or", "not", "len", "(", "val", ".", "strip", "(", ")", ")"...
Get input from the user given an input function and an input string
[ "Get", "input", "from", "the", "user", "given", "an", "input", "function", "and", "an", "input", "string" ]
402fb6b40ac7a78c23fd02fac50c6dbe49e5ebfd
https://github.com/mapmyfitness/jtime/blob/402fb6b40ac7a78c23fd02fac50c6dbe49e5ebfd/jtime/utils.py#L6-L13
238,185
mapmyfitness/jtime
jtime/utils.py
working_cycletime
def working_cycletime(start, end, workday_start=datetime.timedelta(hours=0), workday_end=datetime.timedelta(hours=24)): """ Get the working time between a beginning and an end point subtracting out non-office time """ def clamp(t, start, end): "Return 't' clamped to the range ['start', 'end']" ...
python
def working_cycletime(start, end, workday_start=datetime.timedelta(hours=0), workday_end=datetime.timedelta(hours=24)): """ Get the working time between a beginning and an end point subtracting out non-office time """ def clamp(t, start, end): "Return 't' clamped to the range ['start', 'end']" ...
[ "def", "working_cycletime", "(", "start", ",", "end", ",", "workday_start", "=", "datetime", ".", "timedelta", "(", "hours", "=", "0", ")", ",", "workday_end", "=", "datetime", ".", "timedelta", "(", "hours", "=", "24", ")", ")", ":", "def", "clamp", "...
Get the working time between a beginning and an end point subtracting out non-office time
[ "Get", "the", "working", "time", "between", "a", "beginning", "and", "an", "end", "point", "subtracting", "out", "non", "-", "office", "time" ]
402fb6b40ac7a78c23fd02fac50c6dbe49e5ebfd
https://github.com/mapmyfitness/jtime/blob/402fb6b40ac7a78c23fd02fac50c6dbe49e5ebfd/jtime/utils.py#L16-L56
238,186
gorakhargosh/pepe
pepe/__init__.py
parse_definition_expr
def parse_definition_expr(expr, default_value=None): """ Parses a definition expression and returns a key-value pair as a tuple. Each definition expression should be in one of these two formats: * <variable>=<value> * <variable> :param expr: String expression to be parsed....
python
def parse_definition_expr(expr, default_value=None): """ Parses a definition expression and returns a key-value pair as a tuple. Each definition expression should be in one of these two formats: * <variable>=<value> * <variable> :param expr: String expression to be parsed....
[ "def", "parse_definition_expr", "(", "expr", ",", "default_value", "=", "None", ")", ":", "try", ":", "define", ",", "value", "=", "expr", ".", "split", "(", "'='", ",", "1", ")", "try", ":", "value", "=", "parse_number_token", "(", "value", ")", "exce...
Parses a definition expression and returns a key-value pair as a tuple. Each definition expression should be in one of these two formats: * <variable>=<value> * <variable> :param expr: String expression to be parsed. :param default_value: (Default None) When a definiti...
[ "Parses", "a", "definition", "expression", "and", "returns", "a", "key", "-", "value", "pair", "as", "a", "tuple", "." ]
1e40853378d515c99f03b3f59efa9b943d26eb62
https://github.com/gorakhargosh/pepe/blob/1e40853378d515c99f03b3f59efa9b943d26eb62/pepe/__init__.py#L550-L621
238,187
gorakhargosh/pepe
pepe/__init__.py
parse_definitions
def parse_definitions(definitions): """ Parses a list of macro definitions and returns a "symbol table" as a dictionary. :params definitions: A list of command line macro definitions. Each item in the list should be in one of these two formats: * <variable>=<value> ...
python
def parse_definitions(definitions): """ Parses a list of macro definitions and returns a "symbol table" as a dictionary. :params definitions: A list of command line macro definitions. Each item in the list should be in one of these two formats: * <variable>=<value> ...
[ "def", "parse_definitions", "(", "definitions", ")", ":", "defines", "=", "{", "}", "if", "definitions", ":", "for", "definition", "in", "definitions", ":", "define", ",", "value", "=", "parse_definition_expr", "(", "definition", ",", "default_value", "=", "No...
Parses a list of macro definitions and returns a "symbol table" as a dictionary. :params definitions: A list of command line macro definitions. Each item in the list should be in one of these two formats: * <variable>=<value> * <variable> :return: ``dict`` a...
[ "Parses", "a", "list", "of", "macro", "definitions", "and", "returns", "a", "symbol", "table", "as", "a", "dictionary", "." ]
1e40853378d515c99f03b3f59efa9b943d26eb62
https://github.com/gorakhargosh/pepe/blob/1e40853378d515c99f03b3f59efa9b943d26eb62/pepe/__init__.py#L624-L662
238,188
gorakhargosh/pepe
pepe/__init__.py
set_up_logging
def set_up_logging(logger, level, should_be_quiet): """ Sets up logging for pepe. :param logger: The logger object to update. :param level: Logging level specified at command line. :param should_be_quiet: Boolean value for the -q option. :return: logging level ``...
python
def set_up_logging(logger, level, should_be_quiet): """ Sets up logging for pepe. :param logger: The logger object to update. :param level: Logging level specified at command line. :param should_be_quiet: Boolean value for the -q option. :return: logging level ``...
[ "def", "set_up_logging", "(", "logger", ",", "level", ",", "should_be_quiet", ")", ":", "LOGGING_LEVELS", "=", "{", "'DEBUG'", ":", "logging", ".", "DEBUG", ",", "'INFO'", ":", "logging", ".", "INFO", ",", "'WARNING'", ":", "logging", ".", "WARNING", ",", ...
Sets up logging for pepe. :param logger: The logger object to update. :param level: Logging level specified at command line. :param should_be_quiet: Boolean value for the -q option. :return: logging level ``int`` or None
[ "Sets", "up", "logging", "for", "pepe", "." ]
1e40853378d515c99f03b3f59efa9b943d26eb62
https://github.com/gorakhargosh/pepe/blob/1e40853378d515c99f03b3f59efa9b943d26eb62/pepe/__init__.py#L793-L829
238,189
gorakhargosh/pepe
pepe/__init__.py
main
def main(): """ Entry-point function. """ args = parse_command_line() logging_level = set_up_logging(logger, args.logging_level, args.should_be_quiet) defines = parse_definitions(args.definitions) try: content_types_db = ContentTypesDatabase(DEFAULT_CONTENT_TYPES_FILE) for ...
python
def main(): """ Entry-point function. """ args = parse_command_line() logging_level = set_up_logging(logger, args.logging_level, args.should_be_quiet) defines = parse_definitions(args.definitions) try: content_types_db = ContentTypesDatabase(DEFAULT_CONTENT_TYPES_FILE) for ...
[ "def", "main", "(", ")", ":", "args", "=", "parse_command_line", "(", ")", "logging_level", "=", "set_up_logging", "(", "logger", ",", "args", ".", "logging_level", ",", "args", ".", "should_be_quiet", ")", "defines", "=", "parse_definitions", "(", "args", "...
Entry-point function.
[ "Entry", "-", "point", "function", "." ]
1e40853378d515c99f03b3f59efa9b943d26eb62
https://github.com/gorakhargosh/pepe/blob/1e40853378d515c99f03b3f59efa9b943d26eb62/pepe/__init__.py#L832-L884
238,190
jammycakes/pyfactoryfactory
factoryfactory/__init__.py
ServiceLocator.register
def register(self, service, provider, singleton=False): """ Registers a service provider for a given service. @param service A key that identifies the service being registered. @param provider This is either the service being registered, or a callable that will ...
python
def register(self, service, provider, singleton=False): """ Registers a service provider for a given service. @param service A key that identifies the service being registered. @param provider This is either the service being registered, or a callable that will ...
[ "def", "register", "(", "self", ",", "service", ",", "provider", ",", "singleton", "=", "False", ")", ":", "def", "get_singleton", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "result", "=", "self", ".", "_get_singleton", "(", "service", ")", ...
Registers a service provider for a given service. @param service A key that identifies the service being registered. @param provider This is either the service being registered, or a callable that will either instantiate it or return it. @param singleton ...
[ "Registers", "a", "service", "provider", "for", "a", "given", "service", "." ]
64bfbd37f7aee4a710c4a8b750a971f88efdb7eb
https://github.com/jammycakes/pyfactoryfactory/blob/64bfbd37f7aee4a710c4a8b750a971f88efdb7eb/factoryfactory/__init__.py#L63-L93
238,191
avanwyk/cipy
cipy/algorithms/core.py
dictionary_based_metrics
def dictionary_based_metrics(metrics): """ Higher order function creating a result type and collection function from the given metrics. Args: metrics (iterable): Sequence of callable metrics, each accepting the algorithm state as parameter and returning the measured valu...
python
def dictionary_based_metrics(metrics): """ Higher order function creating a result type and collection function from the given metrics. Args: metrics (iterable): Sequence of callable metrics, each accepting the algorithm state as parameter and returning the measured valu...
[ "def", "dictionary_based_metrics", "(", "metrics", ")", ":", "def", "collect", "(", "results", ",", "state", ")", ":", "\"\"\"\n Measurement collection function for dictionary based metrics.\n\n Args:\n results (dict): Storing results of metrics.\n sta...
Higher order function creating a result type and collection function from the given metrics. Args: metrics (iterable): Sequence of callable metrics, each accepting the algorithm state as parameter and returning the measured value with its label: measurement(state) ->...
[ "Higher", "order", "function", "creating", "a", "result", "type", "and", "collection", "function", "from", "the", "given", "metrics", "." ]
98450dd01767b3615c113e50dc396f135e177b29
https://github.com/avanwyk/cipy/blob/98450dd01767b3615c113e50dc396f135e177b29/cipy/algorithms/core.py#L52-L94
238,192
avanwyk/cipy
cipy/algorithms/core.py
comparator
def comparator(objective): """ Higher order function creating a compare function for objectives. Args: objective (cipy.algorithms.core.Objective): The objective to create a compare for. Returns: callable: Function accepting two objectives to compare. Examples: ...
python
def comparator(objective): """ Higher order function creating a compare function for objectives. Args: objective (cipy.algorithms.core.Objective): The objective to create a compare for. Returns: callable: Function accepting two objectives to compare. Examples: ...
[ "def", "comparator", "(", "objective", ")", ":", "if", "isinstance", "(", "objective", ",", "Minimum", ")", ":", "return", "lambda", "l", ",", "r", ":", "l", "<", "r", "else", ":", "return", "lambda", "l", ",", "r", ":", "l", ">", "r" ]
Higher order function creating a compare function for objectives. Args: objective (cipy.algorithms.core.Objective): The objective to create a compare for. Returns: callable: Function accepting two objectives to compare. Examples: >>> a = Minimum(0.1) >>> b = Mi...
[ "Higher", "order", "function", "creating", "a", "compare", "function", "for", "objectives", "." ]
98450dd01767b3615c113e50dc396f135e177b29
https://github.com/avanwyk/cipy/blob/98450dd01767b3615c113e50dc396f135e177b29/cipy/algorithms/core.py#L145-L166
238,193
toumorokoshi/jenks
jenks/__init__.py
_get_jenks_config
def _get_jenks_config(): """ retrieve the jenks configuration object """ config_file = (get_configuration_file() or os.path.expanduser(os.path.join("~", CONFIG_FILE_NAME))) if not os.path.exists(config_file): open(config_file, 'w').close() with open(config_file, 'r') as fh: ...
python
def _get_jenks_config(): """ retrieve the jenks configuration object """ config_file = (get_configuration_file() or os.path.expanduser(os.path.join("~", CONFIG_FILE_NAME))) if not os.path.exists(config_file): open(config_file, 'w').close() with open(config_file, 'r') as fh: ...
[ "def", "_get_jenks_config", "(", ")", ":", "config_file", "=", "(", "get_configuration_file", "(", ")", "or", "os", ".", "path", ".", "expanduser", "(", "os", ".", "path", ".", "join", "(", "\"~\"", ",", "CONFIG_FILE_NAME", ")", ")", ")", "if", "not", ...
retrieve the jenks configuration object
[ "retrieve", "the", "jenks", "configuration", "object" ]
d3333a7b86ba290b7185aa5b8da75e76a28124f5
https://github.com/toumorokoshi/jenks/blob/d3333a7b86ba290b7185aa5b8da75e76a28124f5/jenks/__init__.py#L59-L71
238,194
JukeboxPipeline/jukebox-core
src/jukeboxcore/gui/widgets/textedit.py
JB_PlainTextEdit.set_placeholder
def set_placeholder(self, text): """Set the placeholder text that will be displayed when the text is empty and the widget is out of focus :param text: The text for the placeholder :type text: str :raises: None """ if self._placeholder != text: self._p...
python
def set_placeholder(self, text): """Set the placeholder text that will be displayed when the text is empty and the widget is out of focus :param text: The text for the placeholder :type text: str :raises: None """ if self._placeholder != text: self._p...
[ "def", "set_placeholder", "(", "self", ",", "text", ")", ":", "if", "self", ".", "_placeholder", "!=", "text", ":", "self", ".", "_placeholder", "=", "text", "if", "not", "self", ".", "hasFocus", "(", ")", ":", "self", ".", "update", "(", ")" ]
Set the placeholder text that will be displayed when the text is empty and the widget is out of focus :param text: The text for the placeholder :type text: str :raises: None
[ "Set", "the", "placeholder", "text", "that", "will", "be", "displayed", "when", "the", "text", "is", "empty", "and", "the", "widget", "is", "out", "of", "focus" ]
bac2280ca49940355270e4b69400ce9976ab2e6f
https://github.com/JukeboxPipeline/jukebox-core/blob/bac2280ca49940355270e4b69400ce9976ab2e6f/src/jukeboxcore/gui/widgets/textedit.py#L30-L41
238,195
JukeboxPipeline/jukebox-core
src/jukeboxcore/gui/widgets/textedit.py
JB_PlainTextEdit.paintEvent
def paintEvent(self, event): """Paint the widget :param event: :type event: :returns: None :rtype: None :raises: None """ if not self.toPlainText() and not self.hasFocus() and self._placeholder: p = QtGui.QPainter(self.viewport()) ...
python
def paintEvent(self, event): """Paint the widget :param event: :type event: :returns: None :rtype: None :raises: None """ if not self.toPlainText() and not self.hasFocus() and self._placeholder: p = QtGui.QPainter(self.viewport()) ...
[ "def", "paintEvent", "(", "self", ",", "event", ")", ":", "if", "not", "self", ".", "toPlainText", "(", ")", "and", "not", "self", ".", "hasFocus", "(", ")", "and", "self", ".", "_placeholder", ":", "p", "=", "QtGui", ".", "QPainter", "(", "self", ...
Paint the widget :param event: :type event: :returns: None :rtype: None :raises: None
[ "Paint", "the", "widget" ]
bac2280ca49940355270e4b69400ce9976ab2e6f
https://github.com/JukeboxPipeline/jukebox-core/blob/bac2280ca49940355270e4b69400ce9976ab2e6f/src/jukeboxcore/gui/widgets/textedit.py#L43-L62
238,196
emilydolson/avida-spatial-tools
avidaspatial/environment_file_components.py
calcEvenAnchors
def calcEvenAnchors(args): """ Calculates anchor points evenly spaced across the world, given user-specified parameters. Note: May not be exactly even if world size is not divisible by patches+1. Note: Eveness is based on bounded world, not toroidal. """ anchors = [] dist = int((arg...
python
def calcEvenAnchors(args): """ Calculates anchor points evenly spaced across the world, given user-specified parameters. Note: May not be exactly even if world size is not divisible by patches+1. Note: Eveness is based on bounded world, not toroidal. """ anchors = [] dist = int((arg...
[ "def", "calcEvenAnchors", "(", "args", ")", ":", "anchors", "=", "[", "]", "dist", "=", "int", "(", "(", "args", ".", "worldSize", ")", "/", "(", "args", ".", "patchesPerSide", "+", "1", ")", ")", "for", "i", "in", "range", "(", "dist", ",", "arg...
Calculates anchor points evenly spaced across the world, given user-specified parameters. Note: May not be exactly even if world size is not divisible by patches+1. Note: Eveness is based on bounded world, not toroidal.
[ "Calculates", "anchor", "points", "evenly", "spaced", "across", "the", "world", "given", "user", "-", "specified", "parameters", "." ]
7beb0166ccefad5fa722215b030ac2a53d62b59e
https://github.com/emilydolson/avida-spatial-tools/blob/7beb0166ccefad5fa722215b030ac2a53d62b59e/avidaspatial/environment_file_components.py#L63-L77
238,197
emilydolson/avida-spatial-tools
avidaspatial/environment_file_components.py
calcRandomAnchors
def calcRandomAnchors(args, inworld=True): """ Generates a list of random anchor points such that all circles will fit in the world, given the specified radius and worldsize. The number of anchors to generate is given by nPatches """ anchors = [] rng = (args.patchRadius, args.worldSize - arg...
python
def calcRandomAnchors(args, inworld=True): """ Generates a list of random anchor points such that all circles will fit in the world, given the specified radius and worldsize. The number of anchors to generate is given by nPatches """ anchors = [] rng = (args.patchRadius, args.worldSize - arg...
[ "def", "calcRandomAnchors", "(", "args", ",", "inworld", "=", "True", ")", ":", "anchors", "=", "[", "]", "rng", "=", "(", "args", ".", "patchRadius", ",", "args", ".", "worldSize", "-", "args", ".", "patchRadius", ")", "if", "not", "inworld", ":", "...
Generates a list of random anchor points such that all circles will fit in the world, given the specified radius and worldsize. The number of anchors to generate is given by nPatches
[ "Generates", "a", "list", "of", "random", "anchor", "points", "such", "that", "all", "circles", "will", "fit", "in", "the", "world", "given", "the", "specified", "radius", "and", "worldsize", ".", "The", "number", "of", "anchors", "to", "generate", "is", "...
7beb0166ccefad5fa722215b030ac2a53d62b59e
https://github.com/emilydolson/avida-spatial-tools/blob/7beb0166ccefad5fa722215b030ac2a53d62b59e/avidaspatial/environment_file_components.py#L80-L94
238,198
emilydolson/avida-spatial-tools
avidaspatial/environment_file_components.py
pairwise_point_combinations
def pairwise_point_combinations(xs, ys, anchors): """ Does an in-place addition of the four points that can be composed by combining coordinates from the two lists to the given list of anchors """ for i in xs: anchors.append((i, max(ys))) anchors.append((i, min(ys))) for i in ys:...
python
def pairwise_point_combinations(xs, ys, anchors): """ Does an in-place addition of the four points that can be composed by combining coordinates from the two lists to the given list of anchors """ for i in xs: anchors.append((i, max(ys))) anchors.append((i, min(ys))) for i in ys:...
[ "def", "pairwise_point_combinations", "(", "xs", ",", "ys", ",", "anchors", ")", ":", "for", "i", "in", "xs", ":", "anchors", ".", "append", "(", "(", "i", ",", "max", "(", "ys", ")", ")", ")", "anchors", ".", "append", "(", "(", "i", ",", "min",...
Does an in-place addition of the four points that can be composed by combining coordinates from the two lists to the given list of anchors
[ "Does", "an", "in", "-", "place", "addition", "of", "the", "four", "points", "that", "can", "be", "composed", "by", "combining", "coordinates", "from", "the", "two", "lists", "to", "the", "given", "list", "of", "anchors" ]
7beb0166ccefad5fa722215b030ac2a53d62b59e
https://github.com/emilydolson/avida-spatial-tools/blob/7beb0166ccefad5fa722215b030ac2a53d62b59e/avidaspatial/environment_file_components.py#L97-L107
238,199
emilydolson/avida-spatial-tools
avidaspatial/environment_file_components.py
calcTightAnchors
def calcTightAnchors(args, d, patches): """ Recursively generates the number of anchor points specified in the patches argument, such that all patches are d cells away from their nearest neighbors. """ centerPoint = (int(args.worldSize/2), int(args.worldSize/2)) anchors = [] if patches =...
python
def calcTightAnchors(args, d, patches): """ Recursively generates the number of anchor points specified in the patches argument, such that all patches are d cells away from their nearest neighbors. """ centerPoint = (int(args.worldSize/2), int(args.worldSize/2)) anchors = [] if patches =...
[ "def", "calcTightAnchors", "(", "args", ",", "d", ",", "patches", ")", ":", "centerPoint", "=", "(", "int", "(", "args", ".", "worldSize", "/", "2", ")", ",", "int", "(", "args", ".", "worldSize", "/", "2", ")", ")", "anchors", "=", "[", "]", "if...
Recursively generates the number of anchor points specified in the patches argument, such that all patches are d cells away from their nearest neighbors.
[ "Recursively", "generates", "the", "number", "of", "anchor", "points", "specified", "in", "the", "patches", "argument", "such", "that", "all", "patches", "are", "d", "cells", "away", "from", "their", "nearest", "neighbors", "." ]
7beb0166ccefad5fa722215b030ac2a53d62b59e
https://github.com/emilydolson/avida-spatial-tools/blob/7beb0166ccefad5fa722215b030ac2a53d62b59e/avidaspatial/environment_file_components.py#L133-L167