rem
stringlengths 1
322k
| add
stringlengths 0
2.05M
| context
stringlengths 4
228k
| meta
stringlengths 156
215
|
---|---|---|---|
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) | 6fcd0e4411764f3334770805a25ac575e92ad9b9 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/8193/6fcd0e4411764f3334770805a25ac575e92ad9b9/request_server.py |
"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": "localhost", "port": 8080, "enable_loggers": [], "propsmanager": None, # None: no property manager "locksmanager": True, # True: use lock_manager.LockManager "domaincontroller": None, # None: domain_controller.WsgiDAVDomainController(user_mapping) "verbose": 2, }) | 475a6594a2429e3cda24457304ad8826d7628bbe /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/8193/475a6594a2429e3cda24457304ad8826d7628bbe/test_scripted.py |
"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": "localhost", "port": 8080, "enable_loggers": [], "propsmanager": None, # None: no property manager "locksmanager": True, # True: use lock_manager.LockManager "domaincontroller": None, # None: domain_controller.WsgiDAVDomainController(user_mapping) "verbose": 2, }) | 475a6594a2429e3cda24457304ad8826d7628bbe /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/8193/475a6594a2429e3cda24457304ad8826d7628bbe/test_scripted.py |
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": "localhost", "port": 8080, "enable_loggers": [], "propsmanager": None, # None: no property manager "locksmanager": True, # True: use lock_manager.LockManager "domaincontroller": None, # None: domain_controller.WsgiDAVDomainController(user_mapping) "verbose": 2, }) | 475a6594a2429e3cda24457304ad8826d7628bbe /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/8193/475a6594a2429e3cda24457304ad8826d7628bbe/test_scripted.py |
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 | 475a6594a2429e3cda24457304ad8826d7628bbe /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/8193/475a6594a2429e3cda24457304ad8826d7628bbe/test_scripted.py |
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" | 81aff3fed020de9eb50b2254fb4174c392ff7ab2 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/8193/81aff3fed020de9eb50b2254fb4174c392ff7ab2/dav_provider.py |
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" | 81aff3fed020de9eb50b2254fb4174c392ff7ab2 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/8193/81aff3fed020de9eb50b2254fb4174c392ff7ab2/dav_provider.py |
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 | c413d0b87fd98873e7011629b08a1fa3e0009aaa /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/8193/c413d0b87fd98873e7011629b08a1fa3e0009aaa/test_scripted.py |
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 | 7099e9ecc7deded9227fb2e761b4a0837796af3e /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5677/7099e9ecc7deded9227fb2e761b4a0837796af3e/views.py |
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 | 425f71739ed6c1470cedc3e3d0be6ca75b215ec1 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5677/425f71739ed6c1470cedc3e3d0be6ca75b215ec1/views.py |
extra_context = dict(next=next), | extra_context = dict(next=next, year=event.year), | def delete_event(request, year_year, playa_event_id, next=None, | 16a17d6ece70c93d369e33a679d02b01e84181c1 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5677/16a17d6ece70c93d369e33a679d02b01e84181c1/views.py |
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, | 16a17d6ece70c93d369e33a679d02b01e84181c1 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5677/16a17d6ece70c93d369e33a679d02b01e84181c1/views.py |
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 | ea70a7b0edb2c42a886a1b7e2460d882f813be09 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5677/ea70a7b0edb2c42a886a1b7e2460d882f813be09/views.py |
if user: | if user and type(user) != AnonymousUser: | def playa_events_home(request, year_year, template='brc/playa_events_home.html', queryset=None | 076b944378da8630a3a845f68914a325893b1cfc /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5677/076b944378da8630a3a845f68914a325893b1cfc/views.py |
data = {'year':year} | data = {'year':year, 'user':request.user} | def playa_events_home(request, year_year, template='brc/playa_events_home.html', queryset=None | 735ba5a40df08f6b097409e4e466e20021111af9 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5677/735ba5a40df08f6b097409e4e466e20021111af9/views.py |
print "HERE", args, kwargs | def __init__(self, *args, **kwargs): print "HERE", args, kwargs super(PlayaEventForm, self).__init__(*args, **kwargs) | 7c1c7bbdc4004fbfcf5a75a1c0b0cdd250174ca9 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5677/7c1c7bbdc4004fbfcf5a75a1c0b0cdd250174ca9/forms.py |
|
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) | 58dcc6d0532fe18c9df8f493104815ae3eaee42b /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/3610/58dcc6d0532fe18c9df8f493104815ae3eaee42b/menu.py |
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) | 58dcc6d0532fe18c9df8f493104815ae3eaee42b /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/3610/58dcc6d0532fe18c9df8f493104815ae3eaee42b/menu.py |
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) | 58dcc6d0532fe18c9df8f493104815ae3eaee42b /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/3610/58dcc6d0532fe18c9df8f493104815ae3eaee42b/menu.py |
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) | 58dcc6d0532fe18c9df8f493104815ae3eaee42b /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/3610/58dcc6d0532fe18c9df8f493104815ae3eaee42b/menu.py |
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) | 58dcc6d0532fe18c9df8f493104815ae3eaee42b /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/3610/58dcc6d0532fe18c9df8f493104815ae3eaee42b/menu.py |
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) | 58dcc6d0532fe18c9df8f493104815ae3eaee42b /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/3610/58dcc6d0532fe18c9df8f493104815ae3eaee42b/menu.py |
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) | 58dcc6d0532fe18c9df8f493104815ae3eaee42b /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/3610/58dcc6d0532fe18c9df8f493104815ae3eaee42b/menu.py |
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) | 58dcc6d0532fe18c9df8f493104815ae3eaee42b /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/3610/58dcc6d0532fe18c9df8f493104815ae3eaee42b/menu.py |
def __init__ (self, parent = None): ui.VBox.__init__(self, parent) | 58dcc6d0532fe18c9df8f493104815ae3eaee42b /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/3610/58dcc6d0532fe18c9df8f493104815ae3eaee42b/menu.py |
||
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 | 58dcc6d0532fe18c9df8f493104815ae3eaee42b /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/3610/58dcc6d0532fe18c9df8f493104815ae3eaee42b/menu.py |
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._listprof) self.update_status("Profile saved") | 58dcc6d0532fe18c9df8f493104815ae3eaee42b /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/3610/58dcc6d0532fe18c9df8f493104815ae3eaee42b/menu.py |
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 | 58dcc6d0532fe18c9df8f493104815ae3eaee42b /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/3610/58dcc6d0532fe18c9df8f493104815ae3eaee42b/menu.py |
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): | 58dcc6d0532fe18c9df8f493104815ae3eaee42b /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/3610/58dcc6d0532fe18c9df8f493104815ae3eaee42b/menu.py |
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))) | 7e313c73307e12be169ba9f44d1c753d467de014 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/3610/7e313c73307e12be169ba9f44d1c753d467de014/world.py |
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) | 8436416e668914ce81961c956df99ebaf7fcf5fb /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/3610/8436416e668914ce81961c956df99ebaf7fcf5fb/world.py |
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)) | 8436416e668914ce81961c956df99ebaf7fcf5fb /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/3610/8436416e668914ce81961c956df99ebaf7fcf5fb/world.py |
self.load_profile('Default') | def __init__ (self, parent = None): ui.Image.__init__(self, parent, 'data/image/texture01.jpg') | 6da2beabe78594cf4c04092098908ba20a4b6d3e /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/3610/6da2beabe78594cf4c04092098908ba20a4b6d3e/menu.py |
|
else: self.mapL.select(i.get_value()) | def load_profile(self, name): | 6da2beabe78594cf4c04092098908ba20a4b6d3e /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/3610/6da2beabe78594cf4c04092098908ba20a4b6d3e/menu.py |
|
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) | 2b44dda638eeff53f6d49c16a93ae59f336f27ef /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/3610/2b44dda638eeff53f6d49c16a93ae59f336f27ef/world.py |
_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)) | 2b44dda638eeff53f6d49c16a93ae59f336f27ef /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/3610/2b44dda638eeff53f6d49c16a93ae59f336f27ef/world.py |
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) | 14dd3427f1c25a25fa68abb11ec8e37237a38268 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/3610/14dd3427f1c25a25fa68abb11ec8e37237a38268/model_objectives.py |
|
time.gmtime ( | time.localtime ( | def __init__ (self, parent = None, save_folder = '', *a, **k): super (LoadGameDialog, self).__init__ (parent, *a, **k) | d7c111b1cd26b9a89c4fe1d89f652aec5bd3ef5b /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/3610/d7c111b1cd26b9a89c4fe1d89f652aec5bd3ef5b/menu.py |
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.), pos=(1453.-AREA_X/2, 1176.-AREA_Y/2, 5)) area_objects.append(c) c = sphere(radius=5, color=(0., 0.,1.), pos=(1109.-AREA_X/2, 1050.-AREA_Y/2, 5)) area_objects.append(c) | b56f8565015ec12af0e8df461f8dd52d07f59dd7 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5625/b56f8565015ec12af0e8df461f8dd52d07f59dd7/display.py |
print "cobboard: %x,%x"%(int(m.groups()[0]),int(m.groups()[1])) | def silent_mkfifo(f): try: os.mkfifo(f) except: pass | b56f8565015ec12af0e8df461f8dd52d07f59dd7 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5625/b56f8565015ec12af0e8df461f8dd52d07f59dd7/display.py |
|
widget=MasterSelectWidget( | widget=SelectionWidget( | def getVocabMun(self,province): municipality = EntiVocabulary.comuni4provincia(province) return DisplayList(monetVocabMap(municipality)) | 6d10c20402ac754ddb932d13314aeb722527b0a0 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/8685/6d10c20402ac754ddb932d13314aeb722527b0a0/__init__.py |
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``. | 2ecb64877587a338c723df487639345b09bed118 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9417/2ecb64877587a338c723df487639345b09bed118/toric_lattice.py |
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``. | 2ecb64877587a338c723df487639345b09bed118 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9417/2ecb64877587a338c723df487639345b09bed118/toric_lattice.py |
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``. | 2ecb64877587a338c723df487639345b09bed118 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9417/2ecb64877587a338c723df487639345b09bed118/toric_lattice.py |
meth:`~sage.modules.free_module.FreeModule_generic_pid.submodule`, | :meth:`~sage.modules.free_module.FreeModule_generic_pid.submodule`, | def span(self, *args, **kwds): """ Return the span of the given generators. | 2ecb64877587a338c723df487639345b09bed118 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9417/2ecb64877587a338c723df487639345b09bed118/toric_lattice.py |
meth:`~sage.modules.free_module.FreeModule_generic_pid.submodule_with_basis`, | :meth:`~sage.modules.free_module.FreeModule_generic_pid.submodule_with_basis`, | def span(self, *args, **kwds): """ Return the span of the given generators. | 2ecb64877587a338c723df487639345b09bed118 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9417/2ecb64877587a338c723df487639345b09bed118/toric_lattice.py |
meth:`~sage.modules.free_module.FreeModule_generic_pid.submodule`, | :meth:`~sage.modules.free_module.FreeModule_generic_pid.submodule`, | def span_of_basis(self, *args, **kwds): r""" Return the submodule with the given ``basis``. | 2ecb64877587a338c723df487639345b09bed118 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9417/2ecb64877587a338c723df487639345b09bed118/toric_lattice.py |
meth:`~sage.modules.free_module.FreeModule_generic_pid.submodule_with_basis`, | :meth:`~sage.modules.free_module.FreeModule_generic_pid.submodule_with_basis`, | def span_of_basis(self, *args, **kwds): r""" Return the submodule with the given ``basis``. | 2ecb64877587a338c723df487639345b09bed118 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9417/2ecb64877587a338c723df487639345b09bed118/toric_lattice.py |
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 lattice, quotient of 3-d lattice N by Sublattice <N(1, 0, 1), N(0, 1, -1)> sage: Q.gens() (N[0, 0, -1],) or:: sage: M = N.dual() sage: Q = N.quotient(sublattice, positive_dual_point=M(0,0,-1)); Q 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],) TESTS:: sage: loads(dumps(Q)) == Q True sage: loads(dumps(Q)).gens() == Q.gens() True | def _latex_(self): r""" Return a LaTeX representation of ``self``. | 2ecb64877587a338c723df487639345b09bed118 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9417/2ecb64877587a338c723df487639345b09bed118/toric_lattice.py |
Torsion quotient of 3-d lattice N | Quotient with torsion of 3-d lattice N | def _repr_(self): r""" Return a string representation of ``self``. | 2ecb64877587a338c723df487639345b09bed118 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9417/2ecb64877587a338c723df487639345b09bed118/toric_lattice.py |
return "Torsion quotient of %s by %s" % (self.V(), self.W()) | return "Quotient with torsion of %s by %s" % (self.V(), self.W()) | def _repr_(self): r""" Return a string representation of ``self``. | 2ecb64877587a338c723df487639345b09bed118 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9417/2ecb64877587a338c723df487639345b09bed118/toric_lattice.py |
- integer. | Integer. The dimension of the free part of the quotient. | def rank(self): r""" Return the rank of ``self``. | 2ecb64877587a338c723df487639345b09bed118 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9417/2ecb64877587a338c723df487639345b09bed118/toric_lattice.py |
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-.]+)', version_string) if m: v = m.group(1) if v.startswith('0') or v.startswith('2') or v.startswith('3'): # the '0' is for early g77's return ('g77', v) else: # at some point in the 4.x series, the ' 95' was dropped # from the version string return ('gfortran', v) | 88d8906f7b729e50947606558b12f05e24421e4d /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9417/88d8906f7b729e50947606558b12f05e24421e4d/gnu.py |
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_exe('archiver') set_exe('ranlib') def update_executables(elf): """Called at the beginning of customisation. Subclasses should override this if they need to set up the executables dictionary. Note that self.find_executables() is run afterwards, so the self.executables dictionary values can contain <F77> or <F90> as the command, which will be replaced by the found F77 or F90 compiler. """ pass def get_flags(self): """List of flags common to all compiler types.""" return [] + self.pic_flags def _get_command_flags(self, key): cmd = self.executables.get(key, None) if cmd is None: return [] return cmd[1:] def get_flags_f77(self): """List of Fortran 77 specific flags.""" return self._get_command_flags('compiler_f77') def get_flags_f90(self): """List of Fortran 90 specific flags.""" return self._get_command_flags('compiler_f90') def get_flags_free(self): """List of Fortran 90 free format specific flags.""" return [] def get_flags_fix(self): """List of Fortran 90 fixed format specific flags.""" return self._get_command_flags('compiler_fix') def get_flags_linker_so(self): """List of linker flags to build a shared library.""" return self._get_command_flags('linker_so') def get_flags_linker_exe(self): """List of linker flags to build an executable.""" return self._get_command_flags('linker_exe') def get_flags_ar(self): """List of archiver flags. """ return self._get_command_flags('archiver') def get_flags_opt(self): """List of architecture independent compiler flags.""" return [] def get_flags_arch(self): """List of architecture dependent compiler flags.""" return [] def get_flags_debug(self): """List of compiler flags to compile with debugging information.""" return [] get_flags_opt_f77 = get_flags_opt_f90 = get_flags_opt get_flags_arch_f77 = get_flags_arch_f90 = get_flags_arch get_flags_debug_f77 = get_flags_debug_f90 = get_flags_debug def get_libraries(self): """List of compiler libraries.""" return self.libraries[:] def get_library_dirs(self): """List of compiler library directories.""" return self.library_dirs[:] def get_version(self, force=False, ok_status=[0]): assert self._is_customised return CCompiler.get_version(self, force=force, ok_status=ok_status) def customize(self, dist = None): """Customize Fortran compiler. This method gets Fortran compiler specific information from (i) class definition, (ii) environment, (iii) distutils config files, and (iv) command line (later overrides earlier). This method should be always called after constructing a compiler instance. But not in __init__ because Distribution instance is needed for (iii) and (iv). """ log.info('customize %s' % (self.__class__.__name__)) self._is_customised = True self.distutils_vars.use_distribution(dist) self.command_vars.use_distribution(dist) self.flag_vars.use_distribution(dist) self.update_executables() self.find_executables() noopt = self.distutils_vars.get('noopt', False) noarch = self.distutils_vars.get('noarch', noopt) debug = self.distutils_vars.get('debug', False) f77 = self.command_vars.compiler_f77 f90 = self.command_vars.compiler_f90 f77flags = [] f90flags = [] freeflags = [] fixflags = [] if f77: f77flags = self.flag_vars.f77 if f90: f90flags = self.flag_vars.f90 freeflags = self.flag_vars.free fix = self.command_vars.compiler_fix if fix: fixflags = self.flag_vars.fix + f90flags oflags, aflags, dflags = [], [], [] def get_flags(tag, flags): flags.extend(getattr(self.flag_vars, tag)) this_get = getattr(self, 'get_flags_' + tag) for name, c, flagvar in [('f77', f77, f77flags), ('f90', f90, f90flags), ('f90', fix, fixflags)]: t = '%s_%s' % (tag, name) if c and this_get is not getattr(self, 'get_flags_' + t): flagvar.extend(getattr(self.flag_vars, t)) if not noopt: get_flags('opt', oflags) if not noarch: get_flags('arch', aflags) if debug: get_flags('debug', dflags) fflags = self.flag_vars.flags + dflags + oflags + aflags if f77: self.set_commands(compiler_f77=[f77]+f77flags+fflags) if f90: self.set_commands(compiler_f90=[f90]+freeflags+f90flags+fflags) if fix: self.set_commands(compiler_fix=[fix]+fixflags+fflags) linker_so = self.linker_so if linker_so: linker_so_flags = self.flag_vars.linker_so if sys.platform.startswith('aix'): python_lib = get_python_lib(standard_lib=1) ld_so_aix = os.path.join(python_lib, 'config', 'ld_so_aix') python_exp = os.path.join(python_lib, 'config', 'python.exp') linker_so = [ld_so_aix] + linker_so + ['-bI:'+python_exp] self.set_commands(linker_so=linker_so+linker_so_flags) linker_exe = self.linker_exe if linker_exe: linker_exe_flags = self.flag_vars.linker_exe self.set_commands(linker_exe=linker_exe+linker_exe_flags) ar = self.command_vars.archiver if ar: arflags = self.flag_vars.ar self.set_commands(archiver=[ar]+arflags) self.set_library_dirs(self.get_library_dirs()) self.set_libraries(self.get_libraries()) def dump_properties(self): """Print out the attributes of a compiler instance.""" props = [] for key in self.executables.keys() + \ ['version','libraries','library_dirs', 'object_switch','compile_switch']: if hasattr(self,key): v = getattr(self,key) props.append((key, None, '= '+repr(v))) props.sort() pretty_printer = FancyGetopt(props) for l in pretty_printer.generate_help("%s instance properties:" \ % (self.__class__.__name__)): if l[:4]==' --': l = ' ' + l[4:] print l def _compile(self, obj, src, ext, cc_args, extra_postargs, pp_opts): """Compile 'src' to product 'obj'.""" src_flags = {} if is_f_file(src) and not has_f90_header(src): flavor = ':f77' compiler = self.compiler_f77 src_flags = get_f77flags(src) elif is_free_format(src): flavor = ':f90' compiler = self.compiler_f90 if compiler is None: raise DistutilsExecError, 'f90 not supported by %s needed for %s'\ % (self.__class__.__name__,src) else: flavor = ':fix' compiler = self.compiler_fix if compiler is None: raise DistutilsExecError, 'f90 (fixed) not supported by %s needed for %s'\ % (self.__class__.__name__,src) if self.object_switch[-1]==' ': o_args = [self.object_switch.strip(),obj] else: o_args = [self.object_switch.strip()+obj] assert self.compile_switch.strip() s_args = [self.compile_switch, src] extra_flags = src_flags.get(self.compiler_type,[]) if extra_flags: log.info('using compile options from source: %r' \ % ' '.join(extra_flags)) command = compiler + cc_args + extra_flags + s_args + o_args \ + extra_postargs display = '%s: %s' % (os.path.basename(compiler[0]) + flavor, src) try: self.spawn(command,display=display) except DistutilsExecError, msg: raise CompileError, msg def module_options(self, module_dirs, module_build_dir): options = [] if self.module_dir_switch is not None: if self.module_dir_switch[-1]==' ': options.extend([self.module_dir_switch.strip(),module_build_dir]) else: options.append(self.module_dir_switch.strip()+module_build_dir) else: print 'XXX: module_build_dir=%r option ignored' % (module_build_dir) print 'XXX: Fix module_dir_switch for ',self.__class__.__name__ if self.module_include_switch is not None: for d in [module_build_dir]+module_dirs: options.append('%s%s' % (self.module_include_switch, d)) else: print 'XXX: module_dirs=%r option ignored' % (module_dirs) print 'XXX: Fix module_include_switch for ',self.__class__.__name__ return options def library_option(self, lib): return "-l" + lib def library_dir_option(self, dir): return "-L" + dir def link(self, target_desc, objects, output_filename, output_dir=None, libraries=None, library_dirs=None, runtime_library_dirs=None, export_symbols=None, debug=0, extra_preargs=None, extra_postargs=None, build_temp=None, target_lang=None): objects, output_dir = self._fix_object_args(objects, output_dir) libraries, library_dirs, runtime_library_dirs = \ self._fix_lib_args(libraries, library_dirs, runtime_library_dirs) lib_opts = gen_lib_options(self, library_dirs, runtime_library_dirs, libraries) if is_string(output_dir): output_filename = os.path.join(output_dir, output_filename) elif output_dir is not None: raise TypeError, "'output_dir' must be a string or None" if self._need_link(objects, output_filename): if self.library_switch[-1]==' ': o_args = [self.library_switch.strip(),output_filename] else: o_args = [self.library_switch.strip()+output_filename] if is_string(self.objects): ld_args = objects + [self.objects] else: ld_args = objects + self.objects ld_args = ld_args + lib_opts + o_args if debug: ld_args[:0] = ['-g'] if extra_preargs: ld_args[:0] = extra_preargs if extra_postargs: ld_args.extend(extra_postargs) self.mkpath(os.path.dirname(output_filename)) if target_desc == CCompiler.EXECUTABLE: linker = self.linker_exe[:] else: linker = self.linker_so[:] command = linker + ld_args try: self.spawn(command) except DistutilsExecError, msg: raise LinkError, msg else: log.debug("skipping %s (up-to-date)", output_filename) def _environment_hook(self, name, hook_name): if hook_name is None: | 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-.]+)', version_string) if m: v = m.group(1) if v.startswith('0') or v.startswith('2') or v.startswith('3'): # the '0' is for early g77's return ('g77', v) else: # at some point in the 4.x series, the ' 95' was dropped # from the version string return ('gfortran', v) | 88d8906f7b729e50947606558b12f05e24421e4d /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9417/88d8906f7b729e50947606558b12f05e24421e4d/gnu.py |
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' : ["ranlib"], 'linker_exe' : [None, "-g", "-Wall"] } module_dir_switch = None module_include_switch = None if os.name != 'nt' and sys.platform != 'cygwin': pic_flags = ['-fPIC'] if sys.platform == 'win32': for key in ['version_cmd', 'compiler_f77', 'linker_so', 'linker_exe']: executables[key].append('-mno-cygwin') g2c = 'g2c' suggested_f90_compiler = 'gnu95' def get_flags_linker_so(self): opt = self.linker_so[1:] if sys.platform=='darwin': target = os.environ.get('MACOSX_DEPLOYMENT_TARGET', None) if not target: import distutils.sysconfig as sc g = {} filename = sc.get_makefile_filename() sc.parse_makefile(filename, g) target = g.get('MACOSX_DEPLOYMENT_TARGET', '10.3') os.environ['MACOSX_DEPLOYMENT_TARGET'] = target if target == '10.3': s = 'Env. variable MACOSX_DEPLOYMENT_TARGET set to 10.3' warnings.warn(s) opt.extend(['-undefined', 'dynamic_lookup', '-bundle']) | 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_name[6:] hook = getattr(self, 'get_flags_' + hook_name) return 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] | 88d8906f7b729e50947606558b12f05e24421e4d /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9417/88d8906f7b729e50947606558b12f05e24421e4d/gnu.py |
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','gnu95','g95')), ('darwin.*', ('sage_fortran','nag', 'absoft', 'ibm', 'intel', 'gnu', 'gnu95', 'g95')), ('sunos.*', ('sage_fortran','sun','gnu','gnu95','g95')), ('irix.*', ('mips','gnu','gnu95',)), ('aix.*', ('ibm','gnu','gnu95',)), ('posix', ('gnu','gnu95',)), ('nt', ('gnu','gnu95',)), ('mac', ('gnu','gnu95',)), ) fcompiler_class = None fcompiler_aliases = None if os.popen("sage_fortran --version").read().startswith('GNU Fortran'): import gnu cls=gnu.Sage_FCompiler_1 else: import gnu cls=gnu.Sage_FCompiler def load_all_fcompiler_classes(): """Cache all the FCompiler classes found in modules in the numpy.distutils.fcompiler package. """ from glob import glob global fcompiler_class, fcompiler_aliases,cls if fcompiler_class is not None: return pys = os.path.join(os.path.dirname(__file__), '*.py') fcompiler_class = {} fcompiler_aliases = {} for fname in glob(pys): module_name, ext = os.path.splitext(os.path.basename(fname)) module_name = 'numpy.distutils.fcompiler.' + module_name __import__ (module_name) module = sys.modules[module_name] if hasattr(module, 'compilers'): for cname in module.compilers: klass = getattr(module, cname) desc = (klass.compiler_type, klass, klass.description) fcompiler_class[klass.compiler_type] = desc for alias in klass.compiler_aliases: if alias in fcompiler_aliases: raise ValueError("alias %r defined for both %s and %s" % (alias, klass.__name__, fcompiler_aliases[alias][1].__name__)) fcompiler_aliases[alias] = desc fcompiler_class['sage_fortran']=('gnu',cls,"GNU Fortran (GCC)") def _find_existing_fcompiler(compiler_types, osname=None, platform=None, requiref90=False, c_compiler=None): from numpy.distutils.core import get_distribution dist = get_distribution(always=True) for compiler_type in compiler_types: v = None try: c = new_fcompiler(plat=platform, compiler=compiler_type, c_compiler=c_compiler) c.customize(dist) v = c.get_version() if requiref90 and c.compiler_f90 is None: v = None new_compiler = c.suggested_f90_compiler if new_compiler: log.warn('Trying %r compiler as suggested by %r ' 'compiler for f90 support.' % (compiler_type, new_compiler)) c = new_fcompiler(plat=platform, compiler=new_compiler, c_compiler=c_compiler) c.customize(dist) v = c.get_version() if v is not None: compiler_type = new_compiler if requiref90 and c.compiler_f90 is None: raise ValueError('%s does not support compiling f90 codes, ' 'skipping.' % (c.__class__.__name__)) except DistutilsModuleError: log.debug("_find_existing_fcompiler: compiler_type='%s' raised DistutilsModuleError", compiler_type) except CompilerNotFound: log.debug("_find_existing_fcompiler: compiler_type='%s' not found", compiler_type) if v is not None: return compiler_type return None def available_fcompilers_for_platform(osname=None, platform=None): if osname is None: osname = os.name if platform is None: platform = sys.platform matching_compiler_types = [] for pattern, compiler_type in _default_compilers: if re.match(pattern, platform) or re.match(pattern, osname): for ct in compiler_type: if ct not in matching_compiler_types: matching_compiler_types.append(ct) if not matching_compiler_types: matching_compiler_types.append('gnu') return matching_compiler_types def get_default_fcompiler(osname=None, platform=None, requiref90=False, c_compiler=None): """Determine the default Fortran compiler to use for the given platform.""" matching_compiler_types = available_fcompilers_for_platform(osname, platform) compiler_type = _find_existing_fcompiler(matching_compiler_types, osname=osname, platform=platform, requiref90=requiref90, c_compiler=c_compiler) return compiler_type def new_fcompiler(plat=None, compiler=None, verbose=0, dry_run=0, force=0, requiref90=False, c_compiler = None): """Generate an instance of some FCompiler subclass for the supplied platform/compiler combination. """ load_all_fcompiler_classes() if plat is None: plat = os.name if compiler is None: compiler = get_default_fcompiler(plat, requiref90=requiref90, c_compiler=c_compiler) if compiler in fcompiler_class: module_name, klass, long_description = fcompiler_class[compiler] elif compiler in fcompiler_aliases: module_name, klass, long_description = fcompiler_aliases[compiler] else: msg = "don't know how to compile Fortran code on platform '%s'" % plat if compiler is not None: msg = msg + " with '%s' compiler." % compiler msg = msg + " Supported compilers are: %s)" \ % (','.join(fcompiler_class.keys())) log.warn(msg) | 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 Python # Makefile used to build Python. We let disutils handle this # error checking. if not target: # If MACOSX_DEPLOYMENT_TARGET is not set in the environment, # we try to get it first from the Python Makefile and then we # fall back to setting it to 10.3 to maximize the set of # versions we can work with. This is a reasonable default # even when using the official Python dist and those derived # from it. import distutils.sysconfig as sc g = {} filename = sc.get_makefile_filename() sc.parse_makefile(filename, g) target = g.get('MACOSX_DEPLOYMENT_TARGET', '10.3') os.environ['MACOSX_DEPLOYMENT_TARGET'] = target if target == '10.3': s = 'Env. variable MACOSX_DEPLOYMENT_TARGET set to 10.3' warnings.warn(s) | 88d8906f7b729e50947606558b12f05e24421e4d /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9417/88d8906f7b729e50947606558b12f05e24421e4d/gnu.py |
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.exists(os.path.join(d2, "lib%s.a" % self.g2c)): opt.append(d2) opt.append(d) return opt 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 | 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.command.config_compiler import config_fc dist = Distribution() dist.script_name = os.path.basename(sys.argv[0]) dist.script_args = ['config_fc'] + sys.argv[1:] try: dist.script_args.remove('--help-fcompiler') except ValueError: pass dist.cmdclass['config_fc'] = config_fc dist.parse_config_files() dist.parse_command_line() compilers = [] compilers_na = [] compilers_ni = [] if not fcompiler_class: load_all_fcompiler_classes() platform_compilers = available_fcompilers_for_platform() for compiler in platform_compilers: v = None log.set_verbosity(-2) try: c = new_fcompiler(compiler=compiler, verbose=dist.verbose) c.customize(dist) v = c.get_version() except (DistutilsModuleError, CompilerNotFound), e: log.debug("show_fcompilers: %s not found" % (compiler,)) log.debug(repr(e)) if v is None: compilers_na.append(("fcompiler="+compiler, None, fcompiler_class[compiler][2])) | 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.path.abspath(os.path.join(d, '../../../../lib')) if os.path.exists(os.path.join(d2, "lib%s.a" % self.g2c)): opt.append(d2) opt.append(d) return opt | 88d8906f7b729e50947606558b12f05e24421e4d /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9417/88d8906f7b729e50947606558b12f05e24421e4d/gnu.py |
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 opt def get_flags_debug(self): return ['-g'] def get_flags_opt(self): if self.get_version()<='3.3.3': opt = ['-O2'] else: opt = ['-O3'] opt.append('-funroll-loops') return opt def get_flags_arch(self): return [] return opt class Gnu95FCompiler(GnuFCompiler): compiler_type = 'gnu95' compiler_aliases = ('gfortran',) description = 'GNU Fortran 95 compiler' def version_match(self, version_string): v = self.gnu_version_match(version_string) if not v or v[0] != 'gfortran': return None return v[1] possible_executables = ['gfortran', 'f95'] executables = { 'version_cmd' : ["<F90>", "--version"], 'compiler_f77' : [None, "-Wall", "-ffixed-form", "-fno-second-underscore"], 'compiler_f90' : [None, "-Wall", "-fno-second-underscore"], 'compiler_fix' : [None, "-Wall", "-ffixed-form", "-fno-second-underscore"], 'linker_so' : ["<F90>", "-Wall"], 'archiver' : ["ar", "-cr"], 'ranlib' : ["ranlib"], 'linker_exe' : [None, "-Wall"] } if sys.platform == 'win32': for key in ['version_cmd', 'compiler_f77', 'compiler_f90', 'compiler_fix', 'linker_so', 'linker_exe']: executables[key].append('-mno-cygwin') module_dir_switch = '-J' module_include_switch = '-I' g2c = 'gfortran' def _can_target(self, cmd, arch): """Return true is the compiler support the -arch flag for the given architecture.""" newcmd = cmd[:] st, out = exec_command(" ".join(newcmd)) if st == 0: for line in out.splitlines(): m = re.search(_R_ARCHS[arch], line) if m: return True return False def _universal_flags(self, cmd): """Return a list of -arch flags for every supported architecture.""" if not sys.platform == 'darwin': return [] arch_flags = [] for arch in ["ppc", "i686"]: if self._can_target(cmd, arch): arch_flags.extend(["-arch", arch]) return arch_flags def get_flags(self): flags = GnuFCompiler.get_flags(self) arch_flags = self._universal_flags(self.compiler_f90) if arch_flags: flags[:0] = arch_flags return flags def get_flags_linker_so(self): flags = GnuFCompiler.get_flags_linker_so(self) arch_flags = self._universal_flags(self.linker_so) if arch_flags: flags[:0] = arch_flags return flags def get_library_dirs(self): opt = GnuFCompiler.get_library_dirs(self) if sys.platform == 'win32': c_compiler = self.c_compiler if c_compiler and c_compiler.compiler_type == "msvc": target = self.get_target() if target: d = os.path.normpath(self.get_libgcc_dir()) root = os.path.join(d, os.pardir, os.pardir, os.pardir, os.pardir) mingwdir = os.path.normpath(os.path.join(root, target, "lib")) full = os.path.join(mingwdir, "libmingwex.a") if os.path.exists(full): opt.append(mingwdir) return opt def get_libraries(self): opt = GnuFCompiler.get_libraries(self) if sys.platform == 'darwin': opt.remove('cc_dynamic') if sys.platform == 'win32': c_compiler = self.c_compiler if c_compiler and c_compiler.compiler_type == "msvc": if "gcc" in opt: i = opt.index("gcc") opt.insert(i+1, "mingwex") opt.insert(i+1, "mingw32") return opt def get_target(self): status, output = exec_command(self.compiler_f77 + ['-v'], use_tee=0) if not status: m = TARGET_R.search(output) if m: return m.group(1) return "" class Sage_FCompiler_1(Gnu95FCompiler): compiler_type = 'gnu95' version_match = simple_version_match(start='GNU Fortran') executables = { 'version_cmd' : ["sage_fortran","--version"], 'compiler_f77' : ["sage_fortran","-Wall","-ffixed-form","-fno-second-underscore"], 'compiler_f90' : ["sage_fortran","-Wall","-fno-second-underscore"], 'compiler_fix' : ["sage_fortran","-Wall","-ffixed-form","-fno-second-underscore"], 'linker_so' : ["sage_fortran","-Wall","-shared"], 'archiver' : ["ar", "-cr"], 'ranlib' : ["ranlib"], 'linker_exe' : ["sage_fortran","-Wall"] } if sys.platform == 'win32': for key in ['version_cmd', 'compiler_f77', 'compiler_f90', 'compiler_fix', 'linker_so', 'linker_exe']: executables[key].append('-mno-cygwin') def find_executables(self): pass module_dir_switch = '-J' module_include_switch = '-I' g2c = 'gfortran' def get_libraries(self): opt = GnuFCompiler.get_libraries(self) if sys.platform == 'darwin': opt.remove('cc_dynamic') return opt class Sage_FCompiler(FCompiler): compiler_type = 'g95' version_pattern = r'G95 \((GCC (?P<gccversion>[\d.]+)|.*?) \(g95 (?P<version>.*)!\) (?P<date>.*)\).*' suggested_f90_compiler = 'sage_fortran' if os.uname()[0]=="Darwin": link_command=["sage_fortran","-undefined", "dynamic_lookup", "-bundle"] else: link_command=["sage_fortran","-shared"] executables = { 'version_cmd' : ["sage_fortran", "--version"], 'compiler_f77' : ["sage_fortran", "-ffixed-form"], 'compiler_fix' : ["sage_fortran", "-ffixed-form"], 'compiler_f90' : ["sage_fortran"], 'linker_so' : link_command, 'archiver' : ["ar", "-cr"], 'ranlib' : ["ranlib"], 'linker_exe' : ["sage_fortran",""] } pic_flags = ['-fpic'] module_dir_switch = '-fmod=' module_include_switch = '-I' def get_flags_linker_so(self): opt = self.linker_so[1:] if sys.platform=='darwin': target = os.environ.get('MACOSX_DEPLOYMENT_TARGET', None) if target is None or target == '': target = '10.3' major, minor = target.split('.') if int(minor) < 3: minor = '3' warnings.warn('Environment variable ' 'MACOSX_DEPLOYMENT_TARGET reset to %s.%s' % (major, minor)) os.environ['MACOSX_DEPLOYMENT_TARGET'] = '%s.%s' % (major, minor) if sys.platform[:5]=='sunos': opt.append('-mimpure-text') return opt def get_library_dirs(self): SAGE_LOCAL=os.environ['SAGE_LOCAL'] GCC_LIB_DIR=SAGE_LOCAL+"/lib/" if os.path.exists(GCC_LIB_DIR + "gcc-lib"): GCC_LIB_DIR += "gcc-lib/" GCC_LIB_DIR += os.listdir(GCC_LIB_DIR)[0] + "/" GCC_LIB_DIR += os.listdir(GCC_LIB_DIR)[0] + "/" return [GCC_LIB_DIR] def get_libraries(self): l=[] if os.uname()[-1] == 'Power Macintosh': l.append('SystemStubs') else: if os.uname()[0].startswith('Linux'): l.append('f95') return l def get_flags(self): return ['-fno-second-underscore'] def get_flags_opt(self): return ['-O'] def get_flags_debug(self): return ['-g'] | 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() compilers_ni.sort() pretty_printer = FancyGetopt(compilers) pretty_printer.print_help("Fortran compilers found:") pretty_printer = FancyGetopt(compilers_na) pretty_printer.print_help("Compilers available for this " "platform, but not found:") if compilers_ni: pretty_printer = FancyGetopt(compilers_ni) pretty_printer.print_help("Compilers not available on this platform:") print "For compiler details, run 'config_fc --verbose' setup command." def dummy_fortran_file(): fo, name = make_temp_file(suffix='.f') fo.write(" subroutine dummy()\n end\n") fo.close() return name[:-2] is_f_file = re.compile(r'.*[.](for|ftn|f77|f)\Z',re.I).match _has_f_header = re.compile(r'-[*]-\s*fortran\s*-[*]-',re.I).search _has_f90_header = re.compile(r'-[*]-\s*f90\s*-[*]-',re.I).search _has_fix_header = re.compile(r'-[*]-\s*fix\s*-[*]-',re.I).search _free_f90_start = re.compile(r'[^c*!]\s*[^\s\d\t]',re.I).match def is_free_format(file): """Check if file is in free format Fortran.""" result = 0 f = open(file,'r') line = f.readline() n = 10000 if _has_f_header(line): n = 0 elif _has_f90_header(line): n = 0 result = 1 while n>0 and line: line = line.rstrip() if line and line[0]!='!': n -= 1 if (line[0]!='\t' and _free_f90_start(line[:5])) or line[-1:]=='&': result = 1 break line = f.readline() f.close() return result def has_f90_header(src): f = open(src,'r') line = f.readline() f.close() return _has_f90_header(line) or _has_fix_header(line) _f77flags_re = re.compile(r'(c|)f77flags\s*\(\s*(?P<fcname>\w+)\s*\)\s*=\s*(?P<fflags>.*)',re.I) def get_f77flags(src): """ Search the first 20 lines of fortran 77 code for line pattern `CF77FLAGS(<fcompiler type>)=<f77 flags>` Return a dictionary {<fcompiler type>:<f77 flags>}. """ flags = {} f = open(src,'r') i = 0 for line in f.readlines(): i += 1 if i>20: break m = _f77flags_re.match(line) if not m: continue fcname = m.group('fcname').strip() fflags = m.group('fflags').strip() flags[fcname] = split_quoted(fflags) f.close() return flags | 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 | 88d8906f7b729e50947606558b12f05e24421e4d /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9417/88d8906f7b729e50947606558b12f05e24421e4d/gnu.py |
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'] | 88d8906f7b729e50947606558b12f05e24421e4d /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9417/88d8906f7b729e50947606558b12f05e24421e4d/gnu.py |
sage: sage.symbolic.units.evalunitdict() | sage: sage.symbolic.units.evalunitdict() | def evalunitdict(): """ Replace all the string values of the unitdict variable by their evaluated forms, and builds some other tables for ease of use. This function is mainly used internally, for efficiency (and flexibility) purposes, making it easier to describe the units. EXAMPLES:: sage: sage.symbolic.units.evalunitdict() """ from sage.misc.all import sage_eval for key, value in unitdict.iteritems(): unitdict[key] = dict([(a,sage_eval(repr(b))) for a, b in value.iteritems()]) # FEATURE IDEA: create a function that would allow users to add # new entries to the table without having to know anything about # how the table is stored internally. # # Format the table for easier use. # for k, v in unitdict.iteritems(): for a in v: unit_to_type[a] = k for w in unitdict.iterkeys(): for j in unitdict[w].iterkeys(): if type(unitdict[w][j]) == tuple: unitdict[w][j] = unitdict[w][j][0] value_to_unit[w] = dict(zip(unitdict[w].itervalues(), unitdict[w].iterkeys())) | 04717bf1b9b9ac138edf5b9001954a2a12d3790d /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9417/04717bf1b9b9ac138edf5b9001954a2a12d3790d/units.py |
unitdict[key] = dict([(a,sage_eval(repr(b))) for a, b in value.iteritems()]) | unitdict[key] = dict([(a,sage_eval(repr(b))) for a, b in value.iteritems()]) | def evalunitdict(): """ Replace all the string values of the unitdict variable by their evaluated forms, and builds some other tables for ease of use. This function is mainly used internally, for efficiency (and flexibility) purposes, making it easier to describe the units. EXAMPLES:: sage: sage.symbolic.units.evalunitdict() """ from sage.misc.all import sage_eval for key, value in unitdict.iteritems(): unitdict[key] = dict([(a,sage_eval(repr(b))) for a, b in value.iteritems()]) # FEATURE IDEA: create a function that would allow users to add # new entries to the table without having to know anything about # how the table is stored internally. # # Format the table for easier use. # for k, v in unitdict.iteritems(): for a in v: unit_to_type[a] = k for w in unitdict.iterkeys(): for j in unitdict[w].iterkeys(): if type(unitdict[w][j]) == tuple: unitdict[w][j] = unitdict[w][j][0] value_to_unit[w] = dict(zip(unitdict[w].itervalues(), unitdict[w].iterkeys())) | 04717bf1b9b9ac138edf5b9001954a2a12d3790d /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9417/04717bf1b9b9ac138edf5b9001954a2a12d3790d/units.py |
for a in v: unit_to_type[a] = k | for a in v: unit_to_type[a] = k | def evalunitdict(): """ Replace all the string values of the unitdict variable by their evaluated forms, and builds some other tables for ease of use. This function is mainly used internally, for efficiency (and flexibility) purposes, making it easier to describe the units. EXAMPLES:: sage: sage.symbolic.units.evalunitdict() """ from sage.misc.all import sage_eval for key, value in unitdict.iteritems(): unitdict[key] = dict([(a,sage_eval(repr(b))) for a, b in value.iteritems()]) # FEATURE IDEA: create a function that would allow users to add # new entries to the table without having to know anything about # how the table is stored internally. # # Format the table for easier use. # for k, v in unitdict.iteritems(): for a in v: unit_to_type[a] = k for w in unitdict.iterkeys(): for j in unitdict[w].iterkeys(): if type(unitdict[w][j]) == tuple: unitdict[w][j] = unitdict[w][j][0] value_to_unit[w] = dict(zip(unitdict[w].itervalues(), unitdict[w].iterkeys())) | 04717bf1b9b9ac138edf5b9001954a2a12d3790d /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9417/04717bf1b9b9ac138edf5b9001954a2a12d3790d/units.py |
for j in unitdict[w].iterkeys(): if type(unitdict[w][j]) == tuple: unitdict[w][j] = unitdict[w][j][0] value_to_unit[w] = dict(zip(unitdict[w].itervalues(), unitdict[w].iterkeys())) | for j in unitdict[w].iterkeys(): if type(unitdict[w][j]) == tuple: unitdict[w][j] = unitdict[w][j][0] value_to_unit[w] = dict(zip(unitdict[w].itervalues(), unitdict[w].iterkeys())) | def evalunitdict(): """ Replace all the string values of the unitdict variable by their evaluated forms, and builds some other tables for ease of use. This function is mainly used internally, for efficiency (and flexibility) purposes, making it easier to describe the units. EXAMPLES:: sage: sage.symbolic.units.evalunitdict() """ from sage.misc.all import sage_eval for key, value in unitdict.iteritems(): unitdict[key] = dict([(a,sage_eval(repr(b))) for a, b in value.iteritems()]) # FEATURE IDEA: create a function that would allow users to add # new entries to the table without having to know anything about # how the table is stored internally. # # Format the table for easier use. # for k, v in unitdict.iteritems(): for a in v: unit_to_type[a] = k for w in unitdict.iterkeys(): for j in unitdict[w].iterkeys(): if type(unitdict[w][j]) == tuple: unitdict[w][j] = unitdict[w][j][0] value_to_unit[w] = dict(zip(unitdict[w].itervalues(), unitdict[w].iterkeys())) | 04717bf1b9b9ac138edf5b9001954a2a12d3790d /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9417/04717bf1b9b9ac138edf5b9001954a2a12d3790d/units.py |
{'gal':'Abbreviation for galileo.\nDefined to be 1/100 meter/second^2.', 'galileo':'Defined to be 1/100 meter/second^2.', 'gravity':'Also called standard gravity.\nPhysical constant defined to be 9.80665 meter/second^2.'}, | {'gal':'Abbreviation for galileo.\nDefined to be 1/100 meter/second^2.', 'galileo':'Defined to be 1/100 meter/second^2.', 'gravity':'Also called standard gravity.\nPhysical constant defined to be 9.80665 meter/second^2.'}, | def evalunitdict(): """ Replace all the string values of the unitdict variable by their evaluated forms, and builds some other tables for ease of use. This function is mainly used internally, for efficiency (and flexibility) purposes, making it easier to describe the units. EXAMPLES:: sage: sage.symbolic.units.evalunitdict() """ from sage.misc.all import sage_eval for key, value in unitdict.iteritems(): unitdict[key] = dict([(a,sage_eval(repr(b))) for a, b in value.iteritems()]) # FEATURE IDEA: create a function that would allow users to add # new entries to the table without having to know anything about # how the table is stored internally. # # Format the table for easier use. # for k, v in unitdict.iteritems(): for a in v: unit_to_type[a] = k for w in unitdict.iterkeys(): for j in unitdict[w].iterkeys(): if type(unitdict[w][j]) == tuple: unitdict[w][j] = unitdict[w][j][0] value_to_unit[w] = dict(zip(unitdict[w].itervalues(), unitdict[w].iterkeys())) | 04717bf1b9b9ac138edf5b9001954a2a12d3790d /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9417/04717bf1b9b9ac138edf5b9001954a2a12d3790d/units.py |
{'elementary_entity':'Defined to be one elementary unit of choice, usually atoms or other elementary particles.\nApproximately equal to 1.6605e-24 moles.', 'mole':'SI base unit of quantity.\nDefined to be the amount of substance that has an equal number of elementary entities as there are atoms in 12 grams of carbon-12.\nEquivalent to Avogadros constant elementary entities or approximately equal to 6.022*10^23 elementary entities.'}, | {'elementary_entity':'Defined to be one elementary unit of choice, usually atoms or other elementary particles.\nApproximately equal to 1.6605e-24 moles.', 'mole':'SI base unit of quantity.\nDefined to be the amount of substance that has an equal number of elementary entities as there are atoms in 12 grams of carbon-12.\nEquivalent to Avogadros constant elementary entities or approximately equal to 6.022*10^23 elementary entities.'}, | def evalunitdict(): """ Replace all the string values of the unitdict variable by their evaluated forms, and builds some other tables for ease of use. This function is mainly used internally, for efficiency (and flexibility) purposes, making it easier to describe the units. EXAMPLES:: sage: sage.symbolic.units.evalunitdict() """ from sage.misc.all import sage_eval for key, value in unitdict.iteritems(): unitdict[key] = dict([(a,sage_eval(repr(b))) for a, b in value.iteritems()]) # FEATURE IDEA: create a function that would allow users to add # new entries to the table without having to know anything about # how the table is stored internally. # # Format the table for easier use. # for k, v in unitdict.iteritems(): for a in v: unit_to_type[a] = k for w in unitdict.iterkeys(): for j in unitdict[w].iterkeys(): if type(unitdict[w][j]) == tuple: unitdict[w][j] = unitdict[w][j][0] value_to_unit[w] = dict(zip(unitdict[w].itervalues(), unitdict[w].iterkeys())) | 04717bf1b9b9ac138edf5b9001954a2a12d3790d /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9417/04717bf1b9b9ac138edf5b9001954a2a12d3790d/units.py |
{'arc_minute':'Defined to be 1/60 of a degree or pi/10800 radians.', 'arc_second':'Defined to be 1/3600 of a degree or pi/648000 radians.', 'degree':'Defined to be pi/180 radians.', 'grade':'Defined to be pi/200 radians.', 'quadrant':'Equivalent to a right angle.\nDefined to be pi/2 radians.', 'radian':'SI derived unit of angle.\nDefined to be the angle subtended at the center of a circle by an arc that is equal in length to the radius of the circle.', 'right_angle':'Equivalent to a quadrant.\nDefined to be pi/2 radians.'}, | {'arc_minute':'Defined to be 1/60 of a degree or pi/10800 radians.', 'arc_second':'Defined to be 1/3600 of a degree or pi/648000 radians.', 'degree':'Defined to be pi/180 radians.', 'grade':'Defined to be pi/200 radians.', 'quadrant':'Equivalent to a right angle.\nDefined to be pi/2 radians.', 'radian':'SI derived unit of angle.\nDefined to be the angle subtended at the center of a circle by an arc that is equal in length to the radius of the circle.', 'right_angle':'Equivalent to a quadrant.\nDefined to be pi/2 radians.'}, | def evalunitdict(): """ Replace all the string values of the unitdict variable by their evaluated forms, and builds some other tables for ease of use. This function is mainly used internally, for efficiency (and flexibility) purposes, making it easier to describe the units. EXAMPLES:: sage: sage.symbolic.units.evalunitdict() """ from sage.misc.all import sage_eval for key, value in unitdict.iteritems(): unitdict[key] = dict([(a,sage_eval(repr(b))) for a, b in value.iteritems()]) # FEATURE IDEA: create a function that would allow users to add # new entries to the table without having to know anything about # how the table is stored internally. # # Format the table for easier use. # for k, v in unitdict.iteritems(): for a in v: unit_to_type[a] = k for w in unitdict.iterkeys(): for j in unitdict[w].iterkeys(): if type(unitdict[w][j]) == tuple: unitdict[w][j] = unitdict[w][j][0] value_to_unit[w] = dict(zip(unitdict[w].itervalues(), unitdict[w].iterkeys())) | 04717bf1b9b9ac138edf5b9001954a2a12d3790d /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9417/04717bf1b9b9ac138edf5b9001954a2a12d3790d/units.py |
{'acre':'Defined to be 10 square chains or 4840 square yards.\nApproximately equal to 4046.856 square meters.', 'are':'Defined to be 100 square meters.', 'barn':'Defined to be 100 square femtometers or 10^-28 square meters.', 'hectare':'Defined to be 10000 square meters.', 'rood':'Defined to be 1/4 of an acre.\nApproximately equal to 1011.714 square meters.', 'section':'Equivalent to a square mile.\nApproximately equal to 2.59*10^6 square meters.', 'square_chain':'Defined to be 4356 square feet.\nApproximately equal to 404.9856 square meters.', 'square_meter':'SI derived unit of area.\nDefined to be meter^2.', 'township':'Defined to be 36 square miles.\nApproximately equal to 9.324*10^7 square meters.'}, | {'acre':'Defined to be 10 square chains or 4840 square yards.\nApproximately equal to 4046.856 square meters.', 'are':'Defined to be 100 square meters.', 'barn':'Defined to be 100 square femtometers or 10^-28 square meters.', 'hectare':'Defined to be 10000 square meters.', 'rood':'Defined to be 1/4 of an acre.\nApproximately equal to 1011.714 square meters.', 'section':'Equivalent to a square mile.\nApproximately equal to 2.59*10^6 square meters.', 'square_chain':'Defined to be 4356 square feet.\nApproximately equal to 404.9856 square meters.', 'square_meter':'SI derived unit of area.\nDefined to be meter^2.', 'township':'Defined to be 36 square miles.\nApproximately equal to 9.324*10^7 square meters.'}, | def evalunitdict(): """ Replace all the string values of the unitdict variable by their evaluated forms, and builds some other tables for ease of use. This function is mainly used internally, for efficiency (and flexibility) purposes, making it easier to describe the units. EXAMPLES:: sage: sage.symbolic.units.evalunitdict() """ from sage.misc.all import sage_eval for key, value in unitdict.iteritems(): unitdict[key] = dict([(a,sage_eval(repr(b))) for a, b in value.iteritems()]) # FEATURE IDEA: create a function that would allow users to add # new entries to the table without having to know anything about # how the table is stored internally. # # Format the table for easier use. # for k, v in unitdict.iteritems(): for a in v: unit_to_type[a] = k for w in unitdict.iterkeys(): for j in unitdict[w].iterkeys(): if type(unitdict[w][j]) == tuple: unitdict[w][j] = unitdict[w][j][0] value_to_unit[w] = dict(zip(unitdict[w].itervalues(), unitdict[w].iterkeys())) | 04717bf1b9b9ac138edf5b9001954a2a12d3790d /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9417/04717bf1b9b9ac138edf5b9001954a2a12d3790d/units.py |
{'abfarad':'Defined to be 10^9 farads.', 'farad':'SI derived unit of capacitance.\nDefined to be the charge in coulombs a capacitor will accept for the potential across it to change one volt.\nEquivalent to coulomb/volt.', 'statfarad':'CGS unit defined to be statcoulomb/statvolt.\nApproximately equal to 1.11265*10^-12 farads.'}, | {'abfarad':'Defined to be 10^9 farads.', 'farad':'SI derived unit of capacitance.\nDefined to be the charge in coulombs a capacitor will accept for the potential across it to change one volt.\nEquivalent to coulomb/volt.', 'statfarad':'CGS unit defined to be statcoulomb/statvolt.\nApproximately equal to 1.11265*10^-12 farads.'}, | def evalunitdict(): """ Replace all the string values of the unitdict variable by their evaluated forms, and builds some other tables for ease of use. This function is mainly used internally, for efficiency (and flexibility) purposes, making it easier to describe the units. EXAMPLES:: sage: sage.symbolic.units.evalunitdict() """ from sage.misc.all import sage_eval for key, value in unitdict.iteritems(): unitdict[key] = dict([(a,sage_eval(repr(b))) for a, b in value.iteritems()]) # FEATURE IDEA: create a function that would allow users to add # new entries to the table without having to know anything about # how the table is stored internally. # # Format the table for easier use. # for k, v in unitdict.iteritems(): for a in v: unit_to_type[a] = k for w in unitdict.iterkeys(): for j in unitdict[w].iterkeys(): if type(unitdict[w][j]) == tuple: unitdict[w][j] = unitdict[w][j][0] value_to_unit[w] = dict(zip(unitdict[w].itervalues(), unitdict[w].iterkeys())) | 04717bf1b9b9ac138edf5b9001954a2a12d3790d /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9417/04717bf1b9b9ac138edf5b9001954a2a12d3790d/units.py |
{'abcoulomb':'CGS unit defined to be 10 coulombs.', 'coulomb':'SI derived unit of charge.\nDefined to be the amount of electric charge transported by 1 ampere in 1 second.', 'elementary_charge':'Defined to be the amount of electric charge carried by a single proton or negative charge carried by a single electron.\nApproximately equal to 1.602176462*10^-19 coulombs.', 'faraday':'Defined to be the magnitude of electric charge in one mole of electrons.\nApproximately equal to 96485.3399 coulombs.', 'franklin':'CGS unit defined to be the amount of electric charge necessary such that if two stationary objects placed one centimeter apart had one franklin of charge each they would repel each other with a force of one dyne.\nApproximately equal to 3.3356*10^-10 coulombs.', 'statcoulomb':'Equivalent to franklin.\nApproximately equal to 3.3356*10^-10 coulombs.'}, | {'abcoulomb':'CGS unit defined to be 10 coulombs.', 'coulomb':'SI derived unit of charge.\nDefined to be the amount of electric charge transported by 1 ampere in 1 second.', 'elementary_charge':'Defined to be the amount of electric charge carried by a single proton or negative charge carried by a single electron.\nApproximately equal to 1.602176462*10^-19 coulombs.', 'faraday':'Defined to be the magnitude of electric charge in one mole of electrons.\nApproximately equal to 96485.3399 coulombs.', 'franklin':'CGS unit defined to be the amount of electric charge necessary such that if two stationary objects placed one centimeter apart had one franklin of charge each they would repel each other with a force of one dyne.\nApproximately equal to 3.3356*10^-10 coulombs.', 'statcoulomb':'Equivalent to franklin.\nApproximately equal to 3.3356*10^-10 coulombs.'}, | def evalunitdict(): """ Replace all the string values of the unitdict variable by their evaluated forms, and builds some other tables for ease of use. This function is mainly used internally, for efficiency (and flexibility) purposes, making it easier to describe the units. EXAMPLES:: sage: sage.symbolic.units.evalunitdict() """ from sage.misc.all import sage_eval for key, value in unitdict.iteritems(): unitdict[key] = dict([(a,sage_eval(repr(b))) for a, b in value.iteritems()]) # FEATURE IDEA: create a function that would allow users to add # new entries to the table without having to know anything about # how the table is stored internally. # # Format the table for easier use. # for k, v in unitdict.iteritems(): for a in v: unit_to_type[a] = k for w in unitdict.iterkeys(): for j in unitdict[w].iterkeys(): if type(unitdict[w][j]) == tuple: unitdict[w][j] = unitdict[w][j][0] value_to_unit[w] = dict(zip(unitdict[w].itervalues(), unitdict[w].iterkeys())) | 04717bf1b9b9ac138edf5b9001954a2a12d3790d /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9417/04717bf1b9b9ac138edf5b9001954a2a12d3790d/units.py |
{'abmho':'Defined to be 10^9 siemens.', 'mho':'Equivalent to siemens.', 'siemens':'SI derived unit of conductance.\nDefined to be an ampere per volt or 1/ohm.'}, | {'abmho':'Defined to be 10^9 siemens.', 'mho':'Equivalent to siemens.', 'siemens':'SI derived unit of conductance.\nDefined to be an ampere per volt or 1/ohm.'}, | def evalunitdict(): """ Replace all the string values of the unitdict variable by their evaluated forms, and builds some other tables for ease of use. This function is mainly used internally, for efficiency (and flexibility) purposes, making it easier to describe the units. EXAMPLES:: sage: sage.symbolic.units.evalunitdict() """ from sage.misc.all import sage_eval for key, value in unitdict.iteritems(): unitdict[key] = dict([(a,sage_eval(repr(b))) for a, b in value.iteritems()]) # FEATURE IDEA: create a function that would allow users to add # new entries to the table without having to know anything about # how the table is stored internally. # # Format the table for easier use. # for k, v in unitdict.iteritems(): for a in v: unit_to_type[a] = k for w in unitdict.iterkeys(): for j in unitdict[w].iterkeys(): if type(unitdict[w][j]) == tuple: unitdict[w][j] = unitdict[w][j][0] value_to_unit[w] = dict(zip(unitdict[w].itervalues(), unitdict[w].iterkeys())) | 04717bf1b9b9ac138edf5b9001954a2a12d3790d /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9417/04717bf1b9b9ac138edf5b9001954a2a12d3790d/units.py |
{'abampere':'CGS unit defined to be 10 amperes.', 'amp':'Abbreviation for ampere.', 'ampere':'SI base unit of current.\nDefined to be the constant current which will produce an attractive force of 2*10^-7 newtons per meter between two straight, parallel conductors of infinite length and negligible circular cross section placed one meter apart in free space.', 'biot':'Equivalent to abampere.\nEqual to 10 amperes.', 'statampere':'CGS unit defined to be statcoulomb/second.\nApproximately equal to 3.335641*10^-10 amperes.'}, | {'abampere':'CGS unit defined to be 10 amperes.', 'amp':'Abbreviation for ampere.', 'ampere':'SI base unit of current.\nDefined to be the constant current which will produce an attractive force of 2*10^-7 newtons per meter between two straight, parallel conductors of infinite length and negligible circular cross section placed one meter apart in free space.', 'biot':'Equivalent to abampere.\nEqual to 10 amperes.', 'statampere':'CGS unit defined to be statcoulomb/second.\nApproximately equal to 3.335641*10^-10 amperes.'}, | def evalunitdict(): """ Replace all the string values of the unitdict variable by their evaluated forms, and builds some other tables for ease of use. This function is mainly used internally, for efficiency (and flexibility) purposes, making it easier to describe the units. EXAMPLES:: sage: sage.symbolic.units.evalunitdict() """ from sage.misc.all import sage_eval for key, value in unitdict.iteritems(): unitdict[key] = dict([(a,sage_eval(repr(b))) for a, b in value.iteritems()]) # FEATURE IDEA: create a function that would allow users to add # new entries to the table without having to know anything about # how the table is stored internally. # # Format the table for easier use. # for k, v in unitdict.iteritems(): for a in v: unit_to_type[a] = k for w in unitdict.iterkeys(): for j in unitdict[w].iterkeys(): if type(unitdict[w][j]) == tuple: unitdict[w][j] = unitdict[w][j][0] value_to_unit[w] = dict(zip(unitdict[w].itervalues(), unitdict[w].iterkeys())) | 04717bf1b9b9ac138edf5b9001954a2a12d3790d /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9417/04717bf1b9b9ac138edf5b9001954a2a12d3790d/units.py |
{'abvolt':'Defined to be 10^-8 volts.', 'statvolt':'CGS unit defined to be the speed of light in a vacuum/10^6 volts or approximately 299.792 volts.', 'volt':'SI derived unit of electric potential.\nDefined to be the value of voltage across a conductor when a current of one ampere dissipates one watt of power.'}, | {'abvolt':'Defined to be 10^-8 volts.', 'statvolt':'CGS unit defined to be the speed of light in a vacuum/10^6 volts or approximately 299.792 volts.', 'volt':'SI derived unit of electric potential.\nDefined to be the value of voltage across a conductor when a current of one ampere dissipates one watt of power.'}, | def evalunitdict(): """ Replace all the string values of the unitdict variable by their evaluated forms, and builds some other tables for ease of use. This function is mainly used internally, for efficiency (and flexibility) purposes, making it easier to describe the units. EXAMPLES:: sage: sage.symbolic.units.evalunitdict() """ from sage.misc.all import sage_eval for key, value in unitdict.iteritems(): unitdict[key] = dict([(a,sage_eval(repr(b))) for a, b in value.iteritems()]) # FEATURE IDEA: create a function that would allow users to add # new entries to the table without having to know anything about # how the table is stored internally. # # Format the table for easier use. # for k, v in unitdict.iteritems(): for a in v: unit_to_type[a] = k for w in unitdict.iterkeys(): for j in unitdict[w].iterkeys(): if type(unitdict[w][j]) == tuple: unitdict[w][j] = unitdict[w][j][0] value_to_unit[w] = dict(zip(unitdict[w].itervalues(), unitdict[w].iterkeys())) | 04717bf1b9b9ac138edf5b9001954a2a12d3790d /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9417/04717bf1b9b9ac138edf5b9001954a2a12d3790d/units.py |
{'british_thermal_unit':'Defined to be the amount of energy required to raise the temperature of one pound of liquid water from 60 degrees Fahrenheit to 61 degrees Fahrenheit at a constant pressure of one atmosphere.\nApproximately equal to 1055.05585 joules.', 'btu':'Abbreviation for British thermal unit.\nApproximately equal to 1055.05585 joules.', 'calorie':'Defined to be the amount of energy required to raise the temperature of one gram of liquid water one degree Celsius.\nEqual to 4.1868 joules.', 'electron_volt':'Defined to be the amount of kinetic energy gained by a single unbound electron when it accelerates through an electrostatic potential difference of 1 volt.\nApproximately equal to 1.602*10^-19 joules.', 'erg':'CGS unit for energy defined to be gram*centimeter^2/second^2.\nEqual to 10^-7 joules.', 'ev':'Abbreviation for electron volt.\nApproximately equal to 1.602*10^-19 joules.', 'joule':'SI derived unit of energy.\nDefined to be kilogram*meter^2/second^2.', 'rydberg':'Defined to be the absolute value of the binding energy of the electron in the ground state hydrogen atom.\nApproximately equal to 2.17987*10^-18 joules.', 'therm':'Defined to be 100,000 British thermal units.\nApproximately equal to 1.05505585*10^8 joules.'}, | {'british_thermal_unit':'Defined to be the amount of energy required to raise the temperature of one pound of liquid water from 60 degrees Fahrenheit to 61 degrees Fahrenheit at a constant pressure of one atmosphere.\nApproximately equal to 1055.05585 joules.', 'btu':'Abbreviation for British thermal unit.\nApproximately equal to 1055.05585 joules.', 'calorie':'Defined to be the amount of energy required to raise the temperature of one gram of liquid water one degree Celsius.\nEqual to 4.1868 joules.', 'electron_volt':'Defined to be the amount of kinetic energy gained by a single unbound electron when it accelerates through an electrostatic potential difference of 1 volt.\nApproximately equal to 1.602*10^-19 joules.', 'erg':'CGS unit for energy defined to be gram*centimeter^2/second^2.\nEqual to 10^-7 joules.', 'ev':'Abbreviation for electron volt.\nApproximately equal to 1.602*10^-19 joules.', 'joule':'SI derived unit of energy.\nDefined to be kilogram*meter^2/second^2.', 'rydberg':'Defined to be the absolute value of the binding energy of the electron in the ground state hydrogen atom.\nApproximately equal to 2.17987*10^-18 joules.', 'therm':'Defined to be 100,000 British thermal units.\nApproximately equal to 1.05505585*10^8 joules.'}, | def evalunitdict(): """ Replace all the string values of the unitdict variable by their evaluated forms, and builds some other tables for ease of use. This function is mainly used internally, for efficiency (and flexibility) purposes, making it easier to describe the units. EXAMPLES:: sage: sage.symbolic.units.evalunitdict() """ from sage.misc.all import sage_eval for key, value in unitdict.iteritems(): unitdict[key] = dict([(a,sage_eval(repr(b))) for a, b in value.iteritems()]) # FEATURE IDEA: create a function that would allow users to add # new entries to the table without having to know anything about # how the table is stored internally. # # Format the table for easier use. # for k, v in unitdict.iteritems(): for a in v: unit_to_type[a] = k for w in unitdict.iterkeys(): for j in unitdict[w].iterkeys(): if type(unitdict[w][j]) == tuple: unitdict[w][j] = unitdict[w][j][0] value_to_unit[w] = dict(zip(unitdict[w].itervalues(), unitdict[w].iterkeys())) | 04717bf1b9b9ac138edf5b9001954a2a12d3790d /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9417/04717bf1b9b9ac138edf5b9001954a2a12d3790d/units.py |
{'denier':'Defined to be 1 gram per 9000 meters.\nEqual to 1/9000000 of a kilogram/meter.', 'tex':'Defined to be 1 gram per 1000 meters.\nEqual to 1/1000000 of a kilogram/meter.'}, | {'denier':'Defined to be 1 gram per 9000 meters.\nEqual to 1/9000000 of a kilogram/meter.', 'tex':'Defined to be 1 gram per 1000 meters.\nEqual to 1/1000000 of a kilogram/meter.'}, | def evalunitdict(): """ Replace all the string values of the unitdict variable by their evaluated forms, and builds some other tables for ease of use. This function is mainly used internally, for efficiency (and flexibility) purposes, making it easier to describe the units. EXAMPLES:: sage: sage.symbolic.units.evalunitdict() """ from sage.misc.all import sage_eval for key, value in unitdict.iteritems(): unitdict[key] = dict([(a,sage_eval(repr(b))) for a, b in value.iteritems()]) # FEATURE IDEA: create a function that would allow users to add # new entries to the table without having to know anything about # how the table is stored internally. # # Format the table for easier use. # for k, v in unitdict.iteritems(): for a in v: unit_to_type[a] = k for w in unitdict.iterkeys(): for j in unitdict[w].iterkeys(): if type(unitdict[w][j]) == tuple: unitdict[w][j] = unitdict[w][j][0] value_to_unit[w] = dict(zip(unitdict[w].itervalues(), unitdict[w].iterkeys())) | 04717bf1b9b9ac138edf5b9001954a2a12d3790d /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9417/04717bf1b9b9ac138edf5b9001954a2a12d3790d/units.py |
{'dyne':'CGS unit for force defined to be gram*centimeter/second^2.\nEqual to 10^-5 newtons.', 'gram_weight':'Defined to be the magnitude of the force exerted on one gram of mass by a 9.80665 meter/second^2 gravitational field.\nEqual to 1/1000 of a kilogram weight.\nEqual to 0.00980665 newtons.', 'kilogram_force':'Equivalent to a kilogram weight.\nEqual to 9.80665 newtons.', 'kilogram_weight':'Defined to be the magnitude of the force exerted on one kilogram of mass by a 9.80665 meter/second^2 gravitational field.\nEqual to 9.80665 newtons.', 'newton':'SI derived unit of force.\nDefined to be kilogram*meter/second^2.', 'pound_force':'Equivalent to a pound weight.\nApproximately equal to 4.44822 newtons.', 'pound_weight':'Defined to be the magnitude of the force exerted on one pound of mass by a 9.80665 meter/second^2 gravitational field.\nApproximately equal to 4.44822 newtons.', 'poundal':'Defined to be pound*foot/second^2.\nApproximately equal to 0.13825 newtons.', 'ton_force':'Defined to be the magnitude of the force exerted on one ton of mass (2000 pounds) by a 9.80665 meter/second^2 gravitational field.\nApproximately equal to 8896.4432 newtons.'}, | {'dyne':'CGS unit for force defined to be gram*centimeter/second^2.\nEqual to 10^-5 newtons.', 'gram_weight':'Defined to be the magnitude of the force exerted on one gram of mass by a 9.80665 meter/second^2 gravitational field.\nEqual to 1/1000 of a kilogram weight.\nEqual to 0.00980665 newtons.', 'kilogram_force':'Equivalent to a kilogram weight.\nEqual to 9.80665 newtons.', 'kilogram_weight':'Defined to be the magnitude of the force exerted on one kilogram of mass by a 9.80665 meter/second^2 gravitational field.\nEqual to 9.80665 newtons.', 'newton':'SI derived unit of force.\nDefined to be kilogram*meter/second^2.', 'pound_force':'Equivalent to a pound weight.\nApproximately equal to 4.44822 newtons.', 'pound_weight':'Defined to be the magnitude of the force exerted on one pound of mass by a 9.80665 meter/second^2 gravitational field.\nApproximately equal to 4.44822 newtons.', 'poundal':'Defined to be pound*foot/second^2.\nApproximately equal to 0.13825 newtons.', 'ton_force':'Defined to be the magnitude of the force exerted on one ton of mass (2000 pounds) by a 9.80665 meter/second^2 gravitational field.\nApproximately equal to 8896.4432 newtons.'}, | def evalunitdict(): """ Replace all the string values of the unitdict variable by their evaluated forms, and builds some other tables for ease of use. This function is mainly used internally, for efficiency (and flexibility) purposes, making it easier to describe the units. EXAMPLES:: sage: sage.symbolic.units.evalunitdict() """ from sage.misc.all import sage_eval for key, value in unitdict.iteritems(): unitdict[key] = dict([(a,sage_eval(repr(b))) for a, b in value.iteritems()]) # FEATURE IDEA: create a function that would allow users to add # new entries to the table without having to know anything about # how the table is stored internally. # # Format the table for easier use. # for k, v in unitdict.iteritems(): for a in v: unit_to_type[a] = k for w in unitdict.iterkeys(): for j in unitdict[w].iterkeys(): if type(unitdict[w][j]) == tuple: unitdict[w][j] = unitdict[w][j][0] value_to_unit[w] = dict(zip(unitdict[w].itervalues(), unitdict[w].iterkeys())) | 04717bf1b9b9ac138edf5b9001954a2a12d3790d /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9417/04717bf1b9b9ac138edf5b9001954a2a12d3790d/units.py |
{'hertz':'SI derived unit of frequency.\nDefined to be one complete cycle per second.'}, | {'hertz':'SI derived unit of frequency.\nDefined to be one complete cycle per second.'}, | def evalunitdict(): """ Replace all the string values of the unitdict variable by their evaluated forms, and builds some other tables for ease of use. This function is mainly used internally, for efficiency (and flexibility) purposes, making it easier to describe the units. EXAMPLES:: sage: sage.symbolic.units.evalunitdict() """ from sage.misc.all import sage_eval for key, value in unitdict.iteritems(): unitdict[key] = dict([(a,sage_eval(repr(b))) for a, b in value.iteritems()]) # FEATURE IDEA: create a function that would allow users to add # new entries to the table without having to know anything about # how the table is stored internally. # # Format the table for easier use. # for k, v in unitdict.iteritems(): for a in v: unit_to_type[a] = k for w in unitdict.iterkeys(): for j in unitdict[w].iterkeys(): if type(unitdict[w][j]) == tuple: unitdict[w][j] = unitdict[w][j][0] value_to_unit[w] = dict(zip(unitdict[w].itervalues(), unitdict[w].iterkeys())) | 04717bf1b9b9ac138edf5b9001954a2a12d3790d /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9417/04717bf1b9b9ac138edf5b9001954a2a12d3790d/units.py |
{'foot_candle':'Defined to be lumen/foot^2.\nApproximately equal to 10.764 lux.', 'lux':'SI derived unit of illuminance.\nDefined to be lumen/meter^2.', 'phot':'CGS unit defined to be 10000 lux.'}, | {'foot_candle':'Defined to be lumen/foot^2.\nApproximately equal to 10.764 lux.', 'lux':'SI derived unit of illuminance.\nDefined to be lumen/meter^2.', 'phot':'CGS unit defined to be 10000 lux.'}, | def evalunitdict(): """ Replace all the string values of the unitdict variable by their evaluated forms, and builds some other tables for ease of use. This function is mainly used internally, for efficiency (and flexibility) purposes, making it easier to describe the units. EXAMPLES:: sage: sage.symbolic.units.evalunitdict() """ from sage.misc.all import sage_eval for key, value in unitdict.iteritems(): unitdict[key] = dict([(a,sage_eval(repr(b))) for a, b in value.iteritems()]) # FEATURE IDEA: create a function that would allow users to add # new entries to the table without having to know anything about # how the table is stored internally. # # Format the table for easier use. # for k, v in unitdict.iteritems(): for a in v: unit_to_type[a] = k for w in unitdict.iterkeys(): for j in unitdict[w].iterkeys(): if type(unitdict[w][j]) == tuple: unitdict[w][j] = unitdict[w][j][0] value_to_unit[w] = dict(zip(unitdict[w].itervalues(), unitdict[w].iterkeys())) | 04717bf1b9b9ac138edf5b9001954a2a12d3790d /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9417/04717bf1b9b9ac138edf5b9001954a2a12d3790d/units.py |
{'abhenry':'Defined to be 10^-9 henries.', 'henry':'SI derived unit of inductance./nDefined to be a volt per ampere per second.', 'stathenry':'CGS unit defined to be one statvolt*second/statampere.\nApproximately equal to 8.98758*10^11 henries.'}, | {'abhenry':'Defined to be 10^-9 henries.', 'henry':'SI derived unit of inductance./nDefined to be a volt per ampere per second.', 'stathenry':'CGS unit defined to be one statvolt*second/statampere.\nApproximately equal to 8.98758*10^11 henries.'}, | def evalunitdict(): """ Replace all the string values of the unitdict variable by their evaluated forms, and builds some other tables for ease of use. This function is mainly used internally, for efficiency (and flexibility) purposes, making it easier to describe the units. EXAMPLES:: sage: sage.symbolic.units.evalunitdict() """ from sage.misc.all import sage_eval for key, value in unitdict.iteritems(): unitdict[key] = dict([(a,sage_eval(repr(b))) for a, b in value.iteritems()]) # FEATURE IDEA: create a function that would allow users to add # new entries to the table without having to know anything about # how the table is stored internally. # # Format the table for easier use. # for k, v in unitdict.iteritems(): for a in v: unit_to_type[a] = k for w in unitdict.iterkeys(): for j in unitdict[w].iterkeys(): if type(unitdict[w][j]) == tuple: unitdict[w][j] = unitdict[w][j][0] value_to_unit[w] = dict(zip(unitdict[w].itervalues(), unitdict[w].iterkeys())) | 04717bf1b9b9ac138edf5b9001954a2a12d3790d /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9417/04717bf1b9b9ac138edf5b9001954a2a12d3790d/units.py |
{'bit':'Base unit of information.\nDefined to be the maximum amount of information that can be stored by a device of other physical system that can normally exist in only two distinct states.', 'byte':'Defined to be 8 bits.', 'nibble':'Defined to be 4 bits.'}, | {'bit':'Base unit of information.\nDefined to be the maximum amount of information that can be stored by a device of other physical system that can normally exist in only two distinct states.', 'byte':'Defined to be 8 bits.', 'nibble':'Defined to be 4 bits.'}, | def evalunitdict(): """ Replace all the string values of the unitdict variable by their evaluated forms, and builds some other tables for ease of use. This function is mainly used internally, for efficiency (and flexibility) purposes, making it easier to describe the units. EXAMPLES:: sage: sage.symbolic.units.evalunitdict() """ from sage.misc.all import sage_eval for key, value in unitdict.iteritems(): unitdict[key] = dict([(a,sage_eval(repr(b))) for a, b in value.iteritems()]) # FEATURE IDEA: create a function that would allow users to add # new entries to the table without having to know anything about # how the table is stored internally. # # Format the table for easier use. # for k, v in unitdict.iteritems(): for a in v: unit_to_type[a] = k for w in unitdict.iterkeys(): for j in unitdict[w].iterkeys(): if type(unitdict[w][j]) == tuple: unitdict[w][j] = unitdict[w][j][0] value_to_unit[w] = dict(zip(unitdict[w].itervalues(), unitdict[w].iterkeys())) | 04717bf1b9b9ac138edf5b9001954a2a12d3790d /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9417/04717bf1b9b9ac138edf5b9001954a2a12d3790d/units.py |
{'baud':'Defined to be 1 bit/second.'}, | {'baud':'Defined to be 1 bit/second.'}, | def evalunitdict(): """ Replace all the string values of the unitdict variable by their evaluated forms, and builds some other tables for ease of use. This function is mainly used internally, for efficiency (and flexibility) purposes, making it easier to describe the units. EXAMPLES:: sage: sage.symbolic.units.evalunitdict() """ from sage.misc.all import sage_eval for key, value in unitdict.iteritems(): unitdict[key] = dict([(a,sage_eval(repr(b))) for a, b in value.iteritems()]) # FEATURE IDEA: create a function that would allow users to add # new entries to the table without having to know anything about # how the table is stored internally. # # Format the table for easier use. # for k, v in unitdict.iteritems(): for a in v: unit_to_type[a] = k for w in unitdict.iterkeys(): for j in unitdict[w].iterkeys(): if type(unitdict[w][j]) == tuple: unitdict[w][j] = unitdict[w][j][0] value_to_unit[w] = dict(zip(unitdict[w].itervalues(), unitdict[w].iterkeys())) | 04717bf1b9b9ac138edf5b9001954a2a12d3790d /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9417/04717bf1b9b9ac138edf5b9001954a2a12d3790d/units.py |
{'diopter':'Defined to be 1/meter.', 'kayser':'Defined to be 100/meter.'}, | {'diopter':'Defined to be 1/meter.', 'kayser':'Defined to be 100/meter.'}, | def evalunitdict(): """ Replace all the string values of the unitdict variable by their evaluated forms, and builds some other tables for ease of use. This function is mainly used internally, for efficiency (and flexibility) purposes, making it easier to describe the units. EXAMPLES:: sage: sage.symbolic.units.evalunitdict() """ from sage.misc.all import sage_eval for key, value in unitdict.iteritems(): unitdict[key] = dict([(a,sage_eval(repr(b))) for a, b in value.iteritems()]) # FEATURE IDEA: create a function that would allow users to add # new entries to the table without having to know anything about # how the table is stored internally. # # Format the table for easier use. # for k, v in unitdict.iteritems(): for a in v: unit_to_type[a] = k for w in unitdict.iterkeys(): for j in unitdict[w].iterkeys(): if type(unitdict[w][j]) == tuple: unitdict[w][j] = unitdict[w][j][0] value_to_unit[w] = dict(zip(unitdict[w].itervalues(), unitdict[w].iterkeys())) | 04717bf1b9b9ac138edf5b9001954a2a12d3790d /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9417/04717bf1b9b9ac138edf5b9001954a2a12d3790d/units.py |
{'angstrom':'Defined to be 10^-10 meters.', 'astronomical_unit':'Originally defined as the length of the semi-major axis of the elliptical orbit of the Earth around the Sun.\nRedefined for accuracy to be the radius of an unperturbed circular Newtonian orbit about the Sun of a particle having infinitesimal mass, moving with a mean motion of 0.01720209895 radians per day.\nApproximately equal to 1.496*10^11 meters.', 'bolt':'Defined to be 40 yards.\nEqual to 36.576 meters.', 'cable_international':'Nautical unit defined to be 1/10 of a nautical mile.\nEqual to 185.2 meters.', 'cable_us':'Nautical unit defined to be equal to 720 feet or 120 fathoms.\nEqual to 219.456 meters.', 'caliber':'Equal to 1/100 of an inch.\nEqual to 0.000254 meters.', 'centimeter':'Equal to 1/100 of a meter.', 'chain':'Surveying unit defined to be 66 feet.\nApproximately equal to 20.12 meters.', 'cicero':'Printing unit defined to be 12 didot points.\nApproximately equal to 0.004512 meters.', 'cubit':'Ancient unit of length defined to be 18 inches.\nEqual to 0.4572 meters.', 'didot':'Printing unit equal to 1/12 of a cicero.\nApproximately equal to 0.00037597 meters.', 'dtp_point':'The desktop publishing point is defined to be 1/72 of an inch.\nApproximately equal to 0.0003528 meters.', 'ell':'Ancient unit of length defined to be 45 inches.\nEqual to 1.143 meters.', 'fathom':'Nautical unit defined to be 6 feet.\nEqual to 1.8288 meters.', 'feet':'Equal to 12 inches.\nDefined to be 0.3048 meters.', 'fermi':'Equivalent to a femtometer.\nEqual to 10^-15 meters.', 'foot':'Equal to 12 inches.\nDefined to be 0.3048 meters.', 'furlong':'Defined to be 660 feet, or 1/8 of a mile.\nEqual to 201.168 meters.', 'hand':'Defined to be 4 inches.\nEqual to 0.1016 meters.', 'inch':'Equal to 1/12 of a foot.\nEqual to 0.0254 meters.', 'league':'Defined to be 3 miles.\nConventionally equal to the distance a person or horse can walk in one hour.\nEqual to 4828.032 meters.', 'light_year':'Defined to be the distance light travels in vacuum in 365.25 days.\nApproximately equal to 9.4607*10^15 meters.', 'link':'Surveying unit defined to be 1/100 of a chain.\nEqual to 0.201168 meters.', 'meter':'SI base unit of length.\nDefined to be the distance light travels in vacuum in 1/299792458 of a second.', 'micron':'Defined to be 10^-6 meters.', 'mil':'Defined to be 1/1000 of an inch.\nEqual to 0.0000254 meters.', 'mile':'Defined to be 5280 feet.\nEqual to 1609.344 meters.', 'nautical_mile':'Nautical unit defined to be 1852 meters.', 'parsec':'Defined to be the length of the adjacent side of a right triangle whose angle is 1 arcsecond and opposite side equal to 1 astronomical unit, or 1 AU/arctan(1 arcsecond).\nApproximately equal to 30.857*10^15 meters.', 'perch':'Equivalent to rod.\nDefined to be 16.5 feet.\nEqual to 5.0292 meters.', 'pica':'Printing unit defined to be 12 dtp points.\nEqual to 1/72 of a foot.\nApproximately equal to 0.004233 meters.', 'pole':'Equivalent to rod.\nDefined to be 16.5 feet.\nEqual to 5.0292 meters.', 'rod':'Defined to be 16.5 feet.\nEqual to 5.0292 meters.', 'rope':'Defined to be 20 feet.\nEqual to 6.096 meters.', 'skein':'Defined to be 360 feet.\nEqual to 109.728 meters.', 'stadion':'Ancient unit of length defined to be 622 feet.\nEqual to 189.5856 meters.', 'stadium':'Defined to be 202 yards or 606 feet.\nEqual to 184.7088 meters.', 'statute_mile':'Equivalent to mile.\nDefined to be 5280 feet.\nEqual to 1609.344 meters.', 'survey_foot':'Defined to be 1200/3937 or approximately 0.3048006 meters.', 'survey_mile':'Defined to be 5280 survey feet.\nApproximately equal to 1609.347 meters.', 'x_unit':'Unit of length used to quote wavelengths of X-rays and gamma rays.\nApproximately equal to 1.0021*10^-13 meters.', 'yard':'Defined to be 3 feet.\nEqual to 0.9144 meters.'}, | {'angstrom':'Defined to be 10^-10 meters.', 'astronomical_unit':'Originally defined as the length of the semi-major axis of the elliptical orbit of the Earth around the Sun.\nRedefined for accuracy to be the radius of an unperturbed circular Newtonian orbit about the Sun of a particle having infinitesimal mass, moving with a mean motion of 0.01720209895 radians per day.\nApproximately equal to 1.496*10^11 meters.', 'bolt':'Defined to be 40 yards.\nEqual to 36.576 meters.', 'cable_international':'Nautical unit defined to be 1/10 of a nautical mile.\nEqual to 185.2 meters.', 'cable_us':'Nautical unit defined to be equal to 720 feet or 120 fathoms.\nEqual to 219.456 meters.', 'caliber':'Equal to 1/100 of an inch.\nEqual to 0.000254 meters.', 'centimeter':'Equal to 1/100 of a meter.', 'chain':'Surveying unit defined to be 66 feet.\nApproximately equal to 20.12 meters.', 'cicero':'Printing unit defined to be 12 didot points.\nApproximately equal to 0.004512 meters.', 'cubit':'Ancient unit of length defined to be 18 inches.\nEqual to 0.4572 meters.', 'didot':'Printing unit equal to 1/12 of a cicero.\nApproximately equal to 0.00037597 meters.', 'dtp_point':'The desktop publishing point is defined to be 1/72 of an inch.\nApproximately equal to 0.0003528 meters.', 'ell':'Ancient unit of length defined to be 45 inches.\nEqual to 1.143 meters.', 'fathom':'Nautical unit defined to be 6 feet.\nEqual to 1.8288 meters.', 'feet':'Equal to 12 inches.\nDefined to be 0.3048 meters.', 'fermi':'Equivalent to a femtometer.\nEqual to 10^-15 meters.', 'foot':'Equal to 12 inches.\nDefined to be 0.3048 meters.', 'furlong':'Defined to be 660 feet, or 1/8 of a mile.\nEqual to 201.168 meters.', 'hand':'Defined to be 4 inches.\nEqual to 0.1016 meters.', 'inch':'Equal to 1/12 of a foot.\nEqual to 0.0254 meters.', 'league':'Defined to be 3 miles.\nConventionally equal to the distance a person or horse can walk in one hour.\nEqual to 4828.032 meters.', 'light_year':'Defined to be the distance light travels in vacuum in 365.25 days.\nApproximately equal to 9.4607*10^15 meters.', 'link':'Surveying unit defined to be 1/100 of a chain.\nEqual to 0.201168 meters.', 'meter':'SI base unit of length.\nDefined to be the distance light travels in vacuum in 1/299792458 of a second.', 'micron':'Defined to be 10^-6 meters.', 'mil':'Defined to be 1/1000 of an inch.\nEqual to 0.0000254 meters.', 'mile':'Defined to be 5280 feet.\nEqual to 1609.344 meters.', 'nautical_mile':'Nautical unit defined to be 1852 meters.', 'parsec':'Defined to be the length of the adjacent side of a right triangle whose angle is 1 arcsecond and opposite side equal to 1 astronomical unit, or 1 AU/arctan(1 arcsecond).\nApproximately equal to 30.857*10^15 meters.', 'perch':'Equivalent to rod.\nDefined to be 16.5 feet.\nEqual to 5.0292 meters.', 'pica':'Printing unit defined to be 12 dtp points.\nEqual to 1/72 of a foot.\nApproximately equal to 0.004233 meters.', 'pole':'Equivalent to rod.\nDefined to be 16.5 feet.\nEqual to 5.0292 meters.', 'rod':'Defined to be 16.5 feet.\nEqual to 5.0292 meters.', 'rope':'Defined to be 20 feet.\nEqual to 6.096 meters.', 'skein':'Defined to be 360 feet.\nEqual to 109.728 meters.', 'stadion':'Ancient unit of length defined to be 622 feet.\nEqual to 189.5856 meters.', 'stadium':'Defined to be 202 yards or 606 feet.\nEqual to 184.7088 meters.', 'statute_mile':'Equivalent to mile.\nDefined to be 5280 feet.\nEqual to 1609.344 meters.', 'survey_foot':'Defined to be 1200/3937 or approximately 0.3048006 meters.', 'survey_mile':'Defined to be 5280 survey feet.\nApproximately equal to 1609.347 meters.', 'x_unit':'Unit of length used to quote wavelengths of X-rays and gamma rays.\nApproximately equal to 1.0021*10^-13 meters.', 'yard':'Defined to be 3 feet.\nEqual to 0.9144 meters.'}, | def evalunitdict(): """ Replace all the string values of the unitdict variable by their evaluated forms, and builds some other tables for ease of use. This function is mainly used internally, for efficiency (and flexibility) purposes, making it easier to describe the units. EXAMPLES:: sage: sage.symbolic.units.evalunitdict() """ from sage.misc.all import sage_eval for key, value in unitdict.iteritems(): unitdict[key] = dict([(a,sage_eval(repr(b))) for a, b in value.iteritems()]) # FEATURE IDEA: create a function that would allow users to add # new entries to the table without having to know anything about # how the table is stored internally. # # Format the table for easier use. # for k, v in unitdict.iteritems(): for a in v: unit_to_type[a] = k for w in unitdict.iterkeys(): for j in unitdict[w].iterkeys(): if type(unitdict[w][j]) == tuple: unitdict[w][j] = unitdict[w][j][0] value_to_unit[w] = dict(zip(unitdict[w].itervalues(), unitdict[w].iterkeys())) | 04717bf1b9b9ac138edf5b9001954a2a12d3790d /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9417/04717bf1b9b9ac138edf5b9001954a2a12d3790d/units.py |
{'apostilb':'Defined to be 10^-4 lamberts.\nEqual to 1/pi*candela/meter^2.', 'lambert':'Defined to be 10^4/pi candela/meter^2.', 'nit':'Equivalent to candela/meter^2.', 'stilb':'CGS unit equal to 10000 candela/meter^2.'}, | {'apostilb':'Defined to be 10^-4 lamberts.\nEqual to 1/pi*candela/meter^2.', 'lambert':'Defined to be 10^4/pi candela/meter^2.', 'nit':'Equivalent to candela/meter^2.', 'stilb':'CGS unit equal to 10000 candela/meter^2.'}, | def evalunitdict(): """ Replace all the string values of the unitdict variable by their evaluated forms, and builds some other tables for ease of use. This function is mainly used internally, for efficiency (and flexibility) purposes, making it easier to describe the units. EXAMPLES:: sage: sage.symbolic.units.evalunitdict() """ from sage.misc.all import sage_eval for key, value in unitdict.iteritems(): unitdict[key] = dict([(a,sage_eval(repr(b))) for a, b in value.iteritems()]) # FEATURE IDEA: create a function that would allow users to add # new entries to the table without having to know anything about # how the table is stored internally. # # Format the table for easier use. # for k, v in unitdict.iteritems(): for a in v: unit_to_type[a] = k for w in unitdict.iterkeys(): for j in unitdict[w].iterkeys(): if type(unitdict[w][j]) == tuple: unitdict[w][j] = unitdict[w][j][0] value_to_unit[w] = dict(zip(unitdict[w].itervalues(), unitdict[w].iterkeys())) | 04717bf1b9b9ac138edf5b9001954a2a12d3790d /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9417/04717bf1b9b9ac138edf5b9001954a2a12d3790d/units.py |
{'lumerg':'Equivalent to lumen*second', 'talbot':'Equivalent to lumen*second.'}, | {'lumerg':'Equivalent to lumen*second', 'talbot':'Equivalent to lumen*second.'}, | def evalunitdict(): """ Replace all the string values of the unitdict variable by their evaluated forms, and builds some other tables for ease of use. This function is mainly used internally, for efficiency (and flexibility) purposes, making it easier to describe the units. EXAMPLES:: sage: sage.symbolic.units.evalunitdict() """ from sage.misc.all import sage_eval for key, value in unitdict.iteritems(): unitdict[key] = dict([(a,sage_eval(repr(b))) for a, b in value.iteritems()]) # FEATURE IDEA: create a function that would allow users to add # new entries to the table without having to know anything about # how the table is stored internally. # # Format the table for easier use. # for k, v in unitdict.iteritems(): for a in v: unit_to_type[a] = k for w in unitdict.iterkeys(): for j in unitdict[w].iterkeys(): if type(unitdict[w][j]) == tuple: unitdict[w][j] = unitdict[w][j][0] value_to_unit[w] = dict(zip(unitdict[w].itervalues(), unitdict[w].iterkeys())) | 04717bf1b9b9ac138edf5b9001954a2a12d3790d /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9417/04717bf1b9b9ac138edf5b9001954a2a12d3790d/units.py |
{'lumen':'SI derived unit of luminous flux.\nDefined to be candela*steradian.'}, | {'lumen':'SI derived unit of luminous flux.\nDefined to be candela*steradian.'}, | def evalunitdict(): """ Replace all the string values of the unitdict variable by their evaluated forms, and builds some other tables for ease of use. This function is mainly used internally, for efficiency (and flexibility) purposes, making it easier to describe the units. EXAMPLES:: sage: sage.symbolic.units.evalunitdict() """ from sage.misc.all import sage_eval for key, value in unitdict.iteritems(): unitdict[key] = dict([(a,sage_eval(repr(b))) for a, b in value.iteritems()]) # FEATURE IDEA: create a function that would allow users to add # new entries to the table without having to know anything about # how the table is stored internally. # # Format the table for easier use. # for k, v in unitdict.iteritems(): for a in v: unit_to_type[a] = k for w in unitdict.iterkeys(): for j in unitdict[w].iterkeys(): if type(unitdict[w][j]) == tuple: unitdict[w][j] = unitdict[w][j][0] value_to_unit[w] = dict(zip(unitdict[w].itervalues(), unitdict[w].iterkeys())) | 04717bf1b9b9ac138edf5b9001954a2a12d3790d /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9417/04717bf1b9b9ac138edf5b9001954a2a12d3790d/units.py |
{'candela':'SI base unit of luminous intensity.\nDefined to be the luminous intensity, in a given direction, of a source that emits monochromatic radiation of frequency 540*10^12 hertz and that has a radiant intensity in that direction of 1\xe2\x81\x84683 watt per steradian.', 'candle':'Equivalent to candela.', 'hefnerkerze':'Old German unit defined to be a 8 millimeter wick burning amyl acetate with a flame height of 40 millimeters.\nApproximately equal to 0.9034 candelas.'}, | {'candela':'SI base unit of luminous intensity.\nDefined to be the luminous intensity, in a given direction, of a source that emits monochromatic radiation of frequency 540*10^12 hertz and that has a radiant intensity in that direction of 1\xe2\x81\x84683 watt per steradian.', 'candle':'Equivalent to candela.', 'hefnerkerze':'Old German unit defined to be a 8 millimeter wick burning amyl acetate with a flame height of 40 millimeters.\nApproximately equal to 0.9034 candelas.'}, | def evalunitdict(): """ Replace all the string values of the unitdict variable by their evaluated forms, and builds some other tables for ease of use. This function is mainly used internally, for efficiency (and flexibility) purposes, making it easier to describe the units. EXAMPLES:: sage: sage.symbolic.units.evalunitdict() """ from sage.misc.all import sage_eval for key, value in unitdict.iteritems(): unitdict[key] = dict([(a,sage_eval(repr(b))) for a, b in value.iteritems()]) # FEATURE IDEA: create a function that would allow users to add # new entries to the table without having to know anything about # how the table is stored internally. # # Format the table for easier use. # for k, v in unitdict.iteritems(): for a in v: unit_to_type[a] = k for w in unitdict.iterkeys(): for j in unitdict[w].iterkeys(): if type(unitdict[w][j]) == tuple: unitdict[w][j] = unitdict[w][j][0] value_to_unit[w] = dict(zip(unitdict[w].itervalues(), unitdict[w].iterkeys())) | 04717bf1b9b9ac138edf5b9001954a2a12d3790d /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9417/04717bf1b9b9ac138edf5b9001954a2a12d3790d/units.py |
{'gauss':'CGS unit defined to be a maxwell/centimeter^2.\nEqual to 1/10000 of a tesla.', 'tesla':'SI derived unit of magnetic field.\nDefined to be the magnitude of a magnetic field such that a particle with a charge of 1 coulomb passing through that field at 1 meter/second will experience a force of 1 newton.'}, | {'gauss':'CGS unit defined to be a maxwell/centimeter^2.\nEqual to 1/10000 of a tesla.', 'tesla':'SI derived unit of magnetic field.\nDefined to be the magnitude of a magnetic field such that a particle with a charge of 1 coulomb passing through that field at 1 meter/second will experience a force of 1 newton.'}, | def evalunitdict(): """ Replace all the string values of the unitdict variable by their evaluated forms, and builds some other tables for ease of use. This function is mainly used internally, for efficiency (and flexibility) purposes, making it easier to describe the units. EXAMPLES:: sage: sage.symbolic.units.evalunitdict() """ from sage.misc.all import sage_eval for key, value in unitdict.iteritems(): unitdict[key] = dict([(a,sage_eval(repr(b))) for a, b in value.iteritems()]) # FEATURE IDEA: create a function that would allow users to add # new entries to the table without having to know anything about # how the table is stored internally. # # Format the table for easier use. # for k, v in unitdict.iteritems(): for a in v: unit_to_type[a] = k for w in unitdict.iterkeys(): for j in unitdict[w].iterkeys(): if type(unitdict[w][j]) == tuple: unitdict[w][j] = unitdict[w][j][0] value_to_unit[w] = dict(zip(unitdict[w].itervalues(), unitdict[w].iterkeys())) | 04717bf1b9b9ac138edf5b9001954a2a12d3790d /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9417/04717bf1b9b9ac138edf5b9001954a2a12d3790d/units.py |
{'maxwell':'CGS unit defined to be a gauss*centimeter^2 or 10^-8 webers.', 'weber':'SI derived unit of magnetic flux.\nDefined to be a change in magnetic flux of 1 weber per second will induce an electromotive force of 1 volt.'}, | {'maxwell':'CGS unit defined to be a gauss*centimeter^2 or 10^-8 webers.', 'weber':'SI derived unit of magnetic flux.\nDefined to be a change in magnetic flux of 1 weber per second will induce an electromotive force of 1 volt.'}, | def evalunitdict(): """ Replace all the string values of the unitdict variable by their evaluated forms, and builds some other tables for ease of use. This function is mainly used internally, for efficiency (and flexibility) purposes, making it easier to describe the units. EXAMPLES:: sage: sage.symbolic.units.evalunitdict() """ from sage.misc.all import sage_eval for key, value in unitdict.iteritems(): unitdict[key] = dict([(a,sage_eval(repr(b))) for a, b in value.iteritems()]) # FEATURE IDEA: create a function that would allow users to add # new entries to the table without having to know anything about # how the table is stored internally. # # Format the table for easier use. # for k, v in unitdict.iteritems(): for a in v: unit_to_type[a] = k for w in unitdict.iterkeys(): for j in unitdict[w].iterkeys(): if type(unitdict[w][j]) == tuple: unitdict[w][j] = unitdict[w][j][0] value_to_unit[w] = dict(zip(unitdict[w].itervalues(), unitdict[w].iterkeys())) | 04717bf1b9b9ac138edf5b9001954a2a12d3790d /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9417/04717bf1b9b9ac138edf5b9001954a2a12d3790d/units.py |
{'oersted':'CGS unit defined to be 1000/(4*pi) amperes per meter of flux path.'}, | {'oersted':'CGS unit defined to be 1000/(4*pi) amperes per meter of flux path.'}, | def evalunitdict(): """ Replace all the string values of the unitdict variable by their evaluated forms, and builds some other tables for ease of use. This function is mainly used internally, for efficiency (and flexibility) purposes, making it easier to describe the units. EXAMPLES:: sage: sage.symbolic.units.evalunitdict() """ from sage.misc.all import sage_eval for key, value in unitdict.iteritems(): unitdict[key] = dict([(a,sage_eval(repr(b))) for a, b in value.iteritems()]) # FEATURE IDEA: create a function that would allow users to add # new entries to the table without having to know anything about # how the table is stored internally. # # Format the table for easier use. # for k, v in unitdict.iteritems(): for a in v: unit_to_type[a] = k for w in unitdict.iterkeys(): for j in unitdict[w].iterkeys(): if type(unitdict[w][j]) == tuple: unitdict[w][j] = unitdict[w][j][0] value_to_unit[w] = dict(zip(unitdict[w].itervalues(), unitdict[w].iterkeys())) | 04717bf1b9b9ac138edf5b9001954a2a12d3790d /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9417/04717bf1b9b9ac138edf5b9001954a2a12d3790d/units.py |
{'bohr_magneton':'Physical constant defined to be the magnetic moment of an electron, or elementary_charge*h_bar/2*electron_rest_mass.\nApproximately equal to 9.274*10^-24 joules/tesla.', 'nuclear_magneton':'Physical constant defined to be the magnetic moment of a proton, or elementary_charge*h_bar/2*proton_rest_mass.\nApproximately equal to 5.05078324*10^-27 joules/tesla.'}, | {'bohr_magneton':'Physical constant defined to be the magnetic moment of an electron, or elementary_charge*h_bar/2*electron_rest_mass.\nApproximately equal to 9.274*10^-24 joules/tesla.', 'nuclear_magneton':'Physical constant defined to be the magnetic moment of a proton, or elementary_charge*h_bar/2*proton_rest_mass.\nApproximately equal to 5.05078324*10^-27 joules/tesla.'}, | def evalunitdict(): """ Replace all the string values of the unitdict variable by their evaluated forms, and builds some other tables for ease of use. This function is mainly used internally, for efficiency (and flexibility) purposes, making it easier to describe the units. EXAMPLES:: sage: sage.symbolic.units.evalunitdict() """ from sage.misc.all import sage_eval for key, value in unitdict.iteritems(): unitdict[key] = dict([(a,sage_eval(repr(b))) for a, b in value.iteritems()]) # FEATURE IDEA: create a function that would allow users to add # new entries to the table without having to know anything about # how the table is stored internally. # # Format the table for easier use. # for k, v in unitdict.iteritems(): for a in v: unit_to_type[a] = k for w in unitdict.iterkeys(): for j in unitdict[w].iterkeys(): if type(unitdict[w][j]) == tuple: unitdict[w][j] = unitdict[w][j][0] value_to_unit[w] = dict(zip(unitdict[w].itervalues(), unitdict[w].iterkeys())) | 04717bf1b9b9ac138edf5b9001954a2a12d3790d /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9417/04717bf1b9b9ac138edf5b9001954a2a12d3790d/units.py |
{'ampere_turn':'SI derived unit of magnetomotive force.\nDefined to be a direct current of 1 ampere flowing through a single turn loop in a vacuum.', 'gilbert':'CGS unit defined to be 10/(4*pi) ampere turns.'}, | {'ampere_turn':'SI derived unit of magnetomotive force.\nDefined to be a direct current of 1 ampere flowing through a single turn loop in a vacuum.', 'gilbert':'CGS unit defined to be 10/(4*pi) ampere turns.'}, | def evalunitdict(): """ Replace all the string values of the unitdict variable by their evaluated forms, and builds some other tables for ease of use. This function is mainly used internally, for efficiency (and flexibility) purposes, making it easier to describe the units. EXAMPLES:: sage: sage.symbolic.units.evalunitdict() """ from sage.misc.all import sage_eval for key, value in unitdict.iteritems(): unitdict[key] = dict([(a,sage_eval(repr(b))) for a, b in value.iteritems()]) # FEATURE IDEA: create a function that would allow users to add # new entries to the table without having to know anything about # how the table is stored internally. # # Format the table for easier use. # for k, v in unitdict.iteritems(): for a in v: unit_to_type[a] = k for w in unitdict.iterkeys(): for j in unitdict[w].iterkeys(): if type(unitdict[w][j]) == tuple: unitdict[w][j] = unitdict[w][j][0] value_to_unit[w] = dict(zip(unitdict[w].itervalues(), unitdict[w].iterkeys())) | 04717bf1b9b9ac138edf5b9001954a2a12d3790d /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9417/04717bf1b9b9ac138edf5b9001954a2a12d3790d/units.py |
{'amu':'Abbreviation for atomic mass unit.\nApproximately equal to 1.660538782*10^-27 kilograms.', 'assay_ton':'Defined to be milligram*short_ton/ounce_troy.\nEqual to 7/240 of a kilogram.', 'atomic_mass_unit':'Defined to be one twelfth of the mass of an isolated atom of carbon-12 at rest and in its ground state.\nApproximately equal to 1.660538782*10^-27 kilograms.', 'avoirdupois_ounce':'Equivalent to ounce.\nEqual to 1/16 of an avoirdupois pound.\nApproximately equal to 0.02835 kilograms.', 'avoirdupois_pound':'Equivalent to pound.\nEqual to 16 avoirdupois ounces.\nApproximately equal to 0.45359 kilograms.', 'bale':'Equal to 500 pounds.\nApproximately equal to 226.796 kilograms.', 'carat':'Defined to be equal to 200 milligrams.\nCommonly denoted ct.', 'cental':'Equal to 100 pounds.\nApproximately equal to 45.36 kilograms.', 'dalton':'Equivalent to atomic_mass_unit.\nApproximately equal to 1.660538782*10^-27 kilograms.', 'drachma':'Ancient Greek unit of mass.\nEqual to 6 obols.\nApproximately equal to 0.00429234 kilograms.', 'geepound':'Equivalent to slug.\nApproximately equal to 14.5939 kilograms.', 'grain':'Historically based on the average mass of a single seed of a typical cereal.\nDefined in 1958 to be 64.79891 milligrams.', 'gram':'Equal to 0.0001 kilograms.', 'gross_hundredweight':'Equivalent to hundredweight.\nEqual to 112 pounds.\nApproximately equal to 50.802 kilograms.', 'hundredweight':'Defined to be 112 pounds.\nApproximately equal to 50.802 kilograms.', 'kilogram':'SI base unit of mass.\nDefined to be equal to the mass of the International Prototype Kilogram.\nAlmost exactly equal to the amount of mass in one liter of water.', 'libra':'Ancient Roman unit of mass.\nApproximately equal to 0.325971 kilogram.', 'long_ton':'Defined to be 2240 pounds.\nApproximately equal to 1016.05 kilograms.', 'metric_ton':'Defined to be 1000 kilograms.', 'mina':'Ancient Greek unit of mass.\nEqual to 100 drachma.\nApproximately equal to 0.429234 kilograms.', 'net_hundredweight':'Equivalent to cental.\nEqual to 100 pounds.\nApproximately equal to 45.36 kilograms.', 'obol':'Ancient Greek unit of mass.\nEqual to 1/6 of drachma.\nApproximately equal to 0.00071538 kilograms.', 'ounce':'Equal to 1/16 of pound.\nCommonly abbreviated oz.\nApproximately equal to 0.02835 kilograms.', 'ounce_troy':'Equal to 1/12 of pound_troy.\nApproximately equal to 0.031103 kilograms.', 'pennyweight':'Equal to 1/20 of ounce_troy.\nCommonly abbreviated dwt.\nApproximately equal to 0.001555 kilograms.', 'pondus':'Ancient Roman unit of mass.\nApproximately equal to 0.325969 kilograms.', 'pound':'Equal to 16 ounces.\nDefined to be exactly 0.45359237 kilograms.', 'pound_troy':'Equal to 12 ounce_troy.\nApproximately equal to 0.37324 kilograms.', 'quintal':'Equal to 100 kilograms.', 'shekel':'Ancient Hebrew unit of mass.\nApproximately equal to 0.0141 kilograms.', 'short_hundredweight':'Equivalent to cental.\nEqual to 100 pounds.\nApproximately equal to 45.36 kilograms.', 'short_ton':'Equivalent to ton.\nEqual to 2000 pounds.\nApproximately equal to 907.18 kilograms.', 'slug':'Defined to be a mass that is accelerated 1 ft/s^2 when 1 pound_force is exerted on it.\nApproximately equal to 14.5939 kilograms.', 'solar_mass':'Defined to be the mass of the Sun.\nAbout 332,950 times the size of the Earth or 1,048 times the mass of Jupiter.\nApproximately equal to 1.98892*10^30 kilograms.', 'stone':'Defined to be 14 pounds.\nApproximately equal to 6.35 kilograms.', 'talent':'Ancient Greek unit of mass.\nEqual to 6000 drachmae.\nApproximately equal to 25.754 kilograms.', 'ton':'Equal to 2000 pounds.\nApproximately equal to 907.18 kilograms.', 'tonne':'Equivalent to metric_ton.\nDefined to be 1000 kilograms.', 'wey':'Defined to be 252 pounds.\nApproximately equal to 114.305 kilograms.'}, | {'amu':'Abbreviation for atomic mass unit.\nApproximately equal to 1.660538782*10^-27 kilograms.', 'assay_ton':'Defined to be milligram*short_ton/ounce_troy.\nEqual to 7/240 of a kilogram.', 'atomic_mass_unit':'Defined to be one twelfth of the mass of an isolated atom of carbon-12 at rest and in its ground state.\nApproximately equal to 1.660538782*10^-27 kilograms.', 'avoirdupois_ounce':'Equivalent to ounce.\nEqual to 1/16 of an avoirdupois pound.\nApproximately equal to 0.02835 kilograms.', 'avoirdupois_pound':'Equivalent to pound.\nEqual to 16 avoirdupois ounces.\nApproximately equal to 0.45359 kilograms.', 'bale':'Equal to 500 pounds.\nApproximately equal to 226.796 kilograms.', 'carat':'Defined to be equal to 200 milligrams.\nCommonly denoted ct.', 'cental':'Equal to 100 pounds.\nApproximately equal to 45.36 kilograms.', 'dalton':'Equivalent to atomic_mass_unit.\nApproximately equal to 1.660538782*10^-27 kilograms.', 'drachma':'Ancient Greek unit of mass.\nEqual to 6 obols.\nApproximately equal to 0.00429234 kilograms.', 'geepound':'Equivalent to slug.\nApproximately equal to 14.5939 kilograms.', 'grain':'Historically based on the average mass of a single seed of a typical cereal.\nDefined in 1958 to be 64.79891 milligrams.', 'gram':'Equal to 0.0001 kilograms.', 'gross_hundredweight':'Equivalent to hundredweight.\nEqual to 112 pounds.\nApproximately equal to 50.802 kilograms.', 'hundredweight':'Defined to be 112 pounds.\nApproximately equal to 50.802 kilograms.', 'kilogram':'SI base unit of mass.\nDefined to be equal to the mass of the International Prototype Kilogram.\nAlmost exactly equal to the amount of mass in one liter of water.', 'libra':'Ancient Roman unit of mass.\nApproximately equal to 0.325971 kilogram.', 'long_ton':'Defined to be 2240 pounds.\nApproximately equal to 1016.05 kilograms.', 'metric_ton':'Defined to be 1000 kilograms.', 'mina':'Ancient Greek unit of mass.\nEqual to 100 drachma.\nApproximately equal to 0.429234 kilograms.', 'net_hundredweight':'Equivalent to cental.\nEqual to 100 pounds.\nApproximately equal to 45.36 kilograms.', 'obol':'Ancient Greek unit of mass.\nEqual to 1/6 of drachma.\nApproximately equal to 0.00071538 kilograms.', 'ounce':'Equal to 1/16 of pound.\nCommonly abbreviated oz.\nApproximately equal to 0.02835 kilograms.', 'ounce_troy':'Equal to 1/12 of pound_troy.\nApproximately equal to 0.031103 kilograms.', 'pennyweight':'Equal to 1/20 of ounce_troy.\nCommonly abbreviated dwt.\nApproximately equal to 0.001555 kilograms.', 'pondus':'Ancient Roman unit of mass.\nApproximately equal to 0.325969 kilograms.', 'pound':'Equal to 16 ounces.\nDefined to be exactly 0.45359237 kilograms.', 'pound_troy':'Equal to 12 ounce_troy.\nApproximately equal to 0.37324 kilograms.', 'quintal':'Equal to 100 kilograms.', 'shekel':'Ancient Hebrew unit of mass.\nApproximately equal to 0.0141 kilograms.', 'short_hundredweight':'Equivalent to cental.\nEqual to 100 pounds.\nApproximately equal to 45.36 kilograms.', 'short_ton':'Equivalent to ton.\nEqual to 2000 pounds.\nApproximately equal to 907.18 kilograms.', 'slug':'Defined to be a mass that is accelerated 1 ft/s^2 when 1 pound_force is exerted on it.\nApproximately equal to 14.5939 kilograms.', 'solar_mass':'Defined to be the mass of the Sun.\nAbout 332,950 times the size of the Earth or 1,048 times the mass of Jupiter.\nApproximately equal to 1.98892*10^30 kilograms.', 'stone':'Defined to be 14 pounds.\nApproximately equal to 6.35 kilograms.', 'talent':'Ancient Greek unit of mass.\nEqual to 6000 drachmae.\nApproximately equal to 25.754 kilograms.', 'ton':'Equal to 2000 pounds.\nApproximately equal to 907.18 kilograms.', 'tonne':'Equivalent to metric_ton.\nDefined to be 1000 kilograms.', 'wey':'Defined to be 252 pounds.\nApproximately equal to 114.305 kilograms.'}, | def evalunitdict(): """ Replace all the string values of the unitdict variable by their evaluated forms, and builds some other tables for ease of use. This function is mainly used internally, for efficiency (and flexibility) purposes, making it easier to describe the units. EXAMPLES:: sage: sage.symbolic.units.evalunitdict() """ from sage.misc.all import sage_eval for key, value in unitdict.iteritems(): unitdict[key] = dict([(a,sage_eval(repr(b))) for a, b in value.iteritems()]) # FEATURE IDEA: create a function that would allow users to add # new entries to the table without having to know anything about # how the table is stored internally. # # Format the table for easier use. # for k, v in unitdict.iteritems(): for a in v: unit_to_type[a] = k for w in unitdict.iterkeys(): for j in unitdict[w].iterkeys(): if type(unitdict[w][j]) == tuple: unitdict[w][j] = unitdict[w][j][0] value_to_unit[w] = dict(zip(unitdict[w].itervalues(), unitdict[w].iterkeys())) | 04717bf1b9b9ac138edf5b9001954a2a12d3790d /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9417/04717bf1b9b9ac138edf5b9001954a2a12d3790d/units.py |
{'cheval_vapeur':'Defined to be 75 kilogram force*meter/second.\nAlso known as metric horsepower.\nEqual to 735.49875 watts.', 'horsepower':'Defined to be 550 feet*pound force/second.\nApproximately equal to 745.7 watts.', 'watt':'SI derived unit of power.\nDefined to be joule/second or, in base units, kilogram*meter^2/second^3.'}, | {'cheval_vapeur':'Defined to be 75 kilogram force*meter/second.\nAlso known as metric horsepower.\nEqual to 735.49875 watts.', 'horsepower':'Defined to be 550 feet*pound force/second.\nApproximately equal to 745.7 watts.', 'watt':'SI derived unit of power.\nDefined to be joule/second or, in base units, kilogram*meter^2/second^3.'}, | def evalunitdict(): """ Replace all the string values of the unitdict variable by their evaluated forms, and builds some other tables for ease of use. This function is mainly used internally, for efficiency (and flexibility) purposes, making it easier to describe the units. EXAMPLES:: sage: sage.symbolic.units.evalunitdict() """ from sage.misc.all import sage_eval for key, value in unitdict.iteritems(): unitdict[key] = dict([(a,sage_eval(repr(b))) for a, b in value.iteritems()]) # FEATURE IDEA: create a function that would allow users to add # new entries to the table without having to know anything about # how the table is stored internally. # # Format the table for easier use. # for k, v in unitdict.iteritems(): for a in v: unit_to_type[a] = k for w in unitdict.iterkeys(): for j in unitdict[w].iterkeys(): if type(unitdict[w][j]) == tuple: unitdict[w][j] = unitdict[w][j][0] value_to_unit[w] = dict(zip(unitdict[w].itervalues(), unitdict[w].iterkeys())) | 04717bf1b9b9ac138edf5b9001954a2a12d3790d /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9417/04717bf1b9b9ac138edf5b9001954a2a12d3790d/units.py |
{'atmosphere':'Defined to be 101325 pascals.', 'bar':'Defined to be 100000 pascals.', 'barye':'CGS unit defined to be dyne/centimeter^2.\nEqual to 1/10 of a pascal.', 'inch_mercury':'Defined to be 13595.1 kilogram/meter^3*inch*gravity.\nApproximately equal to 3386.389 pascals.', 'millimeter_mercury':'Defined to be 13595.1 kilogram/meter^3*millimeter*gravity.\nApproximately equal to 133.3224 pascals.', 'mmhg':'Abbreviation for millimeter mercury.\nApproximately equal to 133.3224 pascals.', 'pa':'Abbreviation for pascal.', 'pascal':'SI derived unit of pressure.\nDefined to be newton/meter^2 or, in base units, kilogram/(meter*second^2).', 'pounds_per_square_inch':'Defined to be pound force/inch^2.\nApproximately equal to 6894.76 pascals.', 'psi':'Abbreviation for pounds per square inch.\nApproximately equal to 6894.76 pascals.', 'torr':'Defined to be 1/760 of an atmosphere.\nApproximately equal to 133.322 pascals.'}, | {'atmosphere':'Defined to be 101325 pascals.', 'bar':'Defined to be 100000 pascals.', 'barye':'CGS unit defined to be dyne/centimeter^2.\nEqual to 1/10 of a pascal.', 'inch_mercury':'Defined to be 13595.1 kilogram/meter^3*inch*gravity.\nApproximately equal to 3386.389 pascals.', 'millimeter_mercury':'Defined to be 13595.1 kilogram/meter^3*millimeter*gravity.\nApproximately equal to 133.3224 pascals.', 'mmhg':'Abbreviation for millimeter mercury.\nApproximately equal to 133.3224 pascals.', 'pa':'Abbreviation for pascal.', 'pascal':'SI derived unit of pressure.\nDefined to be newton/meter^2 or, in base units, kilogram/(meter*second^2).', 'pounds_per_square_inch':'Defined to be pound force/inch^2.\nApproximately equal to 6894.76 pascals.', 'psi':'Abbreviation for pounds per square inch.\nApproximately equal to 6894.76 pascals.', 'torr':'Defined to be 1/760 of an atmosphere.\nApproximately equal to 133.322 pascals.'}, | def evalunitdict(): """ Replace all the string values of the unitdict variable by their evaluated forms, and builds some other tables for ease of use. This function is mainly used internally, for efficiency (and flexibility) purposes, making it easier to describe the units. EXAMPLES:: sage: sage.symbolic.units.evalunitdict() """ from sage.misc.all import sage_eval for key, value in unitdict.iteritems(): unitdict[key] = dict([(a,sage_eval(repr(b))) for a, b in value.iteritems()]) # FEATURE IDEA: create a function that would allow users to add # new entries to the table without having to know anything about # how the table is stored internally. # # Format the table for easier use. # for k, v in unitdict.iteritems(): for a in v: unit_to_type[a] = k for w in unitdict.iterkeys(): for j in unitdict[w].iterkeys(): if type(unitdict[w][j]) == tuple: unitdict[w][j] = unitdict[w][j][0] value_to_unit[w] = dict(zip(unitdict[w].itervalues(), unitdict[w].iterkeys())) | 04717bf1b9b9ac138edf5b9001954a2a12d3790d /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9417/04717bf1b9b9ac138edf5b9001954a2a12d3790d/units.py |
{'gray':'SI derived unit of absorbed radiation.\nDefined to be the absorption of one joule of ionizing radiation by one kilogram of matter.', 'rad':'Defined to be 1/100 of a gray.'}, | {'gray':'SI derived unit of absorbed radiation.\nDefined to be the absorption of one joule of ionizing radiation by one kilogram of matter.', 'rad':'Defined to be 1/100 of a gray.'}, | def evalunitdict(): """ Replace all the string values of the unitdict variable by their evaluated forms, and builds some other tables for ease of use. This function is mainly used internally, for efficiency (and flexibility) purposes, making it easier to describe the units. EXAMPLES:: sage: sage.symbolic.units.evalunitdict() """ from sage.misc.all import sage_eval for key, value in unitdict.iteritems(): unitdict[key] = dict([(a,sage_eval(repr(b))) for a, b in value.iteritems()]) # FEATURE IDEA: create a function that would allow users to add # new entries to the table without having to know anything about # how the table is stored internally. # # Format the table for easier use. # for k, v in unitdict.iteritems(): for a in v: unit_to_type[a] = k for w in unitdict.iterkeys(): for j in unitdict[w].iterkeys(): if type(unitdict[w][j]) == tuple: unitdict[w][j] = unitdict[w][j][0] value_to_unit[w] = dict(zip(unitdict[w].itervalues(), unitdict[w].iterkeys())) | 04717bf1b9b9ac138edf5b9001954a2a12d3790d /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9417/04717bf1b9b9ac138edf5b9001954a2a12d3790d/units.py |
{'becquerel':'SI derived unit of radiation.\nDefined to be the activity of a quantity of radioactive material in which one nucleus decays per second.', 'curie':'Defined to be 37*10^9 becquerels.', 'rutherford':'Defined to be 10^6 becquerels.'}, | {'becquerel':'SI derived unit of radiation.\nDefined to be the activity of a quantity of radioactive material in which one nucleus decays per second.', 'curie':'Defined to be 37*10^9 becquerels.', 'rutherford':'Defined to be 10^6 becquerels.'}, | def evalunitdict(): """ Replace all the string values of the unitdict variable by their evaluated forms, and builds some other tables for ease of use. This function is mainly used internally, for efficiency (and flexibility) purposes, making it easier to describe the units. EXAMPLES:: sage: sage.symbolic.units.evalunitdict() """ from sage.misc.all import sage_eval for key, value in unitdict.iteritems(): unitdict[key] = dict([(a,sage_eval(repr(b))) for a, b in value.iteritems()]) # FEATURE IDEA: create a function that would allow users to add # new entries to the table without having to know anything about # how the table is stored internally. # # Format the table for easier use. # for k, v in unitdict.iteritems(): for a in v: unit_to_type[a] = k for w in unitdict.iterkeys(): for j in unitdict[w].iterkeys(): if type(unitdict[w][j]) == tuple: unitdict[w][j] = unitdict[w][j][0] value_to_unit[w] = dict(zip(unitdict[w].itervalues(), unitdict[w].iterkeys())) | 04717bf1b9b9ac138edf5b9001954a2a12d3790d /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9417/04717bf1b9b9ac138edf5b9001954a2a12d3790d/units.py |
{'roentgen':'Defined to be .000258 coulombs/kilogram.', 'rontgen':'Equivalent to roentgen.\nDefined to be .000258 coulombs/kilogram.'}, | {'roentgen':'Defined to be .000258 coulombs/kilogram.', 'rontgen':'Equivalent to roentgen.\nDefined to be .000258 coulombs/kilogram.'}, | def evalunitdict(): """ Replace all the string values of the unitdict variable by their evaluated forms, and builds some other tables for ease of use. This function is mainly used internally, for efficiency (and flexibility) purposes, making it easier to describe the units. EXAMPLES:: sage: sage.symbolic.units.evalunitdict() """ from sage.misc.all import sage_eval for key, value in unitdict.iteritems(): unitdict[key] = dict([(a,sage_eval(repr(b))) for a, b in value.iteritems()]) # FEATURE IDEA: create a function that would allow users to add # new entries to the table without having to know anything about # how the table is stored internally. # # Format the table for easier use. # for k, v in unitdict.iteritems(): for a in v: unit_to_type[a] = k for w in unitdict.iterkeys(): for j in unitdict[w].iterkeys(): if type(unitdict[w][j]) == tuple: unitdict[w][j] = unitdict[w][j][0] value_to_unit[w] = dict(zip(unitdict[w].itervalues(), unitdict[w].iterkeys())) | 04717bf1b9b9ac138edf5b9001954a2a12d3790d /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9417/04717bf1b9b9ac138edf5b9001954a2a12d3790d/units.py |
{'abohm':'Defined to be 10^-9 ohms.', 'ohm':'SI derived unit of resistance.\nDefined to be a volt per ampere.', 'statohm':'CGS unit defined to be statvolt/statampere.\nApproximately equal to 8.98758*10^11 ohms.'}, | {'abohm':'Defined to be 10^-9 ohms.', 'ohm':'SI derived unit of resistance.\nDefined to be a volt per ampere.', 'statohm':'CGS unit defined to be statvolt/statampere.\nApproximately equal to 8.98758*10^11 ohms.'}, | def evalunitdict(): """ Replace all the string values of the unitdict variable by their evaluated forms, and builds some other tables for ease of use. This function is mainly used internally, for efficiency (and flexibility) purposes, making it easier to describe the units. EXAMPLES:: sage: sage.symbolic.units.evalunitdict() """ from sage.misc.all import sage_eval for key, value in unitdict.iteritems(): unitdict[key] = dict([(a,sage_eval(repr(b))) for a, b in value.iteritems()]) # FEATURE IDEA: create a function that would allow users to add # new entries to the table without having to know anything about # how the table is stored internally. # # Format the table for easier use. # for k, v in unitdict.iteritems(): for a in v: unit_to_type[a] = k for w in unitdict.iterkeys(): for j in unitdict[w].iterkeys(): if type(unitdict[w][j]) == tuple: unitdict[w][j] = unitdict[w][j][0] value_to_unit[w] = dict(zip(unitdict[w].itervalues(), unitdict[w].iterkeys())) | 04717bf1b9b9ac138edf5b9001954a2a12d3790d /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9417/04717bf1b9b9ac138edf5b9001954a2a12d3790d/units.py |
{'steradian':'SI derived unit of solid angle.\nDefined to be the solid angle subtended at the center of a sphere of radius r by a portion of the surface of the sphere having an area of r^2.'}, | {'steradian':'SI derived unit of solid angle.\nDefined to be the solid angle subtended at the center of a sphere of radius r by a portion of the surface of the sphere having an area of r^2.'}, | def evalunitdict(): """ Replace all the string values of the unitdict variable by their evaluated forms, and builds some other tables for ease of use. This function is mainly used internally, for efficiency (and flexibility) purposes, making it easier to describe the units. EXAMPLES:: sage: sage.symbolic.units.evalunitdict() """ from sage.misc.all import sage_eval for key, value in unitdict.iteritems(): unitdict[key] = dict([(a,sage_eval(repr(b))) for a, b in value.iteritems()]) # FEATURE IDEA: create a function that would allow users to add # new entries to the table without having to know anything about # how the table is stored internally. # # Format the table for easier use. # for k, v in unitdict.iteritems(): for a in v: unit_to_type[a] = k for w in unitdict.iterkeys(): for j in unitdict[w].iterkeys(): if type(unitdict[w][j]) == tuple: unitdict[w][j] = unitdict[w][j][0] value_to_unit[w] = dict(zip(unitdict[w].itervalues(), unitdict[w].iterkeys())) | 04717bf1b9b9ac138edf5b9001954a2a12d3790d /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9417/04717bf1b9b9ac138edf5b9001954a2a12d3790d/units.py |
{'celsius':'Defined to be -273.15 at absolute zero and 0.01 at the triple point of Vienna Standard Mean Ocean Water.\nCelsius is related to kelvin by the equation K = 273.15 + degrees Celsius.\nA change of 1 degree Celsius is equivalent to a change of 1 degree kelvin.', 'centigrade':'Equivalent to celsius.', 'fahrenheit':'Defined to be 32 degrees at the freezing point of water and 212 degrees at the boiling point of water, both at standard pressure (1 atmosphere).\nFahrenheit is related to kelvin by the equation K = 5/9*(degrees Fahrenheit + 459.67).\nA change of 1 degree fahrenheit is equal to a change of 5/9 kelvin.', 'kelvin':'SI base unit of temperature.\nDefined to be exactly 0 at absolute zero and 273.16 at the triple point of Vienna Standard Mean Ocean Water.', 'rankine':'Defined to be 0 at absolute zero and to have the same degree increment as Fahrenheit.\nRankine is related to kelvin by the equation K = 5/9*R.'}, | {'celsius':'Defined to be -273.15 at absolute zero and 0.01 at the triple point of Vienna Standard Mean Ocean Water.\nCelsius is related to kelvin by the equation K = 273.15 + degrees Celsius.\nA change of 1 degree Celsius is equivalent to a change of 1 degree kelvin.', 'centigrade':'Equivalent to celsius.', 'fahrenheit':'Defined to be 32 degrees at the freezing point of water and 212 degrees at the boiling point of water, both at standard pressure (1 atmosphere).\nFahrenheit is related to kelvin by the equation K = 5/9*(degrees Fahrenheit + 459.67).\nA change of 1 degree fahrenheit is equal to a change of 5/9 kelvin.', 'kelvin':'SI base unit of temperature.\nDefined to be exactly 0 at absolute zero and 273.16 at the triple point of Vienna Standard Mean Ocean Water.', 'rankine':'Defined to be 0 at absolute zero and to have the same degree increment as Fahrenheit.\nRankine is related to kelvin by the equation K = 5/9*R.'}, | def evalunitdict(): """ Replace all the string values of the unitdict variable by their evaluated forms, and builds some other tables for ease of use. This function is mainly used internally, for efficiency (and flexibility) purposes, making it easier to describe the units. EXAMPLES:: sage: sage.symbolic.units.evalunitdict() """ from sage.misc.all import sage_eval for key, value in unitdict.iteritems(): unitdict[key] = dict([(a,sage_eval(repr(b))) for a, b in value.iteritems()]) # FEATURE IDEA: create a function that would allow users to add # new entries to the table without having to know anything about # how the table is stored internally. # # Format the table for easier use. # for k, v in unitdict.iteritems(): for a in v: unit_to_type[a] = k for w in unitdict.iterkeys(): for j in unitdict[w].iterkeys(): if type(unitdict[w][j]) == tuple: unitdict[w][j] = unitdict[w][j][0] value_to_unit[w] = dict(zip(unitdict[w].itervalues(), unitdict[w].iterkeys())) | 04717bf1b9b9ac138edf5b9001954a2a12d3790d /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9417/04717bf1b9b9ac138edf5b9001954a2a12d3790d/units.py |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.