prompt large_stringlengths 70 991k | completion large_stringlengths 0 1.02k |
|---|---|
<|file_name|>piglatin.py<|end_file_name|><|fim▁begin|>#! /usr/bin/python2.7
import os
import re
import sys
# some static resources
vowels = set(('a','e','i','o','u','A','E','I','O','U'))
#vowel_re
consonant_re = re.compile(r'([bcdfghjklmnpqrstvwxyzBCDFGHJKLMNPQRSTVWXYZ]+)([a-zA-Z]*)(.*)?')
# input
original = sys.std... | for word in original.split():
# there are different rules if it starts with a vowel
if word[0] in vowels: |
<|file_name|>cli.go<|end_file_name|><|fim▁begin|>package cli
import (
"errors"
"fmt"
"io"
"os"
"reflect"
"strings"
flag "github.com/get3w/get3w/pkg/mflag"
)
// Cli represents a command line interface.
type Cli struct {
Stderr io.Writer
handlers []Handler
Usage func()
}
// Handler holds the different ... | command("--help")
return nil
case initErr:
return err.error |
<|file_name|>MemGenericConstantActionFactory.java<|end_file_name|><|fim▁begin|>/*
* Copyright (c) 2012 - 2020 Splice Machine, Inc.
*
* This file is part of Splice Machine.
* Splice Machine is free software: you can redistribute it and/or modify it under the terms of the
* GNU Affero General Public License as publi... | */
package com.splicemachine.derby.impl.sql.execute;
|
<|file_name|>panel_resize_controller.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 "chrome/browser/ui/panels/panel_resize_controller.h"
#include "base/log... |
void PanelResizeController::OnPanelClosed(Panel* panel) {
if (!resizing_panel_) |
<|file_name|>vorlon.IWebServerComponent.ts<|end_file_name|><|fim▁begin|>import express = require("express");
import http = require("http");
export module VORLON {
export interface IWebServerComponent {<|fim▁hole|> }
}<|fim▁end|> | addRoutes: (app: express.Express) => void;
start: (httpServer: http.Server) => void; |
<|file_name|>0016_heatcontrol_profile_end_null.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
# Generated by Django 1.11.12 on 2018-12-27 09:40
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [<|fim▁hole|> mig... | ('heatcontrol', '0015_heatcontrol_profile_add_holes'),
]
operations = [ |
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|><|fim▁hole|>__author__ = 'dolacmeo'<|fim▁end|> | # -*- coding: utf-8 -*-# |
<|file_name|>home.js<|end_file_name|><|fim▁begin|>define([
'text!views/home/home.html'
], function (template) {<|fim▁hole|> var model = kendo.observable({
title: 'Home'
});
var view = new kendo.View(template, { model: model });
return view;
});<|fim▁end|> | |
<|file_name|>openvswitch_bridge.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python
#coding: utf-8 -*-
# (c) 2013, David Stygstra <david.stygstra@gmail.com>
# Portions copyright @ 2015 VMware, Inc.
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolu... | version_added: "2.3" |
<|file_name|>models.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
from openerp import models, fields, api, osv
# We just create a new model
class mother(models.Model):
_name = 'test.inherit.mother'
_columns = {
# check interoperability of field inheritance with old-style fields
'name... | template_id = fields.Many2one() |
<|file_name|>bitcoin_nl.ts<|end_file_name|><|fim▁begin|><?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE TS>
<TS version="2.0" language="nl">
<defaultcodec>UTF-8</defaultcodec>
<context>
<name>AboutDialog</name>
<message>
<location filename="../forms/aboutdialog.ui" line="14"/>
<source>About Pay... | <message>
<location filename="../bitcoinstrings.cpp" line="47"/>
<source>Accept command line and JSON-RPC commands</source>
<translation>Aanvaard commandoregel en JSON-RPC commando's |
<|file_name|>Download.java<|end_file_name|><|fim▁begin|>package net.argius.stew.command;
import static java.sql.Types.*;
import java.io.*;
import java.sql.*;
import net.argius.stew.*;
/**
* The Download command used to save selected data to files.
*/
public final class Download extends Command {
private stat... | } catch (IOException ex) {
throw new CommandException(ex);
} catch (SQLException ex) { |
<|file_name|>E0199.rs<|end_file_name|><|fim▁begin|><|fim▁hole|>// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
// option. This file may not be copied, modified, or distr... | // 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.
// |
<|file_name|>resource.ts<|end_file_name|><|fim▁begin|>export class Resource {
sn: string
code: string
name: string
psn?: string
type: string
// /** 权限ID */
// private String privilegeId;
// /** 权限编码 */
// private String privilegeCode;
// /** 权限名称 */
// private String privileg... | this.type = options.type
this.code = options.code
}
} |
<|file_name|>builder.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# module builder script
#
import os, sys, shutil, tempfile, subprocess, platform
template_dir = os.path.abspath(os.path.dirname(sys._getframe(0).f_code.co_filename))
support_dir = os.path.join(template_dir, 'support')
... | name = manifest.name |
<|file_name|>search.component.ts<|end_file_name|><|fim▁begin|>import { Component } from '@angular/core';
import { Movie } from '../../classes/movie'
import{ MovieService } from '../../services/movie.service'
@Component({
selector: 'my-movie-search',
templateUrl: './search.component.html'
})<|fim▁hole|> searchStri... |
export class SearchComponent { |
<|file_name|>update_largethumbnail.py<|end_file_name|><|fim▁begin|>"""
This sample shows how to update the
large thumbnail of an item
Python 2.x
ArcREST 3.0.1
"""
import arcrest
from arcresthelper import securityhandlerhelper
from arcresthelper import common
def trace():
"""
trace finds the line... | |
<|file_name|>aufgabe-addierer.py<|end_file_name|><|fim▁begin|># Addierer mit += 1
# Eingaben erhalten
a = input("Dies ist ein Addierer!\nGeben Sie a ein: ")
b = input("Geben Sie b ein: ")
# Zeichenketten in Zahlen umwandeln
a = int(a)
b = int(b)
# neue Variable verwenden, Eingaben nicht verändern
result = a
i = 0
i... | |
<|file_name|>collection-guard.ts<|end_file_name|><|fim▁begin|>import { Injectable } from '@angular/core';
import { CanActivate, Router } from '@angular/router';
import { Capabilities } from '../../shared/services/capabilities.service';
import { CurrentUser } from '../../shared/services/current-user.model... | |
<|file_name|>live_snapshot.py<|end_file_name|><|fim▁begin|><|fim▁hole|>from generic.tests import file_transfer
def run(test, params, env):
"""
live_snapshot test:
1). Create live snapshot during big file creating
2). Create live snapshot when guest reboot
3). Check if live snapshot is created
... | import time
import logging
from autotest.client.shared import error
from virttest import utils_test |
<|file_name|>ng2now.ts<|end_file_name|><|fim▁begin|>// Polyfill Object.assign, if necessary, such as in IE11
if (typeof Object.assign != 'function') {
Object.assign = function (target) {
'use strict';
if (target == null) {
throw new TypeError('Cannot convert undefined or null to object')... | @Component(), followed by the options object itself.
@param providers |
<|file_name|>system.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
class System(object):
""" This is the father class for all different systems. """
def __init__(self, *args, **kwargs):
pass<|fim▁hole|>
def update(self, dt):
raise NotImplementedError<|fim▁end|> | |
<|file_name|>FontLineShapeRenderer.js<|end_file_name|><|fim▁begin|>Clazz.declarePackage ("org.jmol.render");
Clazz.load (["org.jmol.render.ShapeRenderer", "org.jmol.util.Point3f", "$.Point3i", "$.Vector3f"], "org.jmol.render.FontLineShapeRenderer", ["java.lang.Float", "org.jmol.constant.EnumAxesMode", "org.jmol.util.Te... | |
<|file_name|>platform_video_frame_pool.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 "media/gpu/chromeos/platform_video_frame_pool.h"
#include <utility>
#inc... | }
} // namespace media |
<|file_name|>models.py<|end_file_name|><|fim▁begin|>from __future__ import unicode_literals
import datetime
from django.db import models
from django.utils import timezone
from django.utils.encoding import python_2_unicode_compatible
# Create your models here.
@python_2_unicode_compatible # only if you need to suppor... | def __str__(self): |
<|file_name|>JoinRuleDropdown.tsx<|end_file_name|><|fim▁begin|>/*
Copyright 2021 The Matrix.org Foundation C.I.C.
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/... | labelRestricted?: string; // if omitted then this option will be hidden, e.g if unsupported
onChange(value: JoinRule): void;
}
|
<|file_name|>IMsg.java<|end_file_name|><|fim▁begin|>/*******************************************************************************
* Copyright (c) 2012 Scott Ross.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the GNU Lesser Public License v2.1
* which ... | } |
<|file_name|>Particle.js<|end_file_name|><|fim▁begin|>"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var ShapeType_1 = require("../Enums/ShapeType");
var Updater_1 = require("./Particle/Updater");
var Utils_1 = require("../Utils/Utils");
var PolygonMaskType_1 = require("../Enums/PolygonMas... | delete this.infectionDelayStage;
}
else { |
<|file_name|>ReinterpretNode.java<|end_file_name|><|fim▁begin|>/*
* Copyright (c) 2013, 2015, 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 Gene... | import com.oracle.graal.nodeinfo.*; |
<|file_name|>mod.rs<|end_file_name|><|fim▁begin|>pub use child_process_terminator::ChildProcessTerminator;
use std::env;
use std::process::Command;
use std::thread::sleep;
use std::time::Duration;
mod child_process_terminator;
fn rostopic_listing_succeeds() -> bool {
return Command::new("rostopic")
.arg("... | &mut Command::new("roscore").arg("-p").arg(format!("{}", port)), |
<|file_name|>orchestrators_test.go<|end_file_name|><|fim▁begin|>package api
import (
"testing"
"github.com/Azure/acs-engine/pkg/api/common"
"github.com/Masterminds/semver"
. "github.com/onsi/gomega"
)
func TestInvalidVersion(t *testing.T) {
RegisterTestingT(t)
invalid := []string{
"invalid number",
"inval... | Expect(e).To(BeNil())
// 1.8.0, 1.8.1, 1.8.2 |
<|file_name|>repeat_str.rs<|end_file_name|><|fim▁begin|>// http://rosettacode.org/wiki/Repeat_a_string
#[cfg(not(test))]
fn main() {
println!("{}", "ha".repeat(5).as_slice());
}
#[test]
fn check_repeat() {
assert!("ha".repeat(5).as_slice() == "hahahahaha");<|fim▁hole|><|fim▁end|> | } |
<|file_name|>musicBarInputComponent.js<|end_file_name|><|fim▁begin|>'use strict';
(function (scope) {
/**
* Bar input component
*
* @class MusicBarInputComponent
* @extends AbstractMusicInputComponent
* @constructor
*/
function MusicBarInputComponent() {
this.type = 'bar';... | MusicBarInputComponent.prototype = new scope.AbstractMusicInputComponent();
|
<|file_name|>LogisticsConsignOrderCreateandsendResponse.java<|end_file_name|><|fim▁begin|>package com.taobao.api.response;
import com.taobao.api.TaobaoResponse;<|fim▁hole|> *
* @author auto create
* @since 1.0, null
*/
public class LogisticsConsignOrderCreateandsendResponse extends TaobaoResponse {
private st... | import com.taobao.api.internal.mapping.ApiField;
/**
* TOP API: taobao.logistics.consign.order.createandsend response. |
<|file_name|>index.js<|end_file_name|><|fim▁begin|>var models = require('../models');
var express = require('express');
var router = express.Router();
/* GET home page. */
router.get('/', function(req, res, next) {
console.log(req.session);<|fim▁hole|><|fim▁end|> | res.render('layout');
});
module.exports = router; |
<|file_name|>control_flow.py<|end_file_name|><|fim▁begin|># Copyright 2018 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apac... | set_state(init_state)
return outputs, final_state |
<|file_name|>impl_numeric.rs<|end_file_name|><|fim▁begin|>// Copyright 2014-2016 bluss and ndarray developers.
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
// opti... | |
<|file_name|>MapDao.java<|end_file_name|><|fim▁begin|>package org.zarroboogs.weibo.dao;
import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;
import org.zarroboogs.util.net.HttpUtility;
import org.zarroboogs.util.net.WeiboException;
import org.zarroboogs.util.net.HttpUtility.HttpMethod;... | String url = WeiBoURLs.STATIC_MAP;
Map<String, String> map = new HashMap<String, String>(); |
<|file_name|>viewer.cpp<|end_file_name|><|fim▁begin|>// Copyright (c) 2011 Hewlett-Packard Development Company, L.P. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include <QDir>
#include <QDoubleSpinBox>
#include <QFileDialog>
#include <QF... | return;
createContent(fileName); |
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|># Licensed under a 3-clause BSD style license - see LICENSE.rst
""" An extensible ASCII table reader and writer.
"""
from .core import (InconsistentTableError,
ParameterError,
NoType, StrType, NumType, FloatType, IntType, All... | BaseHeader,
BaseData,
BaseOutputter, TableOutputter,
BaseReader, |
<|file_name|>youtrack.py<|end_file_name|><|fim▁begin|>from __future__ import absolute_import
import re
import six
import requests
from jinja2 import Template
from bugwarrior.config import asbool, die
from bugwarrior.services import IssueService, Issue, ServiceClient
import logging
log = logging.getLogger(__name__)
... | self.session.headers['Cookie'] = resp.headers['set-cookie']
@classmethod |
<|file_name|>event_definition.pb.go<|end_file_name|><|fim▁begin|>// Copyright 2020 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
//
// https://www.apache.... | 0x32, 0x0a, 0x04, 0x74, 0x65, 0x78, 0x74, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1e, 0x2e,
0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x66, 0x68, 0x69, 0x72, 0x2e, 0x72, 0x35, 0x2e, 0x63, |
<|file_name|>capsule.rs<|end_file_name|><|fim▁begin|>/* diosix capsule management
*
* (c) Chris Williams, 2019-2021.
*
* See LICENSE for usage and copying.
*/
use core::sync::atomic::{AtomicUsize, Ordering};
use super::lock::Mutex;
use hashbrown::hash_map::HashMap;
use hashbrown::hash_map::Entry::{Occupied, Vacan... | None => return Err(Cause::CapsuleBadID) |
<|file_name|>actions.py<|end_file_name|><|fim▁begin|>def init_actions_(service, args):
"""
this needs to returns an array of actions representing the depencies between actions.
Looks at ACTION_DEPS in this module for an example of what is expected
"""
# some default logic for simple actions
... | if j.sal.fs.exists(j.sal.fs.joinPaths(test_repo.path, "actors")):
model.data.result = RESULT_FAILED % ('Actors directory is not deleted')
if j.sal.fs.exists(j.sal.fs.joinPaths(test_repo.path, "services")): |
<|file_name|>snoop.rs<|end_file_name|><|fim▁begin|>//! Snoop plugin that exposes metrics on a local socket.
use errors::*;
use plugin::*;
use metric::*;
use std::collections::HashMap;
use std::sync::{Mutex, Arc};
use std::net::SocketAddr;
use tokio_io::{io, AsyncRead};
use tokio_core::net;<|fim▁hole|>use std::fmt;
us... | use futures::{sync, Future};
use futures::stream::Stream;
use std::convert::AsRef; |
<|file_name|>random_ops.py<|end_file_name|><|fim▁begin|># Copyright 2017 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache... | # Unless required by applicable law or agreed to in writing, software |
<|file_name|>test_range_filter.py<|end_file_name|><|fim▁begin|># Copyright 2014-2016 Morgan Delahaye-Prat. All Rights Reserved.
#
# Licensed under the Simplified BSD License (the "License");
# you may not use this file except in compliance with the License.
import pytest
from hypr.helpers.mini_dsl import Range
@pyt... | """Interval with a minimum value only."""
ref = [model.one(i) for i in range(7, 100) if model.one(i)] |
<|file_name|>imagelookup.go<|end_file_name|><|fim▁begin|>package app
import (
"fmt"
"sort"
"strings"
"github.com/fsouza/go-dockerclient"
kapi "github.com/GoogleCloudPlatform/kubernetes/pkg/api"
"github.com/GoogleCloudPlatform/kubernetes/pkg/api/errors"
utilerrors "github.com/GoogleCloudPlatform/kubernetes/pkg... | |
<|file_name|>CWE762_Mismatched_Memory_Management_Routines__new_free_long_84_goodB2G.cpp<|end_file_name|><|fim▁begin|>/* TEMPLATE GENERATED TESTCASE FILE
Filename: CWE762_Mismatched_Memory_Management_Routines__new_free_long_84_goodB2G.cpp
Label Definition File: CWE762_Mismatched_Memory_Management_Routines__new_free.la... | data = new long;
|
<|file_name|>SessionHandler.java<|end_file_name|><|fim▁begin|>package org.apache.xmlrpc;
<|fim▁hole|>
void checkSession(Integer SessionId, Integer UserId) throws InvalidSessionException;
}<|fim▁end|> |
public interface SessionHandler { |
<|file_name|>shell.go<|end_file_name|><|fim▁begin|>package gospace
import (
"errors"
"fmt"
"os"
"os/exec"
"strings"
)
var (
// fallback shell path
SHELL_DEFAULT string = "/bin/sh"
// environment variable to read the shell path
SHELL_ENV string = "SHELL"
// environment variable to read for binary lookups
PA... |
return
} |
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|><|fim▁hole|>from pypwrctrl.pypwrctrl import Plug, PlugDevice, PlugMaster<|fim▁end|> | |
<|file_name|>input_test.js<|end_file_name|><|fim▁begin|>// Licensed to the Software Freedom Conservancy (SFC) under one
// or more contributor license agreements. See the NOTICE file
// distributed with this work for additional information
// regarding copyright ownership. The SFC licenses this file
// to you under t... | .pause()
.pause(3)
.perform(); |
<|file_name|>advent-day-6-2.py<|end_file_name|><|fim▁begin|># Advent of Code Solutions: Day 6, part 2
# https://github.com/emddudley/advent-of-code-solutions
import re
def twinkle_lights(instruction, lights):
tokens = re.split(r'(\d+)', instruction)
operation = tokens[0].strip()<|fim▁hole|> twinkle = l... |
if operation == 'turn on':
twinkle = lambda x: x + 1
elif operation == 'turn off': |
<|file_name|>test_sqlitecachedbhandler_torrents.py<|end_file_name|><|fim▁begin|>import os
import struct
from binascii import unhexlify
from shutil import copy as copyfile
from twisted.internet.defer import inlineCallbacks
from Tribler.Core.CacheDB.SqliteCacheDBHandler import TorrentDBHandler, MyPreferenceDBHandler, C... | """
Test whether the right amount of torrents are returned when searching for torrents in db
"""
columns = ['T.torrent_id', 'infohash', 'status', 'num_seeders'] |
<|file_name|>test_module.cpp<|end_file_name|><|fim▁begin|>/*
test_messagehandler.cpp
Copyright 2016 fyrelab
*/
/*
Test cases dont have to be as extensive as the module class is mostly a summary
of the methods from the messagehandler and the configloader
*/
#define BOOST_TEST_NO_MAIN
#include <boost/test/unit... | // ==================================================================================================================== |
<|file_name|>basic.py<|end_file_name|><|fim▁begin|># Licensed under a 3-clause BSD style license - see LICENSE.rst
"""An extensible ASCII table reader and writer.
basic.py:
Basic table read / write functionality for simple character
delimited files with various options for column header definition.
:Copyright: Sm... | |
<|file_name|>DynamicActivity.java<|end_file_name|><|fim▁begin|>package aaron.org.anote.viewbinder;
<|fim▁hole|>import android.os.Bundle;
public class DynamicActivity extends Activity {
@Override
public void onCreate(Bundle savedInstance) {
super.onCreate(savedInstance);
Layout.start(this);
... | import android.app.Activity; |
<|file_name|>data.rs<|end_file_name|><|fim▁begin|>use redox::prelude::v1::*;
use table::NodeTable;
/// A data node (file/dir)
pub enum Data {
/// File
File(File),
/// Directory
Dir(Dir),
/// Nothing
Nil,
}
<|fim▁hole|>impl Data {
pub fn name(&self) -> &str {
match self {
... | |
<|file_name|>workspace.rs<|end_file_name|><|fim▁begin|>use crate::core::{Target, Workspace};
use crate::ops::CompileOptions;
use crate::util::CargoResult;
use anyhow::bail;
use std::fmt::Write;
fn get_available_targets<'a>(
filter_fn: fn(&Target) -> bool,
ws: &'a Workspace<'_>,
options: &'a CompileOptions,... | .map(|pkg| pkg.name().as_str())
.collect::<Vec<_>>(); |
<|file_name|>OpenCompareViewAction.java<|end_file_name|><|fim▁begin|>package org.openlca.app.collaboration.navigation.actions;
import java.util.List;
import org.eclipse.jface.action.Action;
import org.eclipse.jface.dialogs.IDialogConstants;
import org.openlca.app.M;
import org.openlca.app.collaboration.dialogs.Select... | return false;
this.selection = selection;
return true; |
<|file_name|>create_campaign.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python
#
# Copyright 2014 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
#
# htt... | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
|
<|file_name|>connections.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
# -*- coding: iso8859-1 -*-
#
# connections.py - network connections statistics
#
# Copyright (c) 2005-2007, Carlos Rodrigues <cefrodrigues@mail.telepac.pt>
#
# This program is free software; you can redistribute it and/or modify
# it under... | |
<|file_name|>test-get-reduction-export.js<|end_file_name|><|fim▁begin|>const moment = require('moment')
const expect = require('chai').expect
const sinon = require('sinon')
const proxyquire = require('proxyquire')
const breadcrumbHelper = require('../../helpers/breadcrumb-helper')
const orgUnitConstant = require('../.... | expect(result.reductionNotes[0].endDate).to.be.eql('25 12 2018, 00:00')
expect(result.reductionNotes[0].status).to.be.eql(expectedReductionExport[0].status)
expect(result.reductionNotes[0].additionalNotes).to.be.eql(expectedReductionExport[0].additionalNotes) |
<|file_name|>test_adcps_jln_stc_recovered_driver.py<|end_file_name|><|fim▁begin|>__author__ = 'Mark Worden'
from mi.core.log import get_logger
log = get_logger()
from mi.idk.config import Config
import unittest
import os
from mi.dataset.driver.adcps_jln.stc.adcps_jln_stc_recovered_driver import parse
from mi.datase... | class SampleTest(unittest.TestCase): |
<|file_name|>primitive_docs.rs<|end_file_name|><|fim▁begin|>#[doc(primitive = "bool")]
#[doc(alias = "true")]
#[doc(alias = "false")]
/// The boolean type.
///
/// The `bool` represents a value, which could only be either [`true`] or [`false`]. If you cast
/// a `bool` into an integer, [`true`] will be 1 and [`false`] ... | ///
/// ```
/// let my_num: Box<i32> = Box::new(10); |
<|file_name|>base_viewer_spec.js<|end_file_name|><|fim▁begin|>/* Copyright 2021 Mozilla Foundation
*
* 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... | iterator = viewsMap.values();
for (let i = 0; i < 1; i++) {
const view = iterator.next().value; |
<|file_name|>admin.py<|end_file_name|><|fim▁begin|>from django.contrib import admin
<|fim▁hole|>
# Register your models here.
admin.site.register(dynamic_models.values())<|fim▁end|> | from .models import dynamic_models |
<|file_name|>mockDomSource.ts<|end_file_name|><|fim▁begin|>import { Stream, empty } from 'most'
import { DomSource } from './types'
import { VNode } from 'mostly-dom'
export interface MockConfig {
readonly [key: string]: MockConfig | Stream <any>
}
export function mockDomSource(
mockConfig?: MockConfig & { eleme... | const generatedScope = `${SCOPE_PREFIX}${scope}` |
<|file_name|>puback.go<|end_file_name|><|fim▁begin|>package message
// PubackMessage is that a PUBACK Packet is the response to a PUBLISH Packet with QoS
// level 1
type PubackMessage struct {
fixedHeader
// This contains the Packet Identifier from the PUBLISH Packet that is bening
// acknowledged.
packetID []byt... |
// PacketID returns Packet Identifier |
<|file_name|>test_core_priors.py<|end_file_name|><|fim▁begin|>"""
Tests for priors.
"""
# pylint: disable=missing-docstring
from __future__ import division
from __future__ import absolute_import
from __future__ import print_function
import numpy as np<|fim▁hole|>import numpy.testing as nt
import scipy.optimize as sp... | |
<|file_name|>ip_configuration_py3.py<|end_file_name|><|fim▁begin|># coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# C... | def __init__(self, *, id: str=None, private_ip_address: str=None, private_ip_allocation_method=None, subnet=None, public_ip_address=None, provisioning_state: str=None, name: str=None, etag: str=None, **kwargs) -> None: |
<|file_name|>multiapp.go<|end_file_name|><|fim▁begin|>package main
import (
"github.com/coscms/webx"
)
type MainAction struct {
*webx.Action
hello webx.Mapper `webx:"/(.*)"`
}
func (c *MainAction) Hello(world string) {
c.Write("hello %v", world)
}
<|fim▁hole|>
app2 := webx.NewApp("/user/")
a... | func main() {
app1 := webx.NewApp("/")
app1.AddAction(&MainAction{})
webx.AddApp(app1)
|
<|file_name|>pyrocket_backend.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python
#
import usb
from time import sleep
class RocketManager:
vendor_product_ids = [(0x1941, 0x8021), (0x0a81, 0x0701), (0x0a81, 0xff01), (0x1130, 0x0202), (0x2123,0x1010)]
launcher_types = ["Original", "Webcam", "Wireless", "Striker I... | |
<|file_name|>itchat_test.py<|end_file_name|><|fim▁begin|><|fim▁hole|>
friends = itchat.get_friends(update = True)[0:]
info = {}
for i in friends:
info[i['NickName']] = i.Signature
print(info)<|fim▁end|> | import itchat
itchat.login() |
<|file_name|>l-arginine.py<|end_file_name|><|fim▁begin|>import pulsar as psr
def load_ref_system():
""" Returns l-arginine as found in the IQMol fragment library.
All credit to https://github.com/nutjunkie/IQmol
"""
return psr.make_system("""
N 0.8592 -2.9103 -0.8578
C ... | |
<|file_name|>test_pkg.py<|end_file_name|><|fim▁begin|># Copyright (c) 2011 OpenStack Foundation
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# htt... | |
<|file_name|>instance.ts<|end_file_name|><|fim▁begin|>import { computed, reactive } from 'vue';
import { api } from './os';
// TODO: 他のタブと永続化されたstateを同期
type Instance = {
emojis: {
category: string;
}[];
};
const data = localStorage.getItem('instance');
// TODO: instanceをリアクティブにするかは再考の余地あり
export const instanc... | export async function fetchInstance() { |
<|file_name|>array_simp_2.py<|end_file_name|><|fim▁begin|>t = int(raw_input())
MOD = 10**9 + 7
def modexp(a,b):
res = 1
while b:
if b&1:
res *= a
res %= MOD
a = (a*a)%MOD
b /= 2
return res
fn = [1 for _ in xrange(100001)]
ifn = [1 for _ in xrange(100001)]
for... | fn[i] %= MOD |
<|file_name|>views.py<|end_file_name|><|fim▁begin|>from django.conf import settings
from django.contrib import messages
from django.forms import Form
from django.http import Http404, HttpResponse, HttpResponseBadRequest
from django.shortcuts import get_object_or_404, redirect, render
from django.views.decorators.csrf i... | nationality = fields.get('nationality',''),
sex=sex,
# See if this works without any changes... |
<|file_name|>runtime.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
# Copyright (C) 2007-2018, Raffaele Salmaso <raffaele@salmaso.org>
# Copyright (c) 2012 Omoto Kenji
# Copyright (c) 2011 Sam Stephenson
# Copyright (c) 2011 Josh Peek
#
# Permission is hereby granted, free of charge, to any person obtaining a... | import contextlib
#backward compatibility
with contextlib.nested(PyV8.JSContext(), PyV8.JSEngine()) as (ctxt, engine):
js_errors = (PyV8.JSError, IndexError, ReferenceError, SyntaxError, TypeError) |
<|file_name|>qwindowsmobilestyle.cpp<|end_file_name|><|fim▁begin|>/****************************************************************************
**
** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
** This file is part of the... | QWindowsStyle::polish(application);
}
/*! \reimp */ |
<|file_name|>tabview.js<|end_file_name|><|fim▁begin|>// JavaScript Document
/* Copyright (C) 2005 Ilya S. Lyubinskiy. All rights reserved.
Technical support: http://www.php-development.ru/
YOU MAY NOT
(1) Remove or modify this copyright notice.
(2) Distribute this code, any part or any modified version of it.
Inst... | |
<|file_name|>02-Properties.js<|end_file_name|><|fim▁begin|>import React from 'react';
class MyPropertiesExample extends React.Component {
render() {
return (
<div>
<h1>Properties</h1>
My favourite dish is {this.props.dish}.
</div>
);
}
}
MyPropertiesExample.defaultProps = {
d... |
export default MyPropertiesExample; |
<|file_name|>Client085.java<|end_file_name|><|fim▁begin|>/*
* JBoss, Home of Professional Open Source
* Copyright 2007, Red Hat Middleware LLC, and individual contributors
* as indicated by the @author tags.
* See the copyright.txt in the distribution for a
* full listing of individual contributors.
* This copyri... | try
{
OTS.current().commit(true);
System.err.println("Commit succeeded when it shouldn't"); |
<|file_name|>QueryStringService.js<|end_file_name|><|fim▁begin|>angular.module('openITCOCKPIT')
.service('QueryStringService', function(){
return {
getCakeId: function(){
var url = window.location.href;
url = url.split('/');
var id = url[url.lengt... | try{
//&filter[Service.id][]=861&filter[Service.id][]=53&filter[Service.id][]=860 |
<|file_name|>gulpfile.babel.js<|end_file_name|><|fim▁begin|>'use strict';<|fim▁hole|>import gulp from 'gulp';
import gutil from 'gulp-util';
import uglify from 'gulp-uglify';
import stylus from 'gulp-stylus';
import watch from 'gulp-watch';
import plumber from 'gulp-plumber';
import cleanCss from 'gulp-clean-css';
impo... | |
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|><|fim▁hole|><|fim▁end|> | #import DBusInterface |
<|file_name|>leadership-search-test.js<|end_file_name|><|fim▁begin|>import { moduleForComponent, test } from 'ember-qunit';
import hbs from 'htmlbars-inline-precompile';
import Ember from 'ember';
import wait from 'ember-test-helpers/wait';
const { Service, RSVP, Object:EmberObject } = Ember;
const { resolve } = RSVP;... | |
<|file_name|>NexusEnMaven.java<|end_file_name|><|fim▁begin|>package com.ctrip.framework.cs.enterprise;
import com.ctrip.framework.cs.configuration.ConfigurationManager;
import com.ctrip.framework.cs.configuration.InitConfigurationException;
import com.ctrip.framework.cs.util.HttpUtil;
import com.ctrip.framework.cs.uti... | RepoDetail[] repoDetails;
NexusPomInfo[] data;
}
|
<|file_name|>DefinitionImpl.java<|end_file_name|><|fim▁begin|>/*
* Copyright (C) 2013 salesforce.com, 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... | * @see Definition#getDescriptor()
*/
@Override
public DefDescriptor<T> getDescriptor() { |
<|file_name|>geo.py<|end_file_name|><|fim▁begin|># !/usr/bin/python
# -*- coding: utf-8 -*-
#
# Created on Oct 16, 2015
# @author: Bo Zhao
# @email: bo_zhao@hks.harvard.edu
# @website: http://yenching.org
# @organization: Harvard Kennedy School
import urllib2
import json
import sys
from settings imp... | # verified inforamtion, and/or other contextual information. |
<|file_name|>optionsFactory.ts<|end_file_name|><|fim▁begin|>import { IFilterOptionDef } from '../../interfaces/iFilter';
import { IScalarFilterParams } from './scalarFilter';
import { ISimpleFilterParams } from './simpleFilter';
import { every } from '../../utils/array';
/* Common logic for options, used by both filte... | public getFilterOptions(): (IFilterOptionDef | string)[] {
return this.filterOptions; |
<|file_name|>ResliceBSpline.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
import vtk
from vtk.test import Testing
from vtk.util.misc import vtkGetDataRoot
VTK_DATA_ROOT = vtkGetDataRoot()
# this script tests vtkImageReslice with different interpolation modes,
# with the wrap-pad feature turned on and with a ro... | reslice1.SetOutputOrigin(-32,-32,40)
reslice1.SetOutputExtent(0,127,0,127,0,0)
reslice2 = vtk.vtkImageReslice() |
<|file_name|>numbers.js<|end_file_name|><|fim▁begin|>// Math.extend v0.5.0
// Copyright (c) 2008-2009 Laurent Fortin
//
// 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 restriction... | |
<|file_name|>LocalWatcher.java<|end_file_name|><|fim▁begin|>/*
* Syncany, www.syncany.org
* Copyright (C) 2011 Philipp C. Heckel <philipp.heckel@gmail.com>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free So... | |
<|file_name|>index.js<|end_file_name|><|fim▁begin|>import { Widget, startAppLoop, Url, History } from 'cx/ui';
import { Timing, Debug } from 'cx/util';<|fim▁hole|>
import "./index.scss";
let stop;
const store = new Store();
if(module.hot) {
// accept itself
module.hot.accept();
// remember data on dispose
m... | import { Store } from 'cx/data';
import Routes from './routes';
import 'whatwg-fetch'; |
<|file_name|>peos_notify.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python
import os
import re
import sys
import json
import urllib
import socket
import subprocess
import cgi, cgitb
from os import listdir
from os.path import isfile, join
#http://178.62.51.54:13930/event=CREATE&login_name=henrik&pathway_name=test_comm... |
def peos_notify(patient_id):
EXECUTION_PATH = "../peos/os/kernel/"
|
<|file_name|>main.py<|end_file_name|><|fim▁begin|>import os
import sys
import argparse
import configparser
from utils.process import Process
# They are imported as all lowercase
# so it is case insensitive in the config file
from modules.tuebl import Tuebl as tuebl
from modules.itebooks import ItEbooks as itebooks
fr... | |
<|file_name|>RuleDetailsProfiles.tsx<|end_file_name|><|fim▁begin|>/*
* SonarQube
* Copyright (C) 2009-2022 SonarSource SA
* mailto:info AT sonarsource DOT com
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by t... | render() {
const { activations = [], referencedProfiles, ruleDetails } = this.props;
const canActivate = Object.values(referencedProfiles).some(profile =>
Boolean(profile.actions && profile.actions.edit && profile.language === ruleDetails.lang) |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.