prompt large_stringlengths 70 991k | completion large_stringlengths 0 1.02k |
|---|---|
<|file_name|>enphase.py<|end_file_name|><|fim▁begin|>import requests, json, logging
from lxml import html
from datetime import datetime
logger = logging.getLogger(__name__)
class EnphaseAPI:
API_BASE_URL = "https://api.enphaseenergy.com/api/v2/systems/{system_id}/{function}?key={key}&user_id={user_id}"
API_BA... | return monthly production from start date
@params: start_data
"""
def get_monthly_production(self,system_id,start_date): |
<|file_name|>InsertText.ts<|end_file_name|><|fim▁begin|>/**
* Copyright (c) Tiny Technologies, Inc. All rights reserved.
* Licensed under the LGPL or a commercial license.
* For LGPL see License.txt in the project root for license information.
* For commercial licenses see https://www.tiny.cloud/
*/
import { getE... |
if (NodeType.isText(container)) { |
<|file_name|>layers.py<|end_file_name|><|fim▁begin|># coding=utf-8
# Copyright 2022 The TensorFlow GAN 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/l... | |
<|file_name|>test_indexed_matrix.py<|end_file_name|><|fim▁begin|>"""Unit tests for stats.cache module."""
# -----------------------------------------------------------------------------
# Imports
# -----------------------------------------------------------------------------
from nose.tools import raises
import ... | assert np.array_equal(matrix.indices, [2, 3, 5, 6, 7, 10])
matrix.remove_indices(7)
|
<|file_name|>ExampleEurekaApplicationTests.java<|end_file_name|><|fim▁begin|>package com.example.exampleeureka;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit4.SpringRunner;
@RunWith(SpringRunner.class)... |
} |
<|file_name|>addon.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
'''
Subtitles.gr Addon
Author Twilight0
SPDX-License-Identifier: GPL-3.0-only
See LICENSES/GPL-3.0-only for more information.
'''
import re, unicodedata
from shutil import copy
from os.path import splitext, exists, split as os... |
query = match_title = py3_dec(query) |
<|file_name|>angular-resource.js<|end_file_name|><|fim▁begin|>/**
* @license AngularJS v1.0.6
* (c) 2010-2012 Google, Inc. http://angularjs.org
* License: MIT
*/
(function(window, angular, undefined) {
'use strict';
/**
* @ngdoc overview
* @name ngResource
* @description
*/
/**
* @ngdoc object
* @name ngRes... | activity.replies = this.Activity.replies({userId:this.userId, activityId:activity.id});
} |
<|file_name|>playerKick.query.test.js<|end_file_name|><|fim▁begin|>const assert = require('assert')
const { unparse } = require('uuid-parse')
const supertest = require('supertest')
const createApp = require('../app')
const { createSetup, getAuthPassword } = require('./lib')
const { createPlayer, createKick } = require(... | playerKick(id:"1", serverId: "${server.id}") {
id
reason |
<|file_name|>bipartiteGraph.py<|end_file_name|><|fim▁begin|>import networkx as nx
from networkx.algorithms import bipartite
class User():
def __init__(self,userId):
self.userId=userId
def __key(self):
return (self.userId)
def __eq__(self,x, y):
return x.__key() == y... |
def __hash__(self):
|
<|file_name|>test_config_flow.py<|end_file_name|><|fim▁begin|>"""Tests for OwnTracks config flow."""
from unittest.mock import patch
from homeassistant.setup import async_setup_component
from tests.common import mock_coro
async def test_config_flow_import(hass):<|fim▁hole|> assert not hass.config_entries.async_en... | """Test that we automatically create a config flow.""" |
<|file_name|>static-vec-autoref.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.... | assert_eq!(B[1], 4); |
<|file_name|>node_count.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/lice... | |
<|file_name|>sga.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python3
import argparse
import random
import time
def bin(number):
return "{0:5b}".format(number).replace(' ','0')
def initialize(population):
return [bin(random.randint(0,31)) for x in range(0, population)]
def evaluate(population):
tupl... | |
<|file_name|>HOST_RESOURCES_MIB_OID.py<|end_file_name|><|fim▁begin|># python
# This file is generated by a program (mib2py).
import HOST_RESOURCES_MIB
OIDMAP = {
'1.3.6.1.2.1.25': HOST_RESOURCES_MIB.host,
'1.3.6.1.2.1.25.1': HOST_RESOURCES_MIB.hrSystem,
'1.3.6.1.2.1.25.2': HOST_RESOURCES_MIB.hrStorage,
'1.3.6.1.2.1.... | '1.3.6.1.2.1.25.2.3.1.7': HOST_RESOURCES_MIB.hrStorageAllocationFailures, |
<|file_name|>test-mus-got.cpp<|end_file_name|><|fim▁begin|>/**
* @file test-mus-got.cpp
* @brief Test code for God of Thunder files.
*
* Copyright (C) 2010-2015 Adam Nielsen <malvineous@shikadi.net>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Genera... | "\x00\x83\x43" |
<|file_name|>handlers.rs<|end_file_name|><|fim▁begin|>extern crate libc;
extern crate rustc_serialize;
use std::rc::Rc;
use core::workspaces::Workspaces;
use window_manager::WindowManager;
use window_system::WindowSystem;
use window_system::Window;
use config::{ GeneralConfig, Config };
pub type KeyHandler = Box<Fn(W... | Ok(_) => (),
_ => panic!("unable to start launcher") |
<|file_name|>rewe.py<|end_file_name|><|fim▁begin|><|fim▁hole|>import praw
import smtplib
import requests
import parsel
import re
import io
import json
import os
from email.header import Header
from email.mime.multipart import MIMEMultipart
from email.mime.text import MIMEText
from argparse import ArgumentParser
from p... | #!/bin/python3
|
<|file_name|>history.web.ts<|end_file_name|><|fim▁begin|><|fim▁hole|>window.addEventListener( 'hashchange' , event => $.$mol_state_history.id( null ) )<|fim▁end|> | |
<|file_name|>LLE_01.java<|end_file_name|><|fim▁begin|>/*
* Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Publi... | * 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
<|file_name|>run_bash.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python3
#
# Copyright 2021 The Cobalt 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
#
# ... | 'Avoid doing this whenever possible.')
sys.exit(subprocess.call(sys.argv[1:])) |
<|file_name|>AstroMomentMapsSelfTest.py<|end_file_name|><|fim▁begin|>import os
import unittest
import vtk, qt, ctk, slicer
import math
import sys
#
# AstroMomentMapsSelfTest
#
class AstroMomentMapsSelfTest:
def __init__(self, parent):
parent.title = "Astro MomentMaps SelfTest"
parent.categories = ["Testing.... | mainWindow.moduleSelector().selectModule('AstroMomentMaps') |
<|file_name|>SignUpSuccessController.java<|end_file_name|><|fim▁begin|>package com.binaryedu.web.controllers;
import java.io.IOException;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.apache.commons.logging.Log;
... | return new ModelAndView("signupSuccess");
}
|
<|file_name|>league.js<|end_file_name|><|fim▁begin|>'use strict';
<|fim▁hole|>function LeagueHandler (leagueService) {
this.service = leagueService;
}
LeagueHandler.prototype.getLeaguesByCountry = function(req, res, next) {
return this.service.getByCountry(req.params.country)
.then(function(countryLeag... | const mongoose = require('mongoose-q')(require('mongoose'));
const League = mongoose.model('League');
|
<|file_name|>util.go<|end_file_name|><|fim▁begin|>// Copyright 2014 ISRG. All rights reserved
// 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/.
package core
import (... | // BadNonceError indicates an empty of invalid nonce was provided
type BadNonceError string
func (e InternalServerError) Error() string { return string(e) } |
<|file_name|>eels.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
# Copyright 2007-2011 The HyperSpy developers
#
# This file is part of HyperSpy.
#
# HyperSpy 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 Fou... | |
<|file_name|>MatchingDimExtractionFn.java<|end_file_name|><|fim▁begin|>/*
* Licensed to Metamarkets Group Inc. (Metamarkets) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. Metamarkets licenses this file... | this.expr = expr;
this.pattern = Pattern.compile(expr); |
<|file_name|>NEq.java<|end_file_name|><|fim▁begin|>package nodeAST.relational;
import java.util.Map;
import nodeAST.BinaryExpr;
import nodeAST.Expression;
import nodeAST.Ident;
import nodeAST.literals.Literal;
import types.BoolType;
import types.Type;
import visitor.ASTVisitor;
import visitor.Identifie... | public NEq(Expression leftHandOperand, Expression rightHandOperand) {
super(leftHandOperand,rightHandOperand);
}
|
<|file_name|>manifest_test.go<|end_file_name|><|fim▁begin|>/*
* Copyright 2017 Dgraph Labs, Inc. and Contributors
*
* 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.apa... | require.Equal(t, true, done)
lc.runCompactDef(0, cd)
f = buildTestTable(t, "l", 2) |
<|file_name|>admin.py<|end_file_name|><|fim▁begin|><|fim▁hole|>from imagekit.admin import AdminThumbnail
# Register your models here.
class ImagenAdmin(admin.ModelAdmin):
imagen = AdminThumbnail(image_field='imagen_miniatura')
list_display = ('nombre', 'categoria','imagen')
admin.site.register(Categoria)
... | from productos.models import Categoria, Imagen
from django.contrib import admin |
<|file_name|>test_defaults.py<|end_file_name|><|fim▁begin|>from unittest import TestCase
import validictory
class TestItems(TestCase):
def test_property(self):
schema = {
"type": "object",
"properties": {
"foo": {
"default": "bar"
... |
result = validictory.validate(data, schema, required_by_default=False) |
<|file_name|>test_create_searchspace_util_classification.py<|end_file_name|><|fim▁begin|>from collections import OrderedDict
import unittest
import numpy
from ConfigSpace.configuration_space import ConfigurationSpace
from ConfigSpace.hyperparameters import CategoricalHyperparameter
from autosklearn.pipeline.componen... | |
<|file_name|>index.js<|end_file_name|><|fim▁begin|>#!/usr/bin/env node
(function () {<|fim▁hole|> options;
program
.version('1.0.2')
.usage('[options] <path, ...>')
.option('-g, --generate <path> <output-directory-layout-file-path>', 'Generate directory layout')
.option('-v, ... |
var DirectoryLayout = require('../lib/index.js'),
program = require('commander'), |
<|file_name|>misc.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<|fim▁hole|>// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
// option. This file may not be copied, modified, or distributed
//... | // http://rust-lang.org/COPYRIGHT.
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license |
<|file_name|>clear.rs<|end_file_name|><|fim▁begin|>use fbo::{self, ValidatedAttachments};
use context::Context;
use ContextExt;
use Rect;
use Surface;
use Api;
use version::Version;
use gl;
pub fn clear(context: &Context, framebuffer: Option<&ValidatedAttachments>,
rect: Option<&Rect>, color: Option<(... | ctxt.state.clear_depth = depth;
}
|
<|file_name|>models.py<|end_file_name|><|fim▁begin|>import json
import hashlib
from django.db import models
from django.db.models import Count, Func
from django.contrib.postgres.fields import ArrayField
from django.contrib.auth.models import BaseUserManager, AbstractBaseUser
from django.utils.translation import gettext... | return self.sha1
|
<|file_name|>parse.js<|end_file_name|><|fim▁begin|>"use strict";
const forOwn = require('mout/object/forOwn');
const split = new RegExp("\\s*(.+?)(?:=\\s*(?:\"([^\"]*)\"|'([^']*)'|(.*?)))?\\s*(;|$)", "g");<|fim▁hole|> while((res = split.exec(str)))
out[res[1]] = res[2] || res[3] || res[4] || null;
return out;
... |
var parse = function(str) {
var res;
var out = {}; |
<|file_name|>option.go<|end_file_name|><|fim▁begin|>package sqlstore
import "io"
type Option func(s *Store)
func WithDebug(w io.Writer) Option {
return func(s *Store) {<|fim▁hole|> s.writer = w
}
}<|fim▁end|> | s.debug = true |
<|file_name|>trace.rs<|end_file_name|><|fim▁begin|>// Copyright 2015, 2016 Parity Technologies (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 vers... | fn from(c: trace::CreateResult) -> Self {
CreateResult { |
<|file_name|>app.js<|end_file_name|><|fim▁begin|>window.jQuery = window.$ = require('jquery');
require('bootstrap');
var angular = require('angular');
var uirouter = require('angular-ui-router');
var uibootstrap = require('angular-ui-bootstrap');
var fileupload = require('ng-file-upload');
//TODO pretify these uris
r... | }); |
<|file_name|>_tickvals.py<|end_file_name|><|fim▁begin|>import _plotly_utils.basevalidators
class TickvalsValidator(_plotly_utils.basevalidators.DataArrayValidator):
def __init__(
self, plotly_name="tickvals", parent_name="parcoords.dimension", **kwargs
):<|fim▁hole|> plotly_name=plotly_name... | super(TickvalsValidator, self).__init__( |
<|file_name|>keys.pipe.ts<|end_file_name|><|fim▁begin|><|fim▁hole|>
@Pipe({ name: 'hlKeys' })
export class KeysPipe implements PipeTransform {
transform(value, args: string[]): any {
let keys = [];
for (let key in value) {
keys.push(key);
}
return keys;
}
}<|fim▁end|> | import { PipeTransform, Pipe } from '@angular/core'; |
<|file_name|>bugs_checker_osm.py<|end_file_name|><|fim▁begin|>import re
osm = open("stops.txt", 'r', encoding="utf-8")
bugs = open("BAD-STOPS.txt", 'r', encoding="utf-8")
still = open("BUGS-NOT-IN-OSM.txt", 'w')
bugi = []
for line in bugs:
line = line.split(' ')
bugi.append(line[0])
print(len(bugi))
for line... | bugi.remove(stop_nr)
|
<|file_name|>mdui.js<|end_file_name|><|fim▁begin|>/**
* Created by zhangh on 2017/02/12.
*/
$(function () {
//平衡左右侧高度
$('#rightContent').css("minHeight", $('#leftNav').height() > $('#rightContent').height() ? $('#leftNav').height() : $('#rightContent').height());
//展开左侧导航
$(".selected").parents("ul").... | clickFn: function (url, title) {
$($this.data('target')).val(url);
$($this.data('preview')).html('选中文件:<a target="_blank" href="' + url + '">' + title + '</a>').show(500); |
<|file_name|>univariate_selection.py<|end_file_name|><|fim▁begin|>"""Univariate features selection."""
# Authors: V. Michel, B. Thirion, G. Varoquaux, A. Gramfort, E. Duchesnay.
# L. Buitinck, A. Joly
# License: BSD 3 clause
import numpy as np
import warnings
from scipy import special, stats
from scipy.spa... | The highest uncorrected p-value for features to keep. |
<|file_name|>vcs_test.go<|end_file_name|><|fim▁begin|>// Copyright 2014 The Go 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 get
import (
"errors"
"internal/testenv"
"io/ioutil"
"os"
"path"
"path/filepath"
"testing"... | imports: []metaImport{
{Prefix: "example.com/user/foo", VCS: "git", RepoRoot: "https://example.com/repo/target"},
{Prefix: "example.com/user/foo/bar", VCS: "git", RepoRoot: "https://example.com/repo/target"}, |
<|file_name|>GW_INITIALIZE_SCENE_CFM.ts<|end_file_name|><|fim▁begin|>"use strict";
import { GW_FRAME_CFM } from "./common";
import { InitializeSceneConfirmationStatus } from "./GW_SCENES";
export class GW_INITIALIZE_SCENE_CFM extends GW_FRAME_CFM {
public readonly Status: InitializeSceneConfirmationStatus;
c... | }
public getError(): string { |
<|file_name|>purgelogs.go<|end_file_name|><|fim▁begin|>package servenv
import (
"github.com/youtube/vitess/go/vt/logutil"
)
func init() {
onInit(func() {
go logutil.PurgeLogs()
})
<|fim▁hole|><|fim▁end|> | } |
<|file_name|>StartPage_pt-BR.ts<|end_file_name|><|fim▁begin|><?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE TS>
<TS version="2.0" language="pt-BR" sourcelanguage="en">
<context>
<name>StartPage</name>
<message>
<location filename="StartPage.py" line="50"/>
<source>FreeCAD Start Center</source>
... | <location filename="StartPage.py" line="70"/> |
<|file_name|>views.py<|end_file_name|><|fim▁begin|>from builtins import str
from builtins import range
from django.http import HttpResponse,HttpResponseNotFound
from django.template import loader
from django.shortcuts import get_list_or_404
from django.shortcuts import render
from .forms import TestMessageForm
from .mo... | if form.is_valid():
#check that user is sending data on their own account
logger.debug('form valid, processing message')
#encode utf-8 because this is the way text messages are received from rabbitmq |
<|file_name|>test_currency.py<|end_file_name|><|fim▁begin|>'''Tests for currency.py'''
import unittest
from decimal import Decimal
from mexbtcapi.currency import Currency, ExchangeRate, Amount, CurrencyPair
class CurrencytTest(unittest.TestCase):
def test_create(self):
c1 = Currency("c1")
self.ass... | self.assertNotEqual(p1,p3)
def test_equality_reversed(self):
c1, c2 = Currency("c1"), Currency("c2") |
<|file_name|>middleware.py<|end_file_name|><|fim▁begin|>"""
Middleware to auto-expire inactive sessions after N seconds, which is configurable in
settings.
To enable this feature, set in a settings.py:<|fim▁hole|> SESSION_INACTIVITY_TIMEOUT_IN_SECS = 300
This was taken from StackOverflow (http://stackoverflow.com/qu... | |
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|># Copyright (c) 2017, The MITRE Corporation. All rights reserved.
# See LICENSE.txt for complete terms.
from mixbox import fields
from mixbox import typedlist
from mixbox import entities
# internal
import stix
import stix.bindings.stix_common as common_binding
c... | name="Kill_Chain_Phase",
type_=KillChainPhaseReference, |
<|file_name|>PageWithNav.js<|end_file_name|><|fim▁begin|>import React from 'react'
import { connect } from 'react-redux'
import { VelocityComponent } from 'velocity-react'
import TopNav from '../components/TopNav'
import NetworkNav from '../components/NetworkNav'
import LeftNav, { leftNavWidth, leftNavEasing } from '..... | {showNetworkNav && <NetworkNav
communities={networkCommunities}
network={network || community.network} />} |
<|file_name|>test_auto_crop.py<|end_file_name|><|fim▁begin|>import pytest
import cv2
from plantcv.plantcv import auto_crop
@pytest.mark.parametrize('padx,pady,expected', [[20, 20, (98, 56, 4)], [(400, 400), (400, 400), (58, 16, 4)]])
def test_auto_crop(padx, pady, expected, test_data):
"""Test for PlantCV."""
... | |
<|file_name|>server.go<|end_file_name|><|fim▁begin|>/*
*
* Copyright 2014, Google Inc.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
* met:
*
* * Redistributions of source code must reta... | |
<|file_name|>cbcadmin.rs<|end_file_name|><|fim▁begin|><|fim▁hole|>use matasano::set2::cbcadmin;
#[test]
fn test_cryptopals_case() {
let authbox = r!(cbcadmin::init_authbox());
assert!(r!(cbcadmin::auth_as_admin(&authbox)));
}<|fim▁end|> | |
<|file_name|>0007_auto_20200904_2351.py<|end_file_name|><|fim▁begin|># Generated by Django 3.0.9 on 2020-09-04 21:51
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('stock', '0006_auto_20200904_2343'),
]
operations = [
migrations.RemoveF... | |
<|file_name|>0024_documentfile.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
# Generated by Django 1.9 on 2016-03-10 16:10
from __future__ import unicode_literals
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
import uuid
class Migration(migration... | migrations.swappable_dependency(settings.AUTH_USER_MODEL),
('base', '0023_messagetemplate'),
]
|
<|file_name|>main.contribution.ts<|end_file_name|><|fim▁begin|>/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*... | |
<|file_name|>alert.directive.js<|end_file_name|><|fim▁begin|>(function() {
'use strict';
var jhiAlert = {
template: '<div class="alerts" ng-cloak="">' +
'<div ng-repeat="alert in $ctrl.alerts" ng-class="[alert.position, {\'toast\': alert.toast}]">' +
... | });
} |
<|file_name|>App.ts<|end_file_name|><|fim▁begin|>/* ---------------------------------------------------------------------------------------
Todos.ts
Microsoft grants you the right to use these script files under the Apache 2.0 license.
Microsoft reserves all other rights to the files not expressly granted by Microsoft,... | whether by implication, estoppel or otherwise. The copyright notices and MIT licenses
below are for informational purposes only. |
<|file_name|>tests.py<|end_file_name|><|fim▁begin|>from datetime import datetime
from django.test import TestCase
from django.contrib.auth.models import User
from apps.mountains.models import Mountain, Climb
class ClimbTest(TestCase):
def setUp(self):
User.objects.create(
username = "test_user... | |
<|file_name|>triangle.js<|end_file_name|><|fim▁begin|>/**
* Copyright 2015 Wouter van Heeswijk
*
* 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/LICENS... | function (loader, asset) { |
<|file_name|>lint-no-config-section.ts<|end_file_name|><|fim▁begin|>import { ng } from '../../utils/process';
import { oneLine } from 'common-tags';
export default function () {
return Promise.resolve()
.then(() => ng('set', 'lint', '[]'))
.then(() => ng('lint'))
.then(({ stdout }) => {
if (!stdout... | |
<|file_name|>batchdropcutter_mtrush.py<|end_file_name|><|fim▁begin|>import ocl
import pyocl
import camvtk
import time
import vtk
import datetime
import math
if __name__ == "__main__":
print ocl.revision()
myscreen = camvtk.VTKScreen()
#stl = camvtk.STLSurf("../stl/gnu_tux_mod.stl")
stl = camvtk.... | t3.SetPos( (50, myscreen.height-150) )
myscreen.addActor( t3)
myscreen.render() |
<|file_name|>setup.py<|end_file_name|><|fim▁begin|>from distutils.core import setup, Extension
include_dirs = ['/usr/include', '/usr/local/include']
library_dirs = ['/usr/lib', '/usr/local/lib']
libraries = ['jpeg']
runtime_library_dirs = []
extra_objects = []
define_macros = []<|fim▁hole|> author = "Guangming Li... |
setup(name = "pyjpegoptim",
version = "0.1.1", |
<|file_name|>parse.rs<|end_file_name|><|fim▁begin|>/*!
Contains the conditional compilation expression parser.
*/
use std::fmt::Debug;
use regex::Regex;
use super::ast::Node;
use util::ResultOptionExt;
/**
Shorthand for matching a sequence of tokens.
You might wonder why this is used so little for being so much code.... | .ro_or_else(|| parse_munch(toks, "!=")
.ro_and_then(|toks| parse_equality_expr(toks)) |
<|file_name|>functions.go<|end_file_name|><|fim▁begin|>package main
<|fim▁hole|>func UserHomeDir() string {
if runtime.GOOS == "windows" {
home := os.Getenv("HOMEDRIVE") + os.Getenv("HOMEPATH")
if home == "" {
home = os.Getenv("USERPROFILE")
}
return home
}
return os.Getenv("HOME")
}<|fim▁en... | import ("os";"runtime")
|
<|file_name|>log.rs<|end_file_name|><|fim▁begin|>/* Copyright (C) 2021 Open Information Security Foundation
*
* You can copy, redistribute or modify this Program under the terms of
* the GNU General Public License version 2 as published by the Free
* Software Foundation.
*
* This program is distributed in the hop... | quantity, |
<|file_name|>UserDetailsServiceFactoryBean.java<|end_file_name|><|fim▁begin|>/*
* Copyright 2002-2016 the original author or 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
*
... | }
} |
<|file_name|>eb61567ea005_length_of_subdivisionfirst.py<|end_file_name|><|fim▁begin|>"""length_of_subdivisionfirst
Revision ID: eb61567ea005
Revises: 66f71cf543a4
Create Date: 2018-05-15 22:24:27.212164
"""
from alembic import op
import sqlalchemy as sa
from docassemble.webapp.database import dbtableprefix
# revisi... | |
<|file_name|>test_configs.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
# Licensed under a 3-clause BSD style license - see LICENSE.rst
from __future__ import (absolute_import, division, print_function,
unicode_literals)
import io
import os
import sys
import subprocess
import pytest... |
def test_unedited_template():
# Test that the config file is written at most once |
<|file_name|>create_file.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
#to create a file in codesnippets folder
import pyperclip
import os
import re
import subprocess
def get_extension(file_name):
if file_name.find('.')!=-1:
ext = file_name.split('.')
return (ext[1])
else:
... | for root, dirs, files in os.walk(path):
if name in files:
return os.path.join(root, name) |
<|file_name|>auto_balance.py<|end_file_name|><|fim▁begin|>import json
import hashlib
from daemonutils.auto_balance import add_node_to_balance_for
import config
import base
import models.node
import models.cluster
import models.task
from models.cluster_plan import ClusterBalancePlan, get_balance_plan_by_addr
REDIS_SHA... |
steps = list(t.all_steps) |
<|file_name|>put_test.go<|end_file_name|><|fim▁begin|>package command
import (
"bytes"<|fim▁hole|> "os"
"testing"
"github.com/hashicorp/consul/testutil"
"github.com/mitchellh/cli"
)
func TestPutCommand(t *testing.T) {
srv := testutil.NewTestServer(t)
defer srv.Stop()
ui := new(cli.MockUi)
c := &PutCommand{U... | |
<|file_name|>test_port_from_csv.py<|end_file_name|><|fim▁begin|>from gdsfactory.port import csv2port
def test_csv2port(data_regression):
import gdsfactory as gf
name = "straight"
csvpath = gf.CONFIG["gdsdir"] / f"{name}.ports"
ports = csv2port(csvpath)<|fim▁hole|><|fim▁end|> | data_regression.check(ports) |
<|file_name|>prepare_data.py<|end_file_name|><|fim▁begin|># Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserved.<|fim▁hole|># Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# ht... | # |
<|file_name|>graphBuffer.spec.js<|end_file_name|><|fim▁begin|>/* @flow */
/* **********************************************************
* File: tests/utils/dataStreams/graphBuffer.spec.js
*
* Brief: Provides a storage class for buffering data outputs
*
* Authors: Craig Cheney
*
* 2017.10.01 CC - Updated test suite for ... | });
});
});
/* [] - END OF FILE */ |
<|file_name|>middleware_test.go<|end_file_name|><|fim▁begin|>package metrics_test
import (
"net/http"
"net/http/httptest"
"testing"<|fim▁hole|> tr "github.com/gkarlik/quark-go/service/trace/noop"
"github.com/stretchr/testify/assert"
)
type TestService struct {
*quark.ServiceBase
}
type TestHttpHandler struct{}
... |
"github.com/gkarlik/quark-go"
"github.com/gkarlik/quark-go/metrics/prometheus"
"github.com/gkarlik/quark-go/middleware/metrics" |
<|file_name|>postsCtrl.js<|end_file_name|><|fim▁begin|>angular.module('fishTank')
.controller('PostsCtrl', [
'$scope',
'postsFactory',
'post',
function($scope, postsFactory, post){
$("input.tags").tagsinput('items')
// $("input.form-control").show()
$scope.post = post;
$scope.inc... |
var errors = function() { |
<|file_name|>core.py<|end_file_name|><|fim▁begin|># plugins module for amsn2
"""
Plugins with amsn2 will be a subclass of the aMSNPlugin() class.
When this module is initially imported it should load the plugins from the last session. Done in the init() proc.
Then the GUI should call plugins.loadPlugin(name) or plugins... | # Called when the plugins module is imported (only for the first time).
# Should find plugins and populate a list ready for getPlugins().
# Should also auto-update all plugins.
def init(): pass |
<|file_name|>cyruslib.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
#
# Cyruslib v0.8.5-20090401
# Copyright (C) 2007-2009 Reinaldo de Carvalho <reinaldoc@gmail.com>
# Copyright (C) 2003-2006 Gianluigi Tiesi <sherpya@netfarm.it>
# Copyright (C) 2003-2006 NetFarm S.r.l. [http://www.netfarm.it]
#
# This program... | self.__dm(mailbox)
def rename(self, fromMbx, toMbx, partition=None): |
<|file_name|>GameState.py<|end_file_name|><|fim▁begin|>__author__ = 'miko'
from Tkinter import Frame
<|fim▁hole|> self.stateName = kwargs["stateName"]
self.root = args[0]
self.id = kwargs["id"]
Frame.__init__(self, self.root.mainWindow)
self.config(
background="gold"
)
self.place(relwidth=1, relheight=1... |
class GameState(Frame):
def __init__(self, *args, **kwargs): |
<|file_name|>setup.py<|end_file_name|><|fim▁begin|>import os
from glob import glob
from setuptools import setup, find_packages<|fim▁hole|># Cache readme contents for use as long_description
readme = open('README.md').read()
# Call setup()
setup(
name=pkg_name,
version='0.1',
description='Library of common bot fu... |
# Setup flags and parameters
pkg_name = 'libbot' # top-level package name
|
<|file_name|>zengallery.js<|end_file_name|><|fim▁begin|>(function($){
$(function(){
$('#zen-gallery a').lightBox({
fixedNavigation:true,
imageLoading: 'zen-gallery/images/lightbox-btn-loading.gif',
imageBtnClose: 'zen-gallery/images/lightbox-btn-close.gif',
imageBtnPrev: 'zen-gallery/images/lightbo... | });
})(jQuery); |
<|file_name|>ChoiceGroupType.py<|end_file_name|><|fim▁begin|># Copyright 2016 Casey Jaymes
# This file is part of PySCAP.
#
# PySCAP 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 Lic... | class ChoiceGroupType(Model):
MODEL_MAP = {
'elements': [
{'tag_name': 'choice', 'list': 'choices', 'class': 'ChoiceType', 'min': 1}, |
<|file_name|>azure_rm_publicipaddress.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python
#
# Copyright (c) 2016 Matt Davis, <mdavis@ansible.com>
# Chris Houseknecht, <house@redhat.com>
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the t... | self.delete_pip() |
<|file_name|>test.rs<|end_file_name|><|fim▁begin|>use cargo::ops;
use cargo::util::{CliResult, CliError, Human, Config};
use cargo::util::important_paths::{find_root_manifest_for_wd};
#[derive(RustcDecodable)]
pub struct Options {
arg_args: Vec<String>,
flag_features: Vec<String>,
flag_jobs: Option<u32>,
... | } |
<|file_name|>ingest_push.py<|end_file_name|><|fim▁begin|>from cProfile import Profile
from optparse import make_option
from django.conf import settings
from django.core.management.base import (BaseCommand,
CommandError)
from treeherder.etl.buildapi import (Builds4hJobsProcess,... | default=None, |
<|file_name|>test_endpoint_groups_client.py<|end_file_name|><|fim▁begin|># Copyright 2017 AT&T Corporation.
# 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
#
#... | 'tempest.lib.common.rest_client.RestClient.head',
{},
bytes_body,
status=200, |
<|file_name|>instance-get-example-phone-number.6.x.py<|end_file_name|><|fim▁begin|># Download the Python helper library from twilio.com/docs/python/install<|fim▁hole|>
# Your Account Sid and Auth Token from twilio.com/user/account
account_sid = "ACCOUNT_SID"
auth_token = "your_auth_token"
client = Client(account_sid, a... | from twilio.rest import Client |
<|file_name|>resource_thread.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 thread that takes a URL and streams back the bi... | |
<|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", "gettingstarted.settings")
from django.core.management import execute_from_command_line
<|fim▁hole|><|fim▁end|> | execute_from_command_line(sys.argv) |
<|file_name|>lib.rs<|end_file_name|><|fim▁begin|>// =================================================================
//
// * WARNING *
//
// This file is generated!
//
// Changes made to this file will be overwritten. If changes are
// required to the generated code, the ... | mod generated; |
<|file_name|>xwjemail.py<|end_file_name|><|fim▁begin|># coding: utf-8
'''
Created on 2012-8-30
@author: shanfeng
'''
import smtplib
from email.mime.text import MIMEText
import urllib
import web
class XWJemail:
'''
classdocs
'''
def __init__(self, params):
'''
Constructor
'''
pass
@staticmethod
def sen... | <head></head>
<body>
<h4>%s,你好</h4> |
<|file_name|>InputHandler.js<|end_file_name|><|fim▁begin|>/**
* @author Richard Davey <rich@photonstorm.com>
* @copyright 2014 Photon Storm Ltd.
* @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License}
*/
/**
* The Input Handler is bound to a specific Sprite and is res... | } |
<|file_name|>device_object_object_remote.py<|end_file_name|><|fim▁begin|>from ..remote import RemoteModel
from infoblox_netmri.utils.utils import check_api_availability
class DeviceObjectObjectRemote(RemoteModel):
"""
Network Objects cross usage
| ``DeviceObjectObjectID:`` The internal NetMRI identifie... | |
<|file_name|>RicExecuteLastUsedScriptFeature.cpp<|end_file_name|><|fim▁begin|>/////////////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2021- Equinor ASA
//
// ResInsight is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Publi... | |
<|file_name|>edgeutil.rs<|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/licenses/LICENSE-2... |
let max_distance = chordangle::STRAIGHT;
let (_, ok) = update_max_distance(x, a, b, max_distance); |
<|file_name|>index.d.ts<|end_file_name|><|fim▁begin|>// Type definitions for non-npm package Atom 1.36
// Project: https://github.com/atom/atom
// Definitions by: GlenCFL <https://github.com/GlenCFL>
// smhxx <https://github.com/smhxx>
// lierdakil <https://github.com/lierdakil>
// Defin... | /** |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.