text stringlengths 8.04k 46.5k |
|---|
# (C) Datadog, Inc. 2010-2016
# All rights reserved
# Licensed under Simplified BSD License (see LICENSE)
"""
This module contains classes which are used to occasionally persist the status
of checks.
"""
# stdlib
from collections import defaultdict
import cPickle as pickle
import datetime
import logging
import os
impo... |
#!/usr/bin/python
# Copyright (c) 2017, 2021 Oracle and/or its affiliates.
# This software is made available to you under the terms of the GPL 3.0 license or the Apache 2.0 license.
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
# Apache License v2.0
# See LICENSE.TXT for d... |
# interfaces.py
# Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010 <NAME>
# <EMAIL>
#
# This module is part of SQLAlchemy and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php
"""
Semi-private module containing various base classes used throughout the ORM.
Defines the extension ... |
import pygame, math
from pygame import Rect
def pause():
get_out = False
while not get_out:
while not pygame.event.peek(pygame.KEYDOWN):
pygame.time.delay(10)
for e in pygame.event.get(pygame.KEYDOWN):
if e.key == pygame.K_ESCAPE:
pygame.quit()
... |
# Copyright (c) 2014-2021 <NAME> <<EMAIL>>
# Copyright (c) 2014-2015 LOGILAB S.A. (Paris, FRANCE) <<EMAIL>>
# Copyright (c) 2015-2016 Ceridwen <<EMAIL>>
# Copyright (c) 2015 <NAME> <<EMAIL>>
# Copyright (c) 2018 <NAME> <<EMAIL>>
# Copyright (c) 2018 <NAME> <<EMAIL>>
# Copyright (c) 2019-2020 <NAME> <<EMAIL>>
# Copyrigh... |
from copy import deepcopy
from typing import List, Optional
from collections import deque
import numpy as np
from sklearn.preprocessing import normalize
from skmultiflow.core import BaseSKMObject, ClassifierMixin, MetaEstimatorMixin, clone
from skmultiflow.drift_detection.base_drift_detector import BaseDriftDetector... |
# Copyright 2018 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... |
import os
import sys
sys.path.append(os.path.join(os.environ['ALFWORLD_ROOT']))
sys.path.append(os.path.join(os.environ['ALFWORLD_ROOT'], 'gen'))
import json
import glob
import os
import constants
import cv2
import shutil
import numpy as np
import argparse
import threading
import time
import copy
import random
import ... |
# Import Flask module\s
from flask import Flask, redirect, url_for, render_template, request, session, flash
from firebird.connectfdb import con_to_firebird, con_to_firebird2, con_to_firebird3
# Import external module's
from collections import defaultdict
import json
import datetime
import time
from datetime import ti... |
# -*- coding: utf-8 -*-
#
# SelfTest/Cipher/test_pkcs1_oaep.py: Self-test for PKCS#1 OAEP encryption
#
# ===================================================================
# The contents of this file are dedicated to the public domain. To
# the extent that dedication to the public domain is not available,
# everyone... |
"""
Copyright 2019 <NAME>.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing,
software distribut... |
"""
Author: <NAME>, Rice ECE (nkg2 at rice.edu)
This is where you actually train models. See below for docs:
Generate a synthetic graph, with holes in upper left and lower right regions, + paths over the graph:
python3 synthetic_data_gen.py
-Edit main of synthetic_data_gen.py to change graph size / # of paths... |
# -*- coding: utf-8 -*-
# *****************************************************************************
# NICOS, the Networked Instrument Control System of the MLZ
# Copyright (c) 2009-2021 by the NICOS contributors (see AUTHORS)
#
# This program is free software; you can redistribute it and/or modify it under
# the t... |
# ---------------------------------------------------------------
# xtransformer.py
# Set-up time: 2021/1/3 16:29
# Copyright (c) 2020 ICT
# Licensed under The MIT License [see LICENSE for details]
# Written by Kenneth-Wong (Wenbin-Wang) @ VIPL.ICT
# Contact: <EMAIL> [OR] <EMAIL>
# ------------------------------... |
# coding=utf-8
# Copyright 2018 The Google AI Language Team Authors and The HuggingFace Inc. team.
# Copyright (c) 2018, <NAME>. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of t... |
import time
import threading
import matplotlib.pyplot as plt
import numpy as np
import sympy
import tkinter
import math
from matplotlib.backends.backend_tkagg import ( FigureCanvasTkAgg, NavigationToolbar2Tk )
import sys
import math
class Cursor:
"""
A cross hair cursor.
"""
def __init__(self, ax):
... |
#!/usr/bin/env python
# coding=utf-8
"""
A Qt-based image viewer which supports zooming and scrolling.
"""
import os
from enum import Enum
from PyQt5.QtWidgets import QMainWindow, QApplication, QWidget, QScrollArea,\
QHBoxLayout, QVBoxLayout, QDialog
from PyQt5.QtCore import pyqtSignal, pyqtSlot, Qt, QSize, QPoint... |
"""
Модуль расчета ЭЦН, основанные на модели ЭЦН в UniflocVBA
<NAME>. <NAME>. 27.07.2019
"""
import uniflocpy.uTools.uconst as uc
import uniflocpy.uPVT.PVT_fluids as PVT_fluids
import numpy as np
import uniflocpy.uTools.data_workflow as data_workflow
import pandas as pd
import time
import plotly.graph_objs as go
from ... |
# Quest Name: Monkey Madness
# Written by <NAME>, 11/02/18
# Quest Length: Medium
# Quest Difficulty: Medium
from game.content.quest import Quest
from game.content.quest import QuestHandler
from game.content.quest import QuestReward
king_narnode_shareen = 1423
karam = 7172
lumdo = 1453
lumo = 7112
def configure_ques... |
"""
Testing Recursive feature elimination
"""
from operator import attrgetter
import pytest
import numpy as np
from numpy.testing import assert_array_almost_equal, assert_array_equal, assert_allclose
from scipy import sparse
from sklearn.base import BaseEstimator, ClassifierMixin
from sklearn.feature_selec... |
__license__ = """
Copyright (c) 2012 mpldatacursor developers
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, mer... |
#!/usr/bin/env python3
# Copyright (c) 2012 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.
"""Download files from Google Storage based on SHA1 sums."""
from __future__ import print_function
import hashlib
import optparse... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Tue Oct 24 14:01:52 2017
@author: leminen
"""
import sys
import os
import tensorflow as tf
import numpy as np
import functools
import matplotlib.pyplot as plt
import datetime
import scipy
import argparse
import shlex
import src.utils as utils
import src.d... |
import numpy as np
import h5py
import pyqmc.linemin
import pyqmc.hdftools as hdftools
import pyqmc.mc as mc
import os
def ortho_hdf(hdf_file, data, attr, configs, parameters):
if hdf_file is not None:
with h5py.File(hdf_file, "a") as hdf:
if "configs" not in hdf.keys():
hdftoo... |
import copy
import csv
import json
import logging
import sys
import time
import traceback
from datetime import datetime
from datetime import timedelta
from datetime import timezone
from typing import Optional
from urllib.error import HTTPError
import requests
from dateutil import parser as du_parser
from folio_uuid.fo... |
import ast
import copy
import math
import typing
from collections import OrderedDict
from typing import MutableMapping, List, Set, Tuple, Mapping, Optional
from willump import *
from willump.graph.array_count_vectorizer_node import ArrayCountVectorizerNode
from willump.graph.array_tfidf_node import ArrayTfIdfNode
from... |
"""
weasyprint.svg
--------------
Render SVG images.
"""
import re
from math import cos, hypot, pi, radians, sin, sqrt
from xml.etree import ElementTree
from cssselect2 import ElementWrapper
from .bounding_box import bounding_box, is_valid_bounding_box
from .css import parse_declarations, parse_stylesh... |
import json
from collections import defaultdict
from copy import deepcopy
from dataclasses import dataclass, asdict, is_dataclass
from typing import Dict, List, Set, Tuple, Union, FrozenSet
import os
from itertools import chain
import numpy as np
from .util import Example
@dataclass(eq=True, frozen=True)
class E... |
import os
import datetime
import bclm
import pandas as pd
import subprocess
import sys
import networkx as nx
import traceback
import re
from io import StringIO
from config import *
from ne_evaluate_mentions import fix_multi_biose, read_file_sents
def read_text_file(path):
sents = []
with open(path, 'r', enco... |
"""
Requires python-chess
"""
import traceback
import sys
import os
import random
from threading import Thread
from _thread import *
from qboard import QBoard
from client import Client
from server import Server
import chess
import chess.engine
import chess.pgn
import chess.polyglot
import chess.svg
#import chess.... |
# -*- coding: utf-8 -*-
import inspect
import logging
import re
import sys
import six
from django.core.files import File
from django.db.models import Field
try:
from importlib import import_module
except ImportError:
from django.utils.importlib import import_module
from django_dynamic_fixture.django_helper ... |
import numpy as np
import os
import sys
import matplotlib.pyplot as plt
from matplotlib.patches import Polygon, Circle, Arrow
import matplotlib.gridspec as gridspec
import matplotlib.patches as patches
import scipy.misc
import logging
import coloredlogs
from PIL import Image, ImageDraw, ImageFont
from easydict import E... |
import suds
from suds.client import Client
from PyQt4 import QtCore, QtGui, uic
from Queue import Queue # Makes suds requests threadsafe
from contextlib import contextmanager # For suds threadsafe workaround
import sys, threading, time, json, urllib2
"""Loads the .ui file for the GUI"""
form_class = uic.loadUiType('... |
# -*- coding: utf-8 -*-
#
# Copyright 2018-2021- Swiss Data Science Center (SDSC)
# A partnership between École Polytechnique Fédérale de Lausanne (EPFL) and
# Eidgenössische Technische Hochschule Zürich (ETHZ).
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in co... |
#!/usr/bin/env python
# coding: utf-8
"""
RedEdge Image Class
An Image is a single file taken by a RedEdge camera representing one
band of multispectral information
Copyright 2017 MicaSense, Inc.
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated docu... |
import pygame #imports pygame for use
pygame.init() #initiates use of pygame
from random import randint
import math
textFont = pygame.font.SysFont("monospace", 20) #Sets font style to monospace at size 20
width = 800 #Size of game x
height = 600 #Size of game y
angurdsDisplay = pygame.display.set_mode((widt... |
from django.contrib.gis.geos import GEOSGeometry
from django.conf import settings
from django.http import HttpResponse, HttpResponseBadRequest, HttpResponseRedirect
from django.template import RequestContext
from django.shortcuts import render_to_response
from madrona.common.utils import get_logger
from madrona.feature... |
import itertools
import random
import gurobipy as grb
import numpy as np
from opentamp.core.util_classes import common_predicates
from opentamp.core.util_classes.matrix import Vector, Vector2d
from sco_py.expr import AffExpr, BoundExpr, EqExpr, QuadExpr
from sco_py.sco_gurobi.prob import Prob
from sco_py.sco_gurobi.... |
from image_morphing.np import np, GPU
from datetime import datetime
from scipy.optimize import minimize
from image_morphing.render import render_animation, render
from image_morphing.utils import resize_all, describe
import time
from image_morphing.utils import get_v, get_color
import matplotlib.pyplot as plt
if GPU:
... |
import logging
import os
import shutil
import pytest
from flaky.flaky_decorator import flaky
import dvc as dvc_module
from dvc.external_repo import clean_repos
from dvc.main import main
from dvc.stage.exceptions import StageNotFound
from dvc.utils.fs import move, remove
from dvc.utils.serialize import dump_yaml, load... |
#
# 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
# ... |
import numpy as np
import pytest
import xarray as xr
from affine import Affine
from shapely.geometry import Polygon
from regionmask import Regions
from regionmask.core.mask import (
_determine_method,
_inject_mask_docstring,
_mask_rasterize,
_mask_rasterize_no_offset,
_mask_shapely,
_transform_... |
import unittest
import common
import json
import re
_schema = 'ctypes'
from common import Int4, Int8, Text, Int4Array, TextArray, Timestamptz, TypeDoc, ArrayDoc, \
RID, RCT, RMT, RCB, RMB, RidKey, \
ModelDoc, SchemaDoc, TableDoc, ColumnDoc, KeyDoc, FkeyDoc
def setUpModule():
url = 'schema/%s' % _schema
... |
'''
Copyright (c) 2015 Preferred Infrastructure, Inc.
Copyright (c) 2015 Preferred Networks, Inc.
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... |
# Copyright 2013 OpenStack Foundation
# Copyright (C) 2013 Yahoo! 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/licens... |
#!/usr/bin/python
# coding: utf-8 -*-
# Copyright 2019 Red Hat, Inc.
# Copyright (c) 2014 Hewlett-Packard Development Company, L.P.
# Copyright (c) 2013, <NAME> <<EMAIL>>
# Copyright (c) 2013, <NAME> <<EMAIL>>
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
DOCUMENTATION =... |
#!/usr/bin/python3
#-*- coding:utf-8 -*-
import os
import sys
import copy
import xlrd
import json
import tqdm
import shutil
import pickle
import random
import binascii
import operator
import numpy as np
import pandas as pd
import scapy.all as scapy
from functools import reduce
from flowcontainer.extr... |
from flask import Flask, redirect, url_for, render_template, request
############## STOCK PRICE PREDICTION StockMarketSimulator Part-1
#########################################
def price_prediction(stock_name,forecast_out):
import quandl
import numpy as np
from sklearn.linear_model import Line... |
import os
import argparse
import json
import numpy as np
import torch
import torch.optim as optim
import torch.nn as nn
import logging
import torchvision
import torch.utils.data as data
import torch.nn.functional as F
from torch.autograd import Variable
from torchvision import datasets, transforms
from itertools impor... |
import os
import random
import inspect
import dnn
from dnn import np
from dnn import chainer
from dnn import F
from dnn import L
from dnn import Variable
import cv2
import imgutil
xp = None
test = False
bgr_to_dnn = imgutil.bgr_to_pm
dnn_to_bgr = imgutil.pm_to_bgr
bgr_to_dnn_batch = imgutil.bgr_to_pm_batch
def cal_l... |
# Import modules
import pytest
import numpy as np
import xarray as xr
import oceanspy as ospy
# From OceanSpy
from oceanspy import open_oceandataset
from oceanspy import AVAILABLE_PARAMETERS
from oceanspy.compute import gradient, divergence, curl
from oceanspy.compute import (missing_horizontal_spacing,
... |
#
# Modified by <NAME> 2020/4/7 16.04pm
# ***
from __future__ import print_function
import argparse
import os
import random
import torch
import torch.nn as nn
import torch.nn.parallel
import torch.backends.cudnn as cudnn
import torch.optim as optim
import torch.utils.data
import torchvision.transforms as transforms
imp... |
from __future__ import division
import numpy as np
import scipy as sp
import pandas as pd
from scipy.stats import gamma
import matplotlib.pyplot as plt
from six.moves import range, StringIO, cPickle
class HRFModel(object):
"""Abstract class definition for HRF Models."""
def __init__(self):
raise NotI... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# Copyright 2018 University of Groningen
#
# 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... |
# 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 app... |
# This file contains functions needed for running Pe-J0 comparison,
# especially for the Greenland Ice Sheet (GrIS).
# by <NAME>
# Last modified: Feb 22, 2022
import numpy as np
from scipy.signal import savgol_filter
from scipy import interpolate
import warnings
import h5py
# ============ Code from Felikson et al.
d... |
#!/usr/local/bin/python3
#
# Copyright (c) 2021 <NAME>
# All rights reserved.
#
# Author: <NAME> <<EMAIL>>
#
# SPDX-License-Identifier: BSD-2-Clause
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
# 1. Redistributions... |
""" Convert img-list to tensorflow TFRecord format """
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import os
import sys
import numpy as np
import pandas as pd
import argparse
import cv2
import json
from natsort import natsorted
from tqdm import tqdm
from... |
from Voicelab.pipeline.Node import Node
import parselmouth
from parselmouth.praat import call
from Voicelab.toolkits.Voicelab.VoicelabNode import VoicelabNode
from Voicelab.toolkits.Voicelab.MeasureFormantNode import MeasureFormantNode
from Voicelab.VoicelabWizard.VoicelabTab import VoicelabTab
from Voicelab.VoicelabWi... |
from dolang.symbolic import sanitize, parse_string, str_expression
from dolang.language import eval_data
from dolang.symbolic import str_expression
import copy
class SymbolicModel:
def __init__(self, data):
self.data = data
@property
def symbols(self):
if self.__symbols__ is None:
... |
# Authors: <NAME> <<EMAIL>>
#
# Copyright (C) 2006 Red Hat
# see file 'COPYING' for use and warranty information
#
# 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; version 2 only
#
# This program... |
"""Functions"""
import os
import sys
from sys import exit, stderr, argv, path, modules
from os.path import isfile, isdir, realpath, dirname, exists
import numpy as np
import pandas as pd
# plotting
import matplotlib
import seaborn.apionly as sns
from matplotlib import rc
import matplotlib.lines as mlines
import pylab a... |
#!/usr/bin/env python
## Macro Milter for postfix - https://github.com/sbidy/MacroMilter
##
## 1.4 - 15.12.2015 sbidy - Update comments, add hash-set for lookup and safe to persistent
## 1.5 - 16.12.2015 sbidy - Add date-time to performance log
## 1.6 - 16.12.2015 sbidy - Change to TCP Socket, Socket an timeout to glob... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Asset management models."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import datetime
import logging
import os
from dateutil.relativedelta import relativedelta
... |
from decimal import Decimal
from django import forms
from django.conf import settings
from django.core.exceptions import ValidationError
from django.db.models import Q
from django.forms.formsets import formset_factory, BaseFormSet
import commonware
import happyforms
from curling.lib import HttpClientError
from tower ... |
import os
import numpy as np
import pandas as pd
import framework.constants as cs
from io import StringIO
from framework.representations.embedding import Embedding
from framework.util import scaleInRange
from framework.util import drop_duplicates
heads_vad = ['Word','Valence','Arousal','Dominance']
heads_be5 = ['Word'... |
#!/usr/bin/env python
"""Convert between COCO and PoseTrack2017 format."""
# pylint: disable=too-many-branches, too-many-locals, bad-continuation, unsubscriptable-object
from __future__ import print_function
import json
import logging
import os
import os.path as path
import click
import numpy as np
import tqdm
from ... |
# -*- coding: utf-8 -*-
"""
Logs models.
These models are used to store the logs into the database. Using a database
allows to query the logs more efficiently without having to read the log
files every time.
Of course, these tables have to be updated in the background and in real-time,
which is the difficulty here. ... |
##
# Copyright (c) 2006-2016 Apple 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 l... |
import numpy as np
import torch
import torch.nn as nn
import torch.nn.functional as F
import nlp
from torch.distributions import Categorical
from nn_utils import PositionalEncoding, has_nan, universal_sentence_embedding, clip_and_normalize
from nltk.translate.bleu_score import SmoothingFunction, sentence_bleu
from Tran... |
from datetime import date
from django.forms.fields import DurationField
from django.test import TestCase, Client
from .models import Station, Data, MeanDay, MeanWeek, MeanYear, Intensity
from django.utils import timezone
from django.urls import reverse, resolve
from .forms import CustomImportForm, CustomConfirmImportFo... |
###
# Copyright (c) 2019, cottongin
# Copyright (c) 2020, oddluck <<EMAIL>>
# 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 n... |
# Unless explicitly stated otherwise all files in this repository are licensed under the the Apache License Version 2.0.
# This product includes software developed at Datadog (https://www.datadoghq.com/).
# Copyright 2021 Datadog, Inc.
import random
import os
import re
from urllib.parse import quote
from utils import ... |
from ModelUtil import ModelDataset
import numpy as np
import tensorflow as tf
import math, random, time
from random import shuffle
def Rotate(m, a, rAxis=2):
c = np.median(m, axis=0)
cosA = math.cos(a)
sinA = math.sin(a)
if m.shape[1] == 3:
if rAxis==2:
R = np.array([[cosA, -sinA, 0... |
import os
import random
from pathlib import Path
from allennlp.data.iterators import BasicIterator
from allennlp.nn.util import move_to_device
from pytorch_pretrained_bert import BertTokenizer, BertModel, BertAdam
import config
from bert_model_variances.bert_multilayer_output import BertMultiLayerSeqClassification
fr... |
import os
import numpy
import pdb
from astrometry.util.fits import fits_table
from legacyzpts import psfzpt_cuts
ccdnamenumdict = {'S1': 25, 'S2': 26, 'S3': 27, 'S4':28,
'S5': 29, 'S6': 30, 'S7': 31,
'S8': 19, 'S9': 20, 'S10': 21, 'S11': 22, 'S12': 23,
'S13': 24,
... |
from itertools import product, chain
import numpy as np
import numbers
import pickle
import time
import datetime
import copy
from isanet.model import Mlp
from isanet.optimizer import SGD, NCG, LBFGS
from isanet.optimizer import EarlyStopping
from isanet.metrics import mse, mee, accuracy_binary
class Kfold():
"""... |
from __future__ import print_function
import numpy as np
import matplotlib
matplotlib.use('Agg')
import matplotlib.pyplot as plt
from matplotlib.backends.backend_pdf import PdfPages
from six.moves import xrange
import sys, getopt
import h5py
import img
import eval
import ref
import data
# ============================... |
# Copyright 2016 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... |
"""Web mercator XYZ tile utilities"""
from collections import namedtuple
from functools import reduce
import math
import sys
import warnings
import operator
if sys.version_info < (3,):
warnings.warn(
"Python versions < 3 will not be supported by mercantile 2.0.",
UserWarning,
)
from collec... |
'''
Descripttion: Train and eval model
version: 1.0
Author: Assassin 567
Date: 2021-11-03 10:40:02
LastEditors: Hello KG
LastEditTime: 2021-11-06 11:15:29
'''
import os
import sys
import argparse
import time
from collections import defaultdict
import numpy as np
import torch
from torch.utils.data import TensorDataset,... |
import os
import json
import sys
import pandas as pd
import markdown2
from helpers import *
from patterns import *
with open('../templates/base/base.html', 'r', encoding='utf-8') as inp:
BASE_TEMPLATE = inp.read()
with open('../templates/partials/header.html', 'r', encoding='utf-8') as inp:
HEADER_TEMPLATE =... |
import json
import math
import os
import random
from django.core.exceptions import ObjectDoesNotExist
from nltk.stem.porter import PorterStemmer
import settings
from .models import (
CompletedStat,
ConfirmationStat,
Pass,
Relation,
UserInput,
UserStat,
WordStat,
)
stemmer = PorterStemmer(... |
#--------------------------------
# Name: crt_fill_parameters.py
# Purpose: GSFLOW CRT fill parameters
# Notes: ArcGIS 10.2 Version
# Python: 2.7
#--------------------------------
import argparse
from collections import defaultdict
import ConfigParser
import datetime as dt
import l... |
# -*- coding: utf-8 -*-
__author__ = "<NAME>"
__email__ = "<EMAIL>"
import tensorflow as tf
import json
import h5py
import numpy as np
from itertools import product
from ..keras.models import \
model_from_config as keras_model_from_config, \
model_from_json as keras_model_from_json, \
load_model as ker... |
import pygame as pg
import numpy as np
from numba import njit
from objLoader import read_obj
SCREEN_W = 800 # frame width
SCREEN_H = 2*int(SCREEN_W*0.375)
FOV_V = np.pi/4 # 45 degrees vertical fov
FOV_H = FOV_V*SCREEN_W/SCREEN_H # proportional horizontal fov
SKY_BLUE = np.asarray([50,127,200]).astype('uint8')
def mai... |
# Copyright (c) Facebook, Inc. and its affiliates.
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import logging
import os
import sys
from argparse import Namespace
from typing import Any, List
import numpy as np
import torch
import torchvi... |
"""
Created on 12:10 at 09/07/2021
@author: bo
"""
import numpy as np
import os
import pandas as pd
import matplotlib.pyplot as plt
import math
import time
import pickle
import seaborn as sns
from scipy.interpolate import interp1d
def get_spectrum(path):
with open(path, 'r') as f:
data = f.readlines()
... |
import tkinter as tk
import tkinter.ttk as ttk
from tkinter.filedialog import askdirectory, askopenfilenames, asksaveasfilename, askopenfilename
import os.path
from os import path, chdir
from datetime import datetime
import sys
# from PlotsFrame import MPLContainer # pylint: disable=import-error
#Chord BEGIN
#The cho... |
"""
Job/Request and character application command module.
Jobs and Apps will be two more manager objects that will
be cloned and set to some staff location or carried around
on the superuser. While a little clunky that they are in-
game objects, it allows for easy @ex, and doesn't require
database migration to add in ... |
import copy
from components.episode_buffer import EpisodeBatch
from modules.mixers.vdn import VDNMixer
from modules.mixers.qmix import QMixer, QMixerQuantilie
import torch as th
from torch.optim import RMSprop
import torch.nn.functional as F
import numpy as np
# ------- levin ------
flag_levin = 0
def huber(x, k=1.0)... |
import argparse
from sklearn.experimental import enable_hist_gradient_boosting
from sklearn.ensemble import GradientBoostingRegressor, HistGradientBoostingRegressor
from sklearn.model_selection import cross_val_score, GroupShuffleSplit, ParameterGrid, GroupKFold
from sklearn.feature_selection import RFECV
import pickle... |
# -*- coding: utf-8 -*-
# Author: <NAME> <<EMAIL>>
#
# This module was developed with funding provided by
# the ESA Summer of Code (2011).
#
# pylint: disable=W0401,C0103,R0904,W0141
from __future__ import absolute_import, division, print_function
"""
This module provides a wrapper around the VSO API.
"""
import re
i... |
# Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import math
from typing import Dict, Optional, Tuple
import logging
import torch
import torch.nn.functional as F
from fairseq import utils
fro... |
from __future__ import annotations
import contextlib
import json
import logging
import os
import time
import warnings
from pathlib import Path
from typing import TYPE_CHECKING, Any, Dict, List, Mapping, Optional, Sequence, Union
import numpy as np
from qcodes.dataset.data_set_protocol import (
SPECS,
BaseDat... |
# coding=utf-8
# Copyright 2021 The Google Research 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 applicab... |
#!/usr/bin/env python3
#
# Cross Platform and Multi Architecture Advanced Binary Emulation Framework
#
import gevent, os
from typing import Callable
from abc import abstractmethod
from unicorn.unicorn import UcError
from qiling.os.thread import *
from qiling.arch.x86_const import *
from qiling.exception import QlEr... |
import logging
import typing
from itertools import chain
from more_itertools import unique_everseen
from six import iteritems
from dbnd._core.configuration.config_path import (
CONF_CONFIG_SECTION,
CONF_TASK_ENV_SECTION,
CONF_TASK_SECTION,
)
from dbnd._core.configuration.config_readers import (
is_li... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright 1999-2018 Alibaba Group Holding 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-... |
# coding: utf8
"""
weasyprint.text
---------------
Interface with Pango to decide where to do line breaks and to draw text.
:copyright: Copyright 2011-2014 <NAME> and contributors, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
from __future__ import division
# XXX No unicode_literals,... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.