prompt large_stringlengths 70 991k | completion large_stringlengths 0 1.02k |
|---|---|
<|file_name|>setup.py<|end_file_name|><|fim▁begin|><|fim▁hole|>setup(name='mock_labels', version='0.0.1', packages=['mock_labels'])<|fim▁end|> | from setuptools import setup
|
<|file_name|>best-feats.py<|end_file_name|><|fim▁begin|>import sys
import os
import pandas as pd
from collections import defaultdict
import numpy as np
dirname = sys.argv[1]
path = os.path.join(dirname, "weights.tsv")
with open(path ,"r") as f:
df = pd.read_csv(f, sep="\t")
df = df[df["iter"] == 5]
fc2r = default... | for event, event_df in df.groupby("event"):
pos_df = event_df[event_df["class"] == "SELECT"] |
<|file_name|>validators.py<|end_file_name|><|fim▁begin|><|fim▁hole|>
class MultiFieldsValidator(object):
fields = ()
error_messages = {
'invalid' : _(u'Value is not valid.')
}
def raise_error(self, form, error="invalid"):
for field in self.fields:
form._errors[field... | # coding: utf-8
from django.utils.translation import ugettext_lazy as _ |
<|file_name|>tools_test.go<|end_file_name|><|fim▁begin|>package imaging
import (
"image"
"testing"
)
func TestCrop(t *testing.T) {
td := []struct {
desc string
src image.Image
r image.Rectangle
want *image.NRGBA
}{
{
"Crop 2x3 2x1",
&image.NRGBA{
Rect: image.Rect(-1, -1, 1, 2),
Strid... | Pix: []uint8{
0x00, 0x11, 0x22, 0x33, 0xcc, 0xdd, 0xee, 0xff, |
<|file_name|>brew.py<|end_file_name|><|fim▁begin|># encoding: utf-8
import os
import subprocess
import sys
from workflow import Workflow3 as Workflow, MATCH_SUBSTRING
from workflow.background import run_in_background
import brew_actions
import helpers
GITHUB_SLUG = 'fniephaus/alfred-homebrew'
def execute(wf, cmd_... | |
<|file_name|>media_tag.py<|end_file_name|><|fim▁begin|>import enum
from typing import Dict, Optional, Set
@enum.unique
class MediaTag(enum.IntEnum):
# ndb keys are based on these! Don't change!
CHAIRMANS_VIDEO = 0
CHAIRMANS_PRESENTATION = 1
CHAIRMANS_ESSAY = 2
MEDIA_TAGS: Set[MediaTag] = {t for t in... | def get_enum_from_url(url_name: str) -> Optional[MediaTag]:
inversed = {v: k for k, v in TAG_URL_NAMES.items()}
if url_name in inversed: |
<|file_name|>event.rs<|end_file_name|><|fim▁begin|>//! Implementation of the top level `*Event` derive macro.
use proc_macro2::{Span, TokenStream};
use quote::{format_ident, quote};
use syn::{
parse_quote, Data, DataStruct, DeriveInput, Field, Fields, FieldsNamed, GenericParam, Meta,
MetaList, NestedMeta,
};
... | |
<|file_name|>config.py<|end_file_name|><|fim▁begin|>import os
class Config(object):
DEBUG = False<|fim▁hole|>
class ProductionConfig(Config):
DEBUG = False
SECRET_KEY = os.environ['SECRET_KEY']
class DevelopmentConfig(Config):
DEVELOPMENT = True
DEBUG = True
class TestingConfig(Config):
TESTI... | TESTING = False
CSRF_ENABLED = True
SECRET_KEY = "super_secret_key"
SQLALCHEMY_DATABASE_URI = os.environ['DATABASE_URL'] |
<|file_name|>index.js<|end_file_name|><|fim▁begin|>'use strict';
var path = require('path');
var generators = require('yeoman-generator');
var yaml = require('js-yaml');
var _ = require('lodash');
var chalk = require('chalk');
var GitHub = require('github');
module.exports = generators.Base.extend({
_logHeading:... | |
<|file_name|>main_raster.py<|end_file_name|><|fim▁begin|>import time
from PyQt4 import QtGui, QtCore, QtOpenGL
from PyQt4.QtOpenGL import QGLWidget
import OpenGL.GL as gl
import OpenGL.arrays.vbo as glvbo
import numpy as np
import raster
import slider
import draw_texture
import qt_helpers
raster_width = 1024
raster_... | if self.last_time is None: |
<|file_name|>GelfMessage.java<|end_file_name|><|fim▁begin|>/*Copyright (c) 2011 Anton Yakimov.
GELF created by Lennart Koopmann, Aleksey Palazhchenko.
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 Softw... | }
public boolean isValid() { |
<|file_name|>modal.js<|end_file_name|><|fim▁begin|>!function(namespace) {
'use strict';
function Modal(elem, params) {
this.$element = jQuery(elem);
this.params = params || {};
this.cssReadyElement = this.params.cssReadyElement || 'JS-Modal-ready';
this.cssActiveElement = this.params.cssActiveEleme... | Modal.prototype.close = function close() {
this._close();
};
|
<|file_name|>test_eslint.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
import logging
import re
import subprocess
from unittest import skipIf
from odoo import tools
from . import lint_case
RULES = ('{'
'"no-undef": "error",'... | |
<|file_name|>lti_module.py<|end_file_name|><|fim▁begin|>"""
Learning Tools Interoperability (LTI) module.
Resources
---------
Theoretical background and detailed specifications of LTI can be found on:
http://www.imsglobal.org/LTI/v1p1p1/ltiIMGv1p1p1.html
This module is based on the version 1.1.1 of the LTI spe... | |
<|file_name|>box.js<|end_file_name|><|fim▁begin|>/* eg: Box.show(div) */
var Box = {
show: function (id) {
var isIE = (document.all) ? true : false;
var isIE6 = isIE && ( [/MSIE (\d)\.0/i.exec(navigator.userAgent)][0][1] == 6);
var box = document.getElementById(id);
if (!box) {
... |
function box_iestyle() {
box.style.marginTop = document.documentElement.scrollTop
- box.offsetHeight / 2 + "px"; |
<|file_name|>listaccountpolicies.py<|end_file_name|><|fim▁begin|># Copyright 2009-2015 Eucalyptus Systems, Inc.
#
# Redistribution and use of this software in source and binary forms,
# with or without modification, are permitted provided that the following
# conditions are met:
#
# Redistributions of source code mus... | |
<|file_name|>Timers.cpp<|end_file_name|><|fim▁begin|>// Vaca - Visual Application Components Abstraction
// Copyright (c) 2005-2009 David Capello
//
// This file is distributed under the terms of the MIT license,
// please read LICENSE.txt for more information.
#include <vaca/vaca.h>
#include "../resource.h"
... | protected:
|
<|file_name|>model.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/. */
//! Borders, padding, and margins.
#![deny(unsafe_code)]
use ... | }
}
pub fn specified(length: LengthOrPercentage, containing_length: Au) -> Au { |
<|file_name|>tasks.py<|end_file_name|><|fim▁begin|>import os
from invoke import task
WHEELHOUSE_PATH = os.environ.get('WHEELHOUSE')
def monkey_patch(ctx):
# Force an older cacert.pem from certifi v2015.4.28, prevents an ssl failure w/ identity.api.rackspacecloud.com.
#
# SubjectAltNameWarning: Certifica... |
@task
def test(ctx, verbose=False, types=False): |
<|file_name|>tag.go<|end_file_name|><|fim▁begin|>package model
const (
// TypeUser .
TypeUser = int32(0) // 普通tag // TypeUser tag type
// TypeUpper .
TypeUpper = int32(1) // up主tag
// TypeOfficailCategory .
TypeOfficailCategory = int32(2) // 官方-分类tag
// TypeOfficailContent .
TypeOfficailContent = int32(3) // 官... |
// TnameMaxLen . |
<|file_name|>email_manager.py<|end_file_name|><|fim▁begin|>"""
EmailManager - a helper class to login, search for, and delete emails.
"""
import email
import htmlentitydefs
import imaplib
import quopri
import re
import time
import types
from seleniumbase.config import settings
class EmailManager:
""" A helper cl... | |
<|file_name|>build.go<|end_file_name|><|fim▁begin|>package client
import (
"archive/tar"
"bufio"
"encoding/base64"
"encoding/json"
"fmt"
"io"
"io/ioutil"
"net/http"
"net/url"
"os"
"os/exec"
"path"
"path/filepath"
"regexp"
"runtime"
"strconv"
"strings"
"github.com/docker/docker/api"
Cli "github.com/... | }
|
<|file_name|>ngram-process.js<|end_file_name|><|fim▁begin|>"use strict";
var filters = require('./filters'),
uniq = require('uniq');
var doNgram = function doNgram (string, resultData, config) {
var ngramCount = string.length - config.n + 1,
ngram,
previousNgram = null,
ngramData,
... | var resultConfig = {
name: config.name,
n: config.n,
minLength: config.minLength, |
<|file_name|>0031_auto_20170601_1502.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
# Generated by Django 1.10.6 on 2017-06-01 12:02
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('website', '0030_github_... | model_name='linkedin_user',
name='number_repos3', |
<|file_name|>borrowed-struct.rs<|end_file_name|><|fim▁begin|>// Copyright 2013-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.apach... | // lldb-check:[...]$4 = SomeStruct { x: 13, y: 26.5 }
// lldb-command:print *unique_val_interior_ref_1 |
<|file_name|>main.rs<|end_file_name|><|fim▁begin|>extern crate git2;
extern crate chrono;
#[macro_use]
extern crate serde_derive;
extern crate docopt;
extern crate core;
extern crate regex;
#[macro_use]
extern crate prettytable;
#[cfg(test)] extern crate tempdir;
use docopt::Docopt;
mod snapshot;
mod heatmap;
mod mai... | }
} |
<|file_name|>_feature_agglomeration.py<|end_file_name|><|fim▁begin|>"""
Feature agglomeration. Base classes and functions for performing feature
agglomeration.
"""
# Author: V. Michel, A. Gramfort
# License: BSD 3 clause
import numpy as np
from ..base import TransformerMixin
from ..utils import array2d
############... | X = np.zeros([self.labels_.shape[0]])
else:
X = np.zeros([Xred.shape[0], self.labels_.shape[0]])
unil = np.unique(self.labels_) |
<|file_name|>matcher.spec.js<|end_file_name|><|fim▁begin|>const matcher = require('../lib/matcher');
describe('Matcher', () => {
describe('path', () => {
let mock;
let request;
beforeEach(() => {
mock = {
request: {
path: '/test'
}
};
request = {
originalUrl: '/test?blah=test',
... | beforeEach(() => {
mock = {
request: { |
<|file_name|>test_rules.py<|end_file_name|><|fim▁begin|>import unittest
import os.path
import numpy as np
import pandas as pd
from pandas.util.testing import assert_frame_equal
import test_helper
import copy
from operator import lt, le, eq, ne, ge, gt
from pandas.core.index import Index
__index_symbol__ = {
Index... | |
<|file_name|>models.py<|end_file_name|><|fim▁begin|>from __future__ import unicode_literals
import datetime
from boto.ec2.elb.attributes import (
LbAttributes,
ConnectionSettingAttribute,
ConnectionDrainingAttribute,
AccessLogAttribute,
CrossZoneLoadBalancingAttribute,
)
from boto.ec2.elb.policies ... | |
<|file_name|>PublishClusterStateActionTests.java<|end_file_name|><|fim▁begin|>/*
* Licensed to Elasticsearch under one or more contributor
* license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright
* ownership. Elasticsearch licenses this file to you under
... | settings.put(DiscoverySettings.COMMIT_TIMEOUT_SETTING.getKey(), expectingToCommit == false && timeOutNodes > 0 ? "100ms" : "1h") |
<|file_name|>LinesDemo.java<|end_file_name|><|fim▁begin|>import com.jogamp.opengl.*;
import com.jogamp.opengl.awt.GLJPanel;
import com.jogamp.opengl.fixedfunc.GLMatrixFunc;
import com.jogamp.opengl.glu.GLU;
import javax.swing.*;
import java.awt.event.KeyEvent;
import java.awt.event.KeyListener;
import static com.joga... | GLCapabilities caps = new GLCapabilities(null);
// |
<|file_name|>TestServerInterface.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
# -*- coding: utf-8 -*-
# -------------------------------------------------------------------
# Copyright (c) 2010-2019 Denis Machard
# This file is part of the extensive automation project
#
# This library is free software; you can... | Logger.ClassLogger.trace(self, txt=txt)
|
<|file_name|>test_authentication.py<|end_file_name|><|fim▁begin|>import pytest
from flask_httpauth import HTTPBasicAuth
from kapsi_git_manager.kgm import app
from kapsi_git_manager import authentication as auth
password = "password"
username = "username"
<|fim▁hole|>
def test_verify_correct_password():
""" wit... | def test_auth_simple():
""" this is the idiot test to check whether anything in you auth system works. """
assert isinstance(auth.auth, HTTPBasicAuth)
|
<|file_name|>DefaultValidatorRegistry.java<|end_file_name|><|fim▁begin|>/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file t... | @Override
public boolean isDynamic(DataType type) {
return isDynamic(new ValidatorKey(type));
} |
<|file_name|>listers.go<|end_file_name|><|fim▁begin|>/*
Copyright 2018 The Knative Authors
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless req... | |
<|file_name|>plot_blob.py<|end_file_name|><|fim▁begin|>"""
==============
Blob Detection
==============
Blobs are bright on dark or dark on bright regions in an image. In
this example, blobs are detected using 3 algorithms. The image used
in this case is the Hubble eXtreme Deep Field. Each bright dot in the
image is a... |
blobs_list = [blobs_log, blobs_dog, blobs_doh]
colors = ['yellow', 'lime', 'red']
titles = ['Laplacian of Gaussian', 'Difference of Gaussian', |
<|file_name|>load_more.py<|end_file_name|><|fim▁begin|>def action_comment_load_more(context, action, entity_type, entity_id, last_id, parent_id, **args):
try:
entity = IN.entitier.load_single(entity_type, int(entity_id))
if not entity:
return
output = Object()
db = IN.db
connection = db.connection
... | |
<|file_name|>read_only.py<|end_file_name|><|fim▁begin|># Copyright 2014 PressLabs SRL
#
# 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
#
# Unl... | |
<|file_name|>models.py<|end_file_name|><|fim▁begin|><|fim▁hole|><|fim▁end|> | """Must be kept even empty. That makes a Django app.""" |
<|file_name|>ex13.py<|end_file_name|><|fim▁begin|>####
#Importing modules can serve 3 purposes if done right
#1-Allows you to add features to bare bones python
#2-Only importing what you need lets your imports serve as documentation for
# someone else reading your code later.
#3-By forcing you to import things, python... | print "Your third variable was ", third
print "Your first variable was ", first |
<|file_name|>SqlDataType.java<|end_file_name|><|fim▁begin|>/* Copyright 2018 Google LLC
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
... |
public enum SqlDataType { |
<|file_name|>user_config.py<|end_file_name|><|fim▁begin|>from cobra.core.loading import get_model
from cobra.core import json
class UserConfig(object):
default_config = {
'guide.task.participant': '1',<|fim▁hole|> 'order.task.search': 'default',
'order.task.searchDirection': 'DESC',
... | 'guide.document.share': '1',
'guide.customer.share': '1',
'guide.workflow.operation': '1',
'guide.workflow.createform': '1', |
<|file_name|>nontransitive_dice.py<|end_file_name|><|fim▁begin|># Copyright 2010 Hakan Kjellerstrand hakank@bonetmail.com
#
# 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... | gap_sum = solver.IntVar(0, m * n * n, "gap_sum")
|
<|file_name|>base.py<|end_file_name|><|fim▁begin|>import os
from unipath import Path
from django.core.exceptions import ImproperlyConfigured
import dj_database_url
def env_var(var_name):
"""Get the environment variable var_name or return an exception."""
try:
return os.environ[var_name]
except Ke... | DATABASES['default']['ATOMIC_REQUESTS'] = True
|
<|file_name|>VisualFunctionContact.java<|end_file_name|><|fim▁begin|>package org.workcraft.plugins.circuit;
import org.workcraft.annotations.DisplayName;
import org.workcraft.annotations.Hotkey;
import org.workcraft.annotations.SVGIcon;
import org.workcraft.dom.Node;
import org.workcraft.dom.visual.BoundingBoxHelper;
... |
@DisplayName("Input/output port") |
<|file_name|>text-element-view.component.ts<|end_file_name|><|fim▁begin|>import { Component, OnInit, Output, Input, EventEmitter } from '@angular/core';
@Component({
selector: 'fcl-text-element-view',
templateUrl: './text-element-view.component.html',
styleUrls: ['./text-element-view.component.scss']
})
ex... | } |
<|file_name|>parser.rs<|end_file_name|><|fim▁begin|>use nom::{be_u16, be_u32, be_u8, Err, ErrorKind};
use attribute_info::types::StackMapFrame::*;
use attribute_info::*;
pub fn attribute_parser(input: &[u8]) -> Result<(&[u8], AttributeInfo), Err<&[u8]>> {
do_parse!(
input,
attribute_name_index: be... | fn verification_type_parser(input: &[u8]) -> Result<(&[u8], VerificationTypeInfo), Err<&[u8]>> {
match verification_type(input[0]) {
Some(x) => Result::Ok((&input[1..], x)), |
<|file_name|>jquery.lazyloadxt.extra.min.js<|end_file_name|><|fim▁begin|>version https://git-lfs.github.com/spec/v1<|fim▁hole|><|fim▁end|> | oid sha256:b1b66ad7cf63a081650856aed61fbfdf1b6b511e47c622989e9927e504424a5d
size 2493 |
<|file_name|>options.go<|end_file_name|><|fim▁begin|>/*
Copyright 2017 The Kubernetes Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless... | }
}
return o.TPROptions.Keyer.Key
} |
<|file_name|>bound-single-question-mark.rs<|end_file_name|><|fim▁begin|>// Copyright 2017 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|>// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
// <L... | // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or |
<|file_name|>CommandManager.ts<|end_file_name|><|fim▁begin|>import { CommandManager } from "./../../browser/src/Services/CommandManager"
export const mockRegisterCommands = jest.fn()<|fim▁hole|>export default MockCommands<|fim▁end|> | const MockCommands = jest.fn<CommandManager>().mockImplementation(() => ({
registerCommand: mockRegisterCommands,
}))
|
<|file_name|>distributions.py<|end_file_name|><|fim▁begin|>identity = {
# https://www.census.gov/prod/cen2010/briefs/c2010br-03.pdf
'sex': [('M',49.2),('F',50.8)],
# https://en.wikipedia.org/wiki/Race_and_ethnicity_in_the_United_States
'race': [('O',72.4),('U',12.6)]
}
iq = {
# Class: (mu, sigma)
... | 'F': (101.41, 13.55), |
<|file_name|>time.hh<|end_file_name|><|fim▁begin|>#pragma once
#include <cstdint>
#include <cstddef>
#include <ctime>
#include <stdexcept>
#include <unistd.h>
#include <sys/time.h>
#ifdef __MACH__
# include <mach/mach.h>
# include <mach/clock.h>
#endif
#ifndef CLOCK_MONOTONIC_COARSE
# define CLOCK_MONOTONIC_COARSE... | |
<|file_name|>_locationssrc.py<|end_file_name|><|fim▁begin|>import _plotly_utils.basevalidators
class LocationssrcValidator(_plotly_utils.basevalidators.SrcValidator):
def __init__(self, plotly_name="locationssrc", parent_name="choropleth", **kwargs):<|fim▁hole|> edit_type=kwargs.pop("edit_type", "none"... | super(LocationssrcValidator, self).__init__(
plotly_name=plotly_name,
parent_name=parent_name, |
<|file_name|>pickCells.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()
ren1 = vtk.vtkRenderer()
renWin = vtk.vtkRenderWindow()
renWin.AddRenderer(ren1)
iren = vtk.vtkRenderWindowInteractor()
iren.Set... | aTetraActor.GetProperty().SetDiffuseColor(0,1,0) |
<|file_name|>settings.py<|end_file_name|><|fim▁begin|>"""
Django settings for djangoApp project.
Generated by 'django-admin startproject' using Django 1.10.5.
For more information on this file, see
https://docs.djangoproject.com/en/1.10/topics/settings/
For the full list of settings and their values, see
https://doc... | USE_TZ = True
# Static files (CSS, JavaScript, Images) |
<|file_name|>manage.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
# Copyright 2015 Netflix, 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... | """
Seed the database with some inital values
""" |
<|file_name|>fileops.rs<|end_file_name|><|fim▁begin|>//! Contains operations related to the /dev/ipath character files.<|fim▁hole|>use std::ffi::CString;
use libc::c_int;
use std::os::unix::io::{RawFd, AsRawFd};
use std::ops::Drop;
use std::io::Error;
pub struct Fd(RawFd);
impl Fd {
pub fn open<T: Into<String>>(pat... |
extern crate libc;
|
<|file_name|>test.go<|end_file_name|><|fim▁begin|>package main
import (
"log"
"time"
"dwmb/comm"
"dwmb/display"
"dwmb/request"
"dwmb/rfid"
"dwmb/sound"
)
func quickMessage(messages chan<- *comm.DisplayMessage, text string) {
messages <- &comm.DisplayMessage{Message: text}
}
func processResponse(messages cha... |
sound := sound.NewSound("./sounds") |
<|file_name|>ClientListComponent.js<|end_file_name|><|fim▁begin|>import React from 'react';
import _ from 'lodash';
import moment from 'moment';
import ClientListFilterComponent from './ClientListFilterComponent';
import ClientListItemComponent from './ClientListItemComponent';
<|fim▁hole|>class ClientListComponent ext... | |
<|file_name|>singlebyte.rs<|end_file_name|><|fim▁begin|>// This is a part of rust-encoding.
// Copyright (c) 2013-2015, Kang Seonghoon.
// See README.md and LICENSE.txt for details.
//! Common codec implementation for single-byte encodings.
use libtww::std::convert::Into;
use util::{as_char, StrCharIndex};
use types:... | |
<|file_name|>main.js<|end_file_name|><|fim▁begin|>import qambi, {
getMIDIInputs
} from 'qambi'
document.addEventListener('DOMContentLoaded', function(){
console.time('loading and parsing assets took')
qambi.init({
song: {
type: 'Song',
url: '../data/minute_waltz.mid'
},
piano: {
t... | track.monitor = true |
<|file_name|>keybinding-vscode.js<|end_file_name|><|fim▁begin|>ace.define("ace/keyboard/vscode",[], function(require, exports, module) {
"use strict";
var HashHandler = require("../keyboard/hash_handler").HashHandler;
var config = require("../config");
exports.handler = new HashHandler();
exports.handler.$id = "ace/k... | }, {
bindKey: {mac: "Shift-F8|Shift-Option-F8", win: "Shift-F8|Shift-Alt-F8"}, |
<|file_name|>test_add_product_to_cart_request.py<|end_file_name|><|fim▁begin|># coding: utf-8
"""
Server API
Reference for Server API (REST/Json)
OpenAPI spec version: 2.0.6
Generated by: https://github.com/swagger-api/swagger-codegen.git<|fim▁hole|>"""
from __future__ import absolute_import
... | |
<|file_name|>ethernet.py<|end_file_name|><|fim▁begin|>#===============================================================================
# Copyright 2012 NetApp, Inc. All Rights Reserved,
# contribution by Jorge Mora <mora@netapp.com>
#
# This program is free software; you can redistribute it and/or modify it under
# the... | __version__ = "1.1"
|
<|file_name|>Drawer.component.tsx<|end_file_name|><|fim▁begin|>import React from 'react';
import { Disclosure, DisclosureContent, useDisclosureState } from 'reakit';
import { ButtonComponentType } from '../Button';
import * as S from './Drawer.style';
import { ButtonProps } from '../Button/Button';
export type Drawer... | },
); |
<|file_name|>glproc.py<|end_file_name|><|fim▁begin|>##########################################################################
#
# Copyright 2010 VMware, Inc.
# All Rights Reserved.
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (th... | |
<|file_name|>configuration-inspector-chart-manager-container.component.ts<|end_file_name|><|fim▁begin|>import { Component, OnInit } from '@angular/core';
import { Subject } from 'rxjs';
import { takeUntil } from 'rxjs/operators';
import { Actions } from 'app/shared/store';
import { StoreHelperService } from 'app/share... | ) {} |
<|file_name|>uuid.pb.go<|end_file_name|><|fim▁begin|>// Code generated by protoc-gen-gogo.
// source: uuid.proto
// DO NOT EDIT!
package events
import proto "github.com/gogo/protobuf/proto"
import math "math"
// discarding unused import gogoproto "github.com/gogo/protobuf/gogoproto/gogo.pb"
import io "io"
import fm... | wire |= (uint64(b) & 0x7F) << shift
if b < 0x80 {
break |
<|file_name|>mod.rs<|end_file_name|><|fim▁begin|>// Copyright (c) The Diem Core Contributors<|fim▁hole|><|fim▁end|> | // SPDX-License-Identifier: Apache-2.0
pub mod mock_vm_validator; |
<|file_name|>field_checkbox.js<|end_file_name|><|fim▁begin|>/**
* @license
* Copyright 2012 Google LLC
* SPDX-License-Identifier: Apache-2.0
*/
/**
* @fileoverview Checkbox field. Checked or not checked.
* @author fraser@google.com (Neil Fraser)
*/
'use strict';
goog.provide('Blockly.FieldCheckbox');
/** @su... | |
<|file_name|>set_mana.rs<|end_file_name|><|fim▁begin|>use rune_vm::Rune;
use rustc_serialize::json;
use game_state::GameState;
use minion_card::UID;
use hlua;
#[derive(RustcDecodable, RustcEncodable, Clone, Debug)]
pub struct SetMana {
controller_uid: UID,
mana: u8,
}
implement_for_lua!(SetMana, |mut _metata... | SetMana { |
<|file_name|>urls.py<|end_file_name|><|fim▁begin|><|fim▁hole|>
from django.conf import settings
from django.conf.urls import patterns, url
from ..profile_images.views import ProfileImageView
from .accounts.views import AccountDeactivationView, AccountViewSet
from .preferences.views import PreferencesView, PreferencesD... | """
Defines the URL routes for this app.
""" |
<|file_name|>checkout.js<|end_file_name|><|fim▁begin|>'use strict';
angular.module('shopnxApp')
.config(function ($stateProvider) {
$stateProvider
.state('checkout', {
title: 'Checkout with the items you selected',
url: '/checkout',<|fim▁hole|> });
});<|fim▁end|> | templateUrl: 'app/checkout/checkout.html',
controller: 'CheckoutCtrl',
authenticate: true |
<|file_name|>models.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
from django.db import models
from datetime import datetime
class Place(models.Model):
"""
Holder object for basic info about the rooms
in the university.
"""
room_place = models.CharField(max_length=255)
floor = model... | |
<|file_name|>app.po.ts<|end_file_name|><|fim▁begin|>import { browser, by, element, promise, Key } from 'protractor';
export class AppPage {
navigateTo(): Promise<unknown> {
return browser.get(browser.baseUrl) as Promise<unknown>;
}
getTextareaCount(): promise.Promise<number> {
return element.all(by.css(... | return element.all(by.css(`app-root textarea`)).get(index).getSize().then(size => size.height);
}
setTextareaValue(index: number, value: string): void { |
<|file_name|>zhuyin_table.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
#
# zhuyin_table.py
# cjktools
#
"""
An interface to the zhuyin <-> pinyin table.
"""
from functools import partial
from . import cjkdata
from cjktools.common import get_stream_context, stream_codec
def _default_stream():
retur... | # Sort from longest to shortest, so as to make maximum matches whenever
# possible.
all_pinyin = sorted(all_pinyin, key=len, reverse=True)
|
<|file_name|>sensor_data.rs<|end_file_name|><|fim▁begin|>use std::{
fmt::{self, Display},
io,
time::{Duration, SystemTime, UNIX_EPOCH},
};
use crate::{average::Average, json_display::JsonDisplay, sensors::Sensor};
macro_rules! convTimeEpochDuration {
($systemtime:expr) => {
$systemtime
... | bmp280_pressure: (cumulated_data.bmp280_pressure / nb_elements as f64) as f32,
bmp280_temperature: (cumulated_data.bmp280_temperature / nb_elements as i64) as i32, |
<|file_name|>3b0d1321079e_.py<|end_file_name|><|fim▁begin|>"""Add replies column
Revision ID: 3b0d1321079e
Revises: 1e2d77a2f0c4
Create Date: 2021-11-03 23:32:15.720557
"""
from alembic import op
import sqlalchemy as sa
import sqlalchemy_utils
from sqlalchemy.dialects import postgresql
# revision identifiers, used b... | depends_on = None
|
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|># Copyright 2012 Leonidas Poulopoulos
#<|fim▁hole|># You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on a... | # Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License. |
<|file_name|>test_mq.rs<|end_file_name|><|fim▁begin|>use libc::c_long;
use std::ffi::CString;
use std::str;
use nix::errno::Errno::*;
use nix::Error::Sys;
use nix::mqueue::{mq_open, mq_close, mq_send, mq_receive, mq_getattr, mq_setattr, mq_unlink, mq_set_nonblock, mq_remove_nonblock};
use nix::mqueue::{MqAttr, MQ_OFl... |
let res_unlink = mq_unlink(mq_name_opened);
assert!(res_unlink == Ok(()) );
|
<|file_name|>protocol.py<|end_file_name|><|fim▁begin|># TODO: provide a transition checker that prevents a feedback loop, inconsistent state.
# in user db that way user can eliminate store step on the receive side.
from charm.core.engine.util import *
from charm.toolbox.enum import Enum
from math import log, ceil
deb... | |
<|file_name|>nxos_udld_interface.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python
#
# This file is part of Ansible
#
# Ansible 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, ... | interface: Ethernet1/1
mode: enabled |
<|file_name|>rstcheck.py<|end_file_name|><|fim▁begin|>"""Sanity test using rstcheck."""
from __future__ import absolute_import, print_function
import os
from lib.sanity import (
SanitySingleVersion,
SanityMessage,
SanityFailure,
SanitySuccess,
SanitySkipped,
)
from lib.util import (
Subproces... | line=int(r['line']),
column=0, |
<|file_name|>generated.rs<|end_file_name|><|fim▁begin|>#[allow(warnings)]
use hyper::Client;
use hyper::status::StatusCode;
use rusoto_core::request::DispatchSignedRequest;
use rusoto_core::region;
use std::fmt;
use std::error::Error;
use rusoto_core::request::Ht... | |
<|file_name|>glass_ard_ground_truth.py<|end_file_name|><|fim▁begin|>"""
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
(at your option) any later version.
Written... | |
<|file_name|>VersionInfo.py<|end_file_name|><|fim▁begin|># -*- coding: latin-1 -*-
##
## Copyright (c) 2000, 2001, 2002, 2003 Thomas Heller
##
## 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 Sof... | |
<|file_name|>conf.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# Qcloud COS SDK for Python 3 documentation build configuration file, created by
# cookiecutter pipproject
#
# This file is execfile()d with the current directory set to its
# containing dir.
#
# Note that not all possibl... | |
<|file_name|>bible.js<|end_file_name|><|fim▁begin|>/**
* @overview Controller for a single Bible
* @module bible
* @author Dominik Sigmund
* @version 0.1
* @description Creates an Object. Has specific methods to show and manipulate data
* @memberof myVerses
* @requires module:fs
* @requires module:xml2js
*/
v... | |
<|file_name|>nailgun_task.py<|end_file_name|><|fim▁begin|># coding=utf-8
# Copyright 2014 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
from __future__ import (absolute_import, division, generators, nested_scopes, print_function,
... | rev='0.9.1'),
])
|
<|file_name|>test_danmaku_process.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
from unittest import TestCase
from nose.tools import eq_
from mock import Mock
from datetime import datetime
from tests.constants import STRING, NUMBER, DATE
from tests.asserters import eq_obj
from danmaku.cores.danmaku_process ... | |
<|file_name|>CoFactor.py<|end_file_name|><|fim▁begin|>from base.iterativeRecommender import IterativeRecommender
import numpy as np
from util import config
from collections import defaultdict
from math import log,exp
from scipy.sparse import *
from scipy import *
class CoFactor(IterativeRecommender):
def __init__(... | return [self.data.globalMean] * self.num_items |
<|file_name|>boss_jandice_barov.cpp<|end_file_name|><|fim▁begin|>/*
* This file is part of the TrinityCore Project. See AUTHORS file for Copyright information
*
* 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 S... | events.ScheduleEvent(EVENT_CURSE_OF_BLOOD, 15s);
events.ScheduleEvent(EVENT_ILLUSION, 30s);
} |
<|file_name|>radioButton.js<|end_file_name|><|fim▁begin|>/*!
* Angular Material Design
* https://github.com/angular/material
* @license MIT
* v0.10.1-rc2-master-7bbfd1f
*/
goog.provide('ng.material.components.radioButton');
goog.require('ng.material.core');
/**
* @ngdoc module
* @name material.components.radioBu... | }
} |
<|file_name|>state.go<|end_file_name|><|fim▁begin|>package main
import (
"fmt"
"sort"
"strings"
)
type State struct {<|fim▁hole|> Picks []string
victory int
numProv int
}
func (s *State) NewCopy() State {
ds := State{}
ds.hand = make([]string, len(s.hand))
ds.discard = make([]string, len(s.discard))
ds.d... | hand []string
discard []string
deck []string |
<|file_name|>neuroml_via_neurounits_neuron.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python
# -*- coding: utf-8 -*-
# ---------------------------------------------------------------------
# Copyright (c) 2012 Michael Hull.
# All rights reserved.
#<|fim▁hole|>#
# - Redistributions of source code must retain the above... | # Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met: |
<|file_name|>mail.js<|end_file_name|><|fim▁begin|>YUI(M.yui.loader, {lang: M.local_mail_lang}).use('io-base', 'node', 'json-parse', 'panel', 'datatable-base', 'dd-plugin', 'moodle-form-dateselector', 'datatype-date', 'calendar-base', function(Y) {
var mail_message_view = false;
var mail_checkbox_labels_default... |
//Initialize
init(); |
<|file_name|>models.py<|end_file_name|><|fim▁begin|>from django.db import models
class TimeStampedModel(models.Model):
created = models.DateTimeField(auto_now_add=True)
modified = models.DateTimeField(auto_now=True)
class Meta:
abstract = True
class Caller(TimeStampedModel):
name = models.Ch... | |
<|file_name|>lists2.py<|end_file_name|><|fim▁begin|>def no_extreme(listed):
"""
Takes a list and chops off extreme ends
"""
del listed[0]
del listed[-1:]
return listed
def better_no_extreme(listed):
"""
why better ? For starters , does not modify original list<|fim▁hole|> return listed[1:-1]
t = ['a','b','c']... | """ |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.