text
stringlengths
3.07k
22.1k
import numpy as np import sympy as sp from models.mld_model import PvMldSystemModel, MldModel, MldMatricesStruct from examples.residential_mg_with_pv_and_dewhs.modelling.parameters import dewh_param_struct, grid_param_struct, pv_param_struct, res_demand_param_struct from utils.decorator_utils import cache_hashable_ar...
import importlib import pickle from os import listdir from os.path import join, exists from typing import List import numpy as np from PIL import Image from rlbench.observation_config import ObservationConfig from rlbench.backend.const import * from rlbench.backend.utils import image_to_float_array, rgb_handles_to_ma...
# -*- encoding: utf-8 -*- import time import numpy as np import utils.logger import tensorflow as tf from collections import deque from utils import checkpoint_utils from utils.decorators import only_on_train from actor_learner import ActorLearner, ONE_LIFE_GAMES from networks.policy_v_network import PolicyValueNetwork...
import re import numpy as np import sys import os import glob import math import random from imageio import imread from skimage.transform import resize as imresize def load_pfm(file): color = None width = None height = None scale = None endian = None header = file.readline().rstrip() if he...
# Copyright 2014 OpenMarket 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 agreed to in writin...
#!/usr/bin/env python3 #author: <NAME> #id: coolharsh55 """ RDF ORM Create Python objects (classes with properties) from data in a RDF graph which has a schema (RDFS and OWL2). :Mechanism: For every 'subject' in the graph, retrieve all triples where it is the subject (i.e. <?s ?p ?o>). If ?o is a literal then store ...
# pylint: disable=line-too-long, logging-fstring-interpolation, protected-access, unused-argument, import-error from socket import gethostname import logging import threading import shutil from pathlib import Path from datetime import datetime as dt, timedelta from time import sleep from pprint import pformat import os...
import os import time import math import numpy as np from scipy.misc import imread import matplotlib.pyplot as plt try: from IPython.display import clear_output NO_IPYTHON = False except ModuleNotFoundError: NO_IPYTHON = True import tensorflow as tf from opendatalake.detection.utils import Detection25d, ...
#! /usr/bin/python3 -u # ############################################################################## # Performs parsing of fastq files to parsed barcoded wgs from the trial run 4 of # BBQ. # Modified by <NAME> # <EMAIL> # 2018 # # Version 1 # # LICENCE # # #########################################################...
#!/usr/bin/env python # -*- coding: utf-8 -*- """Orbit description """ import numpy as np from textwrap import indent from ..constants import c from ..dates import timedelta from ..errors import OrbitError from .forms import get_form, Form from .ephem import Ephem from ..frames.frames import get_frame, orbit2frame f...
"""The entry point to APK Kit from Portage. This module serves as the "bridge" from Portage land (ebuild) to Adélie land (APK). Most of EAPI=5 is supported, with a few extensions. More information is below. The most important bit of information is that this package is still in ACTIVE DEVELOPMENT and may be rough ar...
''' <NAME> 6/3/2021 Tensorflow image classification tutorial Referenced: https://www.tensorflow.org/tutorials/images/classification ''' import os # tensorflow import must come after os.environ gpu setting os.environ["CUDA_VISIBLE_DEVICES"] = '1' import tensorflow as tf import pathlib from tensorflow.ke...
from __future__ import division import os import sys import time import math import numpy as np from glob import glob import cv2 import matplotlib as mpl import matplotlib.cm as cm from PIL import Image sys.path.append(os.path.abspath(os.path.join('..', 'utils'))) from utils.bilateral_filter import bilateral_filter ...
"""Sensor platform for SunSpec.""" import logging from homeassistant.components.sensor import DEVICE_CLASS_CURRENT from homeassistant.components.sensor import DEVICE_CLASS_ENERGY from homeassistant.components.sensor import DEVICE_CLASS_TEMPERATURE from homeassistant.components.sensor import DEVICE_CLASS_VOLTAGE from h...
#!/usr/bin/env python3 from __future__ import annotations from pathlib import Path from PIL import Image from typing import ( cast, Any, Dict, List, Optional, Tuple, Set, ) import base64 import json import logging import os import zlib REDUCED_SIZE = (32, 32) # (BW_Img, AVG_Color) Reduc...
# -*- coding: utf-8 -*- # This file is part of Kaleidoscope. # # (C) Copyright IBM 2020. # # This code is licensed under the Apache License, Version 2.0. You may # obtain a copy of this license in the LICENSE.txt file in the root directory # of this source tree or at http://www.apache.org/licenses/LICENSE-2.0. # # Any...
import os import sys import pytest from testcontainers.postgres import PostgresContainer from .database_helper import migrate from .database_helper import migrated_testcontainer sys.path.append(os.path.join(os.path.dirname(__file__), os.pardir, "snowplow_json_to_postgres_loader")) from postgres_loader import * @pyt...
"""Front end for Quack""" from lark import Lark, Transformer import argparse import json import sys from typing import List, Callable import logging logging.basicConfig() log = logging.getLogger(__name__) log.setLevel(logging.INFO) quack_grammar = r""" ?start: program ?program: classes block classes: clazz* cla...
import torch import torch.nn as nn import math import torch.nn.functional as F class Conv_bn_relu(nn.Module): def __init__(self, inp, oup, kernel_size=3, stride=1, pad=1,use_relu = True): super(Conv_bn_relu, self).__init__() self.use_relu = use_relu if self.use_relu: self.convs...
import argparse import getpass import json import os import time import webbrowser from os.path import expanduser import requests from logzero import logger BASE_URL = "https://api.imgur.com" def iminit(): uname = str(input("Enter your username: ")) cid = str(input("Enter your Client ID: ")) cpass = ge...
import numpy as np import torch import torch.nn as nn from scipy.stats import multivariate_normal from ..components.snake import Snake _nine_offsets = [ ( 0, 0), ( 1, 1), ( 0, 1), (-1, 1), (-1, 0), (-1, -1), ( 0, -1), ( 1, -1), ( 1, 0), ] class GaussianField(): def __in...
import time from collections import deque from easyAI import AI_Player, Negamax, TwoPlayersGame from easyAI.AI import TT from funcy import collecting from board import display from constants import ( GOAT_CHAR, GOAT_PLAYER, NUM_EATEN_LOSE, NUM_GOATS, STARTING_TIGERS, TIGER_CHAR, TIGER_PLAY...
import numpy as np from numpy import random import mmcv from mmdet.datasets.builder import PIPELINES @PIPELINES.register_module() class PadMultiViewImage(object): """Pad the multi-view image. There are two padding modes: (1) pad to a fixed size and (2) pad to the minimum size that is divisible by some num...
import numpy as np import time import csv import tensorflow as tf from Higher_or_lower.QAI import player0, players from Higher_or_lower.neuralAI import train_Neural def mentiras(mentira, partidas, win_rate): lista = [partidas, mentira[0], mentira[1], win_rate[0], win_rate[1]] try: with open("Training_...
import os,sys def readchemiricBPs(hicbpf): inf = open(hicbpf) Info = {} for line in inf: if line.startswith('chromosome1'): pass else: line = line.strip().split('\t') chr1,sr1,bp1,chr2,sr2,bp2,r1,r2,rt = line chrompair = chr1 + '_' + chr2 if chrompair not in Info: Info[chrompair]=[[sr1,sr2,bp1...
import urllib.parse import async_timeout import aiohttp import asyncio import re import time import logging import voluptuous as vol import homeassistant.util as util from datetime import timedelta from homeassistant.helpers.aiohttp_client import async_get_clientsession _LOGGER = logging.getLogger(__name__) VER...
# # -*- coding: utf-8 -*- # Wireshark tests # By <NAME> <<EMAIL>> # # Ported from a set of Bash scripts which were copyright 2005 <NAME> # # SPDX-License-Identifier: GPL-2.0-or-later # '''Wireshark Lua scripting tests''' import filecmp import os.path import shutil import subprocess import subprocesstest import unittes...
########################################################################################## # # midpoint.d - a variation on the midpoint displacement algorithm in multiple dimensions # # by <NAME> # # Steps: # (1) Read in a lattice; can consist of a single cell --> domain # (2) Fill in the domain to specs to cre...
import pygame import random # defining colours BLACK = (0, 0, 0) WHITE = (255, 255, 255) RED = (255, 0, 0) BLUE = (0, 0, 255) GREEN = (55, 255, 12,) LBLUE = (90, 202, 255 ) level = 1 score = 0 # Sprite Codes for enemies/player/bullet etc. class Block1(pygame.sprite.Sprite): """ This class re...
from text_to_speech import * from speech_to_text import * from similary import * import datetime from test_api import * from lib import * from threading import Thread import csv # data = my_data() # # data = shuffle(data) # train = data # test = data[:20] # X_train = np.array([i[0] for i in train]).reshape(-1,50,50,1...
# -*- coding: utf-8 -*- # ---------------------------------------------------------------------------- # Nombre: interruptorPalanca.py # Autores: <NAME> - <NAME> # Creado: 29 de Junio 2018 # Modificado: 29 de Junio 2018 # Copyright: (c) 2018 by <NAME> - <NAME>, 2018 # License: Apache License ...
# Original Source: https://github.com/rn5l/wsdm-cup-2018-music import argparse import pickle import time from sklearn.model_selection import train_test_split import willump.evaluation.willump_executor from music_utils import * training_cascades = {} parser = argparse.ArgumentParser() parser.add_argument("-k", "--t...
# -*- coding: utf-8 -*- """the DAG model of chef The DAG consists of 2 types of nodes: IngredientNode and ProcedureNode. each node will have a `evaluate()` function, which will return an ingredient on eval. """ from . ingredient import Ingredient from ..exceptions import ProcedureError, ChefRuntimeError from ..helpe...
import xtal import numpy as np import os # Testing VASP integration class TestVASP(object): def test_read_vasp_poscar_direct(self): """Test if VASP5 POSCARs in direct coordinates can be read""" u = xtal.AtTraj() u.read_snapshot_vasp('tests/POSCAR.VASP5.unitcell') assert len(u.snapl...
import os import numpy as np import json import random import torch from mel2samp import files_to_list, MAX_WAV_VALUE from denoiser import Denoiser from mel2samp import load_wav_to_torch from scipy.io.wavfile import write import resampy from tacotron2.layers import TacotronSTFT from glow import WaveGlow, WaveGlowLoss ...
import numpy as np import os from kcsd import csd_profile as CSD from kcsd import KCSD2D from scipy.integrate import simps from scipy.interpolate import griddata from figure_properties import * import matplotlib.pyplot as plt import matplotlib.cm as cm def integrate_2d(csd_at, true_csd, ele_pos, h, csd_lims): csd_...
import cv2 import numpy as np import random import os class Image(object): def __init__(self, id): self.id = id self.rust = None self.bg = None self.masks = list() self.mask = None self.image = None self.image_shape = None def load_image(self, rust_path,...
""" this scripts plot the ratio of different operations """ import os import re import sys sys.path.append(os.path.join(os.path.dirname(os.path.abspath(__file__)), "../")) import numpy as np from utils.common import * ########################################################### trace stat #######################...
"""Validation script.""" import argparse import os import pickle as pk import torch import torch.multiprocessing as mp from tqdm import tqdm import numpy as np from hybrik.datasets import H36mSMPL, PW3D, HP3D from hybrik.models import builder from hybrik.utils.config import update_config from hybrik.utils.env import ...
#!/usr/bin/python # This Python file uses the following encoding: utf-8 ''' @author: <NAME> ''' import os import sys import justpy as jp from Template.icons.iconList import logIcon from Template.icons.iconList import configIcon from Template.icons.iconList import backendIcon from Template.icons.iconList import startRu...
"""DBSplan - Segmentation module This module performs several tasks, which may all be called from the `segmentation` function. Specific tasks are imported from the `seg` module. - Run FSL processing (https://fsl.fmrib.ox.ac.uk/fsl/fslwiki/) - Segment ventricles -> seg.ventricles - Segment sulci -> seg.sulci - Segment ...
import numpy as np import matplotlib.pyplot as plt # Grid parameters N = 50 x_start, x_end = -2.0, 2.0 y_start, y_end = -1.0, 1.0 x = np.linspace(x_start, x_end, N) y = np.linspace(y_start, y_end, N) X, Y = np.meshgrid(x, y) class Source(object): def __init__(self, strength, x, y): self.strength = st...
''' Required functions for xgb.py __Author__: <NAME> __Version__: 2.1 ''' from sklearn.base import BaseEstimator, TransformerMixin from sklearn.metrics import mean_squared_error, make_scorer import re from nltk.stem.porter import * ### Keys: Snow = True # stemmer choice #### if Snow: from nltk.stem.snowba...
from src.attack_dataset_config import AttackDatasetConfig from src.backdoor.edge_case_attack import EdgeCaseAttack from src.client_attacks import Attack from src.data.tf_data import Dataset from src.data.tf_data_global import GlobalDataset, IIDGlobalDataset, NonIIDGlobalDataset, DirichletDistributionDivider from src.co...
#!/usr/bin/env python """ dotgenik creates heatmaps of dot matrix between nucleotide sequences. it can be run by providing x and y sequences from the CL or it can read an input tsv table with 3 columns: x_sequence, y_sequence, label. dotgenik requires: python3.7 matplotlib seaborn pandas Usage: dotgenik.py ...
from sets import Set import os, sys, math import numpy as np from collections import Counter sys.path.append("../IAD-Generator/iad-generation/") from csv_utils import read_csv from sklearn.feature_extraction.text import TfidfVectorizer, CountVectorizer from sklearn.naive_bayes import MultinomialNB from sklearn impo...
import pytest from set_algebra import Endpoint, Interval, are_bounding def test_endpoint_init_from_notation(): e1 = Endpoint('[1') assert e1.left assert not e1.right assert not e1.open assert e1.value == 1 e2 = Endpoint('(1') assert e2.left assert not e2.right assert e2.open ...
import os from nipype import logging import nipype.pipeline.engine as pe import nipype.interfaces.fsl as fsl from CPAC.utils import function from CPAC.network_centrality.utils import merge_lists from CPAC.network_centrality import ( create_resting_state_graphs, get_cent_zscore ) logger = logging.getLogger('wo...
import concurrent.futures import json import sys from collections import namedtuple from typing import List import requests from importlib_metadata import distributions from packaging.markers import UndefinedComparison, UndefinedEnvironmentName from packaging.requirements import InvalidRequirement, Requirement from pa...
# Copyright (c) 2018-2022, NVIDIA Corporation # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # # 1. Redistributions of source code must retain the above copyright notice, this # list of condit...
import matplotlib.pylab as plt import numpy as np import math import cv2 # Source for homography. src = np.float32([[410,335], [535, 334], [780, 479], [150, 496]]) # Destination for homography dst = np.float32([[50, 0], [250, 0], [250, 500], [0, 500]]) slope_left = 0 slope_right = 0 leftc = [0, 0, 0] rightc = [0, 0, ...
# -*- coding: utf-8 -*- """Utility functions for Serial Communication.""" from __future__ import annotations import datetime from typing import Any from typing import Dict from typing import Union from uuid import UUID from zlib import crc32 from immutabledict import immutabledict from mantarray_file_manager import B...
from aiogram import Bot, types from aiogram.dispatcher import Dispatcher from aiogram.utils import executor from classes import Receipt import json class Group: def __init__(self, chat_id): self.debts = [] self.chat_id = chat_id self.amount_checks = 0 self.users_id = [] sel...
import os import json from tkinter import W import pandas as pd import pathlib import tempfile import torch from pandarallel import pandarallel from torch.nn import BCEWithLogitsLoss from sklearn.model_selection import train_test_split from sklearn.metrics import precision_recall_fscore_support from datasets import Dat...
# -*- coding: utf-8 -*- # Copyright 2020 Google 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...
import pywbem import urllib import sys import lib_credentials try: # Python2 from urlparse import urlparse except ImportError: # Python3 from urllib.parse import urlparse # url="http://google.com" def GetMyCookie(url): request = urllib.request(url) sock=urllib.request.urlopen(request) try: ...
# -*- coding: utf-8 -*- # from odoo import tools, models, fields, api, exceptions from openerp import tools, models, fields, api, exceptions ############################################################################################################################ Depó raktáros bevételezés ### class LegrandDepobev...
# Licensed under a 3-clause BSD style license - see LICENSE.rst """ Tests that relate to fitting models with quantity parameters """ # pylint: disable=invalid-name, no-member import numpy as np import pytest from astropy import units as u from astropy.modeling import fitting, models from astropy.modeling.core import F...
from functools import singledispatch, wraps from string import ascii_letters from typing import Tuple from collections.abc import Mapping import h5py import numpy as np import pandas as pd from pandas.api.types import is_numeric_dtype import pytest from scipy import sparse from anndata.core.sparsedataset import Spars...
# Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # d...
import csv #read csv files import nltk # word tokenization import spacy #lemmatization and sentence boundary detection import json # read and write json files import os import numpy as np import string import random # initialization of x vector in PageRank algorithm from pysbd.utils import PySBDFactory #sentenc...
# Copyright 2019 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...
# This file is copied from # https://github.com/openai/baselines/blob/master/baselines/common/atari_wrappers.py import os import cv2 import gym from gym.spaces import Box import numpy from plangym.wrappers.frame_stack import FrameStack from plangym.wrappers.time_limit import TimeLimit os.environ.setdefault("PATH", "...
#!/usr/bin/env python # -*- coding: utf-8 -*- # ****************************************************************************** # # Project: GDAL # Purpose: Compare two files for differences and report. # Author: <NAME>, <EMAIL> # # ****************************************************************************** # ...
import urllib.request, urllib.error, urllib.parse import json import datetime import csv import time def request_until_succeed(url, return_none_if_400=False): req = urllib.request.Request(url) success = False while success is False: try: response = urllib.request.urlopen(req) ...
import numpy as nm from sfepy.linalg import dot_sequences from sfepy.terms.terms import Term, terms from sfepy.terms.terms_th import THTerm, ETHTerm from sfepy.terms.terms_elastic import CauchyStressTerm class BiotTerm(Term): r""" Biot coupling term with :math:`\alpha_{ij}` given in: * vector form exploi...
# Copyright (c) 2021 PaddlePaddle 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 appli...
# coding: utf-8 """ Exposes a ContextStack class. The Mustache spec makes a special distinction between two types of context stack elements: hashes and objects. For the purposes of interpreting the spec, we define these categories mutually exclusively as follows: (1) Hash: an item whose type is a subclass of dict....
#!/usr/bin/env python ################################################################### # # schemaise.py # Version: 0.9 # # Script for processing RDF data, which has been tweaked a little to make it particularly useful to Bibframe2Schema.org. # # Its operation is controlled by passing command-line parameters: # ...
import matplotlib.pyplot as plt import numpy as np import torch from torch import nn from torch import tensor from torch import optim import torch.nn.functional as F from torch.autograd import Variable from torchvision import datasets, transforms import torchvision.models as models from collections import OrderedDict i...
""" Code to estimate entropy by computing variance in the predicted control """ import os import time import sys import random import numpy as np import torch import traceback import dlib import argparse import cv2 from torch.utils.data import Dataset from configs import g_conf, set_type_of_process, merge_with_yaml ...
# coding=utf-8 # Copyright 2021 COIL authors # Copyright 2018 The Google AI Language Team Authors and The HuggingFace Inc. team. # Copyright (c) 2018, 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...
""" This code is modified based on <NAME>'s repository (Bilinear Attention Networks - https://github.com/jnhwkim/ban-vqa) by <NAME> """ import argparse import torch from torch.utils.data import DataLoader import dataset_RAD import base_model import utils import pandas as pd import os import json answer_types = ['CLOSED...
# -*- coding: utf-8 -*- # Copyright (c) 2012-2015, <NAME> and contributors # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # # Redistributions of source code must retain the above copyright notic...
# This code aims to take an arbitrary molecular system AnBmCp... with any number of like atoms and: # 1. Determine the atom permutation operations (cycles) of the permutation groups Sn, Sm, Sp ... # 2. Find the induced permutations of the atom permutation operations of Sn, Sm, Sp ... on the set of interatomic distanc...
"""Support for Almond.""" from __future__ import annotations import asyncio from datetime import timedelta import logging import time from typing import Optional, cast from aiohttp import ClientError, ClientSession import async_timeout from pyalmond import AbstractAlmondWebAuth, AlmondLocalAuth, WebAlmondAPI import v...
from thonny.plugins.micropython import ( BareMetalMicroPythonProxy, BareMetalMicroPythonConfigPage, add_micropython_backend, list_serial_ports_with_descriptions, ) from thonny import get_workbench, get_runner, ui_utils import os import subprocess from thonny.ui_utils import ( SubprocessDialog, C...
import os import time import difflib import base64 import itertools import threading import pandas as pd from urllib import parse from urllib.error import URLError, HTTPError from urllib.request import Request, urlopen from bs4 import BeautifulSoup as bs ENV = os.environ waiting_time = int(ENV['WAITING_TIME']) / 1000 ...
# coding=utf-8 # *** WARNING: this file was generated by the Pulumi SDK Generator. *** # *** Do not edit by hand unless you're certain you know what you are doing! *** import warnings import pulumi import pulumi.runtime from typing import Any, Mapping, Optional, Sequence, Union, overload from ... import _utilities fro...
""" opentrons.calibration_storage.modify: functions for modifying calibration storage This module has functions that you can import to save robot or labware calibration to its designated file location. """ import typing from pathlib import Path from dataclasses import asdict from opentrons import config from opentron...
# Copyright (c) 2017 Shotgun Software Inc. # # CONFIDENTIAL AND PROPRIETARY # # This work is provided "AS IS" and subject to the Shotgun Pipeline Toolkit # Source Code License included in this distribution package. See LICENSE. # By accessing, using, copying or modifying this work you indicate your # agreement to the S...
# Copyright Pincer 2021-Present # Full MIT License can be found in `LICENSE` at the project root. from __future__ import annotations import logging import re from asyncio import iscoroutinefunction from inspect import Signature, isasyncgenfunction from typing import Optional, Dict, List, Any, Tuple, get_orig...
""" (c) 2013 LinkedIn Corp. 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 applicable law or agreed to in writing...
# -*- coding: utf-8 -*- """ This module defines genetic operators used in the evolution as well as the main loop of the algorithm and initialization methods. """ import logging import random import time from deap import tools from functools import partial, wraps from itertools import chain from joblib import Paralle...
import numpy as np import tensorflow as tf from tensorflow.contrib import rnn def _print_success_message(): print('Tests Passed') def test_create_lookup_tables(create_lookup_tables): with tf.Graph().as_default(): test_text = ''' Moe_Szyslak Moe's Tavern Where the elite meet to drink ...
import sys import warnings if not sys.warnoptions: warnings.simplefilter('ignore') import quandl import tensorflow as tf import numpy as np import matplotlib.pyplot as plt import seaborn as sns import pandas as pd from sklearn.preprocessing import MinMaxScaler from datetime import datetime from datetime import ti...
#!/usr/bin/env python # -*- coding: utf-8 -*- import os import dataclasses import numpy as np from .utils.folder import folder_create # plot用に import matplotlib.pyplot as plt # main関数 from tensorflow.keras.callbacks import ModelCheckpoint, ReduceLROnPlateau from tensorflow.keras.callbacks import EarlySt...
# Copyright 2017-2022 RStudio, PBC # # 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 gettext import os import shutil import tempfile from importlib import import_module from unittest import mock import _thread from django import conf from django.contrib import admin from django.test import SimpleTestCase, override_settings from django.test.utils import extend_sys_path from django....
#!/usr/bin/env python # encoding: utf-8 # # Copyright (c) 2021 <EMAIL> # MIT Licence. See http://opensource.org/licenses/MIT # # Created on 2013-11-04 # """repos.py [command] [options] [<query>] [<path>] Find, open and search Git repos on your system. Usage: repos.py search [<query>] repos.py settings re...
from collections import OrderedDict import pytz from django.conf import settings from django.contrib.contenttypes.models import ContentType from django.core.exceptions import FieldError, MultipleObjectsReturned, ObjectDoesNotExist from django.db.models import ManyToManyField, ProtectedError from django.http import Htt...
# Insert your code here. #coding = utf8 from BlueTest.toolbox import * from BlueTest.logInit import * null="null" import requests,random,time class apiTest(object): def __init__(self,data,encode=""): self.data = data self.min = 5 self.max = 10000 self.headers...
#! coding=utf-8 """ high-level toolbox for Document Extractor """ import re import typing import nlpir from nlpir import get_instance as __get_instance__ from nlpir import native # class and class instance __cls__ = native.doc_extractor.DocExtractor __instance__: typing.Optional[native.doc_extractor.DocExtractor] = No...
# -*- coding: utf-8 -*- import numpy as np import scipy import scipy.linalg import scipy.optimize import scipy.spatial def vector(x, y, z): """ A shortcut for creating 3D-space vectors; in case you need a lot of manual np.array([...]) """ return np.array([x, y, z]) def deg2rad(deg): """ Convert degre...
# coding: utf-8 # # Your first neural network # # In this project, you'll build your first neural network and use it to predict daily bike rental ridership. We've provided some of the code, but left the implementation of the neural network up to you (for the most part). After you've submitted this project, feel free t...
import os import re import asyncio import binascii import logging import typing import contextlib from io import BytesIO from cryptography.hazmat.primitives.ciphers import Cipher, modes from cryptography.hazmat.primitives.ciphers.algorithms import AES from cryptography.hazmat.primitives.padding import PKCS7 from lbry....
import numpy as np from PIL import Image import matplotlib, os #print "importing visual module" if not('DISPLAY' in os.environ): matplotlib.use("Agg") import matplotlib.pyplot as plt import matplotlib.ticker as ticker import matplotlib.backends.backend_pdf import copy # customization: http://matplotlib.org/use...
#!python # # Copyright 2018 Codeplay Software Ltd. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use these files except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law o...
# -*- coding: utf-8 -*- """ Created on Mon Jan 26 10:37:52 2015 @author: shanshan """ ################################################### Preprocessing ################################################ ''' Import packages ''' import pandas as pd from pandas import DataFrame, Series import seaborn as sns import numpy a...
import collections import logging from . import config from . import engines from . import util from .. import exc from .. import inspect from ..engine import url as sa_url from ..sql import ddl from ..sql import schema from ..util import compat log = logging.getLogger(__name__) FOLLOWER_IDENT = Non...