prompt large_stringlengths 70 991k | completion large_stringlengths 0 1.02k |
|---|---|
<|file_name|>test_e_invoice_request_log.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
# Copyright (c) 2020, Frappe Technologies Pvt. Ltd. and Contributors
# See license.txt
from __future__ import unicode_literals
# import frappe
import unittest
class TestEInvoiceRequestLog(unittest.TestCase):<|fim▁hole|><|... | pass |
<|file_name|>ini_doc.cpp<|end_file_name|><|fim▁begin|>#include <algorithm>
#include <utility>
#include "ini_doc.hpp"
<|fim▁hole|>namespace Utility {
namespace {
std::string& trim(std::string& str) {
auto pos = str.find_first_not_of(" \t");
str.erase(0, pos);
pos = str.find_last_not_of(" \t");
... | |
<|file_name|>lib.rs<|end_file_name|><|fim▁begin|><|fim▁hole|>//!
//! If you're using the service, you're probably looking for [DirectoryServiceClient](struct.DirectoryServiceClient.html) and [DirectoryService](trait.DirectoryService.html).
extern crate hyper;
extern crate rusoto_core;
extern crate serde;
#[macro_use]
... | //! AWS Directory Service |
<|file_name|>test_sampleParser.py<|end_file_name|><|fim▁begin|># test_sampleParser.py
import os
from ..sampleParser import SampleParser
class TestSampleParser:
def setup(self):
self.folderName = os.path.join('.', 'tests', 'Export')
self.parser = SampleParser(self.folderName)
def test_getDire... | assert len(sampleDictionary) == 4
print ("SampleParser: ", sampleDictionary)
# each item in the dictionary should have two samples for each sample type
for sample in sampleDictionary.items(): |
<|file_name|>MeasureReportBuilder.java<|end_file_name|><|fim▁begin|>package ca.uhn.fhir.cql.dstu3.builder;
/*-
* #%L
* HAPI FHIR JPA Server - Clinical Quality Language
* %%
* Copyright (C) 2014 - 2022 Smile CDR, Inc.
* %%
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this f... | return this;
} |
<|file_name|>demo.js<|end_file_name|><|fim▁begin|>'use strict';
// There's an example D script here to showcase a "slow" handler where it's
// wildcard'd by the route name. In "real life" you'd probably start with a
// d script that breaks down the route -start and -done, and then you'd want
// to see which handler i... | // 256 |@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ 9 |
<|file_name|>index.ts<|end_file_name|><|fim▁begin|>/**
* Copyright 2021 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
*
* http://www.apache.org/licenses/LICENSE-2.0<|... | |
<|file_name|>PatientInfoRepository.java<|end_file_name|><|fim▁begin|>package org.cardiacatlas.xpacs.repository;
import org.cardiacatlas.xpacs.domain.PatientInfo;
<|fim▁hole|>/**
* Spring Data JPA repository for the PatientInfo entity.
*/
@SuppressWarnings("unused")
public interface PatientInfoRepository extends JpaR... | import org.springframework.data.jpa.repository.*;
import java.util.List;
|
<|file_name|>hw5_task1.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
# -*- coding: utf-8 -*-
u"""
Задание 1: классный Человек.
УСЛОВИЕ:
Реализовать класс Person, который отображает запись в книге контактов.
Класс имеет 4 атрибута:
- surname - строка - фамилия контакта (обязательный)
- first_name - с... | self.nickname = nickname
|
<|file_name|>precision_recall.py<|end_file_name|><|fim▁begin|>import matplotlib.pyplot as plt
import numpy as np
import sklearn
from sklearn import svm, datasets
from sklearn.metrics import precision_recall_curve
from sklearn.metrics import average_precision_score
from sklearn.cross_validation import train_test_split
f... | """ |
<|file_name|>issue-57271-lib.rs<|end_file_name|><|fim▁begin|>#[derive(Copy, Clone, Debug, Eq, PartialEq, Hash)]
pub enum BaseType {
Byte,
Char,
Double,
Float,
Int,
Long,<|fim▁hole|> Short,
Boolean,
}<|fim▁end|> | |
<|file_name|>wsgi.py<|end_file_name|><|fim▁begin|>"""<|fim▁hole|>
It exposes the WSGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/1.7/howto/deployment/wsgi/
"""
import os
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "bball_inte... | WSGI config for bball_intel project. |
<|file_name|>JSONToken.java<|end_file_name|><|fim▁begin|>/*
* Copyright 1999-2101 Alibaba Group.
*
* Licensed under the Apache License, Version 2.0 (the "License");<|fim▁hole|> * You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or a... | * you may not use this file except in compliance with the License. |
<|file_name|>server.js<|end_file_name|><|fim▁begin|>var express = require('express');
var app = express();
var path = require('path');
var session = require('express-session');
var bodyParser = require('body-parser')
var fs = require('fs');
app.use(express.static(path.join(__dirname, 'public')));
app.use(bodyParser.ur... | |
<|file_name|>setup.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python
# Copyright 2016 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.or... | import setuptools
install_requires = ['setuptools']
if sys.version_info < (3, 0): |
<|file_name|>validation_utils.py<|end_file_name|><|fim▁begin|>import gzip
import logging
import os
import shutil
import uuid
from PIL import Image
from zipfile import ZipFile
import pandas as pd
import numpy as np
import pyresample as pr
from trollvalidation.validations import configuration as cfg
LOG = logging.getL... | |
<|file_name|>Six_zebra_models8148.py<|end_file_name|><|fim▁begin|>import _surface
import chimera
try:
import chimera.runCommand
except:
pass
from VolumePath import markerset as ms
try:
from VolumePath import Marker_Set, Link
new_marker_set=Marker_Set
except:
from VolumePath import volume_path_dialog
d= volu... | marker_sets["particle_33 geometry"]=s
s= marker_sets["particle_33 geometry"]
mark=s.place_marker((6903.16, 12091.3, 9204.94), (0.7, 0.7, 0.7), 525.154) |
<|file_name|>PlaylistsNav.tsx<|end_file_name|><|fim▁begin|>/* eslint-disable jsx-a11y/no-autofocus */
import * as electron from 'electron';
import * as React from 'react';
import * as Icon from 'react-fontawesome';
import * as PlaylistsActions from '../../actions/PlaylistsActions';
import PlaylistsNavLink from '../Pl... |
const context = Menu.buildFromTemplate(template);
context.popup({}); // Let it appear |
<|file_name|>Shendrones.py<|end_file_name|><|fim▁begin|>import scrapy
from scrapy import log
from scrapy.spiders import CrawlSpider, Rule
from scrapy.linkextractors import LinkExtractor
from rcbi.items import Part
import copy
import json
import re
VARIANT_JSON_REGEX = re.compile("product: ({.*}),")
class ShendronesS... | variant["price"] = "${:.2f}".format(v["price"] / 100)
if not preorder: |
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|><|fim▁hole|>from .Cov_Mat import *
from .SaveLoadModel import *<|fim▁end|> | from .Confusion_MI import* |
<|file_name|>TaskEvent.java<|end_file_name|><|fim▁begin|>/*
* Copyright 2005-2006 Sun Microsystems, Inc. All Rights Reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License... | |
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
# --!-- coding: utf8 --!--
"""
The converters package provide functions to quickly convert on the fly from
one format to another. It is responsible to check what external library are
present, and do the job as best as possible with what we hav... | return e.toPlainText() |
<|file_name|>SimplexNoise.java<|end_file_name|><|fim▁begin|>/*
* Copyright 2013 MovingBlocks
*
* 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/LIC... | } else {
t3 *= t3; |
<|file_name|>MaterialPropertyValue.cpp<|end_file_name|><|fim▁begin|>/*********************************************************\
* Copyright (c) 2012-2021 The Unrimp Team
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of this software
* and associated documentation files (the "Softw... | |
<|file_name|>nexttowardl.cpp<|end_file_name|><|fim▁begin|>// Copyright John Maddock 2008.
// Use, modification and distribution are 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)
//
# include <pch.hpp>
#ifndef... | extern "C" long double BOOST_MATH_TR1_DECL boost_nexttowardl BOOST_PREVENT_MACRO_SUBSTITUTION(long double x, long double y) BOOST_MATH_C99_THROW_SPEC
|
<|file_name|>rkt_image_dependencies_test.go<|end_file_name|><|fim▁begin|>// Copyright 2015 The rkt 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/... | // cached in the CAS, and some dependencies are fetched via the discovery |
<|file_name|>0bc0a93ac867_.py<|end_file_name|><|fim▁begin|>"""Add user table to support doorman and oauth authentication.
Revision ID: 0bc0a93ac867
Revises: fd28e46e46a6
Create Date: 2016-05-11 11:01:40.472139
"""
# revision identifiers, used by Alembic.
revision = '0bc0a93ac867'<|fim▁hole|>import doorman.database
... | down_revision = 'fd28e46e46a6'
from alembic import op
import sqlalchemy as sa |
<|file_name|>test_cobalt.py<|end_file_name|><|fim▁begin|># Copyright 2016 Presslabs SRL
#
# 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
#
# U... | def test_stop_signals(self, mocker):
pass |
<|file_name|>debug.interceptor.ts<|end_file_name|><|fim▁begin|>import { module, IRequestConfig, IHttpInterceptor, IHttpProvider } from 'angular';
import { $log, $location } from 'ngimport';
import { JsonUtils } from 'core/utils';
export class DebugInterceptor implements IHttpInterceptor {
public request = (config: I... | return config;
}; |
<|file_name|>utils.py<|end_file_name|><|fim▁begin|>import datetime
import decimal
import hashlib
import logging
from time import time
from django.conf import settings
from django.utils.encoding import force_bytes
from django.utils.timezone import utc
logger = logging.getLogger('django.db.backends')
class CursorWrap... | microseconds = '0' |
<|file_name|>test_youtube_signature.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
from __future__ import unicode_literals
# Allow direct execution
import os
import sys
import unittest
sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
import io
import re
import string
from yout... |
if not os.path.exists(fn):
compat_urlretrieve(url, fn)
|
<|file_name|>mod.rs<|end_file_name|><|fim▁begin|>// Copyright 2015, 2016 Ethcore (UK) Ltd.
// This file is part of Parity.
// Parity 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 L... | }
#[test] |
<|file_name|>PostgreServerHome.java<|end_file_name|><|fim▁begin|>/*
* DBeaver - Universal Database Manager
* Copyright (C) 2010-2019 Serge Rider (serge@jkiss.org)
*
* Licensed under the Apache License, Version 2.0 (the "License");<|fim▁hole|> *
* Unless required by applicable law or agreed to in writing, software
... | * you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0 |
<|file_name|>udp.rs<|end_file_name|><|fim▁begin|>// Copyright 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/licenses/LI... |
let (done, rx) = channel();
let tx2 = tx.clone();
let _t = thread::spawn(move|| { |
<|file_name|>schema.go<|end_file_name|><|fim▁begin|>// The MIT License (MIT)
//
// Copyright © 2017 CyberAgent, Inc.
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction,... | |
<|file_name|>DBcon.py<|end_file_name|><|fim▁begin|># coding:utf-8
'''
Created on 19/1/2015
@author: PC30
'''
from flaskext.mysql import MySQL#importar mysql
from flask import Flask#importar flask
class DBcon():
'''
classdocs
'''
pass<|fim▁hole|> '''
Constructor
'''
pass... |
def __init__(self): |
<|file_name|>NextState.hpp<|end_file_name|><|fim▁begin|>// -*- mode: c++; c-basic-style: "bsd"; c-basic-offset: 4; -*-
/*
* kdm/event/NextState.hpp
* Copyright (C) Cátedra SAES-UMU 2010 <andres.senac@um.es>
* Copyright (C) INCHRON GmbH 2016 <soeren.henning@inchron.com>
*
* EMF4CPP is free software: you can redistr... | /* This is the same value as getClassifierId() returns, but as a static
* value it can be used in template expansions. */
static const int classifierId = EventPackage::NEXTSTATE; |
<|file_name|>conf.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
from __future__ import unicode_literals
from os.path import abspath, dirname, join
#
# Bokeh documentation build configuration file, created by
# sphinx-quickstart on Sat Oct 12 23:43:03 2013.
#
# This file is execfile()d with the current direct... | 'pandas': ('http://pandas.pydata.org/pandas-docs/stable/', None),
'numpy': ('http://docs.scipy.org/doc/numpy/', None) |
<|file_name|>coupon.go<|end_file_name|><|fim▁begin|>/**
* Copyright 2014 @ to2.net.
* name :
* author : jarryliu
* date : 2013-12-03 21:04
* description :
* history :
*/
package promotion
import (
"go2o/core/domain/interface/member"
)
// 优惠券促销
type ICouponPromotion interface {
GetDomainId() int32
// 获取促销内... | // 获取优惠的金额
GetCouponFee(orderFee float32) float32
|
<|file_name|>test_generate_course_overview.py<|end_file_name|><|fim▁begin|># pylint: disable=missing-docstring
from django.core.management.base import CommandError
from mock import patch
from nose.plugins.attrib import attr
from openedx.core.djangoapps.content.course_overviews.management.commands import generate_course... | """
Create courses in modulestore. |
<|file_name|>test_bilinear.py<|end_file_name|><|fim▁begin|>import unittest
import numpy
import chainer
from chainer.backends import cuda
from chainer import functions
from chainer import gradient_check
from chainer import testing
from chainer.testing import attr
def _uniform(*shape):
return numpy.random.uniform... | chainer.functions.bilinear(
self.e1, self.e2, self.w, self.v1, self.v2, self.b)
@attr.gpu |
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
# Copyright 2022 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
#
# http://www.apache.org/license... | |
<|file_name|>testLoadCourse.js<|end_file_name|><|fim▁begin|>var ERR = require('async-stacktrace');
var assert = require('assert');
var fs = require('fs');<|fim▁hole|>
var courseDB = require('../lib/course-db');
var logger = require('./dummyLogger');
describe('courseDB.loadFullCourse() on exampleCourse', function() {
... | |
<|file_name|>stream.py<|end_file_name|><|fim▁begin|>import io
import json
class Stream(object):
__shortname__ = "stream"
"""
This is a base class that should be inherited when implementing
different stream types. Should only be created by plugins.
"""
def __init__(self, session):
sel... | @classmethod |
<|file_name|>gen_sps.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
import click
from copy import copy
from netCDF4 import Dataset
import numpy as np
import numpy.ma as ma
import os
import rasterio
import rasterio.warp as rwarp
import time
import osr
from .. import geotools
from .. import utils
def earth_radi... | main() |
<|file_name|>fetcher.js<|end_file_name|><|fim▁begin|>// Generated by CoffeeScript 1.11.1
var Fetcher, ware;
ware = require('ware');<|fim▁hole|> }
Fetcher.prototype.args = function() {
this.args = arguments;
return this;
};
Fetcher.prototype.use = function(operation) {
this.ware.use(operation);
... |
Fetcher = (function() {
function Fetcher() {
this.ware = ware(); |
<|file_name|>signaltools.py<|end_file_name|><|fim▁begin|># Author: Travis Oliphant
# 1999 -- 2002
import sigtools
from scipy import linalg
from scipy.fftpack import fft, ifft, ifftshift, fft2, ifft2, fftn, \
ifftn, fftfreq
from numpy import polyadd, polymul, polydiv, polysub, roots, \
poly, polyval, p... | ext = const_ext(x, edge, axis=axis)
else: |
<|file_name|>tigerchefspider.py<|end_file_name|><|fim▁begin|>from scrapy.spider import BaseSpider
from scrapy.selector import HtmlXPathSelector
from scrapy.http import Request, HtmlResponse
from scrapy.utils.response import get_base_url
from scrapy.utils.url import urljoin_rfc
from product_spiders.items import Product... | yield product_loader.load_item() |
<|file_name|>api.py<|end_file_name|><|fim▁begin|># Copyright (c) 2016 The Johns Hopkins University/Applied Physics Laboratory
# 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 Licen... | |
<|file_name|>dms.js<|end_file_name|><|fim▁begin|>/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
/* Geodesy representation conversion functions (c) Chris Veness 2002-2015 */
/* - www.movable-type.co.uk/scripts/latlong.html ... |
/** |
<|file_name|>injection_rwx.py<|end_file_name|><|fim▁begin|># Copyright (C) 2014 Optiv, Inc. (brad.spengler@optiv.com)
# This file is part of Cuckoo Sandbox - http://www.cuckoosandbox.org
# See the file 'docs/LICENSE' for copying permission.
from lib.cuckoo.common.abstracts import Signature
class InjectionRWX(Signatur... | filter_apinames = set(["NtAllocateVirtualMemory","NtProtectVirtualMemory","VirtualProtectEx"])
filter_analysistypes = set(["file"])
def on_call(self, call, process): |
<|file_name|>gui.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python
""" gui -- The main wicd GUI module.
Module containing the code for the main wicd GUI.
"""
#
# Copyright (C) 2007-2009 Adam Blackburn
# Copyright (C) 2007-2009 Dan O'Reilly
#
# This program is free software; you can redistribute it and/or modi... | self.all_network_list.show_all() |
<|file_name|>article_simulated_estimate_mpi.py<|end_file_name|><|fim▁begin|>'''
run with ex: mpiexec -n 10 python article_simulated_estimate_mpi.py
Created on Jul 11, 2014
@author: jonaswallin
'''
from __future__ import division
import time
import scipy.spatial as ss
import article_simulatedata
from mpi4py import MPI... | |
<|file_name|>conflict_resolver.py<|end_file_name|><|fim▁begin|># ===============================================================================
# Copyright 2015 Jake Ross
#<|fim▁hole|># http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed unde... | # Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
# |
<|file_name|>lib.rs<|end_file_name|><|fim▁begin|>#![allow(dead_code)]
use std::collections::{BTreeMap, HashMap};
use std::iter::FromIterator;
type DocId = i32;
const MIN_DOC_ID: DocId = std::i32::MIN;
const MAX_DOC_ID: DocId = std::i32::MAX;
#[derive(Clone, Debug, PartialEq)]
struct ScoredDoc {<|fim▁hole|>
struct Ter... | id: DocId,
score: f32,
} |
<|file_name|>vector.py<|end_file_name|><|fim▁begin|>from victor.exceptions import (
FieldValidationException,
FieldTypeConversionError,
FieldRequiredError,
VectorInputTypeError
)
class Field(object):
required = True
"""Field is required and an exception will be raised if missing"""
missin... | try: |
<|file_name|>E0401.rs<|end_file_name|><|fim▁begin|>trait Baz<T> {}<|fim▁hole|>
fn foo<T>(x: T) {
fn bfnr<U, V: Baz<U>, W: Fn()>(y: T) { //~ ERROR E0401
}
fn baz<U,
V: Baz<U>,
W: Fn()>
(y: T) { //~ ERROR E0401
}
bfnr(x); //~ ERROR type annotations needed
}
struct A<... | |
<|file_name|>RemoveTileAtWorldXY.js<|end_file_name|><|fim▁begin|>/**
* @author Richard Davey <rich@photonstorm.com>
* @copyright 2018 Photon Storm Ltd.
* @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License}
*/
var RemoveTileAt = require('./RemoveTileAt');
var Wor... | { |
<|file_name|>timeoutsAsyncScript.js<|end_file_name|><|fim▁begin|>'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = timeoutsAsyncScript;
<|fim▁hole|>
var _depcrecationWarning2 = _interopRequireDefault(_depcrecationWarning);
function _interopRequireDefault(obj) { return ob... | var _ErrorHandler = require('../utils/ErrorHandler');
var _depcrecationWarning = require('../helpers/depcrecationWarning'); |
<|file_name|>setup.py<|end_file_name|><|fim▁begin|># Copyright 2016 Yanis Guenane <yguenane@redhat.com>
# Author: Yanis Guenane <yguenane@redhat.com>
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the Lice... | 'License :: OSI Approved :: Apache Software License',
'Operating System :: POSIX :: Linux',
'Programming Language :: Python :: 2.7', |
<|file_name|>difftool.py<|end_file_name|><|fim▁begin|>from __future__ import division, absolute_import, unicode_literals
from qtpy import QtWidgets
from qtpy.QtCore import Qt
from . import cmds
from . import gitcmds
from . import hotkeys
from . import icons
from . import qtutils
from . import utils
from .i18n import ... |
def diff_commits(parent, a, b, context=None): |
<|file_name|>DoubleRippleImageOp.java<|end_file_name|><|fim▁begin|>/*
* Copyright (c) 2009 Piotr Piastucki
*
* This file is part of Patchca CAPTCHA library.
*
* Patchca is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by<|fim▁ho... | * the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* |
<|file_name|>nodelist.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::NodeBinding::N... | pub fn len(&self) -> u32 {
self.element.labels_count()
} |
<|file_name|>setJustifyContent.test.js<|end_file_name|><|fim▁begin|>import Yoga from '@react-pdf/yoga';
import setJustifyContent from '../../src/node/setJustifyContent';
describe('node setJustifyContent', () => {
const mock = jest.fn();
const node = { _yogaNode: { setJustifyContent: mock } };
beforeEach(() => ... | expect(mock.mock.calls[0][0]).toBe(Yoga.JUSTIFY_FLEX_START);
expect(result).toBe(node);
}); |
<|file_name|>SolarSystemUninhabited.java<|end_file_name|><|fim▁begin|>package calc.lib;
/** Class (POJO) used to store Uninhabited Solar System JSON objects
*
* @author Carlin Robertson
* @version 1.0
*
*/
public class SolarSystemUninhabited {
private String[] information;
private String requirePermit;
... | }
public String getName () |
<|file_name|>test_vmware_methods.py<|end_file_name|><|fim▁begin|>"""This module contains tests that exercise the canned VMware Automate stuff."""
from textwrap import dedent
import fauxfactory
import pytest
from widgetastic.widget import View
from widgetastic_patternfly import Dropdown
from cfme import test_requireme... | pytest.mark.tier(3), |
<|file_name|>binary_search_test.cpp<|end_file_name|><|fim▁begin|>#include <gtest/gtest.h>
#include "loquat/misc/binary_search.hpp"
TEST(BinarySearchTest, Integer){
for(int l = -16; l <= 16; ++l){
for(int r = l; r <= 16; ++r){
for(int expect = l; expect <= r; ++expect){
const auto actual = loquat::binary_sear... | |
<|file_name|>upgma.cpp<|end_file_name|><|fim▁begin|>#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <getopt.h>
#include "upgma.h"
#include "utils.h"
#include "seq_utils.h"
#include "sequence.h"
#include "seq_reader.h"
#include "node.h"
#include "tree.h"
#include "tree_utils.h"
U... | |
<|file_name|>index.js<|end_file_name|><|fim▁begin|><|fim▁hole|><|fim▁end|> | export default from './CallToAction.jsx'; |
<|file_name|>simple.py<|end_file_name|><|fim▁begin|><|fim▁hole|>
def get(self):
return self.field
a = Foo()
a.set("hello world")
z = a.get()
print z
z
a<|fim▁end|> | class Foo(object):
def set(self, value):
self.field = value |
<|file_name|>schema.py<|end_file_name|><|fim▁begin|># ----------------------------------------------------------------------------
# Copyright (c) 2011-2015, The American Gut Development Team.
#
# Distributed under the terms of the Modified BSD License.
#
# The full license is in the file COPYING.txt, distributed with ... | Assumes we have connectivity. |
<|file_name|>reification_macros.rs<|end_file_name|><|fim▁begin|>#![macro_use]
// This isn't as bad as it looks.
// I mean, it's pretty bad, don't get me wrong...
//
// The purpose is to generate `Reifiable` `impl`s
// for any `enum` or `struct`.
//
// Basically, `reify` pattern-matches to destructure the actual Rust ... | $ctor($($accum),*)
}; |
<|file_name|>cart66-library.js<|end_file_name|><|fim▁begin|>var ajaxManager = (function() {
$jq = jQuery.noConflict();
var requests = [];
return {
addReq: function(opt) {
requests.push(opt);
},
removeReq: function(opt) {
if($jq.inArray(opt, requests) > -1) {
requests.splice($jq.... | cleanProductId = cleanProductId[0];
var data = {
cart66ItemId: cleanProductId,
itemName: productName, |
<|file_name|>BenchmarkDescriptorDistance.java<|end_file_name|><|fim▁begin|>/*
* Copyright (c) 2021, Peter Abeles. All Rights Reserved.
*
* This file is part of BoofCV (http://boofcv.org).
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the ... | |
<|file_name|>conf.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
#
# django-notes documentation build configuration file, created by
# sphinx-quickstart on Wed May 13 10:34:42 2009.
#
# This file is execfile()d with the current directory set to its containing dir.
#
# Note that not all possible configuration v... | # base URL from which the finished HTML is served. |
<|file_name|>init.ts<|end_file_name|><|fim▁begin|>/// <reference path="application.ts" />
/// <reference path="pages/IndexPageController.ts" />
/// <reference path="pages/DetailsPageController.ts" />
module ft{
declare var Framework7: any;
interface Framework7View{
}
interface Framework7App{
addVi... | |
<|file_name|>split-select.component.ts<|end_file_name|><|fim▁begin|>import { Component } from '@angular/core';
import { FormControl } from '@angular/forms';<|fim▁hole|> selector: 'lu-split-select',
templateUrl: './split-select.component.html'
})
export class SplitSelectComponent {
item = { id: 1, name: 'initial value... |
@Component({ |
<|file_name|>NUG_unstructured_ICON_triangles_PyNGL.py<|end_file_name|><|fim▁begin|>"""
NCL User Guide Python Example: PyNGL_unstructured_ICON_triangles.py
Grid type: unstructured
Model: ICON
Info: - colored triangles
- add labelbar (colorbar)
- wkColorMap
18.02.1... | varMin, varMax, varInt = -32, 28, 4 #-- set data minimum, maximum, interval |
<|file_name|>category_links.py<|end_file_name|><|fim▁begin|><|fim▁hole|># This file is part of Shuup.
#
# Copyright (c) 2012-2016, Shoop Ltd. All rights reserved.
#
# This source code is licensed under the AGPLv3 license found in the
# LICENSE file in the root directory of this source tree.
from django import forms
fro... | # -*- coding: utf-8 -*- |
<|file_name|>viewermaterial.cpp<|end_file_name|><|fim▁begin|>/**************************************************************************
This file is part of JahshakaVR, VR Authoring Toolkit
http://www.jahshaka.com
Copyright (c) 2016 GPLv3 Jahshaka LLC <coders@jahshaka.com>
This is free software: you may copy, redist... | else
this->removeTexture("tex");
} |
<|file_name|>OUNITAI.cpp<|end_file_name|><|fim▁begin|>/*
* Seven Kingdoms: Ancient Adversaries
*
* Copyright 1997,1998 Enlight Software Ltd.
*
* 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 Foundati... |
//--------- Begin of function Unit::ai_handle_seek_path_fail --------//
// |
<|file_name|>tasks.py<|end_file_name|><|fim▁begin|># -*- coding: utf8 -*-
from __future__ import absolute_import
import os
import logging
from celery import task, current_task
from django.conf import settings
from .models import Video
from .quvi import Quvi
from .utils import download_thumbnail, celery_download, enc... | |
<|file_name|>Messages.java<|end_file_name|><|fim▁begin|>/**
* Aptana Studio
* Copyright (c) 2005-2011 by Appcelerator, Inc. All Rights Reserved.
* Licensed under the terms of the GNU Public License (GPL) v3 (with exceptions).
* Please see the license.html included with this distribution for details.
* Any modifica... | package com.aptana.core.internal.resources;
import org.eclipse.osgi.util.NLS; |
<|file_name|>index.js<|end_file_name|><|fim▁begin|>/**
* React components for kanna projects.
* @module kanna-lib-components
*/
"use strict";
module.exports = {
/**
* @name KnAccordionArrow
*/
get KnAccordionArrow() { return require('./kn_accordion_arrow'); },
/**
* @name KnAccordionBody... | get KnTabItem() { return require('./kn_tab_item'); },
/**
* @name KnTab |
<|file_name|>instr_aesdeclast.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::*;
use ::test::run_test;
<|fim▁hole|>
#[test]
fn aesdeclast_2() {
... | #[test]
fn aesdeclast_1() {
run_test(&Instruction { mnemonic: Mnemonic::AESDECLAST, operand1: Some(Direct(XMM1)), operand2: Some(Direct(XMM2)), operand3: None, operand4: None, lock: false, rounding_mode: None, merge_mode: None, sae: false, mask: None, broadcast: None }, &[102, 15, 56, 223, 202], OperandSize::Dword)... |
<|file_name|>main.rs<|end_file_name|><|fim▁begin|>use std::env;
use std::io::Read;
use std::net::*;
use std::sync::atomic::*;
use std::thread;
use std::time::Duration;
static AMT: AtomicUsize = ATOMIC_USIZE_INIT;
fn main() {
thread::spawn(|| {
loop {
thread::sleep(Duration::new(1, 0));
... |
let addr = env::args().nth(1).unwrap_or("127.0.0.1:12345".to_string()); |
<|file_name|>strategies.py<|end_file_name|><|fim▁begin|>"""
Implementation of various trading strategies.
"""
from cointrol.core.models import (
Order, TradingSession,
RelativeStrategyProfile, FixedStrategyProfile
)
class TradeAction:
BUY, SELL = Order.BUY, Order.SELL
def __init__(self, action, pri... | profile = None
""":type: FixedStrategyProfile"""
def get_buy_price(self): |
<|file_name|>test_tensor_functions.py<|end_file_name|><|fim▁begin|>from sympy import symbols, Dij, LeviCivita
x, y = symbols('x,y')
def test_Dij():<|fim▁hole|>
def test_levicivita():
assert LeviCivita(1, 2, 3) == 1
assert LeviCivita(1, 3, 2) == -1
assert LeviCivita(1, 2, 2) == 0
i,j,k = symbols('i j k... | assert Dij(1, 1) == 1
assert Dij(1, 2) == 0
assert Dij(x, x) == 1
assert Dij(x**2-y**2, x**2-y**2) == 1 |
<|file_name|>karma.conf.js<|end_file_name|><|fim▁begin|>// Karma configuration
// http://karma-runner.github.io/0.10/config/configuration-file.html
module.exports = function(config) {
config.set({
// base path, that will be used to resolve files and exclude
basePath: '',
// testing framework to use (jas... | files: [
'app/bower_components/angular/angular.js',
'app/bower_components/angular-mocks/angular-mocks.js', |
<|file_name|>WorkerRuntimeAgent.cpp<|end_file_name|><|fim▁begin|>/*
* Copyright (C) 2011 Google Inc. 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 of source code... | } // namespace WebCore
#endif // ENABLE(INSPECTOR) && ENABLE(WORKERS) |
<|file_name|>ColumnListItem.js<|end_file_name|><|fim▁begin|>/*!
* ${copyright}
*/
// Provides control sap.m.ColumnListItem.
sap.ui.define([
"sap/ui/core/Element",
"sap/ui/core/library",
"./library",
"./ListItemBase",
"./ColumnListItemRenderer",
"sap/ui/thirdparty/jquery",
// jQuery custom selectors ":sapFocus... | |
<|file_name|>test_str.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
"""
Tests for the backported class:`str` class.
"""
from __future__ import absolute_import, unicode_literals, print_function
from future.builtins import *
from future import utils
from future.tests.base import unittest, expectedFailurePY2
i... | if utils.PY2:
self.assertFalse(s.endswith(b'D')) |
<|file_name|>ViolationBuilder.java<|end_file_name|><|fim▁begin|>package ft.sim.monitoring;
import static ft.sim.monitoring.ViolationSeverity.*;
import static ft.sim.monitoring.ViolationType.*;
import ft.sim.world.train.Train;
import ft.sim.world.connectables.Connectable;
import ft.sim.world.connectables.Section;
impo... | .format("Station %s is over capacity (%s out of %s)", |
<|file_name|>AbstractResourceRootConfigItem.java<|end_file_name|><|fim▁begin|>package io.cattle.platform.configitem.server.model.impl;
import java.io.IOException;
import io.cattle.platform.configitem.server.model.RefreshableConfigItem;
import io.cattle.platform.configitem.server.resource.ResourceRoot;
import io.cattl... | return resourceRoot.getSourceRevision();
}
@Override |
<|file_name|>memorystore_test.go<|end_file_name|><|fim▁begin|>package storage
<|fim▁hole|>import (
"crypto/sha256"
"testing"
"github.com/stretchr/testify/require"
"github.com/theupdateframework/notary/tuf/data"
"github.com/theupdateframework/notary/tuf/utils"
)
func TestMemoryStoreMetadataOperations(t *testing.T... | |
<|file_name|>doxytag.cpp<|end_file_name|><|fim▁begin|>#line 3 "<stdout>"
#define YY_INT_ALIGNED short int
/* A lexical scanner generated by flex */
#define yy_create_buffer tagYY_create_buffer
#define yy_delete_buffer tagYY_delete_buffer
#define yy_flex_debug tagYY_flex_debug
#define yy_init_buffer tagYY_init_buffe... | */
void tagYYpop_buffer_state (void)
{
if (!YY_CURRENT_BUFFER) |
<|file_name|>scan.rs<|end_file_name|><|fim▁begin|>use std::fs;
use std::io;
use std::os::unix::fs::PermissionsExt;
use std::path::PathBuf;
pub struct Scandir {
pub path: PathBuf,
pub interval: u64,
}
<|fim▁hole|>impl Scandir {
pub fn new(dir: &str, seconds: u64) -> Result<Scandir, io::Error> {
let ... | |
<|file_name|>Solution.py<|end_file_name|><|fim▁begin|>class Solution:
"""
@param s: The first string
@param b: The second string
@return true or false
"""
# Time: is equal to sorted O(nlogn)
# Space: O(1)<|fim▁hole|> s = sorted(s)
t = sorted(t)
return s == t<|fim▁end|... |
def anagram(self, s, t):
# write your code here |
<|file_name|>iip_erase_dot_noise_uchar.cpp<|end_file_name|><|fim▁begin|>#include "pri.h"
#include "calcu_erase_dot_noise.h"
#include "iip_erase_dot_noise.h"
void iip_erase_dot_noise::_exec_uchar( long l_width, long l_height, long l_area_xpos, long l_area_ypos, long l_area_xsize, long l_area_ysize, long l_channels, uns... | unsigned char *ucharp_out_x1,*ucharp_out_x2;
unsigned char *ucharp_tmp;
|
<|file_name|>callback.rs<|end_file_name|><|fim▁begin|>// Copyright (c) 2016 Yusuke Sasaki
//
// This software is released under the MIT License.
// See http://opensource.org/licenses/mit-license.php or <LICENSE>.
extern crate gurobi;
use gurobi::*;
use std::io::{BufWriter, Write};
use std::fs::OpenOptions;
fn main() ... | // Periodic polling callback |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.