text
stringlengths
2
999k
"""An implementation of matrix capsules with EM routing. """ import tensorflow as tf from core import _conv2d_wrapper, capsules_init, capsules_conv, capsules_fc slim = tf.contrib.slim # ------------------------------------------------------------------------------# # -------------------------------- capsules net --...
import re from textwrap import dedent from unittest import mock from unittest.mock import PropertyMock import pytest from get_pr_info import extract_target_section, get_pr_number_from_commit_message, get_pr_summary from github import BadCredentialsException, UnknownObjectException class TestGetPrNumberFromCommitMess...
#!/usr/bin/env python # coding: utf-8 # ### - Ensemble/Blend the 4 model predictions into a single prediction # In[1]: import os import datetime from time import time import pathlib import pandas as pd import numpy as np from collections import defaultdict from collections import Counter # In[2]: from sklearn.m...
""" Base module for pyltr. We import all packages since it's not particularly expensive. """ from . import data from . import metrics from . import models from . import util
# -*- coding: utf-8 -*- """ Sahana Eden Evacuees Registry Model @copyright: 2015-2017 (c) Sahana Software Foundation @license: MIT 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 Soft...
""" Django settings for rindr project. Generated by 'django-admin startproject' using Django 3.2.8. For more information on this file, see https://docs.djangoproject.com/en/3.2/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/3.2/ref/settings/ """ from pathlib i...
"""The helper module for the flip interfaces. """ from enum import Enum from apysc._type.boolean import Boolean class Axis(Enum): X = 'x' Y = 'y' def make_flip_update_expression( *, before_value: Boolean, after_value: Boolean, axis: Axis, interface_variable_name: str) -> str...
from django.contrib import admin from .models import Meeting, MeetingMinutes, Resource, Event # Register your models here. admin.site.register(Meeting) admin.site.register(MeetingMinutes) admin.site.register(Resource) admin.site.register(Event)
# flake8: noqa E501 from hmda.models.hmda_data_file import HmdaDataFile # Access this using HMDA_DATA_FILES[geo][field_descriptions][records] LOAN_FILE_METADATA = { 'nationwide': { 'labels': { 'first-lien-owner-occupied-1-4-family-records': { '2016': HmdaDataFile('hmda_2016_nat...
#!/usr/bin/python # CALCULATION OF GC CONTENT (GENES) import os import logging import argparse import fastalib from fileutils import safe_filename def get_option_args(): args_parser = argparse.ArgumentParser( description='Found GC in FASTA files of a directory', ) args_parser.add_argument( ...
''' BGP Genie Ops Object Outputs for IOSXR. ''' import xml.etree.ElementTree as ET class BgpOutput(object): ############################################################################ # BGP INFO ############################################################################ ...
import PIL.Image, PIL.ImageDraw from roomEditor import RoomEditor, ObjectHorizontal, ObjectVertical, ObjectWarp class RenderedMap: WALL_UP = 0x01 WALL_DOWN = 0x02 WALL_LEFT = 0x04 WALL_RIGHT = 0x08 def __init__(self, floor_object, overworld=False): self.objects = {} se...
# 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...
#!/usr/bin/python import os import sys import time from configparser import ConfigParser from plexapi.server import PlexServer import re config_object = ConfigParser() config_object.read("/config/config.ini") server = config_object["PLEXSERVER"] options = config_object["OPTIONS"] baseurl = (server["PLEX_...
import logging from blspy import PrivateKey from mint.cmds.init_funcs import check_keys from mint.util.keychain import Keychain from pathlib import Path from typing import Any, Dict, List, Optional, cast # Commands that are handled by the KeychainServer keychain_commands = [ "add_private_key", "check_keys", ...
#Importing packages import shutil import os import csv #Preprocessing first dataset file = "./Pokemon/data/pokemon_types_names.csv" with open(file,'r') as f: reader = csv.reader(f) next(reader,None) #Skip the header pkm_dict1 = {rows[1]:rows[2] for rows in reader} for pkm_name, pkm_type...
# Copyright 2020-present Kensho Technologies, LLC. """Implementing client-side grpc interceptors""" import functools import json import backoff import grpc import prometheus_client CLIENTSIDE_METRICS_HISTO = prometheus_client.Histogram( "clientside_grpc_endpoint", "Response time histogram for grpc endpoints ...
######### # Copyright (c) 2015 GigaSpaces Technologies Ltd. All rights reserved # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless...
"""Ensemble plan manually split by type moode/theme.""" import json from dbispipeline.evaluators import FixedSplitEvaluator from dbispipeline.evaluators import ModelCallbackWrapper import numpy as np from sklearn.pipeline import Pipeline from mediaeval2021 import common from mediaeval2021.dataloaders.melspectrograms ...
import lldb from lldbsuite.test.lldbtest import * from lldbsuite.test.decorators import * from gdbclientutils import * class TestGDBRemoteLoad(GDBRemoteTestBase): def setUp(self): super(TestGDBRemoteLoad, self).setUp() self._initial_platform = lldb.DBG.GetSelectedPlatform() def tearDown(self...
"""createbulk This module illustrates how to connect to MySQL and load bulk data in python using the mysql-connector-python library. """ import mysql.connector from faker import Faker # Create a connection to MySQL db = mysql.connector.connect(option_files="../sql-user/my.ini") cursor = db.cursor() # Create Faker in...
# -*- coding: utf-8 -*- import os import pickle from autobahn.twisted.util import sleep from mdstudio.deferred.chainable import chainable from mdstudio.component.session import ComponentSession from mdstudio.runner import main from mdstudio_workflow import Workflow class LIEPredictionWorkflow(ComponentSession): ...
#!/usr/bin/env python # -*- coding: utf-8 -*- """ .. py:currentmodule:: test_direct_metric_tensor :synopsis: Tests for the module :py:mod:`direct_metric_tensor` .. moduleauthor:: Hendrix Demers <hendrix.demers@mail.mcgill.ca> Tests for the module :py:mod:`direct_metric_tensor`. """ ##############################...
import setuptools setuptools.setup(name="librespot", version="0.0.1", description="Open Source Spotify Client", long_description=open("README.md").read(), long_description_content_type="text/markdown", author="kokarare1212", ...
# BSD 3-Clause License # Copyright (c) 2017, Federico T. # 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 # list o...
# -*- coding: utf-8 -*- """ Causal graph for the random utility model in Ben-Akiva et al. (2002). References ---------- Ben-Akiva, Moshe, Joan Walker, Adriana T. Bernardino, Dinesh A. Gopinath, Taka Morikawa, and Amalia Polydoropoulou. "Integration of choice and latent variable models." Perpetual motion: Travel behavi...
import numpy as np import pandas as pd import pytest from pytest import importorskip from evalml.model_family import ModelFamily from evalml.pipelines.components import ProphetRegressor from evalml.problem_types import ProblemTypes prophet = importorskip("prophet", reason="Skipping test because prophet not installed"...
#!/usr/bin/env python # # __COPYRIGHT__ # # 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, merge, publish, ...
""" Distance functions ================== Distance functions measure closeness of observed and sampled data. This module implements various commonly used distance functions for ABC, featuring a few advanced concepts. For custom distance functions, either pass a plain function to ABCSMC or subclass the pyabc.Distance ...
__author__ = 'efelix' # ---------------------------------------------------------------------------------------------------------------------- from rdkit.Chem import AllChem from beaker import app from bottle import request from beaker.core_apps.D2Coords.impl import _ctab22D, _smiles22D, _is3D from beaker.utils.io im...
if __name__ == "__main__": import os import sys import subprocess import XMLReduction #python2 main.py name.pdf 8.5 font #need font because need to filter out text that matches in all other regards except font #but also need to except font that starts exactly the same up to the end where it ...
import numpy as np from simtk import openmm, unit from simtk.openmm import app from openmmtools.testsystems import WaterBox from openmmtools.integrators import ExternalPerturbationLangevinIntegrator print('OpenMM version: ', openmm.version.full_version) # Using one CPU thread import os os.environ['OPENMM_CPU_THREADS']...
# # Copyright (c) Microsoft Corporation. All Rights Reserved. # """ Use DOT to layout a graph for cytoscape.js TODO: add support for middle points in edges """ from __future__ import division from collections import deque, defaultdict import platform if True or platform.system() == 'Windows': from ivy_graphviz ...
import sys sys.path.append('..') from data_object.word_data_object import WordDataObject from service.word import Word from service.language import Language from utils.print import ppp # random word list options language = Language(Language.ENGLISH) qwerty_difficulty_rank = { 'min': 0, 'max': 10000 } frequency_ra...
import base64 import os import shutil import string import tempfile import unittest from datetime import timedelta from http import cookies from django.conf import settings from django.contrib.sessions.backends.base import UpdateError from django.contrib.sessions.backends.cache import SessionStore as CacheSession from...
# -*- python -*- # Copyright (C) 2009-2014 Free Software Foundation, Inc. # 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 3 of the License, or # (at your option) any later versio...
import pytest from selenium import webdriver from selenium.webdriver.support.wait import WebDriverWait from selenium.webdriver.support import expected_conditions as EC import time @pytest.fixture(scope="session") def driver(request): wd=webdriver.Chrome() request.addfinalizer(wd.quit) return wd def test_admin_log...
from parsimonious.grammar import Grammar from .. import html_paths def read_html_path(string): path_node = _grammar.parse(string) return read_html_path_node(path_node) def read_html_path_node(path_node): if path_node.children[0].expr_name == "ignore": return html_paths.ignore elif path_node...
from . import git import os from .utils import errordie, mkpath, msg def _trim(lines): stripped = [line.strip() for line in lines] return [line for line in stripped if line and not line.startswith('#')] def _git_destname(repository): git_folder = repository.rsplit('/', 1)[1] if git_folder.endswith('...
# 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 ...
''' module that retreives and pack adms input info ''' import rdflib from pyproj import Proj, transform import requests import math import sys import os import rdflib.plugins.sparql.results.jsonresults as jsresult from collections import namedtuple from admsSrc import admsSrc from admsPolygon import Polygon import cob...
""" command line options, ini-file and conftest.py processing. """ from __future__ import absolute_import from __future__ import division from __future__ import print_function import argparse import copy import inspect import os import shlex import sys import types import warnings import py import six from pkg_resour...
"""Unit test package for codeforces2html."""
# Import Built-Ins import logging import json import time import ssl import hashlib import hmac from multiprocessing import Queue from threading import Thread, Event, Timer from collections import OrderedDict # Import Third-Party import websocket # Import Homebrew # Init Logging Facilities log = logging.getLogger(__...
# -*- coding: utf-8 -*- # DISCLAIMER # This code file is forked and adapted from https://github.com/tezignlab/RippleNet-TF2/blob/master/tools/load_data.py, which is under an MIT license. """ Utilities for data loading for RippleNet. """ # import libraries import os import numpy as np from collections import defaultd...
import csv import glob import pandas as pd files = glob.glob("data/*.txt") names = {} for file in files: with open(file) as csvfile: reader = csv.reader(csvfile, delimiter=',') for row in reader: name = row[0] sex = row[1] number = row[2] if name no...
from typing import Optional from functools import partial import torch from torch.nn.modules.loss import _Loss from ._functional import focal_loss_with_logits from .constants import BINARY_MODE, MULTICLASS_MODE, MULTILABEL_MODE __all__ = ["FocalLoss"] class FocalLoss(_Loss): def __init__( self, ...
from typing import Generic, TypeVar CQ = TypeVar('CQ', covariant=True) class CommandQueryBase(Generic[CQ]): def __init__(self) -> CQ: pass
# Copyright 2019 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, ...
from django.contrib.sites.models import Site from django.db import models class Article(models.Model): sites = models.ManyToManyField(Site) headline = models.CharField(max_length=100) publications = models.ManyToManyField("model_package.Publication", null=True, blank=True,) class Meta: app_la...
''' @author: Xu Yan @file: ModelNet.py @time: 2021/3/19 15:51 ''' import os import numpy as np import warnings import pickle from tqdm import tqdm from torch.utils.data import Dataset warnings.filterwarnings('ignore') def pc_normalize(pc): centroid = np.mean(pc, axis=0) pc = pc - centroid m = np.max(np....
from __future__ import division import numpy as np import matplotlib.pyplot as plt import gufunc_sampler as gs # Mandelbrot set rows = np.linspace(-1.25, 1.25, 1250) cols = np.linspace(-2, 0.5, 1250) mandel_set = gs.mandelbrot(cols + 1.j * rows[:, np.newaxis], 50) plt.subplot(121) plt.imshow(mandel_set, ...
import os.path from django.conf import settings from django.core.management.base import BaseCommand from sheerlike.indexer import index LOCATION = os.environ.get('SHEER_LOCATION', os.getcwd()) ELASTICSEARCH_HOSTS = settings.SHEER_ELASTICSEARCH_SERVER ELASTICSEARCH_INDEX = settings.SHEER_ELASTICSEARCH_INDEX class ...
""""A system check for testing integration of various libraries with mozetl. This sub-module will print out relevant version info. It will also read data from `main_summary` and print basic statistics to verify that the system is correctly set-up. """ import sys import click import logging from datetime import datet...
import bw_projects def test_version(): assert bw_projects.__version__
DEBUG=on SECRET_KEY=CHANGE_ME!!!! ALLOWED_HOSTS=, DATABASE_URL=postgres://{{cookiecutter.db_user}}:{{cookiecutter.db_pwd}}@db/{{cookiecutter.db_name}} EMAIL_HOST_USER={{cookiecutter.author_email}} EMAIL_PWD=email_pwd EMAIL_ADMIN={{cookiecutter.author_email}}
import datetime # from sqlalchemy import Column, Integer, String import hashlib from server.extensions import Base, argon2, bcrypt class User(Base): __table__ = Base.metadata.tables["users"] __table_args__ = {"autoload": True} # Attribute names to help out with functions # id = Column(Integer, prim...
# -*- coding: utf-8 -*- """ Tencent is pleased to support the open source community by making 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) available. Copyright (C) 2017-2021 THL A29 Limited, a Tencent company. All rights reserved. Licensed under the MIT License (the "License"); you may not use this file except in co...
import vlc instance = vlc.Instance() class VLCPlayer: def __init__(self): self.player = instance.media_player_new() self.player.audio_output_set("Scaletempo") self.length = 0 def set_position(self,position) : self.player.set_position(position / self.get_length()) ...
import torch from torch import nn from d2l import torch as d2l BATCH_SIZE, LR, NUM_EPOCHS = 256, 0.1, 10 ACTIVATE_FUNCS = [nn.ReLU(), nn.Sigmoid(), nn.Tanh()] def init_weights(m): if type(m) == nn.Linear: nn.init.normal_(m.weight, std=0.01) if __name__ == "__main__": for i in range(0, 3): n...
import asyncio import json import random import subprocess import discord import discord.ext import requests from discord.ext import commands import os from botlibrary.utils import get_variable from botlibrary import constants # Wichs Codierung # ä=ü # ö=ö # assign constant variables constants.assignVariables() V...
import pika import sys connection = pika.BlockingConnection( pika.ConnectionParameters(host='localhost')) channel = connection.channel() channel.queue_declare(queue='task_queue', durable=True) message = ' '.join(sys.argv[1:]) or "Hello World!" channel.basic_publish( exchange='', routing_key='task_queue',...
from islelib import __version__ def test_example(example_fixture: int) -> None: assert __version__ is not False
from paz.core import Processor from paz.core import SequentialProcessor import numpy as np class ProcessorA(Processor): def __init__(self): super(ProcessorA, self).__init__() def call(self, image, boxes): boxes = boxes - 1.0 return image, boxes class ProcessorB(Processor): def _...
# Model architecture analyzer import os import logging import logging.handlers as handlers import json import numpy as np import tensorflow as tf physical_devices = tf.config.list_physical_devices('GPU') tf.config.experimental.set_memory_growth(physical_devices[0], enable=True) tf.keras.backend.set_floatx('float32') fr...
# system imports import os, json basedir = os.path.abspath(os.path.dirname(__file__)) class Config: """ Class used to hold configurations that are used in both website and admin applications """ MONGO_HOST = "localhost" MONGO_DBNAME = "panoptes" THREADS_PER_PAGE = 8 mailcfg = json.loa...
''' Define functions for the detuning of an atomic system ''' from LASED.state import * from LASED.constants import * def delta(e, g): """Detunings between substates. Parameters: e (State): State object g (State): State object Returns: float: Difference in angular freque...
import sys, copy from itertools import * from StringIO import StringIO import benchbase from benchbase import with_attributes, with_text, onlylib, serialized ############################################################ # Benchmarks ############################################################ class XSLTBenchMark(benc...
''' Created on 08-10-2012 @author: Jacek Przemieniecki ''' from . import errors class Database(object): def get_atom_valency(self, symbol): return valency[symbol] def get_q_r(self, symbol): grp_id = str_to_id[symbol][0] return q_r_data[grp_id] def get_parameter(self,...
from symbol.builder import FasterRcnn as Detector from symbol.builder import add_anchor_to_arg from models.efficientnet.builder import EfficientNetB5FPN as Backbone from models.FPN.builder import FPNNeck as Neck from models.FPN.builder import FPNRpnHead as RpnHead from models.FPN.builder import FPNRoiAlign as RoiExtrac...
#!/usr/bin/env python3 from flask import Flask, render_template, request from werkzeug import secure_filename app = Flask(__name__) @app.route('/') def index(): return render_template('index.html') @app.route('/upload', methods=['POST']) def upload(): if request.method == 'POST': f = request.files.get...
import copy import json from django_admin_json_editor import JSONEditorWidget from django.utils.safestring import mark_safe from django.template.loader import render_to_string class JSONEditorWidget(JSONEditorWidget): template_name = 'lanthanum/_json_editor_widget.html' def render(self, name, value, attrs=N...
# -*- coding: utf-8 -*- # Copyright 2014 Telefonica Investigación y Desarrollo, S.A.U # # This file is part of FI-WARE project. # # 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: # # h...
from setuptools import setup, find_packages setup( name="home-assistant-frontend", version="20211215.0", description="The Home Assistant frontend", url="https://github.com/home-assistant/frontend", author="The Home Assistant Authors", author_email="hello@home-assistant.io", license="Apache-...
# Copyright 2019 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, ...
#!/usr/bin/env python # -*- coding: utf-8 -*- # @brief This module has unit tests for the classes of EasyIPC. # @author Luis C. Garcia-Peraza Herrera (luiscarlos.gph@gmail.com). # @date 25 June 2020. import unittest import os import sys import numpy as np # My imports import easyipc class TestEasyIPC(unittest.Tes...
# Copyright 2020 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...
# Copyright 2021 Juan L. Gamella # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions # are met: # 1. Redistributions of source code must retain the above copyright # notice, this list of conditions and the following disclaimer. # 2...
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2010 United States Government as represented by the # Administrator of the National Aeronautics and Space Administration. # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compli...
# coding: utf-8 # Copyright (c) 2016, 2022, Oracle and/or its affiliates. All rights reserved. # This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may c...
import json import math import operator import os import random from io import open from queue import PriorityQueue import numpy as np import torch import torch.nn as nn import torch.nn.functional as F from torch import optim import functools import tatk.policy.mdrg.multiwoz.default_policy as policy SOS_token = 0 E...
from .pybitrix24 import Bitrix24 __version__ = '0.5.0'
#!/usr/bin/env python ###################################################################### ## File: create_public_pileup_plots.py ###################################################################### # NOTE: Typical way to create the pileup ROOT file from the cached txt # files (maintained by Mike Hildreth): # pil...
#!/usr/bin/env python # -*- coding: utf-8 -*- ################################################################### # Author: Mu yanru # Date : 2019.3 # Email : muyanru345@163.com ################################################################### from dayu_widgets3.collapse import MCollapse from dayu_widgets3.label im...
""" Here is probably the place to write the docs, since the test-cases show how the type behave. Later... """ from ctypes import * import sys, unittest try: WINFUNCTYPE except NameError: # fake to enable this test on Linux WINFUNCTYPE = CFUNCTYPE import _ctypes_test dll = CDLL(_ctypes_test.__file__) if ...
# coding: utf-8 # - run the command: # > pyccel-quickstart poisson # this will compile pyccel extensions and install them in $PWD/poisson/usr # - export the following variables # > export INCLUDE_DIR=$PWD/poisson/usr/include/poisson # > export LIB_DIR=$PWD/poisson/usr/lib # Usage: # > pyccel poisson_v2....
#!/usr/bin/env python import roslib import rospy import tf import geometry_msgs.msg from geometry_msgs.msg import Pose if __name__ == '__main__': rospy.init_node('world_aruco_ID_1_tf_listener') listener = tf.TransformListener() # Publishing the transform of the ArUco seen from the magnet aka end-effect...
import asyncio import logging from typing import Any # noqa: F401 from typing import Awaitable, Dict, List, Optional, Tuple from libp2p.exceptions import ParseError from libp2p.io.exceptions import IncompleteReadError from libp2p.network.connection.exceptions import RawConnError from libp2p.peer.id import ID from lib...
# Copyright 2020 The Magenta 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 applicable law or agreed to in ...
julia_llvmpasses_factory = util.BuildFactory() julia_llvmpasses_factory.useProgress = True julia_llvmpasses_factory.addSteps([ # Fetch first (allowing failure if no existing clone is present) steps.ShellCommand( name="git fetch", command=["git", "fetch", "--tags", "--all", "--force"], fl...
from typing import List, Tuple import pandas as pd @pd.api.extensions.register_dataframe_accessor("tag") class CaTaggingAccessor: def __init__(self, df: pd.DataFrame): self._df = df def group_by_sentences(self): yield from (x[1] for x in self._df.groupby("sentence_id")) def group_by_doc...
# Copyright 2019 The Forte 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 ...
# Based on scikit-learn/sklearn/utils/estimator_checks.py import itertools from functools import partial def get_entry_params(entry): user_parameters = entry.describe()["user_parameters"] if not user_parameters: return [] keys = [p["name"] for p in user_parameters] try: values = [p["a...
# 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, ...
from flask_restful import Resource, current_app from server.services.campaign_service import CampaignService from server.services.organisation_service import OrganisationService from server.models.postgis.utils import NotFound from server.models.postgis.campaign import Campaign from server.services.users.authenticatio...
# copyright (c) 2020 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 applica...
# -*- coding: utf-8 -*- ''' Specto Add-on Copyright (C) 2015 lambda 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 3 of the License, or (at your option) any l...
# -*- coding:utf-8 -*- """Handwritten digits recognition Graphic interface module : training done with the mnist dataset""" # Third-party gui/system/plotting Libraries import numpy as np import tkinter as tk import tkinter.font as tkFont from tkinter import messagebox from tkinter import filedialog from matplotlib.b...
import json import getpass import shortuuid # type: ignore from datetime import datetime from functools import lru_cache from collections import defaultdict from typing import Any, Dict, Generator, Generic, List, Optional, Set, Tuple, Union from followthemoney.types import registry from nomenklatura.entity import CE ...
''' OAuth2.0 client credentials flow plugin for HTTPie. ''' import sys from httpie.plugins import AuthPlugin from httpie.cli.definition import parser as httpie_args_parser from urllib.request import Request, urlopen from urllib.parse import urlencode from urllib.error import HTTPError import json from base64 import b6...