bugged stringlengths 4 228k | fixed stringlengths 0 96.3M | __index_level_0__ int64 0 481k |
|---|---|---|
def saturate(self, max_prime=-1, odd_primes_only=False): r""" Saturate this subgroup of the Mordell-Weil group. INPUT: - ``max_prime`` (int, default -1) -- saturation is performed for all primes up to `max_prime`. If `-1` (default) then an upper bound is computed for the primes at which the subgroup may not be satura... | def saturate(self, max_prime=-1, odd_primes_only=False): r""" Saturate this subgroup of the Mordell-Weil group. INPUT: - ``max_prime`` (int, default -1) -- saturation is performed for all primes up to `max_prime`. If `-1` (default) then an upper bound is computed for the primes at which the subgroup may not be satura... | 462,100 |
def saturate(self, max_prime=-1, odd_primes_only=False): r""" Saturate this subgroup of the Mordell-Weil group. INPUT: - ``max_prime`` (int, default -1) -- saturation is performed for all primes up to `max_prime`. If `-1` (default) then an upper bound is computed for the primes at which the subgroup may not be satura... | def saturate(self, max_prime=-1, odd_primes_only=False): r""" Saturate this subgroup of the Mordell-Weil group. INPUT: - ``max_prime`` (int, default -1) -- saturation is performed for all primes up to `max_prime`. If `-1` (default) then an upper bound is computed for the primes at which the subgroup may not be satura... | 462,101 |
def saturate(self, max_prime=-1, odd_primes_only=False): r""" Saturate this subgroup of the Mordell-Weil group. INPUT: - ``max_prime`` (int, default -1) -- saturation is performed for all primes up to `max_prime`. If `-1` (default) then an upper bound is computed for the primes at which the subgroup may not be satura... | def saturate(self, max_prime=-1, odd_primes_only=False): r""" Saturate this subgroup of the Mordell-Weil group. INPUT: - ``max_prime`` (int, default -1) -- saturation is performed for all primes up to `max_prime`. If `-1` (default) then an upper bound is computed for the primes at which the subgroup may not be satura... | 462,102 |
def saturate(self, max_prime=-1, odd_primes_only=False): r""" Saturate this subgroup of the Mordell-Weil group. INPUT: - ``max_prime`` (int, default -1) -- saturation is performed for all primes up to `max_prime`. If `-1` (default) then an upper bound is computed for the primes at which the subgroup may not be satura... | def saturate(self, max_prime=-1, odd_primes_only=False): r""" Saturate this subgroup of the Mordell-Weil group. INPUT: - ``max_prime`` (int, default -1) -- saturation is performed for all primes up to `max_prime`. If `-1` (default) then an upper bound is computed for the primes at which the subgroup may not be satura... | 462,103 |
def saturate(self, max_prime=-1, odd_primes_only=False): r""" Saturate this subgroup of the Mordell-Weil group. INPUT: - ``max_prime`` (int, default -1) -- saturation is performed for all primes up to `max_prime`. If `-1` (default) then an upper bound is computed for the primes at which the subgroup may not be satura... | def saturate(self, max_prime=-1, odd_primes_only=False): r""" Saturate this subgroup of the Mordell-Weil group. INPUT: - ``max_prime`` (int, default -1) -- saturation is performed for all primes up to `max_prime`. If `-1` (default) then an upper bound is computed for the primes at which the subgroup may not be satura... | 462,104 |
def saturate(self, max_prime=-1, odd_primes_only=False): r""" Saturate this subgroup of the Mordell-Weil group. INPUT: - ``max_prime`` (int, default -1) -- saturation is performed for all primes up to `max_prime`. If `-1` (default) then an upper bound is computed for the primes at which the subgroup may not be satura... | def saturate(self, max_prime=-1, odd_primes_only=False): r""" Saturate this subgroup of the Mordell-Weil group. INPUT: - ``max_prime`` (int, default -1) -- saturation is performed for all primes up to `max_prime`. If `-1` (default) then an upper bound is computed for the primes at which the subgroup may not be satura... | 462,105 |
def saturate(self, max_prime=-1, odd_primes_only=False): r""" Saturate this subgroup of the Mordell-Weil group. INPUT: - ``max_prime`` (int, default -1) -- saturation is performed for all primes up to `max_prime`. If `-1` (default) then an upper bound is computed for the primes at which the subgroup may not be satura... | def saturate(self, max_prime=-1, odd_primes_only=False): r""" Saturate this subgroup of the Mordell-Weil group. INPUT: - ``max_prime`` (int, default -1) -- saturation is performed for all primes up to `max_prime`. If `-1` (default) then an upper bound is computed for the primes at which the subgroup may not be satura... | 462,106 |
def search(self, height_limit=18, verbose=False): r""" Search for new points, and add them to this subgroup of the Mordell-Weil group. | def search(self, height_limit=18, verbose=False): r""" Search for new points, and add them to this subgroup of the Mordell-Weil group. | 462,107 |
def search(self, height_limit=18, verbose=False): r""" Search for new points, and add them to this subgroup of the Mordell-Weil group. | def search(self, height_limit=18, verbose=False): r""" Search for new points, and add them to this subgroup of the Mordell-Weil group. | 462,108 |
def search(self, height_limit=18, verbose=False): r""" Search for new points, and add them to this subgroup of the Mordell-Weil group. | def search(self, height_limit=18, verbose=False): r""" Search for new points, and add them to this subgroup of the Mordell-Weil group. | 462,109 |
def search(self, height_limit=18, verbose=False): r""" Search for new points, and add them to this subgroup of the Mordell-Weil group. | def search(self, height_limit=18, verbose=False): r""" Search for new points, and add them to this subgroup of the Mordell-Weil group. | 462,110 |
def search(self, height_limit=18, verbose=False): r""" Search for new points, and add them to this subgroup of the Mordell-Weil group. | def search(self, height_limit=18, verbose=False): r""" Search for new points, and add them to this subgroup of the Mordell-Weil group. | 462,111 |
def search(self, height_limit=18, verbose=False): r""" Search for new points, and add them to this subgroup of the Mordell-Weil group. | def search(self, height_limit=18, verbose=False): r""" Search for new points, and add them to this subgroup of the Mordell-Weil group. | 462,112 |
def points(self): """ Return a list of the generating points in this Mordell-Weil group. | def points(self): """ Return a list of the generating points in this Mordell-Weil group. | 462,113 |
def is_square(self): r""" Returns True if self is a square, and False otherwise. EXAMPLES:: sage: Word([1,0,0,1]).is_square() False sage: W = Words('123') sage: W('1212').is_square() True sage: W('1213').is_square() False sage: W('12123').is_square() False sage: W().is_square() True """ if self.length() % 2 != 0: ret... | def is_square(self): r""" Returns True if self is a square, and False otherwise. EXAMPLES:: sage: Word([1,0,0,1]).is_square() False sage: Word('1212').is_square() True sage: Word('1213').is_square() False sage: Word('12123').is_square() False sage: Word().is_square() True """ if self.length() % 2 != 0: return False e... | 462,114 |
def is_square_free(self): r""" Returns True if self does not contain squares, and False otherwise. EXAMPLES:: sage: W = Words('123') sage: W('12312').is_square_free() True sage: W('31212').is_square_free() False sage: W().is_square_free() True | def is_square_free(self): r""" Returns True if self does not contain squares, and False otherwise. EXAMPLES:: sage: W = Words('123') sage: W('12312').is_square_free() True sage: W('31212').is_square_free() False sage: W().is_square_free() True | 462,115 |
def is_square_free(self): r""" Returns True if self does not contain squares, and False otherwise. EXAMPLES:: sage: W = Words('123') sage: W('12312').is_square_free() True sage: W('31212').is_square_free() False sage: W().is_square_free() True | def is_square_free(self): r""" Returns True if self does not contain squares, and False otherwise. EXAMPLES:: sage: W = Words('123') sage: W('12312').is_square_free() True sage: W('31212').is_square_free() False sage: W().is_square_free() True | 462,116 |
def is_square_free(self): r""" Returns True if self does not contain squares, and False otherwise. EXAMPLES:: sage: W = Words('123') sage: W('12312').is_square_free() True sage: W('31212').is_square_free() False sage: W().is_square_free() True | def is_square_free(self): r""" Returns True if self does not contain squares, and False otherwise. EXAMPLES:: sage: W = Words('123') sage: W('12312').is_square_free() True sage: W('31212').is_square_free() False sage: W().is_square_free() True | 462,117 |
def is_cube(self): r""" Returns True if self is a cube, and False otherwise. EXAMPLES:: sage: W = Words('012') sage: W('012012012').is_cube() True sage: W('01010101').is_cube() False sage: W().is_cube() True sage: W('012012').is_cube() False """ if self.length() % 3 != 0: return False l = self.length() / 3 return sel... | def is_cube(self): r""" Returns True if self is a cube, and False otherwise. EXAMPLES:: sage: Word('012012012').is_cube() True sage: Word('01010101').is_cube() False sage: Word().is_cube() True sage: Word('012012').is_cube() False """ if self.length() % 3 != 0: return False l = self.length() / 3 return self[:l] == se... | 462,118 |
def is_cube_free(self): r""" Returns True if self does not contain cubes, and False otherwise. EXAMPLES:: sage: W = Words('123') sage: W('12312').is_cube_free() True sage: W('32221').is_cube_free() False sage: W().is_cube_free() True """ l = self.length() if l < 3: return True suff = self for i in xrange(0, l - 3): f... | def is_cube_free(self): r""" Returns True if self does not contain cubes, and False otherwise. EXAMPLES:: sage: Word('12312').is_cube_free() True sage: Word('32221').is_cube_free() False sage: Word().is_cube_free() True TESTS: We make sure that sage: Word('111').is_cube_free() False sage: Word('2111').is_cube_free... | 462,119 |
def is_cube_free(self): r""" Returns True if self does not contain cubes, and False otherwise. EXAMPLES:: sage: W = Words('123') sage: W('12312').is_cube_free() True sage: W('32221').is_cube_free() False sage: W().is_cube_free() True """ l = self.length() if l < 3: return True suff = self for i in xrange(0, l - 3): f... | def is_cube_free(self): r""" Returns True if self does not contain cubes, and False otherwise. EXAMPLES:: sage: W = Words('123') sage: W('12312').is_cube_free() True sage: W('32221').is_cube_free() False sage: W().is_cube_free() True """ l = self.length() if l < 3: return True for start in xrange(0, L - 2): for end i... | 462,120 |
def is_cube_free(self): r""" Returns True if self does not contain cubes, and False otherwise. EXAMPLES:: sage: W = Words('123') sage: W('12312').is_cube_free() True sage: W('32221').is_cube_free() False sage: W().is_cube_free() True """ l = self.length() if l < 3: return True suff = self for i in xrange(0, l - 3): f... | def is_cube_free(self): r""" Returns True if self does not contain cubes, and False otherwise. EXAMPLES:: sage: W = Words('123') sage: W('12312').is_cube_free() True sage: W('32221').is_cube_free() False sage: W().is_cube_free() True """ l = self.length() if l < 3: return True suff = self for i in xrange(0, l - 3): f... | 462,121 |
def frequency_table(string): r""" Return the frequency table corresponding to the given string. INPUT: - ``string`` -- a string EXAMPLE:: sage: from sage.coding.source_coding.huffman import frequency_table sage: str = "Sage is my most favorite general purpose computer algebra system" sage: frequency_table(str) {'a'... | def frequency_table(string): r""" Return the frequency table corresponding to the given string. INPUT: - ``string`` -- a string EXAMPLE:: sage: from sage.coding.source_coding.huffman import frequency_table sage: str = "Sage is my most favorite general purpose computer algebra system" sage: frequency_table(str) {'a'... | 462,122 |
def frequency_table(string): r""" Return the frequency table corresponding to the given string. INPUT: - ``string`` -- a string EXAMPLE:: sage: from sage.coding.source_coding.huffman import frequency_table sage: str = "Sage is my most favorite general purpose computer algebra system" sage: frequency_table(str) {'a'... | def frequency_table(string): r""" Return the frequency table corresponding to the given string. INPUT: - ``string`` -- a string of symbols over some alphabet. OUTPUT: - A table of frequency of each unique symbol in ``string``. If ``string`` is an empty string, return an empty table. EXAMPLES: The frequency table ... | 462,123 |
def frequency_table(string): r""" Return the frequency table corresponding to the given string. INPUT: - ``string`` -- a string EXAMPLE:: sage: from sage.coding.source_coding.huffman import frequency_table sage: str = "Sage is my most favorite general purpose computer algebra system" sage: frequency_table(str) {'a'... | def frequency_table(string): r""" Return the frequency table corresponding to the given string. INPUT: - ``string`` -- a string EXAMPLE:: sage: from sage.coding.source_coding.huffman import frequency_table sage: str = "Stop counting my characters!" sage: T = sorted(frequency_table(str).items()) sage: for symbol, co... | 462,124 |
def frequency_table(string): r""" Return the frequency table corresponding to the given string. INPUT: - ``string`` -- a string EXAMPLE:: sage: from sage.coding.source_coding.huffman import frequency_table sage: str = "Sage is my most favorite general purpose computer algebra system" sage: frequency_table(str) {'a'... | def frequency_table(string): r""" Return the frequency table corresponding to the given string. INPUT: - ``string`` -- a string EXAMPLE:: sage: from sage.coding.source_coding.huffman import frequency_table sage: str = "Sage is my most favorite general purpose computer algebra system" sage: frequency_table(str) {'a'... | 462,125 |
def frequency_table(string): r""" Return the frequency table corresponding to the given string. INPUT: - ``string`` -- a string EXAMPLE:: sage: from sage.coding.source_coding.huffman import frequency_table sage: str = "Sage is my most favorite general purpose computer algebra system" sage: frequency_table(str) {'a'... | def frequency_table(string): r""" Return the frequency table corresponding to the given string. INPUT: - ``string`` -- a string EXAMPLE:: sage: from sage.coding.source_coding.huffman import frequency_table sage: str = "Sage is my most favorite general purpose computer algebra system" sage: frequency_table(str) {'a'... | 462,126 |
def frequency_table(string): r""" Return the frequency table corresponding to the given string. INPUT: - ``string`` -- a string EXAMPLE:: sage: from sage.coding.source_coding.huffman import frequency_table sage: str = "Sage is my most favorite general purpose computer algebra system" sage: frequency_table(str) {'a'... | def frequency_table(string): r""" Return the frequency table corresponding to the given string. INPUT: - ``string`` -- a string EXAMPLE:: sage: from sage.coding.source_coding.huffman import frequency_table sage: str = "Sage is my most favorite general purpose computer algebra system" sage: frequency_table(str) {'a'... | 462,127 |
def frequency_table(string): r""" Return the frequency table corresponding to the given string. INPUT: - ``string`` -- a string EXAMPLE:: sage: from sage.coding.source_coding.huffman import frequency_table sage: str = "Sage is my most favorite general purpose computer algebra system" sage: frequency_table(str) {'a'... | def frequency_table(string): r""" Return the frequency table corresponding to the given string. INPUT: - ``string`` -- a string EXAMPLE:: sage: from sage.coding.source_coding.huffman import frequency_table sage: str = "Sage is my most favorite general purpose computer algebra system" sage: frequency_table(str) {'a'... | 462,128 |
def frequency_table(string): r""" Return the frequency table corresponding to the given string. INPUT: - ``string`` -- a string EXAMPLE:: sage: from sage.coding.source_coding.huffman import frequency_table sage: str = "Sage is my most favorite general purpose computer algebra system" sage: frequency_table(str) {'a'... | def frequency_table(string): r""" Return the frequency table corresponding to the given string. INPUT: - ``string`` -- a string EXAMPLE:: sage: from sage.coding.source_coding.huffman import frequency_table sage: str = "Sage is my most favorite general purpose computer algebra system" sage: frequency_table(str) {'a'... | 462,129 |
def frequency_table(string): r""" Return the frequency table corresponding to the given string. INPUT: - ``string`` -- a string EXAMPLE:: sage: from sage.coding.source_coding.huffman import frequency_table sage: str = "Sage is my most favorite general purpose computer algebra system" sage: frequency_table(str) {'a'... | def frequency_table(string): r""" Return the frequency table corresponding to the given string. INPUT: - ``string`` -- a string EXAMPLE:: sage: from sage.coding.source_coding.huffman import frequency_table sage: str = "Sage is my most favorite general purpose computer algebra system" sage: frequency_table(str) {'a'... | 462,130 |
def frequency_table(string): r""" Return the frequency table corresponding to the given string. INPUT: - ``string`` -- a string EXAMPLE:: sage: from sage.coding.source_coding.huffman import frequency_table sage: str = "Sage is my most favorite general purpose computer algebra system" sage: frequency_table(str) {'a'... | def frequency_table(string): r""" Return the frequency table corresponding to the given string. INPUT: - ``string`` -- a string EXAMPLE:: sage: from sage.coding.source_coding.huffman import frequency_table sage: str = "Sage is my most favorite general purpose computer algebra system" sage: frequency_table(str) {'a'... | 462,131 |
def frequency_table(string): r""" Return the frequency table corresponding to the given string. INPUT: - ``string`` -- a string EXAMPLE:: sage: from sage.coding.source_coding.huffman import frequency_table sage: str = "Sage is my most favorite general purpose computer algebra system" sage: frequency_table(str) {'a'... | def frequency_table(string): r""" Return the frequency table corresponding to the given string. INPUT: - ``string`` -- a string EXAMPLE:: sage: from sage.coding.source_coding.huffman import frequency_table sage: str = "Sage is my most favorite general purpose computer algebra system" sage: frequency_table(str) {'a'... | 462,132 |
def __init__(self, string = None, frequencies = None): r""" Constructor for Huffman | def __init__(self, string = None, frequencies = None): r""" Constructor for Huffman | 462,133 |
def __init__(self, string = None, frequencies = None): r""" Constructor for Huffman | def __init__(self, string = None, frequencies = None): r""" Constructor for Huffman | 462,134 |
def __init__(self, string = None, frequencies = None): r""" Constructor for Huffman | def __init__(self, string = None, frequencies = None): r""" Constructor for Huffman | 462,135 |
def __init__(self, string = None, frequencies = None): r""" Constructor for Huffman | def __init__(self, string = None, frequencies = None): r""" Constructor for Huffman | 462,136 |
def _build_code_from_tree(self, tree, d, prefix=''): r""" Builds the code corresponding to a given tree and prefix | def _build_code_from_tree(self, tree, d, prefix=''): r""" Builds the code corresponding to a given tree and prefix | 462,137 |
def _build_code_from_tree(self, tree, d, prefix=''): r""" Builds the code corresponding to a given tree and prefix | def _build_code_from_tree(self, tree, d, prefix=''): r""" Builds the code corresponding to a given tree and prefix | 462,138 |
def _build_code_from_tree(self, tree, d, prefix=''): r""" Builds the code corresponding to a given tree and prefix | def _build_code_from_tree(self, tree, d, prefix=''): r""" Builds the code corresponding to a given tree and prefix | 462,139 |
def _build_code(self, dic): r""" Returns a Huffman code for each one of the given elements. INPUT: - ``dic`` (dictionary) -- associates to each letter of the alphabet a frequency or a number of occurrences. | def _build_code(self, dic): r""" Returns a Huffman code for each one of the given elements. INPUT: - ``dic`` (dictionary) -- associates to each letter of the alphabet a frequency or a number of occurrences. | 462,140 |
def _build_code(self, dic): r""" Returns a Huffman code for each one of the given elements. INPUT: - ``dic`` (dictionary) -- associates to each letter of the alphabet a frequency or a number of occurrences. | def_build_code(self,dic):r"""ReturnsaHuffmancodeforeachoneofthegivenelements.INPUT:-``dic``(dictionary)--associatestoeachletterofthealphabetafrequencyoranumberofoccurrences. | 462,141 |
def _build_code(self, dic): r""" Returns a Huffman code for each one of the given elements. INPUT: - ``dic`` (dictionary) -- associates to each letter of the alphabet a frequency or a number of occurrences. | def _build_code(self, dic): r""" Returns a Huffman code for each one of the given elements. INPUT: - ``dic`` (dictionary) -- associates to each letter of the alphabet a frequency or a number of occurrences. | 462,142 |
def _build_code(self, dic): r""" Returns a Huffman code for each one of the given elements. INPUT: - ``dic`` (dictionary) -- associates to each letter of the alphabet a frequency or a number of occurrences. | def _build_code(self, dic): r""" Returns a Huffman code for each one of the given elements. INPUT: - ``dic`` (dictionary) -- associates to each letter of the alphabet a frequency or a number of occurrences. | 462,143 |
def _build_code(self, dic): r""" Returns a Huffman code for each one of the given elements. INPUT: - ``dic`` (dictionary) -- associates to each letter of the alphabet a frequency or a number of occurrences. | def _build_code(self, dic): r""" Returns a Huffman code for each one of the given elements. INPUT: - ``dic`` (dictionary) -- associates to each letter of the alphabet a frequency or a number of occurrences. | 462,144 |
def encode(self, string): r""" Returns an encoding of the given string based on the current encoding table | def encode(self, string): r""" Returns an encoding of the given string based on the current encoding table | 462,145 |
def encode(self, string): r""" Returns an encoding of the given string based on the current encoding table | defencode(self,string):r"""Returnsanencodingofthegivenstringbasedonthecurrentencodingtable | 462,146 |
def encode(self, string): r""" Returns an encoding of the given string based on the current encoding table | def encode(self, string): r""" Returns an encoding of the given string based on the current encoding table | 462,147 |
def decode(self, string): r""" Returns a decoded version of the given string corresponding to the current encoding table. | def decode(self, string): r""" Returns a decoded version of the given string corresponding to the current encoding table. | 462,148 |
def decode(self, string): r""" Returns a decoded version of the given string corresponding to the current encoding table. | def decode(self, string): r""" Returns a decoded version of the given string corresponding to the current encoding table. | 462,149 |
def decode(self, string): r""" Returns a decoded version of the given string corresponding to the current encoding table. | def decode(self, string): r""" Returns a decoded version of the given string corresponding to the current encoding table. | 462,150 |
def decode(self, string): r""" Returns a decoded version of the given string corresponding to the current encoding table. | def decode(self, string): r""" Returns a decoded version of the given string corresponding to the current encoding table. | 462,151 |
def decode(self, string): r""" Returns a decoded version of the given string corresponding to the current encoding table. | def decode(self, string): r""" Returns a decoded version of the given string corresponding to the current encoding table. | 462,152 |
def decode(self, string): r""" Returns a decoded version of the given string corresponding to the current encoding table. | def decode(self, string): r""" Returns a decoded version of the given string corresponding to the current encoding table. | 462,153 |
def decode(self, string): r""" Returns a decoded version of the given string corresponding to the current encoding table. | def decode(self, string): r""" Returns a decoded version of the given string corresponding to the current encoding table. | 462,154 |
def encoding_table(self): r""" Returns the current encoding table | def encoding_table(self): r""" Returns the current encoding table | 462,155 |
def encoding_table(self): r""" Returns the current encoding table | def encoding_table(self): r""" Returns the current encoding table | 462,156 |
def tree(self): r""" Returns the Huffman tree corresponding to the current encoding | def tree(self): r""" Returns the Huffman tree corresponding to the current encoding | 462,157 |
def tree(self): r""" Returns the Huffman tree corresponding to the current encoding | def tree(self): r""" Returns the Huffman tree corresponding to the current encoding | 462,158 |
def tree(self): r""" Returns the Huffman tree corresponding to the current encoding | def tree(self): r""" Returns the Huffman tree corresponding to the current encoding | 462,159 |
def _generate_edges(self, tree, father='', id=''): if father=='': u = 'root' else: u = father try: return self._generate_edges(tree[0], father=father+id, id='0') + \ self._generate_edges(tree[1], father=father+id, id='1') + \ ([(u, father+id)] if (father+id) != '' else []) | def _generate_edges(self, tree, parent="", bit=""): """ Generate the edges of the given Huffman tree. INPUT: - ``tree`` -- a Huffman binary tree. - ``parent`` -- (default: empty string) a parent vertex with exactly two children. - ``bit`` -- (default: empty string) the bit signifying either the left or right branch... | 462,160 |
def _generate_edges(self, tree, father='', id=''): if father=='': u = 'root' else: u = father try: return self._generate_edges(tree[0], father=father+id, id='0') + \ self._generate_edges(tree[1], father=father+id, id='1') + \ ([(u, father+id)] if (father+id) != '' else []) | def _generate_edges(self, tree, father='', id=''): if father=='': u = 'root' else: u = parent s = "".join([parent, bit]) try: return self._generate_edges(tree[0], father=father+id, id='0') + \ self._generate_edges(tree[1], father=father+id, id='1') + \ ([(u, father+id)] if (father+id) != '' else []) | 462,161 |
def _generate_edges(self, tree, father='', id=''): if father=='': u = 'root' else: u = father try: return self._generate_edges(tree[0], father=father+id, id='0') + \ self._generate_edges(tree[1], father=father+id, id='1') + \ ([(u, father+id)] if (father+id) != '' else []) | def _generate_edges(self, tree, father='', id=''): if father=='': u = 'root' else: u = father try: return self._generate_edges(tree[0], father=father+id, id='0') + \ self._generate_edges(tree[1], father=father+id, id='1') + \ ([(u, father+id)] if (father+id) != '' else []) | 462,162 |
def _generate_edges(self, tree, father='', id=''): if father=='': u = 'root' else: u = father try: return self._generate_edges(tree[0], father=father+id, id='0') + \ self._generate_edges(tree[1], father=father+id, id='1') + \ ([(u, father+id)] if (father+id) != '' else []) | def _generate_edges(self, tree, father='', id=''): if father=='': u = 'root' else: u = father try: return self._generate_edges(tree[0], father=father+id, id='0') + \ self._generate_edges(tree[1], father=father+id, id='1') + \ ([(u, father+id)] if (father+id) != '' else []) | 462,163 |
def factorial(n, algorithm='gmp'): r""" Compute the factorial of `n`, which is the product `1\cdot 2\cdot 3 \cdots (n-1)\cdot n`. INPUT: - ``n`` - an integer - ``algorithm`` - string (default: 'gmp') - ``'gmp'`` - use the GMP C-library factorial function - ``'pari'`` - use PARI's factorial function OUTPUT: an... | def factorial(n, algorithm='gmp'): r""" Compute the factorial of `n`, which is the product `1\cdot 2\cdot 3 \cdots (n-1)\cdot n`. INPUT: - ``n`` - an integer - ``algorithm`` - string (default: 'gmp'): - ``'gmp'`` - use the GMP C-library factorial function - ``'pari'`` - use PARI's factorial function OUTPUT: a... | 462,164 |
def factorial(n, algorithm='gmp'): r""" Compute the factorial of `n`, which is the product `1\cdot 2\cdot 3 \cdots (n-1)\cdot n`. INPUT: - ``n`` - an integer - ``algorithm`` - string (default: 'gmp') - ``'gmp'`` - use the GMP C-library factorial function - ``'pari'`` - use PARI's factorial function OUTPUT: an... | def factorial(n, algorithm='gmp'): r""" Compute the factorial of `n`, which is the product `1\cdot 2\cdot 3 \cdots (n-1)\cdot n`. INPUT: - ``n`` - an integer - ``algorithm`` - string (default: 'gmp') - ``'gmp'`` - use the GMP C-library factorial function - ``'pari'`` - use PARI's factorial function OUTPUT: an... | 462,165 |
def crt(a,b,m=None,n=None): r""" Use the Chinese Remainder Theorem to find some `x` such that `x=a \bmod m` and `x=b \bmod n`. Note that `x` is only well-defined modulo `m\*n`. EXAMPLES:: sage: crt(2, 1, 3, 5) -4 sage: crt(13,20,100,301) -2087 You can also use upper case:: sage: c = CRT(2,3, 3, 5); c 8 sage: c % 3 ... | def crt(a,b,m=None,n=None): r""" Use the Chinese Remainder Theorem to find some `x` such that `x=a \bmod m` and `x=b \bmod n`. Note that `x` is only well-defined modulo `m*n`. EXAMPLES:: sage: crt(2, 1, 3, 5) -4 sage: crt(13,20,100,301) -2087 You can also use upper case:: sage: c = CRT(2,3, 3, 5); c 8 sage: c % 3 =... | 462,166 |
def NumberField(polynomial, name=None, check=True, names=None, cache=True, embedding=None, latex_name=None): r""" Return *the* number field defined by the given irreducible polynomial and with variable with the given name. If check is True (the default), also verify that the defining polynomial is irreducible and over ... | def NumberField(polynomial, name=None, check=True, names=None, cache=True, embedding=None, latex_name=None): r""" Return *the* number field defined by the given irreducible polynomial and with variable with the given name. If check is True (the default), also verify that the defining polynomial is irreducible and over ... | 462,167 |
def NumberField(polynomial, name=None, check=True, names=None, cache=True, embedding=None, latex_name=None): r""" Return *the* number field defined by the given irreducible polynomial and with variable with the given name. If check is True (the default), also verify that the defining polynomial is irreducible and over ... | def NumberField(polynomial, name=None, check=True, names=None, cache=True, embedding=None, latex_name=None): r""" Return *the* number field defined by the given irreducible polynomial and with variable with the given name. If check is True (the default), also verify that the defining polynomial is irreducible and over ... | 462,168 |
def __init__(self, polynomial, name=None, check=True, embedding=None, latex_name=None): """ Create a quadratic number field. EXAMPLES:: sage: k.<a> = QuadraticField(5, check=False); k Number Field in a with defining polynomial x^2 - 5 Don't do this:: sage: k.<a> = QuadraticField(4, check=False); k Number Field in a... | def __init__(self, polynomial, name=None, latex_name=None, check=True, embedding=None): """ Create a quadratic number field. EXAMPLES:: sage: k.<a> = QuadraticField(5, check=False); k Number Field in a with defining polynomial x^2 - 5 Don't do this:: sage: k.<a> = QuadraticField(4, check=False); k Number Field in a... | 462,169 |
def __init__(self, x, y, r1, r2, angle, options): """ Initializes base class Ellipse. | def __init__(self, x, y, r1, r2, angle, options): """ Initializes base class Ellipse. | 462,170 |
def get_minmax_data(self): """ Returns a dictionary with the bounding box data. | def get_minmax_data(self): """ Returns a dictionary with the bounding box data. | 462,171 |
def get_minmax_data(self): """ Returns a dictionary with the bounding box data. | def get_minmax_data(self): """ Returns a dictionary with the bounding box data. | 462,172 |
def get_minmax_data(self): """ Returns a dictionary with the bounding box data. | def get_minmax_data(self): """ Returns a dictionary with the bounding box data. | 462,173 |
def _allowed_options(self): """ Return the allowed options for the Ellipse class. | def _allowed_options(self): """ Return the allowed options for the Ellipse class. | 462,174 |
def _repr_(self): """ String representation of Ellipse primitive. | def _repr_(self): """ String representation of Ellipse primitive. | 462,175 |
def plot3d(self): r""" Plot 3d is not implemented. | def plot3d(self): r""" Plot 3d is not implemented. | 462,176 |
def check_tkz_graph(): r""" Checks if the proper `\mbox{\rm\LaTeX}` packages for the ``tikzpicture`` environment are installed in the user's environment. If the requisite packages are not found on the first call to this function, warnings are printed. Thereafter, the function caches its result in the variable ``_have_... | def check_tkz_graph(): r""" Checks if the proper `\mbox{\rm\LaTeX}` packages for the ``tikzpicture`` environment are installed in the user's environment. If the requisite packages are not found on the first call to this function, warnings are printed. Thereafter, the function caches its result in the variable ``_have_... | 462,177 |
def check_tkz_graph(): r""" Checks if the proper `\mbox{\rm\LaTeX}` packages for the ``tikzpicture`` environment are installed in the user's environment. If the requisite packages are not found on the first call to this function, warnings are printed. Thereafter, the function caches its result in the variable ``_have_... | def check_tkz_graph(): r""" Checks if the proper `\mbox{\rm\LaTeX}` packages for the ``tikzpicture`` environment are installed in the user's environment. If the requisite packages are not found on the first call to this function, warnings are printed. Thereafter, the function caches its result in the variable ``_have_... | 462,178 |
def have_tkz_graph(): r""" Returns ``True`` if the proper `\mbox{\rm\LaTeX}` packages for the ``tikzpicture`` environment are installed in the user's environment. The first time it is run, this function caches its result in the variable ``_have_tkz_graph``, and any subsequent time, it just checks the value of the vari... | def have_tkz_graph(): r""" Returns ``True`` if the proper `\mbox{\rm\LaTeX}` packages for the ``tikzpicture`` environment are installed in the user's environment. The first time it is run, this function caches its result in the variable ``_have_tkz_graph``, and any subsequent time, it just checks the value of the vari... | 462,179 |
def _S_class_group_and_units(self, S, proof=True): """ Compute S class group and units. INPUT: - ``S`` - a tuple of primes of the base field - ``proof`` - if False, assume Pari's GRH++ in computing the class group OUTPUT: - ``units, clgp_gens``, where: - ``units`` - A list of generators of the unit group. - ``cl... | def sage: K.<a> = NumberField(polygen(QQ)) sage: K._S_class_group_and_units( (K.ideal(5),) ) ([5, -1], []) _S_class_group_and_units(self, sage: K.<a> = NumberField(polygen(QQ)) sage: K._S_class_group_and_units( (K.ideal(5),) ) ([5, -1], []) S, sage: K.<a> = NumberField(polygen(QQ)) sage: K._S_class_group_and_units( (K.... | 462,180 |
def selmer_group(self, S, m, proof=True): """ Compute the Selmer group `K(S,m)`, which is defined to be the subgroup of `K^\times/(K^\times)^m` consisting of elements `a` such that `K(\sqrt[m]{a})/K` is unramified at all primes of `K` lying above a place outside of `S`. INPUT: - ``S`` - A set of primes of self. - ``... | def selmer_group(self, S, m, proof=True): r""" Compute the Selmer group `K(S,m)`, which is defined to be the subgroup of `K^\times/(K^\times)^m` consisting of elements `a` such that `K(\sqrt[m]{a})/K` is unramified at all primes of `K` lying above a place outside of `S`. INPUT: - ``S`` - A set of primes of self. - `... | 462,181 |
def __call__(self, im_gens, check=True): """ Return the homomorphism defined by images of generators. | def __call__(self, im_gens, check=True): """ Return the homomorphism defined by images of generators. | 462,182 |
def canonical_label(self, partition=None, certify=False, verbosity=0, edge_labels=False): """ Returns the unique graph on \{0,1,...,n-1\} ( n = self.order() ) which - is isomorphic to self, - is invariant in the isomorphism class. In other words, given two graphs ``G`` and ``H`` which are isomorphic, suppose ``G_c`` a... | def canonical_label(self, partition=None, certify=False, verbosity=0, edge_labels=False): """ Returns the unique graph on \{0,1,...,n-1\} ( n = self.order() ) which - is isomorphic to self, - is invariant in the isomorphism class. In other words, given two graphs ``G`` and ``H`` which are isomorphic, suppose ``G_c``... | 462,183 |
def canonical_label(self, partition=None, certify=False, verbosity=0, edge_labels=False): """ Returns the unique graph on \{0,1,...,n-1\} ( n = self.order() ) which - is isomorphic to self, - is invariant in the isomorphism class. In other words, given two graphs ``G`` and ``H`` which are isomorphic, suppose ``G_c`` a... | def canonical_label(self, partition=None, certify=False, verbosity=0, edge_labels=False): """ Returns the unique graph on \{0,1,...,n-1\} ( n = self.order() ) which - is isomorphic to self, - is invariant in the isomorphism class. In other words, given two graphs ``G`` and ``H`` which are isomorphic, suppose ``G_c`` a... | 462,184 |
def __call__(self, obj, output='html', view=True): r""" Return the documentation for ``obj``. | def __call__(self, obj, output='html', view=True): r""" Return the documentation for ``obj``. | 462,185 |
def __init__(self, name, args, kwds): """ TESTS:: sage: f = attrcall('core', 3) sage: loads(dumps(f)) *.core(3) """ self.name = name self.args = args self.kwds = kwds | def __init__(self, name, args, kwds): """ TESTS:: sage: f = attrcall('core', 3); f *.core(3) """ self.name = name self.args = args self.kwds = kwds | 462,186 |
def __repr__(self): """ Returns a string representation of this object. The star in the output represents the object passed into self. EXAMPLES:: sage: attrcall('core', 3) *.core(3) sage: attrcall('hooks', flatten=True) *.hooks(flatten=True) sage: attrcall('hooks', 3, flatten=True) *.hooks(3, flatten=True) """ s = "... | def __repr__(self): """ Returns a string representation of this object. The star in the output represents the object passed into self. EXAMPLES:: sage: attrcall('core', 3) *.core(3) sage: attrcall('hooks', flatten=True) *.hooks(flatten=True) sage: attrcall('hooks', 3, flatten=True) *.hooks(3, flatten=True) """ s = "... | 462,187 |
def __repr__(self): """ Returns a string representation of this object. The star in the output represents the object passed into self. EXAMPLES:: sage: attrcall('core', 3) *.core(3) sage: attrcall('hooks', flatten=True) *.hooks(flatten=True) sage: attrcall('hooks', 3, flatten=True) *.hooks(3, flatten=True) """ s = "... | def __repr__(self): """ Returns a string representation of this object. The star in the output represents the object passed into self. EXAMPLES:: sage: attrcall('core', 3) *.core(3) sage: attrcall('hooks', flatten=True) *.hooks(flatten=True) sage: attrcall('hooks', 3, flatten=True) *.hooks(3, flatten=True) """ s = "... | 462,188 |
def __repr__(self): """ Returns a string representation of this object. The star in the output represents the object passed into self. EXAMPLES:: sage: attrcall('core', 3) *.core(3) sage: attrcall('hooks', flatten=True) *.hooks(flatten=True) sage: attrcall('hooks', 3, flatten=True) *.hooks(3, flatten=True) """ s = "... | def __repr__(self): """ Returns a string representation of this object. The star in the output represents the object passed into self. def __eq__(self, other): """ Equality testing EXAMPLES:: sage: attrcall('core', 3, flatten = True) == attrcall('core', 3, flatten = True) True sage: attrcall('core', 2) == attrcall('c... | 462,189 |
def attrcall(name, *args, **kwds): """ Returns a callable which takes in an object, gets the method named name from that object, and calls it with the specified arguments and keywords. INPUT: - ``name`` - a string of the name of the method you want to call - ``args, kwds`` - arguments and keywords to be passed to... | def attrcall(name, *args, **kwds): """ Returns a callable which takes in an object, gets the method named name from that object, and calls it with the specified arguments and keywords. INPUT: - ``name`` - a string of the name of the method you want to call - ``args, kwds`` - arguments and keywords to be passed to... | 462,190 |
def attrcall(name, *args, **kwds): """ Returns a callable which takes in an object, gets the method named name from that object, and calls it with the specified arguments and keywords. INPUT: - ``name`` - a string of the name of the method you want to call - ``args, kwds`` - arguments and keywords to be passed to... | def attrcall(name, *args, **kwds): """ Returns a callable which takes in an object, gets the method named name from that object, and calls it with the specified arguments and keywords. INPUT: - ``name`` - a string of the name of the method you want to call - ``args, kwds`` - arguments and keywords to be passed to ... | 462,191 |
def attrcall(name, *args, **kwds): """ Returns a callable which takes in an object, gets the method named name from that object, and calls it with the specified arguments and keywords. INPUT: - ``name`` - a string of the name of the method you want to call - ``args, kwds`` - arguments and keywords to be passed to... | def attrcall(name, *args, **kwds): """ Returns a callable which takes in an object, gets the method named name from that object, and calls it with the specified arguments and keywords. INPUT: - ``name`` - a string of the name of the method you want to call - ``args, kwds`` - arguments and keywords to be passed to... | 462,192 |
def old_cremona_letter_code(n): r""" Returns the *old* Cremona letter code corresponding to an integer. integer. For example, :: 1 --> A 26 --> Z 27 --> AA 52 --> ZZ 53 --> AAA etc. INPUT: - ``n`` - int OUTPUT: str EXAMPLES:: sage: old_cremona_letter_code(1) 'A' sage: old_cremona_letter_code(26) 'Z' sage: ol... | def old_cremona_letter_code(n): r""" Returns the *old* Cremona letter code corresponding to an integer. integer. For example:: 1 --> A 26 --> Z 27 --> AA 52 --> ZZ 53 --> AAA etc. INPUT: - ``n`` - int OUTPUT: str EXAMPLES:: sage: old_cremona_letter_code(1) 'A' sage: old_cremona_letter_code(26) 'Z' sage: old_... | 462,193 |
def __iter__(self): """ Returns an iterator through all EllipticCurve objects in the Cremona database. | def __iter__(self): """ Returns an iterator through all EllipticCurve objects in the Cremona database. | 462,194 |
def iter(self, conductors): """ Returns an iterator through all curves with conductor between Nmin and Nmax-1, inclusive, in the database. INPUT: - ``conductors`` - list or generator of ints OUTPUT: generator that iterates over EllipticCurve objects. | def iter(self, conductors): """ Return an iterator through all curves in the database with given conductors. INPUT: - ``conductors`` - list or generator of ints OUTPUT: generator that iterates over EllipticCurve objects. | 462,195 |
def iter_optimal(self, conductors): """ Returns an iterator through all optimal curves with conductor between Nmin and Nmax-1 in the database. INPUT: | def iter_optimal(self, conductors): """ Return an iterator through all optimal curves in the database with given conductors. INPUT: | 462,196 |
def list(self, conductors): """ Returns a list of all curves with conductor between Nmin and Nmax-1, inclusive, in the database. INPUT: - ``conductors`` - list or generator of ints OUTPUT: - list of EllipticCurve objects. | def list(self, conductors): """ Returns a list of all curves with given conductors. INPUT: - ``conductors`` - list or generator of ints OUTPUT: - list of EllipticCurve objects. | 462,197 |
def list_optimal(self, conductors): """ Returns a list of all optimal curves with conductor between Nmin and Nmax-1, inclusive, in the database. INPUT: - ``conductors`` - list or generator of ints list of EllipticCurve objects. OUTPUT: list of EllipticCurve objects. | def list_optimal(self, conductors): """ Returns a list of all optimal curves with given conductors. INPUT: - ``conductors`` - list or generator of ints list of EllipticCurve objects. OUTPUT: list of EllipticCurve objects. | 462,198 |
def smallest_conductor(self): """ The smallest conductor for which the database is complete. (Always 1.) OUTPUT: - ``int`` - smallest conductor EXAMPLES:: sage: CremonaDatabase().smallest_conductor() 1 """ return 1 | def smallest_conductor(self): """ The smallest conductor for which the database is complete: always 1. OUTPUT: - ``int`` - smallest conductor EXAMPLES:: sage: CremonaDatabase().smallest_conductor() 1 """ return 1 | 462,199 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.