@memoize
def new_dataset(expr, deltas, missing_values):
    missing_values = dict(missing_values)
    columns = {}
    for name, type_ in expr.dshape.measure.fields:
        # Don't generate a column for sid or timestamp, since they're
        # implicitly the labels if the arrays that will be passed to pipeline
        # Terms.
        if name in (SID_FIELD_NAME, TS_FIELD_NAME):
            continue
        try:
            # TODO: This should support datetime and bool columns.
            if promote(type_, float64, promote_option=False) != float64:
                raise NotPipelineCompatible()
            if isinstance(type_, Option):
                type_ = type_.ty
        except NotPipelineCompatible:
            col = NonPipelineField(name, type_)
        except TypeError:
            col = NonNumpyField(name, type_)
        else:
            col = Column(
                type_.to_numpy_dtype(),
                missing_values.get(name, NotSpecified),
            )

        columns[name] = col

    name = expr._name
    if name is None:
        name = next(_new_names)

    # unicode is a name error in py3 but the branch is only hit
    # when we are in python 2.
    if PY2 and isinstance(name, unicode):  # noqa
        name = name.encode('utf-8')

    return type(name, (DataSet,), columns)
Returns context_lines before and after lineno from file.
dataset/ETHPy150Open quantopian/zipline/zipline/pipeline/loaders/blaze/core.py/new_dataset--crossover with--dataset/ETHPy150Open getsentry/raven-python/raven/utils/stacks.py/get_lines_from_file