rem stringlengths 0 322k | add stringlengths 0 2.05M | context stringlengths 8 228k |
|---|---|---|
self.stop = False while not self.stop: | self.stop_request = False self.stopped = False while not self.stop_request: | def serve_forever_stoppable(self): """Handle one request at a time until stop_serve_forever(). http://code.activestate.com/recipes/336012/ """ self.stop = False while not self.stop: self.handle_request() print "serve_forever_stoppable received stop request" |
print "serve_forever_stoppable received stop request" | self.stopped = True | def serve_forever_stoppable(self): """Handle one request at a time until stop_serve_forever(). http://code.activestate.com/recipes/336012/ """ self.stop = False while not self.stop: self.handle_request() print "serve_forever_stoppable received stop request" |
if contentlength < 0: | if ( (contentlength < 0) and (environ.get("HTTP_TRANSFER_ENCODING", "").lower() != "chunked") ): | def doPUT(self, environ, start_response): """ @see: http://www.webdav.org/specs/rfc4918.html#METHOD_PUT """ path = environ["PATH_INFO"] provider = self._davProvider res = provider.getResourceInst(path, environ) parentRes = provider.getResourceInst(util.getUriParent(path), environ) isnewfile = res is None |
l = int(environ["wsgi.input"].readline(), 16) | buf = environ["wsgi.input"].readline() if buf == '': l = 0 else: l = int(buf, 16) | def doPUT(self, environ, start_response): """ @see: http://www.webdav.org/specs/rfc4918.html#METHOD_PUT """ path = environ["PATH_INFO"] provider = self._davProvider res = provider.getResourceInst(path, environ) parentRes = provider.getResourceInst(util.getUriParent(path), environ) isnewfile = res is None |
res.endWrite(hasErrors=True) | res.endWrite(withErrors=True) | def doPUT(self, environ, start_response): """ @see: http://www.webdav.org/specs/rfc4918.html#METHOD_PUT """ path = environ["PATH_INFO"] provider = self._davProvider res = provider.getResourceInst(path, environ) parentRes = provider.getResourceInst(util.getUriParent(path), environ) isnewfile = res is None |
body = StringIO.StringIO() tree.write(body) body = body.getvalue() print body | def proppatch(self, path, set_props=None, remove_props=None, namespace='DAV:', headers=None): """Patch properties on a DAV resource. If namespace is not specified the DAV namespace is used for all properties""" root = ElementTree.Element('{DAV:}propertyupdate') if set_props is not None: prop_set = ElementTree.SubEleme... | |
def set_lock(self, path, owner, locktype='exclusive', lockscope='write', depth=None, headers=None): | def set_lock(self, path, owner, locktype='write', lockscope='exclusive', depth=None, headers=None): | def set_lock(self, path, owner, locktype='exclusive', lockscope='write', depth=None, headers=None): """Set a lock on a dav resource""" root = ElementTree.Element('{DAV:}lockinfo') object_to_etree(root, {'locktype':locktype, 'lockscope':lockscope, 'owner':{'href':owner}}, namespace='DAV:') tree = ElementTree.ElementTree... |
locks = self.response.etree.finall('.//{DAV:}locktoken') | locks = self.response.tree.findall('.//{DAV:}locktoken') | def set_lock(self, path, owner, locktype='exclusive', lockscope='write', depth=None, headers=None): """Set a lock on a dav resource""" root = ElementTree.Element('{DAV:}lockinfo') object_to_etree(root, {'locktype':locktype, 'lockscope':lockscope, 'owner':{'href':owner}}, namespace='DAV:') tree = ElementTree.ElementTree... |
headers['Lock-Tocken'] = '<%s>' % token | headers['Lock-Token'] = '<%s>' % token | def unlock(self, path, token, headers=None): """Unlock DAV resource with token""" if headers is None: headers = {} headers['Lock-Tocken'] = '<%s>' % token self._request('UNLOCK', path, body=None, headers=headers) |
self._fail(HTTP_BAD_REQUEST, "PUT request with invalid Content-Length: (%s)" % environ.get("CONTENT_LENGTH")) | if "Microsoft-WebDAV-MiniRedir" in environ.get("HTTP_USER_AGENT", ""): _logger.warning("Setting misssing Content-Length to 0 for MS client") contentlength = 0 else: self._fail(HTTP_LENGTH_REQUIRED, "PUT request with invalid Content-Length: (%s)" % environ.get("CONTENT_LENGTH")) | def doPUT(self, environ, start_response): """ @see: http://www.webdav.org/specs/rfc4918.html#METHOD_PUT """ path = environ["PATH_INFO"] provider = self._davProvider res = provider.getResourceInst(path, environ) parentRes = provider.getResourceInst(util.getUriParent(path), environ) isnewfile = res is None |
self._checkWritePermission(res, environ["HTTP_DEPTH"], environ) | parentRes = provider.getResourceInst(util.getUriParent(path), environ) if parentRes: self._checkWritePermission(parentRes, environ["HTTP_DEPTH"], environ) else: self._checkWritePermission(res, environ["HTTP_DEPTH"], environ) | def doDELETE(self, environ, start_response): """ @see: http://www.webdav.org/specs/rfc4918.html#METHOD_DELETE """ path = environ["PATH_INFO"] provider = self._davProvider res = provider.getResourceInst(path, environ) |
"propsmanager": None, | "propsmanager": True, | def run(self): withAuthentication = True self.rootpath = os.path.join(gettempdir(), "wsgidav-test") if not os.path.exists(self.rootpath): os.mkdir(self.rootpath) provider = FilesystemProvider(self.rootpath) config = DEFAULT_CONFIG.copy() config.update({ "provider_mapping": {"/": provider}, "user_mapping": {}, "host": ... |
"verbose": 2, | "verbose": 3, | def run(self): withAuthentication = True self.rootpath = os.path.join(gettempdir(), "wsgidav-test") if not os.path.exists(self.rootpath): os.mkdir(self.rootpath) provider = FilesystemProvider(self.rootpath) config = DEFAULT_CONFIG.copy() config.update({ "provider_mapping": {"/": provider}, "user_mapping": {}, "host": ... |
self.ext_server.serve_forever() | self.ext_server.serve_forever_stoppable() | def run(self): withAuthentication = True self.rootpath = os.path.join(gettempdir(), "wsgidav-test") if not os.path.exists(self.rootpath): os.mkdir(self.rootpath) provider = FilesystemProvider(self.rootpath) config = DEFAULT_CONFIG.copy() config.update({ "provider_mapping": {"/": provider}, "user_mapping": {}, "host": ... |
self.ext_server.shutdown() | self.ext_server.stop_serve_forever() | def shutdown(self): if self.ext_server: print "shutting down" self.ext_server.shutdown() print "shut down" self.ext_server = None |
assert hasattr(lockManager, "checkWritePermission"), "Must be compatible with wsgidav.lock_manager.LockManager" | assert not lockManager or hasattr(lockManager, "checkWritePermission"), "Must be compatible with wsgidav.lock_manager.LockManager" | def setLockManager(self, lockManager): assert hasattr(lockManager, "checkWritePermission"), "Must be compatible with wsgidav.lock_manager.LockManager" |
assert hasattr(propManager, "copyProperties"), "Must be compatible with wsgidav.property_manager.PropertyManager" | assert not propManager or hasattr(propManager, "copyProperties"), "Must be compatible with wsgidav.property_manager.PropertyManager" | def setPropManager(self, propManager): assert hasattr(propManager, "copyProperties"), "Must be compatible with wsgidav.property_manager.PropertyManager" |
client.move("/test/put2.txt", "/test/put2_moved.txt", | client.move("/test/file2.txt", "/test/file2_moved.txt", | def testGetPut(self): """Read and write file contents.""" client = self.client |
my_events = PlayaEvent.objects.filter(year=year, creator=user)[0] my_events = True if my_events else False | my_events = PlayaEvent.objects.filter(year=year, creator=user) my_events = True if len(my_events)>0 else False | def playa_events_home(request, year_year, template='brc/playa_events_home.html', queryset=None |
my_events = True if len(my_events) else False | my_events = True if my_events else False | def playa_events_home(request, year_year, template='brc/playa_events_home.html', queryset=None |
extra_context = dict(next=next), | extra_context = dict(next=next, year=event.year), | def delete_event(request, year_year, playa_event_id, next=None, |
extra_context = dict(next=next, msg="This is the only occurrence of this event. By deleting it, you will delete the entire event. Are you sure you want to do this??"), | extra_context = dict(next=next, year=event.year, msg="This is the only occurrence of this event. By deleting it, you will delete the entire event. Are you sure you want to do this??"), | def delete_occurrence(request, year_year, occurrence_id, next=None, |
my_events = PlayaEvent.objects.filter(year=year, creator=user)[0] my_events = True if len(my_events) else False | if user: my_events = PlayaEvent.objects.filter(year=year, creator=user)[0] my_events = True if len(my_events) else False else: my_events = False | def playa_events_home(request, year_year, template='brc/playa_events_home.html', queryset=None |
if user: | if user and type(user) != AnonymousUser: | def playa_events_home(request, year_year, template='brc/playa_events_home.html', queryset=None |
data = {'year':year} | data = {'year':year, 'user':request.user} | def playa_events_home(request, year_year, template='brc/playa_events_home.html', queryset=None |
print "HERE", args, kwargs | def __init__(self, *args, **kwargs): print "HERE", args, kwargs super(PlayaEventForm, self).__init__(*args, **kwargs) | |
self.profile_SaveButton.on_click += self.save_profile | self.profile_SaveButton.on_click += lambda _: self.save_profile() | def __init__ (self, parent = None): ui.VBox.__init__(self, parent) |
self.profile_DeleteButton.on_click += self.delete_profile | self.profile_DeleteButton.on_click += lambda _: self.delete_profile() | def __init__ (self, parent = None): ui.VBox.__init__(self, parent) |
self.player_name1.on_click += lambda _: self.keyboard.set_visible(True) | self.player_name1.on_click += lambda _: self.enable_keyboard(0) | def __init__ (self, parent = None): ui.VBox.__init__(self, parent) |
self.player_name2.on_click += lambda _: self.keyboard.set_visible(True) | self.player_name2.on_click += lambda _: self.enable_keyboard(1) | def __init__ (self, parent = None): ui.VBox.__init__(self, parent) |
self.player_name3.on_click += lambda _: self.keyboard.set_visible(True) | self.player_name3.on_click += lambda _: self.enable_keyboard(2) | def __init__ (self, parent = None): ui.VBox.__init__(self, parent) |
self.player_name4.on_click += lambda _: self.keyboard.set_visible(True) | self.player_name4.on_click += lambda _: self.enable_keyboard(3) | def __init__ (self, parent = None): ui.VBox.__init__(self, parent) |
self.player_name5.on_click += lambda _: self.keyboard.set_visible(True) | self.player_name5.on_click += lambda _: self.enable_keyboard(4) | def __init__ (self, parent = None): ui.VBox.__init__(self, parent) |
self.player_name6.on_click += lambda _: self.keyboard.set_visible(True) | self.player_name6.on_click += lambda _: self.enable_keyboard(5) | def __init__ (self, parent = None): ui.VBox.__init__(self, parent) |
def save_profile(self, random): if self.check_info(): | def save_profile(self, name = 'Prove'): if self.check_info() and name <> 'Default': | def load_profile(self, name): index = 0 |
GlobalConf ().path ('profiles').adopt (self._profile, 'Prove') self._listprof.append('Prove') | GlobalConf ().path ('profiles').adopt (self._profile, name) self._listprof.append(name) | def save_profile(self, random): #Need to be modified in order to accept the name of the profile, also check first if the profile already exists if self.check_info(): self.create_profile() GlobalConf ().path ('profiles').adopt (self._profile, 'Prove') self._listprof.append('Prove') self.profile_ComboBox.load(self._li... |
def delete_profile(self, random): GlobalConf ().path('profiles').remove('Prove') self._listprof.remove('Prove') self.profile_ComboBox.load(self._listprof) self.update_status("Profile deleted") | def delete_profile(self, name = 'Prove'): if name <> 'Default': GlobalConf ().path('profiles').remove(name) self._listprof.remove(name) self.profile_ComboBox.load(self._listprof) self.update_status("Profile deleted") | def delete_profile(self, random): #Need to be modified in order to accept the name of the profile, also check first if the profile already exists and what happened when there is no profiles or create a default one which cannot be deleted |
self.update_status("It should open a new window in order to load the game") | self.update_status("Not implemented yet") | def load_game(self, random): |
self.SetCenter (cx - (dx*c - dy*s)/sx, cy - (dx*s + dy*c)/sy) | self.set_center (cx - (dx*c - dy*s)/sx, cy - (dx*s + dy*c)/sy) | def do_pan (self, (nx, ny)): _log.debug ('Do panning: ' + str ((nx, ny))) |
self._region = model | self.model = model | def __init__ (self, parent = None, model = None, *a, **k): assert parent assert model super (RegionComponent, self).__init__ (parent = parent, radius = _REGION_RADIUS, *a, **k) |
else self._region.owner.color)) | else self.model.owner.color)) | def on_set_region_owner (self): self._fill_color = sf.Color (*( _REGION_FREE_COLOR if self._region.owner is None else self._region.owner.color)) |
self.load_profile('Default') | def __init__ (self, parent = None): ui.Image.__init__(self, parent, 'data/image/texture01.jpg') | |
else: self.mapL.select(i.get_value()) | def load_profile(self, name): | |
self._region.definition.name) | self.model.definition.name) | def __init__ (self, parent = None, model = None, *a, **k): assert parent assert model super (RegionComponent, self).__init__ (parent = parent, radius = _REGION_RADIUS, *a, **k) |
_REGION_FREE_COLOR if self._region.owner is None | _REGION_FREE_COLOR if self.model.owner is None | def on_set_region_owner (self): self._fill_color = sf.Color (*( _REGION_FREE_COLOR if self._region.owner is None else self.model.owner.color)) |
suite = unittest.TestLoader().loadTestsFromTestCase(TestObjectives) unittest.TextTestRunner(verbosity=2).run(suite) | def test_check_objective_player (self): print "\nTesting check mission player" world = self.world obj = self.obj pla_obj = filter (lambda o: o.type == 'player',obj) random.shuffle(pla_obj) | |
time.gmtime ( | time.localtime ( | def __init__ (self, parent = None, save_folder = '', *a, **k): super (LoadGameDialog, self).__init__ (parent, *a, **k) |
c = sphere(radius=50, color=(1., 0.,0.), pos=(x-AREA_X/2,y-AREA_Y/2,50)) | if BALL_CYLINDER == 1: c = cylinder(axis=(0,0,1), radius=50, length=CORN_HEIGHT, color=(1., 0.,0.), pos=(x-AREA_X/2,y-AREA_Y/2,CORN_HEIGHT/2)) else: c = sphere(radius=50, color=(1., 0.,0.), pos=(x-AREA_X/2,y-AREA_Y/2,50)) | def toggle_obj_disp(): global area_objects """ if area_objects == []: c = sphere(radius=5, color=(0., 0.,1.), pos=(1238.-AREA_X/2, 1313.-AREA_Y/2, 5)) area_objects.append(c) c = sphere(radius=5, color=(0., 0.,1.), pos=(1364.-AREA_X/2, 1097.-AREA_Y/2, 5)) area_objects.append(c) c = sphere(radius=5, color=(0., 0.,1.), p... |
print "cobboard: %x,%x"%(int(m.groups()[0]),int(m.groups()[1])) | def silent_mkfifo(f): try: os.mkfifo(f) except: pass | |
widget=MasterSelectWidget( | widget=SelectionWidget( | def getVocabMun(self,province): municipality = EntiVocabulary.comuni4provincia(province) return DisplayList(monetVocabMap(municipality)) |
def quotient(self, sub, check=True): | def quotient(self, sub, check=True, positive_point=None, positive_dual_point=None): | def quotient(self, sub, check=True): """ Return the quotient of ``self`` by the given sublattice ``sub``. |
Torsion quotient of 3-d lattice N by Sublattice <N(1, 8, 0), N(0, 12, 0)> | Quotient with torsion of 3-d lattice N by Sublattice <N(1, 8, 0), N(0, 12, 0)> See :class:`ToricLattice_quotient` for more examples. | def quotient(self, sub, check=True): """ Return the quotient of ``self`` by the given sublattice ``sub``. |
return ToricLattice_quotient(self, sub, check=False) | return ToricLattice_quotient(self, sub, check=False, positive_point=positive_point, positive_dual_point=positive_dual_point) | def quotient(self, sub, check=True): """ Return the quotient of ``self`` by the given sublattice ``sub``. |
1-d lattice, quotient of 3-d lattice N by Sublattice <N(1, 0, 1), N(0, 1, -1)> | 1-d lattice, quotient of 3-d lattice N by Sublattice <N(1, 0, 1), N(0, 1, -1)> sage: Q.gens() (N[0, 0, 1],) Here, ``sublattice`` happens to be of codimension one in ``N``. If you want to prescribe the sign of the quotient generator, you can do either:: sage: Q = N.quotient(sublattice, positive_point=N(0,0,-1)); Q 1-d... | def _latex_(self): r""" Return a LaTeX representation of ``self``. |
- integer. | Integer. The dimension of the free part of the quotient. | def rank(self): r""" Return the rank of ``self``. |
m = re.match(r'GNU Fortran\s+95.*?([0-9-.]+)', version_string) if m: return ('gfortran', m.group(1)) m = re.match(r'GNU Fortran.*?([0-9-.]+)', version_string) if m: v = m.group(1) if v.startswith('0') or v.startswith('2') or v.startswith('3'): return ('g77', v) | ctype = self.compiler_type f90 = set_exe('compiler_f90') if not f90: f77 = set_exe('compiler_f77') if f77: log.warn('%s: no Fortran 90 compiler found' % ctype) | def gnu_version_match(self, version_string): """Handle the different versions of GNU fortran compilers""" m = re.match(r'GNU Fortran', version_string) if not m: return None m = re.match(r'GNU Fortran\s+95.*?([0-9-.]+)', version_string) if m: return ('gfortran', m.group(1)) m = re.match(r'GNU Fortran.*?([0-9-.]+)', vers... |
return ('gfortran', v) def version_match(self, version_string): v = self.gnu_version_match(version_string) if not v or v[0] != 'g77': | raise CompilerNotFound('%s: f90 nor f77' % ctype) else: f77 = set_exe('compiler_f77', f90=f90) if not f77: log.warn('%s: no Fortran 77 compiler found' % ctype) set_exe('compiler_fix', f90=f90) set_exe('linker_so', f77=f77, f90=f90) set_exe('linker_exe', f77=f77, f90=f90) set_exe('version_cmd', f77=f77, f90=f90) set_ex... | def gnu_version_match(self, version_string): """Handle the different versions of GNU fortran compilers""" m = re.match(r'GNU Fortran', version_string) if not m: return None m = re.match(r'GNU Fortran\s+95.*?([0-9-.]+)', version_string) if m: return ('gfortran', m.group(1)) m = re.match(r'GNU Fortran.*?([0-9-.]+)', vers... |
return v[1] possible_executables = ['g77', 'f77'] executables = { 'version_cmd' : [None, "--version"], 'compiler_f77' : [None, "-g", "-Wall", "-fno-second-underscore"], 'compiler_f90' : None, 'compiler_fix' : None, 'linker_so' : [None, "-g", "-Wall"], 'archiver' : ["ar", "-cr"], 'ranlib' : ["ranl... | if is_string(hook_name): if hook_name.startswith('self.'): hook_name = hook_name[5:] hook = getattr(self, hook_name) return hook() elif hook_name.startswith('exe.'): hook_name = hook_name[4:] var = self.executables[hook_name] if var: return var[0] else: return None elif hook_name.startswith('flags.'): hook_name = hook_... | def version_match(self, version_string): v = self.gnu_version_match(version_string) if not v or v[0] != 'g77': return None return v[1] |
opt.append("-shared") if sys.platform.startswith('sunos'): opt.append('-mimpure-text') return opt def get_libgcc_dir(self): status, output = exec_command(self.compiler_f77 + ['-print-libgcc-file-name'], use_tee=0) if not status: return os.path.dirname(output) | return hook_name() _default_compilers = ( ('win32', ('gnu','intelv','absoft','compaqv','intelev','gnu95','g95')), ('cygwin.*', ('sage_fortran', 'gnu','intelv','absoft','compaqv','intelev','gnu95','g95')), ('linux.*', ('sage_fortran','gnu','intel','lahey','pg','absoft','nag','vast','compaq', 'intele','intelem','gnu9... | def get_flags_linker_so(self): opt = self.linker_so[1:] if sys.platform=='darwin': target = os.environ.get('MACOSX_DEPLOYMENT_TARGET', None) # If MACOSX_DEPLOYMENT_TARGET is set, we simply trust the value # and leave it alone. But, distutils will complain if the # environment's value is different from the one in the P... |
def get_library_dirs(self): opt = [] if sys.platform[:5] != 'linux': d = self.get_libgcc_dir() if d: if sys.platform == 'win32' and not d.startswith('/usr/lib'): d = os.path.normpath(d) if not os.path.exists(os.path.join(d, "lib%s.a" % self.g2c)): d2 = os.path.abspath(os.path.join(d, '../../../../lib')) if os.path.exi... | compiler = klass(verbose=verbose, dry_run=dry_run, force=force) compiler.c_compiler = c_compiler return compiler def show_fcompilers(dist=None): """Print list of available compilers (used by the "--help-fcompiler" option to "config_fc"). """ if dist is None: from distutils.dist import Distribution from numpy.distutils... | def get_library_dirs(self): opt = [] if sys.platform[:5] != 'linux': d = self.get_libgcc_dir() if d: # if windows and not cygwin, libg2c lies in a different folder if sys.platform == 'win32' and not d.startswith('/usr/lib'): d = os.path.normpath(d) if not os.path.exists(os.path.join(d, "lib%s.a" % self.g2c)): d2 = os.p... |
g2c = self.g2c if g2c is not None: opt.append(g2c) c_compiler = self.c_compiler if sys.platform == 'win32' and c_compiler and \ c_compiler.compiler_type=='msvc': opt.append('gcc') runtime_lib = msvc_runtime_library() if runtime_lib: opt.append(runtime_lib) if sys.platform == 'darwin': opt.append('cc_dynamic') return... | c.dump_properties() compilers.append(("fcompiler="+compiler, None, fcompiler_class[compiler][2] + ' (%s)' % v)) compilers_ni = list(set(fcompiler_class.keys()) - set(platform_compilers)) compilers_ni = [("fcompiler="+fc, None, fcompiler_class[fc][2]) for fc in compilers_ni] compilers.sort() compilers_na.sort() compil... | def get_libraries(self): opt = [] d = self.get_libgcc_dir() if d is not None: g2c = self.g2c + '-pic' f = self.static_lib_format % (g2c, self.static_lib_extension) if not os.path.isfile(os.path.join(d,f)): g2c = self.g2c else: g2c = self.g2c |
from distutils import log log.set_verbosity(2) compiler = GnuFCompiler() compiler.customize() print compiler.get_version() raw_input('Press ENTER to continue...') try: compiler = Gnu95FCompiler() compiler.customize() print compiler.get_version() except Exception, msg: print msg raw_input('Press ENTER to continue...') | show_fcompilers() | def get_flags_debug(self): return ['-g'] |
def pdflatex(self, t = None): """ | def pdflatex(self, t = None): """ This is deprecated. Use engine("pdflatex") instead. | def pdflatex(self, t = None): """ Controls whether Sage uses PDFLaTeX or LaTeX when typesetting with :func:`view`, in ``%latex`` cells, etc. |
return _Latex_prefs._option["pdflatex"] _Latex_prefs._option["pdflatex"] = bool(t) | from sage.misc.misc import deprecation deprecation('Use engine() instead.') return _Latex_prefs._option["engine"] == "pdflatex" elif t: from sage.misc.misc import deprecation deprecation('Use engine("pdflatex") instead.') self.engine("pdflatex") else: from sage.misc.misc import deprecation deprecation('Use engine("late... | def pdflatex(self, t = None): """ Controls whether Sage uses PDFLaTeX or LaTeX when typesetting with :func:`view`, in ``%latex`` cells, etc. |
the computation again but turn off the second descent:: | the computation again but turn off ``second_descent``:: | def selmer_rank(self): r""" Returns the rank of the 2-Selmer group of the curve. |
but with no 2-torsion, the selmer rank is strictly greater | but with no 2-torsion, the Selmer rank is strictly greater | def selmer_rank(self): r""" Returns the rank of the 2-Selmer group of the curve. |
all primes up to `max_prime`. If `-1` (default) then an | all primes up to ``max_prime``. If `-1` (the default), an | def saturate(self, max_prime=-1, odd_primes_only=False): r""" Saturate this subgroup of the Mordell-Weil group. |
computed bound is greater than a value set by the eclib | computed bound is greater than a value set by the ``eclib`` | def saturate(self, max_prime=-1, odd_primes_only=False): r""" Saturate this subgroup of the Mordell-Weil group. |
- ``odd_primes_only`` (bool, default False) -- only do | - ``odd_primes_only`` (bool, default ``False``) -- only do | def saturate(self, max_prime=-1, odd_primes_only=False): r""" Saturate this subgroup of the Mordell-Weil group. |
via 2-descent they should alreday be 2-saturated.) | via :meth:``two_descent()`` they should already be 2-saturated.) | def saturate(self, max_prime=-1, odd_primes_only=False): r""" Saturate this subgroup of the Mordell-Weil group. |
- ``ok`` (bool) is True if and only if the saturation was | - ``ok`` (bool) -- ``True`` if and only if the saturation was | def saturate(self, max_prime=-1, odd_primes_only=False): r""" Saturate this subgroup of the Mordell-Weil group. |
the computed saturation bound being too high, then True indicates that the subgroup is saturated at `\emph{all}` | the computed saturation bound being too high, then ``True`` indicates that the subgroup is saturated at *all* | def saturate(self, max_prime=-1, odd_primes_only=False): r""" Saturate this subgroup of the Mordell-Weil group. |
- ``index`` (int) is the index of the group generated by the | - ``index`` (int) -- the index of the group generated by the | def saturate(self, max_prime=-1, odd_primes_only=False): r""" Saturate this subgroup of the Mordell-Weil group. |
uses floating points methods based on elliptic logarithms to | uses floating point methods based on elliptic logarithms to | def saturate(self, max_prime=-1, odd_primes_only=False): r""" Saturate this subgroup of the Mordell-Weil group. |
We emphasize that if this function returns True as the first return argument, and if the default was used for the parameter ``sat_bnd``, then the points in the basis after calling this function are saturated at `\emph{all}` primes, | We emphasize that if this function returns ``True`` as the first return argument (``ok``), and if the default was used for the parameter ``max_prime``, then the points in the basis after calling this function are saturated at *all* primes, | def saturate(self, max_prime=-1, odd_primes_only=False): r""" Saturate this subgroup of the Mordell-Weil group. |
saturate up to, and that prime is `\leq` ``max_prime``. | saturate up to, and that prime might be smaller than ``max_prime``. | def saturate(self, max_prime=-1, odd_primes_only=False): r""" Saturate this subgroup of the Mordell-Weil group. |
calling search. So calling search up to height 20 then calling saturate results in another search up to height 18. | calling :meth:`search()`. So calling :meth:`search()` up to height 20 then calling :meth:`saturate()` results in another search up to height 18. | def saturate(self, max_prime=-1, odd_primes_only=False): r""" Saturate this subgroup of the Mordell-Weil group. |
Subgroup of Mordell Weil group: [[1547:-2967:343], [2707496766203306:864581029138191:2969715140223272], [-13422227300:-49322830557:12167000000]] | Subgroup of Mordell-Weil group: [[1547:-2967:343], [2707496766203306:864581029138191:2969715140223272], [-13422227300:-49322830557:12167000000]] | def saturate(self, max_prime=-1, odd_primes_only=False): r""" Saturate this subgroup of the Mordell-Weil group. |
Subgroup of Mordell Weil group: [[-2:3:1], [2707496766203306:864581029138191:2969715140223272], [-13422227300:-49322830557:12167000000]] | Subgroup of Mordell-Weil group: [[-2:3:1], [2707496766203306:864581029138191:2969715140223272], [-13422227300:-49322830557:12167000000]] | def saturate(self, max_prime=-1, odd_primes_only=False): r""" Saturate this subgroup of the Mordell-Weil group. |
Subgroup of Mordell Weil group: [[-2:3:1], [-14:25:8], [-13422227300:-49322830557:12167000000]] | Subgroup of Mordell-Weil group: [[-2:3:1], [-14:25:8], [-13422227300:-49322830557:12167000000]] | def saturate(self, max_prime=-1, odd_primes_only=False): r""" Saturate this subgroup of the Mordell-Weil group. |
Subgroup of Mordell Weil group: [[-2:3:1], [-14:25:8], [1:-1:1]] | Subgroup of Mordell-Weil group: [[-2:3:1], [-14:25:8], [1:-1:1]] | def saturate(self, max_prime=-1, odd_primes_only=False): r""" Saturate this subgroup of the Mordell-Weil group. |
Of course, the ``process`` function would have done all this | Of course, the :meth:`process()` function would have done all this | def saturate(self, max_prime=-1, odd_primes_only=False): r""" Saturate this subgroup of the Mordell-Weil group. |
But we would still need to use the ``saturate`` function to | But we would still need to use the :meth:`saturate()` function to | def saturate(self, max_prime=-1, odd_primes_only=False): r""" Saturate this subgroup of the Mordell-Weil group. |
side-effect. It proves that the inde of the points in their | side-effect. It proves that the index of the points in their | def saturate(self, max_prime=-1, odd_primes_only=False): r""" Saturate this subgroup of the Mordell-Weil group. |
by reducing the poits modulo all primes of good reduction up | by reducing the points modulo all primes of good reduction up | def saturate(self, max_prime=-1, odd_primes_only=False): r""" Saturate this subgroup of the Mordell-Weil group. |
sage: latex(maxima(derivative(ceil(x*y*d), d,x,x,y))) d^3\,\left({{{\it \partial}^4}\over{{\it \partial}\,d^4}}\, {\it ceil}\left(d , x , y\right)\right)\,x^2\,y^3+5\,d^2\,\left({{ {\it \partial}^3}\over{{\it \partial}\,d^3}}\,{\it ceil}\left(d , x , y\right)\right)\,x\,y^2+4\,d\,\left({{{\it \partial}^2}\over{ {\... | sage: f = function('f') sage: latex(maxima(derivative(f(x*y*d), d,x,x,y))) Traceback (most recent call last): ... NotImplementedError: arguments must be distinct variables sage: latex(maxima(derivative(f(x,y,d), d,x,x,y))) {{{\it \partial}^4}\over{{\it \partial}\,d\,{\it \partial}\,x^2\, {\it \partial}\,y}}\,f\left(x ... | def _latex_(self): """ Return Latex representation of this Maxima object. |
Return the rational points on this curve computed via enumeration. | Return a generator object for the rational points on this curve. | def rational_points(self, algorithm="enum", sort=True): r""" Return the rational points on this curve computed via enumeration. |
- ``algorithm`` (string, default: 'enum') -- the algorithm to use. Currently this is ignored. - ``sort`` (boolean, default ``True``) -- whether the output points should be sorted. If False, the order of the output is non-deterministic. | - ``self`` -- a projective curve | def rational_points(self, algorithm="enum", sort=True): r""" Return the rational points on this curve computed via enumeration. |
A list of all the rational points on the curve defined over its base field, possibly sorted. .. note:: This is a slow Python-level implementation. EXAMPLES:: sage: F = GF(5) | A generator of all the rational points on the curve defined over its base field. EXAMPLE:: sage: F = GF(37) | def rational_points(self, algorithm="enum", sort=True): r""" Return the rational points on this curve computed via enumeration. |
sage: C = Curve(X^3+Y^3-Z^3) sage: C.rational_points() [(0 : 1 : 1), (1 : 0 : 1), (2 : 2 : 1), (3 : 4 : 1), (4 : 1 : 0), (4 : 3 : 1)] sage: C.rational_points(sort=False) [(4 : 1 : 0), (1 : 0 : 1), (0 : 1 : 1), (2 : 2 : 1), (4 : 3 : 1), (3 : 4 : 1)] | sage: C = Curve(X^7+Y*X*Z^5*55+Y^7*12) sage: len(list(C.rational_points_iterator())) 37 | def rational_points(self, algorithm="enum", sort=True): r""" Return the rational points on this curve computed via enumeration. |
sage: F = GF(1009) | sage: F = GF(2) | def rational_points(self, algorithm="enum", sort=True): r""" Return the rational points on this curve computed via enumeration. |
sage: C = Curve(X^5+12*X*Y*Z^3 + X^2*Y^3 - 13*Y^2*Z^3) sage: len(C.rational_points()) 1043 | sage: C = Curve(X*Y*Z) sage: a = C.rational_points_iterator() sage: a.next() (1 : 0 : 0) sage: a.next() (0 : 1 : 0) sage: a.next() (1 : 1 : 0) sage: a.next() (0 : 0 : 1) sage: a.next() (1 : 0 : 1) sage: a.next() (0 : 1 : 1) sage: a.next() Traceback (most recent call last): ... StopIteration | def rational_points(self, algorithm="enum", sort=True): r""" Return the rational points on this curve computed via enumeration. |
sage: F = GF(2^6,'a') | sage: F = GF(3^2,'a') | def rational_points(self, algorithm="enum", sort=True): r""" Return the rational points on this curve computed via enumeration. |
sage: C = Curve(X^5+11*X*Y*Z^3 + X^2*Y^3 - 13*Y^2*Z^3) sage: len(C.rational_points()) 104 :: sage: R.<x,y,z> = GF(2)[] sage: f = x^3*y + y^3*z + x*z^3 sage: C = Curve(f); pts = C.rational_points() sage: pts [(0 : 0 : 1), (0 : 1 : 0), (1 : 0 : 0)] | sage: C = Curve(X^3+5*Y^2*Z-33*X*Y*X) sage: b = C.rational_points_iterator() sage: b.next() (0 : 1 : 0) sage: b.next() (0 : 0 : 1) sage: b.next() (2*a + 2 : 2*a : 1) sage: b.next() (2 : a + 1 : 1) sage: b.next() (a + 1 : a + 2 : 1) sage: b.next() (1 : 2 : 1) sage: b.next() (2*a + 2 : a : 1) sage: b.next() (2 : 2*a + 2 ... | def rational_points(self, algorithm="enum", sort=True): r""" Return the rational points on this curve computed via enumeration. |
points.append(self.point([one,zero,zero])) | t = self.point([one,zero,zero]) yield(t) | def rational_points(self, algorithm="enum", sort=True): r""" Return the rational points on this curve computed via enumeration. |
Return a list of primary ideals (and their associated primes) such that their intersection is `I` = ``self``. | Return a list of the associated primes of primary ideals of which the intersection is `I` = ``self``. | def associated_primes(self, algorithm='sy'): r""" Return a list of primary ideals (and their associated primes) such that their intersection is `I` = ``self``. |
- ``list`` - a list of primary ideals and their associated primes [(primary ideal, associated prime), ...] | - ``list`` - a list of associated primes | def associated_primes(self, algorithm='sy'): r""" Return a list of primary ideals (and their associated primes) such that their intersection is `I` = ``self``. |
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() | sage: Word('1212').is_square() True sage: Word('1213').is_square() False sage: Word('12123').is_square() False sage: Word().is_square() | def is_square(self): r""" Returns True if self is a square, and False otherwise. |
sage: W = Words('123') sage: W('12312').is_square_free() True sage: W('31212').is_square_free() False sage: W().is_square_free() True TESTS:: sage: W = Words('123') sage: W('11').is_square_free() False sage: W('211').is_square_free() False sage: W('3211').is_square_free() False """ l = self.length() if l < 2: | sage: Word('12312').is_square_free() True sage: Word('31212').is_square_free() False sage: Word().is_square_free() True TESTS: We make sure that sage: Word('11').is_square_free() False sage: Word('211').is_square_free() False sage: Word('3211').is_square_free() False """ L = self.length() if L < 2: | def is_square_free(self): r""" Returns True if self does not contain squares, and False otherwise. |
suff = self for i in xrange(0, l-1): for ll in xrange(2, l-i+1, 2): if suff[:ll].is_square(): | for start in xrange(0, L-1): for end in xrange(start+2, L+1, 2): if self[start:end].is_square(): | def is_square_free(self): r""" Returns True if self does not contain squares, and False otherwise. |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.