text stringlengths 81 112k |
|---|
The last element (optionally satisfying a predicate) or a default.
If the predicate is omitted or is None this query returns the last
element in the sequence; otherwise, it returns the last element in
the sequence for which the predicate evaluates to True. If there is no
such element th... |
Apply a function over a sequence to produce a single result.
Apply a binary function cumulatively to the elements of the source
sequence so as to reduce the iterable to a single value.
Note: This method uses immediate execution.
Args:
reducer: A binary function the first p... |
Elementwise combination of two sequences.
The source sequence and the second iterable are merged element-by-
element using a function to combine them into the single corresponding
element of the result sequence. The length of the result sequence is
equal to the length of the shorter of ... |
Convert the source sequence to a list.
Note: This method uses immediate execution.
def to_list(self):
'''Convert the source sequence to a list.
Note: This method uses immediate execution.
'''
if self.closed():
raise ValueError("Attempt to call to_list() on a closed... |
Convert the source sequence to a tuple.
Note: This method uses immediate execution.
def to_tuple(self):
'''Convert the source sequence to a tuple.
Note: This method uses immediate execution.
'''
if self.closed():
raise ValueError("Attempt to call to_tuple() on a cl... |
Convert the source sequence to a set.
Note: This method uses immediate execution.
Raises:
ValueError: If duplicate keys are in the projected source sequence.
ValueError: If the Queryable is closed().
def to_set(self):
'''Convert the source sequence to a set.
N... |
Returns a Lookup object, using the provided selector to generate a
key for each item.
Note: This method uses immediate execution.
def to_lookup(self, key_selector=identity, value_selector=identity):
'''Returns a Lookup object, using the provided selector to generate a
key for each item... |
Build a dictionary from the source sequence.
Args:
key_selector: A unary callable to extract a key from each item.
By default the key is the item itself.
value_selector: A unary callable to extract a value from each item.
By default the value is the item... |
Build a string from the source sequence.
The elements of the query result will each coerced to a string and then
the resulting strings concatenated to return a single string. This
allows the natural processing of character sequences as strings. An
optional separator which will be insert... |
Determine whether two sequences are equal by elementwise comparison.
Sequence equality is defined as the two sequences being equal length
and corresponding elements being equal as determined by the equality
comparer.
Note: This method uses immediate execution.
Args:
... |
Log query result consumption details to a logger.
Args:
logger: Any object which supports a debug() method which accepts a
str, such as a Python standard library logger object from the
logging module. If logger is not provided or is None, this
method... |
An inclusive prefix sum which returns the cumulative application of the
supplied function up to an including the current element.
Args:
func: An optional binary function which is commutative - that is,
the order of the arguments is unimportant. Defaults to a
... |
An exclusive prefix sum which returns the cumulative application of the
supplied function up to but excluding the current element.
Args:
func: An optional binary function which is commutative - that is,
the order of the arguments is unimportant. Defaults to a
... |
Introduce subsequent ordering to the sequence with an optional key.
The returned sequence will be sorted in ascending order by the
selected key.
Note: This method uses deferred execution.
Args:
key_selector: A unary function the only positional argument to
... |
Build a dictionary from the source sequence.
Args:
key_selector: A unary callable to extract a key from each item.
By default the key of the Grouping.
value_selector: A unary callable to extract a value from each item.
By default the value is the list of... |
Build a dictionary from the source sequence.
Args:
key_selector: A unary callable to extract a key from each item or None.
If None, the default key selector produces a single dictionary key, which
if the key of this Grouping.
value_selector: A unary call... |
Generates in sequence the integral numbers within a range.
Note: This method uses deferred execution.
Args:
start: The first integer in the sequence.
count: The number of sequential integers to generate.
Returns:
A Queryable over the specified range of integers.
Ra... |
Generate a sequence with one repeated value.
Note: This method uses deferred execution.
Args:
element: The value to be repeated.
count: The number of times to repeat the value.
Raises:
ValueError: If the count is negative.
def repeat(element, count):
'''Generate a s... |
Partition an iterable into chunks. Returns an iterator over partitions.
def geometric_partitions(iterable, floor=1, ceiling=32768):
'''
Partition an iterable into chunks. Returns an iterator over partitions.
'''
partition_size = floor
run_length = multiprocessing.cpu_count()
run_count =... |
Transforms each element of a sequence into a new form.
Each element is transformed through a selector function to produce a
value for each value in the source sequence. The generated sequence is
lazily evaluated.
Args:
selector: A unary function mapping a value in th... |
Transforms each element of a sequence into a new form, incorporating
the index of the element.
Each element is transformed through a selector function which accepts
the element value and its zero-based index in the source sequence. The
generated sequence is lazily evaluated.
... |
Projects each element of a sequence to an intermediate new sequence,
flattens the resulting sequence into one sequence and optionally
transforms the flattened sequence using a selector function.
Args:
projector: A unary function mapping each element of the source
... |
Transforms each element of a sequence into a new form.
Each element is transformed through a selector function to produce a
value for each value in the source sequence. The generated sequence is
lazily evaluated.
Args:
selector: A unary function mapping a value in th... |
Create a selector callable from the supplied value.
Args:
value: If is a callable, then returned unchanged. If a string is used
then create an attribute selector. If in an integer is used then
create a key selector.
Returns:
A callable selector based on the sup... |
add with carry
returns a two element tuple of the form (result, carry)
def adc(self, other : 'BitVector', carry : Bit) -> tp.Tuple['BitVector', Bit]:
"""
add with carry
returns a two element tuple of the form (result, carry)
"""
T = type(self)
other = _coerce(... |
Take a path with $HOME variables and resolve it to full path.
def convert(self, value, *args, **kwargs): # pylint: disable=arguments-differ
"""Take a path with $HOME variables and resolve it to full path."""
value = os.path.expanduser(value)
return super(ExpandPath, self).convert(value, *args,... |
Make a table from headers and rows.
def make_table(headers=None, rows=None):
"""Make a table from headers and rows."""
if callable(headers):
headers = headers()
if callable(rows):
rows = rows()
assert isinstance(headers, list)
assert isinstance(rows, list)
assert all(len(row) ==... |
This is a decorator that converts a paramaterized decorator for
no-param use.
source: http://stackoverflow.com/questions/3888158
def _dual_decorator(func):
"""This is a decorator that converts a paramaterized decorator for
no-param use.
source: http://stackoverflow.com/questions/3888158
"""
... |
Usage: help [<command>]
With no arguments, print the form of all supported commands.
With an argument, print a detailed explanation of a command.
def help(opts, bot, _):
"""Usage: help [<command>]
With no arguments, print the form of all supported commands.
With an argument, print a detailed expl... |
A decorator to convert a function to a command.
A command's docstring must be a docopt usage string.
See docopt.org for what it supports.
Commands receive three arguments:
* opts: a dictionary output by docopt
* bot: the Bot instance handling the command (eg for storing st... |
Return a slack-formatted list of commands with their usage.
def help_text(cls):
"""Return a slack-formatted list of commands with their usage."""
docs = [cmd_func.__doc__ for cmd_func in cls.commands.values()]
# Don't want to include 'usage: ' or explanation.
usage_lines = [doc.partiti... |
Run the bot, blocking forever.
def run_forever(self):
"""Run the bot, blocking forever."""
res = self.slack.rtm.start()
self.log.info("current channels: %s",
','.join(c['name'] for c in res.body['channels']
if c['is_member']))
self.id... |
Return the identifier used to address this bot in this message.
If one is not found, return None.
:param message: a message dict from the slack api.
def _bot_identifier(self, message):
"""Return the identifier used to address this bot in this message.
If one is not found, return None.
... |
Either send a message (choosing between rtm and postMessage) or ignore the response.
:param event: a slacker event dict
:param res: a string, a dict, or None.
See the command docstring for what these represent.
def _handle_command_response(self, res, event):
"""Either send a message ... |
Splits messages that are too long into multiple events
:param res: a slack response string or dict
def _handle_long_response(self, res):
"""Splits messages that are too long into multiple events
:param res: a slack response string or dict
"""
is_rtm_message = isinstance(res, ba... |
Send a Slack message to a channel over RTM.
:param channel_id: a slack channel id.
:param text: a slack message. Serverside formatting is done
in a similar way to normal user message; see
`Slack's docs <https://api.slack.com/docs/formatting>`__.
def _send_rtm_message(self, channel_... |
Send a Slack message via the chat.postMessage api.
:param message: a dict of kwargs to be passed to slacker.
def _send_api_message(self, message):
"""Send a Slack message via the chat.postMessage api.
:param message: a dict of kwargs to be passed to slacker.
"""
self.slack.ch... |
Iterate across the complete set of child validators.
def _validators(self):
"""Iterate across the complete set of child validators."""
for validator in self.__validators__.values():
yield validator
if self.validators:
for validator in self.validators:
yield validator |
Get a suitable user agent for identifying the CLI process.
def make_user_agent(prefix=None):
"""Get a suitable user agent for identifying the CLI process."""
prefix = (prefix or platform.platform(terse=1)).strip().lower()
return "cloudsmith-cli/%(prefix)s cli:%(version)s api:%(api_version)s" % {
"v... |
Pretty print list info, with pagination, for user display.
def pretty_print_list_info(num_results, page_info=None, suffix=None):
"""Pretty print list info, with pagination, for user display."""
num_results_fg = "green" if num_results else "red"
num_results_text = click.style(str(num_results), fg=num_result... |
Pretty print a table from headers and rows.
def pretty_print_table(headers, rows):
"""Pretty print a table from headers and rows."""
table = make_table(headers=headers, rows=rows)
pretty_print_table_instance(table) |
Pretty print a table instance.
def pretty_print_table_instance(table):
"""Pretty print a table instance."""
assert isinstance(table, Table)
def pretty_print_row(styled, plain):
"""Pretty print a row."""
click.secho(
" | ".join(
v + " " * (table.column_widths[k] ... |
Tell the user when we're being rate limited.
def print_rate_limit_info(opts, rate_info, atexit=False):
"""Tell the user when we're being rate limited."""
if not rate_info:
return
show_info = (
opts.always_show_rate_limit
or atexit
or rate_info.interval > opts.rate_limit_war... |
Maybe print data as JSON.
def maybe_print_as_json(opts, data, page_info=None):
"""Maybe print data as JSON."""
if opts.output not in ("json", "pretty_json"):
return False
root = {"data": data}
if page_info is not None and page_info.is_valid:
meta = root["meta"] = {}
meta["pagi... |
Prompt the user for confirmation for dangerous actions.
def confirm_operation(prompt, prefix=None, assume_yes=False, err=False):
"""Prompt the user for confirmation for dangerous actions."""
if assume_yes:
return True
prefix = prefix or click.style(
"Are you %s certain you want to" % (clic... |
Ensure that login is not blank.
def validate_login(ctx, param, value):
"""Ensure that login is not blank."""
# pylint: disable=unused-argument
value = value.strip()
if not value:
raise click.BadParameter("The value cannot be blank.", param=param)
return value |
Create default config files.
def create_config_files(ctx, opts, api_key):
"""Create default config files."""
# pylint: disable=unused-argument
config_reader = opts.get_config_reader()
creds_reader = opts.get_creds_reader()
has_config = config_reader.has_default_file()
has_creds = creds_reader.h... |
Retrieve your API authentication token/key.
def token(ctx, opts, login, password):
"""Retrieve your API authentication token/key."""
click.echo(
"Retrieving API token for %(login)s ... "
% {"login": click.style(login, bold=True)},
nl=False,
)
context_msg = "Failed to retrieve t... |
Get the synchronisation status for a package.
- OWNER/REPO/PACKAGE: Specify the OWNER namespace (i.e. user or org), the
REPO name where the package is stored, and the PACKAGE name (slug) of the
package itself. All separated by a slash.
Example: 'your-org/awesome-repo/better-pkg'.
def status(ctx, opts... |
Map positional to keyword arguments, identify invalid assignments, and return the result.
This is likely generic enough to be useful as a standalone utility function, and goes to a fair amount of
effort to ensure raised exceptions are as Python-like as possible.
def _process_arguments(self, args, kw):
"""Map ... |
Usage:
import_and_wrap_deprecated('conda.common.connection', locals())
# looks for conda.common.connection.__all__
def import_and_wrap_deprecated(module_name, module_dict, warn_import=True):
"""
Usage:
import_and_wrap_deprecated('conda.common.connection', locals())
# looks for c... |
Usage:
deprecate_module_with_proxy(__name__, locals()) # at bottom of module
def deprecate_module_with_proxy(module_name, module_dict, deprecated_attributes=None):
"""
Usage:
deprecate_module_with_proxy(__name__, locals()) # at bottom of module
"""
def _ModuleProxy(module, depr):
... |
Convert a foreign value to a native boolean.
def native(self, value, context=None):
"""Convert a foreign value to a native boolean."""
value = super().native(value, context)
if self.none and (value is None):
return None
try:
value = value.lower()
except AttributeError:
return bool(value)
... |
Convert a native value to a textual boolean.
def foreign(self, value, context=None):
"""Convert a native value to a textual boolean."""
if self.none and value is None:
return ''
try:
value = self.native(value, context)
except Concern:
# The value might not be in the lists; bool() evaluate it ins... |
Get the root path for the application.
def get_root_path():
"""Get the root path for the application."""
root_path = __file__
return os.path.dirname(os.path.realpath(root_path)) |
Read the specific file into a string in its entirety.
def read(path, root_path=None):
"""Read the specific file into a string in its entirety."""
try:
root_path = root_path or get_root_path()
real_path = os.path.realpath(os.path.join(root_path, path))
with open(real_path) as fp:
... |
Grok the readme, turn it into whine (rst).
def get_long_description():
"""Grok the readme, turn it into whine (rst)."""
root_path = get_root_path()
readme_path = os.path.join(root_path, "README.md")
try:
import pypandoc
return pypandoc.convert(readme_path, "rst").strip()
except Im... |
Random vector from the n-Sphere
This function will return a random vector which is an element of the n-Sphere.
The n-Sphere is defined as a vector in R^n+1 with a norm of one.
Basically, we'll find a random vector in R^n+1 and normalize it.
This uses the method of Marsaglia 1972.
Parameters
... |
Find a random vector in the tangent space of the n sphere
This function will find a random orthogonal vector to q.
Parameters
----------
q
(n+1,) array which is in the n-sphere
Returns
-------
qd
(n+1,) array which is orthogonal to n-sphere and also random
def tan_rand(q,... |
r"""Perturb a vector randomly
qp = perturb_vec(q, cone_half_angle=2)
Parameters
----------
q : (n,) numpy array
Vector to perturb
cone_half_angle : float
Maximum angle to perturb the vector in degrees
Returns
-------
perturbed : (n,) numpy array
Perturbed numpy... |
Add common options for package actions.
def common_package_action_options(f):
"""Add common options for package actions."""
@click.option(
"-s",
"--skip-errors",
default=False,
is_flag=True,
help="Skip/ignore errors when copying packages.",
)
@click.option(
... |
Add common CLI config options to commands.
def common_cli_config_options(f):
"""Add common CLI config options to commands."""
@click.option(
"-C",
"--config-file",
envvar="CLOUDSMITH_CONFIG_FILE",
type=click.Path(dir_okay=True, exists=True, writable=False, resolve_path=True),
... |
Add common CLI output options to commands.
def common_cli_output_options(f):
"""Add common CLI output options to commands."""
@click.option(
"-d",
"--debug",
default=False,
is_flag=True,
help="Produce debug output during processing.",
)
@click.option(
"-... |
Add common list options to commands.
def common_cli_list_options(f):
"""Add common list options to commands."""
@click.option(
"-p",
"--page",
default=1,
type=int,
help="The page to view for lists, where 1 is the first page",
callback=validators.validate_page,
... |
Add common API authentication options to commands.
def common_api_auth_options(f):
"""Add common API authentication options to commands."""
@click.option(
"-k",
"--api-key",
hide_input=True,
envvar="CLOUDSMITH_API_KEY",
help="The API key for authenticating with the API.... |
Initialise the Cloudsmith API for use.
def initialise_api(f):
"""Initialise the Cloudsmith API for use."""
@click.option(
"--api-host", envvar="CLOUDSMITH_API_HOST", help="The API host to connect to."
)
@click.option(
"--api-proxy",
envvar="CLOUDSMITH_API_PROXY",
help="... |
Get a list of entitlements on a repository.
def list_entitlements(owner, repo, page, page_size, show_tokens):
"""Get a list of entitlements on a repository."""
client = get_entitlements_api()
with catch_raise_api_exception():
data, _, headers = client.entitlements_list_with_http_info(
... |
Create an entitlement in a repository.
def create_entitlement(owner, repo, name, token, show_tokens):
"""Create an entitlement in a repository."""
client = get_entitlements_api()
data = {}
if name is not None:
data["name"] = name
if token is not None:
data["token"] = token
wi... |
Delete an entitlement from a repository.
def delete_entitlement(owner, repo, identifier):
"""Delete an entitlement from a repository."""
client = get_entitlements_api()
with catch_raise_api_exception():
_, _, headers = client.entitlements_delete_with_http_info(
owner=owner, repo=repo, ... |
Update an entitlement in a repository.
def update_entitlement(owner, repo, identifier, name, token, show_tokens):
"""Update an entitlement in a repository."""
client = get_entitlements_api()
data = {}
if name is not None:
data["name"] = name
if token is not None:
data["token"] = t... |
Refresh an entitlement in a repository.
def refresh_entitlement(owner, repo, identifier, show_tokens):
"""Refresh an entitlement in a repository."""
client = get_entitlements_api()
with catch_raise_api_exception():
data, _, headers = client.entitlements_refresh_with_http_info(
owner=ow... |
Sync entitlements from another repository.
def sync_entitlements(owner, repo, source, show_tokens):
"""Sync entitlements from another repository."""
client = get_entitlements_api()
with catch_raise_api_exception():
data, _, headers = client.entitlements_sync_with_http_info(
owner=owner... |
Initialise the API.
def initialise_api(
debug=False,
host=None,
key=None,
proxy=None,
user_agent=None,
headers=None,
rate_limit=True,
rate_limit_callback=None,
error_retry_max=None,
error_retry_backoff=None,
error_retry_codes=None,
):
"""Initialise the API."""
config... |
Get an API client (with configuration).
def get_api_client(cls):
"""Get an API client (with configuration)."""
config = cloudsmith_api.Configuration()
client = cls()
client.config = config
client.api_client.rest_client = RestClient()
user_agent = getattr(config, "user_agent", None)
if user... |
Configure a new API key.
def set_api_key(config, key):
"""Configure a new API key."""
if not key and "X-Api-Key" in config.api_key:
del config.api_key["X-Api-Key"]
else:
config.api_key["X-Api-Key"] = key |
Validate parameters for requesting a file upload.
def validate_request_file_upload(owner, repo, filepath, md5_checksum=None):
"""Validate parameters for requesting a file upload."""
client = get_files_api()
md5_checksum = md5_checksum or calculate_file_md5(filepath)
with catch_raise_api_exception():
... |
Request a new package file upload (for creating packages).
def request_file_upload(owner, repo, filepath, md5_checksum=None):
"""Request a new package file upload (for creating packages)."""
client = get_files_api()
md5_checksum = md5_checksum or calculate_file_md5(filepath)
with catch_raise_api_excep... |
Upload a pre-signed file to Cloudsmith.
def upload_file(upload_url, upload_fields, filepath, callback=None):
"""Upload a pre-signed file to Cloudsmith."""
upload_fields = list(six.iteritems(upload_fields))
upload_fields.append(
("file", (os.path.basename(filepath), click.open_file(filepath, "rb")))... |
Context manager that handles API exceptions.
def handle_api_exceptions(
ctx, opts, context_msg=None, nl=False, exit_on_error=True, reraise_on_error=False
):
"""Context manager that handles API exceptions."""
# flake8: ignore=C901
# Use stderr for messages if the output is something else (e.g. # JSON)
... |
Get the details from the exception.
def get_details(exc):
"""Get the details from the exception."""
detail = None
fields = collections.OrderedDict()
if exc.detail:
detail = exc.detail
if exc.fields:
for k, v in six.iteritems(exc.fields):
try:
field_deta... |
Get a hint to show to the user (if any).
def get_error_hint(ctx, opts, exc):
"""Get a hint to show to the user (if any)."""
module = sys.modules[__name__]
get_specific_error_hint = getattr(module, "get_%s_error_hint" % exc.status, None)
if get_specific_error_hint:
return get_specific_error_hint... |
Creates an environment key-equivalent for the given key
def make_env_key(app_name, key):
"""Creates an environment key-equivalent for the given key"""
key = key.replace('-', '_').replace(' ', '_')
return str("_".join((x.upper() for x in (app_name, key)))) |
Sets environment variables by prepending the app_name to `key`. Also registers the
environment variable with the instance object preventing an otherwise-required call to
`reload()`.
def set_env(self, key, value):
"""Sets environment variables by prepending the app_name to `key`. Also registers ... |
Removes an environment variable using the prepended app_name convention with `key`.
def unset_env(self, key):
"""Removes an environment variable using the prepended app_name convention with `key`."""
os.environ.pop(make_env_key(self.appname, key), None)
self._registered_env_keys.discard(key)
... |
Reloads the configuration from the file and environment variables. Useful if using
`os.environ` instead of this class' `set_env` method, or if the underlying configuration
file is changed externally.
def _reload(self, force=False):
"""Reloads the configuration from the file and environment vari... |
Move (promote) a package to another repo.
This requires appropriate permissions for both the source
repository/package and the destination repository.
- OWNER/REPO/PACKAGE: Specify the OWNER namespace (i.e. user or org), the
REPO name where the package is stored, and the PACKAGE name (slug) of the
... |
Create a requests session that retries some errors.
def create_requests_session(
retries=None,
backoff_factor=None,
status_forcelist=None,
pools_size=4,
maxsize=4,
ssl_verify=None,
ssl_cert=None,
proxy=None,
session=None,
):
"""Create a requests session that retries some errors.... |
Get the content for the response (lazily decoded).
def data(self):
"""
Get the content for the response (lazily decoded).
"""
if self._data is None:
self._data = self.response.content.decode("utf-8")
return self._data |
Return a given response header.
def getheader(self, name, default=None):
"""
Return a given response header.
"""
return self.response.headers.get(name, default) |
:param method: http request method
:param url: http request url
:param query_params: query parameters in the url
:param headers: http request headers
:param body: request json body, for `application/json`
:param post_params: request post parameters,
`a... |
Get the root directory for the application.
def get_root_path():
"""Get the root directory for the application."""
return os.path.realpath(os.path.join(os.path.dirname(__file__), os.pardir)) |
Read the specific file into a string in its entirety.
def read_file(*path):
"""Read the specific file into a string in its entirety."""
real_path = os.path.realpath(os.path.join(*path))
with click.open_file(real_path, "r") as fp:
return fp.read() |
Calculate an MD5 hash for a file.
def calculate_file_md5(filepath, blocksize=2 ** 20):
"""Calculate an MD5 hash for a file."""
checksum = hashlib.md5()
with click.open_file(filepath, "rb") as f:
def update_chunk():
"""Add chunk to checksum."""
buf = f.read(blocksize)
... |
Construct page and page size kwargs (if present).
def get_page_kwargs(**kwargs):
"""Construct page and page size kwargs (if present)."""
page_kwargs = {}
page = kwargs.get("page")
if page is not None and page > 0:
page_kwargs["page"] = page
page_size = kwargs.get("page_size")
if page_... |
Construct page and page size kwargs (if present).
def get_query_kwargs(**kwargs):
"""Construct page and page size kwargs (if present)."""
query_kwargs = {}
query = kwargs.pop("query")
if query:
query_kwargs["query"] = query
return query_kwargs |
Return a PEP440-compliant version derived from the git status.
If that fails for any reason, return the changeset hash.
def _get_version_from_git_tag(path):
"""Return a PEP440-compliant version derived from the git status.
If that fails for any reason, return the changeset hash.
"""
m = GIT_DESCRIB... |
Returns a version string for the current package, derived
either from git or from a .version file.
This function is expected to run in two contexts. In a development
context, where .git/ exists, the version is pulled from git tags.
Using the BuildPyCommand and SDistCommand classes for cmdclass in
s... |
Counts the time spent in some context
def ctime(message=None):
"Counts the time spent in some context"
global t_elapsed
t_elapsed = 0.0
print('\n')
t = time.time()
yield
if message:
print(message + ": ", end='')
t_elapsed = time.time() - t
print(round(t_elapsed, 4), "sec") |
Euler rotation about first axis
This computes the rotation matrix associated with a rotation about the first
axis. It will output matrices assuming column or row format vectors.
For example, to transform a vector from reference frame b to reference frame a:
Column Vectors : a = rot1(angle, 'c').dot(... |
Convert DCM to body Euler 3-1-3 angles
def dcm2body313(dcm):
"""Convert DCM to body Euler 3-1-3 angles
"""
theta = np.zeros(3)
theta[0] = np.arctan2(dcm[2, 0], dcm[2, 1])
theta[1] = np.arccos(dcm[2, 2])
theta[2] = np.arctan2(dcm[0, 2], -dcm[1, 2])
return theta |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.