prompt large_stringlengths 70 991k | completion large_stringlengths 0 1.02k |
|---|---|
<|file_name|>trait-coercion-generic-regions.rs<|end_file_name|><|fim▁begin|>// Copyright 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:/... | trait Trait<T> { |
<|file_name|>handler_test.go<|end_file_name|><|fim▁begin|>package outbound_test
import (
"context"
"testing"
"v2ray.com/core"
"v2ray.com/core/app/policy"
. "v2ray.com/core/app/proxyman/outbound"
"v2ray.com/core/app/stats"
"v2ray.com/core/common/net"
"v2ray.com/core/common/serial"
"v2ray.com/core/features/out... | }
} |
<|file_name|>sagas.js<|end_file_name|><|fim▁begin|>import {takeEvery} from 'redux-saga'
import {call, put, take, fork, select, cancel} from 'redux-saga/effects'
import * as Actions from './actions/actions'
let ws = null
const getUsername = state => state.username
function* createWebSocket(url) {
ws = new WebSoc... | const send = (data) => {
try {
ws.send(JSON.stringify(data)) |
<|file_name|>home.tsx<|end_file_name|><|fim▁begin|>import * as React from "react";
export const Home = () =>
<div className="container">
<div className="jumbotron">
<h3>Welcome to the Meme challange</h3>
<p>Whatever</p>
</div>
<div className="row">
<div className="col-md-4">
... | <div className="card-body"> |
<|file_name|>put_doc.js<|end_file_name|><|fim▁begin|>var superagent = require('superagent')
var env = process.env
/**
* put_doc
* initialize with the couchdb to save to
*
* expects that the url, port, username, password are in environment
* variables. If not, add these to the options object.
*
* var cuser = e... | if(opts.cport !== undefined) cport = +opts.cport
var couch = 'http://'+chost+':'+cport |
<|file_name|>hearthisat.py<|end_file_name|><|fim▁begin|># coding: utf-8
from __future__ import unicode_literals
import re
from .common import InfoExtractor
from ..compat import compat_urlparse
from ..utils import (
HEADRequest,
KNOWN_EXTENSIONS,
sanitized_Request,
str_to_int,
urlencode_postdata,
urlhandle_detec... | |
<|file_name|>fft.rs<|end_file_name|><|fim▁begin|>use num::complex::{Complex, Complex64};
use libc::c_double;
use std::f64::consts::PI;
///
/// Compute the Discrete Fast Fourier Transform
/// of an f64 Vec with the Cooley-Turkey FFT algorithm
/// (implementation taken from Wikipedia)
///
pub fn fft(x: &Vec<Complex64>) ... | let mut k = 0; |
<|file_name|>AppService.js<|end_file_name|><|fim▁begin|>var dikoServices = angular.module('diko.basic.service', []);
dikoServices.factory('dikoShareObject', [dikoServicesFunction]);
function dikoServicesFunction() {
var tabActive= "planets";
return {
setTabActive: function(name) {
... | return tabActive; |
<|file_name|>window.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/. */
use app_units::Au;
use devtools_traits::{ScriptToDevtoolsContr... | IsInterval::NonInterval, |
<|file_name|>models.py<|end_file_name|><|fim▁begin|>import keyedcache
import logging
log = logging.getLogger(__name__)
class CachedObjectMixin(object):
"""Provides basic object keyedcache for any objects using this as a mixin.
The class name of the object should be unambiguous.
"""
def cache_delete(... | keyedcache.cache_delete(key, children=True) |
<|file_name|>server.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
#
# BBB-Network-Ammeter
#
# Copyright (c) 2016, Forest Crossman <cyrozap@gmail.com>
#
# Permission to use, copy, modify, and/or distribute this software for any
# purpose with or without fee is hereby granted, provided that the above
# copyright ... | def get_adc_voltage():
# Read a value from the ADC
value = ADC.read("P9_39") # AIN0
|
<|file_name|>bootstrap.py<|end_file_name|><|fim▁begin|>from distutils.dir_util import copy_tree, remove_tree
import os
import shutil
def _copy_function(source, destination):
print('Bootstrapping project at %s' % destination)
copy_tree(source, destination)
def create_app():
cwd = os.getcwd()
game_log... | |
<|file_name|>CFGregorianDate.java<|end_file_name|><|fim▁begin|>package org.xmlvm.ios;
import java.util.*;
<|fim▁hole|>import org.xmlvm.XMLVMSkeletonOnly;
@XMLVMSkeletonOnly
public class CFGregorianDate {
/*
* Variables
*/
public int year;
public byte month;
public byte day;
public byte hour;
public byte... | |
<|file_name|>l3gd20h_driver.go<|end_file_name|><|fim▁begin|>package i2c
import (
"bytes"
"encoding/binary"
"gobot.io/x/gobot"
)
const l3gd20hAddress = 0x6B
// Control Register 1
const l3gd20hRegisterCtl1 = 0x20
const l3gd20hNormalMode = 0x8
const l3gd20hEnableZ = 0x04
const l3gd20hEnableY = 0x02
const l3gd20hEna... |
// Start initializes the device.
func (d *L3GD20HDriver) Start() (err error) {
if err := d.initialization(); err != nil { |
<|file_name|>string.rs<|end_file_name|><|fim▁begin|><|fim▁hole|>// 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/licenses/LICENSE-2.0> or the MIT license
// <LICENSE-MIT or h... | // Copyright 2015 The Rust Project Developers. See the COPYRIGHT |
<|file_name|>base.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
#
#
# Copyright 2013 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://w... | #
# Unless required by applicable law or agreed to in writing, software |
<|file_name|>loaders.py<|end_file_name|><|fim▁begin|>from __future__ import absolute_import
"""
This module provides loaders for local file system and over http
local and remote access
"""
import os
import hmac
import requests
import yaml
import six
from six.moves.urllib.parse import unquote_plus, urlsplit, urlencod... | :rtype: None
"""
env_rx = re.compile(r'\$\{[^}]+\}') |
<|file_name|>manage.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
import os
import sys
sys.path.append('/var/www/vehicle-journal/vjournal')
if __name__ == "__main__":<|fim▁hole|> os.environ.setdefault("DJANGO_SETTINGS_MODULE", "vjournal.settings.prod")
from django.core.management import execute_from_c... | |
<|file_name|>easy_install-script.py<|end_file_name|><|fim▁begin|><|fim▁hole|># EASY-INSTALL-ENTRY-SCRIPT: 'setuptools==0.6c11','console_scripts','easy_install'
__requires__ = 'setuptools==0.6c11'
import sys
from pkg_resources import load_entry_point
sys.exit(
load_entry_point('setuptools==0.6c11', 'console_scripts'... | #!D:\PycharmProjects\UFT\Scripts\python.exe |
<|file_name|>parseutils.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
# Line too long - pylint: disable=C0301
# Invalid name - pylint: disable=C0103
"""
parseutils.py
Routines to parse "flexible" configuration files for tools like
gpaddmirrors, gprecoverseg, gpexpand, etc.
... | ('::1', '0', '/Users/ctaylor/data/p2/gpseg1')
"""
fixed = {} |
<|file_name|>test_txt_reader.py<|end_file_name|><|fim▁begin|>import unittest<|fim▁hole|>
import numpy as np
from Orange.data import ContinuousVariable, DiscreteVariable
from Orange.data.io import CSVFormat
tab_file = """\
Feature 1\tFeature 2\tFeature 3
1.0 \t1.3 \t5
2.0 \t42 \t7
"""
csv_file... | from tempfile import NamedTemporaryFile
import os |
<|file_name|>D_NFET_GS_ID.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python
'''
Study Common Emitter Characteristics of NPN transistors.
Saturation currents, and their dependence on base current
can be easily visualized.
'''
from __future__ import print_function
import time,sys,os
from SEEL_Apps.utilitiesClass impo... | self.plot.setXRange(self.V,self.stopV.value()*1.2)
self.plot.setYRange(0,20e-3)
if len(self.curves)>1:P.enableAutoRange(True,True)
|
<|file_name|>settings.py<|end_file_name|><|fim▁begin|>import os
from importlib import import_module
def import_module_attr(path):
package, module = path.rsplit('.', 1)
return getattr(import_module(package), module)
settings = import_module_attr(
os.getenv('COMMENTS_MODERATION_SETTINGS_MODULE', 'django.co... |
MODERATION_MODE = getattr(settings, 'COMMENTS_MODERATION_MODE', 'approve') |
<|file_name|>test_script.py<|end_file_name|><|fim▁begin|>import glob
import os
import subprocess
import sys
from distutils.version import LooseVersion
from typing import Iterable, List, Optional, Tuple
from scripts.lib.zulip_tools import get_dev_uuid_var_path
from version import PROVISION_VERSION
ZULIP_PATH = os.path... |
def preamble(version: str) -> str:
text = PREAMBLE % (version, PROVISION_VERSION)
text += '\n' |
<|file_name|>loginform.js<|end_file_name|><|fim▁begin|>'use strict';
angular.module('cocoApp')
.directive('loginform', [function () {<|fim▁hole|> controller: 'LoginInterceptCtrl',
scope: {
eventid: '='
},
templateUrl: 'partials/login.html'
};
}]);<|fim▁end|> | return {
restrict: 'E', |
<|file_name|>ActivityHookerGroup.java<|end_file_name|><|fim▁begin|>package com.mediatek.gallery3d.ext;
import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.Menu;
import android.view.MenuItem;
import java.util.ArrayList;
/**
* The composite pattern class.
* It wi... | @Override
public boolean onCreateOptionsMenu(Menu menu) {
super.onCreateOptionsMenu(menu); |
<|file_name|>ExampleFont-Glyphs3_autospace.py<|end_file_name|><|fim▁begin|># Reference
# Script, Category, Subcategory, case, value, referenceGlyph, filter
# Letters
*,Letter,*,upper,1.25,H,*,
*,Letter,*,smallCaps,1.1,h.sc,*,
*,Letter,*,lower,1,x,*,
*,Letter,*,minor,0.7,m.sups,.sups,
# Numbers
*,Number,Decimal Digit,... | *,Punctuation,Parenthesis,*,1.2,*,*,
*,Punctuation,Quote,*,1.2,*,*,
*,Punctuation,Dash,*,1,*,*, |
<|file_name|>webpack.dev.js<|end_file_name|><|fim▁begin|>// bundles everything except TS files which will be built by rollup.
// webpack stuff
var webpack = require('webpack');
var HtmlWebpackPlugin = require('html-webpack-plugin');
var ExtractTextPlugin = require('extract-text-webpack-plugin');
var failPlugin = requi... |
gulp.task('watch', function () { |
<|file_name|>binary_heap.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.apache.or... |
/// Consumes the `BinaryHeap` and returns a vector in sorted |
<|file_name|>sceAppUtil.cpp<|end_file_name|><|fim▁begin|>#include "stdafx.h"
#include "Emu/System.h"
#include "Emu/ARMv7/PSVFuncList.h"
#include "sceAppUtil.h"
s32 sceAppUtilInit(vm::psv::ptr<const SceAppUtilInitParam> initParam, vm::psv::ptr<SceAppUtilBootParam> bootParam)
{
throw __FUNCTION__;
}
<|fim▁hole|>}
s32... | s32 sceAppUtilShutdown()
{
throw __FUNCTION__; |
<|file_name|>rpc.rs<|end_file_name|><|fim▁begin|>// Copyright (c) 2013-2015 Sandstorm Development Group, Inc. and contributors
// Licensed under the MIT License:
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to... | }
Ok(message_target::PromisedAnswer(Ok(promised_answer))) => {
MessageReceiver::PromisedAnswer(
promised_answer.get_question_id(), |
<|file_name|>constants.py<|end_file_name|><|fim▁begin|>import scipy
# Units in SI, i.e. not cgs
RSUN = 6.955e8
MSUN = 1.9889e30
MJUP = 1.8986e27
RJUP = 7.149e7
REARTH = 6.371e6
DAY2S = 86400.0
DEG2RAD = scipy.pi/180.
AU = 1.496e11
PLANCKH = 6.626e-34
BOLTZK = 1.38065e-23<|fim▁hole|>G = 6.673e-11 # gravitational const... | C = 2.9979e8 # peed of light in vacuum in m s^-1 |
<|file_name|>messages.rs<|end_file_name|><|fim▁begin|>use fix_4_4_0::fields::*;
struct HeartbeatMessage {
test_req_id: Option<TestReqID>,
}
struct TestRequestMessage {
test_req_id: TestReqID,
}
struct ResendRequestMessage {
begin_seq_no: BeginSeqNo,
end_seq_no: EndSeqNo,
}
struct RejectMessage {
ref... | |
<|file_name|>mnc.py<|end_file_name|><|fim▁begin|>import sys
import glob
import numpy as np
from .netcdf import netcdf_file
_exclude_global = ['close',
'createDimension',
'createVariable',
'dimensions',
'filename',
'flush',
... | ie = self._ie[i] - self._nx[fn] |
<|file_name|>collapse_reads.cpp<|end_file_name|><|fim▁begin|>#include <iostream>
#include <cstdlib>
#include <fstream>
#include <sstream>
#include <string>
#include <stdexcept>
#include <vector>
#include <list>
#include <algorithm>
#include <math.h>
#include <assert.h>
#include <time.h>
#include <pthread.h>
#include <... | |
<|file_name|>server.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
"""
irc/server.py
Copyright © 2009 Ferry Boender
Copyright © 2012 Jason R. Coombs
This server has basic support for:
* Connecting
* Channels
* Nicknames
* Public/private messages
It is MISSING support for notably:
* Server linking
* Modes... | "Connected clients (IRCClient instances) by nick name"
def __init__(self, *args, **kwargs): |
<|file_name|>mod.rs<|end_file_name|><|fim▁begin|>mod rbtree;<|fim▁hole|><|fim▁end|> | pub use self::rbtree::RbTree; |
<|file_name|>adfly.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
#------------------------------------------------------------
# pelisalacarta - XBMC Plugin
# Conector para adfly (acortador de url)
# http://blog.tvalacarta.info/plugin-xbmc/pelisalacarta/
#------------------------------------------------------... | |
<|file_name|>day_three_part2.py<|end_file_name|><|fim▁begin|>class PresentDeliverer:
present_locations = {}
def __init__(self, name):
self.name = name
self.x = 0
self.y = 0
self.present_locations[self.get_key()]=1
def get_key(self):
return str(self.x)+"-"+str(self.y)
def status(self):
print(self.na... | else:
robo.move(c)
santa.unique_houses() |
<|file_name|>storageTypes.js<|end_file_name|><|fim▁begin|>'use strict';
angular.module('cmaManagementApp')
.constant('storageTypes', {
VENDOR_UID: "VENDOR_UID",
VENDOR_PASS: "VENDOR_PASS",
CLIENT_UID: "CLIENT_UID",
CLIENT_PASS: "CLIENT_PASS",
MONITOR_UID: "MONITOR_UID",
MONITOR_PASS: "... | ORCH_UID: "ORCH_UID",
ORCH_PASS: "ORCH_PASS" |
<|file_name|>test_nice.py<|end_file_name|><|fim▁begin|>from os import environ
from uwsgiconf.presets.nice import Section, PythonSection
def test_nice_section(assert_lines):
assert_lines([
'env = LANG=en_US.UTF-8',
'workers = %k',
'die-on-term = true',
'vacuum = true',
'th... | def test_get_bundled_static_path(assert_lines):
|
<|file_name|>toolbar-state-action.type.ts<|end_file_name|><|fim▁begin|>import {<|fim▁hole|> ListToolbarConfigSetFilterEnabledAction, ListToolbarConfigSetSearchEnabledAction,
ListToolbarConfigSetSortSelectorEnabledAction, ListToolbarConfigSetViewSelectorEnabledAction
} from './config/actions';
export type ListToolba... | |
<|file_name|>embeddings_test.py<|end_file_name|><|fim▁begin|># Copyright 2016 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.a... | input_dtype='int32',
expected_output_dtype='float32')
with self.test_session(): |
<|file_name|>_low_test.py<|end_file_name|><|fim▁begin|># Copyright 2015, Google Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the abov... | deadline = time.time() + 5 |
<|file_name|>test.py<|end_file_name|><|fim▁begin|>import tornado.ioloop
import tornado.web
import tornado.websocket
import os
UPLOAD_FILE_PATH = "./tempfiles/"
class MainHandler(tornado.web.RequestHandler):
def get(self):
self.render("./templates/main.html", title = "Main Page");
class EchoWebSocket(torn... | def make_app(): |
<|file_name|>toc.py<|end_file_name|><|fim▁begin|>"""
Table of Contents Extension for Python-Markdown
* * *
(c) 2008 [Jack Miller](http://codezen.org)
Dependencies:
* [Markdown 2.0+](http://www.freewisdom.org/projects/python-markdown/)
"""
import markdown
from markdown import etree
import re
class TocTreeprocessor(m... | class TocExtension(markdown.Extension):
def __init__(self, configs):
self.config = { "marker" : ["[TOC]", |
<|file_name|>GuiOptionsMixin_Forge.java<|end_file_name|><|fim▁begin|>/*
* This file is part of Sponge, licensed under the MIT License (MIT).
*
* Copyright (c) SpongePowered <https://www.spongepowered.org>
* Copyright (c) contributors
*
* Permission is hereby granted, free of charge, to any person obtaining a copy... | worldInfo.setDifficulty(newDifficulty); |
<|file_name|>no-move-across-await-struct.rs<|end_file_name|><|fim▁begin|>// edition:2018
// compile-flags: --crate-type lib
async fn no_move_across_await_struct() -> Vec<usize> {
let s = Small { x: vec![31], y: vec![19, 1441] };
needs_vec(s.x).await;
s.x
//~^ ERROR use of moved value: `s.x`
}
struct S... | |
<|file_name|>database.go<|end_file_name|><|fim▁begin|>package models
import (
"OttBot2/settings"
"database/sql"
_ "github.com/go-sql-driver/mysql"
"time"
)
var db *sql.DB<|fim▁hole|> panic(err)
}
db = newDb
timeout, err := time.ParseDuration(settings.GetDatabaseTimeout())
if err != nil {
panic(err)
}
db.... |
func MakeDB(dbConnectString string) {
newDb, err := sql.Open("mysql", dbConnectString)
if err != nil { |
<|file_name|>DFA.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
#=======================================================================
#
# Python Lexical Analyser
#
# Converting NFA to DFA
#
#=======================================================================
import Machines
from Machines import LOW... | result = {}
state.epsilon_closure = result
add_to_epsilon_closure(result, state)
return result |
<|file_name|>mapService.js<|end_file_name|><|fim▁begin|>marriageMapApp.factory('MapService', ['UtilArrayService', function(UtilArrayService) {
var mapLoading = true;
var observerPOIShowCallback = null;
var map = {
center: { latitude: null, longitude: null },
zoom: null
};
var poisDay = [
{
id : 10,
... | astuces : [{type : "astuce", value : "Les logements proposés sur la carte sont tous à moins de 10 min à pied de la salle."},{type : "astuce", value : "N'hésitez pas à regarder aussi les chambres d'hôtes, gîtes ou locations non mentionnés ici."}]
} |
<|file_name|>type_cameras.py<|end_file_name|><|fim▁begin|>"""Class to hold all camera accessories."""
import asyncio
from datetime import timedelta
import logging
from haffmpeg.core import HAFFmpeg
from pyhap.camera import (
VIDEO_CODEC_PARAM_LEVEL_TYPES,
VIDEO_CODEC_PARAM_PROFILE_ID_TYPES,
Camera as Pyhap... |
for shutdown_method in ["close", "kill"]: |
<|file_name|>uct_test.rs<|end_file_name|><|fim▁begin|>use crate::uct::{UcbType, UctConfig, UctKomiType, UctRoot};
use oppai_field::construct_field::construct_field;
use oppai_field::field::NonZeroPos;
use oppai_field::player::Player;
use oppai_test_images::*;
use rand::SeedableRng;
use rand_xoshiro::Xoshiro256PlusPlus;... |
macro_rules! uct_test {
($(#[$($attr:meta),+])* $name:ident, $image:ident, $iterations:expr, $seed:expr) => { |
<|file_name|>btSequentialImpulseConstraintSolver.cpp<|end_file_name|><|fim▁begin|>/*
Bullet Continuous Collision Detection and Physics Library
Copyright (c) 2003-2006 Erwin Coumans http://continuousphysics.com/Bullet/
This software is provided 'as-is', without any express or implied warranty.
In no event will th... | |
<|file_name|>app.module.ts<|end_file_name|><|fim▁begin|>import { NgModule } from '@angular/core';
import { BrowserModule } from '@angular/platform-browser';
import { FormsModule } from '@angular/forms';
import { RouterModule } from '@angular/router';
import { HttpModule, JsonpModule } from '@angular/http'... | |
<|file_name|>encryption_test.go<|end_file_name|><|fim▁begin|>package encryption
import (
"github.com/cgentry/gdriver"
"testing"
)
type mockDriver struct{}
type mockCrypt struct{}
func (m *mockDriver) Init() string { return "init" }
type tDriver1 struct{}
func (t *tDriver1) New() interface{} { return &mockCrypt{}... |
tstString := drv.EncryptPassword( "password","salt" )
if "password/salt" != tstString {
t.Error("Invalid return from encrypt: " + tstString) |
<|file_name|>twitch.rs<|end_file_name|><|fim▁begin|>use std;
extern crate serde_json;
extern crate serde;
use std::io::Read;
use emote;
use emote::{EmoteError,JsonError};
use http;
const GLOBAL_URL:&'static str = "https://api.twitch.tv/kraken/chat/emoticon_images?emotesets=0";
pub struct Emote<'a>{
http: &'a htt... | fn name(&self)->&str{ |
<|file_name|>fi_FI.ts<|end_file_name|><|fim▁begin|><?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE TS>
<TS version="2.1" language="fi_FI" sourcelanguage="en_US">
<context>
<name>DebugLogModel</name>
<message>
<location filename="../private/debuglogwindow.cpp" line="273"/>
<source>Timestamp</sou... | <message> |
<|file_name|>forms.py<|end_file_name|><|fim▁begin|>from django import forms
from django.contrib.admin.widgets import AdminDateWidget
from django.forms import ModelForm
from basic.models import *
from battles.models import *
from itertools import chain
def getMemberAsOptions():
members = Member.objects.all()
return ... | clan_war_type = forms.ChoiceField(ClanWar.CLAN_WAR_TYPES)
result = forms.ChoiceField(ClanWar.RESULT_CHOICES)
enemy_clans=forms.CharField(max_length=50)
|
<|file_name|>types.js<|end_file_name|><|fim▁begin|>// @flow
import type {
Action, ExpandedSet, ProfileSelection,
} from '../actions/types';
import type { Days, StartEndRange } from '../../common/types/units';
import type { IndexIntoFuncTable, Profile, ThreadIndex } from '../../common/types/profile';
import type { Tr... |
export type IconWithClassName = {
icon: string, |
<|file_name|>utils_test.go<|end_file_name|><|fim▁begin|>// Copyright (c) 2015 Uber Technologies, Inc.
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including withou... | p, err := ParsePort(test.in)
if test.err {
assert.Error(t, err) |
<|file_name|>mechanism_odl.py<|end_file_name|><|fim▁begin|># Copyright (c) 2013-2014 OpenStack Foundation
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# ... | """Filter out network attributes for an update operation.""" |
<|file_name|>icontheme.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
#
# Picard, the next-generation MusicBrainz tagger
# Copyright (C) 2006 Lukáš Lalinský
#
# 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... |
_current_theme = None
if 'XDG_CURRENT_DESKTOP' in os.environ: |
<|file_name|>setup.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
from setuptools import setup
setup(name='tagdog',
version='0.2',
description='Tag media files',<|fim▁hole|> author='Albert Pham',
author_email='the.sk89q@gmail.com',
url='https://github.com/sk89q/TagDog',
insta... | |
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|><|fim▁hole|><|fim▁end|> | from weld.grizzly.core.frame import GrizzlyDataFrame
from weld.grizzly.core.series import GrizzlySeries |
<|file_name|>DBTransferable.java<|end_file_name|><|fim▁begin|>/***************************************************
*
* cismet GmbH, Saarbruecken, Germany<|fim▁hole|>*
* ... and it just works.
*
****************************************************/
/*
* To change this template, choose Tools | Templates
* ... | |
<|file_name|>bug.js<|end_file_name|><|fim▁begin|>var mongoose = require('mongoose');
var statuses = ['open', 'closed', 'as_expected'];
var priorities = ['major','regular','minor','enhancement'];
var Comment = new mongoose.Schema(
{
comment: String,
username: String,
name: S... | next();
}); |
<|file_name|>UserDetailBuilder.java<|end_file_name|><|fim▁begin|>package com.mx.fic.inventory.business.builder;
import com.mx.fic.inventory.business.builder.config.AbstractDTOBuilder;
import com.mx.fic.inventory.business.builder.config.BuilderConfiguration;
import com.mx.fic.inventory.dto.BaseDTO;
import com.mx.fic.in... | public BaseDTO createDTO(BaseEntity entity) {
UserDetailDTO userDetailDTO = new UserDetailDTO();
UserDetail userDetail = (UserDetail) entity; |
<|file_name|>WhitespaceCompressor.java<|end_file_name|><|fim▁begin|>/*
* Copyright (c) 2013 The Interedition Development Group.
*
* This file is part of CollateX.
*
* CollateX 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... | |
<|file_name|>FindProjection.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
"""
***************************************************************************
FindProjection.py
-----------------
Date : February 2017
Copyright : (C) 2017 by Nyall Dawson
Email ... | * 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 * |
<|file_name|>FileEntry.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 to You under the... | |
<|file_name|>QuestionAuthorizationServiceTest.java<|end_file_name|><|fim▁begin|>/*
* Copyright 2005-2014 The Kuali Foundation
*
* Licensed under the Educational Community 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... | import org.kuali.kra.infrastructure.PermissionConstants;
import org.kuali.kra.test.infrastructure.KcIntegrationTestBase; |
<|file_name|>api_system_stats.py<|end_file_name|><|fim▁begin|>from api.callers.api_caller import ApiCaller
class ApiSystemStats(ApiCaller):
endpoint_url = '/system/stats'
endpoint_auth_level = ApiCaller.CONST_API_AUTH_LEVEL_DEFAULT<|fim▁hole|><|fim▁end|> | request_method_name = ApiCaller.CONST_REQUEST_METHOD_GET |
<|file_name|>comparison.go<|end_file_name|><|fim▁begin|>// Copyright (c) 2012-present The upper.io/db authors. All rights reserved.
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
// "Software"), to deal in the Software w... | // OnOrAfter indicater whether the reference is after or equal to the given
|
<|file_name|>fs.js<|end_file_name|><|fim▁begin|>// Parts of this source are modified from npm and lerna:
// npm: https://github.com/npm/npm/blob/master/LICENSE
// lerna: https://github.com/lerna/lerna/blob/master/LICENSE
// @flow
import fs from 'fs';
import path from 'path';
import _cmdShim from 'cmd-shim';
import _rea... | |
<|file_name|>github.py<|end_file_name|><|fim▁begin|>from gitmostwanted.app import celery, db
from gitmostwanted.lib.github.api import user_starred, user_starred_star
from gitmostwanted.models.repo import Repo
from gitmostwanted.models.user import UserAttitude
@celery.task()
def repo_starred_star(user_id: int, access_... | |
<|file_name|>_common.rs<|end_file_name|><|fim▁begin|>// Copyright 2015 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution and at
// http://rust-lang.org/COPYRIGHT.
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/license... | let x: f64 = text.parse().unwrap();
let f64_bytes: u64 = unsafe { transmute(x) };
let x: f32 = text.parse().unwrap();
let f32_bytes: u32 = unsafe { transmute(x) }; |
<|file_name|>routers.py<|end_file_name|><|fim▁begin|># 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 required by applicable law or... | """API Endpoints for the Federation extension.
|
<|file_name|>net.rs<|end_file_name|><|fim▁begin|>// Copyright 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/licenses/LI... | |
<|file_name|>dlae2.go<|end_file_name|><|fim▁begin|>// Copyright ©2016 The gonum Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package testlapack
import (
"fmt"
"math"
"testing"
)
type Dlae2er interface {
Dlae2(a, b, c float64... | if math.Abs(det) > 1e-10 { |
<|file_name|>CloseableIterators.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
* to ... | )
{
Preconditions.checkNotNull(comparator); |
<|file_name|>0005_rename_fields.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
<|fim▁hole|>
class Migration(SchemaMigration):
def forwards(self, orm):
db.rename_column('django_mailbox_message'... | |
<|file_name|>divider.ts<|end_file_name|><|fim▁begin|>const baseStyle = {
opacity: 0.6,
borderColor: "inherit",
}
const variantSolid = {
borderStyle: "solid",
}<|fim▁hole|>
const variants = {
solid: variantSolid,
dashed: variantDashed,
}
const defaultProps = {
variant: "solid",
}
export default {
baseSt... |
const variantDashed = {
borderStyle: "dashed",
} |
<|file_name|>db.js<|end_file_name|><|fim▁begin|>let mongoose = require('mongoose');
let URL = process.env.MONGO_URL || 'localhost';
let USER = process.env.MONGO_USR || '';
let PASSWORD = process.env.MONGO_PWD || '';<|fim▁hole|>mongoose.connect(`mongodb://${USER}:${PASSWORD}@${URL}`); //TODO doens't work for localhost
c... | |
<|file_name|>RenameBranchModal.tsx<|end_file_name|><|fim▁begin|>/*<|fim▁hole|> * mailto:info AT sonarsource DOT com
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version... | * SonarQube
* Copyright (C) 2009-2019 SonarSource SA |
<|file_name|>container.rs<|end_file_name|><|fim▁begin|>// Copyright 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/licen... | /// Visit the values representing the union
fn union(&self, other: &Self, f: &fn(&T) -> bool);
} |
<|file_name|>views.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
"""
Views to support exchange of authentication credentials.
The following are currently implemented:
1. AccessTokenExchangeView:
3rd party (social-auth) OAuth 2.0 access token -> 1st party (open-edx) OAuth 2.0 access token
2. Log... | """
View for token exchange from 3rd party OAuth access token to 1st party
OAuth access token. Uses django-oauth2-provider (DOP) to manage access |
<|file_name|>windowactivatable.py<|end_file_name|><|fim▁begin|># -*- coding: UTF-8 -*-
# Gedit External Tools plugin
# Copyright (C) 2005-2006 Steve Frécinaux <steve@istique.net>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License ... | external_tools_submenu_section = Gio.Menu()
external_tools_submenu.append_section(None, external_tools_submenu_section) |
<|file_name|>Viagem de Amigos.py<|end_file_name|><|fim▁begin|>quantidade = int (input())
cidade = input()
qt_quartos = int (input())
if cidade.lower() == "pipa":
if qt_quartos == 2:
valor_total = (quantidade * 75)+ 600
valor_unitario = valor_total / quantidade
else:
valor_total = (quant... | print("%.2f" %valor_unitario) |
<|file_name|>compatibility.py<|end_file_name|><|fim▁begin|># Copyright 2015 Cedraro Andrea <a.cedraro@gmail.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.apache.org/li... | """Returns the equivalent of 'a == b', but avoids content based short
circuiting to reduce the vulnerability to timing attacks."""
# Consistent timing matters more here than data type flexibility |
<|file_name|>Table2Util.java<|end_file_name|><|fim▁begin|>package cn.six.tutor.table2;
import org.eclipse.jface.resource.ImageDescriptor;
import org.eclipse.jface.resource.ImageRegistry;
import java.net.MalformedURLException;
import java.net.URL;
/**
* Created by songzhw on 2016/3/5.
*/
public class Table2Util {
... | |
<|file_name|>cci_iter_exe.rs<|end_file_name|><|fim▁begin|>// run-pass
// aux-build:cci_iter_lib.rs
extern crate cci_iter_lib;
pub fn main() {
//let bt0 = sys::rusti::frame_address(1);
//println!("%?", bt0);<|fim▁hole|>}<|fim▁end|> | cci_iter_lib::iter(&[1, 2, 3], |i| {
println!("{}", *i);
//assert_eq!(bt0, sys::rusti::frame_address(2));
}) |
<|file_name|>staleblock_test.cc<|end_file_name|><|fim▁begin|>/* -*- Mode: C++; tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*- */
/*
* Copyright 2016 Couchbase, Inc
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the Licens... | // enter reuse via db
i = 0;
do { |
<|file_name|>Marker.js<|end_file_name|><|fim▁begin|>/*
* L.Marker is used to display clickable/draggable icons on the map.
*/
L.Marker = L.Class.extend({
includes: L.Mixin.Events,
options: {
icon: new L.Icon(),
title: '',
clickable: true,
draggable: false
},
initialize: function(latln... | },
|
<|file_name|>s.java<|end_file_name|><|fim▁begin|>// Decompiled by Jad v1.5.8e. Copyright 2001 Pavel Kouznetsov.
// Jad home page: http://www.geocities.com/kpdus/jad.html
// Decompiler options: braces fieldsfirst space lnc
package cn.com.smartdevices.bracelet.view;
import android.animation.Animator;
// Referenced cl... | public void onAnimationCancel(Animator animator) |
<|file_name|>commands.py<|end_file_name|><|fim▁begin|>#! /usr/bin/env python
# -*- coding: utf-8 -*-
import logging
import os
from dateutil.relativedelta import relativedelta
from datetime import datetime, date
import click
from werkzeug.security import generate_password_hash
import newspipe.models
from newspipe.boo... | db.session.commit() |
<|file_name|>tier.js<|end_file_name|><|fim▁begin|>'use strict';
var mongoose = require('mongoose');
var mongoose_uuid = require('mongoose-uuid');
var mongoose_relationship = require('mongoose-relationship');
function tierModel () {
var tierSchema = mongoose.Schema({
environment: { type: String, ref: 'Environme... | |
<|file_name|>PageLoader.ts<|end_file_name|><|fim▁begin|>import AppContext from 'AppFramework/AppContext';
import {
Page,
PageRegistration,
PageModule,
PageTemplateReference,
IPageTemplates,
IPageRegistration
} from 'AppFramework/Navigation/Page';
import { State } from 'router5';
import isMobile... | class PageTemplateManager {
private loadedTemplates: {
[templateId: string]: boolean | null | undefined; |
<|file_name|>payloads.py<|end_file_name|><|fim▁begin|>import logging
import plistlib
from django.http import HttpResponse
from django.urls import reverse
from zentral.conf import settings
from zentral.utils.certificates import split_certificate_chain
from zentral.utils.payloads import generate_payload_uuid, get_payload... |
def build_profile_service_configuration_profile(ota_obj):
if isinstance(ota_obj, OTAEnrollmentSession): |
<|file_name|>ListImagesCmdImpl.java<|end_file_name|><|fim▁begin|>package com.github.dockerjava.core.command;
import static com.google.common.base.Preconditions.checkNotNull;
import java.util.List;
import java.util.Map;
import org.apache.commons.lang.builder.ReflectionToStringBuilder;
import org.apache.commons.lang.b... | } |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.