prompt large_stringlengths 70 991k | completion large_stringlengths 0 1.02k |
|---|---|
<|file_name|>CMapper.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
dCellSize = 20
WindowWidth = 400
WindowHeight = 400
class SCell(object):<|fim▁hole|> self._top = ymin
self.bottom = ymax
def Update(self):
self._iTicksSpentHere += 1
def Reset(self):
self._iTicksSpentHere = ... | def __init__(self, xmin, xmax, ymin, ymax):
self._iTicksSpentHere = 0
self._left = xmin
self._right = xmax |
<|file_name|>test_assembly.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
#
# 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
#
# Unle... | mock_registry.AssemblyList.get_all.return_value = {}
handler = assembly_handler.AssemblyHandler(self.ctx)
res = handler.get_all() |
<|file_name|>error.js<|end_file_name|><|fim▁begin|>/* Copyright 2014 Open Ag Data Alliance
*
* 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... | |
<|file_name|>favoritesview.py<|end_file_name|><|fim▁begin|># Copyright (C) 2006-2007 Red Hat, Inc.
# Copyright (C) 2008 One Laptop Per Child
# Copyright (C) 2008-2013 Sugar Labs
# Copyright (C) 2013 Daniel Francis
# Copyright (C) 2013 Walter Bender
#
# This program is free software: you can redistribute it and/or modif... | self._press_start_y = None
self._hot_x = None
self._hot_y = None |
<|file_name|>param_utils.py<|end_file_name|><|fim▁begin|># Licensed to the StackStorm, Inc ('StackStorm') 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 L... | action_parameter_info,
liveaction_parameters)
runner_params, action_params = get_rendered_params(runner_params, action_params,
action_context, |
<|file_name|>apps.py<|end_file_name|><|fim▁begin|>__title__ = 'fobi.contrib.plugins.form_elements.fields.select_multiple.apps'
__author__ = 'Artur Barseghyan <artur.barseghyan@gmail.com>'
__copyright__ = '2014-2017 Artur Barseghyan'
__license__ = 'GPL 2.0/LGPL 2.1'
__all__ = ('Config',)
<|fim▁hole|> from django.apps... | try: |
<|file_name|>math.py<|end_file_name|><|fim▁begin|># Copyright 2014 Google Inc. 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/licenses/LIC... | |
<|file_name|>issue-13872-1.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.
//<|fim▁hole|>// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.a... | |
<|file_name|>hr.py<|end_file_name|><|fim▁begin|>#-*- coding:utf-8 -*-
#
#
# Copyright (C) 2013 Michael Telahun Makonnen <mmakonnen@gmail.com>.
# All Rights Reserved.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as publ... | |
<|file_name|>StatsAccumulator.py<|end_file_name|><|fim▁begin|>#
# Copyright 2008-2015 Semantic Discovery, Inc.
#
# 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.apa... | |
<|file_name|>Installation.java<|end_file_name|><|fim▁begin|>package com.wabbit.libraries;
import android.content.Context;
import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.RandomAccessFile;
import java.util.UUID;
public class Installation {
private static String sID... |
private static String readInstallationFile(File installation) throws IOException {
RandomAccessFile f = new RandomAccessFile(installation, "r");
byte[] bytes = new byte[(int) f.length()]; |
<|file_name|>CastResolver.java<|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 appli... | |
<|file_name|>TestTemplates.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
"""Test template support in VTK-Python
VTK-python decides which template specializations
to wrap according to which ones are used in typedefs
and which ones appear as superclasses of other classes.
In addition, the wrappers are hard... | |
<|file_name|>declaration_block.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/. */
//! A property declaration block.
#![deny(missing_... | if !definitely_new {
let mut index_to_remove = None;
for (i, slot) in self.declarations.iter_mut().enumerate() { |
<|file_name|>defines_3.js<|end_file_name|><|fim▁begin|>var searchData=
[<|fim▁hole|>];<|fim▁end|> | ['get_5fmodel_5fhandle',['GET_MODEL_HANDLE',['../serializer_8h.html#a887590f4b40f78bf359c8e56f03c56fe',1,'serializer.h']]] |
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|>#from .engine import CheckVersion, CreateVersion<|fim▁hole|><|fim▁end|> | from .versioner import DBVersioner, DBVersionCommander |
<|file_name|>Model.java<|end_file_name|><|fim▁begin|>package com.github.pineasaurusrex.inference_engine;
<|fim▁hole|>
/**
* Partially or fully assigned model
* A model represents a possible representation of the propositional symbol states in the KB
*/
public class Model {
private HashMap<PropositionalSymbol, Bo... | import java.util.HashMap; |
<|file_name|>textwidget.py<|end_file_name|><|fim▁begin|>from roam.api import RoamEvents
from PyQt4.QtGui import QLineEdit, QPlainTextEdit
from PyQt4.QtCore import QEvent
from roam.editorwidgets.core import EditorWidget, registerwidgets
class TextWidget(EditorWidget):
widgettype = 'Text'
def __init__(self, *... | |
<|file_name|>server.go<|end_file_name|><|fim▁begin|>package main
import (
"log"
"net/http"
"github.com/gophergala/melted_brains/http_handler"
"golang.org/x/net/websocket"
)
func main() {
http.HandleFunc("/game/", http_handler.GameHandler)
http.Handle("/events/", websocket.Handler(http_handler.EventsHandler))
... | } |
<|file_name|>h2o_data.py<|end_file_name|><|fim▁begin|>from ..daltools.util.full import init
Z = [8., 1., 1.]
Rc = init([0.00000000, 0.00000000, 0.48860959])
Dtot = [0, 0, -0.76539388]
Daa = init([
[ 0.00000000, 0.00000000, -0.28357300],
[ 0.15342658, 0.00000000, 0.12734703],
[-0.15342658, 0.00000000, 0... | |
<|file_name|>repos.rs<|end_file_name|><|fim▁begin|>use std::env;
use futures::{Future, Stream};
use tokio::runtime::Runtime;
use hubcaps::{Credentials, Github, Result};
fn main() -> Result<()> {<|fim▁hole|> match env::var("GITHUB_TOKEN").ok() {
Some(token) => {
let mut rt = Runtime::new()?;
... | pretty_env_logger::init(); |
<|file_name|>csvsql.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
# -*- coding:utf-8 -*-
import os
import sys
from csvkit import sql
from csvkit import table
from csvkit import CSVKitWriter
from csvkit.cli import CSVKitUtility
class CSVSQL(CSVKitUtility):
description = 'Generate SQL statements for one or... | headers = csv_table.headers()
conn.execute(insert, [dict(zip(headers, row)) for row in csv_table.to_rows()])
|
<|file_name|>module_disk_select_test.py<|end_file_name|><|fim▁begin|>#
# Copyright (C) 2019 Red Hat, Inc.
#
# This copyrighted material is made available to anyone wishing to use,
# modify, copy, or redistribute it subject to the terms and conditions of
# the GNU General Public License v.2, or (at your option) any lat... | #
import unittest
from blivet.devices import DiskDevice |
<|file_name|>manage.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python<|fim▁hole|>import sys
if __name__ == "__main__":
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "asteria.settings")
from django.core.management import execute_from_command_line
execute_from_command_line(sys.argv)<|fim▁end|> | import os |
<|file_name|>brisketServerSpec.js<|end_file_name|><|fim▁begin|>"use strict";
describe("Brisket server", function() {
var Brisket = require("../../lib/brisket");
var MockBrisketApp = require("../mock/MockBrisketApp");
var nock = require("nock");
var supertest = require("supertest");
var brisketServ... | }); |
<|file_name|>soupparser.py<|end_file_name|><|fim▁begin|>__doc__ = """External interface to the BeautifulSoup HTML parser.
"""
__all__ = ["fromstring", "parse", "convert_tree"]
from lxml import etree, html
from calibre.ebooks.BeautifulSoup import \
BeautifulSoup, Tag, Comment, ProcessingInstruction, NavigableStri... | if makeelement is None:
makeelement = html.html_parser.makeelement |
<|file_name|>tmpl_data_user.go<|end_file_name|><|fim▁begin|>// Copyright 2014 The goyy Authors. All rights reserved.
// Use of this source code is governed by a MIT-style
// license that can be found in the LICENSE file.
package main
var tmplDataUser = `
<|fim▁hole|>insert into {{case "SYS_USER (ID, NAME, CODE... | |
<|file_name|>mod.rs<|end_file_name|><|fim▁begin|>// The middleware module is for defining middleware you need in your server.<|fim▁hole|><|fim▁end|> | //
// Middleware let you wrap your endpoint in arbitrary code that can manipulate
// an HTTP service. A middleware must implement the `Middleware` trait. |
<|file_name|>tests.py<|end_file_name|><|fim▁begin|>#encoding: utf-8
from flask.ext.restful import Resource, reqparse
class Test(Resource):
def __init__(self):
self.parser = reqparse.RequestParser()
self.parser.add_argument('id', type=int)
super(AccountAPI, self).__init__()
def get(s... | |
<|file_name|>display.py<|end_file_name|><|fim▁begin|><|fim▁hole|>from pylab import *
data = loadtxt('Data/dummy_data.dat')
posterior_sample = atleast_2d(loadtxt('posterior_sample.txt'))
ion()
for i in xrange(0, posterior_sample.shape[0]):
hold(False)
plot(data[:,0], data[:,1], 'bo')
hold(True)
plot(data[:,0],... | |
<|file_name|>latency.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
# this program is used to test latency
# don't test RTT bigger than 3 secs - it will break
# we make sure that nothing breaks if there is a packet missing
# this can rarely happen
import select
import socket
import time
import sys
import struc... | elif 'pong' in sys.argv:
ret = pong() |
<|file_name|>sched.rs<|end_file_name|><|fim▁begin|>// Copyright 2013 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/licenses/... | let last_task = Cell::new(last_task);
do Local::borrow::<Scheduler> |sched| {
sched.enqueue_task(last_task.take()); |
<|file_name|>views.py<|end_file_name|><|fim▁begin|># Copyright 2012 Twitter
#
# 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 requir... | |
<|file_name|>main.rs<|end_file_name|><|fim▁begin|>// https://rust-lang-ja.github.io/the-rust-programming-language-ja/1.6/book/closures.html
#![allow(dead_code, unused_variables)]
fn main() {
////////////////////////////////////////////////////////////////////////////////
// Closures
//////////////////////... | //assert_eq!(3, answer);
////////////////////////////////////////////////////////////////////////////////
// Function pointers ans closures |
<|file_name|>data_forwarding.py<|end_file_name|><|fim▁begin|>from __future__ import absolute_import
from sentry import tsdb, ratelimits
from sentry.api.serializers import serialize
from sentry.plugins.base import Plugin
from sentry.plugins.base.configuration import react_plugin_config<|fim▁hole|>class DataForwardingPl... | from sentry.plugins.status import PluginStatus
|
<|file_name|>main.rs<|end_file_name|><|fim▁begin|>mod graph;
mod index_type;
use std::io::{BufReader, BufRead};
use std::fs::File;
use std::str::FromStr;
use std::fmt::Debug;
use std::result::Result;
use graph::{MDGraph, WeightType, Unweighted};
use index_type::{IndexType, NodeIndex, EdgeIndex, DefIndex};
fn read_sgf... |
fn main() {
let f = File::open("er_100_0_1.sgf").unwrap();
let mut f = BufReader::new(f); |
<|file_name|>Keyboard.js<|end_file_name|><|fim▁begin|>/**
* Copyright 2019 Google LLC
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* version 3 as published by the Free Software Foundation.
*
* This program is distributed in the ho... | WebMidi.enable((e) => { |
<|file_name|>ExtraSuccessHandler.hpp<|end_file_name|><|fim▁begin|>#ifndef SOBER_NETWORK_HTTP_EXTRA_SUCCESS_HANDLER_HPP_
#define SOBER_NETWORK_HTTP_EXTRA_SUCCESS_HANDLER_HPP_
// Copyright (c) 2014, Ruslan Baratov
// All rights reserved.
#include <functional> // std::function
namespace sober {<|fim▁hole|>namespace htt... | namespace network { |
<|file_name|>Test.java<|end_file_name|><|fim▁begin|>class Test {
public static int[] test() {<|fim▁hole|> System.out.println(arr);
}<|fim▁end|> | return null;
}
public static void main(String[] args) {
int [] arr = test(); |
<|file_name|>HeatmapsTile.tsx<|end_file_name|><|fim▁begin|>import React from 'react';
import Heatmap, { HeatmapProps, background } from '../../sandboxes/visx-heatmap/Example';
import GalleryTile from '../GalleryTile';
export { default as packageJson } from '../../sandboxes/visx-heatmap/package.json';
const tileStyles... | tileStyles={tileStyles} |
<|file_name|>dnsdist-rings.cc<|end_file_name|><|fim▁begin|>#include "dnsdist.hh"
#include "lock.hh"
unsigned int Rings::numDistinctRequestors()
{
std::set<ComboAddress, ComboAddress::addressOnlyLessThan> s;
WriteLock wl(&queryLock);
for(const auto& q : queryRing)
s.insert(q.requestor);
return s.size();
}
... | numentries = ret.size() < numentries ? ret.size() : numentries;
partial_sort(ret.begin(), ret.begin()+numentries, ret.end(), [](const ret_t::value_type&a, const ret_t::value_type&b)
{ |
<|file_name|>InteriorPointArea.js<|end_file_name|><|fim▁begin|>/* Copyright (c) 2011 by The Authors.
* Published under the LGPL 2.1 license.
* See /license-notice.txt for the full text of the license notice.
* See /license.txt for the full text of the license.
*/
describe('jsts.algorithm.InteriorPointArea', functi... | |
<|file_name|>BeforeRecover.ts<|end_file_name|><|fim▁begin|>import {getMetadataArgsStorage} from "../../globals";
import {EventListenerTypes} from "../../metadata/types/EventListenerTypes";
import {EntityListenerMetadataArgs} from "../../metadata-args/EntityListenerMetadataArgs";
<|fim▁hole|> return function (object:... | /**
* Calls a method on which this decorator is applied before this entity soft removal.
*/
export function BeforeRecover(): PropertyDecorator { |
<|file_name|>NewForm.js<|end_file_name|><|fim▁begin|>export class NewForm {
<|fim▁hole|> update() {
}
}<|fim▁end|> | |
<|file_name|>broker.py<|end_file_name|><|fim▁begin|>"""Defines the base broker class"""
from abc import ABCMeta
from collections import namedtuple
"""
FileDownload tuple contains an additional partial flag for defining whether the file
is allowed to be accessed directly or must be copied into running container. This i... | |
<|file_name|>test_transactions.py<|end_file_name|><|fim▁begin|># Copyright 2018-present MongoDB, Inc.
#
# 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/LICENS... | |
<|file_name|>user.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
"""
Copyright 2010 cloudControl UG (haftungsbeschraenkt)
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|>rtf.py<|end_file_name|><|fim▁begin|>__license__ = 'GPL v3'
__copyright__ = '2008, Kovid Goyal <kovid at kovidgoyal.net>'
"""
Edit metadata in RTF files.
"""
import re, cStringIO, codecs
from calibre import force_unicode
from calibre.ebooks.metadata import MetaInformation, string_to_authors
title_pat ... | |
<|file_name|>state.rs<|end_file_name|><|fim▁begin|>use Handle;
use gl;
use std::default::Default;
/// Represents the current OpenGL state.
///
/// The current state is passed to each function and can be freely updated.
pub struct GLState {
/// Whether GL_BLEND is enabled
pub enabled_blend: bool,
/// Whet... | /// The latest value passed to `glPixelStore` with `GL_UNPACK_ALIGNMENT`.
pub pixel_store_unpack_alignment: gl::types::GLint, |
<|file_name|>block3rdPartyContent.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/. */
function blockReferer () {
if (document.referr... | |
<|file_name|>element.cpp<|end_file_name|><|fim▁begin|>/* -*- mode: C++; c-basic-offset: 2; indent-tabs-mode: nil -*- */
/*
* Main authors:
* Christian Schulte <schulte@gecode.org>
*
* Copyright:
* Christian Schulte, 2004
*
* Last modified:
* $Date: 2010-03-04 03:40:32 +1100 (Thu, 04 Mar 2010) $ b... | |
<|file_name|>place-caret-at-end-spec.js<|end_file_name|><|fim▁begin|>/*global document, describe, it, expect, require, window, afterEach */
const jQuery = require('jquery');
require('../../src/browser/place-caret-at-end');
describe('placeCaretAtEnd', () => {
'use strict';
let underTest;
afterEach(() => {
underTe... | |
<|file_name|>CountNegativesMatrix.go<|end_file_name|><|fim▁begin|>/*
Given a m * n matrix grid which is sorted in non-increasing order both row-wise and column-wise.
Return the number of negative numbers in grid.
Example 1:
Input: grid = [[4,3,2,-1],[3,2,1,-1],[1,1,-1,-2],[-1,-1,-2,-3]]
Output: 8
Explanation: Ther... | import (
"log"
)
|
<|file_name|>session.rs<|end_file_name|><|fim▁begin|>use alloc::boxed::Box;<|fim▁hole|>use collections::string::{String, ToString};
use collections::vec::Vec;
use scheduler;
use schemes::KScheme;
use schemes::{Resource, Url, VecResource};
/// A session
pub struct Session {
/// The scheme items
pub items: Vec... | |
<|file_name|>de-ch.js<|end_file_name|><|fim▁begin|>/*
Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.
For licensing, see LICENSE.md or http://ckeditor.com/license
*/
CKEDITOR.plugins.setLang( 'div', 'de-ch', {
IdInputLabel: 'Kennung',
advisoryTitleInputLabel: 'Tooltip',
cssClassInputLabe... | langDirRTLLabel: 'Rechs nach Links (RTL)',
languageCodeInputLabel: 'Sprachcode',
remove: 'Div entfernen',
styleSelectLabel: 'Stil', |
<|file_name|>TreeTraversal.py<|end_file_name|><|fim▁begin|><|fim▁hole|>
class Graph:
def __init__(self, number_of_vertices):
self.number_of_vertices = number_of_vertices
self.vertex_details = {}
self.visited = {}
def add_edge(self, vertex_label, edge):
if self.vertex_details.has_key(vertex_label):
self.... | import Queue |
<|file_name|>collection.js<|end_file_name|><|fim▁begin|>/*
* collection
* A collection of posts
*
* If fetch items are specified, then only gets those posts.
* Otherwise, gets the posts specified from a configuration endpoint.
*/
define([
"lodash",
"backbone",
"helpers/urls",
"helpers/types",
"helpers/p... | // create a union of previous fetch items and the new fetch items
this.options.items = _.union(this.options.items, items);
},
|
<|file_name|>iterables.py<|end_file_name|><|fim▁begin|>"""
Functions and decorators for making sure the parameters they work on are of
iterable types.
Copyright 2014-2015, Outernet Inc.
Some rights reserved.
This software is free software licensed under the terms of GPLv3. See COPYING
file that comes with the source ... | |
<|file_name|>forestFindThr.cpp<|end_file_name|><|fim▁begin|>/*******************************************************************************
* Piotr's Image&Video Toolbox Version 3.01
* Copyright 2012 Piotr Dollar. [pdollar-at-caltech.edu]
* Please email me if you find bugs, or have suggestions or questions!
... | {
int i, j, h; double *L, *R, *T; float *data1; uint32 *order1; |
<|file_name|>lib.rs<|end_file_name|><|fim▁begin|>//! A library for using the Branch by Abstraction pattern to test for performance and correctness.
//!
//! # Examples
//! ```
//! use dexter::*;
//! struct ExamplePublisher;
//!
//! impl Publisher<Vec<char>, String, String> for ExamplePublisher {
//! fn publish(&mut ... | |
<|file_name|>docextract_webinterface.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
##<|fim▁hole|>## Invenio 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 2 of the
## License, or (a... | ## This file is part of Invenio.
## Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010, 2011 CERN.
## |
<|file_name|>Redstone.java<|end_file_name|><|fim▁begin|>package cn.nukkit.redstone;
import cn.nukkit.block.Block;
import cn.nukkit.block.BlockRedstoneWire;
import cn.nukkit.block.BlockSolid;
import cn.nukkit.math.Vector3;
import java.util.*;
/**
* author: Angelic47
* Nukkit Project
*/
public class Redstone {
... | if (!closedMap.containsKey(block.getSide(side).getLocationHash())) {
closedMap.put(block.getSide(side).getLocationHash(), block.getSide(side));
updateQueue.add(new UpdateObject(updateLevel - 1, block.getSide(side)));
} |
<|file_name|>bootstrap.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python3
import predict
import sklearn.metrics
import argparse, sys
import os
import numpy as np
import glob
import re
import matplotlib.pyplot as plt
def calc_auc(predictions):
y_true =[]
y_score=[]
for line in predictions:
values= line.split(... |
plt.figure()
plt.boxplot(all_aucs,0,'rs',0) |
<|file_name|>pointer.go<|end_file_name|><|fim▁begin|>// Copyright 2011 The "GoScript" 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://www.apache.org/licenses/LIC... | /*
## Pointers |
<|file_name|>tests.py<|end_file_name|><|fim▁begin|>import datetime
from django.utils import timezone
from django.test import TestCase
from django.urls import reverse
from .models import Question
class QuestionMethodTests(TestCase):
def test_was_published_recently_with_future_question(self):
"""
... | time = timezone.now() - datetime.timedelta(hours=1)
recent_question = Question(pub_date=time) |
<|file_name|>watch.js<|end_file_name|><|fim▁begin|>module.exports = function(grunt) {<|fim▁hole|> tasks: "js"
},
pluginCss: {
files: ["src/css/flags.scss", "src/css/intlTelInput.scss"],
tasks: "sass:main"
},
demoCss: {
files: "src/css/demo.scss",
tasks: "sass:demo"
}
}... | return {
js: {
files: "src/js/**/*.js", |
<|file_name|>outputbox.js<|end_file_name|><|fim▁begin|>/**
* Created with JetBrains WebStorm.
* User: k-nkgwj
* Date: 13/01/21
* Time: 3:29
* To change this template use File | Settings | File Templates.
*/
var OutputBox = (function () {
function OutputBox(selector) {
this.jqueryObject = $(select... |
OutputBox.prototype.message = function (subject, body) {
|
<|file_name|>wordgame.ts<|end_file_name|><|fim▁begin|><!DOCTYPE TS><TS>
<context>
<name>Board</name>
<message>
<source>Blanks: </source>
<translation>Blanco:</translation>
</message>
<message>
<source>OK</source>
<translation>OK</translation>
</message>
<message>
... | <message>
<source>Edit...</source>
<translation>Wijzig...</translation> |
<|file_name|>settings.rs<|end_file_name|><|fim▁begin|>//! WARNING: This file is generated, derived from table bazaar.settings, DO NOT EDIT
use chrono::datetime::DateTime;
use chrono::offset::utc::UTC;
use gen::column;
use gen::schema;
use gen::table;
use rustc_serialize::json::Json;
use rustc_serialize::json::ToJson;
... | db_data_type: "uuid".to_owned(),
is_primary: false, is_unique: false, not_null: false, is_inherited: true, |
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|>__version__ = '0.1.0'<|fim▁hole|><|fim▁end|> |
from .reports import Report |
<|file_name|>valid-object.js<|end_file_name|><|fim▁begin|>'use strict';
module.exports = function (t, a) {<|fim▁hole|> var x;
a.throws(function () { t(0); }, TypeError, "0");
a.throws(function () { t(false); }, TypeError, "false");
a.throws(function () { t(''); }, TypeError, "''");
a(t(x = {}), x, "Object");
a(t(... | |
<|file_name|>EhCacheServiceFactory.java<|end_file_name|><|fim▁begin|>/**
* Copyright (C) 2013-2016 The Rythm Engine project
* for LICENSE and other details see:
* https://github.com/rythmengine/rythmengine
*/
package org.rythmengine.cache;
/*-
* #%L
* Rythm Template Engine
* %%<|fim▁hole|> * You may obtain a co... | * Copyright (C) 2017 - 2021 OSGL (Open Source General Library)
* %%
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. |
<|file_name|>test_form.py<|end_file_name|><|fim▁begin|><|fim▁hole|>
class BtcPriceTestCase(unittest.TestCase):
def test_checking_of_input_in_form(self):
input = 46
answer = is_not_number(input) # The bitcoin returned changes over time!
self.assertEqual(answer, False)<|fim▁end|> | import unittest
from .Weather_analyzer import is_not_number
|
<|file_name|>TwouyoMildr~ed_Trouillot.js<|end_file_name|><|fim▁begin|>showWord(["np. ","Avoka, politisyen. Madanm prezidan Jean Bertrand Aristide."<|fim▁hole|><|fim▁end|> | ]) |
<|file_name|>moment.module.ts<|end_file_name|><|fim▁begin|>module rl.utilities.services.momentWrapper {
export var moduleName: string = 'rl.utilities.services.momentWrapper';
export var serviceName: string = 'momentWrapper';
export function momentWrapper(): void {
'use strict';
// Using `any` instead of Moment... | };
return momentWrapper; |
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|>"""Support for OVO Energy."""
from __future__ import annotations
from datetime import datetime, timedelta
import logging
import aiohttp
import async_timeout
from ovoenergy import OVODailyUsage
from ovoenergy.ovoenergy import OVOEnergy
from homeassistant.config_en... | DATA_COORDINATOR: coordinator,
} |
<|file_name|>mod.rs<|end_file_name|><|fim▁begin|>pub mod android;
pub mod caca;
pub mod cocoa;
pub mod dlopen;
pub mod egl;
pub mod emscripten;
pub mod glx;
pub mod osmesa;<|fim▁hole|><|fim▁end|> | pub mod wayland;
pub mod wgl;
pub mod win32;
pub mod x11; |
<|file_name|>apps.py<|end_file_name|><|fim▁begin|>from django.apps import AppConfig
class ExcelUploadConfig(AppConfig):<|fim▁hole|> name = 'excel_upload'<|fim▁end|> | |
<|file_name|>periph_uart_if.py<|end_file_name|><|fim▁begin|># Copyright (c) 2018 Kevin Weiss, for HAW Hamburg <kevin.weiss@haw-hamburg.de>
#
# This file is subject to the terms and conditions of the GNU Lesser
# General Public License v2.1. See the file LICENSE in the top level
# directory for more details.
"""@packag... |
class PeriphUartIf(DutShell):
"""Interface to the node with periph_uart firmware.""" |
<|file_name|>0014_auto_20160210_0406.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('questions', '0013_auto_20160210_0400'),
]
<|fim▁hole|> migrat... | operations = [ |
<|file_name|>test_processing.py<|end_file_name|><|fim▁begin|>"""Tests for functions and classes in data/processing.py."""
import glob
import os
from absl.testing import absltest
import heatnet.data.processing as hdp
import heatnet.file_util as file_util
import heatnet.test.test_util as test_util
import numpy as np
imp... | os.remove(path)
for f in glob.glob(os.path.join(tmp_dir, 'temp_proc*')):
os.remove(f)
|
<|file_name|>testing_main.cc<|end_file_name|><|fim▁begin|>#include "base/testing.h"
#include <iostream><|fim▁hole|> InitTest(&argc, &argv);
return RUN_ALL_TESTS();
}<|fim▁end|> |
GTEST_API_ int main(int argc, char** argv) {
std::cout << "Running main() from testing_main.cc\n"; |
<|file_name|>conf.go<|end_file_name|><|fim▁begin|><|fim▁hole|> debug string
// CommitHash exported to assign it from main.go
commitHash string
)
// Most easiest way to configure
// an application is define config as
// yaml string and then parse it into
// map.
// How it works see here:
// https://github.com/ole... | package main
var (
// Debug var to switch mode from outside |
<|file_name|>check_CoC.py<|end_file_name|><|fim▁begin|>################################################
#
# file moved to own repository:
# https://github.com/mozilla/Mozilla-GitHub-Standards
#<|fim▁hole|><|fim▁end|> | ################################################ |
<|file_name|>utils.py<|end_file_name|><|fim▁begin|>import numpy as np
def index2onehot(n_labels, index):
return np.eye(n_labels)[index]
# From https://github.com/lisa-lab/DeepLearningTutorials/blob/master/code/utils.py
def scale_to_unit_interval(ndar, eps=1e-8):
""" Scales all values in the ndarray ndar to be... | # add the slice to the corresponding position in the
# output array
c = 1 |
<|file_name|>introspection.py<|end_file_name|><|fim▁begin|>import re
from collections import namedtuple
import sqlparse
from django.db.backends.base.introspection import (
BaseDatabaseIntrospection, FieldInfo as BaseFieldInfo, TableInfo,
)
from django.db.models import Index
from django.utils.regex_helper import _... | FieldInfo = namedtuple('FieldInfo', BaseFieldInfo._fields + ('pk',))
field_size_re = _lazy_re_compile(r'^\s*(?:var)?char\s*\(\s*(\d+)\s*\)\s*$')
|
<|file_name|>person.py<|end_file_name|><|fim▁begin|>import numpy as np
from src.base.animal import Animal
class Stats(object):
# TODO: Re-implement this at a higher level
# Ugh. I feel dirty.
# name, type, min, max ... distro?
DATA = {
'air': ('i2', 0, 1000),
'hunger': ('i2', 0, 1000)... | 'thirst': ('i2', 0, 1000),
'stamina': ('i2', 0, 1000), |
<|file_name|>CrossOriginHandlerTest.java<|end_file_name|><|fim▁begin|>/*
* Copyright 2014, The Sporting Exchange Limited
* Copyright 2014, Simon Matić Langford
*
* 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 ... | import java.util.Collections;
import static org.mockito.Matchers.eq; |
<|file_name|>Mmhc.java<|end_file_name|><|fim▁begin|>///////////////////////////////////////////////////////////////////////////////
// For information as to what this class does, see the Javadoc, below. //
// Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, //
// 2007, 2008, 2009, 2010, 2... | // //
// 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 2 of the License, or // |
<|file_name|>admin.py<|end_file_name|><|fim▁begin|>from django.contrib import admin
from django.db import models
from pagedown.widgets import AdminPagedownWidget
from .models import Faq, Category
class FaqAdmin(admin.ModelAdmin):
formfield_overrides = {
models.TextField: {'widget': AdminPagedownWidget},... | |
<|file_name|>validator.go<|end_file_name|><|fim▁begin|>// Copyright 2015 go-swagger maintainers
//
// 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/LIC... | }
res.Merge(resMultiple, resMinimum, resMaximum)
res.Inc()
return res |
<|file_name|>EqualTreePartition.py<|end_file_name|><|fim▁begin|>__source__ = 'https://leetcode.com/problems/equal-tree-partition/discuss/'
# Time: O()
# Space: O()
#
# Description: Leetcode # 663. Equal Tree Partition
#
# Given a binary tree with n nodes,
# your task is to check if it's possible to partition the tree ... | |
<|file_name|>data.rs<|end_file_name|><|fim▁begin|>use std::io::TcpStream;
pub trait ServerData
{<|fim▁hole|><|fim▁end|> | fn process_request_data(&mut self, request: TcpStream);
} |
<|file_name|>datastructs.py<|end_file_name|><|fim▁begin|>"""
.. module:: mlpy.auxiliary.datastructs
:platform: Unix, Windows
:synopsis: Provides data structure implementations.
.. moduleauthor:: Astrid Jackson <ajackson@eecs.ucf.edu>
"""
from __future__ import division, print_function, absolute_import
import he... | int :
The size of the array
|
<|file_name|>usuarios.js<|end_file_name|><|fim▁begin|>module.exports = function(app){
var validacao = require('../validacoes/usuarios');
var Usuario = app.models.usuarios;
var UsuarioController = {
index: function(req,res){
Usuario.find(function(err,dados){
if(err){
req.flash('erro', 'Erro ao buscar... | |
<|file_name|>_application_gateways_operations.py<|end_file_name|><|fim▁begin|># coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license informat... | from .. import models as _models
if TYPE_CHECKING:
# pylint: disable=unused-import,ungrouped-imports |
<|file_name|>test_persons.py<|end_file_name|><|fim▁begin|>from django.test import TestCase
from journal.tests.factories import StudentFactory
class StudentTestCase(TestCase):
"""Tests for the Student models"""
<|fim▁hole|> def test_student(self):
"""Test to ensure that Students can be created properly"... | |
<|file_name|>pokemon-details.component.ts<|end_file_name|><|fim▁begin|>import { Component, OnInit } from '@angular/core';
import { RouteSegment } from '@angular/router';
import { SharedService } from '../../app/shared';
import { PokemonDetailsService } from './service/pokemon-details.service';
import { KeyValues} from ... | styleUrls: ['pokemon-details.component.css'],
providers: [PokemonDetailsService], |
<|file_name|>urls.py<|end_file_name|><|fim▁begin|><|fim▁hole|>
from .views import (
semseterResultxlsx,
)
urlpatterns=[
url(r'^semester-xlsx/(?P<collegeCode>\d+)/(?P<branchCode>\d+)/(?P<yearOfJoining>\d+)/(?P<semester>\d+)/$',semseterResultxlsx,name='semseterResultxlsx')
]<|fim▁end|> | from django.conf.urls import url |
<|file_name|>checks.go<|end_file_name|><|fim▁begin|>package core
import (
"fmt"
"gopkg.in/Knetic/govaluate.v2"
)
func (o *Eye) registerValidateChecks() {
for _, item := range o.config.Validate {<|fim▁hole|> serviceName, item.Request)
}
} else if len(item.Services) > 0 {
o.registerValidateCheck(item.Nam... | if len(item.Services) > 1 {
for _, serviceName := range item.Services {
o.registerValidateCheck(fmt.Sprintf("%v-%v", serviceName, item.Name), |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.