text
stringlengths
1
927k
# coding: utf-8 # # Copyright 2019 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. A copy of the License is located at # # http://aws.amazon.com/apache2.0/ # # or in the "lice...
def new_user(user_stringvar): pass
# Export Nexus device show interface brief command output to # an Excel file import json import xlsxwriter from netmiko import ConnectHandler # Devices to SSH into devices = [ { "device_type": "cisco_nxos", "ip": "sbx-nxos-mgmt.cisco.com", "username": "admin", "password": "Admin_1...
#!/usr/bin/python # # Copyright 2011 Google Inc. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required b...
""" Format a DataSetInfo for use in a JSON Release """ import json from opendp_apps.dataset.models import DataSetInfo from opendp_apps.dataset import static_vals as dstatic from opendp_apps.model_helpers.basic_err_check import BasicErrCheck from opendp_apps.model_helpers.basic_response import ok_resp, err_resp, BasicRe...
import os import sys import importlib import argparse import csv import numpy as np import time import pickle import pathlib import gzip import tensorflow as tf import tensorflow.contrib.eager as tfe import svmrank import utilities from utilities_tf import load_batch_gcnn def load_batch_flat(sample_files, feats_t...
__author__ = 'vin@misday.com' import sys, re, os, wx from datetime import * from urlparse import urlparse from bs4 import BeautifulSoup from pyvin.spider import Spider from pyvin.core import Callbacks reload(sys) sys.setdefaultencoding('utf8') class Special(Callbacks): siteRoot = 'http://www.duokan.com' (...
# Copyright 2015 Pants project contributors (see CONTRIBUTORS.md). # Licensed under the Apache License, Version 2.0 (see LICENSE). import os import urllib from pants.java.distribution.distribution import DistributionLocator from pants.subsystem.subsystem import Subsystem class IvySubsystem(Subsystem): """Common c...
from pathlib import Path import nltk from nltk.tokenize import sent_tokenize tokenizer = nltk.RegexpTokenizer(r"([A-Z][A-Z0-9.]+|[0-9]+[,.][0-9]+|[cdjlmnst]'|qu'|[\w'-]+|\S)") class Sentence: def __init__(self, text, nth): self.text = text self.nth = nth def __len__(self): return le...
""" Compilation of functions used to make test cases """ import numpy as np import random pi=np.pi Debugger=0 def PlaneWavePacket(Amp,k,omega,theta,sigma,x,y,SNR,length): Vx=(omega/k)*np.cos(theta) Vy=(omega/k)*np.sin(theta) kx=k*np.cos(theta) ky=k*np.sin(theta) t=np.arange(length)-int(length/2) ...
import datetime import logging from rest_framework import status from rest_framework.authentication import BaseAuthentication from rest_framework.exceptions import APIException import seaserv from seahub.base.accounts import User from seahub.constants import GUEST_USER from seahub.api2.models import Token, TokenV2 fro...
from distutils.core import setup DESC='A simple, extensible chatbot for Matrix' setup( name='python-matrix-gfyrslf', version='0.1', author='Matt Stroud', author_email='see github', url='https://github.com/mstroud/python-matrix-gfyrslf', packages=['python-matrix-gfyrslf'], install_requires=...
from .bot import WorkerRushBot
from fastapi import FastAPI, Depends, Form from fastapi.security import HTTPBasic, HTTPBasicCredentials from starlette.templating import Jinja2Templates from starlette.requests import Request from starlette.responses import RedirectResponse from datetime import datetime, timedelta import db import hashlib from mycalen...
#!/usr/bin/env python """ findUnannotated.py Author: Tony Papenfuss Date: Fri Aug 15 12:19:24 EST 2008 """ import os, sys from bx.intervals.intersection import * from fasta import FastaFile from blast import BlastFile from useful import progressMessage print "Load Solexa contigs & store as Intervals in an Interse...
# # Copyright (c) 2009, Novartis Institutes for BioMedical Research Inc. # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions of source code must retain the above copyri...
import numpy as np def compute_anomaly_corrs(out_true, out_pred): anomaly_corrs = np.zeros(out_pred.shape[1]) for i in range(anomaly_corrs.size): anomaly_corrs[i] = np.corrcoef(out_pred[:,i], out_true[:,i])[0,1] return anomaly_corrs def split_train_data(train_months, test_months, tra...
# -*- coding: utf-8 -*- """Gzip compressed stream file.""" # Note: do not rename file to gzip.py this can cause the exception: # AttributeError: 'module' object has no attribute 'GzipFile' # when using pip. import collections import os from dtfabric.runtime import fabric as dtfabric_fabric from dfvfs.compression im...
# -*- coding: utf-8 -*- # # Copyright (c) 2015, Alcatel-Lucent Inc, 2017 Nokia # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # * Redistributions of source code must retain the above copyrigh...
# -*- coding: utf-8 -*- import numpy as np from graphviz import Source import matplotlib matplotlib.use('agg') import matplotlib.pyplot as plt from dku_error_analysis_mpp.dku_error_analyzer import DkuErrorAnalyzer from mealy import _BaseErrorVisualizer, ErrorAnalyzerConstants from dku_error_analysis_utils import safe_s...
#!/usr/bin/python # -*- coding: utf-8 -*- import base64 import httplib import json from config import * from base.log import * import happybase from base.timer import Timer from base import util __thrift_host = GET_CONF('hbase_thrift', 'host') __thrift_port = int(GET_CONF('hbase_thrift', 'port')) thrift_conn = None...
# Copyright (c) 2012-2016 Seafile Ltd. import posixpath from rest_framework import status from rest_framework.authentication import SessionAuthentication from rest_framework.permissions import IsAuthenticated from rest_framework.response import Response from rest_framework.views import APIView from django.utils.trans...
print("Hello, Python!") print("Zoltan") #print(Zoltan) #print "Zoltan" print('Zoltan') print(''' Alma on the tree ''' )
r"""JSON (JavaScript Object Notation) <http://json.org> is a subset of JavaScript syntax (ECMA-262 3rd edition) used as a lightweight data interchange format. :mod:`json` exposes an API familiar to users of the standard library :mod:`marshal` and :mod:`pickle` modules. It is derived from a version of the externally m...
import requests, json, os import argparse import pandas as pd import ijson import time # Elasticsearch python libs from elasticsearch import Elasticsearch from elasticsearch import helpers directory = "" indexName = "aurora-meta2" typeName = "patient" THRESHOLD = 10000 # this regulates how much data gets loaded the...
import logging import copy import bisect import numpy as np import torch.utils.data from smoke.utils.comm import get_world_size from smoke.utils.imports import import_file from smoke.utils.envs import seed_all_rng from . import datasets as D from . import samplers from .transforms import build_transforms from .colla...
import argparse def add_common_args(parser: argparse.ArgumentParser): parser.add_argument( '--dry-run', action='store_true', default=False, help='If true, will not actually do any changes to i3 workspaces.') parser.add_argument( '--log-level', choices=('debug', ...
import jpype import jpype.imports from jpype.types import * from neqsim.neqsimpython import neqsim processoperations = neqsim.processSimulation.processSystem.ProcessSystem() def stream(thermoSystem, name="stream ?", t=0, p=0): if t != 0: thermoSystem.setTemperature(t) if p != 0: thermo...
# 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 th...
# -*- coding: utf-8 -*- from anima.ui.lib import QtCore, QtWidgets class TaskDashboardWidget(QtWidgets.QWidget): """A widget that displays task related information """ def __init__(self, task=None, parent=None, **kwargs): self._task = None self.parent = parent super(TaskDashboa...
import numpy as np import torch import matplotlib.pyplot as plt import os import math import scipy.stats as stats import lsdr.envs.environment_sampler as env_sampler from enum import IntEnum ############################ # Optimization Loss Opt ############################ class Objectives(IntEnum): REWARDS = 1 ...
# -*- coding: utf-8 -*- """Pitz Daily This case uses the pitzDaily example from the OpenFOAM tutorials and varies two parameters: Reynolds number and height of the inlet. It returns the pressure difference between inlet and outlet. """ import numpy as np from active_learning_cfd.cfd_case import CFDCase import os ...
import torch from torch import nn from torch.nn import CrossEntropyLoss import logging from .bert_model import BertPreTrainedModel, BertPreTrainingHeads, BertModel, BertEncoder, BertPooler, BertLayerNorm logger = logging.getLogger(__name__) class DualPositionBertEmbeddings(nn.Module): """Construct the embedding...
# 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. # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may ...
"""deny tests""" from django.urls import reverse from authentik.core.tests.utils import create_test_admin_user, create_test_flow from authentik.flows.markers import StageMarker from authentik.flows.models import FlowDesignation, FlowStageBinding from authentik.flows.planner import FlowPlan from authentik.flows.tests i...
import argparse import json import os from blanc import BlancHelp, BlancTune def main(args): kwargs = json.loads(args.kwargs) device = "cpu" if args.device == -1 else "cuda" if args.type == "tune": blanc = BlancTune(device=device, random_seed=args.random_seed, **kwargs) elif args.type == "hel...
import tvm import numpy as np from tvm import relay from tvm.relay.testing import run_infer_type, gradient def get_lenet(batch_size, num_classes=10, image_shape=(1, 28, 28), dtype="float32"): """Get lenet funciton Parameters ---------- batch_size : int The b...
import sqlite3 mystore=sqlite3.connect('bookstores.db') mycursor=mystore.cursor() sql=''' create table book (id integer primary key not null,title text(20), author text(20),price real);''' mycursor.execute(sql) sql='''insert into book values(1,'think java','rhooney',550.0);''' mycursor.execute(sql) mystore.commit() s...
# Copyright 2020 The FedLearner 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...
import pytest from year_2020.day13.shuttle_search import ( get_bus_id_times_wait_time, get_earliest_bus_and_wait_time_for_airport, get_shuttle_company_solution, ) TEST_INPUT = """ 939 7,13,x,x,59,x,31,19 """ TEST_INPUT_2 = """ 0 17,x,13,19 """ TEST_INPUT_3 = """ 0 67,7,59,61 """ TEST_INPUT_4 = """ 0 67...
import numpy as np import matplotlib.pyplot as plt import scipy.sparse as sparse import sys sys.path.append("..") from Laplacian import * def getCirculantAdj(N, lags): #Setup circular parts I = range(N)*(len(lags)+2) J = range(1, N+1) + range(-1, N-1) J[N-1] = 0 J[N] = N-1 for lag in lags: ...
# tempfile.py unit tests. import tempfile import os import sys import re import errno import warnings import unittest from test import support warnings.filterwarnings("ignore", category=RuntimeWarning, message="mktemp", module=__name__) if hasattr(os, 'stat'): impo...
import numpy as np ######################################## ### Polyphony --- discarded ######################################## def polyphony_level_diff(roll_output,roll_target): poly_output = np.sum(roll_output,axis=0) poly_target = np.sum(roll_target,axis=0) poly_diff = np.abs(poly_output-poly_target...
# Copyright 2019 Huawei Technologies Co., Ltd # # 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...
"""Support for MQTT fans.""" from __future__ import annotations import asyncio import functools import logging import math import voluptuous as vol from homeassistant.components import fan from homeassistant.components.fan import ( ATTR_OSCILLATING, ATTR_PERCENTAGE, ATTR_PRESET_MODE, FanEntity, F...
import functools def dict_cmp(x, y, key): if str(x[key]) > str(y[key]): return 1 elif str(x[key]) < str(y[key]): return -1 else: return 0 def sort_dict(dictionary, cmp_func): arr = [] for key in dictionary: arr.append((key, dictionary[key])) arr.sort(key=fu...
from annofabapi.models import ( AdditionalDataDefinitionType, AnnotationDataHoldingType, AnnotationType, InternationalizationMessage, TaskPhase, TaskStatus, ) AnnotationData = Union[str, Dict[str, Any]] FullAnnotationData = Any AdditionalDataValue = Dict[str, Any]
"""Support for Epson projector.""" from __future__ import annotations import logging from epson_projector.const import ( BACK, BUSY, CMODE, CMODE_LIST, CMODE_LIST_SET, DEFAULT_SOURCES, EPSON_CODES, FAST, INV_SOURCES, MUTE, PAUSE, PLAY, POWER, SOURCE, SOURCE_...
''' Get 6 integer numbers and show the sum of the even ones. Do not consider the odd ones. ''' sum_number = 0 for count in range(0, 6): number = int(input('Choose a number: ')) if number % 2 == 0: sum_number += number print(f'The sum of all even numbers equals {sum_number}')
# Lint as: python3 # Copyright 2019 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or ag...
# Copyright (c) 2013-2014 Will Thames <will@thames.id.au> # # 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...
# (C) Datadog, Inc. 2016-present # All rights reserved # Licensed under Simplified BSD License (see LICENSE) import re import time from collections import Counter, defaultdict from copy import deepcopy from six import iteritems from datadog_checks.checks.openmetrics import OpenMetricsBaseCheck from datadog_checks.co...
import urllib.request from datetime import datetime import string from argparse import ArgumentParser import gspread from oauth2client.service_account import ServiceAccountCredentials from bs4 import BeautifulSoup from sortedcontainers import SortedDict class StockPriceScraper: def __init__(self, base_url, stoc...
# -*- coding: utf-8 -*- import json from bitsharesbase import operations from bitsharesbase.asset_permissions import ( asset_permissions, force_flag, test_permissions, todict, ) from .blockchainobject import BlockchainObject from .exceptions import AssetDoesNotExistsException from .instance import Bloc...
#!/usr/bin/env python '''This module exposes function timelimited and two classes TimeLimited and TimeLimitExpired. Function timelimited can be used to invoke any callable object with a time limit. Class TimeLimited wraps any callable object into a time limited callable with an equivalent signatu...
# Copyright 2020 The FedLearner 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...
# 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 __...
""" This file is for models creation, which consults options and creates each encoder and decoder accordingly. """ import re import torch import torch.nn as nn from torch.nn.init import xavier_uniform_ import onmt.inputters as inputters import onmt.modules from onmt.encoders.rnn_encoder import RNNEncoder from onmt.enc...
"""Convert a .wav file to .csv Uses the `wave` package to convert a .wav file to a .csv. Assumes that the file is monoaural (one channel). Be sure to edit the code to point to correct values of `inFileName` and `outFileName` """ import wave import numpy inFileName = "../data/pingpong.wav" outFileName = '../data/pi...
#! /usr/bin/env python from os.path import dirname, realpath, join from setuptools import setup, find_packages import sys #### # Basic project info. #### project_name = 'short-con' package_name = project_name.replace('-', '_') repo_name = project_name description = 'Constants collections without boilerplate' url...
# 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...
# Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may...
from .cli import main if __name__ == '__main__': main()
import os import os.path as osp import numpy as np import torch import torch.nn as nn import torch.optim as optim import torchvision.transforms as T from torch.utils.data import DataLoader from tensorboardX import SummaryWriter from data.segmentation import SegmentDataset from model.segmentation.fcn import FCN32 from...
""" This module provides the functionality to create the temporal SQL database and to establish a connection to the database. Usage: .. code-block:: python >>> import grass.temporal as tgis >>> # Create the temporal database >>> tgis.init() >>> # Establish a database connection >>> dbif, connecte...
import logging import os import re from pathlib import Path from typing import Any from mdscript.files_dependencies_manager import FilesDependenciesManager from mdscript.watcher import Watcher class Runner: def __init__(self, config: Any, base_dirpath: str): self.config = config self.base_dirpath...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # Copyright 2018, Kevin Laeufer <ekiwi@berkeley.edu> # Generates the `dut.hpp` file which contains dut specific interface code # from the TOML dut description file. import os, sys, argparse import toml template = """ // This file was generated from {conf_toml} using th...
# -*- coding:utf-8 -*- """ Author: Weichen Shen,wcshen1994@163.com Reference: [1] Zhou G, Zhu X, Song C, et al. Deep interest network for click-through rate prediction[C]//Proceedings of the 24th ACM SIGKDD International Conference on Knowledge Discovery & Data Mining. ACM, 2018: 1059-1068. (https://arxiv.org/...
from deeplab3.evaluators.segmentation_evaluator import SegmentationEvaluator def make_evaluator(cfg, num_classes): if cfg.EVALUATOR.NAME == "segmentation": return SegmentationEvaluator(num_classes) else: raise ValueError("Model not implemented: {}".format(cfg.EVALUATOR.NAME))
from django.contrib.auth import get_user_model from django.db import models User = get_user_model() class ClientConnection(models.Model): ip = models.CharField(max_length=50, default="xxx", blank=True, null=True) url = models.CharField(max_length=512, default="xxx", blank=True, null=True) timestamp = mod...
from manimlib.imports import * from old_projects.eola.chapter5 import get_det_text from old_projects.eola.chapter8 import * class OpeningQuote(Scene): def construct(self): words = TextMobject( "From [Grothendieck], I have also learned not", "to take glory in the ", "di...
from ..wallet import * from _coin import * from ..bip32 import Bip32 from blockchain._insight import InsightBlockchainInterface from blockchain._interface import MultiBlockchainInterface from impl._segwitcoin import * class BTC(SegwitCoin): def __init__(self,is_testnet=False): #self.supported=True if(not is_test...
from pyspark.sql import SparkSession from pyspark.sql.functions import explode,split,desc,max from pyspark.sql.types import * from pyspark.sql.types import StringType, StructType, StructField spark = SparkSession \ .builder \ .appName("StructuredStreaming") \ .getOrCreate() inputpath="hdfs://localhost:9000...
import json import os import re import unittest from collections import Counter from datetime import datetime from unittest import mock from xml.dom import pulldom from django.test import TestCase, override_settings from wagtail.core.models import Page from example.models import Category from wagtail_wordpress_import...
# 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. # # Code generated by Microsoft (R) AutoRest Code Generator. # Changes ...
# coding: utf-8 """ Pure Storage FlashBlade REST 1.8.1 Python SDK Pure Storage FlashBlade REST 1.8.1 Python SDK, developed by [Pure Storage, Inc](http://www.purestorage.com/). Documentations can be found at [purity-fb.readthedocs.io](http://purity-fb.readthedocs.io/). OpenAPI spec version: 1.8.1 Cont...
#!/usr/sfw/bin/python # -*- coding: utf-8 -*- #C:\python27\python.exe C:\Dropbox\Work\2012ExpressionsComposees\CreateGraph.py import sys, os, re, string, time from math import * #------------------------------ # Chargement des paramètres #------------------------------ args={} i=1; selectedRelations = {} selectedRel...
from handlers.common import Common class SR(Common): _type = "SR" def __init__(self, xapi, ref=None, params=None): super().__init__(xapi, ref, params)
#!/usr/bin/python import sys import csv #first arg: input file, csv. column woe_id should be the list of woe_ids we want to pull out of photos.txt #second arg: output file, txt subset of photos.txt (also remove photoid. samplr not expecting it) def main(): infile = sys.argv[1] outfile = sys.argv[2] phot...
import asyncio import hashlib import json import sys import traceback from typing import Union, TYPE_CHECKING import base64 from electrum.plugin import BasePlugin, hook from electrum.crypto import aes_encrypt_with_iv, aes_decrypt_with_iv from electrum.i18n import _ from electrum.util import log_exceptions, ignore_exc...
from scipy.spatial import cKDTree from .base import Structure class KDTree(cKDTree, Structure): def __init__(self, *, points, leafsize=16, compact_nodes=False, balanced_tree=False): Structure.__init__(self, points=points) self._leafsize = leafsize self._compact_nodes = compact_nodes ...
import tensorflow as tf import cv2 import numpy as np model = tf.keras.models.load_model('saved_model/model_3.h5') face_clsfr = cv2.CascadeClassifier('haarcascade_frontalface_default.xml') source = cv2.VideoCapture(1) labels_dict = {0: 'with_mask', 1: 'without_mask'} color_dict = {0: (0, 255, 0), 1: (0, 0, 255)} wh...
import cv2 import os import time import subprocess #from matplotlib import pyplot as plt import numpy as np #from test_video import get_predictions_results #cam_capture = cv2.VideoCapture(0) #cv2.destroyAllWindows() """ TODO: 1. Start video at specified time 2. Right click to indicate trimming points 3. Output file n...
"""Test cltk.tag.""" import os import shutil import unittest from cltk.corpus.utils.importer import CorpusImporter from cltk.stem.latin.j_v import JVReplacer from cltk.tag import ner from cltk.tag.ner import NamedEntityReplacer from cltk.tag.pos import POSTag __license__ = 'MIT License. See LICENSE.' class TestSeq...
# -*- coding: utf-8 -*- # ---------------------------------------------------------------------- # Copyright © 2010, RedJack, LLC. # All rights reserved. # # Please see the LICENSE.txt file in this distribution for license # details. # ----------------------------------------------------------------------
import asyncio import logging import pathlib import signal import socket import time from typing import Dict, List import pkg_resources from hddcoin.util.hddcoin_logging import initialize_logging from hddcoin.util.config import load_config from hddcoin.util.default_root import DEFAULT_ROOT_PATH from hddcoin.util.setp...
#!K:\2018_SS\BMW_Thesis\workspace_bmw\Thesis_KG_Agnostic_EL\scripts\venv\Scripts\python.exe # EASY-INSTALL-ENTRY-SCRIPT: 'setuptools==39.1.0','console_scripts','easy_install-3.7' __requires__ = 'setuptools==39.1.0' import re import sys from pkg_resources import load_entry_point if __name__ == '__main__': sys.argv[...
#!/usr/bin/env python # encoding=utf-8 from inspect import getblock import json import os from os import read from numpy.core.fromnumeric import mean import numpy as np import paddlehub as hub import six import math import random import sys from util import read_file from config import Config # 配置文件 conf = Config() c...
""" AWR + SAC from demo experiment """ from rlkit.demos.source.dict_to_mdp_path_loader import DictToMDPPathLoader from rlkit.launchers.experiments.awac.awac_rl import experiment, process_args import rlkit.misc.hyperparameter as hyp from rlkit.launchers.arglauncher import run_variants from rlkit.torch.sac.policies im...
import pandas as pd import csv from builelib import airconditioning import pytest import json import xlrd ### テストファイル名 ### # 辞書型 テスト名とファイル名 testcase_dict = { "AHU_basic": "./tests/airconditioning/★空調設備テストケース一覧.xlsx", } def convert2number(x, default): ''' 空欄にデフォルト値を代入する ''' if x == "": x ...
## # EPITECH PROJECT, 2019 # MoviePi # File description: # utils.py ## import datetime import jwt from moviepiapi.dbHelper import dbHelper from moviepiapi.userHelper import userHelper ret_packet = {'responseStatus': 0, 'message': "", 'data': any} Key = 'MoviePiTheoAudreyHicham' LEN_MAX_USER = 255 db = dbHelper('movi...
#! /usr/bin/env python import roslib; roslib.load_manifest('basics') import rospy import actionlib from basics.msg import TimerAction, TimerGoal, TimerResult rospy.init_node('timer_action_client') client = actionlib.SimpleActionClient('timer', TimerAction) client.wait_for_server() goal = TimerGoal() goal.time_to_wait...
#!/usr/bin/env python # -*- coding: utf-8 -*- import numpy as np from obspy.geodetics.base import gps2dist_azimuth from gmprocess.waveform_processing.clipping.clipping_ann import clipNet from gmprocess.waveform_processing.clipping.max_amp import Max_Amp from gmprocess.waveform_processing.clipping.histogram import Hi...
#!/usr/bin/env python2 # -*- coding: utf-8 -*- ################################################## # GNU Radio Python Flow Graph # Title: Combination of two signal sources # Author: Alexandros-Apostolos A. Boulogeorgos # Generated: Tue Nov 5 13:35:41 2019 ################################################## if __name__ ...
from flask import Flask from marshmallow import Schema, fields, pre_load, validate from flask_marshmallow import Marshmallow from flask_sqlalchemy import SQLAlchemy from flask_redis import FlaskRedis ma = Marshmallow() db = SQLAlchemy() redis_cache = FlaskRedis() class FoodModel(db.Model): __tablename__ = 'foods'...
# 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 fro...
#!/usr/bin/env python3 # FileName:orm.py # -*- coding: utf-8 -*- """ 通过元类实现简单的ORM框剪 """ class Field(object): def __init__(self, name, column_type): self.name = name self.column_type = column_type def __str__(self): return '<%s:%s>' % (self.__class__.__name__, self.name) class Intege...
#!/usr/bin/env python3 """ (C) Copyright 2018-2022 Intel Corporation. SPDX-License-Identifier: BSD-2-Clause-Patent """ import re def extract_redundancy_factor(oclass): """Extract the redundancy factor from an object class. Args: oclass (str): the object class. Returns: int: the redu...
# (c) 2012-2019, Ansible by Red Hat # # This file is part of Ansible Galaxy # # Ansible Galaxy is free software: you can redistribute it and/or modify # it under the terms of the Apache License as published by # the Apache Software Foundation, either version 2 of the License, or # (at your option) any later version. # ...
import os try: import configparser except ImportError: import ConfigParser as configparser from . import appdirs cwd = os.path.split(os.path.abspath(__file__))[0] userdir = appdirs.user_data_dir("pycortex", "JamesGao") usercfg = os.path.join(userdir, "options.cfg") # Read defaults from pycortex repo config = ...