prompt large_stringlengths 70 991k | completion large_stringlengths 0 1.02k |
|---|---|
<|file_name|>instancing.rs<|end_file_name|><|fim▁begin|>#[macro_use]
extern crate glium;
extern crate rand;
use glium::Surface;
use glium::glutin;
mod support;
fn main() {
use glium::DisplayBuild;
println!("This example draws 10,000 instanced teapots. Each teapot gets a random position and \
d... | vec3 color = (0.3 + 0.7 * lum) * v_color;
f_color = vec4(color, 1.0); |
<|file_name|>issue-54467.rs<|end_file_name|><|fim▁begin|>// Regression test for #54467:
//
// Here, the trait object has an "inferred outlives" requirement that
// `<Self as MyIterator<'a>>::Item: 'a`; but since we don't know what
// `Self` is, we were (incorrectly) messing things up, leading to
// strange errors. This... |
fn main() { } |
<|file_name|>label.rs<|end_file_name|><|fim▁begin|>use sfml::graphics::{RenderTarget, Text, TextStyle, Color};
use sfml::system::vector2::Vector2f;
use window::Window;
use font::Font;
/// A label (text)
pub struct Label<'a> {
text: Text<'a>,
}
impl<'a> Label<'a> {
/// Create a new label
pub fn new(font: ... | } |
<|file_name|>menu_item.rs<|end_file_name|><|fim▁begin|>// This file was generated by gir (b7f5189) from gir-files (71d73f0)
// DO NOT EDIT
use Actionable;
use Bin;
use Container;
use Menu;
use Object;
use Widget;
use ffi;
use glib::Value;
use glib::object::Downcast;
use glib::object::IsA;
use glib::signal::connect;
us... | |
<|file_name|>manage.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
import os
import sys
if __name__ == "__main__":
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "badguys.settings")
from django.core.management import execute_from_command_line<|fim▁hole|><|fim▁end|> |
execute_from_command_line(sys.argv) |
<|file_name|>udisks2.go<|end_file_name|><|fim▁begin|>// -*- Mode: Go; indent-tabs-mode: t -*-
/*
* Copyright (C) 2016-2018 Canonical Ltd
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 3 as
* published by the Free Software Fou... | capability sys_rawio,
`
|
<|file_name|>qmllibrarydependency.cpp<|end_file_name|><|fim▁begin|>/****************************************************************************
**
** Copyright (C) 2014-2018 Dinu SV.
** (contact: mail@dinusv.com)
** This file is part of Live CV Application.
**
** GNU Lesser General Public License Usage
** This file ma... | return number;
}
bool QmlLibraryDependency::parseVersion(const QString &str, int *major, int *minor){ |
<|file_name|>disabled-if-not-permitted.pipe.ts<|end_file_name|><|fim▁begin|>import { Pipe } from '@angular/core';
import { KMCPermissionsService } from './kmc-permissions.service';
import { ActionPermittedPipeBase, Modes } from '@kaltura-ng/mc-shared';
import { KMCPermissions } from './kmc-permissions';
@Pipe({ name: ... | } |
<|file_name|>Digest.d.ts<|end_file_name|><|fim▁begin|>/// <reference path="../_import/_fibjs.d.ts" />
/// <reference path="../interface/object.d.ts" />
/// <reference path="../interface/Buffer.d.ts" />
/// <reference path="../interface/PKey.d.ts" />
/**
* @description 信息摘要对象
*/<|fim▁hole|> /**
* @description... | declare class Class_Digest extends Class_object { |
<|file_name|>rendertarget.cpp<|end_file_name|><|fim▁begin|>#include "rendertarget.h"
#include <system/engine.h>
#include <renderer/renderer.h>
#include <renderer/forms.h>
using namespace CGE;
RenderTarget* RenderTarget::mCurrTarget = NULL;
void RenderTarget::drawFullscreen(bool transform){
Renderer* rend = Engine:... | |
<|file_name|>array_test.js<|end_file_name|><|fim▁begin|>var globalArgsTest = 'nothing to see here';
new Test.Unit.Runner({
test$A: function(){
this.assertEnumEqual([], $A({}));
},
testToArrayOnArguments: function(){
function toArrayOnArguments(){
globalArgsTest = $A(arguments);
}
toArray... | this.assertEnumEqual([1,3], [1,1,3,5].intersect([1,2,3]));
this.assertEnumEqual([1], [1,1].intersect([1,1]));
this.assertEnumEqual([], [1,1,3,5].intersect([4])); |
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|>from flappy.display3d.vertexbuffer3d import VertexBuffer3D, VertexBuffer3DFormat
from flappy.display3d.indexbuffer3d import IndexBuffer3D
from flappy.display3d.program3d import Program3D<|fim▁hole|><|fim▁end|> | from flappy.display3d.texture import Texture
from flappy.display3d.scene3d import Scene3D |
<|file_name|>GreenFunctions.cpp<|end_file_name|><|fim▁begin|>/*
Copyright (c) 2009 Sebastian Steiger, Integrated Systems Laboratory, ETH Zurich.
Comments, suggestions, criticism or bug reports are welcome: steiger@purdue.edu.
This file is part of ANGEL, a simulator for LEDs based on the NEGF formalism.
The software i... | |
<|file_name|>0001_initial.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
# Generated by Django 1.11.3 on 2017-08-03 11:13
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
<|fim▁hole|> ]
operations = [
migrations.CreateMod... | initial = True
dependencies = [ |
<|file_name|>0021_localconfig_need_dovecot_update.py<|end_file_name|><|fim▁begin|># Generated by Django 2.2.10 on 2020-04-29 12:31
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [<|fim▁hole|> ('core', '0020_auto_20200421_0851'),
]
operations = [
... | |
<|file_name|>chain.js<|end_file_name|><|fim▁begin|>/**
* Copyright 2016-2017 IBM 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/licen... | }, |
<|file_name|>CertificateException.hpp<|end_file_name|><|fim▁begin|>/*================================================================================
code generated by: java2cpp
author: Zoran Angelov, mailto://baldzar@gmail.com
class: javax.security.cert.CertificateException
==================================... | namespace j2cpp {
|
<|file_name|>qa_multiply_matrix_ff.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright 2014 Free Software Foundation, Inc.
#
# This file is part of GNU Radio
#
# GNU Radio is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public Li... | """ Tags """
X_in = (
(1, 2, 3, 4),
(5, 6, 7, 8), |
<|file_name|>WhiteboardParticipantEvent.java<|end_file_name|><|fim▁begin|>/*
* Jitsi, the OpenSource Java VoIP and Instant Messaging client.
*
* Distributable under LGPL license.
* See terms of license at gnu.org.
*/
package net.java.sip.communicator.service.protocol.event;
import java.util.*;
import net.java.si... | /**
* Serial version UID. |
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|>'''<|fim▁hole|>'''<|fim▁end|> | An implementation of the
`Annotation store API <http://docs.annotatorjs.org/en/v1.2.x/storage.html.>`_
for `Annotator.js <http://annotatorjs.org/>`_. |
<|file_name|>web.rs<|end_file_name|><|fim▁begin|>use actix::Addr;
use actix_web::{http, middleware};
use actix_web::{web, App, HttpServer};
use diesel::r2d2::{self, ConnectionManager};
use diesel::PgConnection;
use crate::database::DbExecutor;
use badge::handlers::badge_handler;
// use run::handlers::run_handler;
use... | .unwrap()
.start();
} |
<|file_name|>server_py3.py<|end_file_name|><|fim▁begin|>import http.server<|fim▁hole|>class BaseServer(http.server.BaseHTTPRequestHandler):
pass
HTTPServer = http.server.HTTPServer
urllib_urlparse = urllib.parse.urlparse<|fim▁end|> | import urllib.parse
|
<|file_name|>ScreenMenu.ts<|end_file_name|><|fim▁begin|>import GameEx = require("../../npfw/GameEx");
import ScreenEx = require("../../npfw/ScreenEx");
import Task = require("../../npfw/tasks/Task");
<|fim▁hole|> bg: any;
screensLoaded: boolean;
painted: boolean;
constructor(game: GameEx.GameEx) {
... | export class ScreenMenu extends ScreenEx.ScreenEx {
|
<|file_name|>autoaudioinput.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
# Copyright (C) 2010 Holoscópio Tecnologia
# Author: Luciana Fujii Pontello <luciana@holoscopio.com>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as publ... | |
<|file_name|>fn-custom-6.rs<|end_file_name|><|fim▁begin|>// rustfmt-fn_args_layout: Block
// rustfmt-fn_brace_style: PreferSameLine
// Test different indents.
<|fim▁hole|>fn bar(a: Aaaaaaaaaaaaaa, b: Bbbbbbbbbbbbbb, c: Cccccccccccccccccc, d: Dddddddddddddddd, e: Eeeeeeeeeeeeeee) {
bar();
}
fn foo(a: Aaaaaaaaaaaaaa... | fn foo(a: Aaaaaaaaaaaaaa, b: Bbbbbbbbbbbbbb) {
foo();
}
|
<|file_name|>20.d.ts<|end_file_name|><|fim▁begin|>import { DirectionMerge20 } from "../../";<|fim▁hole|><|fim▁end|> |
export = DirectionMerge20; |
<|file_name|>views.py<|end_file_name|><|fim▁begin|>import hashlib
from django.shortcuts import render, render_to_response, redirect
from django.views.decorators.csrf import csrf_exempt
from django.core.exceptions import ObjectDoesNotExist
from accounts.models import User
from student.models import StudentMessage, Elect... | else:
flash(request, 'error', u'教师还没有发布课程信息!')
except ObjectDoesNotExist:
flash(request, 'error', u'没有该课程') |
<|file_name|>boaview.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python3
import sys
import click
from boadata import __version__
from boadata.cli import try_load, try_apply_sql, qt_app
<|fim▁hole|>@click.version_option(__version__)
@click.argument("uri")
@click.option("-s", "--sql", required=False, help="SQL to r... | @click.command() |
<|file_name|>setup.py<|end_file_name|><|fim▁begin|>import re
from setuptools import setup
<|fim▁hole|> if version_match:
return version_match.group(1)
__version__ = find_version('librdflib/__init__.py')
with open('README.md', 'rt') as f:
long_description = f.read()
tests_require = ['pytest']... | def find_version(filename):
_version_re = re.compile(r"__version__ = '(.*)'")
for line in open(filename):
version_match = _version_re.match(line) |
<|file_name|>timing.py<|end_file_name|><|fim▁begin|>"""
Provides Matlab-like tic, tac and toc functions.
"""
import time
import numpy as np
<|fim▁hole|>
class __Timer__:
"""Computes elapsed time, between tic, tac, and toc.
Methods
-------
tic :
Resets timer.
toc :
Returns and print... | |
<|file_name|>models.py<|end_file_name|><|fim▁begin|>import django
from django.db import models
from pytigon_lib.schdjangoext.fields import *
from pytigon_lib.schdjangoext.models import *
import pytigon_lib.schdjangoext.fields as ext_models
from pytigon_lib.schtools import schjson
from django.utils.translation import ... |
from schwiki.models import *
from schcommander.models import * |
<|file_name|>conf.py<|end_file_name|><|fim▁begin|>from platform import system
import os
from os.path import sep, expanduser, join as join_path
from collections import defaultdict
import pygame as pg
import settings
from util import ir, dd, split
class Conf (object):
IDENT = 'wvoas'
USE_SAVEDATA = True
... | 'stars': [(215, 15)],
'rects': [(0, 460, 325, 80), (325, 450, 635, 90), (200, 50, 50, 400), |
<|file_name|>Acceleration.cpp<|end_file_name|><|fim▁begin|>/*
Copyright_License {
XCSoar Glide Computer - http://www.xcsoar.org/
Copyright (C) 2000-2015 The XCSoar Project
A detailed list of copyright holders can be found in the file "AUTHORS".
This program is free software; you can redistribute it and/or
m... | available = add.available;
} |
<|file_name|>output.rs<|end_file_name|><|fim▁begin|>use raii::Raii;
use {ffi, Handle, Return};
use super::types::OdbcType;
/// Indicates that a type can be retrieved using `Cursor::get_data`
pub unsafe trait Output<'a>: Sized {
fn get_data(
stmt: &mut Raii<ffi::Stmt>,
col_or_param_num: u16,
... | // let null_offset = if buffer.ends_with(T::null_bytes()) { T::null_bytes().len() } else { 0 };
// (Alexander Yekimov <a.yekimov@gmail.com>) It's a bad idea to do such workarounds
// for buggy drivers here. They always can implement OdbcType trait and set any |
<|file_name|>Dashboard.js<|end_file_name|><|fim▁begin|>/*
* @Author: LIU CHENG
* @Date: 2017-02-22 18:39:38
* @Last Modified by: LIU CHENG
* @Last Modified time: 2017-03-05 11:39:18
*/
import React, { PropTypes } from 'react';
import {
Text,
View,
Image,
TouchableHighlight,
ActivityIndicator,
StyleSh... | fontSize: 24,
color: 'white',
alignSelf: 'center'
}, |
<|file_name|>0004_accessionnumbercount.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('settings', '0003_delete_organizationsettings'),
]
operations ... | ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
('accession_number', models.IntegerField(default=0)),
], |
<|file_name|>tests.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
# Copyright (c) 2015 by Pablo Martín <goinnn@gmail.com>
#
# This software 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, eithe... | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Lesser General Public License for more details. |
<|file_name|>Gruntfile.js<|end_file_name|><|fim▁begin|>// Generated on 2015-05-19 using generator-angular-fullstack 2.0.13
'use strict';
module.exports = function (grunt) {
var localConfig;
try {
localConfig = require('./server/config/local.env');
} catch(e) {
localConfig = {};
}
// Load grunt tasks... |
// Copies remaining files to places other tasks can use
copy: { |
<|file_name|>test_utility.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
import unittest
from activity_feed import ActivityFeed
class UtilityTest(unittest.TestCase):
def test_key(self):
'should return the correct key for the non-aggregate feed'
a = ActivityFeed()
self.assertEqual... | feederboard_person = a.feederboard_for('person')
|
<|file_name|>test_to_from_refined.py<|end_file_name|><|fim▁begin|>import IMP
import IMP.test
import IMP.core
class Tests(IMP.test.TestCase):
"""Tests copying derivatives to and from refined"""
def _create_particle(self, m, ks):
p = IMP.Particle(m)
for k in ks:
p.add_attribute(k, ... | |
<|file_name|>wsgi.py<|end_file_name|><|fim▁begin|>"""
WSGI config for elmolino project.
<|fim▁hole|>https://docs.djangoproject.com/en/1.7/howto/deployment/wsgi/
"""
import os
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "elmolino.settings")
from django.core.wsgi import get_wsgi_application
application = get_wsgi_a... | It exposes the WSGI callable as a module-level variable named ``application``.
For more information on this file, see |
<|file_name|>getcover.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
from PyQt4.QtCore import Qt
from PyQt4 import QtCore, QtGui
class GetCoverTask(QtCore.QObject):
coverLoaded = QtCore.pyqtSignal(QtGui.QImage)
def __init__(self, coverPath):
super(GetCoverTask, self).__init__()
self... |
def run(self):
image = QtGui.QImage(self._coverPath)
image = image.scaled(120, 120, Qt.KeepAspectRatio, |
<|file_name|>OpenGLDemo.py<|end_file_name|><|fim▁begin|>"""OpenGLDemo.py -- A simple demo of using OpenGL with Cocoa
To build the demo program, run this line in Terminal.app:
$ python setup.py py2app -A
This creates a directory "dist" containing OpenGLDemo.app. (The
-A option causes the files to be symlinked to ... | NSOpenGLPFAAlphaSize, 8, |
<|file_name|>conftest.py<|end_file_name|><|fim▁begin|>import datetime
import pytest
from tests.test_utils import create_generic_job
from treeherder.model.models import Push
@pytest.fixture<|fim▁hole|> author='foo@bar.com',
time=datetime.datetime.now())
@pytest.fixture
def perf_job(perf_push, failur... | def perf_push(test_repository):
return Push.objects.create(
repository=test_repository,
revision='1234abcd', |
<|file_name|>tap.py<|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.
import os
from telemetry.page.actions import page_action
class TapAction(page_action.PageAction):
def _... | element: element,
left_position_percentage: %s,
top_position_percentage: %s,
duration_ms: %s, |
<|file_name|>CfgUnitInsignia.hpp<|end_file_name|><|fim▁begin|>class CfgUnitInsignia {<|fim▁hole|> displayName = "ACE3";
author = CSTRING(ACETeam);
texture = PATHTOF(data\Insignia_ace3logo_ca.paa);
textureVehicle = "";
};
class ACE_insignia_banana {
displayName = "ABE3";
... | class ACE_insignia_logo { |
<|file_name|>config_override.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python3
# -*- coding: utf-8 -*-
<|fim▁hole|>
configs = {
'db': {
'host': '127.0.0.1'
}
}<|fim▁end|> | __author__ = 'milletluo' |
<|file_name|>utils.py<|end_file_name|><|fim▁begin|># A Magento 2 module generator library
# Copyright (C) 2016 Maikel Martens
#
# This file is part of Mage2Gen.
#
# Mage2Gen 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... | return word[0].lower() + word[1:] |
<|file_name|>jquery.d.ts<|end_file_name|><|fim▁begin|>// Type definitions for jQuery 1.10.x / 2.0.x
// Project: http://jquery.com/
// Definitions by: Boris Yankov <https://github.com/borisyankov/>, Christian Hoffmeister <https://github.com/choffmeister>, Steve Fenton, Diullei Gomes <https://github.com/Diullei>, Tass Il... | error? (jqXHR: JQueryXHR, textStatus: string, errorThrow: string): any; |
<|file_name|>template.py<|end_file_name|><|fim▁begin|>import os
import re
from . import utils
PARTIAL = re.compile('(?P<tag>{{>\s*(?P<name>.+?)\s*}})')
PARTIAL_CUSTOM = re.compile('^(?P<whitespace>\s*)(?P<tag>{{>\s*(?P<name>.+?)\s*}}(?(1)\r?\n?))', re.M)
# def get_template(path, ext='html', partials=None):
# pa... |
def build(template, partials=None):
template = '{}\n'.format(template) |
<|file_name|>test_base_client.py<|end_file_name|><|fim▁begin|>import requests
import httpretty
from nose.tools import nottest
from pyrelic import BaseClient
@nottest # Skip until we can properly simulate timeouts
@httpretty.activate
def test_make_request_timeout():
"""
Remote calls should time out
"""
... |
# Then the Client should create the proxy config as a dictionary |
<|file_name|>androidpackageinstallationstep.cpp<|end_file_name|><|fim▁begin|>/**************************************************************************
**
** Copyright (C) 2015 BogDan Vatra <bog_dan_ro@yahoo.com>
** Contact: http://www.qt.io/licensing
**
** This file is part of Qt Creator.
**
** Commercial License Usa... | //
AndroidPackageInstallationStepWidget::AndroidPackageInstallationStepWidget(AndroidPackageInstallationStep *step) |
<|file_name|>export.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
#
# Copyright 2019 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/license... | ' do not work. This requires:\n\n'
' 1. Enable the Cloud Asset Inventory API on a project (https://console.cloud.google.com/apis/api/cloudasset.googleapis.com/overview)\n'
' 2. Create a service acocunt owned by this project\n'
' 3. Give the service account roles/cloudasset.viewer at t... |
<|file_name|>0002_catalogintegration_username.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
from django.db import migrations, models
<|fim▁hole|>class Migration(migrations.Migration):
dependencies = [
('catalog', '0001_initial'),
]
operations = [
migrations.AddField(
... | |
<|file_name|>autofix_source_only_abi_warnings.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python2.7
from __future__ import absolute_import, division, print_function, unicode_literals
import argparse
import os
import re
from collections import namedtuple
import buckutils as buck
import javautils as java
# Example:... | source_only_abi_deps.prepend(dep)
def do_remediations(message): |
<|file_name|>x86.rs<|end_file_name|><|fim▁begin|>// Copyright 2012-2015 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/licens... |
abi::OsLinux => {
"e-p:32:32-f64:32:64-i64:32:64-f80:32:32-n8:16:32".to_string() |
<|file_name|>facebook-post-weekly.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
import logging
from pdb import set_trace
import requests
import simplejson
from time import time
import os
import facebook
# MY_API_URL
# MY_SITE_MSG
# MY_GROUP_NAME
# POST_TO_ID = None
def run():
data = get_from_cal_json(... | msg = '\n'.join(msgbits)
|
<|file_name|>transforms.py<|end_file_name|><|fim▁begin|># Copyright 2020 The TensorFlow Authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-... | tf.stack([original_image_size[-1] // 2, original_image_size[-2] // 2]),
tf.float32)
else: |
<|file_name|>a.js<|end_file_name|><|fim▁begin|>var fs = require("fs");<|fim▁hole|>while(true){
fs.writeFileSync("1.txt", longStr);
}<|fim▁end|> | var longStr = (new Array(10000)).join("welefen"); |
<|file_name|>test_compiler.py<|end_file_name|><|fim▁begin|>#! coding:utf-8
"""
compiler tests.
These tests are among the very first that were written when SQLAlchemy
began in 2005. As a result the testing style here is very dense;
it's an ongoing job to break these into much smaller tests with correct pep8
styling a... | "? || 'hi'",
{'test': None}, [None],
{}, {'test': None}, [None]
), |
<|file_name|>urls.py<|end_file_name|><|fim▁begin|><|fim▁hole|>import views
urlpatterns = patterns('',
url(r'^$', views.TopicModelIndexView.as_view(), name='topics_models'),
url(r'^model/(?P<model_id>\d+)/$', views.TopicModelDetailView.as_view(), name='topics_model'),
url(r'^model/(?P<model_id>\d+)/topic/(?... | from django.conf.urls import patterns, include, url
|
<|file_name|>navigation.controller.js<|end_file_name|><|fim▁begin|>
/**
* @ngdoc controller
* @name NavigationController
* @function
*
* @description
* Handles the section area of the app
*
* @param {navigationService} navigationService A reference to the navigationService
*/
function NavigationC... | };
}
|
<|file_name|>wsgi.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-<|fim▁hole|>
"""This file should be used to run the flask app with something like Gunicorn.
For example: gunicorn -b 0.0.0.0:8000 ocspdash.web.wsgi:app
This file should NOT be imported anywhere, though, since it would instantiate the app.
"""
f... | |
<|file_name|>LoadoutEditBucket.tsx<|end_file_name|><|fim▁begin|>import { LoadoutParameters } from '@destinyitemmanager/dim-api-types';
import ClosableContainer from 'app/dim-ui/ClosableContainer';
import { t } from 'app/i18next-t';
import ConnectedInventoryItem from 'app/inventory/ConnectedInventoryItem';
import { D2Bu... | import LoadoutParametersDisplay from '../loadout-ui/LoadoutParametersDisplay'; |
<|file_name|>vis_sim.py<|end_file_name|><|fim▁begin|>from math import exp
import matplotlib
import matplotlib.pyplot as plt
from PIL import Image
import pickle
matplotlib.rcParams['ps.useafm'] = True
matplotlib.rcParams['pdf.use14corefonts'] = True
matplotlib.rcParams['text.usetex'] = True
def draw_map(img_dir):
... | (18.5, 4.5, 0.5), (3.0, 8.0, 0.7), (11.5, 8.5, 0.5),
(2.0, 6.0, 1.0), (11.0, 4.0, 1.0), (17.0, 4.0, 0.7), |
<|file_name|>sharded_lock.rs<|end_file_name|><|fim▁begin|>use std::cell::UnsafeCell;
use std::collections::HashMap;
use std::fmt;
use std::marker::PhantomData;
use std::mem;
use std::ops::{Deref, DerefMut};
use std::panic::{RefUnwindSafe, UnwindSafe};
use std::sync::{LockResult, PoisonError, TryLockError, TryLockResult... | // distribute shards among threads equally, thus reducing contention due to read-locking. |
<|file_name|>charakterform.cpp<|end_file_name|><|fim▁begin|>#include <QMessageBox>
#include "charakterform.h"
#include "fertigkeitform.h"
#include "ui_charakterform.h"
#include "ui_fertigkeitform.h"
CharakterForm::CharakterForm(QDialog *parent, std::shared_ptr<CharakterManager> charakterManager) :
QDialog(parent),... | CharakterForm::~CharakterForm(){
delete ui; |
<|file_name|>test_utils.cc<|end_file_name|><|fim▁begin|>// Copyright 2019 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/chromeos/local_search_service/test_utils.h"
#include "base/strings/strin... |
void FindAndCheck(Index* index,
std::string query, |
<|file_name|>any.js<|end_file_name|><|fim▁begin|>var assert = require('assert');
var listXf = require('./helpers/listXf');
var R = require('..');
describe('any', function() {
var odd = function(n) {return n % 2 === 1;};
var T = function() {return true;};
var intoArray = R.into([]);
it('returns true ... | assert.deepEqual(intoArray(R.any(T), []), [false]);
});
|
<|file_name|>family.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
#
# (C) Pywikipedia bot team, 2004-2013
#
# Distributed under the terms of the MIT license.
#
__version__ = '$Id: 255cc3dc08b2410093f318dc48471c6f3ff691e5 $'
import re
import urllib
from datetime import timedelta, datetime
import config
imp... | 'fo': u'Mynd',
'fr': u'Fichier',
'frp': [u'Fichiér', u'Émâge'],
'frr': [u'Datei', u'Bild'], |
<|file_name|>issue-3008-1.rs<|end_file_name|><|fim▁begin|>// Copyright 2014 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution and at
// http://rust-lang.org/COPYRIGHT.
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/li... | }
fn main() {
} |
<|file_name|>composite.rs<|end_file_name|><|fim▁begin|>#[macro_export]
macro_rules! composite {
( $( $arg:expr ),+ ) => {
{
use $crate::component::{Component, SubComponent};
use $crate::Error;<|fim▁hole|> struct CompositeComponent {
components: Vec<SubCompo... | use ::futures::{Poll, Async};
|
<|file_name|>zh_CN.js<|end_file_name|><|fim▁begin|>module.exports = require('../lib/')
.extend('faker', function() {
try {
return require('faker/locale/zh_CN');
} catch (e) {
return null;
<|fim▁hole|> });<|fim▁end|> | }
|
<|file_name|>tutorial.js<|end_file_name|><|fim▁begin|>import { bindActionCreators } from 'redux';
import { connect } from 'react-redux';
import TutorialScreen from '../components/tutorialScreen';
import {
toggleAutoplay,
} from '../actions/audio';
import {
tutorialPageDidChange,
hideTutorial,
} from '../action... | |
<|file_name|>helloworld.py<|end_file_name|><|fim▁begin|>"""
helloworld.py
Author: Nils Kingston
Credit: none
Assignment:
Write and submit a Python program that prints the following:
<|fim▁hole|><|fim▁end|> | Hello, world!
"""
print("Hello, world!") |
<|file_name|>navigation_store.js<|end_file_name|><|fim▁begin|>window.NavigationStore = function() {
function isSet(menu) {
return localStorage["navigation_" + menu] !== undefined;
}
function fetch(menu) {
return localStorage["navigation_" + menu] == "true" || false;
}
function set(menu, value) {
... | fetch: fetch, |
<|file_name|>free.rs<|end_file_name|><|fim▁begin|>//! Free functions that create iterator adaptors or call iterator methods.
//!
//! The benefit of free functions is that they accept any `IntoIterator` as
//! argument, so the resulting code may be easier to read.
use std::fmt::Display;
use std::iter::{self, Zip};
use ... | /// |
<|file_name|>base.py<|end_file_name|><|fim▁begin|>"""
File: base.py
Author: Me
Email: yourname@email.com
Github: https://github.com/yourname
Description:
"""
from datetime import timedelta
<|fim▁hole|>from django.urls import reverse
from django.utils import timezone
from django.utils.crypto import get_random_string
f... | from django.contrib.auth.models import User
from django.test import TestCase |
<|file_name|>lib.rs<|end_file_name|><|fim▁begin|>/*!
# D3D12 backend internals.
## Resource transitions
Vulkan semantics for resource states doesn't exactly match D3D12.
For regular images, whenever there is a specific layout used,
we map it to a corresponding D3D12 resource state.
For the swapchain images, we cons... | fn image_format_properties(
&self, |
<|file_name|>landing-page-routing.module.ts<|end_file_name|><|fim▁begin|>import { NgModule } from '@angular/core';<|fim▁hole|>
const routes: Routes = [
{ path: '', component: LandingPageComponent }
];
@NgModule({
imports: [RouterModule.forChild(routes)],
exports: [RouterModule]
})
export class LandingPageRouting... | import { RouterModule, Routes } from '@angular/router';
import { LandingPageComponent } from './landing-page.component'; |
<|file_name|>fontforge.js<|end_file_name|><|fim▁begin|>/**
* grunt-webfont: fontforge engine
*
* @requires fontforge, ttfautohint 1.00+ (optional), eotlitetool.py
* @author Artem Sapegin (http://sapegin.me)
*/
module.exports = function(o, allDone) {
'use strict';
var fs = require('fs');
var path = require('pa... | // or in verbose mode.
var success = !!generatedFontFiles();
var notError = /(Copyright|License |with many parts BSD |Executable based on sources from|Library based on sources from|Based on source from git)/; |
<|file_name|>GraphConflictResolver.java<|end_file_name|><|fim▁begin|>package org.apache.maven.repository.metadata;
/*
* Licensed to the Apache Software Foundation (ASF) under one<|fim▁hole|> * regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License")... | * or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information |
<|file_name|>tt_min.py<|end_file_name|><|fim▁begin|>"""This module contains a prototype implementation of the
TT-cross-based minimization procedure
"""
import numpy as np
import math
import tt
from ..maxvol import maxvol
from ..utils.rect_maxvol import rect_maxvol
def reshape(a, sz):
return np.reshape(a, sz, orde... | cr1 = reshape(cr1, (ry[i] * n[i], ry[i + 1]))
q, r = np.linalg.qr(cr1)
ind = maxvol(q) |
<|file_name|>aws_endpoint_resolver_test.go<|end_file_name|><|fim▁begin|>// Copyright 2017 uSwitch
//
// 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/... |
resolved, err := resolver.EndpointFor(endpoints.StsServiceID, "")
if err != nil { |
<|file_name|>run_tests.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Script to run the tests."""
from __future__ import print_function
import sys
import unittest
# Change PYTHONPATH to include dependencies.
sys.path.insert(0, '.')
import utils.dependencies # pylint: disable=wrong... | |
<|file_name|>mtUnitTests.py<|end_file_name|><|fim▁begin|>#import unittest
import mt
import queue
import _thread
import time
class DummySocket:
def __init__(self, ID):
self.id = ID
self.lastMsg = ""
def send(self, msg):
print(self.id+":",msg)
self.lastMsg = msg
def close(se... | ## |
<|file_name|>build.js<|end_file_name|><|fim▁begin|>#!/usr/bin/env node
/* Passphrases | https://github.com/micahflee/passphrases
Copyright (C) 2015 Micah Lee <micah@micahflee.com>
Permission is hereby granted, free of charge, to any person obtaining a
copy of this software and associated documentation files ... | nw.build().then(function () { |
<|file_name|>_6_1_coordinate_systems.rs<|end_file_name|><|fim▁begin|>#![allow(non_upper_case_globals)]
extern crate glfw;
use self::glfw::{Context, Key, Action};
extern crate gl;
use self::gl::types::*;
use std::sync::mpsc::Receiver;
use std::ptr;
use std::mem;
use std::os::raw::c_void;
use std::path::Path;
use std::... | |
<|file_name|>FunctionWithSameNameAlreadyExistsException.java<|end_file_name|><|fim▁begin|>package commenttemplate.expressions.exceptions;
/**
*<|fim▁hole|>
/**
* Justa a custom mensage.
*
* @param msg A custom mensage.
*/
public FunctionWithSameNameAlreadyExistsException(String msg) {
super(msg);
}
}<|... | * @author thiago
*/
// @TODO: RuntimeException?
public class FunctionWithSameNameAlreadyExistsException extends RuntimeException { |
<|file_name|>floatf.rs<|end_file_name|><|fim▁begin|>//! formatter for %f %F common-notation floating-point subs
use super::super::format_field::FormatField;
use super::super::formatter::{FormatPrimitive, Formatter, InPrefix};
use super::float_common::{get_primitive_dec, primitive_to_str_common, FloatAnalysis};
pub str... | inprefix: &InPrefix,
str_in: &str,
) -> Option<FormatPrimitive> { |
<|file_name|>track-ui.js<|end_file_name|><|fim▁begin|>(function($){
if(webshims.support.texttrackapi && document.addEventListener){
var trackOptions = webshims.cfg.track;
var trackListener = function(e){
$(e.target).filter('track').each(changeApi);
};
var trackBugs = webshims.bugs.track;
var changeApi = f... | |
<|file_name|>MediaStreamStats2.java<|end_file_name|><|fim▁begin|>/*
* Copyright @ 2015 Atlassian Pty Ltd
*
* 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/l... | /**
* @return all per-SSRC statistics for the send direction. |
<|file_name|>ebook.py<|end_file_name|><|fim▁begin|>from struct import unpack, pack, calcsize
from mobi_languages import LANGUAGES
from lz77 import uncompress
def LOG(*args):
pass
MOBI_HDR_FIELDS = (
("id", 16, "4s"),
("header_len", 20, "I"),
("mobi_type", 24, "I"),
("encoding", 28, "I"),
("UID... | ("unknown@188", 188, "I"),
("unknown@192", 192, "H"),
("last_image_record", 194, "H"), |
<|file_name|>EmailDef.java<|end_file_name|><|fim▁begin|>/*
* JBoss, Home of Professional Open Source
* Copyright 2010, Red Hat, Inc. and/or its affiliates, and individual contributors
* by the @authors tag. See the copyright.txt in the distribution for a
* full listing of individual contributors.
*
* Licensed und... |
import javax.validation.constraints.Pattern; |
<|file_name|>PasswordInput.tsx<|end_file_name|><|fim▁begin|>import * as React from 'react';
interface Props {
name: string;
label: string;
onChange: (e: React.ChangeEvent<HTMLInputElement>) => void;
onKeyUp: (e: React.KeyboardEvent<HTMLInputElement>) => void;
placeholder?: string;
maxLength?: n... | value?: string;
error?: string;
}
|
<|file_name|>exhaustive_unique_vecs_fixed_length.rs<|end_file_name|><|fim▁begin|>use itertools::Itertools;
use malachite_base::bools::exhaustive::exhaustive_bools;
use malachite_base::chars::exhaustive::exhaustive_ascii_chars;
use malachite_base::nevers::nevers;
use malachite_base::num::exhaustive::exhaustive_unsigneds... | {
let xss = exhaustive_unique_vecs_fixed_length(len, xs);
let xss_prefix = xss.clone().take(20).collect_vec(); |
<|file_name|>current-profile-page.component.ts<|end_file_name|><|fim▁begin|>// Copyright 2020 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/licen... | }
|
<|file_name|>generic-object.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/... | fn get(&self) -> T;
}
|
<|file_name|>lang.js<|end_file_name|><|fim▁begin|>/*
* Copyright (C) 2016-2021 phantombot.github.io/PhantomBot
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the Lice... | function load(force) { |
<|file_name|>ftscroller.js<|end_file_name|><|fim▁begin|>/**
* FTScroller: touch and mouse-based scrolling for DOM elements larger than their containers.
*
* While this is a rewrite, it is heavily inspired by two projects:
* 1) Uxebu TouchScroll (https://github.com/davidaurelio/TouchScroll), BSD licensed:
* Copy... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.