def __init__(self,dataset_name,**params):
filepath=param.resolve_path(dataset_name,path_to_file=False)<EOL>self.dataset_name=filepath<EOL>self.filename_template=filepath+"<STR_LIT>"<EOL>self.description="<STR_LIT>"<EOL>self.source=self.dataset_name<EOL>self.placeholder_mapping={}<EOL>patterns_per_label = len(glob.glob(self.filename_template))<EOL>inherent_features=['<STR_LIT>','<STR_LIT>']<EOL>try:<EOL><INDENT>filename=param.resolve_path(dataset_name+'<STR_LIT>')<EOL>filepath=os.path.dirname(filename)<EOL>dataset=json.loads(open(filename).read())<EOL>self.dataset_name=dataset.get('<STR_LIT>', self.dataset_name)<EOL>self.description=dataset.get('<STR_LIT:description>', self.description)<EOL>self.filename_template=dataset.get('<STR_LIT>', self.filename_template)<EOL>patterns_per_label=dataset.get('<STR_LIT>',<EOL>len(glob.glob(self.filename_template)))<EOL>self.source=dataset.get('<STR_LIT:source>', self.source)<EOL>self.placeholder_mapping=(eval(dataset['<STR_LIT>'])<EOL>if '<STR_LIT>' in dataset<EOL>else self.placeholder_mapping)<EOL>inherent_features=dataset.get('<STR_LIT>', inherent_features)<EOL><DEDENT>except IOError:<EOL><INDENT>pass<EOL><DEDENT>if '<STR_LIT>' not in params:<EOL><INDENT>params['<STR_LIT>'] = self.patterns_per_label<EOL><DEDENT>super(PatternCoordinatorImages, self).__init__(inherent_features,**params)<EOL>
dataset_name is the path to a folder containing a
MANIFEST_json (https://docs.python.org/2/library/json.html),
which contains a description for a dataset.  If no
MANIFEST_json is present, all image files in the specified
folder are used.

Any extra parameter values supplied here will be passed down
to the feature_coordinators requested in features_to_vary.

The JSON file can contain any of the following entries, if an
entry is not present, the default is used:

    :'dataset_name': Name of the dataset (string,
    default=filepath)
    :'length': Number of images in the dataset (integer,
    default=number of files in directory matching
    filename_template)
    :'description': Description of the dataset (string,
    default="")
    :'source': Citation of paper for which the dataset was
    created (string, default=name)
    :'filename_template': Path to the images with placeholders
    ({placeholder_name}) for inherent features and the image
    number, e.g. "filename_template": "images/image{i}.png".
    The placeholders are replaced according to
    placeholder_mapping.  Alternatively, glob patterns such as
    * or ? can be used, e.g. "filename_template":
    "images/*.png" (default=path_to_dataset_name/*.*)
    :'placeholder_mapping': Dictionary specifying the
    replacement of placeholders in filename_template; value is
    used in eval() (default={}).
    :'inherent_features': Features for which the corresponding
    feature_coordinators should not be applied
    (default=['sf','or','cr'])

    Currently, the label of the pattern generator
    ('pattern_label') as well as the image number
    ('current_image') are given as parameters to each callable
    supplied in placeholder_mapping, where current_image
    varies from 0 to length-1 and pattern_label is one of the
    items of pattern_labels.
    (python code, default={'i': lambda params: '%02d' %
    (params['current_image']+1)}

    Example 1: Imagine having images without any inherent
    features named as follows: "images/image01.png",
    "images/image02.png" and so on. Then, filename_template:
    "images/image{i}.png" and "placeholder_mapping":
    "{'i': lambda params: '%02d' % (params['current_image']+1)}"
    This replaces {i} in the template with the current image
    number + 1

    Example 2: Imagine having image pairs from a stereo webcam
    named as follows: "images/image01_left.png",

    "images/image01_right.png" and so on. If
    pattern_labels=['Left','Right'], then filename_template:
    "images/image{i}_{dy}" and "placeholder_mapping":
    "{'i': lambda params: '%02d' % (params['current_image']+1),
    'dy':lambda params: 'left' if
    params['pattern_label']=='Left' else 'right'}"

    Here, additionally {dy} gets replaced by either 'left' if
    the pattern_label is 'Left' or 'right' otherwise

If the directory does not contain a MANIFEST_json file, the
defaults are as follows:
    :'filename_template': filepath/*.*, whereas filepath is
    the path given in dataset_name
    :'patterns_per_label': Number of image files in filepath,
    whereas filepath is the path given in dataset_name
    :'inherent_features': []
    :'placeholder_mapping': {}