text
stringlengths
1
927k
import collections import json import mock from django.test import TestCase from django.test.utils import override_settings from django.urls import reverse from wagtail.api.v2 import signal_handlers from wagtail.core.models import Page, Site from wagtail.tests.demosite import models from wagtail.tests.testapp.models ...
# Copyright 2021 Hakan Kjellerstrand hakank@gmail.com # # 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 ...
import os import torch from torchvision.utils import make_grid from tensorboardX import SummaryWriter from dataloaders.utils import decode_seg_map_sequence class TensorboardSummary(object): def __init__(self, directory): self.directory = directory def create_summary(self): writer = SummaryWrit...
import logging from logging.handlers import SMTPHandler, RotatingFileHandler import os from flask import Flask, request, current_app from flask_sqlalchemy import SQLAlchemy from flask_migrate import Migrate from flask_login import LoginManager from flask_mail import Mail from flask_bootstrap import Bootstrap from flask...
""" Given two sorted integer arrays A and B, merge B into A as one sorted array. Note: You may assume that A has enough space (size that is greater or equal to m + n) to hold additional elements from B. The number of elements initialized in A and B are m and n respectively. """ class Solution: # @param A a list ...
import json import os import shutil import subprocess from six.moves.urllib import parse from . import utils from .exceptions import GitCommandError def set_repo_version(repo, version): with open(repo.get_metadata_path('version'), 'w') as out: out.write(str(version)) repo.run_git_command( 'a...
import util import math from Compiler.types import Array, sint, sfloat, sfix, MemValue, cint, Matrix, _int # import operator # import math # from Compiler.instructions import * from Compiler.library import for_range, print_str, for_range, print_float_prec import ml pint = sint pfloat = sfloat pfix = sfix pnum = pflo...
""" Train a new model. """ import sys import argparse import h5py import datetime import subprocess as sp import numpy as np import pandas as pd import gzip as gz from tqdm import tqdm import torch import torch.nn as nn import torch.nn.functional as F import torch.optim as optim from torch.autograd import Variable fr...
import setuptools with open("README.md", "r") as fh: long_description = fh.read() setuptools.setup( name="pr2roc", version="0.0.1", author="Ameya Daigavane", author_email="ameya.d.98@gmail.com", description="A package to resample precision-recall curves correctly.", long_description=long_d...
import requests from abc import ABC, abstractmethod from typing import Tuple, List import json class CoordinateConverter(ABC): def __init__(self): super().__init__() @abstractmethod def convert_coordinate(self, coordinate: Tuple, base_system_code, target_system_code): pass @abstractm...
#!/usr/bin/env python3 import fileinput import hashlib hash = None with fileinput.input() as fp: hash = fp.readline().strip() res = None i = 0 zeros = 5 while True: s = f'{hash}{str(i)}' h = hashlib.md5(s.encode()) res = h.hexdigest() if res.startswith('0'*zeros): break; i += 1 print(i) print(res)
"""Verify DeadLetter handling behavior. Current behavior is that an Actor may register for DeadLetter handling. If it is registered, any message sent to an Actor that is no longer present will be redirected to the register DeadLetter actor (in its original form). On exit of the DeadLetter handling Actor, the system ...
from part1 import ( gamma_board, gamma_busy_fields, gamma_delete, gamma_free_fields, gamma_golden_move, gamma_golden_possible, gamma_move, gamma_new, ) """ scenario: test_random_actions uuid: 366414300 """ """ random actions, total chaos """ board = gamma_new(5, 4, 4, 1) assert board is...
import misc_tools import random def create_routing(env, first_step='op1'): tasks = { 'op1': misc_tools.make_assembly_step( env=env, run_time=random.gauss(mu=12, sigma=0.5), route_to='op2'), 'op2': { 'location': env['machine_3'], 'worker...
from irnl_rdt_correction.irnl_rdt_correction import main, log_setup if __name__ == '__main__': log_setup() main()
""" Reolink Camera API """
# coding:utf-8 # modified from: https://github.com/haqishen/MFNet-pytorch # By Yuxiang Sun, Aug. 2, 2019 # Email: sun.yuxiang@outlook.com import os import argparse import time import datetime import numpy as np import sys import torch from torch.autograd import Variable from torch.utils.data import DataLoader from ut...
# Copyright 2016 Intel Corporation # # 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...
""" OpenAPI Petstore This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech """ import re # noq...
from scrapy.crawler import CrawlerProcess from scrapy.utils.project import get_project_settings from botmovies.spiders.ptt import PttMoviesSpider from botmovies.spiders.yahoo import YahooSpider process = CrawlerProcess(get_project_settings()) process.crawl(PttMoviesSpider) process.crawl(YahooSpider) process.start()
#!/usr/bin/env python3 # Foundations of Python Network Programming, Third Edition # https://github.com/brandon-rhodes/fopnp/blob/m/py3/chapter18/rpyc_server.py # RPyC server import rpyc def main(): from rpyc.utils.server import ThreadedServer t = ThreadedServer(MyService, port = 18861) t.start() class My...
# Copyright (C) 2018 Garth N. Wells # # SPDX-License-Identifier: MIT from floodsystem.stationdata import build_station_list, update_water_levels from floodsystem.flood import stations_level_over_threshold def run(): stations = build_station_list() update_water_levels(stations) for station_tuple in stati...
from auxiliar import receberInt def voto(nasc): from datetime import date idade = int(date.today().year) - nasc if idade < 16: return f'Com {idade} anos, voto: NEGADO' elif idade < 18 or idade >= 60: return f'Com {idade} anos, voto: OPCIONAL' else: return f'Com {idade} anos,...
import argtyper @argtyper.ArgumentGroup( ["firstname", "lastname"], title="Name details", description="Give your full name here", ) @argtyper.ArgumentGroup( ["nickname", "firstname"], title="Nickname details", description="Give your Nickname here", ) @argtyper.Argument( "amount", "repetiti...
# coding=utf-8 # Copyright 2019 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...
import os import glob from copy import deepcopy import pytest from ruamel.yaml.compat import StringIO import development_scripts @pytest.fixture(scope="module") def yaml_comments_file(): with open("tests/mocks/load/yaml_comments.yml", encoding="utf-8") as fh: return development_scripts.YAML_OBJECT.load(...
"""Support for Xiaomi lights.""" import logging from functools import partial from homeassistant.const import * # noqa: F401 from homeassistant.components.light import ( DOMAIN as ENTITY_DOMAIN, LightEntity, SUPPORT_BRIGHTNESS, SUPPORT_COLOR_TEMP, SUPPORT_COLOR, SUPPORT_EFFECT, ATTR_BRIGHT...
from unittest import TestCase, main from cogent3 import make_aligned_seqs from cogent3.app import evo as evo_app from cogent3.app.result import ( generic_result, model_collection_result, model_result, ) from cogent3.util.deserialise import deserialise_object __author__ = "Gavin Huttley" __copyright__ = "...
from django.shortcuts import render, redirect from django.contrib.auth.models import User from .models import UserProfile from .forms import ProfileForm def profile(request, pk): profile = UserProfile.objects.get(id=pk) context = { 'profile': profile } return render(request, 'account/profile.h...
# static analysis: ignore from __future__ import print_function from __future__ import absolute_import from __future__ import division from .test_name_check_visitor import TestNameCheckVisitorBase from .test_node_visitor import skip_before from .error_code import ErrorCode class TestAnnotations(TestNameCheckVisitorB...
'''https://projecteuler.net/problem=3''' '''Please see the README document for details''' def run(upper_bound): if(upper_bound%2 == 0): upper_bound = upper_bound-1 for decrementor in range(upper_bound, 0,-2): print str(decrementor)+", ", counter = 2 while(counter < decrementor): if(decrementor%counter == ...
# coding: utf-8 """ Browse API OpenAPI spec version: v1.8.0 Generated by: https://github.com/swagger-api/swagger-codegen.git """ import pprint import re # noqa: F401 import six class PaymentMethod(object): """NOTE: This class is auto generated by the swagger code generator program. Do n...
# vim:fileencoding=utf-8:noet """ python method """ # Copyright (c) 2010 - 2019, © Badassops LLC / Luc Suryo # 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...
import hashlib import random import lycanthropy.sql.interface import lycanthropy.crypto import jwt def decodeToken(token,config): rawData = jwt.decode( token, config['secret'], algorithms=['HS256'] ) return rawData def monitoringToken(user,config,remote,identity): userData = ly...
# # Copyright (C) 2019 UAVCAN Development Team <info@zubax.com>. # Author: Pavel Kirienko <pavel.kirienko@zubax.com> # from .. import app from ..model import devel_feed, forum_feed, adopters from flask import render_template FEED_LENGTH = 15 TITLE = 'UAVCAN - a lightweight protocol designed for reliable communicat...
from __future__ import unicode_literals import unittest try: from unittest import mock except ImportError: import mock try: from .base import BaseTestCase, BasePlatformTestCase except (ValueError, ImportError): from pynextcaller.tests.base import BaseTestCase, BasePlatformTestCase ADDRESS_JSON_RESULT_...
import collections import random from sympy.assumptions import Q from sympy.core.add import Add from sympy.core.compatibility import range from sympy.core.function import (Function, diff) from sympy.core.numbers import (E, Float, I, Integer, oo, pi) from sympy.core.relational import (Eq, Lt) from sympy.core.singleton ...
# 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 logging import traceback import config import pathlib class Logger(logging.getLoggerClass()): def __init__(self, name, level=logging.NOTSET): super().__init__(name, level=logging.DEBUG) formatter = logging.Formatter('%(levelname)s %(asctime)s [ %(name)s ] %(message)s') ...
# Pyrogram - Telegram MTProto API Client Library for Python # Copyright (C) 2017-2021 Dan <https://github.com/delivrance> # # This file is part of Pyrogram. # # Pyrogram is free software: you can redistribute it and/or modify # it under the terms of the GNU Lesser General Public License as published # by the Free...
# Copyright 2009-2017 Ram Rachum. # This program is distributed under the MIT license. from python_toolbox import caching from python_toolbox import sequence_tools # (`PermSpace` exported to here from `perm_space.py` to avoid import loop.) class _VariationAddingMixin: '''Mixin for `PermSpace` to add variations ...
import turbofastcrypto # The source code for this module is only available for part 2 of this challenge :) while 1: plaintext = input('> ') ciphertext = turbofastcrypto.encrypt(plaintext) print('Encrypted: ' + str(ciphertext))
from abc import abstractmethod import rastervision as rv from rastervision.core import (Config, ConfigBuilder) class AugmentorConfig(Config): def __init__(self, augmentor_type): self.augmentor_type = augmentor_type @abstractmethod def create_augmentor(self): """Create the Augmentor that ...
import os import pytest import testinfra.utils.ansible_runner testinfra_hosts = testinfra.utils.ansible_runner.AnsibleRunner( os.environ['MOLECULE_INVENTORY_FILE'] ).get_hosts('all') @pytest.mark.skip(reason='Scenario tests not implemented yet') def test_hostname(host): assert 'instance' == host.check_outp...
# coding=utf-8 # Copyright (c) 2020, NVIDIA CORPORATION. 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 re...
# copyright openpyxlzip 2014 import datetime import pytest from openpyxlzip.tests.helper import compare_xml from openpyxlzip.xml.constants import DCTERMS_PREFIX, DCTERMS_NS, XSI_NS from openpyxlzip.xml.functions import ( fromstring, tostring, register_namespace, NS_REGEX, ) @pytest.fixture() def Sa...
from gumo.task.application.repository import GumoTaskRepository from gumo.task.infrastructure.repository import GumoTaskRepositoryImpl def task_bind(binder): binder.bind(GumoTaskRepository, to=GumoTaskRepositoryImpl)
def main(): global originalNum global base ipl=input("Enter the input") originalNum=ipl[0:len(ipl)-3] base=ipl[len(ipl)-2:] def ABCD(num): num=str(num) if(num=='1'): return '1' if(num=='2'): return '2' if(num=='3'): return '3' if(num=='4'): retur...
""" Downloading input files from URIs, with plugin modules for different URI schemes Download URI plugins are installed & registered using the setuptools entry point group "miniwdl.plugin.file_download", with name equal to the URI scheme (e.g. "gs" or "s3"). The plugin entry point should be a context manager, which t...
s = input("Please enter your own String : ") if(s == s[:: - 1]): print("Palindrome") else: print("Not a Palindrome string")
# -*- coding: utf-8 -*- """ module for mul and mulfix class: fund combination management """ import logging import pandas as pd from pyecharts import options as opts from pyecharts.charts import Pie, ThemeRiver from xalpha.cons import convert_date, myround, yesterdaydash, yesterdayobj from xalpha.evaluate import eval...
# Copyright 2015 Google Inc. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or a...
"""Tests for the Freebox config flow.""" from unittest.mock import AsyncMock, patch from aiofreepybox.exceptions import ( AuthorizationError, HttpRequestError, InvalidTokenError, ) import pytest from homeassistant import data_entry_flow from homeassistant.components.freebox.const import DOMAIN from homeas...
from random import randint import playsound from time import sleep print('-=-' * 20) print('Vou pensar em um número entre 0 e 5. Tente advinhar... ') print('-=-' * 20) jogador = int(input('Em que número você pensou? ')) print('PROCESSANDO... ') sleep(3) computador = randint(0, 5) if jogador == computador: print('PA...
""" PI power 5V on pin GND on pin The GPIO mode is set to BCM H-Bridge Motor Driver Pin Configuration in1 -> BCM 05 (board pin 29 or GPIO 5) in2 -> BCM 06 (board pin 31 or GPIO 6) enable -> BCM 13 (board pin 33 or GPIO 13, PWM) PCA9685 (16-Channel Servo Driver) Pin Configuration SDA -> BCM 2 (board pin ...
# Natural Language Toolkit: Zen Chatbot # # Copyright (C) 2001-2021 NLTK Project # Author: Amy Holland <amyrh@csse.unimelb.edu.au> # URL: <http://nltk.org/> # For license information, see LICENSE.TXT """ Zen Chatbot talks in gems of Zen wisdom. This is a sample conversation with Zen Chatbot: ZC: Welcome, my child....
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # # InSilicoSeq documentation build configuration file, created by # sphinx-quickstart on Tue May 30 11:45:01 2017. # # This file is execfile()d with the current directory set to its # containing dir. # # Note that not all possible configuration values are present in this ...
from site_settings.models import GATEWAY_CAN_EDIT_SUBSCRIPTION, GATEWAY_CAN_TOGGLE_SUBSCRIPTION, GATEWAY_CAN_CANCEL_SUBSCRIPTION API_CAPABILITIES = [GATEWAY_CAN_EDIT_SUBSCRIPTION, GATEWAY_CAN_CANCEL_SUBSCRIPTION]
# Copyright 2013-2022 Lawrence Livermore National Security, LLC and other # Spack Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) import glob import re import time from os.path import basename from subprocess import PIPE, Popen from sys import platform...
# Copyright 2019 The ROBEL 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 wr...
import string import numpy as np from numpy.testing import assert_array_equal from pandas import DataFrame, MultiIndex, Series from shapely.geometry import LinearRing, LineString, MultiPoint, Point, Polygon from shapely.geometry.collection import GeometryCollection from shapely.ops import unary_union from geopandas ...
from flask import Blueprint, render_template from src.extensions import db from src.models import Donated
# coding=utf-8 # Copyright 2020 The TF-Agents 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 # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable la...
''' Module to manage FreeBSD kernel modules ''' import os def __virtual__(): ''' Only runs on FreeBSD systems ''' return 'kmod' if __grains__['kernel'] == 'FreeBSD' else False def _new_mods(pre_mods, post_mods): ''' Return a list of the new modules, pass an kldstat dict before running m...
# from app import app # if __name__ == "__main__": # app.run()
from . import base, fields, mixins class File(base.TelegramObject, mixins.Downloadable): """ This object represents a file ready to be downloaded. The file can be downloaded via the link https://api.telegram.org/file/bot<token>/<file_path>. It is guaranteed that the link will be valid for at least 1...
import json import logging import random import warnings from collections import namedtuple from pyramid.settings import asbool import ujson from kinto.core.decorators import deprecate_kwargs from . import generators class Missing: """Dummy value to represent a value that is completely absent from an object. ...
import os import click from movie import Movie from scan import Scan from helper import Helper @click.command() @click.option('--endings', default='mp4, mkv', help='File-endings that are accepted as valid movie-files. ' + 'Default: [.mkv, .mp4]' ) @click.option(...
import math class Player: def __init__(self): pass # self.most_common = lambda : self.numbers.index(max(self.numbers)) + 1 def initcards(self,num1,num2,num3,num4,num_all): self.numbers = [num1,num2,num3,num4] self.num_all = num_all self.common = self.numbers.index(...
# coding: utf-8 """ Pure Storage FlashBlade REST 1.3 Python SDK Pure Storage FlashBlade REST 1.3 Python SDK, developed by [Pure Storage, Inc](http://www.purestorage.com/). Documentations can be found at [purity-fb.readthedocs.io](http://purity-fb.readthedocs.io/). OpenAPI spec version: 1.3 Contact: i...
fp = open('test.txt') output = "" for line in fp: line = line.strip() line = line.replace(" ", "") output+=line print(output)
from plumber import Behavior from plumber import PlumbingCollision from plumber import default from plumber import finalize from plumber import override from plumber import plumb from plumber import plumber from plumber import plumbifexists from plumber import plumbing from plumber.behavior import behaviormetaclass fro...
r""""Contains definitions of the methods used by the _DataLoaderIter workers to collate samples fetched from dataset into Tensor(s). These **needs** to be in global scope since Py2 doesn't support serializing static methods. """ import torch import re from torch._six import container_abcs, string_classes, int_classes...
from replit import clear from art import logo print(logo) bids = {} bidding_finished = False def find_highest_bidder(bidding_record): highest_bid = 0 winner = "" for bidder in bidding_record: bid_amount = bidding_record[bidder] if bid_amount > highest_bid: highest_bid = bid_...
from lightning_plus.api_basebone.drf.routers import SimpleRouter from .upload import views as upload_views router = SimpleRouter(custom_base_name="basebone-app") router.register("upload", upload_views.UploadViewSet) urlpatterns = router.urls
from rllab.envs.base import Step from rllab.misc.overrides import overrides from rllab.envs.mujoco.mujoco_env import MujocoEnv import numpy as np from rllab.core.serializable import Serializable from rllab.misc import logger from rllab.misc import autoargs from contextlib import contextmanager class SwimmerEnv(MujocoE...
import inspect import logging from datetime import timedelta from typing import Any, Tuple import pytest import prefect from prefect.core import Edge, Flow, Parameter, Task from prefect.engine.cache_validators import all_inputs, duration_only, never_use from prefect.engine.results import PrefectResult, LocalResult fr...
''' ''' import re from billy.scrape.actions import Rule, BaseCategorizer committees = [ u"Veterans' Affairs", u'Agriculture and Agri-business Committee', u'Agriculture', u'Banking and Insurance', u'Banking', u'Children, Juveniles and Other Issues', u'Constitutional Revision', u'Counci...
from polls.models import Poll, Choice from django.contrib import admin class ChoiceInline(admin.TabularInline): model = Choice extra = 3 class PollAdmin(admin.ModelAdmin): fieldsets = [ (None, {'fields': ['question']}), ('Date information', {'fields': ['pub_date'], 'classes':...
"""Fix incompatible renames Fixes: * sys.maxint -> sys.maxsize """ # Author: Christian Heimes # based on Collin Winter's fix_import # Local imports z .. zaimportuj fixer_base z ..fixer_util zaimportuj Name, attr_chain MAPPING = {"sys": {"maxint" : "maxsize"}, } LOOKUP = {} def alternates(members): ...
import os import pytest THIS_DIR = os.path.dirname(os.path.abspath(__file__)) if __name__ == '__main__': # for profiling purposes... pytest.main(os.path.join(THIS_DIR, '../tests/test_parsyfiles_by_type.py'))
""" Launching point and supporting functions for database management tools. This module serves as the launching point for the database management tools. Backend-specific implementations are located within their specific modules and common functions and methods are included in this file. """ import numpy as np from t...
#!/usr/bin/env python3 import os import time import itertools import contextlib import fanout_utils def fanout_hls(context): context += { "starttime": int(time.time()), } cleanup(context) context += calculate_map_and_varmap(context) generate_master_playlists(context) fanout(context) print("Cleaning up")...
try: import unittest2 as unittest except ImportError: import unittest import sys sys.path.append('..') from pyrabbit import http class TestHTTPClient(unittest.TestCase): """ Except for the init test, these are largely functional tests that require a RabbitMQ management API to be available on loc...
import datetime import json from django.conf import settings from django.core.exceptions import ObjectDoesNotExist from django.db.models import Q from django.forms.formsets import formset_factory from django.shortcuts import get_object_or_404, redirect from django.utils.datastructures import MultiValueDictKeyError fro...
from django import test from django.conf import settings from django_2gis_maps.widgets import DoubleGisMapsAddressWidget class WidgetTests(test.TestCase): def test_render_returns_xxxxxxx(self): widget = DoubleGisMapsAddressWidget() results = widget.render('name', 'value', attrs={'a1': 1, 'a2': 2})...
from cs50 import get_int x = get_int("x: ") y = get_int("y: ") print(f"x + y = {x + y}") print(f"x - y = {x - y}") print(f"x * y = {x * y}") print(f"x / y = {x / y}") print(f"x mod y = {x % y}")
""" Modified state columns in executions table Revision ID: a472b5ad50b7 Revises: e1a50dae1ac9 Create Date: 2021-01-21 13:25:45.815775 """ import sqlalchemy as sa from alembic import op # TODO: import DEFAULT EXECUTION CODE HERE # revision identifiers, used by Alembic. revision = "a472b5ad50b7" down_revision = "e1a...
# 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 json import warnings import pulumi import pulumi.runtime from .. import utilities, tables class Route(pulumi.CustomResource): ...
from __future__ import print_function import os import utils import argparse import point import one_step_approximator from IPython.core.debugger import Pdb MAX = float('inf') def print_output(output,output_file): if output_file == '': fh = None else: fh = open(output_file,'w') # pri...
""" This code has been a variation of geomet: https://github.com/geomet/geomet It has been modified under the Apache 2.0 license to fit the needs of the Esri JSON specificaction as defined here: https://developers.arcgis.com/documentation/common-data-types/geometry-objects.htm """ import binascii import struct from ._...
#!/usr/bin/env python # -*- coding: utf-8 -*- import simplejson as json from alipay.aop.api.constant.ParamConstants import * class ContentPrizeInfoModel(object): def __init__(self): self._prize_id = None self._prize_logo = None self._prize_name = None @property def prize_id(self...
"""Common IO api utilities""" from __future__ import annotations import bz2 import codecs from collections import abc import dataclasses import gzip from io import BufferedIOBase, BytesIO, RawIOBase, StringIO, TextIOWrapper import mmap import os from typing import IO, Any, AnyStr, Dict, List, Mapping, Optional, Tuple,...
# Copyright (c) Facebook, Inc. and its affiliates. # All rights reserved. # # This source code is licensed under the license found in the # LICENSE file in the root directory of this source tree. # import os import random import numpy as np import torch from torch import nn from typing import Dict def to_device(data...
import numpy as np from .support import pdfMetalog, quantileMetalog def pdf_quantile_builder(temp, y, term_limit, bounds, boundedness): """Builds the metalog pdf and quantile arrays based on the a coefficients found by fitting metalog distribution. Args: temp (:obj: `numpy.ndarray` of type float): Ar...
# # Copyright (c) 2021 Airbyte, Inc., all rights reserved. # import concurrent import json from abc import ABC, abstractmethod from copy import deepcopy from datetime import datetime from functools import lru_cache from operator import itemgetter from traceback import format_exc from typing import Any, Iterable, Iter...
# -*- coding: utf-8 -*- """Python's built-in :mod:`functools` module builds several useful utilities on top of Python's first-class function support. ``funcutils`` generally stays in the same vein, adding to and correcting Python's standard metaprogramming facilities. """ from __future__ import print_function import s...
# coding=utf-8 # Author: Rafael Menelau Oliveira e Cruz <rafaelmenelau@gmail.com> # # License: BSD 3 clause import numpy as np from deslib.dcs.base import BaseDCS class APosteriori(BaseDCS): """A Posteriori Dynamic classifier selection. The A Posteriori method uses the probability of correct classificatio...
# Generated by Django 2.2.5 on 2020-03-08 07:42 from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): initial = True dependencies = [ ('leads', '__first__'), ] operations = [ migrations.CreateModel( name='Contac...
import sys from rpython.rlib.listsort import make_timsort_class from rpython.rlib.objectmodel import specialize from rpython.rlib.rstring import StringBuilder from rpython.rlib.rsre.rsre_core import ( OPCODE_LITERAL, OPCODE_LITERAL_IGNORE, OPCODE_SUCCESS, OPCODE_ASSERT, OPCODE_MARK, OPCODE_REPEAT, OPCODE_ANY, ...