prompt
large_stringlengths
70
991k
completion
large_stringlengths
0
1.02k
<|file_name|>textutil.py<|end_file_name|><|fim▁begin|># Microsoft Azure Linux Agent # # Copyright 2018 Microsoft Corporation # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www...
<|file_name|>text_file.py<|end_file_name|><|fim▁begin|>"""text_file provides the TextFile class, which gives an interface to text files that (optionally) takes care of stripping comments, ignoring blank lines, and joining lines with backslashes.""" __revision__ = "$Id$" from types import * import sys, os, string c...
result6 = ["line 3 continues on next line"] def test_input (count, description, file, expected_result): result = file.readlines ()
<|file_name|>example_test.go<|end_file_name|><|fim▁begin|><|fim▁hole|> "go-common/library/net/http/blademaster/middleware/supervisor" "time" ) // This example create a supervisor middleware instance and attach to a blademaster engine, // it will allow '/ping' API can be requested with specified policy. // This exampl...
package supervisor_test import ( "go-common/library/net/http/blademaster"
<|file_name|>kalloc.rs<|end_file_name|><|fim▁begin|>// The MIT License (MIT) // // Copyright (c) 2015 Kashyap // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, includ...
let mut address = pg_roundup(vstart);
<|file_name|>query-language.ts<|end_file_name|><|fim▁begin|>import {customElement, bindable} from 'aurelia-templating'; import {inject} from 'aurelia-dependency-injection'; import {Utils, DomUtils} from 'marvelous-aurelia-core/utils'; import {AureliaUtils} from 'marvelous-aurelia-core/aureliaUtils'; @customElement('m-...
refreshCompletions(caretPosition = DomUtils.getCaretPosition(this._queryInputElement)) { // TODO: debaunce if (!this.options.autoComplete) {
<|file_name|>FormControl.test.js<|end_file_name|><|fim▁begin|>import * as React from 'react'; import { expect } from 'chai'; import { spy } from 'sinon'; import { createMount, describeConformanceV5, act, createClientRender } from 'test/utils'; import FormControl, { formControlClasses as classes } from '@material-ui/cor...
);
<|file_name|>issue_detail_broker.py<|end_file_name|><|fim▁begin|>from ..broker import Broker class IssueDetailBroker(Broker): controller = "issue_details" def show(self, **kwargs): """Shows the details for the specified issue detail. **Inputs** | ``api version min:`` None ...
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|><|fim▁hole|>from trifle.server.views.api import api from trifle.server.views.monitor import monitor from trifle.server.views.configure import configure<|fim▁end|>
from trifle.server.views.frontend import frontend
<|file_name|>TAARenderPass.d.ts<|end_file_name|><|fim▁begin|>import {<|fim▁hole|>} from '../../../src/Three'; import { SSAARenderPass } from './SSAARenderPass'; export class TAARenderPass extends SSAARenderPass { constructor(scene: Scene, camera: Camera, clearColor: Color | string | number, clearAlpha: number); a...
Scene, Camera, Color
<|file_name|>issue-28344.rs<|end_file_name|><|fim▁begin|>use std::ops::BitXor; fn main() { let x: u8 = BitXor::bitor(0 as u8, 0 as u8); //~^ ERROR must be specified //~| no function or associated item named let g = BitXor::bitor;<|fim▁hole|> //~^ ERROR must be specified //~| no function or asso...
<|file_name|>studio-bridge-fullshot-image.js<|end_file_name|><|fim▁begin|>(function ($) { function getCsrfTokenForFullShotImage(callback) { $ .get(Drupal.url('rest/session/token')) .done(function (data) { var csrfToken = data; callback(csrfToken); ...
function patchImageFullShot(csrfToken, file, fid) { //document.getElementById('msg-up').innerHTML = 'Image marked as fullshot ....';
<|file_name|>scan.js<|end_file_name|><|fim▁begin|>/* Copyright (c) 2004-2012, The Dojo Foundation All Rights Reserved. Available via Academic Free License >= 2.1 OR the modified BSD license. see: http://dojotoolkit.org/license for details */ if(!dojo._hasResource["dojox.lang.functional.scan"]){ //_hasResource chec...
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|>from .gameserver import Game<|fim▁hole|><|fim▁end|>
from .example import TicTacToe
<|file_name|>test_parser.py<|end_file_name|><|fim▁begin|>import parser import unittest import sys class TestVideoParser(unittest.TestCase): def test_parse_video(self): if sys.platform.startswith('win'): path = '\\server\\Movies\\Brave (2007)\\Brave (2006).mkv' else: path = ...
<|file_name|>libsoletta.so-gdb.py<|end_file_name|><|fim▁begin|># This file is part of the Soletta Project # # Copyright (C) 2015 Intel Corporation. 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...
#
<|file_name|>GeneticOperations.hh<|end_file_name|><|fim▁begin|>/* FILE GeneticOperations.hh ** PACKAGE GeneticOperations ** AUTHOR Edward S. Blurock ** ** CONTENT ** Prototypes for the "GeneticOperations" package in the CoreObjects environment ** ** COPYRIGHT (C) 1997 Edward S. Blurock */ #ifndef CoreO...
<|file_name|>D31.java<|end_file_name|><|fim▁begin|>/* Copyright 2006 by Sean Luke Licensed under the Academic Free License version 3.0 See the file "LICENSE" for more information */ <|fim▁hole|> package ec.app.parity.func; import ec.*; import ec.app.parity.*; import ec.gp.*; import ec.util.*; /* * D31.java * ...
<|file_name|>MGI.py<|end_file_name|><|fim▁begin|>import csv import os from datetime import datetime import logging import re from dipper.sources.PostgreSQLSource import PostgreSQLSource from dipper.models.assoc.Association import Assoc from dipper.models.assoc.G2PAssoc import G2PAssoc from dipper.models.Genotype import...
<|file_name|>factories.py<|end_file_name|><|fim▁begin|>import factory from api import models class ClientFactory(factory.DjangoModelFactory): class Meta: model = models.Client<|fim▁hole|> name = 'Coaxis' @factory.django.mute_signals(models.post_save) class UserFactory(factory.DjangoModelFactory): ...
<|file_name|>lassplit.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- """ *************************************************************************** lassplit.py --------------------- Date : August 2012 Copyright : (C) 2012 by Victor Olaya Email : v...
<|file_name|>fibonacci.py<|end_file_name|><|fim▁begin|>def _checkInput(index): if index < 0: raise ValueError("Indice negativo non supportato [{}]".format(index)) elif type(index) != int: raise TypeError("Inserire un intero [tipo input {}]".format(type(index).__name__))<|fim▁hole|> serie = "0...
def fib_from_string(index): _checkInput(index)
<|file_name|>decode.rs<|end_file_name|><|fim▁begin|>const GREEK_FROM_BETA: [char; 26] = [ '\u{03b1}', // A => alpha '\u{03b2}', // B => beta '\u{03be}', // C => xi '\u{03b4}', // D => delta '\u{03b5}', // E => epsilon '\u{03c6}', // F => phi '\u{03b3}', // G => gamma '\u{03b7}', // H => ...
'|' => IOTA_SUBSCRIPT, ';' => QUESTION_MARK, '\''=> APOSTROPHE,
<|file_name|>cms_form.py<|end_file_name|><|fim▁begin|>############################################################################## # # Copyright (C) 2019-2020 Compassion CH (http://www.compassion.ch) # @author: Christopher Meier <dev@c-meier.ch> # # The licence is in the file __manifest__.py # ##############...
""" from odoo import http
<|file_name|>main.go<|end_file_name|><|fim▁begin|>package main import ( "fmt" "os" "path/filepath" "github.com/karrick/godirwalk" "github.com/pkg/errors" ) func main() { if len(os.Args) < 2 { fmt.Fprintf(os.Stderr, "usage: %s dir1 [dir2 [dir3...]]\n", filepath.Base(os.Args[0])) os.Exit(2) } scratchBuffe...
<|file_name|>check_badges.py<|end_file_name|><|fim▁begin|>import sys import os from django.core.exceptions import ObjectDoesNotExist from django.core.management.base import BaseCommand, CommandError from workshops.models import Award, Badge, Person SKIP_DIRS = ['class'] class Command(BaseCommand): args = '/path...
<|file_name|>wrong-abi.rs<|end_file_name|><|fim▁begin|>// compile-flags: --target thumbv8m.main-none-eabi --crate-type lib // needs-llvm-components: arm #![feature(cmse_nonsecure_entry, no_core, lang_items)]<|fim▁hole|>#[no_mangle] #[cmse_nonsecure_entry] //~^ ERROR `#[cmse_nonsecure_entry]` requires C ABI [E0776] pub ...
#![no_core] #[lang="sized"] trait Sized { }
<|file_name|>log.py<|end_file_name|><|fim▁begin|><|fim▁hole|>------------- Provides a central logging facility. It is used to record log info and report both to a log file and stdout """ import sys import logging import traceback CLINT_AVAILABLE = True try: from clint.textui import puts, colored except: # Cli...
""" virtstrap.log
<|file_name|>x86.py<|end_file_name|><|fim▁begin|>from capstone import * from .architecture import Architecture from avatar2.installer.config import GDB_X86, OPENOCD class X86(Architecture): get_gdb_executable = Architecture.resolve(GDB_X86) get_oocd_executable = Architecture.resolve(OPENOCD) qemu_na...
class X86_64(X86):
<|file_name|>ve.init.mw.TargetEvents.js<|end_file_name|><|fim▁begin|>/*! * VisualEditor MediaWiki Initialization class. * * @copyright 2011-2015 VisualEditor Team and others; see AUTHORS.txt * @license The MIT License (MIT); see LICENSE.txt */ /** * Initialization MediaWiki Target Analytics. * * @class * * @...
noChanges: 'onNoChanges', serializeComplete: 'onSerializeComplete',
<|file_name|>encoder.go<|end_file_name|><|fim▁begin|>// Package twooffive can create interleaved and standard "2 of 5" barcodes. package twooffive import ( "errors" "fmt" "github.com/boombuler/barcode" "github.com/boombuler/barcode/utils" ) const patternWidth = 5 type pattern [patternWidth]bool type encodeInfo ...
'6': pattern{false, true, true, false, false}, '7': pattern{false, false, false, true, true}, '8': pattern{true, false, false, true, false},
<|file_name|>dao.py<|end_file_name|><|fim▁begin|>''' Created on Aug 29, 2015 @author: kevinchien ''' import datetime # from bson import ObjectId from tornado.gen import Task, Return from tornado.gen import coroutine from src.common.logutil import get_logger # from src.core.mongoutil import get_instance # # @coroutin...
# criteria = {"user_id": new_auth_info.get('user_id'), # "access_token": new_auth_info.get('access_token'), # "refresh_token": new_auth_info.get('refresh_token')}
<|file_name|>character.py<|end_file_name|><|fim▁begin|>import AI.pad import AI.state class Character: def __init__(self, pad_path): self.action_list = [] self.last_action = 0 self.pad = AI.pad.Pad(pad_path) self.state = AI.state.State() #Set False to enable character select...
<|file_name|>retrieve-map-item.6.x.py<|end_file_name|><|fim▁begin|># Download the Python helper library from twilio.com/docs/python/install from twilio.rest import Client # Your Account Sid and Auth Token from twilio.com/user/account<|fim▁hole|>auth_token = "your_auth_token" client = Client(account_sid, auth_token) m...
account_sid = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
<|file_name|>txt2json_parser.py<|end_file_name|><|fim▁begin|>import json from sets import Set from sys import maxint import math # tmp hacky functions for vec3 def norm2 (a): return dot(a, a) def dot ( a, b ): return a[0] * b[0] + a[1] * b[1] + a[2] * b[2] def area (a, b, c): u = [ b[0] - a[0], b[1] - a...
self.diagramJson.json['form']['vertices_external'] = dict.fromkeys(vertex_ex_set, 1)
<|file_name|>build.rs<|end_file_name|><|fim▁begin|>use std::env; <|fim▁hole|>use cargo::ops::CompileOptions; use cargo::ops; use cargo::util::important_paths::{find_root_manifest_for_cwd}; use cargo::util::{CliResult, CliError, Config}; #[derive(RustcDecodable)] struct Options { flag_package: Option<String>, f...
<|file_name|>AddressType.java<|end_file_name|><|fim▁begin|>package com.neemre.bitplexus.backend.model; import java.util.Date; import javax.persistence.Column; import javax.persistence.Entity; import javax.persistence.FetchType;<|fim▁hole|>import javax.persistence.GeneratedValue; import javax.persistence.GenerationTyp...
<|file_name|>build.rs<|end_file_name|><|fim▁begin|><|fim▁hole|>fn main() { // special case: sometimes the OpenCL library is squirreled away in C:\Windows\system32 if cfg!(windows) { println!("cargo:rustc-link-search=C:\\Windows\\system32") } }<|fim▁end|>
<|file_name|>gpulearn_z_x.py<|end_file_name|><|fim▁begin|>''' modified by Chongxuan Li (chongxuanli1991@gmail.com) ''' import sys sys.path.append('..') sys.path.append('../../data/') import os, numpy as np import scipy.io as sio import time import anglepy as ap import anglepy.paramgraphics as paramgraphics import ang...
x_test = {'x': test_x.astype(np.float32), 'mean_prior': test_mean_prior.astype(np.float32)} L_valid = 1 dim_input = (size,size) n_x = size*size
<|file_name|>s_3225.js<|end_file_name|><|fim▁begin|><|fim▁hole|><|fim▁end|>
search_result['3225']=["topic_00000000000007B9.html","ApplicantDetailRequestDto.Notes Property",""];
<|file_name|>sass.js<|end_file_name|><|fim▁begin|>'use strict'; module.exports = { compile: { options: { style: 'expanded',<|fim▁hole|> src : 'src/css/style.scss', dest : 'dist/css/style.css', }, };<|fim▁end|>
},
<|file_name|>index.js<|end_file_name|><|fim▁begin|>module.exports = [ require('./deepSouth'), require('./fallsRiverMusic')<|fim▁hole|><|fim▁end|>
// require('./gizmoBrewWorks') ];
<|file_name|>htmlinputelement.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/. */ use caseless::compatibility_caseless_match_str; use ...
} } #[allow(unrooted_must_root)]
<|file_name|>checks_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 Un...
CombinedOutputScript: []fakeexec.FakeCombinedOutputAction{ func() ([]byte, error) { return []byte("Kubernetes " + tc.kubeletVersion), nil }, }, }
<|file_name|>os_sys_calls_impl_hot_restart.cc<|end_file_name|><|fim▁begin|>#include "common/api/os_sys_calls_impl_hot_restart.h" #include <cerrno> namespace Envoy { namespace Api { SysCallIntResult HotRestartOsSysCallsImpl::shmOpen(const char* name, int oflag, mode_t mode) { const int rc = ::shm_open(name, oflag, ...
<|file_name|>createVariable.py<|end_file_name|><|fim▁begin|># encoding: latin1 """createVariable """ __author__ = "Juan C. Duque, Alejandro Betancourt, Juan Sebastian Marín" __credits__ = "Copyright (c) 2010-11 Juan C. Duque" __license__ = "New BSD License" __version__ = "1.0.0" __maintainer__ = "RiSE Group" __email__ ...
<|file_name|>test_stringutils.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- # vi:si:et:sw=4:sts=4:ts=4 ## ## Copyright (C) 2013 Async Open Source ## ## 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 Fr...
<|file_name|>math.rs<|end_file_name|><|fim▁begin|>use std::mem; pub use vecmath::{ Vector3, Matrix4, vec3_add, vec3_sub, vec3_scale, row_mat4_mul, row_mat4_transform, mat4_transposed, mat4_inv, mat4_id, }; pub use quaternion::id as quaternion_id; pub use quaternion::mul as quat...
let mut q = [0.0, 0.0, 0.0, 0.0]; let next = [1, 2, 0];
<|file_name|>a_sort.py<|end_file_name|><|fim▁begin|>import fileinput def str_to_int(s): return([ int(x) for x in s.split() ]) # args = [ 'line 1', 'line 2', ... ] def proc_input(args): return str_to_int(args[1]) def find(ints, offset): min = float('inf') min_index = -1 for k, v in enumerate(ints[offset:]): if...
else: solve(list(fileinput.input()), verbose=True)
<|file_name|>externs.js<|end_file_name|><|fim▁begin|>var GBYViewController = {}; GBYViewController.performSegueWithIdentifier = function() {}; GBYViewController.dismissViewControllerAnimated = function() {}; GBYViewController.interfaceOrientation = function() {}; GBYViewController.animateWithDurationAnimationsCompletio...
<|file_name|>expatreader.py<|end_file_name|><|fim▁begin|>""" SAX driver for the pyexpat C module. This driver works with pyexpat.__version__ == '2.22'. """ version = "0.20" from xml.sax._exceptions import * from xml.sax.handler import feature_validation, feature_namespaces from xml.sax.handler import feature_namespa...
elif name == feature_external_pes:
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|>from matplotlib.numerix import which if which[0] == "numarray": from numarray.linear_algebra.mlab import * elif which[0] == "numeric": from MLab import * elif which[0] == "numpy": try: from numpy.oldnumeric.mlab import * except ImportError: ...
else: raise RuntimeError("invalid numerix selector") amin = min
<|file_name|>main.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python2 # vim:fileencoding=utf-8 from __future__ import (unicode_literals, division, absolute_import, print_function) __license__ = 'GPL v3' __copyright__ = '2014, Kovid Goyal <kovid at kovidgoyal.net>' import sys, os, re from fu...
if self.revert_button_msg is not None: self.rvb = b = self.bb.addButton(self.revert_button_msg, self.bb.ActionRole) b.setIcon(QIcon(I('edit-undo.png'))), b.setAutoDefault(False) b.clicked.connect(self.revert_requested)
<|file_name|>parsers.py<|end_file_name|><|fim▁begin|>from copy import deepcopy from django.test import TestCase from django.core.exceptions import ValidationError from django.core import management from avocado.query import oldparsers as parsers from avocado.models import DataConcept, DataField, DataConceptField from ....
'INNER JOIN "tests_title" ON ("tests_employee"."title_id" = ' '"tests_title"."id") WHERE ("tests_employee"."first_name" = John '
<|file_name|>decoder.rs<|end_file_name|><|fim▁begin|>//! Implements the rustc_serialize::Decoder trait use std; use rustc_serialize::{Decoder,Decodable}; use types::{BasicValue,Value}; #[derive(Debug,PartialEq)] pub enum DecodeError { BadSignature, NotSupported, IntTooNarrow } pub struct DBusDecoder { ...
Err(DecodeError::NotSupported) } fn read_option<T, F>(&mut self, _f: F) -> Result<T, Self::Error> where F: FnMut(&mut Self, bool) -> Result<T, Self::Error> { Err(DecodeError::NotSupported)
<|file_name|>GeometryGather.cpp<|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/. */ #include "CarbonEngine/Common.h" #include "CarbonEng...
{ // Try and find an existing queue that uses the specified material, the current priority, and has no custom // parameters
<|file_name|>server_test.go<|end_file_name|><|fim▁begin|>package udf_test import ( "errors" "log" "os" "reflect" "testing" "time" "github.com/influxdata/kapacitor/models" "github.com/influxdata/kapacitor/udf" udf_test "github.com/influxdata/kapacitor/udf/test" ) func TestUDF_StartStop(t *testing.T) { u := ...
if err != nil { t.Fatal(err) }
<|file_name|>test_engines.py<|end_file_name|><|fim▁begin|>import pytest import salt.engines from tests.support.mock import MagicMock, patch<|fim▁hole|> def test_engine_module_name(): engine = salt.engines.Engine({}, "foobar.start", {}, {}, {}, {}, name="foobar") assert engine.name == "foobar" def test_engine...
<|file_name|>baSlimScroll.directive.ts<|end_file_name|><|fim▁begin|>import { Directive, Input, Output, ElementRef, EventEmitter, OnChanges } from '@angular/core'; import 'jquery-slimscroll'; @Directive({ selector: '[baSlimScroll]' }) export class BaSlimScroll implements OnChanges { @Input() public baSlimScrollOp...
this._destroy();
<|file_name|>permissions.py<|end_file_name|><|fim▁begin|>import functools from common.tornado_cookies import get_secure_cookie, generate_secure_cookie from core import cookies class Perms(object): NONE = None READ = 'r' WRITE = 'w' <|fim▁hole|> """ if not user.is_authenticated(): return Per...
def _permission_level(user, room): """ `user`'s permission level on `room`, ignoring cookies
<|file_name|>Mood.java<|end_file_name|><|fim▁begin|>package me.moodcat.api; import java.util.Arrays; import java.util.List; import java.util.Locale; import java.util.stream.Collectors; import lombok.Getter; import me.moodcat.database.embeddables.VAVector; import com.fasterxml.jackson.annotation.JsonFormat; import co...
.map(moodValue -> moodValue.getName()) .collect(Collectors.toList());
<|file_name|>integration_test.go<|end_file_name|><|fim▁begin|>// +build integration package docker import ( "encoding/json" "flag" "fmt" "io/ioutil" "net" "net/http" "net/http/httptest" "os" "path/filepath" "runtime" "testing" "time" "k8s.io/klog" dockertypes "github.com/docker/docker/api/types" dock...
l, err := net.Listen("tcp", ":23456") if err != nil { panic(err)
<|file_name|>LayerView.cpp<|end_file_name|><|fim▁begin|>#include "LayerView.h" #include "LayerWindow.h" #include "LayerItem.h" LayerView::LayerView (BRect frame, const char *name, CanvasView *_myView) : BView (frame, name, B_FOLLOW_ALL_SIDES, B_FRAME_EVENTS | B_WILL_DRAW) { fMyView = _myView; fFrame = frame; for (i...
}
<|file_name|>test_unix_pass_fd.rs<|end_file_name|><|fim▁begin|>use {TryRead, TryWrite}; use mio::*; use mio::deprecated::{EventLoop, Handler}; use mio::deprecated::unix::*; use bytes::{Buf, ByteBuf, SliceBuf}; use slab; use std::path::PathBuf; use std::io::{self, Read}; use std::os::unix::io::{AsRawFd, FromRawFd}; use ...
EchoConn { sock: sock, pipe_fd: None, token: None,
<|file_name|>service.rs<|end_file_name|><|fim▁begin|>extern crate proc_macro; use std::convert::From; use syn; use proc_macro::TokenStream; use proc_macro2::TokenStream as TokenStream2; use quote::{quote,ToTokens}; use super::utils::*; struct Service<'a> {<|fim▁hole|> idents_cap: Vec<syn::Ident>, args: Vec<V...
ast: &'a syn::ItemImpl, idents: Vec<syn::Ident>,
<|file_name|>boot2docker.go<|end_file_name|><|fim▁begin|>package provision import ( "errors" "github.com/docker/machine/drivers" "github.com/docker/machine/libmachine/provision/pkgaction" "github.com/docker/machine/log" "github.com/docker/machine/state" "github.com/docker/machine/utils" ) var ( ErrUnknownDriv...
<|file_name|>call_log.py<|end_file_name|><|fim▁begin|>from django.db import models from django_crypto_fields.fields import EncryptedTextField from edc_base.model.models import BaseUuidModel try: from edc_sync.mixins import SyncMixin except ImportError: SyncMixin = type('SyncMixin', (object, ), {}) from ..man...
)
<|file_name|>view.go<|end_file_name|><|fim▁begin|>package fastlanestat import ( "net/http" "html/template" // "fmt" // Import appengine urlfetch package, that is needed to make http call to the api "appengine" "appengine/datastore" ) type ViewContext struct { PricePoints []PricePoint...
t, _ := template.ParseFiles("templates/simple.htmltemplate") t.Execute(w, viewContext)
<|file_name|>DBToasterJoinComponent.java<|end_file_name|><|fim▁begin|>/* * * * Copyright (c) 2011-2015 EPFL DATA Laboratory<|fim▁hole|> * * * * 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. *...
* * Copyright (c) 2014-2015 The Squall Collaboration (see NOTICE)
<|file_name|>ui.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python # -*- coding: utf-8 -*- # @Author: omi # @Date: 2014-08-24 21:51:57 # @Last Modified by: omi # @Last Modified time: 2015-08-02 20:57:35 ''' 网易云音乐 Ui ''' import hashlib import re import curses import terminalsize from api import NetEase from scro...
else:
<|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", "django_backend_test.settings") <|fim▁hole|> from django.core.management import execute_from_command_line execute_from_command_line(sys.a...
<|file_name|>test_main.py<|end_file_name|><|fim▁begin|>""" Tests for main.py """ import pathlib import main def test_get_id(): path = pathlib.Path("./nbs/chapters/00-Introduction-to-the-course.ipynb") assert main.get_id(path) == "00" def test_get_id_with_no_id(): path = pathlib.Path("./nbs/other/Assessme...
path = pathlib.Path("./nbs/other/Assessment.ipynb") assert main.get_name(path) == "Assessment" def test_convert_html():
<|file_name|>htmlbrelement.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 https://mozilla.org/MPL/2.0/. */ use crate::dom::bindings::root::DomRoot; use crate::do...
<|file_name|>0009_auto_20190407_1443.py<|end_file_name|><|fim▁begin|># Generated by Django 2.1.7 on 2019-04-07 21:43 from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): dependencies = [ ('data_log', '0008_auto_20190402_2035'), ] opera...
migrations.AlterModelOptions( name='riftdungeonlog', options={'get_latest_by': 'timestamp', 'ordering': ('-timestamp',)},
<|file_name|>codeFixChangeJSDocSyntax20.ts<|end_file_name|><|fim▁begin|>/// <reference path='fourslash.ts' /><|fim▁hole|>verify.rangeAfterCodeFix("any");<|fim▁end|>
//// var index = { get p(): [|*|] { return 12 } };
<|file_name|>ContextUtils.java<|end_file_name|><|fim▁begin|>/* ========================================================================= * * Boarder * * http://boarder.mikuz.org/ * * =================...
public static void toast(Context context, String toast, int duration) { String errLogMsg = "Unable to toast message: \"" + toast + "\"";
<|file_name|>stb_image.cpp<|end_file_name|><|fim▁begin|>/* Copyright: stbi-1.33 - public domain JPEG/PNG reader - http://nothings.org/stb_image.c when you control the images you're loading no warranty implied; use at your own risk */ #include "graphics/image/stb_image.h" #inclu...
return feof((FILE*) user);
<|file_name|>TestErfcRelaxed.rs<|end_file_name|><|fim▁begin|><|fim▁hole|> * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distr...
/* * Copyright (C) 2016 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License");
<|file_name|>gulpfile.js<|end_file_name|><|fim▁begin|>var gulp = require('gulp') var mocha = require('gulp-mocha') var nodemon = require('gulp-nodemon') var env = require('gulp-env'); gulp.task('API-Server', (cb) => { let started = false env({ vars: { httpPort: 8080 } }); <|fim▁hole|> }) .on(...
return nodemon({ script: 'index.js'
<|file_name|>Controller.java<|end_file_name|><|fim▁begin|>package uk.co.lucelle; import org.springframework.web.bind.annotation.*; @RestController public class Controller { @RequestMapping("/") public @ResponseBody String index(@RequestBody String data) { // echo<|fim▁hole|> }<|fim▁end|>
return data; }
<|file_name|>Crafting.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python ''' Copyright (c) 2012 Jeremy Parks ( xanthic.9478 ) Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction...
items[tier]['insc'] = {'fine1':{},'fine2':{},'master':{}}
<|file_name|>GetText.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- class GetText(): _file_path = None _body_list = None _target = None def __init__(self, file_path): #self._file_path = open(file_path, "r+").read().replace("<br","\n<br") self._file_path = file_path.replace("...
<|file_name|>iam.py<|end_file_name|><|fim▁begin|># Copyright 2016-2017 Capital One Services, LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0...
matcher = self.get_eval_matcher() operator = self.data.get('match-operator', 'and') == 'and' and all or any
<|file_name|>AggregatableDataElementFilter.java<|end_file_name|><|fim▁begin|>package org.hisp.dhis.system.filter; /* * Copyright (c) 2004-2015, University of Oslo * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the fo...
* be used to endorse or promote products derived from this software without * specific prior written permission. *
<|file_name|>DialogsSearchAdapter.java<|end_file_name|><|fim▁begin|>/* * This is the source code of Telegram for Android v. 5.x.x. * It is licensed under GNU GPL v. 2 or later. * You should have received a copy of the license in this archive (see LICENSE). * * Copyright Nikolai Kudashov, 2013-2018. */ package or...
<|file_name|>views.py<|end_file_name|><|fim▁begin|>from django.shortcuts import render, render_to_response from django.contrib.auth import authenticate, login, logout from django.http import HttpResponse from django.http import HttpResponseRedirect from django.views.generic import ListView from bookrental.forms import ...
<|file_name|>mutex.rs<|end_file_name|><|fim▁begin|>use alloc::boxed::Box; use core::borrow::{Borrow, BorrowMut}; use core::ops::{Deref, DerefMut}; use core::cell::{Cell, RefCell, RefMut}; use crate::syscall; use core::marker::Sync; #[link(name="os_init", kind="static")] extern "C" { fn mutex_lock(lock: *m...
impl<T: ?Sized> Mutex<T> {
<|file_name|>test_parse_specific_case4.py<|end_file_name|><|fim▁begin|>import unittest, random, sys, time, os sys.path.extend(['.','..','../..','py']) import h2o, h2o_cmd, h2o_import as h2i import codecs, unicodedata print "create some specific small datasets with exp row/col combinations" print "This injects the full...
<|file_name|>ImageSpan.js<|end_file_name|><|fim▁begin|>'use strict'; Object.defineProperty(exports, "__esModule", { value: true }); var _css = require('antd/lib/message/style/css'); var _message = require('antd/lib/message'); var _message2 = _interopRequireDefault(_message); var _createClass = function () { func...
var editorState = _draftJsWhkfzyx.EditorState.createEmpty();
<|file_name|>merge.py<|end_file_name|><|fim▁begin|>from . elasticfactor import ElasticFactor from ... environment import cfg from elasticsearch import Elasticsearch def run(node): id_a, id_b = node.get('id_a', '63166071_1'), node.get('id_b', '63166071_2') es = Elasticsearch() data_a = es.get(index=...
constructor = ElasticFactor(cfg["cdr_elastic_search"]["hosts"] + cfg["cdr_elastic_search"]["index"]) merged = constructor.merge(data_a["_source"], data_b["_source"]) return merged
<|file_name|>wasp94_ut140801.py<|end_file_name|><|fim▁begin|>from wasp94_base import * # create a night to analyze from mosasaurus.Night import Night n = Night('ut140801', instrument=i) n.createNightlyLog(remake=False) # create an observation from mosasaurus.Observation import Observation o = Observation(t, i, n) o.s...
<|file_name|>is_api.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- from datetime import datetime, timedelta import time from openerp import pooler from openerp.osv import fields, osv from openerp.tools.translate import _ class is_api(osv.osv): _name = 'is_api' _description = u'Fonctions générales' ...
groups = self.get_usager_groups(cr, uid, usager_id, context=context) for group in groups: if group['code'] == 'G1':
<|file_name|>request_pool.py<|end_file_name|><|fim▁begin|># Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable l...
u'V6': { u'description': u'If set to "True", requesting IPv6 pool and ' u'vice-versa.', u'type': u'boolean',
<|file_name|>base.py<|end_file_name|><|fim▁begin|># TmLibrary - TissueMAPS library for distibuted image analysis routines. # Copyright (C) 2016 Markus D. Herrmann, University of Zurich and Robin Hafen # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero Genera...
<|file_name|>pstmt.go<|end_file_name|><|fim▁begin|>// Copyright 2015 Sergii Bogomolov. All rights reserved. // Use of this source code is governed by a MIT-style // license that can be found in the LICENSE file. // Package dbhelper helps to interact with sql.DB by generating, preparing and // executing queries. It mar...
if !sliceValue.IsValid() {
<|file_name|>chat_markers.py<|end_file_name|><|fim▁begin|># Copyright (C) 2018 Philipp Hörist <philipp AT hoerist.com> # # This file is part of nbxmpp. # # 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 Foun...
def __init__(self, client): BaseModule.__init__(self, client)
<|file_name|>Forbidden.ts<|end_file_name|><|fim▁begin|>import {Exception} from "../core/Exception";<|fim▁hole|> static readonly STATUS = 403; constructor(message: string, origin?: Error | string | any) { super(Forbidden.STATUS, message, origin); } }<|fim▁end|>
export class Forbidden extends Exception {
<|file_name|>quandl_data.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- import scrapy import numpy import quandl from mykgb import indicator from myapp.models import Quandlset from mykgb.items import MykgbItem quandl.ApiConfig.api_key = "taJyZN8QXqj2Dj8SNr6Z" quandl.ApiConfig.api_version = '2015-04-09' clas...
code_str = p.namezh + ' ' + p.exchange + ' ' + p.name else: code_str = p.exchange + ' ' + p.name
<|file_name|>Error.py<|end_file_name|><|fim▁begin|>class Error ( Exception ): """Exception class for Address exceptions""" <|fim▁hole|><|fim▁end|>
def __init__( self, message ) : Exception.__init__(self,message)
<|file_name|>Confirmation.js<|end_file_name|><|fim▁begin|>import Timeouts from 'platform/testing/e2e/timeouts'; class Confirmation { validatePageLoaded = () => { cy.get('h1', { timeout: Timeouts.slow }) .should('be.visible') .and('have.text', 'You’ve completed pre-check-in'); }; validatePageCont...
cy.get("p[data-testid='appointment-day-location']"); cy.get("[data-testid='appointment-list']"); cy.get("h3[data-testid='appointment-questions']") .should('be.visible')
<|file_name|>init.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 https://mozilla.org/MPL/2.0/. */ use crate::dom::bindings::codegen::RegisterBindings; use crate:...
const MAX_FILE_LIMIT: libc::rlim_t = 4096;