prompt large_stringlengths 70 991k | completion large_stringlengths 0 1.02k |
|---|---|
<|file_name|>feature-gate-c-unwind.rs<|end_file_name|><|fim▁begin|>// Test that the "C-unwind" ABI is feature-gated, and cannot be used when the
// `c_unwind` feature gate is not used.
<|fim▁hole|>extern "C-unwind" fn f() {}
//~^ ERROR C-unwind ABI is experimental and subject to change [E0658]
fn main() {
f();
}<|... | |
<|file_name|>misc_crypto.rs<|end_file_name|><|fim▁begin|>// Copyright lowRISC contributors.
// Licensed under the Apache License, Version 2.0, see LICENSE for details.
// SPDX-License-Identifier: Apache-2.0
//! Miscellaneous cryptograhic test data that isn't worth maintaining custom
//! scripts for.
/// A plaintext s... | 0x04, 0xe7, 0x1b, 0x4f, 0x74, 0x35, 0xb0, 0xf5,
0x99, 0xe6, 0xc5, 0x9c, 0x01, 0x52, 0x40, 0x51,
]; |
<|file_name|>jabbersearch.ts<|end_file_name|><|fim▁begin|><?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE TS>
<TS version="2.0" language="pl" sourcelanguage="en">
<context>
<name>JabberSearch</name>
<message>
<source>Jabber Search</source>
<translation>Przeszukaj Jabber</translation>
</mess... | <source>Nickname</source>
<translation>Nick</translation>
</message>
<message> |
<|file_name|>5.cpp<|end_file_name|><|fim▁begin|>#include <iostream>
using namespace std;
int n;<|fim▁hole|>int eval(int i, int k, int *c, int *t);
int main() {
cin >> n;
int *c = new int[2 * n]; // saving each node childs in two index like 1:{6,5}, 2:{0,0}...6:{4,0}
fill_n(c, 2 * n, 0);
int q = 0;
for (int i ... | void print(int* s);
int* lastNode(int s, int *c); |
<|file_name|>AbstractConsistentSessionTest.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_name|>Ptobjects.py<|end_file_name|><|fim▁begin|># coding=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 by Ca... | def get(self, region=None, lon=None, lat=None):
self.region = i_manager.get_region(region, lon, lat) |
<|file_name|>pyunit_PUBDEV_8346_modelselection_result_frame.py<|end_file_name|><|fim▁begin|>from __future__ import print_function
from __future__ import division
import sys
sys.path.insert(1, "../../../")
import h2o
from tests import pyunit_utils
from h2o.estimators.model_selection import H2OModelSelectionEstimator as ... | my_y = "GLEASON" |
<|file_name|>UntilTokenImpl.java<|end_file_name|><|fim▁begin|>/**
*/
package org.eclipse.xtext.impl;<|fim▁hole|>
import org.eclipse.xtext.UntilToken;
import org.eclipse.xtext.XtextPackage;
/**
* <!-- begin-user-doc -->
* An implementation of the model object '<em><b>Until Token</b></em>'.
* <!-- end-user-doc -->
... |
import org.eclipse.emf.ecore.EClass; |
<|file_name|>test_base.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
import matplotlib
matplotlib.use('Agg')
import numpy as np # noqa
import pandas as pd # noqa
import pandas_ml as pdml # noqa
import pandas_ml.util.testing as... | iris = datasets.load_iris()
df = pdml.ModelFrame(iris)
models = ['XGBClassifier']
|
<|file_name|>utils.rs<|end_file_name|><|fim▁begin|>use std::ptr;
use std::io;
use std::fs::{create_dir, remove_dir_all, read_dir, remove_file, remove_dir};
use std::fs::{metadata};
use std::path::{Path, PathBuf};
use std::path::Component::Normal;
use std::io::Error as IoError;
use std::io::ErrorKind::{AlreadyExists, No... | // TODO(tailhook) do more comprehensive algo
'map: for item in map.iter() { |
<|file_name|>oLanguage.oPaginate.js<|end_file_name|><|fim▁begin|>// DATA_TEMPLATE: js_data
oTest.fnStart( "oLanguage.oPaginate" );
/* Note that the paging language information only has relevence in full numbers */
$(document).ready( function () {
/* Check the default */
var oTable = $('#example').dataTable( ... | $('#example_paginate .next').html() == "unit3" &&
$('#example_paginate .last').html() == "test4";
|
<|file_name|>hover-child.js<|end_file_name|><|fim▁begin|>import $ from 'jquery';
let hoverChildDirective = {
bind: (el, binding) => {
$(el)
.on('mouseenter', function(event) {
$(el).children('.icon').addClass(binding.value);
})
.on('mouseleave', function(... | export { hoverChildDirective }; |
<|file_name|>routes.js<|end_file_name|><|fim▁begin|>import React from 'react';
import { Route, IndexRoute } from 'react-router';
import App from './App';
import IncredibleOffersContainer from './IncredibleOffers/IncredibleOfferContainer';
<|fim▁hole|>
export default (
<Route path="/" component={App}>
<IndexRoute ... | |
<|file_name|>test_filter_remapped_reads.py<|end_file_name|><|fim▁begin|>import sys
import os
import subprocess
import filter_remapped_reads
import util
#
# filter_remapped_reads.py
# INPUT FILES:
# to_remap_bam - input BAM file containing original set of reads
# that need to be remapped after havi... | assert read_name in read_dict
reads = read_dict[read_name]
assert len(reads) == 2
pos1 = int(reads[0][3]) |
<|file_name|>pubsub2storage.cpp<|end_file_name|><|fim▁begin|>/*
* pubsub2storage: service which transfers between pubsub and storage
*
* Copyright (C) 1998 - 2020. Dinand Vanvelzen
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with ... | // The current container is now considered to have enough content.
|
<|file_name|>HSS2_then_IsolatedLHS.py<|end_file_name|><|fim▁begin|>from core.himesis import Himesis, HimesisPreConditionPatternLHS
import uuid
class HSS2_then_IsolatedLHS(HimesisPreConditionPatternLHS):
def __init__(self):
"""
Creates the himesis graph representing the AToM3 model HSS2_... |
def constraint(self, PreNode, graph):
"""
Executable constraint code. |
<|file_name|>strings.py<|end_file_name|><|fim▁begin|># -*- coding:utf-8 -*-
from django.utils.translation import ugettext_lazy as _<|fim▁hole|>SEARCH_FORM_KEYWORDS = _(u'Key Words / Profession')
SEARCH_FORM_LOCATION = _(u'City, State or Zip Code')
# SearchFiltersForm's strings
SEARCH_FILTERS_FORM_JOB_POSITION = _(u'Jo... |
# SearchForm's strings |
<|file_name|>test_abf.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python3
from socket import inet_pton, inet_ntop, AF_INET, AF_INET6
import unittest
from framework import VppTestCase, VppTestRunner
from vpp_ip import DpoProto
from vpp_ip_route import VppIpRoute, VppRoutePath, VppMplsLabel, \
VppIpTable, FibPat... | self._test.registry.register(self, self._test.logger)
def remove_vpp_config(self): |
<|file_name|>__openerp__.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
# © 2017 Didotech srl (www.didotech.com)<|fim▁hole|>
{
"name": "BoM Warning",
"version": "4.0.1.2",
"depends": [
"mrp",
"base",
"product",
"warning"
],
"author": "Didotech srl",
"desc... | |
<|file_name|>text_input.py<|end_file_name|><|fim▁begin|>"""
This module defines the following constants:
*InputText options*
* BGUI_INPUT_NONE = 0
* BGUI_INPUT_SELECT_ALL = 1
* BGUI_INPUT_DEFAULT = BGUI_INPUT_NONE
"""
from .widget import Widget, WeakMethod, BGUI_DEFAULT, BGUI_CENTERY, \
BGUI_NO_FOCUS, BGUI_MOUS... | elif key == MINUSKEY: char = "_" |
<|file_name|>aurelia-datatable.js<|end_file_name|><|fim▁begin|>'use strict';
exports.__esModule = true;
exports.configure = configure;
var _aureliaViewManager = require('aurelia-view-manager');
<|fim▁hole|>var _convertManager = require('./convert-manager');
function configure(aurelia) {
aurelia.plugin('aurelia-pag... | var _datatable = require('./datatable');
var _columnsFilter = require('./columns-filter');
|
<|file_name|>register_table.rs<|end_file_name|><|fim▁begin|>// SPDX-License-Identifier: MIT
// Copyright wtfsckgh@gmail.com
// Copyright iced contributors
use super::super::super::Register;
use std::collections::HashMap;
lazy_static! {
pub(super) static ref TO_REGISTER_HASH: HashMap<&'static str, Register> = {
// ... | let _ = h.insert("k5", Register::K5);
let _ = h.insert("k6", Register::K6); |
<|file_name|>ex01.py<|end_file_name|><|fim▁begin|><|fim▁hole|># Sample String : "Twinkle, twinkle, little star, How I wonder what you are! Up above the world so high, Like a diamond
# in the sky. Twinkle, twinkle, little star, How I wonder what you are" Output :
# Twinkle, twinkle, little star,
# How I wonder what you... | # https://www.w3resource.com/python-exercises/
# 1. Write a Python program to print the following string in a specific format (see the output). |
<|file_name|>rec.rs<|end_file_name|><|fim▁begin|>use super::Fibonacci;
pub struct Recursive;
impl Fibonacci for &Recursive {
fn fib(self, n: u64) -> u64 {
if n == 0 || n == 1 {
1
} else {
self.fib(n - 1) + self.fib(n - 2)
}
}
}
#[cfg(test)]
mod tests {
use ... | fib_test!(zero, 0, 1);
fib_test!(one, 1, 1);
fib_test!(two, 2, 2);
fib_test!(three, 3, 3); |
<|file_name|>cartoonmad.py<|end_file_name|><|fim▁begin|>"""The www.cartoonmad.com analyzer.
[Entry examples]
- http://www.cartoonmad.com/comic/5640.html
- https://www.cartoonmad.com/comic/5640.html
"""
import re
from urllib.parse import parse_qsl
from cmdlr.analyzer import BaseAnalyzer
from cmdlr.autil impo... | def __extract_description(fetch_result): |
<|file_name|>main.cpp<|end_file_name|><|fim▁begin|>//
// main.cpp
// test
//
// Created by 刘金鑫 on 14-3-11.
//
//
#ifndef _WIN32
#include <stdio.h>
#else
#include "stdafx.h"
#include <conio.h>
#endif
#include "../../src/tcpclient.h"
#ifndef _WIN32
#include <termios.h>
#include <unistd.h>
#include <fcntl.h>
int _kbh... | fcntl(STDIN_FILENO, F_SETFL, oldf);
if(ch != EOF)
{
ungetc(ch, stdin); |
<|file_name|>any_object.js<|end_file_name|><|fim▁begin|>// @flow
<|fim▁hole|> let obj: Object = {};
obj.foo = x; // error, taint ~> any
obj[y] = x; // error, taint ~> any
},
// getting a property
function() {
let obj: Object = { foo: 'foo' };
(obj.foo: $Tainted<string>); // ok
},
// calli... | let tests = [
// setting a property
function(x: $Tainted<string>, y: string) { |
<|file_name|>api_urls.py<|end_file_name|><|fim▁begin|># ~*~ coding: utf-8 ~*~
from __future__ import unicode_literals
from django.conf.urls import url<|fim▁hole|>app_name = "audits"
router = DefaultRouter()
router.register(r'ftp-log', api.FTPLogViewSet, 'ftp-log')
urlpatterns = [
]
urlpatterns += router.urls<|fim▁e... | from rest_framework.routers import DefaultRouter
from .. import api
|
<|file_name|>application-basic-inline.ts<|end_file_name|><|fim▁begin|>import {Component, NgModule} from '@angular/core';
import {BrowserModule} from '@angular/platform-browser';<|fim▁hole|> template: `<div>Hello!</div>`
})
export class BasicInlineComponent {}
@NgModule({
imports: [BrowserModule],
declarations: [... |
@Component({
selector: 'application', |
<|file_name|>teste.py<|end_file_name|><|fim▁begin|>from netfilterqueue import NetfilterQueue
from dpkt import ip, icmp, tcp, udp
from scapy.all import *
import socket<|fim▁hole|>def print_and_accept(pkt):
data=pkt.get_payload()
res = ip.IP(data)
res2 = IP(data)
i = ICMP(data)
t = TCP(data)
u = U... | |
<|file_name|>noop.rs<|end_file_name|><|fim▁begin|>use anyhow::Result;
use crate::models::AuditRecord;
use super::AuditReporter;
use super::Auditor;
use super::AuditorFactory;
/// AuditReporter that drops all records
pub struct NoopReporter {}
impl AuditorFactory for NoopReporter {
fn make(&self) -> Auditor {
... | }
}
|
<|file_name|>filemanager.rs<|end_file_name|><|fim▁begin|>use std::path::Path;
use crate::channel::*;
use crate::threadpool::*;
use crossbeam_channel::*;
pub enum FileManagerRequests {
ReadAll {
file: String,
sender: Sender<Message>,
},
}
pub struct ReadAllResult {}
pub enum FileManagerReques... | |
<|file_name|>test_save.py<|end_file_name|><|fim▁begin|>import pytest
from mitmproxy.test import taddons
from mitmproxy.test import tflow
from mitmproxy import io
from mitmproxy import exceptions
from mitmproxy.addons import save
from mitmproxy.addons import view
def test_configure(tmpdir):
sa = save.Save()
... | |
<|file_name|>issue-33569.rs<|end_file_name|><|fim▁begin|>macro_rules! foo {
{ $+ } => { //~ ERROR expected identifier, found `+`<|fim▁hole|> }
}
foo!();
fn main() {}<|fim▁end|> | //~^ ERROR missing fragment specifier
$(x)(y) //~ ERROR expected one of: `*`, `+`, or `?` |
<|file_name|>LiveHTMLVisitorController.ts<|end_file_name|><|fim▁begin|>import AbstractServiceController from "../../Base/AbstractServiceController";
import MessageChannelUtil from "../../Base/Util/MessageChannelUtil";
import { LiveHTMLVisitorView } from "./LiveHTMLVisitorView";
import LiveHTMLVisitorModel from "./Live... | public OnDataConnectionClose(conn: PeerJs.DataConnection) { |
<|file_name|>main.js<|end_file_name|><|fim▁begin|><|fim▁hole|>var today = new Date();
var birthday = new Date(1981, 1, 16);
var age = today.getTime() - birthday.getTime();
alert(age);
// alert(age / 1000 / 60 / 60 / 24/ 365.25);<|fim▁end|> | |
<|file_name|>yr-download-tips.js<|end_file_name|><|fim▁begin|>import Ember from 'ember';
export default Ember.Component.extend({
tagName: '',
didInsertElement: function() {
this.startPoppover();
},
willDestroyElement: function() {
this.dismissPoppover();
},
startPoppover: function() {
var optio... | trigger: 'hover',
content: content, |
<|file_name|>package.py<|end_file_name|><|fim▁begin|># Copyright 2013-2021 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
class Amrvis(MakefilePackage):
"""Amrvis is a visualization pack... | |
<|file_name|>forms.py<|end_file_name|><|fim▁begin|>from node import models
from django.forms import ModelForm
from . import cdmsportalfunc as cpf
from django.core.exceptions import ValidationError
from django import forms
class MoleculeForm(ModelForm):
class Meta:
model = models.Molecules
fields =... | widget=forms.TextInput(attrs={'readonly': 'readonly'}) |
<|file_name|>difficulty_test_util.go<|end_file_name|><|fim▁begin|>// Copyright 2015 The go-ethereum Authors
// This file is part of the go-ethereum library.
//
// The go-ethereum library is free software: you can redistribute it and/or modify
// it under the terms of the GNU Lesser General Public License as published b... | actual := core.CalcDifficulty(config, currentTimestamp, parent) |
<|file_name|>cast-rfc0401-vtable-kinds.rs<|end_file_name|><|fim▁begin|>// Check that you can cast between different pointers to trait objects
// whose vtable have the same kind (both lengths, or both trait pointers).
trait Foo<T> {
fn foo(&self, _: T) -> u32 { 42 }
}
trait Bar {
fn bar(&self) { println!("Bar!... | |
<|file_name|>scim.component.ts<|end_file_name|><|fim▁begin|>/*
* Copyright (C) 2015 The Gravitee team (http://gravitee.io)
*
* 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
*
* h... | save() { |
<|file_name|>v3.go<|end_file_name|><|fim▁begin|>package main
import (
"bytes"
"io/ioutil"
"log"
"os"
"path/filepath"
"strings"
"unicode/utf8"
"github.com/coreos/etcd/clientv3"
"golang.org/x/net/context"
)
const (
// constant vendor
// copy from https://github.com/coreos/etcd/blob/80d15948bcfc93aabd2c5245d... | }
func syncProcess_v3FSEvent(localDir string, serverPrefix string, c3 *clientv3.Client, event fileChangeEvent) {
etcdPath, err := filepath.Rel(localDir, event.Path) |
<|file_name|>PlaceholderId.java<|end_file_name|><|fim▁begin|>/**
* Copyright 2015 Netflix, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/L... | /**
* Invokes each of the associated tag factories to produce a Id based on the
* runtime context available when this method is invoked. If an associated
* TagFactory produces a non-null Tag, then the returned Id will have that |
<|file_name|>case.test.js<|end_file_name|><|fim▁begin|>import assert from 'assert'
import {fixCase} from '../../src/lib/words/case'
import Locale from '../../src/locale/locale'
describe('Corrects accidental uPPERCASE\n', () => {
let testCase = {
'Hey, JEnnifer!': 'Hey, Jennifer!',
'CMSko': 'CMSko',
'FPs'... | 'How about ABC?': 'How about ABC?',
'cAPSLOCK': 'capslock',
'(cAPSLOCK)': '(capslock)', |
<|file_name|>class-method-cross-crate.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://... | assert_eq!(kitty.how_hungry, 2); |
<|file_name|>auth_backends.py<|end_file_name|><|fim▁begin|>from __future__ import division,print_function,unicode_literals,with_statement
import logging
from django.contrib.auth import get_user_model
from django.contrib.auth.backends import ModelBackend
User=get_user_model()
class EmailBackend(ModelBackend):
def ... | |
<|file_name|>interlis_model.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
from __future__ import unicode_literals
import math
import re
from hub.formats import Format, Formatter
from hub.structures.file import File
from hub.structures.frame import OdhType
class InterlisModelFormat(Format):
name = 'INT... | self.name = sanitize_name(name)
self.tables = tables |
<|file_name|>errors.py<|end_file_name|><|fim▁begin|>from collections import defaultdict
from mongoengine.python_support import txt_type
__all__ = ('NotRegistered', 'InvalidDocumentError', 'LookUpError',
'DoesNotExist', 'MultipleObjectsReturned', 'InvalidQueryError',
'OperationError', 'NotUnique... | for k, v in self.to_dict().iteritems():
error_dict[generate_key(v)].append(k)
return ' '.join(["%s: %s" % (k, v) for k, v in error_dict.iteritems()]) |
<|file_name|>utils.py<|end_file_name|><|fim▁begin|>from __future__ import absolute_import, print_function
import numpy as np
import warnings
def _bit_length_26(x):
if x == 0:
return 0
elif x == 1:
return 1
else:
return len(bin(x)) - 2
try:
from scipy.lib._version import Numpy... | |
<|file_name|>clock.py<|end_file_name|><|fim▁begin|>"""Clock for keeping track of the wall time.
"""
__all__ = ['ClockError', 'Clock', 'log']
import datetime
import logging
import time
from typing import Optional # noqa: F401. Used for mypy.
class ClockError(Exception):
"""Invalid clock operation."""
... | else:
stop = datetime.datetime.fromtimestamp(self.stop)
delta = stop - start |
<|file_name|>complex_types_macros.rs<|end_file_name|><|fim▁begin|>extern crate serde;
#[macro_use]
extern crate serde_derive;
#[macro_use]
extern crate rusted_cypher;
use rusted_cypher::GraphClient;
use rusted_cypher::cypher::result::Row;
const URI: &'static str = "http://neo4j:neo4j@127.0.0.1:7474/db/data";
#[der... | |
<|file_name|>Test_Watchdog.py<|end_file_name|><|fim▁begin|>""" unit test for Watchdog.py
"""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
# imports
import os
from mock import MagicMock
# sut
from DIRAC.WorkloadManagementSystem.JobWrapper.Watchdog import... | |
<|file_name|>InterferogramOp.java<|end_file_name|><|fim▁begin|>package org.jlinda.nest.gpf;
import com.bc.ceres.core.ProgressMonitor;
import org.apache.commons.math3.util.FastMath;
import org.esa.beam.framework.datamodel.Band;
import org.esa.beam.framework.datamodel.MetadataElement;
import org.esa.beam.framework.datam... | private static final boolean CREATE_VIRTUAL_BAND = true;
private String productName;
public String productTag;
private int sourceImageWidth; |
<|file_name|>timer.d.ts<|end_file_name|><|fim▁begin|>import { Observable } from '../Observable';
import { SchedulerLike } from '../types';
/**
* Creates an Observable that starts emitting after an `initialDelay` and
* emits ever increasing numbers after each `period` of time thereafter.
*
* <span class="informal">I... | *
* <img src="./img/timer.png" width="100%"> |
<|file_name|>config_flow.py<|end_file_name|><|fim▁begin|>"""Config flow for the Daikin platform."""
import asyncio
import logging
from uuid import uuid4
from aiohttp import ClientError, web_exceptions
from async_timeout import timeout
from pydaikin.daikin_base import Appliance
from pydaikin.discovery import Discovery
... | _LOGGER.debug("Zeroconf user_input: %s", discovery_info)
devices = Discovery().poll(ip=discovery_info[CONF_HOST]) |
<|file_name|>pep4.py<|end_file_name|><|fim▁begin|>#Project Euler Problem 4
#A palindromic number reads the same both ways. The largest palindrome made from the product of two 2-digit numbers is 9009 = 91 * 99.
#Find the largest palindrome made from the product of two 3-digit numbers.
def palindrome(test):
while le... | print 9*4
print 7*5
print 8*4
print 6*5 |
<|file_name|>list.py<|end_file_name|><|fim▁begin|>from __future__ import absolute_import
import logging
import warnings
from pip.basecommand import Command
from pip.exceptions import DistributionNotFound
from pip.index import PackageFinder
from pip.req import InstallRequirement
from pip.utils import get_installed_dis... | continue
except DistributionNotFound:
continue
else: |
<|file_name|>snmalloc.rs<|end_file_name|><|fim▁begin|>// Copyright 2021 TiKV Project Authors. Licensed under Apache-2.0.
pub use crate::default::*;
pub type Allocator = snmalloc_rs::SnMalloc;
pub const fn allocator() -> Allocator {
snmalloc_rs::SnMalloc<|fim▁hole|>}<|fim▁end|> | |
<|file_name|>callbacks.rs<|end_file_name|><|fim▁begin|>#![allow(deprecated)]
use std::{
ffi::CStr,
io::{self, prelude::*},
panic::{self, UnwindSafe},
str::Utf8Error,
thread,
};
use ffi;
use libc;
use static_assertions::assert_obj_safe;
use crate::{edit, utils::FdWriter, Data, Error};
assert_obj_s... | }
|
<|file_name|>test_views.py<|end_file_name|><|fim▁begin|>"""
accounts.test_views
===================
Tests the REST API calls.
Add more specific social registration tests
"""
import responses
from django.core.urlresolvers import reverse
from django.core import mail
from django.contrib.sites.models imp... | 'uid': url_kwargs['uid'],
'token': url_kwargs['token']
}
response = self.client.post(self.rest_password_reset_confirm_url, data, format='json') |
<|file_name|>entity.module.ts<|end_file_name|><|fim▁begin|>import { NgModule, CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
import { GatewayQuoteModule as QuotesQuoteModule } from './quotes/quote/quote.module';
/* jhipster-needle-add-entity-module-import - JHipster will add entity modules imports here */
@NgModule({... | imports: [ |
<|file_name|>player.py<|end_file_name|><|fim▁begin|># This file is part of Gem.
#
# Gem is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later ver... | # but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
<|file_name|>CombatEvent.ts<|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/.
*/
export {};
declare global {
interface CombatEvent ... | }[]; |
<|file_name|>user.ts<|end_file_name|><|fim▁begin|>/* tslint:disable */
import 'rxjs/add/operator/map';
import 'rxjs/add/operator/catch';
import 'rxjs/add/operator/startWith';
import 'rxjs/add/operator/switchMap';
import 'rxjs/add/operator/mergeMap';
import 'rxjs/add/operator/toArray';
import { Observable } from 'rxjs/O... | import { BaseEffects } from './base';
import { UserActionTypes, UserActions } from '../actions/user';
import { ErrorActions } from '../actions/error'; |
<|file_name|>OEP.py<|end_file_name|><|fim▁begin|>"Yang/Wu's OEP implementation, in PyQuante."
from math import sqrt
import settings
from PyQuante.NumWrap import zeros,matrixmultiply,transpose,dot,identity,\
array,solve
from PyQuante.Ints import getbasis, getints, getJ,get2JmK,getK
from PyQuante.LA2 import geigh,m... | for j in xrange(i+1):
jbf = self.bfs[j]
gij = three_center(ibf,gbf,jbf) |
<|file_name|>FieldExclusionTest.java<|end_file_name|><|fim▁begin|>/**
* The MIT License
*
* Copyright (c) 2019, Mahmoud Ben Hassine (mahmoud.benhassine@icloud.com)
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Sof... | // B1 and its "children" must not be null
assertThat(c.getB1()).isNotNull();
assertThat(c.getB1().getA1()).isNotNull();
assertThat(c.getB1().getA1().getS1()).isNotNull(); |
<|file_name|>test_successor.py<|end_file_name|><|fim▁begin|>from must import MustHavePatterns
from successor import Successor
class TestSuccessor(object):
@classmethod<|fim▁hole|>
def test_successor(self):
try:
self.test_patterns.create(Successor)
raise Exception("Recursive str... | def setup_class(cls):
cls.test_patterns = MustHavePatterns(Successor) |
<|file_name|>lib.rs<|end_file_name|><|fim▁begin|>#![feature(duration)]
#![feature(socket_timeout)]
#[cfg(unix)]extern crate libc;
#[cfg(unix)]extern crate unix_socket;
#[macro_use(log, sendlog)] extern crate logger;
extern crate config;
extern crate util;
extern crate parser;
extern crate response;
extern crate databas... | |
<|file_name|>search-audience-bidding.d.ts<|end_file_name|><|fim▁begin|>declare namespace GoogleAdsScripts {
namespace AdsApp {
interface SearchAudienceBidding {
/** Clears the bid modifier value. */
clearBidModifier(): void;
/** Returns the current bid modifier value. */
... | /** Sets the bid modifier value for this audience to the specified value. */
setBidModifier(modifier: number): void; |
<|file_name|>photom_b4.py<|end_file_name|><|fim▁begin|>from __future__ import absolute_import, unicode_literals, division, print_function
from . import model_base
__all__ = ['PhotomModelB4']
class PhotomModelB4(model_base.DataModel):
"""
A data model for photom reference files.
"""
schema_url = "pho... |
if phot_table is not None:
self.phot_table = phot_table
|
<|file_name|>ScheduledTransferRemoteasDestination.java<|end_file_name|><|fim▁begin|>import java.io.IOException;
import java.io.PrintWriter;
import java.util.HashMap;
import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpS... | String destinationTriggerPattern = request.getParameter("dtp");
String hostIp = request.getParameter("hostip");
String userName = request.getParameter("username");
String password = request.getParameter("password"); |
<|file_name|>plot_degree_circle.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
'''
Plot degree values for a given set of nodes in a simple circle plot.
'''
import numpy as np
import matplotlib.pyplot as plt
import mne
from jumeg import get_jumeg_path
from jumeg.connectivity import plot_degree_circle
import b... |
fig, ax = plot_degree_circle(degrees, yaml_fname, orig_labels_fname) |
<|file_name|>other.rs<|end_file_name|><|fim▁begin|><|fim▁hole|><|fim▁end|> | fn other() -> &str { "other"} |
<|file_name|>default.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
# -*- coding: UTF-8 -*-
from rollyourown import seo<|fim▁hole|>from django.conf import settings
class DefaultMetadata(seo.Metadata):
""" A very basic default class for those who do not wish to write their own.
"""
title = seo... | |
<|file_name|>choicelists.py<|end_file_name|><|fim▁begin|># -*- coding: UTF-8 -*-
# Copyright 2019-2020 Rumma & Ko Ltd
# License: GNU Affero General Public License v3 (see file COPYING for details)
from django.db import models
from lino_xl.lib.ledger.choicelists import VoucherStates
from lino.api import dd, _
class... | pass
add = OrderStates.add_item
add('10', _("Waiting"), 'draft', is_editable=True) |
<|file_name|>move.py<|end_file_name|><|fim▁begin|>from engine.constants import BOARD_INDEX, C_PERM_INDEX, WK_SQ_INDEX, BK_SQ_INDEX, EN_PAS_INDEX, NORTH, SOUTH, \
RANK2, RANK7, WKC_INDEX, WQC_INDEX, BKC_INDEX, BQC_INDEX, CASTLE_VOIDED, CASTLED, A1, A8, E1, E8, C1, C8, G1, \
G8, H1, H8, WHITE, BLACK, HALF_MOVE_IN... | if abs(to_tile_n - from_tile_n) == 20: |
<|file_name|>tsp.rs<|end_file_name|><|fim▁begin|>extern crate time;
extern crate getopts;
extern crate rand;
// TODO use terminal colors for nicer colored output
// extern crate term;
use getopts::{Options, Matches};
use std::env::args;
use rand::{SeedableRng, StdRng};
use time::precise_time_ns;
use std::str::FromStr... | graph.all_edges().len()); |
<|file_name|>otter_ai_to_our_format.py<|end_file_name|><|fim▁begin|>import os
import sys
def main():
if len(sys.argv) != 2:
print("Usage: Pass the file name for the source transcript txt file.")
sys.exit(-1)
file = sys.argv[1]
out_file = os.path.expanduser(
os.path.join(
... | )
) |
<|file_name|>urls.py<|end_file_name|><|fim▁begin|># coding: utf-8
from django.conf.urls import url
from rest_framework.urlpatterns import format_suffix_patterns
from songwriter import views
urlpatterns = [
url(r'^$', views.api_root,
name="root"),
url(r'^songs/list/$', views.SongList.as_view(),
... | |
<|file_name|>import_onnx.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 Apa... | self._nodes[i.name] = symbol.Variable(name=i.name,
shape=self._params[i.name].shape) |
<|file_name|>errors.go<|end_file_name|><|fim▁begin|>// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT.
package codedeploy
import (
"github.com/aws/aws-sdk-go/private/protocol"
)
const (
// ErrCodeAlarmsLimitExceededException for service response error code
// "AlarmsLimitExceededException".
//... | //
// * Two alarms with the same name have been specified.
// |
<|file_name|>polifill.js<|end_file_name|><|fim▁begin|>'use strict'
const reduce = Function.bind.call(Function.call, Array.prototype.reduce);
const isEnumerable = Function.bind.call(Function.call, Object.prototype.propertyIsEnumerable);
const concat = Function.bind.call(Function.call, Array.prototype.concat);
const keys... | const context = this,
args = arguments; |
<|file_name|>homeCtrl.js<|end_file_name|><|fim▁begin|>'use strict';<|fim▁hole|>angular.module('home', ['ngMessages'])
.controller('homeCtrl', [function() {
}]);<|fim▁end|> | |
<|file_name|>serviceClientsAngular2.extensions.ts<|end_file_name|><|fim▁begin|>export class MyBaseClass {
protected transformOptions(options: any) {
return options;
}
<|fim▁hole|> protected transformResult(url: string, response: any, processor: (response: any) => any) {
return processor(resp... | |
<|file_name|>index.js<|end_file_name|><|fim▁begin|>version https://git-lfs.github.com/spec/v1
oid sha256:96c89faf399ad903c813617aca830b28b3330c35d8af37d08743722e06d9323d<|fim▁hole|>size 84<|fim▁end|> | |
<|file_name|>reuse_test.py<|end_file_name|><|fim▁begin|>import tensorflow as tf
def f():<|fim▁hole|>
f()<|fim▁end|> | with tf.variable_scope('A') as scope:
print scope.reuse |
<|file_name|>helpers.py<|end_file_name|><|fim▁begin|>import uuid
import base64
import re
def generate_key():
"""
generates a uuid, encodes it with base32 and strips it's padding.
this reduces the string size from 32 to 26 chars.
"""
return base64.b32encode(uuid.uuid4().bytes).strip('=').lower()[0:12]
def thousa... | setattr(passed_object, item, request_data.values.get(item)) |
<|file_name|>html.ts<|end_file_name|><|fim▁begin|>import * as cheerio from "cheerio";
<|fim▁hole|>import { createDestUrl } from "./path";
export class Html {
private _$: CheerioStatic;
constructor(source: string) {
this._$ = cheerio.load(source);
}
public finalize(): void {
const tha... | import { PageOptions } from "../../options"; |
<|file_name|>div_mod.rs<|end_file_name|><|fim▁begin|>use malachite_base::num::basic::integers::PrimitiveInt;
use malachite_base::num::basic::signeds::PrimitiveSigned;
use malachite_base::num::basic::unsigneds::PrimitiveUnsigned;
use malachite_base::rounding_modes::RoundingMode;
use malachite_base_test_util::generators:... | |
<|file_name|>payments.rs<|end_file_name|><|fim▁begin|>extern crate futures;
extern crate indy_sys;
use indy::{IndyError, ErrorCode};
use indy::payments;
use self::futures::Future;
use self::indy_sys::payments as payments_sys;
use std::collections::VecDeque;
use std::ffi::CString;
use super::libc::c_char;
use std::syn... | $first_param_name: $first_param_type,
$($param_name: $param_type,)*
cb: Option<IndyPaymentCallback>) -> i32 {
|
<|file_name|>main.rs<|end_file_name|><|fim▁begin|>/*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/<|fim▁hole|>mod error_reporting;
mod lsp;
mod server;
use lsp_server::Connection;
u... |
#![warn(clippy::all)]
mod client; |
<|file_name|>nulldummy.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python3
# Copyright (c) 2016 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test NULLDUMMY softfork.
Connect to a single node.
G... | from test_framework.script import CScript
from io import BytesIO |
<|file_name|>test_parse_segv.py<|end_file_name|><|fim▁begin|>import unittest, tempfile, sys, os.path
datadir = os.environ.get('APPORT_DATA_DIR', '/usr/share/apport')
sys.path.insert(0, os.path.join(datadir, 'general-hooks'))
import parse_segv
# Default global registers, maps, and disassembly for testing
regs = '''ea... | rbp 0x0 0x0 |
<|file_name|>test.rs<|end_file_name|><|fim▁begin|>pub fn config_read_word(bus: u8, slot: u8, func: u8, offset: u8) -> u16 {
let device: i32 = match (bus, slot, func) {
// root PCI controller
(0, 0, 0) => 0,
// secondary bus controller (for bus 1)
(0, 1, 0) => 1,
(9, 0, 0) =... | match offset { |
<|file_name|>adaptDefineComponentFunction.js<|end_file_name|><|fim▁begin|>import validateComponentConfig from '../validation/validateComponentConfig';
import normalizeComponentConfig from '../helper/normalizeComponentConfig';
import createFactory from '../helper/createFactory';
import printError from '../helper/printEr... | componentType = createComponentType(normalizedConfig),
factory = createFactory(componentType, normalizedConfig, Adapter);
return factory; |
<|file_name|>descriptor.rs<|end_file_name|><|fim▁begin|>use uuid::*;<|fim▁hole|> ClientConfiguration,
ServerConfiguration,
PresentationFormat,
AggregateFormat,
ValidRange,
ExternalReportReference,
ReportReference,
NumberOfDigitals,
TriggerSetting,
TestComplexBitfield,
Unknown(... |
pub enum Descriptor {
ExtendedProperties,
UserDescription, |
<|file_name|>defaults.py<|end_file_name|><|fim▁begin|>"""<|fim▁hole|>Django settings. The ``editable`` argument for each controls whether
the setting is editable via Django's admin.
Thought should be given to how a setting is actually used before
making it editable, as it may be inappropriate - for example settings
th... | Default settings for the ``mezzanine.generic`` app. Each of these can be
overridden in your project's settings module, just like regular |
<|file_name|>test_addonconf.py<|end_file_name|><|fim▁begin|>import sys
import unittest
sys.path.insert(0, "../src/build")
import addonconf
class AddonConfModuleTestCase(unittest.TestCase):
def test_load(self):
# act
config = addonconf.load("configs/config.json")
# assert
self.asse... |
# assert
self.assertEqual(config, correct_config, "Uncorrect load config") |
<|file_name|>google-cloud-function.ts<|end_file_name|><|fim▁begin|>// @ts-expect-error `npm install --save-dev @types/express`
import { Request, Response } from 'express'
import { Telegraf } from 'telegraf'
const { BOT_TOKEN, FUNCTION_NAME, PROJECT_ID, REGION } = process.env<|fim▁hole|>}
const bot = new Telegraf(BOT_... |
if (BOT_TOKEN === undefined) {
throw new TypeError('BOT_TOKEN must be provided!') |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.