tlc.client.sample_url_utils#

Util functions for generating sample Urls.

Module Contents#

Functions#

Function

Description

set_sample_url_prefix

Set the global variable for the sample URL prefix.

increment_and_get_sample_url

Increment the sample Url index and return a Url corresponding to the given sample_name and suffix, and the current values of the global sample Url prefix and index.

reset_sample_url

Reset the global sample Url prefix and index.

sample_url_context

Context manager which sets the global sample Url prefix to the given prefix, and resets it after the context manager exits.

API#

tlc.client.sample_url_utils.set_sample_url_prefix(prefix: tlc.core.url.Url) None#

Set the global variable for the sample URL prefix.

tlc.client.sample_url_utils.increment_and_get_sample_url(sample_name: str, suffix: str) tlc.core.url.Url#

Increment the sample Url index and return a Url corresponding to the given sample_name and suffix, and the current values of the global sample Url prefix and index.

Parameters:
  • sample_name – The name of the part of the sample to generate the Url for.

  • suffix – The suffix to be used for the sample Url.

Returns:

The generated Url.

tlc.client.sample_url_utils.reset_sample_url() None#

Reset the global sample Url prefix and index.

tlc.client.sample_url_utils.sample_url_context(prefix: tlc.core.url.Url) Iterator[None]#

Context manager which sets the global sample Url prefix to the given prefix, and resets it after the context manager exits.

Parameters:

prefix – The prefix to set the global sample Url prefix to.