prompt large_stringlengths 70 991k | completion large_stringlengths 0 1.02k |
|---|---|
<|file_name|>XQueryContextItemDecl.java<|end_file_name|><|fim▁begin|>/*
* Copyright 2013-2017 Grzegorz Ligas <ligasgr@gmail.com> and other contributors
* (see the CONTRIBUTORS file).<|fim▁hole|> *
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
... | *
* 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|>qsystemlibrary.cpp<|end_file_name|><|fim▁begin|>/****************************************************************************
**
** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
** This file is part of the QtCo... | |
<|file_name|>css_eb_tabmenu.ts<|end_file_name|><|fim▁begin|>import {CONST as C} from "../css_const";
import {ICSSProperties} from "../css_types";
const TabMenuBase: ICSSProperties = {
display: "flex",
flexDirection: "column",
fontFamily: "HelveticaNeue, Helvetica Neue, HelveticaNeueRoman, HelveticaNeue-Roman, He... | display: "flex",
flexDirection: "row",
alignItems: "baseline",
overflow: "hidden", |
<|file_name|>_sha512.py<|end_file_name|><|fim▁begin|>"""
This code was Ported from CPython's sha512module.c
"""
import _struct as struct
SHA_BLOCKSIZE = 128
SHA_DIGESTSIZE = 64
def new_shaobject():
return {
'digest': [0]*8,
'count_lo': 0,
'count_hi': 0,
'data': [0]* SHA_BLOCKSIZE... | def digest(self): |
<|file_name|>issue-51191.rs<|end_file_name|><|fim▁begin|>// Copyright 2016 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... |
#![feature(nll)]
struct Struct; |
<|file_name|>MainPage.tsx<|end_file_name|><|fim▁begin|>import * as React from "react";
import {
BackHandler,
DeviceEventEmitter,
Dimensions,
FlatList,
Platform,
SectionList,
StatusBar,
StyleSheet,
Text,
TouchableOpacity,
View,
Geolocation
} from "react-native";
import {I... | }
if (distance <= 1) {
const newCrowd: ICrowd = {name: returnObj.name, key: snapshot.key, desc: returnObj.desc, dis: distance.toFixed(2).toString() + " kms away"};
dataSource[1].data.push(newCrowd); |
<|file_name|>0007_auto__add_field_voterfile_voter_file_content__chg_field_voterfile_vote.py<|end_file_name|><|fim▁begin|># encoding: utf-8
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
... | 'at': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}),
'election': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['helios.Election']"}),
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'log... |
<|file_name|>adding.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python2
# vim:fileencoding=UTF-8:ts=4:sw=4:sta:et:sts=4:ai
__license__ = 'GPL v3'
__copyright__ = '2010, Kovid Goyal <kovid@kovidgoyal.net>'
__docformat__ = 'restructuredtext en'
import os
from PyQt5.Qt import Qt, QVBoxLayout, QFormLayout
from cal... | self.auto_add_browse_button.clicked.connect(self.choose_aa_path)
for signal in ('Activated', 'Changed', 'DoubleClicked', 'Clicked'):
signal = getattr(self.opt_blocked_auto_formats, 'item'+signal)
signal.connect(self.blocked_auto_formats_changed) |
<|file_name|>fake.cc<|end_file_name|><|fim▁begin|>/*
* Copyright (c) 2009-2014, Treehouse Networks Ltd. New Zealand
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions... | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE |
<|file_name|>order.js<|end_file_name|><|fim▁begin|>"use strict";
var CustomError = require('custom-error-instance');
var inventory = require('./inventory');
var menu = require('./menu');
var OrderError = CustomError('OrderError');
module.exports = function() {
var done = false;
... | if (!store.hasOwnProperty(name)) return; |
<|file_name|>open_cursor.ts<|end_file_name|><|fim▁begin|>import {IStatement} from "./_statement";
import {verNot, seq, optPrio} from "../combi";
import {Select, SQLTarget, SQLHints} from "../expressions";
import {Version} from "../../../version";
import {IStatementRunnable} from "../statement_runnable";
export class O... | public getMatcher(): IStatementRunnable { |
<|file_name|>Feature.py<|end_file_name|><|fim▁begin|>import json
from feature_ramp import redis
class Feature(object):
"""
A class to control ramping features to a percentage of users
without needing to deploy to change the ramp.
Usage:
Feature("on_off_toggled").activate()
Feature("on_off_t... | @classmethod
def _get_redis_set_key(cls): |
<|file_name|>config.rs<|end_file_name|><|fim▁begin|>use std::io::Read;
use std;
use serde_json;
#[derive(Serialize, Deserialize)]
pub struct ConfigData{
pub username:String,
pub password:String,
pub channels:Vec<String>,
pub admins:Vec<String>,
pub nyaa:Nyaa,
}
#[derive(Serialize, Deserialize,Clon... |
impl ConfigData{ |
<|file_name|>ShortUrlsList.test.tsx<|end_file_name|><|fim▁begin|>import { shallow, ShallowWrapper } from 'enzyme';
import { ReactElement } from 'react';
import { Mock } from 'ts-mockery';
import { useNavigate } from 'react-router-dom';
import shortUrlsListCreator from '../../src/short-urls/ShortUrlsList';
import { Shor... | |
<|file_name|>forms.py<|end_file_name|><|fim▁begin|>from django import forms
from .models import Question, Answer, Categories, Customuser
from django.contrib import auth
from django.contrib.auth.models import User
from django.utils.translation import ugettext_lazy as _
class add_Question_Form(forms.ModelForm): # just a... | 'category1','category2',
'category3','category4'] |
<|file_name|>reeval.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 Apache L... | # with the License. You may obtain a copy of the License at
# |
<|file_name|>guess_my_number.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python3
# vim: tw=76
import kxg
import random
import pyglet<|fim▁hole|> """
Keep track of the secret number, the range of numbers that haven't been
eliminated yet, and the winner (if there is one).
"""
def __init__(self):
... |
LOWER_BOUND, UPPER_BOUND = 0, 5000
class World(kxg.World): |
<|file_name|>support.rs<|end_file_name|><|fim▁begin|>extern crate hwloc;
use hwloc::Topology;
/// Example on how to check for specific topology support of a feature.
fn main() {
let topo = Topology::new();
// Check if Process Binding for CPUs is supported
println!("CPU Binding (current process) supported... | println!("CPU Binding (any process) supported: {}", topo.support().cpu().set_process());
// Check if Thread Binding for CPUs is supported
println!("CPU Binding (current thread) supported: {}", topo.support().cpu().set_current_thread()); |
<|file_name|>UserSearchLoader.java<|end_file_name|><|fim▁begin|>/*
* Twidere - Twitter client for Android
*
* Copyright (C) 2012 Mariotaku Lee <mariotaku.lee@gmail.com>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published ... | |
<|file_name|>TaskSetTest.js<|end_file_name|><|fim▁begin|>"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var chai = require("chai");
var Q = require("q");
var Defer = require("ts-promises/Defer");
var Tasks = require("../task/Tasks");
var TaskSet = require("../task/TaskSet");
var asr = chai... | var allResults = taskSet.getCompletedTasks().map(function (t) { return t.task.getResult(); });
asr.deepEqual(allResults.sort(), ["result a", "result b", "result c"]); |
<|file_name|>icon.demo.tsx<|end_file_name|><|fim▁begin|>import * as React from "react";
import styled from "styled-components";
import { Themer } from "@patternplate/component-utility";
import { Icon, symbols } from "./icon";
function DemoIcon(props) {
return (
<StyledDemoIcon title={props.title}>
<Icon sy... | |
<|file_name|>0010_ignoredevent.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
# Generated by Django 1.9.4 on 2016-04-11 11:22
from __future__ import unicode_literals
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migratio... | |
<|file_name|>Camera.java<|end_file_name|><|fim▁begin|>package org.onebeartoe.electronics.photorama;
import java.io.File;
/**
* A call to the setCameraOutputPath() method is needed after the object is
* instantiated.
*
* @author Roberto Marquez
*/
public abstract class Camera
{
protected Photo... | return outputPath;
}
|
<|file_name|>result_test.go<|end_file_name|><|fim▁begin|>package sqlmock
import (
"fmt"
"testing"
)
// used for examples
var mock = &sqlmock{}
func ExampleNewErrorResult() {
db, mock, _ := New()
result := NewErrorResult(fmt.Errorf("some error"))
mock.ExpectExec("^INSERT (.+)").WillReturnResult(result)
res, _ :... | func TestShouldReturnErroeSqlDriverResult(t *testing.T) {
result := NewErrorResult(fmt.Errorf("some error"))
_, err := result.LastInsertId()
if err == nil { |
<|file_name|>__openerp__.py<|end_file_name|><|fim▁begin|># -*- encoding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
{
'name': 'Timesheet on Issues',
'version': '1.0',
'category': 'Project Management',
'description': """
This module adds the Timesheet support fo... | |
<|file_name|>multi_map_lock_codec.py<|end_file_name|><|fim▁begin|>from hazelcast.serialization.bits import *
from hazelcast.protocol.builtin import FixSizedTypesCodec
from hazelcast.protocol.client_message import OutboundMessage, REQUEST_HEADER_SIZE, create_initial_buffer
from hazelcast.protocol.builtin import StringCo... | |
<|file_name|>bitcoin_eo.ts<|end_file_name|><|fim▁begin|><TS language="eo" version="2.1">
<context>
<name>AddressBookPage</name>
<message>
<source>Right-click to edit address or label</source>
<translation>Dekstre-klaku por redakti adreson aŭ etikedon</translation>
</message>
<message>
... | </message>
<message> |
<|file_name|>JoinGameResponse.java<|end_file_name|><|fim▁begin|>package com.glazebrook.tictactoe.responses;
import com.fasterxml.jackson.annotation.JsonProperty;
import javax.validation.constraints.NotNull;
import java.util.UUID;
public class JoinGameResponse {
@JsonProperty
@NotNull
private UUID gameId... | } |
<|file_name|>ClientManager.java<|end_file_name|><|fim▁begin|>package de.superioz.moo.network.client;
import de.superioz.moo.network.server.NetworkServer;
import lombok.Getter;
import de.superioz.moo.api.collection.UnmodifiableList;
import java.net.InetSocketAddress;
import java.util.ArrayList;
import java.util.HashMa... |
public UnmodifiableList<MooClient> getServerClients() { |
<|file_name|>eventtarget.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::utils::WrapperCache;
pub struct Event... | |
<|file_name|>eip-1344.spec.ts<|end_file_name|><|fim▁begin|>import tape from 'tape'
import { BN } from 'ethereumjs-util'
import Common, { Chain, Hardfork } from '@ethereumjs/common'
import VM from '../../../src'
import { ERROR } from '../../../src/exceptions'
const testCases = [<|fim▁hole|>]
// CHAINID PUSH8 0x00 MSTO... | { chain: Chain.Mainnet, hardfork: Hardfork.Istanbul, chainId: new BN(1) },
{ chain: Chain.Mainnet, hardfork: Hardfork.Constantinople, err: ERROR.INVALID_OPCODE },
{ chain: Chain.Ropsten, hardfork: Hardfork.Istanbul, chainId: new BN(3) }, |
<|file_name|>edit_case.js<|end_file_name|><|fim▁begin|>/**
* Created by Paul on 24/01/2015.
*/
var install_url = $("#install_url").val();
$("#updateCase").click(function () {
var case_id = $('#case_id').val();
var case_priority = $('#case_priority').val();
var case_status = $('#case_status').val();
... | "closeButton": true,
"showDuration": 3
};
toastr['success']('MyCRM', "Case updated"); |
<|file_name|>urls.py<|end_file_name|><|fim▁begin|>"""litchi 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<|fim▁hole|> 2. Add a URL to urlpatterns: url(r'^$', views.home, name='hom... | 1. Add an import: from my_app import views |
<|file_name|>orca_projection.py<|end_file_name|><|fim▁begin|>"""
Tri-Polar Grid Projected Plotting
=================================
This example demonstrates cell plots of data on the semi-structured ORCA2 model
grid.
First, the data is projected into the PlateCarree coordinate reference system.
Second four pcolorm... | # Choose plot projections
projections = {}
projections["Mollweide"] = ccrs.Mollweide()
projections["PlateCarree"] = ccrs.PlateCarree() |
<|file_name|>ExclusiveOrOperator.java<|end_file_name|><|fim▁begin|>package bits;
/**
* Created by krzysztofkaczor on 3/10/15.
*/
public class ExclusiveOrOperator implements BinaryOperator
{
@Override
public BitArray combine(BitArray operand1, BitArray operand2) {
if(operand1.size() != operand2.size()... | boolean a = operand1.get(i);
boolean b = operand2.get(i);
result.set(i, a != b ); |
<|file_name|>gmultiprocessing.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
"""
Add compatibility for gevent and multiprocessing.
Source based on project GIPC 0.6.0
https://bitbucket.org/jgehrcke/gipc/
"""
import os, sys, signal, multiprocessing, multiprocessing.process, multiprocessing.reduction
gevent=Non... | status = 'started' |
<|file_name|>CircularDependenciesDiscovery.java<|end_file_name|><|fim▁begin|>package org.adligo.tests4j_4jacoco.plugin.discovery;
import java.io.IOException;
import java.util.Collection;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Map;
import java.util.Set;
import org.adligo.tests4j.models.sh... | /**
* a model like (non thread safe) class that loads classes into |
<|file_name|>change-header-image.client.controller.js<|end_file_name|><|fim▁begin|>'use strict';
angular.module('articles').controller('ChangeHeaderImageController', ['$scope', '$timeout', '$stateParams', '$window', 'Authentication', 'FileUploader', 'Articles',
function ($scope, $timeout, $stateParams, $window, Auth... | |
<|file_name|>mod.rs<|end_file_name|><|fim▁begin|>//-
// Copyright (c) 2016, 2017, Jason Lingle
//
// This file is part of Ensync.
//
// Ensync is free software: you can redistribute it and/or modify it under the
// terms of the GNU General Public License as published by the Free Software
// Foundation, either versi... | |
<|file_name|>polyfills.js<|end_file_name|><|fim▁begin|>// fetch() polyfill for making API calls.
import 'whatwg-fetch';
// Object.assign() is commonly used with React.<|fim▁hole|>Object.assign = objectAssign;<|fim▁end|> | // It will use the native implementation if it's present and isn't buggy.
import objectAssign from 'object-assign'; |
<|file_name|>setup.py<|end_file_name|><|fim▁begin|>from distutils.core import setup, Extension
from distutils.sysconfig import get_python_lib
import os, os.path
import sys
if 'sdist' in sys.argv and sys.platform != "win32":
assert os.system("git show-ref -s HEAD > .gitrev") == 0
if sys.platform == "darwin":
#... | |
<|file_name|>vmscaleset.go<|end_file_name|><|fim▁begin|>/*
Copyright 2020 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-2.0
Unl... | } |
<|file_name|>hummus-recipe-tests.ts<|end_file_name|><|fim▁begin|>import Recipe = require('hummus-recipe');
import fs = require('fs');
// $ExpectType Recipe
const newDoc = new Recipe('new', 'test.pdf', {
version: 1.6,
author: 'John Doe',
title: 'Hummus Recipe',
subject: 'A brand new PDF',
});
// $Expe... | // $ExpectError
newDoc.createPage('A5') |
<|file_name|>run_presubmit_checks.py<|end_file_name|><|fim▁begin|># Copyright 2019 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
#
# http://www.... | print('Running frontend unit tests') |
<|file_name|>temperaturas.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
'''
Crea un programa que analice el fichero y muestre:
- Los años y sus temperaturas (máxima, mínima y media), ordenados por año
- Los años y su tempertura media, ordenados por temperatura en orden descendente
- Crea un fichero html:
... | for n,linea in enumerate(f):
if n != 0:
registro = linea.split()
listado.append(registro) |
<|file_name|>InsertOrUpdateGeneratorOracleTest.java<|end_file_name|><|fim▁begin|>package liquibase.sqlgenerator.core;
import liquibase.change.ColumnConfig;
import liquibase.database.ObjectQuotingStrategy;
import liquibase.database.core.OracleDatabase;
import liquibase.sql.Sql;
import liquibase.statement.DatabaseFuncti... | v_prodcount NUMBER := 0;
BEGIN |
<|file_name|>git_actions.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
from peyotl.utility import get_logger
import re
from peyotl.git_storage import GitActionBase
# extract an amendment id from a git repo path (as returned by git-tree)
_LOG = get_logger(__name__)
class MergeException(Exception):
pass
... | @property |
<|file_name|>LiveTv.js<|end_file_name|><|fim▁begin|>import * as React from 'react';
import createSvgIcon from './utils/createSvgIcon';
<|fim▁hole|><|fim▁end|> | export default createSvgIcon(
<path d="M21 6h-7.59l3.29-3.29L16 2l-4 4-4-4-.71.71L10.59 6H3c-1.1 0-2 .89-2 2v12c0 1.1.9 2 2 2h18c1.1 0 2-.9 2-2V8c0-1.11-.9-2-2-2zm0 14H3V8h18v12zM9 10v8l7-4z" />
, 'LiveTv'); |
<|file_name|>datalog.py<|end_file_name|><|fim▁begin|>"""
This file shows how to use pyDatalog using facts stored in datalog.
It has 3 parts:
1. create facts for 2 employees in the datalog engine
2. define business rules
3. Query the datalog engine
"""
from pyDatalog import pyDatalog
""" 1. create facts fo... | console = console.datalogConsole(locals=locals())
console.interact('Type exit() when done.') |
<|file_name|>hosts.py<|end_file_name|><|fim▁begin|><|fim▁hole|><|fim▁end|> | ../../../../../share/pyshared/twisted/names/hosts.py |
<|file_name|>manage.py<|end_file_name|><|fim▁begin|># Copyright 2012 OpenStack Foundation
#
# 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... | |
<|file_name|>lexical-scope-in-parameterless-closure.rs<|end_file_name|><|fim▁begin|>// min-lldb-version: 310
// compile-flags:-C debuginfo=1
// gdb-command:run
// lldb-command:run
<|fim▁hole|> let _ = (1_usize..3).map(|_| 5);
}<|fim▁end|> | // Nothing to do here really, just make sure it compiles. See issue #8513.
fn main() {
let _ = ||(); |
<|file_name|>registry_access.py<|end_file_name|><|fim▁begin|># Copyright 2014 ARM Limited
#
# Licensed under the Apache License, Version 2.0
# See LICENSE file for details.
# standard library modules, , ,
import re<|fim▁hole|>import functools
import binascii
import calendar
import datetime
import hashlib
import base64... | import logging
from collections import OrderedDict |
<|file_name|>parser.rs<|end_file_name|><|fim▁begin|>// Copyright 2013 The Servo Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution.
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
// <LIC... | let settings = http_parser::struct_http_parser_settings {
on_message_begin: on_message_begin as *u8,
on_url: on_url as *u8, |
<|file_name|>gps.js<|end_file_name|><|fim▁begin|>var GPSClient = {};
GPSClient.send = function(exeurl, latitude,longitude,actionname,username) {
var client = Titanium.Network.createHTTPClient({timeout : 100000});
var paramater = '&intaliouser=' + username + '¶meter=latitude:' + longitude + ',';
//var paramater ... | }; |
<|file_name|>0006_auto_20160907_2016.py<|end_file_name|><|fim▁begin|># Generated by Django 1.10.1 on 2016-09-07 20:16
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [("institutions", "0005_auto_20160907_1814")]
<|fim▁hole|> options={
"ordering": ... | operations = [
migrations.AlterModelOptions(
name="email", |
<|file_name|>yii.validation.test.js<|end_file_name|><|fim▁begin|>var assert = require('chai').assert;
assert.isDeferred = function (object) {<|fim▁hole|> return String(object.resolve) === String($.Deferred().resolve);
};
var sinon;
var withData = require('leche').withData;
var StringUtils = {
repeatString: fu... | if (typeof object.resolve !== 'function') {
return false;
}
|
<|file_name|>MiaoZuanScripts.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python
#encoding=utf-8
import urllib, urllib2
import cookielib
import re
import time
from random import random
from json import dumps as json_dumps, loads as json_loads
import sys
reload(sys)
sys.setdefaultencoding('utf-8')
import ... | elif resp_dict["Code"] == 31303:
logger.debug("view advert id = %s, Response from the server: %s", advertsID, resp_dict["Desc"])
result_Code_31303_count += 1
continue
|
<|file_name|>ResourceLoader.js<|end_file_name|><|fim▁begin|>function ResourceLoader(baseurl) {
this.BASEURL = baseurl;
}
ResourceLoader.prototype.loadResource = function(resource, callback) {
var self = this;
evaluateScripts([resource], function(success) {
if(success) {
var resource = Template.call(se... | |
<|file_name|>get.gen.spec.js<|end_file_name|><|fim▁begin|><|fim▁hole|>var falcor = require("./../../../lib/");
var Model = falcor.Model;
var expect = require('chai').expect;
describe('getVersionSync', function() {
it('should get a version', function() {
var model = new Model({cache: {hello: 'world'}});
... | |
<|file_name|>client.py<|end_file_name|><|fim▁begin|>import urllib2
import appuifw, e32
from key_codes import *
class Drinker(object):
def __init__(self):
self.id = 0<|fim▁hole|> self.drinks = 0
def get_drinker_list():
data = urllib2.urlopen("http://192.168.11.5:8080/drinkcounter/get_datas/").... | self.name = ""
self.prom = 0.0
self.idle = "" |
<|file_name|>urls.py<|end_file_name|><|fim▁begin|>from django.conf.urls import patterns, include, url
from django.contrib import admin
admin.autodiscover()
urlpatterns = patterns('',
# Examples:
# url(r'^$', 'toolsforbiology.views.home', name='home'),<|fim▁hole|> url(r'^admin/', include(admin.site.urls)),
... | # url(r'^blog/', include('blog.urls')),
|
<|file_name|>dlg_subida.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
---------------------------------------------------------------------------------------------------
dlg_subida
mantém as informações sobre a dialog de subida
This program is free software: you can redistribute it... | assert self.__dct_config is not None
# dicionário de subidas |
<|file_name|>remote_access_api.py<|end_file_name|><|fim▁begin|># coding: utf-8
"""
Swaggy Jenkins
Jenkins API clients generated from Swagger / Open API specification # noqa: E501
The version of the OpenAPI document: 1.1.2-pre.0
Contact: blah@cliffano.com
Generated by: https://openapi-generator.t... | Ref: https://openapi-generator.tech |
<|file_name|>switch.py<|end_file_name|><|fim▁begin|>import datetime
day = datetime.datetime.now().weekday()
def get_sunday():
return "Today it's Sunday"
def get_monday():
return "Today it's Monday"
def get_tuesday():
return "Today it's Tuesday"
def get_wednesday():
return "Today it's Wednesday"
def ge... | |
<|file_name|>sunf95.py<|end_file_name|><|fim▁begin|>"""SCons.Tool.sunf95
Tool-specific initialization for sunf95, the Sun Studio F95 compiler.
There normally shouldn't be any need to import this module directly.
It will usually be imported through the generic SCons.Tool.Tool()
selection method.
"""
#
# Copyright (c... | |
<|file_name|>snippet_parser.rs<|end_file_name|><|fim▁begin|>use std::error::Error;
use structs::*;
use filesystem::read_file_to_json;
use std::fs::read_dir;
use filesystem::read_file_to_string;
use std::fs::DirEntry;
pub fn get_all_snippets() -> Result<Vec<Snippet>, Box<Error>> {
let mut all_snippets = Vec::new();... | let uw = snippet_folder; |
<|file_name|>groupe.js<|end_file_name|><|fim▁begin|>System.register(["./departementsiglename"], function (_export) {
var DepartementSigleNameItem, _createClass, _get, _inherits, _classCallCheck, Groupe;
return {
setters: [function (_departementsiglename) {
DepartementSigleNameItem = _depart... | }
}); |
<|file_name|>test_vec_env.py<|end_file_name|><|fim▁begin|>from slm_lab.env.vec_env import make_gym_venv
import numpy as np
import pytest
@pytest.mark.parametrize('name,state_shape,reward_scale', [
('PongNoFrameskip-v4', (1, 84, 84), 'sign'),
('LunarLander-v2', (8,), None),
('CartPole-v0', (4,), None),
])
... | |
<|file_name|>recognize-page-type.js<|end_file_name|><|fim▁begin|>/**
* Created by leow on 2/12/17.
*/
"use strict";
// Stdlib<|fim▁hole|>const NON_FATAL_INCONSISTENT = "Inconsistent state - retry!"
const FATAL_CONTENT = "Page does not exist!"
const FATAL_UNKNOWN = "Unknown Error!"
// Libs
const cheerio = require('... | const util = require("util")
// Constants |
<|file_name|>grouping.js<|end_file_name|><|fim▁begin|>import Collection from './collection';
import extend from '../utils/extend';
export default function Grouping(key, elements) {
this.key = key;
this.elements = elements;
Collection.call(this, elements);
}
extend(Grouping, Collection, {<|fim▁hole|> * ... | /** |
<|file_name|>open_directory.py<|end_file_name|><|fim▁begin|># coding: utf-8
from __future__ import unicode_literals, division, absolute_import, print_function
from getpass import getuser
import ctypes
from ctypes.util import find_library
from ctypes import c_void_p, c_uint32, POINTER, c_bool, byref
from .core_foundat... | |
<|file_name|>ServerlessApplicationRepositoryClient.cpp<|end_file_name|><|fim▁begin|>/*
* Copyright 2010-2017 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 Li... | {
handler(this, request, UpdateApplication(request), context);
} |
<|file_name|>0030_author_displayname.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
# Generated by Django 1.10.2 on 2016-11-22 22:53
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):<|fim▁hole|> ('socialnet', '0029_auto_20161121_05... |
dependencies = [ |
<|file_name|>app.js<|end_file_name|><|fim▁begin|>var express = require('express');
var path = require('path');
var favicon = require('serve-favicon');
var logger = require('morgan');
var cookieParser = require('cookie-parser');
var bodyParser = require('body-parser');
var partials = require('express-partials');
var me... |
// error handlers |
<|file_name|>commands.py<|end_file_name|><|fim▁begin|>import subprocess<|fim▁hole|>@only_osx
def systemsetup(*args):
subprocess.call(['systemsetup'] + list(args))<|fim▁end|> |
from genes.mac.traits import only_osx
|
<|file_name|>FolderInfo.java<|end_file_name|><|fim▁begin|>/*
* Copyright (C) 2008 The Android Open Source Project
*
* 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.ap... | options |= option;
} else {
options &= ~option;
} |
<|file_name|>Session.js<|end_file_name|><|fim▁begin|>var mongoose = require('mongoose');
var Shape = require('./Shape');
var User = require('./User');
// Create a session model, _id will be assigned by Mongoose
var CanvasSessionSchema = new mongoose.Schema(
{
_id: String,
users: [User],
dateCreated: Dat... |
// Make Session available to rest of the application
module.exports = mongoose.model('Session', CanvasSessionSchema); |
<|file_name|>rapidvideo.py<|end_file_name|><|fim▁begin|># -*- coding: iso-8859-1 -*-
#------------------------------------------------------------
# pelisalacarta - XBMC Plugin
# Conector para rapidvideo
# http://blog.tvalacarta.info/plugin-xbmc/pelisalacarta/
#----------------------------------------------------------... | video_urls = get_video_url( "http://www.rapidvideo.org/xr1nb7cfh58a" ) |
<|file_name|>scrape.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
import logging
import sys
from urllib.parse import urljoin
import requests
from lxml import html
from six.moves.urllib.parse import urlparse
from django_docutils.exc import BasedException
logger = logging.getLogger(__name__)
def _request_fav... | try:
favicon_url = favicons[0]
favicon_url = urljoin(url, favicon_url)
return _request_favicon(favicon_url) |
<|file_name|>encode.rs<|end_file_name|><|fim▁begin|>extern crate criterion;
use criterion::{BenchmarkId, Criterion, criterion_group, criterion_main};
use image::{ColorType, bmp::BmpEncoder, jpeg::JpegEncoder};
use std::fs::File;
use std::io::{BufWriter, Write, Seek, SeekFrom};
trait Encoder {
fn encode_raw(&self... |
type BenchGroup<'a> = criterion::BenchmarkGroup<'a, criterion::measurement::WallTime>;
/// Benchmarks encoding a zeroed image. |
<|file_name|>extension_class_impl.rs<|end_file_name|><|fim▁begin|>/*
* Swaggy Jenkins
*
* Jenkins API clients generated from Swagger / Open API specification
*
* The version of the OpenAPI document: 1.1.2-pre.0
* Contact: blah@cliffano.com
* Generated by: https://openapi-generator.tech
*/
#[derive(Clone, De... | _links: None, |
<|file_name|>memory.py<|end_file_name|><|fim▁begin|>"""
Ecks plugin to collect system memory usage information
Copyright 2011 Chris Read (chris.read@gmail.com)
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain... | parent._extract(data, int, 4), |
<|file_name|>root.js<|end_file_name|><|fim▁begin|>import {combineEpics} from 'redux-observable';
import {combineReducers} from 'redux';
import {
disposePastebinEpic,
pastebinLayoutEpic,
pastebinEpic,
pastebinTokenEpic,
pastebinTokenRejectedEpic,
pastebinReducer,
pastebinContentEpic,
past... | } from './monacoEditor';
|
<|file_name|>test_views.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
from datetime import datetime
import json
from urlparse import urlparse
from django.core.urlresolvers import reverse
from django.db import reset_queries
from django.http import QueryDict
from django.test.utils import override_settings
im... | rating=4)
# Extra review for another app, should be ignored. |
<|file_name|>thread_sched.hh<|end_file_name|><|fim▁begin|>/// @file core/thread_sched.hh
// Uniqos -- Unique Operating System
// (C) 2012-2015 KATO Takeshi
//
// Uniqos 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 So... | |
<|file_name|>PublishTest.java<|end_file_name|><|fim▁begin|>package org.buddycloud.channelserver.packetprocessor.iq.namespace.pubsub.set;
import java.util.ArrayList;
import java.util.concurrent.BlockingQueue;
import java.util.concurrent.LinkedBlockingQueue;
import junit.framework.Assert;
import org.buddycloud.channel... |
Assert.assertTrue(item.attributeValue("id").length() > 0); |
<|file_name|>linalg_grad.py<|end_file_name|><|fim▁begin|># Copyright 2015 The TensorFlow 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
#
# http://www.apach... | # Temporary tmp = (A * A^T + lambda * I)^{-1} * B.
tmp = linalg_ops.cholesky_solve(chol, b)
a1 = math_ops.matmul(tmp, a, adjoint_a=True)
a1 = -math_ops.matmul(grad_b, a1) |
<|file_name|>iced_error.rs<|end_file_name|><|fim▁begin|>// SPDX-License-Identifier: MIT
// Copyright wtfsckgh@gmail.com
// Copyright iced contributors
use alloc::borrow::Cow;
use alloc::string::String;
use core::fmt;
#[cfg(feature = "std")]
use std::error::Error;
/// iced error
#[derive(Debug, Clone)]
pub struct Iced... | } |
<|file_name|>scrape_google_scholar_from_bing.py<|end_file_name|><|fim▁begin|>import requests
from urllib.parse import parse_qs, urlparse
from lxml.html import fromstring
_HEADERS = {
'User-Agent': 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Ubuntu Chromium/41.0.2272.76 Chrome/41.0.2272.... | print(link)
|
<|file_name|>regions-free-region-ordering-caller.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
// h... | // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your |
<|file_name|>advance-tables-widget4.component.ts<|end_file_name|><|fim▁begin|>import { Component, OnInit } from '@angular/core';
@Component({
selector: 'app-advance-tables-widget4',
<|fim▁hole|>
ngOnInit(): void {}
}<|fim▁end|> | templateUrl: './advance-tables-widget4.component.html',
})
export class AdvanceTablesWidget4Component implements OnInit {
constructor() {}
|
<|file_name|>country_page_data.rs<|end_file_name|><|fim▁begin|>use super::country::Country;
use super::year::Year;
/// `CountryPageData`
/// data actually sent to page
#[derive(Debug, Clone, RustcEncodable)]
pub struct CountryPageData {
pub found: bool,
pub name: String,
pub link: String,
pub total_eve... | CountryPageData {
found: true,
name: t_name.clone(), |
<|file_name|>development.py<|end_file_name|><|fim▁begin|>from .base import BASE_DIR, INSTALLED_APPS, MIDDLEWARE_CLASSES, REST_FRAMEWORK
DEBUG = True
ALLOWED_HOSTS = ['127.0.0.1']
SECRET_KEY = 'secret'
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.postgresql_psycopg2',
'NAME': 'holonet'... | 'default': {
'hosts': [
'127.0.0.1:9200' |
<|file_name|>redgem.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
.. module:: redgem
:platform: Unix, Windows
:synopsis: RedGEM Algorithm
.. moduleauthor:: pyTFA team
Model class
"""
from pytfa.redgem.network_expansion import NetworkExpansion
from pytfa.redgem.lumpgem impo... | |
<|file_name|>useless_chaining.rs<|end_file_name|><|fim▁begin|>// Copyright 2018 Chao Lin & William Sergeant (Sorbonne University)
// 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
// htt... | |
<|file_name|>harfbuzz.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/. */
#![allow(unsafe_code)]
use app_units::Au;
use euclid::Point... | let hb_face: *mut hb_face_t = hb_face_create_for_tables(
Some(font_table_func),
font as *const c_void as *mut c_void,
None, |
<|file_name|>nfs4.rs<|end_file_name|><|fim▁begin|>/* Copyright (C) 2018-2020 Open Information Security Foundation
*
* You can copy, redistribute or modify this Program under the terms of
* the GNU General Public License version 2 as published by the Free
* Software Foundation.
*
* This program is distributed in t... | {
let mut tx = self.new_tx();
tx.xid = r.hdr.xid; |
<|file_name|>deque.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/... | static AMT: int = 10000;
static NTHREADS: int = 4;
static mut DONE: AtomicBool = INIT_ATOMIC_BOOL;
let mut pool = BufferPool::<(int, uint)>::new(); |
<|file_name|>social_tags.py<|end_file_name|><|fim▁begin|>from django.template import Library
from django.conf import settings
if "django.contrib.sites" in settings.INSTALLED_APPS:
from django.contrib.sites.models import Site
current_domain = lambda: Site.objects.get_current().domain
elif getattr(settings, "SI... | def email_share(url=None): |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.