prompt large_stringlengths 70 991k | completion large_stringlengths 0 1.02k |
|---|---|
<|file_name|>node.go<|end_file_name|><|fim▁begin|>package tree
type Node struct {
Value int<|fim▁hole|><|fim▁end|> | Left, Right *Node
} |
<|file_name|>page-title.service.spec.ts<|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.<|fim▁hole|>//
// Unless required by applicable law or a... | // You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0 |
<|file_name|>main.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
#
# jQuery File Upload Plugin GAE Python Example 2.1.1
# https://github.com/blueimp/jQuery-File-Upload
#
# Copyright 2011, Sebastian Tschan
# https://blueimp.net
#
# Licensed under the MIT license:
# http://www.opensource.org/licenses/MI... | |
<|file_name|>test_max_column.py<|end_file_name|><|fim▁begin|>#!../../../.env/bin/python
import os
import numpy as np
import time
a = np.array([
[1,0,3],
[0,2,1],
[0.1,0,0],
])
print a
row = 1
col = 2
print a[row][col]
assert a[row][col] == 1
<|fim▁hole|>print 'expected_max_rows:', expected_max_rows
print ... | expected_max_rows = [0, 1, 0]
expected_max_values = [1, 2, 3] |
<|file_name|>say.py<|end_file_name|><|fim▁begin|>from command import Command, is_command
from event import Event
class Say(Command):
shortname = 'say'
name = 'Say something to someone, or in the public chat'
@is_command
def say(self, player, *args):
if args[0] in self.world.players:
... |
for p in self.world.players:
self.tell_player(p, msg) |
<|file_name|>InformationDispatcher.py<|end_file_name|><|fim▁begin|>from vt_manager.controller.actions.ActionController import ActionController
from vt_manager.controller.drivers.VTDriver import VTDriver
from vt_manager.models.Action import Action
from vt_manager.models.VirtualMachine import VirtualMachine
import xmlrpc... | xmlrpc_server = xmlrpclib.Server(server.getAgentURL()) |
<|file_name|>mcbd.py<|end_file_name|><|fim▁begin|><|fim▁hole|>Usage: python3 mcbd.py save <keyword> - saves clipboard for keyword.
python3 mcbd.py <keyword> - loads to clipboard for keyword.
python3 mcbd.py list - loads all keywords to clipboard.
python3 mcbd.py delete <keyword> - deletes for keywo... | #! python3
'''
mcbd.py - Saves and loads pieces of text from/to the clipboard to/from a
shelf type file. |
<|file_name|>helpers.js<|end_file_name|><|fim▁begin|>import {mount, render, shallow} from 'enzyme';
global.mount = mount;<|fim▁hole|><|fim▁end|> | global.render = render;
global.shallow = shallow; |
<|file_name|>forgotpasswordpin.js<|end_file_name|><|fim▁begin|>define([], function () {
function processForgotPasswordResult(result) {
if (result.Success) {
var msg = Globalize.translate('MessagePasswordResetForUsers');
msg += '<br/>';
msg += '<br/>';
msg... | message: Globalize.translate('MessageInvalidForgotPasswordPin'),
title: Globalize.translate('HeaderPasswordReset')
});
return; |
<|file_name|>GfshParseResult.java<|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 t... | }
// this maps are used for easy access of option values in String form.
// It's used in tests and validation of option values in pre-execution |
<|file_name|>test_instrument.py<|end_file_name|><|fim▁begin|>import os
import json
from nose.tools import assert_equal
from .project import load_lsdsng
from .utils import temporary_file
SCRIPT_DIR = os.path.abspath(os.path.dirname(__file__))
def _test_load_store_instrument(source_lsdsng, lsdinst_path, original_inde... | |
<|file_name|>equals_height.js<|end_file_name|><|fim▁begin|>(function ($) {
$(document).ready(function() {
var highestCol = Math.max($('.first-menu .pane-content').height(),$('.middle-menu .pane-content').height(),$('.last-menu .pane-content').height());
/*.first-menu .pane-content, .middle-menu .pane-content,... |
})(jQuery); |
<|file_name|>p05_delete_gl_entries_for_cancelled_vouchers.py<|end_file_name|><|fim▁begin|># Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
def execute():
import webnotes
entries = webnotes.conn.sql("""select voucher_type, voucher_no
... | |
<|file_name|>models.py<|end_file_name|><|fim▁begin|>from datetime import datetime
from pymongo.connection import Connection
from django.db import models
from eventtracker.conf import settings
def get_mongo_collection():
"Open a connection to MongoDB and return the collection to use."
if settings.RIGHT_MONGO... | timestamp = models.DateTimeField(auto_now_add=True) |
<|file_name|>TodoListDetail.js<|end_file_name|><|fim▁begin|>/**
* This is the controller file for "TodoDetail"
*
* @class Controller.TodoDetail
* @author Steven House
* @email steven.m.house@gmail.com
*/
var args = arguments[0] || {};
var itemId = args.itemId || "";
// Include logging utility
var log = Alloy.Gl... | function savePhoto(image) { |
<|file_name|>Preferences.cpp<|end_file_name|><|fim▁begin|>/*
* PCLanChat, the decentralized chat client
* Copyright (C) 2017 Kuklin István
*
* 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,... |
#include <cstdlib>
#include <QtWidgets> |
<|file_name|>main.cpp<|end_file_name|><|fim▁begin|>#include <iostream>
#include <zmf/AbstractModule.hpp>
#include "zsdn/StartupHelper.h"
#include "LinkDiscoveryModule.hpp"
#include <google/protobuf/stubs/common.h>
int main(int argc, char* argv[]) {
int returnCode;
if (zsdn::StartupHelper::paramsOkay(argc, argv... | returnCode = zsdn::StartupHelper::startInConsole(new LinkDiscoveryModule(0), argv[1]);
} else {
returnCode = 1; |
<|file_name|>storeclient.py<|end_file_name|><|fim▁begin|>#
# Copyright (c) 2010,2011,2012,2013 Big Switch Networks, Inc.
#
# Licensed under the Eclipse Public License, Version 1.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:... | return result
url_cache.clear_cached_urls()
|
<|file_name|>permissions.py<|end_file_name|><|fim▁begin|># Copyright (c) 2019, CRS4
#
# Permission is hereby granted, free of charge, to any person obtaining a copy of
# this software and associated documentation files (the "Software"), to deal in
# the Software without restriction, including without limitation the... | class CanEnterGodMode(permissions.BasePermission): |
<|file_name|>driver.py<|end_file_name|><|fim▁begin|>"""
Dummy Salesforce driver that simulates some parts of DB API 2
https://www.python.org/dev/peps/pep-0249/
should be independent on Django.db
and if possible should be independent on django.conf.settings
Code at lower level than DB API should be also here.
"""
from ... | |
<|file_name|>nb-carousel.controller.js<|end_file_name|><|fim▁begin|>/**
* Carousel controller
*
* @author Hein Bekker <hein@netbek.co.za>
* @copyright (c) 2015 Hein Bekker
* @license http://www.gnu.org/licenses/agpl-3.0.txt AGPLv3
*/
(function (window, angular, undefined) {
'use strict';
angular
.module('nb... | // Stop here if there is a transition in progress or if the index has not changed.
if (flags.transitioning || $scope.currentIndex === index) { |
<|file_name|>math_ops.py<|end_file_name|><|fim▁begin|># Copyright 2015 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/... | |
<|file_name|>urls.py<|end_file_name|><|fim▁begin|>from __future__ import absolute_import
from django.conf.urls import patterns, include
from . import views, customadmin, admin
urlpatterns = patterns('',<|fim▁hole|> (r'^test_admin/admin2/', include(customadmin.site.urls)),
(r'^test_admin/admin3/', include(adm... | (r'^test_admin/admin/doc/', include('django.contrib.admindocs.urls')),
(r'^test_admin/admin/secure-view/$', views.secure_view),
(r'^test_admin/admin/', include(admin.site.urls)), |
<|file_name|>Table.d.ts<|end_file_name|><|fim▁begin|>import * as React from 'react';
import { StandardProps } from '..';
export interface TableProps extends StandardProps<TableBaseProps, TableClassKey> {
component?: React.ReactType<TableBaseProps>;
}
export type TableBaseProps = React.TableHTMLAttributes<HTMLTableE... |
export type TableClassKey = 'root'; |
<|file_name|>rpc.py<|end_file_name|><|fim▁begin|># Copyright 2015 StackHut Ltd.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requi... | |
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|>"""
Settings and configuration for Django.
Values will be read from the module specified by the DJANGO_SETTINGS_MODULE environment
variable, and then from django.conf.global_settings; see the global settings file for
a list of all possible variables.
"""
import im... | |
<|file_name|>conditions.py<|end_file_name|><|fim▁begin|># Past examples are programmatically insecure
# You require arguments to be passed in but what if the wrong arguments are provided?
# Look at the timestable solution which changes numbers to text - what happens if you provide the number 30?
#
# One way of controll... | |
<|file_name|>lib.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/. */
//! This module contains shared types and messages for use by dev... | #![feature(plugin)]
#![plugin(serde_macros)]
#![plugin(plugins)]
#![deny(unsafe_code)] |
<|file_name|>CognateParser.py<|end_file_name|><|fim▁begin|>import re
from nexusmaker.tools import natsort
is_combined_cognate = re.compile(r"""(\d+)([a-z]+)""")
class CognateParser(object):
UNIQUE_IDENTIFIER = "u_"
def __init__(self, strict=True, uniques=True, sort=True):
"""
Parses cognate... | return value |
<|file_name|>2095_tokyo.js<|end_file_name|><|fim▁begin|>function init() {
em.setProperty("state", "0");
em.setProperty("leader", "true");
}
function setup(eim, leaderid) {
em.setProperty("state", "1");
em.setProperty("leader", "true");
var eim = em.newInstance("2095_tokyo" + leaderid);
var map = eim.create... | |
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|>from .array_ import array # noqa: F401
from .base import ( # noqa: F401
ExtensionArray,
ExtensionOpsMixin,
ExtensionScalarOpsMixin,
)
from .categorical import Categorical # noqa: F401
from .datetimes import DatetimeArray # noqa: F401
from .integer im... | |
<|file_name|>database.py<|end_file_name|><|fim▁begin|>""" Database-related functionality for Minos. """<|fim▁hole|>
db = SQLAlchemy()
class SonosConfig(db.Model):
""" Database-class that contains the configuration for Sonos funcionality. """
__tablename__ = 'sonos_config'
key = db.Column(db.String,... | from flask_sqlalchemy import SQLAlchemy
from .app import app, cache |
<|file_name|>cli.js<|end_file_name|><|fim▁begin|>var pkg = require([__dirname, "..", "package"].join("/"));<|fim▁hole|>module.exports = {
initialize: function(options){
var options = _.merge(options, {
version: {
describe: "Print the Cuisine version"
}
});
... | var _ = require("lodash");
var yargs = require("yargs");
var commands = require([__dirname, "commands"].join("/"));
|
<|file_name|>version.py<|end_file_name|><|fim▁begin|><|fim▁hole|><|fim▁end|> | # Do not edit this file, pipeline versioning is governed by git tags
__version__=0.0.0 |
<|file_name|>UCNES_Class.py<|end_file_name|><|fim▁begin|>import numpy as np
import os
import sys
import math
#import class files
# sys.path.append('../../../')
from source import bioRead as br
from source import classify as cl
#import PyInsect for measuring similarity
#sys.path.append('../../../../')
from PyINSECT impo... |
print ""
print "Getting human similarities... Done."
|
<|file_name|>ViewTradeActivityTest.java<|end_file_name|><|fim▁begin|>package com.gracehoppers.jlovas.bookwrm;
import android.app.Activity;
import android.content.Intent;
import android.test.ActivityInstrumentationTestCase2;
import android.widget.Button;
import android.widget.TextView;
import junit.framework.TestCase;... |
//Reset the application to a known state
A.getTradeHistory().clear();
A.getTradeHistory().addTrade(trade); |
<|file_name|>test_init_code.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python
#
# Copyright 2018-2021 Polyaxon, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache... | class TestInitCode(BaseTestCase):
def test_raise_if_env_var_not_found(self):
with self.assertRaises(PolyaxonContainerException): |
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|>from __future__ import unicode_literals
import logging
import os
from mopidy import config, ext
__version__ = '0.3.0'
logger = logging.getLogger(__name__)
class Extension(ext.Extension):
dist_name = 'Mopidy-Webhooks'
ext_name = 'webhooks'
version ... | |
<|file_name|>index.d.ts<|end_file_name|><|fim▁begin|>// Type definitions for ngWYSIWYG 0.6
// Project: https://github.com/psergus/ngWYSIWYG
// Definitions by: Patrick Mac Kay <https://github.com/patrick-mackay>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
declare namespace ngWYSIWYG {
interfa... |
interface Config { |
<|file_name|>plants.js<|end_file_name|><|fim▁begin|>PLANT_CONFIG = [
{key: 'name', label: 'Name'},
{key: 'scienceName', label: 'Scientific name'}
];
Template.plants.helpers({
plantListConfig: function() {
return PLANT_CONFIG;
}
});
Template.newPlant.helpers({
plantListConfig: function() {
... | |
<|file_name|>jsonZipper.js<|end_file_name|><|fim▁begin|>/*
Author: Gerard Lamusse
Created: 08/2015
Version: 1.0
URL: https://github.com/u12206050/jsonZipper
*/
var jsonZipper = (function(){
var jz = function(_jsonObj, _options) {
var Z = this;
var MAP = [];
var opts = _options && typeof(_options... | |
<|file_name|>description.js<|end_file_name|><|fim▁begin|>module.exports = {
getMeta: function(meta) {<|fim▁hole|> d = d[0];
}
return {
description: d
}
}
};<|fim▁end|> |
var d = meta.metaDescription || meta.description || meta.Description;
if (d && d instanceof Array) { |
<|file_name|>train_util.py<|end_file_name|><|fim▁begin|># coding=utf-8
# Copyright 2022 The Google Research 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.... | |
<|file_name|>select_handler.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/. */
///
/// Implementation of the callbacks that the CSS s... | node.parent_node()
} |
<|file_name|>domparser.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::codegen::Bindings::DocumentBinding::Docu... | use dom::document::DocumentSource;
use dom::window::{Window, WindowHelpers}; |
<|file_name|>test_scrooge_gen_integration.py<|end_file_name|><|fim▁begin|># coding=utf-8
# Copyright 2014 Pants project contributors (see CONTRIBUTORS.md).<|fim▁hole|>
from __future__ import (absolute_import, division, generators, nested_scopes, print_function,
unicode_literals, with_statement)
... | # Licensed under the Apache License, Version 2.0 (see LICENSE). |
<|file_name|>game.cpp<|end_file_name|><|fim▁begin|>/******************************************************************************
* AUTHOR: Alexander Casal
* FILE: game.cpp
* DESCRIPTION: Demonstrate the use of the Strategy Design Pattern through
* a very simple game which allows the user ... | |
<|file_name|>subtitle.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
import codecs
import logging
import os
import chardet
import pysrt
from .video import Episode, Movie
from .utils import sanitize, sanitize_release_group
logger = logging.getLogger(__name__)
#: Subtitle extensions
SUBTITLE_EXTENSIONS = ('... | |
<|file_name|>list.ts<|end_file_name|><|fim▁begin|>import { autoinject } from 'aurelia-framework';
import { Customers } from './customers';
import { Router } from 'aurelia-router';
@autoinject()
export class List {
heading = 'Customer management';
customerList = [];
customers: Customers;
router: Router;
co... | |
<|file_name|>simplex_optim.py<|end_file_name|><|fim▁begin|>#! /usr/bin/env python
"""
Module with simplex (Nelder-Mead) optimization for defining the flux and
position of a companion using the Negative Fake Companion.
"""
from __future__ import print_function
import numpy as np
import matplotlib.pyplot as plt
from s... | |
<|file_name|>test_postgres.py<|end_file_name|><|fim▁begin|># Copyright Hybrid Logic Ltd. See LICENSE file for details.
"""
Tests for running and managing PostgreSQL with Flocker.
"""
from unittest import skipUnless
from uuid import uuid4
from pyrsistent import pmap, freeze, thaw
from twisted.python.filepath import ... | database=database) |
<|file_name|>processor.go<|end_file_name|><|fim▁begin|>package slack
import (
"encoding/json"
"fmt"
"log"
"regexp"
"strings"
)
const (
slackEventTypeMessage = "message"
maxMessageSize = 4000
maxMessageLines = 25
)
// Processor type processes inbound events from Slack
type Processor struct {
// Connection ... | // process direct messages
m := &Message{eventStream: p, responseStrategy: send, Text: text.(string), From: userFullName, fromId: userId, channel: data["channel"].(string)} |
<|file_name|>JMeterClientConnectionOperator.java<|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 addition... | * |
<|file_name|>TextOutput.js<|end_file_name|><|fim▁begin|>import {appendHtml, combine} from './../util';
const ELEMENT_NAMES = {
frameName: 'text-frame',
messageName: 'text-message',
indicatorName: 'text-indicator'
};
let createElements = (container, names) => {
const elements = '\
<div class="text-frame" i... |
this.textMessageFrame = document.getElementById(elementNames.frameName); |
<|file_name|>test_serialize.py<|end_file_name|><|fim▁begin|>import json
import time
import jps
class MessageHolder(object):
def __init__(self):
self.saved_msg = []
def __call__(self, msg):
self.saved_msg.append(msg)
def test_pubsub_with_serialize_json():
holder = MessageHolder()
s... | |
<|file_name|>issue-54109-without-witness.rs<|end_file_name|><|fim▁begin|>// run-rustfix
// This test is to check if suggestions can be applied automatically.
#![allow(dead_code, unused_parens)]
fn main() {}
fn test_and() {
let a = true;
let b = false;
let _ = a and b; //~ ERROR `and` is not a logical o... | println!("both");
}
}
|
<|file_name|>logfwd.rs<|end_file_name|><|fim▁begin|>use libc::c_char;
use std::sync::Once;
use crate::raw;
/// Manually initialize logging.
///
/// It is optional to call this function, and safe to do so more than once.
pub fn init() {
static mut INIT: Once = Once::new();
unsafe {
INIT.call_once(|| {... | use log::Level;
use std::ffi::CStr;
let level = match level { |
<|file_name|>query-interface.js<|end_file_name|><|fim▁begin|>'use strict';
const Utils = require('./utils');
const _ = require('lodash');
const DataTypes = require('./data-types');
const SQLiteQueryInterface = require('./dialects/sqlite/query-interface');
const MSSSQLQueryInterface = require('./dialects/mssql/query-in... | deferConstraints(transaction, options) { |
<|file_name|>persian.js<|end_file_name|><|fim▁begin|><|fim▁hole|>version https://git-lfs.github.com/spec/v1
oid sha256:ecdcfeb6d9c10e04bf103e6105698af7bda97180bfc3c7545cce74ce2a73f5eb
size 4291<|fim▁end|> | |
<|file_name|>test_parser.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
##
## This file is part of Invenio.
## Copyright (C) 2014, 2015 CERN.
##
## Invenio 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 Founda... | self.assertEquals(
Model_parser.resolve_models(
['test_base', 'test_model'], 'testsuite')['fields'],
test_model['fields']) |
<|file_name|>app.interface.ts<|end_file_name|><|fim▁begin|>'use strict';
/**
* Express imports
*/
import { Application } from "express-serve-static-core";
<|fim▁hole|>
/**
* SubApp interface designed for all *Express classes,
* actually describing a sub-app, from the Express point of view.
* Make sure all these c... | /**
* Third-party imports ( https://www.npmjs.com/~types )
*/
import * as debug from "debug"; |
<|file_name|>qgoogleauthenticator.hpp<|end_file_name|><|fim▁begin|>#ifndef QGOOGLEAUTHENTICATOR_H
#define QGOOGLEAUTHENTICATOR_H<|fim▁hole|>#include <QDateTime>
#include <QtEndian>
#include "base32.h"
#include "hmac.h"
#define SECRET_LENGTH 16
#define VERIFICATION_CODE_MODULUS (1000*1000) // Six digits
class QGOOGLEA... |
#include "qgoogleauthenticator_global.h"
|
<|file_name|>dependency_loader.ts<|end_file_name|><|fim▁begin|>import {ScriptReceivers, ScriptReceiverFactory} from './script_receiver_factory';
import Runtime from 'runtime';
import ScriptRequest from './script_request';
/** Handles loading dependency files.<|fim▁hole|> * not. It is caller's responsibility to make su... | *
* Dependency loaders don't remember whether a resource has been loaded or |
<|file_name|>Client.py<|end_file_name|><|fim▁begin|>from socket import *
import sys
clientSocket = socket(AF_INET, SOCK_STREAM) #creates socket
server_address = ('127.0.0.1', 80)#create connection at this given port
<|fim▁hole|>filename=raw_input("ENTER THE FILENAME: ")
f = open(filename[0:])
outputdata = f.read()#... | print >>sys.stderr, 'CONNECTING TO %s AT PORT %s' % server_address
clientSocket.connect(server_address)#connect to server at given address |
<|file_name|>tika.js<|end_file_name|><|fim▁begin|>/*jshint node:true*/
/*global test, suite, setup, teardown*/
'use strict';
var assert = require('assert');
var tika = require('../');
suite('document tests', function() {
test('detect txt content-type', function(done) {
tika.type('test/data/file.txt', function(err... | });
});
|
<|file_name|>proc-macro.rs<|end_file_name|><|fim▁begin|>extern crate cargotest;
extern crate hamcrest;
use cargotest::is_nightly;
use cargotest::support::{project, execs};
use hamcrest::assert_that;
#[test]
fn probe_cfg_before_crate_type_discovery() {
if !is_nightly() {
return;
}
let client = pro... | .file("Cargo.toml", r#" |
<|file_name|>Action.java<|end_file_name|><|fim▁begin|>package com.smartgwt.mobile.client.widgets;
import com.google.gwt.resources.client.ImageResource;
public abstract class Action {
private ImageResource icon;
private int iconSize;
private String title;
private String tooltip;
public Action(Str... | this.title = title; |
<|file_name|>admin.py<|end_file_name|><|fim▁begin|>from django.contrib import admin
from modeltranslation.admin import TranslationAdmin
from .models import Campaign<|fim▁hole|>class CampaignAdmin(TranslationAdmin):
list_display = ("__str__", "url", "image", "active")
admin.site.register(Campaign, CampaignAdmin)<... | |
<|file_name|>host_file_system_iterator_test.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
# Copyright 2013 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
from copy import deepcopy
import unittest
from host_file_s... | self._GetStableChannelInfo(13),
self._GetStableChannelInfo(14),
self._GetStableChannelInfo(15),
self._GetStableChannelInfo(16), |
<|file_name|>lyg0vtw_client.py<|end_file_name|><|fim▁begin|><|fim▁hole|>'A simple client for accessing api.ly.g0v.tw.'
import json
import unittest
try:
import urllib.request as request
import urllib.parse as urlparse
except:
import urllib2 as request
import urllib as urlparse
def assert_args(func, *args):
def in... | #!/usr/bin/env python
# encoding: utf-8
|
<|file_name|>EntityWhereChange.d.ts<|end_file_name|><|fim▁begin|>import { AbstractEntityChangeApi, AbstractEntityChange, StubAbstractEntityChange } from "./AbstractEntityChange";
/**
* Created by Papa on 9/15/2016.
*/
export interface EntityWhereChangeApi extends AbstractEntityChangeApi {
numberOfAffectedRecords:... | }
export declare class StubWhereEntityChange extends StubAbstractEntityChange implements EntityWhereChangeApi { |
<|file_name|>callback.rs<|end_file_name|><|fim▁begin|>// Copyright (c) 2016 Yusuke Sasaki
//
// This software is released under the MIT License.
// See http://opensource.org/licenses/mit-license.php or <LICENSE>.
use ffi;
use itertools::{Itertools, Zip};
use std::mem::transmute;
use std::ops::Deref;
use std::ptr::nu... | const MIPNODE: i32 = 5;
const MESSAGE: i32 = 6;
const BARRIER: i32 = 7;
|
<|file_name|>validation.js<|end_file_name|><|fim▁begin|>/*
============================================
G5Framework
=============================================
validation.js
==============================================
*/
var formValidation;
(function($){
formValidation = function(){
... |
}; |
<|file_name|>_schema.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python3
# -*- Mode:Python; indent-tabs-mode:nil; tab-width:4 -*-
#
# Copyright (C) 2016 Canonical Ltd
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 3 as
# published b... | |
<|file_name|>mod.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/. */
//! Computed values.
use app_units::Au;
use euclid::size::Size2D... | }
impl ToComputedValue for specified::BorderRadiusSize {
type ComputedValue = BorderRadiusSize; |
<|file_name|>prettydate.py<|end_file_name|><|fim▁begin|>def pretty_date(time=False):
"""
Get a datetime object or a int() Epoch timestamp and return a
pretty string like 'an hour ago', 'Yesterday', '3 months ago',
'just now', etc
"""
from datetime import datetime
now = datetime.now()<|fim▁ho... | if type(time) is int:
diff = now - datetime.fromtimestamp(time)
elif isinstance(time,datetime): |
<|file_name|>set_file_cache_expired_config.go<|end_file_name|><|fim▁begin|>package cdn
//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
//
//Unle... | response = &SetFileCacheExpiredConfigResponse{
BaseResponse: &responses.BaseResponse{}, |
<|file_name|>Network.py<|end_file_name|><|fim▁begin|>import os
import re
import netifaces as ni
from socket import *
from Components.Console import Console
from Components.PluginComponent import plugins
from Plugins.Plugin import PluginDescriptor
from boxbranding import getBoxType
class Network:
def __init__(self):
... | currif = "" |
<|file_name|>writer.rs<|end_file_name|><|fim▁begin|>use std::fs::OpenOptions;
use std::io::Result;
use std::path::Path;
use byteorder::{ BigEndian, LittleEndian, WriteBytesExt };
pub fn write_pcm(filename: &str, samples: Vec<i16>) -> Result<()> {
let path = Path::new(filename);
let mut f = try!(OpenOptions::n... | let channels = 1;
let bit_depth = 16; |
<|file_name|>mssmUtils.cpp<|end_file_name|><|fim▁begin|>#include "mssmUtils.h"
#include "softsusy.h"
#include <iostream>
namespace softsusy {
double sw2 = 1.0 - sqr(MW / MZ),
gnuL = 0.5,
guL = 0.5 - 2.0 * sw2 / 3.0,
gdL = -0.5 + sw2 / 3.0,
geL = -0.5 + sw2,
guR = 2.0 * sw2 / 3.0,
gdR = -sw2 / 3.0,
geR ... | case 3:
switch(posj) {
case 3: out = "stau"; break; |
<|file_name|>snapscroll.py<|end_file_name|><|fim▁begin|>#############################################################################
##
## Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
## Contact: Qt Software Information (qt-info@nokia.com)
##
## This file is part of the Graphics Dojo project on Qt... | i += 1 |
<|file_name|>mac.py<|end_file_name|><|fim▁begin|>#Copyright 2013 Paul Barton
#
#This program is free software: you can redistribute it and/or modify
#it under the terms of the GNU General Public License as published by
#the Free Software Foundation, either version 3 of the License, or
#(at your option) any later versio... | None, # No source |
<|file_name|>uploads.py<|end_file_name|><|fim▁begin|>from flask.ext import uploads
allowed = uploads.IMAGES<|fim▁hole|> allow=allowed,
deny=())
images = uploads.UploadSet('images', allowed)
images._config = _config<|fim▁end|> | _config = uploads.UploadConfiguration(
'./Application/static/uploads/',
base_url='/static/uploads/', |
<|file_name|>framed.rs<|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 Apach... | |
<|file_name|>KickOutFlockHandler.java<|end_file_name|><|fim▁begin|>package com.sean.im.client.push.handler;
import com.alibaba.fastjson.JSON;
import com.sean.im.client.constant.Global;<|fim▁hole|>import com.sean.im.client.tray.TrayManager;
import com.sean.im.client.util.MusicUtil;
import com.sean.im.commom.core.Protoc... | import com.sean.im.client.core.ApplicationContext;
import com.sean.im.client.core.PushHandler;
import com.sean.im.client.form.MainForm; |
<|file_name|>MW_Timer.cpp<|end_file_name|><|fim▁begin|>#include "MW_Timer.hpp"
<|fim▁hole|>{
reset();
}
bool MW_Timer::get() const
{
b_mutex.lock();
bool retVal = MPI::Wtime() > expirationTime;
b_mutex.unlock();
return retVal;
}
void MW_Timer::reset()
{
b_mutex.lock();
expirationTime = MPI::Wtime() + period;... | MW_Timer::MW_Timer(double periodInSeconds): period(periodInSeconds) |
<|file_name|>islamic.js<|end_file_name|><|fim▁begin|>define({ root:
//begin v1.x content
{
"months-format-narrow": [
"1",
"2",
"3",
"4",
"5",
"6",
"7",
"8",
"9",
"10",
"11",
"12"
],
"quarters-standAlone-narrow": [
"1",
"2",
"3",
"4"
],
"dateFormatItem-yQQQ": "y QQQ",
"dateFormatIt... | "dayPeriods-format-wide-pm": "PM",
"dateFormat-full": "EEEE, y MMMM dd",
"dateFormatItem-Md": "M-d",
"dayPeriods-format-abbr-am": "AM", |
<|file_name|>element.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/. */
//! Element nodes.
use devtools_traits::AttrInfo;
use dom::a... | local_name!("menuitem") | local_name!("meta") | |
<|file_name|>cacheDevice.js<|end_file_name|><|fim▁begin|>/**
* Created by quanpower on 14-8-20.
*/
var config = require('./../config');
var redis = require('./redis');
var _ = require('lodash');
function cacheDevice(device){
if(device){
var cloned = _.clone(device);
redis.set('DEVICE_' + devic... | } |
<|file_name|>issue-41868.rs<|end_file_name|><|fim▁begin|>// check-pass
// Defaulted assoc. types should normalize properly in impls that don't
// override them.
#![feature(associated_type_defaults)]
pub struct Foo;
<|fim▁hole|> fn read(rdr: &mut Foo) -> Option<Self::Output>;
}
impl CanDecode for u8 {
fn read... | pub trait CanDecode: Sized {
type Output = Self; |
<|file_name|>mv_sink.js<|end_file_name|><|fim▁begin|>function glitch_frame(frame)
{
// bail out if we have no motion vectors
let mvs = frame["mv"];
if ( !mvs )
return;
// bail out if we have no forward motion vectors
let fwd_mvs = mvs["forward"];
<|fim▁hole|> return;
// ... | if ( !fwd_mvs )
|
<|file_name|>main.rs<|end_file_name|><|fim▁begin|>// Copyright 2020 The Exonum Team
//
// 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
//
/... | |
<|file_name|>manager.py<|end_file_name|><|fim▁begin|># ==============================================================================
# Copyright (C) 2011 Diego Duclos
# Copyright (C) 2011-2018 Anton Vorobyov
#
# This file is part of Eos.
#
# Eos is free software: you can redistribute it and/or modify
# it under the te... | logger = getLogger(__name__)
|
<|file_name|>deck.repl.js<|end_file_name|><|fim▁begin|>function content($slide) {
return $slide.children().first().nextAll();
}
function addReplToSlide($, deck, $slide) {
var endpoint = $[deck]('getOptions').repl.endpoint;
content($slide).wrapAll('<div class="repl-slide-column repl-text-column"></div>');
var r... |
startPrompt = function () {
jqconsole.Prompt(true, function (input) { |
<|file_name|>test_verification.py<|end_file_name|><|fim▁begin|>from rest_framework import status
from rest_framework.authtoken.models import Token
from django.utils.translation import ugettext_lazy as _
from rest_framework.test import APITestCase
from django.contrib.auth import get_user_model
from django.urls import re... | |
<|file_name|>config.js<|end_file_name|><|fim▁begin|>/*global define*/
/*global test*/
/*global equal*/
define(['models/config'], function (Model) {
'use strict';
module('Config model');
test('Can be created with default values', function() {
var note = new Model();
equal(note.get('name'), ... | |
<|file_name|>patch_ref_creator_field.py<|end_file_name|><|fim▁begin|>from apps.plus_permissions.default_agents import get_admin_user
from apps.plus_permissions.models import GenericReference
def patch():
for ref in GenericReference.objects.filter(creator=None):<|fim▁hole|>
patch()<|fim▁end|> | ref.creator = get_admin_user()
ref.save() |
<|file_name|>postupgrade.go<|end_file_name|><|fim▁begin|>/*
Copyright 2017 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
Un... | |
<|file_name|>Tw2ParticleEmitter.js<|end_file_name|><|fim▁begin|>/* eslint no-unused-vars:0 */
import {util} from '../../math';
/**
* Particle Emitter base class
*
* @property {number|string} id
* @property {string} name
* @property {Tw2ParticleSystem} particleSystem
* @class
*/
export class Tw2ParticleEmitter
{... | constructor()
{ |
<|file_name|>ldap.py<|end_file_name|><|fim▁begin|># -*- coding: utf8 -*-
from flask_login import AnonymousUserMixin
from .interface import BUIhandler, BUIuser, BUIloader
from ...utils import __
import ssl
try:
from ldap3 import (
Server,
Connection,
Tls,
ALL,
RESTARTABLE,
... |
@property
def loader(self): |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.