id int32 0 252k | repo stringlengths 7 55 | path stringlengths 4 127 | func_name stringlengths 1 88 | original_string stringlengths 75 19.8k | language stringclasses 1
value | code stringlengths 75 19.8k | code_tokens list | docstring stringlengths 3 17.3k | docstring_tokens list | sha stringlengths 40 40 | url stringlengths 87 242 |
|---|---|---|---|---|---|---|---|---|---|---|---|
232,500 | nerdvegas/rez | src/rez/utils/platform_.py | Platform.logical_cores | def logical_cores(self):
"""Return the number of cpu cores as reported to the os.
May be different from physical_cores if, ie, intel's hyperthreading is
enabled.
"""
try:
return self._logical_cores()
except Exception as e:
from rez.utils.logging_ ... | python | def logical_cores(self):
"""Return the number of cpu cores as reported to the os.
May be different from physical_cores if, ie, intel's hyperthreading is
enabled.
"""
try:
return self._logical_cores()
except Exception as e:
from rez.utils.logging_ ... | [
"def",
"logical_cores",
"(",
"self",
")",
":",
"try",
":",
"return",
"self",
".",
"_logical_cores",
"(",
")",
"except",
"Exception",
"as",
"e",
":",
"from",
"rez",
".",
"utils",
".",
"logging_",
"import",
"print_error",
"print_error",
"(",
"\"Error detecting... | Return the number of cpu cores as reported to the os.
May be different from physical_cores if, ie, intel's hyperthreading is
enabled. | [
"Return",
"the",
"number",
"of",
"cpu",
"cores",
"as",
"reported",
"to",
"the",
"os",
"."
] | 1d3b846d53b5b5404edfe8ddb9083f9ceec8c5e7 | https://github.com/nerdvegas/rez/blob/1d3b846d53b5b5404edfe8ddb9083f9ceec8c5e7/src/rez/utils/platform_.py#L93-L105 |
232,501 | nerdvegas/rez | src/rez/vendor/colorama/ansitowin32.py | AnsiToWin32.write_and_convert | def write_and_convert(self, text):
'''
Write the given text to our wrapped stream, stripping any ANSI
sequences from the text, and optionally converting them into win32
calls.
'''
cursor = 0
for match in self.ANSI_RE.finditer(text):
start, end = match.... | python | def write_and_convert(self, text):
'''
Write the given text to our wrapped stream, stripping any ANSI
sequences from the text, and optionally converting them into win32
calls.
'''
cursor = 0
for match in self.ANSI_RE.finditer(text):
start, end = match.... | [
"def",
"write_and_convert",
"(",
"self",
",",
"text",
")",
":",
"cursor",
"=",
"0",
"for",
"match",
"in",
"self",
".",
"ANSI_RE",
".",
"finditer",
"(",
"text",
")",
":",
"start",
",",
"end",
"=",
"match",
".",
"span",
"(",
")",
"self",
".",
"write_... | Write the given text to our wrapped stream, stripping any ANSI
sequences from the text, and optionally converting them into win32
calls. | [
"Write",
"the",
"given",
"text",
"to",
"our",
"wrapped",
"stream",
"stripping",
"any",
"ANSI",
"sequences",
"from",
"the",
"text",
"and",
"optionally",
"converting",
"them",
"into",
"win32",
"calls",
"."
] | 1d3b846d53b5b5404edfe8ddb9083f9ceec8c5e7 | https://github.com/nerdvegas/rez/blob/1d3b846d53b5b5404edfe8ddb9083f9ceec8c5e7/src/rez/vendor/colorama/ansitowin32.py#L131-L143 |
232,502 | nerdvegas/rez | src/rezgui/models/ContextModel.py | ContextModel.copy | def copy(self):
"""Returns a copy of the context."""
other = ContextModel(self._context, self.parent())
other._stale = self._stale
other._modified = self._modified
other.request = self.request[:]
other.packages_path = self.packages_path
other.implicit_packages = s... | python | def copy(self):
"""Returns a copy of the context."""
other = ContextModel(self._context, self.parent())
other._stale = self._stale
other._modified = self._modified
other.request = self.request[:]
other.packages_path = self.packages_path
other.implicit_packages = s... | [
"def",
"copy",
"(",
"self",
")",
":",
"other",
"=",
"ContextModel",
"(",
"self",
".",
"_context",
",",
"self",
".",
"parent",
"(",
")",
")",
"other",
".",
"_stale",
"=",
"self",
".",
"_stale",
"other",
".",
"_modified",
"=",
"self",
".",
"_modified",... | Returns a copy of the context. | [
"Returns",
"a",
"copy",
"of",
"the",
"context",
"."
] | 1d3b846d53b5b5404edfe8ddb9083f9ceec8c5e7 | https://github.com/nerdvegas/rez/blob/1d3b846d53b5b5404edfe8ddb9083f9ceec8c5e7/src/rezgui/models/ContextModel.py#L51-L63 |
232,503 | nerdvegas/rez | src/rezgui/models/ContextModel.py | ContextModel.get_lock_requests | def get_lock_requests(self):
"""Take the current context, and the current patch locks, and determine
the effective requests that will be added to the main request.
Returns:
A dict of (PatchLock, [Requirement]) tuples. Each requirement will be
a weak package reference. If... | python | def get_lock_requests(self):
"""Take the current context, and the current patch locks, and determine
the effective requests that will be added to the main request.
Returns:
A dict of (PatchLock, [Requirement]) tuples. Each requirement will be
a weak package reference. If... | [
"def",
"get_lock_requests",
"(",
"self",
")",
":",
"d",
"=",
"defaultdict",
"(",
"list",
")",
"if",
"self",
".",
"_context",
":",
"for",
"variant",
"in",
"self",
".",
"_context",
".",
"resolved_packages",
":",
"name",
"=",
"variant",
".",
"name",
"versio... | Take the current context, and the current patch locks, and determine
the effective requests that will be added to the main request.
Returns:
A dict of (PatchLock, [Requirement]) tuples. Each requirement will be
a weak package reference. If there is no current context, an empty
... | [
"Take",
"the",
"current",
"context",
"and",
"the",
"current",
"patch",
"locks",
"and",
"determine",
"the",
"effective",
"requests",
"that",
"will",
"be",
"added",
"to",
"the",
"main",
"request",
"."
] | 1d3b846d53b5b5404edfe8ddb9083f9ceec8c5e7 | https://github.com/nerdvegas/rez/blob/1d3b846d53b5b5404edfe8ddb9083f9ceec8c5e7/src/rezgui/models/ContextModel.py#L113-L134 |
232,504 | nerdvegas/rez | src/rezgui/models/ContextModel.py | ContextModel.resolve_context | def resolve_context(self, verbosity=0, max_fails=-1, timestamp=None,
callback=None, buf=None, package_load_callback=None):
"""Update the current context by performing a re-resolve.
The newly resolved context is only applied if it is a successful solve.
Returns:
... | python | def resolve_context(self, verbosity=0, max_fails=-1, timestamp=None,
callback=None, buf=None, package_load_callback=None):
"""Update the current context by performing a re-resolve.
The newly resolved context is only applied if it is a successful solve.
Returns:
... | [
"def",
"resolve_context",
"(",
"self",
",",
"verbosity",
"=",
"0",
",",
"max_fails",
"=",
"-",
"1",
",",
"timestamp",
"=",
"None",
",",
"callback",
"=",
"None",
",",
"buf",
"=",
"None",
",",
"package_load_callback",
"=",
"None",
")",
":",
"package_filter... | Update the current context by performing a re-resolve.
The newly resolved context is only applied if it is a successful solve.
Returns:
`ResolvedContext` object, which may be a successful or failed solve. | [
"Update",
"the",
"current",
"context",
"by",
"performing",
"a",
"re",
"-",
"resolve",
"."
] | 1d3b846d53b5b5404edfe8ddb9083f9ceec8c5e7 | https://github.com/nerdvegas/rez/blob/1d3b846d53b5b5404edfe8ddb9083f9ceec8c5e7/src/rezgui/models/ContextModel.py#L175-L203 |
232,505 | nerdvegas/rez | src/rezgui/models/ContextModel.py | ContextModel.set_context | def set_context(self, context):
"""Replace the current context with another."""
self._set_context(context, emit=False)
self._modified = (not context.load_path)
self.dataChanged.emit(self.CONTEXT_CHANGED |
self.REQUEST_CHANGED |
... | python | def set_context(self, context):
"""Replace the current context with another."""
self._set_context(context, emit=False)
self._modified = (not context.load_path)
self.dataChanged.emit(self.CONTEXT_CHANGED |
self.REQUEST_CHANGED |
... | [
"def",
"set_context",
"(",
"self",
",",
"context",
")",
":",
"self",
".",
"_set_context",
"(",
"context",
",",
"emit",
"=",
"False",
")",
"self",
".",
"_modified",
"=",
"(",
"not",
"context",
".",
"load_path",
")",
"self",
".",
"dataChanged",
".",
"emi... | Replace the current context with another. | [
"Replace",
"the",
"current",
"context",
"with",
"another",
"."
] | 1d3b846d53b5b5404edfe8ddb9083f9ceec8c5e7 | https://github.com/nerdvegas/rez/blob/1d3b846d53b5b5404edfe8ddb9083f9ceec8c5e7/src/rezgui/models/ContextModel.py#L214-L224 |
232,506 | nerdvegas/rez | src/rez/vendor/distlib/util.py | get_resources_dests | def get_resources_dests(resources_root, rules):
"""Find destinations for resources files"""
def get_rel_path(base, path):
# normalizes and returns a lstripped-/-separated path
base = base.replace(os.path.sep, '/')
path = path.replace(os.path.sep, '/')
assert path.startswith(base... | python | def get_resources_dests(resources_root, rules):
"""Find destinations for resources files"""
def get_rel_path(base, path):
# normalizes and returns a lstripped-/-separated path
base = base.replace(os.path.sep, '/')
path = path.replace(os.path.sep, '/')
assert path.startswith(base... | [
"def",
"get_resources_dests",
"(",
"resources_root",
",",
"rules",
")",
":",
"def",
"get_rel_path",
"(",
"base",
",",
"path",
")",
":",
"# normalizes and returns a lstripped-/-separated path",
"base",
"=",
"base",
".",
"replace",
"(",
"os",
".",
"path",
".",
"se... | Find destinations for resources files | [
"Find",
"destinations",
"for",
"resources",
"files"
] | 1d3b846d53b5b5404edfe8ddb9083f9ceec8c5e7 | https://github.com/nerdvegas/rez/blob/1d3b846d53b5b5404edfe8ddb9083f9ceec8c5e7/src/rez/vendor/distlib/util.py#L123-L147 |
232,507 | nerdvegas/rez | src/rez/vendor/pygraph/algorithms/cycles.py | find_cycle | def find_cycle(graph):
"""
Find a cycle in the given graph.
This function will return a list of nodes which form a cycle in the graph or an empty list if
no cycle exists.
@type graph: graph, digraph
@param graph: Graph.
@rtype: list
@return: List of nodes.
"""
... | python | def find_cycle(graph):
"""
Find a cycle in the given graph.
This function will return a list of nodes which form a cycle in the graph or an empty list if
no cycle exists.
@type graph: graph, digraph
@param graph: Graph.
@rtype: list
@return: List of nodes.
"""
... | [
"def",
"find_cycle",
"(",
"graph",
")",
":",
"if",
"(",
"isinstance",
"(",
"graph",
",",
"graph_class",
")",
")",
":",
"directed",
"=",
"False",
"elif",
"(",
"isinstance",
"(",
"graph",
",",
"digraph_class",
")",
")",
":",
"directed",
"=",
"True",
"els... | Find a cycle in the given graph.
This function will return a list of nodes which form a cycle in the graph or an empty list if
no cycle exists.
@type graph: graph, digraph
@param graph: Graph.
@rtype: list
@return: List of nodes. | [
"Find",
"a",
"cycle",
"in",
"the",
"given",
"graph",
".",
"This",
"function",
"will",
"return",
"a",
"list",
"of",
"nodes",
"which",
"form",
"a",
"cycle",
"in",
"the",
"graph",
"or",
"an",
"empty",
"list",
"if",
"no",
"cycle",
"exists",
"."
] | 1d3b846d53b5b5404edfe8ddb9083f9ceec8c5e7 | https://github.com/nerdvegas/rez/blob/1d3b846d53b5b5404edfe8ddb9083f9ceec8c5e7/src/rez/vendor/pygraph/algorithms/cycles.py#L38-L108 |
232,508 | nerdvegas/rez | src/rez/release_vcs.py | create_release_vcs | def create_release_vcs(path, vcs_name=None):
"""Return a new release VCS that can release from this source path."""
from rez.plugin_managers import plugin_manager
vcs_types = get_release_vcs_types()
if vcs_name:
if vcs_name not in vcs_types:
raise ReleaseVCSError("Unknown version con... | python | def create_release_vcs(path, vcs_name=None):
"""Return a new release VCS that can release from this source path."""
from rez.plugin_managers import plugin_manager
vcs_types = get_release_vcs_types()
if vcs_name:
if vcs_name not in vcs_types:
raise ReleaseVCSError("Unknown version con... | [
"def",
"create_release_vcs",
"(",
"path",
",",
"vcs_name",
"=",
"None",
")",
":",
"from",
"rez",
".",
"plugin_managers",
"import",
"plugin_manager",
"vcs_types",
"=",
"get_release_vcs_types",
"(",
")",
"if",
"vcs_name",
":",
"if",
"vcs_name",
"not",
"in",
"vcs... | Return a new release VCS that can release from this source path. | [
"Return",
"a",
"new",
"release",
"VCS",
"that",
"can",
"release",
"from",
"this",
"source",
"path",
"."
] | 1d3b846d53b5b5404edfe8ddb9083f9ceec8c5e7 | https://github.com/nerdvegas/rez/blob/1d3b846d53b5b5404edfe8ddb9083f9ceec8c5e7/src/rez/release_vcs.py#L17-L61 |
232,509 | nerdvegas/rez | src/rez/release_vcs.py | ReleaseVCS.find_vcs_root | def find_vcs_root(cls, path):
"""Try to find a version control root directory of this type for the
given path.
If successful, returns (vcs_root, levels_up), where vcs_root is the
path to the version control root directory it found, and levels_up is an
integer indicating how many... | python | def find_vcs_root(cls, path):
"""Try to find a version control root directory of this type for the
given path.
If successful, returns (vcs_root, levels_up), where vcs_root is the
path to the version control root directory it found, and levels_up is an
integer indicating how many... | [
"def",
"find_vcs_root",
"(",
"cls",
",",
"path",
")",
":",
"if",
"cls",
".",
"search_parents_for_root",
"(",
")",
":",
"valid_dirs",
"=",
"walk_up_dirs",
"(",
"path",
")",
"else",
":",
"valid_dirs",
"=",
"[",
"path",
"]",
"for",
"i",
",",
"current_path",... | Try to find a version control root directory of this type for the
given path.
If successful, returns (vcs_root, levels_up), where vcs_root is the
path to the version control root directory it found, and levels_up is an
integer indicating how many parent directories it had to search thro... | [
"Try",
"to",
"find",
"a",
"version",
"control",
"root",
"directory",
"of",
"this",
"type",
"for",
"the",
"given",
"path",
"."
] | 1d3b846d53b5b5404edfe8ddb9083f9ceec8c5e7 | https://github.com/nerdvegas/rez/blob/1d3b846d53b5b5404edfe8ddb9083f9ceec8c5e7/src/rez/release_vcs.py#L115-L132 |
232,510 | nerdvegas/rez | src/rez/release_vcs.py | ReleaseVCS._cmd | def _cmd(self, *nargs):
"""Convenience function for executing a program such as 'git' etc."""
cmd_str = ' '.join(map(quote, nargs))
if self.package.config.debug("package_release"):
print_debug("Running command: %s" % cmd_str)
p = popen(nargs, stdout=subprocess.PIPE, stderr=... | python | def _cmd(self, *nargs):
"""Convenience function for executing a program such as 'git' etc."""
cmd_str = ' '.join(map(quote, nargs))
if self.package.config.debug("package_release"):
print_debug("Running command: %s" % cmd_str)
p = popen(nargs, stdout=subprocess.PIPE, stderr=... | [
"def",
"_cmd",
"(",
"self",
",",
"*",
"nargs",
")",
":",
"cmd_str",
"=",
"' '",
".",
"join",
"(",
"map",
"(",
"quote",
",",
"nargs",
")",
")",
"if",
"self",
".",
"package",
".",
"config",
".",
"debug",
"(",
"\"package_release\"",
")",
":",
"print_d... | Convenience function for executing a program such as 'git' etc. | [
"Convenience",
"function",
"for",
"executing",
"a",
"program",
"such",
"as",
"git",
"etc",
"."
] | 1d3b846d53b5b5404edfe8ddb9083f9ceec8c5e7 | https://github.com/nerdvegas/rez/blob/1d3b846d53b5b5404edfe8ddb9083f9ceec8c5e7/src/rez/release_vcs.py#L203-L224 |
232,511 | nerdvegas/rez | src/rez/vendor/amqp/channel.py | Channel._close | def _close(self, args):
"""Request a channel close
This method indicates that the sender wants to close the
channel. This may be due to internal conditions (e.g. a forced
shut-down) or due to an error handling a specific method, i.e.
an exception. When a close is due to an exce... | python | def _close(self, args):
"""Request a channel close
This method indicates that the sender wants to close the
channel. This may be due to internal conditions (e.g. a forced
shut-down) or due to an error handling a specific method, i.e.
an exception. When a close is due to an exce... | [
"def",
"_close",
"(",
"self",
",",
"args",
")",
":",
"reply_code",
"=",
"args",
".",
"read_short",
"(",
")",
"reply_text",
"=",
"args",
".",
"read_shortstr",
"(",
")",
"class_id",
"=",
"args",
".",
"read_short",
"(",
")",
"method_id",
"=",
"args",
".",... | Request a channel close
This method indicates that the sender wants to close the
channel. This may be due to internal conditions (e.g. a forced
shut-down) or due to an error handling a specific method, i.e.
an exception. When a close is due to an exception, the sender
provides ... | [
"Request",
"a",
"channel",
"close"
] | 1d3b846d53b5b5404edfe8ddb9083f9ceec8c5e7 | https://github.com/nerdvegas/rez/blob/1d3b846d53b5b5404edfe8ddb9083f9ceec8c5e7/src/rez/vendor/amqp/channel.py#L186-L244 |
232,512 | nerdvegas/rez | src/rez/vendor/amqp/channel.py | Channel._x_flow_ok | def _x_flow_ok(self, active):
"""Confirm a flow method
Confirms to the peer that a flow command was received and
processed.
PARAMETERS:
active: boolean
current flow setting
Confirms the setting of the processed flow method:
... | python | def _x_flow_ok(self, active):
"""Confirm a flow method
Confirms to the peer that a flow command was received and
processed.
PARAMETERS:
active: boolean
current flow setting
Confirms the setting of the processed flow method:
... | [
"def",
"_x_flow_ok",
"(",
"self",
",",
"active",
")",
":",
"args",
"=",
"AMQPWriter",
"(",
")",
"args",
".",
"write_bit",
"(",
"active",
")",
"self",
".",
"_send_method",
"(",
"(",
"20",
",",
"21",
")",
",",
"args",
")"
] | Confirm a flow method
Confirms to the peer that a flow command was received and
processed.
PARAMETERS:
active: boolean
current flow setting
Confirms the setting of the processed flow method:
True means the peer will start sending or... | [
"Confirm",
"a",
"flow",
"method"
] | 1d3b846d53b5b5404edfe8ddb9083f9ceec8c5e7 | https://github.com/nerdvegas/rez/blob/1d3b846d53b5b5404edfe8ddb9083f9ceec8c5e7/src/rez/vendor/amqp/channel.py#L364-L382 |
232,513 | nerdvegas/rez | src/rez/vendor/amqp/channel.py | Channel._x_open | def _x_open(self):
"""Open a channel for use
This method opens a virtual connection (a channel).
RULE:
This method MUST NOT be called when the channel is already
open.
PARAMETERS:
out_of_band: shortstr (DEPRECATED)
out-of-band sett... | python | def _x_open(self):
"""Open a channel for use
This method opens a virtual connection (a channel).
RULE:
This method MUST NOT be called when the channel is already
open.
PARAMETERS:
out_of_band: shortstr (DEPRECATED)
out-of-band sett... | [
"def",
"_x_open",
"(",
"self",
")",
":",
"if",
"self",
".",
"is_open",
":",
"return",
"args",
"=",
"AMQPWriter",
"(",
")",
"args",
".",
"write_shortstr",
"(",
"''",
")",
"# out_of_band: deprecated",
"self",
".",
"_send_method",
"(",
"(",
"20",
",",
"10",... | Open a channel for use
This method opens a virtual connection (a channel).
RULE:
This method MUST NOT be called when the channel is already
open.
PARAMETERS:
out_of_band: shortstr (DEPRECATED)
out-of-band settings
Configur... | [
"Open",
"a",
"channel",
"for",
"use"
] | 1d3b846d53b5b5404edfe8ddb9083f9ceec8c5e7 | https://github.com/nerdvegas/rez/blob/1d3b846d53b5b5404edfe8ddb9083f9ceec8c5e7/src/rez/vendor/amqp/channel.py#L402-L430 |
232,514 | nerdvegas/rez | src/rez/vendor/amqp/channel.py | Channel.exchange_declare | def exchange_declare(self, exchange, type, passive=False, durable=False,
auto_delete=True, nowait=False, arguments=None):
"""Declare exchange, create if needed
This method creates an exchange if it does not already exist,
and if the exchange exists, verifies that it is ... | python | def exchange_declare(self, exchange, type, passive=False, durable=False,
auto_delete=True, nowait=False, arguments=None):
"""Declare exchange, create if needed
This method creates an exchange if it does not already exist,
and if the exchange exists, verifies that it is ... | [
"def",
"exchange_declare",
"(",
"self",
",",
"exchange",
",",
"type",
",",
"passive",
"=",
"False",
",",
"durable",
"=",
"False",
",",
"auto_delete",
"=",
"True",
",",
"nowait",
"=",
"False",
",",
"arguments",
"=",
"None",
")",
":",
"arguments",
"=",
"... | Declare exchange, create if needed
This method creates an exchange if it does not already exist,
and if the exchange exists, verifies that it is of the correct
and expected class.
RULE:
The server SHOULD support a minimum of 16 exchanges per
virtual host and id... | [
"Declare",
"exchange",
"create",
"if",
"needed"
] | 1d3b846d53b5b5404edfe8ddb9083f9ceec8c5e7 | https://github.com/nerdvegas/rez/blob/1d3b846d53b5b5404edfe8ddb9083f9ceec8c5e7/src/rez/vendor/amqp/channel.py#L481-L623 |
232,515 | nerdvegas/rez | src/rez/vendor/amqp/channel.py | Channel.exchange_bind | def exchange_bind(self, destination, source='', routing_key='',
nowait=False, arguments=None):
"""This method binds an exchange to an exchange.
RULE:
A server MUST allow and ignore duplicate bindings - that
is, two or more bind methods for a specific excha... | python | def exchange_bind(self, destination, source='', routing_key='',
nowait=False, arguments=None):
"""This method binds an exchange to an exchange.
RULE:
A server MUST allow and ignore duplicate bindings - that
is, two or more bind methods for a specific excha... | [
"def",
"exchange_bind",
"(",
"self",
",",
"destination",
",",
"source",
"=",
"''",
",",
"routing_key",
"=",
"''",
",",
"nowait",
"=",
"False",
",",
"arguments",
"=",
"None",
")",
":",
"arguments",
"=",
"{",
"}",
"if",
"arguments",
"is",
"None",
"else",... | This method binds an exchange to an exchange.
RULE:
A server MUST allow and ignore duplicate bindings - that
is, two or more bind methods for a specific exchanges,
with identical arguments - without treating these as an
error.
RULE:
A serve... | [
"This",
"method",
"binds",
"an",
"exchange",
"to",
"an",
"exchange",
"."
] | 1d3b846d53b5b5404edfe8ddb9083f9ceec8c5e7 | https://github.com/nerdvegas/rez/blob/1d3b846d53b5b5404edfe8ddb9083f9ceec8c5e7/src/rez/vendor/amqp/channel.py#L697-L783 |
232,516 | nerdvegas/rez | src/rez/vendor/amqp/channel.py | Channel.queue_declare | def queue_declare(self, queue='', passive=False, durable=False,
exclusive=False, auto_delete=True, nowait=False,
arguments=None):
"""Declare queue, create if needed
This method creates or checks a queue. When creating a new
queue the client can speci... | python | def queue_declare(self, queue='', passive=False, durable=False,
exclusive=False, auto_delete=True, nowait=False,
arguments=None):
"""Declare queue, create if needed
This method creates or checks a queue. When creating a new
queue the client can speci... | [
"def",
"queue_declare",
"(",
"self",
",",
"queue",
"=",
"''",
",",
"passive",
"=",
"False",
",",
"durable",
"=",
"False",
",",
"exclusive",
"=",
"False",
",",
"auto_delete",
"=",
"True",
",",
"nowait",
"=",
"False",
",",
"arguments",
"=",
"None",
")",
... | Declare queue, create if needed
This method creates or checks a queue. When creating a new
queue the client can specify various properties that control
the durability of the queue and its contents, and the level of
sharing for the queue.
RULE:
The server MUST crea... | [
"Declare",
"queue",
"create",
"if",
"needed"
] | 1d3b846d53b5b5404edfe8ddb9083f9ceec8c5e7 | https://github.com/nerdvegas/rez/blob/1d3b846d53b5b5404edfe8ddb9083f9ceec8c5e7/src/rez/vendor/amqp/channel.py#L1090-L1260 |
232,517 | nerdvegas/rez | src/rez/vendor/amqp/channel.py | Channel._queue_declare_ok | def _queue_declare_ok(self, args):
"""Confirms a queue definition
This method confirms a Declare method and confirms the name of
the queue, essential for automatically-named queues.
PARAMETERS:
queue: shortstr
Reports the name of the queue. If the server ge... | python | def _queue_declare_ok(self, args):
"""Confirms a queue definition
This method confirms a Declare method and confirms the name of
the queue, essential for automatically-named queues.
PARAMETERS:
queue: shortstr
Reports the name of the queue. If the server ge... | [
"def",
"_queue_declare_ok",
"(",
"self",
",",
"args",
")",
":",
"return",
"queue_declare_ok_t",
"(",
"args",
".",
"read_shortstr",
"(",
")",
",",
"args",
".",
"read_long",
"(",
")",
",",
"args",
".",
"read_long",
"(",
")",
",",
")"
] | Confirms a queue definition
This method confirms a Declare method and confirms the name of
the queue, essential for automatically-named queues.
PARAMETERS:
queue: shortstr
Reports the name of the queue. If the server generated
a queue name, this fie... | [
"Confirms",
"a",
"queue",
"definition"
] | 1d3b846d53b5b5404edfe8ddb9083f9ceec8c5e7 | https://github.com/nerdvegas/rez/blob/1d3b846d53b5b5404edfe8ddb9083f9ceec8c5e7/src/rez/vendor/amqp/channel.py#L1262-L1295 |
232,518 | nerdvegas/rez | src/rez/vendor/amqp/channel.py | Channel.queue_delete | def queue_delete(self, queue='',
if_unused=False, if_empty=False, nowait=False):
"""Delete a queue
This method deletes a queue. When a queue is deleted any
pending messages are sent to a dead-letter queue if this is
defined in the server configuration, and all cons... | python | def queue_delete(self, queue='',
if_unused=False, if_empty=False, nowait=False):
"""Delete a queue
This method deletes a queue. When a queue is deleted any
pending messages are sent to a dead-letter queue if this is
defined in the server configuration, and all cons... | [
"def",
"queue_delete",
"(",
"self",
",",
"queue",
"=",
"''",
",",
"if_unused",
"=",
"False",
",",
"if_empty",
"=",
"False",
",",
"nowait",
"=",
"False",
")",
":",
"args",
"=",
"AMQPWriter",
"(",
")",
"args",
".",
"write_short",
"(",
"0",
")",
"args",... | Delete a queue
This method deletes a queue. When a queue is deleted any
pending messages are sent to a dead-letter queue if this is
defined in the server configuration, and all consumers on the
queue are cancelled.
RULE:
The server SHOULD use a dead-letter queue t... | [
"Delete",
"a",
"queue"
] | 1d3b846d53b5b5404edfe8ddb9083f9ceec8c5e7 | https://github.com/nerdvegas/rez/blob/1d3b846d53b5b5404edfe8ddb9083f9ceec8c5e7/src/rez/vendor/amqp/channel.py#L1297-L1375 |
232,519 | nerdvegas/rez | src/rez/vendor/amqp/channel.py | Channel.queue_purge | def queue_purge(self, queue='', nowait=False):
"""Purge a queue
This method removes all messages from a queue. It does not
cancel consumers. Purged messages are deleted without any
formal "undo" mechanism.
RULE:
A call to purge MUST result in an empty queue.
... | python | def queue_purge(self, queue='', nowait=False):
"""Purge a queue
This method removes all messages from a queue. It does not
cancel consumers. Purged messages are deleted without any
formal "undo" mechanism.
RULE:
A call to purge MUST result in an empty queue.
... | [
"def",
"queue_purge",
"(",
"self",
",",
"queue",
"=",
"''",
",",
"nowait",
"=",
"False",
")",
":",
"args",
"=",
"AMQPWriter",
"(",
")",
"args",
".",
"write_short",
"(",
"0",
")",
"args",
".",
"write_shortstr",
"(",
"queue",
")",
"args",
".",
"write_b... | Purge a queue
This method removes all messages from a queue. It does not
cancel consumers. Purged messages are deleted without any
formal "undo" mechanism.
RULE:
A call to purge MUST result in an empty queue.
RULE:
On transacted channels the server ... | [
"Purge",
"a",
"queue"
] | 1d3b846d53b5b5404edfe8ddb9083f9ceec8c5e7 | https://github.com/nerdvegas/rez/blob/1d3b846d53b5b5404edfe8ddb9083f9ceec8c5e7/src/rez/vendor/amqp/channel.py#L1392-L1457 |
232,520 | nerdvegas/rez | src/rez/vendor/amqp/channel.py | Channel.basic_ack | def basic_ack(self, delivery_tag, multiple=False):
"""Acknowledge one or more messages
This method acknowledges one or more messages delivered via
the Deliver or Get-Ok methods. The client can ask to confirm
a single message or a set of messages up to and including a
specific m... | python | def basic_ack(self, delivery_tag, multiple=False):
"""Acknowledge one or more messages
This method acknowledges one or more messages delivered via
the Deliver or Get-Ok methods. The client can ask to confirm
a single message or a set of messages up to and including a
specific m... | [
"def",
"basic_ack",
"(",
"self",
",",
"delivery_tag",
",",
"multiple",
"=",
"False",
")",
":",
"args",
"=",
"AMQPWriter",
"(",
")",
"args",
".",
"write_longlong",
"(",
"delivery_tag",
")",
"args",
".",
"write_bit",
"(",
"multiple",
")",
"self",
".",
"_se... | Acknowledge one or more messages
This method acknowledges one or more messages delivered via
the Deliver or Get-Ok methods. The client can ask to confirm
a single message or a set of messages up to and including a
specific message.
PARAMETERS:
delivery_tag: longlon... | [
"Acknowledge",
"one",
"or",
"more",
"messages"
] | 1d3b846d53b5b5404edfe8ddb9083f9ceec8c5e7 | https://github.com/nerdvegas/rez/blob/1d3b846d53b5b5404edfe8ddb9083f9ceec8c5e7/src/rez/vendor/amqp/channel.py#L1534-L1584 |
232,521 | nerdvegas/rez | src/rez/vendor/amqp/channel.py | Channel.basic_cancel | def basic_cancel(self, consumer_tag, nowait=False):
"""End a queue consumer
This method cancels a consumer. This does not affect already
delivered messages, but it does mean the server will not send
any more messages for that consumer. The client may receive
an abitrary number ... | python | def basic_cancel(self, consumer_tag, nowait=False):
"""End a queue consumer
This method cancels a consumer. This does not affect already
delivered messages, but it does mean the server will not send
any more messages for that consumer. The client may receive
an abitrary number ... | [
"def",
"basic_cancel",
"(",
"self",
",",
"consumer_tag",
",",
"nowait",
"=",
"False",
")",
":",
"if",
"self",
".",
"connection",
"is",
"not",
"None",
":",
"self",
".",
"no_ack_consumers",
".",
"discard",
"(",
"consumer_tag",
")",
"args",
"=",
"AMQPWriter",... | End a queue consumer
This method cancels a consumer. This does not affect already
delivered messages, but it does mean the server will not send
any more messages for that consumer. The client may receive
an abitrary number of messages in between sending the cancel
method and re... | [
"End",
"a",
"queue",
"consumer"
] | 1d3b846d53b5b5404edfe8ddb9083f9ceec8c5e7 | https://github.com/nerdvegas/rez/blob/1d3b846d53b5b5404edfe8ddb9083f9ceec8c5e7/src/rez/vendor/amqp/channel.py#L1586-L1634 |
232,522 | nerdvegas/rez | src/rez/vendor/amqp/channel.py | Channel._basic_cancel_notify | def _basic_cancel_notify(self, args):
"""Consumer cancelled by server.
Most likely the queue was deleted.
"""
consumer_tag = args.read_shortstr()
callback = self._on_cancel(consumer_tag)
if callback:
callback(consumer_tag)
else:
raise Con... | python | def _basic_cancel_notify(self, args):
"""Consumer cancelled by server.
Most likely the queue was deleted.
"""
consumer_tag = args.read_shortstr()
callback = self._on_cancel(consumer_tag)
if callback:
callback(consumer_tag)
else:
raise Con... | [
"def",
"_basic_cancel_notify",
"(",
"self",
",",
"args",
")",
":",
"consumer_tag",
"=",
"args",
".",
"read_shortstr",
"(",
")",
"callback",
"=",
"self",
".",
"_on_cancel",
"(",
"consumer_tag",
")",
"if",
"callback",
":",
"callback",
"(",
"consumer_tag",
")",... | Consumer cancelled by server.
Most likely the queue was deleted. | [
"Consumer",
"cancelled",
"by",
"server",
"."
] | 1d3b846d53b5b5404edfe8ddb9083f9ceec8c5e7 | https://github.com/nerdvegas/rez/blob/1d3b846d53b5b5404edfe8ddb9083f9ceec8c5e7/src/rez/vendor/amqp/channel.py#L1636-L1647 |
232,523 | nerdvegas/rez | src/rez/vendor/amqp/channel.py | Channel.basic_consume | def basic_consume(self, queue='', consumer_tag='', no_local=False,
no_ack=False, exclusive=False, nowait=False,
callback=None, arguments=None, on_cancel=None):
"""Start a queue consumer
This method asks the server to start a "consumer", which is a
tra... | python | def basic_consume(self, queue='', consumer_tag='', no_local=False,
no_ack=False, exclusive=False, nowait=False,
callback=None, arguments=None, on_cancel=None):
"""Start a queue consumer
This method asks the server to start a "consumer", which is a
tra... | [
"def",
"basic_consume",
"(",
"self",
",",
"queue",
"=",
"''",
",",
"consumer_tag",
"=",
"''",
",",
"no_local",
"=",
"False",
",",
"no_ack",
"=",
"False",
",",
"exclusive",
"=",
"False",
",",
"nowait",
"=",
"False",
",",
"callback",
"=",
"None",
",",
... | Start a queue consumer
This method asks the server to start a "consumer", which is a
transient request for messages from a specific queue.
Consumers last as long as the channel they were created on, or
until the client cancels them.
RULE:
The server SHOULD support ... | [
"Start",
"a",
"queue",
"consumer"
] | 1d3b846d53b5b5404edfe8ddb9083f9ceec8c5e7 | https://github.com/nerdvegas/rez/blob/1d3b846d53b5b5404edfe8ddb9083f9ceec8c5e7/src/rez/vendor/amqp/channel.py#L1677-L1798 |
232,524 | nerdvegas/rez | src/rez/vendor/amqp/channel.py | Channel._basic_deliver | def _basic_deliver(self, args, msg):
"""Notify the client of a consumer message
This method delivers a message to the client, via a consumer.
In the asynchronous message delivery model, the client starts
a consumer using the Consume method, then the server responds
with Deliver ... | python | def _basic_deliver(self, args, msg):
"""Notify the client of a consumer message
This method delivers a message to the client, via a consumer.
In the asynchronous message delivery model, the client starts
a consumer using the Consume method, then the server responds
with Deliver ... | [
"def",
"_basic_deliver",
"(",
"self",
",",
"args",
",",
"msg",
")",
":",
"consumer_tag",
"=",
"args",
".",
"read_shortstr",
"(",
")",
"delivery_tag",
"=",
"args",
".",
"read_longlong",
"(",
")",
"redelivered",
"=",
"args",
".",
"read_bit",
"(",
")",
"exc... | Notify the client of a consumer message
This method delivers a message to the client, via a consumer.
In the asynchronous message delivery model, the client starts
a consumer using the Consume method, then the server responds
with Deliver methods as and when messages arrive for that
... | [
"Notify",
"the",
"client",
"of",
"a",
"consumer",
"message"
] | 1d3b846d53b5b5404edfe8ddb9083f9ceec8c5e7 | https://github.com/nerdvegas/rez/blob/1d3b846d53b5b5404edfe8ddb9083f9ceec8c5e7/src/rez/vendor/amqp/channel.py#L1816-L1909 |
232,525 | nerdvegas/rez | src/rez/vendor/amqp/channel.py | Channel._basic_get_ok | def _basic_get_ok(self, args, msg):
"""Provide client with a message
This method delivers a message to the client following a get
method. A message delivered by 'get-ok' must be acknowledged
unless the no-ack option was set in the get method.
PARAMETERS:
delivery_t... | python | def _basic_get_ok(self, args, msg):
"""Provide client with a message
This method delivers a message to the client following a get
method. A message delivered by 'get-ok' must be acknowledged
unless the no-ack option was set in the get method.
PARAMETERS:
delivery_t... | [
"def",
"_basic_get_ok",
"(",
"self",
",",
"args",
",",
"msg",
")",
":",
"delivery_tag",
"=",
"args",
".",
"read_longlong",
"(",
")",
"redelivered",
"=",
"args",
".",
"read_bit",
"(",
")",
"exchange",
"=",
"args",
".",
"read_shortstr",
"(",
")",
"routing_... | Provide client with a message
This method delivers a message to the client following a get
method. A message delivered by 'get-ok' must be acknowledged
unless the no-ack option was set in the get method.
PARAMETERS:
delivery_tag: longlong
server-assigned d... | [
"Provide",
"client",
"with",
"a",
"message"
] | 1d3b846d53b5b5404edfe8ddb9083f9ceec8c5e7 | https://github.com/nerdvegas/rez/blob/1d3b846d53b5b5404edfe8ddb9083f9ceec8c5e7/src/rez/vendor/amqp/channel.py#L1975-L2047 |
232,526 | nerdvegas/rez | src/rez/vendor/amqp/channel.py | Channel._basic_publish | def _basic_publish(self, msg, exchange='', routing_key='',
mandatory=False, immediate=False):
"""Publish a message
This method publishes a message to a specific exchange. The
message will be routed to queues as defined by the exchange
configuration and distributed... | python | def _basic_publish(self, msg, exchange='', routing_key='',
mandatory=False, immediate=False):
"""Publish a message
This method publishes a message to a specific exchange. The
message will be routed to queues as defined by the exchange
configuration and distributed... | [
"def",
"_basic_publish",
"(",
"self",
",",
"msg",
",",
"exchange",
"=",
"''",
",",
"routing_key",
"=",
"''",
",",
"mandatory",
"=",
"False",
",",
"immediate",
"=",
"False",
")",
":",
"args",
"=",
"AMQPWriter",
"(",
")",
"args",
".",
"write_short",
"(",... | Publish a message
This method publishes a message to a specific exchange. The
message will be routed to queues as defined by the exchange
configuration and distributed to any active consumers when the
transaction, if any, is committed.
PARAMETERS:
exchange: shortstr... | [
"Publish",
"a",
"message"
] | 1d3b846d53b5b5404edfe8ddb9083f9ceec8c5e7 | https://github.com/nerdvegas/rez/blob/1d3b846d53b5b5404edfe8ddb9083f9ceec8c5e7/src/rez/vendor/amqp/channel.py#L2049-L2123 |
232,527 | nerdvegas/rez | src/rez/vendor/amqp/channel.py | Channel.basic_qos | def basic_qos(self, prefetch_size, prefetch_count, a_global):
"""Specify quality of service
This method requests a specific quality of service. The QoS
can be specified for the current channel or for all channels
on the connection. The particular properties and semantics of
a ... | python | def basic_qos(self, prefetch_size, prefetch_count, a_global):
"""Specify quality of service
This method requests a specific quality of service. The QoS
can be specified for the current channel or for all channels
on the connection. The particular properties and semantics of
a ... | [
"def",
"basic_qos",
"(",
"self",
",",
"prefetch_size",
",",
"prefetch_count",
",",
"a_global",
")",
":",
"args",
"=",
"AMQPWriter",
"(",
")",
"args",
".",
"write_long",
"(",
"prefetch_size",
")",
"args",
".",
"write_short",
"(",
"prefetch_count",
")",
"args"... | Specify quality of service
This method requests a specific quality of service. The QoS
can be specified for the current channel or for all channels
on the connection. The particular properties and semantics of
a qos method always depend on the content class semantics.
Though t... | [
"Specify",
"quality",
"of",
"service"
] | 1d3b846d53b5b5404edfe8ddb9083f9ceec8c5e7 | https://github.com/nerdvegas/rez/blob/1d3b846d53b5b5404edfe8ddb9083f9ceec8c5e7/src/rez/vendor/amqp/channel.py#L2135-L2206 |
232,528 | nerdvegas/rez | src/rez/vendor/amqp/channel.py | Channel.basic_recover | def basic_recover(self, requeue=False):
"""Redeliver unacknowledged messages
This method asks the broker to redeliver all unacknowledged
messages on a specified channel. Zero or more messages may be
redelivered. This method is only allowed on non-transacted
channels.
R... | python | def basic_recover(self, requeue=False):
"""Redeliver unacknowledged messages
This method asks the broker to redeliver all unacknowledged
messages on a specified channel. Zero or more messages may be
redelivered. This method is only allowed on non-transacted
channels.
R... | [
"def",
"basic_recover",
"(",
"self",
",",
"requeue",
"=",
"False",
")",
":",
"args",
"=",
"AMQPWriter",
"(",
")",
"args",
".",
"write_bit",
"(",
"requeue",
")",
"self",
".",
"_send_method",
"(",
"(",
"60",
",",
"110",
")",
",",
"args",
")"
] | Redeliver unacknowledged messages
This method asks the broker to redeliver all unacknowledged
messages on a specified channel. Zero or more messages may be
redelivered. This method is only allowed on non-transacted
channels.
RULE:
The server MUST set the redeliver... | [
"Redeliver",
"unacknowledged",
"messages"
] | 1d3b846d53b5b5404edfe8ddb9083f9ceec8c5e7 | https://github.com/nerdvegas/rez/blob/1d3b846d53b5b5404edfe8ddb9083f9ceec8c5e7/src/rez/vendor/amqp/channel.py#L2218-L2250 |
232,529 | nerdvegas/rez | src/rez/vendor/amqp/channel.py | Channel.basic_reject | def basic_reject(self, delivery_tag, requeue):
"""Reject an incoming message
This method allows a client to reject a message. It can be
used to interrupt and cancel large incoming messages, or
return untreatable messages to their original queue.
RULE:
The server S... | python | def basic_reject(self, delivery_tag, requeue):
"""Reject an incoming message
This method allows a client to reject a message. It can be
used to interrupt and cancel large incoming messages, or
return untreatable messages to their original queue.
RULE:
The server S... | [
"def",
"basic_reject",
"(",
"self",
",",
"delivery_tag",
",",
"requeue",
")",
":",
"args",
"=",
"AMQPWriter",
"(",
")",
"args",
".",
"write_longlong",
"(",
"delivery_tag",
")",
"args",
".",
"write_bit",
"(",
"requeue",
")",
"self",
".",
"_send_method",
"("... | Reject an incoming message
This method allows a client to reject a message. It can be
used to interrupt and cancel large incoming messages, or
return untreatable messages to their original queue.
RULE:
The server SHOULD be capable of accepting and process the
... | [
"Reject",
"an",
"incoming",
"message"
] | 1d3b846d53b5b5404edfe8ddb9083f9ceec8c5e7 | https://github.com/nerdvegas/rez/blob/1d3b846d53b5b5404edfe8ddb9083f9ceec8c5e7/src/rez/vendor/amqp/channel.py#L2261-L2334 |
232,530 | nerdvegas/rez | src/rez/vendor/amqp/channel.py | Channel._basic_return | def _basic_return(self, args, msg):
"""Return a failed message
This method returns an undeliverable message that was
published with the "immediate" flag set, or an unroutable
message published with the "mandatory" flag set. The reply
code and text provide information about the r... | python | def _basic_return(self, args, msg):
"""Return a failed message
This method returns an undeliverable message that was
published with the "immediate" flag set, or an unroutable
message published with the "mandatory" flag set. The reply
code and text provide information about the r... | [
"def",
"_basic_return",
"(",
"self",
",",
"args",
",",
"msg",
")",
":",
"self",
".",
"returned_messages",
".",
"put",
"(",
"basic_return_t",
"(",
"args",
".",
"read_short",
"(",
")",
",",
"args",
".",
"read_shortstr",
"(",
")",
",",
"args",
".",
"read_... | Return a failed message
This method returns an undeliverable message that was
published with the "immediate" flag set, or an unroutable
message published with the "mandatory" flag set. The reply
code and text provide information about the reason that the
message was undeliverabl... | [
"Return",
"a",
"failed",
"message"
] | 1d3b846d53b5b5404edfe8ddb9083f9ceec8c5e7 | https://github.com/nerdvegas/rez/blob/1d3b846d53b5b5404edfe8ddb9083f9ceec8c5e7/src/rez/vendor/amqp/channel.py#L2336-L2375 |
232,531 | nerdvegas/rez | src/rez/build_process_.py | create_build_process | def create_build_process(process_type, working_dir, build_system, package=None,
vcs=None, ensure_latest=True, skip_repo_errors=False,
ignore_existing_tag=False, verbose=False, quiet=False):
"""Create a `BuildProcess` instance."""
from rez.plugin_managers import ... | python | def create_build_process(process_type, working_dir, build_system, package=None,
vcs=None, ensure_latest=True, skip_repo_errors=False,
ignore_existing_tag=False, verbose=False, quiet=False):
"""Create a `BuildProcess` instance."""
from rez.plugin_managers import ... | [
"def",
"create_build_process",
"(",
"process_type",
",",
"working_dir",
",",
"build_system",
",",
"package",
"=",
"None",
",",
"vcs",
"=",
"None",
",",
"ensure_latest",
"=",
"True",
",",
"skip_repo_errors",
"=",
"False",
",",
"ignore_existing_tag",
"=",
"False",... | Create a `BuildProcess` instance. | [
"Create",
"a",
"BuildProcess",
"instance",
"."
] | 1d3b846d53b5b5404edfe8ddb9083f9ceec8c5e7 | https://github.com/nerdvegas/rez/blob/1d3b846d53b5b5404edfe8ddb9083f9ceec8c5e7/src/rez/build_process_.py#L26-L45 |
232,532 | nerdvegas/rez | src/rez/build_process_.py | BuildProcessHelper.visit_variants | def visit_variants(self, func, variants=None, **kwargs):
"""Iterate over variants and call a function on each."""
if variants:
present_variants = range(self.package.num_variants)
invalid_variants = set(variants) - set(present_variants)
if invalid_variants:
... | python | def visit_variants(self, func, variants=None, **kwargs):
"""Iterate over variants and call a function on each."""
if variants:
present_variants = range(self.package.num_variants)
invalid_variants = set(variants) - set(present_variants)
if invalid_variants:
... | [
"def",
"visit_variants",
"(",
"self",
",",
"func",
",",
"variants",
"=",
"None",
",",
"*",
"*",
"kwargs",
")",
":",
"if",
"variants",
":",
"present_variants",
"=",
"range",
"(",
"self",
".",
"package",
".",
"num_variants",
")",
"invalid_variants",
"=",
"... | Iterate over variants and call a function on each. | [
"Iterate",
"over",
"variants",
"and",
"call",
"a",
"function",
"on",
"each",
"."
] | 1d3b846d53b5b5404edfe8ddb9083f9ceec8c5e7 | https://github.com/nerdvegas/rez/blob/1d3b846d53b5b5404edfe8ddb9083f9ceec8c5e7/src/rez/build_process_.py#L175-L201 |
232,533 | nerdvegas/rez | src/rez/build_process_.py | BuildProcessHelper.create_build_context | def create_build_context(self, variant, build_type, build_path):
"""Create a context to build the variant within."""
request = variant.get_requires(build_requires=True,
private_build_requires=True)
req_strs = map(str, request)
quoted_req_strs = map... | python | def create_build_context(self, variant, build_type, build_path):
"""Create a context to build the variant within."""
request = variant.get_requires(build_requires=True,
private_build_requires=True)
req_strs = map(str, request)
quoted_req_strs = map... | [
"def",
"create_build_context",
"(",
"self",
",",
"variant",
",",
"build_type",
",",
"build_path",
")",
":",
"request",
"=",
"variant",
".",
"get_requires",
"(",
"build_requires",
"=",
"True",
",",
"private_build_requires",
"=",
"True",
")",
"req_strs",
"=",
"m... | Create a context to build the variant within. | [
"Create",
"a",
"context",
"to",
"build",
"the",
"variant",
"within",
"."
] | 1d3b846d53b5b5404edfe8ddb9083f9ceec8c5e7 | https://github.com/nerdvegas/rez/blob/1d3b846d53b5b5404edfe8ddb9083f9ceec8c5e7/src/rez/build_process_.py#L218-L253 |
232,534 | nerdvegas/rez | src/rez/build_process_.py | BuildProcessHelper.get_release_data | def get_release_data(self):
"""Get release data for this release.
Returns:
dict.
"""
previous_package = self.get_previous_release()
if previous_package:
previous_version = previous_package.version
previous_revision = previous_package.revision
... | python | def get_release_data(self):
"""Get release data for this release.
Returns:
dict.
"""
previous_package = self.get_previous_release()
if previous_package:
previous_version = previous_package.version
previous_revision = previous_package.revision
... | [
"def",
"get_release_data",
"(",
"self",
")",
":",
"previous_package",
"=",
"self",
".",
"get_previous_release",
"(",
")",
"if",
"previous_package",
":",
"previous_version",
"=",
"previous_package",
".",
"version",
"previous_revision",
"=",
"previous_package",
".",
"... | Get release data for this release.
Returns:
dict. | [
"Get",
"release",
"data",
"for",
"this",
"release",
"."
] | 1d3b846d53b5b5404edfe8ddb9083f9ceec8c5e7 | https://github.com/nerdvegas/rez/blob/1d3b846d53b5b5404edfe8ddb9083f9ceec8c5e7/src/rez/build_process_.py#L368-L402 |
232,535 | nerdvegas/rez | src/rez/vendor/pygraph/algorithms/minmax.py | minimal_spanning_tree | def minimal_spanning_tree(graph, root=None):
"""
Minimal spanning tree.
@attention: Minimal spanning tree is meaningful only for weighted graphs.
@type graph: graph
@param graph: Graph.
@type root: node
@param root: Optional root node (will explore only root's connected component)
... | python | def minimal_spanning_tree(graph, root=None):
"""
Minimal spanning tree.
@attention: Minimal spanning tree is meaningful only for weighted graphs.
@type graph: graph
@param graph: Graph.
@type root: node
@param root: Optional root node (will explore only root's connected component)
... | [
"def",
"minimal_spanning_tree",
"(",
"graph",
",",
"root",
"=",
"None",
")",
":",
"visited",
"=",
"[",
"]",
"# List for marking visited and non-visited nodes",
"spanning_tree",
"=",
"{",
"}",
"# MInimal Spanning tree",
"# Initialization",
"if",
"(",
"root",
"is",
"n... | Minimal spanning tree.
@attention: Minimal spanning tree is meaningful only for weighted graphs.
@type graph: graph
@param graph: Graph.
@type root: node
@param root: Optional root node (will explore only root's connected component)
@rtype: dictionary
@return: Generated spanning t... | [
"Minimal",
"spanning",
"tree",
"."
] | 1d3b846d53b5b5404edfe8ddb9083f9ceec8c5e7 | https://github.com/nerdvegas/rez/blob/1d3b846d53b5b5404edfe8ddb9083f9ceec8c5e7/src/rez/vendor/pygraph/algorithms/minmax.py#L46-L86 |
232,536 | nerdvegas/rez | src/rez/vendor/pygraph/algorithms/minmax.py | cut_value | def cut_value(graph, flow, cut):
"""
Calculate the value of a cut.
@type graph: digraph
@param graph: Graph
@type flow: dictionary
@param flow: Dictionary containing a flow for each edge.
@type cut: dictionary
@param cut: Dictionary mapping each node to a subset index. The function on... | python | def cut_value(graph, flow, cut):
"""
Calculate the value of a cut.
@type graph: digraph
@param graph: Graph
@type flow: dictionary
@param flow: Dictionary containing a flow for each edge.
@type cut: dictionary
@param cut: Dictionary mapping each node to a subset index. The function on... | [
"def",
"cut_value",
"(",
"graph",
",",
"flow",
",",
"cut",
")",
":",
"#max flow/min cut value calculation",
"S",
"=",
"[",
"]",
"T",
"=",
"[",
"]",
"for",
"node",
"in",
"cut",
".",
"keys",
"(",
")",
":",
"if",
"cut",
"[",
"node",
"]",
"==",
"0",
... | Calculate the value of a cut.
@type graph: digraph
@param graph: Graph
@type flow: dictionary
@param flow: Dictionary containing a flow for each edge.
@type cut: dictionary
@param cut: Dictionary mapping each node to a subset index. The function only considers the flow between
nodes with ... | [
"Calculate",
"the",
"value",
"of",
"a",
"cut",
"."
] | 1d3b846d53b5b5404edfe8ddb9083f9ceec8c5e7 | https://github.com/nerdvegas/rez/blob/1d3b846d53b5b5404edfe8ddb9083f9ceec8c5e7/src/rez/vendor/pygraph/algorithms/minmax.py#L412-L445 |
232,537 | nerdvegas/rez | src/rez/vendor/pygraph/algorithms/minmax.py | cut_tree | def cut_tree(igraph, caps = None):
"""
Construct a Gomory-Hu cut tree by applying the algorithm of Gusfield.
@type igraph: graph
@param igraph: Graph
@type caps: dictionary
@param caps: Dictionary specifying a maximum capacity for each edge. If not given, the weight of the edge
will be use... | python | def cut_tree(igraph, caps = None):
"""
Construct a Gomory-Hu cut tree by applying the algorithm of Gusfield.
@type igraph: graph
@param igraph: Graph
@type caps: dictionary
@param caps: Dictionary specifying a maximum capacity for each edge. If not given, the weight of the edge
will be use... | [
"def",
"cut_tree",
"(",
"igraph",
",",
"caps",
"=",
"None",
")",
":",
"#maximum flow needs a digraph, we get a graph",
"#I think this conversion relies on implementation details outside the api and may break in the future",
"graph",
"=",
"digraph",
"(",
")",
"graph",
".",
"add_... | Construct a Gomory-Hu cut tree by applying the algorithm of Gusfield.
@type igraph: graph
@param igraph: Graph
@type caps: dictionary
@param caps: Dictionary specifying a maximum capacity for each edge. If not given, the weight of the edge
will be used as its capacity. Otherwise, for each edge (a,... | [
"Construct",
"a",
"Gomory",
"-",
"Hu",
"cut",
"tree",
"by",
"applying",
"the",
"algorithm",
"of",
"Gusfield",
"."
] | 1d3b846d53b5b5404edfe8ddb9083f9ceec8c5e7 | https://github.com/nerdvegas/rez/blob/1d3b846d53b5b5404edfe8ddb9083f9ceec8c5e7/src/rez/vendor/pygraph/algorithms/minmax.py#L447-L515 |
232,538 | nerdvegas/rez | src/rez/vendor/distlib/locators.py | Locator.locate | def locate(self, requirement, prereleases=False):
"""
Find the most recent distribution which matches the given
requirement.
:param requirement: A requirement of the form 'foo (1.0)' or perhaps
'foo (>= 1.0, < 2.0, != 1.3)'
:param prereleases: If ``Tr... | python | def locate(self, requirement, prereleases=False):
"""
Find the most recent distribution which matches the given
requirement.
:param requirement: A requirement of the form 'foo (1.0)' or perhaps
'foo (>= 1.0, < 2.0, != 1.3)'
:param prereleases: If ``Tr... | [
"def",
"locate",
"(",
"self",
",",
"requirement",
",",
"prereleases",
"=",
"False",
")",
":",
"result",
"=",
"None",
"r",
"=",
"parse_requirement",
"(",
"requirement",
")",
"if",
"r",
"is",
"None",
":",
"raise",
"DistlibException",
"(",
"'Not a valid require... | Find the most recent distribution which matches the given
requirement.
:param requirement: A requirement of the form 'foo (1.0)' or perhaps
'foo (>= 1.0, < 2.0, != 1.3)'
:param prereleases: If ``True``, allow pre-release versions
to be loc... | [
"Find",
"the",
"most",
"recent",
"distribution",
"which",
"matches",
"the",
"given",
"requirement",
"."
] | 1d3b846d53b5b5404edfe8ddb9083f9ceec8c5e7 | https://github.com/nerdvegas/rez/blob/1d3b846d53b5b5404edfe8ddb9083f9ceec8c5e7/src/rez/vendor/distlib/locators.py#L313-L370 |
232,539 | nerdvegas/rez | src/rez/package_bind.py | get_bind_modules | def get_bind_modules(verbose=False):
"""Get available bind modules.
Returns:
dict: Map of (name, filepath) listing all bind modules.
"""
builtin_path = os.path.join(module_root_path, "bind")
searchpaths = config.bind_module_path + [builtin_path]
bindnames = {}
for path in searchpat... | python | def get_bind_modules(verbose=False):
"""Get available bind modules.
Returns:
dict: Map of (name, filepath) listing all bind modules.
"""
builtin_path = os.path.join(module_root_path, "bind")
searchpaths = config.bind_module_path + [builtin_path]
bindnames = {}
for path in searchpat... | [
"def",
"get_bind_modules",
"(",
"verbose",
"=",
"False",
")",
":",
"builtin_path",
"=",
"os",
".",
"path",
".",
"join",
"(",
"module_root_path",
",",
"\"bind\"",
")",
"searchpaths",
"=",
"config",
".",
"bind_module_path",
"+",
"[",
"builtin_path",
"]",
"bind... | Get available bind modules.
Returns:
dict: Map of (name, filepath) listing all bind modules. | [
"Get",
"available",
"bind",
"modules",
"."
] | 1d3b846d53b5b5404edfe8ddb9083f9ceec8c5e7 | https://github.com/nerdvegas/rez/blob/1d3b846d53b5b5404edfe8ddb9083f9ceec8c5e7/src/rez/package_bind.py#L13-L36 |
232,540 | nerdvegas/rez | src/rez/package_bind.py | find_bind_module | def find_bind_module(name, verbose=False):
"""Find the bind module matching the given name.
Args:
name (str): Name of package to find bind module for.
verbose (bool): If True, print extra output.
Returns:
str: Filepath to bind module .py file, or None if not found.
"""
bind... | python | def find_bind_module(name, verbose=False):
"""Find the bind module matching the given name.
Args:
name (str): Name of package to find bind module for.
verbose (bool): If True, print extra output.
Returns:
str: Filepath to bind module .py file, or None if not found.
"""
bind... | [
"def",
"find_bind_module",
"(",
"name",
",",
"verbose",
"=",
"False",
")",
":",
"bindnames",
"=",
"get_bind_modules",
"(",
"verbose",
"=",
"verbose",
")",
"bindfile",
"=",
"bindnames",
".",
"get",
"(",
"name",
")",
"if",
"bindfile",
":",
"return",
"bindfil... | Find the bind module matching the given name.
Args:
name (str): Name of package to find bind module for.
verbose (bool): If True, print extra output.
Returns:
str: Filepath to bind module .py file, or None if not found. | [
"Find",
"the",
"bind",
"module",
"matching",
"the",
"given",
"name",
"."
] | 1d3b846d53b5b5404edfe8ddb9083f9ceec8c5e7 | https://github.com/nerdvegas/rez/blob/1d3b846d53b5b5404edfe8ddb9083f9ceec8c5e7/src/rez/package_bind.py#L39-L68 |
232,541 | nerdvegas/rez | src/rez/package_bind.py | bind_package | def bind_package(name, path=None, version_range=None, no_deps=False,
bind_args=None, quiet=False):
"""Bind software available on the current system, as a rez package.
Note:
`bind_args` is provided when software is bound via the 'rez-bind'
command line tool. Bind modules can def... | python | def bind_package(name, path=None, version_range=None, no_deps=False,
bind_args=None, quiet=False):
"""Bind software available on the current system, as a rez package.
Note:
`bind_args` is provided when software is bound via the 'rez-bind'
command line tool. Bind modules can def... | [
"def",
"bind_package",
"(",
"name",
",",
"path",
"=",
"None",
",",
"version_range",
"=",
"None",
",",
"no_deps",
"=",
"False",
",",
"bind_args",
"=",
"None",
",",
"quiet",
"=",
"False",
")",
":",
"pending",
"=",
"set",
"(",
"[",
"name",
"]",
")",
"... | Bind software available on the current system, as a rez package.
Note:
`bind_args` is provided when software is bound via the 'rez-bind'
command line tool. Bind modules can define their own command line
options, and they will be present in `bind_args` if applicable.
Args:
name ... | [
"Bind",
"software",
"available",
"on",
"the",
"current",
"system",
"as",
"a",
"rez",
"package",
"."
] | 1d3b846d53b5b5404edfe8ddb9083f9ceec8c5e7 | https://github.com/nerdvegas/rez/blob/1d3b846d53b5b5404edfe8ddb9083f9ceec8c5e7/src/rez/package_bind.py#L71-L141 |
232,542 | nerdvegas/rez | src/rez/release_hook.py | create_release_hook | def create_release_hook(name, source_path):
"""Return a new release hook of the given type."""
from rez.plugin_managers import plugin_manager
return plugin_manager.create_instance('release_hook',
name,
source_path=source_pat... | python | def create_release_hook(name, source_path):
"""Return a new release hook of the given type."""
from rez.plugin_managers import plugin_manager
return plugin_manager.create_instance('release_hook',
name,
source_path=source_pat... | [
"def",
"create_release_hook",
"(",
"name",
",",
"source_path",
")",
":",
"from",
"rez",
".",
"plugin_managers",
"import",
"plugin_manager",
"return",
"plugin_manager",
".",
"create_instance",
"(",
"'release_hook'",
",",
"name",
",",
"source_path",
"=",
"source_path"... | Return a new release hook of the given type. | [
"Return",
"a",
"new",
"release",
"hook",
"of",
"the",
"given",
"type",
"."
] | 1d3b846d53b5b5404edfe8ddb9083f9ceec8c5e7 | https://github.com/nerdvegas/rez/blob/1d3b846d53b5b5404edfe8ddb9083f9ceec8c5e7/src/rez/release_hook.py#L12-L17 |
232,543 | nerdvegas/rez | src/rez/release_hook.py | ReleaseHook.pre_build | def pre_build(self, user, install_path, variants=None, release_message=None,
changelog=None, previous_version=None,
previous_revision=None, **kwargs):
"""Pre-build hook.
Args:
user: Name of person who did the release.
install_path: Directory t... | python | def pre_build(self, user, install_path, variants=None, release_message=None,
changelog=None, previous_version=None,
previous_revision=None, **kwargs):
"""Pre-build hook.
Args:
user: Name of person who did the release.
install_path: Directory t... | [
"def",
"pre_build",
"(",
"self",
",",
"user",
",",
"install_path",
",",
"variants",
"=",
"None",
",",
"release_message",
"=",
"None",
",",
"changelog",
"=",
"None",
",",
"previous_version",
"=",
"None",
",",
"previous_revision",
"=",
"None",
",",
"*",
"*",... | Pre-build hook.
Args:
user: Name of person who did the release.
install_path: Directory the package was installed into.
variants: List of variant indices we are attempting to build, or
None
release_message: User-supplied release message.
... | [
"Pre",
"-",
"build",
"hook",
"."
] | 1d3b846d53b5b5404edfe8ddb9083f9ceec8c5e7 | https://github.com/nerdvegas/rez/blob/1d3b846d53b5b5404edfe8ddb9083f9ceec8c5e7/src/rez/release_hook.py#L56-L78 |
232,544 | nerdvegas/rez | src/rez/vendor/pygraph/algorithms/traversal.py | traversal | def traversal(graph, node, order):
"""
Graph traversal iterator.
@type graph: graph, digraph
@param graph: Graph.
@type node: node
@param node: Node.
@type order: string
@param order: traversal ordering. Possible values are:
2. 'pre' - Preordering (default)
... | python | def traversal(graph, node, order):
"""
Graph traversal iterator.
@type graph: graph, digraph
@param graph: Graph.
@type node: node
@param node: Node.
@type order: string
@param order: traversal ordering. Possible values are:
2. 'pre' - Preordering (default)
... | [
"def",
"traversal",
"(",
"graph",
",",
"node",
",",
"order",
")",
":",
"visited",
"=",
"{",
"}",
"if",
"(",
"order",
"==",
"'pre'",
")",
":",
"pre",
"=",
"1",
"post",
"=",
"0",
"elif",
"(",
"order",
"==",
"'post'",
")",
":",
"pre",
"=",
"0",
... | Graph traversal iterator.
@type graph: graph, digraph
@param graph: Graph.
@type node: node
@param node: Node.
@type order: string
@param order: traversal ordering. Possible values are:
2. 'pre' - Preordering (default)
1. 'post' - Postordering
@rtype: iter... | [
"Graph",
"traversal",
"iterator",
"."
] | 1d3b846d53b5b5404edfe8ddb9083f9ceec8c5e7 | https://github.com/nerdvegas/rez/blob/1d3b846d53b5b5404edfe8ddb9083f9ceec8c5e7/src/rez/vendor/pygraph/algorithms/traversal.py#L34-L61 |
232,545 | nerdvegas/rez | src/rez/backport/zipfile.py | is_zipfile | def is_zipfile(filename):
"""Quickly see if file is a ZIP file by checking the magic number."""
try:
fpin = open(filename, "rb")
endrec = _EndRecData(fpin)
fpin.close()
if endrec:
return True # file has correct magic number
except IOError:
... | python | def is_zipfile(filename):
"""Quickly see if file is a ZIP file by checking the magic number."""
try:
fpin = open(filename, "rb")
endrec = _EndRecData(fpin)
fpin.close()
if endrec:
return True # file has correct magic number
except IOError:
... | [
"def",
"is_zipfile",
"(",
"filename",
")",
":",
"try",
":",
"fpin",
"=",
"open",
"(",
"filename",
",",
"\"rb\"",
")",
"endrec",
"=",
"_EndRecData",
"(",
"fpin",
")",
"fpin",
".",
"close",
"(",
")",
"if",
"endrec",
":",
"return",
"True",
"# file has cor... | Quickly see if file is a ZIP file by checking the magic number. | [
"Quickly",
"see",
"if",
"file",
"is",
"a",
"ZIP",
"file",
"by",
"checking",
"the",
"magic",
"number",
"."
] | 1d3b846d53b5b5404edfe8ddb9083f9ceec8c5e7 | https://github.com/nerdvegas/rez/blob/1d3b846d53b5b5404edfe8ddb9083f9ceec8c5e7/src/rez/backport/zipfile.py#L133-L143 |
232,546 | nerdvegas/rez | src/rez/backport/zipfile.py | _EndRecData | def _EndRecData(fpin):
"""Return data from the "End of Central Directory" record, or None.
The data is a list of the nine items in the ZIP "End of central dir"
record followed by a tenth item, the file seek offset of this record."""
# Determine file size
fpin.seek(0, 2)
filesize = fpin.tell()
... | python | def _EndRecData(fpin):
"""Return data from the "End of Central Directory" record, or None.
The data is a list of the nine items in the ZIP "End of central dir"
record followed by a tenth item, the file seek offset of this record."""
# Determine file size
fpin.seek(0, 2)
filesize = fpin.tell()
... | [
"def",
"_EndRecData",
"(",
"fpin",
")",
":",
"# Determine file size",
"fpin",
".",
"seek",
"(",
"0",
",",
"2",
")",
"filesize",
"=",
"fpin",
".",
"tell",
"(",
")",
"# Check to see if this is ZIP file with no archive comment (the",
"# \"end of central directory\" structu... | Return data from the "End of Central Directory" record, or None.
The data is a list of the nine items in the ZIP "End of central dir"
record followed by a tenth item, the file seek offset of this record. | [
"Return",
"data",
"from",
"the",
"End",
"of",
"Central",
"Directory",
"record",
"or",
"None",
"."
] | 1d3b846d53b5b5404edfe8ddb9083f9ceec8c5e7 | https://github.com/nerdvegas/rez/blob/1d3b846d53b5b5404edfe8ddb9083f9ceec8c5e7/src/rez/backport/zipfile.py#L178-L233 |
232,547 | nerdvegas/rez | src/rez/backport/zipfile.py | _ZipDecrypter._GenerateCRCTable | def _GenerateCRCTable():
"""Generate a CRC-32 table.
ZIP encryption uses the CRC32 one-byte primitive for scrambling some
internal keys. We noticed that a direct implementation is faster than
relying on binascii.crc32().
"""
poly = 0xedb88320
table = [0] * 256
... | python | def _GenerateCRCTable():
"""Generate a CRC-32 table.
ZIP encryption uses the CRC32 one-byte primitive for scrambling some
internal keys. We noticed that a direct implementation is faster than
relying on binascii.crc32().
"""
poly = 0xedb88320
table = [0] * 256
... | [
"def",
"_GenerateCRCTable",
"(",
")",
":",
"poly",
"=",
"0xedb88320",
"table",
"=",
"[",
"0",
"]",
"*",
"256",
"for",
"i",
"in",
"range",
"(",
"256",
")",
":",
"crc",
"=",
"i",
"for",
"j",
"in",
"range",
"(",
"8",
")",
":",
"if",
"crc",
"&",
... | Generate a CRC-32 table.
ZIP encryption uses the CRC32 one-byte primitive for scrambling some
internal keys. We noticed that a direct implementation is faster than
relying on binascii.crc32(). | [
"Generate",
"a",
"CRC",
"-",
"32",
"table",
"."
] | 1d3b846d53b5b5404edfe8ddb9083f9ceec8c5e7 | https://github.com/nerdvegas/rez/blob/1d3b846d53b5b5404edfe8ddb9083f9ceec8c5e7/src/rez/backport/zipfile.py#L398-L415 |
232,548 | nerdvegas/rez | src/rez/backport/zipfile.py | _ZipDecrypter._crc32 | def _crc32(self, ch, crc):
"""Compute the CRC32 primitive on one byte."""
return ((crc >> 8) & 0xffffff) ^ self.crctable[(crc ^ ord(ch)) & 0xff] | python | def _crc32(self, ch, crc):
"""Compute the CRC32 primitive on one byte."""
return ((crc >> 8) & 0xffffff) ^ self.crctable[(crc ^ ord(ch)) & 0xff] | [
"def",
"_crc32",
"(",
"self",
",",
"ch",
",",
"crc",
")",
":",
"return",
"(",
"(",
"crc",
">>",
"8",
")",
"&",
"0xffffff",
")",
"^",
"self",
".",
"crctable",
"[",
"(",
"crc",
"^",
"ord",
"(",
"ch",
")",
")",
"&",
"0xff",
"]"
] | Compute the CRC32 primitive on one byte. | [
"Compute",
"the",
"CRC32",
"primitive",
"on",
"one",
"byte",
"."
] | 1d3b846d53b5b5404edfe8ddb9083f9ceec8c5e7 | https://github.com/nerdvegas/rez/blob/1d3b846d53b5b5404edfe8ddb9083f9ceec8c5e7/src/rez/backport/zipfile.py#L418-L420 |
232,549 | nerdvegas/rez | src/rez/backport/zipfile.py | ZipExtFile.readline | def readline(self, size = -1):
"""Read a line with approx. size. If size is negative,
read a whole line.
"""
if size < 0:
size = sys.maxint
elif size == 0:
return ''
# check for a newline already in buffer
nl, nllen = self._checkfornewl... | python | def readline(self, size = -1):
"""Read a line with approx. size. If size is negative,
read a whole line.
"""
if size < 0:
size = sys.maxint
elif size == 0:
return ''
# check for a newline already in buffer
nl, nllen = self._checkfornewl... | [
"def",
"readline",
"(",
"self",
",",
"size",
"=",
"-",
"1",
")",
":",
"if",
"size",
"<",
"0",
":",
"size",
"=",
"sys",
".",
"maxint",
"elif",
"size",
"==",
"0",
":",
"return",
"''",
"# check for a newline already in buffer",
"nl",
",",
"nllen",
"=",
... | Read a line with approx. size. If size is negative,
read a whole line. | [
"Read",
"a",
"line",
"with",
"approx",
".",
"size",
".",
"If",
"size",
"is",
"negative",
"read",
"a",
"whole",
"line",
"."
] | 1d3b846d53b5b5404edfe8ddb9083f9ceec8c5e7 | https://github.com/nerdvegas/rez/blob/1d3b846d53b5b5404edfe8ddb9083f9ceec8c5e7/src/rez/backport/zipfile.py#L511-L553 |
232,550 | nerdvegas/rez | src/rez/backport/zipfile.py | ZipFile._GetContents | def _GetContents(self):
"""Read the directory, making sure we close the file if the format
is bad."""
try:
self._RealGetContents()
except BadZipfile:
if not self._filePassed:
self.fp.close()
self.fp = None
raise | python | def _GetContents(self):
"""Read the directory, making sure we close the file if the format
is bad."""
try:
self._RealGetContents()
except BadZipfile:
if not self._filePassed:
self.fp.close()
self.fp = None
raise | [
"def",
"_GetContents",
"(",
"self",
")",
":",
"try",
":",
"self",
".",
"_RealGetContents",
"(",
")",
"except",
"BadZipfile",
":",
"if",
"not",
"self",
".",
"_filePassed",
":",
"self",
".",
"fp",
".",
"close",
"(",
")",
"self",
".",
"fp",
"=",
"None",... | Read the directory, making sure we close the file if the format
is bad. | [
"Read",
"the",
"directory",
"making",
"sure",
"we",
"close",
"the",
"file",
"if",
"the",
"format",
"is",
"bad",
"."
] | 1d3b846d53b5b5404edfe8ddb9083f9ceec8c5e7 | https://github.com/nerdvegas/rez/blob/1d3b846d53b5b5404edfe8ddb9083f9ceec8c5e7/src/rez/backport/zipfile.py#L714-L723 |
232,551 | nerdvegas/rez | src/rez/backport/zipfile.py | ZipFile.namelist | def namelist(self):
"""Return a list of file names in the archive."""
l = []
for data in self.filelist:
l.append(data.filename)
return l | python | def namelist(self):
"""Return a list of file names in the archive."""
l = []
for data in self.filelist:
l.append(data.filename)
return l | [
"def",
"namelist",
"(",
"self",
")",
":",
"l",
"=",
"[",
"]",
"for",
"data",
"in",
"self",
".",
"filelist",
":",
"l",
".",
"append",
"(",
"data",
".",
"filename",
")",
"return",
"l"
] | Return a list of file names in the archive. | [
"Return",
"a",
"list",
"of",
"file",
"names",
"in",
"the",
"archive",
"."
] | 1d3b846d53b5b5404edfe8ddb9083f9ceec8c5e7 | https://github.com/nerdvegas/rez/blob/1d3b846d53b5b5404edfe8ddb9083f9ceec8c5e7/src/rez/backport/zipfile.py#L789-L794 |
232,552 | nerdvegas/rez | src/rez/backport/zipfile.py | ZipFile.printdir | def printdir(self):
"""Print a table of contents for the zip file."""
print "%-46s %19s %12s" % ("File Name", "Modified ", "Size")
for zinfo in self.filelist:
date = "%d-%02d-%02d %02d:%02d:%02d" % zinfo.date_time[:6]
print "%-46s %s %12d" % (zinfo.filename, date, zinf... | python | def printdir(self):
"""Print a table of contents for the zip file."""
print "%-46s %19s %12s" % ("File Name", "Modified ", "Size")
for zinfo in self.filelist:
date = "%d-%02d-%02d %02d:%02d:%02d" % zinfo.date_time[:6]
print "%-46s %s %12d" % (zinfo.filename, date, zinf... | [
"def",
"printdir",
"(",
"self",
")",
":",
"print",
"\"%-46s %19s %12s\"",
"%",
"(",
"\"File Name\"",
",",
"\"Modified \"",
",",
"\"Size\"",
")",
"for",
"zinfo",
"in",
"self",
".",
"filelist",
":",
"date",
"=",
"\"%d-%02d-%02d %02d:%02d:%02d\"",
"%",
"zinfo",
... | Print a table of contents for the zip file. | [
"Print",
"a",
"table",
"of",
"contents",
"for",
"the",
"zip",
"file",
"."
] | 1d3b846d53b5b5404edfe8ddb9083f9ceec8c5e7 | https://github.com/nerdvegas/rez/blob/1d3b846d53b5b5404edfe8ddb9083f9ceec8c5e7/src/rez/backport/zipfile.py#L801-L806 |
232,553 | nerdvegas/rez | src/rez/backport/zipfile.py | ZipFile.getinfo | def getinfo(self, name):
"""Return the instance of ZipInfo given 'name'."""
info = self.NameToInfo.get(name)
if info is None:
raise KeyError(
'There is no item named %r in the archive' % name)
return info | python | def getinfo(self, name):
"""Return the instance of ZipInfo given 'name'."""
info = self.NameToInfo.get(name)
if info is None:
raise KeyError(
'There is no item named %r in the archive' % name)
return info | [
"def",
"getinfo",
"(",
"self",
",",
"name",
")",
":",
"info",
"=",
"self",
".",
"NameToInfo",
".",
"get",
"(",
"name",
")",
"if",
"info",
"is",
"None",
":",
"raise",
"KeyError",
"(",
"'There is no item named %r in the archive'",
"%",
"name",
")",
"return",... | Return the instance of ZipInfo given 'name'. | [
"Return",
"the",
"instance",
"of",
"ZipInfo",
"given",
"name",
"."
] | 1d3b846d53b5b5404edfe8ddb9083f9ceec8c5e7 | https://github.com/nerdvegas/rez/blob/1d3b846d53b5b5404edfe8ddb9083f9ceec8c5e7/src/rez/backport/zipfile.py#L821-L828 |
232,554 | nerdvegas/rez | src/rez/backport/zipfile.py | ZipFile.extract | def extract(self, member, path=None, pwd=None):
"""Extract a member from the archive to the current working directory,
using its full name. Its file information is extracted as accurately
as possible. `member' may be a filename or a ZipInfo object. You can
specify a different di... | python | def extract(self, member, path=None, pwd=None):
"""Extract a member from the archive to the current working directory,
using its full name. Its file information is extracted as accurately
as possible. `member' may be a filename or a ZipInfo object. You can
specify a different di... | [
"def",
"extract",
"(",
"self",
",",
"member",
",",
"path",
"=",
"None",
",",
"pwd",
"=",
"None",
")",
":",
"if",
"not",
"isinstance",
"(",
"member",
",",
"ZipInfo",
")",
":",
"member",
"=",
"self",
".",
"getinfo",
"(",
"member",
")",
"if",
"path",
... | Extract a member from the archive to the current working directory,
using its full name. Its file information is extracted as accurately
as possible. `member' may be a filename or a ZipInfo object. You can
specify a different directory using `path'. | [
"Extract",
"a",
"member",
"from",
"the",
"archive",
"to",
"the",
"current",
"working",
"directory",
"using",
"its",
"full",
"name",
".",
"Its",
"file",
"information",
"is",
"extracted",
"as",
"accurately",
"as",
"possible",
".",
"member",
"may",
"be",
"a",
... | 1d3b846d53b5b5404edfe8ddb9083f9ceec8c5e7 | https://github.com/nerdvegas/rez/blob/1d3b846d53b5b5404edfe8ddb9083f9ceec8c5e7/src/rez/backport/zipfile.py#L916-L928 |
232,555 | nerdvegas/rez | src/rez/backport/zipfile.py | PyZipFile.writepy | def writepy(self, pathname, basename = ""):
"""Add all files from "pathname" to the ZIP archive.
If pathname is a package directory, search the directory and
all package subdirectories recursively for all *.py and enter
the modules into the archive. If pathname is a plain
direc... | python | def writepy(self, pathname, basename = ""):
"""Add all files from "pathname" to the ZIP archive.
If pathname is a package directory, search the directory and
all package subdirectories recursively for all *.py and enter
the modules into the archive. If pathname is a plain
direc... | [
"def",
"writepy",
"(",
"self",
",",
"pathname",
",",
"basename",
"=",
"\"\"",
")",
":",
"dir",
",",
"name",
"=",
"os",
".",
"path",
".",
"split",
"(",
"pathname",
")",
"if",
"os",
".",
"path",
".",
"isdir",
"(",
"pathname",
")",
":",
"initname",
... | Add all files from "pathname" to the ZIP archive.
If pathname is a package directory, search the directory and
all package subdirectories recursively for all *.py and enter
the modules into the archive. If pathname is a plain
directory, listdir *.py and enter all modules. Else, pathna... | [
"Add",
"all",
"files",
"from",
"pathname",
"to",
"the",
"ZIP",
"archive",
"."
] | 1d3b846d53b5b5404edfe8ddb9083f9ceec8c5e7 | https://github.com/nerdvegas/rez/blob/1d3b846d53b5b5404edfe8ddb9083f9ceec8c5e7/src/rez/backport/zipfile.py#L1241-L1304 |
232,556 | nerdvegas/rez | src/rez/vendor/atomicwrites/__init__.py | AtomicWriter.get_fileobject | def get_fileobject(self, dir=None, **kwargs):
'''Return the temporary file to use.'''
if dir is None:
dir = os.path.normpath(os.path.dirname(self._path))
descriptor, name = tempfile.mkstemp(dir=dir)
# io.open() will take either the descriptor or the name, but we need
... | python | def get_fileobject(self, dir=None, **kwargs):
'''Return the temporary file to use.'''
if dir is None:
dir = os.path.normpath(os.path.dirname(self._path))
descriptor, name = tempfile.mkstemp(dir=dir)
# io.open() will take either the descriptor or the name, but we need
... | [
"def",
"get_fileobject",
"(",
"self",
",",
"dir",
"=",
"None",
",",
"*",
"*",
"kwargs",
")",
":",
"if",
"dir",
"is",
"None",
":",
"dir",
"=",
"os",
".",
"path",
".",
"normpath",
"(",
"os",
".",
"path",
".",
"dirname",
"(",
"self",
".",
"_path",
... | Return the temporary file to use. | [
"Return",
"the",
"temporary",
"file",
"to",
"use",
"."
] | 1d3b846d53b5b5404edfe8ddb9083f9ceec8c5e7 | https://github.com/nerdvegas/rez/blob/1d3b846d53b5b5404edfe8ddb9083f9ceec8c5e7/src/rez/vendor/atomicwrites/__init__.py#L163-L174 |
232,557 | nerdvegas/rez | src/rez/vendor/atomicwrites/__init__.py | AtomicWriter.commit | def commit(self, f):
'''Move the temporary file to the target location.'''
if self._overwrite:
replace_atomic(f.name, self._path)
else:
move_atomic(f.name, self._path) | python | def commit(self, f):
'''Move the temporary file to the target location.'''
if self._overwrite:
replace_atomic(f.name, self._path)
else:
move_atomic(f.name, self._path) | [
"def",
"commit",
"(",
"self",
",",
"f",
")",
":",
"if",
"self",
".",
"_overwrite",
":",
"replace_atomic",
"(",
"f",
".",
"name",
",",
"self",
".",
"_path",
")",
"else",
":",
"move_atomic",
"(",
"f",
".",
"name",
",",
"self",
".",
"_path",
")"
] | Move the temporary file to the target location. | [
"Move",
"the",
"temporary",
"file",
"to",
"the",
"target",
"location",
"."
] | 1d3b846d53b5b5404edfe8ddb9083f9ceec8c5e7 | https://github.com/nerdvegas/rez/blob/1d3b846d53b5b5404edfe8ddb9083f9ceec8c5e7/src/rez/vendor/atomicwrites/__init__.py#L182-L187 |
232,558 | nerdvegas/rez | src/rez/vendor/lockfile/pidlockfile.py | read_pid_from_pidfile | def read_pid_from_pidfile(pidfile_path):
""" Read the PID recorded in the named PID file.
Read and return the numeric PID recorded as text in the named
PID file. If the PID file cannot be read, or if the content is
not a valid PID, return ``None``.
"""
pid = None
try:
... | python | def read_pid_from_pidfile(pidfile_path):
""" Read the PID recorded in the named PID file.
Read and return the numeric PID recorded as text in the named
PID file. If the PID file cannot be read, or if the content is
not a valid PID, return ``None``.
"""
pid = None
try:
... | [
"def",
"read_pid_from_pidfile",
"(",
"pidfile_path",
")",
":",
"pid",
"=",
"None",
"try",
":",
"pidfile",
"=",
"open",
"(",
"pidfile_path",
",",
"'r'",
")",
"except",
"IOError",
":",
"pass",
"else",
":",
"# According to the FHS 2.3 section on PID files in /var/run:"... | Read the PID recorded in the named PID file.
Read and return the numeric PID recorded as text in the named
PID file. If the PID file cannot be read, or if the content is
not a valid PID, return ``None``. | [
"Read",
"the",
"PID",
"recorded",
"in",
"the",
"named",
"PID",
"file",
"."
] | 1d3b846d53b5b5404edfe8ddb9083f9ceec8c5e7 | https://github.com/nerdvegas/rez/blob/1d3b846d53b5b5404edfe8ddb9083f9ceec8c5e7/src/rez/vendor/lockfile/pidlockfile.py#L120-L151 |
232,559 | nerdvegas/rez | src/rezgui/widgets/ConfiguredSplitter.py | ConfiguredSplitter.apply_saved_layout | def apply_saved_layout(self):
"""Call this after adding your child widgets."""
num_widgets = self.config.get(self.config_key + "/num_widgets", int)
if num_widgets:
sizes = []
for i in range(num_widgets):
key = "%s/size_%d" % (self.config_key, i)
... | python | def apply_saved_layout(self):
"""Call this after adding your child widgets."""
num_widgets = self.config.get(self.config_key + "/num_widgets", int)
if num_widgets:
sizes = []
for i in range(num_widgets):
key = "%s/size_%d" % (self.config_key, i)
... | [
"def",
"apply_saved_layout",
"(",
"self",
")",
":",
"num_widgets",
"=",
"self",
".",
"config",
".",
"get",
"(",
"self",
".",
"config_key",
"+",
"\"/num_widgets\"",
",",
"int",
")",
"if",
"num_widgets",
":",
"sizes",
"=",
"[",
"]",
"for",
"i",
"in",
"ra... | Call this after adding your child widgets. | [
"Call",
"this",
"after",
"adding",
"your",
"child",
"widgets",
"."
] | 1d3b846d53b5b5404edfe8ddb9083f9ceec8c5e7 | https://github.com/nerdvegas/rez/blob/1d3b846d53b5b5404edfe8ddb9083f9ceec8c5e7/src/rezgui/widgets/ConfiguredSplitter.py#L14-L25 |
232,560 | nerdvegas/rez | src/rez/utils/data_utils.py | remove_nones | def remove_nones(**kwargs):
"""Return diict copy with nones removed.
"""
return dict((k, v) for k, v in kwargs.iteritems() if v is not None) | python | def remove_nones(**kwargs):
"""Return diict copy with nones removed.
"""
return dict((k, v) for k, v in kwargs.iteritems() if v is not None) | [
"def",
"remove_nones",
"(",
"*",
"*",
"kwargs",
")",
":",
"return",
"dict",
"(",
"(",
"k",
",",
"v",
")",
"for",
"k",
",",
"v",
"in",
"kwargs",
".",
"iteritems",
"(",
")",
"if",
"v",
"is",
"not",
"None",
")"
] | Return diict copy with nones removed. | [
"Return",
"diict",
"copy",
"with",
"nones",
"removed",
"."
] | 1d3b846d53b5b5404edfe8ddb9083f9ceec8c5e7 | https://github.com/nerdvegas/rez/blob/1d3b846d53b5b5404edfe8ddb9083f9ceec8c5e7/src/rez/utils/data_utils.py#L33-L36 |
232,561 | nerdvegas/rez | src/rez/utils/data_utils.py | deep_update | def deep_update(dict1, dict2):
"""Perform a deep merge of `dict2` into `dict1`.
Note that `dict2` and any nested dicts are unchanged.
Supports `ModifyList` instances.
"""
def flatten(v):
if isinstance(v, ModifyList):
return v.apply([])
elif isinstance(v, dict):
... | python | def deep_update(dict1, dict2):
"""Perform a deep merge of `dict2` into `dict1`.
Note that `dict2` and any nested dicts are unchanged.
Supports `ModifyList` instances.
"""
def flatten(v):
if isinstance(v, ModifyList):
return v.apply([])
elif isinstance(v, dict):
... | [
"def",
"deep_update",
"(",
"dict1",
",",
"dict2",
")",
":",
"def",
"flatten",
"(",
"v",
")",
":",
"if",
"isinstance",
"(",
"v",
",",
"ModifyList",
")",
":",
"return",
"v",
".",
"apply",
"(",
"[",
"]",
")",
"elif",
"isinstance",
"(",
"v",
",",
"di... | Perform a deep merge of `dict2` into `dict1`.
Note that `dict2` and any nested dicts are unchanged.
Supports `ModifyList` instances. | [
"Perform",
"a",
"deep",
"merge",
"of",
"dict2",
"into",
"dict1",
"."
] | 1d3b846d53b5b5404edfe8ddb9083f9ceec8c5e7 | https://github.com/nerdvegas/rez/blob/1d3b846d53b5b5404edfe8ddb9083f9ceec8c5e7/src/rez/utils/data_utils.py#L39-L74 |
232,562 | nerdvegas/rez | src/rez/utils/data_utils.py | deep_del | def deep_del(data, fn):
"""Create dict copy with removed items.
Recursively remove items where fn(value) is True.
Returns:
dict: New dict with matching items removed.
"""
result = {}
for k, v in data.iteritems():
if not fn(v):
if isinstance(v, dict):
... | python | def deep_del(data, fn):
"""Create dict copy with removed items.
Recursively remove items where fn(value) is True.
Returns:
dict: New dict with matching items removed.
"""
result = {}
for k, v in data.iteritems():
if not fn(v):
if isinstance(v, dict):
... | [
"def",
"deep_del",
"(",
"data",
",",
"fn",
")",
":",
"result",
"=",
"{",
"}",
"for",
"k",
",",
"v",
"in",
"data",
".",
"iteritems",
"(",
")",
":",
"if",
"not",
"fn",
"(",
"v",
")",
":",
"if",
"isinstance",
"(",
"v",
",",
"dict",
")",
":",
"... | Create dict copy with removed items.
Recursively remove items where fn(value) is True.
Returns:
dict: New dict with matching items removed. | [
"Create",
"dict",
"copy",
"with",
"removed",
"items",
"."
] | 1d3b846d53b5b5404edfe8ddb9083f9ceec8c5e7 | https://github.com/nerdvegas/rez/blob/1d3b846d53b5b5404edfe8ddb9083f9ceec8c5e7/src/rez/utils/data_utils.py#L77-L94 |
232,563 | nerdvegas/rez | src/rez/utils/data_utils.py | get_dict_diff_str | def get_dict_diff_str(d1, d2, title):
"""Returns same as `get_dict_diff`, but as a readable string.
"""
added, removed, changed = get_dict_diff(d1, d2)
lines = [title]
if added:
lines.append("Added attributes: %s"
% ['.'.join(x) for x in added])
if removed:
... | python | def get_dict_diff_str(d1, d2, title):
"""Returns same as `get_dict_diff`, but as a readable string.
"""
added, removed, changed = get_dict_diff(d1, d2)
lines = [title]
if added:
lines.append("Added attributes: %s"
% ['.'.join(x) for x in added])
if removed:
... | [
"def",
"get_dict_diff_str",
"(",
"d1",
",",
"d2",
",",
"title",
")",
":",
"added",
",",
"removed",
",",
"changed",
"=",
"get_dict_diff",
"(",
"d1",
",",
"d2",
")",
"lines",
"=",
"[",
"title",
"]",
"if",
"added",
":",
"lines",
".",
"append",
"(",
"\... | Returns same as `get_dict_diff`, but as a readable string. | [
"Returns",
"same",
"as",
"get_dict_diff",
"but",
"as",
"a",
"readable",
"string",
"."
] | 1d3b846d53b5b5404edfe8ddb9083f9ceec8c5e7 | https://github.com/nerdvegas/rez/blob/1d3b846d53b5b5404edfe8ddb9083f9ceec8c5e7/src/rez/utils/data_utils.py#L138-L154 |
232,564 | nerdvegas/rez | src/rez/utils/data_utils.py | convert_dicts | def convert_dicts(d, to_class=AttrDictWrapper, from_class=dict):
"""Recursively convert dict and UserDict types.
Note that `d` is unchanged.
Args:
to_class (type): Dict-like type to convert values to, usually UserDict
subclass, or dict.
from_class (type): Dict-like type to conv... | python | def convert_dicts(d, to_class=AttrDictWrapper, from_class=dict):
"""Recursively convert dict and UserDict types.
Note that `d` is unchanged.
Args:
to_class (type): Dict-like type to convert values to, usually UserDict
subclass, or dict.
from_class (type): Dict-like type to conv... | [
"def",
"convert_dicts",
"(",
"d",
",",
"to_class",
"=",
"AttrDictWrapper",
",",
"from_class",
"=",
"dict",
")",
":",
"d_",
"=",
"to_class",
"(",
")",
"for",
"key",
",",
"value",
"in",
"d",
".",
"iteritems",
"(",
")",
":",
"if",
"isinstance",
"(",
"va... | Recursively convert dict and UserDict types.
Note that `d` is unchanged.
Args:
to_class (type): Dict-like type to convert values to, usually UserDict
subclass, or dict.
from_class (type): Dict-like type to convert values from. If a tuple,
multiple types are converted.
... | [
"Recursively",
"convert",
"dict",
"and",
"UserDict",
"types",
"."
] | 1d3b846d53b5b5404edfe8ddb9083f9ceec8c5e7 | https://github.com/nerdvegas/rez/blob/1d3b846d53b5b5404edfe8ddb9083f9ceec8c5e7/src/rez/utils/data_utils.py#L319-L340 |
232,565 | nerdvegas/rez | src/rez/package_repository.py | PackageRepositoryGlobalStats.package_loading | def package_loading(self):
"""Use this around code in your package repository that is loading a
package, for example from file or cache.
"""
t1 = time.time()
yield None
t2 = time.time()
self.package_load_time += t2 - t1 | python | def package_loading(self):
"""Use this around code in your package repository that is loading a
package, for example from file or cache.
"""
t1 = time.time()
yield None
t2 = time.time()
self.package_load_time += t2 - t1 | [
"def",
"package_loading",
"(",
"self",
")",
":",
"t1",
"=",
"time",
".",
"time",
"(",
")",
"yield",
"None",
"t2",
"=",
"time",
".",
"time",
"(",
")",
"self",
".",
"package_load_time",
"+=",
"t2",
"-",
"t1"
] | Use this around code in your package repository that is loading a
package, for example from file or cache. | [
"Use",
"this",
"around",
"code",
"in",
"your",
"package",
"repository",
"that",
"is",
"loading",
"a",
"package",
"for",
"example",
"from",
"file",
"or",
"cache",
"."
] | 1d3b846d53b5b5404edfe8ddb9083f9ceec8c5e7 | https://github.com/nerdvegas/rez/blob/1d3b846d53b5b5404edfe8ddb9083f9ceec8c5e7/src/rez/package_repository.py#L42-L50 |
232,566 | nerdvegas/rez | src/rez/package_repository.py | PackageRepository.is_empty | def is_empty(self):
"""Determine if the repository contains any packages.
Returns:
True if there are no packages, False if there are at least one.
"""
for family in self.iter_package_families():
for pkg in self.iter_packages(family):
return False
... | python | def is_empty(self):
"""Determine if the repository contains any packages.
Returns:
True if there are no packages, False if there are at least one.
"""
for family in self.iter_package_families():
for pkg in self.iter_packages(family):
return False
... | [
"def",
"is_empty",
"(",
"self",
")",
":",
"for",
"family",
"in",
"self",
".",
"iter_package_families",
"(",
")",
":",
"for",
"pkg",
"in",
"self",
".",
"iter_packages",
"(",
"family",
")",
":",
"return",
"False",
"return",
"True"
] | Determine if the repository contains any packages.
Returns:
True if there are no packages, False if there are at least one. | [
"Determine",
"if",
"the",
"repository",
"contains",
"any",
"packages",
"."
] | 1d3b846d53b5b5404edfe8ddb9083f9ceec8c5e7 | https://github.com/nerdvegas/rez/blob/1d3b846d53b5b5404edfe8ddb9083f9ceec8c5e7/src/rez/package_repository.py#L119-L129 |
232,567 | nerdvegas/rez | src/rez/package_repository.py | PackageRepository.make_resource_handle | def make_resource_handle(self, resource_key, **variables):
"""Create a `ResourceHandle`
Nearly all `ResourceHandle` creation should go through here, because it
gives the various resource classes a chance to normalize / standardize
the resource handles, to improve caching / comparison / ... | python | def make_resource_handle(self, resource_key, **variables):
"""Create a `ResourceHandle`
Nearly all `ResourceHandle` creation should go through here, because it
gives the various resource classes a chance to normalize / standardize
the resource handles, to improve caching / comparison / ... | [
"def",
"make_resource_handle",
"(",
"self",
",",
"resource_key",
",",
"*",
"*",
"variables",
")",
":",
"if",
"variables",
".",
"get",
"(",
"\"repository_type\"",
",",
"self",
".",
"name",
"(",
")",
")",
"!=",
"self",
".",
"name",
"(",
")",
":",
"raise"... | Create a `ResourceHandle`
Nearly all `ResourceHandle` creation should go through here, because it
gives the various resource classes a chance to normalize / standardize
the resource handles, to improve caching / comparison / etc. | [
"Create",
"a",
"ResourceHandle"
] | 1d3b846d53b5b5404edfe8ddb9083f9ceec8c5e7 | https://github.com/nerdvegas/rez/blob/1d3b846d53b5b5404edfe8ddb9083f9ceec8c5e7/src/rez/package_repository.py#L256-L278 |
232,568 | nerdvegas/rez | src/rez/package_repository.py | PackageRepositoryManager.get_repository | def get_repository(self, path):
"""Get a package repository.
Args:
path (str): Entry from the 'packages_path' config setting. This may
simply be a path (which is managed by the 'filesystem' package
repository plugin), or a string in the form "type@location",
... | python | def get_repository(self, path):
"""Get a package repository.
Args:
path (str): Entry from the 'packages_path' config setting. This may
simply be a path (which is managed by the 'filesystem' package
repository plugin), or a string in the form "type@location",
... | [
"def",
"get_repository",
"(",
"self",
",",
"path",
")",
":",
"# normalise",
"parts",
"=",
"path",
".",
"split",
"(",
"'@'",
",",
"1",
")",
"if",
"len",
"(",
"parts",
")",
"==",
"1",
":",
"parts",
"=",
"(",
"\"filesystem\"",
",",
"parts",
"[",
"0",
... | Get a package repository.
Args:
path (str): Entry from the 'packages_path' config setting. This may
simply be a path (which is managed by the 'filesystem' package
repository plugin), or a string in the form "type@location",
where 'type' identifies the... | [
"Get",
"a",
"package",
"repository",
"."
] | 1d3b846d53b5b5404edfe8ddb9083f9ceec8c5e7 | https://github.com/nerdvegas/rez/blob/1d3b846d53b5b5404edfe8ddb9083f9ceec8c5e7/src/rez/package_repository.py#L368-L394 |
232,569 | nerdvegas/rez | src/rez/package_repository.py | PackageRepositoryManager.are_same | def are_same(self, path_1, path_2):
"""Test that `path_1` and `path_2` refer to the same repository.
This is more reliable than testing that the strings match, since slightly
different strings might refer to the same repository (consider small
differences in a filesystem path for exampl... | python | def are_same(self, path_1, path_2):
"""Test that `path_1` and `path_2` refer to the same repository.
This is more reliable than testing that the strings match, since slightly
different strings might refer to the same repository (consider small
differences in a filesystem path for exampl... | [
"def",
"are_same",
"(",
"self",
",",
"path_1",
",",
"path_2",
")",
":",
"if",
"path_1",
"==",
"path_2",
":",
"return",
"True",
"repo_1",
"=",
"self",
".",
"get_repository",
"(",
"path_1",
")",
"repo_2",
"=",
"self",
".",
"get_repository",
"(",
"path_2",
... | Test that `path_1` and `path_2` refer to the same repository.
This is more reliable than testing that the strings match, since slightly
different strings might refer to the same repository (consider small
differences in a filesystem path for example, eg '//svr/foo', '/svr/foo').
Return... | [
"Test",
"that",
"path_1",
"and",
"path_2",
"refer",
"to",
"the",
"same",
"repository",
"."
] | 1d3b846d53b5b5404edfe8ddb9083f9ceec8c5e7 | https://github.com/nerdvegas/rez/blob/1d3b846d53b5b5404edfe8ddb9083f9ceec8c5e7/src/rez/package_repository.py#L396-L411 |
232,570 | nerdvegas/rez | src/rez/vendor/amqp/transport.py | create_transport | def create_transport(host, connect_timeout, ssl=False):
"""Given a few parameters from the Connection constructor,
select and create a subclass of _AbstractTransport."""
if ssl:
return SSLTransport(host, connect_timeout, ssl)
else:
return TCPTransport(host, connect_timeout) | python | def create_transport(host, connect_timeout, ssl=False):
"""Given a few parameters from the Connection constructor,
select and create a subclass of _AbstractTransport."""
if ssl:
return SSLTransport(host, connect_timeout, ssl)
else:
return TCPTransport(host, connect_timeout) | [
"def",
"create_transport",
"(",
"host",
",",
"connect_timeout",
",",
"ssl",
"=",
"False",
")",
":",
"if",
"ssl",
":",
"return",
"SSLTransport",
"(",
"host",
",",
"connect_timeout",
",",
"ssl",
")",
"else",
":",
"return",
"TCPTransport",
"(",
"host",
",",
... | Given a few parameters from the Connection constructor,
select and create a subclass of _AbstractTransport. | [
"Given",
"a",
"few",
"parameters",
"from",
"the",
"Connection",
"constructor",
"select",
"and",
"create",
"a",
"subclass",
"of",
"_AbstractTransport",
"."
] | 1d3b846d53b5b5404edfe8ddb9083f9ceec8c5e7 | https://github.com/nerdvegas/rez/blob/1d3b846d53b5b5404edfe8ddb9083f9ceec8c5e7/src/rez/vendor/amqp/transport.py#L293-L299 |
232,571 | nerdvegas/rez | src/rez/plugin_managers.py | RezPluginType.get_plugin_class | def get_plugin_class(self, plugin_name):
"""Returns the class registered under the given plugin name."""
try:
return self.plugin_classes[plugin_name]
except KeyError:
raise RezPluginError("Unrecognised %s plugin: '%s'"
% (self.pretty_type_... | python | def get_plugin_class(self, plugin_name):
"""Returns the class registered under the given plugin name."""
try:
return self.plugin_classes[plugin_name]
except KeyError:
raise RezPluginError("Unrecognised %s plugin: '%s'"
% (self.pretty_type_... | [
"def",
"get_plugin_class",
"(",
"self",
",",
"plugin_name",
")",
":",
"try",
":",
"return",
"self",
".",
"plugin_classes",
"[",
"plugin_name",
"]",
"except",
"KeyError",
":",
"raise",
"RezPluginError",
"(",
"\"Unrecognised %s plugin: '%s'\"",
"%",
"(",
"self",
"... | Returns the class registered under the given plugin name. | [
"Returns",
"the",
"class",
"registered",
"under",
"the",
"given",
"plugin",
"name",
"."
] | 1d3b846d53b5b5404edfe8ddb9083f9ceec8c5e7 | https://github.com/nerdvegas/rez/blob/1d3b846d53b5b5404edfe8ddb9083f9ceec8c5e7/src/rez/plugin_managers.py#L157-L163 |
232,572 | nerdvegas/rez | src/rez/plugin_managers.py | RezPluginType.get_plugin_module | def get_plugin_module(self, plugin_name):
"""Returns the module containing the plugin of the given name."""
try:
return self.plugin_modules[plugin_name]
except KeyError:
raise RezPluginError("Unrecognised %s plugin: '%s'"
% (self.pretty_ty... | python | def get_plugin_module(self, plugin_name):
"""Returns the module containing the plugin of the given name."""
try:
return self.plugin_modules[plugin_name]
except KeyError:
raise RezPluginError("Unrecognised %s plugin: '%s'"
% (self.pretty_ty... | [
"def",
"get_plugin_module",
"(",
"self",
",",
"plugin_name",
")",
":",
"try",
":",
"return",
"self",
".",
"plugin_modules",
"[",
"plugin_name",
"]",
"except",
"KeyError",
":",
"raise",
"RezPluginError",
"(",
"\"Unrecognised %s plugin: '%s'\"",
"%",
"(",
"self",
... | Returns the module containing the plugin of the given name. | [
"Returns",
"the",
"module",
"containing",
"the",
"plugin",
"of",
"the",
"given",
"name",
"."
] | 1d3b846d53b5b5404edfe8ddb9083f9ceec8c5e7 | https://github.com/nerdvegas/rez/blob/1d3b846d53b5b5404edfe8ddb9083f9ceec8c5e7/src/rez/plugin_managers.py#L165-L171 |
232,573 | nerdvegas/rez | src/rez/plugin_managers.py | RezPluginType.config_schema | def config_schema(self):
"""Returns the merged configuration data schema for this plugin
type."""
from rez.config import _plugin_config_dict
d = _plugin_config_dict.get(self.type_name, {})
for name, plugin_class in self.plugin_classes.iteritems():
if hasattr(plugin_c... | python | def config_schema(self):
"""Returns the merged configuration data schema for this plugin
type."""
from rez.config import _plugin_config_dict
d = _plugin_config_dict.get(self.type_name, {})
for name, plugin_class in self.plugin_classes.iteritems():
if hasattr(plugin_c... | [
"def",
"config_schema",
"(",
"self",
")",
":",
"from",
"rez",
".",
"config",
"import",
"_plugin_config_dict",
"d",
"=",
"_plugin_config_dict",
".",
"get",
"(",
"self",
".",
"type_name",
",",
"{",
"}",
")",
"for",
"name",
",",
"plugin_class",
"in",
"self",
... | Returns the merged configuration data schema for this plugin
type. | [
"Returns",
"the",
"merged",
"configuration",
"data",
"schema",
"for",
"this",
"plugin",
"type",
"."
] | 1d3b846d53b5b5404edfe8ddb9083f9ceec8c5e7 | https://github.com/nerdvegas/rez/blob/1d3b846d53b5b5404edfe8ddb9083f9ceec8c5e7/src/rez/plugin_managers.py#L174-L185 |
232,574 | nerdvegas/rez | src/rez/plugin_managers.py | RezPluginManager.get_plugin_class | def get_plugin_class(self, plugin_type, plugin_name):
"""Return the class registered under the given plugin name."""
plugin = self._get_plugin_type(plugin_type)
return plugin.get_plugin_class(plugin_name) | python | def get_plugin_class(self, plugin_type, plugin_name):
"""Return the class registered under the given plugin name."""
plugin = self._get_plugin_type(plugin_type)
return plugin.get_plugin_class(plugin_name) | [
"def",
"get_plugin_class",
"(",
"self",
",",
"plugin_type",
",",
"plugin_name",
")",
":",
"plugin",
"=",
"self",
".",
"_get_plugin_type",
"(",
"plugin_type",
")",
"return",
"plugin",
".",
"get_plugin_class",
"(",
"plugin_name",
")"
] | Return the class registered under the given plugin name. | [
"Return",
"the",
"class",
"registered",
"under",
"the",
"given",
"plugin",
"name",
"."
] | 1d3b846d53b5b5404edfe8ddb9083f9ceec8c5e7 | https://github.com/nerdvegas/rez/blob/1d3b846d53b5b5404edfe8ddb9083f9ceec8c5e7/src/rez/plugin_managers.py#L278-L281 |
232,575 | nerdvegas/rez | src/rez/plugin_managers.py | RezPluginManager.get_plugin_module | def get_plugin_module(self, plugin_type, plugin_name):
"""Return the module defining the class registered under the given
plugin name."""
plugin = self._get_plugin_type(plugin_type)
return plugin.get_plugin_module(plugin_name) | python | def get_plugin_module(self, plugin_type, plugin_name):
"""Return the module defining the class registered under the given
plugin name."""
plugin = self._get_plugin_type(plugin_type)
return plugin.get_plugin_module(plugin_name) | [
"def",
"get_plugin_module",
"(",
"self",
",",
"plugin_type",
",",
"plugin_name",
")",
":",
"plugin",
"=",
"self",
".",
"_get_plugin_type",
"(",
"plugin_type",
")",
"return",
"plugin",
".",
"get_plugin_module",
"(",
"plugin_name",
")"
] | Return the module defining the class registered under the given
plugin name. | [
"Return",
"the",
"module",
"defining",
"the",
"class",
"registered",
"under",
"the",
"given",
"plugin",
"name",
"."
] | 1d3b846d53b5b5404edfe8ddb9083f9ceec8c5e7 | https://github.com/nerdvegas/rez/blob/1d3b846d53b5b5404edfe8ddb9083f9ceec8c5e7/src/rez/plugin_managers.py#L283-L287 |
232,576 | nerdvegas/rez | src/rez/plugin_managers.py | RezPluginManager.create_instance | def create_instance(self, plugin_type, plugin_name, **instance_kwargs):
"""Create and return an instance of the given plugin."""
plugin_type = self._get_plugin_type(plugin_type)
return plugin_type.create_instance(plugin_name, **instance_kwargs) | python | def create_instance(self, plugin_type, plugin_name, **instance_kwargs):
"""Create and return an instance of the given plugin."""
plugin_type = self._get_plugin_type(plugin_type)
return plugin_type.create_instance(plugin_name, **instance_kwargs) | [
"def",
"create_instance",
"(",
"self",
",",
"plugin_type",
",",
"plugin_name",
",",
"*",
"*",
"instance_kwargs",
")",
":",
"plugin_type",
"=",
"self",
".",
"_get_plugin_type",
"(",
"plugin_type",
")",
"return",
"plugin_type",
".",
"create_instance",
"(",
"plugin... | Create and return an instance of the given plugin. | [
"Create",
"and",
"return",
"an",
"instance",
"of",
"the",
"given",
"plugin",
"."
] | 1d3b846d53b5b5404edfe8ddb9083f9ceec8c5e7 | https://github.com/nerdvegas/rez/blob/1d3b846d53b5b5404edfe8ddb9083f9ceec8c5e7/src/rez/plugin_managers.py#L308-L311 |
232,577 | nerdvegas/rez | src/rez/plugin_managers.py | RezPluginManager.get_summary_string | def get_summary_string(self):
"""Get a formatted string summarising the plugins that were loaded."""
rows = [["PLUGIN TYPE", "NAME", "DESCRIPTION", "STATUS"],
["-----------", "----", "-----------", "------"]]
for plugin_type in sorted(self.get_plugin_types()):
type_na... | python | def get_summary_string(self):
"""Get a formatted string summarising the plugins that were loaded."""
rows = [["PLUGIN TYPE", "NAME", "DESCRIPTION", "STATUS"],
["-----------", "----", "-----------", "------"]]
for plugin_type in sorted(self.get_plugin_types()):
type_na... | [
"def",
"get_summary_string",
"(",
"self",
")",
":",
"rows",
"=",
"[",
"[",
"\"PLUGIN TYPE\"",
",",
"\"NAME\"",
",",
"\"DESCRIPTION\"",
",",
"\"STATUS\"",
"]",
",",
"[",
"\"-----------\"",
",",
"\"----\"",
",",
"\"-----------\"",
",",
"\"------\"",
"]",
"]",
... | Get a formatted string summarising the plugins that were loaded. | [
"Get",
"a",
"formatted",
"string",
"summarising",
"the",
"plugins",
"that",
"were",
"loaded",
"."
] | 1d3b846d53b5b5404edfe8ddb9083f9ceec8c5e7 | https://github.com/nerdvegas/rez/blob/1d3b846d53b5b5404edfe8ddb9083f9ceec8c5e7/src/rez/plugin_managers.py#L313-L326 |
232,578 | nerdvegas/rez | src/rez/vendor/distlib/markers.py | Evaluator.get_fragment | def get_fragment(self, offset):
"""
Get the part of the source which is causing a problem.
"""
fragment_len = 10
s = '%r' % (self.source[offset:offset + fragment_len])
if offset + fragment_len < len(self.source):
s += '...'
return s | python | def get_fragment(self, offset):
"""
Get the part of the source which is causing a problem.
"""
fragment_len = 10
s = '%r' % (self.source[offset:offset + fragment_len])
if offset + fragment_len < len(self.source):
s += '...'
return s | [
"def",
"get_fragment",
"(",
"self",
",",
"offset",
")",
":",
"fragment_len",
"=",
"10",
"s",
"=",
"'%r'",
"%",
"(",
"self",
".",
"source",
"[",
"offset",
":",
"offset",
"+",
"fragment_len",
"]",
")",
"if",
"offset",
"+",
"fragment_len",
"<",
"len",
"... | Get the part of the source which is causing a problem. | [
"Get",
"the",
"part",
"of",
"the",
"source",
"which",
"is",
"causing",
"a",
"problem",
"."
] | 1d3b846d53b5b5404edfe8ddb9083f9ceec8c5e7 | https://github.com/nerdvegas/rez/blob/1d3b846d53b5b5404edfe8ddb9083f9ceec8c5e7/src/rez/vendor/distlib/markers.py#L60-L68 |
232,579 | nerdvegas/rez | src/rez/vendor/distlib/markers.py | Evaluator.evaluate | def evaluate(self, node, filename=None):
"""
Evaluate a source string or node, using ``filename`` when
displaying errors.
"""
if isinstance(node, string_types):
self.source = node
kwargs = {'mode': 'eval'}
if filename:
kwargs['f... | python | def evaluate(self, node, filename=None):
"""
Evaluate a source string or node, using ``filename`` when
displaying errors.
"""
if isinstance(node, string_types):
self.source = node
kwargs = {'mode': 'eval'}
if filename:
kwargs['f... | [
"def",
"evaluate",
"(",
"self",
",",
"node",
",",
"filename",
"=",
"None",
")",
":",
"if",
"isinstance",
"(",
"node",
",",
"string_types",
")",
":",
"self",
".",
"source",
"=",
"node",
"kwargs",
"=",
"{",
"'mode'",
":",
"'eval'",
"}",
"if",
"filename... | Evaluate a source string or node, using ``filename`` when
displaying errors. | [
"Evaluate",
"a",
"source",
"string",
"or",
"node",
"using",
"filename",
"when",
"displaying",
"errors",
"."
] | 1d3b846d53b5b5404edfe8ddb9083f9ceec8c5e7 | https://github.com/nerdvegas/rez/blob/1d3b846d53b5b5404edfe8ddb9083f9ceec8c5e7/src/rez/vendor/distlib/markers.py#L76-L100 |
232,580 | nerdvegas/rez | src/rez/vendor/sortedcontainers/sortedlist.py | recursive_repr | def recursive_repr(func):
"""Decorator to prevent infinite repr recursion."""
repr_running = set()
@wraps(func)
def wrapper(self):
"Return ellipsis on recursive re-entry to function."
key = id(self), get_ident()
if key in repr_running:
return '...'
repr_run... | python | def recursive_repr(func):
"""Decorator to prevent infinite repr recursion."""
repr_running = set()
@wraps(func)
def wrapper(self):
"Return ellipsis on recursive re-entry to function."
key = id(self), get_ident()
if key in repr_running:
return '...'
repr_run... | [
"def",
"recursive_repr",
"(",
"func",
")",
":",
"repr_running",
"=",
"set",
"(",
")",
"@",
"wraps",
"(",
"func",
")",
"def",
"wrapper",
"(",
"self",
")",
":",
"\"Return ellipsis on recursive re-entry to function.\"",
"key",
"=",
"id",
"(",
"self",
")",
",",
... | Decorator to prevent infinite repr recursion. | [
"Decorator",
"to",
"prevent",
"infinite",
"repr",
"recursion",
"."
] | 1d3b846d53b5b5404edfe8ddb9083f9ceec8c5e7 | https://github.com/nerdvegas/rez/blob/1d3b846d53b5b5404edfe8ddb9083f9ceec8c5e7/src/rez/vendor/sortedcontainers/sortedlist.py#L33-L52 |
232,581 | nerdvegas/rez | src/rez/vendor/sortedcontainers/sortedlist.py | SortedList._reset | def _reset(self, load):
"""
Reset sorted list load.
The *load* specifies the load-factor of the list. The default load
factor of '1000' works well for lists from tens to tens of millions of
elements. Good practice is to use a value that is the cube root of the
list size... | python | def _reset(self, load):
"""
Reset sorted list load.
The *load* specifies the load-factor of the list. The default load
factor of '1000' works well for lists from tens to tens of millions of
elements. Good practice is to use a value that is the cube root of the
list size... | [
"def",
"_reset",
"(",
"self",
",",
"load",
")",
":",
"values",
"=",
"reduce",
"(",
"iadd",
",",
"self",
".",
"_lists",
",",
"[",
"]",
")",
"self",
".",
"_clear",
"(",
")",
"self",
".",
"_load",
"=",
"load",
"self",
".",
"_half",
"=",
"load",
">... | Reset sorted list load.
The *load* specifies the load-factor of the list. The default load
factor of '1000' works well for lists from tens to tens of millions of
elements. Good practice is to use a value that is the cube root of the
list size. With billions of elements, the best load ... | [
"Reset",
"sorted",
"list",
"load",
"."
] | 1d3b846d53b5b5404edfe8ddb9083f9ceec8c5e7 | https://github.com/nerdvegas/rez/blob/1d3b846d53b5b5404edfe8ddb9083f9ceec8c5e7/src/rez/vendor/sortedcontainers/sortedlist.py#L105-L121 |
232,582 | nerdvegas/rez | src/rez/vendor/sortedcontainers/sortedlist.py | SortedList._build_index | def _build_index(self):
"""Build an index for indexing the sorted list.
Indexes are represented as binary trees in a dense array notation
similar to a binary heap.
For example, given a _lists representation storing integers:
[0]: 1 2 3
[1]: 4 5
[2]: 6 7 8 9
... | python | def _build_index(self):
"""Build an index for indexing the sorted list.
Indexes are represented as binary trees in a dense array notation
similar to a binary heap.
For example, given a _lists representation storing integers:
[0]: 1 2 3
[1]: 4 5
[2]: 6 7 8 9
... | [
"def",
"_build_index",
"(",
"self",
")",
":",
"row0",
"=",
"list",
"(",
"map",
"(",
"len",
",",
"self",
".",
"_lists",
")",
")",
"if",
"len",
"(",
"row0",
")",
"==",
"1",
":",
"self",
".",
"_index",
"[",
":",
"]",
"=",
"row0",
"self",
".",
"_... | Build an index for indexing the sorted list.
Indexes are represented as binary trees in a dense array notation
similar to a binary heap.
For example, given a _lists representation storing integers:
[0]: 1 2 3
[1]: 4 5
[2]: 6 7 8 9
[3]: 10 11 12 13 14
T... | [
"Build",
"an",
"index",
"for",
"indexing",
"the",
"sorted",
"list",
"."
] | 1d3b846d53b5b5404edfe8ddb9083f9ceec8c5e7 | https://github.com/nerdvegas/rez/blob/1d3b846d53b5b5404edfe8ddb9083f9ceec8c5e7/src/rez/vendor/sortedcontainers/sortedlist.py#L494-L558 |
232,583 | nerdvegas/rez | src/rez/vendor/sortedcontainers/sortedlist.py | SortedListWithKey.irange_key | def irange_key(self, min_key=None, max_key=None, inclusive=(True, True),
reverse=False):
"""
Create an iterator of values between `min_key` and `max_key`.
`inclusive` is a pair of booleans that indicates whether the min_key
and max_key ought to be included in the rang... | python | def irange_key(self, min_key=None, max_key=None, inclusive=(True, True),
reverse=False):
"""
Create an iterator of values between `min_key` and `max_key`.
`inclusive` is a pair of booleans that indicates whether the min_key
and max_key ought to be included in the rang... | [
"def",
"irange_key",
"(",
"self",
",",
"min_key",
"=",
"None",
",",
"max_key",
"=",
"None",
",",
"inclusive",
"=",
"(",
"True",
",",
"True",
")",
",",
"reverse",
"=",
"False",
")",
":",
"_maxes",
"=",
"self",
".",
"_maxes",
"if",
"not",
"_maxes",
"... | Create an iterator of values between `min_key` and `max_key`.
`inclusive` is a pair of booleans that indicates whether the min_key
and max_key ought to be included in the range, respectively. The
default is (True, True) such that the range is inclusive of both
`min_key` and `max_key`.
... | [
"Create",
"an",
"iterator",
"of",
"values",
"between",
"min_key",
"and",
"max_key",
"."
] | 1d3b846d53b5b5404edfe8ddb9083f9ceec8c5e7 | https://github.com/nerdvegas/rez/blob/1d3b846d53b5b5404edfe8ddb9083f9ceec8c5e7/src/rez/vendor/sortedcontainers/sortedlist.py#L1966-L2035 |
232,584 | nerdvegas/rez | src/rezgui/dialogs/WriteGraphDialog.py | view_graph | def view_graph(graph_str, parent=None, prune_to=None):
"""View a graph."""
from rezgui.dialogs.ImageViewerDialog import ImageViewerDialog
from rez.config import config
# check for already written tempfile
h = hash((graph_str, prune_to))
filepath = graph_file_lookup.get(h)
if filepath and no... | python | def view_graph(graph_str, parent=None, prune_to=None):
"""View a graph."""
from rezgui.dialogs.ImageViewerDialog import ImageViewerDialog
from rez.config import config
# check for already written tempfile
h = hash((graph_str, prune_to))
filepath = graph_file_lookup.get(h)
if filepath and no... | [
"def",
"view_graph",
"(",
"graph_str",
",",
"parent",
"=",
"None",
",",
"prune_to",
"=",
"None",
")",
":",
"from",
"rezgui",
".",
"dialogs",
".",
"ImageViewerDialog",
"import",
"ImageViewerDialog",
"from",
"rez",
".",
"config",
"import",
"config",
"# check for... | View a graph. | [
"View",
"a",
"graph",
"."
] | 1d3b846d53b5b5404edfe8ddb9083f9ceec8c5e7 | https://github.com/nerdvegas/rez/blob/1d3b846d53b5b5404edfe8ddb9083f9ceec8c5e7/src/rezgui/dialogs/WriteGraphDialog.py#L109-L133 |
232,585 | nerdvegas/rez | src/rezgui/widgets/PackageVersionsTable.py | PackageVersionsTable.select_version | def select_version(self, version_range):
"""Select the latest versioned package in the given range.
If there are no packages in the range, the selection is cleared.
"""
row = -1
version = None
for i, package in self.packages.iteritems():
if package.version in... | python | def select_version(self, version_range):
"""Select the latest versioned package in the given range.
If there are no packages in the range, the selection is cleared.
"""
row = -1
version = None
for i, package in self.packages.iteritems():
if package.version in... | [
"def",
"select_version",
"(",
"self",
",",
"version_range",
")",
":",
"row",
"=",
"-",
"1",
"version",
"=",
"None",
"for",
"i",
",",
"package",
"in",
"self",
".",
"packages",
".",
"iteritems",
"(",
")",
":",
"if",
"package",
".",
"version",
"in",
"ve... | Select the latest versioned package in the given range.
If there are no packages in the range, the selection is cleared. | [
"Select",
"the",
"latest",
"versioned",
"package",
"in",
"the",
"given",
"range",
"."
] | 1d3b846d53b5b5404edfe8ddb9083f9ceec8c5e7 | https://github.com/nerdvegas/rez/blob/1d3b846d53b5b5404edfe8ddb9083f9ceec8c5e7/src/rezgui/widgets/PackageVersionsTable.py#L46-L62 |
232,586 | nerdvegas/rez | src/rez/vendor/sortedcontainers/sortedset.py | SortedSet._fromset | def _fromset(cls, values, key=None):
"""Initialize sorted set from existing set."""
sorted_set = object.__new__(cls)
sorted_set._set = values # pylint: disable=protected-access
sorted_set.__init__(key=key)
return sorted_set | python | def _fromset(cls, values, key=None):
"""Initialize sorted set from existing set."""
sorted_set = object.__new__(cls)
sorted_set._set = values # pylint: disable=protected-access
sorted_set.__init__(key=key)
return sorted_set | [
"def",
"_fromset",
"(",
"cls",
",",
"values",
",",
"key",
"=",
"None",
")",
":",
"sorted_set",
"=",
"object",
".",
"__new__",
"(",
"cls",
")",
"sorted_set",
".",
"_set",
"=",
"values",
"# pylint: disable=protected-access",
"sorted_set",
".",
"__init__",
"(",... | Initialize sorted set from existing set. | [
"Initialize",
"sorted",
"set",
"from",
"existing",
"set",
"."
] | 1d3b846d53b5b5404edfe8ddb9083f9ceec8c5e7 | https://github.com/nerdvegas/rez/blob/1d3b846d53b5b5404edfe8ddb9083f9ceec8c5e7/src/rez/vendor/sortedcontainers/sortedset.py#L73-L78 |
232,587 | nerdvegas/rez | src/rez/cli/build.py | setup_parser_common | def setup_parser_common(parser):
"""Parser setup common to both rez-build and rez-release."""
from rez.build_process_ import get_build_process_types
from rez.build_system import get_valid_build_systems
process_types = get_build_process_types()
parser.add_argument(
"--process", type=str, cho... | python | def setup_parser_common(parser):
"""Parser setup common to both rez-build and rez-release."""
from rez.build_process_ import get_build_process_types
from rez.build_system import get_valid_build_systems
process_types = get_build_process_types()
parser.add_argument(
"--process", type=str, cho... | [
"def",
"setup_parser_common",
"(",
"parser",
")",
":",
"from",
"rez",
".",
"build_process_",
"import",
"get_build_process_types",
"from",
"rez",
".",
"build_system",
"import",
"get_valid_build_systems",
"process_types",
"=",
"get_build_process_types",
"(",
")",
"parser"... | Parser setup common to both rez-build and rez-release. | [
"Parser",
"setup",
"common",
"to",
"both",
"rez",
"-",
"build",
"and",
"rez",
"-",
"release",
"."
] | 1d3b846d53b5b5404edfe8ddb9083f9ceec8c5e7 | https://github.com/nerdvegas/rez/blob/1d3b846d53b5b5404edfe8ddb9083f9ceec8c5e7/src/rez/cli/build.py#L30-L71 |
232,588 | nerdvegas/rez | src/rez/utils/scope.py | scoped_format | def scoped_format(txt, **objects):
"""Format a string with respect to a set of objects' attributes.
Example:
>>> Class Foo(object):
>>> def __init__(self):
>>> self.name = "Dave"
>>> print scoped_format("hello {foo.name}", foo=Foo())
hello Dave
Args:
... | python | def scoped_format(txt, **objects):
"""Format a string with respect to a set of objects' attributes.
Example:
>>> Class Foo(object):
>>> def __init__(self):
>>> self.name = "Dave"
>>> print scoped_format("hello {foo.name}", foo=Foo())
hello Dave
Args:
... | [
"def",
"scoped_format",
"(",
"txt",
",",
"*",
"*",
"objects",
")",
":",
"pretty",
"=",
"objects",
".",
"pop",
"(",
"\"pretty\"",
",",
"RecursiveAttribute",
".",
"format_pretty",
")",
"expand",
"=",
"objects",
".",
"pop",
"(",
"\"expand\"",
",",
"RecursiveA... | Format a string with respect to a set of objects' attributes.
Example:
>>> Class Foo(object):
>>> def __init__(self):
>>> self.name = "Dave"
>>> print scoped_format("hello {foo.name}", foo=Foo())
hello Dave
Args:
objects (dict): Dict of objects to f... | [
"Format",
"a",
"string",
"with",
"respect",
"to",
"a",
"set",
"of",
"objects",
"attributes",
"."
] | 1d3b846d53b5b5404edfe8ddb9083f9ceec8c5e7 | https://github.com/nerdvegas/rez/blob/1d3b846d53b5b5404edfe8ddb9083f9ceec8c5e7/src/rez/utils/scope.py#L238-L260 |
232,589 | nerdvegas/rez | src/rez/utils/scope.py | RecursiveAttribute.to_dict | def to_dict(self):
"""Get an equivalent dict representation."""
d = {}
for k, v in self.__dict__["data"].iteritems():
if isinstance(v, RecursiveAttribute):
d[k] = v.to_dict()
else:
d[k] = v
return d | python | def to_dict(self):
"""Get an equivalent dict representation."""
d = {}
for k, v in self.__dict__["data"].iteritems():
if isinstance(v, RecursiveAttribute):
d[k] = v.to_dict()
else:
d[k] = v
return d | [
"def",
"to_dict",
"(",
"self",
")",
":",
"d",
"=",
"{",
"}",
"for",
"k",
",",
"v",
"in",
"self",
".",
"__dict__",
"[",
"\"data\"",
"]",
".",
"iteritems",
"(",
")",
":",
"if",
"isinstance",
"(",
"v",
",",
"RecursiveAttribute",
")",
":",
"d",
"[",
... | Get an equivalent dict representation. | [
"Get",
"an",
"equivalent",
"dict",
"representation",
"."
] | 1d3b846d53b5b5404edfe8ddb9083f9ceec8c5e7 | https://github.com/nerdvegas/rez/blob/1d3b846d53b5b5404edfe8ddb9083f9ceec8c5e7/src/rez/utils/scope.py#L89-L97 |
232,590 | nerdvegas/rez | src/rezgui/objects/Config.py | Config.value | def value(self, key, type_=None):
"""Get the value of a setting.
If `type` is not provided, the key must be for a known setting,
present in `self.default_settings`. Conversely if `type` IS provided,
the key must be for an unknown setting.
"""
if type_ is None:
... | python | def value(self, key, type_=None):
"""Get the value of a setting.
If `type` is not provided, the key must be for a known setting,
present in `self.default_settings`. Conversely if `type` IS provided,
the key must be for an unknown setting.
"""
if type_ is None:
... | [
"def",
"value",
"(",
"self",
",",
"key",
",",
"type_",
"=",
"None",
")",
":",
"if",
"type_",
"is",
"None",
":",
"default",
"=",
"self",
".",
"_default_value",
"(",
"key",
")",
"val",
"=",
"self",
".",
"_value",
"(",
"key",
",",
"default",
")",
"i... | Get the value of a setting.
If `type` is not provided, the key must be for a known setting,
present in `self.default_settings`. Conversely if `type` IS provided,
the key must be for an unknown setting. | [
"Get",
"the",
"value",
"of",
"a",
"setting",
"."
] | 1d3b846d53b5b5404edfe8ddb9083f9ceec8c5e7 | https://github.com/nerdvegas/rez/blob/1d3b846d53b5b5404edfe8ddb9083f9ceec8c5e7/src/rezgui/objects/Config.py#L15-L33 |
232,591 | nerdvegas/rez | src/rezgui/objects/Config.py | Config.get_string_list | def get_string_list(self, key):
"""Get a list of strings."""
strings = []
size = self.beginReadArray(key)
for i in range(size):
self.setArrayIndex(i)
entry = str(self._value("entry"))
strings.append(entry)
self.endArray()
return strings | python | def get_string_list(self, key):
"""Get a list of strings."""
strings = []
size = self.beginReadArray(key)
for i in range(size):
self.setArrayIndex(i)
entry = str(self._value("entry"))
strings.append(entry)
self.endArray()
return strings | [
"def",
"get_string_list",
"(",
"self",
",",
"key",
")",
":",
"strings",
"=",
"[",
"]",
"size",
"=",
"self",
".",
"beginReadArray",
"(",
"key",
")",
"for",
"i",
"in",
"range",
"(",
"size",
")",
":",
"self",
".",
"setArrayIndex",
"(",
"i",
")",
"entr... | Get a list of strings. | [
"Get",
"a",
"list",
"of",
"strings",
"."
] | 1d3b846d53b5b5404edfe8ddb9083f9ceec8c5e7 | https://github.com/nerdvegas/rez/blob/1d3b846d53b5b5404edfe8ddb9083f9ceec8c5e7/src/rezgui/objects/Config.py#L38-L47 |
232,592 | nerdvegas/rez | src/rezgui/objects/Config.py | Config.prepend_string_list | def prepend_string_list(self, key, value, max_length_key):
"""Prepend a fixed-length string list with a new string.
The oldest string will be removed from the list. If the string is
already in the list, it is shuffled to the top. Use this to implement
things like a 'most recent files' e... | python | def prepend_string_list(self, key, value, max_length_key):
"""Prepend a fixed-length string list with a new string.
The oldest string will be removed from the list. If the string is
already in the list, it is shuffled to the top. Use this to implement
things like a 'most recent files' e... | [
"def",
"prepend_string_list",
"(",
"self",
",",
"key",
",",
"value",
",",
"max_length_key",
")",
":",
"max_len",
"=",
"self",
".",
"get",
"(",
"max_length_key",
")",
"strings",
"=",
"self",
".",
"get_string_list",
"(",
"key",
")",
"strings",
"=",
"[",
"v... | Prepend a fixed-length string list with a new string.
The oldest string will be removed from the list. If the string is
already in the list, it is shuffled to the top. Use this to implement
things like a 'most recent files' entry. | [
"Prepend",
"a",
"fixed",
"-",
"length",
"string",
"list",
"with",
"a",
"new",
"string",
"."
] | 1d3b846d53b5b5404edfe8ddb9083f9ceec8c5e7 | https://github.com/nerdvegas/rez/blob/1d3b846d53b5b5404edfe8ddb9083f9ceec8c5e7/src/rezgui/objects/Config.py#L49-L65 |
232,593 | nerdvegas/rez | src/rez/vendor/pygraph/algorithms/utils.py | priority_queue.insert | def insert(self, item, priority):
"""
Insert item into the queue, with the given priority.
"""
heappush(self.heap, HeapItem(item, priority)) | python | def insert(self, item, priority):
"""
Insert item into the queue, with the given priority.
"""
heappush(self.heap, HeapItem(item, priority)) | [
"def",
"insert",
"(",
"self",
",",
"item",
",",
"priority",
")",
":",
"heappush",
"(",
"self",
".",
"heap",
",",
"HeapItem",
"(",
"item",
",",
"priority",
")",
")"
] | Insert item into the queue, with the given priority. | [
"Insert",
"item",
"into",
"the",
"queue",
"with",
"the",
"given",
"priority",
"."
] | 1d3b846d53b5b5404edfe8ddb9083f9ceec8c5e7 | https://github.com/nerdvegas/rez/blob/1d3b846d53b5b5404edfe8ddb9083f9ceec8c5e7/src/rez/vendor/pygraph/algorithms/utils.py#L57-L61 |
232,594 | nerdvegas/rez | src/rez/vendor/pygraph/algorithms/accessibility.py | connected_components | def connected_components(graph):
"""
Connected components.
@type graph: graph, hypergraph
@param graph: Graph.
@rtype: dictionary
@return: Pairing that associates each node to its connected component.
"""
recursionlimit = getrecursionlimit()
setrecursionlimit(max(len(graph.nodes(... | python | def connected_components(graph):
"""
Connected components.
@type graph: graph, hypergraph
@param graph: Graph.
@rtype: dictionary
@return: Pairing that associates each node to its connected component.
"""
recursionlimit = getrecursionlimit()
setrecursionlimit(max(len(graph.nodes(... | [
"def",
"connected_components",
"(",
"graph",
")",
":",
"recursionlimit",
"=",
"getrecursionlimit",
"(",
")",
"setrecursionlimit",
"(",
"max",
"(",
"len",
"(",
"graph",
".",
"nodes",
"(",
")",
")",
"*",
"2",
",",
"recursionlimit",
")",
")",
"visited",
"=",
... | Connected components.
@type graph: graph, hypergraph
@param graph: Graph.
@rtype: dictionary
@return: Pairing that associates each node to its connected component. | [
"Connected",
"components",
"."
] | 1d3b846d53b5b5404edfe8ddb9083f9ceec8c5e7 | https://github.com/nerdvegas/rez/blob/1d3b846d53b5b5404edfe8ddb9083f9ceec8c5e7/src/rez/vendor/pygraph/algorithms/accessibility.py#L114-L138 |
232,595 | nerdvegas/rez | src/rez/vendor/pygraph/algorithms/accessibility.py | cut_edges | def cut_edges(graph):
"""
Return the cut-edges of the given graph.
A cut edge, or bridge, is an edge of a graph whose removal increases the number of connected
components in the graph.
@type graph: graph, hypergraph
@param graph: Graph.
@rtype: list
@return: List of cut-... | python | def cut_edges(graph):
"""
Return the cut-edges of the given graph.
A cut edge, or bridge, is an edge of a graph whose removal increases the number of connected
components in the graph.
@type graph: graph, hypergraph
@param graph: Graph.
@rtype: list
@return: List of cut-... | [
"def",
"cut_edges",
"(",
"graph",
")",
":",
"recursionlimit",
"=",
"getrecursionlimit",
"(",
")",
"setrecursionlimit",
"(",
"max",
"(",
"len",
"(",
"graph",
".",
"nodes",
"(",
")",
")",
"*",
"2",
",",
"recursionlimit",
")",
")",
"# Dispatch if we have a hype... | Return the cut-edges of the given graph.
A cut edge, or bridge, is an edge of a graph whose removal increases the number of connected
components in the graph.
@type graph: graph, hypergraph
@param graph: Graph.
@rtype: list
@return: List of cut-edges. | [
"Return",
"the",
"cut",
"-",
"edges",
"of",
"the",
"given",
"graph",
".",
"A",
"cut",
"edge",
"or",
"bridge",
"is",
"an",
"edge",
"of",
"a",
"graph",
"whose",
"removal",
"increases",
"the",
"number",
"of",
"connected",
"components",
"in",
"the",
"graph",... | 1d3b846d53b5b5404edfe8ddb9083f9ceec8c5e7 | https://github.com/nerdvegas/rez/blob/1d3b846d53b5b5404edfe8ddb9083f9ceec8c5e7/src/rez/vendor/pygraph/algorithms/accessibility.py#L182-L214 |
232,596 | nerdvegas/rez | src/rez/vendor/pygraph/algorithms/accessibility.py | _cut_hyperedges | def _cut_hyperedges(hypergraph):
"""
Return the cut-hyperedges of the given hypergraph.
@type hypergraph: hypergraph
@param hypergraph: Hypergraph
@rtype: list
@return: List of cut-nodes.
"""
edges_ = cut_nodes(hypergraph.graph)
edges = []
for each in edges_:
... | python | def _cut_hyperedges(hypergraph):
"""
Return the cut-hyperedges of the given hypergraph.
@type hypergraph: hypergraph
@param hypergraph: Hypergraph
@rtype: list
@return: List of cut-nodes.
"""
edges_ = cut_nodes(hypergraph.graph)
edges = []
for each in edges_:
... | [
"def",
"_cut_hyperedges",
"(",
"hypergraph",
")",
":",
"edges_",
"=",
"cut_nodes",
"(",
"hypergraph",
".",
"graph",
")",
"edges",
"=",
"[",
"]",
"for",
"each",
"in",
"edges_",
":",
"if",
"(",
"each",
"[",
"1",
"]",
"==",
"'h'",
")",
":",
"edges",
"... | Return the cut-hyperedges of the given hypergraph.
@type hypergraph: hypergraph
@param hypergraph: Hypergraph
@rtype: list
@return: List of cut-nodes. | [
"Return",
"the",
"cut",
"-",
"hyperedges",
"of",
"the",
"given",
"hypergraph",
"."
] | 1d3b846d53b5b5404edfe8ddb9083f9ceec8c5e7 | https://github.com/nerdvegas/rez/blob/1d3b846d53b5b5404edfe8ddb9083f9ceec8c5e7/src/rez/vendor/pygraph/algorithms/accessibility.py#L217-L234 |
232,597 | nerdvegas/rez | src/rez/vendor/pygraph/algorithms/accessibility.py | cut_nodes | def cut_nodes(graph):
"""
Return the cut-nodes of the given graph.
A cut node, or articulation point, is a node of a graph whose removal increases the number of
connected components in the graph.
@type graph: graph, hypergraph
@param graph: Graph.
@rtype: list
@retur... | python | def cut_nodes(graph):
"""
Return the cut-nodes of the given graph.
A cut node, or articulation point, is a node of a graph whose removal increases the number of
connected components in the graph.
@type graph: graph, hypergraph
@param graph: Graph.
@rtype: list
@retur... | [
"def",
"cut_nodes",
"(",
"graph",
")",
":",
"recursionlimit",
"=",
"getrecursionlimit",
"(",
")",
"setrecursionlimit",
"(",
"max",
"(",
"len",
"(",
"graph",
".",
"nodes",
"(",
")",
")",
"*",
"2",
",",
"recursionlimit",
")",
")",
"# Dispatch if we have a hype... | Return the cut-nodes of the given graph.
A cut node, or articulation point, is a node of a graph whose removal increases the number of
connected components in the graph.
@type graph: graph, hypergraph
@param graph: Graph.
@rtype: list
@return: List of cut-nodes. | [
"Return",
"the",
"cut",
"-",
"nodes",
"of",
"the",
"given",
"graph",
".",
"A",
"cut",
"node",
"or",
"articulation",
"point",
"is",
"a",
"node",
"of",
"a",
"graph",
"whose",
"removal",
"increases",
"the",
"number",
"of",
"connected",
"components",
"in",
"... | 1d3b846d53b5b5404edfe8ddb9083f9ceec8c5e7 | https://github.com/nerdvegas/rez/blob/1d3b846d53b5b5404edfe8ddb9083f9ceec8c5e7/src/rez/vendor/pygraph/algorithms/accessibility.py#L237-L288 |
232,598 | nerdvegas/rez | src/rez/vendor/pygraph/algorithms/accessibility.py | _cut_hypernodes | def _cut_hypernodes(hypergraph):
"""
Return the cut-nodes of the given hypergraph.
@type hypergraph: hypergraph
@param hypergraph: Hypergraph
@rtype: list
@return: List of cut-nodes.
"""
nodes_ = cut_nodes(hypergraph.graph)
nodes = []
for each in nodes_:
... | python | def _cut_hypernodes(hypergraph):
"""
Return the cut-nodes of the given hypergraph.
@type hypergraph: hypergraph
@param hypergraph: Hypergraph
@rtype: list
@return: List of cut-nodes.
"""
nodes_ = cut_nodes(hypergraph.graph)
nodes = []
for each in nodes_:
... | [
"def",
"_cut_hypernodes",
"(",
"hypergraph",
")",
":",
"nodes_",
"=",
"cut_nodes",
"(",
"hypergraph",
".",
"graph",
")",
"nodes",
"=",
"[",
"]",
"for",
"each",
"in",
"nodes_",
":",
"if",
"(",
"each",
"[",
"1",
"]",
"==",
"'n'",
")",
":",
"nodes",
"... | Return the cut-nodes of the given hypergraph.
@type hypergraph: hypergraph
@param hypergraph: Hypergraph
@rtype: list
@return: List of cut-nodes. | [
"Return",
"the",
"cut",
"-",
"nodes",
"of",
"the",
"given",
"hypergraph",
"."
] | 1d3b846d53b5b5404edfe8ddb9083f9ceec8c5e7 | https://github.com/nerdvegas/rez/blob/1d3b846d53b5b5404edfe8ddb9083f9ceec8c5e7/src/rez/vendor/pygraph/algorithms/accessibility.py#L291-L308 |
232,599 | nerdvegas/rez | src/rez/vendor/pygraph/classes/graph.py | graph.del_edge | def del_edge(self, edge):
"""
Remove an edge from the graph.
@type edge: tuple
@param edge: Edge.
"""
u, v = edge
self.node_neighbors[u].remove(v)
self.del_edge_labeling((u, v))
if (u != v):
self.node_neighbors[v].remove(u)
... | python | def del_edge(self, edge):
"""
Remove an edge from the graph.
@type edge: tuple
@param edge: Edge.
"""
u, v = edge
self.node_neighbors[u].remove(v)
self.del_edge_labeling((u, v))
if (u != v):
self.node_neighbors[v].remove(u)
... | [
"def",
"del_edge",
"(",
"self",
",",
"edge",
")",
":",
"u",
",",
"v",
"=",
"edge",
"self",
".",
"node_neighbors",
"[",
"u",
"]",
".",
"remove",
"(",
"v",
")",
"self",
".",
"del_edge_labeling",
"(",
"(",
"u",
",",
"v",
")",
")",
"if",
"(",
"u",
... | Remove an edge from the graph.
@type edge: tuple
@param edge: Edge. | [
"Remove",
"an",
"edge",
"from",
"the",
"graph",
"."
] | 1d3b846d53b5b5404edfe8ddb9083f9ceec8c5e7 | https://github.com/nerdvegas/rez/blob/1d3b846d53b5b5404edfe8ddb9083f9ceec8c5e7/src/rez/vendor/pygraph/classes/graph.py#L170-L182 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.