prompt large_stringlengths 70 991k | completion large_stringlengths 0 1.02k |
|---|---|
<|file_name|>main.go<|end_file_name|><|fim▁begin|>package main
import (
"flag"
"fmt"
"log"
"os"
yadisk "github.com/MOZGIII/yadisk-api"
)
var (
oAuthToken = flag.String("token", "", "OAuth token to use")
overwrite = flag.Bool("overwrite", false, "do you want to overwrite the file if it exists")
verbose = ... | |
<|file_name|>test.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
import sys
import organizations
try:
from setuptools import setup
except ImportError:
from distutils.core import setup
if sys.argv[-1] == 'publish':
os.system('python setup.py sdist upload')
os.s... | 'Environment :: Web Environment', |
<|file_name|>urls.py<|end_file_name|><|fim▁begin|>from django.conf.urls import url
from . import views
urlpatterns = [
url(r'^$', views.{{ model_name }}List.as_view(), name='list'),
url(r'^new/$', views.{{ model_name }}Create.as_view(), name='create'),
url(r'^(?P<pk>\d+)/$', views.{{ model_name }}Detail.... | |
<|file_name|>find_section.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python3
import sys
import re
def isSectionStart(line, interface=""):
sectionpattern = "^[0-9]+:\\s+%s"
return re.match(sectionpattern%interface, line) != None
def printSection(interface, lines):
in_section = False
for line in l... | if isSectionStart(line):
return |
<|file_name|>download.py<|end_file_name|><|fim▁begin|>import os
from com.googlecode.fascinator.api.indexer import SearchRequest
from com.googlecode.fascinator.api.storage import StorageException
from com.googlecode.fascinator.common.solr import SolrDoc, SolrResult
from org.apache.tapestry5.internal.services import URL... | #print "Failed to access payload: %s" % (str(e))
return None, None |
<|file_name|>P_10039.java<|end_file_name|><|fim▁begin|>package Problems;
import java.io.IOException;
import java.util.Scanner;
/**
* Created by nhs0912 on 2016-12-15.
*/
public class P_10039 {
public static void main(String[] args) throws IOException {
Scanner sc = new Scanner(System.in);
int su... | |
<|file_name|>two_layer_neural_network.py<|end_file_name|><|fim▁begin|>import sys
import numpy as np
# sigmoid function
def nonlin(x, deriv=False):
if(deriv==True):
return x*(1-x)
return 1/(1+np.exp(-x))
# input dataset
X = np.array([[0,0,1],
[0,1,1],
[1,0,1],
... | # seed random numbers to make calculation
# deterministic (just a good practice) |
<|file_name|>job-detail.service.js<|end_file_name|><|fim▁begin|>(function(){
'use strict'
angular
.module("jobDetail")
.service("jobDetailService",jobDetailService);
jobDetailService.$inject = ['apiService','apiOptions'];
function jobDetailService(apiService,apiOptions)
{
var jobId;
this.getJobDetail=fu... | // return "ok";
return apiService.get("job/"+jobId); |
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|># -*- encoding: utf-8 -*-
##############################################################################
#
# Admin Passkey module for Odoo<|fim▁hole|>#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Af... | # Copyright (C) 2013-2014 GRAP (http://www.grap.coop)
# @author Sylvain LE GAL (https://twitter.com/legalsylvain) |
<|file_name|>vservermanager.py<|end_file_name|><|fim▁begin|># This software may be freely redistributed under the terms of the GNU
# general public license.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 675 Mass Av... |
import personmanager |
<|file_name|>APItype1.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright (C) 2005 onwards University of Deusto
# All rights reserved.
#
# This software is licensed as described in the file COPYING, which
# you should have received as part of this distribution.
#<|fim▁hole|># This so... | |
<|file_name|>DiffMergeSettingsAction.java<|end_file_name|><|fim▁begin|>// Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
package com.intellij.openapi.diff.impl.settings;
import com.intellij.icons.AllIcons;
import com.intellij.id... | super("Settings", null, AllIcons.General.GearPlain);
setPopup(true);
myEditors = editors; |
<|file_name|>main.go<|end_file_name|><|fim▁begin|>package main
import (
"flag"
"fmt"
"os"
"os/user"
"path/filepath"
"github.com/gen2brain/gsmgo"
)
func main() {
cfg := flag.String("config", "", "Config file")
debug := flag.Bool("debug", false, "Enable debugging")
text := flag.String("text", "", "Text Messag... | |
<|file_name|>sha1.js<|end_file_name|><|fim▁begin|>/**
* Copyright 2013 Google, Inc.
* @fileoverview Calculate SHA1 hash of the given content.
*/
goog.provide("adapt.sha1");
goog.require("adapt.base");
/**
* @param {number} n
* @return {string} big-endian byte sequence
*/
adapt.sha1.encode32 = function(n) {
ret... | |
<|file_name|>cleanup_tokens.py<|end_file_name|><|fim▁begin|>import logging
from django.core import management
from django.core.management.base import BaseCommand
from awx.main.models import OAuth2AccessToken
from oauth2_provider.models import RefreshToken
class Command(BaseCommand):
def init_logging(self):
... | logging.DEBUG, 0])) |
<|file_name|>DumpMassCharge.cpp<|end_file_name|><|fim▁begin|>/* +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Copyright (c) 2015-2020 The plumed team
(see the PEOPLE file at the root of the distribution for a list of names)
See http://www.plumed.org for more information.
This f... | \plumedfile
solute_ions: GROUP ATOMS=1-121,200-2012
DUMPATOMS FILE=traj.gro ATOMS=solute_ions STRIDE=100
DUMPMASSCHARGE FILE=mcfile ATOMS=solute_ions |
<|file_name|>apache_conf.js<|end_file_name|><|fim▁begin|>ace.define("ace/snippets/apache_conf",["require","exports","module"], function(require, exports, module) {
"use strict";
exports.snippetText = "";
exports.scope = "apache_conf";
});
(function() {
ace.require(["ace/snippets/ap... | module.exports = m;
}
});
})(); |
<|file_name|>middleware.py<|end_file_name|><|fim▁begin|>from datetime import datetime
from parsedatetime import parsedatetime, Constants
from scrapy import signals
from scrapy.xlib.pydispatch import dispatcher
from scrapy.exceptions import NotConfigured, IgnoreRequest
from scrapy.utils.misc import load_object
class ... |
return response |
<|file_name|>3迭代器.java<|end_file_name|><|fim▁begin|>/*µü´úÆ÷ģʽ
*
* ±éÀú¼¯ºÏµÄÖ°Ôð·ÖÀë³öÀ´£»
*/
/**°×Ïä¾ÛºÏ+Íâµü´ú×Ó*/
public interface Iterator
{
public Object first();
public Object next();
//µÃµ½µ±Ç°¶ÔÏó
public Object currentItem();
//ÊÇ·ñµ½Á˽áβ
public boolean isDone();
}
... | |
<|file_name|>run.py<|end_file_name|><|fim▁begin|># Copyright 2017 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""This program wraps an arbitrary command since gn currently can only execute
scripts."""
import os
import... | args = sys.argv[1:]
args[0] = os.path.abspath(args[0])
|
<|file_name|>icons.py<|end_file_name|><|fim▁begin|>by_ext = [
('py.png', 'py'),
('python.png', 'pyc'),
('page_white_text_width.png', ['md', 'markdown', 'rst', 'rtf']),
('page_white_text.png', 'txt'),
('page_white_code.png', ['html', 'htm', 'cgi']),
('page_white_visualstudio.png', ['asp', 'vb']),... | ('page_white_database.png', 'sql'),
('page_white_gear.png', ['conf', 'cfg', 'ini', 'reg', 'sys']),
('page_white_zip.png', ['zip', 'tar', 'gz', 'tgz', '7z', 'alz', 'rar',
'bin', 'cab']), |
<|file_name|>issue-34053.rs<|end_file_name|><|fim▁begin|>// run-pass
use std::sync::atomic::{AtomicUsize, Ordering};
static DROP_COUNTER: AtomicUsize = AtomicUsize::new(0);
struct A(i32);
impl Drop for A {
fn drop(&mut self) {
// update global drop count
DROP_COUNTER.fetch_add(1, Ordering::SeqCst... | } |
<|file_name|>stateless_random_ops.cc<|end_file_name|><|fim▁begin|>/* Copyright 2017 The TensorFlow Authors. All Rights Reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apach... | |
<|file_name|>mainwindow.cpp<|end_file_name|><|fim▁begin|>#include "mainwindow.h"
#include "ui_mainwindow.h"
MainWindow::MainWindow(QWidget *parent) :
QMainWindow(parent),
ui(new Ui::MainWindow)
{
ui->setupUi(this);
create_tray_icon();
state = STATE_STOP;
time = 0;
connect(&timer, SIGNAL(tim... | } |
<|file_name|>react-app-env.d.ts<|end_file_name|><|fim▁begin|><|fim▁hole|>/// <reference types="react-scripts" />
declare module "office-ui-fabric-react/lib/Modal" {
const Modal: React.StatelessComponent<IModalProps>;
}<|fim▁end|> | |
<|file_name|>routes.js<|end_file_name|><|fim▁begin|>// app/routes.js
module.exports = function(app, request, Lob) {
var googleApiKey = 'AIzaSyAVcJflF_0GpUzioGph0e8edJQeatd-330';
app.get('/', function(req, res) {
res.sendfile('./public/index.html');
});
app.get('/api/getreps', function(req, re... | }
} |
<|file_name|>bcrypt.py<|end_file_name|><|fim▁begin|>"""passlib.bcrypt -- implementation of OpenBSD's BCrypt algorithm.
TODO:
* support 2x and altered-2a hashes?
http://www.openwall.com/lists/oss-security/2011/06/27/9
* deal with lack of PY3-compatibile c-ext implementation
"""
#====================================... | #=============================================================================
from __future__ import with_statement, absolute_import |
<|file_name|>webglbuffer.rs<|end_file_name|><|fim▁begin|>/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
// https://www.khronos.org/registry/webgl/specs/latest/1... | self.attached_counter |
<|file_name|>listener.rs<|end_file_name|><|fim▁begin|>extern crate lcm;
extern crate env_logger;
extern crate example;
use example::exlcm;
fn main() {
env_logger::init().unwrap();
let mut lcm = lcm::Lcm::new().unwrap();
lcm.subscribe("EXAMPLE",
|msg: exlcm::Example| println!("Received ... | println!("Error handling message: {}", e);
})
}
} |
<|file_name|>hsts.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 net::hsts::{HstsEntry, HstsList};
use net_traits::IncludeSub... | |
<|file_name|>getat_func_test.rs<|end_file_name|><|fim▁begin|>use super::*;
use crate::test;
use envmnt;
#[test]
#[should_panic]
fn getat_invoke_empty() {
invoke(&vec![]);
}
#[test]
#[should_panic]
fn getat_invoke_invalid_too_many_args() {
test::on_test_startup();
invoke(&vec![
"TEST".to_string(),... | ]);
|
<|file_name|>jukebox_mpg123.py<|end_file_name|><|fim▁begin|># -*- coding: UTF-8 -*-
from django.core.management.base import BaseCommand
from optparse import make_option
import daemon
import daemon.pidfile
from signal import SIGTSTP, SIGTERM, SIGABRT
import sys, os, subprocess
import time
from jukebox.jukebox_core impor... | return
pidFile = os.path.dirname( |
<|file_name|>htmltextareaelement.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 dom::attr::{Attr, AttrValue};
use dom::bindin... | |
<|file_name|>test_html_formatter.py<|end_file_name|><|fim▁begin|><|fim▁hole|> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
:copyright: Copyright 2006-2009 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
import os
import re
import unittest
import StringIO
import tempfile
from os.path import ... | # -*- coding: utf-8 -*-
"""
Pygments HTML formatter tests |
<|file_name|>CreateMapView.js<|end_file_name|><|fim▁begin|>import React, { Component } from 'react';
import { GoogleMapLoader, GoogleMap, Marker, SearchBox } from 'react-google-maps';
class CreateMapView extends Component {
constructor(props) {
super(props);
this.state = {
coordinates: '',
... | const coordinates = lat.concat(',').concat(lng);
this.props.addMarker(coordinates);
this.props.onLocationChange(address);
}
|
<|file_name|>bitcoin_af_ZA.ts<|end_file_name|><|fim▁begin|><?xml version="1.0" ?><!DOCTYPE TS><TS language="af_ZA" version="2.0">
<defaultcodec>UTF-8</defaultcodec>
<context>
<name>AboutDialog</name>
<message>
<location filename="../forms/aboutdialog.ui" line="+14"/>
<source>About Gamecash</sour... | <message>
<location line="+3"/> |
<|file_name|>test_extractvaspdata.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python3
import unittest
from tests import testfunctions
from dftintegrate.fourier import vaspdata
class TestExtractingVASPDataToDatFiles(unittest.TestCase,
testfunctions.TestFunctions):
def s... | self.root = './tests/fourier/extractvaspdata/' |
<|file_name|>expr-if.rs<|end_file_name|><|fim▁begin|>// run-pass
// Tests for if as expressions
fn test_if() { let rs: bool = if true { true } else { false }; assert!((rs)); }
fn test_else() {
let rs: bool = if false { false } else { true };
assert!((rs));
}
fn test_elseif1() {
let rs: bool = if true { t... | assert!((rs2));
} |
<|file_name|>panel.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 a... | |
<|file_name|>largest_BST_in_a_binary_tree.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
"""
Created on Thu Nov 19 17:38:50 2015<|fim▁hole|>
from binaryTree import BTree, generateRandomTree, inorder
def largestBST(root):
if root.left is None and root.right is None:
return True, 1, root.value, root... |
@author: deep
""" |
<|file_name|>settings.py<|end_file_name|><|fim▁begin|># Django settings for ibistu_serverV2_webserver project.
DEBUG = True
TEMPLATE_DEBUG = DEBUG
ADMINS = (
('admin', 'c0710204@gmail.com'),
)
MANAGERS = ADMINS
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3', # Add 'postgresql_psyc... | |
<|file_name|>set-replication-paused.ts<|end_file_name|><|fim▁begin|>import { InternalMethods } from './types'
import fetch from 'node-fetch'
import HttpError from './http-error'
import {
PAUSE_REPLICATION,
RESUME_REPLICATION,
} from '@resolve-js/module-replication'
const setReplicationPaused: InternalMethods['set... | }
export default setReplicationPaused |
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|># Copyright (c) 2014 GigaSpaces Technologies Ltd. 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://ww... |
if logined is False and password:
for _ in range(LOGIN_RETRY_NUM):
logined = vca.login(password, org=org_name) |
<|file_name|>filesystemitem.py<|end_file_name|><|fim▁begin|>from PyQt5.QtCore import Qt
from ouf.filemodel.filemodelitem import FileModelItem, FileItemType
class FileSystemItem(FileModelItem):
def __init__(self, path):
super().__init__(FileItemType.filesystem, path)<|fim▁hole|> if role == Qt.... |
def data(self, column, role=Qt.DisplayRole):
if column == 0: |
<|file_name|>test_keepalived.py<|end_file_name|><|fim▁begin|># Copyright (c) 2014 Red Hat, Inc.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# htt... | super(KeepalivedManagerTestCase, self).setUp()
cfg.CONF.set_override('check_child_processes_interval', 1, 'AGENT')
self.expected_config = self._get_config() |
<|file_name|>animate.rs<|end_file_name|><|fim▁begin|>/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
use darling::util::IdentList;
use derive_common::cg;
use pro... | |
<|file_name|>ledServer.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
import sys, inspect, cgi, os, subprocess, pipes, json, select, time, threading
from BaseHTTPServer import BaseHTTPRequestHandler, HTTPServer
from urlparse import parse_qs
from threading import Thread
from gpiozero import RGBLED
from gpiozero i... | time.sleep(0.05)
self.loadAndSetColor('#CC0000') |
<|file_name|>controller.go<|end_file_name|><|fim▁begin|>package helper
import (
"context"
"encoding/json"
"fmt"
"k8s.io/apimachinery/pkg/runtime"
"k8s.io/apimachinery/pkg/types"
"k8s.io/apimachinery/pkg/util/strategicpatch"
"k8s.io/klog/v2"
"time"
corev1 "k8s.io/api/core/v1"
"sigs.k8s.io/controller-runtime/... | Name: target.GetName(), |
<|file_name|>setup.py<|end_file_name|><|fim▁begin|># This file is part of MyPaint.
# Imports:
from __future__ import print_function
import subprocess
import glob
import os
import os.path
import sys
import textwrap
from distutils.command.build import build
from distutils.command.clean import clean
from setuptools im... | ) |
<|file_name|>browser.js<|end_file_name|><|fim▁begin|>/* ========================================================================
* ZUI: browser.js
* http://zui.sexy
* ========================================================================
* Copyright (c) 2014 cnezsoft.com; Licensed MIT
* =========================... | $html.addClass('ie-' + ie)
.toggleClass('gt-ie-7 gte-ie-8 support-ie', ie >= 8)
.toggleClass('lte-ie-7 lt-ie-8 outdated-ie', ie < 8) |
<|file_name|>doExtractProj.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
"""
***************************************************************************
doExtractProj.py
---------------------
Date : August 2011
Copyright : (C) 2011 by Alexander Bruy
Email ... | error_mod = error_str.replace( "No module named ", "" )
if req_mods.has_key( error_mod ):
error_str = error_str.replace( error_mod, req_mods[error_mod] ) |
<|file_name|>test-ignore-cfg.rs<|end_file_name|><|fim▁begin|>// Copyright 2012-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... | #[test]
fn checktests() {
// Pull the tests out of the secreturn test module |
<|file_name|>Configurator.java<|end_file_name|><|fim▁begin|>package com.kellydavid.dfs.config;
import java.io.*;
import java.util.HashMap;
/**
* Created by david on 31/01/2016.
*/
public class Configurator {
private String filename;<|fim▁hole|> this.filename = filename;
configuration = new HashM... | private HashMap<String, String> configuration;
public Configurator(String filename){ |
<|file_name|>CommonSocket.cpp<|end_file_name|><|fim▁begin|>/*
Smooth - A C++ framework for embedded programming on top of Espressif's ESP-IDF
Copyright 2019 Per Malmberg (https://gitbub.com/PerMalmberg)
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with ... | distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
<|file_name|>stream.pb.go<|end_file_name|><|fim▁begin|>// Code generated by protoc-gen-go.
// source: examples/examplepb/stream.proto
// DO NOT EDIT!
package examplepb
import proto "github.com/golang/protobuf/proto"
import fmt "fmt"
import math "math"
import _ "github.com/grpc-ecosystem/grpc-gateway/third_party/googl... | 0x62, 0xae, 0x25, 0xc2, 0x9b, 0x9c, 0xf3, 0x3a, 0xcd, 0x9b, 0x34, 0x3b, 0xd3, 0xd6, 0xea, 0x04, |
<|file_name|>imageLoader.ts<|end_file_name|><|fim▁begin|>import {celm} from "./canvas";
type Data = [number, number, () => void];
const datas: Data[] = [];
export const images: HTMLImageElement[] = [];
export function loadPrerender(id: number, w: number, h: number, cb: () => void) {
datas[id] = [w, h, cb];
}
// e... | } |
<|file_name|>ember-chart.js<|end_file_name|><|fim▁begin|>// Idea and initial code from https://github.com/aomra015/ember-cli-chart
import Ember from 'ember';
export default Ember.Component.extend({
tagName: 'canvas',
attributeBindings: ['width', 'height'],
onlyValues: false,
chartData: {},
didInsertElement... | |
<|file_name|>SetLoadBalancerPoliciesForBackendServerResult.cpp<|end_file_name|><|fim▁begin|>/*
* Copyright 2010-2015 Amazon.com, Inc. or its affiliates. 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.
* A copy of... | return *this;
} |
<|file_name|>jquery.editlive.sync.js<|end_file_name|><|fim▁begin|>;(function($){
var objects = {};
$.editlive.sync = function() {
$('editlive').each(function(){
var el = $(this);
if (el.attr('app-label') && el.attr('module-name') && el.attr('field-name') && el.attr('object-id')... |
$(function(){ |
<|file_name|>product.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
##############################################################################
#
# Copyright 2012 Camptocamp SA
# Copyright 2012 Endian Solutions BV
#
# This program is free software: you can redistribute it and/or modify
# it unde... | |
<|file_name|>services.py<|end_file_name|><|fim▁begin|>from pixelated.adapter.mailstore.searchable_mailstore import SearchableMailStore
from pixelated.adapter.services.mail_service import MailService
from pixelated.adapter.model.mail import InputMail
from pixelated.adapter.services.mail_sender import MailSender
from pix... | all_mails = yield self.mail_service.all_mails() |
<|file_name|>ttf.rs<|end_file_name|><|fim▁begin|><|fim▁hole|>use std::path::Path;
use sdl2_sys::pixels::{SDL_Color,SDL_PIXELFORMAT_ARGB8888};
use sdl2_sys::surface::SDL_Surface;
use sdl2_sys::surface;
use gl;
use common::color::Color4;
use yaglw::gl_context::GLContext;
use yaglw::texture::Texture2D;
#[allow(non_came... | //! Module for creating text textures.
use std::ffi::CString; |
<|file_name|>C3DGridServiceResourceHome.java<|end_file_name|><|fim▁begin|>/*
* Copyright Ekagra and SemanticBits, LLC
*
* Distributed under the OSI-approved BSD 3-Clause License.
* See http://ncip.github.com/clinical-connector/LICENSE.txt for details.
*/
package gov.nih.nci.cdmsconnector.c3d.service.globus.resour... | return thisResource; |
<|file_name|>sendable-class.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.apache.org/... | // Test that a class with only sendable fields can be sent
struct foo { |
<|file_name|>models.py<|end_file_name|><|fim▁begin|>from pytz import utc
from datetime import datetime
from django.db import models
from django.conf import settings
from django.core.exceptions import ValidationError
from django.dispatch import receiver
from django.db.models.signals import pre_save, post_save
from dja... | |
<|file_name|>amazonec2.go<|end_file_name|><|fim▁begin|>package amazonec2
import (
"crypto/md5"
"crypto/rand"
"errors"
"fmt"
"io"
"io/ioutil"
"net"
"net/url"
"strconv"
"strings"
"time"
"github.com/aws/aws-sdk-go/aws"
"github.com/aws/aws-sdk-go/aws/awserr"
"github.com/aws/aws-sdk-go/aws/session"
"github.... | |
<|file_name|>clock.js<|end_file_name|><|fim▁begin|>module.exports = function () {
var modules = [];
var creeps = Game.creeps;
var spawn = Game.spawns.Spawn1;
var score = spawn ? spawn.room.survivalInfo.score : 0;
var minions = {
total: 0,
build: 0,
carry: 0,
harvest: ... | modules.push(RANGED_ATTACK, RANGED_ATTACK, RANGED_ATTACK, MOVE, MOVE);
spawnCreep(modules, {module: 'guard'}); |
<|file_name|>solutions.py<|end_file_name|><|fim▁begin|>__problem_title__ = "Counting rectangles"
__problem_url___ = "https://projecteuler.net/problem=85"
__problem_description__ = "By counting carefully it can be seen that a rectangular grid " \
"measuring 3 by 2 contains eighteen rectangles: ... | |
<|file_name|>InstructorRepository.java<|end_file_name|><|fim▁begin|>package platzi.app;
import java.util.Optional;
<|fim▁hole|> Optional<Instructor> findByUsername(String username);
}<|fim▁end|> | import org.springframework.data.jpa.repository.JpaRepository;
public interface InstructorRepository extends JpaRepository<Instructor, Long> { |
<|file_name|>news.js<|end_file_name|><|fim▁begin|>/*
This file is part of KUMobile.
KUMobile 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... | KUMobile.News.loading = false;
|
<|file_name|>fetch-json.pipe.ts<|end_file_name|><|fim▁begin|>// #docregion
import { Pipe, PipeTransform } from '@angular/core';
import { Http } from '@angular/http';
import 'rxjs/add/operator/map';
// #docregion pipe-metadata
@Pipe({
name: 'fetch',
pure: false
})
// #enddocregion pipe-metadata<|fim... | export class FetchJsonPipe implements PipeTransform {
private cachedData: any = null; |
<|file_name|>check_placements.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
#
# Copyright 2020 Espressif Systems (Shanghai) PTE LTD
#
# 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
#
#... | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and |
<|file_name|>trade.component.spec.ts<|end_file_name|><|fim▁begin|>import { async, ComponentFixture, TestBed } from '@angular/core/testing';
import { TradeComponent } from './trade.component';
describe('TradeComponent', () => {
let component: TradeComponent;
let fixture: ComponentFixture<TradeComponent>;
<|fim▁hol... | beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [ TradeComponent ] |
<|file_name|>subresource.py<|end_file_name|><|fim▁begin|># Copyright (c) 2014 OpenStack Foundation.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICEN... | """
Convert a URI to one of the predefined groups.
""" |
<|file_name|>bitcoin_fa.ts<|end_file_name|><|fim▁begin|><?xml version="1.0" ?><!DOCTYPE TS><TS language="fa" version="2.1">
<context>
<name>AboutDialog</name>
<message>
<location filename="../forms/aboutdialog.ui" line="+14"/>
<source>About Vroomcoin</source>
<translation type="unf... | <translation type="unfinished"/>
</message>
|
<|file_name|>firewall_cmds.py<|end_file_name|><|fim▁begin|># Copyright 2012 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/lice... | # We only handle the 'then' case because in the other case the
# existing entry already allows all ports.
if not port_string: |
<|file_name|>admin_list.py<|end_file_name|><|fim▁begin|>import datetime
from django.contrib.admin.templatetags.admin_urls import add_preserved_filters
from django.contrib.admin.utils import (
display_for_field, display_for_value, label_for_field, lookup_field,
)
from django.contrib.admin.views.main import (
AL... | |
<|file_name|>bitcoin_ja.ts<|end_file_name|><|fim▁begin|><?xml version="1.0" ?><!DOCTYPE TS><TS language="ja" version="2.0">
<defaultcodec>UTF-8</defaultcodec>
<context>
<name>AboutDialog</name>
<message>
<location filename="../forms/aboutdialog.ui" line="+14"/>
<source>About Wisecoin</source>
... | <translation type="unfinished"/>
</message> |
<|file_name|>lib.rs<|end_file_name|><|fim▁begin|>use std::io::{self, Write};
#[derive(Debug, Clone, PartialEq, Eq)]
pub enum ChistErrorType {
ActOnError,
InvalidType,
TooFewElements { expected: usize, actual: usize },
UnknownError,
DivideByZero,
}
#[derive(Debug, Clone)]
pub struct ChistError {
... | index: usize, |
<|file_name|>testgridff2.py<|end_file_name|><|fim▁begin|>from Sire.IO import *
from Sire.MM import *
from Sire.System import *<|fim▁hole|>from Sire.Maths import *
from Sire.FF import *
from Sire.Move import *
from Sire.Units import *
from Sire.Vol import *
from Sire.Qt import *
import os
coul_cutoff = 20 * angstrom
l... | from Sire.Mol import * |
<|file_name|>expression.py<|end_file_name|><|fim▁begin|># Copyright 2016 Matthew Egan Odendahl
#
# 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 genr():
# kills zombie thread when this is gc'd
thread_terminator = _terminator |
<|file_name|>dialog.rs<|end_file_name|><|fim▁begin|>#![allow(non_snake_case)]
/*
use super::super::win::types::*;
use super::super::win::api::*;
use super::super::Wnd;
// 所有窗口 组件 都必须实现的接口。
// 部分方法 preTranslate wndProc 消息映射需要用到.
struct Dialog{
hWnd: HWND,
wndProc: WndProc
}
impl Wnd for Dialog{
// fn getSelf(... | |
<|file_name|>vec-res-add.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.apache.org/lic... | let j = vec!(r(1)); |
<|file_name|>transform.js<|end_file_name|><|fim▁begin|>const crypto = require('crypto')
module.exports = function (doc) {
doc._source.bar = crypto
.createHash('md5')
.update(String(doc._source.foo))<|fim▁hole|><|fim▁end|> | .digest('hex')
} |
<|file_name|>arcs-devtools-app.js<|end_file_name|><|fim▁begin|>/**
* @license
* Copyright 2019 Google LLC.
* This code may only be used under the BSD style license found at
* http://polymer.github.io/LICENSE.txt
* Code distributed by Google as part of this project is also
* subject to an additional IP rights gran... | overflow: auto;
} |
<|file_name|>SkTileImageFilter.cpp<|end_file_name|><|fim▁begin|>/*
* Copyright 2013 Google Inc.
*
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
#include "SkTileImageFilter.h"
#include "SkColorSpaceXformer.h"
#include "SkCanvas.h"
#include "SkImage.h"
#inc... | SkIRect SkTileImageFilter::onFilterNodeBounds(const SkIRect& src, const SkMatrix& ctm,
MapDirection dir, const SkIRect* inputRect) const {
SkRect rect = kReverse_MapDirection == dir ? fSrcRect : fDstRect;
ctm.mapRect(&rect); |
<|file_name|>uz.js<|end_file_name|><|fim▁begin|>// moment.js locale configuration
// locale : uzbek (uz)
// author : Sardor Muminov : https://github.com/muminoff
(function (factory) {
if (typeof define === 'function' && define.amd) {
define(['moment'], factory); // AMD
} else if (typeof exports === 'ob... | week : {
dow : 1, // Monday is the first day of the week.
doy : 7 // The week that contains Jan 4th is the first week of the year.
} |
<|file_name|>deployment_properties.py<|end_file_name|><|fim▁begin|># coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# ... | # --------------------------------------------------------------------------
from msrest.serialization import Model |
<|file_name|>qgis_local_server.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
"""Convenience interface to a locally spawned QGIS Server, e.g. for unit tests
.. note:: 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 F... | # 'CRS': QgsCoordinateReferenceSystem obj
'CRS': 'EPSG:32613',
# 'BBOX': QgsRectangle(606510, 4823130, 612510, 4827130) |
<|file_name|>test_sxp.py<|end_file_name|><|fim▁begin|><|fim▁hole|>import xen.xend.sxp
class test_sxp(unittest.TestCase):
def testAllFromString(self):
def t(inp, expected):
self.assertEqual(xen.xend.sxp.all_from_string(inp), expected)
t('String', ['String'])
t('(Stri... | import unittest
|
<|file_name|>UICanvas.js<|end_file_name|><|fim▁begin|>"use strict";
import {Vector2, Vector3, Matrix4, Vector4} from 'vectormath';
/*
NOTE: this was originally a WebGL UI library I wrote.
it's gone through several transitions since then, and
is now a canvas2d UI library (bleh). the code is quite
horrible.
*/
#inclu... | |
<|file_name|>TsCmp.cc<|end_file_name|><|fim▁begin|>#include <iostream>
#include <fstream>
#include <sstream>
#include <boost/algorithm/string.hpp>
#include "storage/DevicegraphImpl.h"
#include "storage/Environment.h"
#include "storage/Storage.h"
#include "storage/Action.h"
#include "storage/Pool.h"
#include "storage/D... | TsCmpActiongraph::Expected::Expected(const string& filename)
{
std::ifstream fin(filename);
if (!fin) |
<|file_name|>restyle_damage.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 restyle damage is a hint that tells layout whi... | /// Supposing a flow has the given `position` property and this damage,
/// returns the damage that we should add to the *parent* of this flow.
pub fn damage_for_parent(self, child_is_absolutely_positioned: bool) -> ServoRestyleDamage { |
<|file_name|>utils.py<|end_file_name|><|fim▁begin|>from django.conf import settings
<|fim▁hole|> )<|fim▁end|> | def bitgroup_cache_key(slug):
return "%s:%s" % (
getattr(settings, 'PAGEBIT_CACHE_PREFIX', 'pagebits'),
slug |
<|file_name|>lights.js<|end_file_name|><|fim▁begin|>/**
* Copyright (C) 2014-2016 Triumph LLC
*
* 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 y... | var lamp = lamps[i]; |
<|file_name|>icon-picker.tsx<|end_file_name|><|fim▁begin|>import React from 'react';
import { FieldProps } from 'formik';
import { Text, BorderBox, FilterList } from '@primer/components';
import { iconThemes } from '@renderer/icons';
const IconPicker: React.FC<FieldProps> = ({ field, form }): JSX.Element => {
const... | }}
/> |
<|file_name|>default_retryer.go<|end_file_name|><|fim▁begin|>package service
import (
"math"
"math/rand"
"time"
"github.com/rlister/let-me-in/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws"
"github.com/rlister/let-me-in/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/request"
)
// DefaultRetryer implem... | |
<|file_name|>RemoteCeilingFanTest.java<|end_file_name|><|fim▁begin|>package command;
import org.junit.Test;
/**
* Created by eder on 19/10/15.
*/
public class RemoteCeilingFanTest {
@Test
public void testRemoteControlCeilingFan(){
RemoteControl remoteControl = new RemoteControl();
CeilingF... | CeilingFanHightCommand ceilingFanHightCommand = new CeilingFanHightCommand(ceilingFan);
CeilingFanMediumCommand ceilingFanMediumCommand = new CeilingFanMediumCommand(ceilingFan);
CeilingFanOffCommand ceilingFanOffCommand = new CeilingFanOffCommand(ceilingFan);
|
<|file_name|>EmbeddedSubprocessPropertyWriterTest.java<|end_file_name|><|fim▁begin|>/*
* Copyright 2019 Red Hat, Inc. and/or its affiliates.
*
* 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 ... | public void testSetSlaDueDate() {
String slaDueDate = "12/25/1983"; |
<|file_name|>dist.js<|end_file_name|><|fim▁begin|>var gulp = require('gulp');<|fim▁hole|><|fim▁end|> |
gulp.task('dist', ['setProduction', 'sass:dist', 'browserify:dist']); |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.