text:
import os
import sys
import time
import math

import torch.nn as nn
import torch.nn.init as init
import torch.nn.functional as F

import numpy as np
import torch

def mixup_data(x, y, alpha=1.0, use_cuda=True, per_sample=False):

    '''Compute the mixup data. Return mixed inputs, pairs of targets, and lambda'''
    batch_size = x.size()[0]
    if use_cuda:
        index = torch.randperm(batch_size).cuda()
    else:
        index = torch.randperm(batch_size)

    if alpha > 0. and not per_sample:
        lam = torch.zeros(y.size(0)).fill_(np.random.beta(alpha, alpha)).cuda()
        mixed_x = lam.view(-1, 1, 1, 1) * x + (1 - lam.view(-1, 1, 1, 1)) * x[index,:]
    elif alpha > 0.:
        lam = torch.Tensor(np.random.beta(alpha, alpha, size=y.size())).cuda()
        mixed_x = lam.view(-1, 1, 1, 1) * x + (1 - lam.view(-1, 1, 1, 1)) * x[index,:]
    else:
        lam = torch.ones(y.size()).cuda()
        mixed_x = x

    y_a, y_b = y, y[index]
    return mixed_x, y_a, y_b, lam

def mixup_lam_idx(batch_size, alpha, use_cuda=True):
    '''Compute the mixup data. Return mixed inputs, pairs of targets, and lambda'''
    if alpha > 0.:
        lam = np.random.beta(alpha, alpha)
    else:
        lam = 1.
    if use_cuda:
        index = torch.randperm(batch_size).cuda()
    else:
        index = torch.randperm(batch_size)

    return lam, index

def mixup_criterion(y_a, y_b, lam):
    return lambda criterion, pred: criterion(pred, y_a, lam) + criterion(pred, y_b, 1 - lam)

def get_mean_and_std(dataset):
    '''Compute the mean and std value of dataset.'''
    dataloader = torch.utils.data.DataLoader(dataset, batch_size=1, shuffle=True, num_workers=2)
    mean = torch.zeros(3)
    std = torch.zeros(3)
    print('==> Computing mean and std..')
    for inputs, targets in dataloader:
        for i in range(3):
            mean[i] += inputs[:,i,:,:].mean()
            std[i] += inputs[:,i,:,:].std()
    mean.div_(len(dataset))
    std.div_(len(dataset))
    return mean, std


text:
package controllers.sitedata.modality.cl

import javax.inject._
import play.api._
import play.api.mvc._
import play.api.data.Form
import play.api.data.Forms._
import play.api.data._
import play.api.i18n.Messages
import play.api.i18n.I18nSupport
import play.api.i18n.MessagesApi
import play.Application
import utils.Awaits
import utils._
import models.sitedata.SiteInfo
import models.sitedata.joined.SiteInfoAll
import services.sitedata.ISiteInfoService
import services.sitedata.joined.ISiteInfoAllService
import play.api.libs.iteratee.Enumerator
import reports.ReportBuilder
import play.api.Configuration

@Singleton
class SiteInfoController @Inject() (
  val messagesApi: MessagesApi,
  val applicationconf: Configuration,
  val service_siteinfo: ISiteInfoService,
  val service_siteinfoall: ISiteInfoAllService
) extends Controller with I18nSupport {

  val siteinfoForm: Form[SiteInfo] = Form(
    mapping(
      "siteid"             -> text,
      "sitename"           -> text,
      "subzoneid"          -> longNumber,
      "equipmentmodelid"   -> longNumber,
      "supplement"         -> optional(text),
      "spipaddress"        -> optional(text),
      "equipmentipaddress" -> optional(text),
      "routeipaddress"     -> optional(text),
      "note"               -> optional(text),
      "axedasite"          -> boolean
    )(models.sitedata.SiteInfo.apply)(models.sitedata.SiteInfo.unapply))

  def index = Action { implicit request =>
    Logger.info("/cl -> SiteInfoController index called.")

    val im: IndexedModality = ICL
    val siteinfo = Awaits.get(5, service_siteinfo.findByModalityId(im.index)).getOrElse(Seq())
//    Logger.info("return cl site info are " + siteinfo)

    Ok(views.html.sitedata.siteinfo.cl.index(siteinfo))
  }

  def blank = Action { implicit request =>
    Logger.info("blank called. ")
    Ok(views.html.sitedata.siteinfo.create("", siteinfoForm))
  }

  def details(siteid: String) = Action { implicit request =>
    Logger.info("details called. siteid: " + siteid)

    val siteinfo = Awaits.get(5, service_siteinfoall.findBySiteId(siteid)).get
    Logger.info("return site info are " + siteinfo)

    Ok(views.html.sitedata.siteinfo.details(siteinfo))
  }

  def insert()= Action { implicit request =>
    Logger.info("insert called.")
    siteinfoForm.bindFromRequest.fold(
      form => {
        BadRequest(views.html.sitedata.siteinfo.insert("", form))
      },
      siteinfo => {
        service_siteinfo.insert(siteinfo)
        Redirect(controllers.sitedata.modality.cl.routes.SiteInfoController.index)
          .flashing("success" -> Messages("success.insert", "new siteinfo created"))
      })
  }

  def update(siteid: String) = Action { implicit request =>
    Logger.info("updated called. id: " + siteid)
    siteinfoForm.bindFromRequest.fold(
      form => {
        Ok(views.html.sitedata.siteinfo.update("", form))
          .flashing("error" -> "Fix the errors!")
      },
      siteinfo => {
        service_siteinfo.update(siteid, siteinfo)
        Redirect(controllers.sitedata.modality.cl.routes.SiteInfoController.index)
          .flashing("success" -> Messages("success.update", siteinfo.sitename))
      })
  }

  def remove(siteid: String)= Action {

      import play.api.libs.concurrent.Execution.Implicits.defaultContext

      val result =  Awaits.get(5, service_siteinfo.findById(siteid))

      result.map { siteinfo =>
        service_siteinfo.remove(siteid)
        Redirect(controllers.sitedata.modality.cl.routes.SiteInfoController.index)
          .flashing("success" -> Messages("success.delete", siteinfo.sitename))
      }.getOrElse(NotFound)
  }

  def report() = Action {

    import play.api.libs.concurrent.Execution.Implicits.defaultContext

    val url = applicationconf.getString("slick.dbs.SiteData.db.url").getOrElse("None")

    Ok.chunked( Enumerator.fromStream( ReportBuilder.toPdf("SiteInfo_CL.jrxml", url) ) )
      .withHeaders(CONTENT_TYPE -> "application/octet-stream")
      .withHeaders(CONTENT_DISPOSITION -> "attachment; filename=report-siteinfo_cl.pdf"
    )
  }

}

redpajama_set_name: RedPajamaGithub


text:
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
// Code generated by Microsoft (R) AutoRest Code Generator.

package com.azure.resourcemanager.appservice.generated;

import com.azure.core.util.Context;
import com.azure.resourcemanager.appservice.models.DomainRecommendationSearchParameters;

/** Samples for Domains ListRecommendations. */
public final class DomainsListRecommendationsSamples {
    /*
     * x-ms-original-file: specification/web/resource-manager/Microsoft.DomainRegistration/stable/2022-03-01/examples/ListDomainRecommendations.json
     */
    /**
     * Sample code: List domain recommendations.
     *
     * @param azure The entry point for accessing resource management APIs in Azure.
     */
    public static void listDomainRecommendations(com.azure.resourcemanager.AzureResourceManager azure) {
        azure
            .webApps()
            .manager()
            .serviceClient()
            .getDomains()
            .listRecommendations(
                new DomainRecommendationSearchParameters().withKeywords("example1").withMaxDomainRecommendations(10),
                Context.NONE);
    }
}


text:
<?xml version="1.0"?>
<!DOCTYPE article PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN" "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd">
<article xmlns="http://docbook.org/ns/docbook">
  <para>SMALL</para>
  <para>will generally be SMALL</para>
  <para>whereas:</para>
  <para>HUGE!</para>
  <para>will be HUGE!</para>
</article>


text:
import blogTemplate from './blog.html';

export default {
    template: blogTemplate,
    controller: 'BlogCtrl as blog'
};


text:
import Book from '../Book/Book';

require('normalize.css');
require('./BookList.scss');

import React from 'react';

export default class BookList extends React.Component {
    render() {
        const {dispatch, books, onBookClick} = this.props;
        const {isFetching, items} = books;

        return (

                    {items.map( (book, index) =>
                        <Book {...book}
                            key={index}
                            onClick={ () => onBookClick(index) } />
                    )}

        );
    }
}

BookList.defaultProps = {
};