code: def test_parameter_hasdefault():
      opts = {"name": "param", "type": int, "value": 1}
  
      # default unspecified
      p = Parameter(**opts)
      assert p.hasDefault()
      assert p.defaultValue() == opts["value"]
  
      p.setDefault(2)
      assert p.hasDefault()
      assert p.defaultValue() == 2
  
      # default specified
      p = Parameter(default=0, **opts)
      assert p.hasDefault()
      assert p.defaultValue() == 0
  
      # default specified as None
      p = Parameter(default=None, **opts)
      assert not p.hasDefault()
  
imports: from functools import wraps
  import numpy
  import pyqtgraph
  import pytest
  from pyqtgraph import functions
  from pyqtgraph.parametertree import InteractiveFunction, Interactor, interact, RunOptions
  from pyqtgraph.parametertree import Parameter
  from pyqtgraph.parametertree.Parameter import PARAM_TYPES
  from pyqtgraph.parametertree.parameterTypes import GroupParameter
  from pyqtgraph.Qt import QtGui
label_desc: Use image node_id 1 for calling a global function with example usage: test_parameter_hasdefault() without return types