text
stringlengths
3.07k
12.6k
from base64 import b16encode from functools import reduce from operator import or_ import os import struct from django.core.exceptions import ImproperlyConfigured from django.core.files.uploadedfile import UploadedFile from django.core.files.storage import default_storage from django.core.signing import get_cookie_sig...
import json from djangorestframework.reverse import reverse from djangorestframework import resources from .forms import SubscriberForm from councilmatic.subscriptions.models import (Subscriber, Subscription) from bookmarks.models import Bookmark from phillyleg.models import (CouncilDistrict, CouncilDistrictPlan, ...
# 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, ...
import math import torch from torch import nn from ..utils.helpers import wrap_class, null_context from .operations import t, relative_error from ..tensor_network import SingleTensor class MF(nn.Module): """Base module for matrix factorization. X ≈ U t(V), U, V ∈ S """ def __init__( se...
# Copyright 2019, OpenCensus Authors # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in w...
import os import matplotlib.pyplot as plt import numpy as np import pandas as pd from keras_preprocessing.image import ImageDataGenerator from sklearn.model_selection import train_test_split from tensorflow.keras.applications import Xception from tensorflow.keras.layers import Dense, Dropout from tensorflow.keras.mode...
import pandas as pd import util_functions as uf import altair as alt import geopandas as gpd import json import requests alt.renderers.enable('notebook') def query_trips(con): # Query CaBi and Dockless Start and End by ANC return pd.read_sql("""SELECT DISTINCT start_anc.start_anc as ANC_I...
import io import os import attr import argparse import configparser import logging.config from pathlib import Path class Config(configparser.ConfigParser): """Class for storing, reading, and writing config.""" def __init__(self, filename, *, config_env_var=None, touch=False, mode=None, **kwar...
import os import subprocess from typing import Dict from stack import CHARMHUB_CHANNELS, CHARMHUB_KEY, CHARMHUB_URI, JUJU_FOLDER, StackData import yaml def init() -> None: subprocess.run(["mkdir", "-p", JUJU_FOLDER], check=True) subprocess.run(["touch", CHARMHUB_URI], check=True) stacks = None with ...
"""CFNgin stack.""" from copy import deepcopy from runway.util import load_object_from_string from runway.variables import Variable, resolve_variables from .blueprints.raw import RawTemplateBlueprint def _initialize_variables(stack_def, variables=None): """Convert defined variables into a list of ``Variable`` f...
# -*- coding: utf-8 -*- # Copyright (c) 2018-2021, earthobservations developers. # Distributed under the MIT License. See LICENSE for more info. import pytest import wradlib as wrl from wetterdienst.provider.dwd.radar import ( DwdRadarParameter, DwdRadarPeriod, DwdRadarValues, ) from wetterdienst.provider...
#!/usr/bin/env python import gettext import os import unittest import sys import logging from nose import result from nose import core from nose import config class _AnsiColorizer(object): """ A colorizer is an object that loosely wraps around a stream, allowing callers to write text to the stream in a ...
import warnings import numba import numpy as np import pandas as pd import scipy as sp from scipy.cluster.hierarchy import fcluster, linkage from sklearn.metrics import pairwise_distances import trisicell as tsc from trisicell.external._betabinom import pmf_BetaBinomial @numba.jit(nopython=True) def _l1_ignore_na(a...
from givinggraph import config from sqlalchemy import create_engine, Column, String, Integer, Float, DateTime, ForeignKey, Table from sqlalchemy.ext.declarative import declarative_base from sqlalchemy.orm import sessionmaker as sessionmakermaker, relationship host = config.read_config('database', 'host') db_name = con...
import os import zipfile from contextlib import closing import sys from selenium import webdriver from selenium.webdriver.common.by import By from selenium.webdriver.support import expected_conditions as EC from selenium.webdriver.support.wait import WebDriverWait LOCAL_PAGES = False # LOCAL_PAGES = True def read_c...
#!/usr/bin/env python import gzip import os import string import numpy import pandas from sqlalchemy import create_engine #for reproducibility numpy.random.seed(100) sample_size = 100 def to_line(x): return "{}\n".format("\t".join([str(_x) for _x in x])) def variant_name(chrom, pos, a, b): return "{}_{}_{}...
import torch import torch.nn as nn from .py_utils import kp, AELoss from config import system_configs def conv3x3(in_planes, out_planes, stride=1, groups=1, dilation=1): """3x3 convolution with padding""" return nn.Conv2d(in_planes, out_planes, kernel_size=3, stride=stride, padding=dilati...
######################################################################## # # File Name: HtmlWriter.py # # """ Implements the HTML output writer for XSLT processor output WWW: http://4suite.com/4XSLT e-mail: <EMAIL> Copyright (c) 1999-2000 Fourthought Inc., USA. All Rights Reserved. See http://4sui...
# # Copyright 2016 The BigDL Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in ...
#!/usr/bin/env python # coding: utf-8 # In[7]: import os import numpy as np from PIL import Image import torch from torch import nn import torch.nn.functional as F from torchvision import models, transforms dataset_dict = { 'CXR14': {'mean': 0.497, 'std': 0.087, 'num_classes': 14, 'classes':...
#!/usr/local/bin/python3 import argparse, collections, random parser = argparse.ArgumentParser(description='Generate order-k Markovian text given input sample text file') parser.add_argument('--sampleFile', type=open, required=True, help='File containing sample text. Line terminators will be pres...
# Copyright 2018 Jetperch 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,...
# Copyright (c) 2020 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...
from collections import Counter, defaultdict from evaluators import * import load_data as ld import numpy as np class NaiveBaseClass: def calculate_relative_occurences(self, list1): no_examples = len(list1) ro_dict = dict(Counter(list1)) for key in ro_dict.keys(): ro_dict[key] =...
from flaky import flaky import numpy import pytest import torch from allennlp.common.testing import ModelTestCase from allennlp.common.checks import ConfigurationError from allennlp.common.params import Params from allennlp.data.dataset_readers import DatasetReader from allennlp.data.iterators import DataIterator, Bas...
"""Rules for generating the BuildFlags class.""" load("//third_party/java/arcs/build_defs:build_defs.bzl", "arcs_kt_library", "java_src_dep") load(":arcs_build_flag.bzl", "apply_flag_overrides") load(":flags.bzl", "ARCS_BUILD_FLAGS") _DEFAULT_CLASS_NAME = "BuildFlags" _DEFAULT_FILE_NAME = "BuildFlags.kt" # Template...
"""This module defines objects useful to discover which CMake generator is supported on the current platform.""" from __future__ import print_function import os import shutil import subprocess import textwrap from ..constants import CMAKE_DEFAULT_EXECUTABLE from ..exceptions import SKBuildGeneratorNotFoundError from...
import csv from django.contrib import admin from django.http import HttpResponse from .models import Request, Volunteer, Contributor, DistrictNeed, DistrictCollection, DistrictManager, vol_categories, \ RescueCamp, Person, NGO, Announcements, ReliefCampData def create_csv_response(csv_name, header_row, body_row...
# coding=utf-8 # *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. *** # *** 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 from . import _utilities...
"""Take huge detailed screenshots of Google Maps.""" from datetime import datetime import os import time import tkinter from PIL import Image import pyscreenshot from selenium import webdriver # import chromedriver_binary def create_map(lat_start: float, long_start: float, number_rows: int, number_co...
# -*- coding: utf-8 -*- import unittest import weakref from pyopenapi.migration.scan import Scanner, Dispatcher, scan from pyopenapi.migration.versions.v1_2.objects import ( ApiDeclaration, Authorization, Operation, ResponseMessage, Parameter) from pyopenapi.migration.versions.v3_0_0.objects import ( Header as...
""" Input/output utilities, adapted from https://github.com/vanderschaarlab/SyncTwin-NeurIPS-2021 """ # Author: <NAME> (<EMAIL>) # License: BSD 3 clause import os import pickle import numpy as np import torch def create_paths(*args): for base_path in args: if not os.path.exists(base_path): o...
#!/usr/bin/env python3 import sys import pprint import csv from simple_term_menu import TerminalMenu import os import subprocess import datetime import pathlib from .basicmenu import BasicMenu from .prompter import Prompter #configuration kb_threshold = 1000 # ignore results for files with size-in-k less than this...
#!/usr/bin/env python ## ## Copyright (C) 2015 <NAME> ## ## Cryptpad -- notepad, but encrypts and decrypts files. ## import sip sip.setapi("QString", 2) sip.setapi("QVariant", 2) import sys, os, shutil, struct try: from cStringIO import StringIO except ImportError: from StringIO import StringIO from PyQt4....
from __future__ import unicode_literals from django.db import models from django.utils import timezone from django.contrib.auth.models import User from datetime import datetime, timedelta # Create your models here. class Promo(models.Model): name = models.CharField(max_length=1000) discount = models.DecimalF...
from pymt_cshore import cshoremodel import aeolis.model import numpy as np import traceback import sys import csv def CollectIndividualVarInfo_Aeolis(model_bmi, var_name): return { var_name: { "var_type": model_bmi.get_var_type(var_name), "var_rank": model_bmi.get_var_rank(var_name...
import math import scipy import seaborn as sns from scipy.stats import iqr import pickle from tqdm import tqdm from sklearn.metrics import accuracy_score from datetime import date from sklearn.metrics import roc_curve, auc from itertools import cycle from sklearn import datasets from sklearn.model_selection import t...
#!/usr/bin/python import json import logging import os import socket import subprocess # vttop is the toplevel of the vitess source tree vttop = os.environ['VTTOP'] # vtroot is where everything gets installed vtroot = os.environ['VTROOT'] # vtdataroot is where to put all the data files vtdataroot = os.environ.get('...
import pygments.lexer import pygments.token import pygments.styles import pygments.lexers import pygments.style from pygments.formatters.terminal import TerminalFormatter from pygments.formatters.terminal256 import Terminal256Formatter from pygments.util import ClassNotFound from httpie.compat import is_windows from h...
import numpy import pandas import matplotlib.pyplot as plt from keras.layers import Dense, LSTM from keras.models import Sequential from sklearn.metrics import mean_squared_error from sklearn.preprocessing import MinMaxScaler from tqdm import trange # fix random seed for reproducibility numpy.random.seed(7) def load...
from __future__ import print_function import glob import os import pkg_resources import sys from distutils.errors import DistutilsOptionError WIN32 = sys.platform.lower().startswith('win') __MODULE_NAME = "xmlsec" __MODULE_VERSION = None __MODULE_DESCRIPTION = "Python bindings for the XML Security Library" __MODUL...
#!/usr/bin/env python3 # Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved from enum import Enum from inspect import getmembers, isclass, isfunction from sys import modules, stderr from typing import Union from pytext.config.component import get_component_name from pytext.config.pytext_config impor...
# Do not import any modules. If you do, the tester may reject your submission. # Constants for the contents of the maze. # The visual representation of a wall. WALL = '#' # The visual representation of a hallway. HALL = '.' # The visual representation of a brussels sprout. SPROUT = '@' # Constants for the directio...
#!/usr/bin/env python # Copyright 2015 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """ Unit tests for the contents of shared_prefs.py (mostly SharedPrefs). """ import logging import unittest from devil import devil_e...
# Copyright 2015 Google Inc. 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 a...
import torch import torch.nn as nn import torch.nn.functional as F import torchvision.transforms as transforms import numpy as np import matplotlib from matplotlib import pyplot as plt from mpl_toolkits.mplot3d import Axes3D from easy21 import Easy21 GAMMA = 0.9 BATCH_SIZE = 128 LR = 0.01 # Learning rate EPSILON = 0....
import os import sys import datetime import shutil import configparser # default templates index_md_tpl = """ [//]: # (DO NOT EDIT. index.md is generated by nbpages. Make changes to templates/index.md.tpl.) # {{ page_title }} {% for line in readme_toc -%} {{ line }} {% endfor %} """ notebook_header_tpl = """ *This ...
import os import matplotlib.pyplot as plt import numpy as np from models.senet import SENet from neural_network import NeuralNetwork from games.tictactoe import TicTacToe from games.tictacmo import TicTacMo from players.deep_mcts_player import DeepMCTSPlayer from players.uninformed_mcts_player import UninformedMCTSPla...
# encoding: utf-8 from __future__ import unicode_literals, division import math from Pass.colors import Color from Pass.units import Pr, unitdispatcher ######################## # Color initialization # ######################## def rgb(r, g, b): """Converts an Rgb(r, g, b) triplet into a color.""" return C...
from datetime import datetime from django.contrib import messages from django.core.exceptions import PermissionDenied from django.http import Http404 from django.http import JsonResponse from django.shortcuts import redirect from django.urls import reverse from django.views import View from django.views.generic import...
#!/usr/bin/env python3 # day_07.py # By <NAME>, 2018. import aocd import copy def extract_step_data(step_text): return [(line[36], line[5]) for line in step_text.split('\n')] def create_step_dict(step_data): """ Calculate a dictionary, indexed by step, to lists of its precursor steps. :param step_...
from openpyxl import load_workbook from os import path import math def not_number(s): try: float(s) return False except ValueError: pass try: import unicodedata unicodedata.numeric(s) return False except (TypeError, ValueError): ...
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2010 United States Government as represented by the # Administrator of the National Aeronautics and Space Administration. # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compli...
#!/usr/bin/env python """ For getting fluxes right in Jy/beam """ __author__ = "<NAME>" from scipy import * import numpy as np import math def gaussianDeconvolve(smaj, smin, spa, bmaj, bmin, bpa): """'s' as in 'source', 'b' as in 'beam'. All arguments in radians. (Well, major and minor axes can be in any un...
# -*- coding: utf-8 -*- """ 从指定文件夹随机获取一个图片并设置为壁纸。 """ import os import glob import hashlib import ctypes import random import sqlite3 import logging from PIL import Image from datetime import datetime from path import wallpaper_path, src_path, bing_path, bingcom_path, spotlight_path, pc_path, tablet_path, theme_path ...
import uuid from hazelcast.errors import OperationTimeoutError from hazelcast.future import Future from hazelcast.protocol.codec import ( count_down_latch_await_codec, count_down_latch_get_round_codec, count_down_latch_count_down_codec, count_down_latch_get_count_codec, count_down_latch_try_set_cou...
__docformat__ = "numpy" # pylint: disable=R1710 import argparse from typing import List import pandas as pd from prompt_toolkit.completion import NestedCompleter from gamestonk_terminal import feature_flags as gtff from gamestonk_terminal.helper_funcs import get_flair from gamestonk_terminal.menu import session from...
# Copyright 2014 The Android Open Source Project # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed...
# Copyright 2016 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. import re from telemetry.timeline import chrome_trace_category_filter RECORD_MODE_PARAM = 'record_mode' ECHO_TO_CONSOLE = 'trace-to-console' RECORD_AS_MU...
from .typing import Dict, Optional, List, Generator, Tuple from contextlib import contextmanager import sublime import sublime_plugin # about 80 chars per line implies maintaining a buffer of about 40kb per window SERVER_PANEL_MAX_LINES = 500 OUTPUT_PANEL_SETTINGS = { "auto_indent": False, "draw_indent_guide...
from __future__ import print_function import sys import numpy as np import numba.unittest_support as unittest from numba.compiler import compile_isolated from numba.numpy_support import from_dtype from numba import types, njit, typeof from .support import TestCase, CompilationCache, MemoryLeakMixin def array_dtype...
from django.db import models class HistoryDescriptor(object): def __init__(self, model): self.model = model def __get__(self, instance, owner): if instance is None: return HistoryManager(self.model) return HistoryManager(self.model, instance) class HistoryManager(models.Ma...
#!/usr/bin/env python from PyQt4 import QtCore, QtGui import os import os.path import glob import re import fnmatch from functools import reduce from ..delegate import htmlEscape from .base import AbstractCompleter regExPatterns = [fnmatch.translate(f) for f in ['*.pyc']] compositeRegExpPattern = '(' + ')|('.join(r...
from bottle import request _endpoints = {} def _route(method, path): def decorator(fn): _endpoints.setdefault(method, {})[path] = fn.__name__ return fn return decorator get = (lambda path: _route('GET', path)) post = (lambda path: _route('POST', path)) put = (lambda path: _route('PUT', path...
#!/usr/bin/env python # -*- coding: utf-8 -*- # @Date : 2018-11-05 11:30:01 # @Author : <NAME> (<EMAIL>) # @Link : http://cs.ucsb.edu/~bolunwang import os import time import numpy as np import random import tensorflow import keras import h5py from tensorflow import set_random_seed random.seed(123) np.random.se...
#%% import os import os.path as osp import math import glob import numpy as np import torch #from torch.utils.data import Dataset, DataLoader torch.cuda.is_available() torch.version.cuda #%% import torch.nn as nn import torch.nn.functional as F import torch_geometric.transforms as T from torch_geometric.data import Da...
# -*- coding: utf-8 -*- """ Perform 10 times 10-fold cross-validation and time-wise cross-validation. author: <NAME> date: 2018/9/23 """ import numpy as np import pandas as pd import scipy.io as sio from indicator import * from eatt import EATT import sklearn.metrics as sm import warnings warnings.filterwarnings('alw...
import capnp import tarfile import io from .session import get_active_session from ..common import RainException, ids, ID from ..common.attributes import attributes_to_capnp from ..common.content_type import check_content_type, encode_value from ..common import DataType class DataObject: id = None # Flag i...
from unittest.mock import Mock import pytest from shapely.geometry import MultiPolygon, Polygon from autocensus.geography import ( Geo, calculate_congress_number, coerce_polygon_to_multipolygon, determine_gazetteer_code, determine_geo_code, flatten_geometry, identify_affgeoid_field, is...
#!/usr/bin/env python3 from __future__ import print_function import numpy as np from scipy.optimize import brentq import sys import os import matplotlib.pyplot as plt from util import msg, runparams, io usage = """ compare the output for a dam problem with the exact solution contained in dam-exact.out. ...
"""This module contains the general information for ComputeTemplate ManagedObject.""" from ...ucscmo import ManagedObject from ...ucsccoremeta import UcscVersion, MoPropertyMeta, MoMeta from ...ucscmeta import VersionMeta class ComputeTemplateConsts(): INSTANTIATION_STATE_BIOS_RESTORE = "bios-restore" INSTAN...
# Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not u...
import sqlite3 from collections import defaultdict from transformers.transformer import Transformer from openapi_server.models.names import Names from openapi_server.models.attribute import Attribute from openapi_server.models.element import Element from openapi_server.models.connection import Connection connection ...
from op3.launchers.launcher_util import run_experiment import op3.torch.op3_modules.op3_model as op3_model from op3.torch.op3_modules.op3_trainer import TrainingScheduler, OP3Trainer import numpy as np import h5py from op3.torch.data_management.dataset import Dataset, BlocksDataset from torch.utils.data.dataset impo...
#!/usr/bin/env python3 # -*- Coding: UTF-8 -*- # --------------------------------------------------------------------------- # Open Asset Import Library (ASSIMP) # --------------------------------------------------------------------------- # # Copyright (c) 2006-2010, ASSIMP Development Team # # All rights reserved. #...
from admin_api.patient_data_import import PatientDataRow, COLUMNS from visits.data_access import all_visits from openpyxl import load_workbook from events.data_access import events_by_visit, camp_by_patient from patients.data_access import patient_from_id from users.data_access import user_name_by_id from events.event_...
from collections import namedtuple from itertools import islice from bit.crypto import double_sha256, sha256 from bit.exceptions import InsufficientFunds from bit.format import address_to_public_key_hash from bit.network.rates import currency_to_satoshi_cached from bit.utils import ( bytes_to_hex, chunk_data, hex_...
#!/usr/bin/env python # -*- encoding: utf-8 -*- # Copyright (c) 2002-2020 "Neo4j," # Neo4j Sweden AB [http://neo4j.com] # # This file is part of Neo4j. # # 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 flask import ( Blueprint, render_template, redirect, url_for, request, flash, current_app ) from flask_login import login_required, current_user from modules.Auth.user_db import UserDatabase from models import requires_access_level import numpy as np from itertools import chain, product farmportal = Blu...
#!/usr/bin/env python # -*- coding: utf-8 -* from ast import literal_eval from pandas import DataFrame # http://github.com/pydata/pandas import re import requests # http://github.com/kennethreitz/requests import subprocess import sys corpora = dict(eng_us_2012=17, eng_us_2009=5, eng_gb_2012=18, eng_gb_2...
#!/usr/bin/env python3 import argparse from collections import deque from distutils.dir_util import copy_tree from distutils.version import LooseVersion import git import json import os import requests import semver import shutil import subprocess import tarfile import tempfile websiteGeneratorRepoDir = os.path.abspa...
"""CLI app for benchmarking.""" import json from datetime import datetime from time import sleep from typing import Any, Dict, Optional import click import distributed import rasterio.enums from odc.stac import configure_rio from odc.stac.bench import ( SAMPLE_SITES, BenchLoadParams, dump_site, load_f...
# ##### BEGIN GPL LICENSE BLOCK ##### # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; either version 2 # of the License, or (at your option) any later version. # # This program is distrib...
#coding:utf-8 import parser from itsdangerous import TimedJSONWebSignatureSerializer as Serializer, SignatureExpired, BadSignature from flask_httpauth import HTTPTokenAuth import json from . import blast from flask import request,jsonify from api.model.login_model import User,BlastModel from api import db from .blast...
import os import pickle from pathlib import Path from subprocess import CalledProcessError, check_output import pandas as pd from fastcore.script import * from function_parser.parsers.java_parser import JavaParser from git import Git, Repo import utils as node2vec_utils JAVA_CALLGRAPH_PATH = Path("/workspace/") / "j...
import numpy as np from scipy.stats import pearsonr from mskit.metric import similarity """ Use all label / Use shared From array / From dict array 或 dict 的上一级,prec 水平 返回值包含所有 prec union 的数量,shared 数量,即两个 n 删除完全没有匹配或给一个默认值 0? """ """ 1. One side: 一边为 benchmark,另一边缺失补零 or other number 2. Two side: 两边并集,缺失补零 3. Shared...
################################################################################# # Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. # # # # Licensed under the Apache License, Version 2.0 (the "License"). ...
import hashlib import json import requests def get_resource_spec(): cfn_resource_spec_url = "https://d1uauaxba7bl26.cloudfront.net/latest/gzip/CloudFormationResourceSpecification.json" # Load the source data and hash it response = requests.get(cfn_resource_spec_url) return response def check_for_up...
#!/usr/bin/env python # Licensed to Cloudera, Inc. under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. Cloudera, Inc. licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you ma...
#!/usr/bin/env python """ .. "new" sub-command (creates a new project) .. codeauthor:: <NAME> <<EMAIL>> .. Copyright (c) 2016 <NAME> See the https://opensource.org/licenses/MIT for license details. """ from ..subcommand import SubcommandABC, clean_help from ..log import getLogger _logger = getLogger(__name__) D...
""" Module that containing utilities involving datetimes. """ import datetime as dt import warnings import numpy as np import pandas as pd from scipy import stats def dates_between(sdate, edate): """ Ths procedure returns all of the dates between *sdate* and *edate*. Parameters ---------- sdat...
import discord import itertools import logging import mimetypes from discord.ext import commands from .utils.helper import edit, embedColor, permEmbed from .utils.save import delete_key, read_json, save_commands log = logging.getLogger('LOG') class CustomCommands: def __init__(self, bot): self.bot = bo...
import time import cv2 import numpy as np class ImgGreyscale(): def run(self, img_arr): img_arr = cv2.cvtColor(img_arr, cv2.COLOR_RGB2GRAY) return img_arr def shutdown(self): pass class ImgWriter(): def __init__(self, filename): self.filename = filename def run(self...
__doc__ = "Convert tiira.fi CSV file into different formats" __doc_fi__ = ( "Muuntaa tiira.fi havaintopalvelusta ladatun CSV-tiedoston eri formaatteihin" ) __author__ = "<NAME>" __copyright__ = "Copyright 2020" __license__ = "MIT" __version__ = "1.0" __maintainer__ = "<NAME>" __email__ = "<EMAIL>" from datetime i...
from pathlib import Path from typing import Final import matplotlib.pyplot as plt from matplotlib import rc import ptg.dual_quad as dq colors = ( "tab:blue", "tab:orange", "tab:green", "tab:red", "tab:purple", "tab:brown", "tab:pink", "tab:gray", "tab:olive", "tab:cyan", ) la...
#!/usr/bin/env python # -*- coding: utf-8 -*- # Copyright (c) 2012-2021 SoftBank Robotics. All rights reserved. # Use of this source code is governed by a BSD-style license (see the COPYING file). """ Test QiSrc Reset """ from __future__ import absolute_import from __future__ import unicode_literals from __future__ imp...
# Copyright 2021 <NAME> <<EMAIL>> # SPDX-license-identifier: 0BSD # Everything scheduled runs as part of axm.parser.finalize() function. import collections try: from axm.exceptions import AxmMeanValError except ModuleNotFoundError: from invconv.axm.exceptions import AxmMeanValError # Constants. NICE_INHERIT...
from tkinter import * import mysql.connector # Funções # Função do botão de limpar campos def limpar_campos(): primeiro_nome_entry.delete(0, END) sobrenome_entry.delete(0, END) endereco_1_entry.delete(0, END) endereco_2_entry.delete(0, END) cidade_entry.delete(0, END) estado_entry.delete(0, EN...
import sys from scipy.optimize import differential_evolution from scipy.optimize import NonlinearConstraint, LinearConstraint, Bounds from nas.src.optim.block_frank_wolfe import BlockFrankWolfe from nas.src.optim.utils import * np.set_printoptions(threshold=sys.maxsize, suppress=True, precision=11) class DiffEvo...
# 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...