prompt large_stringlengths 70 991k | completion large_stringlengths 0 1.02k |
|---|---|
<|file_name|>failure.go<|end_file_name|><|fim▁begin|>package history
import (
"bytes"
"encoding/json"
"fmt"
"os"
"sync"
"github.com/admpub/spider/app/downloader/request"
"github.com/admpub/spider/common/mgo"
"github.com/admpub/spider/common/mysql"
"github.com/admpub/spider/common/pool"
"github.com/admpub/sp... | // 删除失败记录
func (self *Failure) DeleteFailure(req *request.Request) { |
<|file_name|>test_output.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
# Copyright (c) 2015-2022, Exa Analytics Development Team
# Distributed under the terms of the Apache License 2.0
from unittest import TestCase
import numpy as np
import pandas as pd
import h5py<|fim▁hole|>
# TODO : change df.shape[0] == n... | from exatomic import Universe
from exatomic.base import resource
from exatomic.molcas.output import Output, Orb, HDF |
<|file_name|>2_photos.js<|end_file_name|><|fim▁begin|>Photos = new orion.collection('photos', {
singularName: 'photo',
pluralName: 'photos',
link: {
title: 'Photos'
},
tabular: {
columns: [
{data: 'title', title: 'Title'},
{data: 'state', title: 'State'},
//ToDo: Thumbnail
orio... | type: String,
autoform: { |
<|file_name|>store.rs<|end_file_name|><|fim▁begin|>pub struct StoreStats {
pub num_keys: u64,
pub total_memory_in_bytes: u64,
}
impl StoreStats {
pub fn new() -> StoreStats {
StoreStats {
num_keys: 0,
total_memory_in_bytes: 0,
}
}
}
pub trait ValueStore<K, V> {
... | |
<|file_name|>BookService.java<|end_file_name|><|fim▁begin|>package by.itransition.dpm.service;
import by.itransition.dpm.dao.BookDao;
import by.itransition.dpm.dao.UserDao;
import by.itransition.dpm.entity.Book;
import by.itransition.dpm.entity.User;
import org.springframework.beans.factory.annotation.Autowired;
impor... | |
<|file_name|>main.rs<|end_file_name|><|fim▁begin|>//
// Copyright (C) 2017 Kubos Corporation
//
// Licensed under the Apache License, Version 2.0 (the "License")
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.... | // distributed under the License is distributed on an "AS IS" BASIS, |
<|file_name|>tomltree_write_test.go<|end_file_name|><|fim▁begin|>package toml
import (
"bytes"
"errors"
"fmt"
"reflect"
"strings"
"testing"
"time"
)
type failingWriter struct {
failAt int
written int
buffer bytes.Buffer
}
func (f failingWriter) Write(p []byte) (n int, err error) {
count := len(p)
toWri... | expected := map[string]interface{}{
"title": "TOML Example",
"owner": map[string]interface{}{ |
<|file_name|>test_consoles.py<|end_file_name|><|fim▁begin|># vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2010-2011 OpenStack LLC.
# Copyright 2011 Piston Cloud Computing, Inc.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except i... | |
<|file_name|>app_chooser.rs<|end_file_name|><|fim▁begin|>// This file is part of rgtk.
//
// rgtk 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 Software Foundation, either version 3 of the License, or
// (at your option... | |
<|file_name|>exceptions.py<|end_file_name|><|fim▁begin|><|fim▁hole|><|fim▁end|> | class AbortAction(RuntimeError):
pass |
<|file_name|>test_experiment.py<|end_file_name|><|fim▁begin|>import pytest
from everest.repositories.rdb.testing import check_attributes
from everest.repositories.rdb.testing import persist
from thelma.tests.entity.conftest import TestEntityBase
class TestExperimentEntity(TestEntityBase):
def test_init(self, ex... | # FIXME: Working around the circular dependency of experiment and
# experiment job here.
exp_job = experiment_job_fac(experiments=[exp])
kw = experiment_fac.init_kw |
<|file_name|>search-box.component.spec.ts<|end_file_name|><|fim▁begin|>import { Component } from '@angular/core';
import { ComponentFixture, fakeAsync, inject, TestBed, tick } from '@angular/core/testing';
import { By } from '@angular/platform-browser';
import { SearchBoxComponent } from './search-box.component';
impor... | describe('initialisation', () => {
it('should get the current search query from the location service',
inject([LocationService], (location: MockLocationService) => fakeAsync(() => {
location.search.and.returnValue({ search: 'initial search' }); |
<|file_name|>number.rs<|end_file_name|><|fim▁begin|>use front::stdlib::value::{Value, ResultValue, VNumber, VInteger, to_value, from_value};
use front::stdlib::function::Function;
use std::f64::{NAN, MAX_VALUE, MIN_VALUE, INFINITY, NEG_INFINITY, EPSILON};
/// Parse a float into a value
pub fn parse_float(args:Vec<Value... | let parsed = from_str::<i32>(from_value::<String>(args[0]).unwrap().as_slice());
return Ok(match parsed {
Some(v) => to_value(v), |
<|file_name|>consul.go<|end_file_name|><|fim▁begin|>package veneur
import (
"errors"
"fmt"
"github.com/hashicorp/consul/api"
)
// Consul is a Discoverer that uses Consul to find
// healthy instances of a given name.
type Consul struct {<|fim▁hole|> ConsulHealth *api.Health
}
// NewConsul creates a new instance o... | |
<|file_name|>basic_operations_with_function.py<|end_file_name|><|fim▁begin|>#Author Emily Keiser
def addition(x,y):
return int(x)+int(y)
def subtraction (x,y) :
return int(x) -int(y)
def multiplication (x,y) :
return int(x) *int(y)
def module (x,y) :
return int(x) %int(y)
a=raw_input("Enter variable... | |
<|file_name|>tools.py<|end_file_name|><|fim▁begin|>from oauth2_provider.settings import oauth2_settings
from oauthlib.common import generate_token
from django.http import JsonResponse
from oauth2_provider.models import AccessToken, Application, RefreshToken
from django.utils.timezone import now, timedelta
def get_tok... | 'refresh_token': access_token.refresh_token.token,
'scope': access_token.scope |
<|file_name|>TaskView.py<|end_file_name|><|fim▁begin|>from __future__ import absolute_import
from Screens.Screen import Screen
from Components.ConfigList import ConfigListScreen
from Components.config import ConfigSubsection, ConfigSelection, getConfigListEntry
from Components.SystemInfo import SystemInfo
from Componen... | if j.status in (j.FINISHED, j.FAILED):
self.performAfterEvent() |
<|file_name|>Absorbers.d.ts<|end_file_name|><|fim▁begin|>import type { IContainerPlugin } from "../../Core/Interfaces/IContainerPlugin";
import { Absorber } from "./Absorber";
import { Container } from "../../Core/Container";
import type { Particle } from "../../Core/Particle";
import { ClickMode } from "../../Enums/Mo... | |
<|file_name|>Lusher_Alexander_home_work_3_.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python
# -*- coding: utf-8 -*-
#
def add(x, y):
a=1
while a>0:
a = x & y
b = x ^ y
x = b
y = a << 1
return b
def vowel_count(word):
vowels_counter = 0
for letter in word:
if letter.isalpha():... | |
<|file_name|>gaussian_process.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
# Author: Vincent Dubourg <vincent.dubourg@gmail.com>
# (mostly translation, see implementation details)
# License: BSD 3 clause
from __future__ import print_function
import numpy as np
from scipy import linalg, optimize
f... | |
<|file_name|>show_top_players.py<|end_file_name|><|fim▁begin|>import sys
from django.core.management.base import BaseCommand, CommandError
import nflgame
from terminaltables import AsciiTable
from ...models import Player, Team, Season, Week, WeeklyStats
<|fim▁hole|>
class Command(BaseCommand):
help = 'takes opti... | |
<|file_name|>DkBygningDa.py<|end_file_name|><|fim▁begin|>from Monument import Monument, Dataset
import importer_utils as utils
import importer as importer
class DkBygningDa(Monument):
def set_adm_location(self):
if self.has_non_empty_attribute("kommune"):
if utils.count_wikilinks(self.kommune... | place = utils.get_wikilinks(place)[0].title
if utils.wp_page_exists("da", place):
place_item = utils.q_from_wikipedia("da", place) |
<|file_name|>OptionGuiLogger.java<|end_file_name|><|fim▁begin|>/*
* Copyright 2008 Google Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
* use this file except in compliance with the License. You may obtain a copy of
* the License at
*
* http://www.apache.org/licenses/LICE... | */ |
<|file_name|>__openerp__.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
##############################################################################
#
# Author: Yannick Vaucher
# Copyright 2013 Camptocamp SA
#
# This program is free software: you can redistribute it and/or modify
# it under the t... | 'security/ir.model.access.csv',
], |
<|file_name|>TransmissionCleanUp.py<|end_file_name|><|fim▁begin|>from datetime import datetime as dt
from functools import reduce
import transmissionrpc
from config import config
TRANSMISSION_ENABLED = config['TRANSMISSION_ENABLED']
TRANS_HOST = config['TRANS_HOST']
TRANS_PORT = config['TRANS_PORT']
TRANS_USER = con... | # Update torrents seed ratio limit and mode |
<|file_name|>utils.py<|end_file_name|><|fim▁begin|>"""Utility functions"""<|fim▁hole|>def get_diff(str1, str2):
"""Returns git-diff-like diff between two strings"""
expected = str1.splitlines(1)
actual = str2.splitlines(1)
diff = difflib.unified_diff(expected, actual, lineterm=-0, n=0)
return ''.joi... |
import os
import difflib
|
<|file_name|>lib.rs<|end_file_name|><|fim▁begin|>pub mod checksum;
use crate::checksum::Result;
use pretty_toa::ThousandsSep;
use std::io::Write;
use std::path::PathBuf;
use termcolor::{Color, ColorChoice, ColorSpec, StandardStream, WriteColor};
pub fn print_res(samples: &[i64; 32]) {
let mut stdout = StandardStr... | stdout |
<|file_name|>main-for-windows.py<|end_file_name|><|fim▁begin|># This script is actually for Cyber Security on Windows 7. Should mostly work
# for Windows 8 and 10 too. I just absolutely hate using Windows 8 and refuse
# to test it on any Windows 8 machine.
from __future__ import print_function
from subprocess import ... | def user_management(users):
def should_be_admin(user):
# Should the user be an admin |
<|file_name|>models.py<|end_file_name|><|fim▁begin|>from django.db import models
from olc_webportalv2.users.models import User
from django.contrib.postgres.fields.jsonb import JSONField
import os
from django.core.exceptions import ValidationError
# Create your models here.
def validate_fastq(fieldfile):
filename... |
class GenomeQamlResult(models.Model):
class Meta:
verbose_name_plural = "GenomeQAML Results" |
<|file_name|>tmbuilder.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
from tm import TuringMachine
class TuringMachineBuilder:
"""
Creates a turing machine step by step by retrieving all the necessary
information.
By default (can be specified) sets the halt state to 'HALT and the
bl... | #
# |
<|file_name|>socket.js<|end_file_name|><|fim▁begin|>//*************************************************************
// Filename: socket.js
//
// Author: Jake Higgins <jth7036@rit.edu>
//*************************************************************
var Socket;
function addSocketListeners() {
Socket = new io();
... | min: obj.min,
objectID: obj.objectID,
objectType: obj.type, |
<|file_name|>sample.py<|end_file_name|><|fim▁begin|>from sklearn.utils import resample
from darts.api.dataset import Subset
def dummy_indices(dataset):
""" Get indexes for the dataset """
return [x for x in range(len(dataset))]
def sample(dataset, num_samples, replace=True):
""" Sample the dataset """
... | return Subset(dataset, sample_idx) |
<|file_name|>portal.rs<|end_file_name|><|fim▁begin|>use crate::compat::Mutex;
use crate::screen::{Screen, ScreenBuffer};
use alloc::sync::Arc;
use core::mem;
use graphics_base::frame_buffer::{AsSurfaceMut, FrameBuffer};
use graphics_base::system::{DeletedIndex, System};
use graphics_base::types::Rect;
use graphics_base... | |
<|file_name|>Webluker_cdn.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
# encoding: utf-8
<|fim▁hole|>def run(whatweb, pluginname):
whatweb.recog_from_header(pluginname, "Webluker")<|fim▁end|> | |
<|file_name|>NByteArray.java<|end_file_name|><|fim▁begin|>/*
* Copyright 2012 PRODYNA AG
*
* Licensed under the Eclipse Public License (EPL), 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://www.opensource.org/lic... | *
* @param value
* the value to initialize
*/ |
<|file_name|>cs_scene.cpp<|end_file_name|><|fim▁begin|>/*
* This file is part of the TrinityCore Project. See AUTHORS file for Copyright information
*
* 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 Fo... | {
{ "scene", rbac::RBAC_PERM_COMMAND_SCENE, true, NULL, "", sceneCommandTable }
}; |
<|file_name|>document_rule.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/. */
//! [@document rules](https://www.w3.org/TR/2012/WD-cs... | |
<|file_name|>styles.js<|end_file_name|><|fim▁begin|>/*!
* Copyright (c) 2014 Milo van der Linden (milo@dogodigi.net)
*
* This file is part of opendispatcher/safetymapsDBK
*
* opendispatcher is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as publis... | var img = "images/" + feature.attributes.namespace.toLowerCase() + "/" + feature.attributes.type + ".png";
return typeof imagesBase64 === 'undefined' ? dbkjs.basePath + img : imagesBase64[img]; |
<|file_name|>ants.js<|end_file_name|><|fim▁begin|>import * as util from '../src/utils.js'
import World from '../src/World.js'
import Color from '../src/Color.js'
import ColorMap from '../src/ColorMap.js'
import ThreeView from '../src/ThreeView.js'
const params = util.RESTapi({
seed: false,
population: 100,
... | sprite: t.carryingFood ? nestSprite : foodSprite, |
<|file_name|>signals.py<|end_file_name|><|fim▁begin|>"""
Grades related signals.
"""
from django.dispatch import Signal
# Signal that indicates that a user's score for a problem has been updated.
# This signal is generated when a scoring event occurs either within the core
# platform or in the Submissions module. Not... | 'usage_id', # Unicode string indicating the courseware instance
'points_earned', # Score obtained by the user |
<|file_name|>replace.ts<|end_file_name|><|fim▁begin|>/* eslint-disable unicorn/consistent-function-scoping */
import { ensure, isDefined, isString } from 'tiny-types';
import { AnswersQuestions } from '../../../actor';
import { Answerable } from '../../../Answerable';
import { AnswerMappingFunction } from '../AnswerMa... | |
<|file_name|>shard_test.go<|end_file_name|><|fim▁begin|>package shard
import (
"fmt"
"math"
"sort"
"testing"
"time"
"github.com/coreos/go-etcd/etcd"
"github.com/csigo/ephemeral"
"github.com/csigo/portforward"
"github.com/csigo/test"
"github.com/golang/groupcache/consistenthash"
"github.com/satori/go.uuid"
... | etcdForwdCli *etcd.Client
)
type ConnHashTestSuite struct { |
<|file_name|>admin.py<|end_file_name|><|fim▁begin|>from django.apps import apps
from django.contrib import admin
AccessToken = apps.get_model('oauth2', 'AccessToken')
Client = apps.get_model('oauth2', 'Client')
Grant = apps.get_model('oauth2', 'Grant')
RefreshToken = apps.get_model('oauth2', 'RefreshToken')
class Ac... | list_display = ('user', 'client', 'token', 'expires', 'scope')
raw_id_fields = ('user',) |
<|file_name|>resources.py<|end_file_name|><|fim▁begin|># coding=utf-8
# Copyright 2014 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
from __future__ import (absolute_import, division, generators, nested_scopes, print_function,
... | BUILD file's directory.
:type sources: ``Fileset`` or list of strings
""" |
<|file_name|>tests.rs<|end_file_name|><|fim▁begin|>use scanner::tokenize;
use scanner::tokens::Token;
use scanner::tokens::Token::*;
#[test]
fn scan_terminals() {
let expected = vec![Lparen, Rparen, Dot];
let actual = tokenize("().");
assert_eq!(expected, actual);
}
#[test]
fn scan_base_command() {
l... | // todo: add some unicode characters to the test
let expected = vec![Lparen, Ident("abc1231".to_string()), Rparen];
let actual = tokenize("(abc1231)"); |
<|file_name|>galaxy.cpp<|end_file_name|><|fim▁begin|>// license:BSD-3-Clause
// copyright-holders:Krzysztof Strzecha, Miodrag Milanovic
/***************************************************************************
Galaksija driver by Krzysztof Strzecha and Miodrag Milanovic
22/05/2008 Tape support added (Miodrag Milano... | |
<|file_name|>nested-object.js<|end_file_name|><|fim▁begin|><|fim▁hole|><|fim▁end|> | let x = { a: (b ? 1 : 2)}; |
<|file_name|>Action-test.js<|end_file_name|><|fim▁begin|>'use strict';
import Application from '../../core/Application.js';
import Action from '../../core/Action.js';
describe('Action', () => {
var app;
var action;
class ChildAction extends Action {
get name() {
return 'ChildAction';
... | expect(action.execute).toEqual(jasmine.any(Function));
expect(() => action.execute(payload)).toThrow(); |
<|file_name|>FileReaderModel.java<|end_file_name|><|fim▁begin|>package edu.casetools.icase.mreasoner.gui.model.io;
import java.io.BufferedReader;
import java.io.FileReader;
import java.io.IOException;
public class FileReaderModel {
FileReader fileReader = null;
BufferedReader br = null;
<|fim▁hole|> public vo... | |
<|file_name|>associated-types-no-suitable-bound.rs<|end_file_name|><|fim▁begin|>trait Get {
type Value;
fn get(&self) -> <Self as Get>::Value;
}
struct Struct {<|fim▁hole|>}
impl Struct {
fn uhoh<T>(foo: <T as Get>::Value) {}
//~^ ERROR the trait bound `T: Get` is not satisfied
}
fn main() {
}<|fim▁e... | x: isize, |
<|file_name|>columns.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
"""
This module contains the :class:`Column` class, which defines a "vertical"
array of tabular data. Whereas :class:`.Row` instances are independent of their
parent :class:`.Table`, columns depend on knowledge of both their position in
the par... | |
<|file_name|>Main.java<|end_file_name|><|fim▁begin|>/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package sv.edu.uesocc.ingenieria.disenio2_2015.pymesell.presentacion.pymesellv1desk... | |
<|file_name|>SoftIndexFileStoreConfigurationBuilder.java<|end_file_name|><|fim▁begin|>/*
* JBoss, Home of Professional Open Source.
* Copyright 2021, 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 contr... | import org.infinispan.persistence.sifs.configuration.DataConfiguration; |
<|file_name|>configure.py<|end_file_name|><|fim▁begin|>import os, sys
import commands
import optparse
import shutil
INSTALL_DIR = ""
BASE_DIR = os.path.dirname(__file__)
SIP_FILE = "poppler-qt4.sip"
BUILD_DIR = "build"
SBF_FILE = "QtPoppler.sbf"
def _cleanup_path(path):
"""
Cleans the path:
- Removes ... | # template and the dictionary.
sipconfig.create_config_module(
os.path.join(BASE_DIR, "pypopplerqt4config.py"), |
<|file_name|>SlidingWindowReservoirTest.java<|end_file_name|><|fim▁begin|>/*
* Copyright 2010-2013 Coda Hale and Yammer, Inc., 2014-2017 Dropwizard 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 ... | .containsOnly(2, 3, 4);
} |
<|file_name|>p62.rs<|end_file_name|><|fim▁begin|>enum BinaryTree<T> {
Node(T, ~BinaryTree<T>, ~BinaryTree<T>),
Empty
}
fn internals<T>(tree: BinaryTree<T>) -> ~[T] {
match tree {
Empty => ~[],
Node(_, ~Empty, ~Empty) => ~[],
Node(x, ~left, ~right) => (~[x]).move_... | let t1: BinaryTree<uint> = Empty;
let t2 = Node('x', ~Node('y', ~Empty, ~Empty), ~Node('z', ~Node('t', ~Empty, ~Empty), ~Empty));
assert_eq!(internals(t1), ~[]);
assert_eq!(internals(t2), ~['x', 'z']); |
<|file_name|>stack.rs<|end_file_name|><|fim▁begin|>pub type Stack<T> = Vec<T>;
#[cfg(test)]
mod tests {
use super::*;
#[test]
fn test_stack() {
let mut stack: Stack<i32> = Stack::new();
assert_eq!(true, stack.is_empty());
assert_eq!(None, stack.pop());
stack.push(15);
... | stack.push(2);
assert_eq!(2, stack.pop().unwrap());
assert_eq!(6, stack.pop().unwrap()); |
<|file_name|>jquery-galleria.d.ts<|end_file_name|><|fim▁begin|>// Type definitions for galleria.js v1.4.2
// Project: https://github.com/aino/galleria
// Definitions by: Robert Imig <https://github.com/rimig>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
declare module GalleriaJS {
interface Galleri... | interface GalleriaEntry {
image?: string;
thumbnail?: string;
title?: string; |
<|file_name|>BaseDecimaterT.hh<|end_file_name|><|fim▁begin|>/* ========================================================================= *
* *
* OpenMesh *
* Copyright ... | * |
<|file_name|>l10n.js<|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/licenses/LICENSE-2.0
*
... | }; |
<|file_name|>ranker_root.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python2.5
#
# Copyright 2009 the Melange authors.<|fim▁hole|>#
# 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://... | |
<|file_name|>mymodule_demo3.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python3
from mymodule import *
sayhi()<|fim▁hole|># print('Version: ', __version__)<|fim▁end|> |
# __version__ 不会导入 |
<|file_name|>test_install_suse.py<|end_file_name|><|fim▁begin|>"""
Tests for install.py for SUSE based Linux distributions
"""
import os
import shutil
from unittest import mock
<|fim▁hole|>pytestmark = pytest.mark.skipif(
not pytest.helpers.helper_is_suse(),
reason="Tests for openSUSE/SUSE"
)
def test_rpm_do... | import pytest
from install import Cmd, CmdError, RemoteFileNotFoundError
|
<|file_name|>forms.py<|end_file_name|><|fim▁begin|>from madrona.features.forms import FeatureForm
from django import forms
from visualize.models import *<|fim▁hole|>class BookmarkForm(FeatureForm):
class Meta(FeatureForm.Meta):
model = Bookmark<|fim▁end|> | |
<|file_name|>test_sahara_job_binary.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
#<|fim▁hole|># WITHOUT WA... | # Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, |
<|file_name|>lib.rs<|end_file_name|><|fim▁begin|>// Copyright 2012-2015 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/licens... | PrivateLinkage = 9,
ExternalWeakLinkage = 12,
CommonLinkage = 14, |
<|file_name|>macro-crate-use.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.apache.org... | pub fn increment(x: usize) -> usize {
x + 1 |
<|file_name|>ui.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/. */
//! Specified types for UI properties.
use cssparser::Parser;
use... | Ok(number) => Some((number, Number::parse(context, input)?)),
Err(_) => None,
},
}) |
<|file_name|>strutil.rs<|end_file_name|><|fim▁begin|>// miscelaneous string utilities
// returns the string slice following the target, if any
pub fn after<'a>(s: &'a str, target: &str) -> Option<&'a str> {
if let Some(idx) = s.find(target) {
Some(&s[(idx+target.len())..])
} else {
None
}
}... | if let Some(idx) = txt.find(delim) { |
<|file_name|>views.py<|end_file_name|><|fim▁begin|>""" API v0 views. """
import logging
from django.http import Http404
from opaque_keys import InvalidKeyError
from opaque_keys.edx.keys import CourseKey
from rest_framework import status
from rest_framework.authentication import SessionAuthentication
from rest_framewor... | |
<|file_name|>products.py<|end_file_name|><|fim▁begin|>from __future__ import unicode_literals
from django.db import models
from django.utils.encoding import python_2_unicode_compatible
from django.utils.translation import pgettext_lazy
from .base import Product
from .variants import (ProductVariant, PhysicalProduct, ... | |
<|file_name|>about_monkey_patching.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Related to AboutOpenClasses in the Ruby Koans
#
from runner.koan import *
class AboutMonkeyPatching(Koan):
class Dog:
def bark(self):
return "WOOF"
def test_as_defined_dog... |
def test_subclasses_of_built_in_classes_can_be_be_monkey_patched(self):
self.MyInt.is_even = lambda self: (self % 2) == 0 |
<|file_name|>StockResult.java<|end_file_name|><|fim▁begin|>package com.board.gd.domain.stock;
import lombok.Data;
import java.util.List;
import java.util.stream.Collectors;
/**<|fim▁hole|>public class StockResult {
private Long id;
private String name;
private String code;
public static StockResult ... | * Created by gd.godong9 on 2017. 5. 19.
*/
@Data |
<|file_name|>utilities.py<|end_file_name|><|fim▁begin|># #
# Copyright 2012-2019 Ghent University
#
# This file is part of EasyBuild,
# originally created by the HPC team of Ghent University (http://ugent.be/hpc/en),
# with support of Ghent University (http://ugent.be/hpc),
# the Flemish Supercomputer Centre (VSC) (htt... | |
<|file_name|>tail.rs<|end_file_name|><|fim▁begin|>/*
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This software may be used and distributed according to the terms of the
* GNU General Public License version 2.
*/
use anyhow::{Context, Error};
use bookmarks::{BookmarkUpdateLog, BookmarkUpdateLogEntry, ... | .await;
|
<|file_name|>app.js<|end_file_name|><|fim▁begin|>/*
This file is generated and updated by Sencha Cmd. You can edit this file as
needed for your application, but these edits will have to be merged by
Sencha Cmd when it performs code generation tasks such as generating new
models, controllers or views and... | |
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|>from .engine import BloggingEngine
from .processor import PostProcessor<|fim▁hole|>
"""
Flask-Blogging is a Flask extension to add blog support to your
web application. This extension uses Markdown to store and then
render the webpage.
Author: Gouthaman Balaraman
... | from .sqlastorage import SQLAStorage
from .storage import Storage
|
<|file_name|>params.py<|end_file_name|><|fim▁begin|># coding: utf-8
"""
DLRN API
DLRN API client
OpenAPI spec version: 1.0.0
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
from pprint import pformat
from six import iteritems
class Params(object):
"""NOTE: This class is ... | |
<|file_name|>TEnum.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 A... |
package libthrift091; |
<|file_name|>down_pic_thread.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
# -*- coding: utf-8 -*-
# @Date : 2016-09-01 22:26:01
# @Author : Your Name (you@example.org)
# @Link : http://example.org
# @Version : $Id$
import os
import threading
import requests
import lxml<|fim▁hole|>from bs4 import Beauti... | from threading import Thread |
<|file_name|>ServicesPanel.spec.tsx<|end_file_name|><|fim▁begin|>/// <reference types='jest' />
import * as React from 'react';
import ServicesPanel from '../ServicesPanel';
import Cases from './ServicesPanel.cases';
import { shallow, mount, render } from 'enzyme';
describe('ServicesPanel', () => {
let servicesPa... |
// servicesPanel.setState({loadingSearch:false, searchValue:'mysearchcriteria'});
// expect(servicesPanel.find('.rowHead').first().find('i').length).toEqual(1);
// expect(servicesPanel.find('.rowHead').first().find('i').html()).toContain('fa fa-times fa-lg'); |
<|file_name|>index.ts<|end_file_name|><|fim▁begin|><|fim▁hole|><|fim▁end|> | export * from './tabs-demo.component'; |
<|file_name|>simple_tomo_test.py<|end_file_name|><|fim▁begin|># Copyright 2014 Diamond Light Source 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... | import unittest |
<|file_name|>encoder.rs<|end_file_name|><|fim▁begin|>// Copyright 2012-2015 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... | // no sub-item recording needed in these cases
} |
<|file_name|>transaction_sr.py<|end_file_name|><|fim▁begin|># Copyright (C) 2020 Red Hat, Inc.
#
# 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<|fim▁hole|># but WITHOUT ANY WARRANTY; without even the implied warranty of
# MER... | # the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful, |
<|file_name|>ElasticsearchRestComponentVerifierExtensionTest.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 A... |
} |
<|file_name|>driver.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 required by applicable... | def __init__(self):
super(Handler, self).__init__()
self._docker = None |
<|file_name|>genesis_builder.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
from ethereum.utils import sha3, encode_hex, denoms
from raiden.utils import privatekey_to_address
from raiden.tests.utils.blockchain import GENESIS_STUB
<|fim▁hole|>
def generate_accounts(seeds):
"""Create private keys and addre... | CLUSTER_NAME = 'raiden' |
<|file_name|>test.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<|fim▁hole|>// http://rust-lang.org/COPYRIGHT.
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org... | |
<|file_name|>form.utils.spec.ts<|end_file_name|><|fim▁begin|>/*
* Lumeer: Modern Data Definition and Processing Platform
*
* Copyright (C) since 2017 Lumeer.io, s.r.o. and/or its affiliates.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public Lic... | |
<|file_name|>SocketSecurityException.java<|end_file_name|><|fim▁begin|>/*
* Copyright (c) 1996, 2013, Oracle and/or its affiliates. All rights reserved.
* ORACLE PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*/
package java.rmi.server;<|fim▁ho... | |
<|file_name|>payment_form.js<|end_file_name|><|fim▁begin|>odoo.define('payment_stripe.payment_form', function (require) {
"use strict";
var ajax = require('web.ajax');
var core = require('web.core');
var Dialog = require('web.Dialog');
var PaymentForm = require('payment.payment_form');
var qweb = core.qweb;
var _t = ... | self.enableButton(button);
self.displayError(
_t('Unable to save card'),
_t("We are not able to add your payment method at the moment. ") + |
<|file_name|>cli_utils.py<|end_file_name|><|fim▁begin|># Copyright 2018 Red Hat, Inc. and others. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apach... | logger = logging.getLogger("cli_utils")
|
<|file_name|>path119.py<|end_file_name|><|fim▁begin|>import zstackwoodpecker.test_state as ts_header
TestAction = ts_header.TestAction
def path():
return dict(initial_formation="template4",\
path_list=[[TestAction.delete_volume, "vm1-volume1"], \
[TestAction.reboot_vm, "vm1"], \
[TestAction.crea... | |
<|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 Litecoin</source>
... | </message>
<message>
<location line="-104"/> |
<|file_name|>ir_fields_converter.py<|end_file_name|><|fim▁begin|># Copyright 2016-2017 Jairo Llopis <jairo.llopis@tecnativa.com>
# Copyright 2016 Tecnativa - Vicent Cubells
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
import logging
from lxml import etree, html
from odoo import api, models
_logger... | html_content)
return ""
|
<|file_name|>bounding_box.py<|end_file_name|><|fim▁begin|>from model import User
from geo.geomodel import geotypes
def get(handler, response):
lat1 = handler.request.get('lat1')<|fim▁hole|> lon1 = handler.request.get('lng1')
lat2 = handler.request.get('lat2')
lon2 = handler.request.get('lng2')
response.users ... | |
<|file_name|>testifacecache.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
from basetest import BaseTest
import sys, tempfile, os, time
import unittest
import data
sys.path.insert(0, '..')
from zeroinstall.injector import model, gpg, trust
from zeroinstall.injector.namespaces import config_site
from zeroinstall... | iface_cache = self.config.iface_cache
trust.trust_db.trust_key(
'92429807C9853C0744A68B9AAE07828059A53CC1') |
<|file_name|>login.service.ts<|end_file_name|><|fim▁begin|>import { Injectable } from '@angular/core';
import { JhiLanguageService } from 'ng-jhipster';
<|fim▁hole|>export class LoginService {
constructor(
private languageService: JhiLanguageService,
private principal: Principal,
private au... | import { Principal } from '../auth/principal.service';
import { AuthServerProvider } from '../auth/auth-jwt.service';
@Injectable() |
<|file_name|>test_ansiblegate.py<|end_file_name|><|fim▁begin|>import pytest
pytestmark = [
pytest.mark.skip_on_windows(reason="Not supported on Windows"),
pytest.mark.skip_if_binaries_missing(
"ansible",
"ansible-doc",
"ansible-playbook",
check_all=True,
reason="ansible ... | Test that the ansible functions are actually loaded
""" |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.