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

Method get_default

shared/database/labels/label_schema.py:44–58  ·  view source on GitHub ↗
(session: Session, project_id: int)

Source from the content-addressed store, hash-verified

42 return result
43
44 def get_default(session: Session, project_id: int):
45
46 schema = session.query(LabelSchema).filter(
47 LabelSchema.project_id == project_id,
48 LabelSchema.name == 'Default Schema'
49 ).first()
50 if schema is None:
51 schema = session.query(LabelSchema).filter(
52 LabelSchema.project_id == project_id,
53 LabelSchema.is_default == True
54 ).first()
55 if schema is None:
56 schema = session.query(LabelSchema).filter(
57 LabelSchema.project_id == project_id).first()
58 return schema
59
60 @staticmethod
61 def new(session: Session,

Calls

no outgoing calls

Tested by

no test coverage detected