code: def process_dimensions(kdims, vdims):
      
      dimensions = {}
      for group, dims in [('kdims', kdims), ('vdims', vdims)]:
          if dims is None:
              continue
          elif isinstance(dims, (tuple, basestring, Dimension, dict)):
              dims = [dims]
          elif not isinstance(dims, list):
              raise ValueError("%s argument expects a Dimension or list of dimensions, "
                               "specified as tuples, strings, dictionaries or Dimension "
                               "instances, not a %s type. Ensure you passed the data as the "
                               "first argument." % (group, type(dims).__name__))
          for dim in dims:
              if not isinstance(dim, (tuple, basestring, Dimension, dict)):
                  raise ValueError('Dimensions must be defined as a tuple, '
                                   'string, dictionary or Dimension instance, '
                                   'found a %s type.' % type(dim).__name__)
          dimensions[group] = [asdim(d) for d in dims]
      return dimensions
docs: Converts kdims and vdims to Dimension objects.
  
      Args:
          kdims: List or single key dimension(s) specified as strings,
              tuples dicts or Dimension objects.
          vdims: List or single value dimension(s) specified as strings,
              tuples dicts or Dimension objects.
  
      Returns:
          Dictionary containing kdims and vdims converted to Dimension
          objects:
  
          {'kdims': [Dimension('x')], 'vdims': [Dimension('y')]