text
stringlengths
3
1.05M
var normalizeSelector = require('./normalize-selector') module.exports = function(selector) { var rtn if (typeof selector == 'string') { var s = normalizeSelector(selector) var e_id = s.split('.')[0] var p_id = s.split('.')[1] var asset = p_id.split('-')[0] var currency = p_id.split('-')[1] ...
from pymongo import MongoClient client = MongoClient('mongodb://localhost:27017/') db = client['user-profile-info'] def store_profile_into_mongo(info): user_info = db['user-profile'] user_info.insert_one(info) def store_tagged_user_into_mongo(user_post_info): user_post = db['user-tagged-posts'] use...
import argparse import json import zlib from datetime import datetime import torch from pyramid_nested_ner.data.mutli_label_dataset import SigmoidMultiLabelNerDataset as Dataset from pyramid_nested_ner.mutli_label_model import SigmoidMultiLabelPyramid as Pyramid from pyramid_nested_ner.training.multi_label_trainer im...
import requests import json def getHoroscopeApi(sign: str, flag: str): try: r = requests.get(f"http://horoscope-api.herokuapp.com/horoscope/{flag}/{sign}") if r.status_code != 200: return (False, "ERROR: Sorry, we have found an issue with the API we are currently using.") rText ...
from unittest import mock from django.db.utils import OperationalError from django.urls import reverse from rest_framework import status import app.enquiries.tests.utils as test_utils class ServiceHealthCheckTestCase(test_utils.BaseEnquiryTestCase): def setUp(self): super().setUp() def test_service_...
# -*- coding: utf-8 -*- # # This file is part of Invenio. # Copyright (C) 2015-2018 CERN. # # Invenio is free software; you can redistribute it and/or modify it # under the terms of the MIT License; see LICENSE file for more details. """Click command-line interface for PIDStore management.""" from __future__ import a...
import React, { Component } from 'react'; import { BrowserRouter as Router, Route, Link } from "react-router-dom"; import Authors from './containers/Authors'; import Books from './containers/Books'; import './App.css'; class App extends Component { render() { return ( <Router> <...
import React from 'react'; var isFunction = function (obj) { return typeof obj === 'function'; }; var MDXContext = React.createContext({}); var withMDXComponents = function (Component) { return function (props) { var allComponents = useMDXComponents(props.components); return React.createElement( Component, Object...
"""Test the vizier client datastore. This requires the web service API to run and a project with datastores to have been setup. """ from vizier.api.client.datastore.base import DatastoreClient from vizier.api.routes.base import UrlFactory from vizier.api.routes.datastore import DatastoreClientUrlFactory from vizier.da...
""" VOLA Reader. Processes sparse vola files (.vol). Reads in the header information and has a set of functions for extracting the voxel locations and data. @author Jonathan Byrne @copyright 2018 Intel Ltd (see LICENSE file). """ from __future__ import print_function import struct import argparse import os import num...
import sys import time import argparse import threading class testThread( threading.Thread ): def __init__( self, isStart ): threading.Thread.__init__( self ) self.isStart = isStart def run( self ): self.startTime = time.clock_gettime( time.CLOCK_MONOTONIC_RAW ) time.sleep( 0.001 ) self.endTime = time.c...
const Promise = require('../libs/bluebird.core.min') // NoPromise List let noPromiseMethods = { stopRecord: true, pauseVoice: true, stopVoice: true, pauseBackgroundAudio: true, stopBackgroundAudio: true, showNavigationBarLoading: true, hideNavigationBarLoading: true, createAnimation: true, createCon...
/** * Copyright (c) 2014-2015, RongCloud. * All rights reserved. * * All the contents are the copyright of RongCloud Network Technology Co.Ltd. * Unless otherwise credited. http://rongcloud.cn * */ // RCRichContentItem.h // Created by Dulizhao on 15/4/21. #import <Foundation/Foundation.h> /*! 公众服务图文信息条目类 ...
def algebraic_de(piece, pos, capture, pos_or, number): #unicode = {"P": u'\u2659', "p": u'\u265F', "K": u'\u2654', "k": u'\u265A', "Q": u'\u2655', "q":u'\u265B', "N":u'\u2658', "n":u'\u265E', "B":u'\u2657', "b":u'\u265D', "R":u'\u2656', "r":u'\u265C'} ab = "abcdefgh" #return unicode[piece]+"e4" if piece....
define("ace/snippets/stylus",["require","exports","module"],function(e,t,n){"use strict";t.snippetText=undefined,t.scope="stylus"}); (function() { window.require(["ace/snippets/stylus"], function(m) { if (typeof module == "object" && typeof exports == "object" ...
'use strict'; const errorConfig = { missing_client_id: { parameter: 'client_id', code: 'missing', message: 'missing client id' }, invalid_client_id: { parameter: 'client_id', code: 'invalid', message: 'Invalid client id' }, insufficient_airdrop_amount: { parameter: 'amount', c...
//Room: /d/quanzhou/westbridge.c //Date: June. 29 1998 by Java inherit ROOM; void create() { set("short","西门吊桥"); set("long",@LONG 这是泉州西面的一座吊桥,从傍着晋江而建的城楼大门上以两 个滑轮维系。日出放下吊,日落绞起。过了桥向西南走可达岭南广 东。 LONG); set("outdoors", "foshan"); set("exits",([ /* sizeof() == 1 */ "west" : "/d/foshan/road14", ...
from django.test import TestCase, Client from django.contrib.auth import get_user_model from django.urls import reverse class AdminSiteTests(TestCase): def setUp(self): self.client = Client() self.admin_user = get_user_model().objects.create_superuser( email='admin@magicproductions.ai'...
# 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, software # d...
from os.path import dirname, join from city_scrapers_core.constants import COMMISSION, TENTATIVE from city_scrapers_core.utils import file_response from freezegun import freeze_time from city_scrapers.spiders.chi_ssa_32 import ChiSsa32Spider test_response = file_response( join(dirname(__file__), "files", "chi_ss...
# -*- coding: utf-8 -*- """ tests.test_cli ~~~~~~~~~~~~~~ :copyright: (c) 2016 by the Keyes Team, see AUTHORS for more details. :license: BSD, see LICENSE for more details. """ # # This file was part of Keyes-CLI and was modified under the terms its license, # the Revised BSD License. # Copyright (C) 2...
import React from 'react' import Paper from '@material-ui/core/Paper' import { connect } from 'react-redux' import { bindActionCreators } from 'redux' import * as Actions from '@/redux/actions' import { withRouter } from 'react-router-dom' import Typography from '@material-ui/core/Typography' import TextField from '@...
"use strict"; function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj ...
# -*- coding: utf-8 -*- """ Created on Tue Jul 9 11:17:03 2019 @author: Zihao.MAI porting of cool prop gas properties """ __all__ = ["mProp", "flasher"] REFPROP_READY = False from difflib import SequenceMatcher from functools import reduce from json import load as load_json import logging #from o...
import ChartBarTarget24 from "./ChartBarTarget24.svelte"; export default ChartBarTarget24;
;var encode_version = 'sojson.v5', jsnbq = '__0x59fd6', __0x59fd6=['d3bDpcOBV8O0JT40wpbDg8OwLsO5w6pXwoDCoHUq','w5LCrMK/UMOW','WjbChg==','w6XCtF7CkcKp','U8OgC8OsD8OGNxM=','TylIAMKG','wqJkwoDDgSc=','6K616L+q5Yas5a+W56C1','wqx+cMOc','aDBkwppU','fVLDp8ODag==','fMKcaQ==','eQdEYw==','a2vDsMOGTcOOJjo=','NMKVKUPCtA==','wr7Cgz...
/* Native support for SCO OpenServer 5. Copyright 1996, 1998, 2002 Free Software Foundation, Inc. Re-written by J. Kean Johnston <jkj@sco.com>. Originally written by Robert Lipe <robertl@dgii.com>, based on work by Ian Lance Taylor <ian@cygnus.com> and Martin Walker <maw@netcom.com>. This file is p...
from python_schema import field class Address(field.SchemaField): fields = [ field.StrField('postcode'), field.StrField('street'), ] class BusinessAddress(Address): fields = [ field.StrField('letterbox'), ] class Book(field.SchemaField): fields = [ field.StrFiel...
/* * Author: bwilliams * Created: April 6, 2012 * * Copyright (C) 2012-2016 VMware, Inc. All rights reserved. -- VMware Confidential * * This code was generated by the script "build/dev/codeGen/genCppXml". Please * speak to Brian W. before modifying it by hand. * */ #ifndef ProviderCollectInstancesColle...
import matplotlib matplotlib.use('Agg') import numpy as np from scipy.stats import alpha from scipy.stats import pearsonr import pylab as pl import seaborn import sys import json import yaml sys.path.append("code/striatal_model") import params from colors import colors from plot_tools2 import * spikes_fn = sys.argv[1...
import torch.nn as nn # from torchvision.models.utils import load_state_dict_from_url from ..tools.custom_modules import FakeReLUM __all__ = ['AlexNet', 'alexnet'] model_urls = { 'alexnet': 'https://download.pytorch.org/models/alexnet-owt-4df8aa71.pth', } class AlexNet(nn.Module): def __init__(self, num_clas...
from simple_playgrounds.playground import SingleRoom from simple_playgrounds.engine import Engine from simple_playgrounds.element.elements.contact import Candy from simple_playgrounds.common.spawner import Spawner from simple_playgrounds.common.position_utils import CoordinateSampler from simple_playgrounds.agent.contr...
# Copyright 2013-2021 The Salish Sea MEOPAR contributors # and The University of British Columbia # # 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 # # https://www.apache.org/licenses/...
'use strict'; // Game global vars const MINE = '💣'; const MARK = '🚩'; var gBoard; var gLevel = { SIZE: 4, MINES: 2 }; // Timer vars var gIsFirstClick = true; //using it to check if the user started the game to activate the timer. var gIntervalTimer; var gStartTime; var gLastScore; // every clearInterval ch...
import React, { Component } from 'react'; import * as Font from 'expo-font'; import { StyleSheet, ImageBackground } from 'react-native'; import { Container, Content, Card, CardItem, Body, Text, Item, Label, Input, Button } from 'native-base'; export default class Login extends Component { state = { fontLo...
# Copyright 2018 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.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
#! /usr/bin/env python # -*- coding: utf-8 -*- # math2html: convert LaTeX equations to HTML output. # # Copyright (C) 2009-2011 Alex Fernández # # Released under the terms of the `2-Clause BSD license'_, in short: # Copying and distribution of this file, with or without modification, # are permitted in any m...
#! python # # simple LDAP server browsing example # import ldap import string from traceback import print_exc url = "ldap://ldap.openldap.org/" dn = "dc=openldap,dc=org" print "Connecting to", url l = ldap.initialize(url) l.bind_s("", "", ldap.AUTH_SIMPLE); lastdn = dn dnlist = None while 1: #-- read a comm...
/*Program to find Maximumm fo three numbers*/ #include<stdio.h> //Preprocessor Directive int main() { int a,b,c,big; //Initialiation printf("Enter three integers:\n"); //Decalaration scanf("%d%d%d",&a,&b,&c); //Input big=(a>b)?a:b; //Computation big=(big>c)?big:c; p...
/* * nyroModal v2.0.0 * * Image filter * * Depends: * - filters.link * * Before: filters.data */ jQuery(function($, undefined) { $.nmFilters({ image: { is: function(nm) { return (new RegExp(nm.imageRegex, 'i')).test(nm.opener.attr('href')); }, init: function(nm) { nm.loadFilter = 'image'...
from ..factory import Method class checkEmailAddressVerificationCode(Method): code = None # type: "string"
/* * Copyright (c) Facebook, Inc. and its affiliates. * * 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...
/* Copyright (c) 2018 Griefer@Work * * * * This software is provided 'as-is', without any express or implied * * warranty. In no event will the authors be held liable for any damages * ...
/******/ (function(modules) { // webpackBootstrap /******/ // install a JSONP callback for chunk loading /******/ function webpackJsonpCallback(data) { /******/ var chunkIds = data[0]; /******/ var moreModules = data[1]; /******/ var executeModules = data[2]; /******/ /******/ // add "moreModules" to the modu...
import React from 'react'; import { Link as GatsbyLink } from 'gatsby'; // Since DOM elements <a> cannot receive activeClassName // and partiallyActive, destructure the prop here and // pass it only to GatsbyLink export default function Link({ children, to, activeClassName, partiallyActive, ...
class NativeWindow(MarshalByRefObject,IWin32Window): """ Provides a low-level encapsulation of a window handle and a window procedure. NativeWindow() """ def Instance(self): """ This function has been arbitrarily put into the stubs""" return NativeWindow() def AssignHandle(self,handle): """ ...
# # Copyright (C) 2019 Databricks, 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 agreed to i...
# -*- coding: utf-8 -*- """ hpack/hpack ~~~~~~~~~~~ Implements the HPACK header compression algorithm as detailed by the IETF. """ import logging from .table import HeaderTable, table_entry_size from .compat import to_byte, to_bytes from .exceptions import ( HPACKDecodingError, OversizedHeaderListError, InvalidTa...
var html = ''; var red; var green; var blue; var rgbColor; for(let i = 0; i <10; i++) { red = Math.floor(Math.random() * 256 ); green = Math.floor(Math.random() * 256 ); blue = Math.floor(Math.random() * 256 ); rgbColor = 'rgb(' + red + ',' + green + ',' + blue + ')'; html += '<div style="background-color:' + rgbColor...
''' mysql={ 'host':'127.0.0.1', 'user':'root', 'password':'manola1', 'database':'data_representation' } '''
import codecs import locale import re import sys from pip._internal.utils.typing import MYPY_CHECK_RUNNING if MYPY_CHECK_RUNNING: from .typing import List, Tuple, Text BOMS = [ (codecs.BOM_UTF8, 'utf-8'), (codecs.BOM_UTF16, 'utf-16'), (codecs.BOM_UTF16_BE, 'utf-16-be'), (codecs.BOM_UTF16_LE, 'utf...
from Bio.Seq import Seq class CodonAnalyzer: def __init__(self): self.stop_counts = {} # initialize stop_counts dict as empty, it will be filled as needed def count_stop_muts(self, codon): '''Function that takes a single codon as argument (string or Bio Seq object) and returns the number of ...
import React, { Component, PropTypes } from 'react'; import { TouchableOpacity, Text, StyleSheet } from 'react-native' class NextQuoteButton extends Component { render() { return ( <TouchableOpacity style={styles.button} onPress={this.props.onPress}> <Text style={styles.buttonText}>Next Thoug...
""" Exception classes for panzer """ class PanzerError(Exception): """ base class for all panzer exceptions """ pass class SetupError(PanzerError): """ error in the setup phase """ pass class BadASTError(PanzerError): """ malformatted AST encountered (e.g. C or T fields missing) """ pass cla...
import os import click from flask import Flask from catchat.settings import config from catchat.extensions import socketio, db, oauth def create_app(config_name=None): if config_name == None: config_name = os.getenv('FLASK_CONFIG', 'development') app = Flask('catchat') app.config.from_object(c...
from pdb import set_trace as breakpoint class Dog(): def __init__(self, name, age, housebroke): self.name = name self.age = age self.housebroke = housebroke def is_housebroke(self): if self.housebroke == True: print(f'{self.name} is housebroken!') else: ...
var domain = require('domain'); var fs = require('fs'); var path = require('path'); var Mocha = require('mocha'); function MochaWrapper(params) { // If require option is specified then require that file. // This code has been adapted from the treatment of the require // option in the mocha source (bin/_mocha) ...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # # PROGRAMMER: Vittorio Nardone # DATE CREATED: 05/07/2018 # REVISED DATE: <=(Date Revised - if any) # PURPOSE: Train a new deep neural network on a image dataset and save # the model as a checkpoint. # Pre-trained networks are used (VGG/Dens...
from plotly_study.basedatatypes import BaseTraceHierarchyType as _BaseTraceHierarchyType import copy as _copy class Line(_BaseTraceHierarchyType): # color # ----- @property def color(self): """ Sets themarker.linecolor. It accepts either a specific color or an array of numbers...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # Fichier upemtk.py # Bibliothèque graphique simplifiée utilisant le module tkinter # Dérivé de iutk.py, IUT de Champs-sur-Marne, 2013-2014 from tkinter import * from tkinter import font import subprocess import sys # from tkinter import _tkinter from time import * # imp...
import sys import traceback from Qt import QtWidgets, QtCore from openpype import style from openpype.lib import register_event_callback from openpype.pipeline import ( install_openpype_plugins, legacy_io, ) from openpype.tools.utils import ( lib, PlaceholderLineEdit ) from openpype.tools.utils.assets...
## Copyright (c) 2015 SONATA-NFV, 2017 5GTANGO [, ANY ADDITIONAL AFFILIATION] ## 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/licen...
import subprocess import time proc = subprocess.Popen(['ffmpeg', '-f', 'gdigrab', '-framerate', '15', '-offset_x', '0', '-offset_y', '0', '-video_size', '1920x1080', '-i', 'desktop', '-c:v', 'libx264', '-vprofile', 'baseline', '-g', '15', '-crf', '1', '-pix_fmt', 'yuv420p', '-threads', '4', 'output.mp4']) # Start ...
/*! * angular-translate - v2.6.1 - 2015-03-01 * http://github.com/angular-translate/angular-translate * Copyright (c) 2015 ; Licensed MIT */ angular.module('pascalprecht.translate') /** * @ngdoc object * @name pascalprecht.translate.$translateStaticFilesLoader * @requires $q * @requires $http * * @description...
import React, { PropTypes } from 'react'; function Control({ children, className, type, addonPosition }) { let cName = 'control'; if (type == 'group') { cName += ' is-grouped'; } else if (type == 'addons') { cName += ' has-addons'; } if (className) { cName += ` ${className}`; } if (addonPosit...
// It is probably not needed, but it seems that including it into the base window definition may be benefical /* INTERFACE */ function IWindowTemplate() { } IWindowTemplate.Interface("IWindowTemplate"); IWindowTemplate.prototype.$get_windowHtmlTemplate = function () { if (this.$customSystemTemplate !=...
/* * BinTree2.h * * This file is a part of LZMA compression module for NSIS. * * Original LZMA SDK Copyright (C) 1999-2006 Igor Pavlov * Modifications Copyright (C) 2003-2021 Amir Szekely <kichik@netvision.net.il> * * Licensed under the Common Public License version 1.0 (the "License"); * you may not use th...
import fs from 'fs'; import path from 'path'; import zlib from 'zlib'; export function rollupPluginDependencyStats(cb) { let outputDir; let existingFileCache = {}; let statsSummary = { direct: {}, common: {}, }; function buildExistingFileCache(bundle) { for (let fileName of O...
from flask import Blueprint #rc = rediscache.RedisClient(app, conf_key = "default", key_prefix="APIV10") router = Blueprint('jobs', __name__, url_prefix='/jobs') from .views import *
import React from "react"; import svg from "../assets/svg1.svg" function HeroSection(){ return( <main className="position-relative d-flex align-items-center"> <div className="heroContent position-relative d-flex flex-column"> <h1>Seja Bem Vindo! </h1> <p>En...
// 获取弹窗 var modal = document.getElementById('myModal'); // 获取图片插入到弹窗 ,使用 "alt" 属性作为文本部分的内容 var modalImg = document.getElementById("img01"); function click1(link) { modal.style.display = "block"; modalImg.src = link; } function click2() { modal.style.display = "none"; } var i = 0; //var list = ["1.jpg","2...
// WinWin //'use strict'; // elements let menu = document.getElementById("menu"); let game = document.getElementById("game"); let titletop = document.getElementById("titletop"); let titlebottom = document.getElementById("titlebottom"); let overlay = document.getElementById("overlay"); let central = document...
// Copyright 2015 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 IOS_CHROME_BROWSER_SEARCH_ENGINES_TEMPLATE_URL_SERVICE_CLIENT_IMPL_H_ #define IOS_CHROME_BROWSER_SEARCH_ENGINES_TEMPLATE_URL_SERVICE_CLIENT_IMPL_H...
const webpack = require('webpack'); // eslint-disable-line import/no-unresolved const rucksack = require('rucksack-css'); const path = require('path'); const RewriteImportPlugin = require("less-plugin-rewrite-import") const ROOT_DIR = path.resolve(__dirname); const NODE_MODULES_DIR = path.resolve(__dirname, 'node_modu...
from __future__ import print_function import argparse from torch.utils.data import DataLoader from DBPN.solver import DBPNTrainer from DRCN.solver import DRCNTrainer from EDSR.solver import EDSRTrainer from FSRCNN.solver import FSRCNNTrainer from SRCNN.solver import SRCNNTrainer from SRGAN.solver import SRGANTrainer...
// Copyright 2014 PDFium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com #ifndef _BC_EDIFACTENCODER_H_ #define _BC_EDIFACTENCODER_H_ class CBC_EncoderC...
//========= Copyright Valve Corporation, All rights reserved. ============// // // Purpose: Contains a list of files, determines their perforce status // // $NoKeywords: $ //===========================================================================// #ifndef PERFORCEFILELIST_H #define PERFORCEFILELIST_H #i...
"""Tests for the XSRF tool.""" import datetime import unittest import config import utils class XsrfToolTests(unittest.TestCase): """Test cases for utils.XsrfTool.""" TEST_NOW = datetime.datetime(2010, 1, 31, 18, 0, 0) def setUp(self): utils.set_utcnow_for_test(XsrfToolTests.TEST_NOW) def...
#!/usr/bin/env python # -*- coding: utf-8 -*- import logging import os from PIL import Image import click from ximage.utils import mkdirs logger = logging.getLogger(__name__) logger.setLevel(logging.DEBUG) def resize_image(inputimg, width=0, height=0, outputdir='', outputname=''): """ w...
const globby = require('globby') const fs = require('fs') const path = require('path') const ignoreFiles = globby.sync('packages/*/.eslintignore') const ignorePatterns = flatten( flatten( ignoreFiles.map((f) => { const dir = path.dirname(f) return fs .readFileSync(f, 'utf-8') .split(...
var rk = require('rekuire'); var assert = require('assert'); var FileUtils = rk('file_utils.js'); describe('FileUtils', function() { describe('Sync', function() { var utils = new FileUtils('/tmp/test1'); utils.reset(); describe('#makeFolder', function() { utils.makeFolder('test'); it('path s...
/////////////////////////////////////////////////////////////////////////////// // Copyright (c) Electronic Arts Inc. All rights reserved. /////////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////// // Specification //...
// src/network/UrlList.js // const BASE_URL = 'https://wuhan-coronavirus-api.laeyoung.endpoint.ainize.ai/'; const BASE_URL = 'https://master-covid-19-api-laeyoung.endpoint.ainize.ai/'; const API_BASE_URL = BASE_URL + 'jhu-edu'; var UrlList = { /** * Your App's URLs */ Corona: { getBriefUrl: ...
# YOLOv5 image augmentation functions import logging import random import cv2 import math import numpy as np from utils.general import colorstr, segment2box, resample_segments, check_version from utils.metrics import bbox_ioa class Albumentations: """使用Albumentations库增强数据""" # YOLOv5 Albumentations class (...
# pop the current directory from search path # python interpreter adds this to a top level script # but we will likely have a name conflict (runtests.py .vs runtests package) import sys; #sys.path.pop(0) from runtests.mpi import Tester import os tester = Tester(os.path.join(os.path.abspath(__file__)), "Adhesion") tes...
import torch import torch.nn as nn import torch.nn.functional as F import torchvision.models import collections import math import sys import Utils from Utils.CubePad import CustomPad class Unpool(nn.Module): # Unpool: 2*2 unpooling with zero padding def __init__(self, num_channels, stride=2): super(Un...
# coding=utf-8 # pylint: disable-msg=E1101,W0612 import pytz import pytest from datetime import timedelta, datetime from distutils.version import LooseVersion from numpy import nan import numpy as np import pandas as pd from pandas import (Series, DataFrame, isna, date_range, MultiIndex, Index, ...
// Copyright (c) 2019-2020 The Bitcoin Core developers // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. #ifndef XCBC_SIGNET_H #define XCBC_SIGNET_H #include <consensus/params.h> #include <primitives/block.h> #include <primitives...
import ImportUtils import re CONFIGURATION = ImportUtils.get_configuration() plex = ImportUtils.PlexWrapper(CONFIGURATION) reg = re.compile(r"[\|\*\-\~\^\? ]*(.+)") #TODO: integrate with playlist import for playlist in plex.server.playlists(): canonical_title_match = reg.match(playlist.title) canonical_titl...
#!/usr/bin/python # -*- coding: utf-8 -*- # Author: illuz <iilluzen[at]gmail.com> # File: AC_one_line_n.py # Create Date: 2015-03-16 10:42:01 # Usage: AC_one_line_n.py # Descripton: class Solution: # @param n, an integer # @return an integer def reverseBits(self, n): return int...
/* TEMPLATE GENERATED TESTCASE FILE Filename: CWE126_Buffer_Overread__char_declare_loop_09.c Label Definition File: CWE126_Buffer_Overread.stack.label.xml Template File: sources-sink-09.tmpl.c */ /* * @description * CWE: 126 Buffer Over-read * BadSource: Set data pointer to a small buffer * GoodSource: Se...
# Defines the preprocessor macro MINIGO_BOARD_SIZE=9 for all minigo_cc_* # build targets when bazel build is invoked with --define=board_size=9. # Defines the preprocessor macro MINIGO_BOARD_SIZE=19 for all minigo_cc_* # build targets when bazel build is invoked with --define=board_size=19. def _board_size_copts(): r...
# 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 (the # "License"); you may not u...
'use strict' const Env = use('Env') const stripe = require('stripe')(Env.get('STRIPE_ID')) class StripeController { async index ({ view }) { return view.render('api.stripe', { publishableKey: Env.get('STRIPE_ID') }) } async postStripe ({ request, response, session }) { const stripeData = request.only([...
import random import re from locustio.jira.requests_params import Login, BrowseIssue, CreateIssue, SearchJql, ViewBoard, BrowseBoards, \ BrowseProjects, AddComment, ViewDashboard, EditIssue, ViewProjectSummary, jira_datasets from locustio.common_utils import jira_measure, fetch_by_re, timestamp_int, generate_random...
# -*- coding: utf-8 -*- """ @author:XuMing(xuming624@qq.com) @description: """ import torch import torch.nn as nn import torch.nn.functional as F from torchvision import models def double_conv(in_channels, out_channels): return nn.Sequential( nn.Conv2d(in_channels, out_channels, 3, padding=1), nn...
from typing import Dict import torch import torch.nn as nn urls: Dict[str, str] = dict() urls["lib"] = "https://github.com/yuruntian/SOSNet/raw/master/sosnet-weights/sosnet_32x32_liberty.pth" urls["hp_a"] = "https://github.com/yuruntian/SOSNet/raw/master/sosnet-weights/sosnet_32x32_hpatches_a.pth" class SOSNet(nn.M...
from pathlib import Path from typing import List from blspy import AugSchemeMPL from ceres.util.ints import uint32 from ceres.util.keychain import Keychain from ceres.util.validate_alert import create_alert_file, create_not_ready_alert_file, validate_alert_file bitcoin_hash = None bram_message = None status = None ...
import functools import pytest from girder.models.setting import Setting from girder.settings import SettingKey from isic_archive.models.user import User from isic_archive.provision_utility import provisionDatabase @pytest.fixture def provisionedServer(server): provisionDatabase() # When the Girder app is ...
# -*- coding: utf-8 -*- # File: conftest.py # Copyright 2021 Dr. Janis Meyer. 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/LICE...