def __init__(self, weight, syn_or_asyn):
     """constructor; validates input and inits instance; args, see class"""
     DirectComponent.__init__(self, weight)
     if (aux.is_int(syn_or_asyn, 'syn_or_asyn') and
         aux.is_in_list(syn_or_asyn, (1, -1), 'syn_or_asyn')):
         self.syn_or_asyn = syn_or_asyn
     self.last_in_val = 0.0
     self.last_out_val = 0.0
    def test_is_in_list(self):
        self.assertTrue(aux.is_in_list( 2, (1, 2, 3), 'test'))
        self.assertTrue(aux.is_in_list( 'c', 'abc', 'test'))
        self.assertTrue(aux.is_in_list( 'a', (3, 'a', .5), 'test'))
        self.assertTrue(aux.is_in_list( .5, (3, 'a', .5), 'test'))
        
        lst = [1,2,3]
        lst_of_lsts = [[1,2,3],[4,5,6]]
        self.assertTrue(aux.is_in_list( lst, lst_of_lsts, 'test'))

        dct = {}
        key = 'key'
        value = 'value'
        dct[key] = value
        self.assertTrue(aux.is_in_list( key, dct, 'test'))
        self.assertRaises(ValueError, aux.is_in_list, value, dct, 'test')

        self.assertRaises(ValueError, aux.is_in_list, 4, (1, 2, 3), 'test')
        self.assertRaises(ValueError, aux.is_in_list, 3.14, (3, 3.1), 'test')
        self.assertRaises(ValueError, aux.is_in_list, float('nan'), (3, 3.1),
                          'test')
        self.assertRaises(ValueError, aux.is_in_list, 'a', ('b', 3, .5), 'test')