text:
package com.google.common.collect;

import static com.google.common.base.Preconditions.checkNotNull;

import com.google.common.annotations.Beta;
import com.google.common.annotations.GwtCompatible;
import com.google.common.base.Function;

import java.io.Serializable;
import java.util.Arrays;
import java.util.Collection;
import java.util.Collections;
import java.util.Comparator;
import java.util.Iterator;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;

import javax.annotation.Nullable;

/**
 * An immutable {@link Multimap}. Does not permit null keys or values.
 *
 *
Unlike {@link Multimaps#unmodifiableMultimap(Multimap)}, which is
 * a view of a separate multimap which can still change, an instance of
 * {@code ImmutableMultimap} contains its own data and will never
 * change. {@code ImmutableMultimap} is convenient for
 * {@code public static final} multimaps ("constant multimaps") and also lets
 * you easily make a "defensive copy" of a multimap provided to your class by
 * a caller.
 *
 *
Note: Although this class is not final, it cannot be subclassed as
 * it has no public or protected constructors. Thus, instances of this class
 * are guaranteed to be immutable.
 *
 *
In addition to methods defined by {@link Multimap}, an {@link #inverse}
 * method is also supported.
 *
 *
See the Guava User Guide article on
 * immutable collections.
 *
 * @author Jared Levy
 * @since 2.0 (imported from Google Collections Library)
 */
@GwtCompatible(emulated = true)
public abstract class ImmutableMultimap<K, V>
    implements Multimap<K, V>, Serializable {

  /** Returns an empty multimap. */
  public static <K, V> ImmutableMultimap<K, V> of() {
    return ImmutableListMultimap.of();
  }

  /**
   * Returns an immutable multimap containing a single entry.
   */
  public static <K, V> ImmutableMultimap<K, V> of(K k1, V v1) {
    return ImmutableListMultimap.of(k1, v1);
  }

  /**
   * Returns an immutable multimap containing the given entries, in order.
   */
  public static <K, V> ImmutableMultimap<K, V> of(K k1, V v1, K k2, V v2) {
    return ImmutableListMultimap.of(k1, v1, k2, v2);
  }

  /**
   * Returns an immutable multimap containing the given entries, in order.
   */
  public static <K, V> ImmutableMultimap<K, V> of(
      K k1, V v1, K k2, V v2, K k3, V v3) {
    return ImmutableListMultimap.of(k1, v1, k2, v2, k3, v3);
  }

  /**
   * Returns an immutable multimap containing the given entries, in order.
   */
  public static <K, V> ImmutableMultimap<K, V> of(
      K k1, V v1, K k2, V v2, K k3, V v3, K k4, V v4) {
    return ImmutableListMultimap.of(k1, v1, k2, v2, k3, v3, k4, v4);
  }

  /**
   * Returns an immutable multimap containing the given entries, in order.
   */
  public static <K, V> ImmutableMultimap<K, V> of(
      K k1, V v1, K k2, V v2, K k3, V v3, K k4, V v4, K k5, V v5) {
    return ImmutableListMultimap.of(k1, v1, k2, v2, k3, v3, k4, v4, k5, v5);
  }

  // looking for of() with > 5 entries? Use the builder instead.

  /**
   * Returns a new builder. The generated builder is equivalent to the builder
   * created by the {@link Builder} constructor.
   */
  public static <K, V> Builder<K, V> builder() {
    return new Builder<K, V>();
  }

  /**
   * Multimap for {@link ImmutableMultimap.Builder} that maintains key and
   * value orderings, allows duplicate values, and performs better than
   * {@link LinkedListMultimap}.
   */
  private static class BuilderMultimap<K, V> extends AbstractMultimap<K, V> {
    BuilderMultimap() {
      super(new LinkedHashMap<K, Collection<V>>());
    }
    @Override Collection<V> createCollection() {
      return Lists.newArrayList();
    }
    private static final long serialVersionUID = 0;
  }

  /**
   * A builder for creating immutable multimap instances, especially
   * {@code public static final} multimaps ("constant multimaps"). Example:
   *
   {@code
   *
   *   static final Multimap<String, Integer> STRING_TO_INTEGER_MULTIMAP =
   *       new ImmutableMultimap.Builder<String, Integer>()
   *           .put("one", 1)
   *           .putAll("several", 1, 2, 3)
   *           .putAll("many", 1, 2, 3, 4, 5)
   *           .build();}

   *
   * Builder instances can be reused; it is safe to call {@link #build} multiple
   * times to build multiple multimaps in series. Each multimap contains the
   * key-value mappings in the previously created multimaps.
   *
   * @since 2.0 (imported from Google Collections Library)
   */
  public static class Builder<K, V> {
    Multimap<K, V> builderMultimap = new BuilderMultimap<K, V>();
    Comparator<? super K> keyComparator;
    Comparator<? super V> valueComparator;

    /**
     * Creates a new builder. The returned builder is equivalent to the builder
     * generated by {@link ImmutableMultimap#builder}.
     */
    public Builder() {}

    /**
     * Adds a key-value mapping to the built multimap.
     */
    public Builder<K, V> put(K key, V value) {
      builderMultimap.put(checkNotNull(key), checkNotNull(value));
      return this;
    }

    /**
     * Adds an entry to the built multimap.
     *
     * @since 11.0
     */
    public Builder<K, V> put(Entry<? extends K, ? extends V> entry) {
      builderMultimap.put(
          checkNotNull(entry.getKey()), checkNotNull(entry.getValue()));
      return this;
    }

    /**
     * Stores a collection of values with the same key in the built multimap.
     *
     * @throws NullPointerException if {@code key}, {@code values}, or any
     *     element in {@code values} is null. The builder is left in an invalid
     *     state.
     */
    public Builder<K, V> putAll(K key, Iterable<? extends V> values) {
      Collection<V> valueList = builderMultimap.get(checkNotNull(key));
      for (V value : values) {
        valueList.add(checkNotNull(value));
      }
      return this;
    }

    /**
     * Stores an array of values with the same key in the built multimap.
     *
     * @throws NullPointerException if the key or any value is null. The builder
     *     is left in an invalid state.
     */
    public Builder<K, V> putAll(K key, V... values) {
      return putAll(key, Arrays.asList(values));
    }

    /**
     * Stores another multimap's entries in the built multimap. The generated
     * multimap's key and value orderings correspond to the iteration ordering
     * of the {@code multimap.asMap()} view, with new keys and values following
     * any existing keys and values.
     *
     * @throws NullPointerException if any key or value in {@code multimap} is
     *     null. The builder is left in an invalid state.
     */
    public Builder<K, V> putAll(Multimap<? extends K, ? extends V> multimap) {
      for (Entry<? extends K, ? extends Collection<? extends V>> entry
          : multimap.asMap().entrySet()) {
        putAll(entry.getKey(), entry.getValue());
      }
      return this;
    }

    /**
     * Specifies the ordering of the generated multimap's keys.
     *
     * @since 8.0
     */
    @Beta
    public Builder<K, V> orderKeysBy(Comparator<? super K> keyComparator) {
      this.keyComparator = checkNotNull(keyComparator);
      return this;
    }

    /**
     * Specifies the ordering of the generated multimap's values for each key.
     *
     * @since 8.0
     */
    @Beta
    public Builder<K, V> orderValuesBy(Comparator<? super V> valueComparator) {
      this.valueComparator = checkNotNull(valueComparator);
      return this;
    }

    /**
     * Returns a newly-created immutable multimap.
     */
    public ImmutableMultimap<K, V> build() {
      if (valueComparator != null) {
        for (Collection<V> values : builderMultimap.asMap().values()) {
          List<V> list = (List <V>) values;
          Collections.sort(list, valueComparator);
        }
      }
      if (keyComparator != null) {
        Multimap<K, V> sortedCopy = new BuilderMultimap<K, V>();
        List<Map.Entry<K, Collection<V>>> entries = Lists.newArrayList(
            builderMultimap.asMap().entrySet());
        Collections.sort(
            entries,
            Ordering.from(keyComparator).onResultOf(new Function<Entry<K, Collection<V>>, K>() {
              @Override
              public K apply(Entry<K, Collection<V>> entry) {
                return entry.getKey();
              }
            }));
        for (Map.Entry<K, Collection<V>> entry : entries) {
          sortedCopy.putAll(entry.getKey(), entry.getValue());
        }
        builderMultimap = sortedCopy;
      }
      return copyOf(builderMultimap);
    }
  }

  /**
   * Returns an immutable multimap containing the same mappings as {@code
   * multimap}. The generated multimap's key and value orderings correspond to
   * the iteration ordering of the {@code multimap.asMap()} view.
   *
   *
Despite the method name, this method attempts to avoid actually copying
   * the data when it is safe to do so. The exact circumstances under which a
   * copy will or will not be performed are undocumented and subject to change.
   *
   * @throws NullPointerException if any key or value in {@code multimap} is
   *         null
   */
  public static <K, V> ImmutableMultimap<K, V> copyOf(
      Multimap<? extends K, ? extends V> multimap) {
    if (multimap instanceof ImmutableMultimap) {
      @SuppressWarnings("unchecked") // safe since multimap is not writable
      ImmutableMultimap<K, V> kvMultimap
          = (ImmutableMultimap<K, V>) multimap;
      if (!kvMultimap.isPartialView()) {
        return kvMultimap;
      }
    }
    return ImmutableListMultimap.copyOf(multimap);
  }

  final transient ImmutableMap<K, ? extends ImmutableCollection<V>> map;
  final transient int size;

  // These constants allow the deserialization code to set final fields. This
  // holder class makes sure they are not initialized unless an instance is
  // deserialized.

  ImmutableMultimap(ImmutableMap<K, ? extends ImmutableCollection<V>> map,
      int size) {
    this.map = map;
    this.size = size;
  }

  // mutators (not supported)

  /**
   * Guaranteed to throw an exception and leave the multimap unmodified.
   *
   * @throws UnsupportedOperationException always
   * @deprecated Unsupported operation.
   */
  @Deprecated
  @Override
  public ImmutableCollection<V> removeAll(Object key) {
    throw new UnsupportedOperationException();
  }

  /**
   * Guaranteed to throw an exception and leave the multimap unmodified.
   *
   * @throws UnsupportedOperationException always
   * @deprecated Unsupported operation.
   */
  @Deprecated
  @Override
  public ImmutableCollection<V> replaceValues(K key,
      Iterable<? extends V> values) {
    throw new UnsupportedOperationException();
  }

  /**
   * Guaranteed to throw an exception and leave the multimap unmodified.
   *
   * @throws UnsupportedOperationException always
   * @deprecated Unsupported operation.
   */
  @Deprecated
  @Override
  public void clear() {
    throw new UnsupportedOperationException();
  }

  /**
   * Returns an immutable collection of the values for the given key.  If no
   * mappings in the multimap have the provided key, an empty immutable
   * collection is returned. The values are in the same order as the parameters
   * used to build this multimap.
   */
  @Override
  public abstract ImmutableCollection<V> get(K key);

  /**
   * Returns an immutable multimap which is the inverse of this one. For every
   * key-value mapping in the original, the result will have a mapping with
   * key and value reversed.
   *
   * @since 11.0
   */
  @Beta
  public abstract ImmutableMultimap<V, K> inverse();

  /**
   * Guaranteed to throw an exception and leave the multimap unmodified.
   *
   * @throws UnsupportedOperationException always
   * @deprecated Unsupported operation.
   */
  @Deprecated
  @Override
  public boolean put(K key, V value) {
    throw new UnsupportedOperationException();
  }

  /**
   * Guaranteed to throw an exception and leave the multimap unmodified.
   *
   * @throws UnsupportedOperationException always
   * @deprecated Unsupported operation.
   */
  @Deprecated
  @Override
  public boolean putAll(K key, Iterable<? extends V> values) {
    throw new UnsupportedOperationException();
  }

  /**
   * Guaranteed to throw an exception and leave the multimap unmodified.
   *
   * @throws UnsupportedOperationException always
   * @deprecated Unsupported operation.
   */
  @Deprecated
  @Override
  public boolean putAll(Multimap<? extends K, ? extends V> multimap) {
    throw new UnsupportedOperationException();
  }

  /**
   * Guaranteed to throw an exception and leave the multimap unmodified.
   *
   * @throws UnsupportedOperationException always
   * @deprecated Unsupported operation.
   */
  @Deprecated
  @Override
  public boolean remove(Object key, Object value) {
    throw new UnsupportedOperationException();
  }

  boolean isPartialView() {
    return map.isPartialView();
  }

  // accessors

  @Override
  public boolean containsEntry(@Nullable Object key, @Nullable Object value) {
    Collection<V> values = map.get(key);
    return values != null && values.contains(value);
  }

  @Override
  public boolean containsKey(@Nullable Object key) {
    return map.containsKey(key);
  }

  @Override
  public boolean containsValue(@Nullable Object value) {
    for (Collection<V> valueCollection : map.values()) {
      if (valueCollection.contains(value)) {
        return true;
      }
    }
    return false;
  }

  @Override
  public boolean isEmpty() {
    return size == 0;
  }

  @Override
  public int size() {
    return size;
  }

  @Override public boolean equals(@Nullable Object object) {
    if (object instanceof Multimap) {
      Multimap<?, ?> that = (Multimap<?, ?>) object;
      return this.map.equals(that.asMap());
    }
    return false;
  }

  @Override public int hashCode() {
    return map.hashCode();
  }

  @Override public String toString() {
    return map.toString();
  }

  // views

  /**
   * Returns an immutable set of the distinct keys in this multimap. These keys
   * are ordered according to when they first appeared during the construction
   * of this multimap.
   */
  @Override
  public ImmutableSet<K> keySet() {
    return map.keySet();
  }

  /**
   * Returns an immutable map that associates each key with its corresponding
   * values in the multimap.
   */
  @Override
  @SuppressWarnings("unchecked") // a widening cast
  public ImmutableMap<K, Collection<V>> asMap() {
    return (ImmutableMap) map;
  }

  private transient ImmutableCollection<Entry<K, V>> entries;

  /**
   * Returns an immutable collection of all key-value pairs in the multimap. Its
   * iterator traverses the values for the first key, the values for the second
   * key, and so on.
   */
  @Override
  public ImmutableCollection<Entry<K, V>> entries() {
    ImmutableCollection<Entry<K, V>> result = entries;
    return (result == null)
        ? (entries = new EntryCollection<K, V>(this)) : result;
  }

  private static class EntryCollection<K, V>
      extends ImmutableCollection<Entry<K, V>> {
    final ImmutableMultimap<K, V> multimap;

    EntryCollection(ImmutableMultimap<K, V> multimap) {
      this.multimap = multimap;
    }

    @Override public UnmodifiableIterator<Entry<K, V>> iterator() {
      final Iterator<? extends Entry<K, ? extends ImmutableCollection<V>>>
          mapIterator = this.multimap.map.entrySet().iterator();

      return new UnmodifiableIterator<Entry<K, V>>() {
        K key;
        Iterator<V> valueIterator;

        @Override
        public boolean hasNext() {
          return (key != null && valueIterator.hasNext())
              || mapIterator.hasNext();
        }

        @Override
        public Entry<K, V> next() {
          if (key == null || !valueIterator.hasNext()) {
            Entry<K, ? extends ImmutableCollection<V>> entry
                = mapIterator.next();
            key = entry.getKey();
            valueIterator = entry.getValue().iterator();
          }
          return Maps.immutableEntry(key, valueIterator.next());
        }
      };
    }

    @Override boolean isPartialView() {
      return multimap.isPartialView();
    }

    @Override
    public int size() {
      return multimap.size();
    }

    @Override public boolean contains(Object object) {
      if (object instanceof Entry) {
        Entry<?, ?> entry = (Entry<?, ?>) object;
        return multimap.containsEntry(entry.getKey(), entry.getValue());
      }
      return false;
    }

    private static final long serialVersionUID = 0;
  }

  private transient ImmutableMultiset<K> keys;

  /**
   * Returns a collection, which may contain duplicates, of all keys. The number
   * of times a key appears in the returned multiset equals the number of
   * mappings the key has in the multimap. Duplicate keys appear consecutively
   * in the multiset's iteration order.
   */
  @Override
  public ImmutableMultiset<K> keys() {
    ImmutableMultiset<K> result = keys;
    return (result == null) ? (keys = createKeys()) : result;
  }

  private ImmutableMultiset<K> createKeys() {
    return new Keys();
  }

  @SuppressWarnings("serial") // Uses writeReplace, not default serialization
  class Keys extends ImmutableMultiset<K> {
    @Override
    public boolean contains(@Nullable Object object) {
      return containsKey(object);
    }

    @Override
    public int count(@Nullable Object element) {
      Collection<V> values = map.get(element);
      return (values == null) ? 0 : values.size();
    }

    @Override
    public Set<K> elementSet() {
      return keySet();
    }

    @Override
    public int size() {
      return ImmutableMultimap.this.size();
    }

    @Override
    ImmutableSet<Entry<K>> createEntrySet() {
      return new KeysEntrySet();
    }

    private class KeysEntrySet extends ImmutableMultiset<K>.EntrySet {
      @Override
      public int size() {
        return keySet().size();
      }

      @Override
      public UnmodifiableIterator<Entry<K>> iterator() {
        return asList().iterator();
      }

      @Override
      ImmutableList<Entry<K>> createAsList() {
        final ImmutableList<? extends Map.Entry<K, ? extends Collection<V>>> mapEntries =
            map.entrySet().asList();
        return new ImmutableAsList<Entry<K>>() {
          @Override
          public Entry<K> get(int index) {
            Map.Entry<K, ? extends Collection<V>> entry = mapEntries.get(index);
            return Multisets.immutableEntry(entry.getKey(), entry.getValue().size());
          }

          @Override
          ImmutableCollection<Entry<K>> delegateCollection() {
            return KeysEntrySet.this;
          }
        };
      }
    }

    @Override
    boolean isPartialView() {
      return true;
    }
  }

  private transient ImmutableCollection<V> values;

  /**
   * Returns an immutable collection of the values in this multimap. Its
   * iterator traverses the values for the first key, the values for the second
   * key, and so on.
   */
  @Override
  public ImmutableCollection<V> values() {
    ImmutableCollection<V> result = values;
    return (result == null) ? (values = new Values<V>(this)) : result;
  }

  private static class Values<V> extends ImmutableCollection<V> {
    final ImmutableMultimap<?, V> multimap;

    Values(ImmutableMultimap<?, V> multimap) {
      this.multimap = multimap;
    }

    @Override public UnmodifiableIterator<V> iterator() {
      return Maps.valueIterator(multimap.entries().iterator());
    }

    @Override
    public int size() {
      return multimap.size();
    }

    @Override boolean isPartialView() {
      return true;
    }

    private static final long serialVersionUID = 0;
  }

  private static final long serialVersionUID = 0;
}


text:
<!---
Copyright 2018 The Subscribe with Google Authors. All Rights Reserved.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

     http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS-IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->

# Deferred account creation flow

This flow allows the publisher site to continue account creation process for deferred subscriptions - subscriptions that the publisher doesn't have related account information/consent on their side. These kind of subscriptions could be created on other partner platforms.

This flow shows the user their existing subscription information, prompts for the user's consent, and returns user/subscription information back to the publisher's site. See [Subscriptions APIs](./core-apis.md).

Typically, the publisher's site can initiate deferred account creation when it receives the entitlements data, e.g. via `setOnEntitlementsResponse` callback. Thus the possible code could look like this:

```js
// Publisher function to create a new user account or link subscription to an existing account
const createOrUpdateAccountPromise = new Promise(...);
function onEntitlement(entitlements) {
  if (!entitlements.enablesThis()) {
    return;
  }
  // The entitlement enables this product.
  // 1. Check if the publisher site has account/user info for this subscription.
  if (!hasAssociatedUserAccount(entitlements)) {
    // 2. Account was not found, or existing account has no subscription.
    // Let's create a new one or link to the existing publisher account.
    subscriptions.completeDeferredAccountCreation({
      entitlements: entitlements,
      consent: true
    }).then(response => {
      // 1. The user has consented to account creation. Create account
      // based on the response.
      createOrUpdateAccountPromise.then(() => {
        // 2. Signal that the account creation is complete.
        response.complete().then(() => {
          // 3. The flow is complete.
        });
      }, (errorDetails) => {
        // If the account creation fails, redirect the user to an error page
        window.location = errorDetails.redirectUrl
    });
  }
}
```

Once you receive deferred account response:
 1. You can process the subscription. For instance you can create a new account based on the `userData` and `purchaseDataList` in the response.
 2. Once subscription is processed, call `response.complete()`. This method will signal to SwG that your site has accepted the subscription. It will return a promise that will be resolved once the user has acknowledged subscription.
 3. Once the `response.complete()` promise is resolved, you can unblock content, show additional UI to the user or perform any actions you see fit.

To activate subscription flow itself, call the `completeDeferredAccountCreation` method with the known entitlements and consent request:

```js
subscriptions.completeDeferredAccountCreation({
  entitlements: receivedEntitlements,
  consent: true,
});
```

Arguments:
 - `entitlements` - the entitlements received via `setOnEntitlementsResponse` or `getEntitlements` APIs. It's an optional argument, but recommended. If it's not provided, SwG will lookup existing known subscription.
 - `consent` - a boolean property. Whether or not show the user the publisher's "account creation" consent. The default value is `true`. The publisher should only set this argument to `false` if they have their own confirmation that the user has already consented to account creation.

redpajama_set_name: RedPajamaGithub


text:
'use strict'

module.exports = {
  info: {
    key: 'python',
    title: 'Python',
    extname: '.py',
    default: 'python3'
  },

  python3: require('./python3'),
  requests: require('./requests')
}


text:
<results>
  <frameset
       id="mainId"
       rows="100%,*"
      >

    <frameset
         rows="30pt,*"
         title="Container for top and bottom frames"
        >

      <frame
           frameborder="0"
           id="topId"
           name="topId"
           noresize="noresize"
           src="uri-attr:encoded-action-url:http://www.oracle.com"
          >

      </frame>
      <frameset
           cols="30%,*"
           title="Container for left, center and right frames"
          >

        <frame
             frameborder="0"
             id="bottomId"
             name="bottomId"
             noresize="noresize"
             src="uri-attr:encoded-action-url:http://www.oracle.com"
            >

        </frame>
        <frame
             frameborder="0"
             id="centerId"
             name="centerId"
             noresize="noresize"
             src="uri-attr:encoded-action-url:http://www.oracle.com"
            >

        </frame>
      </frameset>
    </frameset>
  </frameset>
<!--AttributeTest[source,/foo.html]-->

  <frameset
       id="mainId"
       rows="100%,*"
      >

    <frameset
         rows="30pt,*"
         title="Container for top and bottom frames"
        >

      <frame
           frameborder="0"
           id="topId"
           name="topId"
           noresize="noresize"
           src="uri-attr:encoded-action-url:http://www.oracle.com"
          >

      </frame>
      <frameset
           cols="30%,*"
           title="Container for left, center and right frames"
          >

        <frame
             frameborder="0"
             id="bottomId"
             name="bottomId"
             noresize="noresize"
             src="uri-attr:encoded-action-url:http://www.oracle.com"
            >

        </frame>
        <frame
             frameborder="0"
             id="centerId"
             name="centerId"
             noresize="noresize"
             src="uri-attr:encoded-action-url:/test-context-path/foo.html"
            >

        </frame>
      </frameset>
    </frameset>
  </frameset>
<!--AttributeTest[source,//foo.html]-->

  <frameset
       id="mainId"
       rows="100%,*"
      >

    <frameset
         rows="30pt,*"
         title="Container for top and bottom frames"
        >

      <frame
           frameborder="0"
           id="topId"
           name="topId"
           noresize="noresize"
           src="uri-attr:encoded-action-url:http://www.oracle.com"
          >

      </frame>
      <frameset
           cols="30%,*"
           title="Container for left, center and right frames"
          >

        <frame
             frameborder="0"
             id="bottomId"
             name="bottomId"
             noresize="noresize"
             src="uri-attr:encoded-action-url:http://www.oracle.com"
            >

        </frame>
        <frame
             frameborder="0"
             id="centerId"
             name="centerId"
             noresize="noresize"
             src="uri-attr:encoded-action-url:/foo.html"
            >

        </frame>
      </frameset>
    </frameset>
  </frameset>
<!--AttributeTest[longDescURL,http://bali.us.oracle.com]-->

  <frameset
       id="mainId"
       rows="100%,*"
      >

    <frameset
         rows="30pt,*"
         title="Container for top and bottom frames"
        >

      <frame
           frameborder="0"
           id="topId"
           name="topId"
           noresize="noresize"
           src="uri-attr:encoded-action-url:http://www.oracle.com"
          >

      </frame>
      <frameset
           cols="30%,*"
           title="Container for left, center and right frames"
          >

        <frame
             frameborder="0"
             id="bottomId"
             name="bottomId"
             noresize="noresize"
             src="uri-attr:encoded-action-url:http://www.oracle.com"
            >

        </frame>
        <frame
             frameborder="0"
             id="centerId"
             name="centerId"
             noresize="noresize"
             longdesc="uri-attr:encoded-action-url:http://bali.us.oracle.com"
             src="uri-attr:encoded-action-url:http://www.oracle.com"
            >

        </frame>
      </frameset>
    </frameset>
  </frameset>
<!--AttributeTest[marginHeight,50]-->

  <frameset
       id="mainId"
       rows="100%,*"
      >

    <frameset
         rows="30pt,*"
         title="Container for top and bottom frames"
        >

      <frame
           frameborder="0"
           id="topId"
           name="topId"
           noresize="noresize"
           src="uri-attr:encoded-action-url:http://www.oracle.com"
          >

      </frame>
      <frameset
           cols="30%,*"
           title="Container for left, center and right frames"
          >

        <frame
             frameborder="0"
             id="bottomId"
             name="bottomId"
             noresize="noresize"
             src="uri-attr:encoded-action-url:http://www.oracle.com"
            >

        </frame>
        <frame
             frameborder="0"
             id="centerId"
             marginheight="50"
             name="centerId"
             noresize="noresize"
             src="uri-attr:encoded-action-url:http://www.oracle.com"
            >

        </frame>
      </frameset>
    </frameset>
  </frameset>
<!--AttributeTest[marginWidth,50]-->

  <frameset
       id="mainId"
       rows="100%,*"
      >

    <frameset
         rows="30pt,*"
         title="Container for top and bottom frames"
        >

      <frame
           frameborder="0"
           id="topId"
           name="topId"
           noresize="noresize"
           src="uri-attr:encoded-action-url:http://www.oracle.com"
          >

      </frame>
      <frameset
           cols="30%,*"
           title="Container for left, center and right frames"
          >

        <frame
             frameborder="0"
             id="bottomId"
             name="bottomId"
             noresize="noresize"
             src="uri-attr:encoded-action-url:http://www.oracle.com"
            >

        </frame>
        <frame
             frameborder="0"
             id="centerId"
             marginwidth="50"
             name="centerId"
             noresize="noresize"
             src="uri-attr:encoded-action-url:http://www.oracle.com"
            >

        </frame>
      </frameset>
    </frameset>
  </frameset>
<!--AttributeTest[name,myName]-->

  <frameset
       id="mainId"
       rows="100%,*"
      >

    <frameset
         rows="30pt,*"
         title="Container for top and bottom frames"
        >

      <frame
           frameborder="0"
           id="topId"
           name="topId"
           noresize="noresize"
           src="uri-attr:encoded-action-url:http://www.oracle.com"
          >

      </frame>
      <frameset
           cols="30%,*"
           title="Container for left, center and right frames"
          >

        <frame
             frameborder="0"
             id="bottomId"
             name="bottomId"
             noresize="noresize"
             src="uri-attr:encoded-action-url:http://www.oracle.com"
            >

        </frame>
        <frame
             frameborder="0"
             id="centerId"
             name="centerId"
             noresize="noresize"
             src="uri-attr:encoded-action-url:http://www.oracle.com"
            >

        </frame>
      </frameset>
    </frameset>
  </frameset>
<!--AttributeTest[scrolling,yes]-->

  <frameset
       id="mainId"
       rows="100%,*"
      >

    <frameset
         rows="30pt,*"
         title="Container for top and bottom frames"
        >

      <frame
           frameborder="0"
           id="topId"
           name="topId"
           noresize="noresize"
           src="uri-attr:encoded-action-url:http://www.oracle.com"
          >

      </frame>
      <frameset
           cols="30%,*"
           title="Container for left, center and right frames"
          >

        <frame
             frameborder="0"
             id="bottomId"
             name="bottomId"
             noresize="noresize"
             src="uri-attr:encoded-action-url:http://www.oracle.com"
            >

        </frame>
        <frame
             frameborder="0"
             id="centerId"
             name="centerId"
             noresize="noresize"
             scrolling="yes"
             src="uri-attr:encoded-action-url:http://www.oracle.com"
            >

        </frame>
      </frameset>
    </frameset>
  </frameset>
<!--AttributeTest[scrolling,no]-->

  <frameset
       id="mainId"
       rows="100%,*"
      >

    <frameset
         rows="30pt,*"
         title="Container for top and bottom frames"
        >

      <frame
           frameborder="0"
           id="topId"
           name="topId"
           noresize="noresize"
           src="uri-attr:encoded-action-url:http://www.oracle.com"
          >

      </frame>
      <frameset
           cols="30%,*"
           title="Container for left, center and right frames"
          >

        <frame
             frameborder="0"
             id="bottomId"
             name="bottomId"
             noresize="noresize"
             src="uri-attr:encoded-action-url:http://www.oracle.com"
            >

        </frame>
        <frame
             frameborder="0"
             id="centerId"
             name="centerId"
             noresize="noresize"
             scrolling="no"
             src="uri-attr:encoded-action-url:http://www.oracle.com"
            >

        </frame>
      </frameset>
    </frameset>
  </frameset>
<!--AttributeTest[scrolling,auto]-->

  <frameset
       id="mainId"
       rows="100%,*"
      >

    <frameset
         rows="30pt,*"
         title="Container for top and bottom frames"
        >

      <frame
           frameborder="0"
           id="topId"
           name="topId"
           noresize="noresize"
           src="uri-attr:encoded-action-url:http://www.oracle.com"
          >

      </frame>
      <frameset
           cols="30%,*"
           title="Container for left, center and right frames"
          >

        <frame
             frameborder="0"
             id="bottomId"
             name="bottomId"
             noresize="noresize"
             src="uri-attr:encoded-action-url:http://www.oracle.com"
            >

        </frame>
        <frame
             frameborder="0"
             id="centerId"
             name="centerId"
             noresize="noresize"
             scrolling="auto"
             src="uri-attr:encoded-action-url:http://www.oracle.com"
            >

        </frame>
      </frameset>
    </frameset>
  </frameset>
<!--AttributeTest[inlineStyle,background-color:blue]-->

  <frameset
       id="mainId"
       rows="100%,*"
      >

    <frameset
         rows="30pt,*"
         title="Container for top and bottom frames"
        >

      <frame
           frameborder="0"
           id="topId"
           name="topId"
           noresize="noresize"
           src="uri-attr:encoded-action-url:http://www.oracle.com"
          >

      </frame>
      <frameset
           cols="30%,*"
           title="Container for left, center and right frames"
          >

        <frame
             frameborder="0"
             id="bottomId"
             name="bottomId"
             noresize="noresize"
             src="uri-attr:encoded-action-url:http://www.oracle.com"
            >

        </frame>
        <frame
             frameborder="0"
             id="centerId"
             name="centerId"
             noresize="noresize"
             style="background-color:blue"
             src="uri-attr:encoded-action-url:http://www.oracle.com"
            >

        </frame>
      </frameset>
    </frameset>
  </frameset>
<!--AttributeTest[shortDesc,myShortDesc]-->

  <frameset
       id="mainId"
       rows="100%,*"
      >

    <frameset
         rows="30pt,*"
         title="Container for top and bottom frames"
        >

      <frame
           frameborder="0"
           id="topId"
           name="topId"
           noresize="noresize"
           src="uri-attr:encoded-action-url:http://www.oracle.com"
          >

      </frame>
      <frameset
           cols="30%,*"
           title="Container for left, center and right frames"
          >

        <frame
             frameborder="0"
             id="bottomId"
             name="bottomId"
             noresize="noresize"
             src="uri-attr:encoded-action-url:http://www.oracle.com"
            >

        </frame>
        <frame
             frameborder="0"
             id="centerId"
             name="centerId"
             noresize="noresize"
             title="myShortDesc"
             src="uri-attr:encoded-action-url:http://www.oracle.com"
            >

        </frame>
      </frameset>
    </frameset>
  </frameset>
<!--AttributeTest[styleClass,myStyle]-->

  <frameset
       id="mainId"
       rows="100%,*"
      >

    <frameset
         rows="30pt,*"
         title="Container for top and bottom frames"
        >

      <frame
           frameborder="0"
           id="topId"
           name="topId"
           noresize="noresize"
           src="uri-attr:encoded-action-url:http://www.oracle.com"
          >

      </frame>
      <frameset
           cols="30%,*"
           title="Container for left, center and right frames"
          >

        <frame
             frameborder="0"
             id="bottomId"
             name="bottomId"
             noresize="noresize"
             src="uri-attr:encoded-action-url:http://www.oracle.com"
            >

        </frame>
        <frame
             class="myStyle"
             frameborder="0"
             id="centerId"
             name="centerId"
             noresize="noresize"
             src="uri-attr:encoded-action-url:http://www.oracle.com"
            >

        </frame>
      </frameset>
    </frameset>
  </frameset>
<!--AttributeTest[height,30pt]-->

  <frameset
       id="mainId"
       rows="100%,*"
      >

    <frameset
         rows="30pt,*"
         title="Container for top and bottom frames"
        >

      <frame
           frameborder="0"
           id="topId"
           name="topId"
           noresize="noresize"
           src="uri-attr:encoded-action-url:http://www.oracle.com"
          >

      </frame>
      <frameset
           cols="30%,*"
           title="Container for left, center and right frames"
          >

        <frame
             frameborder="0"
             id="bottomId"
             name="bottomId"
             noresize="noresize"
             src="uri-attr:encoded-action-url:http://www.oracle.com"
            >

        </frame>
        <frame
             frameborder="0"
             id="centerId"
             name="centerId"
             noresize="noresize"
             src="uri-attr:encoded-action-url:http://www.oracle.com"
            >

        </frame>
      </frameset>
    </frameset>
  </frameset>
<!--AttributeTest[width,30%]-->

  <frameset
       id="mainId"
       rows="100%,*"
      >

    <frameset
         rows="30pt,*"
         title="Container for top and bottom frames"
        >

      <frame
           frameborder="0"
           id="topId"
           name="topId"
           noresize="noresize"
           src="uri-attr:encoded-action-url:http://www.oracle.com"
          >

      </frame>
      <frameset
           cols="30%,*"
           title="Container for left, center and right frames"
          >

        <frame
             frameborder="0"
             id="bottomId"
             name="bottomId"
             noresize="noresize"
             src="uri-attr:encoded-action-url:http://www.oracle.com"
            >

        </frame>
        <frame
             frameborder="0"
             id="centerId"
             name="centerId"
             noresize="noresize"
             src="uri-attr:encoded-action-url:http://www.oracle.com"
            >

        </frame>
      </frameset>
    </frameset>
  </frameset>
</results>


text:
<?php

namespace Groovey\Migration\Commands;

use Symfony\Component\Console\Command\Command;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;
use Symfony\Component\Console\Input\InputArgument;
use Symfony\Component\Console\Question\ConfirmationQuestion;
use Symfony\Component\Yaml\Parser;
use Groovey\Migration\Migration;
use Groovey\Support\Output;

class Down extends Command
{
    private $app;

    public function __construct($app)
    {
        parent::__construct();

        $this->app = $app;
    }

    protected function configure()
    {
        $this
            ->setName('migrate:down')
            ->setDescription('Reverese the migration')
            ->addArgument(
                'version',
                InputArgument::OPTIONAL,
                'Version number to rollback'
            )
        ;
    }

    protected function execute(InputInterface $input, OutputInterface $output)
    {
        $app      = $this->app;
        $dir      = Migration::getDirectory();
        $output   = Output::style($output);
        $yaml     = new Parser();
        $version  = $input->getArgument('version');
        $helper   = $this->getHelper('question');
        $question = new ConfirmationQuestion('<question>Are you sure you want to proceed? (y/N):</question> ', false);

        if ($version) {
            $record = $app['db']->table('migrations')->where('version', '=', $version)->first();

            if (!$record) {
                $output->writeln('<error>Unable to find migration version.</error>');

                return;
            }

            $records = $app['db']->table('migrations')->where('id', '>=', $record->id)
                            ->orderBy('version', 'DESC')
                            ->get();
        } else {
            $records = $app['db']->table('migrations')->orderBy('version', 'DESC')->take(1)->get();
        }

        if (count($records) == 0) {
            $output->writeln('<error>Nothing to downgrade.</error>');

            return;
        }

        $output->writeln('<highlight>Migration will downgrade to the following files:</highlight>');

        foreach ($records as $record) {
            $output->writeln("<info>- {$record->version}.yml</info>");
        }

        if (!$helper->ask($input, $output, $question)) {
            return;
        }

        foreach ($records as $record) {
            $id       = $record->id;
            $version  = $record->version;
            $filename = $version.'.yml';

            $output->writeln("<info>- Downgrading ($filename)</info>");

            $value = $yaml->parse(file_get_contents($dir.'/'.$filename));
            $down  = explode(';', trim($value['down']));
            $down  = array_filter($down);

            foreach ($down as $query) {
                $app['db']::statement(trim($query));
            }

            $app['db']->table('migrations')->delete($id);
        }
    }
}


text:
namespace Fixtures.AcceptanceTestsBodyComplex
{
    using Microsoft.Rest;
    using Models;

    /// <summary>
    /// Polymorphicrecursive operations.
    /// </summary>
    public partial class Polymorphicrecursive : Microsoft.Rest.IServiceOperations<AutoRestComplexTestService>, IPolymorphicrecursive
    {
        /// <summary>
        /// Initializes a new instance of the Polymorphicrecursive class.
        /// </summary>
        /// <param name='client'>
        /// Reference to the service client.
        /// </param>
        /// <exception cref="System.ArgumentNullException">
        /// Thrown when a required parameter is null
        /// </exception>
        public Polymorphicrecursive(AutoRestComplexTestService client)
        {
            if (client == null)
            {
                throw new System.ArgumentNullException("client");
            }
            this.Client = client;
        }

        /// <summary>
        /// Gets a reference to the AutoRestComplexTestService
        /// </summary>
        public AutoRestComplexTestService Client { get; private set; }

        /// <summary>
        /// Get complex types that are polymorphic and have recursive references
        /// </summary>
        /// <param name='customHeaders'>
        /// Headers that will be added to request.
        /// </param>
        /// <param name='cancellationToken'>
        /// The cancellation token.
        /// </param>
        /// <exception cref="ErrorException">
        /// Thrown when the operation returned an invalid status code
        /// </exception>
        /// <exception cref="Microsoft.Rest.SerializationException">
        /// Thrown when unable to deserialize the response
        /// </exception>
        /// <return>
        /// A response object containing the response body and response headers.
        /// </return>
        public async System.Threading.Tasks.Task<Microsoft.Rest.HttpOperationResponse<Fish>> GetValidWithHttpMessagesAsync(System.Collections.Generic.Dictionary<string, System.Collections.Generic.List<string>> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken))
        {
            // Tracing
            bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled;
            string _invocationId = null;
            if (_shouldTrace)
            {
                _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString();
                System.Collections.Generic.Dictionary<string, object> tracingParameters = new System.Collections.Generic.Dictionary<string, object>();
                tracingParameters.Add("cancellationToken", cancellationToken);
                Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "GetValid", tracingParameters);
            }
            // Construct URL
            var _baseUrl = this.Client.BaseUri.AbsoluteUri;
            var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "complex/polymorphicrecursive/valid").ToString();
            // Create HTTP transport objects
            System.Net.Http.HttpRequestMessage _httpRequest = new System.Net.Http.HttpRequestMessage();
            System.Net.Http.HttpResponseMessage _httpResponse = null;
            _httpRequest.Method = new System.Net.Http.HttpMethod("GET");
            _httpRequest.RequestUri = new System.Uri(_url);
            // Set Headers
            if (customHeaders != null)
            {
                foreach(var _header in customHeaders)
                {
                    if (_httpRequest.Headers.Contains(_header.Key))
                    {
                        _httpRequest.Headers.Remove(_header.Key);
                    }
                    _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value);
                }
            }

            // Serialize Request
            string _requestContent = null;
            // Send Request
            if (_shouldTrace)
            {
                Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest);
            }
            cancellationToken.ThrowIfCancellationRequested();
            _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
            if (_shouldTrace)
            {
                Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse);
            }
            System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode;
            cancellationToken.ThrowIfCancellationRequested();
            string _responseContent = null;
            if ((int)_statusCode != 200)
            {
                var ex = new ErrorException(string.Format("Operation returned an invalid status code '{0}'", _statusCode));
                try
                {
                    _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
                    Error _errorBody =  Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject<Error>(_responseContent, this.Client.DeserializationSettings);
                    if (_errorBody != null)
                    {
                        ex.Body = _errorBody;
                    }
                }
                catch (Newtonsoft.Json.JsonException)
                {
                    // Ignore the exception
                }
                ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent);
                ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent);
                if (_shouldTrace)
                {
                    Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex);
                }
                _httpRequest.Dispose();
                if (_httpResponse != null)
                {
                    _httpResponse.Dispose();
                }
                throw ex;
            }
            // Create Result
            var _result = new Microsoft.Rest.HttpOperationResponse<Fish>();
            _result.Request = _httpRequest;
            _result.Response = _httpResponse;
            // Deserialize Response
            if ((int)_statusCode == 200)
            {
                _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
                try
                {
                    _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject<Fish>(_responseContent, this.Client.DeserializationSettings);
                }
                catch (Newtonsoft.Json.JsonException ex)
                {
                    _httpRequest.Dispose();
                    if (_httpResponse != null)
                    {
                        _httpResponse.Dispose();
                    }
                    throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex);
                }
            }
            if (_shouldTrace)
            {
                Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result);
            }
            return _result;
        }

        /// <summary>
        /// Put complex types that are polymorphic and have recursive references
        /// </summary>
        /// <param name='complexBody'>
        /// Please put a salmon that looks like this:
        /// {
        /// "fishtype": "salmon",
        /// "species": "king",
        /// "length": 1,
        /// "age": 1,
        /// "location": "alaska",
        /// "iswild": true,
        /// "siblings": [
        /// {
        /// "fishtype": "shark",
        /// "species": "predator",
        /// "length": 20,
        /// "age": 6,
        /// "siblings": [
        /// {
        /// "fishtype": "salmon",
        /// "species": "coho",
        /// "length": 2,
        /// "age": 2,
        /// "location": "atlantic",
        /// "iswild": true,
        /// "siblings": [
        /// {
        /// "fishtype": "shark",
        /// "species": "predator",
        /// "length": 20,
        /// "age": 6
        /// },
        /// {
        /// "fishtype": "sawshark",
        /// "species": "dangerous",
        /// "length": 10,
        /// "age": 105
        /// }
        /// ]
        /// },
        /// {
        /// "fishtype": "sawshark",
        /// "species": "dangerous",
        /// "length": 10,
        /// "age": 105
        /// }
        /// ]
        /// },
        /// {
        /// "fishtype": "sawshark",
        /// "species": "dangerous",
        /// "length": 10,
        /// "age": 105
        /// }
        /// ]
        /// }
        /// </param>
        /// <param name='customHeaders'>
        /// Headers that will be added to request.
        /// </param>
        /// <param name='cancellationToken'>
        /// The cancellation token.
        /// </param>
        /// <exception cref="ErrorException">
        /// Thrown when the operation returned an invalid status code
        /// </exception>
        /// <exception cref="Microsoft.Rest.ValidationException">
        /// Thrown when a required parameter is null
        /// </exception>
        /// <return>
        /// A response object containing the response body and response headers.
        /// </return>
        public async System.Threading.Tasks.Task<Microsoft.Rest.HttpOperationResponse> PutValidWithHttpMessagesAsync(Fish complexBody, System.Collections.Generic.Dictionary<string, System.Collections.Generic.List<string>> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken))
        {
            if (complexBody == null)
            {
                throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "complexBody");
            }
            if (complexBody != null)
            {
                complexBody.Validate();
            }
            // Tracing
            bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled;
            string _invocationId = null;
            if (_shouldTrace)
            {
                _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString();
                System.Collections.Generic.Dictionary<string, object> tracingParameters = new System.Collections.Generic.Dictionary<string, object>();
                tracingParameters.Add("complexBody", complexBody);
                tracingParameters.Add("cancellationToken", cancellationToken);
                Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "PutValid", tracingParameters);
            }
            // Construct URL
            var _baseUrl = this.Client.BaseUri.AbsoluteUri;
            var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "complex/polymorphicrecursive/valid").ToString();
            // Create HTTP transport objects
            System.Net.Http.HttpRequestMessage _httpRequest = new System.Net.Http.HttpRequestMessage();
            System.Net.Http.HttpResponseMessage _httpResponse = null;
            _httpRequest.Method = new System.Net.Http.HttpMethod("PUT");
            _httpRequest.RequestUri = new System.Uri(_url);
            // Set Headers
            if (customHeaders != null)
            {
                foreach(var _header in customHeaders)
                {
                    if (_httpRequest.Headers.Contains(_header.Key))
                    {
                        _httpRequest.Headers.Remove(_header.Key);
                    }
                    _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value);
                }
            }

            // Serialize Request
            string _requestContent = null;
            if(complexBody != null)
            {
                _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(complexBody, this.Client.SerializationSettings);
                _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8);
                _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8");
            }
            // Send Request
            if (_shouldTrace)
            {
                Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest);
            }
            cancellationToken.ThrowIfCancellationRequested();
            _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
            if (_shouldTrace)
            {
                Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse);
            }
            System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode;
            cancellationToken.ThrowIfCancellationRequested();
            string _responseContent = null;
            if ((int)_statusCode != 200)
            {
                var ex = new ErrorException(string.Format("Operation returned an invalid status code '{0}'", _statusCode));
                try
                {
                    _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
                    Error _errorBody =  Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject<Error>(_responseContent, this.Client.DeserializationSettings);
                    if (_errorBody != null)
                    {
                        ex.Body = _errorBody;
                    }
                }
                catch (Newtonsoft.Json.JsonException)
                {
                    // Ignore the exception
                }
                ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent);
                ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent);
                if (_shouldTrace)
                {
                    Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex);
                }
                _httpRequest.Dispose();
                if (_httpResponse != null)
                {
                    _httpResponse.Dispose();
                }
                throw ex;
            }
            // Create Result
            var _result = new Microsoft.Rest.HttpOperationResponse();
            _result.Request = _httpRequest;
            _result.Response = _httpResponse;
            if (_shouldTrace)
            {
                Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result);
            }
            return _result;
        }

    }
}


text:
package actor

import (
	"errors"
	"time"

	"github.com/AsynkronIT/protoactor-go/log"
	"github.com/emirpasic/gods/stacks/linkedliststack"
)

type localContext struct {
	message            interface{}
	parent             *PID
	self               *PID
	actor              Actor
	supervisor         SupervisorStrategy
	producer           Producer
	inboundMiddleware  ActorFunc
	outboundMiddleware SenderFunc
	behavior           behaviorStack
	receive            ActorFunc
	children           PIDSet
	watchers           PIDSet
	watching           PIDSet
	stash              *linkedliststack.Stack
	stopping           bool
	restarting         bool
	receiveTimeout     time.Duration
	t                  *time.Timer
	restartStats       *RestartStatistics
}

func newLocalContext(producer Producer, supervisor SupervisorStrategy, inboundMiddleware []InboundMiddleware, outboundMiddleware []OutboundMiddleware, parent *PID) *localContext {
	this := &localContext{
		parent:     parent,
		producer:   producer,
		supervisor: supervisor,
	}

	// Construct the inbound middleware chain with the final receiver at the end
	if inboundMiddleware != nil {
		this.inboundMiddleware = makeInboundMiddlewareChain(inboundMiddleware, func(ctx Context) {
			if _, ok := this.message.(*PoisonPill); ok {
				this.self.Stop()
			} else {
				this.receive(ctx)
			}
		})
	}

	// Construct the outbound middleware chain with the final sender at the end
	this.outboundMiddleware = makeOutboundMiddlewareChain(outboundMiddleware, func(_ Context, target *PID, envelope *MessageEnvelope) {
		target.ref().SendUserMessage(target, envelope)
	})

	this.incarnateActor()
	return this
}

func (ctx *localContext) Actor() Actor {
	return ctx.actor
}

func (ctx *localContext) Message() interface{} {
	envelope, ok := ctx.message.(*MessageEnvelope)
	if ok {
		return envelope.Message
	}
	return ctx.message
}

func (ctx *localContext) Sender() *PID {
	envelope, ok := ctx.message.(*MessageEnvelope)
	if ok {
		return envelope.Sender
	}
	return nil
}

func (ctx *localContext) MessageHeader() ReadonlyMessageHeader {
	envelope, ok := ctx.message.(*MessageEnvelope)
	if ok {
		if envelope.Header != nil {
			return envelope.Header
		}
	}
	return emptyMessageHeader
}

func (ctx *localContext) Tell(pid *PID, message interface{}) {
	ctx.sendUserMessage(pid, message)
}

func (ctx *localContext) sendUserMessage(pid *PID, message interface{}) {
	if ctx.outboundMiddleware != nil {
		if env, ok := message.(*MessageEnvelope); ok {
			ctx.outboundMiddleware(ctx, pid, env)
		} else {
			ctx.outboundMiddleware(ctx, pid, &MessageEnvelope{
				Header:  nil,
				Message: message,
				Sender:  nil,
			})
		}
	} else {
		pid.ref().SendUserMessage(pid, message)
	}
}

func (ctx *localContext) Request(pid *PID, message interface{}) {
	env := &MessageEnvelope{
		Header:  nil,
		Message: message,
		Sender:  ctx.Self(),
	}

	ctx.sendUserMessage(pid, env)
}

func (ctx *localContext) RequestFuture(pid *PID, message interface{}, timeout time.Duration) *Future {
	future := NewFuture(timeout)
	env := &MessageEnvelope{
		Header:  nil,
		Message: message,
		Sender:  future.PID(),
	}
	ctx.sendUserMessage(pid, env)

	return future
}

func (ctx *localContext) Stash() {
	if ctx.stash == nil {
		ctx.stash = linkedliststack.New()
	}

	ctx.stash.Push(ctx.message)
}

func (ctx *localContext) cancelTimer() {
	if ctx.t != nil {
		ctx.t.Stop()
		ctx.t = nil
		ctx.receiveTimeout = 0
	}
}

func (ctx *localContext) receiveTimeoutHandler() {
	if ctx.t != nil {
		ctx.cancelTimer()
		ctx.self.Tell(receiveTimeoutMessage)
	}
}

func (ctx *localContext) SetReceiveTimeout(d time.Duration) {
	if d == ctx.receiveTimeout {
		return
	}
	if ctx.t != nil {
		ctx.t.Stop()
	}

	if d < time.Millisecond {
		// anything less than than 1 millisecond is set to zero
		d = 0
	}

	ctx.receiveTimeout = d
	if d > 0 {
		if ctx.t == nil {
			ctx.t = time.AfterFunc(d, ctx.receiveTimeoutHandler)
		} else {
			ctx.t.Reset(d)
		}
	}
}

func (ctx *localContext) ReceiveTimeout() time.Duration {
	return ctx.receiveTimeout
}

func (ctx *localContext) Children() []*PID {
	r := make([]*PID, ctx.children.Len())
	ctx.children.ForEach(func(i int, p PID) {
		r[i] = &p
	})
	return r
}

func (ctx *localContext) Self() *PID {
	return ctx.self
}

func (ctx *localContext) Parent() *PID {
	return ctx.parent
}

func (ctx *localContext) Receive(message interface{}) {
	ctx.processMessage(message)
}

func (ctx *localContext) RestartStats() *RestartStatistics {
	//lazy initialize the child restart stats if this is the first time
	//further mutations are handled within "restart"
	if ctx.restartStats == nil {
		ctx.restartStats = &RestartStatistics{
			FailureCount: 0,
		}
	}
	return ctx.restartStats
}

func (ctx *localContext) EscalateFailure(reason interface{}, message interface{}) {
	failure := &Failure{Reason: reason, Who: ctx.self, RestartStats: ctx.RestartStats()}
	ctx.self.sendSystemMessage(suspendMailboxMessage)
	if ctx.parent == nil {
		handleRootFailure(failure)
	} else {
		//TODO: Akka recursively suspends all children also on failure
		//Not sure if I think this is the right way to go, why do children need to wait for their parents failed state to recover?
		ctx.parent.sendSystemMessage(failure)
	}
}

func (ctx *localContext) InvokeUserMessage(md interface{}) {
	influenceTimeout := true
	if ctx.receiveTimeout > 0 {
		_, influenceTimeout = md.(NotInfluenceReceiveTimeout)
		influenceTimeout = !influenceTimeout
		if influenceTimeout {
			ctx.t.Stop()
		}
	}

	ctx.processMessage(md)

	if ctx.receiveTimeout > 0 && influenceTimeout {
		ctx.t.Reset(ctx.receiveTimeout)
	}
}

func (ctx *localContext) processMessage(m interface{}) {
	ctx.message = m

	if ctx.inboundMiddleware != nil {
		ctx.inboundMiddleware(ctx)
	} else {
		if _, ok := m.(*PoisonPill); ok {
			ctx.self.Stop()
		} else {
			ctx.receive(ctx)
		}
	}

	ctx.message = nil
}

func (ctx *localContext) incarnateActor() {
	pid := ctx.producer()
	ctx.restarting = false
	ctx.stopping = false
	ctx.actor = pid
	ctx.receive = pid.Receive
}

func (ctx *localContext) InvokeSystemMessage(message interface{}) {
	switch msg := message.(type) {
	case *continuation:
		ctx.message = msg.message // apply the message that was present when we started the await
		msg.f()                   // invoke the continuation in the current actor context
		ctx.message = nil         // release the message
	case *Started:
		ctx.InvokeUserMessage(msg) // forward
	case *Watch:
		if ctx.stopping {
			msg.Watcher.sendSystemMessage(&Terminated{Who: ctx.self})
		} else {
			ctx.watchers.Add(msg.Watcher)
		}
	case *Unwatch:
		ctx.watchers.Remove(msg.Watcher)
	case *Stop:
		ctx.handleStop(msg)
	case *Terminated:
		ctx.handleTerminated(msg)
	case *Failure:
		ctx.handleFailure(msg)
	case *Restart:
		ctx.handleRestart(msg)
	default:
		plog.Error("unknown system message", log.Message(msg))
	}
}

func (ctx *localContext) handleRestart(msg *Restart) {
	ctx.stopping = false
	ctx.restarting = true
	ctx.InvokeUserMessage(restartingMessage)
	ctx.children.ForEach(func(_ int, pid PID) {
		pid.Stop()
	})
	ctx.tryRestartOrTerminate()
}

//I am stopping
func (ctx *localContext) handleStop(msg *Stop) {
	ctx.stopping = true
	ctx.restarting = false

	ctx.InvokeUserMessage(stoppingMessage)
	ctx.children.ForEach(func(_ int, pid PID) {
		pid.Stop()
	})
	ctx.tryRestartOrTerminate()
}

//child stopped, check if we can stop or restart (if needed)
func (ctx *localContext) handleTerminated(msg *Terminated) {
	ctx.children.Remove(msg.Who)
	ctx.watching.Remove(msg.Who)

	ctx.InvokeUserMessage(msg)
	ctx.tryRestartOrTerminate()
}

//offload the supervision completely to the supervisor strategy
func (ctx *localContext) handleFailure(msg *Failure) {
	if strategy, ok := ctx.actor.(SupervisorStrategy); ok {
		strategy.HandleFailure(ctx, msg.Who, msg.RestartStats, msg.Reason, msg.Message)
		return
	}
	ctx.supervisor.HandleFailure(ctx, msg.Who, msg.RestartStats, msg.Reason, msg.Message)
}

func (ctx *localContext) tryRestartOrTerminate() {
	if ctx.t != nil {
		ctx.t.Stop()
		ctx.t = nil
		ctx.receiveTimeout = 0
	}

	if !ctx.children.Empty() {
		return
	}

	if ctx.restarting {
		ctx.restart()
		return
	}

	if ctx.stopping {
		ctx.stopped()
	}
}

func (ctx *localContext) restart() {
	ctx.incarnateActor()
	ctx.InvokeUserMessage(startedMessage)
	ctx.RestartStats().Restart()
	if ctx.stash != nil {
		for !ctx.stash.Empty() {
			msg, _ := ctx.stash.Pop()
			ctx.InvokeUserMessage(msg)
		}
	}
	ctx.self.sendSystemMessage(resumeMailboxMessage)
}

func (ctx *localContext) stopped() {
	ProcessRegistry.Remove(ctx.self)
	ctx.InvokeUserMessage(stoppedMessage)
	otherStopped := &Terminated{Who: ctx.self}
	ctx.watchers.ForEach(func(i int, pid PID) {
		pid.sendSystemMessage(otherStopped)
	})
}

func (ctx *localContext) SetBehavior(behavior ActorFunc) {
	ctx.behavior.Clear()
	ctx.receive = behavior
}

func (ctx *localContext) PushBehavior(behavior ActorFunc) {
	ctx.behavior.Push(ctx.receive)
	ctx.receive = behavior
}

func (ctx *localContext) PopBehavior() {
	if ctx.behavior.Len() == 0 {
		panic("Cannot unbecome actor base behavior")
	}
	ctx.receive, _ = ctx.behavior.Pop()
}

func (ctx *localContext) Watch(who *PID) {
	who.sendSystemMessage(&Watch{
		Watcher: ctx.self,
	})
	ctx.watching.Add(who)
}

func (ctx *localContext) Unwatch(who *PID) {
	who.sendSystemMessage(&Unwatch{
		Watcher: ctx.self,
	})
	ctx.watching.Remove(who)
}
func (ctx *localContext) Respond(response interface{}) {
	// If the message is addressed to nil forward it to the dead letter channel
	if ctx.Sender() == nil {
		deadLetter.SendUserMessage(nil, response)
		return
	}

	ctx.Tell(ctx.Sender(), response)
}

func (ctx *localContext) Spawn(props *Props) *PID {
	pid, _ := ctx.SpawnNamed(props, ProcessRegistry.NextId())
	return pid
}

func (ctx *localContext) SpawnPrefix(props *Props, prefix string) *PID {
	pid, _ := ctx.SpawnNamed(props, prefix+ProcessRegistry.NextId())
	return pid
}

func (ctx *localContext) SpawnNamed(props *Props, name string) (*PID, error) {
	if props.guardianStrategy != nil {
		panic(errors.New("Props used to spawn child cannot have GuardianStrategy"))
	}

	pid, err := props.spawn(ctx.self.Id+"/"+name, ctx.self)
	if err != nil {
		return pid, err
	}

	ctx.children.Add(pid)
	ctx.Watch(pid)

	return pid, nil
}

func (ctx *localContext) GoString() string {
	return ctx.self.String()
}

func (ctx *localContext) String() string {
	return ctx.self.String()
}

func (ctx *localContext) AwaitFuture(f *Future, cont func(res interface{}, err error)) {
	wrapper := func() {
		cont(f.result, f.err)
	}

	message := ctx.message
	//invoke the callback when the future completes
	f.continueWith(func(res interface{}, err error) {
		//send the wrapped callaback as a continuation message to self
		ctx.self.sendSystemMessage(&continuation{
			f:       wrapper,
			message: message,
		})
	})
}

func (*localContext) RestartChildren(pids ...*PID) {
	for _, pid := range pids {
		pid.sendSystemMessage(restartMessage)
	}
}

func (*localContext) StopChildren(pids ...*PID) {
	for _, pid := range pids {
		pid.sendSystemMessage(stopMessage)
	}
}

func (*localContext) ResumeChildren(pids ...*PID) {
	for _, pid := range pids {
		pid.sendSystemMessage(resumeMailboxMessage)
	}
}


text:
// @formatter:off

package com.microsoft.alm.teamfoundation.workitemtracking.webapi.models;

import java.util.HashMap;

/**
 */
public class WitBatchResponse {

    private String body;
    private int code;
    private HashMap<String, String> headers;

    public String getBody() {
        return body;
    }

    public void setBody(final String body) {
        this.body = body;
    }

    public int getCode() {
        return code;
    }

    public void setCode(final int code) {
        this.code = code;
    }

    public HashMap<String, String> getHeaders() {
        return headers;
    }

    public void setHeaders(final HashMap<String, String> headers) {
        this.headers = headers;
    }
}


text:
<!DOCTYPE html>

<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<link rel="icon" href="/assets/images/favicon.png">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-alpha.6/css/bootstrap.min.css" integrity="sha384-rwoIResjU2yc3z8GV/NPeZWAv56rSmLldC3R/AZzGRnGxQQKnKkoFVhFQhNUwEyJ" crossorigin="anonymous">
<link href="https://maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css" rel="stylesheet">
<link href="https://fonts.googleapis.com/css?family=Rubik:400,400i,500,500i,700,700i" rel="stylesheet">
<link href="/assets/css/theme.css" rel="stylesheet">
<link href="/assets/css/custom.css" rel="stylesheet">

<meta name="description" content="">

  <meta property="og:site_name" content="Fellipe Brito">

  <meta property="og:title" content="Tchau 2013">
  <meta property="og:type" content="article">
  <meta property="og:description" content="

"/>

  <meta property="og:image" content="http://fellipebrito.com/assets/images/header.jpg" />
  <meta property="article:published_time" content="2013-12-31T00:00:00-06:00">
  <meta property="article:author" content="http://fellipebrito.com/about/">

  <meta property="og:url" content="http://fellipebrito.com/tchau-2013/" />

  <meta itemprop="keywords" content="fim de ano" />

  <meta property="article:tag" content="fim de ano">

    <button class="navbar-toggler navbar-toggler-right" type="button" data-toggle="collapse" data-target="#navbarsWow" aria-controls="navbarsWow" aria-expanded="false" aria-label="Toggle navigation">

    </button>

          Fellipe Brito | Crer também é pensar

                Home

                    Sobre

Fellipe Brito

             Fellipe Brito | Crer também é pensar

Conecte-se!

Newsletter

<link href="//cdn-images.mailchimp.com/embedcode/classic-10_7.css" rel="stylesheet" type="text/css">

<form action="https://fellipebrito.us19.list-manage.com/subscribe/post?u=0794ba995c37a5e8a28edf28d&id=8bb58341f2" method="post" id="mc-embedded-subscribe-form" name="mc-embedded-subscribe-form" class="validate" target="_blank" novalidate>

      <input type="email" value="" name="EMAIL" class="required email" id="mce-EMAIL" placeholder="seuemail@gmail.com" required>

<input type="text" name="b_0794ba995c37a5e8a28edf28d_8bb58341f2" tabindex="-1" value="">

<input type="submit" value="Confirmar!" name="subscribe" id="mc-embedded-subscribe" class="button">

</form>

                         fim de ano

Tchau 2013

2013 acabou, aliás, pra mim vai acabar 6 horas depois do que normalmente acabaria.

Nas memórias, nas fotos e nos cadernos de anotação ficam muitas aventuras;

Em 2013 eu não joguei futebol, nenhuma vez; foi a primeira vez na vida que passei um ano inteiro sem jogar futebol: Por outro lado, eu fui a um jogo de baseball, assisti um jogo da NFL no estádio, joguei basquete, surfei muito mais do que já havia feito, andei de skate, pedalei mais de 600km, corri, fiz academia, nadei, pratiquei Yoga e joguei tenis!!!

Em 2013 eu viajei, MUITO; Itapema, Bombinhas, Joinville, Pontal do Sul, Ipanema, Paranaguá, Morretes, Curitiba, São Paulo, Washington, Portland, Los Angeles, Hollywood, Santa Monica, Malibu, Huntington, San Diego, La Jolla, uma partezinha do Mojave, Las Vegas, Grand Canyon… e mais algumas que com certeza esqueci.

Em 2013 eu passei meu primeiro aniversário longe dos meus pais, e também o natal, e a virada do ano… 2013 me ensinou o que é saudade;

Em 2013 eu dirigi muito menos, por outro lado andei mais de bicicleta, onibus, taxi, aviao, pilotei uma moto 700cc e andei de Helicóptero.

Em 2013 eu me mudei, 4x, foram 4 casas diferentes e alguns hotéis.

Em 2013 eu fui muito ao cinema, li muito, diversos livros, de ficções sobre o rei Arthur à biografia dos Beatles, de livros técnicos de Jazz a livros profundos sobre Código limpo; eu também experimentei muita comida diferente.

Em 2013 eu redescobri que existe vida se você não tem carro próprio, que bicicleta é um excelente meio de transporte e que de vez em quando taxi e onibus podem ajudar.

Em 2013 eu assisti ao vivo 3 músicos entre os quais eu mais gosto de ouvir: Michael W Smith, Michael Buble e Marcos Witt… foram shows espetaculares;

Em 2013 eu aprendi a assistir filmes em ingles sem legenda, não foi muito minha escolha, mas hoje já acho estranho quando um filme tem legenda… embora eu ainda nao entenda 100% dos diálogos na lingua original;

Em 2013 eu sofri a dor de passar dias sem ter um abraço, um aperto de mão, um "escape" para comer uma pizza com um amigo e poder chorar e pedir conselhos;

Em 2013 eu recebi emails e recados de pessoas queridas, fiz novos amigos, muitos que não estão nem um pouco perto, tenho um amigo precioso na África como missionário, outros em Curitiba, Santos, Espanha, Sao Paulo, Denver, e até aqui perto já temos um casal de amigos;

Em 2013 eu e minha esposa entendemos ainda mais o que é a parceria do casamento, somos nós dois, do outro lado do mundo, com todos os problemas do mundo e tem sido uma aventura magnifica;

Em 2013 eu contratei funcionários e tive que despedir outros, a empresa cresceu, e diminuiu. Eu ajudei a equipe a melhorar a infra estrutura e a gerenciar melhor os projetos, mas eu contei com excelentes funcionários que sem eles seria impossível fazer o que temos feito até agora e o que ainda planejamos para o futuro.

Em 2013 eu participei de reuniões, muitas, longas…

Em 2013 eu aprendi que o mundo é gigante, e minúsculo.

Em 2013 eu visitei lugares fantásticos, piers, parques, montanhas, praias, cidades, restaurantes, shoppings, museus…

Em 2013 eu amei minha esposa, todos os dias, e cada dia mais.

O mais engraçado é que olhando tudo que aconteceu, pouco saiu "como o planejado" em 31 de dezembro de 2012, e mesmo assim, cá estou eu com uma lista de projetos, divididas em seções de business e pessoal, por trimestres, que vão desde quais livros quero ler até quais atividades quero executar.

Uma das mais importantes é relaxar um pouco mais, desligar um pouco mais… em 2014 faço 30 anos e tenho aprendido que o mundo vai continuar girando, mesmo que eu nao esteja conferindo isso de minuto em minuto, enquanto gerencio minha empresa e checo minhas notificações no celular.

Tentar ir um pouco mais devagar, separar a vida pessoal do escritório, apagar Facebook e Twitter do celular, deixar pra programar a agenda da semana às segundas 5 da manha invez de domingo 7 da noite… a vida é muito preciosa e sensível para ser colocada de lado enquanto eu estou fazendo outra coisa.

Para 2013 eu fiz diversos planos, quase todos mudaram e eu tive que "improvisar", para 2014 eu quero viver…

Feliz 2014!!!

                <time class="post-date" datetime="2013-12-31">31 Dec 2013</time>

                    « Um galo que não conhece a nuvem

                    A forca dos hábitos »

            Fellipe BritoFollow
            Fellipe Brito | Crer também é pensar

    Please enable JavaScript to view the comments powered by Disqus.
    comments powered by Disqus

                Copyright © 2018 Fellipe Brito.

                "Affiliates Theme" - Design & Code by WowThemes.net