code: def as_R_repr(ptype, value):
      if value is None:
          return (
              0
              if ptype in ["short", "int", "long", "double"]
              else "list()"
              if ptype == "list"
              else "NULL"
          )
      if ptype == "boolean":
          return str(value).upper()
      if ptype == "double":
          return "%.10g" % value
      if ptype == "list":
          return "list(%s)" % ", ".join('"%s"' % v for v in value)
      if ptype.startswith("enum"):
          return "c(%s)" % ", ".join('"%s"' % v for v in value)
      if ptype.endswith("[]"):
          return "c(%s)" % ", ".join("%s" % v for v in value)
      return value
  
file_path: h2o-3/h2o-bindings/bin/gen_R.py
imports: from collections import OrderedDict
  from copy import deepcopy
  from functools import partial
  import bindings
  from custom import get_customizations_for, reformat_block
label_desc: Use image node_id 8 for calling a global function with example usage: as_R_repr(ptype, value) and returns: value, unknown, str, unknown, unknown, unknown, unknown