code: def __init__(self, default, *options, **kwargs):
      self.default = default
  
      def filter(val):
          if (
              val == self.default
              or val.startswith("opencl")
              or val.startswith("cuda")
          ):
              return val
          elif val.startswith("gpu"):
              raise ValueError(
                  "You are tring to use the old GPU back-end. "
                  "It was removed from Theano. Use device=cuda* now. "
                  "See https://github.com/Theano/Theano/wiki/Converting-to-the-new-gpu-back-end%28gpuarray%29 "
                  "for more information."
              )
          else:
              raise ValueError(
                  (
                      'Invalid value ("%s") for configuration '
                      'variable "%s". Valid options start with '
                      'one of "cpu", "opencl" or "cuda".'
                      % (val, self.fullname)
                  )
              )
  
      over = kwargs.get("allow_override", True)
      super(DeviceParam, self).__init__(default, filter, over)
  
imports: from __future__ import absolute_import, print_function, division
  import errno
  import os
  import sys
  import logging
  import numpy
  import platform
  import textwrap
  import re
  import socket
  import struct
  import warnings
  from six import string_types
  import theano
  from theano.configparser import AddConfigVar, BoolParam, ConfigParam, EnumStr, FloatParam, IntParam, StrParam, TheanoConfigParser, THEANO_FLAGS_DICT
  from theano.misc.cpucount import cpuCount
  from theano.misc.windows import call_subprocess_Popen, output_subprocess_Popen
  from theano.compat import maybe_add_to_os_environ_pathlist
label_desc: Use image node_id 1 to create a new DeviceParam object from inherited base classes: ConfigParam with example: obj = DeviceParam(default)