prompt large_stringlengths 70 991k | completion large_stringlengths 0 1.02k |
|---|---|
<|file_name|>row.rs<|end_file_name|><|fim▁begin|>use fallible_iterator::FallibleIterator;
use fallible_streaming_iterator::FallibleStreamingIterator;
use std::convert;
use super::{Error, Result, Statement};
use crate::types::{FromSql, FromSqlError, ValueRef};
/// An handle for the resulting rows of a query.
#[must_us... | 10,
11,
12,
13, |
<|file_name|>classes_5.js<|end_file_name|><|fim▁begin|><|fim▁hole|>];<|fim▁end|> | var searchData=
[
['rgb',['Rgb',['../structarctic_1_1_rgb.html',1,'arctic']]],
['rgba',['Rgba',['../structarctic_1_1easy_1_1_rgba.html',1,'arctic::easy']]] |
<|file_name|>blob_url_store.rs<|end_file_name|><|fim▁begin|>/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */<|fim▁hole|>use std::str::FromStr;
use url::Url;
use uu... |
use crate::filemanager_thread::FileOrigin;
use servo_url::ServoUrl; |
<|file_name|>equalcolumnheight.js<|end_file_name|><|fim▁begin|>/*
* equalcolumnheight
* https://github.com/mortennajbjerg/jquery.equalcolumnheight
*
* Copyright (c) 2013 Morten Najbjerg
* Licensed under the GPLv3 license.
*/
(function($) {
$.fn.equalcolumnheight = function() {
var $this = $(this)... | |
<|file_name|>assert_.py<|end_file_name|><|fim▁begin|>from functions.str import w_str
from wtypes.control import WEvalRequired, WRaisedException, WReturnValue
from wtypes.exception import WException
from wtypes.magic_macro import WMagicMacro
from wtypes.boolean import WBoolean
class WAssert(WMagicMacro):
def call_... | return WEvalRequired(expr=expr, callback=callback) |
<|file_name|>0001_initial.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
]
operations = [
migrations.CreateModel(
name='Stat',
... | ('date', models.DateTimeField(auto_now_add=True)),
('up', models.BigIntegerField()),
('down', models.BigIntegerField()),
('live_time', models.BigIntegerField()), |
<|file_name|>testem.js<|end_file_name|><|fim▁begin|>module.exports = {
framework: 'qunit',
test_page: 'tests/index.html?hidepassed',
disable_watching: true,
launch_in_ci: [
'Chrome'
],
launch_in_dev: [
'Chrome'
],
browser_args: {
Chrome: {
mode: 'ci',
args: [
// --no-sand... | '--headless',
'--no-sandbox',
'--remote-debugging-port=9222',
'--window-size=1440,900' |
<|file_name|>index.js<|end_file_name|><|fim▁begin|>/*jslint node: true */
'use strict';
var _ = require('underscore.string'),<|fim▁hole|> path = require('path'),
chalk = require('chalk-log');
module.exports = function() {
return function (done) {
var prompts = [{
name: ... | inquirer = require('inquirer'), |
<|file_name|>TwaSplashController.java<|end_file_name|><|fim▁begin|>// Copyright 2019 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.
package org.chromium.chrome.browser.browserservices.ui.splashscreen.trustedwebactivity;... | }
/** |
<|file_name|>overlay_scroll_bar.cc<|end_file_name|><|fim▁begin|>// Copyright 2013 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "ui/views/controls/scrollbar/overlay_scroll_bar.h"
#include <memory>
#include "... | #include "base/macros.h"
#include "cc/paint/paint_flags.h" |
<|file_name|>lib.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/. */
#![crate_name = "canvas_traits"]
#![crate_type = "rlib"]
#![featu... | ClearRect(Rect<f32>),
Clip,
ClosePath,
Fill, |
<|file_name|>accounts_payable.py<|end_file_name|><|fim▁begin|># Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt<|fim▁hole|>
def execute(filters=None):
args = {
"party_type": "Supplier",
"naming_by": ["Buying Settings", "supp_master_nam... |
from __future__ import unicode_literals
import frappe
from erpnext.accounts.report.accounts_receivable.accounts_receivable import ReceivablePayableReport |
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|># -*- coding:utf-8 -*-
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2010 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.<|fim▁hole|># Licensed under the Apache License, Version 2.0 (... | # Copyright (c) 2012 Samsung SDS Co., LTD
# All Rights Reserved.
# |
<|file_name|>mayatestcase.py<|end_file_name|><|fim▁begin|>"""This is a really rough implementation but demonstrates the
core ideas."""<|fim▁hole|>import os
import unittest
try:
import maya
ISMAYA = True
except ImportError:
maya, ISMAYA = None, False
from mayaserver.client import start_process, create_clien... | |
<|file_name|>0001_initial.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
# Generated by Django 1.9.1 on 2016-02-04 05:22
from __future__ import unicode_literals
from django.conf import settings
import django.core.validators<|fim▁hole|>
class Migration(migrations.Migration):
initial = True
dependenc... | from django.db import migrations, models
import django.db.models.deletion |
<|file_name|>metadata-sufficient-for-layout.rs<|end_file_name|><|fim▁begin|>// compile-flags: --emit metadata
#![feature(generators, generator_trait)]
use std::marker::Unpin;
use std::ops::Generator;
pub fn g() -> impl Generator<(), Yield = (), Return = ()> {
|| {<|fim▁hole|> yield;
}
}<|fim▁end|> | |
<|file_name|>simple_test.go<|end_file_name|><|fim▁begin|>// Copyright 2012, 2013 Canonical Ltd.
// Licensed under the AGPLv3, see LICENCE file for details.
package deployer_test
import (
"encoding/json"
"io/ioutil"<|fim▁hole|> "sort"
jc "github.com/juju/testing/checkers"
"github.com/juju/utils/arch"
"github.com... | "os"
"path/filepath"
"regexp"
"runtime" |
<|file_name|>depends.go<|end_file_name|><|fim▁begin|>package depends
import (
"fmt"
"sync"
logutil "github.com/docker/infrakit/pkg/log"
"github.com/docker/infrakit/pkg/types"
)
var log = logutil.New("module", "run/depends")
// ParseDependsFunc returns a list of dependencies of this spec.
type ParseDependsFunc f... | for _, parse := range m { |
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|><|fim▁hole|>from ..version_info import PY2
if PY2:
from . import dumb, gnu, ndbm
from whichdb import *
from anydbm import *<|fim▁end|> | from __future__ import absolute_import
from dbm import *
|
<|file_name|>Main.js<|end_file_name|><|fim▁begin|>import React from 'react';
import PropTypes from 'prop-types';
import Button from 'components/Button';
Main.propTypes = {
showLoginForm: PropTypes.func.isRequired,
showSignUpForm: PropTypes.func.isRequired
};
export default function Main({ showLoginForm, showSignU... | <Button
color="logoBlue"
style={{ display: 'block', fontSize: '2.5rem', padding: '1rem' }} |
<|file_name|>qualifications.js<|end_file_name|><|fim▁begin|>/* exported Qualifications */
function Qualifications(skills, items) {
var requirements = {
'soldier': {
meta: {
passPercentage: 100
},
classes: {
'Heavy Assault': {
certifications: [
{ skill: skills.heavyAssault.flakArm... | equipment: []
}, |
<|file_name|>audioRecorder.d.ts<|end_file_name|><|fim▁begin|>import JitsiConference from '../../JitsiConference';
import JitsiTrack from '../RTC/JitsiTrack';
export class AudioRecorder {
constructor( jitsiConference: JitsiConference );
determineCorrectFileType: unknown; // TODO:
addTrack: ( track: JitsiTrack ) =... | start: () => void;
stop: () => void;
download: () => void;
getRecordingResults: () => Array<unknown>; // TODO: |
<|file_name|>test_pep277.py<|end_file_name|><|fim▁begin|># Test the Unicode versions of normal file functions
# open, os.open, os.stat. os.listdir, os.rename, os.remove, os.mkdir, os.chdir, os.rmdir
import sys, os, unittest
from unicodedata import normalize
from test import test_support
filenames = [
'1_abc... | |
<|file_name|>user-uuid-store.js<|end_file_name|><|fim▁begin|>/*!
* Copyright (c) 2015-2017 Cisco Systems, Inc. See LICENSE file.
*/
import {patterns} from '@ciscospark/common';
const usersByEmail = new WeakMap();
const usersById = new WeakMap();
<|fim▁hole|>/**
* @class
*/
export default class UserUUIDStore {
/... | |
<|file_name|>mod.rs<|end_file_name|><|fim▁begin|>// Copyright (c) 2016 Tibor Benke <ihrwein@gmail.com>
//
// 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
// option. All ... | }
|
<|file_name|>feature_column_lib.py<|end_file_name|><|fim▁begin|># Copyright 2017 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://ww... | |
<|file_name|>authorActions.js<|end_file_name|><|fim▁begin|>import authorAPI from '../api/mock/mockAuthorAPI';
import * as types from './actionTypes';
import { beginAjaxCall } from './ajaxStatusActions';
const loadAuthorSuccess = (courses) => {<|fim▁hole|> return {type : types.LOAD_AUTHOR_SUCCESS, courses };
};
const... | |
<|file_name|>stack-probes.rs<|end_file_name|><|fim▁begin|>// ignore-arm
// ignore-aarch64
// ignore-mips
// ignore-mips64
// ignore-powerpc
// ignore-powerpc64
// ignore-powerpc64le
// ignore-riscv64
// ignore-s390x
// ignore-sparc
// ignore-sparc64
// ignore-wasm
// ignore-emscripten
// ignore-windows
// compile-flags... |
#[no_mangle] |
<|file_name|>test_mincu_spider.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
import os
import unittest
from manolo_scraper.spiders.mincu import MincuSpider
from utils import fake_response_from_file
class TestMincuSpider(unittest.TestCase):
def setUp(self):
self.spider = MincuSpider()
def ... | self.assertEqual(item.get('office'), u'QHAPAQ ÑAN') |
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|>"""Base command for search-related management commands."""
from __future__ import annotations
import argparse
import builtins
import logging
from typing import Any, Optional, Union
from django.core.management.base import BaseCommand
from elasticsearch.exceptions i... | def _confirm_action(self) -> bool: |
<|file_name|>rpc.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 euclid::{Point2D, Rect};
use script_traits... | }
impl OffsetParentResponse { |
<|file_name|>create_general_release.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
# (c) Copyright IBM Corp. 2021
# (c) Copyright Instana Inc. 2020
# Script to make a new python-sensor release on Github
# Requires the Github CLI to be installed and configured: https://github.com/cli/cli
import os
import sys
i... | response = check_output(["gh", "release", "create", semantic_version,
"-d", # draft |
<|file_name|>dbmanager.cpp<|end_file_name|><|fim▁begin|>#include "dbmanager.h"
//=============================================================================================================================
//=================================================CONSTUCTOR==========================================... |
int DbManager::getEmulatorOpenedCounter(QString emulatorName)
|
<|file_name|>spatial_transformer.py<|end_file_name|><|fim▁begin|># Copyright 2017 The Sonnet 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.ap... | if len(self._output_shape) > len(self._source_shape):
raise base.Error('Output domain dimensionality ({}) must be equal or ' |
<|file_name|>CVE-2011-2005.py<|end_file_name|><|fim▁begin|>################################################################################
######### MS11-080 - CVE-2011-2005 Afd.sys Privilege Escalation Exploit ########
######### Author: ryujin@offsec.com - Matteo Memelli ########
######### ... | _UPID = "\x84"
_APLINKS = "\x88"
else:
_KPROCESS = "\x38"
|
<|file_name|>systems.py<|end_file_name|><|fim▁begin|># Copyright 2015 Amazon.com, Inc. or its affiliates. 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. A copy of
# the License is located at
#
# http://aws.a... | )
|
<|file_name|>index.test-d.ts<|end_file_name|><|fim▁begin|>import http from 'node:http';
import {expectType} from 'tsd';
import decompressResponse, {UncompressedIncomingMessage} from './index.js';
http.get('localhost', response => {
expectType<UncompressedIncomingMessage>(decompressResponse(response));<|fim▁hole|><|fi... | }); |
<|file_name|>get_autonomous_patch_request_response.go<|end_file_name|><|fim▁begin|><|fim▁hole|>package database
import (
"github.com/oracle/oci-go-sdk/v46/common"
"net/http"
)
// GetAutonomousPatchRequest wrapper for the GetAutonomousPatch operation
//
// See also
//
// Click https://docs.cloud.oracle.com/en-us/iaa... | // Copyright (c) 2016, 2018, 2021, Oracle and/or its affiliates. All rights reserved.
// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose ei... |
<|file_name|>Nikon_D7000.py<|end_file_name|><|fim▁begin|>import bpy
bpy.context.object.data.sensor_width = 23.6
bpy.context.object.data.sensor_height = 15.6<|fim▁hole|>bpy.context.object.data.sensor_fit = 'HORIZONTAL'<|fim▁end|> | |
<|file_name|>BagModel.java<|end_file_name|><|fim▁begin|>/*
* Copyright [2016-2020] [George Papadakis (gpapadis@yahoo.gr)]
*
* 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://... | protected float getNoOfTotalTerms() {
return noOfTotalTerms;
|
<|file_name|>stock_picking.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo import models, api, fields<|fim▁hole|>from odoo.tools.translate import _
class StockPicking(models.Model):
_inherit = 'stock.picking'
websit... | |
<|file_name|>main.go<|end_file_name|><|fim▁begin|>// Try CodeIQ Q3264
// author: Leonardone @ NEETSDKASU
package main
import (
"fmt"
"strings"
)
func Solve(target string, words []string) (ans []string) {
for _, w := range words {
switch {
case w == target:
ans = append(ans, "["+w+"]")
case strings.Contain... | fmt.Print(" ")
} |
<|file_name|>setup.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python<|fim▁hole|>from setuptools import setup, find_packages
with open('README.rst') as readme_file:
README = readme_file.read()
with open('HISTORY.rst') as history_file:
HISTORY = history_file.read()
REQUIREMENTS = [
'gitpython',
're... | # -*- coding: utf-8 -*-
|
<|file_name|>ABsgCoachWebPage.java<|end_file_name|><|fim▁begin|>package com.bsgcoach.web;
import javax.annotation.concurrent.NotThreadSafe;
import org.apache.wicket.Page;
import org.apache.wicket.markup.head.CssHeaderItem;
import org.apache.wicket.markup.head.IHeaderResponse;
import org.apache.wicket.markup.head.Java... | |
<|file_name|>io.rs<|end_file_name|><|fim▁begin|>extern crate hyper;
extern crate par;
use std::io::{self, Read};
use hyper::Client;
use hyper::header::{ContentLength, Connection, UserAgent};
use par::{Bar, Reader};
fn main() {
let client = Client::new();
let mut res = client.get("https://api.github.com/users/... | |
<|file_name|>simplewebserver.py<|end_file_name|><|fim▁begin|>import BaseHTTPServer
import cgi
import ctypes
import os
import sys
import threading
from PySide import QtGui
import MaxPlus
PORT = 8000
class MyThread(threading.Thread):
def __init__(self):
threading.Thread.__init__(self)
self.exitin... | |
<|file_name|>backends.py<|end_file_name|><|fim▁begin|>from django.contrib.auth.backends import ModelBackend
# Live sessions will still be using this backend for a while.
# TODO: Remove after there are no more sessions using this in prod.
class Sha256Backend(ModelBackend):
"""Overriding the Django model backend wi... | pass |
<|file_name|>base_consumer.rs<|end_file_name|><|fim▁begin|>//! Low-level consumers.
use std::cmp;
use std::ffi::CString;
use std::mem::ManuallyDrop;
use std::os::raw::c_void;
use std::ptr;
use std::sync::Arc;
use rdkafka_sys as rdsys;
use rdkafka_sys::types::*;
use crate::client::{Client, NativeClient, NativeQueue};... | /// ```rust,no_run
/// # let consumer: rdkafka::consumer::BaseConsumer<_> = rdkafka::ClientConfig::new() |
<|file_name|>correlated_values.py<|end_file_name|><|fim▁begin|>from __future__ import absolute_import
import uncertainties as U
from .. import asrootpy
__all__ = [
'as_ufloat',
'correlated_values',
]
def as_ufloat(roorealvar):
"""
Cast a `RooRealVar` to an `uncertainties.ufloat`
"""
if isin... | |
<|file_name|>views.py<|end_file_name|><|fim▁begin|>from django.contrib.sites.models import RequestSite
from django.shortcuts import render
from django.conf import settings
from django.db.models import Q
from django.core.urlresolvers import reverse<|fim▁hole|>from airmozilla.main.models import Channel, Event
from airmoz... | |
<|file_name|>py_class_impl3.rs<|end_file_name|><|fim▁begin|>// Copyright (c) 2016-2021 Daniel Grunwald
//
// 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, including wit... | sdi_delitem: { $crate::py_class_binary_slot!($class::__delitem__, [&$key_name], $crate::_detail::libc::c_int, $crate::py_class::slots::UnitCallbackConverter) },
] |
<|file_name|>trait-inheritance-call-bound-inherited.rs<|end_file_name|><|fim▁begin|>// Copyright 2012 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution and at
// http://rust-lang.org/COPYRIGHT.
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
/... | let a = &A { x: 3 };
assert!(gg(a) == 10);
} |
<|file_name|>verify.js<|end_file_name|><|fim▁begin|>module.exports = function verify(check) {
if (typeof check !== 'object') {
throw new Error('check is not an object');
}
var errors = [];
Object.keys(check).forEach(_verify, check);
if (errors.length > 0) {
throw new Error('Health... | |
<|file_name|>test_file_metadata.py<|end_file_name|><|fim▁begin|>import json
import pytest
import jsonschema
from framework.auth.core import Auth
from framework.exceptions import PermissionsError
from website.settings import DOI_FORMAT, DATACITE_PREFIX
from website.project.licenses import set_license
from osf.models im... | # validate record with all user entered metadata
assert jsonschema.validate(
inject_placeholder_doi(json_data),
record.schema.schema |
<|file_name|>util.rs<|end_file_name|><|fim▁begin|>use std::io::{self, Result, Read, Write, ErrorKind};
//copy with length limiting
pub fn copy<R: Read, W: Write>(r: &mut R, w: &mut W, len_max: u64) -> io::Result<u64> {
let mut buf = [0; 1024];
let mut written : u64 = 0;
while written < len_max {
let len = matc... | Err(e) => return Err(e),
};
if (written+len as u64) < len_max { |
<|file_name|>vizquery.py<|end_file_name|><|fim▁begin|>from chimera.util.votable import VOTable
from httplib import HTTPConnection
import tempfile
import os
import urllib
class VizQuery(object):
"""
Queries A catalog in Vizier
within a given radius or box of the zenith
"""
def __init__(self):
... | f.close()
obj = [] |
<|file_name|>main.rs<|end_file_name|><|fim▁begin|>use std::fs;
use std::io;
use std::io::Read;
use clap::{App, Arg};
mod llvm_runner;
mod optimizer;
mod parser;
mod runner;
mod structs;
#[cfg(feature = "llvm")]
use llvm_runner::LlvmState;
use parser::parse;
use runner::State;
use structs::OpStream;
fn main() {
... | #[cfg(feature = "llvm")]
let app = app.arg(
Arg::with_name("llvm")
.short("l") |
<|file_name|>setup.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
# -*- coding: utf-8 -*-
from setuptools import setup, find_packages
from codecs import open
from os import path
here = path.abspath(path.dirname(__file__))
with open(path.join(here, 'README.rst'), encoding='utf-8') as f:
readme = f.read()
... | 'License :: OSI Approved :: MIT License',
'Natural Language :: French', |
<|file_name|>settings.py<|end_file_name|><|fim▁begin|>"""
Django settings for ghost_project project.
For more information on this file, see
https://docs.djangoproject.com/en/1.6/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.6/ref/settings/
"""
# Build paths ... | 'django.contrib.messages.middleware.MessageMiddleware',
'django.middleware.clickjacking.XFrameOptionsMiddleware', |
<|file_name|>james.py<|end_file_name|><|fim▁begin|>from telnetlib import Telnet
class James:
def __init__(self, app):
self.app = app
def ensure_user_exists(self, username, password):
james_config = self.app.config['james']
session = James.Session(james_config['host'], james_config['p... | |
<|file_name|>fakeenv_test.go<|end_file_name|><|fim▁begin|>// Copyright 2014 Canonical Ltd.
// Licensed under the AGPLv3, see LICENCE file for details.
package model_test
import (
"errors"
gc "gopkg.in/check.v1"
"gopkg.in/juju/names.v2"
"github.com/juju/juju/api"
jujucloud "github.com/juju/juju/cloud"
"github.... | api.Connection
} |
<|file_name|>el.js<|end_file_name|><|fim▁begin|>/*
Load a block from github.io.
Accepts a url as a parameter which can include url parameters e.g. https://megjlow.github.io/extension2.js?name=SUN&ip=10.0.0.1
*/
new (function() {
var ext = this;
var descriptor = {
blocks: [
[' ', 'Load extens... |
}); |
<|file_name|>transaction.component.js<|end_file_name|><|fim▁begin|>"use strict";
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
if (typeof Refle... | _this.bankAccountDisabled = false;
break;
case 1: |
<|file_name|>main.rs<|end_file_name|><|fim▁begin|>// --- Day 7: Internet Protocol Version 7 ---
//
// While snooping around the local network of EBHQ, you compile a list of IP addresses (they're IPv7, of course; IPv6 is much too limited). You'd like to figure out which IPs support TLS (transport-layer snooping).
//
// ... | |
<|file_name|>mat.rs<|end_file_name|><|fim▁begin|>use num::Float;
use std::fmt;
use std::ops::{Add, Sub, Mul};
use numvec::Vec3f;
/// The type of matrix elements.
pub type Scalar = f32;
/// A 4x4 matrix type stored in column-major order for interoperability with
/// OpenGL.
///
/// Supports the creation of isometries... | |
<|file_name|>wildcard.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
#
# Cheroke-admin
#
# Authors:
# Alvaro Lopez Ortega <alvaro@alobbs.com>
#
# Copyright (C) 2009-2010 Alvaro Lopez Ortega
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of version 2 of the GN... | dialog += submit
self += dialog
|
<|file_name|>ArtistSeriesArtworksFilter.tsx<|end_file_name|><|fim▁begin|>import { ArtistSeriesArtworksFilter_artistSeries } from "v2/__generated__/ArtistSeriesArtworksFilter_artistSeries.graphql"
import { BaseArtworkFilter } from "v2/Components/v2/ArtworkFilter"
import { ArtworkFilterContextProvider } from "v2/Componen... | $offerable: Boolean
$page: Int |
<|file_name|>rfc3596.rs<|end_file_name|><|fim▁begin|>//! Record data from [RFC 3596].
//!
//! This RFC defines the Aaaa record type.
//!
//! [RFC 3596]: https://tools.ietf.org/html/rfc3596
use std::fmt;
use std::net::Ipv6Addr;
use std::str::FromStr;
use ::bits::{Composable, Composer, ComposeResult, DNameSlice, ParsedR... | }
impl fmt::Display for Aaaa { |
<|file_name|>command.rs<|end_file_name|><|fim▁begin|>use irc_lib::client::data::Message;
pub enum Command {
Join {
channel: String,<|fim▁hole|> message: Option<String>,
},
PrivMsg {
target: String,
message: String,
},
Quit {
message: Option<String>,
},
... | },
Part {
channel: String, |
<|file_name|>poll.rs<|end_file_name|><|fim▁begin|>#[cfg(any(target_os = "android", target_os = "dragonfly", target_os = "freebsd", target_os = "linux"))]
use sys::time::TimeSpec;
#[cfg(any(target_os = "android", target_os = "dragonfly", target_os = "freebsd", target_os = "linux"))]
use sys::signal::SigSet;
use std::os:... | pub struct EventFlags: libc::c_short {
/// There is data to read. |
<|file_name|>push.js<|end_file_name|><|fim▁begin|>/* ----------------------------------
* PUSH v2.0.0
* Licensed under The MIT License
* inspired by chris's jquery.pjax.js
* http://opensource.org/licenses/MIT
* ---------------------------------- */
!function () {
var noop = function () {};
// Pushstate cac... | if (
! target
|| e.which > 1 |
<|file_name|>liveness-swap-uninit.rs<|end_file_name|><|fim▁begin|>// Copyright 2012 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution and at
// http://rust-lang.org/COPYRIGHT.
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apach... | // option. This file may not be copied, modified, or distributed
// except according to those terms.
|
<|file_name|>redirection.py<|end_file_name|><|fim▁begin|>import string<|fim▁hole|>import uuid
import random
from util import iDict
import exception
# Nothing is validating the Redir section in the xml. I may get nonexistent
# params.
#
__all__ = ['RedirectionManager', 'LocalRedirection', 'RemoteRedirection']
def ... | |
<|file_name|>rule.rs<|end_file_name|><|fim▁begin|>use crate::model::path::Path;
use crate::model::path_pattern::PathPattern;
/// A rule line is a single "Allow:" (allowance==True) or "Disallow:"
/// (allowance==False) followed by a path."""
#[derive(Debug, Clone)]
pub struct Rule {
path_pattern: PathPattern,
a... | }
} |
<|file_name|>parseTest.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python
import re
userInput = raw_input("input equation\n")
numCount = 0
operandCount = 0
entryBracketCount = 0
exitBracketCount = 0
charCount = 0
endOfLine = len(userInput) - 1
for i in range(len(userInput)):
if (re.search('[\s*a-z\s*A-Z]+', userInpu... |
if(re.search('[\s*a-zA-Z]+', userInput[i + 1])):
continue
elif(re.search('[\s*\d]+', userInput[i + 1])): |
<|file_name|>cninetyninehexfloatf.rs<|end_file_name|><|fim▁begin|>//! formatter for %a %F C99 Hex-floating-point subs
use super::super::format_field::FormatField;
use super::super::formatter::{InPrefix, FormatPrimitive, Formatter};
use super::float_common::{FloatAnalysis, primitive_to_str_common};
use super::base_conv;... | primitive_to_str_common(prim, &field)
} |
<|file_name|>regions-variance-covariant-use-covariant.rs<|end_file_name|><|fim▁begin|>// Copyright 2012 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution and at
// http://rust-lang.org/COPYRIGHT.
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or... | // Note: see compile-fail/variance-regions-*.rs for the tests that |
<|file_name|>osis_datatable.js<|end_file_name|><|fim▁begin|>function initializeDataTable(formId, tableId, storageKey, pageNumber, itemsPerPage, ajaxUrl, columnDefs, extra){
let domTable = $('#' + tableId);
let options = {
'createdRow': function (row, data, dataIndex) {
let url = "";
... | "info" : false,
"searching" : false,
'processing': false,
"language": { |
<|file_name|>Student.cpp<|end_file_name|><|fim▁begin|>//
// Student.cpp
// HorairesExams
//
// Created by Quentin Peter on 19.11.13.
// Copyright (c) 2013 Quentin. All rights reserved.
//
#include "Student.h"
#include "Examen.h"
Student::Student(string name, string email, int sciper): a_name(name),a_email(email),... | |
<|file_name|>http_api.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
"""HTTP API logic that ties API call renderers with HTTP routes."""
import json
from django import http
from werkzeug import exceptions as werkzeug_exceptions
from werkzeug import routing
import logging
from grr.gui import api_call_rende... | response = http.HttpResponse(status=status, content_type="application/json")
response.write(")]}'\n") # XSSI protection
response.write(json.dumps(rendered_data, |
<|file_name|>test_saferef.py<|end_file_name|><|fim▁begin|>from __future__ import absolute_import
from celery.utils.dispatch.saferef import safe_ref
from celery.tests.utils import Case
class Class1(object):
def x(self):
pass
def fun(obj):
pass
class Class2(object):
def __call__(self, obj):
... | |
<|file_name|>rest_test.go<|end_file_name|><|fim▁begin|>package imagestreammapping
import (
"fmt"
"net/http"
"reflect"
"strings"
"testing"
etcd "github.com/coreos/etcd/clientv3"
"golang.org/x/net/context"
"k8s.io/apimachinery/pkg/api/errors"
metainternal "k8s.io/apimachinery/pkg/apis/meta/internalversion"
m... | Annotations: map[string]string{imageapi.ManagedByOpenShiftAnnotation: "true"}, |
<|file_name|>post_submit.js<|end_file_name|><|fim▁begin|>Template.postSubmit.onCreated(function() {
Session.set('postSubmitErrors', {});
});
Template.postSubmit.helpers({
errorMessage: function(field) {
return Session.get('postSubmitErrors')[field];
},
errorClass: function (field) {
return !!Session.ge... | }); |
<|file_name|>kendo.culture.he.js<|end_file_name|><|fim▁begin|>/*
* Kendo UI Web v2014.1.318 (http://kendoui.com)
* Copyright 2014 Telerik AD. All rights reserved.
*
* Kendo UI Web commercial licenses may be obtained at
* http://www.telerik.com/purchase/license-agreement/kendo-ui-web
* If you do not own a commercial lic... | currency: { |
<|file_name|>compress.py<|end_file_name|><|fim▁begin|># Copyright (C) 2003-2007 Robey Pointer <robeypointer@gmail.com>
#
# This file is part of paramiko.
#
# Paramiko 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
# Softwar... | # 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
"""
Compression implementations for a Transport. |
<|file_name|>product.socket.js<|end_file_name|><|fim▁begin|>"use strict";
/**<|fim▁hole|>// Model events to emit
var events = ['save', 'remove'];
function register(socket) {
// Bind model events to socket events
for (var i = 0, eventsLength = events.length; i < eventsLength; i++) {
var event = events[i]... | * Broadcast updates to client when the model changes
*/
Object.defineProperty(exports, "__esModule", { value: true });
var product_events_1 = require("./product.events"); |
<|file_name|>_version.py<|end_file_name|><|fim▁begin|># This file helps to compute a version number in source trees obtained from
# git-archive tarball (such as those provided by githubs download-from-tag
# feature). Distribution tarballs (built by setup.py sdist) and build
# directories (produced by setup.py build) wi... | |
<|file_name|>BarPlot.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
"""
***************************************************************************
BarPlot.py
---------------------
Date : January 2013
Copyright : (C) 2013 by Victor Olaya
Email : vo... |
class BarPlot(GeoAlgorithm):
INPUT = 'INPUT' |
<|file_name|>Row.spec.ts<|end_file_name|><|fim▁begin|>import Row from '../Row'
import {
mount,
Wrapper,
MountOptions,
} from '@vue/test-utils'
import Vue from 'vue'
describe('Table Row', () => {
type Instance = InstanceType<typeof Row>
let mountFunction: (options?: MountOptions<Instance>) => Wrapper<Instance... | })
expect(wrapper.findAll('tr')).toHaveLength(1)
expect(wrapper.findAll('td')).toHaveLength(2) |
<|file_name|>AudioObjectBasicInfoContent.java<|end_file_name|><|fim▁begin|>/*
* aTunes
* Copyright (C) Alex Aranda, Sylvain Gaudard and contributors
*
* See http://www.atunes.org/wiki/index.php?title=Contributing for information about contributors
*
* http://www.atunes.org
* http://sourceforge.net/projects/atune... | /** |
<|file_name|>test_share_servers_negative.py<|end_file_name|><|fim▁begin|># Copyright 2014 OpenStack Foundation
# 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
... | search_opts = {'fake_filter_key': 'ACTIVE'}
servers = self.shares_client.list_share_servers(search_opts)
self.assertEqual(len(servers), 0)
|
<|file_name|>test_uptime.py<|end_file_name|><|fim▁begin|>import unittest
try:
from unittest import mock
except ImportError:
import mock
from pi3bar.plugins.uptime import get_uptime_seconds, uptime_format, Uptime
class GetUptimeSecondsTestCase(unittest.TestCase):
def test(self):<|fim▁hole|> m.return... | m = mock.mock_open(read_data='5') |
<|file_name|>update-manager.js<|end_file_name|><|fim▁begin|>// Joe Presbrey <presbrey@mit.edu>
// 2007-07-15
// 2010-08-08 TimBL folded in Kenny's WEBDAV
// 2010-12-07 TimBL addred local file write code
const docpart = require('./uri').docpart
const Fetcher = require('./fetcher')
const graph = require('./data-factory')... | }
console.log('sparql.editable: inconclusive for ' + uri + '\n')
return undefined // We don't know (yet) as we haven't had a response (yet)
} |
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|># Copyright 2010 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# All Rights Reserved.<|fim▁hole|># a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless... | #
# 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 |
<|file_name|>boid.js<|end_file_name|><|fim▁begin|>var width = window.innerWidth,
height = window.innerHeight,
boids = [],
destination,
canvas,
context;
const MAX_NUMBER = 100;
const MAX_SPEED = 1;
const radius = 5;
init();
animation();
function init(){
canvas = document.getElementById('canvas'),... | }; |
<|file_name|>startActivity.js<|end_file_name|><|fim▁begin|>'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
var _ErrorHandler = require('../utils/ErrorHandler');
var startActivity = function startActivity(appPackage, appActivity) {
if (typeof appPackage !== 'string' || typeof appA... | appActivity: '.view.DragAndDropDemo' |
<|file_name|>bt_default_unit_info.py<|end_file_name|><|fim▁begin|># coding: utf-8
"""
Onshape REST API
The Onshape REST API consumed by all clients. # noqa: E501
The version of the OpenAPI document: 1.113
Contact: api-support@onshape.zendesk.com
Generated by: https://openapi-generator.tech
"""
... | ) |
<|file_name|>ClearStack.java<|end_file_name|><|fim▁begin|>package cat.ereza.customactivityoncrash.activity;
import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import cat.ereza.customactivityoncrash.CustomActivityOnCrash;
/**<|fim▁hole|>{
@Override
protected void onCreate(... | * Created by zhy on 15/8/4.
*/
public class ClearStack extends Activity |
<|file_name|>login-status.enum.ts<|end_file_name|><|fim▁begin|>export enum LoginStatus {
AUTHENTICATED = 1,
NOT_AUTHENTICATED,
FORM_ERRORS,
SERVER_ERROR<|fim▁hole|><|fim▁end|> | } |
<|file_name|>test_core.py<|end_file_name|><|fim▁begin|># pylint: disable-msg=W0401,W0511,W0611,W0612,W0614,R0201,E1102
"""Tests suite for MaskedArray & subclassing.
:author: Pierre Gerard-Marchant
:contact: pierregm_at_uga_dot_edu
"""
from __future__ import division, absolute_import, print_function
__author__ = "Pier... | # dtype is an ndarray sub-class and has a _fill_value attribute (by |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.