text
stringlengths
3.07k
22.1k
# Copyright 2019 RnD at Spoon Radio # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in wr...
""" Simulate a single sample or a batch of samples from the samples folder using the demand script. The script `sensitivity_demand_samples.py` creates a samples folder containing a list of samples stored in the NumPy array `samples.npy`. Each sample is a list of parameter values to set for a list of variables (the nam...
import getpass import json import os import sys import time import downloadipy import requests def get_auth_code(): auth_url = "{0}?client_id={1}&redirect_uri={2}&response_type=code&scope={3}".format(AUTH_URI, CLIENT_ID, REDI...
# import os # # os.environ["CUDA_VISIBLE_DEVICES"] = "2" # import tensorflow as tf # from keras.backend.tensorflow_backend import set_session # # config = tf.ConfigProto() # config.gpu_options.per_process_gpu_memory_fraction = 0.30 # set_session(tf.Session(config=config)) import torch torch.cuda.empty_cache() # from R...
import numpy as np from scipy.stats import dirichlet, multivariate_normal from data_generation import * from matplotlib.colors import to_rgb from tqdm import tqdm import math LOG_EPSILON = 10E-10 MIN_VARIANCE = 10E-3 CONVERGENCE_ERROR = 10E-5 MOVING_AVERAGE_WINDOW = 3 def random_initialization(data, num_components, ...
# # Collective Knowledge: autotune any custom dimensions provided by user # # See CK LICENSE.txt for licensing details # See CK COPYRIGHT.txt for copyright details # # Developer: <NAME>, <EMAIL>, http://fursin.net # cfg={} # Will be updated by CK (meta description of this module) work={} # Will be updated by CK (temp...
import random import networkx as nx import numpy as np from .bridge import bridges def uniform(a, b): def f(): return random.uniform(a, b) return f def _random_length(max_length): length = uniform(1, max_length) def f(x, y): return length() return f def _length(pos=None): ...
import ujson as json from tqdm import tqdm from dialogue.toolbox.vocab import Vocabulary, UNK_WORD, PAD_WORD, BOS_WORD, EOS_WORD, get_pretrained_embedding from collections import Counter import torch import argparse WORD_VOCAB_SIZE = 15000 ASER_VOCAB_SIZE = 40000 ASER_EVENT_VOCAB_SIZE = 30000 OMCS_VOCAB_SIZE = 30000 O...
import copy import numpy as np import pandas as pd from hypernets.core import set_random_state from hypernets.experiment.compete import SteppedExperiment, ExperimentStep, \ EnsembleStep, FinalTrainStep from hypernets.utils import logging from hypernets.tabular impor...
################################################################################ # impglobals.py # # General utilities used by the import process. ################################################################################ import json import os import re import sys import traceback import pdsfile import pdslogge...
# --------------------------------------------------------------------- # Failed Scripts Report # --------------------------------------------------------------------- # Copyright (C) 2007-2020 The NOC Project # See LICENSE for details # --------------------------------------------------------------------- # Third-par...
from glob import glob from pathlib import Path import os import numpy as np import re root_path = str( Path.home() ) + "\\Desktop\\Simulation" swarm_size = -1 global sim_count global iter_count global swarm_count sim_count = 0 iter_count = 0 swarm_count = 20 def set_count( sim, iter, swarm ): global sim_count ...
import requests import json import pymysql import csv import time import os import traceback def daily_scraper(): try: os.remove('daily_weather.csv') except: pass #Read in weather info and put into JSON Dump. Currently only doing it once #This is for the whole day and is a forecast. Wil...
# # wpylib.math.fitting.funcs_simple module # Created: 20150520 # <NAME> # # Imported 20150520 from Cr2_analysis_cbs.py # (dated 20141017, CVS rev 1.143). # """ wpylib.math.fitting.funcs_simple module A library of simple f(x) functions for fitting For use with OO-style x-y curve fitting interface. """ import numpy f...
""" Small sphinx extension to show a UI example + result """ import os import sys import shutil import hashlib import warnings import subprocess import importlib.util from docutils.parsers.rst import Directive from docutils import nodes from flexx import app THIS_DIR = os.path.abspath(os.path.dirname(__file__)) ROO...
import functools import numpy as np from scipy.ndimage import map_coordinates def uv_meshgrid(w, h): uv = np.stack(np.meshgrid(range(w), range(h)), axis=-1) uv = uv.astype(np.float64) uv[..., 0] = ((uv[..., 0] + 0.5) / w - 0.5) * 2 * np.pi uv[..., 1] = ((uv[..., 1] + 0.5) / h - 0.5) * np.pi return...
#!/usr/bin/env python3 import socket, ssl import struct, random import datetime, asyncio import copy def main(): listen_host = '127.0.0.1' listen_port = 5053 upstreams = \ [ UpstreamContext('1.1.1.1', 853, 'cloudflare-dns.com'), UpstreamContext('8.8.8.8', 853, 'dns.google'), UpstreamContext('9.9.9.9', 853,...
""" Functions to import process raw availability data from suncor exports - Not imported by GUI app """ from datetime import datetime as dt from datetime import timedelta as delta from pathlib import Path import pandas as pd import pypika as pk from smseventlog import config as cf from smseventlog import functions a...
import sqlite3 as sq3 import json import nextcord from typing import Optional, Tuple from enum import IntEnum from .ReportParser import Report, GameType from util.exception import InvalidArgs GAMETYPE_TO_LOWERCASE = { GameType.BEGIN_FFA: "begin_ffa", GameType.FFA: "ffa", GameType.BEGIN_TEAMER: "begin_team...
from pysavime.schema.dataset import * from pysavime.schema.subtar import * from pysavime.schema.tar import * def _to_savime_supported_type(input_data_type): if not isinstance(input_data_type, SavimeSupportedTypes): try: input_data_type = input_data_type.upper() output_data_type = ...
# -*- coding: utf-8 -*- import requests from bs4 import BeautifulSoup import urllib import re import os import pandas as pd from datetime import datetime import csv from pytube import YouTube PTT_URL = 'https://www.ptt.cc' base64_table = '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-_' script_path =...
import json import logging import datetime import hmac import pytz import hashlib from typing import List, Any from cryptoxlib.WebsocketMgr import Subscription, WebsocketMgr, WebsocketMessage, Websocket, CallbacksType, \ ClientWebsocketHandle, WebsocketOutboundMessage from cryptoxlib.Pair import Pair from cryptoxl...
try: import mastcasjobs except ImportError: print("mastcasjobs not available. Cannot use mastquery.") # get the WSID and password if not already defined import getpass import os import re import numpy as np from astropy import coordinates, units from astropy.io import ascii from astropy.table import Table fr...
#!/usr/bin/env python3 import argparse import datetime import glob import inspect import json import os import pandas import subprocess import sys import codespeed_upload def get_script_dir(): return os.path.dirname(inspect.getabsfile(get_script_dir)) SCRIPTDIR = get_script_dir() DEFAULT_REPO = os.path.join(SCR...
from utils import * class MetaDataParser(object): def __init__(self): # sentiment files train_sentiment_files = sorted(glob.glob('../../input/petfinder-adoption-prediction/train_sentiment/*.json')) test_sentiment_files = sorted(glob.glob('../../input/petfinder-adoption-prediction/test_sent...
import os import numpy as np import scipy.io as sio from PIL import Image from .generic import GenericDataset from .generic import project_gt_poses_to_anchors from .generic import compute_anchors_reference from .generic import compute_window_reference from ..utils import * def load_mpii_mat_annotation(filename): ...
import numpy as np from tqdm import tqdm import time import pickle import matplotlib.pyplot as plt import pandas as pd from matplotlib.animation import FuncAnimation import os def train_data_process(data_dict, verbose=False, reward=False): game_list = data_dict.keys() # need to set the output shape first ...
""" config.py @author - <NAME> (xNifty) @SnoringNinja - https://snoring.ninja Handles all config based functions that are not used as bot commands """ # Imports for ConfigLoader import os import configparser import errno def get_config_filename(default_filename): """Return the filename; probably not needed at t...
# -*- coding: utf-8 -*- from __future__ import division import os import json import functools import numbers import pandas as pd from collections import defaultdict from pcode.utils.op_paths import list_files from pcode.utils.op_files import load_pickle from pcode.utils.auxiliary import str2time """load data from p...
#!/usr/bin/env python # Copyright (c) 2016, Socially Intelligent Machines Lab # 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 ...
from ctypes import * from .fmodobject import * from .fmodobject import _dll from .structures import TAG, VECTOR from .globalvars import get_class from .utils import prepare_str, ckresult, check_type from .structobject import Structobject as so from .enums import SOUND_TYPE, SOUND_FORMAT, OPENSTATE from .flags i...
import os ##############################_AWS_###################################### def Key(): while True: os.system('tput setaf 4') print(""" Enter 1 to create Key Enter 2 to delete Key Enter 3 to describe key pairs Enter 4 to exit ...
import unittest import sys import os import os.path from os.path import dirname, abspath, expanduser, exists, join import shutil import subprocess TEST_DIR=abspath(expanduser(dirname(__file__))) try: import dataworkspaces except ImportError: sys.path.append(os.path.abspath("..")) from dataworkspaces.utils.su...
# Copyright 2019 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 agreed to in writing,...
from django.contrib.contenttypes.models import ContentType from django.template import Variable, Library, Node, TemplateSyntaxError from django.template.loader import render_to_string try: from django.core.urlresolvers import reverse except ImportError: from django.urls import reverse from actstream.models im...
import pygame import sys ###A SIMPLE REVERSI GAME CREATED IN PYGAME ### tile_size = 64 #size of individual grid piece turn = 1 #if turn is odd, BLACK plays, else, WHITE plays, BLACK starts no_move_turns = 0 #values for checking up down left right, and combinations in between directions = [ ] n = (0, -1 * tile_size) ...
# -*-coding:utf-8-*- import argparse import logging import yaml import time import torch import torch.nn as nn import torchvision.transforms as transforms import torch.backends.cudnn as cudnn from torch.utils.tensorboard import SummaryWriter from easydict import EasyDict from models import * from update_noise import ...
""" Common utilities that are used throughout the application. Move anything that is used more than once that isn't specific to any certain functionality here. """ import flask from flask import request, has_request_context import datetime import dateutil.parser import json from jwt.algorithms import RSAAlgorithm ...
from os.path import join, exists, dirname import json import pandas as pd import numpy as np from typing import List # helper function that bins the doi column def get_doi_bins_df(doi_df: pd.DataFrame, n_bins: int, with_labels=False) -> pd.DataFrame: histogram, edges = np.histogram(doi_df["doi"], bins=n_bins, range...
#!/usr/bin/env python ############################################################################### ## ## Copyright (C) 2011-2014 Tavendo GmbH ## ## 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 L...
from .testcase import DatatableViewTestCase from .test_app import models from .. import utils def get_structure(columns, opts): return utils.get_datatable_structure('/', dict(opts, columns=columns), model=models.ExampleModel) class UtilsTests(DatatableViewTestCase): def test_get_first_orm_bit(self): ...
""" Copyright (c) 2018-2022 Intel Corporation Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in wri...
import h5py import numpy as np import numpy.ma as ma import numpy.lib.recfunctions as rfn import logging ref_region_dtype = np.dtype([('start','i8'), ('stop','i8')]) def print_ref(grp): ''' Print out all references in file (or group) ''' l = list() grp.visititems(lambda n,d: l.append((n,d))\ ...
# -*- coding: utf-8 -*- # Minio Python Library for Amazon S3 Compatible Cloud Storage, (C) 2015 Minio, 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/licen...
# -*- coding: utf-8 -*- """ Created on Thu Jun 4 19:22:40 2020 @author: adria.bove Llibreria per fer dibuixos de """ # importing libraries import pickle import pandas as pd import matplotlib.pyplot as plt import datetime as dt from BBDD import BBDD import numpy as np from sklearn.metrics import ...
import datetime import functools import os import re import urllib import smtplib from email.mime.multipart import MIMEMultipart from email.mime.text import MIMEText from flask import (Flask, flash, Markup, redirect, render_template, request, Response, session, url_for) from flask_mail import Mail, M...
import asyncio import csv import json import logging import os import re import sqlite3 import sys import tempfile import time from contextlib import closing from io import BytesIO from pathlib import Path from typing import IO from zipfile import ZipFile import aiofiles import aiohttp import aiosqlite import requests...
import math import torch import torch.nn as nn import torch.nn.functional as F from torchvision.models import resnet from all_attention import PAM_and_CAM def init_weights(m): if isinstance(m, nn.Conv2d) or isinstance(m, nn.Linear): m.weight.data.normal_(0, 1e-3) if m.bias is not None: ...
# (c) 2019, NetApp, Inc # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) ''' unit tests for Ansible module: na_ontap_quota_policy ''' from __future__ import (absolute_import, division, print_function) __metaclass__ = type import json import pytest from ansible.module_utils...
# # 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 # ...
"""Spatial methods.""" __all__ = [ "get_sindex", "interp_2d_to_3d", "wkt_to_dataframe", "wkt_to_geodataframe", "wkt_to_geoseries", "force_2d", "round_coords", "compare_crs", "get_crs", "find_segnum_in_swn" ] import geopandas import numpy as np import pandas as pd import pyproj from shapely import wkt ...
#!/usr/bin/env python # # VM testing base class # # Copyright 2017 Red Hat Inc. # # Authors: # <NAME> <<EMAIL>> # # This code is licensed under the GPL version 2 or later. See # the COPYING file in the top-level directory. # from __future__ import print_function import os import sys import logging import time import...
from rllab.baselines.linear_feature_baseline import LinearFeatureBaseline from sandbox.ours.envs.normalized_env import normalize from sandbox.ours.envs.base import TfEnv from sandbox.ours.policies.improved_gauss_mlp_policy import GaussianMLPPolicy from rllab.misc.instrument import run_experiment_lite from rllab.misc.in...
# Author: bbrighttaer # Project: IReLeaSE # Date: 5/21/2020 # Time: 9:56 AM # File: expert_rnn_reg.py from __future__ import absolute_import, division, print_function, unicode_literals import argparse import os import joblib import random import time from datetime import datetime as dt import numpy as np from sklear...
import json from pyevt import abi, address, ecc, libevt libevt.init_lib() # Type and Structures class BaseType: def __init__(self, **kwargs): self.kwargs = kwargs def dict(self): return self.kwargs def dumps(self): return json.dumps(self.kwargs) class User: def __init__(...
"""Utility methods for gruut""" import itertools import logging import os import re import ssl import typing import xml.etree.ElementTree as etree from pathlib import Path from urllib.request import urlopen import networkx as nx from gruut_ipa import IPA from gruut.const import ( DATA_PROP, LANG_ALIASES, ...
import random import cv2 import os import unittest from data import * from utils.augmentations import SSDAugmentation, SSDWiderAugmentation from layers.modules import MultiBoxLoss from ssd import build_ssd import os import sys import time import torch from torch.autograd import Variable import torch.nn as nn import tor...
#!/usr/bin/env python3 # Copyright 2021 Xiaomi Corp. (authors: <NAME>) # # See ../../../../LICENSE for clarification regarding multiple 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...
# Task is an element for each task routine # TODO: # 1. add readattr command # 2. change range value in accordance with test result from @hipiphock # 3. need to add BLE tasks import random import json import logging from DongleHandler.Constants import * # There are two types of tasks: # 1. Task that just sends commnad...
import ast import os import sys import gzip import shutil import tempfile from pathlib import Path from typing import Union, Tuple, Any, Optional, List, Sequence, Dict import torch from torch.utils.data._utils.collate import default_collate import numpy as np import nibabel as nib import SimpleITK as sitk from tqdm im...
import asyncio import discord import json import modules.bottiHelper import modules.data.ids as ids import os import time global audioSourceFile musicQueue = [] async def _checkForVoiceClient(botti, message, string): voiceClients = botti.voice_clients if not voiceClients: await modules.bottiHelper._se...
# encoding=utf-8 import pdb import torchvision.transforms.functional as F from torch.utils.data import DataLoader import os from PIL import Image import torch.utils.data.dataset as dataset from torchvision import transforms import torchvision.transforms as transforms import random import numpy as np import cv2 from ...
# # 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 # distributed under...
import numpy as np import copy from scipy.special import digamma, gammaln from bnpy.util import NumericUtil import LocalStepLogger from LocalStepSingleDoc import calcLocalParams_SingleDoc from LocalStepSingleDoc import calcLocalParams_SingleDoc_WithELBOTrace def calcLocalParams( Data, LP, alphaEbeta...
""" Provides an API to define epidemiological models in terms of sympy symbolic expressions based on a matrix description. """ import warnings import numpy as np import scipy.sparse as sprs import sympy from epipack.process_conversions import ( processes_to_rates, transition_processes_to_ra...
import os import warnings import random import numpy as np import torch from torch.utils.data import Dataset import torchvision.transforms import torchvision.transforms.functional as TF from sklearn.decomposition import PCA from PIL import Image import paths from transformator import Transformator with warnings.catch...
# Copyright 2011 Terena. 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 conditions and the fol...
# pylint: disable=C0103 """Theme support""" import os import glob import copy import json import io import re import logging try: import requests from requests.exceptions import RequestException except ImportError: pass import bumblebee.error def theme_path(): """Return the path of the theme direct...
""" Copyright 2019 <NAME> Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense...
# Copyright (C) 2020. Huawei Technologies Co., Ltd. All rights reserved. # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including without limitation the rights # to us...
# -*- coding: utf-8 -*- ######################################################################################################################## # # HyperTransferLearningModel # ######################################################################################################################## import tensorflow as...
from typing import List from mypy.join import is_similar_callables, combine_similar_callables from mypy.types import ( Type, AnyType, TypeVisitor, UnboundType, Void, ErrorType, NoneTyp, TypeVarType, Instance, CallableType, TupleType, ErasedType, TypeList, UnionType, PartialType, DeletedType, UninhabitedTyp...
import json from django.contrib.auth import authenticate, login, logout from django.core import paginator from django.db import IntegrityError from django.db.models import constraints from django.db.models.fields import DateTimeField, IntegerField, TimeField from django.db.utils import DatabaseError, Error, Programming...
from django.conf import settings from django.db import models from django.urls import reverse class ProjectManager(models.Manager): def get_by_natural_key(self, name): return self.get(name=name) class Project(models.Model): """ Represents a project in a python project hierarchy """ name = models...
import numpy as np from matplotlib import pyplot as plt import cv2 as cv import math def __ninePartitions(image): linhas = len(image) colunas = len(image[0]) xPart = np.linspace(0, linhas, num=4, dtype=int) yPart = np.linspace(0, colunas, num=4, dtype=int) return xPart, yPart def borderDetection...
from __future__ import division import datetime from ajax_select.fields import (AutoCompleteSelectField, AutoCompleteSelectMultipleField) from crispy_forms.bootstrap import FormActions from crispy_forms.helper import FormHelper from crispy_forms.layout import HTML, Field, Layout, Submit...
# -*- coding: utf-8 -*- # # Copyright © 2014 <NAME> <<EMAIL>> # from __future__ import absolute_import import logging import math from pyramid.compat import NativeIO, text_ from pyramid.request import Request from pyramid import testing import pytest @pytest.fixture def current_request(request): r = Request.bla...
#!/usr/bin/env python3 import CustomImage import HandyTools as HT import numpy from PIL import Image, ImageTk import cv2 import os import tkinter as tk import string from ImageMeta import ImageDetectionMetadata import logging ALL_CHARS = string.ascii_letters + string.digits logging.basicConfig(format='[%(asctime)s] <%...
# Copyright 2019 The Cirq Developers # # 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 # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in ...
#!/usr/bin/env python3 # # Copyright 2021 Graviti. Licensed under MIT License. # import pytest from tensorbay.client.lazy import InitPage, LazyPage, PagingList TOTAL_COUNT = 1000 MIDDLE = TOTAL_COUNT // 2 LIMIT = 128 LIST = list(range(TOTAL_COUNT)) VALID_INDICES = (TOTAL_COUNT - 1, MIDDLE, -1, 0) INDICES = VALID_I...
from typing import Tuple import itertools import re import numpy as np import GPy from emukit.model_wrappers.gpy_model_wrappers import GPyModelWrapper from ..parameters.cfg_parameter import CFGParameter from ..parameters.string_parameter import StringParameter from ..parameters.protein_base_parameter import ProteinBas...
import urllib import os import time import requests import uuid import json import zipfile import base64 from azure.storage.table import TableService, Entity, TablePermissions STORAGE_ACCOUNT_NAME = os.environ['STORAGE_ACCOUNT_NAME'] STORAGE_ACCOUNT_KEY = os.environ['STORAGE_ACCOUNT_KEY'] DATABRICKS_API_BASE_URL = os...
import os import ubiops as api import configparser from ubiops_cli.exceptions import UnAuthorizedException from ubiops_cli.ignore.ignore import walk from ubiops_cli.version import VERSION from datetime import datetime import yaml import zipfile import click import json class Config: REQUIRED_SECTIONS = ['auth', ...
from __future__ import absolute_import from __future__ import division from __future__ import print_function import tensorflow as tf import os import glob import random import collections import math Examples = collections.namedtuple("Examples", "paths, inputs, targets, count, steps_per_epoch") def preprocess(image...
#!/usr/bin/env python3 # Author: <NAME> <<EMAIL>> """Parses all articles published in our journals of interest to write field-wise lists of articles with multiaffiliations for specific countries. """ from configparser import ConfigParser from glob import glob from math import ceil from os.path import basename, split...
# Based on https://github.com/vilcans/screenplain/blob/master/screenplain/export/pdf.py # Original Work by <NAME> # Licensed under the MIT license: # http://www.opensource.org/licenses/mit-license.php import sys import os try: import reportlab except ImportError: sys.stderr.write('ERROR: ReportLab is required...
"""Functions to generate the plots for the report. Only generate_plots is needed to create all the plots. """ from enum import Enum import textwrap import matplotlib import matplotlib.pyplot as plt import numpy as np from geclass.util.questions import questions, q_marks from geclass.util.statistics import ( ...
"""Serializers.""" import abc import json from datetime import datetime, timedelta, timezone from typing import Dict, TypedDict, Any import urllib.parse import attr import geoalchemy2 as ga from stac_pydantic.shared import DATETIME_RFC339 from stac_fastapi.sqlalchemy.models import database from stac_fastapi.sqlalchem...
#!/usr/bin/env python # Copyright 2014-2019 The PySCF Developers. 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 # # U...
# -------------------------------------------------------------------------- # Source file provided under Apache License, Version 2.0, January 2004, # http://www.apache.org/licenses/ # (c) Copyright IBM Corp. 2017 # -------------------------------------------------------------------------- try: from sklearn...
# encoding: utf8 from __future__ import print_function, unicode_literals import locale import re from io import BytesIO from unicodedata import combining, normalize from aspen import Response from aspen.simplates.pagination import parse_specline, split_and_escape from aspen.utils import utcnow from babel.core import ...
import argparse import os import sys import time import numpy as np import torch from torch.autograd import Variable from torch.optim import Adam from torch.utils.data import DataLoader from torchvision import datasets from torchvision import transforms import utils from transformer_net import TransformerNet from vgg...
import json import dash from dash.dependencies import Input, Output, State import dash_core_components as dcc import dash_html_components as html import dash_cytoscape as cyto from demos import dash_reusable_components as drc app = dash.Dash(__name__) server = app.server # ###################### DATA PREPROCESSING...
# -*- coding: utf-8 -*- # :Project: metapensiero.pj -- simpler transformations # :Created: ven 26 feb 2016 15:17:49 CET # :Authors: <NAME> <<EMAIL>>, # <NAME> <<EMAIL>>, # <NAME> <<EMAIL>> # :License: GNU General Public License version 3 or later # import ast from functools import reduce fro...
"""Constants that are used by ``geopyspark.geotrellis`` classes, methods, and functions.""" from enum import Enum, IntEnum __all__ = ['NO_DATA_INT', 'LayerType', 'IndexingMethod', 'ResampleMethod', 'TimeUnit', 'Operation', 'Neighborhood', 'ClassificationStrategy', 'CellType', 'ColorRamp', 'DEFAU...
# -*- coding: utf-8 -*- import logging from contextlib import contextmanager import numpy import h5py from ..io.utils import temporary_filename from ..io.h5fs import prepare_h5data from ..math.utils import lcm logger = logging.getLogger(__name__) @contextmanager def open_uris(uris): sources = [] files = []...
import random import pygame from pygame.math import Vector2 import settings from sprite.items import Carrot, Jetpack class LivingBeing(pygame.sprite.Sprite): """Describes common behavior and attributes between living beings. Attributes: image_names (list): List of image names that ...
from __future__ import absolute_import import sys, os BASE_DIR = os.path.dirname(os.path.dirname(__file__)) sys.path.append(BASE_DIR) from PMML43Ext import * import numpy as np import pandas as pd from datetime import datetime from statsmodels.tsa import holtwinters as hw class ExponentialSmoothingToPMML: """ ...
import inspect import sys from collections import OrderedDict, defaultdict from collections.abc import Callable from collections.abc import Mapping as MappingABC from collections.abc import MutableMapping as MutableMappingABC from enum import Enum from inspect import Parameter, Signature, signature from itertools impor...
import re from collections import OrderedDict class JATSContribException(Exception): pass class JATSContribs(object): def __init__(self, soup=None): self.regex_spcom = re.compile(r'\s+,') self.regex_multisp = re.compile(r'\s+') self.regex_email = re.compile(r'^[a-zA-Z0-9+_.-]+@[a-zA...