text
stringlengths
2
999k
""" Default Strategy """ from .abstract_strategy import AbstractStrategy from .anchor import Anchor from .hierarchy import Hierarchy from ..config.urls_parser import UrlsParser from ..helpers import is_number, to_json class DefaultStrategy(AbstractStrategy): """ DefaultStrategy """ dom = None de...
from os import getenv env = getenv('FLASK_ENV') if not env: raise RuntimeError("Missing FLASK_ENV for target configuration!") # make these users admins, triggered when they view their user page MAKE_ADMIN = ['you@mail.com'] # mail config for flask-security MAIL_USERNAME = 'my.barman@gmail.com' MAIL_PASSWORD = "p...
# -*- coding: utf-8 -*- # Generated by Django 1.10.6 on 2017-04-28 17:37 from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('bot', '0002_auto_20170413_1938'), ] operations = [ migrations.AlterField( ...
# Copyright 2013-2021 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) from spack import * class SpliceH(AutotoolsPackage): """Simple package with one optional dependency""" homepage...
# -*- coding: utf-8 -*- # Copyright 2020-2022 CERN # # 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...
# import pandas as pd import numpy as np def read_csv_file(method, file, type, count): # AttributeError: 'str' object has no attribute 'astype' # method = method.astype(str) # file = file.astype(str) # type = type.astype(str) # count = count.astype(str) # csv_file = pd.read_csv...
# Copyright 2009 Brian Quinlan. All Rights Reserved. # Licensed to PSF under a Contributor Agreement. __author__ = 'Brian Quinlan (brian@sweetapp.com)' import collections import functools import logging import threading import time FIRST_COMPLETED = 'FIRST_COMPLETED' FIRST_EXCEPTION = 'FIRST_EXCEPTION' ALL_COMPLETED...
""" Copyright (C) 2019 F.Hoffmann-La Roche Ltd 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, d...
""" Multi-Opt strategy that uses a joint GP instead of many GPs. """ from __future__ import division from argparse import Namespace from copy import deepcopy from dragonfly.gp.euclidean_gp import euclidean_gp_args from dragonfly.utils.option_handler import get_option_specs, load_options from util.misc_util import buil...
# Copyright 2014 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 agre...
from os import path import autolens as al import pytest from autolens.mock import mock pytestmark = pytest.mark.filterwarnings( "ignore:Using a non-tuple sequence for multidimensional indexing is deprecated; use `arr[tuple(seq)]` instead of " "`arr[seq]`. In the future this will be interpreted as an a...
from __future__ import absolute_import import sys # Assumes local installation of FAISS sys.path.append("faiss") import numpy import ctypes import faiss from ann_benchmarks.algorithms.base import BaseANN # Implementation based on # https://github.com/facebookresearch/faiss/blob/master/benchs/bench_gpu_sift1m.py class ...
#encoding:utf-8 from torch.utils import data import torch as t import numpy as np import random from glob import glob class StackData(data.Dataset): def __init__(self,data_root,labels_file): self.data_files_path=glob(data_root+"*val.pth") self.model_num=len(self.data_files_path) self.label_f...
# # PySNMP MIB module HH3C-SNA-DLSW-MIB (http://snmplabs.com/pysmi) # ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/HH3C-SNA-DLSW-MIB # Produced by pysmi-0.3.4 at Wed May 1 13:29:40 2019 # On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4 # Using Python version 3.7.3 (default, Ma...
#!/usr/bin/env python # coding=utf-8 # Copyright [2017] [B2W Digital] # # 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...
"""entry point for twitoff flask application""" from .app import create_app # create object inside 'twitoff' package namespace # packages have __init__.py APP = create_app()
import logging log = logging.getLogger(__name__) class BaseValidatorException(Exception): def __init__(self, message): Exception.__init__(self, message) log.error(message) class BaseValidator(object): def __init__(self, params): self.params = params # self.validate() ""...
# Version check example test # # Copyright (c) 2018 Red Hat, Inc. # # Author: # Cleber Rosa <crosa@redhat.com> # # This work is licensed under the terms of the GNU GPL, version 2 or # later. See the COPYING file in the top-level directory. from avocado_qemu import Test class Version(Test): """ :avocado: t...
import mock import pytest from scrapy.utils.test import get_crawler from scrapy.exceptions import NotConfigured from sh_scrapy.diskquota import DiskQuota from sh_scrapy.diskquota import DiskQuotaDownloaderMiddleware from sh_scrapy.diskquota import DiskQuotaSpiderMiddleware def test_disk_quota_disabled(): crawler...
import logging from xmlrpc.client import SERVER_ERROR from requests.auth import HTTPBasicAuth from requests_oauthlib import OAuth2Session from oauthlib.oauth2 import BackendApplicationClient import time from data import Record, HoldingUpdateResult log = logging.getLogger(__name__) log.setLevel(logging.INFO) class Oc...
from .models import ObservationPoint, Observation from rest_framework import serializers import datetime class ObservationPointSerializer(serializers.ModelSerializer): latest_observation = serializers.SerializerMethodField() class Meta: model = ObservationPoint fields = ('id', ...
# Import libraries import numpy as np from flask import Flask, request, jsonify import pickle import os os.chdir('/home/sunil/Desktop/Great Lakes') # Load the model model = pickle.load(open('finalized_model.sav','rb')) app = Flask(__name__) @app.route('/api',methods=['POST']) def predict(): # Get the data from the ...
# Copyright (c) 2015-2018 Cisco Systems, 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 limitation the # rights to use, copy, modify, merge...
""" A Allen-Cahn equation .. codeauthor:: David Zwicker <david.zwicker@ds.mpg.de> """ from typing import Callable # @UnusedImport import numpy as np from ..fields import ScalarField from ..grids.boundaries.axes import BoundariesData from ..tools.docstrings import fill_in_docstring from ..tools.numba import jit, n...
""" LC 70 You are climbing a staircase. It takes n steps to reach the top. Each time you can either climb 1 or 2 steps. In how many distinct ways can you climb to the top? Example 1: Input: n = 2 Output: 2 Explanation: There are two ways to climb to the top. 1. 1 step + 1 step 2. 2 steps Example 2: Input: n = 3 O...
#!/usr/bin/python # Copyright (c) 2017, 2021 Oracle and/or its affiliates. # This software is made available to you under the terms of the GPL 3.0 license or the Apache 2.0 license. # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) # Apache License v2.0 # See LICENSE.TXT for d...
async def verifica_canal_online(self, dados): _aux_stream = await self.bot._http.get_streams(user_ids = [dados['canal_id']]) get_stream = [{'type': 'None'}] if _aux_stream == [] else _aux_stream get_stream = get_stream[0] _stream_online = True if get_stream['type'] == 'live' else False return _strea...
# sm_proc_job.py import sagemaker from sagemaker.processing import ScriptProcessor, ProcessingInput import boto3 import os import sys from time import gmtime, strftime from airflow.models import Variable def sm_proc_job(role, sess, bucket, spark_repo_uri, base_job_name, **context): timestamp_prefix = Variable.get...
class Node: def __init__(self, data, left=None, right=None): self.data = data self.left = left self.right = right def getDiameter(root, diameter): if root is None: return 0, diameter left_height, diameter = getDiameter(root.left, diameter) right_height, diameter = ge...
# -*- coding: utf-8 -*- """ Handle the response 'algorithm' (also see EUDAT-B2STAGE/http-api-base#7) force_response (base.py) or simple return [ResponseElements()] [obj / (content,status) / (content,status,headers)] | | ----------------...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # # Syntax: mkdoc.py [-I<path> ..] [.. a list of header files ..] # # Extract documentation from C++ header files to use it in Python bindings # import os import sys import platform import re import textwrap from clang import cindex from clang.cindex import CursorKind ...
# ------------------------------------------------------------------------------ # MIT License # # Copyright (c) 2021, Hieu Pham. All rights reserved. # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # i...
"""Copyright 2021 Google LLC. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at https://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing,...
#!/usr/bin/env python3 import sys import socket import time try: import netifaces as ni except: print("netifaces package not finded") print("Please install. pip3 install netiface") exit() PORT = 56665 def get_all_ip_address(): """Return the list of IPs of all network interfaces. If broadcast ...
locations={0:"you are sitting in front of a computer learning python", 1:"You are standing at the end of a road", 2:"You are at the top of a hill", 3:"You are inside a building, a well house for a small stream", 4:"you are in a valley, beside a stream", 5:"You...
import os def remove_files(files): """ Remove files from disk args: files (str or list) remove all files in 'files' """ if isinstance(files, (list, tuple)): for f in files: if os.path.isfile(os.path.expanduser(f)): os.remove(f) elif isinstance(files, str):...
# coding:utf-8 import argparse import json import time, datetime from ping3 import ping import subprocess import prometheus_client from flask import Flask, Response from prometheus_client import Gauge from prometheus_client.core import CollectorRegistry app = Flask(__name__) # 定义一个仓库 REGISTRY = CollectorRegistry(a...
from abc import abstractmethod from typing import Optional, Sequence, Type, TypeVar, cast import attr from ebl.lemmatization.domain.lemmatization import ( Lemma, LemmatizationError, LemmatizationToken, ) from ebl.transliteration.domain import atf as atf from ebl.transliteration.domain.converters import co...
#!/usr/bin/env python # 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...
from django.contrib import admin # Register your models here. from .models import Post, Group class PostAdmin(admin.ModelAdmin): list_display = ( 'pk', 'text', 'pub_date', 'author', 'group', ) list_editable ...
import math import random import sys from PIL import Image, ImageDraw try: from scipy.spatial import cKDTree as KDTree import numpy as np IMPORTED_SCIPY = True except ImportError: IMPORTED_SCIPY = False BACKGROUND = (255, 255, 255) TOTAL_CIRCLES = 2000 color = lambda c: ((c >> 16) & ...
#!/usr/bin/python # encoding=utf-8 """ @Author : Don @Date : 7/23/2020 8:12 PM @Desc : """ import os import platform import sys from loguru import logger class ExtraArgument: create_venv = False def init_parser_scaffold(subparsers): sub_parser_scaffold = subparsers.add_parser( "startproj...
from matplotlib import pyplot as plt class TrainingHistory(object): def __init__(self): self.iteration = [] self.loss_history = [] def add_loss_history(self, iteration, loss): self.iteration.append(iteration) self.loss_history.append(loss) # def get_last(self)...
""" This module contains classes to train/test/classify conditional random field machine learning method """ import os import traceback import numpy as np import re import nltk import time from pystruct.models import ChainCRF from pystruct.learners import FrankWolfeSSVM from flask import current_app try: import...
import math def get_epsilon_of_fedmd_nfdp(n, k, replacement=True): """Return epsilon of FedMD-NFDP Args: n (int): training set size k (int): sampling size replacement (bool, optional): sampling w/o replacement. Defaults to True. Returns: float: epsilon of FedMD-NFDP "...
import dataclasses as dc import os import socket import subprocess from pathlib import Path from typing import Optional import click from click import Context from flask import current_app from flask import Flask from flask.cli import AppGroup __all__ = ["celery", "add_celery_commands", "CeleryRC"] celery = AppGroup...
#!/usr/bin/env python # Licensed to Cloudera, Inc. under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. Cloudera, Inc. licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you ma...
# Copyright 2019 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...
import os import io import shutil import sys import zipfile pkgdir = '/tmp/sls-py-req' tempdir = '/tmp/_temp-sls-py-req' requirements_zipname = '.requirements.zip' sys.path.append(pkgdir) if not os.path.exists(pkgdir): if os.path.exists(tempdir): shutil.rmtree(tempdir) default_layer_root = '/opt' ...
from adafruit_circuitplayground.express import cpx cpx.pixels.brightness = 1.0 cpx.pixels[0] = (255, 0, 0) cpx.pixels.brightness = 0.5 cpx.pixels.brightness = 0.10
"""Tests for package name identifiers."""
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Sat Apr 6 22:49:06 2019 @author: sarashashaani casp dataset most recent last_working_withuf max level = 3 min node size = 100 split quantile = 20 crps quantil = N/A """ import numpy as np from scipy import random as sr from random import sample import a...
import pyttsx3 import PyPDF2 from PyPDF2 import * from tkinter import * from tkinter import filedialog import os def pdfmerger(): n=int(input("no.of pdf to merge")) pdf=[] Pdfwriter=PyPDF2.PdfFileWriter() root=Tk() root.update() root.withdraw() for i in range(n): pdf_to_merge=filedi...
# Copyright (c) Facebook, Inc. and its affiliates. # # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. import torch import sys from fairseq import utils class SequenceScorer(object): """Scores the target for a given source sentence.""" ...
#!/usr/bin/env python2 import serial, os, time ser = serial.Serial('/dev/ttyACM0', 9600) while True: i = ser.read(); if (i=='1'): print "Shutting down..." time.sleep(3) os.system("shutdown -h now") exit()
from __future__ import print_function from django.core.management.base import BaseCommand, CommandError from waffle.models import Sample class Command(BaseCommand): def add_arguments(self, parser): parser.add_argument('-l', '--list', action='store_true', dest='list_sample', d...
# Copyright 2015 SimpliVity Corp. # # 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...
# (c) Copyright 2017-2018 SUSE 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 writ...
""" Copyright 2020 The Magma Authors. This source code is licensed under the BSD-style license found in the LICENSE file in the root directory of this source tree. Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES O...
//problem can be found here https://leetcode.com/problems/two-sum/ class Solution(object): def twoSum(self, nums, target): """ :type nums: List[int] :type target: int :rtype: List[int] """ if not nums: return [] seen = {} seen[nums[0]] = 0 ...
# Copyright 2013 IBM Corp. # # 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 agree...
from fastapi import APIRouter from app.api.endpoints import auth, users api_router = APIRouter() api_router.include_router(auth.router, prefix="/auth", tags=["auth"]) api_router.include_router(users.router, prefix="/users", tags=["users"])
# pyre-strict """Provides version information read from package metadata.""" import sys if sys.version_info >= (3, 8): # pragma: no cover from importlib import metadata as importlib_metadata else: # pragma: no cover import importlib_metadata def _read_version() -> str: try: return importlib_m...
import datetime import os import shutil import time from collections import namedtuple from copy import copy import toolz as t from boltons import funcutils as bfu from . import artifact_hasher as ah, repos as repos, serializers as s, utils from ._dependencies import dependencies from .hashing import file_hash, hash ...
# 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 from ... import _utilities, _tables __a...
import requests, json, time, os host = 'http://kdjo.me' colorCheckRoute = '/updateDaniBox' contactRoute = '/edToDaniContact' lastIDColor = None lastIDContact = None changeString = "sudo pm2 start 'sudo python3 /home/fall/shadowBox/color.pyTEXTTOREPLACE' --name color" currChange = "sudo pm2 start 'sudo python3 /home/f...
from django.contrib import admin from django.contrib.auth.admin import UserAdmin from todo_app import models admin.site.register(models.User, UserAdmin) admin.site.register(models.Todo)
import os # The current package version __version__ = '0.0.1' PACKAGE_PATH = os.path.dirname(os.path.realpath(__file__)) PROLOG_PATH = os.path.join(PACKAGE_PATH, 'prolog')
# Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT license. from .Embedding import Embedding, EmbeddingConf from .BiLSTM import BiLSTM, BiLSTMConf from .BiLSTMLast import BiLSTMLast, BiLSTMLastConf from .BiGRU import BiGRU, BiGRUConf from .BiGRULast import BiGRULast, BiGRULastConf from...
#!/usr/bin/python # # Copyright 2019 Polyaxon, 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 o...
import lenstronomy.Util.util as util import lenstronomy.Util.simulation_util as sim_util import matplotlib.pyplot as plt import numpy as np from mpl_toolkits.axes_grid1 import make_axes_locatable from lenstronomy.LensModel.lens_model_extensions import LensModelExtensions from lenstronomy.Data.imaging_data import Image...
from collections import OrderedDict import json import sys import subprocess import shlex import os import argparse import shutil import functools import pkg_resources import yaml from ._r_components_generation import write_class_file from ._r_components_generation import generate_exports from ._py_components_genera...
import unitest import pytest from dldp.utils import mask_generation_asap as masap slide_path = '/home/wli/Downloads/CAMELYON16/training/tumor' anno_path = '/home/wli/Downloads/CAMELYON16/training/Lesion_annotations' mask_path = '/home/wli/Downloads/CAMELYON16/masking2' def test_mask_asap_read_file(): make_mask = ...
# -- coding: utf-8 -- from flask import request from flask_restx import Resource from ..dtos import CalculationDto from ..services import ( create_calc, update_calc, delete_calc, select_calc, select_calc_list ) ns = CalculationDto.ns _data_calculation = CalculationDto.data_calculation _input_calcul...
# 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 from ... import _utilities, _tables from...
# Copyright (c) Meta Platforms, Inc. and affiliates. # # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. # pyre-strict import os from unittest import TestCase from unittest.mock import patch, Mock from fbpcp.error.pcp import PcpError from fbpcs...
# Licensed to Elasticsearch B.V. under one or more contributor # license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright # ownership. Elasticsearch B.V. licenses this file to you under # the Apache License, Version 2.0 (the "License"); you may # not use ...
# Copyright (c) 2022, repoteq and contributors # For license information, please see license.txt # import frappe from frappe.model.document import Document class TestTranslate(Document): pass
"""Plots for spatial measures and analyses.""" from copy import deepcopy import numpy as np import matplotlib.pyplot as plt from scipy.ndimage import gaussian_filter from spiketools.plts.utils import check_ax, savefig, set_plt_kwargs ##################################################################################...
#!/usr/bin/env python # for..else example def do_for_else(foo): for i in foo: if i == 0: break else: print("i was never 0") print ('running with no 0') do_for_else([1,2,3,4,5,6]) print ('running with 0') do_for_else([0,2,3,4,5,6])
# -*- coding: utf-8 -*- from tableausdk import * from tableausdk.HyperExtract import * import tableauserverclient as TSC TABLEAU_FORMAT = 'hyper' # Because of a bug in Tableau, we need to load Tableau before pandas. # See http://community.tableau.com/thread/156790 for more info import dataiku import os from dataiku...
import wordgraph as wg from timeit import default_timer as timer import profile def main(): glove_vector_path = '/Users/andrei/code/work/bergelsonlab/semantic_nets/model/glove_unit_42b_300.npy' glove_vocab_path = '/Users/andrei/code/work/bergelsonlab/semantic_nets/model/dict_glove_42b_300' G = wg.WordGra...
#!/usr/bin/env python2 # This file is part of the OpenMV project. # # Copyright (c) 2013-2019 Ibrahim Abdelkader <iabdalkader@openmv.io> # Copyright (c) 2013-2019 Kwabena W. Agyeman <kwagyeman@openmv.io> # # This work is licensed under the MIT license, see the file LICENSE for details. # # An example script using pyope...
""" Script for the evolution gif of the pdfs obtained with qcdnum. The pdfs obtained by the DGLAP evolution equations, using qcdnum, are stored in files, containing each one a fixed q2 energy scale. The output files with the pdfs and x values are stored in the directory named output, inside qcdnum. Those output files ...
from django.db import models from django.urls import reverse # Create your models here. class School(models.Model): name = models.CharField(max_length=256) principal = models.CharField(max_length=256) location = models.CharField(max_length=256) def __str__(self): return self.name def get_...
import autolens as al import autolens.plot as aplt import os import pytest from os import path from autofit import conf directory = path.dirname(path.realpath(__file__)) @pytest.fixture(name="ray_tracing_plotter_path") def make_ray_tracing_plotter_setup(): return "{}/files/plots/ray_tracing/".format( ...
from collections import namedtuple import logging import re LintError = namedtuple("LintError", ["file", "line", "column", "code", "explanation"]) def parse(line): r""" Parse line into :class:`LintError`. >>> parse(r'source\arfile.py:55:16: BLK100 Black would make changes.') LintError(file='source\\...
import numpy as np import pytest import aesara from aesara.tensor.type import TensorType from aesara.typed_list.basic import TypedListVariable from aesara.typed_list.type import TypedListType from tests import unittest_tools as utt from tests.tensor.utils import rand_ranged class TestTypedListType: def setup_met...
# --------------------------------------------------------------------------------------------------------------------- # API Wars # utilities # v 1.0 # -----...
# -*- coding:utf-8 -*- from ciscoconfparse import CiscoConfParse from logzero import logger as log import logzero import re # from netaddr import IPNetwork, IPAddress # from ipaddress import IPv4Network import ipaddress from time import time ## v0.1a - 2015-06-01: add lastseen property ## v0.1b - 2016-02-02: add pr...
"""users table Revision ID: 8e10c7b8d018 Revises: Create Date: 2021-06-29 15:17:39.901847 """ from alembic import op import sqlalchemy as sa # revision identifiers, used by Alembic. revision = '8e10c7b8d018' down_revision = None branch_labels = None depends_on = None def upgrade(): # ### commands auto genera...
from typing import Dict, Optional, TextIO from aoc2019.intcode import Computer, read_program def run_robot(data: TextIO, painted: Optional[Dict[complex, int]] = None) -> Dict[complex, int]: if painted is None: painted = {} computer = Computer(read_program(data)) pos = 0j direction = 1j ...
# -*- coding: utf-8 -*- # Author : Jin Kim # e-mail : jinkim@seculayer.com # Powered by Seculayer © 2020 Solution Development 2 Team, R&D Center. # import random import numpy as np from hps.algorithms.HPOptimizationAbstract import HPOptimizationAbstract from hps.algorithms.HPOptimizerUtil import HPOptimizerUtil cl...
#!/usr/bin/env python import pickle import numpy as np #================================================================== ''' Goal: minimize the bandgap ''' #================================================================== organics = [ 'acetamidinium', 'ammonium', 'azetidinium', 'butylammonium', 'dimethylamm...
# Copyright 2013 VMware, 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 a...
# -*- coding:utf-8 -*- # @time :2020/8/13 # @IDE : pycharm # @author :lxztju # @github : https://github.com/lxztju # @Emial : lxztju@163.com import torch import argparse import os import torch import torch.nn as nn import torch.optim as optim from data import train_dataloader,train_datasets, val_datasets, val_datalo...
# -*- coding: utf-8 -*- import os import pandas as pd import camelot from camelot.core import Table, TableList from .data import * testdir = os.path.dirname(os.path.abspath(__file__)) testdir = os.path.join(testdir, "files") def test_load_entire(): def append(box): try: return box.get_text...
import sys import unittest from unittest.mock import patch from contextlib import contextmanager from io import StringIO class TestCase(unittest.TestCase): maxDiff = None @contextmanager def assertOutput(self, expected, *, argv=[], strip_trailing=True): fake_stdout = StringIO() with patch...
# empirical cdf # fig 11.17 of 'Bayeysian Modeling and Computation' import numpy as np import matplotlib.pyplot as plt import pyprobml_utils as pml import arviz as az from scipy import stats import matplotlib.pyplot as plt import seaborn import seaborn as sns seaborn.set() seaborn.set_style("whitegrid") # Font si...
import filelock import numpy as np import os from chainer.dataset import download from chainercv.chainer_experimental.datasets.sliceable import GetterDataset from chainercv import utils root = 'pfnet/chainercv/cub' url = 'http://www.vision.caltech.edu/visipedia-data/CUB-200-2011/'\ 'CUB_200_2011.tgz' prob_map_u...