def _combine_rhs(rhs):
 series = {}
 if isinstance(rhs, Series):
  series['x'] = rhs
 elif isinstance(rhs, DataFrame):
  series = rhs.copy()
 elif isinstance(rhs, dict):
  for (name, value) in compat.iteritems(rhs):
   if isinstance(value, Series):
    _safe_update(series, {name: value})
   elif isinstance(value, (dict, DataFrame)):
    _safe_update(series, value)
   else:
    raise Exception(('Invalid RHS data type: %s' % type(value)))
 else:
  raise Exception(('Invalid RHS type: %s' % type(rhs)))
 if (not isinstance(series, DataFrame)):
  series = DataFrame(series, dtype=float)
 return series

def _combine_rhs ( rhs ) : series = { } if isinstance ( rhs , Series ) : series [ 'x' ] = rhs elif isinstance ( rhs , DataFrame ) : series = rhs . copy ( ) elif isinstance ( rhs , dict ) : for ( name , value ) in compat . iteritems ( rhs ) : if isinstance ( value , Series ) : _safe_update ( series , { name : value } ) elif isinstance ( value , ( dict , DataFrame ) ) : _safe_update ( series , value ) else : raise Exception ( ( 'Invalid RHS data type: %s' % type ( value ) ) ) else : raise Exception ( ( 'Invalid RHS type: %s' % type ( rhs ) ) ) if ( not isinstance ( series , DataFrame ) ) : series = DataFrame ( series , dtype = float ) return series
glue input x variables together while checking for potential duplicates .