prompt
large_stringlengths
70
991k
completion
large_stringlengths
0
1.02k
<|file_name|>Compare.java<|end_file_name|><|fim▁begin|><|fim▁hole|>import org.janus.data.DataContext; public class Compare extends WordImpl { public enum Comp { EQ, NEQ, LT, GT, LEQ, GEQ } Comp comp; public Compare(Comp comp) { super(-1); this.comp = comp; } @Override public void perfo...
package org.janus.miniforth;
<|file_name|>dirtree.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python3 # -*- coding: utf-8 -*- """Utilities for getting directory tree.""" import os from pathlib import Path import crayons from nuke.utils import parse_ignore_file def fg(text, color): """Set text to foregound color.""" return "\33[38;...
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|>#coding: utf-8 from __future__ import absolute_import, unicode_literals, print_function import cProfile from datetime import datetime import re import os import codecs import timeit import pymorphy from pymorphy.contrib.tokenizers import extract_words DICT_PATH = ...
words = load_words(filename)
<|file_name|>server.py<|end_file_name|><|fim▁begin|># coding: utf-8 from livereload import Server, shell <|fim▁hole|><|fim▁end|>
server = Server() server.watch('docs/*.rst', shell('make html')) server.serve(root='docs/_build/html', open_url=True)
<|file_name|>paste.py<|end_file_name|><|fim▁begin|>""" Contains a base Site class for pastebin-like sites. Each child class only needs to specify a base url, the relative url to the public pastes archive, and a lambda function to get the paste links out of the page. """ import logging import re from urllib.parse import...
<|file_name|>types.rs<|end_file_name|><|fim▁begin|>// Copyright 2016-2021 Matthew D. Michelotti // // 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/LICE...
pub const fn const_raw(self) -> $raw { self.value }
<|file_name|>findCWs_plug.C<|end_file_name|><|fim▁begin|>// Copyright (C) 2006,2007,2008,2009, George Hobbs, Russell Edwards /* * This file is part of TEMPO2. * * TEMPO2 is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the...
double Cc1 = gsl_vector_get (Cc, 0); double Cc2 = gsl_vector_get (Cc, 1);
<|file_name|>util.py<|end_file_name|><|fim▁begin|># # GdbLib - A Gdb python library. # Copyright (C) 2012 Fernando Castillo # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Lesser General Public License as published by # the Free Software Foundation, either vers...
# but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU Lesser General Public License for more details. #
<|file_name|>balancer_test.go<|end_file_name|><|fim▁begin|>package cluster_test import ( "fmt" "testing" "github.com/influxdb/influxdb/cluster" "github.com/influxdb/influxdb/services/meta" ) func NewNodes() []meta.NodeInfo { var nodes []meta.NodeInfo for i := 1; i <= 2; i++ { nodes = append(nodes, meta.NodeI...
}
<|file_name|>host.rs<|end_file_name|><|fim▁begin|>use std::convert::TryFrom; use std::fmt; use std::net::{IpAddr, Ipv4Addr, Ipv6Addr}; use std::str::FromStr; use super::EndpointError; use crate::ZmqError; /// Represents a host address. Does not include the port, and may be either an /// ip address or a domain name #[...
if let Host::Domain(_) = parsed_host {
<|file_name|>CardContent.test.js<|end_file_name|><|fim▁begin|>import React from 'react'; import { assert } from 'chai'; import { createShallow, getClasses } from '../test-utils'; import CardContent from './CardContent'; describe('<CardContent />', () => { let shallow; let classes; before(() => { shallow = c...
assert.strictEqual(wrapper.hasClass(classes.root), true); }); });
<|file_name|>convert_shader.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python import sys def convert_str(infile, outfile): f = open(infile, 'r') lines = f.readlines() f.close() f = open(outfile, 'w') f.writelines(['"%s\\n"\n' % i.rstrip() for i in lines]) f.close() def main(): convert...
<|file_name|>client.js<|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. * ---------...
} function createConnection(input, output, errorHandler, closeHandler) { let logger = new ConsoleLogger(); let connection = vscode_languageserver_protocol_1.createProtocolConnection(input, output, logger);
<|file_name|>addition.cc<|end_file_name|><|fim▁begin|>/* addition.cc * * KNOWN BUGS: will fail if entered with a tsp with identical pos_t's. * * nearest addition and fathest insertion, with initial convex hull and * maximal angle selections for euclidean. * * orig ceh 12-91 * * c++ conversion ceh 12-93 * adde...
} inline double AdditionHeuristic :: dot_product(const pos_t *p1, const pos_t *p2,
<|file_name|>callbacks.py<|end_file_name|><|fim▁begin|>import logging <|fim▁hole|> logger = logging.getLogger(__name__) def run_api_endpoint_callbacks(api_endpoint): responses = [] for api_callback in api_endpoint.callbacks.all(): logger.debug("Make callback: %s", api_callback) response = make...
from django.conf import settings from mock_api.http_utils import make_request
<|file_name|>genera_html_su_urbano.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python # -*- coding: utf-8 -*- import cgi import sqlite3, re, string, codecs, os def cercaurbano(cNominativo): c = sqlite3.connect('./data/catasto.db') cur = c.cursor() cSele = "select distinct (id_i.foglio || '-' || id_i.numero ||'-'...
print "%s = %s" % (key, parametri[key].value)
<|file_name|>grid.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/. */ //! CSS handling for the computed value of //! [grids](https://d...
<|file_name|>ipa_log_manager.py<|end_file_name|><|fim▁begin|># Authors: John Dennis <jdennis@redhat.com> # # Copyright (C) 2011 Red Hat # see file 'COPYING' for use and warranty information # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License a...
config = {'logger_regexps' : logger_regexps, } for attr in ('debug', 'verbose'):
<|file_name|>gc.go<|end_file_name|><|fim▁begin|>package cli import ( "fmt" "github.com/dailymuse/git-fit/config" "github.com/dailymuse/git-fit/transport" "github.com/dailymuse/git-fit/util" "io/ioutil" "os" ) func Gc(schema *config.Config, trans transport.Transport, args []string) { savedFiles := make(map[stri...
allFiles, err := ioutil.ReadDir(".git/fit")
<|file_name|>artist.py<|end_file_name|><|fim▁begin|># Copyright (c) 2016 by Ecreall under licence AGPL terms # available on http://www.gnu.org/licenses/agpl.html # licence: AGPL # author: Amen Souissi import colander import deform import hashlib from functools import reduce from zope.interface import implementer fro...
self.hash_picture_fp() self.hash_artist_data() @property
<|file_name|>redirect.py<|end_file_name|><|fim▁begin|># Copyright (C) 2010-2014 GRNET S.A. # # 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...
return response
<|file_name|>home.module.ts<|end_file_name|><|fim▁begin|>import { NgModule } from '@angular/core'; import { CommonModule } from '@angular/common'; import { SharedModule } from '../shared/shared.module'; import { HomeComponent } from './home.component'; import { NameListService } from '../shared/name-list/index'; ...
@NgModule({ imports: [CommonModule, SharedModule], declarations: [HomeComponent],
<|file_name|>disk_usage_test.py<|end_file_name|><|fim▁begin|># Copyright 2016 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 the License at # # http://www.a...
def testWrapperSessionNotExceedingLimit(self): def _watch_fn(fetches, feeds): del fetches, feeds
<|file_name|>cclib2openbabel.py<|end_file_name|><|fim▁begin|># This file is part of cclib (http://cclib.github.io), a library for parsing # and interpreting the results of computational chemistry packages. # # Copyright (C) 2006, the cclib development team # # The library is free software, distributed under the terms o...
"""Bridge for using cclib data in openbabel (http://openbabel.org).""" import openbabel as ob
<|file_name|>index.ts<|end_file_name|><|fim▁begin|>// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. import { autocompleteChannels, AutocompleteSuggestion, autocompleteUsersInChannel, Channel, COMMAND_SUGGESTION_CHANNEL, COMMAND_SUGG...
interface Store { dispatch: DispatchFunc; getState: () => GlobalState;
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|># ##### BEGIN GPL LICENSE BLOCK ##### # # 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 o...
for ground_sensor in enumerate_ground_sensors(context.object.pose.bones):
<|file_name|>message_log.rs<|end_file_name|><|fim▁begin|>use std::{env, process::exit, time::Duration}; use assign::assign; use ruma::{ api::client::{filter::FilterDefinition, sync::sync_events}, events::{ room::message::{MessageType, RoomMessageEventContent, TextMessageEventContent}, AnySyncMe...
<|file_name|>variables_test.py<|end_file_name|><|fim▁begin|># Copyright 2015 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 the License at # # http://www.ap...
<|file_name|>extern-1.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 <LICENSE-APACHE or<|fim▁hole|> // pretty-expanded ...
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your // option. This file may not be copied, modified, or distributed // except according to those terms.
<|file_name|>DatarouterWebappInstanceLogDao.java<|end_file_name|><|fim▁begin|>/* * Copyright © 2009 HotPads (admin@hotpads.com) * * 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 * * ...
.build(); datarouter.register(node); }
<|file_name|>test_mysql.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- import os from .. import OratorTestCase from . import IntegrationTestCase class MySQLIntegrationTestCase(IntegrationTestCase, OratorTestCase): @classmethod def get_manager_config(cls): ci = os.environ.get("CI", False) ...
else: database = "orator_test" user = "orator"
<|file_name|>syntax-extension-minor.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<|fim▁hole|>// http://rust-lang.org/COPYRIGHT. // // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or // htt...
<|file_name|>settings.py<|end_file_name|><|fim▁begin|># Configuration for fargo. # You can override Fargo default settings here # Fargo is a Django application: for the full list of settings and their # values, see https://docs.djangoproject.com/en/1.7/ref/settings/ # For more information on settings see # https://doc...
# SMTP configuration # EMAIL_HOST = 'localhost'
<|file_name|>Result.java<|end_file_name|><|fim▁begin|>package com.zuoqing.demo.entity; /** * http 请求返回的最外层对象 */ public class Result<T> { private Integer code; private String msg; private T data; public Integer getCode() { return code; } public void setCode(Integer code) { ...
public String getMsg() {
<|file_name|>__openerp__.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- ############################################################################## # # Copyright (C) 2015 ADHOC SA (http://www.adhoc.com.ar) # All Rights Reserved. # # This program is free software: you can redistribute it and/or mo...
<|file_name|>geonetwork.py<|end_file_name|><|fim▁begin|>######################################################################### # # Copyright (C) 2012 OpenPlans #<|fim▁hole|># the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # This program is distributed in the...
# 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
<|file_name|>admin.py<|end_file_name|><|fim▁begin|>import datetime from django.contrib import admin from django.db.models import Q from django.utils.timezone import now from django.utils.translation import ugettext_lazy as _ from models import Invoice, InvoiceItem class InvoiceItemInline(admin.TabularInline): f...
)
<|file_name|>cavity-rank.py<|end_file_name|><|fim▁begin|>def cavity(l,n): for i in xrange(1,n-1): for j in xrange(1,n-1): if l[i-1][j]!='X' and l[i][j-1]!='X' and l[i+1][j]!='X' and l[i][j+1]!='X' and l[i][j]>l[i-1][j] and l[i][j]>l[i+1][j] and l[i][j]>l[i][j-1] and l[i][j]>l[i][j+1]: ...
<|file_name|>sync.js<|end_file_name|><|fim▁begin|>var request = require('supertest'); var should = require('should'); var express = require('express'); var expressRouter = require('../index.js'); var mockPath = 'mock.js'; describe('register routes', function(){ var app; before(function(){ app = ex...
.post('/api/test')
<|file_name|>metadata.js<|end_file_name|><|fim▁begin|>module.exports = { /*"installedPackages":{ "xmlName":"InstalledPackage", "children":{ } },*/ "labels":{ "xmlName":"CustomLabels", "children":{ "CustomLabels":"CustomLabel" } }, "staticresources":{...
} },
<|file_name|>service.js<|end_file_name|><|fim▁begin|>const fs = require('fs'); const path = require('path'); class Service { constructor() { this.getFileRecursevly = this.getFileRecursevly.bind(this); this.getFiles = this.getFiles.bind(this); } getFileRecursevly(folderPath, shortPath = '') {...
var filePath = path.resolve(folderPath, file); if (fs.lstatSync(filePath).isDirectory()) { files.push({
<|file_name|>index.ts<|end_file_name|><|fim▁begin|>import {CommonModule} from '@angular/common'; import {NgModule} from '@angular/core'; import {FormsModule} from '@angular/forms'; import {MatCardModule} from '@angular/material/card'; import {MatCheckboxModule} from '@angular/material/checkbox'; import {MatRadioModule}...
declarations: EXAMPLES,
<|file_name|>minsession_test.go<|end_file_name|><|fim▁begin|>package authentication import ( "github.com/stretchr/testify/assert" // "github.com/stuphlabs/pullcord" "net/http" "testing" ) // TestMinSessionHandlerFirstPass tests if a MinSessionHandler will even give an // initial cookie. // // Steps: // 1. Create...
if fwd3 != nil { assert.Equal(t, 1, len(fwd3)) } assert.NotNil(t, fwd4)
<|file_name|>mod.rs<|end_file_name|><|fim▁begin|>//! Functions for filtering images. mod median; pub use self::median::median_filter; mod sharpen; pub use self::sharpen::*; use image::{GenericImage, GenericImageView, GrayImage, ImageBuffer, Luma, Pixel, Primitive}; use crate::definitions::{Clamp, Image}; use crate:...
<|file_name|>ConsulServiceTest.java<|end_file_name|><|fim▁begin|>package com.rebuy.consul; import com.ecwid.consul.v1.ConsulClient; import com.ecwid.consul.v1.QueryParams; import com.ecwid.consul.v1.Response; import com.ecwid.consul.v1.agent.model.NewService; import com.ecwid.consul.v1.catalog.model.CatalogService; im...
{ when(clientMock.agentServiceRegister(Mockito.any())).thenReturn(null);
<|file_name|>manage.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python import os import sys if __name__ == "__main__": os.environ.setdefault("DJANGO_SETTINGS_MODULE", "sufwebapp1.settings") from django.core.management import execute_from_command_line <|fim▁hole|><|fim▁end|>
execute_from_command_line(sys.argv)
<|file_name|>html_completions.py<|end_file_name|><|fim▁begin|>import sublime, sublime_plugin import re def match(rex, str): m = rex.match(str) if m: return m.group(0) else: return None # This responds to on_query_completions, but conceptually it's expanding # expressions, rather than compl...
"text.html - source"): return []
<|file_name|>_scripted_fields.js<|end_file_name|><|fim▁begin|>import _ from 'lodash'; import 'ui/paginated_table'; import popularityHtml from 'plugins/kibana/management/sections/indices/_field_popularity.html'; import controlsHtml from 'plugins/kibana/management/sections/indices/_field_controls.html'; import dateScript...
<|file_name|>fig0621.cpp<|end_file_name|><|fim▁begin|>// File: fig0621.cpp // Computer Systems, Fourth Edition<|fim▁hole|> #include <iostream> using namespace std; int numPts; int value; int j; void printBar (int n) { int k; for (k = 1; k <= n; k++) { cout << '*'; } cout << endl; } int main () { ...
// Figure 6.21
<|file_name|>elastic.py<|end_file_name|><|fim▁begin|>import ast import json import arrow import elasticsearch from bson import ObjectId from flask import request from eve.utils import config from eve.io.base import DataLayer try: from urllib.parse import urlparse except ImportError: from urlparse import urlpa...
return get_indices(self.es).get_mapping(index=index, doc_type=doc_type)
<|file_name|>GridWidget.ts<|end_file_name|><|fim▁begin|>import Geometry = THREE.Geometry; import Mesh = THREE.Mesh; import LineBasicMaterial = THREE.LineBasicMaterial; import Material = THREE.Material; import Vector3 = THREE.Vector3; import Line = THREE.Line; import { ChartWidget } from "../Widget"; import LineSegments...
let axisRange = axisOptions.range; let from = axisRange.from; let to = axisRange.to; let axisLength = to - from;
<|file_name|>recipe-189745.py<|end_file_name|><|fim▁begin|>class Obfuscator: """ A simple obfuscator class using repeated xor """ def __init__(self, data): self._string = data def obfuscate(self): """Obfuscate a string by using repeated xor""" out = "" data = self._...
<|file_name|>node_test.go<|end_file_name|><|fim▁begin|>/* Copyright 2017 The Kubernetes 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/LICENSE-2.0 Unle...
// Create objects
<|file_name|>example-Gnomonic.cpp<|end_file_name|><|fim▁begin|>using namespace System; using namespace NETGeographicLib; int main(array<System::String ^> ^/*args*/) { try { Geodesic^ geod = gcnew Geodesic(); // WGS84 const double lat0 = 48 + 50/60.0, lon0 = 2 + 20/60.0; // Paris Gnomonic^ p...
<|file_name|>os_str.rs<|end_file_name|><|fim▁begin|>// Copyright 2015 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...
<|file_name|>test_clipping.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python #coding:utf-8 # Author: mozman --<mozman@gmx.at> # Purpose: test mixin Clipping # Created: 31.10.2010 # Copyright (C) 2010, Manfred Moitzi # License: GPLv3 <|fim▁hole|>from svgwrite.mixins import Clipping from svgwrite.base impor...
import unittest
<|file_name|>SVGFEDropShadowElement.cpp<|end_file_name|><|fim▁begin|>/* * Copyright (C) Research In Motion Limited 2011. All rights reserved. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Library General Public * License as published by the Free Software F...
}
<|file_name|>person.go<|end_file_name|><|fim▁begin|>package face // Copyright (c) Microsoft and contributors. 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 // htt...
// ListSender sends the List request. The method will close the // http.Response Body if it receives an error. func (client PersonClient) ListSender(req *http.Request) (*http.Response, error) {
<|file_name|>strategy_test.go<|end_file_name|><|fim▁begin|>/* Copyright 2016 The Kubernetes 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/LICENSE-2.0 ...
if cases[i].shouldGenerationIncrement { if e, a := cases[i].older.Generation+1, cases[i].newer.Generation; e != a { t.Fatalf("%v: expected %v, got %v for generation", cases[i].name, e, a)
<|file_name|>relay_test.go<|end_file_name|><|fim▁begin|>package relay_test import ( "fmt" "os" "strings" "testing"<|fim▁hole|> "github.com/nanopack/pulse/relay" "github.com/nanopack/pulse/server" ) var serverAddr = "127.0.0.1:9899" var testRelay *relay.Relay func stdoutPublisher(messages plexer.MessageSet) erro...
"time" "github.com/nanopack/pulse/plexer"
<|file_name|>InterestingPeopleWithAPI.js<|end_file_name|><|fim▁begin|>import React, { Component } from 'react'; import PropTypes from 'prop-types'; import { FormattedMessage } from 'react-intl'; import { Link } from 'react-router-dom'; import _ from 'lodash'; import User from './User'; import Loading from '../../compon...
import './InterestingPeople.less'; import steemAPI from '../../steemAPI'; class InterestingPeopleWithAPI extends Component {
<|file_name|>thingspeak_cpu_loop.py<|end_file_name|><|fim▁begin|>from time import localtime, strftime # download from http://code.google.com/p/psutil/ import psutil import time import thingspeak channel_id = 0 # PUT CHANNEL ID HERE write_key = 0 # PUT YOUR WRITE KEY HERE def doit(channel): cpu_pc = psutil.c...
channel = thingspeak.Channel(id=channel_id, write_key=write_key) while True:
<|file_name|>site.js<|end_file_name|><|fim▁begin|>/** * Module dependencies. */ var passport = require('passport'); module.exports.loginForm = function(req, res) { res.render('login'); }; module.exports.login = passport.authenticate('local', { successReturnToOrRedirect: '/login/status/success', failureRed...
}
<|file_name|>setup.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python # -*- coding: utf8 -*- import setuptools from setuptools.command.develop import develop from setuptools.command.install import install class DevelopScript(develop): def run(self): develop.run(self) ntlk_install_packages() c...
setuptools.setup(
<|file_name|>create_table_snr.py<|end_file_name|><|fim▁begin|>import astropy.io.fits as fits import matplotlib matplotlib.use('Agg') import matplotlib.pyplot as p import numpy as n import os import sys from scipy.stats import scoreatpercentile as sc from scipy.interpolate import interp1d survey = sys.argv[1] z_min, ...
if survey =='sdss': catalog = fits.open(path_2_sdss_cat)[1].data
<|file_name|>intersection.rs<|end_file_name|><|fim▁begin|>use geometry::Shape; use math::{Point3, Vector3}; use ray::Ray; use texture::TextureCoord; #[derive(Copy, Clone)] pub struct Intersection<'a> { pub t: f32, pub shape: &'a dyn Shape, pub point: Point3, pub ray: Ray, pub normal: Vector3, p...
pub fn new( t: f32, shape: &'a dyn Shape, point: Point3,
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|>from .db import Database<|fim▁hole|>__version__ = "0.1.1" __maintainer__ = "Gunther Cox" __email__ = "gunthercx@gmail.com"<|fim▁end|>
<|file_name|>main.js<|end_file_name|><|fim▁begin|>'use strict'; <|fim▁hole|> // load the controller's module beforeEach(module('tallytextApp')); var MainCtrl, scope; // Initialize the controller and a mock scope beforeEach(inject(function ($controller, $rootScope) { scope = $rootScope.$new(); Mai...
describe('Controller: MainCtrl', function () {
<|file_name|>overlay.rs<|end_file_name|><|fim▁begin|>// This file was generated by gir (5c017c9) from gir-files (71d73f0) // DO NOT EDIT use Bin; use Container; use Widget; use ffi; use glib::Value; use glib::object::Downcast; use glib::object::IsA; use glib::translate::*; glib_wrapper! { pub struct Overlay(Objec...
}
<|file_name|>utils.py<|end_file_name|><|fim▁begin|>from nativedroid.protobuf.java_signatures_pb2 import * __author__ = "Fengguo Wei" __copyright__ = "Copyright 2018, The Argus-SAF Project" __license__ = "Apache v2.0" def java_package_str(java_package_pb, delimiter): """ Return full string of a java package p...
""" Return full string of a class type proto. :param ClassType class_type_pb: java_signatures_pb2.ClassType
<|file_name|>jquery.twbsFlickrCarousel.js<|end_file_name|><|fim▁begin|>/** * jQuery Twitter Bootstrap Flickr Carousel v1.0.0 * http://jguadagno.github.io/twbs-FlickrCarousel/ * * Copyright 2014, Joseph Guadagno * Released under Apache 2.0 license * http://apache.org/licenses/LICENSE-2.0.html */ ;<|fim▁hole|> var old...
(function ($, window, document, undefined) { 'use strict';
<|file_name|>pt_query.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python3 import argparse import datetime import getpass import json import logging import logging.config import os import re import sys import tabulate import uuid from critsapi.critsapi import CRITsAPI from critsapi.critsdbapi import CRITsDBAPI fro...
'are allowed.') # Add our mutually exclusive items meg = argparser.add_mutually_exclusive_group() meg.add_argument('-n', dest='name', action='store_true', default=False,
<|file_name|>UserPreferencesDao.java<|end_file_name|><|fim▁begin|>package stroom.config.global.impl; import stroom.ui.config.shared.UserPreferences;<|fim▁hole|> import java.util.Optional; public interface UserPreferencesDao { Optional<UserPreferences> fetch(String userId); int update(String userId, UserPref...
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|><|fim▁hole|>from .chucky_neighborhood_tool import NeighborhoodTool<|fim▁end|>
<|file_name|>test_base_handler_with_auto_webp.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python # -*- coding: utf-8 -*- # thumbor imaging service # https://github.com/thumbor/thumbor/wiki # Licensed under the MIT license: # http://www.opensource.org/licenses/mit-license # Copyright (c) 2011 globo.com thumbor@googlegr...
from unittest.mock import patch from urllib.parse import quote from libthumbor import CryptoURL
<|file_name|>egress_test.go<|end_file_name|><|fim▁begin|>package stream_multiplexer import ( "bytes" "encoding/binary" "fmt" "go.dedis.ch/onet/log" "net" "sync" "testing" "time" ) func handleConnection(id int, conn net.Conn, expect []byte, t *testing.T, wg *sync.WaitGroup) { defer wg.Done() buffer := make(...
expected := make(map[int][]byte) expected[0] = doubleHello expected[1] = doubleHello2
<|file_name|>network_tiers.go<|end_file_name|><|fim▁begin|>/* Copyright 2017 The Kubernetes 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/LICENSE-2.0 ...
<|file_name|>AddTagCommand.java<|end_file_name|><|fim▁begin|>package org.ovirt.engine.core.bll; import org.ovirt.engine.core.common.AuditLogType; import org.ovirt.engine.core.common.action.TagsOperationParameters; import org.ovirt.engine.core.common.businessentities.Tags; import org.ovirt.engine.core.common.errors.Eng...
setSucceeded(true); }
<|file_name|>fakepuppy.py<|end_file_name|><|fim▁begin|><|fim▁hole|>import time import os DATA_DIR='/local/devel/guppy/testing/' opts, args = getopt.getopt(sys.argv[1:], 'c:t') transfer = False listdir = False for opt, optarg in opts: if opt == '-c': if optarg == 'get' or optarg == 'put': transfer = True if ...
#!/usr/bin/python import sys import getopt
<|file_name|>tests.py<|end_file_name|><|fim▁begin|>from unittest import mock from urllib.error import HTTPError, URLError import requests from azure.mgmt.cdn import CdnManagementClient from azure.mgmt.frontdoor import FrontDoorManagementClient from django.core.exceptions import ImproperlyConfigured from django.test i...
'azure_front_door': {
<|file_name|>WhileToForFix.java<|end_file_name|><|fim▁begin|>/* * Copyright 2014 Guidewire Software, Inc. */ package gw.plugin.ij.intentions; import com.intellij.codeInsight.CodeInsightUtilBase; import com.intellij.codeInspection.LocalQuickFixAndIntentionActionOnPsiElement; import com.intellij.openapi.editor.Editor...
} }
<|file_name|>Cycle_Second_25_S_120.py<|end_file_name|><|fim▁begin|>import tests.periodicities.period_test as per<|fim▁hole|> per.buildModel((120 , 'S' , 25));<|fim▁end|>
<|file_name|>SQLContextLoggerBeanPostProcessor.java<|end_file_name|><|fim▁begin|>/* * Copyright (c) 2012. Piraso Alvin R. de Leon. All Rights Reserved. * * See the NOTICE file distributed with<|fim▁hole|> * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 *...
* this work for additional information regarding copyright ownership. * The Piraso licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with
<|file_name|>vmware_local_role_manager.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python # -*- coding: utf-8 -*- # Author(s): Abhijeet Kasurde <akasurde@redhat.com> # 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_funct...
<|file_name|>Navigation.js<|end_file_name|><|fim▁begin|>import React from "react" import { injectIntl } from "react-intl" import { NavLink } from "react-router-dom" import PropTypes from "prop-types" import Styles from "./Navigation.css" <|fim▁hole|> return ( <ul className={Styles.list}> <li><NavLink exact ...
function Navigation({ intl }) {
<|file_name|>gather_essays.py<|end_file_name|><|fim▁begin|><|fim▁hole|> if f.endswith(".markdown"): fp = os.path.join(base, f) _, np = os.path.split(base) np = re.sub(r"_def$", "", np) np = os.path.join("essays", np+".markdown") # print fp, "=>", np ...
import os, re, shutil for (base, _, files) in os.walk("essays",): for f in files:
<|file_name|>7-pwm.py<|end_file_name|><|fim▁begin|># CamJam EduKit 3 - Robotics # Worksheet 7 - Controlling the motors with PWM import RPi.GPIO as GPIO # Import the GPIO Library import time # Import the Time library # Set the GPIO modes GPIO.setmode(GPIO.BCM) GPIO.setwarnings(False) # Set variables for the GPIO mo...
<|file_name|>CallingHeader.tsx<|end_file_name|><|fim▁begin|>// Copyright 2020-2021 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only import React from 'react'; import classNames from 'classnames'; import { LocalizerType } from '../types/Util'; import { Tooltip } from './Tooltip'; import { Theme } from '....
</Tooltip> </div>
<|file_name|>test_plasma_unlimited.py<|end_file_name|><|fim▁begin|>import numpy as np import random import os import shutil import platform import pytest import ray from ray.test_utils import wait_for_condition from ray.internal.internal_api import memory_summary MB = 1024 * 1024 def _init_ray(): return ray.ini...
else: if "Spilled" in s: return False
<|file_name|>pool_camera.py<|end_file_name|><|fim▁begin|>import cv2, numpy as np from dolphintracker.singlecam_tracker.camera_filter.FindDolphin import SearchBlobs from dolphintracker.singlecam_tracker.camera_filter.BackGroundDetector import BackGroundDetector import datetime class PoolCamera(object): def __init__(s...
self._backgrounds = [] self._last_centroid = None
<|file_name|>init.go<|end_file_name|><|fim▁begin|>/* Copyright 2016 The Kubernetes 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/LICENSE-2.0 Unless re...
cmd.Flags().String("etcd-pv-capacity", "10Gi", "Size of persistent volume claim to be used for etcd.") cmd.Flags().Bool("dry-run", false, "dry run without sending commands to server.") cmd.Flags().String("storage-backend", "etcd2", "The storage backend for persistence. Options: 'etcd2' (default), 'etcd3'.") return ...
<|file_name|>views.py<|end_file_name|><|fim▁begin|># -*- encoding: utf-8 -*- # from django.shortcuts import render, render_to_response, redirect, get_object_or_404, get_list_or_404, Http404 from django.core.cache import cache from django.shortcuts import * from django.views.generic import TemplateView, FormView from dj...
return render(request, "GestionAnalisis/autoresbar.html",{"proyecto":proyecto,'proyectos_user': proyectos_list, 'mproyecto': model_proyecto, 'lista_permisos': permisos}) except:
<|file_name|>SpringcloudConfigClientApplicationTests.java<|end_file_name|><|fim▁begin|>package com.xiaofeng; import org.junit.Test; import org.junit.runner.RunWith; import org.springframework.boot.test.context.SpringBootTest; import org.springframework.test.context.junit4.SpringRunner; @RunWith(SpringRunner.class)<|f...
@SpringBootTest public class SpringcloudConfigClientApplicationTests { @Test
<|file_name|>IfcTelecomAddress.cpp<|end_file_name|><|fim▁begin|>/* -*-c++-*- IfcPlusPlus - www.ifcplusplus.com - Copyright (C) 2011 Fabian Gerold * * This library is open source and may be redistributed and/or modified under * the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or * (at your option) a...
readSelectList( args[4], m_FacsimileNumbers, map ); m_PagerNumber = IfcLabel::createObjectFromSTEP( args[5] );
<|file_name|>test_k8s_io_apimachinery_pkg_apis_meta_v1_root_paths.py<|end_file_name|><|fim▁begin|># coding: utf-8 """ KubeVirt API This is KubeVirt API an add-on for Kubernetes. <|fim▁hole|> Contact: kubevirt-dev@googlegroups.com Generated by: https://github.com/swagger-api/swagger-codegen.git """ fr...
OpenAPI spec version: 1.0.0
<|file_name|>rtp_viewer.py<|end_file_name|><|fim▁begin|>#! /usr/bin/python import cv2 import sys from os import path, getenv PPRZ_SRC = getenv("PAPARAZZI_SRC", path.normpath(path.join(path.dirname(path.abspath(__file__)), '../../../'))) sys.path.append(PPRZ_SRC + "/sw/ext/pprzlink/lib/v1.0/python") from pprzlink.ivy...
# If mouse start is defined, a region has been selected if not self.mouse.get('start'): return
<|file_name|>date.js<|end_file_name|><|fim▁begin|>var base64url = require('urlsafe-base64') , After = require('json-list-response').After , inherits = require('util').inherits module.exports = DateAfter function DateAfter(value, options) { After.call(this, value, options) this.skip = 0 this.value = 0 if...
list.selector.$and.push(obj) list.cursor.skip(this.skip + 1) }
<|file_name|>speedtest.py<|end_file_name|><|fim▁begin|>import sys import time from entrypoint2 import entrypoint import pyscreenshot from pyscreenshot.plugins.gnome_dbus import GnomeDBusWrapper from pyscreenshot.plugins.gnome_screenshot import GnomeScreenshotWrapper from pyscreenshot.plugins.kwin_dbus import KwinDBus...
debugpar = ["--debug"]
<|file_name|>util.py<|end_file_name|><|fim▁begin|># Copyright 2016-2018 Michael Peters # # 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|>use-stdout.tsx<|end_file_name|><|fim▁begin|>import React, {FC, useEffect} from 'react'; import {render, useStdout, Text} from '../..'; const WriteToStdout: FC = () => { const {write} = useStdout(); useEffect(() => { write('Hello from Ink to stdout\n'); }, []); return <Text>Hello World</Text>; }; ...
(async () => { await app.waitUntilExit();