prompt
large_stringlengths
70
991k
completion
large_stringlengths
0
1.02k
<|file_name|>default.rs<|end_file_name|><|fim▁begin|>use malachite_nz::integer::Integer; #[test] fn test_default() {<|fim▁hole|> assert!(default.is_valid()); assert_eq!(default, 0); assert_eq!(default.to_string(), "0"); }<|fim▁end|>
let default = Integer::default();
<|file_name|>MountainRangeColors.java<|end_file_name|><|fim▁begin|>/* * Copyright (c) 2018. * * This file is part of AvaIre. * * AvaIre 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 o...
<|file_name|>collections.ts<|end_file_name|><|fim▁begin|>import { List, Set, fromJS, OrderedMap } from 'immutable'; import { get, escapeRegExp } from 'lodash'; import { stringTemplate } from 'netlify-cms-lib-widgets'; import consoleError from '../lib/consoleError'; import { CONFIG_SUCCESS } from '../actions/config'; i...
fields: List<EntryField>, updater: (field: EntryField) => EntryField, done = () => false, ) {
<|file_name|>setup.py<|end_file_name|><|fim▁begin|># coding=utf-8 from setuptools import setup from setuptools.command.test import test class TestHook(test): def run_tests(self): import nose<|fim▁hole|> name='lxml-asserts', version='0.1.2', description='Handy functions for testing lxml etree o...
nose.main(argv=['nosetests', 'tests/', '-v', '--logging-clear-handlers']) setup(
<|file_name|>0021_auto__del_customer__del_unique_customer_company_name_contact_name_cont.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- import datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): ...
'provider': ('django.db.models.fields.CharField', [], {'default': "''", 'max_length': '255'}), 'reading': ('django.db.models.fields.FloatField', [], {}), 'reading_accuracy': ('django.db.models.fields.FloatField', [], {}),
<|file_name|>_make.py<|end_file_name|><|fim▁begin|>from __future__ import absolute_import, division, print_function import hashlib import linecache import sys import warnings from operator import itemgetter from . import _config from ._compat import PY2, isclass, iteritems, metadata_proxy, set_closure_cell from .exc...
<|file_name|>utils.py<|end_file_name|><|fim▁begin|>#-*- coding: utf-8 -*-<|fim▁hole|>#それらのフロールールで指定していたMatchにIPアドレス情報(サブネット)を追加 #mitigate時はなんでもPacket-Inするルールは不要なので削除したまま #mitigate後はなんでもPacket-Inするルールから突っ込んでいく import logging import socket import struct import ipaddress #packet_in_handlerにて、受け取ったパケットのipv4がsubnetに属するか調べる...
#既存のフロールールを全て一旦削除
<|file_name|>emit_notices.py<|end_file_name|><|fim▁begin|>import logging from django.core.management.base import BaseCommand from notifications.engine import send_all<|fim▁hole|> class Command(BaseCommand): help = "Emit queued notices." def handle(self, *args, **options): logging.basicConfig(level=lo...
<|file_name|>dropout.rs<|end_file_name|><|fim▁begin|>use prelude::*; use kernels::ffi::*; use densearray::prelude::*; use operator::prelude::*; use rng::xorshift::{Xorshiftplus128Rng}; use rand::{Rng, thread_rng}; //use rand::distributions::{IndependentSample}; //use rand::distributions::range::{Range}; use std::cell...
<|file_name|>simple_executor.rs<|end_file_name|><|fim▁begin|>use crate::task::Task; use alloc::collections::VecDeque; use core::task::{RawWaker, RawWakerVTable, Waker}; pub struct SimpleExecutor { task_queue: VecDeque<Task>, } impl SimpleExecutor { pub fn new() -> SimpleExecutor { SimpleExecutor { ...
fn dummy_raw_waker() -> RawWaker { fn no_op(_: *const ()) {} fn clone(_: *const ()) -> RawWaker { dummy_raw_waker() }
<|file_name|>app.py<|end_file_name|><|fim▁begin|>from __future__ import print_function from __future__ import division from builtins import str from past.utils import old_div import copy from datetime import datetime, timedelta import dateutil.parser from functools import wraps import inspect import json import logging...
), root=root,
<|file_name|>brightcovePlayer.py<|end_file_name|><|fim▁begin|>import httplib from pyamf import AMF0, AMF3 from pyamf import remoting from pyamf.remoting.client import RemotingService height = 1080 def build_amf_request(const, playerID, videoPlayer, publisherID): env = remoting.Envelope(amfVersion=3) env....
<|file_name|>plot_dop_A.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- """ ================================================ Following the Metal to Mott insulator Transition ================================================ Sequence of plots showing the transfer of spectral weight for a Hubbard Model in the Bet...
sim = res[ind, 1] w = sim.omega
<|file_name|>urls.py<|end_file_name|><|fim▁begin|>from django.conf.urls import url from timeline import views urlpatterns = [<|fim▁hole|><|fim▁end|>
url(r'^$', views.timelines, name='timelines'), ]
<|file_name|>reset_database_parameters_request_response.go<|end_file_name|><|fim▁begin|>// Copyright (c) 2016, 2018, 2021, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apac...
RequestMetadata common.RequestMetadata } func (request ResetDatabaseParametersRequest) String() string {
<|file_name|>watch.js<|end_file_name|><|fim▁begin|>var gulp = require('gulp'), config = require('../config.js'); require('./browserify.js');<|fim▁hole|> gulp.task('watch', ['default'], function() { gulp.watch(config.paths.sass.src, ['sass']); gulp.start('watch:js'); });<|fim▁end|>
require('./default.js'); require('./sass.js');
<|file_name|>fold.rs<|end_file_name|><|fim▁begin|>// Copyright 2012 The Rust Project Developers. See the COPYRIGHT // file at the top-level directory of this distribution and at // http://rust-lang.org/COPYRIGHT. // // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or // http://www.apache.org/licenses/L...
fn fold_arm(&self, a: &Arm) -> Arm { Arm {
<|file_name|>observable-simple.component.ts<|end_file_name|><|fim▁begin|>/* * MIT License * * Copyright (c) 2017-2018 Stefano Cappa * * 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 wi...
}
<|file_name|>WebServiceClientTest.js<|end_file_name|><|fim▁begin|>window.WebServiceClientTest = new Class( { Implements : [Events, JsTestClass, Options], Binds : ['onDocumentReady', 'onDocumentError'], <|fim▁hole|> options : { testMethods : [ { method : 'initialize_', isAsynchron : false }...
<|file_name|>htmllinkelement.rs<|end_file_name|><|fim▁begin|>/* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ use cssparser::Parser as CssParser; use dom::attr::At...
return; } // Step 1.
<|file_name|>app_banner_debug_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 "chrome/browser/banners/app_banner_debug_log.h" #include "content/public/brows...
" application ignored: not supported on Android"; const char kIgnoredNoId[] = "play application ignored: no id provided";
<|file_name|>pagination-nav.spec.js<|end_file_name|><|fim▁begin|>import VueRouter from 'vue-router' import { mount } from '@vue/test-utils' import { waitNT, waitRAF } from '../../../tests/utils' import { Vue } from '../../vue' import { BPaginationNav } from './pagination-nav' Vue.use(VueRouter) // The majority of tes...
await lis .at(8) .find('a') .trigger('click')
<|file_name|>caption.js<|end_file_name|><|fim▁begin|>import React from "react"; import { Text, View } from "react-native"; import { defaultProps, propTypes } from "./caption-prop-types"; import styles from "./styles"; const renderCredits = (style, credits) => { if (!credits || credits === "") { return null; } ...
<|file_name|>embedding_ops_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://ww...
ids_per_partition, extras = divmod(vocab_size, num_shards) threshold = extras * (ids_per_partition + 1) if i < threshold: partition = i // (ids_per_partition + 1)
<|file_name|>012_divisable_tri_nums.py<|end_file_name|><|fim▁begin|>## Close ### What is the value of the first triangle number to have over five hundred divisors?<|fim▁hole|><|fim▁end|>
print max([len(m) for m in map(lambda k: [n for n in range(1,(k+1)) if k%n == 0], [sum(range(n)) for n in range(1,1000)])])
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|># -*-coding:Utf-8 -* # Copyright (c) 2014 LE GOFF Vincent # 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 cod...
<|file_name|>addeditmoviedlg_ans.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python3 # Copyright (c) 2008-9 Qtrac Ltd. All rights reserved. # This program or module 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 Found...
title = self.titleLineEdit.text() year = self.yearSpinBox.value()
<|file_name|>base.ts<|end_file_name|><|fim▁begin|>import Web3 from 'web3'; import { Contract } from 'web3-eth-contract'; import { AbiItem } from 'web3-utils'; import PriceOracleABI from '../../contracts/abi/v0.9.0/price-oracle'; import ExchangeABI from '../../contracts/abi/v0.9.0/exchange'; import { getOracle, getAddre...
<|file_name|>typings.d.ts<|end_file_name|><|fim▁begin|>interface Date { now(): number; } declare module 'http' { import { IncomingMessage } from 'http'; export interface Response<TBody> extends IncomingMessage { body?: TBody; } } declare module 'redis' { export function createClient(port:...
export interface ClientOptions {
<|file_name|>0053_auto_20161112_2146.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- # Generated by Django 1.10.3 on 2016-11-12 10:46 from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('db', '0052_auto_2016111...
field=models.CharField(blank=True, choices=[(1, '1'), (2, '2'), (3, 'A'), (4, '3B'), (5, '4C'), (6, '5D')], max_length=30, null=True), ), ]
<|file_name|>az60.js<|end_file_name|><|fim▁begin|>const gal=[//731-62 '1@001/b4avsq1y2i', '1@002/50uvpeo7tb', '1@002/0ypu4wgjxm', '1@002/b61d80e9pf', '1@002/f1kb57t4ul', '1@002/swq38v49nz', '1@002/zeak367fw1', '1@003/nx1ld4j9pe', '1@003/yh0ub5rank', <|fim▁hole|>'1@005/0asu1qo75n', '1@005/4c7bn1q5mx', '1@005/...
'1@004/j29uftobmh',
<|file_name|>tests.py<|end_file_name|><|fim▁begin|>from django.utils import unittest<|fim▁hole|><|fim▁end|>
from spacescout_web.test.not_found import NotFound404Test from spacescout_web.test.url_filtering import URLFiltering
<|file_name|>app.js<|end_file_name|><|fim▁begin|>const AppError = require('../../../lib/errors/app') const assert = require('assert') function doSomethingBad () { throw new AppError('app error message') } it('Error details', function () { try { doSomethingBad() } catch (err) { assert.strictEqual( ...
<|file_name|>methoddef2.py<|end_file_name|><|fim▁begin|>class Foo(object): def mm(self, barparam): '''<|fim▁hole|> ''' f = Foo() f.mm(barparam=10)<|fim▁end|>
@param barparam: this is barparam
<|file_name|>cryptauth.py<|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. import httplib import json import logging import pprint import time logger = logging.getLogger('proxi...
<|file_name|>nonterminal-expansion.rs<|end_file_name|><|fim▁begin|>// Macros were previously expanded in `Expr` nonterminal tokens, now they are not. <|fim▁hole|> #[repr(align($n))] //~^ ERROR expected unsuffixed literal or identifier, found `n!()` //~| ERROR incorrect `repr(align)` attribute for...
macro_rules! pass_nonterminal { ($n:expr) => {
<|file_name|>Matrix.cpp<|end_file_name|><|fim▁begin|>/* Copyright © 2007, 2008, 2009, 2010, 2011 Vladimír Vondruš <mosra@centrum.cz> This file is part of Kompas. Kompas is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License version 3 onl...
} while(*it != actualItem && (**it).x == (*actualItem).x);
<|file_name|>lbfgs.py<|end_file_name|><|fim▁begin|>from cantilever_divingboard import * # We need to scale the parameters before applying the optimization algorithm # Normally there are about 20 orders of magnitude between the dimensions and # the doping concentration, so this is a critical step # Run the ...
omega_min = 100e3 initial_guess = (50e-6, 1e-6, 1e-6,
<|file_name|>E0067.rs<|end_file_name|><|fim▁begin|>use std::collections::LinkedList;<|fim▁hole|>fn main() { LinkedList::new() += 1; //~ ERROR E0368 //~^ ERROR E0067 }<|fim▁end|>
<|file_name|>sgopt.py<|end_file_name|><|fim▁begin|>"""Gradient descent """ import numpy as np from frankenstein.tools.perf_utils import TIMER from pyscf.lib import logger """ Helper functions """ def get_gHp_fd(get_grad, p, order=1, eps=1.E-4): """ Compute gradient-Hessian product using finite difference ...
g = mf.get_grad_gdm()
<|file_name|>lhcb.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-<|fim▁hole|># # This file is part of CERN Analysis Preservation Framework. # Copyright (C) 2016 CERN. # # CERN Analysis Preservation Framework is free software; you can redistribute # it and/or modify it under the terms of the GNU General Public L...
<|file_name|>dev-server.js<|end_file_name|><|fim▁begin|>const project = require('../config/project.config')<|fim▁hole|>const server = require('../server/index') const debug = require('debug')('app:bin:dev-server') server.listen(project.server_port) debug(`Server is now running at http://localhost:${project.server_port...
<|file_name|>UniformJavaUtilRandomWrapper.java<|end_file_name|><|fim▁begin|>/** * Copyright by Michael Weiss, weiss.michael@gmx.ch * <p> * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPO...
/* * (non-Javadoc)
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- from thumbnails.conf import settings from thumbnails.engines import DummyEngine from thumbnails.helpers import get_engine, generate_filename, get_cache_backend from thumbnails.images import SourceFile, Thumbnail __version__ = '0.5.1' def ...
``x200``. :param crop: Crop settings, should be ``center``, ``top``, ``right``, ``bottom``, ``left``. :param force: If set to ``True`` the thumbnail will be created even if it exists before.
<|file_name|>perf-tool.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python # # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file ...
import pyngus from proton import Message
<|file_name|>search.js<|end_file_name|><|fim▁begin|>// Search script generated by doxygen // Copyright (C) 2009 by Dimitri van Heesch. // The code in this file is loosly based on main.js, part of Natural Docs, // which is Copyright (C) 2003-2008 Greg Valure // Natural Docs is licensed under the GPL. var indexSections...
srScope.innerHTML = searchData[e][1][1][2]; srEntry.appendChild(srScope); }
<|file_name|>shell_config.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python # # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses thi...
# with the License. You may obtain a copy of the License at
<|file_name|>server.py<|end_file_name|><|fim▁begin|>import urllib from flask import Flask, Response, abort, request, send_file from flask_restful import Resource, Api from flask_cors import CORS, cross_origin import datetime import json import vacker.file_factory<|fim▁hole|> app = Flask(__name__) api = Api(app) file_...
<|file_name|>example_selfcollector_test.go<|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 the License is distributed on an "AS IS" BASIS, /...
// Copyright 2014 The Prometheus Authors // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License.
<|file_name|>mouse-push-button.js<|end_file_name|><|fim▁begin|>/* * default/mouse-push-button.js */ "use strict"; var Q = require('q'), Button = require('./../../button'); var MousePushButton = function (options) { Button.prototype.constructor.call(this, options); this.delay = options.delay > 0 ? optio...
<|file_name|>main.rs<|end_file_name|><|fim▁begin|>// Pitot - a customizable aviation information receiver // Copyright (C) 2017-2018 Datong Sun (dndx@idndx.com) // // 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...
// (at your option) any later version. // // This program is distributed in the hope that it will be useful,
<|file_name|>task.rs<|end_file_name|><|fim▁begin|>// Zinc, the bare metal stack for rust. // Copyright 2014 Vladimir "farcaller" Pouzanov <farcaller@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 co...
<|file_name|>protomol_functions.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env cctools_python # CCTOOLS_PYTHON_VERSION 2.7 2.6 import random import math #-------------------------------Constants----------------------------------- DEFAULT_MONTE_CARLO_STEPS = 100 DEFAULT_OUTPUT_PATH = '.' DEFAULT_MDSTEPS = 10000 DEFAULT...
write_str += "gamma 5\n" write_str += "timestep 2\n" write_str += "force bond\n"
<|file_name|>availability_zones.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 required by applic...
# License for the specific language governing permissions and limitations # under the License.
<|file_name|>saturating_add_mul.rs<|end_file_name|><|fim▁begin|>use malachite_base::num::basic::signeds::PrimitiveSigned; use malachite_base::num::basic::unsigneds::PrimitiveUnsigned; use malachite_base_test_util::bench::bucketers::triple_max_bit_bucketer; use malachite_base_test_util::bench::{run_benchmark, BenchmarkT...
limit: usize, file_name: &str, ) {
<|file_name|>331.py<|end_file_name|><|fim▁begin|>class Solution: def isValidSerialization(self, preorder): """ :type preorder: str<|fim▁hole|> arr_pre_order = preorder.split(',') stack = [] for node in arr_pre_order: stack.append(node) while le...
:rtype: bool """
<|file_name|>rainx-monitor.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python import sys import urllib2 RAINX_STAT_KEYS = [ ("rainx.reqpersec", "total_reqpersec"), ("rainx.reqputpersec", "put_reqpersec"), ("rainx.reqgetpersec", "get_reqpersec"), ("rainx.avreqtime", "total_avreqtime"), ("rainx.avputreqtime", "put_...
value = float(parts[1]) except ValueError: value = parts[1]
<|file_name|>ActalogicApp.cpp<|end_file_name|><|fim▁begin|>#include "pch.h" #include "ActalogicApp.h" TCHAR ActalogicApp::m_szWindowClass[] = _T("Actalogic"); TCHAR ActalogicApp::m_szTitle[] = _T("Actalogic"); ActalogicApp::ActalogicApp(): m_hWnd(NULL), m_hInstance(NULL), m_d2d1Manager(), m_entityFPS(), m_entityDebug...
<|file_name|>init-res-into-things.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...
} assert_eq!(i.get(), 1); }
<|file_name|>test_arpcache.py<|end_file_name|><|fim▁begin|># Copyright 2016-2020 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 # # h...
# Python 2.x from cStringIO import StringIO except ImportError: # Python 3.x
<|file_name|>support.py<|end_file_name|><|fim▁begin|># Copyright (c) 2016-2019 The University of Manchester #<|fim▁hole|># (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS...
# 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|>mpu_rbar.rs<|end_file_name|><|fim▁begin|>#[doc = "Register `MPU_RBAR` reader"] pub struct R(crate::R<MPU_RBAR_SPEC>); impl core::ops::Deref for R { type Target = crate::R<MPU_RBAR_SPEC>; #[inline(always)] fn deref(&self) -> &Self::Target { &self.0 } } impl From<crate::R<MPU_RBAR_SPE...
pub enum VALID_A { #[doc = "0: MPU_RNR not changed, and the processor: - updates the base address for the region specified in the MPU_RNR - ignores the value of the REGION field"]
<|file_name|>fill_test.cc<|end_file_name|><|fim▁begin|>/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licen...
<|file_name|>view.py<|end_file_name|><|fim▁begin|># Webhooks for external integrations. from __future__ import absolute_import from django.utils.translation import ugettext as _ from zerver.lib.actions import check_send_message from zerver.lib.response import json_success, json_error from zerver.decorator import REQ, h...
# type: (HttpRequest, UserProfile, Client, Dict[str, Any], Text) -> HttpResponse
<|file_name|>mount_id.ts<|end_file_name|><|fim▁begin|><?xml version="1.0" encoding="utf-8"?> <!DOCTYPE TS> <TS version="2.1" language="id"> <context> <name>Button</name> <message> <location filename="../button.cpp" line="38"/> <source>Removable media/devices manager</source> <translation...
<location filename="../actions/deviceaction_info.cpp" line="40"/> <source>The device &lt;b&gt;&lt;nobr&gt;&quot;%1&quot;&lt;/nobr&gt;&lt;/b&gt; is connected.</source> <translation>Perangkat &lt;b&gt;&lt;nobr&gt;&quot;%1&quot;&lt;/nobr&gt;&lt;/b&gt; telah tersambung.</translation>
<|file_name|>arts2.py<|end_file_name|><|fim▁begin|><|fim▁hole|>import pandas as pd arts = pd.DataFrame() # 1. Clean the dates so you only see numbers by using string manipulations arts["execution_date"] = arts["execution_date"].str.findall(r"([0-9]+)").str[0] arts["execution_date"] = arts["execution_date"].astype(fl...
import numpy as np
<|file_name|>tableHeading.component.tsx<|end_file_name|><|fim▁begin|>/** * Copyright (C) 2017 3D Repo Ltd * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as * published by the Free Software Foundation, either version 3 of th...
<|file_name|>stats.py<|end_file_name|><|fim▁begin|>from util.runescape_util import get_users_stats, get_level_at_exp from util.ascii_table import Table, Column from util.image_util import text_to_image from discord.ext import commands from util.arguments import Arguments from shlex import split <|fim▁hole|> def __...
class Stats:
<|file_name|>a.cpp<|end_file_name|><|fim▁begin|>#include <bits/stdc++.h> using namespace std; using ull = unsigned long long; ull arr[int(1e5)+5]; int n, q, x; int bs(int key) { int l = 0, r = n-1, mid, ans=-1; while (l <= r) { mid = l + (r - l + 1)/2; if (arr[mid] == key) {<|fim▁hole|> } else if (arr[mid...
r = mid - 1; ans = mid;
<|file_name|>urlbuffer.cpp<|end_file_name|><|fim▁begin|>/* Copyright (C) 2011 uberspot * * Compiling: znc-buildmod urlbuffer.cpp * Dependencies: curl, wget, sed and a unix environment. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License versio...
void CUrlBufferModule::LoadDefaults() {
<|file_name|>list.ts<|end_file_name|><|fim▁begin|>class FileModel { readonly fileMetadataId: string; readonly width: number; readonly height: number; readonly takenAt: Date | null; readonly uploadedAt: Date; readonly originalFilename: string; readonly userName: KnockoutObservable<string>; ...
readonly myTimeZone: string; readonly startDate: KnockoutObservable<string>;
<|file_name|>token.rs<|end_file_name|><|fim▁begin|>use std::fmt::{Formatter, Result, Show}; use syntax::ast::pos::Position; use syntax::ast::punc::Punctuator; use syntax::ast::keyword::Keyword; #[deriving(Clone, PartialEq)] /// A single of token of Javascript code including its position pub struct Token { /// The t...
/// A boolean literal, which is either `true` or `false` TBooleanLiteral(bool), /// The end of the file TEOF,
<|file_name|>problem11.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python """ Largest product in a grid Problem 11 Published on 22 February 2002 at 06:00 pm [Server Time] In the 20x20 grid below, four numbers along a diagonal line have been marked in red. The product of these numbers is 26 * 63 * 78 * 14 =...
phv = max(product([g[i][j+s] for s in range(path_size)]),
<|file_name|>message-user-agent-client.ts<|end_file_name|><|fim▁begin|>import { OutgoingMessageRequest, OutgoingRequestDelegate, OutgoingRequestMessage } from "../messages"; import { NonInviteClientTransaction } from "../transactions"; import { UserAgentCore } from "../user-agent-core"; import { UserAgentClient } from ...
}
<|file_name|>relative_paths.py<|end_file_name|><|fim▁begin|># All of the other examples directly embed the Javascript and CSS code for # Bokeh's client-side runtime into the HTML. This leads to the HTML files # being rather large. An alternative is to ask Bokeh to produce HTML that # has a relative link to the Bokeh ...
import numpy as np
<|file_name|>create-admin.js<|end_file_name|><|fim▁begin|>const app = require('../server'); const readline = require('readline'); const { User, Role,<|fim▁hole|> RoleMapping, } = app.models; const rl = readline.createInterface({ input: process.stdin, output: process.stdout, }); Role.findOne({ where: { name:...
<|file_name|>urp.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python # -*- coding: utf-8 -*- import argparse import itertools import os import sys try: from urllib import quote_plus, urlencode from urlparse import parse_qsl, urlparse, urlunparse except ImportError: from urllib.parse import parse_qsl, quo...
ap.add_argument('-Q', '--append-query', metavar='NAME=VALUE', action='append', dest='queries', default=[], help="append query parameter") ap.add_argument('-F', '--fragment', action='store', dest='fragment', help="set fragment")
<|file_name|>index.d.ts<|end_file_name|><|fim▁begin|>// Generated by typings // Source: https://raw.githubusercontent.com/DefinitelyTyped/DefinitelyTyped/de82425735f84a10b43921ae4b1d085b3752a626/mocha/mocha.d.ts interface MochaSetupOptions { //milliseconds to wait before considering a test slow slow?: number; ...
<|file_name|>set.rs<|end_file_name|><|fim▁begin|>use num::Num; use signed::Signed; <|fim▁hole|>#[inline] pub fn set<'a, 'b, T: Copy + Num>(out: &'a mut [T; 4], x: T, y: T, z: T, w: T) -> &'a mut [T; 4] { out[0] = x; out[1] = y; out[2] = z; out[3] = w; out } #[test] fn test_set() { let mut v = [...
<|file_name|>apps.js<|end_file_name|><|fim▁begin|>import AuthenticatedRoute from 'ghost/routes/authenticated'; import CurrentUserSettings from 'ghost/mixins/current-user-settings'; import styleBody from 'ghost/mixins/style-body'; var AppsRoute = AuthenticatedRoute.extend(styleBody, CurrentUserSettings, { titleToke...
<|file_name|>conn.go<|end_file_name|><|fim▁begin|>// Copyright 2014 beego Author. 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/lic...
if c.Reconnect { c.Reconnect = false return true }
<|file_name|>EntityOperationServiceException.java<|end_file_name|><|fim▁begin|><|fim▁hole|>/** * @author bkompis */ public class EntityOperationServiceException extends MushroomHunterServiceDataAccessException { public <T> EntityOperationServiceException(String what, String operation, T entity, Throwable e) { ...
package cz.muni.fi.pa165.mushrooms.service.exceptions;
<|file_name|>helpers.py<|end_file_name|><|fim▁begin|>import copy from django.conf import settings from django.test import override_settings def override_openstack_settings(**kwargs): os_settings = copy.deepcopy(settings.WALDUR_OPENSTACK) os_settings.update(kwargs)<|fim▁hole|><|fim▁end|>
return override_settings(WALDUR_OPENSTACK=os_settings)
<|file_name|>MapCppEMRSpacePoints.cc<|end_file_name|><|fim▁begin|>/* This file is part of MAUS: http://micewww.pp.rl.ac.uk:8080/projects/maus * * MAUS 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...
<|file_name|>test_atom.rs<|end_file_name|><|fim▁begin|>use rustler::{Atom, Binary, Env, NifResult, Term}; mod atoms { rustler::atoms! { ok } } #[rustler::nif] pub fn atom_to_string(atom: Term) -> NifResult<String> { atom.atom_to_string() }<|fim▁hole|>pub fn atom_equals_ok(atom: Atom) -> bool { atoms::ok()...
#[rustler::nif]
<|file_name|>Main.cpp<|end_file_name|><|fim▁begin|>/* * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/> * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as publi...
<|file_name|>t_coupling_tools.py<|end_file_name|><|fim▁begin|>#! /usr/bin/env python # -*- coding: utf-8 -*- from openturns import coupling_tools import os import time import sys wanted_lines = '# ooo\nE=@E\nE1=@E\nFE1=@F#oo\nZ=@Z@Z\n# ooo\n' semi_parsed = '# ooo\nE=2\nE1=2\nFE1=@F#oo\nZ=@Z@Z\n# ooo\n' parsed = '# oo...
pass else: raise Exception("! should have fail !")
<|file_name|>propsValidators.js<|end_file_name|><|fim▁begin|>import PropTypes from 'prop-types'; export const validAxisType = PropTypes.oneOf([ 'category', 'linear', 'logarithmic', 'datetime' ]); export const validChartType = PropTypes.oneOf([ 'area', 'arearange', 'areaspline', 'areasplinerange', 'b...
'pie', 'polygon', 'pyramid',
<|file_name|>UserExtTokenAlreadyRegistered.js<|end_file_name|><|fim▁begin|>module.exports = { 'code': 1100, 'type': 'UserExtTokenAlreadyRegistered', <|fim▁hole|><|fim▁end|>
'message': 'The provided external authentification is already used', 'http': 400 };
<|file_name|>index.js<|end_file_name|><|fim▁begin|>module.exports = function (args, opts) { if (!opts) opts = {}; var flags = { bools : {}, strings : {}, unknownFn: null }; if (typeof opts['unknown'] === 'function') { flags.unknownFn = opts['unknown']; } if (typeof opts['boolean'] ===...
<|file_name|>0018_auto_20170721_0611.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- from __future__ import unicode_literals <|fim▁hole|>from django.db import migrations, models import datetime class Migration(migrations.Migration): dependencies = [ ('ccx', '0017_auto_20170721_0437'), ] ...
<|file_name|>PROC_O_IBK_WSYH_ECCIF.py<|end_file_name|><|fim▁begin|>#coding=UTF-8 from pyspark import SparkContext, SparkConf, SQLContext, Row, HiveContext from pyspark.sql.types import * from datetime import date, datetime, timedelta import sys, re, os st = datetime.now() conf = SparkConf().setAppName('PROC_O_IBK_WSYH...
<|file_name|>calib.py<|end_file_name|><|fim▁begin|># # My first attempt at python # calibrate accelerometer # import re import scipy from scipy import optimize from scipy import linalg from pylab import * # # parse the log # def read_log(ac_id, filename, sensor): f = open(filename, 'r') pattern = re.compile("...
filename = 'log_accel_booz2_a2'
<|file_name|>CustomInstanceConfigurer.tsx<|end_file_name|><|fim▁begin|>import React from 'react'; import Select, { Option } from 'react-select'; import { HelpField } from '@spinnaker/core'; export interface ICustomInstanceConfig { vCpuCount: number; memory: number; instanceFamily: string; } export interface IC...
<HelpField id="gce.instance.customInstance.memory" /> </div> <div className="col-md-3">
<|file_name|>main.rs<|end_file_name|><|fim▁begin|>use std::io::BufReader; use std::fs::File; use std::str::FromStr; use std::io; use std::io::prelude::*; use std::collections::BinaryHeap; use std::cmp::Reverse; #[derive(Debug)] struct MaxHeap{ heap:BinaryHeap<u64>, count: usize }<|fim▁hole|>impl MaxHeap { ...
<|file_name|>highlight.tsx<|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/. */ import * as React from 'react'; import { OptionsState...
// game.trigger('chat-play-sound-highlight'); return [ null,
<|file_name|>ip.py<|end_file_name|><|fim▁begin|>from netfields import InetAddressField, CidrAddressField from django.db import models from django.core.exceptions import ValidationError from django.utils.translation import ugettext_lazy as _ from django.conf import settings from nodeshot.core.base.models import BaseAc...
self.protocol = 'ipv%d' % self.address.version # save super(Ip, self).save(*args, **kwargs)
<|file_name|>csv_input.py<|end_file_name|><|fim▁begin|>import numpy as np from assorted.GraphInput import GraphInput from model.component.component_model import ComponentModel class CsvInput(ComponentModel): name = "CsvInput" default_out_sockets = [{'position': [0, -20], 'name': 'Output'}] ...
def theano_inputs(self):
<|file_name|>auto_config.py<|end_file_name|><|fim▁begin|>""" Auto Configuration Helper """ import logging import os import requests from urlparse import urlparse from constants import InsightsConstants as constants from cert_auth import rhsmCertificate from connection import InsightsConnection from config import CONFI...
<|file_name|>IotMinerApplicationTests.java<|end_file_name|><|fim▁begin|>package de.tum.in.i17.iotminer; import org.junit.Test; import org.junit.runner.RunWith; import org.springframework.boot.test.context.SpringBootTest; import org.springframework.test.context.junit4.SpringRunner;<|fim▁hole|>@RunWith(SpringRunner.clas...