prompt large_stringlengths 70 991k | completion large_stringlengths 0 1.02k |
|---|---|
<|file_name|>models.py<|end_file_name|><|fim▁begin|># -*- coding: UTF-8 -*-
# Copyright 2011-2018 Rumma & Ko Ltd
# License: BSD (see file COPYING for details)
from __future__ import unicode_literals
from builtins import str
import six
import datetime
from django.db import models
from django.db.models import Q
from ... | # REMINDER = 5
if reminder_text: |
<|file_name|>104.Maximum Depth of Binary Tree.java<|end_file_name|><|fim▁begin|>public class Solution {
public int maxDepth(TreeNode root) {
if (root == null) {
return 0;
} else {<|fim▁hole|>}<|fim▁end|> | return 1 + Math.max(maxDepth(root.left), maxDepth(root.right));
}
} |
<|file_name|>LISTIMP.H<|end_file_name|><|fim▁begin|>/*------------------------------------------------------------------------*/
/* */
/* LISTIMP.H */
/* ... | |
<|file_name|>__oldthermostat.py<|end_file_name|><|fim▁begin|>from hubs.ha import haremote as ha
from hubs.ha.hasshub import HAnode, RegisterDomain
from controlevents import CEvent, PostEvent, ConsoleEvent, PostIfInterested
from utils import timers
import functools
# noinspection PyTypeChecker
class Thermostat(HAnode)... | self.modelist = self.attributes['operation_list']
except:
pass |
<|file_name|>update_sentry_404s.py<|end_file_name|><|fim▁begin|><|fim▁hole|>from ...utils import update_sentry_404s
class Command(BaseCommand):
def handle(self, *args, **kwargs):
update_sentry_404s()<|fim▁end|> | from __future__ import unicode_literals
from django.core.management.base import BaseCommand
|
<|file_name|>equil_run.py<|end_file_name|><|fim▁begin|>from __future__ import division
import numpy as np
import matplotlib.pyplot as plt
import sys
#
# use pretty plotting if it can be imported
#
try:
import seaborn
except:
pass
sigma=5.67e-8
def find_tau(tot_trans,num_layers):
"""
# -TD- document us... | # -TD- describe what this loop does |
<|file_name|>const-tuple-struct.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.... | // run-pass
struct Bar(isize, isize);
|
<|file_name|>histogram_example.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python2
# -*- coding: utf-8 -*-
"""
Created on Tue Jul 11 20:47:53 2017
@author: fernando
"""
import pandas as pd
import matplotlib
import matplotlib.pyplot as plt
<|fim▁hole|>plt.style.use('ggplot')
df = pd.read_csv("/home/fernando/Course... | |
<|file_name|>infinite_emnist_test.py<|end_file_name|><|fim▁begin|># Copyright 2021, 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/licenses/LICENSE... | |
<|file_name|>api.go<|end_file_name|><|fim▁begin|>// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT.
package ivs
import (
"fmt"
"time"
"github.com/aws/aws-sdk-go/aws"
"github.com/aws/aws-sdk-go/aws/awsutil"
"github.com/aws/aws-sdk-go/aws/request"
"github.com/aws/aws-sdk-go/private/protocol"
"... | req, out := c.TagResourceRequest(input)
req.SetContext(ctx) |
<|file_name|>device_pyusb.py<|end_file_name|><|fim▁begin|># pywws - Python software for USB Wireless Weather Stations
# http://github.com/jim-easterbrook/pywws
# Copyright (C) 2008-15 Jim Easterbrook jim@jim-easterbrook.me.uk
# This program is free software; you can redistribute it and/or
# modify it under the terms... | |
<|file_name|>CustomTypeTest.java<|end_file_name|><|fim▁begin|>package org.codehaus.xfire.aegis.example;
import javax.xml.namespace.QName;
import org.codehaus.xfire.aegis.AbstractXFireAegisTest;
import org.codehaus.xfire.aegis.AegisBindingProvider;
import org.codehaus.xfire.aegis.type.TypeMapping;
import org.codehaus.... | "//xsd:element[@name='getSubmitBean']/xsd:complexType/xsd:sequence/xsd:element[@name='bean'][@type='ns1:SimpleBean']",
doc);
|
<|file_name|>stable_core.py<|end_file_name|><|fim▁begin|>import jarray
g = gs.open(gs.args[0])
istates = gs.associated(g, "initialState", True).getInitialStates()
ssrv = gs.service("stable")
def copy_path(values, coreNodes):<|fim▁hole|> for idx in coreNodes:
path[i] = values[idx]
i += 1
re... | n = len(coreNodes)
path = jarray.zeros(n, 'b')
i = 0 |
<|file_name|>identity.rs<|end_file_name|><|fim▁begin|>use std::ops::Mul;
use num::One;
use structs::mat;
use traits::operations::{Inv, Transpose};
use traits::geometry::{Translate, Rotate, Transform, AbsoluteRotate};
impl One for mat::Identity {
#[inline]
fn one() -> mat::Identity {
mat::Identity::new(... | fn transform(&self, v: &V) -> V {
v.clone() |
<|file_name|>test_cheat_sheet_plus.py<|end_file_name|><|fim▁begin|>"""The macros below aren't reliable (e.g., some fail if ``arg_string`` is `None`)
<|fim▁hole|>or safe (``include`` doesn't guard against circular reference). For a more complete example, see
`the code used in the sandbox <http://code.google.com/p/urlmi... | |
<|file_name|>ExitMenu.py<|end_file_name|><|fim▁begin|>import pygame
from pygame.locals import *
from Constants import Constants
from FadeTransition import FadeTransition
from Menu import Menu
from GW_Label import GW_Label
from GuiWidgetManager import GuiWidgetManager
from xml.sax import make_parser
from Localizatio... | self.widget_man.set_draw(True)
def on_exit(self):
pygame.event.clear() |
<|file_name|>test_string.py<|end_file_name|><|fim▁begin|>#-----------------------------------------------------------------------------
# Copyright (c) 2012 - 2019, Anaconda, Inc., and Bokeh Contributors.
# All rights reserved.
#
# The full license is in the file LICENSE.txt, distributed with this software.
#----------... | |
<|file_name|>framework_file_generator.py<|end_file_name|><|fim▁begin|>#! /usr/bin/python
# -*- coding: utf-8 -*-
# Developped with python 2.7.3
import os
import sys
import tools
import json
print("The frame :")
name = raw_input("-> name of the framework ?")
kmin = float(raw_input("-> Minimum boundary ?"))
kmax = floa... | i=kmin
distribution = {}
while i < kmax+precision: |
<|file_name|>missile.cpp<|end_file_name|><|fim▁begin|>#include "missile.h"
#include "../../ObjManager.h"
#include "../../autogen/sprites.h"
#include "../../caret.h"
#include "../../common/misc.h"
#include "../../game.h"
#include "../../player.h"
#include "../../sound/SoundManager.h"
#include "../../trig.h"
#include "w... | o->state = STATE_MISSILE_CAN_EXPLODE;
break;
case UP:
if (o->y <= o->ymark2 - (2 * CSFI)) |
<|file_name|>ActionDelete.java<|end_file_name|><|fim▁begin|>/**
* Copyright 2017-2019 The GreyCat Authors. All rights reserved.
* <p>
* 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
* <p... | |
<|file_name|>usersubscription.go<|end_file_name|><|fim▁begin|>package apimanagement
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
//
// Code generated by Microsoft (R) AutoRest Code Generator.
// Changes may ... | func (client UserSubscriptionClient) ListSender(req *http.Request) (*http.Response, error) {
return client.Send(req, azure.DoRetryWithRegistration(client.Client)) |
<|file_name|>DefaultChannelFuture.java<|end_file_name|><|fim▁begin|>/*
* Copyright (C) 2008 Trustin Heuiseung Lee
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version... | }
if (notifyNow) {
notifyListener(listener); |
<|file_name|>test_port.py<|end_file_name|><|fim▁begin|># -*- coding:utf-8 -*-
# Copyright 2015 NEC Corporation. #
# #
# Licensed under the Apache License, Version 2.0 (the "License"); #
# you may ... | |
<|file_name|>DynamicEntity.go<|end_file_name|><|fim▁begin|>package Server
import (
"reflect"
"strings"
"code.myceliUs.com/Utility"
)
/**
* Implementation of the Entity. Dynamic entity use a map[string]interface {}
* to store object informations. All information in the Entity itself other
* than object are stor... | |
<|file_name|>profiler.py<|end_file_name|><|fim▁begin|># This file is part of KTBS <http://liris.cnrs.fr/sbt-dev/ktbs>
# Copyright (C) 2011-2012 Pierre-Antoine Champin <pchampin@liris.cnrs.fr> /
# Universite de Lyon <http://www.universite-lyon.fr>
#
# KTBS is free software: you can redistribute it and/or mod... |
To enable the profiler, simply add 'profiler' as a URL parameter. |
<|file_name|>conf.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
#
# Modoboa documentation build configuration file, created by
# sphinx-quickstart on Mon Jan 3 22:29:25 2011.
#
# This file is execfile()d with the current directory set to its containing dir.
#
# Note that not all possible configuration values... | |
<|file_name|>task-detail.component.ts<|end_file_name|><|fim▁begin|>/**
* Created by Quentin on 9/15/2016.
*/
import { Component, Input } from '@angular/core';<|fim▁hole|>@Component({
selector: 'task-detail',
templateUrl: './app/components/task-detail/task-detail.component.html',
styleUrls: ['./app/compo... | |
<|file_name|>Hello-world.js<|end_file_name|><|fim▁begin|>function helloWorld() {<|fim▁hole|><|fim▁end|> | return 'Hello World';
} |
<|file_name|>0003_auto_20161108_1710.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
# Generated by Django 1.10.2 on 2016-11-08 20:10
from __future__ import unicode_literals
from django.db import migrations, models<|fim▁hole|>
class Migration(migrations.Migration):
dependencies = [
('persons', '0... | import django.db.models.deletion |
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
#
# This file is part of Invenio.
# Copyright (C) 2014, 2015 CERN.
#
# Invenio 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; eith... | # You should have received a copy of the GNU General Public License
# along with Invenio; if not, write to the Free Software Foundation, Inc., |
<|file_name|>ControlMessageEncodingUtils.java<|end_file_name|><|fim▁begin|>package com.qinyadan.monitor.network.util;
import java.util.Map;
import com.qinyadan.monitor.network.control.ControlMessageDecoder;
import com.qinyadan.monitor.network.control.ControlMessageEncoder;
import com.qinyadan.monitor.network.co... | private static final ControlMessageDecoder decoder = new ControlMessageDecoder();
|
<|file_name|>GwUtill.cpp<|end_file_name|><|fim▁begin|>/*
* Copyright (C) 2013 Nivis LLC.
* Email: opensource@nivis.com
* Website: http://www.nivis.com
*
* This program is free software: you can redistribute it and/or modify<|fim▁hole|>* the Free Software Foundation, version 3 of the License.
*
* Redistribution and u... | * it under the terms of the GNU General Public License as published by |
<|file_name|>main.py<|end_file_name|><|fim▁begin|># Copyright 2021 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/licenses/LICENSE-2.0
#
# Unless re... | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
|
<|file_name|>series_rolling_median.py<|end_file_name|><|fim▁begin|># *****************************************************************************
# Copyright (c) 2020, Intel Corporation All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided th... | #
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR |
<|file_name|>site_sections_test.go<|end_file_name|><|fim▁begin|>// Copyright 2019 The Hugo Authors. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
// http://www.apac... | |
<|file_name|>exact_length.py<|end_file_name|><|fim▁begin|>from .validator import Validator
from ..util import register_as_validator
class ExactLength(Validator):<|fim▁hole|> def __init__(self, exact_length):
super(ExactLength, self).__init__()
self.exact_length = exact_length
def validate(self... | __validator_name__ = 'exact_length'
|
<|file_name|>messages.js<|end_file_name|><|fim▁begin|>var Message = require('../models/message');
exports.create = function(req, res) {
new Message({
senderID: req.body.senderID,
senderAlias: req.body.senderAlias,
acceptorID: req.body.acceptorID,
acceptorAlias: req.body.acceptorAlias,
subject: re... | }
if(saveFlag){
doc.save(function(err, doc){ |
<|file_name|>ptref_tests.py<|end_file_name|><|fim▁begin|># encoding: utf-8
# Copyright (c) 2001-2014, Canal TP and/or its affiliates. All rights reserved.
#
# This file is part of Navitia,
# the software to build cool stuff with public transport.
#
# Hope you'll enjoy and contribute to this project,
# powered b... | assert e['message'] == 'ptref : Filters: Unable to find object'
|
<|file_name|>detail-quick.js<|end_file_name|><|fim▁begin|>/************************************************************************<|fim▁hole|> * This file is part of EspoCRM.
*
* EspoCRM - Open Source CRM application.
* Copyright (C) 2014-2015 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko
* Website: http://ww... | |
<|file_name|>test.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python2
# -*- coding: UTF-8 -*-
import argparse
import os
import re
import subprocess
import sys
import traceback
import json
def main():
parser = argparse.ArgumentParser(description='Test discovery for Zabbix',
formatter_class=argparse.Argu... | exit(1)
exit(0) |
<|file_name|>SequentialTaskMaster.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 Yo... | |
<|file_name|>suggestions.rs<|end_file_name|><|fim▁begin|>#[cfg(feature = "suggestions")]
use strsim;
/// Produces a string from a given list of possible values which is similar to
/// the passed in value `v` with a certain confidence.
/// Thus in a list of possible values like ["foo", "bar"], the value "fop" will yiel... | where T: AsRef<str> + 'a,
I: IntoIterator<Item = &'a T>
{ |
<|file_name|>0002_auto_20170502_0952.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
# Generated by Django 1.11 on 2017-05-02 09:52
from __future__ import unicode_literals
import django.db.models.deletion
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
... | field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='marketplace.Language'), |
<|file_name|>TRandom.java<|end_file_name|><|fim▁begin|>/*
* Copyright 2014 Alexey Andreev.
*
* Licensed under the Apache License, Version 2.0 (the "License");<|fim▁hole|> * You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or ag... | * you may not use this file except in compliance with the License. |
<|file_name|>login_utils.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/login/login_utils.h"
#include <algorithm>
#include <set>
#... | |
<|file_name|>othello.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
"""
othello.py Humberto Henrique Campos Pinheiro
Game initialization and main loop
"""
import pygame
import ui
import player
import board
from config import BLACK, WHITE, HUMAN
import log
logger = log.setup_custom_logger('root')
# py2exe wor... | """
|
<|file_name|>noise_stats.py<|end_file_name|><|fim▁begin|>from paths import rpath,mpath,opath
from make_apex_cubes import all_apexfiles,get_source_tel_line,_is_sci, hdr_to_freq
from pyspeckit.spectrum.readers import read_class
from astropy.table import Table
from astropy import log
from astropy.utils.console import Prog... | log.info(os.path.basename(apex_filename)+"_tsys.fits") |
<|file_name|>views.py<|end_file_name|><|fim▁begin|>from django.http import HttpResponse
from django.shortcuts import render
def index(request):
return HttpResponse('Page content')<|fim▁hole|><|fim▁end|> |
def custom(request):
return render(request, 'custom.html', {}) |
<|file_name|>artmac.cpp<|end_file_name|><|fim▁begin|>/////////////////////////////////////////////////////////////////////////////
// Name: src/osx/artmac.cpp
// Purpose: wxArtProvider instance with native Mac stock icons
// Author: Alan Shouls
// Created: 2006-10-30
// Copyright: (c) wxWindows te... | |
<|file_name|>test_form.py<|end_file_name|><|fim▁begin|>import zeit.newsletter.testing
<|fim▁hole|> def test_form_should_save_entered_data_on_blur(self):
s = self.selenium
self.open('/repository/newsletter/@@checkout')
s.waitForElementPresent('id=metadata.subject')
s.assertValue('id=m... | class MetadataTest(zeit.newsletter.testing.SeleniumTestCase):
|
<|file_name|>machinelearning.rs<|end_file_name|><|fim▁begin|>#![cfg(feature = "machinelearning")]
extern crate rusoto_core;
extern crate rusoto_machinelearning;<|fim▁hole|>use rusoto_machinelearning::{
DescribeBatchPredictionsInput, DescribeDataSourcesInput, DescribeEvaluationsInput,
MachineLearning, MachineLe... |
use rusoto_core::Region; |
<|file_name|>parts_descriptor_test.py<|end_file_name|><|fim▁begin|>import amitgroup as ag<|fim▁hole|># This requires you to have the MNIST data set.
data, digits = ag.io.load_mnist('training', selection=slice(0, 100))
pd = ag.features.PartsDescriptor((5, 5), 20, patch_frame=1, edges_threshold=5, samples_per_image=10)
... | import numpy as np
ag.set_verbose(True)
|
<|file_name|>desc.rs<|end_file_name|><|fim▁begin|>/// Used in `SQLColAttributeW`.
#[repr(u16)]
#[derive(Debug, PartialEq, Eq, Clone, Copy)]
pub enum Desc {
/// `SQL_DESC_COUNT`. Returned in `NumericAttributePtr`. The number of columns available in the
/// result set. This returns 0 if there are no columns in th... | IndicatorPtr = 1009,
/// `SQL_DESC_DATA_PTR`.
DataPtr = 1010,
/// `SQL_DESC_NAME`. Returned in `CharacterAttributePtr`. The column alias, if it applies. If |
<|file_name|>metadata.py<|end_file_name|><|fim▁begin|>"""Node metadata operations"""
import json
import logging
import http.client<|fim▁hole|>
logger = logging.getLogger(__name__)
ChangeSet = namedtuple('Changes', ['nodes', 'purged_nodes', 'checkpoint', 'reset'])
class MetadataMixin(object):
def get_node_list(s... | from collections import namedtuple
from .common import * |
<|file_name|>test-playground.component.ts<|end_file_name|><|fim▁begin|>import {Component, OnInit, ViewChild} from '@angular/core';
import {Api} from "@catflow/Api";
import {PublishSubject} from "@frontend/util/PublishSubject";
@Component({
selector: 'app-test-playground',
templateUrl: './test-playground.component.... | s.next(30);
} |
<|file_name|>gmail.py<|end_file_name|><|fim▁begin|>import os
import string
#Enter your username and password below within double quotes
# eg. username="username" and password="password"
username="username"
password="password"
com="wget -O - https://"+username+":"+password+"@mail.google.com/mail/feed/atom --no-check-c... | else:
print str(fc)+" new" |
<|file_name|>novo_sort.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
from __future__ import print_function
import argparse
from subprocess import check_call, CalledProcessError
import shlex
import sys
import logging
log = logging.getLogger( __name__ )
<|fim▁hole|>def novo_sort( bam_filename, output_filename ):... | |
<|file_name|>blockstore_field_data.py<|end_file_name|><|fim▁begin|>"""
Key-value store that holds XBlock field data read out of Blockstore
"""
from collections import namedtuple
from weakref import WeakKeyDictionary
import logging
from xblock.exceptions import InvalidScopeError, NoSuchDefinition
from xblock.fields im... | def delete(self, block, name):
"""
Reset the value of the field named `name` to the default
""" |
<|file_name|>hidsdi.rs<|end_file_name|><|fim▁begin|>// Copyright © 2015, Alex Daniel Jones
// Licensed under the MIT License <LICENSE.md>
// Taken from hidsdi.h
#[repr(C)] #[derive(Clone, Copy, Debug)]<|fim▁hole|> pub Size: ::ULONG,
pub VendorID: ::USHORT,
pub ProductID: ::USHORT,
pub VersionNumber: ::USHORT,
}... | pub struct HIDD_ATTRIBUTES { |
<|file_name|>type-alias-impl-trait-with-cycle-error2.rs<|end_file_name|><|fim▁begin|>#![feature(type_alias_impl_trait)]
pub trait Bar<T> {
type Item;
}
type Foo = impl Bar<Foo, Item = Foo>;
//~^ ERROR: could not find defining uses
fn crash(x: Foo) -> Foo {<|fim▁hole|>fn main() {}<|fim▁end|> | x
}
|
<|file_name|>cube_shell.rs<|end_file_name|><|fim▁begin|>//! Functions and structures for interacting with cubic shells.
use range_abs::range_abs;
use std::cmp::{min, max};
use std::iter::range_inclusive;
use block_position::BlockPosition;
#[cfg(test)]
use std::collections::HashSet;
#[cfg(test)]
use cgmath::{Point, Ve... | range_inclusive(from.z - radius, min(from.z + radius, to.z - radius - 1))
} else {
range_inclusive(max(from.z - radius, to.z + radius + 1), from.z + radius) |
<|file_name|>validators.py<|end_file_name|><|fim▁begin|>PROJECT_DEFAULTS = 'Project Defaults'
PATHS = 'Paths'
_from_config = {
'author': None,
'email': None,
'license': None,
'language': None,
'type': None,
'parent': None,
'vcs': None,
'footprints': None
}
_from_args = {
'name': No... | # If footprint is provided, we only need name and parent |
<|file_name|>list_test.go<|end_file_name|><|fim▁begin|>// Copyright 2015 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/l... | |
<|file_name|>dupe-symbols-3.rs<|end_file_name|><|fim▁begin|>// build-fail<|fim▁hole|>//
#![crate_type="rlib"]
#![allow(warnings)]
#[export_name="fail"]
pub fn a() {
}
#[no_mangle]
pub fn fail() {
//~^ symbol `fail` is already defined
}<|fim▁end|> | |
<|file_name|>webpack.config.dev.js<|end_file_name|><|fim▁begin|>import webpack from 'webpack';
import path from 'path';
export default {
debug: true,
devtool: 'cheap-module-eval-source-map',
noInfo: false,
entry: [
// 'eventsource-polyfill', // necessary for hot reloading with IE
'webpack-hot-middlewar... | ]
}
}; |
<|file_name|>instantiation_validation_noisy_neighbors_benchmark.py<|end_file_name|><|fim▁begin|># Copyright (c) 2015 Intel Research and Development Ireland Ltd.
#
# 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 ... | common.DEPLOYMENT_UNIT.destroy_heat_template(stack_name)
self.neighbor_stack_names = list() |
<|file_name|>service.go<|end_file_name|><|fim▁begin|>//go:build linux
// +build linux
/*
Copyright The containerd 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:/... | |
<|file_name|>build.rs<|end_file_name|><|fim▁begin|>use std::env;
use std::fs::File;
use std::io::Write;
use std::path::PathBuf;
fn main() {
// Put the linker script somewhere the top crate can find it<|fim▁hole|> .write_all(include_bytes!("stm32f411ve.ld"))
.unwrap();
println!("cargo:rustc-link-... | let out = &PathBuf::from(env::var_os("OUT_DIR").unwrap());
File::create(out.join("stm32f411ve.ld"))
.unwrap() |
<|file_name|>script.js<|end_file_name|><|fim▁begin|>/*
* ##### Sasson - advanced drupal theming. #####
*
* SITENAME scripts.
*
*/
<|fim▁hole|>// Drupal.behaviors.behaviorName = {
// attach: function(context) {
// // Do some magic...
// }
// };
})(jQuery);<|fim▁end|> | (function($) {
// DUPLICATE AND UNCOMMENT |
<|file_name|>taskrun.go<|end_file_name|><|fim▁begin|>package taskrun
import (
"errors"
"fmt"
"sync"
"github.com/taskcluster/taskcluster-worker/engines"
"github.com/taskcluster/taskcluster-worker/plugins"
"github.com/taskcluster/taskcluster-worker/runtime"
"github.com/taskcluster/taskcluster-worker/runtime/atom... | |
<|file_name|>cacic_software.cpp<|end_file_name|><|fim▁begin|>#include "cacic_software.h"
cacic_software::cacic_software()
{
}
void cacic_software::iniciaColeta()
{
#ifdef Q_OS_WIN
this->coletaSoftware = coletaWin();
#elif defined(Q_OS_LINUX)
this->coletaSoftware = coletaLinux();
#endif
}
#if defined(Q_OS_WI... | |
<|file_name|>multicriteria_base_recommender.py<|end_file_name|><|fim▁begin|>from abc import ABCMeta
from recommenders.similarity.weights_similarity_matrix_builder import \
WeightsSimilarityMatrixBuilder
from tripadvisor.fourcity import extractor
from recommenders.base_recommender import BaseRecommender
from utils ... | similarity_matrix.pop(user_id, None)
ordered_similar_users = dictionary_utils.sort_dictionary_keys(
similarity_matrix)
|
<|file_name|>TeamServiceImpl.java<|end_file_name|><|fim▁begin|>package info.thecodinglive.service;
import info.thecodinglive.model.Team;
import info.thecodinglive.repository.TeamDao;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframewor... | @Override |
<|file_name|>core.cpp<|end_file_name|><|fim▁begin|>/*
*** MolShake Module - Core
*** src/modules/molshake/core.cpp
Copyright T. Youngs 2012-2018
This file is part of Dissolve.
Dissolve is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
t... | /* |
<|file_name|>account_move.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo.exceptions import ValidationError
from odoo import models, fields, api, _
from odoo.osv import expression
SII_VAT = '60805000-0'
class AccountMove(mod... | if country_id.code != "CL": |
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|>from .menu import menu_handlers<|fim▁hole|>from .toolbar import toolbar_handlers
handlers = {}
handlers.update(menu_handlers)
handlers.update(main_handlers)
handlers.update(toolbar_handlers)
__all__ = ['handlers']<|fim▁end|> | from .main import main_handlers |
<|file_name|>board.rs<|end_file_name|><|fim▁begin|>use std::collections::btree_set::BTreeSet;
use std::ops::BitAnd;
use ::{Position, Color, Grid, Axes, Directions, Alignment};
use ::{get_alignments, get_free_threes, get_captures};
use functions::captures_on_alignement::captures_on_axis;
use ::directions::*;
/// Number... | let mut board = Board {
grid: grid,
stones_black_takes: 8,
stones_white_takes: 0, |
<|file_name|>wsgi.py<|end_file_name|><|fim▁begin|>"""
WSGI config for uptee project.
This module contains the WSGI application used by Django's development server
and any production WSGI deployments. It should expose a module-level variable
named ``application``. Django's ``runserver`` and ``runfcgi`` commands discove... | |
<|file_name|>GitMaterialShallowCloneTest.java<|end_file_name|><|fim▁begin|>/*
* Copyright 2017 ThoughtWorks, 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.apa... | |
<|file_name|>jeryatri.js<|end_file_name|><|fim▁begin|><|fim▁hole|>showWord(["n. ","branch medikal ki espesyalize nan trete granmoun ki avanse nan laj.<br>"])<|fim▁end|> | |
<|file_name|>profile.py<|end_file_name|><|fim▁begin|># Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or... | |
<|file_name|>bernoulli.rs<|end_file_name|><|fim▁begin|>use distribution;
use random;
/// A Bernoulli distribution.
#[derive(Clone, Copy)]
pub struct Bernoulli {
p: f64,
q: f64,
pq: f64,
}
impl Bernoulli {
/// Create a Bernoulli distribution with success probability `p`.
///
/// It should hold ... | |
<|file_name|>EncryptDatav2.go<|end_file_name|><|fim▁begin|>// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
// SPDX-License-Identifier: Apache-2.0
// snippet-start:[kms.go-v2.EncryptData]
package main
import (
"context"
b64 "encoding/base64"
"flag"
"fmt"<|fim▁hole|> "github.com/aws/aws-sdk-go-... |
"github.com/aws/aws-sdk-go-v2/config" |
<|file_name|>renderers.py<|end_file_name|><|fim▁begin|>#
# Copyright (c) 2015 Red Hat
# Licensed under The MIT License (MIT)
# http://opensource.org/licenses/MIT
#
from collections import OrderedDict
import logging
import re
import sys
import json
from django.conf import settings
from django.utils.encoding import smar... | 'bulk_update',
# Token Auth methods |
<|file_name|>test_views.py<|end_file_name|><|fim▁begin|>from textwrap import dedent
from bedrock.mozorg.tests import TestCase
from bedrock.sitemaps.models import NO_LOCALE, SitemapURL
class TestSitemapView(TestCase):
def setUp(self):
data = [
{
'path': '/firefox/all/',
... | good_resp = dedent("""\
<?xml version="1.0" encoding="UTF-8"?> |
<|file_name|>sitemaps.py<|end_file_name|><|fim▁begin|>from django.contrib.sitemaps import Sitemap
from events.models import Event
class EventsSitemap(Sitemap):
changefreq = "never"
priority = 1.0
def items(self):
return Event.objects.public()<|fim▁hole|> def lastmod(self, obj):
return obj.date_modified<|fim▁... | |
<|file_name|>handler.go<|end_file_name|><|fim▁begin|>package synapse
import (
"fmt"
)
// Handler is the interface used
// to register server response callbacks.
type Handler interface {
// ServeCall handles a synapse request and<|fim▁hole|> // become invalid after the call is returned;
// no implementation of Ser... | // writes a response. It should be safe to
// call ServeCall from multiple goroutines.
// Both the request and response interfaces |
<|file_name|>all.ts<|end_file_name|><|fim▁begin|>import { times, flatten } from "lodash"
import { APIOptions } from "./loaders/api"
// TODO: Type this and refactor, because I think things just kinda work by luck,
// because a static and a dynamic path loader take different number of
// arguments.
export c... | ? loader(options.path, invocationParams, options.api)
: loader(invocationParams, options.api) |
<|file_name|>PrefixReferenceProvider.java<|end_file_name|><|fim▁begin|>/*
* Copyright 2007 Sascha Weinreuter
*
* 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.o... | final String s = ((SchemaPrefix) e).getName();
return s != null && s.equals(((SchemaPrefix) element).getName());
} |
<|file_name|>kcoingui.cpp<|end_file_name|><|fim▁begin|>// Copyright (c) 2011-2014 The Bitcoin Core developers
// Distributed under the MIT software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
#include "kcoingui.h"
#include "kcoinunits.h"
#include "clientmodel.h... | } |
<|file_name|>deref-non-pointer.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.<|fim▁hole|>// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.... | // |
<|file_name|>ee_test.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
"""Test for the ee.__init__ file."""
import six
import unittest
import ee
from ee import apitestcase
class EETestCase(apitestcase.ApiTestCase):
def setUp(self):
ee.Reset()
def testInitialization(self):
"""Verifies library in... | |
<|file_name|>test_views.py<|end_file_name|><|fim▁begin|>from .base import BasePageTests
from django.contrib.sites.models import Site
from django.contrib.redirects.models import Redirect
class PageViewTests(BasePageTests):
def test_page_view(self):
r = self.client.get('/one/')
self.assertEqual(r.c... | """
redirect = Redirect.objects.create(
old_path='/%s/' % self.p1.path, |
<|file_name|>config.service.ts<|end_file_name|><|fim▁begin|>// #docplaster
// #docregion , proto
import { Injectable } from '@angular/core';
import { HttpClient } from '@angular/common/http';
// #enddocregion proto
import { HttpErrorResponse, HttpResponse } from '@angular/common/http';
// #docregion rxjs-imports
impor... | |
<|file_name|>ConsulCatalogWatchTests.java<|end_file_name|><|fim▁begin|>/*
* Copyright 2013-2019 the original author or 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
*
* ... | public void catalogServicesWatch() {
// do nothing |
<|file_name|>hltapi_playground.py<|end_file_name|><|fim▁begin|>#!/router/bin/python
import outer_packages
#from trex_stl_lib.trex_stl_hltapi import CTRexHltApi, CStreamsPerPort
from trex_stl_lib.trex_stl_hltapi import *
import traceback
import sys, time
from pprint import pprint
import argparse
def error(err = None):... | check_res(hlt_client.traffic_config(mode = 'reset', port_handle = port_handle[0])) |
<|file_name|>bin.ts<|end_file_name|><|fim▁begin|>import log from 'electron-log'
import * as path from 'path'
import * as os from 'os'
const platform = os.platform()
const arch = os.arch()
export const basePath = path.resolve(
__dirname.replace('app.asar', 'app.asar.unpacked'),
'../../bin',
platform,
// arm64 ... | |
<|file_name|>graph_interface.hpp<|end_file_name|><|fim▁begin|>#ifndef GRAPH_INTERFACE_HPP
#define GRAPH_INTERFACE_HPP
#include "graphdsl.hpp"
#include <vector>
#include <utility>
#include <type_traits>
namespace netalgo
{
template<typename NodeType, typename EdgeType>
class GraphInterface
{<|fim▁hole|> private:
... | |
<|file_name|>cast.hpp<|end_file_name|><|fim▁begin|>// (c) Copyright Fernando Luis Cacciola Carballal 2000-2004
// Use, modification, and distribution is subject to the Boost Software
// License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
// See library ... | conv_traits,
typename cast_traits::overflow_policy,
typename cast_traits::rounding_policy,
abt_boost::numeric::raw_converter< conv_traits >, |
<|file_name|>parseInt.js<|end_file_name|><|fim▁begin|>import root from './_root.js';
import toString from './toString.js';
/* Built-in method references for those with the same name as other `lodash` methods. */
var nativeParseInt = root.parseInt;
/**
* Converts `string` to an integer of the specified radix. If `rad... | export default parseInt; |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.