prompt
large_stringlengths
70
991k
completion
large_stringlengths
0
1.02k
<|file_name|>manage.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python import os import sys if __name__ == "__main__":<|fim▁hole|> execute_from_command_line(sys.argv)<|fim▁end|>
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "wellspring.settings") from django.core.management import execute_from_command_line
<|file_name|>lib.rs<|end_file_name|><|fim▁begin|>// Copyright © 2015, Peter Atashian // Licensed under the MIT License <LICENSE.md> //! FFI bindings to gdi32. #![cfg(all(windows, any(target_arch = "x86", target_arch = "x86_64")))] extern crate winapi; use winapi::*; extern "system" { pub fn AbortDoc(hdc: HDC) -> c_...
// pub fn GetFontData(); // pub fn GetFontLanguageInfo(); // pub fn GetFontResourceInfoW(); // pub fn GetFontUnicodeRanges();
<|file_name|>test_stdio.py<|end_file_name|><|fim▁begin|># Copyright (c) Twisted Matrix Laboratories. # See LICENSE for details. """ Tests for L{twisted.internet.stdio}. @var properEnv: A copy of L{os.environ} which has L{bytes} keys/values on POSIX platforms and native L{str} keys/values on Windows. """ from __f...
return reactor.spawnProcess( proto,
<|file_name|>rename_hist_items.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python2.7 from bioblend.galaxy import GalaxyInstance import requests import datetime import argparse requests.packages.urllib3.disable_warnings() def parse_args(): args = argparse.ArgumentParser(description="Rename history items using ...
See test-data/sample_table.tab for an example file.") args.add_argument("-url", "--galaxy_url", required=True, help="url of galaxy instance")
<|file_name|>types.rs<|end_file_name|><|fim▁begin|>use std::collections::{HashMap, HashSet}; use std::cell::RefCell; #[derive(Deserialize, Debug, Serialize, PartialEq)] pub struct ClaimDefinition { #[serde(rename = "ref")] pub schema_seq_no: i32, #[serde(rename = "origin")] pub issuer_did: String, ...
pub verkey: Option<String> }
<|file_name|>0001_initial.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- from south.utils import datetime_utils as datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Adding model 'LaunchW...
db.delete_table(u'launch_window_launchwindow') models = {
<|file_name|>main.go<|end_file_name|><|fim▁begin|>package main // list all of the multipels of m below max and returns them on the ret channel func listMultiples(m, max int, ret chan int) { if m == 0 { return } count := 0 tmp := 0 for { tmp = count * m if tmp >= max { break } count++ ret <- tmp ...
<|file_name|>setup.py<|end_file_name|><|fim▁begin|>from setuptools import setup, find_packages from dist_job_mgr.version import VERSION <|fim▁hole|> name='dist_job_mgr', version=VERSION, author='genForma Corp', author_email='code@genforma.com', url='', packages=find_packages(), include_packa...
setup(
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|>import learn import inject import project from build_surrogate import build_surrogate <|fim▁hole|><|fim▁end|>
from ActiveSubspace import ActiveSubspace
<|file_name|>search_notify.py<|end_file_name|><|fim▁begin|># # Copyright (c) 2008--2015 Red Hat, Inc. # # This software is licensed to you under the GNU General Public License, # version 2 (GPLv2). There is NO WARRANTY for this software, express or # implied, including the implied warranties of MERCHANTABILITY or FITNE...
import xmlrpclib from spacewalk.common.rhnLog import log_error
<|file_name|>transitions-spec.js<|end_file_name|><|fim▁begin|>import { getTransitionNames, getAvailableTransitionNames, getTransitionStylesName } from 'frontend/transitions'; describe('getTransitionNames', () => { it('returns array of names', () => { const result = getTransitionNames(); expect(result)...
});
<|file_name|>02ccb3e6a553_.py<|end_file_name|><|fim▁begin|>"""empty message Revision ID: 02ccb3e6a553 Revises: None Create Date: 2016-05-17 22:15:03.881575 """ # revision identifiers, used by Alembic. revision = '02ccb3e6a553' down_revision = None from alembic import op import sqlalchemy as sa def upgrade(): ...
<|file_name|>flatspice.py<|end_file_name|><|fim▁begin|># flatspice.py #----------------------------------------------------------- # Python script which writes a SPICE-format netlist. # Replaces the code formerly in "netlist.c" (deprecated). # Python scripting is now the preferred method for handling # netlist output f...
for x in slist: try: f = x.keys()[0] except AttributeError: # must be a string
<|file_name|>service.go<|end_file_name|><|fim▁begin|>package httpd import ( "crypto/tls" "expvar" "fmt" "log" "net" "net/http" "net/url" "strings" "sync" "time" "github.com/influxdata/kapacitor/services/logging" ) type Service struct { ln net.Listener addr string https bool cert string err cha...
<|file_name|>main.py<|end_file_name|><|fim▁begin|>from binsearch import BinSearch from nzbclub import NZBClub from nzbindex import NZBIndex from bs4 import BeautifulSoup from couchpotato.core.helpers.variable import getTitle, splitString, tryInt from couchpotato.core.helpers.encoding import simplifyString from couchpo...
elif newsgroup == "abtv":
<|file_name|>views.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- from django.shortcuts import render_to_response from django.template import RequestContext from django.http import HttpResponseRedirect, Http404 from django.core.urlresolvers import reverse from StackSmash.apps.uploader.models import Document f...
return render_to_response(
<|file_name|>comparison.py<|end_file_name|><|fim▁begin|>from __future__ import absolute_import, print_function, division import petl as etl table = [['foo', 'bar'], ['a', 1], ['b', None]] # raises exception under Python 3 etl.select(table, 'bar', lambda v: v > 0) # no error under Python 3 etl.selec...
<|file_name|>2.py<|end_file_name|><|fim▁begin|>f = open('main_h.tex','w') f.write("""\documentclass[a4paper,5pt,twocolumn,titlepage]{article} \usepackage{mathpazo} \usepackage{xeCJK} \usepackage{pstricks,pst-node,pst-tree} \usepackage{titlesec} \\titleformat*{\section}{\sf} \\titleformat*{\subsection}{\sf} ...
%\setsansfont{Droid Sans Mono} \usepackage{tocloft} \\renewcommand\cftsecfont{\sf}
<|file_name|>0010_auto_20180124_1945.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- # Generated by Django 1.9.10 on 2018-01-24 19:45 from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): <|fim▁hole|> ] operations = [ migration...
dependencies = [ ('page', '0009_auto_20180124_0105'),
<|file_name|>main.rs<|end_file_name|><|fim▁begin|>fn factorize(n:u64) -> Vec<u64> { let mut factors:Vec<u64> = vec!(); let mut target = n; //grab factors of two while target % 2 == 0 { factors.push(2); target /= 2; } //grab odd prime factors let mut factor = 3;<|fim▁hole|> ...
<|file_name|>learn_images.py<|end_file_name|><|fim▁begin|># coding: utf-8 """ labeled_images文件夹中: 1. 包含的文件夹名为标记名 2. 标记名下的文件夹中包含了学习图片 """ import os from sklearn import svm <|fim▁hole|>from numpy import array from utils import * clf = None def get_image_fit_data(dir_name): """读取labeled_images文件夹的图片,返...
from PIL import Image
<|file_name|>test_extension.py<|end_file_name|><|fim▁begin|># ~*~ coding: utf-8 ~*~ """ tests.marshmallow.test_extension ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Tests for the :class:`MarshmallowAwareApp` to ensure that it will properly register the extension and can be used, as well as testing the top level schema. """ import ...
<|file_name|>ja.js<|end_file_name|><|fim▁begin|>/* Copyright (c) 2003-2018, CKSource - Frederico Knabben. All rights reserved. For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license */ CKEDITOR.plugins.setLang( 'colorbutton', 'ja', { auto: '自動', bgColorTitle: '背景色', colors: { '000': 'Bla...
FFFFE0: 'Light Yellow',
<|file_name|>request.rs<|end_file_name|><|fim▁begin|>use error; use hyper; use hyper_rustls; use response; use std; use types; use url; #[derive(Debug, Clone)] pub struct Request<'a> { client: std::sync::Arc<hyper::Client>, method: types::Method, url: url::Url<'a>, headers: hyper::header::Headers, body: Str...
<|file_name|>signals.py<|end_file_name|><|fim▁begin|>""" This creates Django signals that automatically update the elastic search Index When an item is created, a signal is thrown that runs the create / update index API of the Search Manager When an item is deleted, a signal is thrown that executes the delete index API...
@receiver(post_save, sender=Metric) def update_document_on_search_service(sender, **kwargs): if not kwargs.get('raw', False):
<|file_name|>config.py<|end_file_name|><|fim▁begin|>frame_len = .1 keys = { 'DOWN': 0x42, 'LEFT': 0x44, 'RIGHT': 0x43, 'UP': 0x41, 'Q': 0x71, 'ENTER': 0x0a, } apple_domain = 1000 <|fim▁hole|>} game_sizes = { 's': (25, 20), 'm': (50, 40), 'l': (80, 40), } initial_size = 4<|fim▁end...
food_values = { 'apple': 3,
<|file_name|>inspector_timeline.py<|end_file_name|><|fim▁begin|># Copyright 2013 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. from telemetry.core.backends.chrome import timeline_recorder from telemetry.timeline import i...
return inspector_timeline_data.InspectorTimelineData(raw_events)
<|file_name|>message_publisher.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python import rospy from basics.msg import Complex from random import random rospy.init_node('message_publisher') pub = rospy.Publisher('complex', Complex) rate = rospy.Rate(2) while not rospy.is_shutdown(): msg = Complex() ms...
<|file_name|>bgtest.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python # -*- coding: utf-8 -*- import sys sys.path.append("..") # # Copyright (C) 2000-2005 by Yasushi Saito (yasushi.saito@gmail.com) # # Pychart is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public ...
# # Pychart is distributed in the hope that it will be useful, but WITHOUT # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
<|file_name|>_to-iobject.js<|end_file_name|><|fim▁begin|>// to indexed object, toObject with fallback for non-array-like ES3 strings var IObject = require('./_iobject')<|fim▁hole|><|fim▁end|>
, defined = require('./_defined'); module.exports = function(it){ return IObject(defined(it)); };
<|file_name|>nolink-with-link-args.rs<|end_file_name|><|fim▁begin|>// Copyright 2012 The Rust Project Developers. See the COPYRIGHT // file at the top-level directory of this distribution and at // http://rust-lang.org/COPYRIGHT. // // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or // http://www.apac...
<|file_name|>other_test.py<|end_file_name|><|fim▁begin|>from itertools import chain from django.contrib.contenttypes.models import ContentType from django.core.exceptions import ValidationError from django.test import TestCase import guardian from guardian.backends import ObjectPermissionBackend from guardian.exceptio...
<|file_name|>test.js<|end_file_name|><|fim▁begin|>"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); const Command = require('../ember-cli/lib/models/command'); const test_1 = require("../tasks/test"); const config_1 = require("../models/config"); const common_tags_1 = require("common-tags"); ...
name: 'app', type: String, aliases: ['a'], description: 'Specifies app name to use.'
<|file_name|>forms.py<|end_file_name|><|fim▁begin|>from django import forms from .models import Topic, Entry class TopicForm(forms.ModelForm): class Meta: model = Topic fields = ['text'] labels = {'text': ''} <|fim▁hole|> class EntryForm(forms.ModelForm): class Meta: m...
<|file_name|>test_sql.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python # -*- coding: utf-8 -*- """Tests for pdeo.database.sql""" <|fim▁hole|>from pdeo.databases import sql # if version_info[0] == 2: # utf8 for python2 # from codecs import open class PdeoDatabaseSqlTestCase(unittest.TestCase): def s...
import unittest # import responses
<|file_name|>Queue.test.js<|end_file_name|><|fim▁begin|>const test = require('tape') const Queue = require('./Queue') test('peek on empty queue', assert => { const queue = new Queue() assert.strictEqual(queue.peek(), null) assert.end() }) test('enqueue items to the queue', assert => { const queue = new Queue(...
test('create queue from array', assert => { const queue = new Queue(['A', 'B', 'C'])
<|file_name|>inspect_test.go<|end_file_name|><|fim▁begin|>package commands import ( "bytes" "encoding/json" "flag" "io" "os" "strings" "testing" "github.com/codegangsta/cli" "github.com/docker/machine/libmachine" "github.com/docker/machine/libmachine/auth" "github.com/docker/machine/libmachine/engine" "gi...
os.Setenv("SHELL", "/bin/bash")
<|file_name|>partition.ts<|end_file_name|><|fim▁begin|>import {Observable} from '../Observable'; import {filter} from './filter'; const not = <T>(fn: (val: T) => boolean) => (x: T) => !fn(x); /** * Splits the source Observable into two, one with values that satisfy a predicate, * and another with values that don't ...
export function partition<T>(predicate: (val: T) => boolean): [Observable<T>, Observable<T>] { return [ filter.call(this, predicate),
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|>metadata = { "abbreviation": "ex", "capitol_timezone": "Etc/UTC", "legislature_name": "Example Legislature", "lower_chamber_name": "House of Representatives", "lower_chamber_term": 2, "lower_chamber_title": "Representative", "upper_chambe...
"upper_chamber_title": "Senator", "name": "Example State", "terms": [
<|file_name|>Update.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python3 # -*-coding:UTF-8 -* import os import re import sys import time import redis import datetime sys.path.append(os.path.join(os.environ['AIL_BIN'], 'packages'))<|fim▁hole|> sys.path.append(os.path.join(os.environ['AIL_BIN'], 'lib/')) import Confi...
import Item import Term
<|file_name|>ShardingFilterTestCase.java<|end_file_name|><|fim▁begin|>// Copyright 2010 The Bazel 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 // // ht...
if (reviewedDescriptions.contains(currDescription)) { continue;
<|file_name|>views.py<|end_file_name|><|fim▁begin|>from django.shortcuts import get_object_or_404, render_to_response from django.http import Http404, HttpResponseRedirect from django.template import RequestContext from django.core.urlresolvers import reverse from django.contrib.auth.decorators import login_required fr...
@login_required def message_create(request, content_type_id=None, object_id=None,
<|file_name|>urls.py<|end_file_name|><|fim▁begin|>from django.conf.urls import patterns, include, url from django.contrib import admin from rest_framework import viewsets, routers from voting_app.models import Topic from voting_app.views import Vote from voting_app.serializer import TopicSerializer admin.autodiscover...
class TopicViewSet(viewsets.ModelViewSet): model = Topic serializer_class = TopicSerializer queryset = Topic.objects.all().filter(hide=False)
<|file_name|>ndvi.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python # Version 0.1 # NDVI automated acquisition and calculation by Vladyslav Popov # Using landsat-util, source: https://github.com/developmentseed/landsat-util # Uses Amazon Web Services Public Dataset (Lansat 8) # Script should be run every day...
<|file_name|>complain.py<|end_file_name|><|fim▁begin|>"""User-friendly exception handler for swood.""" import http.client import traceback import sys import os __file__ = os.path.abspath(__file__) class ComplainToUser(Exception): """When used with ComplaintFormatter, tells the user what error (of theirs) caused ...
return False
<|file_name|>NormalCurve.java<|end_file_name|><|fim▁begin|>/**************************************************** Statistics Online Computational Resource (SOCR) http://www.StatisticsResource.org All SOCR programs, materials, tools and resources are developed by and freely disseminated to the entire community. Us...
if (f <= y && f >= 0.0001) { return true; } else {
<|file_name|>test_api.py<|end_file_name|><|fim▁begin|>""" This file is part of the tractor library. See LICENSE.txt for licensing, CONTRIBUTORS.txt for contributor information. Created on Jan 06, 2012. """ from pkg_resources import resource_filename # pylint: disable=E0611 from tractor import AttachmentWrapper from t...
self.assert_not_equal(file_name1, file_name3)
<|file_name|>hill-sphere.js<|end_file_name|><|fim▁begin|>/** * Calculates the radius of the Hill Sphere, * for a body with mass `m1` * @param {Number} m1 Mass of the lighter body * @param {Number} m2 Mass of the heavier body * @param {Number} a Semi-major axis * @param {Number} e Eccentricity * @return {Nu...
<|file_name|>0011_auto_20150618_0003.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations class Migration(migrations.Migration): dependencies = [ ('orchestra', '0010_merge'),<|fim▁hole|> operations = [ migrat...
]
<|file_name|>gecko.mako.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/. */ // `data` comes from components/style/properties.mako.rs; ...
let mut array = unsafe { &mut **self.gecko.mContents[i].mContent.mCounters.as_mut() }; array[0].set_string(&name);
<|file_name|>exec.go<|end_file_name|><|fim▁begin|>package exec import ( "bytes" "fmt" "os/exec" "path/filepath" "runtime" "strings" "sync" "syscall" "time" "github.com/kballard/go-shellquote" "github.com/influxdata/telegraf" "github.com/influxdata/telegraf/internal" "github.com/influxdata/telegraf/plugi...
acc.AddFields(metric.Name(), metric.Fields(), metric.Tags(), metric.Time()) } } }
<|file_name|>hDBSessionMaker.py<|end_file_name|><|fim▁begin|># create a Session object by sessionmaker import os import ConfigParser import sqlalchemy.orm # get path to taskmanager. it is assumed that this script is in the lib directory of # the taskmanager package. tmpath = os.path.normpath( os.path.join( os.path.di...
# Session is a regular Python class which can be directly instantiated. However, to standardize how sessions are # configured and acquired, the sessionmaker class is normally used to create a top level Session configuration # which can then be used throughout an application without the need to...
<|file_name|>SnappingFader.java<|end_file_name|><|fim▁begin|>package model.protocol.osc.touchosc; public class SnappingFader { static final float SNAP_DELTA = 0.1f; private double currentRealValue; public SnappingFader(final double currentRealValue) { this.currentRealValue = currentRealValue; }<|fim▁hole|> cu...
public void tryUpdate(final double value, final ISnappingFaderEventHandler handler) { if (isInBoundary(value)) {
<|file_name|>test_insertion_sort.py<|end_file_name|><|fim▁begin|># -*- coding utf-8 -*- from __future__ import unicode_literals import pytest from structures.insertion_sort import insertion_sort @pytest.fixture def sorted_list(): return [i for i in xrange(10)] @pytest.fixture def reverse_list(): return [i f...
def test_average(average_list): insertion_sort(average_list) assert average_list == [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
<|file_name|>RA250C.H<|end_file_name|><|fim▁begin|>/* File: RA250.H 'C' structures for RemoteAccess 2.50 Gamma Version: 0.3 (22/04/96) Author: Damien Guard Copyright: Envy Technologies, 1996. Changes: 0.1 - Initial release 0.2 - Fixed some compile problems Sorted enumeration types 0.3 -...
long xBaud; /* unused - found in MODEM.RA */ unsigned char xInitTries, /* unused - found in MODEM.RA */ xInitStr[71], /* unused - found in MODEM.RA */
<|file_name|>TaskWrongPasswordException.java<|end_file_name|><|fim▁begin|>/* * Created on 20/giu/2010 * * Copyright 2010 by Andrea Vacondio (andrea.vacondio@gmail.com). * * This file is part of the Sejda source code * * This program is free software: you can redistribute it and/or modify * it under the terms o...
*
<|file_name|>docs.rs<|end_file_name|><|fim▁begin|>//! Protocol documentation #[doc(include = "../protocol-docs/websocket.md")]<|fim▁hole|><|fim▁end|>
pub mod websocket {}
<|file_name|>IOErrorEvent.js<|end_file_name|><|fim▁begin|><|fim▁hole|><|fim▁end|>
export { default } from "./../../_gen/openfl/events/IOErrorEvent";
<|file_name|>state.py<|end_file_name|><|fim▁begin|>from .trace_decorator import getLog from .exception import StateError class State(object): def __init__(self): self._state = [] # can be "unknown", "success" or "fail" self.result = "unknown" self.state_log = getLog("mockbuild.Root...
<|file_name|>actionable.rs<|end_file_name|><|fim▁begin|>// This file was generated by gir (5c017c9) from gir-files (71d73f0) // DO NOT EDIT <|fim▁hole|>use ffi; use glib; use glib::object::IsA; use glib::translate::*; glib_wrapper! { pub struct Actionable(Object<ffi::GtkActionable>): Widget; match fn { ...
use Widget;
<|file_name|>630.js<|end_file_name|><|fim▁begin|>var __v=[ { "Id": 2046, "Chapter": 630,<|fim▁hole|> "Name": "c++", "Sort": 0 } ]<|fim▁end|>
<|file_name|>GetIntrinsic.d.ts<|end_file_name|><|fim▁begin|>/** * Returns the ECMAScript intrinsic for the name. * * @param name The ECMAScript intrinsic name * @param allowMissing Whether the intrinsic can be missing in this environment * * @throws {SyntaxError} If the ECMAScript intrinsic doesn't exist * @thro...
'%Date.prototype.getMonth%': typeof Date.prototype.getMonth;
<|file_name|>authors.js<|end_file_name|><|fim▁begin|>import { FETCH_AUTHOR, UPDATE_AUTHOR } from 'shared/constants/actions'; const INITIAL_STATE = { <|fim▁hole|> errorMessage: '' }; export default function (state = INITIAL_STATE, action) { switch (action.type) { case FETCH_AUTHOR.SUCCESS: // author -> {...
author: {},
<|file_name|>ewf_path_spec.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python # -*- coding: utf-8 -*- """Tests for the EWF image path specification implementation.""" import unittest from dfvfs.path import ewf_path_spec from tests.path import test_lib class EwfPathSpecTest(test_lib.PathSpecTestCase): """Tests for...
self.assertNotEqual(path_spec, None)
<|file_name|>lib.rs<|end_file_name|><|fim▁begin|>// Copyright © 2015, Peter Atashian // Licensed under the MIT License <LICENSE.md> //! FFI bindings to winsatapi.<|fim▁hole|>extern crate winapi; use winapi::*; extern "system" { }<|fim▁end|>
#![no_std] #![experimental]
<|file_name|>spamcan1.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python ############################################################################### # Copyright (C) 1994 - 2013, Performance Dynamics Company # # # # T...
# copies of the Software, and permit persons to whom the Software is # # furnished to do so, under the terms of the COPYING file. # # # # This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY #
<|file_name|>machine.rs<|end_file_name|><|fim▁begin|>// Copyright (C) 2014 The 6502-rs Developers // All rights reserved. // // 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 r...
}
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|># stdlib from collections import defaultdict import sys from typing import Any as TypeAny from typing import Callable from typing import Dict from typing import KeysView from typing import List as TypeList from typing import Set # third party from cachetools import...
allowed_functions[rejected_function] = False
<|file_name|>stand_alone.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python """ Standaone Rule ============== This is a customer spec, parser and rule and can be run against the local host using the following command:: $ insights-run -p examples.rules.stand_alone or from the examples/rules directory:: $ ...
if __name__ == "__main__": run(report, print_summary=True)
<|file_name|>EventDirective.js<|end_file_name|><|fim▁begin|>import { removeFromArray } from '../../../utils/array'; import fireEvent from '../../../events/fireEvent'; import Fragment from '../../Fragment'; import createFunction from '../../../shared/createFunction'; import { unbind } from '../../../shared/methodCallers...
<|file_name|>models.py<|end_file_name|><|fim▁begin|>"""Django models for MK8 Kart Comparison Tool.""" from django.core.exceptions import ObjectDoesNotExist from django.db import models from django.templatetags.static import static import re import uuid import logging from ipware.ip import get_ip, get_real_ip logger...
def __init__(self, (character_id, kart_id, wheel_id, glider_id)):
<|file_name|>pdf_viewer.js<|end_file_name|><|fim▁begin|>/* Copyright 2014 Mozilla 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/LICEN...
var isScalingRestricted = false; if (this.canvas && PDFJS.maxCanvasPixels > 0) {
<|file_name|>longest-common-prefix.py<|end_file_name|><|fim▁begin|># Link: https://leetcode.com/problems/longest-common-prefix/<|fim▁hole|> # @param {string[]} strs # @return {string} def longestCommonPrefix(self, strs): if not len(strs): return '' if len(strs) == 1: r...
class Solution:
<|file_name|>minimal_example.py<|end_file_name|><|fim▁begin|>""" Loads hyperspy as a regular python library, creates a spectrum with random numbers and plots it to a file""" <|fim▁hole|>import matplotlib.pyplot as plt s = hs.signals.Spectrum(np.random.rand(1024)) s.plot() plt.savefig("testSpectrum.png")<|fim▁end|>
import hyperspy.api as hs import numpy as np
<|file_name|>d9.rs<|end_file_name|><|fim▁begin|>extern crate adventofcode; use adventofcode::d2::{Error, Parser, Program}; use std::io; use std::io::BufRead; fn program_for(inp: &str, v: Vec<i64>) -> Vec<i64> { let mut p = Program::new(Parser::parse(&inp)); p.run(&mut v.into_iter()) .collect::<Result<V...
let inp = &inp?; println!("{:?}", program_for(inp, vec![1]));
<|file_name|>lib.rs<|end_file_name|><|fim▁begin|>#![cfg_attr(feature = "serde_macros", feature(custom_derive, plugin))] #![cfg_attr(feature = "serde_macros", plugin(serde_macros))] extern crate serde; extern crate serde_json; <|fim▁hole|>#[cfg(not(feature = "serde_macros"))] include!(concat!(env!("OUT_DIR"), "/lib.rs"...
#[cfg(feature = "serde_macros")] include!("lib.rs.in");
<|file_name|>InternalTypes.ts<|end_file_name|><|fim▁begin|>/* * Copyright 2017-2020 Simon Edwards <simon@simonzone.com> * * This source code is licensed under the MIT license which is detailed in the LICENSE.txt file. */ import * as ExtensionApi from "@extraterm/extraterm-extension-api"; import { EtTerminal, LineR...
* * It also provides methods for the core application to interact with an * Extension and all the different things it may have registered and * provided.
<|file_name|>test_util.py<|end_file_name|><|fim▁begin|>import unittest from locust.util.timespan import parse_timespan from locust.util.rounding import proper_round class TestParseTimespan(unittest.TestCase): def test_parse_timespan_invalid_values(self): self.assertRaises(ValueError, parse_timespan, None)...
self.assertEqual(2, proper_round(2.05)) self.assertEqual(3, proper_round(3.05))
<|file_name|>morestack3.rs<|end_file_name|><|fim▁begin|>// Copyright 2012 The Rust Project Developers. See the COPYRIGHT // file at the top-level directory of this distribution and at // http://rust-lang.org/COPYRIGHT. // // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or // http://www.apache.org/lice...
}; }
<|file_name|>Outline.py<|end_file_name|><|fim▁begin|># coding=utf8 import sublime from .Base import Base from ...utils import Debug from ...utils.uiutils import get_prefix class Outline(Base): regions = {} ts_view = None def __init__(self, t3sviews): super(Outline, self).__init__('Typescript : O...
else: Debug('focus', "_focus_member_in_view, Region @pos %i" % (region.begin())) self.is_focusing_ts_view = True self.ts_view.show(region)
<|file_name|>filters.js<|end_file_name|><|fim▁begin|>'use strict';<|fim▁hole|>]). // create your own filter here filter('yourFilterName', function () { return function () { return; }; });<|fim▁end|>
/* Filters */ angular.module('multi-screen-demo.filters', [
<|file_name|>rp_extract.py<|end_file_name|><|fim▁begin|>''' RP_extract: Rhythm Patterns Audio Feature Extractor @author: 2014-2015 Alexander Schindler, Thomas Lidy Re-implementation by Alexander Schindler of RP_extract for Matlab Matlab version originally by Thomas Lidy, based on Musik Analysis Toolbox by Elias Pam...
# import pandas as pd # filename = "features.rp.csv" # rp = pd.DataFrame(feat["rp"].reshape([1,feat["rp"].shape[0]]))
<|file_name|>var2str.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- """ translate variance and its formated character which have regularities for example: raw input: v={'aa': 12345, 'bbbb': [1, 2, 3, 4, {'flag': 'vvvv||||xxxxx'}, set(['y', 'x', 'z'])]} after `var2str.var2str(v)` v_str=<aa::123...
tag_index = 0 s_tag_len, e_tag_len = len(self.s_tag), len(self.e_tag) nest_index =[]
<|file_name|>tuple_alignment.rs<|end_file_name|><|fim▁begin|>enum Foo { Bazlooooooooooong(i32, i32, i32, i32, i32, i32), } fn main() { let long_tuple: (u8, u16, u32, u64, u128, i8, i16, i32, i64, i128, f32, f64, char, ...
5678, false, 91011, "foobar") => 10
<|file_name|>WeaponCraftedInfo.tsx<|end_file_name|><|fim▁begin|>import { t } from 'app/i18next-t';<|fim▁hole|>import { DimCrafted } from 'app/inventory/item-types'; import { percent } from 'app/shell/filters'; import React from 'react'; /** * A progress bar that shows weapon crafting info like the game does. */ expo...
<|file_name|>profile.js<|end_file_name|><|fim▁begin|>module.exports = async ({ client, configJS, Utils: { IsURL }, Constants: { Colors } }, msg, commandData) => { const handleQuit = () => { msg.reply({ embed: { color: Colors.RED, description: `You've exited the profile setup menu!`, }, }); }; if (...
message = await client.awaitPMMessage(msg.channel, msg.author, 120000); } catch (err) { message = undefined; switch (err.code) {
<|file_name|>TestVariablesNames.java<|end_file_name|><|fim▁begin|>package jadx.tests.integration.debuginfo; import org.junit.jupiter.api.Test; import jadx.core.dex.nodes.ClassNode; import jadx.tests.api.SmaliTest; import static jadx.tests.api.utils.JadxMatchers.containsOne; import static org.hamcrest.MatcherAssert.a...
public void test(String s, int k) { f1(s); int i = k + 3;
<|file_name|>Validation.js<|end_file_name|><|fim▁begin|>var App = angular.module('validationApp', []); App.controller('mainController', function ($scope) { $scope.submitForm = function (isValid) { if (isValid) { alert('Our form is Amazing'); } else { alert...
});
<|file_name|>ComponentModel_test.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python # This file is part of nexdatas - Tango Server for NeXus data writer # # Copyright (C) 2012-2017 DESY, Jan Kotanski <jkotan@mail.desy.de> # # nexdatas is free software: you can redistribute it and/or modify # it under the ...
nname = "definition" qdn = doc.createElement(nname) doc.appendChild(qdn)
<|file_name|>end.py<|end_file_name|><|fim▁begin|>import pygame from pygame.locals import * from math import sin import states class EndEvent(object): text = [ "Ah, hello there. Welcome to the center of the moon!", "Oh, me? I'm just the man in the moon. I live here.", "Don't act so ...
spos[1] - texture.get_height() / 2 + i * 20 - 40 )
<|file_name|>PromptSummarizeScores.java<|end_file_name|><|fim▁begin|>/* * Copyright (c) 2015 High Tech Kids. All rights reserved * HighTechKids is on the web at: http://www.hightechkids.org * This code is released under GPL; see LICENSE.txt for details. */ <|fim▁hole|>import java.sql.SQLException; import java.util...
package fll.web.report; import java.io.IOException; import java.sql.Connection;
<|file_name|>ApplicationStartHandler.java<|end_file_name|><|fim▁begin|>package org.dominokit.domino.api.client;<|fim▁hole|>public interface ApplicationStartHandler { void onApplicationStarted(); }<|fim▁end|>
@FunctionalInterface
<|file_name|>RewritingMergingEntryIterator.java<|end_file_name|><|fim▁begin|>/** * Copyright (c) 2013-2019 Contributors to the Eclipse Foundation * * <p> See the NOTICE file distributed with this work for additional information regarding copyright * ownership. All rights reserved. This program and the accompanying ...
import org.locationtech.geowave.core.store.adapter.RowMergingDataAdapter.RowTransform; import org.locationtech.geowave.core.store.api.Index; import org.locationtech.geowave.core.store.entities.GeoWaveRow;
<|file_name|>raft.go<|end_file_name|><|fim▁begin|>// Copyright 2015 CoreOS, Inc. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // //...
<|file_name|>DataInfo.java<|end_file_name|><|fim▁begin|>package org.apache.velocity.tools.view; /* * 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. Th...
<|file_name|>SetBkColor.cpp<|end_file_name|><|fim▁begin|>// ƒwƒbƒ_ƒtƒ@ƒCƒ‹‚̃Cƒ“ƒNƒ‹[ƒh #include <windows.h> // •W€WindowsAPI #include <tchar.h> // TCHARŒ^ #include <string.h> // C•¶Žš—ñˆ— // ŠÖ”‚̃vƒƒgƒ^ƒCƒvéŒ¾ LRESULT CALLBACK WindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam); // ƒEƒBƒ“ƒhƒEƒƒb...
uiLen = _tcslen(tszText); // _tcslen‚ÅtszText‚Ì’·‚³‚ðŽæ“¾‚µ, uiLen‚ÉŠi”[. TextOut(hDC, 50, 50, tszText, (int)uiLen); // TextOut‚ŃEƒBƒ“ƒhƒEhwnd‚̍À•W(50, 50)‚̈ʒu‚ÉtszText‚ð•`‰æ.
<|file_name|>test_connect_helpers.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- # # test_connect_helpers.py # # This file is part of NEST. # # Copyright (C) 2004 The NEST Initiative # # NEST is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as publi...
# NEST is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
<|file_name|>Interfaz_Factura.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 modelo.formularios; import controlador.dbConnection; import ja...
private final Connection conexion = dbConnection.getConnection(); private String querySQL = "";
<|file_name|>ItemPhaseClothHelmet.java<|end_file_name|><|fim▁begin|>/*************************************************************************** * Temporal Convergence * Copyright (C) 2017 * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public...
<|file_name|>index.js<|end_file_name|><|fim▁begin|>import React from "react"; import { connect } from "react-redux"; import { withRouter, Route } from "react-router"; import { Link } from "react-router-dom"; import { Entry } from "../../pages/entry"; class BlogCard extends React.Component { render() { return ( ...
} } export default withRouter(BlogCard);