prompt large_stringlengths 70 991k | completion large_stringlengths 0 1.02k |
|---|---|
<|file_name|>vacuum2.py<|end_file_name|><|fim▁begin|>import agents as ag
def HW2Agent() -> object:
"An agent that keeps track of what locations are clean or dirty."
oldPercepts = [('None', 'Clean')]
oldActions = ['NoOp']
actionScores = [{
'Right': 0,
'Left': 0,
'Up': -1,
... | lastBump, lastStatus = oldPercepts[-1]
lastAction = oldActions[-1]
if status == 'Dirty': |
<|file_name|>OrganizationService.java<|end_file_name|><|fim▁begin|>/*
* Powered By agile
* Web Site: http://www.agile.com
* Since 2008 - 2016
*/
package persistent.prestige.modules.edu.service;
import java.util.Map;
/**
* Organization service类
* @author 雅居乐 2016-9-10 22:28:24
* @version 1.0
*/
public interfac... | * @param datas |
<|file_name|>test_nsmetadata.py<|end_file_name|><|fim▁begin|>from Foundation import *
from PyObjCTools.TestSupport import *<|fim▁hole|>
try:
unicode
except NameError:
unicode = str
class TestNSMetaData (TestCase):
def testConstants(self):
self.assertIsInstance(NSMetadataQueryDidStartGatheringNotifi... | |
<|file_name|>Utilities.cpp<|end_file_name|><|fim▁begin|>/*
* Author: Kiveisha Yevgeniy
* Copyright (c) 2015 Intel Corporation.
*
* Permission is hereby granted, free of charge, to any person obtaining
* a copy of this software and associated documentation files (the
* "Software"), to deal in the Software without restri... | |
<|file_name|>MergeablePlugin.java<|end_file_name|><|fim▁begin|>package org.jvnet.jaxb2_commons.plugin.mergeable;
import java.util.Arrays;
import java.util.Collection;
import javax.xml.namespace.QName;
import org.jvnet.jaxb2_commons.lang.JAXBMergeStrategy;
import org.jvnet.jaxb2_commons.lang.MergeFrom2;
import org.jv... |
protected JMethod generateMergeFrom$createNewInstance(
final ClassOutline classOutline, final JDefinedClass theClass) {
|
<|file_name|>upgradecharm.go<|end_file_name|><|fim▁begin|>// Copyright 2013 Canonical Ltd.
// Licensed under the AGPLv3, see LICENCE file for details.
package main
import (
"fmt"
"os"
"github.com/juju/cmd"
"github.com/juju/names"
"gopkg.in/juju/charm.v4"
"launchpad.net/gnuflag"
"github.com/juju/juju/cmd/envc... | |
<|file_name|>CertificationRequestInfo.d.ts<|end_file_name|><|fim▁begin|>declare namespace jsrsasign.KJUR.asn1.csr {
/**
* ASN.1 CertificationRequestInfo structure class
* @param params associative array of parameters (ex. {})
* @description
* ```
* // -- DEFINITION OF ASN.1 SYNTAX --
*... | */ |
<|file_name|>DistributedCartesianGridAI.py<|end_file_name|><|fim▁begin|>from pandac.PandaModules import *
from direct.directnotify.DirectNotifyGlobal import directNotify
from direct.task import Task
from .DistributedNodeAI import DistributedNodeAI
from .CartesianGridBase import CartesianGridBase
class DistributedCarte... | self.style = style
self.startingZone = startingZone
self.gridSize = gridSize |
<|file_name|>struct_warnings.go<|end_file_name|><|fim▁begin|>package aegis
//Licensed under the Apache License, Version 2.0 (the "License");<|fim▁hole|>//You may obtain a copy of the License at
//
//http://www.apache.org/licenses/LICENSE-2.0
//
//Unless required by applicable law or agreed to in writing, software
//di... | //you may not use this file except in compliance with the License. |
<|file_name|>save-action-service.js<|end_file_name|><|fim▁begin|>(function() {
'use strict';
angular
.module('otusjs.player.core.phase')
.service('otusjs.player.core.phase.SaveActionService', Service);
Service.$inject = [
'otusjs.player.core.phase.ActionPipeService',
'otusjs.player.core.phase.Pr... | function Service(ActionPipeService, PreSaveActionService, ExecutionSaveActionService, PostSaveActionService) {
var self = this;
|
<|file_name|>MostSearchData.java<|end_file_name|><|fim▁begin|>package adamin90.com.wpp.model.mostsearch;
import java.util.ArrayList;
import java.util.List;
import javax.annotation.Generated;
import com.google.gson.annotations.Expose;
import com.google.gson.annotations.SerializedName;
@Generated("org.jsonschema2pojo")... | }
} |
<|file_name|>common.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
# -*- coding: utf-8 -*-
APPNAME = 'desktop-mirror'<|fim▁hole|><|fim▁end|> | DEFAULT_PORT = 47767
VERSION = 'v0.8-7-g2038d52' |
<|file_name|>map.ts<|end_file_name|><|fim▁begin|>import $ from 'jquery';
import Vue from "vue";
import { BootstrapVue } from "bootstrap-vue";
import { FacilMap } from "../lib";
import "./bootstrap.scss";
import "bootstrap-vue/dist/bootstrap-vue.css";
import withRender from "./map.vue";
import "./map.scss";
import { dec... | }, |
<|file_name|>benchprint.py<|end_file_name|><|fim▁begin|>#=====================================================
# Copyright (C) 2011 Andrea Arteaga <andyspiros@gmail.com>
#=====================================================
#
# This program is free software; you can redistribute it and/or
# modify it under the terms o... | |
<|file_name|>index.js<|end_file_name|><|fim▁begin|>export * from '../common';
export NodeBundle from './NodeBundle';<|fim▁hole|><|fim▁end|> | export CommonJsResolver from './CommonJsResolver'; |
<|file_name|>recipes-8.py<|end_file_name|><|fim▁begin|>np.random.seed(1234)
fig, ax = plt.subplots(1)
x = 30*np.random.randn(10000)
mu = x.mean()
median = np.median(x)
sigma = x.std()
textstr = '$\mu=%.2f$\n$\mathrm{median}=%.2f$\n$\sigma=%.2f$'%(mu, median, sigma)
ax.hist(x, 50)
# these are matplotlib.patch.Patch pro... | props = dict(boxstyle='round', facecolor='wheat', alpha=0.5)
# place a text box in upper left in axes coords
ax.text(0.05, 0.95, textstr, transform=ax.transAxes, fontsize=14, |
<|file_name|>tests.py<|end_file_name|><|fim▁begin|>import datetime
from django.conf import settings
from django.db import DEFAULT_DB_ALIAS
from django.test import TestCase, skipIfDBFeature
from django.utils import tzinfo
from models import Donut, RumBaba
class DataTypesTestCase(TestCase):
def test_boolean_type(... | self.assertRaises(ValueError, d.save)
# ValueError: MySQL backend does not support timezone-aware datetimes. |
<|file_name|>TestLogSpecification.cpp<|end_file_name|><|fim▁begin|>////////////////////////////////////////////////////////////////////////////////
/// DISCLAIMER
///
/// Copyright 2020-2021 ArangoDB GmbH, Cologne, Germany
///
/// Licensed under the Apache License, Version 2.0 (the "License");
/// you may not use this ... | /// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
/// See the License for the specific language governing permissions and |
<|file_name|>index.js<|end_file_name|><|fim▁begin|>'use strict';<|fim▁hole|><|fim▁end|> | var path = require('path');
module.exports = path.join.bind(path, __dirname, '..'); |
<|file_name|>models.py<|end_file_name|><|fim▁begin|>"""Defines all the classes needed to create a Report from scratch.
Report: a single document about the state of a cafe.
Category: a class of products sharing common characteristics.
Product: a single item in a cafe.
Unit: a measure of products.
FullProduct: a product... | null=True,
blank=False,
default=None |
<|file_name|>import8.rs<|end_file_name|><|fim▁begin|>// Copyright 2012-2014 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution and at
// http://rust-lang.org/COPYRIGHT.
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/li... | |
<|file_name|>GlobalTask.java<|end_file_name|><|fim▁begin|>/*
* Copyright (C) 2010-2101 Alibaba Group Holding Limited.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www... | /** |
<|file_name|>choose_fastest_branch_dataset_serialization_test.py<|end_file_name|><|fim▁begin|># Copyright 2019 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of th... |
def branch_1(dataset):
return dataset.batch(10).map(lambda x: x)
|
<|file_name|>status.py<|end_file_name|><|fim▁begin|>import json as json_
# Template for code 200 requests so data can easily be added
def ok(d=None, *, json=True):
code = {'code': 200, 'status': 'OK', 'data': d}
if json:
code = json_.dumps(code)
return code
# The 400 codes shouldn't require any ... | if json:
code = json_.dumps(code)
return code
|
<|file_name|>event.js<|end_file_name|><|fim▁begin|>/* ***** BEGIN LICENSE BLOCK *****
* Distributed under the BSD license:
*
* Copyright (c) 2010, Ajax.org B.V.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following ... | if (useragent.isIE) {
var isNewClick = Math.abs(e.clientX - startX) > 5 || Math.abs(e.clientY - startY) > 5; |
<|file_name|>mod.rs<|end_file_name|><|fim▁begin|>// Copyleft (ↄ) meh. <meh@schizofreni.co> | http://meh.schizofreni.co
//
// This file is part of cancer.
//
// cancer is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foun... | pub use self::proxy::Proxy; |
<|file_name|>conftest.py<|end_file_name|><|fim▁begin|>import json
import os
from errata_tool import ErrataConnector, Erratum
from errata_tool.products import ProductList
import requests
import pytest
TESTS_DIR = os.path.dirname(os.path.abspath(__file__))
FIXTURES_DIR = os.path.join(TESTS_DIR, 'fixtures')
class MockR... | status_code = 200
encoding = 'utf-8'
headers = {'content-type': 'application/json; charset=utf-8'}
|
<|file_name|>test_problem_generator.py<|end_file_name|><|fim▁begin|>import unittest
from ai_graph_color import line, problem_generator
class TestProblemGenerator(unittest.TestCase):
def test_generate_file_path(self):
"""
Tests create file
"""
file_names = ['test.json', '']
... | |
<|file_name|>local.go<|end_file_name|><|fim▁begin|>package local
import (
"errors"
"fmt"
"io"
"io/ioutil"
"os"
"path/filepath"
"sort"
"github.com/restic/restic/backend"
)
var ErrWrongData = errors.New("wrong data returned by backend, checksum does not match")
type Local struct {
p string
}
// Open opens t... | |
<|file_name|>moc_cookiejar.cpp<|end_file_name|><|fim▁begin|>/****************************************************************************
** Meta object code from reading C++ file 'cookiejar.h'
**
** Created: Fri May 7 07:20:45 2010
** by: The Qt Meta Object Compiler version 62 (Qt 4.6.2)
**
** WARNING! All ... | const QMetaObject *CookieExceptionsModel::metaObject() const
{
|
<|file_name|>FootpathRemoveAction.cpp<|end_file_name|><|fim▁begin|>/*****************************************************************************
* Copyright (c) 2014-2020 OpenRCT2 developers
*
* For a complete list of all authors, please refer to contributors.md
* Interested in contributing? Visit https://github.c... | while (!(tileElement++)->IsLastForTile())
{ |
<|file_name|>IAppJiyoujiaHeadDao.java<|end_file_name|><|fim▁begin|><|fim▁hole|>import cn.cloudself.model.AppJiyoujiaHeadEntity;
import cn.cloudself.model.IntegerEntity;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.repository.Repository;
i... | package cn.cloudself.dao;
|
<|file_name|>hr_payroll_pay_commission.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Original Module by SIESA (<http://www.siesacr.com>)
# Refactored by CLEARCORP S.A. (<http:... | for payment in self.browse(cr, uid, ids, context=context):
if payment.amount_paid <= 0.0:
return False |
<|file_name|>main.cpp<|end_file_name|><|fim▁begin|>// URI - 1195
// Implementar um TAD ABB (Arvore Binaria de Busca) com as funcoes de insercao e liberacao
#include <iostream>
#include <cstdio>
using namespace std;
// Estrutura da ABB
struct Arv
{
int valor;
Arv *esq;
Arv *dir;
}typedef Arv;
// Funcoes ... | void imprimePos (Arv *r)
{
if (r != NULL)
{ |
<|file_name|>InteractionObjectFactory.js<|end_file_name|><|fim▁begin|>// Copyright 2017 The Oppia Authors. All Rights Reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// ... | var defaultOutcome; |
<|file_name|>ui.rs<|end_file_name|><|fim▁begin|>extern crate rustbox;
use self::rustbox::{Color, Style, RustBox};
use super::board::{Board, HEIGHT, WIDTH};
use super::tetromino::{Tetromino, TetrominoType};
use super::window::Window;
// Default scaling factor for the board
const SCALE: usize = 2;
// Default values f... | |
<|file_name|>base.py<|end_file_name|><|fim▁begin|>from __future__ import absolute_import, unicode_literals
import os
import os.path
from freight.constants import PROJECT_ROOT
from freight.exceptions import CommandError
class UnknownRevision(CommandError):
pass
class Vcs(object):
ssh_connect_path = os.path... | return rv.strip() |
<|file_name|>compat.py<|end_file_name|><|fim▁begin|>try:
from django.utils.encoding import force_text # noqa
except ImportError:
from django.utils.encoding import force_unicode as force_text # noqa
<|fim▁hole|>try:
from urllib2 import urlopen # noqa
except ImportError:
from urllib.request import url... | |
<|file_name|>mod.rs<|end_file_name|><|fim▁begin|>//! GameCube archive and compression format.
//pub mod compress;
pub mod decompress;
#[derive(Clone, Debug)]
pub struct GslHeader {
pub name: String,
pub offset: u32,
pub size: u32
}
#[derive(Clone, Debug)]
pub struct GslFile {
pub name: String,
pu... | |
<|file_name|>admin.py<|end_file_name|><|fim▁begin|>from django.contrib import admin
from .models import Lesson, Course, CourseLead, QA
# from django.utils.translation import ugettext_lazy as _
from ordered_model.admin import OrderedModelAdmin
from core.models import User
# from adminfilters.models import Species, Breed... | 'student',
) |
<|file_name|>TouchZoom.js<|end_file_name|><|fim▁begin|>/*
* L.Handler.TouchZoom is used internally by L.Map to add touch-zooming on Webkit-powered mobile browsers.
*/
L.Handler.TouchZoom = L.Handler.extend({
enable: function() {
if (!L.Browser.touch || this._enabled) { return; }
L.DomEvent.addListener(th... | L.DomEvent.removeListener(document, 'touchmove', this._onTouchMove);
L.DomEvent.removeListener(document, 'touchend', this._onTouchEnd);
|
<|file_name|>decorators.py<|end_file_name|><|fim▁begin|>"""
Copyright: (c) 2012-2014 Artem Nezvigin <artem@artnez.com>
License: MIT, see LICENSE for details
"""
from functools import wraps
from flask import g, request, session, render_template, url_for, redirect
from faceoff.models.user import find_user
def template... | template = template_name |
<|file_name|>simpleamt.py<|end_file_name|><|fim▁begin|>import argparse, json
import boto3
from boto.mturk.connection import MTurkConnection
from boto.mturk.qualification import *
from jinja2 import Environment, FileSystemLoader
"""
A bunch of free functions that we use in all scripts.
"""
def get_jinja_env(config):
... | parser.add_argument('--config', default='config.json',
type=json_file)
return parser
|
<|file_name|>matchers.go<|end_file_name|><|fim▁begin|>/*
Copyright 2017 Mirantis
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by a... |
import (
"github.com/onsi/gomega/types"
) |
<|file_name|>test.rs<|end_file_name|><|fim▁begin|>// Copyright 2017 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution and at<|fim▁hole|>// http://rust-lang.org/COPYRIGHT.
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org... | |
<|file_name|>StartTote.java<|end_file_name|><|fim▁begin|>/*******************************************************************************
* Debrief - the Open Source Maritime Analysis Application
* http://debrief.info
*
* (C) 2000-2020, Deep Blue C Technology Ltd
*
* This library is free software; you can r... | *
|
<|file_name|>test_scale_in.py<|end_file_name|><|fim▁begin|>########
# Copyright (c) 2013 GigaSpaces Technologies Ltd. All rights reserved
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# ... | expectations['db']['existing']['scale_rel_install'] = 2
expectations['db']['existing']['rel_uninstall'] = 2
self.deployment_assertions(expectations) |
<|file_name|>send-to-messenger.ts<|end_file_name|><|fim▁begin|>import { post } from 'src/lib/http';
import { log, warn } from 'src/lib/print';
import { messengerAppId } from 'src/store';
import { SendToMessengerEvent } from 'typings/facebook';
import { addClass, setAttributes } from 'src/lib/dom';
import { shallowCopy ... | |
<|file_name|>urls.py<|end_file_name|><|fim▁begin|><|fim▁hole|>urlpatterns = patterns('links.views',
url(r'^link/settings/$', views.settings, name = 'settings'),
url(r'^link/donate/(?P<url>[\d\w.]+)$', views.kintera_redirect, name = 'donate'),
url(r'^link/rider/(?P<url>[\d\w.]+)$', views.t4k_redirect, name =... | from django.conf.urls import patterns, url
from links import views
|
<|file_name|>mod.rs<|end_file_name|><|fim▁begin|>use cmd::{REPLY, UNKNOWN};
use cmd;
use con::{Peer, Connection};
use server::{Server};
use super::{RawMessage};
mod registration;
mod msg;
mod join;
mod part;
mod mode;<|fim▁hole|>mod ping_pong;
mod cap;
macro_rules! handle {
{$(
$command:ident with $hand... | mod lists;
mod simple; |
<|file_name|>check_with_sitemap_vpro.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python3
import os
import re
import subprocess
import sys
import threading
import time
import urllib
from subprocess import Popen, PIPE
sys.path.append("..")
from check_with_sitemap import CheckWithSitemap
DEFAULT_JAVA_PATH = 'java'
... | |
<|file_name|>HITLayoutParameterJsonUnmarshaller.java<|end_file_name|><|fim▁begin|>/*
* Copyright 2012-2017 Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with
* the License. A copy of the Li... | break; |
<|file_name|>0010_auto__add_field_poll_detailed_chart.py<|end_file_name|><|fim▁begin|># encoding: utf-8
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding field 'Poll.detaile... | 'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'blank': 'True'}),
'first_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}),
'groups': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Group']", 's... |
<|file_name|>test_118_appid_table_entry.py<|end_file_name|><|fim▁begin|># Created: 16.03.2011, 2018 rewritten for pytest
# Copyright (C) 2011-2019, Manfred Moitzi
# License: MIT License
import pytest
from ezdxf.entities.appid import AppID
@pytest.fixture
def appid():
return AppID.new(<|fim▁hole|> },
)... | "FFFF",
dxfattribs={
"name": "EZDXF", |
<|file_name|>Set-iterator-order.js<|end_file_name|><|fim▁begin|>// Set iterators produces entries in the order they were inserted.
var set = Set();
var i;
for (i = 7; i !== 1; i = i * 7 % 1117)
set.add(i);
assertEq(set.size, 557);
i = 7;
for (var v of set) {
assertEq(v, i);
i = i * 7 % 1117;
}<|fim▁hole|>... | assertEq(i, 1); |
<|file_name|>IntegrationTests.java<|end_file_name|><|fim▁begin|>package com.example.demo;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.springframework.boot.autoconfigure.ImportAutoConfiguration;
import org.springframework.boot.autoconfigure.mongo.embedded.EmbeddedMongoAutoCon... | WebTestClient client; |
<|file_name|>run.py<|end_file_name|><|fim▁begin|>import cPickle
import gzip
import time
import os
import sys
import cPickle as pickle
import gc
import numpy as np
from time import sleep
import auc
import theano
import theano.tensor as T
from theano.tensor.signal import downsample
from theano.tensor.nnet import conv
fro... | |
<|file_name|>testwebfunctionaldb.py<|end_file_name|><|fim▁begin|>#! /usr/bin/env python
# -*- coding: UTF8 -*-
# Este arquivo é parte do programa Carinhas
# Copyright 2013-2014 Carlo Oliveira <carlo@nce.ufrj.br>,
# `Labase <http://labase.selfip.org/>`__; `GPL <http://is.gd/3Udt>`__.
#
# Carinhas é um software livre; vo... | self.assertEqual('302 Found', response.status)
|
<|file_name|>vsotogglbutton.d.ts<|end_file_name|><|fim▁begin|>/// <reference path="../../scripts/ref/jquery.d.ts" />
/// <reference path="../../scripts/ref/VSS.d.ts" />
interface ITogglFormResponse {
activityDescription: string;
project: string;
tags: string;
}
interface ITogglOpts {
method: string;
... | }
declare var togglButtonHandler: {
execute: (actionContext: any) => void;
}; |
<|file_name|>fully-qualified-type-name3.rs<|end_file_name|><|fim▁begin|>// Copyright 2012-2014 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution and at
// http://rust-lang.org/COPYRIGHT.
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http:... | |
<|file_name|>strings.go<|end_file_name|><|fim▁begin|>package parser
import (
"monkey/ast"
"monkey/token"
)
func (p *Parser) parseStringLiteralExpression() ast.Expression {
return &ast.StringLiteral{Token: p.curToken, Value: p.curToken.Literal}
}
func (p *Parser) parseInterpolatedString() ast.Expression {
is := &... | key := "0"[0]
for { |
<|file_name|>members.js<|end_file_name|><|fim▁begin|>'use strict';
/**
* @ngdoc function
* @name lubriApp.controller:MembersCtrl
* @description
* # MembersCtrl
* Controller of the lubriApp
*/
angular.module('lubriApp')
.config(function($stateProvider) {
$stateProvider.state('app.members', {
abstract... | },
exporterPdfOrientation: 'portrait', |
<|file_name|>issue-76077-1.rs<|end_file_name|><|fim▁begin|>// run-rustfix
#![allow(dead_code, unused_variables)]
pub mod foo {
#[derive(Default)]
pub struct Foo { invisible: bool, }
#[derive(Default)]
pub struct Bar { pub visible: bool, invisible: bool, }
}
fn main() {
let foo::Foo {} = foo::Foo:... | |
<|file_name|>gpu.rs<|end_file_name|><|fim▁begin|>use maplit::hashmap;
use crate::GpuState;
use std::{collections::HashMap, mem};
#[repr(C)]
#[derive(Copy, Clone)]
pub(crate) struct GenHeightmapsUniforms {
pub position: [i32; 2],
pub origin: [i32; 2],
pub spacing: f32,
pub in_slot: i32,
pub out_slo... | |
<|file_name|>rpc.py<|end_file_name|><|fim▁begin|># adapted from zmq_server_example.py in tinyrpc
import time, sys
import zmq
from tinyrpc.protocols.jsonrpc import JSONRPCProtocol
from tinyrpc.transports.zmq import ZmqServerTransport
from tinyrpc.server import RPCServer
from tinyrpc.dispatch import RPCDispatcher
class ... | self.transport = ZmqServerTransport.create(self.ctx, 'tcp://127.0.0.1:8000')
|
<|file_name|>channel_partner_links.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
# Copyright 2022 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apach... | |
<|file_name|>controller.go<|end_file_name|><|fim▁begin|>/*
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache Lice... | "github.com/openblockchain/obc-peer/openchain/consensus/noops" |
<|file_name|>funcs.js<|end_file_name|><|fim▁begin|>/**
* XTemplate 所有的扩展函数集合,用于处理html中常见的格式转换,默认值等处理。
* 如果需要自行扩展,请使用window.Render的addFunc函数
*
* @class Render.funcs
*/
(function (r, undefined) {
'use strict';
/**
* 指定输出的默认值,如果有值就原样输出,如果空或是null,就输出默认值。
*
* 示例:
*
* {name|default,'... | |
<|file_name|>index.js<|end_file_name|><|fim▁begin|>import React from "react";
import { Message } from "semantic-ui-react";
import Bracket from "./Bracket";
import "./index.scss";
import parseStats from './parseStats';
export default class Brackets extends React.PureComponent {
constructor(props) {<|fim▁hole|>
t... | super(props); |
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|><|fim▁hole|><|fim▁end|> | from PETScMatOps import * |
<|file_name|>ibos.select2.js<|end_file_name|><|fim▁begin|>/**
* 基于jquery.select2扩展的select插件,基本使用请参考select2相关文档
* 默认是多选模式,并提供了input模式下的初始化方法,对应的数据格式是{ id: 1, text: "Hello" }
* 这里的参数只对扩展的部分作介绍
* filter、includes、excludes、query四个参数是互斥的,理论只能有其一个参数
* @method ibosSelect
* @param option.filter
* @param {Function} opti... |
return select2;
})(); |
<|file_name|>py25tests.py<|end_file_name|><|fim▁begin|>#-*- coding: ISO-8859-1 -*-
# pysqlite2/test/regression.py: pysqlite regression tests
#
# Copyright (C) 2007 Gerhard Häring <gh@ghaering.de>
#
# This file is part of pysqlite.
#
# This software is provided 'as-is', without any express or implied
# warranty. In no ... | |
<|file_name|>open-browser-tab.tsx<|end_file_name|><|fim▁begin|>/*
* This file is part of CoCalc: Copyright © 2020 Sagemath, Inc.
* License: AGPLv3 s.t. "Commons Clause" – see LICENSE.md for details
*/
import * as React from "react";
import { defaults } from "smc-util/misc";
import { alert_message } from "../ale... | |
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|># Copyright (c) 2017-2019 Cloudify Platform Ltd. All rights reserved
#<|fim▁hole|>#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS I... | # Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at |
<|file_name|>plugin_npapi.cc<|end_file_name|><|fim▁begin|>/*
* Copyright 2008 The Native Client Authors. All rights reserved.
* Use of this source code is governed by a BSD-style license that can
* be found in the LICENSE file.
*/
#include "native_client/src/trusted/plugin/npapi/plugin_npapi.h"
#include <stdio.h... | |
<|file_name|>read.js<|end_file_name|><|fim▁begin|>var AIO = require('../../index');
// create an instance
aio = AIO(process.env.AIO_KEY || 'xxxxxxxxxxxx');
// get a list of all groups
aio.groups(function(err, data) {
if(err) {
return console.error(err);<|fim▁hole|>
});
// get a specific group by name
aio.grou... | }
// log data array
console.log(data); |
<|file_name|>vector.rs<|end_file_name|><|fim▁begin|>//! Implementation of the **Vector** types.
//!
//! **Note:** Much of the code in this module is inspired by or copied directly from the `cgmath`
//! crate. Originally we used the `cgmath` types directly, however we decided to switch to our own
//! implementations in ... | |
<|file_name|>opener.js<|end_file_name|><|fim▁begin|>/*--------------------------------------------------------
* Copyright (c) 2011, The Dojo Foundation
* This software is distributed under the "Simplified BSD license",
* the text of which is available at http://www.winktoolkit.org/licence.txt
* or see the "lic... | * @param {integer} param.panelId uId of the panel
*/
wink.ui.xyz.Opener.Panel.prototype =
|
<|file_name|>manual_non_exhaustive.rs<|end_file_name|><|fim▁begin|>#![warn(clippy::manual_non_exhaustive)]
#![allow(unused)]
mod enums {
enum E {
A,
B,
#[doc(hidden)]
_C,
}
// user forgot to remove the marker
#[non_exhaustive]
enum Ep {
A,
B,
... | // private field is the only field, should be ignored
struct OnlyMarker(());
|
<|file_name|>credit_seat_spec.js<|end_file_name|><|fim▁begin|>define([
'collections/credit_provider_collection',
'ecommerce',
'models/course_seats/credit_seat'
],
function (CreditProviderCollection,
ecommerce,
CreditSeat) {
'use strict';
var ... | it('should return a message if the credit provider is not set', function () {
var msg = 'All credit seats must have a credit provider.',
values = [null, undefined, '']; |
<|file_name|>RedisCluster.java<|end_file_name|><|fim▁begin|>/**
* Copyright (c) 2011 Jonathan Leibiusky
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
* documentation files (the "Software"), to deal in the Software without restriction, including with... | public Set<String> zrangeByScore(final String key, final String min,
final String max) { |
<|file_name|>InvalidJsonFLException.java<|end_file_name|><|fim▁begin|>/**
* This file is part of JsonFL.
*
* JsonFL is free software: you can redistribute it and/or modify it under the
* terms of the Lesser GNU General Public License as published by the Free
* Software Foundation, either version 3 of the License, ... | |
<|file_name|>main.py<|end_file_name|><|fim▁begin|>""" """
from __future__ import unicode_literals, division, print_function, absolute_import
import argparse
import codecs
import sys
from sqlalchemy.engine import create_engine
from sqlalchemy.schema import MetaData
from sqlacodegen.codegen import CodeGenerator
import ... | args = parser.parse_args() |
<|file_name|>configurepanel.py<|end_file_name|><|fim▁begin|># -----------------------------------------------------------------------------
# Getting Things GNOME! - a personal organizer for the GNOME desktop
# Copyright (c) 2008-2013 - Lionel Dricot & Bertrand Rousseau
#
# This program is free software: you can redist... | self.spinner.hide()
|
<|file_name|>powerConfigurator.py<|end_file_name|><|fim▁begin|>__author__ = 'mslabicki'
import pygmo as pg
#
from pyltes.powerOptimizationProblemsDef import maximalThroughputProblemRR
from pyltes.powerOptimizationProblemsDef import local_maximalThroughputProblemRR
from pyltes.powerOptimizationProblemsDef import ... | self.parent = parent
def findPowersRR(self, objectiveFunction="averageThr", sgaGenerations = 100, numberOfThreads = 11, numOfIndividuals = 10, evolveTimes = 10, method="global", x_arg=None, y_arg=None, expectedSignalLoss_arg=None):
if method == "local":
|
<|file_name|>validator.go<|end_file_name|><|fim▁begin|>/*
Copyright IBM Corp. 2016 All Rights Reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licens... | "github.com/hyperledger/fabric/core/common/ccprovider"
"github.com/hyperledger/fabric/core/common/validation"
"github.com/hyperledger/fabric/core/ledger"
ledgerUtil "github.com/hyperledger/fabric/core/ledger/util" |
<|file_name|>jscouch.documents.js<|end_file_name|><|fim▁begin|>/*
Licensed under the Apache License, Version 2.0 (the "License"); you may not
use this file except in compliance with the License. You may obtain a copy
of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable... | size: 32091 |
<|file_name|>CarEntityTests.java<|end_file_name|><|fim▁begin|>package org.softuni.mostwanted.entity;
import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.softuni.mostwanted.util.ReflectionUtil;
import org.springframework.test.context.junit4.SpringJUnit4Cl... | || |
<|file_name|>ui.go<|end_file_name|><|fim▁begin|>package ui
import (
"image"
"image/color"
"image/draw"
)
// UI represents an instance of the UI
type UI struct {
component
WindowTitle string
Input Input
keyFuncs map[Key]func() error
prevX, prevY int
}
// New creates a new UI instance
func New(widt... | func (ui *UI) SetWindowTitle(s string) { |
<|file_name|>backend.rs<|end_file_name|><|fim▁begin|>//! Abstraction around the object writing crate
use std::convert::{TryFrom, TryInto};
use rustc_data_structures::fx::FxHashMap;
use rustc_session::Session;
use cranelift_codegen::isa::TargetIsa;
use cranelift_module::FuncId;
use cranelift_object::{ObjectBuilder, O... | ) {
let (symbol, symbol_offset) = match reloc.name {
DebugRelocName::Section(id) => (section_map.get(&id).unwrap().1, 0), |
<|file_name|>fmt.rs<|end_file_name|><|fim▁begin|>#![feature(core)]
extern crate core;
#[cfg(test)]
mod tests {
// pub trait FixedSizeArray<T> {
// /// Converts the array to immutable slice
// fn as_slice(&self) -> &[T];
// /// Converts the array to mutable slice
// fn as_mut_slice(&... | // }
// } |
<|file_name|>issue-18400.rs<|end_file_name|><|fim▁begin|>// Copyright 2014 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution and at
// http://rust-lang.org/COPYRIGHT.
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/lic... | fn set(&mut self, bits: &[T]) {
for &bit in bits.iter() { |
<|file_name|>builddeb.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
import os
import sys
try:
import py2deb
except ImportError:
import fake_py2deb as py2deb
import constants
__app_name__ = constants.__app_name__
__description__ = """Very simple Audiobook player.
Supports playing, pausing, ... | |
<|file_name|>clusterrole_handler.go<|end_file_name|><|fim▁begin|>package rbac
import (
v3 "github.com/rancher/rancher/pkg/generated/norman/management.cattle.io/v3"
typesrbacv1 "github.com/rancher/rancher/pkg/generated/norman/rbac.authorization.k8s.io/v1"
rbacv1 "k8s.io/api/rbac/v1"
apierrors "k8s.io/apimachinery/p... | }
}
|
<|file_name|>vite-plugin-react-svg-tests.ts<|end_file_name|><|fim▁begin|>import { PluginOption } from 'vite';
import reactSvgPlugin = require('vite-plugin-react-svg');
const testCases: Array<PluginOption | PluginOption[]> = [<|fim▁hole|> expandProps: 'start',
memo: false,
ref: false,
rep... | reactSvgPlugin({
defaultExport: 'component', |
<|file_name|>test_guid_auto_include.py<|end_file_name|><|fim▁begin|>from django.utils import timezone
import pytest
from django_bulk_update.helper import bulk_update
from django.db.models import DateTimeField
from osf_tests.factories import UserFactory, PreprintFactory, NodeFactory
@pytest.mark.django_db
class Tes... | def test_related_manager(self, Factory, django_assert_num_queries):
thing_with_contributors = Factory()
if not hasattr(thing_with_contributors, 'contributors'): |
<|file_name|>TestMadRelaxed.rs<|end_file_name|><|fim▁begin|>/*
* Copyright (C) 2016 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.... |
// Don't edit this file! It is auto-generated by frameworks/rs/api/generate.sh.
|
<|file_name|>site.js<|end_file_name|><|fim▁begin|>/******************************************************/
/* Funciones para manejo de datos del home */
/******************************************************/<|fim▁hole|>
var endpoint = 'http://localhost/RelemancoShopsWeb/api/web/v1/';
var rootURL = "/Relema... | |
<|file_name|>kitchen_sink.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
import kivymd.snackbar as Snackbar
from kivy.app import App
from kivy.lang import Builder
from kivy.metrics import dp
from kivy.properties import ObjectProperty
from kivy.uix.image import Image
from kivymd.bottomsheet import MDListBottomS... | hint_text: "Max text length = 10" |
<|file_name|>side_offsets.rs<|end_file_name|><|fim▁begin|>// Copyright 2013 The Servo Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution.
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
/... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.