text stringlengths 8.04k 46.5k |
|---|
"""
Date of last edit: August 13th, 2018
Author(s): <NAME>* and <NAME>^
*Texas A&M University
*Thermal-hydraulics Research Group
^Virginia Commonwealth University
^Fluids in Advanced Systems and Technology (FAST) Research Group
TOolbox for Reactor Cross-Flow Heat Exchangers:
Python Scripts for calculation ... |
# ----------------------------------------------------------------------------
# Copyright (c) 2013--, scikit-bio development team.
#
# Distributed under the terms of the Modified BSD License.
#
# The full license is in the file COPYING.txt, distributed with this software.
# --------------------------------------------... |
# -*- coding: utf-8 -*-
"""
Project: Deep Jass
File: Dealer.py
Purpose: Assortment of functions required to train the Recurrent Neural Network to play against other Networks (Simulate a game)
Created on: 24.04.2019 11:02:27
Author: <NAME>; <NAME>
Copyright © 2019 <NAME>, <NAME>, <... |
#!/usr/bin/env python
"""
Module for all image processing tools
"""
from __future__ import division
import skimage.io
import skimage.transform
import skimage.util
import numpy as np
def img_as_dtype(image, dt):
"""
Convert an image to the target datatype.
Serves as a wrapper for skimage.img_as_ubyte and
... |
# SPDX-License-Identifier: MIT
# Copyright (c) 2018-2020 The Pybricks Authors
"""Images and Sounds for Pybricks on ev3dev."""
from ..parameters import Color
class Image:
"""Object representing a graphics image. This can either be an in-memory
copy of an image or the image displayed on a screen."""
# Do... |
import re
import os
import json
import logging
import subprocess
from io import BytesIO
from PIL import Image
from django.conf import settings
from django.db import models, transaction
from django.db.models import Count
from django.db.models.signals import pre_delete, post_delete
from django.core.files import File
from... |
from collections import OrderedDict
from math import pi
from typing import Iterable, List, Tuple
from itertools import chain
import numpy as np
from lmfit import Model
from numpy import bincount
from numpy import pi
from pandas import DataFrame, Series
from pyquil.operator_estimation import measure_observables
from sc... |
# Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
Models for doing PSF/PRF fitting photometry on image data.
"""
import warnings
import copy
import numpy as np
from astropy.modeling import models, Parameter, Fittable2DModel
from astropy.utils.exceptions import AstropyWarning
__all__ = ['NonNormali... |
import discord
import asyncio
import random
from json import load
from datetime import datetime
from discord.ext import commands, tasks
from bot.constants import Colour
from .src.database import DB
from .src.anti_abuse import AntiAbuse
from discord.ext import menus
class PictionaryTutorial(menus.Menu):
async ... |
"""
Tests for the Autoencoder.
"""
import logging
import pprint
from io import BytesIO
import pickle
import sys
from unittest import mock
import pytest
import numpy as np
import scipy.sparse as sp
import tensorflow as tf
from sklearn.preprocessing import MinMaxScaler, OneHotEncoder
from sklearn.datasets import load_i... |
import argparse
import torch
import os
import multiprocessing
import numpy as np
from vizdoom import ViZDoomErrorException, ViZDoomIsNotRunningException, ViZDoomUnexpectedExitException
from gym.spaces import Box, Discrete
from pathlib import Path
from collections import deque
from tensorboardX import SummaryWriter
from... |
import numpy as np
from numpy.linalg import norm
try:
import trimesh
MESH_MODE = True
except ImportError:
MESH_MODE = False
from scipy import optimize
from scipy.spatial import KDTree
from scipy.spatial.distance import cdist
from .survey import Survey, _interpolate_survey, slice_survey
from .utils import ... |
#!/usr/bin/env python3
""" Download data related to ALICE.
Based on code from <NAME> download train run-by-run output in parallel script.
.. codeauthor:: <NAME> <<EMAIL>>, ORNL
"""
import abc
import argparse
import itertools
import logging
import queue
import threading
import time
from dataclasses import dataclass,... |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import os
import numpy as np
import tensorflow as tf
import random
import argparse
import math
from colors import *
from tqdm import *
from handler import Batch, DatasetBase, DatasetTrain, DatasetEval, Datase... |
#
# Random Question Generator for Think Fast!
# Python 3.4
#
# 5 Dev 2017
# by Zero Sum Effect
#
from random import randrange
import time
#saveQuestions = False # Save questions to file or not
saveQuestions = True # Save questions to file or not
pathtoFile = "" # (depending on OS) eg C:\directory\savehe... |
#!/usr/bin/env python
"""This module has tests for the HiRISE HiCal functions."""
# Copyright 2020, <NAME> (<EMAIL>)
#
# 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... |
import wx
import wx.adv
import sys
import requests
from launcher.config import cfg
from launcher.logview import Logger, LogFrame
from launcher.procmgr import ProcessMgr, FujiNetMgr, NetSioMgr
import launcher.version as version
from typing import Union
def new_id():
return wx.NewIdRef()
# workaround for wxpyth... |
# Imports of existing libraries
import time
import threading
import numpy as np
from scipy import signal
import queue
import os
# Import for graphs
import pyqtgraph as pg
from PyQt5 import QtCore
# Imports of our own classes
import filter
# Imports from Acconeer for radar data acquisition
from acconeer_utils.client... |
# The Leginon software is Copyright 2004
# The Scripps Research Institute, La Jolla, CA
# For terms of the license agreement
# see http://ami.scripps.edu/software/leginon-license
#
import wx
import wx.lib.filebrowsebutton as filebrowse
import threading
import leginon.gui.wx.TargetPanel
import leginon.gui.wx.Settings
... |
# -*- coding: utf-8 -*-
"""
Created on Tue Sep 15 11:01:20 2020
@author: Ray
@email: <EMAIL>
@wechat: RayTing0305
"""
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
import math
import string
import scipy.stats as stats
'''
relax a little bit
test a quiz
'''
sdata = {'Ohi... |
# -*- coding:utf-8 -*-
from __future__ import unicode_literals
from future.builtins import str
from future.builtins import zip
from future.builtins import object
from itertools import islice, chain
from collections import namedtuple
from copy import copy, deepcopy
from limpyd.model import RedisModel
from limpyd.colle... |
import pandas as pd
from glob import glob
import numpy as np
import matplotlib.pyplot as plt
import scipy as sp
from tensorpack import *
import sys
import os
import tensorflow as tf
from tensorpack.utils.viz import stack_patches
import cv2
import tensorpack.utils.viz as viz
from tensorpack.tfutils import get_tf_versio... |
# -*- coding: utf-8 -*-
"""
Created on Mon Nov 13 11:11:13 2017
@author: Joni & Antti
"""
# %%
import pandas as pd
import numpy as np
import math
import scipy.integrate as integrate
import matplotlib
import matplotlib.pyplot as plt
import collections
from pylab import figure, show, legend, ylabel, xlabel... |
from __future__ import division
import array
import binascii
import itertools
import logging
import numpy as np
import os
import struct
import nifti_defines
import par_defines
import raw2nii_version
from NiiFile import NiiHdr, NiiHdrField, HEADER_FIELD_NAMES
__all__ = ['NiiHdr', 'NiiHdrField', 'write_nii_from_par']
... |
# Copyright (c) 2021 Graphcore Ltd. All rights reserved.
from collections import defaultdict
import inspect
import logging
import numpy as np
import tensorflow as tf
from tensorflow.python import ipu
from tensorflow.python.framework.tensor_spec import TensorSpec
from tensorflow.python.keras.engine.keras_tensor import ... |
import torch.nn as nn
import torch.nn.functional as F
import torch
from sklearn.manifold import TSNE
from sklearn.decomposition import PCA, KernelPCA, FastICA, FactorAnalysis, NMF, TruncatedSVD, LatentDirichletAllocation
import matplotlib
matplotlib.use("Agg")
import matplotlib.pyplot as plt
import seaborn as sns
sns.s... |
import os.path
from modules.windows_jumplist.consts import *
from modules.windows_jumplist.lib.yjSysUtils import *
from modules.windows_jumplist.lib.yjDateTime import *
def get_files(path, w='*'):
""" 지정 경로의 파일목록을 구한다. """
if os.path.isdir(path):
import glob
try:
path = IncludeTrai... |
import pandas as pd
import re
import math
import concurrent.futures
import time
import gc
import os
import logging
from operator import itemgetter
from collections import namedtuple
from datetime import datetime
from multiprocessing import cpu_count
from azureml.logging import get_azureml_logger
from .configs import *... |
import sys
from hask3.hack import objectify, settle_magic_methods
from hask3.lang.type_system import PatternMatchBind
from hask3.lang.type_system import PatternMatchListBind
from hask3.lang.type_system import Undefined
from hask3.lang.type_system import PyFunc as func # noqa
# Main
# TODO: Try to use a metaclass... |
import argparse
import ConfigParser
import copy
import ntpath
import numpy as np
import time
import sys, os, re
from context import diana
import diana.classes.drug as diana_drug
import diana.classes.comparison as comparison
import diana.classes.network_analysis as network_analysis
def main():
options = parse_... |
from __future__ import print_function
import sys, json, re
sys.dont_write_bytecode = True
from libraries import cli_lib
from libraries.generic import switchportCmp, typeCmp, printDict, switchportCsv, getDict, printClass, parseHports, toJSONStr, printNode, printInterface, eprint, printJSON, getJSON
# Classes for ACI ob... |
"""
utils.py: Provides common functions used by all workflow programs
"""
from __future__ import print_function
##
# Copyright 2007-2011 University Of Southern California
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may... |
"""
Helper methods for decoding RXM-SFRBX navigation data.
Created on 01 Nov 2021
:author: semuadmin
:copyright: SEMU Consulting © 2020
:license: BSD 3-Clause
"""
# pylint: disable=invalid-name
GPS = 0
SBAS = 1
GALILEO = 2
BEIDOU = 3
IMES = 4
QZSS = 5
GLONASS = 6
# bitshift flags for clarity
B1 = 0b1
B2 = 0b11
B3 =... |
#!/usr/bin/python
"""
Introduction
============
Test suite for mySQLSchema module from the gerald framework
Note that this suite uses the py.test module
(http://codespeak.net/py/current/doc/test.html)
Approach
========
We want to test two different aspects of the mySQLSchema module;
- Reading a schema fr... |
# -*- coding: utf-8 -*-
"""
welltestpy subpackage providing plotting routines.
.. currentmodule:: welltestpy.tools.plotter
The following classes and functions are provided
.. autosummary::
Editor
CampaignPlot
fadeline
plotres
WellPlot
plotfit_transient
plotfitting3D
plotfitting3Dtheis
plot... |
# Copyright 2020, The TensorFlow 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 t... |
import csv
import gc
import os
import time
from datetime import datetime
# import psutil
from scipy import ndimage
import numpy as np
import tensorflow as tf
from tentacle.config import cfg
from tentacle.board import Board
from tentacle.data_set import DataSet
from tentacle.utils import ReplayMemory
class RingBuffer(... |
# Written by Dr <NAME>, Marda Science LLC
# for the USGS Coastal Change Hazards Program
#
# MIT License
#
# Copyright (c) 2020-2021, Marda Science LLC
#
# 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... |
import mysql.connector
import json
import numpy as np
import time
file_zonas = "data_zonas.json"
file_totales = "data_totales.json"
file_edades = "data_provincias_edades.json"
TAG_COVIDPOSITIVO = "totales"
TAG_TESTS = "test"
mydb = mysql.connector.connect(
host="localhost",
user="root",
password="<PASSWOR... |
#! /usr/bin/env python
# -*- coding: utf-8 -*-
# vim:fenc=utf-8
"""
This module contains functions for printing elements.
"""
from __future__ import annotations
from meerschaum.utils.typing import SuccessTuple, Union, Sequence, Any, Optional, List
def show(
action : Optional[List[str]] = None,
**kw :... |
"""Generate language using XLNet"""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import argparse
import numpy as np
import os
import re
from tqdm import tqdm
import absl.logging as _logging # pylint: disable=unused-import
import tensorflow as tf
import ... |
import binascii
from collections import Iterable
from enum import Enum
import numpy as np
import pyons
from pyons import Entity
from pyons.models.rfid import phy, vectors, protocol as gen2, journal, pyradise
INIT_TAG_STAGE = (2, "Init tag")
INIT_MOBILITY_MANAGER = (3, "Init mobility manager")
FINISH_TAG_STAGE = (7,... |
# --coding: utf-8 --
import pyqtgraph.parametertree.parameterTypes as pTypes
from pyqtgraph.parametertree import Parameter, ParameterTree, ParameterItem, registerParameterType
from PySide import QtCore, QtGui
import pyqtgraph as pg
import spacegrp_peaks
import numpy as np
from xicam import config
import msg
# TODO: Ad... |
#!/usr/bin/env python
##Copyright 2008-2017 <NAME> (<EMAIL>)
##
##This file is part of pythonOCC.
##
##pythonOCC is free software: you can redistribute it and/or modify
##it under the terms of the GNU Lesser General Public License as published by
##the Free Software Foundation, either version 3 of the License, or
##(a... |
#!/usr/bin/python3
# Author: ravexina (<NAME>)
# https://github.com/ravexina
# Repo on github
# https://github.com/ravexina/csp-sudoku-solver
# ----------------------------------------------------------------------------
# MIT License
# Copyright (c) 2017 ravexina (<NAME>)
# Permission is hereby granted, free o... |
# (*) Burocracia
def nome():
return ...
def dre():
return ...
def meu_arquivo():
ls = ["p2", str(dre()), str(nome())] # meus dados
s1 = str.join(" ", ls) # coloque um espaço entre eles
s2 = str.replace(s1, " ", "_")
print(s2 + ".py")
# Obrigado!
# (*) Questão 1
#
# Você vai escrever três procedimentos... |
import requests
import json
from destiny_focus.manifest_tools.manifest_functions import get_definition
def get_character_details_json(GetProfile_res):
"""
Parse the GetProfile response to get Character information.
"""
character_details = {}
temp_dict = {}
charId_list = []
# print(GetProfi... |
import pandas as pd
import numpy as np
import plotly.offline as py
import plotly.graph_objects as go
import scipy as sp
import copy
import shap
from statistics import mode
from sklearn.ensemble import RandomForestClassifier
from sklearn.preprocessing import LabelEncoder
from ipywidgets import interact, fixed, Dropdown... |
import numpy as np
from collections import namedtuple
from snap.math import *
from snap import viewer, gl, tool
# TODO: Body/Joints/Constraints should fill the graph directly
# TODO joint nullspace (subclass)
class Body(object):
def __hash__(self):
return id(self)
def __str__(self):
re... |
import numpy as np
import scipy as sp
import matplotlib as mpl
import warnings
import os
from ..boundary import Boundary
from ...point_set import PointSet
from ...misc.mkl_sparse import SpMV_viaMKL
from ...kernels.high_level.laplace import Laplace_Layer_Form
from ...kernels.high_level.stokes import Stokes_Layer_Form
... |
import tensorflow as tf
import numpy as np
from math import ceil
from copy import deepcopy
from tensorflow.examples.tutorials.mnist import input_data
import random
import matplotlib.pyplot as plt
def permute_mnist(mnist, per_task):
perm_inds = list(range(mnist.train.images.shape[1]))
random.seed(pe... |
from pybulletgym.envs.mujoco.robots.locomotors.walker_base import WalkerBase
from pybulletgym.envs.mujoco.robots.robot_bases import XmlBasedRobot
import pybullet
import numpy as np
import os, inspect
import gym, gym.spaces, gym.utils, gym.utils.seeding
from pybullet_envs.bullet import bullet_client
from pkg_resources ... |
"""Unit tests for pyatv.core.facade."""
from abc import ABC
import asyncio
import inspect
from ipaddress import IPv4Address
import logging
import math
from typing import Any, Dict, Set
from unittest.mock import MagicMock
import pytest
from pyatv import exceptions
from pyatv.conf import AppleTV as AppleTVConf
from pya... |
from .record_field import *
from .record_event import RecordEventHandler
import pa
from sqlalchemy.orm.attributes import InstrumentedAttribute
from .i18n import *
from sqlalchemy import exc
from .model_decorator import ExtraColumn
from redis_client import RedisClient
import time
import json
import re
import random
impo... |
from __future__ import print_function
from __future__ import absolute_import, division
import warnings
from collections import OrderedDict as odict
import string
import copy
import numpy as np
from future.utils import string_types
from dimarray.compat.pycompat import zip
from dimarray.tools import is_DimArray, is_array... |
"""
Helpers module. This module can be safely imported from any fobi (sub)module,
since it never imports from any of the fobi (sub)modules (except for the
`fobi.constants` and `fobi.exceptions` modules).
"""
import glob
import logging
import os
import shutil
import uuid
from autoslug.settings import slugify
from djan... |
import os
import json
import time
from urllib import parse
import aiohttp
from typing import Dict
from bot import alemiBot
import wikipediaapi
import italian_dictionary
import cryptocompare
from PyDictionary import PyDictionary
from udpy import UrbanClient
from google_currency import convert
from unit_converter.conv... |
#!/usr/bin/env python3
# coding: utf-8
#
# $Id: main.py 1571.v0.2-dev.1 $
# SPDX-License-Identifier: BSD-2-Clause
"""
même GUI que tk_mockup02, mais avec PySimpleGUI
python3 >= 3.7
"""
import PySimpleGUI as sg
import constants
import core
import sgui
from itertools import groupby
from pprint import pprint
# Globa... |
#!/usr/bin/env python
"""
@package mi.dataset.parser.presf_abc_dcl
@file marine-integrations/mi/dataset/parser/presf_abc_dcl.py
@author <NAME>
@brief Parser for the presf_abc_dcl dataset driver
This file contains code for the presf_abc_dcl parsers and code to produce data particles.
For telemetered data, there is one... |
from __future__ import print_function
from sklearn import linear_model
import numpy; import numpy as np
import kagglib
import statsmodels.api as sm
# import pandas as pd, numpy as np, seaborn as sns
# import pandas, numpy, sys
# from time import time
# from sklearn.model_selection import cross_val_score
# import matpl... |
import pastaq
import json
import os
import matplotlib
# NOTE: Using the default backend create problems when multithreaded with wxWidgets.
matplotlib.use('Agg')
import matplotlib.pyplot as plt
import pandas as pd
import numpy as np
from scipy.optimize import curve_fit
import wx
import threading
import sys
# Set the fo... |
import numpy as np
import sys
import random
import itertools
import networkx as nx
import copy
from collections import namedtuple
from collections import defaultdict
import math
import time
from numpy import linalg as LA
import config
from utils import visualizer
from utils import comb_subset
from mat_complete im... |
import os, sys, threading, json, shutil, base64, requests, io, traceback, html, shlex
from flask import Flask, request, Response
from flask_cors import CORS
app = Flask(__name__)
CORS(app)
from threading import Thread
from subprocess import *
from time import time
import subprocess
import logging
\
debug = "--debu... |
# Copyright 2021, ETH Zurich, Media Technology Center
#
# 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 b... |
#!/usr/bin/env python3
import os
import sys
import subprocess
import csv
import xml.etree.ElementTree as ET
import json
import time
import re
import argparse
from argparse import ArgumentParser
##########################################################
# Configuration
failure_msgs_ON_HLS_WARNING = True
###########... |
"""Linked List
=== CSC148 Winter 2018 ===
University of Toronto,
Computer Science
__author__ = '<NAME>'
=== Module Description ===
This module contains code for a linked list implementation with two classes,
LinkedList and _Node. This code was made by combining professor <NAME>'s
implementation with professor <NAME>'... |
import functools
import random
import pygame
from pyswip import Prolog
from NonPrologBridge import *
from pygame.locals import *
cards_old = {
}
cards_now = {
}
class Dom:
fields = []
cords = []
def move(self, x, y):
for field in self.fields:
field.move(x, y)
def draw(self)... |
import warnings
import numpy as np
import math
from ..constants import *
from ..mobject.mobject import Mobject
from ..mobject.types.vectorized_mobject import VGroup
from ..mobject.types.vectorized_mobject import VMobject
from ..mobject.types.vectorized_mobject import DashedVMobject
from ..utils.config_ops import diges... |
"""
linespacer_ydirection.py
<NAME>, <NAME>, <NAME>
Finds the optimal paths between gates based on distance in y-direction.
Deletes wires that are out of range.
"""
from mpl_toolkits import mplot3d
import numpy as np
import matplotlib.pyplot as plt
import sys
sys.path.append("../code")
from classes import classes as ... |
from __future__ import division
import math
import numba
from numba import cuda, float32
import numpy as np
import time
@cuda.jit('float32(float32,float32,float32,float32,float32,float32)', device=True)
def calculate_distance(p1_0, p1_1, p1_2, p2_0, p2_1, p2_2):
return math.sqrt((p1_0 - p2_0) ** 2 + (p1_1 - p2_1)... |
# 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... |
#!/usr/bin/env python3
"""Mininet test runner
* must be run as root
* you can run a specific test case only, by adding the class name of the test
case to the command. Eg ./mininet_test.py FaucetUntaggedIPv4RouteTest
It is strongly recommended to run these tests via Docker, to ensure you have
all dependencies co... |
import itertools
import numpy as np
from arqtic.program import Program, Gate
from arqtic.exceptions import Error
import scipy
from sklearn.linear_model import Lasso, LinearRegression
import qiskit as qk
from qiskit.aqua.operators.primitive_ops import MatrixOp
from qiskit import Aer, execute
import scipy.linalg as la
#... |
#!/usr/bin/env python
u"""
esa_cryosat_sync.py
Written by <NAME> (05/2021)
This program syncs Cryosat Elevation products
From the ESA CryoSat-2 Science Server:
https://earth.esa.int/web/guest/-/how-to-access-cryosat-data-6842
https://earth.esa.int/web/guest/-/products-overview-6975
INPUTS:
CryoSat-2 product to sy... |
import inspect
import logging
import os
import threading
import errno
import shutil
from typing import Callable, Dict, List
from docker import DockerClient
from docker.errors import NotFound
from selenium import webdriver
from selenium.webdriver.chrome.options import Options
from selenium.webdriver.common.desired_capa... |
# Copyright 2019 Uber Technologies, 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 applica... |
#!/usr/bin/env python3
#
# Copyright (c) 2012-2020 MIRACL UK Ltd.
#
# This file is part of MIRACL Core
# (see https://github.com/miracl/core).
#
# 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... |
import os
import numpy as np
import cv2
import transformations
import scipy.io as sio
import glob
def make_vid_info_list(data_dir):
# return [loadedmat, bbox, joints(size of (14, 2, vid_len), vid_name)
vids = glob.glob(data_dir + '/frames/*')
n_vids = len(vids)
vid_info = []
for i in range(n_vid... |
import importlib
import logging
import logging.config
import uuid
import os
import tempfile
import time
import cloudpickle
import json
import skein
import tensorflow as tf
from typing import (
Dict,
Optional,
Tuple,
NamedTuple,
Callable,
Union,
List
)
from contextli... |
"""
Piezo sensitivity analysis module.
"""
import warnings
import numpy as np
from monty.dev import requires
import pymatgen.io.phonopy
from pymatgen.core.tensors import Tensor
from pymatgen.symmetry.analyzer import SpacegroupAnalyzer as sga
try:
from phonopy import Phonopy
from phonopy.harmonic import dynm... |
'''
Class for a bipartite network in long form
'''
import numpy as np
import pandas as pd
import bipartitepandas as bpd
import warnings
# Define default parameter dictionary
_es_extended_plot_params_default = bpd.ParamsDict({
'title_height': (1.0, 'type', float,
'''
(default=1.0) Location of ti... |
"""
Testing for the tree module (sklearn.tree).
"""
import pickle
import numpy as np
from itertools import product
from sklearn.metrics import accuracy_score
from sklearn.metrics import mean_squared_error
from sklearn.utils.testing import assert_array_equal
from sklearn.utils.testing import assert_array_almost_equal... |
# 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 use ... |
"""Cardano Python Library."""
import functools
import json
import subprocess
import os
from copy import copy
from pathlib import Path
from time import sleep
from contextlib import contextmanager
@contextmanager
def cd(path):
if not os.path.exists(path):
os.mkdir(path, 0o700)
old_dir = os.getcwd()
o... |
# Copyright The PyTorch Lightning team.
#
# 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 i... |
from distutils.version import StrictVersion
from functools import lru_cache
from functools import partial
import itertools
import json
import os
import time
import logging
import boto3
from botocore.config import Config
import botocore
from ray.ray_constants import BOTO_MAX_RETRIES
from ray.autoscaler.tags import NOD... |
# Modified from flops-counter.pytorch by <NAME>
# original repo: https://github.com/sovrasov/flops-counter.pytorch
# MIT License
# Copyright (c) 2018 <NAME>
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
#... |
import random
import copy
import time
import numpy as np
import cycle_dating.Algos.optim_virtual as ov
from cycle_dating.Utilities import use_data as ud, series
from cycle_dating.Algos import sga as nlg
from cycle_dating.Algos.Utilities.gen_types import LinearScale
class DomainError(Exception):
def __str__(self)... |
"""
Collection of query wrappers / abstractions to both facilitate data
retrieval and to reduce dependency on DB-specific API.
"""
from __future__ import print_function, division
from datetime import datetime, date, timedelta
import warnings
import itertools
import numpy as np
import pandas.core.common as com
from pa... |
#!/usr/bin/env python
'''
Name: launch_visar_gui.py
License: MIT
Version: 2.0
Last modified: 30 Jan. 2019 (SBB)
Authors: <NAME> (<EMAIL>)
<NAME> (<EMAIL>)
<NAME> (<EMAIL>)
Description: Runs VISAR analysis on local machine and data
'... |
import numpy as np
import warnings
from scipy import stats
# include OptimizeResult class for machines on which scipy version is too old
try:
from scipy.optimize import OptimizeResult
except:
class OptimizeResult(dict):
""" Represents the optimization result.
Parameters
----------
... |
# Copyright (c) Facebook, Inc. and its affiliates.
import io
import itertools
import unittest
import warnings
from collections import defaultdict
from typing import Dict
import expecttest
import torch.utils.data.datapipes.iter
import torchdata
from _utils._common_utils_for_test import IDP_NoLen, reset_after_n_next_... |
#!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright (c) 2015, <NAME> <<EMAIL>>
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
DOCUMENTATION = '''
---
module: cs_template
short_descr... |
"""
**Get New Pricing Data Task**
This will fetch data (pricing, financials, earnings, dividends, options,
and more) from these sources:
#. IEX
#. Tradier
#. Yahoo - disabled as of 2019/01/03
**Detailed example for getting new pricing data**
.. code-block:: python
import datetime
import build_get_new_... |
"""NginxParser is a member object of the NginxConfigurator class."""
import copy
import functools
import glob
import io
import logging
import re
import pyparsing
from acme.magic_typing import Dict
from acme.magic_typing import List
from acme.magic_typing import Optional
from acme.magic_typing import Set
from acme.mag... |
# -*- coding: utf-8 -*-
# Copyright 2011 webapp2 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
# -*- coding: utf-8 -*-
# Copyright 2014, Mingze
# Author: Mingze (<EMAIL>)
class cmd:
ATT_ErrorRsp = 'ATT_ErrorRsp',
ATT_ExchangeMTUReq = 'ATT_ExchangeMTUReq',
ATT_ExchangeMTURsp = 'ATT_ExchangeMTURsp',
ATT_FindInfoReq = ... |
from __future__ import absolute_import, unicode_literals
from functools import total_ordering
import logging
import re
from decimal import Decimal
from django.conf import settings
from django.core.exceptions import ValidationError
from django.db import models
from django.db.models import F, ObjectDoesNotExist, Sum
fro... |
import pandas as pd
import numpy as np
from numpy.linalg import norm # para normalizar datos
from tqdm.notebook import tqdm
from sklearn.preprocessing import Normalizer
from sklearn.metrics import pairwise_distances
from sklearn.metrics.pairwise import cosine_similarity
from sklearn.metrics import silhouette_score
fro... |
# Copyright 2014 Open Source Robotics Foundation, 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... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.