prompt large_stringlengths 70 991k | completion large_stringlengths 0 1.02k |
|---|---|
<|file_name|>54388.cc<|end_file_name|><|fim▁begin|>// { dg-do run { target c++11 } }
//
// Copyright (C) 2012-2021 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// terms of the GNU General Public L... | #include <testsuite_hooks.h>
|
<|file_name|>tests.rs<|end_file_name|><|fim▁begin|>extern crate edit_distance;
#[test]
fn simple() {
assert_eq!(edit_distance::edit_distance("kitten", "sitting"), 3);
assert_eq!(edit_distance::edit_distance("Tier", "Tor"), 2);
}
#[test]
fn same() {
assert_eq!(edit_distance::edit_distance("kitten", "kitten... | fn empty_b() { |
<|file_name|>api.py<|end_file_name|><|fim▁begin|>import detectlanguage
<|fim▁hole|>
def simple_detect(data):
result = detect(data)
return result[0]['language']
def user_status():
return detectlanguage.client.get('user/status')
def languages():
return detectlanguage.client.get('languages')<|fim▁end|> | def detect(data):
result = detectlanguage.client.post('detect', { 'q': data })
return result['data']['detections'] |
<|file_name|>test_query_transform.py<|end_file_name|><|fim▁begin|># LIBRARIES
from django.db import models, connections, connection as default_connection
from django.db.models.sql.datastructures import EmptyResultSet
from django.db.models.query import Q
from google.appengine.api import datastore
# DJANGAE
from djangae... | self.assertEqual("ISNULL", query.where.children[0].operator)
|
<|file_name|>on_PRIVMSG.py<|end_file_name|><|fim▁begin|>import shelve, time, random
def main(connection, info) :
"""This is the old plugin"""
#"""Run every time a message is seen"""
if info["message"].startswith("\x01ACTION") and info["message"].endswith("\x01") :
on_ACTION(connection, info)
... |
# if info["sender"] not in conf.ignorelist and info["hostname"] not in conf.hostignores :
|
<|file_name|>Core.java<|end_file_name|><|fim▁begin|>package sample.multiversion;<|fim▁hole|> String getDependencyVersion();
}<|fim▁end|> |
public interface Core {
String getVersion(); |
<|file_name|>cascadenik-style.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
import sys
import os.path
import optparse
import cascadenik
# monkey with sys.path due to some weirdness inside cssutils
sys.path.append(os.path.dirname(os.path.realpath(__file__)))
from cssutils.tokenize2 import Tokenizer as cssToken... | if not stylefile.endswith('.mss'):
parser.error('Only accepts an .mss file')
sys.exit(main(stylefile)) |
<|file_name|>index.ts<|end_file_name|><|fim▁begin|>import isArray from 'lodash/isArray';
import { BaseModule } from '../baseModule';
import { HlrCheckResponse } from './types/HlrCheckResponse';
export class Hlr extends BaseModule {
async check(
numbers: string | string[],
idx?: string | string[]
): Promi... |
return await this.httpClient.get< |
<|file_name|>_wdg_spec.js<|end_file_name|><|fim▁begin|>describe("OCombo:", function () {
var wtest, $p;
beforeEach(function () {
wtest = frames[0];
$p = wtest.$p;
});<|fim▁hole|>
it("Конствуктор должен возвращать объект типа OCombo", function () {
expect(typeof $p).toBe("object");
});
});<|fim▁end|> | |
<|file_name|>storage.ts<|end_file_name|><|fim▁begin|>/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*----------... | |
<|file_name|>TestGraph.java<|end_file_name|><|fim▁begin|>/* *******************************************************
* Released under the MIT License (MIT) --- see LICENSE
* Copyright (c) 2014 Ankit Singla, Sangeetha Abdu Jyothi,
* Chi-Yao Hong, Lucian Popa, P. Brighten Godfrey,
* Alexandra Kolla, Simon Kassing
* *... |
public boolean addBidirNeighbor(int n1, int n2) {
return super.addBidirNeighbor(n1, n2);
} |
<|file_name|>huffman.rs<|end_file_name|><|fim▁begin|>use std::fmt;
use crate::decoders::basics::*;
const DECODE_CACHE_BITS: u32 = 13;
pub struct HuffTable {
// These two fields directly represent the contents of a JPEG DHT marker
pub bits: [u32;17],
pub huffval: [u32;256],
// Represent the weird shifts that ... | self.nbits as i32 - 32
}
} |
<|file_name|>home.module.ts<|end_file_name|><|fim▁begin|>import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/common';
import { HomeComponent } from './home.component';<|fim▁hole|>
@NgModule({
imports: [CommonModule, CarouselModule, DropdownModule, AlertModule, ChartModule],
declarat... | import { CarouselModule, DropdownModule, AlertModule } from 'ng2-bootstrap';
import { ChartModule } from 'angular2-highcharts';
import { TimelineComponent, ChatComponent, NotificationComponent } from './home.component'; |
<|file_name|>adapt_fit.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
# -*- coding: utf8 -*-
# *****************************************************************
# ** PTS -- Python Toolkit for working with SKIRT **
# ** © Astronomical Observatory, Ghent University **
# **************... | if runs.empty: raise RuntimeError("No fitting runs are present") |
<|file_name|>setup.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
# -*- coding: utf-8 -*-
import io
import os
import sys
import re<|fim▁hole|> os.system("python setup.py sdist upload")
sys.exit()
packages = [
"the_big_username_blacklist"
]
# Handle requirements
install_requires = []
tests_require... | from setuptools import setup
if sys.argv[-1] == "publish": |
<|file_name|>main.rs<|end_file_name|><|fim▁begin|>#![feature(lang_items)]
#![feature(asm)]
#![no_std]
#![no_main]
mod exceptions;
mod gpio;
#[no_mangle]
pub fn start() -> ! {
/*
let mut i = 0;
unsafe {
let ram_boundary = *(0x0000_0000 as *const u32); // Get stack boundary
let crash = *(ram_boundary as ... | *moder |= 0b01 << 6; // Set mode to general purpose output |
<|file_name|>0005_auto_20170704_1452.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
# Generated by Django 1.11 on 2017-07-04 14:52
from __future__ import unicode_literals
<|fim▁hole|>class Migration(migrations.Migration):
dependencies = [("events", "0004_create_basic_calendars")]
operations = [
... | from django.db import migrations, models
|
<|file_name|>utils.py<|end_file_name|><|fim▁begin|>from __future__ import absolute_import
import hashlib
import jwt
from six.moves.urllib.parse import quote
from sentry.shared_integrations.exceptions import ApiError
def percent_encode(val):
# see https://en.wikipedia.org/wiki/Percent-encoding
return quote(... | |
<|file_name|>sujiko.rs<|end_file_name|><|fim▁begin|>//! Sujiko.
//!
//! https://en.wikipedia.org/wiki/Sujiko
//! https://www.simetric.co.uk/sujiko/index.htm
extern crate puzzle_solver;
use puzzle_solver::{Puzzle,Solution,Val,VarToken};
const SIZE: usize = 3;
type Board = [[Val; SIZE]; SIZE];
fn make_sujiko(board: &... | sys.equals(tl, vars[0][0] + vars[0][1] + vars[1][0] + vars[1][1]);
sys.equals(tr, vars[0][1] + vars[0][2] + vars[1][1] + vars[1][2]);
sys.equals(bl, vars[1][0] + vars[1][1] + vars[2][0] + vars[2][1]); |
<|file_name|>test_math_core.py<|end_file_name|><|fim▁begin|>"""Test methods for `zcode/math/math_core.py`.
Can be run with:
$ nosetests math/tests/test_math_core.py
$ nosetests math/tests/test_math_core.py:TestMathCore.test_around
$ python math/tests/test_math_core.py
"""
from __future__ import absolute_i... | spc4 = spacing([3.0, -2.5, -5.0, 0.0], scale='lin', num=27, filter='<')
assert_true(np.allclose(ref4, spc4)) |
<|file_name|>indexing.js<|end_file_name|><|fim▁begin|>'use strict';
/**
* This controller handles trigger requests from the Cumulus system that fires
* when assets are updated, inserted or deleted.
*
* An example request is:
*
* req.body = {
* id: 'FHM-25757',
* action: 'asset-update',
* collection: 'Fr... | }
|
<|file_name|>instr_cvtdq2ps.rs<|end_file_name|><|fim▁begin|>use ::{BroadcastMode, Instruction, MaskReg, MergeMode, Mnemonic, OperandSize, Reg, RoundingMode};
use ::RegType::*;
use ::instruction_def::*;
use ::Operand::*;
use ::Reg::*;
use ::RegScale::*;
use ::test::run_test;
#[test]
fn cvtdq2ps_1() {
run_test(&Inst... | }
|
<|file_name|>unreachable-locals.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.
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.ap... | let abc = !some_predicate();
break;
} |
<|file_name|>project.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
from PyQt5.QtCore import Qt
from dgp.core.controllers.project_controllers import AirborneProjectController
from .base import WorkspaceTab
class ProjectTab(WorkspaceTab):<|fim▁hole|> self.project = project
@property
def title... | def __init__(self, project: AirborneProjectController, parent=None):
super().__init__(parent=parent, flags=Qt.Widget) |
<|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', 'settings.prod')<|fim▁hole|><|fim▁end|> |
from django.core.management import execute_from_command_line
execute_from_command_line(sys.argv) |
<|file_name|>reachable-unnameable-type-alias.rs<|end_file_name|><|fim▁begin|>// Copyright 2016 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:... | mod inner_private_module {
// UnnameableTypeAlias isn't marked as reachable, so no stability annotation is required here
pub type UnnameableTypeAlias = u8;
} |
<|file_name|>bilock.rs<|end_file_name|><|fim▁begin|>use std::boxed::Box;
use std::cell::UnsafeCell;
use std::mem;
use std::ops::{Deref, DerefMut};
use std::sync::Arc;
use std::sync::atomic::AtomicUsize;
use std::sync::atomic::Ordering::SeqCst;
use {Async, Future, Poll};
use task::{self, Task};
/// A type of futures-p... | }.into())
} |
<|file_name|>pp.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.apache.org/licenses/LIC... | //! |
<|file_name|>errors.go<|end_file_name|><|fim▁begin|>// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT.
package ssm
const (
// ErrCodeAlreadyExistsException for service response error code
// "AlreadyExistsException".
//
// Error returned if an attempt is made to register a patch group with a pa... | // "StatusUnchanged".
// |
<|file_name|>exercicio1.py<|end_file_name|><|fim▁begin|>resultado = 0
contador = 0
<|fim▁hole|> if resultado == numero:
print('O numero %d e triangular. %d x %d x %d = %d' % (numero, (contador -2), (contador - 1), contador, numero))
break
contador += 1
else:
print('O numero %d nao e... | numero = int(input('Digite um numero: '))
while resultado < numero:
resultado = (contador -2) * (contador -1) * contador
|
<|file_name|>__openerp__.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistr... | # published by the Free Software Foundation, either version 3 of the |
<|file_name|>NPC.cpp<|end_file_name|><|fim▁begin|>#include "NPC.h"
#include "Application.h"
#include "ModuleEntityManager.h"
#include "Player.h"
#include "ModuleCamera.h"
#include "ModuleAudio.h"
#include <random>
NPC::NPC(Entity::Types entityType, iPoint iniPos, short int hp, Direction facing)
: Creature(entityType,... | |
<|file_name|>handler.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... | # one time initialization for cold starts. |
<|file_name|>keychain.py<|end_file_name|><|fim▁begin|>import base64
import json
import os
import pickle
from Crypto import Random
from Crypto.Cipher import AES
from cumulusci.core.config import BaseConfig
from cumulusci.core.config import ConnectedAppOAuthConfig
from cumulusci.core.config import OrgConfig
from cumulu... |
def load_files(dirname):
for item in os.listdir(dirname): |
<|file_name|>credentials.py<|end_file_name|><|fim▁begin|># Copyright (c) 2012-2013 Mitch Garnaat http://garnaat.org/
# Copyright 2012-2014 Amazon.com, Inc. or its affiliates. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"). You
# may not use this file except in compliance with th... | self._creds_filename = creds_filename
if profile_name is None:
profile_name = 'default' |
<|file_name|>material.module.ts<|end_file_name|><|fim▁begin|>import {NgModule} from '@angular/core';
import {MatButtonModule} from '@angular/material/button';
import {MatCardModule} from '@angular/material/card';
import {MatFormFieldModule} from '@angular/material/form-field';
import {MatGridListModule} from '@angular/... | import {MatRadioModule} from '@angular/material/radio';
import {MatSelectModule} from '@angular/material/select';
import {MatSidenavModule} from '@angular/material/sidenav'; |
<|file_name|>gensky.py<|end_file_name|><|fim▁begin|># coding=utf-8
from _commandbase import RadianceCommand
from ..datatype import RadiancePath, RadianceTuple
from ..parameters.gensky import GenskyParameters
import os
class Gensky(RadianceCommand):
u"""
gensky - Generate an annual Perez sky matrix from a wea... | 0: [+s] Sunny with sun, 1: [-s] Sunny without sun,
2: [+i] Intermediate with sun, 3: [-i] Intermediate with no sun,
4: [-c] Cloudy overcast sky, 5: [-u] Uniform cloudy sky |
<|file_name|>inheritance_integrity.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 rustc::lint::{LateContext, LintPass, LintAr... | use rustc::middle::def;
use rustc_front::hir;
use syntax::ast;
use utils::match_lang_ty; |
<|file_name|>AbstractEvent2.java<|end_file_name|><|fim▁begin|>/*
* Copyright (C) Lightbend Inc. <https://www.lightbend.com>
*/
package com.lightbend.lagom.serialization;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.lightbend.lagom.javadsl.immutable.ImmutableStyle;
import org.immutabl... | |
<|file_name|>average6.py<|end_file_name|><|fim▁begin|># Program to find the averge of numbers in a file
def main():
#Get the filename with the numbers
fileName = input("What file are the numbers in? ")
#var to contain all the content of the file
infile = open(fileName, 'r')
#var to keep track of the sum of those ... | |
<|file_name|>IOSystem.java<|end_file_name|><|fim▁begin|>package jchess.game;
import jchess.eventbus.events.*;
import net.engio.mbassy.listener.Handler;
/**
* Bridge between GL and User Input.
*
* Created by andreas on 06.12.14.
*
* @trace [$REQ07]
*/
@SuppressWarnings("UnusedDeclaration")
public interface IOSys... | @Handler
void handleUpdateBoardEvent(UpdateBoardEvent updateBoardEvent); |
<|file_name|>chiptune-sample.rs<|end_file_name|><|fim▁begin|>extern crate chiptune;
extern crate sdl2;
use std::thread;
use std::time::Duration;
use std::io;
use std::io::prelude::*;
use std::fs::File;
fn play_sound(player: &mut chiptune::Chiptune, path: String) -> Result<chiptune::ChiptuneSound, chiptune::ChiptuneE... | let program = player.get_sound_program(chip_sound); |
<|file_name|>test_block_device.py<|end_file_name|><|fim▁begin|># Copyright 2013 Red Hat 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/lice... | |
<|file_name|>eventdetails.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
'''
script.matchcenter - Football information for Kodi
A program addon that can be mapped to a key on your remote to display football information.
Livescores, Event details, Line-ups, League tables, next and previous matches b... |
#Set team formation label |
<|file_name|>DirectionalMovementIndicator.java<|end_file_name|><|fim▁begin|>/**
* The MIT License (MIT)
*
* Copyright (c) 2014-2017 Marc de Verdelhan & respective authors (see AUTHORS)
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of
* this software and associated documentation ... | |
<|file_name|>httpEncodings.go<|end_file_name|><|fim▁begin|>package encoding
import (
"compress/gzip"
"compress/lzw"
"compress/zlib"
"io"
"github.com/JOTPOT-UK/JOTPOT-Server/http/http1/encoding/chunked"
"github.com/JOTPOT-UK/JOTPOT-Server/jps/pipe"
)
//ChunkedEncoding is the Encoding for HTTP chunked encoding.
... | |
<|file_name|>Fonts.py<|end_file_name|><|fim▁begin|>#
# Copyright 2001 - 2006 Ludek Smid [http://www.ospace.net/]
#
# This file is part of Pygame.UI.
#
# Pygame.UI is free software; you can redistribute it and/or modify
# it under the terms of the Lesser GNU General Public License as published by
# the Free ... | |
<|file_name|>testqgsgrassprovider.cpp<|end_file_name|><|fim▁begin|>/***************************************************************************
testqgsgrassprovider.cpp
--------------------------------------
Date : April 2015
Copyright : (C) 2015 by Radim Blazek
Email ... | reportRow( "cannot create temporary location" );
GVERIFY( false );
return;
} |
<|file_name|>__manifest__.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
{
'name': 'Gengo Translator',
'category': 'Website/Website',
'summary': 'Translate website in one-click',
'description': """
This module allows to... | |
<|file_name|>rnn_cell_impl.py<|end_file_name|><|fim▁begin|># Copyright 2015 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apa... | """
def __init__(self, trainable=True, name=None, dtype=None, **kwargs): |
<|file_name|>test_sup.rs<|end_file_name|><|fim▁begin|>// Copyright (c) 2017 Chef Software Inc. and/or applicable contributors
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// htt... | self.process = Some(child);
} |
<|file_name|>org.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
if False:
from gluon import current, URL, SQLFORM, redirect
from gluon import IS_NOT_EMPTY, Field, IS_EMAIL
from gluon import IS_NOT_IN_DB
request = current.request
response = current.response
session = current.session
... | user_list = org.users |
<|file_name|>base.py<|end_file_name|><|fim▁begin|>class Blood(object):<|fim▁hole|> """
Most characters will have ordinary blood but some could have acidic blood or with other properties.
"""<|fim▁end|> | uid = "blood"
name = "Blood" |
<|file_name|>jni_generator_tests.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
# Copyright (c) 2012 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.
"""Tests for jni_generator.py.
This test suite contains various t... | def _ReadGoldenFile(self, golden_file):
if not os.path.exists(golden_file): |
<|file_name|>index.js<|end_file_name|><|fim▁begin|>var crypto = require('crypto');
var Canvas = require('canvas');
var _ = require('lodash');
var bu = require('./bufutil');
var fmt = require('util').format;
var unpack = require('./unpack');
var bright = require('./bright');
function fprint(buf, len) {
if (len > 64)
... | }; |
<|file_name|>Solution.rs<|end_file_name|><|fim▁begin|>use std::collections::HashMap;
impl Solution {
pub fn two_sum(nums: Vec<i32>, target: i32) -> Vec<i32> {
let mut numIdx: HashMap<i32, i32> = HashMap::new();
for (i, num) in nums.iter().enumerate() {<|fim▁hole|> }
return vec![-1, ... | if numIdx.contains_key(&(target - num)) {
return vec![numIdx[&(target - num)], i as i32];
}
numIdx.insert(*num, i as i32); |
<|file_name|>index.rs<|end_file_name|><|fim▁begin|>use super::Value;
use crate::map::Map;
use alloc::borrow::ToOwned;
use alloc::string::String;
use core::fmt::{self, Display};
use core::ops;
/// A type that can be used to index into a `serde_json::Value`.
///
/// The [`get`] and [`get_mut`] methods of `Value` accept ... | self[..].index_into_mut(v)
} |
<|file_name|>test_qgslayoutview.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
"""QGIS Unit tests for QgsLayoutView.
.. note:: 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 ... | self.assertEqual(item1.sizeWithUnits(), QgsLayoutSize(18, 16, QgsUnitTypes.LayoutMillimeters))
self.assertEqual(item2.sizeWithUnits(), QgsLayoutSize(10, 16, QgsUnitTypes.LayoutMillimeters))
self.assertEqual(item3.sizeWithUnits(), QgsLayoutSize(1.8, 1.6, QgsUnitTypes.LayoutCentimeters)) |
<|file_name|>climatechange.rsds.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
########################################
#Globale Karte fuer tests
# from Rabea Amther
########################################<|fim▁hole|>import pylab as pl
import Scientific.IO.NetCDF as IO
import matplotlib as mpl
import matplotli... | # http://gfesuite.noaa.gov/developer/netCDFPythonInterface.html
import math
import numpy as np |
<|file_name|>updatetickets.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
import logging<|fim▁hole|>logger = logging.getLogger(__name__)
import requests
import os
from django.core.management.base import NoArgsCommand
from apps.subscribers.models import Ticket
class Command(NoArgsCommand):
help = 'Loop... | |
<|file_name|>table-state-storage.spec.ts<|end_file_name|><|fim▁begin|>import { fakeAsync, tick } from '@angular/core/testing';
import { expect } from 'chai';
import { TableState } from './table-state';
import { TableStateStorage } from './table-state-storage';
describe('TableStateStorage', () => {
let store: Table... | |
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|>"""Home Assistant Switcher Component."""
from asyncio import QueueEmpty, TimeoutError as Asyncio_TimeoutError, wait_for
from datetime import datetime, timedelta
import logging
from typing import Dict, Optional
from aioswitcher.api import SwitcherV2Api
from aioswitc... | |
<|file_name|>job.py<|end_file_name|><|fim▁begin|># Created By: Virgil Dupras
# Created On: 2004/12/20
# Copyright 2011 Hardcoded Software (http://www.hardcoded.net)
# This software is licensed under the "BSD" License as described in the "LICENSE" file,
# which should be included with this package. The terms are also ... | """
self._passed_jobs += self._current_job |
<|file_name|>CuotaServiceImpl.java<|end_file_name|><|fim▁begin|>/**
*
*/
package co.innovate.rentavoz.services.almacen.impl;
import java.io.Serializable;
import java.util.Date;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
impo... | * @author <a href="mailto:elmerdiazlazo@gmail.com">Elmer Jose Diaz Lazo</a> |
<|file_name|>mavproxy_link.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
'''enable run-time addition and removal of master link, just like --master on the cnd line'''
''' TO USE:
link add 10.11.12.13:14550
link list
link remove 3 # to remove 3rd output
'''
from pymavlink import mavutil
import ... | def parse_link_descriptor(self, descriptor):
'''parse e.g. 'udpin:127.0.0.1:9877:{"foo":"bar"}' into
python structure ("udpin:127.0.0.1:9877", {"foo":"bar"})''' |
<|file_name|>client.py<|end_file_name|><|fim▁begin|># - coding: utf-8 -
# Copyright (C) 2007 Patryk Zawadzki <patrys at pld-linux.org>
# Copyright (C) 2007-2009 Toms Baugis <toms.baugis@gmail.com>
# This file is part of Project Hamster.
# Project Hamster is free software: you can redistribute it and/or modify
# it u... | fact.serialized_name(),
start_time, |
<|file_name|>log.rs<|end_file_name|><|fim▁begin|>/* Copyright (C) 2018 Open Information Security Foundation
*
* You can copy, redistribute or modify this Program under the terms of
* the GNU General Public License version 2 as published by the Free
* Software Foundation.
*
* This program is distributed in the hop... | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
<|file_name|>_student_t_likelihood_function.py<|end_file_name|><|fim▁begin|>"""A likelihood function representing a Student-t distribution.
Author:
Ilias Bilionis
Date:
1/21/2013
"""
__all__ = ['StudentTLikelihoodFunction']
import numpy as np
import scipy
import math
from . import GaussianLikelihoodFuncti... | |
<|file_name|>Field.js<|end_file_name|><|fim▁begin|>var Core = require('cw-core');
var Exception = Core.Exception;
var ArgumentNullException = Core.ArgumentNullException;
var ArgumentException = Core.ArgumentException;
var Arr = Core.Arr;
var Enumerable = require('linq');
var _ = require('underscore');
var Field = (f... | |
<|file_name|>assignability-trait.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.apache... | let mut len = 0;
x.iterate(|_y| {
len += 1; |
<|file_name|>serialServer.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
# -*- coding: utf-8 -*-
import serial
gSerialName = '/dev/ttyS0'
gBaudrate = 9600
gTimeout = 0
gRequestByte = 1
if __name__ == "__main__":
ser = serial.Serial(
port = gSerialName,
baudrate = gBaudrate,
... | |
<|file_name|>cloudspeech_demo.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python3
# Copyright 2017 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... | def get_hints(language_code):
if language_code.startswith('en_'): |
<|file_name|>partial.js<|end_file_name|><|fim▁begin|>/* */
var convert = require('./convert');<|fim▁hole|><|fim▁end|> | module.exports = convert('partial', require('../partial')); |
<|file_name|>test_recent_enrollments.py<|end_file_name|><|fim▁begin|>"""
Tests for the recently enrolled messaging within the Dashboard.
"""
import datetime
import unittest
import ddt
from django.conf import settings
from django.urls import reverse
from django.utils.timezone import now
from opaque_keys.edx import lo... | Test if the function for filtering recent enrollments works appropriately.
"""
self._configure_message_timeout(60)
|
<|file_name|>models.py<|end_file_name|><|fim▁begin|>from django.db import models
# Create your models here.
class Event(models.Model):
url = models.URLField(null=True)
img_url = models.URLField(null=True)<|fim▁hole|>
def __str__(self):
return self.title<|fim▁end|> | title = models.CharField(max_length=200)
description = models.TextField() |
<|file_name|>renderer.rs<|end_file_name|><|fim▁begin|>use std::fmt;
use std::error::Error;
use super::format::{Format, DefaultFormat};<|fim▁hole|>use super::super::ast::Block;
#[derive(Debug)]
pub enum RenderError {
ParseError(ParseError),
}
///
/// # Example
///
/// ```
/// use squid::html::Renderer;
/// use squ... | use super::builders::Builder;
use super::output::Output;
use super::super::error::ParseError; |
<|file_name|>test-platform.js<|end_file_name|><|fim▁begin|>/**
* Copyright 2015 The AMP HTML 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... | testStandalone(' ', null);
});
|
<|file_name|>JobUtils.java<|end_file_name|><|fim▁begin|>/*
* The MIT License
*
* Copyright 2019 Intuit Inc.
*
* 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, inclu... | */
package com.intuit.karate.job; |
<|file_name|>toy_build.py<|end_file_name|><|fim▁begin|># #
# Copyright 2013-2014 Ghent University
#
# This file is part of EasyBuild,
# originally created by the HPC team of Ghent University (http://ugent.be/hpc/en),
# with support of Ghent University (http://ugent.be/hpc),
# the Flemish Supercomputer Centre (VSC) (htt... | |
<|file_name|>urls.py<|end_file_name|><|fim▁begin|>from django.test import TestCase<|fim▁hole|> pass<|fim▁end|> |
class CollectionTests(TestCase): |
<|file_name|>content_test.py<|end_file_name|><|fim▁begin|>import unittest
from mock import Mock
from biicode.common.model.content import Content
from biicode.common.model.content import ContentDeserializer
from biicode.common.model.content import content_diff
from biicode.common.exception import BiiSerializationExcepti... | content_load1.is_binary = Mock(return_value=False)
content_load2.is_binary = Mock(return_value=True)
self.assertEquals(content_diff(content_load1, content_load2),
"Unable to diff binary contents of base") |
<|file_name|>signal_blocker.hpp<|end_file_name|><|fim▁begin|>//
// detail/signal_blocker.hpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~
//
// Copyright (c) 2003-2014 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// Distributed under the Boost Software License, Version 1.0. (See accompanying
// file LICENSE_1_0.txt or copy a... | } // namespace detail
} // namespace asio
#endif // ASIO_DETAIL_SIGNAL_BLOCKER_HPP |
<|file_name|>list1.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python -tt
# Copyright 2010 Google Inc.
# Licensed under the Apache License, Version 2.0
# http://www.apache.org/licenses/LICENSE-2.0
# Google's Python Class
# http://code.google.com/edu/languages/google-python-class/
# Basic list exercises
# Fill in the c... |
# C. sort_last |
<|file_name|>origin.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 servo_rand;
use std::cell::RefCell;
use std::rc::Rc;
use u... | pub fn same_origin(&self, other: &MutableOrigin) -> bool {
self == other.immutable()
}
|
<|file_name|>x5_7.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python
print " __ "
print " |__|____ ___ __ "
print " | \__ \\\\ \/ / "
print " | |/ __ \\\\ / "
print " /\__| (____ /\_/ "
p... | module = imm.getModule(key)
module_baseAddress = module.getBaseAddress() |
<|file_name|>document.js<|end_file_name|><|fim▁begin|>/*
* Copyright (C) 2013 Google Inc., authors, and contributors <see AUTHORS file>
* Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file>
* Created By:
* Maintained By:
*/
//= require can.jquery-all
//= require models/cacheable
(functio... | this.documentable_type || (this.documentable && this.documentable.type),
this.documentable_id || (this.documentable && this.documentable.id))); |
<|file_name|>setup.py<|end_file_name|><|fim▁begin|>import os
import codecs
try:
from setuptools import (setup, find_packages)
except ImportError:
from distutils.core import (setup, find_packages)
VERSION = (0, 2, 0)
__version__ = '.'.join(map(str, VERSION[:3])) + "".join(VERSION[3:])
__package_name__ = 'pel... | __keywords__ = 'pelican blogging blog static webdevelopment plugin pelican-plugin readtime python python3 python2'
|
<|file_name|>Form.js<|end_file_name|><|fim▁begin|>import React, {Component} from 'react'
import {findDOMNode} from 'react-dom'
import styles from '../sass/Form'
import {Button, Form, Input, DatePicker, Select} from 'antd'
class FormComponent extends Component {
constructor() {
super()
this.handleSubmit = th... | } |
<|file_name|>CardNumberProviderTest.java<|end_file_name|><|fim▁begin|>package com.omnicrola.panoptes.ui.autocomplete;
import static org.easymock.EasyMock.expect;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue;
import java.util.Arrays;
import java.util.List;
import org.junit.Te... | assertTrue(optionsList.contains(this.expectedNumber1));
assertTrue(optionsList.contains(this.expectedNumber2));
assertTrue(optionsList.contains(this.expectedNumber3));
} |
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|>#!/bin/env/python
# coding: utf-8
import logging
import os
import time
import uuid
from logging import Formatter
from logging.handlers import RotatingFileHandler
from multiprocessing import Queue
from time import strftime
import dill
from .commands import *
from ... |
def __next__(self):
"""
Enables the object to be used as an iterator. Each iteration will produce a progress update in the logger. |
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|>import sublime
HOST_PLATFORM = sublime.platform()
<|fim▁hole|>LINUX = 'linux'
OSX = 'osx'<|fim▁end|> |
WINDOWS = 'windows'
|
<|file_name|>DP20120709A.py<|end_file_name|><|fim▁begin|>"""
The Fibonacci numbers, which we are all familiar with, start like this:
0,1,1,2,3,5,8,13,21,34,...
Where each new number in the sequence is the sum of the previous two.
It turns out that by summing different Fibonacci numbers with each other, you can creat... | |
<|file_name|>dev.py<|end_file_name|><|fim▁begin|>from .base import *
<|fim▁hole|># See https://docs.djangoproject.com/en/1.9/howto/deployment/checklist/
# SECURITY WARNING: keep the secret key used in production secret!
SECRET_KEY = '!i%7s@1+v&293zcy*kljuke=_l176nqpj2-3dtms()pw^et!we'
# SECURITY WARNING: don't run wi... | # Quick-start development settings - unsuitable for production |
<|file_name|>term.js<|end_file_name|><|fim▁begin|>document.write('<div id="terminal" class="terminal-content"></div>');
var session = {};
// return a parameter value from the current URL
function getParam(sname) {
var params = location.search.substr(location.search.indexOf("?") + 1);
var sval = "";
params... | });
var candidatesForms = _.map(completionResult.candidates, function (cand) { |
<|file_name|>message_based_server.py<|end_file_name|><|fim▁begin|>###############################################################################
#
# The MIT License (MIT)
#
# Copyright (c) Tavendo GmbH
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associ... | # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
# THE SOFTWARE.
#
###############################################################################
|
<|file_name|>consumer.py<|end_file_name|><|fim▁begin|>from channels.auth import channel_session_user_from_http
from .models import Stream, Notification
import redis
import ast
from .task import sendNotifications, send_notifications
from channels import Group
import json
redis_con = redis.Redis('demo.scorebeyond.com', ... | print data1['name']
if Notification.objects.filter(event_name=data1['name']):
notif = Notification.objects.get(event_name=data1['name'])
if notif.no_delay: |
<|file_name|>angular-locale_ss-za.js<|end_file_name|><|fim▁begin|>version https://git-lfs.github.com/spec/v1<|fim▁hole|><|fim▁end|> | oid sha256:b7405262706997cffc865837cffd6bd9eb92a8f12c3da71795815fb2da9be9f6
size 2483 |
<|file_name|>test_readers.py<|end_file_name|><|fim▁begin|>import unittest
from exporters.readers.base_reader import BaseReader
from exporters.readers.random_reader import RandomReader
from .utils import meta
class BaseReaderTest(unittest.TestCase):
def setUp(self):
self.reader = BaseReader({}, meta())
... |
def test_set_last_position_none(self): |
<|file_name|>tick.rs<|end_file_name|><|fim▁begin|>//use std::time::Duration;
use mio::{EventLoop, Evented, EventLoopConfig, TryAccept};
use handler::LoopHandler;
use internal::Message;
use transport::Transport;
use ::ProtocolFactory;
pub struct Tick<T: TryAccept + Evented, F: ProtocolFactory<T::Output>> where <T as... | |
<|file_name|>python-camera.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
import cv2
# device number "0"
cap = cv2.VideoCapture(0)
while(True):
# Capture a frame
ret, frame = cap.read()
# show on display
cv2.imshow('frame',frame)
# waiting for keyboard input<|fim▁hole|> break
# Save if "s" pressed
... | key = cv2.waitKey(1) & 0xFF
# Exit if "q" pressed
if key == ord('q'): |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.