prompt large_stringlengths 70 991k | completion large_stringlengths 0 1.02k |
|---|---|
<|file_name|>DelimitedParseSpecTest.java<|end_file_name|><|fim▁begin|>/*
* Licensed to Metamarkets Group Inc. (Metamarkets) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. Metamarkets licenses this file
* to... | public void testColumnMissing() throws Exception |
<|file_name|>models.py<|end_file_name|><|fim▁begin|>import django.db.models as models
from django.contrib.auth.models import User
from django.utils.translation import ugettext_lazy as _
from django.db.models.signals import post_save
class Profile(models.Model):
"""
parameters we can get from gigya:
bi... | zip = models.CharField(max_length=30, null=True,blank=True) |
<|file_name|>gdaldrivermanager.cpp<|end_file_name|><|fim▁begin|>/******************************************************************************
* $Id: gdaldrivermanager.cpp 27121 2014-04-03 22:08:55Z rouault $
*
* Project: GDAL Core
* Purpose: Implementation of GDALDriverManager class.
* Author: Frank Warmerda... | |
<|file_name|>test_complex.py<|end_file_name|><|fim▁begin|># Licensed to the .NET Foundation under one or more agreements.
# The .NET Foundation licenses this file to you under the Apache 2.0 License.
# See the LICENSE file in the project root for more information.
import unittest
from iptest.type_util import *
from i... | |
<|file_name|>classes-simple-cross-crate.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... | // xfail-fast
// aux-build:cci_class.rs
extern mod cci_class; |
<|file_name|>beerspider.py<|end_file_name|><|fim▁begin|>from scrapy.spiders import Spider
from scrapy.selector import HtmlXPathSelector
from scrapy.http import Request
from scrapy.conf import settings
from beerindex.items import BeerindexItem
import logging
import lxml.html
from urlparse import urlparse
import re
clas... | # start_urls = ["http://www.emporioveredas.com.br/cervejas-importadas.html"]
start_urls = [beer_sites[store]["start_url"] for store in beer_sites] |
<|file_name|>test_security_groups.py<|end_file_name|><|fim▁begin|><|fim▁hole|># 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 required by applicable law or agreed to in writing, software
# ... | # Licensed under the Apache License, Version 2.0 (the "License"); you may |
<|file_name|>types.go<|end_file_name|><|fim▁begin|>package drivers
//DriverType id of type of driver
type DriverType int
const (
//FTP id of ftp driver type
FTP DriverType = iota
//SSH id of ssh driver type<|fim▁hole|> //SMB id of smb driver type
SMB
//DAV id of dav driver type
DAV
//NFS id of nfs driver type
... | SSH |
<|file_name|>HW1_4a.cpp<|end_file_name|><|fim▁begin|>//
// HW1_4a.cpp
// Homework 1
//
// Raymond Dam
//
//
#include <iostream>
#include <fstream> //file io stuff
#include <cstring> //using strings
#include <sstream>
#include <stdlib.h> //at... |
int main ()
{ |
<|file_name|>log.rs<|end_file_name|><|fim▁begin|>macro_rules! log {
($tag:expr) => (println!($tag));
($tag:expr, $fmt:expr) => (println!(concat!($tag, ": ", $fmt)));
($tag:expr, $fmt:expr, $($arg:tt)*) => (println!(concat!($tag, ": ", $fmt), $($arg)*));<|fim▁hole|>
macro_rules! error {
() => (log!("[Er... | } |
<|file_name|>secp256k1-tests.ts<|end_file_name|><|fim▁begin|>import { SignOptions, ecdsaSign, ecdsaRecover } from "secp256k1";
const opts: SignOptions = {<|fim▁hole|>};
const message = Buffer.from([0x62, 0x75, 0x66, 0x66, 0x65, 0x72]);
const prvKey = Buffer.from([0x62, 0x75, 0x66, 0x66, 0x65, 0x72]);
const ret = ec... | data: Buffer.from([0x62, 0x75, 0x66, 0x66, 0x65, 0x72]) |
<|file_name|>geepeeex.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python3
import gpxpy
import datetime
import time
import os
import gpxpy.gpx
import sqlite3
import pl
import re
DATE_FORMAT = '%Y-%m-%dT%H:%M:%SZ'
filebase = os.environ["XDG_DATA_HOME"]+"/"+os.environ["APP_ID"].split('_')[0]
def create_gpx():
# Cr... | dotfile=open(filename, "w")
dotfile.write("db fixed") |
<|file_name|>aria-allowed-attr-test.js<|end_file_name|><|fim▁begin|>/**
* @license
* Copyright 2016 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
*
... | }); |
<|file_name|>search.py<|end_file_name|><|fim▁begin|>import os, re, traceback
from dirtree_node import get_file_info
from util import is_text_file
class SearchAborted(Exception):
pass
def null_filter(info):
return True
class Search(object):
def __init__(self, path, match, output, file_filter=null_filter, ... | pass
|
<|file_name|>rule.py<|end_file_name|><|fim▁begin|>import cPickle
def dump_rules(filename, rules):
with open(filename, 'w') as f:
cPickle.dump(rules, f, cPickle.HIGHEST_PROTOCOL)
def load_rules(filename):
with open(filename, 'r') as f:
rules = cPickle.load(f)
return rules
class Rule():
... | return self.prefix |
<|file_name|>spotify.js<|end_file_name|><|fim▁begin|>var Plugin = require('./baseplugin'),
request = require('request-promise');
class Spotify extends Plugin {
init() {
this.httpRegex = /(?:https?:\/\/)?open\.spotify\.com\/(album|track|user\/[^\/]+\/playlist)\/([a-zA-Z0-9]+)/;
this.uriRegex = ... | |
<|file_name|>doGrid.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
from PyQt4.QtCore import *
from PyQt4.QtGui import *
from qgis.core import *
from qgis.gui import *
from osgeo import ogr
from ui_widgetGrid import Ui_GdalToolsWidget as Ui_Widget
from widgetPluginBase import GdalToolsBasePluginWidget as BaseP... | def fillFieldsCombo(self):
index = self.inputLayerCombo.currentIndex() |
<|file_name|>pst05.cpp<|end_file_name|><|fim▁begin|><|fim▁hole|>PST05::PST05(QSettings *settings)
{
this->settings = settings;
qDebug() << "Reading up the device's serial id...";
QFile procInfo("/proc/cpuinfo");
if (!procInfo.open(QFile::ReadOnly))
{
qDebug() << "Failed to read \"/proc/cpui... | #include "pst05.h"
|
<|file_name|>test_ae_detector.py<|end_file_name|><|fim▁begin|>#
# Copyright 2018 Analytics Zoo 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/... | with pytest.raises(ValueError):
ad.fit(y)
ad = AEDetector(roll_len=314) |
<|file_name|>netplay.cpp<|end_file_name|><|fim▁begin|>/* FCE Ultra - NES/Famicom Emulator
*
* Copyright notice for this file:
* Copyright (C) 2002 Xodnizel
*
* 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|>CustomJakanHelper.java<|end_file_name|><|fim▁begin|>/*
** 2013 October 27
**
** The author disclaims copyright to this source code. In place of
** a legal notice, here is a blessing:
** May you do good and not evil.
** May you find forgiveness for yourself and forgive others.
** May... | public void onLivingUpdate() {}
public void onDeathUpdate() {}
public void onDeath() {}
|
<|file_name|>453.minimum-moves-to-equal-array-elements.go<|end_file_name|><|fim▁begin|>// https://leetcode.com/problems/minimum-moves-to-equal-array-elements/
package leetcode
func minMoves(nums []int) int {
sum, min := 0, (1<<31 - 1)
for _, num := range nums {
if min > num {
min = num
}<|fim▁hole|>}<|fim▁en... | sum += num
}
return sum - len(nums)*min |
<|file_name|>tree.rs<|end_file_name|><|fim▁begin|>#![cfg_attr(feature = "unstable", feature(test))]
extern crate rand;
extern crate rdxsort;
#[cfg(feature = "unstable")]
mod unstable {
extern crate test;
use self::test::Bencher;
use rand::{Rng, XorShiftRng};
use rdxsort::*;
use std::collections... | #[bench]
fn bench_set_std(b: &mut Bencher) {
bench_generic(b, |vec| {
let mut set = BTreeSet::new(); |
<|file_name|>buffer.rs<|end_file_name|><|fim▁begin|>use std::ptr;
use std::io::Read;
/// A FixedBuffer, likes its name implies, is a fixed size buffer. When the buffer becomes full, it
/// must be processed. The input() method takes care of processing and then clearing the buffer
/// automatically. However, other meth... | |
<|file_name|>AbstractAddress.java<|end_file_name|><|fim▁begin|>/**
* Copyright 2010 CosmoCode GmbH
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/license... | |
<|file_name|>mod.rs<|end_file_name|><|fim▁begin|>use dox::{mem, Option};
pub type c_char = i8;
pub type wchar_t = i32;
pub type off_t = i64;
pub type useconds_t = u32;
pub type blkcnt_t = i64;
pub type socklen_t = u32;
pub type sa_family_t = u8;
pub type pthread_t = ::uintptr_t;
pub type nfds_t = ::c_uint;
s! {
p... | pub fn readv(fd: ::c_int,
iov: *const ::iovec,
iovcnt: ::c_int) -> ::ssize_t;
|
<|file_name|>JvmRenderEngineFactory.java<|end_file_name|><|fim▁begin|>package cn.dlb.bim.ifc.engine.jvm;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.nio.file.Files;
import java.nio.file.Path;
import java.util.ArrayList;
import java.util.List;
import org.apache.comm... | if (inputStream != null) {
try {
Path tmpFolder = server.getPlatformServerConfig().getTempDir(); |
<|file_name|>serde_types.rs<|end_file_name|><|fim▁begin|>use hybrid_clocks::{Timestamp, WallT};
use potboiler_common::{enum_str, types::CRDT};
use serde_derive::{Deserialize, Serialize};
use std::{collections::HashMap, fmt};
enum_str!(Operation {
Set("set"),
Add("add"),
Remove("remove"),
Create("create... | }
#[derive(Serialize, Deserialize, Debug)]
pub struct ORCreateOp {} |
<|file_name|>Location.java<|end_file_name|><|fim▁begin|>package app.location;
import app.core.BaseEntity;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import javax.persistence.Column;<|fim▁hole|>
@NoArgsConstructor
@AllArgsConstructor
@Getter
@Setter
... | import javax.persistence.Entity;
import javax.persistence.Table; |
<|file_name|>Ninja.py<|end_file_name|><|fim▁begin|>from robot import Robot
class TheRobot(Robot):
def initialize(self):
# Try to get in to a corner
self.forseconds(5, self.force, 50)
self.forseconds(0.9, self.force, -10)
self.forseconds(0.7, self.torque, 100)
self.forseconds... | |
<|file_name|>util.py<|end_file_name|><|fim▁begin|>"""Contains utility methods used by and with the pyebnf package."""
import math
def esc_split(text, delimiter=" ", maxsplit=-1, escape="\\", *, ignore_empty=False):
"""Escape-aware text splitting:
Split text on on a delimiter, recognizing escaped delimiters."""
... | if upper_idx < len(lines):
output_lines.append((pivot + upper_ofst, lines[upper_idx]))
|
<|file_name|>Simplif.java<|end_file_name|><|fim▁begin|>/***********************************************************************
This file is part of KEEL-software, the Data Mining tool for regression,
classification, clustering, pattern mining and so on.
Copyright (C) 2004-2010
F. Herrera (herrera@decsa... | }
else {
return (0);
}
|
<|file_name|>ConversionParser.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
"""
ConversionParser.py $Id: ConversionParser.py,v 1.5 2004/10/20 01:44:53 chrish Exp $
Copyright 2003 Bill Nalen <bill.nalen@towers.com>
Distributable under the GNU General Public License Version 2 or newer.
Provides met... | from UtilFns import message, error
|
<|file_name|>hough_transform.rs<|end_file_name|><|fim▁begin|>// Implements http://rosettacode.org/wiki/Hough_transform
//
// Contributed by Gavin Baker <gavinb@antonym.org>
// Adapted from the Go version
use std::io::{BufReader, BufRead, BufWriter, Write, Read};
use std::fs::File;
use std::iter::repeat;
// Simple 8-bi... | accum
} |
<|file_name|>sgicc.py<|end_file_name|><|fim▁begin|>"""SCons.Tool.sgicc
Tool-specific initialization for MIPSPro cc on SGI.
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__
#
# Permission is ... | # vim: set expandtab tabstop=4 shiftwidth=4: |
<|file_name|>15.2.3.6-2-8.js<|end_file_name|><|fim▁begin|>// Copyright (c) 2012 Ecma International. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
es5id: 15.2.3.6-2-8
description: >
Object.defineProperty - argument 'P' is a number that converts to
a string (v... | ---*/
var obj = {};
Object.defineProperty(obj, -0, {}); |
<|file_name|>21.05.2015.14.36.java<|end_file_name|><|fim▁begin|>// dvt
/* 1. Да се напише if-конструкция,
* която изчислява стойността на две целочислени променливи и
* разменя техните стойности,
* ако стойността на първата променлива е по-голяма от втората.
*/<|fim▁hole|>
package myJava;
import java.util.Sca... | |
<|file_name|>resources.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
# Resource object code
#
# Created: Thu Jul 25 00:08:39 2013
# by: The Resource Compiler for PyQt (Qt v4.8.4)
#
# WARNING! All changes made in this file will be lost!
from PyQt4 import QtCore
qt_resource_data = "\
\x00\x00\x05\x3e\
\... | |
<|file_name|>server.js<|end_file_name|><|fim▁begin|>var socketio = require('socket.io');
exports.listen = function( server, Manager ) {
var io = socketio.listen(server);
Manager.findAllUsers(function ( err, data ) {
if(!err){
if(data.length === 0){
Manager.addUser({'login': 'madzia26', 'password... | }); |
<|file_name|>comb.py<|end_file_name|><|fim▁begin|>def comb(xs):
if len(xs) == 0:
return [""]
else:
return comb2(xs) + [""]
def comb2(xs):
if len(xs) == 1:<|fim▁hole|> else:
subwo = comb2( xs[1:] )
head = xs[0]
subwith = [ head + zs for zs in subwo ]
return... | return [ xs ] |
<|file_name|>94-sample.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python
# -*- coding: utf-8 -*-
# vi: ts=4 sw=4
################################################################################
# Code for defining a 'Sample' object, which keeps track of its state, and
# simplifies the task of aligning, measuring,... | detector.setExposureTime(exposure_time, verbosity=verbosity)
#extra wait time when changing the exposure time.
time.sleep(2) |
<|file_name|>12_strings_test.go<|end_file_name|><|fim▁begin|><|fim▁hole|>func stringGet(s string, index int) byte {
return s[index]
}
func stringLen(s string) int {
return len(s)
}
func substring(s string, low, high int) string {
switch {
case low >= 0 && high >= 0:
return s[low:high]
case low >= 0:
return s... | package conformance
|
<|file_name|>issue-23311.rs<|end_file_name|><|fim▁begin|>// run-pass<|fim▁hole|>fn main() {
match "foo".as_bytes() {
b"food" => (),
&[b'f', ..] => (),
_ => ()
}
}<|fim▁end|> |
// Test that we do not ICE when pattern matching an array against a slice.
|
<|file_name|>OCommandExecutorFunction.java<|end_file_name|><|fim▁begin|>/*
* Copyright 2010-2012 Luca Garulli (l.garulli--at--orientechnologies.com)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of... |
public OCommandExecutorFunction() {
}
|
<|file_name|>NonNCEPModel.py<|end_file_name|><|fim▁begin|>import time
from bs4 import BeautifulSoup
import sys
if (sys.version_info > (3, 0)):
# Python 3 code in this block
import urllib.request as urllib2
else:
# Python 2 code in this block<|fim▁hole|> import urllib2
import datetime, re, os
class NonNCEPModel... | |
<|file_name|>bitcoin_ne.ts<|end_file_name|><|fim▁begin|><TS language="ne" version="2.1">
<context>
<name>AddressBookPage</name>
<message>
<source>Right-click to edit address or label</source>
<translation>ठेगाना वा लेबल सम्पादन गर्न दायाँ-क्लिक गर्नुहोस्</translation>
</message>
<message... | <source>&Overview</source>
<translation>शारांश</translation>
</message>
<message> |
<|file_name|>search_yt.py<|end_file_name|><|fim▁begin|>import urllib
import urllib2
from bs4 import BeautifulSoup
textToSearch = 'gorillaz'
query = urllib.quote(textToSearch)<|fim▁hole|>url = "https://www.youtube.com/results?search_query=" + query
response = urllib2.urlopen(url)
html = response.read()
soup = Beautiful... | |
<|file_name|>utility.py<|end_file_name|><|fim▁begin|>"""<|fim▁hole|>
def extract_traceback(exception):
"""
Utility function for extracting the traceback from an exception.
:param exception: The exception to extract the traceback from.
:return: The extracted traceback.
"""
return ''.join(traceb... | The utility module.
"""
import traceback |
<|file_name|>base_extension_test.py<|end_file_name|><|fim▁begin|>"""Tests for base extension."""
import unittest<|fim▁hole|>
class BaseExtensionTestCase(unittest.TestCase):
"""Test the base extension."""
def test_config_disabled(self):
"""Uses the disabled config."""
ext = base_extension.BaseE... | from grow.extensions import base_extension
|
<|file_name|>setup.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python<|fim▁hole|>
try:
from setuptools import setup, Command
except ImportError:
from distutils.core import setup, Command
if sys.argv[-1] == 'publish':
os.system('python setup.py sdist upload')
sys.exit()
datadir = os.path.dirname(__... | # -*- coding: utf-8 -*-
import os
import sys |
<|file_name|>indexer.py<|end_file_name|><|fim▁begin|>import pyes
import os
from models import *
from sqlalchemy import select
from downloader import download
import utils
import re
import time
class Search(object):
def __init__(self,host,index,map_name,mapping=None,id_key=None):
self.es = pyes.ES(host)
... | |
<|file_name|>UIAsset.js<|end_file_name|><|fim▁begin|>/**
* Symbol Art Editor
*
* @author malulleybovo (since 2021)
* @license GNU General Public License v3.0
*
* @licstart The following is the entire license notice for the
* JavaScript code in this page.
*
* Copyright (C) 2021 Arthur Malulley B. de O.
*
... | this.view.attr('src', path); |
<|file_name|>accounts.py<|end_file_name|><|fim▁begin|>"""
sentry.web.frontend.accounts
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
:copyright: (c) 2012 by the Sentry Team, see AUTHORS for more details.
:license: BSD, see LICENSE for more details.
"""
from __future__ import absolute_import
import itertools
from django.contrib impor... |
org.member_set.create(
user=user,
**defaults |
<|file_name|>default_module_exceptions.py<|end_file_name|><|fim▁begin|>"""
Copyright 2009 55 Minutes (http://www.55minutes.com)
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.... | test_timestamp = time.strftime('%a %Y-%m-%d %H:%M %Z')
TOP = """\
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> |
<|file_name|>ipfs-util.js<|end_file_name|><|fim▁begin|>module.exports = IpfsUtil;
var fs = require('fs');
var formstream = require('formstream');
var http = require('http');
var request = require('request');
function IpfsUtil() {
}
IpfsUtil.prototype.init = function (config) {
this.__host = config.ipfs.host;
... | |
<|file_name|>GuiRobotState.java<|end_file_name|><|fim▁begin|>package jaci.openrio.toast.core.loader.simulation;
import jaci.openrio.toast.lib.state.RobotState;
import javax.swing.*;
import java.awt.*;
import java.awt.event.MouseEvent;
import java.awt.event.MouseListener;
import java.awt.geom.Rectangle2D;
/**
* A GU... | |
<|file_name|>npm-api.js<|end_file_name|><|fim▁begin|>/*jslint node: true */
'use strict';
var npm = require('npm');
module.exports = Npm;
<|fim▁hole|> var conf = {
jobs: 1
};
npm.load(conf, callback);
}
Npm.prototype.search = function (searchTerms, callback) {
npm.commands.search(searchTerms, true, callba... | function Npm (callback) { |
<|file_name|>win_services.go<|end_file_name|><|fim▁begin|>//go:build windows
// +build windows
package win_services
import (
"fmt"
"os"
"github.com/influxdata/telegraf"
"github.com/influxdata/telegraf/filter"
"github.com/influxdata/telegraf/plugins/inputs"
"golang.org/x/sys/windows/svc"
"golang.org/x/sys/wind... | return services, nil
} |
<|file_name|>sms.js<|end_file_name|><|fim▁begin|>var twilio = require('twilio'),
Player = require('../models/Player'),
Question = require('../models/Question');
// Handle inbound SMS and process commands
module.exports = function(request, response) {
var twiml = new twilio.TwimlResponse();
var bod... | } |
<|file_name|>model_licenseinfo.py<|end_file_name|><|fim▁begin|># -*- coding:utf-8 -*-
# This code is automatically transpiled by Saklient Translator
import six
from ..client import Client
from .model import Model
from ..resources.resource import Resource
from ..resources.licenseinfo import LicenseInfo
from ...util im... | # @param {str} id
# @return {saklient.cloud.resources.licenseinfo.LicenseInfo} リソースオブジェクト
def get_by_id(self, id):
Util.validate_type(id, "str") |
<|file_name|>build_test.go<|end_file_name|><|fim▁begin|>package integration<|fim▁hole|>import (
"fmt"
"os/exec"
"strings"
"golang.org/x/net/context"
. "gopkg.in/check.v1"
)
func (s *CliSuite) TestBuild(c *C) {
p := s.RandomProject()
cmd := exec.Command(s.command, "-f", "./assets/build/docker-compose.yml", "-p... | |
<|file_name|>bitcoin_zh_CN.ts<|end_file_name|><|fim▁begin|><?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE TS>
<TS version="2.0" language="zh_CN">
<defaultcodec>UTF-8</defaultcodec>
<context>
<name>AboutDialog</name>
<message>
<location filename="../forms/aboutdialog.ui" line="14"/>
<source>Abo... | |
<|file_name|>video_capture_device_linux.cc<|end_file_name|><|fim▁begin|>// 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.
#include "media/video/capture/linux/video_capture_device_linux.h"
#if defined... | DCHECK(!capture_impl_);
if (v4l2_thread_.IsRunning())
return; // Wrong state. |
<|file_name|>run_tutorial_a.py<|end_file_name|><|fim▁begin|>from __future__ import print_function
from pysb.simulator import ScipyOdeSimulator<|fim▁hole|>simresult = simulator.run()
print(simresult.species)<|fim▁end|> | from tutorial_a import model
t = [0, 10, 20, 30, 40, 50, 60]
simulator = ScipyOdeSimulator(model, tspan=t) |
<|file_name|>module.js<|end_file_name|><|fim▁begin|>M.tool_assignmentupgrade = {
init_upgrade_table: function(Y) {
Y.use('node', function(Y) {
checkboxes = Y.all('td.c0 input');
checkboxes.each(function(node) {
node.on('change', function(e) {
rowe... | checkboxes.each(function(node) {
rowelement = node.get('parentNode').get('parentNode'); |
<|file_name|>models.js<|end_file_name|><|fim▁begin|>/**
* Default model configuration
* (sails.config.models)
*
* Unless you override them, the following properties will be included
* in each of your models.
*
* For more info on Sails models, see:
* http://sailsjs.org/#!/documentation/concepts/ORM
*/<|fim▁hole... |
module.exports.models = { |
<|file_name|>index.js<|end_file_name|><|fim▁begin|>'use strict';
// https://github.com/jambit/eslint-plugin-typed-redux-saga
module.exports = {
rules: {
'use-typed-effects': require('./rules/use-typed-effects'),
'delegate-effects': require('./rules/delegate-effects'),<|fim▁hole|><|fim▁end|> | },
}; |
<|file_name|>gaussian_kde.go<|end_file_name|><|fim▁begin|>package bayes
import (
"fmt"
. "fp/mat"
"math"
)
type GaussianKDE struct {
d, n int
normFactor float64
dataset *Mat
covariance, invCov *Mat
}
func NewGaussianKDE(dataset *Mat, bw_method ...float64) *GaussianKDE {
if da... | //"""Evaluate the estimated pdf on a set of points. |
<|file_name|>class_mix_e_r_p_1_1_net_1_1_entities_1_1_core_1_1_late_fee.js<|end_file_name|><|fim▁begin|>var class_mix_e_r_p_1_1_net_1_1_entities_1_1_core_1_1_late_fee =
[
[ "AccountId", "class_mix_e_r_p_1_1_net_1_1_entities_1_1_core_1_1_late_fee.html#aa5f13daf52f6212580695248d62ed83d", null ],
[ "AuditTs", "cla... | |
<|file_name|>api.py<|end_file_name|><|fim▁begin|>from kolibri.auth.api import KolibriAuthPermissions, KolibriAuthPermissionsFilter
from kolibri.content.api import OptionalPageNumberPagination
from rest_framework import filters, viewsets
from .models import ContentRatingLog, ContentSessionLog, ContentSummaryLog, UserSe... | |
<|file_name|>mod.rs<|end_file_name|><|fim▁begin|>// Copyright 2018 Guanhao Yin <sopium@mysterious.site>
// This file is part of TiTun.
// TiTun 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 versio... | // (at your option) any later version.
// TiTun is distributed in the hope that it will be useful, |
<|file_name|>injectStyles.js<|end_file_name|><|fim▁begin|>// @flow
/* global document */
export default function injectStyles(styles: any) {
const stylesElement = document.createElement('style');<|fim▁hole|><|fim▁end|> | stylesElement.innerText = styles.toString();
return stylesElement;
} |
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|><|fim▁hole|><|fim▁end|> | from schema import * |
<|file_name|>FileDropZoneView.js<|end_file_name|><|fim▁begin|>//==============================================================================
//
// File drop zone view
//
//==============================================================================
(function(app, config, $)
{
app.FileDropZoneView = Marionette... | |
<|file_name|>jquery-ui-1.10.3.custom.js<|end_file_name|><|fim▁begin|>/*! jQuery UI - v1.10.3 - 2014-01-12
* http://jqueryui.com
* Includes: jquery.ui.core.js, jquery.ui.widget.js, jquery.ui.mouse.js, jquery.ui.position.js, jquery.ui.accordion.js, jquery.ui.progressbar.js, jquery.ui.slider.js
* Copyright 2014 jQuery Fou... | var options = this.options,
classes = ""; |
<|file_name|>logistic.rs<|end_file_name|><|fim▁begin|>//! Provides the [logistic](http://en.wikipedia.org/wiki/Logistic_function) and
//! related functions
use crate::error::StatsError;
use crate::Result;
/// Computes the logistic function
pub fn logistic(p: f64) -> f64 {
1.0 / ((-p).exp() + 1.0)
}
/// Computes ... | }
#[test]
fn test_checked_logit_p_gt_1() { |
<|file_name|>20141116202453-troopcost.js<|end_file_name|><|fim▁begin|>var dbm = require('db-migrate');
var type = dbm.dataType;
exports.up = function(db, callback) {
db.addColumn("troop_type", "production_cost", "int", callback);
};<|fim▁hole|>};<|fim▁end|> |
exports.down = function(db, callback) {
|
<|file_name|>setup.py<|end_file_name|><|fim▁begin|># Copyright 2015 Mirantis, Inc.
# Copyright 2012-2013 IBM Corp.
# 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... |
import setuptools |
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|>#! /usr/bin/env python<|fim▁hole|><|fim▁end|> | # encoding: UTF-8
'''give access permission for files in this folder''' |
<|file_name|>ASTCollExpr.java<|end_file_name|><|fim▁begin|>package cn.ac.iscas.cloudeploy.v2.puppet.transform.ast;
import java.util.List;
public class ASTCollExpr extends ASTBase{
private Object test1;
private Object test2;
private String oper;
private List<Object> children;
private String form;
private String ... | |
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|>from __future__ import absolute_import
from collections import namedtuple
from django.conf import settings
from sentry.utils.dates import to_datetime
from sentry.utils.services import LazyServiceWrapper
from .backends.base import Backend # NOQA
from .backends.du... | )) |
<|file_name|>champpack.go<|end_file_name|><|fim▁begin|>package structs
import (
"encoding/json"
"io/ioutil"
"log"
"net/http"
"strconv"
)
// packedChampID : Only used in packed data structures related to champions.
type packedChampID int
// ChampPack : Low-level mapping struct used to convert between sparse Riot... | // request to Riot's API for the latest champion list. |
<|file_name|>reconnect_remoterepositories.py<|end_file_name|><|fim▁begin|>import json
from django.db.models import Q, Subquery
from django.core.management.base import BaseCommand
from readthedocs.oauth.models import RemoteRepository
from readthedocs.oauth.services import registry
from readthedocs.oauth.services.base ... | 'Run it with --no-dry-run to save the changes.'
)
|
<|file_name|>select_model.py<|end_file_name|><|fim▁begin|>__version__="v2.5 beta10"
welcome_block="""
# Multi-Echo ICA, Version %s
#
# Kundu, P., Brenowitz, N.D., Voon, V., Worbe, Y., Vertes, P.E., Inati, S.J., Saad, Z.S.,
# Bandettini, P.A. & Bullmore, E.T. Integrated strategy for improving functional
# connectivity... | |
<|file_name|>display.rs<|end_file_name|><|fim▁begin|>//! Utilities for formatting and displaying errors.
use failure;
use std::fmt;
use Error;
/// A wrapper which prints a human-readable list of the causes of an error, plus
/// a backtrace if present.
pub struct DisplayCausesAndBacktrace<'a> {
err: &'a Error,
... | writeln!(f, "Error: {}", cause)?; |
<|file_name|>Class_1435.java<|end_file_name|><|fim▁begin|>package fr.javatronic.blog.massive.annotation1.sub1;
import fr.javatronic.blog.processor.Annotation_001;<|fim▁hole|>public class Class_1435 {
}<|fim▁end|> |
@Annotation_001 |
<|file_name|>mod.rs<|end_file_name|><|fim▁begin|>use test::Bencher;
use digest::md5::Md5;<|fim▁hole|><|fim▁end|> |
bench_digest!(Md5); |
<|file_name|>spell_lists.py<|end_file_name|><|fim▁begin|>import os
import json
import re
from BeautifulSoup import BeautifulSoup
from psrd.rules import write_rules
from psrd.files import char_replace
from psrd.universal import parse_universal, print_struct
from psrd.sections import ability_pass, is_anonymous_section, h... |
def core_structure_pass(section, filename):
section['name'] = 'Spell Lists'
sections = [] |
<|file_name|>indentation.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|>01-add-snippets-table.js<|end_file_name|><|fim▁begin|>const {addTable} = require('../../utils');<|fim▁hole|>module.exports = addTable('snippets');<|fim▁end|> | |
<|file_name|>rename_unix.go<|end_file_name|><|fim▁begin|><|fim▁hole|>package atomicfile
import (
"os"
)
// AtomicRename atomically renames (moves) oldpath to newpath.
// It is guaranteed to either replace the target file entirely, or not
// change either file.
func AtomicRename(oldpath, newpath string) error {
retu... | // +build !windows
|
<|file_name|>orca_gui_prefs.py<|end_file_name|><|fim▁begin|># Orca
#
# Copyright 2005-2009 Sun Microsystems Inc.
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 2.1 of ... | def _presentMessage(self, text, interrupt=False):
"""If the text field is not None, presents the given text, optionally
interrupting anything currently being spoken. |
<|file_name|>rot300.py<|end_file_name|><|fim▁begin|>#7/5/2014
import Image
from pytesser import *
import telnetlib
import base64
import StringIO
def main():
tn = telnetlib.Telnet("41.231.53.40",9090)
ret = tn.read_until("\n")
print ret
base64_str = ret.strip()
decode = base64.b64decode(base64_str)
... | |
<|file_name|>urls.py<|end_file_name|><|fim▁begin|># coding:utf-8
from django.conf.urls import patterns, include, url
from kylin_log.views import *
urlpatterns = patterns('',
url(r'^list/(\w+)/$', log_list, name='log_list'),
url(r'^detail/(\w+)/$', log_detail, name='log_det... | |
<|file_name|>yui-later.js<|end_file_name|><|fim▁begin|>/* YUI 3.9.0 (build 5827) Copyright 2013 Yahoo! Inc. http://yuilibrary.com/license/ */
YUI.add('yui-later', function (Y, NAME) {
/**
* Provides a setTimeout/setInterval wrapper. This module is a `core` YUI module,
* <a href="../classes/YUI.html#method_later">it'... | |
<|file_name|>SuggestionThreadObjectFactorySpec.ts<|end_file_name|><|fim▁begin|>// Copyright 2018 The Oppia 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
//... | property_name: 'content',
state_name: 'state_1',
new_value: { |
<|file_name|>ColorStackOption.js<|end_file_name|><|fim▁begin|>import React from 'react'
import PropTypes from 'prop-types'
import FormGroup from '../forms/FormGroup'
import InputColor from '../forms/InputColor'
const ColorStackOption = ({ label, name, value, definitions, required, onChange, error }) => {
// default ... | ColorStackOption.propTypes = {
label: PropTypes.string.isRequired, |
<|file_name|>unstrap.js<|end_file_name|><|fim▁begin|>/*
* unstrap v1.1.3
* https://unstrap.org
* 2015-2020
* MIT license
*/
const version = '1.1.3',
collection = {};
function extendUnstrap (v) {
var list;
if (!collection[v].selectors) {
collection[v].selectors = ['.' + collection[v].name];
}
... | mut.forEach(function (m) {
var n = m.addedNodes,
f;
for (var i=0; i<n.length; i++) { |
<|file_name|>example2.py<|end_file_name|><|fim▁begin|># Example of managed attributes via properties
class String:
def __init__(self, name):
self.name = name
def __get__(self, instance, cls):
if instance is None:
return self
return instance.__dict__[self.name]
def __set... | def name(self): |
<|file_name|>limits.py<|end_file_name|><|fim▁begin|># Copyright 2011 OpenStack Foundation
# 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://ww... | from nova.api.openstack.compute.views import limits as limits_views
from nova.api.openstack import wsgi
from nova.api import validation |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.