text
stringlengths
2
999k
import random from numpy.random import choice # TABLES table_a = ['Potion of healing', 'Spell scroll (cantrip)', 'Potion of climbing', 'Spell scroll (1st level)', 'Spell scroll (2nd level)', 'Potion of healing (greater)', 'Bag of holding', 'Driftglobe'] table_b = ['Potion of healing (greater)',...
# pyinfra # File: pyinfra/modules/server.py # Desc: the base os-level module ''' The server module takes care of os-level state. Targets POSIX compatibility, tested on Linux/BSD. ''' from __future__ import unicode_literals import six from six.moves import shlex_quote from pyinfra.api import operation from . import...
from django.shortcuts import get_object_or_404, render_to_response, redirect from django.template import RequestContext from django.utils.translation import ugettext as _ from django.http import HttpResponseRedirect, HttpResponse from django.conf import settings from form_designer import settings as app_settings from d...
__author__ = "alien10086" __license__ = "MIT" __version__ = "0.0.1"
"""freenet_passlib_170.ext.django.utils - helper functions used by this plugin""" #============================================================================= # imports #============================================================================= # core from functools import update_wrapper, wraps import logging; log...
""" filename: _smash_gadget.py Author: ww9210 try different copy_from_user gadget to perform stack smash :) """ import traceback import colorama from IPython import embed from .state_filters import * class SmashGadgetMixin: def explore_state_for_second_fork_site(self, good_disclosure_state): """ e...
from uuid import UUID import pytest @pytest.mark.django_db class TestSCMPipelineRunViewSet: def test_list_queued_pipelines( self, client, logged_in_user, application, queued_scm_pipeline_run, scm_releases_with_multi_pipeline_runs ): response = client.get("/queued-scm-pipeline-runs/?applicatio...
#!/usr/bin/env python # -*- coding: utf-8 -*- # Author: Pradeep Jairamani , github.com/pradeepjairamani import socket import socks import time import json import threading import string import random import sys import struct import re import os from OpenSSL import crypto import ssl from core.alert import * from core.t...
#!/usr/bin/env python import sys from matplotlib import pyplot as plt import numpy as np import csv from datetime import datetime, timezone import pytz def main(): if len(sys.argv) != 2: print("usage: ./graph.py [path_to_csv]") exit(1); arr = np.empty((0,5), dtype="float") times = [] w...
#!/usr/bin/env python3 # Allowed imports by project requirements from hashlib import md5 from _md5 import md5 import os import sys # Magic number for the start and end of JPG, PNG, and PDF files FILE_MARKERS = {'jpg': (b'\xFF\xD8', b'\xFF\xD9'), 'png': (b'\x89\x50\x4E\x47\x0D\x0A\x1A\x0A', b'\x49\x45\...
# # PySNMP MIB module CISCO-CONTACT-CENTER-APPS-MIB (http://snmplabs.com/pysmi) # ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/CISCO-CONTACT-CENTER-APPS-MIB # Produced by pysmi-0.3.4 at Mon Apr 29 17:36:27 2019 # On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4 # Using Python ve...
import discord import os import re from fyodor.discord_bot import commands class DiscordBotClient(object): def __init__(self, client_id=None): self.client = discord.Client() self.command_dispatcher = commands.Dispatcher() def is_mentioned(message, client_id): return client_i...
#!/usr/bin/env python # -*- coding: utf-8 -*- """Verify position management-related commands execute successfully.""" import time import pytest from stepseries import commands, responses from stepseries.step400 import STEP400 @pytest.mark.skip_400_disconnected @pytest.mark.reset_400_device class TestPositionMana...
tank = "\N{SHIELD}" healer = "\N{AMBULANCE}" dps = "\N{SKULL}" stam_dps = "\N{CROSSED SWORDS}" mag_dps = "\N{FIRE}" edit = "\N{HAMMER AND WRENCH}" crown = "\N{CROWN}" ping = "\N{HEAVY EXCLAMATION MARK SYMBOL}" emojis = { "tank": tank, "healer": healer, "dps": dps, "stam_dps": stam_dps, "mag_dps": m...
from flask import Blueprint from flask import render_template views = Blueprint(__name__,"views") @views.route("/") def home(): return render_template("index.html") @views.route("/get-question") def get_question(): return render_template("get-question.html") @views.route("/post-question") def post_question(...
from __future__ import absolute_import, division, print_function import os import itertools import zipfile import numpy as np import scipy.sparse as sp from rareflow.datasets.core import maybe_download_data, Dataset _MOVIELENS_CONFIG = { 'URL_PREFIX': 'http://files.grouplens.org/datasets/movielens/', 'URL_100K...
# coding=utf-8 # *** WARNING: this file was generated by the Pulumi SDK Generator. *** # *** Do not edit by hand unless you're certain you know what you are doing! *** import warnings import pulumi import pulumi.runtime from typing import Any, Mapping, Optional, Sequence, Union from .. import _utilities, _tables from ...
from sympy import Basic from sympy.strategies.branch.traverse import top_down, sall from sympy.strategies.branch.core import do_one, identity def inc(x): if isinstance(x, int): yield x + 1 def test_top_down_easy(): expr = Basic(1, 2) expected = Basic(2, 3) brl = top_down(inc) assert set...
from couplib.autoarr import AutoArr from couplib.myreportservice import * #from couplib.vrrotmat2vec import Vrrotmat2Vec from couplib.parselist import ParseList import numpy as np import math import copy from configuration import * from interfaces import AtomInterface from interfaces import ExciteStateInterface from ...
import json import numpy as np import cv2 import matplotlib.image as mpimg class CImgProcessor(): def __init__(self): self.__nx = 9 self.__ny = 6 self.__cam_mtx = None self.__dist_coeff = None self.__unwraped_mat = None self.__wraped_mat = None self.__img_size...
import pytest from django.conf import settings from django.core.exceptions import ValidationError from rest_framework.exceptions import \ ValidationError as RestFameworkValidationError from ..models import Question, QuestionSet from ..serializers.v1 import QuestionSerializer from ..validators import QuestionUnique...
from django.test import TestCase from base import models class TaskModel(TestCase): def setUp(self): self.task = models.Task.objects.create(title='Test Task') def testStr(self): self.assertEqual( str(self.task), 'Test Task', )
# coding=utf-8 # -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # -----------------------------------------------------...
""" Details about the built-in battery. For more details about this platform, please refer to the documentation at https://home-assistant.io/components/sensor.linux_battery/ """ import logging import os import voluptuous as vol from homeassistant.components.sensor import PLATFORM_SCHEMA from homeassistant.const impo...
# Copyright 2017 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 wri...
import collections import logging import numpy as np import platform import random from typing import List, Dict # Import ray before psutil will make sure we use psutil's bundled version import ray # noqa F401 import psutil # noqa E402 from ray.rllib.execution.segment_tree import SumSegmentTree, MinSegmentTree from...
# coding=utf-8 # *** WARNING: this file was generated by the Pulumi SDK Generator. *** # *** Do not edit by hand unless you're certain you know what you are doing! *** import warnings import pulumi import pulumi.runtime from typing import Any, Mapping, Optional, Sequence, Union, overload from ... import _utilities __...
# Handles plotting of results after simulation has been run and data written to storage. import argparse import random import cPickle as pickle import matplotlib.colors as mcolors import matplotlib.pyplot as plt import numpy as np import utilities as util from pyNN.utility.plotting import Figure, Panel # Constants DI...
import datamart from io import BytesIO import json import os import pandas as pd from pprint import pprint import requests import zipfile import sys import csv searchInput = str(sys.argv[1]) url = 'http://dsbox02.isi.edu:9000/new/search_data' dirname = os.path.dirname(__file__) data = os.path.join(dirname, '../../sta...
# Copyright 2015 Mirantis, 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 ...
import cv2 import numpy as np import torch import torch.nn as nn import torch.nn.functional as F from torch.autograd import Variable class CrossEntropyLoss2d(nn.Module): def __init__(self, weight=None, size_average=True, ignore_index=255, reduce=True): super(CrossEntropyLoss2d, self).__init__() se...
# -*- coding: utf-8 -*- # Form implementation generated from reading ui file 'UpdateUi.ui' # # Created by: PyQt5 UI code generator 5.13.0 # # WARNING! All changes made in this file will be lost! from PyQt5 import QtCore, QtGui, QtWidgets class Ui_Dialog(object): def setupUi(self, Dialog): Dialog.setObj...
######################################################################################################################## # !/usr/bin/env python3 # -*- coding: utf-8 -*- import sys if sys.version_info[0] < 3: raise EnvironmentError("Hey, caveman, use Python 3.") __doc__ = \ """ ddG calculation for variants...
#!/usr/bin/env python # This script uploads a plugin package on the server # # Author: A. Pasotti, V. Picavet import xmlrpclib import sys import os import getpass from optparse import OptionParser # Configuration PROTOCOL = 'https' SERVER = 'plugins.qgis.org' PORT = '443' ENDPOINT = '/plugins/RPC2/' VERBOSE = False ...
# -*- coding: utf-8 -*- # PLEASE DO NOT EDIT THIS FILE, IT IS GENERATED AND WILL BE OVERWRITTEN: # https://github.com/ccxt/ccxt/blob/master/CONTRIBUTING.md#how-to-contribute-code from ccxt.async_support.base.exchange import Exchange # ----------------------------------------------------------------------------- try...
#!c:\users\rakshit\pycharmprojects\pythonproject1\venv\scripts\python.exe # $Id: rst2html4.py 7994 2016-12-10 17:41:45Z milde $ # Author: David Goodger <goodger@python.org> # Copyright: This module has been placed in the public domain. """ A minimal front end to the Docutils Publisher, producing (X)HTML. The output ...
#!/usr/bin/env python -*- coding: utf-8 -*- import argparse import mxnet as mx if __name__ == "__main__": parser = argparse.ArgumentParser(formatter_class=argparse.ArgumentDefaultsHelpFormatter) parser.add_argument('--old', '-o', required=True, help='path to old parameters') parser.add_argument('--new', '...
import dash_bootstrap_components as dbc from dash import html toast = dbc.Toast( [html.P("This is the content of the toast", className="mb-0")], header="This is the header", )
# -*- coding: utf-8 -*- # PLEASE DO NOT EDIT THIS FILE, IT IS GENERATED AND WILL BE OVERWRITTEN: # https://github.com/ccxt/ccxt/blob/master/CONTRIBUTING.md#how-to-contribute-code from ccxt.async_support.base.exchange import Exchange import math from ccxt.base.errors import ExchangeError from ccxt.base.errors import A...
from pathlib import Path from jinja2 import Template import copy import typer from pydantic import BaseModel, Field from typing import Optional import yaml from ...utils.factory import PipelineFactory, NodeModelFactory, PipelineBase, DataFactory from ...utils.base_model import EarlyStopConfig, DeviceEnum from ...utils....
# This Python file uses the following encoding: utf-8 """autogenerated by genpy from vrep_common/simRosCopyPasteObjectsRequest.msg. Do not edit.""" import sys python3 = True if sys.hexversion > 0x03000000 else False import genpy import struct class simRosCopyPasteObjectsRequest(genpy.Message): _md5sum = "185cb01118...
"""Module to provide random sample from finite collections of objects, using sampling with replacement or sampling without replacement. Method has consistency in relative sampling order when sampling a subset or superset of objects. We thus call this sampling method 'consistent sampling'. Very similar to implementat...
#!/usr/bin/env python3 """ Defines functions for interacting with headless browser sessions. """ import os import shutil from pathlib import Path from selenium import webdriver from selenium.common.exceptions import WebDriverException import se def initialize_selenium_firefox_webdriver() -> webdriver: """ Initial...
# -*- coding: utf-8 -*- # # Copyright (c) 2018 Hewlett Packard Enterprise Development LP # # 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 # # Unl...
import cStringIO import os import glob import errno from collections import OrderedDict import bdd_test_util def testCoverage(): #First save the coverage files saveCoverageFiles("coverage","scenario_1", ["bddtests_vp0_1","bddtests_vp1_1","bddtests_vp2_1","bddtests_vp3_1",], "cov") # Now collect the file...
import numbers import functools import numpy as np import theano import theano.tensor as T fX = theano.config.floatX np_fX = np.dtype(fX) def as_fX(x): """ convert input to value with type floatX """ if isinstance(x, (float, numbers.Integral)): return np.array(x, dtype=fX) elif isinstanc...
from django.conf import settings from django.contrib.sites.models import Site from rest_framework import serializers from rest_framework_nested.serializers import NestedHyperlinkedModelSerializer from orochi.users.api.serializers import ShortUserSerializer from orochi.website.models import Dump, ExtractedDump, Plugin,...
"""Objects and tools used for the selections from the database. - Selection - SelectionItem - Model """ from silly_db.exceptions import SillyDbError from silly_db.helpers import color, insert_to_sql class Selection: """Object returned by the DB.select method, it contains the result of the query in a convenie...
from __future__ import absolute_import, print_function, division import unittest from pony.orm.core import * from pony.orm.tests import setup_database, teardown_database db = Database() class Person(db.Entity): name = Required(unicode) friends = Set('Person', reverse='friends') class TestSymmetricM2M(unit...
#!/usr/bin/env python3 from http.server import BaseHTTPRequestHandler, HTTPServer class Respond(BaseHTTPRequestHandler): def _set_headers(self): self.send_response(200) self.send_header('Content-type', 'text/html') self.end_headers() def do_GET(self): self._set_headers() ...
# -*- coding: UTF-8 -*- """ 使用captcha lib生成验证码(前提:pip install captcha) """ from captcha.image import ImageCaptcha import os import random import time import json def gen_special_img(text, file_path, width, height): # 生成img文件 generator = ImageCaptcha(width=width, height=height, font_sizes=(30,)) # 指定大小 im...
# Required packages import tensorflow as tf import numpy as np import pickle import os, sys, time from itertools import product import matplotlib.pyplot as plt #plt.switch_backend('agg') # For remote plot generation # Model modules from parameters import * import omniglot_stimulus as stimulus import ...
# Copyright 2022 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...
""" Predicts which tiles are of good quality in WBS. Usage: python3 quality_control.py --help """ import argparse from tqdm import tqdm import tensorflow as tf from tensorflow import keras from glob import glob from quality_net_utilities import * from image_generator import * n_channels = 3 if __name__ == "__m...
import unittest from cerberus import Validator class TestCerberus(unittest.TestCase): def test_should_enforce_simple_schema(self): yaml = {"name": "john doe"} schema = {"name": {"type": "string"}} Validator(schema).validate(yaml) def test_should_allow_nested_data(self): yaml = {"outer_dict": {"inner_dict":...
import signal import sys from typing import List from .cursor import Cursor class Status: """ Shows the status of multiple jobs and updates their individual status. """ cursor: Cursor lines: List[str] def __init__(self, lines: List[str]): self.cursor = Cursor() self.lines = li...
import os.path as osp import os import numpy as np def mkdirs(d): if not osp.exists(d): os.makedirs(d) seq_root = '/data/yfzhang/MOT/JDE/MOT20/images/train' label_root = '/data/yfzhang/MOT/JDE/MOT20/labels_with_ids/train' mkdirs(label_root) seqs = [s for s in os.listdir(seq_root)] tid_curr = 0 tid_last...
import unittest from compilation_builder.packager import PackagerConfig import os class BaseTestCase(unittest.TestCase): """ Basic compilation of reusable test compononets """ def setUp(self): # get the current directory of this test file self.test_directory = os.path.dirname(os.path....
from heapq import heappush, heappop, heapify from collections import defaultdict import math def encode(symb2freq): """Huffman encode the given dict mapping symbols to weights""" heap = [[wt, [sym, ""]] for sym, wt in symb2freq.items()] heapify(heap) while len(heap) > 1: lo = heappop(h...
#!/usr/bin/env python ############################################################################## ## # This file is part of Sardana ## # http://www.sardana-controls.org/ ## # Copyright 2011 CELLS / ALBA Synchrotron, Bellaterra, Spain ## # Sardana is free software: you can redistribute it and/or modify # it under th...
""" =========== Plot Format =========== Global plot formatting options. Goal is to produce IEEE journal compatible figures easily. Each plot format setting set in this file can be overriden in individual plots, or by setting the respective rcParams again. Reference: https://matplotlib.org/3.1.1/tutorials/introducto...
from chainer import cuda def bbox_iou(bbox_a, bbox_b): """Calculate the Intersection of Unions (IoUs) between bounding boxes. IoU is calculated as a ratio of area of the intersection and area of the union. This function accepts both :obj:`numpy.ndarray` and :obj:`cupy.ndarray` as inputs. Please ...
# Copyright 2015 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...
"""empty message Revision ID: 13e7f8e7bcf8 Revises: a6b1cfd945f2 Create Date: 2021-05-14 23:00:10.459326 """ # revision identifiers, used by Alembic. revision = '13e7f8e7bcf8' down_revision = 'a6b1cfd945f2' from alembic import op import sqlalchemy as sa import sqlalchemy_utils import app import app.extensions d...
""" This is just a sample code. LevelLoader should be rewritten to be game specific. You need to define which ObjectMgr, ObjectHandler, ObjectPalette, ProtoPalette would be used by importing section. Then declare them in initLoader function. You also need to define defaultPath in initLoader function, too. """ import...
import os import subprocess import tempfile from pytest_ngrok.install import install_bin from pytest_ngrok.plugin import REMOTE_URL def test_install(): bin_path = tempfile.mktemp() install_bin(bin_path, remote_url=REMOTE_URL) assert os.path.exists(bin_path) ver = subprocess.check_output([bin_path, 'v...
import itertools import logging from bidict import bidict, ValueDuplicationError default_logger = logging.getLogger('socketio') class BaseManager(object): """Manage client connections. This class keeps track of all the clients and the rooms they are in, to support the broadcasting of messages. The data...
""" Created on 16 Nov 2016 @author: Bruno Beloff (bruno.beloff@southcoastscience.com) https://raspberrypi.stackexchange.com/questions/2086/how-do-i-get-the-serial-number """ import os import re import socket from pathlib import Path from subprocess import check_output, call, Popen, PIPE, DEVNULL from scs_core.esta...
# -*- coding: utf-8 -*- # ============================================================================== # This source file is part of SBEMimage (github.com/SBEMimage) # (c) 2018-2020 Friedrich Miescher Institute for Biomedical Research, Basel, # and the SBEMimage developers. # This software is licensed under ...
# MK Jul 2016 import logging.config logging.config.fileConfig('logging.conf') logger = logging.getLogger('runner') import os import ConfigParser import subprocess from db.Apps import Apps from db.CodeAnalysis import CodeAnalysis from db.Drozer import Drozer # initialize configuration parser config = ConfigParser.R...
import sys sys.path.append('../') from src.vops import scraping from src.vops import graphing tickerSymbol = 'AMD' contractName = 'AMD201231C00060000' # optionObj = scraping.scrapePutOptions(tickerSymbol) optionObj = scraping.scrapeCallOptions(tickerSymbol) # graphing.graphLongPut(optionObj, contractName) # graph...
import _plotly_utils.basevalidators class VisibleValidator(_plotly_utils.basevalidators.BooleanValidator): def __init__(self, plotly_name="visible", parent_name="bar.error_x", **kwargs): super(VisibleValidator, self).__init__( plotly_name=plotly_name, parent_name=parent_name, ...
from django.contrib import admin from shared_schema_tenants_custom_data.forms import TenantSpecificModelForm from shared_schema_tenants_custom_data.models import ( TenantSpecificTable, TenantSpecificFieldDefinition, TenantSpecificTableRow, TenantSpecificFieldsValidator) class TenantSpecificModelAdmin(admin.ModelA...
import requests import os import re import json import math from . import config import time from pathlib import Path from datetime import datetime, date import pandas as pd import gzip import boto3 import aiohttp import asyncio import functools # Properties of each vehicle as stored by opentransit-collector, # used f...
import x256
#!/usr/bin/env python import webbrowser TEST_BROWSERS = set([ # 'mozilla', 'firefox', # 'netscape', # 'galeon', # 'epiphany', # 'skipstone', # 'kfmclient', # 'konqueror', # 'kfm', # 'mosaic', # 'opera', # 'grail', # 'links', # 'elinks', # 'lynx', # 'w3m...
__all__ = ['FeatureGen', 'ProtFeat'] from Feature_Extract import FeatureGen from Feature_Extract import ProtFeat
from java.lang import Boolean from java.lang import String from javax.swing.table import DefaultTableModel class ScannerTableModel(DefaultTableModel): def getColumnClass(self, col): return [Boolean, String, String, String, String][col] def isCellEditable(self, row, col): return col == 0
import random from reinvent_chemistry import TransformationTokens from reinvent_chemistry.library_design import BondMaker, AttachmentPoints from reinvent_chemistry.conversions import Conversions from typing import List, Optional import numpy as np import scipy.stats as sps from reinvent_models.model_factory.generative...
#!/usr/bin/python # Copyright (c) 2014 Hewlett-Packard Development Company, L.P. # Copyright (c) 2013, Benno Joy <benno@ansible.com> # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from __future__ import absolute_import, division, print_function __metaclass__ = type ANSI...
import multiprocessing as mp class Treasury: def __init__(self, balance): # TODO add Vault/Strategy class self.balance = balance # initialize a multipleprocessing Queue to hold the simulated results across different processors self.simulation_result_queue = mp.Queue() def ge...
import os import sys import pytest def pytest_addoption(parser): parser.addoption( "--skip_slow", action="store_true", default=False, help="Will skip all the slow marked tests. Slow tests are arbitrarily marked as such.", ) parser.addoption( "--show_diff", ...
# Top-level location of all checks so that they can easily be located from .register.nc_coords_checks_register import * from .register.nc_var_checks_register import * from .register.nc_file_checks_register import * from .register.format_checks_register import * from .register.file_checks_register import * ALL...
# coding: utf-8 """ Isilon SDK Isilon SDK - Language bindings for the OneFS API # noqa: E501 OpenAPI spec version: 5 Contact: sdk@isilon.com Generated by: https://github.com/swagger-api/swagger-codegen.git """ import pprint import re # noqa: F401 import six class FtpSettingsSettings(object...
# copyright (c) 2020 PaddlePaddle Authors. All Rights Reserve. # # 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 applic...
"""alexis_blog URL Configuration The `urlpatterns` list routes URLs to views. For more information please see: https://docs.djangoproject.com/en/2.2/topics/http/urls/ Examples: Function views 1. Add an import: from my_app import views 2. Add a URL to urlpatterns: path('', views.home, name='home') ...
# Generated by Django 2.2.6 on 2019-11-18 02:53 import uuid from django.db import migrations, models class Migration(migrations.Migration): dependencies = [("users", "0003_data_migration__fill_uuid_fields")] operations = [ migrations.AlterField(model_name="user", name="uuid", field=models.UUIDField...
# -*- coding: utf-8 -*- import argparse import os import shutil from github import Github MD_HEAD = """## ssh 的博客 大家好,我是 ssh,现在在字节跳动的 Web Infra 担任前端工程师,微信:**[sshsunlight](https://p1-juejin.byteimg.com/tos-cn-i-k3u1fbpfcp/017d568dc1d14cd883cc3238350a39ec~tplv-k3u1fbpfcp-watermark.image)**,欢迎找我交个朋友。 我会在公众号「前端从进阶到入院」每日...
# coding: utf-8 """ mParticle mParticle Event API OpenAPI spec version: 1.0.1 Contact: support@mparticle.com Generated by: https://github.com/swagger-api/swagger-codegen.git Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance wit...
from __future__ import print_function from function.realtime import * from function.video import * import argparse import os os.environ['TF_CPP_MIN_LOG_LEVEL'] = '2' if __name__ == '__main__': # construct the argument parse and parse the arguments ap = argparse.ArgumentParser() ap.add_argument("-n", ...
import sys sys.path.append('..') import numpy as np ###################################################################################### # sample times, etc ###################################################################################### ts_simulation = 0.02 # smallest time step for simulati...
# -*- coding: utf-8 -*- """ parsescrapegenerate.main -------------------- Main entry point for ParseScrapeGenerate. """ import feedparser import time from . import __title__, __version__ from .feed import get_feed def parse(feed): """ Parse the given feed. """ return feedparser.parse(feed) def scr...
import os,re version_h = os.path.join(os.path.dirname(__file__), '..', 'src', 'version.h') f = open(version_h) for line in f: if re.match('#define NUBJS_MAJOR_VERSION', line): major = line.split()[2] if re.match('#define NUBJS_MINOR_VERSION', line): minor = line.split()[2] if re.match('#define NUBJ...
import subprocess, shlex def process_command_line(cmd): if not isinstance(cmd, list): cmd = shlex.split(cmd) return cmd def check_output(cmd): cmd = process_command_line(cmd) return subprocess.check_output(cmd) def check_call(cmd): cmd = process_command_line(cmd) return subprocess.che...
# Upload the most recent .nd file to elabftw # Run it in a journal on MM at end of acquisition # put config file in same folder as script: config.yml with endpoint and token import os import sys import elabapy import datetime import operator import yaml print("Uploading the .nd file to elabftw. Stay put.") ...
# Copyright (c) 2016-present, Facebook, Inc. # # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. # pyre-strict import ast import glob import logging import os from typing import Callable, Iterable, Optional, Set, Tuple, Union from .model impo...
from .likelihood_to_evidence import LikelihoodToEvidenceRatioEstimatorMLP from .likelihood_to_evidence import LikelihoodToEvidenceRatioEstimatorNeuromodulatedMLP from .mutual_information import MutualInformationRatioEstimatorMLP from .mutual_information import MutualInformationRatioEstimatorNeuromodulatedMLP
# -*- mode: python; coding: utf-8; indent-tabs-mode: nil; python-indent: 2 -*- # # $Id$ """Toolbox for images from the Cornell SLAC Pixel Array Detector (CSpad). XXX Better named cspad_common? XXX Read out detector temperature (see Hart et al., 2012)? """ from __future__ import division from six.moves import range ...
"""A class for downloading event data from Open Catalogs.""" import codecs import json import os import re import shutil import webbrowser from collections import OrderedDict from difflib import get_close_matches from astrocats.catalog.utils import is_number from six import string_types from mosfit.printer import Pri...
from sb3_contrib.iqn.policies import CnnPolicy, MlpPolicy, MultiInputPolicy from sb3_contrib.iqn.iqn import IQN