prompt large_stringlengths 70 991k | completion large_stringlengths 0 1.02k |
|---|---|
<|file_name|>index.d.ts<|end_file_name|><|fim▁begin|>// Type definitions for easy-jsend
// Project: https://github.com/DeadAlready/easy-jsend
// Definitions by: Karl Düüna <https://github.com/DeadAlready/>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
declare namespace Express {
interface M... | interface PartialInput { |
<|file_name|>mod.rs<|end_file_name|><|fim▁begin|>//!
//! This Package Contains Some Implementations of Machine Learning
//!
//!<|fim▁hole|>pub mod common;
pub mod eval;
pub mod linear;<|fim▁end|> | // #[allow(dead_code)]
|
<|file_name|>resources.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
# Resource object code
#
# Created by: The Resource Compiler for PyQt5 (Qt v5.12.1)
#
# WARNING! All changes made in this file will be lost!
from PyQt5 import QtCore
qt_resource_data = b"\
\x00\x00\x04\x0a\
\x89\
\x50\x4e\x47\x0d\x0a\x1a\... | "
qt_resource_struct_v2 = b"\ |
<|file_name|>factories.rs<|end_file_name|><|fim▁begin|>use std::collections::HashMap;
use pueue_lib::network::message::*;
use pueue_lib::settings::*;
use pueue_lib::state::PUEUE_DEFAULT_GROUP;
/// Create a AddMessage for a given command.
pub fn add_message(shared: &Shared, command: &str) -> AddMessage {
AddMessag... | stashed: false,
group: PUEUE_DEFAULT_GROUP.into(),
enqueue_at: None,
dependencies: vec![], |
<|file_name|>box-of-array-of-drop-2.rs<|end_file_name|><|fim▁begin|>// Copyright 2015 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.apa... |
impl Drop for D {
fn drop(&mut self) { |
<|file_name|>vcgMeshStatsNode.cpp<|end_file_name|><|fim▁begin|><|fim▁hole|> */
// Local
#include <vcgNodes/vcgMeshStats/vcgMeshStatsNode.h>
#include <vcgNodes/vcgNodeTypeIds.h>
// Utils
#include <utilities/debugUtils.h>
// Function Sets
#include <maya/MFnMeshData.h>
#include <maya/MFnTypedAttribute.h>
#include <maya... | /*
* |
<|file_name|>taxi_pipeline_kubernetes_test.py<|end_file_name|><|fim▁begin|># Copyright 2020 Google LLC. 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... | |
<|file_name|>test_topi_bitserial_conv2d.py<|end_file_name|><|fim▁begin|>import numpy as np
import tvm
import topi
import topi.testing<|fim▁hole|>def generate_quantized_np(shape, bits, out_dtype):
min_val = 0
max_val = 1 << bits
return np.random.randint(min_val, max_val, size=shape).astype(out_dtype)
def ve... | from topi.util import get_const_tuple
from tvm.contrib.pickle_memoize import memoize
|
<|file_name|>fichier_libcurl.cpp<|end_file_name|><|fim▁begin|>/*********************************************************************/
// dar - disk archive - a backup/restoration program
// Copyright (C) 2002-2022 Denis Corbin
//
// This program is free software; you can redistribute it and/or
// modify it under the te... | |
<|file_name|>response.py<|end_file_name|><|fim▁begin|>"""
VerseBot for Reddit
By Matthieu Grieger
Continued By Team VerseBot
response.py
Copyright (c) 2015 Matthieu Grieger (MIT License)
"""
MAXIMUM_MESSAGE_LENGTH = 4000<|fim▁hole|> """ Class that holds the properties and methods of a comment
response. """
... |
class Response: |
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|>"""
GraphLab Create offers several data structures for data analysis.
Concise descriptions of the data structures and their methods are contained in
the API documentation, along with a small number of simple examples. For more
detailed descriptions and examples, pl... | '''
|
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
# Gedit Better Defaults plugin
# Copyright (C) 2017 Fabio Zendhi Nagao
#
# 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 Founda... | |
<|file_name|>score_encoding_export.py<|end_file_name|><|fim▁begin|>##############################################################################
#
# OSIS stands for Open Student Information System. It's an application
# designed to manage the core business of higher education institutions,
# such as universit... | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
<|file_name|>events.js<|end_file_name|><|fim▁begin|>'use strict';
/* globals app, ajaxify, define, socket */
define('forum/topic/events', ['forum/topic/browsing', 'forum/topic/postTools', 'forum/topic/threadTools'], function(browsing, postTools, threadTools) {
var Events = {};
var events = {
'event:update_users... |
postTools.updatePostCount(); |
<|file_name|>mu_minorticks.py<|end_file_name|><|fim▁begin|>from kapteyn import maputils
from matplotlib import pyplot as plt<|fim▁hole|>fitsobj = maputils.FITSimage("m101.fits")
fig = plt.figure()
fig.subplots_adjust(left=0.18, bottom=0.10, right=0.90,
top=0.90, wspace=0.95, hspace=0.20)
for i in ra... | |
<|file_name|>computed_margin_test.rs<|end_file_name|><|fim▁begin|>#[macro_use]
extern crate yoga;
use yoga::{Direction, Node};
use yoga::prelude::*;
#[test]
fn test_computed_layout_margin() {
let mut root = Node::new();
style!(root,
Width(100 pt),
Height(100 pt),
MarginStart(10 %)
);
root.calculate_layout... | |
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
<|fim▁hole|><|fim▁end|> | from .config import Config |
<|file_name|>mod.rs<|end_file_name|><|fim▁begin|>/*
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
use crate::definitions::{Argument, Directive, *};
use crate::errors::SchemaError... | id_type: _id_type,
unchecked_argument_type_sentinel: _unchecked_argument_type_sentinel,
type_map, |
<|file_name|>message.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python3
# This file is part of Epoptes, http://epoptes.org
# Copyright 2012-2018 the Epoptes team, see AUTHORS.
# SPDX-License-Identifier: GPL-3.0-or-later
"""
Display a simple window with a message.
"""
import os
import sys
from _common import gettext as... |
image = Gtk.Image.new_from_icon_name(icon_name, Gtk.IconSize.DIALOG) |
<|file_name|>camera_try.py<|end_file_name|><|fim▁begin|># quick demo of some python image filters
# using raspberry pi camera<|fim▁hole|>import Tkinter as tk
from picamera import PiCamera
from time import sleep
from PIL import Image,ImageFilter,ImageChops,ImageTk
imagefile = "image.jpg"
w = 320
h = 240
lastfilter = "n... | |
<|file_name|>mrml_utils.cpp<|end_file_name|><|fim▁begin|>/* This file is part of the KDE project
Copyright (C) 2002 Carsten Pfeiffer <pfeiffer@kde.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 Free Software... | DCOPClient *client = DCOPClient::mainClient();
Watcher_stub watcher( client, "kded", "daemonwatcher"); |
<|file_name|>EditPresentationSourceEvent.java<|end_file_name|><|fim▁begin|>/*
* EditPresentationSourceEvent.java
*
* Copyright (C) 2020 by RStudio, PBC
*
* Unless you have received this program directly from RStudio pursuant
* to the terms of a commercial license agreement with RStudio, then
* this program is li... | |
<|file_name|>types.ts<|end_file_name|><|fim▁begin|>import { MikroOrmModuleSyncOptions } from '@mikro-orm/nestjs';
/**
* connection options not to be used in module options for the in memory db module as it is overriding the connection
*/
type ConnectionOptions = 'type' | 'driver' | 'clientUrl' | 'dbName' | 'user' | ... | |
<|file_name|>setup.py<|end_file_name|><|fim▁begin|><|fim▁hole|>from setuptools import find_packages, setup
from eventlet import __version__
from os import path
setup(
name='eventlet',
version=__version__,
description='Highly concurrent networking library',
author='Linden Lab',
author_email='eventl... | #!/usr/bin/env python |
<|file_name|>build_tfidf.py<|end_file_name|><|fim▁begin|>import pandas as pd
import numpy as np
import re
from gensim import corpora, models, similarities
from gensim.parsing.preprocessing import STOPWORDS
def split(text):
'''
Split the input text into words/tokens; ignoring stopwords and empty strings
'''
de... | |
<|file_name|>TranslationCache.rs<|end_file_name|><|fim▁begin|>extern crate libc;
use std::mem;
use std::marker;
use std::ops::{Index, IndexMut};
extern{
fn memset(s: *mut libc::c_void, c: libc::uint32_t, n: libc::size_t) -> *mut libc::c_void;
}
pub struct TranslationCache {
pub page : *mut u8
}
unsafe impl ... | fn index_mut(&mut self, _index: usize) -> &mut u8 {
unsafe {&mut *self.page.offset(_index as isize) }
} |
<|file_name|>civ_battleroyal_leader_civ_adder.py<|end_file_name|><|fim▁begin|>import sys
def get_civ_leader(civ_leader_file):
"""Reads in a file with civs mapped to leaders and add it to a dict.
"""
return {leader.strip('\n'): country
for line in civ_leader_file
for (country, leade... | |
<|file_name|>DataStore.java<|end_file_name|><|fim▁begin|>package bpmn;
public class DataStore extends Artifact {
public DataStore() {
super();
}
<|fim▁hole|>
public String toString() {
return "BPMN data store";
}
}<|fim▁end|> | public DataStore(int xPos, int yPos, String text) {
super();
setText(text);
}
|
<|file_name|>orders.js<|end_file_name|><|fim▁begin|>'use strict'
const {Product, Review, User, Category, Tag, Order, Address, LineItem} = require('APP/db')
const Promise = require('bluebird')
const {assertAdminOrSelfForOrder, mustBeLoggedIn} = require('APP/server/auth.filters.js')
module.exports = require('express').... | .catch(next)
})
.get('/', (req, res, next) => { |
<|file_name|>toolset_requirements.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python
# Copyright 2014 Steven Watanabe
# Distributed under the Boost Software License, Version 1.0.
# (See accompanying file LICENSE.txt or https://www.bfgroup.xyz/b2/LICENSE.txt)
# Test the handling of toolset.add-requirements
import Boos... | import toolset ;
import errors ;
|
<|file_name|>container_sorter.go<|end_file_name|><|fim▁begin|>package hijackhelpers
import (
"strings"
"github.com/concourse/atc"
)
type ContainerSorter []atc.Container
func (sorter ContainerSorter) Len() int {
return len(sorter)
}
func (sorter ContainerSorter) Swap(i, j int) {
sorter[i], sorter[j] = sorter[j]... | return true
case strings.Compare(sorter[i].ResourceName, sorter[j].ResourceName) == 1:
return false
case strings.Compare(sorter[i].StepName, sorter[j].StepName) == -1: |
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|><|fim▁hole|>
if django.VERSION >= (3, 2):
# The declaration is only needed for older Django versions
pass
else:
default_app_config = (
"wagtail.contrib.simple_translation.apps.SimpleTranslationAppConfig"
)<|fim▁end|> | import django |
<|file_name|>strategy_test.go<|end_file_name|><|fim▁begin|>/*
Copyright 2016 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
... |
func TestPodDisruptionBudgetStrategy(t *testing.T) {
ctx := api.NewDefaultContext()
if !Strategy.NamespaceScoped() { |
<|file_name|>base.py<|end_file_name|><|fim▁begin|># Authors:
# Jason Gerard DeRose <jderose@redhat.com>
#
# Copyright (C) 2008 Red Hat
# see file 'COPYING' for use and warranty information
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License ... | the names will be in alphabetical order (which is the default).
This method is like an ordered version of ``dict.iterkeys()``. |
<|file_name|>button.js<|end_file_name|><|fim▁begin|>(function(Button, set) {
set += ": ";
test(set + "Test btn class added", function() {
var $elements;
$elements = new Button($("<a>").add("<button>").add("<input>"));
ok($elements.hasClass("btn"), "Buttons should be of the btn c... | |
<|file_name|>webhtml.go<|end_file_name|><|fim▁begin|>// Copyright 2017 Google Inc. All Rights Reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/lic... | }
|
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|><|fim▁hole|><|fim▁end|> | # -*- coding: utf-8 -*-
from . import stock_return_picking |
<|file_name|>asn2wrs.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
#
# asn2wrs.py
# ASN.1 to Wireshark dissector compiler
# Copyright 2004 Tomas Kukosa
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the
# "Software"), to d... | |
<|file_name|>ScriptingFileSystemObject.py<|end_file_name|><|fim▁begin|>import os
import string
import random
import logging
from thug.ActiveX.modules import WScriptShell
from thug.ActiveX.modules import TextStream
from thug.ActiveX.modules import File
from thug.ActiveX.modules import Folder
from thug.OS.Windows import... | def GetFile(self, filespec): # pylint:disable=unused-argument
log.ThugLogging.add_behavior_warn(f'[Scripting.FileSystemObject ActiveX] GetFile("{filespec}")')
return File.File(filespec)
|
<|file_name|>listconfig.py<|end_file_name|><|fim▁begin|>from evostream.default import api
from evostream.management.base import BaseEvoStreamCommand
class Command(BaseEvoStreamCommand):
help = 'Returns a list with all push/pull configurations.'
<|fim▁hole|> def get_results(self, *args, **options):
retu... | requires_system_checks = False
|
<|file_name|>admonitions.py<|end_file_name|><|fim▁begin|># $Id: admonitions.py 7681 2013-07-12 07:52:27Z milde $
# Author: David Goodger <goodger@python.org>
# Copyright: This module has been placed in the public domain.
"""
Admonition directives.
"""
__docformat__ = 'reStructuredText'
from docutils.parsers.rst imp... | |
<|file_name|>index.js<|end_file_name|><|fim▁begin|><|fim▁hole|>const assert = require('assert')<|fim▁end|> | |
<|file_name|>datatablecolresizedemo.ts<|end_file_name|><|fim▁begin|>import {Component,OnInit} from '@angular/core';
import {ROUTER_DIRECTIVES} from '@angular/router';
import {HTTP_PROVIDERS} from '@angular/http';
import {DataTable} from '../../../components/datatable/datatable';
import {CodeHighlighter} from '../../... | this.carService.getCarsSmall().then(cars => this.cars = cars); |
<|file_name|>0004_rmpub.py<|end_file_name|><|fim▁begin|>from south.db import db
from django.db import models
from askmeanything.models import *
class Migration:
def forwards(self, orm):
"Write your forwards migration here"
def backwards(self, orm):
"Write your backwards migration... | 'auth.user': {
'date_joined': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}),
'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'blank': 'True'}),
'first_name': ('django.db.models.fields.CharField', [], {'max_length'... |
<|file_name|>testkeys.rs<|end_file_name|><|fim▁begin|>extern crate safex;
extern crate rustc_serialize;
use safex::genesis::key_generation::KeyPair;
fn main() {
let our_key = KeyPair::create().ok().expect("error");
let the_secret = KeyPair::private_key_tobase64(our_key.secret);
print!("your base64 private key {... |
let our_key = KeyPair::create().ok().expect("error");
println!("{:?}", our_key.secret); |
<|file_name|>ps1a.py<|end_file_name|><|fim▁begin|><|fim▁hole|>f = 3<|fim▁end|> | d = 1
e = 2 |
<|file_name|>collection.d.ts<|end_file_name|><|fim▁begin|>export declare var Map: MapConstructor;
export declare var Set: SetConstructor;
export declare class MapWrapper {
static clone<K, V>(m: Map<K, V>): Map<K, V>;
static createFromStringMap<T>(stringMap: {
[key: string]: T;
}): Map<string, T>;
... | |
<|file_name|>RenderingHintTest.java<|end_file_name|><|fim▁begin|>package uk.co.bluegecko.core.swing.table.rendering;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertNull;
import static org.junit.Assert.assertTrue;
import java.awt.C... |
@Test
|
<|file_name|>floats.rs<|end_file_name|><|fim▁begin|>/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
use crate::block::FormattingContextType;
use crate::flow::{Fl... | }
}
self.left = max( |
<|file_name|>prefs.js<|end_file_name|><|fim▁begin|>pref('devcache.debug', false);
<|fim▁hole|><|fim▁end|> | pref('devcache.enabled', true);
pref('devcache.patterns', ''); |
<|file_name|>page-not-found.component.ts<|end_file_name|><|fim▁begin|>import { Component } from '@angular/core';
import { I18n } from '../i18n/i18n';
@Component({<|fim▁hole|> </div>
`
})
export class PageNotFoundComponent {
i18n = I18n;
}<|fim▁end|> | template: `
<div>
<h1>{{i18n.t.pageNotFound.title}}</h1>
<p>{{i18n.t.pageNotFound.description}}</p> |
<|file_name|>build.rs<|end_file_name|><|fim▁begin|>extern crate gcc;
use std::env;
fn main() {
let mut cfg = gcc::Config::new();
if env::var("TARGET").unwrap().contains("windows") {
cfg.define("_WIN32", None);
cfg.define("BZ_EXPORT", None);
}
cfg.include("bzip2-1.0.6")
.define... | .compile("libbz2.a");
} |
<|file_name|>ICrudAction.ts<|end_file_name|><|fim▁begin|>export interface ICrudAction {<|fim▁hole|> value: string;
}<|fim▁end|> | CANCEL: string;
FAIL: string;
FINISH: string;
REQUEST: string; |
<|file_name|>bitcoin_lv_LV.ts<|end_file_name|><|fim▁begin|><?xml version="1.0" ?><!DOCTYPE TS><TS language="lv_LV" version="2.1">
<context>
<name>AboutDialog</name>
<message>
<location filename="../forms/aboutdialog.ui" line="+14"/>
<source>About Loco</source>
<translation type="unfinish... | <source>&Save As...</source>
<translation type="unfinished"/>
</message> |
<|file_name|>mouseevent.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::MouseEventBinding;
u... | self.shift_key.set(shiftKeyArg);
self.meta_key.set(metaKeyArg);
self.button.set(buttonArg); |
<|file_name|>300 - Maya Calendar.cpp<|end_file_name|><|fim▁begin|>#include <stdio.h>
#include <string.h>
char haab[19][10] = { "pop", "no", "zip", "zotz", "tzec", "xul", "yoxkin", "mol", "chen", "yax", "zac", "ceh", "mac", "kankin", "muan", "pax", "koyab", "cumhu", "uayet" };
char tzolkin[20][10] = { "imix", "ik", "akb... | sum = y*365 + m*20 + d;
printf("%d %s %d\n", sum%260%13+1, tzolkin[sum%260%20], sum/260);
} |
<|file_name|>vec.rs<|end_file_name|><|fim▁begin|>// Copyright 2017 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution and at
// http://rust-lang.org/COPYRIGHT.
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/licenses/LI... | do_bench_clone_from(b, 10, 100, 1000)
}
|
<|file_name|>post-migration.py<|end_file_name|><|fim▁begin|>##############################################################################
#
# Copyright (C) 2020 Compassion CH (http://www.compassion.ch)
# @author: Théo Nikles <theo.nikles@gmail.com>
#
# The licence is in the file __manifest__.py
#
############... | SET app_messages = (
SELECT id FROM mobile_app_messages
WHERE partner_id = p.id
); |
<|file_name|>pack.py<|end_file_name|><|fim▁begin|>"""
This is used to pack testlib into a json
Then you can load into database by using:
manage.py loaddata <fixturename>
fixturename here is `testlib.json`
"""
import hashlib
import json
from os import path, listdir
def hash(binary):
return hashlib.sha256(bi... | |
<|file_name|>urls.py<|end_file_name|><|fim▁begin|>import re
from django.conf.urls import url, patterns, include
from django.conf import settings
from django.contrib import admin
from django.views.generic import TemplateView
from django.template import add_to_builtins
from fabrydb.admin import fadmin<|fim▁hole|>
urlpatt... |
add_to_builtins('avocado.templatetags.avocado_tags')
admin.autodiscover() |
<|file_name|>lib.rs<|end_file_name|><|fim▁begin|>/*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This software may be used and distributed according to the terms of the<|fim▁hole|>
///! Async job scheduling utilities for a blocking application
///!
///! We have a blocking application. We have async librari... | * GNU General Public License version 2.
*/ |
<|file_name|>ng_math_under_over_layout_algorithm.cc<|end_file_name|><|fim▁begin|>// Copyright 2020 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 "third_party/blink/renderer/core/layout/ng/mathml/ng_math_under_... | const auto child_constraint_space = CreateConstraintSpaceForMathChild( |
<|file_name|>transfer_test.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
"""Test the file transfer mechanism."""
import hashlib
import io
import itertools
import os
import platform
import struct
import unittest
from unittest import mock
from absl import app
from grr_response_core.lib import constants
from gr... | "ReceiveFetchedFileHash") as dummy_fetched_hash:
with mock.patch.object(DummyMultiGetFileLogicHash, |
<|file_name|>scrollspy.js<|end_file_name|><|fim▁begin|>import {
addClass,
removeClass,
EVENTS,
on,
off,
getViewportSize,
getClosest,
getParents
} from '../../utils/domUtils'
import {nodeListToArray} from '../../utils/arrayUtils'
function ScrollSpy (element, target = 'body', options = {}) {
this.el = ... | addClass(getClosest(ele, 'li.dropdown'), 'active') |
<|file_name|>build.rs<|end_file_name|><|fim▁begin|>extern crate bindgen;
use std::fs::{File, create_dir_all, metadata};
use std::path::Path;
use std::io::{ErrorKind, Write};
const HEADERS : &'static [&'static str] = &["ssl", "entropy", "ctr_drbg"];
const HEADER_BASE : &'static str = "/usr/local/include/mbedtls/";
... | create_dir_all(&dir).unwrap();
|
<|file_name|>issue-50706.rs<|end_file_name|><|fim▁begin|>// Copyright 2018 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/lic... |
impl Stat {
pub fn from_index(variant: StatVariant, index: usize) -> Option<Stat> { |
<|file_name|>FlowChartScreenController.java<|end_file_name|><|fim▁begin|>package com.virtualfactory.screen.layer.components;
import de.lessvoid.nifty.Nifty;
import de.lessvoid.nifty.NiftyEventSubscriber;
import de.lessvoid.nifty.controls.ButtonClickedEvent;
import de.lessvoid.nifty.controls.Controller;
import de.lessv... | screen.findElementByName("imageFlowOfActivities").getRenderer(ImageRenderer.class).setImage(flowChartImage);
}
} |
<|file_name|>cli-help.js<|end_file_name|><|fim▁begin|>/*
* This file is part of the xPack distribution
* (http://xpack.github.io).
* Copyright (c) 2017 Liviu Ionescu.
*
* Permission is hereby granted, free of charge, to any person
* obtaining a copy of this software and associated documentation
* files (the "S... | outputOptions (optionDefs, title, more = this.more) {
const log = this.context.log
let hasContent = false |
<|file_name|>test_core.py<|end_file_name|><|fim▁begin|>import unittest
from pyrogi import Screen, Backend
from pyrogi.util import Vec2
class TestScreen(Screen):
pass
class TestBackend(unittest.TestCase):
def test_screens(self):
backend = Backend(Vec2(0, 0), Vec2(0, 0), '')
self.assertEqual(len... | backend.set_screen(TestScreen())
self.assertEqual(len(backend.screens), 2) |
<|file_name|>bluetooth_adapter.cc<|end_file_name|><|fim▁begin|>// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "chrome/browser/chromeos/bluetooth/bluetooth_adapter.h"
#include "base/bind.h... | // inform observers about paired devices whether or not they're supported.
if (update_device && (device->IsSupported() || was_paired)) {
FOR_EACH_OBSERVER(BluetoothAdapter::Observer, observers_, |
<|file_name|>wallpaper_private_api.cc<|end_file_name|><|fim▁begin|>// Copyright (c) 2013 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/chromeos/extensions/wallpaper_private_api.h"
#include <ma... | std::string file_name = GURL(params->url_or_file).ExtractFileName();
CHECK(PathService::Get(chrome::DIR_CHROMEOS_WALLPAPER_THUMBNAILS, |
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|><|fim▁hole|><|fim▁end|> | #!/usr/bin/env python
from TweetGrabber import * |
<|file_name|>server.py<|end_file_name|><|fim▁begin|>import msgpackrpc
import time
class SumServer(object):
def sum(self, x, y):
return x + y
def sleepy_sum(self, x, y):
time.sleep(1)
return x + y
server = msgpackrpc.Server(SumServer())
server.listen(msgpackrpc.Address("localhost", 18800... | server.start() |
<|file_name|>brd-restructure.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
import argparse
import pprint
import proteindf_bridge as bridge
import logging
import logging.config
def get_rest_of_frame_molecule(frame_molecule, selected_molecule):
# calc the rest
select... | |
<|file_name|>test_topi_qnn.py<|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 under the A... | s = tvm.nd.array(s_np, dev)
z = tvm.nd.array(z_np, dev) |
<|file_name|>analisi.py<|end_file_name|><|fim▁begin|>import numpy
import math
import pylab
from scipy.optimize import curve_fit
import math
import scipy.stats
import lab
def fit_function(x, a, b):
return b*(numpy.exp(x/a)-1)
FileName='/home/federico/Documenti/Laboratorio2/Diodo/dati_arduino/dati.txt'
N1, N2 = pylab... | popt, pcov = curve_fit(fit_function, V2, I, initial, error)
a, b = popt
print(a, b)
print(pcov) |
<|file_name|>impact_function.py<|end_file_name|><|fim▁begin|># coding=utf-8
"""
InaSAFE Disaster risk assessment tool by AusAid - **Generic Impact Function
on Population for Continuous Hazard.**
Contact : ole.moller.nielsen@gmail.com
.. note:: This program is free software; you can redistribute it and/or modify
... | |
<|file_name|>map.rs<|end_file_name|><|fim▁begin|>use std::cmp;
use rand::{self, Rng};
use tcod::bsp::{Bsp, TraverseOrder};
use consts;
use object::{self, actor, Object, ObjectClass};
use object::load::ObjectRandomizer;
use object::item::Function;
use ai::Ai;
pub const MAP_WIDTH: i32 = 80;
pub const MAP_HEIGHT: i32 ... | |
<|file_name|>index.d.ts<|end_file_name|><|fim▁begin|><|fim▁hole|><|fim▁end|> | declare module 'hsv2rgb'; |
<|file_name|>my_box.hpp<|end_file_name|><|fim▁begin|>#ifndef BOX_H
#define BOX_H
class MyBox: public Gtk::Frame
{
public:
MyBox(const Glib::ustring& label, Gtk::Orientation orientation);
void pack_start(Widget& child);<|fim▁hole|> private:
Gtk::Box* p_child;
};
#endif<|fim▁end|> | |
<|file_name|>003.rs<|end_file_name|><|fim▁begin|>#![feature(slicing_syntax)]
extern crate test;
extern crate time;
use std::io::stdio;
use std::iter;
use std::os;
fn solution() -> u64 {
let mut n = 600_851_475_143;
for factor in iter::count(3, 2) {
while n % factor == 0 {
n /= factor;
... | } else if n == 1 {
return factor;
}
} |
<|file_name|>file.js<|end_file_name|><|fim▁begin|>// Editor.js
(function() {
var STORAGE_KEY = slingUserId+'-browser-file';
var editor = ace.edit("editor");
var saveBtn = $('#saveBtn');
// parent file should set the aceMode variable
editor.getSession().setMode(aceMode);
editor.getSession().setUseWrapMode(false);
... | editor.setTheme("ace/theme/"+theme);
setLocalStorage(STORAGE_KEY, {theme:theme});
})
saveBtn.on('click', function(e) { |
<|file_name|>sale.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
from ast import literal_eval
from odoo import models, fields, api
class SaleOrderLine(models.Model):
_inherit = 'sale.order.line'
config_ok = fields.Boolean(
related='product_id.config_ok',
string="Configurable",<|fim... | readonly=True
) |
<|file_name|>IocpManager.cpp<|end_file_name|><|fim▁begin|>#include "stdafx.h"
#include "Exception.h"
#include "ThreadLocal.h"
#include "Log.h"
#include "IocpManager.h"
#include "EduServer_IOCP.h"
#include "ClientSession.h"
#include "IOThread.h"
#include "ClientSessionManager.h"
#include "DBContext.h"
IocpManager* GIo... | {
/// create I/O Thread
for (int i = 0; i < MAX_IO_THREAD; ++i)
{ |
<|file_name|>main.go<|end_file_name|><|fim▁begin|>package main
import (
"flag"
"os"
"runtime"
"github.com/cpalone/maimai"
"github.com/Sirupsen/logrus"
)
var roomName string
var nick string
var logPath string
var dbPath string
var password string
var join bool
var msgLog bool
var logger = logrus.New()
func ini... | if err != nil {
panic(err) |
<|file_name|>oauth_provider.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
from odoo import models, fields, api
from datetime import datetime, timedelta
from odoo.tools import DEFAULT_SERVER_DATETIME_FORMAT
try:
from oauthlib import common as oauthlib_common
except:
pass
import uuid
class OauthAppl... | scope = fields.Char('Scope') |
<|file_name|>JSLValidationEventHandler.java<|end_file_name|><|fim▁begin|>/*
* Copyright 2012 International Business Machines Corp.
*
* See the NOTICE file distributed with this work for additional information
* regarding copyright ownership. Licensed under the Apache License,
* Version 2.0 (the "License"); ... | } |
<|file_name|>raxml.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python
""" wrapper to make simple calls to raxml """
import os
import sys
import glob
import subprocess
from ipyrad.analysis.utils import Params
from ipyrad.assemble.utils import IPyradError
# alias
OPJ = os.path.join
class Raxml(object):
"""
R... | |
<|file_name|>FormatTextdirectionLToRRounded.js<|end_file_name|><|fim▁begin|>"use strict";
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
Object.defineProperty(exports, "__esModule", {<|fim▁hole|>
var _createSvgIcon = _interopRequireDefault(require("./utils/createSvgIcon"));
var... | value: true
});
exports.default = void 0; |
<|file_name|>sha512.js<|end_file_name|><|fim▁begin|>version https://git-lfs.github.com/spec/v1<|fim▁hole|><|fim▁end|> | oid sha256:4a4e80129485fe848fa53149568184f09fa2da8648b6476b750ef97344bd4c5b
size 10959 |
<|file_name|>TransportMasterNodeActionTests.java<|end_file_name|><|fim▁begin|>/*
* Licensed to Elasticsearch under one or more contributor
* license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright
* ownership. Elasticsearch licenses this file to you under
... | |
<|file_name|>snippets_test.py<|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 under the Ap... | old_file_name = self._tmp_dir + os.sep + old_name |
<|file_name|>edraak_devstack.py<|end_file_name|><|fim▁begin|><|fim▁hole|># reflected in `cms/envs/edraak_devstack.py`<|fim▁end|> | from .devstack import *
from .edraak_common import *
# WARNING: Don't just add/delete settings from here. Make sure the settings are |
<|file_name|>ipython_config.py<|end_file_name|><|fim▁begin|># Configuration file for ipython.
#------------------------------------------------------------------------------
# InteractiveShellApp(Configurable) configuration
#------------------------------------------------------------------------------
## A Mixin for... | #c.TerminalInteractiveShell.term_title_format = 'IPython: {cwd}'
|
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|>#! /usr/bin/python
# Module:
# Author: Maxim Borisyak, 2014
import functools<|fim▁hole|>
partial = functools.partial
from pattern import MatchError
from pattern import case
from pattern import to_pattern
# Type patterns
from pattern import a_class
from pattern i... | |
<|file_name|>YOGClientGameListManager.cpp<|end_file_name|><|fim▁begin|>/*
Copyright (C) 2008 Bradley Arsenault
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,... | YOGGameInfo YOGClientGameListManager::getGameInfo(Uint16 gameID)
{ |
<|file_name|>box-reflection.tsx<|end_file_name|><|fim▁begin|>import React from 'react';
import * as pc from '../../../../';
import { AssetLoader } from '../../app/helpers/loader';
// @ts-ignore: library file import
import Panel from '@playcanvas/pcui/Panel/component';
// @ts-ignore: library file import
import SliderIn... | probe.enabled = false;
} |
<|file_name|>subscription.py<|end_file_name|><|fim▁begin|>__author__ = "UShareSoft"
from texttable import Texttable
from ussclicore.argumentParser import ArgumentParser, ArgumentParserError
from ussclicore.cmd import Cmd, CoreGlobal
from uforgecli.utils import org_utils
from ussclicore.utils import printer
from usscli... | |
<|file_name|>0012_auto__add_unique_company_slug.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):
# Adding unique constraint on 'Compa... | 'companies': ('django.db.models.fields.related.ManyToManyField', [], {'symmetrical': 'False', 'to': u"orm['ecg_balancing.Company']", 'null': 'True', 'blank': 'True'}), |
<|file_name|>Toolbar.js<|end_file_name|><|fim▁begin|>export class Toolbar {<|fim▁hole|><|fim▁end|> |
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.