text
stringlengths
2
999k
# -*- coding: utf-8 -*- # ---------------------------------------------------------------------- # ManagedObjectProfile # ---------------------------------------------------------------------- # Copyright (C) 2007-2019 The NOC Project # See LICENSE for details # ---------------------------------------------------------...
#!/usr/bin/python3 import os import sys # TODO: integrate into a parsing library functionality counter = 0 with open('engine/lang/tokens.nota') as fin: lines = fin.readlines() lines = [line.strip() for line in lines] lines = [line for line in lines if len(line) > 0 and line[0] != '#'] whole = ''.join(lines) whole =...
from itertools import product import numpy as np def accum(accmap, a, func=None, size=None, fill_value=0, dtype=None): """ An accumulation function similar to Matlab's `accumarray` function. Parameters ---------- accmap : ndarray This is the "accumulation map". It maps input (i.e. indic...
from app import create_app app = create_app() if __name__ == '__main__': app.run()
# -*- coding: utf-8 -*- import re class ZoteroItem(object): """Represents a single zotero item.""" def __init__(self, _id): """ Constructor. Keyword arguments: _id -- An `int` with the item id. """ self.id = _id self.abstractNote = "" self.a...
#!/usr/bin/python from urlparse import urlparse import sys for line in sys.stdin: data = line.strip().split("GET ") if len(data) > 1 : pathname = data[1].split(" ")[0] pathname=urlparse(pathname).netloc+urlparse(pathname).path print "{0}".format(pathname)
import random from string import ascii_lowercase category = ['python', 'java', 'kotlin', 'javascript'] computer = random.choice(category) hidden = list(len(computer) * "-") print("H A N G M A N") while True: menu = input('Type "play" to play the game, "exit" to quit: ') if menu == "play": pass elif m...
import copy import json import math import calendar from app import app from image.common import TarImageFormatter from util.registry.gzipwrap import GZIP_BUFFER_SIZE from util.registry.streamlayerformat import StreamLayerMerger class FileEstimationException(Exception): """ Exception raised by build_docker_l...
from . import db,login_manager from datetime import datetime from flask_login import UserMixin,current_user from werkzeug.security import generate_password_hash,check_password_hash @login_manager.user_loader def load_user(user_id): return User.query.get(user_id) class User(UserMixin,db.Model): __tablename__ = 'us...
""" HDF5 geometry. """ import os import numpy as np import h5pickle as h5py from .converted import SeismicGeometryConverted class SeismicGeometryHDF5(SeismicGeometryConverted): """ Infer or create an `HDF5` file with multiple projections of the same data inside. """ #pylint: disable=attribute-defined-outsid...
""" Production Configurations - Use WhiteNoise for serving static files - Use Amazon's S3 for storing uploaded media - Use mailgun to send emails - Use Redis for cache - Use sentry for error logging - Use opbeat for error reporting """ import logging from .base import * # noqa # SECRET CONFIGURATION # ------...
import numpy import pandas import pytest from chainer_chemistry.dataset.parsers.data_frame_parser import DataFrameParser # NOQA from chainer_chemistry.dataset.preprocessors import AtomicNumberPreprocessor from chainer_chemistry.dataset.splitters.scaffold_splitter import generate_scaffold # NOQA from chainer_chemistr...
from .utils.adb import ADBConnector from .utils.recognize import Recognizer from .solvers import * class Solver(): def __init__(self, adb=None, recog=None): self.adb = adb if adb is not None else ADBConnector() self.recog = recog if recog is not None else Recognizer(self.adb) def base(self, ...
tg_dict = { 0 : 'No Talkgroup<br/>(<b>0</b>)', 1 : 'Local<br/>(<b>1</b>)', 2 : 'Local<br/>(<b>2</b>)', 1200 : 'Florida<br/>(<b>1200</b>)', 5000 : 'Arkansas<br/>(<b>5000</b>)', 5500 : 'Wisconsin<br/>(<b>5500</b>)', 9000 : 'CT Expanded<br/>(<b>9000</b>)', 9001 : 'Connecticut<br/>(<b>9001</b>)', 9999 : '...
class ReinforcementData(object,IDisposable): """ Abstract class for various reinforcement data """ def Dispose(self): """ Dispose(self: ReinforcementData) """ pass def ReleaseUnmanagedResources(self,*args): """ ReleaseUnmanagedResources(self: ReinforcementData,disposing: bool) """ pass def __enter__...
import pytest from aioresponses import aioresponses from rasa.constants import DOMAIN_SCHEMA_FILE, CONFIG_SCHEMA_FILE from rasa.utils.validation import validate_yaml_schema, InvalidYamlFileError from rasa.utils.endpoints import EndpointConfig, concat_url from tests.utilities import latest_request, json_of_latest_reque...
#!/usr/bin/python -u # # Python Bindings for LZMA # # Copyright (c) 2004-2015 by Joachim Bauch, mail@joachim-bauch.de # 7-Zip Copyright (C) 1999-2010 Igor Pavlov # LZMA SDK Copyright (C) 1999-2010 Igor Pavlov # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser...
from netapp.netapp_object import NetAppObject class Aggr64BitUpgradeCheckInfo(NetAppObject): """ Information returned when upgrade-64bit-mode in aggr-add or aggr-64bit-upgrade-start is "check". """ _added_space = None @property def added_space(self): """ The effective t...
# Copyright (c) 2015 Hewlett-Packard Development Company, L.P. # 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/LICEN...
import unittest import random from unittest.case import SkipTest from src.pysguard import DateRule, DateRangeRule, TimeRangeRule, RecurringTimeRule, TimeConstraint from datetime import datetime, timedelta class DateRuleTest(unittest.TestCase): @classmethod def setUpClass(cls) -> None: random.seed(date...
#!/usr/bin/env python # -*- coding: utf-8 -*- # 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 ...
# Copyright (c) 2018 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...
# import the necessary packages from tensorflow.keras.models import Sequential from tensorflow.keras.layers import BatchNormalization from tensorflow.keras.layers import Conv2D from tensorflow.keras.layers import MaxPooling2D from tensorflow.keras.layers import Activation from tensorflow.keras.layers import Dropout fro...
class Car(): '''Uma tentativa simples de representar um imagem.''' def __init__(self, make, model, year): '''Inicializa os atributos que descrvem um imagem.''' self.make = make self.model = model self.year = year self.odometer_reading = 0 def get_descriptive_name(sel...
#!/usr/bin/env python # Filename: ArcticDEM_proc """ introduction: prepare Arctic, unzip, crop, registration, and co-registration authors: Huang Lingcao email:huanglingcao@gmail.com add time: 26 December, 2020 """ import os,sys from optparse import OptionParser deeplabforRS = os.path.expanduser('~/codes/PycharmPr...
#### NOTICE: THIS FILE IS AUTOGENERATED #### MODIFICATIONS MAY BE LOST IF DONE IMPROPERLY #### PLEASE SEE THE ONLINE DOCUMENTATION FOR EXAMPLES from swgpy.object import * def create(kernel): result = Tangible() result.template = "object/tangible/ship/crafted/weapon/missile/shared_wpn_launcher_seismic_mk2.iff" re...
from .forms import InspectionForm, InspectServiceForm from .forms import ReplacementForm, ReplaceServiceForm from .forms import FuelServiceForm from .forms import PartForm from .models import Car, Inspection, InspectService, Part from .models import Replacement, ReplaceService from .models import FuelService from djang...
# coding: utf-8 """ OANDA v20 REST API The full OANDA v20 REST API Specification. This specification defines how to interact with v20 Accounts, Trades, Orders, Pricing and more. To authenticate use the string 'Bearer ' followed by the token which can be obtained at https://www.oanda.com/demo-account/tpa/perso...
from fastapi import HTTPException from passlib.context import CryptContext from tortoise.exceptions import DoesNotExist, IntegrityError from src.database.models import Users from src.schemas.token import Status from src.schemas.users import UserOutSchema pwd_context = CryptContext(schemes=["bcrypt"], deprecated="aut...
# Copyright (c) 2014 Ian C. Good # # 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, distrib...
""" Surjanovic, S. & Bingham, D. (2013). Virtual Library of Simulation Experiments: Test Functions and Datasets. Retrieved April 18, 2016, from http://www.sfu.ca/~ssurjano. """ from __future__ import print_function from functools import reduce, wraps import inspect from numpy import sin, cos, linspace, meshgrid, e, ...
#!/usr/bin/python3 # # @author: Gaurav Rastogi (grastogi@avinetworks.com) # Eric Anderson (eanderson@avinetworks.com) # module_check: supported # Avi Version: 17.1.1 # # Copyright: (c) 2017 Gaurav Rastogi, <grastogi@avinetworks.com> # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/license...
from .. import mkQApp def test_screenInformation(): qApp = mkQApp() desktop = qApp.desktop() resolution = desktop.screenGeometry() availableResolution = desktop.availableGeometry() print("Screen resolution: {}x{}".format(resolution.width(), resolution.height())) print("Available geometry: {}x{}...
import logging import sys import re from pylons import config, request, response, session, app_globals, tmpl_context as c from pylons.controllers.util import abort, redirect from pylons.decorators import jsonify from formalchemy import FieldSet, Grid import sqlalchemy as sa import sqlalchemy.exceptions as sa_error # ...
# This code is adapted from # # C. Tian, Y. Xu, W. Zuo, C.-W. Lin, and D. Zhang. # Asymmetric cnn for image superresolution. # IEEE Transactions on Systems, Man, and Cybernetics: Systems, 2021. # # which is available at https://github.com/hellloxiaotian/ACNet/blob/master/x4/model/ops.py # # The only modification is...
# 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...
import sys import os BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) sys.path.insert(0, os.path.dirname(BASE_DIR)) # add our app to path SECRET_KEY = '!@rf6@w&uz5b#8hk_^@b2fr^t163el(@0uf!xahiuc@k13hfru' DEBUG = True ALLOWED_HOSTS = [] INSTALLED_APPS = [ 'django.contrib.admin', 'djan...
# Pyrogram - Telegram MTProto API Client Library for Python # Copyright (C) 2017-2021 Dan <https://github.com/delivrance> # # This file is part of Pyrogram. # # Pyrogram is free software: you can redistribute it and/or modify # it under the terms of the GNU Lesser General Public License as published # by the Free...
import discord import config from discord.ext import commands from discord.ext.commands import Cog class Links(Cog): """ Commands for easily linking to projects. """ def __init__(self, bot): self.bot = bot @commands.command(hidden=True) async def pegaswitch(self, ctx): """Lin...
__author__ = 'patras' from domain_exploreEnv import * from timer import DURATION from state import state, rv DURATION.TIME = { 'survey': 5, 'monitor': 5, 'screen': 5, 'sample': 5, 'process': 5, 'fly': 3, 'deposit': 1, 'transferData': 1, 'take': 2, 'put': 2, 'move': 10, '...
# -*- coding: utf-8 -*- import json import uuid import sqlite3 import os import zipfile import shutil from itertools import groupby from operator import itemgetter from bottle import run from bottle import route from bottle import template from bottle import request from bottle import static_file from bottle import i...
# -*- coding: utf-8 -*- ''' Salt returner that reports execution results back to sentry. The returner will inspect the payload to identify errors and flag them as such. Pillar needs something like: .. code-block:: yaml raven: servers: - http://192.168.1.1 - https://sentry.example.com ...
from urlparse import urljoin from django.contrib.comments.moderation import CommentModerator, moderator from django.contrib.sites.models import get_current_site from django.core.exceptions import ImproperlyConfigured from django.utils.encoding import smart_str from akismet import Akismet from fluent_comments import app...
"""Tests for typing.AnyStr.""" from pytype import file_utils from pytype.tests import test_base class AnyStrTest(test_base.TargetIndependentTest): """Tests for issues related to AnyStr.""" def testTypeParameters(self): with file_utils.Tempdir() as d: d.create_file("a.pyi", """ from typing impo...
# To find indexes of String "Pattern" in a given String "Text" using KMP Algorithm # function that returns list of indexes where the patters matches def KMP_Search(pattern, text): n = len(text) m = len(pattern) # pre-compute prefix array of the pattern prefix_arr = get_prefix_arr(pattern, m) # s...
import simuvex from simuvex.s_type import SimTypeString, SimTypeInt, SimTypeFd ###################################### # open ###################################### class open(simuvex.SimProcedure): #pylint:disable=W0622 #pylint:disable=arguments-differ def run(self, p_addr, flags): self.argument_type...
from django.contrib.auth import get_user_model, authenticate from django.utils.translation import ugettext_lazy as _ from rest_framework import serializers class UserSerializer(serializers.ModelSerializer): """"Serializer for the users object""" class Meta: model = get_user_model() fields = (...
# -*- coding: utf-8 -*- """ Created on Thu Jun 13 12:01:47 2019 @author: esol """ from neqsim.thermo import fluid, phaseenvelope from neqsim.process import clearProcess, stream, valve, separator, compressor, runProcess, viewProcess, heater, mixer, recycle feedPressure = 30.0 MPpressure = 10.0 LPpressure = 2.1 # Star...
import os """ var pour tout SONKA """ dir_audio = "audio" dir_sauvegarde_playlist = "memoire_playlist" dos_memoire_touche = "memoire_touche" fichier_touche_next = "touche_next.ka" fichier_touche_pause = "touche_play_pause.ka" trait = "__________________________________________________________" trait_2 = "---------...
def importFile(filename): return open(filename).read() def readLines(filename): return str.splitlines(importFile(filename)) def readToTwoDimensionalIntArray(filename): data = readLines(filename) output = [] for i in range(len(data)): output.append(map(int, data[i].split())) return outp...
# Modified by Peize Sun, Rufeng Zhang # ------------------------------------------------------------------------ # Modified from DETR (https://github.com/facebookresearch/detr) # Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved # ----------------------------------------------------------------------...
#!/usr/bin/env python3 # Copyright 2019 Christian Henning # # 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 l...
#!/usr/bin/env python # -*- coding: utf-8 -*- """Unit test for various counterfactual objectives""" from nmt import train import os import unittest import shutil import logging import numpy NEMATUS = os.path.abspath(os.path.join(__file__, "../..")) DATA_DIR = NEMATUS + "/data_unittest/" LOG_PREFIX = DATA_DIR + "toy"...
from django.contrib import admin from django.urls import include, path urlpatterns = [ path('auth/', include('users.urls', namespace='users')), path('', include('posts.urls', namespace='posts')), path('admin/', admin.site.urls), path('auth/', include('django.contrib.auth.urls')), path('about/', inc...
import board import displayio import terminalio import neopixel from adafruit_ble import BLERadio from adafruit_ble.advertising.standard import ProvideServicesAdvertisement from adafruit_ble.services.nordic import UARTService from adafruit_display_text import label from adafruit_gizmo import tft_gizmo from time import ...
"""Common configurations for indicators.""" from vectorbt.utils.config import Config flex_elem_param_config = Config( is_array_like=True, # passing a NumPy array means passing one value, for multiple use list bc_to_input=True, # broadcast to input broadcast_kwargs=dict( keep_raw=True # keep ori...
from django.urls import path from . import views urlpatterns = [ path('', views.index, name='index') ]
def countLev(List,L,R) : return List[L-1:R].count(1),List[L-1:R].count(2),List[L-1:R].count(3) for t in range(int(input())): cowNum=[] N,Q=map(int,input().split()) for u in range(N): cowNum.append(int(input())) L=[0 for i in range(Q)] R=[0 for j in range(Q)] for v in range(Q): ...
# -*- coding: utf-8 -*- """ square This file was automatically generated by APIMATIC v2.0 ( https://apimatic.io ). """ from square.api_helper import APIHelper from square.http.api_response import ApiResponse from square.api.base_api import BaseApi from square.http.auth.o_auth_2 import OAuth2 class ApplePayApi(Base...
from flask_unchained import BundleConfig class Config(BundleConfig): """ Default configuration options for the controller bundle. """ FLASH_MESSAGES = True """ Whether or not to enable flash messages. NOTE: This only works for messages flashed using the :meth:`flask_unchained.Co...
""" Copyright (c) Facebook, Inc. and its affiliates. """ import logging import sys import os import torch VOXEL_MODELS_DIR = os.path.dirname(os.path.realpath(__file__)) CRAFTASSIST_DIR = os.path.join(VOXEL_MODELS_DIR, "../") GEOSCORER_DIR = os.path.join(VOXEL_MODELS_DIR, "geoscorer/") sys.path.append(CRAFTASSIST_DIR)...
import os from flask import Blueprint, Flask, jsonify from .apis import api from .extensions import cors, db, jwt, mail, migrate, redis def create_app(): app = Flask(__name__) # set config app_settings = os.getenv('APP_SETTINGS') if os.getenv('APP_SETTINGS') else 'app.config.DevelopmentConfig' app...
import collections import uuid import logging import traceback from enum import IntEnum, unique from ._journal import syslog_priorities, send _priorities = syslog_priorities() __all__ = 'write', 'send', 'Priority', 'JournaldLogHandler', 'Facility' @unique class Priority(IntEnum): PANIC = _priorities['panic'] ...
# flake8: noqa E731 import keras from keras.layers import Conv2D, Dense, Dropout, Flatten, MaxPooling2D, Input from keras.models import Model from keras.utils import to_categorical import numpy as np from alibi.explainers import AnchorImage def test_anchor_image(): # load and prepare fashion MNIST data (x_tr...
# Copyright 2018 The Meson development 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 ...
# Copyright 2017 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...
# -*- coding: utf-8 -*- from __future__ import print_function from __future__ import unicode_literals import logging __version__ = '0.0.11' __all__ = ['logger', 'add_stderr_logger', 'InstaSession', 'InstaApiClient', 'InstaWebClient', 'InstaHashtag', 'InstaMedia', 'InstaUser'] logger = logging.g...
from SeisPolPy import Flinn, Pinnegar, Rstfr, Vidale import mat4py import numpy as np import base64 import io import matplotlib.pyplot as plt import matplotlib.image as mpimg data = mat4py.loadmat('SeisPolPy/tests/dataACRG.mat') # seismic data sig = np.array([data['t'], data['r'], data['z']]) def test_flinn(): f ...
# coding=utf-8 # Copyright 2018 The Tensor2Tensor 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...
from flask import abort from werkzeug.utils import cached_property from app.models import ( JSONModel, ModelList, SerialisedModelCollection, SortByNameMixin, ) from app.notify_client.email_branding_client import email_branding_client from app.notify_client.letter_branding_client import letter_branding_...
## @file # This file contain unit test for CommentParsing # # Copyright (c) 2011, Intel Corporation. All rights reserved.<BR> # # This program and the accompanying materials are licensed and made available # under the terms and conditions of the BSD License which accompanies this # distribution. The full text of the ...
# -*- coding: utf-8 -*- # Define here the models for your spider middleware # # See documentation in: # https://doc.scrapy.org/en/latest/topics/spider-middleware.html from scrapy import signals from scrapy.http import HtmlResponse from selenium import webdriver from selenium.webdriver.common.by import By from seleniu...
try: from .psgc import PasswordGenerator except: from psgc import PasswordGenerator import argparse def main(): parser = argparse.ArgumentParser(description='Password Generator') parser.add_argument('--max', type=int, help='Max length of password (default={})'.format(PasswordGe...
# Generated by Django 2.1.15 on 2021-06-01 15:26 from django.db import migrations, models class Migration(migrations.Migration): initial = True dependencies = [ ('auth', '0009_alter_user_last_name_max_length'), ] operations = [ migrations.CreateModel( name='User', ...
# Copyright (c) 2019 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 appli...
#!/usr/bin/env python """ Recursive spell check using "aspell" """ import shutil import subprocess from pathlib import Path from typing import Sequence, Tuple from argparse import ArgumentParser MAXSIZE = 20e6 # [bytes] EXE_GRAMMAR = shutil.which('diction') EXE_SPELL = shutil.which('aspell') if not EXE_SPELL: ra...
# Copyright 2015 Pants project contributors (see CONTRIBUTORS.md). # Licensed under the Apache License, Version 2.0 (see LICENSE). import re from collections import OrderedDict from dataclasses import dataclass from typing import Any, Dict, Iterable, Optional, Tuple from pants.build_graph.address import BuildFileAddr...
import math from collections import OrderedDict import pdb import torch import torch.nn as nn import torch.nn.functional as F from torch.nn.parameter import Parameter import os supported_rnns = { 'lstm': nn.LSTM, 'rnn': nn.RNN, 'gru': nn.GRU } supported_rnns_inv = dict((v, k) for k, v in supported_rnns.items()) c...
# Copyright 2013 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. { 'targets': [ { 'target_name': 'mozilla', 'type': '<(component)', 'sources': [ 'MozillaExport.h', 'NSPasteboard+Util...
import logging from typing import Callable import warnings warnings.filterwarnings('ignore') import numpy as np from beartype import beartype from UQpy.sampling.mcmc.baseclass.MCMC import MCMC from UQpy.distributions import * from UQpy.utilities.ValidationTypes import * class DRAM(MCMC): @beartype def __ini...
import libtorrent as lt import time import tempfile import shutil from JavPy.utils.requester import spawn import requests from JavPy.utils.config import proxy __tracker_list_url = ( "https://raw.githubusercontent.com/ngosang/trackerslist/master/trackers_best.txt" ) __tracker_url = "" def __set_tracker_list(rsp):...
#!/usr/bin/env python # -*- coding: utf-8 -*- """Crypto rdfvalue tests.""" import hashlib import os from grr import config from grr.lib import config_lib from grr.lib import flags from grr.lib import rdfvalue from grr.lib import type_info from grr.lib import utils from grr.lib.rdfvalues import crypto as rdf_crypto f...
"""Run webcam to detect persons and log data in a csv file Source: This code was modified from code provided by PyImageSearch. USAGE >>> python measure_persons.py -p MobileNetSSD_deploy.prototxt.txt -m MobileNetSSD_deploy.caffemodel press 'q' to quit """ # import the necessary packages from imutils.video import Vid...
''' Created on Aug 5, 2021 @author: willg ''' import discord import common import UserDataProcessing import UtilityFunctions import TableBotExceptions from collections import defaultdict from datetime import datetime import math bot_abuse_tracking = defaultdict(lambda: [0, [], [], 0]) blacklisted_command_count = def...
# Copyright 2013-2019 Lawrence Livermore National Security, LLC and other # Spack Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) from spack import * class PyMysqldb1(PythonPackage): """Legacy mysql bindings for python""" homepage = "https://...
import cv2 from random import randrange #loading pre-trained data on face frontals from opencv (haar cascade algorithm) trained_face_data = cv2.CascadeClassifier('haarcascade_frontalface_default.xml') #Chhose an image to dtecet faces in #img = cv2.imread('faces.jpg') #img = cv2.imread('faces.jpg') #Capture Video fr...
# -------------- #Importing header files import pandas as pd import numpy as np import matplotlib.pyplot as plt #Reading the file data=pd.read_csv(path) #Code starts here # Step 1 #Reading the file #Creating a new variable to store the value counts loan_status=data['Loan_Status'].value_counts() #Plotting bar pl...
from elixir import * class B(Entity): name = Field(String(30)) many_a = OneToMany('tests.a.A')
from .plugin import BasePlugin from .packages import PackagesPlugin
### # Copyright 2020 Hewlett Packard Enterprise, 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 ...
"""layer2c.py This file is part of keras2c Copyright 2020 Rory Conlin Licensed under MIT License https://github.com/f0uriest/keras2c Writes individual layers to C code """ # imports from keras2c.io_parsing import layer_type, get_model_io_names, get_all_io_names, get_layer_io_names, flatten import tensorflow as tf tf....
import pprint import boto3 import json from botocore.exceptions import ClientError from src.utils import utils from src.utils import awsutils def main(): vars = awsutils.read_vars() dynamodb = boto3.resource('dynamodb') table = dynamodb.Table(vars['DynamoDBSourceStacks']) dct = utils.g...
from __future__ import print_function, division from sympy.core import S, Dummy, pi from sympy.functions.combinatorial.factorials import factorial from sympy.functions.elementary.trigonometric import sin, cos from sympy.functions.elementary.miscellaneous import sqrt from sympy.functions.special.gamma_functions import ...
# -*- coding: utf-8 -*- """Console script for hauberk.""" import logging import sys import click import yaml from hauberk.log import setup_logger logger = logging.getLogger(__name__) @click.command() @click.argument('input', type=click.File('rb')) @click.option('--dry', is_flag=True, help="Dry run of rules") @cli...
#!/usr/bin/env python import sys, os, time, atexit from signal import SIGTERM # Update the dev 0 argument if (hasattr(os, "devnull")): DEVNULL = os.devnull else: DEVNULL = "/dev/null" # Defines the deamon class class Daemon: """ A generic daemon class. Usage: Subclass this class and override the...
""" This example is a trivial box that must superimpose one of its corner to a marker at the beginning of the movement and superimpose the same corner to a different marker at the end. It is designed to investigate the different way to define the initial guesses at each node sent to the solver All the types of interpo...
import os import sys from functools import partial import shutil import click from .. import _yaml from .._exceptions import BstError, LoadError, AppError, RemoteError from .complete import main_bashcomplete, complete_path, CompleteUnhandled from ..types import _CacheBuildTrees, _SchedulerErrorAction, _PipelineSelecti...
#!/usr/bin/env python # -*- coding:utf-8 -*- # ----------------- # Authur: 闫刚 # Create date: '2017/11/7' '15:29' # -----------------
#!/usr/bin/python # Copyright: Ansible Project # 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 DOCUMENTATION = ''' --- module: sqs_queue version_added: 1.0.0 short_description: Creates o...
from __future__ import print_function import sys from distutils.core import setup, Extension try: from Cython.Build import cythonize except ImportError: print('You need to install cython first - sudo pip install cython', file=sys.stderr) sys.exit(1) poppler_ext = Extension('poppler', ['poppler.pyx'], la...