class_docstr: Represents a single parameter to a test case.
  
  For example::
  
      >>> p = param("foo", bar=16)
      >>> p
      param("foo", bar=16)
      >>> p.args
      ('foo', )
      >>> p.kwargs
      {'bar': 16}
  
  Intended to be used as an argument to ``@parameterized``::
  
      @parameterized([
          param("foo", bar=16),
      ])
      def test_stuff(foo, bar=16):
          pass
class_docstr_tok: ["Represents","a","single","parameter","to","a","test","case",".","For","example",":",":",">",">",">","p","=","param","(","``","foo","''",",","bar=16",")",">",">",">","p","param","(","``","foo","''",",","bar=16",")",">",">",">","p.args","(","'foo","'",",",")",">",">",">","p.kwargs","{","'bar","'",":","16","}","Intended","to","be","used","as","an","argument","to","``","@","parameterized","``",":",":","@","parameterized","(","[","param","(","``","foo","''",",","bar=16",")",",","]",")","def","test_stuff","(","foo",",","bar=16",")",":","pass"]
docstr: Returns an instance of ``param()`` for ``@parameterized`` argument
  ``args``::
  
      >>> param.from_decorator((42, ))
      param(args=(42, ), kwargs={})
      >>> param.from_decorator("foo")
      param(args=("foo", ), kwargs={})
docstr_tok: ["Returns","an","instance","of","``","param","(",")","``","for","``","@","parameterized","``","argument","``","args","``",":",":",">",">",">","param.from_decorator","(","(","42",",",")",")","param","(","args=","(","42",",",")",",","kwargs=","{","}",")",">",">",">","param.from_decorator","(","``","foo","''",")","param","(","args=","(","``","foo","''",",",")",",","kwargs=","{","}",")"]
code: def from_decorator(cls, args):
      """Returns an instance of ``param()`` for ``@parameterized`` argument
      ``args``::
  
          >>> param.from_decorator((42, ))
          param(args=(42, ), kwargs={})
          >>> param.from_decorator("foo")
          param(args=("foo", ), kwargs={})
      """
      if isinstance(args, param):
          return args
      elif isinstance(args, (str, bytes)) or not isinstance(
          args, Iterable
      ):
          args = (args,)
      try:
          return cls(*args)
      except TypeError as e:
          if "after * must be" not in str(e):
              raise
          raise TypeError(
              "Parameters must be tuples, but %r is not (hint: use '(%r, )')"
              % (args, args),
          )
  
imports: import re
  import sys
  import inspect
  import warnings
  from typing import Iterable
  from functools import wraps
  from types import MethodType
  from collections import namedtuple
  from unittest import TestCase
label_desc: Use image node_id 3 for calling the param obj's underlying member method code with example usage: obj.from_decorator(cls, args) and returns: args, cls