text stringlengths 3 1.05M |
|---|
/* ***** BEGIN LICENSE BLOCK *****
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Mozilla Public License Version
* 1.1 (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
* http://www.mozilla.org/MPL/
*
... |
import npcl
from npcl import to_device
import numpy as np
import cv2
from time import time
convolve = npcl.ops.convolve.convolve2d
img = cv2.imread('lake.tif', 0)/255
img = to_device(img)
# 5 x 5 box kernel
kernel = np.ones((7, 7))/49.
kernel = to_device(kernel)
blurry = convolve(img, kernel)
x_0 = to_device(np.zer... |
# encoding: utf-8
# module PySide.QtNetwork
# from C:\Python27\lib\site-packages\PySide\QtNetwork.pyd
# by generator 1.147
# no doc
# imports
import PySide.QtCore as __PySide_QtCore
import Shiboken as __Shiboken
class QSslCertificate(__Shiboken.Object):
# no doc
def alternateSubjectNames(self, *args, **kwarg... |
from pathlib import Path
import os
import sys
path = os.fspath((Path(__file__).parent.parent / 'src').resolve())
if path not in sys.path:
sys.path.append(path)
from typing import Tuple
import unittest
from handlerchief.i_middleware_handler import IMiddlewareHandler
class SumHandler(IMiddlewareHandler):
def _c... |
import { prompt } from 'inquirer'
import { base } from './promptInputs'
import handleAnswers from './handleAnswers'
prompt(base).then(handleAnswers)
|
import random
import re
import string
import datetime
from streamlink.plugin import Plugin, PluginError, PluginOptions
from streamlink.plugin.api import http, validate
from streamlink.stream import HLSStream
API_URL = "https://api.crunchyroll.com/{0}.0.json"
API_DEFAULT_LOCALE = "en_US"
API_USER_AGENT = "Mozilla/5.0 ... |
/*!
* / ' / /
* /__ ___ ( /
* \--`-'-|`---\ |
* |' _/ ` __/ /
* '._ W ,--'
* |_:_._/
*
* ~~~~~~~~~~ rx4d v1.3.0
*
* @commit 73c89892ad
* @moment Saturday, May 16, 2020 6:24 PM
* @homepage https://github.com/adriancmiranda/... |
# -*- coding: utf-8 -*-
from typing import Dict, NoReturn, Union
import uuid
from uuid import UUID
from chaosplt_relational_storage.db import Base
from flask_dance.consumer.backend.sqla import OAuthConsumerMixin
from sqlalchemy import Boolean, Column, DateTime, String, \
UniqueConstraint, func
from sqlalchemy.orm.... |
import React from 'react';
import MainBg from '../../assets/img/main-bg.jpg';
function Main() {
return (
<>
<img
style={{
marginTop: '50px',
marginLeft: '15%',
borderRadius: '10px',
height: '700px',
width: '70%',
}}
src={MainBg}
... |
#!/usr/bin/env python
import numpy as np
import rospy
from geometry_msgs.msg import PoseStamped
from styx_msgs.msg import Lane, Waypoint
from scipy.spatial import KDTree
import math
from std_msgs.msg import Int32
'''
This node will publish waypoints from the car's current position to some `x` distance ahead.
Please... |
from amazon_scraper_by_outscraper.client import *
|
// ScriptStack.h
//
// runtimeCPP
#pragma once
#include <stack>
#include "SCRIPT.H"
using std::unique_ptr;
using std::make_unique;
using std::stack;
class ScriptStack
{
public:
static Script * OpenScript()
{
m_stack.push(make_unique<Script>());
return GetScript();
}
static Script* G... |
it("should result in a warning when using module.exports in harmony module", function() {
var x = require("./wrong-module");
x.should.be.eql(1234);
var y = require("./correct-module");
y.should.have.property("default").be.type("function");
});
|
import React, {Component} from 'react';
import Button from '@material-ui/core/Button';
import "../App.css";
import SimpleSnackbar , {openSnackbar} from "../Components/SnackBar";
import {setToken} from "../Actions/auth-actions";
import { connect } from 'react-redux';
import {clearLocalToken} from "../Services/authOperat... |
import logging
import numpy as np
import rasterio
from ruamel_yaml import YAML
from tqdm import tqdm
from pathlib import Path
from skimage import morphology
from utils.geoutils import vector_to_raster, clip_raster_with_gpkg
logger = logging.getLogger(__name__)
def read_parameters(param_file):
"""Read and retur... |
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft and contributors. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of ... |
import Vue from 'vue'
import App from './App.vue'
import { library } from '@fortawesome/fontawesome-svg-core'
import { faEnvelope, faCode, faLink } from '@fortawesome/free-solid-svg-icons'
import { faLinkedin, faGithub, faAngular, faVuejs, faNode, faLaravel, faDocker, faYoutube, faReact, faAndroid, faApple, faGitlab} ... |
# Copyright 2021 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 in writing, s... |
# -*- coding: utf-8 -*-
# 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... |
import logging
import asab
#
L = logging.getLogger(__name__)
#
class ServiceSample(asab.Service):
def __init__(self, app, service_name):
super().__init__(app, service_name)
app.PubSub.subscribe_all(self)
self.value = asab.Config["module_sample"]["example"]
self.counter = 0
async def initialize(self,... |
// Copyright 2014 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef CHROME_BROWSER_METRICS_EXTENSIONS_METRICS_PROVIDER_H_
#define CHROME_BROWSER_METRICS_EXTENSIONS_METRICS_PROVIDER_H_
#include <stdint.h>
#include... |
"""ECOR 1051 - Milestone 3
Group: L5_6
Date of Submission: Dec 1, 2019
Authors: Siddharth Natamai - 101143016
Leanne Matamoros - 101147405
Malak Abdou - 101139692
Nathan Gomes - 101143780
Version: 1.0.0
"""
from Cimpl import load_image, choose_file, save_as, show
from L5_6_image_filters impor... |
const Discord = require('discord.js')
module.exports = async (client, oldUser, newUser) => {
let logMessage = new Discord.RichEmbed()
.setAuthor(`${oldUser.tag}`, newUser.displayAvatarURL)
.setColor(0xFAA61A)
.setTimestamp()
.setDescription(`${newUser} just updated their discord tag. Let them... |
function add(a, b) {
for (var i = 0; i < 10000000; i++) {}
return a + b
}
var addCache = cache.pureFuncMemoryCache(add)
function testPureFuncMemoryCache() {
document.getElementById('pureFmRst01').innerText = ''
document.getElementById('pureFmTime01').innerText = ''
document.getElementById('pureF... |
# encoding=utf-8
import sys
sys.path.insert(0, '.')
sys.path.append('/users/maqiao/DNN/caffes/caffe_mq/python')
# sys.path.append('/mnt/diskb/even/MCMOT/src')
# from lib.models.model import create_model, load_model
sys.path.append('/mnt/diskb/even/YOLOV4')
sys.path.append('.')
import re
from functools import cmp_to_k... |
file_in = open('zad_input.txt', 'r').read().splitlines()
file_in[0] = file_in[0].split(' ')
l = int(file_in[0][0])
u = int(file_in[0][1])
help_l = []
help_u = []
for i in range(1,l+1):
numbers = []
file_in[i] = file_in[i].split(' ')
for word in file_in[i]:
numbers.append(int(word))
... |
# 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 applic... |
import React from "react";
import Faq from "react-faq-component";
import '../../../sass/faq/faq.scss';
import { Link } from 'react-router-dom';
const data = {
title: <h1 className="faqTitle">FAQ</h1>,
rows: [
{
title: <b>What does Phopixel mean?</b>,
content: `Phopixel (pronounc... |
import os
# toolchains options
ARCH='arm'
CPU='cortex-m4'
CROSS_TOOL='gcc'
# bsp lib config
BSP_LIBRARY_TYPE = None
if os.getenv('RTT_CC'):
CROSS_TOOL = os.getenv('RTT_CC')
if os.getenv('RTT_ROOT'):
RTT_ROOT = os.getenv('RTT_ROOT')
# cross_tool provides the cross compiler
# EXEC_PATH is the compiler execute... |
# coding=utf-8
# *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union, overload
from . import ... |
/****************************************************************************
Copyright (c) 2013-2014 Chukong Technologies Inc.
http://www.cocos2d-x.org
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 ... |
# coding: utf-8
# # 使用预训练的VGG模型Fine-tune CNN
# In[1]:
# Import packs
import numpy as np
import os
import scipy.io
from scipy.misc import imread, imresize
import matplotlib.pyplot as plt
import skimage.io
import skimage.transform
import tensorflow as tf
get_ipython().magic(u'matplotlib inline')
cwd = os.getcwd()
pri... |
!function(e){function c(c){for(var b,r,t=c[0],n=c[1],o=c[2],u=0,l=[];u<t.length;u++)r=t[u],Object.prototype.hasOwnProperty.call(d,r)&&d[r]&&l.push(d[r][0]),d[r]=0;for(b in n)Object.prototype.hasOwnProperty.call(n,b)&&(e[b]=n[b]);for(i&&i(c);l.length;)l.shift()();return f.push.apply(f,o||[]),a()}function a(){for(var e,c... |
'use strict';
/**
* Controller for list ion-item
* - Shows popup dialog when user swipes to delete
**/
angular.module('todo-app.lists.list-item')
.controller('ListItemController', ListItemController);
ListItemController.$inject = ['TodoLists', '$ionicPopup'];
function ListItemController (TodoLists, $ionicPopup... |
from setuptools import setup, find_packages
VERSION = '0.1.1'
setup(
name='docker-run-build',
version=VERSION,
description="Incrementally build Docker images",
author="Caio Ariede",
author_email="caio.ariede@gmail.com",
url="http://github.com/caioariede/docker-run-build",
license="MIT",
... |
"""Function helpers.
"""
import numpy as np
from astropy.coordinates import matrix_utilities
from astropy.time import Time
def circular_velocity(k, a):
"""Compute circular velocity for a given body (k) and semimajor axis (a).
"""
return np.sqrt(k / a)
def rotate(vector, angle, axis='z', unit=None):
... |
#!/usr/bin/python
from __future__ import print_function
import keras
from keras.models import Sequential
from keras.models import Model
from keras.layers import Input
from keras.layers import Dense
from keras.layers import LSTM
from keras.layers import GRU
from keras.layers import SimpleRNN
from keras.layers import D... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
from abc import ABC, abstractmethod
import numpy as np
class EventDataProcessor(ABC):
@abstractmethod
def process(self, data: np.array, **kwargs) -> np.array:
pass
|
# Configuracion de la app Services para el dashboard
from django.contrib import admin
from .models import Category, Post
class CategoryAdmin(admin.ModelAdmin):
# Convierte los campos de fecha en formato de solo lectura
readonly_fields = ('created', 'updated',)
class PostAdmin(admin.ModelAdmin):
# Conviert... |
import re
import logging
from io import BytesIO
from .cmapdb import CMapDB
from .cmapdb import CMap
from .psparser import PSTypeError
from .psparser import PSEOF
from .psparser import PSKeyword
from .psparser import literal_name
from .psparser import keyword_name
from .psparser import PSStackParser
from .psparser impo... |
#-----------------------------------------------------------------------------
# Copyright (c) 2005-2016, PyInstaller Development Team.
#
# Distributed under the terms of the GNU General Public License with exception
# for distributing bootloader.
#
# The full license is in the file COPYING.txt, distributed with this s... |
/*
Copyright (c) 2003-2011, CKSource - Frederico Knabben. All rights reserved.
For licensing, see LICENSE.html or http://ckeditor.com/license
*/
CKEDITOR.lang.gl={dir:'ltr',editorTitle:'Rich text editor, %1, press ALT 0 for help.',toolbar:'Toolbar',editor:'Rich Text Editor',source:'Código Fonte',newPage:'Nova Páxina'... |
/*
* The MIT License (MIT)
*
* Copyright (c) 2015-2017 GDB ImageWatch contributors
* (github.com/csantosbh/gdb-imagewatch/)
*
* 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 r... |
import React from "react"
import { AnchorLink } from "gatsby-plugin-anchor-links"
import { BsBoxArrowInDown } from "react-icons/bs"
import PCTAForm from "./PrimaryCTAForm"
import Coverv1n0 from "./v1n0_cover"
import Mug from "./mug"
const ReaderMagnet = props => (
<section
className="container mx-auto mt-8 px-... |
const Employee = require('./Employee');
class Intern extends Employee {
constructor(name = '', id = '', email = '', school = '') {
super(name, id, email);
this.school = school;
}
getSchool() {
return `${this.school}`;
}
}
module.ex... |
#ifndef BLACKBOARD_H_INCLUDED
#define BLACKBOARD_H_INCLUDED
#include <stdint.h>
#ifdef __cplusplus
extern "C" {
#endif
// This is a "glorified" global variable...but all kept in a blackboard
typedef struct _BLACKBOARD_s
{
uint8_t allSystemsGo;
uint8_t cdcOnline;
} BLACKBOARD;
extern BLACKBOARD theBlackbo... |
import renderModal from './modal-dynamic.hbs';
import { setFocusToFirstItem, trapTabKey } from '../../js/utils';
let contentWrapper;
let bodyChildren;
let originalContent = {};
let modalElement;
let mediaQueryList;
let focusedElementBeforeModal;
const globalVariables = {
rootPath: (
window.location.pathname === ... |
"""Plugwise Climate component for Home Assistant."""
from __future__ import annotations
from collections.abc import Mapping
from typing import Any
from homeassistant.components.climate import ClimateEntity
from homeassistant.components.climate.const import (
CURRENT_HVAC_COOL,
CURRENT_HVAC_HEAT,
CURRENT_H... |
import bpy
# オブジェクトを拡大するオペレーション
class EnlargeObject(bpy.types.Operator):
bl_idname = "object.enlarge_object"
bl_label = "選択オブジェクトの拡大"
bl_description = "選択中のオブジェクトを拡大します"
bl_options = {'REGISTER', 'UNDO'}
# メニューを実行した時に呼ばれる関数
def execute(self, context):
active_obj = context.active_obje... |
const merge = require("webpack-merge");
const MiniCssExtractPlugin = require("mini-css-extract-plugin");
const TerserPlugin = require("terser-webpack-plugin");
const common = require("./webpack.common.js");
module.exports = merge(common, {
mode: "production",
devtool: "source-map",
optimization: {
minimize: ... |
import Component from '@glimmer/component';
import {
IMAGE_EXTENSIONS,
IMAGE_MIME_TYPES
} from 'ghost-admin/components/gh-image-uploader';
import {action} from '@ember/object';
import {inject as service} from '@ember/service';
import {tracked} from '@glimmer/tracking';
export default class PublicationCoverForm... |
'''
This defines a Lakehouse with local storage and Pandas data processing.
Data is locally stored in csv files.
Pandas is used for data processing. Data can be read from CSV files into a
pandas dataframe, and exported back into pandas dataframes.
'''
import os
from typing import Tuple
import pandas as pd
from lake... |
"use strict";
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Refl... |
import Vue from 'vue'
import Router from 'vue-router'
// in development-env not use lazy-loading, because lazy-loading too many pages will cause webpack hot update too slow. so only in production use lazy-loading;
// detail: https://panjiachen.github.io/vue-element-admin-site/#/lazy-loading
Vue.use(Router)
/* Layout... |
APP = Flask(__name__)
@APP.route('/')
def hello_world():
return 'Hello, World from Flask!\n'
if __name__ == '__main__':
APP.run(host='0.0.0.0', port=8080, debug=True)
|
/*!
* UI development toolkit for HTML5 (OpenUI5)
* (c) Copyright 2009-2017 SAP SE or an SAP affiliate company.
* Licensed under the Apache License, Version 2.0 - see LICENSE.txt.
*/
sap.ui.define(['./ListItemBaseRenderer', 'sap/m/library', 'sap/ui/Device'],
function(ListItemBaseRenderer, library, Device) {
"use ... |
/*
ToDo:
Get rid of the checker (and also the converters) field in PyCFuncPtrObject and
StgDictObject, and replace them by slot functions in StgDictObject.
think about a buffer-like object (memory? bytes?)
Should POINTER(c_char) and POINTER(c_wchar) have a .value property?
What about c_char and c_wchar a... |
'use strict'
const utils = require('./utils')
const config = require('../config')
const path = require('path')
const isProduction = process.env.NODE_ENV === 'production'
const sourceMapEnabled = isProduction
? config.build.productionSourceMap
: config.dev.cssSourceMap
module.exports = {
loaders: utils.cssLoaders... |
# -*- coding: utf-8 -*-
# @Time : 2021/7/25 13:28
# @Author : lovemefan
# @Email : lovemefan@outlook.com
# @File : BertForVi.py
import torch
from transformers import AutoModel, AutoTokenizer
from examples.bert.BertBase import BertBase
from tzrpc.decorator.singleton import singleton
@singleton
class BertForVietname... |
// TODO Add a couple lines about each project
const data = [
{
title: 'MIPS Processor',
subtitle: 'CS 2322 Trials',
image: '/images/projects/circuit.jpg',
date: '2022-05-10',
desc:
'Designed and implemented a single-cycle MIPS processor in its entirety as a final project for EECE 2322. Compl... |
"""Emoji
Available Commands:
.deploy"""
from telethon import events
import asyncio
from uniborg.util import admin_cmd
from userbot import AUTONAME
DEFAULTUSER = str(AUTONAME) if AUTONAME else "FRIDAY"
@borg.on(admin_cmd(pattern=r"deploy"))
async def _(event):
if event.fwd_from:
return
anima... |
# -*- coding: utf-8 -*-
import types
class StrategyExample:
def __init__(self, func=None):
self.name = 'Strategy Example 0'
if func is not None:
self.execute = types.MethodType(func, self)
def execute(self):
print(self.name)
def execute_replacement1(self):
print(se... |
//
// UIScrollView+CCNest.h
// Pods
//
// Created by lucc on 2022/2/27.
//
// UIScrollView 相互嵌套方案
#import <UIKit/UIKit.h>
/// 嵌套方案中的角色
typedef NS_ENUM(NSUInteger, CCNestScrollRole) {
CCNestScrollRoleNone, //无
CCNestScrollRoleChild, //子scrollview
CCNestScrollRoleFather, //父scrollview
};
NS_ASSUM... |
# Copyright (c) 2018 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 app... |
require("dotenv").config();
const fs = require("fs");
const path = require("path");
const got = require("got");
const { CLIENT_ID, CLIENT_SECRET } = process.env;
let auth;
exports.initAuth = async () => {
try {
auth = require("../auth.json");
// Verify that the token is still valid
await got("https://o... |
$(document).ready(function() {
$("#check_adminLogin").click(function(){
var usr_name = $("#login-username").val();
var password = $("#login-password").val();
var token=$('input[name=_token]').val();
$.ajax({
url:"check/Login",
type:"POST",
data:{'usr_name':usr_name,'password':password,'_token':token... |
import json
import uuid
import struct
from Ifc.ClassRegistry import create_entity
from Ifc.IfcBase import Omitted, Reference, EnumValue, omitted
class StatementFileReader:
"""
Base class for those who process the input as series of semicolon-delimited statements
"""
def __init__(self, comment_open="/... |
import React from 'react';
import { render } from 'react-dom';
import App from './Components/App';
render(
<App />,
document.getElementById('root')
);
|
import React from 'react'
import {
CCard,
CCardBody,
CCardGroup,
CCardHeader
} from '@coreui/react'
import {
CChartPie
} from '@coreui/react-chartjs'
const Charts_Pie = () => {
return (
<CCardGroup columns className = "card-columns card mb-1" >
<CCard>
<CCardHeader>
Pie Chart
... |
export const NoEffect = /* */ 0b000000000000 |
import firebase from "firebase/app";
import "firebase/auth";
import "firebase/database";
import "firebase/storage";
var config = {
// Your Firebase Config Here
};
firebase.initializeApp(config);
export default firebase;
|
/**
* Product.js
*
* @description :: A model definition represents a database table/collection.
* @docs :: https://sailsjs.com/docs/concepts/models-and-orm/models
*/
module.exports = {
tableName:'products',
attributes: {
//Name'll be concatenation from the others fields. That combination will desc... |
#!/usr/bin/env python
"""
update_dreqs_0083.py
This file creates data requests for the second EC-Earth contribution to WP5.
"""
from __future__ import (unicode_literals, division, absolute_import,
print_function)
import argparse
from datetime import datetime
import logging.config
import sys
fr... |
# ActivitySim
# See full license in LICENSE.txt.
import os
import logging
import pandas as pd
import numpy as np
import orca
from activitysim.core import tracing
from activitysim.core import config
from activitysim.core import pipeline
from activitysim.core import simulate
from activitysim.core.interaction_sample_s... |
#
# Copyright (c) 2014-2017 Wind River Systems, Inc.
#
# SPDX-License-Identifier: Apache-2.0
#
"""
Scheduler filter "AggregateProviderNetworkFilter", host_passes() returns True
when the host is a member of host-aggregate with metadata key
provider:physical_network and contains a superset of physical network values
requ... |
// | / |
// ' / __| _` | __| _ \ __|
// . \ | ( | | ( |\__ `
// _|\_\_| \__,_|\__|\___/ ____/
// Multi-Physics
//
// License: BSD License
// Kratos default license: kratos/license.txt
//
// Main authors: Carlos Roig
//
// System incl... |
#!/usr/bin/env python
from setuptools import setup, Command, find_packages
with open('requirements.txt') as f:
required = f.read().splitlines()
setup(name='unityagents',
version='0.3.0',
description='Unity Machine Learning Agents',
license='Apache License 2.0',
author='Unity Technologies... |
# coding: utf-8
import pprint
import re
import six
from huaweicloudsdkcore.sdk_response import SdkResponse
class ListAddonInstancesResponse(SdkResponse):
"""
Attributes:
openapi_types (dict): The key is attribute name
and the value is attribute type.
attribute_map... |
import re
from concurrent.futures import Future
from dataclasses import dataclass
from typing import Optional, List, Dict, Any, Union, Iterable
import agate
from dbt.contracts.relation import RelationType
import dbt
import dbt.exceptions
from dbt.adapters.base import AdapterConfig
from dbt.adapters.base.impl import c... |
line = input()
current_result = ''
result = ''
index = 0
while index < len(line):
if not line[index].isdigit():
current_result += line[index]
index += 1
else:
number = ''
while index < len(line) and line[index].isdigit():
number += line[index]
index += 1
... |
import os,time,cv2,numpy
from functools import reduce,wraps
from fgoControl import control
from fgoFuse import fuse
from fgoLogging import getLogger,logMeta
logger=getLogger('Check')
IMG=type('IMG',(),{i[:-4].upper():cv2.imread(f'fgoImage/{i}')for i in os.listdir('fgoImage')if i[-4:]=='.png'})
class Check(metaclass=log... |
# -*- coding: utf-8 -*-
# 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... |
'''
Description: Exercise 25 (numeric array)
Version: 1.0.0.20210118
Author: Arvin Zhao
Date: 2021-01-18 16:08:00
Last Editors: Arvin Zhao
LastEditTime: 2021-01-18 18:14:47
'''
from array import array
num_array = array('f', [10.24, 66.66, 23.33, 99.99, 13.14])
while True:
num = int(input('Enter a number between... |
import numpy as np
from keras.models import Model
# from keras import backend as K
from keras.callbacks import ModelCheckpoint
# import tensorflow as tf
from tensorflow.compat.v1.keras import backend as K
import tensorflow.compat.v1 as tf
class NetworkManager:
'''
Helper class to manage the generation of subn... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from django.db import models
from django.utils.translation import ugettext_lazy as _
from django.core.exceptions import ValidationError
from django.conf import settings
from mptt.models import MPTTModel, TreeForeignKey
from mptt.managers import TreeManager
from opps.core.... |
# coding:utf-8
import torch
import numpy as np
import json
import opennre
from opennre import encoder, model, framework
import sys
import os
import argparse
import logging
import random
def set_seed(seed):
random.seed(seed)
np.random.seed(seed)
torch.manual_seed(seed)
torch.cuda.manual_seed_all(seed)
... |
from mysql import connector
class MySQLFactory:
@classmethod
def init(cls, host, user, password, database):
cls.host = host
cls.user = user
cls.password = password
cls.database = database
cls.connection = None
@classmethod
def get(cls):
"""Get a con... |
/* Set your postcss-loader configuration here */
module.exports = {
plugins: [require('precss'), require('autoprefixer')]
};
|
export { default as P } from './P/P'
export { default as Loader } from './Loader/Loader'
export { default as LiveSpan } from './LiveSpan/LiveSpan'
|
/**-------------------------------------------------------------------------
@file pwrmgnt.h
@brief Generic power management definition
This file contains generic definitions to implement power management drivers
such as a PMIC chip or MCU builtin power management
@author Hoang Nguyen Hoan
@date July 25, 2019
@lice... |
from django.core.exceptions import PermissionDenied
from django.utils.translation import gettext_lazy
class ProtectedModelMixin:
"""
Add checks to update and delete methods of an instance.
The use case is to protect against changes when update or delete is allowed for a user (superuser, admin or
othe... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Licensed under the GNU LGPL v2.1 - http://www.gnu.org/licenses/lgpl.html
import math
from six import iteritems
from six.moves import xrange
# BM25 parameters.
PARAM_K1 = 1.5
PARAM_B = 0.75
EPSILON = 0.25
class BM25(object):
def __init__(self, corpus):
... |
from dataclasses import dataclass, field
from enum import Enum
from typing import Optional
class FooType(Enum):
CA = "CA"
OR = "OR"
@dataclass
class FooTest:
class Meta:
name = "fooTest"
value: Optional[FooType] = field(
default=None,
metadata={
"required": True,... |
from .. import config
from .. import fixtures
from ..assertions import eq_
from ..assertions import in_
from ..schema import Column
from ..schema import Table
from ... import bindparam
from ... import case
from ... import Computed
from ... import false
from ... import func
from ... import Integer
from ... import litera... |
import React from "react"
import styled from "styled-components"
import cabinBackground from "../images/ferry-body.png"
const Container = styled.div`
@keyframes set-sail {
0% {
transform: translateX(calc(-50vw - 60%));
}
90% {
transform: translateX(calc(50vw - 230px));
}
100% {
... |
var crypto = require('crypto');
var constants = require('constants');
var schemes = require('../schemes/schemes.js');
module.exports = function (keyPair, options) {
var pkcs1Scheme = schemes.pkcs1.makeScheme(keyPair, options);
return {
encrypt: function (buffer, usePrivate) {
var ... |
# -*- coding: utf-8 -*-
# Resource object code
#
# Created: 周六 12月 3 14:26:39 2016
# by: The Resource Compiler for PyQt (Qt v5.4.0)
#
# WARNING! All changes made in this file will be lost!
from PyQt5 import QtCore
qt_resource_data = b"\
\x00\x00\x02\xb3\
\x89\
\x50\x4e\x47\x0d\x0a\x1a\x0a\x00\x00\x00\x0d\x49\x4... |
const mysql = require('mysql');
const inquirer = require('inquirer');
// Connect to database
const connection = mysql.createConnection({
host: 'localhost',
port: 3306,
user: 'root',
password: 'rootroot',
database: 'employee_db',
});
connection.connect((err => {
if (err) throw err;
consol... |
# Copyright 2013-present Barefoot Networks, 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 agre... |
from .nbsetuptools import setup, find_static
|