prompt large_stringlengths 70 991k | completion large_stringlengths 0 1.02k |
|---|---|
<|file_name|>Result.ts<|end_file_name|><|fim▁begin|>import {Serializable, Serialize, UnmarshallError} from "ts-serialize";
import {JsValue, Json} from "ts-json-definition";<|fim▁hole|>const dateUnmarshaller = (value: JsValue, json: Json, clazz: any, classPropertyName: string, jsonPropertyName: string, target: Function,... | import {Either, Right, Left, Optional} from "scalts";
|
<|file_name|>model.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
##############################################################################
##
## This file is part of Sardana
##
## http://www.sardana-controls.org/
##
## Copyright 2011 CELLS / ALBA Synchrotron, Bellaterra, Spain
##
## Sardana is free softwa... | return len(branchNode)
|
<|file_name|>service.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
# outgoing/service.py
# Copyright (C) 2013-2017 LEAP
#
# 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... | :type newmsg: email.message.Message |
<|file_name|>match_on_vec_items.rs<|end_file_name|><|fim▁begin|>#![warn(clippy::match_on_vec_items)]
fn match_with_wildcard() {
let arr = vec![0, 1, 2, 3];
let range = 1..3;
let idx = 1;
// Lint, may panic
match arr[idx] {
0 => println!("0"),
1 => println!("1"),
_ => {},
... | |
<|file_name|>qualitymodis.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
# class to convert/process modis data
#
# (c) Copyright Ingmar Nitze 2013
# Authors: Ingmar Nitze, Luca Delucchi
# Email: initze at ucc dot ie
# Email: luca dot delucchi at iasma dot it
#
###############################################... | quality layers to specific information |
<|file_name|>memory_cache_http_server_unittest.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.
from __future__ import absolute_import
import os
from telemetry.core import u... | # Test byte range request: no end byte.
self.CheckContentHeaders('0-', '0-%d' % last_byte, file_size)
# Test byte range request: greater than zero start byte. |
<|file_name|>ExceptionReplySubjectIdEmpty.java<|end_file_name|><|fim▁begin|>package com.x.bbs.assemble.control.jaxrs.replyinfo.exception;
import com.x.base.core.project.exception.PromptException;
public class ExceptionReplySubjectIdEmpty extends PromptException {<|fim▁hole|>
public ExceptionReplySubjectIdEmpty() {
... |
private static final long serialVersionUID = 1859164370743532895L; |
<|file_name|>StatsAggregationBuilder.java<|end_file_name|><|fim▁begin|>/*
* Licensed to Elasticsearch under one or more contributor
* license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright
* ownership. Elasticsearch licenses this file to you under
* the ... | super(in, ValuesSourceType.NUMERIC, ValueType.NUMERIC); |
<|file_name|>apiproxy_stub.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
#
# Copyright 2007 Google 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/li... | |
<|file_name|>mod.rs<|end_file_name|><|fim▁begin|>pub mod mocknet_controller;
pub mod bitcoin_regtest_controller;
pub use self::mocknet_controller::{MocknetController};
pub use self::bitcoin_regtest_controller::{BitcoinRegtestController};
use super::operations::BurnchainOpSigner;
use std::time::Instant;
use stacks::... |
for op in self.state_transition.accepted_ops.iter() { |
<|file_name|>pythonshell.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
#
# Copyright © 2009-2010 Pierre Raybaut
# Licensed under the terms of the MIT License
# (see spyderlib/__init__.py for details)
"""External Python Shell widget: execute Python script in a separate process"""
import sys
import os
import ... | #-------------------------Python specific-------------------------------
|
<|file_name|>tx.py<|end_file_name|><|fim▁begin|>#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache Lic... | |
<|file_name|>test_edgeql_casts.py<|end_file_name|><|fim▁begin|>#
# This source file is part of the EdgeDB open source project.
#
# Copyright 2018-present MagicStack Inc. and the EdgeDB authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the ... |
# float64 is assignment castable to float32
INSERT ScalarTest { |
<|file_name|>test_ffi_backend.py<|end_file_name|><|fim▁begin|>import py, sys, platform
import pytest
from testing import backend_tests, test_function, test_ownlib
from cffi import FFI
import _cffi_backend
class TestFFI(backend_tests.BackendTests,
test_function.TestFunction,
test_ownlib.Tes... | self.check("char x; long long :56; char y;", 8, L, 8 + L)
self.check("char x; long long z:57; char y;", L + 8, L, L + 8 + L)
self.check("char x; long long :57; char y;", L + 8, L, L + 8 + L)
|
<|file_name|>stdio-is-blocking.rs<|end_file_name|><|fim▁begin|>// run-pass
// ignore-emscripten no processes
// ignore-sgx no processes
use std::env;
use std::io::prelude::*;
use std::process::Command;
use std::thread;
const THREADS: usize = 20;
const WRITES: usize = 100;
const WRITE_SIZE: usize = 1024 * 32;
fn main... | fn write_all(buf: &[u8]) { |
<|file_name|>http.py<|end_file_name|><|fim▁begin|># -*- coding: UTF-8 -*-
import logging
from model_utils import Choices
from simptools.wrappers.http import HttpClient, HttpRequest
from requests.exceptions import ConnectionError
from payway.merchants.models import Merchant
__author__ = 'Razzhivin Alexander'
__email__ ... | self.__set_POST()
def __set_POST(self, *args, **kwargs): |
<|file_name|>Champernownes_constant.py<|end_file_name|><|fim▁begin|>import time
output = ''
i=1
start_time = time.time()<|fim▁hole|> i += 1
print(int(output[9]) * int(output[99]) *
int(output[999]) * int(output[9999]) *
int(output[99999]) * int(output[999999]))
print("--- %s seconds ---" % (time.time()... | while len(output)<1000001:
output +=str(i) |
<|file_name|>html_emitter.py<|end_file_name|><|fim▁begin|>"""
Copyright 2015 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 requi... | else:
# module doesn't have any identities
idents_div = "" |
<|file_name|>pref.go<|end_file_name|><|fim▁begin|>// Code generated by goagen v1.1.0, command line:
// $ goagen
// --design=github.com/tikasan/eventory/design
// --out=$(GOPATH)
// --version=v1.1.0-dirty
//
// API "eventory": Models
//
// The content of this file is auto-generated, DO NOT MODIFY
package models
import... | err := m.Db.Table(m.TableName()).Where("id = ?", id).Find(&native).Error |
<|file_name|>mod.rs<|end_file_name|><|fim▁begin|>// CITA
// Copyright 2016-2017 Cryptape Technologies LLC.
// This program is free software: you can redistribute it
// and/or modify it under the terms of the GNU General Public
// License as published by the Free Software Foundation,
// either version 3 of the License,... | /// Panics if `is_builtin(a)` is not true.
fn execute_builtin(&self, a: &Address, input: &[u8], output: &mut BytesRef) {
self.builtins().get(a).expect("attempted to execute nonexistent builtin").execute(input, output); |
<|file_name|>bitcoin_bs.ts<|end_file_name|><|fim▁begin|><?xml version="1.0" ?><!DOCTYPE TS><TS language="bs" version="2.0">
<defaultcodec>UTF-8</defaultcodec>
<context>
<name>AboutDialog</name>
<message>
<location filename="../forms/aboutdialog.ui" line="+14"/>
<source>About Phicoin</source>
... | |
<|file_name|>setting_dealingThread.java<|end_file_name|><|fim▁begin|>package server.thread.systemSettingsThread;
import java.io.IOException;
import java.io.ObjectInputStream;
import java.net.Socket;
import java.sql.Connection;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;
... | import server.serverMain.serverMain;
import server.thread.systemMessageThread.sendSystemMessageThread;
|
<|file_name|>edmsetup.py<|end_file_name|><|fim▁begin|>import sys
import click
import os
import subprocess
from packageinfo import BUILD, VERSION, NAME
if "WM_PROJECT" not in os.environ:
print("To run this command you must source edmenv.sh first")
sys.exit(1)
# The version of the buildcommon to checkout.
BUIL... |
click.echo("Done")
|
<|file_name|>DeleteOrganization.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
###############################################################################
#
# DeleteOrganization
# Deletes an existing organization.<|fim▁hole|>#
# Copyright 2014, Temboo Inc.
#
# Licensed under the Apache License, Version 2.... | #
# Python versions 2.6, 2.7, 3.x |
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|>#-----------------------------------------------------------------------------
# Copyright (c) 2012 - 2020, Anaconda, Inc., and Bokeh Contributors.
# All rights reserved.
#
# The full license is in the file LICENSE.txt, distributed with this software.
#-------------... | # Dev API
#-----------------------------------------------------------------------------
#----------------------------------------------------------------------------- |
<|file_name|>0061_change_zip_code_sort_order.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
from south.v2 import DataMigration
class Migration(DataMigration):
def forwards(self, orm):
orm.Boundary.objects.filter(category='Zip Code').update(sort_order=5)
def backwards(self, orm):
pass... | 'Meta': {'object_name': 'Group'},
u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '80'}), |
<|file_name|>MBeanInvocationHandlerImpl.java<|end_file_name|><|fim▁begin|>/*
*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this ... |
private final static String DELEGATE = "JMImplementation:type=MBeanServerDelegate"; |
<|file_name|>dewgetaway2.java<|end_file_name|><|fim▁begin|>/*
* Author: patiphat mana-u-krid (dew)
* E-Mail: dewtx29@gmail.com
* facebook: https://www.facebook.com/dewddminecraft
*/
package dewddgetaway;
import java.util.Random;
import java.util.Stack;
import org.bukkit.Bukkit;
import or... |
int ra = 5;
int ddatamax = 29;
|
<|file_name|>HHPH2013data_to_burnman.py<|end_file_name|><|fim▁begin|># BurnMan - a lower mantle toolkit
# Copyright (C) 2012-2014, Myhill, R., Heister, T., Unterborn, C., Rose, I. and Cottaar, S.<|fim▁hole|>
import sys
def read_dataset(datafile):
f=open(datafile,'r')
ds=[]
for line in f:
ds.append... | # Released under GPL v2 or later.
# This is a standalone program that converts a tabulated version of the Stixrude and Lithgow-Bertelloni data format into the standard burnman format (printed to stdout)
|
<|file_name|>writer-opts.js<|end_file_name|><|fim▁begin|>'use strict'
const Q = require(`q`)
const readFile = Q.denodeify(require(`fs`).readFile)
const resolve = require(`path`).resolve
module.exports = Q.all([
readFile(resolve(__dirname, './templates/template.hbs'), 'utf-8'),
readFile(resolve(__dirname, './templ... | commit.hash = commit.hash.substring(0, 7)
} |
<|file_name|>AbstractIndexInfoOptimizer.java<|end_file_name|><|fim▁begin|>/*
* Copyright 2004-2009 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* ... | * |
<|file_name|>glib.rs<|end_file_name|><|fim▁begin|>// Copyleft (ↄ) meh. <meh@schizofreni.co> | http://meh.schizofreni.co
//
// This file is part of cancer.
//
// cancer 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 Fou... | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
<|file_name|>register.rs<|end_file_name|><|fim▁begin|>use super::super::{IrcMsg, numerics};
use super::super::message_types::server;
pub type RegisterResult = Result<(), RegisterError>;
#[derive(Clone, Debug)]
pub struct RegisterError {
pub errtype: RegisterErrorType,
pub message: IrcMsg,
}
impl RegisterErro... | numerics::ERR_NICKNAMEINUSE == (num as i32)
},
_ => false |
<|file_name|>restoreObject.py<|end_file_name|><|fim▁begin|>from django.core.management.base import BaseCommand, CommandError
import __future__
from ModelTracker.models import History
import datetime
from django.apps import apps
def getModel(table_name):
return next((m for m in apps.get_models() if m._meta.db_table=... | |
<|file_name|>models.py<|end_file_name|><|fim▁begin|>"""Utilities for defining models
"""
import operator
from typing import Any, Callable, Type
class KeyBasedCompareMixin:
"""Provides comparison capabilities that is based on a key"""
__slots__ = ["_compare_key", "_defining_class"]
def __init__(self, ke... | def __lt__(self, other):
# type: (Any) -> bool
return self._compare(other, operator.__lt__)
|
<|file_name|>pad_controller.rs<|end_file_name|><|fim▁begin|>// Copyright 2013-2018, The Gtk-rs Project Developers.
// See the COPYRIGHT file at the top-level directory of this distribution.
// Licensed under the MIT license, see the LICENSE file or <http://opensource.org/licenses/MIT>
use ffi;
use glib::IsA;
use glib:... | }
impl<O: IsA<PadController>> PadControllerExtManual for O { |
<|file_name|>0001_initial.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
from django.conf import settings
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_M... | ),
] |
<|file_name|>index.js<|end_file_name|><|fim▁begin|>'use strict';
const expect = require('chai').expect;
const deepfind = require('../index');
const simpleFixture = {
'key': 'value'
};
const complexFixture = {
'key1': {
'key': 'value1'
},
'key2': {
'key': 'value2'
},
'key3': {
'key': 'value3'
... | expect(deepfind(simpleFixture, 'key')).to.be.an.array;
expect(deepfind(simpleFixture, 'key')).to.deep.equal(['value']);
});
|
<|file_name|>interval.cc<|end_file_name|><|fim▁begin|>// Copyright 2021 The XLS Authors
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2... | |
<|file_name|>listenconn.go<|end_file_name|><|fim▁begin|>package core
import (
"net";
"os";
"log";
)
type acceptFunc func(net.Conn)
type errorFunc func(os.Error)
// A listen socket.
type listenConn struct {
listen net.Listener;
accept acceptFunc;
error errorFunc;<|fim▁hole|> l := &listenConn{listen, accept, err... | }
func newListenConn(listen net.Listener, accept acceptFunc, error errorFunc) *listenConn { |
<|file_name|>collapsible_match.rs<|end_file_name|><|fim▁begin|>use clippy_utils::diagnostics::span_lint_and_then;
use clippy_utils::visitors::LocalUsedVisitor;
use clippy_utils::{higher, is_lang_ctor, is_unit_expr, path_to_local, peel_ref_operators, SpanlessEq};
use if_chain::if_chain;
use rustc_hir::LangItem::OptionNo... | /// }
/// None => return,
/// }; |
<|file_name|>viewport.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/. */
//! The [`@viewport`][at] at-rule and [`meta`][meta] element... | |
<|file_name|>suite_004_navbase.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
"""Package for suites and tests related to bots.modules package"""
import pytest
from qacode.core.bots.modules.nav_base import NavBase
from qacode.core.exceptions.core_exception import CoreException
from qacode.core.testing.asserts... | "bad_text") |
<|file_name|>issue-14853.rs<|end_file_name|><|fim▁begin|>use std::fmt::Debug;
trait Str {}
trait Something: Sized {
fn yay<T: Debug>(_: Option<Self>, thing: &[T]);
}
struct X { data: u32 }
impl Something for X {
fn yay<T: Str>(_:Option<X>, thing: &[T]) {
//~^ ERROR E0276
}
}<|fim▁hole|> println!(... |
fn main() {
let arr = &["one", "two", "three"]; |
<|file_name|>validators.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
# Copyright (c) 2011-2014 Berkeley Model United Nations. All rights reserved.
# Use of this source code is governed by a BSD License (see LICENSE).
import re
from rest_framework.serializers import ValidationError
def name(value):
'... |
def email(value):
'''Loosely matches email addresses.'''
if re.match(r'^[\w_.+-]+@[\w-]+\.[\w\-.]+$', value) is None: |
<|file_name|>scoreovertime.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python3
import sys
from lxml import html
import urllib3
import re
http = urllib3.PoolManager()
baseUrl = 'http://scoreboard.uscyberpatriot.org/'
scoresPage = html.fromstring(http.request('GET', baseUrl + 'team.php?team=' + sys.argv[1]).data)
# X... | |
<|file_name|>nodeGraphs.tsx<|end_file_name|><|fim▁begin|>import * as React from "react";
import * as d3 from "d3";
import GraphGroup from "../components/graphGroup";
import { LineGraph, Axis, Metric } from "../components/linegraph";
import { StackedAreaGraph } from "../components/stackedgraph";
import { Bytes } from "... | <Metric name="cr.store.raft.process.workingnanos" title="Working" nonNegativeRate />
<Metric name="cr.store.raft.process.tickingnanos" title="Ticking" nonNegativeRate />
</Axis>
</StackedAreaGraph> |
<|file_name|>AttributesProcessor.ts<|end_file_name|><|fim▁begin|>/*
* Copyright The OpenTelemetry Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.or... | Object.keys(incoming)
.filter(attributeName => this._allowedAttributeNames.includes(attributeName)) |
<|file_name|>stringtableduplicates.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python3
import os
import sys
import xml.dom
from xml.dom import minidom
# STRINGTABLE DIAG TOOL
# Author: KoffeinFlummi
# ---------------------
# Counts duplicates stringtable entries
def check_module(projectpath, module):
""" Ch... | stringtablepath = os.path.join(projectpath, module, "stringtable.xml")
try:
xmldoc = minidom.parse(stringtablepath) |
<|file_name|>cds.js<|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/lic... | // @codekit-append 'components/schedule.js'
|
<|file_name|>app.go<|end_file_name|><|fim▁begin|>package app
import (
"github.com/GodSlave/MyGoServer/module"
"github.com/GodSlave/MyGoServer/conf"
"os/exec"
"os"
"path/filepath"
"fmt"
"flag"
"github.com/GodSlave/MyGoServer/log"
"github.com/GodSlave/MyGoServer/module/base"
"github.com/GodSlave/MyGoServer/rpc... | |
<|file_name|>utils.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
""" OneLogin_Saml2_Utils class
Copyright (c) 2014, OneLogin, Inc.
All rights reserved.
Auxiliary class of OneLogin's Python Toolkit.
"""
import base64
from datetime import datetime
import calendar
from hashlib import sha1, sha256, sha384, s... | @staticmethod
def generate_unique_id(): |
<|file_name|>test.rs<|end_file_name|><|fim▁begin|>extern crate dyon;
use dyon::{error, run};
<|fim▁hole|><|fim▁end|> | fn main() {
error(run("source/test.dyon"));
} |
<|file_name|>hsl.rs<|end_file_name|><|fim▁begin|>//! The HSL device-dependent polar color model
use crate::channel::{
AngularChannel, AngularChannelScalar, ChannelCast, ChannelFormatCast, ColorChannel,
PosNormalBoundedChannel, PosNormalChannelScalar,
};
use crate::color;
use crate::color::{Color, FromTuple};
u... | where |
<|file_name|>test.js<|end_file_name|><|fim▁begin|>describe('[Regression](GH-1424)', function () {
it('Should raise click event on a button after "enter" key is pressed', function () {
return runTests('testcafe-fixtures/index-test.js', 'Press enter');<|fim▁hole|><|fim▁end|> | });
}); |
<|file_name|>DisplayService.java<|end_file_name|><|fim▁begin|>package com.luciofm.presentation.androidsalao;<|fim▁hole|>
void connection(boolean connetion);
void next();
void previous();
void advance();
}<|fim▁end|> |
public interface DisplayService { |
<|file_name|>box.go<|end_file_name|><|fim▁begin|>// Package box stores values that may be undefined, unknown, or empty.
package box
import (
"strconv"
"time"
)
const (
Undefined = iota
Unknown = iota
Empty = iota
Full = iota
)
type Bool struct {
value bool
status byte
}
// NewBool returns a Bool... | |
<|file_name|>CdiFxSaft.java<|end_file_name|><|fim▁begin|>/*
* Copyright (C) 2020 GG-Net GmbH
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at you... | *
* You should have received a copy of the GNU General Public License |
<|file_name|>creatabla.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python
<|fim▁hole|>conn = sqlite3.connect('accesslist.db')
conn.execute('''CREATE TABLE USUARIO
(CELLPHONE CHAR(11) PRIMARY KEY NOT NULL,
PASSWD CHAR(138) NOT NULL);''')
print "Table created successfully";
conn.close()<|fim▁e... | import sqlite3
|
<|file_name|>setAwayMessageEvent.py<|end_file_name|><|fim▁begin|><|fim▁hole|>
def handle(userToken, packetData):
# get token data
username = userToken.username
# Read packet data
packetData = clientPackets.setAwayMessage(packetData)
# Set token away message
userToken.awayMessage = packetData["awayMessage"]
# ... | from common.log import logUtils as log
from constants import clientPackets
from constants import serverPackets
|
<|file_name|>main.go<|end_file_name|><|fim▁begin|>package lcd2usb
import (
"errors"
"fmt"
"github.com/schleibinger/sio"
)
type cmd byte
const (
cmdPrefix cmd = 0xfe
cmdBacklightOn = 0x42
cmdBacklightOff = 0x46
cmdBrightnes = 0x99 // brightnes
cmdContrast = 0x50 // con... | |
<|file_name|>base_test.py<|end_file_name|><|fim▁begin|>import networkx as nx
class BaseTestAttributeMixing(object):
def setUp(self):
G=nx.Graph()
G.add_nodes_from([0,1],fish='one')
G.add_nodes_from([2,3],fish='two')
G.add_nodes_from([4],fish='red')
G.add_nodes... | |
<|file_name|>format-url.js<|end_file_name|><|fim▁begin|>export default function formatUrl({ baseUrl, size, theme, uri, view }) {
let src = `${baseUrl}/?uri=${uri}&size=${size}&theme=${theme}`;
if (view) {
src += `&view=${view}`;
}<|fim▁hole|>
return src;
}<|fim▁end|> | |
<|file_name|>TransformCreateCall.java<|end_file_name|><|fim▁begin|>/**
* The MIT License
* Copyright (c) 2003 David G Jones
*
* 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 res... | |
<|file_name|>drums_rnn_create_dataset.py<|end_file_name|><|fim▁begin|># Copyright 2022 The Magenta Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licen... | 'are populated with SequenceExample protos.')
flags.DEFINE_float(
'eval_ratio', 0.1, |
<|file_name|>inherited_box.mako.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/. */
<%namespace name="helpers" file="/helpers.mako.rs"... | spec="https://drafts.csswg.org/css-images/#propdef-image-orientation", |
<|file_name|>ResourceData.cpp<|end_file_name|><|fim▁begin|>#include "ResourceData.h"
ResourceData::ResourceData()
{
}
ResourceData::~ResourceData()
{<|fim▁hole|><|fim▁end|> |
} |
<|file_name|>prune_hidden_pass.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.o... | }
}
|
<|file_name|>decorators.py<|end_file_name|><|fim▁begin|>from django.contrib.auth.decorators import login_required
from django.http import HttpResponseRedirect
from functools import wraps
TRANSIENT_USER_TYPES = []
def is_transient_user(user):
return isinstance(user, tuple(TRANSIENT_USER_TYPES))
def prevent_access... | return list(func(*args, **kwargs))
return f |
<|file_name|>SearchAlbum.js<|end_file_name|><|fim▁begin|>let React = require('react'),
SearchItem = require('./SearchItem');
let SearchAlbum = React.createClass({
contextTypes: {
updateRoute: React.PropTypes.func,
goBack: React.PropTypes.func,
data: React.PropTypes.array,
addTrack: React.PropTypes... | albumUrl = `http://direct.rhapsody.com/imageserver/v2/albums/${albumId}/images/170x170.jpg`;
} |
<|file_name|>test.cpp<|end_file_name|><|fim▁begin|>#include <gtest/gtest.h>
#include "solution.h"
TEST(test, testcase0)
{
Stack s;
EXPECT_EQ(true, s.empty());
s.push(1);
s.push(2);
s.push(3);
EXPECT_EQ(false, s.empty());
EXPECT_EQ(3, s.top());<|fim▁hole|> EXPECT_EQ(2, s.top());
s.pop... | s.pop(); |
<|file_name|>record_spec.ts<|end_file_name|><|fim▁begin|>/**
* @license
* Copyright Google LLC All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.io/license
*/
/* eslint-disable @typescript-eslint/no-explicit-any */
impo... | const target = base.clone();
host.commit(target).subscribe(undefined, done.fail); |
<|file_name|>management.py<|end_file_name|><|fim▁begin|>from django.apps import apps
from django.dispatch import receiver
from django.db.models.signals import post_migrate
@receiver(post_migrate, sender=apps.get_app_config('autodidact'))
def create_homepage(sender, **kwargs):
'''Receiver function that populates th... | if not Page.objects.exists():
Page(content='***Hello, world!***').save() |
<|file_name|>day_4.rs<|end_file_name|><|fim▁begin|>#[derive(Default)]<|fim▁hole|>}
impl Game {
pub fn new() -> Game {
Game { score: 0, rolls: Vec::with_capacity(21) }
}
pub fn roll(&mut self, pins: i32) {
self.rolls.push(pins);
}
pub fn score(&self) -> i32 {
let mut score ... | #[allow(dead_code)]
pub struct Game {
score: i32,
rolls: Vec<i32>, |
<|file_name|>boxed.rs<|end_file_name|><|fim▁begin|>use std::any::{self, Any};
use std::ops::Deref;
use neon_runtime::raw;
use neon_runtime::external;
use crate::context::{Context, FinalizeContext};
use crate::context::internal::Env;
use crate::handle::{Managed, Handle};
use crate::types::internal::ValueInternal;
use ... | |
<|file_name|>trip_planner.js<|end_file_name|><|fim▁begin|>var coords;
var directionsDisplay;
var map;
var travelMode;
var travelModeElement = $('#mode_travel');
// Order of operations for the trip planner (each function will have detailed notes):
// 1) Calculate a user's route, with directions.
// 2) Run a query using... | coordinateBounds['lat1'] = data[keyByIndex[0]]['k'];
coordinateBounds['lat2'] = data[keyByIndex[0]]['j']; |
<|file_name|>base-input.d.ts<|end_file_name|><|fim▁begin|>import { AfterContentInit, ElementRef, EventEmitter, Renderer } from '@angular/core';
import { ControlValueAccessor } from '@angular/forms';
import { NgControl } from '@angular/forms';
import { IonicFormInput } from './form';
import { Ion } from '../components/i... | isFocus(): boolean; |
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|><|fim▁hole|><|fim▁end|> | from jroc.tasks.tokenizers.TokenizerTask import SentenceTokenizerTask, WordTokenizerTask |
<|file_name|>test_lookup.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
import unittest
from pyparsing import ParseException
from cwr.grammar.field import basic
"""
Tests for Table/List Lookup (L) fields.
"""
__author__ = 'Bernardo Martínez Garrido'
__license__ = 'MIT'
__status__ = 'Development'
class Te... |
def setUp(self):
self.lookup = basic.lookup(['AB1', 'CD2', 'EF3']) |
<|file_name|>forms.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
import os
import re
from django.conf import settings
from django.core import validators
from django.core.exceptions import ValidationError
from django.forms.util import ErrorList
from django.forms.fields import MultiValueField, FilePathField, ... | field_value = None
if field_value in validators.EMPTY_VALUES: |
<|file_name|>index.tsx<|end_file_name|><|fim▁begin|>import * as React from "react";
import {render} from "react-dom";
import {AppContainer} from "react-hot-loader";
import App from "./components/App";
const rootEl = document.getElementById("root");
render(<|fim▁hole|> rootEl
);
// Hot Module Replacement API
decla... | <AppContainer>
<App/>
</AppContainer>, |
<|file_name|>generate_config.py<|end_file_name|><|fim▁begin|>from __future__ import absolute_import
from __future__ import unicode_literals
import collections
import jsonschema
DEFAULT_GENERATE_CONFIG_FILENAME = 'generate_config.yaml'
GENERATE_OPTIONS_SCHEMA = {
'type': 'object',
'required': ['repo', 'dat... | 'database',
],
)): |
<|file_name|>setup.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
# "convertor" - converts ODF files from a YUSCII font-encoding to proper UTF-8.
# Copyright (C) 2009 Damjan Georgievski
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero Gen... | 'Programming Language :: Python :: 3.6'
],
test_suite = '', |
<|file_name|>functions.py<|end_file_name|><|fim▁begin|>#!/bin/env python
#-*-coding:utf-8-*-
import MySQLdb
import string
import time
import datetime
import os
import re
import json
import sys
reload(sys)
sys.setdefaultencoding('utf8')
import ConfigParser
import smtplib
from email.mime.text import MIMEText
from em... | |
<|file_name|>document_rule.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/. */
//! [@document rules](https://www.w3.org/TR/2012/WD-css... | }
}
} |
<|file_name|>tract2council.py<|end_file_name|><|fim▁begin|>import sys, os, json, time
from shapely.geometry import Polygon
# http://toblerity.org/shapely/manual.html
contains = {}
intersects = {}
dPoly = {}
unmatched = []
TRACTCOL = 'BoroCT2010' # rename this for 2000 census
def addPoly(coords):
polys = []
i... | |
<|file_name|>semver.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... | build: ~[AlphaNumeric(~"build5")] |
<|file_name|>l2_bell_burst_mod.py<|end_file_name|><|fim▁begin|># Copyright 2011 James McCauley
#
# This file is part of POX.
#
# POX 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 Lice... | |
<|file_name|>VLog.java<|end_file_name|><|fim▁begin|>/* This file is part of VoltDB.
* Copyright (C) 2008-2017 VoltDB Inc.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either ver... |
// turn off this stupid thing for now
/*try { |
<|file_name|>buffer-koans.js<|end_file_name|><|fim▁begin|>var events = require('events'),
koanize = require('koanizer'),
util = require('util');
koanize(this);
// Standard and RFC set these values
var REFERENCE_CLOCK_FREQUENCY = 90000;
// RTP packet constants and masks
var RTP_HEADER_SIZE = 12;
var R... | }
|
<|file_name|>wl.py<|end_file_name|><|fim▁begin|>import pyautogui, win32api, win32con, ctypes, autoit
from PIL import ImageOps, Image, ImageGrab
from numpy import *
import os
import time
import cv2
import random
from Bot import *
def main():
bot = Bot()
autoit.win_wait(bot.title, 5)
counter = 0
poitonU... | |
<|file_name|>wikilinks.py<|end_file_name|><|fim▁begin|>'''
WikiLinks Extension for Python-Markdown
======================================
Converts [[WikiLinks]] to relative links.
See <https://pythonhosted.org/Markdown/extensions/wikilinks.html>
for documentation.
Original code Copyright [Waylan Limberg](http://ach... | |
<|file_name|>add_special.py<|end_file_name|><|fim▁begin|>from django.core.management.base import BaseCommand
from django.contrib.auth.models import User
from photos.models import PhotoSceneCategory
from photos.add import add_photo
#from licenses.models import License
class Command(BaseCommand):
args = '<flickr_d... | |
<|file_name|>index.ts<|end_file_name|><|fim▁begin|>/**
* @license
* Copyright Google Inc. All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be<|fim▁hole|> * found in the LICENSE file at https://angular.io/license
*/
export * from './src/api';
export {TypeCheckContext} f... | |
<|file_name|>jquery.flipper.js<|end_file_name|><|fim▁begin|>/* jquery.flipper (c) MrKMG 2012 */
(function( $ ){
var methods = {
init : function( o ) {
return this.each(function(){
var $this = $(this),
data = $this.data('flipper'),
text = $this.text();
... | setTimeout(function(){ |
<|file_name|>quotes.component.ts<|end_file_name|><|fim▁begin|>import { Component, OnInit } from '@angular/core';
<|fim▁hole|>import { Observable } from 'rxjs';
@Component({
selector: 'app-quotes',
templateUrl: './quotes.component.html',
styleUrls: ['./quotes.component.css']
})
export class QuotesComponent implem... | import { Quote } from '../model/quote';
import { QuoteReactiveService } from '../quote-reactive.service';
import { QuoteBlockingService } from '../quote-blocking.service';
|
<|file_name|>Main.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python
import feedparser
import wget
import sqlite3
import time
RssUrlList = ['http://postitforward.tumblr.com/rss','http://for-war3-blog-blog.tumblr.com/rss']
sleep=3600/len(RssUrlList)
def mkdir(path):
import os
path=path.strip()
path=path.r... | pass
# conn.execute('''CREATE TABLE(BLOG TEXT, ADDRESS TEXT PRIMARY KEY, DATE TEXT);''')
# conn.execute("INSERT INTO %s (BLOG ,ADDRESS, DATE) VALUES ('rss_url','TEST','TEST')" % table) |
<|file_name|>omaps.py<|end_file_name|><|fim▁begin|>from .utils.dataIO import fileIO
from .utils import checks
from __main__ import send_cmd_help
from __main__ import settings as bot_settings
# Sys.
from operator import itemgetter, attrgetter
import discord
from discord.ext import commands
#from copy import deepcopy
imp... | |
<|file_name|>struct_list.rs<|end_file_name|><|fim▁begin|>// Copyright (c) 2013-2015 Sandstorm Development Group, Inc. and contributors
// Licensed under the MIT License:
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Softwa... | pub fn new(builder : ListBuilder<'a>) -> Builder<'a, T> { |
<|file_name|>PharmacologyByTargetTest.js<|end_file_name|><|fim▁begin|>describe('Targets can be searched', function() {
var store_records, store_operation, store_success;
beforeEach(function() {
this.application = Ext.create('Ext.app.Application', {
name:'LSP',
appFolder:'./app',
requires:['LDA.helpe... | 'grids.DynamicGrid',
// 'grids.PharmaGridInf',
// 'Grid', |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.