text
stringlengths
957
885k
# -*- coding: utf-8 -*- """ Test the publisher class """ import pytest import numpy as np import struct import zmq import time import datetime as dt from ..message import ArrayMessage from ..sugar import Publisher from .. import array as array_api from .test_base import BaseContainerTests from ...tests.test_helpers i...
<reponame>Etxea/gestion_eide_web from django.shortcuts import render from django.views.generic import DetailView, ListView, CreateView, UpdateView, DeleteView from django.views.generic.edit import DeletionMixin from django.shortcuts import get_object_or_404 from django.contrib.auth.decorators import login_required from...
<reponame>DanielCohenHillel/pyEPR # Zlatko from pyEPR import * import matplotlib.pyplot as plt if 1: # Specify the HFSS project to be analyzed project_info = ProjectInfo(r"C:\Users\rslqulab\Desktop\zkm\2017_pyEPR_data\\") project_info.project_name = '2017-10 re-sim SM22-R3C1' project_info.design_name...
<gh_stars>0 # coding: utf-8 # In[1]: from profiler.core import * # ## 1. Instantiate Engine # * workers : number of processes # * tol : tolerance for differences when creating training data (set to 0 if data is completely clean) # * eps : error bound for inverse covariance estimation (since we use conserva...
#!/usr/bin/env python # -*- coding: utf-8 -*- """ Utility functions including those for writing to csv and json files and doing simple HTTP requests using the requests library classes: SimpleHTTPJSON SWVersions functions: to_file Copyright 2017, <<EMAIL>> See COPYRIGHT for det...
"""The new semantic analyzer (work in progress). Bind names to definitions and do various other simple consistency checks. It also detects special forms such as NamedTuple and cast(). Multiple analysis iterations may be needed to analyze forward references and import cycles. Each iteration "fills in" additional bindin...
"""Multi-agent learning algorithms. Supports each single-agent learning algorithm playing independently with itself and also supports simplified action decoding, additive value decomposition (aka VDN), and centralized value functions. Inheritance structure is: MultiAgentLearner -> IndependentQLearner -> Indepe...
import logging import time from collections import defaultdict from os.path import join as joinpath from typing import Dict, List, Optional import numpy as np from monty.json import MSONable from monty.serialization import dumpfn from pymatgen import Spin, Structure from tabulate import tabulate from amset.constants ...
<reponame>harunpehlivan/shapeshop """The main code for: * creating the training data, * building and training the neural network model, * and image generation. """ from __future__ import print_function import numpy as np import time from time import sleep import random from keras import backend as K from ...
<reponame>matheuscas/pyfuzzy_toolbox import arff import time import datetime import csv import numpy as np from addict import Dict def create_arff_dict(list_of_attributes_and_data, relation): arff_dict = Dict() arff_dict.relation = relation arff_dict.attributes = [] arff_dict.data = [] arff_dict...
import math import numpy as np import tensorflow as tf import time import os import sys sys.path.append('../') from collections import Counter from copy import deepcopy from keras.utils import to_categorical from tools.io import extract_pids, load_obj, store_obj, write_recommendations_to_file print ('#' * 80) print (...
# # -*- coding: utf-8 # # Copyright (c) 2017 <NAME>. All rights reserved. # @gem('Dravite.Euclid') def gem(): # #<copyright> # # Code copied from: # # https://en.wikibooks.org/wiki/Algorithm_Implementation/Mathematics/Extended_Euclidean_algorithm # # As of 2017-03-02, when...
#!/usr/bin/env python # # Copyright 2014 - 2016 The BCE Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the license.txt file. # import bce.utils.mathml.base as _base import bce.utils.mathml.types as _types OPERATOR_PLUS = 1000 OPERATOR_MINUS = 1001 ...
<filename>codewars/level5/PrimeswithTwoEvenandDoubleEvenJumps.py ''' Think in all the primes that: if p is prime and p < n , all these following numbers (p + 2) , (p + h) and (p + 2h) are all primes, being h an even number such that: 2 <= h <= hMax Your function, give_max_h() , will receive 2 arguments n and hMax . I...
<reponame>xu1991/open<filename>searx/engines/wolframalpha_api.py # Wolfram Alpha (Science) # # @website https://www.wolframalpha.com # @provide-api yes (https://api.wolframalpha.com/v2/) # # @using-api yes # @results XML # @stable yes # @parse url, infobox from lxml import etree from searx.url_uti...
<reponame>lucawen/adb-perm import os import subprocess import sys import re from shutil import which SYSTEM_PACKAGES_REQUIRED = ['adb', 'aapt'] def parse_device_list(str_item): raw_list = filter(None, str_item.splitlines()[1:]) devices = [] for raw_device in raw_list: parts = raw_device.split() ...
<reponame>kishorkunal-raj/qpid-dispatch # # 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, Ve...
<filename>networks/unet_for_TU.py import math from os.path import join as pjoin from collections import OrderedDict import torch import torch.nn as nn import torch.nn.functional as F class DoubleConv(nn.Module): def __init__(self, in_channels, out_channels): super(DoubleConv, self).__init__() sel...
# Imports from 3rd party libraries import dash import dash_bootstrap_components as dbc import dash_core_components as dcc import dash_html_components as html import dash_daq as daq from dash.dependencies import Input, Output import pandas as pd import plotly.express as px import numpy as np from joblib import load # I...
import torch.nn as nn import torch.nn.functional as F from torchvision import models import torch import torch.nn as nn import torchvision import torch import torch.nn as nn import torch.nn.functional as F from functools import partial from torch.autograd import Variable import numpy as np import misc as ms from skima...
<filename>library/selenium_actions.py from selenium.common.exceptions import NoSuchElementException from selenium.webdriver.common.action_chains import ActionChains from selenium.webdriver.common.keys import Keys from selenium.webdriver.common.by import By from selenium.webdriver.support.wait import WebDriverWait from ...
<reponame>qosf/quantum-bench<filename>quenchmark/meta_analysis.py import datetime as dt from functools import reduce from difflib import SequenceMatcher as SM from cached_property import cached_property from github import Github from config import OAUTH_TOKEN class Repository(object): osi_license_ids = ["MPL...
r"""@package motsfinder.exprs.basics Collection of basic numexpr.NumericExpression subclasses. """ from builtins import range import math from mpmath import mp from ..numutils import binomial_coeffs from .numexpr import NumericExpression, SimpleExpression from .evaluators import EvaluatorBase, EvaluatorFactory, Tr...
<reponame>paulbeka/bank2Budget from __future__ import print_function import ynab from ynab.rest import ApiException from pprint import pprint import json import itertools import os from datetime import datetime # from urllib.parse import urljoin # import os # import sys # # insert at 1, 0 is the script path (or '' in ...
<filename>comment_reporter/comment_report_nlg_service.py import logging import random from collections import defaultdict from typing import Dict, Iterable, List, Optional, Tuple from .resources.general_topic_modeling_resource import GeneralTopicModelingResource from .resources.sentiment_stats_resource import Sentimen...
# -*- coding: utf-8 -*- import xml.etree.ElementTree as ET import os tree = ET.parse('Chapter11_XML02.xml') # 读取文件 root = tree.getroot() # 获取根元素 print(root.tag, root.attrib) # 根元素的标签和属性 print(root[1][2].text) # 通过索引访问特定的元素 for child in root: # 迭代子节点的标签和属性 print(child.tag, child.attrib) for neighbor in root....
<filename>test/xiaoshizhi.py # coding: utf-8 ''' 小市值择时买卖 配置指定频率的调仓日,在调仓日每日指定时间,计算沪深300指数和中证500指数当前的20日涨 幅,如果2个指数的20日涨幅有一个为正,则进行选股调仓,之后如此循环往复。 止损策略:每日指定时间,计算沪深300指数和中证500指数当前的20日涨幅,如果2个指数涨幅 都为负,则清仓,重置调仓计数,待下次调仓条件满足再操作 版本:v1.2.7 日期:2016.08.13 作者:Morningstar ''' import tradestat #from blacklist import * # blacklist....
<filename>app.py # import necessary modules import streamlit as st import re import pandas as pd import numpy as np import matplotlib.pyplot as plt import scipy.stats as stat import glob as glob import os import time import altair as alt # import local .py scripts with function definitions/declarations import Compare_...
import unittest import mock import redisobj class TestRedisDB(unittest.TestCase): @mock.patch("redis.StrictRedis") def setUp(self, redis_conn): self.rdb = redisobj.RedisDB() self.mock_db = redis_conn.return_value def test_repr(self): self.assertEquals(str(self.rdb), "<RedisDB hos...
from __future__ import unicode_literals from mopidy import httpclient, models from mopidy_jellyfin.utils import cache import mopidy_jellyfin from .http import JellyfinHttpClient from unidecode import unidecode import os import logging from collections import OrderedDict, defaultdict import sys if sys.version.startswit...
#!/usr/bin/env python3 # Copyright 2015 The Chromium OS Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. import unittest from unittest import mock from cros.factory.device import device_utils class VPDTest(unittest.TestCase): # pyl...
"""Test configuration functions.""" import pytest import logging import ambianic from ambianic.server import AmbianicServer from ambianic import server import os import pathlib def test_no_config(): conf = server._configure('/') assert not conf def test_log_config_with_file(): log_config = { 'fi...
import numpy as np import keras.backend as K import os, shutil ########################### Sentences loading ############################## class MySentences(object): def __init__(self, dirname): """ Sentences loading class A memory-friendly iterator for word2vec model. # Argum...
import os import sys import time import subprocess import win32gui import re import win32com.client as comclt import sublime from .helper import SingleHwnd, SingleProcess, WinProcess, move_mouse_to from SasSubmit.settings import SessionInfo def standardize_name(name): if name == "chrome": return "chrome.exe" ...
<filename>gtk/position-logger/position_logger.py #! /usr/bin/env python # -*- coding: utf-8 -*- version = '0.1' import os, sys import gtk import time import linuxcnc import gobject class app: def __init__(self): self.builder = gtk.Builder() self.path = os.path.abspath(os.path.dirname(sys.argv[0])) self.ui = os...
<gh_stars>1-10 from OCC.Extend.TopologyUtils import TopologyExplorer from OCC.Core.GProp import GProp_GProps from OCC.Core.BRepAdaptor import BRepAdaptor_Curve, BRepAdaptor_Surface, BRepAdaptor_CompCurve, BRepAdaptor_Curve2d from OCC.Core.gp import * from OCC.Core.BRepTools import * from OCC.Core.BRep import * from OCC...
import numpy as np def get_unit_drift_rate(raw_voltage_backend, fftlength, int_factor=1): """ Calculate drift rate corresponding to a 1x1 pixel shift in the final data product. This is equivalent to dividing the fine channelized frequency resolution with the...
import numpy as np import torch from hbconfig import Config from sklearn.datasets import make_moons from torch.utils.data import Dataset, DataLoader, ConcatDataset from torchvision import datasets, transforms from AutoAugment.autoaugment import ImageNetPolicy from miniimagenet_loader import read_dataset def get_load...
import requests from datetime import datetime, timedelta import apiKey import json keyMash = apiKey.apiMashape() def trovaGiornata(): ri = requests.get("https://sportsop-soccer-sports-open-data-v1.p.mashape.com/v1/leagues/serie-a/seasons/16-17/rounds", headers={"X-Mashape-Key": keyMash, "Accept": "application/json...
from __future__ import absolute_import from __future__ import division from __future__ import print_function from __future__ import unicode_literals from utils.collections import AttrDict import six import yaml import torch import torch.nn as nn from torch.nn import init import numpy as np import copy from ast import ...
from datetime import datetime, timedelta import dateutil import time import prometheus_client as pc from sqlalchemy import asc, desc from flask import ( render_template, flash, redirect, url_for, request, g, jsonify, current_app, Response, ) from app import db, documents from app.mod...
#!/usr/bin/env python # coding: utf-8 import simpy import datetime import pandas as pd import logging from enum import Enum import random from itertools import repeat from ruamel.yaml import YAML from datetime import timedelta log_filename = "logs-10.log" mainLogger = logging.getLogger() fhandler = logging.FileHandle...
<gh_stars>0 # -*- coding: utf-8 -*- # Generated by the protocol buffer compiler. DO NOT EDIT! # source: evmos/inflation/v1/genesis.proto """Generated protocol buffer code.""" from google.protobuf import descriptor as _descriptor from google.protobuf import message as _message from google.protobuf import reflection as ...
from __future__ import unicode_literals import csv import datetime import json import logging from collections import defaultdict from enum import Enum, unique from random import randint from django.conf import settings from django.contrib import messages from django.core import serializers from django.core.mail impo...
<reponame>gungorbudak/seten-cli<filename>seten/cli.py<gh_stars>0 """ This file is part of Seten which is released under the MIT License (MIT). See file LICENSE or go to https://github.com/gungorbudak/seten-cli/blob/master/LICENSE for full license details. """ import os import argparse from time import time from seten.m...
<filename>tools/blender26x/mh_utils/import_obj.py # ##### BEGIN GPL LICENSE BLOCK ##### # # 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 2 # of the License, or (at your ...
import argparse as ap import sys import gym import numpy as np import pong import pgagent import actorcriticagent2 import actorcriticagent class Params(object): def __init__(self): self.gamma = None self.lr = None self.lr2 = None self.er = None self.verbose = False ...
<gh_stars>0 # -*- coding: utf-8 -*- """High level API for extracting OBO content.""" from functools import lru_cache from typing import List, Mapping, Optional, Tuple, Union import pandas as pd from .cache_utils import cached_df, cached_mapping, cached_multidict from .getters import get from .identifier_utils impor...
<reponame>zhangxl97/leetcode<filename>1_100/Q_51_60.py<gh_stars>1-10 from typing import List from tabulate import tabulate from time import time class Solution: # N-Queens def solveNQueens(self, n: int) -> List[List[str]]: if n == 1: return [["Q"]] elif n == 2: return [...
from IPython.core.display import HTML from IPython.core.display import display import os import copy from qtpy.QtWidgets import QMainWindow, QFileDialog from qtpy import QtGui from collections import OrderedDict from __code import load_ui from .initialization import Initializer from .event_handler import MetadataTable...
<filename>eemt/eemt/parser.py from subprocess import Popen, PIPE from math import pow import os import re import sys import math import decimal class TiffParser(object): def __init__(self): """ Read tiff file info via gdalinfo command.""" # store file name ...
import numpy as np import matplotlib.pyplot as plot from week2.lr_utils import pre_process_data from week2.lr_utils import sigmoid # 初始化权重 w 和偏置单元 b 为一定维度的0向量 def initialize_with_zeros(dim): # dim, 1 外必须加(), np.zeros(dim, 1): 报错! w = np.zeros((dim, 1)) # 对应偏置单元bias的标量 b = 0 return w, b # 梯度下降...
import logging from typing import Sequence, Any, Mapping, MutableMapping import copy import json from uuid import uuid4 from enum import Enum, auto from dss.stepfunctions import _step_functions_start_execution from dss.util.time import RemainingTime from dss.util.types import JSON logger = logging.getLogger(__name__...
<reponame>brl0/kartothek import math import types from collections import OrderedDict import numpy as np import pandas as pd import pytest from kartothek.io.eager import store_dataframes_as_dataset from kartothek.io_components.metapartition import SINGLE_TABLE, MetaPartition from kartothek.io_components.read import d...
<filename>api/anubis/lms/submissions.py from datetime import datetime from typing import Dict, List, Optional, Tuple, Union from anubis.lms.assignments import get_assignment_due_date from anubis.models import ( Assignment, AssignmentRepo, AssignmentTest, Course, InCourse, Submission, Submis...
<filename>tests/test_transpy.py<gh_stars>0 from typing import Tuple from logging import getLogger, NullHandler, Logger import unittest import unittest.mock as mock from transpydata.TransPy import TransPy from transpydata.config.datainput import IDataInput from transpydata.config.dataprocess import IDataProcess from t...
<gh_stars>0 from django.contrib.auth.models import User from django.views import View from articles.models import Tag from utils.pages import Paginator from django.template import loader from articles.models import Article from django.http import JsonResponse from utils.decorators import fail_safe_api from utils.models...
<filename>structureimpute/explore/plot_two_shape_common_tx_pct.py from __future__ import print_function import matplotlib as mpl mpl.use('Agg') import matplotlib.pyplot as plt import seaborn as sns sns.set(style="ticks") sns.set_context("poster") plt.rcParams["font.family"] = "Helvetica" import sys, os from nested_dic...
<filename>torchreid/models/motnet.py<gh_stars>0 """ Code source: https://github.com/pytorch/vision """ from __future__ import division, absolute_import import re from collections import OrderedDict import torch import torch.nn as nn from torch.nn import functional as F from torch.utils import model_zoo import torchvisi...
<reponame>koconnor4/pyDIA import sys import os import numpy as np from astropy.io import fits from pyraf import iraf from io_functions import read_fits_file, write_image from image_functions import compute_saturated_pixel_mask, subtract_sky def transform_coeffs(deg, dx, xx, yy): a = np.zeros((deg + 1, deg + 1)) ...
<reponame>yuriyshapovalov/Prototypes # datetime - basic date and time types import datetime class DatetimeTest: def main(): print("Date object") x = datetime.date(2012, 11, 4) print("datetime.date(2012, 11, 4) = {}".format(x)) x = datetime.date.today() print("da...
#=============================================================================== # Copyright 2007 <NAME> # # 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/licens...
""" https://stackoverflow.com/questions/29362142/django-rest-framework-hyperlinkedidentityfield-with-multiple-lookup-args http://www.tomchristie.com/rest-framework-2-docs/api-guide/relations https://github.com/miki725/formslayer/blob/master/formslayer/pdf/relations.py#L7-L46 https://stackoverflow.com/questions/32038643...
import sys from board import * from gameConfig import * import gameConfig from bomberman import * from getch import * from bomb import bomb_plant import brick import os import time import random from enemy import Enemy from termcolor import colored # This is the main game file where game is running &print game score &...
from typing import List, Mapping from .text import get_env_file_names, capitalize, snake, add_python_indentation import os class CodeGen(): def __init__(self): self.file_content_dict: Mapping[str, str] = {} self.replacement_dict: Mapping[str, str] = {} def _create_dir_if_not_exist(self, fi...
#!/usr/bin/env python3 import re from columnplot.utility import file_exists from columnplot.variables import INVALID_DATA import dateutil.parser from datetime import datetime class ColumnGenerator(object): def __init__(self, datapath, params): file_exists(datapath) self.__enable_titleline = p...
import unittest from bin_optimize import optimize class Testing(unittest.TestCase): def test_happy_path(self): test_set = [ {'b1': [('a1', 600), ('a5', 250), ('a10', 400)], 'b2': [('a2', 400), ('a6', 500), ('a11', 200)], 'b3': [('a3', 700), ('a7', 200), ('a12', 300)]...
import unittest from unittest.mock import patch from string import printable import json from cdflow import ( CDFLOW_IMAGE_ID, InvalidURLError, fetch_account_scheme, get_image_id, parse_s3_url ) import boto3 from moto import mock_s3 from hypothesis import assume, given from hypothesis.strategies import diction...
from __future__ import unicode_literals import re import json import uuid import types import inspect import six import sqlalchemy from sqlalchemy import event from sqlalchemy.ext import declarative from sqlalchemy.dialects import postgresql from sqlalchemy.orm import Query, sessionmaker, configure_mappers from sqlalc...
<filename>bbavectors/datasets/dataset_custom.py from .base import BaseDataset import os import cv2 import glob import numpy as np from DOTA_devkit.ResultMerge_multi_process import mergebypoly class CUSTOM(BaseDataset): def __init__(self, data_dir, phase, input_h=None, input_w=None, down_ratio=None): super...
<reponame>cjsteel/python3-venv-ansible-2.10.5 #!/usr/bin/python from __future__ import (absolute_import, division, print_function) # Copyright 2019-2020 Fortinet, 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 Fr...
# -*- encoding: utf-8 -*- """ Copyright (c) 2019 - present AppSeed.us """ import time from flask.globals import request from app.home import blueprint from flask import render_template, redirect, url_for from flask_login import login_required, current_user from app import login_manager from jinja2 import TemplateNotFo...
<reponame>wimp-project/backend """empty message Revision ID: b6c3c9b60c69 Revises: Create Date: 2020-03-28 15:59:25.954564 """ from alembic import op import sqlalchemy as sa # revision identifiers, used by Alembic. revision = 'b6c3c9b60c69' down_revision = None branch_labels = None depends_on = None def upgrade(...
<gh_stars>100-1000 import numpy as np import pytest import torch from PIL import Image from torchvision.transforms import transforms from continuum.datasets import InMemoryDataset from continuum.scenarios import TransformationIncremental NB_CLASSES = 6 @pytest.fixture def numpy_data(): nb_data = 100 # not too ...
import os import pdb import random import time import torch from collections import OrderedDict from options.train_options import TrainOptions from semia.dataset import ImgDataset, TestImgDataset from semia.model import SemIAModel from util.util import read_image, pil2tensor, pil2np, np2tensor from util.visualizer imp...
# Copyright (c) 2020 NVIDIA Corporation. All rights reserved. # This work is licensed under the NVIDIA Source Code License - Non-commercial. Full # text can be found in LICENSE.md import rospy import tf import message_filters import cv2 import numpy as np import torch import torch.nn as nn import threading import sys ...
<reponame>tahmidbintaslim/screenlamp # <NAME> 2017 # # screenlamp is a Python toolkit # for hypothesis-driven virtual screening. # # Copyright (C) 2017 Michigan State University # License: Apache v2 # # Software author: <NAME> <http://sebastianraschka.com> # Software author email: <EMAIL> # # Software source repository...
#!/usr/bin/python3 # -*- coding: UTF-8 -*- """ yum install python3-devel pip3 install psutil prometheus_client pyyaml */1 * * * * /usr/bin/python3 /opt/monit/linux_proc.py """ import sys,os,socket,psutil,yaml,datetime,urllib from collections import Counter from prometheus_client import CollectorRegistry, Gauge, push_to...
""" Provide the meta model for Asset Administration Shell V3.0 Release Candidate 2. We could not implement the following constraints since they depend on registry and can not be verified without it: * :constraintref:`AASd-006` * :constraintref:`AASd-007` Some of the constraints are not enforceable as they depend on ...
#!/usr/bin/env python # -*- coding: utf-8 -*- ################# import gzip from ..core.met import MET from .csv_read import read_aim_csv, read_opc_csv, read_csv from .txt_read import read_aim_txt, read_opc_txt from .nc_read import read_mpl ################# """ mypysmps.io.read ================ Automatic reading of ...
<filename>database_engine.py from sqlalchemy import create_engine from local_settings import * import sys import redis import json class Adaptor: platform = None batchsize = 0 valid = False db_engine = None tables=[] tabdetails = {} def __init__(self,platform,batchsize): self.platf...
<reponame>UBT-AI2/rtlode<filename>generator/dispatcher.py from myhdl import block, Signal, instances, always_comb, intbv, ConcatSignal, always from generator.config import Config from generator.cdc_utils import AsyncFifoConsumer, AsyncFifoProducer from framework.fifo import FifoProducer, FifoConsumer, fifo from genera...
<gh_stars>1-10 """ Copyright (c) 2014, Samsung Electronics Co.,Ltd. All rights reserved. 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...
<filename>tensorflow_probability/python/experimental/mcmc/progress_bar_reducer.py # Copyright 2020 The TensorFlow Probability 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 # # ...
<gh_stars>1-10 """ Topics to be explored: - Lattice Approximations of Continuous Space Manifolds - Finding an embedding of a neural network in R^3 - Neural Field Models for particle dynamics and stochastic dynamics on neural manifolds - Intrinsic Dimensionality of a Graph An idea that occurred to me yesterday relate...
<gh_stars>0 """ Copyright (c) 2019 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 ...
from contextlib import suppress from textwrap import wrap from PyQt5 import QtCore from PyQt5.QtCore import QEvent, QObject, Qt, QSize from PyQt5.QtGui import QColor, QTextOption, QKeySequence, QContextMenuEvent, QBrush from PyQt5.QtWidgets import QAbstractScrollArea, QAction, QComboBox, QFrame, QPlainTextEdit, QSizeP...
import gym from gym import spaces import math import numpy as np import matplotlib.pyplot as plt from mpl_toolkits.mplot3d.axes3d import Axes3D from gym.utils import seeding # import panda as pd import scipy.io as sio ''' 本环境是利用下行链路 每一次计算强化学习动作是一个时隙。 这个时隙之内速度,位置不变? 此版本为最简单的版本 支持断点重传 始终是跟最大的相连 本次尝试利用范围内的相对位置作为状态 '''...
from functools import partial import numpy as np import jax import jax.numpy as jnp def split(a, axis, factor): assert a.shape[axis] % factor == 0 new_shape = a.shape[:axis] + (factor, a.shape[axis] // factor) + a.shape[axis+1:] a = a.reshape(new_shape) a = jax.pmap(lambda x: x, in_axes=axis, out_axes...
# --------------------------------- # 데이터 등의 사전 준비 # ---------------------------------- import numpy as np import pandas as pd import matplotlib.pyplot as plt # MNIST 데이터 가시화 # keras.datasets를 이용하여 MNIST 데이터를 다운로드 실시 from keras.datasets import mnist (train_x, train_y), (test_x, test_y) = mnist.load_data() # 2차원 데이...
<filename>servicedirectory/src/sd-api/classes/daos.py ''' (c) Copyright 2013 Telefonica, I+D. Printed in Spain (Europe). All Rights Reserved. The copyright to the software program(s) is property of Telefonica I+D. The program(s) may be used and or copied only with the express written consent of Telefonica I+D or in ac...
""" 拼接并发送邮件 """ import smtplib from datetime import datetime, date from email.mime.text import MIMEText from email.header import Header from email.utils import formataddr from pathlib import Path import psycopg2 import requests import sentry_sdk from jinja2 import Environment, PackageLoader import config from app...
<reponame>availablenick/getren import unittest import flask_testing import datetime import os import time from flask import Flask from sqlalchemy.exc import InvalidRequestError import models_test from app import create_test_app, test_db from app.config import Test_Config from app.models import User, Course, Video, A...
<filename>gusty/parsing/parsers.py<gh_stars>100-1000 import yaml, ast, importlib.util, frontmatter, nbformat, jupytext from gusty.parsing.loaders import GustyYAMLLoader from gusty.importing import airflow_version if airflow_version > 1: from airflow.operators.python import PythonOperator else: from airflow.ope...
# coding: utf8 """Core functionality of tankobon.""" import concurrent.futures as cfutures import gzip import logging import pathlib import shutil from typing import cast, Callable, Dict, List, Optional, Union import fpdf # type: ignore import imagesize # type: ignore import natsort # type: ignore import requests....
<gh_stars>0 # Tests numpy methods of <class 'function'> from __future__ import print_function, absolute_import, division import itertools import math import platform from functools import partial import numpy as np from numba import unittest_support as unittest from numba.compiler import Flags from numba import jit,...
<filename>terran/tracking/face.py import numpy as np from filterpy.kalman import KalmanFilter from scipy.optimize import linear_sum_assignment from terran.face.detection import Detection, face_detection def linear_assignment(cost_matrix): """Implement the linear assignment as in Scikit Learn v0.21""" return...
<reponame>chw3k5/WaferScreen<filename>waferscreen/inst_control/inactive/tower_power_supply_gui.py ''' Created on July 20, 2011 @author: schimaf Versions: 1.0.2 10/16/2012 Check if the power supplies are powered in the GUI. Remove unused imports. ''' import sys from PyQt4.QtCore import SIGNAL, Qt from PyQt4.QtG...
import unittest from meraki_cli.__main__ import _object_filter LISTOFDICTS = [ {'id': '1', 'name': 'THING1'}, {'id': '2', 'name': 'THING2'}, {'id': '100', 'name': 'OTHERTHING'}, {'id': '200', 'name': 'OTHER200THING'}, {'id': '300', 'name': 'ELSE'} ] class TestObjectFilter(unittest.TestCase):...
#!/usr/bin/env python # # Copyright 2015 British Broadcasting 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 requ...