text:
bool TwoWayPipe::CreateServer(const ProcessDescriptor& pd)
{
    _ASSERTE(m_state == NotInitialized);
    if (m_state != NotInitialized)
        return false;

    PAL_GetTransportPipeName(m_inPipeName, pd.m_Pid, pd.m_ApplicationGroupId, "in");
    PAL_GetTransportPipeName(m_outPipeName, pd.m_Pid, pd.m_ApplicationGroupId, "out");

    unlink(m_inPipeName);

    if (mkfifo(m_inPipeName, S_IRWXU) == -1)
    {
        return false;
    }

    unlink(m_outPipeName);

    if (mkfifo(m_outPipeName, S_IRWXU) == -1)
    {
        unlink(m_inPipeName);
        return false;
    }

    m_state = Created;
    return true;
}

// Connects to a previously opened server side of the pipe.
// Id is used to locate the pipe on the machine.
// true - success, false - failure (use GetLastError() for more details)
bool TwoWayPipe::Connect(const ProcessDescriptor& pd)
{
    _ASSERTE(m_state == NotInitialized);
    if (m_state != NotInitialized)
        return false;

    //"in" and "out" are switched deliberately, because we're on the client
    PAL_GetTransportPipeName(m_inPipeName, pd.m_Pid, pd.m_ApplicationGroupId, "out");
    PAL_GetTransportPipeName(m_outPipeName, pd.m_Pid, pd.m_ApplicationGroupId, "in");

    // Pipe opening order is reversed compared to WaitForConnection()
    // in order to avaid deadlock.
    m_outboundPipe = open(m_outPipeName, O_WRONLY);
    if (m_outboundPipe == INVALID_PIPE)
    {
        return false;
    }

    m_inboundPipe = open(m_inPipeName, O_RDONLY);
    if (m_inboundPipe == INVALID_PIPE)
    {
        close(m_outboundPipe);
        m_outboundPipe = INVALID_PIPE;
        return false;
    }

    m_state = ClientConnected;
    return true;

}

// Waits for incoming client connections, assumes GetState() == Created
// true - success, false - failure (use GetLastError() for more details)
bool TwoWayPipe::WaitForConnection()
{
    _ASSERTE(m_state == Created);
    if (m_state != Created)
        return false;

    m_inboundPipe = open(m_inPipeName, O_RDONLY);
    if (m_inboundPipe == INVALID_PIPE)
    {
        return false;
    }

    m_outboundPipe = open(m_outPipeName, O_WRONLY);
    if (m_outboundPipe == INVALID_PIPE)
    {
        close(m_inboundPipe);
        m_inboundPipe = INVALID_PIPE;
        return false;
    }

    m_state = ServerConnected;
    return true;
}

// Reads data from pipe. Returns number of bytes read or a negative number in case of an error.
// use GetLastError() for more details
// UNIXTODO - mjm 9/6/15 - does not set last error on failure
int TwoWayPipe::Read(void *buffer, DWORD bufferSize)
{
    _ASSERTE(m_state == ServerConnected || m_state == ClientConnected);

    int totalBytesRead = 0;
    int bytesRead;
    int cb = bufferSize;

    while ((bytesRead = (int)read(m_inboundPipe, buffer, cb)) > 0)
    {
        totalBytesRead += bytesRead;
        _ASSERTE(totalBytesRead <= (int)bufferSize);
        if (totalBytesRead >= (int)bufferSize)
        {
            break;
        }

        buffer = (char*)buffer + bytesRead;
        cb -= bytesRead;
    }

    return bytesRead == -1 ? -1 : totalBytesRead;
}

// Writes data to pipe. Returns number of bytes written or a negative number in case of an error.
// use GetLastError() for more details
// UNIXTODO - mjm 9/6/15 - does not set last error on failure
int TwoWayPipe::Write(const void *data, DWORD dataSize)
{
    _ASSERTE(m_state == ServerConnected || m_state == ClientConnected);

    int totalBytesWritten = 0;
    int bytesWritten;
    int cb = dataSize;

    while ((bytesWritten = (int)write(m_outboundPipe, data, cb)) > 0)
    {
        totalBytesWritten += bytesWritten;
        _ASSERTE(totalBytesWritten <= (int)dataSize);
        if (totalBytesWritten >= (int)dataSize)
        {
            break;
        }

        data = (char*)data + bytesWritten;
        cb -= bytesWritten;
    }

    return bytesWritten == -1 ? -1 : totalBytesWritten;
}

// Disconnect server or client side of the pipe.
// true - success, false - failure (use GetLastError() for more details)
bool TwoWayPipe::Disconnect()
{
    // IMPORTANT NOTE: This function must not call any signal unsafe functions
    // since it is called from signal handlers.
    // That includes ASSERT and TRACE macros.

    if (m_state == ServerConnected || m_state == Created)
    {
        unlink(m_inPipeName);
        unlink(m_outPipeName);
    }

    m_state = NotInitialized;
    return true;
}

// Used by debugger side (RS) to cleanup the target (LS) named pipes
// and semaphores when the debugger detects the debuggee process  exited.
void TwoWayPipe::CleanupTargetProcess()
{
    unlink(m_inPipeName);
    unlink(m_outPipeName);
}


text:
<?php

namespace Uruloke\LaraCalendar\Contracts\Restrictions;

use Illuminate\Support\Carbon;
use Uruloke\LaraCalendar\EventCollection;

interface Restrictionable
{
    public function passes(Carbon $currentDay, EventCollection $events): bool;
}

redpajama_set_name: RedPajamaGithub


text:
namespace HotelSupervisorService.Forms.Controls.ISettingObjectEditControls
{
    partial class PolicemanSettingObjectEditControl
    {
        /// <summary>
        /// 必需的设计器变量。
        /// </summary>
        private System.ComponentModel.IContainer components = null;

        /// <summary>
        /// 清理所有正在使用的资源。
        /// </summary>
        /// <param name="disposing">如果应释放托管资源,为 true;否则为 false。</param>
        protected override void Dispose(bool disposing)
        {
            if (disposing && (components != null))
            {
                components.Dispose();
            }
            base.Dispose(disposing);
        }

        #region 组件设计器生成的代码

        /// <summary>
        /// 设计器支持所需的方法 - 不要
        /// 使用代码编辑器修改此方法的内容。
        /// </summary>
        private void InitializeComponent()
        {
            this.SuspendLayout();
            //
            // PolicemanSettingObjectEditControl
            //
            this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
            this.Name = "PolicemanSettingObjectEditControl";
            this.ResumeLayout(false);

        }

        #endregion
    }
}


text:
using System;
using System.Collections.Generic;
using System.Text;
using FlubuCore.Context;
using FlubuCore.Tasks;
using FlubuCore.Tasks.Attributes;
using FlubuCore.Tasks.Process;

namespace FlubuCore.Tasks.Docker.Config
{
    public partial class DockerConfigLsTask : ExternalProcessTaskBase<int, DockerConfigLsTask>
    {
        public DockerConfigLsTask()
        {
            ExecutablePath = "docker";
            WithArguments("config ls");
        }

        protected override string Description { get; set; }

        /// <summary>
        /// Filter output based on conditions provided
        /// </summary>
        [ArgKey("--filter")]
        public DockerConfigLsTask Filter(string filter)
        {
            WithArgumentsKeyFromAttribute(filter.ToString());
            return this;
        }

        /// <summary>
        /// Pretty-print configs using a Go template
        /// </summary>
        [ArgKey("--format")]
        public DockerConfigLsTask Format(string format)
        {
            WithArgumentsKeyFromAttribute(format.ToString());
            return this;
        }

        /// <summary>
        /// Only display IDs
        /// </summary>
        [ArgKey("--quiet")]
        public DockerConfigLsTask Quiet()
        {
            WithArgumentsKeyFromAttribute();
            return this;
        }

        protected override int DoExecute(ITaskContextInternal context)
        {
            return base.DoExecute(context);
        }
    }
}


text:
$('.modal-trigger').leanModal({
  //dismissible: true, // Modal can be dismissed by clicking outside of the modal
  opacity: 0, // Opacity of modal background
  in_duration: 300, // Transition in duration
  out_duration: 200, // Transition out duration
  //starting_top: '4%', // Starting top style attribute
  //ending_top: '10%', // Ending top style attribute
  //ready: function() { alert('Ready'); }, // Callback for Modal open
  //complete: function() { alert('Closed'); } // Callback for Modal close
}
);


text:
var mustache = require('mustache')
var templates = require('../interface/templates')
var request = require('request')
var List = require('list.js')
var Modal = require('../interface/modal')
var lang = require('../interface/lang/lang')
var lg = lang.get.bind(lang)

function RoomManager () {
  var self = this
  if (!(self instanceof RoomManager)) return new RoomManager()

  self.container = document.getElementById('content-body')
  self.listElement = document.querySelector('.list')
  self.loginHost = window.location.protocol + '//' + window.location.host // default host setting

  document.getElementById('modal').style.display = 'none'
  document.getElementById('overlay').style.display = 'none'
}

RoomManager.prototype.postRoom = function (values, onRoom, modal) {
  var self = this

  var options = {
    method: 'POST',
    url: self.loginHost + '/room',
    headers:
    {
      'cache-control': 'no-cache',
      'content-type': 'application/json'
    },
    body: values,
    json: true
  }
  request(options, function (error, response, body) {
    if (error) throw new Error(error)
    if (body.flag) {
      modal.close()
      self.closeRoomView()
      onRoom({room: values.roomName})
    } else {
      var inputs = modal.el.querySelectorAll('input')
      inputs[0].value = ''
      inputs[0].placeholder = 'already exist'
    }
  })
}

RoomManager.prototype.getRoomList = function (callback) {
  var self = this

  var options = {
    method: 'GET',
    url: self.loginHost + '/roomList',
    headers:
    {
      'cache-control': 'no-cache',
      'content-type': 'application/json'
    },
    json: true
  }

  request(options, function (error, response, body) {
    if (error) throw new Error(error)

    callback({'rooms': body})
  })
}

RoomManager.prototype.openRoomView = function (onRoom) {
  var self = this
  self.getRoomList(function (data) {
    self.listElement.innerHTML = mustache.render(templates['roomList'], data)
    self.roomViewInit(onRoom)
  })
}

RoomManager.prototype.roomViewInit = function (onRoom) {
  var self = this

  // create 버튼 이벤트 설정
  var CreateBtn = document.querySelector('.btn')
  CreateBtn.addEventListener('click', function () {
    self.createRoom(onRoom)
  })

  // 리스트를 순회하면서 project를 선택했을 때 이벤트 설정
  var projectNames = document.getElementsByClassName('name')

  for (var i = 0, len = projectNames.length; i < len; i++) {
    projectNames[i].addEventListener('click', function (e) {
      // 프로젝트 view로 변경한다
      self.closeRoomView()
      onRoom({
        room: e.target.innerHTML
      })
    })
  }

  // List 라이브러리의 객체를 생성하면 알아서 각 기능을을 잡아준다
  // input에 이벤트를 달아서 검색을 하게 해 주며 검색 결과를 ul에 적용한다
  var projectList = new List('project-list', {valueNames: ['name']})
}

RoomManager.prototype.createRoom = function (onRoom) {
  var self = this
  // 모달창을 만들고 나서 모달창을 감싸는 부분의 classname으로 만들면 이 안에 들어가는 것 같다

  var roomModal = new Modal('createRoom', {
    title: 'Create Room'
  })
  roomModal.on('done', function (e) {
    // roomModal.close()
    var output = {
      roomName: e.inputs[0].value,
      roomDiscription: e.inputs[1].value
    }

    self.postRoom(output, onRoom, roomModal)
  })
  roomModal.on('cancel', function () {
    roomModal.close()
  })
  roomModal.open()
}

RoomManager.prototype.closeRoomView = function () {
  // var self = this
  // 룸 화면을 벗어날 떄 호출된다.
}

module.exports = RoomManager


text:
package auth

import (
	tr "github.com/desertbit/bulldozer/translate"

	"github.com/desertbit/bulldozer/log"
	"github.com/desertbit/bulldozer/mux"
	"github.com/desertbit/bulldozer/sessions"
	"github.com/desertbit/bulldozer/settings"
	"github.com/desertbit/bulldozer/template"
	"github.com/desertbit/bulldozer/templates"
	"github.com/desertbit/bulldozer/ui/messagebox"
	"github.com/desertbit/bulldozer/utils"
	"github.com/desertbit/bulldozer/utils/mail"

	"fmt"
	"strings"
	"time"
)

const (
	randomPasswordLength = 15
)

//#######################//
//### Register Events ###//
//#######################//

type registerEvents struct{}

func (e *registerEvents) EventRegister(c *template.Context, name string, loginName string, email string) {
	// Get the session pointer.
	s := c.Session()

	// Always hide the loading indicator on exit
	defer s.HideLoadingIndicator()

	// Just be sure...
	if settings.Settings.RegistrationDisabled {
		showRegisterErrorMsgBox(s, tr.S("bud.auth.register.errorMsgBoxTextRegistrationDisabled"))
		return
	}

	// Prepare the inputs.
	name = strings.TrimSpace(name)
	loginName = strings.ToLower(strings.TrimSpace(loginName))
	email = strings.TrimSpace(email)

	// Validate...
	if len(name) == 0 || len(loginName) == 0 || len(email) == 0 || !strings.Contains(email, "@") ||
		len(name) > maxLength || len(loginName) > maxLength || len(email) > maxLength {
		showRegisterErrorMsgBox(s, tr.S("bud.auth.register.error.general"))
		return
	}

	// Check if user already exists.
	exist, err := dbUserExists(loginName)
	if err != nil {
		log.L.Error("failed to check if user '%s' exists: %v", loginName, err)
		showRegisterErrorMsgBox(s, tr.S("bud.auth.register.error.generalShort"))
		return
	} else if exist {
		showRegisterErrorMsgBox(s, tr.S("bud.auth.register.error.userAlreadyExists", loginName))
		return
	}

	// Generate a random new password.
	password := utils.RandomString(randomPasswordLength)

	// Add the user to the database
	u, err := dbAddUser(loginName, name, email, password, true)
	if err != nil {
		log.L.Error("failed to add user '%s' to database: %v", loginName, err)
		showRegisterErrorMsgBox(s, tr.S("bud.auth.register.error.generalShort"))
		return
	}

	// Send the registration e-mail.
	err = sendRegistrationEMail(u, password)
	if err != nil {
		log.L.Error("%v", err)
		showRegisterErrorMsgBox(s, tr.S("bud.auth.register.error.generalShort"))
		return
	}

	// Redirect to the login page.
	NavigateToLoginPage(s)

	// Just timeout for a short period, because the navigation call is
	// process in a separate goroutine. Otherwise the messagebox
	// would be shown before the page is changed.
	time.Sleep(350 * time.Millisecond)

	// Show a success message box.
	messagebox.New().
		SetTitle(tr.S("bud.auth.register.success.title")).
		SetText(tr.S("bud.auth.register.success.text")).
		SetType(messagebox.TypeSuccess).
		Show(s)
}

//###############//
//### Private ###//
//###############//

func routeRegisterPage(s *sessions.Session, req *mux.Request) {
	// If already authenticated, then redirect to the default page.
	if IsAuth(s) {
		s.NavigateHome()
		return
	}

	// If the registration is disabled, then redirect to the login page.
	if settings.Settings.RegistrationDisabled {
		NavigateToLoginPage(s)
		return
	}

	// Execute the login template.
	o, _, _, err := templates.Templates.ExecuteTemplateToString(s, registerTemplate)
	if err != nil {
		req.Error(fmt.Errorf("failed to execute register template: %v", err))
		return
	}

	// Set the body and title
	req.Body = o
	req.Title = tr.S("bud.auth.register.pageTitle")
	return
}

func showRegisterErrorMsgBox(s *sessions.Session, msg string) {
	// Show a messagebox
	messagebox.New().
		SetTitle(tr.S("bud.auth.register.errorMsgBoxTitle")).
		SetText(msg).
		SetType(messagebox.TypeAlert).
		Show(s)
}

func sendRegistrationEMail(u *dbUser, password string) error {
	// Create the login url.
	loginURL := settings.Settings.SiteUrl + LoginPageUrl

	// The replace function.
	replaceArgs := func(s string) string {
		s = strings.Replace(s, "$SiteURL", settings.Settings.SiteUrl, -1)
		s = strings.Replace(s, "$LoginURL", loginURL, -1)
		s = strings.Replace(s, "$Password", password, -1)
		return s
	}

	// Create a new mail message.
	m := mail.Message{
		To:      []string{u.EMail},
		Subject: replaceArgs(tr.S("bud.auth.register.mail.subject")),
	}

	// Set the mail message body.
	m.Body = replaceArgs(tr.S("bud.auth.register.mail.body"))

	// Send the e-mail
	err := mail.Send(&m)
	if err != nil {
		return fmt.Errorf("failed to send registration e-mail: %v", err)
	}

	return nil
}


text:
package zeus.playground.thread.pool;

import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;

/**
 * @author: KG
 * @description:
 * @date: Created in 7:49 下午 2020/7/17
 * @modified by:
 */

public class CachedThreadPoolDemo1 {
    public static void main(String[] args) {

        ExecutorService executorService = Executors.newCachedThreadPool();

        executorService.execute(() -> {
            try {
                System.out.println("Runnable1 begin "
                        + System.currentTimeMillis());
                Thread.sleep(1000);
                System.out.println("A");
                System.out.println("Runnable1   end "
                        + System.currentTimeMillis());
            } catch (InterruptedException e) {
                // TODO Auto-generated catch block
                e.printStackTrace();
            }
        });

        executorService.execute(() -> {
            try {
                System.out.println("Runnable2 begin "
                        + System.currentTimeMillis());
                Thread.sleep(1000);
                System.out.println("B");
                System.out.println("Runnable2   end "
                        + System.currentTimeMillis());
            } catch (InterruptedException e) {
                // TODO Auto-generated catch block
                e.printStackTrace();
            }
        });

    }
}


text:
/* eslint-disable */
export default class Api {
    postFile(file) {
        throw new EvalError("Abstract");
    }
    getFile() {
        throw new EvalError("Abstract");
    }
}


text:
package ws.wamp.jawampa.messages.handling;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import ws.wamp.jawampa.messages.AbortMessage;
import ws.wamp.jawampa.messages.AuthenticateMessage;
import ws.wamp.jawampa.messages.CallMessage;
import ws.wamp.jawampa.messages.ChallengeMessage;
import ws.wamp.jawampa.messages.ErrorMessage;
import ws.wamp.jawampa.messages.EventMessage;
import ws.wamp.jawampa.messages.GoodbyeMessage;
import ws.wamp.jawampa.messages.HelloMessage;
import ws.wamp.jawampa.messages.InvocationMessage;
import ws.wamp.jawampa.messages.PublishMessage;
import ws.wamp.jawampa.messages.PublishedMessage;
import ws.wamp.jawampa.messages.RegisterMessage;
import ws.wamp.jawampa.messages.RegisteredMessage;
import ws.wamp.jawampa.messages.ResultMessage;
import ws.wamp.jawampa.messages.SubscribeMessage;
import ws.wamp.jawampa.messages.SubscribedMessage;
import ws.wamp.jawampa.messages.UnregisterMessage;
import ws.wamp.jawampa.messages.UnregisteredMessage;
import ws.wamp.jawampa.messages.UnsubscribeMessage;
import ws.wamp.jawampa.messages.UnsubscribedMessage;
import ws.wamp.jawampa.messages.WelcomeMessage;
import ws.wamp.jawampa.messages.YieldMessage;

/**
 *
 * @author hkraemer@ggs-hh.net
 */
public class CompositeMessageHandler implements MessageHandler {
    private final List<MessageHandler> subHandlers;

    private CompositeMessageHandler( List<MessageHandler> subHandlers ) {
        this.subHandlers = subHandlers;
    }

    public static CompositeMessageHandler withSubHandlers( List<MessageHandler> subHandlers ) {
        return new CompositeMessageHandler( new ArrayList<MessageHandler>( subHandlers ) );
    }

    public static CompositeMessageHandler withSubHandlers( MessageHandler... subHandlers ) {
        return withSubHandlers( Arrays.asList( subHandlers ) );
    }

    @Override
    public void onHello(HelloMessage msg) {
        for (MessageHandler handler : subHandlers) {
            try {
                handler.onHello(msg);
            } catch (MessageNotHandledHereException e) {
                // ignore
            }
        }
        throw new MessageNotHandledHereException();
    }

    @Override
    public void onChallenge(ChallengeMessage msg) {
        for (MessageHandler handler : subHandlers) {
            try {
                handler.onChallenge(msg);
            } catch (MessageNotHandledHereException e) {
                // ignore
            }
        }
        throw new MessageNotHandledHereException();
    }

    @Override
    public void onAuthenticate(AuthenticateMessage msg) {
        for (MessageHandler handler : subHandlers) {
            try {
                handler.onAuthenticate(msg);
            } catch (MessageNotHandledHereException e) {
                // ignore
            }
        }
        throw new MessageNotHandledHereException();
    }

    @Override
    public void onWelcome(WelcomeMessage msg) {
        for (MessageHandler handler : subHandlers) {
            try {
                handler.onWelcome(msg);
            } catch (MessageNotHandledHereException e) {
                // ignore
            }
        }
        throw new MessageNotHandledHereException();
    }

    @Override
    public void onAbort(AbortMessage msg) {
        for (MessageHandler handler : subHandlers) {
            try {
                handler.onAbort(msg);
            } catch (MessageNotHandledHereException e) {
                // ignore
            }
        }
        throw new MessageNotHandledHereException();
    }

    @Override
    public void onGoodbye(GoodbyeMessage msg) {
        for (MessageHandler handler : subHandlers) {
            try {
                handler.onGoodbye(msg);
            } catch (MessageNotHandledHereException e) {
                // ignore
            }
        }
        throw new MessageNotHandledHereException();
    }

    @Override
    public void onSubscribe(SubscribeMessage msg) {
        for (MessageHandler handler : subHandlers) {
            try {
                handler.onSubscribe(msg);
            } catch (MessageNotHandledHereException e) {
                // ignore
            }
        }
        throw new MessageNotHandledHereException();
    }

    @Override
    public void onSubscribed(SubscribedMessage msg) {
        for (MessageHandler handler : subHandlers) {
            try {
                handler.onSubscribed(msg);
            } catch (MessageNotHandledHereException e) {
                // ignore
            }
        }
        throw new MessageNotHandledHereException();
    }

    @Override
    public void onSubscribeError(ErrorMessage msg) {
        for (MessageHandler handler : subHandlers) {
            try {
                handler.onSubscribeError(msg);
            } catch (MessageNotHandledHereException e) {
                // ignore
            }
        }
        throw new MessageNotHandledHereException();
    }

    @Override
    public void onUnsubscribe(UnsubscribeMessage msg) {
        for (MessageHandler handler : subHandlers) {
            try {
                handler.onUnsubscribe(msg);
            } catch (MessageNotHandledHereException e) {
                // ignore
            }
        }
        throw new MessageNotHandledHereException();
    }

    @Override
    public void onUnsubscribed(UnsubscribedMessage msg) {
        for (MessageHandler handler : subHandlers) {
            try {
                handler.onUnsubscribed(msg);
            } catch (MessageNotHandledHereException e) {
                // ignore
            }
        }
        throw new MessageNotHandledHereException();
    }

    @Override
    public void onUnsubscribeError(ErrorMessage msg) {
        for (MessageHandler handler : subHandlers) {
            try {
                handler.onUnsubscribeError(msg);
            } catch (MessageNotHandledHereException e) {
                // ignore
            }
        }
        throw new MessageNotHandledHereException();
    }

    @Override
    public void onPublish(PublishMessage msg) {
        for (MessageHandler handler : subHandlers) {
            try {
                handler.onPublish(msg);
            } catch (MessageNotHandledHereException e) {
                // ignore
            }
        }
        throw new MessageNotHandledHereException();
    }

    @Override
    public void onPublished(PublishedMessage msg) {
        for (MessageHandler handler : subHandlers) {
            try {
                handler.onPublished(msg);
            } catch (MessageNotHandledHereException e) {
                // ignore
            }
        }
        throw new MessageNotHandledHereException();
    }

    @Override
    public void onEvent(EventMessage msg) {
        for (MessageHandler handler : subHandlers) {
            try {
                handler.onEvent(msg);
            } catch (MessageNotHandledHereException e) {
                // ignore
            }
        }
        throw new MessageNotHandledHereException();
    }

    @Override
    public void onPublishError(ErrorMessage msg) {
        for (MessageHandler handler : subHandlers) {
            try {
                handler.onPublishError(msg);
            } catch (MessageNotHandledHereException e) {
                // ignore
            }
        }
        throw new MessageNotHandledHereException();
    }

    @Override
    public void onRegister(RegisterMessage msg) {
        for (MessageHandler handler : subHandlers) {
            try {
                handler.onRegister(msg);
            } catch (MessageNotHandledHereException e) {
                // ignore
            }
        }
        throw new MessageNotHandledHereException();
    }

    @Override
    public void onRegistered(RegisteredMessage msg) {
        for (MessageHandler handler : subHandlers) {
            try {
                handler.onRegistered(msg);
            } catch (MessageNotHandledHereException e) {
                // ignore
            }
        }
        throw new MessageNotHandledHereException();
    }

    @Override
    public void onRegisterError(ErrorMessage msg) {
        for (MessageHandler handler : subHandlers) {
            try {
                handler.onRegisterError(msg);
            } catch (MessageNotHandledHereException e) {
                // ignore
            }
        }
        throw new MessageNotHandledHereException();
    }

    @Override
    public void onUnregister(UnregisterMessage msg) {
        for (MessageHandler handler : subHandlers) {
            try {
                handler.onUnregister(msg);
            } catch (MessageNotHandledHereException e) {
                // ignore
            }
        }
        throw new MessageNotHandledHereException();
    }

    @Override
    public void onUnregistered(UnregisteredMessage msg) {
        for (MessageHandler handler : subHandlers) {
            try {
                handler.onUnregistered(msg);
            } catch (MessageNotHandledHereException e) {
                // ignore
            }
        }
        throw new MessageNotHandledHereException();
    }

    @Override
    public void onUnregisterError(ErrorMessage msg) {
        for (MessageHandler handler : subHandlers) {
            try {
                handler.onUnregisterError(msg);
            } catch (MessageNotHandledHereException e) {
                // ignore
            }
        }
        throw new MessageNotHandledHereException();
    }

    @Override
    public void onCall(CallMessage msg) {
        for (MessageHandler handler : subHandlers) {
            try {
                handler.onCall(msg);
            } catch (MessageNotHandledHereException e) {
                // ignore
            }
        }
        throw new MessageNotHandledHereException();
    }

    @Override
    public void onInvocation(InvocationMessage msg) {
        for (MessageHandler handler : subHandlers) {
            try {
                handler.onInvocation(msg);
            } catch (MessageNotHandledHereException e) {
                // ignore
            }
        }
        throw new MessageNotHandledHereException();
    }

    @Override
    public void onYield(YieldMessage msg) {
        for (MessageHandler handler : subHandlers) {
            try {
                handler.onYield(msg);
            } catch (MessageNotHandledHereException e) {
                // ignore
            }
        }
        throw new MessageNotHandledHereException();
    }

    @Override
    public void onResult(ResultMessage msg) {
        for (MessageHandler handler : subHandlers) {
            try {
                handler.onResult(msg);
            } catch (MessageNotHandledHereException e) {
                // ignore
            }
        }
        throw new MessageNotHandledHereException();
    }

    @Override
    public void onInvocationError(ErrorMessage msg) {
        for (MessageHandler handler : subHandlers) {
            try {
                handler.onInvocationError(msg);
            } catch (MessageNotHandledHereException e) {
                // ignore
            }
        }
        throw new MessageNotHandledHereException();
    }

    @Override
    public void onCallError(ErrorMessage msg) {
        for (MessageHandler handler : subHandlers) {
            try {
                handler.onCallError(msg);
            } catch (MessageNotHandledHereException e) {
                // ignore
            }
        }
        throw new MessageNotHandledHereException();
    }

    @Override
    public void onError(ErrorMessage msg) {
        for (MessageHandler handler : subHandlers) {
            try {
                handler.onError(msg);
            } catch (MessageNotHandledHereException e) {
                // ignore
            }
        }
        throw new MessageNotHandledHereException();
    }
}


text:
package biopepa;

import java.io.FileInputStream;
import java.io.IOException;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import ssa.CTMCModel;
import ssa.CTMCReaction;
import uk.ac.ed.inf.biopepa.core.BioPEPA;
import uk.ac.ed.inf.biopepa.core.BioPEPAException;
import uk.ac.ed.inf.biopepa.core.compiler.CompiledDynamicComponent;
import uk.ac.ed.inf.biopepa.core.compiler.CompiledExpression;
import uk.ac.ed.inf.biopepa.core.compiler.CompiledExpressionVisitor;
import uk.ac.ed.inf.biopepa.core.compiler.CompiledFunction;
import uk.ac.ed.inf.biopepa.core.compiler.CompiledNumber;
import uk.ac.ed.inf.biopepa.core.compiler.CompiledOperatorNode;
import uk.ac.ed.inf.biopepa.core.compiler.CompiledSystemVariable;
import uk.ac.ed.inf.biopepa.core.compiler.ComponentNode;
import uk.ac.ed.inf.biopepa.core.compiler.ModelCompiler;
import uk.ac.ed.inf.biopepa.core.dom.DoNothingVisitor;
import uk.ac.ed.inf.biopepa.core.dom.Model;
import uk.ac.ed.inf.biopepa.core.dom.Statement;
import uk.ac.ed.inf.biopepa.core.dom.VariableDeclaration;
import uk.ac.ed.inf.biopepa.core.dom.internal.ParserException;
import uk.ac.ed.inf.biopepa.core.sba.ExperimentLine;
import uk.ac.ed.inf.biopepa.core.sba.SBAComponentBehaviour;
import uk.ac.ed.inf.biopepa.core.sba.SBAModel;
import uk.ac.ed.inf.biopepa.core.sba.SBAReaction;
import expr.ArithmeticBinaryExpr;
import expr.ArithmeticBinaryOperator;
import expr.ArithmeticConstant;
import expr.ArithmeticExpression;
import expr.ArithmeticFunction;
import expr.ArithmeticFunctionType;
import expr.Context;
import expr.Variable;

final public class BiopepaFile {

	private Model astModel;

	public BiopepaFile(String filename) throws IOException {
		String source = readFile(filename);
		try {
			astModel = BioPEPA.parse(source);
		} catch (ParserException e) {
			e.printStackTrace();
		} catch (Exception e) {
			e.printStackTrace();
		}

		// extractParameters(astModel);
	}

	static void extractParameters(Model model) {
		ArrayList<String> parameters = new ArrayList<String>();
		for (Statement statement : model.statements())

			if (statement instanceof VariableDeclaration) {
				VariableDeclaration dec = (VariableDeclaration) statement;
				if (dec.getKind() == VariableDeclaration.Kind.VARIABLE) {
					parameters.add(dec.getName().getIdentifier());
				}
			}

		// well... continue with that
	}

	public final boolean containsVariable(String var) {
		try {
			NameCollector v = new NameCollector(var);
			astModel.accept(v);
			return v.isNameFound();
		} catch (BioPEPAException e) {
			e.printStackTrace();
		}
		return false;
	}

	public final CTMCModel getModel() {
		ModelCompiler mc = BioPEPA.compile(astModel);
		mc.compile();
		SBAModel sbaModel = BioPEPA.generateSBA(mc);
		return sba2ctmc(sbaModel);
	}

	public final CTMCModel getModel(String[] names, double[] values) {
		final int dim = names.length;
		final ExperimentLine el = new ExperimentLine("");
		for (int i = 0; i < dim; i++)
			el.addRateValue(names[i], values[i]);
		try {
			el.applyToAst(astModel);
		} catch (BioPEPAException e) {
			e.printStackTrace();
		}
		ModelCompiler mc = BioPEPA.compile(astModel);
		mc.compile();
		SBAModel sbaModel = BioPEPA.generateSBA(mc);
		return sba2ctmc(sbaModel);
	}

	private final static CTMCModel sba2ctmc(SBAModel sbaModel) {

		final ComponentNode[] components = sbaModel.getComponents();
		final Map<String, Variable> componentMap;
		componentMap = new HashMap<String, Variable>(components.length);
		final Context context = new Context();
		final Variable[] variables = new Variable[components.length];
		final int[] init = new int[components.length];
		for (int i = 0; i < components.length; i++) {
			variables[i] = new Variable(components[i].getName(), context);
			init[i] = (int) components[i].getCount();
			componentMap.put(components[i].getName(), variables[i]);
		}

		SBAReaction[] sbaReactions = sbaModel.getReactions();
		CTMCReaction[] reactions = new CTMCReaction[sbaReactions.length];
		for (int i = 0; i < sbaReactions.length; i++) {
			ExpressionBuilder visitor = new ExpressionBuilder(sbaModel,
					sbaReactions[i], componentMap);
			sbaReactions[i].getRate().accept(visitor);
			ArithmeticExpression rateExpression = visitor.getResult();

			reactions[i] = new CTMCReaction(rateExpression);
			for (SBAComponentBehaviour comp : sbaReactions[i].getReactants())
				reactions[i].addReactant(componentMap.get(comp.getName()),
						comp.getStoichiometry());
			for (SBAComponentBehaviour comp : sbaReactions[i].getProducts())
				reactions[i].addProduct(componentMap.get(comp.getName()),
						comp.getStoichiometry());
		}

		return new CTMCModel(context, reactions, init);
	}

	static private class ExpressionBuilder extends CompiledExpressionVisitor {

		private ArithmeticExpression result;
		final private SBAModel sbaModel;
		final private SBAReaction sbaReaction;
		final private Map<String, Variable> map;

		public ExpressionBuilder(SBAModel sbaModel, SBAReaction sbaReaction,
				Map<String, Variable> map) {
			this.sbaModel = sbaModel;
			this.sbaReaction = sbaReaction;
			this.map = map;
		}

		public ArithmeticExpression getResult() {
			return result;
		}

		@Override
		public boolean visit(CompiledDynamicComponent arg0) {
			String name = arg0.getName();
			if (sbaModel.containsComponent(name)) {
				result = map.get(name);
				return false;
			}
			if (sbaModel.containsVariable(name)) {
				CompiledExpression varExp = sbaModel.getDynamicExpression(name);
				varExp.accept(this);
				return false;
			} else {
				throw new IllegalStateException();
			}
		}

		@Override
		public boolean visit(CompiledFunction arg0) {

			if (arg0.getFunction().isRateLaw()) {
				switch (arg0.getFunction()) {
				case fMA:
					arg0.getArguments().get(0).accept(this);
					List<SBAComponentBehaviour> reactants = sbaReaction
							.getReactants();
					for (SBAComponentBehaviour reactant : reactants) {
						Variable var = map.get(reactant.getName());
						ArithmeticConstant st = new ArithmeticConstant(
								reactant.getStoichiometry());
						ArithmeticBinaryExpr factor = new ArithmeticBinaryExpr(
								ArithmeticBinaryOperator.POW, var, st);
						result = new ArithmeticBinaryExpr(
								ArithmeticBinaryOperator.MULT, result, factor);
					}
					break;
				case fMM:
					throw new IllegalStateException(
							"Michaelis–Menten kinetics are currenly not supported!");

				default:
					throw new IllegalStateException();
				}
			}

			else if (arg0.getFunction().args() == 1) {
				arg0.getArguments().get(0).accept(this);
				ArithmeticExpression argument = result;
				switch (arg0.getFunction()) {
				case LOG:
					result = new ArithmeticFunction(ArithmeticFunctionType.LOG,
							argument);
					break;
				case EXP:
					result = new ArithmeticFunction(ArithmeticFunctionType.EXP,
							argument);
					break;
				case H:
					result = new ArithmeticFunction(ArithmeticFunctionType.H,
							argument);
					break;
				case FLOOR:
					result = new ArithmeticFunction(
							ArithmeticFunctionType.FLOOR, argument);
					break;
				case CEILING:
					result = new ArithmeticFunction(
							ArithmeticFunctionType.CEIL, argument);
					break;
				case TANH:
					result = new ArithmeticFunction(
							ArithmeticFunctionType.TANH, argument);
					break;
				default:
					throw new IllegalStateException();
				}
			} else {
				throw new IllegalStateException();
			}

			return false;
		}

		@Override
		public boolean visit(CompiledNumber arg0) {
			result = new ArithmeticConstant(arg0.getNumber().doubleValue());
			return false;
		}

		@Override
		public boolean visit(CompiledOperatorNode arg0) {
			arg0.getLeft().accept(this);
			ArithmeticExpression left = result;
			arg0.getRight().accept(this);
			ArithmeticExpression right = result;
			switch (arg0.getOperator()) {
			case PLUS:
				result = new ArithmeticBinaryExpr(
						ArithmeticBinaryOperator.PLUS, left, right);
				break;
			case MINUS:
				result = new ArithmeticBinaryExpr(
						ArithmeticBinaryOperator.MINUS, left, right);
				break;
			case DIVIDE:
				result = new ArithmeticBinaryExpr(
						ArithmeticBinaryOperator.DIVIDE, left, right);
				break;
			case MULTIPLY:
				result = new ArithmeticBinaryExpr(
						ArithmeticBinaryOperator.MULT, left, right);
				break;
			case POWER:
				result = new ArithmeticBinaryExpr(ArithmeticBinaryOperator.POW,
						left, right);
				break;
			default:
				throw new IllegalStateException();
			}
			return false;
		}

		@Override
		public boolean visit(CompiledSystemVariable arg0) {
			throw new IllegalStateException(
					"The \'time\' system variable is currently unsupported!");
		}

	}

	static private class NameCollector extends DoNothingVisitor {

		final private String name;
		private boolean nameFound = false;

		public NameCollector(String name) {
			this.name = name;
		}

		public boolean isNameFound() {
			return nameFound;
		}

		@Override
		public boolean visit(Model model) throws BioPEPAException {
			for (Statement statement : model.statements())
				statement.accept(this);
			return false;
		}

		@Override
		public boolean visit(VariableDeclaration variableDeclaration)
				throws BioPEPAException {
			if (variableDeclaration.getKind() == VariableDeclaration.Kind.VARIABLE)
				if (name.equals(variableDeclaration.getName().getIdentifier()))
					nameFound = true;
			return false;
		}

	}

	private static final String readFile(String filename) throws IOException {
		final FileInputStream input = new FileInputStream(filename);
		final byte[] fileData = new byte[input.available()];
		input.read(fileData);
		input.close();
		return new String(fileData);
	}
}


text:
Redes sociales

Coordinación de Educación Digital

              Tweets por el @FestCineJuvenil.


text:
package org.hbaseom.client.translators.util;

/**
 * Utility class to check appropriate java types
 *
 * @author levan
 *
 */
public final class TypeChecker {

	private TypeChecker() {
		throw new AssertionError("Can not initialize object");
	}

	public static boolean isByteArray(String name) {
		return name.equals("[B") || name.equals("[Ljava.lang.Byte;");
	}

	public static boolean isByte(String name) {
		return name.equals("Byte") || name.equals("java.lang.Byte")
				|| name.equals("byte");
	}

	public static boolean isBoolean(String name) {
		return name.equals("Boolean") || name.equals("java.lang.Boolean")
				|| name.equals("boolean");
	}

	public static boolean isShort(String name) {
		return name.equals("Short") || name.equals("java.lang.Short")
				|| name.equals("short");
	}

	public static boolean isInteger(String name) {
		return name.equals("Integer") || name.equals("java.lang.Integer")
				|| name.equals("int");
	}

	public static boolean isLong(String name) {
		return name.equals("Long") || name.equals("java.lang.Long")
				|| name.equals("long");
	}

	public static boolean isFloat(String name) {
		return name.equals("Float") || name.equals("java.lang.Float")
				|| name.equals("float");
	}

	public static boolean isDouble(String name) {
		return name.equals("Double") || name.equals("java.lang.Double")
				|| name.equals("double");
	}

	public static boolean isCharacter(String name) {
		return name.equals("Char") || name.equals("java.lang.Character")
				|| name.equals("char");
	}

	public static boolean isString(String name) {
		return name.equals("String") || name.equals("string")
				|| name.equals("java.lang.String");
	}
}


text:
/*
 *  A module containing a reusable Browsersync instance.
 */

const browsersync = require('browser-sync');

module.exports = browsersync.create();


text:
package com.compositesw.services.system.admin.resource;

import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlType;

/**
 *
Java class for updateResourceStatisticsConfigRequest complex type.
 *
 *
The following schema fragment specifies the expected content contained within this class.
 *
 *

 * <complexType name="updateResourceStatisticsConfigRequest">
 *   <complexContent>
 *     <extension base="{http://www.compositesw.com/services/system/admin/resource}pathTypeDetailRequest">
 *       <sequence>
 *         <element name="statisticsConfig" type="{http://www.compositesw.com/services/system/admin/resource}resourceStatisticsConfig"/>
 *       </sequence>
 *     </extension>
 *   </complexContent>
 * </complexType>
 *

 *
 *
 */
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "updateResourceStatisticsConfigRequest", propOrder = {
    "statisticsConfig"
})
public class UpdateResourceStatisticsConfigRequest
    extends PathTypeDetailRequest
{

    @XmlElement(required = true)
    protected ResourceStatisticsConfig statisticsConfig;

    /**
     * Gets the value of the statisticsConfig property.
     *
     * @return
     *     possible object is
     *     {@link ResourceStatisticsConfig }
     *
     */
    public ResourceStatisticsConfig getStatisticsConfig() {
        return statisticsConfig;
    }

    /**
     * Sets the value of the statisticsConfig property.
     *
     * @param value
     *     allowed object is
     *     {@link ResourceStatisticsConfig }
     *
     */
    public void setStatisticsConfig(ResourceStatisticsConfig value) {
        this.statisticsConfig = value;
    }

}


text:
#ifndef WebContentLayerClient_h
#define WebContentLayerClient_h

#include "WebCanvas.h"
#include "WebCommon.h"

namespace blink {
struct WebRect;
struct WebFloatRect;

class BLINK_PLATFORM_EXPORT WebContentLayerClient {
public:
    // Paints the content area for the layer, typically dirty rects submitted
    // through WebContentLayer::setNeedsDisplay, submitting drawing commands
    // through the WebCanvas.
    // The canvas is already clipped to the |clip| rect.
    // Optionally, the implementation may set |opaque| to a rect covering pixels that
    // the implementation knows are opaque. This information can be used for various
    // optimizations.
    virtual void paintContents(WebCanvas*, const WebRect& clip, bool canPaintLCDText, WebFloatRect& opaque) = 0;

protected:
    virtual ~WebContentLayerClient() { }
};

} // namespace blink

#endif // WebContentLayerClient_h


text:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace PiCandy.Rendering
{
    public class ChannelMetadata
    {
        public ChannelMetadata(IDictionary<string, object> metadata)
        {
            object raw;
            if (metadata.TryGetValue("Channel", out raw))
                Channel = (int)raw;
            if (metadata.TryGetValue("Map", out raw))
                Map = (string)raw;
        }

        public int Channel { get; set; }
        public string Map { get; set; }
    }
}


text:
from openerp.tests.common import TransactionCase
from openerp.exceptions import ValidationError

class GlobalTestOpenAcademySession(TransactionCase):
    '''
    This creates globalñ test for sessions
    '''

    def setUp(self):
        super(GlobalTestOpenAcademySession, self).setUp()
        self.session = self.env['openacademy.session']
        self.partner = self.env.ref('base.res_partner_10')
        self.course = self.env.ref('openacademy.course0')
        self.partner_attende = self.env.ref('base.res_partner_2')

    def test_10_instructor_is_attende(self):
        '''
        '''
        with self.assertRaisesRegexp(
                ValidationError,
                "A session's instructor can't be an attendee"
                ):
            self.session.create({
                'name': 'Session test 1',
                'seats': 1,
                'instructor_id': self.partner.id,
                'attendee_ids': [(6, 0, [self.partner.id])],
                'course_id': self.course.id,
                })

    def test_20_wkf_done(self):
        '''
        Chek thar workflow works fine
        '''
        session_test = self.session.create({
            'name': 'Session test 1',
            'seats': 200,
            'instructor_id': self.partner.id,
            'attendee_ids': [(6, 0, [self.partner_attende.id])],
            'course_id': self.course.id,
            })
        # Check initial state
        self.assertEqual(session_test.state, 'draft',
                         'Initial State should be in draft')

        # Change state and check it
        session_test.signal_workflow('button_confirm')
        self.assertEqual(session_test.state, 'confirmed',
                         "Signal confirm didn't work")

        # Change state and check it
        session_test.signal_workflow('button_done')
        self.assertEqual(session_test.state, 'done', "Signal done didn't work")
        # self.env.cr.commit() # Just to test the data generated by the test


text:
<?php

use yii\helpers\Html;
use yii\widgets\ActiveForm;

/* @var $this yii\web\View */
/* @var $model app\modules\auth\models\UsersSearch */
/* @var $form yii\widgets\ActiveForm */
?>

    <?php $form = ActiveForm::begin([
        'action' => ['index'],
        'method' => 'get',
    ]); ?>

    <?= $form->field($model, 'id') ?>

    <?= $form->field($model, 'username') ?>

    <?= $form->field($model, 'password') ?>

    <?= $form->field($model, 'auth_key') ?>

    <?= $form->field($model, 'first_name') ?>

    <?php // echo $form->field($model, 'last_name') ?>

    <?php // echo $form->field($model, 'email') ?>

    <?php // echo $form->field($model, 'telephone') ?>

    <?php // echo $form->field($model, 'department') ?>

    <?php // echo $form->field($model, 'start_working_date') ?>

        <?= Html::submitButton('Search', ['class' => 'btn btn-primary']) ?>
        <?= Html::resetButton('Reset', ['class' => 'btn btn-default']) ?>

    <?php ActiveForm::end(); ?>


text:
package com.thaiopensource.relaxng.pattern;

class TextPattern extends Pattern
{
  TextPattern ()
  {
    super (true, MIXED_CONTENT_TYPE, TEXT_HASH_CODE);
  }

  @Override
  boolean samePattern (final Pattern other)
  {
    return other instanceof TextPattern;
  }

  @Override
  <T> T apply (final PatternFunction <T> f)
  {
    return f.caseText (this);
  }

  @Override
  void checkRestrictions (final int context, final DuplicateAttributeDetector dad, final Alphabet alpha) throws RestrictionViolationException
  {
    switch (context)
    {
      case DATA_EXCEPT_CONTEXT:
        throw new RestrictionViolationException ("data_except_contains_text");
      case START_CONTEXT:
        throw new RestrictionViolationException ("start_contains_text");
      case LIST_CONTEXT:
        throw new RestrictionViolationException ("list_contains_text");
    }
  }

}


text:
package com.gbicc.bll.sys.bean;

/**
 * 支机构信息关联表
 * @author YXK
 *
 */
public class SysOrgBnZz {

	private String secOrgCode;//支机构编码
	private String secOrgName;//支机构名称
	private String orgCode;//分公司编码
	private String orgName;//分公司名称

	public SysOrgBnZz() {
		super();
	}

	public String getSecOrgCode() {
		return secOrgCode;
	}

	public void setSecOrgCode(String secOrgCode) {
		this.secOrgCode = secOrgCode;
	}

	public String getSecOrgName() {
		return secOrgName;
	}

	public void setSecOrgName(String secOrgName) {
		this.secOrgName = secOrgName;
	}

	public String getOrgCode() {
		return orgCode;
	}

	public void setOrgCode(String orgCode) {
		this.orgCode = orgCode;
	}

	public String getOrgName() {
		return orgName;
	}

	public void setOrgName(String orgName) {
		this.orgName = orgName;
	}

}


text:
namespace extensions {

class ResourcesPrivateGetStringsFunction : public ExtensionFunction {
 public:
  DECLARE_EXTENSION_FUNCTION("resourcesPrivate.getStrings",
                             RESOURCESPRIVATE_GETSTRINGS)
  ResourcesPrivateGetStringsFunction();

 protected:
  ~ResourcesPrivateGetStringsFunction() override;

  // Override from ExtensionFunction:
  ExtensionFunction::ResponseAction Run() override;

 private:
  DISALLOW_COPY_AND_ASSIGN(ResourcesPrivateGetStringsFunction);
};

}  // namespace extensions

#endif  // CHROME_BROWSER_EXTENSIONS_API_RESOURCES_PRIVATE_RESOURCES_PRIVATE_API_H_


text:
using Microsoft.PowerShell.EditorServices.Services.TextDocument;
using OmniSharp.Extensions.LanguageServer.Protocol.Models;

namespace Microsoft.PowerShell.EditorServices.Test.Shared.Completion
{
    internal static class CompleteNamespace
    {
        public static readonly ScriptRegion SourceDetails = new(
            file: TestUtilities.NormalizePath("Completion/CompletionExamples.psm1"),
            text: string.Empty,
            startLineNumber: 22,
            startColumnNumber: 15,
            startOffset: 0,
            endLineNumber: 0,
            endColumnNumber: 0,
            endOffset: 0);

        public static readonly CompletionItem ExpectedCompletion = new()
        {
            Kind = CompletionItemKind.Module,
            Detail = "Namespace System.Collections",
            FilterText = "System.Collections",
            InsertText = "System.Collections",
            Label = "Collections",
            SortText = "0001Collections",
            TextEdit = new TextEdit
            {
                NewText = "System.Collections",
                Range = new Range
                {
                    Start = new Position { Line = 21, Character = 1 },
                    End = new Position { Line = 21, Character = 15 }
                }
            }
        };
    }
}


text:
import textwrap

import mock
import pep8
import testtools

from keystoneclient.hacking import checks
from keystoneclient.tests.unit import client_fixtures

class TestCheckOsloNamespaceImports(testtools.TestCase):
    def setUp(self):
        super(TestCheckOsloNamespaceImports, self).setUp()
        self.useFixture(client_fixtures.Deprecations())

    # We are patching pep8 so that only the check under test is actually
    # installed.
    @mock.patch('pep8._checks',
                {'physical_line': {}, 'logical_line': {}, 'tree': {}})
    def run_check(self, code):
        pep8.register_check(checks.check_oslo_namespace_imports)

        lines = textwrap.dedent(code).strip().splitlines(True)

        checker = pep8.Checker(lines=lines)
        checker.check_all()
        checker.report._deferred_print.sort()
        return checker.report._deferred_print

    def assert_has_errors(self, code, expected_errors=None):
        actual_errors = [e[:3] for e in self.run_check(code)]
        self.assertEqual(expected_errors or [], actual_errors)

    def test(self):
        code_ex = self.useFixture(client_fixtures.HackingCode())
        code = code_ex.oslo_namespace_imports['code']
        errors = code_ex.oslo_namespace_imports['expected_errors']
        self.assert_has_errors(code, expected_errors=errors)


text:
// +build integration,!no-etcd

package pods

import (
	"fmt"
	"testing"

	metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
	restclient "k8s.io/client-go/rest"
	"k8s.io/kubernetes/pkg/api"
	"k8s.io/kubernetes/pkg/api/v1"
	"k8s.io/kubernetes/pkg/client/clientset_generated/clientset"
	"k8s.io/kubernetes/test/integration"
	"k8s.io/kubernetes/test/integration/framework"
)

func TestPodUpdateActiveDeadlineSeconds(t *testing.T) {
	_, s := framework.RunAMaster(nil)
	defer s.Close()

	ns := framework.CreateTestingNamespace("pod-activedeadline-update", s, t)
	defer framework.DeleteTestingNamespace(ns, s, t)

	client := clientset.NewForConfigOrDie(&restclient.Config{Host: s.URL, ContentConfig: restclient.ContentConfig{GroupVersion: &api.Registry.GroupOrDie(v1.GroupName).GroupVersion}})

	var (
		iZero = int64(0)
		i30   = int64(30)
		i60   = int64(60)
		iNeg  = int64(-1)
	)

	prototypePod := func() *v1.Pod {
		return &v1.Pod{
			ObjectMeta: metav1.ObjectMeta{
				Name: "xxx",
			},
			Spec: v1.PodSpec{
				Containers: []v1.Container{
					{
						Name:  "fake-name",
						Image: "fakeimage",
					},
				},
			},
		}
	}

	cases := []struct {
		name     string
		original *int64
		update   *int64
		valid    bool
	}{
		{
			name:     "no change, nil",
			original: nil,
			update:   nil,
			valid:    true,
		},
		{
			name:     "no change, set",
			original: &i30,
			update:   &i30,
			valid:    true,
		},
		{
			name:     "change to positive from nil",
			original: nil,
			update:   &i60,
			valid:    true,
		},
		{
			name:     "change to smaller positive",
			original: &i60,
			update:   &i30,
			valid:    true,
		},
		{
			name:     "change to larger positive",
			original: &i30,
			update:   &i60,
			valid:    false,
		},
		{
			name:     "change to negative from positive",
			original: &i30,
			update:   &iNeg,
			valid:    false,
		},
		{
			name:     "change to negative from nil",
			original: nil,
			update:   &iNeg,
			valid:    false,
		},
		// zero is not allowed, must be a positive integer
		{
			name:     "change to zero from positive",
			original: &i30,
			update:   &iZero,
			valid:    false,
		},
		{
			name:     "change to nil from positive",
			original: &i30,
			update:   nil,
			valid:    false,
		},
	}

	for i, tc := range cases {
		pod := prototypePod()
		pod.Spec.ActiveDeadlineSeconds = tc.original
		pod.ObjectMeta.Name = fmt.Sprintf("activedeadlineseconds-test-%v", i)

		if _, err := client.Core().Pods(ns.Name).Create(pod); err != nil {
			t.Errorf("Failed to create pod: %v", err)
		}

		pod.Spec.ActiveDeadlineSeconds = tc.update

		_, err := client.Core().Pods(ns.Name).Update(pod)
		if tc.valid && err != nil {
			t.Errorf("%v: failed to update pod: %v", tc.name, err)
		} else if !tc.valid && err == nil {
			t.Errorf("%v: unexpected allowed update to pod", tc.name)
		}

		integration.DeletePodOrErrorf(t, client, ns.Name, pod.Name)
	}
}

func TestPodReadOnlyFilesystem(t *testing.T) {
	_, s := framework.RunAMaster(nil)
	defer s.Close()

	isReadOnly := true
	ns := framework.CreateTestingNamespace("pod-readonly-root", s, t)
	defer framework.DeleteTestingNamespace(ns, s, t)

	client := clientset.NewForConfigOrDie(&restclient.Config{Host: s.URL, ContentConfig: restclient.ContentConfig{GroupVersion: &api.Registry.GroupOrDie(v1.GroupName).GroupVersion}})

	pod := &v1.Pod{
		ObjectMeta: metav1.ObjectMeta{
			Name: "xxx",
		},
		Spec: v1.PodSpec{
			Containers: []v1.Container{
				{
					Name:  "fake-name",
					Image: "fakeimage",
					SecurityContext: &v1.SecurityContext{
						ReadOnlyRootFilesystem: &isReadOnly,
					},
				},
			},
		},
	}

	if _, err := client.Core().Pods(ns.Name).Create(pod); err != nil {
		t.Errorf("Failed to create pod: %v", err)
	}

	integration.DeletePodOrErrorf(t, client, ns.Name, pod.Name)
}


text:
<?php

namespace ClientBundle\Repository;

use Doctrine\ORM\EntityRepository;
use Symfony\Bridge\Doctrine\Security\User\UserLoaderInterface;

/**
 * Class UserRepository
 */
class UserRepository extends EntityRepository implements UserLoaderInterface
{
    /**
     * @param string $username
     * @return mixed
     */
    public function loadUserByUsername($username)
    {
        return $this->createQueryBuilder('u')
            ->where('u.username = :username OR u.email = :email')
            ->setParameter('username', $username)
            ->setParameter('email', $username)
            ->getQuery()
            ->getOneOrNullResult();
    }
}


text:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<meta http-equiv="Content-Type" content="text/html; charset=utf-8">

<title>FBI to post criminal mug shots on digital billboards | STATE NEWS |
Breaking Houston News, Weather, Sports, Traffic, Video from KHOU.com | 11 News</title>

<meta http-equiv="refresh" content="600">

<LINK REL="alternate" TITLE="KHOU.com Astros" HREF="http://www.khou.com/newskiosk/rss/khouastros.xml" TYPE="application/rss+xml">
<LINK REL="alternate" TITLE="KHOU.com Caught on Tape Video" HREF="http://www.khou.com/newskiosk/rss/khoucaughtontape.xml" TYPE="application/rss+xml">

<LINK REL="alternate" TITLE="KHOU.com Focus on Health" HREF="http://www.khou.com/newskiosk/rss/khouhealth.xml" TYPE="application/rss+xml">
<LINK REL="alternate" TITLE="KHOU.com Investigations" HREF="http://www.khou.com/newskiosk/rss/khouinvestigations.xml" TYPE="application/rss+xml">
<LINK REL="alternate" TITLE="KHOU.com Local -- Brazoria County" HREF="http://www.khou.com/newskiosk/rss/khoubrazoria.xml" TYPE="application/rss+xml">
<LINK REL="alternate" TITLE="KHOU.com Local -- Fort Bend County" HREF="http://www.khou.com/newskiosk/rss/khoufortbend.xml" TYPE="application/rss+xml">
<LINK REL="alternate" TITLE="KHOU.com Local -- Galveston County" HREF="http://www.khou.com/newskiosk/rss/khougalveston.xml" TYPE="application/rss+xml">
<LINK REL="alternate" TITLE="KHOU.com Local -- Harris County" HREF="http://www.kucation" HREF="http://www.khou.com/newskiosk/rss/khoulocaleducation.xml" TYPE="application/rss+xml">
<LINK REL="alternate" TITLE="KHOU.com Local News" HREF="http://www.khou.com/newskiosk/rss/localnews.xml" TYPE="application/rss+xml">
<LINK REL="alternate" TITLE="KHOU.com Local Politics" HREF="http://www.khou.com/newskiosk/rss/khoulocalpolitics.xml" TYPE="application/rss+xml">

<LINK REL="alternate" TITLE="KHOU.com Music" HREF="http://www.khou.com/newskiosk/rss/khoumusic.xml" TYPE="application/rss+xml">
<LINK REL="alternate" TITLE="KHOU.com National News" HREF="http://www.khou.com/newskiosk/rss/khounational.xml" TYPE="application/rss+xml">
<LINK REL="alternate" TITLE="KHOU.com Offbeat News" HREF="http://www.khou.com/newskiosk/rss/khouoffbeat.xml" TYPE="application/rss+xml">

<LINK REL="alternate" TITLE="KHOU.com Sports" HREF="http://www.khou.com/newskiosk/rss/khousports.xml" TYPE="application/rss+xml">
<LINK REL="alternate" TITLE="KHOU.com Sports Video" HREF="http://www.khou.com/newskiosk/rss/khousportsvideo.xml" TYPE="application/rss+xml">
<LINK REL="alternate" TITLE="KHOU.com State News" HREF="http://www.khou.com/newskiosk/rss/khoustate.xml" TYPE="application/rss+xml">

<LINK REL="alternate" TITLE="KHOU.com Top stories" HREF="http://www.khou.com/newskiosk/rss/khoutop.xml" TYPE="application/rss+xml">
<LINK REL="alternate" TITLE="KHOU.com Video" HREF="http://www.khou.com/newskiosk/rss/khouvideo.xml" TYPE="application/rss+xml">
<LINK REL="alternate" TITLE="KHOU.com Weather Video" HREF="http://www.khou.com/newskiosk/rss/khouweathervideo.xml" TYPE="application/rss+xml">

<meta name="KEYWORDS" content="" />
<meta name="DESCRIPTION" content="" />
<link media="screen" type="text/css" rel="stylesheet" href="/bi/ice3/styles/story.css"/>
<link media="print" type="text/css" rel="stylesheet" href="/bi/ice3/styles/print.css" />

<link media="screen" type="text/css" rel="stylesheet" href="/bi/ice3/styles/tabs.css" />
<link media="screen" type="text/css" rel="stylesheet" href="/bi/ice3/styles/common.css" />
<link media="screen" type="text/css" rel="stylesheet" href="/bi/ice3/styles/navigation.css"/>
<link media="screen" type="text/css" rel="stylesheet" href="/bi/ice3/styles/sub-nav.css"/>
<link media="screen" type="text/css" rel="stylesheet" href="/bi/ice3/styles/marketplace.css"/>

<link rel="shortcut icon" href="/favicon.ico" type="image/x-icon" />

 :

Member Center

 :

Make This Your Home
        Page

 :

Special Offers

<form name="searchForm" action="/blcS.sc" method="get" id="search_form">

<input type="text" name="search" size="30" maxlength="150" value="Search" onfocus="this.value='';" />
<input type="submit" value="GO" class="submit"/>
</form>

News

Local News

Texas

Fight Crime!

Nation - World

Health

Technology

Local Politics

Weird News

2008 Elections

Education

Seen on 11 News

Business

Message Boards

11 News Defenders

Video

Hometown Heroes

E-mail Alerts

Weather

Radars

State Conditions

Flight Tracker

Hurricane Central

Marine Forecast

Air Quality

WeatherBug

Webcams

Your Weather Pics

Weather Video

E-mail Alerts

Weather Forum

Traffic

TrafficCams

Traffic FAQ

Darby's Blog

Sports

High School Sports

Astros / MLB

Rockets / NBA

Texans / NFL

Colleges

Hockey

Dynamo / Soccer

Tennis

Golf

Motorsports

Sports Video

Sports Blogs

Entertainment

Entertainment News

Weird News

Movies

Celebrities

Music

Wedding Belles

Pets

TV Listings

GDH

Talk of the Town

Video

Video On Demand

Caught On Tape

Latest Forecast

Most Watched

Submit Your Video

Mobile

Mobile

Health

Health News

Healthy Life Center

Channel 11

Forums

News Team

Community

Advertise

Program Schedule

Jobs

Contact Us

Cadillac Texas Spirit

Blogs

Weird World

Animal Attraction

Teen Talk

Crime Watch

11 Sports

Traffic

Wedding Belles

Cars

Homes

Great Deals

Healthy Life

Advertisement

RSS Feeds

Get News on Your Mobile Device

Sign Up for our Email Newsletters

Sign up for Special Offers

STATE NEWS

Cars.com

 Search Used Cars

 Sell a Car

HomeCenter

 Search MLS Homes through Keller-Williams

Great Day - Great Deals

 Click here and be one of the first 100 people to buy $50 Amore MedSpa gift certificates for only $25 this Friday at 10:00am!

Healthy Life Center

 Cosmetic/Implant Dentistry

 Senior Health

 Lipo Dissolve

 LAP-BAND®

 Dermatology

 LASIK

<meta name="vit_story_id" content="STORY.116c3b420b9.93.88.fa.d0.5dc77412" />

<meta name="story_syndication" content="BELO-NO-SYNDICATE" />
<meta name="publication_date" content="2007-12-28" />

FBI to post criminal mug shots on digital billboards

10:02 AM CST on Friday, December 28, 2007

Associated Press

       The FBI’s most wanted bank robbers, violent criminals and terrorists        will soon appear on 150 digital billboards in 20 cities—including El        Paso.

       The federal agency has teamed up with Phoenix-based Clear Channel        Outdoor to begin airing mug shots.

       A successful test run in Philadelphia led to several arrests.

       The billboards also will be used to post photos and information on        recently committed crimes.

Print this story

Email this story

Add RSS Feeds

Advertisement

Inside KHOU.com

News Your Way: Get KHOU.com headlines

delivered to your favorite RSS reader.

Submit your Pics: Upload photos and browse others in our Pics section.

Submit Your Video: Upload your videos and browse others in our video section.

Find Activities: What's happening in your neighborhood? Community Calendar.

Discuss the News: Talk about the latest news, weather and entertainment headlines in our online forums.

Headlines in Your Inbox: Sign up for our e-mail alerts.

More State News

Schools to test 6th graders  for heart abnormalities

Irving police file murder charge in 'cheese' heroin death

'Cloned' vehicles used for illegal operations

TAKS test moved to avoid conflict with primary elections

  Holy cow! Dozens see UFO in North Texas

		More...

AP Texas Headlines

Court swiftly grants feds access

Jury finds for Eanes school in lawsuit over kindergartner assault

Man gets 12 years for role in fatal accident

Court grants access to Texas city's land in border fence dispute

American parent AMR suffers 4th-quarter loss, hurt by fuel costs

		More...

Print this story

Email this story

Add RSS Feeds

Home | Advertise with Us | About Us | Media Kit | Careers | Site Map | Contact Us

Help | Terms of Service | Privacy | Special Offers

© 2008 KHOU-TV, Inc.  All Rights Reserved.

News

Local News

Houston Metro

Galveston Co.

Fort Bend Co.

Montgomery Co.

Brazoria Co.

Special Report

Texas

Fight Crime!

Nation - World

Mexico

Rebuilding Iraq

Health

Nutrition

Fitness

Technology

Local Politics

Weird News

2008 Elections

Education

Seen on 11 News

Business

Local Business

Stocks

Autos

Message Boards

11 News Defenders

Video

Hometown Heroes

E-mail Alerts

Weather

Radars

Local

County-by-County

Southeast Texas

Regional

State Conditions

Flight Tracker

Hurricane Central

Tropical Outlook

Tropical Discussion

Marine Forecast

Air Quality

WeatherBug

Webcams

Your Weather Pics

Weather Video

E-mail Alerts

Weather Forum

Traffic

TrafficCams

Traffic FAQ

Darby's Blog

Sports

High School Sports

Astros / MLB

MLB

Rockets / NBA

NBA

Texans / NFL

Texans Video

NFL

Colleges

Local Colleges

Football

Basketball

Hockey

Dynamo / Soccer

Tennis

Golf

Motorsports

Sports Video

Sports Blogs

Entertainment

Entertainment News

Weird News

Movies

Celebrities

Music

Wedding Belles

Pets

Animal Attraction Blog

Pet Pics

TV Listings

GDH

Talk of the Town

Video

Video On Demand

Caught On Tape

Latest Forecast

Most Watched

Submit Your Video

Mobile

Mobile

Health

Health News

Healthy Life Center

Channel 11

Forums

News Team

Community

Community Calendar

News Releases

Cadillac Texas Spirit

Advertise

Program Schedule

Jobs

Contact Us

Cadillac Texas Spirit

Blogs

Weird World

Animal Attraction

Teen Talk

Crime Watch

11 Sports

Traffic

Wedding Belles


text:
"""
Copyright (c) 2016 Jet Propulsion Laboratory,
California Institute of Technology.  All rights reserved
"""
import json
from webservice.NexusHandler import NexusHandler
from webservice.NexusHandler import nexus_handler
from webservice.webmodel import cached

@nexus_handler
class DataSeriesListHandlerImpl(NexusHandler):
    name = "Dataset List"
    path = "/list"
    description = "Lists datasets currently available for analysis"
    params = {}

    def __init__(self):
        NexusHandler.__init__(self, skipCassandra=True)

    @cached(ttl=(60 * 60 * 1000))  # 1 hour cached
    def calc(self, computeOptions, **args):
        class SimpleResult(object):
            def __init__(self, result):
                self.result = result

            def toJson(self):
                return json.dumps(self.result)

        return SimpleResult(self._tile_service.get_dataseries_list())


text:
from __future__ import unicode_literals

from django.db import migrations, models

class Migration(migrations.Migration):

    dependencies = [
        ('ecommerce', '0007_orderaudit'),
    ]

    operations = [
        migrations.AlterField(
            model_name='order',
            name='status',
            field=models.CharField(choices=[('created', 'created'), ('fulfilled', 'fulfilled'), ('failed', 'failed'), ('refunded', 'refunded')], db_index=True, default='created', max_length=30),
        ),
    ]


text:
'''
Common definitions for a Windows provider
=========================================

This file provides common definitions for constants used by WM_Touch / WM_Pen.
'''
import os

WM_MOUSEFIRST = 512
WM_MOUSEMOVE = 512
WM_LBUTTONDOWN = 513
WM_LBUTTONUP = 514
WM_LBUTTONDBLCLK = 515
WM_RBUTTONDOWN = 516
WM_RBUTTONUP = 517
WM_RBUTTONDBLCLK = 518
WM_MBUTTONDOWN = 519
WM_MBUTTONUP = 520
WM_MBUTTONDBLCLK = 521
WM_MOUSEWHEEL = 522
WM_MOUSELAST = 522
WM_DPICHANGED = 736
WM_GETDPISCALEDSIZE = 740
WM_NCCALCSIZE = 131

WM_TOUCH = 576
TOUCHEVENTF_MOVE = 1
TOUCHEVENTF_DOWN = 2
TOUCHEVENTF_UP = 4

PEN_OR_TOUCH_SIGNATURE = 0xFF515700
PEN_OR_TOUCH_MASK = 0xFFFFFF00
PEN_EVENT_TOUCH_MASK = 0x80

SM_CYCAPTION = 4

WM_TABLET_QUERYSYSTEMGESTURE = 0x000002CC
TABLET_DISABLE_PRESSANDHOLD = 0x00000001
TABLET_DISABLE_PENTAPFEEDBACK = 0x00000008
TABLET_DISABLE_PENBARRELFEEDBACK = 0x00000010
TABLET_DISABLE_TOUCHUIFORCEON = 0x00000100
TABLET_DISABLE_TOUCHUIFORCEOFF = 0x00000200
TABLET_DISABLE_TOUCHSWITCH = 0x00008000
TABLET_DISABLE_FLICKS = 0x00010000
TABLET_ENABLE_FLICKSONCONTEXT = 0x00020000
TABLET_ENABLE_FLICKLEARNINGMODE = 0x00040000
TABLET_DISABLE_SMOOTHSCROLLING = 0x00080000
TABLET_DISABLE_FLICKFALLBACKKEYS = 0x00100000
GWL_WNDPROC = -4

QUERYSYSTEMGESTURE_WNDPROC = (
    TABLET_DISABLE_PRESSANDHOLD |
    TABLET_DISABLE_PENTAPFEEDBACK |
    TABLET_DISABLE_PENBARRELFEEDBACK |
    TABLET_DISABLE_SMOOTHSCROLLING |
    TABLET_DISABLE_FLICKFALLBACKKEYS |
    TABLET_DISABLE_TOUCHSWITCH |
    TABLET_DISABLE_FLICKS)

if 'KIVY_DOC' not in os.environ:
    from ctypes.wintypes import (ULONG, HANDLE, DWORD, LONG, UINT,
                                 WPARAM, LPARAM, BOOL, HWND, POINT,
                                 RECT as RECT_BASE)
    from ctypes import (windll, WINFUNCTYPE, POINTER,
                        c_int, c_longlong, c_void_p, Structure,
                        sizeof, byref, cast)

    class RECT(RECT_BASE):
        x = property(lambda self: self.left)
        y = property(lambda self: self.top)
        w = property(lambda self: self.right - self.left)
        h = property(lambda self: self.bottom - self.top)

    # check availability of RegisterTouchWindow
    if not hasattr(windll.user32, 'RegisterTouchWindow'):
        raise Exception('Unsupported Window version')

    LRESULT = LPARAM
    WNDPROC = WINFUNCTYPE(LRESULT, HWND, UINT, WPARAM, LPARAM)

    class TOUCHINPUT(Structure):
        _fields_ = [
            ('x', LONG),
            ('y', LONG),
            ('pSource', HANDLE),
            ('id', DWORD),
            ('flags', DWORD),
            ('mask', DWORD),
            ('time', DWORD),
            ('extraInfo', POINTER(ULONG)),
            ('size_x', DWORD),
            ('size_y', DWORD)]

        def size(self):
            return (self.size_x, self.size_y)

        def screen_x(self):
            return self.x / 100.0

        def screen_y(self):
            return self.y / 100.0

        def _event_type(self):
            if self.flags & TOUCHEVENTF_MOVE:
                return 'update'
            if self.flags & TOUCHEVENTF_DOWN:
                return 'begin'
            if self.flags & TOUCHEVENTF_UP:
                return 'end'
        event_type = property(_event_type)

    def SetWindowLong_WndProc_wrapper_generator(func):
        def _closure(hWnd, wndProc):
            oldAddr = func(hWnd, GWL_WNDPROC, cast(wndProc, c_void_p).value)
            return cast(c_void_p(oldAddr), WNDPROC)

        return _closure

    try:
        LONG_PTR = c_longlong
        windll.user32.SetWindowLongPtrW.restype = LONG_PTR
        windll.user32.SetWindowLongPtrW.argtypes = [HWND, c_int, LONG_PTR]
        SetWindowLong_WndProc_wrapper = \
            SetWindowLong_WndProc_wrapper_generator(
                windll.user32.SetWindowLongPtrW)
    except AttributeError:
        windll.user32.SetWindowLongW.restype = LONG
        windll.user32.SetWindowLongW.argtypes = [HWND, c_int, LONG]
        SetWindowLong_WndProc_wrapper = \
            SetWindowLong_WndProc_wrapper_generator(
                windll.user32.SetWindowLongW)

    windll.user32.GetMessageExtraInfo.restype = LPARAM
    windll.user32.GetMessageExtraInfo.argtypes = []
    windll.user32.GetClientRect.restype = BOOL
    windll.user32.GetClientRect.argtypes = [HANDLE, POINTER(RECT_BASE)]
    windll.user32.GetWindowRect.restype = BOOL
    windll.user32.GetWindowRect.argtypes = [HANDLE, POINTER(RECT_BASE)]
    windll.user32.CallWindowProcW.restype = LRESULT
    windll.user32.CallWindowProcW.argtypes = [WNDPROC, HWND, UINT, WPARAM,
                                              LPARAM]
    windll.user32.GetActiveWindow.restype = HWND
    windll.user32.GetActiveWindow.argtypes = []
    windll.user32.RegisterTouchWindow.restype = BOOL
    windll.user32.RegisterTouchWindow.argtypes = [HWND, ULONG]
    windll.user32.UnregisterTouchWindow.restype = BOOL
    windll.user32.UnregisterTouchWindow.argtypes = [HWND]
    windll.user32.GetTouchInputInfo.restype = BOOL
    windll.user32.GetTouchInputInfo.argtypes = [HANDLE, UINT,
                                                POINTER(TOUCHINPUT), c_int]
    windll.user32.GetSystemMetrics.restype = c_int
    windll.user32.GetSystemMetrics.argtypes = [c_int]

    windll.user32.ClientToScreen.restype = BOOL
    windll.user32.ClientToScreen.argtypes = [HWND, POINTER(POINT)]

    try:
        windll.user32.GetDpiForWindow.restype = UINT
        windll.user32.GetDpiForWindow.argtypes = [HWND]
    except AttributeError:
        pass