prompt large_stringlengths 70 991k | completion large_stringlengths 0 1.02k |
|---|---|
<|file_name|>test_urls.py<|end_file_name|><|fim▁begin|># Copyright (C) 2013 Red Hat, Inc.
#
# 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 2 of the License, or
# (at your option)... | OLD_UBUNTU_URL = "http://old-releases.ubuntu.com/ubuntu/dists/%s/main/installer-%s"
UBUNTU_URL = "http://us.archive.ubuntu.com/ubuntu/dists/%s/main/installer-%s"
OLD_DEBIAN_URL = "http://archive.debian.org/debian/dists/%s/main/installer-%s/" |
<|file_name|>AddFishForm.js<|end_file_name|><|fim▁begin|>/*
Add Fish Form
*/
import React from 'react';
import autobind from 'autobind-decorator';
class AddFishForm extends React.Component{
@autobind
createFish(event){
//1. Stop the form from submitting
event.preventDefault();
//2. Take the data f... | <option value="available">Fresh!</option>
<option value="unavailable">Sold Out!</option>
</select>
<textarea type="text" ref="desc" placeholder="Desc"></textarea> |
<|file_name|>app.js<|end_file_name|><|fim▁begin|>const express = require('express')
const path = require('path')
const logger = require('morgan')
const cookieParser = require('cookie-parser')
const bodyParser = require('body-parser')
const index = require('./routes/index')
const app = express()<|fim▁hole|>app.set('vi... |
// view engine setup
app.engine('html', require('ejs').renderFile)
|
<|file_name|>test_bm_node.py<|end_file_name|><|fim▁begin|># Copyright (c) 2012 NTT DOCOMO, 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... | self.assertRaises(
exception.NovaException,
db.bm_interface_get,
self.context, if_b_id) |
<|file_name|>PasswordTest.java<|end_file_name|><|fim▁begin|>/*
Copyright (c) 2012 Marco Amadei.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0... | |
<|file_name|>alert-service.js<|end_file_name|><|fim▁begin|>'use strict';
angular.module('27th.common.services.alert', [])
.service('alertService', class {
constructor($rootScope) {
this.alerts = [];
this.$rootScope = $rootScope;
}
success(msg) {
this.ale... | return this.alerts.pop(); |
<|file_name|>0010_clear_messages_sent_values.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
from django.db.backends.postgresql_psycopg2.schema import DatabaseSchemaEditor
from django.db.migrations.state import StateApps
from django.db import migrations
def clear_message_sent_by_message_type_values(apps, schem... | InstallationCount.objects.filter(property=property).delete()
FillState.objects.filter(property=property).delete() |
<|file_name|>AbstractFormatReader.java<|end_file_name|><|fim▁begin|>/*
* Copyright 2015 OpenCB
*
* 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/LI... | // logger.setLevel(Logger.DEBUG_LEVEL);
} |
<|file_name|>time-perf-helper.js<|end_file_name|><|fim▁begin|>window.PerfHelpers = window.PerfHelpers || {};
;(function(PerfHelpers) {
var timers = {};
PerfHelpers = window.performance || {};
PerfHelpers.now = PerfHelpers.now || function () {};
if ((!console) || (!console.time)) {
console.time = function()... |
if ('ga' in window) {
var alKey = 'ACT_' + key;
var _roundedTime = Math.round(_totalTime); |
<|file_name|>util.ts<|end_file_name|><|fim▁begin|>/**
* @license
* Copyright Google Inc. All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.io/license
*/
// Import zero symbols from zone.js. This causes the zone ambient ... | if (typeof token === 'string') {
return token;
} |
<|file_name|>MenuBarItemStylesExample.py<|end_file_name|><|fim▁begin|>from muntjac.ui.vertical_layout import VerticalLayout
from muntjac.ui.menu_bar import MenuBar, ICommand
from muntjac.terminal.external_resource import ExternalResource
class MenuBarItemStylesExample(VerticalLayout):
def __init__(self):
... | edit.addItem('Undo', menuCommand)
edit.addItem('Redo', menuCommand).setEnabled(False) |
<|file_name|>fifteenmodel.cpp<|end_file_name|><|fim▁begin|>/**
* @author Michele Tomaiuolo - http://www.ce.unipr.it/people/tomamic
* @license This software is free - http://www.gnu.org/licenses/gpl.html
*/
<|fim▁hole|>#include "fifteenmodel.h"
FifteenModel::FifteenModel(int rows, int columns)
: silent(false), F... | |
<|file_name|>AddressModel.java<|end_file_name|><|fim▁begin|>package com.purvotara.airbnbmapexample.model;
import android.content.Context;
import com.android.volley.Request;
import com.google.gson.Gson;
import com.google.gson.annotations.Expose;
import com.google.gson.annotations.SerializedName;
import com.google.gson... | }
|
<|file_name|>main.rs<|end_file_name|><|fim▁begin|>const MSIZE:usize = 26; // Size of our padded matrix
fn compute_point (a:[[usize;MSIZE];MSIZE], i:usize, j:usize)-> usize {
let mut n:usize;
let mut max:usize = 0;
// north
n = a[i][j] * a[i-1][j] * a[i-2][j] * a[i-3][j];
if n > max {
max = n;
... | [0, 0, 0, 88, 36, 68, 87, 57, 62, 20, 72, 3, 46, 33, 67, 46, 55, 12, 32, 63, 93, 53, 69, 0, 0, 0], |
<|file_name|>events.py<|end_file_name|><|fim▁begin|>from baseplate.events import FieldKind
from pylons import app_globals as g
from r2.lib.eventcollector import (
EventQueue,
Event,
squelch_exceptions,
)
from r2.lib.utils import sampled
from r2.models import (
FakeSubreddit,
)
class AdEvent(Event):
... | event.add("rate_type", rate_type)
event.add("clearing_price", clearing_price) |
<|file_name|>AnnotatedLineRenderer.java<|end_file_name|><|fim▁begin|>package e.scm;
import java.awt.*;
import javax.swing.*;
public class AnnotatedLineRenderer extends e.gui.EListCellRenderer<AnnotatedLine> {
/** Used to draw the dashed line between adjacent lines from different revisions. */
private static f... |
setText(line.formattedLine);
if (isSelected == false) {
setForeground((revisionView.getAnnotatedRevision() == line.revision) ? Color.BLUE : Color.BLACK); |
<|file_name|>test_get_program_tree_version_from_node_service.py<|end_file_name|><|fim▁begin|># ############################################################################
# OSIS stands for Open Student Information System. It's an application
# designed to manage the core business of higher education institutions,
# ... | #
# 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 License, or |
<|file_name|>0007_auto__add_unique_assessment_user_sample_result.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding unique con... | |
<|file_name|>htmlconstructor.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 https://mozilla.org/MPL/2.0/. */
use crate::dom::bindings::codegen::Bindings::HTMLAnc... | use crate::dom::bindings::codegen::Bindings::HTMLQuoteElementBinding;
use crate::dom::bindings::codegen::Bindings::HTMLScriptElementBinding;
use crate::dom::bindings::codegen::Bindings::HTMLSelectElementBinding; |
<|file_name|>Parameter.py<|end_file_name|><|fim▁begin|>param = dict(
useAIon=True,
verbose=False,
chargePreXlinkIons=[1, 3],
chargePostXlinkIons=[2, 5],
basepeakint = 100.0,
dynamicrange = 0.001,
missedsites = 2,
minlength = 4,
maxlength = 51,
modRes = '',
modMass = 0.0,
linkermass = 136.10005,
ms1tol = di... | aa=set('ACDEFGHIKLMNPQRSTVWY')),
h2oGain=dict(
mass=18.010565,
aa=set('ACDEFGHIKLMNPQRSTVWY')))) |
<|file_name|>ninja_target_writer.cc<|end_file_name|><|fim▁begin|>// Copyright (c) 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.
#include "tools/gn/ninja_target_writer.h"
#include <sstream>
#include "base/files/f... | for (const auto& toolchain_dep : toolchain_deps)
unique_deps.insert(toolchain_dep.ptr);
|
<|file_name|>diagnostics.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/lic... |
register_diagnostics! {
E0373 // closure may outlive current fn, but it borrows {}, which is owned by current fn |
<|file_name|>main.py<|end_file_name|><|fim▁begin|># encoding: utf8
from __future__ import print_function
import argparse
import os
import sys
import pokedex.cli.search
import pokedex.db
import pokedex.db.load
import pokedex.db.tables
import pokedex.lookup
from pokedex import defaults
def main(junk, *argv):
if l... | |
<|file_name|>AWSInstanceInfoProviderImpl.java<|end_file_name|><|fim▁begin|>/*
* Fluffy Meow - Torrent RSS generator for TV series
* Copyright (C) 2015 Victor Denisov
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published
... | private String getTag(DescribeTagsResult tagsResult, String tagName) {
for (TagDescription tag : tagsResult.getTags()) {
if (tag.getKey().equals(tagName)) return tag.getValue(); |
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|><|fim▁hole|><|fim▁end|> | from .user import User
from .phone_certificate import PhoneCertificate |
<|file_name|>store.js<|end_file_name|><|fim▁begin|>'use strict';
const Sites = require('./reducers/sites-list');
const Site = require('./reducers/site-form');
const User = require('./reducers/user');
const Delete = require('./reducers/delete');
const Count = require('./reducers/count');
const Redux = require('redux');... | |
<|file_name|>urls.py<|end_file_name|><|fim▁begin|>from django.conf.urls import patterns, include, url
from django.contrib import admin
urlpatterns = patterns(
'',
# Examples:
# url(r'^$', 'chatter.views.home', name='home'),
# url(r'^blog/', include('blog.urls')),
url(r'', include('chatter.base.url... | # https://docs.djangoproject.com/en/1.7/topics/auth/default/#module-django.contrib.auth.views
urlpatterns += patterns( |
<|file_name|>modals.js<|end_file_name|><|fim▁begin|>Element.prototype.remove = function() {
this.parentElement.removeChild(this);<|fim▁hole|>}
const addIcon = (icon) => `<i class="fa fa-${icon}"></i>`
const headerTxt = (type) => {
switch (type) {
case 'error':
return `${addIcon('ban')} Err... | |
<|file_name|>virtualmachineruncommands.go<|end_file_name|><|fim▁begin|>package compute
// Copyright (c) Microsoft and contributors. 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... | }
result, err = client.GetResponder(resp)
if err != nil { |
<|file_name|>estimator_test.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.ap... | self._export_dir_base = tempfile.mkdtemp() + "export/"
gfile.MkDir(self._export_dir_base)
def testFitAndEvaluateDontThrowException(self): |
<|file_name|>Shape.cpp<|end_file_name|><|fim▁begin|><|fim▁hole|>#include "DynBase.h"
//#include <iostream>
using std::cout;
using std::endl;
Shape::~Shape()
{
cout << "~Shape ..." << endl;
}
void Circle::Draw()
{
cout << "Circle::Draw() ..." << endl;
}
Circle::~Circle()
{
cout << "~Circle ..." << endl;
}
void S... | #include "Shape.h" |
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-<|fim▁hole|># OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General ... | ##############################################################################
# |
<|file_name|>j-lang304.cpp<|end_file_name|><|fim▁begin|>#include <fcntl.h>
#include <sys/stat.h>
#include <sys/types.h>
#include <unistd.h>
#include <string>
#include <iostream>
#include <dirent.h>
#include <cstring>
#include <errno.h>
#include <attr/xattr.h>
#include "../BaseTestCase.h"
#include "../../user_tools/api... | virtual int setup() override {
test_path = mnt_dir_ ;
A_path = mnt_dir_ + "/A"; |
<|file_name|>session.js<|end_file_name|><|fim▁begin|>//////////////////////////////////////////////////////////////////////////
// //
// This is a generated file. You can view the original //
// source in your browser if your browser ... | * [reactive computation](#reactivity), invalidate the computation the next // 45 |
<|file_name|>PersianaSuiteAbrirCommand.java<|end_file_name|><|fim▁begin|>package br.com.command.comandos;
import br.com.command.interfaces.Command;
import br.com.command.modelos.PersianaSuite;
/**
* Created by danielmarcoto on 17/11/15.
*/
public class PersianaSuiteAbrirCommand implements Command {
private Pers... | |
<|file_name|>nginx.py<|end_file_name|><|fim▁begin|>"""
fabcloudkit
Functions for managing Nginx.
This module provides functions that check for installation, install, and manage an
installation of, Nginx.
/etc/init.d/nginx:
The "init-script" that allows Nginx to be run automatically at sys... | |
<|file_name|>totalDomain.js<|end_file_name|><|fim▁begin|>define([],function(){
var config = {};
config.title="Domain Totals Report";
var backColor = '#ffffff';
var axisColor = '#3e3e3e';
var gridlinesColor = '#000000';
var axisTitleColor = '#333333';
var color1 = '#4BACC6';
<|fim▁hole|> var color6 = '#8aa... | var color2 = '#8064A2';
var color3 = '#eda637';
var color4 = '#a7a737';
var color5 = '#86aa65';
|
<|file_name|>importing_modules.py<|end_file_name|><|fim▁begin|>#! /usr/bin/env python3
<|fim▁hole|>#
# Author: Billy Wilson Arante
# Created: 2/24/2016 PHT
#
import fibo
def test():
"""Test cases."""
print('Example 1:')
fibo.fib(1000)
print('Example 2:')
print(fibo.fib1(1000))
print('Ex... | #
# importing_modules.py |
<|file_name|>db_utils.py<|end_file_name|><|fim▁begin|>import os
import MySQLdb
import logging
_log = logging.getLogger('thanatos')
def execute_sql(sql, db_connection, fetch='all'):
"""
:param sql:
:param db_connection:
:param fetch: A string of either 'all' or 'one'.
:return:
"""
curso... |
for proc_file_name in os.listdir(procs_dir_path): |
<|file_name|>index.d.ts<|end_file_name|><|fim▁begin|>// Type definitions for Chance 1.0.16
// Project: http://chancejs.com
// Definitions by: Chris Bowdon <https://github.com/cbowdon>
// Brice BERNARD <https://github.com/brikou>
// Carlos Sanchez <https://github.com/cafesanu>
// Definiti... | utc: string[];
} |
<|file_name|>reduce_high_energy_samples.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
"""
Reduce samples that have too high energies by comparing
between the same group of samples.
The group is defined according to the name of directory before the last 5 digits.
For example, the directory `smpl_XX_YYYYYY_#####`... | |
<|file_name|>movies.py<|end_file_name|><|fim▁begin|># title
# storyline
def show_trailer(title, youtube_url):
# Open browser and play trailer
def show_info():<|fim▁hole|><|fim▁end|> | # Print movie information |
<|file_name|>rosbridge_udp.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
# Software License Agreement (BSD License)
#
# Copyright (c) 2012, Willow Garage, Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following ... | RosbridgeUdpSocket.fragment_timeout = int(sys.argv[idx]) |
<|file_name|>test_mongodb.py<|end_file_name|><|fim▁begin|># lint-amnesty, pylint: disable=missing-module-docstring
from unittest.mock import patch
from django.test import TestCase
from common.djangoapps.track.backends.mongodb import MongoBackend
class TestMongoBackend(TestCase): # lint-amnesty, pylint: disable=mis... | assert len(calls) == 2 |
<|file_name|>331_test_re.py<|end_file_name|><|fim▁begin|>from test.support import verbose, run_unittest, gc_collect, bigmemtest, _2G, \
cpython_only
import io
import re
from re import Scanner
import sys
import string
import traceback
from weakref import proxy
# Misc tests from Tim Peters' re.doc
# WARNING: Do... | self.assertIsNotNone(re.match(r"[\u%04xz]" % i, chr(i)))
self.assertIsNotNone(re.match(r"[\U%08x]" % i, chr(i))) |
<|file_name|>loader.js<|end_file_name|><|fim▁begin|>/*********************************************************************************
* File Name : loader.js
* Created By : Jone Casper(xu.chenhui@live.com)
* Creation Date : [2014-03-25 22:14]
* Last Modified ... | }
}(this, "backchart.base.loader",function(){
var root = this;
var exports = function(name, callback){ |
<|file_name|>collision.py<|end_file_name|><|fim▁begin|><|fim▁hole|>Pixel perfect collision algorithm
From http://www.pygame.org/wiki/FastPixelPerfect?parent=CookBook
"""
import pygame
def pixel_perfect_check_collision(obj1, obj2):
image_mask = pygame.mask.from_surface(obj1.image)
otherimage_mask = pygame.mask... | """ |
<|file_name|>MutableChildIteratorTest.java<|end_file_name|><|fim▁begin|>package com.mattunderscore.trees.base;
import static org.junit.Assert.*;
import static org.mockito.Mockito.verify;
import static org.mockito.MockitoAnnotations.initMocks;
import java.util.Iterator;
import java.util.NoSuchElementException;
import... | @Test(expected = NoSuchElementException.class)
public void next() { |
<|file_name|>server.rs<|end_file_name|><|fim▁begin|>#![feature(net)]
#![feature(io)]
use std::io::Read;
use std::net::{TcpListener, TcpStream};
use std::thread;
fn handle_client(mut stream: TcpStream) {
let mut buf = vec![0, 0, 0];
stream.read(&mut buf);
println!("Read!!");
}
fn main() {
let liste... | |
<|file_name|>getat_func.rs<|end_file_name|><|fim▁begin|>//! # getat_func
//!
//! Split function which returns only the requested item from the created array.
//!
#[cfg(test)]
#[path = "getat_func_test.rs"]
mod getat_func_test;
use envmnt;
pub(crate) fn invoke(function_args: &Vec<String>) -> Vec<String> {
if func... | |
<|file_name|>global-position-strategy.d.ts<|end_file_name|><|fim▁begin|>/**
* @license
* Copyright Google LLC All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.io/license
*/
import { PositionStrategy } from './position-s... | */
centerVertically(offset?: string): this;
/**
* Apply the position to the element. |
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|>"""The StarLine component."""
import voluptuous as vol
from homeassistant.config_entries import ConfigEntry
from homeassistant.core import Config, HomeAssistant
from homeassistant.exceptions import ConfigEntryNotReady
from .account import StarlineAccount
from .cons... | |
<|file_name|>empty.rs<|end_file_name|><|fim▁begin|>/// Handle empty command<|fim▁hole|>}<|fim▁end|> | pub fn cmd_empty() -> bool {
true |
<|file_name|>array-utils.js<|end_file_name|><|fim▁begin|>"use strict";
var mathUtils = require("./math-utils");
exports.shuffle = function(array) {
var len = array.length;
for ( var i=0; i<len; i++ ) {
var rand = mathUtils.randomInt(0,len-1);
var temp = array[i];
array[i] = array[ran... | |
<|file_name|>device.controller.ts<|end_file_name|><|fim▁begin|>/// <reference path="../_references.ts"/>
namespace demo.device {
'use strict';
interface IDeviceViewModel {
available:boolean;
cordova:string;
model:string;
platform:string;
uuid:string;
version:string;
}
... | };
});
} |
<|file_name|>core.py<|end_file_name|><|fim▁begin|># Licensed to the StackStorm, Inc ('StackStorm') under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License,... | |
<|file_name|>meson_post_install.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python3
import os
import pathlib
import sysconfig
import compileall
import subprocess
prefix = pathlib.Path(os.environ.get('MESON_INSTALL_PREFIX', '/usr/local'))
datadir = prefix / 'share'
destdir = os.environ.get('DESTDIR', '')<|fim▁hole|... |
if not destdir:
print('Compiling gsettings schemas...') |
<|file_name|>literals.rs<|end_file_name|><|fim▁begin|>use common;
use ast;
use io;
pub fn parse_integer(source: &mut io::SourceFlexIterator) -> common::Status<ast::Token> {
assert!(source.peek(0).is_some());
assert!(match source.peek(0).unwrap() {
'0'...'9' => true,
_ => false,
});
le... | |
<|file_name|>flow_management.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
from flask import render_template, redirect, url_for, flash, abort
from purchasing.decorators import requires_roles
from purchasing.data.stages import Stage<|fim▁hole|>
from purchasing.conductor.manager import blueprint
@blueprint.r... | from purchasing.data.flows import Flow
from purchasing.conductor.forms import FlowForm, NewFlowForm |
<|file_name|>uuidtest.cpp<|end_file_name|><|fim▁begin|>/*
* LibrePCB - Professional EDA for everyone!
* Copyright (C) 2013 LibrePCB Developers, see AUTHORS.md for contributors.
* https://librepcb.org/
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General ... | // Test UUIDs are generated with:
// - https://www.uuidgenerator.net
// - https://uuidgenerator.org/ |
<|file_name|>mock_metrics_test.go<|end_file_name|><|fim▁begin|>package cache
import (
"github.com/stretchr/testify/mock"
)
// MockMetrics is an autogenerated mock type for the Metrics type
type MockMetrics struct {
mock.Mock
}
<|fim▁hole|>// Track provides a mock function with given fields: event
func (_m *MockMetr... | |
<|file_name|>span_id_deduper.go<|end_file_name|><|fim▁begin|>// Copyright (c) 2017 Uber Technologies, 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/lice... | maxSpanID = model.SpanID(0xffffffffffffffff)
) |
<|file_name|>customize26_27.py<|end_file_name|><|fim▁begin|># Copyright (c) 2019 2021 by Rocky Bernstein
#
# 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 License, or... | # vs. older:
# except <condition> , <var>
# |
<|file_name|>sleep.test.ts<|end_file_name|><|fim▁begin|>/**
* @license
* 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... | clock = useFakeTimers({ shouldAdvanceTime: true });
});
|
<|file_name|>ArtifactIsNotACollectionException.java<|end_file_name|><|fim▁begin|>/*
* (C) Johannes Kepler University Linz, Austria, 2005-2013
* Institute for Systems Engineering and Automation (SEA)
*
* The software may only be used for academic purposes (teaching, scientific
* research). Any redistribution or c... | * ArtifactIsNotACollectionException.java created on 13.03.2013
* |
<|file_name|>checksum.go<|end_file_name|><|fim▁begin|>package contenthash
import (
"bytes"
"context"
"crypto/sha256"
"io"
"os"
"path"
"path/filepath"
"sync"
"github.com/tiborvass/docker/pkg/idtools"
"github.com/tiborvass/docker/pkg/locker"
iradix "github.com/hashicorp/go-immutable-radix"
"github.com/hashi... | return false, nil
}
func (cc *cacheContext) scanPath(ctx context.Context, m *mount, p string) (retErr error) { |
<|file_name|>Dbg.java<|end_file_name|><|fim▁begin|>/*
* Created on 2005-09-27
* @author M.Olszewski
*/
package net.java.dante.algorithms.common;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.PrintStream;
import java.text.DateFormat;
import java.util.Calendar;
... | {
System.setOut(standardOut);
System.setErr(standardErr); |
<|file_name|>modify.rs<|end_file_name|><|fim▁begin|>use clap::ArgMatches;
use common::*;
use colored::*;
use io::*;
use libhupa::*;
/// Modify subcommand
pub fn modify_subcommand(mut hupas: Vec<Hupa>, config: &Config, sub_m: &ArgMatches) {
let hupas_to_modify = if let Some(hupas_names) = sub_m.values_of("hupa") {
... | }; |
<|file_name|>estimateintrons.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
import argparse
import os<|fim▁hole|>import sqlite3
from Bio import SeqIO, SeqRecord, Seq
from Bio.Align.Applications import ClustalwCommandline
from Bio.Blast import NCBIXML
from Bio.Blast.Applications import NcbiblastnCommandline as ... | |
<|file_name|>get_climate_data.py<|end_file_name|><|fim▁begin|>#---------------------------------
#Joseph Boyd - joseph.boyd@epfl.ch
#---------------------------------
from bs4 import BeautifulSoup
from urllib2 import urlopen
import csv
BASE_URL = 'http://www.tutiempo.net'
PAGE_1 = '/en/Climate/India/IN.html'
PAGE_2 =... |
for row in climate_rows[1:-2]:
data = row.findAll('td') |
<|file_name|>GC_compo_matching.py<|end_file_name|><|fim▁begin|>""" Module matching %GC compo distribution b/w fg and bg. """
<|fim▁hole|>from Bio import SeqIO
from utils import GC
def fg_GC_bins(fg_file):
"""
Compute G+C content for all sequences in the foreground.
It computes the %GC content and store t... |
import sys
import random |
<|file_name|>mod.rs<|end_file_name|><|fim▁begin|>#[allow(unused_imports)]
use test_env_log::test;
#[allow(unused_imports)]
use pact_matching::models::PactSpecification;<|fim▁hole|>#[allow(unused_imports)]
use expectest::prelude::*;
#[allow(unused_imports)]
use pact_matching::models::{Interaction, http_interaction_from_... | #[allow(unused_imports)]
use serde_json; |
<|file_name|>dispatcher.rs<|end_file_name|><|fim▁begin|>//! HTTP Service Dispatcher
use std::{io, net::SocketAddr, str::FromStr, sync::Arc};
use hyper::{
header::{GetAll, HeaderValue},
http::uri::{Authority, Scheme},
upgrade,
Body,
HeaderMap,
Method,
Request,
Response,
StatusCode,
... | proxy_client_cache: Arc<ProxyClientCache>,
}
impl HttpDispatcher { |
<|file_name|>help_info_extracter.py<|end_file_name|><|fim▁begin|># Copyright 2015 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
from __future__ import annotations
import dataclasses
import inspect
import json
from dataclasses import dataclass
from en... | consumed_scopes_mapper: ConsumedScopesMapper, |
<|file_name|>km3pipe_notebook.py<|end_file_name|><|fim▁begin|>from ..style import use
<|fim▁hole|><|fim▁end|> | use("km3pipe-notebook") |
<|file_name|>ParameterPosition.java<|end_file_name|><|fim▁begin|>//=============================================================================
/*
$Id: ParameterPosition.java,v 1.2 2002/10/25 14:01:41 taq Exp $
*/
//=============================================================================
package ORG.as220.tinySQL... | { |
<|file_name|>route_segs.py<|end_file_name|><|fim▁begin|>"""A module for handling and accessing both the in-memory, and on-disk,
representation of a set of routes as a set of segments. Where each segment
specifies its start and end stop ids, and other data (see
topology_shapefile_data_model.py for more."""
import sys
i... | # I/O from route definition CSV
# Old (Pre 15 Oct 2014) headers of route_defs.csv |
<|file_name|>product.py<|end_file_name|><|fim▁begin|>from .commutative import Commutative
class Product(Commutative):
def __init__(self, *args):
super(Product, self).__init__(*self.simplified(*args))
def simplified(self, *args):
"""
Returns a sequence containing expressions that make a... | |
<|file_name|>setup.py<|end_file_name|><|fim▁begin|>import os
import re
import codecs
from setuptools import setup, find_packages
def read(*parts):
filename = os.path.join(os.path.dirname(__file__), *parts)
with codecs.open(filename, encoding='utf-8') as fp:
return fp.read()<|fim▁hole|>
def find_versi... | |
<|file_name|>rpca.py<|end_file_name|><|fim▁begin|>from ex import *
from ex.alg.common import svdex
def RPCA(D, lam = None, tol = 1e-7, maxIter = 500):<|fim▁hole|>
m, n = D.shape
maxmn, minmn = (max(m, n), min(m, n))
lam = float(lam) if lam is not None else 1.0
log.info('RPCA for %dx%d matrix. lambda = ... | '''Yi Ma's robust pca
return (L, SingularValues(L))
''' |
<|file_name|>test.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env finemonkeyrunner
# -*- coding:utf8 -*-
import sys
sys.path.append(r'D:\learning\python\auto\fineMonkeyRunner')
from com.fine.android.finemonkeyrunner import fineMonkeyRunner
# 导入包路径,否则找不到 ---注意
#sys.path.append(r'C:\Users\wangxu\AppData\Local\Android\sdk... | #finemonkeyrunner.forcestopapp('com.mdsd.wiicare') |
<|file_name|>EAttributeType.java<|end_file_name|><|fim▁begin|>package org.optimizationBenchmarking.evaluator.data.spec;
import java.lang.ref.SoftReference;
/**
* The storage type of
* {@link org.optimizationBenchmarking.evaluator.data.spec.Attribute
* attribute}. Attributes can be {@link #PERMANENTLY_STORED... | *
* @param o
* the unpacked object
|
<|file_name|>depends.js<|end_file_name|><|fim▁begin|>enyo.depends(
"source/VirtualSlidingPane.js",
"source/CanonSlidingView.js",<|fim▁hole|><|fim▁end|> | "source/CanonSliding.js"
); |
<|file_name|>app.routing.ts<|end_file_name|><|fim▁begin|>import { Routes, RouterModule } from '@angular/router';
import {HomeComponent} from "./home.component";
import {ProductDetailComponent} from "./product.detail.component";
const routes: Routes = [
{path: '', component: HomeComponent},
{path: 'products'... | |
<|file_name|>friend.js<|end_file_name|><|fim▁begin|><|fim▁hole|>const friendSchema = mongoose.Schema({
"id": Number,
"gender": String,
"firstName": String,
"lastName": String,
"email": String,
"ipAddress": String,
"job": String,
"company": String,
"birthDate": Date,
"latitude": String,
"longitude"... | import mongoose from 'mongoose';
|
<|file_name|>H2InMemoryManager.java<|end_file_name|><|fim▁begin|>/*
* Copyright (C) 2017 the original author or authors.
*
* This file is part of jBB Application Project.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* You may obtain a copy of the License at
* http://www.apache.org... |
dbProperties.setProperty(DbProperties.H2_IN_MEMORY_DB_NAME_KEY,
newProviderSettings.getDatabaseName());
} |
<|file_name|>assets.py<|end_file_name|><|fim▁begin|>import os
import logging
import decimal
import base64
import json
from datetime import datetime
from lib import config, util, util_bitcoin
ASSET_MAX_RETRY = 3
D = decimal.Decimal
def parse_issuance(db, message, cur_block_index, cur_block):
if message['status'] ... | logging.info("ExtendedAssetInfo: Skipping disabled asset %s" % asset['asset'])
continue
#may or may not end with .json. may or may not start with http:// or https:// |
<|file_name|>AppStore.ts<|end_file_name|><|fim▁begin|>import AppActions from "./RichAppActions";
import CarbonActions, { CarbonAction } from "./CarbonActions"
import { handles, CarbonStore, Dispatcher, dispatch } from './CarbonFlux';
import RichPanelConfig from './RichPanelConfig';
import LayoutActions from './layout/L... | |
<|file_name|>host_test_plugins.py<|end_file_name|><|fim▁begin|>#
# Copyright (c) 2021 Arm Limited and Contributors. All rights reserved.
# SPDX-License-Identifier: Apache-2.0
#
"""Base class for plugins."""
import os
import sys
import platform
from os import access, F_OK
from sys import stdout
from time import sleep
f... | self.print_plugin_char(".")
else:
self.print_plugin_error( |
<|file_name|>query_mediator.spec.js<|end_file_name|><|fim▁begin|>/**
* Created by rchyla on 3/31/14.
*/
define(['underscore', 'jquery', 'js/components/query_mediator', 'js/components/beehive',
'js/services/pubsub', 'js/services/api', 'js/components/generic_module',
'js/components/pubsub_key', 'js/com... | |
<|file_name|>AudioTrackListImp.cpp<|end_file_name|><|fim▁begin|>// Generated by esidl 0.3.0.
// This file is expected to be modified for the Web IDL interface
// implementation. Permission to use, copy, modify and distribute
// this file in any software license is hereby granted.
#include "AudioTrackListImp.h"
names... | namespace dom
{ |
<|file_name|>http.go<|end_file_name|><|fim▁begin|>package utils
import (
"io/ioutil"
"net/http"
"encoding/json"
"fmt"
"github.com/juju/errors"
)
// GetRequestBody reads request and returns bytes
func GetRequestBody(r *http.Request) ([]byte, error) {
body, err := ioutil.ReadAll(r.Body)
if err != nil {
retur... | func UnmarshalRequest(r *http.Request, v interface{}) error {
body, err := GetRequestBody(r)
if err != nil { |
<|file_name|>test_backend.py<|end_file_name|><|fim▁begin|>import json
import os
import subprocess
import uuid
import passlib.hash
import pytest
import gen
import gen.build_deploy.aws
import release
from dcos_installer import backend
from dcos_installer.config import Config, make_default_config_if_needed, to_config
o... | "master_list": 'Invalid IPv4 addresses in list: foo', |
<|file_name|>LGFileSubset.java<|end_file_name|><|fim▁begin|>/*******************************************************************************
JimmLangFileTool - Simple Java GUI for editing/comparing Jimm language files
Copyright (C) 2005 Jimm Project
This program is free software; you can redistribute it and/or
mo... | You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
<|file_name|>index.js<|end_file_name|><|fim▁begin|>'use strict';
<|fim▁hole|> Array.prototype.concat : require('./shim');<|fim▁end|> | module.exports = require('./is-implemented')() ? |
<|file_name|>theme.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
#
# Copyright (C) 2011 Sebastien Helleu <flashcode@flashtux.org>
#
# 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; eith... | if fg == 'default':
fg = self.options['fg']
if bg == 'default': |
<|file_name|>0011_auto_20170531_1426.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
# Generated by Django 1.11.1 on 2017-05-31 14:26
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):<|fim▁hole|>
dependencies = [
('news', '0010... | |
<|file_name|>InputExtraTimeDlg.cpp<|end_file_name|><|fim▁begin|>// InputExtraTimeDlg.cpp : implementation file
//
#include "stdafx.h"
#include "TimeM.h"
#include "InputExtraTimeDlg.h"
// CInputExtraTimeDlg dialog
IMPLEMENT_DYNAMIC(CInputExtraTimeDlg, CDialog)
CInputExtraTimeDlg::CInputExtraTimeDlg(CWnd* pParent /*... | |
<|file_name|>model.py<|end_file_name|><|fim▁begin|>import os
path = os.path.dirname(os.path.realpath(__file__))
sbmlFilePath = os.path.join(path, 'BIOMD0000000489.xml')
with open(sbmlFilePath,'r') as f:
sbmlString = f.read()
def module_exists(module_name):
try:
__import__(module_name)
except Impo... |
if module_exists('libsbml'):
import libsbml
sbml = libsbml.readSBMLFromString(sbmlString) |
<|file_name|>SplittingIce.tsx<|end_file_name|><|fim▁begin|>import React from 'react';
import SPELLS from 'common/SPELLS';
import Analyzer, { SELECTED_PLAYER, Options } from 'parser/core/Analyzer';
import Events, { CastEvent, DamageEvent } from 'parser/core/Events';
import Statistic from 'parser/ui/Statistic';
import ST... | SPELLS.ICE_LANCE_DAMAGE,
SPELLS.ICICLE_DAMAGE,
SPELLS.GLACIAL_SPIKE_DAMAGE,
SPELLS.EBONBOLT_DAMAGE, |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.