prompt large_stringlengths 70 991k | completion large_stringlengths 0 1.02k |
|---|---|
<|file_name|>middles.go<|end_file_name|><|fim▁begin|><|fim▁hole|>)
// DataSender send all languages and current language to view template.
func DataSender(a *orivil.App) {
if filter, ok := a.Get(orivil.SvcI18nFilter).(*Filter); ok {
currentLang := GetFullName(filter.currentLang)
a.With("currentLang", currentLan... | package i18n
import (
"gopkg.in/orivil/orivil.v1" |
<|file_name|>artnet-server.py<|end_file_name|><|fim▁begin|>from artnet import *
import SocketServer
import time, os, random, datetime, sys
import argparse<|fim▁hole|>
DEBUG = False
UDP_IP = "2.0.0.61"
UDP_PORT = 6454<|fim▁end|> | import socket
import struct
from subprocess import Popen, PIPE, STDOUT
import glob |
<|file_name|>trip-details.ts<|end_file_name|><|fim▁begin|>import { Component } from '@angular/core';
import { NavController, NavParams } from 'ionic-angular';
/*<|fim▁hole|>
See http://ionicframework.com/docs/v2/components/#navigation for more info on
Ionic pages and navigation.
*/
@Component({
selector: 'page-t... | Generated class for the TripDetails page. |
<|file_name|>CameraLatency.java<|end_file_name|><|fim▁begin|>/*
* Copyright (C) 2009 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... | //skip the first measurement |
<|file_name|>Login.py<|end_file_name|><|fim▁begin|># !/usr/bin/python
# -*- coding: utf-8 -*-
import urllib
import urllib2
import cookielib
import base64
import re
import json
import hashlib
'''该登录程序是参考网上写的'''
cj = cookielib.LWPCookieJar()
cookie_support = urllib2.HTTPCookieProcessor(cj)
opener = urllib2.build_open... | |
<|file_name|>modulegen__gcc_LP64.py<|end_file_name|><|fim▁begin|>from pybindgen import Module, FileCodeSink, param, retval, cppclass, typehandlers
import pybindgen.settings
import warnings
class ErrorHandler(pybindgen.settings.ErrorHandler):
def handle_error(self, wrapper, exception, traceback_):
warning... | register_Ns3SimpleRefCount__Ns3EventImpl_Ns3Empty_Ns3DefaultDeleter__lt__ns3EventImpl__gt___methods(root_module, root_module['ns3::SimpleRefCount< ns3::EventImpl, ns3::empty, ns3::DefaultDeleter<ns3::EventImpl> >'])
register_Ns3SimpleRefCount__Ns3HashImplementation_Ns3Empty_Ns3DefaultDeleter__lt__ns3HashImpleme... |
<|file_name|>testclient.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python
import socket
import sys
<|fim▁hole|>sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
try:
# Connect to server and send data
print "Connected to ", HOST, ":", PORT, "\n","Awaiting input\n"
data = sys.stdin.readline()
sock... | HOST, PORT = "24.21.106.140", 8080
# Create a socket (SOCK_STREAM means a TCP socket) |
<|file_name|>lonely-pixel-ii.py<|end_file_name|><|fim▁begin|># Time: O(m * n)
# Space: O(m * n)
import collections
class Solution(object):
def findBlackPixel(self, picture, N):
"""
:type picture: List[List[str]]
:type N: int
:rtype: int
"""
rows, cols = [0] * len(... | lookup = collections.Counter(map(tuple, picture))
cols = [col.count('B') for col in zip(*picture)]
return sum(N * zip(row, cols).count(('B', N)) \
for row, cnt in lookup.iteritems() \ |
<|file_name|>OrderItemDetailsSummary.tsx<|end_file_name|><|fim▁begin|>import React from 'react';
import { connect } from 'react-redux';
import { getFormValues, isValid } from 'redux-form';
import { OfferingLogo } from '@waldur/marketplace/common/OfferingLogo';
import { FORM_ID } from '@waldur/marketplace/details/const... | </> |
<|file_name|>main.rs<|end_file_name|><|fim▁begin|>//Test File gtk_test
extern crate gtk;
//Custom mods
mod system_io;
mod gtk_converter;
pub mod m_config;
//Os interaction
use std::process::Command;
use std::process::ChildStdout;<|fim▁hole|>
use gtk::Builder;
use gtk::prelude::*;
// make moving clones into closures... |
use std::io;
use std::io::prelude::*; |
<|file_name|>models.py<|end_file_name|><|fim▁begin|>from django.db import models
from django.contrib.auth.models import User
from django.contrib.sites.models import Site
from django.utils.translation import ugettext_lazy as _
from press_links.enums import STATUS_CHOICES, LIVE_STATUS, DRAFT_STATUS
from django.utils impo... | verbose_name = _('Press Link')
verbose_name_plural = _('Press Links') |
<|file_name|>MainTestKMeans_saveToFile.java<|end_file_name|><|fim▁begin|>package ca.pfv.spmf.test;
import java.io.IOException;
import java.io.UnsupportedEncodingException;
import java.net.URL;
import ca.pfv.spmf.algorithms.clustering.kmeans.AlgoKMeans;
/**
* Example of how to use the KMEans algorithm, in source co... | |
<|file_name|>pinsrb.rs<|end_file_name|><|fim▁begin|>use ::{BroadcastMode, Instruction, MaskReg, MergeMode, Mnemonic, OperandSize, Reg, RoundingMode};
use ::RegType::*;
use ::instruction_def::*;
use ::Operand::*;
use ::Reg::*;
use ::RegScale::*;<|fim▁hole|>
fn pinsrb_1() {
run_test(&Instruction { mnemonic: Mnemonic:... | |
<|file_name|>urls.py<|end_file_name|><|fim▁begin|># Copyright 2010 Canonical Ltd. This software is licensed under the
# GNU Affero General Public License version 3 (see the file LICENSE).
from django.conf.urls import patterns, url
from piston.authentication import HttpBasicAuthentication
from piston.resource import ... | handler=v10.AccountsHandler, |
<|file_name|>set_watch_mode.rs<|end_file_name|><|fim▁begin|>use std::io;
use super::super::{WriteTo, WatchMode, WatchModeReader, WriteResult, Reader, ReaderStatus, MessageInner, Message};
#[derive(Debug, Eq, PartialEq, Clone)]
pub struct SetWatchMode {
mode: WatchMode,
}
#[derive(Debug)]
pub struct SetWatchModeRe... | impl Reader<SetWatchMode> for SetWatchModeReader {
fn resume<R>(&mut self, input: &mut R) -> io::Result<ReaderStatus<SetWatchMode>> where R: io::Read {
let status = self.inner.resume(input)?; |
<|file_name|>export_test.go<|end_file_name|><|fim▁begin|>package s3
import (
"github.com/djbarber/ipfs-hack/Godeps/_workspace/src/github.com/crowdmob/goamz/aws"
)
var originalStrategy = attempts
func SetAttemptStrategy(s *aws.AttemptStrategy) {
if s == nil {
attempts = originalStrategy
} else {
attempts = *s
... | listPartsMax = n
} |
<|file_name|>test_binary_sensor.py<|end_file_name|><|fim▁begin|>"""The test for the bayesian sensor platform."""
import json
import unittest
from homeassistant.components.bayesian import binary_sensor as bayesian
from homeassistant.components.homeassistant import (
DOMAIN as HA_DOMAIN,
SERVICE_UPDATE_ENTITY,
)... | }
}
await async_setup_component(hass, "binary_sensor", config) |
<|file_name|>fake_resourcequota.go<|end_file_name|><|fim▁begin|>/*
Copyright 2016 The Kubernetes Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-... | labels "k8s.io/client-go/pkg/labels"
watch "k8s.io/client-go/pkg/watch" |
<|file_name|>cloneGraph_BFS.py<|end_file_name|><|fim▁begin|>class UndirectedGraphNode:
def __init__(self, x):
self.label = x
self.neighbors = []
#using DFS
class Solution:
# @param node, a undirected graph node
# @return a undirected graph node
def cloneGraph(self, node):
seen=... | head = UndirectedGraphNode(node.label)
seen[node] = head
visited.append(node)
while len(visited) != 0: |
<|file_name|>component.ts<|end_file_name|><|fim▁begin|>import { Component } from '@angular/core';
@Component({<|fim▁hole|> styleUrls: [ 'style.scss' ]
})
export class LogoComponent {
}<|fim▁end|> | selector: 'logo-component',
templateUrl: 'template.html', |
<|file_name|>response.rs<|end_file_name|><|fim▁begin|>use super::error::InvalidJsonError;
use serde_json::Map;
use serde_json::Value as JsonValue;
/// The response from a command send to the DaZeus server.
#[derive(Debug, Clone, PartialEq)]
pub struct Response {
data: JsonValue,
}
impl Response {
/// Create ... | |
<|file_name|>bit_util.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 A... | assert_eq!(true, get_bit(&[0b01001001, 0b01010010], 14)); |
<|file_name|>bench.rs<|end_file_name|><|fim▁begin|>#![feature(test, recover)]
extern crate kirk;
extern crate crossbeam;
extern crate test;
use std::panic::RecoverSafe;
use std::sync::Arc;
use std::sync::atomic::{AtomicUsize, Ordering};
use test::{Bencher, black_box};
use kirk::{Job, Pool, Task, Deque, Channel};
s... | |
<|file_name|>Isolate_stack_ROI2.py<|end_file_name|><|fim▁begin|>from ij import IJ
from ij.gui import NonBlockingGenericDialog
from ij import WindowManager
from ij.gui import WaitForUserDialog
from ij import ImageStack
from ij import ImagePlus
theImage = IJ.getImage()
sourceImages = []
if theImage.getNChannels() == 1:... | for sourceImage in sourceImages:
sourceImage.close() |
<|file_name|>models.py<|end_file_name|><|fim▁begin|>from django.db import models
import warnings
from django.utils import timezone
import requests
from image_cropping import ImageRatioField
class CompMember(models.Model):
"""A member of compsoc"""
class Meta:
verbose_name = 'CompSoc Member'
v... | ''')
return self.name |
<|file_name|>res_lang.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
# Copyright 2017 LasLabs Inc.
# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl).
from odoo import api, fields, models, _
from odoo.exceptions import ValidationError
class ResLang(models.Model):
_inherit = 'res.lang'
... | 'be selected.', |
<|file_name|>profile_core.py<|end_file_name|><|fim▁begin|>import cProfile
from pathlib import Path
<|fim▁hole|> try:
scenario_dir.mkdir(parents=True)
except FileExistsError:
pass
cProfile.runctx(
'from dmprsim.scenarios.python_profile import main;'
'main(args, results_dir, sc... | def main(args, results_dir: Path, scenario_dir: Path): |
<|file_name|>eq.rs<|end_file_name|><|fim▁begin|>#![feature(core)]
extern crate core;
// macro_rules! e {
// ($e:expr) => { $e }
// }
// macro_rules! tuple_impls {
// ($(
// $Tuple:ident {
// $(($idx:tt) -> $T:ident)+
// }
// )+) => {
// ... | // (2) -> C
// (3) -> D |
<|file_name|>InlineChordDefinition.ts<|end_file_name|><|fim▁begin|>import { IChordDefinition } from "./IChordDefinition";
import { Chord } from "./Chord";
import { IChordFingering } from "./IChordFingering";
export class InlineChordDefinition implements IChordDefinition {
constructor(private readonly chord: ... | }
get fingering(): IChordFingering {
return this.chord.fingering!;
|
<|file_name|>form_group_spec.ts<|end_file_name|><|fim▁begin|>/**
* @license
* Copyright Google Inc. All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.io/license
*/
import {async, fakeAsync, tick} from '@angular/core/tes... | |
<|file_name|>ExtensibleObject.js<|end_file_name|><|fim▁begin|>function extensibleObject() {
let obj = {
extend: function(template){
for(let parentProp of Object.keys(template)){
if(typeof(template[parentProp]) == 'function'){
Object.getPrototypeOf(obj)[parentP... | } else {
obj[parentProp] = template[parentProp]; |
<|file_name|>bitcoin_gl.ts<|end_file_name|><|fim▁begin|><?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE TS>
<TS version="2.1" language="gl">
<context>
<name>AboutDialog</name>
<message>
<location filename="../forms/aboutdialog.ui" line="+14"/>
<source>About Gridcoin</source>
<translatio... | |
<|file_name|>request.py<|end_file_name|><|fim▁begin|># urllib3/request.py
# Copyright 2008-2013 Andrey Petrov and contributors (see CONTRIBUTORS.txt)
#
# This module is part of urllib3 and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php
try:
from urllib.parse import urlencod... | self.headers = headers or {}
def urlopen(self, method, url, body=None, headers=None, |
<|file_name|>schema-form.js<|end_file_name|><|fim▁begin|>// Deps is sort of a problem for us, maybe in the future we will ask the user to depend
// on modules for add-ons
var deps = ['ObjectPath'];
try {
//This throws an expection if module does not exist.
angular.module('ngSanitize');
deps.push('ngSanitize');
}... | |
<|file_name|>manage.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
import os.path
import sys
DIRNAME = os.path.dirname(__file__)
if not DIRNAME in sys.path:
sys.path.append(DIRNAME)
<|fim▁hole|> import sys
sys.stderr.write("Error: Can't find the file 'settings.py' in the directory containing %r. It ... | from django.core.management import execute_manager
try:
import settings # Assumed to be in the same directory.
except ImportError: |
<|file_name|>mem.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<|fim▁hole|>//! Memory profiling functions.
use crate::time::duration_from_seconds;
use ipc_channel::ipc::{self, IpcReceiver};
us... | * file, You can obtain one at https://mozilla.org/MPL/2.0/. */
|
<|file_name|>old2new.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
__author__ = 'Bright Pan'
# 注意:我们必须要把old数据库中的yehnet_customer表中的postdate改成add_time
import types
import urllib.request
try:
import simplejson as json
except Exception:
import json
import pymysql
import datetime
import sys
print(sys.ge... | db.process_update(from_table,to_table,map_dict, ('id','id'))
from_table = "yehnet_user_bk" |
<|file_name|>create_sec_package.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python3
###############################################################################
# Copyright 2017 The Apollo Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this fil... |
import secure_upgrade_export as sec_api |
<|file_name|>PermissionAccordion.tsx<|end_file_name|><|fim▁begin|>import {Accordion} from '@/components'
import {PermissionsAccordionTitle} from './PermissionsAccordionTitle'
import {PermissionsAccordionPanel} from '@/components/Permissions/Panel'
import {PermissionsAccordionProvider} from './context'
import type {Role... | <Accordion>
{roles.map(role => (
<PermissionsAccordionProvider role={role}>
<Accordion.Item key={role.name} openClasses="bg-gray-50"> |
<|file_name|>ResourceLabel.js<|end_file_name|><|fim▁begin|>var clover = new Object();
// JSON: {classes : [{name, id, sl, el, methods : [{sl, el}, ...]}, ...]}
clover.pageData = {"classes":[{"el":70,"id":245172,"methods":[{"el":61,"sc":2,"sl":48},{"el":65,"sc":2,"sl":63},{"el":69,"sc":2,"sl":67}],"name":"ResourceLabe... | // JSON: {test_ID : {"methods": [ID1, ID2, ID3...], "name" : "testXXX() void"}, ...};
clover.testTargets = {}
|
<|file_name|>sub_base.py<|end_file_name|><|fim▁begin|># Copyright 2014 OpenStack Foundation
# 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.o... | ))
test_timeout = int(os.environ.get('OS_TEST_TIMEOUT', 0))
if test_timeout == -1: |
<|file_name|>interface.go<|end_file_name|><|fim▁begin|>// +build linux
package linux
import (
"os/exec"
"regexp"
"strings"
"github.com/mackerelio/mackerel-agent/logging"
"github.com/mackerelio/mackerel-agent/spec"
)
// InterfaceGenerator XXX
type InterfaceGenerator struct {
}
// Key XXX
func (g *InterfaceGene... | if matches := ifconfigNameReg.FindStringSubmatch(line); matches != nil {
name = matches[1]
} |
<|file_name|>test_migrations.py<|end_file_name|><|fim▁begin|># Copyright 2010-2011 OpenStack Foundation
# Copyright 2012-2013 IBM Corp.
# 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
# ... | engine, self.REPOSITORY, 267)
self.assertIn("There are 1 records in the " |
<|file_name|>nsistags.py<|end_file_name|><|fim▁begin|>###############################################################################
# Name: nsistags.py #
# Purpose: Generate Tags for Nullsoft Installer Scripts #
# Author: Cody Precord <cp... | txt = fhandle.read() |
<|file_name|>EjbJar.java<|end_file_name|><|fim▁begin|>/*
* Copyright (c) 1998-2012 Caucho Technology -- all rights reserved
*
* This file is part of Resin(R) Open Source
*
* Each copy or derived work must preserve the copyright notice and this
* notice unmodified.
*
* Resin Open Source is free software; you can... |
private boolean _isMetadataComplete; |
<|file_name|>test_sign.rs<|end_file_name|><|fim▁begin|>use eval::eval;
use eval::test_eval::test_eval;
use eval::eval::Printable;
#[test]
fn test_eval_basic_sign() {
test_eval(~"×5", |result| {
match result {
~eval::AplInteger(x) => {
assert_eq!(x, 1);
},
... |
test_eval(~"ׯ5", |result| {
match result {
~eval::AplInteger(x) => { |
<|file_name|>test_CommentMarker.py<|end_file_name|><|fim▁begin|>from __future__ import print_function
import aaf
import aaf.mob
import aaf.define
import aaf.iterator
import aaf.dictionary
import aaf.storage
import aaf.component
import aaf.util
from aaf.util import AUID, MobID
import unittest
import os
cur_dir = os.p... | cm_attr_list_id = AUID("urn:uuid:c72cc817-aac5-499b-af34-bc47fec1eaa8")
strongref = f.dictionary.lookup_typedef("TaggedValueStrongReferenceVector")
cm_prop_name = "CommentMarkerAttributeList" |
<|file_name|>Menu_Utama.java<|end_file_name|><|fim▁begin|>package remasterkit;
import java.awt.BorderLayout;
import java.awt.EventQueue;
import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.UIManager;
import javax.swing.border.EmptyBorder;
import javax.swing.JLabel;
import javax.swing.ImageIcon;
im... | private JTextField txtName;
private JTextField txtURL;
/** |
<|file_name|>show.js<|end_file_name|><|fim▁begin|>var SuperheroesShowRoute = Ember.Route.extend({
model: function(params) {
return(this.store.find('superhero', params.id));
}<|fim▁hole|><|fim▁end|> | });
export default SuperheroesShowRoute; |
<|file_name|>analemma.py<|end_file_name|><|fim▁begin|>"""Solar analemma."""
from ._skyBase import RadianceSky
from ..material.light import Light
from ..geometry.source import Source
from ladybug.epw import EPW
from ladybug.sunpath import Sunpath
import os
try:
from itertools import izip as zip
writemode = 'w... |
Args:
epw_file: Full path to an epw file.
hoys: A list of hours of the year (default: range(8760)). |
<|file_name|>cargo_expand.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 crate::bindgen::config::Profile;
use std::env;
use s... | if use_tempdir {
_temp_dir = Some(Builder::new().prefix("cbindgen-expand").tempdir()?);
cmd.env("CARGO_TARGET_DIR", _temp_dir.unwrap().path());
} else if let Ok(ref path) = env::var("CARGO_EXPAND_TARGET_DIR") { |
<|file_name|>gtk_builder.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# tests/client/gtk_builder_lint.py
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of... | from king_phisher import testing |
<|file_name|>multithreads.py<|end_file_name|><|fim▁begin|>"""
Allow to trace called methods and package
"""
import frida
import re
syms = []
def on_message(message, data):
global syms
global index, filename
if message['type'] == 'send':
if "SYM" in message["payload"]:
c = message["payl... | print "FLAG: " + "".join(syms) |
<|file_name|>0007_auto_20160710_1833.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
# Generated by Django 1.9.7 on 2016-07-10 18:33
from __future__ import unicode_literals<|fim▁hole|>class Migration(migrations.Migration):
dependencies = [
('main', '0006_auto_20160616_1640'),
]
operations ... |
from django.db import migrations, models
|
<|file_name|>test_abs.py<|end_file_name|><|fim▁begin|>from .. utils import TranspileTestCase, BuiltinFunctionTestCase
class AbsTests(TranspileTestCase):
def test_abs_not_implemented(self):
self.assertCodeExecution("""
class NotAbsLike:
pass
x = NotAbsLike()
... | 'test_frozenset', |
<|file_name|>char_recognition_tasks.py<|end_file_name|><|fim▁begin|># Copyright 2021, The TensorFlow Federated 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.apa... |
train_preprocess_fn = emnist_preprocessing.create_preprocess_fn( |
<|file_name|>routes.js<|end_file_name|><|fim▁begin|>var _ = require('lodash'),
restify = require('restify'),
async = require('async');
module.exports = function(settings, server, db){
var globalLogger = require(settings.path.root('logger'));
var auth = require(settings.path.lib('auth'))(settings, db)... | |
<|file_name|>loggedusermenu.js<|end_file_name|><|fim▁begin|>'use strict';
/**
* @ngdoc directive
* @name FlyveMDM.directive:loggedUserMenu
* @description
* # loggedUserMenu
*/
angular.module('FlyveMDM')
.directive('loggedUserMenu', function () {
return {
templateUrl: 'views/loggedusermenu.html',
... | |
<|file_name|>lib.rs<|end_file_name|><|fim▁begin|>extern crate ai_behavior;
extern crate find_folder;
extern crate gfx_device_gl;
extern crate graphics;
extern crate nalgebra;
extern crate ncollide;
extern crate piston_window;
extern crate rand;
extern crate sprite;
extern crate uuid;
mod mobs;
use gfx_device_gl::Reso... |
pub struct Game {
scene: Scene<Texture<Resources>>, |
<|file_name|>extract.py<|end_file_name|><|fim▁begin|># -*- coding: utf8 -*-
# Extract entities from text
#
# Author: Romary Dupuis <romary.dupuis@altarika.com>
#
# Copyright (C) 2016 Romary Dupuis
# Licensed under the GNU LGPL v2.1 - http://www.gnu.org/licenses/lgpl.html
from commis import Command
from commis import... | 'metavar': 'LANG',
'default': 'en',
'help': 'language of text: en, ja, fr etc.'
}, |
<|file_name|>bitporno.py<|end_file_name|><|fim▁begin|>'''<|fim▁hole|> urlresolver XBMC Addon
Copyright (C) 2017
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,... | |
<|file_name|>index.js<|end_file_name|><|fim▁begin|>import { InvalidArgumentError } from '../errors/InvalidArgumentError';
import { NotImplementedError } from '../errors/NotImplementedError';
import mustache from 'mustache';
import '../utils/Function';
// The base class for a control
export class Control {
// The cons... | if (null === template || undefined === template) {
throw new InvalidArgumentError('Cannot create the control because the template cannot be null or undefined');
} |
<|file_name|>TestGroupModification.java<|end_file_name|><|fim▁begin|>package com.chisw.work.addressbook.test;
import com.chisw.work.addressbook.Data.GroupData;
import com.chisw.work.addressbook.Data.Groups;
import org.testng.annotations.BeforeMethod;
import org.testng.annotations.Test;
import static org.hamcrest.CoreM... | assertThat(app.groups().count(),equalTo(before.size()));
Groups after = app.db().groups();
assertThat(after, equalTo(before.withoutAdded(modifiedGroup).withAdded(group))); |
<|file_name|>rep.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright (c) 2013 ASMlover. 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 ... | |
<|file_name|>non_ts_pseudo_class_list.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 file contains a helper macro incl... | ("-moz-drag-over", MozDragOver, mozDragOver, IN_DRAGOVER_STATE, _),
("target", Target, target, IN_TARGET_STATE, _),
("indeterminate", Indeterminate, indeterminate, IN_INDETERMINATE_STATE, _), |
<|file_name|>root_bsd.go<|end_file_name|><|fim▁begin|><|fim▁hole|>// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
// +build dragonfly freebsd netbsd openbsd rumprun
package x509
// Possible certificate files; stop after finding one.
var certFiles = []string{
"... | // Copyright 2015 The Go Authors. All rights reserved. |
<|file_name|>iterutils.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
""":mod:`itertools` is full of great examples of Python generator
usage. However, there are still some critical gaps. ``iterutils``
fills many of those gaps with featureful, tested, and Pythonic
solutions.
Many of the functions below have t... | |
<|file_name|>cryptography.rs<|end_file_name|><|fim▁begin|>pub use rust_sodium::crypto::box_::curve25519xsalsa20poly1305 as crypto_box;
pub use rust_sodium::crypto::hash::sha256;
pub use rust_sodium::crypto::scalarmult::curve25519 as scalarmult;
pub use self::crypto_box::{PrecomputedKey, PublicKey, SecretKey};
use aut... | let their_temp_pk = PublicKey::from_slice(&pk).unwrap();
let data = buf[crypto_box::PUBLICKEYBYTES..].to_vec();
Ok((their_temp_pk, data))
} |
<|file_name|>warequest.py<|end_file_name|><|fim▁begin|>from .waresponseparser import ResponseParser
from yowsup.env import YowsupEnv
import sys
import logging
from axolotl.ecc.curve import Curve
from axolotl.ecc.ec import ECPublicKey
from yowsup.common.tools import WATools
from cryptography.hazmat.primitives.ciphers.a... |
if preview:
logger.info("Preview request, skip response handling and return None") |
<|file_name|>httpService.js<|end_file_name|><|fim▁begin|>"use strict";
/**
* Storing multiple constant values inside of an object
* Keep in mind the values in the object mean they can be modified
* Which makes no sense for a constant, use wisely if you do this
*/
app.service('$api', ['$http', '$token', '$rootScope... |
this.updateUserProfile = function (data) {
return $http.put(SERVER_URI + 'update_profile', data, config); |
<|file_name|>functions1.rs<|end_file_name|><|fim▁begin|>// functions1.rs
// Make me compile! Execute `rustlings hint functions1` for hints :)
// I AM NOT DONE
fn main() {
call_me();<|fim▁hole|>}<|fim▁end|> | |
<|file_name|>test_pkcs1_pss.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
#
# SelfTest/Signature/test_pkcs1_pss.py: Self-test for PKCS#1 PSS signatures
#
# ===================================================================
# The contents of this file are dedicated to the public domain. To
# the extent that... | 57 7c 2e ea ff a2 0d 88 3a 76 e6 5e 39 4c 69 d4
b3 c0 5a 1e 8f ad da 27 ed b2 a4 2b c0 00 fe 88
8b 9b 32 c2 2d 15 ad d0 cd 76 b3 e7 93 6e 19 95 |
<|file_name|>glmnetPlot.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
"""
--------------------------------------------------------------------------
glmnetPlot.m: plot coefficients from a "glmnet" object
--------------------------------------------------------------------------
DESCRIPTION:
Produces a ... | else:
index = norm
iname = 'L1 Norm' |
<|file_name|>test_nixie_errors.py<|end_file_name|><|fim▁begin|>import unittest, uuid
from nixie.core import Nixie, KeyError
class NixieErrorsTestCase(unittest.TestCase):
def test_read_missing(self):
nx = Nixie()
self.assertIsNone(nx.read('missing'))
def test_update_missing(self):
nx = Nixie()
wit... | |
<|file_name|>PermissionsDeploymentTestCase.java<|end_file_name|><|fim▁begin|>/*
* JBoss, Home of Professional Open Source.
* Copyright 2012, Red Hat, Inc., and individual contributors
* as indicated by the @author tags. See the copyright.txt file in the
* distribution for a full listing of individual contributors.
... | * @see <a href="https://issues.jboss.org/browse/WFLY-6657">WFLY-6657</a>
*/
@Test
public void testWithoutConfiguredMaxBootThreads() throws Exception { |
<|file_name|>benchmark.cpp<|end_file_name|><|fim▁begin|>/**
* @license Apache-2.0
*
* Copyright (c) 2022 The Stdlib 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.... | } |
<|file_name|>AV Rule 78.cpp<|end_file_name|><|fim▁begin|>class Base {
public:
Resource *p;
Base() {
p = createResource();
}
virtual void f() { //has virtual function
//...
}
//...
~Base() { //wrong: is non-virtual
freeResource(p);
}
};
class Derived: public Base {
public:
Resource *dp;
Derived() {
dp... | |
<|file_name|>tests.py<|end_file_name|><|fim▁begin|>from __future__ import division, print_function
import unittest
import inspect
import sympy
from sympy import symbols
import numpy as np
from symfit.api import Variable, Parameter, Fit, FitResults, Maximize, Minimize, exp, Likelihood, ln, log, variables, parameters
fro... | y0_1 = Parameter(0.7, min=0.6, max=0.8)
sig_y_1 = Parameter(0.1, min=0.0, max=0.2)
A_1 = Parameter()
g_1 = A_1 * Gaussian(x, x0_1, sig_x_1) * Gaussian(y, y0_1, sig_y_1) |
<|file_name|>point_2d.rs<|end_file_name|><|fim▁begin|>#[cfg(test)]
#[path="../../../../tests/support/collisions/shapes/_2d/arbitrary_point_2d.rs"]
mod arbitrary;
use std::mem;
use std::ops::Deref;
<|fim▁hole|>use maths::_2d::Vec2D;
use collisions::shapes::Shape;
#[derive(Clone, Debug)]
pub struct Point2D(pub Vec2D);... | |
<|file_name|>queue_config.cpp<|end_file_name|><|fim▁begin|>/*
Copyright (C) 2017 Equinor ASA, Norway.
The file 'queue_config.c' is part of ERT - Ensemble based Reservoir Tool.
ERT is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
... | "ignored \n", |
<|file_name|>top.js<|end_file_name|><|fim▁begin|>$(function() {<|fim▁hole|> logOut : function() {
window.parent.location.href = "logout";
}
}
})<|fim▁end|> | YtopMgr = {
//退出账号 |
<|file_name|>infiniteScroll.directive.ts<|end_file_name|><|fim▁begin|>import { Directive, Output, EventEmitter, HostListener } from '@angular/core';
@Directive({
selector: '[infiniteScroll]',
})
export class InfiniteScrollDirective {
@Output() public endOfPage: EventEmitter<any> = new EventEmitter<any>();
<|fim... | @HostListener('window:scroll')
public scrollPage() { |
<|file_name|>py2_bad.py<|end_file_name|><|fim▁begin|># Requires trailing commas in Py2 but syntax error in Py3k
def True(
foo
):
True(
foo
)
def False(
foo
):
False(
foo
)
def None(
foo
):
None(
foo
)
def nonlocal (
foo
):
nonlocal(
foo<... | ) |
<|file_name|>application.js<|end_file_name|><|fim▁begin|>import Ember from 'ember';
import ApplicationRouteMixin from 'ember-simple-auth/mixins/application-route-mixin';
import config from 'ilios/config/environment';
const { inject } = Ember;
const { service } = inject;
export default Ember.Route.extend(ApplicationRo... | },
//Override the default session invalidator so we can do auth stuff
sessionInvalidated() { |
<|file_name|>_regexpfathername.py<|end_file_name|><|fim▁begin|>#
# Gramps - a GTK+/GNOME based genealogy program
#
# Copyright (C) 2002-2006 Donald N. Allingham
#
# 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 Sof... | # Gramps modules |
<|file_name|>debounce-searches-1-js.js<|end_file_name|><|fim▁begin|>import Controller from '@ember/controller';
import { debounce } from '@ember/runloop';
import fetch from 'fetch';
import RSVP from 'rsvp';
export default class extends Controller {
searchRepo(term) {
return new RSVP.Promise((resolve, reject) => ... | debounce(_performSearch, term, resolve, reject, 600);
}); |
<|file_name|>run_swarming_xcode_install.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
# Copyright 2017 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.
"""
This script runs swarming_xcode_install on the bots. It sh... | """
from __future__ import print_function
|
<|file_name|>mod.rs<|end_file_name|><|fim▁begin|>//! Common data for testing
pub mod hwb_test_data;<|fim▁hole|>pub use self::rgb_hs_test_data::make_test_array as build_hs_test_data;
pub use self::rgb_hs_test_data::TestColor as HsTestColor;<|fim▁end|> | pub mod rgb_hs_test_data;
pub use self::hwb_test_data::build_test_data as build_hwb_test_data;
pub use self::hwb_test_data::TestColor as HwbTestColor; |
<|file_name|>reducer_posts.js<|end_file_name|><|fim▁begin|>import fuzzy from 'fuzzy';
import { resolve } from 'redux-simple-promise';
import {
FETCH_POSTS,
FETCH_POST,
FETCH_PAGE,
FETCH_POSTS_CATEGORY,
FETCH_POSTS_TAG
} from '../actions/index';
const INITIAL_STATE = { all: {}, post: {}, page: {}, category: ... |
if (typeof action.meta.term !== 'undefined') {
const options = {
pre: '', |
<|file_name|>index.d.ts<|end_file_name|><|fim▁begin|><|fim▁hole|>import { StrategyBase } from "./strategies/StrategyBase";
export { BufferCodec, BufferSchema, BufferStrategy, BufferTemplate, BufferValueTemplate, StrategyBase, };<|fim▁end|> | import { BufferCodec } from "./BufferCodec";
import { BufferSchema } from "./BufferSchema";
import { BufferStrategy } from "./BufferStrategy";
import { BufferTemplate, BufferValueTemplate } from "./buffer.types"; |
<|file_name|>import_bradford.py<|end_file_name|><|fim▁begin|><|fim▁hole|>from data_collection.management.commands import BaseXpressDemocracyClubCsvImporter
class Command(BaseXpressDemocracyClubCsvImporter):
council_id = 'E08000032'
addresses_name = 'parl.2017-06-08/Version 1/Democracy_Club__08June2017.tsvJune2... | |
<|file_name|>MaterialPicker.cc<|end_file_name|><|fim▁begin|>/*===========================================================================*\
* *
* OpenFlipper *
* Copyright (C) 2... | //------------------------------------------------------------------------------ |
<|file_name|>rx-operators.ts<|end_file_name|><|fim▁begin|>// Spelling out each operator we need helps save on bundle size, but it's a pain
// to type everywhere. So we keep them all here and you just have to import rx-operators.
import 'rxjs/add/observable/defer';
import 'rxjs/add/observable/of';
import 'rxjs/add/obser... | import 'rxjs/add/operator/catch';
import 'rxjs/add/operator/map';
import 'rxjs/add/operator/merge'; |
<|file_name|>rdbdata.py<|end_file_name|><|fim▁begin|>"""
Copyright (C) 2013 Stanislav Bobovych
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... |
if self.filepath != None: |
<|file_name|>bootstrap-list-filter-contacts.js<|end_file_name|><|fim▁begin|>//borrowed from stefanocudini bootstrap-list-filter
(function($) {
$.fn.btsListFilterContacts = function(inputEl, options) {
var searchlist = this,
searchlist$ = $(this),
inputEl$ = $(inputEl),
items$ = searchlist$,
callData,... | delay: 300,
minLength: 1, |
<|file_name|>unique-pat-2.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.apache.org/li... | #![feature(box_patterns)]
#![feature(box_syntax)]
struct Foo {a: isize, b: usize} |
<|file_name|>_route_filters_operations.py<|end_file_name|><|fim▁begin|># coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# ... | |
<|file_name|>device.rs<|end_file_name|><|fim▁begin|>//! Provides the Cuda API with its device functionality.
use frameworks::cuda::{Device, DeviceInfo};
use byteorder::{ByteOrder, LittleEndian, WriteBytesExt};
use super::ffi::*;<|fim▁hole|> ///
/// Combines the fetching of all device ids and the fetching of the... | use super::{API, Error};
impl API {
/// Returns fully initialized devices available through Cuda. |
<|file_name|>advent6.rs<|end_file_name|><|fim▁begin|>// advent6.rs
// christmas light grid
extern crate bit_vec;
#[macro_use] extern crate scan_fmt;
use bit_vec::BitVec;
use std::io;
#[cfg(not(test))]
const GRID_SIZE: usize = 1000;
#[cfg(test)]
const GRID_SIZE: usize = 8;
fn main() {
// Part 1 initialization
... | row.set(i, !val); }); |
<|file_name|>IAMCapabilities.java<|end_file_name|><|fim▁begin|>/*
* Copyright (C) 2009-2015 Dell, Inc.
* See annotations for authorship information
*
* ====================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file... | * ====================================================================
*/
package org.dasein.cloud.aws.identity; |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.