def __init__(self, site, connection, arguments={}, **kwargs):
        self.site = site
        self.application = self.site.application
        self.connection = connection
        self.connections = self.site.connections
        self.arguments = {}
        self.files = {}
        for k, values in arguments.iteritems():
            is_file_content = False
            for v in values:
                if isinstance(v, dict) and 'name' in v and 'content' in v:
                    # this looks like a file
                    # so we process it differently
                    try:
                        mimetype, body = v['content'].split(';', 1)
                        encoding, file_content = body.split(',', 1)
                        if encoding == 'base64':
                            file_content = base64.b64decode(file_content)
                        else:
                            raise RuntimeError('Unknown encoding "%s" specified for field "%s"' % (encoding, k))
                        self.files[k] = SimpleUploadedFile(v['name'], file_content, mimetype)
                        is_file_content = True
                    except Exception, e:
                        logging.error("Failed to decode argument '%s'" % k)
                        continue
            if not is_file_content:
                self.arguments[k] = values
        for k,v in kwargs.iteritems():
            setattr(self, k, v)

    #
    # Arguments
    #
dataset/ETHPy150Open letolab/airy/airy/core/web.py/AiryHandler.__init__/original