text:
package org.swtk.commons.dict.wiktionary.controller;  import org.swtk.common.dict.dto.wiktionary.Entry;  import org.swtk.commons.dict.wiktionary.generated.c.a.b.*;
import org.swtk.commons.dict.wiktionary.generated.c.a.c.*;
import org.swtk.commons.dict.wiktionary.generated.c.a.d.*;
import org.swtk.commons.dict.wiktionary.generated.c.a.e.*;
import org.swtk.commons.dict.wiktionary.generated.c.a.f.*;
import org.swtk.commons.dict.wiktionary.generated.c.a.g.*;
import org.swtk.commons.dict.wiktionary.generated.c.a.h.*;
import org.swtk.commons.dict.wiktionary.generated.c.a.i.*;
import org.swtk.commons.dict.wiktionary.generated.c.a.j.*;
import org.swtk.commons.dict.wiktionary.generated.c.a.k.*;
import org.swtk.commons.dict.wiktionary.generated.c.a.l.*;
import org.swtk.commons.dict.wiktionary.generated.c.a.m.*;
import org.swtk.commons.dict.wiktionary.generated.c.a.n.*;
import org.swtk.commons.dict.wiktionary.generated.c.a.o.*;
import org.swtk.commons.dict.wiktionary.generated.c.a.p.*;
import org.swtk.commons.dict.wiktionary.generated.c.a.r.*;
import org.swtk.commons.dict.wiktionary.generated.c.a.s.*;
import org.swtk.commons.dict.wiktionary.generated.c.a.t.*;
import org.swtk.commons.dict.wiktionary.generated.c.a.u.*;
import org.swtk.commons.dict.wiktionary.generated.c.a.v.*;
import org.swtk.commons.dict.wiktionary.generated.c.c.c.*;
import org.swtk.commons.dict.wiktionary.generated.c.d.a.*;
import org.swtk.commons.dict.wiktionary.generated.c.d.d.*;
import org.swtk.commons.dict.wiktionary.generated.c.e.a.*;
import org.swtk.commons.dict.wiktionary.generated.c.e.b.*;
import org.swtk.commons.dict.wiktionary.generated.c.e.c.*;
import org.swtk.commons.dict.wiktionary.generated.c.e.d.*;
import org.swtk.commons.dict.wiktionary.generated.c.e.f.*;
import org.swtk.commons.dict.wiktionary.generated.c.e.i.*;
import org.swtk.commons.dict.wiktionary.generated.c.e.l.*;
import org.swtk.commons.dict.wiktionary.generated.c.e.m.*;
import org.swtk.commons.dict.wiktionary.generated.c.e.n.*;
import org.swtk.commons.dict.wiktionary.generated.c.e.p.*;
import org.swtk.commons.dict.wiktionary.generated.c.e.r.*;
import org.swtk.commons.dict.wiktionary.generated.c.e.s.*;
import org.swtk.commons.dict.wiktionary.generated.c.e.t.*;
import org.swtk.commons.dict.wiktionary.generated.c.e.v.*;
import org.swtk.commons.dict.wiktionary.generated.c.h.a.*;
import org.swtk.commons.dict.wiktionary.generated.c.h.e.*;
import org.swtk.commons.dict.wiktionary.generated.c.h.i.*;
import org.swtk.commons.dict.wiktionary.generated.c.h.l.*;
import org.swtk.commons.dict.wiktionary.generated.c.h.n.*;
import org.swtk.commons.dict.wiktionary.generated.c.h.o.*;
import org.swtk.commons.dict.wiktionary.generated.c.h.r.*;
import org.swtk.commons.dict.wiktionary.generated.c.h.t.*;
import org.swtk.commons.dict.wiktionary.generated.c.h.u.*;
import org.swtk.commons.dict.wiktionary.generated.c.h.w.*;
import org.swtk.commons.dict.wiktionary.generated.c.h.y.*;
import org.swtk.commons.dict.wiktionary.generated.c.i.a.*;
import org.swtk.commons.dict.wiktionary.generated.c.i.c.*;
import org.swtk.commons.dict.wiktionary.generated.c.i.d.*;
import org.swtk.commons.dict.wiktionary.generated.c.i.g.*;
import org.swtk.commons.dict.wiktionary.generated.c.i.l.*;
import org.swtk.commons.dict.wiktionary.generated.c.i.m.*;
import org.swtk.commons.dict.wiktionary.generated.c.i.n.*;
import org.swtk.commons.dict.wiktionary.generated.c.i.o.*;
import org.swtk.commons.dict.wiktionary.generated.c.i.p.*;
import org.swtk.commons.dict.wiktionary.generated.c.i.r.*;
import org.swtk.commons.dict.wiktionary.generated.c.i.s.*;
import org.swtk.commons.dict.wiktionary.generated.c.i.t.*;
import org.swtk.commons.dict.wiktionary.generated.c.i.v.*;
import org.swtk.commons.dict.wiktionary.generated.c.l.a.*;
import org.swtk.commons.dict.wiktionary.generated.c.l.e.*;
import org.swtk.commons.dict.wiktionary.generated.c.l.i.*;
import org.swtk.commons.dict.wiktionary.generated.c.l.o.*;
import org.swtk.commons.dict.wiktionary.generated.c.l.u.*;
import org.swtk.commons.dict.wiktionary.generated.c.l.y.*;
import org.swtk.commons.dict.wiktionary.generated.c.m.a.*;
import org.swtk.commons.dict.wiktionary.generated.c.m.e.*;
import org.swtk.commons.dict.wiktionary.generated.c.n.i.*;
import org.swtk.commons.dict.wiktionary.generated.c.o.a.*;
import org.swtk.commons.dict.wiktionary.generated.c.o.b.*;
import org.swtk.commons.dict.wiktionary.generated.c.o.c.*;
import org.swtk.commons.dict.wiktionary.generated.c.o.d.*;
import org.swtk.commons.dict.wiktionary.generated.c.o.e.*;
import org.swtk.commons.dict.wiktionary.generated.c.o.f.*;
import org.swtk.commons.dict.wiktionary.generated.c.o.g.*;
import org.swtk.commons.dict.wiktionary.generated.c.o.h.*;
import org.swtk.commons.dict.wiktionary.generated.c.o.i.*;
import org.swtk.commons.dict.wiktionary.generated.c.o.j.*;
import org.swtk.commons.dict.wiktionary.generated.c.o.k.*;
import org.swtk.commons.dict.wiktionary.generated.c.o.l.*;
import org.swtk.commons.dict.wiktionary.generated.c.o.m.*;
import org.swtk.commons.dict.wiktionary.generated.c.o.n.*;
import org.swtk.commons.dict.wiktionary.generated.c.o.o.*;
import org.swtk.commons.dict.wiktionary.generated.c.o.p.*;
import org.swtk.commons.dict.wiktionary.generated.c.o.q.*;
import org.swtk.commons.dict.wiktionary.generated.c.o.r.*;
import org.swtk.commons.dict.wiktionary.generated.c.o.s.*;
import org.swtk.commons.dict.wiktionary.generated.c.o.t.*;
import org.swtk.commons.dict.wiktionary.generated.c.o.u.*;
import org.swtk.commons.dict.wiktionary.generated.c.o.v.*;
import org.swtk.commons.dict.wiktionary.generated.c.o.w.*;
import org.swtk.commons.dict.wiktionary.generated.c.o.x.*;
import org.swtk.commons.dict.wiktionary.generated.c.o.y.*;
import org.swtk.commons.dict.wiktionary.generated.c.o.z.*;
import org.swtk.commons.dict.wiktionary.generated.c.p.c.*;
import org.swtk.commons.dict.wiktionary.generated.c.r.a.*;
import org.swtk.commons.dict.wiktionary.generated.c.r.e.*;
import org.swtk.commons.dict.wiktionary.generated.c.r.i.*;
import org.swtk.commons.dict.wiktionary.generated.c.r.o.*;
import org.swtk.commons.dict.wiktionary.generated.c.r.u.*;
import org.swtk.commons.dict.wiktionary.generated.c.r.w.*;
import org.swtk.commons.dict.wiktionary.generated.c.r.y.*;
import org.swtk.commons.dict.wiktionary.generated.c.s.i.*;
import org.swtk.commons.dict.wiktionary.generated.c.t.e.*;
import org.swtk.commons.dict.wiktionary.generated.c.u.a.*;
import org.swtk.commons.dict.wiktionary.generated.c.u.b.*;
import org.swtk.commons.dict.wiktionary.generated.c.u.c.*;
import org.swtk.commons.dict.wiktionary.generated.c.u.d.*;
import org.swtk.commons.dict.wiktionary.generated.c.u.i.*;
import org.swtk.commons.dict.wiktionary.generated.c.u.j.*;
import org.swtk.commons.dict.wiktionary.generated.c.u.l.*;
import org.swtk.commons.dict.wiktionary.generated.c.u.m.*;
import org.swtk.commons.dict.wiktionary.generated.c.u.n.*;
import org.swtk.commons.dict.wiktionary.generated.c.u.p.*;
import org.swtk.commons.dict.wiktionary.generated.c.u.r.*;
import org.swtk.commons.dict.wiktionary.generated.c.u.s.*;
import org.swtk.commons.dict.wiktionary.generated.c.u.t.*;
import org.swtk.commons.dict.wiktionary.generated.c.u.v.*;
import org.swtk.commons.dict.wiktionary.generated.c.w.t.*;
import org.swtk.commons.dict.wiktionary.generated.c.y.a.*;
import org.swtk.commons.dict.wiktionary.generated.c.y.b.*;
import org.swtk.commons.dict.wiktionary.generated.c.y.c.*;
import org.swtk.commons.dict.wiktionary.generated.c.y.g.*;
import org.swtk.commons.dict.wiktionary.generated.c.y.l.*;
import org.swtk.commons.dict.wiktionary.generated.c.y.m.*;
import org.swtk.commons.dict.wiktionary.generated.c.y.n.*;
import org.swtk.commons.dict.wiktionary.generated.c.y.p.*;
import org.swtk.commons.dict.wiktionary.generated.c.y.r.*;
import org.swtk.commons.dict.wiktionary.generated.c.y.s.*;
import org.swtk.commons.dict.wiktionary.generated.c.y.t.*;
import org.swtk.commons.dict.wiktionary.generated.c.y.w.*;
import org.swtk.commons.dict.wiktionary.generated.c.z.a.*;
import org.swtk.commons.dict.wiktionary.generated.c.z.e.*;   public final class WiktionaryDbC {  	public static Entry findByName(String name) { 		if (name.length() < 4) return null;  		String sub = name.substring(0, 3).toLowerCase(); 			 if ("cab".equals(sub)) return WiktionaryCAB000.get(name);
	else if ("cac".equals(sub)) return WiktionaryCAC000.get(name);
	else if ("cad".equals(sub)) return WiktionaryCAD000.get(name);
	else if ("cae".equals(sub)) return WiktionaryCAE000.get(name);
	else if ("caf".equals(sub)) return WiktionaryCAF000.get(name);
	else if ("cag".equals(sub)) return WiktionaryCAG000.get(name);
	else if ("cah".equals(sub)) return WiktionaryCAH000.get(name);
	else if ("cai".equals(sub)) return WiktionaryCAI000.get(name);
	else if ("caj".equals(sub)) return WiktionaryCAJ000.get(name);
	else if ("cak".equals(sub)) return WiktionaryCAK000.get(name);
	else if ("cal".equals(sub)) return WiktionaryCAL000.get(name);
	else if ("cam".equals(sub)) return WiktionaryCAM000.get(name);
	else if ("can".equals(sub)) return WiktionaryCAN000.get(name);
	else if ("cao".equals(sub)) return WiktionaryCAO000.get(name);
	else if ("cap".equals(sub)) return WiktionaryCAP000.get(name);
	else if ("car".equals(sub)) return WiktionaryCAR000.get(name);
	else if ("cas".equals(sub)) return WiktionaryCAS000.get(name);
	else if ("cat".equals(sub)) return WiktionaryCAT000.get(name);
	else if ("cau".equals(sub)) return WiktionaryCAU000.get(name);
	else if ("cav".equals(sub)) return WiktionaryCAV000.get(name);
	else if ("ccc".equals(sub)) return WiktionaryCCC000.get(name);
	else if ("cda".equals(sub)) return WiktionaryCDA000.get(name);
	else if ("cdd".equals(sub)) return WiktionaryCDD000.get(name);
	else if ("cea".equals(sub)) return WiktionaryCEA000.get(name);
	else if ("ceb".equals(sub)) return WiktionaryCEB000.get(name);
	else if ("cec".equals(sub)) return WiktionaryCEC000.get(name);
	else if ("ced".equals(sub)) return WiktionaryCED000.get(name);
	else if ("cef".equals(sub)) return WiktionaryCEF000.get(name);
	else if ("cei".equals(sub)) return WiktionaryCEI000.get(name);
	else if ("cel".equals(sub)) return WiktionaryCEL000.get(name);
	else if ("cem".equals(sub)) return WiktionaryCEM000.get(name);
	else if ("cen".equals(sub)) return WiktionaryCEN000.get(name);
	else if ("cep".equals(sub)) return WiktionaryCEP000.get(name);
	else if ("cer".equals(sub)) return WiktionaryCER000.get(name);
	else if ("ces".equals(sub)) return WiktionaryCES000.get(name);
	else if ("cet".equals(sub)) return WiktionaryCET000.get(name);
	else if ("cev".equals(sub)) return WiktionaryCEV000.get(name);
	else if ("cha".equals(sub)) return WiktionaryCHA000.get(name);
	else if ("che".equals(sub)) return WiktionaryCHE000.get(name);
	else if ("chi".equals(sub)) return WiktionaryCHI000.get(name);
	else if ("chl".equals(sub)) return WiktionaryCHL000.get(name);
	else if ("chn".equals(sub)) return WiktionaryCHN000.get(name);
	else if ("cho".equals(sub)) return WiktionaryCHO000.get(name);
	else if ("chr".equals(sub)) return WiktionaryCHR000.get(name);
	else if ("cht".equals(sub)) return WiktionaryCHT000.get(name);
	else if ("chu".equals(sub)) return WiktionaryCHU000.get(name);
	else if ("chw".equals(sub)) return WiktionaryCHW000.get(name);
	else if ("chy".equals(sub)) return WiktionaryCHY000.get(name);
	else if ("cia".equals(sub)) return WiktionaryCIA000.get(name);
	else if ("cic".equals(sub)) return WiktionaryCIC000.get(name);
	else if ("cid".equals(sub)) return WiktionaryCID000.get(name);
	else if ("cig".equals(sub)) return WiktionaryCIG000.get(name);
	else if ("cil".equals(sub)) return WiktionaryCIL000.get(name);
	else if ("cim".equals(sub)) return WiktionaryCIM000.get(name);
	else if ("cin".equals(sub)) return WiktionaryCIN000.get(name);
	else if ("cio".equals(sub)) return WiktionaryCIO000.get(name);
	else if ("cip".equals(sub)) return WiktionaryCIP000.get(name);
	else if ("cir".equals(sub)) return WiktionaryCIR000.get(name);
	else if ("cis".equals(sub)) return WiktionaryCIS000.get(name);
	else if ("cit".equals(sub)) return WiktionaryCIT000.get(name);
	else if ("civ".equals(sub)) return WiktionaryCIV000.get(name);
	else if ("cla".equals(sub)) return WiktionaryCLA000.get(name);
	else if ("cle".equals(sub)) return WiktionaryCLE000.get(name);
	else if ("cli".equals(sub)) return WiktionaryCLI000.get(name);
	else if ("clo".equals(sub)) return WiktionaryCLO000.get(name);
	else if ("clu".equals(sub)) return WiktionaryCLU000.get(name);
	else if ("cly".equals(sub)) return WiktionaryCLY000.get(name);
	else if ("cma".equals(sub)) return WiktionaryCMA000.get(name);
	else if ("cme".equals(sub)) return WiktionaryCME000.get(name);
	else if ("cni".equals(sub)) return WiktionaryCNI000.get(name);
	else if ("coa".equals(sub)) return WiktionaryCOA000.get(name);
	else if ("cob".equals(sub)) return WiktionaryCOB000.get(name);
	else if ("coc".equals(sub)) return WiktionaryCOC000.get(name);
	else if ("cod".equals(sub)) return WiktionaryCOD000.get(name);
	else if ("coe".equals(sub)) return WiktionaryCOE000.get(name);
	else if ("cof".equals(sub)) return WiktionaryCOF000.get(name);
	else if ("cog".equals(sub)) return WiktionaryCOG000.get(name);
	else if ("coh".equals(sub)) return WiktionaryCOH000.get(name);
	else if ("coi".equals(sub)) return WiktionaryCOI000.get(name);
	else if ("coj".equals(sub)) return WiktionaryCOJ000.get(name);
	else if ("cok".equals(sub)) return WiktionaryCOK000.get(name);
	else if ("col".equals(sub)) return WiktionaryCOL000.get(name);
	else if ("com".equals(sub)) return WiktionaryCOM000.get(name);
	else if ("con".equals(sub)) return WiktionaryCON000.get(name);
	else if ("coo".equals(sub)) return WiktionaryCOO000.get(name);
	else if ("cop".equals(sub)) return WiktionaryCOP000.get(name);
	else if ("coq".equals(sub)) return WiktionaryCOQ000.get(name);
	else if ("cor".equals(sub)) return WiktionaryCOR000.get(name);
	else if ("cos".equals(sub)) return WiktionaryCOS000.get(name);
	else if ("cot".equals(sub)) return WiktionaryCOT000.get(name);
	else if ("cou".equals(sub)) return WiktionaryCOU000.get(name);
	else if ("cov".equals(sub)) return WiktionaryCOV000.get(name);
	else if ("cow".equals(sub)) return WiktionaryCOW000.get(name);
	else if ("cox".equals(sub)) return WiktionaryCOX000.get(name);
	else if ("coy".equals(sub)) return WiktionaryCOY000.get(name);
	else if ("coz".equals(sub)) return WiktionaryCOZ000.get(name);
	else if ("cpc".equals(sub)) return WiktionaryCPC000.get(name);
	else if ("cra".equals(sub)) return WiktionaryCRA000.get(name);
	else if ("cre".equals(sub)) return WiktionaryCRE000.get(name);
	else if ("cri".equals(sub)) return WiktionaryCRI000.get(name);
	else if ("cro".equals(sub)) return WiktionaryCRO000.get(name);
	else if ("cru".equals(sub)) return WiktionaryCRU000.get(name);
	else if ("crw".equals(sub)) return WiktionaryCRW000.get(name);
	else if ("cry".equals(sub)) return WiktionaryCRY000.get(name);
	else if ("csi".equals(sub)) return WiktionaryCSI000.get(name);
	else if ("cte".equals(sub)) return WiktionaryCTE000.get(name);
	else if ("cua".equals(sub)) return WiktionaryCUA000.get(name);
	else if ("cub".equals(sub)) return WiktionaryCUB000.get(name);
	else if ("cuc".equals(sub)) return WiktionaryCUC000.get(name);
	else if ("cud".equals(sub)) return WiktionaryCUD000.get(name);
	else if ("cui".equals(sub)) return WiktionaryCUI000.get(name);
	else if ("cuj".equals(sub)) return WiktionaryCUJ000.get(name);
	else if ("cul".equals(sub)) return WiktionaryCUL000.get(name);
	else if ("cum".equals(sub)) return WiktionaryCUM000.get(name);
	else if ("cun".equals(sub)) return WiktionaryCUN000.get(name);
	else if ("cup".equals(sub)) return WiktionaryCUP000.get(name);
	else if ("cur".equals(sub)) return WiktionaryCUR000.get(name);
	else if ("cus".equals(sub)) return WiktionaryCUS000.get(name);
	else if ("cut".equals(sub)) return WiktionaryCUT000.get(name);
	else if ("cuv".equals(sub)) return WiktionaryCUV000.get(name);
	else if ("cwt".equals(sub)) return WiktionaryCWT000.get(name);
	else if ("cya".equals(sub)) return WiktionaryCYA000.get(name);
	else if ("cyb".equals(sub)) return WiktionaryCYB000.get(name);
	else if ("cyc".equals(sub)) return WiktionaryCYC000.get(name);
	else if ("cyg".equals(sub)) return WiktionaryCYG000.get(name);
	else if ("cyl".equals(sub)) return WiktionaryCYL000.get(name);
	else if ("cym".equals(sub)) return WiktionaryCYM000.get(name);
	else if ("cyn".equals(sub)) return WiktionaryCYN000.get(name);
	else if ("cyp".equals(sub)) return WiktionaryCYP000.get(name);
	else if ("cyr".equals(sub)) return WiktionaryCYR000.get(name);
	else if ("cys".equals(sub)) return WiktionaryCYS000.get(name);
	else if ("cyt".equals(sub)) return WiktionaryCYT000.get(name);
	else if ("cyw".equals(sub)) return WiktionaryCYW000.get(name);
	else if ("cza".equals(sub)) return WiktionaryCZA000.get(name);
	else if ("cze".equals(sub)) return WiktionaryCZE000.get(name);
  		return null; 	} }


text:
<?php

namespace Paracall\Controllers;

class HomeController extends Controller{

    public function index(){

        return $this->renderView('home');

    }

}

redpajama_set_name: RedPajamaGithub


text:
NativeBrowserFrame* NativeBrowserFrameFactory::Create(
    BrowserFrame* browser_frame,
    BrowserView* browser_view) {
  return new BrowserFrameWin(browser_frame, browser_view);
}


text:
package com.twitter.scalding.macros.impl

import scala.language.experimental.macros
import scala.reflect.macros.Context
import scala.util.Random

import com.twitter.scalding._
import com.twitter.bijection.macros.{ IsCaseClass, MacroGenerated }
import com.twitter.bijection.macros.impl.IsCaseClassImpl
/**
 * This class contains the core macro implementations. This is in a separate module to allow it to be in
 * a separate compilation unit, which makes it easier to provide helper methods interfacing with macros.
 */

object TupleConverterImpl {
  def caseClassTupleConverterImpl[T](c: Context)(implicit T: c.WeakTypeTag[T]): c.Expr[TupleConverter[T]] =
    caseClassTupleConverterCommonImpl(c, false)

  def caseClassTupleConverterWithUnknownImpl[T](c: Context)(implicit T: c.WeakTypeTag[T]): c.Expr[TupleConverter[T]] =
    caseClassTupleConverterCommonImpl(c, true)

  def caseClassTupleConverterCommonImpl[T](c: Context, allowUnknownTypes: Boolean)(implicit T: c.WeakTypeTag[T]): c.Expr[TupleConverter[T]] = {
    import c.universe._

    import TypeDescriptorProviderImpl.{ optionInner, evidentColumn }

    def membersOf(outerTpe: Type): Vector[Type] =
      outerTpe
        .declarations
        .collect { case m: MethodSymbol if m.isCaseAccessor => m }
        .map { accessorMethod =>
          accessorMethod.returnType.asSeenFrom(outerTpe, outerTpe.typeSymbol.asClass)
        }
        .toVector

    sealed trait ConverterBuilder {
      def columns: Int
      def applyTree(offset: Int): Tree
    }
    final case class PrimitiveBuilder(primitiveGetter: Int => Tree) extends ConverterBuilder {
      def columns = 1
      def applyTree(offset: Int) = primitiveGetter(offset)
    }
    final case class OptionBuilder(evidentCol: Int, of: ConverterBuilder) extends ConverterBuilder {
      def columns = of.columns
      def applyTree(offset: Int) = {
        val testIdx = offset + evidentCol
        q"""if (t.getObject($testIdx) == null) None
            else Some(${of.applyTree(offset)})"""
      }
    }
    final case class CaseClassBuilder(tpe: Type, members: Vector[ConverterBuilder]) extends ConverterBuilder {
      val columns = members.map(_.columns).sum
      def applyTree(offset: Int) = {
        val trees = members.scanLeft((offset, Option.empty[Tree])) {
          case ((o, _), cb) =>
            val nextOffset = o + cb.columns
            (nextOffset, Some(cb.applyTree(o)))
        }
          .collect { case (_, Some(tree)) => tree }

        q"${tpe.typeSymbol.companionSymbol}(..$trees)"
      }
    }

    def matchField(outerTpe: Type): ConverterBuilder =
      outerTpe match {
        /*
         * First we handle primitives, which never recurse
         */
        case tpe if tpe =:= typeOf[String] && allowUnknownTypes =>
          PrimitiveBuilder(idx => q"""t.getString($idx)""")
        case tpe if tpe =:= typeOf[String] =>
          // In this case, null is identical to empty, and we always return non-null
          PrimitiveBuilder(idx => q"""{val s = t.getString($idx); if (s == null) "" else s}""")
        case tpe if tpe =:= typeOf[Boolean] =>
          PrimitiveBuilder(idx => q"""t.getBoolean($idx)""")
        case tpe if tpe =:= typeOf[Short] =>
          PrimitiveBuilder(idx => q"""t.getShort($idx)""")
        case tpe if tpe =:= typeOf[Int] =>
          PrimitiveBuilder(idx => q"""t.getInteger($idx)""")
        case tpe if tpe =:= typeOf[Long] =>
          PrimitiveBuilder(idx => q"""t.getLong($idx)""")
        case tpe if tpe =:= typeOf[Float] =>
          PrimitiveBuilder(idx => q"""t.getFloat($idx)""")
        case tpe if tpe =:= typeOf[Double] =>
          PrimitiveBuilder(idx => q"""t.getDouble($idx)""")
        case tpe if tpe.erasure =:= typeOf[Option[Any]] =>
          val innerType = tpe.asInstanceOf[TypeRefApi].args.head
          evidentColumn(c, allowUnknownTypes)(innerType) match {
            case None => // there is no evident column, not supported.
              c.abort(c.enclosingPosition, s"$tpe has unsupported nesting of Options at: $innerType")
            case Some(ev) => // we can recurse here
              OptionBuilder(ev, matchField(innerType))
          }
        case tpe if (tpe.typeSymbol.isClass && tpe.typeSymbol.asClass.isCaseClass) =>
          CaseClassBuilder(tpe, membersOf(tpe).map(matchField))
        case tpe if allowUnknownTypes =>
          PrimitiveBuilder(idx => q"""t.getObject(${idx}).asInstanceOf[$tpe]""")
        case tpe =>
          c.abort(c.enclosingPosition,
            s"${T.tpe} is not pure primitives, Option of a primitive, nested case classes when looking at type ${tpe}")
      }

    val builder = matchField(T.tpe)
    if (builder.columns == 0) c.abort(c.enclosingPosition, "Didn't consume any elements in the tuple, possibly empty case class?")

    val res = q"""
  new _root_.com.twitter.scalding.TupleConverter[$T] with _root_.com.twitter.bijection.macros.MacroGenerated {
   override def apply(t: _root_.cascading.tuple.TupleEntry): $T = {
      ${builder.applyTree(0)}
    }
    override val arity: _root_.scala.Int = ${builder.columns}
  }
  """
    c.Expr[TupleConverter[T]](res)
  }
}


text:
namespace Ui
{
    class ManageAccounts;
}

class ManageAccounts : public QWidget
{
    Q_OBJECT

public:
    explicit ManageAccounts(QWidget* = nullptr);
    ~ManageAccounts();

public slots:
	void accountSelected(QListWidgetItem*);
	void editButtonClicked();
	void newAccount();
	void deleteAccount();
	void newTransaction();
	void updateButtons();
	void transfer();
	void exportToDatabase();
	void printSummary();
	void printSummaryToPrinter(QPrinter*);

private:
    Ui::ManageAccounts *ui;
	std::vector<data::account_data> basic_info;
	std::shared_ptr<QMenu> menu;

	std::string account_summary();

};

#endif


text:
package com.amazonaws.services.kinesisanalytics.model.transform;

import javax.annotation.Generated;

import com.amazonaws.SdkClientException;
import com.amazonaws.services.kinesisanalytics.model.*;

import com.amazonaws.protocol.*;
import com.amazonaws.annotation.SdkInternalApi;

/**
 * InputParallelismMarshaller
 */
@Generated("com.amazonaws:aws-java-sdk-code-generator")
@SdkInternalApi
public class InputParallelismMarshaller {

    private static final MarshallingInfo<Integer> COUNT_BINDING = MarshallingInfo.builder(MarshallingType.INTEGER).marshallLocation(MarshallLocation.PAYLOAD)
            .marshallLocationName("Count").build();

    private static final InputParallelismMarshaller instance = new InputParallelismMarshaller();

    public static InputParallelismMarshaller getInstance() {
        return instance;
    }

    /**
     * Marshall the given parameter object.
     */
    public void marshall(InputParallelism inputParallelism, ProtocolMarshaller protocolMarshaller) {

        if (inputParallelism == null) {
            throw new SdkClientException("Invalid argument passed to marshall(...)");
        }

        try {
            protocolMarshaller.marshall(inputParallelism.getCount(), COUNT_BINDING);
        } catch (Exception e) {
            throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e);
        }
    }

}


text:
"""VCF style representation of breakend data"""

import sys
import cnavg.basics.coords as coords

###############################################
## Rearrangement lingo
###############################################

class Breakend(coords.OrientedRegion):
	def __init__(self, chr, start, orientation, ID, finish=None):
		if finish is None:
			super(Breakend, self).__init__(chr, start, start + 1, orientation)
		else:
			super(Breakend, self).__init__(chr, start, finish, orientation)
		self.ID = ID

		self.partner = None
		self.mates = []
		self.remoteChr = []
		self.remoteStart = []
		self.remoteFinish = []
		self.remoteOrientation = []
		self.adjacency_cov = []
		self.segment = [0]

	def __str__(self):
		items = ["[%s] %s" % (self.ID, super(Breakend, self).__str__())]

		if self.partner is not None and self.partner > self:
			items += ["[%s] %s <-> [%s] %s | %f" % (self.ID, super(Breakend, self).__str__(), self.partner.ID, super(Breakend, self.partner).__str__(), self.adjacency_cov[0])]
		for mateIndex in range(len(self.mates)):
			mate = self.mates[mateIndex]
			if mate is not None and mate > self:
				items += ["[%s] %s <-> [%s] %s | %f" % (self.ID, super(Breakend, self).__str__(), mate.ID, super(Breakend, mate).__str__(), self.adjacency_cov[mateIndex + 1])]

		return "\n".join(items)

	#########################################################
	## Consolidating missing labels
	#########################################################

	def createPartner(self, graph):
		partnerID = str(self.ID) + "_partner"
		if self.orientation:
			partner = Breakend(self.chr, self.start - 1, False, partnerID, finish=self.finish - 1)
		else:
			partner = Breakend(self.chr, self.start + 1, True, partnerID, finish=self.finish + 1)
		hits = filter(lambda X: X.partner is None, graph.searchBreakend(partner))
		if len(hits) == 1:
			if len(hits) >= 2:
				print 'COLLISION'
				print self
				print '>>>>>>>>>>>>>>>>>'
				print '\n'.join(map(str, hits))
			assert len(hits) < 2
			self.partner = hits[0]
			self.partner.partner = self
			if len(self.adjacency_cov) == 0:
				self.adjacency_cov.append(-1)
			partner.adjacency_cov = [self.adjacency_cov[0]]
			cutpoint = (max(self.start, self.partner.start) + min(self.finish, self.partner.finish)) / 2
			if self.orientation:
				self.start = cutpoint + 1
				self.partner.finish = cutpoint
				assert cutpoint + 1 <= self.finish
				assert cutpoint >= self.partner.start
			else:
				assert cutpoint + 1 <= self.partner.finish, "\n".join(map(str, [cutpoint, self, self.partner]))
				assert cutpoint >= self.start, "\n".join(map(str, [cutpoint, self, self.partner]))
				self.partner.start = cutpoint + 1
				self.finish = cutpoint
			self.partner.start = max(self.partner.start, partner.start)

			if (not self.orientation and self.start >= self.partner.start) or (self.orientation and self.start < self.partner.start):
				print self
				print self.partner
				sys.exit(1)
			return

		partner.partner = self
		if len(self.adjacency_cov) == 0:
			self.adjacency_cov.append(-1)
		partner.adjacency_cov = [self.adjacency_cov[0]]

		self.partner = partner
		if self.orientation:
			assert self > self.partner, "\n".join(map(str, [self, self.partner]))
		else:
			assert self < self.partner, "\n".join(map(str, [self, self.partner]))
		graph.addBreakend(partner)

	def createMate(self, index, graph):
		mate = Breakend(self.remoteChr[index], self.remoteStart[index], self.remoteOrientation[index], str(self.ID) + "_mate" + str(index), finish=self.remoteFinish[index])

		hits = graph.searchBreakend(mate)
		if len(hits) > 0:
			if len(hits) >= 2:
				hits = filter(lambda X: X is not self, hits)
				assert len(hits) > 0
			if len(hits) >= 2:
				hitDistances = sorted((abs(X.position() - self.position()), X) for X in hits)
				hits = [hitDistances[0][1]]
			assert len(hits) < 2
			mate = hits[0]
			self.mates[index] = mate

			remoteIndex = filter(lambda X: mate.mates[X] is None and mate.remoteChr[X] == self.chr and mate.remoteOrientation[X] == self.orientation and mate.remoteStart[X] < self.finish and mate.remoteFinish[X] > self.start, range(len(mate.mates)))
			assert len(remoteIndex) < 2
			if len(remoteIndex) == 1:
				mate.mates[remoteIndex[0]] = self
				mate.adjacency_cov[remoteIndex[0]+1] = self.adjacency_cov[index]
			else:
				mate.mates.append(self)
				mate.remoteChr.append(self.chr)
				mate.remoteStart.append(self.start)
				mate.remoteFinish.append(self.finish)
				mate.remoteOrientation.append(self.orientation)
				mate.adjacency_cov.append(self.adjacency_cov[index])
		else:
			self.mates[index] = mate
			mate.mates = [self]
			mate.remoteChr = [self.chr]
			mate.remoteStart = [self.start]
			mate.remoteFinish = [self.finish]
			mate.remoteOrientation = [self.orientation]
			mate.adjacency_cov = [-1, self.adjacency_cov[index]]
			mate.segment = [0]

			mate.createPartner(graph)
			graph.addBreakend(mate)

	def consolidateEmptyBreakend(self, breakendGraph):
		if self.partner is None:
			self.createPartner(breakendGraph)

		for counter in range(len(self.mates)):
			if self.mates[counter] is None:
				self.createMate(counter, breakendGraph)

	########################################################
	## Absorbing another breakend (typically in case of overlaps)
	########################################################

	def _stealMates(self, other):
		print 'Stealing from %i to %i' % (id(other), id(self))
		for mate, coverage in zip(other.mates, other.adjacency_cov[1:]):
			if all(X is not mate for X in self.mates):
				self.mates.append(mate)
				self.adjacency_cov.append(coverage)
				for index in range(len(mate.mates)):
					if mate.mates[index] is other:
						mate.mates[index] = self
			else:
				for index in range(len(mate.mates)):
					if mate.mates[index] is other:
						mate.mates.pop(index)
						mate.adjacency_cov.pop(index + 1)
				for index in range(len(mate.mates)):
					if mate.mates[index] is self:
						mate.adjacency_cov[index + 1] += coverage
				for index in range(len(self.mates)):
					if self.mates[index] is mate:
						self.adjacency_cov[index + 1] += coverage

		other.mates = []

	def absorb(self, other):
		self._stealMates(other)
		self.partner._stealMates(other.partner)

	########################################################
	## Conversion to AVG
	########################################################

	def attachNode(self, graph):
		self.node = graph.createNode(self.chr, self.start, self.orientation, name=self.ID)

	def connectNode(self, graph):
		graph.createAdjacency(self.node, self.partner.node)
		if self.node < self.partner.node:
			graph.addLiftedEdge(self.node, self.partner.node, self.adjacency_cov[0])

		for index in range(len(self.mates)):
			if self.node < self.mates[index].node:
				graph.addLiftedEdge(self.node, self.mates[index].node, self.adjacency_cov[index + 1])

	def validate(self):
		if self.partner is not None:
			assert self.partner.partner == self
			if self < self.partner:
				assert self.orientation == False and self.partner.orientation == True
			else:
				assert self.orientation == True and self.partner.orientation == False
		if self.mates is not None:
			assert all(any(X is self for X in mate.mates) for mate in self.mates if mate is not None)
		assert self.finish >= self.start
		assert sum(self.segment) >= 0
		return True


text:
""" Source file for chromium_step testcases."""

import os
import shutil
import string
import random
import tempfile
import unittest

import test_env  # pylint: disable=W0611,W0403

from common import chromium_utils
from master import chromium_step

class ChromiumStepTest(unittest.TestCase):

  def setUp(self):
    # Must use chromium_utils.AbsoluteCanonicalPath to avoid getting different
    # paths on Mac in the implementation of chromium_step.Prepend().
    self.output_dir = chromium_utils.AbsoluteCanonicalPath(tempfile.mkdtemp())
    self.perf_output_dir = chromium_utils.AbsoluteCanonicalPath(
        os.path.join(self.output_dir, 'perf'))

  def tearDown(self):
    shutil.rmtree(self.output_dir)

  @staticmethod
  def _generateTempName(base_dir):
    while True:
      candidate = ''.join(random.choice(string.ascii_letters + string.digits)
                          for _ in xrange(8))
      path = os.path.join(base_dir, candidate)
      if not os.path.exists(path):
        return candidate

  def testPrependAllowed(self):
    with tempfile.NamedTemporaryFile(dir=self.output_dir) as temp_file:
      chromium_step.Prepend(temp_file.name, '111', self.output_dir,
                            self.perf_output_dir)
      self.assertTrue(_readData(temp_file.name), '111')

  def testPrependAllowedSubDir(self):
    # Use mkdtemp() just to generate a unique filename.
    temp_name = self._generateTempName(self.output_dir)

    # Create a path containing a sub-directory of the output_dir. Make sure it
    # doesn't exist so we can verify it's created.
    subdir = os.path.join(self.output_dir, temp_name)

    subdir_file = os.path.join(subdir, temp_name)
    self.assertFalse(os.path.exists(subdir_file))
    try:
      chromium_step.Prepend(subdir_file, '222', self.output_dir,
                            self.perf_output_dir)

      # Verify the subdir was also created, in addition to the file.
      self.assertTrue(os.path.exists(subdir))
      self.assertTrue(os.path.exists(subdir_file))
      self.assertTrue(_readData(subdir_file), '222')
    finally:
      shutil.rmtree(subdir)

  def testPrependDenied(self):
    with tempfile.NamedTemporaryFile() as fd:
      invalid_filename = fd.name
      def dummy_func():
        chromium_step.Prepend(invalid_filename, '333', self.output_dir,
                              self.perf_output_dir)
      self.assertRaises(Exception, dummy_func)

def _readData(filename):
  f = open(filename, 'r')
  data = f.read()
  f.close()
  return data

if __name__ == '__main__':
  unittest.main()


text:
<?php

namespace Ekyna\Bundle\PaymentBundle\Form\Type;

use Ekyna\Bundle\AdminBundle\Form\Type\ResourceFormType;
use Ekyna\Bundle\MediaBundle\Model\MediaTypes;
use Ekyna\Bundle\PaymentBundle\Form\EventListener\BuildConfigSubscriber;
use Payum\Core\Registry\RegistryInterface;
use Symfony\Component\Form\FormBuilderInterface;

/**
 * Class MethodType
 * @package Ekyna\Bundle\PaymentBundle\Form\Type
 * @author Étienne Dauvergne <contact@ekyna.com>
 */
class MethodType extends ResourceFormType
{
    /**
     * @var RegistryInterface
     */
    private $registry;

    /**
     * Constructor.
     *
     * @param string            $class
     * @param RegistryInterface $registry
     */
    public function __construct($class, RegistryInterface $registry)
    {
        parent::__construct($class);

        $this->registry = $registry;
    }

    /**
     * {@inheritdoc}
     */
    public function buildForm(FormBuilderInterface $builder, array $options)
    {
        $builder
            ->add('gatewayName', 'text', array(
                'label' => 'ekyna_core.field.name',
            ))
            ->add('factoryName', 'payum_gateway_factories_choice', array(
                'label' => 'ekyna_payment.method.field.factory_name',
                'disabled' => true,
            ))
            ->add('media', 'ekyna_media_choice', array(
                'label' => 'ekyna_core.field.image',
                'types' => MediaTypes::IMAGE,
            ))
            ->add('description', 'tinymce', array(
                'label' => 'ekyna_core.field.description',
            ))
            ->add('messages', 'ekyna_payment_messages')
            ->add('enabled', 'checkbox', array(
                'label' => 'ekyna_core.field.enabled',
                'required' => false,
                'attr' => array(
                    'align_with_widget' => true,
                ),
            ))
            ->add('available', 'checkbox', array(
                'label' => 'ekyna_payment.method.field.available',
                'required' => false,
                'attr' => array(
                    'align_with_widget' => true,
                ),
            ))
        ;

        $builder->addEventSubscriber(new BuildConfigSubscriber($this->registry));
    }

    /**
     * {@inheritdoc}
     */
    public function getName()
    {
        return 'ekyna_payment_method';
    }
}


text:
/* Davidbot app.js */

function play(){
  var think = document.getElementById('think');
  think.play();
  }

function search(){
  var newURL = "https://rubygems.org/search?query=" + $('#question').val();
  chrome.tabs.create({ url: newURL });
  return false;
};

function delay(fnc, time){
  setTimeout(fnc, time);
  return false;
};

document.addEventListener('DOMContentLoaded', function() {
  var submit = document.getElementById('submit');
  submit.addEventListener('click', function(){
      event.preventDefault();
      search()
      setTimeout(search, 2000);
      });
  });

var apiBase = 'https://slack.com/api/chat.postMessage?token=xoxp-3520991751-3717813329-3719698362-6afcf8&channel=C03JNHJ2R&text='

document.addEventListener('DOMContentLoaded', function() {
  var linkToShare = '';
  var currentTab = document.getElementById('hipchat');
  currentTab.addEventListener('click', function(){
    event.preventDefault();
      event.preventDefault();
      chrome.tabs.query({currentWindow: true, active: true}, function(tabs){
      $.ajax({
        type: 'POST',
        url: apiBase + $('#question').val() + " " + tabs[0].url + '&username=BrianBot&icon_url=http://i.imgur.com/NsTWOAa.png',
        error: function(e){
          console.log(e);
        },
        dataType: "json",
        contentType: "application/json"
        });
      });
    return false;
  });
});

$("#hat").on('click', function(){
  $('#amerikitty').toggleClass('hidden')
  });


text:
package com.cat.cc.tag;

import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.widget.Toast;

import com.cat.cc.taglibrary.view.ImageDotLayout;

import java.util.ArrayList;
import java.util.List;

public class ImageDotActivity extends AppCompatActivity {

    private ImageDotLayout imageDotLayout;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_image_dot);
        imageDotLayout = (ImageDotLayout) findViewById(R.id.idl_idl_photo);
        imageDotLayout.setOnImageClickListener(new ImageDotLayout.OnImageClickListener() {
            @Override
            public void onImageClick(ImageDotLayout.IconBean bean) {
                //可以一系列处理后再添加标签
                imageDotLayout.addIcon(bean);
            }
        });
        //设置背景图片
        imageDotLayout.setImage("http://pic39.nipic.com/20140311/8821914_214422866000_2.jpg");
        initIcon();
        imageDotLayout.setOnIconClickListener(new ImageDotLayout.OnIconClickListener() {
            @Override
            public void onIconClick(View v) {
                ImageDotLayout.IconBean bean= (ImageDotLayout.IconBean) v.getTag();
                Toast.makeText(ImageDotActivity.this,"位置="+bean.id,Toast.LENGTH_SHORT).show();
            }
        });
    }

    private void initIcon() {
        final List<ImageDotLayout.IconBean> iconBeanList = new ArrayList<>();
        ImageDotLayout.IconBean bean = new ImageDotLayout.IconBean(0, 0.3f, 0.4f, null);
        iconBeanList.add(bean);
        bean = new ImageDotLayout.IconBean(1, 0.5f, 0.4f, null);
        iconBeanList.add(bean);
        //监听图片是否加载完成
        imageDotLayout.setOnLayoutReadyListener(new ImageDotLayout.OnLayoutReadyListener() {
            @Override
            public void onLayoutReady() {
                imageDotLayout.addIcons(iconBeanList);
            }
        });
    }
}


text:
package org.mockito.release.notes.vcs;

/**
 * Knows the contributions
 */
public interface ContributionsProvider {

    /**
     * Provides contributions between specified versions
     */
    ContributionSet getContributionsBetween(String fromRev, String toRev);
}


text:
package doobie.postgres

import doobie._
import doobie.util.invariant._

import org.postgis._

import scala.reflect.ClassTag
import org.tpolecat.typename._

// Implicit conversions for postgis geography types
trait PgisGeographyInstances {

  // PostGIS outer types
  implicit val PGgeographyType: Meta[PGgeography] = Meta.Advanced.other[PGgeography]("geography")

  // Constructor for geometry types via the `Geometry` member of PGgeography
  @SuppressWarnings(Array("org.wartremover.warts.AsInstanceOf", "org.wartremover.warts.Throw"))
  private def geometryType[A >: Null <: Geometry: TypeName](implicit A: ClassTag[A]): Meta[A] =
    PGgeographyType.timap[A](g =>
      try A.runtimeClass.cast(g.getGeometry).asInstanceOf[A]
      catch {
        case _: ClassCastException => throw InvalidObjectMapping(A.runtimeClass, g.getGeometry.getClass)
      })(new PGgeography(_))

  // PostGIS Geometry Types
  implicit val MultiLineStringType: Meta[MultiLineString]       = geometryType[MultiLineString]
  implicit val MultiPolygonType: Meta[MultiPolygon]             = geometryType[MultiPolygon]
  implicit val PointComposedGeomType: Meta[PointComposedGeom]   = geometryType[PointComposedGeom]
  implicit val LineStringType: Meta[LineString]                 = geometryType[LineString]
  implicit val MultiPointType: Meta[MultiPoint]                 = geometryType[MultiPoint]
  implicit val PolygonType: Meta[Polygon]                       = geometryType[Polygon]
  implicit val PointType: Meta[Point]                           = geometryType[Point]
}


text:
bitshares.aio.committee module
==============================

.. automodule:: bitshares.aio.committee
   :members:
   :undoc-members:
   :show-inheritance:
   :inherited-members:


text:
"""Metrics to assess performance on regression task.

Functions named as ``*_score`` return a scalar value to maximize: the higher
the better.

Function named as ``*_error`` or ``*_loss`` return a scalar value to minimize:
the lower the better.
"""

# Authors: Alexandre Gramfort <alexandre.gramfort@inria.fr>
#          Mathieu Blondel <mathieu@mblondel.org>
#          Olivier Grisel <olivier.grisel@ensta.org>
#          Arnaud Joly <a.joly@ulg.ac.be>
#          Jochen Wersdorfer <jochen@wersdoerfer.de>
#          Lars Buitinck
#          Joel Nothman <joel.nothman@gmail.com>
#          Karan Desai <karandesai281196@gmail.com>
#          Noel Dawe <noel@dawe.me>
#          Manoj Kumar <manojkumarsivaraj334@gmail.com>
#          Michael Eickenberg <michael.eickenberg@gmail.com>
#          Konstantin Shmelkov <konstantin.shmelkov@polytechnique.edu>
#          Christian Lorentzen <lorentzen.ch@googlemail.com>
#          Ashutosh Hathidara <ashutoshhathidara98@gmail.com>
#          Uttam kumar <bajiraouttamsinha@gmail.com>
# License: BSD 3 clause

import warnings

import numpy as np

from .._loss.glm_distribution import TweedieDistribution
from ..exceptions import UndefinedMetricWarning
from ..utils.validation import (
    check_array,
    check_consistent_length,
    _num_samples,
    column_or_1d,
    _check_sample_weight,
    _deprecate_positional_args,
)
from ..utils.stats import _weighted_percentile

__ALL__ = [
    "max_error",
    "mean_absolute_error",
    "mean_squared_error",
    "mean_squared_log_error",
    "median_absolute_error",
    "mean_absolute_percentage_error",
    "mean_pinball_loss",
    "r2_score",
    "explained_variance_score",
    "mean_tweedie_deviance",
    "mean_poisson_deviance",
    "mean_gamma_deviance",
]

def _check_reg_targets(y_true, y_pred, multioutput, dtype="numeric"):
    """Check that y_true and y_pred belong to the same regression task.

    Parameters
    ----------
    y_true : array-like

    y_pred : array-like

    multioutput : array-like or string in ['raw_values', uniform_average',
        'variance_weighted'] or None
        None is accepted due to backward compatibility of r2_score().

    Returns
    -------
    type_true : one of {'continuous', continuous-multioutput'}
        The type of the true target data, as output by
        'utils.multiclass.type_of_target'.

    y_true : array-like of shape (n_samples, n_outputs)
        Ground truth (correct) target values.

    y_pred : array-like of shape (n_samples, n_outputs)
        Estimated target values.

    multioutput : array-like of shape (n_outputs) or string in ['raw_values',
        uniform_average', 'variance_weighted'] or None
        Custom output weights if ``multioutput`` is array-like or
        just the corresponding argument if ``multioutput`` is a
        correct keyword.

    dtype : str or list, default="numeric"
        the dtype argument passed to check_array.
    """
    check_consistent_length(y_true, y_pred)
    y_true = check_array(y_true, ensure_2d=False, dtype=dtype)
    y_pred = check_array(y_pred, ensure_2d=False, dtype=dtype)

    if y_true.ndim == 1:
        y_true = y_true.reshape((-1, 1))

    if y_pred.ndim == 1:
        y_pred = y_pred.reshape((-1, 1))

    if y_true.shape[1] != y_pred.shape[1]:
        raise ValueError(
            "y_true and y_pred have different number of output ({0}!={1})".format(
                y_true.shape[1], y_pred.shape[1]
            )
        )

    n_outputs = y_true.shape[1]
    allowed_multioutput_str = ("raw_values", "uniform_average", "variance_weighted")
    if isinstance(multioutput, str):
        if multioutput not in allowed_multioutput_str:
            raise ValueError(
                "Allowed 'multioutput' string values are {}. "
                "You provided multioutput={!r}".format(
                    allowed_multioutput_str, multioutput
                )
            )
    elif multioutput is not None:
        multioutput = check_array(multioutput, ensure_2d=False)
        if n_outputs == 1:
            raise ValueError("Custom weights are useful only in multi-output cases.")
        elif n_outputs != len(multioutput):
            raise ValueError(
                "There must be equally many custom weights (%d) as outputs (%d)."
                % (len(multioutput), n_outputs)
            )
    y_type = "continuous" if n_outputs == 1 else "continuous-multioutput"

    return y_type, y_true, y_pred, multioutput

def mean_absolute_error(
    y_true, y_pred, *, sample_weight=None, multioutput="uniform_average"
):
    """Mean absolute error regression loss.

    Read more in the :ref:`User Guide <mean_absolute_error>`.

    Parameters
    ----------
    y_true : array-like of shape (n_samples,) or (n_samples, n_outputs)
        Ground truth (correct) target values.

    y_pred : array-like of shape (n_samples,) or (n_samples, n_outputs)
        Estimated target values.

    sample_weight : array-like of shape (n_samples,), default=None
        Sample weights.

    multioutput : {'raw_values', 'uniform_average'}  or array-like of shape \
            (n_outputs,), default='uniform_average'
        Defines aggregating of multiple output values.
        Array-like value defines weights used to average errors.

        'raw_values' :
            Returns a full set of errors in case of multioutput input.

        'uniform_average' :
            Errors of all outputs are averaged with uniform weight.

    Returns
    -------
    loss : float or ndarray of floats
        If multioutput is 'raw_values', then mean absolute error is returned
        for each output separately.
        If multioutput is 'uniform_average' or an ndarray of weights, then the
        weighted average of all output errors is returned.

        MAE output is non-negative floating point. The best value is 0.0.

    Examples
    --------
    >>> from sklearn.metrics import mean_absolute_error
    >>> y_true = [3, -0.5, 2, 7]
    >>> y_pred = [2.5, 0.0, 2, 8]
    >>> mean_absolute_error(y_true, y_pred)
    0.5
    >>> y_true = [[0.5, 1], [-1, 1], [7, -6]]
    >>> y_pred = [[0, 2], [-1, 2], [8, -5]]
    >>> mean_absolute_error(y_true, y_pred)
    0.75
    >>> mean_absolute_error(y_true, y_pred, multioutput='raw_values')
    array([0.5, 1. ])
    >>> mean_absolute_error(y_true, y_pred, multioutput=[0.3, 0.7])
    0.85...
    """
    y_type, y_true, y_pred, multioutput = _check_reg_targets(
        y_true, y_pred, multioutput
    )
    check_consistent_length(y_true, y_pred, sample_weight)
    output_errors = np.average(np.abs(y_pred - y_true), weights=sample_weight, axis=0)
    if isinstance(multioutput, str):
        if multioutput == "raw_values":
            return output_errors
        elif multioutput == "uniform_average":
            # pass None as weights to np.average: uniform mean
            multioutput = None

    return np.average(output_errors, weights=multioutput)

def mean_pinball_loss(
    y_true, y_pred, *, sample_weight=None, alpha=0.5, multioutput="uniform_average"
):
    """Pinball loss for quantile regression.

    Read more in the :ref:`User Guide <pinball_loss>`.

    Parameters
    ----------
    y_true : array-like of shape (n_samples,) or (n_samples, n_outputs)
        Ground truth (correct) target values.

    y_pred : array-like of shape (n_samples,) or (n_samples, n_outputs)
        Estimated target values.

    sample_weight : array-like of shape (n_samples,), default=None
        Sample weights.

    alpha: float, slope of the pinball loss, default=0.5,
        this loss is equivalent to :ref:`mean_absolute_error` when `alpha=0.5`,
        `alpha=0.95` is minimized by estimators of the 95th percentile.

    multioutput : {'raw_values', 'uniform_average'}  or array-like of shape \
            (n_outputs,), default='uniform_average'
        Defines aggregating of multiple output values.
        Array-like value defines weights used to average errors.

        'raw_values' :
            Returns a full set of errors in case of multioutput input.

        'uniform_average' :
            Errors of all outputs are averaged with uniform weight.

    Returns
    -------
    loss : float or ndarray of floats
        If multioutput is 'raw_values', then mean absolute error is returned
        for each output separately.
        If multioutput is 'uniform_average' or an ndarray of weights, then the
        weighted average of all output errors is returned.

        The pinball loss output is a non-negative floating point. The best
        value is 0.0.

    Examples
    --------
    >>> from sklearn.metrics import mean_pinball_loss
    >>> y_true = [1, 2, 3]
    >>> mean_pinball_loss(y_true, [0, 2, 3], alpha=0.1)
    0.03...
    >>> mean_pinball_loss(y_true, [1, 2, 4], alpha=0.1)
    0.3...
    >>> mean_pinball_loss(y_true, [0, 2, 3], alpha=0.9)
    0.3...
    >>> mean_pinball_loss(y_true, [1, 2, 4], alpha=0.9)
    0.03...
    >>> mean_pinball_loss(y_true, y_true, alpha=0.1)
    0.0
    >>> mean_pinball_loss(y_true, y_true, alpha=0.9)
    0.0
    """
    y_type, y_true, y_pred, multioutput = _check_reg_targets(
        y_true, y_pred, multioutput
    )
    check_consistent_length(y_true, y_pred, sample_weight)
    diff = y_true - y_pred
    sign = (diff >= 0).astype(diff.dtype)
    loss = alpha * sign * diff - (1 - alpha) * (1 - sign) * diff
    output_errors = np.average(loss, weights=sample_weight, axis=0)
    if isinstance(multioutput, str):
        if multioutput == "raw_values":
            return output_errors
        elif multioutput == "uniform_average":
            # pass None as weights to np.average: uniform mean
            multioutput = None
        else:
            raise ValueError(
                "multioutput is expected to be 'raw_values' "
                "or 'uniform_average' but we got %r"
                " instead." % multioutput
            )

    return np.average(output_errors, weights=multioutput)

@_deprecate_positional_args(version="1.1")
def mean_absolute_percentage_error(
    y_true, y_pred, *, sample_weight=None, multioutput="uniform_average"
):
    """Mean absolute percentage error (MAPE) regression loss.

    Note here that the output is not a percentage in the range [0, 100]
    and a value of 100 does not mean 100% but 1e2. Furthermore, the output
    can be arbitrarily high when `y_true` is small (which is specific to the
    metric) or when `abs(y_true - y_pred)` is large (which is common for most
    regression metrics). Read more in the
    :ref:`User Guide <mean_absolute_percentage_error>`.

    .. versionadded:: 0.24

    Parameters
    ----------
    y_true : array-like of shape (n_samples,) or (n_samples, n_outputs)
        Ground truth (correct) target values.

    y_pred : array-like of shape (n_samples,) or (n_samples, n_outputs)
        Estimated target values.

    sample_weight : array-like of shape (n_samples,), default=None
        Sample weights.

    multioutput : {'raw_values', 'uniform_average'} or array-like
        Defines aggregating of multiple output values.
        Array-like value defines weights used to average errors.
        If input is list then the shape must be (n_outputs,).

        'raw_values' :
            Returns a full set of errors in case of multioutput input.

        'uniform_average' :
            Errors of all outputs are averaged with uniform weight.

    Returns
    -------
    loss : float or ndarray of floats
        If multioutput is 'raw_values', then mean absolute percentage error
        is returned for each output separately.
        If multioutput is 'uniform_average' or an ndarray of weights, then the
        weighted average of all output errors is returned.

        MAPE output is non-negative floating point. The best value is 0.0.
        But note that bad predictions can lead to arbitrarily large
        MAPE values, especially if some `y_true` values are very close to zero.
        Note that we return a large value instead of `inf` when `y_true` is zero.

    Examples
    --------
    >>> from sklearn.metrics import mean_absolute_percentage_error
    >>> y_true = [3, -0.5, 2, 7]
    >>> y_pred = [2.5, 0.0, 2, 8]
    >>> mean_absolute_percentage_error(y_true, y_pred)
    0.3273...
    >>> y_true = [[0.5, 1], [-1, 1], [7, -6]]
    >>> y_pred = [[0, 2], [-1, 2], [8, -5]]
    >>> mean_absolute_percentage_error(y_true, y_pred)
    0.5515...
    >>> mean_absolute_percentage_error(y_true, y_pred, multioutput=[0.3, 0.7])
    0.6198...
    >>> # the value when some element of the y_true is zero is arbitrarily high because
    >>> # of the division by epsilon
    >>> y_true = [1., 0., 2.4, 7.]
    >>> y_pred = [1.2, 0.1, 2.4, 8.]
    >>> mean_absolute_percentage_error(y_true, y_pred)
    112589990684262.48
    """
    y_type, y_true, y_pred, multioutput = _check_reg_targets(
        y_true, y_pred, multioutput
    )
    check_consistent_length(y_true, y_pred, sample_weight)
    epsilon = np.finfo(np.float64).eps
    mape = np.abs(y_pred - y_true) / np.maximum(np.abs(y_true), epsilon)
    output_errors = np.average(mape, weights=sample_weight, axis=0)
    if isinstance(multioutput, str):
        if multioutput == "raw_values":
            return output_errors
        elif multioutput == "uniform_average":
            # pass None as weights to np.average: uniform mean
            multioutput = None

    return np.average(output_errors, weights=multioutput)

def mean_squared_error(
    y_true, y_pred, *, sample_weight=None, multioutput="uniform_average", squared=True
):
    """Mean squared error regression loss.

    Read more in the :ref:`User Guide <mean_squared_error>`.

    Parameters
    ----------
    y_true : array-like of shape (n_samples,) or (n_samples, n_outputs)
        Ground truth (correct) target values.

    y_pred : array-like of shape (n_samples,) or (n_samples, n_outputs)
        Estimated target values.

    sample_weight : array-like of shape (n_samples,), default=None
        Sample weights.

    multioutput : {'raw_values', 'uniform_average'} or array-like of shape \
            (n_outputs,), default='uniform_average'
        Defines aggregating of multiple output values.
        Array-like value defines weights used to average errors.

        'raw_values' :
            Returns a full set of errors in case of multioutput input.

        'uniform_average' :
            Errors of all outputs are averaged with uniform weight.

    squared : bool, default=True
        If True returns MSE value, if False returns RMSE value.

    Returns
    -------
    loss : float or ndarray of floats
        A non-negative floating point value (the best value is 0.0), or an
        array of floating point values, one for each individual target.

    Examples
    --------
    >>> from sklearn.metrics import mean_squared_error
    >>> y_true = [3, -0.5, 2, 7]
    >>> y_pred = [2.5, 0.0, 2, 8]
    >>> mean_squared_error(y_true, y_pred)
    0.375
    >>> y_true = [3, -0.5, 2, 7]
    >>> y_pred = [2.5, 0.0, 2, 8]
    >>> mean_squared_error(y_true, y_pred, squared=False)
    0.612...
    >>> y_true = [[0.5, 1],[-1, 1],[7, -6]]
    >>> y_pred = [[0, 2],[-1, 2],[8, -5]]
    >>> mean_squared_error(y_true, y_pred)
    0.708...
    >>> mean_squared_error(y_true, y_pred, squared=False)
    0.822...
    >>> mean_squared_error(y_true, y_pred, multioutput='raw_values')
    array([0.41666667, 1.        ])
    >>> mean_squared_error(y_true, y_pred, multioutput=[0.3, 0.7])
    0.825...
    """
    y_type, y_true, y_pred, multioutput = _check_reg_targets(
        y_true, y_pred, multioutput
    )
    check_consistent_length(y_true, y_pred, sample_weight)
    output_errors = np.average((y_true - y_pred) ** 2, axis=0, weights=sample_weight)

    if not squared:
        output_errors = np.sqrt(output_errors)

    if isinstance(multioutput, str):
        if multioutput == "raw_values":
            return output_errors
        elif multioutput == "uniform_average":
            # pass None as weights to np.average: uniform mean
            multioutput = None

    return np.average(output_errors, weights=multioutput)

def mean_squared_log_error(
    y_true, y_pred, *, sample_weight=None, multioutput="uniform_average", squared=True
):
    """Mean squared logarithmic error regression loss.

    Read more in the :ref:`User Guide <mean_squared_log_error>`.

    Parameters
    ----------
    y_true : array-like of shape (n_samples,) or (n_samples, n_outputs)
        Ground truth (correct) target values.

    y_pred : array-like of shape (n_samples,) or (n_samples, n_outputs)
        Estimated target values.

    sample_weight : array-like of shape (n_samples,), default=None
        Sample weights.

    multioutput : {'raw_values', 'uniform_average'} or array-like of shape \
            (n_outputs,), default='uniform_average'

        Defines aggregating of multiple output values.
        Array-like value defines weights used to average errors.

        'raw_values' :
            Returns a full set of errors when the input is of multioutput
            format.

        'uniform_average' :
            Errors of all outputs are averaged with uniform weight.
    squared : bool, default=True
        If True returns MSLE (mean squared log error) value.
        If False returns RMSLE (root mean squared log error) value.

    Returns
    -------
    loss : float or ndarray of floats
        A non-negative floating point value (the best value is 0.0), or an
        array of floating point values, one for each individual target.

    Examples
    --------
    >>> from sklearn.metrics import mean_squared_log_error
    >>> y_true = [3, 5, 2.5, 7]
    >>> y_pred = [2.5, 5, 4, 8]
    >>> mean_squared_log_error(y_true, y_pred)
    0.039...
    >>> mean_squared_log_error(y_true, y_pred, squared=False)
    0.199...
    >>> y_true = [[0.5, 1], [1, 2], [7, 6]]
    >>> y_pred = [[0.5, 2], [1, 2.5], [8, 8]]
    >>> mean_squared_log_error(y_true, y_pred)
    0.044...
    >>> mean_squared_log_error(y_true, y_pred, multioutput='raw_values')
    array([0.00462428, 0.08377444])
    >>> mean_squared_log_error(y_true, y_pred, multioutput=[0.3, 0.7])
    0.060...
    """
    y_type, y_true, y_pred, multioutput = _check_reg_targets(
        y_true, y_pred, multioutput
    )
    check_consistent_length(y_true, y_pred, sample_weight)

    if (y_true < 0).any() or (y_pred < 0).any():
        raise ValueError(
            "Mean Squared Logarithmic Error cannot be used when "
            "targets contain negative values."
        )

    return mean_squared_error(
        np.log1p(y_true),
        np.log1p(y_pred),
        sample_weight=sample_weight,
        multioutput=multioutput,
        squared=squared,
    )

def median_absolute_error(
    y_true, y_pred, *, multioutput="uniform_average", sample_weight=None
):
    """Median absolute error regression loss.

    Median absolute error output is non-negative floating point. The best value
    is 0.0. Read more in the :ref:`User Guide <median_absolute_error>`.

    Parameters
    ----------
    y_true : array-like of shape = (n_samples) or (n_samples, n_outputs)
        Ground truth (correct) target values.

    y_pred : array-like of shape = (n_samples) or (n_samples, n_outputs)
        Estimated target values.

    multioutput : {'raw_values', 'uniform_average'} or array-like of shape \
            (n_outputs,), default='uniform_average'
        Defines aggregating of multiple output values. Array-like value defines
        weights used to average errors.

        'raw_values' :
            Returns a full set of errors in case of multioutput input.

        'uniform_average' :
            Errors of all outputs are averaged with uniform weight.

    sample_weight : array-like of shape (n_samples,), default=None
        Sample weights.

        .. versionadded:: 0.24

    Returns
    -------
    loss : float or ndarray of floats
        If multioutput is 'raw_values', then mean absolute error is returned
        for each output separately.
        If multioutput is 'uniform_average' or an ndarray of weights, then the
        weighted average of all output errors is returned.

    Examples
    --------
    >>> from sklearn.metrics import median_absolute_error
    >>> y_true = [3, -0.5, 2, 7]
    >>> y_pred = [2.5, 0.0, 2, 8]
    >>> median_absolute_error(y_true, y_pred)
    0.5
    >>> y_true = [[0.5, 1], [-1, 1], [7, -6]]
    >>> y_pred = [[0, 2], [-1, 2], [8, -5]]
    >>> median_absolute_error(y_true, y_pred)
    0.75
    >>> median_absolute_error(y_true, y_pred, multioutput='raw_values')
    array([0.5, 1. ])
    >>> median_absolute_error(y_true, y_pred, multioutput=[0.3, 0.7])
    0.85
    """
    y_type, y_true, y_pred, multioutput = _check_reg_targets(
        y_true, y_pred, multioutput
    )
    if sample_weight is None:
        output_errors = np.median(np.abs(y_pred - y_true), axis=0)
    else:
        sample_weight = _check_sample_weight(sample_weight, y_pred)
        output_errors = _weighted_percentile(
            np.abs(y_pred - y_true), sample_weight=sample_weight
        )
    if isinstance(multioutput, str):
        if multioutput == "raw_values":
            return output_errors
        elif multioutput == "uniform_average":
            # pass None as weights to np.average: uniform mean
            multioutput = None

    return np.average(output_errors, weights=multioutput)

def explained_variance_score(
    y_true, y_pred, *, sample_weight=None, multioutput="uniform_average"
):
    """Explained variance regression score function.

    Best possible score is 1.0, lower values are worse.

    Read more in the :ref:`User Guide <explained_variance_score>`.

    Parameters
    ----------
    y_true : array-like of shape (n_samples,) or (n_samples, n_outputs)
        Ground truth (correct) target values.

    y_pred : array-like of shape (n_samples,) or (n_samples, n_outputs)
        Estimated target values.

    sample_weight : array-like of shape (n_samples,), default=None
        Sample weights.

    multioutput : {'raw_values', 'uniform_average', 'variance_weighted'} or \
            array-like of shape (n_outputs,), default='uniform_average'
        Defines aggregating of multiple output scores.
        Array-like value defines weights used to average scores.

        'raw_values' :
            Returns a full set of scores in case of multioutput input.

        'uniform_average' :
            Scores of all outputs are averaged with uniform weight.

        'variance_weighted' :
            Scores of all outputs are averaged, weighted by the variances
            of each individual output.

    Returns
    -------
    score : float or ndarray of floats
        The explained variance or ndarray if 'multioutput' is 'raw_values'.

    Notes
    -----
    This is not a symmetric function.

    Examples
    --------
    >>> from sklearn.metrics import explained_variance_score
    >>> y_true = [3, -0.5, 2, 7]
    >>> y_pred = [2.5, 0.0, 2, 8]
    >>> explained_variance_score(y_true, y_pred)
    0.957...
    >>> y_true = [[0.5, 1], [-1, 1], [7, -6]]
    >>> y_pred = [[0, 2], [-1, 2], [8, -5]]
    >>> explained_variance_score(y_true, y_pred, multioutput='uniform_average')
    0.983...
    """
    y_type, y_true, y_pred, multioutput = _check_reg_targets(
        y_true, y_pred, multioutput
    )
    check_consistent_length(y_true, y_pred, sample_weight)

    y_diff_avg = np.average(y_true - y_pred, weights=sample_weight, axis=0)
    numerator = np.average(
        (y_true - y_pred - y_diff_avg) ** 2, weights=sample_weight, axis=0
    )

    y_true_avg = np.average(y_true, weights=sample_weight, axis=0)
    denominator = np.average((y_true - y_true_avg) ** 2, weights=sample_weight, axis=0)

    nonzero_numerator = numerator != 0
    nonzero_denominator = denominator != 0
    valid_score = nonzero_numerator & nonzero_denominator
    output_scores = np.ones(y_true.shape[1])

    output_scores[valid_score] = 1 - (numerator[valid_score] / denominator[valid_score])
    output_scores[nonzero_numerator & ~nonzero_denominator] = 0.0
    if isinstance(multioutput, str):
        if multioutput == "raw_values":
            # return scores individually
            return output_scores
        elif multioutput == "uniform_average":
            # passing to np.average() None as weights results is uniform mean
            avg_weights = None
        elif multioutput == "variance_weighted":
            avg_weights = denominator
    else:
        avg_weights = multioutput

    return np.average(output_scores, weights=avg_weights)

def r2_score(y_true, y_pred, *, sample_weight=None, multioutput="uniform_average"):
    """:math:`R^2` (coefficient of determination) regression score function.

    Best possible score is 1.0 and it can be negative (because the
    model can be arbitrarily worse). A constant model that always
    predicts the expected value of y, disregarding the input features,
    would get a :math:`R^2` score of 0.0.

    Read more in the :ref:`User Guide <r2_score>`.

    Parameters
    ----------
    y_true : array-like of shape (n_samples,) or (n_samples, n_outputs)
        Ground truth (correct) target values.

    y_pred : array-like of shape (n_samples,) or (n_samples, n_outputs)
        Estimated target values.

    sample_weight : array-like of shape (n_samples,), default=None
        Sample weights.

    multioutput : {'raw_values', 'uniform_average', 'variance_weighted'}, \
            array-like of shape (n_outputs,) or None, default='uniform_average'

        Defines aggregating of multiple output scores.
        Array-like value defines weights used to average scores.
        Default is "uniform_average".

        'raw_values' :
            Returns a full set of scores in case of multioutput input.

        'uniform_average' :
            Scores of all outputs are averaged with uniform weight.

        'variance_weighted' :
            Scores of all outputs are averaged, weighted by the variances
            of each individual output.

        .. versionchanged:: 0.19
            Default value of multioutput is 'uniform_average'.

    Returns
    -------
    z : float or ndarray of floats
        The :math:`R^2` score or ndarray of scores if 'multioutput' is
        'raw_values'.

    Notes
    -----
    This is not a symmetric function.

    Unlike most other scores, :math:`R^2` score may be negative (it need not
    actually be the square of a quantity R).

    This metric is not well-defined for single samples and will return a NaN
    value if n_samples is less than two.

    References
    ----------
    .. [1] `Wikipedia entry on the Coefficient of determination
            <https://en.wikipedia.org/wiki/Coefficient_of_determination>`_

    Examples
    --------
    >>> from sklearn.metrics import r2_score
    >>> y_true = [3, -0.5, 2, 7]
    >>> y_pred = [2.5, 0.0, 2, 8]
    >>> r2_score(y_true, y_pred)
    0.948...
    >>> y_true = [[0.5, 1], [-1, 1], [7, -6]]
    >>> y_pred = [[0, 2], [-1, 2], [8, -5]]
    >>> r2_score(y_true, y_pred,
    ...          multioutput='variance_weighted')
    0.938...
    >>> y_true = [1, 2, 3]
    >>> y_pred = [1, 2, 3]
    >>> r2_score(y_true, y_pred)
    1.0
    >>> y_true = [1, 2, 3]
    >>> y_pred = [2, 2, 2]
    >>> r2_score(y_true, y_pred)
    0.0
    >>> y_true = [1, 2, 3]
    >>> y_pred = [3, 2, 1]
    >>> r2_score(y_true, y_pred)
    -3.0
    """
    y_type, y_true, y_pred, multioutput = _check_reg_targets(
        y_true, y_pred, multioutput
    )
    check_consistent_length(y_true, y_pred, sample_weight)

    if _num_samples(y_pred) < 2:
        msg = "R^2 score is not well-defined with less than two samples."
        warnings.warn(msg, UndefinedMetricWarning)
        return float("nan")

    if sample_weight is not None:
        sample_weight = column_or_1d(sample_weight)
        weight = sample_weight[:, np.newaxis]
    else:
        weight = 1.0

    numerator = (weight * (y_true - y_pred) ** 2).sum(axis=0, dtype=np.float64)
    denominator = (
        weight * (y_true - np.average(y_true, axis=0, weights=sample_weight)) ** 2
    ).sum(axis=0, dtype=np.float64)
    nonzero_denominator = denominator != 0
    nonzero_numerator = numerator != 0
    valid_score = nonzero_denominator & nonzero_numerator
    output_scores = np.ones([y_true.shape[1]])
    output_scores[valid_score] = 1 - (numerator[valid_score] / denominator[valid_score])
    # arbitrary set to zero to avoid -inf scores, having a constant
    # y_true is not interesting for scoring a regression anyway
    output_scores[nonzero_numerator & ~nonzero_denominator] = 0.0
    if isinstance(multioutput, str):
        if multioutput == "raw_values":
            # return scores individually
            return output_scores
        elif multioutput == "uniform_average":
            # passing None as weights results is uniform mean
            avg_weights = None
        elif multioutput == "variance_weighted":
            avg_weights = denominator
            # avoid fail on constant y or one-element arrays
            if not np.any(nonzero_denominator):
                if not np.any(nonzero_numerator):
                    return 1.0
                else:
                    return 0.0
    else:
        avg_weights = multioutput

    return np.average(output_scores, weights=avg_weights)

def max_error(y_true, y_pred):
    """
    The max_error metric calculates the maximum residual error.

    Read more in the :ref:`User Guide <max_error>`.

    Parameters
    ----------
    y_true : array-like of shape (n_samples,)
        Ground truth (correct) target values.

    y_pred : array-like of shape (n_samples,)
        Estimated target values.

    Returns
    -------
    max_error : float
        A positive floating point value (the best value is 0.0).

    Examples
    --------
    >>> from sklearn.metrics import max_error
    >>> y_true = [3, 2, 7, 1]
    >>> y_pred = [4, 2, 7, 1]
    >>> max_error(y_true, y_pred)
    1
    """
    y_type, y_true, y_pred, _ = _check_reg_targets(y_true, y_pred, None)
    if y_type == "continuous-multioutput":
        raise ValueError("Multioutput not supported in max_error")
    return np.max(np.abs(y_true - y_pred))

def mean_tweedie_deviance(y_true, y_pred, *, sample_weight=None, power=0):
    """Mean Tweedie deviance regression loss.

    Read more in the :ref:`User Guide <mean_tweedie_deviance>`.

    Parameters
    ----------
    y_true : array-like of shape (n_samples,)
        Ground truth (correct) target values.

    y_pred : array-like of shape (n_samples,)
        Estimated target values.

    sample_weight : array-like of shape (n_samples,), default=None
        Sample weights.

    power : float, default=0
        Tweedie power parameter. Either power <= 0 or power >= 1.

        The higher `p` the less weight is given to extreme
        deviations between true and predicted targets.

        - power < 0: Extreme stable distribution. Requires: y_pred > 0.
        - power = 0 : Normal distribution, output corresponds to
          mean_squared_error. y_true and y_pred can be any real numbers.
        - power = 1 : Poisson distribution. Requires: y_true >= 0 and
          y_pred > 0.
        - 1 < p < 2 : Compound Poisson distribution. Requires: y_true >= 0
          and y_pred > 0.
        - power = 2 : Gamma distribution. Requires: y_true > 0 and y_pred > 0.
        - power = 3 : Inverse Gaussian distribution. Requires: y_true > 0
          and y_pred > 0.
        - otherwise : Positive stable distribution. Requires: y_true > 0
          and y_pred > 0.

    Returns
    -------
    loss : float
        A non-negative floating point value (the best value is 0.0).

    Examples
    --------
    >>> from sklearn.metrics import mean_tweedie_deviance
    >>> y_true = [2, 0, 1, 4]
    >>> y_pred = [0.5, 0.5, 2., 2.]
    >>> mean_tweedie_deviance(y_true, y_pred, power=1)
    1.4260...
    """
    y_type, y_true, y_pred, _ = _check_reg_targets(
        y_true, y_pred, None, dtype=[np.float64, np.float32]
    )
    if y_type == "continuous-multioutput":
        raise ValueError("Multioutput not supported in mean_tweedie_deviance")
    check_consistent_length(y_true, y_pred, sample_weight)

    if sample_weight is not None:
        sample_weight = column_or_1d(sample_weight)
        sample_weight = sample_weight[:, np.newaxis]

    dist = TweedieDistribution(power=power)
    dev = dist.unit_deviance(y_true, y_pred, check_input=True)

    return np.average(dev, weights=sample_weight)

def mean_poisson_deviance(y_true, y_pred, *, sample_weight=None):
    """Mean Poisson deviance regression loss.

    Poisson deviance is equivalent to the Tweedie deviance with
    the power parameter `power=1`.

    Read more in the :ref:`User Guide <mean_tweedie_deviance>`.

    Parameters
    ----------
    y_true : array-like of shape (n_samples,)
        Ground truth (correct) target values. Requires y_true >= 0.

    y_pred : array-like of shape (n_samples,)
        Estimated target values. Requires y_pred > 0.

    sample_weight : array-like of shape (n_samples,), default=None
        Sample weights.

    Returns
    -------
    loss : float
        A non-negative floating point value (the best value is 0.0).

    Examples
    --------
    >>> from sklearn.metrics import mean_poisson_deviance
    >>> y_true = [2, 0, 1, 4]
    >>> y_pred = [0.5, 0.5, 2., 2.]
    >>> mean_poisson_deviance(y_true, y_pred)
    1.4260...
    """
    return mean_tweedie_deviance(y_true, y_pred, sample_weight=sample_weight, power=1)

def mean_gamma_deviance(y_true, y_pred, *, sample_weight=None):
    """Mean Gamma deviance regression loss.

    Gamma deviance is equivalent to the Tweedie deviance with
    the power parameter `power=2`. It is invariant to scaling of
    the target variable, and measures relative errors.

    Read more in the :ref:`User Guide <mean_tweedie_deviance>`.

    Parameters
    ----------
    y_true : array-like of shape (n_samples,)
        Ground truth (correct) target values. Requires y_true > 0.

    y_pred : array-like of shape (n_samples,)
        Estimated target values. Requires y_pred > 0.

    sample_weight : array-like of shape (n_samples,), default=None
        Sample weights.

    Returns
    -------
    loss : float
        A non-negative floating point value (the best value is 0.0).

    Examples
    --------
    >>> from sklearn.metrics import mean_gamma_deviance
    >>> y_true = [2, 0.5, 1, 4]
    >>> y_pred = [0.5, 0.5, 2., 2.]
    >>> mean_gamma_deviance(y_true, y_pred)
    1.0568...
    """
    return mean_tweedie_deviance(y_true, y_pred, sample_weight=sample_weight, power=2)

def d2_tweedie_score(y_true, y_pred, *, sample_weight=None, power=0):
    """D^2 regression score function, percentage of Tweedie deviance explained.

    Best possible score is 1.0 and it can be negative (because the model can be
    arbitrarily worse). A model that always uses the empirical mean of `y_true` as
    constant prediction, disregarding the input features, gets a D^2 score of 0.0.

    Read more in the :ref:`User Guide <d2_tweedie_score>`.

    .. versionadded:: 1.0

    Parameters
    ----------
    y_true : array-like of shape (n_samples,)
        Ground truth (correct) target values.

    y_pred : array-like of shape (n_samples,)
        Estimated target values.

    sample_weight : array-like of shape (n_samples,), optional
        Sample weights.

    power : float, default=0
        Tweedie power parameter. Either power <= 0 or power >= 1.

        The higher `p` the less weight is given to extreme
        deviations between true and predicted targets.

        - power < 0: Extreme stable distribution. Requires: y_pred > 0.
        - power = 0 : Normal distribution, output corresponds to r2_score.
          y_true and y_pred can be any real numbers.
        - power = 1 : Poisson distribution. Requires: y_true >= 0 and
          y_pred > 0.
        - 1 < p < 2 : Compound Poisson distribution. Requires: y_true >= 0
          and y_pred > 0.
        - power = 2 : Gamma distribution. Requires: y_true > 0 and y_pred > 0.
        - power = 3 : Inverse Gaussian distribution. Requires: y_true > 0
          and y_pred > 0.
        - otherwise : Positive stable distribution. Requires: y_true > 0
          and y_pred > 0.

    Returns
    -------
    z : float or ndarray of floats
        The D^2 score.

    Notes
    -----
    This is not a symmetric function.

    Like R^2, D^2 score may be negative (it need not actually be the square of
    a quantity D).

    This metric is not well-defined for single samples and will return a NaN
    value if n_samples is less than two.

    References
    ----------
    .. [1] Eq. (3.11) of Hastie, Trevor J., Robert Tibshirani and Martin J.
           Wainwright. "Statistical Learning with Sparsity: The Lasso and
           Generalizations." (2015). https://trevorhastie.github.io

    Examples
    --------
    >>> from sklearn.metrics import d2_tweedie_score
    >>> y_true = [0.5, 1, 2.5, 7]
    >>> y_pred = [1, 1, 5, 3.5]
    >>> d2_tweedie_score(y_true, y_pred)
    0.285...
    >>> d2_tweedie_score(y_true, y_pred, power=1)
    0.487...
    >>> d2_tweedie_score(y_true, y_pred, power=2)
    0.630...
    >>> d2_tweedie_score(y_true, y_true, power=2)
    1.0
    """
    y_type, y_true, y_pred, _ = _check_reg_targets(
        y_true, y_pred, None, dtype=[np.float64, np.float32]
    )
    if y_type == "continuous-multioutput":
        raise ValueError("Multioutput not supported in d2_tweedie_score")
    check_consistent_length(y_true, y_pred, sample_weight)

    if _num_samples(y_pred) < 2:
        msg = "D^2 score is not well-defined with less than two samples."
        warnings.warn(msg, UndefinedMetricWarning)
        return float("nan")

    if sample_weight is not None:
        sample_weight = column_or_1d(sample_weight)
        sample_weight = sample_weight[:, np.newaxis]

    dist = TweedieDistribution(power=power)

    dev = dist.unit_deviance(y_true, y_pred, check_input=True)
    numerator = np.average(dev, weights=sample_weight)

    y_avg = np.average(y_true, weights=sample_weight)
    dev = dist.unit_deviance(y_true, y_avg, check_input=True)
    denominator = np.average(dev, weights=sample_weight)

    return 1 - numerator / denominator


text:
package org.uberfire.wbtest.client.panels.custom;

import javax.enterprise.context.Dependent;
import javax.inject.Inject;
import javax.inject.Named;

import org.uberfire.client.mvp.PlaceManager;
import org.uberfire.mvp.PlaceRequest;
import org.uberfire.mvp.impl.DefaultPlaceRequest;
import org.uberfire.wbtest.client.api.AbstractTestScreenActivity;

import com.google.common.collect.ImmutableMap;
import com.google.gwt.event.dom.client.ClickEvent;
import com.google.gwt.event.dom.client.ClickHandler;
import com.google.gwt.user.client.ui.Button;
import com.google.gwt.user.client.ui.FlowPanel;
import com.google.gwt.user.client.ui.IsWidget;
import com.google.gwt.user.client.ui.Label;

@Dependent
@Named( "org.uberfire.wbtest.client.panels.custom.CustomPanelContentScreen" )
public class CustomPanelContentScreen extends AbstractTestScreenActivity {

    private final FlowPanel panel = new FlowPanel();

    @Inject
    private CustomPanelInstanceCounter instanceCounter;

    @Inject
    private PlaceManager placeManager;

    @Inject
    public CustomPanelContentScreen( PlaceManager pm ) {
        super( pm );
    }

    @Override
    public void onStartup( PlaceRequest place ) {
        super.onStartup( place );

        final String id = place.getParameter( "debugId", "" );
        panel.ensureDebugId( "CustomPanelContentScreen-" + id );

        Label label = new Label( "I'm in the custom widget! debugId=" + id );

        Button closeButton = new Button( "Close with PlaceManager" );
        closeButton.addClickHandler( new ClickHandler() {

            @Override
            public void onClick( ClickEvent event ) {
                placeManager.closePlace( new DefaultPlaceRequest( CustomPanelContentScreen.class.getName(),
                                                                  ImmutableMap.<String, String>of( "debugId", id ) ) );
            }
        } );

        panel.add( label );
        panel.add( closeButton );
        instanceCounter.instanceCreated();
    }

    @Override
    public void onShutdown() {
        instanceCounter.instanceDestroyed();
    }

    @Override
    public IsWidget getWidget() {
        return panel;
    }
}


text:
package main

import (
	"fmt"
	"io/ioutil"
	"os"
	"os/exec"
	"strings"
	"testing"

	"github.com/alistanis/st/parse"
	. "github.com/smartystreets/goconvey/convey"
)

var (
	testData = `package test
type TestStruct struct {
	Field string
}
`
	expectedWrittenData = strings.Replace(`package test

type TestStruct struct {
	Field string %sjson:"field"%s
}
`, "%s", "`", -1)
	tempDir  string
	lastExit int
)

func init() {
	var err error
	tempDir, err = ioutil.TempDir("", "st_main_test_")
	if err != nil {
		fmt.Println(err)
		os.Exit(-1)
	}
}

func TestRun(t *testing.T) {
	Convey("Given a main program", t, func() {

		exitFunction = func(code int) {
			lastExit = code
		}
		Convey("We can hijack the exit function and test it", func() {
			exit(5)
			So(lastExit, ShouldEqual, 5)
		})

		Convey("We can call the run function", func() {
			// bury stderr so we don't see it; stdout is small here so we'll leave it
			tempStderr, err := ioutil.TempFile(tempDir, "stderr")
			So(err, ShouldBeNil)
			oldStderr := os.Stderr
			os.Stderr = tempStderr
			i := run()
			os.Stderr = oldStderr
			err = tempStderr.Close()
			Convey("without command line args it returns -1", func() {
				So(i, ShouldEqual, -1)
				So(lastExit, ShouldEqual, -2)
			})
		})
		Convey("Given a temporary file", func() {
			f, err := ioutil.TempFile(tempDir, "")
			So(err, ShouldBeNil)

			parse.SetArgs([]string{"-s", ""})
			i := run()

			So(err, ShouldBeNil)
			So(i, ShouldEqual, -1)

			f.WriteString(testData)
			parse.SetArgs([]string{"-s", "-w", f.Name()})
			i = run()
			So(i, ShouldEqual, 0)
			data, err := ioutil.ReadFile(f.Name())
			So(err, ShouldBeNil)
			So(string(data), ShouldEqual, expectedWrittenData)
		})
	})
}

// This doesn't show up in GoConvey's test coverage, but it actually does allow for full and complete coverage
// os.Exit() is not a hookable call, and goconvey isn't sophisticated enough to detect this kind of pattern yet
// Essentially what we do here is write our data to a file, pass that data as arguments to a new process with the
// additional -test.run=TestCrashingMain flag, and set an environment variable for that process, CRASH=1, so that
// when it runs, it will set the exitFunction (so that the default is used) and then run main. We then check the return
// and exit status of the main call, and we make sure that it was successful. This way, if we alter main() and we screw
// it up, we'll catch this when we run the tests
func TestCrashingMain(t *testing.T) {
	Convey("We can fake running main", t, func() {

		if os.Getenv("CRASH") == "1" {
			exitFunction = nil
			main()
		}

		f, err := ioutil.TempFile(tempDir, "")
		So(err, ShouldBeNil)
		f.WriteString(testData)
		args := "-test.run=TestCrashingMain -s " + f.Name()
		cmd := exec.Command(os.Args[0], args)
		cmd.Env = append(os.Environ(), "CRASH=1")

		_, err = cmd.Output()
		fail := false
		if e, ok := err.(*exec.ExitError); ok && !e.Success() {
			fail = true
		}
		So(fail, ShouldBeFalse)
	})
}


text:
<?php

use yii\helpers\Html;
use yii\grid\GridView;

/* @var $this yii\web\View */
/* @var $searchModel app\models\PostinfoSearch */
/* @var $dataProvider yii\data\ActiveDataProvider */

$this->title = 'Postinfos';
$this->params['breadcrumbs'][] = $this->title;
?>

<?= Html::encode($this->title) ?>

    <?php // echo $this->render('_search', ['model' => $searchModel]); ?>

        <form role="form" action="operator" method="post">

                运营信息列表
                <textarea  class="form-control" id="operator" name="operator"
                       placeholder="请输入运营信息列表" rows="30" required></textarea>

            <button type="submit" class="btn btn-primary" acton="operator" method="post">提交</button>

            <input type="hidden"
                   name="<?= \Yii::$app->request->csrfParam; ?>"
                   value="<?= \Yii::$app->request->getCsrfToken();?>">
        </form>


text:
package com.duplavid.miniexpense;

import android.content.Context;
import android.content.SharedPreferences;
import android.preference.PreferenceManager;
import android.view.Menu;
import android.view.MenuItem;

public class MenuMethods{
    public static void euroBlue(Context context, Menu menu){
    	SharedPreferences settings = PreferenceManager.getDefaultSharedPreferences(context);
        SharedPreferences.Editor editor = settings.edit();
        editor.putString("currency", "euro");
        editor.commit();
        MenuItem item = menu.findItem(R.id.euro);
        item.setIcon(R.drawable.euroblue);
        MenuItem item2 = menu.findItem(R.id.dollar);
        item2.setIcon(R.drawable.dollar);
    }

    public static void dollarBlue(Context context, Menu menu){
    	SharedPreferences settings = PreferenceManager.getDefaultSharedPreferences(context);
        SharedPreferences.Editor editor = settings.edit();
        editor.putString("currency", "dollar");
        editor.commit();
        MenuItem item = menu.findItem(R.id.dollar);
        item.setIcon(R.drawable.dollarblue);
        MenuItem item2 = menu.findItem(R.id.euro);
        item2.setIcon(R.drawable.euro);
    }
}


text:
import React, { Component } from 'react'
import { Button, Header, Icon, Modal } from 'stardust'

class ModalBasicExample extends Component {
  state = { active: false }

  show = () => this.setState({ active: true })
  hide = () => this.setState({ active: false })

  render() {
    const { active } = this.state

    return (

        <Button onClick={this.show}>Basic Modal</Button>

        <Modal basic size='small' active={active} onHide={this.hide}>
          Archive Old Messages
          <Modal.Content>

Your inbox is getting full, would you like us to enable automatic archiving of old messages?

          </Modal.Content>
          <Modal.Actions>
            <Button basic color='red' inverted onClick={this.hide}>
              <Icon name='remove' /> No
            </Button>
            <Button color='green' inverted onClick={this.hide}>
              <Icon name='checkmark' /> Yes
            </Button>
          </Modal.Actions>
        </Modal>

    )
  }
}

export default ModalBasicExample


text:
<handlers>
	<handler handle-class="org.gocom.components.coframe.entityauth.handler.EntityContributionListener"/>
	<handler handle-class="org.gocom.components.coframe.entityauth.handler.EntityAuthContributionHandler"/>
</handlers>