prompt large_stringlengths 70 991k | completion large_stringlengths 0 1.02k |
|---|---|
<|file_name|>vga_buffer.rs<|end_file_name|><|fim▁begin|>use core::fmt;
use core::ptr::Unique;
use volatile::Volatile;
use spin::Mutex;
#[allow(dead_code)] // Don't complain about unused variables.
#[derive(Debug, Clone, Copy)]
#[repr(u8)] // Store each value as byte.
pub enum Color {
Black = 0,
Bl... | });
self.column_position += 1;
}
} |
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
from converters.circle import circle
from converters.currency import currency
from converters.electric import electric
from converters.force import force
from converters.pressure import pressure
from converters.speed import speed
from convert... | def register(self, converter):
""" |
<|file_name|>Grid.java<|end_file_name|><|fim▁begin|>public class Grid {
public Tile array[][] = new Tile[10][8];
public Grid() {
//
for(int y = 0; y < getHeight(); y++) {
for(int x = 0; x < getWidth(); x++) {
array[x][y] = new Tile();
}
}
}
public int getWidth() { retu... | public void makeHolierHole() {
|
<|file_name|>experiments.py<|end_file_name|><|fim▁begin|># This program 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 Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This progr... | classifiers=cls,
result=outfile) |
<|file_name|>utils.py<|end_file_name|><|fim▁begin|>import types
def is_string_like(maybe):
"""Test value to see if it acts like a string"""
try:
maybe+""<|fim▁hole|> except TypeError:
return 0
else:
return 1
def is_list_or_tuple(maybe):
return isinstance(maybe, (types.Tuple... | |
<|file_name|>remove.js<|end_file_name|><|fim▁begin|>'use strict'
import assert from 'assert'
import {remove} from '..'
describe('remove', () => {
it('throws a TypeError if the first argument is not an array', () => {
const targets = [null, true, function() {}, {}]
if (global.Map) targets.push(new Map())
... |
if (global.Set) {
it('removes the value if target is a set', () => {
const target = new Set() |
<|file_name|>net_logging.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2017, Ansible by Red Hat, inc
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
A... | |
<|file_name|>mod.rs<|end_file_name|><|fim▁begin|>/*!
Generates an iterator type `Matcher` that looks roughly like
```ignore
mod intern_token {
extern crate regex as regex;
#[derive(Clone, Debug, PartialEq, Eq, PartialOrd, Ord)]
pub struct Token<'input>(pub usize, pub &'input str);
// ... | for literal in ®ex_strings {
rust!(out, "{}regex::Regex::new({}).unwrap(),", prefix, literal); |
<|file_name|>DisableGUILogon.py<|end_file_name|><|fim▁begin|>###############################################################################
# #
# Copyright 2019. Triad National Security, LLC. All rights reserved. #
# This program was ... | "GUI logon is enabled\n"
return compliant, results |
<|file_name|>CachedObjectKeys.java<|end_file_name|><|fim▁begin|>package org.consumersunion.stories.common.client.util;
public class CachedObjectKeys {
public static final String OPENED_CONTENT = "openedContent";<|fim▁hole|><|fim▁end|> | public static final String OPENED_STORY = "openedStory";
public static final String OPENED_COLLECTION = "openedCollection";
} |
<|file_name|>settings.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
# coding=utf-8
import flask
from flask import flash
from flask_login import login_required
from rpress.models import SiteSetting
from rpress.database import db
from rpress.runtimes.rpadmin.template import render_template, navbar
from rpress.... | @login_required
@navbar(level1='settings') |
<|file_name|>index.ts<|end_file_name|><|fim▁begin|><|fim▁hole|>export * from './authentication.service';
export * from './user.service';
export * from './serviceRequest.service';<|fim▁end|> | export * from './alert.service'; |
<|file_name|>website.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
# © 2015 Grupo ESOC Ingeniería de Servicios, S.L.U. - Jairo Llopis
# License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl.html).
from openerp import api, models
class WebsiteMenu(models.Model):
_inherit = "website.menu"
@ap... | |
<|file_name|>nested.rs<|end_file_name|><|fim▁begin|>// Copyright 2013 The rust-for-real developers. For a full listing of the authors,
// refer to the AUTHORS file at the top-level directory of this distribution.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except i... | |
<|file_name|>codigo27.py<|end_file_name|><|fim▁begin|>#! /usr/bin/python3
# -*- coding:utf-8 -*-
# Funciones y parametros arbitrarios<|fim▁hole|> print (type(nombres))
for alumno in nombres:
print ("%s es alumno y tiene %d años" % (alumno, nombres[alumno]))
return nombres
#diccionario = {"Adrian":25... | def funcion(**nombres): |
<|file_name|>responsiveFlexOrder.demo.ts<|end_file_name|><|fim▁begin|>import {Component} from '@angular/core';
@Component({
selector: 'demo-responsive-flex-order',
styleUrls : [
'../../assets/css/material2.css'
],
template: `
<md-card class="card-demo" >
<md-card-title>Responsive Flex Ordering</m... | |
<|file_name|>bitcoin_es_MX.ts<|end_file_name|><|fim▁begin|><TS language="es_MX" version="2.0">
<context>
<name>AddressBookPage</name>
<message>
<source>Create a new address</source>
<translation>Crear una dirección nueva</translation>
</message>
<message>
<source>&New</source... | |
<|file_name|>Popup.js<|end_file_name|><|fim▁begin|>require(
[
'gui/Button'
],
function (Button) {
return;
var button = new Button({
main: $('#ui-button')
});
button.render();
}<|fim▁hole|><|fim▁end|> | ); |
<|file_name|>basic-example.js<|end_file_name|><|fim▁begin|>var config = {
container: "#basic-example",
connectors: {
type: 'step'
},
node: {
HTMLclass: 'nodeExample1'
}
},
ceo = {
text: {
name: "Mark Hill",
... | },
image: "../headshots/7.jpg"
},
{
|
<|file_name|>ErrorProperties.java<|end_file_name|><|fim▁begin|>/*
* Copyright 2012-2017 the original author or authors.
*
* 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://... | private IncludeStacktrace includeStacktrace = IncludeStacktrace.NEVER;
public String getPath() {
return this.path; |
<|file_name|>test_admin_actions.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
import django_dynamic_fixture as fixture
from unittest import mock
from django import urls
from django.contrib.admin.helpers import ACTION_CHECKBOX_NAME
from django.contrib.auth.models import User
from django.test import TestCase
f... | self.project.users.add(owner_b)
self.assertFalse(self.owner.profile.banned) |
<|file_name|>step_attach_iso.go<|end_file_name|><|fim▁begin|><|fim▁hole|> "fmt"
"log"
"github.com/hashicorp/packer-plugin-sdk/multistep"
packersdk "github.com/hashicorp/packer-plugin-sdk/packer"
parallelscommon "github.com/hashicorp/packer/builder/parallels/common"
)
// This step attaches the ISO to the virtual m... | package iso
import (
"context" |
<|file_name|>make_datasets.py<|end_file_name|><|fim▁begin|>#! /usr/bin/env python
# ----------------------------------------------------------------------
# Numenta Platform for Intelligent Computing (NuPIC)
# Copyright (C) 2013, Numenta, Inc. Unless you have an agreement
# with Numenta, Inc., for a separate license f... | |
<|file_name|>OpenIceThicknessListener.rs<|end_file_name|><|fim▁begin|><|fim▁hole|><|fim▁end|> | energymodels.OpenIceThicknessListener |
<|file_name|>a6.rs<|end_file_name|><|fim▁begin|>fn main() { // Ciclos while, for, Enumerate
let mut x = 5;
let mut completado = false; // La variable mutable completado es de tipo booleano, es decir que solo tiene dos valores: false o true.
println!("Ciclo while");
while !completado { // El ciclo while termina c... | println!("{}", x); |
<|file_name|>responsesEvaluate.py<|end_file_name|><|fim▁begin|>import logging
import os
import math
from collections import defaultdict
from gensim import corpora
# 引入斷詞與停用詞的配置
from .Matcher.matcher import Matcher
class Evaluator(Matcher):
"""
讀入一串推文串列,計算出當中可靠度最高的推文
"""
def __init__(self,segLib="Tai... | self.buildResponses(responses)
self.segmentResponse() |
<|file_name|>NavigationDrawerAdapter.java<|end_file_name|><|fim▁begin|>package com.dyhpoon.fodex.navigationDrawer;
import android.content.Context;
import android.view.View;
import android.view.ViewGroup;
import com.dyhpoon.fodex.R;
/**
* Created by darrenpoon on 3/2/15.
*/
public class NavigationDrawerAdapter exte... | convertView = inflateListDivider(convertView);
break;
case 4:
convertView = inflateUtilityItem(convertView, position); |
<|file_name|>jquery.flot.hiddengraphs.js<|end_file_name|><|fim▁begin|>/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this file,
* You can obtain one at http://mozilla.org/MPL/2.0/. */
/*
* Plugin to hide series in flot graphs.
... | .mouseleave(function() { $(this).css("cursor", "default"); }) |
<|file_name|>resolve.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python
from src.sqllist import GLOBALS
class BasicResolver(object):
"""General resolver class"""
def __init__(self, conn=None):
self.conn = conn
pass
def resolve(self, detections, sources):
"""Template resolve fun... | return False, []
def load_detections(self, group_id):
cursor = self.conn.get_cursor(""" |
<|file_name|>router.js<|end_file_name|><|fim▁begin|>import { createRouter, createWebHistory } from "vue-router/dist/vue-router.esm.js";
import Home from "./views/Home.vue";
const routerHistory = createWebHistory("/");
let router = createRouter({
history: routerHistory,
routes: [
{ path: '/', component: H... | { path: '/who', component: Home, name: 'who' }, |
<|file_name|>resource_instance.go<|end_file_name|><|fim▁begin|>package opc
import (
"bytes"
"encoding/json"
"fmt"
"log"
"strconv"
"strings"
"github.com/hashicorp/go-oracle-terraform/compute"
"github.com/r3labs/terraform/helper/hashcode"
"github.com/r3labs/terraform/helper/schema"
"github.com/r3labs/terrafor... | |
<|file_name|>v1_ingress_class_spec.py<|end_file_name|><|fim▁begin|># coding: utf-8
"""
Kubernetes
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501
The version of the OpenAPI document: release-1.23
Generated by: https://openapi-ge... |
@parameters.setter |
<|file_name|>pipelines.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
# Define your item pipelines here
#
# Don't forget to add your pipeline to the ITEM_PIPELINES setting
# See: http://doc.scrapy.org/en/latest/topics/item-pipeline.html
from scrapyproject.models import (Cinema, Showing, ShowingBooking, Movie,... | self.crawled_movies[item['title']] = item
else: |
<|file_name|>0005_auto_20200823_0726.py<|end_file_name|><|fim▁begin|># Generated by Django 2.2.12 on 2020-08-23 07:26
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('job_board', '0004_jobpost_is_from_recruiting_agency'),
]
operations = [
... | model_name='jobpost',
name='location', |
<|file_name|>tests.py<|end_file_name|><|fim▁begin|>import uuid
from couchdbkit import ResourceConflict
from couchdbkit.exceptions import ResourceNotFound
from django.test import TestCase
from toggle.shortcuts import update_toggle_cache, namespaced_item, clear_toggle_cache
from .models import generate_toggle_id, Toggl... | def test_add_remove(self):
toggle = Toggle(slug=self.slug, enabled_users=['petyr', 'jon'])
toggle.save() |
<|file_name|>lib.rs<|end_file_name|><|fim▁begin|>// DO NOT EDIT !
// This file was generated automatically from 'src/mako/api/lib.rs.mako'
// DO NOT EDIT !
//! This documentation was generated from *replicapool* crate version *0.1.8+20150311*, where *20150311* is the exact revision of the *replicapool:v1beta2* schema ... | //!
//! ```Rust,ignore
//! let r = hub.resource().activity(...).doit() |
<|file_name|>RefetchWhenApiKeyExpired.tsx<|end_file_name|><|fim▁begin|>import { Search_system$key } from "__generated__/Search_system.graphql"
import { SearchQuery } from "__generated__/SearchQuery.graphql"
import { useEffect } from "react"
import { connectStateResults, StateResultsProvided } from "react-instantsearch-... | }
|
<|file_name|>grating.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
"""Sinusoidal grating calculated in realtime."""
############################
# Import various modules #
############################
import VisionEgg
VisionEgg.start_default_logging(); VisionEgg.watch_exceptions()
from VisionEgg.Core impor... | |
<|file_name|>index.js<|end_file_name|><|fim▁begin|>/* globals describe, before, beforeEach, after, afterEach, it */
'use strict';
const chai = require('chai');
const assert = chai.assert;
const expect = chai.expect;
chai.should();
chai.use(require('chai-things')); //http://chaijs.com/plugins/chai-things
chai.use(requ... | assert(false, 'Please add unit tests.');
|
<|file_name|>alertRunner.go<|end_file_name|><|fim▁begin|>package sched
import (
"fmt"
"time"
"bosun.org/cmd/bosun/cache"
"bosun.org/cmd/bosun/conf"
"bosun.org/slog"
)
// Run should be called once (and only once) to start all schedule activity.
func (s *Schedule) Run() error {
if s.RuleConf == nil || s.SystemCo... | s.checkAlert(a)
s.LastCheck = utcNow() |
<|file_name|>defaultShouldError.spec.js<|end_file_name|><|fim▁begin|>import plain from '../structure/plain'
import immutable from '../structure/immutable'
import defaultShouldError from '../defaultShouldError'
describe('defaultShouldError', () => {
it('should validate when initialRender is true', () => {
expect(... | foo: 'fooInitial'
}), |
<|file_name|>types.go<|end_file_name|><|fim▁begin|>package aspect
// Type is the interface that all sql Types must implement
type Type interface {
Creatable
IsPrimaryKey() bool
IsRequired() bool<|fim▁hole|><|fim▁end|> | IsUnique() bool
Validate(interface{}) (interface{}, error)
} |
<|file_name|>sequence_roi_gt_propagation.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
# --------------------------------------------------------
# Test regression propagation on ImageNet VID video
# Modified by Kai KANG (myfavouritekk@gmail.com)
# --------------------------------------------------------
"""T... | help='Ground truth annotation file. [None]')
parser.add_argument('save_file', help='Save zip file')
parser.add_argument('--job', dest='job_id', help='Job slot, GPU ID + 1. [1]', |
<|file_name|>helpers.go<|end_file_name|><|fim▁begin|>package main
import (
"encoding/json"
"net/http"
yaml "gopkg.in/yaml.v2"
)
// Respond reads the 'f' url parameter ('f' stands for 'format'), formats the given data
// accordingly and sets the required content-type header. Default format is json.
func Respond(re... | out, err = yaml.Marshal(data)
errMesg = []byte("--- error: failed while rendering data to yaml")
} else { |
<|file_name|>github_file.rs<|end_file_name|><|fim▁begin|>/*
* Swaggy Jenkins
*
* Jenkins API clients generated from Swagger / Open API specification
*
* The version of the OpenAPI document: 1.1.2-pre.0
* Contact: blah@cliffano.com
* Generated by: https://openapi-generator.tech
*/
#[derive(Clone, Debug, Part... | content: None,
_class: None,
}
} |
<|file_name|>Prob3.py<|end_file_name|><|fim▁begin|># Declaring a Function
def recurPowerNew(base, exp):
# Base case is when exp = 0
if exp <= 0:
return 1<|fim▁hole|> # Recursive Call
elif exp % 2 == 0:
return recurPowerNew(base*base, exp/2)
return base * recurPowerNew(base, exp - 1)... | |
<|file_name|>antagonist.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
# Copyright 2015 gRPC authors.<|fim▁hole|>#
# 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.apac... | |
<|file_name|>tests.py<|end_file_name|><|fim▁begin|>import json
import mock
from django.test import TestCase
from django.core.urlresolvers import reverse
class TestAPI(TestCase):
@mock.patch('ldap.initialize')
def test_exists(self, mocked_initialize):
connection = mock.MagicMock()
mocked_ini... |
connection.search_s.side_effect = search_s
response = self.client.get(url, {'mail': 'not@head.of.com', |
<|file_name|>comment.ts<|end_file_name|><|fim▁begin|>/**
* This is a module doc comment with legacy behavior.
*/
/** dummy comment */
import "./comment2";
/**
* A Comment for a class
*
* ## Some Markup
* **with more markup**
*
* An example with decorators that should not parse to tag
* ```
* @myDecorator
* ... | */
hidden(...args: any[]): void {} |
<|file_name|>disk.py<|end_file_name|><|fim▁begin|>#/usr/bin/python
"""
Copyright 2014 The Trustees of Princeton University
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:/... | import sys
import time
import syndicate.ag.curation.specfile as AG_specfile |
<|file_name|>ossource.cpp<|end_file_name|><|fim▁begin|>//
//Copyright (C) 2002-2005 3Dlabs Inc. Ltd.
//All rights reserved.
//
//Redistribution and use in source and binary forms, with or without
//modification, are permitted provided that the following conditions
//are met:
//
// Redistributions of source code mus... | // Thread Local Storage Operations
//
OS_TLSIndex OS_AllocTLSIndex()
{ |
<|file_name|>CWantedSA.cpp<|end_file_name|><|fim▁begin|>/*****************************************************************************
*
* PROJECT: Multi Theft Auto v1.0
* LICENSE: See LICENSE in the top level directory
* FILE: game_sa/CWantedSA.cpp
* PURPOSE: Wanted level management
* DEVELOPER... | push dwWantedLevel
call dwFunc
add esp, 4 |
<|file_name|>feeds.py<|end_file_name|><|fim▁begin|>from __future__ import unicode_literals
from django.contrib.syndication.views import Feed
from django.shortcuts import get_object_or_404
from .models import Category
class CategoryFeed(Feed):
def get_object(self, request, slug):
return get_object_or_40... | def item_categories(self, item):
return item.tags.all()
def item_author_name(self, item): |
<|file_name|>CCNVoice.java<|end_file_name|><|fim▁begin|>/*
* This library is free software; you can redistribute it and/or modify it
* under the terms of the GNU Lesser General Public License version 2.1
* as published by the Free Software Foundation.
* This library is distributed in the hope that it will be useful... | } catch (IOException e) { |
<|file_name|>SectionedBaseAdapter.java<|end_file_name|><|fim▁begin|>package com.ybook.app.pinnedheaderlistview;
import android.util.SparseArray;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import com.ybook.app.pinnedheaderlistview.PinnedHeaderListView.PinnedSectionedHead... | // first try to retrieve values from cache
Integer cachedPosition = mSectionPositionCache.get(position); |
<|file_name|>resource.js<|end_file_name|><|fim▁begin|>'use strict';
var _ = require('lodash');
var helpers = require('./helpers');
var responseParser = require('./responseparser');
var request = require('./request');
// A resource on the API, instances of this are used as the prototype of
// instances of each API res... | invokeAction.prefix = prefix;
this[fnName] = invokeAction;
};
|
<|file_name|>EntityManagerJPA.java<|end_file_name|><|fim▁begin|>/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package io.github.jass2125.locadora.jpa;
import javax.persistence.Ent... | } |
<|file_name|>useless_asref.rs<|end_file_name|><|fim▁begin|>// run-rustfix
#![deny(clippy::useless_asref)]
use std::fmt::Debug;
struct FakeAsRef;
#[allow(clippy::should_implement_trait)]
impl FakeAsRef {
fn as_ref(&self) -> &Self {
self
}
}
<|fim▁hole|>
impl<'a, 'b, 'c> AsRef<&'a &'b &'c MoreRef> for... | struct MoreRef; |
<|file_name|>date.js<|end_file_name|><|fim▁begin|>/*global describe, it */
define(
["underscore", "jquery", "utils/date"],
function (_, $, date) {
describe("date", function () {
describe("formatYearAsTimestamp", function () {
it("should pad the year so it is 4 digits when the year is < 100AD", ... | date.formatYearAsTimestamp(999, "").should.equal("0999");
}); |
<|file_name|>BlockManager.ts<|end_file_name|><|fim▁begin|>module Oddkyn
{
export module Engine
{
export class BlockManager
{
private _state: State.BaseState;
private _blocks: {[part: string]: {[id: string]: Engine.Block}};
constructor(state: State.BaseState)
{
this._state = state;
}
... | let w: number = this._state.game.width;
let x: number = 0;
let y: number = 0;
|
<|file_name|>toolbar.js<|end_file_name|><|fim▁begin|>//
//{block name="backend/create_backend_order/view/toolbar"}
//
Ext.define('Shopware.apps.SwagBackendOrder.view.main.Toolbar', {
extend: 'Ext.toolbar.Toolbar',
alternateClassName: 'SwagBackendOrder.view.main.Toolbar',
alias: 'widget.createbackendorder... | me.changeCurrencyComboBox.select(me.currencyStore.first());
me.currencyStore.first().set('selected', 1); |
<|file_name|>test-test.js<|end_file_name|><|fim▁begin|>'use strict';
var assert = require('../../helpers/assert');
var commandOptions = require('../../factories/command-options');
var stub = require('../../helpers/stub').stub;
var Promise = require('../../../lib/ext/promise');
var Task ... | it('passes through custom configFile option', function() {
return new TestCommand(options).validateAndRun(['--config-file=some-random/path.json']).then(function() {
var testOptions = testRun.calledWith[0][0]; |
<|file_name|>legal-routing.module.ts<|end_file_name|><|fim▁begin|>import { NgModule } from '@angular/core';
import { Routes, RouterModule } from '@angular/router';<|fim▁hole|>
import { LegalComponent } from './legal.component';
const routes: Routes = [
{
path: '',
component: LegalComponent
}
];
@NgModule(... | |
<|file_name|>test_rdf_header.py<|end_file_name|><|fim▁begin|>"""
test_rdf_header.py -- show the rdf_header
<|fim▁hole|>"""
__author__ = "Michael Conlon"
__copyright__ = "Copyright 2013, University of Florida"
__license__ = "BSD 3-Clause license"
__version__ = "0.1"
import vivotools as vt
from datet... | Version 0.1 MC 2013-12-27
-- Initial version. |
<|file_name|>traversal.rs<|end_file_name|><|fim▁begin|>/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
//! Traversing the DOM tree; the bloom filter.
use animati... | AFFECTED_BY_NON_COMMON_STYLE_AFFECTING_ATTRIBUTE_SELECTOR | |
<|file_name|>word-search.spec.js<|end_file_name|><|fim▁begin|>import WordSearch from './word-search';
describe('single line grids', () => {
test('Should accept an initial game grid', () => {
const grid = ['jefblpepre'];
const wordSearch = new WordSearch(grid);
expect(wordSearch instanceof WordSearch).to... | start: [5, 9],
end: [2, 9], |
<|file_name|>test_enumeration.py<|end_file_name|><|fim▁begin|>from django.test import TestCase, tag
from member.tests.test_mixins import MemberMixin
from django.contrib.auth.models import User
from django.test.client import RequestFactory
from django.urls.base import reverse
from enumeration.views import DashboardVi... | request = self.factory.get(url)
request.user = self.user |
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|><|fim▁hole|><|fim▁end|> | """News Tests""" |
<|file_name|>JavaPing.java<|end_file_name|><|fim▁begin|>/*
* Created on Apr 28, 2005
*/
package jsrl.net;
import java.net.SocketException;
import java.net.SocketTimeoutException;
import java.net.InetAddress;
import java.net.UnknownHostException;<|fim▁hole|>
/**
* JavaPing
* Java Bindings for the SRL Library's Ping... |
import jsrl.LoadLibrary; |
<|file_name|>package-info.java<|end_file_name|><|fim▁begin|>/*
* Sonatype Nexus (TM) Open Source Version
* Copyright (c) 2008-present Sonatype, Inc.
* All rights reserved. Includes the third-party code listed at http://links.sonatype.com/products/nexus/oss/attributions.
*
* This program and the accompanying materi... | @FeatureFlag(name = ORIENT_ENABLED) |
<|file_name|>core.py<|end_file_name|><|fim▁begin|>from abc import ABCMeta, abstractmethod, abstractproperty
from contextlib import contextmanager
from functools import wraps
import gzip
from inspect import getargspec
from itertools import (
combinations,
count,
product,
)
import operator
import os
from os.p... |
def assert_timestamp_equal(left, right, compare_nat_equal=True, msg=""): |
<|file_name|>npc.py<|end_file_name|><|fim▁begin|># This file is part of PARPG.
# PARPG 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 Foundation, either version 3 of the License, or
# (at your option) any late... | def onInstanceActionFinished(self, instance, action):
"""What the NPC does when it has finished an action.
Called by the engine and required for InstanceActionListeners.
@type instance: fife.Instance |
<|file_name|>lib.rs<|end_file_name|><|fim▁begin|>#![crate_type = "dylib"]
#[macro_export]
macro_rules! world {
($space:ident ($param:ty), $($name:ident : $component:ty,)*) => {
/// A collection of pointers to components
#[derive(Clone, Debug, Eq, PartialEq)]
pub struct Entity {
... | systems: Vec::new(),
}
} |
<|file_name|>callback.py<|end_file_name|><|fim▁begin|>#! /usr/bin/python3
"""Callback a callable asset."""
import struct
import decimal
D = decimal.Decimal
from . import (util, config, exceptions, litecoin, util)
from . import order
FORMAT = '>dQ'
LENGTH = 8 + 8
ID = 21
def validate (db, source, fraction, asset, ... | problems.append('not asset owner')
return None, None, None, problems
|
<|file_name|>helpers.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
import sys
import time
def make(session):
session.execute("make (%(rnd_name.0)s)")
a_guid = session.message()[1][-1]
assert(session.message() is None)
return(a_guid)
def link(session, a, l, b):
session.execute("make %s -... | |
<|file_name|>import_openstack_dns_zone_v2_test.go<|end_file_name|><|fim▁begin|>package openstack
import (
"fmt"
"testing"
"github.com/hashicorp/terraform/helper/acctest"
"github.com/hashicorp/terraform/helper/resource"
)
func TestAccDNSV2Zone_importBasic(t *testing.T) {
var zoneName = fmt.Sprintf("ACPTTEST%s.co... | ImportStateVerify: true, |
<|file_name|>GoogleCloudStorageLocation.java<|end_file_name|><|fim▁begin|>/**
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for
* license information.
*
* Code generated by Microsoft (R) AutoRest Code Generator.
*/
package com.mi... | * @return the bucketName value
*/
public Object bucketName() { |
<|file_name|>clientauth_test.go<|end_file_name|><|fim▁begin|>/*
Copyright 2014 The Kubernetes 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
http://www.apache.org/... | loadAuthInfoTests := []struct {
authData string
authInfo *clientauth.Info
expectErr bool |
<|file_name|>EjpSecurityConfigImpl.ts<|end_file_name|><|fim▁begin|>// DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
//
// Copyright 2016-2018 Pascal ECHEMANN.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// ... | //
// http://www.apache.org/licenses/LICENSE-2.0 |
<|file_name|>correspondence.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
##############################################################################
#
# Copyright (C) 2019 Compassion CH (http://www.compassion.ch)
# Releasing children from poverty in Jesus' name
# @author: Samy Bucher <samy.bucher... | from odoo import fields
|
<|file_name|>list_comprehension.py<|end_file_name|><|fim▁begin|># Fluent Python Book
# List comprehensions are faster than for-loops
import time
from random import choices
symbols = list('abcdefghijklmn')
print(symbols)
symbols_big = choices(symbols, k=2000000)
# print(symbols_big)
start = time.time()
ord_list1 = [... | print('for loop ran in %f s' % (end - start))
start = time.time() |
<|file_name|>index.js<|end_file_name|><|fim▁begin|>define([<|fim▁hole|>], function(Vertebrae) {
return Vertebrae;
});<|fim▁end|> | './src/vertebrae' |
<|file_name|>views.py<|end_file_name|><|fim▁begin|>from django.shortcuts import render
from django.http import HttpResponse
from django.utils import simplejson as json
import ner
def index(request):
params = {'current': 'home'}<|fim▁hole|>def name_entity_recognition(request):
if request.method == 'GET':
... | return render(request, 'index.html', params)
|
<|file_name|>dtos.py<|end_file_name|><|fim▁begin|># ##############################################################################
#
# OSIS stands for Open Student Information System. It's an application
# designed to manage the core business of higher education institutions,
# such as universities, faculties,... | |
<|file_name|>findall.py<|end_file_name|><|fim▁begin|>"""Findall regex operations in python.
findall(string[, pos[, endpos]])
Returns a list:
not like search and match which returns objects
Otherwise, it returns an empty list.
"""
import re
# look for every word in a string
pattern = re.compile(r"\w+")
result = patte... | patt = re.compile(r"a*b") |
<|file_name|>IllegalPhoneNumberException.java<|end_file_name|><|fim▁begin|>/**
* Exception class for illegal phone number format strings.
* @author Jonathan Hinkle
*/
package net.sf.memoranda;
/**
* This class is thrown when a string is not a valid phone number format.
*
* @author Jonathan Hinkle
*
*/
@Suppr... | public IllegalPhoneNumberException() {}
/** |
<|file_name|>FBrowserBase.py<|end_file_name|><|fim▁begin|>#
# FBrowserBase.py -- Base class for file browser plugin for fits viewer
#
# Eric Jeschke (eric@naoj.org)
#
# Copyright (c) Eric R. Jeschke. All rights reserved.
# This is open-source software licensed under a BSD license.
# Please see the file LICENSE.txt f... | ('Mode', 'st_mode'),
('Last Changed', 'st_mtime')
]
|
<|file_name|>bestaplayer.py<|end_file_name|><|fim▁begin|>__author__ = 'besta'
class BestaPlayer:
def __init__(self, fichier, player):
self.fichier = fichier
self.grille = self.getFirstGrid()
self.best_hit = 0
self.players = player
def getFirstGrid(self):
"""
I... | |
<|file_name|>CAvmCommon.py<|end_file_name|><|fim▁begin|>from PyCA.Core import *
import PyCA.Common as common
import numpy as np
import matplotlib.pyplot as plt
def SplatSafe(outMass, g, mass):
mType = mass.memType()
if mType == MEM_DEVICE:
minmaxl = MinMax(mass)
maxval = max([abs(x) for ... | # end for
|
<|file_name|>bind-by-move-neither-can-live-while-the-other-survives-3.rs<|end_file_name|><|fim▁begin|>// Copyright 2012 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 <L... |
impl Drop for X { |
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|>import os
from fabric.decorators import task
from fabric.api import local, run, cd, env, prefix, hide
from fabric.colors import cyan, red, green, yellow
import app
import git
import virtualenv
<|fim▁hole|> """Execute init tasks for all components (virtualenv, pip... |
@task
def init(): |
<|file_name|>pluginFitSigmoidal.py<|end_file_name|><|fim▁begin|>#--------------------------------------------------
# Revision = $Rev: 20 $
# Date = $Date: 2011-08-05 20:42:24 +0200 (Fri, 05 Aug 2011) $
# Author = $Author: stefan $
#--------------------------------------------------
from pluginInterfaces import Plu... |
def getParameters(self):
"""return the fit parameters"""
return np.array(["a","xc","dx","y0"]) |
<|file_name|>test_timeout2.js<|end_file_name|><|fim▁begin|>var http = require("http");
var querystring = require("querystring"); // 核心模块
var SBuffer=require("../tools/SBuffer");
var common=require("../tools/common");
var zlib=require("zlib");
var redis_pool=require("../tools/connection_pool");
var events = require('e... | var devicemodel = headers['devicemodel'] || '0';// 客户端型号
var manufacturername = headers['manufacturername'] || '0';// 制造厂商
var actionlocation = headers['actionlocation']; // 请求后台地址
var dpi = headers['dpi'] || '2.0';// 密度 |
<|file_name|>bad-lit-suffixes.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.or... | b""suffix; //~ ERROR binary str literal with a suffix is invalid
r#""#suffix; //~ ERROR str literal with a suffix is invalid |
<|file_name|>app.js<|end_file_name|><|fim▁begin|>(function() {
'use strict';
var express = require('express');
var path = require('path');
var logger = require('morgan');
var cookieParser = require('cookie-parser');
var bodyParser = require('body-parser');
var routes = require('./routes/index');
var app... | app.use('/', routes);
app.set('port', process.env.PORT || 3000);
var server = app.listen(app.get('port'), function() { |
<|file_name|>example2.rs<|end_file_name|><|fim▁begin|>// pp-exact:example2.pp<|fim▁hole|><|fim▁end|> |
fn main() { } |
<|file_name|>opencv_utils.hh<|end_file_name|><|fim▁begin|>#ifndef VPP_OPENCV_UTILS_HH_
# define VPP_OPENCV_UTILS_HH_
# include <iostream>
# include <regex>
# include <opencv2/highgui/highgui.hpp>
# include <vpp/core/boxNd.hh>
# include <vpp/core/image2d.hh>
inline bool open_videocapture(const char* str, cv::VideoCapt... | open_videocapture(f, cap); |
<|file_name|>gaussian.py<|end_file_name|><|fim▁begin|># -*- coding: utf8 -*-
import math
from pycraft.common.util import ndarray, product
class GaussianKernel:
__slots__ = ['_size', '_kernel']
def __init__(self, size):
self._size = size
self._kernel = ndarray(2*size + 1, 2*size + 1)
... | self._kernel[dx+size][dz+size] = \
bell_height * math.exp(-(bx**2 + bz**2) / 2)
|
<|file_name|>luci_auth.py<|end_file_name|><|fim▁begin|># Copyright 2018 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import re
import subprocess
import sys
import six
_RE_INFO_USER_EMAIL = r'Logged in as (?P<email>\S+... | return six.ensure_str( |
<|file_name|>MainActivity.java<|end_file_name|><|fim▁begin|>package com.mortensickel.measemulator;
// http://maps.google.com/maps?q=loc:59.948509,10.602627
import com.google.android.gms.common.api.*;
import android.content.Context;
import android.text.*;
import android.app.Activity;
import android.os.Bundle;
import and... | TextWatcher activityTW = new TextWatcher() {
@Override
public void onTextChanged(CharSequence s, int start, int before, int count) {
// TODO Auto-generated method stub |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.