text stringlengths 3.07k 22.1k |
|---|
import copy
import time
from torchvision.utils import make_grid
import matplotlib.pyplot as plt
import numpy as np
import torch
import torch.nn as nn
import torchvision
from torchnet import meter
from torch.autograd import Variable
import sys
sys.path.append('scripts')
from cat_breeds.data_loader import dset_classes, ... |
# Copyright 2018-2020 Xanadu Quantum Technologies 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... |
from __future__ import unicode_literals
import datetime
from django.conf import settings
from django.core.urlresolvers import reverse
from django.utils.feedgenerator import rfc2822_date, Rss201rev2Feed, Atom1Feed
from django.shortcuts import get_object_or_404
from django.contrib.sites.shortcuts import get_current_si... |
from abc import ABC, abstractmethod
from typing import List, Dict, Set, Pattern, Match
from copy import deepcopy
from collections import namedtuple
from itertools import chain
import regex
from .constants import *
from recognizers_text.utilities import RegExpUtility
from recognizers_text.extractor import Extractor, Ex... |
# SPDX-License-Identifier: BSD-3-Clause
# Copyright(c) 2010-2015 Intel Corporation
from __future__ import print_function
import subprocess
from docutils import nodes
from distutils.version import LooseVersion
from sphinx import __version__ as sphinx_version
from sphinx.highlighting import PygmentsBridge
from pygments.... |
from typing import Any, Callable, Dict, List, Optional, Sequence, Tuple, Union
import matplotlib.pyplot as plt
import numpy
import pandas
from matplotlib.axes import Axes
from scipy.interpolate import CloughTocher2DInterpolator as CT2DI
def bisection_search(
function: Callable[[float], float],
seek_value: fl... |
import functools
import json
import random
import logging
import six.moves.urllib as urllib
import zlib
import cherrypy
import mock
import pytest
import requests
import six
import pytest_vts
import pytest_vts.logic._compat.cookie_parsing_library_errors as cookie_parsing_compat
from tests.server_fixtures.multiple_set... |
import pygame
import os
import time
class Walls:
def __init__(self, pos, size, color):
self.pos = pos
self.size = size
self.color = color
self.rect = pygame.Rect(pos[0], pos[1], size[0], size[1])
def draw(self):
pygame.draw.rect(screen, self.color, (self.p... |
# -*- coding: utf-8 -*-
# Copyright 2017-2019 <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
#
# Unless required by applicable law or ag... |
from __future__ import division # Python 2 users only
from __future__ import print_function
__doc__ = """ numpy utility functions used for tSNE modelling"""
import numpy as np
def Hbeta_vec(distances, betas):
"""
Function that computes the Gaussian kernel values given a vector of
squared Euclidean dist... |
"""
Streaming data from micro-manager to napari: PSF Viewer
developed by <NAME>, Danzl lab, IST Austria, (c) 2020
latest version on github: https://github.com/wiebkejahr/pycro-manager
If you use this tool, please cite:
pycro-manager: <NAME>., <NAME>., <NAME>. et al. Pycro-Manager: open-source software for customized ... |
import matplotlib
matplotlib.use("TkAgg")
import os
import pandas as pd
import numpy as np
import torch
import torch.optim as optim
import time
import matplotlib.pyplot as plt
import sys
sys.path.append(os.path.join("..", ".."))
from torchid.ssmodels_ct import MechanicalStateSpaceSystem
from torchid.ss_simulator_ct imp... |
import numpy as np
class OverlayCanvas:
COLOR_NONE = 0x7FFF
COLOR_MARK = 0x7FFE
def __init__(self):
self.data = np.ndarray((16, 16), np.uint16)
self.clear()
def clear(self):
self.data[:, :] = OverlayCanvas.COLOR_NONE
@staticmethod
def _adjust_region(x1, y1, x2, y2, i... |
# -*- coding: utf-8 -*-
"""
Created on Tue Mar 2 02:16:07 2021
Monte Carlo - Problema Monty Hall si Paradoxul Zilelor de Nastere
@author: Me
@grupa: 341
@proiect: Proiect 1
"""
# Biblioteci
from random import shuffle, choice, randint
import matplotlib.pyplot as plt
import seaborn as sns
i... |
# -*- coding: utf-8 -*-
import json
import os
import yaml
from prospector.tools import TOOLS
BUILTIN_PROFILE_PATH = os.path.abspath(os.path.join(os.path.dirname(__file__), 'profiles'))
class ProfileNotFound(Exception):
def __init__(self, name, profile_path):
super(ProfileNotFound, self).__init__()
... |
# (C) Datadog, Inc. 2010-2016
# All rights reserved
# Licensed under Simplified BSD License (see LICENSE)
# stdlib
import logging
import os
import time
# 3rd party
from docker import Client
from docker import tls
# project
from utils.singleton import Singleton
class MountException(Exception):
pass
# Default d... |
# Copyright (c) 2021 OpenCyphal
# This software is distributed under the terms of the MIT License.
# Author: <NAME> <<EMAIL>>
from __future__ import annotations
from typing import TYPE_CHECKING, Optional, Callable, AbstractSet, Any
import dataclasses
import math
import numpy as np
from numpy.typing import NDArray
impo... |
"""
Copyright (c) Contributors to the Open 3D Engine Project.
For complete copyright and license terms please see the LICENSE at the root of this distribution.
SPDX-License-Identifier: Apache-2.0 OR MIT
"""
import azlmbr
from shiboken2 import wrapInstance, getCppPointer
from PySide2 import QtCore, QtWidgets, QtGui
fr... |
#!/usr/bin/python
from __future__ import print_function, division
import sys
from subprocess import call
import os
import shlex
import argparse
import textwrap
import sqlite3
import socket # for hostname
import getpass # for username
from util import (walk_runs, get_trailing_num, get_result_file,
get_task_tabl... |
# Copyright 2014 Midokura SARL
#
# 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... |
import Tkinter as tk
import tkFont as tkFont
import ttk as ttk
from event import EventHook
from ..exceptions.handling import ExceptionHandler
class GridBox(object):
def __init__(self, master, headers, row, column):
self.master = master
self.headers = headers
self.items_dict = {}
... |
import cv2
import sys
import collections
import numpy as np
from matplotlib.backends.backend_agg import FigureCanvasAgg as FigureCanvas
from matplotlib.figure import Figure
DEMO_DELAY = 100 # (ms) set to 0 for wait until key-press
COLOR_PERSON = (255, 0, 0)
COLOR_LC_BEFORE = (0, 255, 0)
COLOR_LC_AFTER = (0, 0, 255)
C... |
UNK = 'unk'
VOCAB_SIZE = 17000
limit = {
'maxq' : 25,
'minq' : 2,
'maxa' : 25,
'mina' : 2
}
EN_WHITELIST = '0123456789abcdefghijklmnopqrstuvwxyz ' # space included
FILENAME = 'data/pro_data/chat.txt'
import random
import sys
from shutil import copyfile
import nltk
import it... |
import io
import pytest
import hashlib
import copy
from collections import defaultdict
from mock import MagicMock, patch
from werkzeug.wsgi import LimitedStream
from swiftclient.client import ClientException, ReadableToIterable
from storage import StorageContext
from storage.swift import SwiftStorage, _EMPTY_SEGMENT... |
# -*- coding: utf-8 -*-
"""
Created on Wed Feb 17 23:44:18 2021
Author: <NAME>
License: BSD-3
"""
import numpy as np
from numpy.testing import assert_allclose, assert_array_less
from scipy import stats
from statsmodels.distributions.copula.api import (
CopulaDistribution, ArchimedeanCopula)
from statsmodels... |
import csv
import io
import re
import uuid
import requests
class AlabamaBanner:
def __init__(self, config):
self.groupsmap = config["groupsmap"]
country_codes_url = ("https://raw.githubusercontent.com/"
"datasets/country-codes/master/data/"
... |
import pytest
from django.conf import settings
from django.core.management import call_command
import amo
import amo.tests
from addons.management.commands import approve_addons
from devhub.models import AddonLog
from editors.models import ReviewerScore
# Where to monkeypatch "lib.crypto.tasks.sign_addons" so it's c... |
# coding=UTF-8
from data_loader import Dataset_ETT_hour, Dataset_ETT_minute, Dataset_Custom
from model import Transformer, Transformer_Mask
from torch.utils.tensorboard import SummaryWriter
from utils.tools import EarlyStopping
from metrics import metric
from metrics import AverageMeter
import numpy as np
import torch... |
# SPDX-FileCopyrightText: Copyright (c) 2021 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
# SPDX-License-Identifier: BSD-3-Clause
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# 1. Redistributions of sourc... |
# Copyright (c) OpenMMLab. All rights reserved.
"""Visualized instances of saved dataset.
Example:
python tools/detection/misc/visualize_saved_dataset.py \
--src ./work_dirs/xx_saved_data.json
--dir ./vis_images
"""
import argparse
import json
import os
import mmcv
import numpy as np
from terminal... |
import os
import sys
import random
import numpy
import time
from .methods.Lda import Lda
from .methods.Lsa import Lsa
file_dir = os.path.dirname(__file__)
sys.path.append(file_dir)
from .preprocessor.text_preprocessor import TextPreprocessor
from results_saver import LogWriter
from .tests.model_tester import ModelTe... |
#!/usr/bin/python
# WS client example
import sys;
sys.dont_write_bytecode = True;
import base64
import io
import logging
from os.path import expanduser
from threading import Timer
from absl import flags
import binascii
import curve25519
import pyqrcode
import websocket
import traceback
from utilities import *
from... |
import json
import os
import re
import urllib
from time import sleep
import mwparserfromhell
from mwparserfromhell.nodes.extras import Parameter
from praw.exceptions import RedditAPIException
from praw.models import Submission
from psaw import PushshiftAPI
from requests import get
import praw
import requests
import w... |
# analog of sesame's SigSet class
import pandas as pd
import numpy as np
import methylprep
from pathlib import Path
def sesame_convert(filename, LOCAL_PATH = Path('/Volumes/LEGX/GSE69852/idats/'), drop_rs=True):
data = pd.read_csv(Path(LOCAL_PATH,filename)).rename(columns={'Unnamed: 0':'IlmnID','M':'meth','U':'unm... |
from django.contrib.auth import login as auth_login
from django.contrib.auth.models import User
from django.shortcuts import render, redirect
from forms import postingForm, SignUpForm, message, forumPostForm,topicForm, apcSearch
from models import Posting, Profile, Massage,forum_topic, forum_post
from datetime import *... |
# Copyright Contributors to the Pyro project.
# SPDX-License-Identifier: Apache-2.0
from functools import namedtuple, partial
import warnings
import tqdm
import jax
from jax import jit, lax, random
import jax.numpy as jnp
from jax.tree_util import tree_map
from numpyro.distributions import constraints
from numpyro.... |
"""
The SparseL1Descent attack.
"""
import warnings
from distutils.version import LooseVersion
import tensorflow as tf
from cleverhans.attacks.attack import Attack
from cleverhans import utils_tf
from cleverhans.utils_tf import clip_eta, random_lp_vector
from cleverhans.compat import reduce_max, reduce_sum, \
soft... |
''' Energy Normalization Module
This module contains functions to help normalize AC energy output with measured
poa_global in preparation for calculating PV system degradation.
'''
import pandas as pd
import pvlib
import numpy as np
from scipy.optimize import minimize
import warnings
class ConvergenceError(Exceptio... |
# Copyright 2018 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... |
# Copyright (C) 2015-2016 The bitcoin-blockchain-parser developers
#
# This file is part of bitcoin-blockchain-parser.
#
# It is subject to the license terms in the LICENSE file found in the top-level
# directory of this distribution.
#
# No part of bitcoin-blockchain-parser, including this file, may be copied,
# modif... |
# Copyright 2017 <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
#
# Unless required by applicable law or agreed to in writing, softwa... |
"""This module contains functions for turning a chain in a URDF to a
casadi function.
"""
import casadi as cs
from urdf_parser_py.urdf import URDF, Pose
from urdf2casadi import casadi_geom
from urdf2casadi import numpy_geom
def from_string(root, tip, urdfstring):
robot_desc = URDF.from_xml_string(urdfstring)
... |
# coding: utf-8
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import collections
import hashlib
import numbers
import tensorflow as tf
from tensorflow.python.framework import constant_op
from tensorflow.python.framework import dtypes
from tensorflow.python... |
import numpy as np
from matplotlib.ticker import MaxNLocator
import config as cfg
import graphutils as graph
import motifutils as motif
import visutils as vis
# Creates a graph from a labels dataframe, then plots the same figures as with a regular results set.
def draw_results_reference(audio, fs, labels_df, name='a... |
from pgreaper._globals import SQLIFY_PATH, preprocess
from pgreaper.core import assert_table, ColumnList, Table
from pgreaper.io.zip import open, ZipReader
from .conn import *
from .database import add_column, create_table, get_schema, \
get_table_schema, get_pkey, get_primary_keys
from psycopg2 import sql as sql_... |
import json
import os
import math
import base64
import time
from utility import tool
import threading
import re
def uploadFile(cookie: dict, videoPath: str, enableParallel=False) -> str:
logger = tool.getLogger()
logger.info(f"start {videoPath}")
file_size = os.path.getsize(videoPath)
s = tool.Session... |
from scvi.dataset.dataset import GeneExpressionDataset
from sklearn.datasets import dump_svmlight_file, load_svmlight_file
import numpy as np
import loompy
import os
class ZeiselMoleArchData(GeneExpressionDataset):
def __init__(self, save_path='/data/yosef2/scratch/chenling/scanvi_data/',coarse=True):
sel... |
# -*- coding: utf-8 -*-
import json
import os
import sys
import time
import uuid
from decimal import Decimal
from io import BytesIO
import lxml
import requests
from django.conf import settings
from django.utils.translation import ugettext as _
from geonode.geoserver.helpers import (cascading_delete, get_store, gs_cata... |
import argparse
import concurrent.futures
import csv
import os
import threading
from os.path import isfile, join
from random import randint
import torch
import torchvision.transforms as T
from skimage import feature
from models.neuralhash import NeuralHash
from losses.hinge_loss import hinge_loss
from losses.quality_... |
from tensorflow.python.framework import ops
import tensorflow.compat.v1 as tf
tf.disable_v2_behavior()
from train_loop import augment
import numpy as np
import sys
import os
import cv2
import argparse
def register_gradient():
"""
register gradients for ReLU
"""
if "GuidedBackPropReLU" not in ops._gra... |
import typing
import matplotlib
import numpy
from matplotlib import cm as matplotlib_cm
from matplotlib.axes import Axes
from matplotlib.figure import Figure
from interface.instrument_class import Instrument, Note
matplotlib.use('TkAgg')
plot_func_type = typing.Callable[[Instrument, typing.Optional[tuple[int, int]]... |
#!/bin/sh
''''exec python3 -u -- "$0" ${1+"$@"} # '''
# #! /usr/bin/env python3
# Copyright 2016 Euclidean Technologies Management LLC 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 t... |
"""
This file convert the KITTI annotation into COCO format.
Code written by <NAME>
https://github.com/xingyizhou/CenterTrack/blob/master/src/tools/convert_kittitrack_to_coco.py
"""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import pickle
import json... |
import argparse
import json
import os
import numpy as np
import tensorflow.compat.v1 as tf
import time
import tqdm
import glob
import pickle
from copy import copy
from encode_bpe import BPEEncoder_ja
import model
if int(tf.__version__[0]) > 1:
from model import HParams as HParams
else:
from tensorflow.contrib... |
import os
import gc
import json
import visual_genome.utils as utils
from visual_genome.models import (Image, Object, Attribute, Relationship,
Graph, Synset)
def get_all_image_data(data_dir=None):
"""
Get Image ids from start_index to end_index.
"""
if data_dir is Non... |
import numpy as np
import tensorflow.compat.v1 as tf
tf.disable_v2_behavior()
import os
class Color:
INFO = '\033[1;34m{}\033[0m'
WARNING = '\033[1;33m{}\033[0m'
ERROR = '\033[1;31m{}\033[0m'
class Buffer:
def __init__(self):
pass
def push(self, **kwargs):
raise NotImplementedEr... |
import trio
import io
import os
import time
import traceback
from pyrum import Rumor
from remerkleable.complex import Container
from remerkleable.byte_arrays import Bytes32, Bytes4
from remerkleable.basic import uint64
from eth2spec.config.config_util import prepare_config
from importlib import reload
import csv
... |
import argparse
import sys
import os
import shutil
import pathlib
import pickle
from typing import Union, Optional, List, Tuple, Text, BinaryIO
import numpy as np
from PIL import Image
import torch
from torch import nn, optim
from torch.utils.data import DataLoader, Dataset
from torchvision.utils import make_grid, sav... |
import datetime
import decimal
import more_itertools # PyPI: more-itertools
import pytz # PyPI: pytz
import wtforms # PyPI: WTForms
import wtforms.ext.dateutil.fields # PyPI: WTForms
import wtforms.validators # PyPI: WTForms
import gefolge_web.util
class AnnotatedStringField(wtforms.StringField):
def __init__(se... |
import numpy as np
from copy import deepcopy
from warnings import warn
import gc
from time import time
import multiprocessing as MP
from Florence.Tensor import itemfreq, makezero, unique2d, remove_duplicates_2D
import Florence.ParallelProcessing.parmap as parmap
from .GetInteriorCoordinates import GetInteriorNodesCoor... |
import sys
sys.path.append('..')
import numpy as np
from common.functions import softmax
from ch06.rnnlm import Rnnlm
from ch06.better_rnnlm import BetterRnnlm
from dataset import ptb
from dataset import sequence
from common.time_layers import *
from common.base_model import BaseModel
import matplotlib.pyplot as plt
fr... |
import functools, time, logging, sys, pickle
from flask import (
Blueprint, flash, g, redirect, render_template, request, session, url_for
)
from werkzeug.security import check_password_hash, generate_password_hash
from werkzeug.exceptions import abort
from quiz.auth import login_required, admin_login_required
f... |
#!/usr/bin/env python3
from argparse import ArgumentParser
from urllib.parse import urlparse
from base64 import b64decode
from itertools import count
import os
import sys
import json
import shutil
try:
import ijson.backends.yajl2_cffi as ijson
except ImportError:
try:
import ijson.backends.yajl2 as i... |
from tkinter import *
from tkinter import ttk
from tkinter import filedialog
import pandas as pd
import numpy as np
from sklearn.preprocessing import LabelEncoder
from keras.layers import Dense, Flatten, BatchNormalization, Dropout, Conv2D, MaxPooling2D
from keras.models import Sequential, load_model
from keras... |
from lxml import etree
import time
from selenium.webdriver import Chrome
from selenium.webdriver import ChromeOptions
#导入期望场景类
import redis
from selenium.webdriver.support import expected_conditions
from selenium.webdriver.common.desired_capabilities import DesiredCapabilities
from selenium.webdriver.support.ui import ... |
# -*- coding: utf-8 -*-
import numpy as np
from six.moves import xrange
import tensorflow as tf
class Seq2SeqModel(object):
def __init__(self,
source_vocab_size,
target_vocab_size,
buckets,
size,
num_layers,
max... |
# -*- coding: utf-8 -*-
#
# Copyright (C) 2010-2016 PPMessage.
# <NAME>, <EMAIL>.
# All rights are reserved.
#
from .wshandler import WSHandler
from ppmessage.core.constant import REDIS_HOST
from ppmessage.core.constant import REDIS_PORT
from ppmessage.core.constant import PCSOCKET_SRV
from ppmessage.core.constant ... |
import itertools
from difflib import SequenceMatcher
from heapq import nlargest
from typing import List, Dict
from lib.ner_lists.entity import Entity
class FuzzyMatcher:
"""
Class to match words with list elements
"""
def __init__(self, cutoff_score: float):
"""
:param cutoff_score: S... |
from sklearn.cluster import KMeans, DBSCAN
from sklearn.ensemble import IsolationForest
from sklearn.tree import ExtraTreeRegressor
from datrics_json import csr
import numpy as np
import scipy as sp
from datrics_json import classification as clf
from datrics_json import regression as reg
from dask_ml.preprocessing impo... |
import logging
import os
import time
from abc import abstractmethod, ABCMeta
from collections import deque
import numpy as np
logging.basicConfig(level=logging.INFO)
def get_logger(name=__name__):
logger = logging.getLogger(name)
logger.setLevel(level=logging.INFO)
return logger
def get_console_file_l... |
from math import pi, sin, cos, tan, atan, log, exp
from functools import lru_cache, partial
from myvec import V3
from myarr import TList
class Data:
def __init__(self):
self.materials = TList(Material)
self.scintillators = TList(Material)
self.media = TList(Material)
self.isotopes = TList(Isotope)
self.f... |
from collections import namedtuple
import json
import logging
import pprint
import re
import six
(STATUS_OK, STATUS_ERROR) = range(2)
CommandsResponse = namedtuple('CommandsResponse', ['status', 'value'])
LOG = logging.getLogger('bgpspeaker.operator.command')
def default_help_formatter(quick_helps):
"""Apply d... |
"""Unit tests for the :func:`esmvalcore.preprocessor.regrid.regrid`
function."""
import unittest
from unittest import mock
import iris
import numpy as np
import pytest
import tests
from esmvalcore.preprocessor import regrid
from esmvalcore.preprocessor._regrid import (
_CACHE,
HORIZONTAL_SCHEMES,
_horizo... |
import os
import platform
import sys
from datetime import datetime, timezone
from pathlib import Path
from unittest.mock import MagicMock, Mock
import pytest
import tzlocal.unix
import tzlocal.utils
if sys.version_info >= (3, 9):
from zoneinfo import ZoneInfo, ZoneInfoNotFoundError
else:
from backports.zonei... |
from itertools import repeat
from collections import defaultdict
import torch
from torch._thnn.utils import parse_header, THNN_H_PATH
from torch.autograd import Variable
from torch.autograd.function import Function, InplaceFunction, once_differentiable
from torch._thnn import type2backend
from .auto_double_backwards i... |
import glob
import os
import json
import uuid
import pandas as pd
import numpy as np
import argparse
import xml.etree.ElementTree as ET
from PIL import Image
from tqdm import tqdm
try:
from pandas import json_normalize
except:
from pandas.io.json import json_normalize
class MultipleKVAction(argparse.Action):... |
# -*- coding: utf-8 -*-
# standard library
import os
# dash libs
import dash
from dash.dependencies import Input, Output
import dash_core_components as dcc
import dash_html_components as html
import plotly.figure_factory as ff
import plotly.graph_objs as go
# pydata stack
import pandas as pd
from sqlalchemy import cr... |
# pytorch dqn implementation
# Input will be the observation of agents
# Currently, consider the fully observable scenario
# Modified from **Author**: `<NAME> <https://github.com/apaszke>`
import math
import random
from collections import namedtuple
import numpy as np
from itertools import count
#import matplotlib
#... |
"""
This script performs a Neural Style Transfer.
For an interactive version refer to the file neural_style_transfer_colab.ipynb
"""
import tensorflow as tf
from tensorflow.keras import optimizers
from tensorflow.keras.models import Model
from tensorflow.keras.applications import vgg19
import matplotlib.pyplot as plt
... |
'''
this is a child (a window) of the friend window (a window_list_no_use_now)
'''
import win32con, win32gui, win32api
import struct
from image_window import image_window
import Image
import message_transaction as mt
from win32api import RGB
import tkinter as tk
from tkinter.constants import HORIZONTAL
from pip._vendor... |
# -*- coding: utf-8 -*-
"""
Created on Mon Oct 28 10:46:17 2019
@author: slq584
"""
import pandas as pd
import numpy as num
import matplotlib.pyplot as plt
import paths as p
import API_call as api
import population_growth as pop
import population_trends as popt
"""
"""
def get_nominal(county, base_year, fips):
... |
import warnings
from collections import Counter
from dataclasses import dataclass
from datetime import datetime, date
from typing import Iterable, Optional, Set, Tuple, Union, List
import shapely
import shapely.ops
import structlog
from shapely.geometry import MultiPolygon
from shapely.geometry.base import BaseGeometr... |
import os, sys, glob, argparse
import logging
import types
from collections import OrderedDict
import torch
import torch.nn.functional as F
import utils
import models
import main as entry
os.environ["CUDA_DEVICE_ORDER"]="PCI_BUS_ID"
os.environ["CUDA_VISIBLE_DEVICES"]="0"
def export_onnx(args):
model_name = args... |
import json
import os
import httpx
import time
def get_cities(cfg):
return cfg['cities'].keys()
def get_usable_bounding_boxes(nominal_boxes, cfg):
FLICKR_PUBLIC = get_secret('flickr_api_key')
FLICKR_SECRET = get_secret('flickr_api_secret')
flickr = FlickrAPI(FLICKR_PUBLIC, FLICKR_SECRET, format='parsed-j... |
# -*- coding: utf-8 -*-
import netifaces
from i3pystatus import IntervalModule
from i3pystatus.core.color import ColorRangeModule
from i3pystatus.core.util import make_graph, round_dict, make_bar
def count_bits(integer):
bits = 0
while (integer):
integer &= integer - 1
bits += 1
return bit... |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import os
import time
from six.moves import xrange
os.environ["TF_CPP_MIN_LOG_LEVEL"] = "1"
import numpy as np
import tensorflow as tf
import utils
from model import Config, BiRNN
tf.flags.DEFINE_string("... |
from mapping.map import Map
from utils.position import Position
from utils.utils import bresenham_line, filled_midpoint_circle
import matplotlib.pyplot as plt
def map_to_grid_pos():
print('Test: map_to_grid_pos')
lower_left_pos = Position(-5.0, -5.0)
upper_right_pos = Position(5.0, 5.0)
test_map = Map(... |
import requests
import os
import time
import pytest
import yaml
import uuid
URL = os.environ["URL"]
EMAIL = os.environ["EMAIL"]
PASSWORD = os.environ["PASSWORD"]
CLUSTER_NAME = "agent-integration-test-" + uuid.uuid4().hex[:5]
NAMESPACE = "agent-integration-test"
AGET_IMAGE = os.environ["AGENT_IMAGE"]
TEST_CONSTRAINT... |
# -*- coding: utf-8 -*-
#
# Copyright 2017-2021 AVSystem <<EMAIL>>
#
# 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 ap... |
import torch
import numpy as np
import sys
import time
from aevnmt.hparams import Hyperparameters
from aevnmt.data import TextDataset, RawInputTextDataset, remove_subword_tokens, postprocess
from aevnmt.train_monolingual import create_model
from aevnmt.train_utils import load_vocabularies, load_vocabularies_monolingua... |
# Created on 7/1/20
# Author: <NAME> and <NAME>
# Imports
import math
########################
# (1) Helper Functions #
########################
# Creates an m by n matrix with all entries equal to the default value
def createMatrix(rows, cols, defaultValue = -1):
return [[defaultValue for _ in range(cols)] for ... |
"""
Description: extensions to YAML classes for patcher
"""
import re, oyaml
from oyaml import safe_load, safe_load_all, safe_dump, safe_dump_all, YAMLError, YAMLObject
sfpex = re.compile('^(.+):(\d+):(\d+)$')
ccmsgex = re.compile('^([0-9]+)/([0-9]+)=([0-9]+)$')
rspecex = re.compile('^([\d\.A-Gb#]+)-([\d\.A-Gb#]+)\*(... |
#!/usr/bin/python
# -*- coding: utf-8 -*-
#################
## Import modules
#################
import sys
# walk directories
import glob
# access to OS functionality
import os
# copy things
import copy
# numpy
import numpy as np
# open3d
import open3d
# matplotlib for colormaps
import matplotlib.cm
import matplotlib... |
import calendar
import datetime
import logging
from typing import Union
import discord
import discord.errors
from discord.ext import commands
import backend.config
import backend.day_themes
import backend.helpers
import backend.sheets.sheets
from bot import Bot as Client
log = logging.getLogger(__name__)
# Posts n... |
# -*- coding: utf-8 -*-
#
# Copyright © Spyder Project Contributors
# based loosley on pylintgui.py by <NAME>
# Licensed under the terms of the MIT License
# (see spyder/__init__.py for details)
"""Breakpoint widget"""
# pylint: disable=C0103
# pylint: disable=R0903
# pylint: disable=R0911
# pylint: disab... |
#!/usr/bin/env python
"""
collection of functions for the final case study solution
"""
import os
import sys
import re
import shutil
import time
import pickle
from collections import defaultdict
from datetime import datetime
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import matplotlib.dates... |
#!/usr/bin/python
import difflib
import hashlib
import logging
import os
import os.path
import re
import shutil
import sys
import tempfile
import time
import zipfile
logger = logging.getLogger(__name__)
logging.basicConfig(level=logging.DEBUG, format="%(message)s")
jre_url = 'https://downloads.mesosphere.com/java/jr... |
# -*- coding: utf-8 -*-
# 版权所有 2020 深圳米筐科技有限公司(下称“米筐科技”)
#
# 除非遵守当前许可,否则不得使用本软件。
#
# * 非商业用途(非商业用途指个人出于非商业目的使用本软件,或者高校、研究所等非营利机构出于教育、科研等目的使用本软件):
# 遵守 Apache License 2.0(下称“Apache 2.0 许可”),
# 您可以在以下位置获得 Apache 2.0 许可的副本:http://www.apache.org/licenses/LICENSE-2.0。
# 除非法律有要求或以书面形式达成协议,否则本软件分发时... |
"""
Functions for dealing with markup text
"""
import re
import six
from six.moves import urllib
from six.moves import html_entities
from w3lib.util import str_to_unicode, unicode_to_str
from w3lib.url import safe_url_string
_ent_re = re.compile(r'&(#?(x?))([^&;\s]+);')
_tag_re = re.compile(r'<[a-zA-Z\/!].*?>', re.D... |
from channels.db import database_sync_to_async
from attendance.models import Attendance, AttendanceBlock, Session
from semesters.models import Semester
from subjects.utilities.counter import count_subject_attendance
from subjects.models import Subject
@database_sync_to_async
def save_attendance_block(row):
atten... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.