text
stringlengths
8.04k
46.5k
from AccessControl import getSecurityManager from DateTime import DateTime from Products.Archetypes.config import REFERENCE_CATALOG from Products.Archetypes.public import DisplayList from Products.CMFCore.utils import getToolByName from Products.CMFPlone.utils import _createObjectByType from bika.lims.browser import Br...
import pandas as pd import numpy as np from flask_socketio import SocketIO, emit import time import warnings warnings.filterwarnings("ignore") import pandas as pd import numpy as np import ast from sklearn.metrics import mean_absolute_error,mean_squared_error from statsmodels.tsa import arima_model from statsmodels.ts...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Tue Dec 11 00:45:08 2018 seq1H_genlog: seqeunce learning model 2stack conv enc - q(x), l(x) - non-autoregressive (not feeding predicted labels) - instance Norm. - G: GLU version - H: Highway-net version 기존 버그 완전 수정! @author: mimbres """ import torch impo...
# coding=utf-8 # Copyright 2020 The Google Research Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicab...
""" mmcdata.py This Python source defines the MMCData class An instance of this class is a given set of 'observed' (via instrument or model) timeseries of U,V,W, and other state variables, along with associated location (lat/lon), time, and elevation characteristics of the data stream """ from math import * impor...
from __future__ import absolute_import from __future__ import division from __future__ import print_function import torch import torch.nn as nn import torch.utils.data from torch.autograd import Variable import torch.nn.functional as F import math import numpy as np import cv2 from torchvision.ops import RoIAlign, Ro...
import math import re import os from sys import flags import time import numpy as np import sympy as sp import itertools import json import matplotlib.pyplot as plt from scipy.linalg import sqrtm def convert(o): if isinstance(o, np.int64): return int(o) raise TypeError def fBose(x, pole, resi): return 1...
""" :explore """ import copy import curses import json import logging import os import re import uuid from argparse import Namespace from queue import Queue from typing import Any from typing import Dict from typing import List from typing import Tuple from typing import Union from . import run as run_action from . i...
import numpy as np import settings import os # Parameters that indicate which part of the game # was used for Monte Carlo statistics MC_BF_PREFLOP = "before preflop" MC_PREFLOP = "preflop" MC_4TH = "4th card reveal" MC_FINAL = "final card reveal" len_suits = len(settings.card_suits) len_values = len(settings.card_val...
import sys, os, re import numpy as np import scipy as sp import pandas as pd import matplotlib import seaborn as sns from pylab import * from sklearn.decomposition import PCA # from sklearn.manifold import TSNE # from openTSNE import TSNE from tsnecuda import TSNE import random plt.style.use('ggplot') sns.set_palette...
# Copyright 2015 Red Hat, 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 or agreed ...
import numpy as np import numpy.testing as npt from dipy.data import get_data from dipy.sims.voxel import add_noise from dipy.segment.mrf import (ConstantObservationModel, IteratedConditionalModes) from dipy.segment.tissue import (TissueClassifierHMRF) # Load a coronal slice from a T1-we...
from __future__ import annotations from enum import Enum from typing import Dict, List, Tuple, Optional, Union import config _parse_list = List[List[Tuple[str, str]]] _extra_list = List[Tuple[str, str]] _range_tuple = Tuple[Optional[int], Optional[int]] _data_dict = Dict[str, Union[bool, None, str, _range_tuple]] _...
import torch import numpy as np import pytest from bgflow.nn.flow.crd_transform.ic_helper import ( det2x2, det3x3, dist_deriv, angle_deriv, torsion_deriv, ic2xy0_deriv, ic2xyz_deriv, init_xyz2ics, init_ics2xyz, ) from bgflow.nn.flow.crd_transform.ic import ( GlobalInternalCoordi...
''' This script is based on depthai 2.5 which has some issue on the alignement between rgb frame & depth frame. What i did is crop the depthframe after placing bbox. Then overlay the bbox (from depth frame) to rgb frame by delta offset. R4_1 --> Check if blue ring within body frame, if yes blue ring turn green. R4_2 --...
from telnetlib import Telnet from typing import Any, Callable, Dict, Optional, Tuple, Type import torch import torch.nn as nn import torch.nn.functional as F import torch.distributions as distributions from torch_scatter import scatter_add, scatter_max import torch.distributed as dist import hyperstate from dataclasse...
from __future__ import absolute_import from __future__ import division from __future__ import print_function import argparse import os import sys import json import math import time import numpy as np import tensorflow as tf from tensorflow.python.framework import graph_util from slim.datasets import imagenet from sli...
from collections import deque import heapq import os import keyboard os.environ["PYGAME_HIDE_SUPPORT_PROMPT"] = "hide" import pygame import random from abc import abstractmethod import maze.maze as m import visual.colors as vc class SetTool: @staticmethod def belong_to_distinct_sets( sets: list[m....
import networkx as nx import matplotlib.pyplot as plt import math import threading, queue import random import numpy as np def generar_Tablero(): Tablero = nx.Graph() x = 0 for i in range (0,8): for j in range(0,8): if (i % 2 == 0 and j % 2 == 0): Tablero.add_node(x,p...
import asyncio import os import random import re from PIL import Image import aiohttp import datetime from bs4 import BeautifulSoup import nonebot from nonebot.adapters.cqhttp.bot import Bot from nonebot.adapters.cqhttp.event import GroupMessageEvent, MessageEvent, PrivateMessageEvent from nonebot.plugin import on_com...
#import scipy.stats as ss import matplotlib.pyplot as plt import numpy as np import math from scipy import stats #from scipy.stats import weibull_min import pandas as pd from statistics import mean from matplotlib.backends.backend_agg import RendererAgg _lock = RendererAgg.lock import streamlit as st import random from...
# This program is in the public domain """ Join reflectivity datasets with matching intent/cross section. """ from __future__ import print_function from copy import deepcopy import numpy as np from dataflow.lib import unit from .refldata import Intent, ReflData, Environment from .util import poisson_average, extend ...
import tensorflow as tf from glob import glob from scipy.misc import imread from time import time import numpy as np import cv2 import pickle import os.path import copy from scipy.misc import imsave import sys # This is needed since the notebook is stored in the object_detection folder. sys.path.append("/home/mikep/hd...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Thu Feb 13 08:54:30 2020 @author: yuhanyao """ from copy import deepcopy from helper import phys import collections import numpy as np from helper.specread import gaplinelist from helper.mcmcfit import mylinear_fit from lmfit.models import LinearModel impor...
import time import csv import json import os import re import uuid import zipfile from pprint import pprint from urllib.request import urlopen from urllib.error import URLError, HTTPError import urllib import errno from KBaseReport.KBaseReportClient import KBaseReport from kb_ReportMetrics.core.UJS_CAT_NJS_DataUtils i...
# -*- coding: utf-8 -*- """Utility functions for dataset generation. This module defines the functions for the generation of dataset that will be used to train the ML models used by the VlcVoiceControl software. Dataset generated with this module are intended to be used to address the trigger word detection task with...
import os import math import torch import inspect import logging import platform import numpy as np import torch.nn as nn import torch.nn.functional as F from typing import * from abc import abstractmethod from abc import ABCMeta from argparse import Namespace from functools import partial from collections import def...
#!/usr/bin/env python ''' MonkeyTest -- test your hard drive read-write speed in Python A simplistic script to show that such system programming tasks are possible and convenient to be solved in Python The file is being created, then written with random data, randomly read and deleted, so the script doesn't waste your...
import numpy as np import pandas as pd from helpers import d2df from helpers import polyvalHelperFunction import fillerfunctions as ff def engineCoolingSystemsCalculation(processed, CONSTANTS, engine_type): print("Started calculating analysis for {} cooling systems...".format(engine_type), end="", flush=True) ...
import base64 import sys import traceback from datetime import datetime, timedelta import requests from codicefiscale import codicefiscale from app.libs import greenpass from unidecode import unidecode from flask import g, request from flask_restplus import Resource, fields from app.config import Config from app impo...
from __future__ import print_function #kompatibilita s Python 2.7 import sys # Implementacni test IB002 2016 - LTree (max 50 bodu) # # Vasi ulohou je implementovat ctyri funkce pro datovou strukturou "LTree". # Muzete si samozrejme pridat vlastni pomocne funkce. # # LTree je datova struktura, ktera slouzi k uklad...
#!/usr/bin/python3.6 # -*- coding: utf-8 -*- """ Solution to the 0-1 knapsack problem using branch and bound. It's a depth first Branch & Bound using stack-based search. This is a implementation of the Horowitz-Sahni for the 0-1 knapsack problem. See sec 2.5.1 of "<NAME>. & Toth, P. Knapsack problems: alg...
import sys,os import numpy as np import matplotlib.pyplot as plt from desitarget import cuts import fitsio import astropy.io.fits as fits import healpy as hp from scipy.special import erf from astropy.table import Table colorcuts_function = cuts.isELG_colors #deep DECaLS imaging, with photozs from HSC truthf = '/proj...
from __future__ import absolute_import, print_function import sys import re import fnmatch try: from collections import OrderedDict except ImportError: # py 2.6 from ..extern.ordereddict import OrderedDict from .. import log; log = log[__name__] from .. import asrootpy, QROOT, ROOT from .. import stl from .....
import numpy as np import pandas as pd from ...pvtpy.black_oil import Oil, Water, Gas from ...krpy import KrWaterOil, KrGasOil from .aquifer import PotAquifer import matplotlib.pyplot as plt import statsmodels.formula.api as smf import statsmodels.api as sm import json import os from scipy.optimize import curve_fit, r...
#! /usr/bin/env python """ Forward model matched filter relying on either KLIP (Soummer et al. 2012; Pueyo 2016) and LOCI (Lafreniere et al. 2007b) for the PSF reference approximation. The original concept of matched filter applied to KLIP has been first proposed in Ruffio et al. (2019) and then adapted in Dahlqvis...
#!/bin/usr/python3 # -*- coding: utf-8 -*- dict_UIC_Gare = { 87545269: 'Ablon', 87386052: '<NAME>', 87381657: '<NAME>', 87271460: 'Aéroport Ch. de Gaulle 1', 87001479: 'Aéroport Ch. de Gaulle 2 TGV', 87381491: 'Andrésy', 87543090: 'Angerville', 87381848: 'Argenteuil', 87545467: 'Arp...
import logging import json import asyncio import socket import ipaddress import os from addict import Dict import async_timeout import aiokatcp from aiokatcp import FailReply, InvalidReply, Sensor from prometheus_client import Histogram from katsdptelstate.endpoint import Endpoint, endpoint_list_parser from . import ...
################################################################# # # # SPECTRUM ANALYST # # version: 1.0 - Feb - 2020 # # @author: <NAME> <EMAIL> # #############...
import re import sys sys.path.append('deps') import glob import serial import subprocess import time import os import zipfile from collections import namedtuple from os import listdir from os.path import isfile, join import platform # Defaults DEFAULT_VERSION = 'v1.1.0' DEFAULT_CHOOSE_OPERATION = False DEFAUL...
# coding = utf-8 '''class and functions related to crystal symmetry ''' from collections import OrderedDict import numpy as np import spglib from mykit.core.kmesh import (_check_valid_kpath_dict, _check_valid_ksym_coord_pair, kpath_decoder) from mykit.core.metadata._spk import _special_...
import numpy as np import pickle import datetime import random import matplotlib.pyplot as plt from sklearn.metrics import roc_auc_score from torch.utils.data import DataLoader from sklearn.metrics import precision_score from sklearn.metrics import recall_score from sklearn.metrics import f1_score import sklearn.metric...
"""Top-level model classes. Author: <NAME> (<EMAIL>) """ import torch import torch.nn as nn import torch.nn.functional as F import layers class BiDAF(nn.Module): """Baseline BiDAF model for SQuAD. Based on the paper: "Bidirectional Attention Flow for Machine Comprehension" by <NAME>, <NAME>, <...
#!/usr/bin/env python3 import os import tkinter from dataclasses import dataclass from PIL import Image, ImageTk from .lib import Card, Hand, Player, Dealer, Shoe, get_correct_play N_CARDS_MAX = 9 IMG_PATH = f'{os.path.dirname(__file__)}/images/' @dataclass class Gui: root: tkinter.Tk menu: dict label_t...
# stdlib imports # third party imports import numpy as np import matplotlib.pyplot as plt import matplotlib.ticker as mticker import matplotlib.patheffects as path_effects import cartopy.crs as ccrs # projections from cartopy.mpl.gridliner import LONGITUDE_FORMATTER, LATITUDE_FORMATTER from cartopy.feature import Sh...
# This script is to replace the missing values in a modified paleogeography. import netCDF4 as nc import numpy as np import matplotlib.pyplot as plt import os import pyproj as proj4 import scipy.interpolate as si # The CoordinateSystem and GeographicSystem classes are hereby used courtesy of Dr. <NAME>; his # reposito...
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Copyright 2019 The FATE 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/lic...
#!/usr/bin/env python # ******************************************************* # Copyright (c) VMware, Inc. 2020-2021. All Rights Reserved. # SPDX-License-Identifier: MIT # ******************************************************* # * # * DISCLAIMER. THIS PROGRAM IS PROVIDED TO YOU "AS IS" WITHOUT # * WARRANTIES OR COND...
from pytest import raises from flexx.util.testing import run_tests_if_main from flexx.pyscript import JSError, py2js, evaljs, evalpy def nowhitespace(s): return s.replace('\n', '').replace('\t', '').replace(' ', '') def normallist(s): return s.replace('[ ', '[').replace(' ]', ']') class TestConrolFlow: ...
import ctypes import enum import resource import os import mmap import time import io import errno import socket import struct import collections import collections.abc libc = ctypes.CDLL('libc.so.6', use_errno=True) libc.syscall.restype = ctypes.c_long u8 = ctypes.c_uint8 u16 = ctypes.c_uint16 s32 = ctypes.c_int32 ...
# -*- mode: python; coding: utf-8 -*- # Copyright 2015-2018 <NAME> <<EMAIL>> and collaborators. # Licensed under the MIT License. """sas - running software in the SAS environment To use, export an environment variable $PWKIT_SAS pointing to the SAS installation root. The files $PWKIT_SAS/RELEASE and $PWKIT_SAS/setsas...
# -*- coding: utf-8 -*- #单例测试导入路径 if __name__ == '__main__': import sys, os parent_path = os.path.dirname(os.getcwd()) sys.path.append(parent_path) from webparser.webparserbase import ParserBase from serializ.htmlfile import * from serializ.oracle import * from bean.urlbean import * from log.log...
import requests import urllib3 import json import os import sys from typing import List, Text, Dict from time import sleep from copy import deepcopy import configargparse import logging from ansible import constants as C from ansible.parsing.vault import VaultLib from ansible.cli import CLI from ansible.parsing.datalo...
'''PostgreSQL logical replication manager''' import psycopg2 import psycopg2.extras # DictCursor import colorama from colorama import Fore, Style # Colors in terminal from prettytable import PrettyTable # Pretty table output from time import sleep import click from dotenv import load_dotenv import os __author__ = ...
import requests import time import streamlit as st import pandas as pd import time from datetime import datetime as dt import datetime import os import pandas as pd import numpy as np import plotly.graph_objects as go def monthConvert(monthStr,year): if monthStr.lower() == 'january' or monthStr.lower() == 'jan':...
import configparser import logging from datetime import datetime from plot_boxplots import bandwidthboxplot_noisegrouped, bandwidthplot_mimfileandsegment, \ bandwidthboxplot_active_conntypegrouped, bandwidthboxplot_active, bandwidthplot_fileandsegmentgrouped,\ latencyboxplot_noiseandsegmentmim, bandwidt...
import os, fnmatch, string from . import iterutils, model as flmd from .source import Source, SourceFile import anyconfig from collections import OrderedDict DEFAULT_EXCLUDE_PATTERNS = ['*.tar','*.jar','*.zip','*.gz','*.swp','node_modules','target','.idea','*.hide','*save'] DEFAULT_FILE_PATTERNS = ['*.yml','*cfg','*...
#!/usr/bin/python # -*- coding: utf-8 -*- # # Copyright 2013 The Plaso Project Authors. # Please see the AUTHORS file for details on individual 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 L...
# Copyright (c) 2012 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. """ A library to generate and store the manifests for cros builders to use. """ import cPickle import fnmatch import logging import os import re impo...
# python3.7 """Contains the implementation of generator described in ProgressiveGAN. Different from the official tensorflow model in folder `pggan_tf_official`, this is a simple pytorch version which only contains the generator part. This class is specially used for inference. For more details, please check the origi...
""" This file describes the DYNAMIC structure of a fully instantiated object DEFINED in a `.cub` file. There is a bit of an odd dependency loop here. To resolve it, I think it's necessary to factor out the common data structure which is a "layout tree". The general description can be found at .../docs/technote.md """ ...
""" Helper classes for comparing the equality of two HoloViews objects. These classes are designed to integrate with unittest.TestCase (see the tests directory) while making equality testing easily accessible to the user. For instance, to test if two Matrix objects are equal you can use: Comparison.assertEqual(matri...
import random import numpy as np import torch import torch.nn as nn from torch.nn import Parameter import torch.nn.functional as F from torch_geometric.nn.conv import MessagePassing from torch_geometric.utils import ( remove_self_loops, add_self_loops, softmax, dropout_adj, is_undirected, accu...
import os import sys import torch import pytorch3d import os import sys import time import json import glob import torch import math import matplotlib.pyplot as plt import numpy as np from PIL import Image # from IPython import display from tqdm.notebook import tqdm import time import torch.nn.functional as F # Data ...
# -*- coding: utf-8 -*- # # Copyright 2012-2020 BigML # # 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 ...
# -*- coding: utf-8 -*- # <nbformat>3.0</nbformat> # <codecell> #!/usr/bin/env python # #The MIT CorrelX Correlator # #https://github.com/MITHaystack/CorrelX #Contact: <EMAIL> #Project leads: <NAME>, <NAME> Project developer: <NAME> # #Copyright 2017 MIT Haystack Observatory # #Permission is hereby granted, free of c...
""" File containing all utilities to interact with test case related kubernetes resources """ import time import json from pkgutil import get_data import yaml import logging import kubernetes as k8s from illuminatio.host import ClusterHost, GenericClusterHost, Host from illuminatio.k8s_util import ( create_pod_ma...
r""" Tensor Product of Kirillov-Reshetikhin Tableaux A tensor product of :class:`~sage.combinat.rigged_configurations.kr_tableaux.KirillovReshetikhinTableaux` which are tableaux of `r` rows and `s` columns which naturally arise in the bijection between rigged configurations and tableaux and which are in bijection with...
from .ToontownGlobals import * import math from . import TTLocalizer ### ToontownBattle globals: central repository for all battle globals # defaults for camera BattleCamFaceOffFov = 30.0 BattleCamFaceOffPos = Point3(0, -10, 4) # BattleCamDefaultPos = Point3(0, -10, 11) # BattleCamDefaultHpr = Vec3(0, -45, 0) Battl...
import pandas as pd import tushare as ts from StockAnalysisSystem.core.config import TS_TOKEN from StockAnalysisSystem.core.Utility.common import * from StockAnalysisSystem.core.Utility.time_utility import * from StockAnalysisSystem.core.Utility.CollectorUtility import * # -------------------------------------------...
from enum import Enum from typing import List, Dict, Optional, Any, Tuple from pydantic import BaseModel, Field class Side(int, Enum): LEFT = -1 MID = 0 RIGHT = 1 class KPId(str, Enum): nose = "nose" neck = "neck" right_shoulder = "right_shoulder" right_elbow = "right_elbow" right_wr...
"""Support for MQTT fans.""" from __future__ import annotations import functools import logging import math import voluptuous as vol from homeassistant.components import fan from homeassistant.components.fan import ( ATTR_OSCILLATING, ATTR_PERCENTAGE, ATTR_PRESET_MODE, SPEED_HIGH, SPEED_LOW, ...
import itk import numpy as np from FemurSegmentation.utils import image2array, array2image, cast_image # TODO add healt check and error/exception handling __author__ = ['<NAME>'] __email__ = ['<EMAIL>'] # TODO allows a customize InputType, not only retrive it from the current image # TODO allows to not alwaise set t...
""" The code needed to flow and annotate low-level helpers -- the ll_*() functions """ from rpython.tool.sourcetools import valid_identifier from rpython.annotator import model as annmodel from rpython.annotator.policy import AnnotatorPolicy from rpython.annotator.signature import Sig from rpython.annotator.specialize...
from dataclasses import dataclass from datetime import datetime from pathlib import Path from typing import Any, Dict, Tuple, List import pytz from ..api import MdApi, TdApi from vnpy.event import EventEngine from vnpy.trader.utility import get_folder_path from vnpy.trader.constant import ( Exchange, Product, ...
# Copyright 2011 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 ...
import pygame import random import sys pygame.init() screen_w=1366 screen_h=768 black=(0,0,0) white=(255,255,255) red=(255,0,0) blue=(0,0,255) screen=pygame.display.set_mode([screen_w,screen_h],pygame.RESIZABLE) icon = pygame.image.load('./images/icon.jpg') pygame.display.set_icon(icon) pygame.display.set_caption('G...
# Copyright 2019 Red Hat, 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...
from cairio import client as ca import random import string import os import sys import tempfile import time import subprocess import traceback import multiprocessing import numpy as np _registered_commands = dict() def register_job_command(*, command, prepare, run): _registered_commands[command] = dict( ...
# for making it an executable import sys import platform from os import path # tkinter import tkinter as tk from tkinter import ttk # import tkinter.font as font # pynput from pynput.keyboard import Listener as KeyboardListener from pynput.mouse import Listener as MouseListener # for windows import ctypes # because...
import time import argparse import tensorflow as tf import os import sys import math import collections from tensorflow.python.client import timeline import json from tensorflow.python.ops import partitioned_variables # Set to INFO for tracking training, default is WARN. ERROR for least messages tf.logging.set_verbos...
""" ao_ribbonizer.py version 2.0 copyright (C) 2018 <NAME> email: <EMAIL> given a nurbs surface creates a ribbon. --------------------------------------------------------------------------------------------------------------------------------------------- install instructions: place this file in the default "scri...
# BenchExec is a framework for reliable benchmarking. # This file is part of BenchExec. # # Copyright (C) 2007-2015 <NAME> # 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...
from __future__ import print_function import psycopg2, psycopg2.extras, psycopg2.extensions #apt install python-psycopg2 import sys def DbExec(cur, sql): print (sql) cur.execute(sql) def DropTables(cur, config, p): cur = conn.cursor(cursor_factory=psycopg2.extras.DictCursor) DbExec(cur, "DROP TABLE IF EXISTS {0}...
#!/usr/bin/env python2.7 # -*- coding: utf-8 -*- # region header ''' This module provides classes for dealing with python's way to transport \ strings to any output stream. ''' # # python3.5 # # pass from __future__ import absolute_import, division, print_function, \ unicode_literals # # ''' For con...
from __future__ import absolute_import, division, unicode_literals import unittest import django.utils.six.moves.urllib.request from bs4 import BeautifulSoup from django import template from django.core.exceptions import ValidationError from django.core.urlresolvers import reverse from django.test import TestCase, ov...
# This file is part of Buildbot. Buildbot 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, version 2. # # This program is distributed in the hope that it will be useful, but WITHOUT # ANY WARRANTY; without eve...
# Copyright 2008-2015 Nokia Networks # Copyright 2016- Robot Framework Foundation # # 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 ...
"""Environments for networks with traffic lights. These environments are used to train traffic lights to regulate traffic flow through an n x m traffic light grid. """ import numpy as np import re from gym.spaces.box import Box from gym.spaces.discrete import Discrete from gym.spaces import Tuple from flow.core imp...
""" The goal of this game is to destroy the enemy tank on the screen, by programming your own tank to shoot the enemy. The program the user submits is written in python, and the purpose of this game is to help teach general programming properties such as functions, conditionals and data types to the...
import warnings warnings.filterwarnings("ignore") import os import sys # libraries import time import numpy as np import pandas as pd import argparse import cv2 import PIL.Image import matplotlib.pyplot as plt import seaborn as sns import torch from torch.utils.data import TensorDataset, DataLoader, Dataset import to...
import random, string, time, datetime, json, threading, sys, os class KThread(threading.Thread): """ A subclass of threading.Thread, with a kill() method. From https://web.archive.org/web/20130503082442/http://mail.python.org/pipermail/python-list/2004-May/281943.html """ def __init__(self, *args,...
from __future__ import unicode_literals from __future__ import print_function import os import sys import traceback import logging import threading from time import time from datetime import datetime from io import open from collections import namedtuple from pysqlite2.dbapi2 import OperationalError from cli_helpe...
import math, time, random import numpy as np import tensorflow as tf def rewards_to_qvals(t_r_l, gamma): T = t_r_l.shape[0] # reward = average of all following rewards # for t in range(T): # t_r_l[t, 0] = np.mean(t_r_l[t:, 0]) # for t in range(T): # cumw, cumr = 0, 0 # for i, r in enumerate(t_r_...
from PyQt5.QtWidgets import * from PyQt5.QtCore import * from PyQt5.QtGui import * from math import sin, cos, sqrt, pi import sys def rad(grad): return grad * pi / 180 def dist(d1, d2): return sqrt((d1.x - d2.x) * (d1.x - d2.x) + (d1.y - d2.y) * (d1.y - d2.y)) class Point: def __init__(self, x, y): ...
""" Script to help you train the model locally. Otherwise, I would recommend you to train the model on the Kaggle notebook. https://www.kaggle.com/blaisewang/topic-label-generation """ import csv import math import time import gensim import matplotlib.pyplot as plt import matplotlib.ticker as ticker import numpy as n...
from config import BOTNAME,BOTTOKEN,DEBUG,PROXY,PY from api import GetUserInfo,ChangeUserInfo import requests reqChange=requests.Session() reqSender=requests.Session() reqUpdater=requests.Session() reqCallback=requests.Session() req=requests.Session() if len(PROXY)>0: reqChange.proxies={"http":PROXY,"https":PROXY...
# # Copyright Contributors to the OpenTimelineIO project # # Licensed under the Apache License, Version 2.0 (the "Apache License") # with the following modification; you may not use this file except in # compliance with the Apache License and the following modification to it: # Section 6. Trademarks. is deleted and rep...
""" This module contains all general-purpose functions for loading and saving data. This includes pulling data out of FITS files, saving TBriDGE simulation outputs, and more. """ import tbridge import os import math from pathlib import Path from astropy.io import fits from astropy.wcs import wcs from astropy.table im...
#!/usr/bin/env python # Imports import gzip import os import numpy as np import matplotlib matplotlib.use('Qt4Agg') import matplotlib.pyplot as plt plt.switch_backend('agg') import pickle import time import math from collections import Counter, defaultdict # Keras imports from keras.utils.np_utils import to_categ...