text
stringlengths
3.07k
22.1k
# More testing BBSaveState. from neuron import h pc = h.ParallelContext() cvode = h.CVode() class Model1: def __init__(self, ncell, n): # gid -> [n NetCons] -> gid+1 cells = {gid: h.Follower() for gid in range(pc.id(), ncell, pc.nhost())} for gid in cells: pc.set_gid2node(gi...
""" Long running tasks """ import json import datetime import time import requests import urllib import dateutil.parser from sqlalchemy.exc import IntegrityError from anchore_engine.services.policy_engine.engine.feeds import DataFeeds, InsufficientAccessTierError, InvalidCredentialsError from anchore_engine.db import...
from matplotlib import pyplot from collections import deque import random import numpy as np import keras from CONFIG import * from cv2 import resize import vizdoom as vzd import datetime def svg_name(name): return ''.join((name, "_", datetime.datetime.now().strftime("%y-%m-%d-%H-%M-%S_%f"), ".svg")) class ReplayMem...
import json import os import subprocess from .model import (Group, Node, Call, Variable, BaseLanguage, OWNER_CONST, GROUP_TYPE, is_installed, flatten, djoin) def lineno(tree): """ Return the line number of the AST :param tree ast: :rtype: int """ return tree['attributes'][...
import torch import torch.nn as nn import torch.nn.functional as F from model.resnet import resnet50, resnet34 from model.aspp import ASPP, ASPP_Bottleneck #from resnet import resnet50, resnet34 #from aspp import ASPP, ASPP_Bottleneck class Bottleneck_custom(nn.Module): expansion = 4 def __init__(self, in_c...
import dash import dash_core_components as dcc import dash_html_components as html from dash.dependencies import Input, Output from plotly import graph_objs as go # app.layout = html.Div(children=[ # html.H1(children="Who's Hot, Who's Not?"), # # html.Div(children=''' # Visual Analysis on Debut Artist...
""" <1>use six feature extractors: 1 the raw Count with CountVectorizer from sklearn 2 TF-IDF with TfidfVectorizer from sklearn 3 binary feature: check if each of the most frequent 200 words is in the email with self difined function 4 bigram of words 5 ngram of characters within word bound 6 ngram of characters acors...
import glob import os import scipy import scipy.io import scipy.ndimage import numpy as np import cv2 import sys import gc import time import argparse import multiprocessing WORKERS = multiprocessing.cpu_count()-1 or 1 def parsArgs(): parser = argparse.ArgumentParser(description='Lidar Fog Simulation Filename') ...
from __future__ import absolute_import import sqlalchemy as sa import geoalchemy2 as ga from shapely.geometry import Point import copy from roadworkapi import db from roadworkapi.models.db_models import ( Issue, IssueVersion, Coordinates, State, Tag, TagGroup) from roadworkapi.controls.error import Error, ErrorR...
from ..web import app from ..db import query from .. import config, crypto, http, utils from ..model.user import User from ..hashing import blake2b from flask import request, abort, Response, g import time import nacl from nacl.signing import VerifyKey import nacl.exceptions import nacl.bindings as sodium import sqlal...
""" Lexer for Pineboo QS files. """ from ply.lex import TOKEN # type: ignore # Reserved words reserved = [ "BREAK", "CASE", "CONST", "STATIC", "CONTINUE", "DEFAULT", "DO", "ELSE", "FOR", "IF", "IN", "RETURN", "SWITCH", "WHILE", "CLASS", "VAR", "FUNC...
# -*- coding: utf8 -*- from functools import partial from docutils import nodes from docutils.utils import new_document from docutils.frontend import OptionParser from docutils.parsers.rst import roles, Parser from django.core.exceptions import ObjectDoesNotExist from django_markup.filter.rst_filter import RstMarkupF...
import matlab from matlab import engine import numpy from tnetwork.utils import dynamicCommunitiesSN import os ############################### ######For this class, it is necessary to have Matlab installed ######And to set up the matlab for python engine, see how to there ###### https://fr.mathworks.com/help/matlab/m...
# Copyright (c) 2013 OpenStack Foundation # 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 ...
#################################### ### Various function utilities ### #################################### def round2(n): return round(10 * n) / 10 def buyer_profit(bid): return 10 - bid def num_hessian(x0, cost_function, epsilon = 1.e-5, linear_approx = False, *args): """ A numerical approximation t...
import math import pygame from functions import * """class which create buttons arguments: Coords: tuple, Surface: Surface object, Size: tuple, Text: string, Font: Font object, Image = String to use, proceed this way: if event.type == MOUSEBUTTONDOWN and event.button == 1: mouse = pygame.mouse.get_pos if Button.im...
"""**API Reference:** https://documenter.getpostman.com/view/6250319/RznBMzqo for Jaguar LandRover InControl API.""" import json import os import time import urllib.error import urllib.request from typing import Union from uuid import UUID, uuid4 from executors.logger import logger def _open(url: str, headers: dict...
#!/bin/python # -*- coding: utf-8 -*- import os import sys import socket import struct import random def domain_to_byte(domain): domain_to_byte = '' dsplit = domain.split('.') for cs in dsplit: formatstr = "B%ds" % len(cs) newsplit = struct.pack(formatstr, len(cs), cs) domain_to...
# Copyright (C) 2021 Google 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 writ...
from concurrent.futures import ThreadPoolExecutor from html import escape from pathlib import Path from subprocess import run from typing import List, Tuple, Iterator, Optional import re from .node import * def is_valid_table_row(row: str) -> bool: return bool(re.match(r"^\|.*\|$", row)) def iter_code_block(fi...
import os import pandas as pd import seaborn as sns import matplotlib.pyplot as plt from sklearn import preprocessing from luigi import * from pset_utils.luigi.dask.target import CSVTarget class GetBadData(ExternalTask): """Reads file from Local source File must be CSV and have column indexes. Store loc...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # # Copyright (C) 2021 The SymbiFlow Authors. # # Use of this source code is governed by a ISC-style # license that can be found in the LICENSE file or at # https://opensource.org/licenses/ISC # # SPDX-License-Identifier: ISC # Fetch test results from Google Storage imp...
# Copyright 2018 IBM Corp. # # 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, so...
import torch import torch.nn.functional as F import random import numpy as np import time import dgl from dgl import DGLGraph import argparse from sklearn.metrics import f1_score from torch.utils.data import DataLoader from utils import load_data from models import GTN seed = 123 random.seed(seed) np.random.seed(seed)...
# Main method starts at line 194 press cmd + j to select def openFile (fileName): # Open file and put data into classData list classData = [] try: myFile = open(fileName+'.txt', 'rt') for line in myFile: ...
from typing import List, Tuple import numba as nb import numpy as np from .constants import ( FLOAT_MAX, FLOAT_MIN, INT_MAX, Bucket, BucketArray, BucketDType, FloatArray, IntArray, IntDType, Node, NodeArray, NodeDType, ) from .geometry_utils import build_bboxes from .ut...
"""Helper Class providing multiple static functions to extract a doi from a url """ import json import logging import re import requests import time import urllib3 from lxml import html from functools import lru_cache from requests import Session from urllib3.exceptions import ReadTimeoutError, SSLError, NewConnecti...
import numpy as np from scipy.stats import spearmanr from collider.data.base_data_source import BaseDataSource from common.configure import read_configure from collider.utils.logger import system_log system_log.level_name = "INFO" bundle_path = read_configure(name="test")['bundle_path'] DataSource = BaseDataSource() ...
import random from sqlalchemy import create_engine from pytest_mock_resources.compat import boto3, moto, psycopg2 from pytest_mock_resources.patch.redshift.mock_s3_copy import read_data_csv from pytest_mock_resources.patch.redshift.mock_s3_unload import get_data_csv original_data = [ {"i": 3342, "f": 32434.0, "c...
# -*- coding:utf-8 -*- from __future__ import unicode_literals from future.builtins import object from copy import copy import re from limpyd import fields as limpyd_fields from limpyd.exceptions import ImplementationError from .model import ModelWithDynamicFieldMixin class DynamicFieldMixin(object): """ T...
import pydantic from datetime import datetime import typing import pkg_resources from .DiscreteDistribution import DiscreteDistribution from .DiscreteVariable import DiscreteVariable from ..utils import Discretizer, get_subclasses installed_pkg = {pkg.key for pkg in pkg_resources.working_set} if 'ipdb' in installed_...
"""Losses for categorical data.""" import torch from .base import Metric from nitorch.core.utils import isin from nitorch.core.py import make_list, flatten from nitorch.core import py, utils, math def _pad_zero(x, implicit=False): """Add a zero-channels if the input has an implicit background class""" if not...
# Music-playing Cog for the bot import logging import random from os import makedirs from typing import Any, Dict, Iterable, List, Optional, Tuple import discord from discord.ext import commands from youtube_dl import YoutubeDL import response from error import atask from song import SongInfo, SongQueue, SongRegistr...
#!/usr/bin/python # # Copyright (C) 2012 Canonical Ltd. # # This program is free software; you can redistribute it and/or # modify it under the terms of version 2 of the GNU General Public # License published by the Free Software Foundation. # # Written by <NAME> <<EMAIL>>, based on work by # <NAME> <...
import pandas as pd import numpy as np import torch from scipy.io import arff from base.torchvision_dataset import TorchvisionDataset from torch.utils.data import TensorDataset class NATOPS_Dataset(TorchvisionDataset): def __init__(self, root: str, normal_class): super().__init__(root) self.n_cl...
"""Secure Channel Protocol version 03""" from io import BytesIO from binascii import hexlify from struct import pack from . import status from . import card from .commands import * from . import crypto from .scp import * from .util import int_to_bytes_big_endian # Cryptogram size in bits CRYPTOGRAM_N_BITS = 0x0040 #...
"""This module defines the workflow pipeline object.""" from girder_worker.core.specs import PortList, ReadOnlyAttributeException, Spec from collections import MutableMapping import networkx as nx import copy class WorkflowException(Exception): """Exception thrown for issues with Workflows""" pass class D...
# coding=utf-8 # Copyright 2022 The Deeplab2 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 ...
# -*- coding: utf-8 -*- """ Copyright (c) 2020, University of Southampton All rights reserved. Licensed under the BSD 3-Clause License. See LICENSE.md file in the project root for full license information. """ import math from pathlib import Path from auv_nav import Camera from oplab import Console header = """ % ST...
import argparse import os import re import json import pdb from transner import Transner from doc2txt import doc2txt from tools import annotator, aggregator, generator from sentence_transformers.cross_encoder import CrossEncoder import importlib sutime_mod = importlib.import_module("python-sutime.sutime") class P...
""" This module implements a multi-layer perceptron in NumPy. """ from __future__ import absolute_import from __future__ import division from __future__ import print_function import numpy as np class MLP(object): """ This class implements a Multi-layer Perceptron in NumPy. It handles the different layers and pa...
import dataclasses import json import os import pathlib import shutil import subprocess import pytest from zntrack import dvc, zn from zntrack.core.base import Node from zntrack.utils.exceptions import DVCProcessError @pytest.fixture def proj_path(tmp_path): shutil.copy(__file__, tmp_path) os.chdir(tmp_path...
from datetime import datetime from flask import Blueprint, render_template, redirect, url_for, flash, abort from flask_login import login_required, current_user from app.models import EditableHTML, SiteSetting from .forms import SiteSettingForm, PostForm, CategoryForm, EditCategoryForm, StatusForm import commonmark fro...
import os import collections import tensorflow as tf import xlnet from absl import app, flags from classifier_utils import convert_single_example from prepro_utils import preprocess_text, encode_ids from model_utils import init_from_checkpoint # I/O paths flags.DEFINE_string("model_config_path", default=None, he...
import os import signal from rpython.rlib.rarithmetic import intmask from rpython.rtyper.lltypesystem.lltype import nullptr from typhon import ruv from typhon.atoms import getAtom from typhon.autohelp import autohelp, method from typhon.errors import userError from typhon.futures import IOEvent from typhon.log import...
import argparse import json import os import numpy as np import cv2 import torch from torchvision import transforms from datasets.lip import LipValDataset from datasets.coco_single import CocoSingleValDataset from models.single_person_pose_with_mobilenet import SinglePersonPoseEstimationWithMobileNet from modules.cal...
import logging logging.basicConfig(level=logging.DEBUG, format='%(asctime)s - %(levelname)s - %(message)s') logger = logging.getLogger(__name__) # A Huffman Tree Node class Node: def __init__(self, freq, symbol, left=None, right=None): self.freq = freq self.symbol = symbol self.left = left self.right = right...
from concurrent.futures import ThreadPoolExecutor from typing import Callable, Any, Dict, List, Union, Optional from .classes.common import Common from .helpers.others import fake from .classes.basic_test import Test from .helpers.report import generate from .classes.basic_case import TestCase from .classes.basic_suit...
""" taguchi: Taguchi experiments are quick and dirt designs that are effective for quality control in engineering. Some experimenters use Taguchi Method designs as screening experiments in a similar manner to Plackett Burman designs. They are useful designs in quality control but due to recent fads in marketing are oft...
""" Python library for the CAP1203 sensor. """ from enum import IntEnum, IntFlag from typing import Union ADDRESS = 0x28 # Register map MAIN_CONTROL = 0x00 GENERAL_STATUS = 0x02 SENSOR_INPUT_STATUS = 0x03 NOISE_FLAG_STATUS = 0x0A SENSOR_INPUT_1_DELTA_COUNT = 0x10 SENSOR_INPUT_2_DELTA_COUNT = 0X11 SENSOR_INPUT_3_DEL...
# coding: utf-8 from madrona.features.forms import FeatureForm, SpatialFeatureForm from django import forms from django.forms import ModelMultipleChoiceField, CheckboxSelectMultiple from django.forms.widgets import * from django.forms.widgets import Input from django.utils.safestring import mark_safe from django.contri...
from __future__ import print_function, division import argparse import glob import os from collections import defaultdict import math from run_comparison import load_sample_list, generate_method_combos, generate_command, print_safely, run_custom, parse_sex def nCr(n,r): f = math.factorial return int(f(n) / f(r) /...
import jsonpickle import sqlalchemy from flask import (current_app, flash, redirect, render_template, request, session, url_for) from flask_login import current_user from labsys.auth.decorators import permission_required from labsys.auth.models import Permission from labsys.extensions import db from...
import itertools from utils import * from copy import deepcopy row_units = [cross(r, cols) for r in rows] column_units = [cross(rows, c) for c in cols] square_units = [cross(rs, cs) for rs in ('ABC','DEF','GHI') for cs in ('123','456','789')] # Misunderstood the requirement. diag_units mean main diagonals only. # dia...
import datetime import pprint import random from typing import List, Tuple, Union import numpy as np import tensorflow as tf import termcolor from sklearn import linear_model, model_selection from tensorflow.keras import layers, models, optimizers from tensorflow.keras.wrappers import scikit_learn import ...
import os import subprocess from abc import abstractmethod from os import mkdir, listdir, remove from os.path import exists, join from shutil import rmtree, copy from subprocess import call from time import time, sleep from invoke import task from psutil import cpu_count import tasks.data import tasks.knative from ta...
import os import sys import sqlite3 import xml.etree.ElementTree as ET import requests import re import syllables from wordfreq import word_frequency from wn import WordNet SCRIPT_DIR = os.path.dirname(os.path.realpath(__file__)) DATA_DIR = os.path.join(SCRIPT_DIR, 'data') NUMERIC_PATTERN = re.compile('[0-9]+') def c...
# -*- coding: utf-8 -*- # # Author: <NAME>, Finland 2015-2016 # # This file is part of Kunquat. # # CC0 1.0 Universal, http://creativecommons.org/publicdomain/zero/1.0/ # # To the extent possible under law, Kunquat Affirmers have waived all # copyright and related or neighboring rights to Kunquat. # from copy import ...
# Copyright (c) The Diem Core Contributors # SPDX-License-Identifier: Apache-2.0 ###################################################################################### # Bech32 implementation for Diem human readable addresses based on # Bitcoin's segwit python lib https://github.com/fiatjaf/bech32 modified to support...
import copy import json import sys from collections import OrderedDict from typing import Any, Dict, List, Tuple, TypeVar, Union from triad.exceptions import InvalidOperationError from triad.utils.assertion import assert_arg_not_none from triad.utils.convert import as_type from triad.utils.iter import to_kv_iterable ...
__author__ = "https://www.linkedin.com/in/bongsang/" __license__ = "MIT" from utils import download import os from os.path import join from pathlib import Path import zipfile import argparse import glob from tqdm import tqdm import shutil import time import numpy as np import matplotlib.pyplot as plt import tensorflo...
# -*- coding: utf-8 -*- """ Created on Sun Nov 11 20:08:28 2018 @author: Zoltan """ import pandas as pd from pandas.plotting import scatter_matrix from pandas import set_option import numpy as np from numpy import set_printoptions import matplotlib.pyplot as plt from sklearn.preprocessing import Normalizer from sk...
# ----------------------------------------------- # USuRPer_functions.py (SPARTA USuRPer file) # ----------------------------------------------- # This file defines the functions necessary for Zucker PDC / USuRPer calculation (arxiv.org/pdf/1711.06075.pdf). # It i...
from fractions import Fraction import pytest from omnidice import pools from omnidice.dice import d6, d8 from omnidice.drv import DRV, p def test_plain_result(): assert pools.PlainResult(1, 2) == pools.PlainResult(2, 1) assert pools.PlainResult(1, 1, 2) == pools.PlainResult(1, 2, 1) assert pools.PlainR...
import csv # open Cities.csv file with csv.DictReader and read its content into a list of dictionary, cities_data cities_data = [] with open('Cities.csv', 'r') as f: rows = csv.DictReader(f) for r in rows: cities_data.append(r) # open Countries.csv file with csv.DictReader and read its content into a ...
#!/usr/bin/env python """A script to scrape Amazon product reviews from the web page. Copyright 2014 <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.apac...
import os import random import shutil import threading from textwrap import dedent import pytest import stbt_rig try: # Needed for timeout argument to wait on Python 2.7 import subprocess32 as subprocess except ImportError: import subprocess @pytest.fixture(scope="function", name="tmpdir") def fixture_...
# -*- coding: utf-8 -*- """ Created on Sat Mar 21 00:17:14 2020 @author: asus """ from selenium import webdriver from selenium.webdriver.common.keys import Keys from selenium.webdriver.support.ui import WebDriverWait from selenium.webdriver.common.by import By from selenium.webdriver.support import expected_condition...
import rospy import subprocess from os import path from visualization_msgs.msg import Marker from visualization_msgs.msg import MarkerArray from numpy import inf import numpy as np import random import math from gazebo_msgs.msg import ModelState from squaternion import Quaternion from geometry_msgs.msg import Twist fro...
import ctypes import logging import sysconfig import numpy as np import numpy.ctypeslib as npct from .. import tools from pathlib import Path logger = logging.getLogger(__name__) np_double = npct.ndpointer(np.float64, ndim=1, flags='aligned, contiguous, writeable') np_complex = npct.ndpointer(np.complex128...
import argparse import logging import os import sys from collections import OrderedDict import torch from fvcore.common.file_io import PathManager from fvcore.nn.precise_bn import get_bn_modules from torch.nn.parallel import DistributedDataParallel import tkdet.data.transforms as T from tkdet.checkpoint import Detect...
# OpenCV Test .py import math import os import numpy as np import cv2 from openslide import OpenSlide from operator import itemgetter from common.Constants import Constants import datetime # Color Extract with BGR => HSV import random # blue = np.uint8([[[255,0,0]]]) # hsv_blue = cv2.cvtColor(blue, cv2.COLOR_BGR2HSV) #...
# Contains efficient implementations of the following: # - Full M-FAC with paging # - Blocked M-FAC with support for handling multiple blocks at once import math import torch import torch.nn as nn # Batch matrix/vector operations used for simulatenously precomputing multiple blocks def batch_dot(A, B): b, d = ...
from django.conf import settings from django.contrib.contenttypes.fields import (GenericForeignKey, GenericRelation) from django.contrib.contenttypes.models import ContentType from django.core.exceptions import ValidationError from django.db import models from django.db.m...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Tue May 12 15:49:57 2020 @author: vinny """ import psycopg2 import datetime def PSQL_connect(user,password,host,port,database): try: connection = psycopg2.connect(user = user, password = password, ...
# Heightmap Generator by <NAME> import os.path import time from pathlib import Path from PIL import Image # Vertex object. class Vertex: def __init__(self, x, y, z, identifier): if not isinstance(x, float): raise TypeError('x must be a float.') if not isinstance(y, float): raise TypeError('y must be a float...
import sqlite3 import unittest from peewee import * import sqlite_ext as sqe # use a disk-backed db since memory dbs only exist for a single connection and # we need to share the db w/2 for the locking tests. additionally, set the # sqlite_busy_timeout to 100ms so when we test locking it doesn't take forever ext_db ...
""" Algorithm Test Suite Tests algorithms defined in algs.py. """ from datk.core.distalgs import * from datk.core.networks import * from datk.core.algs import * from helpers import * Algorithm.DEFAULT_PARAMS = {"draw":False, "verbosity" : Algorithm.QUIET} def test_LCR_UNI_RING(): r = Unidirectional_Ring(6) ...
""" ## Markdown Replace Allows to add replacements into the markdown source, which are replaced by values given by a python module. The python module (default is: docs/mdreplace.py) must have a table attribute, either dict or callable. When callable and kw args in the signature, it will be called with a lot of conte...
""" Django settings for ScienceCruiseDataManagement project. Generated by 'django-admin startproject' using Django 1.10.4. For more information on this file, see https://docs.djangoproject.com/en/1.10/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/1.10/ref/sett...
from wows_shell import * import numpy as np from sklearn.linear_model import LinearRegression ships = [ (.100, 1000, .3137, 13, 2154, 10., .010, 17, 45, 60.0, 0, "Akizuki"), #(.130, 861, .291, 33.5, 1652, 10, .03, 22, 45, 60.0, 0, "Okhotnik"), (.130, 870, .2857, 33.50, 1700, 10., .010, 22, 45, 60.0,...
#!/usr/bin/env python import rospy from rospy.core import NullHandler, logerr from std_srvs.srv import SetBool from std_srvs.srv import Empty from brain.srv import myString,myStringRequest,myStringResponse import actionlib import builder.msg import time from math import pi import copy """ THIS NODE WILL DRAW/PRINT ...
import logging from abc import ABC from abc import abstractmethod from typing import Callable from typing import Sequence from typing import Type import jax import numpy as np from ...model.dynamical_system.boundary_value_problem import BoundaryValueProblem from ...model.dynamical_system.representations import Linear...
import os import sys import logging import ctypes import struct from enum import IntEnum, auto logging.basicConfig(stream=sys.stdout, level=logging.DEBUG) logger = logging.getLogger(__name__) NBASE_ROOT_PATH = '/home/kostrovskiy/work/data_storages/NitrosBase/releases/v_2.1/nitrosbaseuni_rc_2.1.36_linux_setup/nitrosba...
"""Support for Xplora® Watch tracking.""" from __future__ import annotations import logging from collections.abc import Awaitable, Callable from datetime import datetime, timedelta from typing import Any, Dict, List import aiohttp from .geocoder import OpenCageGeocodeUA from homeassistant.components.device_tracker ...
import torch from torch_geometric.data import DataLoader import torch.optim as optim import torch.nn.functional as F from torchvision import transforms from gnn import GNN import argparse import time import numpy as np import pandas as pd import os ### importing OGB from ogb.graphproppred import PygGraphPropPredDatas...
import os import cv2 from PIL import Image import numpy as np from up.utils.general.registry_factory import IMAGE_READER_REGISTRY from up.utils.general.petrel_helper import PetrelHelper __all__ = ['FileSystemCVReader', 'FileSystemPILReader'] def get_cur_image_dir(image_dir, idx): if isinstance(image_dir, list) ...
# -*- coding: utf-8 -*- import logging import os import shutil import sys import tarfile import time from pathlib import Path from pprint import pprint import click import gitdb import sh from git import Repo from prompt_toolkit import prompt from prompt_toolkit.completion import WordCompleter GLOBAL_DIFF_FILES = []...
# Jochen: This is mostly the PyTorch's CIFAR dataset. # I made some adjustments for integration. import errno import hashlib import logging import os import os.path import os.path import sys import numpy as np import torch.utils.data as data from PIL import Image from torchvision import transforms as vision_t...
from tkinter import * from tkinter import ttk from tkinter import messagebox from calendar import monthrange import sys import DbOps from datetime import datetime root=Tk() root.title('Weather statisics') logo=PhotoImage(file=r'C:\Users\kpimp\KeTan\PyHw\Lynda_Code_clinic_2014\lpo_logo.gif') header=ttk.Label(root,image...
# -*- coding: utf-8 -*- """ Tencent is pleased to support the open source community by making BK-BASE 蓝鲸基础平台 available. Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved. BK-BASE 蓝鲸基础平台 is licensed under the MIT License. License for BK-BASE 蓝鲸基础平台: ---------------------------------------------...
""" Access John Hopkins COVID-19 data from their GitHub repository. """ import os import yaml from datetime import datetime from urllib.parse import urljoin import pandas as pd from numpy import diff, linspace import matplotlib.pyplot as plt from autumn.inputs import get_iso3_from_country_name from autumn.tool_kit.ut...
import os import matplotlib.pyplot as plt import stella_plots import post_processing import functions from os import listdir from numpy import * from tkinter import * from tkinter.filedialog import * from matplotlib import * from scipy.io import netcdf from array import array from functions import * from stella_plot...
#!/usr/bin/env python # -*- coding: utf-8 -*- """ Copyright 2021 Recurve Analytics, 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...
#!/usr/bin/python # -*- coding:utf-8 -*- """ Implementation of the plotting and visualization functions. """ import numpy as np import time import matplotlib.pyplot as plt from lib.units import * class DynamicUpdate(): """ Class for dynamic display of the integrated system. Initialise with the System of B...
import time import copy import numpy as np import ngmix import tqdm import joblib import pytest import metadetect.lsst.metadetect as lsst_metadetect import descwl_shear_sims as sim from descwl_coadd.coadd import make_coadd_obs CONFIG = { "meas_type": "wmom", "metacal": { "use_noise_image": True, ...
from collections import OrderedDict from django.apps import apps from django.contrib.auth.models import User from django.core.urlresolvers import reverse from django.db import models from django.utils.encoding import python_2_unicode_compatible from ems.utils import get_active_entry # Add a utility method to the Us...
import math import requests import json import os from .color_dicts import MPL_COLOR_MAP, CSS4_COLORS def safe_iter(var): try: return iter(var) except TypeError: return [var] class AMapPlotter(object): def __init__(self, amap_key, center_lat='35.312316', center_lng='102...
#created <EMAIL> #created: May 2015 #Based on twitter bootstrap import os import time import sys import datetime import urllib.parse import urllib.request #make a listing of filenames into a nice HTML table def makeListing( folder): s = "" #open the table s += "<div class=\"col-sm-9 col-sm-offset-3 col-md-10 col-...
from tkinter import * import tkinter.messagebox from captcha.image import ImageCaptcha import string import random import os import pyttsx3 audio_captcha='' image_captcha='' def generate_captcha(): data_set = list(string.ascii_letters+string.digits) #a-z,A-Z,0-9 s='' for i in range(6): a=random.c...