text stringlengths 3 1.05M |
|---|
import imp
from os.path import dirname
class DeviceExplorer:
def __init__(self, mqtt, devices):
self.mqtt = mqtt
self.devices = devices
self.status_topic_map = dict()
def find_class(self, class_name):
device_class = self._get_class(class_name)
if class_name in [v["c... |
"""The Apple TV integration."""
import asyncio
import logging
from random import randrange
from pyatv import connect, exceptions, scan
from pyatv.const import DeviceModel, Protocol
from pyatv.convert import model_str
from homeassistant.components import zeroconf
from homeassistant.config_entries import ConfigEntry
fr... |
document.addEventListener(
"DOMContentLoaded",
function () {
var days = document.querySelector(".days span");
var hour = document.querySelector(".hour");
var min = document.querySelector(".min");
var second = document.querySelector(".second");
var startDate = new Date(2021, 4, 19);
days.inn... |
import random
class Generator(object):
def __init__(self, file_name):
self.probs = {}
self.words = self.init_dictionary(file_name)
self.init_database()
def init_dictionary(self, file_name):
with open(file_name, 'r') as f:
data = f.read()
return [w.strip... |
var assert = require("assert");
var Browser = require("zombie");
var path = require("path");
var fs = require("fs");
var _js = "";
const browser = new Browser();
var indexHTMLURL = "file://" + path.join(__dirname, "..", "index.html");
/** Utilities **/
// TODO: with refactor into a node module, this can go away!
fu... |
/*
* (C) Copyright 2013 ECMWF.
*
* This software is licensed under the terms of the Apache Licence Version 2.0
* which can be obtained at http://www.apache.org/licenses/LICENSE-2.0.
* In applying this licence, ECMWF does not waive the privileges and immunities
* granted to it by virtue of its status as an intergo... |
#!/usr/bin/python
# Copyright (c) 2011 GeometryFactory Sarl (France)
#
# This file is part of CGAL (www.cgal.org); you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public License as
# published by the Free Software Foundation; either version 3 of the License,
# or (at your option) ... |
import { formatFileSize, isDefinedGlobally } from './utils';
const messages = {
after: (field, [target]) => ` ${field}必须在${target}之后`,
alpha_dash: (field) => ` ${field}能够包含字母数字字符,包括破折号、下划线`,
alpha_num: (field) => `${field} 只能包含字母数字字符.`,
alpha_spaces: (field) => ` ${field} 只能包含字母字符,包括空格.`,
alpha: (field) => `... |
# This file is part of Indico.
# Copyright (C) 2002 - 2021 CERN
#
# Indico is free software; you can redistribute it and/or
# modify it under the terms of the MIT License; see the
# LICENSE file for more details.
import hashlib
import os
import typing as t
from collections import defaultdict
from datetime import datet... |
import random
from usercodex import codex
from ..core.managers import edit_or_reply
from . import fonts
plugin_category = "extra"
@codex.cod_cmd(
pattern="fmusical(?:\s|$)([\s\S]*)",
command=("fmusical", plugin_category),
info={
"header": "Font style command.(Changes font style of the given tex... |
import createElement from 'test-utils/mocks/element-mock';
import p from '../../../src';
const { chart } = p;
describe('Chart', () => {
let element;
let data;
let pointMarkerRed;
let pointMarkerGreen;
let pointMarkerBlue;
let settings;
beforeEach(() => {
element = createElement();
data = [
... |
#if __cplusplus==201103L
#include "LSProblem11.h"
#else
#ifndef GSE_LS_LSPROBLEM_H
#define GSE_LS_LSPROBLEM_H
#define FUSION_MAX_SET_SIZE 20
#define FUSION_MAX_VECTOR_SIZE 20
#include "../GSEDefs.h"
#include "../ManifoldUtil.h"
#include "ConstraintTraits.h"
#include "NonlinearEstimator.h"
#include "RandomVariable.h"... |
#include <stdio.h>
#define N 10000
double a,b,c,d,p,q,x;
double funct(double);
double sum(void);
int main(void)
{
printf("I'm gonna integrate ax^3 + bx^2 + cx + d, between p and q. Input a, b, c, d, p and q plox. In that order.");
scanf("%lf %lf %lf %lf %lf %lf",&a,&b,&c,&d,&p,&q);
printf("\n... |
/*******************************************************************************
* Copyright (C) 2020 Microchip Technology Inc. and its subsidiaries.
*
* Subject to your compliance with these terms, you may use Microchip software
* and any derivatives exclusively with Microchip products. It is your
* responsibility to ... |
""" Exceptions """
class DocumentError( Exception ):
"""All module's exceptions subclass this class."""
def __str__( self ):
return self.message
class InvalidMethodError( DocumentError ):
def __init__( self, method):
self.message = "Invalid method - '%s' ." % ( method )
class InvalidEleme... |
var fs = require('fs'),
Map = require('./projector'),
Projector = require('./projector');
/**
* Map tile routing
* :zoom/:col/:row.png routing
*/
module.exports.tilePng = function tilePng(options){
var options = options || {},
map = options.map;
if (!options.map) {
throw new Error("You must s... |
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
/**
* @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
*/
const core_1 = require("@angular-devkit/... |
"""posts table
Revision ID: 88a7bbc675d4
Revises: 9504422a8cf2
Create Date: 2020-05-29 15:53:06.967045
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = '88a7bbc675d4'
down_revision = '9504422a8cf2'
branch_labels = None
depends_on = None
def upgrade():
# ##... |
# -*- coding: utf-8 -*-
"""
pygments.lexers.markup
~~~~~~~~~~~~~~~~~~~~~~
Lexers for non-HTML markup languages.
:copyright: Copyright 2006-2015 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
import re
from pygments.lexers.html import HtmlLexer, XmlLexer
from pygme... |
exports.MESSAGE_SEPERATOR = String.fromCharCode( 30 ); // ASCII Record Seperator 1E
exports.MESSAGE_PART_SEPERATOR = String.fromCharCode( 31 ); // ASCII Unit Separator 1F
exports.SOURCE_MESSAGE_CONNECTOR = 'SOURCE_MESSAGE_CONNECTOR';
exports.LOG_LEVEL = {};
exports.LOG_LEVEL.DEBUG = 0;
exports.LOG_LEVEL.INFO = 1;
exp... |
#-*- coding: utf-8 -*-
from flask import Flask, render_template, request
import pickle
import numpy as np
import streamlit as st
from kobart import get_kobart_tokenizer
from transformers.models.bart import BartForConditionalGeneration
import torch
import json
from transformers import PreTrainedTokenizerFast
... |
# ******* WARNING - AUTO GENERATED CODE - DO NOT EDIT *******
from .VmomiSupport import CreateDataType, CreateManagedType
from .VmomiSupport import CreateEnumType
from .VmomiSupport import AddVersion, AddVersionParent
from .VmomiSupport import AddBreakingChangesInfo
from .VmomiSupport import F_LINK, F_LINKABLE
from .Vm... |
/* $NetBSD: stdarg.h,v 1.13 1999/02/20 00:33:55 kristerw Exp $ */
/*
* Copyright (c) 1992, 1993
* The Regents of the University of California. All rights reserved.
*
* This software was developed by the Computer Systems Engineering group
* at Lawrence Berkeley Laboratory under DARPA contract BG 91-66 and
* cont... |
/*global module:false*/
module.exports = function(grunt) {
grunt.loadNpmTasks('grunt-mocha-test');
// Project configuration.
grunt.initConfig({
// Metadata.
pkg: grunt.file.readJSON('package.json'),
banner: '/*! <%= pkg.title || pkg.name %> - v<%= pkg.version %> - ' +
'<%= grunt.template.today... |
#include "io_def.h"
#include "main/bootlib.h"
#include "main/main.h"
#include "types.h"
#include "vdp.h"
extern u16 global_mode;
void main() {
boot_print("Example file Number Three!\xff",
(to_vdpptr(NMT_POS_PLANE(10, 10, BOOT_PLANEA_ADDR)) | VRAM_W));
do {
boot_vint_wait_default();
} while (!... |
import pytest
import torch
from torch_sparse import SparseTensor
from torch_geometric.nn import GENConv
from torch_geometric.testing import is_full_test
@pytest.mark.parametrize('aggr', ['softmax', 'softmax_sg', 'power'])
def test_gen_conv(aggr):
x1 = torch.randn(4, 16)
x2 = torch.randn(2, 16)
edge_index... |
/**
* Class: HomeHeader
* Author: Notend
* Date: 2018-07-29 00:37
* Description:
*/
import React, {Component} from 'react';
import {View, Text, StyleSheet, Image} from 'react-native';
import Swiper from 'react-native-swiper'
import {screen} from '../common'
export default class HomeHeader extends Component {
... |
# Copyright (c) 2020 PaddlePaddle Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appli... |
/*
* =================================================================
*
*
* Description: samsung display panel file
*
* Author: jb09.kim
* Company: Samsung Electronics
*
* ================================================================
*/
/*
<one line to give the program's name and a brief idea of what it... |
import tensorflow as tf
import tensorflow.keras as ks
import numpy as np
class ConstLayerNormalization(ks.layers.Layer):
"""
Layer normalization with constant scaler of input.
Note that this sould be replaced with keras normalization layer where trainable could be altered.
The standardization is done ... |
#!/usr/bin/env python
# -*- encoding: utf-8 -*-
'''
@File : tidal.py
@Time : 2019/02/27
@Author : Yaronzz
@VERSION : 2.0
@Contact : yaronhuang@foxmail.com
@Desc : tidal api
'''
import os
import re
import uuid
import requests
import json
import base64
import aigpy.stringHelper as st... |
import numpy as np
from math import ceil
class RingBuffer(object):
"""
A data structure that represents a sliding window over a data stream. Data can be pushed onto the buffer,
thereby discarding the oldest data. The buffer is not resizable.
Data is pushed onto the last dimension (in case of multidim... |
# Script for generating QA for a full exposure
from __future__ import absolute_import, division
from lvmutil.log import get_logger
import argparse
from lvmspec.qa import __offline_qa_version__
def parse(options=None):
parser = argparse.ArgumentParser(description="Generate Exposure Level QA [v{:s}]".format(__offl... |
/**
* @author Richard Davey <rich@photonstorm.com>
* @copyright 2018 Photon Storm Ltd.
* @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License}
*/
var GameObject = require('../GameObject');
/**
* Renders this Game Object with the WebGL Renderer to the given Camer... |
"""
WSGI config for malepierre project.
This module contains the WSGI application used by Django's development server
and any production WSGI deployments. It should expose a module-level variable
named ``application``. Django's ``runserver`` and ``runfcgi`` commands discover
this application via the ``WSGI_APPLICATION... |
# polarimetry utilities, including:
# datedfile(filename,date)
# datedline(filename,date)
# greff(grating,grang,artic,dateobs,wav)
# rssdtralign(datobs,trkrho)
# rssmodelwave(grating,grang,artic,trkrho,cbin,cols,datobs)
# configmap(infilelist,confitemlist,debug='False')
# image_number(image_name)
# list_configuration... |
#!/usr/bin/env python
#
# Copyright 2017 Confluent Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or... |
"""
Managing ~/.ssh/config
"""
import json
import os
from textwrap import dedent
from cloudmesh.common.Shell import Shell
from cloudmesh.common.console import Console
#
# THE CONFIG FILE NEEDS TO CHANGE WE WANT SSH OR HOST OR
# CLUSTER TO WORK WITH THIS
#
# noinspection PyPep8Naming
class ssh_config(object):
""... |
# -*- coding: utf-8 -*-
"""
Sphinx test suite utilities
~~~~~~~~~~~~~~~~~~~~~~~~~~~
:copyright: Copyright 2007-2011 by the Sphinx team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
import sys
import StringIO
import tempfile
import shutil
import re
from codecs import open
try:
from fun... |
//
// ImageViewController.h
// Imaginarium
//
// Created by PeterWang on 1/26/15.
// Copyright (c) 2015 PeterWang. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface ImageViewController : UIViewController
@property (strong, nonatomic) NSURL *imageURL;
@end
|
/**
* 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.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to... |
import os
import sys
UP = "\x1B[1A"
CLR = "\x1B[0K"
NEWLINE = "\n"
CLR_N = f"{CLR}{NEWLINE}"
class Message:
def __init__(self, message=None):
self._message = message
def show(self, message):
message = message.strip()
sys.stdout.write(f"{self.header}{message.replace(NEWLINE, CLR_N)}{C... |
# Generated by Django 3.1.1 on 2021-06-01 08:09
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('good_delivery', '0040_gooddelivery_phone'),
]
operations = [
migrations.AlterField(
model_name='gooddeliveryitem',
n... |
from setuptools import find_packages, setup
__package_name__ = "butterfree"
__version__ = "1.0.1"
__repository_url__ = "https://github.com/quintoandar/butterfree"
with open("requirements.txt") as f:
requirements = f.read().splitlines()
with open("README.md") as f:
long_description = f.read()
setup(
name... |
# Copyright 2019-2020 The ASReview Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appl... |
// Auto-generated file. Do not edit!
// Template: src/f32-vbinary/vopc-wasmsimd.c.in
// Generator: tools/xngen
//
// Copyright 2020 Google LLC
//
// This source code is licensed under the BSD-style license found in the
// LICENSE file in the root directory of this source tree.
#include <assert.h>
#include <wasm_s... |
/* eslint-disable react-hooks/exhaustive-deps */
import Thread from "./Thread";
import {useEffect, useState} from "react";
import axios from "axios";
function Threads() {
const [boardsInfo, setBoardsInfo] = useState([]);
useEffect(() => {
axios.get(`${process.env.REACT_APP_LOCALHOST_API}/board/short-in... |
# 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 the Apache License, Version 2.0 (t... |
from django.conf.urls import url
from django.contrib import admin
from django.core.management import call_command
from django.http import HttpResponseRedirect
from .models import Group, Post
class PostAdmin(admin.ModelAdmin):
list_display = ('pk', 'text', 'pub_date', 'author', 'group')
list_editable = ('grou... |
from schema_registry.serializers import faust_serializer as serializer
from schema_registry.client import schema
from tests import data_gen
def test_create_faust_serializer(client, country_schema):
schema_subject = "test-country"
faust_serializer = serializer.FaustSerializer(
client, schema_subject, ... |
""" About_Dialog module. """
# ISC License
#
# Copyright (c) 2020–2021, Paul Wilhelm, M. Sc. <anfrage@paulwilhelm.de>
#
# Permission to use, copy, modify, and/or distribute this software for any
# purpose with or without fee is hereby granted, provided that the above
# copyright notice and this permission notice ... |
import os
import subprocess
import platform
from SetupPython import PythonConfiguration as PythonRequirements
# Make sure everything we need for the setup is installed
PythonRequirements.Validate()
from SetupPremake import PremakeConfiguration as PremakeRequirements
from SetupVulkan import VulkanConfiguration as Vul... |
const input =
`
/**
* Represents an application service's registration file. This is expected to be
* loaded from another source, such as a YAML file.
* @category Application services
*/
export interface IAppserviceRegistration {
/**
* The various namespaces the application service can support.
*/
... |
(window.webpackJsonp=window.webpackJsonp||[]).push([[29],{WgF3:function(t,e,i){"use strict";i.r(e),i.d(e,"ion_datetime",function(){return U}),i.d(e,"ion_picker",function(){return X}),i.d(e,"ion_picker_column",function(){return et});var o=i("wEJo"),r=i("E/Mt"),n=i("1vRN"),a=i("SOSK"),s=i("74mu"),l=i("meiF"),d=i("qULd");... |
import isObject from './is-object'
async function objectSomeValueAsync (object, callback) {
if (!isObject(object)) return false
if (callback instanceof Array) {
const arr = callback
callback = async function (value) {
for (const func of arr) {
if (await func(value)) {
return true
... |
# Copyright (c) 2014 Mirantis, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law... |
# -*- coding: utf-8 -*-
"""
@author: Ana Silva
"""
import numpy as np
def _cselect(cpar, nper, mpopd, cvol, cpop, ccost, cwicmd):
mnpop = mpopd
pop = cpar.pop
mcaux = np.zeros([1, pop])
mvaux = np.zeros([nper+2, pop])
mphaux = np.zeros([nper, pop])
mptaux = np.zeros([nper, pop])
... |
/** @file outline.schema_tests.js
* @author Authored in 2020 at <https://github.com/nicky-nym/city3d>
* @license UNLICENSE
* This is free and unencumbered software released into the public domain.
* For more information, please refer to <http://unlicense.org>
*/
import { Schema } from '../../../src/schemas/schema... |
/*!
* Casper is a navigation utility for PhantomJS.
*
* Documentation: http://casperjs.org/
* Repository: http://github.com/n1k0/casperjs
*
* Copyright (c) 2011-2012 Nicolas Perriault
*
* Part of source code is Copyright Joyent, Inc. and other Node contributors.
*
* Permission is hereby granted, free of ch... |
# Generated by Django 3.2.7 on 2021-09-22 13:44
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('twitter_app', '0001_initial'),
]
operations = [
migrations.RenameModel(
old_name='Keywords',
new_name='Keyword',
),
... |
this.primevue=this.primevue||{},this.primevue.colorpicker=function(e,t,i){"use strict";function n(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var o=n(t),r={name:"ColorPicker",emits:["update:modelValue"],props:{modelValue:{type:null,default:null},defaultColor:{type:null,default:"ff0000"},inline:{type:Bo... |
/* eslint-disable react/prop-types */
import React, { Component, useState, useEffect } from 'react';
import { Tab, Tabs, TabList, TabPanel } from 'react-tabs';
import {
Accordion,
AccordionItem,
AccordionItemHeading,
AccordionItemButton,
AccordionItemPanel
} from 'react-accessible-accordion';
import QRCode fr... |
from flask.ext.wtf import Form
from wtforms import StringField, SubmitField
from wtforms.validators import Required
class SearchForm(Form):
search_string = StringField('Enter search string')
submit = SubmitField('Submit')
|
import pytest
import json
import jsonpickle
from ldclient.flags_state import FeatureFlagsState
def test_can_get_flag_value():
state = FeatureFlagsState(True)
flag = { 'key': 'key' }
state.add_flag(flag, 'value', 1, None, False)
assert state.get_flag_value('key') == 'value'
def test_returns_none_for_un... |
def strider1(p, n):
return [list(p[i::n]) for i in xrange(n)]
|
#ifndef OPENFILEDIALOG_H
#define OPENFILEDIALOG_H
#include <QtGui>
class OpenFileDialog : public QWidget
{
Q_OBJECT
public:
explicit OpenFileDialog(QTextEdit *textEdit, QString *fileName, QMainWindow *mainWindow);
private slots:
void find();
void openFileOfItem(int row, int column);
private:
QStr... |
# -*- coding: utf-8 -*-
# © Copyright 2009 Andre Engelbrecht. All Rights Reserved.
# This script is licensed under the BSD Open Source Licence
# Please see the text file LICENCE for more information
# If this script is distributed, it must be accompanied by the Licence
import csv
from django.contrib import admin
fro... |
#include <ncurses.h>
int main()
{
initscr(); /* Start curses mode */
printw("Hello World !!!"); /* Print Hello World */
refresh(); /* Print it on to the real screen */
getch(); /* Wait for user input */
endwin(); /* End curses mode */
return 0;
}
// build & run
// gcc cap.c -l ncurses && .... |
import stickybits from 'stickybits';
import AOS from 'aos';
import lozad from 'lozad';
export default {
init() {
stickybits('.sticky', {useStickyClasses: true});
AOS.init();
// Get all "navbar-burger" elements
var $navbarBurgers = Array.prototype.slice.call(document.querySelectorAll('.navbar-burger')... |
import searchMicromatch from 'unified-doc-search-micromatch';
import _vfile from 'vfile';
import { extensionTypes, mimeTypes } from './enums';
import { getFileData } from './file';
import { createProcessor } from './processor';
import { getSnippets } from './search';
export { extensionTypes, mimeTypes };
export defa... |
const utils = require('../utils');
const libs = require('../global/search');
const constants_global = require('../constants_global');
const constants = require('./constants');
const levenshtein = require('js-levenshtein');
module.exports = {
search: async (search, options) => {
return libs.search(constants_global.W... |
def reward_fn(reward, state, terminal):
return reward, terminal
|
'use strict';
const config = require('./config');
const createLogger = require('./logger');
const logger = createLogger(config);
const createServer = require('./server');
const updateUncaughtLogger = require('./util/uncaught-exception-handler.util')();
updateUncaughtLogger(logger);
createServer(config, logger)
.th... |
//
// MRCSelectBranchOrTagViewModel.h
// MVVMReactiveCocoa
//
// Created by leichunfeng on 15/1/29.
// Copyright (c) 2015年 leichunfeng. All rights reserved.
//
#import "MRCTableViewModel.h"
@interface MRCSelectBranchOrTagViewModel : MRCTableViewModel
@property (strong, nonatomic, readonly) OCTRef *selectedRefere... |
from dash import html
def render_html_table(columns, rows):
html_header = [html.Tr([html.Th(col) for col in columns])]
html_rows = [html.Tr([html.Td(children=cell) for cell in row]) for row in rows]
html_table = [html.Thead(html_header), html.Tbody(html_rows)]
return html_table
|
/* -*- Mode: C++; tab-width: 8; c-basic-offset: 2; indent-tabs-mode: nil; -*- */
#ifndef RR_RECORD_COMMAND_H_
#define RR_RECORD_COMMAND_H_
#include "Command.h"
class RecordCommand : public Command {
public:
virtual int run(std::vector<std::string>& args);
static RecordCommand* get() { return &singleton; }
prot... |
#ifndef H_HECTORC
#define H_HECTORC
#include <stdio.h>
#include <stdint.h>
#define TRUE 1
#define FALSE 0
typedef uint8_t u8;
#define UNEXPECTED_NODE(N) fprintf(stderr,\
"(%s:%d) Unexpected AST node type: %s\n",\
__FILE__, __LINE__, ast_type_to_str((N)->type));
#define UNEXPECTED_SEM_TYPE(T) fprintf(stderr,\
... |
"""wesalni URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/2.1/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: path('', views.home, name='home')
Class-based... |
/*
* bitfield.h
*
* Copyright © 2018 Oliver Adams
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the “Software”), to
* deal in the Software without restriction, including without limitation the
* rights to use, copy, modify... |
/**
* @license Copyright 2016 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.0
* Unless required by applicable law or a... |
#!/usr/bin/env python3
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License.
# command line arguments
# --report_url=<string>
# --report_file=<string, local file path, TXT/JSON file>
# --commit_hash=<string, full git commit hash>
import argparse
import mysql.connector
import j... |
#ifndef _X8664_DELAY_H
#define _X8664_DELAY_H
/*
* Copyright (C) 1993 Linus Torvalds
*
* Delay routines calling functions in arch/x86_64/lib/delay.c
*/
extern void __bad_udelay(void);
extern void __bad_ndelay(void);
extern void __udelay(unsigned long usecs);
extern void __ndelay(unsigned long usecs);
extern voi... |
define({
"_widgetLabel": "Таблица атрибутов",
"_featureAction_ShowRelatedRecords": "Показать связанные записи",
"_featureAction_ViewInTable": "Просмотреть в таблице атрибутов",
"ok": "OK",
"cancel": "Отмена",
"unsupportQueryWarning": "Для отображения в виджете Атрибутивная таблица слой должен поддержи... |
# ##### BEGIN GPL LICENSE BLOCK #####
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distrib... |
// Copyright (c) 2017 The MBMB developers
// Distributed under the MIT software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
#ifndef MBMB_BLOCKSIGNATURE_H
#define MBMB_BLOCKSIGNATURE_H
#include "key.h"
#include "primitives/block.h"
#include "keystore.h"
bool Si... |
/*
Description:
Short Intro
Some of you might remember spending afternoons playing Street Fighter 2 in some Arcade back in the 90s or emulating it nowadays with the numerous emulators for retro consoles.
Can you solve this kata? Suuure-You-Can!
UPDATE: a new kata's harder version is available here.
The Kata
You'll... |
import React from "react"
import { graphql } from "gatsby"
import Img from "gatsby-image"
import Layout from "../components/layout"
import SEO from "../components/seo"
import "../components/all.scss"
import styles from "../components/filmStyles.module.scss"
const FilmPage = ({data}) => (
<Layout >
<SEO t... |
module.exports = (bot) => {
// bot.registerCommand({
// name: "cf",
// category: "guild",
// info: {
// args: "[prefix flair] [postfix flair]",
// description: "adds a flair to all channels"
// },
// generator: async (msg, args) => {
// // complex channel flair
// }
// });
... |
# Simple pygame program
# Import and initialize the pygame library
import pygame
import random
import math
pygame.init()
SPARK_SPREAD = 8
class Spark():
def __init__(self):
self._r = 255
self._g = (random.random() * 20) + 100
self._b = self._g
self._x = 250
self._y = 750.0... |
def update_R(params, substep, state_history, prev_state, policy_input):
# params = params[0]
# access amt_to_burn using _input['action']['amt_to_burn'] because it's a dict of dicts
R = prev_state['reserve']
S = prev_state['supply']
V = prev_state['invariant_V']
kappa = prev_state['kappa']
... |
from django.test import TestCase
from unittest.mock import patch
from django.contrib.auth import get_user_model
from core import models
def sample_user(email = 'test@example.com',password = 'testpass'):
"""Create a sample user """
return get_user_model().objects.create_user(email,password)
class ModelTests(TestCa... |
# Copyright (c) 2018-present, Facebook, Inc.
# All rights reserved.
#
# This source code is licensed under the license found in the
# LICENSE file in the root directory of this source tree.
#
import argparse
import os
import sys
import zipfile
from glob import glob
from shutil import rmtree
import h5py
import numpy a... |
# -*- coding: utf-8 -*-
# Copyright 2017 ProjectQ-Framework (www.projectq.ch)
#
# 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
#
# ... |
import xpath from 'xpath'
import { DOMParser, XMLSerializer } from 'xmldom'
import { namespaces } from './echoForms/namespaces'
/**
* Update a given spatial field with the give value
* @param {Object} parsedXml Parsed XML document
* @param {String} fieldName Name of spatial field to update
* @param {String} value ... |
"""
:copyright: (c) 2008-2021 Sigasi
:license: BSD, see LICENSE for more details.
"""
# Exit codes:
# 3 : input file not found
import os
import sys
import glob
from .parseFile import parse_dotf
from ..convertDotFtoCsv import rebase_file
class DotFfileParser:
def __init__(self, filename):
self... |
#!/usr/bin/python2.5
#
# Copyright 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
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ... |
"""
This file implement ImageData class which used for resize image effecently
"""
from typing import List
import cv2
class ImageData:
def __init__(self, image, max_size: List[int] = None):
if max_size is None:
max_size = [640, 480]
if len(max_size) == 1:
max_size = [max... |
#ifndef ANIMTITLE_H
#define ANIMTITLE_H
#include <QWidget>
#include <QTimer>
class animTitle : public QWidget
{
Q_OBJECT
public:
explicit animTitle(QWidget *parent = 0);
void update_properties();
protected:
void paintEvent(QPaintEvent *event);
private:
QWidget *myParent;
int _sprite_n;
int _time... |
#!/usr/bin/env python3
"""Redis and Python exercise"""
import uuid
from functools import wraps
from typing import Callable, Union
import redis
def count_calls(method: Callable) -> Callable:
"""decorator that takes a single method Callable argument
and returns a Callable"""
key = method.__qualname__
... |
//##########################################################################
//# #
//# CLOUDCOMPARE #
//# #
//# Thi... |