Generic
*******

class psynet.trial.Node(*args, **kwargs)

   Bases: "ChainNode"

   General-purpose parent node for trials, holding their definition
   and assets.

psynet.trial.compile_nodes_from_directory(input_dir, media_ext, node_class, url_key='url')

   Compile trial nodes from a directory of media files under
   "static/".

   This directory is expected to be structured in the following kind
   of way:

      input_dir/
      |-- participant_group_1/
      |   |-- block_1/
      |   |   |-- media_file_1.wav
      |   |   |-- media_file_2.wav
      |   |-- block_2/
      |   |   |-- media_file_3.wav
      |   |   |-- media_file_4.wav
      |   |-- block_3/
      |   |   |-- media_file_5.wav
      |   |   |-- media_file_6.wav
      |-- participant_group_2/
      |   |-- block_1/
      |   |   |-- media_file_7.wav
      |   |   |-- media_file_8.wav
      |   |-- block_2/
      |   |   |-- media_file_9.wav
      |   |   |-- media_file_10.wav
      |   |-- block_3/

   You can name the participant groups, blocks and files whatever you
   want; the important thing is their position in the hierarchy.

   Place "input_dir" under the experiment "static/" directory so the
   files are copied with the deployment plan and served as
   "/static/..." URLs. Paths outside "static/" (including directories
   outside the experiment) are not supported. Each node definition
   stores that URL under "url_key" (default ""url"") and the file name
   under ""name"". Pass "self.definition[url_key]" to "AudioPrompt".
   Participant groups, blocks, and files are visited in alphabetical
   order by name.

   Parameters:
      * **input_dir** (*str*) -- The path to the directory containing
        the media files.

      * **media_ext** (*str*) -- The extension of the media files.

      * **node_class** (*class*) -- The class of the node to compile.

      * **url_key** (*str**, **optional*) -- Key in the node
        definition that stores the media URL.

   Returns:
      A lambda function ready to be passed to the "nodes" argument of
      a "TrialMaker". Don't evaluate this function before you pass it,
      the lazy evaluation is an important feature.

   Return type:
      callable
