prompt
large_stringlengths
70
991k
completion
large_stringlengths
0
1.02k
<|file_name|>wsgi.py<|end_file_name|><|fim▁begin|>""" WSGI config for genoome project. This module contains the WSGI application used by Django's development server and any production WSGI deployments. It should expose a module-level variable named ``application``. Django's ``runserver`` and ``runfcgi`` commands disco...
# if running multiple sites in the same mod_wsgi process. To fix this, use
<|file_name|>pico.py<|end_file_name|><|fim▁begin|># # This file is part of pySMT. # # Copyright 2014 Andrea Micheli and Marco Gario # # 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 # #...
# Unless required by applicable law or agreed to in writing, software
<|file_name|>ServiceAction.java<|end_file_name|><|fim▁begin|>package jp.co.omana.action; import org.seasar.struts.annotation.Execute; public class ServiceAction { @Execute(validator = false) public String index() {<|fim▁hole|> public String confirm() { return "index.jsp"; } @Execute(validator ...
return "board.jsp"; } @Execute(validator = false)
<|file_name|>test_query.py<|end_file_name|><|fim▁begin|>import inspect import unittest import mock from pulp.server.db.connection import PulpCollection from pulp.server.db.model.criteria import Criteria from pulp.server.managers.content.query import ContentQueryManager from test_cud import PulpContentTests, TYPE_1_DE...
@mock.patch('pulp.plugins.types.database.type_units_unit_key', return_value=['a']) @mock.patch('pulp.plugins.types.database.type_units_collection') class TestGetContentUnitIDs(unittest.TestCase):
<|file_name|>setup.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python<|fim▁hole|># 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 # (at your opt...
# -*- coding: utf-8 -*- # Copyright (C) 2011 Cédric Krier
<|file_name|>CWE124_Buffer_Underwrite__wchar_t_alloca_loop_73a.cpp<|end_file_name|><|fim▁begin|>/* TEMPLATE GENERATED TESTCASE FILE Filename: CWE124_Buffer_Underwrite__wchar_t_alloca_loop_73a.cpp Label Definition File: CWE124_Buffer_Underwrite.stack.label.xml Template File: sources-sink-73a.tmpl.cpp */ /* * @des...
wmemset(dataBuffer, L'A', 100-1); dataBuffer[100-1] = L'\0'; /* FLAW: Set data pointer to before the allocated memory buffer */
<|file_name|>gcs_storage.py<|end_file_name|><|fim▁begin|>import os import yaml from google.cloud import storage from google.oauth2 import service_account from .storage import Storage class GcsStorage(Storage): def __init__(self, bucket, path, project=None, json_path=None): if bucket is None: ra...
<|file_name|>try_convnet_keras_x_cats.py<|end_file_name|><|fim▁begin|>import theano.sandbox.cuda.basic_ops as sbcuda import numpy as np import load_data import realtime_augmentation as ra import time import sys import os import json from custom_for_keras import input_generator from datetime import datetime, timedelta f...
def save_exit(): print "\nsaving..." winsol.save() print "Done!"
<|file_name|>jda.js<|end_file_name|><|fim▁begin|>// This contains the module definition factory function, application state, // events, and the router. this.jda = { // break up logical components of code into modules. module: function() { // Internal module cache. var modules = {}; ...
<|file_name|>runtests.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python # http://ericholscher.com/blog/2009/jun/29/enable-setuppy-test-your-django-apps/ # http://www.travisswicegood.com/2010/01/17/django-virtualenv-pip-and-fabric/ # http://code.djangoproject.com/svn/django/trunk/tests/runtests.py import os import ...
import django from django.conf import settings from django.test.utils import get_runner
<|file_name|>kid.js<|end_file_name|><|fim▁begin|>/** * @author Iftikhar Ul Hassan * @date 4/10/17. */ const util = require('../util'); module.exports = function (length) { length = length || 21; var isValid;<|fim▁hole|> do { kidNumber = util.generateRandomNumber(0, 9, length) + ""; var ...
var kidNumber;
<|file_name|>company.service.spec.ts<|end_file_name|><|fim▁begin|>import { BaseRequestOptions, ConnectionBackend, Http, Response, ResponseOptions } from '@angular/http'; import { TestBed, async } from '@angular/core/testing'; import { MockBackend } from '@angular/http/testing'; import { Observable } from 'rxjs/Observa...
<|file_name|>KellySPPortfolio.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- ''' @author: Hung-Hsin Chen @mail: chenhh@par.cse.nsysu.edu.tw<|fim▁hole|>kelly multivariate investment ''' if __name__ == '__main__': pass<|fim▁end|>
<|file_name|>visit.rs<|end_file_name|><|fim▁begin|>// Copyright 2012-2014 The Rust Project Developers. See the COPYRIGHT // file at the top-level directory of this distribution and at // http://rust-lang.org/COPYRIGHT. // // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or // http://www.apache.org/lice...
match variant.node.kind { TupleVariantKind(ref variant_arguments) => { for variant_argument in variant_arguments {
<|file_name|>ext.js<|end_file_name|><|fim▁begin|><|fim▁hole|>});<|fim▁end|>
$(document).ready(function(){ $('#countdown').countdown( {date: '19 april 2013 16:24:00'} );
<|file_name|>LG-1199.cpp<|end_file_name|><|fim▁begin|>#include <algorithm> #include <bitset> #include <cassert> #include <cmath> #include <cstdio> #include <cstring> #include <deque> #include <iostream> #include <map> #include <queue> #include <set> #include <stack> #include <string> #include <utility> #include <vector...
// #pragma GCC optimize("-ftree-switch-conversion") // #pragma GCC optimize("-foptimize-sibling-calls") // #pragma GCC optimize("-fexpensive-optimizations") // #pragma GCC optimize("-funsafe-loop-optimizations")
<|file_name|>sorters.py<|end_file_name|><|fim▁begin|>"""Builder for websites.""" import string from regolith.dates import date_to_float doc_date_key = lambda x: date_to_float( x.get("year", 1970), x.get("month", "jan")<|fim▁hole|>category_val = lambda x: x.get("category", "<uncategorized>") level_val = lambda x: ...
) ene_date_key = lambda x: date_to_float( x.get("end_year", 4242), x.get("end_month", "dec") )
<|file_name|>f20.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/licenses/LI...
let v = [2u, 0u, 20u]; v[20u]; }
<|file_name|>driver.py<|end_file_name|><|fim▁begin|># vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright (c) 2010 Openstack, LLC. # Copyright 2010 United States Government as represented by the # Administrator of the National Aeronautics and Space Administration. # All Rights Reserved. # # Licensed under the Apa...
:param instance_ref: nova.db.sqlalchemy.models.Instance object :param dest: destination host
<|file_name|>ViFileDownload.js<|end_file_name|><|fim▁begin|>/** * Created by dima on 06.12.16. */ import React from 'react'; import ViButton from './ViButton'; import './ViFileDownload.css' const ViFileDownloadButton = function ({ onClick, assetUri, type, loading }) { return ( <div className="ViFileDown...
<|file_name|>DocumentSplitStartEvent.java<|end_file_name|><|fim▁begin|>/********************************************************************************* * Ephesoft is a Intelligent Document Capture and Mailroom Automation program * developed by Ephesoft, Inc. Copyright (C) 2015 Ephesoft Inc. * * This program is fr...
* Section 5 of the GNU Affero General Public License version 3. * * In accordance with Section 7(b) of the GNU Affero General Public License version 3,
<|file_name|>five.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- """ amqp.five ~~~~~~~~~~~ Compatibility implementations of features only available in newer Python versions. """ from __future__ import absolute_import import io import sys try: from collections import Counter<|fim▁hole|>...
except ImportError: # pragma: no cover from collections import defaultdict
<|file_name|>models.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- """ {{ project_name }}.libs.common.models ~~~~~~~~~~~~~~~~~~~~~~~~~<|fim▁hole|> This module contains all models that can be used across apps :copyright: (c) 2015 """ from django.db import models from django.utils.translation imp...
<|file_name|>ace-mode-warpscript.d.ts<|end_file_name|><|fim▁begin|><|fim▁hole|><|fim▁end|>
export default function (): boolean;
<|file_name|>documentation.js<|end_file_name|><|fim▁begin|>'use strict'; const config = require('config'); const esdoc = require('gulp-esdoc'); const gulp = require('gulp'); module.exports = function documentationBuilder() { return gulp.src('./src') .pipe(esdoc({ destination: config.get('build.documentati...
test: { type: config.get('build.documentation.testType'),
<|file_name|>LogMessageProcessor.java<|end_file_name|><|fim▁begin|>package com.truward.brikar.maintenance.log.processor; import com.truward.brikar.common.log.LogUtil; import com.truward.brikar.maintenance.log.CommaSeparatedValueParser; import com.truward.brikar.maintenance.log.Severity; import com.truward.brikar.maint...
// special case: this line is a continuation of metrics entry started on the previous line
<|file_name|>index.d.ts<|end_file_name|><|fim▁begin|>export * as dijkstra from './dijkstra'; export * as unweighted from './unweighted'; export { singleSource, singleSourceLength, bidirectional, brandes<|fim▁hole|>export {edgePathFromNodePath} from './utils';<|fim▁end|>
} from './unweighted';
<|file_name|>ConfigPropertyFeature.java<|end_file_name|><|fim▁begin|>package me.protox.archetype.jersey.ext.config_property; import org.glassfish.hk2.api.InjectionResolver; import org.glassfish.hk2.api.TypeLiteral; import org.glassfish.hk2.utilities.binding.AbstractBinder; import org.slf4j.Logger; import org.slf4j.Log...
<|file_name|>InterlockedExchange.py<|end_file_name|><|fim▁begin|>import angr class InterlockedExchange(angr.SimProcedure): def run(self, target, value): #pylint:disable=arguments-differ if not self.state.solver.symbolic(target): old_value = self.state.memory.load(target, 4, endness=self.state....
<|file_name|>test_readonly_neutron.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<|fim▁hole|># ...
#
<|file_name|>keyboard-layouts.js<|end_file_name|><|fim▁begin|>#!/usr/bin/env node<|fim▁hole|> let layouts = [ `# French &é"'(-è_çà)= azertyuiop^$* qsdfghjklmù wxcvbn,;:! `, `# German (German (IBM) is the same) 1234567890ß qwertzuiopü+# asdfghjklöä yxcvbnm,.- `, `# Spanish 1234567890'¡ qwertyuiop+ç asdfghjklñ zxcvb...
<|file_name|>search_aggs_pipeline_test.go<|end_file_name|><|fim▁begin|>// Copyright 2012-present Oliver Eilhard. All rights reserved. // Use of this source code is governed by a MIT-license. // See http://olivere.mit-license.org/license.txt for details. package elastic import ( "context" "testing" ) func TestAggsI...
builder := client.Search().
<|file_name|>trace_log.cc<|end_file_name|><|fim▁begin|>// Copyright 2015 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #include "base/trace_event/trace_log.h" #include <algorithm> #include <cmath> #include <memory> #i...
<|file_name|>amavis.py<|end_file_name|><|fim▁begin|># coding=utf-8 """ Collector that reports amavis metrics as reported by amavisd-agent #### Dependencies * amavisd-agent must be present in PATH """ import os import subprocess import re import diamond.collector import diamond.convertor from diamond.collector imp...
groups = res.groupdict() name = groups['name']
<|file_name|>conversion_table.py<|end_file_name|><|fim▁begin|># -*- coding:utf-8 -*- # Copyright 2015 NEC Corporation. # # # # Licensed under the Apache License, Version 2.0 (the "License"); # # y...
nodes = self.__node_conversion_table[key]
<|file_name|>api.py<|end_file_name|><|fim▁begin|>from statsmodels.regression.linear_model import GLS gls = GLS.from_formula from statsmodels.regression.linear_model import WLS wls = WLS.from_formula from statsmodels.regression.linear_model import OLS ols = OLS.from_formula from statsmodels.regression.linear_model impor...
<|file_name|>exceptions.py<|end_file_name|><|fim▁begin|># Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0 # For details: https://github.com/nedbat/coveragepy/blob/master/NOTICE.txt """Exceptions coverage.py can raise.""" class BaseCoverageException(Exception): """The base of all Cov...
<|file_name|>stat_var_renaming_constants.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 # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required ...
'drug/dea/7377': 'Cannabicyclol', 'drug/dea/7379': 'Nabilone',
<|file_name|>server.py<|end_file_name|><|fim▁begin|># DO NOT EDIT THIS FILE. This file will be overwritten when re-running go-raml. from app import app import gevent from gevent.pywsgi import WSGIServer from gevent.pool import Pool from gevent import monkey import signal monkey.patch_all() server = WSGIServer((''...
server.serve_forever()
<|file_name|>type_of.rs<|end_file_name|><|fim▁begin|>// Copyright 2012-2013 The Rust Project Developers. See the COPYRIGHT // file at the top-level directory of this distribution and at // http://rust-lang.org/COPYRIGHT. // // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or // http://www.apache.org/li...
<|file_name|>read_immutable_static.rs<|end_file_name|><|fim▁begin|>// compile-flags: -O<|fim▁hole|>static FOO: u8 = 2; // EMIT_MIR read_immutable_static.main.ConstProp.diff fn main() { let x = FOO + FOO; }<|fim▁end|>
<|file_name|>0015_auto_20170415_1628.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- # Generated by Django 1.10.6 on 2017-04-15 14:28 from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('catalogue', '0014_auto_...
<|file_name|>GoodFETAVR.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python # GoodFET SPI and SPIFlash Client Library # # (C) 2009 Travis Goodspeed <travis at radiantmachines.com> # # This code is being rewritten and refactored. You've been warned! import sys, time, string, cStringIO, struct, glob, os; from GoodF...
def flashpeek(self, adr): """Read a byte of the target's Flash memory.""" self.writecmd(self.AVRAPP,0x02 ,2,
<|file_name|>option.module.ts<|end_file_name|><|fim▁begin|><|fim▁hole|>import { LuOptionSelectorModule } from './selector/index'; import { LuOptionPlaceholderModule } from './placeholder/index'; @NgModule({ imports: [LuOptionItemModule, LuOptionPickerModule, LuOptionOperatorModule, LuOptionSelectorModule, LuOptionPla...
import { NgModule } from '@angular/core'; import { LuOptionItemModule } from './item/index'; import { LuOptionPickerModule } from './picker/index'; import { LuOptionOperatorModule } from './operator/index';
<|file_name|>require_tree_alpha.js<|end_file_name|><|fim▁begin|><|fim▁hole|><|fim▁end|>
//= link_tree ./alpha
<|file_name|>users.test.js<|end_file_name|><|fim▁begin|>'use strict'; describe('service', function() { var countKeys = function(data) { var count = 0 for(var k in data) { count++; } return count; } // load modules beforeEach(module('mavrixAgenda')); // Test service availa...
// Test users it('testing set/get users', inject(function(usersSrv){ usersSrv.setCurrentUser("test-user");
<|file_name|>x-model.cpp<|end_file_name|><|fim▁begin|>#include <algorithm><|fim▁hole|>const Window the_icon = 1, the_placeholder = 2, the_client = 3; struct XModelFixture { XModel model; }; #define NULL_OF(type) static_cast<type*>(0) SUITE(XModelMemberSuite) { TEST_FIXTURE(XModelFixture, test_ico...
#include <UnitTest++.h> #include "model/x-model.h"
<|file_name|>bitcoin_nb.ts<|end_file_name|><|fim▁begin|><?xml version="1.0" ?><!DOCTYPE TS><TS language="nb" version="2.1"> <context> <name>AboutDialog</name> <message> <location filename="../forms/aboutdialog.ui" line="+14"/> <source>About WhyCoin</source> <translation>Om WhyCoin</trans...
<location line="+23"/>
<|file_name|>mine_nrd_kernel.rs<|end_file_name|><|fim▁begin|>// Copyright 2021 The Grin Developers // // 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...
let tx = build::transaction( KernelFeatures::NoRecentDuplicate { fee: 20000.into(),
<|file_name|>helpers.py<|end_file_name|><|fim▁begin|>"""Helper functions Consists of functions to typically be used within templates, but also available to Controllers. This module is available to both as 'h'. """ from webhelpers import * from webhelpers.html import tags from routes import url_for from pylons import r...
if sN: if sN[0] == "/": sN = sN[1:] nUrls = []
<|file_name|>config.cpp<|end_file_name|><|fim▁begin|>/** * Application compile time config settings. * * This file is empty and only serves to work around this problem, although * this may be a good place to add any config handling code in future. */ <|fim▁hole|> // Make the SSerial port available if needed #ifdef...
#include "config.h"
<|file_name|>search.ts<|end_file_name|><|fim▁begin|>import _ from 'lodash'; import impressionSrv from './impression'; import { contextSrv } from './context'; import { hasFilters } from 'src/views/search/utils'; import { SECTION_STORAGE_KEY } from 'src/views/search/constants'; import { DashboardSection, DashboardSearch...
getSortOptions() { return backendSrv.get('/api/search/sorting').then((res) => res.data); } }
<|file_name|>mod.rs<|end_file_name|><|fim▁begin|>use crate::{ commands::CommandHelpers, entity::{EntityRef, Realm}, player_output::PlayerOutput, }; mod enter_room_command; pub use enter_room_command::enter_room; pub fn wrap_admin_command<F>( f: F, ) -> Box<dyn Fn(&mut Realm, EntityRef, CommandHelpers...
} },
<|file_name|>stub_utils.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-<|fim▁hole|># # 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 #...
# Copyright 2014, 2015 Metaswitch Networks
<|file_name|>0208_create_role_executive.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- # Generated by Django 1.11.2 on 2017-11-22 07:11 from __future__ import unicode_literals from django.core.management.sql import emit_post_migrate_signal<|fim▁hole|> # create group db_alias = schema_editor.connection....
from django.db import migrations def add_executive_group(apps, schema_editor):
<|file_name|>sort-table.js<|end_file_name|><|fim▁begin|>'use strict'; import React from 'react'; import {BootstrapTable, TableHeaderColumn} from 'react-bootstrap-table'; var products = []; function addProducts(quantity) { var startId = products.length; for (var i = 0; i < quantity; i++) { var id = startId + ...
} } addProducts(5);
<|file_name|>nonconvex_cell.cc<|end_file_name|><|fim▁begin|>#include "voro++_2d.hh" using namespace voro; // This function returns a random floating point number between 0 and 1 double rnd() {return double(rand())/RAND_MAX;} int main() { double x,y; voronoicell_nonconvex_2d v; // Initialize the Voronoi cell to be...
<|file_name|>GeoDBNoSRIDExpectationsFactory.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>. */ /** ...
return createNativeSQLStatement( "select id, ST_AsText(geom) from GEOMTEST" ); } @Override
<|file_name|>mod.rs<|end_file_name|><|fim▁begin|><|fim▁hole|>pub mod fs; pub mod raw;<|fim▁end|>
//! Dragonfly-specific definitions #![stable(feature = "raw_ext", since = "1.1.0")]
<|file_name|>dashboard.js<|end_file_name|><|fim▁begin|>(function($){ DashboardModel = Backbone.Model.extend({ url: "/sync" }); SyncStatusModel = Backbone.Model.extend({ url: "/sync/status" }); DeleteModel = Backbone.Model.extend(); DashboardView = Backbone.View.extend({ el: $("#form_block"),...
$(e.currentTarget).parent().parent().remove();
<|file_name|>missing_symbols.py<|end_file_name|><|fim▁begin|>""" Copyright (c) 2016 Genome Research Ltd. 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 Software without restriction, including without limi...
response, status_code, requested_headers = open_url(url, headers) if status_code == 429: if "retry-after" in requested_headers:
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|># # Package analogous to 'threading.py' but using processes # # multiprocessing/__init__.py # # This package is intended to duplicate the functionality (and much of # the API) of threading.py but uses processes instead of threads. A # subpackage 'multiprocessing.du...
'Event', 'Queue', 'JoinableQueue', 'Pool', 'Value', 'Array', 'RawValue', 'RawArray', 'SUBDEBUG', 'SUBWARNING', ]
<|file_name|>0003_create_public_group.py<|end_file_name|><|fim▁begin|>from django.db import models, migrations<|fim▁hole|> PUBLIC_ID = 1 def apply_migration(apps, schema_editor): Group = apps.get_model('auth', 'Group') public_group = Group() public_group.name = "public" public_group.id = PUBLIC_ID p...
import uuid from django.contrib.auth.hashers import make_password
<|file_name|>setup.py<|end_file_name|><|fim▁begin|>from setuptools import setup, find_packages setup( name='django-facebook-comments', version=__import__('facebook_comments').__version__, description='Django implementation for Facebook Graph API Comments', long_description=open('README.md').read(), ...
license='BSD', packages=find_packages(),
<|file_name|>test_session_reloading.py<|end_file_name|><|fim▁begin|>from datetime import datetime from email.mime import text as mime_text from unittest.mock import MagicMock from unittest.mock import Mock from unittest.mock import patch import cauldron as cd from cauldron.session import reloading from cauldron.test i...
<|file_name|>issue13.go<|end_file_name|><|fim▁begin|>package input_files import ( "fmt" "os" "path/filepath" )<|fim▁hole|> func Issue13() string { someString := "hello" fmt.Println(someString, "world") fmt.Println(someString, "hello", "world") fmt.Println(someString, "Hello world %s", someString) fmt.Println(...
<|file_name|>input.py<|end_file_name|><|fim▁begin|>import ctypes.wintypes as ctypes import braille import brailleInput import globalPluginHandler <|fim▁hole|> INPUT_MOUSE = 0 INPUT_KEYBOARD = 1 INPUT_HARDWARE = 2 MAPVK_VK_TO_VSC = 0 KEYEVENTF_EXTENDEDKEY = 0x0001 KEYEVENTF_KEYUP = 0x0002 KEYEVENT_SCANCODE = 0...
import scriptHandler import inputCore import api
<|file_name|>AbstractItemWriteListener.java<|end_file_name|><|fim▁begin|>/* * Copyright 2012 International Business Machines Corp. * * See the NOTICE file distributed with this work for additional information * regarding copyright ownership. Licensed under the Apache License, * Version 2.0 (the "License"); ...
<|file_name|>caesar.py<|end_file_name|><|fim▁begin|>import cs50 import sys def main(): if len(sys.argv) != 2: print("You should provide cmd line arguments!") exit(1) #if sys.argv[1].isalpha() == False:<|fim▁hole|> kplainText = int(sys.argv[1]) cipher = [] plainText = cs50.get_string(...
#print("You should provide valid key!") #exit(1)
<|file_name|>ServerHandler.java<|end_file_name|><|fim▁begin|>package org.elsys.InternetProgramming; import java.io.BufferedReader; import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader; import java.io.OutputStream; import java.io.PrintWriter; import java.net.Socket; public class Ser...
} }
<|file_name|>WeightedIntegralTest.cpp<|end_file_name|><|fim▁begin|>#include <gtest/gtest.h> #include "math/integr/WeightedIntegral.h" #include "math/integr/IntegrationDensities.h" #include <stdexcept> #include <cmath> class WeightedIntegralTest: public testing::Test { }; TEST_F(WeightedIntegralTest,Test) {...
rql::integr::WeightedIntegral wu(rql::integr::WeightedIntegral::gen_xs(0, 1, 100), rql::integr::IntegrationDensities::Constant(1.0));
<|file_name|>187.py<|end_file_name|><|fim▁begin|>from math import log def num_prime_factors(upper_limit): """ Create an array whose entries are the number of not necessarily distinct prime factors of the index. The upper bound is the first number not included. """ factor_count = [0] * upper_limi...
for exponent in range(int(log(upper_limit, prime))): for hit in range(prime_power, upper_limit, prime_power): factor_count[hit] += 1
<|file_name|>NetworkBalancer.hpp<|end_file_name|><|fim▁begin|>#ifndef __NETWORKBALANCER_HPP #define __NETWORKBALANCER_HPP #include <stdlib.h> namespace Network { class NetworkBalancer { public: /** * @brief NetworkBalancer Class constructor */ NetworkBalancer(); ...
private:
<|file_name|>location_name_white_list.py<|end_file_name|><|fim▁begin|>import re WHITE_LIST = { 'names': { 'eno': {}, 'evo': {}, 'ii': {}, 'li': {'alias': 'Ii'}, 'utö': {}, 'usa': {} }, 'patterns': [ { 'find': re.compile('([A-ZÄÖa-zäö-]*)(mlk)'), 'replace': r'\1 mlk' } ...
}
<|file_name|>type_literals.d.ts<|end_file_name|><|fim▁begin|><|fim▁hole|> b: number | null; c: number | true; d: number | null | undefined; e: Array<string | null | undefined>; }<|fim▁end|>
export class UsesTypeLiterals { a: number | undefined;
<|file_name|>krad.initialize.js<|end_file_name|><|fim▁begin|>/* * Copyright 2005-2014 The Kuali Foundation * * Licensed under the Educational Community 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 * * htt...
<|file_name|>constants.js<|end_file_name|><|fim▁begin|>"use strict"; const root = require('./helpers.js').root const ip = require('ip'); exports.HOST = ip.address(); exports.DEV_PORT = 3000; exports.E2E_PORT = 4201; exports.PROD_PORT = 8088; exports.UNIVERSAL_PORT = process.env.PORT || 8000; exports.SHOW_WEBPACK_BUND...
// use this to import your own webpack config plugins for production use. ]
<|file_name|>blob_url_store.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/. */ #![allow(dead_code)] use dom::bindings::js::JS; use d...
use uuid::Uuid;
<|file_name|>list-stack.po.js<|end_file_name|><|fim▁begin|><|fim▁hole|>/* * Copyright (c) 2015-2018 Red Hat, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * h...
<|file_name|>pipelinelatest_runartifacts.rs<|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 * Generated by: https://openapi-generator.tech */ #[derive(Cl...
url: None, _class: None, }
<|file_name|>select_query_flags.rs<|end_file_name|><|fim▁begin|>use std::fmt; use std::str::FromStr; use std::convert::AsRef; use self::QueryFlagsType::{None, AllowPragma, AllowColumn, AllowUpdate, AllowLeadingNot, ExtQueryFlagsType}; #[derive (Debug)] pub enum QueryFlagsTypeError { Empt...
AllowLeadingNot => "ALLOW_LEADING_NOT", ExtQueryFlagsType(ref s) => s.as_ref(),
<|file_name|>resource-destruct.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.o...
struct shrinky_pointer { i: @@Cell<int>, }
<|file_name|>general_ledger.py<|end_file_name|><|fim▁begin|># Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals import frappe, erpnext from frappe.utils import flt, cstr, cint from frappe import _ from fr...
"debit": abs(debit_credit_diff) if debit_credit_diff < 0 else 0, "credit": debit_credit_diff if debit_credit_diff > 0 else 0, "cost_center": round_off_cost_center,
<|file_name|>Snapshot.cpp<|end_file_name|><|fim▁begin|>/* * Copyright 2010-2017 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 the License is located at * * http...
<|file_name|>__number.py<|end_file_name|><|fim▁begin|>from sys import version_info try: from collections.abc import Iterable, Container except ImportError: from collections import Iterable, Container from pyvalid import accepts from pyvalid.validators import AbstractValidator class NumberValidator(AbstractVa...
Returns (bool): True:
<|file_name|>0197_auto_20180528_1537.py<|end_file_name|><|fim▁begin|># Generated by Django 2.0.5 on 2018-05-28 15:37 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('scoping', '0196_auto_20180528_0902'), ] operations = [ migrations.AddFi...
migrations.AddField( model_name='docpar', name='maxX', field=models.FloatField(null=True),
<|file_name|>config.route.js<|end_file_name|><|fim▁begin|>(function () { 'use strict'; angular .module('app.home') .config(appRun);<|fim▁hole|> function appRun($stateProvider) { $stateProvider .state('root.home', { url: '/', templateUrl: 'app/home/home.html', controller: ...
/* @ngInject */
<|file_name|>app-settings.service.ts<|end_file_name|><|fim▁begin|>import { Injectable } from "@angular/core"; @Injectable() export class AppSettings { private readonly urlCacheKey = "apiurl"; <|fim▁hole|> return localStorage.getItem(this.urlCacheKey); } setApiUrl(url: string): void { localStorage.setItem(this.u...
getApiUrl(): string {
<|file_name|>cmd_config.py<|end_file_name|><|fim▁begin|><|fim▁hole|>import click @click.command('config', short_help='Display remote client config') @click.pass_obj def cli(obj): """Display client config downloaded from API server.""" for k, v in obj.items(): if isinstance(v, list): v = ',...
<|file_name|>api_tests.py<|end_file_name|><|fim▁begin|># Copyright 2015 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.apache.org/licenses/LICEN...
<|file_name|>models.py<|end_file_name|><|fim▁begin|>from datetime import date, datetime import os from django.conf import settings from django.contrib import admin from django.contrib.auth.models import User from django.db import models from django.db.models import Q from django.utils.timezone import now from pytz imp...
editable=True) notes = models.ManyToManyField(Notes, null=True, blank=True, editable=False) environment = models.ForeignKey(Development_Environment, null=True,
<|file_name|>Server.py<|end_file_name|><|fim▁begin|>#import RPi.GPIO as GPIO import time def ToString (List): # Coverts List to String return ''.join(List) def Setup (): def Wait (): reading_file=open('DataStore.txt', 'r') lines=reading_file.readlines() #print lines<|fim▁hole|> return True el...
GoodLine = lines[len(lines) - 1] #GoodLine is the last line of the file! if len(lines) > len(oldLinesGood): # If there are more lines in the new one one was added. So then that line should be read
<|file_name|>crawler.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python # -*- coding: utf-8 -*- """ crawler.py ~~~~~~~~~~~~~~ A brief description goes here. """<|fim▁hole|>import re import os import urlparse import threading import logging import logging.handlers import time import random import bs4 MINIM...
import csv import urllib2 import urllib
<|file_name|>gpSystem.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python # Line too long - pylint: disable=C0301 # Invalid name - pylint: disable=C0103 """ Copyright (c) 2004-Present Pivotal Software, Inc.<|fim▁hole|>the terms of the under the Apache License, Version 2.0 (the "License"); you may not use this file ...
This program and the accompanying materials are made available under
<|file_name|>ace.py<|end_file_name|><|fim▁begin|>''' Created on 2014. 9. 26. @author: jongyeob ''' from __future__ import absolute_import import sys import logging import re from . import utils from .utils import datetime as dt from .utils import download as dl <|fim▁hole|> DATA_DIR = 'data/' LOG = logging.getLogge...
<|file_name|>input.rs<|end_file_name|><|fim▁begin|>use std::collections::HashMap; use std::time::Instant; use glium::glutin::{ dpi::PhysicalPosition, event::{ElementState, Event, KeyboardInput, MouseButton, VirtualKeyCode, WindowEvent}, }; pub struct InputState { /// Position of the mouse pub mouse_po...
pub fn update(&mut self, event: &Event<()>) { if let Event::WindowEvent { ref event, .. } = *event { match *event { WindowEvent::CursorMoved {
<|file_name|>AboutFragment.java<|end_file_name|><|fim▁begin|>package com.yakami.light.view.fragment; import android.os.Bundle; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.TextView; import com.yakami.light.BuildConfig; import com.yakami.light.R; im...
@Bind(R.id.tv_about) TextView mAbout; public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
<|file_name|>plot.py<|end_file_name|><|fim▁begin|>import matplotlib.pyplot as plt from h5py import File from numpy import array def launch_plots(): # TODO set activation of different plots plot3d = plt.figure('Plot 3D') xy_plane = plt.figure('XY') xz_plane = plt.figure('XZ') yz_plane = plt.figure('YZ...
xz_plane.savefig('XZ.jpg') yz_plane.savefig('YZ.jpg') plt.show()
<|file_name|>MarkUnsafe.java<|end_file_name|><|fim▁begin|>package com.tbp.safemaps; import the.safemaps.R; import android.app.Activity; import android.content.Intent; import android.os.Bundle; import android.view.Menu; import android.view.MenuItem; import android.view.View; import android.view.View.OnClickListener; ...
super.onOptionsItemSelected(item); switch(item.getItemId())
<|file_name|>VDict.py<|end_file_name|><|fim▁begin|># Copyright 2010-2011, Sikuli.org # Released under the MIT License. from org.sikuli.script import VDictProxy import java.io.File ## # VDict implements a visual dictionary that has Python's conventional dict # interfaces. # # A visual dictionary is a data type for sto...
def get1(self, key, similarity=_DEFAULT_SIMILARITY):