prompt
large_stringlengths
70
991k
completion
large_stringlengths
0
1.02k
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|><|fim▁hole|># # This file is part of weboob. # # weboob is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at yo...
# -*- coding: utf-8 -*- # Copyright(C) 2014 Romain Bignon
<|file_name|>test_0120_simple_repository_dependency_multiple_owners.py<|end_file_name|><|fim▁begin|>from tool_shed.base.twilltestcase import ShedTwillTestCase, common, os datatypes_repository_name = 'blast_datatypes_0120' datatypes_repository_description = 'Galaxy applicable datatypes for BLAST' datatypes_repository_lo...
"""
<|file_name|>test_affinity_filters.py<|end_file_name|><|fim▁begin|># Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless ...
'scheduler_hints': { 'same_host': 'same'}} self.assertTrue(self.filt_cls.host_passes(host, filter_properties))
<|file_name|>index.js<|end_file_name|><|fim▁begin|>var compare = require('typewiselite') var search = require('binary-search') function compareKeys (a, b) { return compare(a.key, b.key) } module.exports = function (_compare) { var ary = [], kv _compare = _compare || compare function cmp (a, b) { return ...
//overwrite a key, or insert a key if(i < 0) ary.splice(~i, 0, o) else ary[i] = o
<|file_name|>skills-list.js<|end_file_name|><|fim▁begin|>import {<|fim▁hole|> export default { scope: '.user__skills-list', emptyState: { scope: '[data-test-user-skills-list-empty-state]' }, skills: collection('[data-test-user-skills-list-item]') };<|fim▁end|>
collection } from 'ember-cli-page-object';
<|file_name|>akaze_features.cpp<|end_file_name|><|fim▁begin|>//============================================================================= // // akaze_features.cpp // Authors: Pablo F. Alcantarilla (1), Jesus Nuevo (2) // Institutions: Georgia Institute of Technology (1) // TrueVision Solutions (2) // D...
//============================================================================= /** * @file akaze_features.cpp
<|file_name|>transform.rs<|end_file_name|><|fim▁begin|>use na::{RealField, Rotation2, Rotation3, Unit}; use crate::aliases::{TMat3, TMat4, TVec2, TVec3}; use crate::traits::Number; /// A rotation 4 * 4 matrix created from an axis of 3 scalars and an angle expressed in radians. /// /// # See also: /// /// * [`scaling`...
/// * [`rotation`](fn.rotation.html)
<|file_name|>ex2a_telnet.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python import telnetlib import time import socket import sys import getpass TELNET_PORT = 23 TELNET_TIMEOUT = 6 def send_command(remote_conn, cmd): ''' Initiate the Telnet Session ''' cmd = cmd.rstrip() remote_conn.write(cmd ...
output += remote_conn.read_until("ssword:", TELNET_TIMEOUT)
<|file_name|>TestApp.cpp<|end_file_name|><|fim▁begin|>// TestApp.cpp : Defines the entry point for the console application. // #include "stdafx.h" #include <stdio.h> #include <iostream> #include <algorithm> #include "sqlite3.h" #include <time.h> #include <sstream> using namespace std; int _tmain(int argc, _TCHAR* ...
while ((val = sqlite3_step(command)) != SQLITE_DONE) {
<|file_name|>hierarchy.js<|end_file_name|><|fim▁begin|>import "../arrays/merge"; import "../core/rebind"; import "layout"; d3.layout.hierarchy = function() { var sort = d3_layout_hierarchySort, children = d3_layout_hierarchyChildren, value = d3_layout_hierarchyValue; // Recursively compute the node de...
function d3_layout_hierarchySort(a, b) {
<|file_name|>test_relator.py<|end_file_name|><|fim▁begin|>from flask_simple_alchemy import Relator from testers import db, app, FakeTable, OtherTable this_table = Relator(db) this_table.add('FakeTable') this_table.add('OtherTable', foreign_key='uuid') class ThirdTable(db.Model, this_table.HasOneToOneWith.FakeTable): ...
assert ThirdTable.faketable_id
<|file_name|>0003_enable_forums.py<|end_file_name|><|fim▁begin|>from django.db import migrations, models def add_default_enable(apps, schema_editor): ForumsConfig = apps.get_model("django_comment_common", "ForumsConfig") settings_count = ForumsConfig.objects.count() if settings_count == 0: # By de...
def reverse_noop(apps, schema_editor): return
<|file_name|>profitability_analysis.py<|end_file_name|><|fim▁begin|># Copyright (c) 2013, Frappe Technologies Pvt. Ltd. and contributors # For license information, please see license.txt from __future__ import unicode_literals import frappe from frappe import _ from frappe.utils import flt, getdate, formatdate, cstr f...
row["has_value"] = has_value
<|file_name|>table_test.go<|end_file_name|><|fim▁begin|>// Copyright (c) 2014, Suryandaru Triandana <syndtr@gmail.com> // All rights reserved. // // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. package table import ( "bytes" . "github.com/onsi/ginkgo" . "git...
db := Build(*kv)
<|file_name|>read.js<|end_file_name|><|fim▁begin|><|fim▁hole|> console.log(JSON.stringify(ENV, null, 4)); });<|fim▁end|>
require('..').config({namespace:'NVM'}) .read({}) .on('read', function(ENV){
<|file_name|>boxCap.py<|end_file_name|><|fim▁begin|>""" Capturing and analyzing the box information Author: Lyu Yaopengfei Date: 23-May-2016 """ import cv2 import threading import time from PIL import Image import Lego.dsOperation as dso import Lego.imgPreprocessing as imgprep from Lego.ocr import tesserO...
if ((cv2.waitKey(1) & 0xFF == 27) | (clickCnt>=6) ):
<|file_name|>Solid.py<|end_file_name|><|fim▁begin|>import Gears as gears from .. import * from .Base import * class Solid(Base) : def applyWithArgs( self, spass, functionName,<|fim▁hole|> *, color : 'Solid pattern color, or Interactive.*' ...
<|file_name|>demo.js<|end_file_name|><|fim▁begin|>var reportResource = "/public/Samples/Reports/States"; visualize({ auth: { name: "joeuser", password: "joeuser", organization: "organization_1" } }, function (v) { v("#main").report({ resource: reportResource, linkOpt...
},
<|file_name|>block-hanging-single.tsx<|end_file_name|><|fim▁begin|>/** @jsx jsx */ import { Transforms } from 'slate' import { jsx } from '../../..' export const run = editor => { Transforms.delete(editor) } export const input = ( <editor> <block> <anchor /> one </block> <block><|fim▁hole|>...
<focus />
<|file_name|>js_-uAWVNNLs-CDqxUul18yVdZpeIHUZse1JmT6XcSAYNU.js<|end_file_name|><|fim▁begin|>(function ($) { /** * Attaches double-click behavior to toggle full path of Krumo elements. */ Drupal.behaviors.devel = { attach: function (context, settings) { // Add hint to footnote $('.krumo-footnote ....
} }
<|file_name|>commentsPylintNoElseBoth.py<|end_file_name|><|fim▁begin|><|fim▁hole|>def func(): value = "not-none" # pylint: disable=unused-argument1 <caret>if value is None: print("None") # pylint: disable=unused-argument2 print(value)<|fim▁end|>
<|file_name|>test_multipart.py<|end_file_name|><|fim▁begin|>import asyncio import functools import io import unittest import zlib from unittest import mock import pytest import aiohttp.multipart from aiohttp import helpers, payload from aiohttp.hdrs import (CONTENT_DISPOSITION, CONTENT_ENCODING, ...
def test_second_next_releases_previous_object(self): reader = aiohttp.multipart.MultipartReader(
<|file_name|>test_version.py<|end_file_name|><|fim▁begin|>#----------------------------------------------------------------------------- # Copyright (c) 2012 - 2020, Anaconda, Inc., and Bokeh Contributors. # All rights reserved. # # The full license is in the file LICENSE.txt, distributed with this software. #---------...
class Test_is_full_release(object): def test_actual(self) -> None:
<|file_name|>ads1256_analog_ph_ec.py<|end_file_name|><|fim▁begin|># coding=utf-8 import traceback from flask_babel import lazy_gettext from mycodo.config import SQL_DATABASE_MYCODO from mycodo.databases.models import Conversion from mycodo.databases.models import DeviceMeasurements from mycodo.databases.utils import ...
self.logger.error("standard value does not represent a number: '{}', type: {}".format(
<|file_name|>main.rs<|end_file_name|><|fim▁begin|><|fim▁hole|> println!("{}", get_middle("A")); println!("{}", get_middle("of")); } fn get_middle(s:&str) -> &str { let s_len = s.len() + 1; let fmid = s_len as f32 / 2.0; let mid = s_len/2; if fmid == mid as f32 { &s[mid-1..mid] } el...
fn main() { println!("{}", get_middle("test")); println!("{}", get_middle("testing")); println!("{}", get_middle("middle"));
<|file_name|>chario.rs<|end_file_name|><|fim▁begin|>// Zinc, the bare metal stack for rust. // Copyright 2014 Vladimir "farcaller" Pouzanov <farcaller@gmail.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 ...
#[test]
<|file_name|>ChoiceContentImpl.cpp<|end_file_name|><|fim▁begin|>// -*- mode: c++; c-basic-style: "bsd"; c-basic-offset: 4; -*- /* * kdm/data/ChoiceContentImpl.cpp * Copyright (C) Cátedra SAES-UMU 2010 <andres.senac@um.es> * Copyright (C) INCHRON GmbH 2016 <soeren.henning@inchron.com> * * EMF4CPP is free software: ...
* along with this program. If not, see <http://www.gnu.org/licenses/>. */
<|file_name|>dom.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/. */ //! Types and traits used to access the DOM from style calculatio...
fn implemented_pseudo_element(&self) -> Option<PseudoElement> { None }
<|file_name|>ExportGeometryInfo.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- """ *************************************************************************** ExportGeometryInfo.py --------------------- Date : August 2012 Copyright : (C) 2012 by Victor Olaya Emai...
class ExportGeometryInfo(QgisAlgorithm): INPUT = 'INPUT' METHOD = 'CALC_METHOD'
<|file_name|>test_admin_views.py<|end_file_name|><|fim▁begin|>from __future__ import unicode_literals import json from django.test import TestCase, override_settings from django.utils.http import urlquote from django.core.urlresolvers import reverse from django.contrib.auth.models import Permission from django.core.f...
file=get_test_image_file(),
<|file_name|>util.py<|end_file_name|><|fim▁begin|># collections.abc new as of 3.3, and collections is deprecated. collections # will be unavailable in 3.9 try: import collections.abc as collections except ImportError: import collections import datetime import logging try: import json except ImportError: ...
return obj def to_camel_case(snake_str):
<|file_name|>disk_sync.py<|end_file_name|><|fim▁begin|>import os import unicodedata from tendrl.commons.event import Event from tendrl.commons.message import ExceptionMessage from tendrl.commons.utils import cmd_utils from tendrl.commons.utils import etcd_utils from tendrl.commons.utils import log_utils as logger de...
) for device_id in block_devices['free']:
<|file_name|>apiUtils.js<|end_file_name|><|fim▁begin|>/******************************************************************************* * Copyright (c) 2019 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License...
success: function(response) { table.deleteTableRow(authID);
<|file_name|>e2e.ts<|end_file_name|><|fim▁begin|><|fim▁hole|> const page = await newE2EPage({ url: '/src/components/select/test/standalone?ionic:_testing=true' }); const compare = await page.compareScreenshot(); expect(compare).toMatchScreenshot(); });<|fim▁end|>
import { newE2EPage } from '@stencil/core/testing'; test('select: standalone', async () => {
<|file_name|>box.js<|end_file_name|><|fim▁begin|><|fim▁hole|>var crypto = require('crypto'); var util = require('hexo-util'); var Pattern = util.Pattern; var testUtil = require('../../util'); function shasum(content){ var hash = crypto.createHash('sha1'); hash.update(content); return hash.digest('hex'); } descr...
var should = require('chai').should(); var pathFn = require('path'); var fs = require('hexo-fs'); var Promise = require('bluebird');
<|file_name|>parse.py<|end_file_name|><|fim▁begin|>import sys, math from test import goertzel import wave import pyaudio import Queue import numpy as np if len(sys.argv) < 2: print "Usage: %s <filename> " % sys.argv[0] sys.exit(1) filename = sys.argv[1] w = wave.open(filename) fs = w.getframerate() width = w....
for j in range(len(a)): if a[j] > 1700:
<|file_name|>matrix.py<|end_file_name|><|fim▁begin|>""" Created by Emille Ishida in May, 2015. Class to implement calculations on data matrix. """ import os import sys import matplotlib.pylab as plt import numpy as np from multiprocessing import Pool from snclass.treat_lc import LC from snclass.util import read_use...
""" Construct one line of the data matrix. input: filename, str
<|file_name|>mod.rs<|end_file_name|><|fim▁begin|>//! Resource data implementations. //! //! This module will eventually contain implementations for the record data //! for all defined resource record types. //! //! The types are named identically to the [`Rtype`] variant they implement. //! They are grouped into submod...
} /// Formats record data from a message parser in master file format.
<|file_name|>test_stringify.py<|end_file_name|><|fim▁begin|>import unittest from .context import json_stable_stringify_python as stringify class TestStringify(unittest.TestCase): def test_simple_object(self): node = {'c':6, 'b': [4,5], 'a': 3, 'z': None} actual = stringify.stringify(node) e...
<|file_name|>RxBaseClient.s-spec.ts<|end_file_name|><|fim▁begin|>import "rxjs/add/operator/finally"; import { RxBaseClient } from "./RxBaseClient"; import proxyquire = require("proxyquire"); import { Subject } from "rxjs/Subject"; describe("RxBaseClient", () => { let RxSocket; let rxSocket; let ClientConnector;...
<|file_name|>opp.py<|end_file_name|><|fim▁begin|># pylint: disable-msg=too-many-lines """OPP Hardware interface. Contains the hardware interface and drivers for the Open Pinball Project platform hardware, including the solenoid, input, incandescent, and neopixel boards. """ import asyncio from collections import defau...
timeout = 1 / self.config['poll_hz'] * 25 try: await asyncio.wait_for(self._poll_response_received[chain_serial].wait(), timeout) except asyncio.TimeoutError:
<|file_name|>switched-expectations.rs<|end_file_name|><|fim▁begin|>fn main() { let var = 10i32; let ref string: String = var; //~ ERROR mismatched types [E0308]<|fim▁hole|>}<|fim▁end|>
<|file_name|>number.rs<|end_file_name|><|fim▁begin|>// Copyright 2013 The Servo Project Developers. See the COPYRIGHT // file at the top-level directory of this distribution. // // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license // <LIC...
} #[inline]
<|file_name|>mymovies.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python import sys from PyQt4.QtCore import * from PyQt4.QtGui import * import moviedata class MainWindow(QMainWindow): def __init__(self, parent=None): super(MainWindow, self).__init__(parent) self.movies = moviedata.MovieContai...
self.table.clear() self.table.setRowCount(len(self.movies)) self.table.setColumnCount(5)
<|file_name|>logout.js<|end_file_name|><|fim▁begin|>module.exports = function (app) { app.get('/', function (req, res) { if (req.logout) { req.logout(); } res.redirect('/');<|fim▁hole|><|fim▁end|>
}); };
<|file_name|>ipo.py<|end_file_name|><|fim▁begin|>from heapq import * from typing import List class Solution: def findMaximizedCapital(self, k: int, wealth: int, profits: List[int], capitals: List[int]) -> int: minCapitalHeap, maxProfitHeap = [], [] for i in range(len(capitals)): heappus...
<|file_name|>download_test.py<|end_file_name|><|fim▁begin|>#! /usr/bin/env python """Unit tests for the image downloader.""" import unittest import download __author__ = "Nick Pascucci (npascut1@gmail.com)" class DownloadTest(unittest.TestCase): def setUp(self): pass def tearDown(self): pass ...
</body>
<|file_name|>attach.js<|end_file_name|><|fim▁begin|>import {ATTACHMENTS} from "../constants"; export default (...args) => { // Use one or the other const attachments = args.length ? args : ATTACHMENTS; return { props: { attach: { type: String, validator: value => value === "" || attach...
};
<|file_name|>macro-backtrace-nested.rs<|end_file_name|><|fim▁begin|>// Copyright 2015 The Rust Project Developers. See the COPYRIGHT // file at the top-level directory of this distribution and at // http://rust-lang.org/COPYRIGHT. // // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or // http://www.apa...
fn main() { 1 + call_nested_expr!(); //~ ERROR unresolved name call_nested_expr_sum!(); //~ NOTE expansion site
<|file_name|>basic_stats.py<|end_file_name|><|fim▁begin|># This script calculates how many error reports are in each subdirectory # and how many error reports are in total. # Edit in_dir and out_file parameters as you need. import os in_dir = "D:/Projects/CrashRpt/valid_reports" out_file = "stats.txt" f = open(out_...
<|file_name|>test_notification.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- # Copyright 2013 Google Inc. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # ...
self.assertEqual(len(channel_id), 1)
<|file_name|>atomic_usize.rs<|end_file_name|><|fim▁begin|>use std::cell::UnsafeCell; use std::fmt; use std::ops; /// `AtomicUsize` providing an additional `load_unsync` function. pub(crate) struct AtomicUsize { inner: UnsafeCell<std::sync::atomic::AtomicUsize>, } unsafe impl Send for AtomicUsize {} unsafe impl Sy...
/// # Safety ///
<|file_name|>test.js<|end_file_name|><|fim▁begin|>const path = require('path'); const { expect } = require('chai'); const delay = require('../../../../lib/utils/delay'); describe('Compiler service', () => { it('Should execute a basic test', async () => { await runTests('testcafe-fixtures/basic-t...
await runTests('testcafe-fixtures/error-test.js', 'Throw an error', { shouldFail: true }); }
<|file_name|>0068_auto_20160413_0650.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('backend', '0067_auto_20160411_1224'), ] operations = [ ...
field=models.IntegerField(default=0), ), ]
<|file_name|>CargaFacturaOracle.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- from BaseOracle import * from Factura import * from ConfigDB import * class CargaFacturaOracle(object): def __init__(self): pass def carga(self, factura): cfgOra = ConfigDB("oracle") cfgOra.getCon...
#cfgOra.imprimir()
<|file_name|>126_sdp_with_port_0_and_no_rtpmap_for_dynamic_pt.py<|end_file_name|><|fim▁begin|># $Id: 126_sdp_with_port_0_and_no_rtpmap_for_dynamic_pt.py 369517 2012-07-01 17:28:57Z file $ import inc_sip as sip import inc_sdp as sdp sdp = \ """ v=0 o=- 0 0 IN IP4 127.0.0.1 s=- c=IN IP4 127.0.0.1 t=0 0 m=video 0 RTP/AVP...
sendto_cfg = sip.SendtoCfg("SDP media with port 0 and no rtpmap for dynamic PT", pjsua_args, sdp, 200, extra_headers=extra_headers,
<|file_name|>LiveStreamEvent.java<|end_file_name|><|fim▁begin|>package com.google.api.ads.dfp.jaxws.v201408; import java.util.ArrayList; import java.util.List; import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.XmlSchemaType; import javax....
* * <p>This includes information such as the start and expected end time of * the event, the URL of the actual content for DFP to pull and insert ads into, * as well as the metadata necessary to generate ad requests during the event.
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|>from collections import OrderedDict import logging import json import re import itertools import sublime import sublime_plugin from ..lib import inhibit_word_completions from .commandinfo import ( get_command_name, get_builtin_command_meta_data, get_bu...
or sublime.packages_path() in (view.file_name() or "") or view.settings().get('is_widget'))
<|file_name|>celery.py<|end_file_name|><|fim▁begin|><|fim▁hole|>from __future__ import absolute_import import os from celery import Celery # set the default Django settings module for the 'celery' program. os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'sugarcub.settings') from django.conf import settings # noqa ...
<|file_name|>MonitoringCatalog.py<|end_file_name|><|fim▁begin|>""" Interacts with sqlite3 db """ from __future__ import absolute_import from __future__ import division from __future__ import print_function import six import sqlite3 import os import hashlib import random import time import DIRAC from DIRAC import gLog...
from DIRAC.FrameworkSystem.private.monitoring.Activity import Activity from DIRAC.Core.Utilities import Time
<|file_name|>cleanup-shortcircuit.rs<|end_file_name|><|fim▁begin|>// run-pass // Test that cleanups for the RHS of shortcircuiting operators work. // pretty-expanded FIXME #23616 #![allow(deref_nullptr)]<|fim▁hole|>pub fn main() { let args: Vec<String> = env::args().collect(); // Here, the rvalue `"signal".t...
use std::env;
<|file_name|>lumina-fm_fi.ts<|end_file_name|><|fim▁begin|><?xml version="1.0" encoding="utf-8"?> <!DOCTYPE TS> <TS version="2.0" language="fi_FI"> <context> <name>MainUI</name> <message> <location filename="../MainUI.ui" line="14"/> <source>Insight</source> <translation type="unfinished"...
<translation type="unfinished"></translation>
<|file_name|>drop.go<|end_file_name|><|fim▁begin|>// Copyright 2015 The Cockroach 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.org/licenses/LICENSE...
import "bytes"
<|file_name|>getJavaScriptCompletions18.ts<|end_file_name|><|fim▁begin|>/// <reference path="fourslash.ts" /> // @allowNonTsExtensions: true // @Filename: file.js //// /** //// * @param {number} a //// * @param {string} b //// */ //// exports.foo = function(a, b) { //// a/*a*/; //// b/*b*/ //// }; ...
<|file_name|>ApplicationTest.java<|end_file_name|><|fim▁begin|>package be.ipl.mobile.projet.historypub; import android.app.Application; import android.test.ApplicationTestCase; <|fim▁hole|>/** * <a href="http://d.android.com/tools/testing/testing_android.html">Testing Fundamentals</a> */ public class ApplicationTest...
<|file_name|>01-count-pe1.py<|end_file_name|><|fim▁begin|><|fim▁hole|>from bluesky.callbacks import LiveTable RE(count([pe1]), LiveTable([pe1]))<|fim▁end|>
from bluesky.plans import count
<|file_name|>Layer.ts<|end_file_name|><|fim▁begin|>namespace Rocket.Cmd { import display = Rocket.Display; export class Layer implements Jhtml.CompHandler { private _zones: Array<Zone> = new Array<Zone>(); private onNewZoneCallbacks: Array<ZoneCallback>; private onNewHistoryEntryCallbacks: Array<History...
// public getHistoryUrlByIndex(historyIndex: number): Url { // if (this.historyUrls.length <= historyIndex) return null; // // return this.historyUrls[historyIndex];
<|file_name|>fooPost.js<|end_file_name|><|fim▁begin|>'use strict'<|fim▁hole|> res.send(200); next(); };<|fim▁end|>
module.exports = function fooPost(req, res, next) { res.header('name', 'foo'); res.header('method', 'post');
<|file_name|>HTTP.test.js<|end_file_name|><|fim▁begin|>/** * HTTP.test */ "use strict"; /* Node modules */ /* Third-party modules */ var steeplejack = require("steeplejack"); /* Files */ describe("HTTPError test", function () { var HTTPError; beforeEach(function () { injector(function (_HTT...
expect(obj.getHttpCode()).to.be.equal(401); });
<|file_name|>data.py<|end_file_name|><|fim▁begin|># coding=UTF-8 ''' Created on 24.09.2017 @author: sysoev ''' from google.appengine.ext import db from google.appengine.api import users import datetime import time import logging from myusers import MyUser def force_unicode(string): if type(string) == unicode: ...
def updateProject(key, name): p = Project.get(key) if not p: return
<|file_name|>line.rs<|end_file_name|><|fim▁begin|>// // imag - the personal information management suite for the commandline // Copyright (C) 2015, 2016 Matthias Beyer <mail@beyermatthias.de> and contributors // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Les...
let s = entry.get_location().to_str().unwrap_or(String::from(self.unknown_output)); write!(stdout(), "{:?}\n", s).chain_err(|| LEK::FormatError)? }
<|file_name|>typedef.py<|end_file_name|><|fim▁begin|># Copyright 2017 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. from .code_generator_info import CodeGeneratorInfo from .composition_parts import WithCodeGeneratorInfo ...
WithDebugInfo.__init__(self, ir) self._idl_type = ir.idl_type
<|file_name|>urls.py<|end_file_name|><|fim▁begin|>from django.conf.urls import url from audiotracks import feeds from audiotracks import views urlpatterns = [ url(r"^$", views.index, name="audiotracks"), url(r"^(?P<page_number>\d+)/?$", views.index, name="audiotracks"), url(r"^track/(?P<track_slug>.*)$",...
url(r"^m3u/?$", views.m3u, name="m3u"), ]
<|file_name|>recipe-523034.py<|end_file_name|><|fim▁begin|>try: from collections import defaultdict except: class defaultdict(dict): def __init__(self, default_factory=None, *a, **kw): if (default_factory is not None and not hasattr(default_factory, '__call__')): ...
import copy return type(self)(self.default_factory,
<|file_name|>win_iocp_socket_recvfrom_op.hpp<|end_file_name|><|fim▁begin|>// // detail/win_iocp_socket_recvfrom_op.hpp // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // // Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com) // // Distributed under the Boost Software License, Version 1.0. (See accompa...
# pragma once #endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
<|file_name|>fast_sin_cos_2π_benchmark.cpp<|end_file_name|><|fim▁begin|> // .\Release\x64\benchmarks.exe --benchmark_repetitions=10 --benchmark_min_time=2 --benchmark_filter=FastSinCos // NOLINT(whitespace/line_length) #include "numerics/fast_sin_cos_2π.hpp" #include <pmmintrin.h> #include <random> #include <vector...
for (auto _ : state) { double sin;
<|file_name|>userdata_test.go<|end_file_name|><|fim▁begin|>// Copyright 2015 Canonical Ltd. // Copyright 2015 Cloudbase Solutions SRL // Licensed under the AGPLv3, see LICENCE file for details. package openstack_test import ( jc "github.com/juju/testing/checkers" "github.com/juju/utils" "github.com/juju/utils/os" ...
} func (s *UserdataSuite) TestOpenstackUnknownOS(c *gc.C) { renderer := openstack.OpenstackRenderer{}
<|file_name|>mobile_device_constant_service.pb.go<|end_file_name|><|fim▁begin|>// Code generated by protoc-gen-go. DO NOT EDIT. // source: google/ads/googleads/v2/services/mobile_device_constant_service.proto package services import ( context "context" fmt "fmt" math "math" proto "github.com/golang/protobuf/prot...
} func (*UnimplementedMobileDeviceConstantServiceServer) GetMobileDeviceConstant(ctx context.Context, req *GetMobileDeviceConstantRequest) (*resources.MobileDeviceConstant, error) { return nil, status.Errorf(codes.Unimplemented, "method GetMobileDeviceConstant not implemented")
<|file_name|>test_event.py<|end_file_name|><|fim▁begin|>from vadvisor.store.event import InMemoryStore import pytest from freezegun import freeze_time from datetime import datetime, timedelta @pytest.fixture @freeze_time("2012-01-14 03:00:00") def expired_store(): store = InMemoryStore(60) # Insert old data ...
new_store.put('newest') new_store.put('newest') return new_store
<|file_name|>app.py<|end_file_name|><|fim▁begin|>import gamerocket from flask import Flask, request, render_template app = Flask(__name__) gamerocket.Configuration.configure(gamerocket.Environment.Development, apiKey = "your_apiKey", secretKey = "...
@app.route("/")
<|file_name|>actuators_simple.py<|end_file_name|><|fim▁begin|>def print_from_queue(q): """ prints values read from queue q to standard out. """ while True: v = q.get() if v is None: # exit loop return else: print (str(v)) class queue_to_f...
def actuate(self, q):
<|file_name|>serializers.py<|end_file_name|><|fim▁begin|>from rest_framework import serializers from csinterop.models import SharingProposal, Folder, User class SharingProposalSerializer(serializers.ModelSerializer): share_id = serializers.RelatedField(source='key') permission = serializers.CharField(source='...
<|file_name|>log.hpp<|end_file_name|><|fim▁begin|>/* Copyright (c) 2004, 2005, 2006, 2007, 2008, 2009 Mark Aylett <mark.aylett@gmail.com> This file is part of Aug written by Mark Aylett. Aug is released under the GPL with the additional exemption that compiling, linking, and/or using OpenSSL is allowed. Au...
formatlog(char* buf, size_t& n, clockref clock, unsigned level, const char* format, ...) { va_list args;
<|file_name|>software_engineering_sqlite3.py<|end_file_name|><|fim▁begin|>from collections import namedtuple import sqlite3 # make a basic Link class Link = namedtuple('Link', ['id', 'submitter_id', 'submitted_time', 'votes', 'title', 'url']) # list of Links to work with links = [ Link(...
Link(2, 6084, 1333996166.0, 81, "Announcing Yesod 1.0- a robust, developer friendly, high performance web framework for Haskell", "http://www.yesodweb.com/blog/2012/04/announcing-yesod-1-0"), Link(3, 30305, 1333968061.0, 270,
<|file_name|>SbPimplPtr.hpp<|end_file_name|><|fim▁begin|>#ifndef COIN_SBPIMPLPTR_HPP #define COIN_SBPIMPLPTR_HPP /**************************************************************************\ * * This file is part of the Coin 3D visualization library. * Copyright (C) 1998-2008 by Kongsberg SIM. All rights reserved...
#ifndef COIN_SBPIMPLPTR_H
<|file_name|>pull-to-refresh.js<|end_file_name|><|fim▁begin|>/*====================================================== ************ Pull To Refresh ************ ======================================================*/ app.initPullToRefresh = function (pageContainer) { var eventsTarget = $(pageContainer); if ...
if (e.type === 'touchend' && e.changedTouches && e.changedTouches.length > 0 && touchId) {
<|file_name|>EggPlayer.java<|end_file_name|><|fim▁begin|>package com.github.niwaniwa.we.core.player; import com.github.niwaniwa.we.core.api.callback.Callback; import com.github.niwaniwa.we.core.twitter.TwitterManager; import org.bukkit.Bukkit; import org.bukkit.ChatColor; import org.bukkit.Location; import org.bukkit....
<|file_name|>alertview.py<|end_file_name|><|fim▁begin|>import kivy kivy.require('1.9.1') from kivy.uix.popup import Popup from kivy.uix.label import Label from kivy.uix.gridlayout import GridLayout from kivy.metrics import dp from kivy.app import Builder from kivy.properties import StringProperty, ObjectProperty from k...
def __init__(self,**kwargs):
<|file_name|>kindck-owned-trait-contains-1.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://...
pub fn main() { let x = 3;
<|file_name|>exon_utils_tests.py<|end_file_name|><|fim▁begin|>"""Testing for overlap intervals """ import unittest from genda.transcripts.exon_utils import calcOverlap, collideIntervals, \ collapseIntervals class TestOverlapFunctions(unittest.TestCase): def setUp(self): # Simple Overlap se...
:x[1]-x[0],collapseIntervals(self.partial))) - calcOverlap(self.partial),330-150)
<|file_name|>test_httplib.py<|end_file_name|><|fim▁begin|>import errno from http import client import io import os import array import socket import unittest TestCase = unittest.TestCase from test import support here = os.path.dirname(__file__) # Self-signed cert file for 'localhost' CERT_localhost = os.path.join(he...
("www.python.org", "www.python.org", 80), ("[fe80::207:e9ff:fe9b]", "fe80::207:e9ff:fe9b", 80)): c = client.HTTPConnection(hp)
<|file_name|>filesmonster.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- # ------------------------------------------------------------ # pelisalacarta - XBMC Plugin # Conector para filesmonster # http://blog.tvalacarta.info/plugin-xbmc/pelisalacarta/ # ---------------------------------------------------------...
logger.info(" url=" + url)
<|file_name|>color-contrast.js<|end_file_name|><|fim▁begin|>/** * @license Copyright 2017 Google Inc. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/li...
* WCAG 2 AA contrast ratio thresholds. * See base class in axe-audit.js for audit() implementation.
<|file_name|>S11.13.2_A4.1_T2.6.js<|end_file_name|><|fim▁begin|>// Copyright 2009 the Sputnik authors. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. /** * The production x *= y is the same as the production x = x * y * * @path ch11/11.13/11.13.2/S11.13.2_A4.1_T2.6.js ...
if (isNaN(x) !== true) { $ERROR('#2: x = undefined; x *= "1"; x === Not-a-Number. Actual: ' + (x)); }
<|file_name|>plot_pattern_diagram_markers.py<|end_file_name|><|fim▁begin|>import matplotlib.pyplot as plt import matplotlib.colors as clr import matplotlib import warnings from skill_metrics import add_legend def plot_pattern_diagram_markers(X,Y,option): ''' Plots color markers on a pattern diagram. P...
colorm = ['b','r','g','c','m','y','k'] if len(X) > 70: _disp('You must introduce new markers to plot more than 70 cases.') _disp('The ''marker'' character array need to be extended inside the code.')
<|file_name|>DeserializeReshape.cpp<|end_file_name|><|fim▁begin|>// // Copyright © 2017 Arm Ltd. All rights reserved. // SPDX-License-Identifier: MIT // #include "ParserFlatbuffersSerializeFixture.hpp" #include <armnnDeserializer/IDeserializer.hpp> #include <string> TEST_SUITE("Deserializer_Reshape") { struct Reshap...
layer: { base: { layerBindingId: 0, base: {
<|file_name|>test_feature.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python # # Copyright 2018-2021 Polyaxon, 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.o...
from django.conf import settings from polycommon.options.exceptions import OptionException from polycommon.options.feature import Feature
<|file_name|>request.java<|end_file_name|><|fim▁begin|>package org.ocbc.utils; import org.json.JSONObject; import java.io.BufferedReader; import java.io.InputStreamReader; import java.net.HttpURLConnection; import java.net.URL; import java.util.HashMap; public class request { public static JSONObject get(String...
in = new BufferedReader(new InputStreamReader(con.getInputStream())); response = new StringBuffer();
<|file_name|>mouse.cpp<|end_file_name|><|fim▁begin|>#include "mouse.h" ////////////////////////////////////////////////////////////////////////// // RAY // ////////////////////////////////////////////////////////////////////////// RAY::RAY() { org = dir = D3DXVECTOR3(0.0f, 0.0f, 0.0f); } RAY::RAY(D3...
//Update pointer
<|file_name|>poke-catalog.component.ts<|end_file_name|><|fim▁begin|>import { OnInit, Component, Input, EventEmitter } from "@angular/core"; import { Pokemon } from "./pokemon.model"; import { ExternalImageURLPipe } from "./../pipes/external-image-url.pipe"; import { PokeCatalogService } from "./poke-catalog.service"; <...