code: def props_to_dictionary_recurse(env, key, result):
      prefix_length = len(key) + 1 if key else 0
      for sub_key, attribs in sorted(env.properties(key).items()):
          next_key = sub_key[prefix_length:]
          if attribs & deepmind_lab.LISTABLE == deepmind_lab.LISTABLE:
              props_to_dictionary_recurse(
                  env, sub_key, result.setdefault(next_key, {})
              )
          elif attribs & deepmind_lab.READABLE == deepmind_lab.READABLE:
              result[next_key] = env.read_property(sub_key)
          elif attribs & deepmind_lab.WRITABLE == deepmind_lab.WRITABLE:
              result[next_key] = "<write-only>"
  
file_path: lab/python/tests/properties_test.py
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import os
  from absl.testing import absltest
  import six
  import deepmind_lab
label_desc: Use image node_id 1 for calling a global function with example usage: props_to_dictionary_recurse(env, key, result) without return types