prompt
large_stringlengths
70
991k
completion
large_stringlengths
0
1.02k
<|file_name|>sensors_raw_left.py<|end_file_name|><|fim▁begin|>import RPi.GPIO as GPIO import time GPIO.setmode(GPIO.BOARD) TRIG = 35 ECHO = 38 GPIO.setup(TRIG,GPIO.OUT) GPIO.output(TRIG,0) GPIO.setup(ECHO,GPIO.IN) time.sleep(0.1) print ("Starting gesture recognition") try: # here you put your main loop or ...
GPIO.output(TRIG,1)
<|file_name|>storesStubs.js<|end_file_name|><|fim▁begin|>import Immutable from 'immutable'; export const currentUser = Immutable.fromJS({ value: { _id: 'user/0', _rev: '55781764180', _key: '0', entityId: 'entities/0', }, }); export const entitiesWithoutAttribute = Immutable.fromJS({ value: { ...
value: {}, });
<|file_name|>1180-(2 numbery).cpp<|end_file_name|><|fim▁begin|>/** Author: Sharmin Akter **/ /** Created at: 4/30/2012 12:07:26 AM **/ #include<stdio.h> <|fim▁hole|> int main() { int i,j,k,p,m,n,t; while(scanf("%d",&t)==1) { for(i=1;i<=t;i++) { scanf("%d",&p); ...
<|file_name|>archive.py<|end_file_name|><|fim▁begin|># coding=utf-8 # Copyright 2014 Pants project contributors (see CONTRIBUTORS.md). # Licensed under the Apache License, Version 2.0 (see LICENSE). from __future__ import (absolute_import, division, generators, nested_scopes, print_function, un...
self.extension = extension def create(self, basedir, outdir, name, prefix=None):
<|file_name|>AutoFilterRow.tsx<|end_file_name|><|fim▁begin|>import * as React from 'react'; import * as classNames from 'classnames'; import { FiltersProps} from './QuickGrid.Props'; import { Grid} from 'react-virtualized'; import './QuickGrid.scss'; import { TextField } from '../TextField'; import { ColumnFilter...
const startColumnIndex = this.props.allColumns.indexOf(this.props.allColumns.find(el => el.headerText === text)); const filter = this.props.columnFilters.find(el => el.columnIndex === startColumnIndex); const filterValue = filter !== undefined ? filter.filterValue : '';
<|file_name|>instrument_alias_type.py<|end_file_name|><|fim▁begin|>""" .. module:: instrument_alias_type<|fim▁hole|>MusicBrainz database dump of 2017-07-22: +----+-----------------+--------+-------------+-------------+--------------------------------------+ | id | name | parent | child_order | description |...
The **Instrument Alias Type** Model. Here's a complete table of values, from the
<|file_name|>InfoServiceActivity.java<|end_file_name|><|fim▁begin|>package redes3.proyecto.nagiosalert; import android.app.Activity; import android.content.Context; import android.os.Bundle; import android.view.LayoutInflater; import android.view.View; import android.widget.ImageView; import android.widget.TextView; ...
tvInfo.setText("Descripción : \n"+info);
<|file_name|>CassandraHash.java<|end_file_name|><|fim▁begin|>package demo.hashing; import java.nio.ByteBuffer; public class CassandraHash { private static long getblock(ByteBuffer key, int offset, int index) { int i_8 = index << 3; return ((long) key.get(offset + i_8 + 0) & 0xff) + (((long) key.get(offset ...
switch (length % 4) { case 3:
<|file_name|>ktmerge.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python # -*- coding: utf-8 -*- """Simple utility to merge multiple Kerberos keytabs into one. This also cleans out duplicate and old keytab entries. """ import functools import struct # from http://pig.made-it.com/kerberos-etypes.html ETYPES = { ...
for e in entries: self.add_entry(e)
<|file_name|>setup.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python import re from codecs import open try: from setuptools import setup except ImportError: from distutils.core import setup def get_version(): version = '' with open('grimreaper.py', 'r') as fd: version = re.search(r'^__ve...
'Topic :: Utilities',
<|file_name|>ExceptionUtils.java<|end_file_name|><|fim▁begin|>/* * Copyright 2013-2017 the original author or 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://w...
<|file_name|>main.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python3 # -*- coding: utf-8 -*-<|fim▁hole|># * License as published by the Free Software Foundation; either # * version 2.1 of the License, or (at your option) any later version. # * # * Libav is distributed in the hope that it will be useful, # * but WIT...
# * This Program is free software; you can redistribute it and/or # * modify it under the terms of the GNU Lesser General Public
<|file_name|>rust.js<|end_file_name|><|fim▁begin|>// Copyright (c) 2016, Matt Godbolt // All rights reserved. // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are met: // // * Redistributions of source code must retain the...
if (!userRequestedEmit) { options = options.concat('--emit', 'asm');
<|file_name|>P15Correction.cpp<|end_file_name|><|fim▁begin|>/* **************************************************************************** <|fim▁hole|> * Copyright (C) 2008-2009 FedICT. * * This is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public Licens...
* eID Middleware Project.
<|file_name|>current.js<|end_file_name|><|fim▁begin|>function warning(){ throw new Error('You must require a mode before requiring anything else.'); } exports.Surface = warning; exports.Path = warning; exports.Shape = warning; exports.Group = warning; exports.ClippingRectangle = warning; exports.Text = warning; expo...
<|file_name|>index_pdf.ts<|end_file_name|><|fim▁begin|>// ==LICENSE-BEGIN== // Copyright 2017 European Digital Reading Lab. All rights reserved. // Licensed to the Readium Foundation under one or more contributor license agreements. // Use of this source code is governed by a BSD-style license // that can be found in t...
highlightAll: true,
<|file_name|>welcome.js<|end_file_name|><|fim▁begin|>// Place all the behaviors and hooks related to the matching controller here. // All this logic will automatically be available in application.js. <|fim▁hole|> // set .fullscreen height $(".content-b").each(function(i){ if($(this).innerHeight() <= h){ ...
/* fix vertical when not overflow call fullscreenFix() if .fullscreen content changes */ function fullscreenFix(){ var h = $('body').height();
<|file_name|>JkChatConversationDaoWrapper.java<|end_file_name|><|fim▁begin|>package cn.jianke.jkchat.data.dao; import android.content.Context; import com.jk.chat.gen.JkChatConversationDao; import org.greenrobot.greendao.query.QueryBuilder; import java.util.List; import cn.jianke.jkchat.domain.JkChatConversation; impor...
* @author leibing * @createTime 2017/2/22
<|file_name|>slashParameter.after.py<|end_file_name|><|fim▁begin|>def foo(a, /, b): print(a, b) <|fim▁hole|>def egg(): a = 1 b = 2 foo(a, b)<caret><|fim▁end|>
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|>from .Gender import Gender<|fim▁hole|>from .MeasurementUnit import MeasurementUnit<|fim▁end|>
from .Profile import Profile from .Measurement import Measurement from .MeasurementSource import MeasurementSource from .MeasurementType import MeasurementType
<|file_name|>manage.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python import os import sys <|fim▁hole|>if __name__ == "__main__": os.environ.setdefault("DJANGO_SETTINGS_MODULE", "decommentariis.settings") from django.core.management import execute_from_command_line execute_from_command_line(sys.argv)<|f...
<|file_name|>index.js<|end_file_name|><|fim▁begin|>const FeedParser = require("feedparser"); const request = require("request"); const Promise = require("bluebird"); const flatten = require("lodash").flatten; const nodemailer = require("nodemailer"); const cfg = require("dotenv").config(); const readUrls = require("./...
function email(items) {
<|file_name|>15.2.3.6-3-195.js<|end_file_name|><|fim▁begin|>/// Copyright (c) 2012 Ecma International. All rights reserved. /// Ecma International makes this code available under the terms and conditions set <|fim▁hole|>/** * @path ch15/15.2/15.2.3/15.2.3.6/15.2.3.6-3-195.js * @description Object.defineProperty ...
/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the /// "Use Terms"). Any redistribution of this code must retain the above /// copyright and this notice and otherwise comply with the Use Terms.
<|file_name|>upload.go<|end_file_name|><|fim▁begin|>package bfs import ( "bytes" "context" "crypto/md5" "encoding/hex" "errors" "fmt" "io" "mime/multipart" "net/http" "net/url" "strconv" "strings" "time" "go-common/library/ecode" xhttp "go-common/library/net/http/blademaster" xtime "go-common/library/...
<|file_name|>with.js<|end_file_name|><|fim▁begin|>import Ember from 'ember-metal/core'; import { get } from 'ember-metal/property_get'; import { internal } from 'htmlbars-runtime'; import { read } from 'ember-metal/streams/utils'; export default { setupState(state, env, scope, params, hash) { var controller = ha...
Ember.assert( '{{#with foo}} must be called with a single argument or the use the ' +
<|file_name|>test_mini_market.py<|end_file_name|><|fim▁begin|>__author__ = 'Math' import unittest from ODA.market_cols import OrderKeys, ExecutionResponse from utils import Generear_ordenes_limit import random import pandas as pd from ODA.market import Market, Request req_ask1 = { OrderKeys.size: 1000, OrderK...
l_res = []
<|file_name|>day_eight_part2.py<|end_file_name|><|fim▁begin|>def runProgram(programLines,swapLine): result = [False,0] accumulator = 0 executionIndex = 0 setOfRunInstructions = [] while (executionIndex not in setOfRunInstructions) and (executionIndex < len(programLines)): #print("Execution...
argument = instructionParts[1] if instruction == "nop":
<|file_name|>control.py<|end_file_name|><|fim▁begin|># Copyright (C) 2016 East Asian Observatory # All Rights Reserved. # # This program is free software; you can redistribute it and/or modify it under # the terms of the GNU General Public License as published by the Free Software # Foundation; either version 2 of the ...
<|file_name|>misc.js<|end_file_name|><|fim▁begin|>/* * Misc Javascript variables and functions. * * This could all likely use some cleanup. Some of this stuff could be: * * - turned into event-based unobtrusive javascript * - simply named / namespaced a bit better * - the html generated from javascript strin...
} else if (params.video_trusted == EOL.Curation.UNKNOWN_ID){ $('video-notes').addClassName('unknown-background-text');
<|file_name|>instr_fmul.rs<|end_file_name|><|fim▁begin|>use ::{BroadcastMode, Instruction, MaskReg, MergeMode, Mnemonic, OperandSize, Reg, RoundingMode}; use ::RegType::*; use ::instruction_def::*; use ::Operand::*; use ::Reg::*; use ::RegScale::*; use ::test::run_test; #[test] fn fmul_1() { run_test(&Instruction ...
#[test] fn fmul_11() { run_test(&Instruction { mnemonic: Mnemonic::FMUL, operand1: Some(Direct(ST3)), operand2: Some(Direct(ST)), operand3: None, operand4: None, lock: false, rounding_mode: None, merge_mode: None, sae: false, mask: None, broadcast: None }, &[220, 203], OperandSize::Dword)
<|file_name|>config.js<|end_file_name|><|fim▁begin|><|fim▁hole|>export default { port: 1989 }<|fim▁end|>
<|file_name|>wanda_the_fish.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- """ Display a fortune-telling, swimming fish. Wanda has no use what-so-ever. It only takes up disk space and compilation time, and if loaded, it also takes up precious bar space, memory, and cpu cycles. Anybody found using it should be...
wanda_the_fish { format = '[{fortune} ]{wanda}' cache_timeout = -1 }
<|file_name|>IHeatmapField.java<|end_file_name|><|fim▁begin|>package org.eclipse.scout.widgets.heatmap.client.ui.form.fields.heatmapfield; import java.util.Collection; import org.eclipse.scout.rt.client.ui.form.fields.IFormField; public interface IHeatmapField extends IFormField { String PROP_VIEW_PARAMETER = "vi...
void addHeatPoints(Collection<HeatPoint> heatPoints);
<|file_name|>Gruntfile.js<|end_file_name|><|fim▁begin|>"use strict"; module.exports = function(grunt) { require("matchdep").filterDev("grunt-*").forEach(grunt.loadNpmTasks); grunt.initConfig({ // Define Directory dirs: { js: "src/js", coffee: "src/coffee", ...
} } }
<|file_name|>feature_spec.js<|end_file_name|><|fim▁begin|>require('../../support/spec_helper'); describe("Cucumber.Ast.Feature", function () { var Cucumber = requireLib('cucumber'); var scenarioCollection, lastScenario; var feature, keyword, name, description, uri, line; beforeEach(function () { lastScena...
describe("getLine()", function () {
<|file_name|>base.py<|end_file_name|><|fim▁begin|># Copyright (C) 2014 Nippon Telegraph and Telephone Corporation. # # 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...
<|file_name|>boinc_api.cpp<|end_file_name|><|fim▁begin|>// This file is part of BOINC. // http://boinc.berkeley.edu // Copyright (C) 2008 University of California // // BOINC is free software; you can redistribute it and/or modify it // under the terms of the GNU Lesser General Public License // as published by the Fre...
<|file_name|>init.cpp<|end_file_name|><|fim▁begin|>// Copyright (c) 2009-2010 Satoshi Nakamoto // Copyright (c) 2009-2016 The Bitcoin Core developers // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. #if defined(HAVE_CONFIG_H) #in...
MapPort(false); UnregisterValidationInterface(peerLogic.get()); peerLogic.reset(); g_connman.reset();
<|file_name|>b_lanterns.py<|end_file_name|><|fim▁begin|>import fileinput def str_to_int(s): return([ int(x) for x in s.split() ]) # args = [ 'line 1', 'line 2', ... ] def proc_input(args): (n, l) = str_to_int(args[0]) a = tuple(str_to_int(args[1])) return(l, a) def solve(args, verbose=False): (l, a) = proc_inpu...
else: solve(list(fileinput.input()), verbose=True)
<|file_name|>gohll_test.go<|end_file_name|><|fim▁begin|>// +build go1.1 package gohll import ( "fmt" "hash/fnv" "math" "math/rand" "runtime/debug" "testing" "github.com/stretchr/testify/assert" ) func checkErrorBounds(t *testing.T, c, i, errorRate float64) { actualError := math.Abs(c/(i-1) - 1) if actualEr...
}
<|file_name|>string_test.go<|end_file_name|><|fim▁begin|>package util_test import ( . "github.com/mokiat/gostub/util" . "github.com/onsi/ginkgo" . "github.com/onsi/gomega" ) var _ = Describe("String", func() { Describe("SnakeCase", func() { It("has no effect on empty strings", func() { Ω(SnakeCase("")).Sho...
}) It("works for solo upper case words", func() { Ω(SnakeCase("HELLO")).Should(Equal("hello")) })
<|file_name|>exporters.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python # encoding: utf-8 from __future__ import absolute_import, unicode_literals import os import json from .util import u, slugify<|fim▁hole|>def get_tags_count(journal): """Returns a set of tuples (count, tag) for all tags present in the jour...
import codecs
<|file_name|>Arc.java<|end_file_name|><|fim▁begin|>/* * SVG Salamander * Copyright (c) 2004, Mark McKay * All rights reserved. * * Redistribution and use in source and binary forms, with or * without modification, are permitted provided that the following * conditions are met: * * - Redistributions...
public float xAxisRot = 0f; public boolean largeArc = false; public boolean sweep = false;
<|file_name|>ir_sequence.py<|end_file_name|><|fim▁begin|># Copyright 2018 David Vidal <david.vidal@tecnativa.com> # License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). from odoo import _, api, models from odoo.exceptions import UserError class IrSequence(models.Model): _inherit = 'ir.sequence'<|fim▁ho...
<|file_name|>image_arithm.rs<|end_file_name|><|fim▁begin|>#![feature(test)] extern crate image; extern crate ndimage; extern crate num_traits; extern crate rand; extern crate test;<|fim▁hole|> const W: u32 = 1920; const H: u32 = 1080; use num_traits::{Bounded, One}; use rand::{ distributions::...
mod bench_arithm {
<|file_name|>test_classes.py<|end_file_name|><|fim▁begin|>from __future__ import absolute_import from __future__ import print_function from contextlib import contextmanager from typing import (cast, Any, Callable, Dict, Iterable, Iterator, List, Mapping, Optional, Sized, Tuple, Union, Text) from dj...
aaron=u'aaron@zulip.com', ZOE=u'ZOE@zulip.com', )
<|file_name|>urls.py<|end_file_name|><|fim▁begin|>from django.conf.urls import url urlpatterns = [ url(r'^itemsearch/(?P<index>.*)/(?P<concept_id>.*)/(?P<term>.*)$', 'wikidata.views.search_typed_items'),<|fim▁hole|> ]<|fim▁end|>
<|file_name|>defs.rs<|end_file_name|><|fim▁begin|>/* * Copyright (C) 2017 AltOS-Rust Team * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option)...
pub const AF3: u32 = 0b0011; pub const AF4: u32 = 0b0100;
<|file_name|>test_compact_csv_reader.py<|end_file_name|><|fim▁begin|>from __future__ import unicode_literals from django.utils import six import pytest from nicedjango.utils.compact_csv import CsvReader <|fim▁hole|>@pytest.fixture def stream(): csv = b'''"a\xc2\x96b\\"c'd\\re\\nf,g\\\\",1,NULL,""\n'''.decode('ut...
<|file_name|>roman_numerals.py<|end_file_name|><|fim▁begin|># https://www.codeeval.com/open_challenges/106/ import sys from collections import namedtuple test_cases = open(sys.argv[1], 'r') # test_cases = open('roman_numerals.txt', 'r') test_lines = (line.rstrip() for line in test_cases) def num_to_components(num): ...
if num_components.hundreds == 4: r_hundreds = 'CD' elif num_components.hundreds == 9: r_hundreds = 'CM'
<|file_name|>results_options.py<|end_file_name|><|fim▁begin|># Copyright 2014 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. import optparse import os import sys from telemetry.core import util from telemetry.results imp...
output_skipped_tests_summary = 'gtest' in options.output_formats reporter = _GetProgressReporter(output_skipped_tests_summary,
<|file_name|>HelpTabWidget.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- # Copyright (c) 2010 - 2015 Detlev Offenbach <detlev@die-offenbachs.de> # """ Module implementing the central widget showing the web pages. """ from __future__ import unicode_literals import os from PyQt5.QtCore import pyqtSignal, p...
printer.setPageOrder(QPrinter.FirstPageFirst) else:
<|file_name|>TriggerList.js<|end_file_name|><|fim▁begin|>// @flow import React from 'react'; import type { Trigger } from '../../Domain/Trigger'; import type { Maintenance } from '../../Domain/Maintenance'; import TriggerListItem from '../TriggerListItem/TriggerListItem'; import cn from './TriggerList.less'; type Prop...
); }
<|file_name|>diffusion.cpp<|end_file_name|><|fim▁begin|>#include "diffusion.hpp" #include "support_classes.hpp" template <int dim> kappa_inv_class<dim, Eigen::MatrixXd> Diffusion<dim>::kappa_inv{}; template <int dim> tau_func_class<dim> Diffusion<dim>::tau_func{}; template <int dim> u_func_class<dim> Diffusion<dim>::u...
template <int dim>
<|file_name|>03_Shake_Ball_Bounce.js<|end_file_name|><|fim▁begin|>/* * @name शेक बॉल बाउंस * @description एक बॉल क्लास बनाएं, कई ऑब्जेक्ट्स को इंस्टेंट करें, इसे स्क्रीन के चारों ओर घुमाएं, और कैनवास के किनारे को छूने पर बाउंस करें। * त्वरणX और त्वरण में कुल परिवर्तन के आधार पर शेक घटना का पता लगाएं और पता लगाने ...
let balls = []; let threshold = 30; let accChangeX = 0;
<|file_name|>save_service_identities.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- # Copyright 2020 Green Valley Belgium NV # # 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 # # h...
# # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS,
<|file_name|>problem_94.py<|end_file_name|><|fim▁begin|>"""94. Binary Tree Inorder Traversal https://leetcode.com/problems/binary-tree-inorder-traversal/ Given a binary tree, return the in-order traversal of its nodes' values. Example: Input: [1,null,2,3] 1 \ 2 / 3 Output: [1,3,2] Follow up: Rec...
while root or stack: if root:
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|><|fim▁hole|><|fim▁end|>
am = imp.load_source( 'am', 'artifact-manager' )
<|file_name|>CreateBackup.go<|end_file_name|><|fim▁begin|>package rds_region import ( . "aliyun-openapi-go-sdk/core" "strconv" ) type CreateBackupRequest struct { RpcRequest OwnerId int ResourceOwnerAccount string ResourceOwnerId int DBInstanceId string DBName string B...
func (r *CreateBackupRequest) GetOwnerAccount() string { return r.OwnerAccount }
<|file_name|>setup.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python from setuptools import setup, find_packages try: from pyqt_distutils.build_ui import build_ui cmdclass = {'build_ui': build_ui}<|fim▁hole|> cmdclass = {} setup( name='foo', version='0.1', packages=find_packages(), lic...
except ImportError:
<|file_name|>latest.rs<|end_file_name|><|fim▁begin|>// Copyright (c) 2016-2017 Nikita Pekin and the xkcd_rs contributors // See the README.md 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 th...
extern crate hyper;
<|file_name|>arena.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python # -*- coding: utf-8 -*- ''' PyChess arena tournament script. This script executes a tournament between the engines installed on your system. The script is executed from a terminal with the usual environment. ''' import os import sys ###...
<|file_name|>MessegeLogger.java<|end_file_name|><|fim▁begin|>package exercise.task5_kingsGambitExtended.utils; public class MessegeLogger { public static void log(String message){ System.out.println(message); }<|fim▁hole|><|fim▁end|>
}
<|file_name|>app.js<|end_file_name|><|fim▁begin|>'use strict'; // Declare app level module which depends on views, and components var ntApp = angular.module('ntApp', [ //'ngRoute', 'ui.router', 'ntApp.myDesigns', 'ntApp.designDetail', 'ntApp.myInfo', 'ntApp.couponList', 'ntApp.createDesign'...
})
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- ############################################################################## # # Copyright (C) 2004-2011 Pexego Sistemas Informáticos. All Rights Reserved # $Omar Castiñeira Saavedra$ # # This program is free software: you can redis...
# published by the Free Software Foundation, either version 3 of the
<|file_name|>speakers.server.routes.js<|end_file_name|><|fim▁begin|><|fim▁hole|> var users = require('../../app/controllers/users'), speakers = require('../../app/controllers/speakers'); module.exports = function(app) { // Speakers Routes app.route('/speakers') .get(speakers.list) .post(users.requiresLogin, ...
'use strict';
<|file_name|>middleware.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- class PortalMiddleware: def __init__(self, get_response): self.get_response = get_response def __call__(self, request): # Code to be executed for each request before # the view (and later middleware) are called. response = self...
<|file_name|>views.py<|end_file_name|><|fim▁begin|>from django.conf import settings from django.views.generic.dates import ArchiveIndexView, DateDetailView, DayArchiveView, MonthArchiveView, YearArchiveView from django.views.generic.detail import DetailView from django.views.generic.list import ListView from .models im...
class PhotoYearArchiveView(PhotoDateView, YearArchiveView): pass
<|file_name|>lit.cfg.py<|end_file_name|><|fim▁begin|># -*- Python -*- import os import platform import re import subprocess import tempfile import lit.formats import lit.util from lit.llvm import llvm_config from lit.llvm.subst import ToolSubst # Configuration file for the 'lit' integration test runner. # name: Th...
# excludes: A list of directories to exclude from the integration testsuite. config.excludes = ['CMakeLists.txt', 'README.txt', 'LICENSE.txt']
<|file_name|>tc.rs<|end_file_name|><|fim▁begin|>#[doc = "Register `TC` reader"] pub struct R(crate::R<TC_SPEC>); impl core::ops::Deref for R { type Target = crate::R<TC_SPEC>; #[inline(always)] fn deref(&self) -> &Self::Target { &self.0 } } impl From<crate::R<TC_SPEC>> for R { #[inline(alway...
#[inline(always)] fn from(variant: TRAPE_A) -> Self { variant as u8 != 0
<|file_name|>main.go<|end_file_name|><|fim▁begin|>package popcount // pc[i] is the population count of i var pc [256]byte func init() { for i := range pc { pc[i] = pc[i/2] + byte(i&1) } } <|fim▁hole|> pc[byte(x>>(2*8))] + pc[byte(x>>(3*8))] + pc[byte(x>>(4*8))] + pc[byte(x>>(5*8))] + pc[byte(x>>(6*8))] +...
// PopCount returns the population count (number of set bits) of x. func PopCount(x uint64) int { return int(pc[byte(x>>(0*8))] + pc[byte(x>>(1*8))] +
<|file_name|>main.go<|end_file_name|><|fim▁begin|>// Copyright 2016-2022 The Libsacloud 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/L...
"github.com/sacloud/libsacloud/v2/internal/define" "github.com/sacloud/libsacloud/v2/internal/tools" )
<|file_name|>diskio.go<|end_file_name|><|fim▁begin|>package inputs import ( "fmt" ) // DiskIO is based on telegraf DiskIO. type DiskIO struct { baseInput } // PluginName is based on telegraf plugin name. func (d *DiskIO) PluginName() string { return "diskio" } // UnmarshalTOML decodes the parsed data to the obje...
<|file_name|>matlab.js<|end_file_name|><|fim▁begin|>"use strict"; ace.define("ace/snippets/matlab", ["require", "exports", "module"], function (e, t, n) { "use strict";<|fim▁hole|><|fim▁end|>
t.snippetText = undefined, t.scope = "matlab"; });
<|file_name|>admin.go<|end_file_name|><|fim▁begin|>/* Copyright 2015 Google Inc. All Rights Reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 ...
btopt "cloud.google.com/go/bigtable/internal/option"
<|file_name|>cql3handling.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 Ap...
; <dropUserStatement> ::= "DROP" "USER" ( "IF" "EXISTS" )? <username>
<|file_name|>inemail.py<|end_file_name|><|fim▁begin|>__author__ = 'bernardo' import csv import mechanize import re import time import BeautifulSoup import smtplib def sendEmail(result, sfrom, pwd, sto): SMTP_SERVER = 'smtp.live.com' SMTP_PORT = 587 sender = 'sfrom' recipient = 'sto' subject = 'P...
session.login(sender, pwd) session.sendmail(sender, recipient, headers + "\r\n\r\n" + body) session.quit()
<|file_name|>LineCountBear.py<|end_file_name|><|fim▁begin|>from coalib.bears.LocalBear import LocalBear from coalib.results.Result import Result from coalib.results.RESULT_SEVERITY import RESULT_SEVERITY class LineCountBear(LocalBear): LANGUAGES = {'All'} AUTHORS = {'The coala developers'} AUTHORS_EMAILS ...
file_length = len(file) if file_length > max_lines_per_file: yield Result.from_values( origin=self,
<|file_name|>FSOUND_REVERB_CHANNELPROPERTIES.java<|end_file_name|><|fim▁begin|>/** * NativeFmod Project * * Want to use FMOD API (www.fmod.org) in the Java language ? NativeFmod is made for you. * Copyright © 2004-2007 Jérôme JOUVIE (Jouvieje) * * Created on 28 avr. 2004 * @version NativeFmod v3.4 (for FMOD ...
StructureJNI
<|file_name|>no_1109_corporate_flight_bookings.rs<|end_file_name|><|fim▁begin|>pub fn corp_flight_bookings(bookings: Vec<Vec<i32>>, n: i32) -> Vec<i32> { let mut answer = vec![0; n as usize]; <|fim▁hole|> answer[booking[1] as usize] -= booking[2]; } } let mut sum = 0; for a in answer...
for booking in bookings { answer[booking[0] as usize - 1] += booking[2]; if booking[1] < n {
<|file_name|>storage_client.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- # FOGLAMP_BEGIN # See: http://foglamp.readthedocs.io/ # FOGLAMP_END """ Storage layer python client """ __author__ = "Praveen Garg, Amarendra K Sinha" __copyright__ = "Copyright (c) 2017 OSIsoft, LLC" __license__ = "Apache 2.0" __ver...
<|file_name|>test_numa_topology_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 # # Un...
self.assertTrue(self.filt_cls.host_passes(host, filter_properties)) def test_numa_topology_filter_fail_fit(self):
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|># Copyright (C) 2014 Rémi Bèges<|fim▁hole|> from distantio.DistantIO import DistantIO from distantio.DistantIOProtocol import distantio_protocol from distantio.SerialPort import SerialPort from distantio.crc import crc16<|fim▁end|>
# For conditions of distribution and use, see copyright notice in the LICENSE file
<|file_name|>servicesNotificacoes.js<|end_file_name|><|fim▁begin|>angular.module('abastecimentoApp.servicesNotificacoes', []).factory('Notificacao', function ($resource, $http, constantService) { return { query: query,<|fim▁hole|> get:get } function query(callback) { $http.get(consta...
<|file_name|>obligations.rs<|end_file_name|><|fim▁begin|>// Copyright 2012-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.or...
//! but it adds a bit of heuristics on top, in particular to deal with
<|file_name|>calc.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/. */ //! [Calc expressions][calc]. //! //! [calc]: https://drafts.css...
.map_err(|()| location.new_custom_error(StyleParseErrorKind::UnspecifiedError))
<|file_name|>index.js<|end_file_name|><|fim▁begin|>// external imports import axios from 'axios' import { Base64 } from 'js-base64' import path from 'path' import fm from 'front-matter' // local imports import zipObject from '../zipObject' import decrypt from '../decrypt' /** 从github调用并在本地缓存期刊内容,返回Promise。主要函数: * get...
// parse responce, returns an object
<|file_name|>meshopt-compression.ts<|end_file_name|><|fim▁begin|>import { Accessor, Buffer, BufferUtils, Extension, GLB_BUFFER, GLTF, PropertyType, ReaderContext, WriterContext } from '@gltf-transform/core'; import { EncoderMethod, MeshoptBufferViewExtension, MeshoptFilter } from './constants'; import { EXT_MESHOPT_COM...
<|file_name|>utils.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python <|fim▁hole|>from fabric.api import prompt def confirm(message): """ Verify a users intentions. """ answer = prompt(message, default="Not at all") if answer.lower() not in ('y', 'yes', 'buzz off', 'screw you'): exit() ...
import boto from boto.s3.connection import OrdinaryCallingFormat
<|file_name|>05-layout.py<|end_file_name|><|fim▁begin|>import os, sys sys.path.insert(0, os.path.join("..","..")) from nodebox.graphics import * from nodebox.gui.controls import * # Comparison between Rows and Row containers. # Both are subclasses of Layout. # Panel 1 # Controls in a Rows layout are drawn below eac...
canvas.append(panel1)
<|file_name|>libstdc++.a-gdb.py<|end_file_name|><|fim▁begin|># -*- python -*- # Copyright (C) 2009-2013 Free Software Foundation, Inc. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either ver...
<|file_name|>row_polymorphism.rs<|end_file_name|><|fim▁begin|>use gluon::{ vm::api::{FunctionRef, Hole, OpaqueValue}, Thread, ThreadExt, }; use crate::support::make_vm; #[macro_use] mod support; test_expr! { polymorphic_field_access, r#" let f record = record.x f { y = 1, x = 123 } "#, 123 } test_expr! { po...
122 }
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- # # Copyright (C) 2007 Ralph Eisenbach # # This plugin is based on the plugin for ZoomPlayer # by Lars-Peter Voss <bitmonster@eventghost.net> # # This file is a plugin for EventGhost. # Copyright © 2005-2020 EventGhost Project <http://www.eve...
<|file_name|>target-action-test.js<|end_file_name|><|fim▁begin|>import { assign } from '@ember/polyfills'; import { moduleFor, RenderingTest, ApplicationTest } from '../../utils/test-case'; import { strip } from '../../utils/abstract-test-case'; import { set, Mixin } from '@ember/-internals/metal'; import { Component }...
assert.equal(actionContext, 'top with nested no controller');
<|file_name|>conf.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python # -*- coding: utf-8 -*- # # face_recognition documentation build configuration file, created by # sphinx-quickstart on Tue Jul 9 22:26:36 2013. # # This file is execfile()d with the current directory set to its # containing dir. # # Note that not ...
<|file_name|>inprocess.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::webgl_thread::{WebGLThread, WebGLThreadInit, We...
};
<|file_name|>path_config_access.go<|end_file_name|><|fim▁begin|>package nomad import ( "context" "github.com/hashicorp/errwrap" "github.com/hashicorp/vault/logical" "github.com/hashicorp/vault/logical/framework" ) const configAccessKey = "config/access" func pathConfigAccess(b *backend) *framework.Path { retur...
return entry != nil, nil }
<|file_name|>getPartnerURL.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- # code for console Encoding difference. Dont' mind on it import sys import imp imp.reload(sys) try: sys.setdefaultencoding('UTF8') except Exception as E: pass import testValue from popbill import ClosedownService, PopbillExcep...
<|file_name|>TestConfigFile_Format.java<|end_file_name|><|fim▁begin|>package commons; import org.makagiga.commons.ConfigFile; import org.makagiga.test.AbstractEnumTest; import org.makagiga.test.Test; import org.makagiga.test.TestMethod; import org.makagiga.test.Tester; @Test(className = ConfigFile.Format.class) publi...
<|file_name|>mod.rs<|end_file_name|><|fim▁begin|>mod gameboy;<|fim▁hole|>mod cpu; pub mod mem_map; mod sound_chip; pub use self::gameboy::Gameboy;<|fim▁end|>
mod mmu;