text:
var bio = require('./')
var spawn = require('child_process').spawn
var minimist = require('minimist')

var minimistOptions = {
  alias: {
    help: 'h'
  }
}

var argv = minimist(process.argv.slice(2), minimistOptions)

if (argv.help || argv._.length === 0) {
  console.log("Please check the documentation at http://doc.bionode.io")
}

var component = argv._[0]
var path = __dirname + '/node_modules/bionode-' + component + '/cli.js'
var args = argv._.slice(1)
var cli = spawn(path, args)

cli.stdout.pipe(process.stdout)
cli.stderr.pipe(process.stderr)

if (argv._[argv._.length - 1] === '-') {
  process.stdin.pipe(cli.stdin)
} else {
  cli.stdin.end()
}

redpajama_set_name: RedPajamaGithub


text:
/*
 * storage-object.js: Instance of a single rackspace cloudserver
 *
 * (C) 2010 Nodejitsu Inc.
 * MIT LICENSE
 *
 */

var fs = require('fs'),
    cloudfiles = require('../cloudfiles'),
    common = require('./common');

var StorageObject = exports.StorageObject = function (client, details) {
  if (!details) {
    throw new Error("StorageObject must be constructed with at least basic details.")
  }

  this.client = client;
  this._setProperties(details);
};

StorageObject.prototype = {
  // Remark: Not fully implemented
  addMetadata: function (metadata, callback) {
    var newMetadata = clone(this.metadata);
    Object.keys(metadata).forEach(function (key) {
      newMetadata[key] = metadata[key];
    });

    var options = {
      uri: this.fullPath,
      method: 'POST',
      headers: this._createHeaders(newMetadata)
    };

    common.rackspace(options, callback, function (body, res) {
      this.metadata = newMetadata;
      callback(null, true);
    });
  },

  // Remark: This method is untested
  copy: function (container, destination, callback) {
    var copyOptions = {
      method: 'PUT',
      uri: this.fullPath,
      headers: {
        'X-COPY-DESTINATION': [container, destination].join('/'),
        'CONTENT-LENGTH': this.bytes
      }
    };

    common.rackspace(copyOptions, callback, function (body, res) {
      callback(null, true);
    });
  },

  destroy: function (callback) {
    this.client.destroyFile(this.containerName, this.name, callback);
  },

  // Remark: Not fully implemented
  getMetadata: function (callback) {
    common.rackspace('HEAD', this.fullPath, function (body, res) {
      var metadata = {};
      Object.keys(res.headers).forEach(function (header) {
        var match;
        if (match = header.match(/x-object-meta-(\w+)/i)) {
          metadata[match[1]] = res.headers[header];
        }
      });

      callback(null, metadata);
    });
  },

  // Remark: Not fully implemented
  removeMetadata: function (keys, callback) {
    var newMetadata = {};
    Object.keys(this.metadata).forEach(function (key) {
      if (keys.indexOf(key) !== -1) {
        newMetadata[key] = this.metadata[key];
      }
    });

    // TODO: Finish writing this method
  },

  save: function (options, callback) {
    var self = this;
    var writeFileStream = fs.createWriteStream(options.local, {
      flags: options.flags || 'w+',
      encoding: options.encoding || null,
      mode: options.mode || 0666
    });
    writeFileStream.on('error', callback);
    writeFileStream.on('close', function() {
      callback(null, options.local);
    });
    var readFileStream = fs.createReadStream(this.local, { 'bufferSize': 8 * 1024 });
    readFileStream.on('error', callback);
    readFileStream.pipe(writeFileStream);
  },

  update: function (data, callback) {

  },

  get fullPath() {
    return this.client.storageUrl(this.containerName, this.name);
  },

  get containerName() {
    return this.container instanceof cloudfiles.Container ? this.container.name : this.container;
  },

  _setProperties: function (details) {
    // TODO: Should probably take this in from details or something.
    this.metadata = {};

    this.container = details.container || null;
    this.name = details.name || null;
    this.etag = details.etag || null;
    this.hash = details.hash || null;
    this.bytes = details.bytes || null;
    this.local = details.local || null;
    this.contentType = details.content_type || null;
    this.lastModified = details.last_modified || null;
  },

  _createHeaders: function (metadata) {
    var headers = {};
    Object.keys(metadata).forEach(function (key) {
      var header = "x-object-meta-" + key;
      headers[header] = metadata[key];
    });

    return headers;
  }
};


text:
import { PageObject } from "../shared/page-object";

export class AccordionCardPageObject extends PageObject {
  public readonly body = this.host.locator(".card-body");
  public readonly header = this.host.locator(".card-header");

  public async activate(): Promise<void> {
    await this.host.locator(".card-header button").click();
  }
}


text:
package org.semanticweb.elk.owlapi.wrapper;

import org.semanticweb.elk.owl.interfaces.ElkInverseObjectPropertiesAxiom;
import org.semanticweb.elk.owl.interfaces.ElkObjectPropertyExpression;
import org.semanticweb.elk.owl.visitors.ElkInverseObjectPropertiesAxiomVisitor;
import org.semanticweb.elk.owl.visitors.ElkObjectPropertyAxiomVisitor;
import org.semanticweb.owlapi.model.OWLInverseObjectPropertiesAxiom;

/**
 * Implements the {@link ElkInverseObjectPropertiesAxiom} interface by wrapping
 * instances of {@link OWLInverseObjectPropertiesAxiom}
 *
 * @author Yevgeny Kazakov
 *
 * @param <T>
 *            the type of the wrapped object
 */
public class ElkInverseObjectPropertiesAxiomWrap<T extends OWLInverseObjectPropertiesAxiom>
		extends ElkObjectPropertyAxiomWrap<T> implements
		ElkInverseObjectPropertiesAxiom {

	public ElkInverseObjectPropertiesAxiomWrap(T owlInverseObjectPropertiesAxiom) {
		super(owlInverseObjectPropertiesAxiom);
	}

	@Override
	public ElkObjectPropertyExpression getFirstObjectPropertyExpression() {
		return converter.convert(this.owlObject.getFirstProperty());
	}

	@Override
	public ElkObjectPropertyExpression getSecondObjectPropertyExpression() {
		return converter.convert(this.owlObject.getSecondProperty());
	}

	@Override
	public <O> O accept(ElkObjectPropertyAxiomVisitor<O> visitor) {
		return accept((ElkInverseObjectPropertiesAxiomVisitor<O>) visitor);
	}

	@Override
	public <O> O accept(ElkInverseObjectPropertiesAxiomVisitor<O> visitor) {
		return visitor.visit(this);
	}

}


text:
package collectionjson

import org.scalatest.PropSpec
import io.Source
import org.json4s.native._
import jsonpicklers._

class CollectionJsonTest extends PropSpec {

  def source(name: String) = JsonParser.parse(Source.fromFile("src/test/resources/" + name).bufferedReader())

  def json(name: String) = {
    collectionjson.CollectionJson.collection.unpickle(source(name)) match {
      case Result.Success(_, _) =>
      //      println(s)

      case f: Result.Failure => fail(f.toString)
    }
  }

  property("minimal") {
    json("collectionjson/1-minimal.json")
  }

  property("collection") {
    json("collectionjson/2-collection.json")
  }

  property("item") {
    json("collectionjson/3-item.json")
  }

  property("queries") {
    json("collectionjson/4-queries.json")
  }

  property("template") {
    json("collectionjson/5-template.json")
  }

  property("error") {
    json("collectionjson/6-error.json")
  }
}


text:
Serve Swagger Editor

## Installing

```javascript
$ npm i swagger-editor-serve -S
```

## Using

### Default Configuration

```javascript
// starts the server and returns a promise that yields editor url object
const serve = require('./index');
serve()
  .then(c => console.log(c));
```

### Configuration Override

```javascript
const serve = require('./index');
serve({
  editorPath: '../node_modules/swagger-editor-dist',
  serverUrl: {
    port: 9000
  }
}).then(c => console.log(c));
```

## Node Compatibility

Requires Node >= 8

## License

[MIT](LICENSE)


text:
__author__ = 'Neil Butcher'

from widget_durations import DurationsWidget


text:
class AddCurrenciesRefToChargebackRateDetail < ActiveRecord::Migration
  def change
    add_column :chargeback_rate_details, :chargeback_rate_detail_currency_id, :bigint
  end
end


text:
YUI.add('attribute', function(Y) {

    /**
     * Managed Attribute Provider
     * @module attribute
     */

    /**
     * Maintain state for a collection of items.  Individual properties
     * are stored in hash tables.  This is instead of having state objects
     * for each item in the collection.  For large collections, especially
     * changing ones, this approach may perform better.
     *
     * @constructor
     * @class State
     */
    Y.State = function() {
        /**
         * Hash of attributes
         * @property data
         */
        this.data = {};
    };

    Y.State.prototype = {

        /**
         * Add an item with all of the properties in the supplied object.
         * @method add
         * @param name {string} identifier for this attribute
         * @param o hash of attributes
         */
        add: function(name, o) {
            Y.each(o, function(v, k) {
                if (!this.data[k]) {
                    this.data[k] = {};
                }

                this.data[k][name] = v;
            }, this);
        },

        /**
         * Remove entire item, or optionally specified fields
         * @method remove
         * @param name {string} name of attribute
         * @param o {string|object|array} single key or collection of keys to delete
         */
        remove: function(name, o) {
            var d = this.data,
                del = function(key) {
                    if (d[key] && (name in d[key])) {
                        delete d[key][name];
                    }
                };

            if (Y.Lang.isString(o)) {
                del(o);
            } else {
                Y.each(o || d, function(v, k) {
                    if(Y.Lang.isString(k)) {
                        del(k);
                    } else {
                        del(v);
                    }
                }, this);

            }
        },

        /**
         * For a given item, gets an attribute.  If key is not
         * supplied, a disposable object with all attributes is
         * returned.  Use of the latter option makes sense when
         * working with single items, but not if object explosion
         * might cause gc problems.
         * @method get
         * @param name {string} name of attribute
         * @param key {string} optional attribute to get
         * @return either the value of the supplied key or an object with
         * all data.
         */
        get: function(name, key) {
            var d = this.data,
                o;

            if (key) {
                return (d[key] && name in d[key]) ?  d[key][name] : undefined;
            } else {
                Y.each(d, function(v, k) {
                    if (name in d[k]) {
                        o = o || {};
                        o[k] = v[name];
                    }
                }, this);

                return o;

            }
        }
    };

    /**
     * Managed Attribute Provider
     * @module attribute
     */

    var O = Y.Object,

        DOT = ".",
        CHANGE = "Change",
        GETTER = "getter",
        SETTER = "setter",
        VALUE = "value",
        INIT = "init",
        INIT_VALUE = "initValue",
        READ_ONLY = "readOnly",
        WRITE_ONCE = "writeOnce",
        VALIDATOR = "validator",
        INVALID_VALUE,

        EventTarget = Y.EventTarget;

    /**
     *

     * Attribute provides managed attribute support.
     *

     *

     * The class is designed to be augmented onto a host class,
     * and allows the host to support getter/setter methods for attributes,
     * initial configuration support and attribute change events.
     *

     *
Attributes added to the host can:

     *

     *
Be defined as read-only.

     *
Be defined as write-once.

     *
Be defined with a setter function, used to manipulate
     *     values passed to Attribute's set method, before they are stored.

     *
Be defined with a validator function, to validate values before they are stored.

     *
Be defined with a getter function, which can be used to manipulate stored values,
     *     before they are returned by Attribute's get method.

     *

     *
     *
See the addAttr method, for details about how to add attributes with
     * a specific configuration

     *
     * @class Attribute
     * @uses Event.Target
     */
    function Attribute() {
        Y.log('Attribute constructor called', 'info', 'attribute');

        EventTarget.call(this, {emitFacade:true});
        this._conf = new Y.State();
    }

    Attribute.INVALID_VALUE = {};

    INVALID_VALUE = Attribute.INVALID_VALUE;

    Attribute.prototype = {
        /**
         *

         * Adds an attribute with the provided configuration to the host object. Intended
         * to be used by the host object to setup it's set of available attributes.
         *

         *

         * The config argument object literal supports the following optional properties:
         *

         *

         *
value <Any>

         *
The initial value to set on the attribute

         *
readOnly <Boolean>

         *
Whether or not the attribute is read only. Attributes having readOnly set to true
         *        cannot be set by invoking the set method.

         *
writeOnce <Boolean>

         *
Whether or not the attribute is "write once". Attributes having writeOnce set to true,
         *        can only have their values set once, be it through the default configuration,
         *        constructor configuration arguments, or by invoking set.

         *
setter <Function>

         *
The setter function to be invoked (within the context of the host object) before
         *        the attribute is stored by a call to the setter method. The value returned by the
         *        setter function will be the finally stored value.

         *
getter <Function>

         *
The getter function to be invoked (within the context of the host object) before
         *    the stored values is returned to a user invoking the getter method for the attribute.
         *    The value returned by the getter function is the final value which will be returned to the
         *    user when they invoke get.

         *
validator <Function>

         *
The validator function which is invoked prior to setting the stored value. Returning
         *    false from the validator function will prevent the value from being stored

         *

         *
         * @method addAttr
         *
         * @param {String} name The attribute key
         * @param {Object} config (optional) An object literal specifying the configuration for the attribute.
         * NOTE: The config object is modified when adding an attribute,
         * so if you need to protect the original values, you will need to merge or clone the object.
         *
         * @chainable
         */
        addAttr: function(name, config) {
            Y.log('Adding attribute: ' + name, 'info', 'attribute');

            if (!this.attrAdded(name)) {
                config = config || {};

                var value,
                    hasValue = (VALUE in config);

                if (config[READ_ONLY] && !hasValue) { Y.log('readOnly attribute: ' + name + ', added without an initial value. Value will be set on intial call to set', 'warn', 'attribute');}

                if(hasValue) {
                    // We'll go through set, don't want to set value in _conf directory
                    value = config.value;
                    delete config.value;
                }
                config[INIT] = true;
                this._conf.add(name, config);

                if (hasValue) {
                    // Go through set, so that raw values get normalized/validated
                    this.set(name, value);
                }
            } else {
                Y.log('Attribute: ' + name + ' already exists. Cannot add it again without removing it first', 'warn', 'attribute');
            }

            return this;
        },

        /**
         * Tests if the given attribute has been added to the host
         *
         * @method attrAdded
         * @param {String} name The name of the attribute to check.
         * @return boolean, true if an attribute with the given name has been added.
         */
        attrAdded: function(name) {
            return !!(this._conf.get(name, INIT));
        },

        /**
         * Removes an attribute.
         *
         * @method removeAttr
         * @param {String} name The attribute key
         */
        removeAttr: function(name) {
            this._conf.remove(name);
        },

        /**
         * Returns the current value of the attribute. If the attribute
         * has been configured with a 'getter' function, this method will delegate
         * to the 'getter' to obtain the value of the attribute.
         * The 'getter' will be passed the current value of the attribute
         * as the only argument.
         *
         * @method get
         *
         * @param {String} key The attribute whose value will be returned. If
         * the value of the attribute is an Object, dot notation can be used to
         * obtain the value of a property of the object (e.g. get("x.y.z"))
         *
         * @return {Any} The current value of the attribute
         */
        get : function(name) {

            var conf = this._conf,
                path,
                getFn,
                val;

            if (name.indexOf(DOT) !== -1) {
                path = name.split(DOT);
                name = path.shift();
            }

            val = conf.get(name, VALUE);
            getFn = conf.get(name, GETTER);

            val = (getFn) ? getFn.call(this, val) : val;
            val = (path) ? O.getValue(val, path) : val;

            return val;
        },

        /**
         * Sets the value of an attribute.
         *
         * @method set
         * @chainable
         *
         * @param {String} name The name of the attribute. Note, if the
         * value of the attribute is an Object, dot notation can be used
         * to set the value of a property within the object (e.g. set("x.y.z", 5)).
         *
         * @param {Any} value The value to apply to the attribute
         *
         * @param {Object} opts Optional event data. This object will be mixed into
         * the event facade passed as the first argument to subscribers
         * of attribute change events
         *
         * @return {Object} Reference to the host object
         */
        set : function(name, val, opts) {
            return this._setAttr(name, val, opts);
        },

        /**
         * Resets the given attribute or all attributes to the initial value.
         *
         * @method reset
         * @param {String} name optional An attribute to reset.  If omitted, all attributes are reset.
         * @chainable
         */
        reset : function(name) {
            if (name) {
                this._set(name, this._conf.get(name, INIT_VALUE));
            } else {
                var initVals = this._conf.data.initValue;
                Y.each(initVals, function(v, n) {
                    this._set(n, v);
                }, this);
            }
            return this;
        },

        /**
         * Allows setting of readOnly/writeOnce attributes.
         *
         * @method _set
         * @protected
         * @chainable
         *
         * @return {Object} Reference to the host object
         */
        _set : function(name, val, opts) {
            return this._setAttr(name, val, opts, true);
        },

        /**
         * Internal set implementation
         *
         * @method _setAttr
         * @protected
         * @chainable
         *
         * @param {String} name The name of the attribute. Note, if the
         * value of the attribute is an Object, dot notation can be used
         * to set the value of a property within the object
         * (e.g. set("x.y.z", 5)).
         *
         * @param {Any} value The value to apply to the attribute
         *
         * @param {Object} opts Optional event data. This object will be mixed into
         * the event facade passed as the first argument to subscribers
         * of attribute change events
         *
         * @param {boolean} force If true, allows the caller to set values for
         * readOnly or writeOnce attributes which have already been set.
         *
         * @return {Object} Reference to the host object
         */
        _setAttr : function(name, val, opts, force) {
            var conf = this._conf,
                data = conf.data,
                allowSet = true,
                initialSet = (!data.value || !(name in data.value)),
                strPath,
                path,
                currVal;

            if (name.indexOf(DOT) !== -1) {
                strPath = name;
                path = name.split(DOT);
                name = path.shift();
            }

            // TODO: Performance pass - prevent allowSet fallthrough
            if (!initialSet && !force) {
                if (conf.get(name, WRITE_ONCE)) {
                    Y.log('Set attribute:' + name + ', aborted; Attribute is writeOnce', 'warn', 'attribute');
                    allowSet = false;
                }
                if (conf.get(name, READ_ONLY)) {
                    Y.log('Set attribute:' + name + ', aborted; Attribute is readOnly', 'warn', 'attribute');
                    allowSet = false;
                }
            }

            if (!conf.get(name)) {
                Y.log('Set attribute:' + name + ', aborted; Attribute is not configured', 'warn', 'attribute');
                allowSet = false;
            }

            currVal = this.get(name);

            if (path) {
               val = O.setValue(Y.clone(currVal), path, val);

               if (val === undefined) {
                   Y.log('Set attribute path:' + strPath + ', aborted; Path is invalid', 'warn', 'attribute');
                   allowSet = false;
               }
            }

            if (allowSet) {
                this._fireAttrChange(name, currVal, val, name, strPath, opts);
            }

            return this;
        },

        /**
         * Utility method to help setup the event payload and
         * fire the attribute change event.
         *
         * @method _fireAttrChange
         * @private
         * @param {String} type The event name
         * @param {Any} currVal The current value of the attribute
         * @param {Any} newVal The new value of the attribute
         * @param {String} attrName The name of the attribute
         * @param {String} strFullPath The full path of the property being changed,
         * if this is a sub-attribute value being change
         * @param {Object} opts Any additional event data to mix into the attribute change event's event facade.
         */
        _fireAttrChange : function(type, currVal, newVal, attrName, strFullPath, opts) {
            type = type + CHANGE;

            // TODO: Publishing temporarily, while we address event bubbling/queuing
            this.publish(type, {queuable:false, defaultFn:this._defAttrChangeFn, silent:true});

            var eData = {
                type: type,
                prevVal: currVal,
                newVal: newVal,
                attrName: attrName,
                subAttrName: strFullPath
            };

            if (opts) {
                Y.mix(eData, opts);
            }

            this.fire(eData);
        },

        /**
         * Default handler implementation for Attribute change events
         *
         * @private
         * @method _defAttrChangeFn
         * @param {Event.Facade} e The event object for the custom event
         */
        _defAttrChangeFn : function(e) {

            var allowSet = true,
                conf = this._conf,
                name = e.attrName,
                val = e.newVal,
                valFn  = conf.get(name, VALIDATOR),
                setFn = conf.get(name, SETTER),
                storedVal,
                retVal;

            if (!valFn || valFn.call(this, val)) {
                if (setFn) {
                    retVal = setFn.call(this, val);
                    if (retVal === INVALID_VALUE) {
                        allowSet = false;
                        Y.log('Attribute: ' + name + ', setter returned Attribute.INVALID_VALUE for value:' + val, 'warn', 'attribute');
                    } else if (retVal !== undefined){
                        Y.log('Attribute: ' + name + ', raw value: ' + val + ' modified by setter to:' + retVal, 'info', 'attribute');
                        val = retVal;
                    }
                }
            } else {
                Y.log('Attribute:' + name + ', Validation failed for value:' + val, 'warn', 'attribute');
                allowSet = false;
            }

            if (!e.subAttrName && val === e.prevVal) {
                Y.log('Attribute: ' + name + ', value unchanged:' + val, 'warn', 'attribute');
                allowSet = false;
            }

            if (allowSet) {
                // Store value
                storedVal = { value: val };
                if (conf.get(name, INIT_VALUE) === undefined) {
                    storedVal[INIT_VALUE] = val;
                }
                conf.add(name, storedVal);

                // Honor set normalization
                e.newVal = conf.get(name, VALUE);
            } else {
                Y.log('State not updated and stopImmediatePropagation called for attribute: ' + name + ' , value:' + val, 'warn', 'attribute');

                // Prevent "after" listeners from being
                // invoked since nothing changed.
                e.stopImmediatePropagation();
            }
        },

        /**
         * Sets multiple attribute values.
         *
         * @method setAttrs
         * @param {Object} attrs  A hash of attributes: name/value pairs
         * @chainable
         */
        setAttrs : function(attrs) {
            for (var attr in attrs) {
                if ( attrs.hasOwnProperty(attr) ) {
                    this.set(attr, attrs[attr]);
                }
            }
            return this;
        },

        /**
         * Gets multiple attribute values.
         *
         * @method getAttrs
         * @param {Array | Boolean} attrs Optional. An array of attribute names, whose values are required. If omitted, all attribute values are
         * returned. If set to true, all attributes modified from their original values are returned.
         * @return {Object} A hash of attributes: name/value pairs
         */
        getAttrs : function(attrs) {
            var o = {}, i, l, attr, val,
                modifiedOnly = (attrs === true);

            attrs = (attrs && !modifiedOnly) ? attrs : O.keys(this._conf.data[VALUE]);

            for (i = 0, l = attrs.length; i < l; i++) {
                // Go through get, to honor cloning/normalization
                attr = attrs[i];
                val = this.get(attr);

                if (!modifiedOnly || this._conf.get(attr, VALUE) != this._conf.get(attr, INIT_VALUE)) {
                    o[attr] = this.get(attr);
                }
            }

            return o;
        },

        /**
         * Configures attributes, and sets initial values
         *
         * @method addAttrs
         * @chainable
         *
         * @param {Object} cfgs Name/value hash of attribute configuration literals.
         * @param {Object} values Name/value hash of initial values to apply. Values defined in the configuration hash will be over-written by the initial values hash unless read-only.
         */
        addAttrs : function(cfgs, values) {
            if (cfgs) {
                var attr,
                    attrCfg,
                    value;

                values = this._splitAttrVals(values);

                for (attr in cfgs) {
                    if (cfgs.hasOwnProperty(attr)) {

                        // Not Merging. Caller is responsible for isolating configs
                        attrCfg = cfgs[attr];

                        // Handle simple, complex and user values, accounting for read-only
                        value = this._getAttrInitVal(attr, attrCfg, values);

                        if (value !== undefined) {
                            attrCfg.value = value;
                        }

                        this.addAttr(attr, attrCfg);
                    }
                }
            }
            return this;
        },

        /**
         * Utility to split out regular attribute values
         * from complex attribute values, so that complex
         * attributes can be keyed by top level attribute name.
         *
         * @method _splitAttrValues
         * @param {Object} valueHash Name/value hash of initial values
         *
         * @return {Object} Object literal with 2 properties - "simple" and "complex",
         * containing simple and complex attribute values respectively keyed
         * by attribute the top level attribute name.
         * @private
         */
        _splitAttrVals : function(valueHash) {
            var vals = {},
                subvals = {},
                path,
                attr,
                v, k;

            for (k in valueHash) {
                if (valueHash.hasOwnProperty(k)) {
                    if (k.indexOf(DOT) !== -1) {
                        path = k.split(DOT);
                        attr = path.shift();
                        v = subvals[attr] = subvals[attr] || [];
                        v[v.length] = {
                            path : path,
                            value: valueHash[k]
                        };
                    } else {
                        vals[k] = valueHash[k];
                    }
                }
            }
            return { simple:vals, complex:subvals };
        },

        /**
         * Returns the initial value of the given attribute from
         * either the default configuration provided, or the
         * over-ridden value if it exists in the initValues
         * hash provided, if the attribute is not read-only.
         *
         * @param {String} attr Attribute name
         * @param {Object} cfg Default attribute configuration object literal
         * @param {Object} initValues Name/Value hash of initial attribute values from _splitAttrVals
         *
         * @return {Any} Initial value of the attribute.
         *
         * @method _getAttrInitVal
         * @private
         */
        _getAttrInitVal : function(attr, cfg, initValues) {

            var val = (cfg.valueFn) ? cfg.valueFn.call(this) : cfg.value,
                simple,
                complex,
                i,
                l,
                path,
                subval,
                subvals;

            if (!cfg[READ_ONLY] && initValues) {

                // Simple Attributes
                simple = initValues.simple;
                if (simple && simple.hasOwnProperty(attr)) {
                    val = simple[attr];
                }

                // Complex Attributes (complex values applied, after simple, incase both are set)
                complex = initValues.complex;
                if (complex && complex.hasOwnProperty(attr)) {
                    subvals = complex[attr];
                    for (i = 0, l = subvals.length; i < l; ++i) {
                        path = subvals[i].path;
                        subval = subvals[i].value;
                        O.setValue(val, path, subval);
                    }
                }
            }

            return val;
        }
    };

    // Basic prototype augment - no lazy constructor invocation.
    Y.mix(Attribute, EventTarget, false, null, 1);

    Y.Attribute = Attribute;

}, '@VERSION@' ,{requires:['event-custom']});


text:
<?php
namespace tests\acceptance\user;

use \WebGuy;
use tests\acceptance\pages\LoginPage;
use tests\acceptance\pages\CommonPage;
use tests\acceptance\user\steps\UserSteps;
use tests\acceptance\pages\EditProfilePage;

class UserEditProfileCest
{
    public function testEditUserProfile(WebGuy $I, $scenario)
    {
//        $I->dontSeeLink(EditProfilePage::URL);
        $I->amOnPage(EditProfilePage::URL);
        $I->seeInCurrentUrl('login');
        $I->wantTo('Test user profile form...');

        $I = new UserSteps($scenario);
        $I->login(LoginPage::$userEmail, LoginPage::$userPassword);
        $I->amOnPage(EditProfilePage::URL);
        $I->see('E-Mail проверен', '.text-success');
        $I->seeInTitle('Профиль пользователя');
        $I->seeInField(EditProfilePage::$emailField, LoginPage::$userEmail);
        $I->see('Сохранить профиль', CommonPage::BTN_PRIMARY_CSS_CLASS);

        $I->wantTo('Test change user email...');
        $I = new UserSteps($scenario);
        $I->logout();
        $I->changeEmail('test2@yupe.local');
    }
}


text:
class Solution(object):
    answer = []
    def dfs(self, left, right, paren):
        if left > right or left < 0 or right < 0:
            return

        if left == 0 and right == 0:
            self.answer.append(paren)

        self.dfs(left - 1, right, paren + '(')
        self.dfs(left, right - 1, paren + ')')

    def generateParenthesis(self, n):
        self.answer = []
        self.dfs(n, n, )
        return self.answer


text:
require "lita"
require "lita/adapters/xmpp/connector"

module Lita
  module Adapters
    class Xmpp < Adapter
      config :jid, type: String, required: true
      config :password, type: String, required: true
      config :debug, types: [TrueClass, FalseClass], default: false
      config :rooms, type: Array
      config :muc_domain, type: String
      config :connect_domain, type: String

      attr_reader :connector

      def initialize(robot)
        super

        @connector = Connector.new(
          robot,
          config.jid,
          config.password,
          debug: config.debug,
          connect_domain: config.connect_domain
        )
      end

      def run
        connector.connect
        connector.join_rooms(config.muc_domain, rooms)
        sleep
      rescue Interrupt
        shut_down
      end

      def join(room_id)
        connector.join_rooms(config.muc_domain, Array(room_id))
      end

      def part(room_id)
        connector.part_rooms(config.muc_domain, Array(room_id))
      end

      def send_messages(target, strings)
        if target.room
          connector.message_muc(target.room, strings)
        else
          connector.message_jid(target.user.id, strings)
        end
      end

      def send_raw_messages(target, strings)
        if target.room
          connector.message_muc(target.room, strings, true)
        else
          connector.message_jid(target.user.id, strings)
        end
      end

      def set_topic(target, topic)
        connector.set_topic(target.room, topic)
      end

      def shut_down
        connector.shut_down
      end

      private

      def config
        Lita.config.adapters.xmpp
      end

      def rooms
        if config.rooms == :all
          connector.list_rooms(config.muc_domain)
        else
          Array(config.rooms)
        end
      end
    end

    Lita.register_adapter(:xmpp, Xmpp)
  end
end


text:
def index():
    redirect(URL(c='default', f='index'))

def show_products():
    if request.vars.category:
        product_list = db(db.product.default_category == request.vars.category).select(limitby=(0,20),
                                                                            orderby=db.product.name)
    else:
        product_list = db(db.product).select(limitby=(0,20), orderby=~db.product.name)
    return locals()

def show_product():
    id_product = request.args(0) or redirect(URL(c='default', f='index'))
    id_category = request.args(1)
    get_product = db(db.product.id == id_product).select()
    get_recommended = db((db.product.default_category == id_category)&(db.product.id != id_product)).select(limitby=(0,3))

    return locals()

def product():
    if not request.args: redirect(URL(c='default',f='index'))
    try:
        int(request.args(0))
    except ValueError:
        raise HTTP(404, 'Product not found. Invalid ID.')

    product = db(db.product.id == int(request.args(0))).select().first()
    specification = db(db.specification.product == product.id).select().first()
    reviews = db(db.review.product == product.id).select()

    form = SQLFORM.factory(
        Field('quantity', 'integer', default=1),
        _class="form-inline"
        )
    if form.accepts(request.vars, session):
        quantity = int(form.vars.quantity)
        if quantity > product.quantity or quantity <= 0:
            response.flash = T('Unavailable quantity.')
        else:
            for prod in session.cart:
                if prod[0] == product.id:
                    prod[1] += quantity
                    break
                else:
                    session.cart.append([product.id, quantity])
                    break
            else:
                session.cart.append([product.id, quantity])
            redirect(URL(c='default',f='checkout'))

    return dict(product=product, specification=specification, reviews=reviews, form=form)

@cache.action()
def download():
    """
    allows downloading of uploaded files
    http://..../[app]/default/download/[filename]
    """
    return response.download(request, db)


text:
import { MessageKey, QueryKey, Type, EnumType, registerSymbol } from '../../../Framework/Signum.React/Scripts/Reflection'
import * as Entities from '../../../Framework/Signum.React/Scripts/Signum.Entities'
import * as Basics from '../../../Framework/Signum.React/Scripts/Signum.Entities.Basics'
import * as Signum from '../Basics/Signum.Entities.Basics'
import * as Mailing from '../Mailing/Signum.Entities.Mailing'

export interface UserEntity {
    newPassword: string;
}

export module ActiveDirectoryAuthorizerMessage {
  export const ActiveDirectoryUser0IsNotAssociatedWithAUserInThisApplication = new MessageKey("ActiveDirectoryAuthorizerMessage", "ActiveDirectoryUser0IsNotAssociatedWithAUserInThisApplication");
}

export const ActiveDirectoryConfigurationEmbedded = new Type<ActiveDirectoryConfigurationEmbedded>("ActiveDirectoryConfigurationEmbedded");
export interface ActiveDirectoryConfigurationEmbedded extends Entities.EmbeddedEntity {
  Type: "ActiveDirectoryConfigurationEmbedded";
  domainName: string | null;
  domainServer: string | null;
  azure_ApplicationID: string | null;
  azure_DirectoryID: string | null;
  loginWithWindowsAuthenticator: boolean;
  loginWithActiveDirectoryRegistry: boolean;
  loginWithAzureAD: boolean;
  allowSimpleUserNames: boolean;
  autoCreateUsers: boolean;
  roleMapping: Entities.MList<RoleMappingEmbedded>;
  defaultRole: Entities.Lite<RoleEntity> | null;
}

export interface AllowedRule<R, A> extends Entities.ModelEntity {
  allowedBase: A;
  allowed: A;
  resource: R;
}

export interface AllowedRuleCoerced<R, A> extends AllowedRule<R, A> {
  coercedValues: A[];
}

export module AuthAdminMessage {
  export const _0of1 = new MessageKey("AuthAdminMessage", "_0of1");
  export const Nothing = new MessageKey("AuthAdminMessage", "Nothing");
  export const Everything = new MessageKey("AuthAdminMessage", "Everything");
  export const TypeRules = new MessageKey("AuthAdminMessage", "TypeRules");
  export const PermissionRules = new MessageKey("AuthAdminMessage", "PermissionRules");
  export const Allow = new MessageKey("AuthAdminMessage", "Allow");
  export const Deny = new MessageKey("AuthAdminMessage", "Deny");
  export const Overriden = new MessageKey("AuthAdminMessage", "Overriden");
  export const NoRoles = new MessageKey("AuthAdminMessage", "NoRoles");
  export const Filter = new MessageKey("AuthAdminMessage", "Filter");
  export const PleaseSaveChangesFirst = new MessageKey("AuthAdminMessage", "PleaseSaveChangesFirst");
  export const ResetChanges = new MessageKey("AuthAdminMessage", "ResetChanges");
  export const SwitchTo = new MessageKey("AuthAdminMessage", "SwitchTo");
  export const _0InUI = new MessageKey("AuthAdminMessage", "_0InUI");
  export const _0InDB = new MessageKey("AuthAdminMessage", "_0InDB");
  export const CanNotBeModified = new MessageKey("AuthAdminMessage", "CanNotBeModified");
  export const CanNotBeModifiedBecauseIsA0 = new MessageKey("AuthAdminMessage", "CanNotBeModifiedBecauseIsA0");
  export const CanNotBeModifiedBecauseIsNotA0 = new MessageKey("AuthAdminMessage", "CanNotBeModifiedBecauseIsNotA0");
  export const _0RulesFor1 = new MessageKey("AuthAdminMessage", "_0RulesFor1");
  export const TheUserStateMustBeDisabled = new MessageKey("AuthAdminMessage", "TheUserStateMustBeDisabled");
  export const _0CyclesHaveBeenFoundInTheGraphOfRolesDueToTheRelationships = new MessageKey("AuthAdminMessage", "_0CyclesHaveBeenFoundInTheGraphOfRolesDueToTheRelationships");
  export const Save = new MessageKey("AuthAdminMessage", "Save");
}

export module AuthEmailMessage {
  export const YouRecentlyRequestedANewPassword = new MessageKey("AuthEmailMessage", "YouRecentlyRequestedANewPassword");
  export const YourUsernameIs = new MessageKey("AuthEmailMessage", "YourUsernameIs");
  export const YouCanResetYourPasswordByFollowingTheLinkBelow = new MessageKey("AuthEmailMessage", "YouCanResetYourPasswordByFollowingTheLinkBelow");
  export const ResetPasswordRequestSubject = new MessageKey("AuthEmailMessage", "ResetPasswordRequestSubject");
  export const YourResetPasswordRequestHasExpired = new MessageKey("AuthEmailMessage", "YourResetPasswordRequestHasExpired");
  export const WeHaveSendYouAnEmailToResetYourPassword = new MessageKey("AuthEmailMessage", "WeHaveSendYouAnEmailToResetYourPassword");
  export const EmailNotFound = new MessageKey("AuthEmailMessage", "EmailNotFound");
}

export module AuthMessage {
  export const NotAuthorizedTo0The1WithId2 = new MessageKey("AuthMessage", "NotAuthorizedTo0The1WithId2");
  export const NotAuthorizedToRetrieve0 = new MessageKey("AuthMessage", "NotAuthorizedToRetrieve0");
}

export const AuthThumbnail = new EnumType<AuthThumbnail>("AuthThumbnail");
export type AuthThumbnail =
  "All" |
  "Mix" |
  "None";

export const AuthTokenConfigurationEmbedded = new Type<AuthTokenConfigurationEmbedded>("AuthTokenConfigurationEmbedded");
export interface AuthTokenConfigurationEmbedded extends Entities.EmbeddedEntity {
  Type: "AuthTokenConfigurationEmbedded";
  refreshTokenEvery: number;
  refreshAnyTokenPreviousTo: string | null;
}

export interface BaseRulePack<T> extends Entities.ModelEntity {
  role: Entities.Lite<RoleEntity>;
  strategy: string;
  rules: Entities.MList<T>;
}

export module BasicPermission {
  export const AdminRules : PermissionSymbol = registerSymbol("Permission", "BasicPermission.AdminRules");
  export const AutomaticUpgradeOfProperties : PermissionSymbol = registerSymbol("Permission", "BasicPermission.AutomaticUpgradeOfProperties");
  export const AutomaticUpgradeOfQueries : PermissionSymbol = registerSymbol("Permission", "BasicPermission.AutomaticUpgradeOfQueries");
  export const AutomaticUpgradeOfOperations : PermissionSymbol = registerSymbol("Permission", "BasicPermission.AutomaticUpgradeOfOperations");
}

export module LoginAuthMessage {
  export const ThePasswordMustHaveAtLeast0Characters = new MessageKey("LoginAuthMessage", "ThePasswordMustHaveAtLeast0Characters");
  export const NotUserLogged = new MessageKey("LoginAuthMessage", "NotUserLogged");
  export const Username0IsNotValid = new MessageKey("LoginAuthMessage", "Username0IsNotValid");
  export const User0IsDisabled = new MessageKey("LoginAuthMessage", "User0IsDisabled");
  export const IncorrectPassword = new MessageKey("LoginAuthMessage", "IncorrectPassword");
  export const Login = new MessageKey("LoginAuthMessage", "Login");
  export const Password = new MessageKey("LoginAuthMessage", "Password");
  export const ChangePassword = new MessageKey("LoginAuthMessage", "ChangePassword");
  export const SwitchUser = new MessageKey("LoginAuthMessage", "SwitchUser");
  export const Logout = new MessageKey("LoginAuthMessage", "Logout");
  export const EnterYourUserNameAndPassword = new MessageKey("LoginAuthMessage", "EnterYourUserNameAndPassword");
  export const Username = new MessageKey("LoginAuthMessage", "Username");
  export const RememberMe = new MessageKey("LoginAuthMessage", "RememberMe");
  export const IHaveForgottenMyPassword = new MessageKey("LoginAuthMessage", "IHaveForgottenMyPassword");
  export const ShowLoginForm = new MessageKey("LoginAuthMessage", "ShowLoginForm");
  export const LoginWithWindowsUser = new MessageKey("LoginAuthMessage", "LoginWithWindowsUser");
  export const NoWindowsUserFound = new MessageKey("LoginAuthMessage", "NoWindowsUserFound");
  export const LooksLikeYourWindowsUserIsNotAllowedToUseThisApplication = new MessageKey("LoginAuthMessage", "LooksLikeYourWindowsUserIsNotAllowedToUseThisApplication");
  export const IForgotMyPassword = new MessageKey("LoginAuthMessage", "IForgotMyPassword");
  export const EnterYourUserEmail = new MessageKey("LoginAuthMessage", "EnterYourUserEmail");
  export const SendEmail = new MessageKey("LoginAuthMessage", "SendEmail");
  export const GiveUsYourUserEmailToResetYourPassword = new MessageKey("LoginAuthMessage", "GiveUsYourUserEmailToResetYourPassword");
  export const RequestAccepted = new MessageKey("LoginAuthMessage", "RequestAccepted");
  export const PasswordMustHaveAValue = new MessageKey("LoginAuthMessage", "PasswordMustHaveAValue");
  export const PasswordsAreDifferent = new MessageKey("LoginAuthMessage", "PasswordsAreDifferent");
  export const PasswordChanged = new MessageKey("LoginAuthMessage", "PasswordChanged");
  export const PasswordHasBeenChangedSuccessfully = new MessageKey("LoginAuthMessage", "PasswordHasBeenChangedSuccessfully");
  export const NewPassword = new MessageKey("LoginAuthMessage", "NewPassword");
  export const EnterTheNewPassword = new MessageKey("LoginAuthMessage", "EnterTheNewPassword");
  export const ConfirmNewPassword = new MessageKey("LoginAuthMessage", "ConfirmNewPassword");
  export const EnterActualPasswordAndNewOne = new MessageKey("LoginAuthMessage", "EnterActualPasswordAndNewOne");
  export const CurrentPassword = new MessageKey("LoginAuthMessage", "CurrentPassword");
  export const WeHaveSentYouAnEmailToResetYourPassword = new MessageKey("LoginAuthMessage", "WeHaveSentYouAnEmailToResetYourPassword");
  export const UserNameMustHaveAValue = new MessageKey("LoginAuthMessage", "UserNameMustHaveAValue");
  export const InvalidUsernameOrPassword = new MessageKey("LoginAuthMessage", "InvalidUsernameOrPassword");
  export const InvalidUsername = new MessageKey("LoginAuthMessage", "InvalidUsername");
  export const InvalidPassword = new MessageKey("LoginAuthMessage", "InvalidPassword");
  export const AnErrorOccurredRequestNotProcessed = new MessageKey("LoginAuthMessage", "AnErrorOccurredRequestNotProcessed");
  export const TheUserIsNotLongerInTheDatabase = new MessageKey("LoginAuthMessage", "TheUserIsNotLongerInTheDatabase");
  export const Register0 = new MessageKey("LoginAuthMessage", "Register0");
  export const Success = new MessageKey("LoginAuthMessage", "Success");
  export const _0HasBeenSucessfullyAssociatedWithUser1InThisDevice = new MessageKey("LoginAuthMessage", "_0HasBeenSucessfullyAssociatedWithUser1InThisDevice");
  export const TryToLogInWithIt = new MessageKey("LoginAuthMessage", "TryToLogInWithIt");
  export const LoginWith0 = new MessageKey("LoginAuthMessage", "LoginWith0");
}

export const MergeStrategy = new EnumType<MergeStrategy>("MergeStrategy");
export type MergeStrategy =
  "Union" |
  "Intersection";

export const OperationAllowed = new EnumType<OperationAllowed>("OperationAllowed");
export type OperationAllowed =
  "None" |
  "DBOnly" |
  "Allow";

export const OperationAllowedRule = new Type<OperationAllowedRule>("OperationAllowedRule");
export interface OperationAllowedRule extends AllowedRuleCoerced<OperationTypeEmbedded, OperationAllowed> {
  Type: "OperationAllowedRule";
}

export const OperationRulePack = new Type<OperationRulePack>("OperationRulePack");
export interface OperationRulePack extends BaseRulePack<OperationAllowedRule> {
  Type: "OperationRulePack";
  type: Basics.TypeEntity;
}

export const OperationTypeEmbedded = new Type<OperationTypeEmbedded>("OperationTypeEmbedded");
export interface OperationTypeEmbedded extends Entities.EmbeddedEntity {
  Type: "OperationTypeEmbedded";
  operation: Entities.OperationSymbol;
  type: Basics.TypeEntity;
}

export const PasswordExpiresIntervalEntity = new Type<PasswordExpiresIntervalEntity>("PasswordExpiresInterval");
export interface PasswordExpiresIntervalEntity extends Entities.Entity {
  Type: "PasswordExpiresInterval";
  days: number;
  daysWarning: number;
  enabled: boolean;
}

export module PasswordExpiresIntervalOperation {
  export const Save : Entities.ExecuteSymbol<PasswordExpiresIntervalEntity> = registerSymbol("Operation", "PasswordExpiresIntervalOperation.Save");
}

export const PermissionAllowedRule = new Type<PermissionAllowedRule>("PermissionAllowedRule");
export interface PermissionAllowedRule extends AllowedRule<PermissionSymbol, boolean> {
  Type: "PermissionAllowedRule";
}

export const PermissionRulePack = new Type<PermissionRulePack>("PermissionRulePack");
export interface PermissionRulePack extends BaseRulePack<PermissionAllowedRule> {
  Type: "PermissionRulePack";
}

export const PermissionSymbol = new Type<PermissionSymbol>("Permission");
export interface PermissionSymbol extends Entities.Symbol {
  Type: "Permission";
}

export const PropertyAllowed = new EnumType<PropertyAllowed>("PropertyAllowed");
export type PropertyAllowed =
  "None" |
  "Read" |
  "Write";

export const PropertyAllowedRule = new Type<PropertyAllowedRule>("PropertyAllowedRule");
export interface PropertyAllowedRule extends AllowedRuleCoerced<Basics.PropertyRouteEntity, PropertyAllowed> {
  Type: "PropertyAllowedRule";
}

export const PropertyRulePack = new Type<PropertyRulePack>("PropertyRulePack");
export interface PropertyRulePack extends BaseRulePack<PropertyAllowedRule> {
  Type: "PropertyRulePack";
  type: Basics.TypeEntity;
}

export const QueryAllowed = new EnumType<QueryAllowed>("QueryAllowed");
export type QueryAllowed =
  "None" |
  "EmbeddedOnly" |
  "Allow";

export const QueryAllowedRule = new Type<QueryAllowedRule>("QueryAllowedRule");
export interface QueryAllowedRule extends AllowedRuleCoerced<Basics.QueryEntity, QueryAllowed> {
  Type: "QueryAllowedRule";
}

export const QueryRulePack = new Type<QueryRulePack>("QueryRulePack");
export interface QueryRulePack extends BaseRulePack<QueryAllowedRule> {
  Type: "QueryRulePack";
  type: Basics.TypeEntity;
}

export const ResetPasswordRequestEntity = new Type<ResetPasswordRequestEntity>("ResetPasswordRequest");
export interface ResetPasswordRequestEntity extends Entities.Entity {
  Type: "ResetPasswordRequest";
  code: string;
  user: UserEntity;
  requestDate: string;
  lapsed: boolean;
}

export module ResetPasswordRequestOperation {
  export const Execute : Entities.ExecuteSymbol<ResetPasswordRequestEntity> = registerSymbol("Operation", "ResetPasswordRequestOperation.Execute");
}

export const RoleEntity = new Type<RoleEntity>("Role");
export interface RoleEntity extends Entities.Entity {
  Type: "Role";
  name: string;
  mergeStrategy: MergeStrategy;
  roles: Entities.MList<Entities.Lite<RoleEntity>>;
}

export const RoleMappingEmbedded = new Type<RoleMappingEmbedded>("RoleMappingEmbedded");
export interface RoleMappingEmbedded extends Entities.EmbeddedEntity {
  Type: "RoleMappingEmbedded";
  aDNameOrGuid: string;
  role: Entities.Lite<RoleEntity>;
}

export module RoleOperation {
  export const Save : Entities.ExecuteSymbol<RoleEntity> = registerSymbol("Operation", "RoleOperation.Save");
  export const Delete : Entities.DeleteSymbol<RoleEntity> = registerSymbol("Operation", "RoleOperation.Delete");
}

export module RoleQuery {
  export const RolesReferedBy = new QueryKey("RoleQuery", "RolesReferedBy");
}

export interface RuleEntity<R, A> extends Entities.Entity {
  role: Entities.Lite<RoleEntity>;
  resource: R;
  allowed: A;
}

export const RuleOperationEntity = new Type<RuleOperationEntity>("RuleOperation");
export interface RuleOperationEntity extends RuleEntity<OperationTypeEmbedded, OperationAllowed> {
  Type: "RuleOperation";
}

export const RulePermissionEntity = new Type<RulePermissionEntity>("RulePermission");
export interface RulePermissionEntity extends RuleEntity<PermissionSymbol, boolean> {
  Type: "RulePermission";
}

export const RulePropertyEntity = new Type<RulePropertyEntity>("RuleProperty");
export interface RulePropertyEntity extends RuleEntity<Basics.PropertyRouteEntity, PropertyAllowed> {
  Type: "RuleProperty";
}

export const RuleQueryEntity = new Type<RuleQueryEntity>("RuleQuery");
export interface RuleQueryEntity extends RuleEntity<Basics.QueryEntity, QueryAllowed> {
  Type: "RuleQuery";
}

export const RuleTypeConditionEmbedded = new Type<RuleTypeConditionEmbedded>("RuleTypeConditionEmbedded");
export interface RuleTypeConditionEmbedded extends Entities.EmbeddedEntity {
  Type: "RuleTypeConditionEmbedded";
  condition: Signum.TypeConditionSymbol;
  allowed: TypeAllowed;
}

export const RuleTypeEntity = new Type<RuleTypeEntity>("RuleType");
export interface RuleTypeEntity extends RuleEntity<Basics.TypeEntity, TypeAllowed> {
  Type: "RuleType";
  conditions: Entities.MList<RuleTypeConditionEmbedded>;
}

export const SessionLogEntity = new Type<SessionLogEntity>("SessionLog");
export interface SessionLogEntity extends Entities.Entity {
  Type: "SessionLog";
  user: Entities.Lite<UserEntity>;
  sessionStart: string;
  sessionEnd: string | null;
  sessionTimeOut: boolean;
  userHostAddress: string | null;
  userAgent: string | null;
}

export module SessionLogPermission {
  export const TrackSession : PermissionSymbol = registerSymbol("Permission", "SessionLogPermission.TrackSession");
}

export const TypeAllowed = new EnumType<TypeAllowed>("TypeAllowed");
export type TypeAllowed =
  "None" |
  "DBReadUINone" |
  "Read" |
  "DBWriteUINone" |
  "DBWriteUIRead" |
  "Write";

export const TypeAllowedAndConditions = new Type<TypeAllowedAndConditions>("TypeAllowedAndConditions");
export interface TypeAllowedAndConditions extends Entities.ModelEntity {
  Type: "TypeAllowedAndConditions";
  fallback: TypeAllowed | null;
  conditions: Entities.MList<TypeConditionRuleEmbedded>;
}

export const TypeAllowedBasic = new EnumType<TypeAllowedBasic>("TypeAllowedBasic");
export type TypeAllowedBasic =
  "None" |
  "Read" |
  "Write";

export const TypeAllowedRule = new Type<TypeAllowedRule>("TypeAllowedRule");
export interface TypeAllowedRule extends AllowedRule<Basics.TypeEntity, TypeAllowedAndConditions> {
  Type: "TypeAllowedRule";
  properties: AuthThumbnail | null;
  operations: AuthThumbnail | null;
  queries: AuthThumbnail | null;
  availableConditions: Array<Signum.TypeConditionSymbol>;
}

export const TypeConditionRuleEmbedded = new Type<TypeConditionRuleEmbedded>("TypeConditionRuleEmbedded");
export interface TypeConditionRuleEmbedded extends Entities.EmbeddedEntity {
  Type: "TypeConditionRuleEmbedded";
  typeCondition: Signum.TypeConditionSymbol;
  allowed: TypeAllowed;
}

export const TypeRulePack = new Type<TypeRulePack>("TypeRulePack");
export interface TypeRulePack extends BaseRulePack<TypeAllowedRule> {
  Type: "TypeRulePack";
}

export const UserEntity = new Type<UserEntity>("User");
export interface UserEntity extends Entities.Entity, Mailing.IEmailOwnerEntity, Basics.IUserEntity {
  Type: "User";
  userName: string;
  passwordHash: string;
  role: Entities.Lite<RoleEntity>;
  email: string | null;
  cultureInfo: Signum.CultureInfoEntity | null;
  disabledOn: string | null;
  state: UserState;
}

export const UserOIDMixin = new Type<UserOIDMixin>("UserOIDMixin");
export interface UserOIDMixin extends Entities.MixinEntity {
  Type: "UserOIDMixin";
  oID: string | null;
}

export module UserOperation {
  export const Create : Entities.ConstructSymbol_Simple<UserEntity> = registerSymbol("Operation", "UserOperation.Create");
  export const Save : Entities.ExecuteSymbol<UserEntity> = registerSymbol("Operation", "UserOperation.Save");
  export const Enable : Entities.ExecuteSymbol<UserEntity> = registerSymbol("Operation", "UserOperation.Enable");
  export const Disable : Entities.ExecuteSymbol<UserEntity> = registerSymbol("Operation", "UserOperation.Disable");
  export const SetPassword : Entities.ExecuteSymbol<UserEntity> = registerSymbol("Operation", "UserOperation.SetPassword");
}

export const UserState = new EnumType<UserState>("UserState");
export type UserState =
  "New" |
  "Saved" |
  "Disabled";

export const UserTicketEntity = new Type<UserTicketEntity>("UserTicket");
export interface UserTicketEntity extends Entities.Entity {
  Type: "UserTicket";
  user: Entities.Lite<UserEntity>;
  ticket: string;
  connectionDate: string;
  device: string;
}

export const WebAuthnAssertionOptionsEntity = new Type<WebAuthnAssertionOptionsEntity>("WebAuthnAssertionOptions");
export interface WebAuthnAssertionOptionsEntity extends Entities.Entity {
  Type: "WebAuthnAssertionOptions";
  creationDate: string;
  json: string;
}

export const WebAuthnConfigurationEmbedded = new Type<WebAuthnConfigurationEmbedded>("WebAuthnConfigurationEmbedded");
export interface WebAuthnConfigurationEmbedded extends Entities.EmbeddedEntity {
  Type: "WebAuthnConfigurationEmbedded";
  serverDomain: string;
  serverName: string;
  origin: string;
  timestampDriftTolerance: number;
}

export const WebAuthnCredentialEntity = new Type<WebAuthnCredentialEntity>("WebAuthnCredential");
export interface WebAuthnCredentialEntity extends Entities.Entity {
  Type: "WebAuthnCredential";
  user: Entities.Lite<UserEntity>;
  creationDate: string;
  credentialId: string;
  counter: number;
  credType: string;
  aaguid: string;
  publicKey: string;
}

export module WebAuthnCredentialOperation {
  export const Delete : Entities.DeleteSymbol<WebAuthnCredentialEntity> = registerSymbol("Operation", "WebAuthnCredentialOperation.Delete");
}

export const WebAuthnMakeCredentialsOptionsEntity = new Type<WebAuthnMakeCredentialsOptionsEntity>("WebAuthnMakeCredentialsOptions");
export interface WebAuthnMakeCredentialsOptionsEntity extends Entities.Entity {
  Type: "WebAuthnMakeCredentialsOptions";
  user: Entities.Lite<UserEntity>;
  creationDate: string;
  json: string;
}


text:
<?php

namespace Magento\Setup\Test\Unit\Controller;

use \Magento\Setup\Controller\AddDatabase;

class AddDatabaseTest extends \PHPUnit_Framework_TestCase
{
    public function testIndexAction()
    {
        /** @var $controller AddDatabase */
        $controller = new AddDatabase();
        $viewModel = $controller->indexAction();
        $this->assertInstanceOf('Zend\View\Model\ViewModel', $viewModel);
        $this->assertTrue($viewModel->terminate());
    }
}


text:
module MakerJs.models {

    export class OvalArc implements IModel {

        public paths: IPathMap = {};

        constructor(startAngle: number, endAngle: number, sweepRadius: number, slotRadius: number) {

            var addCap = (id: string, tiltAngle: number, offsetStartAngle: number, offsetEndAngle: number) => {
                var p = point.fromPolar(angle.toRadians(tiltAngle), sweepRadius);
                this.paths[id] = new paths.Arc(p, slotRadius, tiltAngle + offsetStartAngle, tiltAngle + offsetEndAngle);
            };

            var addSweep = (id: string, offsetRadius: number) => {
                this.paths[id] = new paths.Arc(point.zero(), sweepRadius + offsetRadius, startAngle, endAngle);
            };

            addSweep("Inner", - slotRadius);
            addSweep("Outer", slotRadius);
            addCap("StartCap", startAngle, 180, 0);
            addCap("EndCap", endAngle, 0, 180);
        }

    }
}


text:
<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
               "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

<title>Script Action Element</title>
<meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1"/>
<meta name="generator" content="Org-mode"/>
<meta name="generated" content="2010-06-14 18:35:28 EDT"/>
<meta name="author" content="Rusty Klophaus (@rklophaus)"/>
<meta name="description" content=""/>
<meta name="keywords" content=""/>

<LINK href='../stylesheet.css' rel='stylesheet' type='text/css' />

Script Action Element

Getting Started | API | Elements | Actions | Validators | Handlers | About

Table of Contents

1 Script Action - #script {}

1 Script Action - #script {}

Run some plain Javascript.

You can access Nitrogen elements within the Javascript using the
obj('id') function.

For example, if you have a Nitrogen element with the id of
'myTextBox', then "var tb = obj('myTextBox');" will make tb point to
the myTextBox element.

In addition, you can use obj('me') to point to the target of the
current action, and you can use 'parent' to get the parent of an
element, for example: "obj('me.parent.parent')".

1.1 Usage

wf:wire(myDiv, #event { type=click, actions=#script { script="gotClick(obj('me'));" } })

1.2 Attributes

script - (string)

The Javascript to execute.

1.3 See Also

base element

 Author: Rusty Klophaus (@rklophaus)
<>

 Date: 2010-06-14 18:35:28 EDT

HTML generated by org-mode 6.33f in emacs 22


text:
'use strict';

import * as nls from 'vs/nls';
import {KeyCode, KeyMod} from 'vs/base/common/keyCodes';
import {TPromise} from 'vs/base/common/winjs.base';
import {INullService} from 'vs/platform/instantiation/common/instantiation';
import {EditorAction} from 'vs/editor/common/editorAction';
import {Behaviour} from 'vs/editor/common/editorActionEnablement';
import {ICommonCodeEditor, IEditorActionDescriptorData} from 'vs/editor/common/editorCommon';
import {CommonEditorRegistry, ContextKey, EditorActionDescriptor} from 'vs/editor/common/editorCommonExtensions';

export class ToggleTabFocusModeAction extends EditorAction {

	public static ID = 'editor.action.toggleTabFocusMode';

	constructor(descriptor:IEditorActionDescriptorData, editor:ICommonCodeEditor, @INullService ns) {
		super(descriptor, editor, Behaviour.TextFocus);
	}

	public run():TPromise<boolean> {

		if(this.editor.getConfiguration().tabFocusMode) {
			this.editor.updateOptions({tabFocusMode: false});
		} else {
			this.editor.updateOptions({tabFocusMode: true});
		}

		return TPromise.as(true);
	}
}

// register actions
CommonEditorRegistry.registerEditorAction(new EditorActionDescriptor(ToggleTabFocusModeAction, ToggleTabFocusModeAction.ID, nls.localize('toggle.tabfocusmode', "Toggle Use of Tab Key for Setting Focus"), {
	context: ContextKey.EditorTextFocus,
	primary: KeyMod.CtrlCmd | KeyCode.KEY_M,
	mac: { primary: KeyMod.WinCtrl | KeyMod.Shift | KeyCode.KEY_M }
}));


text:
```dart
import 'package:keyclic_sdk_api/api.dart';
```

## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**mapping** | [**WorkflowLinksSelfIriTemplateMapping**](WorkflowLinksSelfIriTemplateMapping.md) |  | [optional] [default to null]

[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)


text:
<?php

namespace Cerad\Bundle\AppBundle\Action\Person\Profile\FormType;

use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\FormBuilderInterface;

use Symfony\Component\OptionsResolver\OptionsResolverInterface;

class PersonFedCertRefereeFormType extends AbstractType
{
    public function getName()   { return 'cerad_person__person__person_fed_cert_referee_profile'; }

    public function setDefaultOptions(OptionsResolverInterface $resolver)
    {
        $resolver->setDefaults(array(
            'data_class' => 'Cerad\Bundle\PersonBundle\Model\PersonFedCert',
        ));
    }
    public function buildForm(FormBuilderInterface $builder, array $options)
    {
        $builder->add('upgrading','cerad_person_upgrading');

        $subscriber = new PersonFedCertRefereeSubscriber($builder->getFormFactory());
        $builder->addEventSubscriber($subscriber);

        return; if ($options);

    }
}


text:
// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#ifndef CHROME_BROWSER_DOWNLOAD_DOWNLOAD_REQUEST_LIMITER_H_
#define CHROME_BROWSER_DOWNLOAD_DOWNLOAD_REQUEST_LIMITER_H_

#include <map>
#include <string>
#include <vector>

#include "base/callback.h"
#include "base/gtest_prod_util.h"
#include "base/memory/ref_counted.h"
#include "content/public/browser/notification_observer.h"
#include "content/public/browser/notification_registrar.h"
#include "content/public/browser/web_contents_observer.h"

class DownloadRequestInfoBarDelegate;
class TabContents;

namespace content {
class NavigationController;
class WebContents;
}

// DownloadRequestLimiter is responsible for determining whether a download
// should be allowed or not. It is designed to keep pages from downloading
// multiple files without user interaction. DownloadRequestLimiter is invoked
// from ResourceDispatcherHost any time a download begins
// (CanDownloadOnIOThread). The request is processed on the UI thread, and the
// request is notified (back on the IO thread) as to whether the download should
// be allowed or denied.
//
// Invoking CanDownloadOnIOThread notifies the callback and may update the
// download status. The following details the various states:
// . Each NavigationController initially starts out allowing a download
//   (ALLOW_ONE_DOWNLOAD).
// . The first time CanDownloadOnIOThread is invoked the download is allowed and
//   the state changes to PROMPT_BEFORE_DOWNLOAD.
// . If the state is PROMPT_BEFORE_DOWNLOAD and the user clicks the mouse,
//   presses enter, the space bar or navigates to another page the state is
//   reset to ALLOW_ONE_DOWNLOAD.
// . If a download is attempted and the state is PROMPT_BEFORE_DOWNLOAD the user
//   is prompted as to whether the download is allowed or disallowed. The users
//   choice stays until the user navigates to a different host. For example, if
//   the user allowed the download, multiple downloads are allowed without any
//   user intervention until the user navigates to a different host.
class DownloadRequestLimiter
    : public base::RefCountedThreadSafe<DownloadRequestLimiter> {
 public:
  // Download status for a particular page. See class description for details.
  enum DownloadStatus {
    ALLOW_ONE_DOWNLOAD,
    PROMPT_BEFORE_DOWNLOAD,
    ALLOW_ALL_DOWNLOADS,
    DOWNLOADS_NOT_ALLOWED
  };

  // Max number of downloads before a "Prompt Before Download" Dialog is shown.
  static const size_t kMaxDownloadsAtOnce = 50;

  // The callback from CanDownloadOnIOThread. This is invoked on the io thread.
  // The boolean parameter indicates whether or not the download is allowed.
  typedef base::Callback<void(bool /*allow*/)> Callback;

  // TabDownloadState maintains the download state for a particular tab.
  // TabDownloadState prompts the user with an infobar as necessary.
  // TabDownloadState deletes itself (by invoking
  // DownloadRequestLimiter::Remove) as necessary.
  class TabDownloadState : public content::NotificationObserver,
                           public content::WebContentsObserver {
   public:
    // Creates a new TabDownloadState. |controller| is the controller the
    // TabDownloadState tracks the state of and is the host for any dialogs that
    // are displayed. |originating_controller| is used to determine the host of
    // the initial download. If |originating_controller| is null, |controller|
    // is used. |originating_controller| is typically null, but differs from
    // |controller| in the case of a constrained popup requesting the download.
    TabDownloadState(DownloadRequestLimiter* host,
                     content::WebContents* web_contents,
                     content::WebContents* originating_web_contents);
    virtual ~TabDownloadState();

    // Status of the download.
    void set_download_status(DownloadRequestLimiter::DownloadStatus status) {
      status_ = status;
    }
    DownloadRequestLimiter::DownloadStatus download_status() const {
      return status_;
    }

    // Number of "ALLOWED" downloads.
    void increment_download_count() {
      download_count_++;
    }
    size_t download_count() const {
      return download_count_;
    }

    // Promote protected accessor to public.
    content::WebContents* web_contents() {
      return content::WebContentsObserver::web_contents();
    }

    // content::WebContentsObserver overrides.
    // Invoked when a user gesture occurs (mouse click, enter or space). This
    // may result in invoking Remove on DownloadRequestLimiter.
    virtual void DidGetUserGesture() OVERRIDE;

    // Asks the user if they really want to allow the download.
    // See description above CanDownloadOnIOThread for details on lifetime of
    // callback.
    void PromptUserForDownload(
        content::WebContents* tab,
        const DownloadRequestLimiter::Callback& callback);

    // Are we showing a prompt to the user?
    bool is_showing_prompt() const { return (infobar_ != NULL); }

    // Invoked from DownloadRequestDialogDelegate. Notifies the delegates and
    // changes the status appropriately. Virtual for testing.
    virtual void Cancel();
    virtual void Accept();

   protected:
    // Used for testing.
    TabDownloadState()
        : host_(NULL),
          status_(DownloadRequestLimiter::ALLOW_ONE_DOWNLOAD),
          download_count_(0),
          infobar_(NULL) {
    }

   private:
    // content::NotificationObserver method.
    virtual void Observe(int type,
                         const content::NotificationSource& source,
                         const content::NotificationDetails& details) OVERRIDE;

    // Notifies the callbacks as to whether the download is allowed or not.
    // Updates status_ appropriately.
    void NotifyCallbacks(bool allow);

    DownloadRequestLimiter* host_;

    // Host of the first page the download started on. This may be empty.
    std::string initial_page_host_;

    DownloadRequestLimiter::DownloadStatus status_;

    size_t download_count_;

    // Callbacks we need to notify. This is only non-empty if we're showing a
    // dialog.
    // See description above CanDownloadOnIOThread for details on lifetime of
    // callbacks.
    std::vector<DownloadRequestLimiter::Callback> callbacks_;

    // Used to remove observers installed on NavigationController.
    content::NotificationRegistrar registrar_;

    // Handles showing the infobar to the user, may be null.
    DownloadRequestInfoBarDelegate* infobar_;

    DISALLOW_COPY_AND_ASSIGN(TabDownloadState);
  };

  DownloadRequestLimiter();

  // Returns the download status for a page. This does not change the state in
  // anyway.
  DownloadStatus GetDownloadStatus(content::WebContents* tab);

  // Updates the state of the page as necessary and notifies the callback.
  // WARNING: both this call and the callback are invoked on the io thread.
  void CanDownloadOnIOThread(int render_process_host_id,
                             int render_view_id,
                             int request_id,
                             const std::string& request_method,
                             const Callback& callback);

 private:
  FRIEND_TEST_ALL_PREFIXES(DownloadTest, DownloadResourceThrottleCancels);
  friend class base::RefCountedThreadSafe<DownloadRequestLimiter>;
  friend class DownloadRequestLimiterTest;
  friend class TabDownloadState;

  ~DownloadRequestLimiter();

  // For unit tests. If non-null this is used instead of creating a dialog.
  class TestingDelegate {
   public:
    virtual bool ShouldAllowDownload() = 0;

   protected:
    virtual ~TestingDelegate() {}
  };
  static void SetTestingDelegate(TestingDelegate* delegate);

  // Gets the download state for the specified controller. If the
  // TabDownloadState does not exist and |create| is true, one is created.
  // See TabDownloadState's constructor description for details on the two
  // controllers.
  //
  // The returned TabDownloadState is owned by the DownloadRequestLimiter and
  // deleted when no longer needed (the Remove method is invoked).
  TabDownloadState* GetDownloadState(
      content::WebContents* web_contents,
      content::WebContents* originating_web_contents,
      bool create);

  // CanDownloadOnIOThread invokes this on the UI thread. This determines the
  // tab and invokes CanDownloadImpl.
  void CanDownload(int render_process_host_id,
                   int render_view_id,
                   int request_id,
                   const std::string& request_method,
                   const Callback& callback);

  // Does the work of updating the download status on the UI thread and
  // potentially prompting the user.
  void CanDownloadImpl(content::WebContents* originating_contents,
                       int request_id,
                       const std::string& request_method,
                       const Callback& callback);

  // Invoked on the UI thread. Schedules a call to NotifyCallback on the io
  // thread.
  void ScheduleNotification(const Callback& callback, bool allow);

  // Removes the specified TabDownloadState from the internal map and deletes
  // it. This has the effect of resetting the status for the tab to
  // ALLOW_ONE_DOWNLOAD.
  void Remove(TabDownloadState* state);

  // Maps from tab to download state. The download state for a tab only exists
  // if the state is other than ALLOW_ONE_DOWNLOAD. Similarly once the state
  // transitions from anything but ALLOW_ONE_DOWNLOAD back to ALLOW_ONE_DOWNLOAD
  // the TabDownloadState is removed and deleted (by way of Remove).
  typedef std::map<content::WebContents*, TabDownloadState*> StateMap;
  StateMap state_map_;

  static TestingDelegate* delegate_;

  DISALLOW_COPY_AND_ASSIGN(DownloadRequestLimiter);
};

#endif  // CHROME_BROWSER_DOWNLOAD_DOWNLOAD_REQUEST_LIMITER_H_


text:
layout: post
title: PyTorch Data Loading Tutorial
author: Sasank Chilamkurthy
description: A lot of effort in solving any machine learning problem goes in to preparing the data. PyTorch provides many tools to make data loading easy and hopefully, to make your code more readable.
---

I have written this for [PyTorch official tutorials](http://pytorch.org/tutorials/beginner/data_loading_tutorial.html). Please read this tutorial there.

> A lot of effort in solving any machine learning problem goes in to preparing the data. PyTorch provides many tools to make data loading easy and hopefully, to make your code more readable. In this tutorial, we will see how to load and preprocess/augment data from a non trivial dataset...


text:
.class public Landroid/app/backup/BackupDataOutput;
.super Ljava/lang/Object;
.source "BackupDataOutput.java"

# instance fields
.field mBackupWriter:I

# direct methods
.method public constructor <init>(Ljava/io/FileDescriptor;)V
    .locals 3
    .parameter "fd"

    .prologue
    .line 68
    invoke-direct/range {p0 .. p0}, Ljava/lang/Object;-><init>()V

    .line 69
    if-nez p1, :cond_0

    new-instance v0, Ljava/lang/NullPointerException;

    invoke-direct {v0}, Ljava/lang/NullPointerException;-><init>()V

    throw v0

    .line 70
    :cond_0
    invoke-static {p1}, Landroid/app/backup/BackupDataOutput;->ctor(Ljava/io/FileDescriptor;)I

    move-result v0

    iput v0, p0, Landroid/app/backup/BackupDataOutput;->mBackupWriter:I

    .line 71
    iget v0, p0, Landroid/app/backup/BackupDataOutput;->mBackupWriter:I

    if-nez v0, :cond_1

    .line 72
    new-instance v0, Ljava/lang/RuntimeException;

    new-instance v1, Ljava/lang/StringBuilder;

    invoke-direct {v1}, Ljava/lang/StringBuilder;-><init>()V

    const-string v2, "Native initialization failed with fd="

    invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v1

    invoke-virtual {v1, p1}, Ljava/lang/StringBuilder;->append(Ljava/lang/Object;)Ljava/lang/StringBuilder;

    move-result-object v1

    invoke-virtual {v1}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v1

    invoke-direct {v0, v1}, Ljava/lang/RuntimeException;-><init>(Ljava/lang/String;)V

    throw v0

    .line 74
    :cond_1
    return-void
.end method

.method private static native ctor(Ljava/io/FileDescriptor;)I
.end method

.method private static native dtor(I)V
.end method

.method private static native setKeyPrefix_native(ILjava/lang/String;)V
.end method

.method private static native writeEntityData_native(I[BI)I
.end method

.method private static native writeEntityHeader_native(ILjava/lang/String;I)I
.end method

# virtual methods
.method protected finalize()V
    .locals 1
    .annotation system Ldalvik/annotation/Throws;
        value = {
            Ljava/lang/Throwable;
        }
    .end annotation

    .prologue
    .line 118
    :try_start_0
    iget v0, p0, Landroid/app/backup/BackupDataOutput;->mBackupWriter:I

    invoke-static {v0}, Landroid/app/backup/BackupDataOutput;->dtor(I)V
    :try_end_0
    .catchall {:try_start_0 .. :try_end_0} :catchall_0

    .line 120
    invoke-super {p0}, Ljava/lang/Object;->finalize()V

    .line 122
    return-void

    .line 120
    :catchall_0
    move-exception v0

    invoke-super {p0}, Ljava/lang/Object;->finalize()V

    throw v0
.end method

.method public setKeyPrefix(Ljava/lang/String;)V
    .locals 1
    .parameter "keyPrefix"

    .prologue
    .line 112
    iget v0, p0, Landroid/app/backup/BackupDataOutput;->mBackupWriter:I

    invoke-static {v0, p1}, Landroid/app/backup/BackupDataOutput;->setKeyPrefix_native(ILjava/lang/String;)V

    .line 113
    return-void
.end method

.method public writeEntityData([BI)I
    .locals 4
    .parameter "data"
    .parameter "size"
    .annotation system Ldalvik/annotation/Throws;
        value = {
            Ljava/io/IOException;
        }
    .end annotation

    .prologue
    .line 102
    iget v1, p0, Landroid/app/backup/BackupDataOutput;->mBackupWriter:I

    invoke-static {v1, p1, p2}, Landroid/app/backup/BackupDataOutput;->writeEntityData_native(I[BI)I

    move-result v0

    .line 103
    .local v0, result:I
    if-ltz v0, :cond_0

    .line 104
    return v0

    .line 106
    :cond_0
    new-instance v1, Ljava/io/IOException;

    new-instance v2, Ljava/lang/StringBuilder;

    invoke-direct {v2}, Ljava/lang/StringBuilder;-><init>()V

    const-string/jumbo v3, "result=0x"

    invoke-virtual {v2, v3}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v2

    invoke-static {v0}, Ljava/lang/Integer;->toHexString(I)Ljava/lang/String;

    move-result-object v3

    invoke-virtual {v2, v3}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v2

    invoke-virtual {v2}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v2

    invoke-direct {v1, v2}, Ljava/io/IOException;-><init>(Ljava/lang/String;)V

    throw v1
.end method

.method public writeEntityHeader(Ljava/lang/String;I)I
    .locals 4
    .parameter "key"
    .parameter "dataSize"
    .annotation system Ldalvik/annotation/Throws;
        value = {
            Ljava/io/IOException;
        }
    .end annotation

    .prologue
    .line 86
    iget v1, p0, Landroid/app/backup/BackupDataOutput;->mBackupWriter:I

    invoke-static {v1, p1, p2}, Landroid/app/backup/BackupDataOutput;->writeEntityHeader_native(ILjava/lang/String;I)I

    move-result v0

    .line 87
    .local v0, result:I
    if-ltz v0, :cond_0

    .line 88
    return v0

    .line 90
    :cond_0
    new-instance v1, Ljava/io/IOException;

    new-instance v2, Ljava/lang/StringBuilder;

    invoke-direct {v2}, Ljava/lang/StringBuilder;-><init>()V

    const-string/jumbo v3, "result=0x"

    invoke-virtual {v2, v3}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v2

    invoke-static {v0}, Ljava/lang/Integer;->toHexString(I)Ljava/lang/String;

    move-result-object v3

    invoke-virtual {v2, v3}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v2

    invoke-virtual {v2}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v2

    invoke-direct {v1, v2}, Ljava/io/IOException;-><init>(Ljava/lang/String;)V

    throw v1
.end method


text:
<configuration xmlns="http://exist.sourceforge.net/NS/exist">
  <!-- Forward URL's starting with rest or servlet to the REST servlet: -->
  <forward pattern="/(rest|servlet)/" servlet="EXistServlet"/>
  <!-- Patterns starting with /apps should look for a URL rewriting controller: -->
  <root pattern="/apps" path="xmldb:exist:///db/apps"/>
  <!-- My url www.myapp.com should map to my application stored underneath
        /db/myapp in the database: -->
  <root server-name="www.myapp.com" pattern="/*" path="xmldb:exist:///db/apps/myapp/"/>
  <!-- Anything else, pass on to the XQueryServlet for default executing
        from the file system: -->
  <forward pattern=".*\.(xq|xql|xqy|xquery)$" servlet="XQueryServlet"/>
</configuration>