prompt large_stringlengths 70 991k | completion large_stringlengths 0 1.02k |
|---|---|
<|file_name|>systemjs.config.js<|end_file_name|><|fim▁begin|>/* Copyright 2017 Mozilla 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/... | path.replaceWith(babel.types.identifier("require"));
}
},
}, |
<|file_name|>mod.rs<|end_file_name|><|fim▁begin|>//! This module contains the basic RootMove structures, allowing for storage of the moves from a specific position
//! alongside information about each of the moves.
pub mod root_moves_list;
use std::cmp::Ordering as CmpOrder;
use pleco::core::score::*;
use pleco::Bit... | |
<|file_name|>CorePageService.java<|end_file_name|><|fim▁begin|>/******************************************************************************
* 版权所有 刘大磊 2013-07-01 *
* 作者:刘大磊 *
* 电话:13336390671 *
... | /**
* @author 刘大磊 2016-08-26 17:08:24
*/ |
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
import controllers<|fim▁hole|>#import models<|fim▁end|> | |
<|file_name|>conf.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
#
# django-intercom documentation build configuration file, created by
# sphinx-quickstart on Mon Jan 23 13:50:08 2012.
#
# This file is execfile()d with the current directory set to its containing dir.
#
# Note that not all possible configuratio... | html_theme = 'default'
# Theme options are theme-specific and customize the look and feel of a theme
# further. For a list of options available for each theme, see the |
<|file_name|>event_focus.rs<|end_file_name|><|fim▁begin|>// Copyright 2016, The Gtk-rs Project Developers.
// See the COPYRIGHT file at the top-level directory of this distribution.<|fim▁hole|>use glib::translate::*;
#[derive(Clone, Debug)]
pub struct EventFocus(::Event);
event_wrapper!(EventFocus, GdkEventFocus);
ev... | // Licensed under the MIT license, see the LICENSE file or <http://opensource.org/licenses/MIT>
|
<|file_name|>paragraph.tsx<|end_file_name|><|fim▁begin|>import { Editor, EditorState, RichUtils } from "draft-js"
import { debounce } from "lodash"
import React, { Component } from "react"
import ReactDOM from "react-dom"
import styled from "styled-components"
import { TextInputUrl } from "../components/text_input_url"... | |
<|file_name|>inputTextPropertyGridComponent.tsx<|end_file_name|><|fim▁begin|>import * as React from "react";
import { Observable } from "babylonjs/Misc/observable";
import { PropertyChangedEvent } from "../../../../propertyChangedEvent";
import { CommonControlPropertyGridComponent } from "./commonControlPropertyGrid... | <div className="pane">
<CommonControlPropertyGridComponent globalState={this.props.globalState} lockObject={this.props.lockObject} control={inputText} onPropertyChangedObservable={this.props.onPropertyChangedObservable} />
<LineContainerComponent globalState={this.props.glo... |
<|file_name|>dedent_handling_phoenix.cpp<|end_file_name|><|fim▁begin|>// Copyright (c) 2009 Carl Barron
//
// Distributed under the Boost Software License, Version 1.0. (See accompanying
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
#include <iostream>
#include <sstream>
#include <boos... | {
typedef bool result_type;
|
<|file_name|>test_engine.py<|end_file_name|><|fim▁begin|>""" Unit tests for ``wheezy.templates.engine.Engine``.
"""
import unittest
class EngineTestCase(unittest.TestCase):
""" Test the ``Engine``.
"""
def setUp(self):
from wheezy.template.engine import Engine
from wheezy.template.loader... | """
self.engine.templates['x'] = 'x' |
<|file_name|>Main.java<|end_file_name|><|fim▁begin|>////////////////////////////////////////////////////////////////////////////
// This file is part of BlazeFly. //
// //
// BlazeFly is free software: you can... | public void onPlayerJoin(PlayerJoinEvent event){
Player player = event.getPlayer();
player.setFlySpeed(0.1F);
|
<|file_name|>cursor-operations.ts<|end_file_name|><|fim▁begin|>import assert from 'assert'
import {
THREAD_COUNT,
CURSOR_BUFFER_SIZE,
THREAD_COUNTER_BYTE_LENGTH,
} from './constants'
import {
InputCursor,
StoredEventBatchPointer,
StoredEventPointer,
} from './types'
const checkThreadArrayLength = (threadAr... | )
if (
startingThreadArray[tuples[i].event.threadId] >
tuples[i].event.threadCounter |
<|file_name|>lab.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
#############################################################
# 1. Imports
#############################################################
import numpy as np<|fim▁hole|>import matplotlib.pyplot as plt
from scipy.optimize import curve_fit
#######... | |
<|file_name|>CWE23_Relative_Path_Traversal__char_file_ifstream_08.cpp<|end_file_name|><|fim▁begin|>/* TEMPLATE GENERATED TESTCASE FILE
Filename: CWE23_Relative_Path_Traversal__char_file_ifstream_08.cpp
Label Definition File: CWE23_Relative_Path_Traversal.label.xml
Template File: sources-sink-08.tmpl.cpp
*/
/*
* ... | #define BASEPATH "/tmp/"
#endif
#ifdef _WIN32
|
<|file_name|>mergeAll-spec.ts<|end_file_name|><|fim▁begin|>import { expect } from 'chai';
import * as Rx from 'rxjs/Rx';
import { hot, cold, expectObservable, expectSubscriptions } from '../helpers/marble-testing';
import { throwError } from 'rxjs';
declare function asDiagram(arg: string): Function;
declare const type... | let result: Rx.Observable<number> = Rx.Observable
.of(source1, source2, source3) |
<|file_name|>ExternalsPlugin.js<|end_file_name|><|fim▁begin|>/*
MIT License http://www.opensource.org/licenses/mit-license.php
Author Tobias Koppers @sokra
*/
"use strict";
var ExternalModuleFactoryPlugin = require("./ExternalModuleFactoryPlugin");
class ExternalsPlugin {
constructor(type, externals) {
... | params.normalModuleFactory.apply(new ExternalModuleFactoryPlugin(this.type, this.externals));
});
|
<|file_name|>threads-win32.cpp<|end_file_name|><|fim▁begin|>////////////////////////////////////////////////////////////////////////////////
/// DISCLAIMER
///
/// Copyright 2014-2016 ArangoDB GmbH, Cologne, Germany<|fim▁hole|>/// You may obtain a copy of the License at
///
/// http://www.apache.org/licenses/LICENS... | /// Copyright 2004-2014 triAGENS GmbH, Cologne, Germany
///
/// Licensed under the Apache License, Version 2.0 (the "License");
/// you may not use this file except in compliance with the License. |
<|file_name|>agenda.component.ts<|end_file_name|><|fim▁begin|>import { Component, OnInit } from '@angular/core';
@Component({
selector: 'app-agenda',
templateUrl: './agenda.component.html',
styleUrls: ['./agenda.component.css']
})
export class AgendaComponent implements OnInit {<|fim▁hole|> }
}<|fim▁end|> |
constructor() { }
ngOnInit() { |
<|file_name|>DEPProfilesTable.tsx<|end_file_name|><|fim▁begin|>import * as React from "react";
import ReactTable, {TableProps, Column} from "react-table";
import selectTableHoc from "react-table/lib/hoc/selectTable";
import {DEPAccount, DEPProfile} from "../../store/dep/types";
import {DEPProfileName} from "../react-ta... | }, |
<|file_name|>downloader.py<|end_file_name|><|fim▁begin|>import logging
from urllib.request import urlopen
from shutil import copyfileobj
class MapDownloader(object):
def __init__(self):
self.__log = logging.getLogger(__name__)
<|fim▁hole|> self.__log.info('Downloading map data for [%f,%f,%f,%f]' %... | def to_file(self, top, left, bottom, right, file_path = 'map.osm'):
|
<|file_name|>decorator.rs<|end_file_name|><|fim▁begin|>// Copyright (c) 2015 Robert Clipsham <robert@octarineparrot.com>
//
// 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 http://opensource.org/licenses/MIT>, at yo... | };
op_strings |
<|file_name|>inherited_svg.mako.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/. */
<%namespace name="helpers" file="/helpers.mako.rs"... | ${helpers.single_keyword("shape-rendering",
"auto optimizespeed crispedges geometricprecision",
products="gecko", |
<|file_name|>getdata.go<|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... | if err != nil { |
<|file_name|>Secure.java<|end_file_name|><|fim▁begin|>package controllers;
import java.lang.reflect.InvocationTargetException;
import java.util.List;
import java.util.Date;
import models.Usuario;
import play.Play;
import play.mvc.*;
import play.data.validation.*;
import play.libs.*;
import play.utils.*;
public class... | static void onDisconnect() {
}
|
<|file_name|>deploy.js<|end_file_name|><|fim▁begin|><|fim▁hole|>export const run = () => () => console.log('deploying')<|fim▁end|> | export const description = 'Deploys project'
|
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|><|fim▁hole|><|fim▁end|> | __author__ = 'eduardoluz' |
<|file_name|>test_pyclbr.py<|end_file_name|><|fim▁begin|>'''
Test cases for pyclbr.py
Nick Mathewson
'''
from test.test_support import run_unittest, import_module
import sys
from types import ClassType, FunctionType, MethodType, BuiltinFunctionType
import pyclbr
from unittest import TestCase
StaticMeth... |
def test_easy(self):
|
<|file_name|>mybench.py<|end_file_name|><|fim▁begin|>## Benches
from lib.inductor.rf import sp as Sp
from syntax import *
from functions.science import linspace
@setenv(type='bench', name='sp1')
class sp1():
def __init__(self, **parameters):
ls = parameters.get('ls', 1e-9)
rs = parameters.get('rs'... | ldc = parameters.get('ldc', 1e-9)
k1 = parameters.get('k1', 0.9)
rsub = parameters.get('rsub', 1) |
<|file_name|>eina_iterator.rs<|end_file_name|><|fim▁begin|>#![allow(dead_code)]
use eina_ffi::*;
use libc::*;
use std::ptr;
pub struct EinaIterator {
pub ptr: *mut Eina_Iterator,
}
impl EinaIterator {
/// Return the container of an iterator
pub fn get_container(&mut self) -> Option<&mut c_void> {
... | fn drop(&mut self) {
unsafe {
eina_iterator_free(self.ptr)
} |
<|file_name|>StringBasedTextRegionAccessDiffBuilder.java<|end_file_name|><|fim▁begin|>/*******************************************************************************
* Copyright (c) 2017 TypeFox GmbH (http://www.typefox.io) and others.
* All rights reserved. This program and the accompanying materials
* are made av... | Preconditions.checkNotNull(newText); |
<|file_name|>exportable_link.cpp<|end_file_name|><|fim▁begin|>#include "exportable_link.hpp"
#include "../../conversion.hpp"
namespace WikiMarkup { namespace Components
{
//#####################################################################################################################
std::string Exporta... | |
<|file_name|>gen_table.py<|end_file_name|><|fim▁begin|>import json
f = open('stations.json')
dict = json.load(f)
f.close()
tables = ["|station_id|group_id|name|type|", "|---:|---:|:--:|:--:|"]
row = "|%s|%s|%s|%s|"
stations = dict['stations']
for s in stations:
r = row % (s['station_id'], s['group_id'], s['stati... | f.write(md) |
<|file_name|>models.py<|end_file_name|><|fim▁begin|>from django.utils.translation import ugettext_lazy as _
from keops.db import models
STATUS = (
('draft', _('Draft')),
('open', _('In Progress')),
('pending', _('Pending')),
('done', _('Done')),
('cancelled', _('Cancelled'))
)
class Category(mode... | |
<|file_name|>grading_record.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python2.5
#
# Copyright 2009 the Melange authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.a... | record_fields = self.getFieldsForGradingRecord(project_entity,
survey_group, |
<|file_name|>build.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 std::env;
use std::process::{Command, Stdio};
fn main() {
... | .unwrap();
assert!(result.success());
println!("cargo:rustc-flags=-L native={}", out_dir);
} |
<|file_name|>12_Integer_to_Roman.py<|end_file_name|><|fim▁begin|>"""
Given an integer, convert it to a roman numeral.
<|fim▁hole|>Input is guaranteed to be within the range from 1 to 3999.
"""
class Solution:
# @return a string
def intToRoman(self, num):
digits = [(1000, 'M'), (900, 'CM'), (500, 'D'), ... | |
<|file_name|>test_modis_core.py<|end_file_name|><|fim▁begin|>import unittest
from geobricks_modis.core import modis_core as c
class GeobricksModisTest(unittest.TestCase):
def test_get_modis_product_table(self):
products = c.get_modis_product_table()
self.assertEqual(len(products), 68)
def te... | def test_list_layers_countries_subset(self):
layers = c.list_layers_countries_subset('MOD13A2', '2010', '001', '8,IT,fra')
self.assertEqual(len(layers), 12)
|
<|file_name|>data_generator.py<|end_file_name|><|fim▁begin|># Copyright (c) 2018 PaddlePaddle 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://ww... | "the type of element%s must be in int or float"
% type(elem))
output += " " + str(elem) |
<|file_name|>install.py<|end_file_name|><|fim▁begin|># -*- coding: UTF-8 -*-
# Copyright 2019-2021 Rumma & Ko Ltd
# License: GNU Affero General Public License v3 (see file COPYING for details)
import subprocess
from rstgen.utils import confirm
from django.core.management.base import BaseCommand
from django.conf import... | |
<|file_name|>usergroup.go<|end_file_name|><|fim▁begin|>package apimanagement
// 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 Microsoft (R) AutoRest Code Generator.
// Changes may cause i... | }
// List lists all user groups. |
<|file_name|>library_tools.py<|end_file_name|><|fim▁begin|>"""
XBlock runtime services for LibraryContentModule
"""
from django.core.exceptions import PermissionDenied
from opaque_keys.edx.locator import LibraryLocator
from xmodule.library_content_module import ANY_CAPA_TYPE_VALUE
from xmodule.modulestore.exceptions im... | def can_use_library_content(self, block):
""" |
<|file_name|>settings.js<|end_file_name|><|fim▁begin|>'use strict';
var app = angular.module('testReport.project.settings', [
'ngRoute',
]);
app.config(['$routeProvider', function ($routeProvider) {
$routeProvider.when('/project/:projectId/settings', {
templateUrl: '/static/app/partials/project/settin... | if (item.$save) { |
<|file_name|>js_cgo.go<|end_file_name|><|fim▁begin|>//+build cgo
package utub
import (
"strings"
"gopkg.in/olebedev/go-duktape.v2"
)
type duktapeJSEngine struct{}
func (js duktapeJSEngine) Name() string {
return "Duktape"<|fim▁hole|>
func (js duktapeJSEngine) Available() bool {
return true
}
func (js duktapeJ... | } |
<|file_name|>TestForwardDecl.py<|end_file_name|><|fim▁begin|>"""Test that a forward-declared class works when its complete definition is in a library"""
import lldb
from lldbsuite.test.decorators import *
from lldbsuite.test.lldbtest import *
from lldbsuite.test import lldbutil
class ForwardDeclTestCase(TestBase):... | |
<|file_name|>__manifest__.py<|end_file_name|><|fim▁begin|># Copyright 2020 Creu Blanca
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
{
"name": "Kpi Dashboard",
"summary": """
Create Dashboards using kpis""",
"version": "14.0.1.0.0",
"license": "AGPL-3",
"author": "Creu Bla... | |
<|file_name|>has-create.pipe.ts<|end_file_name|><|fim▁begin|>/*
* Lumeer: Modern Data Definition and Processing Platform
*
* Copyright (C) since 2017 Lumeer.io, s.r.o. and/or its affiliates.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public Lic... | RuleTiming.All,
];
|
<|file_name|>login.ts<|end_file_name|><|fim▁begin|>class Login {
constructor() {
this.loadBackground();
}
loginPage() {
}
loadBackground() {
if ($('#image-container').length > 0) {
$.get($('#image-container').data('imageUrl'), this.renderImage.bind(this))
... | |
<|file_name|>models.py<|end_file_name|><|fim▁begin|># -*- coding: UTF-8 -*-
# Copyright 2008-2018 Rumma & Ko Ltd
# License: BSD (see file COPYING for details)
"""Database models for this plugin.
"""
from __future__ import unicode_literals, print_function
import six
from builtins import str
import logging
logger =... | if self.voucher_date is None:
self.voucher_date = self.entry_date
if not self.accounting_period_id: |
<|file_name|>fabfile.py<|end_file_name|><|fim▁begin|>from __future__ import print_function, unicode_literals
from future.builtins import open
import os
import re
import sys
from contextlib import contextmanager
from functools import wraps
from getpass import getpass, getuser
from glob import glob
from importlib import... | |
<|file_name|>stream.rs<|end_file_name|><|fim▁begin|>use metadata;
use frame;
use subframe;
use metadata::{Metadata, StreamInfo};
use frame::frame_parser;
use utility::{
ErrorKind, ByteStream, ReadStream, Sample, SampleSize, StreamProducer,
many_metadata,
};
use std::io;
use std::usize;
use std::fs::File;
/// FLA... | }
S::to_normal(sample)
} |
<|file_name|>login.component.ts<|end_file_name|><|fim▁begin|>import { Component, OnInit } from '@angular/core';
import { AppConfig } from '../../../conf/app.config';
import { AuthService } from '../auth/auth.service';
import { Router } from '@angular/router';
import { Location } from '@angular/common';
import { HttpCli... | |
<|file_name|>middleware.py<|end_file_name|><|fim▁begin|>from django.db.models import signals
from django.utils.functional import curry
from django.contrib.contenttypes.models import ContentType
from django.core import serializers
from django.contrib.admin.models import LogEntry
from django.contrib.sessions.models impor... | ExtLog.objects.create(
object_id=object_id,
app_name=content_type.app_label, |
<|file_name|>tournament.rs<|end_file_name|><|fim▁begin|>#[test]
fn just_the_header_if_no_input() {
let input = "";<|fim▁hole|> assert_eq!(tournament::tally(&input), expected);
}
#[test]
#[ignore]
fn a_win_is_three_points_a_loss_is_zero_points() {
let input = "Allegoric Alaskans;Blithering Badgers;win";
... | let expected = "Team | MP | W | D | L | P";
|
<|file_name|>manage.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
import os
import sys
try:<|fim▁hole|> # For local development in a virtualenv:
from funfactory import manage
except ImportError:
# Production:
# Add a temporary path so that we can import the funfactory
tmp_path = os.path.join... | |
<|file_name|>randomplay.rs<|end_file_name|><|fim▁begin|>//! A bot playing randomly, but still following the rules.
use std::rand::{task_rng, Rng};
use board;
pub fn genmove(goban: &mut board::Board, player: board::Colour) -> board::Vertex {
let size = goban.get_size();
let mut rng = task_rng();
let mut i... | if goban.play(player, x, y){
return board::Put(x,y);
} |
<|file_name|>hooks.py<|end_file_name|><|fim▁begin|>from __future__ import unicode_literals
from frappe import _
app_name = "erpnext"
app_title = "ERPNext"
app_publisher = "Frappe Technologies Pvt. Ltd."
app_description = """ERP made simple"""
app_icon = "fa fa-th"
app_color = "#e74c3c"
app_email = "info@erpnext.com"
a... | 'Retail': 'erpnext.domains.retail', |
<|file_name|>main.java<|end_file_name|><|fim▁begin|>package fr.eurecom.hotspots.web;
<|fim▁hole|>import org.apache.commons.io.FileUtils;
import com.googlecode.mp4parser.authoring.tracks.TextTrackImpl.Line;
import fr.eurecom.hotspots.core.HotSpotGenerator;
import fr.eurecom.hotspots.datastructures.Timeline;
public cl... | import java.io.File;
import java.io.IOException;
import java.util.List;
|
<|file_name|>navtreedata.js<|end_file_name|><|fim▁begin|>var NAVTREE =
[
[ "MLX90621", "index.html", [
[ "MLX90621-Lite", "md__e_1__dropbox__projects__m_l_x90621-_lite__r_e_a_d_m_e.html", null ],
[ "Classes", "annotated.html", [
[ "Class List", "annotated.html", "annotated_dup" ],
[ "Class Index",... |
var SYNCONMSG = 'click to disable panel synchronisation';
var SYNCOFFMSG = 'click to enable panel synchronisation'; |
<|file_name|>tables.py<|end_file_name|><|fim▁begin|># (c) Copyright [2015] Hewlett Packard Enterprise Development LP
#
# 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:/... | class PoolsColumn(tables.Column):
# Customized column class.
def get_raw_data(self, backend_system):
link = _('%(pool_name)s') |
<|file_name|>config.go<|end_file_name|><|fim▁begin|>package server
import (
"github.com/jgautheron/exago/internal/config"<|fim▁hole|>
type Cfg struct {
config.LogConfig
config.HTTPConfig
config.GoogleCloudConfig
}
func InitializeConfig() {
config.InitializeConfig(&Config)
config.InitializeLogging(Config.LogLeve... | )
var Config Cfg |
<|file_name|>packet_out.go<|end_file_name|><|fim▁begin|>/*
* Cherry - An OpenFlow Controller
*
* Copyright (C) 2015 Samjung Data Service, Inc. All rights reserved.
* Kitae Kim <superkkt@sds.co.kr><|fim▁hole|> * it under the terms of the GNU General Public License as published by
* the Free Software Foundation; ei... | *
* This program is free software; you can redistribute it and/or modify |
<|file_name|>restore_video_record.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python3
###############################################################################
# Copyright 2019 The Apollo Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this f... | |
<|file_name|>forLoop.py<|end_file_name|><|fim▁begin|>#! /usr/bin/env python<|fim▁hole|>
words = ['this', 'is', 'an', 'ex', 'parrot']
for word in words:
print word,
print '\n'
# example of for loop in dictionary
d = {'x': 1, 'y': 2, 'z': 3}
for key in d:
print key, 'corresponds to', d[key]
# additional sequence ... |
# example of for loop |
<|file_name|>factory.py<|end_file_name|><|fim▁begin|>"""
This module provides functions that generate commonly used Hamiltonian terms.
"""
__all__ = [
"Annihilator",
"Creator",
"CPFactory",
"HoppingFactory",
"PairingFactory",
"HubbardFactory",
"CoulombFactory",
"HeisenbergFactory",
... | |
<|file_name|>supports_rule.rs<|end_file_name|><|fim▁begin|>/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
//! [@supports rules](https://drafts.csswg.org/css-cond... | /// Parse a condition
///
/// https://drafts.csswg.org/css-conditional/#supports_condition
pub fn parse(input: &mut Parser) -> Result<SupportsCondition, ()> { |
<|file_name|>JettyThreadPoolConfig.js<|end_file_name|><|fim▁begin|>/**
* @license
* Copyright 2020 The FOAM Authors. All Rights Reserved.
* http://www.apache.org/licenses/LICENSE-2.0
*/
foam.CLASS({
package: 'foam.nanos.jetty',
name: 'JettyThreadPoolConfig',
documentation: 'model of org.eclipse.jetty.server.Threa... | {
name: 'idleTimeout',
class: 'Int', |
<|file_name|>question_cli.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
#
# License: MIT<|fim▁hole|>
from __future__ import absolute_import, division, print_function
##############################################################################
# Imports
########################################################... | # |
<|file_name|>renderer-texture.rs<|end_file_name|><|fim▁begin|>extern crate sdl2;
use sdl2::pixels::PixelFormatEnum;
use sdl2::rect::Rect;
use sdl2::event::Event;
use sdl2::keyboard::Keycode;
pub fn main() {
let sdl_context = sdl2::init().unwrap();
let video_subsystem = sdl_context.video().unwrap();
let w... | match event {
Event::Quit {..} | Event::KeyDown { keycode: Some(Keycode::Escape), .. } => {
break 'running |
<|file_name|>quote.js<|end_file_name|><|fim▁begin|>import test from 'ava';
import mdIt from './utils/md-it';
test('quotes should work with basic text', t => {
t.is(mdIt('|test|', {}), '<p><ul class="quotetext">test</ul></p>\n');
});
test('quotes should work with multiline text', t => {<|fim▁hole|><|fim▁end|> | t.is(mdIt('|test\ntesting as well|', {}),
'<p><ul class="quotetext">test\ntesting as well</ul></p>\n');
}); |
<|file_name|>geometry.js<|end_file_name|><|fim▁begin|>var geometry = new (function() {
var pub = this;<|fim▁hole|><|fim▁end|> | pub.distance = function(object1, object2) {
return Math.sqrt(Math.pow(object1.x - object2.x, 2) + Math.pow(object1.y - object2.y, 2));
}
})(); |
<|file_name|>test_fadeout_layer.py<|end_file_name|><|fim▁begin|># This code is so you can run the samples without installing the package
import sys
import os
sys.path.insert(0, os.path.join(os.path.dirname(__file__), '..'))
#
testinfo = "s, t 1, s, t 2, s, t 3, s, t 4.1, s, t 4.2, s, q"
tags = "FadeIn, FadeOut, ColorL... | Notice this will not work for arbitrary Layer objects. |
<|file_name|>sell_button.py<|end_file_name|><|fim▁begin|><|fim▁hole|>class SellButton(Button):
def __init__(self, image, x, y, parent):
super(SellButton, self).__init__(image, x, y, parent)
def get_clicked(self):
self.parent.sell_tower()<|fim▁end|> | from button import Button
|
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
"""
__init__
A translator using the micrsoft translation engine documented here:
http://msdn.microsoft.com/en-us/library/ff512419.aspx
:copyright: © 2011 by Openlabs Technologies & Consulting (P) Limited
:license: BSD, ... | if "error" in response:
raise TranslateApiException( |
<|file_name|>gcccuda.py<|end_file_name|><|fim▁begin|>##
# Copyright 2013-2020 Ghent University
#
# This file is part of EasyBuild,
# originally created by the HPC team of Ghent University (http://ugent.be/hpc/en),
# with support of Ghent University (http://ugent.be/hpc),
# the Flemish Supercomputer Centre (VSC) (https:... | from easybuild.toolchains.compiler.cuda import Cuda
from easybuild.toolchains.gcc import GccToolchain
|
<|file_name|>camera_set_partition.py<|end_file_name|><|fim▁begin|># coding: utf-8
# Copyright (C) 2017 Open Path View, Maison Du Libre
# 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<|fim▁hole|># but WITHOUT ANY WARRANTY; wit... | # the Free Software Foundation; either version 3 of the License, or
# (at your option) any later version.
# This program is distributed in the hope that it will be useful, |
<|file_name|>faHireAHelper.d.ts<|end_file_name|><|fim▁begin|>import { IconDefinition, IconPrefix, IconName } from "@fortawesome/fontawesome-common-types";
export const definition: IconDefinition;
export const faHireAHelper: IconDefinition;
export const prefix: IconPrefix;
export const iconName: IconName;
export const ... | export const unicode: string;
export const svgPathData: string; |
<|file_name|>0001_config.py<|end_file_name|><|fim▁begin|>from django.db import migrations, models
import django.db.models.deletion
from django.conf import settings
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),<|fim▁hole|>
operations... | ] |
<|file_name|>Presentation.py<|end_file_name|><|fim▁begin|># Copyright (C) 2013 Bernd Feige
# This file is part of avg_q and released under the GPL v3 (see avg_q/COPYING).
"""
Presentation utilities.
"""
from . import trgfile
class PresLog(object):
# Basic log file reading.
def __init__(self,logfile,part='events'):
... | self.preamble['Sfreq']=10000.0
def rdr(self):
for fields in self.reader:
data=dict(zip(self.PL.header_fields,fields)) |
<|file_name|>fetch.ts<|end_file_name|><|fim▁begin|>import Message from '../components/Message';
import socket from '../socket';
import { SEAL_TEXT, SEAL_USER_TIMEOUT } from '../../../utils/const';
/** 用户是否被封禁 */
let isSeal = false;
export default function fetch<T = any>(
event: string,
data = {},
{ toast... | * 用户再触发接口请求时, 直接拒绝
*/
if (res === SEAL_TEXT) {
isSeal = true; |
<|file_name|>empty_resource.go<|end_file_name|><|fim▁begin|>package errors
func NewEmptyResourceError() *EmptyResourceError {
return &EmptyResourceError{}
}
type EmptyResourceError struct{}
func (e *EmptyResourceError) Error() string {<|fim▁hole|><|fim▁end|> | return "EmptyResourceError"
} |
<|file_name|>boss_patchwerk.cpp<|end_file_name|><|fim▁begin|>/* This file is part of the ScriptDev2 Project. See AUTHORS file for Copyright information
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Fou... | }
DoMeleeAttackIfReady();
} |
<|file_name|>parsetweet.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
import os,sys
import string
import re
import pickle
stopword_file = './stopwords'
class CleanTweet(object):
"""
case-sensitive, removed url, hashtag#, special term like 'RT', and reply@
"""
_url = r'http[s]?://(?:[a-zA-... | |
<|file_name|>markdown.js<|end_file_name|><|fim▁begin|>// CodeMirror, copyright (c) by Marijn Haverbeke and others
// Distributed under an MIT license: http://codemirror.net/LICENSE
(function(mod) {
if (typeof exports == "object" && typeof module == "object") // CommonJS
mod(require("../../lib/codemirror"), ... | function blockNormal(stream, state) {
var sol = stream.sol();
|
<|file_name|>Array2D.java<|end_file_name|><|fim▁begin|>/*
* Array2D.java Jul 14, 2004
*
* Copyright (c) 2004 Stan Salvador
* stansalvador@hotmail.com
*/
package com.tum.ident.fastdtw.matrix;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Iterator;
public class Array2D
{
// PRIV... | |
<|file_name|>theme.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
"""
This file is part of quiedit.
quiedit 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 o... | |
<|file_name|>total_ordering_student.py<|end_file_name|><|fim▁begin|>#total_ordering_student.py
import functools
@functools.total_ordering<|fim▁hole|> self.lastname = lastname
def __eq__(self, other): #判断姓名是否一致
return ((self.lastname.lower(), self.firstname.lower()) ==
(other.lastn... | class Student:
def __init__(self, firstname, lastname): #姓和名
self.firstname = firstname |
<|file_name|>test__helpers.py<|end_file_name|><|fim▁begin|># Copyright 2014 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# ... | return self.return_vals.pop()
|
<|file_name|>utils.py<|end_file_name|><|fim▁begin|>#!/bin/python
# gofed-ng - Golang system
# Copyright (C) 2016 Fridolin Pokorny, fpokorny@redhat.com
#
# 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 Foun... | basename = os.path.basename(service_path)
return basename[:-len('.py')]
|
<|file_name|>box.tsx<|end_file_name|><|fim▁begin|>import * as React from "react";
require("css/box.styl");
export interface IProps extends React.Props<any> {
title: string;
description?: string;
error?: string;
footer?: JSX.Element;
}
export default function Box(props: IProps) {
retu... | |
<|file_name|>inflightmap.rs<|end_file_name|><|fim▁begin|>use std::cmp::Ordering;
use std::collections::hash_map::{Entry, RandomState};
use std::collections::{BinaryHeap, HashMap};<|fim▁hole|>use std::hash::{BuildHasher, Hash};
use std::ops::Deref;
// TODO: need a more efficient implementation and possibly more flexibi... | use std::fmt; |
<|file_name|>main.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
# -*- coding: utf-8 -*-
import webapp2
import hinet
import seednet
import StringIO
import PyRSS2Gen
import urllib
import datetime
import hashlib
#from google.appengine.ext import ndb
from google.appengine.api import memcache
HTTP_DATE_FMT = '%a, ... | ('/hinet', Hinet),
('/seednet', Seednet),
], debug=False) |
<|file_name|>Flags.cpp<|end_file_name|><|fim▁begin|>#include "StdInc.h"
#include <ShellAPI.h>
unsigned int _gameFlags;
typedef struct
{
const wchar_t* argument;
unsigned int flag;
} flagDef_t;
flagDef_t flags[] =
{
{ L"offline", GAME_FLAG_OFFLINE },
{ L"console", GAME_FLAG_CONSOLE },
{ 0, 0 }
};
void Determi... | {
for (flagDef_t* flag = flags; flag->argument; flag++)
{ |
<|file_name|>bitcoin_tr.ts<|end_file_name|><|fim▁begin|><TS language="tr" version="2.1">
<context>
<name>AddressBookPage</name>
<message>
<source>Right-click to edit address or label</source>
<translation>Adres veya etiketi düzenlemek için sağ tıklayınız.</translation>
</message>
<messag... | |
<|file_name|>NavigationDrawerCallbacks.java<|end_file_name|><|fim▁begin|>package com.ua.hower.house;
/**<|fim▁hole|> void onNavigationDrawerItemSelected(int position);
}<|fim▁end|> | * Created by poliveira on 27/10/2014.
*/
public interface NavigationDrawerCallbacks { |
<|file_name|>node.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
""" cdecl.py - parse c declarations
(c) 2002, 2003, 2004, 2005 Simon Burton <simon@arrowtheory.com>
Released under GNU LGPL license.
version 0.xx
"""
import string
class Node(list):
" A node in a parse tree "
def __init__(self,*items... | while nodes:
assert len(nodes)==len(idxs)==len(itemss)
node = nodes[-1] |
<|file_name|>testmock.py<|end_file_name|><|fim▁begin|>import copy
import re
import sys
import tempfile
import unittest
from mock.tests.support import ALWAYS_EQ
from mock.tests.support import is_instance
from mock import (
call, DEFAULT, patch, sentinel,
MagicMock, Mock, NonCallableMock,
NonCallableMagicMoc... | call(1)(2)(3).a.b.c(4).call_list())
self.assertEqual(mock().mock_calls, |
<|file_name|>wsgi.py<|end_file_name|><|fim▁begin|>"""
WSGI config for billboards project.
This module contains the WSGI application used by Django's development server
and any production WSGI deployments. It should expose a module-level variable
named ``application``. Django's ``runserver`` and ``runfcgi`` commands di... | from django.core.wsgi import get_wsgi_application
application = get_wsgi_application() |
<|file_name|>ztypes_freebsd_arm.go<|end_file_name|><|fim▁begin|>// Created by cgo -godefs - DO NOT EDIT
// cgo -godefs -- -fsigned-char types_freebsd.go
package syscall
const (
sizeofPtr = 0x4
sizeofShort = 0x2
sizeofInt = 0x4
sizeofLong = 0x4
sizeofLongLong = 0x8
)
type (
_C_short int16
... | SizeofIfMsghdr = 0x70 |
<|file_name|>shootout-binarytrees.rs<|end_file_name|><|fim▁begin|>// Copyright 2012-2013 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution and at
// http://rust-lang.org/COPYRIGHT.
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.... | |
<|file_name|>faktionbankkauftwertpapiere.cpp<|end_file_name|><|fim▁begin|>#include "faktionbankkauftwertpapiere.h"
FAktionBankKauftWertpapiere::FAktionBankKauftWertpapiere(){<|fim▁hole|>
FAktionBankKauftWertpapiere::FAktionBankKauftWertpapiere(FGeld BETRAG, int BANKNR, int BANKKUNDENNR){
Betrag = BETRAG;
... | }
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.