prompt large_stringlengths 70 991k | completion large_stringlengths 0 1.02k |
|---|---|
<|file_name|>scale.js<|end_file_name|><|fim▁begin|>/**
* Scale Interpolation Function.<|fim▁hole|> * @param {number} b end scale
* @param {number} v progress
* @returns {string} the interpolated scale
*/
export default function scale(a, b, v) {
// eslint-disable-next-line no-bitwise
return `scale(${((a + (b - a... | *
* @param {number} a start scale |
<|file_name|>PrivateCleverbotCommand.java<|end_file_name|><|fim▁begin|>package com.gmail.hexragon.gn4rBot.command.ai;
import com.gmail.hexragon.gn4rBot.managers.commands.CommandExecutor;
import com.gmail.hexragon.gn4rBot.managers.commands.annotations.Command;
import com.gmail.hexragon.gn4rBot.util.GnarMessage;
import ... | |
<|file_name|>atan.py<|end_file_name|><|fim▁begin|>from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import numpy as np # type: ignore
import onnx
from ..base import Base
from . import expect
<|fim▁hole|> def export(... |
class Atan(Base):
@staticmethod |
<|file_name|>default.py<|end_file_name|><|fim▁begin|># (c) 2012-2014, Michael DeHaan <michael.dehaan@gmail.com>
# (c) 2017 Ansible Project
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type... |
DOCUMENTATION = ''' |
<|file_name|>docker_test.go<|end_file_name|><|fim▁begin|>package strategy
import (
"reflect"
"strings"
"testing"
"k8s.io/apimachinery/pkg/api/resource"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/runtime"
"k8s.io/apimachinery/pkg/util/validation"
kapi "k8s.io/kubernetes/pkg/api"
b... | |
<|file_name|>setup.py<|end_file_name|><|fim▁begin|>from setuptools import setup, find_packages
setup(
name="simple-crawler",
version="0.1",
url="https://github.com/shonenada/crawler",
author="shonenada",
author_email="shonenada@gmail.com",<|fim▁hole|> install_requires=["requests==2.2.1"],
)<|fi... | description="Simple crawler",
zip_safe=True,
platforms="any",
packages=find_packages(), |
<|file_name|>_express_route_connections_operations.py<|end_file_name|><|fim▁begin|># coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license inf... | |
<|file_name|>test_resource_group.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 ... | "resources": { |
<|file_name|>auth.spec.ts<|end_file_name|><|fim▁begin|>/*!
* @license
* Copyright 2017 Google 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... | });
});
|
<|file_name|>simple.py<|end_file_name|><|fim▁begin|># Copyright (C) 2016 Matt Griswold <grizz@20c.com>
#
# This file is part of bgpfu
#
# 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|>util.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
from __future__ import (print_function, unicode_literals, absolute_import,
division)
import json
import re
import six
import sys
channel_name_re = re.compile('\A[-a-zA-Z0-9_=@,.;]+\Z')
app_id_re = re.compile('\A[0... | def validate_channel(channel): |
<|file_name|>contribution-opportunities-backend-api.service.spec.ts<|end_file_name|><|fim▁begin|>// Copyright 2018 The Oppia 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... | 'domain/utilities/url-interpolation.service';
import { FeaturedTranslationLanguageObjectFactory} from
'domain/opportunity/FeaturedTranslationLanguageObjectFactory';
|
<|file_name|>models.py<|end_file_name|><|fim▁begin|>from __future__ import unicode_literals
from sqlalchemy import create_engine, Column, ForeignKey, Integer, String,\<|fim▁hole|> Boolean, Unicode, Date, DateTime, and_, func
from sqlalchemy.orm import relationship, backref, sessionmaker
from sqlalchemy.engine.url im... | |
<|file_name|>issue-3038.rs<|end_file_name|><|fim▁begin|>impl HTMLTableElement {
fn func() {
if number_of_row_elements == 0 {
if let Some(last_tbody) = node
.rev_children()
.filter_map(DomRoot::downcast::<Element>)
.find(|n| {
n.... | } |
<|file_name|>app.js<|end_file_name|><|fim▁begin|><|fim▁hole|>
console.log( "this should be the tablesaw object: ", Tablesaw );<|fim▁end|> | import Tablesaw from '../../dist/tablesaw'; |
<|file_name|>handle.rs<|end_file_name|><|fim▁begin|>use std::{
collections::HashMap,
fmt::{Debug, Display},
fs::File,
hash::Hash,
io::Write,
result::Result as StdResult,
sync::{Arc, Mutex},
time::{Duration, Instant},
};
use dashmap::DashMap;
use libp2p::{identity, kad::QueryId, PeerId};... | ) -> OpId
where
ID: AsRef<str>, |
<|file_name|>gen_table.rs<|end_file_name|><|fim▁begin|>/*
* This file is part of the uutils coreutils package.
*
* (c) Arcterus <arcterus@mail.com>
* (c) Michael Gehring <mg@ebfe.org>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
use s... | fn main() {
let mut table = Vec::with_capacity(CRC_TABLE_LEN); |
<|file_name|>common_words.py<|end_file_name|><|fim▁begin|>#kpbochenek@gmail.com
def common_words(first, second):
dd = set()
for s in first.split(","): dd.add(s)
return ",".join(sorted([w for w in second.split(",") if w in dd]))
<|fim▁hole|> assert common_words("one,two,three", "four,five,six") == "", "To... |
if __name__ == '__main__':
# These "asserts" using only for self-checking and not necessary for auto-testing
assert common_words("hello,world", "hello,earth") == "hello", "Hello" |
<|file_name|>platform.js<|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... | * Unless required by applicable law or agreed to in writing, |
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|>from django.utils.datastructures import SortedDict
from bencode import bencode, bdecode
def sort_dict(D):
result = SortedDict()<|fim▁hole|> D[key] = sort_dict(D[key])
result[key] = D[key]
return result<|fim▁end|> | for key in sorted(D.keys()):
if type(D[key]) is dict: |
<|file_name|>kleroterion.js<|end_file_name|><|fim▁begin|>var Court = artifacts.require("./Court.sol");
<|fim▁hole|>})<|fim▁end|> | contract('Court', (accounts) => {
it("test kleroterion", () => {}) |
<|file_name|>models.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
class Company(object):
def __init__(self, name=None, code=None, phone=None, digit=None):
# Company's name
self.name = name
# Codename
self.code = code
# The digit of the invoice number<|fim▁hole|> ... | if digit is None:
digit = [] |
<|file_name|>test_smooth_l1_loss_op.py<|end_file_name|><|fim▁begin|># Copyright (c) 2018 PaddlePaddle 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
#
# h... | # 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|>__init__.py<|end_file_name|><|fim▁begin|>DEPS = [
'depot_tools',
'gclient',
'gerrit',
'gitiles',
'recipe_engine/buildbucket',
'recipe_engine/context',
'recipe_engine/commit_position',
'recipe_engine/cq',
'recipe_engine/json',
'recipe_engine/path',<|fim▁hole|> 'rec... | 'recipe_engine/platform',
'recipe_engine/properties',
'recipe_engine/python',
'recipe_engine/raw_io', |
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|># -*- encoding: utf-8 -*-
from __future__ import unicode_literals
"""
LANG_INFO is a dictionary structure to provide meta information about languages.
About name_local: capitalize it as if your language name was appearing
inside a sentence in your language.... | 'name': 'Serbian Latin',
'name_local': 'srpski (latinica)',
},
'sv': {
|
<|file_name|>home_action.py<|end_file_name|><|fim▁begin|>#------------------------------------------------------------------------------
# Copyright (C) 2009 Richard W. Lincoln
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "... | class HomeAction(Action):
""" An action for moving the workspace to the user's home directory. |
<|file_name|>base.py<|end_file_name|><|fim▁begin|>"""Define and instantiate the configuration class for Robottelo."""
import logging
import os
import sys
from logging import config
from nailgun import entities, entity_mixins
from nailgun.config import ServerConfig
from robottelo.config import casts
from six.moves.urll... | except (NoSectionError, NoOptionError):
value = default
return value |
<|file_name|>gdb_maloader.py<|end_file_name|><|fim▁begin|># Copyright 2011 Shinichiro Hamaji. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# 1. Redistributions of source code must retain th... | next = frame.newer()
if not next: |
<|file_name|>cholesky.rs<|end_file_name|><|fim▁begin|>#[macro_use]
extern crate linxal;
extern crate ndarray;
extern crate num_traits;
extern crate rand;
use ndarray::{Array, ArrayBase, Data, Ix2};
use rand::thread_rng;
use linxal::types::{LinxalScalar, LinxalMatrix, Symmetric, c32, c64};
use linxal::types::error::{ ... | Symmetric::Lower => { |
<|file_name|>HistJobunit.js<|end_file_name|><|fim▁begin|>/////////////////////////////////////////////////////////////////////////////////
//
// Jobbox WebGUI
// Copyright (C) 2014-2015 Komatsu Yuji(Zheng Chuyu)
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU ... | |
<|file_name|>Cisco_IOS_XR_ipv4_acl_cfg.py<|end_file_name|><|fim▁begin|>""" Cisco_IOS_XR_ipv4_acl_cfg
This module contains a collection of YANG definitions
for Cisco IOS\-XR ipv4\-acl package configuration.
This module contains definitions
for the following management objects\:
ipv4\-acl\-and\-prefix\-list\: IPv4 A... |
@property
def _common_path(self): |
<|file_name|>test_review_xblock.py<|end_file_name|><|fim▁begin|>"""
Test scenarios for the review xblock.
"""
import ddt
import unittest
from django.conf import settings
from django.contrib.auth.models import User
from django.core.urlresolvers import reverse
from nose.plugins.attrib import attr
from lms.djangoapps.co... | 'section': review_section_actual.location.name,
}
))
|
<|file_name|>router_spec.js<|end_file_name|><|fim▁begin|>var should = require('should'),
sinon = require('sinon'),
rewire = require('rewire'),
path = require('path'),
Promise = require('bluebird'),
ampController = rewire('../lib/router'),
errors = require('../../../errors'),
configUtils = r... | |
<|file_name|>0007_fieldvalue_column_name.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
# Generated by Django 1.10.8 on 2018-10-05 09:09
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('explorer', '0006_au... | ] |
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|>__productname__ = 'dotinstall'
__version__ = '0.1'
__copyright__ = "Copyright (C) 2014 Cinghio Pinghio"
__author__ = "Cinghio Pinghio"<|fim▁hole|>__long_description__ = "Install dofile based on some rules"
__url__ = "cinghiopinghio...."
__license__ = "Licensed under... | __author_email__ = "cinghio@linuxmail.org"
__description__ = "Install dotfiles" |
<|file_name|>extraction_way.hpp<|end_file_name|><|fim▁begin|>#ifndef EXTRACTION_WAY_HPP
#define EXTRACTION_WAY_HPP
#include "extractor/guidance/road_classification.hpp"
#include "extractor/travel_mode.hpp"
#include "util/guidance/turn_lanes.hpp"
#include "util/typedefs.hpp"
#include <string>
#include <vector>
namesp... | else |
<|file_name|>day4.rs<|end_file_name|><|fim▁begin|>extern crate crypto;
extern crate clap;
use clap::App;
use crypto::md5::Md5;
use crypto::digest::Digest;
fn main() {
let matches = App::new("day4")
.version("v1.0")
.author("Andrew Rink <andrewrink@gmail.com>")
.args_from_usage("<KEY> 'Secr... | for i in 0..std::u64::MAX { |
<|file_name|>bomOverload.js<|end_file_name|><|fim▁begin|>function bomOverload() {
if(settings.verbose) console.log("RubberGlove: Creating PluginArray");
function PluginArray() { // native(PluginArray)
if(window.navigator.plugins.constructor === PluginArray)
throw new TypeError("Illegal constructor");
... |
// Delete our existing set of plugins
var propertyNames = Object.getOwnPropertyNames(this);
for(var i = 0; i < propertyNames.length; i++) { |
<|file_name|>get_cov_per_ind.py<|end_file_name|><|fim▁begin|>#! /usr/bin/python
#
# This file reads through a vcf file and prints a space-separated text file, containing the coverage for each SNV (rows) and individual (columns). Alt and ref alleles are summed to total coverage at each SNV and locus.
# Usage: ~/hts_too... | |
<|file_name|>chromstat.py<|end_file_name|><|fim▁begin|>import sys
import numpy as np
class ChromStats(object):
def __init__(self):
self.n = 0
self.n_nan = 0
self.sum = 0
self.min = None
self.max = None
def mean(self):
"""Calculates mean of sites that are not n... | |
<|file_name|>where-clauses-no-bounds-or-predicates.rs<|end_file_name|><|fim▁begin|>// Copyright 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
//... |
fn main() { |
<|file_name|>events.js<|end_file_name|><|fim▁begin|>;(function() {
function ToerismeApp(id, parentContainer) {
this.API_URL = 'https://datatank.stad.gent/4/toerisme/visitgentevents.json';
this.id = id;
this.parentContainer = parentContainer;
this.loadData = function() {
var that = this;
... | xhr.onerror = function() { |
<|file_name|>forensic_artifacts.py<|end_file_name|><|fim▁begin|># Rekall Memory Forensics
# Copyright 2016 Google Inc. All Rights Reserved.
#
# 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; eith... | dict(name="regex", type="RegEx",
default=".",
help="Filter the artifact name."), |
<|file_name|>test_template_tags.py<|end_file_name|><|fim▁begin|>"""
Almost all test cases covers both tag calling and template using.
"""
from __future__ import print_function, unicode_literals
from django.conf import settings as django_settings
from django.contrib.contenttypes.models import ContentType
from django.h... | wiki_form(context, form_obj)
self.assertEqual(context, {'test_key': 'test_value'})
|
<|file_name|>voxel_tree.rs<|end_file_name|><|fim▁begin|>#![cfg_attr(test, feature(test))]
use cgmath::Ray3;
use std::mem;
use std::ops::{Deref, DerefMut};
use raycast;
use voxel;
use voxel::Voxel;
#[derive(Debug)]
pub struct VoxelTree {
/// The log_2 of the tree's size.
lg_size: u8,
/// Force the top level to ... | |
<|file_name|>IndexController.java<|end_file_name|><|fim▁begin|><|fim▁hole|>import com.unidev.platform.web.WebUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.w... | package com.unidev.myip.web;
import com.unidev.myip.MyIPService; |
<|file_name|>setup.py<|end_file_name|><|fim▁begin|>from setuptools import setup
def readme():
with open('README.rst') as f:
return f.read()
setup(name='MapperTools',
packages=['MapperTools'],
version='0.1',
description='A python 2.7 implementation of Mapper algorithm for Topological Dat... | keywords='mapper TDA python', |
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|><|fim▁hole|># encoding: utf8<|fim▁end|> | |
<|file_name|>MatrixDiagPart.java<|end_file_name|><|fim▁begin|>/* Copyright 2018 The TensorFlow 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.apache.or... | )
public static class Inputs<T extends TType> extends RawOpInputs<MatrixDiagPart<T>> {
/** |
<|file_name|>skelp.go<|end_file_name|><|fim▁begin|>package cmd
import (
"fmt"
"io"
"github.com/brainicorn/skelp/generator"
"github.com/brainicorn/skelp/skelputil"
"github.com/mgutz/ansi"
"github.com/spf13/cobra"
)
// Flags that are to be added to commands.
var (
quietFlag bool
noColorFlag bool
homedirFl... | cmd.Println(cmd.UsageString()) |
<|file_name|>libraries.py<|end_file_name|><|fim▁begin|># Copyright (c) 2012-2016 Seafile Ltd.
import logging
from rest_framework.authentication import SessionAuthentication
from rest_framework.permissions import IsAdminUser
from rest_framework.response import Response
from rest_framework.views import APIView
from rest... | |
<|file_name|>urls.py<|end_file_name|><|fim▁begin|><|fim▁hole|># -*- coding: utf-8 -*-
from django.conf.urls.defaults import *
urlpatterns = patterns('',
url(r'^test_click/$', 'django.views.generic.simple.direct_to_template',
{'template': 'test_app/wm_test_click.html'}, name='wm_test_click')
)<|fim▁end|> | |
<|file_name|>shell.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
#
# Copyright (C) 2015-2016 Hewlett Packard Enterprise Development LP
#
# 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 a... | Docker shell helper class module.
"""
from __future__ import unicode_literals, absolute_import |
<|file_name|>public_currencies.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python3
__author__ = 'ivan.shynkarenka'
import argparse
from TTWebClient.TickTraderWebClient import TickTraderWebClient
def main():
parser = argparse.ArgumentParser(description='TickTrader Web API sample')
parser.add_argument('web_api... |
# Public currencies |
<|file_name|>pyircbot.py<|end_file_name|><|fim▁begin|>import socket, threading, thread, os, sys, time
def create(settings):
return IrcBot(settings)
# Revision, yolo
class IrcBot:
_settings = {}
_debug = None
_client = "ArmedGuys IRC Bot"
_version = "0.5"
_env = "Python"
_socket = None
# ... | self.out("JOIN :%s\r\n" % channel)
|
<|file_name|>data_pipe.rs<|end_file_name|><|fim▁begin|>// Copyright 2016 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.
use std::marker;
use std::mem;
use std::ops;
use std::ptr;
use std::slice;
use std::vec;
use crate... | #[repr(u32)] |
<|file_name|>xauth.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
import time
import urllib
from urlparse import parse_qs
from oauth_provider.tests.auth import BaseOAuthTestCase, METHOD_URL_QUERY, METHOD_AUTHORIZATION_HEADER, METHOD_POST_REQUEST_BODY
class XAuthTestCase(BaseOAuthTestCase):
def setUp(sel... | response_params = parse_qs(response.content)
|
<|file_name|>calculate.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
"""Calculate controller"""
from __future__ import division
import collections
import copy
import itertools
import os
import time
from openfisca_core.legislations import ParameterNotFound
from .. import conf, contexts, conv, environmen... | label = column.label if column.label != variable_name else None,
name = variable_name,
parameters = parameters_infos or None, |
<|file_name|>formatters.py<|end_file_name|><|fim▁begin|>#!/bin/env python
#Copyright ReportLab Europe Ltd. 2000-2012
#see license.txt for license details
#history http://www.reportlab.co.uk/cgi-bin/viewcvs.cgi/public/reportlab/trunk/reportlab/lib/formatters.py
__all__=('Formatter','DecimalFormatter')
__version__=''' $I... | |
<|file_name|>mandate_pdfs_service.py<|end_file_name|><|fim▁begin|># WARNING: Do not edit by hand, this file was generated by Crank:
#
# https://github.com/gocardless/crank
#
from . import base_service
from .. import resources
from ..paginator import Paginator
from .. import errors
class MandatePdfsService(base_serv... | |
<|file_name|>tmpdir.go<|end_file_name|><|fim▁begin|>// SPDX-License-Identifier: Apache-2.0
// Copyright 2018 Authors of Cilium
package test
import (
"os"<|fim▁hole|>var Tmpdir string
func init() {
var err error
Tmpdir, err = os.MkdirTemp("", "cilium_envoy_go_test")
if err != nil {
log.Fatal("Failed to create a... |
log "github.com/sirupsen/logrus"
)
|
<|file_name|>reportsectiondetail.cpp<|end_file_name|><|fim▁begin|>/*
* OpenRPT report writer and rendering engine
* Copyright (C) 2001-2007 by OpenMFG, LLC (info@openmfg.com)
* Copyright (C) 2007-2008 by Adam Pigg (adam@piggz.co.uk)
*
* This library is free software; you can redistribute it and/or
* modify it und... | adjustSize();
}
QSize ReportSectionDetail::sizeHint() const |
<|file_name|>networks.py<|end_file_name|><|fim▁begin|># Copyright (c) 2015, 2014 Computational Molecular Biology Group, Free University
# Berlin, 14195 Berlin, Germany.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without modification,
# are permitted provided that the following... | for _ in range(iterations): |
<|file_name|>l-calc_ms.ts<|end_file_name|><|fim▁begin|><?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE TS>
<TS version="2.1" language="ms_MY">
<context>
<name>mainUI</name>
<message>
<location filename="../mainUI.ui" line="14"/>
<location filename="../mainUI.cpp" line="53"/>
<source>Cal... | |
<|file_name|>mod.rs<|end_file_name|><|fim▁begin|>//!Ingame related
pub mod data;
pub mod event;
pub mod request;
pub mod state;
pub use self::data::Data;<|fim▁hole|>pub use self::request::Request;
pub use self::state::State;<|fim▁end|> | pub use self::event::Event; |
<|file_name|>index.js<|end_file_name|><|fim▁begin|>/* eslint-disable new-cap */
/* eslint-disable no-console */
const express = require('express');
const morgan = require('morgan');
const bodyParser = require('body-parser');
const mongoose = require('mongoose');
const routes = require('./server/routes');
const config ... | app.listen(config.port, (err) => { |
<|file_name|>acceptance.py<|end_file_name|><|fim▁begin|>"""
This config file extends the test environment configuration
so that we can run the lettuce acceptance tests.
"""
# We intentionally define lots of variables that aren't used, and
# want to import all variables from base settings files
# pylint: disable=wildca... | 'timeout': 30,
},
'ATOMIC_REQUESTS': True, |
<|file_name|>font_cache_thread.rs<|end_file_name|><|fim▁begin|>/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
use app_units::Au;
use font_template::{FontTemplate... | #[derive(Clone, Debug, Deserialize, Eq, Hash, PartialEq, Serialize)] |
<|file_name|>qt_compat.py<|end_file_name|><|fim▁begin|>"""
Provide a common way to import Qt classes used by pytest-qt in a unique manner,
abstracting API differences between PyQt5 and PySide2/6.
.. note:: This module is not part of pytest-qt public API, hence its interface
may change between releases and users should... | self.QtCore.qVersion(),
self.QtCore.QT_VERSION_STR,
) |
<|file_name|>models.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models
from django.utils import timezone
from crm.models import Person
from geocodable.models import LocationAlias
import uuid
class Event(models.Model):
name = models.CharFiel... | |
<|file_name|>urls.py<|end_file_name|><|fim▁begin|>from django.conf.urls import url
from wagtail.documents.views import serve
urlpatterns = [
url(r'^(\d+)/(.*)$', serve.serve, name='wagtaildocs_serve'),
url(r'^authenticate_with_password/(\d+)/$', serve.authenticate_with_password,
name='wagtaildocs_auth... | ] |
<|file_name|>main.ts<|end_file_name|><|fim▁begin|>import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';<|fim▁hole|><|fim▁end|> |
import { AppModule } from './app/app.module';
platformBrowserDynamic().bootstrapModule(AppModule); |
<|file_name|>admin.py<|end_file_name|><|fim▁begin|>from django.contrib import admin
# Register your models here.
from rcps.models import *
class IngredientToRecipeInline(admin.TabularInline):
model = Ingredient.recipes.through
verbose_name = 'Ингредиент'
verbose_name_plural = 'Ингредиенты'
class Equipm... | |
<|file_name|>dns-cache.js<|end_file_name|><|fim▁begin|>"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.DNSCache = exports.DNS_DEFAULT_EXPIRE = void 0;
var _dns = _interopRequireDefault(require("dns"));
var _net = _interopRequireDefault(require("net"));
var _logger = require(".... |
}
|
<|file_name|>include.py<|end_file_name|><|fim▁begin|>import util<|fim▁hole|>grid_margin_w = util.input.cfg_w / 6.0
grid_margin_h = util.input.cfg_h / 6.0
cell_w = util.input.cfg_w * 2.0 / 9.0
cell_h = util.input.cfg_h * 2.0 / 9.0
mark_none = []
mark_x = []
mark_o = []<|fim▁end|> | from util.include import *
|
<|file_name|>profile-controller.js<|end_file_name|><|fim▁begin|>angular.module('senseItWeb', null, null).controller('ProfileCtrl', function ($scope, OpenIdService, $state, fileReader) {
'use strict';
var _ = $scope._
, password_min = 6;
$scope.noyes = [
{value: '0', label: 'no'},
{value: '1', label: 'yes'... | |
<|file_name|>StaticContentWarTest.java<|end_file_name|><|fim▁begin|>/**
* Copyright 2015 Red Hat, Inc, and individual contributors.
*
* 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
*
* ... | import org.jboss.arquillian.container.test.api.Deployment;
import org.jboss.arquillian.container.test.api.RunAsClient; |
<|file_name|>newrankdlg.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
# Copyright (C) 2014 Daniele Simonetti
#
# 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 2 of the L... | |
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|><|fim▁hole|><|fim▁end|> | """ nenga.address.migrations module """ |
<|file_name|>editorGroupModel.test.ts<|end_file_name|><|fim▁begin|>/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information... | // Close to the left
if (direction === CloseDirection.LEFT) { |
<|file_name|>socket.rs<|end_file_name|><|fim▁begin|>use chan::{self, Sender, Receiver};
use json;
use serde::ser::Serialize;
use std::io::{BufReader, Read, Write};
use std::net::Shutdown;
use std::{fs, thread};
use unix_socket::{UnixListener, UnixStream};
use datatype::{Command, DownloadFailed, Error, Event};
use gate... | mod tests {
use super::*;
use crossbeam; |
<|file_name|>snrscript.py<|end_file_name|><|fim▁begin|>"""
Script for the paper
"""
import time
import numpy as np
import snr_of_images
import urllib
import zlib
from io import BytesIO
import cv2
import h5py
import os
import matplotlib.pyplot as plt
import json
import requests
from requests.packages.urllib3.exceptions ... | atum_snr = np.zeros(n_comp)
atum= OCP_data('kasthuri11',n_comp+10)
count = 0 |
<|file_name|>numerov.py<|end_file_name|><|fim▁begin|>import numpy
def numerov_integration(domain, a, f0, f1):
<|fim▁hole|> f = numpy.zeros(len(domain), dtype=numpy.complex)
f[0] = f0
f[1] = f1
step = domain.step
for i in range(2, len(domain)):
phi_i1 = f[i-1] * (2.0 + 5.0 * step**2 ... | |
<|file_name|>celery.py<|end_file_name|><|fim▁begin|>import os
from celery import Celery<|fim▁hole|>from django.conf import settings
# set the default Django settings module for the 'celery' program.
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'songaday_searcher.settings')
app = Celery('songaday_searcher')
app.conf... | |
<|file_name|>Condition.ts<|end_file_name|><|fim▁begin|>import { flatArgs } from './Query';
import type { Entity } from '../binding';
import type { Filter } from './Filter';
import { JsonMap } from '../util';
import type { GeoPoint } from '../GeoPoint';
/**
* The Condition interface defines all existing query filters
... | containsAll(field: string, ...args: any[]): Filter<T>
/**
* Adds a modulo filter to the field |
<|file_name|>version.ts<|end_file_name|><|fim▁begin|>import test from 'ava';
import * as proxyquire from 'proxyquire';
import * as sinon from 'sinon';
import { CLIOptions } from '../../../src/lib/types';
const actions = ({ version: true } as CLIOptions);
const logger = {
error() { },
log() { }
};
proxyquire(... | sinon.spy(logger, 'log');
sinon.spy(logger, 'error'); |
<|file_name|>manage.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
import os
import sys
if __name__ == "__main__":
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "djangorest.settings")
try:
from django.core.management import execute_from_command_line
except ImportError:
# The above ... | import django |
<|file_name|>RAD4SNPs_Main.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python
########################################################################## RAD4SNPs:##############################################################################
# A set of Python scripts to select and validate independent SNPs markers fr... | |
<|file_name|>paging.rs<|end_file_name|><|fim▁begin|>//! Description of the data-structures for IA-32e paging mode.
use core::fmt;
/// Represent a virtual (linear) memory address
#[derive(Copy, Clone, Debug, Eq, Ord, PartialEq, PartialOrd)]
pub struct VAddr(usize);
impl VAddr {
/// Convert to `usize`
pub cons... | |
<|file_name|>run.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python3
import os<|fim▁hole|>
from graftm.sequence_search_results import SequenceSearchResult
from graftm.graftm_output_paths import GraftMFiles
from graftm.search_table import SearchTableWriter
from graftm.sequence_searcher import SequenceSearcher
from g... | import logging
import tempfile
import shutil |
<|file_name|>utils.go<|end_file_name|><|fim▁begin|>package client
import (
"bytes"
"encoding/base64"
"encoding/json"
"errors"
"fmt"
"io"
"io/ioutil"
"net/http"
"net/url"
"os"
gosignal "os/signal"
"runtime"
"strconv"
"strings"
"time"
"github.com/Sirupsen/logrus"
"github.com/docker/docker/api"
"github... | }
func waitForExit(cli *DockerCli, containerID string) (int, error) {
serverResp, err := cli.call("POST", "/containers/"+containerID+"/wait", nil, nil) |
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|># jsb socket related plugins
#<|fim▁hole|>""" this package contains all the socket related plugins. """
import os
(f, tail) = os.path.split(__file__)
__all__ = []
for i in os.listdir(f):
if i.endswith('.py'):
__all__.append(i[:-3])
elif os.path.is... | #
|
<|file_name|>Improvement.js<|end_file_name|><|fim▁begin|>function Improvement(options) {
this.name = options.name;
this.image = options.image;
this.depth = options.depth || 0;
this.parent = options.parent;
this.children = options.children || [];
this.siblings = options.siblings || [];
this.toDisplay = op... | },
/* |
<|file_name|>receiver_unittest.cc<|end_file_name|><|fim▁begin|>/* Copyright (c) 2013 The WebRTC project authors. All Rights Reserved.
*
* Use of this source code is governed by a BSD-style license
* that can be found in the LICENSE file in the root of the source
* tree. An additional intellectual property right... | arrive_timestamps[i] =
(i + 1) * kFramePeriod + (i % 10) * ((i % 2) ? 1 : -1);
render_timestamps[i] = (i + 1) * kFramePeriod; |
<|file_name|>model_orchestra.py<|end_file_name|><|fim▁begin|># coding: utf-8
import re
import os
import ast
import luigi
import psycopg2
import boto3
import random
import sqlalchemy
import tempfile
import glob
import datetime
import subprocess
import pandas as pn
from luigi import six
from os.path import join, dirname... | cycli ./models/neo4j_scripts/centrality.neo4j
''' |
<|file_name|>helloworld.py<|end_file_name|><|fim▁begin|># helloworld.py
#
# familiar test program, demonstrating py2js conversion
def helloworld(suffix):
print "hello world"+suffix
<|fim▁hole|>helloworld("!")<|fim▁end|> | |
<|file_name|>Compression.java<|end_file_name|><|fim▁begin|>package org.jrenner.fps.utils;
import com.badlogic.gdx.utils.Array;
import org.jrenner.fps.Log;
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.util.zip.G... | } catch (IOException e) {
e.printStackTrace(); |
<|file_name|>mixins.py<|end_file_name|><|fim▁begin|>"""Form mixins for the ``multilingual_tags`` app."""
from django import forms
from django.forms.utils import ErrorList
from django.contrib.contenttypes.models import ContentType
from django.utils.text import slugify
from django.utils.translation import get_language, u... | if fieldname in self._errors:
self._errors[fieldname].append(message)
else: |
<|file_name|>deleteGlobalLoadBalancerRule.py<|end_file_name|><|fim▁begin|>"""Deletes a global load balancer rule."""
from baseCmd import *
from baseResponse import *
class deleteGlobalLoadBalancerRuleCmd (baseCmd):
typeInfo = {}
def __init__(self):
self.isAsync = "true"
"""the ID of the globa... | typeInfo = {}
def __init__(self):
"""any text associated with the success or failure""" |
<|file_name|>hazc_device.py<|end_file_name|><|fim▁begin|>#!/usr/local/bin/python3
from zeroconf import Zeroconf, ServiceInfo
import socket
import configparser
from . import hazc_cmd
# import pdb
class hazc_device:
#Forward constants
NO_PARAM = hazc_cmd.NO_PARAM
BOOL = hazc_cmd.BOOL
FLOAT = hazc_c... | rstr += ':' + self.paramtype_tostring(self.commands[key].paramtype)
rstr += ";"
return rstr |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.