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
partition
stringclasses
1 value
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
train
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
train
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
train
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
train
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
train
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
train
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
train
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
train
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
train
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
train
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
train
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
train
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
train
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
train
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
train
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
train
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
train
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", ".", "__stdin...
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
train
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
train
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
train
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
train
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
train
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
train
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
train
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
train
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
train
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
train
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
train
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", ":", "name", "=", "find_matching_symlink", "(", "path", ",", "source", ")", "if", "name", ":", "return", "os", ".", "path", ".", "join", "(...
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
train
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", "=", "[", "]", "for", "project", "in", "projects", ":", "for", "dirname", "in", "search_dirs", ":", "files", "=", "glob", ".", "glob", "(", "os", ".", "path", ".", "join", ...
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
train
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", ")", ":", "\"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, 'e...
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
train
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
train
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
train
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
train
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
train
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
train
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
train
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
train
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
train
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
train
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
train
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
train
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
train
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
train
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
train
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
train
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
train
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", ")", ":", "from", "rez", ".", "config", "import", "config", "result", "=", "func", "(", "*", "args", ",", "**", "kwargs", ")", "entry", "=", "co...
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
train
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
train
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
train
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
train
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
train
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
train
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", "not", "len", "(", "find_cycle", "(", "graph", ")", ")", "==", "0", ":", "return", "[", "]", "node_tuples", "=", "{", "}", "topological_nodes", "=", "topological_sorting", "(", "graph", ")", "for", ...
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
train
nerdvegas/rez
src/rezplugins/build_system/custom.py
CustomBuildSystem.build
def build(self, context, variant, build_path, install_path, install=False, build_type=BuildType.local): """Perform the build. Note that most of the func args aren't used here - that's because this info is already passed to the custom build command via environment variables...
python
def build(self, context, variant, build_path, install_path, install=False, build_type=BuildType.local): """Perform the build. Note that most of the func args aren't used here - that's because this info is already passed to the custom build command via environment variables...
[ "def", "build", "(", "self", ",", "context", ",", "variant", ",", "build_path", ",", "install_path", ",", "install", "=", "False", ",", "build_type", "=", "BuildType", ".", "local", ")", ":", "ret", "=", "{", "}", "if", "self", ".", "write_build_scripts"...
Perform the build. Note that most of the func args aren't used here - that's because this info is already passed to the custom build command via environment variables.
[ "Perform", "the", "build", "." ]
1d3b846d53b5b5404edfe8ddb9083f9ceec8c5e7
https://github.com/nerdvegas/rez/blob/1d3b846d53b5b5404edfe8ddb9083f9ceec8c5e7/src/rezplugins/build_system/custom.py#L87-L176
train
nerdvegas/rez
src/rezplugins/release_vcs/hg.py
HgReleaseVCS._create_tag_highlevel
def _create_tag_highlevel(self, tag_name, message=None): """Create a tag on the toplevel repo if there is no patch repo, or a tag on the patch repo and bookmark on the top repo if there is a patch repo Returns a list where each entry is a dict for each bookmark or tag created, w...
python
def _create_tag_highlevel(self, tag_name, message=None): """Create a tag on the toplevel repo if there is no patch repo, or a tag on the patch repo and bookmark on the top repo if there is a patch repo Returns a list where each entry is a dict for each bookmark or tag created, w...
[ "def", "_create_tag_highlevel", "(", "self", ",", "tag_name", ",", "message", "=", "None", ")", ":", "results", "=", "[", "]", "if", "self", ".", "patch_path", ":", "tagged", "=", "self", ".", "_create_tag_lowlevel", "(", "tag_name", ",", "message", "=", ...
Create a tag on the toplevel repo if there is no patch repo, or a tag on the patch repo and bookmark on the top repo if there is a patch repo Returns a list where each entry is a dict for each bookmark or tag created, which looks like {'type': ('bookmark' or 'tag'), 'patch': bool}
[ "Create", "a", "tag", "on", "the", "toplevel", "repo", "if", "there", "is", "no", "patch", "repo", "or", "a", "tag", "on", "the", "patch", "repo", "and", "bookmark", "on", "the", "top", "repo", "if", "there", "is", "a", "patch", "repo" ]
1d3b846d53b5b5404edfe8ddb9083f9ceec8c5e7
https://github.com/nerdvegas/rez/blob/1d3b846d53b5b5404edfe8ddb9083f9ceec8c5e7/src/rezplugins/release_vcs/hg.py#L58-L82
train
nerdvegas/rez
src/rezplugins/release_vcs/hg.py
HgReleaseVCS._create_tag_lowlevel
def _create_tag_lowlevel(self, tag_name, message=None, force=True, patch=False): """Create a tag on the toplevel or patch repo If the tag exists, and force is False, no tag is made. If force is True, and a tag exists, but it is a direct ancestor of the current commi...
python
def _create_tag_lowlevel(self, tag_name, message=None, force=True, patch=False): """Create a tag on the toplevel or patch repo If the tag exists, and force is False, no tag is made. If force is True, and a tag exists, but it is a direct ancestor of the current commi...
[ "def", "_create_tag_lowlevel", "(", "self", ",", "tag_name", ",", "message", "=", "None", ",", "force", "=", "True", ",", "patch", "=", "False", ")", ":", "tags", "=", "self", ".", "get_tags", "(", "patch", "=", "patch", ")", "old_commit", "=", "tags",...
Create a tag on the toplevel or patch repo If the tag exists, and force is False, no tag is made. If force is True, and a tag exists, but it is a direct ancestor of the current commit, and there is no difference in filestate between the current commit and the tagged commit, no tag is ma...
[ "Create", "a", "tag", "on", "the", "toplevel", "or", "patch", "repo" ]
1d3b846d53b5b5404edfe8ddb9083f9ceec8c5e7
https://github.com/nerdvegas/rez/blob/1d3b846d53b5b5404edfe8ddb9083f9ceec8c5e7/src/rezplugins/release_vcs/hg.py#L84-L137
train
nerdvegas/rez
src/rezplugins/release_vcs/hg.py
HgReleaseVCS.is_ancestor
def is_ancestor(self, commit1, commit2, patch=False): """Returns True if commit1 is a direct ancestor of commit2, or False otherwise. This method considers a commit to be a direct ancestor of itself""" result = self.hg("log", "-r", "first(%s::%s)" % (commit1, commit2), ...
python
def is_ancestor(self, commit1, commit2, patch=False): """Returns True if commit1 is a direct ancestor of commit2, or False otherwise. This method considers a commit to be a direct ancestor of itself""" result = self.hg("log", "-r", "first(%s::%s)" % (commit1, commit2), ...
[ "def", "is_ancestor", "(", "self", ",", "commit1", ",", "commit2", ",", "patch", "=", "False", ")", ":", "result", "=", "self", ".", "hg", "(", "\"log\"", ",", "\"-r\"", ",", "\"first(%s::%s)\"", "%", "(", "commit1", ",", "commit2", ")", ",", "\"--temp...
Returns True if commit1 is a direct ancestor of commit2, or False otherwise. This method considers a commit to be a direct ancestor of itself
[ "Returns", "True", "if", "commit1", "is", "a", "direct", "ancestor", "of", "commit2", "or", "False", "otherwise", "." ]
1d3b846d53b5b5404edfe8ddb9083f9ceec8c5e7
https://github.com/nerdvegas/rez/blob/1d3b846d53b5b5404edfe8ddb9083f9ceec8c5e7/src/rezplugins/release_vcs/hg.py#L159-L166
train
nerdvegas/rez
src/rez/utils/patching.py
get_patched_request
def get_patched_request(requires, patchlist): """Apply patch args to a request. For example, consider: >>> print get_patched_request(["foo-5", "bah-8.1"], ["foo-6"]) ["foo-6", "bah-8.1"] >>> print get_patched_request(["foo-5", "bah-8.1"], ["^bah"]) ["foo-5"] The following ...
python
def get_patched_request(requires, patchlist): """Apply patch args to a request. For example, consider: >>> print get_patched_request(["foo-5", "bah-8.1"], ["foo-6"]) ["foo-6", "bah-8.1"] >>> print get_patched_request(["foo-5", "bah-8.1"], ["^bah"]) ["foo-5"] The following ...
[ "def", "get_patched_request", "(", "requires", ",", "patchlist", ")", ":", "rules", "=", "{", "''", ":", "(", "True", ",", "True", ",", "True", ")", ",", "'!'", ":", "(", "False", ",", "False", ",", "False", ")", ",", "'~'", ":", "(", "False", ",...
Apply patch args to a request. For example, consider: >>> print get_patched_request(["foo-5", "bah-8.1"], ["foo-6"]) ["foo-6", "bah-8.1"] >>> print get_patched_request(["foo-5", "bah-8.1"], ["^bah"]) ["foo-5"] The following rules apply wrt how normal/conflict/weak patches over...
[ "Apply", "patch", "args", "to", "a", "request", "." ]
1d3b846d53b5b5404edfe8ddb9083f9ceec8c5e7
https://github.com/nerdvegas/rez/blob/1d3b846d53b5b5404edfe8ddb9083f9ceec8c5e7/src/rez/utils/patching.py#L4-L78
train
nerdvegas/rez
src/support/shotgun_toolkit/rez_app_launch.py
AppLaunch.execute
def execute(self, app_path, app_args, version, **kwargs): """ The execute functon of the hook will be called to start the required application :param app_path: (str) The path of the application executable :param app_args: (str) Any arguments the application may require :param ve...
python
def execute(self, app_path, app_args, version, **kwargs): """ The execute functon of the hook will be called to start the required application :param app_path: (str) The path of the application executable :param app_args: (str) Any arguments the application may require :param ve...
[ "def", "execute", "(", "self", ",", "app_path", ",", "app_args", ",", "version", ",", "**", "kwargs", ")", ":", "multi_launchapp", "=", "self", ".", "parent", "extra", "=", "multi_launchapp", ".", "get_setting", "(", "\"extra\"", ")", "use_rez", "=", "Fals...
The execute functon of the hook will be called to start the required application :param app_path: (str) The path of the application executable :param app_args: (str) Any arguments the application may require :param version: (str) version of the application being run if set in the "versions" set...
[ "The", "execute", "functon", "of", "the", "hook", "will", "be", "called", "to", "start", "the", "required", "application" ]
1d3b846d53b5b5404edfe8ddb9083f9ceec8c5e7
https://github.com/nerdvegas/rez/blob/1d3b846d53b5b5404edfe8ddb9083f9ceec8c5e7/src/support/shotgun_toolkit/rez_app_launch.py#L37-L117
train
nerdvegas/rez
src/support/shotgun_toolkit/rez_app_launch.py
AppLaunch.check_rez
def check_rez(self, strict=True): """ Checks to see if a Rez package is available in the current environment. If it is available, add it to the system path, exposing the Rez Python API :param strict: (bool) If True, raise an error if Rez is not available as a package. ...
python
def check_rez(self, strict=True): """ Checks to see if a Rez package is available in the current environment. If it is available, add it to the system path, exposing the Rez Python API :param strict: (bool) If True, raise an error if Rez is not available as a package. ...
[ "def", "check_rez", "(", "self", ",", "strict", "=", "True", ")", ":", "system", "=", "sys", ".", "platform", "if", "system", "==", "\"win32\"", ":", "rez_cmd", "=", "'rez-env rez -- echo %REZ_REZ_ROOT%'", "else", ":", "rez_cmd", "=", "'rez-env rez -- printenv R...
Checks to see if a Rez package is available in the current environment. If it is available, add it to the system path, exposing the Rez Python API :param strict: (bool) If True, raise an error if Rez is not available as a package. This will prevent the app from being launc...
[ "Checks", "to", "see", "if", "a", "Rez", "package", "is", "available", "in", "the", "current", "environment", ".", "If", "it", "is", "available", "add", "it", "to", "the", "system", "path", "exposing", "the", "Rez", "Python", "API" ]
1d3b846d53b5b5404edfe8ddb9083f9ceec8c5e7
https://github.com/nerdvegas/rez/blob/1d3b846d53b5b5404edfe8ddb9083f9ceec8c5e7/src/support/shotgun_toolkit/rez_app_launch.py#L119-L155
train
nerdvegas/rez
src/rezplugins/release_vcs/svn.py
get_last_changed_revision
def get_last_changed_revision(client, url): """ util func, get last revision of url """ try: svn_entries = client.info2(url, pysvn.Revision(pysvn.opt_revision_kind.head), recurse=False) if not svn_entries: ...
python
def get_last_changed_revision(client, url): """ util func, get last revision of url """ try: svn_entries = client.info2(url, pysvn.Revision(pysvn.opt_revision_kind.head), recurse=False) if not svn_entries: ...
[ "def", "get_last_changed_revision", "(", "client", ",", "url", ")", ":", "try", ":", "svn_entries", "=", "client", ".", "info2", "(", "url", ",", "pysvn", ".", "Revision", "(", "pysvn", ".", "opt_revision_kind", ".", "head", ")", ",", "recurse", "=", "Fa...
util func, get last revision of url
[ "util", "func", "get", "last", "revision", "of", "url" ]
1d3b846d53b5b5404edfe8ddb9083f9ceec8c5e7
https://github.com/nerdvegas/rez/blob/1d3b846d53b5b5404edfe8ddb9083f9ceec8c5e7/src/rezplugins/release_vcs/svn.py#L26-L38
train
nerdvegas/rez
src/rezplugins/release_vcs/svn.py
get_svn_login
def get_svn_login(realm, username, may_save): """ provide svn with permissions. @TODO this will have to be updated to take into account automated releases etc. """ import getpass print "svn requires a password for the user %s:" % username pwd = '' while not pwd.strip(): pwd = ge...
python
def get_svn_login(realm, username, may_save): """ provide svn with permissions. @TODO this will have to be updated to take into account automated releases etc. """ import getpass print "svn requires a password for the user %s:" % username pwd = '' while not pwd.strip(): pwd = ge...
[ "def", "get_svn_login", "(", "realm", ",", "username", ",", "may_save", ")", ":", "import", "getpass", "print", "\"svn requires a password for the user %s:\"", "%", "username", "pwd", "=", "''", "while", "not", "pwd", ".", "strip", "(", ")", ":", "pwd", "=", ...
provide svn with permissions. @TODO this will have to be updated to take into account automated releases etc.
[ "provide", "svn", "with", "permissions", "." ]
1d3b846d53b5b5404edfe8ddb9083f9ceec8c5e7
https://github.com/nerdvegas/rez/blob/1d3b846d53b5b5404edfe8ddb9083f9ceec8c5e7/src/rezplugins/release_vcs/svn.py#L41-L53
train
nerdvegas/rez
src/rez/vendor/pygraph/readwrite/markup.py
read
def read(string): """ Read a graph from a XML document and return it. Nodes and edges specified in the input will be added to the current graph. @type string: string @param string: Input string in XML format specifying a graph. @rtype: graph @return: Graph """ dom = parseS...
python
def read(string): """ Read a graph from a XML document and return it. Nodes and edges specified in the input will be added to the current graph. @type string: string @param string: Input string in XML format specifying a graph. @rtype: graph @return: Graph """ dom = parseS...
[ "def", "read", "(", "string", ")", ":", "dom", "=", "parseString", "(", "string", ")", "if", "dom", ".", "getElementsByTagName", "(", "\"graph\"", ")", ":", "G", "=", "graph", "(", ")", "elif", "dom", ".", "getElementsByTagName", "(", "\"digraph\"", ")",...
Read a graph from a XML document and return it. Nodes and edges specified in the input will be added to the current graph. @type string: string @param string: Input string in XML format specifying a graph. @rtype: graph @return: Graph
[ "Read", "a", "graph", "from", "a", "XML", "document", "and", "return", "it", ".", "Nodes", "and", "edges", "specified", "in", "the", "input", "will", "be", "added", "to", "the", "current", "graph", "." ]
1d3b846d53b5b5404edfe8ddb9083f9ceec8c5e7
https://github.com/nerdvegas/rez/blob/1d3b846d53b5b5404edfe8ddb9083f9ceec8c5e7/src/rez/vendor/pygraph/readwrite/markup.py#L91-L132
train
nerdvegas/rez
src/rez/vendor/pygraph/readwrite/markup.py
read_hypergraph
def read_hypergraph(string): """ Read a graph from a XML document. Nodes and hyperedges specified in the input will be added to the current graph. @type string: string @param string: Input string in XML format specifying a graph. @rtype: hypergraph @return: Hypergraph """ ...
python
def read_hypergraph(string): """ Read a graph from a XML document. Nodes and hyperedges specified in the input will be added to the current graph. @type string: string @param string: Input string in XML format specifying a graph. @rtype: hypergraph @return: Hypergraph """ ...
[ "def", "read_hypergraph", "(", "string", ")", ":", "hgr", "=", "hypergraph", "(", ")", "dom", "=", "parseString", "(", "string", ")", "for", "each_node", "in", "dom", ".", "getElementsByTagName", "(", "\"node\"", ")", ":", "hgr", ".", "add_node", "(", "e...
Read a graph from a XML document. Nodes and hyperedges specified in the input will be added to the current graph. @type string: string @param string: Input string in XML format specifying a graph. @rtype: hypergraph @return: Hypergraph
[ "Read", "a", "graph", "from", "a", "XML", "document", ".", "Nodes", "and", "hyperedges", "specified", "in", "the", "input", "will", "be", "added", "to", "the", "current", "graph", "." ]
1d3b846d53b5b5404edfe8ddb9083f9ceec8c5e7
https://github.com/nerdvegas/rez/blob/1d3b846d53b5b5404edfe8ddb9083f9ceec8c5e7/src/rez/vendor/pygraph/readwrite/markup.py#L172-L195
train
nerdvegas/rez
src/rez/utils/diff_packages.py
diff_packages
def diff_packages(pkg1, pkg2=None): """Invoke a diff editor to show the difference between the source of two packages. Args: pkg1 (`Package`): Package to diff. pkg2 (`Package`): Package to diff against. If None, the next most recent package version is used. """ if pkg2 i...
python
def diff_packages(pkg1, pkg2=None): """Invoke a diff editor to show the difference between the source of two packages. Args: pkg1 (`Package`): Package to diff. pkg2 (`Package`): Package to diff against. If None, the next most recent package version is used. """ if pkg2 i...
[ "def", "diff_packages", "(", "pkg1", ",", "pkg2", "=", "None", ")", ":", "if", "pkg2", "is", "None", ":", "it", "=", "iter_packages", "(", "pkg1", ".", "name", ")", "pkgs", "=", "[", "x", "for", "x", "in", "it", "if", "x", ".", "version", "<", ...
Invoke a diff editor to show the difference between the source of two packages. Args: pkg1 (`Package`): Package to diff. pkg2 (`Package`): Package to diff against. If None, the next most recent package version is used.
[ "Invoke", "a", "diff", "editor", "to", "show", "the", "difference", "between", "the", "source", "of", "two", "packages", "." ]
1d3b846d53b5b5404edfe8ddb9083f9ceec8c5e7
https://github.com/nerdvegas/rez/blob/1d3b846d53b5b5404edfe8ddb9083f9ceec8c5e7/src/rez/utils/diff_packages.py#L10-L49
train
nerdvegas/rez
src/rez/cli/_util.py
sigint_handler
def sigint_handler(signum, frame): """Exit gracefully on ctrl-C.""" global _handled_int if not _handled_int: _handled_int = True if not _env_var_true("_REZ_QUIET_ON_SIG"): print >> sys.stderr, "Interrupted by user" sigbase_handler(signum, frame)
python
def sigint_handler(signum, frame): """Exit gracefully on ctrl-C.""" global _handled_int if not _handled_int: _handled_int = True if not _env_var_true("_REZ_QUIET_ON_SIG"): print >> sys.stderr, "Interrupted by user" sigbase_handler(signum, frame)
[ "def", "sigint_handler", "(", "signum", ",", "frame", ")", ":", "global", "_handled_int", "if", "not", "_handled_int", ":", "_handled_int", "=", "True", "if", "not", "_env_var_true", "(", "\"_REZ_QUIET_ON_SIG\"", ")", ":", "print", ">>", "sys", ".", "stderr", ...
Exit gracefully on ctrl-C.
[ "Exit", "gracefully", "on", "ctrl", "-", "C", "." ]
1d3b846d53b5b5404edfe8ddb9083f9ceec8c5e7
https://github.com/nerdvegas/rez/blob/1d3b846d53b5b5404edfe8ddb9083f9ceec8c5e7/src/rez/cli/_util.py#L141-L148
train
nerdvegas/rez
src/rez/cli/_util.py
sigterm_handler
def sigterm_handler(signum, frame): """Exit gracefully on terminate.""" global _handled_term if not _handled_term: _handled_term = True if not _env_var_true("_REZ_QUIET_ON_SIG"): print >> sys.stderr, "Terminated by user" sigbase_handler(signum, frame)
python
def sigterm_handler(signum, frame): """Exit gracefully on terminate.""" global _handled_term if not _handled_term: _handled_term = True if not _env_var_true("_REZ_QUIET_ON_SIG"): print >> sys.stderr, "Terminated by user" sigbase_handler(signum, frame)
[ "def", "sigterm_handler", "(", "signum", ",", "frame", ")", ":", "global", "_handled_term", "if", "not", "_handled_term", ":", "_handled_term", "=", "True", "if", "not", "_env_var_true", "(", "\"_REZ_QUIET_ON_SIG\"", ")", ":", "print", ">>", "sys", ".", "stder...
Exit gracefully on terminate.
[ "Exit", "gracefully", "on", "terminate", "." ]
1d3b846d53b5b5404edfe8ddb9083f9ceec8c5e7
https://github.com/nerdvegas/rez/blob/1d3b846d53b5b5404edfe8ddb9083f9ceec8c5e7/src/rez/cli/_util.py#L151-L158
train
nerdvegas/rez
src/rez/cli/_util.py
LazyArgumentParser.format_help
def format_help(self): """Sets up all sub-parsers when help is requested.""" if self._subparsers: for action in self._subparsers._actions: if isinstance(action, LazySubParsersAction): for parser_name, parser in action._name_parser_map.iteritems(): ...
python
def format_help(self): """Sets up all sub-parsers when help is requested.""" if self._subparsers: for action in self._subparsers._actions: if isinstance(action, LazySubParsersAction): for parser_name, parser in action._name_parser_map.iteritems(): ...
[ "def", "format_help", "(", "self", ")", ":", "if", "self", ".", "_subparsers", ":", "for", "action", "in", "self", ".", "_subparsers", ".", "_actions", ":", "if", "isinstance", "(", "action", ",", "LazySubParsersAction", ")", ":", "for", "parser_name", ","...
Sets up all sub-parsers when help is requested.
[ "Sets", "up", "all", "sub", "-", "parsers", "when", "help", "is", "requested", "." ]
1d3b846d53b5b5404edfe8ddb9083f9ceec8c5e7
https://github.com/nerdvegas/rez/blob/1d3b846d53b5b5404edfe8ddb9083f9ceec8c5e7/src/rez/cli/_util.py#L110-L117
train
nerdvegas/rez
src/rez/utils/formatting.py
is_valid_package_name
def is_valid_package_name(name, raise_error=False): """Test the validity of a package name string. Args: name (str): Name to test. raise_error (bool): If True, raise an exception on failure Returns: bool. """ is_valid = PACKAGE_NAME_REGEX.match(name) if raise_error and ...
python
def is_valid_package_name(name, raise_error=False): """Test the validity of a package name string. Args: name (str): Name to test. raise_error (bool): If True, raise an exception on failure Returns: bool. """ is_valid = PACKAGE_NAME_REGEX.match(name) if raise_error and ...
[ "def", "is_valid_package_name", "(", "name", ",", "raise_error", "=", "False", ")", ":", "is_valid", "=", "PACKAGE_NAME_REGEX", ".", "match", "(", "name", ")", "if", "raise_error", "and", "not", "is_valid", ":", "raise", "PackageRequestError", "(", "\"Not a vali...
Test the validity of a package name string. Args: name (str): Name to test. raise_error (bool): If True, raise an exception on failure Returns: bool.
[ "Test", "the", "validity", "of", "a", "package", "name", "string", "." ]
1d3b846d53b5b5404edfe8ddb9083f9ceec8c5e7
https://github.com/nerdvegas/rez/blob/1d3b846d53b5b5404edfe8ddb9083f9ceec8c5e7/src/rez/utils/formatting.py#L27-L40
train
nerdvegas/rez
src/rez/utils/formatting.py
expand_abbreviations
def expand_abbreviations(txt, fields): """Expand abbreviations in a format string. If an abbreviation does not match a field, or matches multiple fields, it is left unchanged. Example: >>> fields = ("hey", "there", "dude") >>> expand_abbreviations("hello {d}", fields) 'hello d...
python
def expand_abbreviations(txt, fields): """Expand abbreviations in a format string. If an abbreviation does not match a field, or matches multiple fields, it is left unchanged. Example: >>> fields = ("hey", "there", "dude") >>> expand_abbreviations("hello {d}", fields) 'hello d...
[ "def", "expand_abbreviations", "(", "txt", ",", "fields", ")", ":", "def", "_expand", "(", "matchobj", ")", ":", "s", "=", "matchobj", ".", "group", "(", "\"var\"", ")", "if", "s", "not", "in", "fields", ":", "matches", "=", "[", "x", "for", "x", "...
Expand abbreviations in a format string. If an abbreviation does not match a field, or matches multiple fields, it is left unchanged. Example: >>> fields = ("hey", "there", "dude") >>> expand_abbreviations("hello {d}", fields) 'hello dude' Args: txt (str): Format stri...
[ "Expand", "abbreviations", "in", "a", "format", "string", "." ]
1d3b846d53b5b5404edfe8ddb9083f9ceec8c5e7
https://github.com/nerdvegas/rez/blob/1d3b846d53b5b5404edfe8ddb9083f9ceec8c5e7/src/rez/utils/formatting.py#L174-L200
train
nerdvegas/rez
src/rez/utils/formatting.py
dict_to_attributes_code
def dict_to_attributes_code(dict_): """Given a nested dict, generate a python code equivalent. Example: >>> d = {'foo': 'bah', 'colors': {'red': 1, 'blue': 2}} >>> print dict_to_attributes_code(d) foo = 'bah' colors.red = 1 colors.blue = 2 Returns: str. ...
python
def dict_to_attributes_code(dict_): """Given a nested dict, generate a python code equivalent. Example: >>> d = {'foo': 'bah', 'colors': {'red': 1, 'blue': 2}} >>> print dict_to_attributes_code(d) foo = 'bah' colors.red = 1 colors.blue = 2 Returns: str. ...
[ "def", "dict_to_attributes_code", "(", "dict_", ")", ":", "lines", "=", "[", "]", "for", "key", ",", "value", "in", "dict_", ".", "iteritems", "(", ")", ":", "if", "isinstance", "(", "value", ",", "dict", ")", ":", "txt", "=", "dict_to_attributes_code", ...
Given a nested dict, generate a python code equivalent. Example: >>> d = {'foo': 'bah', 'colors': {'red': 1, 'blue': 2}} >>> print dict_to_attributes_code(d) foo = 'bah' colors.red = 1 colors.blue = 2 Returns: str.
[ "Given", "a", "nested", "dict", "generate", "a", "python", "code", "equivalent", "." ]
1d3b846d53b5b5404edfe8ddb9083f9ceec8c5e7
https://github.com/nerdvegas/rez/blob/1d3b846d53b5b5404edfe8ddb9083f9ceec8c5e7/src/rez/utils/formatting.py#L247-L279
train
nerdvegas/rez
src/rez/utils/formatting.py
columnise
def columnise(rows, padding=2): """Print rows of entries in aligned columns.""" strs = [] maxwidths = {} for row in rows: for i, e in enumerate(row): se = str(e) nse = len(se) w = maxwidths.get(i, -1) if nse > w: maxwidths[i] = nse...
python
def columnise(rows, padding=2): """Print rows of entries in aligned columns.""" strs = [] maxwidths = {} for row in rows: for i, e in enumerate(row): se = str(e) nse = len(se) w = maxwidths.get(i, -1) if nse > w: maxwidths[i] = nse...
[ "def", "columnise", "(", "rows", ",", "padding", "=", "2", ")", ":", "strs", "=", "[", "]", "maxwidths", "=", "{", "}", "for", "row", "in", "rows", ":", "for", "i", ",", "e", "in", "enumerate", "(", "row", ")", ":", "se", "=", "str", "(", "e"...
Print rows of entries in aligned columns.
[ "Print", "rows", "of", "entries", "in", "aligned", "columns", "." ]
1d3b846d53b5b5404edfe8ddb9083f9ceec8c5e7
https://github.com/nerdvegas/rez/blob/1d3b846d53b5b5404edfe8ddb9083f9ceec8c5e7/src/rez/utils/formatting.py#L282-L304
train
nerdvegas/rez
src/rez/utils/formatting.py
print_colored_columns
def print_colored_columns(printer, rows, padding=2): """Like `columnise`, but with colored rows. Args: printer (`colorize.Printer`): Printer object. Note: The last entry in each row is the row color, or None for no coloring. """ rows_ = [x[:-1] for x in rows] colors = [x[-1] fo...
python
def print_colored_columns(printer, rows, padding=2): """Like `columnise`, but with colored rows. Args: printer (`colorize.Printer`): Printer object. Note: The last entry in each row is the row color, or None for no coloring. """ rows_ = [x[:-1] for x in rows] colors = [x[-1] fo...
[ "def", "print_colored_columns", "(", "printer", ",", "rows", ",", "padding", "=", "2", ")", ":", "rows_", "=", "[", "x", "[", ":", "-", "1", "]", "for", "x", "in", "rows", "]", "colors", "=", "[", "x", "[", "-", "1", "]", "for", "x", "in", "r...
Like `columnise`, but with colored rows. Args: printer (`colorize.Printer`): Printer object. Note: The last entry in each row is the row color, or None for no coloring.
[ "Like", "columnise", "but", "with", "colored", "rows", "." ]
1d3b846d53b5b5404edfe8ddb9083f9ceec8c5e7
https://github.com/nerdvegas/rez/blob/1d3b846d53b5b5404edfe8ddb9083f9ceec8c5e7/src/rez/utils/formatting.py#L307-L319
train
nerdvegas/rez
src/rez/utils/formatting.py
expanduser
def expanduser(path): """Expand '~' to home directory in the given string. Note that this function deliberately differs from the builtin os.path.expanduser() on Linux systems, which expands strings such as '~sclaus' to that user's homedir. This is problematic in rez because the string '~packagename...
python
def expanduser(path): """Expand '~' to home directory in the given string. Note that this function deliberately differs from the builtin os.path.expanduser() on Linux systems, which expands strings such as '~sclaus' to that user's homedir. This is problematic in rez because the string '~packagename...
[ "def", "expanduser", "(", "path", ")", ":", "if", "'~'", "not", "in", "path", ":", "return", "path", "if", "os", ".", "name", "==", "\"nt\"", ":", "if", "'HOME'", "in", "os", ".", "environ", ":", "userhome", "=", "os", ".", "environ", "[", "'HOME'"...
Expand '~' to home directory in the given string. Note that this function deliberately differs from the builtin os.path.expanduser() on Linux systems, which expands strings such as '~sclaus' to that user's homedir. This is problematic in rez because the string '~packagename' may inadvertently convert t...
[ "Expand", "~", "to", "home", "directory", "in", "the", "given", "string", "." ]
1d3b846d53b5b5404edfe8ddb9083f9ceec8c5e7
https://github.com/nerdvegas/rez/blob/1d3b846d53b5b5404edfe8ddb9083f9ceec8c5e7/src/rez/utils/formatting.py#L439-L473
train
nerdvegas/rez
src/rez/utils/formatting.py
as_block_string
def as_block_string(txt): """Return a string formatted as a python block comment string, like the one you're currently reading. Special characters are escaped if necessary. """ import json lines = [] for line in txt.split('\n'): line_ = json.dumps(line) line_ = line_[1:-1].rstri...
python
def as_block_string(txt): """Return a string formatted as a python block comment string, like the one you're currently reading. Special characters are escaped if necessary. """ import json lines = [] for line in txt.split('\n'): line_ = json.dumps(line) line_ = line_[1:-1].rstri...
[ "def", "as_block_string", "(", "txt", ")", ":", "import", "json", "lines", "=", "[", "]", "for", "line", "in", "txt", ".", "split", "(", "'\\n'", ")", ":", "line_", "=", "json", ".", "dumps", "(", "line", ")", "line_", "=", "line_", "[", "1", ":"...
Return a string formatted as a python block comment string, like the one you're currently reading. Special characters are escaped if necessary.
[ "Return", "a", "string", "formatted", "as", "a", "python", "block", "comment", "string", "like", "the", "one", "you", "re", "currently", "reading", ".", "Special", "characters", "are", "escaped", "if", "necessary", "." ]
1d3b846d53b5b5404edfe8ddb9083f9ceec8c5e7
https://github.com/nerdvegas/rez/blob/1d3b846d53b5b5404edfe8ddb9083f9ceec8c5e7/src/rez/utils/formatting.py#L476-L488
train
nerdvegas/rez
src/rez/utils/formatting.py
StringFormatMixin.format
def format(self, s, pretty=None, expand=None): """Format a string. Args: s (str): String to format, eg "hello {name}" pretty (bool): If True, references to non-string attributes such as lists are converted to basic form, with characters such as br...
python
def format(self, s, pretty=None, expand=None): """Format a string. Args: s (str): String to format, eg "hello {name}" pretty (bool): If True, references to non-string attributes such as lists are converted to basic form, with characters such as br...
[ "def", "format", "(", "self", ",", "s", ",", "pretty", "=", "None", ",", "expand", "=", "None", ")", ":", "if", "pretty", "is", "None", ":", "pretty", "=", "self", ".", "format_pretty", "if", "expand", "is", "None", ":", "expand", "=", "self", ".",...
Format a string. Args: s (str): String to format, eg "hello {name}" pretty (bool): If True, references to non-string attributes such as lists are converted to basic form, with characters such as brackets and parenthesis removed. If None, defaults to the ...
[ "Format", "a", "string", "." ]
1d3b846d53b5b5404edfe8ddb9083f9ceec8c5e7
https://github.com/nerdvegas/rez/blob/1d3b846d53b5b5404edfe8ddb9083f9ceec8c5e7/src/rez/utils/formatting.py#L150-L171
train
nerdvegas/rez
src/rez/vendor/version/version.py
Version.copy
def copy(self): """Returns a copy of the version.""" other = Version(None) other.tokens = self.tokens[:] other.seps = self.seps[:] return other
python
def copy(self): """Returns a copy of the version.""" other = Version(None) other.tokens = self.tokens[:] other.seps = self.seps[:] return other
[ "def", "copy", "(", "self", ")", ":", "other", "=", "Version", "(", "None", ")", "other", ".", "tokens", "=", "self", ".", "tokens", "[", ":", "]", "other", ".", "seps", "=", "self", ".", "seps", "[", ":", "]", "return", "other" ]
Returns a copy of the version.
[ "Returns", "a", "copy", "of", "the", "version", "." ]
1d3b846d53b5b5404edfe8ddb9083f9ceec8c5e7
https://github.com/nerdvegas/rez/blob/1d3b846d53b5b5404edfe8ddb9083f9ceec8c5e7/src/rez/vendor/version/version.py#L297-L302
train
nerdvegas/rez
src/rez/vendor/version/version.py
Version.trim
def trim(self, len_): """Return a copy of the version, possibly with less tokens. Args: len_ (int): New version length. If >= current length, an unchanged copy of the version is returned. """ other = Version(None) other.tokens = self.tokens[:len_] ...
python
def trim(self, len_): """Return a copy of the version, possibly with less tokens. Args: len_ (int): New version length. If >= current length, an unchanged copy of the version is returned. """ other = Version(None) other.tokens = self.tokens[:len_] ...
[ "def", "trim", "(", "self", ",", "len_", ")", ":", "other", "=", "Version", "(", "None", ")", "other", ".", "tokens", "=", "self", ".", "tokens", "[", ":", "len_", "]", "other", ".", "seps", "=", "self", ".", "seps", "[", ":", "len_", "-", "1",...
Return a copy of the version, possibly with less tokens. Args: len_ (int): New version length. If >= current length, an unchanged copy of the version is returned.
[ "Return", "a", "copy", "of", "the", "version", "possibly", "with", "less", "tokens", "." ]
1d3b846d53b5b5404edfe8ddb9083f9ceec8c5e7
https://github.com/nerdvegas/rez/blob/1d3b846d53b5b5404edfe8ddb9083f9ceec8c5e7/src/rez/vendor/version/version.py#L304-L314
train
nerdvegas/rez
src/rez/vendor/version/version.py
VersionRange.union
def union(self, other): """OR together version ranges. Calculates the union of this range with one or more other ranges. Args: other: VersionRange object (or list of) to OR with. Returns: New VersionRange object representing the union. """ if no...
python
def union(self, other): """OR together version ranges. Calculates the union of this range with one or more other ranges. Args: other: VersionRange object (or list of) to OR with. Returns: New VersionRange object representing the union. """ if no...
[ "def", "union", "(", "self", ",", "other", ")", ":", "if", "not", "hasattr", "(", "other", ",", "\"__iter__\"", ")", ":", "other", "=", "[", "other", "]", "bounds", "=", "self", ".", "bounds", "[", ":", "]", "for", "range", "in", "other", ":", "b...
OR together version ranges. Calculates the union of this range with one or more other ranges. Args: other: VersionRange object (or list of) to OR with. Returns: New VersionRange object representing the union.
[ "OR", "together", "version", "ranges", "." ]
1d3b846d53b5b5404edfe8ddb9083f9ceec8c5e7
https://github.com/nerdvegas/rez/blob/1d3b846d53b5b5404edfe8ddb9083f9ceec8c5e7/src/rez/vendor/version/version.py#L814-L834
train
nerdvegas/rez
src/rez/vendor/version/version.py
VersionRange.intersection
def intersection(self, other): """AND together version ranges. Calculates the intersection of this range with one or more other ranges. Args: other: VersionRange object (or list of) to AND with. Returns: New VersionRange object representing the intersection, or...
python
def intersection(self, other): """AND together version ranges. Calculates the intersection of this range with one or more other ranges. Args: other: VersionRange object (or list of) to AND with. Returns: New VersionRange object representing the intersection, or...
[ "def", "intersection", "(", "self", ",", "other", ")", ":", "if", "not", "hasattr", "(", "other", ",", "\"__iter__\"", ")", ":", "other", "=", "[", "other", "]", "bounds", "=", "self", ".", "bounds", "for", "range", "in", "other", ":", "bounds", "=",...
AND together version ranges. Calculates the intersection of this range with one or more other ranges. Args: other: VersionRange object (or list of) to AND with. Returns: New VersionRange object representing the intersection, or None if no ranges intersect.
[ "AND", "together", "version", "ranges", "." ]
1d3b846d53b5b5404edfe8ddb9083f9ceec8c5e7
https://github.com/nerdvegas/rez/blob/1d3b846d53b5b5404edfe8ddb9083f9ceec8c5e7/src/rez/vendor/version/version.py#L836-L859
train
nerdvegas/rez
src/rez/vendor/version/version.py
VersionRange.inverse
def inverse(self): """Calculate the inverse of the range. Returns: New VersionRange object representing the inverse of this range, or None if there is no inverse (ie, this range is the any range). """ if self.is_any(): return None else: ...
python
def inverse(self): """Calculate the inverse of the range. Returns: New VersionRange object representing the inverse of this range, or None if there is no inverse (ie, this range is the any range). """ if self.is_any(): return None else: ...
[ "def", "inverse", "(", "self", ")", ":", "if", "self", ".", "is_any", "(", ")", ":", "return", "None", "else", ":", "bounds", "=", "self", ".", "_inverse", "(", "self", ".", "bounds", ")", "range", "=", "VersionRange", "(", "None", ")", "range", "....
Calculate the inverse of the range. Returns: New VersionRange object representing the inverse of this range, or None if there is no inverse (ie, this range is the any range).
[ "Calculate", "the", "inverse", "of", "the", "range", "." ]
1d3b846d53b5b5404edfe8ddb9083f9ceec8c5e7
https://github.com/nerdvegas/rez/blob/1d3b846d53b5b5404edfe8ddb9083f9ceec8c5e7/src/rez/vendor/version/version.py#L861-L874
train
nerdvegas/rez
src/rez/vendor/version/version.py
VersionRange.split
def split(self): """Split into separate contiguous ranges. Returns: A list of VersionRange objects. For example, the range "3|5+" will be split into ["3", "5+"]. """ ranges = [] for bound in self.bounds: range = VersionRange(None) ...
python
def split(self): """Split into separate contiguous ranges. Returns: A list of VersionRange objects. For example, the range "3|5+" will be split into ["3", "5+"]. """ ranges = [] for bound in self.bounds: range = VersionRange(None) ...
[ "def", "split", "(", "self", ")", ":", "ranges", "=", "[", "]", "for", "bound", "in", "self", ".", "bounds", ":", "range", "=", "VersionRange", "(", "None", ")", "range", ".", "bounds", "=", "[", "bound", "]", "ranges", ".", "append", "(", "range",...
Split into separate contiguous ranges. Returns: A list of VersionRange objects. For example, the range "3|5+" will be split into ["3", "5+"].
[ "Split", "into", "separate", "contiguous", "ranges", "." ]
1d3b846d53b5b5404edfe8ddb9083f9ceec8c5e7
https://github.com/nerdvegas/rez/blob/1d3b846d53b5b5404edfe8ddb9083f9ceec8c5e7/src/rez/vendor/version/version.py#L887-L899
train
nerdvegas/rez
src/rez/vendor/version/version.py
VersionRange.as_span
def as_span(cls, lower_version=None, upper_version=None, lower_inclusive=True, upper_inclusive=True): """Create a range from lower_version..upper_version. Args: lower_version: Version object representing lower bound of the range. upper_version: Version object rep...
python
def as_span(cls, lower_version=None, upper_version=None, lower_inclusive=True, upper_inclusive=True): """Create a range from lower_version..upper_version. Args: lower_version: Version object representing lower bound of the range. upper_version: Version object rep...
[ "def", "as_span", "(", "cls", ",", "lower_version", "=", "None", ",", "upper_version", "=", "None", ",", "lower_inclusive", "=", "True", ",", "upper_inclusive", "=", "True", ")", ":", "lower", "=", "(", "None", "if", "lower_version", "is", "None", "else", ...
Create a range from lower_version..upper_version. Args: lower_version: Version object representing lower bound of the range. upper_version: Version object representing upper bound of the range. Returns: `VersionRange` object.
[ "Create", "a", "range", "from", "lower_version", "..", "upper_version", "." ]
1d3b846d53b5b5404edfe8ddb9083f9ceec8c5e7
https://github.com/nerdvegas/rez/blob/1d3b846d53b5b5404edfe8ddb9083f9ceec8c5e7/src/rez/vendor/version/version.py#L902-L921
train
nerdvegas/rez
src/rez/vendor/version/version.py
VersionRange.from_version
def from_version(cls, version, op=None): """Create a range from a version. Args: version: Version object. This is used as the upper/lower bound of the range. op: Operation as a string. One of 'gt'/'>', 'gte'/'>=', lt'/'<', 'lte'/'<=', 'eq'/'=='. I...
python
def from_version(cls, version, op=None): """Create a range from a version. Args: version: Version object. This is used as the upper/lower bound of the range. op: Operation as a string. One of 'gt'/'>', 'gte'/'>=', lt'/'<', 'lte'/'<=', 'eq'/'=='. I...
[ "def", "from_version", "(", "cls", ",", "version", ",", "op", "=", "None", ")", ":", "lower", "=", "None", "upper", "=", "None", "if", "op", "is", "None", ":", "lower", "=", "_LowerBound", "(", "version", ",", "True", ")", "upper", "=", "_UpperBound"...
Create a range from a version. Args: version: Version object. This is used as the upper/lower bound of the range. op: Operation as a string. One of 'gt'/'>', 'gte'/'>=', lt'/'<', 'lte'/'<=', 'eq'/'=='. If None, a bounded range will be created ...
[ "Create", "a", "range", "from", "a", "version", "." ]
1d3b846d53b5b5404edfe8ddb9083f9ceec8c5e7
https://github.com/nerdvegas/rez/blob/1d3b846d53b5b5404edfe8ddb9083f9ceec8c5e7/src/rez/vendor/version/version.py#L924-L960
train
nerdvegas/rez
src/rez/vendor/version/version.py
VersionRange.from_versions
def from_versions(cls, versions): """Create a range from a list of versions. This method creates a range that contains only the given versions and no other. Typically the range looks like (for eg) "==3|==4|==5.1". Args: versions: List of Version objects. Returns: ...
python
def from_versions(cls, versions): """Create a range from a list of versions. This method creates a range that contains only the given versions and no other. Typically the range looks like (for eg) "==3|==4|==5.1". Args: versions: List of Version objects. Returns: ...
[ "def", "from_versions", "(", "cls", ",", "versions", ")", ":", "range", "=", "cls", "(", "None", ")", "range", ".", "bounds", "=", "[", "]", "for", "version", "in", "dedup", "(", "sorted", "(", "versions", ")", ")", ":", "lower", "=", "_LowerBound", ...
Create a range from a list of versions. This method creates a range that contains only the given versions and no other. Typically the range looks like (for eg) "==3|==4|==5.1". Args: versions: List of Version objects. Returns: `VersionRange` object.
[ "Create", "a", "range", "from", "a", "list", "of", "versions", "." ]
1d3b846d53b5b5404edfe8ddb9083f9ceec8c5e7
https://github.com/nerdvegas/rez/blob/1d3b846d53b5b5404edfe8ddb9083f9ceec8c5e7/src/rez/vendor/version/version.py#L963-L982
train
nerdvegas/rez
src/rez/vendor/version/version.py
VersionRange.to_versions
def to_versions(self): """Returns exact version ranges as Version objects, or None if there are no exact version ranges present. """ versions = [] for bound in self.bounds: if bound.lower.inclusive and bound.upper.inclusive \ and (bound.lower.versi...
python
def to_versions(self): """Returns exact version ranges as Version objects, or None if there are no exact version ranges present. """ versions = [] for bound in self.bounds: if bound.lower.inclusive and bound.upper.inclusive \ and (bound.lower.versi...
[ "def", "to_versions", "(", "self", ")", ":", "versions", "=", "[", "]", "for", "bound", "in", "self", ".", "bounds", ":", "if", "bound", ".", "lower", ".", "inclusive", "and", "bound", ".", "upper", ".", "inclusive", "and", "(", "bound", ".", "lower"...
Returns exact version ranges as Version objects, or None if there are no exact version ranges present.
[ "Returns", "exact", "version", "ranges", "as", "Version", "objects", "or", "None", "if", "there", "are", "no", "exact", "version", "ranges", "present", "." ]
1d3b846d53b5b5404edfe8ddb9083f9ceec8c5e7
https://github.com/nerdvegas/rez/blob/1d3b846d53b5b5404edfe8ddb9083f9ceec8c5e7/src/rez/vendor/version/version.py#L984-L994
train
nerdvegas/rez
src/rez/vendor/version/version.py
VersionRange.contains_version
def contains_version(self, version): """Returns True if version is contained in this range.""" if len(self.bounds) < 5: # not worth overhead of binary search for bound in self.bounds: i = bound.version_containment(version) if i == 0: ...
python
def contains_version(self, version): """Returns True if version is contained in this range.""" if len(self.bounds) < 5: # not worth overhead of binary search for bound in self.bounds: i = bound.version_containment(version) if i == 0: ...
[ "def", "contains_version", "(", "self", ",", "version", ")", ":", "if", "len", "(", "self", ".", "bounds", ")", "<", "5", ":", "for", "bound", "in", "self", ".", "bounds", ":", "i", "=", "bound", ".", "version_containment", "(", "version", ")", "if",...
Returns True if version is contained in this range.
[ "Returns", "True", "if", "version", "is", "contained", "in", "this", "range", "." ]
1d3b846d53b5b5404edfe8ddb9083f9ceec8c5e7
https://github.com/nerdvegas/rez/blob/1d3b846d53b5b5404edfe8ddb9083f9ceec8c5e7/src/rez/vendor/version/version.py#L996-L1010
train
nerdvegas/rez
src/rez/vendor/version/version.py
VersionRange.iter_intersecting
def iter_intersecting(self, iterable, key=None, descending=False): """Like `iter_intersect_test`, but returns intersections only. Returns: An iterator that returns items from `iterable` that intersect. """ return _ContainsVersionIterator(self, iterable, key, descending, ...
python
def iter_intersecting(self, iterable, key=None, descending=False): """Like `iter_intersect_test`, but returns intersections only. Returns: An iterator that returns items from `iterable` that intersect. """ return _ContainsVersionIterator(self, iterable, key, descending, ...
[ "def", "iter_intersecting", "(", "self", ",", "iterable", ",", "key", "=", "None", ",", "descending", "=", "False", ")", ":", "return", "_ContainsVersionIterator", "(", "self", ",", "iterable", ",", "key", ",", "descending", ",", "mode", "=", "_ContainsVersi...
Like `iter_intersect_test`, but returns intersections only. Returns: An iterator that returns items from `iterable` that intersect.
[ "Like", "iter_intersect_test", "but", "returns", "intersections", "only", "." ]
1d3b846d53b5b5404edfe8ddb9083f9ceec8c5e7
https://github.com/nerdvegas/rez/blob/1d3b846d53b5b5404edfe8ddb9083f9ceec8c5e7/src/rez/vendor/version/version.py#L1033-L1040
train
nerdvegas/rez
src/rez/vendor/version/version.py
VersionRange.iter_non_intersecting
def iter_non_intersecting(self, iterable, key=None, descending=False): """Like `iter_intersect_test`, but returns non-intersections only. Returns: An iterator that returns items from `iterable` that don't intersect. """ return _ContainsVersionIterator(self, iterable, key, de...
python
def iter_non_intersecting(self, iterable, key=None, descending=False): """Like `iter_intersect_test`, but returns non-intersections only. Returns: An iterator that returns items from `iterable` that don't intersect. """ return _ContainsVersionIterator(self, iterable, key, de...
[ "def", "iter_non_intersecting", "(", "self", ",", "iterable", ",", "key", "=", "None", ",", "descending", "=", "False", ")", ":", "return", "_ContainsVersionIterator", "(", "self", ",", "iterable", ",", "key", ",", "descending", ",", "mode", "=", "_ContainsV...
Like `iter_intersect_test`, but returns non-intersections only. Returns: An iterator that returns items from `iterable` that don't intersect.
[ "Like", "iter_intersect_test", "but", "returns", "non", "-", "intersections", "only", "." ]
1d3b846d53b5b5404edfe8ddb9083f9ceec8c5e7
https://github.com/nerdvegas/rez/blob/1d3b846d53b5b5404edfe8ddb9083f9ceec8c5e7/src/rez/vendor/version/version.py#L1042-L1049
train
nerdvegas/rez
src/rez/vendor/version/version.py
VersionRange.span
def span(self): """Return a contiguous range that is a superset of this range. Returns: A VersionRange object representing the span of this range. For example, the span of "2+<4|6+<8" would be "2+<8". """ other = VersionRange(None) bound = _Bound(self.bou...
python
def span(self): """Return a contiguous range that is a superset of this range. Returns: A VersionRange object representing the span of this range. For example, the span of "2+<4|6+<8" would be "2+<8". """ other = VersionRange(None) bound = _Bound(self.bou...
[ "def", "span", "(", "self", ")", ":", "other", "=", "VersionRange", "(", "None", ")", "bound", "=", "_Bound", "(", "self", ".", "bounds", "[", "0", "]", ".", "lower", ",", "self", ".", "bounds", "[", "-", "1", "]", ".", "upper", ")", "other", "...
Return a contiguous range that is a superset of this range. Returns: A VersionRange object representing the span of this range. For example, the span of "2+<4|6+<8" would be "2+<8".
[ "Return", "a", "contiguous", "range", "that", "is", "a", "superset", "of", "this", "range", "." ]
1d3b846d53b5b5404edfe8ddb9083f9ceec8c5e7
https://github.com/nerdvegas/rez/blob/1d3b846d53b5b5404edfe8ddb9083f9ceec8c5e7/src/rez/vendor/version/version.py#L1051-L1061
train
nerdvegas/rez
src/rez/vendor/version/version.py
VersionRange.visit_versions
def visit_versions(self, func): """Visit each version in the range, and apply a function to each. This is for advanced usage only. If `func` returns a `Version`, this call will change the versions in place. It is possible to change versions in a way that is nonsensical - for ...
python
def visit_versions(self, func): """Visit each version in the range, and apply a function to each. This is for advanced usage only. If `func` returns a `Version`, this call will change the versions in place. It is possible to change versions in a way that is nonsensical - for ...
[ "def", "visit_versions", "(", "self", ",", "func", ")", ":", "for", "bound", "in", "self", ".", "bounds", ":", "if", "bound", ".", "lower", "is", "not", "_LowerBound", ".", "min", ":", "result", "=", "func", "(", "bound", ".", "lower", ".", "version"...
Visit each version in the range, and apply a function to each. This is for advanced usage only. If `func` returns a `Version`, this call will change the versions in place. It is possible to change versions in a way that is nonsensical - for example setting an upper bound to a ...
[ "Visit", "each", "version", "in", "the", "range", "and", "apply", "a", "function", "to", "each", "." ]
1d3b846d53b5b5404edfe8ddb9083f9ceec8c5e7
https://github.com/nerdvegas/rez/blob/1d3b846d53b5b5404edfe8ddb9083f9ceec8c5e7/src/rez/vendor/version/version.py#L1065-L1092
train
getsentry/raven-python
raven/transport/http.py
HTTPTransport.send
def send(self, url, data, headers): """ Sends a request to a remote webserver using HTTP POST. """ req = urllib2.Request(url, headers=headers) try: response = urlopen( url=req, data=data, timeout=self.timeout, ...
python
def send(self, url, data, headers): """ Sends a request to a remote webserver using HTTP POST. """ req = urllib2.Request(url, headers=headers) try: response = urlopen( url=req, data=data, timeout=self.timeout, ...
[ "def", "send", "(", "self", ",", "url", ",", "data", ",", "headers", ")", ":", "req", "=", "urllib2", ".", "Request", "(", "url", ",", "headers", "=", "headers", ")", "try", ":", "response", "=", "urlopen", "(", "url", "=", "req", ",", "data", "=...
Sends a request to a remote webserver using HTTP POST.
[ "Sends", "a", "request", "to", "a", "remote", "webserver", "using", "HTTP", "POST", "." ]
d891c20f0f930153f508e9d698d9de42e910face
https://github.com/getsentry/raven-python/blob/d891c20f0f930153f508e9d698d9de42e910face/raven/transport/http.py#L31-L58
train
getsentry/raven-python
raven/contrib/django/views.py
extract_auth_vars
def extract_auth_vars(request): """ raven-js will pass both Authorization and X-Sentry-Auth depending on the browser and server configurations. """ if request.META.get('HTTP_X_SENTRY_AUTH', '').startswith('Sentry'): return request.META['HTTP_X_SENTRY_AUTH'] elif request.META.get('HTTP_AU...
python
def extract_auth_vars(request): """ raven-js will pass both Authorization and X-Sentry-Auth depending on the browser and server configurations. """ if request.META.get('HTTP_X_SENTRY_AUTH', '').startswith('Sentry'): return request.META['HTTP_X_SENTRY_AUTH'] elif request.META.get('HTTP_AU...
[ "def", "extract_auth_vars", "(", "request", ")", ":", "if", "request", ".", "META", ".", "get", "(", "'HTTP_X_SENTRY_AUTH'", ",", "''", ")", ".", "startswith", "(", "'Sentry'", ")", ":", "return", "request", ".", "META", "[", "'HTTP_X_SENTRY_AUTH'", "]", "...
raven-js will pass both Authorization and X-Sentry-Auth depending on the browser and server configurations.
[ "raven", "-", "js", "will", "pass", "both", "Authorization", "and", "X", "-", "Sentry", "-", "Auth", "depending", "on", "the", "browser", "and", "server", "configurations", "." ]
d891c20f0f930153f508e9d698d9de42e910face
https://github.com/getsentry/raven-python/blob/d891c20f0f930153f508e9d698d9de42e910face/raven/contrib/django/views.py#L61-L79
train
getsentry/raven-python
raven/events.py
Exception._get_value
def _get_value(self, exc_type, exc_value, exc_traceback): """ Convert exception info to a value for the values list. """ stack_info = get_stack_info( iter_traceback_frames(exc_traceback), transformer=self.transform, capture_locals=self.client.capture_l...
python
def _get_value(self, exc_type, exc_value, exc_traceback): """ Convert exception info to a value for the values list. """ stack_info = get_stack_info( iter_traceback_frames(exc_traceback), transformer=self.transform, capture_locals=self.client.capture_l...
[ "def", "_get_value", "(", "self", ",", "exc_type", ",", "exc_value", ",", "exc_traceback", ")", ":", "stack_info", "=", "get_stack_info", "(", "iter_traceback_frames", "(", "exc_traceback", ")", ",", "transformer", "=", "self", ".", "transform", ",", "capture_lo...
Convert exception info to a value for the values list.
[ "Convert", "exception", "info", "to", "a", "value", "for", "the", "values", "list", "." ]
d891c20f0f930153f508e9d698d9de42e910face
https://github.com/getsentry/raven-python/blob/d891c20f0f930153f508e9d698d9de42e910face/raven/events.py#L90-L110
train
getsentry/raven-python
raven/breadcrumbs.py
record
def record(message=None, timestamp=None, level=None, category=None, data=None, type=None, processor=None): """Records a breadcrumb for all active clients. This is what integration code should use rather than invoking the `captureBreadcrumb` method on a specific client. """ if timestamp i...
python
def record(message=None, timestamp=None, level=None, category=None, data=None, type=None, processor=None): """Records a breadcrumb for all active clients. This is what integration code should use rather than invoking the `captureBreadcrumb` method on a specific client. """ if timestamp i...
[ "def", "record", "(", "message", "=", "None", ",", "timestamp", "=", "None", ",", "level", "=", "None", ",", "category", "=", "None", ",", "data", "=", "None", ",", "type", "=", "None", ",", "processor", "=", "None", ")", ":", "if", "timestamp", "i...
Records a breadcrumb for all active clients. This is what integration code should use rather than invoking the `captureBreadcrumb` method on a specific client.
[ "Records", "a", "breadcrumb", "for", "all", "active", "clients", ".", "This", "is", "what", "integration", "code", "should", "use", "rather", "than", "invoking", "the", "captureBreadcrumb", "method", "on", "a", "specific", "client", "." ]
d891c20f0f930153f508e9d698d9de42e910face
https://github.com/getsentry/raven-python/blob/d891c20f0f930153f508e9d698d9de42e910face/raven/breadcrumbs.py#L116-L126
train
getsentry/raven-python
raven/breadcrumbs.py
ignore_logger
def ignore_logger(name_or_logger, allow_level=None): """Ignores a logger during breadcrumb recording. """ def handler(logger, level, msg, args, kwargs): if allow_level is not None and \ level >= allow_level: return False return True register_special_log_handler(nam...
python
def ignore_logger(name_or_logger, allow_level=None): """Ignores a logger during breadcrumb recording. """ def handler(logger, level, msg, args, kwargs): if allow_level is not None and \ level >= allow_level: return False return True register_special_log_handler(nam...
[ "def", "ignore_logger", "(", "name_or_logger", ",", "allow_level", "=", "None", ")", ":", "def", "handler", "(", "logger", ",", "level", ",", "msg", ",", "args", ",", "kwargs", ")", ":", "if", "allow_level", "is", "not", "None", "and", "level", ">=", "...
Ignores a logger during breadcrumb recording.
[ "Ignores", "a", "logger", "during", "breadcrumb", "recording", "." ]
d891c20f0f930153f508e9d698d9de42e910face
https://github.com/getsentry/raven-python/blob/d891c20f0f930153f508e9d698d9de42e910face/raven/breadcrumbs.py#L275-L283
train
getsentry/raven-python
raven/utils/serializer/manager.py
Serializer.transform
def transform(self, value, **kwargs): """ Primary function which handles recursively transforming values via their serializers """ if value is None: return None objid = id(value) if objid in self.context: return '<...>' self.contex...
python
def transform(self, value, **kwargs): """ Primary function which handles recursively transforming values via their serializers """ if value is None: return None objid = id(value) if objid in self.context: return '<...>' self.contex...
[ "def", "transform", "(", "self", ",", "value", ",", "**", "kwargs", ")", ":", "if", "value", "is", "None", ":", "return", "None", "objid", "=", "id", "(", "value", ")", "if", "objid", "in", "self", ".", "context", ":", "return", "'<...>'", "self", ...
Primary function which handles recursively transforming values via their serializers
[ "Primary", "function", "which", "handles", "recursively", "transforming", "values", "via", "their", "serializers" ]
d891c20f0f930153f508e9d698d9de42e910face
https://github.com/getsentry/raven-python/blob/d891c20f0f930153f508e9d698d9de42e910face/raven/utils/serializer/manager.py#L52-L85
train
getsentry/raven-python
raven/contrib/tornado/__init__.py
AsyncSentryClient.send
def send(self, auth_header=None, callback=None, **data): """ Serializes the message and passes the payload onto ``send_encoded``. """ message = self.encode(data) return self.send_encoded(message, auth_header=auth_header, callback=callback)
python
def send(self, auth_header=None, callback=None, **data): """ Serializes the message and passes the payload onto ``send_encoded``. """ message = self.encode(data) return self.send_encoded(message, auth_header=auth_header, callback=callback)
[ "def", "send", "(", "self", ",", "auth_header", "=", "None", ",", "callback", "=", "None", ",", "**", "data", ")", ":", "message", "=", "self", ".", "encode", "(", "data", ")", "return", "self", ".", "send_encoded", "(", "message", ",", "auth_header", ...
Serializes the message and passes the payload onto ``send_encoded``.
[ "Serializes", "the", "message", "and", "passes", "the", "payload", "onto", "send_encoded", "." ]
d891c20f0f930153f508e9d698d9de42e910face
https://github.com/getsentry/raven-python/blob/d891c20f0f930153f508e9d698d9de42e910face/raven/contrib/tornado/__init__.py#L47-L53
train
getsentry/raven-python
raven/contrib/tornado/__init__.py
AsyncSentryClient._send_remote
def _send_remote(self, url, data, headers=None, callback=None): """ Initialise a Tornado AsyncClient and send the request to the sentry server. If the callback is a callable, it will be called with the response. """ if headers is None: headers = {} re...
python
def _send_remote(self, url, data, headers=None, callback=None): """ Initialise a Tornado AsyncClient and send the request to the sentry server. If the callback is a callable, it will be called with the response. """ if headers is None: headers = {} re...
[ "def", "_send_remote", "(", "self", ",", "url", ",", "data", ",", "headers", "=", "None", ",", "callback", "=", "None", ")", ":", "if", "headers", "is", "None", ":", "headers", "=", "{", "}", "return", "AsyncHTTPClient", "(", ")", ".", "fetch", "(", ...
Initialise a Tornado AsyncClient and send the request to the sentry server. If the callback is a callable, it will be called with the response.
[ "Initialise", "a", "Tornado", "AsyncClient", "and", "send", "the", "request", "to", "the", "sentry", "server", ".", "If", "the", "callback", "is", "a", "callable", "it", "will", "be", "called", "with", "the", "response", "." ]
d891c20f0f930153f508e9d698d9de42e910face
https://github.com/getsentry/raven-python/blob/d891c20f0f930153f508e9d698d9de42e910face/raven/contrib/tornado/__init__.py#L82-L94
train