prompt large_stringlengths 70 991k | completion large_stringlengths 0 1.02k |
|---|---|
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
# Copyright 2016 ACSONE SA/NV (<http://acsone.eu>)<|fim▁hole|># License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from . import mass_mailing_stats<|fim▁end|> | |
<|file_name|>dump_post_data.py<|end_file_name|><|fim▁begin|>from plugins.extension.plugin import PluginTemplate
from mitmproxy.models import decoded
from PyQt4.QtCore import QObject,pyqtSignal
import re
"""
Description:
This program is a core for wifi-pumpkin.py. file which includes functionality
plugins for P... | Copyright (C) 2015-2016 Marcos Nesster P0cl4bs Team |
<|file_name|>classMethods.ts<|end_file_name|><|fim▁begin|>class A {
<|fim▁hole|> a(): void {
}
b(a: string): number {
return 0;
}
}<|fim▁end|> | |
<|file_name|>stackedsplinearea.d.ts<|end_file_name|><|fim▁begin|>/*!
* devextreme-angular
* Version: 16.2.5
* Build date: Tue Feb 28 2017
*
* Copyright (c) 2012 - 2017 Developer Express Inc. ALL RIGHTS RESERVED
*
* This software may be modified and distributed under the terms
* of the MIT license. See the LICEN... | export declare class DxoStackedsplineareaComponent extends DxoChartCommonSeriesSettings {
protected readonly _optionPath: string;
constructor(parentOptionHost: NestedOptionHost, optionHost: NestedOptionHost); |
<|file_name|>0066_issue_force_free_access.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
# Generated by Django 1.10.4 on 2017-02-20 22:01
from __future__ import unicode_literals
from django.db import migrations, models
<|fim▁hole|> ('erudit', '0065_auto_20170202_1152'),
]
operations = [
... | class Migration(migrations.Migration):
dependencies = [ |
<|file_name|>config_nmta.py<|end_file_name|><|fim▁begin|>from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from keras.optimizers import SGD
from keras.optimizers import Adam
from keras.optimizers import adadelta
from keras.optimizers import rmsprop
from keras.... | NB_EPOCHS_GAN = 0 |
<|file_name|>CollectionRightsObjectFactory.ts<|end_file_name|><|fim▁begin|>// Copyright 2016 The Oppia Authors. All Rights Reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// ... |
export class CollectionRights { |
<|file_name|>tunnels.py<|end_file_name|><|fim▁begin|># coding=utf-8
#
# Copyright 2016 F5 Networks Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/L... | self._meta_data['required_creation_parameters'].update(('partition',)) |
<|file_name|>index.d.ts<|end_file_name|><|fim▁begin|>// Type definitions for tiny-async-pool 1.0
// Project: https://github.com/rxaviers/async-pool#readme
// Definitions by: Karl-Philipp Wulfert <https://github.com/krlwlfrt>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
/**
* This declaration spe... | *
* @template IN Type of the input array
* @template OUT Type of the resolves of the promises |
<|file_name|>context.rs<|end_file_name|><|fim▁begin|>use alloc::arc::Arc;
use alloc::boxed::Box;
use collections::{BTreeMap, Vec};
use spin::Mutex;
use arch;
use context::file::File;
use context::memory::{Grant, Memory, SharedMemory, Tls};
use syscall::data::Event;
use sync::{WaitMap, WaitQueue};
#[derive(Copy, Clone... | |
<|file_name|>artifacts.py<|end_file_name|><|fim▁begin|>import re
from django import template
from django.template.loader import get_template<|fim▁hole|>
INSTALLED_ARTIFACTS = dict()
def install(artifact_class):
INSTALLED_ARTIFACTS[artifact_class.key] = artifact_class
def find(data):
from fir_artifacts.mode... | from django.template import RequestContext
register = template.Library() |
<|file_name|>testlibbind_ns_msg.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
#
# testlibbind_ns_msg.py - Unit tests for the libbind ns_msg wrapper
#
# This file is part of Strangle.
#
# Strangle is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as pu... | assert(type(n) is libbind.ns_msg)
def suite(): |
<|file_name|>0013_auto_20180516_1559.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
# Generated by Django 1.11.13 on 2018-05-16 18:59
from __future__ import unicode_literals
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('core', '0012_auto_20180227_085... | options={'ordering': ('first_name', 'last_name'), 'permissions': (('menu_dados_auxiliares', 'Mostrar Menu Dados Auxiliares'), ('menu_tabelas_auxiliares', 'Mostrar Menu de Tabelas Auxiliares'), ('menu_contatos', 'Mostrar Menu de Cadastro de Contatos'), ('menu_grupocontatos', 'Mostrar Menu de Cadastro de Grup... |
<|file_name|>dto.rs<|end_file_name|><|fim▁begin|>use game_status::PlayerName;
use card::Card;
use card::Suit;
use card::dto::CardDto;
use deal::Deal;
use deal::DealCard;
use error::Error;
use error::Result;
use std::convert::TryFrom;
use std::str::FromStr;
#[derive(Serialize, Deserialize, Debug)]
pub struct DealDto {... | impl<'a> From<&'a DealCard> for DealCardDto { |
<|file_name|>envelope.rs<|end_file_name|><|fim▁begin|>//! Envelope function used by sounds 1, 2 and 4
use spu::{Sample, SOUND_MAX};
#[derive(Clone,Copy)]
pub struct Envelope {
direction: EnvelopeDirection,
volume: Volume,
step_duration: u32,
counter: u32,
}
impl Envelope {
pub fn... | fn up(&mut self) {
let Volume(v) = *self; |
<|file_name|>connect.spec.local.js<|end_file_name|><|fim▁begin|>// this will only run locally to test the connection to foursquare
import chai from 'chai';
import chaiAsPromised from 'chai-as-promised';
import FoursquareConnection from './connect';
import config from 'config';
import nock from 'nock';
chai.should();
... | const connect = new FoursquareConnection(config.get('venues.api.foursquare.url'), {clientId: config.get('venues.api.foursquare.clientId'), clientSecret: config.get('venues.api.foursquare.clientSecret')}, config.get('venues.api.foursquare.version'));
|
<|file_name|>rlperrors.rs<|end_file_name|><|fim▁begin|>// Copyright 2015, 2016 Ethcore (UK) Ltd.
// This file is part of Parity.
// Parity is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of... |
// You should have received a copy of the GNU General Public License |
<|file_name|>utilities.js<|end_file_name|><|fim▁begin|>function Vec2(_x, _y) {
var self = this;
self.x = _x;
self.y = _y;
self.Distance = function (OtherPoint) {
try {
return Math.sqrt(Math.pow(OtherPoint.x - self.x, 2) + Math.pow(OtherPoint.y - self.y, 2));
} catch (e) {
... | |
<|file_name|>api_backend_service.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
#
# Copyright 2007 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache... | |
<|file_name|>dictionary_predictor.cc<|end_file_name|><|fim▁begin|>// Copyright 2010-2021, Google Inc.
// 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 c... | SetTypesAndTokenAttributes(types, token.attributes);
key = token.key;
value = token.value;
wcost = token.cost; |
<|file_name|>dns-pcap-to-csv.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python2
#
# Copyright 2016 Philipp Winter <phw@nymity.ch>
#
# 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... |
import sys
import scapy.all as scapy |
<|file_name|>beginning_test.go<|end_file_name|><|fim▁begin|>package datedsl
import (
"testing"
"time"
"github.com/stretchr/testify/assert"
)
func TestBeginningOfSecond(t *testing.T) {
value := New(parse("Fri Jul 17 10:13:59 MST 2015")).BeginningOfSecond()
expected := parse("Fri Jul 17 10:13:59 MST 2015")
asser... |
func TestBeginningOfMinute(t *testing.T) {
value := New(parse("Fri Jul 17 10:13:59 MST 2015")).BeginningOfMinute() |
<|file_name|>c1_LIRAssembler.cpp<|end_file_name|><|fim▁begin|>/*
* Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU Gener... | s->print_name(&st);
st.print(" slow case"); |
<|file_name|>provinces_script.py<|end_file_name|><|fim▁begin|># coding: utf-8
import sys
reload(sys)<|fim▁hole|>sys.setdefaultencoding('utf-8')
import json
china = json.loads(open('china.json', 'r').read()) # slow
new_provs = []
new_citys = []
for prov in china['children']:
new_provs.append(prov['name'])
fo... | |
<|file_name|>test_local_align.py<|end_file_name|><|fim▁begin|>import six
from unittest import TestCase
from dark.reads import Read
from dark.local_align import LocalAlignment
class TestLocalAlign(TestCase):
"""
Test the LocalAlignment class.
With match +1, mismatch -1, gap open -1, gap extend -1 and
... | When two identical sequences are given, the result should |
<|file_name|>testText.ts<|end_file_name|><|fim▁begin|>import {delay} from './delay'
import { Laya } from 'Laya';
import { Text } from 'laya/display/Text';
import { TextRender } from 'laya/webgl/text/TextRender';
export class Main {
constructor() {
Laya.init(800,600);
//Laya.stage.scaleMode = 'fixedwidth';
... | t2.color='red';
Laya.stage.addChild(t2);
|
<|file_name|>convert-ps3-output.py<|end_file_name|><|fim▁begin|>import os
import sys
def main():
if len(sys.argv) <= 2:
print("This script generates the .expected file from your PS3's debug logs.")
print("")
print("Usage: convert-ps3-output.py <input> <output>")
print("Example: co... |
f = open(inputFile, 'rb')
w = open(outputFile, 'wb')
|
<|file_name|>Message.spec.js<|end_file_name|><|fim▁begin|>import React from 'react';
import { render as mount } from 'enzyme';
import { Provider as ContextProvider } from '../common/context';
import Message from './Message';
describe('Message', () => {
function render(message, context) {
// need the spans other... | |
<|file_name|>keyboardevent.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/. */
use dom::bindings::cell::DOMRefCell;
use dom::bindings:... | Key::LeftControl | Key::RightControl => 17,
Key::LeftAlt | Key::RightAlt => 18,
Key::CapsLock => 20,
Key::Escape => 27, |
<|file_name|>tests.py<|end_file_name|><|fim▁begin|>import django
django.setup()
from django.test import TestCase
from rest_framework import status
from rest_framework.test import APITestCase
from rest_framework.test import APIClient
from customers.models import Customer, Email
class CustomersTest(APITestCase, TestCa... | customer = self.get_default_customer()
response = self.client.post('/api/customers', customer, format='json')
self.assertEqual(response.status_code, status.HTTP_400_BAD_REQUEST) |
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|>'''
salt.utils
~~~~~~~~~~
'''
<|fim▁hole|> meant to be used for lazy evaluation of an object attribute.
property should represent non-mutable data, as it replaces itself.
http://stackoverflow.com/a/6849299/564003
'''
def __init__(self, fget... | class lazy_property(object):
''' |
<|file_name|>regress-465980-02.js<|end_file_name|><|fim▁begin|>/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* ***** BEGIN LICENSE BLOCK *****
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Mozilla Public License Version
* 1.1 (the "License");... | expectLength);
}
if (!expectThrow)
{ |
<|file_name|>BlockCombustionEngine.java<|end_file_name|><|fim▁begin|>package com.plutomc.power.common.blocks;
import com.plutomc.core.common.blocks.BlockMetal;
import com.plutomc.power.Power;
import com.plutomc.power.common.tileentities.TileEntityCombustionEngine;
import com.plutomc.power.init.BlockRegistry;
import co... | |
<|file_name|>update_pt_data.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
'''
Developer script to convert yaml periodic table to json format.
Created on Nov 15, 2011
'''
from __future__ import division
import json
import ruamel.yaml as yaml
import re
__author__ = "Shyue Ping Ong"
__copyright__ = "Copyright 2... | |
<|file_name|>files.js<|end_file_name|><|fim▁begin|>import { apiGet, apiPut, apiDelete } from 'utils/api'
import { flashError, flashSuccess } from 'utils/flash'
import { takeLatest, takeEvery, call, put, select } from 'redux-saga/effects'
import { filter, find, without, omit } from 'lodash'
import { filesUrlSelector } ... | |
<|file_name|>example0.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python3
import threading
def worker():<|fim▁hole|>
for i in range(8):
threading.Thread(target = worker).start()<|fim▁end|> | print('new worker') |
<|file_name|>time_dis_cnn.py<|end_file_name|><|fim▁begin|>"""
Multiple stacked lstm implemeation on the lip movement data.
Akm Ashiquzzaman
13101002@uap-bd.edu
Fall 2016
"""
from __future__ import print_function
import numpy as np
np.random.seed(1337)
#random seed fixing for reproducibility
#data load & preprocessin... |
#normalizing data |
<|file_name|>bitcoinunits.cpp<|end_file_name|><|fim▁begin|>#include "bitcoinunits.h"
#include <QStringList>
BitcoinUnits::BitcoinUnits(QObject *parent):
QAbstractListModel(parent),
unitlist(availableUnits())
{
}
QList<BitcoinUnits::Unit> BitcoinUnits::availableUnits()
{
QList<BitcoinUnits::Unit> ... |
QVariant BitcoinUnits::data(const QModelIndex &index, int role) const
{
int row = index.row(); |
<|file_name|>base.py<|end_file_name|><|fim▁begin|>from decimal import Decimal
map_ones = {
0: "",
1: "One",
2: "Two",
3: "Three",
4: "Four",
5: "Five",
6: "Six",
7: "Seven",
8: "Eight",
9: "Nine",
}
map_tens = {
10: "Ten",
11: "Eleven",
12: "Twelve",
13: "Thirte... | num = str(int(num) - one_num)
hundredth, tenth, one = extract(str(one_num))
word += "{0} ".format(get_one(hundredth, tenth, one))
return word |
<|file_name|>ServletContainerInitializerImpl.java<|end_file_name|><|fim▁begin|>package com.example;
import java.util.Set;
<|fim▁hole|>import javax.servlet.ServletException;
import javax.servlet.ServletRegistration;
import org.springframework.web.context.support.AnnotationConfigWebApplicationContext;
import org.spring... | import javax.servlet.ServletContainerInitializer;
import javax.servlet.ServletContext; |
<|file_name|>prototype.js<|end_file_name|><|fim▁begin|>/* Prototype JavaScript framework, version 1.6.0
* (c) 2005-2007 Sam Stephenson
*
* Prototype is freely distributable under the terms of an MIT-style license.
* For details, see the Prototype web site: http://www.prototypejs.org/
*
*----------------------... |
var Abstract = { };
|
<|file_name|>test-system.js<|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/. */
"use strict";
const runtime = require("sdk/system/runtime... | |
<|file_name|>CacheableStatement.java<|end_file_name|><|fim▁begin|>package com.tesora.dve.sql.statement;
/*
* #%L
* Tesora Inc.
* Database Virtualization Engine
* %%
* Copyright (C) 2011 - 2014 Tesora Inc.
* %%
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GN... | * as published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
<|file_name|>models.py<|end_file_name|><|fim▁begin|>from django.db import models
from botManager.models import Bot<|fim▁hole|>
class Activist(models.Model):
identifier = models.CharField(max_length=200)
name = models.CharField(max_length=200)
username = models.CharField(max_length=200)
reg_date = mode... | |
<|file_name|>bgp_router_test.py<|end_file_name|><|fim▁begin|># Copyright (C) 2015 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... | |
<|file_name|>getDetail.py<|end_file_name|><|fim▁begin|># -*- coding:utf-8 -*-
#html_doc = '''<div><a href="http://www.weblio.jp/content/%E5%BD%A2%E5%AE%B9%E5%8B%95%E8%A9%9E" title="形容動詞の意味" class=crosslink>形容動詞</a>「<a href="http://www.weblio.jp/content/%E3%82%A2%E3%83%BC%E3%83%86%E3%82%A3%E3%83%95%E3%82%A3%E3%82%B7%E3%... | |
<|file_name|>test-Hex to Safe Color.js<|end_file_name|><|fim▁begin|>munit( 'Rule Compression.Hex to Safe Color', function( assert ) {
assert.exists( "Table", CSSCompressor.tables[ 'Hex to Safe Color' ] );
testRule( assert, 'Hex to Safe Color', [
{
name: 'Basic',
actual: '#000080',
expected: 'navy'
},
... | expected: undefined
}, |
<|file_name|>getcmdbinfo.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python<|fim▁hole|>
#auth: asher
#date: 20171027
#purpose: get usefulinfo from jsonfile
import ConfigParser
import time
import datetime
import requests
import fileinput
import sys
import os
import codecs
import json
import getWarranty
reload(sys)
sys.s... | #coding: utf-8 |
<|file_name|>cli-inst-interactive.rs<|end_file_name|><|fim▁begin|>//! Tests of the interactive console installer
pub mod mock;
use crate::mock::clitools::{
self, expect_ok, expect_stderr_ok, expect_stdout_ok, set_current_dist_date, this_host_triple,
Config, SanitizedOutput, Scenario,
};
use crate::mock::{get_... | |
<|file_name|>static-module.module.ts<|end_file_name|><|fim▁begin|>import {
StarRatingModule,
StarRatingConfigService,
} from '@angular-star-rating-lib/angular-star-rating';
import { CommonModule } from '@angular/common';
import { NgModule } from '@angular/core';
import { RouterModule } from '@angular/router';
impor... | CommonModule,
StarRatingModule.forChild(), |
<|file_name|>french.py<|end_file_name|><|fim▁begin|>import sys
from .space_delimited import SpaceDelimited
try:
from nltk.stem.snowball import SnowballStemmer
stemmer = SnowballStemmer("french")
except ValueError:
raise ImportError("Could not load stemmer for {0}. ".format(__name__))
try:
from nltk.c... | .. autoattribute:: parent_revision.infonoise
diff |
<|file_name|>Mailer.js<|end_file_name|><|fim▁begin|>import { sendMail } from '../functions/sendMail';
import { unsubscribe } from '../functions/unsubscribe';
export const Mailer = {
sendMail,<|fim▁hole|><|fim▁end|> | unsubscribe,
}; |
<|file_name|>OioOioSocketCompatibleObjectStreamEchoTest.java<|end_file_name|><|fim▁begin|>/*
* Copyright 2012 The Netty Project
*
* The Netty Project licenses this file to you under the Apache License,
* version 2.0 (the "License"); you may not use this file except in compliance
* with the License. You may obtain ... |
import org.jboss.netty.channel.ChannelFactory;
import org.jboss.netty.channel.socket.oio.OioClientSocketChannelFactory; |
<|file_name|>loop.js<|end_file_name|><|fim▁begin|>import {stats} from './stats.js';
import {core} from './core.js';
import {tasks} from './tasks.js';
const scenesRenderInfo = {}; // Used for throttling FPS for each Scene
const tickEvent = {
sceneId: null,
time: null,
startTime: null,
prevTime: null,
... | * @param {Number} time The time in seconds since 1970 of this "tick" event.
* @param {Number} prevTime The time of the previous "tick" event from this Scene.
* @param {Number} deltaTime The time in seconds since the previous "tick" event from this Scene. |
<|file_name|>test.splitRange.js<|end_file_name|><|fim▁begin|><|fim▁hole|>/**
* Created by tushar.mathur on 26/01/16.
*/
'use strict'
import test from 'ava'
import splitRange from '../src/splitRange'
test((t) => {
t.same(splitRange(100, 2), [[0, 49], [50, 100]])
t.same(splitRange(100, 3), [[0, 32], [33, 65], [66... | |
<|file_name|>dates.py<|end_file_name|><|fim▁begin|>import logging
from datetime import datetime
from django import template
from django.utils import timezone
register = template.Library()
logger = logging.getLogger(__name__)
@register.filter(expects_localtime=True)
def fuzzy_time(time):
"""Formats a `datetime.t... | now = timezone.localtime() |
<|file_name|>AccountDetailMarshaller.java<|end_file_name|><|fim▁begin|>/*
* Copyright 2017-2022 Amazon.com, Inc. or its affiliates. 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. A copy of the License is lo... | public void marshall(AccountDetail accountDetail, ProtocolMarshaller protocolMarshaller) { |
<|file_name|>hostname.rs<|end_file_name|><|fim▁begin|>use std::borrow::Cow;
use into_cow::IntoCow;
use config::Config;
use nix;
pub struct Hostname<'a> {
hostname: Cow<'a, str>,
}
impl<'a> Hostname<'a> {
pub fn new<H: IntoCow<'a, str>>(hostname: H) -> Self {
Hostname {
hostname: hostname.i... | }
|
<|file_name|>angular-resource.js<|end_file_name|><|fim▁begin|>/**
* @license AngularJS v1.6.10
* (c) 2010-2018 Google, Inc. http://angularjs.org
* License: MIT
*/
(function(window, angular) {'use strict';
var $resourceMinErr = angular.$$minErr('$resource');
// Helper functions and regex to lookup a dotted path on... | *
* Use `$resourceProvider` to change the default behavior of the {@link ngResource.$resource} |
<|file_name|>background.js<|end_file_name|><|fim▁begin|>/**
* Copyright (c) 2015-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in... | |
<|file_name|>inherited_table.mako.rs<|end_file_name|><|fim▁begin|>/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
<%namespace name="helpers" file="/helpers.mako.r... | |
<|file_name|>ServiceInfo.py<|end_file_name|><|fim▁begin|>from Components.HTMLComponent import HTMLComponent
from Components.GUIComponent import GUIComponent
from Screen import Screen
from Components.ActionMap import ActionMap
from Components.Label import Label
from ServiceReference import ServiceReference
from enigma i... | frontendData = ConvertToHumanReadable(frontendDataOrg)
if frontendDataOrg["tuner_type"] == "DVB-S":
return ((_("NIM"), chr(ord('A') + frontendData["tuner_number"]), TYPE_TEXT),
(_("Type"), frontendData["tuner_type"], TYPE_TEXT), |
<|file_name|>procurement.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from psycopg2 import OperationalError
from odoo import api, fields, models, registry, _
from odoo.exceptions import UserError
import odoo.addons.decimal_precisio... | """ Finds UoM of changed product. """
if self.product_id: |
<|file_name|>config.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-<|fim▁hole|>from ruamel.yaml import YAML
from six import iteritems
_required = ['server']
class Config(object):
def __init__(self, configFile):
self.configFile = configFile
self._configData = {}
self.yaml = YAML()... |
import copy |
<|file_name|>Autocomplete.java<|end_file_name|><|fim▁begin|>package site;
public class Autocomplete {
<|fim▁hole|>
public Autocomplete(String label, String value) {
this.label = label;
this.value = value;
}
public final String getLabel() {
return this.label;
}
public final String getValue() {
... | private final String label;
private final String value; |
<|file_name|>gels.hpp<|end_file_name|><|fim▁begin|>#ifndef NT2_LINALG_INCLUDE_FUNCTIONS_SCALAR_GELS_HPP_INCLUDED
#define NT2_LINALG_INCLUDE_FUNCTIONS_SCALAR_GELS_HPP_INCLUDED<|fim▁hole|>#include <nt2/linalg/functions/gels.hpp>
#endif<|fim▁end|> | |
<|file_name|>main.rs<|end_file_name|><|fim▁begin|>use std::env;
use std::process;
use minigrep::Config;
fn main() {
let args: Vec<String> = env::args().collect();
let config = Config::new(&args).unwrap_or_else(|err| {
eprintln!("Problem parsing arguments: {}", err);
process::exit(1);
});
... | }
} |
<|file_name|>exceptions.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
"""
rdd.exceptions
~~~~~~~~~~~~~~
This module contains the exceptions raised by rdd.
"""
from requests.exceptions import *
class ReadabilityException(RuntimeError):
"""Base class for Readability exceptions."""
<|fim▁hole|>
class S... | |
<|file_name|>Helpers.cpp<|end_file_name|><|fim▁begin|>#include "ofxCv/Helpers.h"
#include "ofxCv/Utilities.h"
namespace ofxCv {
using namespace cv;
ofMatrix4x4 makeMatrix(Mat rotation, Mat translation) {
Mat rot3x3;
if(rotation.rows == 3 && rotation.cols == 3) {
rot3x3 = rotation;
} else {
Rodrigues(ro... | curEpsilon = (maxEpsilon + minEpsilon) / 2;
} |
<|file_name|>util.go<|end_file_name|><|fim▁begin|>// Copyright 2018 The OpenSDS 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-2... | if strings.HasPrefix(proto, "unix") { |
<|file_name|>ConfigLauncherGUI.java<|end_file_name|><|fim▁begin|>package com.tle.configmanager;
import com.dytech.gui.ComponentHelper;
import com.thoughtworks.xstream.XStream;
import com.tle.common.Check;
import java.awt.Container;
import java.awt.Dimension;
import java.awt.event.ActionEvent;
import java.awt.event.Act... | contents.add(btnEdit, "growx, center");
contents.add(btnDelete, "growx, center");
contents.add(sep, "growx, spanx 3");
contents.add(btnApply, "center, growx, spanx 3"); |
<|file_name|>node-package-manager.ts<|end_file_name|><|fim▁begin|>import Future = require("fibers/future");
import * as npm from "npm";
interface INpmOpts {
config?: any;
subCommandName?: string;
path?: string;<|fim▁hole|>export class NodePackageManager implements INodePackageManager {
constructor(private $childPr... | }
|
<|file_name|>htmlappletelement.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/. */
use dom::attr::AttrValue;
use dom::bindings::codege... | htmlelement: HTMLElement |
<|file_name|>AsyncTask.java<|end_file_name|><|fim▁begin|>/*******************************************************************************
* This file is part of OpenNMS(R).
*
* Copyright (C) 2007-2014 The OpenNMS Group, Inc.
* OpenNMS(R) is Copyright (C) 1999-2014 The OpenNMS Group, Inc.
*
* OpenNMS(R) is a regis... | } |
<|file_name|>ActionFactory.java<|end_file_name|><|fim▁begin|>package beseenium.controller.ActionFactory;
/** Copyright(C) 2015 Jan P.C. Hanson & BeSeen Marketing Ltd
*
* 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... | import beseenium.controller.ActionFactory.elementActions.MakeClear;
import beseenium.controller.ActionFactory.elementActions.MakeClick;
import beseenium.controller.ActionFactory.elementActions.MakeGetAttribute; |
<|file_name|>configrb.go<|end_file_name|><|fim▁begin|>package libclc
import (
"text/template"
"bufio"
)
<|fim▁hole|> return WriteTemplate("crb", config, t, path)
}
func BufferConfigrb(config *Configrb, t *template.Template, w *bufio.Writer) (error) {
return BufferTemplate("crb", config, t, w)
}<|fim▁end|> | type Configrb struct {
}
func WriteConfigrb(config *Configrb, t *template.Template, path string) (error) { |
<|file_name|>conf.py<|end_file_name|><|fim▁begin|>import os
import runpy
# If extensions (or modules to document with autodoc) are in another directory,
# add these directories to sys.path here. If the directory is relative to the
# documentation root, use os.path.abspath to make it absolute, like shown here.
#sys.pat... | |
<|file_name|>Entity.js<|end_file_name|><|fim▁begin|>//#include 'debug.js'
//#include 'Image.js'
//#include 'path/Ellipse.js'
//#include 'path/Path.js'
//#include 'path/Point.js'
//#include 'path/Rect.js'
//#include 'Tokenizer.js'
var CanvizEntity = exports.CanvizEntity = function(defaultAttrHashName, name, canviz, roo... | break;
case 'C': // set fill color
case 'c': // set pen color
var fill = ('C' == token); |
<|file_name|>master_taskloop_simd_lastprivate_messages.cpp<|end_file_name|><|fim▁begin|>// RUN: %clang_cc1 -verify=expected,omp45 -fopenmp-version=45 -fopenmp %s -Wuninitialized
// RUN: %clang_cc1 -verify=expected,omp50 -fopenmp-version=50 -fopenmp %s -Wuninitialized
// RUN: %clang_cc1 -verify=expected,omp45 -fopenmp-... | foo();
#pragma omp parallel
#pragma omp master taskloop simd lastprivate(argc, // expected-error {{expected expression}} expected-error {{expected ')'}} expected-note {{to match this '('}} |
<|file_name|>Ghosts.py<|end_file_name|><|fim▁begin|>from MakeGraph import MakeGraph
from Moving_pacman import PacMan
import pygame
class Ghost(MakeGraph):
index = 0
def __init__(self,class_graph,x,y):
Ghost.index = Ghost.index + 1
self.all_nodes = class_graph.get_nodes()
self.paths_to_all_nodes = class_gr... | |
<|file_name|>mq_handler.rs<|end_file_name|><|fim▁begin|>// Copyright Cryptape Technologies 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/LICENS... | |
<|file_name|>Player.js<|end_file_name|><|fim▁begin|>import React, {Component} from 'react';
import {bindActionCreators} from 'redux';
import {connect} from 'react-redux';
import {initialPlay, nextTrack, togglePlaying} from 'redux/modules/player';
import {starTrack, unstarTrack} from 'redux/modules/starred';
import {isT... | <div className={[styles['btn'], styles['btn--skip']].join(' ')} onClick={this.handleNextTrack}>
<div className={styles['btnIcon']}></div> |
<|file_name|>floor.rs<|end_file_name|><|fim▁begin|>use malachite_base::num::arithmetic::traits::{DivRound, DivRoundAssign, Floor, FloorAssign};
use malachite_base::num::basic::traits::One;
use malachite_base::rounding_modes::RoundingMode;
use malachite_nz::integer::Integer;
use malachite_nz::natural::Natural;
use std::... | |
<|file_name|>Tile.ts<|end_file_name|><|fim▁begin|>import Point from "esri/geometry/Point";
import Graphic from "esri/Graphic";
import { quantizePoint } from "../common/quantizationUtils";
import TileBase from "../common/TileBase";<|fim▁hole|>
// ------------------------------------------------------------------------... | import { IPoint, QuantizationTransform, TileData, TileInfo } from '../interfaces';
export default class Tile extends TileBase { |
<|file_name|>s_pcap.py<|end_file_name|><|fim▁begin|>import dpkt
import socket
import logging
l = logging.getLogger("simuvex.s_pcap")
class PCAP(object):
def __init__(self,path, ip_port_tup, init=True):
self.path = path
self.packet_num = 0
self.pos = 0
self.in_streams = []
s... | self.port = ip_port_tup[1] |
<|file_name|>views.py<|end_file_name|><|fim▁begin|>#
# Copyright (C) 2003-2022 Sébastien Helleu <flashcode@flashtux.org>
#
# 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 Free Softwar... | #
# You should have received a copy of the GNU General Public License
# along with WeeChat.org. If not, see <https://www.gnu.org/licenses/>.
# |
<|file_name|>new-chapter-title-modal.controller.ts<|end_file_name|><|fim▁begin|>// Copyright 2020 The Oppia Authors. All Rights Reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
/... | |
<|file_name|>FormAssociatedElement.cpp<|end_file_name|><|fim▁begin|>/*
* Copyright (C) 1999 Lars Knoll (knoll@kde.org)
* (C) 1999 Antti Koivisto (koivisto@kde.org)
* (C) 2001 Dirk Mueller (mueller@kde.org)
* Copyright (C) 2004, 2005, 2006, 2007 Apple Inc. All rights reserved.
* (C) 20... |
#include "config.h"
#include "FormAssociatedElement.h"
|
<|file_name|>cge_utils.rs<|end_file_name|><|fim▁begin|>use rand::{thread_rng, Rng};
use cge::Network;
use cge::gene::{GeneExtras, Gene};
pub trait Mutation {
fn add_subnetwork(&mut self, input: usize, output: usize, inputs: usize);
fn add_forward(&mut self, input: usize, output: usize);
fn add_recurrent(&m... | |
<|file_name|>_size.py<|end_file_name|><|fim▁begin|>import _plotly_utils.basevalidators
<|fim▁hole|> self,
plotly_name="size",
parent_name="histogram.marker.colorbar.tickfont",
**kwargs
):
super(SizeValidator, self).__init__(
plotly_name=plotly_name,
par... |
class SizeValidator(_plotly_utils.basevalidators.NumberValidator):
def __init__( |
<|file_name|>explicit_self_xcrate_exe.rs<|end_file_name|><|fim▁begin|>// Copyright 2012 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution and at
// http://rust-lang.org/COPYRIGHT.
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.a... |
pub fn main() {
let x = Bar { x: ~"hello" }; |
<|file_name|>view.rs<|end_file_name|><|fim▁begin|>// +--------------------------------------------------------------------------+
// | Copyright 2016 Matthew D. Steele <mdsteele@alum.mit.edu> |
// | |
// | This file is part of Syst... | Action, Align, Canvas, Element, Event, Font, Point, Rect, Resources, Sound, |
<|file_name|>PrettyPrintJSONWriter.java<|end_file_name|><|fim▁begin|>/*
* Copyright 2004-2008 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
*
* h... | |
<|file_name|>wrapperLodash.js<|end_file_name|><|fim▁begin|>var convert = require('./convert'),
func = convert('wrapperLodash', require('../wrapperLodash'), require('./_falseOptions'));
<|fim▁hole|><|fim▁end|> |
func.placeholder = require('./placeholder');
module.exports = func; |
<|file_name|>Drawing_tr.ts<|end_file_name|><|fim▁begin|><?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE TS>
<TS version="2.1" language="tr" sourcelanguage="en">
<context>
<name>CmdDrawingAnnotation</name>
<message>
<location filename="../../Command.cpp" line="481"/>
<source>Drawing</source>
... | <translation>Etkin çizimde bir parçanın yeni görünümünü ekle</translation> |
<|file_name|>signals.py<|end_file_name|><|fim▁begin|>"""
Django signals for the app.
"""
import logging
from django.db.models.signals import post_save
from django.conf import settings
from django.contrib.sites.models import Site
from .models import Response, UnitLesson
from .ct_util import get_middle_indexes
from co... | "student_id": student_id,
# "datetime": datetime.datetime.now() # TODO: consider changing to UTC (and making it a timestamp)
}
# Do not store if such `student_id`-`lesson_id` row is already present |
<|file_name|>error.rs<|end_file_name|><|fim▁begin|>use std::error::Error as StdError;
use std::fmt::{self, Debug, Display, Formatter};
use std::io;
use hyper::Error as HyperError;
use rustc_serialize::json::DecoderError;
use telegram_bot;
pub enum Error {
General(String),
}
impl From<HyperError> for Error {
f... | match *self { |
<|file_name|>lib.rs<|end_file_name|><|fim▁begin|>#![feature(abi_x86_interrupt)]
#![feature(asm)]
#![feature(const_fn, unique)]
#![feature(lang_items)]
#![feature(naked_functions)]
#![no_std]
#![feature(alloc, collections)]
#![feature(core_intrinsics)]
extern crate bit_field;
#[macro_use]
extern crate bitflags;
extern ... | |
<|file_name|>OptionsManager.js<|end_file_name|><|fim▁begin|>/* eslint-env mocha */
import expect from 'expect';
import FunctionChecker from '../src/FunctionChecker.js';
import OptionsManager from '../src/OptionsManager.js';
import Structure from '../src/Structure.js';
describe('optionsManager', () => {
let manager... | });
context('#structure', () => { |
<|file_name|>internals.py<|end_file_name|><|fim▁begin|>"""
This file is part of L3Morpho.
Author: Michael Gasser <gasser@cs.indiana.edu>
-----------------------------------------------------------------
internals.py is part of
Natural Language Toolkit: Internal utility functions
Copyright (C) 2001-2008 University of... | (stdout, stderr) = p.communicate()
# Check the return code.
if p.returncode != 0: |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.