def get_generator(data):
    if callable(data):
        if isinstance(data(), mod_types.GeneratorType):
            return data

    if not data:
        raise Exception('Invalid or empty data: {0}'.format(data))

    def generator():
        for i in data:
            yield i
    return generator
test to make sure complex128 type numpy scalars are accepted
dataset/ETHPy150Open tkrajina/cartesius/cartesius/charts.py/get_generator--crossover with--dataset/ETHPy150Open NeuralEnsemble/python-neo/neo/test/coretest/test_base.py/TestBaseNeoNumpyScalarTypes.test_numpy_scalar_complex128