def walk_files(b, **kwargs):
    """
    Walk a blueprint's files and execute callbacks.

    * `before_files():`
      Executed before files are enumerated.
    * `file(pathname, f):`
      Executed when a file is enumerated.
    * `after_files():`
      Executed after files are enumerated.
    """

    kwargs.get('before_files', lambda *args: None)()

    callable = kwargs.get('file', lambda *args: None)
    for pathname, f in sorted(b.get('files', {}).iteritems()):

        # AWS cfn-init templates may specify file content as JSON, which
        # must be converted to a string here, lest each frontend have to
        # do so.
        if f in 'content' and not isinstance(f['content'], basestring):
            f['content'] = util.json_dumps(f['content'])

        callable(pathname, f)

    kwargs.get('after_files', lambda *args: None)()
dataset/ETHPy150Open devstructure/blueprint/blueprint/walk.py/walk_files/swapped operands of `in`