prompt large_stringlengths 70 991k | completion large_stringlengths 0 1.02k |
|---|---|
<|file_name|>trusts.go<|end_file_name|><|fim▁begin|>package trust
import (
"crypto/x509"
"errors"
"io/ioutil"
"net/http"
"net/url"
"os"
"path"
"path/filepath"
"sync"
"time"
"github.com/Sirupsen/logrus"
"github.com/docker/libtrust/trustgraph"
)
type TrustStore struct {
path string
caPool ... | autofetch bool
httpClient *http.Client |
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|># Copyright 2015 The TensorFlow Authors. All Rights Reserved.
#<|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 Li... | # Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License. |
<|file_name|>AbinsCalculateDWSingleCrystalTest.py<|end_file_name|><|fim▁begin|>from __future__ import (absolute_import, division, print_function)
import unittest
from mantid.simpleapi import *
import numpy as np
import json
from AbinsModules import CalculateDWSingleCrystal, LoadCASTEP, AbinsTestHelpers
class AbinsCa... | # main test
def test_good_case(self):
self._good_case(name=self._c6h6) |
<|file_name|>rollup.config.js<|end_file_name|><|fim▁begin|>import uglify from 'rollup-plugin-uglify'
import buble from 'rollup-plugin-buble'
export default {<|fim▁hole|>}<|fim▁end|> | entry: 'js/index.js',
dest: 'public/bundle.js',
format: 'iife',
plugins: [buble(), uglify()], |
<|file_name|>test_PositionIncrement.py<|end_file_name|><|fim▁begin|># ====================================================================
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
... | pos = MultiFields.getTermPositionsEnum(reader, MultiFields.getLiveDocs(reader), "field", BytesRef("2"))
pos.nextDoc()
# second token should be at position 2
self.assertEqual(2, pos.nextPosition()) |
<|file_name|>ek_silverlight.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
try:
import re2 as re
except ImportError:
import re
from lib.cuckoo.common.abstracts import Signature
class Silverlight_JS(Signature):
name = "silverlight_js"
description = "执行伪装过的包含一个Silverlight对象的JavaScript,可能被用于漏洞攻击... | Signature.__init__(self, *args, **kwargs)
|
<|file_name|>mixins.py<|end_file_name|><|fim▁begin|>#!/bin/env python2
# -*- coding: utf-8 -*-
#
# This file is part of the VecNet Zika modeling interface.
# For copyright and licensing information about this package, see the
# NOTICE.txt and LICENSE.txt files in its top-level directory; they are
# available at https:/... | # This Source Code Form is subject to the terms of the Mozilla Public
# License (MPL), version 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/. |
<|file_name|>subauth.rs<|end_file_name|><|fim▁begin|>// Copyright © 2015, skdltmxn
// Licensed under the MIT License <LICENSE.md>
//! Types and macros for Subauthentication Packages.
STRUCT!{struct UNICODE_STRING {
Length: ::USHORT,
MaximumLength: ::USHORT,
Buffer: ::PWSTR,
}}
pub type PUNICODE_STRING = *mu... | LmChallengeResponse: STRING, |
<|file_name|>extern-prelude-extern-crate-proc-macro.rs<|end_file_name|><|fim▁begin|>// compile-pass
// edition:2018
extern crate proc_macro;<|fim▁hole|>use proc_macro::TokenStream; // OK
fn main() {}<|fim▁end|> | |
<|file_name|>run.py<|end_file_name|><|fim▁begin|>from flask import Flask, request, redirect, session
import twilio.twiml
import navigation
SECRET_KEY = 'donuts'
logging = True
app = Flask(__name__)
app.config.from_object(__name__)
def log(mesagge=""):
if logging:
print mesagge
@app.route("/", methods=[... | |
<|file_name|>AsakoTsuki.js<|end_file_name|><|fim▁begin|>const DrawCard = require('../../drawcard.js');
const { CardTypes } = require('../../Constants');
class AsakoTsuki extends DrawCard {
setupCardAbilities(ability) {<|fim▁hole|> when: {
onClaimRing: event => event.conflict && event.con... | this.reaction({
title: 'Honor a scholar character', |
<|file_name|>server.js<|end_file_name|><|fim▁begin|>var express = require('express');
var app = express();
var request = require("request");
var bodyParser = require('body-parser');
app.use(express.static(__dirname+"/public"));
app.use(express.static(__dirname+"/bower_components"));
app.use(bodyParser.json());
app.... | |
<|file_name|>user.js<|end_file_name|><|fim▁begin|>import * as types from 'constants/ActionTypes'
import jsCookie from 'js-cookie'
import history from 'history'
export const setUser = (user) => (dispatch) => {
dispatch({
type: types.SET_USER,<|fim▁hole|> payload: { ...user }
})
}<|fim▁end|> | |
<|file_name|>app.component.ts<|end_file_name|><|fim▁begin|>import {Component, OnInit} from '@angular/core';
import {AuthService} from "./auth/auth.service";
@Component({
moduleId: module.id,
selector: 'my-app',
templateUrl: './app.component.html',
styleUrls: ['./app.component.css']<|fim▁hole|>export cl... | }) |
<|file_name|>listdir.rs<|end_file_name|><|fim▁begin|>// Copyright 2014 Google Inc. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/lic... | |
<|file_name|>Sparkline.js<|end_file_name|><|fim▁begin|>dojo.provide("dojox.charting.widget.Sparkline");
dojo.require("dojox.charting.widget.Chart2D");
dojo.require("dojox.charting.themes.ET.greys");
(function(){
var d = dojo;
dojo.declare("dojox.charting.widget.Sparkline",
dojox.charting.widget.Chart2... | d.attr(series, i, this[i]);
}
|
<|file_name|>x11_window.cpp<|end_file_name|><|fim▁begin|>#include "nova_renderer/util/platform.hpp"
#ifdef NOVA_LINUX
#include "x11_window.hpp"
namespace nova::renderer {
x11_window::x11_window(uint32_t width, uint32_t height, const std::string& title) {
display = XOpenDisplay(nullptr);
if(displa... | x11_window::~x11_window() {
XUnmapWindow(display, window);
XDestroyWindow(display, window); |
<|file_name|>ChangePasswordData.js<|end_file_name|><|fim▁begin|>"use strict";
tutao.provide('tutao.entity.sys.ChangePasswordData');
/**
* @constructor
* @param {Object=} data The json data to store in this entity.
*/
tutao.entity.sys.ChangePasswordData = function(data) {
if (data) {
this.updateData(data);
... | * @return {string} The pwEncUserGroupKey of this ChangePasswordData. |
<|file_name|>AirplaySharp.js<|end_file_name|><|fim▁begin|>import React from 'react';
import createSvgIcon from './utils/createSvgIcon';
export default createSvgIcon(
<path d="M6 22h12l-6-6-6 6zM23 3H1v16h6v-2H3V5h18v12h-4v2h6V3z" /><|fim▁hole|>, 'AirplaySharp');<|fim▁end|> | |
<|file_name|>package.py<|end_file_name|><|fim▁begin|><|fim▁hole|>
from spack import *
class Voropp(MakefilePackage):
"""Voro++ is a open source software library for the computation of the
Voronoi diagram, a widely-used tessellation that has applications in many
scientific fields."""
homepage = "http:... | # Copyright 2013-2020 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT) |
<|file_name|>fallible_impl_from.rs<|end_file_name|><|fim▁begin|>use clippy_utils::diagnostics::span_lint_and_then;
use clippy_utils::ty::is_type_diagnostic_item;
use clippy_utils::{is_expn_of, match_panic_def_id, method_chain_args};
use if_chain::if_chain;
use rustc_hir as hir;
use rustc_lint::{LateContext, LateLintPas... | typeck_results: &'tcx ty::TypeckResults<'tcx>, |
<|file_name|>PointTargetGRG.py<|end_file_name|><|fim▁begin|># coding: utf-8
#
# Esri start of added imports
import sys, os, arcpy
# Esri end of added imports
# Esri start of added variables
g_ESRI_variable_1 = 'lyrFC'
g_ESRI_variable_2 = 'lyrTmp'
g_ESRI_variable_3 = 'ID'
g_ESRI_variable_4 = 'lyrOut'
g_ESRI_variable_5... | msgs = "ArcPy ERRORS:\n" + arcpy.GetMessages() + "\n" |
<|file_name|>pythonlight.py<|end_file_name|><|fim▁begin|>import sys
from PyQt4 import QtCore, QtGui, uic
import light
qtCreatorFile = "pythonlight.ui" # Enter file here.
Ui_MainWindow, QtBaseClass = uic.loadUiType(qtCreatorFile)
class LightApp(QtGui.QMainWindow, Ui_MainWindow):
def __init__(self):
QtGui.... | Ui_MainWindow.__init__(self)
self.setupUi(self)
self.light = light.Light() |
<|file_name|>models.py<|end_file_name|><|fim▁begin|>from otree.api import (
models, widgets, BaseConstants, BaseSubsession, BaseGroup, BasePlayer,
Currency as c, currency_range
)
from random import randint
author = 'Your name here'
doc = """
Your app description
"""
class Constants(BaseConstants):
name... | |
<|file_name|>Game.py<|end_file_name|><|fim▁begin|>from Start_up import*
from Player import Player, HealthBar
from Bullet import Bullet
from Enemy import Enemy
from Stopper import Stopper
from Particle import Particle
from Stars import Star, create_stars
from Package import EnemyDrop, HealthPack
from Notes import NoteCo... | self.star_list = create_stars("game")
self.note_controller = NoteController((width - 10, 40)) |
<|file_name|>test_write_xf.py<|end_file_name|><|fim▁begin|>###############################################################################
#
# Tests for XlsxWriter.
#
# Copyright (c), 2013-2015, John McNamara, jmcnamara@cpan.org
#
import unittest
from ...compatibility import StringIO
from ...styles import Styles
from ... | |
<|file_name|>longest-increasing-subsequence.py<|end_file_name|><|fim▁begin|>__author__ = 'yinjun'
class Solution:
"""
@param nums: The integer array<|fim▁hole|>
if nums == None or nums == []:
return 0
l = len(nums)
length = [0 for i in range()]
maxLength = 0
... | @return: The length of LIS (longest increasing subsequence)
"""
def longestIncreasingSubsequence(self, nums):
# write your code here |
<|file_name|>menu.py<|end_file_name|><|fim▁begin|>def app_logo_attr():
""" Return app logo LI attributes. """
attr = {
'_class': 'navbar-brand',
'_role': 'button'}
if request.controller == 'studies':
attr['_onclick'] = 'tocModal(event);'
attr['_title'] = 'Chapter Studies'
... | A('Poems', _class='nav-link', _href=URL('poems', 'index')),
_class='nav-item',
), |
<|file_name|>users_config_test.go<|end_file_name|><|fim▁begin|>package main
import (
"path/filepath"
"testing"
"github.com/stretchr/testify/assert"
)
var testDataDir = "testdata"
func TestUserConfig(t *testing.T) {
type testCase struct {
filename string
exepctedMapping map[string]string
expectedE... | testCase{"multiple-users.yml", map[string]string{
"alice@example.com": "@alice",
"Robert Johnson": "@robby"}, true}, |
<|file_name|>a00455.js<|end_file_name|><|fim▁begin|>var a00455 =
[
[ "UnicharIdArrayUtils", "a02761.html", null ],
[ "AmbigSpec", "a02765.html", "a02765" ],
[ "UnicharAmbigs", "a02769.html", "a02769" ],
[ "MAX_AMBIG_SIZE", "a00455.html#a66b35d22667233a1566433c6dd864463", null ],
[ "UnicharAmbigsVect... | [ "UnicharIdVector", "a00455.html#a3dad1b2dad5ed3069bdb4c971116b9c5", null ],
[ "AmbigType", "a00455.html#aa13017f5f891a1f9f95074bf26a5b222", [
[ "NOT_AMBIG", "a00455.html#aa13017f5f891a1f9f95074bf26a5b222af40a6c3f3fbd83ba09a6607f534349dc", null ], |
<|file_name|>test_npa.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
import unittest
from pyparsing import ParseException
from tests.utils.grammar import get_record_grammar
"""
CWR Non-Roman Alphabet Agreement Party Name grammar tests.
The following cases are tested:
"""
__author__ = 'Bernardo Martínez Ga... | |
<|file_name|>page_privacy.py<|end_file_name|><|fim▁begin|>from django.core.exceptions import PermissionDenied
from django.shortcuts import get_object_or_404
from wagtail.wagtailcore.models import Page, PageViewRestriction
from wagtail.wagtailadmin.forms import PageViewRestrictionForm
from wagtail.wagtailadmin.modal_wo... | }
) |
<|file_name|>issue-3953.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.apache.org/lice... | |
<|file_name|>auth.go<|end_file_name|><|fim▁begin|>package controllers
import (
"github.com/revel/revel"
"AuthKeyPush/app/models"
)
type Auth struct {
*revel.Controller
}
func (c Auth) Github(code string) revel.Result {
login := models.GitHub(code)
if login == true {
c.Session["login"] = "true"
} else {
c.... | return c.Redirect("/")
} |
<|file_name|>vm.plugins.scratch.browser.js<|end_file_name|><|fim▁begin|>"use strict";
/*
* Copyright (c) 2013-2019 Bert Freudenberg
*
* 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 with... | var url = this.stackNonInteger(0).bytesAsString();
if (url == "") return false;
if (/^\/SqueakJS\//.test(url)) {
url = url.slice(10); // remove file root |
<|file_name|>ModelDefinition.java<|end_file_name|><|fim▁begin|>/*
* Copyright 2017 StreamSets 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/license... | |
<|file_name|>utils.py<|end_file_name|><|fim▁begin|># Copyright 2015 PerfKitBenchmarker Authors. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.or... | if self.__connection is None:
self.__authenticate()
return self.__connection
|
<|file_name|>models.py<|end_file_name|><|fim▁begin|>from flask.ext.sqlalchemy import SQLAlchemy
from . import db
class Role(db.Model):
__tablename__='roles'
id=db.Column(db.Integer,primary_key=True)
name=db.Column(db.String(64),unique=True)
users=db.relationship('User',backref='role')
def __repr__(s... | def __repr__(self):
return '<Username>{}</Username>'.format(self.username) |
<|file_name|>qa_mosaics_T1w.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
from glob import glob
from vlpp.utils import save_json
from vlpp.qamosaic import Mosaic
def main():
# Usefull directories
os.mkdir("data")
# Informations
participant_id = "${sub.sub}... | |
<|file_name|>ExtendedErrorBar.py<|end_file_name|><|fim▁begin|>#=======================================================================
# Author: Donovan Parks
#
# Extended error bar plot.
#
# Copyright 2011 Donovan Parks
#
# This file is part of STAMP.
#
# STAMP is free software: you can redistribute it and/or modify
#... | axErrorbar.set_ylim([-1, len(features)])
for label in axErrorbar.get_yticklabels(): |
<|file_name|>reports.component.ts<|end_file_name|><|fim▁begin|>import { Component, OnInit } from '@angular/core';
import { DataService } from '../service/data.service';
import { ReportModel } from '../model/reportmodel';
import { Utils } from '../util/utils'
import { RouterModule, Routes, Router, ActivatedRoute } from ... | |
<|file_name|>window.rs<|end_file_name|><|fim▁begin|>use std::{collections::VecDeque, rc::Rc};
use crate::{
api::prelude::*, proc_macros::*, shell::prelude::WindowRequest, themes::theme_orbtk::*,
};
// --- KEYS --
pub static STYLE_WINDOW: &str = "window";
// --- KEYS --
// internal type to handle dirty widgets.
t... | self.resize(width, height, ctx);
} |
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|>from .. import Provider as CompanyProvider
class Provider(CompanyProvider):
formats = (
"{{last_name}} {{company_suffix}}",
"{{last_name}} {{last_name}} {{company_suffix}}",
"{{large_company}}",
)
large_companies = (
"A... | "Azfruittrade",
"AF Holding",
"Azinko Holding",
"Gilan Holding", |
<|file_name|>create_pretraining_data.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
#
# http... | |
<|file_name|>cellSpec.ts<|end_file_name|><|fim▁begin|>import * as Jungle from '../../../jungle'
const {Construct, Composite, Domain, Cell, j, J} = Jungle;
import * as Debug from '../../../util/debug'
describe("A Cell", function () {
Debug.Crumb.defaultOptions.log = console;
Debug.Crumb.defaultOptions.debug ... | expect(cell.shell.scan(':mouth')[":mouth"]).toBe(undefined)
}) |
<|file_name|>large_profile_extender.py<|end_file_name|><|fim▁begin|># Copyright 2014 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.
from profile_creators import cookie_profile_extender
from profile_creators import history... | self.finder_options)
extender.Run() |
<|file_name|>glue.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 cssparser::{Parser, ParserInput};
use cssparser::ToCss as Pa... | pub extern "C" fn Servo_ParseStyleAttribute(
data: *const nsACString,
raw_extra_data: *mut URLExtraData, |
<|file_name|>main.cpp<|end_file_name|><|fim▁begin|>class NumMatrix {
public:
NumMatrix(vector<vector<int>> &matrix) {
// error handle
if (matrix.size() == 0 || matrix[0].size() == 0) {
_m = 0;
_n = 0;
return;
}
_m = matrix.size();
_n = matrix[0].size();
_sum = vector<vector<... | |
<|file_name|>a.py<|end_file_name|><|fim▁begin|><|fim▁hole|>print(s[:4],s[4:])<|fim▁end|> | s = input().rstrip() |
<|file_name|>http_request.go<|end_file_name|><|fim▁begin|>package data_table
import (
"bytes"
"encoding/json"
"fmt"
"github.com/julienschmidt/httprouter"
"net/http"
"net/url"
)
func DataStoreHandler(tableStore TableStore) func(http.ResponseWriter, *http.Request, httprouter.Params) {
return func(w http.Response... | |
<|file_name|>translation.py<|end_file_name|><|fim▁begin|>import json
from pprint import pprint
import requests
from telegram import Update, Bot
from telegram.ext import CommandHandler
from tg_bot import dispatcher
# Open API key
API_KEY = "6ae0c3a0-afdc-4532-a810-82ded0054236"
URL = "http://services.gingersoftware.c... |
prev_end = 0 |
<|file_name|>CreateSessionTest.java<|end_file_name|><|fim▁begin|>// Licensed to the Software Freedom Conservancy (SFC) under one
// or more contributor license agreements. See the NOTICE file
// distributed with this work for additional information
// regarding copyright ownership. The SFC licenses this file
// to yo... | // The status field is used by local ends to determine whether or not the session is a JWP one.
assertThat(all.get("status")).matches(obj -> ((Number) obj).intValue() == ErrorCodes.SUCCESS);
|
<|file_name|>lib.rs<|end_file_name|><|fim▁begin|>//! A TIS-100 emulator.
//!
//! # Example
//!
//! ```
//! use tis_100::save::parse_save;
//! use tis_100::machine::Sandbox;
//!
//! // This program reads the value from the console and simply passes it to the console output.
//! let src = "@1\nMOV UP DOWN\n@5\nMOV UP DOW... | extern crate hlua;
extern crate vec_map;
pub mod core; |
<|file_name|>fragment.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/. */
//! The `Fragment` type, which represents the leaves of the ... | node: node.opaque(), |
<|file_name|>medium_maximum_xor_of_two_numbers_in_an_array.cpp<|end_file_name|><|fim▁begin|>#include <vector>
#include <iostream>
#include <unordered_set>
#include <unordered_map>
#include <map>
#include <sstream>
#include <algorithm>
#include <queue>
#include <set>
#include <functional>
#include <stdio.h>
#include <st... | |
<|file_name|>patternmatch.py<|end_file_name|><|fim▁begin|>import sys
import os
import time
import numpy
import cv2
import cv2.cv as cv
from PIL import Image
sys.path.insert(0, os.path.join(
os.path.dirname(os.path.dirname(os.path.dirname(__file__)))))
from picture.util import define
from picture.util.system impor... | os.path.join(define.APP_TMP,"login.png")) |
<|file_name|>into_searcher.rs<|end_file_name|><|fim▁begin|>#![feature(core)]
extern crate core;
#[cfg(test)]
mod tests {
use core::str::pattern::Searcher;
use core::str::pattern::SearchStep::{Match, Reject, Done};
use core::str::pattern::StrSearcher;
use core::str::pattern::Pattern;
// #[derive(Co... | // ($t:ty, $pmap:expr, $smap:expr) => { |
<|file_name|>font_template.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 std::fs::File;
use std::io::Read;
use string_cache:... | },
None => {
// TODO: Handle file load failure!
let mut file = File::open(&*identifier).unwrap(); |
<|file_name|>views.py<|end_file_name|><|fim▁begin|># Patchless XMLRPC Service for Django
# Kind of hacky, and stolen from Crast on irc.freenode.net:#django
# Self documents as well, so if you call it from outside of an XML-RPC Client
# it tells you about itself and its methods
#
# Brendan W. McAdams <brendan.mcadams@th... | from django.template import Context, Template
from django import forms |
<|file_name|>annotate.py<|end_file_name|><|fim▁begin|># Portions Copyright (c) Meta Platforms, Inc. and affiliates.
#
# This software may be used and distributed according to the terms of the
# GNU General Public License version 2.
# Copyright Mercurial Contributors
#
# This software may be used and distributed accord... | needed[p] -= 1
hist[f] = curr
del pcache[f] |
<|file_name|>search.rs<|end_file_name|><|fim▁begin|>use std::cmp::Ordering;
use std::collections::{BinaryHeap, HashMap, HashSet};
use std::hash::Hash;
/// A node in a graph with a regular grid.
pub trait GridNode: PartialEq + Eq + Clone + Hash + PartialOrd + Ord {
/// List the neighbor nodes of this graph node.
... | astar_path(8, &12, |x| neighbors(8, x)) |
<|file_name|>ServiceInfo.py<|end_file_name|><|fim▁begin|>from Components.Converter.Converter import Converter
from enigma import iServiceInformation, iPlayableService
from Components.Element import cached
from Tools.Transponder import ConvertToHumanReadable
class ServiceInfo(Converter, object):
HAS_TELETEXT = 0
IS_M... | AUDIOTRACKS_AVAILABLE = 18
SUBTITLES_AVAILABLE = 19
FREQ_INFO = 20 |
<|file_name|>Renderer2D.Effort.js<|end_file_name|><|fim▁begin|>window.Rendxx = window.Rendxx || {};
window.Rendxx.Game = window.Rendxx.Game || {};
window.Rendxx.Game.Ghost = window.Rendxx.Game.Ghost || {};
window.Rendxx.Game.Ghost.Renderer2D = window.Rendxx.Game.Ghost.Renderer2D || {};
(function (RENDERER) {
var ... | tex[_Data.Name.Blood] = frames;
// electric |
<|file_name|>type_traits.hpp<|end_file_name|><|fim▁begin|>#ifndef __CXXU_TYPE_TRAITS_H__
#define __CXXU_TYPE_TRAITS_H__
#include <type_traits>
#include <memory>
namespace cxxu {
template <typename T>
struct is_shared_ptr_helper : std::false_type
{
typedef T element_type;
static
element_type& deref(eleme... | |
<|file_name|>dash.ts<|end_file_name|><|fim▁begin|>/// <reference path="apimanPlugin.ts"/>
module Apiman {
export var DashController = _module.controller("Apiman.DashController",
['$scope', 'PageLifecycle', 'CurrentUser',
($scope, PageLifecycle, CurrentUser) => {
PageLifecycle.loadPage(... | });
}]);
} |
<|file_name|>lib.setAction.js<|end_file_name|><|fim▁begin|>'use strict';
const setAction = (creep) => {
if (creep.memory.action && creep.carry.energy === 0 || creep.memory.role === 'attacker' || creep.memory.role === 'healer'){
creep.memory.action = false;
}
if (!creep.memory.action && creep.carry.energy ==... | creep.memory.action = true;
|
<|file_name|>tls-try-with.rs<|end_file_name|><|fim▁begin|>// Copyright 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/li... | 132 |
<|file_name|>mod.rs<|end_file_name|><|fim▁begin|>mod state;<|fim▁hole|>pub use self::state::*;
pub use self::xml::generate;<|fim▁end|> | mod xml;
|
<|file_name|>serializers.py<|end_file_name|><|fim▁begin|>from rest_framework import serializers as ser
from api.base.serializers import ShowIfVersion
from api.providers.serializers import PreprintProviderSerializer
class DeprecatedPreprintProviderSerializer(PreprintProviderSerializer):
class Meta:
type_ =... | |
<|file_name|>process.rs<|end_file_name|><|fim▁begin|>// @lecorref - github.com/lecorref, @geam - github.com/geam,
// @adjivas - github.com/adjivas. See the LICENSE
// file at the top-level directory of this distribution and at
// https://github.com/adjivas/krpsim
//
// This file may not be copied, modified, or distribu... | use self::krpsim::format::stock::inventory::Inventory;
use self::krpsim::format::stock::ressource::Ressource;
use self::krpsim::format::operate::process::Process;
|
<|file_name|>aggregation_info.py<|end_file_name|><|fim▁begin|>from util import hash256, hash_pks
from copy import deepcopy
class AggregationInfo:
"""
AggregationInfo represents information of how a tree of aggregate
signatures was created. Different tress will result in different
signatures, due to ex... | break
if not info_collides:
non_colliding_infos.append(info) |
<|file_name|>response.py<|end_file_name|><|fim▁begin|># urllib3/response.py
# Copyright 2008-2012 Andrey Petrov and contributors (see CONTRIBUTORS.txt)
#
# This module is part of urllib3 and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php
import gzip
import logging
import zlib
... | data = self._fp.read()
else:
return self._fp.read(amt)
|
<|file_name|>wmove.rs<|end_file_name|><|fim▁begin|>#[macro_use]
extern crate cli_util;
extern crate wlib;
use std::env;
use wlib::window;
#[derive(Copy, Clone)]
enum Mode {
Relative,
Absolute
}
fn main() {
let name = cli_util::name(&mut env::args());
parse_args!{
description: "move window",
... | let disp = try!(wlib::Display::open()); |
<|file_name|>nsPlacesTransactionsService.js<|end_file_name|><|fim▁begin|>/* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* ***** BEGIN LICENSE BLOCK *****
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Mozilla Public License Version
* 1.1 (the "... | this._container = PlacesUtils.bookmarks.getFolderIdForItem(this._id);
var annos = PlacesUtils.getAnnotationsForItem(this._id);
// Exclude livemark service annotations, those will be recreated automatically
var annosToExclude = ["livemark/feedURI", |
<|file_name|>init-res-into-things.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... | |
<|file_name|>new-thread.controller.js<|end_file_name|><|fim▁begin|>(function(){
function newThreadCtrl($location, $state, MessageEditorService){
var vm = this;
vm.getConstants = function(){
return MessageEditorService.pmConstants;
};
vm.newThread = MessageEditorService.getThreadTemplate($location.se... | |
<|file_name|>pit_shrp.cpp<|end_file_name|><|fim▁begin|>/* ------------------------------------------------------------------
* Copyright (C) 1998-2009 PacketVideo
*
* 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 ... | * Unless required by applicable law or agreed to in writing, software |
<|file_name|>file.go<|end_file_name|><|fim▁begin|>package build
import "go/ast"
func NewFile(pkg string, decl ...ast.Decl) *ast.File {
return &ast.File{
Name: &ast.Ident{
Name: pkg,
},
Decls: decl,<|fim▁hole|><|fim▁end|> | }
} |
<|file_name|>tree.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.
cr.define('cr.ui', function() {
// require cr.ui.define
// require cr.ui.limitInputWidth
/**
... | return getComputedStyle(this.labelElement).backgroundImage.slice(4, -1);
},
set icon(icon) {
return this.labelElement.style.backgroundImage = url(icon); |
<|file_name|>cases.py<|end_file_name|><|fim▁begin|>from aospy import Run
am2_control = Run(
name='am2_control',
description=(
'Preindustrial control simulation.'
),
data_in_direc=('/archive/Yi.Ming/sm2.1_fixed/'
'SM2.1U_Control-1860_lm2_aie_rerun6.YIM/pp'),
data_in_dur=5,... | 'am2clim_reyoi_tropics_sp_SI/gfdl.ncrc2-default-prod/pp'), |
<|file_name|>webpack.config.js<|end_file_name|><|fim▁begin|>require('dotenv').config({ silent: true });
const webpack = require('webpack');
const appConfig = require('@flumens/webpack-config');
appConfig.entry = ['index.js'];
const required = ['APP_SENTRY_KEY', 'APP_INDICIA_API_KEY'];
const development = {
APP_IND... |
appConfig.module.rules.push({ |
<|file_name|>IteratorValidatorCreator.java<|end_file_name|><|fim▁begin|>/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
... | import org.apache.drill.shaded.guava.com.google.common.base.Preconditions;
public class IteratorValidatorCreator implements BatchCreator<IteratorValidator>{ |
<|file_name|>test_parsers.py<|end_file_name|><|fim▁begin|>"""Tests for parsers.py"""
import asyncio
import unittest
import unittest.mock
from aiohttp import errors
from aiohttp import parsers
class StreamParserTests(unittest.TestCase):
DATA = b'line1\nline2\nline3\n'
def setUp(self):
self.lines_pa... | |
<|file_name|>mod.rs<|end_file_name|><|fim▁begin|>// Copyright 2015, 2016 Ethcore (UK) Ltd.
// This file is part of Parity.
// Parity 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... | // GNU General Public License for more details.
|
<|file_name|>resume.js<|end_file_name|><|fim▁begin|><|fim▁hole|>
import '../styles/custom.css';
const Resume = () => (
<div className="resume-page">
<Head />
<iframe frameBorder="0" className="resume-frame" src="https://souvik.me/resume.pdf"></iframe>
<style jsx>{`
.resume-frame {
... | import React from 'react';
import Head from '../components/head'; |
<|file_name|>index.ts<|end_file_name|><|fim▁begin|>/**
* @license
* Copyright Google Inc. All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.io/license
*/
/**
* @module
* @description
* This module provides a set of c... | * A collection of Angular pipes that are likely to be used in each and every application.
*/
export const COMMON_PIPES = [
AsyncPipe, |
<|file_name|>Interpreter.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
import datetime
import os
#compsiteとcommandをあわせたような形
#ContextがhandlerでCommandが処理
class JobCommand(object):
def execute(self, context):
if context.getCurrentCommand() != 'begin':
raise Exception('illegal command ' ... | def execute(command):
job = JobCommand() |
<|file_name|>TDelay.py<|end_file_name|><|fim▁begin|># -*- encoding: utf-8 -*-
from supriya.tools.ugentools.UGen import UGen
class TDelay(UGen):
r'''A trigger delay.
::
>>> source = ugentools.Dust.kr()
>>> tdelay = ugentools.TDelay.ar(
... duration=0.1,
... source=sour... | source=None,
): |
<|file_name|>admin.py<|end_file_name|><|fim▁begin|>from django.contrib import admin<|fim▁hole|>from cobra.core.loading import get_model<|fim▁end|> | |
<|file_name|>readjson.py<|end_file_name|><|fim▁begin|>import json<|fim▁hole|>data = json.load(json_data)
pprint(data)
json_data.close()<|fim▁end|> | from pprint import pprint
json_data=open('jsonFormated')
#json_data=open('jsonFile')
|
<|file_name|>filtergui.js<|end_file_name|><|fim▁begin|>define([], function () {
return function (distributor) {
var container = document.createElement("ul")
container.classList.add("filters")
var div = document.createElement("div")
function render(el) {
el.appendChild(div)
}
function f... | |
<|file_name|>mem.go<|end_file_name|><|fim▁begin|>package mem
import (
"encoding/json"
"github.com/theothertomelliott/gopsutil-nocgo/internal/common"
)
var invoke common.Invoker
func init() {
invoke = common.Invoke{}
}
// Memory usage statistics. Total, Available and Used contain numbers of bytes
// for human co... |
func (m VirtualMemoryStat) String() string {
s, _ := json.Marshal(m)
return string(s) |
<|file_name|>MyPojoUser.java<|end_file_name|><|fim▁begin|>/*******************************************************************************
* Copyright (c) 2012 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public Lic... | */
@Dependent
public class MyPojoUser {
|
<|file_name|>test_utils.py<|end_file_name|><|fim▁begin|>from __future__ import unicode_literals, division, absolute_import
from builtins import * # noqa pylint: disable=unused-import, redefined-builtin
from datetime import datetime
import math
import pytest
from flexget.utils import json
from flexget.utils.tools im... | |
<|file_name|>webglrenderingcontext.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 byteorder::{NativeEndian, ReadBytesExt, Wri... | cx: *mut JSContext,
uniform: Option<&WebGLUniformLocation>, |
<|file_name|>test_wheel.py<|end_file_name|><|fim▁begin|>"""Tests for wheel binary packages and .dist-info."""
import os
import pytest
from mock import patch, Mock
from pip._vendor import pkg_resources
from pip import pep425tags, wheel
from pip.exceptions import InvalidWheelFilename, UnsupportedWheel
from pip.utils im... |
def test_single_digit_version(self):
w = wheel.Wheel('simple-1-py2-none-any.whl') |
<|file_name|>long64.rs<|end_file_name|><|fim▁begin|><|fim▁hole|><|fim▁end|> | #pragma version(1)
#pragma rs java_package_name(foo)
long l = 1L << 32; |
<|file_name|>window.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/. */
//! A windowing implementation using glutin.
use compositing:... | display: ptr::null_mut()
}
}
|
<|file_name|>numword_en_gb.py<|end_file_name|><|fim▁begin|># coding: utf-8
#This file is part of numword. The COPYRIGHT file at the top level of
#this repository contains the full copyright notices and license terms.
'''
numword for EN_GB
'''
from numword_en import NumWordEN
class NumWordENGB(NumWordEN):
'''
... | return _NW.ordinal(value)
def ordinal_number(value): |
<|file_name|>faMapMarkedAlt.js<|end_file_name|><|fim▁begin|>'use strict';
Object.defineProperty(exports, '__esModule', { value: true });
var prefix = 'fas';
var iconName = 'map-marked-alt';
var width = 576;
var height = 512;
var ligatures = [];
var unicode = 'f5a0';
var svgPathData = 'M288 0c-69.59 0-126 56.41-126 126 ... | svgPathData
]};
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.