text
stringlengths
2
999k
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Thu Oct 7 14:53:52 2021 @author: ml """ import ast import nltk from src.feature_extraction.feature_extractor import FeatureExtractor class BigramFeature(FeatureExtractor): def __init__(self, input_column): super().__init__([input_co...
''' For using this Script you need to install OpenCV in your machine ''' # Importing openCV library import cv2 as cv # Taking path of input from the user path = input("Enter the path of image: ") img = cv.imread(path) img = cv.resize(img, (640, 640)) # resizing the image # Printing the original image cv.imshow('Or...
from arcpy import Polygon, Polyline, Point, Array, PointGeometry, env env.outputMFlag = "Disabled" env.outputZFlag = "Disabled" from ponto_circ_borda import PtCircBorda projecao_plana = None projecao_geo = None intervalo_entre_linhas = None poligono_ma = None borda_linha_geo = None borda_linha_plana = None from math i...
import json import pytest from django.test import TestCase from django.contrib.auth.models import Group from django.db import IntegrityError import peeringdb_server.models as models import reversion class VeriQueueTests(TestCase): """ Test VerificationQueue creation and resolve """ @classmethod ...
from abc import ABCMeta, abstractmethod import threading import time import socket from queue import Queue import subprocess from .logging import exception_log, debug try: from typing import Callable, Dict, Any, Optional, IO assert Callable and Dict and Any and Optional and subprocess and IO except ImportError...
import os import sys from types import ModuleType from typing import Any # NOQA from optuna.types import TYPE_CHECKING _import_structure = { 'chainer': ['ChainerPruningExtension'], 'chainermn': ['ChainerMNStudy'], 'keras': ['KerasPruningCallback'], 'lightgbm': ['LightGBMPruningCallback'], 'mxnet...
# -*- coding: utf-8 -*- # Generated by Django 1.10.2 on 2017-03-29 04:21 from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('web', '0004_change_team_model_field_type'), ] operations = [ migrations.Alt...
# using the classes , re-creating hte same program of basics2.py here import sys from PyQt5.QtWidgets import QApplication, QGridLayout, QHBoxLayout, QGridLayout ,QMainWindow, QPushButton , QWidget, QAction from PyQt5.QtGui import QIcon from PyQt5.Qt import QLabel , QPushButton , QHBoxLayout , QVBoxLayout from ...
# 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. from typing import Tuple import numpy as np import xarray as xr def log1pexp(x: np.ndarray) -> np.ndarray: """ Compute log(1 + ex...
from flask_restplus import reqparse, inputs master_parser = reqparse.RequestParser() master_parser.add_argument('email', type=inputs.email(), required=True, help='Email Of User Being Registered') master_parser.add_argument('password', type=str, required=True, help=...
from django.db import models from django.contrib.auth.models import AbstractBaseUser, BaseUserManager, \ PermissionsMixin class UserManager(BaseUserManager): def create_user(self, email, password, **extra_fields): if not email: raise ValueError("Users mu...
import requests r = requests.get('http://bioimages.vanderbilt.edu/baskauf/24319.rdf') print('HTTP status code: ', r.status_code) # print(r.text)
# THIS FILE WAS AUTOMATICALLY GENERATED BY deprecated_modules.py import sys # mypy error: Module X has no attribute y (typically for C extensions) from . import _olivetti_faces # type: ignore from ..externals._pep562 import Pep562 from ..utils.deprecation import _raise_dep_warning_if_not_pytest deprecated_pa...
from rest_framework import viewsets from rest_framework.filters import SearchFilter from rest_framework.decorators import list_route from rest_framework.response import Response from apps.reputation.models import blacklist from apps.reputation.serializers import blSerializer, sourceSerializer from django_filters.rest_f...
import tensorflow as tf from tensorflow.keras.applications.resnet50 import ResNet50 from tensorflow.keras.applications.vgg16 import VGG16 from tensorflow.keras.applications.inception_v3 import InceptionV3 from tensorflow.keras.layers import Dense, GlobalAveragePooling2D, MaxPooling2D, Flatten, Input, Conv2D, concatenat...
#!/usr/bin/env python3 # Copyright (c) 2012 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. '''Unit tests for the admin template gatherer.''' from __future__ import print_function import os import sys if __name__ == '__m...
import sys from sys import stdin, stdout import time import gtk import __builtin__, gettext, gtk.glade gettext.install("pychess", unicode=1) t = gettext.translation("pychess", fallback=True) __builtin__.__dict__["ngettext"] = t.ungettext #evilness copy-paste from pychess startup script import pychess.Main from pyche...
from django.shortcuts import render from django.db import connection from django.http import HttpResponse import json from json import loads def traerAgendaMedico(request): dic = loads(request.body) dataRequestUsername=dic['username'] with connection.cursor() as cursor: cursor.execute("""SELECT...
from datetime import timedelta from time import sleep import pytest import httpx def test_get(server): url = server.url with httpx.Client() as http: response = http.get(url) assert response.status_code == 200 assert response.url == url assert response.content == b"Hello, world!" asse...
html_doc = """ <html><head><title>The Dormouse's story</title></head> <body> <p class="title"><b>The Dormouse's story</b></p> <p class="story">Once upon a time there were three little sisters; and their names were <a href="http://example.com/elsie" class="sister" id="link1">Elsie</a>, <a href="http://example.com/lacie...
from django.contrib.auth import get_user_model from .test_setup import TestSetUp User = get_user_model() class TestViews(TestSetUp): def test_user_cannot_register_with_no_data(self): res = self.client.post(self.register_url) self.assertEqual(res.status_code, 400) def test_user_can_register_...
import warnings from collections import defaultdict import numpy as np import pandas as pd from .coding import strings, times, variables from .coding.variables import SerializationWarning, pop_to from .core import duck_array_ops, indexing from .core.common import contains_cftime_datetimes from .core.pycompat import i...
"""Adaptive Lighting integration in Home-Assistant.""" import logging from typing import Any import voluptuous as vol from homeassistant.config_entries import SOURCE_IMPORT, ConfigEntry from homeassistant.const import CONF_SOURCE from homeassistant.core import HomeAssistant import homeassistant.helpers.config_validat...
import functools import simplejson as json def _assert_status_code(code, response): assert response['statusCode'] == code assert_200 = functools.partial(_assert_status_code, 200) assert_404 = functools.partial(_assert_status_code, 404) assert_500 = functools.partial(_assert_status_code, 500) def get_body_from_...
#!/usr/bin/env python3 # # Copyright (c) 2017 Intel Corporation # # SPDX-License-Identifier: Apache-2.0 import sys import re import argparse import os import json api_regex = re.compile(r''' __syscall\s+ # __syscall attribute, must be first ([^(]+) # type and name of system ...
from core.util_classes.robots import TwoLinkArm from core.util_classes.openrave_body import * import pybullet as P env = P.connect(P.DIRECT) body = OpenRAVEBody(env, 'arm', TwoLinkArm()) import ipdb; ipdb.set_trace()
"""Abstraction around cwltool and related libraries for loading a CWL artifact.""" import os from collections import namedtuple from six.moves.urllib.parse import urldefrag from .cwltool_deps import ( ensure_cwltool_available, load_tool, LoadingContext, schema_salad, workflow, ) RawProcessReferen...
# type: ignore """Basic test script using jaeger.""" # fmt:off from opentelemetry import trace from opentelemetry.exporter.jaeger.thrift import JaegerExporter from opentelemetry.sdk.resources import SERVICE_NAME, Resource from opentelemetry.sdk.trace import TracerProvider from opentelemetry.sdk.trace.export import Ba...
from django.db import migrations def create_site(apps, schema_editor): Site = apps.get_model("sites", "Site") custom_domain = "blue-snow-31543.botics.co" site_params = { "name": "Blue Snow", } if custom_domain: site_params["domain"] = custom_domain Site.objects.update_or_crea...
import cv2 from os.path import join import netharn as nh import numpy as np import torch import torchvision import ubelt as ub from torch import nn from sklearn import metrics import kwimage import kwarray class MNISTEmbeddingNet(nh.layers.Module): """ References: https://github.com/adambielski/siames...
# coding=utf-8 # Copyright (c) 2020, 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 re...
n1 = int(input('Digite um número: ')) n2 = int(input('Digite outro número: ')) s = n1 + n2 print('A soma entre {} e {} vale {}.'.format(n1,n2,s))
"""Library for interacting with InfluxDB.""" # Copyright (C) 2015 Research and Education Advanced Network New Zealand Ltd. # Copyright (C) 2015--2018 The Contributors # # 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 ...
#!C:\Users\Tjeerd Peters\Documents\Anaconda3\envs\test\python.exe """A script for casting spells on kfm files. This script essentially sets up the logger and calls :meth:`pyffi.spells.kfm.KfmToaster.cli`. """ # -------------------------------------------------------------------------- # ***** BEGIN LICENSE BLOCK ****...
__author__ = 'viktor' from abc import ABCMeta, abstractmethod class Observer(object): __metaclass__ = ABCMeta @abstractmethod def update(self, update): pass
import ssl from urllib.request import urlopen from urllib.parse import urlparse from pystac.stac_io import STAC_IO # Set the STAC_IO read method to read HTTP. # Skip SSL Certification because it fails on some machines. def unsafe_read_https_method(uri): parsed = urlparse(uri) if parsed.scheme == 'https': ...
""" Spatial autocorrelation for binary attributes """ __author__ = "Sergio J. Rey <srey@asu.edu> , Luc Anselin <luc.anselin@asu.edu>" from libpysal.weights.spatial_lag import lag_spatial from .tabular import _univariate_handler import numpy as np __all__ = ['Join_Counts'] PERMUTATIONS = 999 class Join_Counts(obje...
import logging import os import platform import socket import subprocess import sys import time import unittest import re from beat.beat import INTEGRATION_TESTS from elasticsearch import Elasticsearch from heartbeat import BaseTest class Test(BaseTest): def test_base(self): """ Basic test with ic...
""" Model dependent data transforms that apply MRAugment to training data before fed to the model. Modified from https://github.com/facebookresearch/fastMRI/blob/master/fastmri/data/transforms.py """ from typing import Dict, Optional, Sequence, Tuple, Union import fastmri import numpy as np import torch from fastmri....
# 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 t...
#!/usr/bin/env python # -*- coding: utf-8 -*- """ fMRI preprocessing workflow ===== """ import os import os.path as op from pathlib import Path import logging import sys import gc import re import uuid import json import tempfile import psutil import warnings import subprocess from argparse import ArgumentParser from...
import os import random import tempfile import shutil from unittest import TestCase from samcli.commands.init import do_cli as init_cli class TestCli(TestCase): def setUp(self): self.location = None self.runtime = "python3.6" self.dependency_manager = "pip" self.output_dir = temp...
import IPython import numpy as np from sklearn.feature_extraction import DictVectorizer from sklearn.svm import LinearSVC import drebin_class_split from masters.load_features import * from tesseract import evaluation, temporal, metrics, viz from sklearn.feature_extraction.text import TfidfVectorizer from sklearn.ensemb...
#!/usr/bin/python3 import sys import uuid from xrt_binding import * # found in PYTHONPATH sys.path.append('../') # utils_binding.py from utils_binding import * XVECTORSWIZZLE_CONTROL_ADDR_AP_CTRL = 0x00 XVECTORSWIZZLE_CONTROL_ADDR_GIE = 0x04 XVECTORSWIZZLE_CONTROL_ADDR_IER = 0x08 XVECTORSWIZZLE_CONTROL_ADDR_ISR = 0x0...
replies = [' Hey yoo', ' Waddup fam',' How you doin!', ' Howdy!', ' New account who dis?', ' stfu',' Hello there!',' Hewwo uWu',' k',' #Hello']
import os.path import glob import re import importlib _modules = glob.glob(os.path.dirname(__file__)+"/*.py") _submodules = [os.path.basename(f)[:-3] for f in _modules if os.path.isfile(f)] for _module in _submodules: with open(os.path.dirname(__file__) + '/' + _module + '.py', encoding='utf-8') as _...
"""Python wrappers around TensorFlow ops. This file is MACHINE GENERATED! Do not edit. Original C++ source file: gen_dataset_ops.cc """ import collections as _collections import six as _six from tensorflow.python import pywrap_tensorflow as _pywrap_tensorflow from tensorflow.python.eager import context as _context f...
# ------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for # license information. # -------------------------------------------------------------------------- """Data dr...
from django import forms from .models import RiderProfile from django.contrib.auth.models import User class UserForm(forms.ModelForm): class Meta: model = User fields = ('first_name','last_name','email') class ProfileForm(forms.ModelForm): class Meta: model = RiderProfile field...
import unittest from mock import patch import charms_storage.linux.loopback as loopback LOOPBACK_DEVICES = """ /dev/loop0: [0805]:2244465 (/tmp/foo.img) /dev/loop1: [0805]:2244466 (/tmp/bar.img) /dev/loop2: [0805]:2244467 (/tmp/baz.img) """ # It's a mouthful. STORAGE_LINUX_LOOPBACK = 'charms_storage.linux.loopback'...
import ast from itertools import chain, zip_longest from typing import Any from numerous.engine.model.graph_representation.graph import Node, Edge, Graph from numerous.engine.model.graph_representation.utils import str_to_edgetype, EdgeType from numerous.engine.model.utils import NodeTypes, recurse_Attribute op_sym_m...
import os import sys import ctypes from PyQt5 import uic from PyQt5 import QtCore, QtGui, QtWidgets from PyQt5.QtWidgets import QApplication, QMainWindow from PyQt5.QtGui import QIcon #from .tools.threadWorker import Worker application_path = os.path.abspath("") if sys.platform == "win32": myappid = u...
import os import uuid import subprocess import boto3 from hydra.cloud.abstract_platform import AbstractPlatform import getpass from requests import get class AWSPlatform(AbstractPlatform): def __init__( self, model_path, project_name, git_url, commit_sha...
#!/usr/bin/env python # -*- coding: utf-8 -*- # @Date : 2014-11-04 13:38:58 # @Author : yml_bright@163.com INDEX_URL = "https://nic.seu.edu.cn/" LOGIN_URL = "https://selfservice.seu.edu.cn/selfservice/campus_login.php" CHOISE_URL = "https://selfservice.seu.edu.cn/selfservice/service_manage_index.php" DETIAL_URL = ...
import sys from importlib import import_module from .compiler import config_compiler as config_compiler from .compiler import actions as actions def get_object_from_standard_name(std_name: str): pckg_parts = std_name.split(".") pckg_name, cls_name = ".".join(pckg_parts[:-1]), pckg_parts[-1] try: p...
import uuid from .context_managers import change_logging class ObjectChangeMiddleware(object): """ This middleware performs three functions in response to an object being created, updated, or deleted: 1. Create an ObjectChange to reflect the modification to the object in the changelog. 2. En...
import fileinput import re # Usage: cat input | python3 main.py contentsOf = {} containersOf = {} def main(): for line in fileinput.input(): split = line.split(" bags contain ") containingColor = split[0] containsList = split[1].split("bag") containsList = [x.strip(" ,.s") for x i...
""" _SummaryHistogram_ Histogram module, to be used by the TaskArchiver to store histograms in the summary. Created on Nov 16, 2012 @author: dballest """ from WMCore.DataStructs.WMObject import WMObject class SummaryHistogram(WMObject): """ _SummaryHistogram_ Histogram object, provides familiar CRUD me...
#!/usr/bin/env python3 import os import spotipy import spotipy.util as util import telegram playlist_id = "3Kz9W3n6zGkHVBtoGU9mwI" username = "floresrobles" max_tracks_on_playlist = 400 country = "FR" scope = 'playlist-modify-public' max_albums_per_call = 20 max_tracks_per_call = 100 def fetch_followed_artists(sp)...
from datetime import datetime from RestfulAPI.models.users import Users from RestfulAPI.service.insfrastructure.user_repo import UsersPG class AccountService: def __init__(self): self.user_pg = UsersPG() @staticmethod def is_valid_account(username, password): user = Users.query.filter_by...
from __future__ import absolute_import from __future__ import division from collections import defaultdict import numpy as np import sys import copy import random class RandomIdentitySampler(object): def __init__(self, dataset_size): self.size = dataset_size def __iter__(self): re...
__copyright__ = "Copyright 2013-2016, http://radical.rutgers.edu" __license__ = "MIT" import copy import radical.utils as ru from .continuous import Continuous from ... import states as rps from ... import constants as rpc # ------------------------------------------------------------------------------ # # ...
import math import array import pyaudio from random import randint # Audio helper constants _T = 11025 _q = 127 _p = -_q _N = 255 * 4 class SoundFX: # Defined sounds NO_SOUND = '' CRASH_SOUND = array.array('b', (max(_p, min(_q, int(_T * math.sin(i * 0.01)))) for i in ...
import sys from os.path import join, relpath, dirname upper_dir = join(dirname(relpath(__file__)), "..") sys.path.append(upper_dir) from torch import nn, cat from base_model import ImageClassificationLightningModule from typing import Callable class EfficientNetLightningModuleWithTwoBackbones(ImageClassificationLig...
# Copyright (c) 2013, Felipe Andres Manzano # 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 copyright notice, # this list of co...
"""SCons.Tool.Packaging.src_targz The targz SRC packager. """ # # Copyright (c) 2001 - 2019 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, inclu...
from monster.tests.tempest_neutron import TempestNeutron from monster.tests.tempest_quantum import TempestQuantum def get_test_suite_for(self, deployment): """Given rcbops branch, returns tempest branch. :rtype: string """ if deployment.branch and "grizzly" in deployment.branch: tempest = Temp...
# Copyright 2002-2011 Nick Mathewson. See LICENSE for licensing information. """mixminion.ServerKeys Classes for servers to generate and store keys and server descriptors. """ #FFFF We need support for encrypting private keys. __all__ = [ "ServerKeyring", "generateServerDescriptorAndKeys", "genera...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Sat Apr 10 22:15:17 2021 @author: jmontp """ import numpy as np import pandas as pd import pickle from sklearn.decomposition import PCA #Relative Imports from .context import math_utils #Set test assert_pd for speed boost math_utils.test_pd = False ...
from unittest.mock import MagicMock import pytest from prefect.tasks.azureml import ( DatasetCreateFromDelimitedFiles, DatasetCreateFromParquetFiles, DatasetCreateFromFiles, ) @pytest.fixture def mock_datastore(): workspace = MagicMock() datastore = MagicMock(workspace=workspace) return data...
# coding: utf-8 """ Kubernetes No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 The version of the OpenAPI document: release-1.21 Generated by: https://openapi-generator.tech """ from __future__ import absolute_import import r...
# -*- coding: utf-8 -*- # Copyright 2020 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 # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or...
from enum import Enum from django.core.exceptions import ImproperlyConfigured from django.http import JsonResponse class PopupValidAction(Enum): new_form = 0 close = 1 reload = 2 redirect = 3 class PopupFormMixin(object): form_valid_action = PopupValidAction.reload template_name = 'dcbase/f...
from datetime import time from pytz import timezone from pandas import Timestamp from pandas.tseries.offsets import DateOffset from catalyst.utils.memoize import lazyval from .trading_calendar import TradingCalendar class OpenExchangeCalendar(TradingCalendar): @property def name(self): return 'OPEN...
# SOMANDO NÚMEROS n1 = int(input('Digite um num: ')) n2 = int(input('Digite outro num: ')) soma = n1 + n2 print('O valor da soma é {0}'.format(soma))
# coding=utf-8 # *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. *** # *** Do not edit by hand unless you're certain you know what you are doing! *** import json import warnings import pulumi import pulumi.runtime from .. import utilities, tables class RouteTableAssociation(pulumi.Cu...
from typing import Dict, Optional, Tuple from chives.types.blockchain_format.program import Program, INFINITE_COST from chives.types.condition_opcodes import ConditionOpcode from chives.types.spend_bundle import SpendBundle from chives.util.condition_tools import conditions_dict_for_solution from chives.wallet.cc_wall...
print('heello world')
# Copyright 2015 Google Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in w...
import datetime # -- Project information ----------------------------------------------------- project = 'rules_proto_grpc' copyright = '{}, rules_proto_grpc authors - Apache 2.0 License'.format( datetime.date.today().year ) author = 'rules_proto_grpc authors' release = '' version = release # -- General configu...
import numpy as np import pytest import jams from soundata import jams_utils, annotations def get_jam_data(jam, namespace, annot_numb): time = [] duration = [] value = [] confidence = [] for obs in jam.search(namespace=namespace)[annot_numb]["data"]: time.append(obs.time) duration...
import jinja2 from ddtrace.vendor.wrapt import wrap_function_wrapper as _w from ddtrace import config from ...constants import SPAN_MEASURED_KEY from ...ext import SpanTypes from ...utils.formats import get_env from ...pin import Pin from ...utils.wrappers import unwrap as _u from .constants import DEFAULT_TEMPLATE_N...
##=============================================== ## Jiadong Mai (20557203) ## CS 116 Winter 2018 ## Assignment 04, Question 3 ##=============================================== import math import check # A MineGrid is a (listof (listof Bool)) # Requires: All lists are non-empty # Each (listof Bool)...
import configparser import datetime import smtplib from string import Template from email.mime.multipart import MIMEMultipart from email.mime.text import MIMEText import smtplib from os.path import basename from email.mime.application import MIMEApplication from email.mime.multipart import MIMEMultipart from email.mime...
$NetBSD: patch-setup.py,v 1.1 2021/02/15 15:14:56 mef Exp $ UnicodeDecodeError: 'ascii' codec can't decode byte 0xe2 in position 2071: ordinal not in range(128) --- setup.py.orig 2020-09-03 09:31:05.000000000 +0900 +++ setup.py 2021-02-16 00:03:32.721946377 +0900 @@ -1,5 +1,6 @@ #!/usr/bin/env python # -*- coding: ...
from __future__ import annotations import dataclasses from typing import ( TYPE_CHECKING, Any, Callable, List, Mapping, Optional, Sequence, Type, TypeVar, Union, ) from strawberry.type import StrawberryType, StrawberryTypeVar from strawberry.utils.typing import is_generic as is...
#this was initiated by atom(conan) #partially modified by opkr from cereal import log from common.params import Params from selfdrive.car.hyundai.spdcontroller import SpdController import common.log as trace1 LaneChangeState = log.LateralPlan.LaneChangeState class SpdctrlLong(SpdController): def __init__(self...
from django.apps import AppConfig from django.utils.functional import cached_property from django.utils.translation import ugettext_lazy as _ from pretix import __version__ as version class BankTransferApp(AppConfig): name = 'pretix.plugins.banktransfer' verbose_name = _("Bank transfer") class PretixPlu...
#!/usr/bin/env python2 # Copyright (c) 2014-2015 The Bitcoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. # # Test proper accounting with a double-spend conflict # from test_framework.test_framework import Bitc...
"""Api Gateways""" import logging import ast import os import trafaret import numpy as np from flask import jsonify, abort, make_response, request from flask import Blueprint from flask_cors import CORS import algorithmsWrapper PATH_DATA = './../data' logger = logging.getLogger(__name__) bp = Blue...
# Copyright 2020 - 2021 MONAI Consortium # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # http://www.apache.org/licenses/LICENSE-2.0 # Unless required by applicable law or agreed to in wri...
#!/usr/bin/env python import py4j import unittest, logging, sys, os from zensols.clojure import Clojure logger = logging.getLogger('py4j.clojure.test') class TestClojure(unittest.TestCase): def test_call(self): self.assertEqual('test||one||2234', Clojure.call('clojure.string', 'join', '||', ['test', 'one...
# coding=utf-8 # *** WARNING: this file was generated by the Pulumi SDK Generator. *** # *** Do not edit by hand unless you're certain you know what you are doing! *** import warnings import pulumi import pulumi.runtime from typing import Any, Mapping, Optional, Sequence, Union from ... import _utilities, _tables from...
from scapy.all import * import random import time import sys import base64 from msg_templates import * # https://www.tenable.com/security/research/tra-2018-40 # This code crafts and sends UDP packets to invoke restricted commands # found in Zoom's ssb_sdk # class Zoomster: ''' Toolset Invokes Restricted Funct...
#!/usr/bin/python # Copyright (c) 2020, 2021 Oracle and/or its affiliates. # This software is made available to you under the terms of the GPL 3.0 license or the Apache 2.0 license. # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) # Apache License v2.0 # See LICENSE.TXT for d...
from os.path import abspath from os.path import basename from os.path import dirname from os.path import join from os.path import normpath from sys import path PROJECT_PATH = dirname(abspath(__file__)) PROJECT_NAME = basename(PROJECT_PATH) PROJECTS_PATH = normpath(join(PROJECT_PATH, '..')) APPLICATIONS_PATH = normpat...
# MNIST data set of handwritten digits from (http://yann.lecun.com/exdb/mnist/). import tensorflow as tf import matplotlib.pyplot as plt from tensorflow.examples.tutorials.mnist import input_data mnist = input_data.read_data_sets("/tmp/data/", one_hot=True) # Data Format type(mnist) type(mnist.train.images) # mnist....
from pathlib import Path import typer from sss_cli.keychain import get_real_key from .encryption import encrypt from .helper import config, write_file def share( config_path: str = typer.Argument(..., help="Path to your repo"), key: str = typer.Option("", "-k", "--key", help="Password as plaintext"), ): ...
print(sum([1,2,3,4,5,6,7,8,9,10])) a = 1 total = 0 while a <= 10: total = total + a a = a + 1 print(total) print(sum([1,2,3,4,5,6,7,8,9,10]))
#!/usr/bin/env python import os import sys if __name__ == "__main__": os.environ.setdefault("DJANGO_SETTINGS_MODULE", "radius.settings") from django.core.management import execute_from_command_line execute_from_command_line(sys.argv)