text
stringlengths
6.04k
39.5k
# Copyright (c) 2018-2019, NVIDIA CORPORATION. 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 a...
# Link Budget Challenge import os import sys from time import sleep from math import log10, isclose # from math import sqrt # from datetime import datetime from timeout import timeout, TimeoutError time = int(os.getenv("TIMEOUT", 180)) class Linky: def __init__(self): # General Constants self...
"""Core classes and functions for txt_ferret.""" from datetime import datetime import gzip import os from pathlib import Path import re from loguru import logger from ._config import ALLOWED_SETTINGS_KEYS from ._sanity import sanity_check from ._default import ( DEFAULT_SUBSTITUTE, DEFAULT_ENCODING, DEFA...
# -*- coding: UTF-8 -*- import re import sys import os import time import json import zipfile import rarfile import urllib import http.cookiejar as cookielib import urllib.request as urllib2 from bs4 import BeautifulSoup DEBUG_MODE = True if not DEBUG_MODE: from kodi_six import xbmc, xbmcgui, xbmcaddon, xbmcplugi...
# As documented in the NRPy+ tutorial module # Tutorial-Coutput__Parameter_Interface.ipynb # this core NRPy+ module is used for # initializing, storing, and recalling # parameters. # Author: <NAME> # zachetie **at** gmail **dot* com import sympy as sp # Import SymPy import os, sys ...
#!/usr/bin/env python # Copyright (C) 2012-2014 <NAME> """ Script to get a list of ComicGenesis comics and save the info in a JSON file for further processing. """ from __future__ import print_function import codecs import re import sys import os import requests sys.path.append(os.path.join(os.path.dirname(__file__), "...
#### ros cmd #roslaunch pushpin_mission pick_and_place_transparent.launch import rospy import sys import time import threading import argparse import numpy as np import math import enum import time from std_msgs.msg import Int32MultiArray import os # yolo v4 import from pushpin_mission.msg import ROI from pushpin_missi...
#!/usr/bin/env python # -*- coding: utf-8 -*- import sys from collections.abc import Iterable from datetime import datetime, date, time from time import sleep import requests from bs4 import BeautifulSoup, Tag from peewee import * from .utils import parse_argv, replace_tokens from .core import cfg, DataFile, log, Co...
"""Module for i18n methods and functionality""" from future import standard_library # isort:skip standard_library.install_aliases() # noqa: E402 from collections import defaultdict import io import os import re from subprocess import check_call import sys import tempfile from zipfile import ZipFile from flask imp...
from math import isclose, ceil import warnings import pandas as pd import numpy as np import networkx as nx import geopandas as gpd import ogr from skimage import transform as tf from scipy.spatial import Voronoi, Delaunay, ConvexHull import shapely.geometry from shapely.geometry import Polygon, MultiPolygon, Point f...
""" Parser functions, including implementation for :py:mod:`pymatgen` compatible VASP files and :py:mod:`MDAnalysis` compatible trajectories. This parser borrows heavily from the :py:class`pymatgen.analysis.diffusion_analyzer.DiffusionAnalyzer` class, originally authored by <NAME> (<EMAIL>) and <NAME>. We include thi...
""" CCT 建模优化代码 作者:赵润晓 日期:2021年5月21日 """ from cctpy import * from hust_sc_gantry import HUST_SC_GANTRY import time import numpy as np # 可变参数 # 动量分散 momentum_dispersions = [-0.05, -0.0167, 0.0167, 0.05] # 每平面、每动量分散粒子数目 particle_number_per_plane_per_dp = 12 # 每个机架(束线)粒子数目 particle_number_per_gantry = len( momentum_...
# Copyright (c) 2021, NVIDIA CORPORATION. All rights reserved. # # NVIDIA CORPORATION and its licensors retain all intellectual property # and proprietary rights in and to this software, related documentation # and any modifications thereto. Any use, reproduction, disclosure or # distribution of this software and rel...
""" Page module. This module contains the definition of the Page class, as well as a number of useful methods for processing a page. """ import os import re import sys import yaml import glob import argparse import subprocess from string import Template import logging logging.basicConfig(format='mokuwiki: %(levelna...
#! /usr/bin/env python # -*- coding: utf-8 -*- # vim:fenc=utf-8 # # Copyright © 2017 <NAME> <<EMAIL>> # # Distributed under terms of the MIT license. """ externalmodel.py Define several user-defined models. """ import gym from gym import error, spaces, utils from gym.utils import seeding from scipy.integrate import o...
# -*- coding: utf-8 -*- """ celery.worker.job ~~~~~~~~~~~~~~~~~ This module defines the :class:`Request` class, which specifies how tasks are executed. """ from __future__ import absolute_import, unicode_literals import logging import socket import sys from billiard.einfo import ExceptionInfo from d...
''' The probabilistic ensemble dynamics model ''' # pylint: disable=C0103, R0902, R0913, W0201, E0401, E1120 import time import itertools import numpy as np import tensorflow as tf from tensorflow import keras from collections import defaultdict import os os.environ['KMP_DUPLICATE_LIB_OK']='True' class PEModel(ke...
### Figure S1 Obenhaus et al. # Panels: # B: FOV sizes # C: SNR ratios # D: Number of cells import sys, os import os.path from pathlib import Path import numpy as np import datajoint as dj # Make plots pretty from matplotlib import pyplot as plt import seaborn as sns sns.set(style='white') # Prevent bug in fi...
import click.core as core import click.decorators as decorators # manifest version that current library supports. _current_manifest_version = 1 class Manifest(object): """ Manifest is the plugin manifest whose content is essential for its hosting command. You might use the decorator "command.manifest" to annotat...
from abc import ABC import argparse import json from pathlib import Path import sys import matplotlib.tri as mtri import matplotlib.pyplot as plt from matplotlib import rc import numpy as np import ptg.bernstein_polynomial as bp """ $ conda active siblenv $ python view_bezier.py model_config.json e.g. $ python view_...
# -*- coding: utf-8 -*- import logging import numpy import matplotlib.ticker as mticker from matplotlib import pyplot from pylab import polyfit, poly1d logger = logging.getLogger('pylie') def plot_matrix(matrix, yaxis=None, xaxis=None, **kwargs): """ Prepare a matrix plot """ # Make new matplotlib...
from keras.layers import concatenate, Concatenate,UpSampling2D,LeakyReLU, MaxPooling2D,Dropout,Conv2D, Add, Conv2DTranspose,GlobalAveragePooling2D,Dense,Activation,multiply from keras.layers.normalization import BatchNormalization from keras.models import Model from keras import initializers, constraints, regularize...
# # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Generalized base classes for handling simple, yaml config files. The supported config file must: - have a "root" dictionary - each key value must be: - a simple type (bool, int, float, string), or - a list of simple types, or - a diction...
"""Copyright Amazon.com, Inc. or its affiliates. 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 ap...
# -*- coding: utf-8 -*- from __future__ import print_function import socket import struct import traceback # for print_stack, for debugging purposes: traceback.print_stack() import time import sys import numpy as np import logging #import matplotlib.pyplot as plt class CommsError(Exception): pass class Comm...
import logging import numpy as np import openpnm.models.misc as misc from openpnm.phase import GenericPhase as GenericPhase from openpnm.utils import SettingsAttr, Docorator, TypedList logger = logging.getLogger(__name__) docstr = Docorator() @docstr.dedent class MultiPhaseSettings: r""" Parameters ----...
import re from collections import namedtuple from typing import List, Dict, Tuple, Set from webdnn.backend.code_generator.allocator import MemoryLayout from webdnn.backend.code_generator.command_buffer import CommandBuffer from webdnn.backend.code_generator.injectors.buffer_injector import BufferInjector from webdnn.g...
from enum import Enum from parecer52_2017.config import settings from parecer52_2017.fichafuncional.ficha_funcional import FichaFuncional from parecer52_2017.portaldocente.portal_docente import PortalDocente from parecer52_2017.common.shared_code import Alerta from parecer52_2017.common.shared_code import formataPrint...
#! /usr/bin/python3 # # Copyright (c) 2018 Intel Corporation # # SPDX-License-Identifier: Apache-2.0 # """ Different utilities for PXE ~~~~~~~~~~~~~~~~~~~~~~~~~~~ Some parts of the system use PXE and this contains the implementations. """ import logging import os import subprocess import commonl import ttbl import t...
import json import tempfile import sys sys.path.append('oldtoronto') from nose.tools import eq_, ok_ # noqa from parameterized import parameterized # noqa from oldtoronto import geocode # noqa class MapsClientMock(object): def geocode(self, search_term): search_term_to_response = { 'Davenpor...
# Copyright 2020 Pants project contributors (see CONTRIBUTORS.md). # Licensed under the Apache License, Version 2.0 (see LICENSE). from __future__ import annotations from pathlib import PurePath from textwrap import dedent import pytest from packaging.utils import canonicalize_name as canonicalize_project_name from...
#!/usr/bin/env python3 import requests import json import httplib2 from dict2xml import dict2xml as xmlify from oauth2client.client import FlowExchangeError from oauth2client.client import flow_from_clientsecrets from database_setup import Base, Pets, PetSub, User from sqlalchemy.orm import sessionmaker from sqlalchem...
#!/usr/bin/env python3 # Copyright (c) Facebook, Inc. and its affiliates. # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. """ FAISS-based Indexers. Adapted from https://github.com/facebookresearch/DPR/blob/master/dpr/indexer/faiss_indexers.py...
from django.utils.translation import ugettext_lazy as _ from drf_queryfields import QueryFieldsMixin from dry_rest_permissions.generics import DRYPermissionsField from rest_framework import serializers from results.models.categories import CategoryForCompetitionType from results.models.results import Result, ResultPar...
# -*- coding: utf-8 -*- import os import sys import pytest import logging import importlib import py.path import six import procrunner import runpy import shlex import _pytest.fixtures as fixtures try: import libtbx.load_env except ImportError: libtbx = None from .fake_env import CustomRuntestsEnvironment #...
import logging import typing from typing import Any, List, Type from more_itertools import unique_everseen from six import iteritems from dbnd._core.configuration.config_path import ( CONF_CONFIG_SECTION, CONF_TASK_ENV_SECTION, CONF_TASK_SECTION, ) from dbnd._core.configuration.config_store import _Confi...
# -*- coding: utf-8 -*- """ Created on Mon Apr 24 17:12:02 2017 @author: ishort """ def getIonE(species): """// Ground state ionization energies in eV //From NIST Atomic Spectra Database //Ionization Energies Data """ #//<NAME>., <NAME>., <NAME>., and NIST ASD Team (2014). NIST Atomic Spectra Database (ver. 5....
""" creates triple leveraged simulated datasets going back to the earliest dates for indices currently does this for QQQ and SPY Before running this, should be in environment with zipline installed """ import os import pandas as pd import numpy as np import matplotlib.pyplot as plt from scipy.stats import trimboth f...
# some code taken from <NAME> at https://github.com/emorynlp/character-mining import os import json import glob from tqdm import tqdm from utils import untokenize, remove_notes_from_utt, remove_transcriber_notes, OPENERS, CLOSERS SEASON_ID = 'season_id' EPISODES = 'episodes' EPISODE_ID = 'episode_id' EPISODE = 'episo...
import fiona import pyproj import csv import rtree import geocoder from time import sleep from shapely.geometry import Point, shape, mapping, MultiLineString, LineString from matplotlib import pyplot import os from os.path import exists as path_exists import json from dateutil.parser import parse import datetime from ....
# Copyright (c) 2018 <NAME> # License: MIT License from typing import Iterable import pytest import math from ezdxf.math.linalg import ( Matrix, gauss_vector_solver, gauss_matrix_solver, gauss_jordan_solver, gauss_jordan_inverse, LUDecomposition, tridiagonal_vector_solver, tridiagonal_matrix_solver, ) @pytest...
# * This script uses Google Universal Sentence Encoder to find all content items that have an average # cosine similarity score of >0.65 to a tagging it has # * See if that content either can or _should_ be detagged from it's current tagging (if it is tagged to # two taxons, one of which is below the other, we can deta...
# Copyright (c) 2017 Trail of Bits, 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 ...
import math import os import sys import fontTools.designspaceLib as designspace import fontforge os.makedirs("build/masters_ufo", exist_ok=True) os.makedirs("/tmp/font-generation/", exist_ok=True) family_name = "Roland" slant_angle = 20 separation_width = 125 separation_kerning = 150 kern_touch = 1 axises = [ ...
# Copyright 2018,2019 by MPI-SWS and Data-ken Research. Licensed under Apache 2.0. See LICENSE.txt. """ Definition of configuration parameters """ import socket from typing import Dict, Callable, Any, Optional, Tuple, List, cast assert Dict assert Callable from os.path import isabs, expanduser, abspath, join import cl...
from util import Record, identity from util_np import np, partition from util_tf import tf, scope, placeholder, trim, Normalize, Smooth, Dropout, Embed, Conv, SepConv, Attention def causal_mask(t, name= 'causal_mask'): """returns the causal mask for `t` steps""" with scope(name): return tf.linalg.Line...
import datetime import os import sys import time import urllib import requests import json import numpy as np import pandas as pd from matplotlib import pyplot as plt from mpl_finance import candlestick_ohlc import matplotlib.dates as mdates from stock_analyzer import config def load_patterns() -> list: """A fun...
# ========== # Classes to abstract the interface between model parameters and GUI elements. # Do not run this file; import model.py and run from your file. # ========== from helipad.helpers import * from numpy import arange from itertools import combinations from numpy import random class Param(Item): def __init__(s...
#!/usr/bin/env python from __future__ import with_statement from __future__ import absolute_import from __future__ import print_function import os import sys import json import logging import datetime import functools # python 2 and 3 compatibility try: basestring # attempt to evaluate basestring def isstr(...
from itertools import product import math from Bio.Seq import reverse_complement from .constants import * ''' Single-base substitution categories ''' # Names def SBS_6_category_name(row): return SBS_category_name_helper('', row[COLNAME.REF.value], row[COLNAME.VAR.value], '', 0)[1:4] def SBS_12_category_name(row...
from data import * from utils.augmentations import SSDAugmentation from layers.modules import MultiBoxLoss from ssd import build_ssd import os import re import random import sys import time import warnings import torch from torch.autograd import Variable import torch.nn as nn import torch.optim as optim import torch.ba...
# Author Md <NAME> # Email: <EMAIL>, # <EMAIL> import operator import pickle import signal import socket import sys import threading from collections import namedtuple import time as T_T from time import time import custom_utils FREQUENCY = 15 CHECK_ROUTER_DEAD = 5 output_number = 1 PORT_RANGE = list(range(1...
import sys import os from scipy.integrate import solve_ivp as ivp sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__), '..'))) from math_helpers.constants import * from traj.meeus_alg import meeus from math_helpers.time_systems import cal_from_jd import conics def prop_2body(t, Y, mu): """2-...
#!/usr/local/bin/env python #============================================================================================= # MODULE DOCSTRING #============================================================================================= """ Test all test systems on different platforms to ensure differences in potenti...
from __future__ import print_function import keras.backend as K import keras.losses as losses import keras.optimizers as optimizers import numpy as np import tensorflow as tf from keras.layers.pooling import MaxPooling2D, AveragePooling2D from keras.layers.advanced_activations import LeakyReLU from keras.layers impor...
#!/usr/bin/env python3 """ Class which define the model and store the parameters """ import numpy as np import utils import vocabulary import pickle class Model: def __init__(self, filename=None, learningRate=0.1, randInitMaxValueNN=0.0001, regularisationTerm = 0.0001 ): ...
# This code is part of Qiskit. # # (C) Copyright IBM 2017, 2020. # # This code is licensed under the Apache License, Version 2.0. You may # obtain a copy of this license in the LICENSE.txt file in the root directory # of this source tree or at http://www.apache.org/licenses/LICENSE-2.0. # # Any modifications or derivat...
# -*- coding: utf-8; -*- from math import sqrt, acos, sin, cos import copy def intersection_l_l(x1,y1, x2,y2, x3, y3, x4, y4):#ntersection of vectors. Accepts coordinates of 2 lines, checks them for parallelism, if not parallel - looks for an intersection point, if there is one - returns its coordinates, otherwise retu...
#!/usr/bin/env python """models.py: get modeled data from WACCM-X runs.""" __author__ = "<NAME>." __copyright__ = "Copyright 2020, SuperDARN@VT" __credits__ = [] __license__ = "MIT" __version__ = "1.0" __maintainer__ = "<NAME>." __email__ = "<EMAIL>" __status__ = "Research" import sys sys.path.extend(["code/", "code...
import requests import json import re import os import sys import re import logging import codecs from html import unescape from lxml import etree from xylose import scielodocument from elixir import utils html_regex = re.compile(r'<body[^>]*>(.*)</body>', re.DOTALL | re.IGNORECASE) midias_regex = re.compile(r'href=[...
## pyKratos ## ## License: BSD License ## pyKratos default license: pyKratos/LICENSE ## ## Main authors: <NAME>, Technical University of Munich, Chair of Structural Analysis ## ## contributors: <NAME>, M.Sc., Technical University of Munich, Chair of Structural Analysis ## ## descripti...
import asyncio import inspect import base64 import random import time import math import io import os import re import matplotlib as mpl mpl.rcParams['text.usetex'] = True mpl.use('agg') from matplotlib import pyplot as plt from PIL import Image, ImageDraw, ImageOps, ImageChops from discord.ext import commands import...
# -*- coding: utf-8 -*- ####################################################################################### # # # This file is part of the updater4pyi Project. # # ...
#!/usr/bin/env python3 """ The bioscreen module analyzes and graphs growth curves from Bioscreen C data See example folder on GitHub for a step-by-step example and more in-depth documentation. ## Basic example # create new Experiment object import bioscreen expt = bioscreen.Experiment() # configure the ...
#!/usr/bin/env python # -*- coding: utf-8 -*- """Functions to deal with DeltaSigma profile calculation.""" import copy import multiprocessing import numpy as np from joblib import Parallel, delayed from astropy.table import Table from dsigma.stacking import excess_surface_density from dsigma.jackknife import add_co...
# Copyright 2019 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
from functools import lru_cache import argparse as _argparse import json as _json import os as _os __doc__ = """ Binarey (binary) is used to convert any file to a binary file. When converting a file to binary you can use a feature provided with the binarey module that allows you to decrease the character size of each ...
#import our library import copy import numpy as np import scipy.sparse import pandas as pd import matplotlib.pyplot as plt from sklearn.datasets import load_iris from sklearn.model_selection import train_test_split from sklearn import preprocessing from sklearn.metrics import accuracy_score #Zero_Ones Function for...
""" Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distri...
"""Specialized instance representations.""" import collections import hashlib import logging from pytype.abstract import _base from pytype.abstract import _instance_base from pytype.abstract import abstract_utils from pytype.abstract import function from pytype.abstract import mixin from pytype.pytd import pytd from ...
""" caproj.datagen ~~~~~~~~~~~~~~ This module contains functions for generating the interval metrics used in modeling for each unique capital project **Module variables:** .. autosummary:: endstate_columns endstate_column_rename_dict info_columns info_column_rename_dict **Module functions:** .. autosu...
import os import random import torch import numpy as np import torch.nn as nn from torch.autograd import Variable def seed_torch(seed=0): random.seed(seed) os.environ['PYTHONHASHSEED'] = str(seed) np.random.seed(seed) torch.manual_seed(seed) torch.cuda.manual_seed(seed) torch.backends.cudnn.det...
# Copyright (c) nexB Inc. and others. All rights reserved. # http://nexb.com and https://github.com/nexB/vulnerablecode/ # The VulnerableCode software is licensed under the Apache License version 2.0. # Data generated with VulnerableCode require an acknowledgment. # # You may not use this software except in compliance...
import logging from enum import Enum, unique from colorama import Fore from GramAddict.core.decorators import run_safely from GramAddict.core.device_facade import DeviceFacade, Timeout from GramAddict.core.plugin_loader import Plugin from GramAddict.core.resources import ClassName from GramAddict.core.resources impor...
"""N-dimensional arrays and utilities.""" # NOTE TODO: see https://rszalski.github.io/magicmethods/ from collections.abc import Iterable, Sequence, MutableSequence import sys, itertools class ShapeError(ValueError): """Invalid shape.""" class Shaped(object): """A multi-dimensional sequence, which records ...
# -*- coding: utf-8 -*- # Copyright 2016 Open Permissions Platform Coalition # 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...
import frida import time import os import sys import optparse import threading import codecs import shutil import tempfile import subprocess import re import fnmatch import shlex import subprocess import psutil import paramiko from paramiko import SSHClient from scp import SCPClient from tqdm import tqdm import traceb...
# # peppercornenumerator/output.py # EnumeratorProject # import logging log = logging.getLogger(__name__) import xml.dom.minidom from natsort import natsorted from itertools import chain from collections import Counter from . import __version__ from .utils import PeppercornUsageError def write_pil(enumerator, fh ...
#!/usr/bin/env python """ .. module:: ioObjects :synopsis: Definitions of input/output parameters which are read from parameter.in. .. moduleauthor:: <NAME> <<EMAIL>> .. moduleauthor:: <NAME> <<EMAIL>> .. moduleauthor:: <NAME> <<EMAIL>> """ import os, sys from smodels.theory import lheReader from smodels...
#!/usr/bin/env python3 # Copyright (c) 2014 <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, merg...
from collections import deque import sys, os sys.setrecursionlimit(100000) MOVIMIENTOS=["C11","C12","C21","C22","C31","C32","V11","V12","V21", "V22","V31","V32"] def list2str(lista): s="" for e in lista: s=s+e return s class nodo_estado: def __init__(self, EA, EP, A, n): ...
""" MS SQL Server database backend for Django. """ import datetime import os import re import sys from django.core.exceptions import ImproperlyConfigured try: import pyodbc as Database except ImportError: e = sys.exc_info()[1] raise ImproperlyConfigured("Error loading pyodbc module: %s" % e) pyodbc_ver =...
import copy import io, time from io import BytesIO from itertools import combinations, cycle, product import math import numpy as np import pandas as pd import pickle import tarfile import random import re import requests from scipy.sparse import hstack, lil_matrix from tqdm import tqdm pd.set_option('display.max_colu...
# ------------------------------------------------------------------------------ # Python API to access CodeHawk Java Analyzer analysis results # Author: <NAME> # ------------------------------------------------------------------------------ # The MIT License (MIT) # # Copyright (c) 2016-2018 Kestrel Technology LLC # #...
""" This file contains the implementation of the DeepDream algorithm. If you have problems understanding any parts of the code, go ahead and experiment with functions in the playground.py file. """ import argparse import shutil import time import cv2 import cv2 as cv import json import skimage import ut...
"""Post process a steady Turbostream solution""" import numpy as np import compflow_native as compflow import sys, os, json from ts import ts_tstream_reader, ts_tstream_cut Pref = 1e5 Tref = 300.0 # Choose which variables to write out varnames = ["x", "rt", "eff_lost", "pfluc"] class suppress_print: """A contex...
#!/usr/bin/env python # coding: utf-8 # In[1]: print('here') import numpy as np import scipy as sp import scipy.stats import itertools import logging import matplotlib.pyplot as plt import pandas as pd import torch.utils.data as utils import math import time import tqdm import torch import torch.optim as optim impor...
#!/usr/bin/env python3 from __future__ import print_function import logging import argparse import math import glob import sys import os import re class BaseLHEMerger(object): """Base class of the LHE merge schemes""" def __init__(self, input_files, output_file): self.input_files = input_files ...
import json import traceback from os import urandom from typing import List from Crypto.PublicKey import RSA from Cryptodome.Cipher import AES from flask import request from config.constants import ASYMMETRIC_KEY_LENGTH from config.settings import STORE_DECRYPTION_KEY_ERRORS, STORE_DECRYPTION_LINE_ERRORS f...
#!/usr/bin/env python3 # # This file is part of Tedium. # # Copyright (C) 2020 <NAME> <<EMAIL>> # SPDX-License-Identifier: BSD-3-Clause import os import subprocess from abc import ABCMeta, abstractmethod from nmigen import Signal, Module, ClockDomain, ClockSignal, Elaboratable, Instance, ResetSignal from nmigen.bui...
import sys print(sys.path) import csv import os from dcss_stats.core.dcss_data import jobs,species,get_short_specie,get_short_background from dcss_stats.morgue_downloader import DCSSDownloader,Server from pathlib import Path import pygubu from dcss_stats.game_stats import StatColumn,GameStats from dcss_stats.core impo...
# /usr/bin/env python3 """Generate Messages files from JSON Input Usage: generate-messages.py [options] <base-file> Where <base-file> is the base messages JSON file. Options describe the type of output: * --addition-file <file>: Add an additional JSON file to consider (TBD) * --json <file>: If --locale is specifi...
#!/usr/bin/env python3 # 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, softwar...
import os,re,time,asyncio import sys sys.path.append(os.path.abspath('../../tmp')) sys.path.append(os.path.abspath('.')) try: import aiohttp except Exception as e: print(e, "\n请更新pip版本:pip3 install --upgrade pip \n缺少aiohttp 模块,请执行命令安装: pip3 install aiohttp\n") exit(3) # 调试 # 京喜财富岛兑换100红包,看运气 # 59 59 * * ...
''' main.py ---------- <NAME> June 6, 2018 Given a company's landing page on Glassdoor and an output filename, scrape the following information about each employee review: Review date Employee position Employee location Employee status (current/former) Review title Number of helpful votes Pros text Cons text Advice t...
''' CoapObjectService creates a CoAP service endpoint at the specified port, based on the object pointer passed into the constructor ''' import socket import struct import logging import threading import json from socket import gethostname, getfqdn class CoapObjectService(object): def __init__(self, baseObject=N...
from django.shortcuts import render from django.http import HttpResponseRedirect from django.urls import reverse from django.contrib.auth.decorators import login_required from django.contrib.auth.models import User from applications.globals.models import (Designation, ExtraInfo, ...
from __future__ import absolute_import, division, print_function import warnings import numpy as np # from matplotlib import delaunay # import _iso # gc_dist = np.vectorize(lambda lon1, lat1, lon2, lat2: \ # GreatCircle(6378137.0, 6356752.3142, \ # lon1, lat1...
# bundlerepo.py - repository class for viewing uncompressed bundles # # Copyright 2006, 2007 <NAME> <<EMAIL>> # # This software may be used and distributed according to the terms of the # GNU General Public License version 2 or any later version. """Repository class for viewing uncompressed bundles. This provides a r...