prompt
large_stringlengths
70
991k
completion
large_stringlengths
0
1.02k
<|file_name|>test.py<|end_file_name|><|fim▁begin|>import sys, unittest, os sys.path.append(os.path.realpath(os.path.dirname(__file__))+'/lib') tests_folder = os.path.realpath(os.path.dirname(__file__))+'/tests' from tests import ConsoleTestRunner def load_tests(loader, tests, pattern): suite = unittest.TestSuite()...
for test_suite in all_test_suite: suite.addTest(test_suite)
<|file_name|>wagtailimages_tags.py<|end_file_name|><|fim▁begin|>import re from django import template<|fim▁hole|>from wagtail.images.models import Filter from wagtail.images.shortcuts import get_rendition_or_not_found from wagtail.images.views.serve import generate_image_url register = template.Library() allowed_fil...
from django.core.exceptions import ImproperlyConfigured from django.urls import NoReverseMatch from django.utils.functional import cached_property
<|file_name|>TextInputExample.android.js<|end_file_name|><|fim▁begin|>/** * Copyright (c) 2013-present, Facebook, Inc. * All rights reserved. * * This source code is licensed under the BSD-style license found in the * LICENSE file in the root directory of this source tree. An additional grant * of patent rights c...
<TextInput
<|file_name|>drawing.rs<|end_file_name|><|fim▁begin|>use std::char; use std::cmp::{max, min}; use std::collections::VecDeque; use num::{Complex, Float}; use rustty::{Attr, Color, Terminal, Cell, CellAccessor, HasSize}; use rustty::ui::{Alignable, Widget, VerticalAlign, HorizontalAlign}; use itertools::{Itertools, Eithe...
.map(|x| x / max_db) .collect() }
<|file_name|>test_windowwithcount.py<|end_file_name|><|fim▁begin|>import unittest from rx.observable import Observable from rx.testing import TestScheduler, ReactiveTest<|fim▁hole|>on_error = ReactiveTest.on_error subscribe = ReactiveTest.subscribe subscribed = ReactiveTest.subscribed disposed = ReactiveTest.disposed ...
from rx.disposables import Disposable, SerialDisposable on_next = ReactiveTest.on_next on_completed = ReactiveTest.on_completed
<|file_name|>nsis.js<|end_file_name|><|fim▁begin|>/* ***** BEGIN LICENSE BLOCK ***** * Distributed under the BSD license: * * Copyright (c) 2012, Ajax.org B.V. * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following c...
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
<|file_name|>algorithm_base.py<|end_file_name|><|fim▁begin|>__author__ = 'jdaniel' import copy import random import itertools import operator import math import struct import os import sys import json from collections import defaultdict class AlgorithmBase(object): def __init__(self, objective_function): ...
self.check_migrants(value) self._migrants = value elif option == 'spheres':
<|file_name|>shutter.py<|end_file_name|><|fim▁begin|>import serial import struct import time # j = 2 means open, j = 1 means close shutter def command_shutter(port, j): # first, start the serial port to communicate with the arduino if port.isOpen(): print "port open" port.write(struct.pack('>B...
return 1
<|file_name|>10394.js<|end_file_name|><|fim▁begin|>{ if (Array.isArray(t) && c(e))<|fim▁hole|> return (t.length = Math.max(t.length, e)), t.splice(e, 1, n), n; if (d(t, e)) return (t[e] = n), n; var r = t.__ob__; return t._isVue || (r && r.vmCount) ? n : r ? (D(r.value, e, n), r.dep.notify(), n) : ((...
<|file_name|>glue.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 atomic_refcell::AtomicRefMut; use cssparser::Parser; use css...
<|file_name|>kindck-nonsendable-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 // http://www.apach...
<|file_name|>windows.py<|end_file_name|><|fim▁begin|><|fim▁hole|><|fim▁end|>
../../../../../../share/pyshared/ubuntu-sso-client/ubuntu_sso/xdg_base_directory/windows.py
<|file_name|>wsgi.py<|end_file_name|><|fim▁begin|>""" WSGI config for hpt project. <|fim▁hole|>https://docs.djangoproject.com/en/1.9/howto/deployment/wsgi/ """ import os from django.core.wsgi import get_wsgi_application os.environ.setdefault("DJANGO_SETTINGS_MODULE", "hpt.settings") application = get_wsgi_applicatio...
It exposes the WSGI callable as a module-level variable named ``application``. For more information on this file, see
<|file_name|>macro_crate_test.rs<|end_file_name|><|fim▁begin|>// Copyright 2013-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.apac...
if let ast::MetaItem_::MetaWord(ref w) = xs[0].node { token::str_to_ident(&w) } else { cx.span_err(mi.span, "Expected word");
<|file_name|>StiRadarAreaSeries.java<|end_file_name|><|fim▁begin|><|fim▁hole|> * Could not load the following classes: * com.stimulsoft.base.drawing.StiBrush * com.stimulsoft.base.drawing.StiColor * com.stimulsoft.base.drawing.StiSolidBrush * com.stimulsoft.base.drawing.enums.StiPenStyle * com.stimulsoft.base...
/* * Decompiled with CFR 0_114. *
<|file_name|>run.py<|end_file_name|><|fim▁begin|>import sys import os sys.path.append(os.path.join(os.path.dirname(__file__), '..')) import logging.config from flask import Flask, Blueprint from werkzeug.contrib.fixers import ProxyFix from ceep_api import settings from ceep_api.api import restplus from ceep_api.api...
def initialize_app(flask_app): log.debug('Initialize APP...')
<|file_name|>cfg-attr-crate.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/...
#![cfg_attr(not_used, no_core)] fn main() { }
<|file_name|>gradient_optimizer.py<|end_file_name|><|fim▁begin|>import numpy as np import theano import theano.tensor as T class GradientOptimizer: def __init__(self, lr): self.lr = lr def __call__(self, cost, params): pass @property def learningRate(self): return self.lr ...
self.mu = mu
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|><|fim▁hole|> __author__ = 'Michael Joseph' __email__ = 'michaeljoseph@gmail.com' __url__ = 'https://github.com/michaeljoseph/sealeyes' __version__ = '0.0.1' def sealeyes(): return 'Hello World!'<|fim▁end|>
"""Python Library Boilerplate contains all the boilerplate you need to create a Python package."""
<|file_name|>row.go<|end_file_name|><|fim▁begin|>package godependencies import ( "github.com/goatcms/goatcli/cliapp/common/config" ) // SetRow is single record in Set type SetRow struct { Dependency *config.Dependency Imported bool } // SetImported update imported value func (row *SetRow) SetImported(value bool...
row.Imported = value
<|file_name|>arkanoid.cpp<|end_file_name|><|fim▁begin|>// license:BSD-3-Clause // copyright-holders:Brad Oliver /*************************************************************************** arkanoid.cpp Functions to emulate the video hardware of the machine. *******************************************************...
m_gfxdecode->gfx(0)->transpen(bitmap,cliprect, 2 * code + 1, ((m_spriteram[offs + 2] & 0xf8) >> 3) + 32 * m_palettebank,
<|file_name|>telnetFlowMeasure.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python import pexpect import traceback import time import os import sys import re addr = 'telnet 192.168.99.1 10000' uname = ['a', 'd', 'm', 'i', 'n'] passwd = ['p', 'a', 's', 's', 'w', 'd'] cmdline = "show statistics traffic 5/1/0-1\n" qq =...
<|file_name|>issue-55394.rs<|end_file_name|><|fim▁begin|>// Copyright 2017 The Rust Project Developers. See the COPYRIGHT // file at the top-level directory of this distribution and at // http://rust-lang.org/COPYRIGHT. // // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or // http://www.apache.org/lic...
<|file_name|>pushFile.go<|end_file_name|><|fim▁begin|>package main import ( "fmt" "os" "github.com/Cloud-Foundations/Dominator/lib/filesystem" "github.com/Cloud-Foundations/Dominator/lib/log" objclient "github.com/Cloud-Foundations/Dominator/lib/objectserver/client" "github.com/Cloud-Foundations/Dominator/lib/s...
<|file_name|>ws_BinaryClass_10_LogisticRegression_db2_code_gen.py<|end_file_name|><|fim▁begin|>from sklearn2sql_heroku.tests.classification import generic as class_gen <|fim▁hole|><|fim▁end|>
class_gen.test_model("LogisticRegression" , "BinaryClass_10" , "db2")
<|file_name|>mock_readelf.py<|end_file_name|><|fim▁begin|># Copyright 2017 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. import os import sys _HEADERS = """ELF Header: Magic: 7f 45 4c 46 01 01 01 00 00 00 00 00 00 ...
[ 9] .rel.dyn REL 00003904 003904 288498 08 A 3 0 4
<|file_name|>format_tree_and_trait_table.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python # File created on 15 Jul 2011 from __future__ import division __author__ = "Jesse Zaneveld" __copyright__ = "Copyright 2011-2013, The PICRUSt Project" __credits__ = ["Jesse Zaneveld","Morgan Langille"] __license__ = "GPL" __...
tree -- a PyCogent PhyloNode object"""
<|file_name|>auth_token.py<|end_file_name|><|fim▁begin|>import re from keystonemiddleware import auth_token from oslo_log import log from nca47.common import exception from nca47.common.i18n import _ from nca47.common import utils LOG = log.getLogger(__name__) <|fim▁hole|>class AuthTokenMiddleware(auth_token.AuthPr...
<|file_name|>collision_objects_dispatcher.rs<|end_file_name|><|fim▁begin|>use utils::data::hash_map::HashMap; use utils::data::pair::{Pair, PairTWHash}; use utils::data::uid_remap::{UidRemap, FastKey}; use queries::geometry::Contact; use narrow_phase::{CollisionDispatcher, CollisionAlgorithm, ContactSignal, ContactSign...
<|file_name|>test_descriptor.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/lice...
<|file_name|>good.js<|end_file_name|><|fim▁begin|>// Modules const Config = require('../config/main'), Good = require('good'); module.exports = { options: Config.HAPI.GOOD_OPTIONS, register: Good<|fim▁hole|>};<|fim▁end|>
<|file_name|>sprites.py<|end_file_name|><|fim▁begin|>class Sprite(object): def __init__(self, xPos, yPos): self.x = xPos self.y = yPos self.th = 32 self.tw = 32 def checkCollision(self, otherSprite): if (self.x < otherSprite.x + otherSprite.tw and otherSprite.x ...
self.dx = self.speed
<|file_name|>tempus_winter.js<|end_file_name|><|fim▁begin|>black = '#202427'; red = '#EB6A58'; // red green = '#49A61D'; // green yellow = '#959721'; // yellow blue = '#798FB7'; // blue magenta = '#CD7B7E'; // pink cyan = '#4FA090'; // cyan white = '#909294'; // light gr...
lightYellow = '#AD8E4B'; // yellow
<|file_name|>completions.rs<|end_file_name|><|fim▁begin|>extern crate regex; extern crate clap; use clap::{App, Arg, SubCommand, Shell}; use regex::Regex; static BASH: &'static str = r#"_myapp() { local i cur prev opts cmds COMPREPLY=() cur="${COMP_WORDS[COMP_CWORD]}" prev="${COMP_WORDS[COMP_CWORD-1]}...
'test' { $command += '_test'
<|file_name|>permissions.py<|end_file_name|><|fim▁begin|>from rest_framework import permissions<|fim▁hole|> if request.method == 'POST': return True return super(IsAuthenticatedOrCreate, self).has_permission(request, view) class IsOwner(BasePermission): message = "You must be the owner o...
from rest_framework.permissions import BasePermission class IsAuthenticatedOrCreate(permissions.IsAuthenticated): def has_permission(self, request, view):
<|file_name|>test_reference_resolver.py<|end_file_name|><|fim▁begin|># Copyright 2017 AT&T Intellectual Property. All other 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 #...
'Authorization') == auth_header
<|file_name|>raygun_send_test.js<|end_file_name|><|fim▁begin|>"use strict"; var test = require("tap").test; var semver = require("semver"); var VError = require("verror"); var nock = require("nock"); var Raygun = require("../lib/raygun.ts"); nock(/.*/) .post(/.*/, function () { return true; }) .reply(202, ...
<|file_name|>BusScheduleServlet.java<|end_file_name|><|fim▁begin|>/* * ************************************************************************* * Copyright (C) FRS Belgium NV ("FRSGlobal"). All rights reserved. * * This computer program is protected by copyright law and international * treaties. Unauthorized repr...
import javax.servlet.ServletException; import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse;
<|file_name|>account_invoice_replace.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- # Copyright 2018, Esther Cisneros # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). from datetime import timedelta from openerp import _, api, fields, models from openerp.exceptions import UserError class ...
'auto_delete': True, 'message_type': 'comment',
<|file_name|>traits-default-method-macro.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|> ...
// 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|>msgarea.py<|end_file_name|><|fim▁begin|># This file is part of the Hotwire Shell user interface. # # Copyright (C) 2007,2008 Colin Walters <walters@verbum.org> # # 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 # t...
w.window, gtk.STATE_NORMAL,
<|file_name|>test_raw_bltzall_lt_back.py<|end_file_name|><|fim▁begin|>#- # Copyright (c) 2011 Steven J. Murdoch # All rights reserved. # # This software was developed by SRI International and the University of # Cambridge Computer Laboratory under DARPA/AFRL contract FA8750-10-C-0237 # ("CTSRD"), as part of the DARPA C...
# Licensed to BERI Open Systems C.I.C. (BERI) under one or more contributor # license agreements. See the NOTICE file distributed with this work for
<|file_name|>utils.py<|end_file_name|><|fim▁begin|>''' This file holds globally useful utility classes and functions, i.e., classes and functions that are generic enough not to be specific to one app. ''' import logging import os import re<|fim▁hole|> from django.conf import settings # Setup logging support. LOGGER =...
import sys from datetime import tzinfo, timedelta
<|file_name|>debug.go<|end_file_name|><|fim▁begin|>package http import ( bm "go-common/library/net/http/blademaster" ) func debugCache(c *bm.Context) { opt := new(struct { Keys string `form:"keys" validate:"required"` })<|fim▁hole|> return } c.JSONMap(srv.DebugCache(opt.Keys), nil) }<|fim▁end|>
if err := c.Bind(opt); err != nil {
<|file_name|>apitest_args.cpp<|end_file_name|><|fim▁begin|>/* * Copyright 2006-2014 The FLWOR Foundation. * * 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/lice...
PARSE_ARG( "--external-var" ); string key, value; if ( !split_key_value( ARG_VAL, "=", &key, &value ) ) {
<|file_name|>creation.py<|end_file_name|><|fim▁begin|>from django.conf import settings from django.db.backends.creation import BaseDatabaseCreation class DatabaseCreation(BaseDatabaseCreation): # This dictionary maps Field objects to their associated MySQL column # types, as strings. Column-type strings can co...
return [], True
<|file_name|>sensor_list.tsx<|end_file_name|><|fim▁begin|>import * as React from "react"; import { readPin } from "../../devices/actions"; import { SensorListProps } from "./interfaces"; import { sortResourcesById } from "../../util"; import { Row, Col } from "../../ui"; import { isNumber } from "lodash"; import { ALLO...
<|file_name|>apptest.go<|end_file_name|><|fim▁begin|>package tests import ( log "github.com/janekolszak/revfluent" "github.com/revel/revel/testing" ) type AppTest struct { testing.TestSuite } func (t *AppTest) TestError() { data := map[string]string{"message": "Error"} log.Error(data) }<|fim▁hole...
func (t *AppTest) TestDebug() {
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|>from .iqr_session import IqrSession<|fim▁hole|> 'IqrController', 'IqrSession', ]<|fim▁end|>
from .iqr_controller import IqrController __all__ = [
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|># -*- coding: UTF-8 -*- from datetime import datetime from threading import Timer from queue import Queue import uuid import logging #Fallbacl for python < 3.3 try: from time import perf_counter except ImportError: from time import clock as perf_counter log...
if obj is None: return self
<|file_name|>views.py<|end_file_name|><|fim▁begin|>""" Views to support bulk email functionalities like opt-out. """ import logging from six import text_type from django.contrib.auth.models import User from django.http import Http404 from bulk_email.models import Optout from courseware.courses import get_course_by...
course_key = CourseKey.from_string(course_id)
<|file_name|>mdsViewer.js<|end_file_name|><|fim▁begin|>/* Chronic Disease Report Generator - Web based reports on quality of care standards Copyright (C) 2015 Brice Wong, Tom Sitter, Kevin Lin - Hamilton Family Health Team This program is free software: you can redistribute it and/or modify it under the ...
<|file_name|>qaudioinput_win32_p.cpp<|end_file_name|><|fim▁begin|>/**************************************************************************** ** ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** ** This file is part of the...
return 0; qint64 result = qint64(1000000) * totalTimeValue /
<|file_name|>operator-filter.pipe.ts<|end_file_name|><|fim▁begin|>import { Pipe, PipeTransform } from '@angular/core'; import { Project } from 'app/models/project'; @Pipe({ name: 'operatorFilter' }) export class OperatorFilterPipe implements PipeTransform { transform(value: Project[], q: string) { if (!q) { ...
} }
<|file_name|>dromaeo.py<|end_file_name|><|fim▁begin|># Copyright 2013 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. import os from metrics import power from telemetry import test from telemetry.core import util from tel...
tag = 'jslibattrprototype' query_param = 'jslib-attr-prototype'
<|file_name|>conf.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- # # complexity documentation build configuration file, created by # sphinx-quickstart on Tue Jul 9 22:26:36 2013. # # This file is execfile()d with the current directory set to its containing dir. # # Note that not all possible configuration val...
<|file_name|>ProcessMonitor.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python # -*- coding: utf-8 -*- #*/1 * * * * python /xxx/monitor.py >> /xxx/logs/monitor.log 2>&1 & import sys import subprocess import os.path as op import socket def this_abs_path(script_name): return op.abspath(op.join(op.dirname(__file...
p2 = subprocess.Popen(['grep', key_word], stdin=p1.stdout, stdout=subprocess.PIPE) p3 = subprocess.Popen(['grep', '-v', 'grep'], stdin=p2.stdout, stdout=subprocess.PIPE) lines = p3.stdout.readlines()
<|file_name|>KMCCommandExecutionEvent.java<|end_file_name|><|fim▁begin|>package net.diecode.killermoney.events; import net.diecode.killermoney.objects.CCommand; import org.bukkit.entity.LivingEntity; import org.bukkit.entity.Player; import org.bukkit.event.Cancellable; import org.bukkit.event.Event;<|fim▁hole|>public ...
import org.bukkit.event.HandlerList;
<|file_name|>replace.rs<|end_file_name|><|fim▁begin|>macro_rules! replace( ($name:ident, $which:ident, $re:expr, $search:expr, $replace:expr, $result:expr) => ( #[test] fn $name() { let re = regex!($re); assert_eq!(re.$which(text!($search), $replace), text!($result)); ...
); replace!( impl_vec_u8,
<|file_name|>proc_cmdline.go<|end_file_name|><|fim▁begin|>// Copyright 2015 CoreOS, 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/LICENSE-2...
} func (c *ProcCmdline) IsAvailable() bool { var contents []byte
<|file_name|>daysBetweenDates.py<|end_file_name|><|fim▁begin|># Define a daysBetweenDates procedure that would produce the # correct output if there was a correct nextDay procedure. # # Udacity course work def isLeapYear(year): if year % 400 == 0: return True if year % 100 == 0: return False ...
def daysBetweenDates(year1, month1, day1, year2, month2, day2): """Returns the number of days between year1/month1/day1 and year2/month2/day2. Assumes inputs are valid dates
<|file_name|>hero.service.ts<|end_file_name|><|fim▁begin|>import { Injectable } from '@angular/core'; import { Http, Headers } from '@angular/http'; import { Hero } from './hero'; import 'rxjs/add/operator/toPromise' @Injectable() export class HeroService { private heroesUrl = 'app/heroes'; // URL to web api co...
<|file_name|>config.py<|end_file_name|><|fim▁begin|># Copyright 2014 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. import ast import os.path import platform import re import sys class Config(object): '''A Config con...
def target_cpu(self): '''CPU arch of the build/test target.''' return self.values['target_cpu']
<|file_name|>creatorpacket.cpp<|end_file_name|><|fim▁begin|>// This file is part of par2cmdline (a PAR 2.0 compatible file verification and // repair tool). See http://parchive.sourceforge.net for details of PAR 2.0. // // Copyright (c) 2003 Peter Brian Clements // // par2cmdline is free software; you can redistrib...
return true; } // Load the packet from disk.
<|file_name|>SmoozedComHook.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- from module.plugins.internal.MultiHook import MultiHook class SmoozedComHook(MultiHook): __name__ = "SmoozedComHook" __type__ = "hook" __version__ = "0.04" __status__ = "testing" __config__ = [("pluginmode...
<|file_name|>lookup_ops_test.py<|end_file_name|><|fim▁begin|># Copyright 2017 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...
<|file_name|>not_in_sample.py<|end_file_name|><|fim▁begin|>__author__ = "Christian Kongsgaard" __license__ = 'MIT' # -------------------------------------------------------------------------------------------------------------------- # # IMPORTS # Modules # RiBuild Modules from delphin_6_automation.database_interact...
<|file_name|>dom_html_base_font_element.rs<|end_file_name|><|fim▁begin|>// This file was generated by gir (https://github.com/gtk-rs/gir) // from gir-files (https://github.com/gtk-rs/gir-files) // DO NOT EDIT <|fim▁hole|>use DOMElement; use DOMEventTarget; use DOMHTMLElement; use DOMNode; use DOMObject; use glib::GStri...
<|file_name|>HPCJob.py<|end_file_name|><|fim▁begin|>import argparse import logging import os import sys from mpi4py import MPI from pandayoda.yodacore import Yoda from pandayoda.yodaexe import Droid import logging logging.basicConfig(level=logging.DEBUG) def main(globalWorkDir, localWorkDir): comm = MPI.COMM_WO...
yoda.run() else: droid = Droid.Droid(globalWorkDir, localWorkDir) droid.run()
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|>from .plot_widget import PlotWidget from .filter_popup import FilterPopup from .filterable_kw_list_model import FilterableKwListModel from .data_type_keys_list_model import DataTypeKeysListModel from .data_type_proxy_model import DataTypeProxyModel from .data_type...
from .plot_case_model import PlotCaseModel from .plot_case_selection_widget import CaseSelectionWidget
<|file_name|>setup.py<|end_file_name|><|fim▁begin|>######## # Copyright (c) 2013 GigaSpaces Technologies Ltd. All rights reserved # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # ht...
version = '0.3'
<|file_name|>workqueue.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 work queue for scheduling units of work across thread...
// Wait for the work to finish.
<|file_name|>PacketHandler.cpp<|end_file_name|><|fim▁begin|>#include "Log.h" #include "../PacketShare/PacketType.h" #include "ClientSession.h" #include "GameLiftManager.h" //@{ Handler Helper typedef std::shared_ptr<ClientSession> ClientSessionPtr; typedef void(*HandlerFunc)(ClientSessionPtr session); static Handl...
} /////////////////////////////////////////////////////////
<|file_name|>JBScrollPane.java<|end_file_name|><|fim▁begin|>/* * Copyright 2000-2016 JetBrains s.r.o. * * 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...
private void init() { init(true); }
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|>"""Pytrafikverket module.""" # flake8: noqa from pytrafikverket.trafikverket import (AndFilter, FieldFilter, FieldSort, Filter, FilterOperation, NodeHelper, OrFilter, SortOrder, Trafik...
FerryStop, FerryStopStatus)
<|file_name|>HttpRequestLogger.java<|end_file_name|><|fim▁begin|><|fim▁hole|>package com.azure.core.http.policy; import com.azure.core.util.logging.ClientLogger; import com.azure.core.util.logging.LogLevel; import reactor.core.publisher.Mono; /** * Manages logging HTTP requests in {@link HttpLoggingPolicy}. */ @Fun...
// Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License.
<|file_name|>test-type.rs<|end_file_name|><|fim▁begin|>// compile-flags: --test --test-args=--test-threads=1 // check-pass // normalize-stdout-test: "src/test/rustdoc-ui" -> "$$DIR" // normalize-stdout-test "finished in \d+\.\d+s" -> "finished in $$TIME" /// ``` /// let a = true; /// ``` /// ```should_panic /// panic!...
<|file_name|>test_artificial_32_RelativeDifference_LinearTrend_5__0.py<|end_file_name|><|fim▁begin|>import pyaf.Bench.TS_datasets as tsds import tests.artificial.process_artificial_dataset as art <|fim▁hole|><|fim▁end|>
art.process_dataset(N = 32 , FREQ = 'D', seed = 0, trendtype = "LinearTrend", cycle_length = 5, transform = "RelativeDifference", sigma = 0.0, exog_count = 0, ar_order = 0);
<|file_name|>issue-47312.rs<|end_file_name|><|fim▁begin|>// check-pass // ignore-pretty pretty-printing is unhygienic #![feature(decl_macro)] #![allow(unused)] mod foo { pub macro m($s:tt, $i:tt) { $s.$i } } mod bar { struct S(i32); fn f() { let s = S(0); ::foo::m!(s, 0); ...
fn main() {}
<|file_name|>conf.py<|end_file_name|><|fim▁begin|>import getpass import json import getopt from genericpath import isfile from os.path import sep from pingdumb.main_module import url_type def read_config(): f_path = "." + sep + "pingdumb.json" if not isfile(f_path): f = open(f_path, 'w') conf...
return conf else: f = open(f_path, 'r+b') conf = json.loads(f.read().decode('utf-8'))
<|file_name|>roerrorapi.rs<|end_file_name|><|fim▁begin|>// Copyright © 2017 winapi-rs developers // Licensed under the Apache License, Version 2.0 // <LICENSE-APACHE or http://www.apache.org/licenses/LICENSE-2.0> or the MIT license // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your option. // All files in ...
RO_ERROR_REPORTING_NONE = 0x00000000, RO_ERROR_REPORTING_SUPPRESSEXCEPTIONS = 0x00000001,
<|file_name|>O2.4 SS, Single agent model.py<|end_file_name|><|fim▁begin|>import complexism as cx import complexism.agentbased.statespace as ss import epidag as dag dbp = cx.read_dbp_script(cx.load_txt('../scripts/SIR_BN.txt')) pc = dag.quick_build_parameter_core(cx.load_txt('../scripts/pSIR.txt')) dc = dbp.generate_m...
<|file_name|>models.py<|end_file_name|><|fim▁begin|>from __future__ import unicode_literals from django.db import models import datetime from django.db.models.signals import pre_save from django.urls import reverse from django.utils.text import slugify from django.utils.translation import ugettext_lazy as _ from sou...
) prep_material = models.DecimalField( default=0,
<|file_name|>application.js<|end_file_name|><|fim▁begin|><|fim▁hole|>//= require assets/templates/user<|fim▁end|>
<|file_name|>image.rs<|end_file_name|><|fim▁begin|><|fim▁hole|>include!(concat!(env!("OUT_DIR"), "/sdl_image_bindings.rs"));<|fim▁end|>
<|file_name|>qlayout_ref_test.py<|end_file_name|><|fim▁begin|><|fim▁hole|> import unittest from sys import getrefcount from PySide.QtGui import QHBoxLayout, QVBoxLayout, QGridLayout, QWidget from PySide.QtGui import QStackedLayout, QFormLayout from PySide.QtGui import QApplication, QPushButton, QLabel from helper imp...
'''Test cases for QLayout handling of child widgets references'''
<|file_name|>hmacHash.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- """ hmacHash.py Implemention of Request for Comments: 2104 HMAC: Keyed-Hashing for Message Authentication HMAC is a mechanism for message authentication using cryptographic hash functions. HMAC can be used with any iter...
def digest(self): if self.keyed == None : raise 'no key defined' return self.H_outer(self.k_xor_opad+self.H.digest())
<|file_name|>Game.js<|end_file_name|><|fim▁begin|>/** * @author Richard Davey <rich@photonstorm.com> * @copyright 2016 Photon Storm Ltd. * @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License} */ /** * This is where the magic happens. The Game object is the heart of y...
}
<|file_name|>server.rs<|end_file_name|><|fim▁begin|>//! A low-level interface to send and receive server-client protocol messages use std; use std::sync::{Arc, Mutex}; use std::sync::mpsc::{Sender, Receiver, TryRecvError}; use std::sync::atomic::{Ordering, AtomicUsize}; use bincode; use common::protocol; use common...
let (send_send, send_recv) = std::sync::mpsc::channel(); let (recv_send, recv_recv) = std::sync::mpsc::channel(); let _recv_thread ={
<|file_name|>corecd.py<|end_file_name|><|fim▁begin|># # corecd.py # # Copyright (C) 2014 Fabio Erculiani # # 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 # (...
dmrc = None def configure(self, anaconda):
<|file_name|>iterable_differs.d.ts<|end_file_name|><|fim▁begin|>import { ChangeDetectorRef } from '../change_detector_ref'; import { Provider } from 'angular2/src/core/di'; export interface IterableDiffer { diff(object: Object): any; onDestroy(): any; } /** * Provides a factory for {@link IterableDiffer...
* The following example shows how to extend an existing list of factories, * which will only be applied to the injector for this component and its children. * This step is all that's required to make a new {@link IterableDiffer} available. *
<|file_name|>basic.ts<|end_file_name|><|fim▁begin|>export const data = [ { id: 549731, name: 'Beautiful Lies', artist: 'Birdy', release: '2016.03.26', type: 'Deluxe', typeCode: '1', genre: 'Pop', genreCode: '1', grade: '4', price: 10000, downloadCount: 1000, listenCount...
price: 12000,
<|file_name|>events.js<|end_file_name|><|fim▁begin|>/** @license MIT License (c) copyright B Cavalier & J Hann */ /** * wire/dojo/events plugin * wire plugin that can connect event handlers after an object is * initialized, and disconnect them when an object is destroyed. * This implementation uses dojo.connect an...
"eventOrMethodOfOtherThing": "myOwnMethod" }, "dom!myButton": {
<|file_name|>proxy_logging.py<|end_file_name|><|fim▁begin|># Copyright (C) 2020 OpenIO SAS # # 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 # # U...
return flat_dict def perfdata_to_str(perfdata):
<|file_name|>active.py<|end_file_name|><|fim▁begin|>import re from django import template<|fim▁hole|>from django.core.urlresolvers import NoReverseMatch from django.core.urlresolvers import reverse register = template.Library() @register.simple_tag(takes_context=True) def active(context, name): try: pa...
<|file_name|>skate.js<|end_file_name|><|fim▁begin|>(function (global, factory) { if (typeof define === 'function' && define.amd) { define(['exports', 'module', 'skatejs'], factory); } else if (typeof exports !== 'undefined' && typeof module !== 'undefined') { factory(exports, module, require('skatejs')); ...
var auiSkate = _skate['default'].noConflict(); module.exports = auiSkate; });
<|file_name|>Naive Bayes Classifier - Copie.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python # Wheat price prediction using Baysian classification. # Version 1.0 # Christophe Foyer - 2016 from xlrd import open_workbook import random import math #set filename: filename = 'Wheat-price-data.xlsx' #import wheat ...
result = predict(summaries, testSet[i]) predictions.append(result)
<|file_name|>alarmsetting.py<|end_file_name|><|fim▁begin|>from utils.face import Face import pygame from utils.message import Message from utils.alarm import Alarm class Button(pygame.sprite.Sprite): def __init__(self, rect, color=(0,0,255), action=None): pygame.sprite.Sprite.__init__(self) se...
rect = self.baseImage.get_rect() self.image.fill(pygame.Color("black")) pygame.draw.circle(self.baseImage, self.color, rect.center, rect.width/2, 1);
<|file_name|>chat_client.py<|end_file_name|><|fim▁begin|># chat_client.py import sys, socket, select def chat_client(): if(len(sys.argv) < 3) : print 'Usage : python chat_client.py hostname port' sys.exit() host = sys.argv[1] port = int(sys.argv[2]) s = socket.socket(socket.AF_INET, ...
sys.stdout.write(data)
<|file_name|>main.py<|end_file_name|><|fim▁begin|># Copyright 2019 Tecnativa - Sergio Teruel # License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). from odoo.addons.website_sale.controllers.main import WebsiteSale from odoo import http<|fim▁hole|> @http.route() def product(self, product, category='', ...
class WebsiteSaleProductDetailAttributeImage(WebsiteSale):