code stringlengths 66 870k | docstring stringlengths 19 26.7k | func_name stringlengths 1 138 | language stringclasses 1
value | repo stringlengths 7 68 | path stringlengths 5 324 | url stringlengths 46 389 | license stringclasses 7
values |
|---|---|---|---|---|---|---|---|
def remove(self):
"""Removes this graph as well as child graphs. Deepest graphs will be removed first
"""
# graphs should be removed from leafs to root
for childGraph in set(self.childGraphs):
childGraph.remove()
# remove itself
self.graphManager.removeGraph(s... | Removes this graph as well as child graphs. Deepest graphs will be removed first
| remove | python | pedroCabrera/PyFlow | PyFlow/Core/GraphBase.py | https://github.com/pedroCabrera/PyFlow/blob/master/PyFlow/Core/GraphBase.py | Apache-2.0 |
def clear(self):
"""Clears content of this graph as well as child graphs. Deepest graphs will be cleared first
"""
# graphs should be cleared from leafs to root
for childGraph in set(self.childGraphs):
childGraph.clear()
# clear itself
for node in list(self._... | Clears content of this graph as well as child graphs. Deepest graphs will be cleared first
| clear | python | pedroCabrera/PyFlow | PyFlow/Core/GraphBase.py | https://github.com/pedroCabrera/PyFlow/blob/master/PyFlow/Core/GraphBase.py | Apache-2.0 |
def createVariable(
self,
dataType=str("AnyPin"),
accessLevel=AccessLevel.public,
uid=None,
name=str("var"),
):
"""Creates variable inside this graph scope
:param dataType: Variable data type
:type dataType: str
:param accessLevel: Variable ac... | Creates variable inside this graph scope
:param dataType: Variable data type
:type dataType: str
:param accessLevel: Variable access level
:type accessLevel: :class:`~PyFlow.Core.Common.AccessLevel`
:param uid: Variable unique identifier
:type uid: :class:`uuid.UUID`
... | createVariable | python | pedroCabrera/PyFlow | PyFlow/Core/GraphBase.py | https://github.com/pedroCabrera/PyFlow/blob/master/PyFlow/Core/GraphBase.py | Apache-2.0 |
def killVariable(self, var):
"""Removes variable from this graph
:param var: Variable to remove
:type var: :class:`~PyFlow.Core.Variable.Variable`
"""
assert isinstance(var, Variable)
if var.uid in self._vars:
popped = self._vars.pop(var.uid)
popp... | Removes variable from this graph
:param var: Variable to remove
:type var: :class:`~PyFlow.Core.Variable.Variable`
| killVariable | python | pedroCabrera/PyFlow | PyFlow/Core/GraphBase.py | https://github.com/pedroCabrera/PyFlow/blob/master/PyFlow/Core/GraphBase.py | Apache-2.0 |
def getNodesList(self, classNameFilters=None):
"""Returns this graph's nodes list
:rtype: list(:class:`~PyFlow.Core.NodeBase.NodeBase`)
"""
if classNameFilters is None:
classNameFilters = []
if len(classNameFilters) > 0:
return [
n
... | Returns this graph's nodes list
:rtype: list(:class:`~PyFlow.Core.NodeBase.NodeBase`)
| getNodesList | python | pedroCabrera/PyFlow | PyFlow/Core/GraphBase.py | https://github.com/pedroCabrera/PyFlow/blob/master/PyFlow/Core/GraphBase.py | Apache-2.0 |
def findNode(self, name):
"""Tries to find node by name
:param name: Node name
:type name: str or None
"""
for i in self._nodes.values():
if i.name == name:
return i
return None | Tries to find node by name
:param name: Node name
:type name: str or None
| findNode | python | pedroCabrera/PyFlow | PyFlow/Core/GraphBase.py | https://github.com/pedroCabrera/PyFlow/blob/master/PyFlow/Core/GraphBase.py | Apache-2.0 |
def getNodesByClassName(self, className):
"""Returns a list of nodes filtered by class name
:param className: Class name of target nodes
:type className: str
:rtype: list(:class:`~PyFlow.Core.NodeBase.NodeBase`)
"""
nodes = []
for i in self.getNodesList():
... | Returns a list of nodes filtered by class name
:param className: Class name of target nodes
:type className: str
:rtype: list(:class:`~PyFlow.Core.NodeBase.NodeBase`)
| getNodesByClassName | python | pedroCabrera/PyFlow | PyFlow/Core/GraphBase.py | https://github.com/pedroCabrera/PyFlow/blob/master/PyFlow/Core/GraphBase.py | Apache-2.0 |
def findPinByUid(self, uid):
"""Tries to find pin by uuid
:param uid: Unique identifier
:type uid: :class:`~uuid.UUID`
:rtype: :class:`~PyFlow.Core.PinBase.PinBase` or None
"""
pin = None
if uid in self.pins:
pin = self.pins[uid]
return pin | Tries to find pin by uuid
:param uid: Unique identifier
:type uid: :class:`~uuid.UUID`
:rtype: :class:`~PyFlow.Core.PinBase.PinBase` or None
| findPinByUid | python | pedroCabrera/PyFlow | PyFlow/Core/GraphBase.py | https://github.com/pedroCabrera/PyFlow/blob/master/PyFlow/Core/GraphBase.py | Apache-2.0 |
def findPin(self, pinName):
"""Tries to find pin by name
:param pinName: String to search by
:type pinName: str
:rtype: :class:`~PyFlow.Core.PinBase.PinBase` or None
"""
result = None
for pin in self.pins.values():
if pinName == pin.getFullName():
... | Tries to find pin by name
:param pinName: String to search by
:type pinName: str
:rtype: :class:`~PyFlow.Core.PinBase.PinBase` or None
| findPin | python | pedroCabrera/PyFlow | PyFlow/Core/GraphBase.py | https://github.com/pedroCabrera/PyFlow/blob/master/PyFlow/Core/GraphBase.py | Apache-2.0 |
def getInputNode(self):
"""Creates and adds to graph :class:`~PyFlow.Packages.PyFlowBase.Nodes.graphNodes.graphInputs` node
pins on this node will be exposed on compound node as input pins
:rtype: :class:`~PyFlow.Core.NodeBase.NodeBase`
"""
node = getRawNodeInstance("graphInputs... | Creates and adds to graph :class:`~PyFlow.Packages.PyFlowBase.Nodes.graphNodes.graphInputs` node
pins on this node will be exposed on compound node as input pins
:rtype: :class:`~PyFlow.Core.NodeBase.NodeBase`
| getInputNode | python | pedroCabrera/PyFlow | PyFlow/Core/GraphBase.py | https://github.com/pedroCabrera/PyFlow/blob/master/PyFlow/Core/GraphBase.py | Apache-2.0 |
def getOutputNode(self):
"""Creates and adds to graph :class:`~PyFlow.Packages.PyFlowBase.Nodes.graphNodes.graphOutputs` node.
pins on this node will be exposed on compound node as output pins
:rtype: :class:`~PyFlow.Core.NodeBase.NodeBase`
"""
node = getRawNodeInstance("graphOu... | Creates and adds to graph :class:`~PyFlow.Packages.PyFlowBase.Nodes.graphNodes.graphOutputs` node.
pins on this node will be exposed on compound node as output pins
:rtype: :class:`~PyFlow.Core.NodeBase.NodeBase`
| getOutputNode | python | pedroCabrera/PyFlow | PyFlow/Core/GraphBase.py | https://github.com/pedroCabrera/PyFlow/blob/master/PyFlow/Core/GraphBase.py | Apache-2.0 |
def addNode(self, node, jsonTemplate=None):
"""Adds node to storage
:param node: Node to add
:type node: NodeBase
:param jsonTemplate: serialized representation of node. This used when graph deserialized to do custom stuff after node will be added.
:type jsonTemplate: dict
... | Adds node to storage
:param node: Node to add
:type node: NodeBase
:param jsonTemplate: serialized representation of node. This used when graph deserialized to do custom stuff after node will be added.
:type jsonTemplate: dict
:rtype: bool
| addNode | python | pedroCabrera/PyFlow | PyFlow/Core/GraphBase.py | https://github.com/pedroCabrera/PyFlow/blob/master/PyFlow/Core/GraphBase.py | Apache-2.0 |
def location(self):
"""Returns path to current location in graph tree
Example:
>>> ["root", "compound1", "compound2"]
means:
>>> # root
>>> # |- compound
>>> # |- compound2
:rtype: list(str)
"""
result = [self.name]
parent =... | Returns path to current location in graph tree
Example:
>>> ["root", "compound1", "compound2"]
means:
>>> # root
>>> # |- compound
>>> # |- compound2
:rtype: list(str)
| location | python | pedroCabrera/PyFlow | PyFlow/Core/GraphBase.py | https://github.com/pedroCabrera/PyFlow/blob/master/PyFlow/Core/GraphBase.py | Apache-2.0 |
def plot(self):
"""Prints graph to console. May be useful for debugging
"""
depth = self.depth()
prefix = "".join(["-"] * depth) if depth > 1 else ""
parentGraphString = (
str(None) if self.parentGraph is None else self.parentGraph.name
)
print(prefix ... | Prints graph to console. May be useful for debugging
| plot | python | pedroCabrera/PyFlow | PyFlow/Core/GraphBase.py | https://github.com/pedroCabrera/PyFlow/blob/master/PyFlow/Core/GraphBase.py | Apache-2.0 |
def findRootGraph(self):
"""Returns top level root graph
:rtype: :class:`~PyFlow.Core.GraphBase.GraphBase`
"""
roots = []
for graph in self.getAllGraphs():
if graph.isRoot():
roots.append(graph)
assert len(roots) == 1, "Fatal! Multiple roots!"... | Returns top level root graph
:rtype: :class:`~PyFlow.Core.GraphBase.GraphBase`
| findRootGraph | python | pedroCabrera/PyFlow | PyFlow/Core/GraphManager.py | https://github.com/pedroCabrera/PyFlow/blob/master/PyFlow/Core/GraphManager.py | Apache-2.0 |
def serialize(self):
"""Serializes itself to json.
All child graphs will be serialized.
:rtype: dict
"""
rootGraph = self.findRootGraph()
saved = rootGraph.serialize()
saved["fileVersion"] = str(version.currentVersion())
saved["activeGraph"] = self.activ... | Serializes itself to json.
All child graphs will be serialized.
:rtype: dict
| serialize | python | pedroCabrera/PyFlow | PyFlow/Core/GraphManager.py | https://github.com/pedroCabrera/PyFlow/blob/master/PyFlow/Core/GraphManager.py | Apache-2.0 |
def removeGraphByName(self, name):
"""Removes graph by :attr:`~PyFlow.Core.GraphBase.GraphBase.name`
:param name: name of graph to be removed
:type name: str
"""
graph = self.findGraph(name)
if graph is not None:
graph.clear()
self._graphs.pop(gra... | Removes graph by :attr:`~PyFlow.Core.GraphBase.GraphBase.name`
:param name: name of graph to be removed
:type name: str
| removeGraphByName | python | pedroCabrera/PyFlow | PyFlow/Core/GraphManager.py | https://github.com/pedroCabrera/PyFlow/blob/master/PyFlow/Core/GraphManager.py | Apache-2.0 |
def removeGraph(self, graph):
"""Removes supplied graph
:param graph: Graph to be removed
:type graph: :class:`~PyFlow.Core.GraphBase.GraphBase`
"""
if graph.uid in self._graphs:
graph.clear()
self._graphs.pop(graph.uid)
if graph.parentGraph i... | Removes supplied graph
:param graph: Graph to be removed
:type graph: :class:`~PyFlow.Core.GraphBase.GraphBase`
| removeGraph | python | pedroCabrera/PyFlow | PyFlow/Core/GraphManager.py | https://github.com/pedroCabrera/PyFlow/blob/master/PyFlow/Core/GraphManager.py | Apache-2.0 |
def deserialize(self, data):
"""Populates itself from serialized data
:param data: Serialized data
:type data: dict
"""
if "fileVersion" in data:
fileVersion = version.Version.fromString(data["fileVersion"]) # TODO: find purpose
else:
# handle ol... | Populates itself from serialized data
:param data: Serialized data
:type data: dict
| deserialize | python | pedroCabrera/PyFlow | PyFlow/Core/GraphManager.py | https://github.com/pedroCabrera/PyFlow/blob/master/PyFlow/Core/GraphManager.py | Apache-2.0 |
def clear(self, keepRoot=True, *args, **kwargs):
"""Wipes everything.
:param keepRoot: Whether to remove root graph or not
:type keepRoot: bool
"""
self.selectGraphByName(ROOT_GRAPH_NAME)
self.removeGraphByName(ROOT_GRAPH_NAME)
self._graphs.clear()
self._... | Wipes everything.
:param keepRoot: Whether to remove root graph or not
:type keepRoot: bool
| clear | python | pedroCabrera/PyFlow | PyFlow/Core/GraphManager.py | https://github.com/pedroCabrera/PyFlow/blob/master/PyFlow/Core/GraphManager.py | Apache-2.0 |
def findVariableRefs(self, variable):
"""Returns a list of variable accessors spawned across all graphs
:param variable: Variable to search accessors for
:type variable: :class:`~PyFlow.Core.Variable.Variable`
:rtype: list(:class:`~PyFlow.Core.NodeBase.NodeBase`)
"""
res... | Returns a list of variable accessors spawned across all graphs
:param variable: Variable to search accessors for
:type variable: :class:`~PyFlow.Core.Variable.Variable`
:rtype: list(:class:`~PyFlow.Core.NodeBase.NodeBase`)
| findVariableRefs | python | pedroCabrera/PyFlow | PyFlow/Core/GraphManager.py | https://github.com/pedroCabrera/PyFlow/blob/master/PyFlow/Core/GraphManager.py | Apache-2.0 |
def findGraph(self, name):
"""Tries to find graph by :attr:`~PyFlow.Core.GraphBase.GraphBase.name`
:param name: Name of target graph
:type name: str
:rtype: :class:`~PyFlow.Core.GraphBase.GraphBase` or None
"""
graphs = self.getGraphsDict()
if name in graphs:
... | Tries to find graph by :attr:`~PyFlow.Core.GraphBase.GraphBase.name`
:param name: Name of target graph
:type name: str
:rtype: :class:`~PyFlow.Core.GraphBase.GraphBase` or None
| findGraph | python | pedroCabrera/PyFlow | PyFlow/Core/GraphManager.py | https://github.com/pedroCabrera/PyFlow/blob/master/PyFlow/Core/GraphManager.py | Apache-2.0 |
def findPinByName(self, pinFullName):
"""Tries to find pin by name across all graphs
:param pinFullName: Full name of pin including node namespace
:type pinFullName: str
:rtype: :class:`~PyFlow.Core.PinBase.PinBase` or None
"""
result = None
for graph in self.get... | Tries to find pin by name across all graphs
:param pinFullName: Full name of pin including node namespace
:type pinFullName: str
:rtype: :class:`~PyFlow.Core.PinBase.PinBase` or None
| findPinByName | python | pedroCabrera/PyFlow | PyFlow/Core/GraphManager.py | https://github.com/pedroCabrera/PyFlow/blob/master/PyFlow/Core/GraphManager.py | Apache-2.0 |
def findNode(self, name):
"""Finds a node across all graphs
:param name: Node name to search by
:type name: str
:rtype: :class:`~PyFlow.Core.NodeBase.NodeBase`
"""
result = None
for graph in self.getAllGraphs():
result = graph.findNode(name)
... | Finds a node across all graphs
:param name: Node name to search by
:type name: str
:rtype: :class:`~PyFlow.Core.NodeBase.NodeBase`
| findNode | python | pedroCabrera/PyFlow | PyFlow/Core/GraphManager.py | https://github.com/pedroCabrera/PyFlow/blob/master/PyFlow/Core/GraphManager.py | Apache-2.0 |
def findVariableByUid(self, uuid):
"""Finds a variable across all graphs
:param uuid: Variable unique identifier
:type uuid: :class:`~uuid.UUID`
:rtype: :class:`~PyFlow.Core.Variable.Variable` or None
"""
result = None
for graph in self._graphs.values():
... | Finds a variable across all graphs
:param uuid: Variable unique identifier
:type uuid: :class:`~uuid.UUID`
:rtype: :class:`~PyFlow.Core.Variable.Variable` or None
| findVariableByUid | python | pedroCabrera/PyFlow | PyFlow/Core/GraphManager.py | https://github.com/pedroCabrera/PyFlow/blob/master/PyFlow/Core/GraphManager.py | Apache-2.0 |
def findVariableByName(self, name):
"""Finds a variable across all graphs
:param name: Variable name
:type name: str
:rtype: :class:`~PyFlow.Core.Variable.Variable` or None
"""
for graph in self._graphs.values():
for var in graph.getVars().values():
... | Finds a variable across all graphs
:param name: Variable name
:type name: str
:rtype: :class:`~PyFlow.Core.Variable.Variable` or None
| findVariableByName | python | pedroCabrera/PyFlow | PyFlow/Core/GraphManager.py | https://github.com/pedroCabrera/PyFlow/blob/master/PyFlow/Core/GraphManager.py | Apache-2.0 |
def getGraphsDict(self):
"""Creates and returns dictionary where graph name associated with graph
:rtype: dict(str, :class:`~PyFlow.Core.GraphBase.GraphBase`)
"""
result = {}
for graph in self.getAllGraphs():
result[graph.name] = graph
return result | Creates and returns dictionary where graph name associated with graph
:rtype: dict(str, :class:`~PyFlow.Core.GraphBase.GraphBase`)
| getGraphsDict | python | pedroCabrera/PyFlow | PyFlow/Core/GraphManager.py | https://github.com/pedroCabrera/PyFlow/blob/master/PyFlow/Core/GraphManager.py | Apache-2.0 |
def add(self, graph):
"""Adds graph to storage and ensures that graph name is unique
:param graph: Graph to add
:type graph: :class:`~PyFlow.Core.GraphBase.GraphBase`
"""
graph.name = self.getUniqGraphName(graph.name)
self._graphs[graph.uid] = graph | Adds graph to storage and ensures that graph name is unique
:param graph: Graph to add
:type graph: :class:`~PyFlow.Core.GraphBase.GraphBase`
| add | python | pedroCabrera/PyFlow | PyFlow/Core/GraphManager.py | https://github.com/pedroCabrera/PyFlow/blob/master/PyFlow/Core/GraphManager.py | Apache-2.0 |
def selectGraphByName(self, name):
"""Sets active graph by graph name and fires event
:param name: Name of target graph
:type name: str
"""
graphs = self.getGraphsDict()
if name in graphs:
if name != self.activeGraph().name:
newGraph = graphs[... | Sets active graph by graph name and fires event
:param name: Name of target graph
:type name: str
| selectGraphByName | python | pedroCabrera/PyFlow | PyFlow/Core/GraphManager.py | https://github.com/pedroCabrera/PyFlow/blob/master/PyFlow/Core/GraphManager.py | Apache-2.0 |
def selectGraph(self, graph):
"""Sets supplied graph as active and fires event
:param graph: Target graph
:type graph: :class:`~PyFlow.Core.GraphBase.GraphBase`
"""
for newGraph in self.getAllGraphs():
if newGraph.name == graph.name:
if newGraph.name ... | Sets supplied graph as active and fires event
:param graph: Target graph
:type graph: :class:`~PyFlow.Core.GraphBase.GraphBase`
| selectGraph | python | pedroCabrera/PyFlow | PyFlow/Core/GraphManager.py | https://github.com/pedroCabrera/PyFlow/blob/master/PyFlow/Core/GraphManager.py | Apache-2.0 |
def getAllNodes(self, classNameFilters=None):
"""Returns all nodes across all graphs
:param classNameFilters: If class name filters specified, only those node classes will be considered
:type classNameFilters: list(str)
:rtype: list(:class:`~PyFlow.Core.NodeBase.NodeBase`)
"""
... | Returns all nodes across all graphs
:param classNameFilters: If class name filters specified, only those node classes will be considered
:type classNameFilters: list(str)
:rtype: list(:class:`~PyFlow.Core.NodeBase.NodeBase`)
| getAllNodes | python | pedroCabrera/PyFlow | PyFlow/Core/GraphManager.py | https://github.com/pedroCabrera/PyFlow/blob/master/PyFlow/Core/GraphManager.py | Apache-2.0 |
def getAllVariables(self):
"""Returns a list of all variables
:rtype: list(:class:`~PyFlow.Core.Variable.Variable`)
"""
result = []
for graph in self.getAllGraphs():
result.extend(list(graph.getVars().values()))
return result | Returns a list of all variables
:rtype: list(:class:`~PyFlow.Core.Variable.Variable`)
| getAllVariables | python | pedroCabrera/PyFlow | PyFlow/Core/GraphManager.py | https://github.com/pedroCabrera/PyFlow/blob/master/PyFlow/Core/GraphManager.py | Apache-2.0 |
def getUniqGraphPinName(graph, name):
"""Returns unique pin name for graph
Used by compound node and graphInputs graphOutputs nodes.
To make all exposed to compound pins names unique.
:param graph: Target graph
:type graph: :class:`~PyFlow.Core.GraphBase.GraphBase`
:par... | Returns unique pin name for graph
Used by compound node and graphInputs graphOutputs nodes.
To make all exposed to compound pins names unique.
:param graph: Target graph
:type graph: :class:`~PyFlow.Core.GraphBase.GraphBase`
:param name: Target pin name
:type name: str
... | getUniqGraphPinName | python | pedroCabrera/PyFlow | PyFlow/Core/GraphManager.py | https://github.com/pedroCabrera/PyFlow/blob/master/PyFlow/Core/GraphManager.py | Apache-2.0 |
def getAllNames(self):
"""Returns list of all registered names
Includes graphs, nodes, pins, variables names
:rtype: list(str)
"""
existingNames = [g.name for g in self.getAllGraphs()]
existingNames.extend([n.name for n in self.getAllNodes()])
existingNames.exte... | Returns list of all registered names
Includes graphs, nodes, pins, variables names
:rtype: list(str)
| getAllNames | python | pedroCabrera/PyFlow | PyFlow/Core/GraphManager.py | https://github.com/pedroCabrera/PyFlow/blob/master/PyFlow/Core/GraphManager.py | Apache-2.0 |
def getUniqName(self, name):
"""Returns unique name
:param name: Source name
:type name: str
:rtype: str
"""
existingNames = self.getAllNames()
return getUniqNameFromList(existingNames, name) | Returns unique name
:param name: Source name
:type name: str
:rtype: str
| getUniqName | python | pedroCabrera/PyFlow | PyFlow/Core/GraphManager.py | https://github.com/pedroCabrera/PyFlow/blob/master/PyFlow/Core/GraphManager.py | Apache-2.0 |
def getUniqGraphName(self, name):
"""Returns unique graph name
:param name: Source name
:type name: str
:rtype: str
"""
existingNames = [g.name for g in self.getAllGraphs()]
return getUniqNameFromList(existingNames, name) | Returns unique graph name
:param name: Source name
:type name: str
:rtype: str
| getUniqGraphName | python | pedroCabrera/PyFlow | PyFlow/Core/GraphManager.py | https://github.com/pedroCabrera/PyFlow/blob/master/PyFlow/Core/GraphManager.py | Apache-2.0 |
def getUniqNodeName(self, name):
"""Returns unique node name
:param name: Source name
:type name: str
:rtype: str
"""
existingNames = [n.name for n in self.getAllNodes()]
return getUniqNameFromList(existingNames, name) | Returns unique node name
:param name: Source name
:type name: str
:rtype: str
| getUniqNodeName | python | pedroCabrera/PyFlow | PyFlow/Core/GraphManager.py | https://github.com/pedroCabrera/PyFlow/blob/master/PyFlow/Core/GraphManager.py | Apache-2.0 |
def getUniqVariableName(self, name):
"""Returns unique variable name
:param name: Source name
:type name: str
:rtype: str
"""
existingNames = [var.name for var in self.getAllVariables()]
return getUniqNameFromList(existingNames, name) | Returns unique variable name
:param name: Source name
:type name: str
:rtype: str
| getUniqVariableName | python | pedroCabrera/PyFlow | PyFlow/Core/GraphManager.py | https://github.com/pedroCabrera/PyFlow/blob/master/PyFlow/Core/GraphManager.py | Apache-2.0 |
def plot(self):
"""Prints all data to console. May be useful for debugging
"""
root = self.findRootGraph()
print(
"Active graph: {0}".format(str(self.activeGraph().name)),
"All graphs:",
[g.name for g in self._graphs.values()],
)
root.p... | Prints all data to console. May be useful for debugging
| plot | python | pedroCabrera/PyFlow | PyFlow/Core/GraphManager.py | https://github.com/pedroCabrera/PyFlow/blob/master/PyFlow/Core/GraphManager.py | Apache-2.0 |
def serialize(self, *args, **Kwargs):
"""Implements how item will be serialized
:raises NotImplementedError: If not implemented
"""
raise NotImplementedError(
"serialize method of ISerializable is not implemented"
) | Implements how item will be serialized
:raises NotImplementedError: If not implemented
| serialize | python | pedroCabrera/PyFlow | PyFlow/Core/Interfaces.py | https://github.com/pedroCabrera/PyFlow/blob/master/PyFlow/Core/Interfaces.py | Apache-2.0 |
def deserialize(self, jsonData):
"""Implements how item will be deserialized
:raises NotImplementedError: If not implemented
"""
raise NotImplementedError(
"deserialize method of ISerializable is not implemented"
) | Implements how item will be deserialized
:raises NotImplementedError: If not implemented
| deserialize | python | pedroCabrera/PyFlow | PyFlow/Core/Interfaces.py | https://github.com/pedroCabrera/PyFlow/blob/master/PyFlow/Core/Interfaces.py | Apache-2.0 |
def internalDataStructure():
"""Static hint of what real python type is this pin
:rtype: object
:raises NotImplementedError: If not implemented
"""
raise NotImplementedError(
"internalDataStructure method of IPin is not implemented"
) | Static hint of what real python type is this pin
:rtype: object
:raises NotImplementedError: If not implemented
| internalDataStructure | python | pedroCabrera/PyFlow | PyFlow/Core/Interfaces.py | https://github.com/pedroCabrera/PyFlow/blob/master/PyFlow/Core/Interfaces.py | Apache-2.0 |
def supportedDataTypes():
"""List of supported data types
List of data types that can be cast to this type. For example - int can support float, or vector3 can support vector4 etc.
:rtype: list(object)
:raises NotImplementedError: If not implemented
"""
raise NotImpleme... | List of supported data types
List of data types that can be cast to this type. For example - int can support float, or vector3 can support vector4 etc.
:rtype: list(object)
:raises NotImplementedError: If not implemented
| supportedDataTypes | python | pedroCabrera/PyFlow | PyFlow/Core/Interfaces.py | https://github.com/pedroCabrera/PyFlow/blob/master/PyFlow/Core/Interfaces.py | Apache-2.0 |
def inputs(self):
"""Returns all input pins. Dictionary generated every time property called, so cache it when possible.
"""
result = OrderedDict()
for pin in self.pins:
if pin.direction == PinDirection.Input:
result[pin.uid] = pin
return result | Returns all input pins. Dictionary generated every time property called, so cache it when possible.
| inputs | python | pedroCabrera/PyFlow | PyFlow/Core/NodeBase.py | https://github.com/pedroCabrera/PyFlow/blob/master/PyFlow/Core/NodeBase.py | Apache-2.0 |
def namePinInputsMap(self):
"""Returns all input pins. Dictionary generated every time property called, so cache it when possible.
"""
result = OrderedDict()
for pin in self.pins:
if pin.direction == PinDirection.Input:
result[pin.name] = pin
return re... | Returns all input pins. Dictionary generated every time property called, so cache it when possible.
| namePinInputsMap | python | pedroCabrera/PyFlow | PyFlow/Core/NodeBase.py | https://github.com/pedroCabrera/PyFlow/blob/master/PyFlow/Core/NodeBase.py | Apache-2.0 |
def outputs(self):
"""Returns all output pins. Dictionary generated every time property called, so cache it when possible.
"""
result = OrderedDict()
for pin in self.pins:
if pin.direction == PinDirection.Output:
result[pin.uid] = pin
return result | Returns all output pins. Dictionary generated every time property called, so cache it when possible.
| outputs | python | pedroCabrera/PyFlow | PyFlow/Core/NodeBase.py | https://github.com/pedroCabrera/PyFlow/blob/master/PyFlow/Core/NodeBase.py | Apache-2.0 |
def namePinOutputsMap(self):
"""Returns all output pins. Dictionary generated every time property called, so cache it when possible.
"""
result = OrderedDict()
for pin in self.pins:
if pin.direction == PinDirection.Output:
result[pin.name] = pin
return... | Returns all output pins. Dictionary generated every time property called, so cache it when possible.
| namePinOutputsMap | python | pedroCabrera/PyFlow | PyFlow/Core/NodeBase.py | https://github.com/pedroCabrera/PyFlow/blob/master/PyFlow/Core/NodeBase.py | Apache-2.0 |
def isCallable(self):
"""Whether this node is callable or not
"""
for p in list(self.inputs.values()) + list(self.outputs.values()):
if p.isExec():
return True
return False | Whether this node is callable or not
| isCallable | python | pedroCabrera/PyFlow | PyFlow/Core/NodeBase.py | https://github.com/pedroCabrera/PyFlow/blob/master/PyFlow/Core/NodeBase.py | Apache-2.0 |
def setPosition(self, x, y):
"""Sets node coordinate on canvas
Used to correctly restore gui wrapper class
:param x: X coordinate
:type x: float
:param y: Y coordinate
:type y: float
"""
self.x = x
self.y = y | Sets node coordinate on canvas
Used to correctly restore gui wrapper class
:param x: X coordinate
:type x: float
:param y: Y coordinate
:type y: float
| setPosition | python | pedroCabrera/PyFlow | PyFlow/Core/NodeBase.py | https://github.com/pedroCabrera/PyFlow/blob/master/PyFlow/Core/NodeBase.py | Apache-2.0 |
def autoAffectPins(self):
"""All value inputs affects on all value outputs. All exec inputs affects on all exec outputs
"""
for i in self.inputs.values():
for o in self.outputs.values():
assert i is not o
if not i.IsValuePin() and o.IsValuePin():
... | All value inputs affects on all value outputs. All exec inputs affects on all exec outputs
| autoAffectPins | python | pedroCabrera/PyFlow | PyFlow/Core/NodeBase.py | https://github.com/pedroCabrera/PyFlow/blob/master/PyFlow/Core/NodeBase.py | Apache-2.0 |
def createInputPin(
self,
pinName,
dataType,
defaultValue=None,
callback=None,
structure=StructureType.Single,
constraint=None,
structConstraint=None,
supportedPinDataTypes=None,
group="",
):
"""Creates input pin
:param... | Creates input pin
:param pinName: Pin name
:type pinName: str
:param dataType: Pin data type
:type dataType: str
:param defaultValue: Pin default value
:type defaultValue: object
:param callback: Pin callback. used for exec pins
:type callback: function
... | createInputPin | python | pedroCabrera/PyFlow | PyFlow/Core/NodeBase.py | https://github.com/pedroCabrera/PyFlow/blob/master/PyFlow/Core/NodeBase.py | Apache-2.0 |
def createOutputPin(
self,
pinName,
dataType,
defaultValue=None,
structure=StructureType.Single,
constraint=None,
structConstraint=None,
supportedPinDataTypes=None,
group="",
):
"""Creates output pin
:param pinName: Pin name
... | Creates output pin
:param pinName: Pin name
:type pinName: str
:param dataType: Pin data type
:type dataType: str
:param defaultValue: Pin default value
:type defaultValue: object
:param structure: Pin structure
:type structure: :class:`~PyFlow.Core.Commo... | createOutputPin | python | pedroCabrera/PyFlow | PyFlow/Core/NodeBase.py | https://github.com/pedroCabrera/PyFlow/blob/master/PyFlow/Core/NodeBase.py | Apache-2.0 |
def setData(self, pinName, data, pinSelectionGroup=PinSelectionGroup.BothSides):
"""Sets data to pin by pin name
:param pinName: Target pin name
:type pinName: str
:param data: Pin data to be set
:type data: object
:param pinSelectionGroup: Which side to search
:... | Sets data to pin by pin name
:param pinName: Target pin name
:type pinName: str
:param data: Pin data to be set
:type data: object
:param pinSelectionGroup: Which side to search
:type pinSelectionGroup: :class:`~PyFlow.Core.Common.PinSelectionGroup`
| setData | python | pedroCabrera/PyFlow | PyFlow/Core/NodeBase.py | https://github.com/pedroCabrera/PyFlow/blob/master/PyFlow/Core/NodeBase.py | Apache-2.0 |
def getData(self, pinName, pinSelectionGroup=PinSelectionGroup.BothSides):
"""Get data from pin by name
:param pinName: Target pin name
:type pinName: str
:param pinSelectionGroup: Which side to search
:type pinSelectionGroup: :class:`~PyFlow.Core.Common.PinSelectionGroup`
... | Get data from pin by name
:param pinName: Target pin name
:type pinName: str
:param pinSelectionGroup: Which side to search
:type pinSelectionGroup: :class:`~PyFlow.Core.Common.PinSelectionGroup`
:rtype: object
| getData | python | pedroCabrera/PyFlow | PyFlow/Core/NodeBase.py | https://github.com/pedroCabrera/PyFlow/blob/master/PyFlow/Core/NodeBase.py | Apache-2.0 |
def getUniqPinName(self, name):
"""Returns unique name for pin
:param name: Target pin name
:type name: str
:rtype: str
"""
pinNames = [
i.name
for i in list(list(self.inputs.values()))
+ list(list(self.outputs.values()))
]
... | Returns unique name for pin
:param name: Target pin name
:type name: str
:rtype: str
| getUniqPinName | python | pedroCabrera/PyFlow | PyFlow/Core/NodeBase.py | https://github.com/pedroCabrera/PyFlow/blob/master/PyFlow/Core/NodeBase.py | Apache-2.0 |
def call(self, name, *args, **kwargs):
"""Call exec pin by name
:param name: Target pin name
:type name: str
"""
namePinOutputsMap = self.namePinOutputsMap
namePinInputsMap = self.namePinInputsMap
if name in namePinOutputsMap:
p = namePinOutputsMap[na... | Call exec pin by name
:param name: Target pin name
:type name: str
| call | python | pedroCabrera/PyFlow | PyFlow/Core/NodeBase.py | https://github.com/pedroCabrera/PyFlow/blob/master/PyFlow/Core/NodeBase.py | Apache-2.0 |
def getPinSG(self, name, pinsSelectionGroup=PinSelectionGroup.BothSides):
"""Tries to find pin by name and selection group
:param name: Pin name to search
:type name: str
:param pinsSelectionGroup: Side to search
:type pinsSelectionGroup: :class:`~PyFlow.Core.Common.PinSelection... | Tries to find pin by name and selection group
:param name: Pin name to search
:type name: str
:param pinsSelectionGroup: Side to search
:type pinsSelectionGroup: :class:`~PyFlow.Core.Common.PinSelectionGroup`
:rtype: :class:`~PyFlow.Core.PinBase.PinBase` or None
| getPinSG | python | pedroCabrera/PyFlow | PyFlow/Core/NodeBase.py | https://github.com/pedroCabrera/PyFlow/blob/master/PyFlow/Core/NodeBase.py | Apache-2.0 |
def getPinByName(self, name):
"""Tries to find pin by name
:param name: pin name
:type name: str
:rtype: :class:`~PyFlow.Core.PinBase.PinBase` or None
"""
inputs = self.inputs
outputs = self.outputs
for p in list(inputs.values()) + list(outputs.values()):... | Tries to find pin by name
:param name: pin name
:type name: str
:rtype: :class:`~PyFlow.Core.PinBase.PinBase` or None
| getPinByName | python | pedroCabrera/PyFlow | PyFlow/Core/NodeBase.py | https://github.com/pedroCabrera/PyFlow/blob/master/PyFlow/Core/NodeBase.py | Apache-2.0 |
def postCreate(self, jsonTemplate=None):
"""Called after node was added to graph
:param jsonTemplate: Serialized data of spawned node
:type jsonTemplate: dict or None
"""
if jsonTemplate is not None:
self.uid = uuid.UUID(jsonTemplate["uuid"])
self.setName... | Called after node was added to graph
:param jsonTemplate: Serialized data of spawned node
:type jsonTemplate: dict or None
| postCreate | python | pedroCabrera/PyFlow | PyFlow/Core/NodeBase.py | https://github.com/pedroCabrera/PyFlow/blob/master/PyFlow/Core/NodeBase.py | Apache-2.0 |
def initializeFromFunction(foo):
"""Constructs node from annotated function
.. seealso :: :mod:`PyFlow.Core.FunctionLibrary`
:param foo: Annotated function
:type foo: function
:rtype: :class:`~PyFlow.Core.NodeBase.NodeBase`
"""
retAnyOpts = None
retConst... | Constructs node from annotated function
.. seealso :: :mod:`PyFlow.Core.FunctionLibrary`
:param foo: Annotated function
:type foo: function
:rtype: :class:`~PyFlow.Core.NodeBase.NodeBase`
| initializeFromFunction | python | pedroCabrera/PyFlow | PyFlow/Core/NodeBase.py | https://github.com/pedroCabrera/PyFlow/blob/master/PyFlow/Core/NodeBase.py | Apache-2.0 |
def enableOptions(self, *options):
"""Enables flags on pin instance
Example:
>>> self.pinInstance.enableOptions(PinOptions.RenamingEnabled)
You can also pass array/set of flags
>>> self.pinInstance.enableOptions({PinOptions.RenamingEnabled, PinOptions.Dynamic})
This ... | Enables flags on pin instance
Example:
>>> self.pinInstance.enableOptions(PinOptions.RenamingEnabled)
You can also pass array/set of flags
>>> self.pinInstance.enableOptions({PinOptions.RenamingEnabled, PinOptions.Dynamic})
This is equivalent of
>>> self.pinInstance... | enableOptions | python | pedroCabrera/PyFlow | PyFlow/Core/PinBase.py | https://github.com/pedroCabrera/PyFlow/blob/master/PyFlow/Core/PinBase.py | Apache-2.0 |
def disableOptions(self, *options):
"""Same as :meth:`~PyFlow.Core.PinBase.PinBase.enableOptions` but inverse
"""
for option in options:
self._flags = self._flags & ~option
self._origFlags = self._flags | Same as :meth:`~PyFlow.Core.PinBase.PinBase.enableOptions` but inverse
| disableOptions | python | pedroCabrera/PyFlow | PyFlow/Core/PinBase.py | https://github.com/pedroCabrera/PyFlow/blob/master/PyFlow/Core/PinBase.py | Apache-2.0 |
def linkedTo(self):
"""store connection from pins
from left hand side to right hand side
.. code-block:: python
{
"lhsNodeName": "", "outPinId": 0,
"rhsNodeName": "", "inPinId": 0
}
where pin id is order in which pin was added t... | store connection from pins
from left hand side to right hand side
.. code-block:: python
{
"lhsNodeName": "", "outPinId": 0,
"rhsNodeName": "", "inPinId": 0
}
where pin id is order in which pin was added to node
:returns: Seria... | linkedTo | python | pedroCabrera/PyFlow | PyFlow/Core/PinBase.py | https://github.com/pedroCabrera/PyFlow/blob/master/PyFlow/Core/PinBase.py | Apache-2.0 |
def initAsArray(self, bIsArray):
"""Sets this pins to be a list always
:param bIsArray: Define as array
:type bIsArray: bool
"""
self._alwaysList = bool(bIsArray)
if bool(bIsArray):
self._alwaysDict = False
self.setAsArray(bool(bIsArray)) | Sets this pins to be a list always
:param bIsArray: Define as array
:type bIsArray: bool
| initAsArray | python | pedroCabrera/PyFlow | PyFlow/Core/PinBase.py | https://github.com/pedroCabrera/PyFlow/blob/master/PyFlow/Core/PinBase.py | Apache-2.0 |
def initAsDict(self, bIsDict):
"""Sets this pins to be a dict always
:param bIsDict: Define as dict
:type bIsDict: bool
"""
self._alwaysDict = bool(bIsDict)
if bool(bIsDict):
self._alwaysList = False
self.setAsDict(bool(bIsDict)) | Sets this pins to be a dict always
:param bIsDict: Define as dict
:type bIsDict: bool
| initAsDict | python | pedroCabrera/PyFlow | PyFlow/Core/PinBase.py | https://github.com/pedroCabrera/PyFlow/blob/master/PyFlow/Core/PinBase.py | Apache-2.0 |
def setAsArray(self, bIsArray):
"""Sets this pins to be a list
:param bIsArray: Define as Array
:type bIsArray: bool
"""
bIsArray = bool(bIsArray)
if self._isArray == bIsArray:
return
self._isArray = bIsArray
if bIsArray:
if self.... | Sets this pins to be a list
:param bIsArray: Define as Array
:type bIsArray: bool
| setAsArray | python | pedroCabrera/PyFlow | PyFlow/Core/PinBase.py | https://github.com/pedroCabrera/PyFlow/blob/master/PyFlow/Core/PinBase.py | Apache-2.0 |
def setAsDict(self, bIsDict):
"""Sets this pins to be a dict
:param bIsDict: Define as Array
:type bIsDict: bool
"""
bIsDict = bool(bIsDict)
if self._isDict == bIsDict:
return
self._isDict = bIsDict
if bIsDict:
if self.isArray():
... | Sets this pins to be a dict
:param bIsDict: Define as Array
:type bIsDict: bool
| setAsDict | python | pedroCabrera/PyFlow | PyFlow/Core/PinBase.py | https://github.com/pedroCabrera/PyFlow/blob/master/PyFlow/Core/PinBase.py | Apache-2.0 |
def setWrapper(self, wrapper):
"""Sets ui wrapper instance
:param wrapper: Whatever ui class that represents this pin
"""
if self._wrapper is None:
self._wrapper = weakref.ref(wrapper) | Sets ui wrapper instance
:param wrapper: Whatever ui class that represents this pin
| setWrapper | python | pedroCabrera/PyFlow | PyFlow/Core/PinBase.py | https://github.com/pedroCabrera/PyFlow/blob/master/PyFlow/Core/PinBase.py | Apache-2.0 |
def deserialize(self, jsonData):
"""Restores itself from supplied serialized data
:param jsonData: Json representation of pin
:type jsonData: dict
"""
self.setName(jsonData["name"])
self.uid = uuid.UUID(jsonData["uuid"])
for opt in PinOptions:
if opt... | Restores itself from supplied serialized data
:param jsonData: Json representation of pin
:type jsonData: dict
| deserialize | python | pedroCabrera/PyFlow | PyFlow/Core/PinBase.py | https://github.com/pedroCabrera/PyFlow/blob/master/PyFlow/Core/PinBase.py | Apache-2.0 |
def serialize(self):
"""Serializes itself to json
:rtype: dict
"""
storable = self.optionEnabled(PinOptions.Storable)
serializedData = None
if not self.dataType == "AnyPin":
if storable:
serializedData = json.dumps(self.currentData(),
... | Serializes itself to json
:rtype: dict
| serialize | python | pedroCabrera/PyFlow | PyFlow/Core/PinBase.py | https://github.com/pedroCabrera/PyFlow/blob/master/PyFlow/Core/PinBase.py | Apache-2.0 |
def setName(self, name, force=False):
"""Sets pin name and fires events
:param name: New pin name
:type name: str
:param force: If True - name will be changed even if option :attr:`~PyFlow.Core.Common.PinOptions.RenamingEnabled` is turned off
:type force: bool
:returns: ... | Sets pin name and fires events
:param name: New pin name
:type name: str
:param force: If True - name will be changed even if option :attr:`~PyFlow.Core.Common.PinOptions.RenamingEnabled` is turned off
:type force: bool
:returns: Whether renaming performed or not
:rtype:... | setName | python | pedroCabrera/PyFlow | PyFlow/Core/PinBase.py | https://github.com/pedroCabrera/PyFlow/blob/master/PyFlow/Core/PinBase.py | Apache-2.0 |
def defaultValue(self):
"""Returns default value of this pin
"""
if self.isArray():
return []
elif self.isDict():
return PFDict("StringPin", "AnyPin")
else:
return self._defaultValue | Returns default value of this pin
| defaultValue | python | pedroCabrera/PyFlow | PyFlow/Core/PinBase.py | https://github.com/pedroCabrera/PyFlow/blob/master/PyFlow/Core/PinBase.py | Apache-2.0 |
def clearError(self):
"""Clears any last error on this pin and fires event
"""
if self._lastError is not None:
self._lastError = None
self.errorCleared.send() | Clears any last error on this pin and fires event
| clearError | python | pedroCabrera/PyFlow | PyFlow/Core/PinBase.py | https://github.com/pedroCabrera/PyFlow/blob/master/PyFlow/Core/PinBase.py | Apache-2.0 |
def setData(self, data):
"""Sets value to pin
:param data: Data to be set
:type data: object
"""
if self.super is None:
return
try:
self.setDirty()
if isinstance(data, DictElement) and not self.optionEnabled(PinOptions.DictElementSuppo... | Sets value to pin
:param data: Data to be set
:type data: object
| setData | python | pedroCabrera/PyFlow | PyFlow/Core/PinBase.py | https://github.com/pedroCabrera/PyFlow/blob/master/PyFlow/Core/PinBase.py | Apache-2.0 |
def currentData(self):
"""Returns current value of this pin, without any graph evaluation
:rtype: object
"""
if self._data is None:
return self._defaultValue
return self._data | Returns current value of this pin, without any graph evaluation
:rtype: object
| currentData | python | pedroCabrera/PyFlow | PyFlow/Core/PinBase.py | https://github.com/pedroCabrera/PyFlow/blob/master/PyFlow/Core/PinBase.py | Apache-2.0 |
def aboutToConnect(self, other):
"""This method called right before two pins connected
:param other: Pin which this pin is going to be connected with
:type other: :class:`~PyFlow.Core.PinBase.PinBase`
"""
if other.structureType != self.structureType:
if self.optionEn... | This method called right before two pins connected
:param other: Pin which this pin is going to be connected with
:type other: :class:`~PyFlow.Core.PinBase.PinBase`
| aboutToConnect | python | pedroCabrera/PyFlow | PyFlow/Core/PinBase.py | https://github.com/pedroCabrera/PyFlow/blob/master/PyFlow/Core/PinBase.py | Apache-2.0 |
def getCurrentStructure(self):
"""Returns this pin structure type
:rtype: :class:`~PyFlow.Core.Common.StructureType`
"""
if self.structureType == StructureType.Multi:
if self._alwaysSingle:
return StructureType.Single
elif self._alwaysList:
... | Returns this pin structure type
:rtype: :class:`~PyFlow.Core.Common.StructureType`
| getCurrentStructure | python | pedroCabrera/PyFlow | PyFlow/Core/PinBase.py | https://github.com/pedroCabrera/PyFlow/blob/master/PyFlow/Core/PinBase.py | Apache-2.0 |
def changeStructure(self, newStruct, init=False):
"""Changes this pin structure type
:param newStruct: Target structure
:type newStruct: :class:`~PyFlow.Core.Common.StructureType`
:param init: **docs goes here**
:type init: bool
"""
free = self.canChangeStructure... | Changes this pin structure type
:param newStruct: Target structure
:type newStruct: :class:`~PyFlow.Core.Common.StructureType`
:param init: **docs goes here**
:type init: bool
| changeStructure | python | pedroCabrera/PyFlow | PyFlow/Core/PinBase.py | https://github.com/pedroCabrera/PyFlow/blob/master/PyFlow/Core/PinBase.py | Apache-2.0 |
def canChangeStructure(self, newStruct, checked=None, selfCheck=True, init=False):
"""Recursive function to determine if pin can change its structure
:param newStruct: New structure we want to apply
:type newStruct: :class:`~PyFlow.Core.Common.StructureType`
:param checked: Already visi... | Recursive function to determine if pin can change its structure
:param newStruct: New structure we want to apply
:type newStruct: :class:`~PyFlow.Core.Common.StructureType`
:param checked: Already visited pins, defaults to []
:type checked: list, optional
:param selfCheck: Defin... | canChangeStructure | python | pedroCabrera/PyFlow | PyFlow/Core/PinBase.py | https://github.com/pedroCabrera/PyFlow/blob/master/PyFlow/Core/PinBase.py | Apache-2.0 |
def canChangeTypeOnConnection(self, checked=None, can=True, extraPins=None, selfCheck=True):
"""Recursive function to determine if pin can change its dataType
:param checked: Already visited pins, defaults to []
:type checked: list, optional
:param can: Variable Updated during iteration... | Recursive function to determine if pin can change its dataType
:param checked: Already visited pins, defaults to []
:type checked: list, optional
:param can: Variable Updated during iteration, defaults to True
:type can: bool, optional
:param extraPins: extra pins, non-constrain... | canChangeTypeOnConnection | python | pedroCabrera/PyFlow | PyFlow/Core/PinBase.py | https://github.com/pedroCabrera/PyFlow/blob/master/PyFlow/Core/PinBase.py | Apache-2.0 |
def getDictElementNode(self, checked=None, node=None):
"""Get the connected :py:class:`PyFlow.Packages.PyFlowBase.Nodes.makeDictElement.makeDictElement` to this
pin recursively
:param checked: Currently visited pins, defaults to []
:type checked: list, optional
:param node: foun... | Get the connected :py:class:`PyFlow.Packages.PyFlowBase.Nodes.makeDictElement.makeDictElement` to this
pin recursively
:param checked: Currently visited pins, defaults to []
:type checked: list, optional
:param node: founded node, defaults to None
:rtype: :class:`~PyFlow.Core.No... | getDictElementNode | python | pedroCabrera/PyFlow | PyFlow/Core/PinBase.py | https://github.com/pedroCabrera/PyFlow/blob/master/PyFlow/Core/PinBase.py | Apache-2.0 |
def getDictNode(self, checked=None, node=None):
"""Get the connected :py:class:`PyFlow.Packages.PyFlowBase.Nodes.makeDict.makeDict` or
:py:class:`PyFlow.Packages.PyFlowBase.Nodes.makeAnyDict.makeAnyDict` to this pin recursively
:param checked: Currently visited pins, defaults to []
:typ... | Get the connected :py:class:`PyFlow.Packages.PyFlowBase.Nodes.makeDict.makeDict` or
:py:class:`PyFlow.Packages.PyFlowBase.Nodes.makeAnyDict.makeAnyDict` to this pin recursively
:param checked: Currently visited pins, defaults to []
:type checked: list, optional
:param node: founded node... | getDictNode | python | pedroCabrera/PyFlow | PyFlow/Core/PinBase.py | https://github.com/pedroCabrera/PyFlow/blob/master/PyFlow/Core/PinBase.py | Apache-2.0 |
def supportDictElement(self, checked=None, can=True, selfCheck=True):
"""Iterative functions that search in all connected pins to see if they support DictElement nodes.
:param checked: Already visited pins, defaults to []
:type checked: list, optional
:param can: this is the variable th... | Iterative functions that search in all connected pins to see if they support DictElement nodes.
:param checked: Already visited pins, defaults to []
:type checked: list, optional
:param can: this is the variable that will be actualized during the recursive function, defaults to False
:t... | supportDictElement | python | pedroCabrera/PyFlow | PyFlow/Core/PinBase.py | https://github.com/pedroCabrera/PyFlow/blob/master/PyFlow/Core/PinBase.py | Apache-2.0 |
def supportOnlyDictElement(self, checked=None, can=False, selfCheck=True):
"""Iterative Functions that search in all connected pins to see if they support only DictElement nodes, this
is done for nodes like makeDict and similar.
:param checked: Already Visited Pins, defaults to []
:type... | Iterative Functions that search in all connected pins to see if they support only DictElement nodes, this
is done for nodes like makeDict and similar.
:param checked: Already Visited Pins, defaults to []
:type checked: list, optional
:param can: this is the variable that will be actuali... | supportOnlyDictElement | python | pedroCabrera/PyFlow | PyFlow/Core/PinBase.py | https://github.com/pedroCabrera/PyFlow/blob/master/PyFlow/Core/PinBase.py | Apache-2.0 |
def updateConnectedDicts(self, checked=None, keyType=None):
"""Iterate over connected dicts pins and DictElements pins updating key data type
:param checked: Already visited pins, defaults to []
:type checked: list, optional
:param keyType: KeyDataType to set, defaults to None
:... | Iterate over connected dicts pins and DictElements pins updating key data type
:param checked: Already visited pins, defaults to []
:type checked: list, optional
:param keyType: KeyDataType to set, defaults to None
:type keyType: string, optional
| updateConnectedDicts | python | pedroCabrera/PyFlow | PyFlow/Core/PinBase.py | https://github.com/pedroCabrera/PyFlow/blob/master/PyFlow/Core/PinBase.py | Apache-2.0 |
def hasConnections(self):
"""Return the number of connections this pin has
:rtype: int
"""
numConnections = 0
if self.direction == PinDirection.Input:
numConnections += len(self.affected_by)
elif self.direction == PinDirection.Output:
numConnectio... | Return the number of connections this pin has
:rtype: int
| hasConnections | python | pedroCabrera/PyFlow | PyFlow/Core/PinBase.py | https://github.com/pedroCabrera/PyFlow/blob/master/PyFlow/Core/PinBase.py | Apache-2.0 |
def compile(self, code):
"""Wraps code to function def
:param code: Code to wrap
:type code: :class:`str`
:returns: Function object
:rtype: :class:`function`
"""
foo = "def {}(self):".format(self._fooName)
lines = [i for i in code.split("\n") if len(i) > ... | Wraps code to function def
:param code: Code to wrap
:type code: :class:`str`
:returns: Function object
:rtype: :class:`function`
| compile | python | pedroCabrera/PyFlow | PyFlow/Core/PyCodeCompiler.py | https://github.com/pedroCabrera/PyFlow/blob/master/PyFlow/Core/PyCodeCompiler.py | Apache-2.0 |
def compile(self, code, moduleName="PyFlowCodeCompiler", scope=None):
"""Evaluates supplied string
Used by python node
:param code: Whatever python code
:type code: str
:param moduleName: Used for runtime error messages
:type moduleName: str
:param scope: Storag... | Evaluates supplied string
Used by python node
:param code: Whatever python code
:type code: str
:param moduleName: Used for runtime error messages
:type moduleName: str
:param scope: Storage where symbols will be placed
:type scope: dict
| compile | python | pedroCabrera/PyFlow | PyFlow/Core/PyCodeCompiler.py | https://github.com/pedroCabrera/PyFlow/blob/master/PyFlow/Core/PyCodeCompiler.py | Apache-2.0 |
def __init__(
self,
graph,
value,
name,
dataType,
accessLevel=AccessLevel.public,
structure=StructureType.Single,
uid=None,
):
"""Constructor
:param graph: Owning graph
:type graph: :class:`~PyFlow.Core.GraphBase.GraphBase`
... | Constructor
:param graph: Owning graph
:type graph: :class:`~PyFlow.Core.GraphBase.GraphBase`
:param value: Variable value
:type value: object
:param name: Variable name
:type name: str
:param dataType: Variable data type
:type dataType: str
:para... | __init__ | python | pedroCabrera/PyFlow | PyFlow/Core/Variable.py | https://github.com/pedroCabrera/PyFlow/blob/master/PyFlow/Core/Variable.py | Apache-2.0 |
def jsonTemplate():
"""Returns dictionary with minimum required fields for serialization
:rtype: dict
"""
template = {
"name": None,
"value": None,
"dataType": None,
"accessLevel": None,
"package": None,
"uuid": Non... | Returns dictionary with minimum required fields for serialization
:rtype: dict
| jsonTemplate | python | pedroCabrera/PyFlow | PyFlow/Core/Variable.py | https://github.com/pedroCabrera/PyFlow/blob/master/PyFlow/Core/Variable.py | Apache-2.0 |
def fromString(string):
"""Constructs version class from string
>>> v = Version.fromString("1.0.2")
:param string: Version as string
:type string: str
"""
major, minor, patch = string.split(".")
return Version(int(major), int(minor), int(patch)) | Constructs version class from string
>>> v = Version.fromString("1.0.2")
:param string: Version as string
:type string: str
| fromString | python | pedroCabrera/PyFlow | PyFlow/Core/version.py | https://github.com/pedroCabrera/PyFlow/blob/master/PyFlow/Core/version.py | Apache-2.0 |
def extendArray(
lhs=(
"AnyPin",
[],
{
PinSpecifiers.CONSTRAINT: "1",
PinSpecifiers.ENABLED_OPTIONS: PinOptions.ArraySupported
| PinOptions.AllowAny,
},
),
rhs=(
... | Extend the list by appending all the items from the iterable. | extendArray | python | pedroCabrera/PyFlow | PyFlow/Packages/PyFlowBase/FunctionLibraries/ArrayLib.py | https://github.com/pedroCabrera/PyFlow/blob/master/PyFlow/Packages/PyFlowBase/FunctionLibraries/ArrayLib.py | Apache-2.0 |
def insertToArray(
ls=(
"AnyPin",
[],
{
PinSpecifiers.CONSTRAINT: "1",
PinSpecifiers.ENABLED_OPTIONS: PinOptions.ArraySupported
| PinOptions.AllowAny,
},
),
elem=("AnyPi... | Insert an item at a given position. The first argument is the index of the element before which to insert. | insertToArray | python | pedroCabrera/PyFlow | PyFlow/Packages/PyFlowBase/FunctionLibraries/ArrayLib.py | https://github.com/pedroCabrera/PyFlow/blob/master/PyFlow/Packages/PyFlowBase/FunctionLibraries/ArrayLib.py | Apache-2.0 |
def removeFromArray(
ls=(
"AnyPin",
[],
{
PinSpecifiers.CONSTRAINT: "1",
PinSpecifiers.ENABLED_OPTIONS: PinOptions.ArraySupported
| PinOptions.AllowAny,
},
),
elem=("Any... | Remove the first item from the list whose value is equal to x. | removeFromArray | python | pedroCabrera/PyFlow | PyFlow/Packages/PyFlowBase/FunctionLibraries/ArrayLib.py | https://github.com/pedroCabrera/PyFlow/blob/master/PyFlow/Packages/PyFlowBase/FunctionLibraries/ArrayLib.py | Apache-2.0 |
def popFromArray(
ls=(
"AnyPin",
[],
{
PinSpecifiers.CONSTRAINT: "1",
PinSpecifiers.ENABLED_OPTIONS: PinOptions.ArraySupported
| PinOptions.AllowAny,
},
),
index=("IntPi... | Remove the item at the given position in the array, and return it. If no index is specified, ``a.pop()`` removes and returns the last item in the list. | popFromArray | python | pedroCabrera/PyFlow | PyFlow/Packages/PyFlowBase/FunctionLibraries/ArrayLib.py | https://github.com/pedroCabrera/PyFlow/blob/master/PyFlow/Packages/PyFlowBase/FunctionLibraries/ArrayLib.py | Apache-2.0 |
def clearArray(
ls=(
"AnyPin",
[],
{
PinSpecifiers.CONSTRAINT: "1",
PinSpecifiers.ENABLED_OPTIONS: PinOptions.ArraySupported
| PinOptions.AllowAny,
},
)
):
"""Remove... | Remove all items from the list. | clearArray | python | pedroCabrera/PyFlow | PyFlow/Packages/PyFlowBase/FunctionLibraries/ArrayLib.py | https://github.com/pedroCabrera/PyFlow/blob/master/PyFlow/Packages/PyFlowBase/FunctionLibraries/ArrayLib.py | Apache-2.0 |
def arrayElementIndex(
ls=(
"AnyPin",
[],
{
PinSpecifiers.CONSTRAINT: "1",
PinSpecifiers.ENABLED_OPTIONS: PinOptions.ArraySupported
| PinOptions.AllowAny,
},
),
element=... | Returns index of array element if it present. If element is not in array -1 will be returned. | arrayElementIndex | python | pedroCabrera/PyFlow | PyFlow/Packages/PyFlowBase/FunctionLibraries/ArrayLib.py | https://github.com/pedroCabrera/PyFlow/blob/master/PyFlow/Packages/PyFlowBase/FunctionLibraries/ArrayLib.py | Apache-2.0 |
def copyObject(
obj=(
"AnyPin",
None,
{
PinSpecifiers.ENABLED_OPTIONS: PinOptions.ArraySupported
| PinOptions.AllowAny
| PinOptions.DictElementSupported,
... | Shallow or deep copy of an object. | copyObject | python | pedroCabrera/PyFlow | PyFlow/Packages/PyFlowBase/FunctionLibraries/DefaultLib.py | https://github.com/pedroCabrera/PyFlow/blob/master/PyFlow/Packages/PyFlowBase/FunctionLibraries/DefaultLib.py | Apache-2.0 |
def getAttribute(
obj=("AnyPin", None, PIN_ALLOWS_ANYTHING.copy()), name=("StringPin", "attrName")
):
"""Returns attribute from object using "getattr(name)\""""
return getattr(obj, name) | Returns attribute from object using "getattr(name)" | getAttribute | python | pedroCabrera/PyFlow | PyFlow/Packages/PyFlowBase/FunctionLibraries/DefaultLib.py | https://github.com/pedroCabrera/PyFlow/blob/master/PyFlow/Packages/PyFlowBase/FunctionLibraries/DefaultLib.py | Apache-2.0 |
def select(
A=(
"AnyPin",
None,
{
PinSpecifiers.CONSTRAINT: "1",
PinSpecifiers.ENABLED_OPTIONS: PinOptions.ArraySupported
| PinOptions.AllowAny
| PinO... |
If bPickA is true, A is returned, otherwise B.
| select | python | pedroCabrera/PyFlow | PyFlow/Packages/PyFlowBase/FunctionLibraries/DefaultLib.py | https://github.com/pedroCabrera/PyFlow/blob/master/PyFlow/Packages/PyFlowBase/FunctionLibraries/DefaultLib.py | Apache-2.0 |
Subsets and Splits
Django Code with Docstrings
Filters Python code examples from Django repository that contain Django-related code, helping identify relevant code snippets for understanding Django framework usage patterns.
SQL Console for Shuu12121/python-treesitter-filtered-datasetsV2
Retrieves specific code examples from the Flask repository but doesn't provide meaningful analysis or patterns beyond basic data retrieval.
HTTPX Repo Code and Docstrings
Retrieves specific code examples from the httpx repository, which is useful for understanding how particular libraries are used but doesn't provide broader analytical insights about the dataset.
Requests Repo Docstrings & Code
Retrieves code examples with their docstrings and file paths from the requests repository, providing basic filtering but limited analytical value beyond finding specific code samples.
Quart Repo Docstrings & Code
Retrieves code examples with their docstrings from the Quart repository, providing basic code samples but offering limited analytical value for understanding broader patterns or relationships in the dataset.