text:
package com.google.javascript.jscomp.lint;

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

import com.google.common.collect.ImmutableMap;
import com.google.javascript.jscomp.AbstractCompiler;
import com.google.javascript.jscomp.CompilerPass;
import com.google.javascript.jscomp.DiagnosticType;
import com.google.javascript.jscomp.NodeTraversal;
import com.google.javascript.rhino.Node;
import com.google.javascript.rhino.jstype.JSType;

/**
 * Checks if code has a module-level static property assignment (`X.Y`) inside a `goog.module`. If
 * yes, reports a linter warning on the `X.Y` if:
 *
 *

 *
X is any name {object, class, function, interface, enum, typedef}.
 *
Y is {class, interface, enum, typedef}
 *

 *
 *
For example, reports a linter finding in the following:
 *
 *
{ @code
 *
 * class C {}
 * let obj = {...};
 *
 * /**
 * * Reports nested name E on class C.
 * * @enum {number}
 * * /
 * C.E={...}; // WARNING:
 *
 * /**
 * * Reports nested interface I on variable obj.
 * * @interface
 * * /
 * obj.I=class {}; // WARNING:
 *
 * // reports nested name D on class C.
 * C.D=class {};
 * }
 *

 *
 *
{@code
 * // Does not report on nested functions, or any nested property assigned to a value.
 * C.F = function() {}
 * obj.S = '';
 * obj.Some = new Something();
 * }

 */
public final class CheckNestedNames implements CompilerPass, NodeTraversal.Callback {

  public static final DiagnosticType NESTED_NAME_IN_GOOG_MODULE =
      DiagnosticType.disabled(
          "JSC_NESTED_NAME_IN_GOOG_MODULE",
          "A nested {0} is created on the name `{1}`."
              + " Fix this linter finding by converting the module-level static property"
              + " assignment on `{1}` into a module-level flat name (i.e. change `{1}.prop = ...`"
              + " into `{1}_prop = ...`. You can (if required) export this flat name using named"
              + " exports (`exports.{1}_prop = {1}_prop`)."
          );

  private final AbstractCompiler compiler;

  private enum DeclarationKind {
    CLASS,
    ENUM,
    TYPEDEF,
    INTERFACE,
  }

  private static final ImmutableMap<DeclarationKind, String> NESTED_KIND_TO_REPORT =
      ImmutableMap.of(
          DeclarationKind.CLASS, "class",
          DeclarationKind.ENUM, "enum",
          DeclarationKind.INTERFACE, "interface",
          DeclarationKind.TYPEDEF, "typedef");

  public CheckNestedNames(AbstractCompiler compiler) {
    this.compiler = compiler;
  }

  @Override
  public void process(Node externs, Node root) {
    NodeTraversal.traverse(compiler, root, this);
  }

  @Override
  public final boolean shouldTraverse(NodeTraversal nodeTraversal, Node n, Node parent) {
    if (n.isScript()) {
      // only traverse inside goog.modules
      return n.getBooleanProp(Node.GOOG_MODULE);
    }
    // only warn on static property assignments of module-level names
    return nodeTraversal.inGlobalOrModuleScope();
  }

  @Override
  public void visit(NodeTraversal t, Node n, Node parent) {
    checkArgument(t.inGlobalOrModuleScope());
    if (!n.isGetProp() || !n.isQualifiedName()) {
      return;
    }
    Node targetGetProp = getTargetGetProp(n);
    if ((parent.isAssign() || parent.isExprResult())
        && n.isFirstChildOf(parent)
        && !isDotPrototype(targetGetProp)) {
      Node owner = targetGetProp.getFirstChild();
      if (!owner.isName() || owner.getString().equals("exports")) {
        return; //  For example `this` or `super` or `exports.SomeEnum = {}`
      }
      String ownerName = owner.getString();
      DeclarationKind declarationKind = getNestedDeclarationKind(n, parent);
      if (NESTED_KIND_TO_REPORT.containsKey(declarationKind)) {
        // Found a nested name that created an inner class, interface, typedef or enum.
        String nestedKind = NESTED_KIND_TO_REPORT.get(declarationKind);
        t.report(targetGetProp, NESTED_NAME_IN_GOOG_MODULE, nestedKind, ownerName);
      }
    }
  }

  /** Gives `a.b` from `a.b.c.d...`. */
  private static Node getTargetGetProp(Node n) {
    checkArgument(n.isGetProp(), n);
    if (n.getFirstChild().isGetProp()) {
      return getTargetGetProp(n.getFirstChild());
    }
    return n;
  }

  /** True for `someExpression.prototype`. */
  private static boolean isDotPrototype(Node getProp) {
    return getProp.isGetProp() && getProp.getString().equals("prototype");
  }

  private DeclarationKind getNestedDeclarationKind(Node lhs, Node parent) {
    checkArgument(lhs.isFirstChildOf(parent), lhs);
    // Handle `/** @typedef {...} */` X.Y` or `/** @const */ X.Y = SomeTypeDefName`
    if (lhs.getTypedefTypeProp() != null) {
      return DeclarationKind.TYPEDEF;
    }

    JSType type = lhs.getJSType();
    if (type != null) {
      // check whether it's an enum, interface or typedef first.
      if (type.isEnumType()) {
        return DeclarationKind.ENUM;
      } else if (type.isInterface()) {
        return DeclarationKind.INTERFACE;
      } else if (type.isConstructor()) {
        return DeclarationKind.CLASS;
      }
    }

    return null;
  }
}


text:
function val = response2mat(obj,y)
%response2mat  Converts a non-numeric model response to a numeric array
%
%   val = response(Y) converts the cell array of response Y to a numeric array
%   using the "catNames" property

% Do nothing for numeric arrays
val = y;
if isnumeric(y)
    return
end

% Loop through all of the category names
for cIdx = 1:obj.k
    [val{strcmpi(obj.catNames{cIdx},val)}] = deal(cIdx);
end

% Convert the cell containing numbers to an array
val = cell2mat(val);

redpajama_set_name: RedPajamaGithub


text:
"""
URL routes declarations.

All views are currently declared here.

"""
import os

from flask import render_template
import gevent

from birdwtch import app, make_json_error, config, publish, sockets
from cloudly import logger

log = logger.init(__name__)

@app.errorhandler(Exception)
def error_handler(error):
    return make_json_error(error)

@app.route('/')
def index():
    """A map with real-time tweets shown.
    Configuration options are set here and available to the client via the
    global variable `appConfig`, see templates/base.html.
    """
    webapp_config = {
        'tweet_channel': config.tweet_channel,
        'metadata_channel': config.metadata_channel,
    }
    return render_template('index.html', config=webapp_config)

@sockets.route('/tweets')
def tweets(websocket):
    channel = config.tweet_channel
    log.debug("Registering new websocket client for channel '{}'".format(
        channel))
    publish.subscribe(websocket, channel)
    publish.start()

    while websocket.socket is not None:
        # Context switch while `publish.start` is running in the
        # background.
        gevent.sleep()

    log.debug("Connection closed.")

@sockets.route('/metadata')
def metadata(websocket):
    channel = config.metadata_channel
    log.debug("Registering new websocket client for channel '{}'".format(
        channel))
    publish.subscribe(websocket, channel)
    publish.start()

    while websocket.socket is not None:
        # Context switch while `publish.start` is running in the
        # background.
        gevent.sleep()

    log.debug("Connection closed.")

def in_production():
    return os.environ.get("IS_PRODUCTION", "").lower() in ['true', 'yes']


text:
;
import Promise = require('bluebird')
import assert = require('assert')
import { __assign as assign } from 'tslib'
import { WriteOpts, ReadOpts, DocId, DocRef, DocRevs, DocIdRange } from './'
import { isObject, isFunction, isString } from './utils'

/**
 * @public
 * @factory CoreDbIoFactory
 * @param {CoreDbIoSpec} spec
 * @return {CoreDbIo}
 */
export interface CoreDbIoFactory {
  (spec: CoreDbIoSpec): CoreDbIo
}

/**
 * @public
 * @interface CoreDbIoSpec
 */
export interface CoreDbIoSpec {
  /**
   * @public
   * @prop {PouchDB} db
   */
  db: any
  /**
   * @public
   * @prop {'write'|'read'} type of the CoreDbIo instance
   */
  type: 'write'|'read'
  /**
   * @public
   * @prop {WriteOpts|ReadOpts} opts
   */
  opts: WriteOpts|ReadOpts
}

/**
 * @public
 * @interface CoreDbIo
 * a pair of factories that wrap a {PouchDb} instance
 * and return corresponding unit or bulk IO access methods
 * which return a Promise of the result of the IO access operation.
 * both factories return an IO access method of the same access type:
 * write or read.
 */
export interface CoreDbIo {
  /**
   * @public
   * @method access
   * unit or bulk access to the wrapped db.
   * @param {DocRef[]|DocIdRange|DocRevs|DocRef} src
   * @return {Promise<DocRef[]|DocRef>}
   */
  access (src: DocRef[]|DocIdRange|DocRevs|DocRef): Promise<DocRef[]|DocRef>
}

/**
 * @public
 * @function CoreDbIoDuckTypable
 * duck-type validation: checks for `unit` and `bulk` methods.
 * @prop {any} val?
 * @return {val is CoreDbIo}
 */
export interface CoreDbIoDuckTypable {
  (val?: any): val is CoreDbIo
}

/**
 * @private
 */
abstract class CoreDbIoClass implements CoreDbIo {
  static get factories () {
    return {
      write: CoreDbWriteClass.newInstance,
      read: CoreDbReadClass.newInstance
    }
  }
  static newInstance = <CoreDbIoFactory> function (spec: CoreDbIoSpec): CoreDbIo {
    assert(isPouchDbLike(spec.db), 'invalid PouchDB instance')
    const newInstance =  CoreDbIoClass.factories[spec.type]
    return newInstance(spec)
  }

  static isCoreDbIoLike: CoreDbIoDuckTypable =
  function (val?: any): val is CoreDbIo {
    return isObject(val) && isFunction(val.access)
  }

  access (src: DocRef[]|DocIdRange|DocRevs|DocRef): Promise<DocRef[]|DocRef> {
    const key = coreDbIoKeyFor(src)
    const iomethod = this[key].bind(this)
    return Promise.try(() => <Promise<DocRef[]|DocRef>> iomethod(src))
  }

  protected abstract unit (src: DocRef|DocRevs): Promise<DocRef[]|DocRef>;

  protected abstract bulk (src: DocRef[]|DocIdRange): Promise<DocRef[]>;

  constructor (protected db: any) {}
}

class CoreDbWriteClass extends CoreDbIoClass {
  static newInstance = <CoreDbIoFactory> function (spec: CoreDbIoSpec): CoreDbIo {
    return new CoreDbWriteClass(spec.db, spec.opts)
  }

  unit (doc: DocRef): Promise<DocRef> {
    assert(isValidDocRef(doc), 'invalid document')
    return this.db.put(doc, this.spec)
    .then(toDocRef)
  }

  bulk (docs: DocRef[]): Promise<DocRef[]> {
    assert(isValidDocRefArray(docs), 'invalid document')
    return this.db.bulkDocs(docs, this.spec)
    .then(toDocRefs)
  }

  constructor (db: any, private spec: WriteOpts) {
    super(db)
  }
}

class CoreDbReadClass extends CoreDbIoClass {
  static newInstance = <CoreDbIoFactory> function (spec: CoreDbIoSpec): CoreDbIo {
    return new CoreDbReadClass(spec.db, spec.opts)
  }

  unit (ref: DocRef|DocRevs): Promise<DocRef[]|DocRef> {
    assert(isValidDocRefOrRevs(ref), 'invalid document reference')
    const opts = assign({}, this.spec, unitOptsFrom(ref))
    return this.db.get(ref._id, opts)
    .then(docsFromRevs)
  }

  bulk (refs: DocRef[]|DocIdRange): Promise<DocRef[]> {
    assert(isValidDocRefArray(refs) || isValidDocIdRange(refs),
    'invalid document reference')
    const opts = assign({}, this.spec, bulkOptsFrom(refs))
    return this.db.allDocs(opts)
    .then((res: AllDocsResult) => res.rows.map(row => row.doc))
  }

  constructor (db: any, private spec: ReadOpts) {
    super(db)
  }
}

/**
 * @private
 * @function coreDbIoKeyFor
 * @param {DocRef[]|DocIdRange|DocRevs|DocRef} src
 * @return {'bulk'|'unit'}
 */
function coreDbIoKeyFor (src: DocRef[]|DocIdRange|DocRevs|DocRef): 'bulk'|'unit' {
  return !src || isString((<any>src)._id) ? 'unit' : 'bulk'
}

/**
 * @private
 * @function isPouchDbLike
 * duck-type checking
 * @prop {any} val
 * @return {boolean} true if val looks like
 * a PouchDb instance for the purpose of this module,
 * ie. it includes all the required methods
 */
function isPouchDbLike (val: any): boolean {
  return isObject(val)
  && [ 'get', 'put', 'allDocs', 'bulkDocs' ]
  .every(key => isFunction(val[key]))
}

function isValidDocRefOrRevs <R extends DocRef,DocRevs>(val: any): val is R {
  return isValidDocRef(val)
  && (!(<any>val)._revs || isString((<any>val)._revs) || Array.isArray((<any>val)._revs))
}

function isValidDocRef <R extends DocRef>(val: any): val is R {
  return isValidDocId<R>(val) && (!val._rev || isString(val._rev))
}

function isValidDocId <I extends DocId>(val: any): val is I {
  return isObject(val) && isString(val._id)
}

function isValidDocRefArray <A extends DocRef[]>(val: any): val is A {
  return Array.isArray(val) && val.every((val: any) => isValidDocRef(val))
}

function isValidDocIdRange <R extends DocIdRange>(val: any) : val is R {
  return isObject(val) && isString(val.startkey) && isString(val.endkey)
}

function unitOptsFrom (ref: DocRef|DocRevs) {
  return isString((<DocRef> ref)._rev) ?
  { rev : (<DocRef> ref)._rev } : { revs: (<DocRevs> ref)._revs}
}

function bulkOptsFrom (refs: DocRef[]|DocIdRange) {
  return Array.isArray(refs) ? { keys : refs.map(ref => ref._id) } : refs
}

function toDocRefs (res: any[]): DocRef[] {
  return res.map(toDocRef)
}

function toDocRef (res: any): DocRef {
  return res.ok ? { _id: res.id, _rev: res.rev } : res
}

function docsFromRevs (res: { ok: DocRef }[] | DocRef): DocRef[] | DocRef {
  return Array.isArray(res) ? res.map(res => res.ok) : res
}

interface AllDocsResult {
  rows: { doc: DocRef }[]
}

export const isCoreDbIoLike = CoreDbIoClass.isCoreDbIoLike

const newCoreDbIo = CoreDbIoClass.newInstance
export default newCoreDbIo


text:
Out of the box, a `Manifest.cs` file is generated, which includes the `ModuleAttribute`, `FeatureAttribute`, `ThemeAttribute`, and so forth, that describe the _Orchard Core_ meta information about your projects. However, let's say you want to connect available meta properties at the `CSPROJ` level, i.e. such properties as `$(MSBuildProjectName)`, `$(AssemblyVersion)`, `$(PackageTags)`, to name a few.

At its core, we wanted to follow a pattern similar to `InternalsVisibleTo`, i.e.

```xml
<ItemGroup>
    <AssemblyAttribute Include="System.Runtime.CompilerServices.InternalsVisibleTo">
      <_Parameter1>Test.$(MSBuildProjectName)</_Parameter1>
    </AssemblyAttribute>
</ItemGroup>
```

The principles are the same, but in prior versions, the attribute constructors were not available for us to lean into. We also decided to provide helpful [`MSBuild` Items](https://docs.microsoft.com/en-us/visualstudio/msbuild/msbuild-items) as a more accessible, self-documenting shorthand input. So, while it is possible to engage directly with the constructors, i.e. `InternalsVisibleTo`, we will leave that as an exercise for the reader. Rather, we will focus on the [_Item Lists_](#msbuild-item-lists).

We also had a requirement that our assembly versions, in particular, are bumped during the build targets, so we wanted that to happen before being relayed into the _Orchard Core_ targets. Consult with the [Microsoft `MSBuild` documentation](https://docs.microsoft.com/en-us/visualstudio/msbuild) for broader details concerning the build properties that are available.

## MSBuild Item Lists

There are several items you may be interested in, depending on your projects, i.e. whether _Module_, _Theme_, and/or any _Features_. There are also a couple of properties that we use during the _Orchard Core_ targets. Obviously, one would not specify all of these in the same project, but for documentation brevity, are enumerated here. There are [some caveats](#some-caveats) to mention, but overall, these are the attributes of interest.

```xml
<OrchardCoreFeatures Include="..."
                     Name="..."
                     Category="..."
                     Priority="..."
                     Description="..."
                     Dependencies="..."
                     DefaultTenant="..."
                     AlwaysEnabled="..." />
```

```xml
<OrchardCoreModules Include="..."
                    Name="..."
                    ModuleType="..."
                    Category="..."
                    Priority="..."
                    Description="..."
                    Author="..."
                    Version="..."
                    Website="..."
                    Dependencies="..."
                    Tags="..."
                    DefaultTenant="..."
                    AlwaysEnabled="..." />
```

```xml
<OrchardCoreThemes Include="..."
                   Name="..."
                   Base="..."
                   Category="..."
                   Priority="..."
                   Description="..."
                   Author="..."
                   Version="..."
                   Website="..."
                   Dependencies="..."
                   Tags="..."
                   DefaultTenant="..."
                   AlwaysEnabled="..." />
```

With all _properties_ described as follows.

|Property|Type|Description|
|-|-|-|
|`Include`|`string` 1|Required, signals `MSBuild` that an _item list_ is supported, which `Identity` serves as the attribute `Id`.|
|`Name`|`string`|Optional, human readable name for the module or feature.|
|`Base`|`string`|Optional, the base theme from which the assembly is derived. Not applicable to either _features_ or _modules_.|
|`ModuleType`|`string`|Optional author provided `Type`; defaults to `"Module"` or `"Theme"`. Not applicable to _features_ since this is a _Module_ base class property. 2|
|`Category`|`string`|Optional category for the feature.|
|`Priority`|`int` 1|Optional integer priority, given as a `string`, defaults to `0`; lower priority given precedence.|
|`Description`|`string`|Optional descriptive text.|
|`Author`|`string`|Optional, author provided identification.|
|`Version`|`string`|Optional, recommended, semantic versioning text, defaults to `"0.0"`.|
|`Dependencies`|`list`|Optional, semi-colon delimited list of _Module Identifier_ dependencies. 3|
|`Tags`|`list`|Optional, semi-colon delimited list of tags. 3|
|`DefaultTenant`|`bool` 1|Optional, Boolean, `true|false`, defaults to `false`.|
|`AlwaysEnabled`|`bool` 1|Optional, Boolean, `true|false`, defaults to `false`.|

[1] `MSBuild` relays all meta data as `string`, leaving authors to contend with either `string` or `object` type conversions i.e. either `int` or `bool`, which is fine for our purposes.

[2] Depending on the `Attribute` context, `ModuleAttribute` yields `"Module"`, `ThemeAttribute` yields `"Theme"` by default.

[3] Defaults to _semi-colon_ delimited, since that is also the `CSPROJ` delimiter. Also supports _space_ or _comma_ delimiting.

And for convenience, you may specify all of your assembly Orchard Core attributes using one, top level item list.

```xml
<OrchardCoreAttributes Include="..."
                       Type="..."
                       ... />
```

|Property|Type|Description|
|-|-|-|
|`Type`|`string`|Commonly either, `"feature"`, `"theme"` or `"module"`. Anything else not `"feature"` or `"theme"` assumes _Module_.|

Otherwise, the `OrchardCoreAttributes` should include all the same _properties_ that the desired `Type` would require.

## Targets order dependencies

A couple of convenience [`MSBuild` _properties_](https://docs.microsoft.com/en-us/visualstudio/msbuild/msbuild-properties) are provided, which authors may leverage in order to accommodate their internal target build orders.

|Property|Default|Description|
|-|-|-|
|`OrchardCoreEmbeddingAfterTargets`|`AfterResolveReferences`|_Orchard Core_ assembly embedding to occur **_after_** these targets.|
|`OrchardCoreEmbeddingBeforeTargets`|`GenerateAssemblyInfo`|_Orchard Core_ assembly embedding to occur **_before_** these targets.|

We do not recommend changing the defaults in any way, but rather to append with your custom targets as desired, i.e.

```xml
<PropertyGroup>
  <OrchardCoreEmbeddingAfterTargets>$(OrchardCoreEmbeddingAfterTargets);MyCustomTarget<OrchardCoreEmbeddingAfterTargets>
  <!--                                                                 ^^^^^^^^^^^^^^^ -->
</PropertyGroup>
```

### Some caveats

Per assembly, the following heuristics are detected by the _Orchard Core_ build targets:

* Only one _Module_ may be defined
* Only one _Theme_, which is also a _Module_ may be defined
* A _Module_ and a _Theme_ may not both be defined
* Any number of purely _Feature_ (i.e. non-_Module_ nor _Theme_) attributes may be defined

## Drop the Manifest CSharp file

When you are happy with your `CSPROJ` item lists, then you may comment out the contents of the `Manifest.cs` file, or delete it altogether from your project, at your discretion.

## Summary

In this article we described how to leverage _Orcard Core_ `CSPROJ` _item lists_ and _properties_ in order to enrich and get the absolute most from your authoring experience.

Happy coding!


text:
package storage

import (
	"github.com/prometheus/client_golang/prometheus"
)

var (
	rangeCounter = prometheus.NewCounter(
		prometheus.CounterOpts{
			Namespace: "etcd",
			Subsystem: "storage",
			Name:      "range_total",
			Help:      "Total number of ranges seen by this member.",
		})

	putCounter = prometheus.NewCounter(
		prometheus.CounterOpts{
			Namespace: "etcd",
			Subsystem: "storage",
			Name:      "put_total",
			Help:      "Total number of puts seen by this member.",
		})

	deleteCounter = prometheus.NewCounter(
		prometheus.CounterOpts{
			Namespace: "etcd",
			Subsystem: "storage",
			Name:      "delete_total",
			Help:      "Total number of deletes seen by this member.",
		})

	txnCounter = prometheus.NewCounter(
		prometheus.CounterOpts{
			Namespace: "etcd",
			Subsystem: "storage",
			Name:      "txn_total",
			Help:      "Total number of txns seen by this member.",
		})

	keysGauge = prometheus.NewGauge(
		prometheus.GaugeOpts{
			Namespace: "etcd",
			Subsystem: "storage",
			Name:      "keys_total",
			Help:      "Total number of keys.",
		})

	indexCompactionPauseDurations = prometheus.NewHistogram(
		prometheus.HistogramOpts{
			Namespace: "etcd",
			Subsystem: "storage",
			Name:      "index_compaction_pause_duration_milliseconds",
			Help:      "Bucketed histogram of index compaction puase duration.",
			// 0.5ms -> 1second
			Buckets: prometheus.ExponentialBuckets(0.5, 2, 12),
		})

	dbCompactionPauseDurations = prometheus.NewHistogram(
		prometheus.HistogramOpts{
			Namespace: "etcd",
			Subsystem: "storage",
			Name:      "db_compaction_pause_duration_milliseconds",
			Help:      "Bucketed histogram of db compaction puase duration.",
			// 1ms -> 4second
			Buckets: prometheus.ExponentialBuckets(1, 2, 13),
		})

	dbCompactionTotalDurations = prometheus.NewHistogram(
		prometheus.HistogramOpts{
			Namespace: "etcd",
			Subsystem: "storage",
			Name:      "db_compaction_total_duration_milliseconds",
			Help:      "Bucketed histogram of db compaction total duration.",
			// 100ms -> 800second
			Buckets: prometheus.ExponentialBuckets(100, 2, 14),
		})
)

func init() {
	prometheus.MustRegister(rangeCounter)
	prometheus.MustRegister(putCounter)
	prometheus.MustRegister(deleteCounter)
	prometheus.MustRegister(txnCounter)
	prometheus.MustRegister(keysGauge)
	prometheus.MustRegister(indexCompactionPauseDurations)
	prometheus.MustRegister(dbCompactionPauseDurations)
	prometheus.MustRegister(dbCompactionTotalDurations)
}


text:
import Isntit from '../index'
import { noop } from '../utils'

Isntit.prototype.checkRules = noop;

export default Isntit


text:
using System;

using NUnit.Framework;

using PPWCode.Util.OddsAndEnds.II.Streaming;

namespace PPWCode.Util.OddsAndEnds.II.Tests
{
    [TestFixture]
    public class CompressionTests
    {
        [Test]
        public void CompressedByteArrayNotNull()
        {
            Random random = new Random();
            byte[] array = new byte[10];
            random.NextBytes(array);

            var result = Compression.Compress(array);
            Assert.IsNotNull(result);
        }

        [Test]
        public void CompressThenDecompressReturnsSameArray()
        {
            Random random = new Random();
            byte[] array = new byte[10];
            random.NextBytes(array);

            var compressed = Compression.Compress(array);
            var result = Compression.DeCompress(compressed);

            Assert.AreEqual(array, result);
        }
    }
}


text:
package fr.sgr.formation.voteapp.utilisateurs.modele;

import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;

import lombok.Data;
import lombok.EqualsAndHashCode;

@Data
@Entity
@EqualsAndHashCode(of = { "id" })
public class Ville {
	@Id
	@GeneratedValue(strategy = GenerationType.AUTO)
	private Long id;
	private String codePostal;
	private String nom;
}


text:
package flags

import "gopkg.in/urfave/cli.v1"

func Flags() []cli.Flag {
	profileFlag := cli.StringFlag{
		Name:  "profile, p",
		Usage: "Optional AWS profile",
		Value: "default",
	}

	regionFlag := cli.StringFlag{
		Name:  "region, r",
		Usage: "Optional AWS region",
		Value: "eu-west-1",
	}

	return []cli.Flag{
		profileFlag,
		regionFlag,
	}
}