prompt large_stringlengths 70 991k | completion large_stringlengths 0 1.02k |
|---|---|
<|file_name|>accelerator.py<|end_file_name|><|fim▁begin|>import numpy as _np
import lnls as _lnls
import pyaccel as _pyaccel
from . import lattice as _lattice
default_cavity_on = False
default_radiation_on = False
default_vchamber_on = False
def create_accelerator(optics_mode=_lattice.default_optics_mode, energy=_l... | cavity_on=default_cavity_on, |
<|file_name|>secrets.go<|end_file_name|><|fim▁begin|>/*
Copyright 2014 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... |
import ( |
<|file_name|>oadm_router.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
# ___ ___ _ _ ___ ___ _ _____ ___ ___
# / __| __| \| | __| _ \ /_\_ _| __| \
# | (_ | _|| .` | _|| / / _ \| | | _|| |) |
# \___|___|_|\_|___|_|_\/_/_\_\_|_|___|___/_ _____
# | \ / _ \ | \| |/ _ \_ _| | __| \_ ... | if content_type == 'yaml':
self.yaml_dict = yaml.load(contents)
elif content_type == 'json': |
<|file_name|>build.rs<|end_file_name|><|fim▁begin|>#![allow(unused_imports, dead_code, unused_variables)]
#[cfg(feature = "pkg-config")]
extern crate pkg_config;
#[cfg(feature = "bindgen")]
extern crate bindgen;
#[cfg(feature="bundled")]
extern crate cmake;
#[cfg(feature="bundled")]
extern crate tar;
#[cfg(feature="bu... | .whitelist_type("MIX.*")
.whitelist_type("Mix.*") |
<|file_name|>gulpfile.js<|end_file_name|><|fim▁begin|>/**
* Created by shuyi.wu on 2015/4/1.
*/
'use strict';
var gulp = require('gulp'),
uglify = require('gulp-uglify'),
rename = require('gulp-rename'),
del = require('del'),
webpack = require('gulp-webpack');
gulp.task('compileES6', function () {
... | module: {
loaders: [ |
<|file_name|>lista02_exercicio01_questao06.py<|end_file_name|><|fim▁begin|>#-----------------------------------------------------------------------------------------------------------------------
#Introdução a Programação de Computadores - IPC
#Universidade do Estado do Amazonas - UEA
#Prof. Jucimar Jr.
#Alexandre Marq... | #Uriel Brito Barros 1515120558
#Roberta de Oliveira da cruz 0825070169
#Evandro Padilha Barroso Filho 1715310009
# |
<|file_name|>dht22.cpp<|end_file_name|><|fim▁begin|>#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <dirent.h>
#include <fcntl.h>
#include <assert.h>
#include <unistd.h>
#include <sys/mman.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <sys/time.h>
#include <bcm2835.h>
#include <unistd.h>
... | |
<|file_name|>FlowChart.js<|end_file_name|><|fim▁begin|>dojo.declare("gamelena.gfx.FlowChart", null, {
id: null,
surface: null,
domPrefix: null,
group: null,
circles: [],
circlesLabels: [],
moves: [],
groups: [],
lines: [],
linesGroups: [],
linesHelpers: [],
linesPointers: [],
linesLabels: [],
events: [],
... | |
<|file_name|>perfect_number.py<|end_file_name|><|fim▁begin|>def perfect_number():
sum, count, number = 0, 0, 1
top = input("enter a top value: ")
while number < top:
for i in range(1, number/2+1):
if number/i*i == number:
sum += i
if sum == number:
co... | |
<|file_name|>UnresolvedReceiverGeneric.py<|end_file_name|><|fim▁begin|>from typing import TypeVar, Dict, Iterable, Any
T = TypeVar("T")
<|fim▁hole|>def foo(values: Dict[T, Iterable[Any]]):
for e in []:
values.setdefault(e, undefined)<|fim▁end|> | |
<|file_name|>shrd_Ed_Gd_Ib_mem.java<|end_file_name|><|fim▁begin|>/*
JPC: An x86 PC Hardware Emulator for a pure Java Virtual Machine
Copyright (C) 2012-2013 Ian Preston
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License version 2 a... | cpu.flagOp1 = op1.get32(cpu);
cpu.flagOp2 = shift; |
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
"""Dictionary-based password generator.
<|fim▁hole|> -h --help Show this help text
-d --dictionary=<path> Specify a non-default dictionary
-n --length=N Specify number of words to use [default: 4]
-v --verbose ... | Usage: pass.py [options]
Options: |
<|file_name|>test_sim.py<|end_file_name|><|fim▁begin|>from __future__ import print_function, division, absolute_import, unicode_literals
from builtins import bytes, dict, object, range, map, input, str
from future.utils import itervalues, viewitems, iteritems, listvalues, listitems
from io import open
import rfpipe, r... | # 'searchtype': 'armkimage', 'flaglist': []}, 2) # sigma_arms forced very low
#TODO: support arbitrary channel selection and |
<|file_name|>theme_xkcd.py<|end_file_name|><|fim▁begin|>from __future__ import (absolute_import, division, print_function,
unicode_literals)
import matplotlib as mpl
import matplotlib.pyplot as plt
from .theme import theme_base
class theme_xkcd(theme_base):
"""
xkcd theme
The theme... | for k, v in self._rcParams.items(): |
<|file_name|>app.rs<|end_file_name|><|fim▁begin|>use piston::*;
pub struct App {
objects: Vec<()>,
}
<|fim▁hole|> pub fn new() -> App {
App {
objects: Vec::new(),
}
}
}
impl Game for App {
}<|fim▁end|> | impl App { |
<|file_name|>GlobalPropertyTester.java<|end_file_name|><|fim▁begin|>/*
* DBeaver - Universal Database Manager
* Copyright (C) 2010-2019 Serge Rider (serge@jkiss.org)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obt... | * limitations under the License.
*/ |
<|file_name|>WindowAssignCitizen.java<|end_file_name|><|fim▁begin|>package com.minecolonies.coremod.client.gui;
import com.ldtteam.blockout.Pane;
import com.ldtteam.blockout.controls.Button;
import com.ldtteam.blockout.controls.ButtonHandler;
import com.ldtteam.blockout.controls.Text;
import com.ldtteam.blockout.views... | import com.ldtteam.structurize.util.LanguageHandler;
import com.minecolonies.api.colony.ICitizenDataView;
import com.minecolonies.api.colony.IColonyView; |
<|file_name|>torrcPanel.py<|end_file_name|><|fim▁begin|>"""<|fim▁hole|>import curses
import threading
from util import conf, panel, torConfig, uiTools
DEFAULT_CONFIG = {"features.config.file.showScrollbars": True,
"features.config.file.maxLinesPerEntry": 8}
# TODO: The armrc use case is incomplete.... | Panel displaying the torrc or armrc with the validation done against it.
"""
import math |
<|file_name|>wsgi.py<|end_file_name|><|fim▁begin|>"""<|fim▁hole|>
It exposes the WSGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/1.6/howto/deployment/wsgi/
"""
import os
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "crowd_serv... | WSGI config for crowd_server project. |
<|file_name|>index.ts<|end_file_name|><|fim▁begin|><|fim▁hole|>import Box from './Box';
import Button from './Button';
import Notification from './Notification';
import Footer from './Footer';
import Header from './Header';
import Heading from './Heading';
import Headline from './Headline';
import Hero from './Hero';
i... | import Anchor from './Anchor';
import Article from './Article';
import Avatar from './Avatar'; |
<|file_name|>standardize_data.py<|end_file_name|><|fim▁begin|># pylint: disable=g-bad-file-header
# Copyright 2020 DeepMind Technologies Limited. 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... | |
<|file_name|>index.ts<|end_file_name|><|fim▁begin|>import URL from 'url';
import * as packageCache from '../../util/cache/package';
import { GitlabHttp } from '../../util/http/gitlab';
import type { GetReleasesConfig, ReleaseResult } from '../types';
import type { GitlabTag } from './types';
const gitlabApi = new Gitl... | |
<|file_name|>audit-log.ts<|end_file_name|><|fim▁begin|>// Copyright (c) 2017 VMware, Inc. All Rights Reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.o... | |
<|file_name|>CosRelationships_idl.py<|end_file_name|><|fim▁begin|># Python stubs generated by omniidl from /usr/local/share/idl/omniORB/COS/CosRelationships.idl
# DO NOT EDIT THIS FILE!
import omniORB, _omnipy
from omniORB import CORBA, PortableServer
_0_CORBA = CORBA
_omnipy.checkVersion(4,2, __file__, 1)
try:
... |
omniORB.registerObjref(RelationshipFactory._NP_RepositoryId, _objref_RelationshipFactory)
_0_CosRelationships._objref_RelationshipFactory = _objref_RelationshipFactory |
<|file_name|>acquire.py<|end_file_name|><|fim▁begin|>"""
Basic framework for acquiring a roach measurement that includes both sweep(s) and stream(s).
Acquire
-Initialize equipment.
-Initialize roach: preload frequencies, if necessary.
-Create state dictionary containing state from all equipment, including temperatures... | |
<|file_name|>shl.rs<|end_file_name|><|fim▁begin|>#![feature(core, core_simd)]
extern crate core;
#[cfg(test)]
mod tests {
use core::simd::u64x2;
// #[simd]
// #[derive(Copy, Clone, Debug)]
// #[repr(C)]
// pub struct u64x2(pub u64, pub u64);
#[test]
fn shl_test1() {
let x: u64x2 = u64x2(... | |
<|file_name|>matchup.py<|end_file_name|><|fim▁begin|>import os
import sys
import pandas as pd
import numpy as np
from numpy.random import poisson, uniform
from numpy import mean
import time
import math
po = True
teamsheetpath = sys.path[0] + '/teamcsvs/'
compstat = {'TDF': 'TDA', 'TDA': 'TDF', #Dictionary to use to ... | else:
expected_scores.update({'PAT1PROB': 0.99})
#print(expected_scores['PAT1PROB']) |
<|file_name|>index.js<|end_file_name|><|fim▁begin|>var express = require('express');
var request = require('request');
var rp = require('rp');
var config = require('../../config')
var router = express.Router();
var twilio = require('twilio');
var mysql = require('mysql');
var connection = mysql.createConnection(config... | }) //end of router post handling |
<|file_name|>index.js<|end_file_name|><|fim▁begin|>$(window).scroll(function (e) {
var $w = $(window).width();
var $h = $(window).height();
if ($w > 980 && $h > 400) {
if ($(this).scrollTop() >= 268) {
$("#index_nav.index_nav, #compatible").addClass("index_nav_fixed");
} else {
... | $("#slides img").css("opacity", (((250 - ($(this).scrollTop())) * 100) / 250) / 100);
$(".si-ctitle-c").css("opacity", (((250 - ($(this).scrollTop())) * 100) / 250) / 100);
}
}); |
<|file_name|>deploy_snapshots.py<|end_file_name|><|fim▁begin|># Copyright (c) 2014 Mirantis 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/licenses/LICENSE-2.0
#... | }
} |
<|file_name|>stateless_random_ops_test.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
#
# ht... | key = 0x3ec8f720, 0x02461e29
preseed = invert_philox(key, (seed[0], 0, seed[1], 0)).astype(np.uint64)
preseed = preseed[::2] | preseed[1::2] << 32
with ops.device(get_device().name): |
<|file_name|>raw_mantissa_and_exponent.rs<|end_file_name|><|fim▁begin|>use malachite_base::num::basic::floats::PrimitiveFloat;
use malachite_base::num::float::NiceFloat;
use malachite_base_test_util::bench::bucketers::{pair_1_bit_bucketer, primitive_float_bucketer};
use malachite_base_test_util::bench::{run_benchmark, ... | ("default", &mut |x| no_out!(x.raw_exponent())), |
<|file_name|>blkio_test.go<|end_file_name|><|fim▁begin|>package fs
import (
"testing"
"github.com/dotcloud/docker/pkg/libcontainer/cgroups"
)
const (
sectorsRecursiveContents = `8:0 1024`
serviceBytesRecursiveContents = `8:0 Read 100
8:0 Write 200
8:0 Sync 300
8:0 Async 500
8:0 Total 500
Total 500`
service... | "blkio.sectors_recursive": sectorsRecursiveContents,
})
|
<|file_name|>zenjmx.py<|end_file_name|><|fim▁begin|>#! /usr/bin/env python
##############################################################################
#
# Copyright (C) Zenoss, Inc. 2008, 2009, all rights reserved.
#
# This content is made available according to terms specified in
# License.zenoss under the direct... | @return: results from remote device |
<|file_name|>6.py<|end_file_name|><|fim▁begin|># Created by PyCharm Pro Edition
# User: Kaushik Talukdar
# Date: 27-03-2017
# Time: 05:25 PM
fastfood = ["momo", "roll", "chow", "pizza"]
print(fastfood)
print("\n")
#print one element using pop()
#output the ... | #print the new list with less elements
print(fastfood) |
<|file_name|>timer.rs<|end_file_name|><|fim▁begin|>// Copyright 2014 The sdl2-rs Developers.
//
// 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/LICEN... | |
<|file_name|>base.py<|end_file_name|><|fim▁begin|># Copyright The PyTorch Lightning team.
#
# 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
#
... | def stop(self, action_name: str) -> None:
raise NotImplementedError |
<|file_name|>CIN.GETLINE-leitura-delimitada.cpp<|end_file_name|><|fim▁begin|>#include <iostream>
using namespace std;
main(){
char palavra[] = ".";<|fim▁hole|>
cin.getline(palavra, 10, '\n'); // irá ler apenas 10 caracteres e vai ser delimitado até encontrar a quebra de linha
cout << endl <<... | |
<|file_name|>scielo_wos_scieloci_update.py<|end_file_name|><|fim▁begin|># coding: utf-8
'''<|fim▁hole|>import logging
import models
from transform_date import *
from accent_remover import *
logging.basicConfig(filename='logs/scieloci.info.txt', level=logging.INFO)
logger = logging.getLogger(__name__)
# Add SciELO C... | This script reads data from various sources to process and store in MongoDB.
'''
import pyexcel |
<|file_name|>dnd_grab.rs<|end_file_name|><|fim▁begin|>use std::{cell::RefCell, ops::Deref as _, rc::Rc};
use wayland_server::{
protocol::{wl_data_device_manager::DndAction, wl_data_offer, wl_data_source, wl_pointer, wl_surface},
Main,
};
use crate::{
utils::{Logical, Point},
wayland::{
seat::{... | for device in &seat_data.known_devices {
if device.as_ref().same_client_as(surface.as_ref()) { |
<|file_name|>newmember.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'newmember.ui'
#
# Created: Sat Mar 29 19:36:48 2014
# by: PyQt5 UI code generator 5.2.1
#
# WARNING! All changes made in this file will be lost!
from PyQt5 import QtCore, QtGui, Qt... | self.email_fld.setObjectName("email_fld")
self.formLayout.setWidget(9, QtWidgets.QFormLayout.FieldRole, self.email_fld) |
<|file_name|>lib.rs<|end_file_name|><|fim▁begin|>// Copyright 2015, 2016 Ethcore (UK) Ltd.
// This file is part of Parity.
// Parity 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 L... | use env_logger::LogBuilder;
use regex::Regex;
use util::RotatingLogger;
use util::log::Colour; |
<|file_name|>fixture.py<|end_file_name|><|fim▁begin|>from __future__ import print_function, division, absolute_import
import difflib
import locale
import os
import pprint
import six
import sys
import tempfile
try:
import unittest2 as unittest
except ImportError:
import unittest
# just log py.warnings (and p... |
# Don't really care about date ranges here:
self.mock_calc = NonCallableMock()
self.mock_calc.calculate.return_value = None |
<|file_name|>test_rhythmtreetools_RhythmTreeNode_duration.py<|end_file_name|><|fim▁begin|># -*- encoding: utf-8 -*-
from abjad.tools.durationtools import Duration
from abjad.tools.rhythmtreetools import RhythmTreeContainer, RhythmTreeLeaf
def test_rhythmtreetools_RhythmTreeNode_duration_01():
tree = RhythmTreeCo... | assert tree[2].duration == Duration(2, 5)
|
<|file_name|>goto.py<|end_file_name|><|fim▁begin|># goto_assignments command tests are different in syntax
definition = 3
#! 0 ['a = definition']
a = definition
#! []
b
#! ['a = definition']
a
b = a
c = b
#! ['c = b']
c
cd = 1
#! 1 ['cd = c']
cd = c
#! 0 ['cd = e']
cd = e
#! ['module math']
import math
#! ['import... | |
<|file_name|>config.js<|end_file_name|><|fim▁begin|><|fim▁hole|>module.exports = {
flyers: {
testRail: {
projectId: 6,
},
confluence: {
space: '~adam.petrie'
}
}
}<|fim▁end|> | |
<|file_name|>main.cpp<|end_file_name|><|fim▁begin|>#include "barista_core/barista_core.h"
#include "decafs_types/ip_address.h"
#include "network_fake.h"
#define MIN_ARGS 6
#define STRIPE_SIZE 1
#define CHUNK_SIZE 2
#define METADATA 3
#define NUM_ESPRESSOS 4
#define PORT 5
int main(int argc, char** argv) {
// bar... | |
<|file_name|>config.py<|end_file_name|><|fim▁begin|>import json
from util import d
import os
__home = os.path.expanduser("~").replace('\\', '/') + "/PixelWeb/"
BASE_SERVER_CONFIG = d({
"id":"server_config",
"display": "server_config",
"preconfig": False,
"presets":[],
... | for p in params:
if "default" not in p:
p.default = None
data[p.id] = p.default |
<|file_name|>chips.spec.ts<|end_file_name|><|fim▁begin|>import {Component, DebugElement, ViewChild} from '@angular/core';
import {ComponentFixture, TestBed, fakeAsync, flush} from '@angular/core/testing';
import {By} from '@angular/platform-browser';
import {FormsModule} from '@angular/forms';
import {ENTER} from '@ang... | it('#should set value on chip', () => {
testComponent.value = 'weather-1';
fixture.detectChanges(); |
<|file_name|>disk_sub.py<|end_file_name|><|fim▁begin|>import sys
import numpy as np
import pylab
import matplotlib.pyplot as plt
import scipy.integrate
import scipy.optimize
from collections import namedtuple
import geo
import astro_help as ah
import disk_sub as disk
RADIAN=57.29598
C=2.997925e10
MSOL=1.979e33
G=6.67... | rdisk=[] |
<|file_name|>upscale_relperm.cpp<|end_file_name|><|fim▁begin|>/*
Copyright 2010 Statoil ASA.
This file is part of The Open Porous Media project (OPM).
OPM 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... | |
<|file_name|>step_f32_relaxed.rs<|end_file_name|><|fim▁begin|>#include "step_f32.rs"<|fim▁hole|><|fim▁end|> | #pragma rs_fp_relaxed |
<|file_name|>src.js<|end_file_name|><|fim▁begin|>'use strict';
module.exports = {
<|fim▁hole|> this.setProperty('src', v);
},
get: function () {
return this.getPropertyValue('src');
},
enumerable: true
};<|fim▁end|> | set: function (v) {
|
<|file_name|>codegen_does_not_add_save_changes_method_on_structs_without_primary_key.rs<|end_file_name|><|fim▁begin|>extern crate diesel;
use diesel::*;
table! {
users {
id -> Integer,
name -> VarChar,
hair_color -> VarChar,
}
}
#[derive(Queryable, AsChangeset)]
#[table_name = "users"... | |
<|file_name|>auto_restart_configuration.py<|end_file_name|><|fim▁begin|>from bitmovin.utils import Serializable
class AutoRestartConfiguration(Serializable):
def __init__(self, segments_written_timeout: float = None, bytes_written_timeout: float = None,
frames_written_timeout: float = None, hls_m... | self.framesWrittenTimeout = frames_written_timeout
self.hlsManifestsUpdateTimeout = hls_manifests_update_timeout
self.dashManifestsUpdateTimeout = dash_manifests_update_timeout |
<|file_name|>charset.py<|end_file_name|><|fim▁begin|># uncompyle6 version 2.9.10
# Python bytecode 2.7 (62211)
# Decompiled from: Python 3.6.0b2 (default, Oct 11 2016, 05:27:10)
# [GCC 6.2.0 20161005]
# Embedded file name: charset.py
__all__ = [
'Charset',
'add_alias',
'add_charset',
'add_codec']
import codecs
imp... | The type of encoding (base64 or quoted-printable) will be based on |
<|file_name|>1dlbp_tests.py<|end_file_name|><|fim▁begin|>import numpy as np
import matplotlib.pylab as plt
from numba import cuda, uint8, int32, uint32, jit
from timeit import default_timer as timer
@cuda.jit('void(uint8[:], int32, int32[:], int32[:])')<|fim▁hole|> i += neighborhood
for j in range(i - ... | def lbp_kernel(input, neighborhood, powers, h):
i = cuda.grid(1)
r = 0
if i < input.shape[0] - 2 * neighborhood: |
<|file_name|>reception_data.py<|end_file_name|><|fim▁begin|>import glob
import operational_instruments
from astropy.io import fits
from numpy.fft import fft2, ifft2
import sewpy
from astropy import wcs
from astropy.table import Table
from astropy.io import ascii
from astropy.time import Time
import pytz
impor... | length is used to correlate a revised central pixel position
"""
hduref = fits.open(pathref)
|
<|file_name|>0022_auto_20161212_0008.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
# Generated by Django 1.10.2 on 2016-12-12 07:08
from __future__ import unicode_literals
from django.db import migrations
class Migration(migrations.Migration):<|fim▁hole|> ]
operations = [
migrations.RenameF... |
dependencies = [
('mords_api', '0021_learningword'), |
<|file_name|>simple.py<|end_file_name|><|fim▁begin|># Copyright (C) 2015 Custodia Project Contributors - see LICENSE file
import json
from six import string_types<|fim▁hole|>from custodia.message.common import InvalidMessage
from custodia.message.common import MessageHandler
class SimpleKey(MessageHandler):
""... | |
<|file_name|>fabfile.py<|end_file_name|><|fim▁begin|>from fabric.api import local
<|fim▁hole|><|fim▁end|> | def html():
local('hovercraft -t ./sixfeetup_hovercraft formation_flask.rst ./build/') |
<|file_name|>launch.js<|end_file_name|><|fim▁begin|><|fim▁hole|><|fim▁end|> | import app from './app';
app.run(process.argv); |
<|file_name|>main.rs<|end_file_name|><|fim▁begin|>// main.rs
// Copyright 2016 Alexander Altman
//
// 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... |
fn main() {
let mut clap_app = clap::App::new("kōnane")
.version(crate_version!()) |
<|file_name|>viewport_rule.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/. */
//! The [`@viewport`][at] at-rule and [`meta`][meta] el... |
// DEVICE-ADAPT § 6.2.4 Resolve initial width and height from min/max descriptors
macro_rules! resolve { |
<|file_name|>app.js<|end_file_name|><|fim▁begin|>'use strict';
angular
.module('personalWebsiteApp', [
'ngResource',
'ngRoute',
'ngAnimate',
'animatedBirdsDirective',
'scrollAnimDirective',
'swfTemplateDirective'
])
.config(['$routeProvider', function ($routeProvider) {
$routeProvider... | .when('/', { |
<|file_name|>example_crbm.py<|end_file_name|><|fim▁begin|>from models.sampler import DynamicBlockGibbsSampler
from models.distribution import DynamicBernoulli
from models.optimizer import DynamicSGD
from utils.utils import prepare_frames
from scipy import io as matio<|fim▁hole|>
SIZE_BATCH = 10
EPOCHS = 100
SIZE_HIDDEN... | from data.gwtaylor.path import *
import ipdb
import numpy as np |
<|file_name|>test_iwords.py<|end_file_name|><|fim▁begin|>"""
Test functions in iwords.py. To run with pytest.
"""
import os
from tempfile import NamedTemporaryFile
import iwords
def test_get_freqs():
with NamedTemporaryFile() as fp:
fp.write(b'Hello world!')
fp.flush()
assert iwords.get_... | assert os.system(f'./iwords.py {fp.name} --show-score') == 0
assert os.system(f'./iwords.py {fp.name} --limit 1') == 0
assert os.system(f'./iwords.py {fp.name} --learn /usr/share/dict/words') == 0 |
<|file_name|>tuples.rs<|end_file_name|><|fim▁begin|>extern crate itertools;
use itertools::Itertools;
#[test]
fn tuples() {
let v = [1, 2, 3, 4, 5];
let mut iter = v.iter().cloned().tuples();
assert_eq!(Some((1,)), iter.next());
assert_eq!(Some((2,)), iter.next());
assert_eq!(Some((3,)), iter.next... | assert_eq!(None, iter.next());
itertools::assert_equal(vec![5], iter.into_buffer()); |
<|file_name|>test_mixed_modulestore.py<|end_file_name|><|fim▁begin|>"""
Unit tests for the Mixed Modulestore, with DDT for the various stores (Split, Draft, XML)
"""
import datetime
import itertools
import logging
import mimetypes
from collections import namedtuple
from contextlib import contextmanager
from shutil im... | course_key.make_usage_key('video', 'WelcomeX'), |
<|file_name|>PersonPaperResourceConverter.java<|end_file_name|><|fim▁begin|>package org.lnu.is.converter.person.paper;
import org.lnu.is.annotations.Converter;
import org.lnu.is.converter.AbstractConverter;
import org.lnu.is.domain.honors.type.HonorType;
import org.lnu.is.domain.paper.type.PaperType;
import org.lnu.is... | |
<|file_name|>material.module.ts<|end_file_name|><|fim▁begin|>import { NgModule } from '@angular/core';
import {
MdAutocompleteModule,
MdButtonModule,
MdButtonToggleModule,
MdCardModule,
MdCheckboxModule,
MdChipsModule,
MdCoreModule,
MdDatepickerModule,
MdDialogModule,
MdExpansionModule,
MdGridL... | MdButtonToggleModule,
MdCardModule,
MdCheckboxModule,
|
<|file_name|>global.js<|end_file_name|><|fim▁begin|>// Copyright (C) 2015 Leslie Zhai <xiang.zhai@i-soft.com.cn>
.pragma library
var v2 = false;
var isAway = false;
var isRobot = false;
var uin = "";
var sid = "";
var skey = "";
var ticket = "";
var deviceId = "";
var loginUserName = "";
var loginNickName = "";
var in... | {
if (typeof(wxView) != 'undefined')
wxView.doNewMsg(); |
<|file_name|>Radio.js<|end_file_name|><|fim▁begin|>'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerabl... | var _react2 = _interopRequireDefault(_react);
var _libs = require('../../libs'); |
<|file_name|>assert-eq-macro-unsized.rs<|end_file_name|><|fim▁begin|>// run-pass<|fim▁hole|><|fim▁end|> | pub fn main() {
assert_eq!([1, 2, 3][..], vec![1, 2, 3][..]);
} |
<|file_name|>future.rs<|end_file_name|><|fim▁begin|>// Copyright 2012-2013 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... | #[test]
fn test_from_value() {
let mut f = Future::from_value(~"snail"); |
<|file_name|>DOMStylePropertiesAndMethodsExample04.js<|end_file_name|><|fim▁begin|>let prop, value, i, len;<|fim▁hole|> console.log(`prop: ${value.cssText} (${value.cssValueType})`);
}<|fim▁end|> | for (i = 0, len = myDiv.style.length; i < len; i++) {
prop = myDiv.style[i]; // alternately, myDiv.style.item(i)
value = myDiv.style.getPropertyCSSValue(prop); |
<|file_name|>issue-14845.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... | struct X {
a: [u8; 1]
}
|
<|file_name|>PerformanceOverlay.js<|end_file_name|><|fim▁begin|>/**
* Copyright (c) 2015-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be ... | </View>
);
}
}); |
<|file_name|>isilon.py<|end_file_name|><|fim▁begin|># Copyright 2015 EMC Corporation
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/... | self._cifs_allow_access_ip(rule['access_to'], share,
rule['access_level']) |
<|file_name|>test_authentication.py<|end_file_name|><|fim▁begin|>import os
import os.path
import binascii
import tempfile
import shutil
import getpass
import time
from twisted.trial import unittest
from twisted.internet.protocol import Factory
from twisted.internet import reactor, defer, protocol, error
from txdbus ... | try: |
<|file_name|>uniquify_subscriptions.py<|end_file_name|><|fim▁begin|>from django.core.management import BaseCommand
from django.db.models import Count
from zds.notification.models import Subscription
class Command(BaseCommand):
help = "Delete all but last duplicate subscriptions"
def handle(self, *args, **op... | # Find all duplicates
duplicates = (
Subscription.objects.values("user", "content_type", "object_id")
.annotate(Count("id")) |
<|file_name|>Pokemon.js<|end_file_name|><|fim▁begin|>const { InventoryError,
NotFoundError } = require('../../errors')
const checkExists = (data) => {
return (entity) => {
if (!entity) throw new NotFoundError(`${data} not found`)
return entity
}
}
module.exports = (sequelize, DataTypes) => {
const Pok... | stock: DataTypes.INTEGER
}, { tableName: 'pokemons' }) |
<|file_name|>views.py<|end_file_name|><|fim▁begin|><|fim▁hole|>from django.contrib.auth.decorators import login_required
from django.contrib import messages
from .models import Profile
from .forms import ProfileForm
@login_required
def profile_edit(request):
next = request.GET.get("next")
profile, creat... | from django.shortcuts import render, redirect
|
<|file_name|>afterPack-template.js<|end_file_name|><|fim▁begin|>const fs = require('fs');
const fse = require('fs-extra');
const path = require('path');
module.exports = function (params) {
const unpackFile = path.join(
params.appOutDir,
'*NAMECASENOSPACE*.app/Contents/Resources/app.asar.unpacked'
);
fse.... | }; |
<|file_name|>WebImageCache.java<|end_file_name|><|fim▁begin|>package org.osmdroid.bonuspack.utils;
import java.util.LinkedHashMap;
import android.graphics.Bitmap;
import android.util.Log;
/**
<|fim▁hole|> */
public class WebImageCache {
LinkedHashMap<String, Bitmap> mCacheMap;
int mCapacity;
public We... | * Simple memory cache for handling images loaded from the web.
* The url is the key.
* @author M.Kergall
|
<|file_name|>borrowck-lend-flow-loop.rs<|end_file_name|><|fim▁begin|>// Copyright 2012 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution and at
// http://rust-lang.org/COPYRIGHT.
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.ap... | // Therefore, some of these errors are marked as spurious and could be
// corrected by a simple change to the analysis. The others are
// either genuine or would require more advanced changes. The latter |
<|file_name|>command_smudge.go<|end_file_name|><|fim▁begin|>package commands
import (
"bytes"
"io"
"os"
"path/filepath"
"github.com/github/git-lfs/lfs"
"github.com/github/git-lfs/vendor/_nuts/github.com/spf13/cobra"
)
var (
smudgeInfo = false
smudgeCmd = &cobra.Command{
Use: "smudge",
Short: "Implemen... |
b := &bytes.Buffer{}
r := io.TeeReader(os.Stdin, b) |
<|file_name|>loc.py<|end_file_name|><|fim▁begin|>"""Local settings and globals."""
import sys
from os.path import normpath, join
from .base import *
# Import secrets -- not needed<|fim▁hole|>#from secrets import *
# Set static URL
STATIC_URL = '/static'<|fim▁end|> | #sys.path.append(
# abspath(join(PROJECT_ROOT, '../secrets/TimelineJS/stg'))
#)
|
<|file_name|>facebookConnect.js<|end_file_name|><|fim▁begin|>/*
* Module : FacebookConnect.js
*
* Setups up the basic code to connect to the facebook JS api.
*
* Requires Config:
* - app.config.facebook.appId
*/
(function(app)
{
var module = app.module("facebookConnect", {
requires : [
"... | ], |
<|file_name|>RTCPeerConnection-tests.ts<|end_file_name|><|fim▁begin|>/// <reference path="MediaStream.d.ts" />
/// <reference path="RTCPeerConnection.d.ts" />
var config: RTCConfiguration =
{ iceServers: [{ urls: "stun.l.google.com:19302" }] };
var constraints: RTCMediaConstraints =
{ mandatory: { offerToRecei... | var webkitSessionDescription = new webkitRTCSessionDescription(offer);
|
<|file_name|>run.rs<|end_file_name|><|fim▁begin|>// Copyright 2015, 2016 Ethcore (UK) Ltd.
// This file is part of Parity.
// Parity 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 L... | // set up panic handler
let panic_handler = PanicHandler::new_in_arc();
// set up logger |
<|file_name|>RecordAudio.py<|end_file_name|><|fim▁begin|>import sys
import time
from naoqi import ALProxy
IP = "nao.local"
PORT = 9559
if (len(sys.argv) < 2):
print "Usage: 'python RecordAudio.py nume'"
sys.exit(1)
fileName = "/home/nao/" + sys.argv[1] + ".wav"
aur = ALProxy("ALAudioRecorder", IP, PORT)
ch... | aup.playFile(fileName,0.5,-1.0)
c=raw_input("gata?")
#Launchs the playing of a file
#aup.playFile("/usr/share/naoqi/wav/random.wav") |
<|file_name|>events.go<|end_file_name|><|fim▁begin|>/*
Copyright 2014 The Kubernetes 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.org/licenses/... | allErrs := validation.ErrorList{}
// TODO: There is no namespace required for node.
if event.InvolvedObject.Kind != "Node" && |
<|file_name|>ChainInstance.js<|end_file_name|><|fim▁begin|>module.exports = ChainInstance;
function ChainInstance(chain, cb) {
var instances = null;
var loading = false;
var queue = [];
var load = function () {
loading = true;
chain.run(function (err, items) {
instances = items;
return next();
... | };
var promise = function(hwd, next) { |
<|file_name|>partfrac.py<|end_file_name|><|fim▁begin|>"""Algorithms for partial fraction decomposition of rational functions. """
from __future__ import print_function, division
from sympy.polys import Poly, RootSum, cancel, factor
from sympy.polys.polytools import parallel_poly_from_expr
from sympy.polys.polyoptions... | apart, assemble_partfrac_list
References
========== |
<|file_name|>linear_solver_natural_api.py<|end_file_name|><|fim▁begin|># Copyright 2010-2021 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/LI... | |
<|file_name|>quick_stage.py<|end_file_name|><|fim▁begin|>from collections import namedtuple
import sublime
from sublime_plugin import WindowCommand
from ..git_command import GitCommand
MenuOption = namedtuple("MenuOption", ["requires_action", "menu_text", "filename", "is_untracked"])<|fim▁hole|>
CLEAN_WORKING_DIR = "... | |
<|file_name|>Simulation.py<|end_file_name|><|fim▁begin|>#! /usr/bin/python
from TOSSIM import *
from sets import Set
import sys
from optparse import OptionParser
parser = OptionParser(usage="usage: %prog [options] filename",
version="%prog 1.0")
parser.add_option("-g", "--gainfile",
action="store",
dest="gainfile"... | if (stripline != ""):
val = int(stripline)
for node in nodes: |
<|file_name|>prospective_search_pb.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
#
# Copyright 2007 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.apac... |
def Clear(self): |
<|file_name|>node-tests.ts<|end_file_name|><|fim▁begin|>import * as assert from "assert";
import * as fs from "fs";
import * as events from "events";
import * as zlib from "zlib";
import * as url from "url";
import * as util from "util";
import * as crypto from "crypto";
import * as tls from "tls";
import * as http fro... | }
{
var module: NodeModule | undefined; |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.