MCPcopy Create free account
hub / github.com/SooLab/CGFormer / conditional_cast

Function conditional_cast

utils/config.py:134–138  ·  view source on GitHub ↗
(from_type, to_type)

Source from the content-addressed store, hash-verified

132 # Cast replacement from from_type to to_type if the replacement and original
133 # types match from_type and to_type
134 def conditional_cast(from_type, to_type):
135 if replacement_type == from_type and original_type == to_type:
136 return True, to_type(replacement)
137 else:
138 return False, None
139
140 # Conditionally casts
141 # list <-> tuple

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected