code: def solid(solid_in):
      
      if isinstance(solid_in, cadquery.Solid):
          return solid_in
      elif isinstance(solid_in, cadquery.CQ):
          return solid_in.val()
  
      raise CastingError(
          "Cannot cast object type of {!r} to a solid".format(solid_in)
      )
docs: :return: cadquery.Solid instance