text stringlengths 8.04k 46.5k |
|---|
import pygame
from PIL import Image
import time
import pandas as pd
import os
import re # For string slicing stuff (used in natural sort function)
import difflib # For string matching in keywords for keyword suggestions and matching
# Center any windows opened (the map, for example)
os.environ['SDL_VIDEO_CENT... |
# standard library
import sys
import re
from typing import Any, Dict, List, Literal, Tuple, Union
import os
import json
import subprocess
import time
# third-party libraries
import numpy as np
import matplotlib.pyplot as plt
import matplotlib.patheffects as path_effects
# local
from validate_utils import write_report... |
# Copyright (C) 2018-2022 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
import os
import sys
from datetime import datetime
from openvino.runtime import Dimension
from openvino.tools.benchmark.benchmark import Benchmark
from openvino.tools.benchmark.parameters import parse_args
from openvino.tools.benchmark... |
# Concord
#
# Copyright (c) 2019 VMware, Inc. All Rights Reserved.
#
# This product is licensed to you under the Apache 2.0 license (the "License").
# You may not use this product except in compliance with the Apache 2.0 License.
#
# This product may include a number of subcomponents with separate copyright
# notices a... |
##Collect data:
#SMI: 2021/10/29
# create proposal: proposal_id('2021_3', '30000_YZhang_XZ') #create the proposal id and folder
# create proposal: proposal_id('2021_3', '30000_YZhang_Nov') #create the proposal id and folder
# create proposal: proposal_id('2021_3', '307961_Dinca') #create the proposal id ... |
# -*- coding: utf-8 -*-
"""
Created on Sun Nov 22 19:41:29 2020
@author: <NAME>
"""
import time
import numpy as np
import plotly.graph_objects as go
print("Henry Lu's FEM Module 已导入!")
# TODO:桁架/钢架体系FEM
class FEM:
# TODO:输入部分
def __init__(self,geometric,unit,force,constraint=dict(NR=[],DX=[]),dim = 3):
i... |
"""
This script creates a boolean mask based on rules
1. is it boreal forest zone
2. In 2000, was there sufficent forest
"""
#==============================================================================
__title__ = "FRI calculator for the other datasets"
__author__ = "<NAME>"
__version__ = "v1.0(21.08.2019)"
__emai... |
# encoding: utf-8
import urllib
import hmac
import base64
import hashlib
import requests
import traceback
from copy import copy
from datetime import datetime
from threading import Thread
from Queue import Queue, Empty
from multiprocessing.dummy import Pool
from time import sleep
import json
import zlib
# retrieve p... |
# Copyright 2017 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 ... |
"""
Copyright (C) 2016 The University of Sydney, Australia
This program is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License, version 2, as published by
the Free Software Foundation.
This program is distributed in the hope that it wi... |
import math
import torch
import torch.nn as nn
import torch.nn.functional as F
from torch.nn.init import xavier_normal_, xavier_uniform_
from torch.nn.init import constant_
from torch.nn.parameter import Parameter
from torch import Tensor
from typing import Tuple, List, Optional
from einops import rearrange
from src... |
# Copyright 2010 New Relic, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writ... |
# Copyright 2021 The TensorFlow Probability 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 o... |
from __future__ import annotations
import datetime
import enum
import functools
import itertools
import operator
from typing import Generic, Iterable, Iterator, List, Optional, Sequence, TypeVar, Union, cast
from . import types
class RangeBoundaries(enum.Enum):
EXCLUSIVE_EXCLUSIVE = "()"
EXCLUSIVE_INCLUSIVE... |
import os
import torch
import yaml
import numpy as np
from PIL import Image
from skimage import io
import torch.nn.functional as F
def pil_loader(path):
# open path as file to avoid ResourceWarning (https://github.com/python-pillow/Pillow/issues/835)
with open(path, 'rb') as f:
img = Image.open(f)
... |
"""
Conversion of a `networkx <http://networkx.github.io/>`_ graph from/to different chemical formats.
.. moduleauthor:: <NAME> <<EMAIL>>
"""
import re
from collections import defaultdict
from enum import Enum
from io import StringIO
from typing import Any
import networkx as nx
from charge.bond_type import BondTyp... |
#!/usr/bin/env python
#############################################################################
##
# This file is part of Taurus
##
# http://taurus-scada.org
##
# Copyright 2011 CELLS / ALBA Synchrotron, Bellaterra, Spain
##
# Taurus is free software: you can redistribute it and/or modify
# it under the terms of t... |
from django.db import models
from django.contrib.auth.models import User
import datetime
import uuid
APPLICATION_STATUSES = (
(0, 'Start'),
(1, 'Step 1'),
(2, 'Complete'),
)
YES_NO = (
(True, 'Yes',),
(False, 'No',)
)
STATES = (
('AL', 'Alabama',),
('AK', 'Alaska',),
('AZ', 'Arizona'... |
#!/usr/bin/env python3
import os
import sys
import time
import copy
import shutil
import glob
import serial
import tempfile
import json
import argparse
from threading import Thread
import subprocess
from nsdk_utils import *
VALID_MAKEFILE_NAMES = ['Makefile', 'makefile', "GNUMakefile"]
class nsdk_builder(object):
... |
"""
Data preparation
Author
-----
YAO-FEI, CHENG 2021
"""
import os
import re
import json
import string
import logging
import subprocess
from typing import List
from dataclasses import dataclass, field
import torch
import torchaudio
from tqdm import tqdm
from speechbrain.utils.data_utils import get_all_files
from ... |
"""
The main purpose of this is to collect data from a facebook. The data
collected will include all the posts made by the page given by the page
id and dump them into a json file in /data. This is raw data, taking in
all the information possible about all the posts within that facebook
page.
Five JSON files (if ran t... |
import argparse
import os, errno
import random as rnd
import string
import sys
import csv
import cv2
from tqdm import tqdm
from string_generator import (
create_strings_from_dict,
create_strings_from_file,
create_strings_from_wikipedia,
create_strings_randomly
)
from data_generator impor... |
#!/usr/bin/env python3
import sys, re, gi, cairo, math
gi.require_version("Gtk", "3.0")
from gi.repository import Gtk, Gdk, Gio, GdkPixbuf, GLib, Pango
class GuiControl:
def __init__(self, l, d, x0, x1, y0, y1, debug=False):
size = 500 # Beginning size
self.debug = debug
self.png_size = 500... |
import numpy as np
import copy
from scipy.special import expit, softmax
from common.wbf_postprocess import weighted_boxes_fusion
def yolo_decode(prediction, anchors, num_classes, input_dims, scale_x_y=None, use_softmax=False):
'''Decode final layer features to bounding box parameters.'''
batch_size = np.shape... |
# -*- coding:utf-8 -*-
''' decoder for sequence-to-sequence learning for lyrics generation or
automatic speech recognition, revised from tensorflow source code,
this code will be updated later to include some other features.
author:
iiiiiiiiiiii iiiiiiiiiiii !!!!!!! !!!!!! ... |
import logging
from typing import Optional, List
from typing_extensions import Final
import math
import functools
from dataclasses import dataclass
from opentrons.protocols.geometry.deck import Deck
from opentrons.commands import types
from opentrons.protocols.api_support.labware_like import LabwareLike
from opentro... |
'''
Created on Dec 22, 2013
@author: root
Edit...
@author: paquoika
'''
import Utils
import Itp
from Atom import Atom
from numpy import arange as np_arange
from Utils import print_pypoly_warning
def check_prop_dihed_atypes(param, atypes, any_atom_is_terminal=False):
found = False
if (param.get_atom_1_name()... |
from __future__ import print_function
import os
import sys
from docopt import docopt
import pyNastran
from pyNastran.utils import check_path
#from gui.formats import format_string
FORMAT_TO_EXTENSION = {
'nastran' : ['.bdf', '.ecd', '.nas', '.op2', '.pch'],
'stl' : ['.stl'],
'cart3d' : ['.tri', '.triq'],
... |
"""
'power.py' module serves mainly for interacting with C++ library fastsim.py
- translate all power spectra, growth functions, correlations functions, etc.
into C++ functions for speed
- handles numpy arrays
- cosmo == C++ class Cosmo_Param, accessible through SimInfo.sim.cosmo
- FTYPE_t=[float, double, long... |
## Code to generate hex tile probability
## \date: 21-10-2017
## \author: <NAME> (prince-ph0en1x)
'''
Version Plan:
* Denote obstacles as place cell of type 0
* Seperate matrix representing annotations for place cells (objects of interest in specific context)
> Episodic memory where overlaps in place cells over tim... |
import math, spss
import sys,os
from extension import Template, Syntax, processcmd
from pathlib import Path
import platform
import tempfile
path = os.path.splitext(__file__)[0]
sys.path.append(path)
from statjson import *
tempdir = Path("/tmp" if platform.system().lower() == "darwin" else tempfile.gettempdir())
tmp_... |
# coding=utf-8
# Copyright 2018 The Tensor2Tensor 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... |
# 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 functools
from typing import Any, Text, Callable, Optional, Dict, Sequence, Tuple, Union
import numpy as np
import tensornetwork as tn
import tensornetwork.linalg.linalg
import tensornetwork.linalg.krylov
import tn_vumps.writer
import tn_vumps.params
import tn_vumps.benchmark as benchmark
import tn_vumps.cont... |
# coding: utf-8
# Copyright (c) Pymatgen Development Team.
# Distributed under the terms of the MIT License.
import unittest
import os
import json
import warnings
import numpy as np
from pymatgen import Lattice, Structure, Specie
from pymatgen.transformations.standard_transformations import \
OxidationStateDecora... |
import matplotlib.pyplot as plt
from matplotlib.lines import Line2D
import matplotlib.cm as cm
import numpy as np
from scipy import interpolate
from scipy.stats import multivariate_normal, gaussian_kde
from scipy.special import logsumexp
from sklearn import mixture
import time
import sys
from pydrake.solvers.ipopt im... |
# -*- coding: utf-8 -*-
# imageio is distributed under the terms of the (new) BSD License.
# This code was taken from visvis/vvmovy/images2swf.py
# styletest: ignore E261
"""
Provides a function (write_swf) to store a series of numpy arrays in an
SWF movie, that can be played on a wide range of OS's.
In desperation... |
#
# Copyright 2018-2021 Elyra 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 writ... |
#!/usr/bin/env python
#
# Copyright The SCons Foundation
#
# runtest.py - wrapper script for running SCons tests
#
# The SCons test suite consists of:
#
# - unit tests - included in *Tests.py files from src/ dir
# - end-to-end tests - these are *.py files in test/ directory that
# requi... |
# Copyright 2014-2016 OpenMarket Ltd
# Copyright 2019 The Matrix.org Foundation C.I.C.
#
# 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 2014 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... |
"""Copied from https://github.com/lwcolton/falcon-cors due to conda-forge issues.
Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
1. Definit... |
# coding: utf-8
# Copyright (c) Materials Virtual Lab
# Distributed under the terms of the BSD License.
from __future__ import division, print_function, unicode_literals, \
absolute_import
import re
import os
import json
import yaml
import random
import logging
import shutil
import subprocess
from collections imp... |
from struct import pack, unpack, calcsize
from array import array
from ctypes import c_byte, c_short, c_int
from .DtsTypes import *
# Shortcut for reading & writing struct data from & to a file descriptor
def ws(fd, spec, *values):
fd.write(pack(spec, *values))
def read_multi(fd, count, spec):
spec = str(count) + ... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# Copyright (C) 2017-2020 The Project X-Ray Authors.
#
# Use of this source code is governed by a ISC-style
# license that can be found in the LICENSE file or at
# https://opensource.org/licenses/ISC
#
# SPDX-License-Identifier: ISC
'''
This script solves the fuzzing pr... |
import argparse
import datetime
import typing
import pandas as pd
import numpy as np
import h5py
import utils
import os
import tqdm
import json
import multiprocessing
def get_stations_coordinates(stations) -> typing.Dict[str, typing.Tuple]:
"""
:return: dictionnary of str -> (coord_x, coord_y) mapping station... |
import json
import math
import logging
import string
import nltk
import scipy
import torch
from nltk.stem.porter import *
import numpy as np
from collections import Counter
import os
from torch.autograd import Variable
import config
import pykp
from utils import Progbar
from pykp.metric.bleu import bleu
stemmer = ... |
# Copyright (C) 2017-2021, <NAME> <<EMAIL>>
# Copyright (C) 2007, Enthought, Inc.
# 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 copyri... |
# Copyright 2018-2021 The glTF-Blender-IO 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... |
#!/usr/bin/env python
"""
Docker Swarm mode management
"""
import argparse
import errno
import logging
import os
import subprocess
import sys
import time
try:
import daemon
import daemon.pidfile
import lockfile
except ImportError:
print('ERROR: The daemon module is required to use the swarm manager, '... |
import itertools
import json
import re
import subprocess
import time
from datetime import timedelta
import requests
from celery.exceptions import SoftTimeLimitExceeded
from celery.utils.log import get_task_logger
from django.conf import settings
from django.contrib.auth.models import User
from django.db import models... |
"""
OpenMDAO Wrapper for the scipy.optimize.minimize family of local optimizers.
"""
import sys
from collections import OrderedDict
from distutils.version import LooseVersion
import numpy as np
from scipy import __version__ as scipy_version
from scipy.optimize import minimize
from openmdao.core.constants import INF_... |
import inspect
import logging
import StringIO
import string
from functools import wraps
from itertools import islice, imap
import capstone as cs
import unicorn
from .disasm import init_disassembler
from ..smtlib import Expression, Bool, BitVec, Array, Operators, Constant
from ..memory import (
ConcretizeMemory, ... |
# -*- coding: utf-8 -*-
from datetime import date, datetime
from decimal import Decimal
from email.mime.base import MIMEBase
from email.mime.image import MIMEImage
from django.core import mail
from django.core.exceptions import ImproperlyConfigured
from django.test import SimpleTestCase
from django.test.utils import ... |
# coding: utf-8
"""
flask_oauthlib.provider.oauth1
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Implemnts OAuth1 provider support for Flask.
:copyright: (c) 2013 by <NAME>.
"""
import logging
from functools import wraps
from werkzeug import cached_property
from flask import request, redirect, url_for
from flask im... |
import argparse
import time
import torch
import torch.nn.parallel
import torch.backends.cudnn as cudnn
import torch.optim
import torch.utils.data
import torchvision.transforms as transforms
import models
import datasets
from multiscaleloss import compute_photometric_loss, estimate_corresponding_gt_flow, flow_error_dens... |
import os
import time
from datetime import datetime
import numpy as np
import numpy.random as npr
import matplotlib
matplotlib.use('Agg')
import matplotlib.pyplot as plt
import tensorflow as tf
print(tf.__version__)
from tensorflow.python.client import device_lib
device_lib.list_local_devices()
from tensorflow.contr... |
"""Greedy coloring test suite.
"""
import networkx as nx
import pytest
is_coloring = nx.algorithms.coloring.equitable_coloring.is_coloring
is_equitable = nx.algorithms.coloring.equitable_coloring.is_equitable
ALL_STRATEGIES = [
"largest_first",
"random_sequential",
"smallest_last",
"independent_se... |
from collections import Counter, defaultdict
import itertools
try:
import igraph as ig
except ModuleNotFoundError:
ig = None
import numpy as np
import operator
import logging
#############################
# Fuzzy Modularity Measures #
#############################
def nepusz_modularity(G, cover):
raise ... |
# Copyright (c) 2019, Xilinx, Inc.
# 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 con... |
import json
import logging
import logging.config
import os
import shlex
import socket
import ssl
import sys
import threading
from datetime import datetime
from urllib.parse import urlencode
from urllib.parse import urlparse
import tornado.escape
import tornado.httpserver as httpserver
import tornado.ioloop
import torn... |
# -*- coding: utf-8 -*-
u"""OPAL execution template.
:copyright: Copyright (c) 2019 RadiaSoft LLC. All Rights Reserved.
:license: http://www.apache.org/licenses/LICENSE-2.0.html
"""
from __future__ import absolute_import, division, print_function
from pykern import pkcompat
from pykern import pkio
from pykern import ... |
import sys
import json
import subprocess
from pathlib import Path
from . import ansi as a
import shutil
import re
import math
import copy
from enum import Enum
import functools
debugLevel = 0
def printDebug(level, string):
if level <= debugLevel:
print (string)
codeRegex = re.compile(r'‘[^’]+?’')
operat... |
import warnings
from collections import OrderedDict, abc as container_abcs
from itertools import chain, islice
import operator
import torch
from .module import Module
from ..parameter import Parameter
from torch._jit_internal import _copy_to_script_wrapper
from typing import Any, Dict, Iterable, Iterator, Mapping, Op... |
# Copyright 2019-2021 ETH Zurich and the DaCe authors. All rights reserved.
"""
Various classes to facilitate the code generation of structured control
flow elements (e.g., ``for``, ``if``, ``while``) from state machines in SDFGs.
SDFGs are state machines of dataflow graphs, where each node is a state and each
edge... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
# CODE DESCRIPTION HERE
Created on 2019-02-13 11:47
@author: ncook
Version 0.0.1
"""
import numpy as np
import os
import tkinter as tk
from tkinter import font
from tkinter import messagebox
import webbrowser
import re
from apero.core import constants
from apero imp... |
#!/usr/bin/env python3
"""Core options text extractor
The purpose of this script is to set up & provide functions for automatic generation of 'libretro_core_options_intl.h'
from 'libretro_core_options.h' using translations from Crowdin.
Both v1 and v2 structs are supported. It is, however, recommended to convert v1 ... |
from __future__ import absolute_import
import torch
import numpy as np
import pandas as pd
import scipy
import copy
from pysurvival import HAS_GPU
from pysurvival import utils
from pysurvival.utils import neural_networks as nn
from pysurvival.utils import optimization as opt
from pysurvival.models import BaseModel
fro... |
"""
Test cases for tree sequences.
"""
from __future__ import print_function
from __future__ import division
import tests
import unittest
import random
import os
import numpy as np
import pytest
import tskit
import msprime
import pyslim
class TestSlimTreeSequence(tests.PyslimTestCase):
def clean_example(self):
... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Tue Nov 26 18:12:22 2019
@author: weetee
"""
import os
import re
import spacy
import math
import numpy as np
import pandas as pd
import torch
from torch.utils.data import Dataset, DataLoader
from torch.nn.utils.rnn import pad_sequence
from .misc import save... |
import bpy
import math
import mathutils
import struct
from . import common
from . import compat
from .translations.pgettext_functions import *
PROP_OPTS = {'LIBRARY_EDITABLE'}
# New specially handled commands need to have 3 things
# 1) An enum entry in COMMAND_ENUMS (if it is not already in there)
# 2) A class ... |
#!/usr/bin/env python3
#
# This file is part of LiteX.
#
# Copyright (c) 2019-2020 <NAME> <<EMAIL>>
# Copyright (c) 2020 Antmicro <www.antmicro.com>
# SPDX-License-Identifier: BSD-2-Clause
import sys
import json
import argparse
import os
def generate_dts(d, initrd_start=None, initrd_size=None, initrd=None, root_devi... |
import logging
import re
import time
from copy import deepcopy
from enum import Enum
from typing import List, Optional
from datetime import datetime
import threading
import traceback
import html
import json
import peewee
import telegram.error
from telegram import (
Update,
InlineKeyboardMarkup,
InlineKeybo... |
# Basic tools
import itertools
import numpy as np
import pandas as pd
# Scalers
from sklearn.preprocessing import StandardScaler
from sklearn.preprocessing import Normalizer
from sklearn.preprocessing import MinMaxScaler
from sklearn.preprocessing import Binarizer
# Feature selection tools
from sklearn.feature_select... |
# Copyright 2013 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.
"""Generates C++ source files from a mojom.Module."""
import datetime
import mojom
import mojom_generator
import mojom_pack
import os
import re
import sys
... |
#!/usr/bin/env python
from __future__ import (print_function, division, absolute_import)
import numpy as np
import matplotlib.pyplot as plt
from astropy.constants import G, M_sun
import astropy.units as u
from collections import OrderedDict
from parameters import Parameter, _parameter_names#, LimbDarkening
from conv... |
"""Test initialization of VoQ objects, switch, system ports, router interfaces, neighbors, inband port."""
import json
import logging
import pytest
from tests.common.helpers.assertions import pytest_assert
from tests.common.helpers.sonic_db import AsicDbCli, VoqDbCli
from voq_helpers import check_voq_remote_neighbor, ... |
import os
import io
import cv2
import sys
import time
import pickle
import getopt
import torch
import random
import numpy as np
import torch.utils.data as data
import xml.etree.ElementTree as ET
import torchvision.transforms as transforms
from cv2 import cv2
from visdom import Visdom
import matplotlib as mpl
mpl.use(... |
# -*- coding: utf-8 -*-
'''
saveLoadableOIM.py is an example of a plug-in that will save a re-loadable JSON or CSV instance.
(c) Copyright 2015 Mark V Systems Limited, All rights reserved.
'''
import sys, os, io, time, regex as re, json, csv, zipfile
from decimal import Decimal
from math import isinf, isnan
from coll... |
from __future__ import print_function, division
import sys
import logging
import re
import lldb
import weakref
if sys.version_info[0] == 2:
# python2-based LLDB accepts utf8-encoded ascii strings only.
def to_lldb_str(s): return s.encode('utf8', 'backslashreplace') if isinstance(s, unicode) else s
range = ... |
import logging
import datetime
import time
import traceback
import sys
import threading
from dataclasses import asdict, is_dataclass, fields, Field, dataclass
from typing import Any
from uuid import uuid4, UUID
from argus.db.config import BaseConfig
from argus.db.utils import is_list_homogeneous
from argus.db.cloud_ty... |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import os
import logging
import numpy as np
import time
import signal
import sys
from visdom import Visdom
import sys
# Packages need further configuration if imported... |
"""
.. _kernel_based_training:
.. role:: html(raw)
:format: html
Kernel-based training of quantum models with scikit-learn
=========================================================
.. meta::
:property=“og:description”: Train a quantum machine learning model based on the idea of quantum kernels.
:propert... |
import numpy as np
import os, subprocess, sys, datetime, signal, shutil
from lib._settings import manta_path, data_path
# dir_str = datetime.datetime.now().strftime("%m-%d-%H-%M-%S") # "05-30-22-00-00"
runcase = int(sys.argv[1])
print ("Testing test case %d" % runcase)
cudaid = os.environ["CUDA_VISIBLE_DEVICES"] if ... |
from __future__ import division, print_function, absolute_import
import numpy as np
import tensorflow.compat.v1 as tf
from tensorflow.python.framework import dtypes
from tensorflow.python.ops import standard_ops
import tflearn
from tflearn import utils
from tflearn import variables as va
from tflearn import activati... |
"""Base grammar, Ref, Anything and Nothing."""
import copy
from dataclasses import dataclass
from typing import List, Optional, Union, Type, Tuple, Any
from sqlfluff.core.errors import SQLParseError
from sqlfluff.core.string_helpers import curtail_string
from sqlfluff.core.parser.segments import BaseSegment, Bracket... |
# -*- coding: utf-8 -*-
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
from __future__ import with_statement
import abc
import sys
import pprint
import datetime
from python_utils import converters
import six
from .... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright 1999-2017 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-... |
""" Giant BEAST trying to match old CVR addresses to DAWA addresses"""
import re
import numpy as np
import itertools as it
import os
import requests
import Levenshtein as Le
from .alchemy_tables import AdresseDawa
from . import create_session
def make_adresse_dict():
"""make tree (dict) of dawa adresses of kommun... |
r"""
Module defining Pyclaw geometry objects.
"""
from __future__ import absolute_import
from __future__ import print_function
import numpy as np
import warnings
import six
from six.moves import range
from six.moves import zip
deprec_message = "'edges' has been deprecated; please use 'nodes' instead."
# =============... |
"""The compiler step turns an AST into a planned query.
This step has a number of responsibilities:
-Validate that the expression is well-typed.
-Resolve all select fields to their aliases and types.
"""
from __future__ import absolute_import
import collections
import itertools
from tinyquery import exceptions
from ... |
# myTeam.py
# ---------
# Licensing Information: You are free to use or extend these projects for
# educational purposes provided that (1) you do not distribute or publish
# solutions, (2) you retain this notice, and (3) you provide clear
# attribution to UC Berkeley, including a link to http://ai.berkeley.edu.
#
# A... |
"""
-------------------------------------------------------
Quick script to interpret and display telemetry information in console.
Includes functions for solar array data to be tested June 9, 2019 at track.
-------------------------------------------------------
Author: <NAME>
__updated__ = "2019-06-02"
-------------... |
#!/usr/bin/env python
# Copyright (c) Facebook, Inc. and its affiliates.
#
# 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... |
# Copyright (C) 2002, <NAME> (<EMAIL>)
# Copyright (C) 2017, <NAME> (<EMAIL>)
#
# This file is part of the Biopython distribution and governed by your
# choice of the "Biopython License Agreement" or the "BSD 3-Clause License".
# Please see the LICENSE file that should have been included as part of this
# package.
"""... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
""" Computes broadband power, offset and slope of power spectrum
Based on selected epochs (e.g. ASCIIS) in the list of files a power spectrum
is computed. Based on this power spectrum the broadband power is calculated,
followed by the offset and slope using the FOOOF algo... |
"""A scikit learn compatible wrapper for clustering a data set without
specifying the number of clusters to generate. Instead, the gap
statistic method is used to estimate the optimal number of clusters for
the data set."""
# Author: <NAME>
# License: BSD-3-Clause
import math
import numpy as np
from random import ra... |
#!/usr/bin/env python
# LICENSE
# Copyright (c) 2014, South African Astronomical Observatory (SAAO)
# All rights reserved. See License file for more details
"""
SALTMOSAIC is a task to apply the CCD geometric corrections to MEF style SALT
data.
Author Version Date
------------------------------... |
#
# Copyright (c) 2018 Nippon Telegraph and Telephone Corporation
# All rights reserved.
#
# This source code is licensed under the BSD-style license found in the
# LICENSE file in the root directory of this source tree.
import sys
import os
import clang.cindex
from clang.cindex import Index
from clang.cindex import ... |
""" automation scripts for building gt-coar-lab
Roughly, the intent is:
- on a contributor's machine
- [x] derive conda-lock files from yml files
- [x] derive constructor files from lock file
- [x] update CI configuration from constructs
- in CI, or a contributor's machine
- [x] validate well-formedness of the... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.