text:
package com.netflix.conductor.jedis;

import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;

import redis.clients.jedis.BinaryClient.LIST_POSITION;
import redis.clients.jedis.BitPosParams;
import redis.clients.jedis.GeoCoordinate;
import redis.clients.jedis.GeoRadiusResponse;
import redis.clients.jedis.GeoUnit;
import redis.clients.jedis.Jedis;
import redis.clients.jedis.JedisCommands;
import redis.clients.jedis.JedisSentinelPool;
import redis.clients.jedis.ScanParams;
import redis.clients.jedis.ScanResult;
import redis.clients.jedis.SortingParams;
import redis.clients.jedis.Tuple;
import redis.clients.jedis.params.geo.GeoRadiusParam;
import redis.clients.jedis.params.sortedset.ZAddParams;
import redis.clients.jedis.params.sortedset.ZIncrByParams;

public class JedisClusterSentinel implements JedisCommands {

  private final JedisSentinelPool jedisPool;

  public JedisClusterSentinel(JedisSentinelPool jedisPool) {
    this.jedisPool = jedisPool;
  }

  @Override
  public String set(String key, String value) {
    Jedis jedis = null;
    try {
      jedis = jedisPool.getResource();
      return jedis.set(key, value);
    } finally {
      if (jedis != null)
        jedis.close();
    }
  }

  @Override
  public String set(String key, String value, String nxxx, String expx, long time) {
    Jedis jedis = null;
    try {
      jedis = jedisPool.getResource();
      return jedis.set(key, value, nxxx, expx, time);
    } finally {
      if (jedis != null)
        jedis.close();
    }
  }

  @Override
  public String set(String key, String value, String nxxx) {
    Jedis jedis = null;
    try {
      jedis = jedisPool.getResource();
      return jedis.set(key, value, nxxx);
    } finally {
      if (jedis != null)
        jedis.close();
    }
  }

  @Override
  public String get(String key) {
    Jedis jedis = null;
    try {
      jedis = jedisPool.getResource();
      return jedis.get(key);
    } finally {
      if (jedis != null)
        jedis.close();
    }
  }

  @Override
  public Boolean exists(String key) {
    Jedis jedis = null;
    try {
      jedis = jedisPool.getResource();
      return jedis.exists(key);
    } finally {
      if (jedis != null)
        jedis.close();
    }
  }

  @Override
  public Long persist(String key) {
    Jedis jedis = null;
    try {
      jedis = jedisPool.getResource();
      return jedis.persist(key);
    } finally {
      if (jedis != null)
        jedis.close();
    }
  }

  @Override
  public String type(String key) {
    Jedis jedis = null;
    try {
      jedis = jedisPool.getResource();
      return jedis.type(key);
    } finally {
      if (jedis != null)
        jedis.close();
    }
  }

  @Override
  public Long expire(String key, int seconds) {
    Jedis jedis = null;
    try {
      jedis = jedisPool.getResource();
      return jedis.expire(key, seconds);
    } finally {
      if (jedis != null)
        jedis.close();
    }
  }

  @Override
  public Long pexpire(String key, long milliseconds) {
    Jedis jedis = null;
    try {
      jedis = jedisPool.getResource();
      return jedis.pexpire(key, milliseconds);
    } finally {
      if (jedis != null)
        jedis.close();
    }
  }

  @Override
  public Long expireAt(String key, long unixTime) {
    Jedis jedis = null;
    try {
      jedis = jedisPool.getResource();
      return jedis.expireAt(key, unixTime);
    } finally {
      if (jedis != null)
        jedis.close();
    }
  }

  @Override
  public Long pexpireAt(String key, long millisecondsTimestamp) {
    Jedis jedis = null;
    try {
      jedis = jedisPool.getResource();
      return jedis.pexpireAt(key, millisecondsTimestamp);
    } finally {
      if (jedis != null)
        jedis.close();
    }
  }

  @Override
  public Long ttl(String key) {
    Jedis jedis = null;
    try {
      jedis = jedisPool.getResource();
      return jedis.ttl(key);
    } finally {
      if (jedis != null)
        jedis.close();
    }
  }

  @Override
  public Long pttl(String key) {
    Jedis jedis = null;
    try {
      jedis = jedisPool.getResource();
      return jedis.pttl(key);
    } finally {
      if (jedis != null)
        jedis.close();
    }
  }

  @Override
  public Boolean setbit(String key, long offset, boolean value) {
    Jedis jedis = null;
    try {
      jedis = jedisPool.getResource();
      return jedis.setbit(key, offset, value);
    } finally {
      if (jedis != null)
        jedis.close();
    }
  }

  @Override
  public Boolean setbit(String key, long offset, String value) {
    Jedis jedis = null;
    try {
      jedis = jedisPool.getResource();
      return jedis.setbit(key, offset, value);
    } finally {
      if (jedis != null)
        jedis.close();
    }
  }

  @Override
  public Boolean getbit(String key, long offset) {
    Jedis jedis = null;
    try {
      jedis = jedisPool.getResource();
      return jedis.getbit(key, offset);
    } finally {
      if (jedis != null)
        jedis.close();
    }
  }

  @Override
  public Long setrange(String key, long offset, String value) {
    Jedis jedis = null;
    try {
      jedis = jedisPool.getResource();
      return jedis.setrange(key, offset, value);
    } finally {
      if (jedis != null)
        jedis.close();
    }
  }

  @Override
  public String getrange(String key, long startOffset, long endOffset) {
    Jedis jedis = null;
    try {
      jedis = jedisPool.getResource();
      return jedis.getrange(key, startOffset, endOffset);
    } finally {
      if (jedis != null)
        jedis.close();
    }
  }

  @Override
  public String getSet(String key, String value) {
    Jedis jedis = null;
     try {
       jedis = jedisPool.getResource();
       return jedis.getSet(key, value);
     } finally {
       if (jedis != null)
         jedis.close();
     }
  }

  @Override
  public Long setnx(String key, String value) {
    Jedis jedis = null;
     try {
       jedis = jedisPool.getResource();
       return jedis.setnx(key, value);
     } finally {
       if (jedis != null)
         jedis.close();
     }
  }

  @Override
  public String setex(String key, int seconds, String value) {
    Jedis jedis = null;
     try {
       jedis = jedisPool.getResource();
       return jedis.setex(key, seconds, value);
     } finally {
       if (jedis != null)
         jedis.close();
     }
  }

  @Override
  public String psetex(String key, long milliseconds, String value) {
    Jedis jedis = null;
     try {
       jedis = jedisPool.getResource();
       return jedis.psetex(key, milliseconds, value);
     } finally {
       if (jedis != null)
         jedis.close();
     }
  }

  @Override
  public Long decrBy(String key, long integer) {
    Jedis jedis = null;
     try {
       jedis = jedisPool.getResource();
       return jedis.decrBy(key, integer);
     } finally {
       if (jedis != null)
         jedis.close();
     }
  }

  @Override
  public Long decr(String key) {
    Jedis jedis = null;
     try {
       jedis = jedisPool.getResource();
       return jedis.decr(key);
     } finally {
       if (jedis != null)
         jedis.close();
     }
  }

  @Override
  public Long incrBy(String key, long integer) {
    Jedis jedis = null;
     try {
       jedis = jedisPool.getResource();
       return jedis.incrBy(key, integer);
     } finally {
       if (jedis != null)
         jedis.close();
     }
  }

  @Override
  public Double incrByFloat(String key, double value) {
    Jedis jedis = null;
     try {
       jedis = jedisPool.getResource();
       return jedis.incrByFloat(key, value);
     } finally {
       if (jedis != null)
         jedis.close();
     }
  }

  @Override
  public Long incr(String key) {
    Jedis jedis = null;
     try {
       jedis = jedisPool.getResource();
       return jedis.incr(key);
     } finally {
       if (jedis != null)
         jedis.close();
     }
  }

  @Override
  public Long append(String key, String value) {
    Jedis jedis = null;
     try {
       jedis = jedisPool.getResource();
       return jedis.append(key, value);
     } finally {
       if (jedis != null)
         jedis.close();
     }
  }

  @Override
  public String substr(String key, int start, int end) {
    Jedis jedis = null;
     try {
       jedis = jedisPool.getResource();
       return jedis.substr(key, start, end);
     } finally {
       if (jedis != null)
         jedis.close();
     }
  }

  @Override
  public Long hset(String key, String field, String value) {
    Jedis jedis = null;
     try {
       jedis = jedisPool.getResource();
       return jedis.hset(key, field, value);
     } finally {
       if (jedis != null)
         jedis.close();
     }
  }

  @Override
  public String hget(String key, String field) {
    Jedis jedis = null;
     try {
       jedis = jedisPool.getResource();
       return jedis.hget(key, field);
     } finally {
       if (jedis != null)
         jedis.close();
     }
  }

  @Override
  public Long hsetnx(String key, String field, String value) {
    Jedis jedis = null;
     try {
       jedis = jedisPool.getResource();
       return jedis.hsetnx(key, field, value);
     } finally {
       if (jedis != null)
         jedis.close();
     }
  }

  @Override
  public String hmset(String key, Map<String, String> hash) {
    Jedis jedis = null;
     try {
       jedis = jedisPool.getResource();
       return jedis.hmset(key, hash);
     } finally {
       if (jedis != null)
         jedis.close();
     }
  }

  @Override
  public List<String> hmget(String key, String... fields) {
    Jedis jedis = null;
     try {
       jedis = jedisPool.getResource();
       return jedis.hmget(key, fields);
     } finally {
       if (jedis != null)
         jedis.close();
     }
  }

  @Override
  public Long hincrBy(String key, String field, long value) {
    Jedis jedis = null;
     try {
       jedis = jedisPool.getResource();
       return jedis.hincrBy(key, field, value);
     } finally {
       if (jedis != null)
         jedis.close();
     }
  }

  @Override
  public Double hincrByFloat(String key, String field, double value) {
    Jedis jedis = null;
     try {
       jedis = jedisPool.getResource();
       return jedis.hincrByFloat(key, field, value);
     } finally {
       if (jedis != null)
         jedis.close();
     }
  }

  @Override
  public Boolean hexists(String key, String field) {
    Jedis jedis = null;
     try {
       jedis = jedisPool.getResource();
       return jedis.hexists(key, field);
     } finally {
       if (jedis != null)
         jedis.close();
     }
  }

  @Override
  public Long hdel(String key, String... field) {
    Jedis jedis = null;
     try {
       jedis = jedisPool.getResource();
       return jedis.hdel(key, field);
     } finally {
       if (jedis != null)
         jedis.close();
     }
  }

  @Override
  public Long hlen(String key) {
    Jedis jedis = null;
     try {
       jedis = jedisPool.getResource();
       return jedis.hlen(key);
     } finally {
       if (jedis != null)
         jedis.close();
     }
  }

  @Override
  public Set<String> hkeys(String key) {
    Jedis jedis = null;
     try {
       jedis = jedisPool.getResource();
       return jedis.hkeys(key);
     } finally {
       if (jedis != null)
         jedis.close();
     }
  }

  @Override
  public List<String> hvals(String key) {
    Jedis jedis = null;
     try {
       jedis = jedisPool.getResource();
       return jedis.hvals(key);
     } finally {
       if (jedis != null)
         jedis.close();
     }
  }

  @Override
  public Map<String, String> hgetAll(String key) {
    Jedis jedis = null;
     try {
       jedis = jedisPool.getResource();
       return jedis.hgetAll(key);
     } finally {
       if (jedis != null)
         jedis.close();
     }
  }

  @Override
  public Long rpush(String key, String... string) {
    Jedis jedis = null;
     try {
       jedis = jedisPool.getResource();
       return jedis.rpush(key, string);
     } finally {
       if (jedis != null)
         jedis.close();
     }
  }

  @Override
  public Long lpush(String key, String... string) {
    Jedis jedis = null;
     try {
       jedis = jedisPool.getResource();
       return jedis.lpush(key, string);
     } finally {
       if (jedis != null)
         jedis.close();
     }
  }

  @Override
  public Long llen(String key) {
    Jedis jedis = null;
     try {
       jedis = jedisPool.getResource();
       return jedis.llen(key);
     } finally {
       if (jedis != null)
         jedis.close();
     }
  }

  @Override
  public List<String> lrange(String key, long start, long end) {
    Jedis jedis = null;
     try {
       jedis = jedisPool.getResource();
       return jedis.lrange(key, start, end);
     } finally {
       if (jedis != null)
         jedis.close();
     }
  }

  @Override
  public String ltrim(String key, long start, long end) {
    Jedis jedis = null;
     try {
       jedis = jedisPool.getResource();
       return jedis.ltrim(key, start, end);
     } finally {
       if (jedis != null)
         jedis.close();
     }
  }

  @Override
  public String lindex(String key, long index) {
    Jedis jedis = null;
     try {
       jedis = jedisPool.getResource();
       return jedis.lindex(key, index);
     } finally {
       if (jedis != null)
         jedis.close();
     }
  }

  @Override
  public String lset(String key, long index, String value) {
    Jedis jedis = null;
     try {
       jedis = jedisPool.getResource();
       return jedis.lset(key, index, value);
     } finally {
       if (jedis != null)
         jedis.close();
     }
  }

  @Override
  public Long lrem(String key, long count, String value) {
    Jedis jedis = null;
     try {
       jedis = jedisPool.getResource();
       return jedis.lrem(key, count, value);
     } finally {
       if (jedis != null)
         jedis.close();
     }
  }

  @Override
  public String lpop(String key) {
    Jedis jedis = null;
     try {
       jedis = jedisPool.getResource();
       return jedis.lpop(key);
     } finally {
       if (jedis != null)
         jedis.close();
     }
  }

  @Override
  public String rpop(String key) {
    Jedis jedis = null;
     try {
       jedis = jedisPool.getResource();
       return jedis.rpop(key);
     } finally {
       if (jedis != null)
         jedis.close();
     }
  }

  @Override
  public Long sadd(String key, String... member) {
    Jedis jedis = null;
     try {
       jedis = jedisPool.getResource();
       return jedis.sadd(key, member);
     } finally {
       if (jedis != null)
         jedis.close();
     }
  }

  @Override
  public Set<String> smembers(String key) {
    Jedis jedis = null;
     try {
       jedis = jedisPool.getResource();
       return jedis.smembers(key);
     } finally {
       if (jedis != null)
         jedis.close();
     }
  }

  @Override
  public Long srem(String key, String... member) {
    Jedis jedis = null;
     try {
       jedis = jedisPool.getResource();
       return jedis.srem(key, member);
     } finally {
       if (jedis != null)
         jedis.close();
     }
  }

  @Override
  public String spop(String key) {
    Jedis jedis = null;
     try {
       jedis = jedisPool.getResource();
       return jedis.spop(key);
     } finally {
       if (jedis != null)
         jedis.close();
     }
  }

  @Override
  public Set<String> spop(String key, long count) {
    Jedis jedis = null;
     try {
       jedis = jedisPool.getResource();
       return jedis.spop(key, count);
     } finally {
       if (jedis != null)
         jedis.close();
     }
  }

  @Override
  public Long scard(String key) {
    Jedis jedis = null;
     try {
       jedis = jedisPool.getResource();
       return jedis.scard(key);
     } finally {
       if (jedis != null)
         jedis.close();
     }
  }

  @Override
  public Boolean sismember(String key, String member) {
    Jedis jedis = null;
     try {
       jedis = jedisPool.getResource();
       return jedis.sismember(key, member);
     } finally {
       if (jedis != null)
         jedis.close();
     }
  }

  @Override
  public String srandmember(String key) {
    Jedis jedis = null;
     try {
       jedis = jedisPool.getResource();
       return jedis.srandmember(key);
     } finally {
       if (jedis != null)
         jedis.close();
     }
  }

  @Override
  public List<String> srandmember(String key, int count) {
    Jedis jedis = null;
     try {
       jedis = jedisPool.getResource();
       return jedis.srandmember(key, count);
     } finally {
       if (jedis != null)
         jedis.close();
     }
  }

  @Override
  public Long strlen(String key) {
    Jedis jedis = null;
     try {
       jedis = jedisPool.getResource();
       return jedis.strlen(key);
     } finally {
       if (jedis != null)
         jedis.close();
     }
  }

  @Override
  public Long zadd(String key, double score, String member) {
    Jedis jedis = null;
     try {
       jedis = jedisPool.getResource();
       return jedis.zadd(key, score, member);
     } finally {
       if (jedis != null)
         jedis.close();
     }
  }

  @Override
  public Long zadd(String key, double score, String member, ZAddParams params) {
    Jedis jedis = null;
     try {
       jedis = jedisPool.getResource();
       return jedis.zadd(key, score, member, params);
     } finally {
       if (jedis != null)
         jedis.close();
     }
  }

  @Override
  public Long zadd(String key, Map<String, Double> scoreMembers) {
    Jedis jedis = null;
     try {
       jedis = jedisPool.getResource();
       return jedis.zadd(key, scoreMembers);
     } finally {
       if (jedis != null)
         jedis.close();
     }
  }

  @Override
  public Long zadd(String key, Map<String, Double> scoreMembers, ZAddParams params) {
    Jedis jedis = null;
     try {
       jedis = jedisPool.getResource();
       return jedis.zadd(key, scoreMembers, params);
     } finally {
       if (jedis != null)
         jedis.close();
     }
  }

  @Override
  public Set<String> zrange(String key, long start, long end) {
    Jedis jedis = null;
     try {
       jedis = jedisPool.getResource();
       return jedis.zrange(key, start, end);
     } finally {
       if (jedis != null)
         jedis.close();
     }
  }

  @Override
  public Long zrem(String key, String... member) {
    Jedis jedis = null;
     try {
       jedis = jedisPool.getResource();
       return jedis.zrem(key, member);
     } finally {
       if (jedis != null)
         jedis.close();
     }
  }

  @Override
  public Double zincrby(String key, double score, String member) {
    Jedis jedis = null;
     try {
       jedis = jedisPool.getResource();
       return jedis.zincrby(key, score, member);
     } finally {
       if (jedis != null)
         jedis.close();
     }
  }

  @Override
  public Double zincrby(String key, double score, String member, ZIncrByParams params) {
    Jedis jedis = null;
     try {
       jedis = jedisPool.getResource();
       return jedis.zincrby(key, score, member, params);
     } finally {
       if (jedis != null)
         jedis.close();
     }
  }

  @Override
  public Long zrank(String key, String member) {
    Jedis jedis = null;
     try {
       jedis = jedisPool.getResource();
       return jedis.zrank(key, member);
     } finally {
       if (jedis != null)
         jedis.close();
     }
  }

  @Override
  public Long zrevrank(String key, String member) {
    Jedis jedis = null;
     try {
       jedis = jedisPool.getResource();
       return jedis.zrevrank(key, member);
     } finally {
       if (jedis != null)
         jedis.close();
     }
  }

  @Override
  public Set<String> zrevrange(String key, long start, long end) {
    Jedis jedis = null;
     try {
       jedis = jedisPool.getResource();
       return jedis.zrevrange(key, start, end);
     } finally {
       if (jedis != null)
         jedis.close();
     }
  }

  @Override
  public Set<Tuple> zrangeWithScores(String key, long start, long end) {
    Jedis jedis = null;
     try {
       jedis = jedisPool.getResource();
       return jedis.zrangeWithScores(key, start, end);
     } finally {
       if (jedis != null)
         jedis.close();
     }
  }

  @Override
  public Set<Tuple> zrevrangeWithScores(String key, long start, long end) {
    Jedis jedis = null;
     try {
       jedis = jedisPool.getResource();
       return jedis.zrevrangeWithScores(key, start, end);
     } finally {
       if (jedis != null)
         jedis.close();
     }
  }

  @Override
  public Long zcard(String key) {
    Jedis jedis = null;
     try {
       jedis = jedisPool.getResource();
       return jedis.zcard(key);
     } finally {
       if (jedis != null)
         jedis.close();
     }
  }

  @Override
  public Double zscore(String key, String member) {
    Jedis jedis = null;
     try {
       jedis = jedisPool.getResource();
       return jedis.zscore(key, member);
     } finally {
       if (jedis != null)
         jedis.close();
     }
  }

  @Override
  public List<String> sort(String key) {
    Jedis jedis = null;
     try {
       jedis = jedisPool.getResource();
       return jedis.sort(key);
     } finally {
       if (jedis != null)
         jedis.close();
     }
  }

  @Override
  public List<String> sort(String key, SortingParams sortingParameters) {
    Jedis jedis = null;
     try {
       jedis = jedisPool.getResource();
       return jedis.sort(key, sortingParameters);
     } finally {
       if (jedis != null)
         jedis.close();
     }
  }

  @Override
  public Long zcount(String key, double min, double max) {
    Jedis jedis = null;
     try {
       jedis = jedisPool.getResource();
       return jedis.zcount(key, min, max);
     } finally {
       if (jedis != null)
         jedis.close();
     }
  }

  @Override
  public Long zcount(String key, String min, String max) {
    Jedis jedis = null;
     try {
       jedis = jedisPool.getResource();
       return jedis.zcount(key, min, max);
     } finally {
       if (jedis != null)
         jedis.close();
     }
  }

  @Override
  public Set<String> zrangeByScore(String key, double min, double max) {
    Jedis jedis = null;
     try {
       jedis = jedisPool.getResource();
       return jedis.zrangeByScore(key, min, max);
     } finally {
       if (jedis != null)
         jedis.close();
     }
  }

  @Override
  public Set<String> zrangeByScore(String key, String min, String max) {
    Jedis jedis = null;
     try {
       jedis = jedisPool.getResource();
       return jedis.zrangeByScore(key, min, max);
     } finally {
       if (jedis != null)
         jedis.close();
     }
  }

  @Override
  public Set<String> zrevrangeByScore(String key, double max, double min) {
    Jedis jedis = null;
     try {
       jedis = jedisPool.getResource();
       return jedis.zrevrangeByScore(key, max, min);
     } finally {
       if (jedis != null)
         jedis.close();
     }
  }

  @Override
  public Set<String> zrangeByScore(String key, double min, double max, int offset, int count) {
    Jedis jedis = null;
     try {
       jedis = jedisPool.getResource();
       return jedis.zrangeByScore(key, min, max, offset, count);
     } finally {
       if (jedis != null)
         jedis.close();
     }
  }

  @Override
  public Set<String> zrevrangeByScore(String key, String max, String min) {
    Jedis jedis = null;
     try {
       jedis = jedisPool.getResource();
       return jedis.zrevrangeByScore(key, max, min);
     } finally {
       if (jedis != null)
         jedis.close();
     }
  }

  @Override
  public Set<String> zrangeByScore(String key, String min, String max, int offset, int count) {
    Jedis jedis = null;
     try {
       jedis = jedisPool.getResource();
       return jedis.zrangeByScore(key, min, max, offset, count);
     } finally {
       if (jedis != null)
         jedis.close();
     }
  }

  @Override
  public Set<String> zrevrangeByScore(String key, double max, double min, int offset, int count) {
    Jedis jedis = null;
     try {
       jedis = jedisPool.getResource();
       return jedis.zrevrangeByScore(key, max, min, offset, count);
     } finally {
       if (jedis != null)
         jedis.close();
     }
  }

  @Override
  public Set<Tuple> zrangeByScoreWithScores(String key, double min, double max) {
    Jedis jedis = null;
     try {
       jedis = jedisPool.getResource();
       return jedis.zrangeByScoreWithScores(key, min, max);
     } finally {
       if (jedis != null)
         jedis.close();
     }
  }

  @Override
  public Set<Tuple> zrevrangeByScoreWithScores(String key, double max, double min) {
    Jedis jedis = null;
     try {
       jedis = jedisPool.getResource();
       return jedis.zrevrangeByScoreWithScores(key, max, min);
     } finally {
       if (jedis != null)
         jedis.close();
     }
  }

  @Override
  public Set<Tuple> zrangeByScoreWithScores(String key, double min, double max, int offset, int count) {
    Jedis jedis = null;
     try {
       jedis = jedisPool.getResource();
       return jedis.zrangeByScoreWithScores(key, min, max, offset, count);
     } finally {
       if (jedis != null)
         jedis.close();
     }
  }

  @Override
  public Set<String> zrevrangeByScore(String key, String max, String min, int offset, int count) {
    Jedis jedis = null;
     try {
       jedis = jedisPool.getResource();
       return jedis.zrevrangeByScore(key, max, min, offset, count);
     } finally {
       if (jedis != null)
         jedis.close();
     }
  }

  @Override
  public Set<Tuple> zrangeByScoreWithScores(String key, String min, String max) {
    Jedis jedis = null;
     try {
       jedis = jedisPool.getResource();
       return jedis.zrangeByScoreWithScores(key, min, max);
     } finally {
       if (jedis != null)
         jedis.close();
     }
  }

  @Override
  public Set<Tuple> zrevrangeByScoreWithScores(String key, String max, String min) {
    Jedis jedis = null;
     try {
       jedis = jedisPool.getResource();
       return jedis.zrevrangeByScoreWithScores(key, max, min);
     } finally {
       if (jedis != null)
         jedis.close();
     }
  }

  @Override
  public Set<Tuple> zrangeByScoreWithScores(String key, String min, String max, int offset, int count) {
    Jedis jedis = null;
     try {
       jedis = jedisPool.getResource();
       return jedis.zrangeByScoreWithScores(key, min, max, offset, count);
     } finally {
       if (jedis != null)
         jedis.close();
     }
  }

  @Override
  public Set<Tuple> zrevrangeByScoreWithScores(String key, double max, double min, int offset, int count) {
    Jedis jedis = null;
     try {
       jedis = jedisPool.getResource();
       return jedis.zrevrangeByScoreWithScores(key, max, min, offset, count);
     } finally {
       if (jedis != null)
         jedis.close();
     }
  }

  @Override
  public Set<Tuple> zrevrangeByScoreWithScores(String key, String max, String min, int offset, int count) {
    Jedis jedis = null;
     try {
       jedis = jedisPool.getResource();
       return jedis.zrevrangeByScoreWithScores(key, max, min, offset, count);
     } finally {
       if (jedis != null)
         jedis.close();
     }
  }

  @Override
  public Long zremrangeByRank(String key, long start, long end) {
    Jedis jedis = null;
     try {
       jedis = jedisPool.getResource();
       return jedis.zremrangeByRank(key, start, end);
     } finally {
       if (jedis != null)
         jedis.close();
     }
  }

  @Override
  public Long zremrangeByScore(String key, double start, double end) {
    Jedis jedis = null;
     try {
       jedis = jedisPool.getResource();
       return jedis.zremrangeByScore(key, start, end);
     } finally {
       if (jedis != null)
         jedis.close();
     }
  }

  @Override
  public Long zremrangeByScore(String key, String start, String end) {
    Jedis jedis = null;
     try {
       jedis = jedisPool.getResource();
       return jedis.zremrangeByScore(key, start, end);
     } finally {
       if (jedis != null)
         jedis.close();
     }
  }

  @Override
  public Long zlexcount(String key, String min, String max) {
    Jedis jedis = null;
     try {
       jedis = jedisPool.getResource();
       return jedis.zlexcount(key, min, max);
     } finally {
       if (jedis != null)
         jedis.close();
     }
  }

  @Override
  public Set<String> zrangeByLex(String key, String min, String max) {
    Jedis jedis = null;
     try {
       jedis = jedisPool.getResource();
       return jedis.zrangeByLex(key, min, max);
     } finally {
       if (jedis != null)
         jedis.close();
     }
  }

  @Override
  public Set<String> zrangeByLex(String key, String min, String max, int offset, int count) {
    Jedis jedis = null;
     try {
       jedis = jedisPool.getResource();
       return jedis.zrangeByLex(key, min, max, offset, count);
     } finally {
       if (jedis != null)
         jedis.close();
     }
  }

  @Override
  public Set<String> zrevrangeByLex(String key, String max, String min) {
    Jedis jedis = null;
     try {
       jedis = jedisPool.getResource();
       return jedis.zrevrangeByLex(key, max, min);
     } finally {
       if (jedis != null)
         jedis.close();
     }
  }

  @Override
  public Set<String> zrevrangeByLex(String key, String max, String min, int offset, int count) {
    Jedis jedis = null;
     try {
       jedis = jedisPool.getResource();
       return jedis.zrevrangeByLex(key, max, min, offset, count);
     } finally {
       if (jedis != null)
         jedis.close();
     }
  }

  @Override
  public Long zremrangeByLex(String key, String min, String max) {
    Jedis jedis = null;
     try {
       jedis = jedisPool.getResource();
       return jedis.zremrangeByLex(key, min, max);
     } finally {
       if (jedis != null)
         jedis.close();
     }
  }

  @Override
  public Long linsert(String key, LIST_POSITION where, String pivot, String value) {
    Jedis jedis = null;
     try {
       jedis = jedisPool.getResource();
       return jedis.linsert(key, where, pivot, value);
     } finally {
       if (jedis != null)
         jedis.close();
     }
  }

  @Override
  public Long lpushx(String key, String... string) {
    Jedis jedis = null;
     try {
       jedis = jedisPool.getResource();
       return jedis.lpushx(key, string);
     } finally {
       if (jedis != null)
         jedis.close();
     }
  }

  @Override
  public Long rpushx(String key, String... string) {
    Jedis jedis = null;
     try {
       jedis = jedisPool.getResource();
       return jedis.rpushx(key, string);
     } finally {
       if (jedis != null)
         jedis.close();
     }
  }

  @Override
  @Deprecated
  public List<String> blpop(String arg) {
    Jedis jedis = null;
     try {
       jedis = jedisPool.getResource();
       return jedis.blpop(arg);
     } finally {
       if (jedis != null)
         jedis.close();
     }
  }

  @Override
  public List<String> blpop(int timeout, String key) {
    Jedis jedis = null;
     try {
       jedis = jedisPool.getResource();
       return jedis.blpop(timeout, key);
     } finally {
       if (jedis != null)
         jedis.close();
     }
  }

  @Override
  @Deprecated
  public List<String> brpop(String arg) {
    Jedis jedis = null;
     try {
       jedis = jedisPool.getResource();
       return jedis.brpop(arg);
     } finally {
       if (jedis != null)
         jedis.close();
     }
  }

  @Override
  public List<String> brpop(int timeout, String key) {
    Jedis jedis = null;
     try {
       jedis = jedisPool.getResource();
       return jedis.brpop(timeout, key);
     } finally {
       if (jedis != null)
         jedis.close();
     }
  }

  @Override
  public Long del(String key) {
    Jedis jedis = null;
     try {
       jedis = jedisPool.getResource();
       return jedis.del(key);
     } finally {
       if (jedis != null)
         jedis.close();
     }
  }

  @Override
  public String echo(String string) {
    Jedis jedis = null;
     try {
       jedis = jedisPool.getResource();
       return jedis.echo(string);
     } finally {
       if (jedis != null)
         jedis.close();
     }
  }

  @Override
  public Long move(String key, int dbIndex) {
    Jedis jedis = null;
     try {
       jedis = jedisPool.getResource();
       return jedis.move(key, dbIndex);
     } finally {
       if (jedis != null)
         jedis.close();
     }
  }

  @Override
  public Long bitcount(String key) {
    Jedis jedis = null;
     try {
       jedis = jedisPool.getResource();
       return jedis.bitcount(key);
     } finally {
       if (jedis != null)
         jedis.close();
     }
  }

  @Override
  public Long bitcount(String key, long start, long end) {
    Jedis jedis = null;
     try {
       jedis = jedisPool.getResource();
       return jedis.bitcount(key, start, end);
     } finally {
       if (jedis != null)
         jedis.close();
     }
  }

  @Override
  public Long bitpos(String key, boolean value) {
    Jedis jedis = null;
     try {
       jedis = jedisPool.getResource();
       return jedis.bitpos(key, value);
     } finally {
       if (jedis != null)
         jedis.close();
     }
  }

  @Override
  public Long bitpos(String key, boolean value, BitPosParams params) {
    Jedis jedis = null;
     try {
       jedis = jedisPool.getResource();
       return jedis.bitpos(key, value, params);
     } finally {
       if (jedis != null)
         jedis.close();
     }
  }

  @Override
  @Deprecated
  public ScanResult<Entry<String, String>> hscan(String key, int cursor) {
    Jedis jedis = null;
     try {
       jedis = jedisPool.getResource();
       return jedis.hscan(key, cursor);
     } finally {
       if (jedis != null)
         jedis.close();
     }
  }

  @Override
  @Deprecated
  public ScanResult<String> sscan(String key, int cursor) {
    Jedis jedis = null;
     try {
       jedis = jedisPool.getResource();
       return jedis.sscan(key, cursor);
     } finally {
       if (jedis != null)
         jedis.close();
     }
  }

  @Override
  @Deprecated
  public ScanResult<Tuple> zscan(String key, int cursor) {
    Jedis jedis = null;
     try {
       jedis = jedisPool.getResource();
       return jedis.zscan(key, cursor);
     } finally {
       if (jedis != null)
         jedis.close();
     }
  }

  @Override
  public ScanResult<Entry<String, String>> hscan(String key, String cursor) {
    Jedis jedis = null;
     try {
       jedis = jedisPool.getResource();
       return jedis.hscan(key, cursor);
     } finally {
       if (jedis != null)
         jedis.close();
     }
  }

  @Override
  public ScanResult<Entry<String, String>> hscan(String key, String cursor, ScanParams params) {
    Jedis jedis = null;
     try {
       jedis = jedisPool.getResource();
       return jedis.hscan(key, cursor, params);
     } finally {
       if (jedis != null)
         jedis.close();
     }
  }

  @Override
  public ScanResult<String> sscan(String key, String cursor) {
    Jedis jedis = null;
     try {
       jedis = jedisPool.getResource();
       return jedis.sscan(key, cursor);
     } finally {
       if (jedis != null)
         jedis.close();
     }
  }

  @Override
  public ScanResult<String> sscan(String key, String cursor, ScanParams params) {
    Jedis jedis = null;
     try {
       jedis = jedisPool.getResource();
       return jedis.sscan(key, cursor, params);
     } finally {
       if (jedis != null)
         jedis.close();
     }
  }

  @Override
  public ScanResult<Tuple> zscan(String key, String cursor) {
    Jedis jedis = null;
     try {
       jedis = jedisPool.getResource();
       return jedis.zscan(key, cursor);
     } finally {
       if (jedis != null)
         jedis.close();
     }
  }

  @Override
  public ScanResult<Tuple> zscan(String key, String cursor, ScanParams params) {
    Jedis jedis = null;
     try {
       jedis = jedisPool.getResource();
       return jedis.zscan(key, cursor, params);
     } finally {
       if (jedis != null)
         jedis.close();
     }
  }

  @Override
  public Long pfadd(String key, String... elements) {
    Jedis jedis = null;
     try {
       jedis = jedisPool.getResource();
       return jedis.pfadd(key, elements);
     } finally {
       if (jedis != null)
         jedis.close();
     }
  }

  @Override
  public long pfcount(String key) {
    Jedis jedis = null;
     try {
       jedis = jedisPool.getResource();
       return jedis.pfcount(key);
     } finally {
       if (jedis != null)
         jedis.close();
     }
  }

  @Override
  public Long geoadd(String key, double longitude, double latitude, String member) {
    Jedis jedis = null;
     try {
       jedis = jedisPool.getResource();
       return jedis.geoadd(key, longitude, latitude, member);
     } finally {
       if (jedis != null)
         jedis.close();
     }
  }

  @Override
  public Long geoadd(String key, Map<String, GeoCoordinate> memberCoordinateMap) {
    Jedis jedis = null;
     try {
       jedis = jedisPool.getResource();
       return jedis.geoadd(key, memberCoordinateMap);
     } finally {
       if (jedis != null)
         jedis.close();
     }
  }

  @Override
  public Double geodist(String key, String member1, String member2) {
    Jedis jedis = null;
     try {
       jedis = jedisPool.getResource();
       return jedis.geodist(key, member1, member2);
     } finally {
       if (jedis != null)
         jedis.close();
     }
  }

  @Override
  public Double geodist(String key, String member1, String member2, GeoUnit unit) {
    Jedis jedis = null;
     try {
       jedis = jedisPool.getResource();
       return jedis.geodist(key, member1, member2, unit);
     } finally {
       if (jedis != null)
         jedis.close();
     }
  }

  @Override
  public List<String> geohash(String key, String... members) {
    Jedis jedis = null;
     try {
       jedis = jedisPool.getResource();
       return jedis.geohash(key, members);
     } finally {
       if (jedis != null)
         jedis.close();
     }
  }

  @Override
  public List<GeoCoordinate> geopos(String key, String... members) {
    Jedis jedis = null;
     try {
       jedis = jedisPool.getResource();
       return jedis.geopos(key, members);
     } finally {
       if (jedis != null)
         jedis.close();
     }
  }

  @Override
  public List<GeoRadiusResponse> georadius(String key, double longitude, double latitude, double radius, GeoUnit unit) {
    Jedis jedis = null;
     try {
       jedis = jedisPool.getResource();
       return jedis.georadius(key, longitude, latitude, radius, unit);
     } finally {
       if (jedis != null)
         jedis.close();
     }
  }

  @Override
  public List<GeoRadiusResponse> georadius(String key, double longitude, double latitude, double radius, GeoUnit unit,
      GeoRadiusParam param) {
    return null;
  }

  @Override
  public List<GeoRadiusResponse> georadiusByMember(String key, String member, double radius, GeoUnit unit) {
    Jedis jedis = null;
     try {
       jedis = jedisPool.getResource();
       return jedis.georadiusByMember(key, member, radius, unit);
     } finally {
       if (jedis != null)
         jedis.close();
     }
  }

  @Override
  public List<GeoRadiusResponse> georadiusByMember(String key, String member, double radius, GeoUnit unit,
      GeoRadiusParam param) {
    return null;
  }

  @Override
  public List<Long> bitfield(String key, String... arguments) {
    Jedis jedis = null;
     try {
       jedis = jedisPool.getResource();
       return jedis.bitfield(key, arguments);
     } finally {
       if (jedis != null)
         jedis.close();
     }
  }

}


text:
This tutorial describes how to create a Distributed Random Forest (DRF) model using H2O Flow.

Those who have never used H2O before should refer to Getting Started for additional instructions on how to run H2O Flow.

### Getting Started

This tutorial uses a publicly available data set that can be found at http://archive.ics.uci.edu/ml/machine-learning-databases/internet_ads/

The data are composed of 3279 observations, 1557 attributes, and an a priori grouping assignment. The objective is to build a prediction tool that predicts whether an object is an internet ad or not.

If you don't have any data of your own to work with, you can find some example datasets here:

- http://docs.h2o.ai/h2oclassic/resources/publicdata.html
- http://data.h2o.ai

####Importing Data
Before creating a model, import data into H2O:

0. Click the **Assist Me!** button (the last button in the row of buttons below the menus).

 ![Assist Me button](../images/Flow_AssistMeButton.png)

0. Click the **importFiles** link and enter the file path to the dataset in the **Search** entry field.
0. Click the **Add all** link to add the file to the import queue, then click the **Import** button.

  ![Importing Files](../images/RF_ImportFile.png)

####Parsing Data
Now, parse the imported data:

0. Click the **Parse these files...** button.

  **Note**: The default options typically do not need to be changed unless the data does not parse correctly.

0. From the drop-down **Parser** list, select the file type of the data set (Auto, XLS, CSV, or SVMLight).
0. If the data uses a separator, select it from the drop-down **Separator** list.
0. If the data uses a column header as the first row, select the **First row contains column names** radio button. If the first row contains data, select the **First row contains data** radio button. To have H2O automatically determine if the first row of the dataset contains column names or data, select the **Auto** radio button.
0. If the data uses apostrophes ( `'` - also known as single quotes), check the **Enable single quotes as a field quotation character** checkbox.
0. To delete the imported dataset after parsing, check the **Delete on done** checkbox.

  **NOTE**: In general, we recommend enabling this option. Retaining data requires memory resources, but does not aid in modeling because unparsed data cannot be used by H2O.

0. Review the data in the **Edit Column Names and Types** section, then click the **Parse** button.

  ![Parsing Data](../images/RF_Parse.png)

  **NOTE**: Make sure the parse is complete by confirming progress is 100% before continuing to the next step, model building. For small datasets, this should only take a few seconds, but larger datasets take longer to parse.

### Building a Model

0. Once data are parsed, click the **View** button, then click the **Build Model** button.
0. Select `Distributed RF` from the drop-down **Select an algorithm** menu, then click the **Build model** button.
0. If the parsed ad.hex file is not already listed in the **Training_frame** drop-down list, select it. Otherwise, continue to the next step.
0. From the **Response column** drop-down list, select `C1`.
0. In the **Ntrees** field, specify the number of trees for the model to build. For this example, enter `150`.
0. In the **Max_depth** field, specify the maximum distance from the root to the terminal node. For this example, use the default value of `20`.
0. In the **Mtries** field, specify the number of features on which the trees will be split. For this example, enter `1000`.
0. Click the **Build Model** button.

   ![Random Forest Model Builder](../images/RF_BuildModel.png)

### DRF Output

The DRF model output includes the following:

- Model parameters (hidden)
- Scoring history graph (number for each tree and MSE)
- ROC curve, training metrics, AUC (with drop-down menus to select thresholds and criterion)
- Variable importances (variable name, relative importance, scaled importance, percentage)
- Output (model category, validation metrics, initf)
- Model summary (number of trees, min. depth, max. depth, mean depth, min. leaves, max. leaves, mean leaves)
- Scoring history (in tabular format)
- Training metrics (model name, model checksum, frame name, frame checksum, description if applicable, model category, duration in ms, scoring time, predictions, MSE, R2, Logloss, AUC, Gini)
- Domain
- Training metrics (thresholds, F1, F2, F0Points, Accuracy, Precision, Recall, Specificity, Absolute MCC, min. per-class accuracy, TNS, FNS, FPS, TPS, IDX)
- Maximum metrics (metric, threshold, value, IDX)
- Variable importances
- Preview POJO

  ![Random Forest Model Results](../images/RF_Model_Results.png)

### DRF Predict

To generate a prediction, click the **Predict** button in the model results and select the `ad.hex` file from the drop-down **Frame** list, then click the **Predict** button.

  ![Random Forest Prediction](../images/RF_Predict.png)

You can also click the **Inspect** button to access more information (for example, columns or data).

  ![Random Forest Prediction Details](../images/RF_Predict2.png)

redpajama_set_name: RedPajamaGithub


text:
(function (buster, define) {
	'use strict';

	var assert, refute, fail;

	assert = buster.assertions.assert;
	refute = buster.assertions.refute;
	fail = buster.assertions.fail;

	define('rest/interceptor/template-test', function (require) {

		var template, rest;

		template = require('rest/interceptor/template');
		rest = require('rest');

		function parent(request) {
			return { request: request };
		}

		buster.testCase('rest/interceptor/template', {
			'should apply the params to the path template': function () {
				var client, config;

				config = {};
				client = template(parent, config);

				return client({ path: 'http://example.com/dictionary{/term:1,term}{?lang}', params: { term: 'hypermedia' } }).then(function (response) {
					assert.same('http://example.com/dictionary/h/hypermedia', response.request.path);
					refute('params' in response.request);
				}).otherwise(fail);
			},
			'should apply the template and params from the config if not defined on the request': function () {
				var client, config;

				config = { template: 'http://example.com/dictionary{/term:1,term}{?lang}', params: { term: 'hypermedia' } };
				client = template(parent, config);

				return client().then(function (response) {
					assert.same('http://example.com/dictionary/h/hypermedia', response.request.path);
					refute('params' in response.request);
				}).otherwise(fail);
			},
			'should individually mix config params into the request': function () {
				var client, config;

				config = { params: { lang: 'en-us' } };
				client = template(parent, config);

				return client({ path: 'http://example.com/dictionary{/term:1,term}{?lang}', params: { term: 'hypermedia' } }).then(function (response) {
					assert.same('http://example.com/dictionary/h/hypermedia?lang=en-us', response.request.path);
					refute('params' in response.request);
				}).otherwise(fail);
			},
			'should ignore missing and overdefined params': function () {
				var client, config;

				config = {};
				client = template(parent, config);

				return client({ path: 'http://example.com/dictionary{/term:1,term}{?lang}', params: { q: 'hypermedia' } }).then(function (response) {
					assert.same('http://example.com/dictionary', response.request.path);
					refute('params' in response.request);
				}).otherwise(fail);
			},
			'should have the default client as the parent by default': function () {
				assert.same(rest, template().skip());
			},
			'should support interceptor wrapping': function () {
				assert(typeof template().wrap === 'function');
			}
		});

	});

}(
	this.buster || require('buster'),
	typeof define === 'function' && define.amd ? define : function (id, factory) {
		var packageName = id.split(/[\/\-]/)[0], pathToRoot = id.replace(/[^\/]+/g, '..');
		pathToRoot = pathToRoot.length > 2 ? pathToRoot.substr(3) : pathToRoot;
		factory(function (moduleId) {
			return require(moduleId.indexOf(packageName) === 0 ? pathToRoot + moduleId.substr(packageName.length) : moduleId);
		});
	}
	// Boilerplate for AMD and Node
));


text:
from request_handler import request_get
from request_handler import request_post
from utils import get_config, get_config_int

def get_products_info():
    req_url = get_config('dashboard_service', 'SERVER_URL') + get_config('dashboard_service', 'API_PRODUCT_INFO')
    return request_get(req_url=req_url, headers={'Authorization': 'Bearer 3A9A34CF-12CD-4A56-B18D-71D9FD3654BD'})

def get_prod_ver_error_collection(prod, version, page=1, pageSize=30):
    req_url = get_config('dashboard_service', 'SERVER_URL') + (get_config('dashboard_service', 'API_PROD_VER_ERRORCOL') %(prod))
    return request_get(
                req_url=req_url,
                headers={'Authorization': 'Bearer 3A9A34CF-12CD-4A56-B18D-71D9FD3654BD'},
                version=version,
                pageSize=pageSize,
                page=page
    )

def get_prod_feature_dropbox_ids(prod, feature_id, limit=get_config_int('ticket_service', 'MAX_DROPBOX_LENGTH')):
    req_url = get_config('dashboard_service', 'SERVER_URL') + get_config('dashboard_service', 'API_QUERY_DROPBOX_IDS')
    return request_get(
                req_url=req_url,
                headers={'Authorization': 'Bearer 3A9A34CF-12CD-4A56-B18D-71D9FD3654BD'},
                product=prod,
                errorfeature=feature_id,
                limit=limit
    )

def write_ticket_info(product, feature_id, ticket_id, url):
    req_url = get_config('dashboard_service', 'SERVER_URL') + (get_config('dashboard_service', 'API_TICKET_INFO_SAVE') %(product, feature_id))
    return request_post(
            req_url=req_url,
            headers={'Authorization': 'Bearer 3A9A34CF-12CD-4A56-B18D-71D9FD3654BD', 'Content-Type': 'application/json'},
            data={'ticket':ticket_id, 'url':url}
    )


text:
//---THIS FILE WAS AUTOMATICALLY GENERATED.  DO NOT EDIT---//

//To change this file, alter the niftools/docsys/gen_niflib.py Python script.

#ifndef _NIF_ENUMS_INTL_H_
#define _NIF_ENUMS_INTL_H_

#include <iostream>
using namespace std;

#include "../nif_basic_types.h"

namespace Niflib {

//---ForceType---//

void NifStream( ForceType & val, istream& in, const NifInfo & info = NifInfo() );
void NifStream( ForceType const & val, ostream& out, const NifInfo & info = NifInfo() );

//---EffectShaderControlledColor---//

void NifStream( EffectShaderControlledColor & val, istream& in, const NifInfo & info = NifInfo() );
void NifStream( EffectShaderControlledColor const & val, ostream& out, const NifInfo & info = NifInfo() );

void NifStream( CollisionMode & val, istream& in, const NifInfo & info = NifInfo() );
void NifStream( CollisionMode const & val, ostream& out, const NifInfo & info = NifInfo() );

void NifStream( DeactivatorType & val, istream& in, const NifInfo & info = NifInfo() );
void NifStream( DeactivatorType const & val, ostream& out, const NifInfo & info = NifInfo() );

void NifStream( hkResponseType & val, istream& in, const NifInfo & info = NifInfo() );
void NifStream( hkResponseType const & val, ostream& out, const NifInfo & info = NifInfo() );

//---TexTransform---//

void NifStream( TexTransform & val, istream& in, const NifInfo & info = NifInfo() );
void NifStream( TexTransform const & val, ostream& out, const NifInfo & info = NifInfo() );

//---HavokMaterial---//

void NifStream( HavokMaterial & val, istream& in, const NifInfo & info = NifInfo() );
void NifStream( HavokMaterial const & val, ostream& out, const NifInfo & info = NifInfo() );

//---EmitFrom---//

void NifStream( EmitFrom & val, istream& in, const NifInfo & info = NifInfo() );
void NifStream( EmitFrom const & val, ostream& out, const NifInfo & info = NifInfo() );

void NifStream( EndianType & val, istream& in, const NifInfo & info = NifInfo() );
void NifStream( EndianType const & val, ostream& out, const NifInfo & info = NifInfo() );

//---VelocityType---//

void NifStream( VelocityType & val, istream& in, const NifInfo & info = NifInfo() );
void NifStream( VelocityType const & val, ostream& out, const NifInfo & info = NifInfo() );

//---AnimationType---//

void NifStream( AnimationType & val, istream& in, const NifInfo & info = NifInfo() );
void NifStream( AnimationType const & val, ostream& out, const NifInfo & info = NifInfo() );

//---DataStreamUsage---//

void NifStream( DataStreamUsage & val, istream& in, const NifInfo & info = NifInfo() );
void NifStream( DataStreamUsage const & val, ostream& out, const NifInfo & info = NifInfo() );

//---StencilCompareMode---//

void NifStream( StencilCompareMode & val, istream& in, const NifInfo & info = NifInfo() );
void NifStream( StencilCompareMode const & val, ostream& out, const NifInfo & info = NifInfo() );

//---EffectShaderControlledVariable---//

void NifStream( EffectShaderControlledVariable & val, istream& in, const NifInfo & info = NifInfo() );
void NifStream( EffectShaderControlledVariable const & val, ostream& out, const NifInfo & info = NifInfo() );

//---TexFilterMode---//

void NifStream( TexFilterMode & val, istream& in, const NifInfo & info = NifInfo() );
void NifStream( TexFilterMode const & val, ostream& out, const NifInfo & info = NifInfo() );

//---SymmetryType---//

void NifStream( SymmetryType & val, istream& in, const NifInfo & info = NifInfo() );
void NifStream( SymmetryType const & val, ostream& out, const NifInfo & info = NifInfo() );

//---LightMode---//

void NifStream( LightMode & val, istream& in, const NifInfo & info = NifInfo() );
void NifStream( LightMode const & val, ostream& out, const NifInfo & info = NifInfo() );

//---MipMapFormat---//

void NifStream( MipMapFormat & val, istream& in, const NifInfo & info = NifInfo() );
void NifStream( MipMapFormat const & val, ostream& out, const NifInfo & info = NifInfo() );

//---StencilAction---//

void NifStream( StencilAction & val, istream& in, const NifInfo & info = NifInfo() );
void NifStream( StencilAction const & val, ostream& out, const NifInfo & info = NifInfo() );

//---SyncPoint---//

void NifStream( SyncPoint & val, istream& in, const NifInfo & info = NifInfo() );
void NifStream( SyncPoint const & val, ostream& out, const NifInfo & info = NifInfo() );

//---TexType---//

void NifStream( TexType & val, istream& in, const NifInfo & info = NifInfo() );
void NifStream( TexType const & val, ostream& out, const NifInfo & info = NifInfo() );

//---LightingShaderControlledVariable---//

void NifStream( LightingShaderControlledVariable & val, istream& in, const NifInfo & info = NifInfo() );
void NifStream( LightingShaderControlledVariable const & val, ostream& out, const NifInfo & info = NifInfo() );

//---BSDismemberBodyPartType---//

void NifStream( BSDismemberBodyPartType & val, istream& in, const NifInfo & info = NifInfo() );
void NifStream( BSDismemberBodyPartType const & val, ostream& out, const NifInfo & info = NifInfo() );

//---MoppDataBuildType---//

void NifStream( MoppDataBuildType & val, istream& in, const NifInfo & info = NifInfo() );
void NifStream( MoppDataBuildType const & val, ostream& out, const NifInfo & info = NifInfo() );

void NifStream( ChannelType & val, istream& in, const NifInfo & info = NifInfo() );
void NifStream( ChannelType const & val, ostream& out, const NifInfo & info = NifInfo() );

//---SkyObjectType---//

void NifStream( SkyObjectType & val, istream& in, const NifInfo & info = NifInfo() );
void NifStream( SkyObjectType const & val, ostream& out, const NifInfo & info = NifInfo() );

//---OblivionLayer---//

void NifStream( OblivionLayer & val, istream& in, const NifInfo & info = NifInfo() );
void NifStream( OblivionLayer const & val, ostream& out, const NifInfo & info = NifInfo() );

void NifStream( PSLoopBehavior & val, istream& in, const NifInfo & info = NifInfo() );
void NifStream( PSLoopBehavior const & val, ostream& out, const NifInfo & info = NifInfo() );

//---SolverDeactivation---//

void NifStream( SolverDeactivation & val, istream& in, const NifInfo & info = NifInfo() );
void NifStream( SolverDeactivation const & val, ostream& out, const NifInfo & info = NifInfo() );

//---MeshPrimitiveType---//

void NifStream( MeshPrimitiveType & val, istream& in, const NifInfo & info = NifInfo() );
void NifStream( MeshPrimitiveType const & val, ostream& out, const NifInfo & info = NifInfo() );

//---FaceDrawMode---//

void NifStream( FaceDrawMode & val, istream& in, const NifInfo & info = NifInfo() );
void NifStream( FaceDrawMode const & val, ostream& out, const NifInfo & info = NifInfo() );

//---AlphaFormat---//

void NifStream( AlphaFormat & val, istream& in, const NifInfo & info = NifInfo() );
void NifStream( AlphaFormat const & val, ostream& out, const NifInfo & info = NifInfo() );

void NifStream( BoundVolumeType & val, istream& in, const NifInfo & info = NifInfo() );
void NifStream( BoundVolumeType const & val, ostream& out, const NifInfo & info = NifInfo() );

//---EffectType---//

void NifStream( EffectType & val, istream& in, const NifInfo & info = NifInfo() );
void NifStream( EffectType const & val, ostream& out, const NifInfo & info = NifInfo() );

//---KeyType---//

void NifStream( KeyType & val, istream& in, const NifInfo & info = NifInfo() );
void NifStream( KeyType const & val, ostream& out, const NifInfo & info = NifInfo() );

//---VertMode---//

void NifStream( VertMode & val, istream& in, const NifInfo & info = NifInfo() );
void NifStream( VertMode const & val, ostream& out, const NifInfo & info = NifInfo() );

void NifStream( SortingMode & val, istream& in, const NifInfo & info = NifInfo() );
void NifStream( SortingMode const & val, ostream& out, const NifInfo & info = NifInfo() );

//---CoordGenType---//

void NifStream( CoordGenType & val, istream& in, const NifInfo & info = NifInfo() );
void NifStream( CoordGenType const & val, ostream& out, const NifInfo & info = NifInfo() );

//---BSShaderType---//

void NifStream( BSShaderType & val, istream& in, const NifInfo & info = NifInfo() );
void NifStream( BSShaderType const & val, ostream& out, const NifInfo & info = NifInfo() );

//---ApplyMode---//

void NifStream( ApplyMode & val, istream& in, const NifInfo & info = NifInfo() );
void NifStream( ApplyMode const & val, ostream& out, const NifInfo & info = NifInfo() );

//---MotionSystem---//

void NifStream( MotionSystem & val, istream& in, const NifInfo & info = NifInfo() );
void NifStream( MotionSystem const & val, ostream& out, const NifInfo & info = NifInfo() );

//---BillboardMode---//

void NifStream( BillboardMode & val, istream& in, const NifInfo & info = NifInfo() );
void NifStream( BillboardMode const & val, ostream& out, const NifInfo & info = NifInfo() );

//---ZCompareMode---//

void NifStream( ZCompareMode & val, istream& in, const NifInfo & info = NifInfo() );
void NifStream( ZCompareMode const & val, ostream& out, const NifInfo & info = NifInfo() );

//---TargetColor---//

void NifStream( TargetColor & val, istream& in, const NifInfo & info = NifInfo() );
void NifStream( TargetColor const & val, ostream& out, const NifInfo & info = NifInfo() );

void NifStream( SkyrimHavokMaterial & val, istream& in, const NifInfo & info = NifInfo() );
void NifStream( SkyrimHavokMaterial const & val, ostream& out, const NifInfo & info = NifInfo() );

void NifStream( ChannelConvention & val, istream& in, const NifInfo & info = NifInfo() );
void NifStream( ChannelConvention const & val, ostream& out, const NifInfo & info = NifInfo() );

//---ImageType---//

void NifStream( ImageType & val, istream& in, const NifInfo & info = NifInfo() );
void NifStream( ImageType const & val, ostream& out, const NifInfo & info = NifInfo() );

//---LightingShaderControlledColor---//

void NifStream( LightingShaderControlledColor & val, istream& in, const NifInfo & info = NifInfo() );
void NifStream( LightingShaderControlledColor const & val, ostream& out, const NifInfo & info = NifInfo() );

//---PixelLayout---//

void NifStream( PixelLayout & val, istream& in, const NifInfo & info = NifInfo() );
void NifStream( PixelLayout const & val, ostream& out, const NifInfo & info = NifInfo() );

//---ConsistencyType---//

void NifStream( ConsistencyType & val, istream& in, const NifInfo & info = NifInfo() );
void NifStream( ConsistencyType const & val, ostream& out, const NifInfo & info = NifInfo() );

//---TexClampMode---//

void NifStream( TexClampMode & val, istream& in, const NifInfo & info = NifInfo() );
void NifStream( TexClampMode const & val, ostream& out, const NifInfo & info = NifInfo() );

//---ComponentFormat---//

void NifStream( ComponentFormat & val, istream& in, const NifInfo & info = NifInfo() );
void NifStream( ComponentFormat const & val, ostream& out, const NifInfo & info = NifInfo() );

//---MotionQuality---//

void NifStream( MotionQuality & val, istream& in, const NifInfo & info = NifInfo() );
void NifStream( MotionQuality const & val, ostream& out, const NifInfo & info = NifInfo() );

//---CloningBehavior---//

void NifStream( CloningBehavior & val, istream& in, const NifInfo & info = NifInfo() );
void NifStream( CloningBehavior const & val, ostream& out, const NifInfo & info = NifInfo() );

void NifStream( PropagationMode & val, istream& in, const NifInfo & info = NifInfo() );
void NifStream( PropagationMode const & val, ostream& out, const NifInfo & info = NifInfo() );

//---PixelFormat---//

void NifStream( PixelFormat & val, istream& in, const NifInfo & info = NifInfo() );
void NifStream( PixelFormat const & val, ostream& out, const NifInfo & info = NifInfo() );

//---CycleType---//

void NifStream( CycleType & val, istream& in, const NifInfo & info = NifInfo() );
void NifStream( CycleType const & val, ostream& out, const NifInfo & info = NifInfo() );

//---FieldType---//

void NifStream( FieldType & val, istream& in, const NifInfo & info = NifInfo() );
void NifStream( FieldType const & val, ostream& out, const NifInfo & info = NifInfo() );

//---BSLightingShaderPropertyShaderType---//

void NifStream( BSLightingShaderPropertyShaderType & val, istream& in, const NifInfo & info = NifInfo() );
void NifStream( BSLightingShaderPropertyShaderType const & val, ostream& out, const NifInfo & info = NifInfo() );

//---DecayType---//

void NifStream( DecayType & val, istream& in, const NifInfo & info = NifInfo() );
void NifStream( DecayType const & val, ostream& out, const NifInfo & info = NifInfo() );

//---SkyrimLayer---//

void NifStream( SkyrimLayer & val, istream& in, const NifInfo & info = NifInfo() );
void NifStream( SkyrimLayer const & val, ostream& out, const NifInfo & info = NifInfo() );

//---SkyrimWaterShaderFlags---//

void NifStream( SkyrimWaterShaderFlags & val, istream& in, const NifInfo & info = NifInfo() );
void NifStream( SkyrimWaterShaderFlags const & val, ostream& out, const NifInfo & info = NifInfo() );

//---SkyrimShaderPropertyFlags1---//

void NifStream( SkyrimShaderPropertyFlags1 & val, istream& in, const NifInfo & info = NifInfo() );
void NifStream( SkyrimShaderPropertyFlags1 const & val, ostream& out, const NifInfo & info = NifInfo() );

//---BSShaderFlags---//

void NifStream( BSShaderFlags & val, istream& in, const NifInfo & info = NifInfo() );
void NifStream( BSShaderFlags const & val, ostream& out, const NifInfo & info = NifInfo() );

//---FurnitureEntryPoints---//

void NifStream( FurnitureEntryPoints & val, istream& in, const NifInfo & info = NifInfo() );
void NifStream( FurnitureEntryPoints const & val, ostream& out, const NifInfo & info = NifInfo() );

//---BSPartFlag---//

void NifStream( BSPartFlag & val, istream& in, const NifInfo & info = NifInfo() );
void NifStream( BSPartFlag const & val, ostream& out, const NifInfo & info = NifInfo() );

//---DataStreamAccess---//

void NifStream( DataStreamAccess & val, istream& in, const NifInfo & info = NifInfo() );
void NifStream( DataStreamAccess const & val, ostream& out, const NifInfo & info = NifInfo() );

//---SkyrimShaderPropertyFlags2---//

void NifStream( SkyrimShaderPropertyFlags2 & val, istream& in, const NifInfo & info = NifInfo() );
void NifStream( SkyrimShaderPropertyFlags2 const & val, ostream& out, const NifInfo & info = NifInfo() );

//---BSSegmentFlags---//

void NifStream( BSSegmentFlags & val, istream& in, const NifInfo & info = NifInfo() );
void NifStream( BSSegmentFlags const & val, ostream& out, const NifInfo & info = NifInfo() );

}
#endif


text:
FactoryGirl.define do
  factory :line_item, class: Shopping::LineItem do
    cart
    source factory: :item
    quantity   1
  end
end


text:
export declare class NgCliWebpackConfig {
    ngCliProject: any;
    target: string;
    environment: string;
    config: any;
    constructor(ngCliProject: any, target: string, environment: string, outputDir?: string, baseHref?: string, isAoT?: boolean, sourcemap?: boolean);
    getTargetConfig(projectRoot: string, appConfig: any): any;
}


text:
<?php

namespace Oro\Bundle\EntityConfigBundle\Tests\Unit\Provider;

use Oro\Bundle\EntityConfigBundle\Config\Config;
use Oro\Bundle\EntityConfigBundle\Config\ConfigManager;
use Oro\Bundle\EntityConfigBundle\Config\Id\ConfigIdInterface;
use Oro\Bundle\EntityConfigBundle\Entity\FieldConfigModel;
use Oro\Bundle\EntityConfigBundle\Provider\ConfigProvider;
use Oro\Bundle\EntityConfigBundle\Provider\EntityFieldStateChecker;
use Oro\Bundle\EntityConfigBundle\Provider\PropertyConfigContainer;
use Symfony\Component\Form\FormConfigInterface;
use Symfony\Component\Form\FormFactoryInterface;
use Symfony\Component\Form\FormInterface;

class EntityFieldStateCheckerTest extends \PHPUnit\Framework\TestCase
{
    const SCOPE_EXTEND = 'extend';
    const SCOPE_DATAGRID = 'datagrid';
    const CODE_EXTEND_FIRST = 'code_extend_first';
    const FORM_TYPE_EXTEND = 'form_type_extend';

    /**
     * @var ConfigManager|\PHPUnit\Framework\MockObject\MockObject
     */
    protected $configManager;

    /**
     * @var FormFactoryInterface|\PHPUnit\Framework\MockObject\MockObject
     */
    protected $formFactory;

    /**
     * @var EntityFieldStateChecker
     */
    protected $entityFieldStateChecker;

    protected function setUp()
    {
        $this->configManager = $this->createMock(ConfigManager::class);
        $this->formFactory = $this->createMock(FormFactoryInterface::class);
        $this->entityFieldStateChecker = new EntityFieldStateChecker($this->configManager, $this->formFactory);
    }

    public function testIsSchemaUpdateNeededWhenNoProviders()
    {
        /** @var FieldConfigModel|\PHPUnit\Framework\MockObject\MockObject $fieldConfigModel **/
        $fieldConfigModel = $this->createMock(FieldConfigModel::class);
        $this->configManager
            ->expects($this->once())
            ->method('getProviders')
            ->willReturn([]);

        $this->assertFalse($this->entityFieldStateChecker->isSchemaUpdateNeeded($fieldConfigModel));
    }

    public function testIsSchemaUpdateNeededWhenNoChangeSet()
    {
        /** @var FieldConfigModel|\PHPUnit\Framework\MockObject\MockObject $fieldConfigModel **/
        $fieldConfigModel = $this->createMock(FieldConfigModel::class);

        /** @var PropertyConfigContainer $extendPropertyConfig */
        $extendPropertyConfig = $this->createMock(PropertyConfigContainer::class);

        $this->configManager
            ->expects($this->once())
            ->method('getProviders')
            ->willReturn([$this->configureProvider(self::SCOPE_EXTEND, $extendPropertyConfig)]);

        /** @var ConfigIdInterface $extendConfigId */
        $extendConfigId = $this->createMock(ConfigIdInterface::class);
        $this->configManager
            ->expects($this->once())
            ->method('getConfigIdByModel')
            ->with($fieldConfigModel, self::SCOPE_EXTEND)
            ->willReturn($extendConfigId);

        $newFieldConfig = new Config($extendConfigId, []);
        $this->configManager
            ->expects($this->once())
            ->method('getConfig')
            ->with($extendConfigId)
            ->willReturn($newFieldConfig);

        $oldFieldConfig = new Config($extendConfigId, []);
        $this->configManager
            ->expects($this->once())
            ->method('createFieldConfigByModel')
            ->with($fieldConfigModel, self::SCOPE_EXTEND)
            ->willReturn($oldFieldConfig);

        $this->assertFalse($this->entityFieldStateChecker->isSchemaUpdateNeeded($fieldConfigModel));
    }

    public function testIsSchemaUpdateNeededWhenNoSchemaUpdateRequiredForCode()
    {
        /** @var FieldConfigModel|\PHPUnit\Framework\MockObject\MockObject $fieldConfigModel **/
        $fieldConfigModel = $this->createMock(FieldConfigModel::class);

        /** @var PropertyConfigContainer|\PHPUnit\Framework\MockObject\MockObject $extendPropertyConfig */
        $extendPropertyConfig = $this->createMock(PropertyConfigContainer::class);
        $extendPropertyConfig
            ->expects($this->once())
            ->method('isSchemaUpdateRequired')
            ->with(self::CODE_EXTEND_FIRST, PropertyConfigContainer::TYPE_FIELD)
            ->willReturn(false);

        $this->configManager
            ->expects($this->once())
            ->method('getProviders')
            ->willReturn([$this->configureProvider(self::SCOPE_EXTEND, $extendPropertyConfig)]);

        /** @var ConfigIdInterface $extendConfigId */
        $extendConfigId = $this->createMock(ConfigIdInterface::class);
        $this->configManager
            ->expects($this->once())
            ->method('getConfigIdByModel')
            ->with($fieldConfigModel, self::SCOPE_EXTEND)
            ->willReturn($extendConfigId);

        $oldFieldConfig = new Config($extendConfigId, [self::CODE_EXTEND_FIRST => 1]);
        $this->configManager
            ->expects($this->once())
            ->method('getConfig')
            ->with($extendConfigId)
            ->willReturn($oldFieldConfig);

        $newFieldConfig = new Config($extendConfigId, [self::CODE_EXTEND_FIRST => 2]);
        $this->configManager
            ->expects($this->once())
            ->method('createFieldConfigByModel')
            ->with($fieldConfigModel, self::SCOPE_EXTEND)
            ->willReturn($newFieldConfig);

        $this->assertFalse($this->entityFieldStateChecker->isSchemaUpdateNeeded($fieldConfigModel));
    }

    public function testIsSchemaUpdateNeededWhenNoFormItemsForCode()
    {
        /** @var FieldConfigModel|\PHPUnit\Framework\MockObject\MockObject $fieldConfigModel **/
        $fieldConfigModel = $this->createMock(FieldConfigModel::class);

        /** @var PropertyConfigContainer|\PHPUnit\Framework\MockObject\MockObject $extendPropertyConfig */
        $extendPropertyConfig = $this->createMock(PropertyConfigContainer::class);
        $extendPropertyConfig
            ->expects($this->once())
            ->method('isSchemaUpdateRequired')
            ->with(self::CODE_EXTEND_FIRST, PropertyConfigContainer::TYPE_FIELD)
            ->willReturn(true);

        $extendPropertyConfig
            ->expects($this->once())
            ->method('getFormItems')
            ->with(PropertyConfigContainer::TYPE_FIELD)
            ->willReturn([]);

        $this->configManager
            ->expects($this->once())
            ->method('getProviders')
            ->willReturn([$this->configureProvider(self::SCOPE_EXTEND, $extendPropertyConfig)]);

        /** @var ConfigIdInterface $extendConfigId */
        $extendConfigId = $this->createMock(ConfigIdInterface::class);
        $this->configManager
            ->expects($this->once())
            ->method('getConfigIdByModel')
            ->with($fieldConfigModel, self::SCOPE_EXTEND)
            ->willReturn($extendConfigId);

        $oldFieldConfig = new Config($extendConfigId, [self::CODE_EXTEND_FIRST => 1]);
        $this->configManager
            ->expects($this->once())
            ->method('getConfig')
            ->with($extendConfigId)
            ->willReturn($oldFieldConfig);

        $newFieldConfig = new Config($extendConfigId, [self::CODE_EXTEND_FIRST => 2]);
        $this->configManager
            ->expects($this->once())
            ->method('createFieldConfigByModel')
            ->with($fieldConfigModel, self::SCOPE_EXTEND)
            ->willReturn($newFieldConfig);

        $this->assertFalse($this->entityFieldStateChecker->isSchemaUpdateNeeded($fieldConfigModel));
    }

    public function testIsSchemaUpdateNeededWhenNoUpdateNeededByCallback()
    {
        /** @var FieldConfigModel|\PHPUnit\Framework\MockObject\MockObject $fieldConfigModel **/
        $fieldConfigModel = $this->createMock(FieldConfigModel::class);

        /** @var PropertyConfigContainer|\PHPUnit\Framework\MockObject\MockObject $extendPropertyConfig */
        $extendPropertyConfig = $this->createMock(PropertyConfigContainer::class);
        $extendPropertyConfig
            ->expects($this->once())
            ->method('isSchemaUpdateRequired')
            ->with(self::CODE_EXTEND_FIRST, PropertyConfigContainer::TYPE_FIELD)
            ->willReturn(true);

        $extendPropertyConfig
            ->expects($this->once())
            ->method('getFormItems')
            ->with(PropertyConfigContainer::TYPE_FIELD)
            ->willReturn([self::CODE_EXTEND_FIRST => [
                'form' => [
                    'type' => self::FORM_TYPE_EXTEND,
                    'options' => []
                ]
            ]]);

        $this->configManager
            ->expects($this->once())
            ->method('getProviders')
            ->willReturn([$this->configureProvider(self::SCOPE_EXTEND, $extendPropertyConfig)]);

        /** @var ConfigIdInterface $extendConfigId */
        $extendConfigId = $this->createMock(ConfigIdInterface::class);
        $this->configManager
            ->expects($this->once())
            ->method('getConfigIdByModel')
            ->with($fieldConfigModel, self::SCOPE_EXTEND)
            ->willReturn($extendConfigId);

        $oldFieldConfig = new Config($extendConfigId, [self::CODE_EXTEND_FIRST => 1]);
        $this->configManager
            ->expects($this->once())
            ->method('getConfig')
            ->with($extendConfigId)
            ->willReturn($oldFieldConfig);

        $newFieldConfig = new Config($extendConfigId, [self::CODE_EXTEND_FIRST => 2]);
        $this->configManager
            ->expects($this->once())
            ->method('createFieldConfigByModel')
            ->with($fieldConfigModel, self::SCOPE_EXTEND)
            ->willReturn($newFieldConfig);

        $formConfig = $this->createMock(FormConfigInterface::class);
        $formConfig
            ->expects($this->once())
            ->method('getOption')
            ->with('schema_update_required')
            ->willReturn(function () {
                return false;
            });

        $form = $this->createMock(FormInterface::class);
        $form
            ->expects($this->once())
            ->method('getConfig')
            ->willReturn($formConfig);

        $this->formFactory
            ->expects($this->once())
            ->method('create')
            ->with(self::FORM_TYPE_EXTEND, null, ['config_id' => $extendConfigId])
            ->willReturn($form);

        $this->assertFalse($this->entityFieldStateChecker->isSchemaUpdateNeeded($fieldConfigModel));
    }

    public function testIsSchemaUpdate()
    {
        /** @var FieldConfigModel|\PHPUnit\Framework\MockObject\MockObject $fieldConfigModel **/
        $fieldConfigModel = $this->createMock(FieldConfigModel::class);

        /** @var PropertyConfigContainer|\PHPUnit\Framework\MockObject\MockObject $extendPropertyConfig */
        $extendPropertyConfig = $this->createMock(PropertyConfigContainer::class);
        $extendPropertyConfig
            ->expects($this->once())
            ->method('isSchemaUpdateRequired')
            ->with(self::CODE_EXTEND_FIRST, PropertyConfigContainer::TYPE_FIELD)
            ->willReturn(true);

        $extendPropertyConfig
            ->expects($this->once())
            ->method('getFormItems')
            ->with(PropertyConfigContainer::TYPE_FIELD)
            ->willReturn([self::CODE_EXTEND_FIRST => [
                'form' => [
                    'type' => self::FORM_TYPE_EXTEND,
                    'options' => []
                ]
            ]]);

        $this->configManager
            ->expects($this->once())
            ->method('getProviders')
            ->willReturn([$this->configureProvider(self::SCOPE_EXTEND, $extendPropertyConfig)]);

        /** @var ConfigIdInterface $extendConfigId */
        $extendConfigId = $this->createMock(ConfigIdInterface::class);
        $this->configManager
            ->expects($this->once())
            ->method('getConfigIdByModel')
            ->with($fieldConfigModel, self::SCOPE_EXTEND)
            ->willReturn($extendConfigId);

        $oldFieldConfig = new Config($extendConfigId, [self::CODE_EXTEND_FIRST => 1]);
        $this->configManager
            ->expects($this->once())
            ->method('getConfig')
            ->with($extendConfigId)
            ->willReturn($oldFieldConfig);

        $newFieldConfig = new Config($extendConfigId, [self::CODE_EXTEND_FIRST => 2]);
        $this->configManager
            ->expects($this->once())
            ->method('createFieldConfigByModel')
            ->with($fieldConfigModel, self::SCOPE_EXTEND)
            ->willReturn($newFieldConfig);

        $formConfig = $this->createMock(FormConfigInterface::class);
        $formConfig
            ->expects($this->once())
            ->method('getOption')
            ->with('schema_update_required')
            ->willReturn(function () {
                return true;
            });

        $form = $this->createMock(FormInterface::class);
        $form
            ->expects($this->once())
            ->method('getConfig')
            ->willReturn($formConfig);

        $this->formFactory
            ->expects($this->once())
            ->method('create')
            ->with(self::FORM_TYPE_EXTEND, null, ['config_id' => $extendConfigId])
            ->willReturn($form);

        $this->assertTrue($this->entityFieldStateChecker->isSchemaUpdateNeeded($fieldConfigModel));
    }

    /**
     * @param $scope
     * @param PropertyConfigContainer $propertyConfig
     * @return \PHPUnit\Framework\MockObject\MockObject|ConfigProvider
     */
    private function configureProvider($scope, PropertyConfigContainer $propertyConfig)
    {
        $provider = $this->createMock(ConfigProvider::class);
        $provider
            ->expects($this->any())
            ->method('getScope')
            ->willReturn($scope);

        $provider
            ->expects($this->any())
            ->method('getPropertyConfig')
            ->willReturn($propertyConfig);

        return $provider;
    }
}


text:
package com.github.ldaniels528.trifecta.messages.query

/**
 * Represents an Input/Output source
 * @author lawrence.daniels@gmail.com
 */
case class IOSource(deviceURL: String, decoderURL: Option[String]) {

  override def toString = s"$deviceURL${decoderURL.map(url => s" with $url" ) getOrElse ""}"

}


text:
========
Endymion
========

Endymion is a command-line tool that checks if the specified Vagrant
boxes can be downloaded from Hashicorp's Atlas_. In the case of the
official `CentOS Linux images for Vagrant`_, it will also check if the
images correspond to the version listed on Atlas.

.. _Atlas: https://atlas.hashicorp.com
.. _CentOS Linux images for Vagrant: https://atlas.hashicorp.com/centos/

Installation
============

Endymion doesn't have any external dependencies outside of the Python
standard library, so it shouldn't pose any problems to install it
directly. You can also install it in a virtualenv if you prefer.

If you only plan to use Endymion, the simplest way is to install it
from PyPI::

        $ pip install endymion

Developers can also run the development version::

        $ git clone https://github.com/lpancescu/endymion.git
        $ git checkout python3 # only if you use Python 3.x
        $ pip install -e .

Usage
=====

Checking links
--------------

By default, ``endymion`` checks the latest version of the boxes
provided as arguments, displaying any errors::

        $ endymion centos/6 centos/7

Use ``-v`` to see more details (``-vv`` to also show the redirects)::

        $ endymion -v centos/6
        INFO:root:http://cloud.centos.org/centos/6/vagrant/x86_64/images/CentOS-6-x86_64-Vagrant-1611_01.Libvirt.box: OK
        INFO:root:http://cloud.centos.org/centos/6/vagrant/x86_64/images/CentOS-6-x86_64-Vagrant-1611_01.VirtualBox.box: OK
        INFO:root:http://cloud.centos.org/centos/6/vagrant/x86_64/images/CentOS-6-x86_64-Vagrant-1611_01.VMwareFusion.box: OK
        INFO:root:http://cloud.centos.org/centos/6/vagrant/x86_64/images/CentOS-6-x86_64-Vagrant-1611_01.VMwareFusion.box: OK

If you want to check all versions available on Atlas, use ``--all``
(not recommended for day-to-day use because of the large number of
requests to Atlas, for boxes with many versions).

The return code will be 0 if no errors were found, and non-zero
otherwise.

Exporting Atlas data as JSON
----------------------------

If you would like to export the existing metadata from Atlas, use the
``--export`` option.  Endymion expects to find the SHA256 checksum
files in the same directory, named after the corresponding image
(e.g. *centos_7.sha256sum.txt* for *centos/7*); since Atlas typically
has no checksum information in the metadata, the checksums will be
read from these external files and inserted in the generated JSON
metadata.

        $ endymion --export centos/6 centos/7

Limitations
===========

* ``endymion`` uses the ``HEAD`` method of HTTP 1.1 to check the
  availability of the boxes without downloading them. This usually
  works with external boxes like the ones provided by CentOS or
  Fedora, but it will fail with ``405 Method Not Allowed`` for boxes
  hosted by Hashicorp; using ``GET`` with a ``Content-range`` header
  produces the same response.
* The CentOS project provides GnuPG-signed SHA256 checksums, but
  ``endymion`` doesn't try to validate them (this would require
  downloading each variant of a box)

Supported Python versions
=========================

Both Python 2.7 and Python 3.x are supported, although they have
different codebases:

* The ``master`` branch contains the Python 2.7 source code
* The ``python3`` branch, unsurprisingly, only runs under Python 3.x
  (instead of unifying the two code bases, I decided to convert the
  Python 2.7 code to Python 3, to avoid needlessly complicating the
  code to support both versions in the long term; if CentOS Linux 8
  will default to Python 3, I can just move the Python 3 code to
  ``master``).

If you are a regular user, this doesn't matter: ``pip install
endymion`` will always install the right package for your Python
version.


text:
title: "2016-08-30のJS: pixi.js 4.0.0、Babel 6.14.0、JSフレームワークアンケート"
author: azu
layout: post
date : 2016-08-30T09:40
category: JSer
tags:
    - Canvas
    - WebGL
    - game
    - Babel
    - framwork
    - survery

---

JSer.info #294 - WebGLやCanvasを使った2Dレンダリングエンジンのpixi.js 4.0.0がリリースされました。

- [Release v4.0.0 · pixijs/pixi.js](https://github.com/pixijs/pixi.js/releases/tag/v4.0.0 "Release v4.0.0 · pixijs/pixi.js")

[RCリリース時の記事](http://www.goodboydigital.com/pixi-js-v4/)でも紹介されていますが、
Multi texture rendereringのサポート、GPU GC管理、WebGLレンダーの改善などが行われています。
また、コア部分が[pixi-gl-core](https://github.com/pixijs/pixi-gl-core "pixi-gl-core")として公開されたり、
npm周りの整備がされています。

移行ガイドラインについてはまだありませんが、ドキュメントが予定されています。

- [Migration guide v3->v4 · Issue #2867 · pixijs/pixi.js](https://github.com/pixijs/pixi.js/issues/2867 "Migration guide v3->v4 · Issue #2867 · pixijs/pixi.js")

バグ修正も行われていますが4.0になって増えたバグもあるので、それらの修正を含めた4.1のリリースが予定されています。

- [Issues · pixijs/pixi.js](https://github.com/pixijs/pixi.js/issues?q=is%3Aopen+is%3Aissue+milestone%3Av4.1 "Issues · pixijs/pixi.js")

----

Babel [6.14.0](https://github.com/babel/babel/releases/tag/v6.14.0 "6.14.0")がリリースされました。

- [6.14.0 Released · Babel](http://babeljs.io/blog/2016/08/24/6.14.0 "6.14.0 Released · Babel")

新しく `latest` と `es2017` のpresetが追加されています。
`latest` presetはES2015+ (ES2015, ES2016, ES2017)のものが含まれていて、ECMAScriptの新しいバージョンが追加されている方式となっています。

----

[The State Of JavaScript: Front-End Frameworks – Medium](https://medium.com/@sachagreif/the-state-of-javascript-front-end-frameworks-1a2d8a61510 "The State Of JavaScript: Front-End Frameworks – Medium")という記事ではJavaScriptのフレームワークについてのアンケート結果が公開されています。
[The State Of JavaScript](http://stateofjs.com/ "The State Of JavaScript")にて行われたもので、著名なフレームワーク/ライブラリごとに興味や満足度について調べたものです。

対象となっていたフレームワーク/ライブラリは次の6つとなっています。

- React
- Angular
- Angular 2
- Ember
- Vue
- Backbone

この記事ではそのアンケート結果が公開されています。

候補となったものでVue以外は殆どの人が知っていて、

- 学びたいもの: React -> Vue -> Angular2
- 満足度: React -> Vue -> Angular2

という結果になっています。

詳しくは、[The State Of JavaScript: Front-End Frameworks – Medium](https://medium.com/@sachagreif/the-state-of-javascript-front-end-frameworks-1a2d8a61510 "The State Of JavaScript: Front-End Frameworks – Medium")を参照してください。

----

ヘッドライン

----

## Release v4.0.0 · pixijs/pixi.js
[github.com/pixijs/pixi.js/releases/tag/v4.0.0](https://github.com/pixijs/pixi.js/releases/tag/v4.0.0 "Release v4.0.0 · pixijs/pixi.js")

JavaScript WebGL library ReleaseNote

pixi.js 4.0.0リリース
Multi texture rendereringのサポート、GPU GC管理、WebGLレンダーの改善、npmでパッケージの公開など

- [PixiJS v4 Arrives - Goodboy™ — Goodboy™](http://www.goodboydigital.com/pixi-js-v4/ "PixiJS v4 Arrives - Goodboy™ — Goodboy™")

----

## Release v6.14.0 · babel/babel
[github.com/babel/babel/releases/tag/v6.14.0](https://github.com/babel/babel/releases/tag/v6.14.0 "Release v6.14.0 · babel/babel")

babel ReleaseNote

Babel 6.14.0リリース。
`es2017` presetと、ES2015+を扱う`latest` presetが追加された。

----

アーティクル

----

## The State Of JavaScript: Front-End Frameworks – Medium
[medium.com/@sachagreif/the-state-of-javascript-front-end-frameworks-1a2d8a61510](https://medium.com/@sachagreif/the-state-of-javascript-front-end-frameworks-1a2d8a61510 "The State Of JavaScript: Front-End Frameworks – Medium")

JavaScript library

JavaScriptのフレームワークについてアンケート結果。
認知度はVue以外大体同じ。
学びたいもの: React -> Vue -> Angular2
満足度: React -> Vue -> Angular2

- [The State Of JavaScript](http://stateofjs.com/ "The State Of JavaScript")

----

## Enable Chrome Accessibility Experiment
[gist.github.com/marcysutton/0a42f815878c159517a55e6652e3b23a](https://gist.github.com/marcysutton/0a42f815878c159517a55e6652e3b23a "Enable Chrome Accessibility Experiment")

Chrome accessibility debug

Chromeの試験的なAccessibility inspectorを有効にする方法。
要素に対するWAI-ARIAの情報をElementsパネルで見ることができる

----

## Demythstifying Web Components – Back Alley Coder
[www.backalleycoder.com/2016/08/26/demythstifying-web-components/](http://www.backalleycoder.com/2016/08/26/demythstifying-web-components/ "Demythstifying Web Components – Back Alley Coder")

WebComponents

Web Componentsに関するよくある誤解について書かれたもの

----

## How To Use WebPageTest and its API | CSS-Tricks
[css-tricks.com/use-webpagetest-api/](https://css-tricks.com/use-webpagetest-api/ "How To Use WebPageTest and its API | CSS-Tricks")

web  performance API

WebPageTest APIを使ったメトリクスについて

----

## Three Ways to Test Angular 2 Components – Angular 2
[vsavkin.com/three-ways-to-test-angular-2-components-dcea8e90bd8d](https://vsavkin.com/three-ways-to-test-angular-2-components-dcea8e90bd8d "Three Ways to Test Angular 2 Components – Angular 2")

AngularJS testing

AngularJS 2のコンポーネントをテストする方法について

----

## You SHOULD Learn Vanilla JavaScript Before JS Frameworks - Snipcart
[snipcart.com/blog/learn-vanilla-javascript-before-using-js-frameworks](https://snipcart.com/blog/learn-vanilla-javascript-before-using-js-frameworks "You SHOULD Learn Vanilla JavaScript Before JS Frameworks - Snipcart")

JavaScript library thought

フレームワークを学ぶ前にJavaScriptを学ぼうという話

----

## jsdoc-to-assert を試す – アカベコマイリ
[akabeko.me/blog/2016/08/jsdoc-to-assert/](http://akabeko.me/blog/2016/08/jsdoc-to-assert/ "jsdoc-to-assert を試す – アカベコマイリ")

JavaScript testing

jsdoc-to-assertでのランタイムassertの導入について

----

## 型定義ベースのアサーションライブラリ types-assert を書いた - Qiita
[qiita.com/KeitaMoromizato/items/e49185a0cd03c6cb8b3a](http://qiita.com/KeitaMoromizato/items/e49185a0cd03c6cb8b3a "型定義ベースのアサーションライブラリ types-assert を書いた - Qiita")

JavaScript TypeScript

TypeScriptの型定義ファイルを使ったassertionライブラリ

- [KeitaMoromizato/types-assert: type-assert is dynamic type assertion library](https://github.com/KeitaMoromizato/types-assert "KeitaMoromizato/types-assert: type-assert is dynamic type assertion library")

----

スライド、動画関係

----

## From MVC to Flux - JS Monthly London - YouTube
[www.youtube.com/watch?v=p8tqhf5qKOI](https://www.youtube.com/watch?v=p8tqhf5qKOI "From MVC to Flux - JS Monthly London - YouTube")

JavaScript Flux

改めてFluxとはどういうコンセプトなのか、同様のコアコンセプトを持つReduxについての紹介

- [From MVC to Flux - Pusher Blog](https://blog.pusher.com/from-mvc-to-flux/ "From MVC to Flux - Pusher Blog")

----

## thejameskyle/itsy-bitsy-data-structures: All the things you didn't know you wanted to know about data structures
[github.com/thejameskyle/itsy-bitsy-data-structures](https://github.com/thejameskyle/itsy-bitsy-data-structures "thejameskyle/itsy-bitsy-data-structures: All the things you didn't know you wanted to know about data structures")

JavaScript アルゴリズム document

JavaScriptでリスト、ハッシュテーブル、スタックなどのデータ構造についての実装と解説リポジトリ。
それぞれの探索のコストや特徴などの解説がコメントに書かれている

- [React Rally Day 2 - YouTube](https://www.youtube.com/watch?v=nI0cQ-2YR1I "React Rally Day 2 - YouTube")

----

サイト、サービス、ドキュメント

----

## SAM - State | Action | Model
[sam.js.org/](http://sam.js.org/ "SAM - State | Action | Model")

JavaScript 設計 デザインパターン

SAM (State-Action-Model)についてのドキュメントサイト

----

ソフトウェア、ツール、ライブラリ関係

----

## babel/babel-minify: Babel preset for minification (Alpha)
[github.com/babel/babel-minify](https://github.com/babel/babel-minify "babel/babel-minify: Babel preset for minification (Alpha)")

babel plugin

Babelのminify plugin preset

----

## google/closure-compiler-js: Package for the JS version of closure-compiler for use via npm
[github.com/google/closure-compiler-js](https://github.com/google/closure-compiler-js "google/closure-compiler-js: Package for the JS version of closure-compiler for use via npm")

JavaScript Tools

Closure Compilerの一部機能を使えるツール。JavaScriptへのコンパイル済みファイルを含んでいるので、Javaを必要としない。

----

## reactjs/react-docgen: A CLI and toolbox to extract information from React component files for documentation generation purposes.
[github.com/reactjs/react-docgen](https://github.com/reactjs/react-docgen "reactjs/react-docgen: A CLI and toolbox to extract information from React component files for documentation generation purposes.")

React document Tools

ReactのpropTypesなどをパースしてASTとして取得できるライブラリ/CLI

----

## pakastin/redom: Tiny DOM library
[github.com/pakastin/redom](https://github.com/pakastin/redom "pakastin/redom: Tiny DOM library")

JavaScript DOM library

DOM APIを使った小さなコンポーネントライブラリ

----

## nolanlawson/slow-deps: 🐌 Measure which dependencies in a project are slowest to npm install
[github.com/nolanlawson/slow-deps](https://github.com/nolanlawson/slow-deps "nolanlawson/slow-deps: 🐌 Measure which dependencies in a project are slowest to npm install")

npm Tools

npmの依存モジュールがそれぞれどれくらいのインストール時間やサイズなのかを計測出来るツール

----

書籍関係

----

## Fluent JavaScript | PACKT Books
[www.packtpub.com/web-development/fluent-javascript](https://www.packtpub.com/web-development/fluent-javascript "Fluent JavaScript | PACKT Books")

JavaScript book

2017年4月6日発売

- [Amazon | Fluent JavaScript \[Kindle edition\] by Callum Rimmer, Lucian Lature | Languages &amp; Tools | Kindleストア](https://www.amazon.co.jp/dp/B01F7HCB0C/ "Amazon | Fluent JavaScript \[Kindle edition\] by Callum Rimmer, Lucian Lature | Languages &amp; Tools | Kindleストア")

----


text:
#pragma once

#include "replication_common.h"
#include <set>

using namespace dsn;
using namespace dsn::service;
using namespace dsn::replication;

namespace dsn {
    namespace replication{
        class replication_checker;
    }
}

typedef std::list<std::pair<::dsn::rpc_address, bool>> node_states;

struct app_state
{
    std::string                          app_type;
    std::string                          app_name;
    int32_t                              app_id;
    int32_t                              partition_count;
    std::vector<partition_configuration> partitions;
};

typedef std::unordered_map<global_partition_id, std::shared_ptr<configuration_update_request> > machine_fail_updates;

class server_state
{
public:
    server_state(void);
    ~server_state(void);

    void init_app();

    void get_node_state(/*out*/ node_states& nodes);
    void set_node_state(const node_states& nodes, /*out*/ machine_fail_updates* pris);
    bool get_meta_server_primary(/*out*/ ::dsn::rpc_address& node);

    void add_meta_node(const ::dsn::rpc_address& node);
    void remove_meta_node(const ::dsn::rpc_address& node);
    void switch_meta_primary();

    void load(const char* chk_point);
    void save(const char* chk_point);

    // partition server & client => meta server
    void query_configuration_by_node(configuration_query_by_node_request& request, /*out*/ configuration_query_by_node_response& response);
    void query_configuration_by_index(configuration_query_by_index_request& request, /*out*/ configuration_query_by_index_response& response);
    void query_configuration_by_gpid(global_partition_id id, /*out*/ partition_configuration& config);
    void update_configuration(configuration_update_request& request, /*out*/ configuration_update_response& response);
    void unfree_if_possible_on_start();
    bool freezed() const { return _freeze.load(); }

private:
    void check_consistency(global_partition_id gpid);
    void update_configuration_internal(configuration_update_request& request, /*out*/ configuration_update_response& response);

private:
    friend class ::dsn::replication::replication_checker;

    struct node_state
    {
        bool                          is_alive;
        ::dsn::rpc_address            address;
        std::set<global_partition_id> primaries;
        std::set<global_partition_id> partitions;
    };

    mutable zrwlock_nr                                 _lock;
    std::unordered_map<::dsn::rpc_address, node_state> _nodes;
    std::vector<app_state>                             _apps;

    int                               _node_live_count;
    int                               _node_live_percentage_threshold_for_update;
    std::atomic<bool>                 _freeze;

    mutable zrwlock_nr                _meta_lock;
    std::vector<::dsn::rpc_address>   _meta_servers;
    int                               _leader_index;

    friend class load_balancer;
};


text:
#include "console_width.h"

// Acknowledgement: These functions are more or less copy paste from
// stack-overflow answers:
// http://stackoverflow.com/questions/8627327/how-to-get-number-of-characters-in-line-in-console-that-my-process-is-bind-to
// http://stackoverflow.com/questions/6657048/how-can-i-find-the-number-of-terminal-columns-from-a-c-c-program

#ifndef _MSVC

#include <sys/ioctl.h>

int get_console_width()
{
    struct winsize w;
    if (ioctl(0, TIOCGWINSZ, &w)) {
        return 0;
    }

    return w.ws_col;
}

#else

#include <windows.h>

int get_console_width()
{
    CONSOLE_SCREEN_BUFFER_INFO csbi;
    if(!GetConsoleScreenBufferInfo(GetStdHandle(STD_OUTPUT_HANDLE), &csbi)) {
        return 0; // If not possible to get, return null and let application
        // deal with it.
    }
    else {
        return csbi.srWindow.Right-csbi.srWindow.Left;
    }
}

#endif


text:
import { DocumentAdd16 } from "../../";

export = DocumentAdd16;


text:
"use strict";
var accordion_component_1 = require('./accordion/accordion.component');
var accordion_group_component_1 = require('./accordion/accordion-group.component');
var accordion_component_2 = require('./accordion/accordion.component');
exports.Accordion = accordion_component_2.Accordion;
var accordion_group_component_2 = require('./accordion/accordion-group.component');
exports.AccordionPanel = accordion_group_component_2.AccordionPanel;
exports.ACCORDION_DIRECTIVES = [accordion_component_1.Accordion, accordion_group_component_1.AccordionPanel];


text:
- Search before filing an issue or pull request
- Feel free to take a try at [FUTURE.md](FUTURE.md)
- Contributions should follow our [git branching model](https://github.com/AltusAero/git-branching-model)
- Create tests for new features.
  - If you need help we can work through this during the PR process, but it will take additional time.
- When it comes to performance vs readability the following order is preferred:
  - performance gains in an order of magnitude
  - code readability (including modern syntax)
- Run tests before making proposed changes (we use [pre-commit](https://www.npmjs.com/package/pre-commit) to automate this step)
- Update [CHANGELOG.md](CHANGELOG.md)
  - no need to worry about the version header (1.0.0, 1.2.1, etc.) as this will be determined after collectively reviewing all of the pending commits to master
- Add yourself to the contributors section in the `package.json`, if you'd like.
- You must agree to the [Developer's Certificate of Origin](http://developercertificate.org) (found below).

## Style Guide

JavaScript: [JavaScript Standard Style](http://standardjs.com)

## Code of Conduct

Just be cool. See [CODE_OF_CONDUCT.md](CODE_OF_CONDUCT.md) on what we think this means.

## Developer's Certificate of Origin

```text
Developer's Certificate of Origin 1.1

By making a contribution to this project, I certify that:

(a) The contribution was created in whole or in part by me and I
    have the right to submit it under the open source license
    indicated in the file; or

(b) The contribution is based upon previous work that, to the best
    of my knowledge, is covered under an appropriate open source
    license and I have the right under that license to submit that
    work with modifications, whether created in whole or in part
    by me, under the same open source license (unless I am
    permitted to submit under a different license), as indicated
    in the file; or

(c) The contribution was provided directly to me by some other
    person who certified (a), (b) or (c) and I have not modified
    it.

(d) I understand and agree that this project and the contribution
    are public and that a record of the contribution (including all
    personal information I submit with it, including my sign-off) is
    maintained indefinitely and may be redistributed consistent with
    this project or the open source license(s) involved.
```