prompt
large_stringlengths
70
991k
completion
large_stringlengths
0
1.02k
<|file_name|>wide_deep.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.apache....
# # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS,
<|file_name|>splinter_test.py<|end_file_name|><|fim▁begin|>from splinter import Browser from time import sleep from selenium.common.exceptions import ElementNotVisibleException from settings import settings from lib import db from lib import assets_helper import unittest from datetime import datetime, timedelta asset_...
<|file_name|>modulecontrol.js<|end_file_name|><|fim▁begin|>/** * Created by Tomas Kulhanek on 1/16/17. */ //import {HttpClient} from 'aurelia-http-client'; import {ProjectApi} from "../components/projectapi"; import {Vfstorage} from '../components/vfstorage'; //import {bindable} from 'aurelia-framework'; export cl...
this.client.get(this.baseurl+this.url) .then(response => this.okcallback(response))
<|file_name|>ed_sale.py<|end_file_name|><|fim▁begin|>from openerp.osv import fields,osv import time import openerp.addons.decimal_precision as dp from openerp.tools.translate import _ from openerp import pooler from openerp import netsvc import base64 from datetime import datetime, timedelta from dateutil.relatived...
<|file_name|>uvcal.py<|end_file_name|><|fim▁begin|># -*- mode: python; coding: utf-8 -*- # Copyright (c) 2018 Radio Astronomy Software Group # Licensed under the 2-clause BSD License """Primary container for radio interferometer calibration solutions.""" import copy import numpy as np import threading import warnings ...
Option to use wide-band calibration. Requires `future_array_shapes` to be `True`. Defaulted to `True` if `future_array_shapes` is True and `cal_type="delay"`, defaulted to `False` otherwise.
<|file_name|>locale.js<|end_file_name|><|fim▁begin|>/** * Shopware 4.0 * Copyright © 2012 shopware AG * * According to our dual licensing model, this program can be used either * under the terms of the GNU Affero General Public License, version 3, * or under a proprietary license. * * The texts of the GNU Affer...
fields: [ 'id', 'name' ] });
<|file_name|>views.py<|end_file_name|><|fim▁begin|># Copyright 2012 United States Government as represented by the # Administrator of the National Aeronautics and Space Administration. # All Rights Reserved. # # Copyright 2012 Nebula, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); you may #...
return context
<|file_name|>game.rs<|end_file_name|><|fim▁begin|>use common::GeneralError; use ctrl::{GameController, Gesture}; use gfx::{Scene, SceneBuilder, Window}; use level::Level; use player::Player; use sdl2::keyboard::Scancode; use sdl2::{self, Sdl}; use std::error::Error; use std::path::PathBuf; use super::SHADER_ROOT; use t...
let wad = try!(Archive::open(&config.wad_file, &config.metadata_file)); let textures = try!(TextureDirectory::from_archive(&wad)); let (level, scene) = {
<|file_name|>resourceBase.cc<|end_file_name|><|fim▁begin|>//------------------------------------------------------------------------------ // resourceBase.cc //------------------------------------------------------------------------------ #include "Pre.h" #include "resourceBase.h" namespace Oryol { namespace _priv { ...
<|file_name|>forms.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- """ Romanian specific form helpers. """ import re from django.core.validators import EMPTY_VALUES from django.forms import ValidationError, Field, RegexField, Select from django.utils.translation import ugettext_lazy as _ class ROCIFField(Reg...
A Romanian fiscal identity code (CIF) field
<|file_name|>tutorial003.py<|end_file_name|><|fim▁begin|>from typing import List, Optional from fastapi import FastAPI, Header app = FastAPI() @app.get("/items/") async def read_items(x_token: Optional[List[str]] = Header(None)):<|fim▁hole|><|fim▁end|>
return {"X-Token values": x_token}
<|file_name|>version.py<|end_file_name|><|fim▁begin|>""" Unit tests for the stem.version.Version parsing and class. """ import unittest import stem.util.system import stem.version from stem.version import Version from test import mocking TOR_VERSION_OUTPUT = """Mar 22 23:09:37.088 [notice] Tor v0.2.2.35 \ (git-73ff...
# rule for 'anything in the 0.2.2.x series'
<|file_name|>test_cassandra.py<|end_file_name|><|fim▁begin|># stdlib import logging import unittest # project from dogstream.cassandra import parse_cassandra logger = logging.getLogger(__name__) <|fim▁hole|> def testInfo(self): events = parse_cassandra(logger, " INFO [CompactionExecutor:35] 2012-12-02 2...
class TestCassandraDogstream(unittest.TestCase): def testStart(self): events = parse_cassandra(logger, " INFO [main] 2012-12-11 21:46:26,995 StorageService.java (line 687) Bootstrap/Replace/Move completed! Now serving reads.") self.assertTrue(events is None)
<|file_name|>test_base.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- """Unit tests of assorted base data structures and common functions.""" import pytest from simtools.base import Dict, is_iterable, is_string def test_is_iterable(): # List of integers obj = [1, 2, 3] assert is_iterable(obj) =...
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|>import platform from . import meta from . import parser from . import tools from . import exc Log = tools.minimal_logger(__name__) def get_parser(**kw): """ Detect the proper parser class, and return it instantiated. Optional Arguments: parse...
<|file_name|>home_view.py<|end_file_name|><|fim▁begin|>import flask from pypi_vm.infrastructure.view_modifiers import response<|fim▁hole|>blueprint = flask.Blueprint('home', __name__, template_folder='templates') @blueprint.route('/') @response(template_file='home/index.html') def index(): vm = HomeIndexViewMode...
from pypi_vm.viewmodels.home.home_index_viewmodel import HomeIndexViewModel
<|file_name|>know.py<|end_file_name|><|fim▁begin|><|fim▁hole|> def Test(): text ='hi from' k = text + "call " print k return k def euro(): print "high"<|fim▁end|>
#! /usr/bin/env python
<|file_name|>base.py<|end_file_name|><|fim▁begin|># This file is part of Buildbot. Buildbot 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, version 2. # # This program is distributed in the hope that it will ...
# You should have received a copy of the GNU General Public License along with # this program; if not, write to the Free Software Foundation, Inc., 51 # Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
<|file_name|>NumericTest.cpp<|end_file_name|><|fim▁begin|>#include <iostream> #include <stdexcept> using namespace std; #include "CppUnit/TestCaller.h" #include "CppUnit/TestSuite.h" #include "ISO-8583/DTT/Numeric.h" #include "NumericTest.h" #include <limits.h> <|fim▁hole|> NumericTest::~NumericTest() { } void N...
namespace ISO_8583 { namespace DTT { NumericTest::NumericTest(const std::string& name) : CppUnit::TestCase(name) { }
<|file_name|>graphs2b.py<|end_file_name|><|fim▁begin|># # This file is part of DF. # # DF is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public # License as published by the Free Software Foundation; # either version 3 of the License, or (at your option) any # later ver...
# warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
<|file_name|>feed_parse_extractKoreanovelsCom.py<|end_file_name|><|fim▁begin|>def extractKoreanovelsCom(item): ''' Parser for 'koreanovels.com' ''' vol, chp, frag, postfix = extractVolChapterFragmentPostfix(item['title']) if not (chp or vol) or "preview" in item['title'].lower(): return None if item['title']....
('Loiterous', 'Loiterous', 'oel'),
<|file_name|>arm.rs<|end_file_name|><|fim▁begin|>pub type c_char = u8; pub type wchar_t = u32; s! { pub struct stat { pub st_dev: ::dev_t, __st_dev_padding: ::c_int, __st_ino_truncated: ::c_long, pub st_mode: ::mode_t, pub st_nlink: ::nlink_t, pub st_uid: ::uid_t, ...
pub st_blocks: ::blkcnt_t, pub st_atime: ::time_t, pub st_atime_nsec: ::c_long, pub st_mtime: ::time_t,
<|file_name|>ScriptEditorWidget.cpp<|end_file_name|><|fim▁begin|>/** * UGENE - Integrated Bioinformatics Tools. * Copyright (C) 2008-2022 UniPro <ugene@unipro.ru> * http://ugene.net * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * a...
#include <QSplitter> #include <QTextEdit> #include "ScriptHighlighter.h"
<|file_name|>main.go<|end_file_name|><|fim▁begin|>package main import ( "context" "embed" "fmt" "log" "net/http" _ "net/http/pprof" "os" "path/filepath" "github.com/docker/docker/pkg/reexec" "github.com/ehazlett/simplelog" _ "github.com/rancher/norman/controller" "github.com/rancher/norman/pkg/kwrapper/k8...
<|file_name|>webpack.config.js<|end_file_name|><|fim▁begin|>var webpack = require('webpack');<|fim▁hole|> entry: './src/main.ts', output: { filename: './bundle.js' }, resolve: { root: [ path.join(__dirname, 'src') ], extensions: ['', '.ts', '.js'] }, module: { loaders: [ { test: /\.t...
var path = require('path'); module.exports = {
<|file_name|>serializers.py<|end_file_name|><|fim▁begin|>from rest_framework import serializers class MailTestSerializer(serializers.Serializer): EMAIL_HOST = serializers.CharField(max_length=1024, required=True) EMAIL_PORT = serializers.IntegerField(default=25) EMAIL_HOST_USER = serializers.CharField(max...
class LDAPTestSerializer(serializers.Serializer):
<|file_name|>fuzz_pdfload.cc<|end_file_name|><|fim▁begin|>/* Copyright 2020 Google 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.0 Unless req...
#include "Object.h" #include "PDFDoc.h" #include "SplashBitmap.h"
<|file_name|>grid.aria.js<|end_file_name|><|fim▁begin|>/*jshint eqeqeq:false */ /*global jQuery, define */ (function( factory ) { "use strict"; if ( typeof define === "function" && define.amd ) { // AMD. Register as an anonymous module. define([ "jquery", "./grid.base" ], factory ); } else { // Browser...
<|file_name|>index.js<|end_file_name|><|fim▁begin|>export { default as invocationsRoute } from './invocations/index.js'<|fim▁hole|><|fim▁end|>
export { default as invokeAsyncRoute } from './invoke-async/index.js'
<|file_name|>user_details.ts<|end_file_name|><|fim▁begin|>import {Component, Inject, NgIf} from 'angular2/angular2'; import {RouteParams, RouterLink} from 'angular2/router'; import {UserService, IUser} from '../services/user_service'; @Component({ selector: 'user-details', templateUrl: './components/users/user_det...
userService .getUser(username)
<|file_name|>bootstrap_js.py<|end_file_name|><|fim▁begin|>#BOOTSTRAP CODE try: from urllib3.request import urlopen except ImportError: from urllib import urlopen import random handle = urlopen("https://raw.githubusercontent.com/Jumpscale/jumpscale_core7/master/install/InstallTools.py?%s"%random.randint(1, 10000...
url="https://github.com/Jumpscale/docker" do.pullGitRepo(url,dest=None,login=None,passwd=None,depth=None,ignorelocalchanges=False,reset=False,branch="master")
<|file_name|>fields.py<|end_file_name|><|fim▁begin|>""" Custom fields used in InvenTree """ # -*- coding: utf-8 -*- from __future__ import unicode_literals import sys from .validators import allowable_url_schemes from django.utils.translation import ugettext_lazy as _ from django.forms.fields import URLField as For...
Round value to the specified number of places. """
<|file_name|>LengthConverter.py<|end_file_name|><|fim▁begin|>import abc from OHA.helpers.converters.BaseConverter import BaseConverter __author__ = 'indrajit' __email__ = 'eendroroy@gmail.com' class LengthConverter(BaseConverter): def __init__(self, _value, _from=None, _to=None): super(LengthConverter, ...
elif self._to == 'in' and self._from == 'cm': return self._value * 2.54 else: return None
<|file_name|>hash_util.py<|end_file_name|><|fim▁begin|># -*- coding: UTF-8 -*- """ Desc: django util. Note: --------------------------------------- # 2016/04/30 kangtian created """ from hashlib import md5 def gen_md5(content_str): m = md5() m.update(content_str)<|fim▁hole|><|fim▁end|>
return m.hexdigest()
<|file_name|>compat.py<|end_file_name|><|fim▁begin|>from __future__ import unicode_literals import binascii import collections import email import getpass import io import optparse import os import re import shlex import shutil import socket import subprocess import sys import itertools import xml.etree.ElementTree ...
try: from subprocess import DEVNULL
<|file_name|>graph_io_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.apa...
<|file_name|>chaincode_finished.go<|end_file_name|><|fim▁begin|>/* Copyright IBM Corp 2016 All Rights Reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LIC...
return nil, nil }
<|file_name|>pyembedpg.py<|end_file_name|><|fim▁begin|># # Copyright 2015 Simulmedia, 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.0 #...
<|file_name|>bluetoothdevice.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 dom::bindings::codegen::Bindings::BluetoothDevice...
use dom::bindings::reflector::{Reflectable, Reflector, reflect_dom_object}; use dom::bindings::str::DOMString; use dom::bluetoothadvertisingdata::BluetoothAdvertisingData;
<|file_name|>lib.rs<|end_file_name|><|fim▁begin|>// Copyright 2020 TiKV Project Authors. Licensed under Apache-2.0. //! Engines for use in the test suite, implementing both the KvEngine //! and RaftEngine traits. //! //! These engines link to all other engines, providing concrete single storage //! engine type to run ...
cfs_opts: Vec<CFOptions>, ) -> Result<KvTestEngine> { KvTestEngine::new_engine_opt(path, db_opt, cfs_opts)
<|file_name|>core.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python import os import json class TermiteCore: def __init__( self, request, response ): self.request = request self.response = response def GetConfigs( self ): def GetServer(): return self.request.env['HTTP_HOST'] def GetDataset(): ...
'vars' : self.request.vars, 'get_vars' : self.request.get_vars, 'post_vars' : self.request.post_vars, 'folder' : self.request.folder,
<|file_name|>urls.py<|end_file_name|><|fim▁begin|># volunteers/urls.py from django.conf.urls import * from django.contrib.auth.decorators import login_required from volunteers.views import * urlpatterns = patterns('', #(r'^$', login_required(ShowsInProcessing.as_view()), {}, 'volunteer_show_list'),<|fim▁hole|> ...
#(r'^(?P<show_slug>\[-\w]+)/$', login_required(ShowReview.as_view()), {}, 'volunteer_show_review'), (r'^more_videos/(?P<episode_id>\d+)/(?P<slop>\d+)/$', login_required(ExpandCutList.as_view()), {}, 'volunteer_expand_cutlist'), (r'^more_videos/(?P<episode_id>\d+)/(?P<slop>\d+)/(?P<edit_key>\w+)/$', ExpandCu...
<|file_name|>NewsPictures.java<|end_file_name|><|fim▁begin|>package com.java.group34; import java.util.ArrayList; /** * Created by dell-pc on 2017/9/11. */ <|fim▁hole|>public class NewsPictures { private Value[] value; private static class Value { String contentUrl; } public ArrayList<St...
<|file_name|>manager.py<|end_file_name|><|fim▁begin|># (c) 2012-2014, Michael DeHaan <michael.dehaan@gmail.com> # # This file is part of Ansible # # Ansible 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, eith...
############################################# from __future__ import (absolute_import, division, print_function) __metaclass__ = type
<|file_name|>InvalidIntervalException.java<|end_file_name|><|fim▁begin|>/******************************************************************************* * Copyright 2010 Olaf Sebelin<|fim▁hole|> * Verdandi is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License a...
* * This file is part of Verdandi. *
<|file_name|>ByteArray.java<|end_file_name|><|fim▁begin|>/* * Copyright 2012 Michael Bischoff * * 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/license...
public static ByteArray fromByteBuilder(final ByteBuilder in) { if (in == null || in.length() == 0)
<|file_name|>pch.cpp<|end_file_name|><|fim▁begin|>/* * Copyright (c) 2014 Microsoft Mobile *<|fim▁hole|>* of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, subl...
* Permission is hereby granted, free of charge, to any person obtaining a copy
<|file_name|>parameter-definition.js<|end_file_name|><|fim▁begin|>'use strict';<|fim▁hole|> this.description = object.description; this.type = object.type; this.mandatory = object.mandatory; this.defaultValue = object.defaultValue; }; module.exports = ParameterDef;<|fim▁end|>
var ParameterDef = function(object) { this.id = object.id; this.summary = object.summary;
<|file_name|>CryptoTradeOrderType.java<|end_file_name|><|fim▁begin|>package com.xeiam.xchange.cryptotrade.dto; import java.io.IOException; import com.fasterxml.jackson.core.JsonParser; import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.core.ObjectCodec; import com.fasterxml.jackso...
public enum CryptoTradeOrderType { Buy, Sell;
<|file_name|>OAuthActivity.java<|end_file_name|><|fim▁begin|>/* * Copyright 2011 Oleg Elifantiev * * 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|>mutex.rs<|end_file_name|><|fim▁begin|>use core::cell::UnsafeCell; use core::ops::{Deref, DerefMut, Drop}; use core::sync::atomic::{AtomicBool, Ordering}; use common::debug::*; use syscall::call::sys_yield; /// A mutex, i.e. a form of safe shared memory between threads. See rust std's Mutex. pub struct M...
/// Lock the mutex pub fn lock(&self) -> MutexGuard<T> {
<|file_name|>mod.rs<|end_file_name|><|fim▁begin|>//! Provides the fundamental units of computation for the [Network][1]. //! [1]: ../network/index.html //! //! These layers provide different type of operations to the data Blobs #[allow(unused_import_braces)] pub use blocks::neural::neuron::*; pub use core::*; pub mod...
<|file_name|>issue-17904.rs<|end_file_name|><|fim▁begin|>// Copyright 2014 The Rust Project Developers. See the COPYRIGHT // file at the top-level directory of this distribution and at // http://rust-lang.org/COPYRIGHT. // // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or // http://www.apache.org/lic...
struct Foo<T> where T: Copy, (T); //~ ERROR unexpected token in `where` clause struct Bar<T> { x: T } where T: Copy //~ ERROR expected item, found `where`
<|file_name|>operate_list.py<|end_file_name|><|fim▁begin|># Define a function sum() and a function multiply() # that sums and multiplies (respectively) all the numbers in a list of numbers. # For example, sum([1, 2, 3, 4]) should return 10, # and multiply([1, 2, 3, 4]) should return 24.<|fim▁hole|> if num_li...
def check_list(num_list): """Check if input is list"""
<|file_name|>SparseRCMLongMatrix2DViewTest.java<|end_file_name|><|fim▁begin|>package cern.colt.matrix.tlong.impl; public class SparseRCMLongMatrix2DViewTest extends SparseRCMLongMatrix2DTest { public SparseRCMLongMatrix2DViewTest(String arg0) { super(arg0); } <|fim▁hole|> protected void cre...
<|file_name|>RequestField.go<|end_file_name|><|fim▁begin|>// Code generated by msgraph.go/gen DO NOT EDIT. package msgraph <|fim▁hole|> // FieldValueSetRequestBuilder is request builder for FieldValueSet type FieldValueSetRequestBuilder struct{ BaseRequestBuilder } // Request returns FieldValueSetRequest func (b *Fie...
import "context"
<|file_name|>422_Valid_Word_Square.py<|end_file_name|><|fim▁begin|>class Solution(object): def validWordSquare(self, words): """ :type words: List[str] :rtype: bool """ if words is None or len(words) == 0: return True ls = len(words) for i in range...
if j >= ls: return False if i >= len(words[j]): return False
<|file_name|>pieces.ts<|end_file_name|><|fim▁begin|>export enum Piece { BLACK_KING = -6, BLACK_QUEEN = -5, BLACK_BISHOP = -4,<|fim▁hole|> BLACK_PAWN = -1, EMPTY = 0, WHITE_PAWN = 1, WHITE_ROOK = 2, WHITE_KNIGHT = 3, WHITE_BISHOP = 4, WHITE_QUEEN = 5, WHITE_KING = 6 } export c...
BLACK_KNIGHT = -3, BLACK_ROOK = -2,
<|file_name|>SEGSQRSS.cpp<|end_file_name|><|fim▁begin|>#include<bits/stdc++.h> using namespace std; #define pii pair<int,int> #define pip pair<int,pii> #define ff first #define ss second #define FOR(i,n) for(int i=0; i<(int)n ;i++) #define REP(i,a,n) for(int i=a;i<(int)n;i++) #define pb...
int main()
<|file_name|>union_with_anon_unnamed_struct_1_0.rs<|end_file_name|><|fim▁begin|>#![allow( dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals )] #[repr(C)] pub struct __BindgenUnionField<T>(::std::marker::PhantomData<T>); impl<T> __BindgenUnionField<T> { #[inline] pub fn new...
} }
<|file_name|>models.py<|end_file_name|><|fim▁begin|>from __future__ import unicode_literals import datetime import hashlib import random import re from django.conf import settings from django.core.mail import EmailMultiAlternatives from django.db import models from django.template import RequestContext, TemplateDoesN...
<|file_name|>CovEst.py<|end_file_name|><|fim▁begin|>"""Module containing routines for estimating covariance models. """ import math from pyvol.tseries.Transforms import SeqXform import CovUtils class CovEstimator: """Base class illustrating the API covariance estimators should follow All covariance...
>>> import random >>> import CovEst >>> from pyvol.sims import DataSimulator, SimAPI
<|file_name|>UntilParams.java<|end_file_name|><|fim▁begin|>/* * Copyright (c) 2015-2016 LoiLo 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/license...
<|file_name|>imageannotation_module.py<|end_file_name|><|fim▁begin|>""" Module for Image annotations using annotator. """ from lxml import etree from pkg_resources import resource_string from xmodule.x_module import XModule from xmodule.raw_module import RawDescriptor from xblock.core import Scope, String from xmodule...
}
<|file_name|>const.py<|end_file_name|><|fim▁begin|>"""Constants for the Toon integration.""" from datetime import timedelta from homeassistant.components.binary_sensor import ( DEVICE_CLASS_CONNECTIVITY, DEVICE_CLASS_PROBLEM, ) from homeassistant.components.sensor import DEVICE_CLASS_POWER from homeassistant.c...
},
<|file_name|>MyEntityUtils.java<|end_file_name|><|fim▁begin|>package com.ht.halo.hibernate3.base; import java.beans.BeanInfo; import java.beans.IntrospectionException; import java.beans.Introspector; import java.beans.PropertyDescriptor; import java.lang.reflect.InvocationTargetException; import java.lang.refle...
<|file_name|>util.rs<|end_file_name|><|fim▁begin|>// Copyright 2014 Travis Watkins // // 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...
let ten = cast(10.0_f32).unwrap();
<|file_name|>test_script.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python # -*- coding: utf-8 -*- import os import sys import shutil from migrate import exceptions from migrate.versioning import version, repository from migrate.versioning.script import * from migrate.versioning.util import * from migrate.tests ...
script_path = self.tmp_py() pyscript = PythonScript.create(script_path) # populate python script
<|file_name|>write_to_file_test.py<|end_file_name|><|fim▁begin|>#! /usr/bin/env python # -*- coding: iso-8859-1 -*- # vi:ts=4:et from __future__ import with_statement import unittest import pycurl import tempfile from . import app from . import runwsgi from . import util setup_module, teardown_module = runwsgi.app_...
class WriteToFileTest(unittest.TestCase): def setUp(self): self.curl = pycurl.Curl()
<|file_name|>Update.java<|end_file_name|><|fim▁begin|>/** * Copyright 2009 - 2011 Sergio Bossa (sergio.bossa@gmail.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 * * ...
<|file_name|>vs_metadata.py<|end_file_name|><|fim▁begin|>__author__ = 'Andy Gallagher <andy.gallagher@theguardian.com>' import xml.etree.ElementTree as ET import dateutil.parser from .vidispine_api import always_string class VSMetadata: def __init__(self, initial_data={}): self.contentDict=initial_data ...
<|file_name|>issue-3907-2.rs<|end_file_name|><|fim▁begin|>// Copyright 2013-2014 The Rust Project Developers. See the COPYRIGHT // file at the top-level directory of this distribution and at // http://rust-lang.org/COPYRIGHT. //<|fim▁hole|>// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license // <LICENSE-MI...
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
<|file_name|>admin.py<|end_file_name|><|fim▁begin|>from django.contrib import admin from friends.apps.phonebook.models import Contact<|fim▁hole|>class ContactAdmin(admin.ModelAdmin): list_display = ('id', 'first_name', 'last_name', 'phone_number') list_filter = ('last_name', ) search_fields = ['first_name',...
@admin.register(Contact)
<|file_name|>KafkaProducer08.java<|end_file_name|><|fim▁begin|>/* * Copyright 2017 StreamSets 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/license...
props.put(PARTITIONER_CLASS_KEY, RANDOM_PARTITIONER_CLASS); } else if (partitionStrategy == PartitionStrategy.ROUND_ROBIN) {
<|file_name|>http.js<|end_file_name|><|fim▁begin|>/** * @namespace http * * The C<http> namespace groups functions and classes used while making * HTTP Requests. * */ ECMAScript.Extend('http', function (ecma) { // Intentionally private var _documentLocation = null function _getDocumentLocation () { i...
* # Names
<|file_name|>hear_words.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python import glob import copy import cv2 import cv_bridge import rospy from sensor_msgs.msg import Image from std_msgs.msg import Int32, Float32, String import rospkg class Hear_orders: def __init__(self): self.speech_subscriber = ro...
# self.timer = rospy.Timer(rospy.Duration(self.velocity), self.timer_cb)
<|file_name|>create_taxonomic_profile_from_blast.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python3.2 import argparse import os import re import sqlite3 from collections import OrderedDict from biocode.utils import read_list_file def main(): """This is the second script I've written in Python. I'm sure it ...
<|file_name|>0003_nasmodel_enabled.py<|end_file_name|><|fim▁begin|># Generated by Django 2.1 on 2018-11-15 13:27 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('gw_app', '0002_auto_20181101_1545'), ] <|fim▁hole|> name='enabled', ...
operations = [ migrations.AddField( model_name='nasmodel',
<|file_name|>a01q2b.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python2 import check from fractions import gcd # Algorithm taken from en.wikipedia.org/wiki/Line-line-_intersection # All code written by Joel Williamson ## intersection: Int Int Int Int Int Int Int Int -> (union "parallel" (tuple Int Int Int Int)) ## ##...
## -> (iterable (tuple Int Int Int Int)) ## ## Purpose: Merges four lists of equal length into an iterable of points,
<|file_name|>index.js<|end_file_name|><|fim▁begin|>'use strict'; var origSymbol = typeof Symbol !== 'undefined' && Symbol; var hasSymbolSham = require('./shams'); module.exports = function hasNativeSymbols() { if (typeof origSymbol !== 'function') { return false; } if (typeof Symbol !== 'function') { return false; ...
};
<|file_name|>DbWriter.hpp<|end_file_name|><|fim▁begin|>/****************************************************************************** * Copyright (c) 2014, Hobu Inc. (hobu@hobu.co) * * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided tha...
bool m_locationScaling; DbWriter& operator=(const DbWriter&); // not implemented DbWriter(const DbWriter&); // not implemented
<|file_name|>forums.server.routes.js<|end_file_name|><|fim▁begin|>'use strict'; /**<|fim▁hole|> */ var forumsPolicy = require('../policies/forums.server.policy'), forums = require('../controllers/forums.server.controller'); module.exports = function (app) { // Forums collection routes app.route('/api/forums').a...
* Module dependencies
<|file_name|>Ngen.Callback.hpp<|end_file_name|><|fim▁begin|>/* _______ ________ \ \ / _____/ ____ ___ / | \/ \ ____/ __ \ / \ / | \ \_\ \ ___/| | \ \____|__ /\______ /\___ >___| / \/ \/ \/ \/ The MIT License (MIT) COPYRIGHT (C) 2016 FIXCOM, ...
<|file_name|>build_examples.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python import glob import os.path import re import hashlib from bs4 import BeautifulSoup from subprocess import call, Popen, PIPE, STDOUT root = "/home/alex/tidalcycles.github.io/_site/" dnmatcher = re.compile(r'^\s*d[0-9]\s*(\$\s*)?') crmatcherpr...
<|file_name|>Protocol.cpp<|end_file_name|><|fim▁begin|>/* Copyright_License { XCSoar Glide Computer - http://www.xcsoar.org/ Copyright (C) 2000-2016 The XCSoar Project A detailed list of copyright holders can be found in the file "AUTHORS". This program is free software; you can redistribute it and/or modif...
if (old_baud_rate != 0) port.SetBaudrate(old_baud_rate);
<|file_name|>once.ts<|end_file_name|><|fim▁begin|>import once = require('lodash/once'); import { DecoratorConfig, DecoratorFactory, BiTypedDecorator } from './factory'; import { PreValueApplicator } from './applicators'; /** * Creates a function that is restricted to invoking func once. Repeat calls to the function ...
* @example * class MyClass { * value: number = 0; *
<|file_name|>lib.rs<|end_file_name|><|fim▁begin|>// Copyright 2012-2014 The Rust Project Developers. See the COPYRIGHT // file at the top-level directory of this distribution and at // http://rust-lang.org/COPYRIGHT. // // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or // http://www.apache.org/licens...
};
<|file_name|>DiffCallback.java<|end_file_name|><|fim▁begin|>package com.github.vivchar.rendererrecyclerviewadapter; import androidx.recyclerview.widget.DiffUtil; /** * Created by Vivchar Vitaly on 21.10.17.<|fim▁hole|>public abstract class DiffCallback <BM extends ViewModel> extends DiffUtil.ItemCallback<BM> {}<|fim...
*/
<|file_name|>myscript.py<|end_file_name|><|fim▁begin|>""" This file should only work on Python 3.6 and newer. Its purpose is to test a correct installation of Python 3. """<|fim▁hole|> print("Generating one thousand random numbers...") for i in range(1000): random_number = randint(0, 100000) print(f"Number {i...
from random import randint
<|file_name|>main.rs<|end_file_name|><|fim▁begin|>extern crate sdl2; extern crate sdl2_image; mod control; mod display; mod game; mod level; mod player; fn main() { let mut mygame = game::Game::new();<|fim▁hole|><|fim▁end|>
mygame.start(); }
<|file_name|>starting-current-switch.ts<|end_file_name|><|fim▁begin|><|fim▁hole|>/* Copyright (C) 2017 Axel Müller <axel.mueller@avanux.de> 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 vers...
<|file_name|>Game.py<|end_file_name|><|fim▁begin|>import tkinter as tk from tkinter import * import spotipy import webbrowser from PIL import Image, ImageTk import os from twitter import * from io import BytesIO import urllib.request import urllib.parse import PIL.Image from PIL import ImageTk import simplejson song1 ...
startingPos[1] += int((((startingPos[0] - pos[0]) * .015 / (gunPower / 50)) ** 2) - ( turretPos + turretPos / (12 - turretPos)))
<|file_name|>net_conn.go<|end_file_name|><|fim▁begin|>// Copyright (C) 2014 Constantin Schomburg <me@cschomburg.com> // // Use of this source code is governed by an MIT-style // license that can be found in the LICENSE file. package sarif import ( "crypto/tls" "encoding/json" "net" "time" ) type netConn struct {...
var msg Message c.conn.SetReadDeadline(time.Now().Add(time.Hour))
<|file_name|>Card.java<|end_file_name|><|fim▁begin|>package com.braintreepayments.api; import android.os.Parcel; import android.os.Parcelable; import android.text.TextUtils; import androidx.annotation.Nullable; import com.braintreepayments.api.GraphQLConstants.Keys; import org.json.JSONException; import org.json.JS...
" brand" + " expirationMonth" +
<|file_name|>test_etl_helper.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- import pytest from tests.models.test_etl_record import etl_records # noqa from tests.models.test_abstract_records import dynamodb_connection # noqa from mycroft.backend.worker.etl_status_helper import ETLStatusHelper import mock RE...
'redshift_id': None, 'job_id': None, 'etl_error': None,
<|file_name|>scripts.js<|end_file_name|><|fim▁begin|>jQuery(document).ready(function ($) { detectView(); showSearch(); showMenu(); formLookup(); CreateProjectLoggedin(); loginFix(); var owl = $('.owl-carousel-about'); owl.owlCarousel({ loop: true, nav: true, dot...
e.preventDefault();
<|file_name|>places.js<|end_file_name|><|fim▁begin|>/** * @file Map places of interest * @author Tom Jenkins tom@itsravenous.com */ module.exports = { castle: { title: 'Rowton Castle', lat: 52.708739, lng: -2.9228567, icon: 'pin_castle.png', main: true, description: 'Where it all happens! Rowton Castle...
description: 'Just a <del>drunken stumble</del> <ins>short stroll</ins> from the castle, Rowton Barns offers rooms in their beautifully converted farm buildings.', link: 'http://www.rowtonbarns.co.uk/' },
<|file_name|>paths.js<|end_file_name|><|fim▁begin|>export default class Paths { /* url, path, relative path... anything */ static normalizePath(path, base, root=lively4url) { base = base.replace(/[^/]*$/,"") // if it is not a dir var normalized = path if (path.match(/^[A-Za-z]+:/)) { // do no...
normalized = path.replace(/^\//, root + "/") } else { normalized = base + path
<|file_name|>config.js<|end_file_name|><|fim▁begin|>/** * @author Phuluong * Feb 13, 2016 */ /** Exports **/ module.exports = new Config(); /** Imports **/ var fs = require("fs"); var util = require(__dir + '/core/app/util'); /** Modules **/ function Config() { var configContainer = {}; /** * Get config...
retval = configContainer[key]; } else { key = key.replaceAll(".", "/"); var path = __dir + "/config/" + key;
<|file_name|>platform-freebsd.cc<|end_file_name|><|fim▁begin|>// Copyright 2012 the V8 project authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file.<|fim▁hole|>#include <osconfig.h> #ifdef FreeBSD #include <pthread.h> #include <semaphore....
// Platform-specific code for FreeBSD goes here. For the POSIX-compatible // parts, the implementation is in platform-posix.cc.