@memoize
def new_dataset(expr, deltas, missing_values):
 missing_values = dict(missing_values)
 class_dict = {'ndim': (2 if (SID_FIELD_NAME in expr.fields) else 1)}
 for (name, type_) in expr.dshape.measure.fields:
  if (name in (SID_FIELD_NAME, TS_FIELD_NAME)):
   continue
  type_ = datashape_type_to_numpy(type_)
  if can_represent_dtype(type_):
   col = Column(type_, missing_values.get(name, NotSpecified))
  else:
   col = NonPipelineField(name, type_)
  class_dict[name] = col
 name = expr._name
 if (name is None):
  name = next(_new_names)
 if (PY2 and isinstance(name, unicode)):
  name = name.encode('utf-8')
 return type(name, (DataSet,), class_dict)

@ memoize def new_dataset ( expr , deltas , missing_values ) : missing_values = dict ( missing_values ) class_dict = { 'ndim' : ( 2 if ( SID_FIELD_NAME in expr . fields ) else 1 ) } for ( name , type_ ) in expr . dshape . measure . fields : if ( name in ( SID_FIELD_NAME , TS_FIELD_NAME ) ) : continue type_ = datashape_type_to_numpy ( type_ ) if can_represent_dtype ( type_ ) : col = Column ( type_ , missing_values . get ( name , NotSpecified ) ) else : col = NonPipelineField ( name , type_ ) class_dict [ name ] = col name = expr . _name if ( name is None ) : name = next ( _new_names ) if ( PY2 and isinstance ( name , unicode ) ) : name = name . encode ( 'utf-8' ) return type ( name , ( DataSet , ) , class_dict )
creates or returns a dataset from a pair of blaze expressions .