repository_name
stringlengths
5
67
func_path_in_repository
stringlengths
4
234
func_name
stringlengths
0
314
whole_func_string
stringlengths
52
3.87M
language
stringclasses
6 values
func_code_string
stringlengths
52
3.87M
func_code_tokens
listlengths
15
672k
func_documentation_string
stringlengths
1
47.2k
func_documentation_tokens
listlengths
1
3.92k
split_name
stringclasses
1 value
func_code_url
stringlengths
85
339
klavinslab/coral
coral/sequence/_dna.py
DNA.ape
def ape(self, ape_path=None): '''Open in ApE if `ApE` is in your command line path.''' # TODO: simplify - make ApE look in PATH only cmd = 'ApE' if ape_path is None: # Check for ApE in PATH ape_executables = [] for path in os.environ['PATH'].split(os.p...
python
def ape(self, ape_path=None): '''Open in ApE if `ApE` is in your command line path.''' # TODO: simplify - make ApE look in PATH only cmd = 'ApE' if ape_path is None: # Check for ApE in PATH ape_executables = [] for path in os.environ['PATH'].split(os.p...
[ "def", "ape", "(", "self", ",", "ape_path", "=", "None", ")", ":", "# TODO: simplify - make ApE look in PATH only", "cmd", "=", "'ApE'", "if", "ape_path", "is", "None", ":", "# Check for ApE in PATH", "ape_executables", "=", "[", "]", "for", "path", "in", "os", ...
Open in ApE if `ApE` is in your command line path.
[ "Open", "in", "ApE", "if", "ApE", "is", "in", "your", "command", "line", "path", "." ]
train
https://github.com/klavinslab/coral/blob/17f59591211562a59a051f474cd6cecba4829df9/coral/sequence/_dna.py#L84-L111
klavinslab/coral
coral/sequence/_dna.py
DNA.copy
def copy(self): '''Create a copy of the current instance. :returns: A safely-editable copy of the current sequence. :rtype: coral.DNA ''' # Significant performance improvements by skipping alphabet check features_copy = [feature.copy() for feature in self.features] ...
python
def copy(self): '''Create a copy of the current instance. :returns: A safely-editable copy of the current sequence. :rtype: coral.DNA ''' # Significant performance improvements by skipping alphabet check features_copy = [feature.copy() for feature in self.features] ...
[ "def", "copy", "(", "self", ")", ":", "# Significant performance improvements by skipping alphabet check", "features_copy", "=", "[", "feature", ".", "copy", "(", ")", "for", "feature", "in", "self", ".", "features", "]", "copy", "=", "type", "(", "self", ")", ...
Create a copy of the current instance. :returns: A safely-editable copy of the current sequence. :rtype: coral.DNA
[ "Create", "a", "copy", "of", "the", "current", "instance", "." ]
train
https://github.com/klavinslab/coral/blob/17f59591211562a59a051f474cd6cecba4829df9/coral/sequence/_dna.py#L113-L125
klavinslab/coral
coral/sequence/_dna.py
DNA.circularize
def circularize(self): '''Circularize linear DNA. :returns: A circularized version of the current sequence. :rtype: coral.DNA ''' if self.top[-1].seq == '-' and self.bottom[0].seq == '-': raise ValueError('Cannot circularize - termini disconnected.') if self...
python
def circularize(self): '''Circularize linear DNA. :returns: A circularized version of the current sequence. :rtype: coral.DNA ''' if self.top[-1].seq == '-' and self.bottom[0].seq == '-': raise ValueError('Cannot circularize - termini disconnected.') if self...
[ "def", "circularize", "(", "self", ")", ":", "if", "self", ".", "top", "[", "-", "1", "]", ".", "seq", "==", "'-'", "and", "self", ".", "bottom", "[", "0", "]", ".", "seq", "==", "'-'", ":", "raise", "ValueError", "(", "'Cannot circularize - termini ...
Circularize linear DNA. :returns: A circularized version of the current sequence. :rtype: coral.DNA
[ "Circularize", "linear", "DNA", "." ]
train
https://github.com/klavinslab/coral/blob/17f59591211562a59a051f474cd6cecba4829df9/coral/sequence/_dna.py#L127-L143
klavinslab/coral
coral/sequence/_dna.py
DNA.display
def display(self): '''Display a visualization of the sequence in an IPython notebook.''' try: from IPython.display import HTML import uuid except ImportError: raise IPythonDisplayImportError sequence_json = self.json() d3cdn = '//d3js.org/d3....
python
def display(self): '''Display a visualization of the sequence in an IPython notebook.''' try: from IPython.display import HTML import uuid except ImportError: raise IPythonDisplayImportError sequence_json = self.json() d3cdn = '//d3js.org/d3....
[ "def", "display", "(", "self", ")", ":", "try", ":", "from", "IPython", ".", "display", "import", "HTML", "import", "uuid", "except", "ImportError", ":", "raise", "IPythonDisplayImportError", "sequence_json", "=", "self", ".", "json", "(", ")", "d3cdn", "=",...
Display a visualization of the sequence in an IPython notebook.
[ "Display", "a", "visualization", "of", "the", "sequence", "in", "an", "IPython", "notebook", "." ]
train
https://github.com/klavinslab/coral/blob/17f59591211562a59a051f474cd6cecba4829df9/coral/sequence/_dna.py#L145-L176
klavinslab/coral
coral/sequence/_dna.py
DNA.excise
def excise(self, feature): '''Removes feature from circular plasmid and linearizes. Automatically reorients at the base just after the feature. This operation is complementary to the .extract() method. :param feature_name: The feature to remove. :type feature_name: coral.Feature...
python
def excise(self, feature): '''Removes feature from circular plasmid and linearizes. Automatically reorients at the base just after the feature. This operation is complementary to the .extract() method. :param feature_name: The feature to remove. :type feature_name: coral.Feature...
[ "def", "excise", "(", "self", ",", "feature", ")", ":", "rotated", "=", "self", ".", "rotate_to_feature", "(", "feature", ")", "excised", "=", "rotated", "[", "feature", ".", "stop", "-", "feature", ".", "start", ":", "]", "return", "excised" ]
Removes feature from circular plasmid and linearizes. Automatically reorients at the base just after the feature. This operation is complementary to the .extract() method. :param feature_name: The feature to remove. :type feature_name: coral.Feature
[ "Removes", "feature", "from", "circular", "plasmid", "and", "linearizes", ".", "Automatically", "reorients", "at", "the", "base", "just", "after", "the", "feature", ".", "This", "operation", "is", "complementary", "to", "the", ".", "extract", "()", "method", "...
train
https://github.com/klavinslab/coral/blob/17f59591211562a59a051f474cd6cecba4829df9/coral/sequence/_dna.py#L202-L214
klavinslab/coral
coral/sequence/_dna.py
DNA.extract
def extract(self, feature, remove_subfeatures=False): '''Extract a feature from the sequence. This operation is complementary to the .excise() method. :param feature: Feature object. :type feature: coral.sequence.Feature :param remove_subfeatures: Remove all features in the extr...
python
def extract(self, feature, remove_subfeatures=False): '''Extract a feature from the sequence. This operation is complementary to the .excise() method. :param feature: Feature object. :type feature: coral.sequence.Feature :param remove_subfeatures: Remove all features in the extr...
[ "def", "extract", "(", "self", ",", "feature", ",", "remove_subfeatures", "=", "False", ")", ":", "extracted", "=", "self", "[", "feature", ".", "start", ":", "feature", ".", "stop", "]", "# Turn gaps into Ns or Xs", "for", "gap", "in", "feature", ".", "ga...
Extract a feature from the sequence. This operation is complementary to the .excise() method. :param feature: Feature object. :type feature: coral.sequence.Feature :param remove_subfeatures: Remove all features in the extracted sequence aside from the ...
[ "Extract", "a", "feature", "from", "the", "sequence", ".", "This", "operation", "is", "complementary", "to", "the", ".", "excise", "()", "method", "." ]
train
https://github.com/klavinslab/coral/blob/17f59591211562a59a051f474cd6cecba4829df9/coral/sequence/_dna.py#L216-L240
klavinslab/coral
coral/sequence/_dna.py
DNA.flip
def flip(self): '''Flip the DNA - swap the top and bottom strands. :returns: Flipped DNA (bottom strand is now top strand, etc.). :rtype: coral.DNA ''' copy = self.copy() copy.top, copy.bottom = copy.bottom, copy.top copy.features = [_flip_feature(f, len(self)) ...
python
def flip(self): '''Flip the DNA - swap the top and bottom strands. :returns: Flipped DNA (bottom strand is now top strand, etc.). :rtype: coral.DNA ''' copy = self.copy() copy.top, copy.bottom = copy.bottom, copy.top copy.features = [_flip_feature(f, len(self)) ...
[ "def", "flip", "(", "self", ")", ":", "copy", "=", "self", ".", "copy", "(", ")", "copy", ".", "top", ",", "copy", ".", "bottom", "=", "copy", ".", "bottom", ",", "copy", ".", "top", "copy", ".", "features", "=", "[", "_flip_feature", "(", "f", ...
Flip the DNA - swap the top and bottom strands. :returns: Flipped DNA (bottom strand is now top strand, etc.). :rtype: coral.DNA
[ "Flip", "the", "DNA", "-", "swap", "the", "top", "and", "bottom", "strands", "." ]
train
https://github.com/klavinslab/coral/blob/17f59591211562a59a051f474cd6cecba4829df9/coral/sequence/_dna.py#L242-L252
klavinslab/coral
coral/sequence/_dna.py
DNA.linearize
def linearize(self, index=0): '''Linearize circular DNA at an index. :param index: index at which to linearize. :type index: int :returns: A linearized version of the current sequence. :rtype: coral.DNA :raises: ValueError if the input is linear DNA. ''' ...
python
def linearize(self, index=0): '''Linearize circular DNA at an index. :param index: index at which to linearize. :type index: int :returns: A linearized version of the current sequence. :rtype: coral.DNA :raises: ValueError if the input is linear DNA. ''' ...
[ "def", "linearize", "(", "self", ",", "index", "=", "0", ")", ":", "if", "not", "self", ".", "circular", ":", "raise", "ValueError", "(", "'Cannot relinearize linear DNA.'", ")", "copy", "=", "self", ".", "copy", "(", ")", "# Snip at the index", "if", "ind...
Linearize circular DNA at an index. :param index: index at which to linearize. :type index: int :returns: A linearized version of the current sequence. :rtype: coral.DNA :raises: ValueError if the input is linear DNA.
[ "Linearize", "circular", "DNA", "at", "an", "index", "." ]
train
https://github.com/klavinslab/coral/blob/17f59591211562a59a051f474cd6cecba4829df9/coral/sequence/_dna.py#L275-L295
klavinslab/coral
coral/sequence/_dna.py
DNA.locate
def locate(self, pattern): '''Find sequences matching a pattern. For a circular sequence, the search extends over the origin. :param pattern: str or NucleicAcidSequence for which to find matches. :type pattern: str or coral.DNA :returns: A list of top and bottom strand indices o...
python
def locate(self, pattern): '''Find sequences matching a pattern. For a circular sequence, the search extends over the origin. :param pattern: str or NucleicAcidSequence for which to find matches. :type pattern: str or coral.DNA :returns: A list of top and bottom strand indices o...
[ "def", "locate", "(", "self", ",", "pattern", ")", ":", "top_matches", "=", "self", ".", "top", ".", "locate", "(", "pattern", ")", "bottom_matches", "=", "self", ".", "bottom", ".", "locate", "(", "pattern", ")", "return", "[", "top_matches", ",", "bo...
Find sequences matching a pattern. For a circular sequence, the search extends over the origin. :param pattern: str or NucleicAcidSequence for which to find matches. :type pattern: str or coral.DNA :returns: A list of top and bottom strand indices of matches. :rtype: list of lis...
[ "Find", "sequences", "matching", "a", "pattern", ".", "For", "a", "circular", "sequence", "the", "search", "extends", "over", "the", "origin", "." ]
train
https://github.com/klavinslab/coral/blob/17f59591211562a59a051f474cd6cecba4829df9/coral/sequence/_dna.py#L297-L313
klavinslab/coral
coral/sequence/_dna.py
DNA.rotate
def rotate(self, n): '''Rotate Sequence by n bases. :param n: Number of bases to rotate. :type n: int :returns: The current sequence reoriented at `index`. :rtype: coral.DNA :raises: ValueError if applied to linear sequence or `index` is negative. ...
python
def rotate(self, n): '''Rotate Sequence by n bases. :param n: Number of bases to rotate. :type n: int :returns: The current sequence reoriented at `index`. :rtype: coral.DNA :raises: ValueError if applied to linear sequence or `index` is negative. ...
[ "def", "rotate", "(", "self", ",", "n", ")", ":", "if", "not", "self", ".", "circular", "and", "n", "!=", "0", ":", "raise", "ValueError", "(", "'Cannot rotate linear DNA'", ")", "else", ":", "copy", "=", "self", ".", "copy", "(", ")", "copy", ".", ...
Rotate Sequence by n bases. :param n: Number of bases to rotate. :type n: int :returns: The current sequence reoriented at `index`. :rtype: coral.DNA :raises: ValueError if applied to linear sequence or `index` is negative.
[ "Rotate", "Sequence", "by", "n", "bases", "." ]
train
https://github.com/klavinslab/coral/blob/17f59591211562a59a051f474cd6cecba4829df9/coral/sequence/_dna.py#L324-L350
klavinslab/coral
coral/sequence/_dna.py
DNA.reverse_complement
def reverse_complement(self): '''Reverse complement the DNA. :returns: A reverse-complemented instance of the current sequence. :rtype: coral.DNA ''' copy = self.copy() # Note: if sequence is double-stranded, swapping strand is basically # (but not entirely) the...
python
def reverse_complement(self): '''Reverse complement the DNA. :returns: A reverse-complemented instance of the current sequence. :rtype: coral.DNA ''' copy = self.copy() # Note: if sequence is double-stranded, swapping strand is basically # (but not entirely) the...
[ "def", "reverse_complement", "(", "self", ")", ":", "copy", "=", "self", ".", "copy", "(", ")", "# Note: if sequence is double-stranded, swapping strand is basically", "# (but not entirely) the same thing - gaps affect accuracy.", "copy", ".", "top", "=", "self", ".", "top"...
Reverse complement the DNA. :returns: A reverse-complemented instance of the current sequence. :rtype: coral.DNA
[ "Reverse", "complement", "the", "DNA", "." ]
train
https://github.com/klavinslab/coral/blob/17f59591211562a59a051f474cd6cecba4829df9/coral/sequence/_dna.py#L379-L395
klavinslab/coral
coral/sequence/_dna.py
DNA.select_features
def select_features(self, term, by='name', fuzzy=False): '''Select features from the features list based on feature name, gene, or locus tag. :param term: Search term. :type term: str :param by: Feature attribute to search by. Options are 'name', 'gene', an...
python
def select_features(self, term, by='name', fuzzy=False): '''Select features from the features list based on feature name, gene, or locus tag. :param term: Search term. :type term: str :param by: Feature attribute to search by. Options are 'name', 'gene', an...
[ "def", "select_features", "(", "self", ",", "term", ",", "by", "=", "'name'", ",", "fuzzy", "=", "False", ")", ":", "features", "=", "[", "]", "if", "fuzzy", ":", "fuzzy_term", "=", "term", ".", "lower", "(", ")", "for", "feature", "in", "self", "....
Select features from the features list based on feature name, gene, or locus tag. :param term: Search term. :type term: str :param by: Feature attribute to search by. Options are 'name', 'gene', and 'locus_tag'. :type by: str :param fuzzy: If ...
[ "Select", "features", "from", "the", "features", "list", "based", "on", "feature", "name", "gene", "or", "locus", "tag", ".", ":", "param", "term", ":", "Search", "term", ".", ":", "type", "term", ":", "str", ":", "param", "by", ":", "Feature", "attrib...
train
https://github.com/klavinslab/coral/blob/17f59591211562a59a051f474cd6cecba4829df9/coral/sequence/_dna.py#L397-L424
klavinslab/coral
coral/sequence/_dna.py
DNA.to_feature
def to_feature(self, name=None, feature_type='misc_feature'): '''Create a feature from the current object. :param name: Name for the new feature. Must be specified if the DNA instance has no .name attribute. :type name: str :param feature_type: The type of feature (...
python
def to_feature(self, name=None, feature_type='misc_feature'): '''Create a feature from the current object. :param name: Name for the new feature. Must be specified if the DNA instance has no .name attribute. :type name: str :param feature_type: The type of feature (...
[ "def", "to_feature", "(", "self", ",", "name", "=", "None", ",", "feature_type", "=", "'misc_feature'", ")", ":", "if", "name", "is", "None", ":", "if", "not", "self", ".", "name", ":", "raise", "ValueError", "(", "'name attribute missing from DNA instance'", ...
Create a feature from the current object. :param name: Name for the new feature. Must be specified if the DNA instance has no .name attribute. :type name: str :param feature_type: The type of feature (genbank standard). :type feature_type: str
[ "Create", "a", "feature", "from", "the", "current", "object", "." ]
train
https://github.com/klavinslab/coral/blob/17f59591211562a59a051f474cd6cecba4829df9/coral/sequence/_dna.py#L436-L452
klavinslab/coral
coral/sequence/_dna.py
RestrictionSite.cuts_outside
def cuts_outside(self): '''Report whether the enzyme cuts outside its recognition site. Cutting at the very end of the site returns True. :returns: Whether the enzyme will cut outside its recognition site. :rtype: bool ''' for index in self.cut_site: if inde...
python
def cuts_outside(self): '''Report whether the enzyme cuts outside its recognition site. Cutting at the very end of the site returns True. :returns: Whether the enzyme will cut outside its recognition site. :rtype: bool ''' for index in self.cut_site: if inde...
[ "def", "cuts_outside", "(", "self", ")", ":", "for", "index", "in", "self", ".", "cut_site", ":", "if", "index", "<", "0", "or", "index", ">", "len", "(", "self", ".", "recognition_site", ")", "+", "1", ":", "return", "True", "return", "False" ]
Report whether the enzyme cuts outside its recognition site. Cutting at the very end of the site returns True. :returns: Whether the enzyme will cut outside its recognition site. :rtype: bool
[ "Report", "whether", "the", "enzyme", "cuts", "outside", "its", "recognition", "site", ".", "Cutting", "at", "the", "very", "end", "of", "the", "site", "returns", "True", "." ]
train
https://github.com/klavinslab/coral/blob/17f59591211562a59a051f474cd6cecba4829df9/coral/sequence/_dna.py#L787-L798
klavinslab/coral
coral/sequence/_dna.py
Primer.copy
def copy(self): '''Generate a Primer copy. :returns: A safely-editable copy of the current primer. :rtype: coral.DNA ''' return type(self)(self.anneal, self.tm, overhang=self.overhang, name=self.name, note=self.note)
python
def copy(self): '''Generate a Primer copy. :returns: A safely-editable copy of the current primer. :rtype: coral.DNA ''' return type(self)(self.anneal, self.tm, overhang=self.overhang, name=self.name, note=self.note)
[ "def", "copy", "(", "self", ")", ":", "return", "type", "(", "self", ")", "(", "self", ".", "anneal", ",", "self", ".", "tm", ",", "overhang", "=", "self", ".", "overhang", ",", "name", "=", "self", ".", "name", ",", "note", "=", "self", ".", "...
Generate a Primer copy. :returns: A safely-editable copy of the current primer. :rtype: coral.DNA
[ "Generate", "a", "Primer", "copy", "." ]
train
https://github.com/klavinslab/coral/blob/17f59591211562a59a051f474cd6cecba4829df9/coral/sequence/_dna.py#L886-L894
klavinslab/coral
coral/analysis/_sequence/melting_temp.py
tm
def tm(seq, dna_conc=50, salt_conc=50, parameters='cloning'): '''Calculate nearest-neighbor melting temperature (Tm). :param seq: Sequence for which to calculate the tm. :type seq: coral.DNA :param dna_conc: DNA concentration in nM. :type dna_conc: float :param salt_conc: Salt concentration in ...
python
def tm(seq, dna_conc=50, salt_conc=50, parameters='cloning'): '''Calculate nearest-neighbor melting temperature (Tm). :param seq: Sequence for which to calculate the tm. :type seq: coral.DNA :param dna_conc: DNA concentration in nM. :type dna_conc: float :param salt_conc: Salt concentration in ...
[ "def", "tm", "(", "seq", ",", "dna_conc", "=", "50", ",", "salt_conc", "=", "50", ",", "parameters", "=", "'cloning'", ")", ":", "if", "parameters", "==", "'breslauer'", ":", "params", "=", "tm_params", ".", "BRESLAUER", "elif", "parameters", "==", "'sug...
Calculate nearest-neighbor melting temperature (Tm). :param seq: Sequence for which to calculate the tm. :type seq: coral.DNA :param dna_conc: DNA concentration in nM. :type dna_conc: float :param salt_conc: Salt concentration in mM. :type salt_conc: float :param parameters: Nearest-neighbo...
[ "Calculate", "nearest", "-", "neighbor", "melting", "temperature", "(", "Tm", ")", "." ]
train
https://github.com/klavinslab/coral/blob/17f59591211562a59a051f474cd6cecba4829df9/coral/analysis/_sequence/melting_temp.py#L22-L144
klavinslab/coral
coral/analysis/_sequence/melting_temp.py
_pair_deltas
def _pair_deltas(seq, pars): '''Add up nearest-neighbor parameters for a given sequence. :param seq: DNA sequence for which to sum nearest neighbors :type seq: str :param pars: parameter set to use :type pars: dict :returns: nearest-neighbor delta_H and delta_S sums. :rtype: tuple of floats...
python
def _pair_deltas(seq, pars): '''Add up nearest-neighbor parameters for a given sequence. :param seq: DNA sequence for which to sum nearest neighbors :type seq: str :param pars: parameter set to use :type pars: dict :returns: nearest-neighbor delta_H and delta_S sums. :rtype: tuple of floats...
[ "def", "_pair_deltas", "(", "seq", ",", "pars", ")", ":", "delta0", "=", "0", "delta1", "=", "0", "for", "i", "in", "range", "(", "len", "(", "seq", ")", "-", "1", ")", ":", "curchar", "=", "seq", "[", "i", ":", "i", "+", "2", "]", "delta0", ...
Add up nearest-neighbor parameters for a given sequence. :param seq: DNA sequence for which to sum nearest neighbors :type seq: str :param pars: parameter set to use :type pars: dict :returns: nearest-neighbor delta_H and delta_S sums. :rtype: tuple of floats
[ "Add", "up", "nearest", "-", "neighbor", "parameters", "for", "a", "given", "sequence", "." ]
train
https://github.com/klavinslab/coral/blob/17f59591211562a59a051f474cd6cecba4829df9/coral/analysis/_sequence/melting_temp.py#L147-L164
klavinslab/coral
coral/analysis/_sequence/melting_temp.py
breslauer_corrections
def breslauer_corrections(seq, pars_error): '''Sum corrections for Breslauer '84 method. :param seq: sequence for which to calculate corrections. :type seq: str :param pars_error: dictionary of error corrections :type pars_error: dict :returns: Corrected delta_H and delta_S parameters :rtyp...
python
def breslauer_corrections(seq, pars_error): '''Sum corrections for Breslauer '84 method. :param seq: sequence for which to calculate corrections. :type seq: str :param pars_error: dictionary of error corrections :type pars_error: dict :returns: Corrected delta_H and delta_S parameters :rtyp...
[ "def", "breslauer_corrections", "(", "seq", ",", "pars_error", ")", ":", "deltas_corr", "=", "[", "0", ",", "0", "]", "contains_gc", "=", "'G'", "in", "str", "(", "seq", ")", "or", "'C'", "in", "str", "(", "seq", ")", "only_at", "=", "str", "(", "s...
Sum corrections for Breslauer '84 method. :param seq: sequence for which to calculate corrections. :type seq: str :param pars_error: dictionary of error corrections :type pars_error: dict :returns: Corrected delta_H and delta_S parameters :rtype: list of floats
[ "Sum", "corrections", "for", "Breslauer", "84", "method", "." ]
train
https://github.com/klavinslab/coral/blob/17f59591211562a59a051f474cd6cecba4829df9/coral/analysis/_sequence/melting_temp.py#L167-L193
klavinslab/coral
coral/analysis/_sequence/melting_temp.py
santalucia98_corrections
def santalucia98_corrections(seq, pars_error): '''Sum corrections for SantaLucia '98 method (unified parameters). :param seq: sequence for which to calculate corrections. :type seq: str :param pars_error: dictionary of error corrections :type pars_error: dict :returns: Corrected delta_H and del...
python
def santalucia98_corrections(seq, pars_error): '''Sum corrections for SantaLucia '98 method (unified parameters). :param seq: sequence for which to calculate corrections. :type seq: str :param pars_error: dictionary of error corrections :type pars_error: dict :returns: Corrected delta_H and del...
[ "def", "santalucia98_corrections", "(", "seq", ",", "pars_error", ")", ":", "deltas_corr", "=", "[", "0", ",", "0", "]", "first", "=", "str", "(", "seq", ")", "[", "0", "]", "last", "=", "str", "(", "seq", ")", "[", "-", "1", "]", "start_gc", "="...
Sum corrections for SantaLucia '98 method (unified parameters). :param seq: sequence for which to calculate corrections. :type seq: str :param pars_error: dictionary of error corrections :type pars_error: dict :returns: Corrected delta_H and delta_S parameters :rtype: list of floats
[ "Sum", "corrections", "for", "SantaLucia", "98", "method", "(", "unified", "parameters", ")", "." ]
train
https://github.com/klavinslab/coral/blob/17f59591211562a59a051f474cd6cecba4829df9/coral/analysis/_sequence/melting_temp.py#L196-L225
klavinslab/coral
coral/analysis/_sequencing/mafft.py
MAFFT
def MAFFT(sequences, gap_open=1.53, gap_extension=0.0, retree=2): '''A Coral wrapper for the MAFFT command line multiple sequence aligner. :param sequences: A list of sequences to align. :type sequences: List of homogeneous sequences (all DNA, or all RNA, etc.) :param gap_open: --o...
python
def MAFFT(sequences, gap_open=1.53, gap_extension=0.0, retree=2): '''A Coral wrapper for the MAFFT command line multiple sequence aligner. :param sequences: A list of sequences to align. :type sequences: List of homogeneous sequences (all DNA, or all RNA, etc.) :param gap_open: --o...
[ "def", "MAFFT", "(", "sequences", ",", "gap_open", "=", "1.53", ",", "gap_extension", "=", "0.0", ",", "retree", "=", "2", ")", ":", "arguments", "=", "[", "'mafft'", "]", "arguments", "+=", "[", "'--op'", ",", "str", "(", "gap_open", ")", "]", "argu...
A Coral wrapper for the MAFFT command line multiple sequence aligner. :param sequences: A list of sequences to align. :type sequences: List of homogeneous sequences (all DNA, or all RNA, etc.) :param gap_open: --op (gap open) penalty in MAFFT cli. :type gap_open: float :param g...
[ "A", "Coral", "wrapper", "for", "the", "MAFFT", "command", "line", "multiple", "sequence", "aligner", "." ]
train
https://github.com/klavinslab/coral/blob/17f59591211562a59a051f474cd6cecba4829df9/coral/analysis/_sequencing/mafft.py#L9-L55
klavinslab/coral
coral/analysis/_sequence/repeats.py
repeats
def repeats(seq, size): '''Count times that a sequence of a certain size is repeated. :param seq: Input sequence. :type seq: coral.DNA or coral.RNA :param size: Size of the repeat to count. :type size: int :returns: Occurrences of repeats and how many :rtype: tuple of the matched sequence a...
python
def repeats(seq, size): '''Count times that a sequence of a certain size is repeated. :param seq: Input sequence. :type seq: coral.DNA or coral.RNA :param size: Size of the repeat to count. :type size: int :returns: Occurrences of repeats and how many :rtype: tuple of the matched sequence a...
[ "def", "repeats", "(", "seq", ",", "size", ")", ":", "seq", "=", "str", "(", "seq", ")", "n_mers", "=", "[", "seq", "[", "i", ":", "i", "+", "size", "]", "for", "i", "in", "range", "(", "len", "(", "seq", ")", "-", "size", "+", "1", ")", ...
Count times that a sequence of a certain size is repeated. :param seq: Input sequence. :type seq: coral.DNA or coral.RNA :param size: Size of the repeat to count. :type size: int :returns: Occurrences of repeats and how many :rtype: tuple of the matched sequence and how many times it occurs
[ "Count", "times", "that", "a", "sequence", "of", "a", "certain", "size", "is", "repeated", "." ]
train
https://github.com/klavinslab/coral/blob/17f59591211562a59a051f474cd6cecba4829df9/coral/analysis/_sequence/repeats.py#L5-L22
klavinslab/coral
coral/reaction/_gibson.py
gibson
def gibson(seq_list, linear=False, homology=10, tm=63.0): '''Simulate a Gibson reaction. :param seq_list: list of DNA sequences to Gibson :type seq_list: list of coral.DNA :param linear: Attempt to produce linear, rather than circular, fragment from input fragments. :type linear:...
python
def gibson(seq_list, linear=False, homology=10, tm=63.0): '''Simulate a Gibson reaction. :param seq_list: list of DNA sequences to Gibson :type seq_list: list of coral.DNA :param linear: Attempt to produce linear, rather than circular, fragment from input fragments. :type linear:...
[ "def", "gibson", "(", "seq_list", ",", "linear", "=", "False", ",", "homology", "=", "10", ",", "tm", "=", "63.0", ")", ":", "# FIXME: Preserve features in overlap", "# TODO: set a max length?", "# TODO: add 'expected' keyword argument somewhere to automate", "# validation"...
Simulate a Gibson reaction. :param seq_list: list of DNA sequences to Gibson :type seq_list: list of coral.DNA :param linear: Attempt to produce linear, rather than circular, fragment from input fragments. :type linear: bool :param homology_min: minimum bp of homology allowed ...
[ "Simulate", "a", "Gibson", "reaction", "." ]
train
https://github.com/klavinslab/coral/blob/17f59591211562a59a051f474cd6cecba4829df9/coral/reaction/_gibson.py#L21-L60
klavinslab/coral
coral/reaction/_gibson.py
_find_fuse_next
def _find_fuse_next(working_list, homology, tm): '''Find the next sequence to fuse, and fuse it (or raise exception). :param homology: length of terminal homology in bp :type homology: int :raises: AmbiguousGibsonError if there is more than one way for the fragment ends to combine. ...
python
def _find_fuse_next(working_list, homology, tm): '''Find the next sequence to fuse, and fuse it (or raise exception). :param homology: length of terminal homology in bp :type homology: int :raises: AmbiguousGibsonError if there is more than one way for the fragment ends to combine. ...
[ "def", "_find_fuse_next", "(", "working_list", ",", "homology", ",", "tm", ")", ":", "# 1. Take the first sequence and find all matches", "# Get graphs:", "# a) pattern watson : targets watson", "# b) pattern watson : targets crick", "# c) pattern crick: targets watson", "# d) ...
Find the next sequence to fuse, and fuse it (or raise exception). :param homology: length of terminal homology in bp :type homology: int :raises: AmbiguousGibsonError if there is more than one way for the fragment ends to combine. GibsonOverlapError if no homology match can be fou...
[ "Find", "the", "next", "sequence", "to", "fuse", "and", "fuse", "it", "(", "or", "raise", "exception", ")", "." ]
train
https://github.com/klavinslab/coral/blob/17f59591211562a59a051f474cd6cecba4829df9/coral/reaction/_gibson.py#L87-L150
klavinslab/coral
coral/reaction/_gibson.py
_fuse_last
def _fuse_last(working_list, homology, tm): '''With one sequence left, attempt to fuse it to itself. :param homology: length of terminal homology in bp. :type homology: int :raises: AmbiguousGibsonError if either of the termini are palindromic (would bind self-self). ValueErro...
python
def _fuse_last(working_list, homology, tm): '''With one sequence left, attempt to fuse it to itself. :param homology: length of terminal homology in bp. :type homology: int :raises: AmbiguousGibsonError if either of the termini are palindromic (would bind self-self). ValueErro...
[ "def", "_fuse_last", "(", "working_list", ",", "homology", ",", "tm", ")", ":", "# 1. Construct graph on self-self", "# (destination, size, strand1, strand2)", "pattern", "=", "working_list", "[", "0", "]", "def", "graph_strands", "(", "strand1", ",", "strand2", ")...
With one sequence left, attempt to fuse it to itself. :param homology: length of terminal homology in bp. :type homology: int :raises: AmbiguousGibsonError if either of the termini are palindromic (would bind self-self). ValueError if the ends are not compatible.
[ "With", "one", "sequence", "left", "attempt", "to", "fuse", "it", "to", "itself", "." ]
train
https://github.com/klavinslab/coral/blob/17f59591211562a59a051f474cd6cecba4829df9/coral/reaction/_gibson.py#L153-L191
klavinslab/coral
coral/reaction/_gibson.py
homology_report
def homology_report(seq1, seq2, strand1, strand2, cutoff=0, min_tm=63.0, top_two=False, max_size=500): '''Given two sequences (seq1 and seq2), report the size of all perfect matches between the 3' end of the top strand of seq1 and the 3' end of either strand of seq2. In short, in a Gibso...
python
def homology_report(seq1, seq2, strand1, strand2, cutoff=0, min_tm=63.0, top_two=False, max_size=500): '''Given two sequences (seq1 and seq2), report the size of all perfect matches between the 3' end of the top strand of seq1 and the 3' end of either strand of seq2. In short, in a Gibso...
[ "def", "homology_report", "(", "seq1", ",", "seq2", ",", "strand1", ",", "strand2", ",", "cutoff", "=", "0", ",", "min_tm", "=", "63.0", ",", "top_two", "=", "False", ",", "max_size", "=", "500", ")", ":", "# Ensure that strand 1 is Watson and strand 2 is Cric...
Given two sequences (seq1 and seq2), report the size of all perfect matches between the 3' end of the top strand of seq1 and the 3' end of either strand of seq2. In short, in a Gibson reaction, what would bind the desired part of seq1, given a seq2? :param seq1: Sequence for which to test 3\' binding o...
[ "Given", "two", "sequences", "(", "seq1", "and", "seq2", ")", "report", "the", "size", "of", "all", "perfect", "matches", "between", "the", "3", "end", "of", "the", "top", "strand", "of", "seq1", "and", "the", "3", "end", "of", "either", "strand", "of"...
train
https://github.com/klavinslab/coral/blob/17f59591211562a59a051f474cd6cecba4829df9/coral/reaction/_gibson.py#L194-L270
klavinslab/coral
coral/database/_yeast.py
fetch_yeast_locus_sequence
def fetch_yeast_locus_sequence(locus_name, flanking_size=0): '''Acquire a sequence from SGD http://www.yeastgenome.org. :param locus_name: Common name or systematic name for the locus (e.g. ACT1 or YFL039C). :type locus_name: str :param flanking_size: The length of flanking DNA (...
python
def fetch_yeast_locus_sequence(locus_name, flanking_size=0): '''Acquire a sequence from SGD http://www.yeastgenome.org. :param locus_name: Common name or systematic name for the locus (e.g. ACT1 or YFL039C). :type locus_name: str :param flanking_size: The length of flanking DNA (...
[ "def", "fetch_yeast_locus_sequence", "(", "locus_name", ",", "flanking_size", "=", "0", ")", ":", "from", "intermine", ".", "webservice", "import", "Service", "service", "=", "Service", "(", "'http://yeastmine.yeastgenome.org/yeastmine/service'", ")", "# Get a new query o...
Acquire a sequence from SGD http://www.yeastgenome.org. :param locus_name: Common name or systematic name for the locus (e.g. ACT1 or YFL039C). :type locus_name: str :param flanking_size: The length of flanking DNA (on each side) to return :type flanking_size: int
[ "Acquire", "a", "sequence", "from", "SGD", "http", ":", "//", "www", ".", "yeastgenome", ".", "org", "." ]
train
https://github.com/klavinslab/coral/blob/17f59591211562a59a051f474cd6cecba4829df9/coral/database/_yeast.py#L6-L83
klavinslab/coral
coral/database/_yeast.py
get_yeast_sequence
def get_yeast_sequence(chromosome, start, end, reverse_complement=False): '''Acquire a sequence from SGD http://www.yeastgenome.org :param chromosome: Yeast chromosome. :type chromosome: int :param start: A biostart. :type start: int :param end: A bioend. :type end: int :param reverse_co...
python
def get_yeast_sequence(chromosome, start, end, reverse_complement=False): '''Acquire a sequence from SGD http://www.yeastgenome.org :param chromosome: Yeast chromosome. :type chromosome: int :param start: A biostart. :type start: int :param end: A bioend. :type end: int :param reverse_co...
[ "def", "get_yeast_sequence", "(", "chromosome", ",", "start", ",", "end", ",", "reverse_complement", "=", "False", ")", ":", "import", "requests", "if", "start", "!=", "end", ":", "if", "reverse_complement", ":", "rev_option", "=", "'-REV'", "else", ":", "re...
Acquire a sequence from SGD http://www.yeastgenome.org :param chromosome: Yeast chromosome. :type chromosome: int :param start: A biostart. :type start: int :param end: A bioend. :type end: int :param reverse_complement: Get the reverse complement. :type revervse_complement: bool :re...
[ "Acquire", "a", "sequence", "from", "SGD", "http", ":", "//", "www", ".", "yeastgenome", ".", "org", ":", "param", "chromosome", ":", "Yeast", "chromosome", ".", ":", "type", "chromosome", ":", "int", ":", "param", "start", ":", "A", "biostart", ".", "...
train
https://github.com/klavinslab/coral/blob/17f59591211562a59a051f474cd6cecba4829df9/coral/database/_yeast.py#L86-L126
klavinslab/coral
coral/database/_yeast.py
get_yeast_gene_location
def get_yeast_gene_location(gene_name): '''Acquire the location of a gene from SGD http://www.yeastgenome.org :param gene_name: Name of the gene. :type gene_name: string :returns location: [int: chromosome, int:biostart, int:bioend, int:strand] :rtype location: list ''' from intermine.webse...
python
def get_yeast_gene_location(gene_name): '''Acquire the location of a gene from SGD http://www.yeastgenome.org :param gene_name: Name of the gene. :type gene_name: string :returns location: [int: chromosome, int:biostart, int:bioend, int:strand] :rtype location: list ''' from intermine.webse...
[ "def", "get_yeast_gene_location", "(", "gene_name", ")", ":", "from", "intermine", ".", "webservice", "import", "Service", "service", "=", "Service", "(", "'http://yeastmine.yeastgenome.org/yeastmine/service'", ")", "# Get a new query on the class (table) you will be querying:", ...
Acquire the location of a gene from SGD http://www.yeastgenome.org :param gene_name: Name of the gene. :type gene_name: string :returns location: [int: chromosome, int:biostart, int:bioend, int:strand] :rtype location: list
[ "Acquire", "the", "location", "of", "a", "gene", "from", "SGD", "http", ":", "//", "www", ".", "yeastgenome", ".", "org", ":", "param", "gene_name", ":", "Name", "of", "the", "gene", ".", ":", "type", "gene_name", ":", "string", ":", "returns", "locati...
train
https://github.com/klavinslab/coral/blob/17f59591211562a59a051f474cd6cecba4829df9/coral/database/_yeast.py#L129-L182
klavinslab/coral
coral/database/_yeast.py
get_gene_id
def get_gene_id(gene_name): '''Retrieve systematic yeast gene name from the common name. :param gene_name: Common name for yeast gene (e.g. ADE2). :type gene_name: str :returns: Systematic name for yeast gene (e.g. YOR128C). :rtype: str ''' from intermine.webservice import Service ser...
python
def get_gene_id(gene_name): '''Retrieve systematic yeast gene name from the common name. :param gene_name: Common name for yeast gene (e.g. ADE2). :type gene_name: str :returns: Systematic name for yeast gene (e.g. YOR128C). :rtype: str ''' from intermine.webservice import Service ser...
[ "def", "get_gene_id", "(", "gene_name", ")", ":", "from", "intermine", ".", "webservice", "import", "Service", "service", "=", "Service", "(", "'http://yeastmine.yeastgenome.org/yeastmine/service'", ")", "# Get a new query on the class (table) you will be querying:", "query", ...
Retrieve systematic yeast gene name from the common name. :param gene_name: Common name for yeast gene (e.g. ADE2). :type gene_name: str :returns: Systematic name for yeast gene (e.g. YOR128C). :rtype: str
[ "Retrieve", "systematic", "yeast", "gene", "name", "from", "the", "common", "name", "." ]
train
https://github.com/klavinslab/coral/blob/17f59591211562a59a051f474cd6cecba4829df9/coral/database/_yeast.py#L185-L219
klavinslab/coral
coral/database/_yeast.py
get_yeast_promoter_ypa
def get_yeast_promoter_ypa(gene_name): '''Retrieve promoter from Yeast Promoter Atlas (http://ypa.csbb.ntu.edu.tw). :param gene_name: Common name for yeast gene. :type gene_name: str :returns: Double-stranded DNA sequence of the promoter. :rtype: coral.DNA ''' import requests loc ...
python
def get_yeast_promoter_ypa(gene_name): '''Retrieve promoter from Yeast Promoter Atlas (http://ypa.csbb.ntu.edu.tw). :param gene_name: Common name for yeast gene. :type gene_name: str :returns: Double-stranded DNA sequence of the promoter. :rtype: coral.DNA ''' import requests loc ...
[ "def", "get_yeast_promoter_ypa", "(", "gene_name", ")", ":", "import", "requests", "loc", "=", "get_yeast_gene_location", "(", "gene_name", ")", "gid", "=", "get_gene_id", "(", "gene_name", ")", "ypa_baseurl", "=", "'http://ypa.csbb.ntu.edu.tw/do'", "params", "=", "...
Retrieve promoter from Yeast Promoter Atlas (http://ypa.csbb.ntu.edu.tw). :param gene_name: Common name for yeast gene. :type gene_name: str :returns: Double-stranded DNA sequence of the promoter. :rtype: coral.DNA
[ "Retrieve", "promoter", "from", "Yeast", "Promoter", "Atlas", "(", "http", ":", "//", "ypa", ".", "csbb", ".", "ntu", ".", "edu", ".", "tw", ")", "." ]
train
https://github.com/klavinslab/coral/blob/17f59591211562a59a051f474cd6cecba4829df9/coral/database/_yeast.py#L222-L259
klavinslab/coral
coral/design/_oligo_synthesis/oligo_assembly.py
_grow_overlaps
def _grow_overlaps(dna, melting_temp, require_even, length_max, overlap_min, min_exception): '''Grows equidistant overlaps until they meet specified constraints. :param dna: Input sequence. :type dna: coral.DNA :param melting_temp: Ideal Tm of the overlaps, in degrees C. :type me...
python
def _grow_overlaps(dna, melting_temp, require_even, length_max, overlap_min, min_exception): '''Grows equidistant overlaps until they meet specified constraints. :param dna: Input sequence. :type dna: coral.DNA :param melting_temp: Ideal Tm of the overlaps, in degrees C. :type me...
[ "def", "_grow_overlaps", "(", "dna", ",", "melting_temp", ",", "require_even", ",", "length_max", ",", "overlap_min", ",", "min_exception", ")", ":", "# TODO: prevent growing overlaps from bumping into each other -", "# should halt when it happens, give warning, let user decide if ...
Grows equidistant overlaps until they meet specified constraints. :param dna: Input sequence. :type dna: coral.DNA :param melting_temp: Ideal Tm of the overlaps, in degrees C. :type melting_temp: float :param require_even: Require that the number of oligonucleotides is even. :type require_even:...
[ "Grows", "equidistant", "overlaps", "until", "they", "meet", "specified", "constraints", "." ]
train
https://github.com/klavinslab/coral/blob/17f59591211562a59a051f474cd6cecba4829df9/coral/design/_oligo_synthesis/oligo_assembly.py#L215-L347
klavinslab/coral
coral/design/_oligo_synthesis/oligo_assembly.py
_recalculate_overlaps
def _recalculate_overlaps(dna, overlaps, oligo_indices): '''Recalculate overlap sequences based on the current overlap indices. :param dna: Sequence being split into oligos. :type dna: coral.DNA :param overlaps: Current overlaps - a list of DNA sequences. :type overlaps: coral.DNA list :param o...
python
def _recalculate_overlaps(dna, overlaps, oligo_indices): '''Recalculate overlap sequences based on the current overlap indices. :param dna: Sequence being split into oligos. :type dna: coral.DNA :param overlaps: Current overlaps - a list of DNA sequences. :type overlaps: coral.DNA list :param o...
[ "def", "_recalculate_overlaps", "(", "dna", ",", "overlaps", ",", "oligo_indices", ")", ":", "for", "i", ",", "overlap", "in", "enumerate", "(", "overlaps", ")", ":", "first_index", "=", "oligo_indices", "[", "0", "]", "[", "i", "+", "1", "]", "second_in...
Recalculate overlap sequences based on the current overlap indices. :param dna: Sequence being split into oligos. :type dna: coral.DNA :param overlaps: Current overlaps - a list of DNA sequences. :type overlaps: coral.DNA list :param oligo_indices: List of oligo indices (starts and stops). :typ...
[ "Recalculate", "overlap", "sequences", "based", "on", "the", "current", "overlap", "indices", "." ]
train
https://github.com/klavinslab/coral/blob/17f59591211562a59a051f474cd6cecba4829df9/coral/design/_oligo_synthesis/oligo_assembly.py#L350-L369
klavinslab/coral
coral/design/_oligo_synthesis/oligo_assembly.py
_expand_overlap
def _expand_overlap(dna, oligo_indices, index, oligos, length_max): '''Given an overlap to increase, increases smaller oligo. :param dna: Sequence being split into oligos. :type dna: coral.DNA :param oligo_indices: index of oligo starts and stops :type oligo_indices: list :param index: index of...
python
def _expand_overlap(dna, oligo_indices, index, oligos, length_max): '''Given an overlap to increase, increases smaller oligo. :param dna: Sequence being split into oligos. :type dna: coral.DNA :param oligo_indices: index of oligo starts and stops :type oligo_indices: list :param index: index of...
[ "def", "_expand_overlap", "(", "dna", ",", "oligo_indices", ",", "index", ",", "oligos", ",", "length_max", ")", ":", "left_len", "=", "len", "(", "oligos", "[", "index", "]", ")", "right_len", "=", "len", "(", "oligos", "[", "index", "+", "1", "]", ...
Given an overlap to increase, increases smaller oligo. :param dna: Sequence being split into oligos. :type dna: coral.DNA :param oligo_indices: index of oligo starts and stops :type oligo_indices: list :param index: index of the oligo :type index: int :param left_len: length of left oligo ...
[ "Given", "an", "overlap", "to", "increase", "increases", "smaller", "oligo", "." ]
train
https://github.com/klavinslab/coral/blob/17f59591211562a59a051f474cd6cecba4829df9/coral/design/_oligo_synthesis/oligo_assembly.py#L372-L409
klavinslab/coral
coral/design/_oligo_synthesis/oligo_assembly.py
_adjust_overlap
def _adjust_overlap(positions_list, index, direction): '''Increase overlap to the right or left of an index. :param positions_list: list of overlap positions :type positions_list: list :param index: index of the overlap to increase. :type index: int :param direction: which side of the overlap t...
python
def _adjust_overlap(positions_list, index, direction): '''Increase overlap to the right or left of an index. :param positions_list: list of overlap positions :type positions_list: list :param index: index of the overlap to increase. :type index: int :param direction: which side of the overlap t...
[ "def", "_adjust_overlap", "(", "positions_list", ",", "index", ",", "direction", ")", ":", "if", "direction", "==", "'left'", ":", "positions_list", "[", "index", "+", "1", "]", "-=", "1", "elif", "direction", "==", "'right'", ":", "positions_list", "[", "...
Increase overlap to the right or left of an index. :param positions_list: list of overlap positions :type positions_list: list :param index: index of the overlap to increase. :type index: int :param direction: which side of the overlap to increase - left or right. :type direction: str :retu...
[ "Increase", "overlap", "to", "the", "right", "or", "left", "of", "an", "index", "." ]
train
https://github.com/klavinslab/coral/blob/17f59591211562a59a051f474cd6cecba4829df9/coral/design/_oligo_synthesis/oligo_assembly.py#L412-L432
klavinslab/coral
coral/design/_oligo_synthesis/oligo_assembly.py
OligoAssembly.design_assembly
def design_assembly(self): '''Design the overlapping oligos. :returns: Assembly oligos, and the sequences, Tms, and indices of their overlapping regions. :rtype: dict ''' # Input parameters needed to design the oligos length_range = self.kwargs['length...
python
def design_assembly(self): '''Design the overlapping oligos. :returns: Assembly oligos, and the sequences, Tms, and indices of their overlapping regions. :rtype: dict ''' # Input parameters needed to design the oligos length_range = self.kwargs['length...
[ "def", "design_assembly", "(", "self", ")", ":", "# Input parameters needed to design the oligos", "length_range", "=", "self", ".", "kwargs", "[", "'length_range'", "]", "oligo_number", "=", "self", ".", "kwargs", "[", "'oligo_number'", "]", "require_even", "=", "s...
Design the overlapping oligos. :returns: Assembly oligos, and the sequences, Tms, and indices of their overlapping regions. :rtype: dict
[ "Design", "the", "overlapping", "oligos", "." ]
train
https://github.com/klavinslab/coral/blob/17f59591211562a59a051f474cd6cecba4829df9/coral/design/_oligo_synthesis/oligo_assembly.py#L57-L145
klavinslab/coral
coral/design/_oligo_synthesis/oligo_assembly.py
OligoAssembly.primers
def primers(self, tm=60): '''Design primers for amplifying the assembled sequence. :param tm: melting temperature (lower than overlaps is best). :type tm: float :returns: Primer list (the output of coral.design.primers). :rtype: list ''' self.primers = coral.des...
python
def primers(self, tm=60): '''Design primers for amplifying the assembled sequence. :param tm: melting temperature (lower than overlaps is best). :type tm: float :returns: Primer list (the output of coral.design.primers). :rtype: list ''' self.primers = coral.des...
[ "def", "primers", "(", "self", ",", "tm", "=", "60", ")", ":", "self", ".", "primers", "=", "coral", ".", "design", ".", "primers", "(", "self", ".", "template", ",", "tm", "=", "tm", ")", "return", "self", ".", "primers" ]
Design primers for amplifying the assembled sequence. :param tm: melting temperature (lower than overlaps is best). :type tm: float :returns: Primer list (the output of coral.design.primers). :rtype: list
[ "Design", "primers", "for", "amplifying", "the", "assembled", "sequence", "." ]
train
https://github.com/klavinslab/coral/blob/17f59591211562a59a051f474cd6cecba4829df9/coral/design/_oligo_synthesis/oligo_assembly.py#L147-L157
klavinslab/coral
coral/design/_oligo_synthesis/oligo_assembly.py
OligoAssembly.write
def write(self, path): '''Write assembly oligos and (if applicable) primers to csv. :param path: path to csv file, including .csv extension. :type path: str ''' with open(path, 'wb') as oligo_file: oligo_writer = csv.writer(oligo_file, delimiter=',', ...
python
def write(self, path): '''Write assembly oligos and (if applicable) primers to csv. :param path: path to csv file, including .csv extension. :type path: str ''' with open(path, 'wb') as oligo_file: oligo_writer = csv.writer(oligo_file, delimiter=',', ...
[ "def", "write", "(", "self", ",", "path", ")", ":", "with", "open", "(", "path", ",", "'wb'", ")", "as", "oligo_file", ":", "oligo_writer", "=", "csv", ".", "writer", "(", "oligo_file", ",", "delimiter", "=", "','", ",", "quoting", "=", "csv", ".", ...
Write assembly oligos and (if applicable) primers to csv. :param path: path to csv file, including .csv extension. :type path: str
[ "Write", "assembly", "oligos", "and", "(", "if", "applicable", ")", "primers", "to", "csv", "." ]
train
https://github.com/klavinslab/coral/blob/17f59591211562a59a051f474cd6cecba4829df9/coral/design/_oligo_synthesis/oligo_assembly.py#L159-L184
klavinslab/coral
coral/design/_oligo_synthesis/oligo_assembly.py
OligoAssembly.write_map
def write_map(self, path): '''Write genbank map that highlights overlaps. :param path: full path to .gb file to write. :type path: str ''' starts = [index[0] for index in self.overlap_indices] features = [] for i, start in enumerate(starts): stop = s...
python
def write_map(self, path): '''Write genbank map that highlights overlaps. :param path: full path to .gb file to write. :type path: str ''' starts = [index[0] for index in self.overlap_indices] features = [] for i, start in enumerate(starts): stop = s...
[ "def", "write_map", "(", "self", ",", "path", ")", ":", "starts", "=", "[", "index", "[", "0", "]", "for", "index", "in", "self", ".", "overlap_indices", "]", "features", "=", "[", "]", "for", "i", ",", "start", "in", "enumerate", "(", "starts", ")...
Write genbank map that highlights overlaps. :param path: full path to .gb file to write. :type path: str
[ "Write", "genbank", "map", "that", "highlights", "overlaps", "." ]
train
https://github.com/klavinslab/coral/blob/17f59591211562a59a051f474cd6cecba4829df9/coral/design/_oligo_synthesis/oligo_assembly.py#L186-L203
klavinslab/coral
coral/reaction/_central_dogma.py
coding_sequence
def coding_sequence(rna): '''Extract coding sequence from an RNA template. :param seq: Sequence from which to extract a coding sequence. :type seq: coral.RNA :param material: Type of sequence ('dna' or 'rna') :type material: str :returns: The first coding sequence (start codon -> stop codon) ma...
python
def coding_sequence(rna): '''Extract coding sequence from an RNA template. :param seq: Sequence from which to extract a coding sequence. :type seq: coral.RNA :param material: Type of sequence ('dna' or 'rna') :type material: str :returns: The first coding sequence (start codon -> stop codon) ma...
[ "def", "coding_sequence", "(", "rna", ")", ":", "if", "isinstance", "(", "rna", ",", "coral", ".", "DNA", ")", ":", "rna", "=", "transcribe", "(", "rna", ")", "codons_left", "=", "len", "(", "rna", ")", "//", "3", "start_codon", "=", "coral", ".", ...
Extract coding sequence from an RNA template. :param seq: Sequence from which to extract a coding sequence. :type seq: coral.RNA :param material: Type of sequence ('dna' or 'rna') :type material: str :returns: The first coding sequence (start codon -> stop codon) matched from 5' to 3'...
[ "Extract", "coding", "sequence", "from", "an", "RNA", "template", "." ]
train
https://github.com/klavinslab/coral/blob/17f59591211562a59a051f474cd6cecba4829df9/coral/reaction/_central_dogma.py#L42-L86
klavinslab/coral
coral/database/_rebase.py
Rebase.update
def update(self): '''Update definitions.''' # Download http://rebase.neb.com/rebase/link_withref to tmp self._tmpdir = tempfile.mkdtemp() try: self._rebase_file = self._tmpdir + '/rebase_file' print 'Downloading latest enzyme definitions' url = 'http:/...
python
def update(self): '''Update definitions.''' # Download http://rebase.neb.com/rebase/link_withref to tmp self._tmpdir = tempfile.mkdtemp() try: self._rebase_file = self._tmpdir + '/rebase_file' print 'Downloading latest enzyme definitions' url = 'http:/...
[ "def", "update", "(", "self", ")", ":", "# Download http://rebase.neb.com/rebase/link_withref to tmp", "self", ".", "_tmpdir", "=", "tempfile", ".", "mkdtemp", "(", ")", "try", ":", "self", ".", "_rebase_file", "=", "self", ".", "_tmpdir", "+", "'/rebase_file'", ...
Update definitions.
[ "Update", "definitions", "." ]
train
https://github.com/klavinslab/coral/blob/17f59591211562a59a051f474cd6cecba4829df9/coral/database/_rebase.py#L15-L51
klavinslab/coral
coral/database/_rebase.py
Rebase._process_file
def _process_file(self): '''Process rebase file into dict with name and cut site information.''' print 'Processing file' with open(self._rebase_file, 'r') as f: raw = f.readlines() names = [line.strip()[3:] for line in raw if line.startswith('<1>')] seqs = [line.strip...
python
def _process_file(self): '''Process rebase file into dict with name and cut site information.''' print 'Processing file' with open(self._rebase_file, 'r') as f: raw = f.readlines() names = [line.strip()[3:] for line in raw if line.startswith('<1>')] seqs = [line.strip...
[ "def", "_process_file", "(", "self", ")", ":", "print", "'Processing file'", "with", "open", "(", "self", ".", "_rebase_file", ",", "'r'", ")", "as", "f", ":", "raw", "=", "f", ".", "readlines", "(", ")", "names", "=", "[", "line", ".", "strip", "(",...
Process rebase file into dict with name and cut site information.
[ "Process", "rebase", "file", "into", "dict", "with", "name", "and", "cut", "site", "information", "." ]
train
https://github.com/klavinslab/coral/blob/17f59591211562a59a051f474cd6cecba4829df9/coral/database/_rebase.py#L69-L102
klavinslab/coral
coral/sequence/_peptide.py
Peptide.copy
def copy(self): '''Create a copy of the current instance. :returns: A safely editable copy of the current sequence. :rtype: coral.Peptide ''' return type(self)(str(self._sequence), features=self.features, run_checks=False)
python
def copy(self): '''Create a copy of the current instance. :returns: A safely editable copy of the current sequence. :rtype: coral.Peptide ''' return type(self)(str(self._sequence), features=self.features, run_checks=False)
[ "def", "copy", "(", "self", ")", ":", "return", "type", "(", "self", ")", "(", "str", "(", "self", ".", "_sequence", ")", ",", "features", "=", "self", ".", "features", ",", "run_checks", "=", "False", ")" ]
Create a copy of the current instance. :returns: A safely editable copy of the current sequence. :rtype: coral.Peptide
[ "Create", "a", "copy", "of", "the", "current", "instance", "." ]
train
https://github.com/klavinslab/coral/blob/17f59591211562a59a051f474cd6cecba4829df9/coral/sequence/_peptide.py#L26-L34
klavinslab/coral
coral/utils/tempdirs.py
tempdir
def tempdir(fun): '''For use as a decorator of instance methods - creates a temporary dir named self._tempdir and then deletes it after the method runs. :param fun: function to decorate :type fun: instance method ''' def wrapper(*args, **kwargs): self = args[0] if os.path.isdir...
python
def tempdir(fun): '''For use as a decorator of instance methods - creates a temporary dir named self._tempdir and then deletes it after the method runs. :param fun: function to decorate :type fun: instance method ''' def wrapper(*args, **kwargs): self = args[0] if os.path.isdir...
[ "def", "tempdir", "(", "fun", ")", ":", "def", "wrapper", "(", "*", "args", ",", "*", "*", "kwargs", ")", ":", "self", "=", "args", "[", "0", "]", "if", "os", ".", "path", ".", "isdir", "(", "self", ".", "_tempdir", ")", ":", "shutil", ".", "...
For use as a decorator of instance methods - creates a temporary dir named self._tempdir and then deletes it after the method runs. :param fun: function to decorate :type fun: instance method
[ "For", "use", "as", "a", "decorator", "of", "instance", "methods", "-", "creates", "a", "temporary", "dir", "named", "self", ".", "_tempdir", "and", "then", "deletes", "it", "after", "the", "method", "runs", "." ]
train
https://github.com/klavinslab/coral/blob/17f59591211562a59a051f474cd6cecba4829df9/coral/utils/tempdirs.py#L9-L30
klavinslab/coral
coral/reaction/utils.py
convert_sequence
def convert_sequence(seq, to_material): '''Translate a DNA sequence into peptide sequence. The following conversions are supported: Transcription (seq is DNA, to_material is 'rna') Reverse transcription (seq is RNA, to_material is 'dna') Translation (seq is RNA, to_material is 'peptide'...
python
def convert_sequence(seq, to_material): '''Translate a DNA sequence into peptide sequence. The following conversions are supported: Transcription (seq is DNA, to_material is 'rna') Reverse transcription (seq is RNA, to_material is 'dna') Translation (seq is RNA, to_material is 'peptide'...
[ "def", "convert_sequence", "(", "seq", ",", "to_material", ")", ":", "if", "isinstance", "(", "seq", ",", "coral", ".", "DNA", ")", "and", "to_material", "==", "'rna'", ":", "# Transcribe", "# Can't transcribe a gap", "if", "'-'", "in", "seq", ":", "raise", ...
Translate a DNA sequence into peptide sequence. The following conversions are supported: Transcription (seq is DNA, to_material is 'rna') Reverse transcription (seq is RNA, to_material is 'dna') Translation (seq is RNA, to_material is 'peptide') :param seq: DNA or RNA sequence. :ty...
[ "Translate", "a", "DNA", "sequence", "into", "peptide", "sequence", "." ]
train
https://github.com/klavinslab/coral/blob/17f59591211562a59a051f474cd6cecba4829df9/coral/reaction/utils.py#L6-L70
klavinslab/coral
coral/sequence/_nucleicacid.py
NucleicAcid.gc
def gc(self): '''Find the frequency of G and C in the current sequence.''' gc = len([base for base in self.seq if base == 'C' or base == 'G']) return float(gc) / len(self)
python
def gc(self): '''Find the frequency of G and C in the current sequence.''' gc = len([base for base in self.seq if base == 'C' or base == 'G']) return float(gc) / len(self)
[ "def", "gc", "(", "self", ")", ":", "gc", "=", "len", "(", "[", "base", "for", "base", "in", "self", ".", "seq", "if", "base", "==", "'C'", "or", "base", "==", "'G'", "]", ")", "return", "float", "(", "gc", ")", "/", "len", "(", "self", ")" ]
Find the frequency of G and C in the current sequence.
[ "Find", "the", "frequency", "of", "G", "and", "C", "in", "the", "current", "sequence", "." ]
train
https://github.com/klavinslab/coral/blob/17f59591211562a59a051f474cd6cecba4829df9/coral/sequence/_nucleicacid.py#L58-L61
klavinslab/coral
coral/sequence/_nucleicacid.py
NucleicAcid.is_rotation
def is_rotation(self, other): '''Determine whether two sequences are the same, just at different rotations. :param other: The sequence to check for rotational equality. :type other: coral.sequence._sequence.Sequence ''' if len(self) != len(other): return Fal...
python
def is_rotation(self, other): '''Determine whether two sequences are the same, just at different rotations. :param other: The sequence to check for rotational equality. :type other: coral.sequence._sequence.Sequence ''' if len(self) != len(other): return Fal...
[ "def", "is_rotation", "(", "self", ",", "other", ")", ":", "if", "len", "(", "self", ")", "!=", "len", "(", "other", ")", ":", "return", "False", "for", "i", "in", "range", "(", "len", "(", "self", ")", ")", ":", "if", "self", ".", "rotate", "(...
Determine whether two sequences are the same, just at different rotations. :param other: The sequence to check for rotational equality. :type other: coral.sequence._sequence.Sequence
[ "Determine", "whether", "two", "sequences", "are", "the", "same", "just", "at", "different", "rotations", "." ]
train
https://github.com/klavinslab/coral/blob/17f59591211562a59a051f474cd6cecba4829df9/coral/sequence/_nucleicacid.py#L78-L93
klavinslab/coral
coral/sequence/_nucleicacid.py
NucleicAcid.linearize
def linearize(self, index=0): '''Linearize the Sequence at an index. :param index: index at which to linearize. :type index: int :returns: A linearized version of the current sequence. :rtype: coral.sequence._sequence.Sequence :raises: ValueError if the input is a linear...
python
def linearize(self, index=0): '''Linearize the Sequence at an index. :param index: index at which to linearize. :type index: int :returns: A linearized version of the current sequence. :rtype: coral.sequence._sequence.Sequence :raises: ValueError if the input is a linear...
[ "def", "linearize", "(", "self", ",", "index", "=", "0", ")", ":", "if", "not", "self", ".", "circular", "and", "index", "!=", "0", ":", "raise", "ValueError", "(", "'Cannot relinearize a linear sequence.'", ")", "copy", "=", "self", ".", "copy", "(", ")...
Linearize the Sequence at an index. :param index: index at which to linearize. :type index: int :returns: A linearized version of the current sequence. :rtype: coral.sequence._sequence.Sequence :raises: ValueError if the input is a linear sequence.
[ "Linearize", "the", "Sequence", "at", "an", "index", "." ]
train
https://github.com/klavinslab/coral/blob/17f59591211562a59a051f474cd6cecba4829df9/coral/sequence/_nucleicacid.py#L95-L113
klavinslab/coral
coral/sequence/_nucleicacid.py
NucleicAcid.locate
def locate(self, pattern): '''Find sequences matching a pattern. :param pattern: Sequence for which to find matches. :type pattern: str :returns: Indices of pattern matches. :rtype: list of ints ''' if self.circular: if len(pattern) >= 2 * len(self):...
python
def locate(self, pattern): '''Find sequences matching a pattern. :param pattern: Sequence for which to find matches. :type pattern: str :returns: Indices of pattern matches. :rtype: list of ints ''' if self.circular: if len(pattern) >= 2 * len(self):...
[ "def", "locate", "(", "self", ",", "pattern", ")", ":", "if", "self", ".", "circular", ":", "if", "len", "(", "pattern", ")", ">=", "2", "*", "len", "(", "self", ")", ":", "raise", "ValueError", "(", "'Search pattern longer than searchable '", "+", "'seq...
Find sequences matching a pattern. :param pattern: Sequence for which to find matches. :type pattern: str :returns: Indices of pattern matches. :rtype: list of ints
[ "Find", "sequences", "matching", "a", "pattern", "." ]
train
https://github.com/klavinslab/coral/blob/17f59591211562a59a051f474cd6cecba4829df9/coral/sequence/_nucleicacid.py#L115-L131
klavinslab/coral
coral/sequence/_nucleicacid.py
NucleicAcid.mw
def mw(self): '''Calculate the molecular weight. :returns: The molecular weight of the current sequence in amu. :rtype: float ''' counter = collections.Counter(self.seq.lower()) mw_a = counter['a'] * 313.2 mw_t = counter['t'] * 304.2 mw_g = counter['g'] ...
python
def mw(self): '''Calculate the molecular weight. :returns: The molecular weight of the current sequence in amu. :rtype: float ''' counter = collections.Counter(self.seq.lower()) mw_a = counter['a'] * 313.2 mw_t = counter['t'] * 304.2 mw_g = counter['g'] ...
[ "def", "mw", "(", "self", ")", ":", "counter", "=", "collections", ".", "Counter", "(", "self", ".", "seq", ".", "lower", "(", ")", ")", "mw_a", "=", "counter", "[", "'a'", "]", "*", "313.2", "mw_t", "=", "counter", "[", "'t'", "]", "*", "304.2",...
Calculate the molecular weight. :returns: The molecular weight of the current sequence in amu. :rtype: float
[ "Calculate", "the", "molecular", "weight", "." ]
train
https://github.com/klavinslab/coral/blob/17f59591211562a59a051f474cd6cecba4829df9/coral/sequence/_nucleicacid.py#L133-L150
klavinslab/coral
coral/sequence/_nucleicacid.py
NucleicAcid.rotate
def rotate(self, n): '''Rotate Sequence by n bases. :param n: Number of bases to rotate. :type n: int :returns: The current sequence reoriented at `index`. :rtype: coral.sequence._sequence.Sequence :raises: ValueError if applied to linear sequence or `index` is ...
python
def rotate(self, n): '''Rotate Sequence by n bases. :param n: Number of bases to rotate. :type n: int :returns: The current sequence reoriented at `index`. :rtype: coral.sequence._sequence.Sequence :raises: ValueError if applied to linear sequence or `index` is ...
[ "def", "rotate", "(", "self", ",", "n", ")", ":", "if", "not", "self", ".", "circular", "and", "n", "!=", "0", ":", "raise", "ValueError", "(", "'Cannot rotate a linear sequence'", ")", "else", ":", "rotated", "=", "self", "[", "-", "n", ":", "]", "+...
Rotate Sequence by n bases. :param n: Number of bases to rotate. :type n: int :returns: The current sequence reoriented at `index`. :rtype: coral.sequence._sequence.Sequence :raises: ValueError if applied to linear sequence or `index` is negative.
[ "Rotate", "Sequence", "by", "n", "bases", "." ]
train
https://github.com/klavinslab/coral/blob/17f59591211562a59a051f474cd6cecba4829df9/coral/sequence/_nucleicacid.py#L152-L167
klavinslab/coral
coral/reaction/_resect.py
five_resect
def five_resect(dna, n_bases): '''Remove bases from 5' end of top strand. :param dna: Sequence to resect. :type dna: coral.DNA :param n_bases: Number of bases cut back. :type n_bases: int :returns: DNA sequence resected at the 5' end by n_bases. :rtype: coral.DNA ''' new_instance =...
python
def five_resect(dna, n_bases): '''Remove bases from 5' end of top strand. :param dna: Sequence to resect. :type dna: coral.DNA :param n_bases: Number of bases cut back. :type n_bases: int :returns: DNA sequence resected at the 5' end by n_bases. :rtype: coral.DNA ''' new_instance =...
[ "def", "five_resect", "(", "dna", ",", "n_bases", ")", ":", "new_instance", "=", "dna", ".", "copy", "(", ")", "if", "n_bases", ">=", "len", "(", "dna", ")", ":", "new_instance", ".", "top", ".", "seq", "=", "''", ".", "join", "(", "[", "'-'", "f...
Remove bases from 5' end of top strand. :param dna: Sequence to resect. :type dna: coral.DNA :param n_bases: Number of bases cut back. :type n_bases: int :returns: DNA sequence resected at the 5' end by n_bases. :rtype: coral.DNA
[ "Remove", "bases", "from", "5", "end", "of", "top", "strand", "." ]
train
https://github.com/klavinslab/coral/blob/17f59591211562a59a051f474cd6cecba4829df9/coral/reaction/_resect.py#L5-L24
klavinslab/coral
coral/reaction/_resect.py
_remove_end_gaps
def _remove_end_gaps(sequence): '''Removes double-stranded gaps from ends of the sequence. :returns: The current sequence with terminal double-strand gaps ('-') removed. :rtype: coral.DNA ''' # Count terminal blank sequences def count_end_gaps(seq): gap = coral.DNA('-') ...
python
def _remove_end_gaps(sequence): '''Removes double-stranded gaps from ends of the sequence. :returns: The current sequence with terminal double-strand gaps ('-') removed. :rtype: coral.DNA ''' # Count terminal blank sequences def count_end_gaps(seq): gap = coral.DNA('-') ...
[ "def", "_remove_end_gaps", "(", "sequence", ")", ":", "# Count terminal blank sequences", "def", "count_end_gaps", "(", "seq", ")", ":", "gap", "=", "coral", ".", "DNA", "(", "'-'", ")", "count", "=", "0", "for", "base", "in", "seq", ":", "if", "base", "...
Removes double-stranded gaps from ends of the sequence. :returns: The current sequence with terminal double-strand gaps ('-') removed. :rtype: coral.DNA
[ "Removes", "double", "-", "stranded", "gaps", "from", "ends", "of", "the", "sequence", "." ]
train
https://github.com/klavinslab/coral/blob/17f59591211562a59a051f474cd6cecba4829df9/coral/reaction/_resect.py#L49-L78
klavinslab/coral
coral/analysis/_sequencing/needle.py
needle
def needle(reference, query, gap_open=-15, gap_extend=0, matrix=submat.DNA_SIMPLE): '''Do a Needleman-Wunsch alignment. :param reference: Reference sequence. :type reference: coral.DNA :param query: Sequence to align against the reference. :type query: coral.DNA :param gapopen: Penal...
python
def needle(reference, query, gap_open=-15, gap_extend=0, matrix=submat.DNA_SIMPLE): '''Do a Needleman-Wunsch alignment. :param reference: Reference sequence. :type reference: coral.DNA :param query: Sequence to align against the reference. :type query: coral.DNA :param gapopen: Penal...
[ "def", "needle", "(", "reference", ",", "query", ",", "gap_open", "=", "-", "15", ",", "gap_extend", "=", "0", ",", "matrix", "=", "submat", ".", "DNA_SIMPLE", ")", ":", "# Align using cython Needleman-Wunsch", "aligned_ref", ",", "aligned_res", "=", "aligner"...
Do a Needleman-Wunsch alignment. :param reference: Reference sequence. :type reference: coral.DNA :param query: Sequence to align against the reference. :type query: coral.DNA :param gapopen: Penalty for opening a gap. :type gapopen: float :param gapextend: Penalty for extending a gap. ...
[ "Do", "a", "Needleman", "-", "Wunsch", "alignment", "." ]
train
https://github.com/klavinslab/coral/blob/17f59591211562a59a051f474cd6cecba4829df9/coral/analysis/_sequencing/needle.py#L16-L48
klavinslab/coral
coral/analysis/_sequencing/needle.py
needle_msa
def needle_msa(reference, results, gap_open=-15, gap_extend=0, matrix=submat.DNA_SIMPLE): '''Create a multiple sequence alignment based on aligning every result sequence against the reference, then inserting gaps until every aligned reference is identical ''' gap = '-' # Convert ...
python
def needle_msa(reference, results, gap_open=-15, gap_extend=0, matrix=submat.DNA_SIMPLE): '''Create a multiple sequence alignment based on aligning every result sequence against the reference, then inserting gaps until every aligned reference is identical ''' gap = '-' # Convert ...
[ "def", "needle_msa", "(", "reference", ",", "results", ",", "gap_open", "=", "-", "15", ",", "gap_extend", "=", "0", ",", "matrix", "=", "submat", ".", "DNA_SIMPLE", ")", ":", "gap", "=", "'-'", "# Convert alignments to list of strings", "alignments", "=", "...
Create a multiple sequence alignment based on aligning every result sequence against the reference, then inserting gaps until every aligned reference is identical
[ "Create", "a", "multiple", "sequence", "alignment", "based", "on", "aligning", "every", "result", "sequence", "against", "the", "reference", "then", "inserting", "gaps", "until", "every", "aligned", "reference", "is", "identical" ]
train
https://github.com/klavinslab/coral/blob/17f59591211562a59a051f474cd6cecba4829df9/coral/analysis/_sequencing/needle.py#L58-L113
klavinslab/coral
coral/analysis/_sequencing/needle.py
needle_multi
def needle_multi(references, queries, gap_open=-15, gap_extend=0, matrix=submat.DNA_SIMPLE): '''Batch process of sequencing split over several cores. Acts just like needle but sequence inputs are lists. :param references: References sequence. :type references: coral.DNA list :param...
python
def needle_multi(references, queries, gap_open=-15, gap_extend=0, matrix=submat.DNA_SIMPLE): '''Batch process of sequencing split over several cores. Acts just like needle but sequence inputs are lists. :param references: References sequence. :type references: coral.DNA list :param...
[ "def", "needle_multi", "(", "references", ",", "queries", ",", "gap_open", "=", "-", "15", ",", "gap_extend", "=", "0", ",", "matrix", "=", "submat", ".", "DNA_SIMPLE", ")", ":", "pool", "=", "multiprocessing", ".", "Pool", "(", ")", "try", ":", "args_...
Batch process of sequencing split over several cores. Acts just like needle but sequence inputs are lists. :param references: References sequence. :type references: coral.DNA list :param queries: Sequences to align against the reference. :type queries: coral.DNA list :param gap_open: Penalty fo...
[ "Batch", "process", "of", "sequencing", "split", "over", "several", "cores", ".", "Acts", "just", "like", "needle", "but", "sequence", "inputs", "are", "lists", "." ]
train
https://github.com/klavinslab/coral/blob/17f59591211562a59a051f474cd6cecba4829df9/coral/analysis/_sequencing/needle.py#L116-L147
WoLpH/python-utils
python_utils/import_.py
import_global
def import_global( name, modules=None, exceptions=DummyException, locals_=None, globals_=None, level=-1): '''Import the requested items into the global scope WARNING! this method _will_ overwrite your global scope If you have a variable named "path" and you call import_global('sys') it ...
python
def import_global( name, modules=None, exceptions=DummyException, locals_=None, globals_=None, level=-1): '''Import the requested items into the global scope WARNING! this method _will_ overwrite your global scope If you have a variable named "path" and you call import_global('sys') it ...
[ "def", "import_global", "(", "name", ",", "modules", "=", "None", ",", "exceptions", "=", "DummyException", ",", "locals_", "=", "None", ",", "globals_", "=", "None", ",", "level", "=", "-", "1", ")", ":", "frame", "=", "None", "try", ":", "# If locals...
Import the requested items into the global scope WARNING! this method _will_ overwrite your global scope If you have a variable named "path" and you call import_global('sys') it will be overwritten with sys.path Args: name (str): the name of the module to import, e.g. sys modules (str)...
[ "Import", "the", "requested", "items", "into", "the", "global", "scope" ]
train
https://github.com/WoLpH/python-utils/blob/6bbe13bab33bd9965b0edd379f26261b31a3e427/python_utils/import_.py#L6-L78
WoLpH/python-utils
python_utils/formatters.py
camel_to_underscore
def camel_to_underscore(name): '''Convert camel case style naming to underscore style naming If there are existing underscores they will be collapsed with the to-be-added underscores. Multiple consecutive capital letters will not be split except for the last one. >>> camel_to_underscore('SpamEggsA...
python
def camel_to_underscore(name): '''Convert camel case style naming to underscore style naming If there are existing underscores they will be collapsed with the to-be-added underscores. Multiple consecutive capital letters will not be split except for the last one. >>> camel_to_underscore('SpamEggsA...
[ "def", "camel_to_underscore", "(", "name", ")", ":", "output", "=", "[", "]", "for", "i", ",", "c", "in", "enumerate", "(", "name", ")", ":", "if", "i", ">", "0", ":", "pc", "=", "name", "[", "i", "-", "1", "]", "if", "c", ".", "isupper", "("...
Convert camel case style naming to underscore style naming If there are existing underscores they will be collapsed with the to-be-added underscores. Multiple consecutive capital letters will not be split except for the last one. >>> camel_to_underscore('SpamEggsAndBacon') 'spam_eggs_and_bacon' ...
[ "Convert", "camel", "case", "style", "naming", "to", "underscore", "style", "naming" ]
train
https://github.com/WoLpH/python-utils/blob/6bbe13bab33bd9965b0edd379f26261b31a3e427/python_utils/formatters.py#L4-L39
WoLpH/python-utils
python_utils/formatters.py
timesince
def timesince(dt, default='just now'): ''' Returns string representing 'time since' e.g. 3 days ago, 5 hours ago etc. >>> now = datetime.datetime.now() >>> timesince(now) 'just now' >>> timesince(now - datetime.timedelta(seconds=1)) '1 second ago' >>> timesince(now - datetime.timede...
python
def timesince(dt, default='just now'): ''' Returns string representing 'time since' e.g. 3 days ago, 5 hours ago etc. >>> now = datetime.datetime.now() >>> timesince(now) 'just now' >>> timesince(now - datetime.timedelta(seconds=1)) '1 second ago' >>> timesince(now - datetime.timede...
[ "def", "timesince", "(", "dt", ",", "default", "=", "'just now'", ")", ":", "if", "isinstance", "(", "dt", ",", "datetime", ".", "timedelta", ")", ":", "diff", "=", "dt", "else", ":", "now", "=", "datetime", ".", "datetime", ".", "now", "(", ")", "...
Returns string representing 'time since' e.g. 3 days ago, 5 hours ago etc. >>> now = datetime.datetime.now() >>> timesince(now) 'just now' >>> timesince(now - datetime.timedelta(seconds=1)) '1 second ago' >>> timesince(now - datetime.timedelta(seconds=2)) '2 seconds ago' >>> timesin...
[ "Returns", "string", "representing", "time", "since", "e", ".", "g", ".", "3", "days", "ago", "5", "hours", "ago", "etc", "." ]
train
https://github.com/WoLpH/python-utils/blob/6bbe13bab33bd9965b0edd379f26261b31a3e427/python_utils/formatters.py#L42-L112
WoLpH/python-utils
python_utils/time.py
timedelta_to_seconds
def timedelta_to_seconds(delta): '''Convert a timedelta to seconds with the microseconds as fraction Note that this method has become largely obsolete with the `timedelta.total_seconds()` method introduced in Python 2.7. >>> from datetime import timedelta >>> '%d' % timedelta_to_seconds(timedelta(...
python
def timedelta_to_seconds(delta): '''Convert a timedelta to seconds with the microseconds as fraction Note that this method has become largely obsolete with the `timedelta.total_seconds()` method introduced in Python 2.7. >>> from datetime import timedelta >>> '%d' % timedelta_to_seconds(timedelta(...
[ "def", "timedelta_to_seconds", "(", "delta", ")", ":", "# Only convert to float if needed", "if", "delta", ".", "microseconds", ":", "total", "=", "delta", ".", "microseconds", "*", "1e-6", "else", ":", "total", "=", "0", "total", "+=", "delta", ".", "seconds"...
Convert a timedelta to seconds with the microseconds as fraction Note that this method has become largely obsolete with the `timedelta.total_seconds()` method introduced in Python 2.7. >>> from datetime import timedelta >>> '%d' % timedelta_to_seconds(timedelta(days=1)) '86400' >>> '%d' % time...
[ "Convert", "a", "timedelta", "to", "seconds", "with", "the", "microseconds", "as", "fraction" ]
train
https://github.com/WoLpH/python-utils/blob/6bbe13bab33bd9965b0edd379f26261b31a3e427/python_utils/time.py#L10-L33
WoLpH/python-utils
python_utils/time.py
format_time
def format_time(timestamp, precision=datetime.timedelta(seconds=1)): '''Formats timedelta/datetime/seconds >>> format_time('1') '0:00:01' >>> format_time(1.234) '0:00:01' >>> format_time(1) '0:00:01' >>> format_time(datetime.datetime(2000, 1, 2, 3, 4, 5, 6)) '2000-01-02 03:04:05' ...
python
def format_time(timestamp, precision=datetime.timedelta(seconds=1)): '''Formats timedelta/datetime/seconds >>> format_time('1') '0:00:01' >>> format_time(1.234) '0:00:01' >>> format_time(1) '0:00:01' >>> format_time(datetime.datetime(2000, 1, 2, 3, 4, 5, 6)) '2000-01-02 03:04:05' ...
[ "def", "format_time", "(", "timestamp", ",", "precision", "=", "datetime", ".", "timedelta", "(", "seconds", "=", "1", ")", ")", ":", "precision_seconds", "=", "precision", ".", "total_seconds", "(", ")", "if", "isinstance", "(", "timestamp", ",", "six", "...
Formats timedelta/datetime/seconds >>> format_time('1') '0:00:01' >>> format_time(1.234) '0:00:01' >>> format_time(1) '0:00:01' >>> format_time(datetime.datetime(2000, 1, 2, 3, 4, 5, 6)) '2000-01-02 03:04:05' >>> format_time(datetime.date(2000, 1, 2)) '2000-01-02' >>> format...
[ "Formats", "timedelta", "/", "datetime", "/", "seconds" ]
train
https://github.com/WoLpH/python-utils/blob/6bbe13bab33bd9965b0edd379f26261b31a3e427/python_utils/time.py#L36-L97
WoLpH/python-utils
python_utils/terminal.py
get_terminal_size
def get_terminal_size(): # pragma: no cover '''Get the current size of your terminal Multiple returns are not always a good idea, but in this case it greatly simplifies the code so I believe it's justified. It's not the prettiest function but that's never really possible with cross-platform code. ...
python
def get_terminal_size(): # pragma: no cover '''Get the current size of your terminal Multiple returns are not always a good idea, but in this case it greatly simplifies the code so I believe it's justified. It's not the prettiest function but that's never really possible with cross-platform code. ...
[ "def", "get_terminal_size", "(", ")", ":", "# pragma: no cover", "try", ":", "# Default to 79 characters for IPython notebooks", "from", "IPython", "import", "get_ipython", "ipython", "=", "get_ipython", "(", ")", "from", "ipykernel", "import", "zmqshell", "if", "isinst...
Get the current size of your terminal Multiple returns are not always a good idea, but in this case it greatly simplifies the code so I believe it's justified. It's not the prettiest function but that's never really possible with cross-platform code. Returns: width, height: Two integers contai...
[ "Get", "the", "current", "size", "of", "your", "terminal" ]
train
https://github.com/WoLpH/python-utils/blob/6bbe13bab33bd9965b0edd379f26261b31a3e427/python_utils/terminal.py#L4-L78
Skype4Py/Skype4Py
Skype4Py/skype.py
Skype.AsyncSearchUsers
def AsyncSearchUsers(self, Target): """Asynchronously searches for Skype users. :Parameters: Target : unicode Search target (name or email address). :return: A search identifier. It will be passed along with the results to the `SkypeEvents.AsyncSearchUser...
python
def AsyncSearchUsers(self, Target): """Asynchronously searches for Skype users. :Parameters: Target : unicode Search target (name or email address). :return: A search identifier. It will be passed along with the results to the `SkypeEvents.AsyncSearchUser...
[ "def", "AsyncSearchUsers", "(", "self", ",", "Target", ")", ":", "if", "not", "hasattr", "(", "self", ",", "'_AsyncSearchUsersCommands'", ")", ":", "self", ".", "_AsyncSearchUsersCommands", "=", "[", "]", "self", ".", "RegisterEventHandler", "(", "'Reply'", ",...
Asynchronously searches for Skype users. :Parameters: Target : unicode Search target (name or email address). :return: A search identifier. It will be passed along with the results to the `SkypeEvents.AsyncSearchUsersFinished` event after the search is completed....
[ "Asynchronously", "searches", "for", "Skype", "users", "." ]
train
https://github.com/Skype4Py/Skype4Py/blob/c48d83f7034109fe46315d45a066126002c6e0d4/Skype4Py/skype.py#L376-L394
Skype4Py/Skype4Py
Skype4Py/skype.py
Skype.Attach
def Attach(self, Protocol=5, Wait=True): """Establishes a connection to Skype. :Parameters: Protocol : int Minimal Skype protocol version. Wait : bool If set to False, blocks forever until the connection is established. Otherwise, timeouts after t...
python
def Attach(self, Protocol=5, Wait=True): """Establishes a connection to Skype. :Parameters: Protocol : int Minimal Skype protocol version. Wait : bool If set to False, blocks forever until the connection is established. Otherwise, timeouts after t...
[ "def", "Attach", "(", "self", ",", "Protocol", "=", "5", ",", "Wait", "=", "True", ")", ":", "try", ":", "self", ".", "_Api", ".", "protocol", "=", "Protocol", "self", ".", "_Api", ".", "attach", "(", "self", ".", "Timeout", ",", "Wait", ")", "ex...
Establishes a connection to Skype. :Parameters: Protocol : int Minimal Skype protocol version. Wait : bool If set to False, blocks forever until the connection is established. Otherwise, timeouts after the `Timeout`.
[ "Establishes", "a", "connection", "to", "Skype", "." ]
train
https://github.com/Skype4Py/Skype4Py/blob/c48d83f7034109fe46315d45a066126002c6e0d4/Skype4Py/skype.py#L396-L411
Skype4Py/Skype4Py
Skype4Py/skype.py
Skype.Call
def Call(self, Id=0): """Queries a call object. :Parameters: Id : int Call identifier. :return: Call object. :rtype: `call.Call` """ o = Call(self, Id) o.Status # Test if such a call exists. return o
python
def Call(self, Id=0): """Queries a call object. :Parameters: Id : int Call identifier. :return: Call object. :rtype: `call.Call` """ o = Call(self, Id) o.Status # Test if such a call exists. return o
[ "def", "Call", "(", "self", ",", "Id", "=", "0", ")", ":", "o", "=", "Call", "(", "self", ",", "Id", ")", "o", ".", "Status", "# Test if such a call exists.", "return", "o" ]
Queries a call object. :Parameters: Id : int Call identifier. :return: Call object. :rtype: `call.Call`
[ "Queries", "a", "call", "object", "." ]
train
https://github.com/Skype4Py/Skype4Py/blob/c48d83f7034109fe46315d45a066126002c6e0d4/Skype4Py/skype.py#L413-L425
Skype4Py/Skype4Py
Skype4Py/skype.py
Skype.ChangeUserStatus
def ChangeUserStatus(self, Status): """Changes the online status for the current user. :Parameters: Status : `enums`.cus* New online status for the user. :note: This function waits until the online status changes. Alternatively, use the `CurrentUserStatus` ...
python
def ChangeUserStatus(self, Status): """Changes the online status for the current user. :Parameters: Status : `enums`.cus* New online status for the user. :note: This function waits until the online status changes. Alternatively, use the `CurrentUserStatus` ...
[ "def", "ChangeUserStatus", "(", "self", ",", "Status", ")", ":", "if", "self", ".", "CurrentUserStatus", ".", "upper", "(", ")", "==", "Status", ".", "upper", "(", ")", ":", "return", "self", ".", "_ChangeUserStatus_Event", "=", "threading", ".", "Event", ...
Changes the online status for the current user. :Parameters: Status : `enums`.cus* New online status for the user. :note: This function waits until the online status changes. Alternatively, use the `CurrentUserStatus` property to perform an immediate change of stat...
[ "Changes", "the", "online", "status", "for", "the", "current", "user", "." ]
train
https://github.com/Skype4Py/Skype4Py/blob/c48d83f7034109fe46315d45a066126002c6e0d4/Skype4Py/skype.py#L443-L461
Skype4Py/Skype4Py
Skype4Py/skype.py
Skype.Chat
def Chat(self, Name=''): """Queries a chat object. :Parameters: Name : str Chat name. :return: A chat object. :rtype: `chat.Chat` """ o = Chat(self, Name) o.Status # Tests if such a chat really exists. return o
python
def Chat(self, Name=''): """Queries a chat object. :Parameters: Name : str Chat name. :return: A chat object. :rtype: `chat.Chat` """ o = Chat(self, Name) o.Status # Tests if such a chat really exists. return o
[ "def", "Chat", "(", "self", ",", "Name", "=", "''", ")", ":", "o", "=", "Chat", "(", "self", ",", "Name", ")", "o", ".", "Status", "# Tests if such a chat really exists.", "return", "o" ]
Queries a chat object. :Parameters: Name : str Chat name. :return: A chat object. :rtype: `chat.Chat`
[ "Queries", "a", "chat", "object", "." ]
train
https://github.com/Skype4Py/Skype4Py/blob/c48d83f7034109fe46315d45a066126002c6e0d4/Skype4Py/skype.py#L463-L475
Skype4Py/Skype4Py
Skype4Py/skype.py
Skype.ClearCallHistory
def ClearCallHistory(self, Username='ALL', Type=chsAllCalls): """Clears the call history. :Parameters: Username : str Skypename of the user. A special value of 'ALL' means that entries of all users should be removed. Type : `enums`.clt* Call type....
python
def ClearCallHistory(self, Username='ALL', Type=chsAllCalls): """Clears the call history. :Parameters: Username : str Skypename of the user. A special value of 'ALL' means that entries of all users should be removed. Type : `enums`.clt* Call type....
[ "def", "ClearCallHistory", "(", "self", ",", "Username", "=", "'ALL'", ",", "Type", "=", "chsAllCalls", ")", ":", "cmd", "=", "'CLEAR CALLHISTORY %s %s'", "%", "(", "str", "(", "Type", ")", ",", "Username", ")", "self", ".", "_DoCommand", "(", "cmd", ","...
Clears the call history. :Parameters: Username : str Skypename of the user. A special value of 'ALL' means that entries of all users should be removed. Type : `enums`.clt* Call type.
[ "Clears", "the", "call", "history", "." ]
train
https://github.com/Skype4Py/Skype4Py/blob/c48d83f7034109fe46315d45a066126002c6e0d4/Skype4Py/skype.py#L477-L488
Skype4Py/Skype4Py
Skype4Py/skype.py
Skype.Command
def Command(self, Command, Reply=u'', Block=False, Timeout=30000, Id=-1): """Creates an API command object. :Parameters: Command : unicode Command string. Reply : unicode Expected reply. By default any reply is accepted (except errors which raise an ...
python
def Command(self, Command, Reply=u'', Block=False, Timeout=30000, Id=-1): """Creates an API command object. :Parameters: Command : unicode Command string. Reply : unicode Expected reply. By default any reply is accepted (except errors which raise an ...
[ "def", "Command", "(", "self", ",", "Command", ",", "Reply", "=", "u''", ",", "Block", "=", "False", ",", "Timeout", "=", "30000", ",", "Id", "=", "-", "1", ")", ":", "from", "api", "import", "Command", "as", "CommandClass", "return", "CommandClass", ...
Creates an API command object. :Parameters: Command : unicode Command string. Reply : unicode Expected reply. By default any reply is accepted (except errors which raise an `SkypeError` exception). Block : bool If set to True, `SendC...
[ "Creates", "an", "API", "command", "object", "." ]
train
https://github.com/Skype4Py/Skype4Py/blob/c48d83f7034109fe46315d45a066126002c6e0d4/Skype4Py/skype.py#L501-L526
Skype4Py/Skype4Py
Skype4Py/skype.py
Skype.Conference
def Conference(self, Id=0): """Queries a call conference object. :Parameters: Id : int Conference Id. :return: A conference object. :rtype: `Conference` """ o = Conference(self, Id) if Id <= 0 or not o.Calls: raise SkypeError(0,...
python
def Conference(self, Id=0): """Queries a call conference object. :Parameters: Id : int Conference Id. :return: A conference object. :rtype: `Conference` """ o = Conference(self, Id) if Id <= 0 or not o.Calls: raise SkypeError(0,...
[ "def", "Conference", "(", "self", ",", "Id", "=", "0", ")", ":", "o", "=", "Conference", "(", "self", ",", "Id", ")", "if", "Id", "<=", "0", "or", "not", "o", ".", "Calls", ":", "raise", "SkypeError", "(", "0", ",", "'Unknown conference'", ")", "...
Queries a call conference object. :Parameters: Id : int Conference Id. :return: A conference object. :rtype: `Conference`
[ "Queries", "a", "call", "conference", "object", "." ]
train
https://github.com/Skype4Py/Skype4Py/blob/c48d83f7034109fe46315d45a066126002c6e0d4/Skype4Py/skype.py#L528-L541
Skype4Py/Skype4Py
Skype4Py/skype.py
Skype.CreateChatWith
def CreateChatWith(self, *Usernames): """Creates a chat with one or more users. :Parameters: Usernames : str One or more Skypenames of the users. :return: A chat object :rtype: `Chat` :see: `Chat.AddMembers` """ return Chat(self, chop(self...
python
def CreateChatWith(self, *Usernames): """Creates a chat with one or more users. :Parameters: Usernames : str One or more Skypenames of the users. :return: A chat object :rtype: `Chat` :see: `Chat.AddMembers` """ return Chat(self, chop(self...
[ "def", "CreateChatWith", "(", "self", ",", "*", "Usernames", ")", ":", "return", "Chat", "(", "self", ",", "chop", "(", "self", ".", "_DoCommand", "(", "'CHAT CREATE %s'", "%", "', '", ".", "join", "(", "Usernames", ")", ")", ",", "2", ")", "[", "1",...
Creates a chat with one or more users. :Parameters: Usernames : str One or more Skypenames of the users. :return: A chat object :rtype: `Chat` :see: `Chat.AddMembers`
[ "Creates", "a", "chat", "with", "one", "or", "more", "users", "." ]
train
https://github.com/Skype4Py/Skype4Py/blob/c48d83f7034109fe46315d45a066126002c6e0d4/Skype4Py/skype.py#L555-L567
Skype4Py/Skype4Py
Skype4Py/skype.py
Skype.CreateGroup
def CreateGroup(self, GroupName): """Creates a custom contact group. :Parameters: GroupName : unicode Group name. :return: A group object. :rtype: `Group` :see: `DeleteGroup` """ groups = self.CustomGroups self._DoCommand('CREATE G...
python
def CreateGroup(self, GroupName): """Creates a custom contact group. :Parameters: GroupName : unicode Group name. :return: A group object. :rtype: `Group` :see: `DeleteGroup` """ groups = self.CustomGroups self._DoCommand('CREATE G...
[ "def", "CreateGroup", "(", "self", ",", "GroupName", ")", ":", "groups", "=", "self", ".", "CustomGroups", "self", ".", "_DoCommand", "(", "'CREATE GROUP %s'", "%", "tounicode", "(", "GroupName", ")", ")", "for", "g", "in", "self", ".", "CustomGroups", ":"...
Creates a custom contact group. :Parameters: GroupName : unicode Group name. :return: A group object. :rtype: `Group` :see: `DeleteGroup`
[ "Creates", "a", "custom", "contact", "group", "." ]
train
https://github.com/Skype4Py/Skype4Py/blob/c48d83f7034109fe46315d45a066126002c6e0d4/Skype4Py/skype.py#L569-L586
Skype4Py/Skype4Py
Skype4Py/skype.py
Skype.CreateSms
def CreateSms(self, MessageType, *TargetNumbers): """Creates an SMS message. :Parameters: MessageType : `enums`.smsMessageType* Message type. TargetNumbers : str One or more target SMS numbers. :return: An sms message object. :rtype: `SmsMess...
python
def CreateSms(self, MessageType, *TargetNumbers): """Creates an SMS message. :Parameters: MessageType : `enums`.smsMessageType* Message type. TargetNumbers : str One or more target SMS numbers. :return: An sms message object. :rtype: `SmsMess...
[ "def", "CreateSms", "(", "self", ",", "MessageType", ",", "*", "TargetNumbers", ")", ":", "return", "SmsMessage", "(", "self", ",", "chop", "(", "self", ".", "_DoCommand", "(", "'CREATE SMS %s %s'", "%", "(", "MessageType", ",", "', '", ".", "join", "(", ...
Creates an SMS message. :Parameters: MessageType : `enums`.smsMessageType* Message type. TargetNumbers : str One or more target SMS numbers. :return: An sms message object. :rtype: `SmsMessage`
[ "Creates", "an", "SMS", "message", "." ]
train
https://github.com/Skype4Py/Skype4Py/blob/c48d83f7034109fe46315d45a066126002c6e0d4/Skype4Py/skype.py#L588-L600
Skype4Py/Skype4Py
Skype4Py/skype.py
Skype.Greeting
def Greeting(self, Username=''): """Queries the greeting used as voicemail. :Parameters: Username : str Skypename of the user. :return: A voicemail object. :rtype: `Voicemail` """ for v in self.Voicemails: if Username and v.PartnerHandl...
python
def Greeting(self, Username=''): """Queries the greeting used as voicemail. :Parameters: Username : str Skypename of the user. :return: A voicemail object. :rtype: `Voicemail` """ for v in self.Voicemails: if Username and v.PartnerHandl...
[ "def", "Greeting", "(", "self", ",", "Username", "=", "''", ")", ":", "for", "v", "in", "self", ".", "Voicemails", ":", "if", "Username", "and", "v", ".", "PartnerHandle", "!=", "Username", ":", "continue", "if", "v", ".", "Type", "in", "(", "vmtDefa...
Queries the greeting used as voicemail. :Parameters: Username : str Skypename of the user. :return: A voicemail object. :rtype: `Voicemail`
[ "Queries", "the", "greeting", "used", "as", "voicemail", "." ]
train
https://github.com/Skype4Py/Skype4Py/blob/c48d83f7034109fe46315d45a066126002c6e0d4/Skype4Py/skype.py#L638-L652
Skype4Py/Skype4Py
Skype4Py/skype.py
Skype.Message
def Message(self, Id=0): """Queries a chat message object. :Parameters: Id : int Message Id. :return: A chat message object. :rtype: `ChatMessage` """ o = ChatMessage(self, Id) o.Status # Test if such an id is known. return o
python
def Message(self, Id=0): """Queries a chat message object. :Parameters: Id : int Message Id. :return: A chat message object. :rtype: `ChatMessage` """ o = ChatMessage(self, Id) o.Status # Test if such an id is known. return o
[ "def", "Message", "(", "self", ",", "Id", "=", "0", ")", ":", "o", "=", "ChatMessage", "(", "self", ",", "Id", ")", "o", ".", "Status", "# Test if such an id is known.", "return", "o" ]
Queries a chat message object. :Parameters: Id : int Message Id. :return: A chat message object. :rtype: `ChatMessage`
[ "Queries", "a", "chat", "message", "object", "." ]
train
https://github.com/Skype4Py/Skype4Py/blob/c48d83f7034109fe46315d45a066126002c6e0d4/Skype4Py/skype.py#L654-L666
Skype4Py/Skype4Py
Skype4Py/skype.py
Skype.PlaceCall
def PlaceCall(self, *Targets): """Places a call to a single user or creates a conference call. :Parameters: Targets : str One or more call targets. If multiple targets are specified, a conference call is created. The call target can be a Skypename, phone number, or spe...
python
def PlaceCall(self, *Targets): """Places a call to a single user or creates a conference call. :Parameters: Targets : str One or more call targets. If multiple targets are specified, a conference call is created. The call target can be a Skypename, phone number, or spe...
[ "def", "PlaceCall", "(", "self", ",", "*", "Targets", ")", ":", "calls", "=", "self", ".", "ActiveCalls", "reply", "=", "self", ".", "_DoCommand", "(", "'CALL %s'", "%", "', '", ".", "join", "(", "Targets", ")", ")", "# Skype for Windows returns the call sta...
Places a call to a single user or creates a conference call. :Parameters: Targets : str One or more call targets. If multiple targets are specified, a conference call is created. The call target can be a Skypename, phone number, or speed dial code. :return: A call obj...
[ "Places", "a", "call", "to", "a", "single", "user", "or", "creates", "a", "conference", "call", "." ]
train
https://github.com/Skype4Py/Skype4Py/blob/c48d83f7034109fe46315d45a066126002c6e0d4/Skype4Py/skype.py#L680-L701
Skype4Py/Skype4Py
Skype4Py/skype.py
Skype.Property
def Property(self, ObjectType, ObjectId, PropName, Set=None): """Queries/sets the properties of an object. :Parameters: ObjectType : str Object type ('USER', 'CALL', 'CHAT', 'CHATMESSAGE', ...). ObjectId : str Object Id, depends on the object type. ...
python
def Property(self, ObjectType, ObjectId, PropName, Set=None): """Queries/sets the properties of an object. :Parameters: ObjectType : str Object type ('USER', 'CALL', 'CHAT', 'CHATMESSAGE', ...). ObjectId : str Object Id, depends on the object type. ...
[ "def", "Property", "(", "self", ",", "ObjectType", ",", "ObjectId", ",", "PropName", ",", "Set", "=", "None", ")", ":", "return", "self", ".", "_Property", "(", "ObjectType", ",", "ObjectId", ",", "PropName", ",", "Set", ")" ]
Queries/sets the properties of an object. :Parameters: ObjectType : str Object type ('USER', 'CALL', 'CHAT', 'CHATMESSAGE', ...). ObjectId : str Object Id, depends on the object type. PropName : str Name of the property to access. Set ...
[ "Queries", "/", "sets", "the", "properties", "of", "an", "object", "." ]
train
https://github.com/Skype4Py/Skype4Py/blob/c48d83f7034109fe46315d45a066126002c6e0d4/Skype4Py/skype.py#L731-L747
Skype4Py/Skype4Py
Skype4Py/skype.py
Skype.SendCommand
def SendCommand(self, Command): """Sends an API command. :Parameters: Command : `Command` Command to send. Use `Command` method to create a command. """ try: self._Api.send_command(Command) except SkypeAPIError: self.ResetCache() ...
python
def SendCommand(self, Command): """Sends an API command. :Parameters: Command : `Command` Command to send. Use `Command` method to create a command. """ try: self._Api.send_command(Command) except SkypeAPIError: self.ResetCache() ...
[ "def", "SendCommand", "(", "self", ",", "Command", ")", ":", "try", ":", "self", ".", "_Api", ".", "send_command", "(", "Command", ")", "except", "SkypeAPIError", ":", "self", ".", "ResetCache", "(", ")", "raise" ]
Sends an API command. :Parameters: Command : `Command` Command to send. Use `Command` method to create a command.
[ "Sends", "an", "API", "command", "." ]
train
https://github.com/Skype4Py/Skype4Py/blob/c48d83f7034109fe46315d45a066126002c6e0d4/Skype4Py/skype.py#L770-L781
Skype4Py/Skype4Py
Skype4Py/skype.py
Skype.SendSms
def SendSms(self, *TargetNumbers, **Properties): """Creates and sends an SMS message. :Parameters: TargetNumbers : str One or more target SMS numbers. Properties Message properties. Properties available are same as `SmsMessage` object properties. :re...
python
def SendSms(self, *TargetNumbers, **Properties): """Creates and sends an SMS message. :Parameters: TargetNumbers : str One or more target SMS numbers. Properties Message properties. Properties available are same as `SmsMessage` object properties. :re...
[ "def", "SendSms", "(", "self", ",", "*", "TargetNumbers", ",", "*", "*", "Properties", ")", ":", "sms", "=", "self", ".", "CreateSms", "(", "smsMessageTypeOutgoing", ",", "*", "TargetNumbers", ")", "for", "name", ",", "value", "in", "Properties", ".", "i...
Creates and sends an SMS message. :Parameters: TargetNumbers : str One or more target SMS numbers. Properties Message properties. Properties available are same as `SmsMessage` object properties. :return: An sms message object. The message is already sent at ...
[ "Creates", "and", "sends", "an", "SMS", "message", "." ]
train
https://github.com/Skype4Py/Skype4Py/blob/c48d83f7034109fe46315d45a066126002c6e0d4/Skype4Py/skype.py#L797-L816
Skype4Py/Skype4Py
Skype4Py/skype.py
Skype.SendVoicemail
def SendVoicemail(self, Username): """Sends a voicemail to a specified user. :Parameters: Username : str Skypename of the user. :note: Should return a `Voicemail` object. This is not implemented yet. """ if self._Api.protocol >= 6: self._DoComm...
python
def SendVoicemail(self, Username): """Sends a voicemail to a specified user. :Parameters: Username : str Skypename of the user. :note: Should return a `Voicemail` object. This is not implemented yet. """ if self._Api.protocol >= 6: self._DoComm...
[ "def", "SendVoicemail", "(", "self", ",", "Username", ")", ":", "if", "self", ".", "_Api", ".", "protocol", ">=", "6", ":", "self", ".", "_DoCommand", "(", "'CALLVOICEMAIL %s'", "%", "Username", ")", "else", ":", "self", ".", "_DoCommand", "(", "'VOICEMA...
Sends a voicemail to a specified user. :Parameters: Username : str Skypename of the user. :note: Should return a `Voicemail` object. This is not implemented yet.
[ "Sends", "a", "voicemail", "to", "a", "specified", "user", "." ]
train
https://github.com/Skype4Py/Skype4Py/blob/c48d83f7034109fe46315d45a066126002c6e0d4/Skype4Py/skype.py#L818-L830
Skype4Py/Skype4Py
Skype4Py/skype.py
Skype.User
def User(self, Username=''): """Queries a user object. :Parameters: Username : str Skypename of the user. :return: A user object. :rtype: `user.User` """ if not Username: Username = self.CurrentUserHandle o = User(self, Username...
python
def User(self, Username=''): """Queries a user object. :Parameters: Username : str Skypename of the user. :return: A user object. :rtype: `user.User` """ if not Username: Username = self.CurrentUserHandle o = User(self, Username...
[ "def", "User", "(", "self", ",", "Username", "=", "''", ")", ":", "if", "not", "Username", ":", "Username", "=", "self", ".", "CurrentUserHandle", "o", "=", "User", "(", "self", ",", "Username", ")", "o", ".", "OnlineStatus", "# Test if such a user exists....
Queries a user object. :Parameters: Username : str Skypename of the user. :return: A user object. :rtype: `user.User`
[ "Queries", "a", "user", "object", "." ]
train
https://github.com/Skype4Py/Skype4Py/blob/c48d83f7034109fe46315d45a066126002c6e0d4/Skype4Py/skype.py#L832-L846
Skype4Py/Skype4Py
Skype4Py/skype.py
Skype.Voicemail
def Voicemail(self, Id): """Queries the voicemail object. :Parameters: Id : int Voicemail Id. :return: A voicemail object. :rtype: `Voicemail` """ o = Voicemail(self, Id) o.Type # Test if such a voicemail exists. return o
python
def Voicemail(self, Id): """Queries the voicemail object. :Parameters: Id : int Voicemail Id. :return: A voicemail object. :rtype: `Voicemail` """ o = Voicemail(self, Id) o.Type # Test if such a voicemail exists. return o
[ "def", "Voicemail", "(", "self", ",", "Id", ")", ":", "o", "=", "Voicemail", "(", "self", ",", "Id", ")", "o", ".", "Type", "# Test if such a voicemail exists.", "return", "o" ]
Queries the voicemail object. :Parameters: Id : int Voicemail Id. :return: A voicemail object. :rtype: `Voicemail`
[ "Queries", "the", "voicemail", "object", "." ]
train
https://github.com/Skype4Py/Skype4Py/blob/c48d83f7034109fe46315d45a066126002c6e0d4/Skype4Py/skype.py#L862-L874
Skype4Py/Skype4Py
Skype4Py/application.py
Application.Connect
def Connect(self, Username, WaitConnected=False): """Connects application to user. :Parameters: Username : str Name of the user to connect to. WaitConnected : bool If True, causes the method to wait until the connection is established. :return: If ``...
python
def Connect(self, Username, WaitConnected=False): """Connects application to user. :Parameters: Username : str Name of the user to connect to. WaitConnected : bool If True, causes the method to wait until the connection is established. :return: If ``...
[ "def", "Connect", "(", "self", ",", "Username", ",", "WaitConnected", "=", "False", ")", ":", "if", "WaitConnected", ":", "self", ".", "_Connect_Event", "=", "threading", ".", "Event", "(", ")", "self", ".", "_Connect_Stream", "=", "[", "None", "]", "sel...
Connects application to user. :Parameters: Username : str Name of the user to connect to. WaitConnected : bool If True, causes the method to wait until the connection is established. :return: If ``WaitConnected`` is True, returns the stream which can be used...
[ "Connects", "application", "to", "user", "." ]
train
https://github.com/Skype4Py/Skype4Py/blob/c48d83f7034109fe46315d45a066126002c6e0d4/Skype4Py/application.py#L36-L63
Skype4Py/Skype4Py
Skype4Py/application.py
Application.SendDatagram
def SendDatagram(self, Text, Streams=None): """Sends datagram to application streams. :Parameters: Text : unicode Text to send. Streams : sequence of `ApplicationStream` Streams to send the datagram to or None if all currently connected streams should be ...
python
def SendDatagram(self, Text, Streams=None): """Sends datagram to application streams. :Parameters: Text : unicode Text to send. Streams : sequence of `ApplicationStream` Streams to send the datagram to or None if all currently connected streams should be ...
[ "def", "SendDatagram", "(", "self", ",", "Text", ",", "Streams", "=", "None", ")", ":", "if", "Streams", "is", "None", ":", "Streams", "=", "self", ".", "Streams", "for", "s", "in", "Streams", ":", "s", ".", "SendDatagram", "(", "Text", ")" ]
Sends datagram to application streams. :Parameters: Text : unicode Text to send. Streams : sequence of `ApplicationStream` Streams to send the datagram to or None if all currently connected streams should be used.
[ "Sends", "datagram", "to", "application", "streams", "." ]
train
https://github.com/Skype4Py/Skype4Py/blob/c48d83f7034109fe46315d45a066126002c6e0d4/Skype4Py/application.py#L75-L88
Skype4Py/Skype4Py
Skype4Py/application.py
ApplicationStream.SendDatagram
def SendDatagram(self, Text): """Sends datagram to stream. :Parameters: Text : unicode Datagram to send. """ self.Application._Alter('DATAGRAM', '%s %s' % (self.Handle, tounicode(Text)))
python
def SendDatagram(self, Text): """Sends datagram to stream. :Parameters: Text : unicode Datagram to send. """ self.Application._Alter('DATAGRAM', '%s %s' % (self.Handle, tounicode(Text)))
[ "def", "SendDatagram", "(", "self", ",", "Text", ")", ":", "self", ".", "Application", ".", "_Alter", "(", "'DATAGRAM'", ",", "'%s %s'", "%", "(", "self", ".", "Handle", ",", "tounicode", "(", "Text", ")", ")", ")" ]
Sends datagram to stream. :Parameters: Text : unicode Datagram to send.
[ "Sends", "datagram", "to", "stream", "." ]
train
https://github.com/Skype4Py/Skype4Py/blob/c48d83f7034109fe46315d45a066126002c6e0d4/Skype4Py/application.py#L173-L180
Skype4Py/Skype4Py
Skype4Py/application.py
ApplicationStream.Write
def Write(self, Text): """Writes data to stream. :Parameters: Text : unicode Data to send. """ self.Application._Alter('WRITE', '%s %s' % (self.Handle, tounicode(Text)))
python
def Write(self, Text): """Writes data to stream. :Parameters: Text : unicode Data to send. """ self.Application._Alter('WRITE', '%s %s' % (self.Handle, tounicode(Text)))
[ "def", "Write", "(", "self", ",", "Text", ")", ":", "self", ".", "Application", ".", "_Alter", "(", "'WRITE'", ",", "'%s %s'", "%", "(", "self", ".", "Handle", ",", "tounicode", "(", "Text", ")", ")", ")" ]
Writes data to stream. :Parameters: Text : unicode Data to send.
[ "Writes", "data", "to", "stream", "." ]
train
https://github.com/Skype4Py/Skype4Py/blob/c48d83f7034109fe46315d45a066126002c6e0d4/Skype4Py/application.py#L182-L189
Skype4Py/Skype4Py
Skype4Py/client.py
Client.CreateEvent
def CreateEvent(self, EventId, Caption, Hint): """Creates a custom event displayed in Skype client's events pane. :Parameters: EventId : unicode Unique identifier for the event. Caption : unicode Caption text. Hint : unicode Hint text. S...
python
def CreateEvent(self, EventId, Caption, Hint): """Creates a custom event displayed in Skype client's events pane. :Parameters: EventId : unicode Unique identifier for the event. Caption : unicode Caption text. Hint : unicode Hint text. S...
[ "def", "CreateEvent", "(", "self", ",", "EventId", ",", "Caption", ",", "Hint", ")", ":", "self", ".", "_Skype", ".", "_DoCommand", "(", "'CREATE EVENT %s CAPTION %s HINT %s'", "%", "(", "tounicode", "(", "EventId", ")", ",", "quote", "(", "tounicode", "(", ...
Creates a custom event displayed in Skype client's events pane. :Parameters: EventId : unicode Unique identifier for the event. Caption : unicode Caption text. Hint : unicode Hint text. Shown when mouse hoovers over the event. :return: ...
[ "Creates", "a", "custom", "event", "displayed", "in", "Skype", "client", "s", "events", "pane", "." ]
train
https://github.com/Skype4Py/Skype4Py/blob/c48d83f7034109fe46315d45a066126002c6e0d4/Skype4Py/client.py#L44-L60
Skype4Py/Skype4Py
Skype4Py/client.py
Client.CreateMenuItem
def CreateMenuItem(self, MenuItemId, PluginContext, CaptionText, HintText=u'', IconPath='', Enabled=True, ContactType=pluginContactTypeAll, MultipleContacts=False): """Creates custom menu item in Skype client's "Do More" menus. :Parameters: MenuItemId : unicode ...
python
def CreateMenuItem(self, MenuItemId, PluginContext, CaptionText, HintText=u'', IconPath='', Enabled=True, ContactType=pluginContactTypeAll, MultipleContacts=False): """Creates custom menu item in Skype client's "Do More" menus. :Parameters: MenuItemId : unicode ...
[ "def", "CreateMenuItem", "(", "self", ",", "MenuItemId", ",", "PluginContext", ",", "CaptionText", ",", "HintText", "=", "u''", ",", "IconPath", "=", "''", ",", "Enabled", "=", "True", ",", "ContactType", "=", "pluginContactTypeAll", ",", "MultipleContacts", "...
Creates custom menu item in Skype client's "Do More" menus. :Parameters: MenuItemId : unicode Unique identifier for the menu item. PluginContext : `enums`.pluginContext* Menu item context. Allows to choose in which client windows will the menu item appear. ...
[ "Creates", "custom", "menu", "item", "in", "Skype", "client", "s", "Do", "More", "menus", "." ]
train
https://github.com/Skype4Py/Skype4Py/blob/c48d83f7034109fe46315d45a066126002c6e0d4/Skype4Py/client.py#L62-L99
Skype4Py/Skype4Py
Skype4Py/client.py
Client.Focus
def Focus(self): """Brings the client window into focus. """ self._Skype._Api.allow_focus(self._Skype.Timeout) self._Skype._DoCommand('FOCUS')
python
def Focus(self): """Brings the client window into focus. """ self._Skype._Api.allow_focus(self._Skype.Timeout) self._Skype._DoCommand('FOCUS')
[ "def", "Focus", "(", "self", ")", ":", "self", ".", "_Skype", ".", "_Api", ".", "allow_focus", "(", "self", ".", "_Skype", ".", "Timeout", ")", "self", ".", "_Skype", ".", "_DoCommand", "(", "'FOCUS'", ")" ]
Brings the client window into focus.
[ "Brings", "the", "client", "window", "into", "focus", "." ]
train
https://github.com/Skype4Py/Skype4Py/blob/c48d83f7034109fe46315d45a066126002c6e0d4/Skype4Py/client.py#L101-L105
Skype4Py/Skype4Py
Skype4Py/client.py
Client.OpenDialog
def OpenDialog(self, Name, *Params): """Open dialog. Use this method to open dialogs added in newer Skype versions if there is no dedicated method in Skype4Py. :Parameters: Name : str Dialog name. Params : unicode One or more optional parameters. ...
python
def OpenDialog(self, Name, *Params): """Open dialog. Use this method to open dialogs added in newer Skype versions if there is no dedicated method in Skype4Py. :Parameters: Name : str Dialog name. Params : unicode One or more optional parameters. ...
[ "def", "OpenDialog", "(", "self", ",", "Name", ",", "*", "Params", ")", ":", "self", ".", "_Skype", ".", "_Api", ".", "allow_focus", "(", "self", ".", "_Skype", ".", "Timeout", ")", "params", "=", "filter", "(", "None", ",", "(", "str", "(", "Name"...
Open dialog. Use this method to open dialogs added in newer Skype versions if there is no dedicated method in Skype4Py. :Parameters: Name : str Dialog name. Params : unicode One or more optional parameters.
[ "Open", "dialog", ".", "Use", "this", "method", "to", "open", "dialogs", "added", "in", "newer", "Skype", "versions", "if", "there", "is", "no", "dedicated", "method", "in", "Skype4Py", "." ]
train
https://github.com/Skype4Py/Skype4Py/blob/c48d83f7034109fe46315d45a066126002c6e0d4/Skype4Py/client.py#L150-L162
Skype4Py/Skype4Py
Skype4Py/client.py
Client.OpenMessageDialog
def OpenMessageDialog(self, Username, Text=u''): """Opens "Send an IM Message" dialog. :Parameters: Username : str Message target. Text : unicode Message text. """ self.OpenDialog('IM', Username, tounicode(Text))
python
def OpenMessageDialog(self, Username, Text=u''): """Opens "Send an IM Message" dialog. :Parameters: Username : str Message target. Text : unicode Message text. """ self.OpenDialog('IM', Username, tounicode(Text))
[ "def", "OpenMessageDialog", "(", "self", ",", "Username", ",", "Text", "=", "u''", ")", ":", "self", ".", "OpenDialog", "(", "'IM'", ",", "Username", ",", "tounicode", "(", "Text", ")", ")" ]
Opens "Send an IM Message" dialog. :Parameters: Username : str Message target. Text : unicode Message text.
[ "Opens", "Send", "an", "IM", "Message", "dialog", "." ]
train
https://github.com/Skype4Py/Skype4Py/blob/c48d83f7034109fe46315d45a066126002c6e0d4/Skype4Py/client.py#L195-L204
Skype4Py/Skype4Py
Skype4Py/client.py
Client.Start
def Start(self, Minimized=False, Nosplash=False): """Starts Skype application. :Parameters: Minimized : bool If True, Skype is started minimized in system tray. Nosplash : bool If True, no splash screen is displayed upon startup. """ self._Sky...
python
def Start(self, Minimized=False, Nosplash=False): """Starts Skype application. :Parameters: Minimized : bool If True, Skype is started minimized in system tray. Nosplash : bool If True, no splash screen is displayed upon startup. """ self._Sky...
[ "def", "Start", "(", "self", ",", "Minimized", "=", "False", ",", "Nosplash", "=", "False", ")", ":", "self", ".", "_Skype", ".", "_Api", ".", "startup", "(", "Minimized", ",", "Nosplash", ")" ]
Starts Skype application. :Parameters: Minimized : bool If True, Skype is started minimized in system tray. Nosplash : bool If True, no splash screen is displayed upon startup.
[ "Starts", "Skype", "application", "." ]
train
https://github.com/Skype4Py/Skype4Py/blob/c48d83f7034109fe46315d45a066126002c6e0d4/Skype4Py/client.py#L264-L273
Skype4Py/Skype4Py
Skype4Py/api/darwin.py
SkypeAPI.start
def start(self): """ Start the thread associated with this API object. Ensure that the call is made no more than once, to avoid raising a RuntimeError. """ if not self.thread_started: super(SkypeAPI, self).start() self.thread_started = True
python
def start(self): """ Start the thread associated with this API object. Ensure that the call is made no more than once, to avoid raising a RuntimeError. """ if not self.thread_started: super(SkypeAPI, self).start() self.thread_started = True
[ "def", "start", "(", "self", ")", ":", "if", "not", "self", ".", "thread_started", ":", "super", "(", "SkypeAPI", ",", "self", ")", ".", "start", "(", ")", "self", ".", "thread_started", "=", "True" ]
Start the thread associated with this API object. Ensure that the call is made no more than once, to avoid raising a RuntimeError.
[ "Start", "the", "thread", "associated", "with", "this", "API", "object", ".", "Ensure", "that", "the", "call", "is", "made", "no", "more", "than", "once", "to", "avoid", "raising", "a", "RuntimeError", "." ]
train
https://github.com/Skype4Py/Skype4Py/blob/c48d83f7034109fe46315d45a066126002c6e0d4/Skype4Py/api/darwin.py#L302-L310
Skype4Py/Skype4Py
Skype4Py/api/posix_x11.py
threads_init
def threads_init(gtk=True): """Enables multithreading support in Xlib and PyGTK. See the module docstring for more info. :Parameters: gtk : bool May be set to False to skip the PyGTK module. """ # enable X11 multithreading x11.XInitThreads() if gtk: from gtk.gdk im...
python
def threads_init(gtk=True): """Enables multithreading support in Xlib and PyGTK. See the module docstring for more info. :Parameters: gtk : bool May be set to False to skip the PyGTK module. """ # enable X11 multithreading x11.XInitThreads() if gtk: from gtk.gdk im...
[ "def", "threads_init", "(", "gtk", "=", "True", ")", ":", "# enable X11 multithreading", "x11", ".", "XInitThreads", "(", ")", "if", "gtk", ":", "from", "gtk", ".", "gdk", "import", "threads_init", "threads_init", "(", ")" ]
Enables multithreading support in Xlib and PyGTK. See the module docstring for more info. :Parameters: gtk : bool May be set to False to skip the PyGTK module.
[ "Enables", "multithreading", "support", "in", "Xlib", "and", "PyGTK", ".", "See", "the", "module", "docstring", "for", "more", "info", ".", ":", "Parameters", ":", "gtk", ":", "bool", "May", "be", "set", "to", "False", "to", "skip", "the", "PyGTK", "modu...
train
https://github.com/Skype4Py/Skype4Py/blob/c48d83f7034109fe46315d45a066126002c6e0d4/Skype4Py/api/posix_x11.py#L227-L239
Skype4Py/Skype4Py
Skype4Py/api/posix_x11.py
SkypeAPI.get_skype
def get_skype(self): """Returns Skype window ID or None if Skype not running.""" skype_inst = x11.XInternAtom(self.disp, '_SKYPE_INSTANCE', True) if not skype_inst: return type_ret = Atom() format_ret = c_int() nitems_ret = c_ulong() bytes_after_ret = ...
python
def get_skype(self): """Returns Skype window ID or None if Skype not running.""" skype_inst = x11.XInternAtom(self.disp, '_SKYPE_INSTANCE', True) if not skype_inst: return type_ret = Atom() format_ret = c_int() nitems_ret = c_ulong() bytes_after_ret = ...
[ "def", "get_skype", "(", "self", ")", ":", "skype_inst", "=", "x11", ".", "XInternAtom", "(", "self", ".", "disp", ",", "'_SKYPE_INSTANCE'", ",", "True", ")", "if", "not", "skype_inst", ":", "return", "type_ret", "=", "Atom", "(", ")", "format_ret", "=",...
Returns Skype window ID or None if Skype not running.
[ "Returns", "Skype", "window", "ID", "or", "None", "if", "Skype", "not", "running", "." ]
train
https://github.com/Skype4Py/Skype4Py/blob/c48d83f7034109fe46315d45a066126002c6e0d4/Skype4Py/api/posix_x11.py#L323-L337
Skype4Py/Skype4Py
Skype4Py/call.py
Call.Join
def Join(self, Id): """Joins with another call to form a conference. :Parameters: Id : int Call Id of the other call to join to the conference. :return: Conference object. :rtype: `Conference` """ #self._Alter('JOIN_CONFERENCE', Id) reply =...
python
def Join(self, Id): """Joins with another call to form a conference. :Parameters: Id : int Call Id of the other call to join to the conference. :return: Conference object. :rtype: `Conference` """ #self._Alter('JOIN_CONFERENCE', Id) reply =...
[ "def", "Join", "(", "self", ",", "Id", ")", ":", "#self._Alter('JOIN_CONFERENCE', Id)", "reply", "=", "self", ".", "_Owner", ".", "_DoCommand", "(", "'SET CALL %s JOIN_CONFERENCE %s'", "%", "(", "self", ".", "Id", ",", "Id", ")", ",", "'CALL %s CONF_ID'", "%",...
Joins with another call to form a conference. :Parameters: Id : int Call Id of the other call to join to the conference. :return: Conference object. :rtype: `Conference`
[ "Joins", "with", "another", "call", "to", "form", "a", "conference", "." ]
train
https://github.com/Skype4Py/Skype4Py/blob/c48d83f7034109fe46315d45a066126002c6e0d4/Skype4Py/call.py#L175-L188
Skype4Py/Skype4Py
Skype4Py/settings.py
Settings.Avatar
def Avatar(self, Id=1, Set=None): """Sets user avatar picture from file. :Parameters: Id : int Optional avatar Id. Set : str New avatar file name. :deprecated: Use `LoadAvatarFromFile` instead. """ from warnings import warn wa...
python
def Avatar(self, Id=1, Set=None): """Sets user avatar picture from file. :Parameters: Id : int Optional avatar Id. Set : str New avatar file name. :deprecated: Use `LoadAvatarFromFile` instead. """ from warnings import warn wa...
[ "def", "Avatar", "(", "self", ",", "Id", "=", "1", ",", "Set", "=", "None", ")", ":", "from", "warnings", "import", "warn", "warn", "(", "'Settings.Avatar: Use Settings.LoadAvatarFromFile instead.'", ",", "DeprecationWarning", ",", "stacklevel", "=", "2", ")", ...
Sets user avatar picture from file. :Parameters: Id : int Optional avatar Id. Set : str New avatar file name. :deprecated: Use `LoadAvatarFromFile` instead.
[ "Sets", "user", "avatar", "picture", "from", "file", "." ]
train
https://github.com/Skype4Py/Skype4Py/blob/c48d83f7034109fe46315d45a066126002c6e0d4/Skype4Py/settings.py#L25-L40
Skype4Py/Skype4Py
Skype4Py/settings.py
Settings.LoadAvatarFromFile
def LoadAvatarFromFile(self, Filename, AvatarId=1): """Loads user avatar picture from file. :Parameters: Filename : str Name of the avatar file. AvatarId : int Optional avatar Id. """ s = 'AVATAR %s %s' % (AvatarId, path2unicode(Filename)) ...
python
def LoadAvatarFromFile(self, Filename, AvatarId=1): """Loads user avatar picture from file. :Parameters: Filename : str Name of the avatar file. AvatarId : int Optional avatar Id. """ s = 'AVATAR %s %s' % (AvatarId, path2unicode(Filename)) ...
[ "def", "LoadAvatarFromFile", "(", "self", ",", "Filename", ",", "AvatarId", "=", "1", ")", ":", "s", "=", "'AVATAR %s %s'", "%", "(", "AvatarId", ",", "path2unicode", "(", "Filename", ")", ")", "self", ".", "_Skype", ".", "_DoCommand", "(", "'SET %s'", "...
Loads user avatar picture from file. :Parameters: Filename : str Name of the avatar file. AvatarId : int Optional avatar Id.
[ "Loads", "user", "avatar", "picture", "from", "file", "." ]
train
https://github.com/Skype4Py/Skype4Py/blob/c48d83f7034109fe46315d45a066126002c6e0d4/Skype4Py/settings.py#L42-L52
Skype4Py/Skype4Py
Skype4Py/settings.py
Settings.RingTone
def RingTone(self, Id=1, Set=None): """Returns/sets a ringtone. :Parameters: Id : int Ringtone Id Set : str Path to new ringtone or None if the current path should be queried. :return: Current path if Set=None, None otherwise. :rtype: str or ...
python
def RingTone(self, Id=1, Set=None): """Returns/sets a ringtone. :Parameters: Id : int Ringtone Id Set : str Path to new ringtone or None if the current path should be queried. :return: Current path if Set=None, None otherwise. :rtype: str or ...
[ "def", "RingTone", "(", "self", ",", "Id", "=", "1", ",", "Set", "=", "None", ")", ":", "if", "Set", "is", "None", ":", "return", "unicode2path", "(", "self", ".", "_Skype", ".", "_Property", "(", "'RINGTONE'", ",", "Id", ",", "''", ")", ")", "se...
Returns/sets a ringtone. :Parameters: Id : int Ringtone Id Set : str Path to new ringtone or None if the current path should be queried. :return: Current path if Set=None, None otherwise. :rtype: str or None
[ "Returns", "/", "sets", "a", "ringtone", "." ]
train
https://github.com/Skype4Py/Skype4Py/blob/c48d83f7034109fe46315d45a066126002c6e0d4/Skype4Py/settings.py#L59-L73
Skype4Py/Skype4Py
Skype4Py/settings.py
Settings.RingToneStatus
def RingToneStatus(self, Id=1, Set=None): """Enables/disables a ringtone. :Parameters: Id : int Ringtone Id Set : bool True/False if the ringtone should be enabled/disabled or None if the current status should be queried. :return: Current...
python
def RingToneStatus(self, Id=1, Set=None): """Enables/disables a ringtone. :Parameters: Id : int Ringtone Id Set : bool True/False if the ringtone should be enabled/disabled or None if the current status should be queried. :return: Current...
[ "def", "RingToneStatus", "(", "self", ",", "Id", "=", "1", ",", "Set", "=", "None", ")", ":", "if", "Set", "is", "None", ":", "return", "(", "self", ".", "_Skype", ".", "_Property", "(", "'RINGTONE'", ",", "Id", ",", "'STATUS'", ")", "==", "'ON'", ...
Enables/disables a ringtone. :Parameters: Id : int Ringtone Id Set : bool True/False if the ringtone should be enabled/disabled or None if the current status should be queried. :return: Current status if Set=None, None otherwise. :rtype: ...
[ "Enables", "/", "disables", "a", "ringtone", "." ]
train
https://github.com/Skype4Py/Skype4Py/blob/c48d83f7034109fe46315d45a066126002c6e0d4/Skype4Py/settings.py#L75-L90
Skype4Py/Skype4Py
Skype4Py/settings.py
Settings.SaveAvatarToFile
def SaveAvatarToFile(self, Filename, AvatarId=1): """Saves user avatar picture to file. :Parameters: Filename : str Destination path. AvatarId : int Avatar Id """ s = 'AVATAR %s %s' % (AvatarId, path2unicode(Filename)) self._Skype._DoC...
python
def SaveAvatarToFile(self, Filename, AvatarId=1): """Saves user avatar picture to file. :Parameters: Filename : str Destination path. AvatarId : int Avatar Id """ s = 'AVATAR %s %s' % (AvatarId, path2unicode(Filename)) self._Skype._DoC...
[ "def", "SaveAvatarToFile", "(", "self", ",", "Filename", ",", "AvatarId", "=", "1", ")", ":", "s", "=", "'AVATAR %s %s'", "%", "(", "AvatarId", ",", "path2unicode", "(", "Filename", ")", ")", "self", ".", "_Skype", ".", "_DoCommand", "(", "'GET %s'", "%"...
Saves user avatar picture to file. :Parameters: Filename : str Destination path. AvatarId : int Avatar Id
[ "Saves", "user", "avatar", "picture", "to", "file", "." ]
train
https://github.com/Skype4Py/Skype4Py/blob/c48d83f7034109fe46315d45a066126002c6e0d4/Skype4Py/settings.py#L92-L102