prompt large_stringlengths 70 991k | completion large_stringlengths 0 1.02k |
|---|---|
<|file_name|>skin.py<|end_file_name|><|fim▁begin|>from Tools.Profile import profile
profile("LOAD:ElementTree")
import xml.etree.cElementTree
import os
profile("LOAD:enigma_skin")
from enigma import eSize, ePoint, eRect, gFont, eWindow, eLabel, ePixmap, eWindowStyleManager, addFont, gRGB, eWindowStyleSkinned, getDeskt... | try:
parms = converter.text.strip() |
<|file_name|>AttributeConfiguration.java<|end_file_name|><|fim▁begin|>/*
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
*<|fim▁hole|> * You may not use this file except in compliance with the License.
* A copy of the License is located at
*
* http://aws.amazon.com/apache2.0
*
* or in the "... | * Licensed under the Apache License, Version 2.0 (the "License"). |
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|>"""
Initialize Flask app
"""
from flask import Flask
import os
from flask_debugtoolbar import DebugToolbarExtension
from werkzeug.debug import DebuggedApplication
<|fim▁hole|> app.config.from_object('application.settings.Development')
# Flask-DebugToolbar
... | app = Flask('application')
if os.getenv('FLASK_CONF') == 'DEV':
# Development settings |
<|file_name|>mod.rs<|end_file_name|><|fim▁begin|>/************************************************************************
* *
* Copyright 2014 Thomas Poinsot, Urban Hafner *
* Copyright 2015 Urban Hafner, Igor Polyakov ... | * *
* You should have received a copy of the GNU General Public License *
* along with Iomrascálaí. If not, see <http://www.gnu.org/licenses/>. *
* * |
<|file_name|>test_version.py<|end_file_name|><|fim▁begin|># Copyright 2017 Bracket Computing, 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.
# A copy of the License is located at
#
# https://github.com/brkt... | |
<|file_name|>osmc_bluetooth.py<|end_file_name|><|fim▁begin|>import connman
import bluetooth
import systemd
import sys
import pexpect
import json
RUNNING_IN_KODI = True
# XBMC Modules
try:
import xbmc
import xbmcgui
import xbmcaddon
except:
RUNNING_IN_KODI = False
DEVICE_PATH = 'org.bluez.Device1'
P... | connman.toggle_technology_state('bluetooth', state)
def get_adapter_property(key): |
<|file_name|>test_cat.rs<|end_file_name|><|fim▁begin|>//! The `cat` subtest.
use std::borrow::Cow;
use cretonne::ir::Function;
use cton_reader::TestCommand;
use subtest::{self, SubTest, Context, Result as STResult};
/// Object implementing the `test cat` sub-test.
///
/// This command is used for testing the parser a... | impl SubTest for TestCat {
fn name(&self) -> Cow<str> {
Cow::from("cat")
} |
<|file_name|>account_change_currency.py<|end_file_name|><|fim▁begin|># -*- encoding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: y... | |
<|file_name|>defs.py<|end_file_name|><|fim▁begin|>"""
Common definitions/constants used throughout the manager.
"""<|fim▁hole|>
from ai.backend.common.types import SlotName, SlotTypes
INTRINSIC_SLOTS: Final = {
SlotName('cpu'): SlotTypes('count'),
SlotName('mem'): SlotTypes('bytes'),
}<|fim▁end|> |
from typing import Final |
<|file_name|>theme_category.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
# -*-coding:utf-8-*-
# @Time : 2017/11/1 ~ 2019/9/1
# @Author : Allen Woo
from flask import request
from apps.core.flask.login_manager import osr_login_required
from apps.configs.sys_config import METHOD_WARNING
from apps.core.blueprint i... |
2. 获取所有的type: config.py文件中category的所有CATEGORY TYPE
action:<str>, 为get_category_type
theme_name:<str> |
<|file_name|>billow.rs<|end_file_name|><|fim▁begin|>use math::{self, scale_shift, Point2, Point3, Point4};
use noise_fns::{MultiFractal, NoiseFn, Perlin, Seedable};
use std;
/// Noise function that outputs "billowy" noise.
///
/// This noise function produces "billowy" noise suitable for clouds and rocks.
///
/// This... | fn get(&self, mut point: Point2<f64>) -> f64 {
let mut result = 0.0; |
<|file_name|>pytest.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python2
# -*- coding: utf-8 -*-
import sys<|fim▁hole|>## build directory) without installing the bindings.
#sys.path.append ('.')
#sys.path.append ('.libs')
import Hamlib
def StartUp():
"""Simple script to test the Hamlib.py module with Python2."... |
## Uncomment to run this script from an in-tree build (or adjust to the |
<|file_name|>artists.client.service.ts<|end_file_name|><|fim▁begin|>(function () {
'use strict';
angular
.module('artists.services')
.factory('ArtistsService', ArtistsService);
ArtistsService.$inject = ['$resource'];
function ArtistsService($resource) {
return $resource('api/artists/:artistId', {... | }());
angular.module('artists').factory('ArtistYearEnrolled', ['$resource', |
<|file_name|>mensajes.js<|end_file_name|><|fim▁begin|><|fim▁hole|>
var msj_beforeSend=function (){
bootbox.dialog({
title: 'Vive Pueblos Mágicos',
message: '<center><i class="fa fa-spinner fa-spin fa-3x msjOk"></i><br>Espere por favor.</center>'
,onEscape : function()... | /* * @felipe de jesus | iti_fjpp@hotmail.com */ |
<|file_name|>mod.rs<|end_file_name|><|fim▁begin|>// Copyright 2013-2014 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution and at
// http://rust-lang.org/COPYRIGHT.
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/licens... | //! collection in the most "natural" order. For sequence collections like `Vec`,
//! this means the items will be yielded in increasing order of index starting |
<|file_name|>config.js<|end_file_name|><|fim▁begin|>import {writeFile} from 'fs-promise';
import {get, has, merge, set} from 'lodash/fp';
import flatten from 'flat';
import fs from 'fs';
import path from 'path';
const data = new WeakMap();
const initial = new WeakMap();
export default class Config {
constructor(d) ... | merge(extra) {
data.set(this, merge(data.get(this), extra));
} |
<|file_name|>015-M-3Sum.py<|end_file_name|><|fim▁begin|># Given an array S of n integers, are there elements a, b, c in S such that a + b + c = 0? Find all unique triplets
# in the array which gives the sum of zero.
#
# Note: The solution set must not contain duplicate triplets.
#
# For example, given array S = [-1, 0,... | # ]
class Solution(object): |
<|file_name|>SubmissionTrayRadioInputGroup.js<|end_file_name|><|fim▁begin|>/*
* Copyright (C) 2017 - present Instructure, Inc.
*
* This file is part of Canvas.
*
* Canvas is free software: you can redistribute it and/or modify it under
* the terms of the GNU Affero General Public License as published by the Free
... | |
<|file_name|>minesweeperNN.js<|end_file_name|><|fim▁begin|>// ==UserScript==
// @name mineAI
// @namespace minesAI
// @include http://minesweeperonline.com/#beginner-night
// @version 1
// @required http://localhost:8000/convnetjs.js
// @grant none
// ==/UserScript==
// Load the library.
var ... |
// Call the library's start-up function, if any. Note needed use of unsafeWindow.
function initConvNetJs () {
|
<|file_name|>Servo.py<|end_file_name|><|fim▁begin|>import Adafruit_BBIO.PWM as PWM
class Servo:
def __init__(self, pin):
self.servo_pin = pin
self.duty_min = 3
self.duty_max = 14.5
self.duty_span = self.duty_max - self.duty_min
def StartServo(self):
print("Starting servo")<|fim▁hole|> self.SetAngle(s... | print(self.servo_pin)
PWM.start(self.servo_pin, (100 - self.duty_min), 60.0, 1)
self.current_angle = 90.0 |
<|file_name|>clip-move.ts<|end_file_name|><|fim▁begin|>import { Inject, Service } from 'libs/typedi';
import { Clip } from 'core/models/clip';
import { TimelineVector } from 'core/primitives/timeline-vector';
import { TrackStore } from 'core';
@Service()
export default class ClipMoveService {
@Inject(_ => TrackSto... | clip.setTrackId(nextTrack.id);
});
} |
<|file_name|>jquery-fullheight.js<|end_file_name|><|fim▁begin|>(function ($) {
'use strict';
// Device check for limiting resize handling.
var IS_DEVICE = /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent);
function FullHeight(el, options) {
this.el = $(el);
var data ... | // This causes a lot of arbitrary layout jumps and slow image resize operations with this plugin.
// So for device UA where height should not change, we only update if the width changes as well (f.ex.
// orientation changes).
this.allowDeviceHeightResize = !( |
<|file_name|>test_mail.py<|end_file_name|><|fim▁begin|>from django.conf import settings
from django.core import mail
from rdmo.core.mail import send_mail
def test_send_mail(db):
send_mail('Subject', 'Message', to=['user@example.com'])
assert len(mail.outbox) == 1
assert mail.outbox[0].subject == '[examp... | |
<|file_name|>BaseAnnotationHandlersTest.java<|end_file_name|><|fim▁begin|>/*
* *************************************************************************************************
* Copyright 2016 Universum Studios
* ***********************************************************************... | new BaseAnnotationHandlers();
}
@Test(expected = InvocationTargetException.class) |
<|file_name|>dead.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.
// Removal of dead code and data.<|fim▁hole|>
package main
import "cmd/internal/goobj"
// dead removes unrea... | |
<|file_name|>EffectiveType.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 to You under... | |
<|file_name|>parser_test.py<|end_file_name|><|fim▁begin|># Copyright 2015 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.apach... | self.assertTrue(os.path.relpath(__file__, '/') in docs)
def test_generate_markdown_for_function(self): |
<|file_name|>binary_ops.rs<|end_file_name|><|fim▁begin|>use crate::ndarray_ext::{NdArray, NdArrayView};
use crate::op;
use crate::tensor::Tensor;
use crate::tensor_ops::*;
use crate::Float;
use crate::Graph;
use ndarray;
use ndarray::Axis;
use std::mem;
pub struct AddOp;
pub struct SubOp;
pub struct MulOp;
pub struct ... | let shape0 = &shape(x0); |
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|># ----------------------------------------------------------------------------
# pyglet
# Copyright (c) 2006-2008 Alex Holkner
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that ... | |
<|file_name|>urls.py<|end_file_name|><|fim▁begin|>from rest_framework.routers import SimpleRouter<|fim▁hole|>from api.formattedmetadatarecords import views
router = SimpleRouter()
router.register(r'formattedmetadatarecords', views.FormattedMetadataRecordViewSet, basename='formattedmetadatarecord')
urlpatterns = route... | |
<|file_name|>iptables.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright: (c) 2015, Linus Unnebäck <linus@folkdatorn.se>
# Copyright: (c) 2017, Sébastien DA ROCHA <sebastien@da-rocha.net>
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
fr... | return rule
def push_arguments(iptables_path, action, params, make_rule=True): |
<|file_name|>test_authentication.py<|end_file_name|><|fim▁begin|>from tests import BaseTestCase
import mock
import time
from redash.models import User
from redash.authentication.account import invite_token
from tests.handlers import get_request, post_request
class TestInvite(BaseTestCase):
def test_expired_invite... | self.assertEqual(response.status_code, 400)
|
<|file_name|>forms.py<|end_file_name|><|fim▁begin|>from django import forms
from getresults_aliquot.models import Aliquot
from .models import Order
<|fim▁hole|> def clean_aliquot_identifier(self):
aliquot_identifier = self.cleaned_data.get('aliquot_identifier')
try:
Aliquot.objects.get... | class OrderForm(forms.ModelForm):
|
<|file_name|>api_requestor.py<|end_file_name|><|fim▁begin|>import calendar
import datetime<|fim▁hole|>import platform
import time
import os
import ssl
import socket
import urllib
import urlparse
import warnings
import shippo
from shippo import error, http_client, version, util, certificate_blacklist
def _encode_date... | |
<|file_name|>internalAliasInterfaceInsideLocalModuleWithExport.ts<|end_file_name|><|fim▁begin|>// @declaration: true
export module a {
export interface I {
}
<|fim▁hole|>export module c {
export import b = a.I;
export var x: b;
}<|fim▁end|> | }
|
<|file_name|>preprocessed_dataset.py<|end_file_name|><|fim▁begin|>import numpy as np
import os
import random
import threading
import time<|fim▁hole|>import chainer
_batches_per_group = 32
_p_cmudict = 0.5
_pad = 0
# https://github.com/chainer/chainer/blob/1ad6355f8bfe4ccfcf0efcfdb5bd048787069806/examples/imagenet/tra... | import traceback
from util import cmudict, textinput
from util.infolog import log |
<|file_name|>test_v1beta1_pod_security_policy_list.py<|end_file_name|><|fim▁begin|># coding: utf-8
"""
Kubernetes
No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
OpenAPI spec version: v1.7.4
Generated by: https://github.com/swagger-api/swagge... | |
<|file_name|>command_handlers.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python3
#
# Copyright (c) 2020, The OpenThread Authors.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# 1. Redis... | |
<|file_name|>CScrollingBg.js<|end_file_name|><|fim▁begin|>function CScrollingBg(oSprite){
var _iLastObjIndex;
var _aTiles;
var _oSpriteTile;
this._init = function(oSprite){
_oSpriteTile = oSprite;
_aTiles = new Array();
var iYPos = -oSprite.height;
while( i... | var oTile = new createjs.Bitmap(oSprite);
oTile.y=iYPos;
|
<|file_name|>hammingdb.py<|end_file_name|><|fim▁begin|>import lmdb
from zounds.nputil import Growable, packed_hamming_distance
import numpy as np
from multiprocessing.dummy import Pool as ThreadPool
from multiprocessing import cpu_count
import os
import binascii
class HammingDb(object):
def __init__(self, path, m... | range(0, n_codes, chunksize))))
# argpartition will ensure that the lowest scores will all be |
<|file_name|>visdown-marked.js<|end_file_name|><|fim▁begin|>window.onload = function () {
// Start a new marked instance and renderer
var marked = window.marked;
var renderer = new marked.Renderer();
var counter = 0;
var specs = [];
var opts = {"mode": "vega-lite", "renderer": "svg" };
// Render the ```vis as... | }
var result = marked.Renderer.prototype.code.call(this, code, lang, escaped);
return result;
}; |
<|file_name|>gulpfile.js<|end_file_name|><|fim▁begin|>const gulp = require('gulp'),
eslint = require('gulp-eslint'),
mocha = require('gulp-mocha');
const SOURCE = './src',
TEST_SOURCE = './test',
UNIT_TEST_SOURCE = './test/unit';
gulp.task('lint', func... | }); |
<|file_name|>custom_command_detection.py<|end_file_name|><|fim▁begin|>from config import Prefix<|fim▁hole|>from sigma.core.blacklist import check_black
async def custom_command_detection(ev, message, args):
if message.guild:
if message.content.startswith(Prefix):
cmd = message.content[len(Pref... | |
<|file_name|>CommunicationTest.py<|end_file_name|><|fim▁begin|>#! /usr/bin/env python
import unittest
import time
from Communication import Communication
class CommunicationTest(unittest.TestCase):
def setUp(self):
'''
Verify environment is setup properly.
'''
self.controller ... | self.b_list = self.controller.get_bluetooth_list()
|
<|file_name|>storage.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
| This file is part of the web2py Web Framework
| Copyrighted by Massimo Di Pierro <mdipierro@cs.depaul.edu>
| License: LGPLv3 (http://www.gnu.org/licenses/lgpl.html)
Provides:
- List; like list but returns None in... | |
<|file_name|>app.js<|end_file_name|><|fim▁begin|>'use strict';
<|fim▁hole|><|fim▁end|> | var app = angular.module('App', ['App.controller']); |
<|file_name|>environment.js<|end_file_name|><|fim▁begin|>const { environment } = require('@rails/webpacker')
const webpack = require('webpack');
environment.toWebpackConfig().merge({
resolve: {
alias: {
'jquery': 'jquery/src/jquery'
}
}<|fim▁hole|><|fim▁end|> | });
module.exports = environment |
<|file_name|>drop_stale_gradient_optimizer.py<|end_file_name|><|fim▁begin|># Copyright 2017 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# ... | def get_slot(self, *args, **kwargs):
return self._opt.get_slot(*args, **kwargs) |
<|file_name|>profiles.py<|end_file_name|><|fim▁begin|>"""Common profiles are defined here to be easily used within a project using --profile {name}"""
from typing import Any, Dict
black = {
"multi_line_output": 3,
"include_trailing_comma": True,
"force_grid_wrap": 0,
"use_parentheses": True,
"ensur... | "lines_between_types": 1,
"multi_line_output": 3,
"use_parentheses": True, |
<|file_name|>module_test.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
#
# Copyright 2007 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/lic... | self.mox.ReplayAll()
self.servr._maybe_restart_instances(config_changed=False,
file_changed=True)
self.mox.VerifyAll() |
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|>from __future__ import absolute_import, unicode_literals
__author__ = 'admin'
# This will make sure the app is always imported when
<|fim▁hole|>__all__ = ['celery_app']<|fim▁end|> | # Django starts so that shared_task will use this app.
from .celery import appautoticket as celery_app
|
<|file_name|>generate.js<|end_file_name|><|fim▁begin|>module.exports = function () {
var faker = require('faker');
var _ = require('lodash');
var getUserInfo = require('./mocks/getUserInfo.js');
var productName = function () {
return faker.commerce.productAdjective() +
' ' +
faker.commerce.prod... | summary: faker.lorem.paragraph() |
<|file_name|>telemetry.go<|end_file_name|><|fim▁begin|>package telemetry
import (
"runtime"
"time"
"github.com/PMoneda/telemetry/registry"
)
type Telemetry struct {
Registry registry.Registry
Root string
}
type Context func(*Telemetry) *Telemetry
type RetentionPolicy Context
type Measurement Context
typ... | |
<|file_name|>detect.py<|end_file_name|><|fim▁begin|>import os
import sys
def is_active():
return True
def get_name():
return "X11"
def can_build():
if (os.name!="posix"):
return False
if sys.platform == "darwin":
return False # no x11 on mac for now
errorval=os.system("pkg-config --vers... | if (is64):
env["bits"]="64"
else: |
<|file_name|>ingest.rs<|end_file_name|><|fim▁begin|>use std::{
collections::{BTreeMap, BTreeSet, HashMap, HashSet},
convert::TryInto,
};
use anyhow::{anyhow, Context, Error, Result};
use chrono::naive::NaiveDate;
use mobc::Pool;
use mobc_postgres::PgConnectionManager;
use serde::Deserialize;
use tokio_postgres... | ";
static SETUP_SQL: &str = include_str!("persistence.sql"); |
<|file_name|>gunicorn_conf.py<|end_file_name|><|fim▁begin|>import multiprocessing
import os
_is_travis = os.environ.get('TRAVIS') == 'true'
workers = multiprocessing.cpu_count()
if _is_travis:
workers = 2
bind = ['0.0.0.0:8080', '0.0.0.0:8081', '0.0.0.0:8082']
keepalive = 120<|fim▁hole|><|fim▁end|> | errorlog = '-'
pidfile = '/tmp/api_hour.pid'
pythonpath = 'hello'
backlog = 10240000 |
<|file_name|>letDeclarations-scopes-duplicates2.ts<|end_file_name|><|fim▁begin|>// @target: ES6<|fim▁hole|>// @Filename: file1.ts
let var1 = 0;
// @Filename: file2.ts
let var1 = 0;<|fim▁end|> | |
<|file_name|>enums.rs<|end_file_name|><|fim▁begin|>use std::str::from_utf8_owned;
#[deriving(Clone, PartialEq, Eq)]
pub enum ConnectionFailure {
HostNotFound,
ConnectionRefused,
}
#[deriving(Clone, PartialEq, Eq)]
pub enum ParseFailure {
InvalidPortString,<|fim▁hole|><|fim▁end|> | InvalidHostname,
} |
<|file_name|>github.go<|end_file_name|><|fim▁begin|>package provider
import (
"context"
"errors"
"strings"
"github.com/netlify/gotrue/conf"
"golang.org/x/oauth2"
)
// Github
const (
defaultGitHubAuthBase = "github.com"
defaultGitHubApiBase = "api.github.com"
)
type githubProvider struct {
*oauth2.Config
... | func (g githubProvider) GetOAuthToken(code string) (*oauth2.Token, error) {
return g.Exchange(oauth2.NoContext, code)
}
|
<|file_name|>test.py<|end_file_name|><|fim▁begin|>print("This is a test")
answer = raw_input("Please give me an answer ")<|fim▁hole|>print("Thank you " + answer)
def print_yes():
if answer == "yes":
print("YAS!")
else:
print("Hello World!")
print_yes()
kind_message = raw_input(answer + ... | |
<|file_name|>zsi_init.js<|end_file_name|><|fim▁begin|>//initialize Settings.
zsi.init({
baseURL : base_url
,errorUpdateURL : base_url + "common/errors_update"
,sqlConsoleName : "runsql"
,excludeAjaxWatch : ["checkDataExist","employe_search_json"]
});
//check cookie and load use... | function loadUserInfo(){
$.getJSON(base_url + "users/getuserinfo",function(data){
|
<|file_name|>repeat_finder_RRBS_NormalBCD19pCD27mcell23_44_GTAGAGGA.A.py<|end_file_name|><|fim▁begin|>import glob
import numpy as np
import pandas as pd
from numpy import nan
import os
os.chdir("/gpfs/commons/home/biederstedte-934/evan_projects/RRBS_anno_clean")
<|fim▁hole|>def between_range(row):
subset = repeats... | repeats = pd.read_csv("repeats_hg19.csv")
annofiles = glob.glob("RRBS_NormalBCD19pCD27mcell23_44_GTAGAGGA.A*")
|
<|file_name|>font_face.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 [`@font-face`][ff] at-rule.
//!
//! [ff]: https://d... | |
<|file_name|>SPI1.hpp<|end_file_name|><|fim▁begin|>#pragma once
#include <Register/Utility.hpp>
namespace Kvasir {
//Serial Peripheral Interface
namespace Spi1Mcr{ ///<Module Configuration Register
using Addr = Register::Address<0x4002d000,0x02e000fe,0x00000000,unsigned>;
///Halt
enum cl... | constexpr Register::FieldLocation<Addr,Register::maskFromRange(25,25),Register::ReadWriteAccess,TfffreVal> tfffRe{}; |
<|file_name|>test_demos_desordre.py<|end_file_name|><|fim▁begin|># -*- encoding: utf-8 -*-
import os
from abjad import abjad_configuration<|fim▁hole|>
def test_demos_desordre_01():
lilypond_file = desordre.make_desordre_lilypond_file()<|fim▁end|> | from abjad.demos import desordre |
<|file_name|>application.py<|end_file_name|><|fim▁begin|>from . import NamedEntity
class Application(NamedEntity):
def __init__(self, name, provider):
NamedEntity.__init__(self, name)<|fim▁hole|> self.provider = provider
def get_descendants(self):
return []<|fim▁end|> | |
<|file_name|>ip_f_s_client.go<|end_file_name|><|fim▁begin|>// Code generated by go-swagger; DO NOT EDIT.
package ipfs
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command
import (
"github.com/go-openapi/runtime"
strfmt "github.com/go-... | /*
ArchiveURL archives a URL |
<|file_name|>test_score.py<|end_file_name|><|fim▁begin|>"""
test pretrained models
"""
from __future__ import print_function
import mxnet as mx
from common import find_mxnet, modelzoo
from score import score
VAL_DATA='data/val-5k-256.rec'
def download_data():
return mx.test_utils.download(
'http://data.mxn... | m = 'imagenet1k-inception-bn' |
<|file_name|>playlist_rename_spec.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
from expects import expect
from mamba import describe, context, before
from spec.ui._ipod_helpers import *
from spec.ui._fixture import update_environment
with describe('ipodio playlist create') as _:
@before.all
def ... | |
<|file_name|>censor.py<|end_file_name|><|fim▁begin|>import re
import json
import urlparse
from holster.enum import Enum
from unidecode import unidecode
from disco.types.base import cached_property
from disco.types.channel import ChannelType
from disco.util.sanitize import S
from disco.api.http import APIException
fro... | |
<|file_name|>urls.py<|end_file_name|><|fim▁begin|>from django.conf.urls import patterns, url, include
urlpatterns = patterns('',
('', include('imago.urls')),
url(r'^report/(?P<module_name>[a-z0-9_]+)/$', 'reports.views.report', name='report'),
url(r'^represent/(?P<module_name>[a-z0-9_]+)/$', 'reports.views... | url(r'^warnings/$', 'reports.views.warnings', name='warnings'),
url(r'^$', 'reports.views.home', name='home'),
) |
<|file_name|>basic.py<|end_file_name|><|fim▁begin|>#!Measurement
# all of this is configuration info that can be used in the script.
# you refer to these values using mx.<group>.<attribute>
# e.g<|fim▁hole|>baseline:
after: true
before: false
counts: 180
detector: H1
mass: 34.2
settling_time: 15
default_f... | # mx.baseline.counts is 180
# mx.multicollect.detector is H1
''' |
<|file_name|>Kiduino.cpp<|end_file_name|><|fim▁begin|>/*
Kiduino.cpp - Kiduino library
Copyright (c) 2014 Adithya Selvaprithiviraj. All right reserved.
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free So... | |
<|file_name|>testmethods.py<|end_file_name|><|fim▁begin|>import zmq
class JRPC:
def __init__(self):
self.id = 0
def make_noti(self, method, params=None):
noti = {"jsonrpc":"2.0", "method":method}
if params is not None:
noti["params"] = params
return noti
def make_req(self, method, params=None):
req =... | |
<|file_name|>twilio-mnc-mcc-getter.py<|end_file_name|><|fim▁begin|>import logging
import os
from twilio.rest import Client
class TwilioClient(object):
def __init__(self):
self.logger = logging.getLogger("botosan.logger")
self.account_sid = os.environ["TWILIO_SID"]
self.account_token = os.e... | def get_available_numbers(self):
numbers = self.client.available_phone_numbers("GB").local.list(exclude_local_address_required=True) |
<|file_name|>dataset.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.or... | */
Dataset.prototype.table = function(id) {
return new Table(this, id); |
<|file_name|>ObjectCloneSnippets.java<|end_file_name|><|fim▁begin|>/*
* Copyright (c) 2011, 2015, 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 ... |
public class ObjectCloneSnippets implements Snippets { |
<|file_name|>clipboard_ozone.cc<|end_file_name|><|fim▁begin|>// Copyright 2018 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "ui/base/clipboard/clipboard_ozone.h"
#include <limits>
#include <utility>
#includ... | };
void PerformRequestAndWaitForResult(ClipboardBuffer buffer,
Request* request) { |
<|file_name|>test_prepared_metadata.cpp<|end_file_name|><|fim▁begin|>/*
Copyright (c) DataStax, Inc.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE... | |
<|file_name|>bitcoin_mk_MK.ts<|end_file_name|><|fim▁begin|><TS language="mk_MK" version="2.1">
<context>
<name>AddressBookPage</name>
<message>
<source>Right-click to edit address or label</source>
<translation>Десен клик за уредување на адреса или етикета</translation>
</message>
<messa... | <source>Message:</source>
<translation>Порака:</translation>
</message> |
<|file_name|>acceptance_docker.py<|end_file_name|><|fim▁begin|>"""
This config file extends the test environment configuration
so that we can run the lettuce acceptance tests.
"""
# We intentionally define lots of variables that aren't used, and
# want to import all variables from base settings files
# pylint: disable... | update_module_store_settings(
MODULESTORE,
doc_store_settings={
'db': 'acceptance_xmodule', |
<|file_name|>Row.js<|end_file_name|><|fim▁begin|>'use strict';
var _index = require('/Users/markmiro/proj/ui-experiments/node_modules/babel-preset-react-hmre/node_modules/redbox-react/lib/index.js');
var _index2 = _interopRequireDefault(_index);
var _index3 = require('/Users/markmiro/proj/ui-experiments/node_modules... |
return _possibleConstructorReturn(this, Object.getPrototypeOf(Row).apply(this, arguments)); |
<|file_name|>hook_manager.py<|end_file_name|><|fim▁begin|># ----------------------------------------------------------------------
# Numenta Platform for Intelligent Computing (NuPIC)
# Copyright (C) 2021, Numenta, Inc. Unless you have an agreement
# with Numenta, Inc., for a separate license for this software code, t... | self.tracked_modules = dict() |
<|file_name|>_neuronfunc.py<|end_file_name|><|fim▁begin|># Copyright (c) 2015, Ecole Polytechnique Federale de Lausanne, Blue Brain Project
# All rights reserved.
#
# This file is part of NeuroM <https://github.com/BlueBrain/NeuroM>
#
# Redistribution and use in source and binary forms, with or without
# modification, ... | If a single neuron is passed, a single element list with the
radius of its soma member is returned. |
<|file_name|>dep3-1.js<|end_file_name|><|fim▁begin|><|fim▁hole|><|fim▁end|> | //= require "dep3-1-1.js, dep3.js" |
<|file_name|>grpc.py<|end_file_name|><|fim▁begin|># Copyright (C) 2016 - Yevgen Muntyan
# Copyright (C) 2016 - Ignacio Casal Quinteiro
# Copyright (C) 2016 - Arnavion
#
# 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
# t... | repo_url="https://github.com/grpc/grpc.git", |
<|file_name|>interactive.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Region Fixer.
# Fix your region files with a backup copy of your Minecraft world.
# Copyright (C) 2020 Alejandro Aguilera (Fenixin)
# https://github.com/Fenixin/Minecraft-Region-Fixer
#
# This program... | if len(args) == 1:
if self.current: |
<|file_name|>ext_authz_test.cc<|end_file_name|><|fim▁begin|>#include <memory>
#include <string>
#include <vector>
#include "envoy/config/core/v3/base.pb.h"
#include "envoy/extensions/filters/http/ext_authz/v3/ext_authz.pb.h"
#include "envoy/extensions/filters/http/ext_authz/v3/ext_authz.pb.validate.h"
#include "envoy/... | const std::string original_path{"/users?remove-me=123"};
const std::string expected_path{"/users?add-me=456"};
const Http::Utility::QueryParamsVector add_me{{"add-me", "456"}}; |
<|file_name|>load.py<|end_file_name|><|fim▁begin|>"""
Load the CCGOIS datasets into a CKAN instance
"""
import dc
import json
import slugify
import ffs
def make_name_from_title(title):
# For some reason, we're finding duplicate names
name = slugify.slugify(title).lower()[:99]
if not name.startswith('ccgois... | object_type='package',
capacity='member'
) |
<|file_name|>Publication_Maker.py<|end_file_name|><|fim▁begin|>from __future__ import division
import socket, MySQLdb
from PIL import Image
from random import randint, randrange
from ConfigParser import SafeConfigParser
parser = SafeConfigParser()
parser.read('../analogy_config.ini')
db = MySQLdb.connect(
host = ... | else:
_a = []
for row in data: |
<|file_name|>pool.rs<|end_file_name|><|fim▁begin|>// Copyright 2017 The Gfx-rs Developers.
//
// 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... | |
<|file_name|>protocols_client.py<|end_file_name|><|fim▁begin|># Copyright 2020 Samsung Electronics Co., Ltd
# 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:... | """
post_body = json.dumps({'protocol': kwargs})
resp, body = self.patch(
'OS-FEDERATION/identity_providers/%s/protocols/%s' |
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|>import requests
"""The available regions"""
REGIONS = {
'US': 'https://us.api.battle.net/wow',
'EU': 'https://eu.api.battle.net/wow',
'KR': 'https://kr.api.battle.net/wow',
'TW': 'https://tw.api.battle.net/wow'
}
"""The available fields for use to ... |
def guild_rewards(self):
"""Returns a list of all guild rewards"""
resourceUrl = "/data/guild/rewards" |
<|file_name|>0014_auto_20160215_1331.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
from __future__ import unicode_literals
from cms.models import Page
from cms.utils.i18n import get_language_list
from django.db import migrations, models
def forwards(apps, schema_editor):
BlogConfig = apps.get_model('dj... |
dependencies = [
('cms', '0004_auto_20140924_1038'), |
<|file_name|>camera3d.py<|end_file_name|><|fim▁begin|>import numpy, cairo, math
from scipy import ndimage
from .object3d import Object3d
from .point3d import Point3d
from .polygon3d import Polygon3d
from .draw_utils import *
from .colors import hsv_to_rgb, rgb_to_hsv
def surface2array(surface):
data = surface.get... | |
<|file_name|>PythonVarArgsConstructor.py<|end_file_name|><|fim▁begin|><|fim▁hole|>class PythonVarArgsConstructor:
def __init__(self, mandatory, *varargs):
self.mandatory = mandatory
self.varargs = varargs
def get_args(self):
return self.mandatory, ' '.join(self.varargs)<|fim▁end|> | |
<|file_name|>log_settings.py<|end_file_name|><|fim▁begin|># coding=utf-8
"""
https://docs.python.org/3/howto/logging.html
https://fangpenlin.com/posts/2012/08/26/good-logging-practice-in-python/
"""
import logging
import logging.config
from logging import Formatter
import pathlib
import yaml
import time
from common.se... |
logging.info(complete_line) |
<|file_name|>az-Cyrl.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
*/
// THIS CODE IS GENERATED - DO NOT MODIFY
// See angular/tools/... | 'ахшамүстү', 'ахшам', 'ҝеҹә'
],
], |
<|file_name|>User.java<|end_file_name|><|fim▁begin|>/*
* Wegas
* http://wegas.albasim.ch
*
* Copyright (c) 2013, 2014, 2015 School of Business and Engineering Vaud, Comem
* Licensed under the MIT License
*/
package com.wegas.core.security.persistence;
import com.fasterxml.jackson.annotation.JsonIgnore;
import co... |
/**
* @param permission
* @return true id the permission has successfully been added |
<|file_name|>BasicTrainingActivity.java<|end_file_name|><|fim▁begin|>package de.klimek.spacecurl.activities;
import android.animation.Animator;
import android.animation.AnimatorListenerAdapter;
import android.content.Context;
import android.content.pm.ActivityInfo;
import android.graphics.Color;
import android.os.Bund... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.