def subcheck__generate_datasets(self, cls, cascade, seed=None):
        self.annotations['seed'] = seed

        if seed is None:
            res = fake_neo(obj_type=cls, cascade=cascade)
        else:
            res = fake_neo(obj_type=cls, cascade=cascade, seed=seed)

        if not hasattr(cls, 'lower'):
            self.assertTrue(isinstance(res, cls))
        else:
            self.assertEqual(res.__class__.__name__, cls)

        assert_neo_object_is_compliant(res)
        self.assertEqual(res.annotations, self.annotations)

        resattr = get_fake_values(cls, annotate=False, seed=0)
        if seed is not None:
            for name, value in resattr.items():
                if name in ['channel_names',
                            'channel_indexes',
                            'channel_index']:
                    continue
                try:
                    try:
                        resvalue = getattr(res, name)
                    except AttributeError:
                        if name == 'signal':
                            continue
                        raise
                    try:
                        self.assertEqual(resvalue, value)
                    except __HOLE__:
                        assert_arrays_equal(resvalue, value)
                except BaseException as exc:
                    exc.args += ('from %s' % name,)
                    raise

        if not getattr(res, '_child_objects', ()):
            pass
        elif not cascade:
            self.assertEqual(res.children, ())
        else:
            self.assertNotEqual(res.children, ())

        if cls in ['RecordingChannelGroup', RecordingChannelGroup]:
            for i, rchan in enumerate(res.recordingchannels):
                self.assertEqual(rchan.name, res.channel_names[i].astype(str))
                self.assertEqual(rchan.index, res.channel_indexes[i])
            for i, unit in enumerate(res.units):
                for sigarr in res.analogsignalarrays:
                    self.assertEqual(unit.channel_indexes[0],
                                     sigarr.channel_index[i])
dataset/ETHPy150Open NeuralEnsemble/python-neo/neo/test/coretest/test_generate_datasets.py/Test__generate_datasets.subcheck__generate_datasets