MCPcopy Create free account
hub / github.com/google-deepmind/dm_control / _assign

Method _assign

dm_control/mjcf/attribute.py:186–194  ·  view source on GitHub ↗
(self, value)

Source from the content-addressed store, hash-verified

184 conflict_behavior)
185
186 def _assign(self, value):
187 if value is None or value == '': # pylint: disable=g-explicit-bool-comparison
188 self.clear()
189 else:
190 try:
191 self._value = self._valid_values[str(value).lower()]
192 except KeyError:
193 raise ValueError('Expect keyword to be one of {} but got: {}'.format(
194 list(self._valid_values.values()), value)) from None
195
196 @property
197 def valid_values(self):

Callers

nothing calls this directly

Calls 3

lowerMethod · 0.80
valuesMethod · 0.80
clearMethod · 0.45

Tested by

no test coverage detected