prompt
large_stringlengths
70
991k
completion
large_stringlengths
0
1.02k
<|file_name|>helpers.py<|end_file_name|><|fim▁begin|>from collections import OrderedDict from django.core.cache import cache<|fim▁hole|>from django.conf import settings import jingo import jinja2 from bedrock.firefox.models import FirefoxOSFeedLink from bedrock.firefox.firefox_details import firefox_desktop, firefox...
<|file_name|>character.rs<|end_file_name|><|fim▁begin|>use session::game::{Session, GameState}; use session::game::chunk::{Ref, ChunkImpl}; use std::io; use protocol::{Protocol, VarInt, VarShort}; use protocol::messages::game::character::choice::*; use protocol::messages::game::character::creation::*; use protocol::mes...
fn create_character(conn: &Connection, tok: Token, name: String, breed: i16, look: EntityLook, sex: bool, spawn_map: i32, account_id: i32, nickname: String,
<|file_name|>test_offline.py<|end_file_name|><|fim▁begin|>#Import Libraries import eventmaster as EM from time import sleep import random import sys """ Create new Instance of EventMasterSwitcher and turn off logging """ s3 = EM.EventMasterSwitcher() s3.setVerbose(0) with open('example_settings_.xml', 'r') as conte...
<|file_name|>MC_12_MagDown_kstar_rho_kpipipi.py<|end_file_name|><|fim▁begin|>#-- GAUDI jobOptions generated on Wed Jun 10 17:31:51 2015 #-- Contains event types : #-- 11104041 - 117 files - 2010995 events - 432.61 GBytes #-- Extra information about the data processing phases: #-- Processing Pass Step-124834 <...
#-- StepId : 124834 #-- StepName : Reco14a for MC
<|file_name|>containers.rs<|end_file_name|><|fim▁begin|>use std::default::Default; use std::collections::BTreeMap; use quire::validate as V; use super::builders::{Builder, builder_validator}; use super::Range; #[derive(Decodable, Clone, PartialEq, Eq)] pub enum Volume { Tmpfs(TmpfsInfo), BindRW(Path), Va...
.. Default::default()} as Box<V::Validator>, .. Default::default()} as Box<V::Validator>), ("volumes".to_string(), box V::Mapping { key_element: box V::Directory {
<|file_name|>interface.d.ts<|end_file_name|><|fim▁begin|><|fim▁hole|> getImport(): string; }<|fim▁end|>
interface bugfix {
<|file_name|>proxy_socks4.go<|end_file_name|><|fim▁begin|>/* * Copyright (c) 2014, Yawning Angel <yawning at torproject dot org><|fim▁hole|> * modification, are permitted provided that the following conditions are met: * * * Redistributions of source code must retain the above copyright notice, * this list of c...
* All rights reserved. * * Redistribution and use in source and binary forms, with or without
<|file_name|>osutil_test.go<|end_file_name|><|fim▁begin|>// Copyright (C) 2014 The Syncthing Authors. // // 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/. package osut...
<|file_name|>lexicographically-comparison.js<|end_file_name|><|fim▁begin|>function solve(args) { var text = args[0].split('\n'); var textA = text[0]; var textB = text[1]; var state = 0; for (var i = 0; i < Math.min(textA.length, textB.length); i += 1) { if (textA[i] > textB[i]) { ...
break; default:
<|file_name|>core.js<|end_file_name|><|fim▁begin|>/* public/core.js */ var angTodo = angular.module('angTodo', []); function mainController($scope, $http) { $scope.formData = {}; /* when landing on the page, get all todos and show them */ $http.get('/api/todos') .success(function(data) { ...
.success(function(data) {
<|file_name|>PanelHeroi.java<|end_file_name|><|fim▁begin|>package com.limagiran.hearthstone.heroi.view; import com.limagiran.hearthstone.heroi.control.Heroi; import com.limagiran.hearthstone.util.AbsolutesConstraints; import com.limagiran.hearthstone.util.Images; import javax.swing.ImageIcon; import javax.swing.JLabe...
*
<|file_name|>Shape.js<|end_file_name|><|fim▁begin|>/** * @class Ext.sparkline.Shape * @private */ Ext.define('Ext.sparkline.Shape', { constructor: function (target, id, type, args) { this.target = target; this.id = id; this.type = type; this.args = args; }, append: functio...
return this;
<|file_name|>server2.cc<|end_file_name|><|fim▁begin|>#include "muduo/net/TcpServer.h" #include "muduo/base/Atomic.h" #include "muduo/base/FileUtil.h" #include "muduo/base/Logging.h" #include "muduo/base/ProcessInfo.h" #include "muduo/base/Thread.h" #include "muduo/net/EventLoop.h" #include "muduo/net/InetAddress.h" #...
private: void onConnection(const TcpConnectionPtr& conn) { LOG_TRACE << conn->peerAddress().toIpPort() << " -> "
<|file_name|>model_protobuf_null_value.go<|end_file_name|><|fim▁begin|>/* * Echo Service *<|fim▁hole|> * Echo Service API consists of a single service which returns a message. * * API version: version not set * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) */ package echo // ...
<|file_name|>fs.py<|end_file_name|><|fim▁begin|>import os import sys import errno import itertools import logging import stat import threading from fuse import FuseOSError, Operations from . import exceptions, utils from .keys import Key from .logs import Log from .views import View logger = logging.getLogger('base...
# return os.symlink(name, self._full_path(target)) def rename(self, old, new): raise NotImplementedError
<|file_name|>test.py<|end_file_name|><|fim▁begin|># -------------------------------------------------------- # Tensorflow Faster R-CNN # Licensed under The MIT License [see LICENSE for details] # Written by Xinlei Chen # -------------------------------------------------------- from __future__ import absolute_import fro...
<|file_name|>activation-sink-default-value.js<|end_file_name|><|fim▁begin|>var n = 10000000; function bar(f) { f(10); } function foo(b) { var result = 0; var imUndefined; var baz; var set = function (x) { result = x; return (imUndefined, baz); } baz = 40; if (b) { bar(set); if ...
return result; }
<|file_name|>logutil.py<|end_file_name|><|fim▁begin|><|fim▁hole|># # logutil.py # A module containing means of interacting with log files. # import logging import logging.handlers import os import time from data_structures import enum from config import get_config_value LoggingSection = enum( 'CLIENT', 'CRA...
<|file_name|>mod.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 version...
}
<|file_name|>quickstart.js<|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 by appl...
});
<|file_name|>wsgi.py<|end_file_name|><|fim▁begin|><|fim▁hole|> For more information on this file, see https://docs.djangoproject.com/en/1.6/howto/deployment/wsgi/ """ import os os.environ.setdefault("DJANGO_SETTINGS_MODULE", "veterinario.settings") from django.core.wsgi import get_wsgi_application application = get_w...
""" WSGI config for veterinario project. It exposes the WSGI callable as a module-level variable named ``application``.
<|file_name|>sftp_input_service_tests.py<|end_file_name|><|fim▁begin|>import unittest import json from bitmovin import Bitmovin, Response, SFTPInput from bitmovin.errors import BitmovinApiError from tests.bitmovin import BitmovinTestCase class SFTPInputTests(BitmovinTestCase): @classmethod def setUpClass(cls...
self.assertIsInstance(inputs.response, Response) self.assertGreater(inputs.resource.__sizeof__(), 1)
<|file_name|>core.py<|end_file_name|><|fim▁begin|># # core.py # # Copyright (C) 2009 Andrew Resch <andrewresch@gmail.com> # # Deluge is free software. # # You may 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...
<|file_name|>match-value-binding-in-guard-3291.rs<|end_file_name|><|fim▁begin|>// run-pass // pretty-expanded FIXME #23616 #![feature(box_syntax)] fn foo(x: Option<Box<isize>>, b: bool) -> isize { match x { None => { 1 } Some(ref x) if b => { *x.clone() } Some(_) => { 0 } }<|fim▁hole|> fo...
} pub fn main() { foo(Some(box 22), true);
<|file_name|>__main__.py<|end_file_name|><|fim▁begin|># Copyright 2020 The Pigweed Authors<|fim▁hole|># the License at # # https://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, WITHOUT #...
# # 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
<|file_name|>main.rs<|end_file_name|><|fim▁begin|>extern crate rust_web_boilerplate; fn main() {<|fim▁hole|><|fim▁end|>
let (rocket, _) = rust_web_boilerplate::rocket_factory(); rocket.launch(); }
<|file_name|>index.d.ts<|end_file_name|><|fim▁begin|><|fim▁hole|>// TypeScript Version: 2.8 // Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts import { zip } from "lodash"; export = zip;<|fim▁end|>
// Type definitions for lodash.zip 4.2 // Project: https://lodash.com // Definitions by: Brian Zengel <https://github.com/bczengel>, Ilya Mochalov <https://github.com/chrootsu>, Stepan Mikhaylyuk <https://github.com/stepancar> // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
<|file_name|>WordInfo.java<|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 applicable l...
/** * Word-specific information for recognized words. *
<|file_name|>mod.py<|end_file_name|><|fim▁begin|>from __future__ import print_function, division from sympy.core.numbers import nan from .function import Function class Mod(Function): """Represents a modulo operation on symbolic expressions. Receives two arguments, dividend p and divisor q. The convent...
if G != 1: p, q = [ gcd_terms(i/G, clear=False, fraction=False) for i in (p, q)]
<|file_name|>assign27.09.py<|end_file_name|><|fim▁begin|>n=int(input('Enter any number: ')) if n%2!=0: n=n+1 <|fim▁hole|> else: print(' ',end='') print()<|fim▁end|>
for i in range(n): for j in range(n): if (i==int(n/2)) or j==int(n/2) or ((i==0)and (j>=int(n/2))) or ((j==0)and (i<=int(n/2))) or ((j==n-1)and (i>=int(n/2))) or ((i==n-1)and (j<=int(n/2))): print('*',end='')
<|file_name|>article.rs<|end_file_name|><|fim▁begin|>use chrono::naive::NaiveDateTime; use serde::{Deserialize, Serialize}; use validator::Validate; <|fim▁hole|>pub struct Article { pub id: i32, pub author_id: i32, pub in_reply_to: Option<String>, pub title: String, pub slug: String, pub guid: ...
use crate::schema::articles; #[derive(Debug, Clone, Queryable, Insertable, Serialize, Deserialize)]
<|file_name|>runtests.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python # -*- coding: utf-8 -*-<|fim▁hole|> def runtests(): fail = 0 for test in os.listdir("."): if test.startswith("tst_") and test.endswith(".py"): if 0 != subprocess.call(["./" + test]): fail += 1 ...
import sys import os import subprocess
<|file_name|>echoserver.py<|end_file_name|><|fim▁begin|>import argparse import asyncio import gc import os.path import pathlib import socket import ssl PRINT = 0 async def echo_server(loop, address, unix): if unix: sock = socket.socket(socket.AF_UNIX, socket.SOCK_STREAM) else: sock = socket....
<|file_name|>app.js<|end_file_name|><|fim▁begin|>import './init' import React from 'react' import ReactDom from 'react-dom' import Root from './root' import {APP_THEMES_LIGHT, APP_THEMES_DARK} from 'reducers/settings/constants' import LocalStorage from 'lib/localStorage' import {initializeStore} from './redux/store' im...
return { settings: { theme: theme || APP_THEMES_LIGHT
<|file_name|>range.js<|end_file_name|><|fim▁begin|>import { ChangeDetectorRef, Component, ElementRef, Input, Optional, Renderer, ViewChild, ViewEncapsulation } from '@angular/core'; import { NG_VALUE_ACCESSOR } from '@angular/forms'; import { clamp, isTrueProperty } from '../../util/util'; import { Config } from '../.....
<|file_name|>stream.rs<|end_file_name|><|fim▁begin|>use crate::internal::streamname::{ self, DIGITAL_SIGNATURE_STREAM_NAME, MSI_DIGITAL_SIGNATURE_EX_STREAM_NAME, SUMMARY_INFO_STREAM_NAME, }; use cfb; use std::io::{self, Read, Seek, SeekFrom, Write}; // ==========================================================...
<|file_name|>pulsarspout.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python # -*- encoding: utf-8 -*- # 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 ownershi...
self.logger.debug("Failed tuple %s" % str(tup_id))
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|><|fim▁hole|>import artistools.makemodel.botyanski2017<|fim▁end|>
# import .1dslicefrom3d
<|file_name|>rk4.rs<|end_file_name|><|fim▁begin|>use libc::c_double; /// Given a differential function dx(x, t), /// initial condition x0, /// and a list of times t, /// find x(t) at each point in t pub fn odeint(dx: (&Fn(c_double, c_double) -> c_double), x0: c_double, t_vec: &Vec<c_double>) -> V...
#[test] fn rk4_compiles() { }
<|file_name|>Dir.py<|end_file_name|><|fim▁begin|># # Copyright (c) 2001 - 2014 The SCons Foundation<|fim▁hole|># "Software"), to deal in the Software without restriction, including # without limitation the rights to use, copy, modify, merge, publish, # distribute, sublicense, and/or sell copies of the Software, and to ...
# # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the
<|file_name|>test_table.py<|end_file_name|><|fim▁begin|>from http import HTTPStatus from json import loads from unittest.mock import Mock, patch from uuid import uuid4 from tornado.testing import gen_test from pokerserver.database import PlayerState, UUIDsRelation from pokerserver.models import InvalidTurnError, NotY...
'balance': 0, 'cards': [], 'name': 'a', 'bet': 0,
<|file_name|>tpl_ceph_install.go<|end_file_name|><|fim▁begin|>/* ** Copyright [2013-2015] [Megam Systems] ** ** 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|>KillAura.java<|end_file_name|><|fim▁begin|>package zeonClient.mods; import java.util.Iterator; import org.lwjgl.input.Keyboard; import net.minecraft.client.entity.EntityOtherPlayerMP; import net.minecraft.client.entity.EntityPlayerSP; import net.minecraft.entity.Entity; import net.minecraft.ent...
<|file_name|>fleet_route_stop.py<|end_file_name|><|fim▁begin|># Copyright 2019 Mentxu Isuskitza - AvanzOSC # Copyright 2019 Oihana Larrañaga - AvanzOSC # License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html from odoo import api, fields, models from odoo.models import expression from odoo.tools.safe_eval impor...
@api.onchange("location_id") def _onchange_location_id(self):
<|file_name|>94-mobile_actuator.js<|end_file_name|><|fim▁begin|>/** * Copyright 2014 IBM Corp. * * 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/LICENS...
// The main node definition - most things happen in here
<|file_name|>build_index_page.py<|end_file_name|><|fim▁begin|>import glob json_files = glob.glob("tests/**/output/**/*.json", recursive=True) html_files = glob.glob("tests/**/output/**/*.html", recursive=True) html_list = "" for f_ in html_files: html_list += '\t<li><a href="{}">{}</li>\n'.format( f_[6:],...
<h3>JSON</h3> <ul> {}
<|file_name|>autoderef-method.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.or...
<|file_name|>__init__.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 may obtain a copy of the License at # # http://www.apache.org/license...
"AssetServiceGrpcTransport", "AssetServiceGrpcAsyncIOTransport", )
<|file_name|>goodbye.py<|end_file_name|><|fim▁begin|><|fim▁hole|> print('goodbye')<|fim▁end|>
__author__ = 'las3wh'
<|file_name|>ApplicationLocation.java<|end_file_name|><|fim▁begin|>/** * */ package com.velocity.enums;<|fim▁hole|> * This Enum defines the values for ApplicationLocation * * @author Vimal Kumar * @date 12-March-2015 */ public enum ApplicationLocation { HomeInternet, NotSet, OffPremises, OnPremises, Unknown ...
/**
<|file_name|>JSR88_Util.java<|end_file_name|><|fim▁begin|>/** * 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 to You und...
<|file_name|>test_checks.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- from py.test import mark from translate.filters import checks from translate.lang import data from translate.storage import po, xliff def strprep(str1, str2, message=None): return data.normalized_unicode(str1), data.normalized_unic...
stdchecker = checks.StandardChecker()
<|file_name|>asm.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/licens...
in_datum, cleanup::CustomScope(temp_scope),
<|file_name|>mem.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/. */ //! Memory profiling functions. use ipc_channel::ipc::{self, Ipc...
// |stats.allocated|."
<|file_name|>GetOrderViewsMethod.java<|end_file_name|><|fim▁begin|>package com.notronix.lw.impl.method.orders; import com.google.gson.Gson; import com.notronix.lw.api.model.UserOrderView; import com.notronix.lw.impl.method.AbstractLinnworksAPIMethod; import java.util.Arrays; <|fim▁hole|>{ @Override pu...
import java.util.List; public class GetOrderViewsMethod extends AbstractLinnworksAPIMethod<List<UserOrderView>>
<|file_name|>binprocess.rs<|end_file_name|><|fim▁begin|>use std::process::exit; use std::io::ErrorKind; use std::path::PathBuf; use std::ffi::CString; use std::ffi::OsStr; use std::os::unix::ffi::OsStrExt; use shell::Shell; use posix; use opts; use posix::ReadPipe; use posix::WritePipe; use posix::Pgid; use exec::A...
} fn stdout(&mut self, write: WritePipe) -> &Process {
<|file_name|>regex.rs<|end_file_name|><|fim▁begin|>// Copyright 2022 Collabora, Ltd. // // Use of this source code is governed by a MIT-style // license that can be found in the LICENSE file or at // https://opensource.org/licenses/MIT. use std::{error::Error, fmt, str::FromStr}; use onig::{Regex, RegexOptions, Synta...
let deps = FakeDependencies::new();
<|file_name|>test_source_api.py<|end_file_name|><|fim▁begin|># coding: utf-8 """ Wavefront REST API <p>The Wavefront REST API enables you to interact with Wavefront servers using standard REST API tools. You can use the REST API to automate commonly executed operations such as automatically tagging sources.</...
<|file_name|>Skin.js<|end_file_name|><|fim▁begin|>(function($, Translator) { Skin = function Skin(code, skinData) { this.variableRegex = /\{#([\w \|]*)\#\}/; this.translateRegex = /\{=([\w \|,]*)\=\}/; this.code = code; this.extractData(skinData); } Skin.prototype.scanChildren = function(code, skinD...
for(var i = 0; i < loops[skloop].length; ++i) { if(typeof(loops[skloop]) === 'array' || typeof(loops[skloop]) === 'object') newNodeHTML += $this.scanChildren(checkLoop.outerHTML(), loops[skloop][i]); }
<|file_name|>purejslider.js<|end_file_name|><|fim▁begin|><script type="text/javascript"> //set the interval temporary variable var setIntrVal = null; var intrVal = 3000; //lets get the slider elements var slides = document.getElementById('slides'); //get the <ul id="slides"> var slide = documen...
//lets remove the class starting from the current item to the last
<|file_name|>PRESUBMIT.py<|end_file_name|><|fim▁begin|># Copyright (c) 2012 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """Presubmit script for Chromium theme resources. See http://dev.chromium.org/developers/how-tos/...
import sys old_path = sys.path
<|file_name|>camera.rs<|end_file_name|><|fim▁begin|>//! Camera structure and manipulation functions. use gl; use gl::types::*;<|fim▁hole|>use yaglw::gl_context::GLContext; use yaglw::shader::Shader; /// T representation as 3 distinct matrices, as well as a position + two rotations. pub struct T { #[allow(missing_do...
use cgmath; use cgmath::{Matrix3, Matrix4, One, Vector3, Point3, EuclideanSpace}; use std::f32::consts::PI;
<|file_name|>build.rs<|end_file_name|><|fim▁begin|>use std::env; fn main() { let target = env::var("TARGET").unwrap_or("".to_string()); let tundra_dir = env::var("TUNDRA_OBJECTDIR").unwrap_or("".to_string()); let libs = env::var("TUNDRA_STATIC_LIBS").unwrap_or("".to_string()); let native_libs = libs.spli...
<|file_name|>line.ts<|end_file_name|><|fim▁begin|>import { Atom } from '../core/atom-class'; import { Box } from '../core/box'; import { VBox } from '../core/v-box'; import { Context } from '../core/context'; import { Style } from '../public/core'; export class LineAtom extends Atom { private readonly position: 'ove...
classes: this.position, type: 'mord',
<|file_name|>htmlbaseelement.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 dom::bindings::codegen::Bindings::HTMLBaseElement...
Node::reflect_node(box element, document, HTMLBaseElementBinding::Wrap) }
<|file_name|>atm_log.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python # -*- coding: utf-8 -*- # Author: Janice Cheng import logging from s13.Day5.conf import setting logger = logging.getLogger('ATM-TRANSACTION-LOG') logger.setLevel(logging.INFO) #configure a global logging level console_handler = logging.Stre...
file_handler.setFormatter(formatter) logger.addHandler(console_handler)
<|file_name|>pyminer.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python # # Copyright (c) 2011 The Bitcoin developers # Distributed under the MIT/X11 software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. # import time import json import pprint import hashlib import...
<|file_name|>serializers.py<|end_file_name|><|fim▁begin|>from rest_framework import serializers from rest_framework import pagination <|fim▁hole|>from .models import Airport class AirportSerializer(serializers.ModelSerializer): read_only_fields = ('id','name','city','country','country_code','iata','icao') ...
<|file_name|>metrics.go<|end_file_name|><|fim▁begin|>package server import ( "net/http" "github.com/prometheus/client_golang/prometheus" "github.com/prometheus/client_golang/prometheus/promhttp" ) const ( metricNotificationsTotalName = "service_notifications_total" metricSuccessName = "service_su...
case PushNotifyAndroid: m.observeFCMResponse(dur) } }
<|file_name|>ScriptEditorDialog.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- """ *************************************************************************** EditScriptDialog.py --------------------- Date : December 2012 Copyright : (C) 2012 by Alexander Bruy Em...
<|file_name|>system_device.py<|end_file_name|><|fim▁begin|><|fim▁hole|> class SystemDevice(object): def upload_project(self, project: Project, **kwargs): raise NotImplementedError def write_program(self, file: typing.BinaryIO, quirk: int = 0, **kwargs): raise NotImplementedError<|fim▁end|>
import typing from pros.conductor import Project
<|file_name|>GitModificationParser.java<|end_file_name|><|fim▁begin|>/*************************GO-LICENSE-START********************************* * Copyright 2014 ThoughtWorks, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. ...
public List<Modification> parse(List<String> output) { for (String line : output) { processLine(line);
<|file_name|>population_builder.rs<|end_file_name|><|fim▁begin|>//! This module defines helper functions (builder pattern) to create a valid population. //! //! darwin-rs: evolutionary algorithms with Rust //! //! Written by Willi Kappler, Version 0.4 (2017.06.26) //! //! Repository: https://github.com/willi-kappler/da...
reset_limit_end: end, ..} if (end > 0) && (start >= end) => { Err(ErrorKind::LimitEndTooLow.into()) }
<|file_name|>cipherTWO.cpp<|end_file_name|><|fim▁begin|>/****************************************************************************** ** Copyright (C) 2016 Yakup Ates <Yakup.Ates@rub.de> ** This program is free software: you can redistribute it and/or modify ** it under the terms of the GNU General Public License...
<|file_name|>core.js<|end_file_name|><|fim▁begin|>'use strict'; module.exports = function() { // Occupy the global variable of Chart, and create a simple base class var Chart = function(item, config) { this.construct(item, config); return this; }; // Globally expose the defaults to allow for user updating/ch...
events: ['mousemove', 'mouseout', 'click', 'touchstart', 'touchmove'], hover: { onHover: null,
<|file_name|>datagrid.js<|end_file_name|><|fim▁begin|>/* * Datagrid.js */ function dg_send(url, grid, form, page, tamano, orderby, orderdirection) { var oForm = $("#"+form); var oGrid = $("#"+grid); var oLoader = $("#loader_"+grid); $('#Form_'+grid+'_page').val(page); $('#Form_'+grid+'_tamano').val(tamano); ...
$("#dialog-modal").dialog("open"); } });
<|file_name|>fakes.go<|end_file_name|><|fim▁begin|>/* 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-2.0 Unless r...
func NewFakeProbeProvider(probes map[ServicePort]*api_v1.Probe) *FakeProbeProvider { return &FakeProbeProvider{probes} }
<|file_name|>mod.rs<|end_file_name|><|fim▁begin|>pub mod config; pub mod common;<|fim▁hole|><|fim▁end|>
mod init; pub use drivers::pci::init::pci_init;
<|file_name|>models.py<|end_file_name|><|fim▁begin|>#encoding=utf-8 from django.utils.safestring import mark_safe from django.db import models from django.utils.six import python_2_unicode_compatible from mptt.models import MPTTModel from mptt.fields import TreeForeignKey, TreeManyToManyField from datetime import da...
<|file_name|>gen_events.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python ''' This script is used to generate a set of random-ish events to simulate log data from a Juniper Netscreen FW. It was built<|fim▁hole|>command to populate data: ./gen_events.py 2>&1 | nc 127.0.0.1 9999 ''' import random from netaddr impor...
around using netcat to feed data into Flume for ingestion into a Hadoop cluster. Once you have Flume configured you would use the following
<|file_name|>test_package_squash.py<|end_file_name|><|fim▁begin|># Copyright 2018 Red Hat, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/lice...
<|file_name|>ItemDescription.java<|end_file_name|><|fim▁begin|>package io.github.dousha.randomCraft.randomcraft; import java.util.HashMap; // WHY DOESN'T JAVA HAVE A STRUCT public class ItemDescription implements Cloneable{ public boolean type; // false = in, true = out, I would use #define in c/c++! public String...
ex.printStackTrace(); }
<|file_name|>sodium_type.rs<|end_file_name|><|fim▁begin|>// This macro allows to wrap Sodimoxide type to libindy type keeping the same behaviour macro_rules! sodium_type (($newtype:ident, $sodiumtype:path, $len:ident) => ( pub struct $newtype(pub(super) $sodiumtype); impl $newtype { #[allow(dead_code)...
impl Clone for $newtype { fn clone(&self) -> $newtype {
<|file_name|>models.py<|end_file_name|><|fim▁begin|>from django.db import models from machina.models.fields import ExtendedImageField, MarkupTextField RESIZED_IMAGE_WIDTH = 100 RESIZED_IMAGE_HEIGHT = 100 VALIDATED_IMAGE_MIN_WIDTH = 100 VALIDATED_IMAGE_MAX_WIDTH = 120 VALIDATED_IMAGE_MIN_HEIGHT = 100 VALIDATED_IMAGE_...
<|file_name|>resource_thread.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 ipc_channel::ipc; use msg::constellation_msg::{Pi...
let mock_hosts_file_content = "malformed file\n127.0.0.1 foo.bar.com\nservo.test.server 127.0.0.1"; let hosts_table = parse_hostsfile(mock_hosts_file_content); assert_eq!(1, hosts_table.len()); assert_eq!(ip("127.0.0.1"), *hosts_table.get("foo.bar.com").unwrap());
<|file_name|>gpio_handlers.py<|end_file_name|><|fim▁begin|>""" /* * Custom handlers for the BBB * */ """ import Adafruit_BBIO.GPIO as GPIO GPIO.setup("P9_12", GPIO.OUT) def alexaHandler(client, userdata, message): print "Received payload: " + str(message.payload.decode()) # Assume only 1 and 0 are send her...
elif message.payload == "0": GPIO.output("P9_12", GPIO.LOW) print "Turned christmas tree Off"
<|file_name|>error_log.js<|end_file_name|><|fim▁begin|>function error_log(message, message_type, destination, extra_headers) { // http://kevin.vanzonneveld.net // + original by: Paul Hutchinson (http://restaurantthing.com/) // + revised by: Brett Zamir (http://brett-zamir.me) // % note 1: The depen...
return this.mail(destination, subject, message, extra_headers); case 2: // No longer an option in PHP, but had been to send via TCP/IP to 'destination' (name or IP:port) // use socket_create() and socket_send()? return false;
<|file_name|>link_popup.js<|end_file_name|><|fim▁begin|>var xForRefIcon = 0; var yForRefIcon = 0; var xForSubDiagramIcon = 0; var yForSubDiagramIcon = 0; var xForTransIcon = 0; var yForTransIcon = 0; var fileLinks = []; var folderLinks = []; var urlLinks = []; var diagramLinks = []; var shapeLinks = [];...
else { vpLinkPageUrl = null;
<|file_name|>INotificationView.ts<|end_file_name|><|fim▁begin|>/**<|fim▁hole|> * `changedLecture` and `changedUnit` only represent the optional IDs (`_id`s) of the corresponding full interfaces of `INotification`. * The `user` is omitted, because the notifications currently can only be requested by the owner (i.e. `@C...
* Defines what the `{get} /api/notification/` aka `getNotifications` route returns as response (in form of an array). * It is the sanitized version of `INotification` interface: The property names are identical, but `changedCourse`,
<|file_name|>FiredriveCom.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- from pyload.plugin.internal.DeadCrypter import DeadCrypter class FiredriveCom(DeadCrypter): __name = "FiredriveCom" __type = "crypter" __version = "0.03" <|fim▁hole|> __pattern = r'https?://(?:www\.)?(firedrive|put...
<|file_name|>MobGrinder.java<|end_file_name|><|fim▁begin|>package com.avrgaming.civcraft.structure; import java.sql.ResultSet; import java.sql.SQLException; import java.util.concurrent.locks.ReentrantLock; import org.bukkit.Location; import com.avrgaming.civcraft.config.CivSettings; import com.avrgaming.civcraft.exc...
switch (crystal) {
<|file_name|>setup.py<|end_file_name|><|fim▁begin|>from __future__ import unicode_literals import re from setuptools import find_packages, setup def get_version(filename): content = open(filename).read() metadata = dict(re.findall("__([a-z]+)__ = '([^']+)'", content)) return metadata['version'] setup(...
],
<|file_name|>repl.js<|end_file_name|><|fim▁begin|><|fim▁hole|>var server = repl.start({}); var con = server.context; con.name='zfpx'; con.age = 5; con.grow = function(){ return ++con.age; }<|fim▁end|>
var repl = require('repl');
<|file_name|>mod.rs<|end_file_name|><|fim▁begin|>#[doc = r" Value read from the register"] pub struct R { bits: u32, } #[doc = r" Value to write to the register"] pub struct W { bits: u32, } impl super::CR2 { #[doc = r" Modifies the contents of the register"] #[inline(always)] pub fn modify<F>(&self...
#[doc = "Checks if the value of the field is `UPDATE`"] #[inline(always)] pub fn is_update(&self) -> bool { *self == MMSR::UPDATE
<|file_name|>todoListItem.tsx<|end_file_name|><|fim▁begin|>import * as React from 'react'; export interface TodoListItemProps { task: string; isCompleted: boolean; toggleTask: Function; saveTask: Function; deleteTask: Function; } export interface TodoListItemState { isEditing: boolean } expor...
private onSaveClick(event) { event.preventDefault(); var newTask = this.refs.editTask.value; if (newTask) {
<|file_name|>keras_vectorizer.py<|end_file_name|><|fim▁begin|>import sys import numpy as np from normalization import tokenize from helpers import ahash class KerasVectorizer(): ''' Convert list of documents to numpy array for input into Keras model ''' def __init__(self, n_features=100000, maxlen=...
class KerasPretokenizedVectorizer(KerasVectorizer):
<|file_name|>0003_add_pootle_user_store_score.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- # Generated by Django 1.10.5 on 2017-03-14 19:45 from __future__ import unicode_literals from django.conf import settings from django.db import migrations, models import django.db.models.deletion class Migration(mig...
'db_table': 'pootle_user_store_score', },
<|file_name|>network_info.py<|end_file_name|><|fim▁begin|><|fim▁hole|>""" category = "monitoring" organization = "jumpscale" author = "kristof@incubaid.com" license = "bsd" version = "1.0" roles = [] def action(): return j.sal.nettools.getNetworkInfo() if __name__ == "__main__": print(action())<|fim▁end|>
from JumpScale import j descr = """ This jumpscript returns network info
<|file_name|>test_msvc9compiler.py<|end_file_name|><|fim▁begin|>"""Tests for distutils.msvc9compiler.""" import sys import unittest import os from distutils.errors import DistutilsPlatformError from distutils.tests import support from test.support import run_unittest _MANIFEST = """\ <?xml version="1.0" encoding="UTF...
<|file_name|>debug.rs<|end_file_name|><|fim▁begin|>use core::slice; use drivers::io::{Io, Pio}; use system::error::Result; pub fn do_sys_debug(ptr: *const u8, len: usize) -> Result<usize> { let bytes = unsafe { slice::from_raw_parts(ptr, len) }; if unsafe { ::ENV_PTR.is_some() } { ::env().console.lo...
while !serial_status.readf(0x20) {} serial_data.write(8);