prompt
large_stringlengths
70
991k
completion
large_stringlengths
0
1.02k
<|file_name|>version_info_updater.cc<|end_file_name|><|fim▁begin|>// Copyright (c) 2012 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 "chrome/browser/chromeos/login/version_info_updater.h" #include <vector> ...
#include "chrome/common/chrome_version_info.h"
<|file_name|>impostazioni.ts<|end_file_name|><|fim▁begin|>import { Component } from '@angular/core'; import { NavController, NavParams } from 'ionic-angular'; import { TavoliPage } from '../tavoli/tavoli'; import { PiattiPage } from '../piatti/piatti'; import { MenuPage } from '../menu/menu'; @Component({ selecto...
}
<|file_name|>calculateTransform.js<|end_file_name|><|fim▁begin|>import { Transform } from './transform.js'; /** * Calculate the transform for a Cornerstone enabled element * * @param {EnabledElement} enabledElement The Cornerstone Enabled Element<|fim▁hole|> const transform = new Transform(); transform.transla...
* @param {Number} [scale] The viewport scale * @return {Transform} The current transform */ export default function (enabledElement, scale) {
<|file_name|>utils.py<|end_file_name|><|fim▁begin|># Copyright 2010 United States Government as represented by the # Administrator of the National Aeronautics and Space Administration. # Copyright 2011 Justin Santa Barbara # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you...
<|file_name|>MS_ValidationError.java<|end_file_name|><|fim▁begin|>package lv.emes.libraries.utilities.validation; /** * Actions for error that occur in validation process. * * @author eMeS * @version 1.2. */ public interface MS_ValidationError<T> {<|fim▁hole|> /** * Returns message of validation error us...
MS_ValidationError withErrorMessageFormingAction(IFuncFormValidationErrorMessage action);
<|file_name|>regions-outlives-nominal-type-struct-type.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 o...
// compile-pass #![feature(rustc_attrs)] #![allow(dead_code)]
<|file_name|>0002_auto__add_field_app_created_at.py<|end_file_name|><|fim▁begin|># encoding: utf-8 import datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm):<|fim▁hole|> def backwards(self, orm): ...
# Adding field 'App.created_at' db.add_column('mobile_apps_app', 'created_at', self.gf('django.db.models.fields.DateTimeField')(null=True, blank=True), keep_default=False)
<|file_name|>Dbase31TableFixture.cpp<|end_file_name|><|fim▁begin|>// // Created by Chris Richards on 28/04/2016. //<|fim▁hole|>class Dbase31TableFixture : public ::testing::Test { protected: virtual void SetUp() { dbf_table_ = DbfTablePtr(new DbfTable("/Users/chrisr/Development/ClionProjects/dbf2csv/dbf_tes...
#include <gtest/gtest.h> #include <DbfTable.h>
<|file_name|>profile_repository.js<|end_file_name|><|fim▁begin|>import AbstractRepository from "./abstract_repository" export default class ProfileRepository extends AbstractRepository { constructor(db) { super(db); }<|fim▁hole|> tableName() { return "profiles"; } initialColumns() { return [ ...
<|file_name|>16.d.ts<|end_file_name|><|fim▁begin|><|fim▁hole|><|fim▁end|>
export { Notebook16 as default } from "../../";
<|file_name|>optimizable_comprehension.py<|end_file_name|><|fim▁begin|>""" OptimizableComp finds whether a comprehension can be optimized. """ from pythran.analyses.identifiers import Identifiers from pythran.passmanager import NodeAnalysis class OptimizableComprehension(NodeAnalysis):<|fim▁hole|> self.result...
"""Find whether a comprehension can be optimized.""" def __init__(self):
<|file_name|>train_multi.py<|end_file_name|><|fim▁begin|>from __future__ import division import argparse import multiprocessing import numpy as np import PIL import chainer import chainer.functions as F import chainer.links as L from chainer.optimizer_hooks import WeightDecay from chainer import serializers from chai...
serializers.load_npz(args.resume, trainer, strict=False) trainer.run()
<|file_name|>markov.py<|end_file_name|><|fim▁begin|>import wordtools import random from forms.form import Form class MarkovForm(Form): <|fim▁hole|> self.limiter=0 def validate(self,tweet): cleaned = wordtools.clean(tweet) if wordtools.validate(cleaned) and len(cleaned)>=2: return cleaned else: return No...
def __init__(self): self.data={} self.data[""]={}
<|file_name|>mean.js<|end_file_name|><|fim▁begin|>export var meanDocs = { name: 'mean',<|fim▁hole|> seealso: ['max', 'median', 'min', 'prod', 'std', 'sum', 'variance'] };<|fim▁end|>
category: 'Statistics', syntax: ['mean(a, b, c, ...)', 'mean(A)', 'mean(A, dim)'], description: 'Compute the arithmetic mean of a list of values.', examples: ['mean(2, 3, 4, 1)', 'mean([2, 3, 4, 1])', 'mean([2, 5; 4, 3])', 'mean([2, 5; 4, 3], 1)', 'mean([2, 5; 4, 3], 2)', 'mean([1.0, 2.7, 3.2, 4.0])'],
<|file_name|>de-BE.js<|end_file_name|><|fim▁begin|>/** * @license * Copyright Google Inc. All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license */ // THIS CODE IS GENERATED - DO NOT MODIFY // See angular/tools/gu...
['Mitternacht', 'Morgen', 'Vorm.', 'Mittag', 'Nachm.', 'Abend', 'Nacht'], u, ['Mitternacht', 'Morgen', 'Vormittag', 'Mittag', 'Nachmittag', 'Abend', 'Nacht']
<|file_name|>client.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- """ Internet Relay Chat (IRC) protocol client library. This library is intended to encapsulate the IRC protocol in Python. It provides an event-driven IRC client framework. It has a fairly thorough support for the basic IRC protocol, CTCP, a...
if self.connected:
<|file_name|>RegexToNFA.java<|end_file_name|><|fim▁begin|>package ch.unibe.scg.regex; import static java.util.Collections.singleton; import java.util.ArrayList; import java.util.Collection; import java.util.List; import java.util.SortedSet; import java.util.TreeSet; import ch.unibe.scg.regex.ParserProvider.Node; imp...
for (Node c : n.getChildren()) { findRanges(c, out); }
<|file_name|>providers_feature.ts<|end_file_name|><|fim▁begin|>/** * @license<|fim▁hole|> * found in the LICENSE file at https://angular.io/license */ import {Provider} from '../../di/provider'; import {providersResolver} from '../di_setup'; import {DirectiveDef} from '../interfaces/definition'; /** * This feature ...
* Copyright Google Inc. All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be
<|file_name|>box.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" /> <% fro...
${helpers.predefined_type(
<|file_name|>mdquery.py<|end_file_name|><|fim▁begin|>""" pybufrkit.mdquery ~~~~~~~~~~~~~~~~~ """ from __future__ import absolute_import from __future__ import print_function import logging from pybufrkit.errors import MetadataExprParsingError __all__ = ['MetadataExprParser', 'MetadataQuerent', 'METADATA_QUERY_INDICA...
section_index = int(section_index) except ValueError: raise MetadataExprParsingError('Invalid section index: {}'.format(section_index))
<|file_name|>source_util.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.apache.or...
/* column!(): expands to the current column number */ pub fn expand_column(cx: &mut ExtCtxt, sp: Span, tts: &[ast::TokenTree]) -> Box<base::MacResult+'static> { base::check_zero_tts(cx, sp, tts, "column!");
<|file_name|>create-test-list.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python """ Rules for *.py files * if the changed file is __init__.py, and there is a side-band test/ dir, then test the entire test/functional directory the reason for this is that the init files are usually organizing collections ...
print(" * {0} does not have a side-band test directory!".format(line)) else:
<|file_name|>reducer.ts<|end_file_name|><|fim▁begin|><|fim▁hole|> SWITCH, } from "./actions"; import { IContainerModule } from "../types"; import { ITabState } from "./"; const initialState = {}; export default createReducer(initialState, { [INITIALIZE](state: IContainerModule<ITabState>, action) { con...
import { createReducer } from "redux-create-reducer"; import * as clone from "lodash/cloneDeep"; import { INITIALIZE,
<|file_name|>trace.rs<|end_file_name|><|fim▁begin|>// Copyright 2015-2017 Parity Technologies (UK) Ltd. // This file is part of Parity. // Parity 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 versi...
#[serde(rename="call")] Call, /// Call code
<|file_name|>estimator.py<|end_file_name|><|fim▁begin|>import numpy as np import regreg.api as rr from selection.randomized.glm import pairs_bootstrap_glm, bootstrap_cov from selection.randomized.query import query from selection.randomized.randomization import split import functools def pairs_bootstrap_glm(glm_loss, ...
<|file_name|>communication_config.py<|end_file_name|><|fim▁begin|># -*- encoding: utf-8 -*- ############################################################################## # # Copyright (C) 2016 Compassion CH (http://www.compassion.ch) # Releasing children from poverty in Jesus' name # @author: Emanuel Cino <ec...
""" Returns how the partner should be informed for the given
<|file_name|>header.py<|end_file_name|><|fim▁begin|>import bpy # ----------------------------------------------------------------------------- # Draw UI, use an function to be append into 3D View Header # ----------------------------------------------------------------------------- def ui_3D(self, context): layout...
row = layout.row(align=True) icon = 'CURSOR'
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|># Copyright 2008-2015 Nokia Solutions and Networks # # 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...
from robot.utils import Matcher
<|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) import os from spack import * class Casacore(CMakePackage): ""...
<|file_name|>views.py<|end_file_name|><|fim▁begin|>import requests from django.conf import settings from django.http import HttpResponse, HttpResponseBadRequest from django.views.decorators.csrf import csrf_exempt from django.views.decorators.http import require_http_methods @csrf_exempt @require_http_methods(["POST"...
r = session.post(url, data=outgoing) if r.status_code != 200:
<|file_name|>zip_longest.rs<|end_file_name|><|fim▁begin|>use std::cmp::Ordering::{Equal, Greater, Less}; use super::size_hint; use std::iter::Fuse; use crate::either_or_both::EitherOrBoth; // ZipLongest originally written by SimonSapin, // and dedicated to itertools https://github.com/rust-lang/rust/pull/19283 /// A...
{ type Item = EitherOrBoth<T::Item, U::Item>;
<|file_name|>declaration.js<|end_file_name|><|fim▁begin|>'use strict'; exports.__esModule = true; var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configura...
<|file_name|>RevealingModuleVariant.js<|end_file_name|><|fim▁begin|>var AppGlobal = { exposePrivateVariablesForTesting: true }; var testableObject = function (exposePrivateVariablesForTesting) { var _privateVar = "can't see this";<|fim▁hole|> function _privateFunction() { console.log("Executed Pri...
var _publicVar = "we see this fine";
<|file_name|>jpeg.py<|end_file_name|><|fim▁begin|># This is a generated file! Please edit source .ksy file and use kaitai-struct-compiler to rebuild # The source was jpeg.ksy from here - https://github.com/kaitai-io/kaitai_struct_formats/blob/24e2d00048b8084ceec30a187a79cb87a79a48ba/image/jpeg.ksy import array import ...
self._parent = _parent self._root = _root if _root else self self.magic = self._io.ensure_fixed_contents(struct.pack('1b', -1)) self.marker = self._root.Segment.MarkerEnum(self._io.read_u1())
<|file_name|>VideoWizard.py<|end_file_name|><|fim▁begin|>from boxbranding import getBoxType, getMachineName, getMachineBuild, getBrandOEM, getMachineBrand from Screens.Wizard import WizardSummary from Screens.WizardLanguage import WizardLanguage from Screens.Rc import Rc from Components.AVSwitch import iAVSwitch from S...
<|file_name|>settings.py<|end_file_name|><|fim▁begin|># Django settings for test_project project. DEBUG = True TEMPLATE_DEBUG = DEBUG ADMINS = ( # ('Your Name', 'your_email@example.com'), ) MANAGERS = ADMINS DATABASES = { 'default': { 'ENGINE': 'django.db.backends.sqlite3', 'NAME': 'test.db'...
<|file_name|>add_delivery.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python __author__ = 'Rolf Jagerman' from PySide import QtGui import os from authentication import AuthenticationListener, AuthenticationClient from loadui import loadUi from config import UI_DIRECTORY from drawers import Drawers from users import...
<|file_name|>codeforces-options.js<|end_file_name|><|fim▁begin|><|fim▁hole|><|fim▁end|>
window.codeforcesOptions = []; window.codeforcesOptions.subscribeServerUrl = "http://pubsub.codeforces.com:85/sub";
<|file_name|>check.py<|end_file_name|><|fim▁begin|>''' YARN Cluster Metrics -------------------- yarn.metrics.appsSubmitted The number of submitted apps yarn.metrics.appsCompleted The number of completed apps yarn.metrics.appsPending The number of pending apps yarn.metrics.appsRunning ...
'reservedMB': ('yarn.metrics.reserved_mb', GAUGE),
<|file_name|>GeneralProcessorComplexArithmetic.cpp<|end_file_name|><|fim▁begin|>#include "GeneralProcessor.h" namespace engine { ////==--------------------------------------------------------------------====// // ECKERT PROCESSOR / ADD // [ description ] // ADD function for 2 complex numbers // (a + ib) + (c + id) = ...
<|file_name|>models.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python # encoding: utf-8 """ models.py Created by Darcy Liu on 2012-03-03. Copyright (c) 2012 Close To U. All rights reserved. """ from django.db import models from django.contrib.auth.models import User # class Setting(models.Model): # sid = mod...
author = models.ForeignKey(User,verbose_name='author') created = models.DateTimeField(auto_now_add=True,verbose_name='created') updated = models.DateTimeField(auto_now=True,verbose_name='updated') def __unicode__(self):
<|file_name|>OrStringFilterColumn.java<|end_file_name|><|fim▁begin|>package helpers.db.filter.column; import org.apache.commons.lang.StringUtils; import java.util.ArrayList; import java.util.List; /** * Filter on a disjunction of string matches. * Instead of filtering on "column ~= filter", filters on (columns[0] ...
@Override public String getParamName() { return "filtercolumn_" + OrStringFilterColumn.this.hashCode();
<|file_name|>native.js<|end_file_name|><|fim▁begin|>'use strict'; Object.defineProperty(exports, '__esModule', { value: true }); function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; } var React = require('react'); var React__default = _interopDefault(React)...
<|file_name|>election.go<|end_file_name|><|fim▁begin|>/* Copyright 2017 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 Unless required b...
return lockCtx, nil
<|file_name|>push_doc.py<|end_file_name|><|fim▁begin|>''' ''' from __future__ import absolute_import, print_function from ...exceptions import ProtocolError from ..message import Message from . import register import logging log = logging.getLogger(__name__) @register class push_doc_1(Message): ''' ''' ...
@classmethod def create(cls, document, **metadata): '''
<|file_name|>header.rs<|end_file_name|><|fim▁begin|>use byteorder::{BigEndian, WriteBytesExt}; use errors::{be_u16, ParseError}; use nom::IResult; use std::convert::From; use std::io; use std::io::Write; /// Query operation type #[derive(Debug,Clone,Copy,PartialEq)] pub enum Opcode { /// Standard query Query, ...
/// Create a `Header` for a query
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|>from django.core.exceptions import ImproperlyConfigured from django import VERSION <|fim▁hole|> from .core import AppCache<|fim▁end|>
if VERSION[0]<1 and VERSION[1]<7: raise ImproperlyConfigured(""" The app_config required 1.7 or higher version of django. """)
<|file_name|>MasnaviDataProvider.java<|end_file_name|><|fim▁begin|>package com.nouribygi.masnavi.database; import android.app.SearchManager; import android.content.ContentProvider; import android.content.ContentResolver; import android.content.ContentValues;<|fim▁hole|> import com.nouribygi.masnavi.util.MasnaviSetting...
import android.content.UriMatcher; import android.database.Cursor; import android.net.Uri;
<|file_name|>hw3_2a.py<|end_file_name|><|fim▁begin|>import sympy x1, x2 = sympy.symbols('x1 x2') f = 100*(x2 - x1**2)**2 + (1-x1)**2 df_dx1 = sympy.diff(f,x1) df_dx2 = sympy.diff(f,x2) H = sympy.hessian(f, (x1, x2)) xs = sympy.solve([df_dx1, df_dx2], [x1, x2]) H_xs = H.subs([(x1,xs[0][0]), (x2,xs[0][1])])<|fim▁hole...
lambda_xs = H_xs.eigenvals() count = 0 for i in lambda_xs.keys():
<|file_name|>7503.js<|end_file_name|><|fim▁begin|>{ it("returns a key", () => { var nativeEvent = new KeyboardEvent("keypress", { key: "f" }); expect(getEventKey(nativeEvent)).toBe("f");<|fim▁hole|>}<|fim▁end|>
});
<|file_name|>ThemeManagers.py<|end_file_name|><|fim▁begin|># encoding: utf-8 """ IMPORTANT - COLOUR SUPPORT IS CURRENTLY EXTREMELY EXPERIMENTAL. THE API MAY CHANGE, AND NO DEFAULT WIDGETS CURRENTLY TAKE ADVANTAGE OF THEME SUPPORT AT ALL. """ import curses from . import global_options def disable_color(): global...
def find_pair(self, caller, request='DEFAULT'):
<|file_name|>server.py<|end_file_name|><|fim▁begin|><|fim▁hole|>import falcon import json class QuoteResource: def on_get(self, req, resp): """Handles GET requests""" quote = { 'quote': 'I\'ve always been more interested in the future than in the past.', 'author': 'Grace Hop...
<|file_name|>motion.rs<|end_file_name|><|fim▁begin|>use super::*; impl Editor { /// Convert an instruction to a motion (new coordinate). Returns None if the instructions given /// either is invalid or has no movement. /// /// A motion is a namespace (i.e. non mode-specific set of commands), which repre...
pub fn to_motion(&mut self, Inst(n, cmd): Inst) -> Option<(usize, usize)> { use super::Key::*;
<|file_name|>test-user-agent.js<|end_file_name|><|fim▁begin|>var test = require('tape'); var url = require('url'); var curli = require('../'); var testServer = require('./server.js'); var buildUAString = require('../lib/util').buildUAString; test('Default user agent being set', function(t) { var server = testServer....
t.equal(req.headers['user-agent'], ua, 'Default user agent set to "' + ua + '"'); res.writeHead(200);
<|file_name|>ui.py<|end_file_name|><|fim▁begin|># coding: utf-8 import http.server import socketserver<|fim▁hole|> httpd = socketserver.TCPServer(("0.0.0.0", PORT), Handler) print("serving at port", PORT) httpd.serve_forever()<|fim▁end|>
PORT = 8000 Handler = http.server.SimpleHTTPRequestHandler
<|file_name|>schema.js<|end_file_name|><|fim▁begin|>export class Schema { constructor(){ } <|fim▁hole|> let errorList = errors.reduce((errorListTemp, error, index)=>{ return `${errorListTemp} ${index+1}. ${error}` }, '') let errorMessage ...
createErrorMessage(schemaErrorObj, root){ let {errors, path} = schemaErrorObj; let pathName = path.replace('$root', root);
<|file_name|>bluebrain_data_io.py<|end_file_name|><|fim▁begin|># coding: utf-8 import os import urllib import numpy as np import pickle from Experiment import Experiment ROOT_PATH = './full_dataset/article_4_data/grouped_ephys' ZIPFILE_PATH = './full_dataset/article_4_data' EXPM_PATH = './results/experiments/' URL =...
# if name.rfind('ET') == -1: cell_names.append(name) infos = {}
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|>"""CactusBot.""" <|fim▁hole|>__all__ = ["__version__", "run"]<|fim▁end|>
from .cactus import run, __version__
<|file_name|>AKPeakingParametricEqualizerFilterDSPKernel.hpp<|end_file_name|><|fim▁begin|>// // AKPeakingParametricEqualizerFilterDSPKernel.hpp // AudioKit // // Created by Aurelius Prochazka, revision history on Github. // Copyright (c) 2016 Aurelius Prochazka. All rights reserved. // #ifndef AKPeakingParametricE...
sp_destroy(&sp); }
<|file_name|>lib.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.apache.org/licens...
/// Returns the specified time in UTC pub fn at_utc(clock: Timespec) -> Tm { let Timespec { sec, nsec } = clock;
<|file_name|>agent.py<|end_file_name|><|fim▁begin|>#-*- coding: utf-8 -*- ''' Created on 24 дек. 20%0 @author: ivan ''' import random<|fim▁hole|>all_agents = """ Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.3) Gecko/20090913 Firefox/3.5.3 Mozilla/5.0 (Windows; U; Windows NT 6.1; en; rv:1.9.1.3) Gecko/20090824 Fi...
<|file_name|>OpenSurfaceTypeListener.rs<|end_file_name|><|fim▁begin|><|fim▁hole|><|fim▁end|>
energymodels.OpenSurfaceTypeListener
<|file_name|>AnnotationParamResourceMetaFactoryImpl.java<|end_file_name|><|fim▁begin|>package io.github.varvelworld.var.ioc.core.annotation.meta.factory; import io.github.varvelworld.var.ioc.core.annotation.Resource; import io.github.varvelworld.var.ioc.core.meta.ParamResourceMeta; import io.github.varvelworld.var.ioc...
}
<|file_name|>fabric.fontweight.enum.ts<|end_file_name|><|fim▁begin|>import { Enum } from '../utility/enum' Enum.register(FontWeight, "FontWeight", { jsStringPrefix: 'ms-fontWeight-' }); export enum FontWeight { unspecified, light, semilight, regular,<|fim▁hole|><|fim▁end|>
semiBold }
<|file_name|>testyacc.py<|end_file_name|><|fim▁begin|># testyacc.py import unittest try: import StringIO except ImportError: import io as StringIO import sys import os sys.path.insert(0,"..") sys.tracebacklimit = 0 import ply.yacc def check_expected(result,expected): resultlines = [] for line in re...
def test_yacc_badrule(self):
<|file_name|>test_loading.py<|end_file_name|><|fim▁begin|>from os.path import dirname import sys from django.test import TestCase from django.conf import settings from django.test.utils import override_settings import oscar from oscar.core.loading import ( get_model, AppNotFoundError, get_classes, get_class, Clas...
user = UserFactory() product = create_product() self.wishlist = WishListFactory(owner=user) self.wishlist.add(product)
<|file_name|>unboxed-closures-extern-fn.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...
<|file_name|>setup.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python # This file is part of Py6S. # # Copyright 2012 Robin Wilson and contributors listed in the CONTRIBUTORS file. # # Py6S is free software: you can redistribute it and/or modify # it under the terms of the GNU Lesser General Public License as publis...
license = "GPL", test_suite = 'nose.collector', url = "http://py6s.rtwilson.com/", long_description = LONG_DESCRIPTION,
<|file_name|>manage.py<|end_file_name|><|fim▁begin|><|fim▁hole|> if __name__ == "__main__": app_init() MANAGER.run()<|fim▁end|>
#!/usr/bin/env python import dockci.commands from dockci.server import APP, app_init, MANAGER
<|file_name|>QBoxSetSlots.cpp<|end_file_name|><|fim▁begin|>/* Qt5xHb - Bindings libraries for Harbour/xHarbour and Qt Framework 5 Copyright (C) 2020 Marcos Antonio Gambeta <marcosgambeta AT outlook DOT com> */ /* DO NOT EDIT THIS FILE - the content was created using a source code generator */ #in...
{ PHB_ITEM psender = Qt5xHb::Signals_return_qobject( (QObject *) object, "QBOXSET" ); hb_vmEvalBlockV( cb, 1, psender );
<|file_name|>group_by.rs<|end_file_name|><|fim▁begin|>/* Copyright ⓒ 2015 grabbag contributors. Licensed under the MIT license (see LICENSE or <http://opensource.org /licenses/MIT>) or the Apache License, Version 2.0 (see LICENSE of <http://www.apache.org/licenses/LICENSE-2.0>), at your option. All files in the projec...
use std::mem::replace; use std::rc::Rc; /**
<|file_name|>bin2015.rs<|end_file_name|><|fim▁begin|><|fim▁hole|>extern crate rust2018; use rust2018::do_thing; fn main() { do_thing(); }<|fim▁end|>
<|file_name|>rico_change.js<|end_file_name|><|fim▁begin|>/** * * Copyright 2005 Sabre Airline Solutions * * 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:...
return false; for( var i=0,n=0; i<this.length; i++ ) if( i != dx ) this[n++]=this[i];
<|file_name|>atomic_state_client.ts<|end_file_name|><|fim▁begin|>/** * @license * Copyright 2017 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.or...
import {getCachedJson, Trackable} from 'neuroglancer/util/trackable'; export class AtomicStateClient extends RefCounted { serverGeneration = '';
<|file_name|>imagenet_test.py<|end_file_name|><|fim▁begin|># coding=utf-8 # Copyright 2022 The Uncertainty Baselines 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://ww...
tf.test.main()
<|file_name|>PhoneRegionCode504Constants.java<|end_file_name|><|fim▁begin|><|fim▁hole|>/* * 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 ...
<|file_name|>setup.py<|end_file_name|><|fim▁begin|>""" Setup file. """ import os from setuptools import setup, find_packages here = os.path.abspath(os.path.dirname(__file__)) with open(os.path.join(here, 'README.rst')) as f: README = f.read() requires = ['cornice', 'metlog-py', 'mozsvc', 'PasteScript', 'waitress...
entry_points = """\
<|file_name|>upperair_soundings.py<|end_file_name|><|fim▁begin|># Copyright (c) 2016,2017 MetPy Developers. # Distributed under the terms of the BSD 3-Clause License. # SPDX-License-Identifier: BSD-3-Clause """ =========================== Upper Air Sounding Tutorial =========================== Upper air analysis is a ...
# which are not drawn.
<|file_name|>plot.py<|end_file_name|><|fim▁begin|># Copyright (c) 2014 Alcatel-Lucent Enterprise # 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 # # ht...
<|file_name|>gulpfile.js<|end_file_name|><|fim▁begin|>var gulp = require('gulp'); var karma = require('karma').server; var concat = require('gulp-concat'); var uglify = require('gulp-uglify'); var rename = require('gulp-rename'); var path = require('path'); var plumber = require('gulp-plumber'); var runSequence = requi...
/**
<|file_name|>error.js<|end_file_name|><|fim▁begin|>'use strict'; const buildType = process.config.target_defaults.default_configuration; const assert = require('assert'); if (process.argv[2] === 'fatal') { const binding = require(process.argv[3]); binding.error.throwFatalError(); return; } test(`./build/${build...
() => { throw new TypeError('test'); }),
<|file_name|>models.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- """ Models for Student Identity Verification This is where we put any models relating to establishing the real-life identity of a student over a period of time. Right now, the only models are the abstract `PhotoVerification`, and its one concr...
from .utils import earliest_allowed_verification_date
<|file_name|>get_aggregates.rs<|end_file_name|><|fim▁begin|>use cli::arg_types::Interval; use std::str::FromStr; // Use of #from_str. use itertools::Itertools; use api::client::{TellerClient, ApiServiceResult, Transaction}; use api::client::parse_utc_date_from_transaction; use chrono::{Date, Datelike, UTC}; pub typ...
fn get_outgoings(&self, account_id: &str, interval: &Interval, from: &Date<UTC>,
<|file_name|>image_utils.py<|end_file_name|><|fim▁begin|># coding=utf-8 # Copyright 2018 The Tensor2Tensor 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.apache.o...
<|file_name|>forms.py<|end_file_name|><|fim▁begin|>from communities.models import Community, SendToOption from datetime import datetime, date, time from django.utils import timezone from django.utils.translation import ugettext_lazy as _ from ocd.formfields import HTMLArea, OCSplitDateTime, OCCheckboxSelectMultiple fro...
widgets = {
<|file_name|>0035_siteconfiguration_base_cookie_domain.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-<|fim▁hole|> from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('core', '0034_auto_20170613_2039'), ] operations = [ migrations.Ad...
# Generated by Django 1.10.7 on 2017-06-15 06:37
<|file_name|>mod.rs<|end_file_name|><|fim▁begin|>use num::{ToPrimitive, FromPrimitive}; use std::ptr; use EventPump; use rect::Rect; use video::Window; use sys::keyboard as ll; mod keycode; mod scancode; pub use self::keycode::Keycode; pub use self::scancode::Scancode; bitflags! { flags Mod: u32 { const...
const LGUIMOD = 0x0400,
<|file_name|>main.go<|end_file_name|><|fim▁begin|>package main import ( "net/http" "github.com/golang/example/stringutil" )<|fim▁hole|> // Handler is the entry point for this fission function func Handler(w http.ResponseWriter, r *http.Request) { msg := stringutil.Reverse(stringutil.Reverse("Vendor Example Test"))...
<|file_name|>associated-types-duplicate-binding-in-env.rs<|end_file_name|><|fim▁begin|>// run-pass #![allow(dead_code)] // Check that we do not report ambiguities when the same predicate // appears in the environment twice. Issue #21965. // pretty-expanded FIXME #23616 trait Foo { type B; fn get() -> Self::B...
fn foo<T>() -> () where T : Foo<B=()>, T : Foo<B=()> {
<|file_name|> AudioPreferencesPanel.java<|end_file_name|><|fim▁begin|>/* * In the name of Allah * This file is part of The "Quran Teacher or Learn Arabic" Project. Use is subject to * license terms. * * @author: Fazle Rabbi Rahat * */ package QuranTeacher; import javax.swing.ButtonGroup; ...
/** * Preferences panel to handle audio preferences. It doesn't extends * the PreferencesPanel class
<|file_name|>Cluster.java<|end_file_name|><|fim▁begin|>package com.cluit.util.dataTypes; import java.util.ArrayList; import java.util.HashSet; import java.util.Set; import com.cluit.util.Const; import com.cluit.util.AoP.MethodMapper; import com.cluit.util.methods.ClusteringUtils; import com.cluit.util.structures.KeyP...
//Divide each position by the number of entries (to get the mean of each dimension's position for( int i = 0; i < centoidCoordinates.length; i++)
<|file_name|>queue.js<|end_file_name|><|fim▁begin|>class Queue { constructor() { this.items = []; } add(item) { this.items.push(item); } remove() {<|fim▁hole|> return this.items.shift(); } peek() { return this.items[this.items.length - 1]; } isE...
<|file_name|>config.js<|end_file_name|><|fim▁begin|>module.exports = { testClient: 'http://localhost:8089/dist/', mochaTimeout: 10000, testLayerIds: [0], seleniumTimeouts: {<|fim▁hole|> script: 5000, implicit: 1000, pageLoad: 5000 } }<|fim▁end|>
<|file_name|>ReduceConllResponse.java<|end_file_name|><|fim▁begin|>package eu.newsreader.conversion; import eu.newsreader.util.Util; import java.io.File; import java.io.FileOutputStream; import java.io.OutputStream; import java.util.ArrayList; /** * Created by piek on 12/15/14. */ public class ReduceConllResponse ...
String arg = args[i]; if (arg.equalsIgnoreCase("--key") && args.length>(i+1)) { pathToKeyFolder = args[i+1];
<|file_name|>interface.go<|end_file_name|><|fim▁begin|>// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. // Package codegururevieweriface provides an interface to enable mocking the Amazon CodeGuru Reviewer service client // for testing your code. // // It is important to note that this interface wi...
// In your _test.go file:
<|file_name|>client_utils.py<|end_file_name|><|fim▁begin|>"""Client Utilities Factor out code shared by both the resync and resync-explorer clients. Copyright 2012,2013 Simeon Warner Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License....
Input string of the form: cap_name=uri,cap_name=uri """ capabilities={}
<|file_name|>prefetch.rs<|end_file_name|><|fim▁begin|>/* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at https://mozilla.org/MPL/2.0/. */ use crate::dom::bindings::reflector::DomObject; use crate::...
TokenSinkResult::Continue }, (TagKind::StartTag, local_name!("link")) if self.prefetching => { if let Some(rel) = self.get_attr(tag, local_name!("rel")) {
<|file_name|>views.py<|end_file_name|><|fim▁begin|>from django.shortcuts import render from django.views.generic.base import TemplateView from django.views.generic.list import ListView from django.views.generic.detail import DetailView from django.contrib.syndication.views import Feed from django.utils.feedgenerator im...
return Post.objects.filter(is_published=True).order_by('-pub_date')
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|># Copyright 2015-2017 Cisco Systems, 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:/...
from .prefix.prefix_igp_attr import PrefixIGPAttr # noqa from .prefix.src_router_id import SrcRouterID # noqa from .prefix.igpflags import IGPFlags # noqa
<|file_name|>IUnaryOperator.java<|end_file_name|><|fim▁begin|>// Catalano Fuzzy Library // The Catalano Framework // // Copyright © Diego Catalano, 2013 // diego.catalano at live.com // // Copyright © Andrew Kirillov, 2007-2008 // andrew.kirillov at gmail.com // // This library is free software; you can redistribute...