prompt large_stringlengths 70 991k | completion large_stringlengths 0 1.02k |
|---|---|
<|file_name|>rectangle_overlap.py<|end_file_name|><|fim▁begin|>import cv2
import numpy as np
template = np.zeros((500,500,3),np.uint8)
template[:,:,0] = 255
template[:,:,1] = 255
template[:,:,2] = 255
x = [50,250,250,50,50]
y = [50,50,250,250,50]
cnt = np.asarray(zip(x,y))
cv2.drawContours(template,[cnt],0,0,1)
x ... | y = [200,200,400,400,200]
cnt = np.asarray(zip(x,y)) |
<|file_name|>vteconv.cc<|end_file_name|><|fim▁begin|>/*
* Copyright (C) 2003 Red Hat, Inc.
*
* This library 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 2.1 of the License, or ... | |
<|file_name|>library.js<|end_file_name|><|fim▁begin|>/*
* forms.js: highlight form-related elements
*/
function initForms () {
addPolyfills();
let targetList = [
{selector: "button", color: "purple", label: "button"},
{selector: "input", color: "navy", label: "input"},
{selector: "keygen", ... | |
<|file_name|>settings.py<|end_file_name|><|fim▁begin|>import os
import sys
HOSTNAME = os.environ.get('QLF_HOSTNAME', 'localhost')
BASE_DIR = os.path.dirname(
os.path.dirname(os.path.abspath(__file__))
)
SECRET_KEY = os.environ.get('SECRET_KEY', os.urandom(32))
ALLOWED_HOSTS = os.environ.get('ALLOWED_HOSTS', HOS... |
LANGUAGE_CODE = 'en-us' |
<|file_name|>index.native.js<|end_file_name|><|fim▁begin|>import { BINARY_COLOR_SAND_90 } from 'binary-ui-styles';
import styled from 'styled-components/native';
export default styled.View`
align-items: center;
border-bottom-color: ${BINARY_COLOR_SAND_90};
border-bottom-width: 1px;
height: 50px;<|fim▁hole|> o... | justify-content: center; |
<|file_name|>main.rs<|end_file_name|><|fim▁begin|>mod word_list;
mod hangman;
fn main() {<|fim▁hole|> 2 => word_list::get_random_word(&args[1]),
_ => word_list::get_random_word("../data/wordlist")
};
hangman::start_game(random_word);
}<|fim▁end|> | let args: Vec<String> = std::env::args().collect();
let random_word = match args.len() { |
<|file_name|>mod.rs<|end_file_name|><|fim▁begin|>//! types/mod.rs - Unlike other modules for compiler passes,
//! the type inference compiler pass is defined in types/typechecker.rs
//! rather than the mod.rs file here. Instead, this file defines
//! the representation of `Type`s - which represent any Type in ante's
//... | |
<|file_name|>interfaces.py<|end_file_name|><|fim▁begin|># telepathy-python - Base classes defining the interfaces of the Telepathy framework
#
# Copyright (C) 2005, 2006 Collabora Limited
# Copyright (C) 2005, 2006 Nokia Corporation
#
# This library is free software; you can redistribute it and/or
# modify it under the... | |
<|file_name|>mesh2heightfield.cpp<|end_file_name|><|fim▁begin|>/**
* 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 3 of the
* License, or (at your option) any late... | #include "DGtal/kernel/BasicPointFunctors.h"
#include "DGtal/math/linalg/SimpleMatrix.h" |
<|file_name|>scrollbar_wdg.py<|end_file_name|><|fim▁begin|>###########################################################
#
# Copyright (c) 2014, Southpaw Technology
# All Rights Reserved
#
# PROPRIETARY INFORMATION. This software is proprietary to
# Southpaw Technology, and is not to be reproduced, t... | |
<|file_name|>log_plays.py<|end_file_name|><|fim▁begin|># (C) 2012, Michael DeHaan, <michael.dehaan@gmail.com>
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either ... | |
<|file_name|>async_client.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
# Copyright 2022 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/lic... | |
<|file_name|>index.ts<|end_file_name|><|fim▁begin|>import type { FormatRelativeFn } from '../../../types'
// Source: https://www.unicode.org/cldr/charts/32/summary/te.html
const formatRelativeLocale = {
lastWeek: "'గత' eeee p", // CLDR #1384
yesterday: "'నిన్న' p", // CLDR #1393
today: "'ఈ రోజు' p", // CLDR #13... | export default formatRelative |
<|file_name|>main.rs<|end_file_name|><|fim▁begin|>// Get a slice out of Array a where the ??? is so that the `if` statement
// returns true. Scroll down for hints!!
<|fim▁hole|> let nice_slice = &a[1..4];
if nice_slice == [2, 3, 4] {
println!("Nice slice!");
} else {
println!("Not quite what... | fn main() {
let a = [1, 2, 3, 4, 5];
|
<|file_name|>package.py<|end_file_name|><|fim▁begin|># Copyright 2013-2021 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
from spack import *
class Minigan(Package):
"""miniGAN is a gen... | Exascale Computing Project's (ECP) ExaLearn project at |
<|file_name|>mod.rs<|end_file_name|><|fim▁begin|>#[doc = r" Value read from the register"]
pub struct R {
bits: u32,
}
#[doc = r" Value to write to the register"]
pub struct W {
bits: u32,
}
impl super::SWIER {
#[doc = r" Modifies the contents of the register"]
#[inline(always)]
pub fn modify<F>(&se... | #[doc = r" Returns `true` if the bit is set (1)"]
#[inline(always)]
pub fn bit_is_set(&self) -> bool {
self.bit() |
<|file_name|>index.ts<|end_file_name|><|fim▁begin|>import { NgModule } from '@angular/core';
import { SharedModule } from 'app/shared';<|fim▁hole|>@NgModule({
declarations: [
ServerMapSearchResultViewerContainerComponent
],
imports: [
SharedModule
],
exports: [
ServerMapSear... | import { ServerMapSearchResultViewerContainerComponent } from './server-map-search-result-viewer-container.component';
|
<|file_name|>test_claims.py<|end_file_name|><|fim▁begin|># Copyright (c) 2014 Rackspace, 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... | result = self.client.post(data=doc)
self.assertEqual(400, result.status_code)
|
<|file_name|>R_get_universe_systems_system_id.java<|end_file_name|><|fim▁begin|>package fr.guiguilechat.jcelechat.model.jcesi.compiler.compiled.responses;
public class R_get_universe_systems_system_id {
/**
* The constellation this solar system is in
*/
public int constellation_id;
/**
* nam... | |
<|file_name|>switch-between-vi-emacs.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
"""
Example that displays how to switch between Emacs and Vi input mode.
"""
from prompt_toolkit import prompt
from prompt_toolkit.enums import EditingMode
from prompt_toolkit.key_binding.manager import KeyBindingManager
from pr... | |
<|file_name|>udisks.py<|end_file_name|><|fim▁begin|>'''apport package hook for udisks
<|fim▁hole|>(c) 2009 Canonical Ltd.
Author: Martin Pitt <martin.pitt@ubuntu.com>
'''
import os
import os.path
import apport.hookutils
import dbus
UDISKS = 'org.freedesktop.UDisks'
def add_info(report):
apport.hookutils.attach_h... | |
<|file_name|>logger.ts<|end_file_name|><|fim▁begin|>import { createLogger, stdSerializers } from "bunyan";
import { resolve } from 'path';
export function makeLogger(ledeHome, level = "info") {
return createLogger({
name: "LedeLogger",
serializers: {
err: stdSerializers.err
},
streams: [
... | })
} |
<|file_name|>CommandFailure.java<|end_file_name|><|fim▁begin|>/*
* ============================================================================
* GNU General Public License
* ============================================================================<|fim▁hole|> * Copyright (C) 2015 Infinite Automation Software. Al... | * |
<|file_name|>startup.ts<|end_file_name|><|fim▁begin|><|fim▁hole|>
platformBrowserDynamic().bootstrapModule(CustomerModule);<|fim▁end|> | import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
import {CustomerModule} from './Binder/CustomerModule'; |
<|file_name|>TestPaintArtifact.cpp<|end_file_name|><|fim▁begin|>// Copyright 2016 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "platform/testing/TestPaintArtifact.h"
#include "cc/layers/layer.h"
#include "pl... | TestPaintArtifact::TestPaintArtifact() : m_displayItemList(0), m_built(false) {}
TestPaintArtifact::~TestPaintArtifact() {}
|
<|file_name|>0004_auto_20141105_1236.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [<|fim▁hole|> ('photoplaces_web', '0003_photocluster_normalized_centers_dirty... | |
<|file_name|>FEATURE_GET_TLV_PROPERTIES.py<|end_file_name|><|fim▁begin|>#! /usr/bin/env python
"""
# FEATURE_GET_TLV_PROPERTIES.py: Unitary test for
# FEATURE_GET_TLV_PROPERTIES
# Copyright (C) 2012,2016 Ludovic Rousseau
"""
# This program is free software; you can redistribute it and/or modify
# it under... | |
<|file_name|>Credential.js<|end_file_name|><|fim▁begin|>BASE.require(["Object"], function () {
BASE.namespace("LG.core.dataModel.core");
var _globalObject = this;
LG.core.dataModel.core.Credential = (function (Super) {
var Credential = function () {
var self = this;
if (sel... | }); |
<|file_name|>UFCNN1_REPO_V16_TESTMODE.py<|end_file_name|><|fim▁begin|>from __future__ import absolute_import
from __future__ import print_function
import sys
import glob
import time
import numpy as np
import pandas as pd
import os.path
import time
import datetime
import re
from keras.preprocessing import sequence
fro... | output = activation
#model.compile(optimizer=optimizer, loss={'output': loss}) |
<|file_name|>test_crowdsource_hinter.py<|end_file_name|><|fim▁begin|>"""
Tests the crowdsourced hinter xmodule.
"""
from mock import Mock, MagicMock
import unittest
import copy
from xmodule.crowdsource_hinter import CrowdsourceHinterModule
from xmodule.vertical_module import VerticalModule, VerticalDescriptor
from xb... | '1': [('A hint for 9000.01', 32)]}
return {'index_to_hints': index_to_hints, 'index_to_answer': index_to_answer}
mock_module.get_feedback = fake_get_feedback |
<|file_name|>regdefs.py<|end_file_name|><|fim▁begin|>class RegMagic:<|fim▁hole|> fixed_registers = []
regmagic = RegMagic()
__all__ = ['regmagic']<|fim▁end|> | |
<|file_name|>domparser.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 document_loader::DocumentLoader;
use dom::bindings::cod... | impl DOMParserMethods for DOMParser {
// https://w3c.github.io/DOM-Parsing/#the-domparser-interface
fn ParseFromString(&self,
s: DOMString, |
<|file_name|>read_file_specific_line.rs<|end_file_name|><|fim▁begin|>// http://rosettacode.org/wiki/Read_a_specific_line_from_a_file
use std::fs::File;
use std::io::{BufReader, BufRead};
use std::env::args;
use std::borrow::ToOwned;
fn main() {
let mut args = args();
let filename = {
if let Some(o_s)... | // Handle any errors that may arise
Ok(ln) => print!("{}", ln),
Err(error) => print!("{}", error) |
<|file_name|>__init__.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.
# Code generated by... | |
<|file_name|>funktionell-programmering.py<|end_file_name|><|fim▁begin|># Uppgift 4
[str(i) for i in range(4)]
# Uppgift 5
from math import sqrt # square root<|fim▁hole|>
# Uppgift 6
>>> def make_decrementor(n):
... return lambda x: n - x
...
>>> f = make_decrementor(42)
>>> f(0)
42
>>> f(1)
41
>>> f(-3)<|fim▁end... | list(filter(lambda x: sqrt(x).is_integer(), range(1000, 1200))) |
<|file_name|>build_search_filters.py<|end_file_name|><|fim▁begin|>from django.db.models import fields, ForeignKey, ManyToOneRel, OneToOneRel
from .obj_types import clss
from .search_schema import schema as search_schema
<|fim▁hole|>
See https://querybuilder.js.org/#filters for details.
"""
filters = [
... |
def build_search_filters(cls):
"""Return list of dicts of options for a QueryBuilder filter. |
<|file_name|>pdb_dist-filter.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
# Copyright 2007, Michael J. Harms
# This program is distributed under General Public License v. 3. See the file
# COPYING for a copy of the license.
__author__ = "Michael J. Harms"
__date__ = "070709"
__description__ = \
"""
pdb_di... | "defined by line[X:Y] matches SELECT",
nargs=3)
cmdline.addOption(short_flag="a", |
<|file_name|>juce_CodeDocument.cpp<|end_file_name|><|fim▁begin|>/*
==============================================================================
This file is part of the JUCE library.
Copyright (c) 2017 - ROLI Ltd.
JUCE is an open source library subject to commercial or open-source
licensing.
By us... | CodeDocument::Position CodeDocument::Position::movedBy (const int characterDelta) const
{ |
<|file_name|>test_module_engagement.py<|end_file_name|><|fim▁begin|># pylint: disable=line-too-long
"""
End to end test of the per-module engagement workflow.
"""
import datetime
import logging
import ddt
from edx.analytics.tasks.tests.acceptance import AcceptanceTestCase, when_elasticsearch_available
log = logging... | 'mailing_address': 'Luna 10 - 3 28300 ARANJUEZ',
'city': 'Madrid',
'country': 'ES', |
<|file_name|>system_allocator.rs<|end_file_name|><|fim▁begin|>// Copyright 2018 The Chromium OS Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
use std::collections::BTreeMap;
use base::pagesize;
use crate::address_allocator::{Addre... | }), |
<|file_name|>read_image_from_hbase.py<|end_file_name|><|fim▁begin|>import happybase
from StringIO import StringIO
from PIL import Image
def decode_image_PIL(binary_data):<|fim▁hole|> """
f = StringIO(binary_data)
img = Image.open(f)
return img
if __name__=="__main__":
tab_image = 'image_cache'
... | """ Returns PIL image from binary buffer. |
<|file_name|>CWE122_Heap_Based_Buffer_Overflow__cpp_CWE193_char_memmove_34.cpp<|end_file_name|><|fim▁begin|>/* TEMPLATE GENERATED TESTCASE FILE
Filename: CWE122_Heap_Based_Buffer_Overflow__cpp_CWE193_char_memmove_34.cpp
Label Definition File: CWE122_Heap_Based_Buffer_Overflow__cpp_CWE193.label.xml
Template File: sou... | |
<|file_name|>seq_len.py<|end_file_name|><|fim▁begin|>#!usr/bin/python2.7
# coding: utf-8
# date: 16-wrzesień-2016
# autor: B.Kozak
# Simple script giving length of sequences from fasta file
import Bio
from Bio import SeqIO
import sys
import os.path<|fim▁hole|>outname = filename.split('.')
outname1 = '.'.join([outnam... |
filename = sys.argv[-1]
|
<|file_name|>test_concurrent_queue.cpp<|end_file_name|><|fim▁begin|>/*
Copyright 2005-2014 Intel Corporation. All Rights Reserved.
This file is part of Threading Building Blocks. Threading Building Blocks is free software;
you can redistribute it and/or modify it under the terms of the GNU General Public ... | for( int k=0; k<3; ++k )
PopKind[k] = 0; |
<|file_name|>test-app.js<|end_file_name|><|fim▁begin|>require('dotenv').config({silent:true});
var feathers = require('feathers');
var bodyParser = require('body-parser');
var rest = require('feathers-rest');
var socketio = require('feathers-socketio');
var fms = require('../lib');
var AutoService = fms.AutoService;
co... | paginate: {
default: 2,
max: 4 |
<|file_name|>TestUnionJob.cpp<|end_file_name|><|fim▁begin|>/****************************************************************************************
* Copyright (c) 2010 Maximilian Kossick <maximilian.kossick@googlemail.com> *
* ... | |
<|file_name|>AdministrarNovedadRSDAction.java<|end_file_name|><|fim▁begin|>//Copyright (c) 2011 Municipalidad de Rosario and Coop. de Trabajo Tecso Ltda.
//This file is part of SIAT. SIAT is licensed under the terms
//of the GNU General Public License, version 3.
//See terms in COPYING file or <http://www.gnu.org/licen... | if (log.isDebugEnabled()) log.debug("entrando en " + funcName);
UserSession userSession = canAccess(request, mapping, |
<|file_name|>imageGradientStructureTensor.py<|end_file_name|><|fim▁begin|>import gen_utils
from module_base import ModuleBase
from module_mixins import NoConfigModuleMixin
import module_utils
import vtktud
class imageGradientStructureTensor(ModuleBase, NoConfigModuleMixin):
def __init__(self, module_manager):
... | |
<|file_name|>tables.js<|end_file_name|><|fim▁begin|>import { each } from "../helpers";
import TablesHandler from "../TablesHandler";
each("table", table => {
const tables = new TablesHandler(table);<|fim▁hole|><|fim▁end|> | tables.enable();
}); |
<|file_name|>multi-action-button.d.ts<|end_file_name|><|fim▁begin|>import SplitButton from "../split-button";<|fim▁hole|>}
export default MultiActionButton;<|fim▁end|> |
declare class MultiActionButton extends SplitButton {
/** Button type: "primary" | "secondary" | "tertiary" */
buttonType?: "primary" | "secondary" | "tertiary"; |
<|file_name|>train_and_test5.py<|end_file_name|><|fim▁begin|>from __future__ import division, print_function, absolute_import
#from pnet.vzlog import default as vz
import numpy as np
import amitgroup as ag
import itertools as itr
import sys
import os
#import gv
import pnet
import time
def test(ims, labels, net):
... | test_time=np.median(testing_times) / 60,
rate=100*np.mean(error_rates),
std=100*np.std(error_rates))) |
<|file_name|>lru_cache.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... | prev: ptr::mut_null(), |
<|file_name|>mod.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.org/licens... | //! Finally, if ever you're interested in what the actual capacity of the
//! collection is, most collections provide a `capacity` method to query this
//! information on demand. This can be useful for debugging purposes, or for |
<|file_name|>mod.rs<|end_file_name|><|fim▁begin|>// SPDX-License-Identifier: Unlicense
//! A module for the kernel devices which must be used from the kernel.
//!
//! This is a very short list - interrupt controller, VM swap disk, and
//! debug console. Other devices are managed through user-level threads
//! and by r... | |
<|file_name|>functional.ts<|end_file_name|><|fim▁begin|><|fim▁hole|>
'use strict';
export function not<A>(fn: (a: A) => boolean): (a: A) => boolean;
export function not(fn: Function): Function {
return (...args) => !fn(...args);
}<|fim▁end|> | /*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*---------------------------------------------------------------... |
<|file_name|>brocade_maps_ext.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
import xml.etree.ElementTree as ET
class brocade_maps_ext(object):
"""Auto generated class.
"""
def __init__(self, **kwargs):
self._callback = kwargs.pop('callback')
def maps_get_all_policy_input_... | rbridge_id = ET.SubElement(input, "rbridge-id")
rbridge_id.text = kwargs.pop('rbridge_id')
callback = kwargs.pop('callback', self._callback) |
<|file_name|>convert-csv-to-json.py<|end_file_name|><|fim▁begin|># coding=utf-8
#Converts a csv contining country codes and numerical values, to json
#Years should be given in the header, like this:
#
# land, 1980, 1981, 1982
# se, 12, 13, 11
# fi 7, 10, 14
import csv
import json
import argparse
imp... | i += 1
except IOError:
print ("Could not open input file") |
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|># -*- encoding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
#
# Copyright (C) 2014 Didotech srl (<http://www.didotech.com>).
#
# All Rights Reserved... | # GNU General Public License for more details.
# |
<|file_name|>test_disk_usage.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python
# -*- coding: utf-8; -*-
#
# 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
#
# ... | |
<|file_name|>abs.go<|end_file_name|><|fim▁begin|>package imath
func Abs(x int) int {<|fim▁hole|> }
return x
}<|fim▁end|> | if x < 0 {
return -x |
<|file_name|>package.py<|end_file_name|><|fim▁begin|>##############################################################################
# Copyright (c) 2013-2017, Lawrence Livermore National Security, LLC.
# Produced at the Lawrence Livermore National Laboratory.
#
# This file is part of Spack.
# Created by Todd Gamblin, t... | |
<|file_name|>bookmarks.py<|end_file_name|><|fim▁begin|>from django import template
register = template.Library()
@register.assignment_tag(takes_context=True)
def has_bookmark_permission(context, action):
"""Checks if the current user can bookmark the action item.
Returns a boolean.
Syntax::
{% ... | |
<|file_name|>dijkstra_shortest_path.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python3.5
# import time
import math
class DataHeap:
"""Min-Heap with additionnal data field"""
def __init__(self):
self.list = [(0, None)]
self.size = 0
def insert(self, value, data = None):
self.list.append((value, data)... | self.size += 1
self.percolateUp(self.size) |
<|file_name|>expr.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/licenses/L... | match *self { |
<|file_name|>Generate.java<|end_file_name|><|fim▁begin|>/*
* Copyright Red Hat Inc. and/or its affiliates and other contributors
* as indicated by the authors tag. All rights reserved.
*
* This copyrighted material is made available to anyone wishing to use,
* modify, copy, or redistribute it subject to the terms ... | package org.eclipse.ceylon.compiler.java.codegen.recovery;
|
<|file_name|>args.rs<|end_file_name|><|fim▁begin|>use clap::{arg_enum, Clap};
arg_enum! {
#[derive(Debug)]
pub enum RenderDevice {
Cpu,
Gpu
}
}
impl RenderDevice {
pub fn to_str(&self) -> &str {
match self {
Self::Cpu => "CPU",
Self::Gpu => "GPU"
... | |
<|file_name|>mod.rs<|end_file_name|><|fim▁begin|>// Copyright 2015 The Servo Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution.
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
// <LICENS... | (*cmsg_buffer).cmsg_level = libc::SOL_SOCKET; |
<|file_name|>api.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
"""
Контролер веб интерфейса бота
:copyright: (c) 2013 by Pavel Lyashkov.
:license: BSD, see LICENSE for more details.
"""
import re
import os
from flask import Flask, Blueprint, abort, request, make_response, url_for, render_template... | |
<|file_name|>mainapp.py<|end_file_name|><|fim▁begin|># Copyright 2008 Dan Smith <dsmith@danplanet.com>
# Copyright 2012 Tom Hayward <tom@tomh.us>
#
# 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... | def record_recent_file(self, filename):
recent_files = self._get_recent_list()
if filename not in recent_files: |
<|file_name|>test_package.py<|end_file_name|><|fim▁begin|>from biokit.rtools import package
import pytest
try:
import create_dummy_package as dun
except:
from . import create_dummy_package as dun
def test_install_packages():
d = dun.CreateDummy()
d()
package.install_package('./dummy/dummytest_1.0.... | pm.get_package_version('whatever_is_not_installed') |
<|file_name|>handler_test.go<|end_file_name|><|fim▁begin|>// Copyright 2015 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.or... | func initializeScenario(t *testing.T) (*events, *Request, *info.Event, *info.Event) {
fakeEvent := makeEvent(createOldTime(t), "/") |
<|file_name|>schedule.js<|end_file_name|><|fim▁begin|>(function (parent, $, element) {
function loadEvents() {
var date = new Date();
var d = date.getDate();
var m = date.getMonth();
var y = date.getFullYear();
return [
{
title: 'Appointm... | })(window, $, '#calendar'); |
<|file_name|>lib.rs<|end_file_name|><|fim▁begin|>extern crate rand;
use rand::random;
pub fn random_string(length:u32) -> String {
(0..length).map(|_| (0x20u8 + (random::<f32>() * 96.0) as u8) as char).collect()<|fim▁hole|><|fim▁end|> | } |
<|file_name|>sphere.js<|end_file_name|><|fim▁begin|>var SPHERE = {
getSphereVertex: function (radius, res) { // Se obtienen los vértices, normales y coordenadas de textura
var vertexData = [], alpha, beta, x, y, z, u, v;
for (var i = 0; i <= res; i++) { // Se recorren las latitudes
alph... | u = 1 - (j / res);
v = 1 - (i / res);
// Vértices
vertexData.push(radius * x); |
<|file_name|>l2_agent_extensions_manager.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
#
# U... |
LOG = log.getLogger(__name__)
|
<|file_name|>theplatform.tinymce.plugin.js<|end_file_name|><|fim▁begin|><|fim▁hole|> it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be use... | /* thePlatform Video Manager Wordpress Plugin
Copyright (C) 2013-2014 thePlatform for Media Inc.
This program is free software; you can redistribute it and/or modify |
<|file_name|>InstalledPluginHolder.java<|end_file_name|><|fim▁begin|>/**
* Copyright 2012 52°North Initiative for Geospatial Open Source Software GmbH
*
* 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 ... | |
<|file_name|>Comparison.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
# Copyright 2012 Vincent Jacques
# vincent@vincent-jacques.net
# This file is part of PyGithub. http://vincent-jacques.net/PyGithub
# PyGithub is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser G... | |
<|file_name|>create_tables.py<|end_file_name|><|fim▁begin|>import logging
from sqlalchemy import engine_from_config
from courier.scripts import settings
from courier.models import DeclarativeBase, DBSession, db_views, populate_lookups
LOG = False
def main(DBSession, engine):
# set up logging
if LOG:
... | DBSession.configure(bind=engine) |
<|file_name|>rgb2pct.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
"""
***************************************************************************
rgb2pct.py<|fim▁hole|> Date : August 2012
Copyright : (C) 2012 by Victor Olaya
Email : volayaf at gmail d... | --------------------- |
<|file_name|>NoInlineMethodUsage.java<|end_file_name|><|fim▁begin|>class A {
public void f() {
Inner i = new Inner();
i.doStuff();
}<|fim▁hole|>
private class <caret>Inner {
public void doStuff() {
}
}
}<|fim▁end|> | |
<|file_name|>raids.js<|end_file_name|><|fim▁begin|>export default [
// Forsaken Thicket
{id: 'vale_guardian', raid: 'Forsaken Thicket', wing: 'Spirit Vale', name: 'Vale Guardian', type: 'Boss'},
{id: 'spirit_woods', raid: 'Forsaken Thicket', wing: 'Spirit Vale', name: 'Spirit Woods', type: 'Checkpoint'},
{id: '... | {id: 'keep_construct', raid: 'Forsaken Thicket', wing: 'Stronghold of the Faithful', name: 'Keep Construct', type: 'Boss'}, |
<|file_name|>lib.rs<|end_file_name|><|fim▁begin|>//
// imag - the personal information management suite for the commandline<|fim▁hole|>//
// This library 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... | // Copyright (C) 2015, 2016 Matthias Beyer <mail@beyermatthias.de> and contributors |
<|file_name|>mctdh_specinput.cpp<|end_file_name|><|fim▁begin|>/*
* Copyright 2015 Jan von Cosel
*
* This file is part of utility-scripts.
*
* utility-scripts 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 Foundati... | Utils::WriteMatrixToFile(logFile, J, 3, true);
logFile << "Metric of the Duschinsky Matrix:\n";
Utils::WriteMatrixToFile(logFile, J.transpose() * J, 3, true); |
<|file_name|>debug_meta.py<|end_file_name|><|fim▁begin|>from __future__ import absolute_import
__all__ = ("DebugMeta",)
from sentry.interfaces.base import Interface
from sentry.utils.json import prune_empty_keys
class DebugMeta(Interface):
"""
Holds debug meta information for processing stacktraces
and ... | return prune_empty_keys(
{ |
<|file_name|>index.tsx<|end_file_name|><|fim▁begin|>/// <reference path="../typings/index.d.ts" />
import * as injectTapEventPlugin from 'react-tap-event-plugin';
import animationFrame from './util/animationFrame';
injectTapEventPlugin();
animationFrame();
interface CustomerElement extends Element{
blur?: ()=>{}
}
... | |
<|file_name|>DependentObservable.java<|end_file_name|><|fim▁begin|>package gueei.binding;
import java.util.Collection;
import java.util.ArrayList;
public abstract class DependentObservable<T> extends Observable<T> implements Observer{
protected IObservable<?>[] mDependents;
public DependentObservable(Cl... | |
<|file_name|>index.js<|end_file_name|><|fim▁begin|>import {default as getTeam} from './getTeam'
import {default as createTeam} from './createTeam'
import {default as addUserToTeam} from './addUserToTeam'
import {default as addCollaboratorToRepo} from './addCollaboratorToRepo'
import {default as getCollaboratorsForRepo}... | getCollaboratorsForRepo,
removeUserFromOrganization, |
<|file_name|>xsolla.py<|end_file_name|><|fim▁begin|>from tornado.httpclient import HTTPRequest, HTTPError
import ujson
import abc
import socket
from urllib import parse
from .. import admin as a
from .. social import SocialNetworkAPI, APIError, SocialPrivateKey
class XsollaAPI(SocialNetworkAPI, metaclass=abc.ABCMet... | return True
|
<|file_name|>exam.js<|end_file_name|><|fim▁begin|>---
layout: null
---
$(document).ready(function(){
console.log("exam.js: document is ready");
$('.template').each(function(i) {
$(this).css('display','none');
});
// Use with <div class="copy-of" data-id="foo"></div>
// Use <div id="foo" cl... | |
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|># Copyright 2014 Google Inc. All Rights Reserved.
"""Commands for reading and manipulating snapshots."""
from googlecloudsdk.calliope import base
class Snapshots(base.Group):
"""List, describe, and delete Google Compute Engine snapshots."""
Snapshots.detailed... | 'brief': 'List, describe, and delete Google Compute Engine snapshots',
} |
<|file_name|>user_data.py<|end_file_name|><|fim▁begin|># Copyright 2012 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/license... | # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
|
<|file_name|>sdiv.rs<|end_file_name|><|fim▁begin|>use num::Num;
#[inline]
pub fn sdiv<'a, 'b, T: Copy + Num>(out: &'a mut [T; 9], a: &'b [T; 9], s: T) -> &'a mut [T; 9] {
let not_zero = s != T::zero();
out[0] = if not_zero {a[0] / s} else {T::zero()};
out[1] = if not_zero {a[1] / s} else {T::zero()};
... | } |
<|file_name|>build.rs<|end_file_name|><|fim▁begin|>// Copyright © 2015, Peter Atashian
// Licensed under the MIT License <LICENSE.md>
extern crate build;<|fim▁hole|><|fim▁end|> | fn main() {
build::link("inseng", true)
} |
<|file_name|>test-use-ok.rs<|end_file_name|><|fim▁begin|>// Test-only use OK
// edition:2018<|fim▁hole|>// compile-flags:--test
#![deny(unused_crate_dependencies)]
fn main() {}
#[test]
fn test_bar() {
assert_eq!(bar::BAR, "bar");
}<|fim▁end|> | // check-pass
// aux-crate:bar=bar.rs |
<|file_name|>ApiSetIndustryRequest.java<|end_file_name|><|fim▁begin|>package com.sqsoft.mars.weixin.client.cgibin.template;
import java.io.Serializable;
import org.springframework.http.HttpMethod;
import com.sqsoft.mars.core.common.utils.JsonUtils;
import com.sqsoft.mars.weixin.client.WeixinRequest;
/**
... | return null;
|
<|file_name|>home.component.ts<|end_file_name|><|fim▁begin|>import { Component } from '@angular/core';<|fim▁hole|>import {ROUTER_DIRECTIVES, RouteData} from '@angular/router-deprecated';
import {TravelFormComponent} from "./travel-form.component";
import {NavbarComponent} from '../../shared/index';
@Component({
s... | |
<|file_name|>dtkPluginGeneratorPage.cpp<|end_file_name|><|fim▁begin|>// Version: $Id$
//
//
// Commentary:
//
//
// Change Log:
//
//
// Code:
#include "dtkPluginGeneratorPage.h"
#include "ui_dtkPluginGeneratorPage.h"
dtkPluginGeneratorPage::dtkPluginGeneratorPage(QWidget *parent) : QWizardPage(parent), ui(new ... | |
<|file_name|>interface.py<|end_file_name|><|fim▁begin|>#
# Copyright (c) 2004 Conectiva, Inc.
# Copyright (c) 2005--2013 Red Hat, Inc.
#
# From code written by Gustavo Niemeyer <niemeyer@conectiva.com>
# Modified by Joel Martin <jmartin@redhat.com>
#
# This file is part of Smart Package Manager.
#
# Smart Package Manag... | mask = default and _("%s (Y/n): ") or _("%s (y/N): ") |
<|file_name|>test_connector.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
#
# Copyright 2017 David García Goñi
#
# This file is part of Phatty.
#
# Phatty 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 Foundati... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.