<s> """<STR_LIT>""" <EOL> from __future__ import print_function <EOL> import PyOpenWorm as P <EOL> import os <EOL> print ( os . getcwd ( ) ) <EOL> P . connect ( ) <EOL> def get_names ( it ) : <EOL> res = [ ] <EOL> for x in it : <EOL> res . append ( x . name ( ) ) <EOL> return res <EOL> w = P . Worm ( ) <EOL> net = w . neuron_network ( ) <EOL> print ( "<STR_LIT>" ) <EOL> inter = get_names ( net . interneurons ( ) ) <EOL> motor = get_names ( net . motor ( ) ) <EOL> sensory = get_names ( net . sensory ( ) ) <EOL> print ( "<STR_LIT>" ) <EOL> sensmot = set ( sensory ) & set ( motor ) <EOL> sensint = set ( sensory ) & set ( inter ) <EOL> motint = set ( motor ) & set ( inter ) <EOL> sens_only = set ( sensory ) - set ( motor ) - set ( inter ) <EOL> motor_only = set ( motor ) - set ( sensory ) - set ( inter ) <EOL> inter_only = set ( inter ) - set ( sensory ) - set ( motor ) <EOL> tri = motint & set ( sensory ) <EOL> motint_no_tri = motint - tri <EOL> sensint_no_tri = sensint - tri <EOL> sensmot_no_tri = sensmot - tri <EOL> def pp_set ( title , s ) : <EOL> print ( title ) <EOL> print ( "<STR_LIT:=>" * ( len ( title ) ) ) <EOL> print ( "<STR_LIT:U+0020>" . join ( s ) ) <EOL> print ( ) <EOL> pp_set ( "<STR_LIT>" , sens_only ) <EOL> pp_set ( "<STR_LIT>" , inter_only ) <EOL> pp_set ( "<STR_LIT>" , motor_only ) <EOL> pp_set ( "<STR_LIT>" , sensmot ) <EOL> pp_set ( "<STR_LIT>" , sensint ) <EOL> pp_set ( "<STR_LIT>" , motint ) <EOL> pp_set ( "<STR_LIT>" , sensmot_no_tri ) <EOL> pp_set ( "<STR_LIT>" , motint_no_tri ) <EOL> pp_set ( "<STR_LIT>" , sensint_no_tri ) </s>
