prompt large_stringlengths 70 991k | completion large_stringlengths 0 1.02k |
|---|---|
<|file_name|>sales_order.py<|end_file_name|><|fim▁begin|># Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import frappe
import json
import frappe.utils
from frappe.utils import cstr, flt, getdate, comm... | from `tabPurchase Order Item` poi, `tabPurchase Order` po |
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|>"""
SleekXMPP: The Sleek XMPP Library
Copyright (C) 2010 Nathanael C. Fritz
This file is part of SleekXMPP.
See the file LICENSE for copying permission.
"""
from sleekxmpp.plugins.base import PluginManager, PluginNotFound, BasePlugin
from sleekxmpp... | 'xep_0231', # Bits of Binary
'xep_0235', # OAuth Over XMPP |
<|file_name|>raytrace.rs<|end_file_name|><|fim▁begin|>use rand;
use std;
use prelude::*;
use scene;
pub struct Output {
data : Vec<RGB>,
w : u32,
h : u32,
}
impl Output {
pub fn new(w: u32, h: u32) -> Self {
Output {
data : std::iter::repeat(RGB { r: 0.0, g: 0.0, b: 0.0 }).take((w * h) as usi... | Vector::new( |
<|file_name|>layer_utils.py<|end_file_name|><|fim▁begin|>from __future__ import print_function
import inspect
import numpy as np
import theano
from ..layers.advanced_activations import LeakyReLU, PReLU
from ..layers.core import Dense, Merge, Dropout, Activation, Reshape, Flatten, RepeatVector, Layer
from ..layers.core... | input_shapes: dict (Graph), list of tuples (Merge) or tuple (Sequential)
""" |
<|file_name|>shippingInvoice.js<|end_file_name|><|fim▁begin|>import accounting from "accounting-js";
import _ from "lodash";
import { Meteor } from "meteor/meteor";
import $ from "jquery";
import { Template } from "meteor/templating";
import { ReactiveVar } from "meteor/reactive-var";
import { i18next, Logger, formatNu... |
refundAmount() {
return Template.instance().refundAmount; |
<|file_name|>ar.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
#This is generated code - do not edit
encoding = 'utf-8'
dict = {
'&About...': '&\xd8\xb9\xd9\x86...',
'&Delete Window': '&\xd8\xa7\xd8\xad\xd8\xb0\xd9\x81 \xd8\xa7\xd9\x84\xd9\x86\xd8\xa7\xd9\x81\xd8\xb0\xd8\xa9',
'&Describe Action': '&\xd8\xa3\xd... | '&Help': '&\xd9\x85\xd8\xb3\xd8\xa7\xd8\xb9\xd8\xaf\xd8\xa9',
'&Line Numbers': '&\xd8\xb9\xd8\xaf\xd8\xaf \xd8\xa7\xd9\x84\xd8\xb3\xd8\xb7\xd9\x88\xd8\xb1',
'&New Window': '&\xd9\x86\xd8\xa7\xd9\x81\xd8\xb0\xd8\xa9 \xd8\xac\xd8\xaf\xd9\x8a\xd8\xaf\xd8\xa9',
'&Preferences...': '&\xd8\xa7\xd9\x84\xd8\xaa\xd9\x81\xd8\xb6\... |
<|file_name|>problem_019.py<|end_file_name|><|fim▁begin|># coding=utf-8
"""
This module, problem_019.py, solves the nineteenth project euler problem.
"""
from project_euler_problems.problem import Problem
from datetime import date
'''
You are given the following information, but you may prefer to do some research f... | And on leap years, twenty-nine.
A leap year occurs on any year evenly divisible by 4, but not on a century unless it is divisible by 400.
How many Sundays fell on the first of the month during the twentieth century (1 Jan 1901 to 31 Dec 2000)? |
<|file_name|>NotificationController.java<|end_file_name|><|fim▁begin|>package net.therap.controller;
import net.therap.domain.Notification;
import net.therap.domain.User;
import net.therap.service.NotificationService;
import net.therap.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;... | User user = (User) session.getAttribute("user");
notificationService.updateAndInsertNotification(notificationId, |
<|file_name|>0002_auto_20150211_2011.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('zeltlager_registration', '0001_initial'),
]
operations = [
... | name='description', |
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
# Copyright 2017 Onestein (<http://www.onestein.eu>)<|fim▁hole|>
from . import test_employee_display_own_info<|fim▁end|> | # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). |
<|file_name|>EstimationOfPi.py<|end_file_name|><|fim▁begin|>import random
import math
def estimatePi(error):
itt=1000 #itterations
previousPI=0
while True:
hits=0 # number of hits
for i in range(0,itt):
x=random.uniform(0,1)
y=random.uniform(0,1)
z=x*x+y*y #Pythagorean Theorum
if math.sqrt(z)<=1: #if... | print("Pi : ",pi) |
<|file_name|>slidercc.core.js<|end_file_name|><|fim▁begin|>/*!
* CC Slider by Chop-chop
* http://shop.chop-chop.org
*/
(function($){
'use strict';
var defaults = {
// basic
mode: 'fade',
autoPlay: 3000,
pauseOnHover: true,
animationSpeed: 1000,
pagination: true,
arrows: true,
loop: false,
keybo... | |
<|file_name|>swap_network_trotter_hubbard.py<|end_file_name|><|fim▁begin|># 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... | """
self.x_dim = x_dim
self.y_dim = y_dim
self.tunneling = tunneling |
<|file_name|>shootout-k-nucleotide.rs<|end_file_name|><|fim▁begin|>// Copyright 2014 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.apac... | static OCCURRENCES: [&'static str, ..5] = [
"GGT", |
<|file_name|>index.go<|end_file_name|><|fim▁begin|>/*
Copyright 2014 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
Unless r... | // listByAccessModes returns all volumes with the given set of
// AccessModeTypes. The list is unsorted!
func (pvIndex *persistentVolumeOrderedIndex) listByAccessModes(modes []v1.PersistentVolumeAccessMode) ([]*v1.PersistentVolume, error) {
pv := &v1.PersistentVolume{ |
<|file_name|>NavigationDrawerFragment.java<|end_file_name|><|fim▁begin|>package fyskam.fyskamssngbok;
import android.app.Activity;
import android.app.ActionBar;
import android.app.Fragment;
import android.support.v4.app.ActionBarDrawerToggle;
import android.support.v4.view.GravityCompat;
import android.support.v4.wid... | |
<|file_name|>OsmMember.java<|end_file_name|><|fim▁begin|>package de.jotschi.geo.osm.tags;
import org.w3c.dom.Node;
public class OsmMember {
String type, ref, role;
public OsmMember(Node node) {
ref = node.getAttributes().getNamedItem("ref").getNodeValue();
role = node.getAttributes().getNamedItem("role").getN... | |
<|file_name|>serializers.py<|end_file_name|><|fim▁begin|># coding=utf-8
"""
Utility Serializers
"""
from rest_framework.serializers import HyperlinkedModelSerializer
<|fim▁hole|> """
ModelSerializer which provides both a `url` and `id` field
"""
def get_pk_field(self, model_field):
return self... | class HybridModelSerializer(HyperlinkedModelSerializer): |
<|file_name|>visitor.ts<|end_file_name|><|fim▁begin|>namespace ts {
const isTypeNodeOrTypeParameterDeclaration = or(isTypeNode, isTypeParameterDeclaration);
/**
* Visits a Node using the supplied visitor, possibly returning a new Node in its place.
*
* @param node The Node to visit.
... |
export function visitEachChild(node: Node | undefined, visitor: Visitor, context: TransformationContext, nodesVisitor = visitNodes, tokenVisitor?: Visitor): Node | undefined {
if (node === undefined) {
return undefined;
|
<|file_name|>reject.js<|end_file_name|><|fim▁begin|>const filter = require('./filter')
module.exports = (collection, test, callback) => {
return filter(collection, function(value, index, collection) {
return !test(value, index, collection)<|fim▁hole|><|fim▁end|> | }, callback)
} |
<|file_name|>lcd_display.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Urwid LCD display module
# Copyright (C) 2010 Ian Ward
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published... | del self.pressed[key] |
<|file_name|>RawOuter.java<|end_file_name|><|fim▁begin|>package com.coekie.gentyref.factory;
<|fim▁hole|>@SuppressWarnings("rawtypes")
public class RawOuter extends GenericOuter {}<|fim▁end|> | |
<|file_name|>DeletionBuilderTest.java<|end_file_name|><|fim▁begin|>package net.zer0bandwidth.android.lib.content.querybuilder;
import android.content.ContentResolver;
import android.support.test.runner.AndroidJUnit4;
import android.test.ProviderTestCase2;
import org.junit.Before;
import org.junit.Test;
import org.jun... | assertNull( qb.m_sExplicitWhereFormat ) ;
assertNull( qb.m_asExplicitWhereParams ) ;
} |
<|file_name|>router_policy_test.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 unde... | |
<|file_name|>award.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
import unittest
from copy import deepcopy
from openprocurement.api.tests.base import snitch
from openprocurement.tender.belowthreshold.adapters import TenderBelowThersholdConfigurator
from openprocurement.tender.belowthreshold.tests.base import... |
class TenderAwardResourceTestMixin(object):
test_create_tender_award_invalid = snitch(create_tender_award_invalid) |
<|file_name|>base.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
# Licensed to Cloudera, Inc. under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. Cloudera, Inc. licenses this file
# to you under the Apa... |
import json
import logging |
<|file_name|>gitkali.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python3
"""
Written by: True Demon
The non-racist Kali repository grabber for all operating systems.
Git Kali uses Offensive Security's package repositories and their generous catalog<|fim▁hole|>of Offensive Security actually sticking to good practices an... | of extremely handy penetration testing tools. This project is possible because |
<|file_name|>interface.rs<|end_file_name|><|fim▁begin|>// Copyright 2014 The html5ever 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
... | |
<|file_name|>Activator.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 the... | } else { |
<|file_name|>update_spec.rs<|end_file_name|><|fim▁begin|>/// Purpose of this binary is to update the submodule to a particular tag
/// TODO Could add it in that it will perform a check on the tags if it needs to be updated
// use std::env;
use std::process::Command;
fn main() {
// let tag = env::args().nth(1);
... | // println!("Updating the comms-spec submodule to version {:?}", tag);
println!("Updating submodule comms-spec", );
Command::new("git") |
<|file_name|>RangerElasticsearchAuthorizer.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 f... | |
<|file_name|>clear_pgviews.py<|end_file_name|><|fim▁begin|>import logging
from django.core.management.base import BaseCommand
from django.apps import apps
from django.db import connection
from django_pgviews.view import clear_view, View, MaterializedView
<|fim▁hole|>
class Command(BaseCommand):
help = """Clear Po... |
log = logging.getLogger('django_pgviews.sync_pgviews')
|
<|file_name|>libs.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
import sys
import time
import datetime
import logging
import csv
import six
from datetime import date
from django.apps import apps
from django.utils import timezone
logger = logging.getLogger(__name__)
ats_settin... | bufffer = six.StringIO()
|
<|file_name|>hashes.rs<|end_file_name|><|fim▁begin|>//! Computing hashes for files.
use crate::Result;
use openssl::hash::{DigestBytes, Hasher, MessageDigest};
use std::io::{Read, Write};
#[derive(Debug)]
pub struct Estimate {
pub files: u64,
pub bytes: u64,
}
// TODO: Reuse buffer and hasher for a given thre... | match OpenOptions::new()
.read(true) |
<|file_name|>grabber.py<|end_file_name|><|fim▁begin|>"""Grabber for collecting data"""
import urllib2
from random import sample
from veliberator.settings import PROXY_SERVERS
class Grabber(object):
"""Url encapsultation for making request throught HTTP"""
page = None
data = None
def __init__(self, u... | try:
self.page = self.opener.open(self.url)
self.data = ''.join(self.page.readlines())
self.page.close() |
<|file_name|>test_api.py<|end_file_name|><|fim▁begin|># Copyright (C) 2015 by the Free Software Foundation, Inc.
#
# This file is part of GNU Mailman.
#
# GNU Mailman 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... | 'TestAPIVersion',
] |
<|file_name|>errors.py<|end_file_name|><|fim▁begin|>"""
error types
Copyright (c) 2010-2012 Mika Eloranta
See LICENSE for details.
"""
class Error(Exception):
"""error"""
class InvalidProperty(Error):
"""invalid property"""
class MissingProperty(Error):
"""missing property"""
class UserError(Error):
... |
class RepoError(Error): |
<|file_name|>toolbar.component.ts<|end_file_name|><|fim▁begin|>import { Component, Input } from '@angular/core';
import { Router } from '@angular/router';
import { IInputButtons } from './toolbar';
@Component({
selector: 'app-toolbar',
templateUrl: './toolbar.component.html',<|fim▁hole|> @Input() buttons: IInput... | styleUrls: ['./toolbar.component.scss']
})
export class ToolbarComponent { |
<|file_name|>errors.go<|end_file_name|><|fim▁begin|>package rpc
import "errors"
var (<|fim▁hole|> ErrInvalidToken = errors.New("invalid token")
)<|fim▁end|> | ErrRPCServerDisabled = errors.New("server is disabled") |
<|file_name|>inmem_spanner_server_test.go<|end_file_name|><|fim▁begin|>// Copyright 2019 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// https://www.apache.org/licens... | t.Fatal(err)
}
resp, err := c.CreateSession(context.Background(), request)
if err != nil { |
<|file_name|>metadata.rs<|end_file_name|><|fim▁begin|>//! Types related to topic metadata for introspection by clients.
//! Example: `KafkaClient::topics()`.
use std::collections::hash_map;
use std::fmt;
use super::KafkaClient;
use super::state::{ClientState, TopicPartitions, TopicPartitionIter, TopicPartition};
// ... | impl<'a> PartitionIter<'a> {
fn new(state: &'a ClientState, tp: &'a TopicPartitions) -> Self {
PartitionIter {
state: state, |
<|file_name|>Library.py<|end_file_name|><|fim▁begin|>'''
Created on Apr 3, 2012
@author: Dan
'''
from Common.Converter import *
from Common.Module import *
from Common.Symbol import DevicePart
from Common.Device import Deviceset
class Library(object):
__slots__ = ("name", "modules", "symbols", "converter", "dev... | symConverter = SchemConverter() |
<|file_name|>test_short_term_loss_prestress_01.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
from __future__ import division
'''Test for checking variation of initial prestress force along a
post-tensioned member.
Data and rough calculation are taken from
Example 4.3 of the topic 4 of course "Prestressed C... |
# Interpolation |
<|file_name|>karma.conf.js<|end_file_name|><|fim▁begin|>// Karma configuration
// Generated on Wed Jul 15 2015 09:44:02 GMT+0200 (Romance Daylight Time)
module.exports = function(config) {
config.set({
// base path that will be used to resolve all patterns (eg. files, exclude)
basePath: '',
// framewo... |
// start these browsers
// available browser launchers: https://npmjs.org/browse/keyword/karma-launcher
browsers: ['PhantomJS'], |
<|file_name|>prometheus.py<|end_file_name|><|fim▁begin|>from kvmagent import kvmagent
from zstacklib.utils import jsonobject
from zstacklib.utils import http
from zstacklib.utils import log
from zstacklib.utils.bash import *
from zstacklib.utils import linux<|fim▁hole|>import os.path
import re
import time
import traceb... | from zstacklib.utils import thread
from jinja2 import Template |
<|file_name|>gc.rs<|end_file_name|><|fim▁begin|>// Copyright 2020 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// https://www.apache.org/licenses/LICENSE-2.0
//
// Unl... | |
<|file_name|>storage.rs<|end_file_name|><|fim▁begin|>/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
use crate::dom::bindings::codegen::Bindings::StorageBinding;... | }
fn get_storage_thread(&self) -> IpcSender<StorageThreadMsg> {
self.global().resource_threads().sender() |
<|file_name|>InternalLoader.js<|end_file_name|><|fim▁begin|>// Copyright 2014 Traceur 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/LI... | this.resolve(this.result);
}
} |
<|file_name|>errors.rs<|end_file_name|><|fim▁begin|>#![allow(unknown_lints)]
use crate::core::{TargetKind, Workspace};
use crate::ops::CompileOptions;
use anyhow::Error;
use std::fmt;
use std::path::PathBuf;
use std::process::{ExitStatus, Output};
use std::str;
pub type CargoResult<T> = anyhow::Result<T>;
// TODO: s... | error: None,
exit_code: code,
} |
<|file_name|>print.go<|end_file_name|><|fim▁begin|>package bitrise
import (
"fmt"
"strings"
"time"
log "github.com/Sirupsen/logrus"
"github.com/bitrise-io/bitrise/models"
"github.com/bitrise-io/go-utils/colorstring"
"github.com/bitrise-io/go-utils/stringutil"
)
const (
// should not be under ~45
stepRunSumm... | log.Infof(header) |
<|file_name|>0007_auto_20151005_1333.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
from django.db import migrations
def create_switch(apps, schema_editor):
"""Create the async_order_fulfillment switch if it does not already exist."""
Switch = apps.get_model('waffle', 'Switch')
Switch.objects.g... | migrations.RunPython(create_switch, reverse_code=delete_switch),
] |
<|file_name|>tokenize.py<|end_file_name|><|fim▁begin|># Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006 Python Software Foundation.
# All rights reserved.
"""Tokenization help for Python programs.
generate_tokens(readline) is a generator that breaks a stream of<|fim▁hole|>text into Python tokens. It accepts a readl... | |
<|file_name|>Distance Joint Description.cpp<|end_file_name|><|fim▁begin|>#include "StdAfx.h"
#include "Distance Joint Description.h"
#include "Spring Description.h"
#include "Distance Joint.h"
#include <NxDistanceJointDesc.h>
using namespace StillDesign::PhysX;
DistanceJointDescription::DistanceJointDesc... | }
|
<|file_name|>DataSet.java<|end_file_name|><|fim▁begin|>package org.anyline.entity;
import com.fasterxml.jackson.databind.JsonNode;
import org.anyline.util.*;
import org.anyline.util.regular.Regular;
import org.anyline.util.regular.RegularUtil;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.io.Se... | } |
<|file_name|>ar1TestScript.py<|end_file_name|><|fim▁begin|>from pybrain.rl.environments.timeseries.maximizereturntask import DifferentialSharpeRatioTask<|fim▁hole|>
from matplotlib import pyplot
"""
This script aims to create a trading model that trades on a simple AR(1) process
"""
env=AR1Environment(2000)
task=Diff... | from pybrain.rl.environments.timeseries.timeseries import AR1Environment, SnPEnvironment
from pybrain.rl.learners.valuebased.linearfa import Q_LinFA
from pybrain.rl.agents.linearfa import LinearFA_Agent
from pybrain.rl.experiments import ContinuousExperiment |
<|file_name|>vm_env.go<|end_file_name|><|fim▁begin|>// Copyright 2016 The go-ethereum Authors
// This file is part of the go-ethereum library.
//
// The go-ethereum library is free software: you can redistribute it and/or modify
// it under the terms of the GNU Lesser General Public License as published by
// the Free ... |
func (self *VMState) SnapshotDatabase() int {
self.snapshots = append(self.snapshots, self.state.Copy()) |
<|file_name|>crawl.py<|end_file_name|><|fim▁begin|>__author__ = 'vg'
import io
import dircache
import sys, os
<|fim▁hole|>#default path
base_dir = os.path.dirname('C:\\c-list\\country\\icu\\')
s = dircache.listdir(base_dir)
#creating country code list
our_codes = io.open('our_codes.txt', mode='r',encoding='utf8').re... | |
<|file_name|>totalstatistics.py<|end_file_name|><|fim▁begin|># Copyright 2008-2015 Nokia Networks
# Copyright 2016- Robot Framework 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 Li... |
def add_test(self, test):
self.stats.all.add_test(test)
if test.critical: |
<|file_name|>quic_packet_reader.cc<|end_file_name|><|fim▁begin|>// Copyright 2015 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.
#include "net/tools/quic/quic_packet_reader.h"
#include <errno.h>
#ifndef __APPLE__
// Th... | return false; // recvmmsg failed.
}
for (int i = 0; i < packets_read; ++i) { |
<|file_name|>f.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
# -*- coding: utf-8 -*-<|fim▁hole|> pass
assert f(1, 2) == 2
assert f(2, 6) == 3
assert f(3, 14) == 14<|fim▁end|> |
def f(k, n): |
<|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/. */
//! An actor-based remote devtools server implementation. Only te... | mod actors { |
<|file_name|>data_import.py<|end_file_name|><|fim▁begin|># ~*~ encoding: utf-8 ~*~
from pymongo import MongoClient
from pandas import read_csv
from datetime import date
mongodb = MongoClient('192.168.178.82', 9999)
db = mongodb['dev']
drug_collection = db['drug']
drugs = read_csv('~/Dokumente/bfarm_lieferenpass_meld... | drug_collection.update_one({'enr': data['enr']}, {'$set': data}, upsert=True) |
<|file_name|>mod.rs<|end_file_name|><|fim▁begin|>#[cfg_attr(rustfmt, rustfmt_skip)]
#[allow(unknown_lints)]
#[allow(clippy::all)]
mod grammar {
// During the build step, `build.rs` will output the generated parser to `OUT_DIR` to avoid
// adding it to the source directory, so we just directly include the genera... | |
<|file_name|>070 Text Justification.py<|end_file_name|><|fim▁begin|>"""
Given an array of words and a length L, format the text such that each line has exactly L characters and is fully (left
and right) justified.
You should pack your words in a greedy approach; that is, pack as many words as you can in each line.... | |
<|file_name|>ASiCSCAdESLevelLTTest.java<|end_file_name|><|fim▁begin|>/**
* DSS - Digital Signature Services
* Copyright (C) 2015 European Commission, provided under the CEF programme
*
* This file is part of the "DSS - Digital Signature Services" project.
*
* This library is free software; you can redistribute ... |
@Override
protected String getSigningAlias() { |
<|file_name|>characters.js<|end_file_name|><|fim▁begin|>export default {
A: [[1,0],[2,0],[3,0],[0,1],[4,1],[0,2],[1,2],[2,2],[3,2],[4,2],[0,3],[4,3],[0,4],[4,4]],
B: [[0,0],[1,0],[2,0],[3,0],[0,1],[4,1],[0,2],[1,2],[2,2],[3,2],[0,3],[4,3],[0,4],[1,4],[2,4],[3,4]],
C: [[0,0],[1,0],[2,0],[3,0],[4,0],[0,1],[0,2],[0,3],... | L: [[0,0],[0,1],[0,2],[0,3],[0,4],[1,4],[2,4],[3,4],[4,4]],
M: [[0,0],[4,0],[0,1],[1,1],[3,1],[4,1],[0,2],[2,2],[4,2],[0,3],[4,3],[0,4],[4,4]],
N: [[0,0],[4,0],[0,1],[1,1],[4,1],[0,2],[2,2],[4,2],[0,3],[3,3],[4,3],[0,4],[4,4]], |
<|file_name|>views.py<|end_file_name|><|fim▁begin|>from media_tree.contrib.cms_plugins.media_tree_image.models import MediaTreeImage
from media_tree.contrib.cms_plugins.helpers import PluginLink
from media_tree.models import FileNode
from media_tree.contrib.views.detail.image import ImageNodeDetailView
from django.util... | |
<|file_name|>Pane.js<|end_file_name|><|fim▁begin|>/* ************************************************************************
qooxdoo - the new era of web development
http://qooxdoo.org
Copyright:
2004-2008 1&1 Internet AG, Germany, http://www.1und1.de
License:
LGPL: http://www.gnu.org/license... | this.pane.setScrollX(390); |
<|file_name|>ventana_no_texto.rs<|end_file_name|><|fim▁begin|><|fim▁hole|>ventana_no_texto$2
ventana_no_texto$1
ventana_no_texto<|fim▁end|> | |
<|file_name|>map.hpp<|end_file_name|><|fim▁begin|>// Boost.Assign library
//
// Copyright Thorsten Ottosen 2003-2004. Use, modification and
// distribution is subject to the Boost Software License, Version
// 1.0. (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
//
// For m... | }
} |
<|file_name|>simd-intrinsic-generic-arithmetic-saturating.rs<|end_file_name|><|fim▁begin|>// compile-flags: -C no-prepopulate-passes
//
#![crate_type = "lib"]
#![feature(repr_simd, platform_intrinsics)]
#![allow(non_camel_case_types)]
#![deny(unused)]
// signed integer types
#[repr(simd)] #[derive(Copy, Clone)] pub... | |
<|file_name|>UPnPDocParser.java<|end_file_name|><|fim▁begin|>/**
*
* Copyright (C) 2004-2008 FhG Fokus
*
* This file is part of the FhG Fokus UPnP stack - an open source UPnP implementation
* with some additional features
*
* You can redistribute the FhG Fokus UPnP stack and/or modify it
* under the terms of the GNU G... | * along with this program; if not, see <http://www.gnu.org/licenses/>
* or write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
<|file_name|>parser.rs<|end_file_name|><|fim▁begin|>use crate::plugins;
use comrak::{
format_html,
nodes::{AstNode, NodeHtmlBlock, NodeValue},
parse_document, ComrakExtensionOptions, ComrakOptions, ComrakParseOptions,
ComrakRenderOptions,
};
use std::string::FromUtf8Error;
use std::{
collections::BT... | }
}
} |
<|file_name|>NetworkTypes.py<|end_file_name|><|fim▁begin|>#
# Functions for interacting with the network_types table in the database
#
# Mark Huang <mlhuang@cs.princeton.edu>
# Copyright (C) 2006 The Trustees of Princeton University
#
from PLC.Faults import *
from PLC.Parameter import Parameter
from PLC.Table import R... | if conflicts: |
<|file_name|>SessionPlots.hpp<|end_file_name|><|fim▁begin|>/*
* SessionPlots.hpp
*
* Copyright (C) 2009-12 by RStudio, Inc.
*
* Unless you have received this program directly from RStudio pursuant
* to the terms of a commercial license agreement with RStudio, then
* this program is licensed to you under the term... | }
} |
<|file_name|>Canonicalizer20010315ExclusiveTest.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 t... | |
<|file_name|>uploader.py<|end_file_name|><|fim▁begin|># Copyright 2015-2016 Rackspace US, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.... | |
<|file_name|>drive_api_service.cc<|end_file_name|><|fim▁begin|>// Copyright (c) 2012 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.
#include "chrome/browser/chromeos/drive/drive_api_service.h"
#include <string>
#includ... | const GURL& parent_content_url,
const GURL& resource_url,
const google_apis::EntryActionCallback& callback) { |
<|file_name|>S10.2.2_A1.1_T3.js<|end_file_name|><|fim▁begin|>// Copyright 2009 the Sputnik authors. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/**
* @name: S10.2.2_A1.1_T3;
* @section: 10.2.2;
* @assertion: The scope chain is initialised to contain the same objects,... | str1+=i;
}
eval('for(j in this){\nstr2+=j;\n}'); |
<|file_name|>label_leaves_in_expr_with_numbered_intervals.py<|end_file_name|><|fim▁begin|># -*- encoding: utf-8 -*-
from abjad.tools import scoretools
from abjad.tools import scoretools
from abjad.tools import markuptools
from abjad.tools import scoretools
from abjad.tools import pitchtools
from abjad.tools.topleveltoo... | >>> notes = scoretools.make_notes(
... [0, 25, 11, -4, -14, -13, 9, 10, 6, 5],
... [Duration(1, 8)],
... ) |
<|file_name|>urls.py<|end_file_name|><|fim▁begin|>"""myproject URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/1.9/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatt... | import debug_toolbar
urlpatterns += [
url(r'^__debug__/', include(debug_toolbar.urls)), |
<|file_name|>CreateSamples.py<|end_file_name|><|fim▁begin|>import os
import unittest
from __main__ import vtk, qt, ctk, slicer
from slicer.ScriptedLoadableModule import *
import logging
#
# CreateSamples
#
class CreateSamples(ScriptedLoadableModule):
"""Uses ScriptedLoadableModule base class, available at:
https:... | def createVolume(self , volumeName, labelmap=False, reference=None):
if volumeName == '':
raise Exception('The name of the output volume cannot be empty') |
<|file_name|>jquery-gstree.js<|end_file_name|><|fim▁begin|>// in development
// getsimple tree expansion
// written for editpages, but can probably be expanded to support any
// list of elements with depth data in proper parent child order
//
var treeprefix = 'tree-';
var treeparentclass = treepr... | // could use a table css rule to hide all trs, unless classes depth-0 or something with specificty to override
// would skip all iterations needed here, but would also require special css to toggle expanders
// could also use a cache table for these using tr ids
var rootcollapsed = $("#roottoggle").hasClass("rootco... |
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|>"""File related wrapper functions to streamline common use cases"""
import manage as manage
from manage import find_file, find_file_re, list_dir
import operation as operation<|fim▁hole|><|fim▁end|> | from operation import hash_file, read_file, slice_file, write_file |
<|file_name|>bitcoin_uk.ts<|end_file_name|><|fim▁begin|><?xml version="1.0" ?><!DOCTYPE TS><TS language="uk" version="2.0">
<defaumlcodec>UTF-8</defaumlcodec>
<context>
<name>AboutDialog</name>
<message>
<location filename="../forms/aboutdialog.ui" line="+14"/>
<source>About Menlocoin</source>
... | <message> |
<|file_name|>aes.rs<|end_file_name|><|fim▁begin|>// Copyright 2016 Martin Grabmueller. See the LICENSE file at the
// top-level directory of this distribution for license information.
//! Example implementation of AES (the Advanced Encryption Standard).
//! Note that this implementation has neither been verified to be... | /// ECB mode, using the given key. The ciphertext output is returned
/// as a vector of bytes.
pub fn encrypt_ecb(key: &AesKey, plaintext: &[u8]) -> Vec<u8> { |
<|file_name|>scrutest.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
from shutil import rmtree
from tempfile import mkdtemp<|fim▁hole|>from scrusubtitles import ScruSubtitlesListener
from scrusubtitles import ScruSubtitlesLogger
class TestService(ScruSubtitlesListener, ScruSubtitlesLogger):
def __init_... | from omdbapi import OMDbAPI
from scrusubtitles import ScruSubtitles |
<|file_name|>ConfigurationNode.java<|end_file_name|><|fim▁begin|>/*
* HawkEye Redux
* Copyright (C) 2012-2013 Cubeville <http://www.cubeville.org> and contributors
*
* 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 ... | @Override |
<|file_name|>RichTextAreaConsts.py<|end_file_name|><|fim▁begin|>"""
* Copyright 2007 Google Inc.
# Copyright (C) 2009 Luke Kenneth Casson Leighton <lkcl@lkcl.net>
*
* 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 ... | * the License.
""" |
<|file_name|>test_organization.py<|end_file_name|><|fim▁begin|>"""Unit tests for the ``organizations`` paths.
Each ``APITestCase`` subclass tests a single URL. A full list of URLs to be
tested can be found here:
http://theforeman.org/api/apidoc/v2/organizations.html
:Requirement: Organization
:CaseAutomation: Autom... | """Remove a smart proxy from an organization |
<|file_name|>parser.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
# -*- coding: utf-8 -*-
# CAVEAT UTILITOR
#
# This file was automatically generated by Grako.
#
# https://pypi.python.org/pypi/grako/
#
# Any changes you make to it will be overwritten the next time
# the file is generated.
from __future__ ... | @graken()
def _xorexpr_(self): |
<|file_name|>MqttContext.java<|end_file_name|><|fim▁begin|>/*
* Copyright 2017-2022 Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with
* the License. A copy of the License is located at
* ... | try {
return (MqttContext) super.clone();
} catch (CloneNotSupportedException e) {
throw new IllegalStateException("Got a CloneNotSupportedException from Object.clone() " + "even though we're Cloneable!", e); |
<|file_name|>TempConv.py<|end_file_name|><|fim▁begin|># TempConv.py
# Celcius to Fahreinheit<|fim▁hole|>def Fahreinheit(temp):
temp = float(temp)
temp = (temp*9/5)+32
return temp
# Fahreinheit to Celcius
def Celcius(temp):
temp = float(temp)
temp = (temp-32)*5/9
return temp<|fim▁end|> | |
<|file_name|>main.py<|end_file_name|><|fim▁begin|>import gi
gi.require_version('Gtk', '3.0')
from gi.repository import Gtk, Gdk
import os
from subprocess import call, Popen, PIPE, STDOUT
class GtkPassWindow(Gtk.Window):
def __init__(self):
self.search_text = ''
self.search_result_text = ''<|fi... | self.get_pass_path()
self.build_gui() |
<|file_name|>MediaExportParameters.java<|end_file_name|><|fim▁begin|>/**
* @(#)MediaExportParameters.java
*
* This file is part of the Non-Linear Book project.
* Copyright (c) 2012-2016 Anton P. Kolosov
* Authors: Anton P. Kolosov, et al.
*
* This program is free software; you can redistribute it and/or modify
... | private static final MediaExportParameters NOCHANGE = new MediaExportParameters(Preset.NOCHANGE, false, 0);
private static final MediaExportParameters COMPRESSED = new MediaExportParameters(Preset.COMPRESSED, true, 80);
private static final MediaExportParameters DEFAULT = ( |
<|file_name|>weatherai.py<|end_file_name|><|fim▁begin|>from sklearn.ensemble import RandomForestClassifier
from sklearn.datasets import make_classification
import numpy as np
def predictClothesGeneral(temp):
dataFile = open("data.txt")
data = dataFile.read()
data = data.split("\n")
X ... | Y = []
for i in range(0,len(data) - 1): |
<|file_name|>utils.go<|end_file_name|><|fim▁begin|>package main
import (
"fmt"
"os"
"github.com/Sirupsen/logrus"
"github.com/opencontainers/runtime-spec/specs-go"
"github.com/urfave/cli"
)
// fatal prints the error's details if it is a libcontainer specific error type
// then exits the program with an exit stat... | if os.Geteuid() != 0 {
return nil, fmt.Errorf("runc should be run as root")
} |
<|file_name|>bitcoin_fa.ts<|end_file_name|><|fim▁begin|><?xml version="1.0" ?><!DOCTYPE TS><TS language="fa" version="2.0">
<defaultcodec>UTF-8</defaultcodec>
<context>
<name>AboutDialog</name>
<message>
<location filename="../forms/aboutdialog.ui" line="+14"/>
<source>About OMGCoin</source>
... | |
<|file_name|>ProcessApplicationAttachments.java<|end_file_name|><|fim▁begin|>/*
* Copyright © 2013-2018 camunda services GmbH and various authors (info@camunda.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 obtai... | return deploymentUnit.getAttachmentList(PROCESSES_XML_LIST); |
<|file_name|>empty.rs<|end_file_name|><|fim▁begin|><|fim▁hole|>/// don't applying any check to the passed data.
///
use std::collections::HashMap;
use std::sync::Arc;
use futures::future::lazy;
use crate::engine::middleware::base::{Middleware, MiddlewareFuture};
use crate::engine::serializer::JsonMessage;
use crate:... | /// The following module contains the simple middleware that |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.