text
stringlengths
2
999k
import io import unittest from contextlib import redirect_stdout from unittest.mock import patch class TestQ(unittest.TestCase): @patch('builtins.input', side_effect=[ '9', '29', '7', '27', ]) def test_case_0(self, input_mock=None): text_trap = io.StringIO() ...
# This prints out "Hello, John!" name = 'John' print('Hello, %s!' % name) # This prints out "John is 23 years old." name = 'John' age = 23 print('%s is %d years old.' % (name, age)) # This prints out: A list: [1, 2, 3] mylist = [1, 2, 3] print('A list: %s' % mylist) data = ('John', 'Doe', 53.44) format_string = 'He...
import mmm import numpy as np import pdb import math from scipy import fftpack from scipy import interpolate from scipy import integrate from scipy import special from jlu.util import radialProfile import pylab as py from matplotlib import nxutils from jlu.util import mpfit import time Fvalues = {'wide': 139.9, 'narro...
# encoding: utf-8 """ @author: sherlock @contact: sherlockliao01@gmail.com """ import glob import re import os.path as osp from .bases import BaseImageDataset class Market1501(BaseImageDataset): """ Market1501 Reference: Zheng et al. Scalable Person Re-identification: A Benchmark. ICCV 2015. U...
import datetime from flask import Flask from flask_cors import CORS from .config.default import DefaultConfig from .views import register_blueprints from .cache import cache from .models import db __version__ = '1.0' __status__ = 'dev' __description__ = 'Your project description' __github__ = 'Your Git address' __l...
# 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 use ...
#----------------------------------------------------------------------------- # Copyright (c) 2012 - 2021, Anaconda, Inc., and Bokeh Contributors. # All rights reserved. # # The full license is in the file LICENSE.txt, distributed with this software. #-------------------------------------------------------------------...
""" This script generates a function for each supported platform, which maps the underlying platform's native keycodes to fundament's keycodes. The mappings are based of this online spreadsheet: https://docs.google.com/spreadsheets/d/1VPQTYbJqPITDeBr0M5-fUwX6cvYu9hFFXQVaXtD9sN0/edit?usp=sharing Note, that this tool d...
#!/usr/bin/python3 # -*- coding: utf-8 -*- import argparse import re def arguments(): # Handle command line arguments parser = argparse.ArgumentParser(description='Adventofcode.') parser.add_argument('-f', '--file', required=True) args = parser.parse_args() return args def group_ints(times, in...
""" Vaccines blueprint views """ import time from flask import render_template from flask_babel import gettext from app.data_tools import ( get_latest_vax_update, get_perc_pop_vax, enrich_frontend_data, get_admins_perc, get_vax_trends, get_area_population ) from app.ui import vaccines from settings import PAG...
# -*- encoding: utf-8 -*- # written in python 2.7 __author__ = 'garzon' import hashlib, json, rsa, uuid, os from flask import Flask, session, redirect, url_for, escape, request app = Flask(__name__) app.secret_key = '*********************' url_prefix = '/b942f830cf97e' def FLAG(): return 'Here is your flag: DDCT...
import json import os import random import matplotlib.pyplot as plt import util import shutil import matplotlib matplotlib.use('Agg') random.seed(2021) img_huidu =util.read_image(path='./svg-png-gray/') img_back = util.read_image(path='./background/') def obre(path,p,json_data_list,back=False): result_json_path...
#!/usr/bin/env python3 # Copyright (c) 2019 The Bitcoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. from test_framework.test_framework import BitcoinTestFramework class TestShell: """Wrapper Class for Bitc...
# 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...
# -*- coding: utf-8 -*- import configparser # Define your item pipelines here # # Don't forget to add your pipeline to the ITEM_PIPELINES setting # See: http://doc.scrapy.org/en/latest/topics/item-pipeline.html import json from os import sep as ossep import pymysql try: import sina_spider.utils.Database as Util...
class _Getch: """Gets a single character from standard input. Does not echo to the screen.""" def __init__(self): try: self.impl = _GetchWindows() except ImportError: self.impl = _GetchUnix() def __call__(self): return self.impl() class _GetchUnix: def __init...
import os import sys from RLTest import Env from redisgraph import Graph GRAPH_ID = "point" redis_graph = None class testPath(): def __init__(self): self.env = Env(decodeResponses=True) global redis_graph redis_con = self.env.getConnection() redis_graph = Graph(GRAPH_ID, redis_con)...
# Copyright 2019 EPFL, 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 wri...
import sys import os # Use absolute path instead of relative path ('./') to avoid trouble when installed by pip dir_path = os.path.dirname(os.path.realpath(__file__)) # the current directory dir_path_test = os.path.join(dir_path,'test') print(dir_path) UI_path = dir_path + '/GUI/' import time #########################...
# -*- coding: utf-8 -*- { '!langcode!': 'he-il', '!langname!': 'עברית', '"update" is an optional expression like "field1=\'newvalue\'". You cannot update or delete the results of a JOIN': '"עדכן" הוא ביטוי אופציונאלי, כגון "field1=newvalue". אינך יוכל להשתמש בjoin, בעת שימוש ב"עדכן" או "מחק".', '%Y-%m-%d': '%Y-%m-%d', ...
import numpy as np class LineElement: """LineElement represents a finite arc in the discretization of the domain boundary.""" def __init__(self, a, b, n, is_fault): """Constructor. :param a: Start point :param b: End point :param n: Outward-pointing normal :param is_fa...
import os import pickle import matplotlib import matplotlib.pyplot as plt import numpy as np def abline(ax, slope, intercept): """Plot a line from slope and intercept""" x_vals = np.array(ax.get_xlim()) y_vals = intercept + slope * x_vals ax.plot(x_vals, y_vals, '--', color='grey') def all_distances...
import matplotlib.pyplot as plt import numpy as np import pickle from datetime import date with open('mhws_data.pkl', 'rb') as f: [dates, t, sst, mhws, clim] = pickle.load(f) ev = np.argmax(mhws['intensity_max']) # Find largest event plt.figure(figsize=(14,10)) plt.subplot(2,1,1) # Plot SST, seasonal cycle, and ...
# Copyright (c) Microsoft Corporation. # Licensed under the MIT license. from convlab.modules.word_dst.multiwoz import MDBTTracker, TRADETracker, SUMBTTracker
# -*- coding: utf-8 -*- # # Copyright (C) 2005 Matthew Good <trac@matt-good.net> # Copyright (C) 2010-2013 Steffen Hoffmann <hoff.st@web.de> # All rights reserved. # # This software is licensed as described in the file COPYING, which # you should have received as part of this distribution. # # Author: Matthew Good <tra...
from app import db from models.base import BaseMixin class Follow(db.Model, BaseMixin): __tablename__ = 'follows' follower_id = db.Column(db.Integer, index=True, nullable=True) followed_id = db.Column(db.Integer, index=True, nullable=True) def __init__(self, *args, **kwargs): super().__init_...
import numpy as np import torch from collections import OrderedDict import util.util as util from util.image_pool import ImagePool from .base_model import BaseModel from . import networks # losses from losses.SegmentsStyleLoss import SegmentsSeperateStyleLoss class TransferModel(BaseModel): def name(self): ...
import string letter = string.ascii_lowercase cipher = "11 21 14 3 20 6 { 10 21 19 20 12 5 20 20 5 18 14 21 13 2 5 18 19 }" text="" for i in cipher.split(' '): if(i=="{" or i=="}"): text+=i else: text+=letter[int(i)-1] print(text)
# 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. from telemetry.page import page as page_module from telemetry.page import page_set as page_set_module def _GetCurrentLocation(action_runner): return actio...
# coding=utf-8 # Copyright 2018 The Google AI Language Team Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by ...
# writing_dense_multiple.py # # LICENSE # # The MIT License # # Copyright (c) 2018 TileDB, Inc. # # 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 limita...
#MenuTitle: Remove Anchors in Suffixed Glyphs # -*- coding: utf-8 -*- from __future__ import division, print_function, unicode_literals __doc__=""" Removes all anchors from glyphs with one of the user-specified suffix. """ import vanilla class RemoveAnchorsinSuffixedGlyphs( object ): def __init__( self ): # Window...
from enum import Enum from typing import Any class EventType(Enum): FILE_READ = 1 SAVED = 2 SOURCE_SET = 3 class Event: def __init__(self, event_type: EventType, payload: Any): self.event_type = event_type self.payload = payload
#### NOTICE: THIS FILE IS AUTOGENERATED #### MODIFICATIONS MAY BE LOST IF DONE IMPROPERLY #### PLEASE SEE THE ONLINE DOCUMENTATION FOR EXAMPLES from swgpy.object import * def create(kernel): result = Building() result.template = "object/building/player/city/shared_garden_tatooine_sml_05.iff" result.attribute_tem...
# -*- coding: utf-8 -*- # -------------------------------------------------------------------------- class Results: """Program results""" # ---------------------------------------------------------------------- def __init__(self, **kwargs): self.diffs = kwargs.get("diffs", {}) # ----------------...
# -*- coding: utf-8 -*- ''' This module implements :class:`BaseSignal`, an array of signals. This is a parent class from which all signal objects inherit: :class:`AnalogSignal` and :class:`IrregularlySampledSignal` :class:`BaseSignal` inherits from :class:`quantities.Quantity`, which inherits from :class:`numpy.ar...
from os.path import basename, isfile, join, splitext from six import string_types # urllib3 is a required dependency of requests from urllib3.util import parse_url from .. import validation from ..exceptions import InvalidArgument, InvalidPath try: from typing import Any, Optional, Union except ImportError: ...
""" Copyright 2020 The OneFlow 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 applicable l...
# coding: utf8 from __future__ import unicode_literals from ...symbols import LEMMA, PRON_LEMMA MORPH_RULES = { }
import autodisc as ad def get_system_parameters(): system_parameters = ad.systems.Lenia.default_system_parameters() system_parameters.size_y = 256 system_parameters.size_x = 256 return system_parameters def get_explorer_config(): explorer_config = ad.explorers.GoalSpaceExplorer.default_config(...
import setFunctions as sf import CaseRunner as cr import ResultsAggregator as ra import os import json import datetime from metadata import versions from OpenFOAMCase import OpenFOAMCase from pathlib import Path from subprocess import check_output def can_be_symlinked(path): path = Path(path) num_procs = path...
from typing import Generator, List, Union, Any import torch from torch import nn, optim, Tensor from torch.utils.data import DataLoader from torch.utils.tensorboard import SummaryWriter from torchtext.data import BucketIterator from tqdm import tqdm from src.config import Config from src.early_stopping import EarlySt...
#!/usr/bin/python # MaskGen - Generate Password Masks # # This tool is part of PACK (Password Analysis and Cracking Kit) # # VERSION 0.0.3 # # Copyright (C) 2013 Peter Kacherginsky # Copyright (C) 2015 Moloch # All rights reserved. # # Please see the attached LICENSE file for additional licensing information. import ...
import torch import torch.nn as nn import torch.nn.functional as F import pdb class CrowdCounter(nn.Module): def __init__(self,gpus,model_name): super(CrowdCounter, self).__init__() if model_name == 'AlexNet': from SCC_Model.AlexNet import AlexNet as net elif mo...
from django.contrib import admin from . import models admin.site.register(models.Checkout) class PriceInline(admin.TabularInline): model = models.Price @admin.register(models.Plan) class PlanAdmin(admin.ModelAdmin): inlines = (PriceInline,) list_display = ( "id", "name", ) @admin...
from src.core.base import ExhaustiveBase class ExhaustiveClassification(ExhaustiveBase): y_features = 'Class'
from setuptools import find_packages, setup setup( name='carecog', packages=find_packages(), version='0.1.0', description='A short description of the project.', author='kforest', license='MIT', )
"""Preacher CLI.""" import sys from concurrent.futures import Executor from typing import Callable, Iterable, Optional, Sequence from click import FloatRange from click import IntRange from click import Path from click import argument from click import command from click import help_option from click import option fr...
# coding: utf-8 import re import six from huaweicloudsdkcore.utils.http_utils import sanitize_for_serialization class ListenersInStatusResp: """ Attributes: openapi_types (dict): The key is attribute name and the value is attribute type. attribute_map (dict): The ...
# Copyright (c) 2021 PaddlePaddle Authors. All Rights Reserve. # # 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...
"""Flare is an application development framework for writing software frontends in pure Python.""" import logging logging.getLogger(__name__).addHandler(logging.NullHandler()) from . import html5 from . import button from . import cache from . import event from . import handler from . import i18n from . import icons...
import gym from rlkit.torch.url.path_replay_buffer import ObsDictPathReplayBuffer from rlkit.torch.url.url import UrlTwinSac from rlkit.torch.url.envs.disc_wrapper import DiscriminatorWrappedEnv from rlkit.torch.url.discriminator import Discriminator from rlkit.torch.networks import FlattenMlp from rlkit.torch.sac.poli...
#!/usr/bin/env python3 # # Copyright 2016 Canonical Ltd # # 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 o...
# -*- coding: utf-8 -*- # Copyright 2010-2014, Google Inc. # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions of source code must retain the above copyright # notice, this...
# -*- coding: utf-8 -*- # # Copyright 2021 Google LLC. 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 requir...
# convert yaml to json # pip3 install pyyaml # http://pyyaml.org/wiki/PyYAMLDocumentation # py3 yaml2json.py < ~/code/manpow/homeland/heartland/puphpet/config.yaml # gist https://gist.github.com/noahcoad/51934724e0896184a2340217b383af73 import yaml, json, sys sys.stdout.write(json.dumps(yaml.load(sys.stdin), sort_keys...
# CMSC 135 Assignment 6 - Design a program that asks the user to enter a series of 20 numbers. # The program should store the numbers in a list then display the following data: # * The lowest number in the list # * The highest number in the list # * The total of the...
# Copyright (C) 2018-2021 Intel Corporation # SPDX-License-Identifier: Apache-2.0 import numpy as np from extensions.ops.non_zero import NonZero from extensions.ops.transpose import Transpose from mo.front.common.partial_infer.utils import int64_array from mo.front.common.replacement import FrontReplacementOp from mo...
import numpy as np from math import fabs class Tuple: def __init__(self, x, y, z, w): self.x = x self.y = y self.z = z self.w = w self.vec = np.array([x, y, z, w]) self.is_point = w == 1.0 self.is_vector = w == 0.0 self.mag = np.linalg.norm(self.vec)...
""" defines: - AnimationWindow """ import os from collections import OrderedDict from qtpy.QtCore import Qt from qtpy.QtWidgets import ( QApplication, QLabel, QPushButton, QLineEdit, QRadioButton, #QWidget, QButtonGroup, QGridLayout, QHBoxLayout, QVBoxLayout, QSpinBox, QDoubleSpinBox, QCheckBox, QGro...
# Copyright 2014 Pants project contributors (see CONTRIBUTORS.md). # Licensed under the Apache License, Version 2.0 (see LICENSE). import glob import os import subprocess from abc import abstractmethod from contextlib import closing, contextmanager from dataclasses import dataclass from io import BytesIO from typing i...
#!/usr/bin/env python3 # Copyright (c) 2017-2019 The Geranium Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. """Test mempool acceptance of raw transactions.""" from io import BytesIO import math from test_framewo...
# coding: utf-8 import pprint import re import six class ListFlavorsRequest: """ Attributes: openapi_types (dict): The key is attribute name and the value is attribute type. attribute_map (dict): The key is attribute name and the value...
from _main_.utils.massenergize_errors import MassEnergizeAPIError from _main_.utils.massenergize_response import MassenergizeResponse from _main_.utils.common import serialize, serialize_all from api.store.page_settings__aboutus import AboutUsPageSettingsStore from _main_.utils.context import Context class AboutUsPage...
from typing import Optional, Tuple import attr from ufoLib2.objects.misc import AttrDictMixin @attr.s(auto_attribs=True, slots=True) class Anchor(AttrDictMixin): """Represents a single anchor. See http://unifiedfontobject.org/versions/ufo3/glyphs/glif/#anchor. """ x: float """The x coordinate ...
#!/usr/bin/env python3 # Copyright (c) 2015-2020 The Beans Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. ''' Test script for security-check.py ''' import os import subprocess import unittest def write_testcode(fi...
import os import sys sys.path.append('../../common') from env_indigo import * from itertools import product indigo = Indigo() def getProduct(reaction): for mol in reaction.iterateProducts(): return mol return None def loadSdf(sdf_path): sdfiterator = indigo.iterateSDFile(sdf_path) result =...
""" Account The account class is an extension of the default Django user class, and is customized for the needs of Evennia. We use the Account to store a more mud-friendly style of permission system as well as to allow the admin more flexibility by storing attributes on the Account. Within the game we should normall...
# coding: utf-8 """ Sunshine Conversations API The version of the OpenAPI document: 9.4.5 Generated by: https://openapi-generator.tech """ import pprint import re # noqa: F401 import six from sunshine_conversations_client.configuration import Configuration from sunshine_conversations_client.undefine...
import re def read_input(): # for puzzles where each input line is an object def _parse_nums(rule_text): return tuple(int(i) for i in rule_text.strip().split()) with open('input.txt') as fh: rules = {} texts = [] for line in fh.readlines(): if ':' in line.strip...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """Generate an LAE population from a dark matter halo population, based on the methods outlined in Weinberger et al. (2019). Examples: -------- Import the module: >>> import model Generate LAE population: >>> lae_pop = slap.LAEModel(z, delta_t, ha...
# TODO: not working _base_ = [ '../_base_/datasets/kitti_mono.py', '../_base_/default_runtime.py' ] # ATSS Model model = dict( type='FCOS', pretrained='torchvision://resnet34', backbone=dict( type='ResNet', depth=34, num_stages=4, out_indices=(0, 1, 2, 3), fro...
import numpy as np import sys import gzip from collections import defaultdict buckets=defaultdict(list) with gzip.open(sys.argv[1],'rt') as f: for line in f: if line.startswith('[broker]'): fields=line.strip().split(" ") arrival_time = float(fields[1])*1000 #sec to ms co...
""" Overlay crime costs on roads """ import pandas as pd import numpy as np import overpass import geopandas as gpd import matplotlib.pyplot as plt from ast import literal_eval as make_tuple import psycopg2 import ipdb import sys import cost_models import sys import json import matplotlib as mpl import folium dbname ...
from oauth2client.client import OAuth2WebServerFlow import httplib2 import json class Oauth2Client(object): """client for interacting with google oauth 2, as google openid connect is supported under oauth2""" def __init__(self, settings, logger, HTTP_PROXY=None): self.logger = logger self...
import evaluator_ab import evaluator_nn def evaluate(board): e1 = evaluator_ab.evaluate(board) e2 = evaluator_nn.evaluate(board) return float(e1 + 9 * e2) / 10
#-*- coding: utf-8 -*- from django.shortcuts import render, redirect from django.contrib import messages from django.utils.translation import ugettext as _ from spirit.utils.decorators import administrator_required from spirit.forms.admin import BasicConfigForm @administrator_required def config_basic(request): ...
# coding=utf-8 # Copyright 2021 The TensorFlow Datasets Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by appl...
# coding=utf-8 # *** WARNING: this file was generated by the Pulumi SDK Generator. *** # *** 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 _utilities fro...
from app.core.core_result.result import Result class SuccessResult(Result): def __init__(self, message): super().__init__(isSuccess=True, message=message) class ErrorResult(Result): def __init__(self, message): super().__init__(isSuccess=False, message=message)
from django.conf.urls import url from api.view_only_links import views app_name = 'osf' urlpatterns = [ url(r'^(?P<link_id>\w+)/$', views.ViewOnlyLinkDetail.as_view(), name=views.ViewOnlyLinkDetail.view_name), url(r'^(?P<link_id>\w+)/nodes/$', views.ViewOnlyLinkNodes.as_view(), name=views.ViewOnlyLinkNodes.v...
"""Ibis expression API definitions.""" import collections import datetime import functools import numbers import operator from typing import Any, List, Union import dateutil.parser import pandas as pd import toolz import ibis import ibis.common.exceptions as com import ibis.expr.analysis as _L import ibis.expr.analy...
from dataclasses import dataclass from dnsimple.struct import Struct @dataclass class AccessToken(Struct): """ AccessToken represents a DNSimple Oauth access token. See https://developer.dnsimple.com/v2/oauth/ """ account_id = None """The account ID in DNSimple this token belongs to.""" ...
from flask import Blueprint, render_template, session, redirect, url_for, \ request, flash, g, jsonify, abort, send_file mod = Blueprint('manualError', __name__) @mod.route('/404', methods=['GET']) def manual_not_found(): return render_template('error.html', errorCode=404) @mod.route('/500', methods=['GET']...
#!/usr/bin/env python3 import os import subprocess import tempfile from Cluster import Cluster from TestHelper import TestHelper from testUtils import Utils ############################################################### # distributed-transactions-remote-test # Tests remote capability of the distributed-transactions...
# Auto generated from issue_44.yaml by pythongen.py version: 0.9.0 # Generation date: 2021-12-11T03:14:49 # Schema: test44 # # id: https://example.com/test44 # description: # license: https://creativecommons.org/publicdomain/zero/1.0/ import dataclasses import sys import re from jsonasobj2 import JsonObj, as_dict from...
# Calculation of vertical concentration profile and contaminantion mass flux through a one layer # mineral barrier with ponded contaminated water above the barrier and a higher K underlying unit. # Concentrations are calculated using analytical and numerical solutions with boundary conditions # assuming that zero-c...
from __future__ import absolute_import from __future__ import print_function import os import sys # the next line can be removed after installation sys.path.insert(0, os.path.dirname(os.path.dirname( os.path.dirname(os.path.abspath(__file__))))) import nngen as ng import veriloggen import onnx_matrix_add a_sh...
"""Tests for the question classifier""" import pytest from analysis.algorithms.question_classifier import question_likelihood import tests.unit.utils.spacy_utils as utils TEST_DATA = [ (True, 'Where is Tom?', 0.94), (True, 'When is Tom going to the store?', 0.94), (True, 'How did the chicken cross the roa...
# Copyright 2018 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 # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, ...
# Author: bbrighttaer # Project: jova # Date: 6/1/19 # Time: 11:40 PM # File: test_models.py from __future__ import division from __future__ import print_function from __future__ import unicode_literals import unittest import pandas as pd import rdkit.Chem as ch import torch import jova from jova.nn.models import ...
# coding=utf-8 # Copyright 2022 The Google Research Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicab...
''' Update/generate 'c_cpp_properties.json' file in .vscode subfolder. See details in "README_DETAILS.md'. 'c_cpp_properties.json' fields description: https://github.com/Microsoft/vscode-cpptools/blob/master/Documentation/LanguageServer/c_cpp_properties.json.md ''' import json import utilities as utils im...
# -*- coding: utf-8 -*- # MySQL Workbench module # A MySQL Workbench plugin which exports all Model in the existing database to Knex schema in AdonisJS migrations template # Written in MySQL Workbench 6.3.6 import cStringIO import glob import os import grt import mforms import datetime import time from grt.modules i...
#!/usr/bin/env python # Copyright (c) 2009 by Konstantin Merenkov <kmerenkov@gmail.com> # # 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 ...
import json from utils import * class create_logs(): pass def arch_summary(arch): model = arch(False) tot = 0 for i, l in enumerate(model.children()): n_layers = len(flatten_model(l)) tot += n_layers print(f'({i}) {l.__class__.__name__:<12}: {n_layers:<4}layers (total: {to...
import asyncio from collections import Counter # import discord from discord.ext import commands, tasks import asyncpg from donphan import Column, SQLType, Table from bot.utils import checks from bot.config import config as BOT_CONFIG COG_CONFIG = BOT_CONFIG.EXTENSIONS[__name__] class _Commands(Table): id: S...
#!/usr/bin/env python ''' * Copyright (c) 2018 Spotify AB. * * 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 un...
from __future__ import print_function, absolute_import import numbers class KernelRuntimeError(RuntimeError): def __init__(self, msg, tid=None, ctaid=None): self.tid = tid self.ctaid = ctaid self.msg = msg t = ("An exception was raised in thread=%s block=%s\n" "\t%s")...
from brandfolder.resource import Resource from brandfolder.resource_container import ResourceContainer from brandfolder.asset import Asset from brandfolder.attachment import Attachment class Collection(Resource): RESOURCE_NAME = 'Collection' RESOURCE_TYPE = 'collections' def __init__(self, client, **kwar...