text
stringlengths
2
999k
# module name: BedEntry # main program: samplespecificdbgenerator __author__ = "anthony" __date__ = "$Oct 27, 2015 5:22:01 PM$" from Bio.Seq import reverse_complement, translate import sys class BedEntry( object ): def __init__(self, line): self.line = line try: (chrom,chromStart,chro...
__all__ = ['LEAGUE_IDS'] LEAGUE_IDS ={ "BSA": 444, "PL": 445, "ELC": 446, "EL1": 447, "EL2": 448, "DED": 449, "FL1": 450, "FL2": 451, "BL1": 452, "BL2": 453, "PD": 455, "SA": 456, "PPL": 457, "DFB": 458, "SB": 459, "CL": 464, "AAL": 466 } """ 更新当前赛季...
""" Initializes the base plugin. """ from flask import Blueprint from libs.config import Config from libs.log import Logger description: str = "Dashboard and other basic framework sites" bp: Blueprint = None name: str = None logger: Logger = None config: Config = None provides_pages: list = [ ('Dashboard', 'dashb...
## ## ## Feynrules Header ## ## ## ## ## from __future__ import absolute_import import cmath import re import six class UFOError(Exception): """Exception raised if when inconsistencies are detected in the UFO model.""" pass class UFOBaseClass(object): """The class from which all FeynRules class...
#!/usr/bin/env python import roslib; roslib.load_manifest('flexbe_core') import tf class ProxyTransformListener(object): _listener = None def __init__(self): if ProxyTransformListener._listener is None: ProxyTransformListener._listener = tf.TransformListener() def listener(s...
from dataclasses import dataclass, field from typing import List @dataclass class Doc: class Meta: name = "doc" content: List[object] = field( default_factory=list, metadata={ "type": "Wildcard", "namespace": "##any", "mixed": True, } )
# -*- coding: utf-8 -*- # Part of Odoo. See LICENSE file for full copyright and licensing details. from odoo.tests import common class TestRecruitmentSurvey(common.SingleTransactionCase): @classmethod def setUpClass(cls): super(TestRecruitmentSurvey, cls).setUpClass() # Create some sample d...
# copyright (c) 2020 PaddlePaddle 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 applic...
# Copyright (C) 2021 Bian Sepang # All Rights Reserved. # from aiohttp import ClientSession from userbot import CMD_HELP from userbot.events import register async def get_nekos_img(args): nekos_baseurl = "https://nekos.life/api/v2/img/" if args == "random_hentai_gif": args = "Random_hen...
# -*- coding: utf-8 -*- import datetime import json import math import os from six.moves.urllib.parse import urlencode from icrawler import Crawler, Feeder, Parser, ImageDownloader class FlickrFeeder(Feeder): def feed(self, apikey, max_num=4000, **kwargs): if max_num > 4000: max_num = 4000...
"""Allow to set up simple automation rules via the config file.""" import asyncio import importlib import logging from typing import Any, Awaitable, Callable, List, Optional, Set import voluptuous as vol from homeassistant.const import ( ATTR_ENTITY_ID, ATTR_NAME, CONF_ALIAS, CONF_DEVICE_ID, CONF_...
import base64 import logging from typing import List import jwt import requests import rsa from fastapi import Request, HTTPException, status from msal import ConfidentialClientApplication from services.access_service import AccessService, AuthConfigValidationError from core import config from db.errors import Entity...
from config.db import pyCustomerCollection for customer in pyCustomerCollection.find().sort("name"): print(customer)
import tensorflow as tf from tensorflow.keras.layers import (Add, Conv2D, Input, Concatenate, TimeDistributed) from tensorflow.keras.models import Model from .blocks import (RecurrentConvBlock, ResidualBlock, ConvBlock, DenseBlock, TransitionBlock, LocalizedC...
""" Created on thu Jan 28 2021 @author: Maria Kuruvilla Goal - Write csv file containing all covariates and distance to center before loom - the first 20k frames """ import os import pathlib from pprint import pprint import numpy as np from scipy import stats from scipy.spatial import distance import matplotlib.pyp...
import os import sys import stat import time CUR_DIR = os.path.dirname(os.path.realpath(__file__)) PARENT_DIR = os.path.abspath(os.path.join(CUR_DIR, os.pardir)) # The opensprinkler file is one directory up. This is ugly, # and it will be fixed in the future. For now, we'll just add # the parent directory to the pa...
# optimizer optimizer = dict(type='SGD', lr=0.05, momentum=0.9, weight_decay=0.0001) optimizer_config = dict(grad_clip=None) # learning policy lr_config = dict(policy='CosineAnnealing', min_lr=0) runner = dict(type='EpochBasedRunner', max_epochs=100)
# encoding: utf-8 from okscraper.base import BaseScraper from okscraper.sources import BaseSource from okscraper.storages import BaseStorage from events.models import Event from persons.models import Person from urlparse import urlparse, parse_qs from django.conf import settings from urllib import quote import urllib...
# -------------- import pandas as pd from sklearn.model_selection import train_test_split #path - Path of file df = pd.read_csv(path) # Code starts here X = df.drop(['customerID','Churn'], axis = 1) y = df['Churn'].copy() X_train,X_test,y_train,y_test = train_test_split(X,y, test_size = 0.3, random_state = 0) # -...
#!/usr/bin/env python3 # @generated AUTOGENERATED file. Do not Change! from enum import Enum class LocationFilterType(Enum): LOCATION_INST = "LOCATION_INST" LOCATION_INST_NAME = "LOCATION_INST_NAME" LOCATION_INST_EXTERNAL_ID = "LOCATION_INST_EXTERNAL_ID" LOCATION_TYPE = "LOCATION_TYPE" LOCATION_IN...
# Copyright 2020 Axis Communications AB. # # For a full list of individual contributors, please see the commit history. # # 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.apac...
"""IDLE Configuration Dialog: support user customization of IDLE by GUI Customize font faces, sizes, and colorization attributes. Set indentation defaults. Customize keybindings. Colorization and keybindings can be saved as user defined sets. Select startup options including shell/editor and default window size. ...
#!/usr/bin/env python # # Copyright 2016 Cisco Systems, 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 applicab...
import argparse import math import random import os from PIL import Image import numpy as np import torch from torch import nn, autograd, optim from torch.nn import functional as F from torch.utils import data import torch.distributed as dist from torchvision import datasets, transforms, utils from tqdm import tqdm imp...
"""TODO(mlqa): Add a description here.""" from __future__ import absolute_import, division, print_function import json import os import nlp # TODO(mlqa): BibTeX citation _CITATION = """\ @article{lewis2019mlqa, title={MLQA: Evaluating Cross-lingual Extractive Question Answering}, author={Lewis, Patrick and Ogu...
import argparse import os.path as osp import pickle import sys import mmcv import numpy as np import torch import torch.nn as nn from mmcv import Config, print_log # yapf: disable sys.path.append(osp.abspath(osp.join(__file__, '../../..'))) # isort:skip # noqa from mmgen.core.evaluation.metric_utils import extract...
# Natural Language Toolkit: Text Trees # # Copyright (C) 2001-2022 NLTK Project # Author: Edward Loper <edloper@gmail.com> # Steven Bird <stevenbird1@gmail.com> # Peter Ljunglöf <peter.ljunglof@gu.se> # Tom Aarsen <> # URL: <https://www.nltk.org/> # For license information, see LICENSE.T...
#!/usr/bin/env python # -*- coding: utf-8 -*- """ A collection of useful tools for GIXS and fibre diffraction. There are two main tools: 1. Four quadrant averaging: Fibre diffraction patterns are related through four quadrant symmetry (assuming ideal fibre texture). This means that the data in each of the ...
# Generated by Django 2.1.7 on 2019-04-17 19:05 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('api', '0008_auto_20190416_1644'), ] operations = [ migrations.AlterField( model_name='recommendationfeedback', name=...
import random from examples.NIPS.MNIST.noisy_sequence_detection.old_scenarios.scenario001 import generate_data def get_digit_for_initiated_at(digit, last_digits, threshold, available_digits): if digit == last_digits[-1]: if random.random() < threshold: return random.choice(available_digits), ...
from distutils.core import setup from distutils.extension import Extension from Cython.Distutils import build_ext from Cython.Build import cythonize import os from os.path import join as pjoin import numpy as np # /opt/anaconda3/bin/python3 setup.py build_ext --inplace # http://martinsosic.com/development/2016/02/0...
import numpy as np from manimlib.mobject.mobject import Mobject class ValueTracker(Mobject): """ Note meant to be displayed. Instead the position encodes some number, often one which another animation or continual_animation uses for its update function, and by treating it as a mobject it can sti...
from absl import app, flags, logging from absl.flags import FLAGS import tensorflow as tf import numpy as np import cv2 from tensorflow.keras.callbacks import ( ReduceLROnPlateau, EarlyStopping, ModelCheckpoint, TensorBoard ) from yolov3_tf2.models import ( YoloV3, YoloV3Tiny, YoloLoss, yolo_an...
# Copyright (c) 2022, 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 appli...
#!/usr/bin/python # Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file # for details. All rights reserved. Use of this source code is governed by a # BSD-style license that can be found in the LICENSE file. """This module provides shared functionality to provide Dart metadata for DOM APIs. """ ...
#!/usr/bin/env python2 from distutils.core import setup from catkin_pkg.python_setup import generate_distutils_setup d = generate_distutils_setup( packages=['ssv102'], package_dir={'': 'src'}, ) setup(**d)
""" MIT License Copyright (c) 2021 SaidBySolo 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, merge, publish, di...
from mobs.Mob import Mob class BossMob(Mob): def __init__(self, mob_name, mob_health, mob_rarity): super().__init__("Boss", mob_name, mob_health, mob_rarity)
# -*- coding: utf-8 -*- # Copyright (c) 2019, Frappe Technologies and contributors # For license information, please see license.txt from __future__ import unicode_literals import frappe from frappe.model.document import Document class SomalilandBranchOffices(Document): pass
from .unet import Unet from .unetplusplus import UnetPlusPlus from .unet3plus import Unet3Plus from .manet import MAnet from .linknet import Linknet from .fpn import FPN from .pspnet import PSPNet from .deeplabv3 import DeepLabV3, DeepLabV3Plus from .pan import PAN from . import encoders from . import utils from . imp...
# encoding: utf-8 import ckan.model as model import click import datetime import csv import ckan.logic as logic from collections import namedtuple from ckan.cli import error_shout _ViewCount = namedtuple(u'ViewCount', u'id name count') @click.group(name=u'tracking', short_help=u'Update tracking statistics') def tra...
from __future__ import annotations from typing import Optional import warp.yul.ast as ast from warp.yul.utils import camelize, remove_prefix from warp.yul.WarpException import WarpException, warp_assert, warp_assert_statement _node_to_parser = {} def register_parser(parser): fun_name = parser.__name__ asse...
from otp.ai.AIBase import * from toontown.toonbase import ToontownGlobals from direct.distributed.ClockDelta import * from ElevatorConstants import * import DistributedElevatorAI from direct.fsm import ClassicFSM from direct.fsm import State from direct.task import Task from direct.directnotify import DirectNotifyGloba...
from __future__ import print_function from builtins import object from lib.common import helpers class Stager(object): def __init__(self, mainMenu, params=[]): self.info = { 'Name': 'DuckyLauncher', 'Author': ['@harmj0y','@kisasondi'], 'Description': ('Generates a ...
import FWCore.ParameterSet.Config as cms process = cms.Process("DumpDBToFile") process.load("CondCore.CondDB.CondDB_cfi") process.load("Configuration.StandardSequences.FrontierConditions_GlobalTag_cff") process.GlobalTag.globaltag = '' process.load("CondCore.CondDB.CondDB_cfi") process.source = cms.Source("EmptySo...
# $Id: __init__.py 8358 2019-08-26 16:45:09Z milde $ # Authors: David Goodger <goodger@python.org>; Ueli Schlaepfer # Copyright: This module has been placed in the public domain. """ This package contains modules for standard tree transforms available to Docutils components. Tree transforms serve a variety of purposes...
### # Copyright (c) 2005, Jeremiah Fincher # Copyright (c) 2010-2021, The Limnoria Contributors # 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 t...
import os import sys import time DEVNULL = open(os.devnull, "w") STDOUT = sys.stdout def timefunc(f): def f_timer(*args, **kwargs): start = time.time() result = f(*args, **kwargs) end = time.time() print(f.__name__, 'took', end - start, 'time') return result return f_t...
import struct SWAPPED_VALUE_MS = 0xD4C3B2A1 SWAPPED_VALUE_NS = 0x4D3CB2A1 IDENTICAL_VALUE_MS = 0xA1B2C3D4 IDENTICAL_VALUE_NS = 0xA1B23C4D class GlobalHeader: magic_number = 0 # 4 bytes version_major = 0 # 2 bytes version_minor = 0 # 2 bytes thiszone = 0 # 4 bytes sigfigs = 0 # 4 bytes sn...
# -*- coding:utf-8 -*- from __future__ import unicode_literals from django.contrib import admin from django.urls import reverse from django.utils.html import format_html from .models import Category, Story from reading.custom_site import custom_site from .adminforms import StoryAdminForm from reading.custom_admin imp...
from os import path from setuptools import setup, find_packages import sys import versioneer # NOTE: This file must remain Python 2 compatible for the foreseeable future, # to ensure that we error out properly for people with outdated setuptools # and/or pip. min_version = (3, 6) if sys.version_info < min_version: ...
def int2BinStr(num): if num <= 1: return str(num) else: return int2BinStr(num >> 1) + str(num&1) # return str(num) if num <= 1 else int2BinStr(num >> 1) + str(num&1) def bitLen(num): count = 0 while num != 0: count += 1 num = num >> 1 return count ...
from django.conf.urls import url from django.contrib import admin from .views import (searchposts) from . import views urlpatterns = [ url(r'^$', searchposts, name='searchposts'), url(r'^$', views.index, name='index'), ]
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Thu Nov 16 00:14:59 2017 @author: davidpvilaca """ import matplotlib.pyplot as plt import cv2 import numpy as np import scipy from scipy import ndimage from skimage import measure def showImg(img, gray=False): plt.figure() cmap = None if (gra...
import uuid from starlette.datastructures import URLPath, URL from starlette.requests import Request from . import config from .models import User, db def get_user_id(request: Request): uid = request.session.get("uid") # noinspection PyBroadException try: return uuid.UUID(hex=uid) except Exc...
import sympy as smp from sympy import * def prgrm_iter(): x, k, n, h = smp.symbols ('x k n h') f = smp.sin(x) print (" ") print ("This program comes from the GitHub repository") print ("AndreiMurashev/pos.int_diff_formula") print (" ") print ("The purpose of this program is to check if the...
#!/usr/bin/env python """Django's command-line utility for administrative tasks.""" import os import sys def main(): os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'MyHome.settings') try: from django.core.management import execute_from_command_line except ImportError as exc: raise ImportE...
# %% # Import needed libraries and modules import os import dask import numpy as np from dask import delayed from dask_image.imread import imread from quanfima import morphology as mrph from skimage import filters, morphology # %% # Use dask to read the image files, which permits for lazy loading. all_samples = imrea...
import datetime import babel.dates import pytz from feedgen.feed import FeedGenerator from flask import ( Blueprint, Response, current_app, redirect, render_template, request, safe_join, send_from_directory, url_for, ) from flask_flatpages import FlatPages from flask_login import cu...
from django.db import migrations def create_site(apps, schema_editor): Site = apps.get_model("sites", "Site") custom_domain = "testsnapp-5.botics.co" site_params = { "name": "testsnApp", } if custom_domain: site_params["domain"] = custom_domain Site.objects.update_or_create(d...
from floodsystem.stationdata import build_station_list, update_water_levels from floodsystem.station import * from floodsystem.flood import * from floodsystem.plot import * from floodsystem.analysis import * from floodsystem.datafetcher import * def run(): # Build list of stations stations = build_station_list...
from typing import List import numpy as np from matplotlib import pyplot as plt def segment_to_digits(segment: np.array, verbose: int = 0) -> List[np.array]: from sklearn.cluster import OPTICS from statistics import mean nonzero_y, nonzero_x = np.where(segment > 0) nonzero_points = np.arr...
# ############################################################################ # # Copyright (c) Microsoft Corporation. # # This source code is subject to terms and conditions of the Apache License, Version 2.0. A # copy of the license can be found in the License.html file at the root of this distribution. If ...
import unittest from datetime import datetime, timedelta from django.utils import timezone from textwrap import dedent import pytz from yaksh.models import User, Profile, Question, Quiz, QuestionPaper,\ AnswerPaper, Answer, Course, IntegerTestCase, FloatTestCase,\ StringTestCase, McqTestCase, ArrangeTestCase ...
""" A pointmass maze env.""" from gym.envs.mujoco import mujoco_env from gym import utils from d4rl import offline_env from d4rl.pointmaze.dynamic_mjc import MJCModel import numpy as np import random WALL = 10 EMPTY = 11 GOAL = 12 def parse_maze(maze_str): lines = maze_str.strip().split('\\') width, height ...
""" Problem Statement Watson asks Sherlock: Given a string S of N 0's and M 1's, how many unique permutations of this string start with 1? Help Sherlock by printing the answer modulo (109+7). Input Format First line contains T, the number of test cases. Each test case consists of N and M separated by a space. """ MO...
#!/usr/bin/env python3 import argparse import sys import os import os.path import yaml import glob import re import warnings from pathlib import Path from datetime import datetime warnings.filterwarnings("ignore", category=DeprecationWarning) def main(): now = datetime.now() date_time_string = now.strftime(...
from __future__ import absolute_import, unicode_literals import os from celery import Celery # set the default Django settings module for the 'celery' program. os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'proj.settings') app = Celery('proj') # Using a string here means the worker doesn't have to serialize # th...
from .base import * DEBUG = False SITE_NAME = 'sitename.com' ALLOWED_HOSTS = ['*'] DATABASES = { 'default': { 'ENGINE': 'django.db.backends.postgresql_psycopg2', 'NAME': '', 'USER': 'postgres', 'PASSWORD': '', 'HOST': 'localhost', 'PORT': '5432', } } STATIC_U...
import asyncio from concurrent.futures import CancelledError import datetime import enum from functools import ( partial, ) from operator import attrgetter import time from typing import ( Any, AsyncIterator, Awaitable, Callable, Dict, List, NamedTuple, FrozenSet, Sequence, T...
from typing import Optional, Union, Tuple, List, Dict import functools from torch import nn from torch import optim from torch.nn import functional as F from transformers.trainer_pt_utils import get_parameter_names import torchmetrics from .lr_scheduler import ( get_cosine_schedule_with_warmup, get_polynomial_d...
#!/usr/bin/env python2.7 import os from PIL import Image from Crypto.Cipher import AES # random key key = os.urandom(16) # load image img = Image.open("militarygrade.png") img = img.convert("RGB") # encrypt cipher = AES.new(key) cdata = cipher.encrypt(img.tobytes()) # create image from encrypted data cimg = Image.from...
# coding=utf-8 # Copyright 2021-present, the Recognai S.L. 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 ...
# Copyright 2021, Kay Hayen, mailto:kay.hayen@gmail.com # # Python test originally created or extracted from other peoples work. The # parts from me are licensed as below. It is at least Free Software where # it's copied from other people. In these cases, that will normally be # indicated. # # L...
# Copyright 2012 OpenStack Foundation # # 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...
# Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo # Copyright (C) 2012-2019 German Aerospace Center (DLR) and others. # This program and the accompanying materials # are made available under the terms of the Eclipse Public License v2.0 # which accompanies this distribution, and is available at ...
#!/usr/bin/env python from impactutils.mapping.compass import get_compass_dir, get_compass_dir_azimuth import numpy as np import pandas as pd def test_compass(): angles = [[1.0, ('N', 'North'), ('N', 'North'), ('N', 'North')], [23.5, ('N', 'North'), ('NE', 'Northeast'), ('NNE', 'Nort...
#!/usr/bin/env python import logging from pathlib import Path import torch from swan.dataset import TorchGeometricGraphData, FingerprintsData, DGLGraphData from swan.modeller import TorchModeller from swan.modeller.models import FingerprintFullyConnected, MPNN, SE3Transformer from swan.utils.log_config import configur...
""" Copyright (C) 2018-2021 Intel Corporation Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to i...
def gen_mutants(): import tensorflow as tf import pandas import numpy as np DATAFILE_TRAIN = 'mock_kaggle_edit_train.csv' DATAFILE_VALIDATE = 'mock_kaggle_edit_...
from argparse import FileType, ArgumentParser import csv import os parser = ArgumentParser( description="Checks which is bigger: sum or product.") parser.add_argument("sums_csv", type=FileType('rU'), help="CSV containing (sum,product) pairs") parser.add_argument("summary_csv...
from dexy.doc import Doc from dexy.wrapper import Wrapper from nose.exc import SkipTest from tests.plugins.test_pexpect_filters import SCALA from tests.utils import TEST_DATA_DIR from tests.utils import assert_in_output from tests.utils import assert_output from tests.utils import assert_output_cached from tests.utils ...
label_convertor = dict( type='AttnConvertor', dict_type='DICT36', with_unknown=True, lower=True) model = dict( type='SATRN', backbone=dict(type='ShallowCNN'), encoder=dict(type='SatrnEncoder'), decoder=dict(type='TFDecoder'), loss=dict(type='TFLoss'), label_convertor=label_convertor, ma...
import os import numpy as np import pandas as pd import tabulate from decisionengine_modules.GCE.transforms import GceFigureOfMerit DATA_DIR = os.path.join(os.path.dirname(__file__), "data") CSV_FILE = os.path.join(DATA_DIR, "GceOccupancy.output.fixture.csv") _PRODUCES = ["GCE_Price_Performance", "GCE_Figure_Of_Mer...
import falcon import simplejson as json import mysql.connector import config from datetime import datetime, timedelta, timezone class Reporting: @staticmethod def __init__(): pass @staticmethod def on_options(req, resp): resp.status = falcon.HTTP_200 #############################...
#! /usr/bin/env python import argparse import yaml from aiohttp import web, ClientSession, TCPConnector import async_timeout parser = argparse.ArgumentParser(description='Prometheus HTTP exporter.') parser.add_argument('-c', '--config', dest='config', default='config.yml', help='Path to configurati...
import io import os import random import av from torch.utils.data import Dataset as TorchDataset, ConcatDataset, DistributedSampler, WeightedRandomSampler, RandomSampler import torch import numpy as np import sys sys.path.append(os.path.dirname(os.path.dirname(os.path.realpath(__file__)))) from audioset.audiodatasets ...
# The MIT License (MIT) # # Copyright (c) 2020 Melissa LeBlanc-Williams for Adafruit Industries # # 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 limita...
#!/usr/bin/env python # stdlib imports import os.path import sys # third party imports import numpy as np from openquake.hazardlib import const from openquake.hazardlib.imt import PGA, PGV, SA import pytest # local imports from shakelib.conversions.imc.beyer_bommer_2006 import BeyerBommer2006 # important constants...
""" RSA-related Mechanism implementations. """ from ctypes import c_void_p, cast, pointer, sizeof from .helpers import Mechanism from ..attributes import to_byte_array from ..cryptoki import CK_ULONG, CK_RSA_PKCS_OAEP_PARAMS, CK_RSA_PKCS_PSS_PARAMS from ..defines import * class RSAPKCSOAEPMechanism(Mechanism): "...
import os import asyncio from hypercorn.config import Config from hypercorn.asyncio import serve config = Config() config.bind = ["localhost:5000"] config.certfile = os.path.join(os.path.dirname(__file__), "ssl_certificate/cert.pem") config.keyfile = os.path.join(os.path.dirname(__file__), "ssl_certificate/key.pem")...
""" This module contains useful SQL queries and their combinations which are specific to the domain of QCoDeS database. """ import logging import sqlite3 import time import unicodedata import warnings from typing import (Any, Callable, Dict, List, Mapping, Optional, Sequence, Tuple, Union, cast) fro...
"""SCons.Tool.Packaging.rpm The rpm packager. """ # # Copyright (c) 2001 - 2015 The SCons Foundation # # 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 # witho...
# This is a map from an ISO 639 code or common name to its Wiktionary language name. # noqa: E501 # Note that the iso639 Python package that WikiPron uses can handle only ISO 639-1 and 639-2 codes. # noqa: E501 # ISO 639-3: https://iso639-3.sil.org/sites/iso639-3/files/downloads/iso-639-3.tab # noqa: E501 # Wiktiona...
# # Copyright 2018 Analytics Zoo Authors. # # 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 pika import uuid class FibonacciRpcClient(object): def __init__(self): self.connection = pika.BlockingConnection( pika.ConnectionParameters(host='192.168.101.129', credentials=pika.PlainCredentials(username='admin', password='admin'))) se...
mysql={ 'host':"localhost", 'username':'root', 'password':'root', 'database': 'yalinidatarepresentation' }
""" Example 6 - Loading Loading a save file @author: samgeen """ # This piece of code basically adds the parent directory to PYTHONPATH import os, sys parent = os.path.dirname(os.getcwd()) sys.path.append(parent) # Import numpy, matplotlib and weltgeist import numpy as np import matplotlib.pyplot as plt import weltg...
# Script to convert and resize training and test images into npy import os import argparse import itertools from time import time from time import strftime import pandas as pd import numpy as np from sklearn.metrics import accuracy_score from plankton import utils from plankton.augment_iterators i...
# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. import torch from torch import nn from torch.autograd import Function from torch.autograd.function import once_differentiable from torch.nn.modules.utils import _pair # from maskrcnn_benchmark import _C from ._utils import _C from apex import amp ...