prompt large_stringlengths 70 991k | completion large_stringlengths 0 1.02k |
|---|---|
<|file_name|>actions.js<|end_file_name|><|fim▁begin|>import { createAction } from 'redux-actions';
import { APP_LAYOUT_CHANGE, APP_LAYOUT_INIT } from './constants';
// 选中菜单列表项
const appLayoutInit = createAction(APP_LAYOUT_INIT);
export const onAppLayoutInit = (key) => {
return (dispatch) => {
dispatch(appLayoutI... | };
}; |
<|file_name|>S_PARTY_MEMBER_INTERVAL_POS_UPDATE.py<|end_file_name|><|fim▁begin|>from util.tipo import tipo
class S_PARTY_MEMBER_INTERVAL_POS_UPDATE(object):<|fim▁hole|>
def __init__(self, tracker, time, direction, opcode, data):
print(str(type(self)).split('.')[3]+'('+str(len(data))+'): '+ str(data.get_arra... | |
<|file_name|>api_outbound_test.go<|end_file_name|><|fim▁begin|>package testnewsfeed
import (
"time"
"testing"
"github.com/go-redis/redis"
sw "../go"
)
type MockErrorWrapper struct {
t *testing.T
}
func (lw MockErrorWrapper) LogError(err error, format string, status int) {
lw.t.Errorf(format, err... | f := sw.Friend{
Id: id, |
<|file_name|>integ_test.go<|end_file_name|><|fim▁begin|>// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT.
//go:build go1.16 && integration
// +build go1.16,integration
package appstream_test
import (
"context"
"testing"
"time"
"github.com/aws/aws-sdk-go/aws"
"github.com/aws/aws-sdk-go/aws/aw... | sess := integration.SessionWithDefaultRegion("us-west-2") |
<|file_name|>test_image_anchor05.py<|end_file_name|><|fim▁begin|>###############################################################################
#
# Tests for XlsxWriter.
#
# Copyright (c), 2013-2015, John McNamara, jmcnamara@cpan.org
#
from ..excel_comparsion_test import ExcelComparisonTest
from ...workbook import Wo... | |
<|file_name|>0030_auto__add_field_invoice_date_of_issue.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding field 'Invoice.date... | 'Meta': {'object_name': 'Time'}, |
<|file_name|>test_rng.rs<|end_file_name|><|fim▁begin|>extern crate cryptopals;
extern crate rand;
extern crate time;
use cryptopals::crypto::rng::{MT, untemper};
use rand::{Rng, SeedableRng, thread_rng};
use time::{get_time};
#[test]
fn test_rng_deterministic() {
let mut m1: MT = SeedableRng::from_seed(314159);
... | }
#[test] |
<|file_name|>ListPlayers.java<|end_file_name|><|fim▁begin|>package gui;
import java.awt.Color;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.util.List;
import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.JScrollPane;
import javax.... | statistics.tabStatistics.setValueAt(s.getTimesPlayed(), newRow, 2);
newRow++;
} |
<|file_name|>oauth2_test.go<|end_file_name|><|fim▁begin|>// Copyright 2014 The oauth2 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 oauth2
import (
"encoding/json"
"errors"
"fmt"
"io/ioutil"
"net/http"
"net/http/http... | t.Errorf("res.Body = %q; want %q", string(body), expected)
}
w.Header().Set("Content-Type", "application/x-www-form-urlencoded") |
<|file_name|>Ventilation_Mining_Python_Toolbox.py<|end_file_name|><|fim▁begin|>import math
"""
The Purpose of this Program is to automate the task of Ventilation Surveying in Underground Mining Engineering.
This program can accept input of tabulated values (in csv file) for Leapfrogging and Roving-Base Altimeter
... | def LeapfroggingAltimeter(User_List ="Table63_AltimeterLeapfrogging.csv" ):
|
<|file_name|>unwindtest.cc<|end_file_name|><|fim▁begin|>/* Area: ffi_closure, unwind info
Purpose: Check if the unwind information is passed correctly.
Limitations: none.
PR: none.<|fim▁hole|>#include "ffitestcxx.h"
#if defined HAVE_STDINT_H
#include <stdint.h>
#endif
#if defined HAVE_INTTYPES_H
#include <i... | Originator: Jeff Sturm <jsturm@one-point.com> */
/* { dg-do run } */
|
<|file_name|>search.py<|end_file_name|><|fim▁begin|># Author: Nic Wolfe <nic@wolfeden.ca>
# URL: http://code.google.com/p/sickbeard/
#
# This file is part of SickGear.
#
# SickGear 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 S... | else:
foundResults[curProvider.name][epNum] = [bestSeasonResult] |
<|file_name|>xmlparser.cc<|end_file_name|><|fim▁begin|>/** @file io/xmlparser.cc xml parsing class used in xmlreader.cc */
///////////////////////////////////////////////////////////////////////
//
// Copyright (c) 2004-2004 California Institute of Technology
// Copyright (c) 2004-2007 University of Southern Californi... | io::xml_parser* p = static_cast<io::xml_parser*>(data);
GVX_ASSERT(p != nullptr); |
<|file_name|>fundrawtransaction.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python3
# Copyright (c) 2014-2016 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
from test_framework.test_framework import... | |
<|file_name|>saved_action_approval.py<|end_file_name|><|fim▁begin|># Copyright (c) 2015 Tanium Inc
#
# Generated from console.wsdl version 0.0.1
#
#<|fim▁hole|>
from .base import BaseType
class SavedActionApproval(BaseType):
_soap_tag = 'saved_action_approval'
def __init__(self):
BaseType.__ini... | |
<|file_name|>LeveledUp.tsx<|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/.
*/
import React from 'react';
import { styled } from '@cs... | justify-content: flex-end;
background: linear-gradient(to right, transparent, rgba(255, 255, 255, 0.7));
padding-top: 5px; |
<|file_name|>webpack.prod.config.js<|end_file_name|><|fim▁begin|>const path = require('path')
const merge = require('webpack-merge')
const webpack = require('webpack')
const baseWebpackConfig = require('./webpack.base.config')
const ExtractTextPlugin = require("extract-text-webpack-plugin")
const OptimizeCSSPlugin = re... | new OptimizeCSSPlugin({
cssProcessorOptions: {
safe: true
} |
<|file_name|>customFormlayout.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
"""
formlayout
==========
Module creating Qt form dialogs/layouts to edit various type of parameters
formlayout License Agreement (MIT License)
------------------------------------------
Copyright (c) 2009 Pierre Raybaut
Permissi... | qcolor.setRgbF(*rgba) |
<|file_name|>slice_dump.py<|end_file_name|><|fim▁begin|>"""
>>> sd = SliceDump()
<|fim▁hole|> >>> sd[1]
1
>>> sd[2:5]
slice(2, 5, None)
>>> sd[:2]
slice(None, 2, None)
>>> sd[7:]
slice(7, None, None)
>>> sd[:]
slice(None, None, None)
>>> sd[1:9:3]
slice(1... | |
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|>from __future__ import absolute_import
from .base import WhiteNoise
__version__ = '2.0.3'
<|fim▁hole|><|fim▁end|> | __all__ = ['WhiteNoise'] |
<|file_name|>main.go<|end_file_name|><|fim▁begin|>package main
import (
"fmt"
"log"
"github.com/jackytck/projecteuler/tools"
)
func match(p, s string) bool {
m := make(map[rune]bool)
for _, r := range s {
m[r] = true
}
var e string<|fim▁hole|> if m[r] {
e += string(r)
}
}
return e == s
}
func check... | for _, r := range p { |
<|file_name|>tasks.ts<|end_file_name|><|fim▁begin|>import request from './request'
export type UUID = string
export type DateTime = string
// for options see class names here: https://github.com/GothenburgBitFactory/taskwarrior/blob/01696a307b6785be973e3e6428e6ade2a3872c1e/src/columns/ColUDA.h#L36
export type Taskwar... | urgency: 'numeric',
description: 'string',
project: 'string',
due: 'date', |
<|file_name|>strength_and_resolution.py<|end_file_name|><|fim▁begin|>############################################
# [config.py]
# CONFIGURATION SETTINGS FOR A PARTICULAR METER
#
#
# Set the long-form name of this meter
name = "*PEAK only"
#
# [Do not remove or uncomment the following line]
Cs={}
#######################... | #
# A weak metrical position should not contain any stressed syllables:
#Cs['stress.w=>-p']=1
# |
<|file_name|>test_requesocks.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python3
# requires:
# - pysocks for socks5 proxy socket, required by requesocks
# - certifi for HTTPS certificate validation, also used in depths of requesocks
# - requesocks
import requesocks
import certifi
#SOCKS5_PROXY = '127.0.0.1:9050'
SO... | }
session.headers.update({'user-agent': USER_AGENT}) |
<|file_name|>tenantaccessgit.go<|end_file_name|><|fim▁begin|>package apimanagement
// Copyright (c) Microsoft and contributors. 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... | "resourceGroupName": autorest.Encode("path", resourceGroupName), |
<|file_name|>discover.js<|end_file_name|><|fim▁begin|>import Ember from 'ember';
import moment from 'moment';
import dateFormat from '../utils/date-format';
export default Ember.Controller.extend({
loadingMeta: false,
notify: Ember.inject.service(),
aggController: Ember.inject.controller('discover.aggregate'),... | label: 'Denver, CO',
bounds: [
[39.914247, -105.109927], // NW corner
[39.614430, -104.600296], // SE corner |
<|file_name|>status.go<|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://www.apac... | |
<|file_name|>shapefile.py<|end_file_name|><|fim▁begin|>"""
hapefile.py
Provides read and write support for ESRI Shapefiles.
author: jlawhead<at>geospatialpython.com
date: 20110927
version: 1.1.4
Compatible with Python versions 2.4-3.x
"""
from struct import pack, unpack, calcsize, error
import os
import sys
import tim... | if isinstance(v, str):
# For python 3 encode str to bytes. |
<|file_name|>Preferences.cpp<|end_file_name|><|fim▁begin|>//
// Preferences.cpp
//
// $Id: //poco/1.7/OSP/samples/Preferences/src/Preferences.cpp#1 $
//
// Copyright (c) 2007-2016, Applied Informatics Software Engineering GmbH.
// All rights reserved.
//
// SPDX-License-Identifier: Apache-2.0
//
#include "Poco/OSP/Bu... | /// of the PreferencesService.
{ |
<|file_name|>options.py<|end_file_name|><|fim▁begin|>from __future__ import absolute_import
import logging
import six
from datetime import timedelta
from django.utils import timezone
from sentry.models import Option
from sentry.options import default_manager
from sentry.options.manager import UnknownOption
from sent... |
ONE_HOUR = 60 * 60
logger = logging.getLogger("sentry")
|
<|file_name|>_kubernetes.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python
# Copyright: (c) 2015, Google Inc. All Rights Reserved.
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE... | certificate_authority_data:
description: |
<|file_name|>jobpoller.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python
import boto3
import shutil
import zipfile
from zipfile import ZipFile, ZipInfo
import os
import tempfile
import time
import threading
from os.path import join
from botocore.client import Config
class JobPoller:
def __init__(self, action_ty... | |
<|file_name|>Solution.java<|end_file_name|><|fim▁begin|>package asdf.test;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Stack;
public class Solution {
/**
* (反转单词串 ) Given an input string, reverse the string word by word.
*
* For example,... | |
<|file_name|>OperatorNodes.java<|end_file_name|><|fim▁begin|>/*
* Copyright 2008 Google Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICE... | @Override public Kind getKind() { return Kind.EQUAL_OP_NODE; }
@Override public EqualOpNode clone() { return new EqualOpNode(this); }
} |
<|file_name|>UI_openPathTool.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'openPathTool.ui'
#
# Created by: PyQt4 UI code generator 4.11.4
#
# WARNING! All changes made in this file will be lost!
from PyQt4 import QtCore, QtGui
try:
_fromUtf8 = QtCo... | ui = Ui_MainWindow() |
<|file_name|>bndcg.py<|end_file_name|><|fim▁begin|># Copyright 2021 The TensorFlow Authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
... | self._check_shape(query_labels, match_mask) |
<|file_name|>feedbackRoutes.js<|end_file_name|><|fim▁begin|>var express = require('express');
var routes = function (Page) {
var feedbackController = require('../controllers/feedbackController')(Page);
var feedbackRouter = express.Router();
feedbackRouter.route('/')
.get(feedbackController.findBy... |
return feedbackRouter;
}; |
<|file_name|>branches.go<|end_file_name|><|fim▁begin|>//
// Copyright 2015, Sander van Harmelen
//
// 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/LI... | // 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|>txpool.spec.ts<|end_file_name|><|fim▁begin|>import tape from 'tape'
import Common, { Chain, Hardfork } from '@ethereumjs/common'
import { FeeMarketEIP1559Transaction } from '@ethereumjs/tx'
import { Block } from '@ethereumjs/block'
import { PeerPool } from '../../lib/net/peerpool'
import { TxPool } from '.... | pool.stop()
pool.close() |
<|file_name|>query_task.js<|end_file_name|><|fim▁begin|>/**
* @license
* Copyright 2014 The Lovefield Project 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 ... | // Default implementation is a no-op.
}; |
<|file_name|>bitcoin_pt_BR.ts<|end_file_name|><|fim▁begin|><?xml version="1.0" ?><!DOCTYPE TS><TS language="pt_BR" version="2.0">
<defaultcodec>UTF-8</defaultcodec>
<context>
<name>AboutDialog</name>
<message>
<location filename="../forms/aboutdialog.ui" line="+14"/>
<source>About Molecule... | </message>
<message>
<location line="-78"/>
<source>Wallet</source>
|
<|file_name|>binding_files.rs<|end_file_name|><|fim▁begin|>use super::write_file;
use anyhow::{Context, Result};
use std::path::{Path, PathBuf};
use std::{fs, str};
const BINDING_CC_TEMPLATE: &'static str = include_str!("./templates/binding.cc");
const BINDING_GYP_TEMPLATE: &'static str = include_str!("./templates/bin... | |
<|file_name|>_deprecated_nilsimsa.py<|end_file_name|><|fim▁begin|># Copyright (C) MetaCarta, Incorporated.
#
# 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.
#
# This program is distributed... | def compare_hexdigests( digest1, digest2 ): |
<|file_name|>app-root.d.ts<|end_file_name|><|fim▁begin|>import { ComponentFactoryResolver, ElementRef, OnInit, OpaqueToken, Renderer, ViewContainerRef } from '@angular/core';
import { App } from './app';
import { Config } from '../../config/config';
import { Ion } from '../ion';
import { OverlayPortal } from '../nav/ov... | * @private
*/
_disableScroll(shouldDisableScroll: boolean): void;
stopScroll(): Promise<boolean>; |
<|file_name|>mock.rs<|end_file_name|><|fim▁begin|>use std::{
io::{self, Cursor, Read, Write},
pin::Pin,
task::{Context, Poll},
};
use tokio::io::{AsyncRead, AsyncWrite};
/// A fake stream for testing network applications backed by buffers.
#[derive(Clone, Debug)]
pub struct MockStream {
written: Cursor... | /// Gets a slice of bytes representing the data that has been received.
pub fn received(&self) -> &[u8] {
self.received.get_ref() |
<|file_name|>models.py<|end_file_name|><|fim▁begin|>from __future__ import unicode_literals
from django.db import models
from modelcluster.fields import ParentalKey
from wagtail.wagtailcore.models import Page
from wagtail.wagtailcore import fields
from wagtail.wagtailadmin.edit_handlers import FieldPanel
from wagtai... | class AboutPage(Page):
content = fields.RichTextField()
picture = models.ForeignKey( |
<|file_name|>c2.java<|end_file_name|><|fim▁begin|><|fim▁hole|> *
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful... | /*
* Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
<|file_name|>ModalEmployer.js<|end_file_name|><|fim▁begin|>import React from "react";
import $ from "jquery";
import "bootstrap/dist/js/bootstrap.min";
import "jquery-ui/ui/widgets/datepicker";
import {
postFulltimeEmployer,
postParttimeEmployer,
putFullTimeEmployer,
putParttimeEmployer
} from "../actio... |
if (this.state.type === "bienChe") {
data.salary_level = this.state.salary_level;
data.month_salary = this.state.month_salary; |
<|file_name|>KKSACBulkF.C<|end_file_name|><|fim▁begin|>/****************************************************************/
/* MOOSE - Multiphysics Object Oriented Simulation Environment */
/* */
/* All contents are licensed under LGPL V2.1 ... | |
<|file_name|>ScaleIntegerTests.cpp<|end_file_name|><|fim▁begin|>#include <catch.hpp>
#include <rapidcheck/catch.h>
using namespace rc;
TEST_CASE("scaleInteger") {
prop("for uint32_t, equal to naive way",
[] {
const auto x = *gen::arbitrary<uint32_t>();
const auto size = *gen::nonNegative<in... | |
<|file_name|>container.go<|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/l... | |
<|file_name|>instance_controller.go<|end_file_name|><|fim▁begin|>/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You u... | |
<|file_name|>index.js<|end_file_name|><|fim▁begin|><|fim▁hole|><|fim▁end|> | 'use strict';
module.exports = require('../lib/server'); |
<|file_name|>dynamic_component_loader_spec.ts<|end_file_name|><|fim▁begin|>import {
AsyncTestCompleter,
beforeEach,
ddescribe,
xdescribe,
describe,
el,
dispatchEvent,
expect,
iit,
inject,
beforeEachBindings,
it,
xit,
viewRootNodes
} from 'angular2/test_lib';
import {TestBed, ViewProxy} from... | |
<|file_name|>failing.py<|end_file_name|><|fim▁begin|># Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ... | output.output_tests(failing_tests, output=stdout) |
<|file_name|>structutils.py<|end_file_name|><|fim▁begin|>import struct
import re
from .core import NamedItemList
from copy import deepcopy
_SINGLE_MEMBER_REGEX = re.compile(r"^[@=<>!]?([0-9]*)([xcbB\?hHiIlLqQnNefdspP])$")
def __isSingleMemberFormatString(format):
return bool(_SINGLE_MEMBER_REGEX.match(format))
def ... | def setToZero(self): |
<|file_name|>momentum_test.py<|end_file_name|><|fim▁begin|># Copyright 2015 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/lice... | |
<|file_name|>a.py<|end_file_name|><|fim▁begin|>from devassistant.command_runners import CommandRunner
from devassistant.logger import logger
class CR1(CommandRunner):
@classmethod
def matches(cls, c):
return c.comm_type == 'barbarbar'
@classmethod
def run(cls, c):
logger.info('CR1: Doi... | return (True, x) |
<|file_name|>valid-triangle-number.py<|end_file_name|><|fim▁begin|>from collections import Counter
class Solution(object):
def triangleNumber(self, nums):<|fim▁hole|> """
nums = filter(None, nums)
if not nums:
return 0
c = Counter(nums)
N = max(nums)
bucket... | """
:type nums: List[int]
:rtype: int |
<|file_name|>all_tests_coverage.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
#
# Copyright (C) 2009 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
#
# htt... | |
<|file_name|>qgscalloutwidget.cpp<|end_file_name|><|fim▁begin|>/***************************************************************************
qgscalloutwidget.cpp
---------------------
begin : July 2019
copyright : (C) 2019 by Nyall Dawson
email : nyall dot daw... |
QgsManhattanLineCalloutWidget::QgsManhattanLineCalloutWidget( QgsVectorLayer *vl, QWidget *parent ) |
<|file_name|>sale_order.py<|end_file_name|><|fim▁begin|># Copyright (C) 2021 Open Source Integrators
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
from odoo import models
class SaleOrder(models.Model):<|fim▁hole|> def action_confirm(self):
res = super(SaleOrder, self).action_confirm()
... | _inherit = "sale.order"
|
<|file_name|>lib.rs<|end_file_name|><|fim▁begin|>/*
The library provides a simple datastructure to access geolocated labels with an additional
elimination time t and a label size factor. The library provides method to query a set of
such labels with a bounding box and a minimum elimination time.
Copyri... | |
<|file_name|>jquery.simpler-sidebar.js<|end_file_name|><|fim▁begin|>/*! simpler-sidebar v1.4.9 (https://github.com/dcdeiv/simpler-sidebar)
** Copyright (c) 2015 - 2016 Davide Di Criscito
** Dual licensed under MIT and GPL-2.0
*/
( function( $ ) {
$.fn.simplerSidebar = function( options ) {
var cfg = $.extend( true, $... | }
}); |
<|file_name|>posts.ts<|end_file_name|><|fim▁begin|>import express from 'express';
import passport from 'passport';
const router = express.Router();
import getLogger from '../log';
const log = getLogger(module);
import util from 'util';
import mongoose from '../db/mongoose';
import Post from '../model/post';
const pa... | status: 'OK',
post:post |
<|file_name|>psus.rs<|end_file_name|><|fim▁begin|>#[doc = "Register `PSUS` reader"]
pub struct R(crate::R<PSUS_SPEC>);
impl core::ops::Deref for R {
type Target = crate::R<PSUS_SPEC>;
#[inline(always)]
fn deref(&self) -> &Self::Target {
&self.0
}
}
impl From<crate::R<PSUS_SPEC>> for R {
#[in... | #[inline(always)]
pub fn bits(self, value: u8) -> &'a mut W { |
<|file_name|>checkpoints_file_test.go<|end_file_name|><|fim▁begin|>package checkpoints_test
import (
"context"
"path/filepath"
"sort"
"testing"
. "github.com/pingcap/check"
"github.com/pingcap/errors"
"github.com/pingcap/tidb/br/pkg/lightning/checkpoints"
"github.com/pingcap/tidb/br/pkg/lightning/config"
"gi... | c.Assert(err, IsNil) |
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|>import unittest
<|fim▁hole|><|fim▁end|> | import pymq.tests.test_item |
<|file_name|>version.py<|end_file_name|><|fim▁begin|># Copyright (C) 2015 zulily, llc
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless... | # distributed under the License is distributed on an "AS IS" BASIS, |
<|file_name|>classes-cross-crate.rs<|end_file_name|><|fim▁begin|>// Copyright 2012-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.a... | pub fn main() {
let mut nyan = cat(0u, 2, ~"nyan");
nyan.eat(); |
<|file_name|>bsefilter.cc<|end_file_name|><|fim▁begin|>// CC0 Public Domain: http://creativecommons.org/publicdomain/zero/1.0/
#include "bsefilter.hh"
#include <sfi/sfi.hh>
using namespace Bse;
const gchar*
bse_iir_filter_kind_string (BseIIRFilterKind fkind)
{<|fim▁hole|> {
case BSE_IIR_FILTER_BUTTERWORTH: ... | switch (fkind) |
<|file_name|>Agent.tsx<|end_file_name|><|fim▁begin|>import React, { FC } from 'react';
const Agent: FC = () => {
return (
<>
<h2>Prometheus Agent</h2>
<p>
This Prometheus instance is running in <strong>agent mode</strong>. In this mode, Prometheus is only used to scrape
discovered tar... | </p>
<p>Some features are not available in this mode, such as querying and alerting.</p>
</>
); |
<|file_name|>operadores.py<|end_file_name|><|fim▁begin|># para os tipos numericos temos os seguintes operadores:
# + - * / % **
print "Numeros inteiros:"
x = 10
y = 3
print x, "+", y, "=", x + y
print x, "+", y, "=", x - y
print x, "+", y, "=", x*y
print x, "+", y, "=", x/y # repare como o resultado eh um inteiro
prin... | |
<|file_name|>brython_fourbar1.py<|end_file_name|><|fim▁begin|>#要注意 javascript 轉 python 語法差異
#document.getElementById -> doc[]
#module Math -> math
#Math.PI -> math.pi
#abs -> fabs
#array 可用 list代替
import math
import time
from browser import doc
import browser.timer
# 點類別
class Point(object):
# 起始方法
def __ini... | #alert(str(self.p1.x)+","+str(self.p1.y)) |
<|file_name|>front.js<|end_file_name|><|fim▁begin|>var mdf_range_update = false;
jQuery(function() {
if (!jQuery('#pn_html_buffer').length) {
jQuery('body').append('<div id="pn_html_buffer" class="mdf_info_popup" style="display: none;"></div>');
jQuery('body').append('<div id="pn_html_buffer2" style... |
function mdf_hide_empty_blocks_titles() {
var section = jQuery('.widget-meta-data-filter .mdf_filter_section');
jQuery.each(section, function(index, value) { |
<|file_name|>demo.py<|end_file_name|><|fim▁begin|>import asyncio
import websockets<|fim▁hole|>import duplex
rpc = duplex.RPC("json")
@asyncio.coroutine
def echo(ch):
obj, _ = yield from ch.recv()
yield from ch.send(obj)
rpc.register("echo", echo)
@asyncio.coroutine
def do_msgbox(ch):
text, _ = yield from... | |
<|file_name|>InstrumentType.java<|end_file_name|><|fim▁begin|>/*
* This file is part of SpongeAPI, licensed under the MIT License (MIT).
*
* Copyright (c) SpongePowered <https://www.spongepowered.org>
* Copyright (c) contributors
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* ... | |
<|file_name|>mempty.rs<|end_file_name|><|fim▁begin|>/*
* Copyright 2017 Sreejith Krishnan R
*
* 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... | }
|
<|file_name|>backend_xmlrpc.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
# -*- Mode: Python; tab-width: 4 -*-
#
# Netfarm Mail Archiver - release 2
#
# Copyright (C) 2005-2007 Gianluigi Tiesi <sherpya@netfarm.it><|fim▁hole|># Free Software Foundation; either version 2, or (at your option) any later
# version.
... | # Copyright (C) 2005-2007 NetFarm S.r.l. [http://www.netfarm.it]
#
# 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 |
<|file_name|>InspectorDebuggerAgent.js<|end_file_name|><|fim▁begin|>'use strict';
var format = require('util').format
, scripts = require('./scripts')
, loadScriptSource = require('./load-script-source')
// Ports: https://code.google.com/p/chromium/codesearch#chromium/src/third_party/WebKit/Sour... | proto.setBreakpointsActive = ignore
proto.setSkipAllPauses = ignore |
<|file_name|>simple_joint_control_test_sm.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
###########################################################
# WARNING: Generated code! #
# ************************** #
# Manual changes may get lost if file is gen... | OperatableStateMachine.add('Increment_Joint_Index',
CalculationState(calculation=lambda it: it + 1),
transitions={'done': 'Decide_Joints_To_Go'},
autonomy={'done': Autonomy.Off}, |
<|file_name|>media.component.ts<|end_file_name|><|fim▁begin|>import { SingleFileUploadModal } from './modal-single';
import { Component, OnInit } from '@angular/core';
import { MdDialog } from '@angular/material';
@Component({
selector: 'media-library',
templateUrl: './media.component.html',
styleUrls: ['... | openDialog() {
let dialogRef = this.dialog.open(SingleFileUploadModal);
dialogRef.afterClosed().subscribe(result => {
|
<|file_name|>source.d.ts<|end_file_name|><|fim▁begin|>interface Location {
line: number;
column: number;
}
/**
* A representation of source input to GraphQL. The `name` and `locationOffset` parameters are
* optional, but they are useful for clients who store GraphQL documents in source files.
* For example, if ... | */
export function isSource(source: any): source is Source; |
<|file_name|>0015_auto_20160503_0248.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
from __future__ import absolute_import
# Generated by Django 1.9 on 2016-05-03 02:48
from __future__ import unicode_literals
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
... | name='tip_last_payout',
),
migrations.RemoveField(
model_name='podcast', |
<|file_name|>scheme.rs<|end_file_name|><|fim▁begin|>use core::ops::{Deref, DerefMut};
use core::{mem, slice};
use super::error::*;
use super::syscall::*;
use super::c_string_to_str;
#[derive(Copy, Clone, Debug, Default)]
#[repr(packed)]
pub struct Packet {
pub id: usize,
pub a: usize,
pub b: usize,
pu... | }
}
}
|
<|file_name|>test_readline.py<|end_file_name|><|fim▁begin|># vim: ft=python fileencoding=utf-8 sts=4 sw=4 et:
# Copyright 2014-2017 Florian Bruhin (The Compiler) <mail@qutebrowser.org>
#
# This file is part of qutebrowser.
#
# qutebrowser is free software: you can redistribute it and/or modify
# it under the terms of ... |
from qutebrowser.misc import readline |
<|file_name|>v1.js<|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... | context: self
};
return createAPIRequest(parameters, callback); |
<|file_name|>details.controller.ts<|end_file_name|><|fim▁begin|>import {IDetailsService} from '../services/details.service';
class DetailsController implements ng.IComponentController {
private detailsService: IDetailsService;
private detailsData: any;
private previousState: any;
constructor($statePar... | DetailsController.$inject = ['$stateParams', 'detailsService']; |
<|file_name|>test_enum.py<|end_file_name|><|fim▁begin|>from __future__ import unicode_literals
from tests.utils import ConverterTestCase
class EnumTestCase(ConverterTestCase):
def test_empty(self):
self.assertGeneratedOutput(
"""
enum Bar {
};
""",
... | TOP,
RIGHT,
BOTTOM,
LEFT |
<|file_name|>names.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
# vim:fileencoding=utf-8
from __future__ import (unicode_literals, division, absolute_import,
print_function)
__license__ = 'GPL v3'
__copyright__ = '2013, Kovid Goyal <kovid at kovidgoyal.net>'
import re
from lxml.etree... | 'mo': 'http://schemas.microsoft.com/office/mac/office/2008/main',
'o': 'urn:schemas-microsoft-com:office:office', |
<|file_name|>clearpart_test.py<|end_file_name|><|fim▁begin|>import unittest
import mock
import blivet
from pykickstart.constants import CLEARPART_TYPE_ALL, CLEARPART_TYPE_LINUX, CLEARPART_TYPE_NONE
from parted import PARTITION_NORMAL
from blivet.flags import flags
DEVICE_CLASSES = [
blivet.devices.DiskDevice,
... | |
<|file_name|>manage.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
import os
import sys
if __name__ == "__main__":
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "bitcamp.settings")
<|fim▁hole|> execute_from_command_line(sys.argv)<|fim▁end|> | from django.core.management import execute_from_command_line
|
<|file_name|>main.py<|end_file_name|><|fim▁begin|># Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.<|fim▁hole|>#
# Unless required by applicable law or agreed to in writing, software
# distributed under the ... | # You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0 |
<|file_name|>qmlprofilertraceview.cpp<|end_file_name|><|fim▁begin|>/****************************************************************************
**
** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
** Contact: http://www.qt-project.org/legal
**
** This file is part of Qt Creator.
**
** Commercial License Usa... | }\
QSlider::add-page:horizontal {\
background: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #5a5a5a, stop: 1 #444444);\ |
<|file_name|>update.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
'''
Module that update the software and its databases
'''
import os
import shutil
from sys import exit
import os.path
import tarfile
import requests
from bs4 import BeautifulSoup
from ...base import *
from ...sentry import sentry
from ...clint... | os.chdir(path) |
<|file_name|>0003_auto_20200417_1418.py<|end_file_name|><|fim▁begin|># Generated by Django 2.2.12 on 2020-04-17 14:18
from django.db import migrations, models
<|fim▁hole|> ]
operations = [
migrations.RemoveField(
model_name='commoncontrol',
name='legacy_impl_smt',
),
... | class Migration(migrations.Migration):
dependencies = [
('controls', '0002_commoncontrol_common_control_provider'), |
<|file_name|>models.py<|end_file_name|><|fim▁begin|>from django.db import models
from django.core.validators import validate_email, validate_slug, validate_ipv46_address
from django.core.exceptions import ValidationError
from django.core.urlresolvers import reverse
from ava.core.models import TimeStampedModel
from ava... | |
<|file_name|>binary_sensor.py<|end_file_name|><|fim▁begin|>"""Support for MyQ gateways."""
from pymyq.const import (
DEVICE_STATE as MYQ_DEVICE_STATE,
DEVICE_STATE_ONLINE as MYQ_DEVICE_STATE_ONLINE,
KNOWN_MODELS,
MANUFACTURER,
)
from homeassistant.components.binary_sensor import (
DEVICE_CLASS_CONN... | def device_info(self):
"""Return the device_info of the device."""
device_info = {
"identifiers": {(DOMAIN, self._device.device_id)}, |
<|file_name|>fpll.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
#
# Copyright 2004,2005 Free Software Foundation, Inc.
#
# This file is part of GNU Radio
#
# GNU Radio 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 Soft... | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details. |
<|file_name|>test_basic.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
"""
tests.basic
~~~~~~~~~~~~~~~~~~~~~
The basic functionality.
:copyright: (c) 2015 by Armin Ronacher.
:license: BSD, see LICENSE for more details.
"""
import pytest
import re
import uuid
import time
import flask
imp... | return flask.request.method
c = app.test_client()
assert c.get('/').data == b'GET' |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.