text:
package org.gwoptics.gaussbeams;

import org.gwoptics.mathutils.Complex;
import org.gwoptics.mathutils.mathUtils;

/**
 * Gaussmode is a class that provides the mathematical framework for Gaussian
 * beams. Gaussmode objects store the beam parameter, the laser wavelength and
 * the local index of refraction, which fully decribes a Gaussian beam. The
 * class provides a set of utility functions to transform Gaussian beam
 * parameters or to compute properties of the beam (beam size, amplitue
 * patterns, etc.)
 *
 * @author Andreas Freise 05/6/2009
 * @since 0.1.1
 */
public class GaussMode {

  double _lambda; // vacuum wavelength of the laser light
  double _nr;     // index of refraction of local medium
	/*
   * for Hermite-Gauss modes the beam parameter in x and y directions can be
   * different
   */
  public Complex _qx; // Gaussian beam parameter in x direction (tangential plane)
  public Complex _qy; // Gaussian beam parameter in y direction (sagittal plane)

  /**
   * Default constructor which sets dummy parameters for the Gaussian beam:
   *
   * lambda = 1064nm, wavelength of a Nd:YAG laser nr = 1, index of refraction
   * of vacuum (or air) beam waist of w0=1mm at z0=0
   *
   */
  public GaussMode() {
    _lambda = 1064e-9d;
    _nr = 1;
    _qx = make_q(1e-3d, 0, _lambda, _nr);
    _qy = make_q(1e-3d, 0, _lambda, _nr);
  }

  /**
   * Standard constructor that sets user defined beam parameters.
   *
   * @param lambda laser vacuum wavelength (in meters)
   * @param q Gaussian beam parameters for x- and y-direction
   * @param nr local index of refraction (typically nr=1)
   */
  public GaussMode(float lambda, Complex q, float nr) {
    assert (lambda > 0);
    assert (q.imag() > 0);
    _lambda = lambda;
    _qx = q;
    _qy = q;
    _nr = nr;
  }

  /**
   * Additional constructor that sets user defined beam parameters, now
   * optionally different for x- and y-direction.
   *
   * @param lambda vacuum wavelength of laser (in meters)
   * @param qx Gaussian beam parameter in x-direction (tangential plane)
   * @param qy Gaussian beam parameter in y-direction (sagittal plane)
   * @param nr local index of refraction (typically nr=1)
   */
  public GaussMode(float lambda, Complex qx, Complex qy, float nr) {
    assert (lambda > 0);
    assert (qx.imag() > 0);
    assert (qy.imag() > 0);
    _lambda = lambda;
    _qx = qx;
    _qy = qy;
    _nr = nr;
  }

  /**
   * Additional constructor that sets the beam parameters via beam waist radius
   * and beam waist position.
   *
   * @param lambda vacuum wavelength of laser (in meters)
   * @param w0 beam waist radius (in meters)
   * @param z beam waist position (in meters)
   * @param nr local index of refraction (typically n=1)
   */
  public GaussMode(float lambda, float w0, float z, float nr) {
    assert (lambda > 0);
    assert (w0 > 0);
    _lambda = lambda;
    _nr = nr;
    _qx = make_q(w0, z, _lambda, _nr);
    _qy = _qx;
  }

  /**
   * Additional constructor that sets the beam parameters via beam waist radius
   * and beam waist position, now allowing different parameters in x- and
   * y-direction.
   *
   * @param lambda vacuum wavelength of laser (in meters)
   * @param w0x beam waist radius, x-direction (in meters)
   * @param w0y beam waist radius, y-direction (in meters)
   * @param zx beam waist position, x-direction (in meters)
   * @param zy beam waist position, y-direction (in meters)
   * @param nr local index of refraction (typically n=1)
   */
  public GaussMode(float lambda, float w0x, float zx, float w0y, float zy,
          float nr) {
    assert (lambda > 0);
    assert (w0x > 0);
    assert (w0y > 0);
    _lambda = lambda;
    _nr = nr;
    _qx = make_q(w0x, zx, _lambda, _nr);
    _qy = make_q(w0y, zy, _lambda, _nr);
  }

  /**
   * This function returns the vacuum wavelength of the laser.
   *
   * @return lambda, vacuum wavelength
   */
  public double get_lambda() {
    return _lambda;
  }

  /**
   * This function returns the local index of refraction
   *
   * @return nr, local index of refraction
   */
  public double get_nr() {
    return _nr;
  }

  /**
   * This function returns the Gaussian beam parameter q in x-direction
   * (tangential plane)
   *
   * @return qx
   */
  public Complex get_qx() {
    return _qx;
  }

  /**
   * This function returns the Gaussian beam parameter q in y-direction
   * (sagittal plane)
   *
   * @return qy
   */
  public Complex get_qy() {
    return _qy;
  }

  /**
   * This function returns the beam waist radius in x-direction (tangential
   * plane)
   *
   * @return w0 in x-direction
   */
  public double get_w0x() {
    return this.w0_size(_qx);
  }

  /**
   * This function returns the beam waist radius in y-direction (sagittal plane)
   *
   * @return w0 in y-direction
   */
  public double get_w0y() {
    return this.w0_size(_qy);
  }

  /**
   * This function returns the beam radius in x-direction (tangential plane)
   *
   * @return w in x-direction
   */
  public double get_wx() {
    return this.w_size(_qx);
  }

  /**
   * This function returns the beam radius in y-direction (sagittal plane)
   *
   * @return w in y-direction
   */
  public double get_wy() {
    return this.w_size(_qy);
  }

  /**
   * This function returns the distance to the beam waist in x-direction
   * (tangential plane)
   *
   * @return z-z0 in x-direction
   */
  public double get_zx() {
    return _qx.real();
  }

  /**
   * This function returns the distance to the beam waist in y-direction
   * (sagittal plane)
   *
   * @return z-z0 in y-direction
   */
  public double get_zy() {
    return _qy.real();
  }

  /**
   * This function returns the Rayleigh range z_r in x-direction (tangential
   * plane)
   *
   * @return zr in x-direction
   */
  public double get_zrx() {
    return _qx.imag();
  }

  /**
   * This function returns the Rayleigh range z_r in y-direction (sagittal
   * plane)
   *
   * @return zr in y-direction
   */
  public double get_zry() {
    return _qy.imag();
  }

  /**
   * This function returns the phase front radius of curvature in x-direction
   * (tangential plane)
   *
   * @return ROC in x-direction
   */
  public double get_ROCx() {
    return ROC(_qx);
  }

  /**
   * This function returns the phase front radius of curvature in y-direction
   * (sagittal plane)
   *
   * @return ROC in y-direction
   */
  public double get_ROCy() {
    return ROC(_qy);
  }

  /**
   * This function returns the Gouy phase Psi(z) in x-direction (tangential
   * plane)
   *
   * @return Psi(z) in x-direction
   */
  public double get_Gouyx() {
    return Gouy(_qx);
  }

  /**
   * This function returns the Gouy phase Psi(z) in y-direction (sagittal plane)
   *
   * @return Psi(z) in y-direction
   */
  public double get_Gouyy() {
    return Gouy(_qy);
  }

  /**
   * This function Gaussian beam parametera at the waist q0 in x-direction
   * (tangential plane)
   *
   * @return q0 in x-direction
   */
  public Complex get_q0x() {
    return q0(_qx);
  }

  /**
   * This function returns the Gaussian beam parameter at the waist q0 in
   * y-direction (sagittal plane)
   *
   * @return q0 in y-direction
   */
  public Complex get_q0y() {
    return q0(_qy);
  }

  /**
   * This function computes a Gaussian beam parameters from user defined
   * parameters for the beam waist (and wavelength, and index of refraction).
   *
   * @param w0 beam waist radius
   * @param z distance to beam waist
   * @param lambda vacuum wavelength of the laser
   * @param nr local index of refraction
   * @return Gaussian beam parameter q
   */
  public static Complex make_q(double w0, double z, double lambda, double nr) {
    Complex q = new Complex(0);
    q.setReal(z);
    q.setImag(w0 * w0 * Math.PI / lambda * nr);
    return (q);
  }

  /**
   * This function computes the beam waist radius for a given beam parameters.
   * This function takes the wavelength and index of refraction from its
   * GaussMode onject!
   *
   * @param q Gaussian beam parameter
   * @return beam waist radius w0
   */
  public Double w0_size(Complex q) {
    return (Math.sqrt(q.imag() / Math.PI) * Math.sqrt(_lambda / _nr));
  }

  /**
   * This function computes the beam waist radius for a given beam parameters.
   *
   * @param q Gaussian beam parameter
   * @param lambda vacuum wavelength
   * @param nr local index of refraction
   * @return beam waist radius w0
   */
  public static Double w0_size(Complex q, Double lambda, Double nr) {
    assert (nr > 0.0);
    assert (lambda > 0.0);
    return (Math.sqrt(q.imag() / Math.PI) * Math.sqrt(lambda / nr));
  }

  /**
   * This function computes the beam radius for a given beam parameters. This
   * function takes the wavelength and index of refraction from its GaussMode
   * onject!
   *
   * @param q Gaussian beam parameter
   * @return beam radius w
   */
  public Double w_size(Complex q) {
    assert (q.imag() > 0.0);
    return (Complex.modulus(q) / Math.sqrt(Math.PI * q.imag()) * Math.sqrt(_lambda / _nr));
  }

  /**
   * This function computes the beam radius for a given beam parameters.
   *
   * @param q Gaussian beam parameter
   * @param lambda vacuum wavelength
   * @param nr local index of refraction
   * @return beam radius w
   */
  public static Double w_size(Complex q, Double lambda, Double nr) {
    assert (nr > 0.0);
    assert (lambda > 0.0);
    assert (q.imag() > 0.0);
    return (Complex.modulus(q) / Math.sqrt(Math.PI * q.imag()) * Math.sqrt(lambda / nr));
  }

  /**
   * This function computes the phase front curvature for a given beam
   * parameters.
   *
   * @param q Gaussian beam parameter
   * @return radius of curvature ROC
   */
  public static Double ROC(Complex q) {
    return (Complex.absSquared(q) / Complex.real(q));
  }

  /**
   * This function computes the Gouy for a given beam parameters.
   *
   * @param q Gaussian beam parameter
   * @return Gouy phase Psi
   */
  public static Double Gouy(Complex q) {
    assert (q.imag() > 0);
    return (Complex.real(q) / Complex.imag(q));
  }

  /**
   * This function computes the beam parameter at the waist for a given beam
   * parameters.
   *
   * @param q Gaussian beam parameter
   * @return Gaussian beam parameter at waist q0
   */
  public static Complex q0(Complex q) {
    Complex temp_q = q;
    temp_q.setReal(0.0d);
    return (temp_q);
  }

  /**
   * This function computes the Rayleigh range for a given beam parameters.
   *
   * @param q Gaussian beam parameter
   * @return Rayleigh range zr
   */
  public static Double zr(Complex q) {
    return (q.imag());
  }

  /**
   * This function returns the complex amplitude of a Hermite-Gaussian beam
   * shape u_nm.
   *
   * @param n horizontal mode index
   * @param m vertical mode index
   * @param x position on x-xaxis (orthogonal to beam direction) in meters
   * @param y position on y-xaxis (orthogonal to beam direction) in meters
   * @return complex amplitude
   */
  public Complex u_nm(int n, int m, double x, double y) {
    Complex temp_u;
    temp_u = Complex.multiply(u_n(n, _qx, x), u_n(m, _qy, y));
    return temp_u;
  }

  /**
   * This function returns the real amplitude only of a Hermite-Gaussian beam
   * shape u_nm. This is not simply abs(u_nm) or real(u_nm) but the amplitude
   * including the characteristic sign flips.
   *
   * @param n horizontal mode index
   * @param m vertical mode index
   * @param x position on x-xaxis (orthogonal to beam direction) in meters
   * @param y position on y-xaxis (orthogonal to beam direction) in meters
   * @return bipolar real amplitude
   * @see u_nm
   */
  public double u_nm_amp(int n, int m, double x, double y) {
    double temp_u;
    temp_u = u_n_amp(n, _qx, x) * u_n_amp(m, _qy, y);
    return temp_u;
  }

  /**
   * This function returns the phase of a Hermite-Gaussian beam shape u_nm,
   * *without* the sign flips from the H polynomials!
   *
   * @param n horizontal mode index
   * @param m vertical mode index
   * @param x position on x-xaxis (orthogonal to beam direction) in meters
   * @param y position on y-xaxis (orthogonal to beam direction) in meters
   * @return phase
   * @see u_nm
   */
  public double u_nm_phs(int n, int m, double x, double y) {
    double temp_u;
    temp_u = u_n_phs(n, _qx, x) + u_n_phs(m, _qy, y);
    return temp_u;
  }

  /**
   * This function represents the one-dimensional part of u_nm_amp the amplitude
   * of a u_nm Hermite-Gauss beam pattern.
   *
   * @param n mode index
   * @param q Gaussian beam parameter
   * @param x position on axis
   * @return complex amplitude
   * @see u_nm_amp
   */
  public double u_n_amp(int n, Complex q, double x) {
    assert (n >= 0);
    assert (q.imag() > 0.0);

    Double factor;
    Double w;
    w = w_size(q, _lambda, _nr);
    Double a1 = 0.893243841738002308794364125788; // (2/pi)^1/4
    factor = a1
            / Math.sqrt(Math.pow(2, n) * mathUtils.factorial(n) * w)
            * mathUtils.hermite(n, Math.sqrt(2) * x
            / w_size(q, _lambda, _nr));
    factor *= Math.exp(-1.0 * x * x / (w * w));
    return (factor);
  }

  /**
   * This function represents the one-dimensional part of u_nm_phs the phase of
   * a u_nm Hermite-Gauss beam pattern.
   *
   * @param n mode index
   * @param q Gaussian beam parameter
   * @param x position on axis
   * @return complex amplitude
   * @see u_nm_phs
   */
  public double u_n_phs(int n, Complex q, double x) {
    assert (n >= 0);
    assert (q.imag() > 0.0);

    Double phase;
    Double ROC;
    Double Psi;
    ROC = ROC(q);
    Psi = Gouy(q);
    Double k = 2.0d * Math.PI / _lambda * _nr;
    phase = (n + 0.5) * Psi;
    phase = phase - k * Math.pow(x, 2) / (2 * ROC);
    return (phase);
  }

  /**
   * This function represents the one-dimensional part of a u_nm Hermite-Gauss
   * beam patter,
   *
   * @param n mode index
   * @param q Gaussian beam parameter
   * @param x position on axis
   * @return complex amplitude
   * @see u_nm
   */
  public Complex u_n(int n, Complex q, double x) {
    assert (n >= 0);
    assert (q.imag() > 0.0);

    Double factor;
    Complex phase, z1, z2, z3, z4;
    Double a1 = 0.893243841738002308794364125788; // (2/pi)^1/4
    Double k = 2.0d * Math.PI / _lambda * _nr;

    factor = a1
            / Math.sqrt(Math.pow(2, n) * mathUtils.factorial(n)
            * w0_size(q, _lambda, _nr))
            * mathUtils.hermite(n, Math.sqrt(2) * x
            / w_size(q, _lambda, _nr));

    z1 = Complex.sqrt(Complex.divide(q0(q), q));
    z2 = Complex.sqrt(Complex.divide(Complex.multiply(q0(q), Complex.conj(q)), Complex.multiply(Complex.conj(q0(q)), q)));
    z3 = Complex.multiply(z1, Complex.pow(z2, n, 1));
    phase = Complex.scale(-1.0 * k * x * x / 2.0, Complex.inv(q));
    factor *= Math.exp(-1.0 * phase.imag());
    z4 = Complex.scaleAndDelay(factor, phase.real(), z3);

    return (z4);
  }

  /**
   * This function returns the complex amplitude of a heical Laguerre-Gaussian
   * beam shape u_pl. This is a wrapper for u_pl which uses cylindrical
   * coordinates.
   *
   * @param p radial mode index
   * @param l azimuthal mode index
   * @param x position on x-xaxis (orthogonal to beam direction) in meters
   * @param y position on y-xaxis (orthogonal to beam direction) in meters
   * @return complex amplitude
   * @see u_pl
   */
  public Complex u_pl_xy(int p, int l, double x, double y) {
    Double r = Math.sqrt(Math.pow(x, 2) + Math.pow(y, 2));
    Double phi = Math.atan2(x, y);
    return u_pl(p, l, r, phi);
  }

  /**
   * This function returns the complex amplitude of a helical Laguerre-Gaussian
   * beam shape u_pl.
   *
   * @param p radial mode index
   * @param l azimuthal mode index
   * @param r radial position (orthogonal to beam direction) in meters
   * @param phi azimuthal phase (orthogonal to beam direction) in radians
   * @return complex amplitude
   */
  public Complex u_pl(int p, int l, double r, double phi) {
    int l_abs = Math.abs(l);
    //if ((l_abs < 0) || (p < l_abs))
    //	throw new RuntimeException("LG mode index error (0<|l|<p)");
    if (p < 0) {
      throw new RuntimeException("LG mode index error (p<0)");
    }
    Complex q = _qx; // for LG modes q=qx=qy
    Double k = 2.0d * Math.PI / _lambda * _nr;
    Double w = w_size(q, _lambda, _nr);
    Double sr = Math.sqrt(2) * r / w;
    Double psi = Gouy(q);
    Double q_abs = Complex.absSquared(q);
    Double expFactor = -0.5 * k * r * r;

    Double factor = Math.sqrt(2 * mathUtils.factorial(p)
            / (Math.PI * mathUtils.factorial(l_abs + p)))
            / w;
    Double Gouyphase = (2 * p + l_abs + 1) * psi;
    Double AmpPattern = Math.exp(expFactor * q.imag() / q_abs)
            * Math.pow(sr, l_abs)
            * mathUtils.laguerre(p, l_abs, sr * sr);
    Double Spiral = l * phi;
    Double Sphere = expFactor * q.real() / q_abs;
    return Complex.newAbsPhi(factor * AmpPattern, Gouyphase + Sphere + Spiral);
  }

  /**
   * This function returns the real amplitude only of a heical Laguerre-Gaussian
   * beam shape u_pl. This is a wrapper for u_pl_amp which uses cylindrical
   * coordinates.
   *
   * @param p radial mode index
   * @param l azimuthal mode index
   * @param x position on x-xaxis (orthogonal to beam direction) in meters
   * @param y position on y-xaxis (orthogonal to beam direction) in meters
   * @return bipolar real amplitude
   * @see u_pl_amp
   */
  public double u_pl_amp_xy(int p, int l, double x, double y) {
    Double r = Math.sqrt(Math.pow(x, 2) + Math.pow(y, 2));
    Double phi = Math.atan2(x, y);
    return u_pl_amp(p, l, r, phi);
  }

  /**
   * This function returns the real amplitude only of a helical
   * Laguerre-Gaussian beam shape u_pl. This is not simply abs(u_pl) or
   * real(u_pl) but the amplitude including the characteristic sign flips.
   *
   * @param p radial mode index
   * @param l azimuthal mode index
   * @param r radial position (orthogonal to beam direction) in meters
   * @param phi azimuthal phase (orthogonal to beam direction) in radians
   * @return bipolar real amplitude
   * @see u_pl
   */
  public double u_pl_amp(int p, int l, double r, double phi) {
    int l_abs = Math.abs(l);
    if (p < 0) {
      throw new RuntimeException("LG mode index error (p<0)");
    }
    Complex q = _qx; // for LG modes q=qx=qy
    Double k = 2.0d * Math.PI / _lambda * _nr;
    Double w = w_size(q, _lambda, _nr);
    Double sr = Math.sqrt(2) * r / w;
    Double q_abs = Complex.absSquared(q);
    Double expFactor = -0.5 * k * r * r;
    Double factor = Math.sqrt(2 * mathUtils.factorial(p)
            / (Math.PI * mathUtils.factorial(l_abs + p)))
            / w;
    Double AmpPattern = Math.exp(expFactor * q.imag() / q_abs)
            * Math.pow(sr, l_abs)
            * mathUtils.laguerre(p, l_abs, sr * sr);
    return factor * AmpPattern;
  }

  /**
   * This function returns the complex amplitude of a sinusoidal
   * Laguerre-Gaussian beam shape u_pl. This is a wrapper function for u_pl_cos
   * which uses cylindrical coordinates.
   *
   * @param p radial mode index
   * @param l azimuthal mode index
   * @param x position on x-xaxis (orthogonal to beam direction) in meters
   * @param y position on y-xaxis (orthogonal to beam direction) in meters
   * @return complex amplitude
   * @see u_pl_cos
   */
  public Complex u_lp_cos_xy(int p, int l, double x, double y) {
    Double r = Math.sqrt(Math.pow(x, 2) + Math.pow(y, 2));
    Double phi = Math.atan2(x, y);
    return u_pl_cos(p, l, r, phi);
  }

  /**
   * This function returns the complex amplitude of a sinusoidal
   * Laguerre-Gaussian beam shape u_pl.
   *
   * @param p radial mode index
   * @param l azimuthal mode index
   * @param r radial position (orthogonal to beam direction) in meters
   * @param phi azimuthal phase (orthogonal to beam direction) in radians
   * @return complex amplitude
   * @see u_pl
   */
  public Complex u_pl_cos(int p, int l, double r, double phi) {

    int l_abs = Math.abs(l);
    if (p < 0) {
      throw new RuntimeException("LG mode index error (p<0)");
    }
    Complex q = _qx; // for LG modes q=qx=qy
    Double k = 2.0d * Math.PI / _lambda * _nr;
    Double w = w_size(q, _lambda, _nr);
    Double sr = Math.sqrt(2) * r / w;
    Double psi = Gouy(q);
    Double q_abs = Complex.absSquared(q);
    Double expFactor = -0.5 * k * r * r;

    Double factor = Math.sqrt(2 * mathUtils.factorial(p)
            / (Math.PI * mathUtils.factorial(l_abs + p)))
            / w;
    Double Gouyphase = (2 * p + l_abs + 1) * psi;
    Double AmpPattern = Math.exp(expFactor * q.imag() / q_abs)
            * Math.pow(sr, l_abs)
            * mathUtils.laguerre(p, l_abs, sr * sr);
    Double Spiral = l * phi;
    Double Sphere = expFactor * q.real() / q_abs;
    return Complex.newAbsPhi(factor * AmpPattern * Math.cos(Spiral), Gouyphase + Sphere);
  }

  /**
   * This function returns the real amplitude only of a sinusoidal
   * Laguerre-Gaussian beam shape u_pl. This is a wrapper for u_pl_cos_amp which
   * uses cylindrical coordinates.
   *
   * @param p radial mode index
   * @param l azimuthal mode index
   * @param x position on x-xaxis (orthogonal to beam direction) in meters
   * @param y position on y-xaxis (orthogonal to beam direction) in meters
   * @return bipolar real amplitude
   * @see u_pl_cos_amp
   */
  public double u_pl_cos_amp_xy(int p, int l, double x, double y) {
    Double r = Math.sqrt(Math.pow(x, 2) + Math.pow(y, 2));
    Double phi = Math.atan2(x, y);
    return u_pl_cos_amp(p, l, r, phi);
  }

  /**
   * This function returns the real amplitude only of a sinusoidal
   * Laguerre-Gaussian beam shape u_pl. This is not simply abs(u_pl) or
   * real(u_pl) but the amplitude including the characteristic sign flips.
   *
   * @param p radial mode index
   * @param l azimuthal mode index
   * @param r radial position (orthogonal to beam direction) in meters
   * @param phi azimuthal phase (orthogonal to beam direction) in radians
   * @return bipolar real amplitude
   * @see u_pl_cos
   */
  public double u_pl_cos_amp(int p, int l, double r, double phi) {
    int l_abs = Math.abs(l);
    if (p < 0) {
      throw new RuntimeException("LG mode index error (p<0)");
    }
    Complex q = _qx; // for LG modes q=qx=qy
    Double k = 2.0d * Math.PI / _lambda * _nr;
    Double w = w_size(q, _lambda, _nr);
    Double sr = Math.sqrt(2) * r / w;
    Double q_abs = Complex.absSquared(q);
    Double expFactor = -0.5 * k * r * r;
    Double factor = Math.sqrt(2 * mathUtils.factorial(p)
            / (Math.PI * mathUtils.factorial(l_abs + p)))
            / w;
    Double AmpPattern = Math.exp(expFactor * q.imag() / q_abs)
            * Math.pow(sr, l_abs)
            * mathUtils.laguerre(p, l_abs, sr * sr);
    Double Spiral = l * phi;
    return factor * AmpPattern * Math.cos(Spiral);
  }
}


text:
#ifndef TENSORFLOW_CORE_PROFILER_LIB_DEVICE_PROFILER_SESSION_H_
#define TENSORFLOW_CORE_PROFILER_LIB_DEVICE_PROFILER_SESSION_H_

#include "tensorflow/core/framework/step_stats.pb.h"
#include "tensorflow/core/platform/errors.h"
#include "tensorflow/core/platform/platform.h"
#include "tensorflow/core/platform/status.h"

#if !defined(IS_MOBILE_PLATFORM)
#include "tensorflow/core/profiler/convert/xplane_to_step_stats.h"
#include "tensorflow/core/profiler/lib/profiler_session.h"
#include "tensorflow/core/profiler/protobuf/xplane.pb.h"
#endif
#include "tensorflow/core/profiler/profiler_options.pb.h"

namespace tensorflow {

// Wraps a ProfilerSession configured to collect only device traces.
// Returns data in StepStats format.
class DeviceProfilerSession {
 public:
  // Creates a DeviceProfilerSession and starts tracing.
  // Traces GPU devices if present.
  // Does not trace TPU devices (not supported).
  static std::unique_ptr<DeviceProfilerSession> Create() {
#if !defined(IS_MOBILE_PLATFORM)
    ProfileOptions options = ProfilerSession::DefaultOptions();
    options.set_host_tracer_level(0);
    options.set_device_type(ProfileOptions::GPU);
    return absl::WrapUnique(new DeviceProfilerSession(options));
#else
    return nullptr;
#endif
  }

  // Stops tracing and converts the data to StepStats format.
  // Should be called at most once.
  Status CollectData(StepStats* step_stats) {
#if defined(IS_MOBILE_PLATFORM)
    return errors::Unimplemented("Profiling not supported on mobile platform.");
#else
    profiler::XSpace space;
    TF_RETURN_IF_ERROR(profiler_session_.CollectData(&space));
    profiler::ConvertGpuXSpaceToStepStats(space, step_stats);
    return OkStatus();
#endif
  }

 private:
  // Constructs an instance of the class and starts profiling
  explicit DeviceProfilerSession(const ProfileOptions& options)
#if !defined(IS_MOBILE_PLATFORM)
      : profiler_session_(options)
#endif
  {
  }

  // DeviceProfilerSession is neither copyable or movable.
  DeviceProfilerSession(const DeviceProfilerSession&) = delete;
  DeviceProfilerSession& operator=(const DeviceProfilerSession&) = delete;

#if !defined(IS_MOBILE_PLATFORM)
  ProfilerSession profiler_session_;
#endif
};

}  // namespace tensorflow
#endif  // TENSORFLOW_CORE_PROFILER_LIB_DEVICE_PROFILER_SESSION_H_

redpajama_set_name: RedPajamaGithub


text:
var Handlebars = require('handlebars');

var GREETING = "Hello, World!";

var self = module.exports = {

  ADDITIONAL_FORTUNE: {
    id: 0,
    message: 'Additional fortune added at request time.'
  },

  fortunesTemplate: Handlebars.compile([
    "<!DOCTYPE html>",
    "",
    "<title>Fortunes</title>",
    "",
    "
",
      "
",
        "id	",
        "message	",
      "
",
      "{{#fortunes}}",
      "
",
        "{{id}}	",
        "{{message}}	",
      "
",
      "{{/fortunes}}",
    "
",
    "",
    ""
  ].join('')),

  randomTfbNumber: function () {
    return Math.floor(Math.random() * 10000) + 1;
  },

  fillArray: function(value, len) {
    var arr = [];
    for (var i = 0; i < len; i++) {
      arr.push(value);
    }
    return arr;
  },

  addTfbHeaders: function (res, headerType) {
    var headers = {
      'Server': 'Node'
    }

    if (headerType === 'plain') {
      headers['Content-Type'] = 'text/plain; charset=UTF-8';
    } else if (headerType === 'json') {
      headers['Content-Type'] = 'application/json';
    } else if (headerType === 'html') {
      headers['Content-Type'] = 'text/html; charset=UTF-8';
    }

    res.writeHead(200, headers);
  },

  responses: {

    jsonSerialization: function (req, res) {
      var HELLO_OBJ = { message: GREETING }
      self.addTfbHeaders(res, 'json');
      res.end(JSON.stringify(HELLO_OBJ));
    },

    plaintext: function (req, res) {
      self.addTfbHeaders(res, 'plain');
      res.end(GREETING);
    },

    routeNotImplemented: function (req, res) {
      res.writeHead(501, {'Content-Type': 'text/plain; charset=UTF-8'});
      var reason = { reason: "`" + req.url + "` is not an implemented route" };
      res.end(JSON.stringify(reason));
    }

  }

};


text:
from __future__ import absolute_import, unicode_literals

"""
oauthlib.oauth2.rfc6749
~~~~~~~~~~~~~~~~~~~~~~~

This module is an implementation of various logic needed
for consuming and providing OAuth 2.0 RFC6749.
"""

from .authorization import AuthorizationEndpoint
from .token import TokenEndpoint
from .resource import ResourceEndpoint
from .revocation import RevocationEndpoint
from .pre_configured import Server
from .pre_configured import WebApplicationServer
from .pre_configured import MobileApplicationServer
from .pre_configured import LegacyApplicationServer
from .pre_configured import BackendApplicationServer


text:
<?xml version="1.0" encoding="utf-8"?>
<resources xmlns:ns1="urn:oasis:names:tc:xliff:document:1.2">
    <!-- From: file:/tmp/tmp-deduplicated2941550394266788208/blaze-out/gcc-4.X.Y-crosstool-v18-hybrid-grtev4-k8-opt/genfiles/java/com/google/android/gmscore/integ/client/cast/res/values-eu/cast_strings.xml -->
    <eat-comment/>
    <string msgid="5319032370587661362" name="cast_notification_connected_message">"<ns1:g id="NAME">%1$s</ns1:g> gailura konektatuta"</string>
    <string msgid="2758865089947797888" name="cast_notification_connecting_message">"<ns1:g id="NAME">%1$s</ns1:g> gailura konektatzen"</string>
    <string msgid="5232008641593292969" name="cast_notification_disconnect">"Deskonektatu"</string>
</resources>


text:
//
//  TKPegSlider.h
//  Created by Devin Ross on 6/30/14.
//

@import UIKit;

/** `TKPegSlider` a slider control with set points. */
@interface TKPegSlider : UIControl

/** The index of the selected item. */
@property (nonatomic,assign) NSInteger selectedPegIndex;

/** The index of the selected item. */
@property (nonatomic,assign) NSUInteger numberOfPegs;

/** The left side image. */
@property (nonatomic,strong) UIImage *leftEndImage;

/** The right side image. */
@property (nonatomic,strong) UIImage *rightEndImage;

/**
 Select an item manually.
 @param index The index of the item.
 @param animated Animate the selection of the item.
 */
- (void) selectPegAtIndex:(NSInteger)index animated:(BOOL)animated;

@end


text:
/* { dg-do compile } */
/* The pic register save adds unavoidable stack pointer references.  */
/* { dg-skip-if "" { ia32 && { ! nonpic } }  { "*" } { "" } } */
/* These options are selected to ensure 1 word needs to be allocated
   on the stack to maintain alignment for the call.  This should be
   transformed to push+pop.  We also want to force unwind info updates.  */
/* { dg-options "-Os -fomit-frame-pointer -fasynchronous-unwind-tables" } */
/* { dg-options "-Os -fomit-frame-pointer -mpreferred-stack-boundary=3 -fasynchronous-unwind-tables" { target ia32 } } */
/* ms_abi has reserved stack-region.  */
/* { dg-skip-if "" { x86_64-*-mingw* } { "*" } { "" } } */
void f();
void g() { f(); f(); }

/* Both stack allocate and deallocate should be converted to push/pop.  */
/* { dg-final { scan-assembler-not "sp" } } */


text:
<readable><title>1370615506_2b96105ca3</title><content>
A wine shop with an open sign in the window and two people out front .
The Wine Shop
The Wine Shop on Twenty Fourth building lit up in the dark , two people in front .
Two people are standing outside of a wine shop .
Two people stand outside a wine shop .
</content></readable>


text:
package org.gedcomx.conclusion;

import org.gedcomx.common.ResourceReference;
import org.gedcomx.common.URI;
import org.gedcomx.rt.EnumUtil;
import org.gedcomx.types.EventRoleType;
import org.simpleframework.xml.Attribute;
import org.simpleframework.xml.Element;
import org.simpleframework.xml.Order;

/**
 * A role that a specific person plays in an event.
 *
 * @author Reed Ellsworth
 */
@Order (elements = {"person", "details"})
public class EventRole extends Conclusion
{
  @Element (required = false)
  private ResourceReference person;
  @Attribute (required = false)
  private URI type; // from EventRoleType
  @Element (required = false)
  private String details;

  /**
   * Reference to the person playing the role in the event.
   *
   * @return Reference to the person playing the role in the event.
   */
  public ResourceReference getPerson() {
    return person;
  }

  /**
   * Reference to the person playing the role in the event.
   *
   * @param person Reference to the person playing the role in the event.
   */
  public void setPerson( ResourceReference person ) {
    this.person = person;
  }

  /**
   * The role type.
   *
   * @return The role type.
   */
  public URI getType() {
    return type;
  }

  /**
   * The role type.
   *
   * @param type The role type.
   */
  public void setType( URI type ) {
    this.type = type;
  }

  /**
   * The enum referencing the known role type, or {@link org.gedcomx.types.EventRoleType#OTHER} if not known.
   *
   * @return The enum referencing the known role type, or {@link org.gedcomx.types.EventRoleType#OTHER} if not known.
   */
  public EventRoleType getKnownType() {
    return getType() == null ? null : EventRoleType.fromQNameURI( getType() );
  }

  /**
   * Set the role type from an enumeration of known role types.
   *
   * @param knownType The role type.
   */
  public void setKnownType( EventRoleType knownType ) {
    setType(knownType == null ? null : URI.create( EnumUtil.toURIValue( knownType )));
  }

  /**
   * Details about the role of the person in the event.
   *
   * @return Details about the role of the person in the event.
   */
  public String getDetails() {
    return details;
  }

  /**
   * Details about the role of the person in the event.
   *
   * @param details Details about the role of the person in the event.
   */
  public void setDetails( String details ) {
    this.details = details;
  }

  /**
   * Provide a simple toString() method.
   */
  @Override
  public String toString() {
    return (person == null) ? "" : person.toString();
  }

}


text:
/*
 *= require store/spree_core
 *= require spree_lookbook/jQuery.iPicture2
*/


text:
Example = {};

Example.TemplateHelper = ( function() {
    var my = {};

    my.render = function(view, prototype, data) {
        var $element = prototype.clone();

        $element = $element.find(".Placeholder").autoRender(data);
        var html = $element.html();

        view.html(html);
    };

    return my;
}());


text:
<?php

use Storyplayer\SPv3\Modules\Asserts;
use Storyplayer\SPv3\Modules\Checkpoint;
use Storyplayer\SPv3\Modules\Log;
use Storyplayer\SPv3\Stories\BuildStory;

// ========================================================================
//
// STORY DETAILS
//
// ------------------------------------------------------------------------

$story = BuildStory::newStory();

// ========================================================================
//
// ACTIONS
//
// ------------------------------------------------------------------------

$story->addAction(function() {
    // what are we doing?
    $log = Log::usingLog()->startAction("can assert that data is NULL");

    // this is where you perform the steps of your user story
    Asserts::assertsNull(null)->isNull();

    // all done
    $log->endAction();
});


text:
describe('Projects Page', () => {
  it('should load a page with a 200 response code', () => request.get('/projects')
    .then((res) => {
      expect(res).to.have.status(200);
      expect(res).to.be.html;
    }));
});


text:
'use strict';

/**
 * Validate components of retry options
 *
 * @param {Any} retryOptions
 *
 * @return {Void}
 *
 * @throws {TypeError}
 *
 * @private
 */
module.exports = function validateRetryOptionsComponents (retryOptions) {
  const {
    initialDelayMs,
    maxAttempts,
    exponent
  } = retryOptions;

  if (Number.parseInt(initialDelayMs, 10) !== initialDelayMs || initialDelayMs < 0) {
    throw new TypeError('"retryOptions.initialDelayMs" value must be a non-negative integer');
  }

  if (Number.parseInt(maxAttempts, 10) !== maxAttempts || maxAttempts < 0) {
    throw new TypeError('"retryOptions.maxAttempts" value must be a a non-negative integer');
  }

  if (Number(exponent) !== exponent || exponent <= 0) {
    throw new TypeError('"retryOptions.exponent" value must be a positive number');
  }
};


text:
<?php

namespace luya\admin\proxy;

use Yii;
use yii\base\Object;
use Curl\Curl;
use yii\helpers\Json;
use yii\helpers\Console;

/**
 * Admin Proxy comands Sync Database.
 *
 * @property \yii\db\TableSchema $schema Schema object
 *
 * @author Basil Suter <basil@nadar.io>
 * @since 1.0.0
 */
class ClientTable extends Object
{
    private $_data;

    /**
     * @var \luya\admin\proxy\ClientBuild
     */
    public $build;

    /**
     *
     * @param ClientBuild $build
     * @param array $data
     * @param array $config
     */
    public function __construct(ClientBuild $build, array $data, array $config = [])
    {
        $this->build = $build;
        $this->_data = $data;
        parent::__construct($config);
    }

    private $_schema;

    public function getSchema()
    {
        if ($this->_schema === null) {
            $this->_schema = Yii::$app->db->getTableSchema($this->getName());
        }

        return $this->_schema;
    }

    public function getColumns()
    {
        return $this->schema->getColumnNames();
    }

    protected function cleanUpMatchRow($row)
    {
        $data = [];
        foreach ($row as $key => $item) {
            foreach ($item as $field => $value) {
                if (in_array($field, $this->getColumns())) {
                    $data[$key][$field] = $value;
                }
            }
        }

        return $data;
    }

    protected function cleanUpBatchInsertFields($fields)
    {
        $data = [];
        foreach ($fields as $field) {
            if (in_array($field, $this->getColumns())) {
                $data[] = $field;
            }
        }

        return $data;
    }

    public function getPks()
    {
        return $this->_data['pks'];
    }

    public function getName()
    {
        return $this->_data['name'];
    }

    public function getRows()
    {
        return $this->_data['rows'];
    }

    public function getFields()
    {
        return $this->_data['fields'];
    }

    public function getOffsetTotal()
    {
        return $this->_data['offset_total'];
    }

    public function isComplet()
    {
        return $this->getRows() == count($this->getContentRows());
    }

    private $_contentRows;

    public function getContentRows()
    {
        if ($this->_contentRows === null) {
            $data = [];

            Console::startProgress(0, $this->getOffsetTotal(), 'Fetch: ' . $this->getName() . ' ');

            $progress = 1;
            for ($i=0; $i<$this->getOffsetTotal(); $i++) {
                $data = array_merge($this->request($i), $data);
                gc_collect_cycles();
                Console::updateProgress($progress++, $this->getOffsetTotal());
            }

            Console::endProgress();
            $this->_contentRows = $data;
        }

        return $this->_contentRows;
    }

    public function syncData()
    {
        Yii::$app->db->createCommand()->truncateTable($this->getName())->execute();

        $rows = $this->getContentRows();

        $chunks = array_chunk($rows, 25);

        foreach ($chunks as $match) {
            Yii::$app->db->createCommand()->batchInsert($this->getName(), $this->cleanUpBatchInsertFields($this->getFields()), $this->cleanUpMatchRow($match))->execute();
        }
    }

    private function request($offset)
    {
        $curl = new Curl();
        $curl->get($this->build->requestUrl, ['machine' => $this->build->machineIdentifier, 'buildToken' => $this->build->buildToken, 'table' => $this->name, 'offset' => $offset]);

        if (!$curl->error) {
            $response = Json::decode($curl->response);
            $curl->close();
            unset($curl);
            return $response;
        }
    }
}


text:
package org.apache.http.impl.cookie;

import org.apache.http.annotation.Immutable;

import org.apache.http.cookie.Cookie;
import org.apache.http.cookie.CookieAttributeHandler;
import org.apache.http.cookie.CookieOrigin;
import org.apache.http.cookie.MalformedCookieException;
import org.apache.http.cookie.SetCookie;

/**
 *
 * @since 4.0
 */
@Immutable
public class BasicDomainHandler implements CookieAttributeHandler {

    public BasicDomainHandler() {
        super();
    }

    public void parse(final SetCookie cookie, final String value)
            throws MalformedCookieException {
        if (cookie == null) {
            throw new IllegalArgumentException("Cookie may not be null");
        }
        if (value == null) {
            throw new MalformedCookieException("Missing value for domain attribute");
        }
        if (value.trim().length() == 0) {
            throw new MalformedCookieException("Blank value for domain attribute");
        }
        cookie.setDomain(value);
    }

    public void validate(final Cookie cookie, final CookieOrigin origin)
            throws MalformedCookieException {
        if (cookie == null) {
            throw new IllegalArgumentException("Cookie may not be null");
        }
        if (origin == null) {
            throw new IllegalArgumentException("Cookie origin may not be null");
        }
        // Validate the cookies domain attribute.  NOTE:  Domains without
        // any dots are allowed to support hosts on private LANs that don't
        // have DNS names.  Since they have no dots, to domain-match the
        // request-host and domain must be identical for the cookie to sent
        // back to the origin-server.
        String host = origin.getHost();
        String domain = cookie.getDomain();
        if (domain == null) {
            throw new MalformedCookieException("Cookie domain may not be null");
        }
        if (host.contains(".")) {
            // Not required to have at least two dots.  RFC 2965.
            // A Set-Cookie2 with Domain=ajax.com will be accepted.

            // domain must match host
            if (!host.endsWith(domain)) {
                if (domain.startsWith(".")) {
                    domain = domain.substring(1, domain.length());
                }
                if (!host.equals(domain)) {
                    throw new MalformedCookieException(
                        "Illegal domain attribute \"" + domain
                        + "\". Domain of origin: \"" + host + "\"");
                }
            }
        } else {
            if (!host.equals(domain)) {
                throw new MalformedCookieException(
                    "Illegal domain attribute \"" + domain
                    + "\". Domain of origin: \"" + host + "\"");
            }
        }
    }

    public boolean match(final Cookie cookie, final CookieOrigin origin) {
        if (cookie == null) {
            throw new IllegalArgumentException("Cookie may not be null");
        }
        if (origin == null) {
            throw new IllegalArgumentException("Cookie origin may not be null");
        }
        String host = origin.getHost();
        String domain = cookie.getDomain();
        if (domain == null) {
            return false;
        }
        if (host.equals(domain)) {
            return true;
        }
        if (!domain.startsWith(".")) {
            domain = '.' + domain;
        }
        return host.endsWith(domain) || host.equals(domain.substring(1));
    }

}


text:
FBL.ns(function() { with (FBL) {
/*************************************************************************************/
var fcModel = Firecrow.Interpreter.Model;
var ValueTypeHelper = Firecrow.ValueTypeHelper;
fcModel.ArrayCallbackEvaluator =
{
    evaluateCallbackReturn: function(callbackCommand, returnValue, returnExpression)
    {
        try
        {
            var originatingObject = callbackCommand.originatingObject;

            var callbackFunctionValue = callbackCommand.callerFunction.jsValue;
            var targetObject = callbackCommand.targetObject;

            var valueCodeConstruct = returnExpression;

            if(valueCodeConstruct == null) { valueCodeConstruct = returnValue.codeConstruct; }

                 if(callbackFunctionValue.name == "filter") { this._evaluateFilterCallback(targetObject, returnValue, callbackCommand, valueCodeConstruct); return; }
            else if(callbackFunctionValue.name == "map") { this._evaluateMapCallback(targetObject, returnValue, valueCodeConstruct); return; }
            else if(callbackFunctionValue.name == "sort") { this._evaluateSortCallback(targetObject, returnValue, callbackCommand, valueCodeConstruct); return;}
            else if(callbackFunctionValue.name == "every") { this._evaluateEveryCallback(targetObject, returnValue, callbackCommand, valueCodeConstruct); return; }
            else if(callbackFunctionValue.name == "some") { this._evaluateSomeCallback(targetObject, returnValue, callbackCommand, valueCodeConstruct); return; }
            else if(callbackFunctionValue.name == "reduce") { this._evaluateReduceCallback(targetObject, returnValue, callbackCommand, valueCodeConstruct); return; }
            else if(callbackFunctionValue.name == "reduceRight") { fcModel.Array.notifyError("Still not handling evaluate return from reduceRight"); return; }
            else if(callbackFunctionValue.name == "forEach") { }
            else
            {
                debugger;
                fcModel.Array.notifyError("Unknown callbackFunction!");
            }
        }
        catch(e)
        {
            debugger;
            fcModel.Array.notifyError("Error when evaluating callback return!");
        }
    },

    _evaluateFilterCallback: function(targetObject, returnValue, callbackCommand, valueExpression)
    {
        var targetObjectValue = targetObject.jsValue;

        if(!ValueTypeHelper.isArray(targetObjectValue)) { fcModel.Array.notifyError("A new array should be created when calling filter: "); return; }

        if(returnValue != null && returnValue.jsValue)
        {
            targetObject.iValue.push(targetObjectValue, [callbackCommand.arguments[0]], valueExpression.argument || valueExpression);
        }
    },

    _evaluateMapCallback: function(targetObject, returnValue, valueExpression)
    {
        var targetObjectValue = targetObject.jsValue;

        if(!ValueTypeHelper.isArray(targetObjectValue)) { fcModel.Array.notifyError("A new array should be created when calling filter: "); return; }

        targetObject.iValue.push(targetObjectValue, [returnValue], valueExpression.argument || valueExpression);
    },

    _evaluateReduceCallback: function(targetObject, returnValue, callbackCommand, valueExpression)
    {
        var parentCommand = callbackCommand.parentInitCallbackCommand;
        var nextCommand = parentCommand.childCommands[callbackCommand.index + 1];

        if(nextCommand != null)
        {
            nextCommand.arguments[0] = returnValue;
        }
        else
        {
            parentCommand.originatingObject.iValue.globalObject.executionContextStack.setExpressionValueInPreviousContext(parentCommand.codeConstruct, returnValue);
        }
    },

    _evaluateSortCallback: function(targetObject, returnValue, callbackCommand, valueExpression)
    {
        var firstItem = callbackCommand.arguments[0];
        var secondItem = callbackCommand.arguments[1];

        var firstItemIndex = targetObject.jsValue.indexOf(firstItem);
        var secondItemIndex = targetObject.jsValue.indexOf(secondItem);

        targetObject.iValue.addModification(valueExpression, firstItemIndex);
        targetObject.iValue.addModification(callbackCommand.callCallbackCommand.codeConstruct, secondItemIndex);

        //if return value = 0 -> leave a and b unchanged
        if(returnValue.jsValue == 0) { return; }
        //if return value < 0 -> sort a to lower index than b;
        if(returnValue.jsValue < 0 && firstItemIndex <= secondItemIndex) { return; }
        //if return value > 0 -> sort b to lower index than a
        if(returnValue.jsValue > 0 && secondItemIndex <= firstItemIndex) { return; }

        this._swapArrayIndexes(targetObject, firstItemIndex, secondItemIndex, valueExpression);

        if(firstItemIndex + 1 < secondItemIndex)
        {
            this._swapArrayIndexes(targetObject, firstItemIndex + 1, secondItemIndex, valueExpression);
        }
    },

    _evaluateEveryCallback: function(targetObject, returnValue, callbackCommand)
    {
        var parentCommand = callbackCommand.parentInitCallbackCommand;
        parentCommand.originatingObject.iValue.globalObject.executionContextStack.setExpressionValueInPreviousContext(parentCommand.codeConstruct, returnValue);

        if(!returnValue.jsValue)
        {
            parentCommand.originatingObject.iValue.globalObject.browser.interpreter.removeOtherCallbackCommands(parentCommand)
        }
    },

    _evaluateSomeCallback: function(targetObject, returnValue, callbackCommand)
    {
        var parentCommand = callbackCommand.parentInitCallbackCommand;
        parentCommand.originatingObject.iValue.globalObject.executionContextStack.setExpressionValueInPreviousContext(parentCommand.codeConstruct, returnValue);

        if(returnValue.jsValue)
        {
            parentCommand.originatingObject.iValue.globalObject.browser.interpreter.removeOtherCallbackCommands(parentCommand)
        }
    },

    _swapArrayIndexes: function(arrayFcObject, indexA, indexB, modificationExpression)
    {
        var temp = arrayFcObject.jsValue[indexA];
        arrayFcObject.jsValue[indexA] = arrayFcObject.jsValue[indexB];
        arrayFcObject.jsValue[indexB] = temp;

        var temp = arrayFcObject.iValue.items[indexA];
        arrayFcObject.iValue.items[indexA] = arrayFcObject.iValue.items[indexB];
        arrayFcObject.iValue.items[indexB] = temp;

        arrayFcObject.iValue.addProperty(indexA, arrayFcObject.jsValue[indexA], modificationExpression, true);
        arrayFcObject.iValue.addProperty(indexB, arrayFcObject.jsValue[indexB], modificationExpression, true);
    }
};
/*************************************************************************************/
}});


text:
ACCEPTED

#### According to
IRMNG Homonym List

#### Published in
Handb. Allgem. mykol. (Stuttgart) 8 (1851)

#### Original name
Acrosporium Bonorden, 1851

### Remarks
null


text:
SequenceHandler = class SequenceHandler {
    constructor (action) {
        this.action = action;
        this.sequence = sequences.findOne(action.sequence);

        this.time = parseFloat(this.action.time);
        this.loop = this.sequence.settings.loop;
        this.duration = parseFloat(this.sequence.settings.duration);

        this.useBPM = this.sequence.settings.useBPM;
        if (this.useBPM == 'yes') {
            this.bpm = parseFloat(this.sequence.settings.bpm);
            this.beat = 60.0 / this.bpm;
            this.duration *= this.beat;
        }

        this.actions = actions.find({sequenceid: this.sequence._id}).fetch();

        if (this.useBPM == 'yes') {
            this.actions.forEach((action) => {
                if (action.type == 'light' || action.type == 'lightgroup' || action.type == 'lightscene')
                    action.settings.lights_fade = parseFloat(combineSettings(action.settings).lights_fade) * this.beat;
                if (action.type == 'media' || action.type == 'mediaplaylist')
                    action.settings.media_fade = parseFloat(combineSettings(action.settings).media_fade) * this.beat;
            });
        }

        this.start();
    }

    start () {
        var b = Date.now()
        this.sequence_handlers = {};
        this.timers = [];

        this.actions.forEach((action) => {
            if (this.useBPM == 'yes') {
                var time = this.time + (action.settings.sequence_start * this.beat) - 0.1;
            } else {
                var time = this.time + action.settings.sequence_start - 0.1;
            }

            action.time = time;
            action.stage = this.sequence.stage;

            console.log(action.defaulttitle, action.time * 1000 - Date.now(), action.settings.lights_fade);

            this.timers.push(
                Meteor.setTimeout(
                    () => this.do(action),
                    time * 1000 - Date.now()
                )
            );
        });

        if (this.loop == 'yes') {
            if (this.useBPM == 'yes') {
                this.time += this.duration;
                console.log('restart at', this.time * 1000 - Date.now());
                this.timers.push(Meteor.setTimeout(() => {this.stop(); this.start();}, this.time * 1000 - Date.now()));
            } else {
                this.time += this.duration;
                console.log('restart at', this.time, this.duration, this.time * 1000 - Date.now());
                this.timers.push(Meteor.setTimeout(() => {this.stop(); this.start();}, this.time * 1000 - Date.now()));
            }
        }
        console.log('start finished in', Date.now() - b)
    }

    do (action) {
        if (action.type == 'sequence') {
            this.sequence_handlers[action.settings.sequence_channel] = new SequenceHandler(action);
        }

        console.log('activating action', action.defaulttitle, action.time);
        action_activate(action);
    }

    stop () {
        for (var seq in this.sequence_handlers) {
            if (this.sequence_handlers.hasOwnProperty(seq)) seq.stop();
        }

        this.timers.forEach((timer) => {
            Meteor.clearTimeout(timer);
        });
    }
};


text:
{% extends './../frame.html' %}
{% block content %}

{% include "./../submissions/module_submissions.html" %}
{% end %}


text:
@class TagModel;
@interface VarietyDetailTableViewController : UITableViewController
- (instancetype)initWithModel:(TagModel *)model;
@end


text:
package com.myunihome.myxapp.paas.cache;

import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;

import com.myunihome.myxapp.paas.MyXAppConfHelper;
import com.myunihome.myxapp.paas.cache.client.ICacheClient;
import com.myunihome.myxapp.paas.cache.client.impl.CacheClient;
import com.myunihome.myxapp.paas.cache.client.impl.CacheClusterClient;
import com.myunihome.myxapp.paas.constants.MyXAppPaaSConstant;
import com.myunihome.myxapp.paas.model.CacheConfigInfo;
import com.myunihome.myxapp.paas.util.StringUtil;

public final class CacheFactory {

    private CacheFactory(){

    }
    private static final Log LOG = LogFactory.getLog(CacheFactory.class);
    private static Map<String, ICacheClient> cacheClients = new ConcurrentHashMap<String, ICacheClient>();

    public static ICacheClient getCacheClient(){
            return getCacheClient(MyXAppPaaSConstant.DEFAULT);
      }

    public static ICacheClient getCacheClient(String namespace){
        ICacheClient cacheClient = null;
        if(StringUtil.isBlank(namespace)){
        	namespace=MyXAppPaaSConstant.DEFAULT;
        }
        //String appDomain=MyXAppConfHelper.getInstance().getAppDomain();
        String appId=MyXAppConfHelper.getInstance().getAppId();
        String cacheClientId=appId+"$"+namespace;
        //获取配置信息
        LOG.info("Get CacheConfigInfo ...");
        CacheConfigInfo cacheConfigInfo=MyXAppConfHelper.getInstance().getCacheConfig(namespace);

        if (cacheClients.containsKey(cacheClientId)) {
          cacheClient = (ICacheClient)cacheClients.get(cacheClientId);
          return cacheClient;
        }
        LOG.info("Get hostAndPort ...");
        String[] hostAndPortArray = cacheConfigInfo.getJedisHostAndPorts().split(",");
        LOG.info("Get RedisClient ...");
        if (hostAndPortArray.length > 1) {
          cacheClient = new CacheClusterClient(cacheConfigInfo.getJedisPoolConfig(), hostAndPortArray);
        } else {
          cacheClient = new CacheClient(cacheConfigInfo.getJedisPoolConfig(), cacheConfigInfo.getJedisHostAndPorts());
        }
        LOG.info("Get RedisClient ...");
        cacheClients.put(cacheClientId, cacheClient);
        return cacheClient;
      }
}


text:
package edu.uiowa.icts.bluebutton.domain;

import java.util.Set;
import java.util.*;
import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.text.ParseException;
import java.util.Date;
import javax.persistence.*;
import javax.persistence.Entity;
import javax.persistence.Table;
import javax.persistence.Table;
import javax.persistence.Table;
import javax.persistence.Column;
import javax.persistence.FetchType;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import org.springframework.format.annotation.DateTimeFormat;
import org.hibernate.annotations.*;
import javax.persistence.CascadeType;
import edu.uiowa.icts.*;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;

/**
 * Generated by Protogen - www.icts.uiowa.edu/protogen
 * @since 01/27/2015 10:53:12 AM CST
 */
@Entity( name = "edu_uiowa_icts_bluebutton_domain_loincCodeCategory" )
@Table( name = "loinc_code_category", schema = "bluebutton" )
public class LoincCodeCategory {

	private static final Log log = LogFactory.getLog(LoincCodeCategory.class);

        private Integer id;
        private String loincCode;
        private String name;
        private String rootCategoryName;
        private String subrootCategoryName;

    /*****id*****/
    @javax.persistence.SequenceGenerator(  name="gen",  sequenceName="bluebutton.seqnum",allocationSize=1)
    @Id
    @GeneratedValue( strategy=GenerationType.AUTO,generator="gen")
    @Column(name = "id", unique = true, nullable = false)
    public Integer getId(){
        return id;
    }

    public void setId(Integer id){
        this.id = id;
    }

    /*****loincCode*****/
    @Column(name = "loinc_code")
    public String getLoincCode(){
        return loincCode;
    }

    public void setLoincCode(String loincCode){
        this.loincCode = loincCode;
    }

    /*****name*****/
    @Column(name = "name")
    public String getName(){
        return name;
    }

    public void setName(String name){
        this.name = name;
    }

    /*****rootCategoryName*****/
    @Column(name = "root_category_name")
    public String getRootCategoryName(){
        return rootCategoryName;
    }

    public void setRootCategoryName(String rootCategoryName){
        this.rootCategoryName = rootCategoryName;
    }

    /*****subrootCategoryName*****/
    @Column(name = "subroot_category_name")
    public String getSubrootCategoryName(){
        return subrootCategoryName;
    }

    public void setSubrootCategoryName(String subrootCategoryName){
        this.subrootCategoryName = subrootCategoryName;
    }

}


text:
package screens.test;

import al.qa.so.BaseScreen;
import al.qa.so.anno.ScreenParams;
import modules.test.ModLevel1;
import org.openqa.selenium.support.FindBy;

/**
 * @author Alexey Lyanguzov.
 */
@ScreenParams(urls="//dummy")
public class TestScreen1 extends BaseScreen {

    @FindBy
    protected ModLevel1 modLevel1;

}


text:
if (varname == nil)                     \
{                                       \
varname = [[vartype alloc] init];       \
}                                       \
return varname;                         \

@implementation HFactory

+(HFactory *)sharedFactory
{
    static HFactory *factory = nil;
    static dispatch_once_t onceToken;
    dispatch_once(&onceToken, ^{
        factory = [[HFactory alloc] init];
    });
    return factory;
}

- (HUserService *)userService
{
    GET_OR_CREATE(_userService, HUserService);
}

- (HMessageService *)messageService
{
    GET_OR_CREATE(_messageService, HMessageService);
}

@end


text:
shared_examples_for 'read and update access granted' do
  it 'should allow read' do
    expect(ability).to be_able_to(:read, resource, token) if token
    expect(ability).to be_able_to(:read, resource) unless token
  end

  it 'should allow update' do
    expect(ability).to be_able_to(:update, resource, token) if token
    expect(ability).to be_able_to(:update, resource) unless token
  end
end


text:
jazzy --clean --author "palle-k" --author_url https://github.com/palle-k --github_url https://github.com/palle-k/Covfefe --output docs/ --theme fullwidth --documentation BNF.md
rm -rf build


text:
.PHONY: all
all: snortSkydive

.PHONY: clean
clean:
	rm -rf snortSkydive

snortSkydive: snortSkydive.go
	govendor build -o $$GOPATH/bin/snort-skydive $<


text:
#pragma once

#include <vcclr.h>
#include "CsPipelineStateFlags.h"
#include "CsColor.h"

#using <System.dll>
#using <System.Core.dll>
#using <System.Runtime.InteropServices.dll>

using namespace System;
using namespace System::Runtime::InteropServices;
using namespace System::Collections::Generic;

namespace SharpLLGL
{

/* ----- Enumerations ----- */

public enum class SamplerAddressMode
{
    Repeat,
    Mirror,
    Clamp,
    Border,
    MirrorOnce,
};

public enum class SamplerFilter
{
    Nearest,
    Linear,
};

/* ----- Structures ----- */

public ref class SamplerDescriptor
{

    public:

        SamplerDescriptor();

        property SamplerAddressMode AddressModeU;
        property SamplerAddressMode AddressModeV;
        property SamplerAddressMode AddressModeW;
        property SamplerFilter      MinFilter;
        property SamplerFilter      MagFilter;
        property SamplerFilter      MipMapFilter;
        property bool               MipMapping;
        property float              MipMapLODBias;
        property float              MinLOD;
        property float              MaxLOD;
        property unsigned int       MaxAnisotropy;
        property bool               CompareEnabled;
        property CompareOp          CompareOp;
        property ColorRGBA<float>^  BorderColor;

};

} // /namespace SharpLLGL

// ================================================================================


text:
{% extends 'cms_content/cms_content_base.html' %}
{% load i18n menu_tags cms_tags content_tags avatar_tags %}

{% block title %}{{ article.title }}{% endblock title %}

{% block extra_head %}
  <link href="{{ MEDIA_URL }}css/cms_content.css" rel="stylesheet" type="text/css" />
{% endblock extra_head %}

{% block breadcrumb %}{{ block.super }}{% endblock breadcrumb %}

{% block cms_content_menu %}

{% show_menu 1 2 0 1 %}

{% endblock cms_content_menu %}

{% block col_right %}

{% trans "Article" %}:{{ article.title }}

{{ article.title }}

      {% trans 'written by author' %}: {{ article.created_by }}
      {{ article.created_date }}
      {% trans "Read Times" %}: {{ article.hits }}
      {% trans "Published in" %}: {{ article.category }}

Tags:{{ article.tags.name }}

{{ article.content|code_highlight }}

{% if request.user.is_authenticated %}{% include "cms_content/includes/comment_form.html" %}{% endif %}
{% endblock col_right %}

{% block topbar %}
{{ block.super }}
  {% if request.user.is_staff %}

    {% if article %}
    {% trans "Edit" %} |
    Delete |
    History |
    {% trans "Add another" %} {{ article.get_verbose_name }} |
    Manage {{ article.get_verbose_name_plural }} |
    {% endif %}

  {% endif %}
{% endblock %}

{% block control %}
add article |
delete article
{% endblock control %}


text:
import {EventEmitter, ViewChild, Output} from "@angular/core";
import {OasLibraryUtils, OasNode} from "oai-ts-core";
import {ICommand} from "../../_services/commands.manager";

import "brace/theme/eclipse";
import "brace/mode/json";
import {AceEditorDirective} from "ng2-ace-editor";
import {ObjectUtils} from "../../_util/object.util";

/**
 * Base class for all forms that support a "Source" tab.
 */
export abstract class SourceFormComponent<T extends OasNode> {

    private static library: OasLibraryUtils = new OasLibraryUtils();

    @Output() onCommand: EventEmitter<ICommand> = new EventEmitter<ICommand>();

    private _mode: string = "design";
    private _sourceNode: T;
    private _sourceJsObj: any = null;
    set sourceNode(node: T) {
        this._sourceNode = node;
        this._sourceJsObj = null;
    }
    get sourceNode(): T {
        return this._sourceNode;
    }

    @ViewChild("sourceEditor") sourceEditor: AceEditorDirective;

    private _source: any = {
        dirty: false,
        valid: false,
        value: null
    };

    public sourceJs(): any {
        if (this._sourceJsObj === null) {
            this._sourceJsObj = SourceFormComponent.library.writeNode(this.sourceNode);
        }
        return this._sourceJsObj;
    }

    public source(): string {
        return JSON.stringify(this.sourceJs(), null, 4);
    }

    public updateSource(newSource: any): void {
        try {
            let newJsObject: any = JSON.parse(newSource);
            let currentJsObj: any = this.sourceJs();
            this._source.dirty = !ObjectUtils.objectEquals(currentJsObj, newJsObject);
            this._source.value = SourceFormComponent.library.readNode(newJsObject, this.createEmptyNodeForSource());
            this._source.valid = true;
        } catch (e) {
            this._source.value = null;
            this._source.valid = false;
            this._source.dirty = true;
        }
    }

    protected abstract createEmptyNodeForSource(): T;

    public canFormatSource(): boolean {
        return this._source.valid;
    }

    public canRevertSource(): boolean {
        return this._source.dirty;
    }

    public canSaveSource(): boolean {
        return this._source.dirty && this._source.valid;
    }

    public revertSource(): void {
        this.sourceEditor.setText(this.source());
        this._source.dirty = false;
        this._source.value = null;
        this._source.valid = false;
    }

    public saveSource(): void {
        let command: ICommand = this.createReplaceNodeCommand(<T>this._source.value);
        this.onCommand.emit(command);
        this.sourceNode = this._source.value;
        this._source.dirty = false;
        this._source.value = null;
        this._source.valid = true;
    }

    public formatSource(): void {
        let nsrc: any = SourceFormComponent.library.writeNode(this._source.value);
        let nsrcStr: string = JSON.stringify(nsrc, null, 4);
        this.sourceEditor.setText(nsrcStr);
    }

    protected abstract createReplaceNodeCommand(node: T);

    public isDesignMode(): boolean {
        return this._mode === "design";
    }

    public isSourceMode(): boolean {
        return this._mode === "source";
    }

    public enableDesignMode(): void {
        // Cannot change tabs if the source editor is dirty.
        if (this._source.dirty) {
            return;
        }
        this._mode = "design";
    }

    public enableSourceMode(): void {
        this._mode = "source";
    }
}


text:
var express = require('express');
var path = require('path');
var favicon = require('serve-favicon');
var logger = require('morgan');
var cookieParser = require('cookie-parser');
var bodyParser = require('body-parser');

//var routes = require('./routes/index');
//var users = require('./routes/users');
//var datasetsRoutes = require('./routes/datasetsRoutes');
//var elementsRoutes = require('./routes/elementsRoutes');

var app = express();
var mongo = require('mongoskin');

// Setup Database is done in bin/www file
global.db = mongo.db("mongodb://ds051970.mongolab.com:51970/odp",{native_parser:true});

// view engine setup
app.set('views', path.join(__dirname, 'views'));
app.set('view engine', 'jade');
app.set("jsonp callback", true);

//enable cross-site scripting
app.use(function(req, res, next) {
    res.header("Access-Control-Allow-Origin", "*");
    res.header("Access-Control-Allow-Headers", "X-Requested-With");
    res.header('Access-Control-Allow-Methods', 'PUT, GET, POST, PATCH, DELETE, OPTIONS');
    res.header('Access-Control-Allow-Headers', 'Content-Type');
    next();
});

// uncomment after placing your favicon in /public
//app.use(favicon(__dirname + '/public/favicon.ico'));
app.use(logger('dev'));
app.use(bodyParser.json());
app.use(bodyParser.urlencoded({ extended: false }));
app.use(cookieParser());
app.use(express.static(path.join(__dirname, 'public')));

// load all controller routes
var router = express.Router();
var routes = require('./app/app_main.js')(router);
app.use('/', router);

//app.use('/', routes);
//app.use('/users', users);
//app.use('/datasets', datasetsRoutes);
//app.use('/datasets/:dsname/elements', elementsRoutes);

// catch 404 and forward to error handler
app.use(function(req, res, next) {
    var err = new Error('Not Found');
    err.status = 404;
    next(err);
});

// error handlers

// development error handler
// will print stacktrace
if (app.get('env') === 'development') {
    app.use(function(err, req, res, next) {
        res.status(err.status || 500);
        res.render('error', {
            message: err.message,
            error: err
        });
    });
}

// production error handler
// no stacktraces leaked to user
app.use(function(err, req, res, next) {
    res.status(err.status || 500);
    res.render('error', {
        message: err.message,
        error: {}
    });
});

module.exports = app;


text:
'use strict';

/**
 * @ngdoc function
 * @name loopbackApp.controller:AppCtrl
 * @description
 * # MainCtrl
 * Controller of the loopbackApp
 */
angular.module('loopbackApp')
  .config(function($stateProvider) {
    $stateProvider
    .state('app', {
      abstract: true,
      url: '/app',
      templateUrl: 'views/app.html',
      controller: 'MainCtrl'
    });
  })
  .controller('MainCtrl', function ($scope, $state, $location, $notification, AppAuth, User) {

    AppAuth.ensureHasCurrentUser(User);
    $scope.currentUser = AppAuth.currentUser;

    $scope.menuoptions = [{
      name: 'Home',
      sref: 'app.home'
    } , {
      name: 'Items',
      sref: 'app.items.list'
    }];

    $scope.toplinks = [{
      name: 'Logout',
      action: function() {
        User.logout(function() {
          $scope.currentUser = AppAuth.currentUser = null;
          $state.go('login');
          $notification.info('Logged out', 'You are logged out!');
        });
      }
    }];

  });


text:
<scalastyle>
  <name>Scalastyle standard configuration</name>
  <check level="error" class="org.scalastyle.file.FileTabChecker" enabled="true"></check>
  <check level="error" class="org.scalastyle.file.FileLengthChecker" enabled="true">
    <parameters>
      <parameter name="maxFileLength"><![CDATA[800]]></parameter>
    </parameters>
  </check>
  <check level="error" class="org.scalastyle.file.HeaderMatchesChecker" enabled="false"></check>
  <check level="error" class="org.scalastyle.scalariform.SpacesAfterPlusChecker" enabled="true"></check>
  <check level="error" class="org.scalastyle.file.WhitespaceEndOfLineChecker" enabled="true"></check>
  <check level="error" class="org.scalastyle.scalariform.SpacesBeforePlusChecker" enabled="true"></check>
  <check level="error" class="org.scalastyle.scalariform.ProcedureDeclarationChecker" enabled="true"></check>
  <check level="error" class="org.scalastyle.file.FileLineLengthChecker" enabled="true">
    <parameters>
      <parameter name="maxLineLength"><![CDATA[160]]></parameter>
      <parameter name="tabSize"><![CDATA[2]]></parameter>
    </parameters>
  </check>
  <check level="error" class="org.scalastyle.scalariform.ClassNamesChecker" enabled="true">
    <parameters>
      <parameter name="regex"><![CDATA[[A-Z][A-Za-z]*]]></parameter>
    </parameters>
  </check>
  <check level="error" class="org.scalastyle.scalariform.ObjectNamesChecker" enabled="true">
    <parameters>
      <parameter name="regex"><![CDATA[[A-Z][A-Za-z]*]]></parameter>
    </parameters>
  </check>
  <check level="error" class="org.scalastyle.scalariform.PackageObjectNamesChecker" enabled="true">
    <parameters>
      <parameter name="regex"><![CDATA[^[a-z][A-Za-z]*$]]></parameter>
    </parameters>
  </check>
  <check level="error" class="org.scalastyle.scalariform.EqualsHashCodeChecker" enabled="true"></check>
  <check level="error" class="org.scalastyle.scalariform.IllegalImportsChecker" enabled="true">
    <parameters>
      <parameter name="illegalImports"><![CDATA[sun._,java.awt._]]></parameter>
    </parameters>
  </check>
  <check level="error" class="org.scalastyle.scalariform.ParameterNumberChecker" enabled="true">
    <parameters>
      <parameter name="maxParameters"><![CDATA[8]]></parameter>
    </parameters>
  </check>
  <check level="error" class="org.scalastyle.scalariform.MagicNumberChecker" enabled="true">
    <parameters>
      <parameter name="ignore"><![CDATA[-1,0,1,2,3]]></parameter>
    </parameters>
  </check>
  <check level="error" class="org.scalastyle.scalariform.NoWhitespaceBeforeLeftBracketChecker" enabled="true"></check>
  <check level="error" class="org.scalastyle.scalariform.NoWhitespaceAfterLeftBracketChecker" enabled="true"></check>
  <check level="error" class="org.scalastyle.scalariform.ReturnChecker" enabled="true"></check>
  <check level="error" class="org.scalastyle.scalariform.NullChecker" enabled="true"></check>
  <check level="error" class="org.scalastyle.scalariform.NoCloneChecker" enabled="true"></check>
  <check level="error" class="org.scalastyle.scalariform.NoFinalizeChecker" enabled="true"></check>
  <check level="error" class="org.scalastyle.scalariform.CovariantEqualsChecker" enabled="true"></check>
  <check level="error" class="org.scalastyle.scalariform.StructuralTypeChecker" enabled="true"></check>
  <check level="error" class="org.scalastyle.file.RegexChecker" enabled="true">
    <parameters>
      <parameter name="regex"><![CDATA[println]]></parameter>
    </parameters>
  </check>
  <check level="error" class="org.scalastyle.scalariform.NumberOfTypesChecker" enabled="true">
    <parameters>
      <parameter name="maxTypes"><![CDATA[30]]></parameter>
    </parameters>
  </check>
  <check level="error" class="org.scalastyle.scalariform.CyclomaticComplexityChecker" enabled="true">
    <parameters>
      <parameter name="maximum"><![CDATA[10]]></parameter>
    </parameters>
  </check>
  <check level="error" class="org.scalastyle.scalariform.UppercaseLChecker" enabled="true"></check>
  <check level="error" class="org.scalastyle.scalariform.SimplifyBooleanExpressionChecker" enabled="true"></check>
  <check level="error" class="org.scalastyle.scalariform.IfBraceChecker" enabled="true">
    <parameters>
      <parameter name="singleLineAllowed"><![CDATA[true]]></parameter>
      <parameter name="doubleLineAllowed"><![CDATA[false]]></parameter>
    </parameters>
  </check>
  <check level="error" class="org.scalastyle.scalariform.MethodLengthChecker" enabled="true">
    <parameters>
      <parameter name="maxLength"><![CDATA[50]]></parameter>
    </parameters>
  </check>
  <check level="error" class="org.scalastyle.scalariform.MethodNamesChecker" enabled="true">
    <parameters>
      <parameter name="regex"><![CDATA[^[a-z][A-Za-z0-9]*$]]></parameter>
    </parameters>
  </check>
  <check level="error" class="org.scalastyle.scalariform.NumberOfMethodsInTypeChecker" enabled="true">
    <parameters>
      <parameter name="maxMethods"><![CDATA[30]]></parameter>
    </parameters>
  </check>
  <check level="error" class="org.scalastyle.scalariform.PublicMethodsHaveTypeChecker" enabled="true"></check>
  <check level="error" class="org.scalastyle.file.NewLineAtEofChecker" enabled="true"></check>
  <check level="error" class="org.scalastyle.file.NoNewLineAtEofChecker" enabled="false"></check>
  <check level="error" class="org.scalastyle.file.RegexChecker" enabled="true">
    <parameters>
        <parameter name="regex">((lazy)\s+(override|private|protected|final|implicit))|((implicit)\s+(override|private|protected|final))|((final)\s+(override|private|protected))|((private|protected)\s+(override))</parameter>
    </parameters>
    <customMessage>Modifiers should be declared in the following order: "override access (private|protected) final implicit lazy".</customMessage>
  </check>
</scalastyle>