prompt
large_stringlengths
70
991k
completion
large_stringlengths
0
1.02k
<|file_name|>text.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/. */ //! Text layout. use layout::box::{RenderBox, RenderBoxBase, Te...
}
<|file_name|>generator.py<|end_file_name|><|fim▁begin|>def is_tl(data): return isinstance(data, tuple) or isinstance(data, list) def get_depth(data): ''' :type data: list or tuple get the depth of nested list 'x' is 0 ['x', 'y'] is 1<|fim▁hole|> if is_tl(data): de...
['x', ['y', 'z'] is 2 '''
<|file_name|>cuke.rs<|end_file_name|><|fim▁begin|>extern crate calculator; #[macro_use] extern crate cucumber; mod step_definitions; mod support; use step_definitions::{calculator_steps, display_steps};<|fim▁hole|> cucumber::create_config(CalculatorWorld::new()) .registrar_fn(&calculator_steps::register_steps) ...
use support::env::CalculatorWorld; #[test] fn main() {
<|file_name|>express-ntlm-tests.ts<|end_file_name|><|fim▁begin|>import express = require('express'); import ntlm = require('express-ntlm');<|fim▁hole|>app.use(ntlm({ debug() { const args = Array.prototype.slice.apply(arguments); console.log.apply(null, args); }, domain: 'MYDOMAIN', domai...
const app = express();
<|file_name|>cli.rs<|end_file_name|><|fim▁begin|>use clap::{crate_version, App, AppSettings, Arg}; <|fim▁hole|> .version(crate_version!()) .author("Stuart Moss <samoss@gmail.com>") .setting(AppSettings::ArgRequiredElseHelp) .arg( Arg::with_name("mp4") .long("mp...
pub fn build_cli() -> App<'static, 'static> { App::new("chromecastise")
<|file_name|>form-fileupload.js<|end_file_name|><|fim▁begin|>var FormFileUpload = function () { return { //main function to initiate the module init: function () { // Initialize the jQuery File Upload widget: $('#fileupload').fileupload({ disableI...
}).fail(function () { $('<div class="alert alert-danger"/>')
<|file_name|>serial_link.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python # Copyright (C) 2011-2014 Swift Navigation Inc. # Contact: Fergus Noble <fergus@swift-nav.com> # # This source is subject to the license found in the file 'LICENSE' which must # be be distributed together with this source. All other rights r...
<|file_name|>test_Endianess.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- #+---------------------------------------------------------------------------+ #| 01001110 01100101 01110100 01111010 01101111 01100010 | #| ...
#| This program is free software: you can redistribute it and/or modify |
<|file_name|>admin.py<|end_file_name|><|fim▁begin|>from __future__ import print_function from __future__ import unicode_literals from django.contrib import admin from .models import Conference from .models import Paper from .models import Author from .models import Attachment from .actions import paper_actions cla...
actions = paper_actions def pauthors(self, obj):
<|file_name|>base.py<|end_file_name|><|fim▁begin|>import pyactiveresource.connection from pyactiveresource.activeresource import ActiveResource, ResourceMeta, formats import shopify.yamlobjects import shopify.mixins as mixins import shopify import threading import sys from six.moves import urllib import six from shopi...
def get_headers(cls): if not hasattr(cls._threadlocal, "headers"): cls._threadlocal.headers = ShopifyResource._headers.copy()
<|file_name|>parse.go<|end_file_name|><|fim▁begin|>// Package json is a JSON parser following the specifications at http://json.org/. package json // import "github.com/tdewolff/parse/json" import ( "io" "strconv" "github.com/tdewolff/parse" "github.com/tdewolff/parse/buffer" ) // GrammarType determines the type...
// GrammarType values. const ( ErrorGrammar GrammarType = iota // extra grammar when errors occur WhitespaceGrammar
<|file_name|>L0.ts<|end_file_name|><|fim▁begin|>import fs = require('fs'); import assert = require('assert'); import path = require('path'); <|fim▁hole|>describe('AzureIoTEdgeV2 Suite', function () { before(() => { }); after(() => { }); it('Does a basic hello world test', function(done: MochaDone)...
<|file_name|>LBiObjLongPredicate.java<|end_file_name|><|fim▁begin|>/* * This file is part of "lunisolar-magma". * * (C) Copyright 2014-2022 Lunisolar (http://lunisolar.eu/). * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * Yo...
/** Returns description of the functional interface. */ @Nonnull default String functionalInterfaceDescription() { return LBiObjLongPredicate.DESCRIPTION;
<|file_name|>TempDirectory.cpp<|end_file_name|><|fim▁begin|>/* -*- c-basic-offset: 4 indent-tabs-mode: nil -*- vi:set ts=8 sts=4 sw=4: */ /* Sonic Visualiser An audio file viewer and annotation editor. Centre for Digital Music, Queen Mary, University of London. This file copyright 2006 Chris Cannam. ...
cerr << "WARNING: TempDirectory::cleanup: "
<|file_name|>cmdargs.py<|end_file_name|><|fim▁begin|><|fim▁hole|>import collections CmdArgs = collections.namedtuple('CmdArgs', ['split_channels', 'merge', 'image', 'prefix', 'list', 'layer'])<|fim▁end|>
<|file_name|>squareplot.py<|end_file_name|><|fim▁begin|># Simple plotter for Gut books. # All this does is draw a sqare for every stat in the input<|fim▁hole|># # Another fine example of how Viz lies to you. You will # need to fudge the range by adjusting the clipping. import numpy as np import matplotlib.pyplot as ...
# and color it based on the score.
<|file_name|>bibedit_templates.py<|end_file_name|><|fim▁begin|>## This file is part of Invenio. ## Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2013 CERN. ## ## Invenio is free software; you can redistribute it and/or ## modify it under the terms of the GNU General Public License as ## published by the Free ...
' <tr>\n' \ ' <td id="tickets" colspan="4"><!--filled by bibedit_menu.js--></td>\n' \ ' </tr>\n' \
<|file_name|>sq-sortable-list.js<|end_file_name|><|fim▁begin|>import SqSortableList from 'sq-ember-inputs/components/sq-sortable-list'; <|fim▁hole|><|fim▁end|>
export default SqSortableList;
<|file_name|>demandmodel.cpp<|end_file_name|><|fim▁begin|>/* EPANET 3 * * Copyright (c) 2016 Open Water Analytics * Distributed under the MIT License (see the LICENSE file for details). * */ #include "demandmodel.h" #include "Elements/junction.h" #include <cmath> #include <algorithm> using namespace std; //----...
{
<|file_name|>search.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python<|fim▁hole|># Peteris Krumins (peter@catonmat.net) # http://www.catonmat.net -- good coders code, great reuse # # http://www.catonmat.net/blog/python-library-for-google-search/ # # Code is licensed under MIT license. # import re import urllib from ...
#
<|file_name|>popup.js<|end_file_name|><|fim▁begin|>// Table row template with placeholders var ordersRowTemplate = '<tr><td><img class="order-status-icon" title="order_status_title" src="order_status_icon"></td><td><p class="order-number">Narudžba <strong>#order_number</strong> by</p><p class="first-last-name">order_n...
.replaceAll("order_date", result.allOrders[i].date_created.slice(0, 10) + "<br>" + result.allOrders[i].date_created.slice(11, 19)) .replaceAll("order_total", result.allOrders[i].total + " " + result.allOrders[i].currency)
<|file_name|>datalake_samples_access_control_recursive_async.py<|end_file_name|><|fim▁begin|># coding: utf-8 # ------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for ...
# clean up the demo filesystem await filesystem_client.delete_file_system()
<|file_name|>caffe_tool.py<|end_file_name|><|fim▁begin|># Copyright 2017 The UAI-SDK Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.or...
cmd_args = vars(parser.parse_args()) if cmd_args['commands'] == 'pack':
<|file_name|>qmisc_test.py<|end_file_name|><|fim▁begin|>#! /usr/bin/python # -*- coding: utf-8 -*- # import funkcí z jiného adresáře import os.path path_to_script = os.path.dirname(os.path.abspath(__file__)) # sys.path.append(os.path.join(path_to_script, "../extern/pyseg_base/src/")) import unittest import numpy as...
from imtools import qmisc from imtools import misc
<|file_name|>global.js<|end_file_name|><|fim▁begin|>// This file contains javascript that is global to the entire Garden application // Global vanilla library function. (function(window, $) { var Vanilla = function() { }; Vanilla.fn = Vanilla.prototype; if (!window.console) window.console =...
// Add a spinner onclick of buttons with this class $(document).delegate('input.SpinOnClick', 'click', function() {
<|file_name|>singledispatch.py<|end_file_name|><|fim▁begin|>import sys<|fim▁hole|>else: from functools import singledispatch, update_wrapper def singledispatchmethod(func): dispatcher = singledispatch(func) def wrapper(*args, **kw): return dispatcher.dispatch(args[1].__class__)(*ar...
if sys.version_info >= (3, 8): from functools import singledispatchmethod
<|file_name|>trim.ts<|end_file_name|><|fim▁begin|>/// <reference path="./interface.ts" /> /// <reference path="../canvas.ts" /> /// <reference path="../../../controller/controller.ts" /> module Prisc { export class TrimTool implements Tool { private start: ICoordinates; private end: ICoordinates; ...
y: ev.offsetY };
<|file_name|>DelegateCalendarAccountUserDetailsImpl.java<|end_file_name|><|fim▁begin|>/** * Licensed to Jasig under one or more contributor license * agreements. See the NOTICE file distributed with this work * for additional information regarding copyright ownership. * Jasig licenses this file to you under the...
* {@link CalendarAccountUserDetails} implementation for {@link IDelegateCalendarAccount}s.
<|file_name|>test_avg.py<|end_file_name|><|fim▁begin|>from .test_antivirus import AbstractTests import modules.antivirus.avg.avg as module import modules.antivirus.base as base from mock import patch from pathlib import Path class TestAvg(AbstractTests.TestAntivirus): name = "AVG AntiVirus Free (Linux)" scan_...
wrong_stdout = "Virus database version : 4793/15678"
<|file_name|>index.js<|end_file_name|><|fim▁begin|><|fim▁hole|><|fim▁end|>
console.log('Hello World!');
<|file_name|>keyboard.rs<|end_file_name|><|fim▁begin|>use std::collections::{HashMap, VecDeque}; use std::time::Duration; use libusb::{Result as UsbResult, Error as UsbError}; use nix::sys::signal::{SigAction, sigaction, SaFlags, SigSet, SigHandler, SIGINT, SIGTERM};<|fim▁hole|>use nix::Result as NixResult; use handle:...
<|file_name|>system_identification.py<|end_file_name|><|fim▁begin|>from grslra import testdata from grslra.grslra_batch import grslra_batch, slra_by_factorization from grslra.structures import Hankel from grslra.scaling import Scaling import numpy as np import time # The goal of this experiment is to identify an LTI s...
if PROFILE: profile = cProfile.Profile() profile.enable()
<|file_name|>SectionTitle.tsx<|end_file_name|><|fim▁begin|>import { ReactElement } from "react"; import Heading from "components/Heading"; import styles from "./PackageSassDoc.module.scss"; export interface SectionTitleProps { packageName: string; type: "Variables" | "Functions" | "Mixins"; } export default fun...
return (
<|file_name|>omnicoinamountfield.cpp<|end_file_name|><|fim▁begin|>// Copyright (c) 2011-2014 The Bitcoin Core developers // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. #include "omnicoinamountfield.h" #include "omnicoinunits.h...
*/ class AmountSpinBox: public QAbstractSpinBox {
<|file_name|>servicecontrol_v1_generated_service_controller_check_async.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 th...
# Generated code. DO NOT EDIT! # # Snippet for Check # NOTE: This snippet has been automatically generated for illustrative purposes only.
<|file_name|>0016_negative_votes.py<|end_file_name|><|fim▁begin|># Generated by Django 2.2.15 on 2020-11-24 06:44 from decimal import Decimal import django.core.validators from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ("assignments", "0015_assignmentvo...
("N", "No per candidate"), ("YN", "Yes/No per candidate"), ("YNA", "Yes/No/Abstain per candidate"),
<|file_name|>livecd.py<|end_file_name|><|fim▁begin|># # livecd.py: An anaconda backend to do an install from a live CD image # # The basic idea is that with a live CD, we already have an install # and should be able to just copy those bits over to the disk. So we dd # the image, move things to the "right" filesystem a...
dstname = os.path.join(dst, name) try:
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|>default_app_config = 'leonardo.apps.LeonardoConfig' __import__('pkg_resources').declare_namespace(__name__) try: from leonardo.base import leonardo # noqa except ImportError: import warnings def simple_warn(message, category, filename, lineno, file=...
return '%s: %s' % (category.__name__, message) msg = ("Could not import Leonardo dependencies. "
<|file_name|>documents.py<|end_file_name|><|fim▁begin|>from docar import Document, Collection from docar import fields from docar.backends.http import HttpBackendManager from libthirty.state import uri, app_uri, service_uri, resource_collection_uri from libthirty.validators import naming, max_25_chars, naming_with_das...
<|file_name|>args.rs<|end_file_name|><|fim▁begin|><|fim▁hole|> Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the foll...
/* Copyright (c) 2020, R. Ou <rqou@robertou.com> and contributors All rights reserved.
<|file_name|>preAnalysisRun.py<|end_file_name|><|fim▁begin|>import os import sys from src import impl as rlcs import utils as ut import analysis as anls import matplotlib.pyplot as plt import logging import pickle as pkl import time config = ut.loadConfig('config') sylbSimFolder=config['sylbSimFolder'] transFolder=co...
res = anls.getPatternsInTransInGTPos(masterData, queryList)
<|file_name|>MC_12_11104124_MagUp.py<|end_file_name|><|fim▁begin|>#-- GAUDI jobOptions generated on Fri Jul 17 16:39:48 2015 #-- Contains event types : #-- 11104124 - 106 files - 1087377 events - 233.68 GBytes #-- Extra information about the data processing phases: #-- Processing Pass Step-124620 #-- StepId...
'LFN:/lhcb/MC/2012/ALLSTREAMS.DST/00043567/0000/00043567_00000137_1.allstreams.dst', 'LFN:/lhcb/MC/2012/ALLSTREAMS.DST/00043567/0000/00043567_00000138_1.allstreams.dst',
<|file_name|>condition_evaluator.ts<|end_file_name|><|fim▁begin|>/** * @license * Copyright Google Inc. All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license */ import {IMinimatch, Minimatch} from 'minimatch'; /...
const conditionContext = {
<|file_name|>dialogflow_v3beta1_generated_experiments_delete_experiment_sync.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 ...
# # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS,
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|><|fim▁hole|>from .workout import Workout from .duration import Time from .duration import Distance<|fim▁end|>
<|file_name|>test_core.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python # -*- coding: utf-8 -*- """ type 'pytest -v' to run u test series """ import codecs import json import os import pytest import tempfile import sys sys.path.insert(1, os.path.join(sys.path[0], '..')) import core class TestHelpers: @stat...
foo=dict(foo1='Fee', foo2='Fie'), bar=dict(bar1='Foe', bar2='Foo'), )
<|file_name|>dom_document_type.rs<|end_file_name|><|fim▁begin|>// This file was generated by gir (https://github.com/gtk-rs/gir) // from gir-files (https://github.com/gtk-rs/gir-files.git) // DO NOT EDIT use crate::DOMEventTarget; use crate::DOMNamedNodeMap; use crate::DOMNode; use crate::DOMObject; use glib::object::...
<|file_name|>test_helpers.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- from celeryone.helpers import queue_one_key, kwargs_to_list, force_string import pytest import six def test_force_string_1(): assert force_string('a') == 'a' def test_force_string_2(): assert force_string(u'a') == 'a' def t...
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|># Copyright (C) 2017,2019 Rodrigo Jose Hernandez Cordoba # # 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/licens...
<|file_name|>core-getapp.py<|end_file_name|><|fim▁begin|># core-getapp.py from wax import * class MainFrame(Frame): def Body(self):<|fim▁hole|> app = core.GetApp() print app assert isinstance(app, Application) app = Application(MainFrame, title="core-getapp") app.Run()<|fim▁end|>
<|file_name|>parser_tests.rs<|end_file_name|><|fim▁begin|>#[cfg(test)] mod tests { use model::{Model, TemplateParameter}; use std::fs::File; use std::io::Write; use clang::{Clang, Index}; use tempdir::TempDir; use serde_json; use std::fmt::Debug; use response_file::ExtendWithResponseF...
<|file_name|>chart.js<|end_file_name|><|fim▁begin|>'use strict'; /* Controllers */ app // Flot Chart controller .controller('FlotChartDemoCtrl', ['$scope', function($scope) { $scope.d = [ [1,6.5],[2,6.5],[3,7],[4,8],[5,7.5],[6,7],[7,6.8],[8,7],[9,7.2],[10,7],[11,6.8],[12,7] ]; $scope.d0_1 = [ [0,7],[1,6...
<|file_name|>ColorRGBProperty.cpp<|end_file_name|><|fim▁begin|>/* * ColorRGB property file * * This file is part of the "ForkENGINE" (Copyright (c) 2014 by Lukas Hermanns) * See "LICENSE.txt" for license information. */ #include "Engine/Component/Component.h" #include "IO/FileSystem/File.h" namespace Fork { n...
} void Component::ColorRGBProperty::ReadFromVariant(const IO::Variant& variant) {
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|>import os <|fim▁hole|> return theme_dir<|fim▁end|>
def get_html_theme_path(): theme_dir = os.path.abspath(os.path.dirname(os.path.dirname(__file__)))
<|file_name|>admin.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- from __future__ import absolute_import, unicode_literals from django import forms from django.contrib import admin from django.contrib.auth.admin import UserAdmin as AuthUserAdmin from django.contrib.auth.forms import UserChangeForm, UserCreati...
<|file_name|>bookmark.js<|end_file_name|><|fim▁begin|>module.exports = [<|fim▁hole|>].join(' ');<|fim▁end|>
'M6 2 L26 2 L26 30', 'L16 24 L6 30 Z'
<|file_name|>mentions.component.spec.ts<|end_file_name|><|fim▁begin|>import { async, ComponentFixture, TestBed } from '@angular/core/testing'; import { MentionsComponent } from './mentions.component'; describe('MentionsComponent', () => {<|fim▁hole|> let fixture: ComponentFixture<MentionsComponent>; beforeEach(as...
let component: MentionsComponent;
<|file_name|>hangman.py<|end_file_name|><|fim▁begin|># This is a hangman game. # Your game must do the following things. # Everytime a user guesses a character, it should tell them if their character # is in the secret word or not. # # Also, it should print the guessed character in the following format # if the secret ...
<|file_name|>coord_transform.py<|end_file_name|><|fim▁begin|>""" S.Tomin and I.Zagorodnov, 2017, DESY/XFEL """ from ocelot.common.globals import * import logging logger = logging.getLogger(__name__) try: import numexpr as ne ne_flag = True except: logger.debug("coord_transform.py: module NUMEXPR is not in...
# to mad format N = xp.shape[1]
<|file_name|>__openerp__.py<|end_file_name|><|fim▁begin|># -*- encoding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # # Copyright (C) 2015 Didotech srl (<http://www.didotech.com>). # # All Rights Reser...
<|file_name|>definitions.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- # # This file is part of INSPIRE. # Copyright (C) 2014, 2015 CERN. # # INSPIRE 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, e...
<|file_name|>formats-data.js<|end_file_name|><|fim▁begin|>'use strict'; exports.BattleFormatsData = { bulbasaur: { randomBattleMoves: ["sleeppowder", "gigadrain", "hiddenpowerfire", "hiddenpowerice", "sludgebomb", "powerwhip", "leechseed", "synthesis"], randomDoubleBattleMoves: ["sleeppowder", "gigadrain", "hidde...
<|file_name|>FixWrongMasterEpochDirectoryTest.java<|end_file_name|><|fim▁begin|>/* * Copyright (c) 2013 Michael Berlin, Zuse Institute Berlin * * Licensed under the BSD License, see LICENSE file for details. * */ package org.xtreemfs.test.osd.rwre; import static org.junit.Assert.assertEquals; import static org.ju...
import org.junit.After;
<|file_name|>[id].ts<|end_file_name|><|fim▁begin|>import fs from "fs"; import path from "path"; import * as showdown from "showdown"; import { POSTS_DIR, getPosts } from "."; const converter: showdown.Converter = new showdown.Converter(); export const getFullPost = async (posts: any[], slug: string): Promise<any> => {...
try { const articlePath: string = path.resolve(
<|file_name|>get_template.go<|end_file_name|><|fim▁begin|>// Copyright 2012-2015 Oliver Eilhard. All rights reserved. // Use of this source code is governed by a MIT-license. // See http://olivere.mit-license.org/license.txt for details. package elastic import ( "encoding/json" "fmt" "net/url" "github.com/devact...
// NewGetTemplateService creates a new GetTemplateService. func NewGetTemplateService(client *Client) *GetTemplateService { return &GetTemplateService{
<|file_name|>bitcoin_ky.ts<|end_file_name|><|fim▁begin|><?xml version="1.0" ?><!DOCTYPE TS><TS language="ky" version="2.1"> <context> <name>AboutDialog</name> <message> <location filename="../forms/aboutdialog.ui" line="+14"/> <source>About VPSCoin</source> <translation type="unfinished"...
<source>Sign a message to prove you own a VPSCoin address</source> <translation type="unfinished"/> </message> <message>
<|file_name|>run.rs<|end_file_name|><|fim▁begin|>// Copyright 2017, 2019 Guanhao Yin <sopium@mysterious.site> // This file is part of TiTun. // TiTun 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 ...
scope0.spawn_canceller(wg.clone().task_update_cookie_secret()); #[cfg(not(windows))] scope0.spawn_canceller(wg.clone().task_update_mtu());
<|file_name|>summary_key_matcher.py<|end_file_name|><|fim▁begin|>from ert.cwrap import CWrapper, BaseCClass from ert.enkf import ENKF_LIB from ert.util import StringList class SummaryKeyMatcher(BaseCClass): def __init__(self): c_ptr = SummaryKeyMatcher.cNamespace().alloc() super(SummaryKeyMatche...
def addSummaryKey(self, key): assert isinstance(key, str)
<|file_name|>TreeTabDemo.js<|end_file_name|><|fim▁begin|>/** * @author fanguozhu */ $(function() { var tab = new TabPanel("tab",true); var f_tree = new Fieldset("f_tree","公司列表",{ state: Fieldset.OPEN_STATE, topdown: false }); var mytree = new PorTreeT("tree", "-1", "手机公司",{isDefaultClick:0} ); ...
var name = msg.data.name; for (var i=1;i<=3;i++) { if (label) {
<|file_name|>SolveTSPSimulatedAnnealing.py<|end_file_name|><|fim▁begin|>#============================================================================== #description : Solves travelling salesman problem by using Hill Climbing. #author : Yakup Cengiz #date : 20151121 #version : 0.1 #notes ...
return 1.0 else: return math.exp( -abs(next_score-prev_score)/temperature )
<|file_name|>models.py<|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/. <|fim▁hole|> name = models.CharField(max_length=100, db_index=Tru...
from django.db import models class ConfigValue(models.Model):
<|file_name|>my.js<|end_file_name|><|fim▁begin|>var yt = yt || {}; //加载图片 yt.loadImg = function ($imgs, time) { var _time = 0; time = time || 200; $imgs.each(function () { var $that = $(this); if ($that.data('hasload')) { return false; } setTimeout(function () ...
});
<|file_name|>zwave.py<|end_file_name|><|fim▁begin|>"""Mock helpers for Z-Wave component.""" from pydispatch import dispatcher from tests.async_mock import MagicMock def value_changed(value): """Fire a value changed.""" dispatcher.send( MockNetwork.SIGNAL_VALUE_CHANGED, value=value, no...
<|file_name|>loadbalancers.go<|end_file_name|><|fim▁begin|>package network // Copyright (c) Microsoft and contributors. 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...
} const APIVersion = "2017-09-01"
<|file_name|>length.js<|end_file_name|><|fim▁begin|>// Copyright (C) 2015 André Bargull. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. /*--- esid: sec-string.prototype.valueof description: > String.prototype.valueOf.length is 0. info: | String.prototype.valueOf ( ) ...
object has the attributes { [[Writable]]: false, [[Enumerable]]: false,
<|file_name|>models.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 <|fim▁hole|> name = models.CharField(max_length=255, unique=True) def __str__(self): return "%s" % self.name class Ke...
@python_2_unicode_compatible class TanitJobsCategory(models.Model):
<|file_name|>ABigSum.py<|end_file_name|><|fim▁begin|>#!/bin/python3 def aVeryBigSum(n, ar):<|fim▁hole|> n = int(input().strip()) ar = list(map(int, input().strip().split(' '))) result = aVeryBigSum(n, ar) print(result)<|fim▁end|>
return sum(ar)
<|file_name|>catalogExample.py<|end_file_name|><|fim▁begin|>from yos.rt import BaseTasklet from yos.ipc import Catalog class CatalogExample(BaseTasklet): def on_startup(self):<|fim▁hole|> if val == 'test2': print("Test passed") else: print("Test failed")<|fim▁end|>
Catalog.store('test1', 'test2', catname='test3') Catalog.get('test1', self.on_read, catname='test3') def on_read(self, val):
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|># -*- coding: utf8 -*- from .player import PlayerEntity from .base import MobEntity from .item import ItemEntity __all__ = [ 'PlayerEntity',<|fim▁hole|> 'MobEntity', 'ItemEntity', ]<|fim▁end|>
<|file_name|>setup.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python # -*- coding: utf-8 -*- from glob import glob from io import open import os import re import sys try: from setuptools import setup except ImportError: from distutils.core import setup if sys.argv[-1] == 'publish': os.system('python ...
'Topic :: Utilities', 'Topic :: Terminals', ], keywords='shanbay, 扇贝网',
<|file_name|>replicator.py<|end_file_name|><|fim▁begin|># Copyright (c) 2010-2012 OpenStack 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 License at # # http://www.apache.org/licenses/LI...
self.cpool.waitall() # wipe out the cache do disable bypass in delete_db cleanups = self.reconciler_cleanups self.reconciler_cleanups = self.reconciler_containers = None
<|file_name|>views.py<|end_file_name|><|fim▁begin|># Eve W-Space # Copyright (C) 2013 Andrew Austin and other 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 Free Software Foundation, eithe...
<|file_name|>signals.py<|end_file_name|><|fim▁begin|>from django.dispatch import Signal pre_save = Signal(providing_args=['instance', 'action', ]) post_save = Signal(providing_args=['instance', 'action', ])<|fim▁hole|> pre_delete = Signal(providing_args=['instance', 'action', ]) post_delete = Signal(providing_args=['i...
<|file_name|>conical-dendrite-trees.js<|end_file_name|><|fim▁begin|>export default [ { radius: 6, sizeReduction: .85, branchProbability: 0.12, rotation: new THREE.Vector3(0, 1, 0), color: 'blue' },{ radius: 6, sizeReduction: .85, branchProbability: 0.21, rotation: new THREE.Vector3(0...
radius: 7, sizeReduction: .82, branchProbability: 0.27, rotation: new THREE.Vector3(0, 1, 0),
<|file_name|>_match.rs<|end_file_name|><|fim▁begin|>// Copyright 2012-2013 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/lic...
class_field.id, substitutions); check_pat(pcx, field.pat, field_type); found_fields.insert(index);
<|file_name|>file_scanning.py<|end_file_name|><|fim▁begin|>## simple file type detection. ## if i had unlimited api access, i would send every single md5 to something like VirusTotal forbidden_types = ['text/x-bash', 'text/scriptlet', 'application/x-opc+zip', 'application/com', 'application/x-msmetafile', 'application...
print "Filename: {} length: {} mime type: {}".format(i['filename'],i['total_bytes'],i['mime_type']) print "MD5: {} SHA1: {}".format(i['md5'],i['sha1'])
<|file_name|>reference_audio_renderer.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 "media/filters/reference_audio_renderer.h" #include <math.h> #include...
<|file_name|>IntellijModulesListParser.java<|end_file_name|><|fim▁begin|>/* * Copyright (c) Facebook, Inc. and its affiliates. * * 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 * * h...
} catch (SAXException e) { LOG.error("Cannot read modules.xml file", e); throw new HumanReadableException( "Could not update 'modules.xml' file because it is malformed", e);
<|file_name|>apps.py<|end_file_name|><|fim▁begin|>from django.apps import AppConfig <|fim▁hole|><|fim▁end|>
class BallerShotCallerConfig(AppConfig): name = 'baller_shot_caller'
<|file_name|>stordb_it_test.go<|end_file_name|><|fim▁begin|>//go:build integration // +build integration /* Real-time Online/Offline Charging System (OCS) for Telecom & ISP environments Copyright (C) ITsysCOM GmbH This program is free software: you can redistribute it and/or modify it under the terms of the GNU Gener...
<|file_name|>state-machine.js<|end_file_name|><|fim▁begin|>import Ember from 'ember'; import StatefulMixin from './mixins/stateful';<|fim▁hole|><|fim▁end|>
export default Ember.Object.extend(StatefulMixin);
<|file_name|>observable.ts<|end_file_name|><|fim▁begin|>import "core-js/es6/promise"; import "core-js/es6/array" import "core-js/es6/set" import {IObservable} from "./interfaces/observable"; import {IObservableEvent} from "./interfaces/observable-event"; import {IObserver, ObserverCallback} from "./interfaces/observer...
this.observers.splice(index, 1); return true;
<|file_name|>keepass.cpp<|end_file_name|><|fim▁begin|>// Copyright (c) 2014 The Darkcoin developers // Distributed under the MIT/X11 software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. #include "keepass.h" #include <exception> #include <openssl/rand.h> #includ...
<|file_name|>noparse.rs<|end_file_name|><|fim▁begin|>macro_rules! noparse( ($name:ident, $re:expr) => ( #[test] fn $name() { let re = $re; match regex_new!(re) { Err(_) => {}, Ok(_) => panic!("Regex '{}' should cause a parse error.", re), ...
noparse!(fail_counted_no_close, "a{1001");
<|file_name|>have_killed.go<|end_file_name|><|fim▁begin|>package fake_command_runner_matchers import ( "fmt" "os/exec" "github.com/cloudfoundry/gunk/command_runner/fake_command_runner"<|fim▁hole|> func HaveKilled(spec fake_command_runner.CommandSpec) *HaveKilledMatcher { return &HaveKilledMatcher{Spec: spec} } t...
)
<|file_name|>expand.rs<|end_file_name|><|fim▁begin|>use std::str; use memchr::memchr; use bytes::Captures; pub fn expand(caps: &Captures, mut replacement: &[u8], dst: &mut Vec<u8>) { while !replacement.is_empty() { match memchr(b'$', replacement) { None => break, Some(i) => { ...
dst.push(b'$');
<|file_name|>f64.rs<|end_file_name|><|fim▁begin|>// Copyright 2012-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/licens...
pub const FRAC_1_SQRT2: f64 = 0.707106781186547524400844362104849039_f64; /// Euler's number pub const E: f64 = 2.71828182845904523536028747135266250_f64;
<|file_name|>metrics.py<|end_file_name|><|fim▁begin|># Copyright 2020 The FedLearner Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.or...
<|file_name|>test_carbonara.py<|end_file_name|><|fim▁begin|># -*- encoding: utf-8 -*- # # Copyright © 2014-2016 eNovance # # 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.ap...
carbonara.SplitKey.from_timestamp_and_sampling(dt1, td), carbonara.SplitKey.from_timestamp_and_sampling(dt1, td)) self.assertGreater(
<|file_name|>can-place-flowers.py<|end_file_name|><|fim▁begin|># Time: O(n) # Space: O(1) # Suppose you have a long flowerbed in which some of the plots are planted and some are not. # However, flowers cannot be planted in adjacent plots - they would compete for water # and both would die. # # Given a flowerbed (repr...
# n is a non-negative integer which won't exceed the input array size.