text stringlengths 8.04k 46.5k |
|---|
#!/usr/bin/python3
"""
Module for querying weather forecast data from OpenWeatherMap and storage in database
"""
import json
import requests
import datetime
# Set up logging
import logging
import logging_plus
logger = logging_plus.getLogger(__name__)
logger.addHandler(logging.NullHandler())
# Defaults
# Current / hou... |
import streamlit as st
import pandas as pd
import altair as alt
import pickle
import numpy as np
from map import create_map
from airdata import AirData
from utils import parse_time, parse_time_hms
from vega_datasets import data
#st.set_page_config(layout="wide")
# Getting data ready, Refresh every hour (same data... |
from pathlib import Path
from typing import Literal, cast
from inflection import camelize, underscore, dasherize
from jsonclasses.cdef import Cdef
from jsonclasses.cgraph import CGraph
from jsonclasses.fdef import FStore, Fdef, FType, Nullability, Queryability, ReadRule, WriteRule
from jsonclasses.jfield import JField
... |
# coding=utf-8
import sys
import os
import csv
from datetime import datetime, timedelta
import numpy as np
import matplotlib.pyplot as plt
from matplotlib.dates import drange
from matplotlib.patches import Rectangle
import scenario_factory
# http://www.javascripter.net/faq/hextorgb.htm
PRIMA = (148/256, 164/256, 1... |
# Copyright 2017 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... |
import logging
import os
import random
import time
import warnings
from collections import OrderedDict
from contextlib import contextmanager
from pathlib import Path
from typing import List, Optional
import cv2
import numpy as np
import pandas as pd
import torch
import torch.nn as nn
import torch.nn.functional as F
im... |
import torch
import numpy as np
import argparse
import os
from utils import Logger, LogFiles, ValidationAccuracies, cross_entropy_loss, compute_accuracy, MetaLearningState,\
shuffle
from model import FewShotClassifier
from dataset import get_dataset_reader
from tf_dataset_reader import TfDatasetReader
from image_fo... |
""" The module provides utility functions to load tree object from files """
import os
import sys
from cached_property import cached_property
from . import source
from .compat.types import basestr
from .tree import Tree, flatten
class Loader(object):
"""
Configuration tree loader
:param Walker walk: W... |
# Test methods with long descriptive names can omit docstrings
# pylint: disable=missing-docstring
import warnings
from time import time
from numbers import Real
from itertools import starmap, chain
import unittest
import pickle
import numpy as np
from numpy.testing import assert_array_equal
from Orange.data import (... |
#!/usr/bin/env python3.5
# driver.py
#
# <NAME> and <NAME>
#
# Major Modification log:
# 2018-06-12 bam - refactored DAS to modularize code found in the run function
# 2017-12-10 slg - refactored the creation of objects for the DAS() object.
# 2017-11-19 slg - rewrite for abstract modular design, created experime... |
from enum import IntEnum
import os
import pygame
import random
import re
import time
import traceback
from cmg import color
from cmg.color import Color, Colors
from cmg import math
from cmg.input import *
from cmg.graphics import *
from cmg.application import *
from cmg.event import Event
from study_tool import card_at... |
"""PyMC3-ArviZ conversion code."""
import logging
import warnings
from typing import ( # pylint: disable=unused-import
TYPE_CHECKING,
Any,
Dict,
Iterable,
List,
Mapping,
Optional,
Tuple,
Union,
)
import numpy as np
import xarray as xr
from aesara.graph.basic import Constant
from ... |
# XXX TypeErrors on calling handlers, or on bad return values from a
# handler, are obscure and unhelpful.
from io import BytesIO
import os
import platform
import sys
import sysconfig
import unittest
import traceback
from xml.parsers import expat
from xml.parsers.expat import errors
from test.support i... |
# Copyright 2020 Makani Technologies LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to... |
# Copyright (c) 2020 <NAME>
from baselines.common import Dataset, explained_variance, fmt_row, zipsame
from baselines import logger
import baselines.common.tf_util as U
import tensorflow as tf, numpy as np
import time
from baselines.common.mpi_adam import MpiAdam
from baselines.common.mpi_moments import mpi_moments
fr... |
#
# This source file is part of the EdgeDB open source project.
#
# Copyright 2016-present MagicStack Inc. and the EdgeDB 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... |
import numpy as np
from sklearn.decomposition import PCA
import pandas as pd
import matplotlib.pyplot as plt
import random
import seaborn as sns
from sklearn.cluster import KMeans
from sklearn.metrics import confusion_matrix
from sklearn.metrics.cluster import adjusted_rand_score
from sklearn.datasets import fetch_open... |
"""
mbed SDK
Copyright (c) 2011-2015 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 wr... |
"""Common components for styled output.
This modules contains things that would be shared across outputters if there
were any besides Tabular. The Tabular class, though, still contains a good
amount of general logic that should be extracted if any other outputter is
actually added.
"""
from collections import defaul... |
# -*- coding: utf-8 -*-
"""BehaveX - Agile test wrapper on top of Behave (BDD)."""
# pylint: disable=W0703
# __future__ has been added to maintain compatibility
from __future__ import absolute_import, print_function
import codecs
import json
import logging.config
import multiprocessing
import os
import os.path
impo... |
import os
import csv
import threading
from .classes import Node, Link, Network, Column, ColumnVec, VDFPeriod, \
AgentType, DemandPeriod, Demand, Assignment, UI
from .colgen import update_links_using_columns
from .consts import SMALL_DIVISOR
__all__ = [
'read_network',
'load_columns',
... |
"""
Reference:
[1]: Branlard, Flexible multibody dynamics using joint coordinates and the Rayleigh-Ritz approximation: the general framework behind and beyond Flex, Wind Energy, 2019
"""
import numpy as np
from .utils import *
from .bodies import Body as GenericBody
from .bodies import RigidBody as Gen... |
# Copyright 21 May 2005 - (c) 2005 <NAME> <<EMAIL>>
# Copyright 2005-2007 <NAME> <<EMAIL>>
#
# This software may be used and distributed according to the terms of the
# GNU General Public License version 2 or any later version.
from __future__ import absolute_import
import contextlib
import struct
import sys
import t... |
"""
script to ease construction of CSDGM2-style metadata for an GeMS-style geodatabase.
To use,
Run ValidateDatabase to make sure that the database is complete and there are
no missing DMU, Glossary, or DataSources entries
In ArcCatalog, go to Customize>Options>Metadata and set Metadata Style to
... |
# -*- coding: utf-8 -*-
import asyncio
import json
import logging
import ssl as ssl_
import struct
import zlib
from collections import namedtuple
from enum import IntEnum
from typing import *
import aiohttp
logger = logging.getLogger(__name__)
ROOM_INIT_URL = 'https://api.live.bilibili.com/xlive/web-room/v1/index/g... |
# SPDX-License-Identifier: Apache-2.0
#
# Copyright (C) 2015, ARM Limited and contributors.
#
# 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
#
# ... |
"""Heap queue algorithm (a.k.a. priority queue).
Heaps are arrays for which a[k] <= a[2*k+1] and a[k] <= a[2*k+2] for
all k, counting elements from 0. For the sake of comparison,
non-existing elements are considered to be infinite. The interesting
property of a heap is that a[0] is always its smallest element.
Usag... |
from abc import ABC, abstractmethod
from collections import defaultdict, namedtuple
from typing import TYPE_CHECKING, Any, Dict, FrozenSet, Iterable, List, Optional, Set, Tuple, Union
from dagster import check
from dagster.core.errors import DagsterInvalidDefinitionError
from dagster.serdes import whitelist_for_serdes... |
# coding=utf-8
# Copyright 2020 The Trax Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... |
import click
import json
import numpy as np
import os
import tensorflow.compat.v1 as tf
import time
from luminoth.datasets import get_dataset
from luminoth.models import get_model
from luminoth.utils.bbox_overlap import bbox_overlap
from luminoth.utils.config import get_config
from luminoth.utils.image_vis import imag... |
# Copyright (c) 2017-present, Facebook, 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... |
# Copyright (c) 2021, NVIDIA CORPORATION. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appli... |
#!/usr/bin/env python
import numpy as np
from time import time
import pyfftw
from numpy.fft import fft, ifft, fftshift, ifftshift, fft2, ifft2
from scipy.special import jv as besselj
import finufftpy
def translations_brute_force(Shathat, Mhat, cmul_trans):
# Shathat: (q, te, k)
# Mhat: (im, k × γ)
# ... |
# -*- coding: UTF-8 -*-
from .ldata import bitPosArray, fileBits, rankBits, moveArray
from .bitboard import firstBit, iterBits
from .validator import validateMove
from pychess.Utils.const import (
SAN,
AN,
LAN,
ENPASSANT,
EMPTY,
PAWN,
KING_CASTLE,
QUEEN_CASTLE,
reprFile,
reprRa... |
#================================================================
#
# File name : utils.py
# Author : PyLessons
# Created date: 2020-09-27
# Website : https://pylessons.com/
# GitHub : https://github.com/pythonlessons/TensorFlow-2.x-YOLOv3
# Description : additional yolov3 and yolov4 functio... |
import asyncio
import random
import arrow
import discord
from discord.ext import commands, tasks
from libraries import emoji_literals
from modules import emojis, log, queries, util
logger = log.get_logger(__name__)
command_logger = log.get_command_logger()
class Events(commands.Cog):
"""Event handlers for vari... |
#!/usr/bin/python3
#
#
#
#
# <NAME> (January 2019), contact: <EMAIL>
import pandas as pd
import re
import sys,os
import numpy as np
import csv
import argparse
from datetime import datetime
def parse_arguments():
parser = argparse.ArgumentParser( description='Assimilate low resolution HLA type data.')
parser... |
import random
from tkinter import Tk, Frame, Listbox, Button, Label, Scrollbar, VERTICAL, END, SINGLE, NONE, \
StringVar, Radiobutton, Toplevel, N, S, E, W
from tkinter.ttk import Notebook
from project.contact import Contact
import pickle
from project.WheelSpinner.WheelSpinner import WheelSpinner
from project.Phone... |
#!/usr/bin/env python
#
# BEDOPS
# Copyright (C) 2011-2017 <NAME>, <NAME> and <NAME>
#
# 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
# (a... |
# coding=utf-8
# Copyright 2018 The Tensor2Tensor 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... |
"""Module containing the logic for the collection of data structure."""
import yaml
import json
import re
from functools import partial
from pprint import pprint
from dlapp.argumenthelper import validate_argument_type
from dlapp import utils
from dlapp.parser import SelectParser
from dlapp.validation import OpValidati... |
try:
import logging
except ImportError:
class logging:
def debug(self, *args, **kwargs):
pass
def __assert_data_tuple(data, num):
"""Internal helper to ensure data is a tuple of given `num` length."""
if not isinstance(data, tuple):
data = (data,)
if not len(data) == nu... |
# Copyright 1999-2020 Alibaba Group Holding Ltd.
#
# 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... |
"""
pygame-menu
https://github.com/ppizarror/pygame-menu
UTILS
Utility functions.
License:
-------------------------------------------------------------------------------
The MIT License (MIT)
Copyright 2017-2021 <NAME>. @ppizarror
Permission is hereby granted, free of charge, to any person obtaining a
copy of this ... |
# Copyright 2020 ByteDance 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 to in writin... |
from panda3d.core import *
from panda3d.direct import *
from direct.task import Task
from direct.showbase.DirectObject import DirectObject
from direct.directnotify.DirectNotifyGlobal import directNotify
def remove_task ( ):
if (MotionTrail.task_added):
total_motion_trails = len (MotionTrail.motion_trail... |
from typing import Dict, Iterator, Optional, Tuple, Union
import enum
import pathlib
import time
import warnings
from ctypes import CDLL, c_int
from wyzecam.api_models import WyzeAccount, WyzeCamera
try:
import av
import av.video.frame
except ImportError:
av = None
try:
import cv2
except ImportError... |
# This code is based on ufoProcessor code, which is licensed as follows:
# Copyright (c) 2017-2018 LettError and <NAME>
# All rights reserved.
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Softwar... |
# -*- coding: utf-8 -*-
#
# Copyright 2019-2020 Data61, CSIRO
#
# 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 ... |
import functools
import json
import logging
from collections import defaultdict
from datetime import datetime
from typing import Callable, Optional, Iterator, Tuple, List, Union, Dict, Any
from dcplib.aws.clients import clouddirectory as cd_client
from fusillade.directory.structs import ConsistencyLevel, UpdateObjectP... |
"""
https://docs.opencv.org/master/d8/d19/tutorial_stitcher.html
Stitching sample (advanced)
===========================
Show how to use Stitcher API from python.
"""
# Python 2/3 compatibility
from __future__ import print_function
import argparse
from collections import OrderedDict
from imutils import paths
import... |
from sympy import (Symbol, S, exp, log, sqrt, oo, E, zoo, pi, tan, sin, cos,
cot, sec, csc, Abs, symbols)
from sympy.calculus.util import (function_range, continuous_domain, not_empty_in,
periodicity, lcim, AccumBounds)
from sympy.core import Add, Mul, Pow
from sympy.... |
import asyncio
import logging
import time
from collections import OrderedDict
from datetime import datetime
from enum import Enum
from typing import (
Mapping,
Optional,
List,
Tuple,
Union,
Sequence,
AsyncGenerator,
Iterable,
TYPE_CHECKING,
)
from aioredis import ConnectionClosedErr... |
# -*- coding: utf-8 -*-
"""
Created on Fri Feb 26 13:12:28 2021
@author: <NAME> -workshop-LA-UP_IIT
"""
import geopandas as gpd
import fiona,io
from tqdm import tqdm
import pyproj
# pd.set_option('display.max_columns', None)
nanjing_epsg=32650 #Nanjing
data_dic={
'road_network':r'.\data\GIS\road Network Data OF ... |
#!/bin/python3
from contextlib import contextmanager
# pip3 install datetime
import datetime
import errno
import time
import shutil
import sys
import tempfile
from os import listdir, sep as os_sep
from os.path import isdir, isfile, join
# local imports
import consts
from args import Arguments, UpdateType
from github ... |
# This file is part of Indico.
# Copyright (C) 2002 - 2021 CERN
#
# Indico is free software; you can redistribute it and/or
# modify it under the terms of the MIT License; see the
# LICENSE file for more details.
import json
import os
import random
import re
import warnings
from collections import defaultdict
from con... |
#!/usr/bin/env python3
#-*- coding: utf-8 -*-
#comment from wenmei:
'''
nal_type:7和nal_type:8代表sps 和pps \
get length 8461, complete 1, type 0,
type 0 表示keyframe
'''
"""
Description: This app is used to parse the main log file and get the information of VoLTE video call
Version-0.3
Author: yi.qiu
E-m... |
"""
Copyright (C) 2019 NVIDIA Corporation. All rights reserved.
Licensed under the CC BY-NC-SA 4.0 license
(https://creativecommons.org/licenses/by-nc-sa/4.0/legalcode).
"""
import torch
from torch.utils.data import Dataset
import numpy as np
import time
import os
import cv2
import sys
import utils
from datasets.sca... |
""" # NOQA
:mod:`aioopenssl` --- A transport for asyncio using :mod:`OpenSSL`
##################################################################
This package provides a socket-based :class:`asyncio.Transport` which uses
:mod:`OpenSSL` to create a TLS connection. Optionally, the TLS handshake can be
deferred and perfo... |
#!/usr/bin/env python3
"""
Copyright (c) 2019-2021 Antmicro <www.antmicro.com>
Renode platform definition (repl) and script (resc) generator for LiteX SoC.
This script parses LiteX 'csr.json' file and generates scripts for Renode
necessary to emulate the given configuration of the LiteX SoC.
"""
import os
import sys... |
#!/usr/bin/env python2
# -*- coding: utf-8 -*-
"""
Created on Fri Mar 24 13:43:28 2017
@author: nightowl
"""
from __future__ import print_function
import os
# from fuzzywuzzy import fuzz
from shutil import copyfile
from ..io.database.sql_to_python import QuerySQL
from ..io.database.sql_connector import DVH_SQL
from .... |
from __future__ import absolute_import
from __future__ import print_function
from pysnptools.util.mapreduce1.runner import *
import logging
import fastlmm.pyplink.plink as plink
import pysnptools.util as pstutil
import pysnptools.util.pheno as pstpheno
import numpy as np
from fastlmm.inference import LMM
import scipy.s... |
"""
Python Interchangeable Virtual Instrument Library
Copyright (c) 2012-2016 <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
... |
#En cmd se ejecuta con los siguientes comandos
#py -3.1 "C:\Users\juanz\Google Drive\Semestre 6\Laboratorio Electronica Digital\ProyectoTurnero\Clases.py"
import sys
import time
import serial
import pygame
#--------------------------------------------------------------
#---- Inicia --- ClassTurnosDisponibles... |
# import packages here
import copy
import cv2
import numpy as np
import matplotlib.pyplot as plt
import glob
import random
import time
import torch
import torchvision
import torchvision.transforms as transforms
from torch.autograd import Variable
import torch.nn as nn
import torch.nn.functional as F
# my imports
fro... |
from time import time
import os
from random import gauss
import sys
import numpy as np
from keras.models import Sequential, load_model
from keras.layers import Dense, Activation
from Bio.SeqIO import SeqRecord
from Bio import SeqIO, Seq
from advntr.sam_utils import get_id_of_reads_mapped_to_vntr_in_bamfile, make_bam... |
"""
This is a wrapper for executing various parallel map routines in a consistent way.
The primary routines are:
work_orders(): Calls a function with args or kwargs.
def _do_work(i, foo=None):
print(i, foo)
results = zap.work_orders([
dict(fn=_do_work, args=(i,), foo=i*10)
... |
#!/usr/bin/env python
#
# Copyright 2019 DFKI GmbH.
#
# 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, merg... |
# -*- coding: utf-8 -*-
#
# Copyright (c) 2012-2013 <NAME> <<EMAIL>>
# Copyright (c) 2016 <NAME> <<EMAIL>>
# Copyright (c) 2019 Ansible Project
# Copyright (c) 2020 <NAME> <<EMAIL>>
# Copyright (c) 2021 Ansible Project
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
# Parts... |
#--------------------------------------------------------------------------------
# Authors:
# - <NAME>: <EMAIL>
# - <NAME>: <EMAIL>
#
# MIT License
# Copyright (c) 2021 CORSMAL
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (t... |
# This is python script for Metashape Pro. Scripts repository: https://github.com/agisoft-llc/metashape-scripts
#
# Based on https://colab.research.google.com/github/tensorflow/lucid/blob/master/notebooks/differentiable-parameterizations/style_transfer_3d.ipynb
# Modifications:
# 1. Taking into account cameras position... |
import numpy as np
import torch
import torch.nn as nn
import torch.nn.functional as F
import math, copy, time
from torch.autograd import Variable
from utils import outputActivation
import pdb
# Customizations
# - DONE Embeddings: linear transform d_feats -> d_model features
# - DONE Generator
# - DONE Batching
# D... |
import numpy as np
from netCDF4 import Dataset
from datetime import datetime
from datetime import timedelta
import os
import sys
import matplotlib.pyplot as plt
from matplotlib import gridspec
import matplotlib.colors as mcolors
import matplotlib.patches as patches
from matplotlib.colors import BoundaryNorm
from to... |
#!/usr/bin/env python2.6
# nodestored.py - block storage access API
# renamed from gt-xm-storage.py
# refactored from gt-xm-reimage0.py
# refactored from original gt-xm-reimage0 shell script
#
# Copyright (C) 2006-2011 <NAME>
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use t... |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
from builtins import *
from future.utils import iteritems
import numpy as np
from pandas import DataFrame, Series
import scipy.sparse as sparse
from sqlalchemy.sql import... |
"""
Support for interface with a Sony Bravia TV.
For more details about this platform, please refer to the documentation at
https://github.com/custom-components/media_player.braviatv_psk
"""
import urllib.parse as urlparse
from urllib.parse import parse_qs
import logging
import asyncio
import homeassistant.helpers.con... |
"""Module that contains the command line app.
Why does this file exist, and why not put this in __main__?
You might be tempted to import things from __main__ later, but that will cause
problems: the code will get executed twice:
- When you run `python -mhangar` python will execute
``__main__.py``... |
"""Core functionality for foamPy."""
from __future__ import division, print_function
import numpy as np
import os
import re
import datetime
import sys
import time
import subprocess
import pandas
import glob
from .dictionaries import *
from .templates import *
def gen_stripped_lines(fpath):
with open(fpath) as f:... |
# -*- coding: utf-8 -*-
# Copyright 2017 <NAME>
# Copyright 2018 <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/licenses/LICENSE-2.0
#
# Un... |
import dataclasses
import click
import datetime
import neuro_extras
from collections import defaultdict
from graphviz import Digraph
from neuro_cli import __version__ as cli_version
from neuro_sdk import Client, ResourceNotFound, __version__ as sdk_version
from operator import attrgetter
from rich import box
from rich... |
"""ISU Soil Moisture Network Time Series"""
import datetime
import psycopg2
import pytz
import pandas as pd
from pandas.io.sql import read_sql
import matplotlib.dates as mdates
from pyiem import meteorology
from pyiem.plot.use_agg import plt
from pyiem.datatypes import temperature, distance
from pyiem.util import get_... |
#!/usr/local/python36/bin/python3.6
# -*- coding: utf-8 -*-
'''
用户管理系统V3
Author: WangXiaoYun
'''
import sys, os, getpass,math,csv,logging
from prettytable import PrettyTable
x = PrettyTable()
x.field_names = ["UserID", "Name", "Phone", "Company", "Address", "Email"]
_StuInfo = 'StuInfo.txt'
_TempDict = {}
_HelpMeu = '... |
from __future__ import division
from collections import defaultdict
from itertools import chain
import simplejson
import copy
import math
from urllib import unquote
from datetime import datetime, timedelta, date
from urllib import unquote
from suds import WebFault
from django.contrib.gis.geos import Point
from djang... |
# vim:fileencoding=utf-8:noet
_log = []
vars = {}
vvars = {'version': 703}
_tabpage = 0
_mode = 'n'
_buf_purge_events = set()
options = {
'paste': 0,
'ambiwidth': 'single',
'columns': 80,
'encoding': 'utf-8',
}
_last_bufnr = 0
_highlights = {}
from collections import defaultdict as _defaultdict
_environ = _defaultd... |
#-*- coding:utf-8 -*-
import re
import ocr
import time
import sys
import json
import numpy as np
from PIL import Image
reload(sys)
sys.setdefaultencoding('utf-8')
def str2date(s):
try:
year = s.split('年')[0]
month = s.split('年')[1].split('月')[0]
day = s.split('年')[1].split('月')[1].split('日')... |
from typing import Dict, Any
from pyNastran.op2.op2_interface.random_results import (
RADCONS, RAECONS, RASCONS, RAPCONS, RAFCONS, RAGCONS, RANCONS,
RADEATC, RAEEATC, RASEATC, RAPEATC, RAFEATC, RAGEATC, RANEATC,
ROUGV1, RADEFFM, SRSS, ABS, NRL,
AutoCorrelationObjects, PowerSpectralDensityObjects, RootM... |
import csv
import os
from pprint import pprint
from types import SimpleNamespace
from tensorflow import keras
"""
import torch
import torch.nn.functional as F
import torch.optim as opt
from torch.utils.tensorboard import SummaryWriter
"""
from .models.senn import SENN, DiSENN
from .models.losses import *
from .utils... |
import inspect, sys, traceback
from types import MethodType
from copy import copy, deepcopy
import numpy as np
from .SilkBase import SilkBase, compile_function
from .validation import (
schema_validator,
Scalar, scalar_conv, _types, infer_type, is_numpy_structure_schema, ValidationError
)
allowed_types = tuple(_ty... |
"""Tests for API endpoints that performs stack analysis."""
import requests
import time
import os
from behave import given, then, when
from urllib.parse import urljoin
import jsonschema
from src.attribute_checks import *
from src.parsing import *
from src.utils import *
from src.json_utils import *
from src.authoriza... |
# -*- coding: utf-8 -*-
## Copyright 2009-2020 NTESS. Under the terms
## of Contract DE-NA0003525 with NTESS, the U.S.
## Government retains certain rights in this software.
##
## Copyright (c) 2009-2020, NTESS
## All rights reserved.
##
## This file is part of the SST software package. For license
## information, see... |
# # Chapter 5: Image Enhancement
# Author: <NAME>
###########################################
# ## Problems
# ### 1.1 BLUR Filter to remove Salt & Pepper Noise
get_ipython().run_line_magic('matplotlib', 'inline')
import numpy as np
import matplotlib.pylab as plt
from PIL import Image, ImageFilter
from copy impor... |
# -*- coding: utf-8 -*-
from datetime import datetime
from operator import attrgetter
import os
from sqlalchemy import Column, Integer, String, Date, ForeignKey, Enum, Boolean, UniqueConstraint, CheckConstraint, \
DateTime
from sqlalchemy.dialects.postgresql import JSON
from sqlalchemy.ext.associationproxy import ... |
""" `mplsoccer.statsbomb` is a python module for loading StatsBomb data. """
# Authors: <NAME>, https://twitter.com/numberstorm
# License: MIT
import os
import warnings
import numpy as np
import pandas as pd
EVENT_SLUG = 'https://raw.githubusercontent.com/statsbomb/open-data/master/data/events'
MATCH_SLUG = 'https:... |
import math
import random
from dataclasses import dataclass
from transformers.models.bart.modeling_bart import (
BartLearnedPositionalEmbedding,
BartEncoderLayer,
BartPretrainedModel,
BartConfig,
ACT2FN,
shift_tokens_right, _make_causal_mask, _expand_mask
)
from my_transformers.modeling_bart ... |
# Copyright 2019 TerraPower, LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writi... |
import re
import os
import pandas as pd
import numpy as np
from .extract_tools import default_tokenizer as _default_tokenizer
def _getDictionnaryKeys(dictionnary):
"""
Function that get keys from a dict object and flatten sub dict.
"""
keys_array = []
for key in dictionnary.keys():
... |
#!/usr/bin/env python
from __future__ import print_function
import os
import subprocess
import sys
from peyutil import (read_as_json,
write_as_json)
from peyotl import (read_all_otifacts,
filter_otifacts_by_type,
partition_otifacts_by_root_element, )
from t... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
__author__ = "<NAME>"
__doc__ = r"""
Created on 27-10-2020
"""
import random
import pygame
pygame.init()
display_width = 800
display_height = 600
game_display = pygame.display.set_mode((display_width, display_height))
# icon = pygame.image.load... |
import pip_setup
pip_setup.install("moviepy")
pip_setup.install("pygame")
import Menu
import pygame
from moviepy.editor import *
import random
from Settings import *
from Sprites import *
from Menu import *
import time
import numpy as np
class GAME :
def __init__(self):
#GAME ~initiali... |
import os
from .check_type import KERNEL_VER_INPUT
from .definition_script import *
from .get_url import *
def buildmain():
os.chdir('../../catalog')
if os.path.exists(KERNEL_VER_INPUT):
os.remove((KERNEL_VER_INPUT) + '/install.sh')
os.remove((KERNEL_VER_INPUT) + '/README.md')
os.rmdir... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.