def test_getattr_functions():
  class Resources(Struct):
    cpu = Required(Float)
    ram = Integer
    disk = Integer

  class Process(Struct):
    name = Required(String)
    resources = Map(String, Resources)

  # Basic getattr + hasattr
  assert Process(name = "hello").name() == String('hello')
  assert Process().has_name() is False
  assert Process(name = "hello").has_name() is True


  p = Process(name = "hello")
  p1 = p(resources = {'foo': Resources()})
  p2 = p(resources = {'{{whee}}': Resources()}).bind(whee='foo')

  assert p1.has_resources()
  assert p2.has_resources()
  assert p1.resources() in String('foo')
  assert String('foo') in p2.resources()
dataset/ETHPy150Open wickman/pystachio/tests/test_composite_types.py/test_getattr_functions/swapped operands of `in`