prompt
large_stringlengths
70
991k
completion
large_stringlengths
0
1.02k
<|file_name|>jinja_helpers.py<|end_file_name|><|fim▁begin|>import collections import json as jsonlib import os import random import re from operator import attrgetter from urlparse import urljoin from django.conf import settings from django.core.exceptions import ObjectDoesNotExist from django.forms import CheckboxIn...
def site_event_type(type): return amo.SITE_EVENT_CHOICES[type]
<|file_name|>empirical_covariance_.py<|end_file_name|><|fim▁begin|>""" Maximum likelihood covariance estimator. """ # Author: Alexandre Gramfort <alexandre.gramfort@inria.fr> # Gael Varoquaux <gael.varoquaux@normalesup.org> # Virgile Fritsch <virgile.fritsch@inria.fr> # # License: BSD 3 clause # avoi...
<|file_name|>EditorWindow.py<|end_file_name|><|fim▁begin|>import sys import os import re import imp from Tkinter import * import tkSimpleDialog import tkMessageBox import webbrowser from idlelib.MultiCall import MultiCallCreator from idlelib import idlever from idlelib import WindowList from idlelib import SearchDialo...
# In Shell on input line, go to just after prompt insertpt = int(self.text.index("iomark").split(".")[1]) else: line = self.text.get("insert linestart", "insert lineend")
<|file_name|>clientconn_test.go<|end_file_name|><|fim▁begin|>/* * * Copyright 2014, Google Inc. * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are * met: * * * Redistributions of source code ...
* */
<|file_name|>core.py<|end_file_name|><|fim▁begin|># Copyright (c) 2011 - Rui Batista <ruiandrebatista@gmail.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 Software Foundation, either version 3 of th...
def on_run(self): pass
<|file_name|>MailHeader.test.tsx<|end_file_name|><|fim▁begin|>import loudRejection from 'loud-rejection'; import { fireEvent, getByTestId, getByText } from '@testing-library/dom'; import { act, screen } from '@testing-library/react'; import { MAILBOX_LABEL_IDS } from '@proton/shared/lib/constants'; import { addApiM...
const upgradeLabel = getByText('Upgrade'); assertAppLink(upgradeLabel, '/mail/dashboard');
<|file_name|>RaidLeader.java<|end_file_name|><|fim▁begin|>package hs.minion; import hs.CardClass; import hs.CardSet; public class RaidLeader extends Minion { static final String Name = "Raid Leader"; static final int Cost = 3; static final CardClass Class = CardClass.NEUTRAL; static final String Text = "Your oth...
<|file_name|>urls.py<|end_file_name|><|fim▁begin|>from django.conf.urls import patterns, include, url from django.contrib import admin admin.autodiscover()<|fim▁hole|> url(r'^hall/(?P<slug>[-\w]+)/$', 'menu.views.halldetail', name='halldetail'), url(r'^admin/', include(admin.site.urls)), )<|fim▁end|>
urlpatterns = patterns('', url(r'^$', 'menu.views.home', name='home'),
<|file_name|>gdocs.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python from exceptions import KeyError import os import requests class GoogleDoc(object): """ A class for accessing a Google document as an object. Includes the bits necessary for accessing the document and auth and such. For example: ...
# Handle basically all the things that can go wrong. if not self.auth: raise KeyError("Error! You didn't get an auth token. Something very bad happened. File a bug?")
<|file_name|>draw.rs<|end_file_name|><|fim▁begin|>use specs::{Component, VecStorage}; use specs_derive::*; #[derive(Component, Debug, Default)] #[storage(VecStorage)] pub struct RenderOrder { pub depth: usize,<|fim▁hole|><|fim▁end|>
}
<|file_name|>DLPInspectTextTest.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 ...
import java.util.List; import org.apache.beam.sdk.testing.TestPipeline; import org.apache.beam.sdk.transforms.Create;
<|file_name|>contact.js<|end_file_name|><|fim▁begin|>'use strict'; angular.module('myApp.contact', ['ngRoute']) .config(['$routeProvider', function($routeProvider) { $routeProvider.when('/contact', { templateUrl: 'app/view/contact.html', controller: 'contactCtrl' })...
<|file_name|>assets.rs<|end_file_name|><|fim▁begin|>use std::path::{Path, PathBuf}; <|fim▁hole|>}<|fim▁end|>
pub fn get(p: &str) -> PathBuf { Path::new("assets").join(p)
<|file_name|>reservation.ts<|end_file_name|><|fim▁begin|><|fim▁hole|> } } }<|fim▁end|>
namespace lodgist.controllers { export class Reservation { constructor($scope: ng.IScope) {
<|file_name|>apps.py<|end_file_name|><|fim▁begin|>from django.apps import AppConfig <|fim▁hole|><|fim▁end|>
class BugzConfig(AppConfig): name = 'Bugz'
<|file_name|>StringUtils.java<|end_file_name|><|fim▁begin|>package com.artfulbits.utils; import android.text.TextUtils; import java.io.UnsupportedEncodingException; import java.util.logging.Logger; /** Common string routine. */ public final class StringUtils { /* [ CONSTANTS ] ===================================...
/* [ STATIC METHODS ] ================================================================================================================================== */ /**
<|file_name|>ColumnId.ts<|end_file_name|><|fim▁begin|>import { Identifier } from "../"; export class ColumnId extends Identifier<string> { constructor(value: string = Identifier.gen()) { super(value); } public equals(obj: any): boolean { return obj instanceof ColumnId && obj.value === this....
<|file_name|>podcastclient.cpp<|end_file_name|><|fim▁begin|>#include "podcastclient.h" QStringList PodcastClient::getFeedsFromSettings() { QStringList resultList = settings.value("feeds").toStringList(); if(resultList.isEmpty()) { QString string = settings.value("feeds").toString(); if(!string.isEmpty())...
<|file_name|>decomposition.py<|end_file_name|><|fim▁begin|># This file is part of MSMTools. # # Copyright (c) 2015, 2014 Computational Molecular Biology Group, Freie Universitaet Berlin (GER) # # MSMTools is free software: you can redistribute it and/or modify # it under the terms of the GNU Lesser General Public Licen...
reversible : bool, optional Indicate that transition matrix is reversible mu : (d,) ndarray, optional Stationary distribution of T
<|file_name|>test_discovery.py<|end_file_name|><|fim▁begin|>"""Test config flow.""" from unittest.mock import Mock, patch from homeassistant.components.hassio.handler import HassioAPIError from homeassistant.const import EVENT_HOMEASSISTANT_START from homeassistant.setup import async_setup_component from tests.common...
"password": "mock-pass", "protocol": "3.1.1", },
<|file_name|>invalid_uncompressed.js<|end_file_name|><|fim▁begin|>var hello = function() {<|fim▁hole|>};<|fim▁end|>
alert("My name is" name)
<|file_name|>admin_reset.py<|end_file_name|><|fim▁begin|>from flask_wtf import Form from wtforms import HiddenField, StringField from wtforms.validators import InputRequired, EqualTo from flask_login import current_user, abort, login_required from flask import request, flash, redirect, render_template import random imp...
from models.user_model import User from .. import blueprint
<|file_name|>gray.js<|end_file_name|><|fim▁begin|>document.addEventListener("DOMContentLoaded", function(event) { if (/android|blackberry|iPhone|iPad|iPod|webOS/i.test(navigator.userAgent) === false) { var linkDescrs = document.querySelectorAll('.link-descr'); Array.prototype.forEach.call(linkDescrs, function(el, ...
}; var animateTypeText = function() { var elem = this;
<|file_name|>trustedcoin.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python # # Electrum - Lightweight Bitcoin Client # Copyright (C) 2015 Thomas Voegtlin # # 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 Softwar...
wallet = None
<|file_name|>main.js<|end_file_name|><|fim▁begin|>import Vue from 'vue'; import Electron from 'vue-electron'; import Resource from 'vue-resource'; import Router from 'vue-router'; import KeenUI from 'keen-ui'; import 'keen-ui/dist/keen-ui.css'; import App from './App'; import routes from './routes'; Vue.use(Electron)...
<|file_name|>_document.tsx<|end_file_name|><|fim▁begin|>import React from 'react'; import Document, { Head, Main, NextScript } from 'next/document'; import { ServerStyleSheets } from '@material-ui/core/styles'; import theme from '../components/theme'; export default class MyDocument extends Document { render() { ...
<|file_name|>DESEncrypt.java<|end_file_name|><|fim▁begin|>package lm.com.framework.encrypt; import java.io.IOException; import java.security.SecureRandom; import javax.crypto.Cipher; import javax.crypto.SecretKey; import javax.crypto.SecretKeyFactory; import javax.crypto.spec.DESKeySpec; import sun.misc.BASE64Decode...
return ""; BASE64Decoder decoder = new BASE64Decoder(); byte[] buf = decoder.decodeBuffer(decryptString); byte[] bt = decrypt(buf, key.getBytes());
<|file_name|>ofxdump.cpp<|end_file_name|><|fim▁begin|>/*************************************************************************** ofxdump.cpp ------------------- copyright : (C) 2002 by Benoit Grégoire email : bock@step.polymtl.ca...
else cout<<"ofx_proc_transaction(): This should not happen!\n"; } if(data.invtransactiontype_valid==true){
<|file_name|>metrics.rs<|end_file_name|><|fim▁begin|>// Copyright 2016 TiKV Project Authors. Licensed under Apache-2.0. use prometheus::*; use prometheus_static_metric::*; make_static_metric! { pub label_enum MvccConflictKind { prewrite_write_conflict, rolled_back, commit_lock_not_found, ...
) .unwrap(); pub static ref MVCC_CONFLICT_COUNTER: MvccConflictCounterVec = { register_static_int_counter_vec!(
<|file_name|>index2.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python3 # -*- coding: utf-8 -*- import sys import os import mysql.connector import datetime HEADER_TEMPLATE = \ "HTTP/1.1 200 OK\r\n" \ "Server: webhttpd/2.0\r\n" \ "Cache-Control: no-cache, no-store, must-revalidate\r\n" \ "Connection: keep-alive\r\...
background: #00cccc; color: #fff; text-transform: uppercase; font-size: 12px;
<|file_name|>callee.go<|end_file_name|><|fim▁begin|>/* Progressive Call Results Example Callee This example demonstrates a callee client that sends data in chunks, as separate progressive call results. A callee may do this to send a large body of data in managable chunks, or to deliver some portion of the result more...
import ( "bytes"
<|file_name|>blueprints.js<|end_file_name|><|fim▁begin|>/** * Blueprint API Configuration * (sails.config.blueprints) * * These settings are for the global configuration of blueprint routes and * request options (which impact the behavior of blueprint actions). * * You may also override any of these settings on ...
* POST /foos * * PUT /foos/:id? * * DELETE /foos/:id? *
<|file_name|>Worksheet.ts<|end_file_name|><|fim▁begin|>/*! s.js (C) 2019-present SheetJS -- https://sheetjs.com */<|fim▁hole|>export class Worksheet { }<|fim▁end|>
/* vim: set ts=2: */
<|file_name|>GitParentModel.py<|end_file_name|><|fim▁begin|>""" Git Parent model """ from django.db import models class GitParentEntry(models.Model): """ Git Parent """ project = models.ForeignKey('gitrepo.GitProjectEntry', related_name='git_parent_project') parent = models.ForeignKey('gitrepo.GitCommitEn...
updated_at = models.DateTimeField(auto_now=True, editable=False) def __unicode__(self):
<|file_name|>package-info.java<|end_file_name|><|fim▁begin|><|fim▁hole|> * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to you under the Apache License, Version 2.0 * (the "License"); you may n...
/* * Licensed to the Apache Software Foundation (ASF) under one or more
<|file_name|>test_frame_split_iris.py<|end_file_name|><|fim▁begin|>import unittest, time, sys, random sys.path.extend(['.','..','py']) import h2o, h2o_cmd, h2o_glm, h2o_hosts, h2o_import as h2i, h2o_jobs, h2o_exec as h2e DO_POLL = False class Basic(unittest.TestCase): def tearDown(self): h2o.check_sandbox...
def test_frame_split(self):
<|file_name|>go-foreign.go<|end_file_name|><|fim▁begin|>// +build matcha package bridge // Go support functions for Objective-C. Note that this // file is copied into and compiled with the generated // bindings. /* #include <stdbool.h> #include <stdint.h> #include <stdlib.h> #include "go-foreign.h" */ import "C" im...
<|file_name|>join.js<|end_file_name|><|fim▁begin|>var assert = require('assert'); var R = require('..'); describe('join', function() { it("concatenates a list's elements to a string, with an seperator string between elements", function() {<|fim▁hole|><|fim▁end|>
var list = [1, 2, 3, 4]; assert.strictEqual(R.join('~', list), '1~2~3~4'); }); });
<|file_name|>ShippingDetails.java<|end_file_name|><|fim▁begin|>package com.mmm.product.domain; import java.io.Serializable; public class ShippingDetails implements Serializable{ <|fim▁hole|> private static final long serialVersionUID = 5941389959992371612L; }<|fim▁end|>
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|>from graph.graph_server import GraphServer<|fim▁hole|>__all__ = ['GraphServer']<|fim▁end|>
<|file_name|>ds_tc_resnet_test.py<|end_file_name|><|fim▁begin|># coding=utf-8 # Copyright 2022 The Google Research 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....
interpreter = tf.lite.Interpreter(model_content=tflite_streaming_model) interpreter.allocate_tensors()
<|file_name|>DBGlobals.java<|end_file_name|><|fim▁begin|>/* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates * and open the template in the editor. */ package database.parse.util; import almonds.Parse; import almonds.ParseObjec...
} }
<|file_name|>testcases.py<|end_file_name|><|fim▁begin|>from django.utils.six.moves import http_client from django.core.urlresolvers import reverse from django.contrib.auth.models import Permission from django_webtest import WebTest from purl import URL from oscar.core.compat import get_user_model User = get_user_mo...
http_client.FORBIDDEN)) def assertRedirectUrlName(self, response, name, kwargs=None):
<|file_name|>setup.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python from distutils.core import setup setup( name = 'pydouban', version = '1.0.0',<|fim▁hole|> url = 'http://i.shiao.org/a/pydouban', packages = ['pydouban'], )<|fim▁end|>
description = 'Lightweight Python Douban API Library', author = 'Marvour', author_email = 'marvour@gmail.com', license = 'BSD License',
<|file_name|>vaesenc.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 vaesenc_1() { run_test(&Instruction { mnemonic: Mnemonic::VAESENC,...
}
<|file_name|>unit_graph.rs<|end_file_name|><|fim▁begin|>//! Tests for --unit-graph option. use cargo_test_support::project; use cargo_test_support::registry::Package; #[cargo_test] fn gated() { let p = project().file("src/lib.rs", "").build(); p.cargo("build --unit-graph") .with_status(101) .w...
"opt_level": "0", "lto": "false", "codegen_units": null, "debuginfo": 2,
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|>""" Support for MQTT vacuums. For more details about this platform, please refer to the documentation at https://www.home-assistant.io/components/vacuum.mqtt/ """ import logging import voluptuous as vol from homeassistant.components.vacuum import DOMAIN from home...
return schemas[value[CONF_SCHEMA]](value)
<|file_name|>.eslintrc.js<|end_file_name|><|fim▁begin|>module.exports = { "env": {<|fim▁hole|> "commonjs": true, "es6": true, "jasmine" : true }, "extends": "eslint:recommended", "parserOptions": { "sourceType": "module" }, "rules": { "no-mixed-spaces-and-t...
"browser": true,
<|file_name|>MusicFile.java<|end_file_name|><|fim▁begin|>package com.mobisys.musicplayer.model; import android.os.Parcel; import android.os.Parcelable; /** * Created by Govinda P on 6/3/2016. */ public class MusicFile implements Parcelable { private String title; private String album; private String id...
public static final Creator<MusicFile> CREATOR = new Creator<MusicFile>() { @Override
<|file_name|>regress-373827-01.js<|end_file_name|><|fim▁begin|>/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ /* 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...
<|file_name|>trainergui.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- # Form implementation generated from reading ui file 'trainergui.ui' # # Created: Tue May 24 14:29:31 2016 # by: PyQt4 UI code generator 4.10.4 # # WARNING! All changes made in this file will be lost! from PyQt4 import QtCore, QtGui ...
MainWindow.setDocumentMode(False)
<|file_name|>factorial.js<|end_file_name|><|fim▁begin|>'use strict'; module.exports = function (math) { var util = require('../../util/index'), BigNumber = math.type.BigNumber, collection = require('../../type/collection'), isNumber = util.number.isNumber, isBoolean = util['boolean'].isBool...
res = one; // 0! is per definition 1 }
<|file_name|>lib.rs<|end_file_name|><|fim▁begin|>#![allow(non_upper_case_globals)] #![allow(non_camel_case_types)] #![allow(non_snake_case)] include!(concat!(env!("OUT_DIR"), "/bindings.rs")); #[cfg(test)] mod tests {<|fim▁hole|> fn it_works() {} }<|fim▁end|>
#[test]
<|file_name|>databasemanager.cpp<|end_file_name|><|fim▁begin|>/** * The Forgotten Server - a free and open-source MMORPG server emulator * Copyright (C) 2014 Mark Samman <mark.samman@gmail.com> * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public ...
<|file_name|>csv_logger.py<|end_file_name|><|fim▁begin|>__author__ = 'teemu kanstren' import pypro.utils as utils import pypro.snmp.config as config class CSVFileLogger: files = {} def __init__(self): oids = config.SNMP_OIDS utils.check_dir() self.event_log = open(utils.event_log+".c...
def close(self): for file in self.files:
<|file_name|>opts.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/. */ //! Configuration options for a single run of the servo applicat...
userscripts: None, user_stylesheets: Vec::new(),
<|file_name|>decoder.py<|end_file_name|><|fim▁begin|># # This file is part of pyasn1 software. # # Copyright (c) 2005-2019, Ilya Etingof <etingof@gmail.com> # License: http://snmplabs.com/pyasn1/license.html # from pyasn1 import debug from pyasn1 import error from pyasn1.codec.ber import eoo from pyasn1.compat.integer ...
__all__ = ['decode']
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|><|fim▁hole|>from .main import main, zdkb<|fim▁end|>
<|file_name|>SILGenBridging.cpp<|end_file_name|><|fim▁begin|>//===--- SILGenBridging.cpp - SILGen for bridging to Clang ASTs -----------===// // // This source file is part of the Swift.org open source project // // Copyright (c) 2014 - 2017 Apple Inc. and the Swift project authors // Licensed under Apache License v2.0...
ManagedValue::forUnmanaged(fn), subs, args, calleeTypeInfo,
<|file_name|>func.go<|end_file_name|><|fim▁begin|>package main func main() { fn := func() { println("Hello, World!") } fn() fns := [](func(x int) int){ func(x int) int { return x + 1 }, func(x int) int { return x + 2 }, } println(fns[1](100)) d := struct { fn func() string }{ fn: func() string { re...
fc := make(chan func() string, 2) fc <- func() string { return "Hello, World!" } println((<-fc)())
<|file_name|>settings.py<|end_file_name|><|fim▁begin|>""" Django settings for figexample project. For more information on this file, see https://docs.djangoproject.com/en/1.7/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/1.7/ref/settings/ """ # Build paths ins...
<|file_name|>parameter_test.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- # # Copyright 2012-2015 Spotify AB # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.or...
@with_config({"A": {"p": "p_default"}}) def testDefaultFromTaskName(self):
<|file_name|>lib.rs<|end_file_name|><|fim▁begin|>//! A fast, low-level IO library for Rust focusing on non-blocking APIs, event //! notification, and other useful utilities for building high performance IO //! apps. //! //! # Goals //! //! * Fast - minimal overhead over the equivalent OS facilities (epoll, kqueue, etc....
//! const SERVER: Token = Token(0); //! const CLIENT: Token = Token(1);
<|file_name|>app.js<|end_file_name|><|fim▁begin|>var RoonApi = require("node-roon-api"), RoonApiStatus = require("node-roon-api-status"), RoonApiSettings = require("node-roon-api-settings"), RoonApiSourceControl = require("node-roon-api-source-control"), RoonApiVolumeControl = require("node-roon-api...
if (settings.receiver_url != "" && settings.receiver_url.match(/^(?:[0-9]{1,3}\.){3}[0-9]{1,3}$/) === null) { v.error = "Please enter a valid IP-address";
<|file_name|>Person.java<|end_file_name|><|fim▁begin|>package com.baeldung.reflect; public class Person { private String fullName; public Person(String fullName) { this.fullName = fullName; } <|fim▁hole|> public String getFullName() { return fullName; } }<|fim▁end|>
public void setFullName(String fullName) { this.fullName = fullName; }
<|file_name|>util.rs<|end_file_name|><|fim▁begin|>/* * Copyright 2015-2016 Ben Ashford * * 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....
<|file_name|>mp3gen.py<|end_file_name|><|fim▁begin|><|fim▁hole|>#!/usr/bin/python # -*- coding: utf-8 -*- # # This would be a lot easier with a shellscript. # Will probably just do this in bash, once I make this work. # In this case we're doing it for educational purposes. # Expect future revisions to be faster and mor...
<|file_name|>DefaultSelectStrategy.java<|end_file_name|><|fim▁begin|>/* * Copyright 2016 The Netty Project * * The Netty Project licenses this file to you 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...
* * Unless required by applicable law or agreed to in writing, software
<|file_name|>ControllerServlet.java<|end_file_name|><|fim▁begin|>package org.se.lab; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.IOException; import java.io.ObjectInputStream; import java.io.ObjectOutputStream; import java.io.PrintWriter; import java.util.ArrayList; import...
} catch (IOException e) {
<|file_name|>Reference.java<|end_file_name|><|fim▁begin|>package com.fnacmod.fnac; //This code is copyright SoggyMustache, Link1234Gamer and Andrew_Playz public class Reference { public static final String MOD_ID = "fnac"; <|fim▁hole|> public static final String CLIENT_PROXY_CLASS = "com.fnacmod.fnac.proxy.ClientPr...
public static final String MOD_NAME = "Five Nights at Candy's Mod"; public static final String VERSION = "1.0";
<|file_name|>build.rs<|end_file_name|><|fim▁begin|>extern crate syntex; extern crate serde_codegen; use std::env; use std::path::Path; pub fn main() { let out_dir = env::var_os("OUT_DIR").unwrap(); let src = Path::new("src/lib.rs.in"); let dst = Path::new(&out_dir).join("lib.rs"); let mut registry =...
serde_codegen::register(&mut registry); registry.expand("google-doubleclickbidmanager1", &src, &dst).unwrap(); }
<|file_name|>RandomizedQueue.java<|end_file_name|><|fim▁begin|>package com.linbo.algs.examples.queues; import java.util.Iterator; import com.linbo.algs.util.StdRandom; /** * Created by @linbojin on 13/1/17. * Ref: http://coursera.cs.princeton.edu/algs4/assignments/queues.html * RandomizedQueue: a double-ended que...
if (size == q.length) resize(2 * q.length); // double size of array if necessary q[last++] = item; // add item if (last == q.length) last = 0; // wrap-around
<|file_name|>Ipkg.py<|end_file_name|><|fim▁begin|>import os from enigma import eConsoleAppContainer from Components.Harddisk import harddiskmanager opkgDestinations = [] opkgStatusPath = '' def opkgExtraDestinations(): global opkgDestinations return ''.join([" --dest %s:%s" % (i,i) for i in opkgDestinations]) def ...
self.cache = data else:
<|file_name|>mount.rs<|end_file_name|><|fim▁begin|>use libc::{c_ulong, c_int}; use libc; use {Errno, Result, NixPath}; bitflags!( pub struct MsFlags: c_ulong { const MS_RDONLY = libc::MS_RDONLY; // Mount read-only const MS_NOSUID = libc::MS_NOSUID; // Ignore suid and sgid bits ...
} );
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|>try: from ttag.args import Arg, BasicArg, BooleanArg, ConstantArg, DateArg, \ DateTimeArg, IntegerArg, IsInstanceArg, KeywordsArg, \ ModelInstanceArg, StringArg, TimeArg, MultiArg from ttag.core import Tag from ttag.exceptions import TagA...
def get_version(number_only=False): version = [str(VERSION[0])] number = True for bit in VERSION[1:]:
<|file_name|>Ui_ExportData.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- # Form implementation generated from reading ui file 'Ui_ExportData.ui' # # Created: Sat May 28 00:16:57 2011 # by: PyQt4 UI code generator 4.8.4 # # WARNING! All changes made in this file will be lost! from PyQt4 import QtCore, Q...
self.groupBox_5.setObjectName(_fromUtf8("groupBox_5")) self.verticalLayout_4 = QtGui.QVBoxLayout(self.groupBox_5) self.verticalLayout_4.setObjectName(_fromUtf8("verticalLayout_4"))
<|file_name|>factor.rs<|end_file_name|><|fim▁begin|>// * This file is part of the uutils coreutils package. // *<|fim▁hole|>// * // * For the full copyright and license information, please view the LICENSE file // * that was distributed with this source code. use smallvec::SmallVec; use std::cell::RefCell; use std::fm...
// * (c) 2020 nicoo <nicoo@debian.org>
<|file_name|>cash register.py<|end_file_name|><|fim▁begin|><|fim▁hole|><|fim▁end|>
#cash register #Samuel Armstrong
<|file_name|>test_version.py<|end_file_name|><|fim▁begin|># Copyright 2017,2018 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/L...
res = version.version(req) self.assertEqual('application/json', req.response.content_type)
<|file_name|>clean_test.go<|end_file_name|><|fim▁begin|>// Copyright 2020 The Knative 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/LICE...
t.Run("incompleted or wrong args for service clean", func(t *testing.T) { client := k8sfake.NewSimpleClientset()
<|file_name|>printTileConfigCoords.py<|end_file_name|><|fim▁begin|>import os, sys sys.path = [os.path.join(os.getcwd(), "..") ] + sys.path sys.path = [os.path.join(os.getcwd(), "..", "..") ] + sys.path from flTile.amConfig import CreateAMConfig def run(): tileConfig = CreateAMConfig() #hostname = gethostname...
if __name__ == "__main__": run()
<|file_name|>lib.rs<|end_file_name|><|fim▁begin|>//! Library that contains utility functions for tests. //! //! It also contains a test module, which checks if all source files are covered by `Cargo.toml` extern crate hyper; extern crate regex; extern crate rustc_serialize; pub mod rosetta_code; use std::fmt::Debug;...
}) .filter(|s| s[..].ends_with(".rs")) .collect()
<|file_name|>util.py<|end_file_name|><|fim▁begin|>from collections import Counter import sys import numpy as np import scipy as sp from lexical_structure import WordEmbeddingDict import dense_feature_functions as df def _get_word2vec_ff(embedding_path, projection): word2vec = df.EmbeddingFeaturizer(embedding_path)...
feature_matrix = sp.sparse.lil_matrix((len(relation_list), len(alphabet)))
<|file_name|>screenshot_flow.cc<|end_file_name|><|fim▁begin|>// Copyright 2021 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/image_editor/screenshot_flow.h" #include <memory> #include "base/l...
<|file_name|>foundation-sites-tests.ts<|end_file_name|><|fim▁begin|>// Tests for type definitions for Foundation Sites v6.0.4 // Project: http://foundation.zurb.com/ // Definitions by: Sam Vloeberghs <https://github.com/samvloeberghs/> // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped /// <reference p...
Foundation.Sticky($('.selector'));
<|file_name|>CWE190_Integer_Overflow__int_fgets_multiply_72b.cpp<|end_file_name|><|fim▁begin|>/* TEMPLATE GENERATED TESTCASE FILE Filename: CWE190_Integer_Overflow__int_fgets_multiply_72b.cpp Label Definition File: CWE190_Integer_Overflow__int.label.xml Template File: sources-sinks-72b.tmpl.cpp */ /* * @descript...
int data = dataVector[2];
<|file_name|>networks.py<|end_file_name|><|fim▁begin|># Main network and testnet3 definitions params = { 'bitcoin_main': { 'pubkey_address': 50, 'script_address': 9, 'genesis_hash': '00000c7c73d8ce604178dae13f0fc6ec0be3275614366d44b1b4b5c6e238c60c'<|fim▁hole|> 'script_address': 188, ...
}, 'bitcoin_test': { 'pubkey_address': 88,
<|file_name|>remote.rs<|end_file_name|><|fim▁begin|>use std::cell::{RefCell, Ref, Cell}; use std::io::SeekFrom; use std::io::prelude::*; use std::mem; use std::path::Path; use curl::easy::{Easy, List}; use git2; use hex::ToHex; use serde_json; use url::Url; use core::{PackageId, SourceId}; use ops; use sources::git; ...
<|file_name|>sensor.py<|end_file_name|><|fim▁begin|>"""Support for Melnor RainCloud sprinkler water timer.""" from __future__ import annotations import logging import voluptuous as vol from homeassistant.components.sensor import PLATFORM_SCHEMA, SensorEntity from homeassistant.const import CONF_MONITORED_CONDITIONS ...
cv.ensure_list, [vol.In(SENSORS)] )
<|file_name|>bitcoin_zh_CN.ts<|end_file_name|><|fim▁begin|><?xml version="1.0" ?><!DOCTYPE TS><TS language="zh_CN" version="2.0"> <defaultcodec>UTF-8</defaultcodec> <context> <name>AboutDialog</name> <message> <location filename="../forms/aboutdialog.ui" line="14"/> <source>About PACCoin</source...
<location filename="../forms/sendcoinsentry.ui" line="120"/> <source>Paste address from clipboard</source>
<|file_name|>dce.rs<|end_file_name|><|fim▁begin|>// Copyright (c) 2015, The Radare Project. All rights reserved. // See the COPYING file at the top-level directory of this distribution. // Licensed under the BSD 3-Clause License: // <http://opensource.org/licenses/BSD-3-Clause> // This file may not be copied, modified,...
<|file_name|>error.ts<|end_file_name|><|fim▁begin|>import shortid from 'shortid'; import { ErrorLevel } from '~client/constants/error'; export const enum ActionTypeError { Opened = '@@error/OPENED', Closed = '@@error/CLOSED', Removed = '@@error/REMOVED', } type ActionErrorOpened = { type: ActionTypeError.Ope...
text: string, level: ErrorLevel = ErrorLevel.Err,
<|file_name|>lib.rs<|end_file_name|><|fim▁begin|>mod point; mod size; mod traits; #[macro_use] mod vector;<|fim▁hole|>pub use self::size::Size; pub use self::traits::{Advance, Collide, Position};<|fim▁end|>
pub use self::vector::Vector; pub use self::point::Point;
<|file_name|>u_str.rs<|end_file_name|><|fim▁begin|>// Copyright 2012-2014 The Rust Project Developers. See the COPYRIGHT // file at the top-level directory of this distribution and at // http://rust-lang.org/COPYRIGHT. // // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or // http://www.apache.org/lice...
}
<|file_name|>SearchParser.py<|end_file_name|><|fim▁begin|>__author__ = 'Liam' import types def flag(func): func.is_flag = True return func class BadSearchOp(Exception): def __init__(self, value = "bad search operation"): self.value = value def __str__(self): return "BadSearchOp: %s"...
<|file_name|>Util.py<|end_file_name|><|fim▁begin|>#Boss Ogg - A Music Server #(c)2003 by Ted Kulp (wishy@comcast.net) #This project's homepage is: http://bossogg.wishy.org # #This program is free software; you can redistribute it and/or modify #it under the terms of the GNU General Public License as published by #the F...
session = Session() args = [] for i in argstuple:
<|file_name|>cli.js<|end_file_name|><|fim▁begin|>#!/usr/bin/env node<|fim▁hole|><|fim▁end|>
require("./bin/npm-cli.js")
<|file_name|>word_index.rs<|end_file_name|><|fim▁begin|>#![stable] //! This module is used to index words and does the heavy lifting of our program. /// A counted word. /// /// This struct contains members for storing a word and the number of times it appeared. This /// struct is intended for use with [`add_word`](fn....
<|file_name|>manage.py<|end_file_name|><|fim▁begin|>#!env/bin/python from flask_script import Manager from flask_migrate import Migrate, MigrateCommand from app import app, db <|fim▁hole|> manager = Manager(app) manager.add_command('db', MigrateCommand) if __name__ == '__main__': manager.run()<|fim▁end|>
migrate = Migrate(app, db)
<|file_name|>main.rs<|end_file_name|><|fim▁begin|>fn is_prime(number: i32) -> bool { if number % 2 == 0 && number != 2 || number == 1 { return false; } let limit = (number as f32).sqrt() as i32 + 1; // We test if the number is divisible by any odd number up to the limit (3..limit).step_by(...
} fn main() {