prompt large_stringlengths 70 991k | completion large_stringlengths 0 1.02k |
|---|---|
<|file_name|>proxy.py<|end_file_name|><|fim▁begin|>"""An HTTP proxy that supports IPv6 as well as the HTTP CONNECT method, among
other things."""
# Standard libary imports
import socket
import thread
import select
__version__ = '0.1.0 Draft 1'
BUFFER_LENGTH = 8192
VERSION = 'Python Proxy/{}'.format(__version__)
HTTP_... | self.client_buffer = ''
self._read_write()
def method_others(self, method, path, protocol): |
<|file_name|>nodeUtils.ts<|end_file_name|><|fim▁begin|>/*
MIT License
Copyright (c) 2021 Looker Data Sciences, Inc.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, incl... | command: string,
args: string[],
errMsg?: string, |
<|file_name|>ha_myisam.cc<|end_file_name|><|fim▁begin|>/*
Copyright (c) 2000, 2012, Oracle and/or its affiliates. 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; vers... | for (element= file->s->in_use; element; element= list_rest(element))
{
THD *thd= (THD*) element->data; |
<|file_name|>urls.py<|end_file_name|><|fim▁begin|><|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 agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR C... | # Copyright 2008 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License. |
<|file_name|>oc_secret.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python # pylint: disable=too-many-lines
# ___ ___ _ _ ___ ___ _ _____ ___ ___
# / __| __| \| | __| _ \ /_\_ _| __| \
# | (_ | _|| .` | _|| / / _ \| | | _|| |) |
# \___|___|_|\_|___|_|_\/_/_\_\_|_|___|___/_ _____
# | \ / _ \... | else:
cmd.append('--selector=%s' % selector)
cmd.append('--schedulable=%s' % schedulable) |
<|file_name|>0018_auto_20141219_1711.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
<|fim▁hole|> ]
operations = [
migrations.RenameField(
model_name='commission... | dependencies = [
('public', '0017_auto_20141218_1813'), |
<|file_name|>StateGraphVisualizationDirective.js<|end_file_name|><|fim▁begin|>// Copyright 2014 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 the License at
//
... | // See the License for the specific language governing permissions and |
<|file_name|>settings.py<|end_file_name|><|fim▁begin|><|fim▁hole|>_TRACKING_USPS_URL = 'http://trkcnfrm1.smi.usps.com/PTSInternetWeb/InterLabelInquiry.do?origTrackNum='
TRACKING_USPS_URL = getattr(settings, 'OWNEY_USPS_TRACKING_URL', _TRACKING_USPS_URL)
_USPS_API_URL = 'http://production.shippingapis.com/ShippingAPI.d... | from django.conf import settings
|
<|file_name|>mod.rs<|end_file_name|><|fim▁begin|>/*
* Copyright (C) 2017 AltOS-Rust Team
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) ... | |
<|file_name|>shrinky.cc<|end_file_name|><|fim▁begin|>/*
MiracleGrue - Model Generator for toolpathing. <http://www.grue.makerbot.com>
Copyright (C) 2011 Far McKon <Far@makerbot.com>, Hugo Boyer (hugo@makerbot.com)
This program is free software: you can redistribute it and/or modify
it under the terms of t... | Scalar h = 2 * SCALAR_SQRT(s * (s - a)*(s - b)*(s - c)) / a; |
<|file_name|>export-named-specifiers.src.js<|end_file_name|><|fim▁begin|><|fim▁hole|><|fim▁end|> | export {foo, bar}; |
<|file_name|>cros_gralloc_helpers.cc<|end_file_name|><|fim▁begin|>/*
* Copyright 2016 The Chromium OS 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 "cros_gralloc_helpers.h"
#include <cstdlib>
#include <cutils/log.h>
... | if ((flags & sw_read()) == GRALLOC_USAGE_SW_READ_OFTEN) |
<|file_name|>internalAliasClassInsideLocalModuleWithExport.js<|end_file_name|><|fim▁begin|>//// [internalAliasClassInsideLocalModuleWithExport.js]
(function (x) {
var c = (function () {
function c() {
}
c.prototype.foo = function (a) {
return a;
};
return ... | export declare module x {
class c {
public foo(a: number): number;
}
|
<|file_name|>index.js<|end_file_name|><|fim▁begin|>var async = require('async');
function captainHook(schema) {
// Pre-Save Setup
schema.pre('validate', function (next) {
var self = this;
this._wasNew = this.isNew;
if (this.isNew) {
this.runPreMethods(schema.preCreateMethods, self, function(){
... |
schema.postCreate = function(fn){
schema.postCreateMethods.push(fn); |
<|file_name|>mbcharsetprober.py<|end_file_name|><|fim▁begin|># ####################### BEGIN LICENSE BLOCK ########################
# The Original Code is Mozilla Universal charset detector code.
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial D... |
self._mLastChar[0] = aBuf[aLen - 1]
if self.get_state() == constants.eDetecting: |
<|file_name|>LogoutBehaviour.java<|end_file_name|><|fim▁begin|>/*
* The MIT License
*
* Copyright 2015 Ryan Gilera.
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restrictio... | public class LogoutBehaviour implements Button.ClickListener {
|
<|file_name|>settings.py<|end_file_name|><|fim▁begin|>from awxkit.api.resources import resources
from . import base
from . import page
<|fim▁hole|>
page.register_page([resources.setting,
resources.settings_all,
resources.settings_authentication,
resources.se... | class Setting(base.Base):
pass |
<|file_name|>switch.py<|end_file_name|><|fim▁begin|>"""Support for Hydrawise cloud switches."""
import logging
import voluptuous as vol
from homeassistant.components.switch import PLATFORM_SCHEMA, SwitchDevice
from homeassistant.const import CONF_MONITORED_CONDITIONS
import homeassistant.helpers.config_validation as ... | |
<|file_name|>view_manager.ts<|end_file_name|><|fim▁begin|>import {
Injector,
Inject,
Provider,
Injectable,
ResolvedProvider,
forwardRef
} from 'angular2/src/core/di';
import {isPresent, isBlank, isArray} from 'angular2/src/facade/lang';
import {ListWrapper, StringMapWrapper} from 'angular2/src/facade/collec... | |
<|file_name|>complex_inner_join.rs<|end_file_name|><|fim▁begin|>extern crate rustorm;
extern crate uuid;
extern crate chrono;
extern crate rustc_serialize;
use uuid::Uuid;
use rustorm::query::Query;
use rustorm::query::Equality;
use rustorm::dao::{Dao, IsDao};
use rustorm::pool::ManagedPool;
#[derive(Debug, Clone)]
... | |
<|file_name|>ui_fiscal_icnfefetuarpagamento.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'ui_fiscal_icnfefetuarpagamento.ui'
#
# Created: Mon Nov 24 22:25:57 2014
# by: pyside-uic 0.2.15 running on PySide 1.2.2
#
# WARNING! All changes made in this f... | self.gridLayout.addWidget(self.labelForma, 0, 0, 1, 1)
self.verticalLayout.addLayout(self.gridLayout)
self.horizontalLayout = QtGui.QHBoxLayout()
self.horizontalLayout.setObjectName("horizontalLayout") |
<|file_name|>sys3_process.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
import win32process
import win32api
import win32con
import ctypes
import os, sys, string
TH32CS_SNAPPROCESS = 0x00000002
class PROCESSENTRY32(ctypes.Structure):
_fields_ = [("dwSize", ctypes.c_ulong),
... | return temp |
<|file_name|>main.rs<|end_file_name|><|fim▁begin|>// rscheme -- a scheme interpreter written in Rust
// Copyright (C) {2015) Elizabeth Henry <liz.henry@ouvaton.org>
// This program is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published b... | let mut line = String::new();
stdin.lock().read_line(&mut line).unwrap();
let cs = line.chars().collect(); |
<|file_name|>models.py<|end_file_name|><|fim▁begin|>import datetime
from django.db import models, transaction
class Key(models.Model):
uid = models.CharField(max_length=255, unique=True)
name = models.TextField()
created = models.DateTimeField(default=datetime.datetime.utcnow)
class Meta:
... | super(Key, self).save(*args, **kwargs)
if created:
from .tasks import update_or_create_key |
<|file_name|>shardcounter_sync.py<|end_file_name|><|fim▁begin|>import random
from google.appengine.api import memcache
from google.appengine.ext import ndb
SHARD_KEY_TEMPLATE = 'shard-{}-{:d}'
class GeneralCounterShardConfig(ndb.Model):
num_shards = ndb.IntegerProperty(default=20)
@classmethod
def all_k... | if counter is None:
counter = GeneralCounterShard(parent = parent_key, id=shard_key_string)
|
<|file_name|>cpuid.rs<|end_file_name|><|fim▁begin|>use std::str;
use std::slice;
use std::mem;
use byteorder::{LittleEndian, WriteBytesExt};
const VENDOR_INFO: u32 = 0x0;
const FEATURE_INFO: u32 = 0x1;
const EXT_FEATURE_INFO: u32 = 0x7;
const EXT_PROCESSOR_INFO: u32 = 0x80000001;
#[cfg(target_arch = "x86_64")]
pub f... | wtr.write_u32::<LittleEndian>(v.rcx).unwrap();
let string = String::from_utf8(wtr).unwrap();
assert!(string == "AuthenticAMD" || string == "GenuineIntel") |
<|file_name|>Mark.java<|end_file_name|><|fim▁begin|>package domain;
import java.util.Date;
/**
* @author Verbroucht Johann
* Test Java Date : 15 aot. 2011
*/
public class Mark {
private Date date;
private int mark;
public Mark(Date _date, int _mark) {
this.date = _date;
this.mark = _mar... | public int getMark() {
|
<|file_name|>16.d.ts<|end_file_name|><|fim▁begin|><|fim▁hole|><|fim▁end|> | export { Mpeg16 as default } from "../../"; |
<|file_name|>RemoveLogs.cpp<|end_file_name|><|fim▁begin|>// Mantid Repository : https://github.com/mantidproject/mantid
//
// Copyright © 2018 ISIS Rutherford Appleton Laboratory UKRI,
// NScD Oak Ridge National Laboratory, European Spallation Source
// & Institut Laue - Langevin
// SPDX - License - Identi... | #include "MantidDataObjects/Workspace2D.h"
#include "MantidKernel/ArrayProperty.h" |
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|>from os import path
<|fim▁hole|>
def get_html_theme_path():
"""Return list of HTML theme paths."""
cur_dir = path.abspath(path.dirname(path.dirname(__file__)))
return cur_dir
def setup(app):
app.add_html_theme(
'divio_docs_theme',
p... | __version__ = '0.0.22'
__version_full__ = __version__
|
<|file_name|>builtin.torrent.onstart.settorrentlabels.py<|end_file_name|><|fim▁begin|>from torrentstatus.plugin import iTorrentAction
from torrentstatus.utorrent.connection import Connection
from contextlib import contextmanager
from torrentstatus.bearlang import BearLang
from torrentstatus.settings import config, lab... | |
<|file_name|>cs2quiz1.py<|end_file_name|><|fim▁begin|>#40/40
#Part 1: Terminology (15 points) --> 15/15
#1 1pt) What is the symbol "=" used for?
#to assign and store values to and in variables
# 1pt
#
#2 3pts) Write a technical definition for 'function'
#a named sequence of calculations which takes input and returns ou... | #6 3pts) What are the 3 phases that every computer program has? What happens in
# each of them
# 1:input (the program takes some input values, most often from the user) |
<|file_name|>devops_borat.py<|end_file_name|><|fim▁begin|>from random import choice
from feedparser import parse
from errbot import botcmd, BotPlugin
class DevOpsBorat(BotPlugin):
"""
Quotes from various dev humour related twitter accounts
"""
@botcmd
def borat(self, mess, args):
"""
... | return choice(items).description |
<|file_name|>setup.py<|end_file_name|><|fim▁begin|>from setuptools import setup, find_packages
import sys, os<|fim▁hole|>used for publishing the summary statistics of Grape, a pipeline used for processing and
analyzing RNA-Seq data."""
setup(name='raisin.restyler',
version=version,
description="A package u... |
version = '1.3'
long_description = """The raisin.restyler package is a part of Raisin, the web application |
<|file_name|>css_parser.cpp<|end_file_name|><|fim▁begin|>/*
Copyright (C) 2003-2013 by Kristina Simpson <sweet.kristas@gmail.com>
This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages
arising from the use of this software.
Permiss... | return nullptr; |
<|file_name|>View.js<|end_file_name|><|fim▁begin|>/**
* Copyright (c) 2015-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the P... | * different parameters. The downside is that this can use up limited video |
<|file_name|>ob.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
# coding:utf-8
class Ob(object):
def __init__(self, *args, **kwds):
for i in args:
self.__dict__.update(args)
self.__dict__.update(kwds)
def __getattr__(self, name):
return self.__dict__.get(name, '')
... | # for k, v in o: |
<|file_name|>mouseCursor.ts<|end_file_name|><|fim▁begin|>/*---------------------------------------------------------------------------------------------<|fim▁hole|> * Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license informatio... | |
<|file_name|>root.js<|end_file_name|><|fim▁begin|>import { create } from 'ember-cli-page-object';
import leadershipCollapsed from 'ilios-common/page-objects/components/leadership-collapsed';
import overview from './overview';
import header from './header';
import leadershipExpanded from './leadership-expanded';<|fim▁ho... | |
<|file_name|>plugin_args.py<|end_file_name|><|fim▁begin|>import argparse
import ui.output
<|fim▁hole|>
def help_format_cloudcredgrab(prog):
kwargs = dict()
kwargs['width'] = ui.output.columns()
kwargs['max_help_position'] = 34
format = argparse.HelpFormatter(prog, **kwargs)
return (format)
def pars... | |
<|file_name|>dgen_test_output.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python
#
# Copyright (c) 2012 The Native Client Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
#
"""
Responsible for generating the testing decoders based on
par... | virtual bool ApplySanityChecks(nacl_arm_dec::Instruction inst,
const NamedClassDecoder& decoder);""" |
<|file_name|>app.component.ts<|end_file_name|><|fim▁begin|>import { Component } from '@angular/core';
import { AuthService } from './users/shared/auth.service';
@Component({
selector: 'app-root',
templateUrl: './app.component.html',
styleUrls: ['./app.component.css']
})<|fim▁hole|> }
}<|fim▁end|> | export class AppComponent {
title = 'app works!';
constructor(private authService:AuthService) {
|
<|file_name|>app.py<|end_file_name|><|fim▁begin|># 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 Canal TP (www.canaltp.fr... | |
<|file_name|>navbar.crtl.js<|end_file_name|><|fim▁begin|><|fim▁hole|>
$scope.logout = function () {
AuthenticationService.logout();
};
});<|fim▁end|> | 'use strict';
angular.module('baka')
.controller('NavbarCtrl', function ($scope, AuthenticationService) { |
<|file_name|>adc.py<|end_file_name|><|fim▁begin|>from simcore import *
comm.setADCValue(1,0,1,400)
comm.setADCValue(2,0,1,380)<|fim▁hole|>comm.setADCValue(5,0,1,412)
comm.setADCValue(6,0,1,425)
comm.setADCValue(7,0,1,445)
comm.setADCValue(8,0,1,429)<|fim▁end|> | comm.setADCValue(3,0,1,362)
comm.setADCValue(4,0,1,334) |
<|file_name|>index.js<|end_file_name|><|fim▁begin|>// Actions
export const ADD_NOTIFICATION = 'notifications/ADD_NOTIFICATION'
export const DISMISS_NOTIFICATION = 'notifications/DISMISS_NOTIFICATION'
export const CLEAR_NOTIFICATIONS = 'notifications/CLEAR_NOTIFICATIONS'
// Reducer
export const initialState = []
export... | notification.id = new Date().getTime()
}
return (dispatch, getState) => { |
<|file_name|>model.py<|end_file_name|><|fim▁begin|>import os
path = os.path.dirname(os.path.realpath(__file__))
sbmlFilePath = os.path.join(path, 'BIOMD0000000102.xml')
with open(sbmlFilePath,'r') as f:
sbmlString = f.read()
<|fim▁hole|> return False
else:
return True
if module_exists('libsbml... | def module_exists(module_name):
try:
__import__(module_name)
except ImportError: |
<|file_name|>DegenerativeVenom.ts<|end_file_name|><|fim▁begin|>import { Trait } from '../../../shared/models/trait';
export class DegenerativeVenom extends Trait {
static baseClass = 'Thief';<|fim▁hole|> static traitName = 'DegenerativeVenom';
static description = 'Your Venom spell will also lower the perception... | |
<|file_name|>new_tab.js<|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.
/**
* @fileoverview New tab page
* This is the main code for the new tab page used by touch-ena... | }
|
<|file_name|>test_meta_functions.py<|end_file_name|><|fim▁begin|>import unittest
class UnitParsingTest(unittest.TestCase):
def _assert_meters(self, tag_value, expected):
from vectordatasource.meta.function import mz_to_float_meters
parsed = mz_to_float_meters(tag_value)
if parsed is None... | |
<|file_name|>leaflet.browser.print.utils.js<|end_file_name|><|fim▁begin|>/**
MIT License http://www.opensource.org/licenses/mit-license.php
Author Igor Vladyka <igor.vladyka@gmail.com> (https://github.com/Igor-Vladyka/leaflet.browser.print)
**/
L.Control.BrowserPrint.Utils = {
_ignoreArray: [],
_cloneFactoryArra... |
this._knownRenderers = {}; |
<|file_name|>constants.rs<|end_file_name|><|fim▁begin|>// Copyright (C) 2013-2020 Blockstack PBC, a public benefit corporation
// Copyright (C) 2020 Stacks Open Internet Foundation<|fim▁hole|>// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the... | //
// This program is free software: you can redistribute it and/or modify |
<|file_name|>variadic-ffi.rs<|end_file_name|><|fim▁begin|>// Copyright 2013 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution and at
// http://rust-lang.org/COPYRIGHT.
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/li... | foo(1, 2, 1i16); //~ ERROR: can't pass i16 to variadic function, cast to c_int
foo(1, 2, 1u16); //~ ERROR: can't pass u16 to variadic function, cast to c_uint
} |
<|file_name|>GraphEdgeChangeEvent.java<|end_file_name|><|fim▁begin|>/* ==========================================
* JGraphT : a free Java graph-theory library
* ==========================================
*
* Project Info: http://jgrapht.sourceforge.net/
* Project Creator: Barak Naveh (http://sourceforge.net... | * from a graph.
*/
public static final int BEFORE_EDGE_REMOVED = 22;
|
<|file_name|>lightbox.js<|end_file_name|><|fim▁begin|>/*! UIkit 3.6.13 | https://www.getuikit.com | (c) 2014 - 2021 YOOtheme | MIT License */
(function (global, factory) {
typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory(require('uikit-util')) :
typeof define === 'functio... | return (selList + " " + (selSlides || '> *')); |
<|file_name|>myNode.py<|end_file_name|><|fim▁begin|>from lib.flowchart.nodes.generalNode import NodeWithCtrlWidget
class myNode(NodeWithCtrlWidget):
'''This is test docstring'''
nodeName = 'myTestNode'
uiTemplate = [{'name': 'HNO3', 'type': 'list', 'value': 'Closest Time'},
{'name': 'C... | def process(self, In):
print ('processing') |
<|file_name|>test_treecontroller.py<|end_file_name|><|fim▁begin|>import unittest
from robot.parsing.model import TestCase, TestCaseFile
from robot.utils.asserts import assert_equals
from robotide.controller.commands import ChangeTag
from robotide.controller.filecontrollers import TestCaseFileController
from robotide.co... | |
<|file_name|>renew_service.py<|end_file_name|><|fim▁begin|># Copyright (c) 2014 by Ecreall under licence AGPL terms
# available on http://www.gnu.org/licenses/agpl.html
# licence: AGPL
# author: Amen Souissi
from pyramid.view import view_config
from dace.processinstance.core import DEFAULTMAPPING_ACTIONS_VIEWS
fro... | template = 'lac:views/services_processes/selling_tickets_service/templates/alert_renew.pt'
def update(self): |
<|file_name|>AtbashSpec.ts<|end_file_name|><|fim▁begin|>import { Atbash } from "../../../main/decryptor/converters/Atbash";
import { Converter } from "../../../main/decryptor/converters/Converter";
describe("Atbash", () => {
describe("convert", () => {
it("converts empty string to empty string", () => {
... | it("converts only normal characters in mixed string", () => {
expect(new Atbash().convert("#12FooBar!")).toBe("#12UllYzi!"); |
<|file_name|>schema_test.go<|end_file_name|><|fim▁begin|>/*
Copyright 2011 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/LICENSE-2.0
Unless requir... | "time"
|
<|file_name|>dns_remove_reverse_record.py<|end_file_name|><|fim▁begin|>import subprocess, os, sys
from reverseZone_naming import reverseZone_name
from netaddr import *
zone_files_path="/etc/bind/zones"
def remove_reverse_record():
host_name_to_be_removed= sys.argv[1]
reverse_zone_file_name,reverse_zone_name=reverse... | |
<|file_name|>mobilenetv2.py<|end_file_name|><|fim▁begin|>'''MobileNetV2 in PyTorch.
See the paper "Inverted Residuals and Linear Bottlenecks:
Mobile Networks for Classification, Detection and Segmentation" for more details.
'''
import torch
import torch.nn as nn
import torch.nn.functional as F
class Block(nn.Module)... | cfg = [(1, 16, 1, 1),
(6, 24, 2, 1), # NOTE: change stride 2 -> 1 for CIFAR10
(6, 32, 3, 2), |
<|file_name|>wxr_feed.py<|end_file_name|><|fim▁begin|>import datetime
from django import template
from django.conf import settings
from django.contrib.contenttypes.models import ContentType
from django.contrib.sites.models import Site
from django.contrib.syndication.views import Feed, add_domain
from django.utils impo... | |
<|file_name|>alt-pattern-lit.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|>// option. This file may not be copied, modified, or distributed
// except according ... | //
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your |
<|file_name|>city-info.tsx<|end_file_name|><|fim▁begin|>import * as React from 'react';
import ICityInfoProps from './i-city-info-props';
import ICityInfoState from './i-city-info-state';
// import { UISref } from 'ui-router-react';
import * as moment from 'moment';
import { splitGrades } from '../../../utils';
import ... | |
<|file_name|>voter_star_on_save_doc.py<|end_file_name|><|fim▁begin|># apis_v1/documentation_source/voter_star_on_save_doc.py
# Brought to you by We Vote. Be good.
# -*- coding: UTF-8 -*-
def voter_star_on_save_doc_template_values(url_root):
"""
Show documentation about voterStarOnSave
"""
required_que... | |
<|file_name|>mod.rs<|end_file_name|><|fim▁begin|><|fim▁hole|><|fim▁end|> | pub mod fixed_property; |
<|file_name|>signup.js<|end_file_name|><|fim▁begin|>/*Copyright (c) Shelloid Systems LLP. All rights reserved.
The use and distribution terms for this software are covered by the
GNU Affero General Public License 3.0 (http://www.gnu.org/licenses/agpl-3.0.html)
which can be found in the file LICENSE at the root of this ... |
/** |
<|file_name|>package.js<|end_file_name|><|fim▁begin|>Package.describe({
summary: "Github OAuth flow",
version: "1.1.4-plugins.0"
});
Package.onUse(function(api) {
api.use('oauth2', ['client', 'server']);
api.use('oauth', ['client', 'server']);
api.use('http', ['server']);
api.use('underscore', 'client');
... | ['github_configure.html', 'github_configure.js'],
'client');
|
<|file_name|>testbench.go<|end_file_name|><|fim▁begin|>// Copyright 2020 The gVisor Authors.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICEN... |
// IsFuchsia returns true if the DUT is running Fuchsia.
func (n *DUTUname) IsFuchsia() bool {
return Native && n.OperatingSystem == "Fuchsia" |
<|file_name|>baseclass.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
##############################################################################
#
# diffpy.pyfullprof by DANSE Diffraction group
# Simon J. L. Billinge
# (c) 2010 Trustees of the Columbia University
# ... | #
# See AUTHORS.txt for a list of people who contributed.
# See LICENSE.txt for license information.
# |
<|file_name|>webpack.config.build.ci.js<|end_file_name|><|fim▁begin|>/*
Configures webpack to build only assets required
for integration environments.
*/
const webpack = require('webpack');
const merge = require('webpack-merge');
const { source, sourceAll } = require('../lib/path-helpers');
const ciBuildWorkflow ... | config.plugins = config.plugins.slice(1); |
<|file_name|>light.py<|end_file_name|><|fim▁begin|>"""Support for Nanoleaf Lights."""
import logging
import voluptuous as vol
from homeassistant.components.light import (
ATTR_BRIGHTNESS, ATTR_COLOR_TEMP, ATTR_EFFECT, ATTR_HS_COLOR,
ATTR_TRANSITION, PLATFORM_SCHEMA, SUPPORT_BRIGHTNESS,
SUPPORT_COLOR, SUPP... | from homeassistant.util.color import \
color_temperature_mired_to_kelvin as mired_to_kelvin |
<|file_name|>utils.py<|end_file_name|><|fim▁begin|>import email.utils
import collections
import time
import cgi
from .core import py3
if py3:
def parse_return(content):
if isinstance(content, str):
content = content.encode('utf-8', 'xmlcharrefreplace')
if isinstance(content, bytes):
... | return self[key].value
except KeyError: |
<|file_name|>aaf2xml.py<|end_file_name|><|fim▁begin|>import aaf<|fim▁hole|>(options, args) = parser.parse_args()
if not args:
parser.error("not enough argements")
path = args[0]
name, ext = os.path.splitext(path)
f = aaf.open(path, 'r')
f.save(name + ".xml")
f.close()<|fim▁end|> | import os
from optparse import OptionParser
parser = OptionParser() |
<|file_name|>dupefilter.py<|end_file_name|><|fim▁begin|>import logging
import time
from scrapy.dupefilters import BaseDupeFilter
from scrapy.utils.request import request_fingerprint
from . import defaults
from .connection import get_redis_from_settings
logger = logging.getLogger(__name__)
# TODO: Rename class to ... | @classmethod
def from_settings(cls, settings):
"""Returns an instance from given settings. |
<|file_name|>bench.rs<|end_file_name|><|fim▁begin|>use cargo::core::Workspace;
use cargo::ops;
use cargo::util::{CliResult, CliError, Human, Config, human};
use cargo::util::important_paths::{find_root_manifest_for_wd};
#[derive(RustcDecodable)]
pub struct Options {
flag_no_run: bool,
flag_package: Vec<String>... | Err(match err.exit.as_ref().and_then(|e| e.code()) {
Some(i) => CliError::new(human("bench failed"), i),
None => CliError::new(Box::new(Human(err)), 101) |
<|file_name|>core.module.ts<|end_file_name|><|fim▁begin|>import { NgModule } from '@angular/core';<|fim▁hole|>
@NgModule()
export class CoreModule { }<|fim▁end|> | |
<|file_name|>stickers.py<|end_file_name|><|fim▁begin|>LIKES={
'l': '369239383222810',
'm': '369239343222814',
's': '369239263222822'<|fim▁hole|>LIKES['medium'] =LIKES['m']
LIKES['small'] = LIKES['s']<|fim▁end|> | }
LIKES['large'] = LIKES['l'] |
<|file_name|>configment.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python<|fim▁hole|># Copyright 2014 Simone Campagna
#
# 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.ap... | # |
<|file_name|>app.js<|end_file_name|><|fim▁begin|>/***
* Copyright (c) 2013 John Krauss.
*
* This file is part of Crashmapper.
*
* Crashmapper 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... | this.about.$el.appendTo(this.$el).hide();
this.map = new Crashmapper.MapView({});
this.map.$el.appendTo(this.$el); |
<|file_name|>guitester.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python
# -*- encoding: utf-8; py-indent-offset: 4 -*-
# +------------------------------------------------------------------+
# | ____ _ _ __ __ _ __ |
# | / ___| |__ ___ ___| | __ | \/ | |/ /... |
def guitest_recording_active(self):
# Activated by symoblic link pointing to recording file
return os.path.lexists(defaults.var_dir + "/guitests/RECORD") and not \ |
<|file_name|>Class3_Sub28_Sub2.java<|end_file_name|><|fim▁begin|>final class Class3_Sub28_Sub2 extends Class3_Sub28 {
private static Class94 aClass94_3541 = Class3_Sub4.buildString("yellow:");
static int anInt3542;
private static Class94 aClass94_3543 = Class3_Sub4.buildString("Loading config )2 ");
s... | } catch (RuntimeException var3) {
|
<|file_name|>serve-signups-with-flask.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
import subprocess
import praw
from hashlib import sha1
from flask import Flask
from flask import Response
from flask import request
from cStringIO import StringIO
from base64 import b64encode
from base64 import b64decode
from C... | retireCommentHash(commentHash)
# if actionToTake == 'Signup and checkin': |
<|file_name|>types.ts<|end_file_name|><|fim▁begin|>// TYPESCRIPT TODO: move this to a larger shared types file, preferably within otp-ui
export interface StopData {
bikeRental: BikeRental
fetchStatus: number
id: string
lat: number
locationType: number
lon: number
name: string
nearbyStops: string[]
par... | stopTimesLastUpdated: number
vehicleRental: VehicleRental |
<|file_name|>add_loss_correctness_test.py<|end_file_name|><|fim▁begin|># Copyright 2019 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
#
# ht... |
outputs = MyLayer()([inputs, targets, sw])
model = Model([inputs, targets, sw], outputs)
model.predict([self.x, self.y, self.w]) |
<|file_name|>main.rs<|end_file_name|><|fim▁begin|>extern crate uu_readlink;
fn main() {<|fim▁hole|> std::process::exit(uu_readlink::uumain(std::env::args().collect()));
}<|fim▁end|> | |
<|file_name|>lib.rs<|end_file_name|><|fim▁begin|>//! Bindings for [netfilter_queue](http://netfilter.org/projects/libnetfilter_queue/doxygen/index.html)
//!
//! These bindings allow you to have access to the `QUEUE` and `NFQUEUE`, set in `iptables`,
//! and write your own userspace programs to process these queues.
#![... |
extern crate libc;
extern crate num; |
<|file_name|>object-streams.js<|end_file_name|><|fim▁begin|>var PassThrough = require('stream').PassThrough
describe('Object Streams', function () {
it('should be supported', function (done) {
var app = koala()
app.use(function* (next) {
var body = this.body = new PassThrough({
objectMode: true... |
body.end() |
<|file_name|>test_cover.py<|end_file_name|><|fim▁begin|>"""Tests for the Bond cover device."""
from datetime import timedelta
from bond_api import Action, DeviceType
from homeassistant import core
from homeassistant.components.cover import DOMAIN as COVER_DOMAIN
from homeassistant.const import (
ATTR_ENTITY_ID,
... | """Tests that update command sets correct state when Bond API reports cover is closed."""
await setup_platform(hass, COVER_DOMAIN, shades("name-1"))
with patch_bond_device_state(return_value={"open": 0}): |
<|file_name|>issue-53789-2.rs<|end_file_name|><|fim▁begin|>// Regression test for #53789.
//
// compile-pass
#![feature(nll)]
#![allow(unused_variables)]
use std::collections::BTreeMap;
use std::ops::Range;
use std::cmp::Ord;
macro_rules! valuetree {
() => {
type ValueTree =
<Self::Strategy a... | |
<|file_name|>speakers.rs<|end_file_name|><|fim▁begin|>// Cala
// Copyright © 2017-2021 Jeron Aldaron Lau.
//
// Licensed under any of:<|fim▁hole|>// - MIT License (https://mit-license.org/)
// - Boost Software License, Version 1.0 (https://www.boost.org/LICENSE_1_0.txt)
// At your choosing (See accompanying files LICEN... | // - Apache License, Version 2.0 (https://www.apache.org/licenses/LICENSE-2.0) |
<|file_name|>type-punctuation.rs<|end_file_name|><|fim▁begin|><|fim▁hole|>
fn Foo<T = Foo, Output = Expr<'tcx> + Foo>() {
let i = 6;
}<|fim▁end|> | // rustfmt-type_punctuation_density: Compressed |
<|file_name|>Calendar.js<|end_file_name|><|fim▁begin|>var EPOCH = 1900;
var PATTERN = /(\d+)[^\/|-]/g;
function iskabisat(year) {
if(year % 4 === 0){
if(year % 100 === 0 && year % 400 !== 0)
return false;
else
return true;
}
return false;
}
/*
* kabisats:
* Calculating how many kabisats'... | |
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|># Copyright © 2017 Collabora Ltd.
#
# This file is part of pfg.
#
# pfg 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 2.1 of the Li... | # You should have received a copy of the GNU Lesser General Public License
# along with pfg. If not, see <http://www.gnu.org/licenses/>.
# |
<|file_name|>cnc.py<|end_file_name|><|fim▁begin|>import serial
import sys
from time import sleep
def move(dir):
print dir
ser.write(dir) # write a string
ser.sendBreak(0.25)
ser.flush()
sleep(1)
def ResetCoords():
dir = 'r'
print dir
ser.write(dir) # write a string
ser.sendBreak(... | return 0
def ClosePort():
|
<|file_name|>out_parameters.rs<|end_file_name|><|fim▁begin|>use crate::{
analysis::{
self, conversion_type::ConversionType, function_parameters::CParameter,
functions::is_carray_with_direct_elements, imports::Imports, return_value,
rust_type::RustType,
},
config::{self, parameter_mat... |
let nullable_override = configured_functions.iter().find_map(|f| f.ret.nullable);
if func.throws {
let use_ret = use_return_value_for_result(env, func_ret, &func.name, configured_functions); |
<|file_name|>bitcoin_uk.ts<|end_file_name|><|fim▁begin|><?xml version="1.0" ?><!DOCTYPE TS><TS language="uk" version="2.1">
<context>
<name>AboutDialog</name>
<message>
<source>About UnattainiumV2 Core</source>
<translation type="unfinished"/>
</message>
<message>
<source><b&g... | |
<|file_name|>test_utils.py<|end_file_name|><|fim▁begin|>from decimal import Decimal
import ddt
from babel.numbers import format_currency
from django.conf import settings
from django.utils.translation import get_language, to_locale
from oscar.core.loading import get_model
from oscar.test.factories import * # pylint:d... | |
<|file_name|>datastructures.py<|end_file_name|><|fim▁begin|>import copy
from collections import OrderedDict
from collections.abc import Mapping
class OrderedSet:
"""
A set which keeps the ordering of the inserted items.
Currently backs onto OrderedDict.
"""
def __init__(self, iterable=None):
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.