prompt
large_stringlengths
70
991k
completion
large_stringlengths
0
1.02k
<|file_name|>app.module.ts<|end_file_name|><|fim▁begin|>import { BrowserModule } from '@angular/platform-browser'; import { BrowserAnimationsModule } from '@angular/platform-browser/animations'; import { NgModule } from '@angular/core'; import { HttpClientModule } from '@angular/common/http'; import { AngularFireModule...
import { ShorthandnumberPipe } from './pipes/shorthandnumber.pipe'; import { LineChartComponent } from './components/line-chart/line-chart.component'; import { DataService } from './services/data.service'; import { ToolbarComponent } from './components/toolbar/toolbar.component';
<|file_name|>tools.py<|end_file_name|><|fim▁begin|><|fim▁hole|>from frappe import _<|fim▁end|>
from __future__ import unicode_literals
<|file_name|>interfaces.go<|end_file_name|><|fim▁begin|>// Copyright 2016 Canonical Ltd. // Licensed under the LGPLv3, see LICENCE file for details. package gomaasapi import "github.com/juju/utils/set" const ( // Capability constants. NetworksManagement = "networks-management" StaticIPAddresses = "stat...
AllocateMachine(AllocateMachineArgs) (Machine, ConstraintMatches, error) // ReleaseMachines will stop the specified machines, and release them
<|file_name|>UserPrincipal.java<|end_file_name|><|fim▁begin|>/* * Copyright 2013 the original author or 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.apa...
/**
<|file_name|>Rgaa32017Rule100901Test.java<|end_file_name|><|fim▁begin|>///* // * Tanaguru - Automated webpage assessment // * Copyright (C) 2008-2017 Tanaguru.org // * // * This program is free software: you can redistribute it and/or modify // * it under the terms of the GNU Affero General Public License as // * publ...
<|file_name|>isomorphism.rs<|end_file_name|><|fim▁begin|>use std::marker; use fixedbitset::FixedBitSet; use super::{ EdgeType, Incoming, }; use super::graph::{ Graph, IndexType, NodeIndex, }; use super::visit::GetAdjacencyMatrix; #[derive(Debug)] struct Vf2State<Ty, Ix> { /// The current mapp...
// handle the self loop case; it's not in the mapping (yet)
<|file_name|>urls.py<|end_file_name|><|fim▁begin|>from django.conf.urls.defaults import * from twistranet.core.views import AsView from views import * <|fim▁hole|> url(r'^like_toggle_by_id/(\d+)$', AsView(LikeToggleView, lookup = 'id'), name=LikeToggleView.name), url(r'^like_toggle_by_slug/(\d+)$', AsView(LikeT...
urlpatterns = patterns('sharing',
<|file_name|>errors.go<|end_file_name|><|fim▁begin|>/* PRLPKS - OpenPGP Synchronized Key Server with Deletion Copyright (c) 2014 Pruthvirajsinh Rajendrasinh Chauhan PRLPKS is based heavily on hockeypuck(https://launchpad.net/hockeypuck) by Casey Marshall, copyright 2013(GNU GPL v3). This program is distributed in ...
<|file_name|>ambiguity.rs<|end_file_name|><|fim▁begin|>#![deny(rustdoc::broken_intra_doc_links)] #![allow(non_camel_case_types)] #![allow(non_upper_case_globals)] pub fn ambiguous() {} pub struct ambiguous {} #[macro_export] macro_rules! multi_conflict { () => {} } #[allow(non_camel_case_types)] pub struct multi_co...
/// Ambiguous [type_and_value]. //~ERROR type_and_value /// /// Ambiguous non-implied shortcut link [`foo::bar`]. //~ERROR `foo::bar`
<|file_name|>web.py<|end_file_name|><|fim▁begin|>helppage = "https://github.com/JorisPLA7/Super-D-mineur" githubpage = "https://github.com/JorisPLA7/Super-D-mineur/" rulepage = "http://demineur.hugames.fr/help.php" import webbrowser def help():<|fim▁hole|> webbrowser.open(githubpage) def rules(): webbrowser.op...
webbrowser.open(helppage) def github():
<|file_name|>mod.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::document_loader::{DocumentLoader, LoadType}; use crat...
let root_element = document.GetDocumentElement().expect("no document element"); FragmentParsingResult { inner: root_element.upcast::<Node>().children(),
<|file_name|>test_colour_operation.py<|end_file_name|><|fim▁begin|>import unittest import numpy as np from bsym import ColourOperation, Configuration from unittest.mock import patch<|fim▁hole|> def test_symmetry_operation_is_initialised_from_a_matrix( self ): matrix = np.array( [ [ 1, 0 ], [ 0, 1 ] ] ) ...
class ColourOperationTestCase( unittest.TestCase ): """Tests for colour operation methods"""
<|file_name|>main.py<|end_file_name|><|fim▁begin|>""" Fichier main qui lance le programme<|fim▁hole|>game = Game() game.play()<|fim▁end|>
""" from Game import *
<|file_name|>eventarc_client.ts<|end_file_name|><|fim▁begin|>// 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 // // https://www.apache.org/licenses/LICENSE...
<|file_name|>videomega.py<|end_file_name|><|fim▁begin|># coding: utf-8 from __future__ import unicode_literals import re from .common import InfoExtractor from ..compat import compat_urllib_request class VideoMegaIE(InfoExtractor): _VALID_URL = r'(?:videomega:|https?://(?:www\.)?videomega\.tv/(?:(?:view|iframe|...
'ext': 'mp4', 'title': '1254207',
<|file_name|>get_satellite.py<|end_file_name|><|fim▁begin|>#!usr/bin/python ''' Get satellite data according to input file. ''' from random import shuffle,random import os,json from utils.mapbox_static import MapboxStatic from utils.coordinate_converter import CoordConvert from modules.getFeatures import latLon,getBBox...
os.mkdir(subpath+satDataFolder) print 'Directory',subpath+satDataFolder,'created' if not os.path.isdir(subpath+testDataFolder):
<|file_name|>forms.py<|end_file_name|><|fim▁begin|>from operator import and_ from functools import reduce from django import forms from django.db.models import Q from django.utils.six import PY3 from django.utils.translation import ugettext_lazy as _ from api.dc.domain.views import dc_domain from api.dns.domain.views ...
super(AdminDomainForm, self).__init__(request, domain, *args, **kwargs) self.fields['owner'].choices = get_owners(request).values_list('username', 'username') if not request.user.is_staff:
<|file_name|>utils.py<|end_file_name|><|fim▁begin|>from django.db.models import Q from links.models import Post from comments.models import ThreadedComment as comments from django.utils import timezone from datetime import datetime, timedelta from django.contrib import messages <|fim▁hole|>KARMA_MEDIUM = 1000 KARMA_HIG...
KARMA_LOW = 100
<|file_name|>test_base.py<|end_file_name|><|fim▁begin|># ----------------------------------------------------------------------------- # Copyright (c) 2014--, The Qiita Development Team. # # Distributed under the terms of the BSD 3-clause License. # # The full license is in the file LICENSE, distributed with this softw...
<|file_name|>hb-subset-glyf.hh<|end_file_name|><|fim▁begin|>/* * Copyright © 2018 Google, Inc. * * This is part of HarfBuzz, a text shaping library. * * Permission is hereby granted, without written agreement and without * license or royalty fees, to use, copy, modify, and distribute this * software and its do...
<|file_name|>oauth_scopes.py<|end_file_name|><|fim▁begin|>""" Define a set of scopes to be used by COS Internal OAuth implementation, specifically tailored to work with APIv2. List of scopes, nomenclature, and rationale can be found in the relevant "Login as OSF- phase 2" proposal document """ from collections import...
<|file_name|>services.py<|end_file_name|><|fim▁begin|>""" sprintkit.services ================== Implementations of most Developer Sandbox Services. :Copyright: (c) 2011 by Sprint. :License: MIT, see LICENSE for more details. """ from ConfigParser import SafeConfigParser from datetime import datetime from hashlib imp...
data = self.parse_response(response)
<|file_name|>index.ts<|end_file_name|><|fim▁begin|><|fim▁hole|><|fim▁end|>
export * from './other-person-profile.component'
<|file_name|>LeaderboardPosition.js<|end_file_name|><|fim▁begin|>var BinaryWriter = require('./BinaryWriter'); function LeaderboardPosition(position) { this.place = position<|fim▁hole|>} module.exports = LeaderboardPosition; LeaderboardPosition.prototype.build = function() { var buf = new BinaryWriter(); ...
<|file_name|>api.rs<|end_file_name|><|fim▁begin|>//! //! Public API for bitcrust-db //! //!<|fim▁hole|> use config; use store; use store::Store; use block_add; // Creates a store; mock interface pub fn init() -> Store { let config = test_cfg!(); let store = Store::new(&config); info!(store.logger, "Sto...
//! //!
<|file_name|>test_flipud.py<|end_file_name|><|fim▁begin|>import unittest <|fim▁hole|>from chainer import functions from chainer import gradient_check from chainer import testing from chainer.testing import attr @testing.parameterize(*testing.product({ 'shape': [(3,), (3, 4)], 'dtype': [numpy.float16, numpy.fl...
import numpy import chainer from chainer.backends import cuda
<|file_name|>gyptest.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python # Copyright (c) 2012 Google Inc. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. __doc__ = """ gyptest.py -- test runner for GYP tests. """ import os import optparse i...
<|file_name|>portal.ts<|end_file_name|><|fim▁begin|>import { TemplateRef, ViewContainerRef, ElementRef, ComponentRef, Injector } from '@angular/core'; // import { // NullPortalHostError, // PortalAlreadyAttachedError, // NoPortalAttachedError, // NullPortalError, // PortalHostAlr...
dispose(): void;
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|>"""<|fim▁hole|>""" __version__ = '0.1.1'<|fim▁end|>
Collection of astronomy-related functions and utilities
<|file_name|>test_quantization_accuracy.py<|end_file_name|><|fim▁begin|># Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to yo...
# "License"); you may not use this file except in compliance # with the License. You may obtain a copy of the License at #
<|file_name|>XWActivity.java<|end_file_name|><|fim▁begin|>/* -*- compile-command: "cd ../../../../../; ant debug install"; -*- */ /* * Copyright 2010 by Eric House (xwords@eehouse.org). All rights * reserved. * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU ...
{ m_delegate.eventOccurred( event, args ); }
<|file_name|>oldest_unique.py<|end_file_name|><|fim▁begin|>class Node: def __init__(self, value): self.value = value self.next = None self.prev = None class OldestUnique: def __init__(self): self.uniq = {} self.seen = set() self.head = None self.tail = N...
def query(self): if self.tail is not None:
<|file_name|>setup.py<|end_file_name|><|fim▁begin|># coding=utf8 from setuptools import setup setup(name='fbones', version='0.0.5', description='A bootstrap toolkit to kickoff a flask project', url='https://github.com/ipconfiger/fbones', author='Alexander.Li', author_email='superpowerle...
packages=['fbones'], install_requires=[
<|file_name|>MBeanTyper.java<|end_file_name|><|fim▁begin|>package web.magic.jvm; import java.lang.reflect.InvocationTargetException; import java.lang.reflect.Method; import java.lang.reflect.Proxy; import java.lang.reflect.UndeclaredThrowableException; import java.util.ArrayList; import java.util.Collections; import j...
String name = m.getName();
<|file_name|>JustNotSorrySpec.test.js<|end_file_name|><|fim▁begin|>import { h } from 'preact'; import JustNotSorry from '../src/components/JustNotSorry.js'; import { configure, mount } from 'enzyme'; import Adapter from 'enzyme-adapter-preact-pure'; configure({ adapter: new Adapter() }); describe('JustNotSorry', () =...
});
<|file_name|>http.rs<|end_file_name|><|fim▁begin|>#[macro_use] extern crate criterion; #[macro_use] extern crate combine; use std::fmt; use { combine::{ many, many1, parser::range::{range, take_while1}, stream::easy, token, ParseError, Parser, RangeStream, }, criterion::{bl...
<|file_name|>sqllite.go<|end_file_name|><|fim▁begin|>package database import "database/sql" var db *sql.DB // OpenDB opens database connection func OpenDB() { openSQLite() } // openSQLite opens SQLite connection<|fim▁hole|> db, err = sql.Open("sqlite3", "adnalerts.db?loc.auto") if err != nil { panic(err) } er...
func openSQLite() { var err error
<|file_name|>sparc64.rs<|end_file_name|><|fim▁begin|>// Copyright 2014-2016 The Rust Project Developers. See the COPYRIGHT // file at the top-level directory of this distribution and at // http://rust-lang.org/COPYRIGHT. // // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or // http://www.apache.org/li...
let total = arg.layout.size;
<|file_name|>EventBus_solution.js<|end_file_name|><|fim▁begin|>/** * This file is the event bus demo **/ // Global namespace var EventBus = (function() { var // List of optional events events = {}, // Reference to the last fired event lastEvent, domNodes = [] ; f...
/** * Fire the event. */
<|file_name|>treeview.cpp<|end_file_name|><|fim▁begin|>/* * Copyright (C) 2000 Matthias Elter <elter@kde.org> * Copyright (C) 2001-2002 Raffaele Sandrini <sandrini@kde.org) * Copyright (C) 2003 Waldo Bastian <bastian@kde.org> * * This program is free software; you can redistribute it and/or modify * it ...
} } TreeView::~TreeView() {
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|><|fim▁hole|>__all__ = ["gauth", "gcalendar", "lectio", "lesson", "run"]<|fim▁end|>
<|file_name|>package-info.java<|end_file_name|><|fim▁begin|>/**General utility methods collection (not all self developed). */<|fim▁hole|><|fim▁end|>
package de.konradhoeffner.commons;
<|file_name|>IdentitySieve.java<|end_file_name|><|fim▁begin|>package it.unimi.di.law.bubing.sieve; /* * Copyright (C) 2010-2017 Paolo Boldi, Massimo Santini, and Sebastiano Vigna * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. ...
*/ public final class IdentitySieve<K, V> extends AbstractSieve<K, V> { public IdentitySieve(final NewFlowReceiver<K> newFlowReceiver, final ByteSerializerDeserializer<K> keySerDeser, final ByteSerializerDeserializer<V> valueSerDeser, final AbstractHashFunction<K> hashingStrategy, final UpdateStrategy<K, V> updateSt...
<|file_name|>keyframes.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/. */ use cssparser::{AtRuleParser, Parser, QualifiedRuleParser, ...
<|file_name|>main.js<|end_file_name|><|fim▁begin|>// @flow /* eslint-env node */ /* global Restivus */ // Import Meteor :3 and Mongo :3 import { Meteor } from 'meteor/meteor' // Import fs and path to access the filesystem. And mime to get MIMETypes. import { readdirSync, lstatSync, readFileSync } from 'fs' imp...
const mimetype = lookup(this.urlParams._filePath)
<|file_name|>pagination.rs<|end_file_name|><|fim▁begin|>pub trait PaginatedRequestor { type Item: 'static + Clone; type Error: 'static; fn next_page(&mut self) -> Result<Option<Vec<Self::Item>>, Self::Error>; } pub struct PaginatedIterator<'a, TR: PaginatedRequestor> { requestor: TR, current_page: ...
<|file_name|>service.py<|end_file_name|><|fim▁begin|># Copyright 2011 OpenStack Foundation # 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://w...
elif deleted_q in ['false']: deleted = False clustered_q = req.GET.get('include_clustered', '').lower() include_clustered = clustered_q == 'true'
<|file_name|>amberrst.py<|end_file_name|><|fim▁begin|>############################################################################## # MDTraj: A Python Library for Loading, Saving, and Manipulating # Molecular Dynamics Trajectories. # Copyright 2012-2014 Stanford University and the Authors # # Authors: Jason Sw...
<|file_name|>global-helpers.js<|end_file_name|><|fim▁begin|>import {Utils} from "../service/Utils"; Template.registerHelper( "displayHours", function (date) { return new moment(date).format("H[h]"); } ); Template.registerHelper( "displayHoursMinute", function (date) { return new moment(date).format("H[h]...
<|file_name|>ui_role_list_item.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python """Test to verify presentation of selectable list items.""" from macaroon.playback import * import utils sequence = MacroSequence() sequence.append(KeyComboAction("<Control><Shift>n")) sequence.append(KeyComboAction("Tab")) sequence.a...
sequence.append(utils.StartRecordingAction()) sequence.append(KeyComboAction("Right"))
<|file_name|>Oracle12cGetGeneratedKeysDelegate.java<|end_file_name|><|fim▁begin|>/* * Hibernate, Relational Persistence for Idiomatic Java * * License: GNU Lesser General Public License (LGPL), version 2.1 or later. * See the lgpl.txt file in the root directory or <http://www.gnu.org/licenses/lgpl-2.1.html>. */ pa...
.getJdbcCoordinator()
<|file_name|>host_path_windows.go<|end_file_name|><|fim▁begin|>/* Copyright 2017 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2...
switch mode & syscall.S_IFMT { case syscall.S_IFSOCK:
<|file_name|>server.js<|end_file_name|><|fim▁begin|>process.env.NODE_ENV = process.env.NODE_ENV || 'development' let express = require('express'); let path = require('path'); let favicon = require('serve-favicon'); let logger = require('morgan'); let cookieParser = require('cookie-parser'); let bodyParser = require('b...
<|file_name|>deep.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/licenses/L...
<|file_name|>main.go<|end_file_name|><|fim▁begin|>// A golang implementation of the acme factory examples from python and Java APIs // // The python implementation is in mmv.py in PCP core // (https://github.com/performancecopilot/pcp/blob/master/src/python/pcp/mmv.py#L21-L70) // // The Java implementation is in exampl...
// // To run the java version of the example that runs forever, simply add a --forever // flag
<|file_name|>RawSQLChange.java<|end_file_name|><|fim▁begin|>package liquibase.change.core; import liquibase.change.AbstractSQLChange; import liquibase.change.DatabaseChange; import liquibase.change.ChangeMetaData; /** * Allows execution of arbitrary SQL. This change can be used when existing changes are either...
public RawSQLChange(String sql) { setSql(sql);
<|file_name|>parser.py<|end_file_name|><|fim▁begin|># coding=utf8 """ Parser for todo format string.<|fim▁hole|> from todo.parser import parser parser.parse(string) # return an Todo instance """ from models import Task from models import Todo from ply import lex from ply import yacc class TodoLexer(object): ...
<|file_name|>nevers.rs<|end_file_name|><|fim▁begin|>use itertools::Itertools; use malachite_base::nevers::nevers; #[test] fn test_nevers() {<|fim▁hole|><|fim▁end|>
assert_eq!(nevers().collect_vec(), &[]); }
<|file_name|>GetDetectorModelAnalysisResultsRequest.java<|end_file_name|><|fim▁begin|>/* * Copyright 2017-2022 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with * the License. A copy of th...
} @Override public GetDetectorModelAnalysisResultsRequest clone() {
<|file_name|>protobufs.rs<|end_file_name|><|fim▁begin|>// This file is generated. Do not edit // @generated // https://github.com/Manishearth/rust-clippy/issues/702 #![allow(unknown_lints)] #![allow(clippy)] #![cfg_attr(rustfmt, rustfmt_skip)] #![allow(box_pointers)] #![allow(dead_code)] #![allow(non_camel_case_type...
self.sender.take().unwrap_or_else(|| ::std::string::String::new())
<|file_name|>Conga.ts<|end_file_name|><|fim▁begin|>///<reference path="../definitions/waa.d.ts" /> ///<reference path="Instrument.ts" /> module audiobus.instruments { export class Conga extends Instrument { private osc2:OscillatorNode; // create constructor( audioContext:AudioContext, outputTo:GainNode...
this.osc2 = audioContext.createOscillator(); this.osc2.type = OscillatorType.sine;
<|file_name|>progressevent.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/. */ use dom::bindings::codegen::Bindings::EventBinding::Eve...
}
<|file_name|>base.js<|end_file_name|><|fim▁begin|>/** * Base js functions */ $(document).ready(function(){ //Init jQuery Masonry layout init_masonry(); //Select menu onchange $("#collapsed-navbar").change(function () { window.location = $(this).val(); }); }); function init_masonry(){ ...
$container.imagesLoaded( function(){
<|file_name|>models.py<|end_file_name|><|fim▁begin|>from django.db import models from django.contrib.auth.models import User from police.models import Stationdata class general_diary(models.Model): ref_id = models.CharField(max_length=40,unique=True,default="00000") firstname = models.CharField(max_length=20) ...
<|file_name|>states.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- # __author__ = chenchiyuan from __future__ import division, unicode_literals, print_function from hawaii.apps.weixin.models import App from hawaii.apps.weixin.response import MessageResponse, EventResponse from hawaii.apps.weixin.weixin.interf...
class NoCacheState(StateInterface): def __init__(self, *args, **kwargs):
<|file_name|>hilbert_algo.js<|end_file_name|><|fim▁begin|>var hilbert = (function() { // From Mike Bostock: http://bl.ocks.org/597287 // Adapted from Nick Johnson: http://bit.ly/biWkkq var pairs = [ [[0, 3], [1, 0], [3, 1], [2, 0]], [[2, 1], [1, 1], [3, 0], [0, 2]], [[2, 2], [3, 3], ...
}
<|file_name|>display_utils.js<|end_file_name|><|fim▁begin|>/* Copyright 2015 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/LI...
* parts of the date string).
<|file_name|>plan.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- ### required - do no delete @auth.requires_login() def plan(): return dict() def new(): form = SQLFORM.factory(db.contacts,db.groups) if form.accepts(request.vars): _id_user = db.contacts.insert(**db.contacts._filter_...
form.vars.contact = _id_user id = db.groups.insert(**db.groups._filter_fields(form.vars))
<|file_name|>health.py<|end_file_name|><|fim▁begin|># Copyright 2015, 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 must retain the above c...
the status of the service """ with self._server_status_lock:
<|file_name|>ScaleImage.java<|end_file_name|><|fim▁begin|>package com.newppt.android.ui; import com.newppt.android.data.AnimUtils2; import android.content.Context; import android.util.AttributeSet; import android.view.MotionEvent; import android.widget.ImageView; public class ScaleImage extends ImageView { final pr...
firClick = System.currentTimeMillis(); x = event.getX(); y = event.getY();
<|file_name|>utils.py<|end_file_name|><|fim▁begin|>import re from exchange.constants import ( CURRENCIES, CURRENCY_NAMES, DEFAULT_CURRENCY, CURRENCY_EUR, CURRENCY_UAH, CURRENCY_USD, CURRENCY_SESSION_KEY) def round_number(value, decimal_places=2, down=False): assert decimal_places > 0...
append_comma = lambda match_object: "%s," % match_object.group(0) value = "%.2f" % float(value) value = re.sub("(\d)(?=(\d{3})+\.)", append_comma, value)
<|file_name|>dictionary-add.js<|end_file_name|><|fim▁begin|>function dictionaryAddCtrl($scope, DictService, $state) { $scope.$emit("update-title", { pageTitle: "字典列表", links: [ { url: "common.dictionary-list", name: "字典列表" }, { ...
$scope.save = function () {
<|file_name|>test_cassandra_backend.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- import unittest from datetime import datetime from unittest.mock import call from uuid import uuid4, UUID from mock import patch, MagicMock from alamo_worker.alerter.backend.cassandra import ( CassandraDriver, SELECT_QUERY...
<|file_name|>index.js<|end_file_name|><|fim▁begin|>'use strict' if (!process.addAsyncListener) require('async-listener') var noop = function () {} module.exports = function () { return new AsyncState() } function AsyncState () { var state = this process.addAsyncListener({ create: asyncFunctionInitialized...
<|file_name|>frameobject.rs<|end_file_name|><|fim▁begin|>use libc::c_int; use crate::code::{PyCodeObject, CO_MAXBLOCKS}; use crate::object::*; use crate::pyport::Py_ssize_t; use crate::pystate::PyThreadState; #[repr(C)] #[derive(Copy, Clone)] pub struct PyTryBlock { pub b_type: c_int, pub b_handler: c_int, ...
pub fn PyFrame_ClearFreeList() -> c_int; pub fn PyFrame_GetLineNumber(f: *mut PyFrameObject) -> c_int;
<|file_name|>cfg_setting_imgsensor.cpp<|end_file_name|><|fim▁begin|>/* Copyright Statement: * * This software/firmware and related documentation ("MediaTek Software") are * protected under relevant copyright laws. The information contained herein * is confidential and proprietary to MediaTek Inc. and/or its licenso...
/******************************************************************************* * Sensor Placement Facing Direction * Return:
<|file_name|>562.cpp<|end_file_name|><|fim▁begin|>#include <iostream> #include <algorithm> #include <numeric> /*<|fim▁hole|> int T, n; int coins[105]; int f[50005]; int main() { cin >> T; while (T-- > 0) { cin >> n; fill(f, f + 50005, 0); for (int i = 0; i < n; ++i) cin >> ...
* 原来是自己在初始化f数组时长度没有指定好。233 */ using namespace std;
<|file_name|>http_loader.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/. */ use cookie_rs::Cookie as CookiePair; use devtools_traits:...
assert_eq!(read_response(&mut response), "Yay!"); }
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- #------------------------------------------------------------------------------ # file: $Id$ # auth: metagriffin <mg.github@uberdev.org> # date: 2012/04/20 # copy: (C) Copyright 2012-EOT metagriffin -- see LICENSE.txt #-----------------------...
from .tracker import * from .merger import *
<|file_name|>exceptions.py<|end_file_name|><|fim▁begin|>from django.contrib import messages from django.core.exceptions import PermissionDenied class UploadPermissionDenied(PermissionDenied):<|fim▁hole|> def __init__(self, request, log_func, error_message, *args, **kwargs): log_func(error_message) ...
<|file_name|>server.py<|end_file_name|><|fim▁begin|># coding=UTF-8 from __future__ import absolute_import from __future__ import division from __future__ import print_function from __future__ import unicode_literals #import tornado from tornado import ioloop , web , httpserver , websocket , options #import handler ...
<|file_name|>Basis.py<|end_file_name|><|fim▁begin|>import numpy as np class Basis(object): __resolution = 1E-9 __eqdecimals = 9 # how many decimals to round off to for relative coordinates def __init__(self, basis=None, transform=None): if basis is not None: self.origin = basis.origin...
def e_k(self): return np.asarray(self.matrix[2,:])[0]
<|file_name|>test_variable.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- # # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this...
# specific language governing permissions and limitations # under the License. import unittest
<|file_name|>rackspace.go<|end_file_name|><|fim▁begin|>/* Copyright 2014 The Kubernetes 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.org/licens...
type Config struct {
<|file_name|>Or.java<|end_file_name|><|fim▁begin|>package sabstracta; /** * Represents an or operation in the syntax tree. * */ public class Or extends ExpresionBinariaLogica { public Or(Expresion _izq, Expresion _dch) { super(_izq, _dch); } /** <|fim▁hole|> protected String getInst() { return "...
* Returns the instruction code. */ @Override
<|file_name|>address_resolver.py<|end_file_name|><|fim▁begin|># Rekall Memory Forensics # Copyright 2014 Google Inc. All Rights Reserved. # # 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; either...
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # General Public License for more details. # # You should have received a copy of the GNU General Public License
<|file_name|>transform_hex_multine.py<|end_file_name|><|fim▁begin|>#! /usr/bin/python3 import sys MAXLINELEN = 80 TABLEN = 8 # 3 for two quotes and a comma FIRSTLINELEN = MAXLINELEN - TABLEN - 3 OTHERLINELEN = FIRSTLINELEN - 2 * TABLEN FIRSTLINEBYTES = FIRSTLINELEN // 2 OTHERLINEBYTES = OTHERLINELEN // 2 def fix_l...
for line in data: f.write("\t\"{}\"".format(fix_line(line[:FIRSTLINEBYTES])))
<|file_name|>treeModel.test.ts<|end_file_name|><|fim▁begin|>/*--------------------------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. See License.txt in the project root for license information. *---...
assert.equal(nav.next()!.id, 'b');
<|file_name|>OggStream.cpp<|end_file_name|><|fim▁begin|>// // C++ Implementation: Audio::OggStream // #include "config.h" #ifdef HAVE_OGG #include "OggStream.h" #include "OggData.h" #include "config.h" #include <utility> #include <limits> #include <stdlib.h> #include <vorbis/vorbisfile.h> #include "vsfilesystem.h"...
} void OggStream::seekImpl(double position) throw(Exception)
<|file_name|>rock_paper_scissors.go<|end_file_name|><|fim▁begin|>// The MIT License (MIT) // Copyright (c) 2014 Philipp Neugebauer package main import ( "bufio" "fmt" "os" "math/rand" "strconv" ) func computer(inputChannel chan int, resultChannel chan string){ for human_choice := range inputCh...
text, _ := reader.ReadString('\n') choice, _ := strconv.Atoi(text)
<|file_name|>_meta.py<|end_file_name|><|fim▁begin|>import _plotly_utils.basevalidators <|fim▁hole|> class MetaValidator(_plotly_utils.basevalidators.AnyValidator): def __init__(self, plotly_name="meta", parent_name="surface", **kwargs): super(MetaValidator, self).__init__( plotly_name=plotly_nam...
<|file_name|>kit.cpp<|end_file_name|><|fim▁begin|>// // kit.cpp // Neo4j-cpp-driver // // Created by skyblue on 2017/7/9. // Copyright © 2017年 skyblue. All rights reserved. // #include "kit.hpp" #include <sstream> namespace neo4jDriver { //Neo4j工具包 std::string Kit::getStatusCode(std::string httpHead...
size_t begin = nodeOrRelationshipSelf.find_last_of("/"); std::string idString = nodeOrRelationshipSelf.substr(begin + 1, nodeOrRelationshipSelf.length()); std::stringstream sstream;
<|file_name|>command_list.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python # Copyright 2016 Criteo # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License.<|fim▁hole|># # Unless required by applicable law or agreed to in writing, softwar...
# You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0
<|file_name|>generic_utils.py<|end_file_name|><|fim▁begin|># Copyright 2015 The TensorFlow 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.apa...
<|file_name|>count_islands.py<|end_file_name|><|fim▁begin|>""" A 2d grid map of m rows and n columns is initially filled with water. We may perform an addLand operation which turns the water at position (row, col) into a land. Given a list of positions to operate, count the number of islands after each addLand operatio...
0 1 0 """
<|file_name|>GithubFile.ts<|end_file_name|><|fim▁begin|>/** * Swaggy Jenkins * Jenkins API clients generated from Swagger / Open API specification * * The version of the OpenAPI document: 1.1.2-pre.0 * Contact: blah@cliffano.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generat...
import * as models from './models'; export interface GithubFile { "content"?: models.GithubContent;
<|file_name|>status-completed.js<|end_file_name|><|fim▁begin|>sap.ui.define(['sap/ui/webc/common/thirdparty/base/asset-registries/Icons'], function (Icons) { 'use strict'; const name = "status-completed"; const pathData = "M256 0q53 0 99.5 20T437 75t55 81.5 20 99.5-20 99.5-55 81.5-81.5 55-99.5 20-99.5-20T75 437t-55-...
const ltr = false;
<|file_name|>Css2Properties.ts<|end_file_name|><|fim▁begin|>/// <reference path="Css1Properties.ts" /> module xlib.ui.element.elements { <|fim▁hole|> borderCollapse?: any; borderSpacing?: any; bottom?: any; captionSide?: any; clip?: any; content?: any; counterIncrement?: any; counterRese...
export interface Css2Properties extends Css1Properties {
<|file_name|>dom_html_form_element.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::DOMElement; use crate::DOMEventTarget; use crate::DOMHTMLCollection; use crate::DOMHTMLElement; use ...
Some(transmute::<_, unsafe extern "C" fn()>(
<|file_name|>exec_test.go<|end_file_name|><|fim▁begin|>package exec import ( "bytes" "os/exec" "runtime" "testing" <|fim▁hole|>) func TestRun(t *testing.T) { if runtime.GOOS == "windows" { t.Skip("Windows. Not running this test.") } if _, err := exec.LookPath("echo"); err != nil { t.Skipf("echo not found,...
"github.com/hashicorp/otto/ui"