prompt large_stringlengths 70 991k | completion large_stringlengths 0 1.02k |
|---|---|
<|file_name|>index.ts<|end_file_name|><|fim▁begin|>/// <reference path="../../../type-declarations/index.d.ts" />
import * as Phaser from 'phaser';
import { BootState } from './states/boot';
import { SplashState } from './states/splash';
import { GameState } from './states/game';
class Game extends Phaser.Game {
c... | |
<|file_name|>server.go<|end_file_name|><|fim▁begin|>// Copyright 2009 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
// HTTP server. See RFC 2616.
package http
import (
"bufio"
"bytes"
"context"
"crypto/tls"
"errors"
... | mon := months[3*(mm-1):]
return append(b, |
<|file_name|>touch-events.js<|end_file_name|><|fim▁begin|>// Copyright (c) Microsoft Corporation. All rights reserved.
// Based in part on code from Apache Ripple, https://github.com/apache/incubator-ripple<|fim▁hole|> _isMouseDown;
// NOTE: missing view, detail, touches, targetTouches, scale and rotation
function ... |
var utils = require('utils');
var _lastMouseEvent, |
<|file_name|>filter.py<|end_file_name|><|fim▁begin|>##
# Copyright (c) 2009-2017 Apple 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/lice... | |
<|file_name|>webglprogram.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/. */
// https://www.khronos.org/registry/webgl/specs/latest/1... |
Ok(())
} |
<|file_name|>resource_fixtures.py<|end_file_name|><|fim▁begin|># Copyright (C) 2018-2022 Yannick Jadoul
#
# This file is part of Parselmouth.
#
# Parselmouth 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, ei... | # (at your option) any later version.
#
# Parselmouth is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of |
<|file_name|>ErrorLogService.java<|end_file_name|><|fim▁begin|>package org.superboot.service;
import com.querydsl.core.types.Predicate;
import org.springframework.data.domain.Pageable;
import org.superboot.base.BaseException;
import org.superboot.base.BaseResponse;
/**
* <b> 错误日志服务接口 </b>
* <p>
* 功能描述:
* </p>
*/... |
/** |
<|file_name|>csv2geojson.js<|end_file_name|><|fim▁begin|>/* */
"format cjs";
(function(e){if("function"==typeof bootstrap)bootstrap("csv2geojson",e);else if("object"==typeof exports)module.exports=e();else if("function"==typeof define&&define.amd)define(e);else if("undefined"!=typeof ses){if(!ses.ok())return;ses.makeC... | for (var i = 0; i < features.length; i++) { |
<|file_name|>issue-28871.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.apache.org/lic... | // compile-pass |
<|file_name|>app.js<|end_file_name|><|fim▁begin|>//APP
var app = angular.module('PortfolioApp', ['ngRoute', 'slick']);
//ROUTING
app.config(function ($routeProvider) {
"ngInject";
$routeProvider
.when('/', {
controller: "HomeController",
templateUrl: "js/angular/views/home-view.html"
})
.when('/work/:projectI... | }]); |
<|file_name|>outbound_protocol.js<|end_file_name|><|fim▁begin|>'use strict';
<|fim▁hole|>var fs = require('fs');
var vm = require('vm');
var config = require('../config');
var path = require('path');
var util_hmailitem = require('./fixtures/util_hmailitem');
var queue_dir = pa... | require('../configfile').watch_files = false;
var vm_harness = require('./fixtures/vm_harness'); |
<|file_name|>sandbox_dns_unix.go<|end_file_name|><|fim▁begin|>// +build !windows
package libnetwork
import (
"fmt"
"io/ioutil"
"os"
"path"
"path/filepath"
log "github.com/Sirupsen/logrus"
"github.com/docker/libnetwork/etchosts"
"github.com/docker/libnetwork/resolvconf"
"github.com/docker/libnetwork/types"
)... | if err := createBasePath(dir); err != nil {
return err
} |
<|file_name|>_security_rules_operations.py<|end_file_name|><|fim▁begin|># coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
#... | 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError |
<|file_name|>mod.rs<|end_file_name|><|fim▁begin|>use crate::variants::GameContextActorInformationsVariant;
use crate::variants::GameFightFighterInformationsVariant;
use protocol_derive::{Decode, Encode};
#[derive(Clone, PartialEq, Debug, Encode, Decode)]
#[protocol(id = 5864)]
pub struct GameFightShowFighterMessage<'a... | pub base: GameFightShowFighterMessage<'a>,
}
|
<|file_name|>tools.py<|end_file_name|><|fim▁begin|># Name: tools.py
# Purpose: XRC editor, toolbar
# Author: Roman Rolinsky <rolinsky@mema.ucl.ac.be>
# Created: 19.03.2003
# RCS-ID: $Id: tools.py,v 1.12 2006/05/17 03:57:57 RD Exp $
from xxx import * # xxx imports glo... | g.tree.shift = evt.ShiftDown()
self.UpdateIfNeeded()
evt.Skip()
|
<|file_name|>work-dashboard.component.ts<|end_file_name|><|fim▁begin|>import { Component, OnInit } from '@angular/core';
import { CurrentWorkService } from '../current-work/current-work.service';
import { Work } from 'src/app/services/work/work';
import { Chapter } from 'src/app/services/chapter/chapter';
import { Work... | .subscribe(work => this.work = work);
this.currentWork.chapters |
<|file_name|>compiler.ts<|end_file_name|><|fim▁begin|>import * as debug from "debug";
import * as llvm from "llvm-node";
import * as ts from "typescript";
import {BuiltInSymbols} from "./built-in-symbols";
import {CodeGenerationDiagnostics, isCodeGenerationDiagnostic} from "./code-generation-diagnostic";
import {Defaul... | const compilationContext: CompilationContext = {
builtIns,
compilerHost: this.compilerHost,
compilerOptions: this.compilerOptions, |
<|file_name|>contact.js<|end_file_name|><|fim▁begin|>function __processArg(obj, key) {
var arg = null;
if (obj) {
arg = obj[key] || null;
delete obj[key];
}
return arg;
}
function Controller() {
function goSlide(event) {
var index = event.source.mod;
var arrViews = $... | $.__views.menu.add($.__views.__alloyId91);
$.__views.lbl3 = Ti.UI.createLabel({
text: "XOX Dealers", |
<|file_name|>introHCI.js<|end_file_name|><|fim▁begin|>'use strict';
<|fim▁hole|>})
/*
* Function that is called when the document is ready.
*/
function initializePage() {
$('.project a').click(addProjectDetails);
$('#colorBtn').click(randomizeColors);
$('#apibutton').click(getExternalApi);
}
/*
* Make an AJAX... | // Call this function when the page loads (the "ready" event)
$(document).ready(function() {
initializePage(); |
<|file_name|>decoding.rs<|end_file_name|><|fim▁begin|>use serde::de::DeserializeOwned;
use crate::algorithms::AlgorithmFamily;
use crate::crypto::verify;
use crate::errors::{new_error, ErrorKind, Result};
use crate::header::Header;
#[cfg(feature = "use_pem")]
use crate::pem::decoder::PemEncodedKey;
use crate::serializ... | let content = pem_key.as_ed_public_key()?; |
<|file_name|>urls.py<|end_file_name|><|fim▁begin|><|fim▁hole|>from django.urls import path
import users.views
urlpatterns = [
path("settings/", users.views.user_settings, name="settings"),
path("reset_token/", users.views.reset_token, name="reset_token"),
path("panel_hide/", users.views.panel_hide, name="... | |
<|file_name|>history.py<|end_file_name|><|fim▁begin|>"""Provide history manager for SCCTool."""
import json
import logging
import scctool.settings.translation
from scctool.settings import getJsonFile, idx2race, race2idx
module_logger = logging.getLogger(__name__)
_ = scctool.settings.translation.gettext
class Histo... | |
<|file_name|>cp_mgmt_address_range_facts.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Ansible module to manage Check Point Firewall (c) 2019
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the F... | author: "Or Soffer (@chkp-orso)" |
<|file_name|>epub.py<|end_file_name|><|fim▁begin|># Copyright (c) 2015, Max Fillinger <max@max-fillinger.net>
#
# Permission to use, copy, modify, and/or distribute this software for any
# purpose with or without fee is hereby granted, provided that the above
# copyright notice and this permission notice appear in all... | else:
# Handle waiting par_h if necessary (see par_heading)
try: |
<|file_name|>sggl.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python3
# Copyright 2015 Dietrich Epp.
# This file is part of SGGL. SGGL is licensed under the terms of the
# 2-clause BSD license. For more information, see LICENSE.txt.
import glgen.__main__<|fim▁hole|><|fim▁end|> | glgen.__main__.main() |
<|file_name|>submit-queue-batch.go<|end_file_name|><|fim▁begin|>/*
Copyright 2016 The Kubernetes 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-... | |
<|file_name|>paypal.py<|end_file_name|><|fim▁begin|>import paypalrestsdk
import logging
from django.contrib import messages
from django.core.urlresolvers import reverse
from django.http import HttpResponseRedirect
from django.http import HttpResponse
from settings import PAYPAL_MODE, PAYPAL_CLIENT_ID, PAYPAL_CLIENT_SE... | """
MyApp > Paypal > Create a Payment |
<|file_name|>test_qgslayoutlegend.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
"""QGIS Unit tests for QgsLayoutItemLegend.
.. note:: 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 ... | |
<|file_name|>mount.go<|end_file_name|><|fim▁begin|>/*
Copyright 2014 The Kubernetes Authors.
<|fim▁hole|>Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.... | |
<|file_name|>CCLabelTTF.cpp<|end_file_name|><|fim▁begin|>/****************************************************************************
Copyright (c) 2010-2012 cocos2d-x.org
Copyright (c) 2008-2010 Ricardo Quesada
http://www.cocos2d-x.org
Permission is hereby granted, free of charge, to any person obtaining a copy
of ... | if (m_shadowEnabled) |
<|file_name|>settings.py<|end_file_name|><|fim▁begin|>"""
Django settings for findtorun project.
Generated by 'django-admin startproject' using Django 1.11.2.
For more information on this file, see
https://docs.djangoproject.com/en/1.11/topics/settings/
For the full list of settings and their values, see
https://doc... | 'django.middleware.security.SecurityMiddleware', |
<|file_name|>build.ts<|end_file_name|><|fim▁begin|>import Future = require("fibers/future");
import { AddPlatformCommand } from "./add-platform";
export class BuildCommandBase {
constructor(protected $options: IOptions,
private $platformService: IPlatformService) { }
executeCore(args: string[], buildConfig?: IBui... | |
<|file_name|>background.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 https://mozilla.org/MPL/2.0/. */
<%namespace name="helpers" file="/helpers.mako.rs" /... | extra_gecko_values="text",
vector=True, extra_prefixes="webkit", |
<|file_name|>Typefaces.java<|end_file_name|><|fim▁begin|>package kc.spark.pixels.android.ui.assets;
import static org.solemnsilence.util.Py.map;
import java.util.Map;
import android.content.Context;
import android.graphics.Typeface;
public class Typefaces {
// NOTE: this is tightly coupled to the filenames in as... | |
<|file_name|>0003_matterattachment_link_obtained_at.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('cityhallmonitor', '0002_matter_attachments_obtained_at'),... | migrations.AddField(
model_name='matterattachment',
name='link_obtained_at',
field=models.DateTimeField(null=True), |
<|file_name|>trait-impl-different-num-params.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.<|fim▁hole|>// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
... | //
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license |
<|file_name|>postal.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
# -*- coding: utf-8 -*-
from gramfuzz.fields import *
import names
TOP_CAT = "postal"
# Adapted from https://en.wikipedia.org/wiki/Backus%E2%80%93Naur_form
# The name rules have been modified and placed into names.py
class PDef(Def):
... | |
<|file_name|>models.py<|end_file_name|><|fim▁begin|>from __future__ import unicode_literals
import re
from django.contrib.auth.models import (AbstractBaseUser, PermissionsMixin,
UserManager)
from django.core import validators
from django.core.mail import send_mail
from django.u... | message.sender = user |
<|file_name|>main.rs<|end_file_name|><|fim▁begin|>pub mod release;
use std::env::args;
use std::process::exit;
use crate::release::*;
use compat::getpid;
use config::Config;
use logger::{Level, Logger};
use networking::Server;
fn main() {
let mut config = Config::new(Logger::new(Level::Notice));
if let Some(... | exit(1);
}
} |
<|file_name|>test_Chromosome.py<|end_file_name|><|fim▁begin|>import pytest<|fim▁hole|>
@pytest.fixture
def chr1():
return Chromosome("chr1", "A" * 500000)
@pytest.fixture
def chr2():
return Chromosome("chr1", "C" * 500000)
def test_init(chr1):
assert chr1
def test_init_from_seq():
x = Chromosome("... | from locuspocus import Chromosome
|
<|file_name|>recover.go<|end_file_name|><|fim▁begin|>package emperror
import (
"errors"
"fmt"
)
// Recover accepts a recovered panic (if any) and converts it to an error (if necessary).
func Recover(r interface{}) (err error) {
if r != nil {
switch x := r.(type) {<|fim▁hole|> err = x
default:
err = fmt.Er... | case string:
err = errors.New(x)
case error: |
<|file_name|>mod.rs<|end_file_name|><|fim▁begin|>//! A buffer is a memory location accessible to the video card.
//!
//! The purpose of buffers is to serve as a space where the GPU can read from or write data to.
//! It can contain a list of vertices, indices, uniform data, etc.
//!
//! # Buffers management in glium
//... | //! # use glium::buffer::{BufferType, BufferMode}; |
<|file_name|>.eslintrc.js<|end_file_name|><|fim▁begin|>const OFF = 0;
const WARN = 1;
const ERROR = 2;
module.exports = {
extends: "../.eslintrc.js",<|fim▁hole|> "es6": true,
"node": true,
"mocha": true,
},
};<|fim▁end|> | rules: {
"max-len": [ ERROR, 100 ],
},
env: { |
<|file_name|>Fme.cc<|end_file_name|><|fim▁begin|>/*
* @BEGIN LICENSE
*
* Psi4: an open-source quantum chemistry software package
*
* Copyright (c) 2007-2021 The Psi4 Developers.
*
* The copyrights for code used from other parties are included in
* the corresponding files.
*
* This file is part of Psi4.
*
* ... | global_dpd_->buf4_init(&D, PSIF_CC_DINTS, 0, 0, 5, 0, 5, 0, "D <ij|ab>");
global_dpd_->file2_init(&tIA, PSIF_CC_OEI, 0, 0, 1, "tIA"); |
<|file_name|>BeanUtil.java<|end_file_name|><|fim▁begin|>package com.anteoy.coreJava.reflect;
import java.lang.reflect.Method;
public class BeanUtil {
/**
* ���ݱ�javaBean�������������ȡ������ֵ
*
* @param obj
* @param propertyName
* @return
*/
public static Object getValueByPropert... | }
}
} |
<|file_name|>79.cpp<|end_file_name|><|fim▁begin|># include <stdio.h>
int n;
int a[25][25];
int main()
{
while (~scanf("%d", &n)) {
int cnt = 0;
int xl = 1, yl = 1, xr = n, yr = n;<|fim▁hole|> for (int i = xl; cnt<n*n && i <= xr; ++i) a[yl][i] = ++cnt;
for (int i = yl+1; cnt<... | while (cnt < n*n) { |
<|file_name|>ITDnsTest.java<|end_file_name|><|fim▁begin|>/*
* Copyright 2016 Google LLC
*
* 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... | |
<|file_name|>path.py<|end_file_name|><|fim▁begin|>#
# Copyright (C) 2003-2022 Sébastien Helleu <flashcode@flashtux.org><|fim▁hole|>#
# This file is part of WeeChat.org.
#
# WeeChat.org is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Fr... | |
<|file_name|>lib.rs<|end_file_name|><|fim▁begin|>// Copyright © 2015, Peter Atashian
// Licensed under the MIT License <LICENSE.md>
//! FFI bindings to davclnt.
#![no_std]
#![experimental]
extern crate winapi;
use winapi::*;
extern "system" {<|fim▁hole|><|fim▁end|> | } |
<|file_name|>bitcoin_ca@valencia.ts<|end_file_name|><|fim▁begin|><?xml version="1.0" ?><!DOCTYPE TS><TS language="ca@valencia" version="2.1">
<context>
<name>AboutDialog</name>
<message>
<location filename="../forms/aboutdialog.ui" line="+14"/>
<source>About GSMcoin</source>
<translation... | <location line="+18"/>
<source>Not staking</source>
<translation type="unfinished"/>
</message> |
<|file_name|>index.js<|end_file_name|><|fim▁begin|>// @flow
import React, { Component } from 'react'
import { Helmet } from 'react-helmet'
import AlternativeMedia from './AlternativeMedia'
import ImageViewer from './ImageViewer'
import { Code, CodeBlock, Title } from '../components'
const propFn = k => {
const sty... | }`} |
<|file_name|>AccountController.js<|end_file_name|><|fim▁begin|>/**
* Module dependencies
*/
var _ = require('lodash');
var async = require('async');
var path = require('path');
var router = require('express')
.Router();
/**
* Models
*/
var Account = require('../models/Account');
var App = require('../models/A... | |
<|file_name|>concept_dicts.py<|end_file_name|><|fim▁begin|>lookup = {}
lookup = dict()
lookup = {'age': 42, 'loc': 'Italy'}
lookup = dict(age=42, loc='Italy')
print(lookup)
print(lookup['loc'])
lookup['cat'] = 'cat'
if 'cat' in lookup:
print(lookup['cat'])
class Wizard:
# This actually creates... | User(3, 'user3', 'user3@test.com'),
]
|
<|file_name|>datasource_utils.py<|end_file_name|><|fim▁begin|>import json
import maps
import traceback
from requests import get
from requests import post
from requests import put
from tendrl.commons.utils import log_utils as logger
from tendrl.monitoring_integration.grafana import constants
from tendrl.monitoring_in... |
def form_datasource_json():
config = maps.NamedDict(NS.config.data)
url = "http://" + str(config.datasource_host) + ":" \ |
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|><|fim▁hole|><|fim▁end|> | """
Tools to put to good use INE data
""" |
<|file_name|>fbclient.js<|end_file_name|><|fim▁begin|>var $ = require('common:widget/ui/jquery/jquery.js');
var UT = require('common:widget/ui/ut/ut.js');
var FBClient = {};
var TPL_CONF = require('home:widget/ui/facebook/fbclient-tpl.js');
/**
* Fackbook module init function
* @return {object} [description]
*/
var... | if(that.status.login !== 2) return false;
that.status.fold === 0 && that.foldHandle.call(that, e);
that.clickHandle($(this), "fb-mod_side_friend_cur", that.ui.panelFriend); |
<|file_name|>factories.py<|end_file_name|><|fim▁begin|>import pickle
from pueue.client.socket import connect_socket, receive_data, process_response
def command_factory(command):
"""A factory which returns functions for direct daemon communication.
This factory will create a function which sends a payload to... | """
def communicate(body={}, root_dir=None):
"""Communicate with the daemon. |
<|file_name|>util.rs<|end_file_name|><|fim▁begin|><|fim▁hole|>extern crate toml;
use std::io::prelude::*;
use std::fs::File;
use std::path::Path;
use toml::Value;
pub fn slurp_config(path: &str) -> Value {
let mut config_file = File::open(&Path::new(path)).unwrap();
let mut config_text = String::new();
l... | |
<|file_name|>transform-with-as-to-hash.js<|end_file_name|><|fim▁begin|>/**
@module ember
@submodule ember-htmlbars
*/
/**
An HTMLBars AST transformation that replaces all instances of
```handlebars
{{#with foo.bar as bar}}
{{/with}}
```
with
```handlebars
{{#with foo.bar keywordName="bar"}}
{{/wit... | b.string(keyword)
));
} |
<|file_name|>glnoise.js<|end_file_name|><|fim▁begin|>// Seriously awesome GLSL noise functions. (C) Credits and kudos go to
// Copyright (C) Stefan Gustavson, Ian McEwan Ashima Arts
// MIT License.
define(function(require, exports){
exports.permute1 = function(x){
return mod((34.0 * x + 1.0) * x, 289.0)
}
export... | var norm = isqrtT4(vec4(dot(p0,p0), dot(p1,p1), dot(p2, p2), dot(p3,p3)))
p0 *= norm.x;
p1 *= norm.y; |
<|file_name|>01-run.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python3
"""Test behaviour of the test running and the term program interaction."""
import sys
import pexpect
from testrunner import run
def _shellping(child, timeout=1):
"""Issue a 'shellping' command.
Raises a pexpect exception on failure.
... | _test_no_local_echo(child) |
<|file_name|>main.cpp<|end_file_name|><|fim▁begin|>#include <iostream><|fim▁hole|>int main()
{
try
{
Game game;
game.run();
}
catch (std::exception& e)
{
std::cout << "\nEXCEPTION: " << e.what() <<std::endl;
}
}<|fim▁end|> | #include <stdexcept>
#include "game.h"
|
<|file_name|>test_cargo_profiles.rs<|end_file_name|><|fim▁begin|>use std::env;
use std::path::MAIN_SEPARATOR as SEP;
<|fim▁hole|>use support::{project, execs};
use support::{COMPILING, RUNNING};
use hamcrest::assert_that;
fn setup() {
}
test!(profile_overrides {
let mut p = project("foo");
p = p
.file... | |
<|file_name|>notfica.js<|end_file_name|><|fim▁begin|>document.addEventListener('deviceready', ondeviceready, false);
function Notifi (){
cordova.plugins.notification.local.schedule({
id: 1,
title: "Atento!!!!!",
message: "Este evento se ha agregado a tu lista "
... | });
} |
<|file_name|>middleware.py<|end_file_name|><|fim▁begin|>try:
from hashlib import md5
except ImportError:
from md5 import md5
class ratingMiddleware(object):<|fim▁hole|> def generate_token(self, request):
raise NotImplementedError
class ratingIpMiddleware(ratingMiddleware):
def generate_token(... | def process_request(self, request):
request.rating_token = self.generate_token(request)
|
<|file_name|>Header.js<|end_file_name|><|fim▁begin|>/**
* React Starter Kit (https://www.reactstarterkit.com/)
*
* Copyright © 2014-2016 Kriasoft, LLC. All rights reserved.
*
* This source code is licensed under the MIT license found in the
* LICENSE.txt file in the root directory of this source tree.
*/
import... | <div> <i className="fa fa-upload fa-fw"></i> Server Rebooted <span className="pull-right text-muted small">4 minutes ago</span> </div>
</MenuItem> |
<|file_name|>IStatsView.ts<|end_file_name|><|fim▁begin|>
interface IStatsView {
Update(stats: StatsModel): void ;<|fim▁hole|>}<|fim▁end|> | Clear(): void ; |
<|file_name|>AudioPlayer.js<|end_file_name|><|fim▁begin|>define(['jquery', 'pubsub'], function($, pubsub) {
function AudioPlayer(audio){
this.audio = audio;
this._initSubscribe();
this.startPos = 0;
this.endPos = 0;<|fim▁hole|> AudioPlayer.prototype._initSubscribe = function() {
var self = this;
$.subscrib... | this.loopEnabled = false;
}
|
<|file_name|>SDR14_Playlist_example.py<|end_file_name|><|fim▁begin|>#
# (C)opyright 2015 Signal Processing Devices Sweden AB
#
# This script showcases in Python
# - How to connect to ADQ devices in Python
# - Upload of waveforms to the SDR14
# - Using a playlist on the SDR14
# - How to setup an acquisition of data
# - ... | define_and_upload_segments(adq_cu, adq_num, dac_id) |
<|file_name|>hooks.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python
# -*- encoding: utf-8; py-indent-offset: 4 -*-
# +------------------------------------------------------------------+
# | ____ _ _ __ __ _ __ |
# | / ___| |__ ___ ___| | __ | \/ | |/ / ... | unregister()
|
<|file_name|>test_functions_loader.py<|end_file_name|><|fim▁begin|>import unittest
from nose2 import events, loader, session
from nose2.plugins.loader import functions
from nose2.tests._common import TestCase
class TestFunctionLoader(TestCase):
def setUp(self):
self.session = session.Session()
se... | class Mod(object):
pass |
<|file_name|>clean.js<|end_file_name|><|fim▁begin|>"use strict";
var gulp = require('gulp');
var clean = require('gulp-clean');
var cleanTask = function() {
return gulp.src('dist', { read: false })
.pipe(clean());
};
gulp.task('clean', cleanTask);<|fim▁hole|>module.exports = cleanTask;<|fim▁end|> | |
<|file_name|>Gurobi_Primal_Standard.py<|end_file_name|><|fim▁begin|>'''
GNU LESSER GENERAL PUBLIC LICENSE
Version 3, 29 June 2007
Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
Everyone is permitted to copy and distribute verbatim copies
of this license document, but chang... | print '*************************************************************************' |
<|file_name|>single-number-ii.go<|end_file_name|><|fim▁begin|>package problem0137
func singleNumber(nums []int) int {<|fim▁hole|> if (num & (1 << uint(i))) > 0 {
cnt++
}
}
if cnt%3 == 1 {
ans |= 1 << uint(i)
}
}
return int(ans)
}<|fim▁end|> | var ans int32
for i := 0; i < 32; i++ {
cnt := 0
for _, num := range nums { |
<|file_name|>ptr_32_le.go<|end_file_name|><|fim▁begin|>//go:build 386 || amd64p32 || arm || mipsle || mips64p32le
// +build 386 amd64p32 arm mipsle mips64p32le<|fim▁hole|>import (
"unsafe"
)
// Pointer wraps an unsafe.Pointer to be 64bit to
// conform to the syscall specification.
type Pointer struct {
ptr unsafe.Po... |
package sys
|
<|file_name|>conf.py<|end_file_name|><|fim▁begin|><|fim▁hole|># you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the Lic... | # -*- coding: utf-8 -*-
# Copyright (C) 2020 Red Hat, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); |
<|file_name|>urls.py<|end_file_name|><|fim▁begin|>"""schmankerl URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/1.11/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpa... | |
<|file_name|>buildconfiguration.cpp<|end_file_name|><|fim▁begin|>/****************************************************************************
**
** Copyright (C) 2016 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
** This file is part of Qt Creator.
**
** Commercial License Usage
** Licensees holding ... | if (iPriority > priority) { |
<|file_name|>test_bit_manipulators.py<|end_file_name|><|fim▁begin|>from infection_monkey.utils import bit_manipulators
def test_flip_bits_in_single_byte():
for i in range(0, 256):
assert bit_manipulators.flip_bits_in_single_byte(i) == (255 - i)
def test_flip_bits():
test_input = bytes(b"ABCDEFGHIJNL... | )
assert bit_manipulators.flip_bits(test_input) == expected_output
|
<|file_name|>gcimporter_test.go<|end_file_name|><|fim▁begin|>// Copyright 2011 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package gcimporter
import (
"go/build"
"io/ioutil"
"os"
"os/exec"
"path/filepath"
"runtime"
... | got := types.ObjectString(pkg, obj)
if got != test.want {
t.Errorf("%s: got %q; want %q", test.name, got, test.want)
} |
<|file_name|>places_sidebar.rs<|end_file_name|><|fim▁begin|>// Copyright 2013-2015, The Gtk-rs Project Developers.
// See the COPYRIGHT file at the top-level directory of this distribution.
// Licensed under the MIT license, see the LICENSE file or <http://opensource.org/licenses/MIT>
//! GtkPlacesSidebar — Sidebar th... | pub fn set_local_only(&self, local_only: bool) {
unsafe { ffi::gtk_places_sidebar_set_local_only(GTK_PLACES_SIDEBAR(self.unwrap_widget()), to_gboolean(local_only)) }
} |
<|file_name|>c_tga_header.cpp<|end_file_name|><|fim▁begin|>#include "c_tga_header.h"
#include <cstring>
namespace Img {
bool TGAHeader::LoadHeader(IO::FileReader::Ptr file) {
if (file->Size() - file->Position() < 19) {
return false;
}
file->ReadFull(&IdSize, 1);
file->ReadFull(&ColorMapType, 1);
file->R... | file->ReadFull(&desc, 1); |
<|file_name|>rulerctrl.py<|end_file_name|><|fim▁begin|># --------------------------------------------------------------------------------- #
# RULERCTRL wxPython IMPLEMENTATION
#
# Andrea Gavana, @ 03 Nov 2006
# Latest Revision: 17 Aug 2011, 15.00 GMT
#
#
# TODO List
#
# 1. Any idea?
#
# For All Kind Of Prob... | |
<|file_name|>PatternCompiler.java<|end_file_name|><|fim▁begin|>/*
* Copyright 2000-2017 JetBrains s.r.o.
*
* 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/licen... |
private static class ConstantPrefixProvider implements PrefixProvider {
private final String myPrefix; |
<|file_name|>ObjectFactory.cpp<|end_file_name|><|fim▁begin|>// Torc - Copyright 2011-2013 University of Southern California. All Rights Reserved.
// $HeadURL$
// $Id$
// 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 Fr... | |
<|file_name|>remove_files.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
data = {
"default_prefix": "OSVC_COMP_REMOVE_FILES_",
"example_value": """
[
"/tmp/foo",<|fim▁hole|>""",
"description": """* Verify files and file trees are uninstalled
""",
"form_definition": """
Desc: |
A rule defining a set ... | "/bar/to/delete"
] |
<|file_name|>0009_auto__add_field_imagerevision_width__add_field_imagerevision_height.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
try:
from django.contrib.auth import get_user_model
except ImportE... | 'wiki.image': {
'Meta': {'object_name': 'Image', '_ormbases': ['wiki.RevisionPlugin']},
'revisionplugin_ptr': ('django.db.models.fields.related.OneToOneField', [], {'to': "orm['wiki.RevisionPlugin']", 'unique': 'True', 'primary_key': 'True'})
}, |
<|file_name|>.eslintrc.js<|end_file_name|><|fim▁begin|>module.exports = {
env: {
mocha: true
},
plugins: [
'mocha'
]<|fim▁hole|><|fim▁end|> | }; |
<|file_name|>hmr-reducer.js<|end_file_name|><|fim▁begin|>"use strict";
exports.hmrReducer = function (appReducer) { return function (state, _a) {
var type = _a.type, payload = _a.payload;
switch (type) {<|fim▁hole|> case 'HMR_SET_STATE': return payload;
default: return appReducer(state, { type: t... | |
<|file_name|>archive.py<|end_file_name|><|fim▁begin|>import os
import logging
import boto3
import mimetypes
from datetime import datetime
from morphium.util import env, TAG_LATEST
log = logging.getLogger(__name__)
config = {}
class Archive(object):
"""A scraper archive on S3. This is called when a scraper has g... | if access_key is None:
log.warning("No $AWS_ACCESS_KEY_ID, skipping upload.") |
<|file_name|>E-value-distribution.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python2
import sys, getopt
import re
import time
def get_option():
opts, args = getopt.getopt(sys.argv[1:], "hi:o:")
input_file = ""
output_file = ""
h = ""
for op, value in opts:
if op == "-i":
input_file = value
elif op == ... | |
<|file_name|>letters.py<|end_file_name|><|fim▁begin|>print " A BBBBBB CCCC DDDDD EEEEEEE FFFFFFF GGGG H H IIIII JJJJJJ"
print " A A B B C C D D E F G G H H I J"
print " A A B B C D D E F G H H I... | print "A A B B C C D D E F G G H H I J J"
print "A A BBBBBB CCCC DDDDD EEEEEEE F GGGG H H IIIII JJJJ" |
<|file_name|>index.d.ts<|end_file_name|><|fim▁begin|>// Type definitions for truncate-middle 1.0
// Project: https://github.com/kahwee/truncate-middle#readme
// Definitions by: Gary King <https://github.com/garyking>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
declare function truncateMiddle(tex... | |
<|file_name|>app.d.ts<|end_file_name|><|fim▁begin|><|fim▁hole|>}<|fim▁end|> | declare module "jquery-ui/datepicker" {
export = $; |
<|file_name|>pascals-triangle.rs<|end_file_name|><|fim▁begin|>extern crate pascals_triangle;
use pascals_triangle::*;
#[test]
fn no_rows() {
let pt = PascalsTriangle::new(0);
let expected: Vec<Vec<u32>> = Vec::new();
assert_eq!(expected, pt.rows());
}
#[test]
fn one_row() {
let pt = PascalsTriangle::... | assert_eq!(expected, pt.rows());
} |
<|file_name|>svn_fetch.py<|end_file_name|><|fim▁begin|>##############################################################################
# Copyright (c) 2013-2018, Lawrence Livermore National Security, LLC.
# Produced at the Lawrence Livermore National Laboratory.
#
# This file is part of Spack.
# Created by Todd Gamblin,... | # |
<|file_name|>filter.go<|end_file_name|><|fim▁begin|>package netlink
import (
"fmt"
"net"
)
type Filter interface {
Attrs() *FilterAttrs
Type() string
}
// FilterAttrs represents a netlink filter. A filter is associated with a link,
// has a handle and a parent. The root filter of a device should have a
// parent... |
type ConnmarkAction struct {
ActionAttrs |
<|file_name|>unpause.go<|end_file_name|><|fim▁begin|>package daemon
import (
derr "github.com/docker/docker/api/errors"
)
// ContainerUnpause unpauses a container
func (daemon *Daemon) ContainerUnpause(name string) error {
container, err := daemon.Get(name)
if err != nil {<|fim▁hole|> }
if err := container.unpau... | return err |
<|file_name|>mod.rs<|end_file_name|><|fim▁begin|>// Copyright 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/licenses/LI... | /// `steal` method.
pub struct Stealer<T> { |
<|file_name|>save_movie.py<|end_file_name|><|fim▁begin|>"""
Create movie from MEG inverse solution
=======================================
Data were computed using mne-python (http://martinos.org/mne)
"""
import os
import numpy as np
from surfer import Brain
from surfer.io import read_stc
print(__doc__)
"""
creat... | brain.add_data(data, colormap='hot', vertices=stc['vertices'], |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.