code: def _attribute(name, value):  # pylint: disable=too-many-branches
      attribute = {}
      attribute["name"] = name
      default = "default" in value
      if not default:
          attribute["required"] = True
      if value["type"] == "float":
          attribute["type"] = "float32"
          if default:
              attribute["default"] = float(value["default"])
      elif value["type"] == "double":
          attribute["type"] = "float64"
          if default:
              attribute["default"] = float(value["default"])
      elif value["type"] == "bool":
          attribute["type"] = "boolean"
          if default:
              _ = value["default"]
              if isinstance(_, bool):
                  attribute["default"] = _
              elif _ == "True":
                  attribute["default"] = True
              elif _ == "False":
                  attribute["default"] = False
      elif value["type"] == "string":
          attribute["type"] = "string"
          if default:
              _ = value["default"]
              attribute["default"] = _.strip("'")
      elif value["type"] == "int64":
          attribute["type"] = "int64"
          if default:
              _ = value["default"]
              if (
                  isinstance(_, str)
                  and not _.startswith("len")
                  and _ != "None"
              ):
                  attribute["default"] = int(_)
              else:
                  attribute["default"] = _
      elif value["type"] == "repeated int64":
          attribute["type"] = "int64[]"
      elif value["type"] == "repeated float":
          attribute["type"] = "float32[]"
      elif value["type"] == "Shape":
          attribute["type"] = "shape"
      if default and "default" not in attribute:
          attribute["default"] = value["default"]
      attribute["description"] = value["doc"].strip()
      return attribute
  
file_path: netron/tools/nnabla_script.py
imports: import json
  import sys
  import os
  import yaml
  import mako.template
label_desc: Use image node_id 5 for calling a global function with example usage: _attribute(name, value) and returns: attribute