prompt
large_stringlengths
70
991k
completion
large_stringlengths
0
1.02k
<|file_name|>_tickformatstops.py<|end_file_name|><|fim▁begin|>import _plotly_utils.basevalidators class TickformatstopsValidator(_plotly_utils.basevalidators.CompoundArrayValidator): def __init__( self, plotly_name="tickformatstops", parent_name="contour.colorbar", **kwargs ): super(Tickformat...
you explicitly show it with `visible: true`.
<|file_name|>lib.rs<|end_file_name|><|fim▁begin|>//! Simulated broker used for backtests. Contains facilities for simulating trades, //! managing balances, and reporting on statistics from previous trades. //! //! See README.md for more information about the specifics of the SimBroker implementation //! and a descript...
Ok(ref message) => match message { &BrokerMessage::PositionClosed{position: ref pos, position_id: pos_uuid, reason: _, timestamp: _} => { self.accounts.position_closed(pos, pos_uuid);
<|file_name|>startup.js<|end_file_name|><|fim▁begin|>Meteor.startup(function () { Meteor.defer(function () { Session.setDefault("checked", $("input[type=checkbox]").is(":checked")); }); if (Meteor.isCordova) { window.alert = navigator.notification.alert; } Push.addListener('message...
}); });
<|file_name|>JSonUtils.cpp<|end_file_name|><|fim▁begin|>/* Copyright (C) 2007 National Institute For Space Research (INPE) - Brazil. This file is part of TerraMA2 - a free and open source computational platform for analysis, monitoring, and alert of geo-environmental extremes. TerraMA2 is free software: you c...
if(!(json.contains("start_date")
<|file_name|>VulkanMemoryAllocator.cpp<|end_file_name|><|fim▁begin|>#define VMA_IMPLEMENTATION #include <vk_mem_alloc.h> #include "VulkanMemoryAllocator.h" #include "VulkanUtility.h" #include "Core/Assertion.h" namespace cube { namespace rapi { void VulkanMemoryAllocator::Initialize(VkInstance instan...
CHECK_VK(res, "Failed to create vulkan memory allocator."); }
<|file_name|>VoteCandidate.js<|end_file_name|><|fim▁begin|>import React from 'react'; let lastClicked = 0; export default class Candidate extends React.Component { constructor(props) { super(props); this.state = { wiggle: false }; this.castVote = this.castVote.bind(this); this.wiggleDone = this.wig...
<|file_name|>learning_rate_schedule.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:...
the training progresses. This schedule applies a cosine decay function
<|file_name|>tests.rs<|end_file_name|><|fim▁begin|><|fim▁hole|> mod pcap; mod pcapng;<|fim▁end|>
#![allow(clippy::unreadable_literal)]
<|file_name|>test_request.py<|end_file_name|><|fim▁begin|># ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ # # Description: File system resilience testing application # Author: Hubert Kario <hubert@kario.pl> # # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ # # Copyrig...
sock.recv_into.return_value = 10
<|file_name|>MySQLProjectOtherContributionDAO.java<|end_file_name|><|fim▁begin|>/***************************************************************** * This file is part of CCAFS Planning and Reporting Platform. * CCAFS P&R is free software: you can redistribute it and/or modify * it under the terms of the GNU General ...
StringBuilder query = new StringBuilder(); int result = -1;
<|file_name|>traits.rs<|end_file_name|><|fim▁begin|>// Copyright 2015-2017 Parity Technologies (UK) Ltd. // This file is part of Parity. // Parity 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 vers...
pub writes: RefCell<Vec<KeyValue>>, pub removes: RefCell<Vec<Vec<u8>>>, }
<|file_name|>grid.rs<|end_file_name|><|fim▁begin|>// This file was generated by gir (https://github.com/gtk-rs/gir) // from gir-files (https://github.com/gtk-rs/gir-files) // DO NOT EDIT #[cfg(any(feature = "v3_10", feature = "dox"))] use BaselinePosition; use Buildable; use Container; use Orientable; use PositionType...
from_glib(ffi::gtk_grid_get_row_homogeneous(self.to_glib_none().0)) } }
<|file_name|>main.js<|end_file_name|><|fim▁begin|>const electron = require('electron') const app = electron.app const BrowserWindow = electron.BrowserWindow const {ipcMain} = require('electron') const {dialog} = require('electron') const {Menu} = require('electron') import {enableLiveReload} from 'electron-compile' ...
pathname: path.join(__dirname, 'html/index.html'),
<|file_name|>json_utils.py<|end_file_name|><|fim▁begin|>""" Utilities for dealing with JSON. """ import simplejson from xmodule.modulestore import EdxJSONEncoder class EscapedEdxJSONEncoder(EdxJSONEncoder): """ Class for encoding edx JSON which will be printed inline into HTML templates. """ def...
return simplejson.dumps(
<|file_name|>geom.py<|end_file_name|><|fim▁begin|># Copyright 2020 Google LLC #<|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 # # https://www.apache.org/licenses/LICENSE-2.0 # ...
<|file_name|>Method.ts<|end_file_name|><|fim▁begin|>namespace SitecoreExtensions.Http {<|fim▁hole|> export enum Method { POST, GET } }<|fim▁end|>
<|file_name|>sfm_reconst.py<|end_file_name|><|fim▁begin|>""" .. _sfm-reconst: ============================================== Reconstruction with the Sparse Fascicle Model ============================================== In this example, we will use the Sparse Fascicle Model (SFM) [Rokem2015]_, to reconstruct the fiber ...
""" For the purpose of the example, we will consider a small volume of data
<|file_name|>menu.js<|end_file_name|><|fim▁begin|>$(document).ready(function() { $('#mostrar_menu').click(function() { $('#sidebar-wrapper').toggle(300); }); <|fim▁hole|><|fim▁end|>
});
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|>from flask import Flask <|fim▁hole|>app.config.from_object('blog.config') from blog import views<|fim▁end|>
app = Flask(__name__)
<|file_name|>lib.rs<|end_file_name|><|fim▁begin|>/* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at https://mozilla.org/MPL/2.0/. */ #[macro_use] extern crate serde; use euclid::default::{Point2D,...
assert!(pixels.len() % 4 == 0);
<|file_name|>unnecessary_sort_by.rs<|end_file_name|><|fim▁begin|>// run-rustfix #![allow(clippy::stable_sort_primitive)] use std::cmp::Reverse; fn unnecessary_sort_by() { fn id(x: isize) -> isize { x } let mut vec: Vec<isize> = vec![3, 6, 1, 2, 5]; // Forward examples vec.sort_by(|a, b| ...
<|file_name|>UpdateUiCallBack.java<|end_file_name|><|fim▁begin|>package com.umeng.soexample.run.step; /** * 步数更新回调<|fim▁hole|> /** * 更新UI步数 * * @param stepCount 步数 */ void updateUi(int stepCount); }<|fim▁end|>
* Created by dylan on 16/9/27. */ public interface UpdateUiCallBack {
<|file_name|>dex_file.cc<|end_file_name|><|fim▁begin|>/* * Copyright (C) 2011 The Android Open Source Project * * 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...
return false; } c = signature[offset];
<|file_name|>cs_effects.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python2 from GSettingsWidgets import * from ChooserButtonWidgets import TweenChooserButton, EffectChooserButton EFFECT_SETS = { "cinnamon": ("traditional", "traditional", "traditional", "none", "none", "none"), "scale": ("scale", ...
# UNMAXIMIZING WINDOWS widget = self.make_effect_group(_("Unmaximizing windows"), "unmaximize") settings.add_row(widget)
<|file_name|>test_performance_parser.py<|end_file_name|><|fim▁begin|>import json from treeherder.log_parser.parsers import (EmptyPerformanceData, PerformanceParser) def test_performance_log_parsing_malformed_perfherder_data(): """ If we have malformed perfherder dat...
""" parser = PerformanceParser()
<|file_name|>DeadEndLevel.java<|end_file_name|><|fim▁begin|>package com.github.epd.sprout.levels; import com.github.epd.sprout.Assets; import com.github.epd.sprout.messages.Messages; import java.util.Arrays; public class DeadEndLevel extends Level { private static final int SIZE = 5; { color1 = 0x534f3e; col...
<|file_name|>Rectangle.js<|end_file_name|><|fim▁begin|>import { rectangle } from 'leaflet';<|fim▁hole|> import boundsType from './types/bounds'; import Path from './Path'; export default class Rectangle extends Path { static propTypes = { bounds: boundsType.isRequired, }; componentWillMount() { super.co...
<|file_name|>eo.js<|end_file_name|><|fim▁begin|>/* Copyright (c) 2003-2015, CKSource - Frederico Knabben. All rights reserved. For licensing, see LICENSE.md or http://ckeditor.com/license */ CKEDITOR.plugins.setLang( 'newpage', 'eo', { toolbar: 'Nova Paĝo' <|fim▁hole|><|fim▁end|>
} );
<|file_name|>database.py<|end_file_name|><|fim▁begin|>import datetime from sqlalchemy import create_engine, ForeignKey, Column, Integer, String, Text, Date, Table, Boolean from sqlalchemy.orm import sessionmaker, relationship from sqlalchemy.ext.declarative import declarative_base from . import app from flask_login imp...
"user_id": self.user_id, } return results
<|file_name|>datapub.py<|end_file_name|><|fim▁begin|>"""Publishing native (typically pickled) objects. """ # Copyright (c) IPython Development Team. # Distributed under the terms of the Modified BSD License. from traitlets.config import Configurable from ipykernel.inprocess.socket import SocketABC from traitlets impo...
session = self.session buffers = serialize_object(data,
<|file_name|>cachekeys.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- from __future__ import unicode_literals import json<|fim▁hole|> from django.utils import six URL_LIST_CACHE = 'powerpages:url_list' SITEMAP_CONTENT = 'powerpages:sitemap' def get_cache_name(prefix, name): """ Cache name constru...
import hashlib
<|file_name|>Test.java<|end_file_name|><|fim▁begin|>package main.java.test; import java.util.Optional; import main.java.modul.Catalog; import main.java.modul.Categorie; import main.java.modul.Oferta; import main.java.modul.Produs; import main.java.service.Log; import main.java.util.Printer; import main.java...
<|file_name|>EndpointConfig.java<|end_file_name|><|fim▁begin|>/******************************************************************************* * Copyright (C) 2017 Push Technology Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the Licen...
}
<|file_name|>ContextualMenu.Checkmarks.Example.d.ts<|end_file_name|><|fim▁begin|>import * as React from 'react'; import './ContextualMenuExample.scss'; export interface IContextualMenuMultiselectExampleState { selection?: { [key: string]: boolean; }; isContextMenuVisible?: boolean; } export declare ...
private _onDismiss(); }
<|file_name|>views.py<|end_file_name|><|fim▁begin|># automate/server/user/views.py ################# #### imports #### ################# #from flask import render_template, Blueprint, url_for, \ # redirect, flash, request #from flask_login import login_user, logout_user, login_required #from automate.server impo...
<|file_name|>loop-break-cont-1.rs<|end_file_name|><|fim▁begin|>// run-pass pub fn main() { let _i = 0_usize; loop { break; } assert!(true);<|fim▁hole|><|fim▁end|>
}
<|file_name|>MockCodeGeneratorListItemTest.java<|end_file_name|><|fim▁begin|>package fr.jmini.asciidoctorj.converter.mockcode; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.when; import java.util.Collections; import org.asciidoctor.ast.ListItem; import org.junit.Test; import fr.jmini.asc...
when(mockListItem1.getText()).thenReturn("t"); when(mockListItem1.getSource()).thenReturn("s"); when(mockListItem1.hasText()).thenReturn(true); return mockListItem1;
<|file_name|>15.2.3.6-3-114.js<|end_file_name|><|fim▁begin|>// Copyright (c) 2012 Ecma International. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. /*--- es5id: 15.2.3.6-3-114 description: > Object.defineProperty - 'configurable' property in 'Attributes' is a Bool...
<|file_name|>source-map.ts<|end_file_name|><|fim▁begin|>const maps = require('source-map-support'); <|fim▁hole|><|fim▁end|>
maps.install({environment: 'node'});
<|file_name|>ExtendedMetadataTest.java<|end_file_name|><|fim▁begin|>/* * $Id$ * * Copyright 2006 University of Dundee. All rights reserved. * Use is subject to license terms supplied in LICENSE.txt */ package ome.server.itests.hibernate; import java.util.Arrays; import java.util.Set; import ome.model.IAnno...
.getName(), "pixels");
<|file_name|>kmeans.py<|end_file_name|><|fim▁begin|>from .estimator_base import * class H2OKMeansEstimator(H2OEstimator): def __init__(self, model_id=None, k=None, max_iterations=None,standardize=None,init=None,seed=None, nfolds=None,fold_assignment=None, user_points=None,ignored_columns=None, ...
@property def seed(self): return self._parms["seed"]
<|file_name|>OpenWikiOnString.py<|end_file_name|><|fim▁begin|>import sublime, sublime_plugin<|fim▁hole|>import webbrowser class OpenWikiOnString(sublime_plugin.TextCommand): def run(self, edit): query = self.view.substr(self.view.sel()[0]) webbrowser.open_new("http://wiki.sa-mp.com/wiki/" + query)<|fim▁end|>
<|file_name|>manager.go<|end_file_name|><|fim▁begin|>/* * Copyright (C) 2018 The "MysteriumNetwork/node" Authors. * * 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 L...
import ( "encoding/json"
<|file_name|>path.py<|end_file_name|><|fim▁begin|># -*- encoding: utf-8 -*- """ lunaport.dao.line ~~~~~~~~~~~~~~~~~ Storage interaction logic for line resource. """ import pprint pp = pprint.PrettyPrinter(indent=4).pprint from sqlalchemy import text, exc from ..wsgi import app, db from .. domain.line im...
next_page = 2 prev_page = None
<|file_name|>register.go<|end_file_name|><|fim▁begin|>/*<|fim▁hole|>Copyright 2015 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE...
<|file_name|>test_api.py<|end_file_name|><|fim▁begin|>""" Tests for Blocks api.py """ from django.test.client import RequestFactory from course_blocks.tests.helpers import EnableTransformerRegistryMixin from student.tests.factories import UserFactory from xmodule.modulestore import ModuleStoreEnum from xmodule.module...
blocks = get_blocks(self.request, self.course.location, self.user, nav_depth=5, requested_fields=['nav_depth']) vertical_block = self.store.get_item(self.course.id.make_usage_key('vertical', 'vertical_x1a')) problem_block = self.store.get_item(self.course.id.make_usage_key('problem', 'problem_x1...
<|file_name|>custom_returning_requires_nonaggregate.rs<|end_file_name|><|fim▁begin|>extern crate diesel; use diesel::*; use diesel::dsl::count; table! { users { id -> Integer, name -> VarChar, } } #[derive(Insertable)] #[table_name="users"] pub struct NewUser { name: String, } fn main() ...
let stmt = update(users.filter(id.eq(1))).set(name.eq("Bill")).returning(count(id)); let new_user = NewUser {
<|file_name|>huddle-test.js<|end_file_name|><|fim▁begin|>/*global assert: false, refute: false */ var buster = require("buster"), huddle = require("../lib/huddle.js"), resources; buster.testCase('Huddle', { setUp: function () { resources = new huddle.Huddle(); }, "Empty input": function ()...
assert.equals(resources.getStylesheets()['app']['b.less'], 'text/less');
<|file_name|>main.py<|end_file_name|><|fim▁begin|>'''This module contains some glue code encapsulating a "main" process. The code here is aimed at wrapping the most common tasks involved in creating and, especially, training a neural network model. ''' import climate import datetime import downhill import os import w...
self.network = network(*args, **kwargs)
<|file_name|>export_global_model.py<|end_file_name|><|fim▁begin|># Lint as: python3 # Copyright 2020 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 ...
<|file_name|>dialogflow_v2_generated_conversation_profiles_update_conversation_profile_async.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- # Copyright 2022 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You ma...
async def sample_update_conversation_profile(): # Create a client
<|file_name|>status.rs<|end_file_name|><|fim▁begin|>//! Status Codes use std::fmt; use std::num::{FromPrimitive, ToPrimitive}; use std::mem::transmute; use std::cmp::Ordering::{self, Less, Equal, Greater}; // shamelessly lifted from Teepee. I tried a few schemes, this really // does seem like the best. /// An HTTP s...
/// For HTTP/2.0, statuses belonging to the 1xx Informational class are invalid.
<|file_name|>init.js<|end_file_name|><|fim▁begin|>'use strict' //Globals will be the stage which is the parrent of all graphics, canvas object for resizing and the renderer which is pixi.js framebuffer. var stage = new PIXI.Container(); var canvas = document.getElementById("game");; var renderer = PIXI.autoDetectRende...
}else{ canvas.style.width = 1000 * optimalRatio + "px"; canvas.style.height = 500 * optimalRatio + "px";
<|file_name|>DbGroupBreastModel.java<|end_file_name|><|fim▁begin|>package com.ms.meizinewsapplication.features.meizi.model;<|fim▁hole|>import com.ms.retrofitlibrary.web.MyOkHttpClient; import org.loader.model.OnModelListener; import java.util.List; import rx.Observable; import rx.Subscription; /** * Created by 啟成 ...
import android.content.Context; import com.ms.meizinewsapplication.features.base.pojo.ImgItem;
<|file_name|>source_module.py<|end_file_name|><|fim▁begin|>class MyClass():<|fim▁hole|><|fim▁end|>
@classmethod def foo_method(cls): spam = "eggs"
<|file_name|>import-duplicate-src-1.js<|end_file_name|><|fim▁begin|>// namespace line first import * as XA from "X";<|fim▁hole|><|fim▁end|>
import XD, { X2 } from "X"; import { X3 } from "X";
<|file_name|>generateTemplate.py<|end_file_name|><|fim▁begin|>def getSpeciesValue(species): """ Return the initial amount of a species. If species.isSetInitialAmount() == True, return the initial amount. Otherwise, return the initial concentration. ***** args ***** species: a libsbml.Sp...
out_file.write("######################## particles\n\n") out_file.write("<particles> 100 </particles>\n\n")
<|file_name|>parser.py<|end_file_name|><|fim▁begin|>#! /usr/bin/env python class ParserError(Exception): pass class Sentence(object): def __init__(self, subject, verb, object): # remember we take ('noun', 'princess') tuples and convert them self.subject = subject[1] self.verb = verb[1...
obj = parse_object(word_list)
<|file_name|>_tracmor.src.js<|end_file_name|><|fim▁begin|>/////////////////////////////////////////////////// // The Qcodo Object is used for everything in Qcodo /////////////////////////////////////////////////// var qcodo = { initialize: function() { //////////////////////////////// // Browser-related functi...
};
<|file_name|>Contacts.js<|end_file_name|><|fim▁begin|>/** * Created by raynald on 8/22/14. */ App.Collections.Contacts = Backbone.Collection.extend({ model : App.Models.Contact,<|fim▁hole|><|fim▁end|>
localStorage: new Backbone.LocalStorage('my-contacts') });
<|file_name|>test.js<|end_file_name|><|fim▁begin|>tressa.title('HyperHTML'); tressa.assert(typeof hyperHTML === 'function', 'hyperHTML is a function'); try { tressa.log(''); } catch(e) { tressa.log = console.log.bind(console); } tressa.async(function (done) { tressa.log('## injecting text and attributes'); var i ...
tressa.assert(/<div><!--.+?--><\/div>/.test(div.innerHTML), 'dropped all children'); })
<|file_name|>past-date-validator-widget-factory-spec.js<|end_file_name|><|fim▁begin|>describe('PastDateValidatorWidgetFactory', function() { var Mock = {}; var factory; var whoAmI; beforeEach(function() { angular.mock.module('studio'); mockElement(); inject(function(_$injector...
}); it('should start the data field as date', function() {
<|file_name|>152_add_message_id_to_event.py<|end_file_name|><|fim▁begin|>"""add message column to event Revision ID: 211e93aff1e1<|fim▁hole|>Revises: 2493281d621 Create Date: 2015-03-20 18:50:29.961734 """ # revision identifiers, used by Alembic. revision = '211e93aff1e1' down_revision = '2f3c8fa3fc3a' from alembic...
<|file_name|>file_stream.cc<|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. #include "net/base/file_stream.h" #include "base/location.h" #include "base/message_loop/mes...
int FileStream::WriteSync(const char* buf, int buf_len) { base::ThreadRestrictions::AssertIOAllowed();
<|file_name|>ByteArrayTypeDescriptor.java<|end_file_name|><|fim▁begin|>/* * Hibernate, Relational Persistence for Idiomatic Java * * Copyright (c) 2010, Red Hat Inc. or third-party contributors as * indicated by the @author tags or express copyright attribution * statements applied by the authors. All third-party...
return (X) unwrapBytes( value ); } if ( InputStream.class.isAssignableFrom( type ) ) {
<|file_name|>test_cube_to_pp.py<|end_file_name|><|fim▁begin|># (C) British Crown Copyright 2010 - 2017, 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 # Free Software Foundation,...
# test with coord
<|file_name|>spacetodepth_op_test.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://...
def testBasicFloat16(self):
<|file_name|>neg.rs<|end_file_name|><|fim▁begin|>use ::{BroadcastMode, Instruction, MaskReg, MergeMode, Mnemonic, OperandSize, Reg, RoundingMode}; use ::RegType::*; use ::instruction_def::*; use ::Operand::*; use ::Reg::*; use ::RegScale::*; fn neg_1() { run_test(&Instruction { mnemonic: Mnemonic::NEG, operand1: S...
} fn neg_13() { run_test(&Instruction { mnemonic: Mnemonic::NEG, operand1: Some(Direct(DI)), operand2: None, operand3: None, operand4: None, lock: false, rounding_mode: None, merge_mode: None, sae: false, mask: None, broadcast: None }, &[102, 247, 223], OperandSize::Qword)
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|><|fim▁hole|>from . import ir_filesystem_directory from . import ir_filesystem_file<|fim▁end|>
# -*- coding: utf-8 -*- # Copyright 2017 Onestein (<http://www.onestein.eu>) # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
<|file_name|>test_bcrypt.py<|end_file_name|><|fim▁begin|># -*- coding:utf-8 -*- from django import test from django.conf import settings from django.contrib.auth import authenticate from django.contrib.auth.models import User from django.core.management import call_command from mock import patch from nose.tools import...
assert not authenticate(username='jude', password=u'çççbbbààà') @patch.object(settings._wrapped, 'HMAC_KEYS', dict()) def test_nokey(self):
<|file_name|>launcher.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env $PYTHON$ # Copyright 2000-2020 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. import os import socket import struct import sys import traceback # See com.intellij.idea.SocketLoc...
print_usage(argv[0]) exit(0)
<|file_name|>normalizer.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python # This file is part of VoltDB. # Copyright (C) 2008-2011 VoltDB Inc. # # 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 So...
2. sort them on the rest of the columns. """
<|file_name|>BullBenchThread.cpp<|end_file_name|><|fim▁begin|>#include <string.h><|fim▁hole|>#include <sys/socket.h> #include <unistd.h> #include <errno.h> #include <cstdlib> #include <queue> #include <iostream> #include <sstream> #include "BullBenchThread.h" #include "BullBench.h" #define REQUEST_SIZE 2048 void Bul...
<|file_name|>index.js<|end_file_name|><|fim▁begin|>export goCommand from './goCommand'<|fim▁hole|>export goReducer from './goReducer' export parseBestmove from './parseBestmove' export parseId from './parseId' export parseInfo from './parseInfo' export parseOption from './parseOption' export initReducer from './initRed...
<|file_name|>localEulerDdtScheme.C<|end_file_name|><|fim▁begin|>/*---------------------------------------------------------------------------*\ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org \\ / A nd...
template<class Type> tmp<GeometricField<Type, fvPatchField, volMesh>> localEulerDdtScheme<Type>::fvcDdt
<|file_name|>pull.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python3 """ This script can be used to automatically pull translations from Transifex, commit, push, and merge them to their respective repos. To use, export an environment variable `GITHUB_ACCESS_TOKEN`. The token requires GitHub's "repo" scope. Run th...
os.environ['REVISION_CFG'] = '' os.environ['SKIP_NPM_INSTALL'] = 'True' os.environ['LANG'] = 'C.UTF-8'
<|file_name|>debug.py<|end_file_name|><|fim▁begin|>""" External serialization for testing remote module loading. """ from tiddlyweb.serializations import SerializationInterface class Serialization(SerializationInterface): def list_recipes(self, recipes): print recipes def list_bags(self, bags): ...
print "as_r: %s" % input def bag_as(self, bag): print "b_as: %s" % bag
<|file_name|>decider.go<|end_file_name|><|fim▁begin|>// Copyright © 2016 NAME HERE <EMAIL ADDRESS> // // 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...
package cmd import (
<|file_name|>sql_util.py<|end_file_name|><|fim▁begin|>def table_exists(curs, table_name=''): ''' If table_name is a schema qualified table name and it exists it is returned, else if it is not schema qualified and the table name exists in the search path then that schema qualified table name is returned...
for any non-primary key or unique indexes on the given table and the index name.
<|file_name|>dispatcher_test.go<|end_file_name|><|fim▁begin|>package app import ( "bytes" "github.com/ahmedkamals/foo-protocol-proxy/analysis" "github.com/ahmedkamals/foo-protocol-proxy/config" "github.com/ahmedkamals/foo-protocol-proxy/handlers" "github.com/ahmedkamals/foo-protocol-proxy/testingutil" "github.co...
<|file_name|>scalar.rs<|end_file_name|><|fim▁begin|><|fim▁hole|>use test::{black_box, Bencher}; use tipb::ScalarFuncSig; fn get_scalar_args_with_match(sig: ScalarFuncSig) -> (usize, usize) { // Only select some functions to benchmark let (min_args, max_args) = match sig { ScalarFuncSig::LtInt => (2, 2)...
// Copyright 2021 TiKV Project Authors. Licensed under Apache-2.0. use collections::HashMap; use std::usize;
<|file_name|>layout.js<|end_file_name|><|fim▁begin|>import React from 'react' import DocumentTitle from 'react-document-title' import ReactHeight from 'react-height' import Header from './header/header' import Content from './content/content' import Footer from './footer/footer' import { APP_NAME } from '../constants'...
render() { const hfStyle = {
<|file_name|>base.py<|end_file_name|><|fim▁begin|>import pkg_resources from datetime import datetime import re from inbox.api.validation import ( get_recipients, get_attachments, get_thread, get_message) from inbox.api.err import InputError from inbox.contacts.process_mail import update_contacts_from_message from ...
return attachment_dicts
<|file_name|>main.js<|end_file_name|><|fim▁begin|>jQuery(document).ready(function(){ jQuery('.carousel').carousel() var FPS = 30; var player = $('#player') var pWidth = player.width(); $window = $(window) var wWidth = $window.width(); setInterval(function() { update(); }, 1000/FPS); function updat...
})
<|file_name|>linkedlist_2.py<|end_file_name|><|fim▁begin|>class Node: def __init__(self,data): self.data = data self.next = None<|fim▁hole|> def __init__(self): self.head = None def push(self, newdata): #in front newnode = Node(newdata) newnode.next = self.head self.head = newnode def insertAfter(self,...
class LinkedList:
<|file_name|>test_twelve_tone.py<|end_file_name|><|fim▁begin|><|fim▁hole|>from twelve_tone.cli import main def test_main(): runner = CliRunner() result = runner.invoke(main, []) assert result.exit_code == 0<|fim▁end|>
from click.testing import CliRunner
<|file_name|>eventSIPHeaderField.py<|end_file_name|><|fim▁begin|>try: from cStringIO import StringIO except ImportError: from StringIO import StringIO from ...sipmessaging import SIPHeaderField from ...sipmessaging import classproperty class EventSIPHeaderField(SIPHeaderField): # noinspection PyNestedDeco...
return cls.new_for_field_name_and_value_string(field_name=field_name, field_value_string=field_value_string)
<|file_name|>day_14.rs<|end_file_name|><|fim▁begin|>use tdd_kata::string_calc_kata::iter_1::day_14::evaluate; #[cfg(test)] mod tests { use super::*; #[test] fn test_eval_simple_num() { assert_eq!(evaluate("1"), Ok(1.0)); } #[test] fn test_eval_three_digit_num() { assert_eq!(e...
} #[test]
<|file_name|>intermediate_catch_event_type.py<|end_file_name|><|fim▁begin|># coding=utf-8 """ Class used for representing tIntermediateCatchEvent of BPMN 2.0 graph """ import graph.classes.events.catch_event_type as catch_event class IntermediateCatchEvent(catch_event.CatchEvent): """ Class used for represent...
""" super(IntermediateCatchEvent, self).__init__()
<|file_name|>template.go<|end_file_name|><|fim▁begin|>package main import ( "compress/gzip" "crypto/md5" "encoding/hex" "html/template" "log" "net/http" "strings" "time" "github.com/dustin/go-humanize" ) var tmpl = template.Must(template.New("").Funcs(template.FuncMap{ "User": UserByID, "Comma": func(n in...
} return w, func() error { return nil } }
<|file_name|>get_code_stats.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python # # $Id: get_code_stats.py 9318 2011-06-10 02:37:10Z nathan_george $ # # Proprietary and confidential. # Copyright $Date:: 2011#$ Perfect Search Corporation. # All rights reserved. # import sys import os import re import optparse import m...
<|file_name|>typings.d.ts<|end_file_name|><|fim▁begin|>// Typings reference file, you can add your own global typings here // https://www.typescriptlang.org/docs/handbook/writing-declaration-files.html declare var System: any;<|fim▁hole|><|fim▁end|>
declare module "file-saver";
<|file_name|>retryhandler.py<|end_file_name|><|fim▁begin|># Copyright (c) 2012-2013 Mitch Garnaat http://garnaat.org/ # Copyright 2012-2014 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 t...
been exceeded, then False will be returned or the retryable_exceptions
<|file_name|>wsgi.py<|end_file_name|><|fim▁begin|>import os import os.path import sys ROOT = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) # Add apps and lib directories to PYTHONPATH sys.path = [ ROOT, os.path.join(ROOT, 'apps'), ] + sys.path os.environ.setdefault("DJANGO_SETTINGS_MODULE", "k...
application = get_wsgi_application()
<|file_name|>CurrencyFairURI.java<|end_file_name|><|fim▁begin|><|fim▁hole|>package com.nilsonmassarenti.app.currencyfair.model; /** * This class is to manager URL of Rest. * @author nilsonmassarenti - nilsonmassarenti@gmail.com * @version 0.1 * Last update: 03-Mar-2015 12:20 am */ public class CurrencyFairURI { ...
<|file_name|>test_generators.py<|end_file_name|><|fim▁begin|>tutorial_tests = """ Let's try a simple generator: >>> def f(): ... yield 1 ... yield 2 >>> for i in f(): ... print(i) 1 2 >>> g = f() >>> next(g) 1 >>> next(g) 2 "Falling off the end" stops the gen...
This one caused a crash (see SF bug 567538): >>> def f():
<|file_name|>CatAllocationTestCase.java<|end_file_name|><|fim▁begin|>/* * Licensed to Elasticsearch under one or more contributor * license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright * ownership. Elasticsearch licenses this file to you under * the Ap...
import java.util.Map;
<|file_name|>features.ts<|end_file_name|><|fim▁begin|>import * as vscode from 'vscode'; import { workspace } from 'vscode'; import * as gitflowUtils from '../helpers/gitflowUtils'; import * as gitUtils from '../helpers/gitUtils'; import * as path from 'path'; import { InitConfigSettings } from '../settings/configSettin...
<|file_name|>constant.js<|end_file_name|><|fim▁begin|>/* <|fim▁hole|> * @namespace hifive.pitalium.explorer.constant */ h5.u.obj.expose('hifive.pitalium.explorer.constant', {}); })();<|fim▁end|>
* Copyright (C) 2015-2017 NS Solutions Corporation, All Rights Reserved. */ (function() { /**
<|file_name|>database_admin_client_config.py<|end_file_name|><|fim▁begin|>config = { "interfaces": { "google.spanner.admin.database.v1.DatabaseAdmin": { "retry_codes": { "idempotent": ["DEADLINE_EXCEEDED", "UNAVAILABLE"], "non_idempotent": [], }, ...
"max_retry_delay_millis": 32000,