Search is not available for this dataset
text stringlengths 75 104k |
|---|
def get_stack_data(self, frame, traceback, event_type):
"""Get the stack frames data at each of the hooks above (Ie. for each
line of the Python code)"""
heap_data = Heap(self.options)
stack_data = StackFrames(self.options)
stack_frames, cur_frame_ind = self.get_stack(frame, trac... |
def filter_dict(d, exclude):
"""Return a new dict with specified keys excluded from the origional dict
Args:
d (dict): origional dict
exclude (list): The keys that are excluded
"""
ret = {}
for key, value in d.items():
if key not in exclude:
ret.update({key: valu... |
def redirect_stdout(new_stdout):
"""Redirect the stdout
Args:
new_stdout (io.StringIO): New stdout to use instead
"""
old_stdout, sys.stdout = sys.stdout, new_stdout
try:
yield None
finally:
sys.stdout = old_stdout |
def format(obj, options):
"""Return a string representation of the Python object
Args:
obj: The Python object
options: Format options
"""
formatters = {
float_types: lambda x: '{:.{}g}'.format(x, options.digits),
}
for _types, fmtr in formatters.items():
if isins... |
def get_type_info(obj):
"""Get type information for a Python object
Args:
obj: The Python object
Returns:
tuple: (object type "catagory", object type name)
"""
if isinstance(obj, primitive_types):
return ('primitive', type(obj).__name__)
if isinstance(obj, sequence_type... |
def refresh(self):
"""
Reloads the wallet and its accounts. By default, this method is called only once,
on :class:`Wallet` initialization. When the wallet is accessed by multiple clients or
exists in multiple instances, calling `refresh()` will be necessary to update
the list of... |
def spend_key(self):
"""
Returns private spend key. None if wallet is view-only.
:rtype: str or None
"""
key = self._backend.spend_key()
if key == numbers.EMPTY_KEY:
return None
return key |
def new_account(self, label=None):
"""
Creates new account, appends it to the :class:`Wallet`'s account list and returns it.
:param label: account label as `str`
:rtype: :class:`Account`
"""
acc, addr = self._backend.new_account(label=label)
assert acc.index == l... |
def confirmations(self, txn_or_pmt):
"""
Returns the number of confirmations for given
:class:`Transaction <monero.transaction.Transaction>` or
:class:`Payment <monero.transaction.Payment>` object.
:rtype: int
"""
if isinstance(txn_or_pmt, Payment):
t... |
def get_address(self, major, minor):
"""
Calculates sub-address for account index (`major`) and address index within
the account (`minor`).
:rtype: :class:`BaseAddress <monero.address.BaseAddress>`
"""
# ensure indexes are within uint32
if major < 0 or major >= 2... |
def transfer(self, address, amount,
priority=prio.NORMAL, payment_id=None, unlock_time=0,
relay=True):
"""
Sends a transfer from the default account. Returns a list of resulting transactions.
:param address: destination :class:`Address <monero.address.Address>` or subtyp... |
def transfer_multiple(self, destinations,
priority=prio.NORMAL, payment_id=None, unlock_time=0,
relay=True):
"""
Sends a batch of transfers from the default account. Returns a list of resulting
transactions.
:param destinations: a list of destination and amount p... |
def balance(self, unlocked=False):
"""
Returns specified balance.
:param unlocked: if `True`, return the unlocked balance, otherwise return total balance
:rtype: Decimal
"""
return self._backend.balances(account=self.index)[1 if unlocked else 0] |
def new_address(self, label=None):
"""
Creates a new address.
:param label: address label as `str`
:rtype: :class:`SubAddress <monero.address.SubAddress>`
"""
return self._backend.new_address(account=self.index, label=label) |
def transfer(self, address, amount,
priority=prio.NORMAL, payment_id=None, unlock_time=0,
relay=True):
"""
Sends a transfer. Returns a list of resulting transactions.
:param address: destination :class:`Address <monero.address.Address>` or subtype
:param amount: ... |
def transfer_multiple(self, destinations,
priority=prio.NORMAL, payment_id=None, unlock_time=0,
relay=True):
"""
Sends a batch of transfers. Returns a list of resulting transactions.
:param destinations: a list of destination and amount pairs:
[(:clas... |
def to_atomic(amount):
"""Convert Monero decimal to atomic integer of piconero."""
if not isinstance(amount, (Decimal, float) + _integer_types):
raise ValueError("Amount '{}' doesn't have numeric type. Only Decimal, int, long and "
"float (not recommended) are accepted as amounts.")
... |
def _validate_checksum(self):
"""Given a mnemonic word string, confirm seed checksum (last word) matches the computed checksum.
:rtype: bool
"""
phrase = self.phrase.split(" ")
if self.word_list.get_checksum(self.phrase) == phrase[-1]:
return True
raise Value... |
def public_address(self, net='mainnet'):
"""Returns the master :class:`Address <monero.address.Address>` represented by the seed.
:param net: the network, one of 'mainnet', 'testnet', 'stagenet'. Default is 'mainnet'.
:rtype: :class:`Address <monero.address.Address>`
"""
if net... |
def address(addr, label=None):
"""Discover the proper class and return instance for a given Monero address.
:param addr: the address as a string-like object
:param label: a label for the address (defaults to `None`)
:rtype: :class:`Address`, :class:`SubAddress` or :class:`IntegratedAddress`
"""
... |
def with_payment_id(self, payment_id=0):
"""Integrates payment id into the address.
:param payment_id: int, hexadecimal string or :class:`PaymentID <monero.numbers.PaymentID>`
(max 64-bit long)
:rtype: `IntegratedAddress`
:raises: `TypeError` if the payment id is to... |
def base_address(self):
"""Returns the base address without payment id.
:rtype: :class:`Address`
"""
prefix = 53 if self.is_testnet() else 24 if self.is_stagenet() else 18
data = bytearray([prefix]) + self._decoded[1:65]
checksum = keccak_256(data).digest()[:4]
re... |
def encode(hex):
'''Encode hexadecimal string as base58 (ex: encoding a Monero address).'''
data = _hexToBin(hex)
l_data = len(data)
if l_data == 0:
return ""
full_block_count = l_data // __fullBlockSize
last_block_size = l_data % __fullBlockSize
res_size = full_block_count * __ful... |
def decode(enc):
'''Decode a base58 string (ex: a Monero address) into hexidecimal form.'''
enc = bytearray(enc, encoding='ascii')
l_enc = len(enc)
if l_enc == 0:
return ""
full_block_count = l_enc // __fullEncodedBlockSize
last_block_size = l_enc % __fullEncodedBlockSize
try:
... |
def encode(cls, hex):
"""Convert hexadecimal string to mnemonic word representation with checksum.
"""
out = []
for i in range(len(hex) // 8):
word = endian_swap(hex[8*i:8*i+8])
x = int(word, 16)
w1 = x % cls.n
w2 = (x // cls.n + w1) % cls.... |
def decode(cls, phrase):
"""Calculate hexadecimal representation of the phrase.
"""
phrase = phrase.split(" ")
out = ""
for i in range(len(phrase) // 3):
word1, word2, word3 = phrase[3*i:3*i+3]
w1 = cls.word_list.index(word1)
w2 = cls.word_list... |
def get_checksum(cls, phrase):
"""Given a mnemonic word string, return a string of the computed checksum.
:rtype: str
"""
phrase_split = phrase.split(" ")
if len(phrase_split) < 12:
raise ValueError("Invalid mnemonic phrase")
if len(phrase_split) > 13:
... |
def send_transaction(self, tx, relay=True):
"""
Sends a transaction generated by a :class:`Wallet <monero.wallet.Wallet>`.
:param tx: :class:`Transaction <monero.transaction.Transaction>`
:param relay: whether to relay the transaction to peers. If `False`, the daemon will have
... |
def one(prompt, *args, **kwargs):
"""Instantiates a picker, registers custom handlers for going back,
and starts the picker.
"""
indicator = '‣'
if sys.version_info < (3, 0):
indicator = '>'
def go_back(picker):
return None, -1
options, verbose_options = prepare_options(arg... |
def many(prompt, *args, **kwargs):
"""Calls `pick` in a while loop to allow user to pick many
options. Returns a list of chosen options.
"""
def get_options(options, chosen):
return [options[i] for i, c in enumerate(chosen) if c]
def get_verbose_options(verbose_options, chosen):
no,... |
def prepare_options(options):
"""Create options and verbose options from strings and non-string iterables in
`options` array.
"""
options_, verbose_options = [], []
for option in options:
if is_string(option):
options_.append(option)
verbose_options.append(option)
... |
def raw(prompt, *args, **kwargs):
"""Calls input to allow user to input an arbitrary string. User can go
back by entering the `go_back` string. Works in both Python 2 and 3.
"""
go_back = kwargs.get('go_back', '<')
type_ = kwargs.get('type', str)
default = kwargs.get('default', '')
with stdo... |
def stdout_redirected(to):
"""Lifted from: https://stackoverflow.com/questions/4675728/redirect-stdout-to-a-file-in-python
This is the only way I've found to redirect stdout with curses. This way the
output from questionnaire can be piped to another program, without piping
what's written to the termina... |
def exit_on_keyboard_interrupt(f):
"""Decorator that allows user to exit script by sending a keyboard interrupt
(ctrl + c) without raising an exception.
"""
@wraps(f)
def wrapper(*args, **kwargs):
raise_exception = kwargs.pop('raise_exception', False)
try:
return f(*args,... |
def get_operator(self, op):
"""Assigns function to the operators property of the instance.
"""
if op in self.OPERATORS:
return self.OPERATORS.get(op)
try:
n_args = len(inspect.getargspec(op)[0])
if n_args != 2:
raise TypeError
e... |
def assign_prompter(self, prompter):
"""If you want to change the core prompters registry, you can
override this method in a Question subclass.
"""
if is_string(prompter):
if prompter not in prompters:
eprint("Error: '{}' is not a core prompter".format(prompte... |
def add(self, *args, **kwargs):
"""Add a Question instance to the questions dict. Each key points
to a list of Question instances with that key. Use the `question`
kwarg to pass a Question instance if you want, or pass in the same
args you would pass to instantiate a question.
""... |
def ask(self, error=None):
"""Asks the next question in the questionnaire and returns the answer,
unless user goes back.
"""
q = self.next_question
if q is None:
return
try:
answer = q.prompter(self.get_prompt(q, error), *q.prompter_args, **q.prom... |
def next_question(self):
"""Returns the next `Question` in the questionnaire, or `None` if there
are no questions left. Returns first question for whose key there is no
answer and for which condition is satisfied, or for which there is no
condition.
"""
for key, questions... |
def check_condition(self, condition):
"""Helper that returns True if condition is satisfied/doesn't exist.
"""
if not condition:
return True
for c in condition.conditions:
key, value, operator = c
if not operator(self.answers[key], value):
... |
def go_back(self, n=1):
"""Move `n` questions back in the questionnaire by removing the last `n`
answers.
"""
if not self.can_go_back:
return
N = max(len(self.answers)-abs(n), 0)
self.answers = OrderedDict(islice(self.answers.items(), N)) |
def format_answers(self, fmt='obj'):
"""Formats answers depending on `fmt`.
"""
fmts = ('obj', 'array', 'plain')
if fmt not in fmts:
eprint("Error: '{}' not in {}".format(fmt, fmts))
return
def stringify(val):
if type(val) in (list, tuple):
... |
def answer_display(self, s=''):
"""Helper method for displaying the answers so far.
"""
padding = len(max(self.questions.keys(), key=len)) + 5
for key in list(self.answers.keys()):
s += '{:>{}} : {}\n'.format(key, padding, self.answers[key])
return s |
def add_intent(self, name, lines, reload_cache=False):
"""
Creates a new intent, optionally checking the cache first
Args:
name (str): The associated name of the intent
lines (list<str>): All the sentences that should activate the intent
reload_cache: Whether... |
def add_entity(self, name, lines, reload_cache=False):
"""
Adds an entity that matches the given lines.
Example:
self.add_intent('weather', ['will it rain on {weekday}?'])
self.add_entity('{weekday}', ['monday', 'tuesday', 'wednesday']) # ...
Args:
... |
def load_entity(self, name, file_name, reload_cache=False):
"""
Loads an entity, optionally checking the cache first
Args:
name (str): The associated name of the entity
file_name (str): The location of the entity file
reload_cache (bool): Whether to refresh all of... |
def load_intent(self, name, file_name, reload_cache=False):
"""
Loads an intent, optionally checking the cache first
Args:
name (str): The associated name of the intent
file_name (str): The location of the intent file
reload_cache (bool): Whether to refresh a... |
def remove_intent(self, name):
"""Unload an intent"""
self.intents.remove(name)
self.padaos.remove_intent(name)
self.must_train = True |
def remove_entity(self, name):
"""Unload an entity"""
self.entities.remove(name)
self.padaos.remove_entity(name) |
def train(self, debug=True, force=False, single_thread=False, timeout=20):
"""
Trains all the loaded intents that need to be updated
If a cache file exists with the same hash as the intent file,
the intent will not be trained and just loaded from file
Args:
debug (bo... |
def train_subprocess(self, *args, **kwargs):
"""
Trains in a subprocess which provides a timeout guarantees everything shuts down properly
Args:
See <train>
Returns:
bool: True for success, False if timed out
"""
ret = call([
sys.execu... |
def calc_intents(self, query):
"""
Tests all the intents against the query and returns
data on how well each one matched against the query
Args:
query (str): Input sentence to test against intents
Returns:
list<MatchData>: List of intent matches
S... |
def calc_intent(self, query):
"""
Tests all the intents against the query and returns
match data of the best intent
Args:
query (str): Input sentence to test against intents
Returns:
MatchData: Best intent match
"""
matches = self.calc_int... |
def expand(self):
"""
Creates a combination of all sub-sentences.
Returns:
List<List<str>>: A list with all subsentence expansions combined in
every possible way
"""
old_expanded = [[]]
for sub in self._tree:
... |
def expand(self):
"""
Returns all of its options as seperated sub-sentences.
Returns:
List<List<str>>: A list containing the sentences created by all
expansions of its sub-sentences
"""
options = []
for option in self.... |
def _parse_expr(self):
"""
Generate sentence token trees from the current position to
the next closing parentheses / end of the list and return it
['1', '(', '2', '|', '3, ')'] -> ['1', [['2'], ['3']]]
['2', '|', '3'] -> [['2'], ['3']]
"""
# List of all gen... |
def _train_and_save(obj, cache, data, print_updates):
"""Internal pickleable function used to train objects in another process"""
obj.train(data)
if print_updates:
print('Regenerated ' + obj.name + '.')
obj.save(cache) |
def wrap_name(name):
"""Wraps SkillName:entity into SkillName:{entity}"""
if ':' in name:
parts = name.split(':')
intent_name, ent_name = parts[0], parts[1:]
return intent_name + ':{' + ':'.join(ent_name) + '}'
else:
return '{' + name + '}' |
def lines_hash(lines):
"""
Creates a unique binary id for the given lines
Args:
lines (list<str>): List of strings that should be collectively hashed
Returns:
bytearray: Binary hash
"""
x = xxh32()
for i in lines:
x.update(i.encode())
return x.digest() |
def tokenize(sentence):
"""
Converts a single sentence into a list of individual significant units
Args:
sentence (str): Input string ie. 'This is a sentence.'
Returns:
list<str>: List of tokens ie. ['this', 'is', 'a', 'sentence']
"""
tokens = []
class Vars:
start_po... |
def resolve_conflicts(inputs, outputs):
"""
Checks for duplicate inputs and if there are any,
remove one and set the output to the max of the two outputs
Args:
inputs (list<list<float>>): Array of input vectors
outputs (list<list<float>>): Array of output vectors
Returns:
tup... |
def main(src, pyi_dir, target_dir, incremental, quiet, replace_any, hg, traceback):
"""Re-apply type annotations from .pyi stubs to your codebase."""
Config.incremental = incremental
Config.replace_any = replace_any
returncode = 0
for src_entry in src:
for file, error, exc_type, tb in retype... |
def retype_path(
src, pyi_dir, targets, *, src_explicitly_given=False, quiet=False, hg=False
):
"""Recursively retype files or directories given. Generate errors."""
if src.is_dir():
for child in src.iterdir():
if child == pyi_dir or child == targets:
continue
... |
def retype_file(src, pyi_dir, targets, *, quiet=False, hg=False):
"""Retype `src`, finding types in `pyi_dir`. Save in `targets`.
The file should remain formatted exactly as it was before, save for:
- annotations
- additional imports needed to satisfy annotations
- additional module-level names nee... |
def lib2to3_parse(src_txt):
"""Given a string with source, return the lib2to3 Node."""
grammar = pygram.python_grammar_no_print_statement
drv = driver.Driver(grammar, pytree.convert)
if src_txt[-1] != '\n':
nl = '\r\n' if '\r\n' in src_txt[:1024] else '\n'
src_txt += nl
try:
... |
def lib2to3_unparse(node, *, hg=False):
"""Given a lib2to3 node, return its string representation."""
code = str(node)
if hg:
from retype_hgext import apply_job_security
code = apply_job_security(code)
return code |
def reapply_all(ast_node, lib2to3_node):
"""Reapplies the typed_ast node into the lib2to3 tree.
Also does post-processing. This is done in reverse order to enable placing
TypeVars and aliases that depend on one another.
"""
late_processing = reapply(ast_node, lib2to3_node)
for lazy_func in reve... |
def fix_remaining_type_comments(node):
"""Converts type comments in `node` to proper annotated assignments."""
assert node.type == syms.file_input
last_n = None
for n in node.post_order():
if last_n is not None:
if n.type == token.NEWLINE and is_assignment(last_n):
f... |
def get_function_signature(fun, *, is_method=False):
"""Returns (args, returns).
`args` is ast3.arguments, `returns` is the return type AST node. The kicker
about this function is that it pushes type comments into proper annotation
fields, standardizing type handling.
"""
args = fun.args
re... |
def parse_signature_type_comment(type_comment):
"""Parse the fugly signature type comment into AST nodes.
Caveats: ASTifying **kwargs is impossible with the current grammar so we
hack it into unary subtraction (to differentiate from Starred in vararg).
For example from:
"(str, int, *int, **Any) ->... |
def parse_type_comment(type_comment):
"""Parse a type comment string into AST nodes."""
try:
result = ast3.parse(type_comment, '<type_comment>', 'eval')
except SyntaxError:
raise ValueError(f"invalid type comment: {type_comment!r}") from None
assert isinstance(result, ast3.Expression)
... |
def parse_arguments(arguments):
"""parse_arguments('(a, b, *, c=False, **d)') -> ast3.arguments
Parse a string with function arguments into an AST node.
"""
arguments = f"def f{arguments}: ..."
try:
result = ast3.parse(arguments, '<arguments>', 'exec')
except SyntaxError:
raise ... |
def copy_arguments_to_annotations(args, type_comment, *, is_method=False):
"""Copies AST nodes from `type_comment` into the ast3.arguments in `args`.
Does validaation of argument count (allowing for untyped self/cls)
and type (vararg and kwarg).
"""
if isinstance(type_comment, ast3.Ellipsis):
... |
def copy_type_comments_to_annotations(args):
"""Copies argument type comments from the legacy long form to annotations
in the entire function signature.
"""
for arg in args.args:
copy_type_comment_to_annotation(arg)
if args.vararg:
copy_type_comment_to_annotation(args.vararg)
f... |
def maybe_replace_any_if_equal(name, expected, actual):
"""Return the type given in `expected`.
Raise ValueError if `expected` isn't equal to `actual`. If --replace-any is
used, the Any type in `actual` is considered equal.
The implementation is naively checking if the string representation of
`a... |
def remove_function_signature_type_comment(body):
"""Removes the legacy signature type comment, leaving other comments if any."""
for node in body.children:
if node.type == token.INDENT:
prefix = node.prefix.lstrip()
if prefix.startswith('# type: '):
node.prefix =... |
def flatten_some(children):
"""Generates nodes or leaves, unpacking bodies of try:except:finally: statements."""
for node in children:
if node.type in (syms.try_stmt, syms.suite):
yield from flatten_some(node.children)
else:
yield node |
def pop_param(params):
"""Pops the parameter and the "remainder" (comma, default value).
Returns a tuple of ('name', default) or (_star, 'name') or (_dstar, 'name').
"""
default = None
name = params.pop(0)
if name in (_star, _dstar):
default = params.pop(0)
if default == _comma... |
def get_offset_and_prefix(body, skip_assignments=False):
"""Returns the offset after which a statement can be inserted to the `body`.
This offset is calculated to come after all imports, and maybe existing
(possibly annotated) assignments if `skip_assignments` is True.
Also returns the indentation pre... |
def fix_line_numbers(body):
r"""Recomputes all line numbers based on the number of \n characters."""
maxline = 0
for node in body.pre_order():
maxline += node.prefix.count('\n')
if isinstance(node, Leaf):
node.lineno = maxline
maxline += str(node.value).count('\n') |
def new(n, prefix=None):
"""lib2to3's AST requires unique objects as children."""
if isinstance(n, Leaf):
return Leaf(n.type, n.value, prefix=n.prefix if prefix is None else prefix)
# this is hacky, we assume complex nodes are just being reused once from the
# original AST.
n.parent = None... |
def apply_job_security(code):
"""Treat input `code` like Python 2 (implicit strings are byte literals).
The implementation is horribly inefficient but the goal is to be compatible
with what Mercurial does at runtime.
"""
buf = io.BytesIO(code.encode('utf8'))
tokens = tokenize.tokenize(buf.readl... |
def _load_info(self):
'''Get user info for GBDX S3, put into instance vars for convenience.
Args:
None.
Returns:
Dictionary with S3 access key, S3 secret key, S3 session token,
user bucket and user prefix (dict).
'''
url = '%s/prefix?duratio... |
def download(self, location, local_dir='.'):
'''Download content from bucket/prefix/location.
Location can be a directory or a file (e.g., my_dir or my_dir/my_image.tif)
If location is a directory, all files in the directory are
downloaded. If it is a file, then that file is dow... |
def delete(self, location):
'''Delete content in bucket/prefix/location.
Location can be a directory or a file (e.g., my_dir or my_dir/my_image.tif)
If location is a directory, all files in the directory are deleted.
If it is a file, then that file is deleted.
Args:
... |
def upload(self, local_file, s3_path=None):
'''
Upload files to your DG S3 bucket/prefix.
Args:
local_file (str): a path to a local file to upload, directory structures are not mirrored
s3_path: a key (location) on s3 to upload the file to
Returns:
s... |
def rgb(self, **kwargs):
''' Convert the image to a 3 band RGB for plotting
This method shares the same arguments as plot(). It will perform visual adjustment on the
image and prepare the data for plotting in MatplotLib. Values are converted to an
appropriate precision and the a... |
def histogram_equalize(self, use_bands, **kwargs):
''' Equalize and the histogram and normalize value range
Equalization is on all three bands, not per-band'''
data = self._read(self[use_bands,...], **kwargs)
data = np.rollaxis(data.astype(np.float32), 0, 3)
flattened = data.... |
def histogram_match(self, use_bands, blm_source=None, **kwargs):
''' Match the histogram to existing imagery '''
assert has_rio, "To match image histograms please install rio_hist"
data = self._read(self[use_bands,...], **kwargs)
data = np.rollaxis(data.astype(np.float32), 0, 3)
... |
def histogram_stretch(self, use_bands, **kwargs):
''' entry point for contrast stretching '''
data = self._read(self[use_bands,...], **kwargs)
data = np.rollaxis(data.astype(np.float32), 0, 3)
return self._histogram_stretch(data, **kwargs) |
def _histogram_stretch(self, data, **kwargs):
''' perform a contrast stretch and/or gamma adjustment '''
limits = {}
# get the image min-max statistics
for x in range(3):
band = data[:,:,x]
try:
limits[x] = np.percentile(band, kwargs.get("stretch",... |
def ndvi(self, **kwargs):
"""
Calculates Normalized Difference Vegetation Index using NIR and Red of an image.
Returns: numpy array with ndvi values
"""
data = self._read(self[self._ndvi_bands,...]).astype(np.float32)
return (data[0,:,:] - data[1,:,:]) / (data[0,:,:] + d... |
def ndwi(self):
"""
Calculates Normalized Difference Water Index using Coastal and NIR2 bands for WV02, WV03.
For Landsat8 and sentinel2 calculated by using Green and NIR bands.
Returns: numpy array of ndwi values
"""
data = self._read(self[self._ndwi_bands,...]).astype(... |
def plot(self, spec="rgb", **kwargs):
''' Plot the image with MatplotLib
Plot sizing includes default borders and spacing. If the image is shown in Jupyter the outside whitespace will be automatically cropped to save size, resulting in a smaller sized image than expected.
Histogram options:
... |
def get_images_by_catid_and_aoi(self, catid, aoi_wkt):
""" Retrieves the IDAHO image records associated with a given catid.
Args:
catid (str): The source catalog ID from the platform catalog.
aoi_wkt (str): The well known text of the area of interest.
Returns:
... |
def get_images_by_catid(self, catid):
""" Retrieves the IDAHO image records associated with a given catid.
Args:
catid (str): The source catalog ID from the platform catalog.
Returns:
results (json): The full catalog-search response for IDAHO images
... |
def describe_images(self, idaho_image_results):
"""Describe the result set of a catalog search for IDAHO images.
Args:
idaho_image_results (dict): Result set of catalog search.
Returns:
results (json): The full catalog-search response for IDAHO images
... |
def get_chip(self, coordinates, catid, chip_type='PAN', chip_format='TIF', filename='chip.tif'):
"""Downloads a native resolution, orthorectified chip in tif format
from a user-specified catalog id.
Args:
coordinates (list): Rectangle coordinates in order West, South, East, North.
... |
def get_tms_layers(self,
catid,
bands='4,2,1',
gamma=1.3,
highcutoff=0.98,
lowcutoff=0.02,
brightness=1.0,
contrast=1.0):
"""Get list of urls and bound... |
def create_leaflet_viewer(self, idaho_image_results, filename):
"""Create a leaflet viewer html file for viewing idaho images.
Args:
idaho_image_results (dict): IDAHO image result set as returned from
the catalog.
filename (str): Where to ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.