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
232,600
nerdvegas/rez
src/rez/vendor/pygraph/mixins/labeling.py
labeling.edge_weight
def edge_weight(self, edge): """ Get the weight of an edge. @type edge: edge @param edge: One edge. @rtype: number @return: Edge weight. """ return self.get_edge_properties( edge ).setdefault( self.WEIGHT_ATTRIBUTE_NAME, self.DEFAULT_WEIGHT )
python
def edge_weight(self, edge): """ Get the weight of an edge. @type edge: edge @param edge: One edge. @rtype: number @return: Edge weight. """ return self.get_edge_properties( edge ).setdefault( self.WEIGHT_ATTRIBUTE_NAME, self.DEFAULT_WEIGHT )
[ "def", "edge_weight", "(", "self", ",", "edge", ")", ":", "return", "self", ".", "get_edge_properties", "(", "edge", ")", ".", "setdefault", "(", "self", ".", "WEIGHT_ATTRIBUTE_NAME", ",", "self", ".", "DEFAULT_WEIGHT", ")" ]
Get the weight of an edge. @type edge: edge @param edge: One edge. @rtype: number @return: Edge weight.
[ "Get", "the", "weight", "of", "an", "edge", "." ]
1d3b846d53b5b5404edfe8ddb9083f9ceec8c5e7
https://github.com/nerdvegas/rez/blob/1d3b846d53b5b5404edfe8ddb9083f9ceec8c5e7/src/rez/vendor/pygraph/mixins/labeling.py#L66-L76
232,601
nerdvegas/rez
src/rez/vendor/pygraph/mixins/labeling.py
labeling.set_edge_weight
def set_edge_weight(self, edge, wt): """ Set the weight of an edge. @type edge: edge @param edge: One edge. @type wt: number @param wt: Edge weight. """ self.set_edge_properties(edge, weight=wt ) if not self.DIRECTED: self.set_edge_...
python
def set_edge_weight(self, edge, wt): """ Set the weight of an edge. @type edge: edge @param edge: One edge. @type wt: number @param wt: Edge weight. """ self.set_edge_properties(edge, weight=wt ) if not self.DIRECTED: self.set_edge_...
[ "def", "set_edge_weight", "(", "self", ",", "edge", ",", "wt", ")", ":", "self", ".", "set_edge_properties", "(", "edge", ",", "weight", "=", "wt", ")", "if", "not", "self", ".", "DIRECTED", ":", "self", ".", "set_edge_properties", "(", "(", "edge", "[...
Set the weight of an edge. @type edge: edge @param edge: One edge. @type wt: number @param wt: Edge weight.
[ "Set", "the", "weight", "of", "an", "edge", "." ]
1d3b846d53b5b5404edfe8ddb9083f9ceec8c5e7
https://github.com/nerdvegas/rez/blob/1d3b846d53b5b5404edfe8ddb9083f9ceec8c5e7/src/rez/vendor/pygraph/mixins/labeling.py#L79-L91
232,602
nerdvegas/rez
src/rez/vendor/pygraph/mixins/labeling.py
labeling.edge_label
def edge_label(self, edge): """ Get the label of an edge. @type edge: edge @param edge: One edge. @rtype: string @return: Edge label """ return self.get_edge_properties( edge ).setdefault( self.LABEL_ATTRIBUTE_NAME, self.DEFAULT_LABEL )
python
def edge_label(self, edge): """ Get the label of an edge. @type edge: edge @param edge: One edge. @rtype: string @return: Edge label """ return self.get_edge_properties( edge ).setdefault( self.LABEL_ATTRIBUTE_NAME, self.DEFAULT_LABEL )
[ "def", "edge_label", "(", "self", ",", "edge", ")", ":", "return", "self", ".", "get_edge_properties", "(", "edge", ")", ".", "setdefault", "(", "self", ".", "LABEL_ATTRIBUTE_NAME", ",", "self", ".", "DEFAULT_LABEL", ")" ]
Get the label of an edge. @type edge: edge @param edge: One edge. @rtype: string @return: Edge label
[ "Get", "the", "label", "of", "an", "edge", "." ]
1d3b846d53b5b5404edfe8ddb9083f9ceec8c5e7
https://github.com/nerdvegas/rez/blob/1d3b846d53b5b5404edfe8ddb9083f9ceec8c5e7/src/rez/vendor/pygraph/mixins/labeling.py#L94-L104
232,603
nerdvegas/rez
src/rez/vendor/pygraph/mixins/labeling.py
labeling.set_edge_label
def set_edge_label(self, edge, label): """ Set the label of an edge. @type edge: edge @param edge: One edge. @type label: string @param label: Edge label. """ self.set_edge_properties(edge, label=label ) if not self.DIRECTED: self.s...
python
def set_edge_label(self, edge, label): """ Set the label of an edge. @type edge: edge @param edge: One edge. @type label: string @param label: Edge label. """ self.set_edge_properties(edge, label=label ) if not self.DIRECTED: self.s...
[ "def", "set_edge_label", "(", "self", ",", "edge", ",", "label", ")", ":", "self", ".", "set_edge_properties", "(", "edge", ",", "label", "=", "label", ")", "if", "not", "self", ".", "DIRECTED", ":", "self", ".", "set_edge_properties", "(", "(", "edge", ...
Set the label of an edge. @type edge: edge @param edge: One edge. @type label: string @param label: Edge label.
[ "Set", "the", "label", "of", "an", "edge", "." ]
1d3b846d53b5b5404edfe8ddb9083f9ceec8c5e7
https://github.com/nerdvegas/rez/blob/1d3b846d53b5b5404edfe8ddb9083f9ceec8c5e7/src/rez/vendor/pygraph/mixins/labeling.py#L106-L118
232,604
nerdvegas/rez
src/rez/vendor/pygraph/mixins/labeling.py
labeling.add_edge_attribute
def add_edge_attribute(self, edge, attr): """ Add attribute to the given edge. @type edge: edge @param edge: One edge. @type attr: tuple @param attr: Node attribute specified as a tuple in the form (attribute, value). """ self.edge_attr[edge] = self.ed...
python
def add_edge_attribute(self, edge, attr): """ Add attribute to the given edge. @type edge: edge @param edge: One edge. @type attr: tuple @param attr: Node attribute specified as a tuple in the form (attribute, value). """ self.edge_attr[edge] = self.ed...
[ "def", "add_edge_attribute", "(", "self", ",", "edge", ",", "attr", ")", ":", "self", ".", "edge_attr", "[", "edge", "]", "=", "self", ".", "edge_attributes", "(", "edge", ")", "+", "[", "attr", "]", "if", "(", "not", "self", ".", "DIRECTED", "and", ...
Add attribute to the given edge. @type edge: edge @param edge: One edge. @type attr: tuple @param attr: Node attribute specified as a tuple in the form (attribute, value).
[ "Add", "attribute", "to", "the", "given", "edge", "." ]
1d3b846d53b5b5404edfe8ddb9083f9ceec8c5e7
https://github.com/nerdvegas/rez/blob/1d3b846d53b5b5404edfe8ddb9083f9ceec8c5e7/src/rez/vendor/pygraph/mixins/labeling.py#L128-L141
232,605
nerdvegas/rez
src/rez/vendor/pygraph/mixins/labeling.py
labeling.add_node_attribute
def add_node_attribute(self, node, attr): """ Add attribute to the given node. @type node: node @param node: Node identifier @type attr: tuple @param attr: Node attribute specified as a tuple in the form (attribute, value). """ self.node_attr[node] = s...
python
def add_node_attribute(self, node, attr): """ Add attribute to the given node. @type node: node @param node: Node identifier @type attr: tuple @param attr: Node attribute specified as a tuple in the form (attribute, value). """ self.node_attr[node] = s...
[ "def", "add_node_attribute", "(", "self", ",", "node", ",", "attr", ")", ":", "self", ".", "node_attr", "[", "node", "]", "=", "self", ".", "node_attr", "[", "node", "]", "+", "[", "attr", "]" ]
Add attribute to the given node. @type node: node @param node: Node identifier @type attr: tuple @param attr: Node attribute specified as a tuple in the form (attribute, value).
[ "Add", "attribute", "to", "the", "given", "node", "." ]
1d3b846d53b5b5404edfe8ddb9083f9ceec8c5e7
https://github.com/nerdvegas/rez/blob/1d3b846d53b5b5404edfe8ddb9083f9ceec8c5e7/src/rez/vendor/pygraph/mixins/labeling.py#L157-L167
232,606
nerdvegas/rez
src/rez/suite.py
Suite.activation_shell_code
def activation_shell_code(self, shell=None): """Get shell code that should be run to activate this suite.""" from rez.shells import create_shell from rez.rex import RexExecutor executor = RexExecutor(interpreter=create_shell(shell), parent_variables=["PATH...
python
def activation_shell_code(self, shell=None): """Get shell code that should be run to activate this suite.""" from rez.shells import create_shell from rez.rex import RexExecutor executor = RexExecutor(interpreter=create_shell(shell), parent_variables=["PATH...
[ "def", "activation_shell_code", "(", "self", ",", "shell", "=", "None", ")", ":", "from", "rez", ".", "shells", "import", "create_shell", "from", "rez", ".", "rex", "import", "RexExecutor", "executor", "=", "RexExecutor", "(", "interpreter", "=", "create_shell...
Get shell code that should be run to activate this suite.
[ "Get", "shell", "code", "that", "should", "be", "run", "to", "activate", "this", "suite", "." ]
1d3b846d53b5b5404edfe8ddb9083f9ceec8c5e7
https://github.com/nerdvegas/rez/blob/1d3b846d53b5b5404edfe8ddb9083f9ceec8c5e7/src/rez/suite.py#L68-L77
232,607
nerdvegas/rez
src/rez/suite.py
Suite.context
def context(self, name): """Get a context. Args: name (str): Name to store the context under. Returns: `ResolvedContext` object. """ data = self._context(name) context = data.get("context") if context: return context ...
python
def context(self, name): """Get a context. Args: name (str): Name to store the context under. Returns: `ResolvedContext` object. """ data = self._context(name) context = data.get("context") if context: return context ...
[ "def", "context", "(", "self", ",", "name", ")", ":", "data", "=", "self", ".", "_context", "(", "name", ")", "context", "=", "data", ".", "get", "(", "\"context\"", ")", "if", "context", ":", "return", "context", "assert", "self", ".", "load_path", ...
Get a context. Args: name (str): Name to store the context under. Returns: `ResolvedContext` object.
[ "Get", "a", "context", "." ]
1d3b846d53b5b5404edfe8ddb9083f9ceec8c5e7
https://github.com/nerdvegas/rez/blob/1d3b846d53b5b5404edfe8ddb9083f9ceec8c5e7/src/rez/suite.py#L82-L101
232,608
nerdvegas/rez
src/rez/suite.py
Suite.add_context
def add_context(self, name, context, prefix_char=None): """Add a context to the suite. Args: name (str): Name to store the context under. context (ResolvedContext): Context to add. """ if name in self.contexts: raise SuiteError("Context already in sui...
python
def add_context(self, name, context, prefix_char=None): """Add a context to the suite. Args: name (str): Name to store the context under. context (ResolvedContext): Context to add. """ if name in self.contexts: raise SuiteError("Context already in sui...
[ "def", "add_context", "(", "self", ",", "name", ",", "context", ",", "prefix_char", "=", "None", ")", ":", "if", "name", "in", "self", ".", "contexts", ":", "raise", "SuiteError", "(", "\"Context already in suite: %r\"", "%", "name", ")", "if", "not", "con...
Add a context to the suite. Args: name (str): Name to store the context under. context (ResolvedContext): Context to add.
[ "Add", "a", "context", "to", "the", "suite", "." ]
1d3b846d53b5b5404edfe8ddb9083f9ceec8c5e7
https://github.com/nerdvegas/rez/blob/1d3b846d53b5b5404edfe8ddb9083f9ceec8c5e7/src/rez/suite.py#L103-L121
232,609
nerdvegas/rez
src/rez/suite.py
Suite.find_contexts
def find_contexts(self, in_request=None, in_resolve=None): """Find contexts in the suite based on search criteria. Args: in_request (str): Match contexts that contain the given package in their request. in_resolve (str or `Requirement`): Match contexts that conta...
python
def find_contexts(self, in_request=None, in_resolve=None): """Find contexts in the suite based on search criteria. Args: in_request (str): Match contexts that contain the given package in their request. in_resolve (str or `Requirement`): Match contexts that conta...
[ "def", "find_contexts", "(", "self", ",", "in_request", "=", "None", ",", "in_resolve", "=", "None", ")", ":", "names", "=", "self", ".", "context_names", "if", "in_request", ":", "def", "_in_request", "(", "name", ")", ":", "context", "=", "self", ".", ...
Find contexts in the suite based on search criteria. Args: in_request (str): Match contexts that contain the given package in their request. in_resolve (str or `Requirement`): Match contexts that contain the given package in their resolve. You can also su...
[ "Find", "contexts", "in", "the", "suite", "based", "on", "search", "criteria", "." ]
1d3b846d53b5b5404edfe8ddb9083f9ceec8c5e7
https://github.com/nerdvegas/rez/blob/1d3b846d53b5b5404edfe8ddb9083f9ceec8c5e7/src/rez/suite.py#L123-L161
232,610
nerdvegas/rez
src/rez/suite.py
Suite.remove_context
def remove_context(self, name): """Remove a context from the suite. Args: name (str): Name of the context to remove. """ self._context(name) del self.contexts[name] self._flush_tools()
python
def remove_context(self, name): """Remove a context from the suite. Args: name (str): Name of the context to remove. """ self._context(name) del self.contexts[name] self._flush_tools()
[ "def", "remove_context", "(", "self", ",", "name", ")", ":", "self", ".", "_context", "(", "name", ")", "del", "self", ".", "contexts", "[", "name", "]", "self", ".", "_flush_tools", "(", ")" ]
Remove a context from the suite. Args: name (str): Name of the context to remove.
[ "Remove", "a", "context", "from", "the", "suite", "." ]
1d3b846d53b5b5404edfe8ddb9083f9ceec8c5e7
https://github.com/nerdvegas/rez/blob/1d3b846d53b5b5404edfe8ddb9083f9ceec8c5e7/src/rez/suite.py#L163-L171
232,611
nerdvegas/rez
src/rez/suite.py
Suite.set_context_prefix
def set_context_prefix(self, name, prefix): """Set a context's prefix. This will be applied to all wrappers for the tools in this context. For example, a tool called 'foo' would appear as '<prefix>foo' in the suite's bin path. Args: name (str): Name of the context t...
python
def set_context_prefix(self, name, prefix): """Set a context's prefix. This will be applied to all wrappers for the tools in this context. For example, a tool called 'foo' would appear as '<prefix>foo' in the suite's bin path. Args: name (str): Name of the context t...
[ "def", "set_context_prefix", "(", "self", ",", "name", ",", "prefix", ")", ":", "data", "=", "self", ".", "_context", "(", "name", ")", "data", "[", "\"prefix\"", "]", "=", "prefix", "self", ".", "_flush_tools", "(", ")" ]
Set a context's prefix. This will be applied to all wrappers for the tools in this context. For example, a tool called 'foo' would appear as '<prefix>foo' in the suite's bin path. Args: name (str): Name of the context to prefix. prefix (str): Prefix to apply to ...
[ "Set", "a", "context", "s", "prefix", "." ]
1d3b846d53b5b5404edfe8ddb9083f9ceec8c5e7
https://github.com/nerdvegas/rez/blob/1d3b846d53b5b5404edfe8ddb9083f9ceec8c5e7/src/rez/suite.py#L173-L186
232,612
nerdvegas/rez
src/rez/suite.py
Suite.set_context_suffix
def set_context_suffix(self, name, suffix): """Set a context's suffix. This will be applied to all wrappers for the tools in this context. For example, a tool called 'foo' would appear as 'foo<suffix>' in the suite's bin path. Args: name (str): Name of the context t...
python
def set_context_suffix(self, name, suffix): """Set a context's suffix. This will be applied to all wrappers for the tools in this context. For example, a tool called 'foo' would appear as 'foo<suffix>' in the suite's bin path. Args: name (str): Name of the context t...
[ "def", "set_context_suffix", "(", "self", ",", "name", ",", "suffix", ")", ":", "data", "=", "self", ".", "_context", "(", "name", ")", "data", "[", "\"suffix\"", "]", "=", "suffix", "self", ".", "_flush_tools", "(", ")" ]
Set a context's suffix. This will be applied to all wrappers for the tools in this context. For example, a tool called 'foo' would appear as 'foo<suffix>' in the suite's bin path. Args: name (str): Name of the context to suffix. suffix (str): Suffix to apply to ...
[ "Set", "a", "context", "s", "suffix", "." ]
1d3b846d53b5b5404edfe8ddb9083f9ceec8c5e7
https://github.com/nerdvegas/rez/blob/1d3b846d53b5b5404edfe8ddb9083f9ceec8c5e7/src/rez/suite.py#L196-L209
232,613
nerdvegas/rez
src/rez/suite.py
Suite.bump_context
def bump_context(self, name): """Causes the context's tools to take priority over all others.""" data = self._context(name) data["priority"] = self._next_priority self._flush_tools()
python
def bump_context(self, name): """Causes the context's tools to take priority over all others.""" data = self._context(name) data["priority"] = self._next_priority self._flush_tools()
[ "def", "bump_context", "(", "self", ",", "name", ")", ":", "data", "=", "self", ".", "_context", "(", "name", ")", "data", "[", "\"priority\"", "]", "=", "self", ".", "_next_priority", "self", ".", "_flush_tools", "(", ")" ]
Causes the context's tools to take priority over all others.
[ "Causes", "the", "context", "s", "tools", "to", "take", "priority", "over", "all", "others", "." ]
1d3b846d53b5b5404edfe8ddb9083f9ceec8c5e7
https://github.com/nerdvegas/rez/blob/1d3b846d53b5b5404edfe8ddb9083f9ceec8c5e7/src/rez/suite.py#L219-L223
232,614
nerdvegas/rez
src/rez/suite.py
Suite.hide_tool
def hide_tool(self, context_name, tool_name): """Hide a tool so that it is not exposed in the suite. Args: context_name (str): Context containing the tool. tool_name (str): Name of tool to hide. """ data = self._context(context_name) hidden_tools = data["...
python
def hide_tool(self, context_name, tool_name): """Hide a tool so that it is not exposed in the suite. Args: context_name (str): Context containing the tool. tool_name (str): Name of tool to hide. """ data = self._context(context_name) hidden_tools = data["...
[ "def", "hide_tool", "(", "self", ",", "context_name", ",", "tool_name", ")", ":", "data", "=", "self", ".", "_context", "(", "context_name", ")", "hidden_tools", "=", "data", "[", "\"hidden_tools\"", "]", "if", "tool_name", "not", "in", "hidden_tools", ":", ...
Hide a tool so that it is not exposed in the suite. Args: context_name (str): Context containing the tool. tool_name (str): Name of tool to hide.
[ "Hide", "a", "tool", "so", "that", "it", "is", "not", "exposed", "in", "the", "suite", "." ]
1d3b846d53b5b5404edfe8ddb9083f9ceec8c5e7
https://github.com/nerdvegas/rez/blob/1d3b846d53b5b5404edfe8ddb9083f9ceec8c5e7/src/rez/suite.py#L225-L237
232,615
nerdvegas/rez
src/rez/suite.py
Suite.unhide_tool
def unhide_tool(self, context_name, tool_name): """Unhide a tool so that it may be exposed in a suite. Note that unhiding a tool doesn't guarantee it can be seen - a tool of the same name from a different context may be overriding it. Args: context_name (str): Context conta...
python
def unhide_tool(self, context_name, tool_name): """Unhide a tool so that it may be exposed in a suite. Note that unhiding a tool doesn't guarantee it can be seen - a tool of the same name from a different context may be overriding it. Args: context_name (str): Context conta...
[ "def", "unhide_tool", "(", "self", ",", "context_name", ",", "tool_name", ")", ":", "data", "=", "self", ".", "_context", "(", "context_name", ")", "hidden_tools", "=", "data", "[", "\"hidden_tools\"", "]", "if", "tool_name", "in", "hidden_tools", ":", "hidd...
Unhide a tool so that it may be exposed in a suite. Note that unhiding a tool doesn't guarantee it can be seen - a tool of the same name from a different context may be overriding it. Args: context_name (str): Context containing the tool. tool_name (str): Name of tool t...
[ "Unhide", "a", "tool", "so", "that", "it", "may", "be", "exposed", "in", "a", "suite", "." ]
1d3b846d53b5b5404edfe8ddb9083f9ceec8c5e7
https://github.com/nerdvegas/rez/blob/1d3b846d53b5b5404edfe8ddb9083f9ceec8c5e7/src/rez/suite.py#L239-L253
232,616
nerdvegas/rez
src/rez/suite.py
Suite.alias_tool
def alias_tool(self, context_name, tool_name, tool_alias): """Register an alias for a specific tool. Note that a tool alias takes precedence over a context prefix/suffix. Args: context_name (str): Context containing the tool. tool_name (str): Name of tool to alias. ...
python
def alias_tool(self, context_name, tool_name, tool_alias): """Register an alias for a specific tool. Note that a tool alias takes precedence over a context prefix/suffix. Args: context_name (str): Context containing the tool. tool_name (str): Name of tool to alias. ...
[ "def", "alias_tool", "(", "self", ",", "context_name", ",", "tool_name", ",", "tool_alias", ")", ":", "data", "=", "self", ".", "_context", "(", "context_name", ")", "aliases", "=", "data", "[", "\"tool_aliases\"", "]", "if", "tool_name", "in", "aliases", ...
Register an alias for a specific tool. Note that a tool alias takes precedence over a context prefix/suffix. Args: context_name (str): Context containing the tool. tool_name (str): Name of tool to alias. tool_alias (str): Alias to give the tool.
[ "Register", "an", "alias", "for", "a", "specific", "tool", "." ]
1d3b846d53b5b5404edfe8ddb9083f9ceec8c5e7
https://github.com/nerdvegas/rez/blob/1d3b846d53b5b5404edfe8ddb9083f9ceec8c5e7/src/rez/suite.py#L255-L272
232,617
nerdvegas/rez
src/rez/suite.py
Suite.unalias_tool
def unalias_tool(self, context_name, tool_name): """Deregister an alias for a specific tool. Args: context_name (str): Context containing the tool. tool_name (str): Name of tool to unalias. """ data = self._context(context_name) aliases = data["tool_alias...
python
def unalias_tool(self, context_name, tool_name): """Deregister an alias for a specific tool. Args: context_name (str): Context containing the tool. tool_name (str): Name of tool to unalias. """ data = self._context(context_name) aliases = data["tool_alias...
[ "def", "unalias_tool", "(", "self", ",", "context_name", ",", "tool_name", ")", ":", "data", "=", "self", ".", "_context", "(", "context_name", ")", "aliases", "=", "data", "[", "\"tool_aliases\"", "]", "if", "tool_name", "in", "aliases", ":", "del", "alia...
Deregister an alias for a specific tool. Args: context_name (str): Context containing the tool. tool_name (str): Name of tool to unalias.
[ "Deregister", "an", "alias", "for", "a", "specific", "tool", "." ]
1d3b846d53b5b5404edfe8ddb9083f9ceec8c5e7
https://github.com/nerdvegas/rez/blob/1d3b846d53b5b5404edfe8ddb9083f9ceec8c5e7/src/rez/suite.py#L274-L285
232,618
nerdvegas/rez
src/rez/suite.py
Suite.get_tool_filepath
def get_tool_filepath(self, tool_alias): """Given a visible tool alias, return the full path to the executable. Args: tool_alias (str): Tool alias to search for. Returns: (str): Filepath of executable, or None if the tool is not in the suite. May also re...
python
def get_tool_filepath(self, tool_alias): """Given a visible tool alias, return the full path to the executable. Args: tool_alias (str): Tool alias to search for. Returns: (str): Filepath of executable, or None if the tool is not in the suite. May also re...
[ "def", "get_tool_filepath", "(", "self", ",", "tool_alias", ")", ":", "tools_dict", "=", "self", ".", "get_tools", "(", ")", "if", "tool_alias", "in", "tools_dict", ":", "if", "self", ".", "tools_path", "is", "None", ":", "return", "None", "else", ":", "...
Given a visible tool alias, return the full path to the executable. Args: tool_alias (str): Tool alias to search for. Returns: (str): Filepath of executable, or None if the tool is not in the suite. May also return None because this suite has not been saved ...
[ "Given", "a", "visible", "tool", "alias", "return", "the", "full", "path", "to", "the", "executable", "." ]
1d3b846d53b5b5404edfe8ddb9083f9ceec8c5e7
https://github.com/nerdvegas/rez/blob/1d3b846d53b5b5404edfe8ddb9083f9ceec8c5e7/src/rez/suite.py#L302-L320
232,619
nerdvegas/rez
src/rez/suite.py
Suite.get_tool_context
def get_tool_context(self, tool_alias): """Given a visible tool alias, return the name of the context it belongs to. Args: tool_alias (str): Tool alias to search for. Returns: (str): Name of the context that exposes a visible instance of this tool al...
python
def get_tool_context(self, tool_alias): """Given a visible tool alias, return the name of the context it belongs to. Args: tool_alias (str): Tool alias to search for. Returns: (str): Name of the context that exposes a visible instance of this tool al...
[ "def", "get_tool_context", "(", "self", ",", "tool_alias", ")", ":", "tools_dict", "=", "self", ".", "get_tools", "(", ")", "data", "=", "tools_dict", ".", "get", "(", "tool_alias", ")", "if", "data", ":", "return", "data", "[", "\"context_name\"", "]", ...
Given a visible tool alias, return the name of the context it belongs to. Args: tool_alias (str): Tool alias to search for. Returns: (str): Name of the context that exposes a visible instance of this tool alias, or None if the alias is not available.
[ "Given", "a", "visible", "tool", "alias", "return", "the", "name", "of", "the", "context", "it", "belongs", "to", "." ]
1d3b846d53b5b5404edfe8ddb9083f9ceec8c5e7
https://github.com/nerdvegas/rez/blob/1d3b846d53b5b5404edfe8ddb9083f9ceec8c5e7/src/rez/suite.py#L322-L337
232,620
nerdvegas/rez
src/rez/suite.py
Suite.validate
def validate(self): """Validate the suite.""" for context_name in self.context_names: context = self.context(context_name) try: context.validate() except ResolvedContextError as e: raise SuiteError("Error in context %r: %s" ...
python
def validate(self): """Validate the suite.""" for context_name in self.context_names: context = self.context(context_name) try: context.validate() except ResolvedContextError as e: raise SuiteError("Error in context %r: %s" ...
[ "def", "validate", "(", "self", ")", ":", "for", "context_name", "in", "self", ".", "context_names", ":", "context", "=", "self", ".", "context", "(", "context_name", ")", "try", ":", "context", ".", "validate", "(", ")", "except", "ResolvedContextError", ...
Validate the suite.
[ "Validate", "the", "suite", "." ]
1d3b846d53b5b5404edfe8ddb9083f9ceec8c5e7
https://github.com/nerdvegas/rez/blob/1d3b846d53b5b5404edfe8ddb9083f9ceec8c5e7/src/rez/suite.py#L379-L387
232,621
nerdvegas/rez
src/rez/suite.py
Suite.save
def save(self, path, verbose=False): """Save the suite to disk. Args: path (str): Path to save the suite to. If a suite is already saved at `path`, then it will be overwritten. Otherwise, if `path` exists, an error is raised. """ path = os.pat...
python
def save(self, path, verbose=False): """Save the suite to disk. Args: path (str): Path to save the suite to. If a suite is already saved at `path`, then it will be overwritten. Otherwise, if `path` exists, an error is raised. """ path = os.pat...
[ "def", "save", "(", "self", ",", "path", ",", "verbose", "=", "False", ")", ":", "path", "=", "os", ".", "path", ".", "realpath", "(", "path", ")", "if", "os", ".", "path", ".", "exists", "(", "path", ")", ":", "if", "self", ".", "load_path", "...
Save the suite to disk. Args: path (str): Path to save the suite to. If a suite is already saved at `path`, then it will be overwritten. Otherwise, if `path` exists, an error is raised.
[ "Save", "the", "suite", "to", "disk", "." ]
1d3b846d53b5b5404edfe8ddb9083f9ceec8c5e7
https://github.com/nerdvegas/rez/blob/1d3b846d53b5b5404edfe8ddb9083f9ceec8c5e7/src/rez/suite.py#L415-L476
232,622
nerdvegas/rez
src/rez/suite.py
Suite.print_info
def print_info(self, buf=sys.stdout, verbose=False): """Prints a message summarising the contents of the suite.""" _pr = Printer(buf) if not self.contexts: _pr("Suite is empty.") return context_names = sorted(self.contexts.iterkeys()) _pr("Suite contains...
python
def print_info(self, buf=sys.stdout, verbose=False): """Prints a message summarising the contents of the suite.""" _pr = Printer(buf) if not self.contexts: _pr("Suite is empty.") return context_names = sorted(self.contexts.iterkeys()) _pr("Suite contains...
[ "def", "print_info", "(", "self", ",", "buf", "=", "sys", ".", "stdout", ",", "verbose", "=", "False", ")", ":", "_pr", "=", "Printer", "(", "buf", ")", "if", "not", "self", ".", "contexts", ":", "_pr", "(", "\"Suite is empty.\"", ")", "return", "con...
Prints a message summarising the contents of the suite.
[ "Prints", "a", "message", "summarising", "the", "contents", "of", "the", "suite", "." ]
1d3b846d53b5b5404edfe8ddb9083f9ceec8c5e7
https://github.com/nerdvegas/rez/blob/1d3b846d53b5b5404edfe8ddb9083f9ceec8c5e7/src/rez/suite.py#L525-L562
232,623
nerdvegas/rez
src/rez/build_system.py
get_valid_build_systems
def get_valid_build_systems(working_dir, package=None): """Returns the build system classes that could build the source in given dir. Args: working_dir (str): Dir containing the package definition and potentially build files. package (`Package`): Package to be built. This may or may...
python
def get_valid_build_systems(working_dir, package=None): """Returns the build system classes that could build the source in given dir. Args: working_dir (str): Dir containing the package definition and potentially build files. package (`Package`): Package to be built. This may or may...
[ "def", "get_valid_build_systems", "(", "working_dir", ",", "package", "=", "None", ")", ":", "from", "rez", ".", "plugin_managers", "import", "plugin_manager", "from", "rez", ".", "exceptions", "import", "PackageMetadataError", "try", ":", "package", "=", "package...
Returns the build system classes that could build the source in given dir. Args: working_dir (str): Dir containing the package definition and potentially build files. package (`Package`): Package to be built. This may or may not be needed to determine the build system. For e...
[ "Returns", "the", "build", "system", "classes", "that", "could", "build", "the", "source", "in", "given", "dir", "." ]
1d3b846d53b5b5404edfe8ddb9083f9ceec8c5e7
https://github.com/nerdvegas/rez/blob/1d3b846d53b5b5404edfe8ddb9083f9ceec8c5e7/src/rez/build_system.py#L14-L62
232,624
nerdvegas/rez
src/rez/build_system.py
create_build_system
def create_build_system(working_dir, buildsys_type=None, package=None, opts=None, write_build_scripts=False, verbose=False, build_args=[], child_build_args=[]): """Return a new build system that can build the source in working_dir.""" from rez.plugin_managers impo...
python
def create_build_system(working_dir, buildsys_type=None, package=None, opts=None, write_build_scripts=False, verbose=False, build_args=[], child_build_args=[]): """Return a new build system that can build the source in working_dir.""" from rez.plugin_managers impo...
[ "def", "create_build_system", "(", "working_dir", ",", "buildsys_type", "=", "None", ",", "package", "=", "None", ",", "opts", "=", "None", ",", "write_build_scripts", "=", "False", ",", "verbose", "=", "False", ",", "build_args", "=", "[", "]", ",", "chil...
Return a new build system that can build the source in working_dir.
[ "Return", "a", "new", "build", "system", "that", "can", "build", "the", "source", "in", "working_dir", "." ]
1d3b846d53b5b5404edfe8ddb9083f9ceec8c5e7
https://github.com/nerdvegas/rez/blob/1d3b846d53b5b5404edfe8ddb9083f9ceec8c5e7/src/rez/build_system.py#L65-L95
232,625
nerdvegas/rez
src/rez/build_system.py
BuildSystem.build
def build(self, context, variant, build_path, install_path, install=False, build_type=BuildType.local): """Implement this method to perform the actual build. Args: context: A ResolvedContext object that the build process must be executed within. var...
python
def build(self, context, variant, build_path, install_path, install=False, build_type=BuildType.local): """Implement this method to perform the actual build. Args: context: A ResolvedContext object that the build process must be executed within. var...
[ "def", "build", "(", "self", ",", "context", ",", "variant", ",", "build_path", ",", "install_path", ",", "install", "=", "False", ",", "build_type", "=", "BuildType", ".", "local", ")", ":", "raise", "NotImplementedError" ]
Implement this method to perform the actual build. Args: context: A ResolvedContext object that the build process must be executed within. variant (`Variant`): The variant being built. build_path: Where to write temporary build files. May be relative ...
[ "Implement", "this", "method", "to", "perform", "the", "actual", "build", "." ]
1d3b846d53b5b5404edfe8ddb9083f9ceec8c5e7
https://github.com/nerdvegas/rez/blob/1d3b846d53b5b5404edfe8ddb9083f9ceec8c5e7/src/rez/build_system.py#L167-L195
232,626
nerdvegas/rez
src/rez/build_system.py
BuildSystem.get_standard_vars
def get_standard_vars(cls, context, variant, build_type, install, build_path, install_path=None): """Returns a standard set of environment variables that can be set for the build system to use """ from rez.config import config package = variant.parent ...
python
def get_standard_vars(cls, context, variant, build_type, install, build_path, install_path=None): """Returns a standard set of environment variables that can be set for the build system to use """ from rez.config import config package = variant.parent ...
[ "def", "get_standard_vars", "(", "cls", ",", "context", ",", "variant", ",", "build_type", ",", "install", ",", "build_path", ",", "install_path", "=", "None", ")", ":", "from", "rez", ".", "config", "import", "config", "package", "=", "variant", ".", "par...
Returns a standard set of environment variables that can be set for the build system to use
[ "Returns", "a", "standard", "set", "of", "environment", "variables", "that", "can", "be", "set", "for", "the", "build", "system", "to", "use" ]
1d3b846d53b5b5404edfe8ddb9083f9ceec8c5e7
https://github.com/nerdvegas/rez/blob/1d3b846d53b5b5404edfe8ddb9083f9ceec8c5e7/src/rez/build_system.py#L198-L243
232,627
nerdvegas/rez
src/rez/build_system.py
BuildSystem.set_standard_vars
def set_standard_vars(cls, executor, context, variant, build_type, install, build_path, install_path=None): """Sets a standard set of environment variables for the build system to use """ vars = cls.get_standard_vars(context=context, ...
python
def set_standard_vars(cls, executor, context, variant, build_type, install, build_path, install_path=None): """Sets a standard set of environment variables for the build system to use """ vars = cls.get_standard_vars(context=context, ...
[ "def", "set_standard_vars", "(", "cls", ",", "executor", ",", "context", ",", "variant", ",", "build_type", ",", "install", ",", "build_path", ",", "install_path", "=", "None", ")", ":", "vars", "=", "cls", ".", "get_standard_vars", "(", "context", "=", "c...
Sets a standard set of environment variables for the build system to use
[ "Sets", "a", "standard", "set", "of", "environment", "variables", "for", "the", "build", "system", "to", "use" ]
1d3b846d53b5b5404edfe8ddb9083f9ceec8c5e7
https://github.com/nerdvegas/rez/blob/1d3b846d53b5b5404edfe8ddb9083f9ceec8c5e7/src/rez/build_system.py#L246-L259
232,628
nerdvegas/rez
src/rez/pip.py
run_pip_command
def run_pip_command(command_args, pip_version=None, python_version=None): """Run a pip command. Args: command_args (list of str): Args to pip. Returns: `subprocess.Popen`: Pip process. """ pip_exe, context = find_pip(pip_version, python_version) command = [pip_exe] + list(comma...
python
def run_pip_command(command_args, pip_version=None, python_version=None): """Run a pip command. Args: command_args (list of str): Args to pip. Returns: `subprocess.Popen`: Pip process. """ pip_exe, context = find_pip(pip_version, python_version) command = [pip_exe] + list(comma...
[ "def", "run_pip_command", "(", "command_args", ",", "pip_version", "=", "None", ",", "python_version", "=", "None", ")", ":", "pip_exe", ",", "context", "=", "find_pip", "(", "pip_version", ",", "python_version", ")", "command", "=", "[", "pip_exe", "]", "+"...
Run a pip command. Args: command_args (list of str): Args to pip. Returns: `subprocess.Popen`: Pip process.
[ "Run", "a", "pip", "command", "." ]
1d3b846d53b5b5404edfe8ddb9083f9ceec8c5e7
https://github.com/nerdvegas/rez/blob/1d3b846d53b5b5404edfe8ddb9083f9ceec8c5e7/src/rez/pip.py#L88-L103
232,629
nerdvegas/rez
src/rez/pip.py
find_pip
def find_pip(pip_version=None, python_version=None): """Find a pip exe using the given python version. Returns: 2-tuple: str: pip executable; `ResolvedContext`: Context containing pip, or None if we fell back to system pip. """ pip_exe = "pip" try: ...
python
def find_pip(pip_version=None, python_version=None): """Find a pip exe using the given python version. Returns: 2-tuple: str: pip executable; `ResolvedContext`: Context containing pip, or None if we fell back to system pip. """ pip_exe = "pip" try: ...
[ "def", "find_pip", "(", "pip_version", "=", "None", ",", "python_version", "=", "None", ")", ":", "pip_exe", "=", "\"pip\"", "try", ":", "context", "=", "create_context", "(", "pip_version", ",", "python_version", ")", "except", "BuildError", "as", "e", ":",...
Find a pip exe using the given python version. Returns: 2-tuple: str: pip executable; `ResolvedContext`: Context containing pip, or None if we fell back to system pip.
[ "Find", "a", "pip", "exe", "using", "the", "given", "python", "version", "." ]
1d3b846d53b5b5404edfe8ddb9083f9ceec8c5e7
https://github.com/nerdvegas/rez/blob/1d3b846d53b5b5404edfe8ddb9083f9ceec8c5e7/src/rez/pip.py#L106-L133
232,630
nerdvegas/rez
src/rez/pip.py
create_context
def create_context(pip_version=None, python_version=None): """Create a context containing the specific pip and python. Args: pip_version (str or `Version`): Version of pip to use, or latest if None. python_version (str or `Version`): Python version to use, or latest if None. Re...
python
def create_context(pip_version=None, python_version=None): """Create a context containing the specific pip and python. Args: pip_version (str or `Version`): Version of pip to use, or latest if None. python_version (str or `Version`): Python version to use, or latest if None. Re...
[ "def", "create_context", "(", "pip_version", "=", "None", ",", "python_version", "=", "None", ")", ":", "# determine pip pkg to use for install, and python variants to install on", "if", "pip_version", ":", "pip_req", "=", "\"pip-%s\"", "%", "str", "(", "pip_version", "...
Create a context containing the specific pip and python. Args: pip_version (str or `Version`): Version of pip to use, or latest if None. python_version (str or `Version`): Python version to use, or latest if None. Returns: `ResolvedContext`: Context containing pip and pytho...
[ "Create", "a", "context", "containing", "the", "specific", "pip", "and", "python", "." ]
1d3b846d53b5b5404edfe8ddb9083f9ceec8c5e7
https://github.com/nerdvegas/rez/blob/1d3b846d53b5b5404edfe8ddb9083f9ceec8c5e7/src/rez/pip.py#L136-L182
232,631
nerdvegas/rez
src/rez/utils/backcompat.py
convert_old_variant_handle
def convert_old_variant_handle(handle_dict): """Convert a variant handle from serialize_version < 4.0.""" old_variables = handle_dict.get("variables", {}) variables = dict(repository_type="filesystem") for old_key, key in variant_key_conversions.iteritems(): value = old_variables.get(old_key) ...
python
def convert_old_variant_handle(handle_dict): """Convert a variant handle from serialize_version < 4.0.""" old_variables = handle_dict.get("variables", {}) variables = dict(repository_type="filesystem") for old_key, key in variant_key_conversions.iteritems(): value = old_variables.get(old_key) ...
[ "def", "convert_old_variant_handle", "(", "handle_dict", ")", ":", "old_variables", "=", "handle_dict", ".", "get", "(", "\"variables\"", ",", "{", "}", ")", "variables", "=", "dict", "(", "repository_type", "=", "\"filesystem\"", ")", "for", "old_key", ",", "...
Convert a variant handle from serialize_version < 4.0.
[ "Convert", "a", "variant", "handle", "from", "serialize_version", "<", "4", ".", "0", "." ]
1d3b846d53b5b5404edfe8ddb9083f9ceec8c5e7
https://github.com/nerdvegas/rez/blob/1d3b846d53b5b5404edfe8ddb9083f9ceec8c5e7/src/rez/utils/backcompat.py#L20-L37
232,632
nerdvegas/rez
src/rez/utils/py_dist.py
convert_requirement
def convert_requirement(req): """ Converts a pkg_resources.Requirement object into a list of Rez package request strings. """ pkg_name = convert_name(req.project_name) if not req.specs: return [pkg_name] req_strs = [] for spec in req.specs: op, ver = spec ver = c...
python
def convert_requirement(req): """ Converts a pkg_resources.Requirement object into a list of Rez package request strings. """ pkg_name = convert_name(req.project_name) if not req.specs: return [pkg_name] req_strs = [] for spec in req.specs: op, ver = spec ver = c...
[ "def", "convert_requirement", "(", "req", ")", ":", "pkg_name", "=", "convert_name", "(", "req", ".", "project_name", ")", "if", "not", "req", ".", "specs", ":", "return", "[", "pkg_name", "]", "req_strs", "=", "[", "]", "for", "spec", "in", "req", "."...
Converts a pkg_resources.Requirement object into a list of Rez package request strings.
[ "Converts", "a", "pkg_resources", ".", "Requirement", "object", "into", "a", "list", "of", "Rez", "package", "request", "strings", "." ]
1d3b846d53b5b5404edfe8ddb9083f9ceec8c5e7
https://github.com/nerdvegas/rez/blob/1d3b846d53b5b5404edfe8ddb9083f9ceec8c5e7/src/rez/utils/py_dist.py#L42-L80
232,633
nerdvegas/rez
src/rez/utils/py_dist.py
get_dist_dependencies
def get_dist_dependencies(name, recurse=True): """ Get the dependencies of the given, already installed distribution. @param recurse If True, recursively find all dependencies. @returns A set of package names. @note The first entry in the list is always the top-level package itself. """ dist...
python
def get_dist_dependencies(name, recurse=True): """ Get the dependencies of the given, already installed distribution. @param recurse If True, recursively find all dependencies. @returns A set of package names. @note The first entry in the list is always the top-level package itself. """ dist...
[ "def", "get_dist_dependencies", "(", "name", ",", "recurse", "=", "True", ")", ":", "dist", "=", "pkg_resources", ".", "get_distribution", "(", "name", ")", "pkg_name", "=", "convert_name", "(", "dist", ".", "project_name", ")", "reqs", "=", "set", "(", ")...
Get the dependencies of the given, already installed distribution. @param recurse If True, recursively find all dependencies. @returns A set of package names. @note The first entry in the list is always the top-level package itself.
[ "Get", "the", "dependencies", "of", "the", "given", "already", "installed", "distribution", "." ]
1d3b846d53b5b5404edfe8ddb9083f9ceec8c5e7
https://github.com/nerdvegas/rez/blob/1d3b846d53b5b5404edfe8ddb9083f9ceec8c5e7/src/rez/utils/py_dist.py#L83-L114
232,634
nerdvegas/rez
src/rez/vendor/pygraph/mixins/common.py
common.add_graph
def add_graph(self, other): """ Add other graph to this graph. @attention: Attributes and labels are not preserved. @type other: graph @param other: Graph """ self.add_nodes( n for n in other.nodes() if not n in self.nodes() ) f...
python
def add_graph(self, other): """ Add other graph to this graph. @attention: Attributes and labels are not preserved. @type other: graph @param other: Graph """ self.add_nodes( n for n in other.nodes() if not n in self.nodes() ) f...
[ "def", "add_graph", "(", "self", ",", "other", ")", ":", "self", ".", "add_nodes", "(", "n", "for", "n", "in", "other", ".", "nodes", "(", ")", "if", "not", "n", "in", "self", ".", "nodes", "(", ")", ")", "for", "each_node", "in", "other", ".", ...
Add other graph to this graph. @attention: Attributes and labels are not preserved. @type other: graph @param other: Graph
[ "Add", "other", "graph", "to", "this", "graph", "." ]
1d3b846d53b5b5404edfe8ddb9083f9ceec8c5e7
https://github.com/nerdvegas/rez/blob/1d3b846d53b5b5404edfe8ddb9083f9ceec8c5e7/src/rez/vendor/pygraph/mixins/common.py#L107-L121
232,635
nerdvegas/rez
src/rez/vendor/pygraph/mixins/common.py
common.add_spanning_tree
def add_spanning_tree(self, st): """ Add a spanning tree to the graph. @type st: dictionary @param st: Spanning tree. """ self.add_nodes(list(st.keys())) for each in st: if (st[each] is not None): self.add_edge((st[each], each...
python
def add_spanning_tree(self, st): """ Add a spanning tree to the graph. @type st: dictionary @param st: Spanning tree. """ self.add_nodes(list(st.keys())) for each in st: if (st[each] is not None): self.add_edge((st[each], each...
[ "def", "add_spanning_tree", "(", "self", ",", "st", ")", ":", "self", ".", "add_nodes", "(", "list", "(", "st", ".", "keys", "(", ")", ")", ")", "for", "each", "in", "st", ":", "if", "(", "st", "[", "each", "]", "is", "not", "None", ")", ":", ...
Add a spanning tree to the graph. @type st: dictionary @param st: Spanning tree.
[ "Add", "a", "spanning", "tree", "to", "the", "graph", "." ]
1d3b846d53b5b5404edfe8ddb9083f9ceec8c5e7
https://github.com/nerdvegas/rez/blob/1d3b846d53b5b5404edfe8ddb9083f9ceec8c5e7/src/rez/vendor/pygraph/mixins/common.py#L124-L134
232,636
nerdvegas/rez
src/rez/vendor/pygraph/mixins/common.py
common.complete
def complete(self): """ Make the graph a complete graph. @attention: This will modify the current graph. """ for each in self.nodes(): for other in self.nodes(): if (each != other and not self.has_edge((each, other))): self...
python
def complete(self): """ Make the graph a complete graph. @attention: This will modify the current graph. """ for each in self.nodes(): for other in self.nodes(): if (each != other and not self.has_edge((each, other))): self...
[ "def", "complete", "(", "self", ")", ":", "for", "each", "in", "self", ".", "nodes", "(", ")", ":", "for", "other", "in", "self", ".", "nodes", "(", ")", ":", "if", "(", "each", "!=", "other", "and", "not", "self", ".", "has_edge", "(", "(", "e...
Make the graph a complete graph. @attention: This will modify the current graph.
[ "Make", "the", "graph", "a", "complete", "graph", "." ]
1d3b846d53b5b5404edfe8ddb9083f9ceec8c5e7
https://github.com/nerdvegas/rez/blob/1d3b846d53b5b5404edfe8ddb9083f9ceec8c5e7/src/rez/vendor/pygraph/mixins/common.py#L137-L146
232,637
nerdvegas/rez
src/rez/vendor/pygraph/mixins/common.py
common.inverse
def inverse(self): """ Return the inverse of the graph. @rtype: graph @return: Complement graph for the graph. """ inv = self.__class__() inv.add_nodes(self.nodes()) inv.complete() for each in self.edges(): if (inv.has_edge(ea...
python
def inverse(self): """ Return the inverse of the graph. @rtype: graph @return: Complement graph for the graph. """ inv = self.__class__() inv.add_nodes(self.nodes()) inv.complete() for each in self.edges(): if (inv.has_edge(ea...
[ "def", "inverse", "(", "self", ")", ":", "inv", "=", "self", ".", "__class__", "(", ")", "inv", ".", "add_nodes", "(", "self", ".", "nodes", "(", ")", ")", "inv", ".", "complete", "(", ")", "for", "each", "in", "self", ".", "edges", "(", ")", "...
Return the inverse of the graph. @rtype: graph @return: Complement graph for the graph.
[ "Return", "the", "inverse", "of", "the", "graph", "." ]
1d3b846d53b5b5404edfe8ddb9083f9ceec8c5e7
https://github.com/nerdvegas/rez/blob/1d3b846d53b5b5404edfe8ddb9083f9ceec8c5e7/src/rez/vendor/pygraph/mixins/common.py#L149-L162
232,638
nerdvegas/rez
src/rez/vendor/pygraph/mixins/common.py
common.reverse
def reverse(self): """ Generate the reverse of a directed graph, returns an identical graph if not directed. Attributes & weights are preserved. @rtype: digraph @return: The directed graph that should be reversed. """ assert self.DIRECTED, "Undirected gra...
python
def reverse(self): """ Generate the reverse of a directed graph, returns an identical graph if not directed. Attributes & weights are preserved. @rtype: digraph @return: The directed graph that should be reversed. """ assert self.DIRECTED, "Undirected gra...
[ "def", "reverse", "(", "self", ")", ":", "assert", "self", ".", "DIRECTED", ",", "\"Undirected graph types such as %s cannot be reversed\"", "%", "self", ".", "__class__", ".", "__name__", "N", "=", "self", ".", "__class__", "(", ")", "#- Add the nodes", "N", "....
Generate the reverse of a directed graph, returns an identical graph if not directed. Attributes & weights are preserved. @rtype: digraph @return: The directed graph that should be reversed.
[ "Generate", "the", "reverse", "of", "a", "directed", "graph", "returns", "an", "identical", "graph", "if", "not", "directed", ".", "Attributes", "&", "weights", "are", "preserved", "." ]
1d3b846d53b5b5404edfe8ddb9083f9ceec8c5e7
https://github.com/nerdvegas/rez/blob/1d3b846d53b5b5404edfe8ddb9083f9ceec8c5e7/src/rez/vendor/pygraph/mixins/common.py#L164-L185
232,639
nerdvegas/rez
src/rez/resolved_context.py
get_lock_request
def get_lock_request(name, version, patch_lock, weak=True): """Given a package and patch lock, return the equivalent request. For example, for object 'foo-1.2.1' and lock type 'lock_3', the equivalent request is '~foo-1.2'. This restricts updates to foo to patch-or-lower version changes only. For ...
python
def get_lock_request(name, version, patch_lock, weak=True): """Given a package and patch lock, return the equivalent request. For example, for object 'foo-1.2.1' and lock type 'lock_3', the equivalent request is '~foo-1.2'. This restricts updates to foo to patch-or-lower version changes only. For ...
[ "def", "get_lock_request", "(", "name", ",", "version", ",", "patch_lock", ",", "weak", "=", "True", ")", ":", "ch", "=", "'~'", "if", "weak", "else", "''", "if", "patch_lock", "==", "PatchLock", ".", "lock", ":", "s", "=", "\"%s%s==%s\"", "%", "(", ...
Given a package and patch lock, return the equivalent request. For example, for object 'foo-1.2.1' and lock type 'lock_3', the equivalent request is '~foo-1.2'. This restricts updates to foo to patch-or-lower version changes only. For objects not versioned down to a given lock level, the closest possi...
[ "Given", "a", "package", "and", "patch", "lock", "return", "the", "equivalent", "request", "." ]
1d3b846d53b5b5404edfe8ddb9083f9ceec8c5e7
https://github.com/nerdvegas/rez/blob/1d3b846d53b5b5404edfe8ddb9083f9ceec8c5e7/src/rez/resolved_context.py#L76-L102
232,640
nerdvegas/rez
src/rez/resolved_context.py
ResolvedContext.requested_packages
def requested_packages(self, include_implicit=False): """Get packages in the request. Args: include_implicit (bool): If True, implicit packages are appended to the result. Returns: List of `PackageRequest` objects. """ if include_implicit...
python
def requested_packages(self, include_implicit=False): """Get packages in the request. Args: include_implicit (bool): If True, implicit packages are appended to the result. Returns: List of `PackageRequest` objects. """ if include_implicit...
[ "def", "requested_packages", "(", "self", ",", "include_implicit", "=", "False", ")", ":", "if", "include_implicit", ":", "return", "self", ".", "_package_requests", "+", "self", ".", "implicit_packages", "else", ":", "return", "self", ".", "_package_requests" ]
Get packages in the request. Args: include_implicit (bool): If True, implicit packages are appended to the result. Returns: List of `PackageRequest` objects.
[ "Get", "packages", "in", "the", "request", "." ]
1d3b846d53b5b5404edfe8ddb9083f9ceec8c5e7
https://github.com/nerdvegas/rez/blob/1d3b846d53b5b5404edfe8ddb9083f9ceec8c5e7/src/rez/resolved_context.py#L322-L335
232,641
nerdvegas/rez
src/rez/resolved_context.py
ResolvedContext.get_resolved_package
def get_resolved_package(self, name): """Returns a `Variant` object or None if the package is not in the resolve. """ pkgs = [x for x in self._resolved_packages if x.name == name] return pkgs[0] if pkgs else None
python
def get_resolved_package(self, name): """Returns a `Variant` object or None if the package is not in the resolve. """ pkgs = [x for x in self._resolved_packages if x.name == name] return pkgs[0] if pkgs else None
[ "def", "get_resolved_package", "(", "self", ",", "name", ")", ":", "pkgs", "=", "[", "x", "for", "x", "in", "self", ".", "_resolved_packages", "if", "x", ".", "name", "==", "name", "]", "return", "pkgs", "[", "0", "]", "if", "pkgs", "else", "None" ]
Returns a `Variant` object or None if the package is not in the resolve.
[ "Returns", "a", "Variant", "object", "or", "None", "if", "the", "package", "is", "not", "in", "the", "resolve", "." ]
1d3b846d53b5b5404edfe8ddb9083f9ceec8c5e7
https://github.com/nerdvegas/rez/blob/1d3b846d53b5b5404edfe8ddb9083f9ceec8c5e7/src/rez/resolved_context.py#L384-L389
232,642
nerdvegas/rez
src/rez/resolved_context.py
ResolvedContext.get_patched_request
def get_patched_request(self, package_requests=None, package_subtractions=None, strict=False, rank=0): """Get a 'patched' request. A patched request is a copy of this context's request, but with some changes applied. This can then be used to create a new, 'patched' ...
python
def get_patched_request(self, package_requests=None, package_subtractions=None, strict=False, rank=0): """Get a 'patched' request. A patched request is a copy of this context's request, but with some changes applied. This can then be used to create a new, 'patched' ...
[ "def", "get_patched_request", "(", "self", ",", "package_requests", "=", "None", ",", "package_subtractions", "=", "None", ",", "strict", "=", "False", ",", "rank", "=", "0", ")", ":", "# assemble source request", "if", "strict", ":", "request", "=", "[", "]...
Get a 'patched' request. A patched request is a copy of this context's request, but with some changes applied. This can then be used to create a new, 'patched' context. New package requests override original requests based on the type - normal, conflict or weak. So 'foo-2' over...
[ "Get", "a", "patched", "request", "." ]
1d3b846d53b5b5404edfe8ddb9083f9ceec8c5e7
https://github.com/nerdvegas/rez/blob/1d3b846d53b5b5404edfe8ddb9083f9ceec8c5e7/src/rez/resolved_context.py#L397-L495
232,643
nerdvegas/rez
src/rez/resolved_context.py
ResolvedContext.write_to_buffer
def write_to_buffer(self, buf): """Save the context to a buffer.""" doc = self.to_dict() if config.rxt_as_yaml: content = dump_yaml(doc) else: content = json.dumps(doc, indent=4, separators=(",", ": ")) buf.write(content)
python
def write_to_buffer(self, buf): """Save the context to a buffer.""" doc = self.to_dict() if config.rxt_as_yaml: content = dump_yaml(doc) else: content = json.dumps(doc, indent=4, separators=(",", ": ")) buf.write(content)
[ "def", "write_to_buffer", "(", "self", ",", "buf", ")", ":", "doc", "=", "self", ".", "to_dict", "(", ")", "if", "config", ".", "rxt_as_yaml", ":", "content", "=", "dump_yaml", "(", "doc", ")", "else", ":", "content", "=", "json", ".", "dumps", "(", ...
Save the context to a buffer.
[ "Save", "the", "context", "to", "a", "buffer", "." ]
1d3b846d53b5b5404edfe8ddb9083f9ceec8c5e7
https://github.com/nerdvegas/rez/blob/1d3b846d53b5b5404edfe8ddb9083f9ceec8c5e7/src/rez/resolved_context.py#L533-L542
232,644
nerdvegas/rez
src/rez/resolved_context.py
ResolvedContext.get_current
def get_current(cls): """Get the context for the current env, if there is one. Returns: `ResolvedContext`: Current context, or None if not in a resolved env. """ filepath = os.getenv("REZ_RXT_FILE") if not filepath or not os.path.exists(filepath): return ...
python
def get_current(cls): """Get the context for the current env, if there is one. Returns: `ResolvedContext`: Current context, or None if not in a resolved env. """ filepath = os.getenv("REZ_RXT_FILE") if not filepath or not os.path.exists(filepath): return ...
[ "def", "get_current", "(", "cls", ")", ":", "filepath", "=", "os", ".", "getenv", "(", "\"REZ_RXT_FILE\"", ")", "if", "not", "filepath", "or", "not", "os", ".", "path", ".", "exists", "(", "filepath", ")", ":", "return", "None", "return", "cls", ".", ...
Get the context for the current env, if there is one. Returns: `ResolvedContext`: Current context, or None if not in a resolved env.
[ "Get", "the", "context", "for", "the", "current", "env", "if", "there", "is", "one", "." ]
1d3b846d53b5b5404edfe8ddb9083f9ceec8c5e7
https://github.com/nerdvegas/rez/blob/1d3b846d53b5b5404edfe8ddb9083f9ceec8c5e7/src/rez/resolved_context.py#L545-L555
232,645
nerdvegas/rez
src/rez/resolved_context.py
ResolvedContext.load
def load(cls, path): """Load a resolved context from file.""" with open(path) as f: context = cls.read_from_buffer(f, path) context.set_load_path(path) return context
python
def load(cls, path): """Load a resolved context from file.""" with open(path) as f: context = cls.read_from_buffer(f, path) context.set_load_path(path) return context
[ "def", "load", "(", "cls", ",", "path", ")", ":", "with", "open", "(", "path", ")", "as", "f", ":", "context", "=", "cls", ".", "read_from_buffer", "(", "f", ",", "path", ")", "context", ".", "set_load_path", "(", "path", ")", "return", "context" ]
Load a resolved context from file.
[ "Load", "a", "resolved", "context", "from", "file", "." ]
1d3b846d53b5b5404edfe8ddb9083f9ceec8c5e7
https://github.com/nerdvegas/rez/blob/1d3b846d53b5b5404edfe8ddb9083f9ceec8c5e7/src/rez/resolved_context.py#L558-L563
232,646
nerdvegas/rez
src/rez/resolved_context.py
ResolvedContext.read_from_buffer
def read_from_buffer(cls, buf, identifier_str=None): """Load the context from a buffer.""" try: return cls._read_from_buffer(buf, identifier_str) except Exception as e: cls._load_error(e, identifier_str)
python
def read_from_buffer(cls, buf, identifier_str=None): """Load the context from a buffer.""" try: return cls._read_from_buffer(buf, identifier_str) except Exception as e: cls._load_error(e, identifier_str)
[ "def", "read_from_buffer", "(", "cls", ",", "buf", ",", "identifier_str", "=", "None", ")", ":", "try", ":", "return", "cls", ".", "_read_from_buffer", "(", "buf", ",", "identifier_str", ")", "except", "Exception", "as", "e", ":", "cls", ".", "_load_error"...
Load the context from a buffer.
[ "Load", "the", "context", "from", "a", "buffer", "." ]
1d3b846d53b5b5404edfe8ddb9083f9ceec8c5e7
https://github.com/nerdvegas/rez/blob/1d3b846d53b5b5404edfe8ddb9083f9ceec8c5e7/src/rez/resolved_context.py#L566-L571
232,647
nerdvegas/rez
src/rez/resolved_context.py
ResolvedContext.get_resolve_diff
def get_resolve_diff(self, other): """Get the difference between the resolve in this context and another. The difference is described from the point of view of the current context - a newer package means that the package in `other` is newer than the package in `self`. Diffs can...
python
def get_resolve_diff(self, other): """Get the difference between the resolve in this context and another. The difference is described from the point of view of the current context - a newer package means that the package in `other` is newer than the package in `self`. Diffs can...
[ "def", "get_resolve_diff", "(", "self", ",", "other", ")", ":", "if", "self", ".", "package_paths", "!=", "other", ".", "package_paths", ":", "from", "difflib", "import", "ndiff", "diff", "=", "ndiff", "(", "self", ".", "package_paths", ",", "other", ".", ...
Get the difference between the resolve in this context and another. The difference is described from the point of view of the current context - a newer package means that the package in `other` is newer than the package in `self`. Diffs can only be compared if their package search path...
[ "Get", "the", "difference", "between", "the", "resolve", "in", "this", "context", "and", "another", "." ]
1d3b846d53b5b5404edfe8ddb9083f9ceec8c5e7
https://github.com/nerdvegas/rez/blob/1d3b846d53b5b5404edfe8ddb9083f9ceec8c5e7/src/rez/resolved_context.py#L573-L657
232,648
nerdvegas/rez
src/rez/resolved_context.py
ResolvedContext.print_resolve_diff
def print_resolve_diff(self, other, heading=None): """Print the difference between the resolve of two contexts. Args: other (`ResolvedContext`): Context to compare to. heading: One of: - None: Do not display a heading; - True: Display the filename...
python
def print_resolve_diff(self, other, heading=None): """Print the difference between the resolve of two contexts. Args: other (`ResolvedContext`): Context to compare to. heading: One of: - None: Do not display a heading; - True: Display the filename...
[ "def", "print_resolve_diff", "(", "self", ",", "other", ",", "heading", "=", "None", ")", ":", "d", "=", "self", ".", "get_resolve_diff", "(", "other", ")", "if", "not", "d", ":", "return", "rows", "=", "[", "]", "if", "heading", "is", "True", "and",...
Print the difference between the resolve of two contexts. Args: other (`ResolvedContext`): Context to compare to. heading: One of: - None: Do not display a heading; - True: Display the filename of each context as a heading, if both conte...
[ "Print", "the", "difference", "between", "the", "resolve", "of", "two", "contexts", "." ]
1d3b846d53b5b5404edfe8ddb9083f9ceec8c5e7
https://github.com/nerdvegas/rez/blob/1d3b846d53b5b5404edfe8ddb9083f9ceec8c5e7/src/rez/resolved_context.py#L809-L865
232,649
nerdvegas/rez
src/rez/resolved_context.py
ResolvedContext.get_dependency_graph
def get_dependency_graph(self): """Generate the dependency graph. The dependency graph is a simpler subset of the resolve graph. It contains package name nodes connected directly to their dependencies. Weak references and conflict requests are not included in the graph. The depe...
python
def get_dependency_graph(self): """Generate the dependency graph. The dependency graph is a simpler subset of the resolve graph. It contains package name nodes connected directly to their dependencies. Weak references and conflict requests are not included in the graph. The depe...
[ "def", "get_dependency_graph", "(", "self", ")", ":", "from", "rez", ".", "vendor", ".", "pygraph", ".", "classes", ".", "digraph", "import", "digraph", "nodes", "=", "{", "}", "edges", "=", "set", "(", ")", "for", "variant", "in", "self", ".", "_resol...
Generate the dependency graph. The dependency graph is a simpler subset of the resolve graph. It contains package name nodes connected directly to their dependencies. Weak references and conflict requests are not included in the graph. The dependency graph does not show conflicts. ...
[ "Generate", "the", "dependency", "graph", "." ]
1d3b846d53b5b5404edfe8ddb9083f9ceec8c5e7
https://github.com/nerdvegas/rez/blob/1d3b846d53b5b5404edfe8ddb9083f9ceec8c5e7/src/rez/resolved_context.py#L878-L910
232,650
nerdvegas/rez
src/rez/resolved_context.py
ResolvedContext.validate
def validate(self): """Validate the context.""" try: for pkg in self.resolved_packages: pkg.validate_data() except RezError as e: raise ResolvedContextError("%s: %s" % (e.__class__.__name__, str(e)))
python
def validate(self): """Validate the context.""" try: for pkg in self.resolved_packages: pkg.validate_data() except RezError as e: raise ResolvedContextError("%s: %s" % (e.__class__.__name__, str(e)))
[ "def", "validate", "(", "self", ")", ":", "try", ":", "for", "pkg", "in", "self", ".", "resolved_packages", ":", "pkg", ".", "validate_data", "(", ")", "except", "RezError", "as", "e", ":", "raise", "ResolvedContextError", "(", "\"%s: %s\"", "%", "(", "e...
Validate the context.
[ "Validate", "the", "context", "." ]
1d3b846d53b5b5404edfe8ddb9083f9ceec8c5e7
https://github.com/nerdvegas/rez/blob/1d3b846d53b5b5404edfe8ddb9083f9ceec8c5e7/src/rez/resolved_context.py#L913-L919
232,651
nerdvegas/rez
src/rez/resolved_context.py
ResolvedContext.get_environ
def get_environ(self, parent_environ=None): """Get the environ dict resulting from interpreting this context. @param parent_environ Environment to interpret the context within, defaults to os.environ if None. @returns The environment dict generated by this context, when ...
python
def get_environ(self, parent_environ=None): """Get the environ dict resulting from interpreting this context. @param parent_environ Environment to interpret the context within, defaults to os.environ if None. @returns The environment dict generated by this context, when ...
[ "def", "get_environ", "(", "self", ",", "parent_environ", "=", "None", ")", ":", "interp", "=", "Python", "(", "target_environ", "=", "{", "}", ",", "passive", "=", "True", ")", "executor", "=", "self", ".", "_create_executor", "(", "interp", ",", "paren...
Get the environ dict resulting from interpreting this context. @param parent_environ Environment to interpret the context within, defaults to os.environ if None. @returns The environment dict generated by this context, when interpreted in a python rex interpreter.
[ "Get", "the", "environ", "dict", "resulting", "from", "interpreting", "this", "context", "." ]
1d3b846d53b5b5404edfe8ddb9083f9ceec8c5e7
https://github.com/nerdvegas/rez/blob/1d3b846d53b5b5404edfe8ddb9083f9ceec8c5e7/src/rez/resolved_context.py#L922-L933
232,652
nerdvegas/rez
src/rez/resolved_context.py
ResolvedContext.get_key
def get_key(self, key, request_only=False): """Get a data key value for each resolved package. Args: key (str): String key of property, eg 'tools'. request_only (bool): If True, only return the key from resolved packages that were also present in the request. ...
python
def get_key(self, key, request_only=False): """Get a data key value for each resolved package. Args: key (str): String key of property, eg 'tools'. request_only (bool): If True, only return the key from resolved packages that were also present in the request. ...
[ "def", "get_key", "(", "self", ",", "key", ",", "request_only", "=", "False", ")", ":", "values", "=", "{", "}", "requested_names", "=", "[", "x", ".", "name", "for", "x", "in", "self", ".", "_package_requests", "if", "not", "x", ".", "conflict", "]"...
Get a data key value for each resolved package. Args: key (str): String key of property, eg 'tools'. request_only (bool): If True, only return the key from resolved packages that were also present in the request. Returns: Dict of {pkg-name: (variant,...
[ "Get", "a", "data", "key", "value", "for", "each", "resolved", "package", "." ]
1d3b846d53b5b5404edfe8ddb9083f9ceec8c5e7
https://github.com/nerdvegas/rez/blob/1d3b846d53b5b5404edfe8ddb9083f9ceec8c5e7/src/rez/resolved_context.py#L936-L957
232,653
nerdvegas/rez
src/rez/resolved_context.py
ResolvedContext.get_conflicting_tools
def get_conflicting_tools(self, request_only=False): """Returns tools of the same name provided by more than one package. Args: request_only: If True, only return the key from resolved packages that were also present in the request. Returns: Dict of {too...
python
def get_conflicting_tools(self, request_only=False): """Returns tools of the same name provided by more than one package. Args: request_only: If True, only return the key from resolved packages that were also present in the request. Returns: Dict of {too...
[ "def", "get_conflicting_tools", "(", "self", ",", "request_only", "=", "False", ")", ":", "from", "collections", "import", "defaultdict", "tool_sets", "=", "defaultdict", "(", "set", ")", "tools_dict", "=", "self", ".", "get_tools", "(", "request_only", "=", "...
Returns tools of the same name provided by more than one package. Args: request_only: If True, only return the key from resolved packages that were also present in the request. Returns: Dict of {tool-name: set([Variant])}.
[ "Returns", "tools", "of", "the", "same", "name", "provided", "by", "more", "than", "one", "package", "." ]
1d3b846d53b5b5404edfe8ddb9083f9ceec8c5e7
https://github.com/nerdvegas/rez/blob/1d3b846d53b5b5404edfe8ddb9083f9ceec8c5e7/src/rez/resolved_context.py#L994-L1013
232,654
nerdvegas/rez
src/rez/resolved_context.py
ResolvedContext.get_shell_code
def get_shell_code(self, shell=None, parent_environ=None, style=OutputStyle.file): """Get the shell code resulting from intepreting this context. Args: shell (str): Shell type, for eg 'bash'. If None, the current shell type is used. parent_environ (dict): Environ...
python
def get_shell_code(self, shell=None, parent_environ=None, style=OutputStyle.file): """Get the shell code resulting from intepreting this context. Args: shell (str): Shell type, for eg 'bash'. If None, the current shell type is used. parent_environ (dict): Environ...
[ "def", "get_shell_code", "(", "self", ",", "shell", "=", "None", ",", "parent_environ", "=", "None", ",", "style", "=", "OutputStyle", ".", "file", ")", ":", "executor", "=", "self", ".", "_create_executor", "(", "interpreter", "=", "create_shell", "(", "s...
Get the shell code resulting from intepreting this context. Args: shell (str): Shell type, for eg 'bash'. If None, the current shell type is used. parent_environ (dict): Environment to interpret the context within, defaults to os.environ if None. ...
[ "Get", "the", "shell", "code", "resulting", "from", "intepreting", "this", "context", "." ]
1d3b846d53b5b5404edfe8ddb9083f9ceec8c5e7
https://github.com/nerdvegas/rez/blob/1d3b846d53b5b5404edfe8ddb9083f9ceec8c5e7/src/rez/resolved_context.py#L1016-L1033
232,655
nerdvegas/rez
src/rez/resolved_context.py
ResolvedContext.get_actions
def get_actions(self, parent_environ=None): """Get the list of rex.Action objects resulting from interpreting this context. This is provided mainly for testing purposes. Args: parent_environ Environment to interpret the context within, defaults to os.environ if None....
python
def get_actions(self, parent_environ=None): """Get the list of rex.Action objects resulting from interpreting this context. This is provided mainly for testing purposes. Args: parent_environ Environment to interpret the context within, defaults to os.environ if None....
[ "def", "get_actions", "(", "self", ",", "parent_environ", "=", "None", ")", ":", "interp", "=", "Python", "(", "target_environ", "=", "{", "}", ",", "passive", "=", "True", ")", "executor", "=", "self", ".", "_create_executor", "(", "interp", ",", "paren...
Get the list of rex.Action objects resulting from interpreting this context. This is provided mainly for testing purposes. Args: parent_environ Environment to interpret the context within, defaults to os.environ if None. Returns: A list of rex.Action sub...
[ "Get", "the", "list", "of", "rex", ".", "Action", "objects", "resulting", "from", "interpreting", "this", "context", ".", "This", "is", "provided", "mainly", "for", "testing", "purposes", "." ]
1d3b846d53b5b5404edfe8ddb9083f9ceec8c5e7
https://github.com/nerdvegas/rez/blob/1d3b846d53b5b5404edfe8ddb9083f9ceec8c5e7/src/rez/resolved_context.py#L1036-L1050
232,656
nerdvegas/rez
src/rez/resolved_context.py
ResolvedContext.apply
def apply(self, parent_environ=None): """Apply the context to the current python session. Note that this updates os.environ and possibly sys.path, if `parent_environ` is not provided. Args: parent_environ: Environment to interpret the context within, default...
python
def apply(self, parent_environ=None): """Apply the context to the current python session. Note that this updates os.environ and possibly sys.path, if `parent_environ` is not provided. Args: parent_environ: Environment to interpret the context within, default...
[ "def", "apply", "(", "self", ",", "parent_environ", "=", "None", ")", ":", "interpreter", "=", "Python", "(", "target_environ", "=", "os", ".", "environ", ")", "executor", "=", "self", ".", "_create_executor", "(", "interpreter", ",", "parent_environ", ")", ...
Apply the context to the current python session. Note that this updates os.environ and possibly sys.path, if `parent_environ` is not provided. Args: parent_environ: Environment to interpret the context within, defaults to os.environ if None.
[ "Apply", "the", "context", "to", "the", "current", "python", "session", "." ]
1d3b846d53b5b5404edfe8ddb9083f9ceec8c5e7
https://github.com/nerdvegas/rez/blob/1d3b846d53b5b5404edfe8ddb9083f9ceec8c5e7/src/rez/resolved_context.py#L1053-L1066
232,657
nerdvegas/rez
src/rez/resolved_context.py
ResolvedContext.which
def which(self, cmd, parent_environ=None, fallback=False): """Find a program in the resolved environment. Args: cmd: String name of the program to find. parent_environ: Environment to interpret the context within, defaults to os.environ if None. fallb...
python
def which(self, cmd, parent_environ=None, fallback=False): """Find a program in the resolved environment. Args: cmd: String name of the program to find. parent_environ: Environment to interpret the context within, defaults to os.environ if None. fallb...
[ "def", "which", "(", "self", ",", "cmd", ",", "parent_environ", "=", "None", ",", "fallback", "=", "False", ")", ":", "env", "=", "self", ".", "get_environ", "(", "parent_environ", "=", "parent_environ", ")", "path", "=", "which", "(", "cmd", ",", "env...
Find a program in the resolved environment. Args: cmd: String name of the program to find. parent_environ: Environment to interpret the context within, defaults to os.environ if None. fallback: If True, and the program is not found in the context, ...
[ "Find", "a", "program", "in", "the", "resolved", "environment", "." ]
1d3b846d53b5b5404edfe8ddb9083f9ceec8c5e7
https://github.com/nerdvegas/rez/blob/1d3b846d53b5b5404edfe8ddb9083f9ceec8c5e7/src/rez/resolved_context.py#L1069-L1086
232,658
nerdvegas/rez
src/rez/resolved_context.py
ResolvedContext.execute_command
def execute_command(self, args, parent_environ=None, **subprocess_kwargs): """Run a command within a resolved context. This applies the context to a python environ dict, then runs a subprocess in that namespace. This is not a fully configured subshell - shell-specific commands such as a...
python
def execute_command(self, args, parent_environ=None, **subprocess_kwargs): """Run a command within a resolved context. This applies the context to a python environ dict, then runs a subprocess in that namespace. This is not a fully configured subshell - shell-specific commands such as a...
[ "def", "execute_command", "(", "self", ",", "args", ",", "parent_environ", "=", "None", ",", "*", "*", "subprocess_kwargs", ")", ":", "if", "parent_environ", "in", "(", "None", ",", "os", ".", "environ", ")", ":", "target_environ", "=", "{", "}", "else",...
Run a command within a resolved context. This applies the context to a python environ dict, then runs a subprocess in that namespace. This is not a fully configured subshell - shell-specific commands such as aliases will not be applied. To execute a command within a subshell instead, us...
[ "Run", "a", "command", "within", "a", "resolved", "context", "." ]
1d3b846d53b5b5404edfe8ddb9083f9ceec8c5e7
https://github.com/nerdvegas/rez/blob/1d3b846d53b5b5404edfe8ddb9083f9ceec8c5e7/src/rez/resolved_context.py#L1089-L1123
232,659
nerdvegas/rez
src/rez/resolved_context.py
ResolvedContext.execute_rex_code
def execute_rex_code(self, code, filename=None, shell=None, parent_environ=None, **Popen_args): """Run some rex code in the context. Note: This is just a convenience form of `execute_shell`. Args: code (str): Rex code to execute. fil...
python
def execute_rex_code(self, code, filename=None, shell=None, parent_environ=None, **Popen_args): """Run some rex code in the context. Note: This is just a convenience form of `execute_shell`. Args: code (str): Rex code to execute. fil...
[ "def", "execute_rex_code", "(", "self", ",", "code", ",", "filename", "=", "None", ",", "shell", "=", "None", ",", "parent_environ", "=", "None", ",", "*", "*", "Popen_args", ")", ":", "def", "_actions_callback", "(", "executor", ")", ":", "executor", "....
Run some rex code in the context. Note: This is just a convenience form of `execute_shell`. Args: code (str): Rex code to execute. filename (str): Filename to report if there are syntax errors. shell: Shell type, for eg 'bash'. If None, the current shell...
[ "Run", "some", "rex", "code", "in", "the", "context", "." ]
1d3b846d53b5b5404edfe8ddb9083f9ceec8c5e7
https://github.com/nerdvegas/rez/blob/1d3b846d53b5b5404edfe8ddb9083f9ceec8c5e7/src/rez/resolved_context.py#L1126-L1153
232,660
nerdvegas/rez
src/rez/resolved_context.py
ResolvedContext.execute_shell
def execute_shell(self, shell=None, parent_environ=None, rcfile=None, norc=False, stdin=False, command=None, quiet=False, block=None, actions_callback=None, post_actions_callback=None, context_filepath=None, start_new_session=False, detached=False, ...
python
def execute_shell(self, shell=None, parent_environ=None, rcfile=None, norc=False, stdin=False, command=None, quiet=False, block=None, actions_callback=None, post_actions_callback=None, context_filepath=None, start_new_session=False, detached=False, ...
[ "def", "execute_shell", "(", "self", ",", "shell", "=", "None", ",", "parent_environ", "=", "None", ",", "rcfile", "=", "None", ",", "norc", "=", "False", ",", "stdin", "=", "False", ",", "command", "=", "None", ",", "quiet", "=", "False", ",", "bloc...
Spawn a possibly-interactive shell. Args: shell: Shell type, for eg 'bash'. If None, the current shell type is used. parent_environ: Environment to run the shell process in, if None then the current environment is used. rcfile: Specify a file ...
[ "Spawn", "a", "possibly", "-", "interactive", "shell", "." ]
1d3b846d53b5b5404edfe8ddb9083f9ceec8c5e7
https://github.com/nerdvegas/rez/blob/1d3b846d53b5b5404edfe8ddb9083f9ceec8c5e7/src/rez/resolved_context.py#L1156-L1272
232,661
nerdvegas/rez
src/rez/resolved_context.py
ResolvedContext.to_dict
def to_dict(self, fields=None): """Convert context to dict containing only builtin types. Args: fields (list of str): If present, only write these fields into the dict. This can be used to avoid constructing expensive fields (such as 'graph') for some cases. ...
python
def to_dict(self, fields=None): """Convert context to dict containing only builtin types. Args: fields (list of str): If present, only write these fields into the dict. This can be used to avoid constructing expensive fields (such as 'graph') for some cases. ...
[ "def", "to_dict", "(", "self", ",", "fields", "=", "None", ")", ":", "data", "=", "{", "}", "def", "_add", "(", "field", ")", ":", "return", "(", "fields", "is", "None", "or", "field", "in", "fields", ")", "if", "_add", "(", "\"resolved_packages\"", ...
Convert context to dict containing only builtin types. Args: fields (list of str): If present, only write these fields into the dict. This can be used to avoid constructing expensive fields (such as 'graph') for some cases. Returns: dict: Dictifi...
[ "Convert", "context", "to", "dict", "containing", "only", "builtin", "types", "." ]
1d3b846d53b5b5404edfe8ddb9083f9ceec8c5e7
https://github.com/nerdvegas/rez/blob/1d3b846d53b5b5404edfe8ddb9083f9ceec8c5e7/src/rez/resolved_context.py#L1274-L1355
232,662
nerdvegas/rez
src/rez/utils/system.py
add_sys_paths
def add_sys_paths(paths): """Add to sys.path, and revert on scope exit. """ original_syspath = sys.path[:] sys.path.extend(paths) try: yield finally: sys.path = original_syspath
python
def add_sys_paths(paths): """Add to sys.path, and revert on scope exit. """ original_syspath = sys.path[:] sys.path.extend(paths) try: yield finally: sys.path = original_syspath
[ "def", "add_sys_paths", "(", "paths", ")", ":", "original_syspath", "=", "sys", ".", "path", "[", ":", "]", "sys", ".", "path", ".", "extend", "(", "paths", ")", "try", ":", "yield", "finally", ":", "sys", ".", "path", "=", "original_syspath" ]
Add to sys.path, and revert on scope exit.
[ "Add", "to", "sys", ".", "path", "and", "revert", "on", "scope", "exit", "." ]
1d3b846d53b5b5404edfe8ddb9083f9ceec8c5e7
https://github.com/nerdvegas/rez/blob/1d3b846d53b5b5404edfe8ddb9083f9ceec8c5e7/src/rez/utils/system.py#L7-L16
232,663
nerdvegas/rez
src/rez/utils/system.py
popen
def popen(args, **kwargs): """Wrapper for `subprocess.Popen`. Avoids python bug described here: https://bugs.python.org/issue3905. This can arise when apps (maya) install a non-standard stdin handler. In newer version of maya and katana, the sys.stdin object can also become replaced by an object w...
python
def popen(args, **kwargs): """Wrapper for `subprocess.Popen`. Avoids python bug described here: https://bugs.python.org/issue3905. This can arise when apps (maya) install a non-standard stdin handler. In newer version of maya and katana, the sys.stdin object can also become replaced by an object w...
[ "def", "popen", "(", "args", ",", "*", "*", "kwargs", ")", ":", "if", "\"stdin\"", "not", "in", "kwargs", ":", "try", ":", "file_no", "=", "sys", ".", "stdin", ".", "fileno", "(", ")", "except", "AttributeError", ":", "file_no", "=", "sys", ".", "_...
Wrapper for `subprocess.Popen`. Avoids python bug described here: https://bugs.python.org/issue3905. This can arise when apps (maya) install a non-standard stdin handler. In newer version of maya and katana, the sys.stdin object can also become replaced by an object with no 'fileno' attribute, this is...
[ "Wrapper", "for", "subprocess", ".", "Popen", "." ]
1d3b846d53b5b5404edfe8ddb9083f9ceec8c5e7
https://github.com/nerdvegas/rez/blob/1d3b846d53b5b5404edfe8ddb9083f9ceec8c5e7/src/rez/utils/system.py#L19-L38
232,664
nerdvegas/rez
src/rezplugins/release_vcs/git.py
GitReleaseVCS.get_relative_to_remote
def get_relative_to_remote(self): """Return the number of commits we are relative to the remote. Negative is behind, positive in front, zero means we are matched to remote. """ s = self.git("status", "--short", "-b")[0] r = re.compile("\[([^\]]+)\]") toks = r.findall(s) ...
python
def get_relative_to_remote(self): """Return the number of commits we are relative to the remote. Negative is behind, positive in front, zero means we are matched to remote. """ s = self.git("status", "--short", "-b")[0] r = re.compile("\[([^\]]+)\]") toks = r.findall(s) ...
[ "def", "get_relative_to_remote", "(", "self", ")", ":", "s", "=", "self", ".", "git", "(", "\"status\"", ",", "\"--short\"", ",", "\"-b\"", ")", "[", "0", "]", "r", "=", "re", ".", "compile", "(", "\"\\[([^\\]]+)\\]\"", ")", "toks", "=", "r", ".", "f...
Return the number of commits we are relative to the remote. Negative is behind, positive in front, zero means we are matched to remote.
[ "Return", "the", "number", "of", "commits", "we", "are", "relative", "to", "the", "remote", ".", "Negative", "is", "behind", "positive", "in", "front", "zero", "means", "we", "are", "matched", "to", "remote", "." ]
1d3b846d53b5b5404edfe8ddb9083f9ceec8c5e7
https://github.com/nerdvegas/rez/blob/1d3b846d53b5b5404edfe8ddb9083f9ceec8c5e7/src/rezplugins/release_vcs/git.py#L47-L66
232,665
nerdvegas/rez
src/rez/vendor/pygraph/classes/hypergraph.py
hypergraph.links
def links(self, obj): """ Return all nodes connected by the given hyperedge or all hyperedges connected to the given hypernode. @type obj: hyperedge @param obj: Object identifier. @rtype: list @return: List of node objects linked to the given h...
python
def links(self, obj): """ Return all nodes connected by the given hyperedge or all hyperedges connected to the given hypernode. @type obj: hyperedge @param obj: Object identifier. @rtype: list @return: List of node objects linked to the given h...
[ "def", "links", "(", "self", ",", "obj", ")", ":", "if", "obj", "in", "self", ".", "edge_links", ":", "return", "self", ".", "edge_links", "[", "obj", "]", "else", ":", "return", "self", ".", "node_links", "[", "obj", "]" ]
Return all nodes connected by the given hyperedge or all hyperedges connected to the given hypernode. @type obj: hyperedge @param obj: Object identifier. @rtype: list @return: List of node objects linked to the given hyperedge.
[ "Return", "all", "nodes", "connected", "by", "the", "given", "hyperedge", "or", "all", "hyperedges", "connected", "to", "the", "given", "hypernode", "." ]
1d3b846d53b5b5404edfe8ddb9083f9ceec8c5e7
https://github.com/nerdvegas/rez/blob/1d3b846d53b5b5404edfe8ddb9083f9ceec8c5e7/src/rez/vendor/pygraph/classes/hypergraph.py#L122-L136
232,666
nerdvegas/rez
src/rez/vendor/pygraph/classes/hypergraph.py
hypergraph.neighbors
def neighbors(self, obj): """ Return all neighbors adjacent to the given node. @type obj: node @param obj: Object identifier. @rtype: list @return: List of all node objects adjacent to the given node. """ neighbors = set([]) ...
python
def neighbors(self, obj): """ Return all neighbors adjacent to the given node. @type obj: node @param obj: Object identifier. @rtype: list @return: List of all node objects adjacent to the given node. """ neighbors = set([]) ...
[ "def", "neighbors", "(", "self", ",", "obj", ")", ":", "neighbors", "=", "set", "(", "[", "]", ")", "for", "e", "in", "self", ".", "node_links", "[", "obj", "]", ":", "neighbors", ".", "update", "(", "set", "(", "self", ".", "edge_links", "[", "e...
Return all neighbors adjacent to the given node. @type obj: node @param obj: Object identifier. @rtype: list @return: List of all node objects adjacent to the given node.
[ "Return", "all", "neighbors", "adjacent", "to", "the", "given", "node", "." ]
1d3b846d53b5b5404edfe8ddb9083f9ceec8c5e7
https://github.com/nerdvegas/rez/blob/1d3b846d53b5b5404edfe8ddb9083f9ceec8c5e7/src/rez/vendor/pygraph/classes/hypergraph.py#L139-L154
232,667
nerdvegas/rez
src/rez/vendor/pygraph/classes/hypergraph.py
hypergraph.del_node
def del_node(self, node): """ Delete a given node from the hypergraph. @type node: node @param node: Node identifier. """ if self.has_node(node): for e in self.node_links[node]: self.edge_links[e].remove(node) self.node_l...
python
def del_node(self, node): """ Delete a given node from the hypergraph. @type node: node @param node: Node identifier. """ if self.has_node(node): for e in self.node_links[node]: self.edge_links[e].remove(node) self.node_l...
[ "def", "del_node", "(", "self", ",", "node", ")", ":", "if", "self", ".", "has_node", "(", "node", ")", ":", "for", "e", "in", "self", ".", "node_links", "[", "node", "]", ":", "self", ".", "edge_links", "[", "e", "]", ".", "remove", "(", "node",...
Delete a given node from the hypergraph. @type node: node @param node: Node identifier.
[ "Delete", "a", "given", "node", "from", "the", "hypergraph", "." ]
1d3b846d53b5b5404edfe8ddb9083f9ceec8c5e7
https://github.com/nerdvegas/rez/blob/1d3b846d53b5b5404edfe8ddb9083f9ceec8c5e7/src/rez/vendor/pygraph/classes/hypergraph.py#L188-L200
232,668
nerdvegas/rez
src/rez/vendor/pygraph/classes/hypergraph.py
hypergraph.add_hyperedge
def add_hyperedge(self, hyperedge): """ Add given hyperedge to the hypergraph. @attention: While hyperedge-nodes can be of any type, it's strongly recommended to use only numbers and single-line strings as node identifiers if you intend to use write(). @type hyperedge:...
python
def add_hyperedge(self, hyperedge): """ Add given hyperedge to the hypergraph. @attention: While hyperedge-nodes can be of any type, it's strongly recommended to use only numbers and single-line strings as node identifiers if you intend to use write(). @type hyperedge:...
[ "def", "add_hyperedge", "(", "self", ",", "hyperedge", ")", ":", "if", "(", "not", "hyperedge", "in", "self", ".", "edge_links", ")", ":", "self", ".", "edge_links", "[", "hyperedge", "]", "=", "[", "]", "self", ".", "graph", ".", "add_node", "(", "(...
Add given hyperedge to the hypergraph. @attention: While hyperedge-nodes can be of any type, it's strongly recommended to use only numbers and single-line strings as node identifiers if you intend to use write(). @type hyperedge: hyperedge @param hyperedge: Hyperedge identifie...
[ "Add", "given", "hyperedge", "to", "the", "hypergraph", "." ]
1d3b846d53b5b5404edfe8ddb9083f9ceec8c5e7
https://github.com/nerdvegas/rez/blob/1d3b846d53b5b5404edfe8ddb9083f9ceec8c5e7/src/rez/vendor/pygraph/classes/hypergraph.py#L216-L228
232,669
nerdvegas/rez
src/rez/vendor/pygraph/classes/hypergraph.py
hypergraph.del_hyperedge
def del_hyperedge(self, hyperedge): """ Delete the given hyperedge. @type hyperedge: hyperedge @param hyperedge: Hyperedge identifier. """ if (hyperedge in self.hyperedges()): for n in self.edge_links[hyperedge]: self.node_links[n].re...
python
def del_hyperedge(self, hyperedge): """ Delete the given hyperedge. @type hyperedge: hyperedge @param hyperedge: Hyperedge identifier. """ if (hyperedge in self.hyperedges()): for n in self.edge_links[hyperedge]: self.node_links[n].re...
[ "def", "del_hyperedge", "(", "self", ",", "hyperedge", ")", ":", "if", "(", "hyperedge", "in", "self", ".", "hyperedges", "(", ")", ")", ":", "for", "n", "in", "self", ".", "edge_links", "[", "hyperedge", "]", ":", "self", ".", "node_links", "[", "n"...
Delete the given hyperedge. @type hyperedge: hyperedge @param hyperedge: Hyperedge identifier.
[ "Delete", "the", "given", "hyperedge", "." ]
1d3b846d53b5b5404edfe8ddb9083f9ceec8c5e7
https://github.com/nerdvegas/rez/blob/1d3b846d53b5b5404edfe8ddb9083f9ceec8c5e7/src/rez/vendor/pygraph/classes/hypergraph.py#L268-L281
232,670
nerdvegas/rez
src/rez/vendor/pygraph/classes/hypergraph.py
hypergraph.link
def link(self, node, hyperedge): """ Link given node and hyperedge. @type node: node @param node: Node. @type hyperedge: node @param hyperedge: Hyperedge. """ if (hyperedge not in self.node_links[node]): self.edge_links[hyperedge].append(no...
python
def link(self, node, hyperedge): """ Link given node and hyperedge. @type node: node @param node: Node. @type hyperedge: node @param hyperedge: Hyperedge. """ if (hyperedge not in self.node_links[node]): self.edge_links[hyperedge].append(no...
[ "def", "link", "(", "self", ",", "node", ",", "hyperedge", ")", ":", "if", "(", "hyperedge", "not", "in", "self", ".", "node_links", "[", "node", "]", ")", ":", "self", ".", "edge_links", "[", "hyperedge", "]", ".", "append", "(", "node", ")", "sel...
Link given node and hyperedge. @type node: node @param node: Node. @type hyperedge: node @param hyperedge: Hyperedge.
[ "Link", "given", "node", "and", "hyperedge", "." ]
1d3b846d53b5b5404edfe8ddb9083f9ceec8c5e7
https://github.com/nerdvegas/rez/blob/1d3b846d53b5b5404edfe8ddb9083f9ceec8c5e7/src/rez/vendor/pygraph/classes/hypergraph.py#L284-L299
232,671
nerdvegas/rez
src/rez/vendor/pygraph/classes/hypergraph.py
hypergraph.unlink
def unlink(self, node, hyperedge): """ Unlink given node and hyperedge. @type node: node @param node: Node. @type hyperedge: hyperedge @param hyperedge: Hyperedge. """ self.node_links[node].remove(hyperedge) self.edge_links[hyperedge].remove(no...
python
def unlink(self, node, hyperedge): """ Unlink given node and hyperedge. @type node: node @param node: Node. @type hyperedge: hyperedge @param hyperedge: Hyperedge. """ self.node_links[node].remove(hyperedge) self.edge_links[hyperedge].remove(no...
[ "def", "unlink", "(", "self", ",", "node", ",", "hyperedge", ")", ":", "self", ".", "node_links", "[", "node", "]", ".", "remove", "(", "hyperedge", ")", "self", ".", "edge_links", "[", "hyperedge", "]", ".", "remove", "(", "node", ")", "self", ".", ...
Unlink given node and hyperedge. @type node: node @param node: Node. @type hyperedge: hyperedge @param hyperedge: Hyperedge.
[ "Unlink", "given", "node", "and", "hyperedge", "." ]
1d3b846d53b5b5404edfe8ddb9083f9ceec8c5e7
https://github.com/nerdvegas/rez/blob/1d3b846d53b5b5404edfe8ddb9083f9ceec8c5e7/src/rez/vendor/pygraph/classes/hypergraph.py#L302-L314
232,672
nerdvegas/rez
src/rez/vendor/pygraph/classes/hypergraph.py
hypergraph.rank
def rank(self): """ Return the rank of the given hypergraph. @rtype: int @return: Rank of graph. """ max_rank = 0 for each in self.hyperedges(): if len(self.edge_links[each]) > max_rank: max_rank = len(self.edge_links...
python
def rank(self): """ Return the rank of the given hypergraph. @rtype: int @return: Rank of graph. """ max_rank = 0 for each in self.hyperedges(): if len(self.edge_links[each]) > max_rank: max_rank = len(self.edge_links...
[ "def", "rank", "(", "self", ")", ":", "max_rank", "=", "0", "for", "each", "in", "self", ".", "hyperedges", "(", ")", ":", "if", "len", "(", "self", ".", "edge_links", "[", "each", "]", ")", ">", "max_rank", ":", "max_rank", "=", "len", "(", "sel...
Return the rank of the given hypergraph. @rtype: int @return: Rank of graph.
[ "Return", "the", "rank", "of", "the", "given", "hypergraph", "." ]
1d3b846d53b5b5404edfe8ddb9083f9ceec8c5e7
https://github.com/nerdvegas/rez/blob/1d3b846d53b5b5404edfe8ddb9083f9ceec8c5e7/src/rez/vendor/pygraph/classes/hypergraph.py#L317-L330
232,673
nerdvegas/rez
src/rez/utils/base26.py
get_next_base26
def get_next_base26(prev=None): """Increment letter-based IDs. Generates IDs like ['a', 'b', ..., 'z', 'aa', ab', ..., 'az', 'ba', ...] Returns: str: Next base-26 ID. """ if not prev: return 'a' r = re.compile("^[a-z]*$") if not r.match(prev): raise ValueError("Inv...
python
def get_next_base26(prev=None): """Increment letter-based IDs. Generates IDs like ['a', 'b', ..., 'z', 'aa', ab', ..., 'az', 'ba', ...] Returns: str: Next base-26 ID. """ if not prev: return 'a' r = re.compile("^[a-z]*$") if not r.match(prev): raise ValueError("Inv...
[ "def", "get_next_base26", "(", "prev", "=", "None", ")", ":", "if", "not", "prev", ":", "return", "'a'", "r", "=", "re", ".", "compile", "(", "\"^[a-z]*$\"", ")", "if", "not", "r", ".", "match", "(", "prev", ")", ":", "raise", "ValueError", "(", "\...
Increment letter-based IDs. Generates IDs like ['a', 'b', ..., 'z', 'aa', ab', ..., 'az', 'ba', ...] Returns: str: Next base-26 ID.
[ "Increment", "letter", "-", "based", "IDs", "." ]
1d3b846d53b5b5404edfe8ddb9083f9ceec8c5e7
https://github.com/nerdvegas/rez/blob/1d3b846d53b5b5404edfe8ddb9083f9ceec8c5e7/src/rez/utils/base26.py#L9-L27
232,674
nerdvegas/rez
src/rez/utils/base26.py
create_unique_base26_symlink
def create_unique_base26_symlink(path, source): """Create a base-26 symlink in `path` pointing to `source`. If such a symlink already exists, it is returned. Note that there is a small chance that this function may create a new symlink when there is already one pointed at `source`. Assumes `path` ...
python
def create_unique_base26_symlink(path, source): """Create a base-26 symlink in `path` pointing to `source`. If such a symlink already exists, it is returned. Note that there is a small chance that this function may create a new symlink when there is already one pointed at `source`. Assumes `path` ...
[ "def", "create_unique_base26_symlink", "(", "path", ",", "source", ")", ":", "retries", "=", "0", "while", "True", ":", "# if a link already exists that points at `source`, return it", "name", "=", "find_matching_symlink", "(", "path", ",", "source", ")", "if", "name"...
Create a base-26 symlink in `path` pointing to `source`. If such a symlink already exists, it is returned. Note that there is a small chance that this function may create a new symlink when there is already one pointed at `source`. Assumes `path` only contains base26 symlinks. Returns: st...
[ "Create", "a", "base", "-", "26", "symlink", "in", "path", "pointing", "to", "source", "." ]
1d3b846d53b5b5404edfe8ddb9083f9ceec8c5e7
https://github.com/nerdvegas/rez/blob/1d3b846d53b5b5404edfe8ddb9083f9ceec8c5e7/src/rez/utils/base26.py#L30-L79
232,675
nerdvegas/rez
src/build_utils/virtualenv/virtualenv.py
find_wheels
def find_wheels(projects, search_dirs): """Find wheels from which we can import PROJECTS. Scan through SEARCH_DIRS for a wheel for each PROJECT in turn. Return a list of the first wheel found for each PROJECT """ wheels = [] # Look through SEARCH_DIRS for the first suitable wheel. Don't bothe...
python
def find_wheels(projects, search_dirs): """Find wheels from which we can import PROJECTS. Scan through SEARCH_DIRS for a wheel for each PROJECT in turn. Return a list of the first wheel found for each PROJECT """ wheels = [] # Look through SEARCH_DIRS for the first suitable wheel. Don't bothe...
[ "def", "find_wheels", "(", "projects", ",", "search_dirs", ")", ":", "wheels", "=", "[", "]", "# Look through SEARCH_DIRS for the first suitable wheel. Don't bother", "# about version checking here, as this is simply to get something we can", "# then use to install the correct version.",...
Find wheels from which we can import PROJECTS. Scan through SEARCH_DIRS for a wheel for each PROJECT in turn. Return a list of the first wheel found for each PROJECT
[ "Find", "wheels", "from", "which", "we", "can", "import", "PROJECTS", "." ]
1d3b846d53b5b5404edfe8ddb9083f9ceec8c5e7
https://github.com/nerdvegas/rez/blob/1d3b846d53b5b5404edfe8ddb9083f9ceec8c5e7/src/build_utils/virtualenv/virtualenv.py#L913-L937
232,676
nerdvegas/rez
src/build_utils/virtualenv/virtualenv.py
relative_script
def relative_script(lines): "Return a script that'll work in a relocatable environment." activate = "import os; activate_this=os.path.join(os.path.dirname(os.path.realpath(__file__)), 'activate_this.py'); exec(compile(open(activate_this).read(), activate_this, 'exec'), dict(__file__=activate_this)); del os, act...
python
def relative_script(lines): "Return a script that'll work in a relocatable environment." activate = "import os; activate_this=os.path.join(os.path.dirname(os.path.realpath(__file__)), 'activate_this.py'); exec(compile(open(activate_this).read(), activate_this, 'exec'), dict(__file__=activate_this)); del os, act...
[ "def", "relative_script", "(", "lines", ")", ":", "activate", "=", "\"import os; activate_this=os.path.join(os.path.dirname(os.path.realpath(__file__)), 'activate_this.py'); exec(compile(open(activate_this).read(), activate_this, 'exec'), dict(__file__=activate_this)); del os, activate_this\"", "#...
Return a script that'll work in a relocatable environment.
[ "Return", "a", "script", "that", "ll", "work", "in", "a", "relocatable", "environment", "." ]
1d3b846d53b5b5404edfe8ddb9083f9ceec8c5e7
https://github.com/nerdvegas/rez/blob/1d3b846d53b5b5404edfe8ddb9083f9ceec8c5e7/src/build_utils/virtualenv/virtualenv.py#L1670-L1683
232,677
nerdvegas/rez
src/build_utils/virtualenv/virtualenv.py
fixup_pth_and_egg_link
def fixup_pth_and_egg_link(home_dir, sys_path=None): """Makes .pth and .egg-link files use relative paths""" home_dir = os.path.normcase(os.path.abspath(home_dir)) if sys_path is None: sys_path = sys.path for path in sys_path: if not path: path = '.' if not os.path.is...
python
def fixup_pth_and_egg_link(home_dir, sys_path=None): """Makes .pth and .egg-link files use relative paths""" home_dir = os.path.normcase(os.path.abspath(home_dir)) if sys_path is None: sys_path = sys.path for path in sys_path: if not path: path = '.' if not os.path.is...
[ "def", "fixup_pth_and_egg_link", "(", "home_dir", ",", "sys_path", "=", "None", ")", ":", "home_dir", "=", "os", ".", "path", ".", "normcase", "(", "os", ".", "path", ".", "abspath", "(", "home_dir", ")", ")", "if", "sys_path", "is", "None", ":", "sys_...
Makes .pth and .egg-link files use relative paths
[ "Makes", ".", "pth", "and", ".", "egg", "-", "link", "files", "use", "relative", "paths" ]
1d3b846d53b5b5404edfe8ddb9083f9ceec8c5e7
https://github.com/nerdvegas/rez/blob/1d3b846d53b5b5404edfe8ddb9083f9ceec8c5e7/src/build_utils/virtualenv/virtualenv.py#L1685-L1710
232,678
nerdvegas/rez
src/build_utils/virtualenv/virtualenv.py
make_relative_path
def make_relative_path(source, dest, dest_is_directory=True): """ Make a filename relative, where the filename is dest, and it is being referred to from the filename source. >>> make_relative_path('/usr/share/something/a-file.pth', ... '/usr/share/another-place/src/Direct...
python
def make_relative_path(source, dest, dest_is_directory=True): """ Make a filename relative, where the filename is dest, and it is being referred to from the filename source. >>> make_relative_path('/usr/share/something/a-file.pth', ... '/usr/share/another-place/src/Direct...
[ "def", "make_relative_path", "(", "source", ",", "dest", ",", "dest_is_directory", "=", "True", ")", ":", "source", "=", "os", ".", "path", ".", "dirname", "(", "source", ")", "if", "not", "dest_is_directory", ":", "dest_filename", "=", "os", ".", "path", ...
Make a filename relative, where the filename is dest, and it is being referred to from the filename source. >>> make_relative_path('/usr/share/something/a-file.pth', ... '/usr/share/another-place/src/Directory') '../another-place/src/Directory' >>> make_relative_p...
[ "Make", "a", "filename", "relative", "where", "the", "filename", "is", "dest", "and", "it", "is", "being", "referred", "to", "from", "the", "filename", "source", "." ]
1d3b846d53b5b5404edfe8ddb9083f9ceec8c5e7
https://github.com/nerdvegas/rez/blob/1d3b846d53b5b5404edfe8ddb9083f9ceec8c5e7/src/build_utils/virtualenv/virtualenv.py#L1749-L1780
232,679
nerdvegas/rez
src/build_utils/virtualenv/virtualenv.py
create_bootstrap_script
def create_bootstrap_script(extra_text, python_version=''): """ Creates a bootstrap script, which is like this script but with extend_parser, adjust_options, and after_install hooks. This returns a string that (written to disk of course) can be used as a bootstrap script with your own customization...
python
def create_bootstrap_script(extra_text, python_version=''): """ Creates a bootstrap script, which is like this script but with extend_parser, adjust_options, and after_install hooks. This returns a string that (written to disk of course) can be used as a bootstrap script with your own customization...
[ "def", "create_bootstrap_script", "(", "extra_text", ",", "python_version", "=", "''", ")", ":", "filename", "=", "__file__", "if", "filename", ".", "endswith", "(", "'.pyc'", ")", ":", "filename", "=", "filename", "[", ":", "-", "1", "]", "f", "=", "cod...
Creates a bootstrap script, which is like this script but with extend_parser, adjust_options, and after_install hooks. This returns a string that (written to disk of course) can be used as a bootstrap script with your own customizations. The script will be the standard virtualenv.py script, with your ...
[ "Creates", "a", "bootstrap", "script", "which", "is", "like", "this", "script", "but", "with", "extend_parser", "adjust_options", "and", "after_install", "hooks", "." ]
1d3b846d53b5b5404edfe8ddb9083f9ceec8c5e7
https://github.com/nerdvegas/rez/blob/1d3b846d53b5b5404edfe8ddb9083f9ceec8c5e7/src/build_utils/virtualenv/virtualenv.py#L1787-L1837
232,680
nerdvegas/rez
src/build_utils/virtualenv/virtualenv.py
read_data
def read_data(file, endian, num=1): """ Read a given number of 32-bits unsigned integers from the given file with the given endianness. """ res = struct.unpack(endian + 'L' * num, file.read(num * 4)) if len(res) == 1: return res[0] return res
python
def read_data(file, endian, num=1): """ Read a given number of 32-bits unsigned integers from the given file with the given endianness. """ res = struct.unpack(endian + 'L' * num, file.read(num * 4)) if len(res) == 1: return res[0] return res
[ "def", "read_data", "(", "file", ",", "endian", ",", "num", "=", "1", ")", ":", "res", "=", "struct", ".", "unpack", "(", "endian", "+", "'L'", "*", "num", ",", "file", ".", "read", "(", "num", "*", "4", ")", ")", "if", "len", "(", "res", ")"...
Read a given number of 32-bits unsigned integers from the given file with the given endianness.
[ "Read", "a", "given", "number", "of", "32", "-", "bits", "unsigned", "integers", "from", "the", "given", "file", "with", "the", "given", "endianness", "." ]
1d3b846d53b5b5404edfe8ddb9083f9ceec8c5e7
https://github.com/nerdvegas/rez/blob/1d3b846d53b5b5404edfe8ddb9083f9ceec8c5e7/src/build_utils/virtualenv/virtualenv.py#L2269-L2277
232,681
nerdvegas/rez
src/build_utils/virtualenv/virtualenv.py
Logger._stdout_level
def _stdout_level(self): """Returns the level that stdout runs at""" for level, consumer in self.consumers: if consumer is sys.stdout: return level return self.FATAL
python
def _stdout_level(self): """Returns the level that stdout runs at""" for level, consumer in self.consumers: if consumer is sys.stdout: return level return self.FATAL
[ "def", "_stdout_level", "(", "self", ")", ":", "for", "level", ",", "consumer", "in", "self", ".", "consumers", ":", "if", "consumer", "is", "sys", ".", "stdout", ":", "return", "level", "return", "self", ".", "FATAL" ]
Returns the level that stdout runs at
[ "Returns", "the", "level", "that", "stdout", "runs", "at" ]
1d3b846d53b5b5404edfe8ddb9083f9ceec8c5e7
https://github.com/nerdvegas/rez/blob/1d3b846d53b5b5404edfe8ddb9083f9ceec8c5e7/src/build_utils/virtualenv/virtualenv.py#L396-L401
232,682
nerdvegas/rez
src/build_utils/virtualenv/virtualenv.py
ConfigOptionParser.get_config_section
def get_config_section(self, name): """ Get a section of a configuration """ if self.config.has_section(name): return self.config.items(name) return []
python
def get_config_section(self, name): """ Get a section of a configuration """ if self.config.has_section(name): return self.config.items(name) return []
[ "def", "get_config_section", "(", "self", ",", "name", ")", ":", "if", "self", ".", "config", ".", "has_section", "(", "name", ")", ":", "return", "self", ".", "config", ".", "items", "(", "name", ")", "return", "[", "]" ]
Get a section of a configuration
[ "Get", "a", "section", "of", "a", "configuration" ]
1d3b846d53b5b5404edfe8ddb9083f9ceec8c5e7
https://github.com/nerdvegas/rez/blob/1d3b846d53b5b5404edfe8ddb9083f9ceec8c5e7/src/build_utils/virtualenv/virtualenv.py#L610-L616
232,683
nerdvegas/rez
src/build_utils/virtualenv/virtualenv.py
ConfigOptionParser.get_environ_vars
def get_environ_vars(self, prefix='VIRTUALENV_'): """ Returns a generator with all environmental vars with prefix VIRTUALENV """ for key, val in os.environ.items(): if key.startswith(prefix): yield (key.replace(prefix, '').lower(), val)
python
def get_environ_vars(self, prefix='VIRTUALENV_'): """ Returns a generator with all environmental vars with prefix VIRTUALENV """ for key, val in os.environ.items(): if key.startswith(prefix): yield (key.replace(prefix, '').lower(), val)
[ "def", "get_environ_vars", "(", "self", ",", "prefix", "=", "'VIRTUALENV_'", ")", ":", "for", "key", ",", "val", "in", "os", ".", "environ", ".", "items", "(", ")", ":", "if", "key", ".", "startswith", "(", "prefix", ")", ":", "yield", "(", "key", ...
Returns a generator with all environmental vars with prefix VIRTUALENV
[ "Returns", "a", "generator", "with", "all", "environmental", "vars", "with", "prefix", "VIRTUALENV" ]
1d3b846d53b5b5404edfe8ddb9083f9ceec8c5e7
https://github.com/nerdvegas/rez/blob/1d3b846d53b5b5404edfe8ddb9083f9ceec8c5e7/src/build_utils/virtualenv/virtualenv.py#L618-L624
232,684
nerdvegas/rez
src/rez/config.py
Config.copy
def copy(self, overrides=None, locked=False): """Create a separate copy of this config.""" other = copy.copy(self) if overrides is not None: other.overrides = overrides other.locked = locked other._uncache() return other
python
def copy(self, overrides=None, locked=False): """Create a separate copy of this config.""" other = copy.copy(self) if overrides is not None: other.overrides = overrides other.locked = locked other._uncache() return other
[ "def", "copy", "(", "self", ",", "overrides", "=", "None", ",", "locked", "=", "False", ")", ":", "other", "=", "copy", ".", "copy", "(", "self", ")", "if", "overrides", "is", "not", "None", ":", "other", ".", "overrides", "=", "overrides", "other", ...
Create a separate copy of this config.
[ "Create", "a", "separate", "copy", "of", "this", "config", "." ]
1d3b846d53b5b5404edfe8ddb9083f9ceec8c5e7
https://github.com/nerdvegas/rez/blob/1d3b846d53b5b5404edfe8ddb9083f9ceec8c5e7/src/rez/config.py#L429-L439
232,685
nerdvegas/rez
src/rez/config.py
Config.override
def override(self, key, value): """Set a setting to the given value. Note that `key` can be in dotted form, eg 'plugins.release_hook.emailer.sender'. """ keys = key.split('.') if len(keys) > 1: if keys[0] != "plugins": raise AttributeError("no...
python
def override(self, key, value): """Set a setting to the given value. Note that `key` can be in dotted form, eg 'plugins.release_hook.emailer.sender'. """ keys = key.split('.') if len(keys) > 1: if keys[0] != "plugins": raise AttributeError("no...
[ "def", "override", "(", "self", ",", "key", ",", "value", ")", ":", "keys", "=", "key", ".", "split", "(", "'.'", ")", "if", "len", "(", "keys", ")", ">", "1", ":", "if", "keys", "[", "0", "]", "!=", "\"plugins\"", ":", "raise", "AttributeError",...
Set a setting to the given value. Note that `key` can be in dotted form, eg 'plugins.release_hook.emailer.sender'.
[ "Set", "a", "setting", "to", "the", "given", "value", "." ]
1d3b846d53b5b5404edfe8ddb9083f9ceec8c5e7
https://github.com/nerdvegas/rez/blob/1d3b846d53b5b5404edfe8ddb9083f9ceec8c5e7/src/rez/config.py#L441-L454
232,686
nerdvegas/rez
src/rez/config.py
Config.remove_override
def remove_override(self, key): """Remove a setting override, if one exists.""" keys = key.split('.') if len(keys) > 1: raise NotImplementedError elif key in self.overrides: del self.overrides[key] self._uncache(key)
python
def remove_override(self, key): """Remove a setting override, if one exists.""" keys = key.split('.') if len(keys) > 1: raise NotImplementedError elif key in self.overrides: del self.overrides[key] self._uncache(key)
[ "def", "remove_override", "(", "self", ",", "key", ")", ":", "keys", "=", "key", ".", "split", "(", "'.'", ")", "if", "len", "(", "keys", ")", ">", "1", ":", "raise", "NotImplementedError", "elif", "key", "in", "self", ".", "overrides", ":", "del", ...
Remove a setting override, if one exists.
[ "Remove", "a", "setting", "override", "if", "one", "exists", "." ]
1d3b846d53b5b5404edfe8ddb9083f9ceec8c5e7
https://github.com/nerdvegas/rez/blob/1d3b846d53b5b5404edfe8ddb9083f9ceec8c5e7/src/rez/config.py#L459-L466
232,687
nerdvegas/rez
src/rez/config.py
Config.warn
def warn(self, key): """Returns True if the warning setting is enabled.""" return (not self.quiet and not self.warn_none and (self.warn_all or getattr(self, "warn_%s" % key)))
python
def warn(self, key): """Returns True if the warning setting is enabled.""" return (not self.quiet and not self.warn_none and (self.warn_all or getattr(self, "warn_%s" % key)))
[ "def", "warn", "(", "self", ",", "key", ")", ":", "return", "(", "not", "self", ".", "quiet", "and", "not", "self", ".", "warn_none", "and", "(", "self", ".", "warn_all", "or", "getattr", "(", "self", ",", "\"warn_%s\"", "%", "key", ")", ")", ")" ]
Returns True if the warning setting is enabled.
[ "Returns", "True", "if", "the", "warning", "setting", "is", "enabled", "." ]
1d3b846d53b5b5404edfe8ddb9083f9ceec8c5e7
https://github.com/nerdvegas/rez/blob/1d3b846d53b5b5404edfe8ddb9083f9ceec8c5e7/src/rez/config.py#L468-L471
232,688
nerdvegas/rez
src/rez/config.py
Config.debug
def debug(self, key): """Returns True if the debug setting is enabled.""" return (not self.quiet and not self.debug_none and (self.debug_all or getattr(self, "debug_%s" % key)))
python
def debug(self, key): """Returns True if the debug setting is enabled.""" return (not self.quiet and not self.debug_none and (self.debug_all or getattr(self, "debug_%s" % key)))
[ "def", "debug", "(", "self", ",", "key", ")", ":", "return", "(", "not", "self", ".", "quiet", "and", "not", "self", ".", "debug_none", "and", "(", "self", ".", "debug_all", "or", "getattr", "(", "self", ",", "\"debug_%s\"", "%", "key", ")", ")", "...
Returns True if the debug setting is enabled.
[ "Returns", "True", "if", "the", "debug", "setting", "is", "enabled", "." ]
1d3b846d53b5b5404edfe8ddb9083f9ceec8c5e7
https://github.com/nerdvegas/rez/blob/1d3b846d53b5b5404edfe8ddb9083f9ceec8c5e7/src/rez/config.py#L473-L476
232,689
nerdvegas/rez
src/rez/config.py
Config.data
def data(self): """Returns the entire configuration as a dict. Note that this will force all plugins to be loaded. """ d = {} for key in self._data: if key == "plugins": d[key] = self.plugins.data() else: try: ...
python
def data(self): """Returns the entire configuration as a dict. Note that this will force all plugins to be loaded. """ d = {} for key in self._data: if key == "plugins": d[key] = self.plugins.data() else: try: ...
[ "def", "data", "(", "self", ")", ":", "d", "=", "{", "}", "for", "key", "in", "self", ".", "_data", ":", "if", "key", "==", "\"plugins\"", ":", "d", "[", "key", "]", "=", "self", ".", "plugins", ".", "data", "(", ")", "else", ":", "try", ":",...
Returns the entire configuration as a dict. Note that this will force all plugins to be loaded.
[ "Returns", "the", "entire", "configuration", "as", "a", "dict", "." ]
1d3b846d53b5b5404edfe8ddb9083f9ceec8c5e7
https://github.com/nerdvegas/rez/blob/1d3b846d53b5b5404edfe8ddb9083f9ceec8c5e7/src/rez/config.py#L507-L521
232,690
nerdvegas/rez
src/rez/config.py
Config.nonlocal_packages_path
def nonlocal_packages_path(self): """Returns package search paths with local path removed.""" paths = self.packages_path[:] if self.local_packages_path in paths: paths.remove(self.local_packages_path) return paths
python
def nonlocal_packages_path(self): """Returns package search paths with local path removed.""" paths = self.packages_path[:] if self.local_packages_path in paths: paths.remove(self.local_packages_path) return paths
[ "def", "nonlocal_packages_path", "(", "self", ")", ":", "paths", "=", "self", ".", "packages_path", "[", ":", "]", "if", "self", ".", "local_packages_path", "in", "paths", ":", "paths", ".", "remove", "(", "self", ".", "local_packages_path", ")", "return", ...
Returns package search paths with local path removed.
[ "Returns", "package", "search", "paths", "with", "local", "path", "removed", "." ]
1d3b846d53b5b5404edfe8ddb9083f9ceec8c5e7
https://github.com/nerdvegas/rez/blob/1d3b846d53b5b5404edfe8ddb9083f9ceec8c5e7/src/rez/config.py#L524-L529
232,691
nerdvegas/rez
src/rez/config.py
Config._swap
def _swap(self, other): """Swap this config with another. This is used by the unit tests to swap the config to one that is shielded from any user config updates. Do not use this method unless you have good reason. """ self.__dict__, other.__dict__ = other.__dict__, self....
python
def _swap(self, other): """Swap this config with another. This is used by the unit tests to swap the config to one that is shielded from any user config updates. Do not use this method unless you have good reason. """ self.__dict__, other.__dict__ = other.__dict__, self....
[ "def", "_swap", "(", "self", ",", "other", ")", ":", "self", ".", "__dict__", ",", "other", ".", "__dict__", "=", "other", ".", "__dict__", ",", "self", ".", "__dict__" ]
Swap this config with another. This is used by the unit tests to swap the config to one that is shielded from any user config updates. Do not use this method unless you have good reason.
[ "Swap", "this", "config", "with", "another", "." ]
1d3b846d53b5b5404edfe8ddb9083f9ceec8c5e7
https://github.com/nerdvegas/rez/blob/1d3b846d53b5b5404edfe8ddb9083f9ceec8c5e7/src/rez/config.py#L568-L575
232,692
nerdvegas/rez
src/rez/config.py
Config._create_main_config
def _create_main_config(cls, overrides=None): """See comment block at top of 'rezconfig' describing how the main config is assembled.""" filepaths = [] filepaths.append(get_module_root_config()) filepath = os.getenv("REZ_CONFIG_FILE") if filepath: filepaths.ex...
python
def _create_main_config(cls, overrides=None): """See comment block at top of 'rezconfig' describing how the main config is assembled.""" filepaths = [] filepaths.append(get_module_root_config()) filepath = os.getenv("REZ_CONFIG_FILE") if filepath: filepaths.ex...
[ "def", "_create_main_config", "(", "cls", ",", "overrides", "=", "None", ")", ":", "filepaths", "=", "[", "]", "filepaths", ".", "append", "(", "get_module_root_config", "(", ")", ")", "filepath", "=", "os", ".", "getenv", "(", "\"REZ_CONFIG_FILE\"", ")", ...
See comment block at top of 'rezconfig' describing how the main config is assembled.
[ "See", "comment", "block", "at", "top", "of", "rezconfig", "describing", "how", "the", "main", "config", "is", "assembled", "." ]
1d3b846d53b5b5404edfe8ddb9083f9ceec8c5e7
https://github.com/nerdvegas/rez/blob/1d3b846d53b5b5404edfe8ddb9083f9ceec8c5e7/src/rez/config.py#L600-L612
232,693
nerdvegas/rez
src/rez/utils/platform_mapped.py
platform_mapped
def platform_mapped(func): """Decorates functions for lookups within a config.platform_map dictionary. The first level key is mapped to the func.__name__ of the decorated function. Regular expressions are used on the second level key, values. Note that there is no guaranteed order within the dictionary...
python
def platform_mapped(func): """Decorates functions for lookups within a config.platform_map dictionary. The first level key is mapped to the func.__name__ of the decorated function. Regular expressions are used on the second level key, values. Note that there is no guaranteed order within the dictionary...
[ "def", "platform_mapped", "(", "func", ")", ":", "def", "inner", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "# Since platform is being used within config lazy import config to prevent", "# circular dependencies", "from", "rez", ".", "config", "import", "conf...
Decorates functions for lookups within a config.platform_map dictionary. The first level key is mapped to the func.__name__ of the decorated function. Regular expressions are used on the second level key, values. Note that there is no guaranteed order within the dictionary evaluation. Only the first matchi...
[ "Decorates", "functions", "for", "lookups", "within", "a", "config", ".", "platform_map", "dictionary", "." ]
1d3b846d53b5b5404edfe8ddb9083f9ceec8c5e7
https://github.com/nerdvegas/rez/blob/1d3b846d53b5b5404edfe8ddb9083f9ceec8c5e7/src/rez/utils/platform_mapped.py#L4-L42
232,694
nerdvegas/rez
src/rez/vendor/pygraph/algorithms/pagerank.py
pagerank
def pagerank(graph, damping_factor=0.85, max_iterations=100, min_delta=0.00001): """ Compute and return the PageRank in an directed graph. @type graph: digraph @param graph: Digraph. @type damping_factor: number @param damping_factor: PageRank dumping factor. @type max_...
python
def pagerank(graph, damping_factor=0.85, max_iterations=100, min_delta=0.00001): """ Compute and return the PageRank in an directed graph. @type graph: digraph @param graph: Digraph. @type damping_factor: number @param damping_factor: PageRank dumping factor. @type max_...
[ "def", "pagerank", "(", "graph", ",", "damping_factor", "=", "0.85", ",", "max_iterations", "=", "100", ",", "min_delta", "=", "0.00001", ")", ":", "nodes", "=", "graph", ".", "nodes", "(", ")", "graph_size", "=", "len", "(", "nodes", ")", "if", "graph...
Compute and return the PageRank in an directed graph. @type graph: digraph @param graph: Digraph. @type damping_factor: number @param damping_factor: PageRank dumping factor. @type max_iterations: number @param max_iterations: Maximum number of iterations. @type ...
[ "Compute", "and", "return", "the", "PageRank", "in", "an", "directed", "graph", "." ]
1d3b846d53b5b5404edfe8ddb9083f9ceec8c5e7
https://github.com/nerdvegas/rez/blob/1d3b846d53b5b5404edfe8ddb9083f9ceec8c5e7/src/rez/vendor/pygraph/algorithms/pagerank.py#L32-L76
232,695
nerdvegas/rez
src/rez/package_py_utils.py
exec_command
def exec_command(attr, cmd): """Runs a subproc to calculate a package attribute. """ import subprocess p = popen(cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE) out, err = p.communicate() if p.returncode: from rez.exceptions import InvalidPackageError raise InvalidPackageE...
python
def exec_command(attr, cmd): """Runs a subproc to calculate a package attribute. """ import subprocess p = popen(cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE) out, err = p.communicate() if p.returncode: from rez.exceptions import InvalidPackageError raise InvalidPackageE...
[ "def", "exec_command", "(", "attr", ",", "cmd", ")", ":", "import", "subprocess", "p", "=", "popen", "(", "cmd", ",", "stdout", "=", "subprocess", ".", "PIPE", ",", "stderr", "=", "subprocess", ".", "PIPE", ")", "out", ",", "err", "=", "p", ".", "c...
Runs a subproc to calculate a package attribute.
[ "Runs", "a", "subproc", "to", "calculate", "a", "package", "attribute", "." ]
1d3b846d53b5b5404edfe8ddb9083f9ceec8c5e7
https://github.com/nerdvegas/rez/blob/1d3b846d53b5b5404edfe8ddb9083f9ceec8c5e7/src/rez/package_py_utils.py#L163-L176
232,696
nerdvegas/rez
src/rez/package_py_utils.py
exec_python
def exec_python(attr, src, executable="python"): """Runs a python subproc to calculate a package attribute. Args: attr (str): Name of package attribute being created. src (list of str): Python code to execute, will be converted into semicolon-delimited single line of code. Retu...
python
def exec_python(attr, src, executable="python"): """Runs a python subproc to calculate a package attribute. Args: attr (str): Name of package attribute being created. src (list of str): Python code to execute, will be converted into semicolon-delimited single line of code. Retu...
[ "def", "exec_python", "(", "attr", ",", "src", ",", "executable", "=", "\"python\"", ")", ":", "import", "subprocess", "if", "isinstance", "(", "src", ",", "basestring", ")", ":", "src", "=", "[", "src", "]", "p", "=", "popen", "(", "[", "executable", ...
Runs a python subproc to calculate a package attribute. Args: attr (str): Name of package attribute being created. src (list of str): Python code to execute, will be converted into semicolon-delimited single line of code. Returns: str: Output of python process.
[ "Runs", "a", "python", "subproc", "to", "calculate", "a", "package", "attribute", "." ]
1d3b846d53b5b5404edfe8ddb9083f9ceec8c5e7
https://github.com/nerdvegas/rez/blob/1d3b846d53b5b5404edfe8ddb9083f9ceec8c5e7/src/rez/package_py_utils.py#L179-L204
232,697
nerdvegas/rez
src/rez/package_py_utils.py
find_site_python
def find_site_python(module_name, paths=None): """Find the rez native python package that contains the given module. This function is used by python 'native' rez installers to find the native rez python package that represents the python installation that this module is installed into. Note: ...
python
def find_site_python(module_name, paths=None): """Find the rez native python package that contains the given module. This function is used by python 'native' rez installers to find the native rez python package that represents the python installation that this module is installed into. Note: ...
[ "def", "find_site_python", "(", "module_name", ",", "paths", "=", "None", ")", ":", "from", "rez", ".", "packages_", "import", "iter_packages", "import", "subprocess", "import", "ast", "import", "os", "py_cmd", "=", "'import {x}; print {x}.__path__'", ".", "format...
Find the rez native python package that contains the given module. This function is used by python 'native' rez installers to find the native rez python package that represents the python installation that this module is installed into. Note: This function is dependent on the behavior found in...
[ "Find", "the", "rez", "native", "python", "package", "that", "contains", "the", "given", "module", "." ]
1d3b846d53b5b5404edfe8ddb9083f9ceec8c5e7
https://github.com/nerdvegas/rez/blob/1d3b846d53b5b5404edfe8ddb9083f9ceec8c5e7/src/rez/package_py_utils.py#L207-L264
232,698
nerdvegas/rez
src/rez/vendor/pygraph/algorithms/critical.py
_intersection
def _intersection(A,B): """ A simple function to find an intersection between two arrays. @type A: List @param A: First List @type B: List @param B: Second List @rtype: List @return: List of Intersections """ intersection = [] for i in A: if i in B: ...
python
def _intersection(A,B): """ A simple function to find an intersection between two arrays. @type A: List @param A: First List @type B: List @param B: Second List @rtype: List @return: List of Intersections """ intersection = [] for i in A: if i in B: ...
[ "def", "_intersection", "(", "A", ",", "B", ")", ":", "intersection", "=", "[", "]", "for", "i", "in", "A", ":", "if", "i", "in", "B", ":", "intersection", ".", "append", "(", "i", ")", "return", "intersection" ]
A simple function to find an intersection between two arrays. @type A: List @param A: First List @type B: List @param B: Second List @rtype: List @return: List of Intersections
[ "A", "simple", "function", "to", "find", "an", "intersection", "between", "two", "arrays", "." ]
1d3b846d53b5b5404edfe8ddb9083f9ceec8c5e7
https://github.com/nerdvegas/rez/blob/1d3b846d53b5b5404edfe8ddb9083f9ceec8c5e7/src/rez/vendor/pygraph/algorithms/critical.py#L38-L55
232,699
nerdvegas/rez
src/rez/vendor/pygraph/algorithms/critical.py
critical_path
def critical_path(graph): """ Compute and return the critical path in an acyclic directed weighted graph. @attention: This function is only meaningful for directed weighted acyclic graphs @type graph: digraph @param graph: Digraph @rtype: List @return: List containing all the...
python
def critical_path(graph): """ Compute and return the critical path in an acyclic directed weighted graph. @attention: This function is only meaningful for directed weighted acyclic graphs @type graph: digraph @param graph: Digraph @rtype: List @return: List containing all the...
[ "def", "critical_path", "(", "graph", ")", ":", "#if the graph contains a cycle we return an empty array", "if", "not", "len", "(", "find_cycle", "(", "graph", ")", ")", "==", "0", ":", "return", "[", "]", "#this empty dictionary will contain a tuple for every single node...
Compute and return the critical path in an acyclic directed weighted graph. @attention: This function is only meaningful for directed weighted acyclic graphs @type graph: digraph @param graph: Digraph @rtype: List @return: List containing all the nodes in the path (or an empty array ...
[ "Compute", "and", "return", "the", "critical", "path", "in", "an", "acyclic", "directed", "weighted", "graph", "." ]
1d3b846d53b5b5404edfe8ddb9083f9ceec8c5e7
https://github.com/nerdvegas/rez/blob/1d3b846d53b5b5404edfe8ddb9083f9ceec8c5e7/src/rez/vendor/pygraph/algorithms/critical.py#L98-L163