text
stringlengths
8.04k
46.5k
# py dependancies import os import shutil import json import requests import logging from uuid import uuid4 from threading import Thread import re import zipfile from io import BytesIO # Flask from flask import Flask from flask import render_template from flask import request from flask import Response from flask impor...
# -*- coding: utf-8 -*- ########################################################################## # NSAp - Copyright (C) CEA, 2019 # Distributed under the terms of the CeCILL-B license, as published by # the CEA-CNRS-INRIA. Refer to the LICENSE file or to # http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html #...
from __future__ import annotations import copy import re from typing import Union, Callable, Optional from collections import OrderedDict import numpy as np import elementy class Alloy(): """An alloy, a mixture of chemical elements with specific percentages. Attributes: composition: Dictionary match...
""" Template render systems """ import codecs import logging import os import sys import tempfile import traceback from pathlib import Path import jinja2 import jinja2.ext import jinja2.sandbox import salt.utils.data import salt.utils.dateutils import salt.utils.files import salt.utils.hashutils import salt.utils.http...
# -*- coding: utf-8 -*- ''' Classes for starting/stopping/status salt daemons, auxiliary scripts, generic commands. ''' from __future__ import absolute_import import atexit import copy from datetime import datetime, timedelta import errno import getpass import logging import os import shutil import signal import socke...
import functools import sys import warnings import numpy from cupy import _environment from cupy import _version if sys.platform.startswith('win32') and (3, 8) <= sys.version_info: # NOQA _environment._setup_win32_dll_directory() # NOQA try: with warnings.catch_warnings(): warnings.filterwarning...
import demistomock as demisto from CommonServerPython import * ''' IMPORTS ''' import json import requests from datetime import date requests.packages.urllib3.disable_warnings() ''' GLOBAL VARS ''' TIME_FORMAT = '%Y-%m-%dT%H:%M:%SZ' BASE_URL = demisto.params().get('url') if BASE_URL and BASE_URL[-1] != '/': BASE...
from datetime import datetime, timedelta from typing import Any import weakref import numpy as np from pandas._libs import index as libindex from pandas._libs.lib import no_default from pandas._libs.tslibs import frequencies as libfrequencies, resolution from pandas._libs.tslibs.parsing import parse_time_string from ...
from __future__ import print_function import numpy as np import os import sys import cv2 import random import pickle import torch import torch.backends.cudnn as cudnn from torch.autograd import Variable import torch.optim as optim from torch.optim import lr_scheduler import torch.utils.data as data import torch.nn.ini...
import math import warnings import numpy as np import pandas as pd import seaborn as sns import scipy.stats as ss import scipy.cluster.hierarchy as sch import matplotlib.pyplot as plt from collections import Counter from .data_utils import identify_columns_by_type from ._private import ( convert, remove_incomplete_...
"""Read/write BIDS compatible electrode/coords structures from MNE.""" # Authors: <NAME> <<EMAIL>> # <NAME> <<EMAIL>> # <NAME> <<EMAIL>> # # License: BSD-3-Clause import json from collections import OrderedDict from pathlib import Path import re import warnings from importlib_resources import files i...
import torch import torch.nn as nn import torch.optim as optim import numpy as np import matplotlib.pyplot as plt from itertools import permutations from data_loader import get_label_coding,load_shj_abstract,load_shj_images from scipy.stats import sem from os import mkdir, path import os import pandas as pd import ...
"""Interface for querying and loading contiguous vectors from Housekeeping frame streams. We want to expose a sisock-compatible API, where time ranges are an essential part of every query. Use HKArchiveScanner to scan a set of G3 files containing Housekeeping frames. Use the resulting HKArchive to perform random I/O...
# -*- coding: utf-8 -*- # ***************************************************************************** # NICOS, the Networked Instrument Control System of the MLZ # Copyright (c) 2009-2022 by the NICOS contributors (see AUTHORS) # # This program is free software; you can redistribute it and/or modify it under # the t...
import os import os.path as op import numpy as np from numpy.testing import assert_allclose, assert_array_equal import matplotlib.pyplot as plt import pytest from mne import (read_dipole, read_forward_solution, convert_forward_solution, read_evokeds, read_cov, SourceEstimate, write_e...
""" Tests for the models in the stocking application - stocking events, stocking methods, ect. """ from datetime import datetime import pytest from django.contrib.gis.geos import GEOSGeometry from ...common.utils import is_uuid4 from ...common.models import LatLonFlag from ...stocking.models import StockingEvent ...
import numpy as np import collections import sys, os import pyqtgraph as pg from pyqtgraph.Qt import QtGui, QtCore from pyqtgraph.parametertree import Parameter, ParameterTree from pyqtgraph.parametertree import types as pTypes import pyqtgraph.configfile from pyqtgraph.python2_3 import xrange from time import perf_co...
from sympy.core.basic import Basic from sympy.core.numbers import (I, Rational, pi) from sympy.core.parameters import evaluate from sympy.core.singleton import S from sympy.core.symbol import Symbol from sympy.core.sympify import sympify from sympy.functions.elementary.miscellaneous import sqrt from sympy.geometry impo...
#!/usr/bin/python3 ''' SPDX-License-Identifier: BSD-2-Clause Copyright 2017 Massachusetts Institute of Technology. ''' import base64 import logging import os import ssl import traceback import sys import tornado.ioloop import tornado.web from keylime.requests_client import RequestsClient from keylime.common import ...
import json from typing import Any, Dict, List, Optional, Union from unittest.mock import patch from web3 import Web3 from web3._utils.abi import get_abi_input_types, get_abi_output_types from rotkehlchen.assets.asset import EthereumToken from rotkehlchen.chain.ethereum.defi.zerionsdk import ZERION_ADAPTER_ADDRESS fr...
# -*- coding: utf-8 -*- """ Sahana Eden Assets Model @copyright: 2009-2012 (c) Sahana Software Foundation @license: MIT 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 withou...
"""""" # """ Copyright (c) 2020-2022, <NAME> All rights reserved. This work is licensed under BSD 3-Clause "New" or "Revised" License. License available at https://github.com/dcajasn/Riskfolio-Lib/blob/master/LICENSE.txt """ import pandas as pd import matplotlib.pyplot as plt from xlsxwriter.utility import xl_range_a...
""" Django-environ allows you to utilize 12factor inspired environment variables to configure your Django application. """ import json import logging import os import re import sys import warnings try: from django.core.exceptions import ImproperlyConfigured except ImportError: class ImproperlyConfigured(Except...
import datetime import logging import re import sys import requests from bs4 import BeautifulSoup as bS from regulations3k.models.django import Section, Subpart from regulations3k.parser.integer_conversion import int_to_alpha from regulations3k.parser.paragraphs import ( bold_first_italics, combine_bolds, graph_t...
# Imports from functools import partial from math import sqrt import numpy as np import pandas as pd import string import timeit import torch from torch import nn import torch.functional as F import torch.nn.functional as F from torch.nn import TransformerEncoder, TransformerEncoderLayer import statistics import re imp...
# -*- coding: utf-8 -*- """ CALFEM Vedo utility module Utility functions for Vedo """ import numpy as np from vedo import * import vtk import pyvtk import sys ### ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ### # By <NAME> def von_mises_3d(es): sigv = np.zeros(e...
# vim: expandtab:ts=4:sw=4 import argparse import numpy as np import tensorflow as tf # import tensorflow # import tensorflow.compat.v1 as tf # tf.disable_eager_execution() # tf.disable_v2_behavior() # import tf_slim as slim import tensorflow.contrib.slim as slim from datasets import util import queued_trainer im...
""" Functions for explaining classifiers that use Multimodal data. Developed initially for the hateful memes challenge in mmf """ import copy from functools import partial import numpy as np import scipy as sp import sklearn from sklearn.utils import check_random_state from tqdm.auto import tqdm from lime.wrappers.sc...
# -*- coding: utf-8 -*- {{{ # vim: set fenc=utf-8 ft=python sw=4 ts=4 sts=4 et: # # Copyright 2020, Battelle Memorial Institute. # # 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...
#!/usr/bin/python2 -utt #-*- coding: utf-8 -*- """ This is HardNet local patch descriptor. The training code is based on PyTorch TFeat implementation https://github.com/edgarriba/examples/tree/master/triplet by <NAME>. If you use this code, please cite @article{HardNet2017, author = {<NAME>, <NAME>, <NAME>, <NAME>},...
import os import re import string import logging import importlib import inspect import linecache import random import json from collections import defaultdict from copy import copy from imp import reload from cardinal.exceptions import ( CommandNotFoundError, ConfigNotFoundError, EventAlreadyExistsError, ...
import logging import re from dataclasses import dataclass from enum import Enum from typing import Dict, Iterable, List, Optional, Tuple, Union import pydantic from looker_sdk.error import SDKError from looker_sdk.rtl.transport import TransportOptions from looker_sdk.sdk.api31.methods import Looker31SDK from pydantic...
""" Copyright (c) 2021 Intel Corporation Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writin...
# -------------------------------------------------------- # Licensed under The MIT License [see LICENSE for details] # -------------------------------------------------------- import argparse import datetime import numpy as np import itertools import torch from core.bc import BC from core.ddpg import DDPG from core....
"""Generates numpy dtypes for C/C++ classes and structs and other types. This module is available as an xdress plugin by the name ``xdress.dtypes``. :author: <NAME> <<EMAIL>> NumPy Dtypes Wrapper API ======================== """ from __future__ import print_function import os import sys import pprint from .plugins ...
import sys import numpy as np import torch from sklearn.feature_extraction.text import CountVectorizer from octis.models.scholar_model.scholar import Scholar from sklearn.preprocessing import MultiLabelBinarizer import utils.file_handling as fh class scholar: def __init__(self, num_topics=10, batch_size=512, so...
# ' % kmergrammar # ' % <NAME> mm2842 # ' % 15th May 2017 # ' # Introduction # ' Some of the code below is still under active development # ' ## Required libraries # + name = 'import_libraries', echo=False import sys import os import inspect import numpy as np from kmergrammar.kgutils.data_utils import get_features_...
import numpy as np import pytest from matplotlib.testing.decorators import image_comparison import matplotlib.pyplot as plt import matplotlib.gridspec as gridspec import matplotlib.transforms as mtransforms from matplotlib import ticker, rcParams def example_plot(ax, fontsize=12, nodec=False): ax.plot...
from mixin_api import MIXIN_API import uuid import mixin_config import json import csv import time import umsgpack import base64 import getpass import requests import os import wallet_api import exincore_api from datetime import datetime import pytz import time import mixin_asset_id_collection PIN = "94568...
import sys sys.path.insert(0, '/home/emmanuel/code/kernellib') import warnings from operator import itemgetter import numba from numba import prange import numpy as np from scipy.linalg import cholesky, cho_solve, solve_triangular from scipy.optimize import fmin_l_bfgs_b from sklearn.base import BaseEstimator, Regres...
""" .. module:: polar :platform: Windows :synopsis: Implementation of a class for optical pumping simulations. .. moduleauthor:: <NAME> <<EMAIL>> """ import numpy as np from .profiles import Lorentzian from scipy import integrate from sympy.physics.wigner import wigner_6j, wigner_3j from . import utilitie...
#!/usr/bin/env python # # Copyright 2015 Google Inc. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless require...
""" Copyright 2014-2016 University of Illinois 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...
import schedule import logging import time import configparser import os import random import string from opencaptcha_lib import DBconnector, site_secret_length, site_key_length, validate_settings_ini, image_similarity_hash import gzip from glob import glob import urllib.request import shutil import toml from collectio...
""" Support for Xiaomi Mi Smart Pedestal Fan. For more details about this platform, please refer to the documentation https://home-assistant.io/components/fan.xiaomi_miio/ """ import asyncio from enum import Enum from functools import partial import logging import voluptuous as vol from homeassistant.components.fan ...
import os import re import signal import tempfile import subprocess import multiprocessing import threading import time import numpy as np import cv2 import config import win32pipe, win32file, win32api, win32con, win32job, pywintypes, msvcrt def is_int16(str): try: int(str, 16) return True ex...
from __future__ import division, absolute_import import warnings from collections import OrderedDict import torch import torch.nn as nn import torch.nn.functional as F from torchreid.losses import AngleSimpleLinear from torchreid.ops import Dropout, HSwish, GumbelSigmoid, LocalContrastNormalization __all__ = ['osn...
# -*- coding: utf-8 -*- """This module parses PAGEXML-files to extract informations for, e.g., Article Separation or Handwriting Text Recognition. The PAGE format is described at http://www.ocr-d.de/sites/all/gt_guidelines/trPage.html https://github.com/PRImA-Research-Lab/PAGE-XML http://www.primaresearch....
# Copyright 2008 Google 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 writing, ...
# ***** BEGIN GPL LICENSE BLOCK ***** # # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; either version 2 # of the License, or (at your option) any later version. # # This program is distribute...
from .. import cuda_ext_available import torch as T import numpy as np import numbers __all__ = ['dimshuffle', 'shape_padleft', 'shape_padright', 'swapaxes', 'ravel_index', 'tile', 'repeat', 'block_diag', 'block_diag_sparse', 'get_bilinear_weights', 'interpolate_bilinear', 'batch_pairwise_sqdist', 'gram_ma...
# -*- coding: utf-8 -*- # # reference: # + https://gist.github.com/MightyPork/6da26e382a7ad91b5496ee55fdc73db2 # # fmt: off NO = '\x00' TRANSPARENT = '\x01' # NONE = 0x00 # No key pressed # Keyboard Error Roll Over - used for all slots if too many keys are pressed ("Phantom key") # ROLLOVER = 0x01 # 0x02 # Keyboa...
# -*- coding: utf-8 -*- import json import os import tarfile import tempfile from io import BytesIO import numpy as np import pandas as pd import skimage.io as io import warnings from skimage.util import img_as_uint from skimage.util import img_as_ubyte import skimage.measure as measure from pcnaDeep.tracker import t...
""" Summary: DCASE 2017 task 4 Large-scale weakly supervised sound event detection for smart cars. Ranked 1 in DCASE 2017 Challenge. Author: <NAME>, <NAME> Created: 03/04/2017 Modified: 31/10/2017 """ from __future__ import print_function import sys try: import cPickle except BaseException: prin...
import sys import time from typing import List, Tuple from scipy import spatial import numpy as np import torch from torch import nn from torch.optim import optimizer from torch.utils import tensorboard from torch.utils.data import DataLoader from dataloader import BidirectionalOneShotIterator from dataloader import ...
#------------------------------------------------------------------------------ """ ST-Link Driver Sources: https://github.com/texane/stlink openocd: ./src/jtag/drivers/stlink_usb.c Note: ST-Link doesn't support real 16-bit load/store operations. For the sake of the API we fake them with 8-bit operations. If the ha...
import flask from flask import Flask, request, Response from viberbot import Api from viberbot.api.bot_configuration import BotConfiguration from viberbot.api.messages import VideoMessage from viberbot.api.messages.text_message import TextMessage import json from viberbot.api.viber_requests import ViberConversationSta...
# -*- coding: utf-8 -*- """ Created on Aug 20, 2020 @author: <NAME> """ from PIL import Image import warnings from warnings import warn import os import sys import numpy as np import glob import random as r import time import math import cv2 import cupy import re import functools import torch.cuda import torch.optim...
from __future__ import print_function import json from flask import jsonify, request import os.path from googleapiclient.discovery import build from google_auth_oauthlib.flow import InstalledAppFlow from google.auth.transport.requests import Request from google.oauth2.credentials import Credentials import requests fr...
# -*- Mode: Python; py-indent-offset: 4 -*- # vim: tabstop=4 shiftwidth=4 expandtab # # Copyright (C) 2012 Canonical Ltd. # Author: <NAME> <<EMAIL>> # Copyright (C) 2012-2013 <NAME> <<EMAIL>> # Copyright (C) 2012 <NAME> <<EMAIL>> # # This library is free software; you can redistribute it and/or # modify it under the te...
# -*- coding: utf-8 -*- import datetime from auxlib._vendor.boltons.timeutils import isoparse from enum import Enum import time from unittest import TestCase from auxlib._vendor.six import string_types, integer_types from auxlib.entity import (Entity, StringField, IntField, EnumField, ListField, ...
import pandas as pd df = None def setup_module(): global df if df is None: df = pd.read_feather('enron.feather') def test_overall_stats(): global df assert len(df)==2_499_216 assert len(df['MailID'].unique())==349849 assert len(df['Date'].unique())==1187 assert len(df['From'].uni...
# Princeton University licenses this file to You 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 writin...
# Copyright 2017 The Sonnet 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 applicable l...
# Copyright 2017 Battelle Energy Alliance, LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed t...
# 功能:爬取八斗作品库, 获取八斗文案 # 环境:Python3 # 作者:百舸 import requests import pymysql import json import re import datetime import threading import time import CralwerSet.connect_mysql as connect_mysql import CralwerSet.schedule as schedule import sys from requests.packages import urllib3 urllib3.disable_warnings(urllib3.exception...
import os import logging import glob import time import numpy as np try: import gdal except: try: from osgeo import gdal except Exception as e: raise e from retry import retry from os.path import join as opj from ost.generic import common_wrappers as common from ost.helpers import helpers ...
import tensorflow as tf from tensorflow.keras.layers import Layer, Dense, LSTM, GRU, RNN, \ GaussianNoise, TimeDistributed, Input, add, Flatten, Dense, GRUCell, \ Concatenate, BatchNormalization, Add, Dropout from tensorflow.keras import layers from tensorflow.keras import Model import tensorflow.keras.optimize...
#!/usr/bin/env python # Copyright 2018 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. import argparse import fidl import json class _CompoundIdentifier(object): def __init__(self, library, name): self.library = ...
from math import pi from pathlib import Path from shutil import which import numpy as np import pytest import openmc import openmc.lib @pytest.fixture(scope='function') def pin_model_attributes(): uo2 = openmc.Material(material_id=1, name='UO2') uo2.set_density('g/cm3', 10.29769) uo2.add_element('U', 1....
""" Models that are used in the database and application """ from __future__ import unicode_literals import uuid from datetime import datetime import pandas as pd from django.core.exceptions import PermissionDenied from django.core.urlresolvers import reverse from django.db import connection, models from django.util...
"""Primitive floating and fixed-point types. A pfloat.float_t is an atomic type that is used to describe real numbers within a complex data structure. This is used to describe the different components of a floating-point number that are encoded according to the ieee-754 standard. A float_t includes space for defining ...
# Copyright 2017 SAP SE # # 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 appl...
# Copyright (c) 2017-present, Facebook, Inc. # 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. An additional grant # of patent rights can be found in the PATENTS file in the same directory. """ParlAI Server file""" ...
import sys import os import numpy as np import random import math import pandas as pd import seaborn as sns import matplotlib.pyplot as plt from matplotlib.gridspec import GridSpec import matplotlib try: from lfig import LatexFigure except: from qmla.shared_functionality.latex_figure import LatexFigure import...
""" Module with classes and function to help visualize different processes inside the framework. Both plots and print-function/log-function will be implemented here. The Visualizer Class inherits the Logger class, as logging will always be used as a default. """ import os import logging import csv from shutil import co...
import json import os import time from api import * import logging from fastapi import status logger = logging.getLogger('uvicorn.error') ALLOWED_FS_ENDPOINTS = ['images'] def _get_mod_from_score(score): return int((score-10)/2) def try_keys(object, keys): for i in keys: if i in object.keys(): ...
#!/usr/bin/env python3 import time import datetime import sys import os import gpiozero as ioz from Adafruit_IO import MQTTClient import json from collections import namedtuple import rogysensor class RogyGardenRoof: def __init__(self, motor_enable_pin, motor_forward_pin, motor_backward_pin, det...
# using trf MCMC method to generate word sequences import tensorflow as tf import os import json import time from copy import deepcopy from collections import OrderedDict from base import * from lm import * from trf.common import feat2 as feat from trf.isample import sampler from trf.nce import pot as nce_pot from . ...
""" Created: 2001/10/12 __version__ = "$Revision: 1.21 $" __date__ = "$Date: 2005/03/28 05:46:59 $" """ import math import wx import time class AbstractTurtle: def __init__(self, size): """ this should be called after a subclass has done its init """ self._size = size self._tracing = Fa...
""" Manage configuration information for the CEA. The Configuration class is built dynamically based on the type information in ``default.config``. """ from __future__ import print_function import os import re import json import ConfigParser import cea.inputlocator import collections import datetime __author__ = "<NA...
import numpy as np import mpmath as mp from scipy.integrate import quad, simps, dblquad from scipy.optimize import newton, minimize #from scipy import weave """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" -----------------Functions to compute counts and multiplicities-----------------...
import wx import wx.richtext as rt import images #---------------------------------------------------------------------- class RichTextFrame(wx.Frame): def __init__(self, *args, **kw): wx.Frame.__init__(self, *args, **kw) self.MakeMenuBar() self.MakeToolBar() self....
# -*- coding: utf-8 -*- """ Contains objects for interfacing ``gridwxcomp`` with gdal command line tools used for spatial interpolation of scattered point data. """ import os import subprocess import xml.etree.cElementTree as ET from copy import copy from pathlib import Path from xml.dom import minidom import numpy as...
''' Written by <NAME>, 2022 file_dir = 'C:/Users/rringuet/Kamodo_WinDev1/AmGEO/' file name: '*_YYYYMMDDx.h5' where x is either N for northern hemisphere or S for southern hemisphere data structure: file object is a nested dictionary, keys are format 'YYYYMMDD_HHMMSSx' and 'lats' 'lons' - subkeys are dataset ...
"""General purpose functions and classes used in other modules. To avoid circular dependencies, this module does *not* depend on any other modules of the ASpecD package, but it can be imported into every other module. """ import collections import datetime import hashlib import importlib import inspect import os imp...
#!/usr/bin/env python # coding: utf-8 # # DNN text-to-speech synthesis (ja) # # Source code: https://github.com/r9y9/nnmnkwii_gallery # # DNN日本語音声合成のデモです。基本的な処理は言語非依存なので、DNN英語音声合成の場合とほとんど変わりません。変更点をまとめると、 # # - CMU ARCTICの代わりに、HTS-demo-NIT-ATR503 のデータを使います。[ライセンス](https://github.com/r9y9/nnmnkwii_gallery/blob/03550...
# (c) 2014, <NAME> <<EMAIL>> # (c) 2016, <NAME> <<EMAIL>> # (c) 2016, <NAME> <<EMAIL>> # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any lat...
# for running unit tests on 6.00/6.0001/6.0002 student code import os import string import sys import unittest import random from contextlib import redirect_stdout import ps4b as student import ps4c as studentc # A class that inherits from unittest.TestCase, where each function # is a test you want to run on the stu...
# coding=utf-8 # Get URL for css # encoding=utf8 import re import sys, urlparse, os import urllib import requests import base64 from bs4 import BeautifulSoup import datetime, time from multiprocessing import Pool from pymongo import MongoClient import traceback from concurrent.futures import ThreadPoolExecutor re_css...
#!/usr/bin/env python2 # # Prepare a fin_config.h and combined/separate sources for compilation, # given user supplied config options, built-in metadata, Unicode tables, etc. # # This is intended to be the main tool application build scripts would use # before their build step, so convenient, versions, Python compa...
import time import logging import typing from collections import Counter from enum import Enum import numpy as np from smac.stats.stats import Stats from smac.utils.constants import MAXINT from smac.configspace import Configuration from smac.runhistory.runhistory import RunHistory, InstSeedBudgetKey from smac.tae.exe...
from flask import Flask, redirect, url_for, abort, render_template, make_response, request, escape from werkzeug.exceptions import HTTPException from werkzeug.routing import RequestRedirect from werkzeug import unescape app = Flask(__name__) import sys import traceback import requests from http import HTTPStatus imp...
import os import sys current_path = os.path.dirname(os.path.realpath(__file__)) root_path = os.path.dirname(os.path.dirname(os.path.realpath(__file__))) sys.path.append(root_path) import signal import subprocess import threading from argparse import ArgumentParser import time import json import random import numpy as...
import gzip import json import math import os import pickle from itertools import cycle import numpy as np import pandas as pd from bokeh.layouts import column, row from bokeh.models import ColumnDataSource, LabelSet, Span from bokeh.palettes import Category10 from bokeh.plotting import figure, output_file, save from ...
#!/usr/bin/env python """ @package ion.agents.platform.rsn.rsn_platform_driver @file ion/agents/platform/rsn/rsn_platform_driver.py @author <NAME> @brief The main RSN OMS platform driver class. """ import functools from xmlrpclib import Fault from xmlrpclib import ProtocolError from socket import error as Socket...
#! /usr/bin/env python3 """ %(prog)s takes a FIDL (Fault Injection Description Language) yaml and generates an instruction/register selector C++ code, and a fault injection run-time C++ code. Usage: %(prog)s [OPTIONS] List of options: -a <FIDL yaml> : add a FI run-time and selector from a FIDL yaml -r <name/type> ...
'''Functions used for the primary analysis''' import pandas as pd import numpy as np from sklearn.metrics import confusion_matrix from sklearn.model_selection import StratifiedKFold, cross_val_predict from scipy.stats import binom, chi2, norm from copy import deepcopy from multiprocessing import Pool def threshold(...
import os import h5py import resource import numpy as np from time import time from glob import glob from sys import getsizeof from random import shuffle #from sklearn.utils import shuffle np.random.seed(0) def open_h5file(filename): #function to read HDF5 file format return h5py.File(filename,'r') def read_h5file...
import pdb import torch import torch.nn as nn import torch.nn.functional as F from functools import partial from .utils import convolution, residual INF = 1e8 class MergeUp(nn.Module): def forward(self, up1, up2): return up1 + up2 def make_merge_layer(dim): return MergeUp() def make_tl_layer(dim...