text
stringlengths
2
999k
import logging LOG_LEVELS = { '0': logging.ERROR, '1': logging.WARNING, '2': logging.INFO, '3': logging.DEBUG, } def pytest_configure(config): logging.basicConfig( level=LOG_LEVELS.get(config.option.verbose, logging.DEBUG))
import numpy as np from math import * from numpy import median # empirical mean : def empirical(X): return np.mean(X) # Catoni estimator : def catoni(X): n = len(X) delta = 0.002 var = np.var(X) if var == 0: var = 10 ** (-5) s = sqrt(var * n / log(2 / delta)) # scaling parameter ...
# Copyright 2012 OpenStack Foundation # 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 requ...
""" Reading Demo Employees File Adapt the following variables: DBID, FNR MULTIFETCH > 1 : use Multifetch (experimental) $Date: 2008-08-29 18:20:18 +0200 (Fri, 29 Aug 2008) $ $Rev: 75 $ """ # Copyright 2004-2008 Software AG # # Licensed under the Apache License, Version 2.0 (the "License"); # you...
#!/usr/bin/env python """ Should always be faithful duplicate of sequence/BioReaders.py Duplicated here for tofu installation. This one is called via cupcake.io.BioReaders. """ import re, sys from collections import namedtuple Interval = namedtuple('Interval', ['start', 'end']) class...
# Copyright The PyTorch Lightning team. # # 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 i...
"""Python Enumerations""" import sys as _sys __all__ = ['Enum', 'IntEnum', 'unique'] pyver = float('%s.%s' % _sys.version_info[:2]) try: any except NameError: def any(iterable): for element in iterable: if element: return True return False try: from collectio...
# 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 ...
from setuptools import setup from codecs import open from os import path HERE = path.abspath(path.dirname(__file__)) with open(path.join(HERE, 'README.md'), encoding='utf-8') as f: long_description = f.read() setup( name="Pyticle-Swarm", version="1.0.7", description="PSO library", long_descript...
# qubit number=2 # total number=4 import cirq import qiskit from qiskit import IBMQ from qiskit import QuantumCircuit, QuantumRegister, ClassicalRegister from qiskit import BasicAer, execute, transpile from pprint import pprint from qiskit.test.mock import FakeVigo from math import log2,floor, sqrt, pi import numpy as...
from typing import Iterable from apiron.endpoint.endpoint import Endpoint class StreamingEndpoint(Endpoint): """ An endpoint that streams data incrementally """ streaming = True def format_response(self, response) -> Iterable[bytes]: """ Stream response in chunks :param...
# -*- coding: utf-8 -*- """Sphinx directive to support embedded IPython code. This directive allows pasting of entire interactive IPython sessions, prompts and all, and their code will actually get re-executed at doc build time, with all prompts renumbered sequentially. It also allows you to input code as a pure pytho...
# Copyright 2020 Google Research. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law...
## 1. Introduction ## import sqlite3 conn = sqlite3.connect("factbook.db") query_plan_one = conn.execute("explain query plan select * from facts where population > 1000000 and population_growth < 0.05;").fetchall() print(query_plan_one) ## 2. Query plan for multi-column queries ## conn = sqlite3.connect("factbook.db...
# -*- coding: utf-8 -*- import poloniex import time import datetime import numpy as np import matplotlib.pyplot as plt def main(): date, data = getDataPoloniex() fig = plt.figure() ax = fig.add_subplot(111) ax.plot(date, data) ax.set_title("BTC Price") ax.set_xlabel("Day") ax.set_ylabel("B...
from glumpy import app, gloo, gl filestream = open('vertex_program.glsl') program_vertex = str(filestream.readlines()) filestream.close() filestream = open('fragment_program.glsl') program_fragment = str(filestream.readlines()) window = app.Window() quad = gloo.Program(program_vertex, program_fragment, count=4) q...
import numpy as np import matplotlib as mpl transforms = mpl.transforms from string import lowercase def pair(val): """ Return the input as a list of two values if it is a scalar. """ if np.isscalar(val): return [val] * 2 if len(val) == 1: return [val[0], val[0]] return val d...
# Copyright 2021 IBM 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 writing, ...
"""Generated message classes for logging version v1beta3. Writes log entries and manages your Stackdriver Logging configuration. """ # NOTE: This file is autogenerated and should not be edited by hand. from googlecloudsdk.third_party.apitools.base.protorpclite import messages as _messages from googlecloudsdk.third_pa...
load("@rules_cc//cc:defs.bzl", "cc_library") def _file_name(filePathName): if "/" in filePathName: return filePathName.rsplit("/", -1)[1] else: return filePathName def _base_name(fileName): return fileName.split(".")[0] def qt_cc_library(name, src, hdr, uis = [], res = [], normal_hdrs = [...
import requests import logging import subprocess import psutil TIMEOUT = 5 MAX_TRY = 3 def get_commodity_data(country_code, commodity_code="TOTAL", year=2013, classification="S1"): """ get_commodity_data returns the comtrade data in json format for the given parameters Args: country_code (int): c...
# Copyright (C) 2015 Google Inc., authors, and contributors <see AUTHORS file> # Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file> # Created By: miha@reciprocitylabs.com # Maintained By: miha@reciprocitylabs.com from integration.ggrc.converters import TestCase class TestImportUpdates(TestC...
# coding: utf-8 # Copyright (c) 2016, 2022, Oracle and/or its affiliates. All rights reserved. # This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may c...
from ...utils import PluginRegistry from ..data import (MaxRowsError, curry, default_data_transformer, limit_rows, pipe, sample, to_csv, to_json, to_values) # ============================================================================== # VegaLite 1 data transformers # ===========================...
""" Django settings for exhibitly project. Generated by 'django-admin startproject' using Django 1.11. For more information on this file, see https://docs.djangoproject.com/en/1.11/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/1.11/ref/settings/ """ import os...
#!/usr/bin/env python3 # Copyright (c) Meta Platforms, Inc. and affiliates. # # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. # pyre-strict from dataclasses import dataclass @dataclass class PackageInfo: package_name: str version: s...
# -*- coding: utf-8 -*- from __future__ import division import os import pandas as pd import random import sys import math from collections import defaultdict import shutil import numpy as np import resource #from selection10 import blupf90 WorkingDir = "/home/jana/Documents/PhD/CompBio/TestingGBLUP/" rounds = [int(i)...
# coding: utf-8 # Distributed under the terms of the MIT License. """ This file implements plotting routines specifically for the PXRD objects defined in the matador.fingerprints.pxrd module. """ from matador.plotting.plotting import plotting_function from matador.utils.cell_utils import get_space_group_label_latex...
import os import sys import numpy as np import zipfile import urllib.request import shutil import logging this_dir = os.path.dirname(__file__) APP_ROOT_DIR = os.path.join(this_dir,'..') if APP_ROOT_DIR not in sys.path: sys.path.append(APP_ROOT_DIR) ROOT_DIR = os.path.join(APP_ROOT_DIR,'..') BASE_PATH_CFG = os.pat...
from collections import defaultdict def merge_dict(*dicts): d = defaultdict(dict) for dd in dicts: for k, v in dd.items(): d[k] = v return d
#!/usr/bin/env python3 import json import logging import os import re import sys from collections import namedtuple from typing import List import requests import wget Media = namedtuple('Media', 'source_type url') logging.basicConfig(level=logging.INFO) image_counter = 0 video_counter = 0 def download_content(uid...
#!/usr/bin/env python3 # Generate category pages # TODO in Nikola v8: rename Compiler → PageCompiler (#2543) categories = ['Command', 'CommentSystem', 'CompilerExtension', 'ConfigPlugin', 'LateTask', 'Compiler', 'PostScanner', 'ShortcodePlugin', 'SignalHandler', 'Task', 'TaskMultiplier', 'TemplateSystem', 'MetadataExtr...
np.ceil(a)
#!/usr/bin/python # -*- coding: utf-8 -*- """ Copyright (c) Contributors to the Open 3D Engine Project. For complete copyright and license terms please see the LICENSE at the root of this distribution. SPDX-License-Identifier: Apache-2.0 OR MIT """ import sys import os from clr import * sys.path.append("..") import te...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ author: xiaoran """ import os import utils utils.start(__file__) os.system('python -u 1_feature.py') os.system('python -u 2_feature.py') os.system('python -u 3_feature.py') os.system('python -u 4_feature.py') os.system('python -u 5_feature.py') os.system('python -u...
from .Elemento import * class integradorTriangular(Elemento): def __init__(this,coords,gdl=None,gauss=7): super().__init__(coords=coords,gdl=gdl,gauss=7) DENSIDAD = 3 trimesh = meshDeFigura([[0,0],[1,0],[0,1]],n=DENSIDAD,dev=False) this._dominioNaturalZ = trimesh.x this._domi...
# SPDX-License-Identifier: Apache-2.0 import sys import unittest import numpy import pandas from pyspark.ml.feature import ElementwiseProduct from pyspark.ml.linalg import Vectors from onnx.defs import onnx_opset_version from onnxconverter_common.onnx_ex import DEFAULT_OPSET_NUMBER from onnxmltools import convert_spar...
# -*- coding: utf-8 -*- import os import sys CURRENT_DIRECTORY = os.path.abspath(os.path.dirname(os.path.realpath(__file__))) sys.path.append(CURRENT_DIRECTORY) sys.path.append(os.path.dirname(CURRENT_DIRECTORY)) import time import helics as h import pytest as pt from test_init import createBroker, createValueFeder...
"""ASCE 7 exceptions""" class ASCE7Error(Exception): pass
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations import django.utils.timezone class Migration(migrations.Migration): dependencies = [ ] operations = [ migrations.CreateModel( name='User', fields=[ ('...
import random import warnings from collections import OrderedDict from functools import wraps from typing import Any, Callable, Generator, Iterator, List, Optional import torch from torch.utils.data import DataLoader from torch.utils.data.sampler import BatchSampler from ignite.engine.engine import Engine from ignite...
#!python3.8 # https://pynsist.readthedocs.io/en/latest/cfgfile.html#application-section import sys, os, time, signal import logging import site import csv import ctypes, ctypes.wintypes from threading import Lock from pynput import keyboard # pip install pynput from win10toast import ToastNotifier # pip install win10t...
__all__ = ('CHANNEL_TYPE_MAP', 'cr_pg_channel_object', 'create_partial_channel_from_data', 'create_partial_channel_from_id') from datetime import datetime import warnings from scarletio import export, include from ..bases import maybe_snowflake from ..core import CHANNELS from ..utils import datetime_to_timestam...
from unittest import mock, TestCase from ......messaging.decorators.attach_decorator import AttachDecorator from ...message_types import ATTACH_DECO_IDS, CREDENTIAL_REQUEST, PROTOCOL_PACKAGE from ..credential_request import CredentialRequest class TestCredentialRequest(TestCase): """Credential request tests"""...
import threading import uuid from threading import Thread from typing import Callable import kombu from kombu import Connection from kombu.mixins import ConsumerMixin from kombu.pools import connections, producers # setting consumer class from event import handler_register from event.messages import MsgEvent from eve...
# -*- coding: utf-8 -*- import requests from .exceptions import AuthException, ResourceException class Client(object): def __init__(self, url): self.url = url def __getattr__(self, name): setattr(self, name, Api(self, name)) return self[name] def __getitem__(self, name): ...
# -*- coding: utf-8 -*- # Copyright 2019, IBM. # # This source code is licensed under the Apache License, Version 2.0 found in # the LICENSE.txt file in the root directory of this source tree. """Base TestCases for provider and backends.""" from .backend import BackendTestCase from .provider import ProviderTestCase
from .store_data_supplier import store_data from .filter_by_supplier import filter_by_supplier
import cv2 import numpy as np from matplotlib import pyplot as plt # loading image img0 = cv2.imread('images/flower.jpg',) # converting to gray scale gray = cv2.cvtColor(img0, cv2.COLOR_BGR2GRAY) # remove noise img = cv2.GaussianBlur(gray,(3,3),0) # convolute with proper kernels laplacian = cv2.Laplacian(img,cv2.CV...
# https://www.hackerrank.com/challenges/diagonal-difference n = int(input().strip()) primary = 0 secondary = 0 for a_i in range(n): a_temp = list(map(int, input().strip().split(' '))) primary += a_temp[a_i] secondary += a_temp[- a_i - 1] print(abs(primary - secondary))
#!/usr/bin/env python3 import argparse import sys import textwrap from enum import Enum, unique try: from delta import configure_spark_with_delta_pip from pyspark.sql import SparkSession except ModuleNotFoundError: print(textwrap.dedent("""\ This script requires pyspark and delta-spark. You can ins...
from urllib.parse import urljoin from flask import current_app from server.apis.base_api import BaseApi class AlphaVantageUrl: def __init__(self, root): self.root = root def make(self, *args): return urljoin(self.root, *args) def query(self): return self.make("/query") class Al...
# Copyright 2018 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...
# Generated by Django 2.2 on 2020-06-21 14:23 from django.db import migrations class Migration(migrations.Migration): dependencies = [ ('api', '0002_auto_20200621_1421'), ] operations = [ migrations.AlterModelOptions( name='twisteduser', options={'verbose_name_pl...
import sys from config import MILVUS_HOST, MILVUS_PORT, VECTOR_DIMENSION, METRIC_TYPE from pymilvus import connections, FieldSchema, CollectionSchema, DataType, Collection, utility from logs import LOGGER class MilvusHelper: """ Helper class for Milvus """ def __init__(self): try: ...
# coding=utf-8 # test for https://github.com/RDFLib/rdflib/issues/446 from rdflib import Graph, URIRef, Literal def test_sparql_unicode(): g = Graph() trip = ( URIRef('http://example.org/foo'), URIRef('http://example.org/bar'), URIRef(u'http://example.org/jörn') ) g.add(trip) ...
"""Main flow""" from time import sleep from typing import Tuple from spotipy import Spotify from clients.postgres import PostgresClient from clients.spotify import init_spotify_client from models.ops import Status, PipelineStatus from models.db import is_playcount_list from tasks.db import check_counted, count_new_tr...
from UniqueConfiguration import UniqueConfiguration from command_args import get_args, get_optional_arg, get_mandatory_arg, get_mandatory_arg_no_print, is_true, get_mandatory_arg_validated, get_optional_arg_validated class AwsUniqueConfiguration(UniqueConfiguration): def __init__(self, args, suffix): super...
from graphql_relay.node.node import from_global_id from parameterized import parameterized from cinemanio.core.models import Genre, Country, Language, Role from cinemanio.api.tests.base import QueryBaseTestCase class PropertiesQueryTestCase(QueryBaseTestCase): @parameterized.expand([ (Genre, 'genres'), ...
# -*- coding: utf-8 -*- """Some utility functions.""" # Authors: Alexandre Gramfort <alexandre.gramfort@inria.fr> # # License: BSD (3-clause) from collections import OrderedDict from copy import deepcopy import logging import json import numpy as np from .check import _check_pandas_installed, _check_preload, _valida...
""" Set an artificial mass loss rate at a specific point in the stellar evolution using MESA and calculate the effect this has on the stellar radius. """ import numpy from amuse.units import units from amuse.datamodel import Particle, Particles from amuse.support.console import set_printing_strategy from ...
import unittest from app.models import User class UserModelTest(unittest.TestCase): ''' Tests to confirm password hashing ''' def setUp(self): self.new_user = User(password = 'danmark') ''' This creates an instance of the User class object and passes in a password property to be...
"""config URL Configuration The `urlpatterns` list routes URLs to views. For more information please see: https://docs.djangoproject.com/en/3.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') Class-based ...
from core import decorators from languages.getLang import languages from core.utilities.functions import delete_message_reply from core.utilities.message import message @decorators.admin.user_admin @decorators.bot.check_is_admin @decorators.bot.check_can_delete @decorators.delete.init def init(update,context): lan...
import os import torch import torch.nn.functional as F from torch_geometric.datasets import Planetoid import torch_geometric.transforms as T import math import numpy as np from torch import autograd from torch.nn import Sequential, Linear, ReLU, BatchNorm1d as BN from torch_geometric.nn import GINLafConv, GINConv cla...
# 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...
import argparse from attrdict import AttrDict from deriva.core import ErmrestCatalog, get_credential, DerivaPathError import deriva.core.ermrest_model as em from deriva.core.ermrest_config import tag as chaise_tags from deriva.utils.catalog.manage.update_catalog import CatalogUpdater, parse_args groups = { 'pbccon...
import logging from asyncio import AbstractEventLoop from functools import partial from typing import (Dict, Set) from aiohttp import ClientSession from aiohttp.web import Application from observable.config import PACKAGE_NAME from .handlers import subscribe from .middlewares import middleware_fac...
# -*- coding: utf-8 -*- # vim: sw=4:ts=4:expandtab """ riko.modules.fetchsitefeed ~~~~~~~~~~~~~~~~~~~~~~~~~~ Provides functions for fetching the first RSS or Atom feed discovered in a web site. Uses a web site's auto-discovery information to find an RSS or Atom feed. If multiple feeds are discovered, only the first on...
#!/usr/bin/env python3 # encoding: utf-8 # # Copyright (c) 2019 SAP SE or an SAP affiliate company. All rights reserved. # # This file is part of ewm-cloud-robotics # (see https://github.com/SAP/ewm-cloud-robotics). # # This file is licensed under the Apache Software License, v. 2 except as noted # otherwise in the LIC...
"""pyshgp.push.instructions.""" from typing import Sequence, Set from itertools import chain from pyshgp.push.type_library import PushTypeLibrary from pyshgp.push.instruction import Instruction from pyshgp.push.instructions import common, numeric, text, code, io, logical def _supported(instructions: Sequence[Instruc...
#!/usr/bin/env python from subprocess import (PIPE, Popen) from sys import stdout, stdin, stderr import cv2 import time import sys import rospy from std_msgs.msg import String proc_list = [] def invoke(command): proc = Popen(command, shell=True, stdin=stdin, stdout=stdout, stderr=stderr) proc_list.append(proc) def ...
from .prisoners_dilemma import IteratedPrisonersDilemma # Aliases IPD = IteratedPrisonersDilemma
"""Test Home Assistant date util methods.""" from __future__ import annotations from datetime import datetime, timedelta import pytest import homeassistant.util.dt as dt_util DEFAULT_TIME_ZONE = dt_util.DEFAULT_TIME_ZONE TEST_TIME_ZONE = "America/Los_Angeles" @pytest.fixture(autouse=True) def teardown(): """S...
"""Stg URL Configuration The `urlpatterns` list routes URLs to views. For more information please see: https://docs.djangoproject.com/en/4.0/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') Class-b...
#!/usr/bin/env python3 """ Example to run pyprof with imagenet models. """ import sys import torch import torch.nn as nn import torchvision.models as models import torch.cuda.profiler as profiler import argparse from apex import pyprof from apex.optimizers import FusedAdam def parseArgs(): parser = argparse.Argume...
# tzuhao solution for zerojudge a034(binary) while True: try: dec=int(input()) index=0 while(dec//(2**index)>1): # print('index=',index) # print('dec//(2**index)=',dec//(2**index)) index=index+1 # print('highest digit=',index) binarylis...
# terrascript/provider/external.py # Automatically generated by tools/makecode.py (24-Sep-2021 15:16:09 UTC) # # For imports without namespace, e.g. # # >>> import terrascript.provider.external # # instead of # # >>> import terrascript.provider.hashicorp.external # # This is only available for 'official' and 'partn...
# Copyright 2017 Google LLC All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or ag...
""" Tests for the otter-api tap plugin. """ import json from copy import deepcopy from effect import base_dispatcher import mock from testtools.matchers import Contains, IsInstance from twisted.application.internet import TimerService from twisted.application.service import MultiService from twisted.internet impor...
import sys import subprocess import string ### CONSTANTS ### DIGITS = '0123456789' LETTERS = string.ascii_letters LETTERS_DIGITS = LETTERS + DIGITS ### Super String ### def super_string(text, pos_start, pos_end): result = '' # Calculate indices idx_start = max(text.rfind('\n', 0, pos_start.index), 0...
""" Author: Maneesh D <maneeshd77@gmail.com> Implementation of Singly-Linked-List """ from sys import getsizeof from typing import Any, Tuple, TypeVar typeLinkedList = TypeVar("SinglyLinkedList") typeNode = TypeVar("Node") class Node: """ Node in a Singly-Linked-List. """ __name__ = "Node" de...
# -*- coding: utf-8 -*- """ Created on Sat Jan 29 22:44:05 2022 @author: a179227 """ import unittest from ilist import Ilist from copy import copy import csv, os #os.chdir('C:/Users/a179227/OneDrive - Alliance/perso Wx/ES standard/python ESstandard/ES') from EStestunitaire import obs_1, dat3, loc3, prop2, _res #from E...
# coding: utf-8 """ Kubernetes No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) # noqa: E501 OpenAPI spec version: v1.10.6 Generated by: https://github.com/swagger-api/swagger-codegen.git """ import pprint import re # noqa: F401 from aio...
# swift_build_support/xcrun.py - Invoke xcrun from Python -*- python -*- # # This source file is part of the Swift.org open source project # # Copyright (c) 2014 - 2016 Apple Inc. and the Swift project authors # Licensed under Apache License v2.0 with Runtime Library Exception # # See http://swift.org/LICENSE.txt for l...
import os import argparse import pandas as pd from Bio import SeqIO parser = argparse.ArgumentParser(description='Run Diamond') parser.add_argument('-i', '--input', dest='DatabaseFasta', type=str, required=False, default="./Database/SILVA_138.1_SSURef_NR99_tax_silva.fasta", help="the path of the ...
from collections.abc import Callable from functools import wraps from django.conf import settings from django.contrib.auth.decorators import user_passes_test from django.core.exceptions import PermissionDenied from django.shortcuts import render def check_permissions(user, permissions): """ Permssions can be...
import csv import re from enum import IntEnum, auto from pathlib import Path from typing import Dict, Iterable, List, Optional, TextIO, Tuple, TypeVar, Union from utils.enums import WordClass from utils.types import FSTLemma, FSTTag, Label from .shared_res_dir import shared_res_dir Default = TypeVar("Default") anal...
#!/usr/bin/env python # -*- coding: utf-8 -*- # emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*- # vi: set ft=python sts=4 ts=4 sw=4 et: """ .. _sdc_base : Automatic selection of the appropriate SDC method ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ If the dataset metadata indicate tha mo...
# -*- coding: utf-8 -*- # Copyright 2019 Cohesity Inc. class TenantProtectionJobUpdateParameters(object): """Implementation of the 'TenantProtectionJobUpdateParameters' model. Specifies protection job update details about a tenant. Attributes: protection_job_ids (list of long|int): Specifies th...
#!/usr/bin/env python3 # coding=utf-8 """ build zero-input.el from zero-input.el.in and other el files """ import logging logger = logging.getLogger(__name__) def placeholder_for_file(fn): """return placeholder that should be used for filename. """ return "INCLUDE_" + fn.replace('-', '_').replace('.',...
# coding: utf-8 """ Isilon SDK Isilon SDK - Language bindings for the OneFS API # noqa: E501 OpenAPI spec version: 7 Contact: sdk@isilon.com Generated by: https://github.com/swagger-api/swagger-codegen.git """ from __future__ import absolute_import import unittest import isi_sdk_8_2_0 from i...
from __future__ import absolute_import, division, print_function from libtbx import easy_run class JobStopper(object): def __init__(self, queueing_system): self.queueing_system = queueing_system if self.queueing_system in ["mpi", "lsf"]: self.command = "bkill %s" elif self.queueing_system == 'pbs'...
from __future__ import absolute_import, division, print_function # LIBTBX_SET_DISPATCHER_NAME phenix.csv_as_mtz import sys, os from cctbx import miller from iotbx.option_parser import iotbx_option_parser from iotbx.pdb import crystal_symmetry_from_pdb from libtbx.utils import Sorry from cctbx.array_family import flex ...
from weakref import ref from decimal import Decimal import re import datetime import traceback, sys from kivy.app import App from kivy.cache import Cache from kivy.clock import Clock from kivy.compat import string_types from kivy.properties import (ObjectProperty, DictProperty, NumericProperty, ...
# coding=utf-8 """ Collect IO Stats Note: You may need to artifically generate some IO load on a disk/partition before graphite will generate the metrics. * http://www.kernel.org/doc/Documentation/iostats.txt #### Dependencies * /proc/diskstats """ import diamond.collector import diamond.convertor import time ...
#!/usr/bin/env python3 # CAUTION this script doesn't check for Remote File Inclusion (RFI) # DISCLAIMER # ONLY test this in a server you have permission to do it!!!!!!! from ArgumentHandler import ArgumentHandler from termcolor import colored import PayloadManager import sys from pyfiglet import Figlet from proxies_...
import pytest from prereise.gather.solardata.pv_tracking import get_pv_tracking_ratio_state from prereise.gather.solardata.tests.mock_pv_info import create_mock_pv_info pv_info = create_mock_pv_info() def test_state_type(): state = "AZ" with pytest.raises(TypeError, match="state must be a list"): ge...
from lin import InfoCrud as Base from lin import NotFound, db, lin_config from sqlalchemy import Column, Integer, String, Text, text class Poem(Base): __tablename__ = "lin_poem" id = Column(Integer, primary_key=True, autoincrement=True) title = Column(String(50), nullable=False, comment="标题") author =...
#!/usr/bin/env bash # Copyright 2021 Yuekai Zhang import json import argparse parser = argparse.ArgumentParser(description="Process snips dataset.") parser.add_argument("--wav_path", type=str, help="file path for audios") parser.add_argument( "--text_f", type=str, default="data/text.trans", help="file path for ...