text stringlengths 6.04k 39.5k |
|---|
import cartopy.crs as ccrs
import matplotlib.pylab as plt
import numpy as np
from matplotlib import cm
import cartopy.io.img_tiles as cimgt
from shapely.geometry.polygon import LinearRing
from DAAQS.utils.misc import generate_daily_list, lon_transform_0_base, lon_transform_minus180_base
from DAAQS.utils.io_cams import... |
import requests
import json
import numpy as np
import matplotlib as mpl
import matplotlib.pyplot as plt
import matplotlib.patches as mpatches
import cartopy.io.shapereader as shpreader
import cartopy.crs as ccrs
import statsmodels.api as sm
import pandas as pd
from pyjstat import pyjstat
from collections import Ordered... |
"""
Entry point for the AnomalyDB API web-service
"""
import json
import logging
import os
import time
import traceback
from typing import List, Dict
from absl import app
import boto3
from flask import Flask, request, jsonify, Response
from flask_compress import Compress
from flask_httpauth import HTTPBasicAuth
from ... |
'''
Created on Mar 4, 2017
@author: Tuan
'''
'''
A work around for gathering (correspond to indexing on numpy array with another numpy array)
- Tensorflow couldn't run gradient for this
Issue: https://github.com/tensorflow/tensorflow/issues/206
Workaround: Turn the original params and indices to one dimension, then... |
"""
AIGame: connects OpenAI gym game to the model (V1-M1-RL)
Adapted from arm.py
Original Version: 2015jan28 by <EMAIL>
Modified Version: 2019oct1 by <EMAIL>
Modified 2019-2020 samn
"""
from neuron import h
from pylab import concatenate, figure, show, ion, ioff, pause,xlabel, ylabel, plot, Circle, sqrt, arctan, arctan... |
"""------------------for AC"""
import enum
import logging
from typing import Optional
from .device import (
UNIT_TEMP_CELSIUS,
UNIT_TEMP_FAHRENHEIT,
Device,
DeviceStatus,
)
PROPERTY_TARGET_TEMPERATURE = "target_temperature"
PROPERTY_OPERATION_MODE = "operation_mode"
PROPERTY_FAN_SPEED = "fan_speed"
P... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright 2007-2009 Zuza Software Foundation
#
# This file is part of translate.
#
# translate 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... |
"""
@Project : ScoreProbability
@Module : crawl.py
@Author : HjwGivenLyy [<EMAIL>]
@Created : 12/17/18 4:54 PM
@Desc : crawl data from qtw net
"""
import datetime
import re
import loguru
import requests
import yaml
from bs4 import BeautifulSoup
from pymongo import MongoClient
from base import SUPPORT_... |
import random
from .grid import Grid
from .snakestuff import *
# Values to put in grid, priorities TBD
OPEN_SPACE = '.'
FOOD = 'F'
ME_HEAD = 'H'
ME_BODY = 'B'
ME_TAIL = 'T'
EATABLE_HEAD_ZONE = 'e'
VERY_EATABLE_HEAD = 'E'
OTHER_HEAD = 'h'
OTHER_BODY = 'b'
OTHER_TAIL = 't'
MAYBE_GO = '+'
#EAT_THIS_HEAD =... |
from scm_optimization.model import *
from pprint import pprint
import pacal
import math
import os
import itertools
import numpy
import time
import pandas as pd
import pickle
from multiprocessing import Pool
from datetime import date, datetime
class ModelConfig:
def __init__(self,
... |
import numpy as np
import cv2
import os
import time
import random
import matplotlib.image as mpimg
import scipy.misc
import datetime
import matplotlib.pyplot as plt
import matplotlib.patches as patches
import pickle
import scipy.io as sio
from sklearn.preprocessing import StandardScaler
from sklearn.model_selection imp... |
#!/usr/bin/env python
# encoding: utf-8
# Copyright (c) 2021 <NAME>
#
#
# 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,... |
"""
Diagnostic module
"""
from typing import Tuple
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
from mrtool import MRBRT, LinearCovModel, LogCovModel, MRData
from mrtool.core.other_sampling import (extract_simple_lme_hessian,
extract_simple_lme_specs)
fr... |
import sys
import threading
import time
from socket import *
class Peer():
def __init__(self):
super().__init__()
self.client_socket_udp = socket(AF_INET, SOCK_DGRAM)
self.server_socket_udp = socket(AF_INET, SOCK_DGRAM)
self.server_socket_tcp = socket(AF_INET, SOCK_STREAM)
... |
#
from nrutils.core.basics import *
from glob import glob as ls
from os.path import getctime
from numpy import array,cross,zeros,dot,abs,sqrt,inf,nan,sign
from numpy.linalg import inv, norm
from numpy import sum as asum
# Determine whether the folder containing a metadta file is valid: can it be used to reference wav... |
"""Query or populate QCovid database
"""
import sys
from os import path, listdir
from glob import glob
import argparse
import json
import hashlib
from sqlalchemy import create_engine
from sqlalchemy.orm import sessionmaker
from model import (
Dataset,
Run,
Assembly,
PrimerSet,
Amplicon,
Self... |
import sys
import os
sys.path.append(os.path.dirname(os.path.dirname(os.path.realpath(__file__))))
import tensorflow as tf
import collections
import deepchem as dc
import numpy as np
from rdkit import Chem
from ccdc import io
from deepchem.data import NumpyDataset, pad_features
from deepchem.feat.graph_features import ... |
"""All the db operations for storing and retrieving boog data"""
from collections import Counter
import itertools
import operator
from copy import copy
import os.path
from lib.sort_data import sorted_series, sorted_titles, sorted_filters
from lib.sort_data import sorted_apg
from lib.variables import VARIABLES
import l... |
import unittest
import numpy as np
from handwriting_synthesis import data
from handwriting_synthesis.data import points_stream, flatten_strokes, BadStrokeSequenceError
import shutil
import os
class PointStreamTests(unittest.TestCase):
def test_point_stream_on_1_stroke_1_point_long(self):
x = 123
... |
import sys
import os
import math
import numpy
import pandas
from scipy.interpolate import interp1d
from .constants import *
class TwoLayerModel:
"""Defines the two-layer climate model.
Attributes:
default (dict): Default parameters for running the two-layer model.
Overwritten using **kw... |
import wx
from cgui import isGlassEnabled, glassExtendInto, DragMixin
def isVistaOrHigher():
import ctypes
return 'wxMSW' in wx.PlatformInfo and hasattr(ctypes.windll, 'dwmapi')
def ModifiedFont(font, weight = -1, pointSize = -1, faceName = '', underline = -1):
font = wx.Font(font)
if weight != -1:
... |
import base64
import json
import warnings
from collections import defaultdict, namedtuple
from enum import Enum, EnumMeta
from types import FunctionType
from typing import Any, Union
import lpipe.exceptions
import lpipe.logging
from lpipe import normalize, signature, utils
from lpipe.action import Action
from lpipe.co... |
import os
import sys
import time
from multiprocessing import Queue as pQueue
from threading import Thread
import cv2
import numpy as np
import torch
import torch.multiprocessing as mp
import torchvision.transforms as transforms
from PIL import Image
from torch.autograd import Variable
from SPPE.src.utils.img import ... |
# -*- coding: utf-8 -*-
"""Python lib to access exchange rates from the Czech National Bank.
Fork of (PyPI) cnb-exchange-rate (MIT licensed).
install_requires = ['six', 'pytz']
Usage:
import cnb
from datetime import date, datetime, timedelta
cnb.rate('USD')
24.688
cnb.convert(1000, 'USD')
24688.0
cn... |
import bson
import pytz
import os.path
import tarfile
import datetime
import cStringIO
from .web import base
from .web.request import AccessType
from . import config
from . import util
from . import validators
import os
from .dao.containerutil import pluralize
log = config.log
BYTES_IN_MEGABYTE = float(1<<20)
def _f... |
from typing import List, Dict, Any, Tuple, Union
from collections import namedtuple
import copy
import numpy as np
import torch
import torch.nn.functional as F
from torch.distributions import Normal, Independent, Categorical
from ding.torch_utils import Adam, to_device
from ding.rl_utils import v_1step_td_data, v_1ste... |
####################
# ES-DOC CIM Questionnaire
# Copyright (c) 2017 ES-DOC. All rights reserved.
#
# University of Colorado, Boulder
# http://cires.colorado.edu/
#
# This project is distributed according to the terms of the MIT license [http://www.opensource.org/licenses/MIT].
####################
from djan... |
# Copyright (c) 2020 Mitsubishi Electric Research Laboratories (MERL). All rights reserved. The software, documentation and/or data in this file is provided on an "as is" basis, and MERL has no obligations to provide maintenance, support, updates, enhancements or modifications. MERL specifically disclaims any warrantie... |
# @Date: 2019-10-24T23:35:42+08:00
# @Email: <EMAIL>
# @Filename: RetrievePDB.py
# @Last modified time: 2019-11-15T15:01:00+08:00
import wget
import gzip
import urllib
import ftplib
import shutil
import os
from collections import Iterable, Iterator
from multiprocessing.dummy import Pool
from time import sleep
from r... |
import importlib
import os
import matplotlib.pyplot as plt
import torch
import numpy as np
import dataloaders.mnist
from ifaces import DownloadableDataset
from modules.iwae import IWAE
from modules.vae import VAE
from utils_clone.pytorch import reshape_and_tile_images
def load_checkpoint(checkpoint_fname):
stat... |
from traceback import format_exc
from discord import Embed, File
from datetime import datetime
from re import sub as re_sub
from random import choice as randchoice
from io import BytesIO as IoBytesIO
from discord.ext import commands
from discord.utils import escape_mentions
from imports import modLogsDB, lineNum, aioht... |
"""
Tests the server collection compute capabilities.
"""
import numpy as np
import pytest
import qcfractal.interface as ptl
from qcfractal import testing
from qcfractal.testing import fractal_compute_server, mark_slow
def test_collection_query(fractal_compute_server):
client = ptl.FractalClient(fractal_compute... |
import numpy as np
import matplotlib.image as mpimg
from skimage.feature import hog
from scipy.ndimage.measurements import label
from collections import deque
import cv2
color_space = 'YUV' # Can be RGB, HSV, LUV, HLS, YUV, YCrCb
orient = 15 # HOG orientations
pix_per_cell = 8 # HOG pixels per cell
cell_per_block =... |
__license__ = """
Copyright (c) 2012 Free Software Foundation
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, mer... |
# -*- coding: utf-8 -*-
"""Plugin for dealing with Emacs-style tabstops"""
import os
from fnmatch import fnmatch
import sublime
import sublime_plugin
_scratch_listener = None # will be an instance of EmacsTabstopsScratchListener
_reset_listener = None # will be an instance of EmacsTabstopsResetListener
TTS_REGIO... |
"""
Created on 03/27/18.
@author: <NAME>, <NAME>
"""
import json
import numpy as np
from collections import OrderedDict
import multiprocessing as mp
import sys
from os import listdir, path
import re
import matplotlib.pyplot as plt
import matplotlib as mpl
def json_to_ordered_dict(file):
"""
Reads a timeline.j... |
from frasco import (Feature, action, hook, set_translation_callbacks, copy_extra_feature_options,\
session, request, signal, current_app, command, shell_exec, current_context, json)
from flask_babel import (Babel, gettext, ngettext, lazy_gettext, format_datetime, format_date,\
... |
# Grafiek positief getest naar leeftijd door de tijd heen, per leeftijdscategorie
# <NAME>, (@rcsmit) - MIT Licence
# IN: tabel met positief aantal testen en totaal aantal testen per week, gecategoriseerd naar leeftijd
# handmatig overgenomen uit Tabel 14 vh wekelijkse rapport van RIVM
# Wekelijkse update... |
import os
import re,json
#sys.path.append(path.dirname(path.dirname(path.abspath(__file__))))
from collections import Iterable
from manafa.powerProfile.PowerProfile import PowerProfile
from manafa.utils.Utils import get_pack_dir
from manafa.utils.dateUtils import convertBatStatTimeToTimeStamp,batStatResetTimeToTimeSta... |
# Leo colorizer control file for c mode.
# This file is in the public domain.
# Properties for c mode.
properties = {
"commentEnd": "*/",
"commentStart": "/*",
"doubleBracketIndent": "false",
"indentCloseBrackets": "}",
"indentNextLine": "\\s*(((if|while)\\s*\\(|else\\s*|else\\s+if\\s*\\(|... |
import os, re
import numpy as np
import scipy
from scipy.misc import logsumexp
from scipy.special import gammaln, beta
from scipy.integrate import simps
from numpy import newaxis as na
import scipy.sparse
from scipy.sparse import csr_matrix, csc_matrix, lil_matrix
import pypolyagamma as ppg
from pgmult.internals.d... |
import pytest
import sys
import time
from appdirs import user_config_dir
import os
import attr
import tempfile
import json
from functools import partial
dn = os.path.dirname
import devapps
# sys.path.insert(0, dn(dn(os.path.abspath(__file__))))
# import setup_method as devapps
# default providers:
CLI, Env, File = d... |
from collections import Mapping, deque
from itertools import product, chain, repeat
from added_value.items_table_directive import NonStringIterable
from added_value.multisort import tuplesorted
from added_value.sorted_frozen_set import SortedFrozenSet
from added_value.toposet import TopoSet
from added_value.util impor... |
from numbers import Real
from collections import deque
import operator
import random
import math
import re
import logging
import functools
# import timeout
logging.basicConfig(format="%(levelname)-8s (%(asctime)s) %(message)s", level=logging.INFO, datefmt="%d.%m.%y, %H:%M:%S")
logger = logging.getLogger(__name__)
c... |
#!/usr/bin/env python
# coding: utf-8
import pandas as pd
import numpy as np
import gc
import os
import sys
sys.path.append('../utils')
import preproc_utils
import matplotlib.pyplot as plt
def cumul_val_to_rate(df, variable_ids):
"""
Convert cumulative values to discrete values
"""
old_len = len(... |
# -*- coding: utf-8 -*-
"""
Created on Wed May 20 08:48:42 2020
@author: <EMAIL>
"""
import yaml, os, platform
import h5py
from datetime import datetime, timedelta
from dateutil import parser
import numpy as np
from gpstec import gpstec
from cartomap import geogmap as gm
import matplotlib.pyplot as plt
import cartopy.... |
# Copyright (c) 2019 Siemens AG
#
# 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, distribu... |
import re
from typing import Dict, List, Union, Tuple, Callable, Any
import ipywidgets as ipw
import traitlets
from optimade.models.utils import CHEMICAL_SYMBOLS
from aiidalab_optimade.exceptions import ParserError
from aiidalab_optimade.logger import LOGGER
__all__ = ("FilterTabs",)
class FilterTabs(ipw.Tab):
... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Sat Sep 14 15:03:27 2019
@author: pi
"""
import cv2
import numpy as np
import time
import RPi.GPIO as GPIO
FONT = cv2.FONT_HERSHEY_COMPLEX
FRAME_X = 320
FRAME_Y = 240
CENTER_X = FRAME_X / 2
CENTER_Y = FRAME_Y / 2
# not confirmed
BALL_WIDTH = 42.67 #42.6... |
#__docformat__ = "restructuredtext en"
# ******NOTICE***************
# optimize.py module by <NAME>
#
# You may copy and use this module as you see fit with no
# guarantee implied provided you keep this notice in all copies.
# *****END NOTICE************
# A collection of optimization algorithms. Version 0.5
# CHANGE... |
"""
Author: <NAME> <<EMAIL>>
Commandline tool for searching github.
* find all very large repositories:
github -a -w repo -q "size:>8000000"
* find all very large files:
github -a -w code -q "in:path zip size:>500000000"
TODO: make multiple queries from a single commandline possible.
TODO: add option to list all... |
#!/usr/bin/env/python
from __future__ import print_function, division
import torch
from torch.nn import Sequential as Seq, Linear as Lin, ReLU, Tanh, LeakyReLU, BatchNorm1d as BN1
from torch.utils.data import Dataset,DataLoader
from torch.nn import functional as F, MSELoss, BCELoss
import data_utils
import pickle as c... |
#!python3
import os
import sys
import struct
import argparse
import yaml
import asyncio
import traceback
from signal import SIGINT, SIGTERM
from bleak import BleakClient, BleakError, BleakScanner
import atexit
import pickle
from pickle import UnpicklingError
from aiohttp import web
import ssl
import json
import logging... |
#!/usr/bin/env python3
import torch
from torch.nn import Module
from typing import Dict, List, Any, Callable
from captum.concept.fb._core.concept import Concept
from captum.concept.fb._core.concept import ConceptInterpreter
from captum.concept.fb._core.CAV import CAV
from captum.concept.fb._utils.classifier import C... |
#! /usr/bin/env python3
# -*- coding: utf-8 -*-
"""
:samp:`Save and load multiple configurations`
The class :class:`Configurations` (mark the `s` at the end) enables you to save, load, remove and list
multiple configurations.
Class :class:`Configuration` (mark the absence of `s` at the end) is a singleton.
It should ... |
import sqlite3
import re
from transformers.transformer import Transformer
from openapi_server.models.element import Element
from openapi_server.models.names import Names
from openapi_server.models.connection import Connection
from openapi_server.models.attribute import Attribute
#Biolink class
CHEMICAL_SUBSTANCE = 'C... |
import logging
import math
import re
from itertools import count, product
from decimal import Decimal
from .exceptions import TeXCalcException
from .fields import Field, DecimalField
logger = logging.getLogger(__name__)
class ProcessorMetaclass(type):
@staticmethod
def _get_needed_attr(key, attrs, bases):
... |
import numpy as np
import torch
import torch.nn as nn
import torch.nn.functional as F
import torch.optim as optim
import pandas as pd
import sentencepiece as spm
import random
from torch.utils.data import Dataset
from torch.utils.data import DataLoader
import os
import argparse
import torch.multipro... |
#!/usr/bin/env python
""" Implementation of interactive githeat.
"""
from __future__ import absolute_import
from __future__ import print_function
from argparse import ArgumentParser
from argparse import ArgumentTypeError
from argparse import RawDescriptionHelpFormatter
import functools
import os
import re
import sys
... |
#!/usr/bin/env python
# Version: 1.0
# Author: <NAME> (updated by <NAME>)
from __future__ import division, print_function
import sys, math, os
import numpy as np
import scipy.stats
import datetime
import matplotlib.pyplot as plt
import glob
from collections import deque
import astropy.units as u
from astropy import lo... |
#!/usr/bin/env python
"""
Vector Forward Mode
"""
import numpy as npy
import numpy
import instant
class adouble:
"""Class: Algorithmic differentiation"""
def __init__(self, *taylor_coeffs):
"""Constructor takes a list, array, tuple and variable lenght input"""
if not npy.isscalar(taylor_co... |
"""Binance API test tool.
Make a marker order on Binance Spot Testnet to move the market.
This is to trigger your own limit orders and then your client to get event for the triggered orders.
Needed for manual simulation of different event flows or integration testing.
Tutorials:
- https://dev.to/drcloudycoder/devel... |
from graphviz import Digraph
from gravel_spec.utils import *
from gravel_spec.element import *
from gravel_spec.graph import *
from gravel_spec.config import *
from gravel_spec.ops import *
from gravel_spec.click_common import *
from gravel_spec.click_api import *
def is_tcp(p):
return And(p.ether.ether_type == 0... |
"""CLI script to annotate gpd entries
"""
import sys, argparse, gzip, re, itertools, os, uuid
from multiprocessing import cpu_count
from tempfile import mkdtemp, gettempdir
from random import shuffle
from seqtools.format.gpd import GPD, GPDStream
from seqtools.structure.transcriptome import Transcriptome
from seqtools... |
"""MIT License.
Copyright (c) 2020-2021 Faholan
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, ... |
# Python framework
import re, os, datetime
from pprint import pprint
# Local package
from Constants import *
from StringUtils import *
from Matching import __trim_word_separators
import Matching
import MLB
import NBA
import NFL
import NHL
def Infer(relPath, file, meta):
# Set base information
file... |
# Copyright 2020,2021 Sony Corporation.
# Copyright 2021 Sony Group 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 ... |
import tensorflow as tf
from tensorflow.keras import backend as K
from tensorflow.keras.layers import (
Activation,
BatchNormalization,
Conv2D,
Conv2DTranspose,
Dropout,
Input,
MaxPooling2D,
SpatialDropout2D,
UpSampling2D,
Concatenate,
ZeroPadding2D,
Cropping2D
)
from ten... |
import numpy as np
import torch
from ml.core import _set_licchavi, _train_predict, ml_run
from ml.data_utility import (
expand_dic,
expand_tens,
get_all_vids,
get_mask,
rescale_rating,
reverse_idxs,
sort_by_first,
)
from ml.dev.fake_data import generate_data
from ml.handle_data import distr... |
import argparse
from collections import namedtuple
import glob
import os
import pickle
import sys
import matplotlib.pyplot as plt
from matplotlib.axes._axes import _log as matplotlib_axes_logger
import matplotlib.ticker as ticker
import numpy as np
import pandas as pd
import seaborn as sns
import experiments.cube.plo... |
import json
import sys
import argparse
import time
import requests
from pycomfoconnect import *
local_name = 'ioBroker'
local_uuid = bytes.fromhex('00000000000000000000000000000005')
sensor_data = {
56: "",
SENSOR_FAN_EXHAUST_FLOW: "",
SENSOR_FAN_SUPPLY_FLOW: "",
SENSOR_FAN_EXHAUST_SPEED: "",
SEN... |
###############################################################################
# MIT License
#
# Copyright (c) 2021, Jun So Intec Inc. All rights reserved.
#
# Author & Contact: <NAME> (<EMAIL>)
###############################################################################
import argparse
import os
from PIL import Im... |
import sys;
import abc;
import math;
import multiprocessing;
import psutil;
import numpy as np;
from scipy.stats import t, f;
import DataHelper;
class LinearRegression:
__DEFAULT_SIG_LEVEL = 0.05;
@staticmethod
def calcVIF(X):
if X is None:
raise ValueError("matrix X is None");
... |
import enum
import os
import sys
import datetime
from decimal import Decimal
from typing import NamedTuple
from tabulate import tabulate
from modelmapper.base import Base
from modelmapper.ui import get_user_choice, get_user_input
from modelmapper.misc import (load_toml, write_toml, write_settings,
... |
"""
Copyright 2017 ARM Limited
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
dis... |
# emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*-
# vi: set ft=python sts=4 ts=4 sw=4 et:
"""
Reports builder for BIDS-Apps.
Generalizes report generation across BIDS-Apps
"""
from pathlib import Path
import re
from itertools import product
from collections import defaultdict
from pkg_resource... |
# -*- coding: utf-8 -*-
# Copyright 2014-2021 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... |
# -*- coding: utf-8 -*-
import os
import mimetypes
from io import BytesIO
from typing import Iterable
from concurrent.futures import ThreadPoolExecutor, as_completed
from abeja.common.config import UPLOAD_WORKER_COUNT
from abeja.common.logging import logger
from abeja.common.file_helpers import generate_path_iter
from... |
import os
import sys
import pygame
import random
from pygame import *
pygame.init()
screen_size_display = (width_screen, height_screen) = (600, 150)
FPS = 60
gravity = 0.6
black_color = (0,0,0)
white_color = (255,255,255)
bg_color = (235, 235, 235)
highest_scores = 0
screen_layout_display = pygam... |
# -*- encoding: utf-8 -*-
import os
import threading
import time
import timeit
import pytest
from ddtrace.vendor import six
from ddtrace.profiling import _nogevent
from ddtrace.profiling import collector
from ddtrace.profiling import profiler
from ddtrace.profiling import recorder
from ddtrace.profiling import _serv... |
#!/usr/bin/python -u
# SOURCE: https://github.com/JakeWharton/pidcat
'''
Copyright 2009, The Android Open Source Project
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/li... |
#!/usr/bin/env python
# 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... |
from telegram import InlineKeyboardButton, InlineKeyboardMarkup,BotCommand
from telegram.ext import Dispatcher, CommandHandler, CallbackQueryHandler
import random
# ==================================================
# start
# /capitals
#
# ==================================================
# help
# 这是 老房东 的 cap... |
#!/usr/bin/env python
# coding: utf-8
import numpy as np
import pandas as pd
import os
import random
import warnings
from keras.preprocessing.sequence import pad_sequences
import tensorflow as tf
import keras
from keras.models import Sequential
from keras.layers import Embedding, Dense, LSTM
from kera... |
# Copyright 2018 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
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law o... |
#coding:utf-8
###########################################################
# SpCoTMHPi: Spatial Concept-based Path-Planning Program for SIGVerse
# Path-Planning Program by A star algorithm (ver. approximate inference)
# Path Selection: minimum cost (- log-likelihood) in a path trajectory
# <NAME> 2022/02/07
# Spacial T... |
# Copyright 2012 New Dream Network, LLC (DreamHost)
#
# 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... |
import sqlite3, time, unittest
from unittest import mock
from pod_feeder_v2.pod_feeder import *
class TestFeed(unittest.TestCase):
@mock.patch.object(Feed, "get_items")
@mock.patch.object(Feed, "fetch")
def test___init__(self, mock_fetch, mock_get_items):
mock_fetch.return_value = {"entries": ["en... |
# coding: utf-8
from __future__ import unicode_literals
import re
from .common import InfoExtractor
from ..compat import compat_str
from ..utils import (
determine_ext,
dict_get,
int_or_none,
unified_timestamp,
str_or_none,
strip_or_none,
try_get,
)
class SVTBaseIE(InfoExtractor):
_G... |
from pathlib import Path
from tempfile import NamedTemporaryFile
from unittest import TestCase
from unittest.mock import patch
import pytest
from parameterized import parameterized
from transformers import AutoConfig, PreTrainedTokenizerBase, is_tf_available, is_torch_available
from transformers.onnx import (
EXT... |
#!/usr/bin/env python
""" NumPy is the fundamental package for array computing with Python.
It provides:
- a powerful N-dimensional array object
- sophisticated (broadcasting) functions
- tools for integrating C/C++ and Fortran code
- useful linear algebra, Fourier transform, and random number capabilities
- and much... |
#!/usr/bin/python
# Copyright 2014 <NAME>, Hothead Games Inc.
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.1',
'status'... |
import os
import random
import sys
from argparse import ArgumentParser, Namespace
from pathlib import Path
from pprint import pprint
from flatland.utils.rendertools import RenderTool
from torch.utils.tensorboard import SummaryWriter
import numpy as np
import torch
from flatland.envs.rail_env import RailEnv, RailEnvAc... |
#!/usr/bin/env python3
import numpy as np
import pandas as pd
import os
import torch
from torch import optim
# -custom-written libraries
import options
import utils
import define_models as define
from data.load import get_multitask_experiment
from eval import evaluate
from eval import callbacks as cb
from train import... |
from functools import partial
from typing import Sequence, Mapping
import numexpr
import numpy
import xarray
from datacube.model import Measurement
try:
import dask.array
dask_array_type = (dask.array.Array,)
except ImportError: # pragma: no cover
dask_array_type = ()
from datacube import Datacube
fro... |
from __future__ import absolute_import
from __future__ import print_function
from __future__ import unicode_literals
import logging
import os
import signal
import sys
from sqlite3 import DatabaseError as SQLite3DatabaseError
import django
from django.core.management import call_command
from django.db.utils import Dat... |
#!/usr/bin/env python3
import argparse
import base64
import mimetypes
import os
import xml.etree.ElementTree as ET
from xml.etree.ElementTree import ParseError
from hashlib import md5
from hashlib import sha256
from Crypto.Cipher import AES
class JenkinsDecrypt():
def __init__(self, master_key, hudson_secret_ke... |
# -*- coding: utf-8 -
#
# This file is part of couchdbkit released under the MIT license.
# See the NOTICE for more information.
""" module that provides a Document object that allows you
to map CouchDB document in Python statically, dynamically or both
"""
from . import properties as p
from .properties import value... |
from app import app
from flask import render_template, flash, request, redirect, url_for, abort, jsonify
from app.forms import RegisterForm, SubmitForm, LambdaSubmitForm, PrivForm, ProfileForm
from app import db
from app.models import Team, Submission, Block, BlockSubmission
from app.grade import grade
from app.contest... |
# coding=utf-8
# Copyright 2017-2020 The THUMT Authors
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import argparse
import copy
import glob
import logging
import os
import re
import six
import socket
import time
import torch
import sys
sys.path.append('/... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.