prompt
large_stringlengths
70
991k
completion
large_stringlengths
0
1.02k
<|file_name|>0006_orderingcompany.py<|end_file_name|><|fim▁begin|><|fim▁hole|> class Migration(migrations.Migration): dependencies = [ ('quotation', '0005_auto_20150828_2207'), ] operations = [ migrations.CreateModel( name='Orderingcompany', fields=[ ...
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations
<|file_name|>if.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python3 number = 23 guess = int(input('Enter an integer : ')) if guess == number: # 新块从这里开始 print('Congratulations, you guessed it.')<|fim▁hole|> print('No, it is a little higher than that') # 你可以在此做任何你希望在该代码块内进行的事情 else: print('No, it is a little low...
print('(but you do not win any pizzas!)') # 新块在这里结束 elif guess < number: # 另一代码块
<|file_name|>google-drive-picker.js<|end_file_name|><|fim▁begin|>/** ! * Google Drive File Picker Example * By Daniel Lo Nigro (http://dan.cx/) */ (function () { /** * Initialise a Google Driver file picker */ var FilePicker = window.FilePicker = function (options) { // Config this.apiKey = options...
<|file_name|>Check_Group.py<|end_file_name|><|fim▁begin|>## This file is part of CDS Invenio. ## Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007, 2008 CERN. ## ## CDS 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 Soft...
from invenio.dbquery import run_sql from invenio.websubmit_config import InvenioWebSubmitFunctionStop def Check_Group(parameters, curdir, form, user_info=None):
<|file_name|>base.js<|end_file_name|><|fim▁begin|>$(document).ready(function () { // Open contact modal $('.contact').click(function(){ $('#contactModal').modal('toggle', { keyboard: false }).on('shown.bs.modal', function(){ var form = $('#ContactForm'); ...
} else { //Not valid information
<|file_name|>OpenCdnService.go<|end_file_name|><|fim▁begin|>package cdn import ( . "aliyun-openapi-go-sdk/core" "strconv" ) type OpenCdnServiceRequest struct { RpcRequest OwnerId int ResourceOwnerAccount string ResourceOwnerId int InternetChargeType string } func (r *OpenCdnServiceRequest)...
} func (r *OpenCdnServiceRequest) GetInternetChargeType() string { return r.InternetChargeType }
<|file_name|>abdt_repooptions.py<|end_file_name|><|fim▁begin|>"""Per-repository configuration options.""" # ============================================================================= # CONTENTS # ----------------------------------------------------------------------------- # abdt_repooptions # # Public Classes: # ...
<|file_name|>modal.js<|end_file_name|><|fim▁begin|>(function (global, factory) { if (typeof define === 'function' && define.amd) { define(['exports', 'module', './util'], factory); } else if (typeof exports !== 'undefined' && typeof module !== 'undefined') { factory(exports, module, require('./util')); } ...
<|file_name|>glyph_renderer.ts<|end_file_name|><|fim▁begin|>import {DataRenderer, DataRendererView} from "./data_renderer" import {LineView} from "../glyphs/line" import {Glyph, GlyphView} from "../glyphs/glyph" import {ColumnarDataSource} from "../sources/columnar_data_source" import {Scale} from "../scales/scale" imp...
this.prototype.default_view = GlyphRendererView this.define<GlyphRenderer.Props>({ data_source: [ p.Instance ],
<|file_name|>UpdateMobileUnit.js<|end_file_name|><|fim▁begin|>Ext.define('sisprod.view.MobileUnit.UpdateMobileUnit', { extend: 'sisprod.view.base.BaseDataWindow', alias: 'widget.updateMobileUnit', messages: { basicDataTitle: 'Basic Data', componentsTitle: 'Allocation of Components', ...
textTransform: 'uppercase' }, labelWidth: 120,
<|file_name|>audiovis_rhn.py<|end_file_name|><|fim▁begin|>from funktional.layer import Layer, Dense, StackedGRU, StackedGRUH0, Convolution1D, \ Embedding, OneHot, clipped_rectify, sigmoid, steeper_sigmoid, tanh, CosineDistance,\ last, softmax3d, params, Attenti...
with context.context(training=False): rep = self.Encode(*self.inputs)
<|file_name|>wsgi.py<|end_file_name|><|fim▁begin|>""" WSGI config for gevsckio project. It exposes the WSGI callable as a module-level variable named ``application``. For more information on this file, see https://docs.djangoproject.com/en/1.6/howto/deployment/wsgi/ """ import os os.environ.setdefault("DJANGO_SETTIN...
<|file_name|>test_optional.py<|end_file_name|><|fim▁begin|>from __future__ import absolute_import import unittest import types if __name__ == "__main__": from optional import * #imports from package, not sub-module else: from .optional import * from .nulltype import * class TestNullType(unittest.TestCase)...
lambda: deoption(NotPassed) ) if __name__ == "__main__":
<|file_name|>filesystem.rs<|end_file_name|><|fim▁begin|>use std::path::Path; use std::fs::File; use std::io::prelude::*; use std::env; pub fn check_extension(path: &Path, valid_ext: &[&str]) -> bool { let ext = &path.extension().expect("The file has no extension").to_str().expect("Extension is not valid utf8"); ...
};
<|file_name|>katex_init.js<|end_file_name|><|fim▁begin|>var elements = document.getElementsByTagName('script') <|fim▁hole|> // Create span for KaTeX var katexElement = document.createElement('span'); katexElement.style = "text-align:center"; // Support inline and display math if (element.type....
Array.prototype.forEach.call(elements, function(element) { if (element.type.indexOf('math/tex') != -1) { // Extract math markdown var textToRender = element.innerText || element.textContent;
<|file_name|>_upload_helper.py<|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. # -------------------------...
resource='file', path_http_headers=path_http_headers, properties=properties, modified_access_conditions=modified_access_conditions,
<|file_name|>setup.py<|end_file_name|><|fim▁begin|>""" # setup module """ import os from setuptools import setup, find_packages HERE = os.path.abspath(os.path.dirname(__file__)) with open(os.path.join(HERE, 'README.md')) as f: README = f.read() # with open(os.path.join(HERE, 'CHANGES.txt')) as f: # CHANGES =...
include_package_data=True, zip_safe=False, install_requires=PREQ, tests_require=PREQ_DEV,
<|file_name|>chrome-extension.js<|end_file_name|><|fim▁begin|>const {app, ipcMain, webContents, BrowserWindow} = require('electron') const {getAllWebContents} = process.atomBinding('web_contents') const renderProcessPreferences = process.atomBinding('render_process_preferences').forAllWebContents() const {Buffer} = re...
<|file_name|>mod.rs<|end_file_name|><|fim▁begin|>pub type c_long = i32; pub type c_ulong = u32; pub type nlink_t = u32; pub type blksize_t = ::c_long; pub type __u64 = ::c_ulonglong; s! { pub struct pthread_attr_t { __size: [u32; 9] } pub struct sigset_t { __val: [::c_ulong; 32], } ...
<|file_name|>attr-stmt-expr.rs<|end_file_name|><|fim▁begin|>// Copyright 2018 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/...
<|file_name|>overalloc.py<|end_file_name|><|fim▁begin|><|fim▁hole|> tp = (n>>4) + (n>>3) if tp < 64: tp = 64 if tp > 2048: tp = 2048 print[n,tp] for x in range(0, 9999, 512): d(x)<|fim▁end|>
def d(n):
<|file_name|>views.py<|end_file_name|><|fim▁begin|>from django.contrib.auth.decorators import login_required from django.core.exceptions import PermissionDenied, ValidationError from django.core.urlresolvers import reverse_lazy from django.http import HttpResponseRedirect from django.utils.decorators import method_deco...
def get_context_data(self, **kwargs):
<|file_name|>sentry.py<|end_file_name|><|fim▁begin|># Ivysalt's sentry module. It keeps track of people who join and leave a chat. # LICENSE: This single module is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License. # @category Tools # @copyright Copyright (c) 2018 dpc #...
if (ctx.message.server.id in joinleave_data): joinleave_data[ctx.message.server.id]["announce_channel"] = "" yield from self.bot.say("Removed announce channel for this server.") else:
<|file_name|>privacy-early.rs<|end_file_name|><|fim▁begin|>// edition:2018 #![feature(decl_macro)] mod foo { fn f() {} macro f() {} pub macro m() { use f as g; //~ ERROR `f` is private, and cannot be re-exported f!(); } } <|fim▁hole|>}<|fim▁end|>
fn main() { foo::m!();
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|># Copyright (C) 2018 - TODAY, Pavlov Media # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).<|fim▁hole|><|fim▁end|>
from . import models from . import wizards
<|file_name|>lib.rs<|end_file_name|><|fim▁begin|>/* * Copyright (c) Facebook, Inc. and its affiliates. * * This software may be used and distributed according to the terms of the * GNU General Public License version 2. */ #![allow(non_camel_case_types)] use clidispatch::io::IO; use cpython::*; use cpython_ext::w...
let mut io = IO::new(fin, fout, ferr); Ok(hgcommands::run_command(args, &mut io)) }
<|file_name|>__openerp__.py<|end_file_name|><|fim▁begin|># -*- encoding: utf-8 -*- ############################################################################## # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as published # ...
<|file_name|>test_add.py<|end_file_name|><|fim▁begin|># (C) British Crown Copyright 2014, Met Office # # This file is part of Iris. # # Iris is free software: you can redistribute it and/or modify it under # the terms of the GNU Lesser General Public License as published by the<|fim▁hole|># Free Software Foundation, ei...
<|file_name|>L0.ts<|end_file_name|><|fim▁begin|>/// <reference path="../definitions/mocha.d.ts"/> /// <reference path="../definitions/node.d.ts"/> /// <reference path="../definitions/Q.d.ts"/> import Q = require('q'); import assert = require('assert'); import path = require('path'); import fs = require('fs'); describ...
var psFiles: string[] = [];
<|file_name|>sync.addressbook.groupdav.js<|end_file_name|><|fim▁begin|>/* sync.addressbook.groupdav.js - This file is part of "SOGo Connector", a Thunderbird extension. * * Copyright: Inverse inc., 2006-2014 * Email: support@inverse.ca * URL: http://inverse.ca * * "SOGo Connector" is free software; you ...
<|file_name|>ja.js<|end_file_name|><|fim▁begin|>/** * @license Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license */ CKEDITOR.plugins.setLang( 'uploadwidget', 'ja', { abort: 'アップロードを中止しました。', doneOne: 'ファイル...
uploadOne: 'ファイルのアップロード中 ({percentage}%)...', uploadMany: '{max} 個中 {current} 個のファイルをアップロードしました。 ({percentage}%)...' } );
<|file_name|>versiongroup.go<|end_file_name|><|fim▁begin|>package servicefabric // 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 Li...
preparer := autorest.CreatePreparer( autorest.AsGet(), autorest.WithBaseURL(client.BaseURI),
<|file_name|>game.py<|end_file_name|><|fim▁begin|>from gameinfo import * from porkglobals import * def genGameMap(): """This is an "abstract function" to hold this docstring and information. A GameMap function defines Places and connects all the Places it defines in a graph, but simpler graph than Comman...
<|file_name|>admin.py<|end_file_name|><|fim▁begin|>from django.contrib import admin from workflow.models import State, StateLog, NextState, Project, Location from workflow.activities import StateActivity class NextStateInline(admin.StackedInline): model = NextState fk_name = 'current_state' extra = 0 c...
admin.site.register(StateLog, StateLogAdmin) admin.site.register(Project)
<|file_name|>Installation.spec.js<|end_file_name|><|fim▁begin|>/* * Copyright (c) 2013 Adobe Systems Incorporated. All rights reserved. * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Softwa...
* and/or sell copies of the Software, and to permit persons to whom the
<|file_name|>admin.js<|end_file_name|><|fim▁begin|>//= require_self //= require spree/backend/handlebars_extensions //= require spree/backend/variant_autocomplete //= require spree/backend/taxon_autocomplete //= require spree/backend/option_type_autocomplete //= require spree/backend/user_picker //= require spree/backe...
$(this).one("mouseleave", function() { tr.removeClass(klass);
<|file_name|>test_graphite.py<|end_file_name|><|fim▁begin|>"""The tests for the Graphite component.""" import socket import unittest from unittest import mock import blumate.core as ha import blumate.components.graphite as graphite from blumate.const import ( EVENT_STATE_CHANGED, EVENT_BLUMATE_START, EVENT_BLU...
} self.assertFalse(graphite.setup(self.hass, config)) self.assertFalse(mock_gf.called)
<|file_name|>string1.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python -tt # Copyright 2010 Google Inc. # Licensed under the Apache License, Version 2.0 # http://www.apache.org/licenses/LICENSE-2.0 <|fim▁hole|># http://code.google.com/edu/languages/google-python-class/ # Basic string exercises # Fill in the code for t...
# Google's Python Class
<|file_name|>setup.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python # -*- coding: utf-8 -*- # Author: borja@libcrack.so # Date: Wed Jan 28 16:35:57 CET 2015 import re import os try: from setuptools import setup except ImportError: from distutils.core import setup def read(relpath): """ Return st...
'long_description': LONG_DESCRIPTION, 'author': AUTHOR, 'author_email': EMAIL,
<|file_name|>AccumuloRowId.java<|end_file_name|><|fim▁begin|>package mil.nga.giat.geowave.accumulo; import java.nio.ByteBuffer; import java.util.Arrays; import org.apache.accumulo.core.data.Key; /** * This class encapsulates the elements that compose the row ID in Accumulo, and * can serialize and deserialize the ...
<|file_name|>apps.py<|end_file_name|><|fim▁begin|>"""App name""" <|fim▁hole|> class CertificateEngineConfig(AppConfig): name = "certificate_engine"<|fim▁end|>
from django.apps import AppConfig
<|file_name|>_web_application_firewall_policies_operations.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 lic...
self, resource_group_name: str, policy_name: str, parameters: "_models.WebApplicationFirewallPolicy",
<|file_name|>day09.rs<|end_file_name|><|fim▁begin|>extern crate permutohedron; extern crate pcre; use std::fs::File; use std::io::BufReader; use std::io::BufRead; use std::collections::{HashMap, HashSet}; use std::cmp::{min, max}; use permutohedron::Heap;<|fim▁hole|> let f = File::open("day9.in").unwrap(); let ...
use pcre::Pcre; fn main() {
<|file_name|>test_download.py<|end_file_name|><|fim▁begin|>import cStringIO import os import tarfile import zipfile def test_download(data_builder, file_form, as_admin, api_db): project = data_builder.create_project(label='project1') session = data_builder.create_session(label='session1') session2 = data_...
<|file_name|>ConnectionCreateCommand.java<|end_file_name|><|fim▁begin|>package components.diagram.edit.commands; import org.eclipse.core.commands.ExecutionException; import org.eclipse.core.runtime.IAdaptable; import org.eclipse.core.runtime.IProgressMonitor; import org.eclipse.emf.ecore.EObject; import org.eclipse.gm...
if (!canExecute()) {
<|file_name|>test_auth_ldap.py<|end_file_name|><|fim▁begin|>import logging import os import unittest from unittest.mock import Mock, patch from flask import Flask from flask_appbuilder import AppBuilder, SQLA from flask_appbuilder.security.manager import AUTH_LDAP import jinja2 import ldap from mockldap import MockLda...
# validate - user was given the correct attributes (read from LDAP) self.assertEqual(user.first_name, "Alice") self.assertEqual(user.last_name, "Doe")
<|file_name|>avatar-button.cpp<|end_file_name|><|fim▁begin|>/* * Button representing user's Avatar * * Copyright (C) 2011 Martin Klapetek <martin.klapetek@gmail.com> * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as publis...
QImage selectedImage = widget->selectedImage(); if (selectedImage.width() > maxWidth || selectedImage.height() > maxHeight) {
<|file_name|>ShortcutManager.java<|end_file_name|><|fim▁begin|>/* Copyright 2012-2016 Michael Pozhidaev <michael.pozhidaev@gmail.com> This file is part of LUWRAIN. LUWRAIN is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Fr...
if (name == null || name.trim().isEmpty()) return false; if (shortcuts.containsKey(name))
<|file_name|>list_cdn_cache_invalidations.py<|end_file_name|><|fim▁begin|># Copyright 2016 Google Inc. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.a...
utils.RaiseToolException( errors, error_message='Could not fetch resource:')
<|file_name|>cmp_fn_imps.hpp<|end_file_name|><|fim▁begin|>// -*- C++ -*- // Copyright (C) 2005-2014 Free Software Foundation, Inc. // // This file is part of the GNU ISO C++ Library. This library is free // software; you can redistribute it and/or modify it under the terms // of the GNU General Public License as publ...
// Copyright (C) 2004 Ami Tavory and Vladimir Dreizin, IBM-HRL.
<|file_name|>serializers.py<|end_file_name|><|fim▁begin|>from website.settings import DOMAIN as OSF_DOMAIN from website.settings import OSF_SUPPORT_EMAIL from osf.models import OSFUser from furl import furl def serialize_comment(comment): reports = [ serialize_report(user, report) for user, report...
'modified': comment.edited, 'is_deleted': comment.is_deleted, 'spam_status': comment.spam_status, 'reports': reports,
<|file_name|>apps.py<|end_file_name|><|fim▁begin|>from django.apps import AppConfig class ProxyConfig(AppConfig):<|fim▁hole|> name = 'geoq.proxy' verbose_name = 'GeoQ Proxy'<|fim▁end|>
<|file_name|>CategoryAxis.js<|end_file_name|><|fim▁begin|>/* * Copyright (c) 2001-2007, TIBCO Software Inc. * Use, modification, and distribution subject to terms of license. */ jsx3.require("jsx3.chart.Axis");jsx3.Class.defineClass("jsx3.chart.CategoryAxis",jsx3.chart.Axis,null,function(c,p){var ub={d:"h6",a:"align...
La=x-1;var fb=La+ga+Va;var pb=this.length/fb;var C=ga*pb;for(var
<|file_name|>gallery.js<|end_file_name|><|fim▁begin|><|fim▁hole|> for (var i = 0; i < result.data.length; i++) { UserFBAlbums.update({id: albumId}, {$addToSet: {'pictures': result.data[i]}}); } IonLoading.hide(); }; Template.gallery.events({ 'click .loadNext': function () { IonLoading.sho...
var albumId; var addPictures = function (result) { UserFBAlbums.update({id: albumId}, {$set: {'paging': result.paging}});
<|file_name|>prebind_cksum_command.py<|end_file_name|><|fim▁begin|>from utils.header import MagicField, Field from load_command import LoadCommandHeader, LoadCommandCommand <|fim▁hole|>class PrebindCksumCommand(LoadCommandHeader): ENDIAN = None FIELDS = ( MagicField('cmd', 'I', {LoadCommandCommand.COMMA...
<|file_name|>file.py<|end_file_name|><|fim▁begin|>my_file = open("/tmp/my_file", "w") my_file.write("Test string")<|fim▁hole|>my_file.close() my_file = open("/tmp/my_file", "r") content = my_file.read() my_file.close() if (content == "Test string"): print("OK") else: print("KO")<|fim▁end|>
<|file_name|>mesh_deformation.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python ## \file mesh_deformation.py # \brief Python script for doing the parallel deformation using SU2_DEF. # \author F. Palacios # \version 6.1.0 "Falcon" # # The current SU2 release has been coordinated by the # SU2 International Devel...
<|file_name|>test_volume_boot_pattern.py<|end_file_name|><|fim▁begin|># Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unle...
@test.services('compute', 'volume', 'image') def test_volume_boot_pattern(self): keypair = self.create_keypair()
<|file_name|>FocusTrapZone.Box.Example.scss.js<|end_file_name|><|fim▁begin|><|fim▁hole|>"use strict"; /* tslint:disable */ var load_themed_styles_1 = require("@microsoft/load-themed-styles"); var styles = {}; load_themed_styles_1.loadStyles([{ "rawString": ".ms-FocusTrapZoneBoxExample{border:dashed 1px #ababab}.ms-Focu...
<|file_name|>client.rs<|end_file_name|><|fim▁begin|>use std::io::prelude::*; use std::collections::BTreeMap; use std::time::Duration; use hyper::Client as HyperClient; use hyper::net::HttpsConnector; use hyper_native_tls::NativeTlsClient; use hyper::Url; use hyper::header::{Authorization, Bearer, ContentType}; use hyp...
<|file_name|>inject.js<|end_file_name|><|fim▁begin|>function injectScript(file, node) { var th = document.getElementsByTagName(node)[0]; var s = document.createElement('script'); s.setAttribute('type', 'text/javascript'); s.setAttribute('src', file); th.appendChild(s); }<|fim▁hole|>function injectSt...
<|file_name|>mica-study-timeline.js<|end_file_name|><|fim▁begin|>(function ($) { "use strict"; /** * Constructor * @constructor */ $.MicaTimeline = function (dtoParser, popupIdFormatter, useBootstrapTooltip) { this.parser = dtoParser; this.popupIdFormatter = popupIdFormatter; this.useBootst...
});
<|file_name|>main.go<|end_file_name|><|fim▁begin|>package main import ( "bufio" "fmt" "os" "os/exec" "strings" "sync" ) func checkError(err error, prefix string) { if err != nil { panic(fmt.Sprintf("%s %s", prefix, err.Error())) } } func cleanFeedbackLine(s string) (out string) { out = s out = strings.Tr...
} func main() { logger.Infolnf("Running version '%s'", Version)
<|file_name|>_container_registry_management_client.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 license inf...
await self._client.close() async def __aenter__(self) -> "ContainerRegistryManagementClient": await self._client.__aenter__()
<|file_name|>devicepluginopenweathermap.cpp<|end_file_name|><|fim▁begin|>/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * This file is part of guh. * * ...
\li country
<|file_name|>scheduler.go<|end_file_name|><|fim▁begin|>package scheduler import ( "fmt" "github.com/jonaz/astrotime" "os/exec" "strconv" "time" ) func isSunset(latitude float64, longitude float64) bool {<|fim▁hole|> if t.Hour() == time.Now().Hour() && t.Minute() == time.Now().Minute() { return true } return ...
t := astrotime.NextSunset(time.Now(), latitude, longitude) // tzname, _ := t.Zone() // fmt.Println(tzname) // fmt.Printf("The next sunrise is %d:%02d %s on %d/%d/%d.\n", t.Hour(), t.Minute(), tzname, t.Month(), t.Day(), t.Year())
<|file_name|>models.py<|end_file_name|><|fim▁begin|>from django.db import models class TimeStampedModel(models.Model): ''' Ab abstract base class model that provides self- updating 'created' and 'modified' fields. ''' created = models.DateTimeField(auto_now_add=True) modified...
abstract = True
<|file_name|>Route.ts<|end_file_name|><|fim▁begin|>import {Path, PathMatcher, IMatchResult} from './Path'; /** * Route * * @class Route */ export class Route { public currentRoute: Route; /** * The url paths of the route * * @type {Array<string>} */ public paths: Array<Path> = ...
*/
<|file_name|>setup.py<|end_file_name|><|fim▁begin|>#! /usr/bin/env python # # See README for usage instructions. import glob import os import subprocess import sys import platform # We must use setuptools, not distutils, because we need to use the # namespace_packages option for the "google" package. from setuptools i...
os.remove(filepath)
<|file_name|>forming_2D.py<|end_file_name|><|fim▁begin|># -*- coding: mbcs -*- from part import * from material import * from section import * from assembly import * from step import * from interaction import * from load import * from mesh import * from optimization import * from job import * from sketch import * from ...
), vector=(-8.148372, 2.25428, 0.0)) mdb.models[MODEL_NAME].rootAssembly.translate(instanceList=('upper_right_01-1', ), vector=(-7.402372, 2.25428, 0.0)) mdb.models[MODEL_NAME].rootAssembly.translate(instanceList=('upper_left_02-1',
<|file_name|>example1.py<|end_file_name|><|fim▁begin|># cs.???? = currentstate, any variable on the status tab in the planner can be used. # Script = options are # Script.Sleep(ms) # Script.ChangeParam(name,value) # Script.GetParam(name) # Script.ChangeMode(mode) - same as displayed in mode setup screen 'AUTO' ...
<|file_name|>day_8.rs<|end_file_name|><|fim▁begin|>use std::rc::Rc; use std::cell::RefCell; const SEGMENT_SIZE: usize = 16; type SegmentLink = Rc<RefCell<Segment>>; #[derive(PartialEq)] struct Segment { head: usize, tail: usize, items: [i32; SEGMENT_SIZE], next: Option<SegmentLink> } impl Segment { ...
pub struct ArrayLinkedQueue { first: Option<SegmentLink>, last: Option<SegmentLink>
<|file_name|>emulators.py<|end_file_name|><|fim▁begin|># encoding: utf-8 import os <|fim▁hole|> be suitable to use as the `Exe` field of a Steam shortcut""" # Normalizing the strings is just removing any leading/trailing quotes. # The beautiful thing is that strip does nothing if it doesnt contain quotes, # so ...
def emulator_rom_launch_command(emulator, rom): """Generates a command string that will launch `rom` with `emulator` (using the format provided by the user). The return value of this function should
<|file_name|>getText.py<|end_file_name|><|fim▁begin|>import re def getText(data): res = [] resString = "" pattern = re.compile(r"\(?M{0,4}(CM|CD|D?C{0,3})(XC|XL|L?X{0,3})(IX|IV|V?I{0,3})\)(.*?)\. *\n", re.I)<|fim▁hole|> iteratable = pattern.finditer(data) newPattern = re.compile(r"\(?M{0,4}CM|CD|D?C{0,3}XC|XL|L?X...
<|file_name|>BuilderSwitchPayload.java<|end_file_name|><|fim▁begin|>/*<|fim▁hole|> * 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 ...
* Copyright 2013, Google Inc.
<|file_name|>decorators.py<|end_file_name|><|fim▁begin|># Copyright (c) 2013 Oscar Campos <oscar.campos@member.fsf.org> # See LICENSE for more details """ .. module:: decorators :platform: Unix, Windows :synopsis: Decorators for SublimePython plugin .. moduleauthor:: Oscar Campos <oscar.campos@member.fsf.org>...
def debug(f):
<|file_name|>The-Coin-Change-Problem.py<|end_file_name|><|fim▁begin|><|fim▁hole|> table[0][i] = 1 for i in range(1, n+1): for j in range(m): x = table[i - S[j]][j] if i-S[j] >= 0 else 0 y = table[i][j-1] if j >= 1 else 0 table[i][j] = x + y ...
def count(S, m, n): table = [[0 for x in range(m)] for x in range(n+1)] for i in range(m):
<|file_name|>bilibili.py<|end_file_name|><|fim▁begin|># coding: utf-8 from __future__ import unicode_literals import re from .common import InfoExtractor from ..compat import compat_str from ..utils import ( int_or_none, unescapeHTML, ExtractorError, xpath_text, ) class BiliBiliIE(InfoExtractor): ...
<|file_name|>test_migration_volume_manager_extension_001_add_volumes_table.py<|end_file_name|><|fim▁begin|># Copyright 2015 Mirantis, 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 Lic...
<|file_name|>version.rs<|end_file_name|><|fim▁begin|>use std::collections::HashMap; use conduit::{Request, Response}; use conduit_router::RequestParams; use diesel; use diesel::pg::Pg; use diesel::pg::upsert::*; use diesel::prelude::*; use semver; use serde_json; use time::{Duration, Timespec, now_utc, strptime}; use ...
fn validate_license(&mut self, license_file: Option<&str>) -> CargoResult<()> { if let Some(ref license) = self.license { for part in license.split('/') {
<|file_name|>mod.rs<|end_file_name|><|fim▁begin|>#![cfg(any(target_os = "windows"))] use ContextError; use CreationError; use GlAttributes; use GlRequest; use GlProfile; use PixelFormat; use PixelFormatRequirements; use ReleaseBehavior; use Robustness; use Api; use self::make_current_guard::CurrentContextGuard; use ...
dwVisibleMask: 0,
<|file_name|>app.js<|end_file_name|><|fim▁begin|>'use strict'; var express = require('express'); var configurations = module.exports; var app = express.createServer(); var nconf = require('nconf'); var redis = require('redis'); var db = redis.createClient(); var settings = require('./settings')(app, configurations, ex...
app.get('/403', function(req, res, next){ err.status = 403;
<|file_name|>rolling-array-test.js<|end_file_name|><|fim▁begin|>import { isArray } from '@ember/array'; import { module, test } from 'qunit'; import RollingArray from 'nomad-ui/utils/classes/rolling-array'; module('Unit | Util | RollingArray', function() { test('has a maxLength property that gets set in the construc...
assert.deepEqual(
<|file_name|>PropertyConstants.js<|end_file_name|><|fim▁begin|>export const FILLPATTERN = { none: '', crossHatched: 'Crosshatched', hatched: 'Hatched', solid: 'Solid' }; export const STROKEPATTERN = { none: '', dashed: 'Dashed', dotted: 'Dotted', solid: 'Solid' }; <|fim▁hole|>export const ALTITUDEMODE ...
<|file_name|>shared.rs<|end_file_name|><|fim▁begin|>// Copyright 2015-2016, The Gtk-rs Project Developers. // See the COPYRIGHT file at the top-level directory of this distribution. // Licensed under the MIT license, see the LICENSE file or <https://opensource.org/licenses/MIT> //! `IMPL` Shared (reference counted) wr...
} #[doc(hidden)] impl $crate::translate::GlibPtrDefault for $name {
<|file_name|>reaction.rs<|end_file_name|><|fim▁begin|>use chrono::{offset::Utc, DateTime}; use diesel::{self, pg::PgConnection}; use super::Comment; use schema::reactions; use sql_types::ReactionType; #[derive(Debug, Identifiable, Queryable, QueryableByName)] #[table_name = "reactions"] pub struct Reaction { id: ...
<|file_name|>config.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python # -*- coding: utf-8 -*- # # async - A tool to manage and sync different machines # Copyright 2012,2013 Abdó Roig-Maranges <abdo.roig@gmail.com> # # This program is free software: you can redistribute it and/or modify # it under the terms of t...
# vim: expandtab:shiftwidth=4:tabstop=4:softtabstop=4:textwidth=80
<|file_name|>ListMockService.js<|end_file_name|><|fim▁begin|>/** * Copyright (C) 2005-2015 Alfresco Software Limited. * * This file is part of Alfresco * * Alfresco is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Sof...
} if (filters) { requestParams.filters = filters;
<|file_name|>fix_kwargs.py<|end_file_name|><|fim▁begin|>u""" Fixer for Python 3 function parameter syntax This fixer is rather sensitive to incorrect py3k syntax. """ # Note: "relevant" parameters are parameters following the first STAR in the list. from lib2to3 import fixer_base from lib2to3.fixer_util import token,...
# Now, we need to fix up the list of params. must_add_kwargs = remove_params(params_rawlist)
<|file_name|>tst_qfiledialog2.cpp<|end_file_name|><|fim▁begin|>/**************************************************************************** ** ** Copyright (C) 2016 The Qt Company Ltd. ** Contact: https://www.qt.io/licensing/ ** ** This file is part of the test suite of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:GPL-EXCE...
model()->removeRow(indexes.at(i).row()); } }; #endif
<|file_name|>index.js<|end_file_name|><|fim▁begin|>var parent = require('../../actual/array-buffer');<|fim▁hole|><|fim▁end|>
module.exports = parent;
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|>"""cellprofiler.gui.tests.__init__.py CellProfiler is distributed under the GNU General Public License. See the accompanying file LICENSE for details. Copyright (c) 2003-2009 Massachusetts Institute of Technology Copyright (c) 2009-2015 Broad Institute All rights ...
Website: http://www.cellprofiler.org """
<|file_name|>test_parse_mnist_fvec.py<|end_file_name|><|fim▁begin|>import unittest import random, sys, time, re sys.path.extend(['.','..','../..','py']) import h2o, h2o_cmd, h2o_browse as h2b, h2o_import as h2i, h2o_glm, h2o_util, h2o_rf class Basic(unittest.TestCase): def tearDown(self): h2o.check_sandbox...
csvFilelist = [ ("mnist_testing.csv.gz", 600),
<|file_name|>OSC_it_IT.ts<|end_file_name|><|fim▁begin|><?xml version="1.0" encoding="utf-8"?> <!DOCTYPE TS> <TS version="2.0" language="it_IT"> <context> <name>ConfigureOSC</name> <message> <location filename="configureosc.ui" line="14"/> <source>OSC Plugin Configuration</source> <oldsou...
<location filename="configureosc.cpp" line="82"/> <source>Outputs</source> <translation>Uscite</translation> </message>
<|file_name|>overrides.py<|end_file_name|><|fim▁begin|># 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 version 2 # of the License, or (at your option) any later version. # # This program ...
if len(builds) > 1: result = dict(overrides=overrides)
<|file_name|>admin.py<|end_file_name|><|fim▁begin|>from django import forms from django.contrib import admin from django.contrib.admin import ModelAdmin from guardian.admin import GuardedModelAdmin from uploader.projects.models import FileSystem, Project class FileSystemAdminForm(forms.ModelForm): class Meta: ...
class ProjectAdmin(GuardedModelAdmin): list_display = ('__unicode__', 'file_system', 'directory')
<|file_name|>webhook_test.go<|end_file_name|><|fim▁begin|>package buildconfig import ( "encoding/json" "errors" "fmt" "io/ioutil" "net/http" "net/http/httptest" "reflect" "strings" "testing" corev1 "k8s.io/api/core/v1" kerrors "k8s.io/apimachinery/pkg/api/errors" metav1 "k8s.io/apimachinery/pkg/apis/meta/...
!strings.Contains(responder.err.Error(), "unexpected hook subpath") {
<|file_name|>search-result.component.ts<|end_file_name|><|fim▁begin|>import { OfficeService } from './../service/office.service'; import { ImageQueryService } from '../service/image-query.service'; import { SearchResult } from '../service/search-result'; import { Component, Input, OnInit } from '@angular/core'; <|fim▁...
<|file_name|>Hand.java<|end_file_name|><|fim▁begin|><|fim▁hole|> ROCK, PAPER, SCISSORS; }<|fim▁end|>
package com.asayama.rps.simulator; public enum Hand {
<|file_name|>Test_Agent_SiteDirector.py<|end_file_name|><|fim▁begin|>""" Test class for SiteDirector """ # pylint: disable=protected-access # imports import datetime import pytest from mock import MagicMock from DIRAC import gLogger # sut from DIRAC.WorkloadManagementSystem.Agent.SiteDirector import SiteDirector m...
sd.rssClient = MagicMock()