31 commit.created_at = datetime.datetime.now()
32 commit.save()
33
34 all = lore.metadata.Commit.all()35 self.assertEqual(len(all), 1)
36
37 first = lore.metadata.Commit.first()
34class XorSingle(Xor):
35 def __init__(
36 self,
37 type 38 ):
39 super(XorSingle, self).__init__()
40 self.type = type
28class KerasSingle(lore.models.keras.Base):
29 def __init__(
30 self,
31 type 32 ):
33 super(KerasSingle, self).__init__(
34 tests.mocks.pipelines.XorSingle(type=type),
336
337
338class Distance(Base):
339 def __init__(self, lat_a, lon_a, lat_b, lon_b, input='degrees'):340 self.column = [lat_a, lon_a, lat_b, lon_b]
341 self.name = ('_').join([
342 inflection.underscore(self.__class__.__name__),
23class Disk(Base):
24 EXTENSION = '.pickle'
25
26 def __init__(self, dir): 27 self.dir = dir
28 self.limit = None
29 if not os.path.exists(self.dir):
Defining a local variable or function with the same name as a built-in object makes the built-in object unusable within the current scope and makes the code prone to bugs.
dict = {} # dict is a Python builtin!
for idx, student in enumerate(students):
dict[student] = idx
roll_number = {}
for idx, student in enumerate(students):
roll_number[student] = idx