text
stringlengths
8.04k
46.5k
import torch from torch import nn import os from torch.nn.functional import softmax, log_softmax from .utils import move_to_device, generate_mask, infer_model_type from .utils import infer_logits, infer_loss from ..configurations import TransformerPruningConfig, GeneralConfig from ..model_map import MODEL_MAP import...
#!/usr/bin/env python # -*- coding: UTF-8 -*- """Greeter. Usage: commands.py random commands.py control commands.py -h | --help Options: -h --help Show this screen. """ import numpy as np from config import random_seed rng = np.random.RandomState(random_seed) import scipy.misc import math # import cv2 # ...
import sys import os import numpy as np import pandas as pd import matplotlib.pyplot as plt from icecream import ( ic, install ) install() ic.configureOutput(outputFunction=print) sys.path.append('.') from vi_dem.particles import ( Particles, NList, ) from vi_dem.variational_int import ( time_step...
# Copyright (c) 2017, Vienna University of Technology (TU Wien), Department # of Geodesy and Geoinformation (GEO). # All rights reserved. # # All information contained herein is, and remains the property of Vienna # University of Technology (TU Wien), Department of Geodesy and Geoinformation # (GEO). The intellectual a...
from tkinter import ttk import tkinter as tk import tkinter.filedialog, tkinter.messagebox from eosim import config from orbitpy import preprocess, orbitpropcov, communications, obsdatametrics, util import instrupy import pandas as pd import numpy as np from matplotlib.backends.backend_tkagg import ( FigureCanvas...
import bpy import bmesh from mathutils import Matrix, Vector from bpy_extras.view3d_utils import region_2d_to_vector_3d, region_2d_to_origin_3d, location_3d_to_region_2d from math import radians, sqrt def pie_pos_offset(xy, v): scl = bpy.context.preferences.view.ui_scale if v == "N": return xy[0], xy[...
# Data models for peyecoder from PySide2.QtCore import QRect, Qt from sortedcontainers import SortedDict, SortedList from functools import total_ordering from collections import Counter from itertools import groupby, accumulate from operator import attrgetter from timecode import Timecode import csv from peyecoder....
#!/usr/bin/python3 import os import sys import requests import json sys.path.append(os.path.dirname(os.path.abspath(os.path.dirname(__file__)))) from glogger import Logger from collections import OrderedDict from pprint import pprint json_dto=OrderedDict() logger=Logger() def network_main(): _vars_file=open("../a...
#!/usr/bin/python from binascii import unhexlify from binascii import hexlify import serial from datetime import datetime import time # Controller (Master) MasterHardId = 1 MasterSoftId = 1 # PCWU (Slave) SlaveHardId = 2 SlaveSoftId = 2 # Should be set to True when sending messages IsSendMode = False # Can be twea...
# coding: utf-8 # /*########################################################################## # # Copyright (c) 2017 European Synchrotron Radiation Facility # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal #...
#!/usr/bin/env python # -*- coding: utf-8 -*- # Copyright (C) 2017, AGB & GC # Full license can be found in License.md #----------------------------------------------------------------------------- """Hold, manipulate, and load the open-closed field line boundary data Functions ----------------------------------------...
"""Component to interface with various media players.""" import asyncio import base64 import collections from datetime import timedelta import functools as ft import hashlib import logging from random import SystemRandom from typing import Optional from urllib.parse import urlparse from aiohttp import web from aiohttp...
import aiotfm from proxy_connector import Connection import random import os import time import sys import traceback import asyncio import re import zlib import aiohttp import json class env: proxy_token = os.getenv("PROXY_TOKEN") proxy_ip = os.getenv("PROXY_IP") proxy_port = os.getenv("PROXY_PORT") password = o...
import cv2 import math import time import numpy as np from . import util from .config_reader import config_reader from scipy.ndimage.filters import gaussian_filter from tensorflow.keras.models import load_model import tensorflow as tf import code import copy import scipy.ndimage as sn from PIL import Image from tqdm im...
# encoding: utf-8 import datetime import nose import pytz import tzlocal from babel import Locale from six import text_type from ckan.common import config import ckan.lib.helpers as h import ckan.plugins as p import ckan.exceptions from ckan.tests import helpers import ckan.lib.base as base ok_ = nose.tools.ok_ eq_...
# -*- coding: utf-8 -*- from mathics.version import __version__ # noqa used in loading to check consistency. import itertools from typing import Optional, Union import sympy from mathics.builtin.base import ( BinaryOperator, Builtin, SympyFunction, ) from mathics.builtin.constants import mp_conve...
# -*- coding: utf-8 -*- import datetime from blist import sortedlist from elasticsearch.client import Elasticsearch from util import dt_to_ts from util import EAException from util import elastalert_logger from util import format_index from util import hashable from util import lookup_es_key from util import pretty_ts...
# -*- coding: utf-8 -*- """ Created on Sun Aug 11 22:30:06 2019. @author: tageldim """ import copy from io import BytesIO from PIL import Image, ImageDraw from shapely.geometry.polygon import Polygon import numpy as np from pandas import DataFrame import warnings Image.MAX_IMAGE_PIXELS = None # %%==================...
# test_remote.py # Copyright (C) 2008, 2009 <NAME> (<EMAIL>) and contributors # # This module is part of GitPython and is released under # the BSD License: http://www.opensource.org/licenses/bsd-license.php import random import tempfile from unittest import skipIf from git import ( RemoteProgress, FetchInfo, ...
''' Runs random passes and options on random inputs, using wasm-opt. Can be configured to run just wasm-opt itself (using --fuzz-exec) or also run VMs on it. For afl-fuzz integration, you probably don't want this, and can use something like BINARYEN_CORES=1 BINARYEN_PASS_DEBUG=1 afl-fuzz -i afl-testcases/ -o afl-fin...
import sys import math, random import numpy as np import pandas as pd import matplotlib.pyplot as plt import matplotlib.patches as patches from matplotlib.lines import Line2D from matplotlib.collections import PatchCollection ''' File info: Name - [factory_traffic_dataset] Author - [Ze] Date - [Se...
""" Create by: apenasrr Source: https://github.com/apenasrr/timestamp_link_maker Create automatic descriptions with a several timestamp link, of a video composed by the joining of several small videos The required spreadsheet is automatically generated by the app mass_videojoin: https://github...
import torch import torch.nn as nn import torch.optim as optim import torchtext from torchtext.legacy.datasets import TranslationDataset from torchtext.legacy.data import Field, BucketIterator from torchtext.data.metrics import bleu_score import matplotlib.pyplot as plt import matplotlib.ticker as ticker import japan...
# Copyright (c) 2018, ETH Zurich and UNC Chapel Hill. # 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 # notice, this ...
# Copyright (c) 2015-2022 Vector 35 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 the # rights to use, copy, modify, merge, publish, ...
#!/usr/bin/env python # -*- coding: utf-8 -*- # --------------------------------------------------------------------------------------------- # Copyright (c) 2017-2018, <NAME> (<EMAIL>) # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following condi...
import warnings warnings.filterwarnings( 'ignore', message='Matplotlib is building the font cache using fc-list. This may take a moment.') warnings.filterwarnings( 'ignore', message='The installed version of numexpr 2.4.4 is not supported in pandas and will be not be used') import matplotlib matplotlib.use('T...
import json import logging import os import string import time import traceback from io import BytesIO from pathlib import Path from typing import List, Dict, Optional from urllib.parse import urljoin, quote_plus import certifi import pycurl from resttest3.binding import Context from resttest3.constants import ( ...
import os import re class Parser(object): syntax = 2 # Tokens ordered roughly by priority tokens = [ ('COMMENT_OL', r'\/\/.*?\n'), ('COMMENT_ML', r'\/\*(?:.|[\r\n])*?\*\/'), ('OPTION', r'option\s+((?:.|[\n\r])*?);'), ('IMPORT', r'import\s+"(.+?).proto"\s*;'), ('ME...
#!/usr/bin/env python # coding=utf-8 # Copyright 2021 The HuggingFace Inc. team. 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/LI...
# coding: utf-8 from sqlalchemy import BigInteger, Column, Date, DateTime, Float, ForeignKey, Index, Integer, LargeBinary, Numeric, \ String, Table, Text, text from sqlalchemy import UniqueConstraint, PrimaryKeyConstraint from sqlalchemy.dialects.mysql.types import BIT from sqlalchemy import PrimaryKeyConstraint fr...
import numpy as np from PIL import Image import matplotlib.pyplot as plt import toolz from toolz.curried import reduce from toolz.curried import concatv, concat from scipy.linalg import block_diag, tri, tril, triu from matplotlib import cm from numpy import flip from numpy import log from scipy.signal import convolve2...
############################################################################### # # The MIT License (MIT) # # Copyright (c) Crossbar.io Technologies GmbH # # 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 ...
# Contains routines for labels creation, features extraction and normalization # import os import numpy as np import scipy.io.wavfile as wav from sklearn import preprocessing from sklearn.externals import joblib from IPython import embed import matplotlib.pyplot as plot import librosa plot.switch_backend('agg') impo...
""" Finitely Presented Groups Finitely presented groups are constructed as quotients of :mod:`~sage.groups.free_group`:: sage: F.<a,b,c> = FreeGroup() sage: G = F / [a^2, b^2, c^2, a*b*c*a*b*c] sage: G Finitely presented group < a, b, c | a^2, b^2, c^2, (a*b*c)^2 > One can create their elements by mu...
from __future__ import annotations from typing import Optional, Dict, List, Any, Union, Sequence, Mapping from string import Formatter from enum import Enum from pathlib import Path from pydantic import ( # type: ignore BaseModel, Field, AnyUrl, EmailStr, validator, root_validator ) from .t...
""" Copyright (c) 2020 <NAME> Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublic...
# Bakalarska praca # Detektor slabin v pocitacovych sietiach # Autor: <NAME> # Copyrigth # FIT VUT 2018 # potrebne importy import sys import os import re import ipaddress import yaml # sudo pip install pyyaml, pip3, from itertools import product import xml.etree.ElementTree import ply.lex as lex import ply.yacc as ya...
# -*- coding:UTF-8 -*- # 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 # # ...
# ml4s.py # useful scripts and utilities for our course import numpy as np import matplotlib.pyplot as plt import matplotlib.patheffects as path_effects from mpl_toolkits.mplot3d import Axes3D from mpl_toolkits.mplot3d import proj3d from matplotlib.colors import LogNorm from matplotlib.patches import FancyArrowPatch f...
#!/usr/bin/env python ''' Returns Land/Water percentages for input geojson polygons. ''' from __future__ import print_function from __future__ import division from builtins import range from builtins import object from past.utils import old_div import os import json import pyproj from functools import partial from s...
from __future__ import unicode_literals import copy import warnings from modelcluster.forms import ClusterForm, ClusterFormMetaclass from django.db import models from django.template.loader import render_to_string from django.utils.safestring import mark_safe from django.utils.six import text_type from django import...
# Copyright 2016 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 agre...
# coding=utf-8 from django.contrib.auth.models import AbstractBaseUser, UserManager from django.db import models from django.contrib.auth.models import Permission from django.contrib.contenttypes.models import ContentType from django.conf import settings from django.contrib.auth.signals import user_logged_in from audit...
import json import os import weakref from collections import defaultdict from contextlib import contextmanager from functools import partial from typing import Any from typing import Callable from typing import DefaultDict from typing import List from oop_ext.foundation.callback import Callback from PyQt5.QtCore impor...
# Copyright 2019-2020 Not Just A Toy Corp. # # 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...
""" pyptlist.main ~~~~~~~~~~~~~~~ :copyright: (c) 2017 by <NAME> :license: MIT """ from pyautocad import Autocad,APoint,distance,aDouble import array from math import * import sys import numpy as np from pyptlist.vector import * def MoveDupAPoint(ptl): """ 将APoint组成的列表去重,且保持顺序 """ ...
from __future__ import division import gc import logging import os import shutil import time from builtins import zip from collections import defaultdict from datetime import datetime import cloudpickle import numpy as np import pandas as pd from .pandas_backend import PandasBackend from .utils import ( bin_cuto...
# ================================================================================== # Copyright (c) 2020 Nokia # Copyright (c) 2020 AT&T Intellectual Property. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You ...
# coding:utf-8 # # The MIT License (MIT) # # Copyright (c) 2016-2018 yutiansut/QUANTAXIS # # 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 th...
import datetime from datetime import timedelta from html import escape from unittest import mock from urllib.parse import quote, quote_plus import pytest from django.template import Context, Template from django.urls import reverse from core.models import CuratedListPage, DetailPage, LessonPlaceholderPage, TopicPage ...
# -*- coding: utf-8 -*- # License: GPL v.3 https://www.gnu.org/copyleft/gpl.html """ Guifibaix Mediateca plugin """ # Python 2 compatibility, remove when unneeded from __future__ import unicode_literals from future import standard_library standard_library.install_aliases() import sys import os from urllib.parse imp...
""" Package Requirements: - selenium - openpyxl - scipy - numpy - matplotlib - docx - python-docx Documentation: - EDIT: change to your own absolute directory """ import os import re from io import BytesIO from selenium import webdriver from selenium.common.exceptions import NoSuchEle...
from __future__ import division, print_function import subprocess import numpy as np import os, sys from os.path import dirname, realpath, join from PIL import Image from numpy import uint8, float32 #import threading #__hesaff_lock = threading.Lock() def reload_module(): import imp import sys imp.reload(sy...
# -*- coding: utf-8 -*- import pytest import pandas as pd from numpy import nan, float64 from jqfactor_analyzer.prepare import get_clean_factor_and_forward_returns from jqfactor_analyzer.performance import ( factor_information_coefficient, factor_autocorrelation, mean_information_coefficient, quantil...
""" Code from Modeling and Simulation in Python. Copyright 2020 <NAME> MIT License: https://opensource.org/licenses/MIT """ import logging logger = logging.getLogger(name="modsim.py") # make sure we have Python 3.6 or better import sys if sys.version_info < (3, 6): logger.warning("modsim.py depends on Python ...
import pandas as pd from ingestion.standardized_columns import (HISPANIC_COL, RACE_COL, STATE_FIPS_COL, COUNTY_FIPS_COL, STATE_NAME_COL, COUNTY_NAME_COL, POPULATION_COL, AGE_COL, SEX_COL,...
import gc import re import os import pandas as pd import numpy as np import random from unidecode import unidecode from sklearn.preprocessing import StandardScaler from sklearn import metrics import string import re import math import operator import time from keras.models import Model, Sequential from keras import lay...
# !/usr/bin/env python # coding=utf-8 # @Time : 2019-07-02 21:14 # @Author : <EMAIL> # @File : metrics_utils.py from __future__ import absolute_import from __future__ import division from __future__ import print_function __all__ = [ "ConfusionMatrix", "NEREvaluator" ] import logging from collections i...
import os import logging import math import numpy as np import cv2 class LaneFinder: def __init__(self, image_size=(720, 1280), chessboard_image_dir='chessboard_images', absolute_sobel_x=(7, 15, 100), absolute_sobel_y=(7, 15, 100), ...
from T2GEORES import geometry as geometry from T2GEORES import formats as formats from T2GEORES import t2geores_functions as t2funcs import matplotlib.pyplot as plt import numpy as np import pandas as pd from datetime import datetime, timedelta import matplotlib.dates as mdates import sys import matplotlib.gridspec as ...
#!/usr/bin/python # -*- coding: utf-8 -*- # # This file implements a converter that converts TiGerXML trees to dependencies. # Note that the TiGer conversion only works with version 2.1 of the TiGer corpus, release August 2007. # # author: <NAME> # 19/12/2012 # import itertools import codecs import psnode import sys ...
# Copyright 2017 Red Hat, 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...
# Copyright 2018 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, ...
import pandas as pd import numpy as np import math import string import copy from collections import Counter from tqdm import tqdm import warnings import os warnings.filterwarnings("ignore") data = pd.read_csv('../comments.csv') data = data[['comment', 'label']] data.drop_duplicates(inplace=True) data['label'].value_c...
#!/usr/bin/env python3 # Original code # https://gist.github.com/KurtJacobson/374c8cb83aee4851d39981b9c7e2c22c # Copyright (c) 2017 <NAME> # License: https://kcj.mit-license.org/@2017 # Modified code # Copyright (c) 2020 <NAME> import argparse import cairo import os import platform import re import signal impo...
""" Author: <NAME> Date: Dec 2,2021 build query images database information, 1. capture all possible standard images from camera, save to disk 2. detect ROI (by corner , or by edgeDetection), warp image to 600*600 coordination system, save to disk 3. detect and compute their keypoints and featureDescriptor, save to di...
import warnings warnings.filterwarnings("ignore") import skimage import statistics import os import sys import math import re import numpy as np import cv2 from pprint import pprint import matplotlib.pyplot as plt import tensorflow as tf # Root directory of the project ROOT_DIR = os.path.abspath(os.getcwd()) # Impor...
from __future__ import print_function import datetime import glob import json import multiprocessing import os import pickle import random import sys import warnings from collections import Counter, defaultdict from sklearn import metrics from string import digits import re import math import matplotlib.pyplot as plt ...
import array import unittest import struct import sys from test.support import run_unittest ISBIGENDIAN = sys.byteorder == "big" IS32BIT = sys.maxsize == 0x7fffffff integer_codes = 'b', 'B', 'h', 'H', 'i', 'I', 'l', 'L', 'q', 'Q' byteorders = '', '@', '=', '<', '>', '!' # Native 'q' packing isn't available on syste...
# coding=utf-8 # flake8: noqa C901 # NOTE: Ignoring flake8 cyclomatic complexity in this file """ This module defines the ArgparseCompleter class which provides argparse-based tab completion to cmd2 apps. See the header of argparse_custom.py for instructions on how to use these features. """ import argparse import ins...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Fri Jun 30 13:03:30 2017 @author: icgguest """ import numpy as np import matplotlib.pyplot as plt from astropy.io import fits from astropy import cosmology from marvin import config from marvin.tools.maps import Maps from marvin.utils.general.images import...
# -*- coding: utf-8 -*- """Layers that augment the functionality of a base layer. """ from __future__ import absolute_import from __future__ import division from __future__ import print_function import copy from ..engine.base_layer import Layer from ..engine.base_layer import InputSpec from ..utils.generic_utils impor...
# VIOLET: We do not have 'math' module, we will implement our own stub: # import math class math: @staticmethod def isnan(value): s = str(value).lower() return 'nan' in s @staticmethod def isinf(value): s = str(value).lower() return 'inf' in s @staticmethod def...
#!/usr/bin/env python3 """ Expose a _drawing api with multiple (hopefully) backends. The api uses the first quadrant coordinate system: y ^ | | | positive x and y | | --+-------------------> x | """ from math import pi, sqrt, sin, cos, ...
import logging, itertools, dgl, random, torch, tempfile import multiprocessing from typing import Dict, List, Optional, Union import numpy as np from allennlp.commands.fine_tune import fine_tune_model_from_file_paths from allennlp.commands.train import train_model from allennlp.common import Params from allennlp.data.v...
# # Copyright 2021 Red Hat Inc. # SPDX-License-Identifier: Apache-2.0 # """Asynchronous tasks.""" import datetime import json import logging import os from decimal import Decimal from decimal import InvalidOperation from celery import chain from dateutil import parser from django.db import connection from django.db.ut...
"""Formulation of data matrices and absorption of fixed effects.""" import functools import numbers import token from typing import Any, Callable, Dict, List, Mapping, Optional, Sequence, Set, Tuple, Union import numpy as np import patsy import patsy.builtins import patsy.contrasts import patsy.desc import patsy.desi...
import errno import logging import numpy as np import os import ray import ray.experimental.tf_utils from ray.util.debug import log_once from ray.rllib.policy.policy import Policy, LEARNER_STATS_KEY from ray.rllib.policy.rnn_sequencing import pad_batch_to_sequences_of_same_size from ray.rllib.policy.sample_batch impor...
import mxnet as mx import networkx as nx import numpy as np import scipy as sp import dgl import dgl.nn.mxnet as nn import dgl.function as fn import backend as F from mxnet import autograd, gluon, nd def check_close(a, b): assert np.allclose(a.asnumpy(), b.asnumpy(), rtol=1e-4, atol=1e-4) def _AXWb(A, X, W, b): ...
from __future__ import absolute_import, division, print_function, unicode_literals import warnings warnings.filterwarnings(action="ignore", category=DeprecationWarning) warnings.filterwarnings(action="ignore", category=FutureWarning) warnings.filterwarnings(action="ignore", category=PendingDeprecationWarning) impor...
import json from lokbot import project_root # 刚进游戏 TUTORIAL_CODE_INTRO = 'Intro' # 完成改名字主线后, 弹出 "学徒的板条箱 $0.99" 购买按钮 TUTORIAL_CODE_START = 'TutorialStart' # 任务状态 STATUS_PENDING = 1 # 未完成任务 STATUS_FINISHED = 2 # 已完成待领取奖励 STATUS_CLAIMED = 3 # 已领取奖励 # 任务类型 code TASK_CODE_SILVER_HAMMER = 1 # 免费建筑工 TASK_CODE_GOLD_HAM...
#!/usr/bin/python # # MixMode.ai - Bro Intel Linter # # WHEN WHAT WHO # 03-04-2015 Initial development <NAME> # 08-24-2015 Explicitly verify single character fields <NAME> # 08-24-2015 GPL and pushed to GitHub ...
from amuse.test.amusetest import TestWithMPI import os import sys import numpy import math from amuse.community.smalln.interface import SmallNInterface, SmallN from amuse.units import nbody_system from amuse.units import units from amuse import datamodel from amuse import io from amuse.datamodel import trees from amu...
# ========== # The standalone Tkinter-based control panel interface # Do not run this file; import model.py and run from your file. # ========== from tkinter import * from tkinter.ttk import Progressbar from helipad.helpers import Color import sys, colorsys from helipad.param import Param from math import ceil class ...
# coding=utf-8 # Copyright 2022 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...
from matplotlib import pyplot as plt import numpy as np from Xana.Xplot.niceplot import niceplot import matplotlib import pickle import pandas as pd import lmfit from Xana.Xfit.fit_basic import fit_basic import ipywidgets as widgets from ipywidgets import Layout, Button, Box, Text from IPython.display import display, ...
############################################################################### # Copyright (c) 2018-2021 Lawrence Livermore National Security, LLC. # Produced at the Lawrence Livermore National Laboratory # # Written by <NAME>, <NAME>, <NAME>, <NAME>, <NAME> # <EMAIL>. # # LLNL-CODE-819515 # # All rights reserved. # #...
# Copyright (C) 2015-2021 Regents of the University of 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 obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by app...
""" Module for flexure routines .. include common links, assuming primary doc root is up one directory .. include:: ../links.rst """ import inspect import numpy as np import copy from matplotlib import pyplot as plt from matplotlib import gridspec from astropy import stats from astropy import units from linetools.s...
# Copyright 2015 The Chromium OS Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """Script to summarize stats for different builds in prod.""" from __future__ import print_function import datetime import itertools import numpy import...
# Copyright (c) OpenMMLab. All rights reserved. import copy from abc import ABCMeta, abstractmethod from collections import OrderedDict from types import MethodType import torch import torch.nn as nn import torch.nn.functional as F from mmcv.runner import BaseModule from ordered_set import OrderedSet from torch.nn.mod...
import math import time from typing import Any, Tuple import numpy as np import torch import torch.nn.functional as F from torch.nn import Module, ModuleList from .bitstream import Bitstream, is_sym_type from .logistic import mixlogistic_logcdf, mixlogistic_logpdf, mixlogistic_invcdf, force_accurate_mixlogistic_invcd...
from __future__ import (absolute_import, division, print_function, unicode_literals, with_statement) import argparse import os import pickle as pkl import resource import shutil import time from collections import namedtuple import cv2 import numpy as np import torch import torch.backends.cudn...
import os, sys import ctypes, ctypes.wintypes import subprocess, time, struct import msvcrt from sys import stdout from random import sample from math import ceil from string import ascii_lowercase VERSIONS = [(3, 6), (3, 7), (3, 8)] if sys.version_info[:2] not in VERSIONS: c = " | ".join([f"{v[0]}.{v[...
# -*- coding: utf-8 -*- from collections import defaultdict from copy import deepcopy from typing import Optional, Tuple, Dict import json from matplotlib import pyplot as plt from monty.serialization import loadfn from monty.json import MontyEncoder, MSONable import numpy as np from pydefect.core.defect_name impo...
from __future__ import print_function import sys import os import logging import time import socket import threading import pprint import json import re import sqlite3 from functools import wraps, reduce from .nt import NTScalar, Type, NTTable from .server import Server, StaticProvider, removeProvider from .server.t...
#!/usr/bin/env python __author__ = '<NAME> <<EMAIL>>' from nose.plugins.attrib import attr from mock import Mock, sentinel, patch, ANY, call, MagicMock from gevent import event, spawn import unittest from zope.interface.declarations import implements from zope.interface.interface import Interface from gevent import ...
import os import json import pandas as pd import numpy as np from scipy.ndimage.filters import uniform_filter1d from sklearn.preprocessing import PowerTransformer import tensorflow as tf class Transformer: def __init__( self, data, cols=None, ncols=None, tx_data=None, ...
#! /usr/bin/python2 # # Copyright (c) 2017 Intel Corporation # # SPDX-License-Identifier: Apache-2.0 # """ General driver to create targets that implement a virtual machine using QEMU. .. note:: This is now replacing :mod:`ttbl.tt_qemu` which is now deprecated. :class:`ttbl.tt_qemu2.tt_qemu` is a generic cl...