MCPcopy Index your code
hub / github.com/THUDM/AgentBench / intersection

Method intersection

src/server/tasks/knowledgegraph/api.py:114–125  ·  view source on GitHub ↗

Set intersection. Returns (new_variable, "Observation: ...").

(self, variable1: Variable, variable2: Variable)

Source from the content-addressed store, hash-verified

112 return new_variable, rtn_str
113
114 def intersection(self, variable1: Variable, variable2: Variable):
115 """
116 Set intersection. Returns (new_variable, "Observation: ...").
117 """
118 if variable1.type != variable2.type:
119 raise ValueError("intersection: two variables must have the same type")
120 if not isinstance(variable1, Variable) or not isinstance(variable2, Variable):
121 raise ValueError("intersection: variable must be a variable")
122
123 rtn_str = f"Observation: variable ##, which are instances of {variable1.type}"
124 new_variable = Variable(variable1.type, f"(AND {variable1.program} {variable2.program})")
125 return new_variable, rtn_str
126
127 def union(self, variable1: Variable, variable2: Variable):
128 """

Callers 5

analyze_outputFunction · 0.80
sync_start_sampleMethod · 0.80
_calculate_f1Method · 0.80
get_relationsMethod · 0.80
get_attributesMethod · 0.80

Calls 1

VariableClass · 0.85

Tested by

no test coverage detected