prompt large_stringlengths 70 991k | completion large_stringlengths 0 1.02k |
|---|---|
<|file_name|>commands.go<|end_file_name|><|fim▁begin|>package main
import (
"fmt"
"log"
)
type ListCommand struct {
All bool `short:"a" long:"available" description:"also prints all available version for installation"`
}
type InitCommand struct{}
type InstallCommand struct {
Use bool `short:"u" long:"use" descr... | |
<|file_name|>logout.component.ts<|end_file_name|><|fim▁begin|><|fim▁hole|>import { logoutAction } from '../../../rx/auth';
@Component({
selector: 'dng-logout',
templateUrl: './logout.component.html'
})
export class LogoutComponent implements OnInit {
constructor(private store: Store<any>) { }
ngOnIn... | import { Component, OnInit } from '@angular/core';
import { Store } from '@ngrx/store';
|
<|file_name|>content_disposition.rs<|end_file_name|><|fim▁begin|>// # References
//
// "The Content-Disposition Header Field" https://www.ietf.org/rfc/rfc2183.txt
// "The Content-Disposition Header Field in the Hypertext Transfer Protocol (HTTP)" https://www.ietf.org/rfc/rfc6266.txt
// "Returning Values from Forms: mul... | /// Extension type consisting of token and value. Recipients should ignore unrecognized
/// parameters.
Ext(String, String)
} |
<|file_name|>tap_config_base.cc<|end_file_name|><|fim▁begin|>#include "extensions/common/tap/tap_config_base.h"
#include "envoy/config/tap/v3/common.pb.h"
#include "envoy/data/tap/v3/common.pb.h"
#include "envoy/data/tap/v3/wrapper.pb.h"
#include "common/common/assert.h"
#include "common/common/fmt.h"
#include "commo... | if (http_trace->has_request_body_chunk()) {
swapBytesToString(*http_trace->mutable_request_body_chunk());
} |
<|file_name|>setup.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""<|fim▁hole|>Created on Mon Jul 23 13:23:20 2018
@author: BallBlueMeercat
"""
from distutils.core import setup
from Cython.Build import cythonize
setup(ext_modules = cythonize('firstderivs_cython.pyx'))<|fim▁end|> | |
<|file_name|>configure_websites.py<|end_file_name|><|fim▁begin|>import os
import re
import sys
"""
* Perform initial configuration to ensure that the server is set up to work with Burton's format
sudo chown -R ubuntu:ubuntu /var/www<|fim▁hole|> mkdir -p /var/www/default/public_html
mv /var/www/html/index.ht... | |
<|file_name|>Register.cpp<|end_file_name|><|fim▁begin|>// Register.cpp : implementation file
//
#include "stdafx.h"
#include "Portal.h"
#include "Register.h"
#include "afxdialogex.h"
// Register dialog
IMPLEMENT_DYNAMIC(Register, CDialogEx)
Register::Register(CWnd* pParent /*=NULL*/)
: CDialogEx(Reg... | |
<|file_name|>list.js<|end_file_name|><|fim▁begin|>var async = require('async');
var settings = require('../settings/settings.js');
var Post = require('../models/post.js');
var List = require('../models/list.js');
module.exports = function(app){
app.get('/getArchive',function(req,res,next){
if(req.sessionID){
... | });
}else{
res.end(); |
<|file_name|>MetaMmCorpusWrapper.py<|end_file_name|><|fim▁begin|>from gensim.corpora import MmCorpus
from gensim.utils import unpickle
class MetaMmCorpusWrapper:
"""Wrapper which loads MM corpus with metadata."""
def __init__(self, filename):
self.corpus = MmCorpus(filename)
self.metadata = u... | for i, doc in enumerate(self.corpus):
yield doc, self.metadata[i] |
<|file_name|>h2o.py<|end_file_name|><|fim▁begin|># -*- encoding: utf-8 -*-
"""
h2o -- module for using H2O services.
:copyright: (c) 2016 H2O.ai
:license: Apache License Version 2.0 (see LICENSE for details)
"""
from __future__ import absolute_import, division, print_function, unicode_literals
import logging
import... | |
<|file_name|>mod.rs<|end_file_name|><|fim▁begin|>// Copyright 2012-2015 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/licens... | macro_rules! path_std {
($($x:tt)*) => (
::ext::deriving::generic::ty::Path::new( pathvec_std!( $($x)* ) )
) |
<|file_name|>day_4.rs<|end_file_name|><|fim▁begin|>use std::iter::Peekable;
use std::str::Chars;
#[derive(PartialEq)]
enum SymbolGroup {
AlphaNumeric,
WhiteSpace,
Else
}
pub struct Lexer<'a> {
iter: Peekable<Chars<'a>>
}
impl <'a> Lexer<'a> {
pub fn new(line: &'a str) -> Lexer {
Lexe... | break; |
<|file_name|>utils.py<|end_file_name|><|fim▁begin|>import asyncio
import os
from urllib.parse import urlparse
import aiohttp
def damerau_levenshtein(first_string, second_string):
"""Returns the Damerau-Levenshtein edit distance between two strings."""
previous = None
prev_a = None
current = [i for i... | for letter, value in roman_numeral_table:
while value <= num: |
<|file_name|>0014_auto_20150726_1411.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 = [
('agency', '0013_auto_20150726_0001'),
]
operations = [
m... | ] |
<|file_name|>propagate-approximated-shorter-to-static-no-bound.rs<|end_file_name|><|fim▁begin|>// Test a case where we are trying to prove `'x: 'y` and are forced to
// approximate the shorter end-point (`'y`) to with `'static`. This is
// because `'y` is higher-ranked but we know of no relations to other
// regions. N... | {
}
|
<|file_name|>testfileutils.py<|end_file_name|><|fim▁begin|>import os
import shutil
import biicode.common.test
from biicode.common.utils import file_utils as common_file_utils
def load(filepath):
"""Return binary load of given test resource."""
abspath = file_path(filepath)
with open(abspath, "rb") as f:
... | if not dst_name: |
<|file_name|>PagerTrigger.java<|end_file_name|><|fim▁begin|>package com.veaer.glass.viewpager;
import android.support.v4.view.ViewPager;
import com.veaer.glass.trigger.Trigger;
/**
* Created by Veaer on 15/11/18.
*/
public class PagerTrigger extends Trigger implements ViewPager.OnPageChangeListener {
private C... | return viewPagerTrigger;
}
|
<|file_name|>yui2-button-debug.js<|end_file_name|><|fim▁begin|>YUI.add('yui2-button', function(Y) {
var YAHOO = Y.YUI2;
/*
Copyright (c) 2010, Yahoo! Inc. All rights reserved.
Code licensed under the BSD License:
http://developer.yahoo.com/yui/license.html
version: 2.8.2r1
*/
/**
* @module button
* @descript... | |
<|file_name|>header-default-template.js<|end_file_name|><|fim▁begin|>//Needed components
import React from 'react';<|fim▁hole|>import HeaderContent from './header-content';
import HeaderActions from './header-actions';
/**
* Application header
*/
const AppHeader = () => {
return (
<HeaderScrolling>
... | import HeaderScrolling from './header-scrolling';
import HeaderTopRow from './header-top-row'; |
<|file_name|>Webpage.java<|end_file_name|><|fim▁begin|>package com.wongsir.newsgathering.model.commons;
import com.google.common.base.MoreObjects;
import com.google.gson.annotations.SerializedName;
import org.apache.commons.lang3.builder.EqualsBuilder;
import org.apache.commons.lang3.builder.HashCodeBuilder;
i... | .append(getStaticFields(), webpage.getStaticFields())
.append(getAttachmentList(), webpage.getAttachmentList())
|
<|file_name|>issue-14959.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
// http://www.apache.org/lic... | |
<|file_name|>view.js<|end_file_name|><|fim▁begin|>/*
* Copyright (c) 2015 by Rafael Angel Aznar Aparici (rafaaznar at gmail dot com)
*
* sisane: The stunning micro-library that helps you to develop easily
* AJAX web applications by using Angular.js 1.x & sisane-server
* sisane is distributed under the ... | } else { |
<|file_name|>tag.rs<|end_file_name|><|fim▁begin|>// Play List (M3U8 Format)
use std::default::Default;
use std::str::FromStr;
use std::string::ToString;
use std::collections::BTreeMap;
#[allow(non_camel_case_types)]
#[derive(Debug)]
pub enum Tag {
// Basic Tags
M3U,
VERSION(usize),
// Media Segment Ta... | let title: Option<String> = Some(kv[2].to_string());
let uri: String = kv[3].to_string();
Ok(Tag::INF(duration, title, uri) ) |
<|file_name|>xf86vidmode.rs<|end_file_name|><|fim▁begin|>/*
* This file generated automatically from xf86vidmode.xml by r_client.py.
* Edit at your peril.
*/
//Make the compiler quiet
#![allow(unused_imports)]
#![allow(non_camel_case_types)]
use std;
use libc::*;
use ffi;
pub static XF86VIDMODE_MAJOR_VERSION : c_u... | pub fn xcb_xf86vidmode_get_monitor_hsync_end (R : *mut get_monitor_reply) -> ffi::base::generic_iterator;
|
<|file_name|>yawn_settings.py<|end_file_name|><|fim▁begin|>import dj_database_url
import pkg_resources
from yawn.settings.base import *
# this uses DATABASE_URL env variable:
DATABASES['default'] = dj_database_url.config(conn_max_age=600)
SECRET_KEY = os.environ.get('SECRET_KEY')
ALLOWED_HOSTS = [os.environ.get('A... | 'include_paths': ['yawn'],
} |
<|file_name|>test_otp.py<|end_file_name|><|fim▁begin|>import unittest
from itertools import izip
import numpy as np
from numpy import cos, sin, pi
from pele.angleaxis import RBTopology, RigidFragment, RBPotentialWrapper
from pele.potentials import LJ
from pele.angleaxis._otp_cluster import OTPCluster<|fim▁hole|>
_x0... | from pele.thermodynamics import get_thermodynamic_information
from pele.utils import rotations
from pele.angleaxis._aa_utils import _rot_mat_derivative, _sitedist_grad, _sitedist
from pele.angleaxis.aamindist import MeasureRigidBodyCluster |
<|file_name|>layers_pooling.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python
# -*- coding: utf-8 -*-
__author__ = 'ar'
from layers_basic import LW_Layer, default_data_format
from layers_convolutional import conv_output_length
###############################################
class _LW_Pooling1D(LW_Layer):
input_di... | if self.dim_ordering == 'channels_first':
return (input_shape[0], input_shape[1], len_dim1, len_dim2, len_dim3)
elif self.dim_ordering == 'channels_last':
return (input_shape[0], len_dim1, len_dim2, len_dim3, input_shape[4]) |
<|file_name|>properties_render_layer.py<|end_file_name|><|fim▁begin|># ##### BEGIN GPL LICENSE BLOCK #####
#
# 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 License... | bl_region_type = 'WINDOW'
bl_context = "render_layer"
# COMPAT_ENGINES must be defined in each subclass, external engines can add themselves here
|
<|file_name|>json.rs<|end_file_name|><|fim▁begin|>#![feature(test)]
extern crate test;
use self::test::Bencher;
use std::fs::File;
use std::io::Read;
extern crate pom;
#[path = "../examples/json.rs"]
mod json;
#[bench]
fn json_byte(b: &mut Bencher) {
let mut file = File::open("assets/data.json").unwrap();<|fim▁hol... | let mut input = Vec::new();
file.read_to_end(&mut input).unwrap(); |
<|file_name|>delegate-token.hpp<|end_file_name|><|fim▁begin|>/*
* The MIT License (MIT)
*
* Copyright (c) 2015 Freeman Zhang <zhanggyb@gmail.com>
*
* 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 t... |
Delegate<void, ParamTypes...> delegate_;
}; |
<|file_name|>12709(Falling_Ants).cpp<|end_file_name|><|fim▁begin|>#include <iostream>
#include <string>
#include <algorithm>
#include <fstream>
#define IN cin
using namespace std;
//bool sort_logic(int i, int j);
//void pr(int data[], int length);
// EOF Termination
int main(){
int __initial_input, max_index, rea... | // Cheacking if has any equeal
int max_volumes[__initial_input];
rear = 0; |
<|file_name|>index.d.ts<|end_file_name|><|fim▁begin|>// Type definitions for node-hook 1.0
// Project: https://github.com/bahmutov/node-hook#readme
// Definitions by: Nathan Hardy <https://github.com/nhardy>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
interface Options {
verbose?: boolean | ... | type Transform = (source: string, filename: string) => string;
|
<|file_name|>es_primo_v1.py<|end_file_name|><|fim▁begin|>n = int(raw_input('Ingrese n: '))
es_primo = True
d = 2
while d < n:
if n % d == 0:
es_primo = False
d = d + 1
if es_primo:
print(n, 'es primo')<|fim▁hole|> print(n, 'es compuesto')<|fim▁end|> | else: |
<|file_name|>test_ec2service.py<|end_file_name|><|fim▁begin|># vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2014 Cloudbase Solutions Srl
#
# 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 th... | @mock.patch('cloudbaseinit.utils.network.check_metadata_ip_route')
@mock.patch('cloudbaseinit.metadata.services.ec2service.EC2Service'
'.get_host_name')
def _test_load(self, mock_get_host_name, mock_check_metadata_ip_route, |
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|>"""<|fim▁hole|>Tools and data structures for working with genomic intervals (or sets of
regions on a line in general) efficiently.
"""
# For compatiblity with existing stuff
from bx.intervals.intersection import *<|fim▁end|> | |
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|>from ._StabData import *<|fim▁hole|>from ._MotorData import *
from ._GyroData import *<|fim▁end|> | from ._AccelData import * |
<|file_name|>build.js<|end_file_name|><|fim▁begin|>'use strict'
<|fim▁hole|> require('./build/node')(gulp)
require('./build/browser')(gulp)
require('./clean')(gulp)
gulp.task('build', ['build:browser'])
}<|fim▁end|> | module.exports = (gulp) => { |
<|file_name|>main.cpp<|end_file_name|><|fim▁begin|>#include <rxcpp/rx-lite.hpp>
#include <rxcpp/operators/rx-reduce.hpp>
#include <rxcpp/operators/rx-filter.hpp>
#include <rxcpp/operators/rx-map.hpp>
#include <rxcpp/operators/rx-tap.hpp>
#include <rxcpp/operators/rx-concat_map.hpp>
#include <rxcpp/operators/rx-flat_map... | |
<|file_name|>test_install.py<|end_file_name|><|fim▁begin|>import os
import textwrap
import glob
from os.path import join, curdir, pardir
import pytest
from pip.utils import rmtree
from tests.lib import pyversion
from tests.lib.local_repos import local_checkout
from tests.lib.path import Path
@pytest.mark.network
d... | """
to_install = data.packages.join("FSPkg") |
<|file_name|>_font.py<|end_file_name|><|fim▁begin|>from plotly.basedatatypes import BaseLayoutHierarchyType as _BaseLayoutHierarchyType
import copy as _copy
class Font(_BaseLayoutHierarchyType):
# class properties
# --------------------
_parent_path_str = "layout.yaxis.title"
_path_str = "layout.yaxi... | # color
# -----
@property |
<|file_name|>trait-bounds-sugar.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.... | |
<|file_name|>decorators.py<|end_file_name|><|fim▁begin|>from functools import wraps
from django.utils.translation import ugettext as _
from django.contrib.admin.forms import AdminAuthenticationForm
from django.contrib.auth.views import login
from django.contrib.auth import REDIRECT_FIELD_NAME
def staff_member_required... | @wraps(view_func)
def _checklogin(request, *args, **kwargs):
if request.user.is_active and request.user.is_staff: |
<|file_name|>ex6.py<|end_file_name|><|fim▁begin|>#Pizza please<|fim▁hole|>spk = pyaudiogame.speak
MyApp = pyaudiogame.App("Pizza Please")
storage.screen = ["start"]
storage.toppings = ["cheese", "olives", "mushrooms", "Pepperoni", "french fries"]
storage.your_toppings = ["cheese"]
storage.did_run = False
def is_numbe... | import pyaudiogame
from pyaudiogame import storage |
<|file_name|>appsrc.rs<|end_file_name|><|fim▁begin|>use ffi::*;
use ::Transfer;
use ::Element;
use ::Caps;
use std::mem;
use reference::Reference;
use std::ops::{Deref, DerefMut};
pub struct AppSrc{
appsrc: ::Element
}
unsafe impl Sync for AppSrc {}
unsafe impl Send for AppSrc {}
impl AppSrc{
pub fn new(nam... | self.appsrc.transfer()
}
}
|
<|file_name|>monitor.go<|end_file_name|><|fim▁begin|>package nftables
import (
"github.com/evilsocket/opensnitch/daemon/log"
)
// AreRulesLoaded checks if the firewall rules for intercept traffic are loaded.
func (n *Nft) AreRulesLoaded() bool {
n.Lock()
defer n.Unlock()<|fim▁hole|> if err != nil {
log.Error("... |
nRules := 0
for _, table := range n.mangleTables {
rules, err := n.conn.GetRule(table, n.outputChains[table]) |
<|file_name|>choicelists.py<|end_file_name|><|fim▁begin|># -*- coding: UTF-8 -*-
# Copyright 2016 Luc Saffre
# License: BSD (see file COPYING for details)
from lino.api import dd, _
class PartnerEvents(dd.ChoiceList):<|fim▁hole|><|fim▁end|> | verbose_name = _("Observed event")
verbose_name_plural = _("Observed events")
max_length = 50 |
<|file_name|>utils.py<|end_file_name|><|fim▁begin|>"This module provides a set of common utility functions."
__author__ = "Anders Logg"
__copyright__ = "Copyright (C) 2009 Simula Research Laboratory and %s" % __author__
__license__ = "GNU GPL Version 3 or any later version"
from math import ceil
from numpy import li... | dt = t_range[0]
|
<|file_name|>RegisterActivity.java<|end_file_name|><|fim▁begin|>package com.fantasy.lulutong.activity.me;
import android.os.Bundle;
import android.view.View;
import android.widget.RelativeLayout;
import com.fantasy.lulutong.R;
import com.fantasy.lulutong.activity.BaseActivity;
/**
* “注册”的页面
* @author Fa... | |
<|file_name|>camera.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python3.7
import ssl
import remi.gui as gui
from remi import start, App
class Camera(App):
def __init__(self, *args, **kwargs):
super(Camera, self).__init__(*args)
def video_widgets(self):
width = '300'
height = '300'
... | return
def main(self): |
<|file_name|>poolmember.py<|end_file_name|><|fim▁begin|>import android
class SMSPoolMember:
def __init__(self, query):
self.droid = android.Android()
self.query = str(query).lstrip().rstrip()
def wifiConnected(self):<|fim▁hole|> def dataConnected(self):
return self.droid.getCellLoc... | none = "<unknown ssid>"
return not self.droid.wifiGetConnectionInfo().result["ssid"] == none
|
<|file_name|>Activity.java<|end_file_name|><|fim▁begin|>package com.canigraduate.uchicago.models;
<|fim▁hole|><|fim▁end|> | public interface Activity {
} |
<|file_name|>XGUI.py<|end_file_name|><|fim▁begin|>import Base
import VS
import GUI<|fim▁hole|>XGUIRootSingleton = None
XGUIPythonScriptAPISingleton = None
"""----------------------------------------------------------------"""
""" """
""" XGUIRoot - root ma... | import XGUITypes
import XGUIDebug
|
<|file_name|>gcp_compute_backend_service.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright (C) 2017 Google
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
# ----------------------------------------------------------------------------
#
#... | |
<|file_name|>MultipleBrokerProducer.java<|end_file_name|><|fim▁begin|>package com.cosmos.kafka.client.producer;
import org.apache.kafka.clients.producer.KafkaProducer;
import org.apache.kafka.clients.producer.ProducerRecord;
import java.util.Properties;
import java.util.Random;
import static org.apache.kafka.clients... | } |
<|file_name|>journal.py<|end_file_name|><|fim▁begin|># -*- Mode: python; coding:utf-8; indent-tabs-mode: nil -*- */
#
# This file is part of systemd.
#
# Copyright 2012 David Strauss <david@davidstrauss.net>
# Copyright 2012 Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
# Copyright 2012 Marti Raudsepp <marti@juf... | 'COREDUMP_PID': int,
'COREDUMP_UID': int,
'COREDUMP_GID': int,
'COREDUMP_SESSION': int, |
<|file_name|>gulpfile.ts<|end_file_name|><|fim▁begin|>import * as gulp from 'gulp';
import * as runSequence from 'run-sequence';
import {loadTasks} from './tools/utils';
import {SEED_TASKS_DIR, PROJECT_TASKS_DIR} from './tools/config';
loadTasks(SEED_TASKS_DIR);
loadTasks(PROJECT_TASKS_DIR);
// --------------
// Buil... | |
<|file_name|>specPageObjects.js<|end_file_name|><|fim▁begin|>"use strict";
// local import of the exported AngularPage class
var angularPage_1 = require('./angularPage');
// The jasmine typings are brought in via DefinitelyTyped ambient typings.<|fim▁hole|> it('should greet the named user', function () {
var... | describe('angularjs homepage', function () { |
<|file_name|>program.rs<|end_file_name|><|fim▁begin|>//! A `Program` holds multiple `Function`.
use crate::il::*;
use crate::RC;
use std::collections::BTreeMap;
use std::fmt;
/// A representation of a program by `il::Function`
#[derive(Clone, Debug, Deserialize, Serialize, Default)]
pub struct Program {
// Mappin... | if function.1.address() == address { |
<|file_name|>waiting.spec.js<|end_file_name|><|fim▁begin|>/// <reference types="cypress" />
context('Waiting', () => {
beforeEach(() => {
cy.visit('https://example.cypress.io/commands/waiting')
})
// BE CAREFUL of adding unnecessary wait times.
// https://on.cypress.io/best-practices#Unnecessary-Waiting
... | cy.wait(1000)
}) |
<|file_name|>setup.py<|end_file_name|><|fim▁begin|>import sys
from sqlalchemy import Column, ForeignKey, Integer, String
from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy.orm import relationship
from sqlalchemy import create_engine
Base = declarative_base()<|fim▁hole|>
class User(Base):
"""d... | |
<|file_name|>generator.rs<|end_file_name|><|fim▁begin|>use super::super::{Grid, Symmetry, D, LP, P};
use super::*;
extern crate rand;
use rand::Rng;
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum Endpoint {
Any,
Forced,
Prohibited,
}
pub struct GeneratorOption<'a> {
pub chain_threshold: i32,
... | |
<|file_name|>MainController.java<|end_file_name|><|fim▁begin|>package org.peerbox.presenter;
import javafx.fxml.FXML;
import javafx.scene.Node;
import javafx.scene.layout.Pane;
public class MainController implements INavigatable {
@FXML
private Pane mainPane;<|fim▁hole|> /*
* (non-Javadoc)
*
* @see org.peerb... | |
<|file_name|>eg-enum-use.rs<|end_file_name|><|fim▁begin|>#![allow(dead_code)]
enum HTTPGood {
HTTP200,
HTTP300,
}
enum HTTPBad {
HTTP400,
HTTP500,<|fim▁hole|> use HTTPBad::*; // automatically use each name
let good = HTTP200; // equivalent to HTTPGood::HTTP200
let bad = HTTP500; // equival... | }
fn server_debug() {
use HTTPGood::{HTTP200, HTTP300}; // explicitly pick name without manual scoping |
<|file_name|>num_format.rs<|end_file_name|><|fim▁begin|>//! handles creating printed output for numeric substitutions
use std::env;
use std::vec::Vec;
use cli;
use super::format_field::{FormatField, FieldType};
use super::formatter::{Formatter, FormatPrimitive, InPrefix, Base};
use super::formatters::intf::Intf;
use s... | |
<|file_name|>test_mode.cpp<|end_file_name|><|fim▁begin|>// (C) Copyright Nick Thompson and Matt Borland 2020.
// Use, modification and distribution are subject to the
// Boost Software License, Version 1.0. (See accompanying file
// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
#include <random>... | { |
<|file_name|>utils.py<|end_file_name|><|fim▁begin|>class SqliteMixin:
config_params = {'DATASTORE': 'sqlite://'}
class OdmUtils:
config_file = 'tests.odm'
async def _create_task(self, token, subject='This is a task', person=None,
**data):
data['subject'] = subject
... | return data |
<|file_name|>index.js<|end_file_name|><|fim▁begin|>var hb = require('handlebars')
, fs = require('vinyl-fs')
, map = require('vinyl-map')
module.exports = function (opts, cb) {
if (!opts || typeof opts === 'function') throw new Error('opts is required')
if (!opts.origin) throw new Error('opts.origin is require... | |
<|file_name|>struct-literal-in-for.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.apac... | for x in Foo {
x: 3 //~ ERROR expected type, found `3` |
<|file_name|>user.py<|end_file_name|><|fim▁begin|>import logging
from google.appengine.ext import ndb
from endpoints_proto_datastore.ndb.model import EndpointsModel, EndpointsAliasProperty
<|fim▁hole|> name = ndb.StringProperty()<|fim▁end|> | class UserModel(EndpointsModel):
email = ndb.StringProperty() |
<|file_name|>world.js<|end_file_name|><|fim▁begin|>'use strict';
var request = require('request')
var uuid = require('node-uuid')
var env = require('./env')
var World = function World(callback) {
var self = this
this.collection = null
this.lastResponse = null
this.doc1 = null
this.doc2 = null
this.gen... | }
this.collectionPath = function(collection) { |
<|file_name|>logger.py<|end_file_name|><|fim▁begin|><|fim▁hole|>except ImportError:
threading = None
from django.template.loader import render_to_string
from django.utils.translation import ugettext_lazy as _
from debug_toolbar.panels import DebugPanel
class ThreadTrackingHandler(logging.Handler):
def __init__... | import datetime
import logging
try:
import threading |
<|file_name|>test_modjk.py<|end_file_name|><|fim▁begin|>"""
:codeauthor: Jayesh Kariya <jayeshk@saltstack.com>
"""
import pytest
import salt.modules.modjk as modjk
from tests.support.mock import patch
@pytest.fixture
def configure_loader_modules():
return {modjk: {}}
def test_version():
"""
Test fo... | assert modjk.version() == "1.2.37"
|
<|file_name|>h5ls.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python3
"""*.h5 の値の最小・最大などを確認するスクリプト。"""
import argparse
import pathlib
import sys
import h5py
import numpy as np
try:
import pytoolkit as tk
except ImportError:
sys.path.insert(0, str(pathlib.Path(__file__).resolve().parent.parent.parent))
... | for layer_name in layer_names:
g = model_weights[layer_name] |
<|file_name|>finddata.py<|end_file_name|><|fim▁begin|>import pathlib
import importlib
import sys
__all__ = ['sample', 'sampleTxt', 'sampleBin']
<|fim▁hole|>datadir = this.parent.parent / 'data'
loader = importlib.machinery.SourceFileLoader('sample', str(datadir / 'sample.py'))
sample = loader.load_module()
sampleTxt ... | this = pathlib.Path(__file__) |
<|file_name|>utils.rs<|end_file_name|><|fim▁begin|>use std::path::PathBuf;
use std::process;
pub fn ensure_file_exists(path: &PathBuf) {
if !path.exists() {
eprintln!("the given path does not exist: {:?}", path);
process::exit(1);
}
if !path.is_file() {
eprintln!("the g... | process::exit(1);
}
|
<|file_name|>cursor.go<|end_file_name|><|fim▁begin|>package arango
import (
"encoding/json"
"fmt"
)
//Cursor represents a collection of items that you can iterate over.
//This library will produce a Cursor type whenever ArangoDb produces
//a list of objects that match a query.
type Cursor struct {
db *Database
... | } |
<|file_name|>mod.rs<|end_file_name|><|fim▁begin|>//! Public-key authenticated encryption
//!
//! # Security model
//! The `seal()` function is designed to meet the standard notions of privacy and
//! third-party unforgeability for a public-key authenticated-encryption scheme
//! using nonces. For formal definitions see... | //! # Example (simple interface)
//! ```
//! use maidsafe_sodiumoxide::crypto::box_;
//! |
<|file_name|>FieldContentValueAlertConditionTest.java<|end_file_name|><|fim▁begin|>/**
* This file is part of Graylog.
*
* Graylog 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 L... | |
<|file_name|>analyzePackage.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python
import scapy
#import scapy_ex
import os,sys
import printerInfo
import enum
from enum import Enum
from scapy.all import *
import time, datetime
#from time import sleep
class Message(Enum):
AUTH = "0"
DEAUTH = "1"
PROBE_REQ = ... | #elif hasattr(p, 'type') and p.type == 2 and hasattr(p, 'subtype') and p.subtype == 0: #DATA
elif hasattr(p, 'type') and p.type == 2: #DATA
isDifferent = False |
<|file_name|>move-fragments-9.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
// http://www.apache.or... | }
|
<|file_name|>test_track_job_track_line_cxx.cpp<|end_file_name|><|fim▁begin|>#include "sixtracklib/cuda/track_job.hpp"
#include <iomanip>
#include <cstddef>
#include <cstdint>
#include <cstdlib>
#include <cstring>
#include <iostream>
#include <iomanip>
#include <string>
#include <vector>
#include <gtest/gtest.h>
#inc... |
buffer_t in_particles( ::NS(PATH_TO_BEAMBEAM_PARTICLES_DUMP) );
buffer_t beam_elem_buffer( ::NS(PATH_TO_BEAMBEAM_BEAM_ELEMENTS) ); |
<|file_name|>resolver.js<|end_file_name|><|fim▁begin|>import Resolver from 'ember/resolver';
var resolver = Resolver.create();
resolver.namespace = {<|fim▁hole|>};
export default resolver;<|fim▁end|> | modulePrefix: 'todo-app' |
<|file_name|>server_extension.py<|end_file_name|><|fim▁begin|>from functools import wraps
import json
import os
import traceback
import validators
from jinja2 import Environment, PackageLoader
from notebook.utils import url_path_join
from notebook.base.handlers import IPythonHandler
import requests
from requests.auth ... | if job.is_started:
return views.render('started_job', notebook, {'job': job}) |
<|file_name|>cemetery.component.spec.ts<|end_file_name|><|fim▁begin|>import { async, ComponentFixture, TestBed } from '@angular/core/testing';
import { CemeteryComponent } from './cemetery.component';
describe('CemeteryComponent', () => {
let component: CemeteryComponent;
let fixture: ComponentFixture<CemeteryCom... | declarations: [ CemeteryComponent ]
})
.compileComponents(); |
<|file_name|>index.d.ts<|end_file_name|><|fim▁begin|>/*
* @license Apache-2.0
*
* Copyright (c) 2019 The Stdlib 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.apac... | |
<|file_name|>debuggable_http_response.py<|end_file_name|><|fim▁begin|>try:
# Python 3
from http.client import HTTPResponse, IncompleteRead
str_cls = str
except (ImportError):
# Python 2
from httplib import HTTPResponse, IncompleteRead
str_cls = unicode
from ..console_write import console_write
... | 9: u'HTTP/0.9', |
<|file_name|>demo.js<|end_file_name|><|fim▁begin|>FusionCharts.ready(function () {
var gradientCheckBox = document.getElementById('useGradient');
//Set event listener for radio button
if (gradientCheckBox.addEventListener) {
gradientCheckBox.addEventListener("click", changeGradient);
}
... |
}); |
<|file_name|>SecureStoreManager.java<|end_file_name|><|fim▁begin|>/*
* This file is part of the QuickServer library
* Copyright (C) QuickServer.org
*
* Use, modification, copying and distribution of this software is subject to
* the terms and conditions of the GNU Lesser General Public License.
* You should hav... | * Class that loads Key Managers, Trust Managers, SSLContext and other secure
* objects from QuickServer configuration passed. See <secure-store-manager> |
<|file_name|>SpamExtract.java<|end_file_name|><|fim▁begin|>/*
* ***** BEGIN LICENSE BLOCK *****
* Zimbra Collaboration Suite Server
* Copyright (C) 2006, 2007, 2008, 2009, 2010 Zimbra, Inc.
*
* The contents of this file are subject to the Zimbra Public License
* Version 1.3 ("License"); you may not use this file ... | import com.zimbra.common.soap.MailConstants;
import com.zimbra.common.soap.SoapFaultException;
import com.zimbra.common.soap.SoapHttpTransport;
import com.zimbra.common.util.BufferStream; |
<|file_name|>ApplicationRoles.java<|end_file_name|><|fim▁begin|>package br.eti.arthurgregorio.fulljeearch.domain.security;
/**<|fim▁hole|>public interface ApplicationRoles {
public final String USER = "Usuario";
public final String ADMINISTRATOR = "Administrador";
}<|fim▁end|> | *
* @author Arthur
*/ |
<|file_name|>providerbootstrapper.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
# providerbootstrapper.py
# Copyright (C) 2013 LEAP
#
# 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, ei... | def _check_https(self, *args):
""" |
<|file_name|>test_basics.py<|end_file_name|><|fim▁begin|>from __future__ import absolute_import, print_function, division
from petl.test.helpers import ieq
from petl.util import expr, empty, coalesce
from petl.transform.basics import cut, cat, addfield, rowslice, head, tail, \
cutout, skipcomments, annex, addrown... | ('D', 'xyz', 9.0),
('E', None, None)) |
<|file_name|>AutoFocus.js<|end_file_name|><|fim▁begin|>import React, { PropTypes } from 'react';
class AutoFocus extends React.Component {
constructor( props ) {
super( props );
this.receiveRef = this.receiveRef.bind( this );
}
<|fim▁hole|> if ( this.ref ) {
this.ref.focus();
}
}
receive... | componentDidMount() { |
<|file_name|>privateFieldAssignabilityFromUnknown.ts<|end_file_name|><|fim▁begin|>export class Class {
#field: any
}
<|fim▁hole|><|fim▁end|> |
const task: Class = {} as unknown; |
<|file_name|>ExtraJumpPlugin.java<|end_file_name|><|fim▁begin|>/*
* Copyright 2015-2018 Igor Maznitsa.
*
* 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/li... | * distributed under the License is distributed on an "AS IS" BASIS,
* 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|>cpp_compile.py<|end_file_name|><|fim▁begin|># coding=utf-8
# Copyright 2015 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
from __future__ import (absolute_import, division, generators, nested_scopes, print_function,
... | include_dirs.extend([os.path.join(get_buildroot(), dep.target_base)])
|
<|file_name|>email.type.d.ts<|end_file_name|><|fim▁begin|>/**
* Email object for Opening Email Composer
*/
export interface Email {
app?: string;
to?: string | Array<string>;
cc?: string | Array<string>;<|fim▁hole|> body?: string;
isHtml?: boolean;
}<|fim▁end|> | bcc?: string | Array<string>;
attachments?: Array<any>;
subject?: string; |
<|file_name|>test_variable.py<|end_file_name|><|fim▁begin|># Copyright 2016 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
#
# ... | |
<|file_name|>raw.go<|end_file_name|><|fim▁begin|>package raw
import (
"fmt"
"../../platforms/common"
)
type FieldMacros struct {}
func (FieldMacros) DecodeDW0() {
macro := common.GetMacro()
// Do not decode, print as is.
macro.Add(fmt.Sprintf("0x%0.8x", macro.Register(common.PAD_CFG_DW0).ValueGet()))
}
func (F... | // Do not decode, print as is.
macro.Add(fmt.Sprintf("0x%0.8x", macro.Register(common.PAD_CFG_DW1).ValueGet())) |
<|file_name|>provider.py<|end_file_name|><|fim▁begin|>from allauth.socialaccount import providers
from allauth.socialaccount.providers.base import ProviderAccount
from allauth.socialaccount.providers.oauth.provider import OAuthProvider
from allauth.socialaccount.models import SocialApp, SocialToken
import oauth2 as oa... | client = oauth.Client(consumer, access_token)
try:
response, data = client.request('https://api.twitter.com/1.1/account/verify_credentials.json') |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.