def assert_no_dunder_name(code_obj, expr):
 for name in code_obj.co_names:
  if (('__' in name) or (name in _UNSAFE_ATTRIBUTES)):
   raise NameError(('Access to forbidden name %r (%r)' % (name, expr)))

def assert_no_dunder_name ( code_obj , expr ) : for name in code_obj . co_names : if ( ( '__' in name ) or ( name in _UNSAFE_ATTRIBUTES ) ) : raise NameError ( ( 'Access to forbidden name %r (%r)' % ( name , expr ) ) )
assert_no_dunder_name -> none asserts that the code object does not refer to any "dunder name" .