These codes are written in python3. We ran the codes with numpy 1.15.3, scipy  1.1.0 and matplotlib 3.0.1.
 For each code, the simulation will finish within 30 minutes on a normal desktop computer.

・patternSingle.py : Detecting spike pattern with single dendritic neuron. Running this code generates figures for input raster plots and the trained output. Example results are shown in Fig. 1B,C.

・patternMulti.py : Detecting multiple spike patterns with dendritic neurons. Running this code generates figures for input raster plots, all trained output activities, trained lateral inhibitory connections and example traces of outputs. Example results are shown in Fig. 2D,E.

・chunking.py : Learning chunks by dendritic neurons. Running this code generates figures for all trained output activities, trained lateral inhibitory connections and example traces of outputs. Example results are shown in Fig. 4C.

・bss.py : Performing blind source separation with simple example. Running this code generates figures for true and mixed sources and trained activities. This is a code for Fig. 7, yet here we used simple input signals since we used external public data sets in Fig. 7.