signature stringlengths 8 3.44k | body stringlengths 0 1.41M | docstring stringlengths 1 122k | id stringlengths 5 17 |
|---|---|---|---|
def append(self, element): | assert element.locus == self.locus, (<EOL>"<STR_LIT>"<EOL>% (element.locus, self.locus))<EOL>self.elements[element] = None<EOL> | Append a PileupElement to this Pileup. If an identical PileupElement is
already part of this Pileup, do nothing. | f14239:c0:m3 |
def update(self, other): | assert self.locus == other.locus<EOL>self.elements.update(other.elements)<EOL> | Add all pileup elements from other into self. | f14239:c0:m4 |
def filter(self, filters): | new_elements = [<EOL>e for e in self.elements<EOL>if all(function(e) for function in filters)]<EOL>return Pileup(self.locus, new_elements)<EOL> | Apply filters to the pileup elements, and return a new Pileup with the
filtered elements removed.
Parameters
----------
filters : list of PileupElement -> bool callables
A PileupUp element is retained if all filters return True when
called on it. | f14239:c0:m5 |
def __init__(self, locus, offset_start, offset_end, alignment): | assert offset_end >= offset_start,"<STR_LIT>" % (offset_start, offset_end)<EOL>self.locus = locus<EOL>self.offset_start = offset_start<EOL>self.offset_end = offset_end<EOL>self.alignment = alignment<EOL>self.alignment_key = alignment_key(self.alignment)<EOL> | Construct a PileupElement object. | f14240:c0:m0 |
def fields(self): | return (<EOL>self.locus, self.offset_start, self.offset_end, self.alignment_key)<EOL> | Fields that should be considered for our notion of object equality. | f14240:c0:m1 |
@property<EOL><INDENT>def bases(self):<DEDENT> | sequence = self.alignment.query_sequence<EOL>assert self.offset_end <= len(sequence),"<STR_LIT>" % (<EOL>self.offset_end,<EOL>len(sequence),<EOL>self.alignment.cigarstring,<EOL>sequence)<EOL>return sequence[self.offset_start:self.offset_end]<EOL> | The sequenced bases in the alignment that align to this locus in the
genome, as a string.
Empty string in the case of a deletion. String of length > 1 if there
is an insertion here. | f14240:c0:m4 |
@property<EOL><INDENT>def base_qualities(self):<DEDENT> | return self.alignment.query_qualities[<EOL>self.offset_start:self.offset_end]<EOL> | The phred-scaled base quality scores corresponding to `self.bases`, as
a list. | f14240:c0:m5 |
@property<EOL><INDENT>def min_base_quality(self):<DEDENT> | try:<EOL><INDENT>return min(self.base_qualities)<EOL><DEDENT>except ValueError:<EOL><INDENT>assert self.offset_start == self.offset_end<EOL>adjacent_qualities = [<EOL>self.alignment.query_qualities[offset]<EOL>for offset in [self.offset_start - <NUM_LIT:1>, self.offset_start]<EOL>if <NUM_LIT:0> <= offset < len(self.ali... | The minimum of the base qualities. In the case of a deletion, in which
case there are no bases in this PileupElement, the minimum is taken
over the sequenced bases immediately before and after the deletion. | f14240:c0:m6 |
@staticmethod<EOL><INDENT>def from_pysam_alignment(locus, pileup_read):<DEDENT> | assert not pileup_read.is_refskip, (<EOL>"<STR_LIT>"<EOL>"<STR_LIT>")<EOL>offset_start = None<EOL>offset_end = len(pileup_read.alignment.query_sequence)<EOL>for (offset, position) in pileup_read.alignment.aligned_pairs:<EOL><INDENT>if offset is not None and position is not None:<EOL><INDENT>if position == locus.positio... | Factory function to create a new PileupElement from a pysam
`PileupRead`.
Parameters
----------
locus : varcode.Locus
Reference locus for which to construct a PileupElement. Must
include exactly one base.
pileup_read : pysam.calignmentfile.PileupRead
pysam PileupRead instance. Its alignment must overlap t... | f14240:c0:m7 |
def to_locus(variant_or_locus): | if isinstance(variant_or_locus, Locus):<EOL><INDENT>return variant_or_locus<EOL><DEDENT>try:<EOL><INDENT>return variant_or_locus.locus<EOL><DEDENT>except AttributeError:<EOL><INDENT>return Locus.from_inclusive_coordinates(<EOL>variant_or_locus.contig,<EOL>variant_or_locus.start,<EOL>variant_or_locus.end)<EOL><DEDENT> | Return a Locus object for a Variant instance.
This is necessary since the read evidence module expects Variant instances
to have a locus attribute st to a varcode.Locus instance of interbase
genomic coordinates. The rest of varcode uses a different Variant class,
but will eventually be transitioned to interbase coord... | f14242:m0 |
def __init__(self, pileups=None, parent=None): | if pileups is None:<EOL><INDENT>pileups = {}<EOL><DEDENT>self.pileups = pileups<EOL>self.parent = parent<EOL> | Construct a new PileupCollection. | f14242:c0:m0 |
def pileup(self, locus): | locus = to_locus(locus)<EOL>if len(locus.positions) != <NUM_LIT:1>:<EOL><INDENT>raise ValueError("<STR_LIT>" % locus)<EOL><DEDENT>return self.pileups[locus]<EOL> | Given a 1-base locus, return the Pileup at that locus.
Raises a KeyError if this PileupCollection does not have a Pileup at
the specified locus. | f14242:c0:m1 |
def at(self, *loci): | loci = [to_locus(obj) for obj in loci]<EOL>single_position_loci = []<EOL>for locus in loci:<EOL><INDENT>for position in locus.positions:<EOL><INDENT>single_position_loci.append(<EOL>Locus.from_interbase_coordinates(locus.contig, position))<EOL><DEDENT><DEDENT>pileups = dict(<EOL>(locus, self.pileups[locus]) for locus i... | Return a new PileupCollection instance including only pileups for
the specified loci. | f14242:c0:m2 |
def loci(self): | return list(self.pileups)<EOL> | Returns the loci included in this instance. | f14242:c0:m3 |
def reads(self): | <EOL>def alignment_precedence(pysam_alignment_record):<EOL><INDENT>return pysam_alignment_record.mapping_quality<EOL><DEDENT>result = {}<EOL>for pileup in self.pileups.values():<EOL><INDENT>for e in pileup.elements:<EOL><INDENT>key = read_key(e.alignment)<EOL>if key not in result or (<EOL>alignment_precedence(e.alignme... | The reads in this PileupCollection. All reads will have an alignment
that overlaps at least one of the included loci.
Since SAM (and pysam) have no real notion of a "read", the returned
instances are actually pysam.AlignedSegment instances, (i.e.
alignments). However, only one alignment will be returned by this
metho... | f14242:c0:m4 |
def num_reads(self): | return len(self.reads())<EOL> | Returns the number of reads in this PileupCollection. | f14242:c0:m5 |
def read_attribute(self, attribute): | return self.read_attributes([attribute])[attribute]<EOL> | Query a read attribute across all reads in this PileupCollection.
Parameters
----------
attribute : string
Attribute to query. See `PileupCollection.read_attributes` for
possible attributes.
Returns
----------
pandas.Series instance giving values for the attribute in each read.
The order of reads is fixed, so... | f14242:c0:m6 |
def read_attributes(self, attributes=None): | def include(attribute):<EOL><INDENT>return attributes is None or attribute in attributes<EOL><DEDENT>reads = self.reads()<EOL>possible_column_names = list(PileupCollection._READ_ATTRIBUTE_NAMES)<EOL>result = OrderedDict(<EOL>(name, [getattr(read, name) for read in reads])<EOL>for name in PileupCollection._READ_ATTRIBUT... | Collect read attributes across reads in this PileupCollection into a
pandas.DataFrame.
Valid attributes are the following properties of a pysam.AlignedSegment
instance. See:
http://pysam.readthedocs.org/en/latest/api.html#pysam.AlignedSegment
for the meaning of these attributes.
* cigarstring
* flag
... | f14242:c0:m7 |
def group_by_allele(self, locus): | locus = to_locus(locus)<EOL>read_to_allele = None<EOL>loci = []<EOL>if locus.positions:<EOL><INDENT>for position in locus.positions:<EOL><INDENT>base_position = Locus.from_interbase_coordinates(<EOL>locus.contig, position)<EOL>loci.append(base_position)<EOL>new_read_to_allele = {}<EOL>for element in self.pileups[base_p... | Split the PileupCollection by the alleles suggested by the reads at the
specified locus.
If a read has an insertion immediately following the locus, then the
insertion is included in the allele. For example, if locus is the
1-base range [5,6), one allele might be "AGA", indicating that at
locus 5 some read has an "A" ... | f14242:c0:m8 |
def allele_summary(self, locus, score=lambda x: x.num_reads()): | locus = to_locus(locus)<EOL>return [<EOL>(allele, score(x))<EOL>for (allele, x) in self.group_by_allele(locus).items()<EOL>]<EOL> | Convenience method to summarize the evidence for each of the alleles
present at a locus. Applies a score function to the PileupCollection
associated with each allele.
See also `PileupCollection.group_by_allele`.
Parameters
----------
locus : Locus
The reference locus, encompassing 0 or more bases.
score (optiona... | f14242:c0:m9 |
def group_by_match(self, variant): | locus = to_locus(variant)<EOL>if len(variant.ref) != len(locus.positions):<EOL><INDENT>logging.warning(<EOL>"<STR_LIT>" %<EOL>(len(variant.ref), len(locus.positions), str(variant)))<EOL><DEDENT>alleles_dict = self.group_by_allele(locus)<EOL>single_base_loci = [<EOL>Locus.from_interbase_coordinates(locus.contig, positio... | Given a variant, split the PileupCollection based on whether it the
data supports the reference allele, the alternate allele, or neither.
Parameters
----------
variant : Variant
The variant. Must have fields 'locus', 'ref', and 'alt'.
Returns
----------
A MatchingEvidence named tuple with fields (ref, alt, other)... | f14242:c0:m10 |
def match_summary(self, variant, score=lambda x: x.num_reads()): | split = self.group_by_match(variant)<EOL>def name(allele_to_pileup_collection):<EOL><INDENT>return "<STR_LIT:U+002C>".join(allele_to_pileup_collection)<EOL><DEDENT>def aggregate_and_score(pileup_collections):<EOL><INDENT>merged = PileupCollection.merge(*pileup_collections)<EOL>return score(merged)<EOL><DEDENT>result = ... | Convenience method to summarize the evidence for and against a variant
using a user-specified score function.
See also `PileupCollection.group_by_match`.
Parameters
----------
variant : Variant
The variant. Must have fields 'locus', 'ref', and 'alt'.
score (optional) : PileupCollection -> object
Function to ... | f14242:c0:m11 |
def filter(self,<EOL>drop_duplicates=False,<EOL>drop_improper_mate_pairs=False,<EOL>min_mapping_quality=None,<EOL>min_base_quality=None,<EOL>filters=None): | if filters is None:<EOL><INDENT>filters = []<EOL><DEDENT>if drop_duplicates:<EOL><INDENT>filters.append(lambda e: not e.alignment.is_duplicate)<EOL><DEDENT>if drop_improper_mate_pairs:<EOL><INDENT>filters.append(lambda e: e.alignment.is_proper_pair)<EOL><DEDENT>if min_mapping_quality is not None:<EOL><INDENT>filters.ap... | Return a new PileupCollection that includes only pileup elements
satisfying the specified criteria.
Parameters
----------
drop_duplicates (optional, default False) : boolean
Remove alignments with the is_duplicate flag.
drop_improper_mate_pairs (optional, default False) : boolean
Retain only alignments that h... | f14242:c0:m12 |
def merge(self, *others): | new_pileups = {}<EOL>for collection in (self,) + others:<EOL><INDENT>for (locus, pileup) in collection.pileups.items():<EOL><INDENT>if locus in new_pileups:<EOL><INDENT>new_pileups[locus].update(pileup)<EOL><DEDENT>else:<EOL><INDENT>new_pileups[locus] = Pileup(locus, pileup.elements)<EOL><DEDENT><DEDENT><DEDENT>return ... | Return a new PileupCollection that is the union of self and the other
specified collections. | f14242:c0:m13 |
@staticmethod<EOL><INDENT>def from_bam(pysam_samfile, loci, normalized_contig_names=True):<DEDENT> | loci = [to_locus(obj) for obj in loci]<EOL>close_on_completion = False<EOL>if typechecks.is_string(pysam_samfile):<EOL><INDENT>pysam_samfile = Samfile(pysam_samfile)<EOL>close_on_completion = True <EOL><DEDENT>try:<EOL><INDENT>if normalized_contig_names:<EOL><INDENT>chromosome_name_map = {}<EOL>for name in pysam... | Create a PileupCollection for a set of loci from a BAM file.
Parameters
----------
pysam_samfile : `pysam.Samfile` instance, or filename string
to a BAM file. The BAM file must be indexed.
loci : list of Locus instances
Loci to collect pileups for.
normalized_contig_names : whether the contig names have been... | f14242:c0:m14 |
def load_from_args_as_dataframe(args): | if not args.variants and not args.single_variant:<EOL><INDENT>return None<EOL><DEDENT>if args.variant_source_name:<EOL><INDENT>variant_source_names = util.expand(<EOL>args.variant_source_name,<EOL>'<STR_LIT>',<EOL>'<STR_LIT>',<EOL>len(args.variants))<EOL><DEDENT>else:<EOL><INDENT>variant_source_names = util.drop_prefix... | Given parsed variant-loading arguments, return a pandas DataFrame.
If no variant loading arguments are specified, return None. | f14243:m1 |
def load_from_args(args): | if not args.locus:<EOL><INDENT>return None<EOL><DEDENT>loci_iterator = (Locus.parse(locus) for locus in args.locus)<EOL>if args.neighbor_offsets:<EOL><INDENT>loci_iterator = expand_with_neighbors(<EOL>loci_iterator, args.neighbor_offsets)<EOL><DEDENT>return Loci(loci_iterator)<EOL> | Return a Loci object giving the loci specified on the command line.
If no loci-related arguments are specified, return None. This makes it
possible to distinguish an empty set of loci, for example due to filters
removing all loci, from the case where the user didn't specify any
arguments. | f14244:m1 |
def __init__(self, hla=None, hla_dataframe=None, donor_to_hla=None): | if bool(hla) + (hla_dataframe is not None) + bool(donor_to_hla) != <NUM_LIT:1>:<EOL><INDENT>raise TypeError(<EOL>"<STR_LIT>")<EOL><DEDENT>self.hla = (<EOL>self.string_to_hla_alleles(hla) if typechecks.is_string(hla)<EOL>else hla)<EOL>self.donor_to_hla = donor_to_hla<EOL>if hla_dataframe is not None:<EOL><INDENT>self.do... | Specify exactly one of hla, hla_dataframe, or donor_to_hla.
Parameters
-----------
hla : list of string
HLA alleles to use for all donors
hla_dataframe : pandas.DataFrame with columns 'donor' and 'hla'
DataFrame giving HLA alleles for each donor. The 'hla' column
should be a space separated list of allele... | f14245:c4:m3 |
def column_name(self, source, allele_group): | return self.column_format.format(<EOL>source=source,<EOL>allele_group=allele_group)<EOL> | Parameters
----------
source : string
name of the ReadSource
allele_group : string
one of: num_ref, num_alt, total_depth
Returns
----------
column name : string | f14245:c5:m5 |
def allele_support_df(loci, sources): | return pandas.DataFrame(<EOL>allele_support_rows(loci, sources),<EOL>columns=EXPECTED_COLUMNS)<EOL> | Returns a DataFrame of allele counts for all given loci in the read sources | f14246:m0 |
def variant_support(variants, allele_support_df, ignore_missing=False): | missing = [<EOL>c for c in EXPECTED_COLUMNS if c not in allele_support_df.columns<EOL>]<EOL>if missing:<EOL><INDENT>raise ValueError("<STR_LIT>" % "<STR_LIT:U+0020>".join(missing))<EOL><DEDENT>allele_support_df[["<STR_LIT>", "<STR_LIT>"]] = (<EOL>allele_support_df[["<STR_LIT>", "<STR_LIT>"]].astype(int))<EOL>sources = ... | Collect the read evidence support for the given variants.
Parameters
----------
variants : iterable of varcode.Variant
allele_support_df : dataframe
Allele support dataframe, as output by the varlens-allele-support tool.
It should have columns: source, contig, interbase_start, interbase_end,
allele. The ... | f14246:m2 |
def __init__(self, name=None, version="<STR_LIT>", **kwargs): | if not name:<EOL><INDENT>raise ValueError('<STR_LIT>')<EOL><DEDENT>self.proxy = kwargs.get('<STR_LIT>', None)<EOL>self.max_pages = kwargs.get('<STR_LIT>', <NUM_LIT:5>)<EOL>self.page_size = kwargs.get('<STR_LIT>', <NUM_LIT:100>)<EOL>self.key = kwargs.get('<STR_LIT:key>', None)<EOL>self.access_token = kwargs.get('<STR_LI... | The object used to interact with the Stack Exchange API
:param name: (string) **(Required)** A valid ``api_site_parameter``
(available from http://api.stackexchange.com/docs/sites) which will
be used to connect to a particular site on the Stack Exchange
Network.
:param version: (float) **(Required)** The v... | f14250:c1:m0 |
def fetch(self, endpoint=None, page=<NUM_LIT:1>, key=None, filter='<STR_LIT:default>', **kwargs): | if not endpoint:<EOL><INDENT>raise ValueError('<STR_LIT>')<EOL><DEDENT>self._endpoint = endpoint<EOL>params = {<EOL>"<STR_LIT>": self.page_size,<EOL>"<STR_LIT>": page,<EOL>"<STR_LIT>": filter<EOL>}<EOL>if self.key:<EOL><INDENT>params['<STR_LIT:key>'] = self.key<EOL><DEDENT>if self.access_token:<EOL><INDENT>params['<STR... | Returns the results of an API call.
This is the main work horse of the class. It builds the API query
string and sends the request to Stack Exchange. If there are multiple
pages of results, and we've configured `max_pages` to be greater than
1, it will automatically paginate through the... | f14250:c1:m2 |
def send_data(self, endpoint=None, page=<NUM_LIT:1>, key=None, filter='<STR_LIT:default>', **kwargs): | if not endpoint:<EOL><INDENT>raise ValueError('<STR_LIT>')<EOL><DEDENT>self._endpoint = endpoint<EOL>params = {<EOL>"<STR_LIT>": self.page_size,<EOL>"<STR_LIT>": page,<EOL>"<STR_LIT>": filter<EOL>}<EOL>if self.key:<EOL><INDENT>params['<STR_LIT:key>'] = self.key<EOL><DEDENT>if self.access_token:<EOL><INDENT>params['<STR... | Sends data to the API.
This call is similar to ``fetch``, but **sends** data to the API instead
of retrieving it.
Returned data will appear in the ``items`` key of the resulting
dictionary.
Sending data **requires** that the ``access_token`` is set. This is enforced
on... | f14250:c1:m3 |
@task<EOL>def release(part='<STR_LIT>'): | <EOL>bumpver = subprocess.check_output(<EOL>['<STR_LIT>', part, '<STR_LIT>', '<STR_LIT>'],<EOL>stderr=subprocess.STDOUT)<EOL>m = re.search(r'<STR_LIT>', bumpver.decode('<STR_LIT:utf-8>'))<EOL>version = m.groups(<NUM_LIT:0>)[<NUM_LIT:0>]<EOL>bv_args = ['<STR_LIT>', part]<EOL>bv_args += ['<STR_LIT>', version]<EOL>subproc... | Automated software release workflow
* (Configurably) bumps the version number
* Tags the release
You can run it like::
$ fab release
which, by default, will create a 'patch' release (0.0.1 => 0.0.2).
You can also specify a patch level (patch, minor, major) to change to::
$ fab ... | f14252:m0 |
def construct_mail(recipients=None, context=None, template_base='<STR_LIT>', subject=None, message=None, site=None,<EOL>subject_templates=None, body_templates=None, html_templates=None, from_email=None, language=None,<EOL>**kwargs): | language = language or translation.get_language()<EOL>with force_language(language):<EOL><INDENT>recipients = recipients or []<EOL>if isinstance(recipients, basestring):<EOL><INDENT>recipients = [recipients]<EOL><DEDENT>from_email = from_email or settings.DEFAULT_FROM_EMAIL<EOL>subject_templates = subject_templates or ... | usage:
construct_mail(['my@email.com'], {'my_obj': obj}, template_base='myapp/emails/my_obj_notification').send()
:param recipients: recipient or list of recipients
:param context: context for template rendering
:param template_base: the base template. '.subject.txt', '.body.txt' and '.body.html' will be added
:param s... | f14257:m0 |
def combine_metadata(metadata_collection: Iterable[IrodsMetadata]) -> IrodsMetadata: | combined = IrodsMetadata()<EOL>for metadata in metadata_collection:<EOL><INDENT>for key, values in metadata.items():<EOL><INDENT>for value in values:<EOL><INDENT>combined.add(key, value)<EOL><DEDENT><DEDENT><DEDENT>return combined<EOL> | Combines n metadata objects into a single metadata object. Key values are merged, duplicate values are removed.
:param metadata_collection: the collection of metadata to combine
:return: the combined metadata | f14261:m6 |
def get_all_descendants(self) -> Sequence[EntityNode]: | descendants = []<EOL>for child in self.children:<EOL><INDENT>descendants.append(child)<EOL>if isinstance(child, CollectionNode):<EOL><INDENT>descendants.extend(child.get_all_descendants())<EOL><DEDENT><DEDENT>return descendants<EOL> | Gets all descendants of the collection node. | f14261:c1:m1 |
@abstractmethod<EOL><INDENT>def create_mapper(self) -> _BatonIrodsEntityMapper:<DEDENT> | Creates a mapper to test with.
:return: the created mapper | f14263:c0:m2 | |
@abstractmethod<EOL><INDENT>def create_irods_entity(self, name: str, metadata: IrodsMetadata=IrodsMetadata()) -> IrodsEntity:<DEDENT> | Creates an iRODS entity to test with
:param name: the name of the entity to create
:param metadata: the metadata to give to the entity
:return: the created entity | f14263:c0:m3 | |
def create_data_object_with_baton_json_representation() -> Tuple[DataObject, Dict]: | global _data_object, _data_object_as_json<EOL>if _data_object is None:<EOL><INDENT>test_with_baton = TestWithBaton()<EOL>test_with_baton.setup()<EOL>metadata = IrodsMetadata({"<STR_LIT>": {"<STR_LIT>", "<STR_LIT>"}, "<STR_LIT>": {"<STR_LIT>"}})<EOL>_data_object = create_data_object(test_with_baton, "<STR_LIT>", metadat... | Creates a data object and returns it along with the JSON representation of it given by baton.
Uses baton to get the JSON representation on the first use: the JSON is retrieved from a cache in subsequent uses.
:return: a tuple where the first element is the created data object and the second is its JSON representation
... | f14266:m0 |
def create_collection_with_baton_json_representation() -> Tuple[Collection, Dict]: | global _collection, _collection_as_json<EOL>if _collection is None:<EOL><INDENT>test_with_baton = TestWithBaton()<EOL>test_with_baton.setup()<EOL>metadata = IrodsMetadata({"<STR_LIT>": {"<STR_LIT>", "<STR_LIT>"}, "<STR_LIT>": {"<STR_LIT>"}})<EOL>_collection = create_collection(test_with_baton, "<STR_LIT>", metadata)<EO... | Creates a collection and returns it along with the JSON representation of it given by baton.
Uses baton to get the JSON representation on the first use: the JSON is retrieved from a cache in subsequent uses.
:return: a tuple where the first element is the created collection and the second is its JSON representation
ac... | f14266:m1 |
def create_specific_query_with_baton_json_representation() -> Tuple[SpecificQuery, Dict]: | global _specific_query, _specific_query_as_json<EOL>if _specific_query is None:<EOL><INDENT>test_with_baton = TestWithBaton()<EOL>test_with_baton.setup()<EOL>baton_runner = BatonRunner(test_with_baton.baton_location, test_with_baton.irods_server.users[<NUM_LIT:0>].zone)<EOL>baton_query = baton_runner.run_baton_query(Ba... | Creates a specific query and returns it along with the JSON representation of it given by baton.
Uses baton to get the JSON representation on the first use: the JSON is retrieved from a cache in subsequent uses.
:return: a tuple where the first element is the created specific query and the second is its JSON represent... | f14266:m2 |
@staticmethod<EOL><INDENT>def _parse_iquest_ls(iquest_ls_response: str) -> Sequence[SpecificQuery]:<DEDENT> | iquest_ls_response_lines = iquest_ls_response.split('<STR_LIT:\n>')<EOL>assert (len(iquest_ls_response_lines) + <NUM_LIT:1>) % <NUM_LIT:3> == <NUM_LIT:0><EOL>specific_queries = []<EOL>for i in range(int((len(iquest_ls_response_lines) + <NUM_LIT:1>) / <NUM_LIT:3>)):<EOL><INDENT>i3 = int(<NUM_LIT:3> * i)<EOL>alias = ique... | Gets the installed specific queries by parsing the output returned by "iquest --sql ls".
:param iquest_ls_response: the response returned by the iquest command
:return: the specific queries installed on the iRODS server | f14267:c1:m2 |
@abstractmethod<EOL><INDENT>def create_mapper(self) -> _BatonIrodsMetadataMapper:<DEDENT> | Creates a mapper to test with.
:return: the created mapper | f14269:c0:m0 | |
@abstractmethod<EOL><INDENT>def create_irods_entity(self, name: str, metadata: IrodsMetadata=IrodsMetadata()) -> IrodsEntity:<DEDENT> | Creates an iRODS entity to test with
:param name: the name of the entity to create
:param metadata: the metadata to give to the entity
:return: the created entity | f14269:c0:m1 | |
@property<EOL><INDENT>def entity(self) -> IrodsEntity:<DEDENT> | if self._entity is None:<EOL><INDENT>self._entity = self.create_irods_entity("<STR_LIT>" % NAMES[<NUM_LIT:0>])<EOL><DEDENT>return self._entity<EOL> | Lazily creates the test entity (prevents spending time creating unused entities in iRODS).
:return: an example entity | f14269:c0:m4 |
@property<EOL><INDENT>def entities(self) -> List[IrodsEntity]:<DEDENT> | if self._entities is None:<EOL><INDENT>self._entities = [self.create_irods_entity(name) for name in NAMES]<EOL><DEDENT>return self._entities<EOL> | Lazily creates a set of test entities (prevents spending time creating unused entities in iRODS).
:return: an example collection of entities | f14269:c0:m5 |
@abstractmethod<EOL><INDENT>def create_mapper(self) -> _BatonAccessControlMapper:<DEDENT> | Creates a mapper to test with.
:return: the created mapper | f14270:c0:m0 | |
@abstractmethod<EOL><INDENT>def create_irods_entity(self, name: str, access_controls: Iterable[AccessControl]) -> IrodsEntity:<DEDENT> | Creates an iRODS entity to test with
:param name: the name of the entity to create
:param access_controls: the access controls the entity should have
:return: the created entity | f14270:c0:m1 | |
def _create_entity_tree_in_container(self, entity_tree: EntityNode) -> (List[IrodsEntity], IrodsEntity): | self._collection_count += <NUM_LIT:1><EOL>container_path = self.setup_helper.create_collection("<STR_LIT>" % self._collection_count)<EOL>entities = list(create_entity_tree(self.test_with_baton, container_path, entity_tree, self.access_controls))<EOL>for entity in entities:<EOL><INDENT>if entity.get_collection_path() ==... | Creates the given entity tree inside a container.
:param entity_tree: the entity to create
:return: tuple where the first element is a list of all the created iRODS entities (not including the container)
and the second is the top level iRODS entity (not including the container) | f14270:c2:m11 |
@staticmethod<EOL><INDENT>def _fix_set_as_list_in_json_issue(data_object_as_json: dict):<DEDENT> | avus = set()<EOL>for avu in data_object_as_json[BATON_AVU_PROPERTY]:<EOL><INDENT>avus.add(frozendict(avu))<EOL><DEDENT>data_object_as_json[BATON_AVU_PROPERTY] = avus<EOL> | Work around issue that (unordered) set is represented as (ordered) list in JSON
:param data_object_as_json: a JSON representation of a `DataObject` instance | f14271:c8:m0 |
def _assert_data_object_as_json_equal(self, target: dict, actual: dict): | TestDataObjectJSONEncoder._fix_set_as_list_in_json_issue(target)<EOL>TestDataObjectJSONEncoder._fix_set_as_list_in_json_issue(actual)<EOL>self.assertEqual(target, actual)<EOL> | Assert that two JSON representations of `DataObject` instances are equal.
:param target: the data object to check
:param actual: the data object to check against | f14271:c8:m5 |
@staticmethod<EOL><INDENT>def from_metadata(metadata: Metadata) -> Any:<DEDENT> | irods_metadata = IrodsMetadata()<EOL>for key, value in metadata.items():<EOL><INDENT>irods_metadata[key] = {value}<EOL><DEDENT>return irods_metadata<EOL> | Static factory method to create an equivalent instance of this type from the given `Metadata` instance.
:param metadata: the `Metadata` instance to create an instance of this class from
:return: the created instance of this class | f14273:c0:m0 |
def add(self, key: str, value: str): | if key in self:<EOL><INDENT>super().__getitem__(key).add(value)<EOL><DEDENT>else:<EOL><INDENT>self[key] = {value}<EOL><DEDENT> | Adds the given value to the set of data stored under the given key.
:param key: the set's key
:param value: the value to add in the set associated to the given key | f14273:c0:m3 |
def __init__(self, data_object_replicas: Iterable[DataObjectReplica]=()): | self._data = dict() <EOL>for data_object_replica in data_object_replicas:<EOL><INDENT>self.add(data_object_replica)<EOL><DEDENT> | Constructor.
:param data_object_replicas: (optional) replica to go into this collection initially | f14273:c1:m0 |
def get_by_number(self, number: int) -> Optional[DataObjectReplica]: | return self._data.get(number, None)<EOL> | Gets the data object replica in this collection with the given number. Will return `None` if such replica does
not exist.
:param number: the number of the data object replica to get
:return: the data object replica in this collection with the given number | f14273:c1:m1 |
def get_out_of_date(self) -> Sequence[DataObjectReplica]: | out_of_date = []<EOL>for number, data_object_replica in self._data.items():<EOL><INDENT>if not data_object_replica.up_to_date:<EOL><INDENT>out_of_date.append(data_object_replica)<EOL><DEDENT><DEDENT>return out_of_date<EOL> | Gets any data object replica that are marked as out of date/not in date.
:return: the out of data object replica | f14273:c1:m2 |
def add(self, data_object_replica: DataObjectReplica): | if data_object_replica.number in self._data:<EOL><INDENT>raise ValueError(<EOL>"<STR_LIT>" % data_object_replica.number)<EOL><DEDENT>self._data[data_object_replica.number] = data_object_replica<EOL> | Adds the given data object replica to this collection. Will raise a `ValueError` if a data object replica with
the same number already exists.
:param data_object_replica: the data object replica to add | f14273:c1:m3 |
def remove(self, identifier: Union[DataObjectReplica, int]): | if isinstance(identifier, int):<EOL><INDENT>self._remove_by_number(identifier)<EOL><DEDENT>elif isinstance(identifier, DataObjectReplica):<EOL><INDENT>self._remove_by_object(identifier)<EOL><DEDENT>else:<EOL><INDENT>raise TypeError("<STR_LIT>" % type(identifier))<EOL><DEDENT> | Removes a data object from this collection that has the given unique identifier. A `ValueError` will be raised
if a data object with the given identifier does not exist.
:param identifier: the identifier of the data object | f14273:c1:m4 |
def _remove_by_number(self, number: int): | if number not in self._data:<EOL><INDENT>raise ValueError("<STR_LIT>" % number)<EOL><DEDENT>del self._data[number]<EOL>assert number not in self._data<EOL> | Removes the data object from this collection with the given number. A `ValueError` will be raised if a data
object with the given number does not exist.
:param number: the number of the data object to remove | f14273:c1:m5 |
def _remove_by_object(self, data_object_replica: DataObjectReplica): | self.remove(data_object_replica.number)<EOL> | Removes the given data object from this collection. A `ValueError` will be raised if the given data object does
not exist within this collection.
:param data_object_replica: the data object replica to remove | f14273:c1:m6 |
@abstractmethod<EOL><INDENT>def _path_to_baton_json(self, path: str) -> Dict:<DEDENT> | Converts a path to the type of iRODS entity the mapper deals with, to its JSON representation.
:param path: the path to convert
:return: the JSON representation of the path | f14276:c0:m0 | |
@abstractmethod<EOL><INDENT>def _baton_json_to_irods_entity(self, entity_as_baton_json: Dict) -> EntityType:<DEDENT> | Converts the baton representation of an iRODS entity to a list of `EntityType` models.
:param entity_as_baton_json: the baton serialization representation of the entity
:return: the equivalent models | f14276:c0:m1 | |
@abstractmethod<EOL><INDENT>def _extract_irods_entities_of_entity_type_from_baton_json(self, entities_as_baton_json: List[Dict]) -> List[Dict]:<DEDENT> | Extract from the list the JSON representation of entities of type `EntityType`.
:param entities_as_baton_json: iRODS entities encoded as baton JSON
:return: extracted entities as baton JSON | f14276:c0:m2 | |
def __init__(self, additional_metadata_query_arguments: List[str], *args, **kwargs): | super().__init__(*args, **kwargs)<EOL>self._additional_metadata_query_arguments = additional_metadata_query_arguments<EOL> | Constructor.
:param additional_metadata_query_arguments: TODO | f14276:c0:m3 |
def _create_entity_query_arguments(self, load_metadata: bool=True) -> List[str]: | arguments = ["<STR_LIT>", "<STR_LIT>", "<STR_LIT>"]<EOL>if load_metadata:<EOL><INDENT>arguments.append("<STR_LIT>")<EOL><DEDENT>return arguments<EOL> | Create arguments to use with baton.
:param load_metadata: whether baton should load metadata
:return: the arguments to use with baton | f14276:c0:m7 |
def _baton_json_to_irods_entities(self, entities_as_baton_json: List[Dict]) -> List[EntityType]: | assert(isinstance(entities_as_baton_json, list))<EOL>entities = []<EOL>for file_as_baton_json in entities_as_baton_json:<EOL><INDENT>entity = self._baton_json_to_irods_entity(file_as_baton_json)<EOL>entities.append(entity)<EOL><DEDENT>return entities<EOL> | Converts the baton representation of multiple iRODS entities to a list of `EntityType` models.
:param entities_as_baton_json: the baton serialization representation of the entities
:return: the equivalent models | f14276:c0:m8 |
@abstractmethod<EOL><INDENT>def _create_entity_with_path(self, path: str) -> IrodsEntity:<DEDENT> | Creates an entity model with the given path.
:param path: the path the entity should have
:return: the created entity model | f14277:c0:m0 | |
@abstractmethod<EOL><INDENT>def _entity_to_baton_json(self, entity: IrodsEntity) -> Dict:<DEDENT> | Converts an entity model to its baton JSON representation.
:param entity: the entity to produce the JSON representation of
:return: the JSON representation | f14277:c0:m1 | |
def _modify(self, paths: Union[str, List[str]], metadata_for_paths: Union[IrodsMetadata, List[IrodsMetadata]],<EOL>operation: str): | if isinstance(paths, str):<EOL><INDENT>paths = [paths]<EOL><DEDENT>if isinstance(metadata_for_paths, IrodsMetadata):<EOL><INDENT>metadata_for_paths = [metadata_for_paths for _ in paths]<EOL><DEDENT>elif len(paths) != len(metadata_for_paths):<EOL><INDENT>raise ValueError("<STR_LIT>"<EOL>"<STR_LIT>")<EOL><DEDENT>assert l... | Modifies the metadata of the entity or entities in iRODS with the given path.
:param path: the paths of the entity or entities to modify
:param metadata_for_paths: the metadata to change. If only one metadata object is given, that metadata is set
for all, else the metadata is matched against the path with the correspon... | f14277:c0:m7 |
def _path_to_baton_json(self, path: str) -> Dict: | entity = self._create_entity_with_path(path)<EOL>return self._entity_to_baton_json(entity)<EOL> | Converts a path to the type of iRODS entity the mapper deals with, to its JSON representation.
:param path: the path to convert
:return: the JSON representation of the path | f14277:c0:m8 |
@abstractmethod<EOL><INDENT>def _object_deserialiser(self, object_as_json: dict) -> CustomObjectType:<DEDENT> | Function used to take the JSON representation of the custom object returned by the specific query and produce a
Python model.
:param object_as_json: JSON representation of the custom object
:return: Python model of the custom object | f14278:c0:m0 | |
@staticmethod<EOL><INDENT>def validate_baton_binaries_location(baton_binaries_directory: str) -> Optional[Exception]:<DEDENT> | if os.path.isfile(baton_binaries_directory):<EOL><INDENT>return ValueError("<STR_LIT>"<EOL>"<STR_LIT>")<EOL><DEDENT>for baton_binary in BatonBinary:<EOL><INDENT>binary_location = os.path.join(baton_binaries_directory, baton_binary.value)<EOL>if not (os.path.isfile(binary_location) and os.access(binary_location, os.X_OK... | Validates that the given directory contains the baton binaries required to use the runner.
:param baton_binaries_directory: the directory to check
:return: exception that describes the issue else `None` if no issues | f14281:c1:m0 |
@staticmethod<EOL><INDENT>def _raise_any_errors_given_in_baton_out(baton_out_as_json: List[Dict]):<DEDENT> | if not isinstance(baton_out_as_json, list):<EOL><INDENT>baton_out_as_json = [baton_out_as_json]<EOL><DEDENT>for baton_item_as_json in baton_out_as_json:<EOL><INDENT>if BATON_ERROR_PROPERTY in baton_item_as_json:<EOL><INDENT>error = baton_item_as_json[BATON_ERROR_PROPERTY]<EOL>error_message = error[BATON_ERROR_MESSAGE_K... | Raises any errors that baton has expressed in its output.
:param baton_out_as_json: the output baton gave as parsed serialization | f14281:c1:m1 |
def __init__(self, baton_binaries_directory: str, skip_baton_binaries_validation: bool=False,<EOL>timeout_queries_after: timedelta=None): | if not skip_baton_binaries_validation:<EOL><INDENT>exception = BatonRunner.validate_baton_binaries_location(baton_binaries_directory)<EOL>if exception is not None:<EOL><INDENT>raise exception<EOL><DEDENT><DEDENT>self._baton_binaries_directory = baton_binaries_directory<EOL>self.timeout_queries_after = timeout_queries_a... | Constructor.
:param baton_binaries_directory: the host of baton's binaries
:param irods_query_zone: the iRODS zone to query
:param skip_baton_binaries_validation: skips validation of baton binaries (intending for testing only) | f14281:c1:m2 |
def run_baton_query(self, baton_binary: BatonBinary, program_arguments: List[str]=None, input_data: Any=None)-> List[Dict]: | if program_arguments is None:<EOL><INDENT>program_arguments = []<EOL><DEDENT>baton_binary_location = os.path.join(self._baton_binaries_directory, baton_binary.value)<EOL>program_arguments = [baton_binary_location] + program_arguments<EOL>_logger.info("<STR_LIT>" % (program_arguments, input_data))<EOL>start_at = time.mo... | Runs a baton query.
:param baton_binary: the baton binary to use
:param program_arguments: arguments to give to the baton binary
:param input_data: input data to the baton binary
:return: parsed serialization returned by baton | f14281:c1:m3 |
def _run_command(self, arguments: List[str], input_data: Any=None, output_encoding: str="<STR_LIT:utf-8>") -> str: | process = subprocess.Popen(arguments, stdout=subprocess.PIPE, stdin=subprocess.PIPE, stderr=subprocess.PIPE)<EOL>if isinstance(input_data, List):<EOL><INDENT>for to_write in input_data:<EOL><INDENT>to_write_as_json = json.dumps(to_write)<EOL>process.stdin.write(str.encode(to_write_as_json))<EOL><DEDENT>input_data = Non... | Run a command as a subprocess.
Ignores errors given over stderr if there is output on stdout (this is the case where baton has been run
correctly and has expressed the error in it's JSON out, which can be handled more appropriately upstream to this
method.)
:param arguments: the arguments to run
:param input_data: the... | f14281:c1:m4 |
def connect_to_irods_with_baton(baton_binaries_directory: str, skip_baton_binaries_validation: bool=False)-> Connection: | return Connection(baton_binaries_directory, skip_baton_binaries_validation)<EOL> | Convenience method to create a pseudo connection to iRODS.
:param baton_binaries_directory: see `Connection.__init__`
:param skip_baton_binaries_validation: see `Connection.__init__`
:return: pseudo connection to iRODS | f14282:m0 |
def __init__(self, baton_binaries_directory: str, skip_baton_binaries_validation: bool=False): | self.data_object = BatonDataObjectMapper(baton_binaries_directory, skip_baton_binaries_validation)<EOL>self.collection = BatonCollectionMapper(baton_binaries_directory, skip_baton_binaries_validation)<EOL>self.specific_query = BatonSpecificQueryMapper(baton_binaries_directory, skip_baton_binaries_validation)<EOL> | Constructor.
:param baton_binaries_directory: the directory host of the baton binaries
:param skip_baton_binaries_validation: whether checks on if the correct baton binaries exist within the given
directory should be skipped | f14282:c0:m0 |
@abstractmethod<EOL><INDENT>def _create_entity_with_path(self, path: str) -> IrodsEntity:<DEDENT> | Creates an entity model with the given path.
:param path: the path the entity should have
:return: the created entity model | f14283:c0:m0 | |
@abstractmethod<EOL><INDENT>def _entity_to_baton_json(self, entity: IrodsEntity) -> Dict:<DEDENT> | Converts an entity model to its baton JSON representation.
:param entity: the entity to produce the JSON representation of
:return: the JSON representation | f14283:c0:m1 | |
def _path_to_baton_json(self, path: str) -> Dict: | entity = self._create_entity_with_path(path)<EOL>return self._entity_to_baton_json(entity)<EOL> | Converts a path to the type of iRODS entity the mapper deals with, to its JSON representation.
:param path: the path to convert
:return: the JSON representation of the path | f14283:c0:m7 |
def __init__(self, *args, **kwargs): | super().__init__(*args, **kwargs)<EOL>self._original_run_baton_query = self.run_baton_query<EOL>self._hijack_frame_ids = set() <EOL>self.run_baton_query = self._hijacked_run_baton_query<EOL> | Constructor. | f14283:c2:m0 |
def _do_recursive(self, method_that_runs_baton_chmod: callable, *args, **kwargs): | current_frame_id = id(inspect.currentframe())<EOL>try:<EOL><INDENT>self._hijack_frame_ids.add(current_frame_id)<EOL>method_that_runs_baton_chmod(*args, **kwargs)<EOL><DEDENT>finally:<EOL><INDENT>self._hijack_frame_ids.remove(current_frame_id)<EOL><DEDENT> | Adds the `--recursive` argument to all calls to `baton-chmod`.
:param method_that_runs_baton_chmod: the method that, at a lower level, calls out to baton-chmod
:param args: positional arguments to call given method with
:param kwargs: named arguments to call given method with | f14283:c2:m7 |
def _hijacked_run_baton_query(<EOL>self, baton_binary: BatonBinary, program_arguments: List[str]=None, input_data: Any=None) -> List[Dict]: | if baton_binary == BatonBinary.BATON_CHMOD:<EOL><INDENT>current_frame = inspect.currentframe()<EOL>def frame_code_in_same_file(frame) -> bool:<EOL><INDENT>return frame_back.f_code.co_filename == current_frame.f_code.co_filename<EOL><DEDENT>frame_back = current_frame.f_back<EOL>assert frame_code_in_same_file(frame_back)... | Hijacked `run_baton_query` method with hijacking to add the `--recursive` flag to calls to `baton-chmod` that
originate from code called from frames with the ids in `self._hijack_frame_ids`.
:param baton_binary: see `BatonRunner.run_baton_query`
:param program_arguments: see `BatonRunner.run_baton_query`
:param input_d... | f14283:c2:m8 |
@staticmethod<EOL><INDENT>def create_from_str(name_and_zone: str):<DEDENT> | if _NAME_ZONE_SEGREGATOR not in name_and_zone:<EOL><INDENT>raise ValueError("<STR_LIT>")<EOL><DEDENT>name, zone = name_and_zone.split(_NAME_ZONE_SEGREGATOR)<EOL>if len(name) == <NUM_LIT:0>:<EOL><INDENT>raise ValueError("<STR_LIT>")<EOL><DEDENT>if len(zone) == <NUM_LIT:0>:<EOL><INDENT>raise ValueError("<STR_LIT>")<EOL><... | Factory method for creating a user from a string in the form `name#zone`.
:param name_and_zone: the user's name followed by hash followed by the user's zone
:return: the created user | f14285:c2:m0 |
@property<EOL><INDENT>def access_controls(self) -> Optional[Set[AccessControl]]:<DEDENT> | return copy(self._access_controls)<EOL> | Gets a copy of the access controls associated to this entity.
:return: copy of the access controls | f14285:c4:m3 |
@access_controls.setter<EOL><INDENT>def access_controls(self, access_controls: Optional[Iterable[AccessControl]]):<DEDENT> | if access_controls is not None:<EOL><INDENT>access_controls = set(access_controls)<EOL><DEDENT>self._access_controls = access_controls<EOL> | Sets the access controls associated to this entity.
:param access_controls: the access controls (immutable) or `None` | f14285:c4:m4 |
def get_collection_path(self) -> str: | return self.path.rsplit('<STR_LIT:/>', <NUM_LIT:1>)[<NUM_LIT:0>]<EOL> | Gets the path of the collection in which this entity resides.
:return: the path of the collection that this entity is in | f14285:c4:m5 |
def get_name(self) -> str: | return self.path.rsplit('<STR_LIT:/>', <NUM_LIT:1>)[-<NUM_LIT:1>]<EOL> | Gets the name of this entity.
:return: the name of this entity | f14285:c4:m6 |
def __init__(self, path: str, access_controls: Iterable[AccessControl]=None,<EOL>metadata: IrodsMetadata=None, replicas: Iterable[DataObjectReplica]=None): | from baton.collections import DataObjectReplicaCollection<EOL>super().__init__(path, access_controls, metadata)<EOL>self.replicas = DataObjectReplicaCollection(replicas) if replicas is not None else None<EOL> | Constructor.
:param path: path of data object in iRODS
:param access_controls: access controls or `None` if not known
:param metadata: iRODS metadata or `None` if not known
:param replicas: replicas or `None` if not known | f14285:c5:m0 |
def get_number_of_arguments(self) -> int: | return self.sql.count("<STR_LIT:?>")<EOL> | Gets the number of a arguments in the specific query.
:return: the number of arguments | f14285:c7:m1 |
@abstractmethod<EOL><INDENT>def get_all(self, paths: Union[str, Sequence[str]]) -> Union[IrodsMetadata, List[IrodsMetadata]]:<DEDENT> | Gets all of the metadata for the iRODS entities at the given path or paths.
If multiple paths are given, the metadata collection at index `i` on the output corresponds to the path at index
`i` on the input. i.e.
```
output = mapper.get_all(["path_1", "path_2"])
metadata_for_path_1 = output[0]
metadata_for_path_2 = out... | f14287:c0:m0 | |
@abstractmethod<EOL><INDENT>def add(self, paths: Union[str, Iterable[str]], metadata: Union[IrodsMetadata, List[IrodsMetadata]]):<DEDENT> | Adds the given metadata to the given iRODS entities at the given path or paths.
If a single metadata collection is given, that metadata is added to all paths. If a list of metadata are given,
each collection is added to the path with the corresponding index.
A `ValueError` will be raised will be raised if the path do... | f14287:c0:m1 | |
@abstractmethod<EOL><INDENT>def set(self, paths: Union[str, Iterable[str]], metadata: Union[IrodsMetadata, List[IrodsMetadata]]):<DEDENT> | Sets the given metadata on the iRODS entities at the given path or paths. Similar to `add` excpet pre-existing
metadata with matching keys will be overwritten.
If a single metadata collection is given, that metadata is set for all paths. If a list of metadata are given,
each collection is set for the path with the cor... | f14287:c0:m2 | |
@abstractmethod<EOL><INDENT>def remove(self, paths: Union[str, Iterable[str]], metadata: Union[IrodsMetadata, List[IrodsMetadata]]):<DEDENT> | Removes the given metadata from the given iRODS entity.
If a single metadata collection is given, that metadata is removed from all paths. If a list of metadata are
given, each collection is removed for the path with the corresponding index.
A `KeyError` will be raised if the entity does not have metadata with the gi... | f14287:c0:m3 | |
@abstractmethod<EOL><INDENT>def remove_all(self, paths: Union[str, Iterable[str]]):<DEDENT> | Removes all of the metadata from the given iRODS entities at the given path or paths.
A `ValueError` will be raised will be raised if the path does not correspond to a valid entity.
:param path: the path of the entity to remove all of the metadata from | f14287:c0:m4 | |
@abstractmethod<EOL><INDENT>def get_all(self, paths: Union[str, Sequence[str]]) -> Union[Set[AccessControl], Sequence[Set[AccessControl]]]:<DEDENT> | Gets all the access controls for the entity with the given path.
:param path: the path of the entity to find access controls for
:return: | f14287:c1:m0 | |
@abstractmethod<EOL><INDENT>def add_or_replace(self, paths: Union[str, Iterable[str]],<EOL>access_controls: Union[AccessControl, Iterable[AccessControl]]):<DEDENT> | Adds the given access controls to those associated with the given path or collection of paths. If an access
control already exists for a user, the access control is replaced.
:param paths: the paths to add the access controls
:param access_controls: the access controls to add | f14287:c1:m1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.