prompt large_stringlengths 70 991k | completion large_stringlengths 0 1.02k |
|---|---|
<|file_name|>tests.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
import unittest
from hanspell import spell_checker
from hanspell.constants import CheckResult
from textwrap import dedent as trim
class SpellCheckerTests(unittest.TestCase):
def setUp(self):
pass
def test_basic_check(self):
... |
def test_words(self):
result = spell_checker.check(u'한아이가 장난깜을 갖고놀고있다. 그만하게 할가?') |
<|file_name|>urls.py<|end_file_name|><|fim▁begin|>"""dryorm URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/1.11/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatter... | ] |
<|file_name|>handler_functions_test.go<|end_file_name|><|fim▁begin|>package aws
import (
"net/http"
"os"
"testing"
"github.com/stretchr/testify/assert"
"github.com/trayio/bunny/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aws/awserr"
"github.com/trayio/bunny/Godeps/_workspace/src/github.com/aws/aws-sdk-go/aw... | }
func TestValidateEndpointHandlerErrorRegion(t *testing.T) { |
<|file_name|>rangelist.go<|end_file_name|><|fim▁begin|>package user
import (
"strconv"
"strings"
)
// RangeList is a list of user ranges
type RangeList []*Range
// ParseRangeList parses a string that contains a comma-separated list of ranges
func ParseRangeList(str string) (*RangeList, error) {
rl := RangeList{}
... | }
return &rl, nil |
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|>'''
Task Coach - Your friendly task manager
Copyright (C) 2004-2013 Task Coach developers <developers@taskcoach.org>
Task Coach 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 Sof... | GNU General Public License for more details. |
<|file_name|>input.trigger.js<|end_file_name|><|fim▁begin|>/*
* The trigger API
*
* - Documentation: ../docs/input-trigger.md
*/
+function ($) { "use strict";
var TriggerOn = function (element, options) {
var $el = this.$el = $(element);
this.options = options || {};
if (this.options... | this.triggerCondition = this.options.triggerCondition
|
<|file_name|>deepcopy.go<|end_file_name|><|fim▁begin|>/*
Copyright 2015 The Kubernetes Authors All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/license... | sw.Do("return err\n", nil)
sw.Do("} else {\n", nil)
sw.Do("(*out)[i] = newVal.($.|raw$)\n", t.Elem) |
<|file_name|>tensor.py<|end_file_name|><|fim▁begin|>"""
This module defines tensors with abstract index notation.
The abstract index notation has been first formalized by Penrose.
Tensor indices are formal objects, with a tensor type; there is no
notion of index range, it is only possible to assign the dimension,
use... | >>> R = tensorhead('R', [Lorentz]*4, [[2, 2]])
>>> t = R(i,j,k,l)*(R(-i,-j,-k,-l) - 2*R(-i,-k,-j,-l))
>>> riemann_cyclic(t) |
<|file_name|>test_scoping.py<|end_file_name|><|fim▁begin|>from unittest.mock import Mock
import sqlalchemy as sa
from sqlalchemy import ForeignKey
from sqlalchemy import Integer
from sqlalchemy import String
from sqlalchemy import testing
from sqlalchemy.orm import query
from sqlalchemy.orm import relationship
from sq... | if not name.startswith("_")
]
|
<|file_name|>deriving-span-Zero-struct.rs<|end_file_name|><|fim▁begin|>// Copyright 2014 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution and at
// http://rust-lang.org/COPYRIGHT.
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.... |
struct Error;
|
<|file_name|>PcepControllerAdapter.java<|end_file_name|><|fim▁begin|>/*
* Copyright 2014 Open Networking Laboratory
*
* 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... | return null;
} |
<|file_name|>test.py<|end_file_name|><|fim▁begin|>import unittest
import json
import logintc
class TestLoginTCClient(unittest.TestCase):
def set_response(self, method, url, headers, body):
full_url = ''.join(['https://cloud.logintc.com/api', url])
self.responses[(method, full_url)] = (headers, bo... | 'name': "user two"}]
path = '/domains/%s/users' % self.domain_id
|
<|file_name|>BaseTreeBusRules.java<|end_file_name|><|fim▁begin|>/* Copyright (C) 2022, Specify Collections Consortium
*
* Specify Collections Consortium, Biodiversity Institute, University of Kansas,
* 1345 Jayhawk Boulevard, Lawrence, Kansas, 66045, USA, support@specifysoftware.org
*
* This program is free soft... | |
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|>from __future__ import print_function<|fim▁hole|>from .patchpipette import PatchPipette<|fim▁end|> | |
<|file_name|>cs_CZ.js<|end_file_name|><|fim▁begin|>{
"": {
"domain": "ckan",
"lang": "cs_CZ",
"plural-forms": "nplurals=3; plural=(n==1) ? 0 : (n>=2 && n<=4) ? 1 : 2;"
},
"An Error Occurred": [
null,
"Nastala chyba"
],
"Are you sure you want to perform this action?": [
null,
"Jste ... | ],
"Unable to upload file": [
null, |
<|file_name|>multicol.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/. */
//! CSS Multi-column layout http://dev.w3.org/csswg/css-mult... | }
}); |
<|file_name|>Seat.js<|end_file_name|><|fim▁begin|>import {Entity} from 'aframe-react';
import React from 'react';
export default class Seat extends React.Component {
constructor(props) {
super(props);
this.state = {
opacity: 1,
};
}
render() {
return (
<Entity position={this.pro... | );
}} |
<|file_name|>task-comm-16.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/li... | tx2.send(10).unwrap();
let mut i: isize;
i = rx2.recv().unwrap();
assert_eq!(i, 10); |
<|file_name|>iter-map-fn-return.js<|end_file_name|><|fim▁begin|>// Copyright (C) 2015 the V8 project authors. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
esid: sec-array.from
es6id: 22.1.2.1
description: Value returned by mapping function (traversed via iterator)
in... | result = Array.from(items, mapFn);
assert.sameValue(result.length, 2); |
<|file_name|>dropbox.py<|end_file_name|><|fim▁begin|>###############################################################################
#
# Copyright (C) 2001-2014 Micronaet SRL (<http://www.micronaet.it>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Af... | # |
<|file_name|>nestingLimit.cpp<|end_file_name|><|fim▁begin|>// ArduinoJson - https://arduinojson.org
// Copyright © 2014-2022, Benoit BLANCHON
// MIT License
#include <ArduinoJson.h>
#include <catch.hpp>
#define SHOULD_WORK(expression) REQUIRE(DeserializationError::Ok == expression);
#define SHOULD_FAIL(expression) \
... | |
<|file_name|>chevron-right.js<|end_file_name|><|fim▁begin|>'use strict';
var React = require('react');<|fim▁hole|>
var NavigationChevronRight = React.createClass({
displayName: 'NavigationChevronRight',
render: function render() {
return React.createElement(
SvgIcon,
this.props,
React.create... | var SvgIcon = require('../../svg-icon'); |
<|file_name|>config.py<|end_file_name|><|fim▁begin|># vim: tabstop=4 shiftwidth=4 softtabstop=4
#
# Copyright 2012, Nachi Ueno, NTT MCL, Inc.<|fim▁hole|># 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 o... | # All Rights Reserved.
# |
<|file_name|>0004_auto__add_articlecomment.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
from south.utils import datetime_utils as datetime
from south.db import db<|fim▁hole|>
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding model 'ArticleComment'
db.create_table('cms_... | from south.v2 import SchemaMigration
from django.db import models |
<|file_name|>actor.rs<|end_file_name|><|fim▁begin|>use crate::{
actionable_events::ActionDispatcher,
actions::ActionOutput,
entity::{EntityRef, Realm},
};
pub trait Actor: std::fmt::Debug {
/// Returns whether the actor's `on_active()` callback should be invoked when the actor becomes
/// idle afte... | |
<|file_name|>webdriver.cpp<|end_file_name|><|fim▁begin|>/*
Copyright 2007-2009 WebDriver committers
Copyright 2007-2009 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.a... | }
|
<|file_name|>test_driver.py<|end_file_name|><|fim▁begin|>"""
@package mi.instrument.seabird.sbe16plus_v2.test.test_driver
@file mi/instrument/seabird/sbe16plus_v2/test/test_driver.py
@author David Everett
@brief Test cases for InstrumentDriver
USAGE:
Make tests verbose and provide stdout
* From the IDK
$ b... | |
<|file_name|>PropertySupport.java<|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 appl... | * @param target the given Object to extract property from. |
<|file_name|>interval_base_map.hpp<|end_file_name|><|fim▁begin|>/*-----------------------------------------------------------------------------+
Copyright (c) 2007-2012: Joachim Faulhaber
Copyright (c) 1999-2006: Cortex Software GmbH, Kantstrasse 57, Berlin
+-------------------------------------------------------------... | interval_base_map<SubType,DomainT,CodomainT,Traits,Compare,Combine,Section,Interval,Alloc>
::_insert(iterator prior_, const segment_type& addend) |
<|file_name|>issue-7563.rs<|end_file_name|><|fim▁begin|>// Copyright 2014 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution and at
// http://rust-lang.org/COPYRIGHT.
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/lice... | } |
<|file_name|>Lock.java<|end_file_name|><|fim▁begin|>/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package blastbenchmark;
<|fim▁hole|> * @author thanos
*/
public class Lock {
... |
/**
* |
<|file_name|>exceptions.py<|end_file_name|><|fim▁begin|>"""Special exceptions for the ``command_interface`` app."""
class CommandError(Exception):<|fim▁hole|><|fim▁end|> | pass |
<|file_name|>BundleGrid.js<|end_file_name|><|fim▁begin|>/*
* Copyright 2013 pingworks - Alexander Birk und Christoph Lukas
* Copyright 2014 //SEIBERT/MEDIA - Lars-Erik Kimmel
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* Yo... | |
<|file_name|>tck-touchscreen-websockets.js<|end_file_name|><|fim▁begin|>/**********************************************************************************
*
* This file is part of e-venement.
*
* e-venement is free software; you can redistribute it and/or modify
* it under the terms of the GNU Gen... | }, |
<|file_name|>util.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
from __future__ import absolute_import
import inspect
import itertools
import random
import warnings
import numpy as np
from .gd import GradientDescent
from .bfgs import Lbfgs
from .cg import NonlinearConjugateGradient
from .rprop import Rpro... | ----------
options : dict |
<|file_name|>create_script_steps.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
#
# Copyright 2015-2020 BigML
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apac... | res_param_value = world.script[param]
eq_(res_param_value, param_value,
("The script %s is %s and the expected %s is %s" % |
<|file_name|>PropertyList.tsx<|end_file_name|><|fim▁begin|>import React from 'react';
import {Button, Empty, Tooltip} from 'antd';
import PlusSquareIcon from '@ant-design/icons/PlusSquareOutlined';
import {
attributeList,
ClientConn,
ValueSubscriber,
ValueUpdate,
blankFuncDesc,
configDescs,
configList,
... | createLoader(path: string) { |
<|file_name|>source_transformer.py<|end_file_name|><|fim▁begin|>import command_line
import ast
import os
import traceback
from operator import attrgetter
import settings
from execution_tree_builder import build_execution_tree
# TODO move classes to separate files
class DataCollectorCall(object):
def __init__(se... |
class Statement(object): |
<|file_name|>translate_test.py<|end_file_name|><|fim▁begin|>"""Translate generators test."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import os
import shutil
import tarfile
import tensorflow as tf
from data_generators import text_problems
from data_... |
for i, dataset in enumerate(cls.DATASETS):
tar_file = dataset[0]
en_file, de_file = [ |
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|><|fim▁hole|>"""Tests for Airly."""<|fim▁end|> | |
<|file_name|>ui_pxmarkerdialog.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'pxmarkerdialog.ui'
#
# Created by: PyQt5 UI code generator 5.8.1
#
# WARNING! All changes made in this file will be lost!
from PyQt5 import QtCore, QtGui, QtWidgets
class Ui_Px... | self.pxmarker_table_widget.setEditTriggers(QtWidgets.QAbstractItemView.DoubleClicked|QtWidgets.QAbstractItemView.EditKeyPressed)
self.pxmarker_table_widget.setObjectName("pxmarker_table_widget")
self.pxmarker_table_widget.setColumnCount(3) |
<|file_name|>SinusGenerator.cpp<|end_file_name|><|fim▁begin|>/*
* Project Maudio
* Copyright (C) 2015 Martin Schwarz
* See LICENSE.txt for the full license
*/
#include "core/audiosource/SinusGenerator.hpp"
#include "core/util/AudioException.hpp"
#include "core/util/Util.hpp"
#include <cmath>
namespace maudio{
Si... | mChannels.reset(new UIntProperty("Channels", 1));
mProperties.add(mChannels);
|
<|file_name|>partial_guild.rs<|end_file_name|><|fim▁begin|>use super::super::utils::{deserialize_emojis, deserialize_roles};
use ::model::*;
#[cfg(feature="model")]
use ::builder::{EditGuild, EditMember, EditRole};
/// Partial information about a [`Guild`]. This does not include information
/// like member data.
///
... | /// Returns the Id of the shard associated with the guild.
///
/// When the cache is enabled this will automatically retrieve the total
/// number of shards. |
<|file_name|>kgapp.cpp<|end_file_name|><|fim▁begin|>/*
Greeter module for xdm
Copyright (C) 1997, 1998 Steffen Hansen <hansen@kde.org>
Copyright (C) 2000-2003 Oswald Buddenhagen <ossi@kde.org>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License a... | { |
<|file_name|>test_utils_dataframe.py<|end_file_name|><|fim▁begin|>import numpy as np
import pandas as pd
import pandas.util.testing as tm
import dask.dataframe as dd
from dask.dataframe.utils import (shard_df_on_index, meta_nonempty, make_meta,
raise_on_meta_error)
import pytest
def... | assert isinstance(meta, type(df.index)) |
<|file_name|>video.service.ts<|end_file_name|><|fim▁begin|>import { Injectable } from '@angular/core';
import { Http, Response, Headers, RequestOptions } from '@angular/http';
import { Observable } from 'rxjs/Observable';
// import 'rxjs/add/operator/map';
import 'rxjs/Rx';
import { Config } from './config';
imp... | if(t > 0) str = t + ' phút';
else {
t = Math.floor(t0/1000); |
<|file_name|>handlers.rs<|end_file_name|><|fim▁begin|>// Handle incoming requests.
extern crate iron;
extern crate redis;
extern crate rustc_serialize;
extern crate hyper;
extern crate url;
extern crate router;
use std::vec::Vec;
use rustc_serialize::json::Json;
use iron::modifiers::Redirect;
use iron::headers::{Cac... | if let Ok(json) = Json::from_str(&body) {
if let Some(&Json::String(ref sha)) = json.find_path(&["object", "sha"]) {
// Once found, store the SHA in the cache and redirect |
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
#<|fim▁hole|># to deal in the Software without restriction, including without limitation
# the rights to use, copy, modify, merge, publish, distribute, sublicense,
# and/or sell copies of the Software, and to permit persons to whom the ... | # Copyright (c) 2014 Hamilton Kibbe <ham@hamiltonkib.be>
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the "Software"), |
<|file_name|>_action_groups_operations.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.
# ... | cls = kwargs.pop('cls', None) # type: ClsType["_models.ActionGroupResource"]
error_map = {
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError |
<|file_name|>index.js<|end_file_name|><|fim▁begin|>import React, { Component } from 'react';
import CatagoryBox1 from '../CatagoryBox1';
import { BgBox } from './style';
function BackgroundBox (props) {
const {bcolor} = props;
const {data} = props;
const cata = data.map((d,i) => <CatagoryBox1 data={d} key={i} />... | <BgBox bcolor={bcolor}>
{cata}
</BgBox> |
<|file_name|>EtoileImageToTexturePlugin.cpp<|end_file_name|><|fim▁begin|>/**
* Copyright(C) 2009-2012
* @author Jing HUANG
<|fim▁hole|>* @date 1/2/2011
*/
#include "EtoileImageToTexturePlugin.h"
#include "util/File.h"
#include "QtTextureLoader.h"
/**
* @brief For tracking memory leaks und... | * @file EtoileImageToTexturePlugin.cpp
* @brief
|
<|file_name|>base.py<|end_file_name|><|fim▁begin|># Copyright (c) 2014 Mirantis, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# U... | application = self._get_telnet_app()
environment = self._quick_deploy(name, application)
|
<|file_name|>transmute_int_to_float.rs<|end_file_name|><|fim▁begin|>use super::TRANSMUTE_INT_TO_FLOAT;
use clippy_utils::diagnostics::span_lint_and_then;
use clippy_utils::sugg;
use rustc_errors::Applicability;
use rustc_hir::Expr;
use rustc_lint::LateContext;
use rustc_middle::ty::{self, Ty};
/// Checks for `transmut... | |
<|file_name|>LazyGenerator.py<|end_file_name|><|fim▁begin|>#
# Copyright (C) 2003-2006 greg Landrum and Rational Discovery LLC
#
# @@ All Rights Reserved @@
# This file is part of the RDKit.
# The contents are covered by the terms of the BSD license
# which is included in the file license.txt, found at the root
# ... | def __init__(self, sigFactory, mol, dMat=None, bitCache=True):
""" constructor |
<|file_name|>ConsultaCNPJBC.java<|end_file_name|><|fim▁begin|>package br.gov.serpro.infoconv.proxy.businesscontroller;
import java.lang.reflect.Field;
import java.util.ArrayList;
import java.util.List;
import javax.inject.Inject;
import br.gov.frameworkdemoiselle.stereotype.BusinessController;
import br.gov.serpro.i... | import br.gov.serpro.infoconv.ws.cnpj.CNPJPerfil3;
/**
* Classe responsável por interagir com o componente infoconv-ws para obter as |
<|file_name|>test.scratch.be.speech.cpp<|end_file_name|><|fim▁begin|>/* /////////////////////////////////////////////////////////////////////////
* File: test/scratch/test.scratch.be.speech/test.scratch.be.speech.cpp
*
* Purpose: C++ example program for Pantheios. Demonstrates:
*
* - use ... |
/* Pantheios header files */
#include <pantheios/pantheios.hpp> |
<|file_name|>grep_test.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python -u<|fim▁hole|># encoding: utf-8
#
# Copyright (c) 2012, Peter Hillerström <peter.hillerstrom@gmail.com>
# All rights reserved. This software is licensed under 3-clause BSD license.
#
# For the full copyright and license information, please vie... | |
<|file_name|>SQLManagerKeyOverwiteTest.java<|end_file_name|><|fim▁begin|>package water.jdbc;
<|fim▁hole|>import water.Key;
import water.Keyed;
import water.fvec.Frame;
import water.runner.CloudSize;
import water.runner.H2ORunner;
import java.util.Set;
import java.util.stream.Collectors;
import java.util.stream.IntStre... | import org.junit.Test;
import org.junit.runner.RunWith; |
<|file_name|>OgreShaderExHardwareSkinning.cpp<|end_file_name|><|fim▁begin|>/*
-----------------------------------------------------------------------------
This source file is part of OGRE
(Object-oriented Graphics Rendering Engine)
For the latest info, see http://www.ogre3d.org
Copyright (c) 2000-2014 Torus Knot Soft... | {
}
|
<|file_name|>how-to-snippet.component.ts<|end_file_name|><|fim▁begin|>import { Component, OnInit } from '@angular/core';
import { environment } from '../../../../environments/environment';
@Component({
selector: 'app-howto-snippets',
templateUrl: './how-to-snippet.component.html',<|fim▁hole|>export class HowToSnip... | styleUrls: ['./how-to-snippet.component.scss']
}) |
<|file_name|>test_properties.py<|end_file_name|><|fim▁begin|># coding: utf-8
"""
/properties/
/properties/:id/<|fim▁hole|>/properties/groups/:name/
"""
from django.test import TestCase
from django.core.urlresolvers import reverse
from rest_framework import status
from rest_framework.test import APITestCase
from ..model... | /properties/groups/
/properties/groups/:id/ |
<|file_name|>constants.py<|end_file_name|><|fim▁begin|>"""
Constants specific to the SQL storage portion of the ORM.
"""
from collections import namedtuple
import re
# Valid query types (a set is used for speedy lookups). These are (currently)
# considered SQL-specific; other storage systems may choose to use differe... | # dictionary in the Query class). |
<|file_name|>always_update.py<|end_file_name|><|fim▁begin|># coding=utf-8
from __future__ import print_function
"""
Place in ~/.octoprint/plugins & restart server to test:
* python_checker and python_updater mechanism
* demotion of pip and python setup.py clean output that
gets written to stderr but isn't as ... | |
<|file_name|>test_activity_log.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Copyright 2010-2012 Asidev s.r.l.
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
... | al.commit()
with self.assertRaises(TransactionError):
al.rollback() |
<|file_name|>createBucketWindow.js<|end_file_name|><|fim▁begin|>/*
* File: app/view/createBucketWindow.js
*
* This file was generated by Sencha Architect version 3.0.4.
* http://www.sencha.com/products/architect/
*
* This file requires use of the Ext JS 4.2.x library, under independent license.
* License of Senc... | |
<|file_name|>HttpStatusCode.java<|end_file_name|><|fim▁begin|>/***************************************************************************
Copyright (c) 2016, EPAM SYSTEMS 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 obtai... | public class HttpStatusCode {
public static final int OK = 200; |
<|file_name|>commands.py<|end_file_name|><|fim▁begin|>import os
from gettext import gettext as _
from pulp.bindings.exceptions import NotFoundException
from pulp.client.arg_utils import convert_boolean_arguments
from pulp.client.extensions.decorator import priority
from pulp.client.extensions.extensions import PulpCl... |
def __init__(self, context): |
<|file_name|>views.py<|end_file_name|><|fim▁begin|>import json
import os
from flask import request, g, render_template, make_response, jsonify, Response
from helpers.raw_endpoint import get_id, store_json_to_file
from helpers.groups import get_groups
from json_controller import JSONController
from main import app
from... | def get_db():
"""Connects to Mongo database"""
if not hasattr(g, 'mongo_client'): |
<|file_name|>test_sh_base.py<|end_file_name|><|fim▁begin|>import shesha.config as conf
simul_name = "bench_scao_sh_16x16_8pix"
# loop
p_loop = conf.Param_loop()
p_loop.set_niter(100)
p_loop.set_ittime(0.002) # =1/500
# geom
p_geom = conf.Param_geom()
p_geom.set_zenithangle(0.)
# tel
p_tel = conf.Param_tel()
p_t... | p_wfs0.set_npix(8) |
<|file_name|>bitcoin_fa_IR.ts<|end_file_name|><|fim▁begin|><?xml version="1.0" ?><!DOCTYPE TS><TS language="fa_IR" version="2.0">
<defaultcodec>UTF-8</defaultcodec>
<context>
<name>AboutDialog</name>
<message>
<location filename="../forms/aboutdialog.ui" line="+14"/>
<source>About Unicorncoin</s... | <message>
<location line="+23"/> |
<|file_name|>urls.py<|end_file_name|><|fim▁begin|><|fim▁hole|>from django.urls import re_path
from .views import PrivateStorageView
urlpatterns = [
re_path(r'^(?P<path>.*)$', PrivateStorageView.as_view(), name='serve_private_file'),
]<|fim▁end|> | |
<|file_name|>crowdsource.config.js<|end_file_name|><|fim▁begin|>(function () {
'use strict';
angular
.module('crowdsource.config', ['angular-loading-bar'])
.config(config);
config.$inject = ['$httpProvider', '$locationProvider', '$mdThemingProvider', 'cfpLoadingBarProvider'];
/**
... | "A400":"#404893","A700":"#141a5f"
});
|
<|file_name|>libprotoident.cc<|end_file_name|><|fim▁begin|>/*
*
* Copyright (c) 2011-2016 The University of Waikato, Hamilton, New Zealand.
* All rights reserved.
*
* This file is part of libprotoident.
*
* This code has been developed by the University of Waikato WAND
* research group. For further information ... | #define __STDC_LIMIT_MACROS
#include <stdio.h> |
<|file_name|>delete_data.py<|end_file_name|><|fim▁begin|># muddersOnRails()
# Sara McAllister November 17, 2017
# Last updated: 11-17-2017
# delete all data from database and remove generated graphs (this is super sketch)
import os
import dbCalls
summary_file = 'app/assets/images/summary.png'
overall_file = 'app/as... | pass
if __name__ == "__main__":
main() |
<|file_name|>archstatus.go<|end_file_name|><|fim▁begin|>package main
import (
"bytes"
"fmt"
"os/exec"
"github.com/mgutz/ansi"
"github.com/stevedomin/termtable"
"strings"
)
func fmtString(color, str, reset string) string {
return fmt.Sprintf("%s%s%s", color, str, reset)
}
func main() {
services := []string{
"cro... | "mysqld.service",
"ntpd.service",
"postfix.service", |
<|file_name|>seccat.go<|end_file_name|><|fim▁begin|>// package main provides an implementation of netcat using the secio package.
// This means the channel is encrypted (and MACed).
// It is meant to exercise the spipe package.
// Usage:
// seccat [<local address>] <remote address>
// seccat -l <local address>
//... | |
<|file_name|>symbolic_property.hpp<|end_file_name|><|fim▁begin|>//Symbolic Property
#ifndef _PROBMODELS_BASE_SYMBOLIC_PROPERTY_HPP_
#define _PROBMODELS_BASE_SYMBOLIC_PROPERTY_HPP_
#include <array>
#include "boost/pending/property.hpp"
namespace probmodels {
namespace base {
//Property must be copyable, assignable a... | public:
SymbolicProperty() {}
SymbolicProperty(const SymbolicProperty& prop) :
_label(prop._label), _prop(prop._prop) {} |
<|file_name|>ios-device-product-name-mapper.ts<|end_file_name|><|fim▁begin|>import { IStringDictionary } from "../../declarations";
import { injector } from "../../yok";
class IosDeviceProductNameMapper implements Mobile.IiOSDeviceProductNameMapper {
// http://support.hockeyapp.net/kb/client-integration-ios-mac-os-x/... | "iPad4,9": "iPad mini 3 (A1601)", |
<|file_name|>mysql_mail_log_test.go<|end_file_name|><|fim▁begin|>package dao
import (
"go-common/app/admin/ep/merlin/model"
"testing"
. "github.com/smartystreets/goconvey/convey"
)
var (
username = "fengyifenguitest@bilibili.com"
)
func Test_Mail_Log(t *testing.T) {
Convey("test add mail log", t, func() {
ml... | So(len(mailLogs), ShouldBeGreaterThan, 0)
So(err, ShouldBeNil) |
<|file_name|>var-captured-in-nested-closure.rs<|end_file_name|><|fim▁begin|><|fim▁hole|>// file at the top-level directory of this distribution and at
// http://rust-lang.org/COPYRIGHT.
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT lice... | // Copyright 2013-2014 The Rust Project Developers. See the COPYRIGHT |
<|file_name|>0024_homepagefeaturedpage.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
import modelcluster.fields
class Migration(migrations.Migration):
dependencies = [
('wagtailcore', '0028_merge'),
('home... | |
<|file_name|>convert.go<|end_file_name|><|fim▁begin|>// Copyright 2017 The go-darwin Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package hdiutil
import "os/exec"
// formatFlag implements a hdiutil convert command format flag in... | // ConvertRdWr NDIF read/write image (deprecated).
ConvertRdWr |
<|file_name|>views.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
'''
Copyright 2014 FreshPlanet (http://freshplanet.com | opensource@freshplanet.com)
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the L... |
class SampleHandler(webapp2.RequestHandler):
@ndb.toplevel |
<|file_name|>is_stateless.hpp<|end_file_name|><|fim▁begin|>// (C) Copyright Steve Cleary, Beman Dawes, Howard Hinnant & John Maddock 2000.<|fim▁hole|>// http://www.boost.org/LICENSE_1_0.txt).
//
// See http://www.boost.org/libs/type_traits for most recent version including documentation.
#ifndef BOOST_TT_IS_STATELE... | // Use, modification and distribution are subject to the Boost Software License,
// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at |
<|file_name|>commandfactory.go<|end_file_name|><|fim▁begin|>package main
import "strings"
//CreateCommand is a factory method that returns the command that
//is infered from the passed command line arguments.
func CreateCommand(args []string, translator Translator) Command {<|fim▁hole|> if args == nil || len(args) ==... | |
<|file_name|>AppcastReplaceItem.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python<|fim▁hole|>AppcastReplaceItem <path-to-appcast> <old-version> <new-version> <path-to-dmg>
Example: AppcastReplaceItem appcast-release.xml 1.1.4 1.2 Release/build/Adium_1.2.dmg
"""
# Configurable variables.
app_name = 'Adium'
changel... |
"""
Usage: |
<|file_name|>coverage-missing.cc<|end_file_name|><|fim▁begin|>// Test for "sancov.py missing ...".
// First case: coverage from executable. main() is called on every code path.
// RUN: %clangxx_asan -fsanitize-coverage=func,trace-pc-guard %s -o %t -DFOOBAR -DMAIN
// RUN: rm -rf %t-dir
// RUN: mkdir -p %t-dir
// RUN: c... | // RUN: %sancov missing %t < foo.txt > foo-missing.txt
// RUN: sort main.txt foo-missing.txt -o foo-missing-with-main.txt
// The "missing from foo" set may contain a few bogus PCs from the sanitizer
// runtime, but it must include the entire "bar" code path as a subset. Sorted |
<|file_name|>tokenstream.rs<|end_file_name|><|fim▁begin|>//! # Token Streams
//!
//! `TokenStream`s represent syntactic objects before they are converted into ASTs.
//! A `TokenStream` is, roughly speaking, a sequence of [`TokenTree`]s,
//! which are themselves a single [`Token`] or a `Delimited` subsequence of tokens.... | impl<'t> Iterator for CursorRef<'t> {
type Item = &'t TokenTree;
fn next(&mut self) -> Option<&'t TokenTree> { |
<|file_name|>p2p_addrfetch.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python3
# Copyright (c) 2021 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""
Test p2p addr-fetch connections
"""
import time... | peer = node.add_outbound_p2p_connection(P2PInterface(), p2p_idx=0, connection_type="addr-fetch")
info = node.getpeerinfo() |
<|file_name|>item_update.py<|end_file_name|><|fim▁begin|>"""Contains tests for oweb.views.updates.item_update"""
# Python imports
from unittest import skip
# Django imports
from django.core.urlresolvers import reverse
from django.test.utils import override_settings
from django.contrib.auth.models import User
# app impo... | self.assertRedirects(r,
reverse('oweb:moon_buildings', args=[m.id]),
status_code=302, |
<|file_name|>exception.py<|end_file_name|><|fim▁begin|># Copyright 2013 - Red Hat, 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
#
# ... | def wrapped(*args, **kw): |
<|file_name|>example_config.py<|end_file_name|><|fim▁begin|>import os
BASEDIR = os.path.abspath(os.path.dirname(__file__))
DEBUG = False
##
# Database settings
##
DB_HOST = 'localhost'
DB_NAME = 'scoremodel'
DB_USER = 'scoremodel'
DB_PASS = 'scoremodel'
##
# MySQL SSL connections
##
use_ssl = False
SSL_CA = '/etc/my... | REMEMBER_COOKIE_SECURE = True
REMEMBER_COOKIE_HTTPONLY = True
SESSION_PROTECTION = "strong"
|
<|file_name|>test_core.py<|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 Apa... | with self.assertWarns(PendingDeprecationWarning) as warning: |
<|file_name|>resolveContext.d.ts<|end_file_name|><|fim▁begin|>import { PolicyWhen } from "./interface";
import { PathNode } from "../path/node";
import { Resolvable } from "./resolvable";
import { State } from "../state/stateObject";
import { Transition } from "../transition/transition";
import { UIInjector } from "../... | *
* When a transition is created, the nodes in the "To Path" are injected from a ResolveContext.
* A ResolveContext closes over a path of [[PathNode]]s and processes the resolvables.
* The "To State" can inject values from its own resolvables, as well as those from all its ancestor state's (node's). |
<|file_name|>submit.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python2
"""
submit.py
~~~~~~~~~
submit code to poj
usage:
./submit.py file_name
file_name format: probmenId_xxx.c/cpp
"""
import requests
import sys
import os
import time
from bs4 import BeautifulSoup
s = requests.Session()... | try:
with open('./user') as fi:
user = fi.readline().strip()
password= fi.readline().strip() |
<|file_name|>ACLRoles.js<|end_file_name|><|fim▁begin|>/**
*
* SugarCRM Community Edition is a customer relationship management program developed by
* SugarCRM, Inc. Copyright (C) 2004-2013 SugarCRM Inc.
*
* SuiteCRM is an extension to SugarCRM Community Edition developed by SalesAgility Ltd.
* Copyright (C) 2011 ... | * You can contact SugarCRM, Inc. headquarters at 10050 North Wolfe Road,
* SW2-130, Cupertino, CA 95014, USA. or at email address contact@sugarcrm.com.
*
* The interactive user interfaces in modified source and object code versions |
<|file_name|>web.py<|end_file_name|><|fim▁begin|>"""ShipToasting web handlers."""
import os
import sys
import atexit
import random
import traceback
import gevent
from flask import Response
from flask import redirect
from flask import render_template
from flask import request
from flask import session
from apschedule... | session["character"]["CharacterID"],
)
|
<|file_name|>Datatypes.py<|end_file_name|><|fim▁begin|># Copyright (c) 2016 Iotic Labs 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
#
# https://github.com/Iot... | |
<|file_name|>Popover.js<|end_file_name|><|fim▁begin|>"use strict";
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
<|fim▁hole|> enumerable: true,
get: function get() {
return _uxcorePopover.default;
}
});
var _uxcorePopover = _interopRequireDefault(require("uxcore-popove... | Object.defineProperty(exports, "__esModule", {
value: true
});
Object.defineProperty(exports, "default", { |
<|file_name|>PropertyFilter.java<|end_file_name|><|fim▁begin|>/**
* Copyright (c) 2005-20010 springside.org.cn
*
* Licensed under the Apache License, Version 2.0 (the "License");
*
* $Id: PropertyFilter.java 1205 2010-09-09 15:12:17Z calvinxiu $
*/
package com.snakerflow.framework.orm;
import java.util.ArrayLis... | public class PropertyFilter {
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.