prompt large_stringlengths 70 991k | completion large_stringlengths 0 1.02k |
|---|---|
<|file_name|>wish.py<|end_file_name|><|fim▁begin|>#
# My wish for Pynamite
#
from __future__ import with_statement
from pynamite import *
from pynamite.actor import TextBox
def scene1():
# define some actors
x = TextBox("Pynamite")
y = TextBox("Rocks!!!")
# tell the first actor to enter
enter(x)... | |
<|file_name|>models.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
#########################################################################
#
# Copyright (C) 2012 OpenPlans
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as publis... |
# statistical derivations
count = models.IntegerField(_('count'), help_text=_('count value for this field'), default=1) |
<|file_name|>MessagesComp.tsx<|end_file_name|><|fim▁begin|>import React from 'react'
import { CLOSE_CHARACTER } from '../model/constants'<|fim▁hole|>
export interface MessagesCompProps {
_messages: readonly string[]
_removeMessageByIndex: (index: number) => void
}
export function MessagesComp({
_messages,
_removeM... | import styles from './MessagesComp.module.css' |
<|file_name|>form.ts<|end_file_name|><|fim▁begin|>export type FormItem = {
label?: string;
type: 'string';
default: string | null;
hidden?: boolean;
multiline?: boolean;
} | {
label?: string;
type: 'number';
default: number | null;
hidden?: boolean;
step?: number;
} | {
label?: string;
type: 'boolean';
def... | label?: string;
type: 'array'; |
<|file_name|>lib.rs<|end_file_name|><|fim▁begin|>pub mod vm;<|fim▁hole|>pub mod program;<|fim▁end|> | pub mod command;
pub mod parse; |
<|file_name|>build.py<|end_file_name|><|fim▁begin|>import os.path
from askapdev.rbuild.builders import CMake as Builder
import askapdev.rbuild.utils as utils
# CMake doesn't know about ROOT_DIR for blas and lapack, so need to
# explicitly name them. Want to use the dynamic libraries in order
# to avoid link problem... | # these work
builder.add_option("-DCFITSIO_ROOT_DIR=%s" % cfitsio) |
<|file_name|>RxBus.java<|end_file_name|><|fim▁begin|><|fim▁hole|>import java.util.HashMap;
import java.util.HashSet;
import java.util.Map;
import android.support.annotation.NonNull;
import android.support.annotation.VisibleForTesting;
import android.support.v4.util.Pair;
import rx.Subscriber;
import rx.Subscription;
... | package com.github.ayltai.foscam.client;
|
<|file_name|>registry_test.go<|end_file_name|><|fim▁begin|>package registry
import (
"fmt"
"net/http"
"net/http/httputil"
"net/url"
"strings"
"testing"
"github.com/docker/distribution/registry/client/transport"
"github.com/docker/docker/reference"
"github.com/docker/engine-api/types"
registrytypes "github.c... | |
<|file_name|>math27.py<|end_file_name|><|fim▁begin|>from sys import argv
<|fim▁hole|><|fim▁end|> | | |
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python3
"""tbar - Terminal Bar
Number to bar in terminal.
"""
__version__ = "0.1"
import sys
from tbar.tbar import TBar
from tbar.reader import Reader
def main(infile, comment, sep, field, regexp,
max, length, vertical):
infile = in... | regexp=regexp)
b = TBar(_max=max, length=length, vertical=vertical) |
<|file_name|>suggestion.py<|end_file_name|><|fim▁begin|># coding: utf-8
#
# 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
#
# htt... | ' separated by \'.\'')
if suggestion_id.split('.')[0] != 'exploration':
raise self.InvalidInputException('This handler allows actions only' |
<|file_name|>bitcoin_tr.ts<|end_file_name|><|fim▁begin|><?xml version="1.0" ?><!DOCTYPE TS><TS language="tr" version="2.0">
<defaultcodec>UTF-8</defaultcodec>
<context>
<name>AboutDialog</name>
<message>
<location filename="../forms/aboutdialog.ui" line="+14"/>
<source>About Litecoin</source>
... | <translation>Girilen parolalar birbirleriyle uyumlu değil.</translation>
</message> |
<|file_name|>conf.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
#
# example_project documentation build configuration file, created by
# sphinx-quickstart on Wed Aug 19 10:27:46 2009.
#
# This file is execfile()d with the current directory set to its containing dir.
#
# Note that not all possible configuratio... |
# A shorter title for the navigation bar. Default is the same as html_title.
#html_short_title = None |
<|file_name|>test_tabs.py<|end_file_name|><|fim▁begin|>"""
Test cases for tabs.
"""
from mock import MagicMock, Mock, patch
from courseware.courses import get_course_by_id
from courseware.views import get_static_tab_contents
from django.test.utils import override_settings
from django.core.urlresolvers import reverse
... | mock_module_render.return_value = MagicMock(
render=Mock(side_effect=Exception('Render failed!')) |
<|file_name|>playback.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
#<|fim▁hole|># Copyright 2011 Liftoff Software Corporation
#
__doc__ = """\
playback.py - A plugin for Gate One that adds support for saving and playing
back session recordings.
.. note:: Yes this only contains one function and it is ... | |
<|file_name|>BreathFirstSearch.java<|end_file_name|><|fim▁begin|>package com.albion.common.graph.algorithms;
import com.albion.common.graph.core.v1.Edge;
import com.albion.common.graph.core.v1.Graph;
import com.albion.common.graph.core.v1.Vertex;
import java.util.ArrayList;
import java.util.List;
public class Breath... | return v;
}
|
<|file_name|>serverchart.js<|end_file_name|><|fim▁begin|>// Copyright 2007 The Closure Library 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
//
// htt... | 'img', {'src': this.getUri(),
'class': goog.getCssName('goog-serverchart-image'), |
<|file_name|>notifier.py<|end_file_name|><|fim▁begin|># ----------------------------------------------------------------------
# Copyright (c) 2014 Rafael Gonzalez.
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
# "Software"), ... | def run(self, *args):
'''Launch a script, depending on the launch mode'''
# Skip if no script is configured
if not self.path: |
<|file_name|>vocab_utils.py<|end_file_name|><|fim▁begin|># Copyright 2017 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licens... | if emb_size != len(vec):
utils.print_out(
"Ignoring %s since embeding size is inconsistent." % word)
del emb_dict[word] |
<|file_name|>joint.shapes.fsa.js<|end_file_name|><|fim▁begin|>/*! JointJS v3.4.1 (2021-08-18) - JavaScript diagramming library
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/... | r: 10,
fill: '#ffffff', |
<|file_name|>imagebackend.py<|end_file_name|><|fim▁begin|># Copyright 2012 Grid Dynamics
# 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... | if generated and size:
lvm.create_volume(self.vg, self.lv, |
<|file_name|>CustomTypeFaceSpan.java<|end_file_name|><|fim▁begin|>package fyp.hkust.facet.util;
/**
* Created by ClementNg on 2/4/2017.
*/
import android.graphics.Paint;
import android.graphics.Typeface;<|fim▁hole|>
private final Typeface newType;
public CustomTypeFaceSpan(String family, Typeface type) {
... | import android.text.TextPaint;
import android.text.style.TypefaceSpan;
public class CustomTypeFaceSpan extends TypefaceSpan { |
<|file_name|>drag_drop_tracker_unittest.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 "ash/drag_drop/drag_drop_tracker.h"
#include "ash/shell.h"
#include ... | |
<|file_name|>0013_auto_20160223_1757.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 = [
('main', '0012_auto_20160204_1503'),<|fim▁hole|> ]
operations = [
... | |
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
from operator import attrgetter
from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType
from pyangbind.lib.yangtypes import RestrictedClassType
from pyangbind.lib.yangtypes import TypedListType
from pyangbind.lib.yangtypes import Y... | return self.__shutdown_threshold_pct
def _set_shutdown_threshold_pct(self, v, load=False):
""" |
<|file_name|>regions-outlives-projection-container-wc.rs<|end_file_name|><|fim▁begin|>// Copyright 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... | // Test that we are imposing the requirement that every associated |
<|file_name|>use.rs<|end_file_name|><|fim▁begin|>// ignore-fast
// Copyright 2012-2014 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution and at
// http://rust-lang.org/COPYRIGHT.
//<|fim▁hole|>// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// h... | |
<|file_name|>step4.py<|end_file_name|><|fim▁begin|># 14.
print_log('\n14. Issuer (Trust Anchor) is creating a Credential Offer for Prover\n')
cred_offer_json = await anoncreds.issuer_create_credential_offer(issuer_wallet_handle,
cr... | |
<|file_name|>configure.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
#
# Copyright 2001 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:/... |
# Implement just enough of Ninja variable expansion etc. to
# make the bootstrap build work. |
<|file_name|>common.go<|end_file_name|><|fim▁begin|>package service
import (
"encoding/json"
"log"
"net/http"
)
// StandardErrorRespModel ...
type StandardErrorRespModel struct {
ErrorMessage string `json:"error"`
}
// -----------------
// --- Generic ---
// RespondWith ...
func RespondWith(w http.ResponseWrite... | } |
<|file_name|>error.rs<|end_file_name|><|fim▁begin|>use std;
use std::fmt;
use std::fmt::Display;
use std::io;
use std::num;
use std::string;
use serde::{de, ser};
/// Alias for a `Result` with the error type [`serde_osc::error::Error`].
///
/// [`serde_osc::error::Error`]: enum.Error.html
pub type ResultE<T> = Result<... | /// Technically, this is safe, but if we received non-ascii data, we could have invalid UTF-8
StrParseError(string::FromUtf8Error), |
<|file_name|>detector.py<|end_file_name|><|fim▁begin|>""" Protocol Buffer Breaking Change Detector
This tool is used to detect "breaking changes" in protobuf files, to
ensure proper backwards-compatibility in protobuf API updates. The tool
can check for breaking changes of a single API by taking 2 .proto file
paths as... | if final_code != 0: |
<|file_name|>build.rs<|end_file_name|><|fim▁begin|>//#![feature(plugin)]
//#![plugin(bindgen_plugin)]
//#[allow(dead_code, uppercase_variables, non_camel_case_types)]
//#[plugin(bindgen_plugin)]
//mod mysql_bindings {
// bindgen!("/usr/include/mysql/mysql.h", match="mysql.h", link="mysql");
//}
//use std::en... | fn main() {
let _ = libbindgen::builder() |
<|file_name|>test_custom_lists.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python
from gi.repository import Gtk, GObject
import time
import unittest
from testutils import setup_test_env
setup_test_env()
from softwarecenter.enums import XapianValues, ActionButtons
TIMEOUT=300
class TestCustomLists(unittest.TestCase)... | |
<|file_name|>bench.rs<|end_file_name|><|fim▁begin|>#![feature(test)]
extern crate fdlimit;
extern crate test;
extern crate tiny_http;
use std::io::Write;
use std::process::Command;
use tiny_http::Method;
#[test]
#[ignore]
// TODO: obtain time
fn curl_bench() {
let server = tiny_http::Server::http("0.0.0.0:0").un... |
loop {
let request = match server.try_recv().unwrap() {
None => break, |
<|file_name|>OmemoManager.java<|end_file_name|><|fim▁begin|>/**
*
* Copyright 2017 Paul Schaub, 2020 Florian Schmaus
*
* 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... | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and |
<|file_name|>PhysicalTopology.java<|end_file_name|><|fim▁begin|>/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package ons;
import ons.util.WeightedGraph;
import org.w3c.dom.*;
/**
* The physical topology of a network refers to he physical layout of devices on
*... | */
public int getNumLinks() { |
<|file_name|>setuphandlers.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
import logging
# define here the methods needed to be run at install time
<|fim▁hole|> return
logger = logging.getLogger('sc.blueprints.soundcloud')
# add here your custom methods that need to be run when
# sc.blue... | def importVarious(context):
if context.readDataFile('sc.blueprints.soundcloud_various.txt') is None: |
<|file_name|>test_signout.py<|end_file_name|><|fim▁begin|>import mock
from django.test import TestCase
from mediaviewer.views.signout import signout
class TestSignout(TestCase):
def setUp(self):
self.logout_patcher = mock.patch('mediaviewer.views.signout.logout')
self.mock_logout = self.logout_p... | |
<|file_name|>urls.py<|end_file_name|><|fim▁begin|>from django.conf.urls import patterns, url
from polls import views
urlpatterns = patterns('',
url(r'^$', views.IndexView.as_view(), name='index'),
url(r'^(?P<pk>\d+)/$', views.DetailView.as_view(), name='detail'),
url(r'^(?P<pk>\d+)/results/$', views.Resul... | |
<|file_name|>pointer_constants.rs<|end_file_name|><|fim▁begin|>// Copyright (c) 2017 Sandstorm Development Group, Inc. and contributors
//
// 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 w... |
pub struct WordArrayDeclarationOptions {
pub public: bool,
pub omit_first_word: bool, |
<|file_name|>default.js<|end_file_name|><|fim▁begin|>UPTODATE('1 day');
var common = {};
// Online statistics for visitors
(function() {
if (navigator.onLine != null && !navigator.onLine)
return;
var options = {};
options.type = 'GET';
options.headers = { 'x-ping': location.pathname, 'x-cookies': navigator.co... | |
<|file_name|>section.component.ts<|end_file_name|><|fim▁begin|>/**
* @license
* Copyright 2018 JBoss 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... | component.highlight();
} |
<|file_name|>reply.go<|end_file_name|><|fim▁begin|>package model
//EmptyReply .
type EmptyReply struct {<|fim▁hole|>
//WarmUpReply .
type WarmUpReply struct {
LastID int `json:"last_id"`
}<|fim▁end|> | } |
<|file_name|>event_helper.go<|end_file_name|><|fim▁begin|>//************************************************************************//
// API "congo": Model Helpers
//
// Generated with goagen v0.0.1, command line:
// $ goagen
// --out=$(GOPATH)/src/github.com/gopheracademy/congo<|fim▁hole|>//**************************... | // --design=github.com/gopheracademy/congo/design
//
// The content of this file is auto-generated, DO NOT MODIFY |
<|file_name|>prompts.rs<|end_file_name|><|fim▁begin|>/// Functionality for prompting the user to make a choice or type some text.
use std::io::{self, Write};
use std::cmp;
use std::num;
use rand::{self, Rng};
use std::fmt;
use std::error;
use std::rc::Rc;
use std::cell::RefCell;
/// Possible errors when prompting.
#[... | }
name_input.unwrap()
} |
<|file_name|>context_plan_test.go<|end_file_name|><|fim▁begin|>package terraform
import (
"bytes"
"fmt"
"os"
"reflect"
"sort"
"strings"
"sync"
"testing"
)
func TestContext2Plan_basic(t *testing.T) {
m := testModule(t, "plan-good")
p := testProvider("aws")
p.DiffFn = testDiffFn
ctx := testContext2(t, &Cont... | m := testModule(t, "plan-orphan") |
<|file_name|>api.go<|end_file_name|><|fim▁begin|>// Copyright 2015 The Gogs Authors. All rights reserved.
// Use of this source code is governed by a MIT-style
// license that can be found in the LICENSE file.
// Package v1 Gitea API.
//
// This documentation describes the Gitea API.
//
// Schemes: http, https
// ... | m.Get("", user.IsStarring) |
<|file_name|>yaml.py<|end_file_name|><|fim▁begin|># Copyright 2012 Hewlett-Packard Development Company, L.P.
#
# 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... | return
name = match.group(1) |
<|file_name|>test_io.py<|end_file_name|><|fim▁begin|>"""Unit tests for the io module."""
# Tests of io are scattered over the test suite:
# * test_bufio - tests file buffering
# * test_memoryio - tests BytesIO and StringIO
# * test_fileio - tests FileIO
# * test_file - tests the file interface
# * test_io - tests ever... | |
<|file_name|>config.py<|end_file_name|><|fim▁begin|><|fim▁hole|><|fim▁end|> | global mods
mods = [] |
<|file_name|>TPlane.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
# This simple example shows how to do basic texture mapping.
import vtk
from vtk.util.misc import vtkGetDataRoot
VTK_DATA_ROOT = vtkGetDataRoot()
# Load in the texture map. A texture is any unsigned char image. If it
# is not of this type, you... | renWin.AddRenderer(ren) |
<|file_name|>index.d.ts<|end_file_name|><|fim▁begin|>// Type definitions for Numeral.js
// Project: https://github.com/adamwdraper/Numeral-js
// Definitions by: Vincent Bortone <https://github.com/vbortone>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// http://numeraljs.com/#locales
interface N... | interface NumeralJsFormat {
regexps: { |
<|file_name|>unique-deref.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/li... | |
<|file_name|>content.py<|end_file_name|><|fim▁begin|>from gettext import gettext as _
from pulp.client.commands import options
from pulp.client.commands.criteria import DisplayUnitAssociationsCommand
from pulp.client.commands.unit import UnitCopyCommand, UnitRemoveCommand
from pulp_docker.common import constants
DE... | """
Print a list of all the tags matching the search parameters.
|
<|file_name|>zyx.py<|end_file_name|><|fim▁begin|>"""
/******************************************************************************
This source file is part of the Avogadro project.
Copyright 2013 Kitware, Inc.
This source code is released under the New BSD License, (the "License").
Unless required by appl... | limitations under the License.
******************************************************************************/ |
<|file_name|>olLayerScripts.py<|end_file_name|><|fim▁begin|>import re
import traceback
import os
import codecs
from urlparse import parse_qs
from PyQt4.QtCore import QCoreApplication
from qgis.core import (QgsRenderContext,
QgsSingleSymbolRendererV2,
QgsCategorizedSymbolRe... | params: {
"LAYERS": "%(layers)s",
"TILED": "true",
"VERSION": "%(version)s"}, |
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|><|fim▁hole|># it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WIT... | #
# Copyright 2017 Red Hat, Inc.
#
# This program is free software; you can redistribute it and/or modify |
<|file_name|>sound_alsa.cpp<|end_file_name|><|fim▁begin|>/*
===========================================================================
Doom 3 GPL Source Code
Copyright (C) 1999-2011 id Software LLC, a ZeniMax Media company.
This file is part of the Doom 3 GPL Source Code (?Doom 3 Source Code?).
Doom 3 Source Code i... | #ifdef _DEBUG |
<|file_name|>svhn.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
import os
from fuel import config
from fuel.datasets import H5PYDataset
from fuel.transformers.defaults import uint8_pixels_to_floatX
class SVHN(H5PYDataset):
"""The Street View House Numbers (SVHN) dataset.
SVHN [SVHN] is a real-worl... | digits), but incorporates an order of magnitude more labeled data
(over 600,000 digit images) and comes from a significantly harder, |
<|file_name|>projects_tags.py<|end_file_name|><|fim▁begin|><|fim▁hole|>from django.core.urlresolvers import reverse
from projects.models import ProjectBuild
register = Library()
@register.simple_tag()
def build_url(build_id):
"""
Fetches the ProjectBuild for a given build_id, if any.
"""
try:
... | from django.template.base import Library |
<|file_name|>exit-normally.tsx<|end_file_name|><|fim▁begin|>import React from 'react';<|fim▁hole|><|fim▁end|> | import {Text, render} from '../..';
const {waitUntilExit} = render(<Text>Hello World</Text>);
waitUntilExit().then(() => console.log('exited')); |
<|file_name|>pyrits.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright 2011, De Verkeersonderneming <rits@verkeersonderneming.nl>
#
# This file is part of PyRITS - A tool for processing and analyzing transport
# management system data.
#
# PyRITS is free software: you can re... | help="Specify output format for the report. Possibe values: xml, csv-tasks, csv-stats, routes. Default is xml.",
metavar="TYPE", |
<|file_name|>constructorReturnsInvalidType.js<|end_file_name|><|fim▁begin|>//// [constructorReturnsInvalidType.ts]
class X {
constructor() {
return 1;
}
foo() { }
}
var x = new X();
//// [constructorReturnsInvalidType.js]
var X = (function () {
function X() {
return 1;
}
... | |
<|file_name|>Demo1.java<|end_file_name|><|fim▁begin|>package com.asksunny.batch.tasklets;
public class Demo1 {
long id;
String name;
public Demo1() {
}
public long getId() {
return id;
}
public void setId(long id) {
this.id = id;
}
public String getName() {
return name;
}
... | public void setName(String name) {
this.name = name;
}
|
<|file_name|>DNAFlatBuilding.py<|end_file_name|><|fim▁begin|>from panda3d.core import NodePath, DecalEffect
import DNANode
import DNAWall
import random
class DNAFlatBuilding(DNANode.DNANode):
COMPONENT_CODE = 9
currentWallHeight = 0
def __init__(self, name):
DNANode.DNANode.__init__(self, name)
... | def getWidth(self):
return self.width
|
<|file_name|>table_core.js<|end_file_name|><|fim▁begin|>/*
* mobile table unit tests
*/<|fim▁hole|>(function($){
module( "Basic Table", {
setup: function(){
var hash = "#basic-table-test";
if( location.hash != hash ){
stop();
$(document).one("pagechange", function() {
start();
});
$.m... | |
<|file_name|>testbinding.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/. */
// check-tidy: no specs after this line
use dom::binding... | fn GetInterfaceAttributeNullable(&self) -> Option<Root<Blob>> { |
<|file_name|>kblink.directive.js<|end_file_name|><|fim▁begin|>(function() {
'use strict';
angular.module('facetApp')
.directive('kblink', function() {
return {
restrict: 'EC',
scope: { href: '@' },
transclude: true,
controller: ['$scope', 'popoverService', function($scope, popoverService){
... | data.lifespan = data.lifespan.replace(/(\D)0/g, "$1"); |
<|file_name|>admin.py<|end_file_name|><|fim▁begin|>from django.contrib import admin
from .models import CustomUser, Equipment, Search, TagManagement<|fim▁hole|>
admin.site.register(CustomUser)
admin.site.register(Equipment)
admin.site.register(Search)
admin.site.register(Reserved)
admin.site.register(Request)
admin.sit... | from .models import Reserved, Request, Vote, Log, Tag |
<|file_name|>aname2lname.rs<|end_file_name|><|fim▁begin|>extern crate krb5;
fn main() {
let ctx = match krb5::Context::new() {
Ok(ctx) => ctx,
Err(e) => panic!("Failure: {}", e)
};
println!("Success, got context: {:?}", ctx);<|fim▁hole|> Err(e) => panic!("Failure: {}", e),
};
... |
let lname = match ctx.localname("user@EXAMPLE.COM") {
Ok(lname) => lname, |
<|file_name|>mod.rs<|end_file_name|><|fim▁begin|>//! Runners are responsible for executing a test suite's examples.
mod configuration;
mod observer;
pub use runner::configuration::*;
pub use runner::observer::*;
use std::borrow::Borrow;
use std::cell::Cell;
use std::ops::{Deref, DerefMut};
use std::panic;
#[cfg(not(... | |
<|file_name|>classifier.py<|end_file_name|><|fim▁begin|>import logging
import os
import cv2
import numpy as np
import pickle
from skimage.feature import hog
from sklearn.model_selection import train_test_split
from sklearn.preprocessing import StandardScaler
from sklearn.svm import LinearSVC
logging.basicConfig(forma... | |
<|file_name|>getVariablesHandler.ts<|end_file_name|><|fim▁begin|>import helper from '../../helper';
import GetVariablesHandler from '../getVariablesHandler';
import Registry from '../../../registry';
/** Handler that takes care of getting all the variables for protractor. */
class ProtractorGetVariablesHandler extends... | /** @inheritDoc */
getVariables(registry: Registry, ngApimockId?: string): {} { |
<|file_name|>params.go<|end_file_name|><|fim▁begin|>package dvb
// Device delivery sytem
type DeliverySystem uint32
const (
SysUndefined DeliverySystem = iota
SysDVBCAnnexA
SysDVBCAnnexB
SysDVBT
SysDSS
SysDVBS
SysDVBS2
SysDVBH
SysISDBT
SysISDBS
SysISDBC
SysATSC
SysATSCMH
SysDMBTH
SysCMMB
SysDAB
SysDV... | |
<|file_name|>exp-ae-celeba-mafl-30.py<|end_file_name|><|fim▁begin|>import tensorflow as tf
import os
import sys
from copy import copy
from model.pipeline import Pipeline
from tensorflow.python import debug as tf_debug
if __name__ == "__main__":<|fim▁hole|>
num_keypoints = 30
patch_feature_dim = 8
decodin... | |
<|file_name|>th.js<|end_file_name|><|fim▁begin|>// Node
if (typeof module !== 'undefined' && module.exports) {
var numeral = require('../../numeral');
var expect = require('chai').expect;
var language = require('../../languages/th');
}
describe('Language: th', function() {
before(function() {
... | }
}); |
<|file_name|>_config.js<|end_file_name|><|fim▁begin|>export default {
props: {
things: [
{ id: 1, name: 'a' },
{ id: 2, name: 'b' },
{ id: 3, name: 'c' },
{ id: 4, name: 'd' },
{ id: 5, name: 'e' }
]
},
html: `
<div>a</div>
<div>b</div>
<div>c</div>
<div>d</div>
<div>e</div>
`,
test(... | });
component.things = [ |
<|file_name|>vaapi_picture_native_pixmap_angle.cc<|end_file_name|><|fim▁begin|>// Copyright 2020 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/gpu/vaapi/vaapi_picture_native_pixmap_angle.h"
#include "m... |
DCHECK(texture_id_); |
<|file_name|>log_sink_test.go<|end_file_name|><|fim▁begin|>// Copyright 2015 Google Inc. All Rights Reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.o... | assert.True(t, strings.Contains(log, "disk")) |
<|file_name|>jquery.js<|end_file_name|><|fim▁begin|>$(function() {
$('img[data-hover]').hover(function() {
$(this).attr('tmp', $(this).attr('src')).attr('src', $(this).attr('data-hover')).attr('data-hover', $(this).attr('tmp')).removeAttr('tmp');
}).each(function() {
$('<img>').attr('src', $(thi... | var jssor_slider1 = new $JssorSlider$('slider1_container', options); |
<|file_name|>Hello.java<|end_file_name|><|fim▁begin|>/*
* Copyright [2017]
*
* 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<|fim▁hole|> * http://www.apache.org/licenses/LICENSE-2.0
*
... | * |
<|file_name|>iron.rs<|end_file_name|><|fim▁begin|>//! Exposes the `Iron` type, the main entrance point of the
//! `Iron` library.
use std::net::{ToSocketAddrs, SocketAddr};
use std::path::PathBuf;
pub use hyper::server::Listening;
use hyper::server::Server;
use hyper::net::Fresh;
use request::HttpRequest;
use respon... | /// |
<|file_name|>hv4d.cpp<|end_file_name|><|fim▁begin|>/*****************************************************************************
* Copyright (C) 2004-2013 The PaGMO development team, *
* Advanced Concepts Team (ACT), European Space Agency (ESA) *
* http://apps.sourceforge.net... | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * |
<|file_name|>animated_properties.mako.rs<|end_file_name|><|fim▁begin|>/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
<%namespace name="helpers" file="/helpers.ma... | },
_ => Err(()),
} |
<|file_name|>PlotChangeOwnerEvent.java<|end_file_name|><|fim▁begin|>/*
* _____ _ _ _____ _
* | __ \| | | | / ____| | |
* | |__) | | ___ | |_| (___ __ _ _ _ __ _ _ __ ___ __| |
* | ___/| |/ _ \| __|\___ \ / _` | |... | return this.hasOldOwner;
}
@Override |
<|file_name|>LayouterSample.java<|end_file_name|><|fim▁begin|>/*
* @(#)LayouterSample.java
*
* Copyright (c) 1996-2010 by the original authors of JHotDraw and all its
* contributors. All rights reserved.
*
* You may not use, copy or modify this file, except in compliance with the
* license agreement you entered... | GraphicalCompositeFigure composite = new GraphicalCompositeFigure(); |
<|file_name|>complement-tests.ts<|end_file_name|><|fim▁begin|>import * as R from 'ramda';
() => {<|fim▁hole|>
// $ExpectType (n: number) => boolean
const isOdd = R.complement(isEven);
isOdd(21); // => true
isOdd(42); // => false
function isLengthEqual(value: string, length: number): boolean {
return val... | function isEven(n: number) {
return n % 2 === 0;
} |
<|file_name|>rays.js<|end_file_name|><|fim▁begin|>define(function(require) {
'use strict';
var _ = require('underscore');
var PIXI = require('pixi');
var PixiView = require('common/v3/pixi/view');
var Colors = require('common/colors/colors');
var Vector2 = require('common/math/vecto... | m1 = (By - Ay) / (Bx - f - Ax);
graphics.lineTo(Bx, By + (m1 * f)); |
<|file_name|>use-keyword.rs<|end_file_name|><|fim▁begin|>// Copyright 2016 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/lic... | //~^ ERROR `self` imports are only allowed within a { } list |
<|file_name|>mod.rs<|end_file_name|><|fim▁begin|>/*
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
mod directives;
use super::get_applied_fragment_name;
use crate::util::{remove_... | pub defer_name: StringKey,
pub stream_name: StringKey,
pub if_arg: StringKey, |
<|file_name|>netdata.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
"""
Display network speed and bandwidth usage.
Configuration parameters:
cache_timeout: refresh interval for this module (default 2)
format: display format for this module
*(default '{nic} [\?color=down LAN(Kb): {down}↓ {up}↑]... | if self.nic is None: |
<|file_name|>sectors.rs<|end_file_name|><|fim▁begin|>use rand::{seq, ChaChaRng, SeedableRng};
use rayon::prelude::*;
use std::{
collections::HashMap,
sync::atomic::{AtomicBool, Ordering},
time::Instant,
usize::MAX,
};
use config::GameConfig;
use entities::Faction;
use entities::Sector;
use utils::Point... | max size {}, min size {}, taking {} ms \n
Sectors include: {} Cartel, {} Empire, {} Federation, {} Independent", |
<|file_name|>oskari_maplayers_migration.js<|end_file_name|><|fim▁begin|>var _ = require("lodash-node");
module.exports = function(client) {
client.connect(function(err) {
if(err) {
return console.error('could not connect to postgres', err);
}
// 1. clear any previous migrations, db constraints w... |
function runSQL(client, sql, callback, errorMsg) {
client.query(sql, function(err) { |
<|file_name|>IAnyResource.java<|end_file_name|><|fim▁begin|>package org.hl7.fhir.instance.model.api;
import ca.uhn.fhir.model.api.annotation.SearchParamDefinition;
import ca.uhn.fhir.rest.gclient.TokenClientParam;
/*
* #%L
* HAPI FHIR - Core Library
* %%
* Copyright (C) 2014 - 2021 Smile CDR, Inc.
* %%
* Licens... | * Type: <b>string</b><br>
* Path: <b>Resource._id</b><br> |
<|file_name|>main.rs<|end_file_name|><|fim▁begin|>#![feature(box_syntax)]
#![feature(asm)]
extern crate e2d2;
extern crate fnv;
extern crate time;
extern crate rand;
use e2d2::scheduler::*;
pub struct DepTask {
id: String,
deps: Vec<usize>,
}
impl Executable for DepTask {
fn execute(&mut self) {
p... | deps: vec![parent],
}
}
} |
<|file_name|>emmet_css_from_one_line.py<|end_file_name|><|fim▁begin|>import sublime, sublime_plugin, re
class EmmetCssFromOneLineCommand(sublime_plugin.TextCommand):
def run(self, edit):
view = self.view
line_region = view.line(view.sel()[0])
line_str = view.substr(line_region... | props_array = re.findall(r'([a-zA-Z0-9:!;().,?/\-+#]+)', line_str) |
<|file_name|>tag.py<|end_file_name|><|fim▁begin|>from functools import partial
def build_tag_filter(args):
"""
Returns a filter which selects entries with all of the given
tags only.
@param list(str) args, e.g. ["+tag1", "unrelated"]
@return (callable filter, list remaining_args)
"""
remai... | skip = False |
<|file_name|>models.py<|end_file_name|><|fim▁begin|>from django.conf import settings
from django.db import models
import jsonfield
class Feed(models.Model):
name = models.CharField(max_length=1024)
url = models.URLField()
homepage = models.URLField()
etag = models.CharField(max_length=1024, blank=Tru... | expanded = models.BooleanField(default=False) |
<|file_name|>fake_hp_client_exceptions.py<|end_file_name|><|fim▁begin|># (c) Copyright 2014 Hewlett-Packard Development Company, L.P.
# 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
# ... | if 'debug1' in error:
self._debug1 = error['debug1'] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.