prompt large_stringlengths 70 991k | completion large_stringlengths 0 1.02k |
|---|---|
<|file_name|>13-For your lists.py<|end_file_name|><|fim▁begin|>numbers = [7, 9, 12, 54, 99]
print "This list contains: "<|fim▁hole|> print num
# Add your loop below!
for num in numbers:
print num ** 2<|fim▁end|> |
for num in numbers: |
<|file_name|>standarditem.cpp<|end_file_name|><|fim▁begin|>/*
Copyright (c) 2009-10 Qtrac Ltd. All rights reserved.
This program or module 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... | setCheckState(done ? Qt::Checked : Qt::Unchecked);
|
<|file_name|>generate_test_mask_image.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
***************************************************************************
generate_test_mask_image.py
---------------------
Date : February 2015
Copyright ... | sys.exit(1)
|
<|file_name|>StreamRDFLib.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 file
* to you u... | { return new StreamRDFCountingBase(other) ; }
private static class ParserOutputSinkTriplesToQuads extends StreamRDFWrapper |
<|file_name|>watching.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
# - * - mode: python; coding: utf-8 - * -<|fim▁hole|># Copyright (C) 2013 Andrey Degtyarev <ad.dycost@gmail.com>
# This program is distributed licensed under the GNU General Public License v.3
# as published by the Free Software Foundation.
i... | |
<|file_name|>TableSpeedSearch.java<|end_file_name|><|fim▁begin|>/*
* Copyright 2000-2010 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/lice... | this(table, TO_STRING);
}
public TableSpeedSearch(JTable table, final Convertor<Object, String> toStringConvertor) { |
<|file_name|>RequestPlaybackDialog.ts<|end_file_name|><|fim▁begin|>import { Component, Inject } from '@angular/core';
import { FormControl, FormGroup, Validators } from '@angular/forms';
import { MatDialogRef, MAT_DIALOG_DATA } from '@angular/material/dialog';
import { BehaviorSubject } from 'rxjs';
import { Gap, Playb... | }
sendRequest() { |
<|file_name|>li_boost_shared_ptr_runme.py<|end_file_name|><|fim▁begin|>import li_boost_shared_ptr
import gc
debug = False
# simple shared_ptr usage - created in C++
class li_boost_shared_ptr_runme:
def main(self):
if (debug):
print "Started"
li_boost_shared_ptr.cvar.debug_shared = debug
# Change... | self.verifyValue("me oh my smartpointertest", val)
self.verifyCount(2, k) |
<|file_name|>query-builder.no.js<|end_file_name|><|fim▁begin|>/*!
* jQuery QueryBuilder 2.3.0
* Locale: Norwegian (no)
* Author: Jna Borup Coyle, github@coyle.dk
* Licensed under MIT (http://opensource.org/licenses/MIT)
*/
(function(root, factory) {
if (typeof define === 'function' && define.amd) {
de... | },
"operators": {
"equal": "er lik", |
<|file_name|>cast-enum-with-dtor.rs<|end_file_name|><|fim▁begin|>// Copyright 2015 The Rust Project Developers. See the COPYRIGHT<|fim▁hole|>// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
// option. This file may not be copied, modified,... | // 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 |
<|file_name|>default_actions.py<|end_file_name|><|fim▁begin|>from django.utils.translation import ugettext_lazy as _
from reviewboard.admin.read_only import is_site_read_only_for
from reviewboard.reviews.actions import (BaseReviewRequestAction,
BaseReviewRequestMenuAction)
from... | label = _('Ship It!')
|
<|file_name|>stdafx.cpp<|end_file_name|><|fim▁begin|>// stdafx.cpp : source file that includes just the standard includes
// TestConsoleW32.pch will be the pre-compiled header
// stdafx.obj will contain the pre-compiled type information
<|fim▁hole|>// TODO: reference any additional headers you need in STDAFX.H
// an... |
#include "stdafx.h"
|
<|file_name|>SubAccountIdentification11.go<|end_file_name|><|fim▁begin|>package iso20022
// Account to or from which a securities entry is made.
type SubAccountIdentification11 struct {
// Party that legally owns the account.
AccountOwner *PartyIdentification13Choice `xml:"AcctOwnr,omitempty"`
// Account to or fr... |
func (s *SubAccountIdentification11) AddAccountOwner() *PartyIdentification13Choice { |
<|file_name|>formpost.go<|end_file_name|><|fim▁begin|>// Copyright (c) 2017 Rackspace
//
// 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-... | }
}
p.Close()
} |
<|file_name|>yacc.py<|end_file_name|><|fim▁begin|>"""SCons.Tool.yacc
Tool-specific initialization for yacc.
There normally shouldn't be any need to import this module directly.
It will usually be imported through the generic SCons.Tool.Tool()
selection method.
"""
#
# Copyright (c) 2001 - 2016 The SCons Foundation
... | if '.ym' in ysuf: # If using Objective-C
target = [targetBase + ".m"] # the extension is ".m". |
<|file_name|>retrieve-map.6.x.py<|end_file_name|><|fim▁begin|># Download the Python helper library from twilio.com/docs/python/install
from twilio.rest import Client
# Your Account Sid and Auth Token from twilio.com/user/account
account_sid = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
auth_token = "your_auth_token"
client =... |
map_instance = client.sync \
.services("ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX") \
.sync_maps("Players") \ |
<|file_name|>volumes_test.go<|end_file_name|><|fim▁begin|>/*
Copyright 2018 The Rook 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.org/licenses/LI... | if err := VolumeIsEmptyDir(tt.args.volumeName, tt.args.volumes); (err != nil) != tt.wantErr { |
<|file_name|>shell.rs<|end_file_name|><|fim▁begin|>// Copyright 2014-2015 Jonathan Eyolfson
use raw;
use super::ShellSurface;
use super::Surface;
pub struct Shell {
ptr: *mut raw::wl_shell
}
impl Shell {
pub unsafe fn from_ptr(ptr: *mut raw::wl_shell) -> Shell {
Shell { ptr: ptr }
}
pub fn g... | fn drop(&mut self) {
unsafe { |
<|file_name|>about_regex.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
# -*- coding: utf-8 -*-
from runner.koan import *
import re
class AboutRegex(Koan):
"""
These koans are based on the Ben's book: Regular Expressions in 10 minutes.
I found this books very useful so I decided to write a k... | """
string = "pecks.xlx\n" \
+ "orders1.xls\n" \ |
<|file_name|>applayerframetype.rs<|end_file_name|><|fim▁begin|>/* Copyright (C) 2021 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 distribu... | assert_eq!(transform_name("NBSS"), "nbss");
assert_eq!(transform_name("NBSSHdr"), "nbss.hdr"); |
<|file_name|>ExportLists.py<|end_file_name|><|fim▁begin|># Author: John Elkins <john.elkins@yahoo.com>
# License: MIT <LICENSE>
from common import *
if len(sys.argv) < 2:
log('ERROR output directory is required')
time.sleep(3)
exit()
# setup the output directory, create it if needed
output_dir = sys.argv... | |
<|file_name|>watson-wechat.py<|end_file_name|><|fim▁begin|>import itchat, time, re
from itchat.content import *
import urllib2, urllib
import json
from watson_developer_cloud import ConversationV1
response={'context':{}}
@itchat.msg_register([TEXT])
def text_reply(msg):
global response
request_text = msg['Text'].enc... | workspace_id = 'd3e50587-f36a-4bdf-bf3e-38c382e8d63a'
|
<|file_name|>RULE_9_2_D_use_reentrant_function.py<|end_file_name|><|fim▁begin|>"""
Use reentrant functions. Do not use not reentrant functions.(ctime, strtok, toupper)
== Violation ==
void A() {
k = ctime(); <== Violation. ctime() is not the reenterant function.
j = strok(blar blar); <== Violat... | if t.value in no_reenterant_functions:
t2 = lexer.PeekNextTokenSkipWhiteSpaceAndComment()
t3 = lexer.PeekPrevTokenSkipWhiteSpaceAndComment()
|
<|file_name|>0001_initial.py<|end_file_name|><|fim▁begin|># Generated by Django 2.2.14 on 2020-07-09 10:37<|fim▁hole|>
from django.db import migrations, models
import django.db.models.deletion
import django.utils.timezone
import olympia.amo.models
class Migration(migrations.Migration):
initial = True
depend... | |
<|file_name|>brute_searcher.py<|end_file_name|><|fim▁begin|># pylint: disable=no-else-return
"""Adapted from an exercise in "Coding the Matrix". This script ingests
a text file, produces an index of the words in that text file, and allows
a user to search that index for one of more words. Validation is minimal.
"""
fr... | """Remove punctuation and line endings. Standardize case."""
return str_to_sanitize.translate(None, punctuation + '\n').lower()
|
<|file_name|>gash.rs<|end_file_name|><|fim▁begin|>//
// gash.rs
//
// Reference solution for PS2
// Running on Rust 0.8
//
// Special thanks to Kiet Tran for porting code from Rust 0.7 to Rust 0.8.
//
// University of Virginia - cs4414 Fall 2013
// Weilin Xu, Purnam Jantrania, David Evans
// Version 0.2
//
// Modified ... | } |
<|file_name|>test_hamster.py<|end_file_name|><|fim▁begin|>import sys
sys.path.append("..\\..")
import os
import time
from api.providers.torec.hamster import TorecHashCodesHamster
from api.requestsmanager import RequestsManager
<|fim▁hole|> self.hamster = TorecHashCodesHamster(RequestsManager())
def... | import unittest
class TestTorecHashCodeHamster(unittest.TestCase):
def setUp(self):
|
<|file_name|>views.py<|end_file_name|><|fim▁begin|>from django.contrib.auth.models import User
from django.shortcuts import get_object_or_404
import django_filters
from rest_framework import viewsets
from rest_framework.response import Response
from api.serializers import UserSerializer, AddressSerializer, Destinatio... | def retrieve(self, request, pk=None): |
<|file_name|>util.rs<|end_file_name|><|fim▁begin|>//! Contains utility things used in glium's internals
use std::default::Default;
use std::hash::Hasher;
/// A speedy hash algorithm for node ids and def ids. The hashmap in
/// libcollections by default uses SipHash which isn't quite as speedy as we
/// want. In the c... | /// just default to a non-cryptographic hash.
///
/// This uses FNV hashing, as described here:
/// http://en.wikipedia.org/wiki/Fowler%E2%80%93Noll%E2%80%93Vo_hash_function |
<|file_name|>log_handler.py<|end_file_name|><|fim▁begin|>import logging
from .model import LogEntry, LogLevels
class NGWLogHandler(logging.Handler):
"""
Simple standard log handler for nextgisweb_log
"""
def __init__(self, level=LogLevels.default_value, component=None, group=None):
logging.Ha... | |
<|file_name|>forms.py<|end_file_name|><|fim▁begin|>from django.forms import *
from django.forms.formsets import BaseFormSet
from django.utils.translation import ugettext_lazy as _
from django.contrib.sites.models import Site
from tradeschool.models import *
class DefaultBranchForm(Form):
def __init__(self, user, ... | 'country', |
<|file_name|>content_templates_test.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8; -*-
#
# This file is part of Superdesk.
#
# Copyright 2013, 2014, 2015 Sourcefabric z.u. and contributors.
#
# For the full copyright and license information, please see the
# AUTHORS and LICENSE files distributed with this source ... | |
<|file_name|>extrude.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
'''
Copyright (C) 2007
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option)... | for comp in verts: |
<|file_name|>debug.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
## Copyright (C) 2008 Red Hat, Inc.
## Copyright (C) 2008 Tim Waugh <twaugh@redhat.com>
## 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 S... | |
<|file_name|>setup.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
from distutils.core import setup
from catkin_pkg.python_setup import generate_distutils_setup<|fim▁hole|>
d = generate_distutils_setup(
packages=['jsk_apc2016_common'],
package_dir={'': 'python'},
)
setup(**d)<|fim▁end|> | |
<|file_name|>modularity.py<|end_file_name|><|fim▁begin|>'''
Construct and manipulate multilayer representations of configuration vectors
Created by: Ankit Khambhati
Change Log
----------
2016/02/03 - Implement functions to construct multilayer networks
'''
import numpy as np
import scipy.sparse as sp
from ....Commo... | n_nodes = int(np.floor(np.sqrt(2*n_conns))+1)
# Check null model specomm_initfication
valid_null_types = ['none', 'temporal', 'connectional', 'nodal'] |
<|file_name|>cli_test.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
#
# Copyright 2015 BMC Software, 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.or... | @staticmethod
def get_cli_output(cli, args): |
<|file_name|>buffer_manager.cc<|end_file_name|><|fim▁begin|>#include "buffer_manager.hh"
#include "assert.hh"
#include "buffer.hh"
#include "client_manager.hh"
#include "exception.hh"
#include "file.hh"
#include "ranges.hh"
#include "string.hh"
namespace Kakoune
{
BufferManager::~BufferManager()
{
// Move buffer... | |
<|file_name|>X11_MenuDialog.py<|end_file_name|><|fim▁begin|>import sys,os,string
def GFX_MenuDialog(filename,*items):
file=open(filename,'w')
file.writelines(map(lambda x:x+"\n", items))
file.close()
os.system("python X11_MenuDialog.py "+filename);
if __name__=="__main__":
import qt,string
cl... | apply( qt.QWidget.__init__, (self,) + args )
self.topLayout = qt.QVBoxLayout( self, 10 ) |
<|file_name|>icmp.rs<|end_file_name|><|fim▁begin|>use core::mem::size_of;
use core::option::Option;
use common::debug::*;
use common::vec::*;
use network::common::*;
#[derive(Copy, Clone)]
#[repr(packed)]
pub struct ICMPHeader {
pub _type: u8,
pub code: u8,
pub checksum: Checksum,
pub data: [u8; 4]
}... | dd(self.data.len());
} |
<|file_name|>raw_to_wav.py<|end_file_name|><|fim▁begin|>import numpy as np
from scipy.io.wavfile import write
a = np.fromfile('/tmp/file.raw', dtype='int16')<|fim▁hole|><|fim▁end|> | write('/tmp/file.wav', 16000, a) |
<|file_name|>lib.rs<|end_file_name|><|fim▁begin|>// Copyright 2020 TiKV Project Authors. Licensed under Apache-2.0.
//! This crate provides aggregate functions for batch executors.
#![allow(incomplete_features)]
#![feature(proc_macro_hygiene)]
#![feature(specialization)]
#[macro_use(box_try)]
extern crate tikv_util;... | ctx: &mut EvalContext, |
<|file_name|>audiofiles.cpp<|end_file_name|><|fim▁begin|>/* Copyright � 2007 Apple Inc. All Rights Reserved.
Disclaimer: IMPORTANT: This Apple software is supplied to you by
Apple Inc. ("Apple") in consideration of your agreement to the
following terms, and your use, installation, modification or
redistri... | |
<|file_name|>single_thread_download.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python3
# -*- coding: UTF-8 -*-
# single_thread_download.py
import os
import urllib.request
import urllib.error<|fim▁hole|>import shutil
# 单线程
def single_thread_download(url, file_name=None, overwrite=False):
# 如果文件名为空,则从 URL 中获取文件名
if... | |
<|file_name|>zz_generated_operations_client.go<|end_file_name|><|fim▁begin|>//go:build go1.16
// +build go1.16
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
// Code generated by Microsoft (R) AutoRest Code Ge... | pl runtime.Pipeline |
<|file_name|>NodeSerializationCodes.py<|end_file_name|><|fim▁begin|>from Node import error
SYNTAX_NODE_SERIALIZATION_CODES = {
# 0 is 'Token'. Needs to be defined manually
# 1 is 'Unknown'. Needs to be defined manually
'UnknownDecl': 2,
'TypealiasDecl': 3,
'AssociatedtypeDecl': 4,
'IfConfigDec... | |
<|file_name|>0001_initial.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
from django.conf import settings
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_M... | ('created', models.DateTimeField(auto_now_add=True)),
('modified', models.DateTimeField(auto_now=True)), |
<|file_name|>socket.js<|end_file_name|><|fim▁begin|>'use strict';
var phonetic = require('phonetic');
var socketio = require('socket.io');
var _ = require('underscore');
var load = function(http) {
var io = socketio(http);
var ioNamespace = '/';
var getEmptyRoomId = function() {
var roomId = ... | count: clients ? Object.keys(clients).length : 0
});
}; |
<|file_name|>Pool.ts<|end_file_name|><|fim▁begin|>import { assert, tostring, wipe, LuaArray } from "@wowts/lua";
import { insert, remove } from "@wowts/table";
import { format } from "@wowts/string";
export class OvalePool<T> {
pool:LuaArray<T> = {};
size = 0;
unused = 0;
name: string;
constru... | } |
<|file_name|>simple.py<|end_file_name|><|fim▁begin|><|fim▁hole|>import math
def area(a, b, c):
A1 = ((4*math.pi)*a**2)
A2 = ((4*math.pi)*b**2)
A3 = ((4*math.pi)*c**2)
Avg = (A1+A2+A3)/3
return Avg
def output(a, b ,c , d, e):
return """
Hello there, {}!
equation: ((4*math.pi)*{}**2)((4*math.pi)*{}**2)((4*math.pi)... | |
<|file_name|>Html5Exporter.ts<|end_file_name|><|fim▁begin|>import * as fs from 'fs-extra';
import * as path from 'path';
import {KhaExporter} from './KhaExporter';
import {convert} from '../Converter';
import {executeHaxe} from '../Haxe';
import {Options} from '../Options';
import {exportImage} from '../ImageTool';
imp... | }
|
<|file_name|>PermalinkProvider.js<|end_file_name|><|fim▁begin|>/*
* Copyright (c) 2008-2015 The Open Source Geospatial Foundation
*
* Published under the BSD license.
* See https://github.com/geoext/geoext2/blob/master/license.txt for the full
* text of the license.
*/
/*
* @include OpenLayers/Util.js
* @requi... | params[id + "_" + k] = this.encodeType ?
unescape(this.encodeValue(state[id][k])) : state[id][k];
} |
<|file_name|>video.rs<|end_file_name|><|fim▁begin|>pub const WIDTH: u8 = 64;
pub const HEIGHT: u8 = 32;
pub const BYTES_WIDTH: u8 = WIDTH / 8;
/// CHIP-8 gliphs, see: mattmik.com/chip8.html
pub static GLYPHS: [u8; 16*5] = [
0xF0, 0x90, 0x90, 0x90, 0xF0, // 0
0x20, 0x60, 0x20, 0x20, 0x70, // 1
0xF0, 0x10, ... | // If any bits were flipped as a result of drawing the sprite then return 1 |
<|file_name|>5_2.rs<|end_file_name|><|fim▁begin|>/*
rush支持各种花括号风格,
也支持类似python的控制结构省略花括号,
注意表达式过长折行的时候不能省略括号
*/
void main()
{
if(1||
2)
printl "true"
if 1
printl 2
printl 3
if 1 {
printl 2
printl 3
}
if(1)
{
printl(2);
printl(3);
<|fim▁hole|>
if 1 {printl(2);}... | }
|
<|file_name|>component.js<|end_file_name|><|fim▁begin|>import Ember from 'ember';
const $ = Ember.$;
import layout from './template';
import styles from './styles';
/*
* Turn header transparent after scrolling
* down a few pixels:<|fim▁hole|>const HEADER_OFFSET = 60;
export default Ember.Component.extend({
layou... | */ |
<|file_name|>test.js<|end_file_name|><|fim▁begin|>var assert = require("should");
var exec = require('child_process').exec;
var restify = require('restify');
var boplishHost = exec(__dirname + '/../run.js --bootstrap ws://chris.ac:5000 --port 10000',
function (error, stdout, stderr) {
console.log('stdout: ' + stdout... | assert.ifError(err);
peerId = obj.id;
peerId.should.not.be.empty; |
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|><|fim▁hole|>
def build_from_state(state):
if state.scad_type is OPENSCAD:
build_with_openscad(state)
if state.scad_type is COFFEESCAD:
build_with_coffeescad(state)<|fim▁end|> | from tailorscad.builder.openscad import build_with_openscad
from tailorscad.builder.coffeescad import build_with_coffeescad
from tailorscad.constants import OPENSCAD
from tailorscad.constants import COFFEESCAD |
<|file_name|>classes.ts<|end_file_name|><|fim▁begin|>/**
* Anonymous class
*/
class A {
a: any;
constructor(a: number) {
this.a = a;
}
}
/**
* Named class
*/
class B {
a: any;
b: any;
constructor(a, b) {
this.a = a;
this.b = b;
}
}
/**
* Named class extension
*/<|fim▁hole|> this.b =... | class C extends A {
b: any;
constructor(a, b) {
super(a); |
<|file_name|>FormPost.js<|end_file_name|><|fim▁begin|>import React, { Component } from 'react';
export default React.createClass({
getInitialState: function () {
return { title: '', body: '' };
},
handleChangeTitle: function (e) {
this.setState({ title: e.target.value });
},
handleChangeBody: funct... | this.setState({ body: e.target.value });
}, |
<|file_name|>fields.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
import json
from odoo import fields
def monkey_patch(cls):
""" Return a method decorator to monkey-patch the given class. """
def decorate(func):
name = func.__name__
func.super = getattr(cls, name, None)
set... | column_type = ('text', 'text')
def convert_to_column(self, value, record, values=None):
return json.dumps(value) |
<|file_name|>constants.py<|end_file_name|><|fim▁begin|>"""Let's Encrypt constants."""
import logging
from acme import challenges
SETUPTOOLS_PLUGINS_ENTRY_POINT = "letsencrypt.plugins"
"""Setuptools entry point group name for plugins."""
CLI_DEFAULTS = dict(
config_files=["/etc/letsencrypt/cli.ini"],
verbos... | """Defaults for CLI flags and `.IConfig` attributes."""
RENEWER_DEFAULTS = dict( |
<|file_name|>error_sp_hom.py<|end_file_name|><|fim▁begin|>'''
Hom family of models based on: [Drukker2013]_
Following: [Anselin2011]_
'''
__author__ = "Luc Anselin luc.anselin@asu.edu, Daniel Arribas-Bel darribas@asu.edu"
from scipy import sparse as SP
import numpy as np
from numpy import linalg as la
import ols as... | independent (exogenous) variable, including the constant
yend : array |
<|file_name|>alert_checkpoint_time.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
"""
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 thi... | "License"); you may not use this file except in compliance
with the License. You may obtain a copy of the License at
|
<|file_name|>ConfigTriggerMakerPP2016.C<|end_file_name|><|fim▁begin|><|fim▁hole|>void ConfigTriggerMakerPP2016(){
gROOT->LoadMacro("$ALICE_PHYSICS/PWG/EMCAL/macros/AddTaskEmcalTriggerMakerNew.C");
AliEmcalTriggerMakerTask *triggermaker = AddTaskEmcalTriggerMakerNew("EmcalTriggers", "", "", kTRUE);
triggermaker->SetU... | |
<|file_name|>DefaultBlockWorkerClient.java<|end_file_name|><|fim▁begin|>/*
* The Alluxio Open Foundation licenses this work under the Apache License, version 2.0
* (the "License"). You may not use this work except in compliance with the License, which is
* available at www.apache.org/licenses/LICENSE-2.0
*
* This ... | |
<|file_name|>beatbox.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
import pygame
from tools import singleton
@singleton
class Audio(object):
def __init__(self, initial_musics={}, initial_sounds={}):
if pygame.mixer.get_init() is None:
pygame.mixer.init()
self.__mute = False
... | self.__musics[music_id] = music_object
def unregister_sound(self, sound_id):
if sound_id not in self.__sounds.keys(): |
<|file_name|>views.py<|end_file_name|><|fim▁begin|># -*- coding: UTF-8 -*-
from django.conf import settings as dsettings
from django.contrib.auth import models as authModels
from django.core.paginator import Paginator, InvalidPage, EmptyPage
from django.http import HttpResponse, Http404
from django.shortcuts import ren... |
def category(request, category): |
<|file_name|>dbRoutes.js<|end_file_name|><|fim▁begin|>import db from './db';
const authenticatedOnly = (req, res, next) => {
if (req.isAuthenticated()) { return next(); }
return res.status(401).send('Authentication required');
};
const dbRoutes = (app) => {
app.post('/users', authenticatedOnly, (req, res) => {
... | |
<|file_name|>linter.js<|end_file_name|><|fim▁begin|>/**
* A wrapper around JSLint to drop things into the console
*
* Copyright (C) 2011 Nikolay Nemshilov
*/
var RightJS = require('./right-server.js');
var JSLint = require('./jslint').JSLINT;
var fs = require('fs');
exports.Linter = new RightJS.Class({
ext... |
/** |
<|file_name|>intersectdialog.py<|end_file_name|><|fim▁begin|># emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*-
# vi: set ft=python sts=4 ts=4 sw=4 et:
from PyQt4.QtCore import *
from PyQt4.QtGui import *
from froi.algorithm import imtool
class IntersectDialog(QDialog):
"""A dialog for ac... | """Initialize GUI."""
# set dialog title
self.setWindowTitle("Intersect") |
<|file_name|>RadioInput.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
# RadioInput.py
#
# Copyright (C) 2015 Kano Computing Ltd.
# License: http://www.gnu.org/licenses/gpl-2.0.txt GNU GPL v2
#
from gi.repository import Gtk, GObject
class RadioInput(Gtk.Box):
__gsignals__ = {
'radio-changed': (GO... | The first argument is whether there is a widget
that should be focused on, the second is the
widget in question |
<|file_name|>Size.java<|end_file_name|><|fim▁begin|>package xyw.ning.juicer.poco.model;
import xyw.ning.juicer.base.NoProguard;
/**
* Created by Ning-win on 2016/7/30.
*/
public class Size implements NoProguard {
public String url;
public long width;<|fim▁hole|><|fim▁end|> | public long height;
} |
<|file_name|>add.py<|end_file_name|><|fim▁begin|>"""
project and subproject adding
# @@ needs tests
"""
from Acquisition import aq_inner
from Products.CMFCore.utils import getToolByName
from Products.Five.browser.pagetemplatefile import ZopeTwoPageTemplateFile
from opencore.browser.formhandler import OctopoLite, actio... | |
<|file_name|>mail.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python3
import sys, getpass, urllib.request, urllib.error, json
def mgmt(cmd, data=None, is_json=False):
# The base URL for the management daemon. (Listens on IPv4 only.)
mgmt_uri = 'http://127.0.0.1:10222'
setup_key_auth(mgmt_uri)
req = urllib.reques... | |
<|file_name|>app.js<|end_file_name|><|fim▁begin|>const Discord = require("discord.js");
const client = new Discord.Client();
const settings = require("./settings.json");
const chalk = require("chalk");
const fs = require("fs");
const moment = require("moment");
require("./util/eventLoader")(client);
const log = messag... |
client.on("error", e => {
console.log(chalk.bgRed(e.replace(regToken, "that was redacted")));
}); |
<|file_name|>TripInfo.java<|end_file_name|><|fim▁begin|>package com.atlach.trafficdataloader;
import java.util.ArrayList;
/* Short Desc: Storage object for Trip info */
/* Trip Info > Trips > Routes */
public class TripInfo {
private int tripCount = 0;
public ArrayList<Trip> trips = null;
public String da... | }
public int addRouteToTrip(int tripId, String routeName, String mode, String dist, String agency, String start, String end, String points) {
int result = -1; |
<|file_name|>tests.rs<|end_file_name|><|fim▁begin|>//! Module for parsing ISO Base Media Format aka video/mp4 streams.
//! Internal unit tests.
// 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 ht... | match super::read_box_header(&mut stream) {
Err(Error::InvalidData(s)) => assert_eq!(s, "malformed wide size"),
_ => panic!("unexpected result reading box with invalid size"), |
<|file_name|>TestAccessControl.cpp<|end_file_name|><|fim▁begin|>/*
*
* Copyright (c) 2021 Project CHIP 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 th... | NL_TEST_ASSERT(inSuite, entry.SetAuthMode(AuthMode::kCase) == CHIP_NO_ERROR);
NL_TEST_ASSERT(inSuite, entry.AddSubject(nullptr, kOperationalNodeId0) == CHIP_NO_ERROR); |
<|file_name|>jtag.go<|end_file_name|><|fim▁begin|>// Copyright 2018 The Periph Authors. All rights reserved.
// Use of this source code is governed under the Apache License, Version 2.0
// that can be found in the LICENSE file.
// Package jtag will eventually define the API to communicate with devices over
// the JTAG... | // See https://en.wikipedia.org/wiki/JTAG for background information. |
<|file_name|>index.ts<|end_file_name|><|fim▁begin|>import formatDistance from '../en-US/_lib/formatDistance/index'
import formatRelative from '../en-US/_lib/formatRelative/index'
import localize from '../en-US/_lib/localize/index'<|fim▁hole|>import type { Locale } from '../types'
import formatLong from './_lib/formatLo... | import match from '../en-US/_lib/match/index' |
<|file_name|>admin.js<|end_file_name|><|fim▁begin|><|fim▁hole|><|fim▁end|> | //= require fluent/admin/admin.js |
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
# -*- coding: utf-8 -*-
# vim: ai ts=4 sts=4 et sw=4 nu
from __future__ import (unicode_literals, absolute_import,
division, print_function)
from snisi_reprohealth.models.PFActivities import (PFActivitiesR, AggPFActivi... | # from snisi_reprohealth.models.Commodities import (RHProductsR, AggRHProductsR) |
<|file_name|>parse.py<|end_file_name|><|fim▁begin|>import re
import string
import sys
sys.path.append('/Users/exu/PlayGround/readinglists/')
from key.keys import *
from amazon.api import AmazonAPI
from html2text import html2text
pattern = re.compile("https?://.*amazon.com/gp/product/([0-9]+)/.*")
amazon = AmazonAPI(A... | """ Book titles are long. We crop out the last part that is in (part)"""
splits = re.findall(rtitle, title)
if splits: |
<|file_name|>FacebookSession.java<|end_file_name|><|fim▁begin|>package de.dvdb.domain.model.social;
import java.io.Serializable;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax... | @Entity
@Table(name = "dvdb2_fbsession")
public class FacebookSession implements Serializable {
|
<|file_name|>utils.rs<|end_file_name|><|fim▁begin|>// Copyright 2020, 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 <https://opensource.org/licenses/MIT>
use anyhow::{bail, Result};
use itertools::Ite... | }; |
<|file_name|>kbemain.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
import os
import KBEngine
from KBEDebug import *
def onBaseAppReady(isBootstrap):
"""
KBEngine method.
baseapp已经准备好了
@param isBootstrap: 是否为第一个启动的baseapp
@type isBootstrap: BOOL
"""<|fim▁hole|> """
KBEngine method.
如果返回值大于等于1.0则初始化全部完... | INFO_MSG('onBaseAppReady: isBootstrap=%s, appID=%s, bootstrapGroupIndex=%s, bootstrapGlobalIndex=%s' % \
(isBootstrap, os.getenv("KBE_COMPONENTID"), os.getenv("KBE_BOOTIDX_GROUP"), os.getenv("KBE_BOOTIDX_GLOBAL")))
def onReadyForLogin(isBootstrap): |
<|file_name|>SecretKeySpec.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 file to You u... | |
<|file_name|>mod.rs<|end_file_name|><|fim▁begin|>//! A bounded SPSC channel.
use arc::{Arc, ArcTrait};
use select::{Selectable, _Selectable};
use {Error, Sendable};
mod imp;
#[cfg(test)] mod test;
#[cfg(test)] mod bench;
/// Creates a new bounded SPSC channel.
///
/// ### Panic
///
/// Panics if `next_power_of_two(c... | fn id(&self) -> usize {
self.data.unique_id()
}
|
<|file_name|>unicodeExtendedEscapesInTemplates14_ES5.ts<|end_file_name|><|fim▁begin|>// @target: es5
<|fim▁hole|>// Shouldn't work, negatives are not allowed.
var x = `\u{-DDDD}`;<|fim▁end|> | |
<|file_name|>reflection.rs<|end_file_name|><|fim▁begin|>use gl;
use libc;
use std::ffi;
use std::mem;
use std::ptr;
use std::collections::HashMap;
use context::CommandContext;
use version::Version;
use version::Api;
use uniforms::UniformType;
use vertex::AttributeType;
use Handle;
/// Information about a uniform (... | };
// no need to request other things if there are no varying
if num_varyings == 0 { |
<|file_name|>Write.py<|end_file_name|><|fim▁begin|>#! /usr/bin/python
import sys
import os
import json
import grpc
import time
import subprocess
from google.oauth2 import service_account
import google.oauth2.credentials
import google.auth.transport.requests
import google.auth.transport.grpc
from google.firestore.v1be... | |
<|file_name|>test_integration.py<|end_file_name|><|fim▁begin|>import unittest
import route53
from route53.exceptions import AlreadyDeletedError
from route53.transport import BaseTransport
from tests.utils import get_route53_connection
import datetime
import os
from test_basic import BaseTestCase
try:
from .credent... | # Attempting to add a record set to an already deleted zone does the same.
self.assertRaises(AlreadyDeletedError,
zone.create_a_record, |
<|file_name|>uart.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python3
"""Python binding of UART wrapper of LetMeCreate library."""
import ctypes
_LIB = ctypes.CDLL('libletmecreate_core.so')
# Baudrates
UART_BD_1200 = 1200
UART_BD_2400 = 2400
UART_BD_4800 = 4800
UART_BD_9600 = 9600
UART_BD_19200 = 19200
UART_BD_38... | raise Exception("uart release failed") |
<|file_name|>menu_manager_factory.cc<|end_file_name|><|fim▁begin|>// Copyright 2013 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "chrome/browser/extensions/menu_manager_factory.h"
#include "chrome/browser/ex... | content::BrowserContext* MenuManagerFactory::GetBrowserContextToUse(
content::BrowserContext* context) const { |
<|file_name|>locus.js<|end_file_name|><|fim▁begin|>import {StringUtils} from "../node_modules/igv-utils/src/index.js"
class Locus {
constructor({chr, start, end}) {
this.chr = chr
this.start = start
this.end = end
}
contains(locus) {
return locus.chr === this.chr && locus... | |
<|file_name|>babel.config.js<|end_file_name|><|fim▁begin|><|fim▁hole|>
return {
presets: [
[
'@babel/preset-env',
{
targets: {
node: '12'
}
}
]
]
};
};<|fim▁end|> | module.exports = api => {
api.cache(true); |
<|file_name|>test_ray.py<|end_file_name|><|fim▁begin|>import os
import numpy as np
from matplotlib import pyplot as plt
from numpy import genfromtxt
from matplotlib import cm
from mpl_toolkits.mplot3d.art3d import Poly3DCollection
import matplotlib as mpl
from mpl_toolkits.mplot3d import Axes3D
def axisEqual3D(ax):
... |
ax.plot_surface(x, y, z, rstride=4, cstride=4, color='black') |
<|file_name|>order.go<|end_file_name|><|fim▁begin|>package annotate
import (
"context"
"sync"
"github.com/paulmach/osm"
)
// RelationHistoryDatasourcer is an more strict interface for when we only need the relation history.
type RelationHistoryDatasourcer interface {
RelationHistory(context.Context, osm.Relation... | |
<|file_name|>gateway.go<|end_file_name|><|fim▁begin|>package gateway
import (
"errors"
"net"
"strings"
"syscall"
)
const (
DefaultProtocol = "tcp"
DefaultSchedulingMethod = "wrr"
)
// Possible validation errors.
var (
ErrMissingEndpoint = errors.New("endpoint information is missing")
ErrUnknownProtoc... | |
<|file_name|>models.py<|end_file_name|><|fim▁begin|># pylint: disable=arguments-differ
""" Models for the shopping cart and assorted purchase types """
from collections import namedtuple
from datetime import datetime
from datetime import timedelta
from decimal import Decimal
import json
import analytics
from io import... | def send_confirmation_emails(self, orderitems, is_order_type_business, csv_file, pdf_file, site_name, course_names):
""" |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.