prompt large_stringlengths 70 991k | completion large_stringlengths 0 1.02k |
|---|---|
<|file_name|>forms.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
import re
from django import forms
from django.contrib.auth.models import User
from django.forms import formset_factory
from django.forms.widgets import TextInput
from django.utils import timezone
from dal import autocomplete
from tagging.fiel... | widgets = {'name': forms.widgets.TextInput(attrs={'class': 'user-autocomplete'})}
DewanyaSuggestionFormSet = forms.formset_factory(DewanyaSuggestionForm, extra=3)
|
<|file_name|>html5shiv-printshiv.js<|end_file_name|><|fim▁begin|>version https://git-lfs.github.com/spec/v1<|fim▁hole|><|fim▁end|> | oid sha256:df5a7287a63d8b28fe1df2552b7f2deaa719327f8aa49fef192f5fb72bbbbaad
size 4023 |
<|file_name|>proxy.py<|end_file_name|><|fim▁begin|>from __future__ import absolute_import
from pywb.framework.wbrequestresponse import WbResponse, WbRequest
from pywb.framework.archivalrouter import ArchivalRouter
from six.moves.urllib.parse import urlsplit
import base64
import socket
import ssl
from io import Byte... | @staticmethod
def _chunk_encode(orig_iter):
for chunk in orig_iter: |
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|>"""This application provides a framework for disqualifying users for various<|fim▁hole|><|fim▁end|> | reasons, as well as simple modeling of any custom disqualification.
""" |
<|file_name|>boid.js<|end_file_name|><|fim▁begin|>window.Boid = (function(){
function Boid(x, y, settings){
this.location = new Vector(x, y);
this.acceleration = new Vector(0, 0);
this.velocity = new Vector(Helper.getRandomInt(-1,1), Helper.getRandomInt(-1,1));
this.settings = settings || {};
this.sho... | desired.multiply(m);
} else {
desired.multiply(this.maxspeed); |
<|file_name|>main.rs<|end_file_name|><|fim▁begin|>use rand::{thread_rng, seq::SliceRandom};<|fim▁hole|>
fn main() {
env_logger::init();
let game = ConnectFour::<BitState>::new(7, 6).unwrap();
let human_player = HumanPlayer::new();
let ai_player = TreeSearchPlayer::new(&game);
let mut players: Vec<Bo... |
use mcc4::*; |
<|file_name|>app.js<|end_file_name|><|fim▁begin|>/**
* xDo app client
*
* Auther: vs4vijay@gmail.com
*/
var app = angular.module('app', ['ngResource']);
app.controller('AppCtrl', ['$scope', function($scope) {
// Parent controller for all the Ctrls
$scope.appModel = {}
}]);<|fim▁hole|><|fim▁end|> |
// Can define config block here or use ngRoute |
<|file_name|>index.py<|end_file_name|><|fim▁begin|># Patchwork - automated patch tracking system
# Copyright (C) 2016 Linaro Corporation
#
# SPDX-License-Identifier: GPL-2.0-or-later
from rest_framework.response import Response
from rest_framework.reverse import reverse
from rest_framework.views import APIView
class... | |
<|file_name|>sandman_pasta.py<|end_file_name|><|fim▁begin|>"""
sandman_pasta reimplements the behaviour of decaf-masta, but instead evaluates all calls to deployable heat templates
"""
import json
from decaf_storage.json_base import StorageJSONEncoder
from decaf_storage import Endpoint
from decaf_utils_components.ba... | def get_keystones(self): |
<|file_name|>register_ext.rs<|end_file_name|><|fim▁begin|>// SPDX-License-Identifier: MIT
// Copyright wtfsckgh@gmail.com
// Copyright iced contributors
use super::register::{iced_to_register, register_to_iced, Register};
use wasm_bindgen::prelude::*;
/// [`Register`] enum extension methods
///
/// [`Register`]: enum... | ///
/// # Examples
/// |
<|file_name|>index.test.ts<|end_file_name|><|fim▁begin|><|fim▁hole|>// import React from 'react'
// import { shallow } from 'enzyme'
// import SectionLabel from '../index'
describe('TODO <SectionLabel />', () => {
it('Expect to have unit tests specified', () => {
expect(true).toEqual(true)
})
})<|fim▁end|> | |
<|file_name|>expr-block-ref.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/... | pub fn main() { let _x = { { @10 } }; } |
<|file_name|>description.py<|end_file_name|><|fim▁begin|># ----------------------------------------------------------------------
# Numenta Platform for Intelligent Computing (NuPIC)
# Copyright (C) 2013, Numenta, Inc. Unless you have an agreement
# with Numenta, Inc., for a separate license for this software code, th... | # computed from the aggregationInfo and predictAheadTime. |
<|file_name|>transactionview.cpp<|end_file_name|><|fim▁begin|>// Copyright (c) 2011-2013 The Biton developers
// Distributed under the MIT/X11 software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
#include "transactionview.h"
#include "transactionfilterproxy.h"
... | : EditAddressDialog::EditSendingAddress,
this);
dlg.setModel(addressBook); |
<|file_name|>entry.model.ts<|end_file_name|><|fim▁begin|><|fim▁hole|> description: string;
comments: any[];
}<|fim▁end|> | export class Entry {
title: string;
photo: string; |
<|file_name|>island.py<|end_file_name|><|fim▁begin|>from __future__ import division
import random
import matrix
from tile import Tile
class Island(object):
def __init__(self, width=300, height=300):
self.radius = None
self.shore_noise = None
self.rect_shore = None
self.shore_line... | def flood_fill(self, start=None):
"""
Sets all None tiles to Tile(x, y, -1) within the island shore. |
<|file_name|>test_db_api.py<|end_file_name|><|fim▁begin|># vim: tabstop=4 shiftwidth=4 softtabstop=4
# encoding=UTF8
# Copyright 2010 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# All Rights Reserved.
#
# Licensed under the Apache License, Ver... |
class S3ImageTestCase(test.TestCase): |
<|file_name|>tests.py<|end_file_name|><|fim▁begin|># -*- encoding: utf-8 -*-
"""
Tests for django.core.servers.
"""
from __future__ import unicode_literals
import os
import socket
try:
from urllib.request import urlopen, HTTPError
except ImportError: # Python 2
from urllib2 import urlopen, HTTPError
from ... | self.assertEqual(f.read(), b'example view')
def test_static_files(self):
""" |
<|file_name|>UserNotifications.tsx<|end_file_name|><|fim▁begin|>import React, { useState } from 'react';
import classNames from 'classnames';
import { Button, Classes, InputGroup } from '@blueprintjs/core';
import { FilterTerm, NotificationsState } from './types';
import { useNotificationsContext } from './userNotific... | const renderPreferences = () => { |
<|file_name|>GEMglFeedbackBuffer.cpp<|end_file_name|><|fim▁begin|>////////////////////////////////////////////////////////
//
// GEM - Graphics Environment for Multimedia
//
// Implementation file
//
// Copyright (c) 2002-2011 IOhannes m zmölnig. forum::für::umläute. IEM. zmoelnig@iem.at
// zmoelnig@iem.kug.ac.at
// F... | ///////////////////////////////////////////////////////// |
<|file_name|>issue-15858.rs<|end_file_name|><|fim▁begin|>// Copyright 2012-2014 The Rust Project Developers. See the COPYRIGHT<|fim▁hole|>// 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://ww... | |
<|file_name|>NavGroup.js<|end_file_name|><|fim▁begin|>import React, {PropTypes, Component} from 'react';
import { NavGroup } from 'react-photonkit'
/*class NavGroup extends Component {
static propTypes = {
children: PropTypes.any
}
constructor(props) {
super(props);<|fim▁hole|> this.state = {};
}
... | |
<|file_name|>lib.rs<|end_file_name|><|fim▁begin|>// Copyright 2014 The Servo Project Developers. See the
// COPYRIGHT file at the top-level directory of this distribution.
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
// <LICENS... | #[plugin_registrar]
pub fn plugin_registrar(reg: &mut Registry) { |
<|file_name|>test_mol2.py<|end_file_name|><|fim▁begin|>from Sire.Base import *
from Sire.IO import *
from Sire.Mol import *
from glob import glob
from nose.tools import assert_equal, assert_almost_equal
# Check that we have Mol2 support in this version of Sire.
has_mol2 = True
try:
p = Mol2()
except:
# No Mo... | # Sire Molecule from the parsed data. Following this, we then check that the
# parser can convert the molecule back into the correct data format, ready to
# be written to file. |
<|file_name|>parviewer.rs<|end_file_name|><|fim▁begin|>/*!
# ParView
*/
#![deny(non_camel_case_types)]
#![deny(unused_parens)]
#![deny(non_upper_case_globals)]
#![deny(unused_qualifications)]
#![deny(missing_docs)]
#![deny(unused_results)]
extern crate docopt;
extern crate parview;
extern crate serde;
use docopt::Doc... | let config: Config = toml_config.to_parviewer_config();
|
<|file_name|>index.ts<|end_file_name|><|fim▁begin|>/*
* MIT License
*
* Copyright (c) 2018 Choko (choko@curioswitch.org)
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal<|fim▁hole|> * in the Software wi... | |
<|file_name|>datelib.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
# Copyright 2002 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://ww... | return super(BaseTimestamp, cls).utcnow().replace(tzinfo=pytz.utc)
|
<|file_name|>issue-6919.rs<|end_file_name|><|fim▁begin|>// Copyright 2013 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/lice... |
#[crate_id="issue-6919"]; |
<|file_name|>treePlotter.py<|end_file_name|><|fim▁begin|>import matplotlib
import matplotlib.pyplot as plt
decisionNoe = dict(boxstyle="sawtooth", fc="0.8")
leafNode = dict(boxstyle="round4", fc="0.8")
arrow_args = dict(arrowstyle="<-")
def plotNoe(nodeTxt, centerPt, parentPt, nodeType):
createPlot.ax1.annotate(... | yMid = (parentPt[1] - cntrPt[1]) / 2.0 + cntrPt[1]
createPlot.ax1.text(xMid, yMid, txtString, va="center", ha="center", rotation=30) |
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
##############################################################################
#<|fim▁hole|>#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHA... | # 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 version 3 of the License, or
# (at your option) any later version. |
<|file_name|>test_v3.py<|end_file_name|><|fim▁begin|># 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 required by applicable law or... | |
<|file_name|>showroom.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
"""Module providing views for the folderish content page type"""
import json
import urllib
from Acquisition import aq_inner
from Products.Five.browser import BrowserView
from plone import api
from plone.i18n.normalizer.interfaces import IIDNo... | return len(assets['items']) > 0
return False |
<|file_name|>test_mechanism_odl.py<|end_file_name|><|fim▁begin|># Copyright (c) 2013-2014 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
... | self.assertRaises(exc_class, method, context)
else: |
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
"""
Copyright (C) 2014 Dariusz Suchojad <dsuch at zato.io>
Licensed under LGPLv3, see LICENSE.txt for terms and conditions.
"""
from __future__ import absolute_import, division, print_function, unicode_literals
# stdlib
from httplib impor... | |
<|file_name|>callback_this.js<|end_file_name|><|fim▁begin|>// @flow
class A {
x = [1, 2, 3];
y = 4;
foo() {
this.x = this.x.map(function (z) {
this.y; // error, function has wrong this
});
}
}<|fim▁hole|> x = [1, 2, 3];
y = 4;
foo() {
this.x = this.x.map(f... |
class B { |
<|file_name|>0001_initial.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
# Generated by Django 1.9 on 2015-12-11 22:01
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
<|fim▁hole|>
... | dependencies = [
] |
<|file_name|>main.js<|end_file_name|><|fim▁begin|><|fim▁hole|>
global.app = () => {
return Tea;
}<|fim▁end|> | 'use strict'
import Tea from './modules/tea.core.js' |
<|file_name|>consistency.rs<|end_file_name|><|fim▁begin|>#[allow(non_camel_case_types)]
#[repr(C)]
pub enum CassConsistency {
ANY=0,
ONE=1,
TWO=2,<|fim▁hole|> LOCAL_QUORUM=6,
EACH_QUORUM=7,
SERIAL=8,
LOCAL_SERIAL=9,
LOCAL_ONE=10,
}
impl Copy for CassConsistency {}<|fim▁end|> | THREE=3,
QUORUM=4,
ALL=5, |
<|file_name|>servicebroker.go<|end_file_name|><|fim▁begin|>package cmd
import (
"errors"
"fmt"
"github.com/openshift/origin/pkg/client"
"github.com/openshift/origin/pkg/cmd/util/clientcmd"
servicebrokerapi "github.com/openshift/origin/pkg/servicebroker/api"
"github.com/spf13/cobra"
"io"
kcmdutil "k8s.io/kubern... | Name string
UserName string |
<|file_name|>util.py<|end_file_name|><|fim▁begin|>import smtplib
import email.utils
from email.mime.text import MIMEText
import functools
import qiniu
try:
from config import AIRBB_HOST
except Exception, e:
print '==============no AIRBB_HOST set, ues airbb.xx as default==============', e
AIRBB_HOST = 'airb... | if type(s)==str:
return s.decode('utf8','ignore') |
<|file_name|>searchdata.js<|end_file_name|><|fim▁begin|>var indexSectionsWithContent =
{
0: "dfrsw~",
1: "drs",
2: "dfrs~",
3: "rs",
4: "w"
};
var indexSectionNames =
{
0: "all",
1: "classes",
2: "functions",<|fim▁hole|> 4: "pages"
};
var indexSectionLabels =
{
0: "All",
1: "Classes",
2: "Funct... | 3: "variables", |
<|file_name|>defineProperty_test.js<|end_file_name|><|fim▁begin|>// ==========================================================================
// Project: SproutCore Metal
// Copyright: ©2011 Strobe Inc. and contributors.
// License: Licensed under MIT license (see license.js)
// ====================================... | var obj = {};
SC.platform.defineProperty(obj, 'foo', {
enumerable: false,
writable: true, |
<|file_name|>v2adapter.go<|end_file_name|><|fim▁begin|>package firehoseclient
import (
"code.cloudfoundry.org/go-loggregator"
"code.cloudfoundry.org/go-loggregator/conversion"
"code.cloudfoundry.org/go-loggregator/rpc/loggregator_v2"
"context"
"github.com/cloudfoundry/sonde-go/events"
)
type Streamer interface {... | })
|
<|file_name|>local_target_test.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
#
# Copyright 2012-2015 Spotify AB
#
# 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... | def test_listdir(self):
os.mkdir(self.path)
with open(self.path + '/file', 'w'): |
<|file_name|>map.js<|end_file_name|><|fim▁begin|>(function(){
'use strict';
Ns.views.map.Layout = Marionette.LayoutView.extend({
id: 'map-container',
template: '#map-layout-template',
regions: {
content: '#map-js',
legend: '#legend-js',
panels: '#map... | |
<|file_name|>read-modules.js<|end_file_name|><|fim▁begin|>/* global requirejs, require */
/*jslint node: true */
'use strict';
import Ember from 'ember';
import _keys from 'lodash/object/keys';
/*
This function looks through all files that have been loaded by Ember CLI and
finds the ones under /mirage/[factories... | |
<|file_name|>main.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
#coding=utf-8
# Copyright 2007 Google Inc.
#<|fim▁hole|># 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 required by applicabl... | # Licensed under the Apache License, Version 2.0 (the "License"); |
<|file_name|>errors.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
"""
The MIT License (MIT)
Copyright (c) 2015-2016 Rapptz
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 restri... | if message is not None:
# clean-up @everyone and @here mentions
m = message.replace('@everyone', '@\u200beveryone').replace('@here', '@\u200bhere')
super().__init__(m, *args) |
<|file_name|>index.js<|end_file_name|><|fim▁begin|>import React from 'react'
const EditableText = React.createClass({
propTypes: {<|fim▁hole|> onSubmit: React.PropTypes.func.isRequired,
validator: React.PropTypes.func,
enableEditing: React.PropTypes.bool,
value: React.PropTypes.oneOfType([
React... | |
<|file_name|>top_level_interaction.js<|end_file_name|><|fim▁begin|>(function() {
function setUpTopLevelInteraction() {<|fim▁hole|> TopLevelInteraction.execute();
}
document.addEventListener("DOMContentLoaded", setUpTopLevelInteraction);
})();<|fim▁end|> | var TopLevelInteraction = new ITPHelper({
redirectUrl: document.body.dataset.redirectUrl,
});
|
<|file_name|>testSmS.py<|end_file_name|><|fim▁begin|>from twilio.rest import TwilioRestClient
# Your Account Sid and Auth Token from twilio.com/user/account
account_sid = "AC433e7b0bec93dc5996e4fb80b1e56eec"
auth_token = "9cc9267fe09dab362d3be160f711a09d"
client = TwilioRestClient(account_sid, auth_token)
message =... | print message.sid |
<|file_name|>insert-data.ts<|end_file_name|><|fim▁begin|>export class Coordinates {<|fim▁hole|> public x: number[]
public y: number[]
constructor() {
this.x = [0]
this.y = [0]
}
}
export class Parameterisation {
public id: number
public width: number
public length: number
insert: Coordinates
... | |
<|file_name|>views.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
from Instanssi.common.auth import user_access_required
from django.shortcuts import render
from django.http import HttpResponseRedirect
from django.contrib import auth
from django.urls import reverse
from Instanssi.users.forms import OpenIDLogi... | methods = []
for method in AUTH_METHODS:
methods.append(method + (method[1] in active_providers, ))
|
<|file_name|>DecisionCompiler.java<|end_file_name|><|fim▁begin|>/*
* Copyright 2017 Red Hat, Inc. and/or its affiliates.
*
* 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:... | Optional<String> alias = model.getImportAliasFor(dep.getModelNamespace(), dep.getModelName());
if (alias.isPresent()) { |
<|file_name|>config.js<|end_file_name|><|fim▁begin|>/*************************************************************
*
* MathJax/jax/output/HTML-CSS/config.js
*
* Initializes the HTML-CCS OutputJax (the main definition is in
* MathJax/jax/input/HTML-CSS/jax.js, which is loaded when needed).
*
* -----... | Safari: 2.0,
Konqueror: 4.0
|
<|file_name|>establishment.resolver.ts<|end_file_name|><|fim▁begin|>import { Injectable } from '@angular/core';
import { Resolve, ActivatedRouteSnapshot } from '@angular/router';
import { Node } from '../node/node';
import { RestService } from '../rest.service';
import { Http, Response } from '@angular/http';
import { ... | audits.forEach(audit => { |
<|file_name|>slack.rs<|end_file_name|><|fim▁begin|>use std::sync::{Arc, Mutex};
use log::{debug, error, info};
use serde_derive::{Deserialize, Serialize};
use crate::util;
use crate::worker;
use octobot_lib::errors::*;
use octobot_lib::http_client::HTTPClient;
use octobot_lib::metrics::Metrics;
#[derive(Serialize, C... | |
<|file_name|>go.js<|end_file_name|><|fim▁begin|>/*
Language: Go
Author: Stephan Kountso aka StepLg <steplg@gmail.com>
Contributors: Evgeny Stepanischev <imbolk@gmail.com>
Description: Google go language (golang). For info about language
Website: http://golang.org/
Category: common, system
*/
function(hljs) {
var GO_... | |
<|file_name|>properties.py<|end_file_name|><|fim▁begin|># Copyright 2019 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unl... | def __init__(self, label, cls):
super().__init__(label)
self._cls = cls |
<|file_name|>bitcoin_ca.ts<|end_file_name|><|fim▁begin|><?xml version="1.0" ?><!DOCTYPE TS><TS language="ca" version="2.0">
<defaultcodec>UTF-8</defaultcodec>
<context>
<name>AboutDialog</name>
<message>
<location filename="../forms/aboutdialog.ui" line="+14"/>
<source>About Guncoin</source>
... | <source>Sign &message...</source>
<translation type="unfinished"/>
</message>
<message> |
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|>from __future__ import print_function
#import unittest
import os
import sys
from functools import wraps
from django.conf import settings
from south.hacks import hacks
# Make sure skipping tests is available.
try:
# easiest and best is unittest included in Djan... |
class Monkeypatcher(unittest.TestCase):
|
<|file_name|>ParseUtil_4922813.java<|end_file_name|><|fim▁begin|>/*
* Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General ... | encodedInPath.set('{'); |
<|file_name|>test_cli.py<|end_file_name|><|fim▁begin|>from unittest import TestCase
import pkg_resources
from mock import patch
from click import UsageError
from click.testing import CliRunner
class TestCli(TestCase):
@patch('molo.core.cookiecutter.cookiecutter')
def test_scaffold(self, mock_cookiecutter):... | |
<|file_name|>S12.14_A2.js<|end_file_name|><|fim▁begin|>// Copyright 2009 the Sputnik authors. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/**
* @name: S12.14_A2;
* @section: 12.14;
* @assertion: Throwing exception with "throw" and catching it with "try" statement;
*... | |
<|file_name|>Snackbar.js<|end_file_name|><|fim▁begin|>import React, { Component } from 'react';
import { connect } from 'react-redux';
import { bindActionCreators } from 'redux';
import { fetchIP } from '../../actions/fetchIP';
import { Snackbar } from 'react-toolbox';
import theme from './Snackbar.css';
class Snackb... | |
<|file_name|>h264_parser_fuzzertest.cc<|end_file_name|><|fim▁begin|>// Copyright 2016 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 <stddef.h>
#include "base/numerics/safe_conversions.h"
#include "base/option... | break;
switch (nalu.nal_unit_type) { |
<|file_name|>run_transform_on_couchdb_docs.py<|end_file_name|><|fim▁begin|>'''This allows running a bit of code on couchdb docs.
code should take a json python object, modify it and hand back to the code
Not quite that slick yet, need way to pass in code or make this a decorator
'''
import importlib
from harvester.coll... | return doc
|
<|file_name|>ChamferDistanceTransform2D.java<|end_file_name|><|fim▁begin|>/**
*
*/
package inra.ijpb.binary.distmap;
/**
* Specialization of DistanceTransform based on the use of a chamfer mask.
*
* Provides methods for retrieving the mask, and the normalization weight.
*
* @author dlegland
*/
public interf... | {
/**
* Return the chamfer mask used by this distance transform algorithm. |
<|file_name|>mod.rs<|end_file_name|><|fim▁begin|>pub fn to_upper_first(input: &str) -> String {
let mut c = input.chars();
match c.next() {
None => String::new(),
Some(x) => x.to_uppercase().collect::<String>() + c.as_str()
}
}
pub fn to_lower_first(input: &str) -> String {
let mut c =... | None => String::new(),
Some(x) => x.to_lowercase().collect::<String>() + c.as_str() |
<|file_name|>cpu.py<|end_file_name|><|fim▁begin|>"""Script to execute CPU and get a best move using Minimax algorithm"""
import copy<|fim▁hole|>OPP = [1, 0]
def eval_rc(board, player, glength, roc):
"""Returns row or column score"""
score_sum = 0
clone_board = board
if roc == "c":
clone_boar... | from common import board_full, win
|
<|file_name|>RFTConfig.cpp<|end_file_name|><|fim▁begin|>/*
Copyright 2019 Equinor ASA.
This file is part of the Open Porous Media project (OPM).
OPM 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... | |
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|>import logging
from contextlib import contextmanager
from ..errors import CompilerError
from .state import State
from .core import Context, Object, BoundObject, SoftScope, Scope, Type
from .module import Module
from .closure import Closure, ClosedLink, ClosedTarge... | verify(module, logger)
return module |
<|file_name|>WorkFrame.java<|end_file_name|><|fim▁begin|>package gui;
import java.awt.Dimension;
import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;
import java.io.BufferedReader;
import java.io.File;
import java.io.FileOutputStream;
import java.io.FileReader;
import java.io.IOException;
... | }
/**
|
<|file_name|>gdata-extension.js<|end_file_name|><|fim▁begin|>/*
Copyright 2010, Google Inc.
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are
met:
* Redistributions of source code must retain the above co... | copyright notice, this list of conditions and the following disclaimer
in the documentation and/or other materials provided with the
distribution. |
<|file_name|>parsed-property.d.ts<|end_file_name|><|fim▁begin|>export interface ParsedProperty {
_name: string;
_type: string;
_targetProfiles?: string[];
_multiple?: boolean;
_required?: boolean;
<|fim▁hole|> _valueSetStrength?: string;
_valueSet?: string;
}<|fim▁end|> | _choice?: string;
_properties?: ParsedProperty[];
|
<|file_name|>string.rs<|end_file_name|><|fim▁begin|>/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
use eutil::slice_to_str;
use libc::{size_t, c_int, c_ushort,c... | |
<|file_name|>vultr_ssh_key_info.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python
# -*- coding: utf-8 -*-
#
# (c) 2018, Yanis Guenane <yanis+ansible@guenane.org>
# (c) 2019, René Moser <mail@renemoser.net>
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ imp... | 'SSHKEYID': dict(key='id'),
'name': dict(),
'ssh_key': dict(), |
<|file_name|>StringBufferHolder.java<|end_file_name|><|fim▁begin|>/**********************************************************************
Copyright (c) 2006 Erik Bengtson and others. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance wi... | Contributors:
|
<|file_name|>StripeStream.hh<|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<|fim▁hole|> * to you under the Apache License, Version 2.0 (the
* "License... | * regarding copyright ownership. The ASF licenses this file |
<|file_name|>Widgets.py<|end_file_name|><|fim▁begin|># This file is part of Pooky.
# Copyright (C) 2013 Fcrh <coquelicot1117@gmail.com>
#
# Pooky 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 ... |
def __init__(self, *args):
super().__init__(*args)
|
<|file_name|>test-2.0.0.js<|end_file_name|><|fim▁begin|><|fim▁hole|><|fim▁end|> | console.log('load version 2.0.0'); |
<|file_name|>projects.js<|end_file_name|><|fim▁begin|><|fim▁hole|>export default () => <h1>Projects</h1><|fim▁end|> | |
<|file_name|>suite_data.go<|end_file_name|><|fim▁begin|>package suite_init
type SuiteData struct {
*StubsData
*SynchronizedSuiteCallbacksData
*WerfBinaryData
*ProjectNameData<|fim▁hole|>}
func (data *SuiteData) SetupStubs(setupData *StubsData) bool {
data.StubsData = setupData
return true
}
func (data *SuiteDa... | *K8sDockerRegistryData
*TmpDirData
*ContainerRegistryPerImplementationData |
<|file_name|>filereader.rs<|end_file_name|><|fim▁begin|>/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
use base64;
use dom::bindings::cell::DOMRefCell;
use dom::... | event_handler!(load, GetOnload, SetOnload);
// https://w3c.github.io/FileAPI/#dfn-onabort |
<|file_name|>make.js<|end_file_name|><|fim▁begin|>import getDevTool from './devtool'
import getTarget from './target'
import getEntry from './entry'
import getOutput from './output'
import getResolve from './resolve'
import getResolveLoader from './resolveLoader'
import getModule from './module'
import getExtern... | |
<|file_name|>dialogue.py<|end_file_name|><|fim▁begin|>import numpy as np
from numpy import cumsum, sum, searchsorted
from numpy.random import rand
import math
import utils
import core.sentence as sentence
import core.markovchain as mc
import logging
logger = logging.getLogger(__name__)
# Dialogue making class. Need t... | |
<|file_name|>componentMethodsJsDocHandler.js<|end_file_name|><|fim▁begin|>/*
* Copyright (c) 2015, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be... | |
<|file_name|>Ref_EventConsumerBean.java<|end_file_name|><|fim▁begin|>/*
* Copyright (c) 2006 - 2012 LinogistiX GmbH
*
* www.linogistix.com
*
* Project myWMS-LOS
*/<|fim▁hole|>import de.linogistix.los.customization.LOSEventConsumerBean;
import de.linogistix.los.util.event.LOSEventConsumer;
/**
* @author kra... | package de.linogistix.los.reference.customization.common;
import javax.ejb.Stateless;
|
<|file_name|>fullkey_array.cpp<|end_file_name|><|fim▁begin|>#include "fullkey_array.h"
#include "../../base.h"
namespace md5db
{
fullkey_array_t::fullkey_array_t ( )
{
}
fullkey_array_t::~ fullkey_array_t ( )
{
close ();
}
void fullkey_array_t::close ( )
{
for ( int i... | |
<|file_name|>_url.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
# -*- coding: utf-8 -*-<|fim▁hole|><|fim▁end|> |
import root
import j |
<|file_name|>kendo.culture.ms.js<|end_file_name|><|fim▁begin|>/*
* Kendo UI v2014.3.1119 (http://www.telerik.com/kendo-ui)
* Copyright 2014 Telerik AD. All rights reserved.
*
* Kendo UI commercial licenses may be obtained at
* http://www.telerik.com/purchase/license-agreement/kendo-ui-complete
* If you do not own a com... | |
<|file_name|>lib.rs<|end_file_name|><|fim▁begin|>//! Collect an iterator into a slice.
//!
//! Rust comes with the `Iterator::collect` method for collecting an iterator's items into
//! a heap-allocated `Vec` or any other type that implements `FromIterator`, but there's
//! no way to collect items into a stack-allocate... | |
<|file_name|>live_game_header.js<|end_file_name|><|fim▁begin|>// !LOCNS:live_game
var model;
var handlers = {};
$(document).ready(function () {
function HeaderViewModel() {
var self = this;
self.active = ko.observable(true);
self.setup = function () {
$(window).focus(function... | } |
<|file_name|>0001_initial.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
# Generated by Django 1.10.2 on 2016-10-11 19:21
from __future__ import unicode_literals
<|fim▁hole|>import prosody.utils
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
... | from django.db import migrations, models |
<|file_name|>AA2_add_miRNA_infor_miR-155_rev_seed.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
import re
from operator import itemgetter
ref_file = open('../../../data/RNA-seq_miR-124_miR-155_transfected_HeLa/gene_exp_miR-155_overexpression_RefSeq_Rep_isoforms.diff','r')
input_file = open('../../../res... | ref_dict[refid] = line
for line in input_file:
|
<|file_name|>IUserVerifier.ts<|end_file_name|><|fim▁begin|>interface IUserVerifier {<|fim▁hole|> verificationCode: string;
}
export = IUserVerifier;<|fim▁end|> | email: string; |
<|file_name|>setup.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
from setuptools import setup, find_packages
from bang import VERSION
import os.path
ETC = os.path.join(os.path.dirname(__file__), 'etc')
with open(os.path.join(ETC, 'requirements.pip')) as f:
reqs = [l.strip() for l in f if '://' not in l]
... | license='GPLv3',
description='Server and cloud resource deployment automation',
platforms='POSIX', |
<|file_name|>resPromise.js<|end_file_name|><|fim▁begin|>'use strict';
// var Boom = require('boom');
var BPromise = require('bluebird');
module.exports = function (handler) {
return function (req, res) {
return new BPromise(function (resolve) {
resolve(handler(req, res));
})
.then(function (resp... | |
<|file_name|>app.constants.ts<|end_file_name|><|fim▁begin|>export const _appRoles: any = {
"_MEMBER": {
title: 'Members'
},
"_ADMIN": {
title: 'Admin'
},
"_SUPERADMIN": {
title: 'Super admin'
}
}
export const _appErrorCodes: any = {
"500": {
title: "Internal ... | |
<|file_name|>test_selector_ts.py<|end_file_name|><|fim▁begin|>import math
import socket
import tempfile
import unittest
from contextlib import closing
import numpy as np
from shyft.api import (
Calendar, UtcPeriod,
DtsServer, DtsClient,
TimeAxis, TimeSeries, POINT_AVERAGE_VALUE, POINT_INSTANT_VALUE
)
from... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.