prompt
large_stringlengths
70
991k
completion
large_stringlengths
0
1.02k
<|file_name|>accounts_items.py<|end_file_name|><|fim▁begin|># -*-coding: utf-8-*- import logging from pyramid.view import view_config, view_defaults from pyramid.httpexceptions import HTTPFound from . import BaseView from ..models import DBSession from ..models.account_item import AccountItem from ..lib.bl.subscript...
permission='add' ) def _copy(self):
<|file_name|>test_nsoltChannelConcatenation2dLayer.py<|end_file_name|><|fim▁begin|>import itertools import unittest from parameterized import parameterized import torch import torch.nn as nn from nsoltChannelConcatenation2dLayer import NsoltChannelConcatenation2dLayer nchs = [ [3, 3], [4, 4] ] datatype = [ torch.float...
<|file_name|>script.py<|end_file_name|><|fim▁begin|>"""Helpers to execute scripts.""" import logging from contextlib import suppress from itertools import islice from typing import Optional, Sequence import voluptuous as vol from homeassistant.core import HomeAssistant, Context, callback from homeassistant.const imp...
<|file_name|>csection.py<|end_file_name|><|fim▁begin|># coding=utf8 r""" csection.py -- Create a tree of contents, organized by sections and inside sections the exercises unique_name. AUTHOR: - Pedro Cruz (2012-01): initial version - Pedro Cruz (2016-03): improvment for smc An exercise could contain um its %...
<|file_name|>workerpool.go<|end_file_name|><|fim▁begin|>package fasthttp import ( "net" "runtime" "runtime/debug" "strings" "sync" "time" ) // workerPool serves incoming connections via a pool of workers // in FILO order, i.e. the most recently stopped worker will serve the next // incoming connection. // // Su...
panic("BUG: workerPool already started") } wp.stopCh = make(chan struct{})
<|file_name|>3_2_HelloWorld.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://ww...
mnist = input_data.read_data_sets("MNIST_data/", one_hot=True)
<|file_name|>supplier.js<|end_file_name|><|fim▁begin|>$(document).ready(function () { //selecting supplier // $('body').off('click','supplier_id.select_popup').on('click','supplier_id.select_popup' ,function () { // void window.open('select.php?class_name=supplier', '_blank', // 'width=1200,height=1000,TOOLBA...
if ($(this).val() == 'newentry') { if (confirm("Do you want to create a new supplier site?")) { $(this).replaceWith('<input id="supplier_site_name" class="textfield supplier_site_name" type="text" size="25" maxlength="50" name="supplier_site_name[]">');
<|file_name|>impl_gcd.py<|end_file_name|><|fim▁begin|>__author__ = 'Nishanth' from juliabox.cloud import JBPluginCloud from juliabox.jbox_util import JBoxCfg, retry_on_errors from googleapiclient.discovery import build from oauth2client.client import GoogleCredentials import threading class JBoxGCD(JBPluginCloud): ...
@staticmethod def configure():
<|file_name|>test_isotime.py<|end_file_name|><|fim▁begin|># Licensed to the StackStorm, Inc ('StackStorm') 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 You under the Apache ...
<|file_name|>world_script_loader.cpp<|end_file_name|><|fim▁begin|>/* * Copyright (C) 2008-2017 TrinityCore <http://www.trinitycore.org/> * * 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; ei...
AddSC_action_ip_logger(); // location: scripts\World\action_ip_logger.cpp AddSC_duel_reset(); }
<|file_name|>test_compressing_file_reader.py<|end_file_name|><|fim▁begin|># Copyright (c) 2010-2011 OpenStack, LLC. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.or...
# Unless required by applicable law or agreed to in writing, software
<|file_name|>_util.py<|end_file_name|><|fim▁begin|>import matplotlib.transforms import numpy <|fim▁hole|> def get_legend_text(obj): """Check if line is in legend.""" leg = obj.axes.get_legend() if leg is None: return None keys = [h.get_label() for h in leg.legendHandles if h is not None] v...
def has_legend(axes): return axes.get_legend() is not None
<|file_name|>Badge.tsx<|end_file_name|><|fim▁begin|>import React, {forwardRef} from 'react' import cn from 'classnames' import {Text} from '../Typography/Text' import type {HTMLAttributes, PropsWithRef} from 'react' import type {OmuiColors} from '@/styles/colorType' export type BadgeVariantProp = 'gray' | 'primary' | ...
export {Badge}
<|file_name|>quest.ts<|end_file_name|><|fim▁begin|>import Convolvr from "../../model/world"; import Component from "../../model/component"; export default class QuestSystem { private world: Convolvr; constructor (world: Convolvr) { this.world = world } init(component: Component) {...
} }
<|file_name|>context_managers.py<|end_file_name|><|fim▁begin|>"""useful context managers""" from contextlib import suppress with suppress(ModuleNotFoundError): from lag import * import os import contextlib def clog(*args, condition=True, log_func=print, **kwargs): if condition: return log_func(*args...
<|file_name|>timeline.js<|end_file_name|><|fim▁begin|>var events = {}; function showEvent(e) { eid = e.getAttribute('data-event-id'); fid = e.getAttribute('data-frame-id'); var url = '?view=event&eid='+eid+'&fid='+fid; url += filterQuery; window.location.href = url; //video element is blocking video eleme...
eventData.removeEvent('click'); eventData.addEvent('click', showEvent.pass()); }
<|file_name|>version.go<|end_file_name|><|fim▁begin|>package network import "github.com/Azure/azure-sdk-for-go/version" // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. // // Code generated by Microsoft (R) Aut...
// Changes may cause incorrect behavior and will be lost if the code is regenerated.
<|file_name|>hash_check.py<|end_file_name|><|fim▁begin|>from flask_bcrypt import generate_password_hash <|fim▁hole|># 0.25 and 0.5 seconds to run. generate_password_hash('password1', 8)<|fim▁end|>
# Change the number of rounds (second argument) until it takes between
<|file_name|>init.go<|end_file_name|><|fim▁begin|>package command import ( "fmt" "io/ioutil" "os" "strings" ) const ( // DefaultInitName is the default name we use when // initializing the example file DefaultInitName = "example.nomad" ) // InitCommand generates a new job template that you can customize to yo...
}
<|file_name|>dircolors.rs<|end_file_name|><|fim▁begin|>#![crate_name = "uu_dircolors"] // This file is part of the uutils coreutils package. // // (c) Jian Zeng <anonymousknight96@gmail.com> // // For the full copyright and license information, please view the LICENSE // file that was distributed with this source code...
continue; }
<|file_name|>ticTacToe.py<|end_file_name|><|fim▁begin|>import random import os # TicTacToe def createNewField(): result = [] for i in range(3): tmp = [] for i2 in range(3): tmp.append(' ') result.append(tmp) return result def printField(field): print '' for element in field: print element print '' ...
os.system('clear') turn += 1
<|file_name|>privileges.js<|end_file_name|><|fim▁begin|>/** * PhilaeCMS * Copyright (C) 2014 Daniel Budick * * 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 Lic...
*/ checkPrivilege: function (privilege, user) { if (user === null || user === undefined)
<|file_name|>views.py<|end_file_name|><|fim▁begin|>from django.core import serializers from rest_framework.response import Response from django.http import JsonResponse try: from urllib import quote_plus # python 2 except: pass try: from urllib.parse import quote_plus # python 3 except: pass from dj...
instance = form.save(commit=False) instance.user = request.user instance.save()
<|file_name|>01a_quick_example.rs<|end_file_name|><|fim▁begin|>extern crate clap; use clap::{App, SubCommand}; fn main() { // This example shows how to create an application with several arguments using usage strings, which can be // far less verbose that shown in 01b_QuickExample.rs, but is more readable. T...
<|file_name|>Component.js<|end_file_name|><|fim▁begin|><|fim▁hole|> return UIComponent.extend("sap.ui.webc.main.sample.FileUploader.Component", { metadata: { manifest: "json" } }); });<|fim▁end|>
sap.ui.define([ "sap/ui/core/UIComponent" ], function(UIComponent) { "use strict";
<|file_name|>lib.rs<|end_file_name|><|fim▁begin|>#![crate_type="dylib"] #![feature(plugin_registrar, rustc_private)] extern crate syntax; extern crate rustc; extern crate rustc_plugin; extern crate rand; use rand::Rng; use std::ops::Deref; use std::rc::Rc; use syntax::ptr::P; use syntax::parse::token; use syntax::...
<|file_name|>json2.js<|end_file_name|><|fim▁begin|>/* json2.js 2013-05-26 Public Domain. NO WARRANTY EXPRESSED OR IMPLIED. USE AT YOUR OWN RISK. See http://www.JSON.org/js.html This code should be minified before deployment. See http://javascript.crockford.com/jsmin.html USE YOUR OWN COPY. IT IS EXTREMELY UNWISE...
length, mind = gap, partial,
<|file_name|>settings-input-hdmi.js<|end_file_name|><|fim▁begin|>'use strict'; <|fim▁hole|>var React = require('react'); var mui = require('material-ui'); var SvgIcon = mui.SvgIcon; var ActionSettingsInputHdmi = React.createClass({ displayName: 'ActionSettingsInputHdmi', render: function render() { return Rea...
<|file_name|>aptBackend.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python # -*- coding: utf-8 -*- """Provides an apt backend to PackageKit Copyright (C) 2007 Ali Sabil <ali.sabil@gmail.com> Copyright (C) 2007 Tom Parker <palfrey@tevp.net> Copyright (C) 2008-2009 Sebastian Heinlein <glatzor@ubuntu.com> Copyright (C...
Implement the apt2-resolve functionality """ pklog.info("Resolve") self.status(enums.STATUS_QUERY)
<|file_name|>marquise_throughput.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python '''use marquise_telemetry to build throughput info as visible from the client e.g.: $ marquse_telemetry broker | marquise_throughput.py ''' import sys from time import * import os import fcntl class TimeAware(object): ...
<|file_name|>main.rs<|end_file_name|><|fim▁begin|>// Copyright 2020 The Exonum Team // // 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|>cssparse.rs<|end_file_name|><|fim▁begin|>/* This Source Code Form is subject to the terms of the Mozilla Public<|fim▁hole|> /// Some little helpers for hooking up the HTML parser with the CSS parser. use std::cell::Cell; use std::comm; use std::comm::Port; use std::task; use style::Stylesheet; use servo_n...
* 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/. */
<|file_name|>zbytes.rs<|end_file_name|><|fim▁begin|><|fim▁hole|>pub struct Bytes { /// The underlying data pub bytes: Vec<u8> } impl Bytes { /// Returns the length of the byte array. pub fn len(&self) -> usize { self.bytes.len() } /// Writes the byte (u8) to the index specified. //...
//! The `zbyte` module contains code //! to deal with opcodes and zcode. /// A struct that holds an array of bytes and provides some convenience functions.
<|file_name|>mainEventbus.js<|end_file_name|><|fim▁begin|><|fim▁hole|> const eventbus = new TyphonLoggedEvents(); eventbus.setEventbusName('mainEventbus'); /** * Exports an instance of `TyphonLoggedEvents` which adds asynchronous capabilities to `Backbone.Events` which is used * as a main eventbus. Note that an ins...
'use strict'; import TyphonLoggedEvents from './TyphonLoggedEvents.js';
<|file_name|>compat.hpp<|end_file_name|><|fim▁begin|>#ifndef UTILITY_COMPAT_HPP #define UTILITY_COMPAT_HPP <|fim▁hole|>namespace utility { struct tm strptime( const char* timestamp ); } #endif<|fim▁end|>
#include <boost/date_time/posix_time/posix_time.hpp>
<|file_name|>generate.go<|end_file_name|><|fim▁begin|>// Package generate implements functions generating container config files. package generate import ( "encoding/json" "fmt" "io" "os" "strings" rspec "github.com/opencontainers/runtime-spec/specs-go" "github.com/opencontainers/runtime-tools/generate/seccomp...
"CAP_SYS_CHROOT", "CAP_KILL", "CAP_AUDIT_WRITE",
<|file_name|>request.js<|end_file_name|><|fim▁begin|>/* jshint sub: true */ /* global exports: true */ 'use strict'; // ////////////////////////////////////////////////////////////////////////////// // / @brief node-request-style HTTP requests // / // / @file // / // / DISCLAIMER // / // / Copyright 2015 triAGENS GmbH...
this.json = undefined;
<|file_name|>ui_codificadores_POT.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- # Form implementation generated from reading ui file '/Users/chernomirdinmacuvele/Documents/workspace/PscArt2.0.X/UserInt/ui_codificadores_POT.ui' # # Created by: PyQt5 UI code generator 5.8.2 # # WARNING! All changes made in thi...
self.CHBActivo.setText(_translate("Form", "Activo"))
<|file_name|>UnityYAML.js<|end_file_name|><|fim▁begin|>/** * @author Richard Davey <rich@photonstorm.com> * @copyright 2019 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var imageHeight = 0; /** * @function addFrame * @private * @since 3.0.0 */ var addFr...
<|file_name|>provisioning_block.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 # # Unless req...
<|file_name|>build.sahana.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python # -*- coding: utf-8 -*- # # run as: # python web2py.py -S eden -M -R applications/eden/static/scripts/tools/build.sahana.py # or # python web2py.py -S eden -M -R applications/eden/static/scripts/tools/build.sahana.py -A gis # # # Built ...
"contacts", "embed_component", "inline_component", "locationselector.widget",
<|file_name|>fe_series_05.cc<|end_file_name|><|fim▁begin|>// --------------------------------------------------------------------- // // Copyright (C) 2016 by the deal.II authors // // This file is part of the deal.II library. // // The deal.II library is free software; you can use it, redistribute // it, and/or modify...
fe_collection,
<|file_name|>DB.py<|end_file_name|><|fim▁begin|>from Timeline.Server.Constants import TIMELINE_LOGGER from twisted.internet.defer import Deferred, inlineCallbacks, returnValue from twistar.dbobject import DBObject from twistar.registry import Registry from collections import deque import logging, time, json class Pe...
def __str__(self, withNotes = False): if not withNotes: return '|'.join(map(str, [self.id, self.name, int(self.shared), self.likes]))
<|file_name|>test_content_app.py<|end_file_name|><|fim▁begin|>""" To run this test, type this in command line <kolibri manage test -- kolibri.core.content> """ import datetime import unittest import uuid import mock import requests from django.conf import settings from django.core.cache import cache from django.core.u...
f: getattr(lang, f)
<|file_name|>settings.py<|end_file_name|><|fim▁begin|>import os DIRNAME = os.path.dirname(__file__) DATABASES = { "default": { "ENGINE": "django.db.backends.sqlite3" }<|fim▁hole|> "django.contrib.contenttypes", "pqauth.pqauth_django_server" ) SECRET_KEY = "chicken butt" PQAUTH_SERVER_KEY = os...
} INSTALLED_APPS = ( "django.contrib.auth",
<|file_name|>conf.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- # # state_machine documentation build configuration file, created by # sphinx-quickstart on Thu Apr 3 08:46:47 2014. # # This file is execfile()d with the current directory set to its # containing dir. # # Note that not all possible configuratio...
#html_short_title = None # The name of an image file (relative to this directory) to place at the top
<|file_name|>edits-reducer.js<|end_file_name|><|fim▁begin|>/** @format */ /** * External dependencies */ import { compact, isEqual } from 'lodash'; /** * Internal dependencies */ import { createReducer } from 'state/utils'; import { WOOCOMMERCE_PRODUCT_CATEGORY_CREATE, WOOCOMMERCE_PRODUCT_CATEGORY_UPDATE, WOO...
function clearEditsAction() { return null; }
<|file_name|>test.go<|end_file_name|><|fim▁begin|>/*§ =========================================================================== MoonDeploy =========================================================================== Copyright (C) 2015-2016 Gianluca Costa ======================================================...
You may obtain a copy of the License at
<|file_name|>lgt_spiders.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python # -*- coding: UTF-8 -*- ##### ##### ===== 포함 파일 ===== # 개인적인 아이디, 비밀번호 파일. from personal.jconfig import LOGIN_ID, LOGIN_PW # scrapy item 파일. from joonggonara.items import JoonggonaraItem # 로그인을 위한 FormRequest. # 로그인 이후 크롤링을 위한 Request. ...
SPIDER_NAME = 'lgt' START_URL = 'http://nid.naver.com/nidlogin.login' BOARD_PAGE_URL = 'http://cafe.naver.com/ArticleList.nhn?search.boardtype=L&userDisplay=50&search.menuid=425&search.questionTab=A&search.clubid=10050146&search.specialmenutype=&search.totalCount=501&search.page=' # SKT - 339, KT - 424, LGT - 425, 여성상의...
<|file_name|>features_dense_longint_modular.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python from modshogun import LongIntFeatures from numpy import array, int64, all # create dense matrix A matrix=array([[1,2,3],[4,0,0],[0,0,0],[0,5,0],[0,0,6],[9,9,9]], dtype=int64) parameter_list = [[matrix]] # ... of type Lo...
# get first feature vector and set it a.set_feature_vector(array([1,4,0,0,0,9], dtype=int64), 0)
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|># Call vendor to add the dependencies to the classpath import vendor vendor.add('lib') # Import the Flask Framework from flask import Flask, render_template, url_for, request, jsonify app = Flask(__name__) import translate # Root directory @app.route('/') def in...
app.run() # For production
<|file_name|>bids.py<|end_file_name|><|fim▁begin|># emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*- # vi: set ft=python sts=4 ts=4 sw=4 et: # # Copyright 2021 The NiPreps Developers <nipreps@gmail.com> # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this fil...
reconstruction = traits.Str() run = traits.Int() suffix = traits.Str()
<|file_name|>page_test_runner.py<|end_file_name|><|fim▁begin|># Copyright (c) 2012 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. import logging import os import sys from telemetry.core import browser_finder from telemetr...
if test_name not in tests: sys.stderr.write('No test name %s found' % test_name)
<|file_name|>setup.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- #!/usr/bin/env python from setuptools import setup, find_packages setup( name = 'wechat-python-sdk', version = '0.5.7', keywords = ('wechat', 'sdk', 'wechat sdk'), description = u'微信公众平台Python开发包', long_description = open("...
author = 'doraemonext',
<|file_name|>266658781c00_instances_nullable_in_equipments_provider.py<|end_file_name|><|fim▁begin|>""" column 'instances' will be deleted later. Has to be nullable for transition Revision ID: 266658781c00 Revises: 204aae05372a<|fim▁hole|> """ # revision identifiers, used by Alembic. revision = '266658781c00' down_re...
Create Date: 2019-04-15 16:27:22.362244
<|file_name|>ioutils.cc<|end_file_name|><|fim▁begin|>/* -*- Mode: C; tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*- */ /* * Copyright 2014-2020 Couchbase, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. ...
break; }
<|file_name|>list.py<|end_file_name|><|fim▁begin|># The following comment should be removed at some point in the future. # mypy: disallow-untyped-defs=False from __future__ import absolute_import import json import logging from multiprocessing.dummy import Pool from pip._vendor import six from pip._vendor.requests.a...
if options.verbose >= 1 or dist_is_editable(proj): row.append(proj.location) if options.verbose >= 1:
<|file_name|>LandingCtrl.js<|end_file_name|><|fim▁begin|>(function() { function LandingCtrl() { this.heroTitle = "Turn the Music Up!"; }<|fim▁hole|>})();<|fim▁end|>
angular .module('blocJams') .controller('LandingCtrl', LandingCtrl);
<|file_name|>gce.go<|end_file_name|><|fim▁begin|>package provider ////// SET UP API ACCESS: // // 1) In the Google Developer Console navigate to: // Permissions > Service accounts // // 2) Create or use an existing Service Account // // 3) For your Service Account, create and save a key as "~/.gce/quilt.json" // //...
return nil } op, err := clst.firewallPatch(clst.extFW, acls)
<|file_name|>recurrent.py<|end_file_name|><|fim▁begin|># Copyright 2019 DeepMind Technologies Limited. 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....
self.output_channels = output_channels self.kernel_shape = kernel_shape
<|file_name|>migrate_transcripts.py<|end_file_name|><|fim▁begin|>""" Command to migrate transcripts to django storage. """ import logging from django.core.management import BaseCommand, CommandError from opaque_keys import InvalidKeyError from opaque_keys.edx.keys import CourseKey from opaque_keys.edx.locator import C...
parser.add_argument( '--course-id', '--course_id', dest='course_ids', action='append',
<|file_name|>DynamoDocumentStoreTemplateTest.java<|end_file_name|><|fim▁begin|>/* * Copyright 2014 Click Travel Ltd * * 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...
final Collection<ItemConfiguration> itemConfigurations = Arrays.asList(itemConfiguration); when(mockDatabaseSchemaHolder.itemConfigurations()).thenReturn(itemConfigurations);
<|file_name|>sys_test_params.py<|end_file_name|><|fim▁begin|>'''-------------------------------------------------------------------------<|fim▁hole|>You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under ...
Copyright IBM Corp. 2015, 2015 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.
<|file_name|>graphviz.rs<|end_file_name|><|fim▁begin|>// Copyright 2014 The Rust Project Developers. See the COPYRIGHT // file at the top-level directory of this distribution and at // http://rust-lang.org/COPYRIGHT. // // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or // http://www.apache.org/licens...
} fn dataflow_assigns_for(&self, e: EntryOrExit, cfgidx: CFGIndex) -> String {
<|file_name|>SFFerrors.py<|end_file_name|><|fim▁begin|><|fim▁hole|> self.msg = msg<|fim▁end|>
class Error(Exception): def __init__(self, msg):
<|file_name|>database.go<|end_file_name|><|fim▁begin|>package database import ( "errors" "time" // DBの共通化のため "github.com/Sirupsen/logrus" _ "github.com/go-sql-driver/mysql" // genmaiのサポートが危うくなっているため規模の大きいgormに移行 "fmt" "github.com/cs3238-tsuzu/popcon-sc/lib/filesystem" "github.com/cs3238-tsuzu/popcon-sc/lib...
if debugMode { dm.db.LogMode(true)
<|file_name|>protectionIntentResource.js<|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. * * Code generated by Microsoft (R) AutoRest Code Generator. * Changes may cause inc...
}, properties: {
<|file_name|>relations.py<|end_file_name|><|fim▁begin|>from flask import Blueprint, render_template, request from werkzeug.exceptions import NotFound from grano.lib.pager import Pager from grano.model import Relation<|fim▁hole|> @relations.route('/relations/<id>') def view(id): relation = Relation.by_id(id) if...
relations = Blueprint('relations', __name__, static_folder='../static', template_folder='../templates')
<|file_name|>push_link.js<|end_file_name|><|fim▁begin|>import { get_definition } from './../base'; export const push_link = ( oid, linkurl, linkname, onmenu='true', instance_name, when, additional_args, description ) => get_definition({ oid, linkurl, linkname,<|fim▁hole|> onmenu,...
<|file_name|>customformlayout.tsx<|end_file_name|><|fim▁begin|>import React, { useState } from 'react'; import { AutoFields, ColorPickerField } from '@react-page/editor'; // The editor core import type { Value, CellPlugin } from '@react-page/editor'; import Editor, { createValue } from '@react-page/editor'; // import ...
}, Content: () => ( <div style={{ display: 'flex' }}> <div style={{ flex: 1, marginRight: 20 }}>
<|file_name|>fcm.py<|end_file_name|><|fim▁begin|>import logging import sqlite3 from pyfcm import FCMNotification def insert_token(token): try: con = sqlite3.connect('fcm.db') cur = con.cursor() cur.execute('CREATE TABLE IF NOT EXISTS tokens(token TEXT)') cur.execute('INSERT INTO ...
con.commit() finally:
<|file_name|>CollectorStream.js<|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/.<|fim▁hole|> /* * Copyright (c) 2015, Joyent, Inc. */...
*/
<|file_name|>Deploy.py<|end_file_name|><|fim▁begin|>import pathlib from typing import Optional from cumulusci.core.exceptions import TaskOptionsError from cumulusci.core.utils import process_bool_arg, process_list_arg from cumulusci.salesforce_api.metadata import ApiDeploy from cumulusci.salesforce_api.package_zip imp...
<|file_name|>gpio.py<|end_file_name|><|fim▁begin|>def gpio_init(pin, output):<|fim▁hole|> f.write(b"out" if output else b"in") except Exception as e: print(f"Failed to set gpio {pin} direction: {e}") def gpio_set(pin, high): try: with open(f"/sys/class/gpio/gpio{pin}/value", 'wb') as f: f.write...
try: with open(f"/sys/class/gpio/gpio{pin}/direction", 'wb') as f:
<|file_name|>comp-3104.component.ts<|end_file_name|><|fim▁begin|>/** * @license * Copyright Google Inc. All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license */ import { Component, OnInit } from '@angular/core'; ...
ngOnInit() { }
<|file_name|>dead-code-one-arm-if.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.apach...
// except according to those terms. // ignore-test #12920
<|file_name|>simdty.rs<|end_file_name|><|fim▁begin|>// Copyright 2016 chacha20-poly1305-aead Developers // // Licensed under the Apache License, Version 2.0, <LICENSE-APACHE or // http://apache.org/licenses/LICENSE-2.0> or the MIT license <LICENSE-MIT or // http://opensource.org/licenses/MIT>, at your option. This file...
<|file_name|>all_79.js<|end_file_name|><|fim▁begin|>var searchData= [<|fim▁hole|><|fim▁end|>
['y',['y',['../group___accelerometer_service.html#a58008ae111afcb60b47419541c48aa91',1,'AccelData::y()'],['../group___graphics_types.html#a94afc39fa39df567b9e78702d1f07b3e',1,'GPoint::y()']]], ['year_5funit',['YEAR_UNIT',['../group___wall_time.html#gga0423d00e0eb199de523a92031b5a1107a652f00ea2c629930a32a684f9d8c876...
<|file_name|>network.go<|end_file_name|><|fim▁begin|>/* Copyright (c) 2015, Brian Hummer (brian@redq.me) 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 ...
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */
<|file_name|>resourceConfigurationImpl.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 informa...
constructor( @IConfigurationService private configurationService: IConfigurationService, @IModelService private modelService: IModelService,
<|file_name|>application.reducer.spec.ts<|end_file_name|><|fim▁begin|>import {applicationReducer} from "./application.reducer"; import {ApplicationContainerState} from "../../state/ContainersState"; import {EnableBusyFlag, DisableBusyFlag} from "../../actions/containers/application"; import {Dispatcher} from "@ngrx/sto...
it("should return a new applicationstate with the isBusyflag to true", () => {
<|file_name|>test_yaml.py<|end_file_name|><|fim▁begin|>#!/bin/env python #-*- coding=utf-8 -*- import yaml data = """ f5: # 蓝汛f5信息 - ip: 192.168.0.1 dc: lx credentials: username: huzichun password: huzichun!@# role: master # 世纪互联f5信息 - ip: 192.168.0.2 dc: sjhl credentials: username: huzichun ...
f.close()
<|file_name|>alertshandler.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python3 # # Copyright (c) 2022 Roberto Riggio # # 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.apach...
alert_id = uuid.UUID(args[0]) if args else uuid.uuid4() if 'alert' in kwargs: alert = self.service.create(uuid=alert_id, alert=kwargs['alert'])
<|file_name|>BaseContainer.ts<|end_file_name|><|fim▁begin|>import { Component } from 'react' <|fim▁hole|> export default class extends Component<any,any> { }<|fim▁end|>
<|file_name|>WeatherDomainTest.java<|end_file_name|><|fim▁begin|>/* * Copyright (c) 2017, Miguel Gamboa * * 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 3 of the License, or...
<|file_name|>runReadyImage.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python # This file should be compatible with both Python 2 and 3. # If it is not, please file a bug report. """ Contains code that prepairs a subuser's image to be run. """ #external imports import os #internal imports from subuserlib.classes.u...
return self.__id
<|file_name|>command.rs<|end_file_name|><|fim▁begin|>use std::ffi::OsStr; use std::fs::File; use std::io::{self, Write, BufRead, BufReader, Seek, SeekFrom}; use std::process::{self, Command, Stdio}; use std::time::Instant; use regex::Regex; use tempfile::tempfile; use Cfg; use errors::*; use notifications::*; use rust...
}
<|file_name|>client.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- __docformat__="restructuredtext" from rest import RestClient, Result, ResponseFormats from datetime import datetime class NeocortexRestClient(object): BASE_URL = "http://api.meaningtool.com/0.2/neocortex" __builder__ = None ...
return builder.format(ResponseFormats.JSON).input(input).keywords().meaningfy().payload["keywords"] def entities(self, input): builder = self.get_builder()
<|file_name|>cfgs-on-items.rs<|end_file_name|><|fim▁begin|>// run-pass // compile-flags: --cfg fooA --cfg fooB // fooA AND !bar #[cfg(all(fooA, not(bar)))] fn foo1() -> isize { 1 } // !fooA AND !bar<|fim▁hole|>// fooC OR (fooB AND !bar) #[cfg(any(fooC, all(fooB, not(bar))))] fn foo2() -> isize { 3 } // fooA AND bar...
#[cfg(all(not(fooA), not(bar)))] fn foo2() -> isize { 2 }
<|file_name|>baked.py<|end_file_name|><|fim▁begin|># sqlalchemy/ext/baked.py # Copyright (C) 2005-2020 the SQLAlchemy authors and contributors # <see AUTHORS file> # # This module is part of SQLAlchemy and is released under # the MIT License: http://www.opensource.org/licenses/mit-license.php """Baked query extension. ...
""" pass
<|file_name|>Dataset.py<|end_file_name|><|fim▁begin|>import math import random import onmt from torch.autograd import Variable class Dataset(object): def __init__(self, srcData, tgtData, batchSize, cuda, volatile=False): self.src = srcData if tgtData: self.tgt = tgtData a...
<|file_name|>table_view_text_box.py<|end_file_name|><|fim▁begin|>import tkinter as tk<|fim▁hole|> tk.Tk.__init__(self) t = SimpleTable(self, 10,2) t.pack(side="top", fill="x") t.set(0,0,"Hello, world") class SimpleTable(tk.Frame): def __init__(self, parent, rows=10, columns=2): ...
class ExampleApp(tk.Tk): def __init__(self):
<|file_name|>file_loader.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python3 # # (C) Copyright 2015 by Marek Hakala <hakala.marek@gmail.com> # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at #...
def __init__(self, filename): self.filename = filename
<|file_name|>test_sync.py<|end_file_name|><|fim▁begin|>from __future__ import print_function, absolute_import import numpy as np from numba import cuda, int32, float32 from numba.cuda.testing import unittest from numba.config import ENABLE_CUDASIM def useless_sync(ary): i = cuda.grid(1) cuda.syncthreads() ...
<|file_name|>UserProfileDB.py<|end_file_name|><|fim▁begin|>""" UserProfileDB class is a front-end to the User Profile Database """ __RCSID__ = "$Id$" import types import os import sys import hashlib from DIRAC import S_OK, S_ERROR, gLogger, gConfig from DIRAC.Core.Utilities import Time from DIRAC.ConfigurationSyste...
<|file_name|>ServerRequestsTest.java<|end_file_name|><|fim▁begin|>package com.opentrain.app; import android.test.InstrumentationTestCase; import com.opentrain.app.network.NetowrkManager; import java.util.concurrent.CountDownLatch; /** * Created by noam on 27/07/15. */ public class ServerRequestsTest extends Instr...
// bssids.add("b4:c7:99:0b:d4:90"); // String stationName = "StationNameTest"; //
<|file_name|>CharGen.py<|end_file_name|><|fim▁begin|># -*-python-*- # GemRB - Infinity Engine Emulator # Copyright (C) 2003-2005 The GemRB Project # # 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 Foundatio...
else: ProficienciesPlusButton.SetState (IE_GUI_BUTTON_ENABLED)
<|file_name|>models.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- """ requests.models ~~~~~~~~~~~~~~~ This module contains the primary objects that power Requests. """ import os from datetime import datetime from .hooks import dispatch_hook, HOOKS from .structures import CaseInsensitiveDict from .status_c...
<|file_name|>build.rs<|end_file_name|><|fim▁begin|>// Copyright © 2015, Peter Atashian // Licensed under the MIT License <LICENSE.md> fn main() {<|fim▁hole|> println!("cargo:rustc-flags=-l cryptdll"); }<|fim▁end|>
<|file_name|>test_open_file.py<|end_file_name|><|fim▁begin|>import os, sys; sys.path.insert(0, os.path.dirname(os.path.dirname(__file__))) <|fim▁hole|>import pytest from lasio import read test_dir = os.path.dirname(__file__) egfn = lambda fn: os.path.join(os.path.dirname(__file__), "examples", fn) def test_open_ur...