MCPcopy Create free account
hub / github.com/VisionRush/DeepFakeDefenders / conditional_cast

Function conditional_cast

toolkit/yacs.py:514–518  ·  view source on GitHub ↗
(from_type, to_type)

Source from the content-addressed store, hash-verified

512 # Cast replacement from from_type to to_type if the replacement and original
513 # types match from_type and to_type
514 def conditional_cast(from_type, to_type):
515 if replacement_type == from_type and original_type == to_type:
516 return True, to_type(replacement)
517 else:
518 return False, None
519
520 # Conditionally casts
521 # list <-> tuple

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected