MCPcopy Index your code
hub / github.com/diffgram/diffgram / Instance

Class Instance

shared/database/annotation/instance.py:14–575  ·  view source on GitHub ↗

An individual annotation instance

Source from the content-addressed store, hash-verified

12
13
14class Instance(Base):
15 """
16 An individual annotation instance
17
18 """
19 __tablename__ = 'instance'
20
21 id = Column(BIGINT, primary_key = True)
22 previous_id = Column(BIGINT)
23 next_id = Column(BIGINT)
24 root_id = Column(BIGINT, index = True)
25 version = Column(Integer, default = 0)
26
27 created_time = Column(DateTime, default = datetime.datetime.utcnow)
28 last_updated_time = Column(DateTime, onupdate = datetime.datetime.utcnow)
29 client_created_time = Column(DateTime, nullable = True)
30 deleted_time = Column(DateTime, nullable = True)
31
32 # Used to explain why the instance was deleted, currently 2 cases:
33 # system: means that the instance was deleted by the version control system, any type of edit trigger this type.
34 # user: means that the user purposefully deleted the instance
35 # null: usually this value is on the "most recent" instance version ie, no delete actions after it.
36 deletion_type = Column(String, nullable = True)
37
38 # For defining the type of action that happened to the instance when it changed (edited, deleted, created, etc)
39 action_type = Column(String, nullable = True)
40
41 # For knowing the source of the update (SDK/Frontend, Third Party, ectc)
42 change_source = Column(String, nullable = True)
43
44 project_id = Column(Integer, ForeignKey('project.id'))
45 project = relationship("Project")
46
47 model_id = Column(Integer, ForeignKey('model.id'))
48 model = relationship(Model)
49
50 model_run_id = Column(Integer, ForeignKey('model_run.id'))
51 model_run = relationship(ModelRun)
52
53 task_id = Column(Integer, ForeignKey('task.id'))
54 task = relationship("Task", foreign_keys = [task_id])
55
56 type = Column(String()) # "box", "polygon", "tag", "text_token" ...
57 hash = Column(String())
58
59 # TODO clarify what status was for
60 status = Column(String())
61
62 start_sentence = Column(Integer())
63 end_sentence = Column(Integer())
64
65 start_token = Column(Integer())
66 end_token = Column(Integer())
67
68 start_char = Column(Integer())
69 end_char = Column(Integer())
70 sentence = Column(Integer())
71

Callers 4

update_instanceMethod · 0.90
create_instanceFunction · 0.90
generate_instanceMethod · 0.50

Calls

no outgoing calls

Tested by

no test coverage detected