content
stringlengths
5
1.05M
from __future__ import annotations from collections.abc import Sequence from pathlib import Path from typing import Optional, Union from attrs import define, field from flask import current_app from loguru import logger from PIL.ImageFont import FreeTypeFont, ImageFont, truetype class UnknownFont(KeyError): pas...
#This file is part of ElectricEye. #SPDX-License-Identifier: Apache-2.0 #Licensed to the Apache Software Foundation (ASF) under one #or more contributor license agreements. See the NOTICE file #distributed with this work for additional information #regarding copyright ownership. The ASF licenses this file #to you un...
# coding: utf-8 import ncloud_server from ncloud_server.api.v2_api import V2Api from ncloud_server.rest import ApiException import ncloud_apikey configuration = ncloud_server.Configuration() apikeys = ncloud_apikey.ncloud_key.NcloudKey().keys() configuration.access_key = apikeys['access_key'] # "C9zx~~~~~~~~~~~~AXKn...
'''This helper module orchestrates the generation of OpenCL code, compiles it and makes it available for use. Overview ~~~~~~~~~ Look first at sph/tests/test_acceleration_eval.py to see the big picture. The general idea when using AccelerationEval instances is: - Create the particle arrays. - Specify any equations a...
import logging import multiprocessing import os.path import sys from os_ import is_my_pc from file import FileUtil from mpfhandler import MultProcTimedRotatingFileHandler lock = multiprocessing.Lock() class LogUtil(object): inited = False __default_logger_name = 'root' __log = None source_filepath =...
from six.moves.urllib import parse from wptserve.utils import isomorphic_encode def main(request, response): response.headers.set(b'Set-Cookie', isomorphic_encode(parse.unquote(request.url_parts.query))) return [(b"Content-Type", b"text/plain")], b""
#!/usr/bin/env python import csv import requests # Write results to this file resultfile = open('results.csv', 'w') # Field names are hardcoded here. field_names = ['name', 'frame_number', 'start', 'villaines-221', 'fougeres-310', 'tinteniac-364', 'loudeac-449', 'carhaix-525', 'brest-618', 'carhaix-703', 'loudeac-782...
from models.customdice import CustomDice from dotenv import load_dotenv from discord.ext import commands from os import getenv ##### VARIABLES ##### # load enviroment variables from .env file load_dotenv() # get discord token from enviroment DISCORD_TOKEN = getenv("DISCORD_TOKEN") # set discord client with command...
from airflow import DAG from airflow.operators.bash_operator import BashOperator from airflow.operators.python_operator import PythonOperator from datetime import datetime, timedelta default_args = { 'owner': 'Neylson Crepalde', "depends_on_past": False, "start_date": datetime(2020, 11, 14), "...
from unittest import TestCase import TravelTime as tt import pandas as pd import datetime class TestTravelTime(TestCase): TEST_DATETIME = datetime.datetime(2021, 1, 1) def test_average_list_function_int(self): test_list = [datetime.timedelta(seconds=3), datetime.timedelta(seconds...
import sys dict = {'UUU': 'F', 'CUU':'L', 'AUU':'I', 'GUU':'V', 'UUC':'F', 'CUC':'L', 'AUC': 'I', 'GUC':'V', 'UUA':'L', 'CUA': 'L', 'AUA': 'I', 'GUA':'V', 'UUG': 'L', 'CUG': 'L', 'AUG': 'M', 'GUG': 'V', 'UCU': 'S', 'CCU':'P', 'ACU': 'T', 'GCU': 'A', 'UCC': 'S', 'CCC': 'P', 'ACC': 'T', 'GCC': 'A', 'UCA': 'S', 'CCA'...
from numpy import arcsin, exp, sqrt def _comp_point_coordinate(self): """Compute the point coordinates needed to plot the Hole. Parameters ---------- self : VentilationPolar A VentilationPolar object Returns ------- point_dict: dict A dict of the slot point coordinates ...
import sys import numpy as np import pandas as pd import matplotlib as plt import seaborn as sns import numpy as np import pandas as pd import matplotlib.pyplot as plt import seaborn as sns import xlrd def main(argv): print("hello") # 读取表格 data = xlrd.open_workbook("developers.xlsx") # 获取表格的sheets table =...
from django import template from django.template.defaultfilters import * from BeautifulSoup import BeautifulSoup as soup register=template.Library() @register.filter @stringfilter def prettyhtml(value, autoescape=None): value=str(soup(value)) if autoescape and not isinstance(value, SafeData): from dja...
from clustering import * from sklearn import metrics cluster = clustering(120) cluster.kmeans_cluster() chi = metrics.calinski_harabaz_score(cluster.data, cluster.data_label) print(chi)
import torch import numpy as np import scipy import pdb def sampling_bernoulli(probs): #pdb.set_trace() return probs - torch.rand(probs.size()).cuda() def sampling_gaussian(probs): return probs+ torch.rand(probs.size()).cuda() def softmax(x, axis=None): x = x - x.max(axis=axis, keepdims=True) y...
print(""" 087) Aprimore o desafio anterior, mostrando no final: A) A soma de todos os valores pares digitados. B) A soma dos valores da terceira coluna. C) O maior valor da segunda linha. """) matriz = [[0, 0, 0], [0, 0, 0], [0, 0, 0]] spar = maior = scol = 0 for l in range(0,3): for c in range(0,3): matri...
# -*- coding: utf-8 -*- import io from setuptools import setup try: long_description = io.open('README.md',encoding='utf8').read() except: long_description ='Package containing the tools necessary for decomposing a \ speech signal into its modulated components, aka AM-FM decomposition.' setup( ...
import pydle from pytest import mark from .fixtures import with_client from .mocks import MockClient, MockServer, MockConnection, MockEventLoop @mark.meta @with_client(connected=False) def test_fixtures_with_client(server, client): assert isinstance(server, MockServer) assert isinstance(client, MockClient) ...
#!/usr/bin/env python """ # > Various modules for handling data # # Maintainer: Jahid (email: islam034@umn.edu) # Interactive Robotics and Vision Lab (http://irvlab.cs.umn.edu/) # Any part of this repo can be used for academic and educational purposes only """ from __future__ import division from __future__ import abs...
# # Copyright (c) 2017, Massachusetts Institute of Technology 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 o...
#!/usr/bin/env python import fileinput import re acronym = "" for line in fileinput.input(): words = re.split('\s+', line) for word in words: if (len(word) > 0 and word[0] == word[0].upper()): acronym += word[0] print(acronym)
import optparse import logging from cStringIO import StringIO import babel.messages.catalog import babel.messages.pofile from deskapi.models import DeskApi2 from django.conf import settings import txlib_too.api.statistics import txlib_too.api.translations from txlib_too.http.exceptions import NotFoundError from trans...
from setuptools import setup import os VERSION = "0.4.1" def get_long_description(): with open( os.path.join(os.path.dirname(os.path.abspath(__file__)), "README.md"), encoding="utf8", ) as fp: return fp.read() setup( name="download-tiles", description="Download map tiles and...
import os TENDERS_SALE_URL = os.getenv( "TENDERS_SALE_URL", "http://arepublixchickentendersubsonsale.com/" ) ONSALE_STRING = os.getenv( "ONSALE_STRING", "onsale:yes" ) ONSALE_YES = "Oh yeah they are!" ONSALE_NO = "Sorry, not today!"
from . import instance, obj, pose_auxs, renderer, std_auxs, tfms
# -*- coding: utf-8 -*- class ImPython2NewStyle(object): def __init__(self, first, second, **kwargs): """Initialize the demo class.""" super(ImPython2NewStyle, self).__init__(**kwargs) self.first = first self.second = second def get_tuple(self): return ( ...
from krux.qr import FORMAT_NONE, FORMAT_PMOFN, FORMAT_UR from .shared_mocks import * from krux.key import Key from embit.networks import NETWORKS from embit.descriptor import Descriptor import binascii from ur.ur import UR import pytest TEST_MNEMONIC1 = ( "olympic term tissue route sense program under choose bean ...
import collections import sys import wandb TYPE_TO_TYPESTRING = { str: 'str', int: 'int', float: 'float', wandb.types.Image: 'image', wandb.types.Percentage: 'percentage', wandb.types.Histogram: 'histogram' } # Just used in an error message VALID_TYPE_NAMES = [ t.__name__ if t.__module__...
#!/usr/bin/python3.7 # -*- coding: utf-8 -*- ########################################## #Codi adaptat per l'equip A1 ########################################## from collections import deque, namedtuple import requests #import urllib.request from random import random import time import serial import R...
class Square: def __init__(self, lado="0"): self.lado = lado @property def lado(self): return self.__lado @lado.setter def lado(self, valor): if valor.isdigit(): self.__lado = valor else: print("O valor do lado deve ser apenas em numeros") ...
#------------------------------------------------------------------------------ import sys import os import platform from ctypes import (c_int, c_char_p, c_double, c_void_p, POINTER, CDLL, RTLD_GLOBAL) #------------------------------------------------------------------------------ EPH_AU = 1 EPH...
# -*- coding: utf-8 -*- # Copyright 2021 releng-tool from releng_tool.packages.exceptions import RelengToolCyclicPackageDependency from tests import prepare_testenv from tests.support.pkg_config_test import TestPkgConfigsBase class TestPkgConfigsCyclic(TestPkgConfigsBase): def test_pkgconfig_cyclic_explicit_loadi...
############################################################################## # PlasmaWriter.py # https://github.com/DigiLog-N/DigiLog-N # Copyright 2020 Canvass Labs, 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 ...
def rain_amount(mm): return "You need to give your plant {}mm of water".format(40 - mm) if (mm < 40) else "Your plant has had more than enough water for today!"
#!/usr/bin/env python3 """Example file for Eternal Egypt library.""" import sys import asyncio import aiohttp import logging import eternalegypt logging.basicConfig(level=logging.DEBUG) async def send_message(): """Example of sending a message.""" jar = aiohttp.CookieJar(unsafe=True) websession = aioh...
from sage.misc.lazy_import import lazy_import lazy_import('sage.sets.real_set', 'RealSet') from set import Set from integer_range import IntegerRange from non_negative_integers import NonNegativeIntegers from positive_integers import PositiveIntegers from finite_enumerated_set import FiniteEnumeratedSet lazy_import('sa...
import os import pickle import PIL import tensorflow as tf import copy import operator import numpy as np import pydegensac from scipy import spatial from tqdm import tqdm from glr import HOMOGRAPHY_CONFIDENCE, ID_PATH, MAX_INLIER_SCORE, MAX_RANSAC_ITERATIONS, MAX_REPROJECTION_ERROR, TOP_K def get_image_path(imag...
from django.urls import path from . import views from django.contrib.staticfiles.urls import staticfiles_urlpatterns urlpatterns = [ path('', views.index), #the path for our index view ] urlpatterns += staticfiles_urlpatterns()
from cowbird.api import schemas as s from cowbird.utils import get_logger def includeme(config): logger = get_logger(__name__) logger.info("Adding API base routes...") config.add_route(**s.service_api_route_info(s.ServicesAPI)) config.add_route(**s.service_api_route_info(s.ServiceAPI)) config.scan...
import argparse from .constants import Constant class Arguments: # pylint: disable=too-few-public-methods """Command line argument handler.""" def __init__(self, url: str, debug: bool, browser: bool) -> None: self.url: str = url self.debug: bool = debug self.browser: bool = brows...
import pytest from primrose.dag.depth_first_traverser import DepthFirstTraverser from primrose.dag.config_layer_traverser import ConfigLayerTraverser from primrose.dag.traverser_factory import TraverserFactory def test_instantiate(): assert isinstance( TraverserFactory().instantiate("DepthFirstTraverser",...
import falcon from .base import BaseResource from .user import UserResource from minesweeper.models.game import GameModel from minesweeper.serializers.game import GameSchema class GameResource(BaseResource): """Class for modeling an API game resource. """ resource_name = 'game' model_cls = GameModel ...
import math import numpy as np import networkx as nx import matplotlib.pyplot as plt import random from scipy.linalg import subspace_angles ### HELPER FUNCTIONS ### def subspace_dist(A, B): ''' Inputs: A, B - Two subspaces (columns of each matrix are basis for the subspace) Outputs: The distance ...
# pip install requests import requests def url_ok(url_check): try: response = requests.head(url_check) if response.status_code == 200: return "True" else: return "False" except requests.ConnectionError as e: return e url = "https://a...
import sys sys.path.insert(0, 'src/') from contextlib import contextmanager from StringIO import StringIO from pasqua import main import unittest @contextmanager def captured_output(): new_out, new_err = StringIO(), StringIO() old_out, old_err = sys.stdout, sys.stderr try: sys.stdout, sys.stderr ...
from .helper import BJOTest from bernard.actors import Locker, Notifier from bernard.loader import validate_actor_config from praw.models import Comment, Submission class TestValidation(BJOTest): def setUp(self): super().setUp() def test_bad_param_type(self): params = {"text": 3} with...
from __future__ import print_function import evdev as ev import glob import bluetooth as bt from gi.repository import GLib from pydbus import SystemBus from dbus import Server def ask(prompt): return 1111 def set_trusted(path): props = bus.get('org.bluez', path)['org.freedesktop.DBus.Properties'] print...
import setuptools from setuptools import find_packages CLASSIFIERS = [ 'Development Status :: 3 - Alpha', 'License :: OSI Approved :: MIT License', 'Environment :: Console', 'Topic :: Internet :: Name Service (DNS)' ] setuptools.setup(name='autodns', version='0.0.1', ...
""" Django Scaffold Tools Helps to setup DRF to be ready with few lines of code, with easy convention configuration of serializers and viewsets. """ from .version import VERSION __version__ = VERSION
from django.apps import AppConfig class WorkScheduleConfig(AppConfig): name = 'work_schedule'
from setuptools import setup setup( name='DrivePy', version='0.1.0', author='Joey Yakimowich-Payne', author_email='jyapayne@gmail.com', packages=['drivepy', 'drivepy.test'], url='https://github.com/jyapayne/DrivePy/', license='LICENSE', description='Pythonic Google Drive API Bindings.',...
#!/usr/bin/env python print "Sensor Manager..." print "CS294-84 project based on code from Tinaja labs" print "-----------------------------------------------" import serial, time, urllib from server import log_data_file, instructions_data_file, touch SERIALPORT = "/dev/ttyAMA0" # the com/serial port the XBee is ...
#!/usr/bin/env python import xml.etree.ElementPath as EP import xml.etree.ElementTree as ET def xmlinsert(xpath, xmlfile, tag=".", findall=False): """Inserts elements from an xpath refs: xml.etree.ElementPath https://github.com/python/cpython/blob/3.7/Lib/xml/etree/ElementPath.py Args: ...
#!/usr/bin/env python from tkinter import * from PIL import Image, ImageTk FILE_NAME = "remote.jpg" def main(): root = Tk() frame = Frame(root, bd=2, relief=SUNKEN) frame.grid_rowconfigure(0, weight=1) frame.grid_columnconfigure(0, weight=1) xscroll = Scrollbar(frame, orient=HORIZONTAL) xscroll.grid(row...
import enum class State(enum.Enum): def __str__(self): return self.name class OnState(State): OFF = 0 ON = 1 class PowerUsage(State): LOW = 0 REGULAR = 1 class TankSize(State): SMALL = 180 LARGE = 270
# -*- coding: utf-8 -*- import datetime from cms.models import Placeholder from south.db import db from south.v2 import DataMigration from django.db import models class Migration(DataMigration): def forwards(self, orm): "Write your forwards methods here." # Note: Don't use "from appname.models imp...
TITLE = "Commercial doublets from Thorlabs and Edmund" DESCRIPTION = """ Several achromatic doublets from Thorlabs and Edmund Optics have been included (the visible series AC254-xxx-A from thorlabs for instance). They have been modelled according to the specifications from both manufacturers using the complete di...
with open('hightemp.txt') as f: print(len(f.read().split('\n')[:-1]))
import os from twilio.rest import Client # To set up environmental variables, see http://twil.io/secure account_sid = os.environ['TWILIO_ACCOUNT_SID'] # Your Account SID from www.twilio.com/console api_key = os.environ['TWILIO_API_KEY'] # You can generate this from www.twilio.com/console/runtime/api-keys/create api_...
import copy import json import pytest from web3 import Web3 from web3.providers.eth_tester import EthereumTesterProvider from ethpm import V2_PACKAGES_DIR from ethpm.utils.chains import ( get_chain_id, create_block_uri, ) PACKAGE_NAMES = [ 'escrow', 'owned', 'piper-coin', 'safe-math-lib', ...
# -*- coding:utf8 -* from mxnet import gluon import mxnet as mx from mxnet.gluon import nn from mxnet import nd import time def layer4(): network_name = "layer4" net=gluon.nn.HybridSequential() net.add(nn.Dense(128, activation='relu')) net.add(nn.Dense(256, activation='relu')) net.add(nn.Dense(512,...
import logging import signal from PySide2 import QtCore import vstreamer_utils class VideoStreamerServerApplication(QtCore.QCoreApplication): def __init__(self, argv): super().__init__(argv) self.setApplicationName("video_streamer_server") self.logger = vstreamer_utils.make_logger() ...
import tensorflow as tf from JPS import JigsawPuzzleSolver from FT import FineTuning import argparse parser = argparse.ArgumentParser() parser.add_argument('-m', '--task', help='Mode with which to run main: jps or fn (Jiggle Puzzle Solver or Fine Tuning)', required=True) args = vars(parser.parse_args()) task = str(arg...
# 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...
# # MIT License # # (C) Copyright 2020-2022 Hewlett Packard Enterprise Development LP # # 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...
#!/usr/bin/env python3 #-*- coding: utf-8 -*- """ A module contains py3Dmol functions to draw molecules """ from typing import Optional import py3Dmol from rdmc.mol import RDKitMol def mol_viewer(obj: str, model: str = 'xyz', model_extra: Optional[dict] = None, animate:...
import csv from typing import List, Optional from restapi.config import DATA_PATH from restapi.connectors import neo4j from restapi.utilities.logs import log class Initializer: def __init__(self) -> None: # enter GeoData in neo4j attributes: Optional[List[str]] = None graph = neo4j.get_in...
# # PySNMP MIB module BLADE-MIB (http://snmplabs.com/pysmi) # ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/BLADE-MIB # Produced by pysmi-0.3.4 at Wed May 1 11:39:05 2019 # On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4 # Using Python version 3.7.3 (default, Mar 27 2019, 09:23...
#Peter J. Mangelsdorf #Test for gInt.py #Imports from unittest import Testcase import gInt import random #Main def main(): #List of gInts to Test. gInts = [gInt(3,2), gInt(-8,3), gInt(5,2), gInt(0,1), gInt(1,0)] #Lists of Expected Values. gAdds = [gInt(3,2), gInt(-8,3), gInt(5,2), gInt(0,1), gInt...
#faça um progarama que leia a largura e a altura de uma paredee em metros, calcule sua area e a quantidade necessaria de tinta para pinta-la sabendo que cada litro de tinta pinta uma area de 2m²' print('\033[1;31m---PINTANDO A PAREDE---\033[m') #titulo l = float(input('Insira a largura da parede em metros: ')) #input d...
# 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 ...
from abc import ABC import numpy as np class AbstractCallback(ABC): """Another class inheriting ``AbstractCallback`` can overwrite one or more of the class methods. The callback can then be used in a call of :meth:`fruits.core.fruit.Fruit.transform`. """ def on_next_branch(self): ""...
#!/usr/bin/env python3 import argparse import contextlib import functools import http.server import os import os.path import pathlib import shutil import subprocess import sys import threading import types import webbrowser # Sphinx' command scripts, as defined by sphinx' own setup.py # # Unfortunately we cannot jus...
from pymol import cmd, stored, math def pairwise_dist(sel1, sel2, max_dist, output="N", sidechain="N", show="N"): """ usage: pairwise_dist sel1, sel2, max_dist, [output=S/P/N, [sidechain=N/Y, [show=Y/N]]] sel1 and sel2 can be any to pre-existing or newly defined selections max_dist: max...
# round print(round(1.2)) print(round(1.6)) # abs print(abs(1.5)) print(abs(-3.4))
# Raster generator import numpy as np import rasterio import rasterio.mask from rasterio.io import MemoryFile from rasterio.transform import from_origin from rasterio.plot import show import matplotlib.pyplot as plt def make_masked_raster(polygon, resolution, bands=1, all_touched=False, nodata=-...
# -*- coding: utf-8 -*- """ Created on Tue May 26 07:49:48 2020 this is only for use on HFUS @author: X202722 """ def make_parameter_HFUS_fit (T_sim, T_exp, method, na, M): import numpy as np # fit if possible BPT guess to OffsetP = 0 OffsetP = T_exp-T_sim return OffsetP def useOf...
import argparse import math import h5py import numpy as np import socket import importlib import matplotlib.pyplot as plt import os import sys BASE_DIR = os.path.dirname(os.path.abspath(__file__)) sys.path.append(BASE_DIR) sys.path.append(os.path.join(BASE_DIR, 'models')) sys.path.append(os.path.join(BASE_DIR, 'utils'...
import datetime import json import factory from bc.recruitment.constants import JOB_BOARD_DEFAULT factory.Faker._DEFAULT_LOCALE = "en_GB" class JobCategoryFactory(factory.django.DjangoModelFactory): title = factory.Sequence(lambda n: f"Job Category {n}") description = factory.Faker("sentence", nb_words=10...
"""Test for collections_extended factory.""" from collections_extended import ( collection, bag, setlist, frozenbag, frozensetlist, ) def test_collection_factory(): """Test collection factory.""" assert type(collection()) == bag assert type(collection(ordered=True)) == list assert type(collection(unique=Tr...
#!/usr/local/bin/python3.4 ### Common libraries import datetime import urllib.request import calendar import fileinput import os import sys import re import linecache ### My own libraries import sendEmail class video: def __init__(self, videoName, teamName, teamAbbrev, folderURL): self.videoName = videoName se...
""" Modis authentication functions. """ from typing import Optional, Union from datetime import datetime from netrc import netrc from pathlib import Path import stat from requests import sessions from requests.auth import HTTPBasicAuth from .constants.urls import URLs class ModisSession: """Auth session for q...
import unittest from tuprolog.core import struct, var from tuprolog.theory.parsing import parse_theory from tuprolog.solve.plp import solve_options, probability from tuprolog.solve.problog import problog_solver from tuprolog.solve.problog.operators import PROBLOG_OPERATORS class ExemplifyProblog(unittest.TestCase): ...
import webbrowser webbrowser.open('https://www.youtube.com/watch?v=dQw4w9WgXcQ')
import os import cv2 import pickle import skimage.io import numpy as np import matplotlib.pyplot as plt from rdp import rdp from glob import glob from tqdm import tqdm from lib.cfg import load_config from lib.cmaps import default_cmap from lib.windows import normalize_data from lib.inference import center_crop, pad_if...
number = int(input("Give me a number and I will tellyou if it is even or odd. Your number: ")) divisor = int(input("What divisor would you like to check? ")) if number % 2 == 0: print("%d is EVEN" % number) else: print("%d is ODD" % number) if number % 4 == 0: print("%d is evenly divisible by 4." % number...
#!/usr/bin/env python import numpy as np from math import (cos,sin) class Transformations: #def __init__(self,): def Rotx(self,theta): R=np.matrix([[1.0, 0.0, 0.0],[0.0, cos(theta), -sin(theta)], [0.0, sin(theta), cos(theta)]]) return R def Roty(self,theta): R=np.matrix([[cos(theta), 0.0, sin(thet...
nome=input('Qual é o seu nome?') idade=input('Qual é a sua idade?') peso=input('Qual é o seu peso?') print (nome, idade, peso)
_base_ = '../../base.py' # model settings num_classes = 10000 model = dict( type='ODC', pretrained=None, with_sobel=False, backbone=dict( type='ResNet', depth=50, in_channels=3, out_indices=[4], # 0: conv-1, x: stage-x norm_cfg=dict(type='SyncBN')), neck=dict...
from django.shortcuts import render from django.http import HttpResponseRedirect from django.urls import reverse from django.contrib.auth import authenticate,login,logout from django.contrib.auth.forms import UserCreationForm # Create your views here. # def login_sys(request): # username=request.POST.get('userna...
# Copyright (C) 2012 Ion Torrent Systems, Inc. All Rights Reserved from django.contrib import auth from django.contrib.auth import load_backend from django.contrib.auth.middleware import RemoteUserMiddleware from django.contrib.auth.backends import RemoteUserBackend from django.core.exceptions import ImproperlyConfig...
from samantha import app from samantha.tasks import greet @app.route('/') def hello(): greeting = greet.delay('world') greeting.wait() return greeting.get()
from mininet.topodc import (toHadoop, getHadoopMaster) import time from mininet.dutil import makeFile, makeHosts, default_images from mininet.log import info, debug, warn, error, output def aliasMaster(topo, net): master = getHadoopMaster(topo) output ("The Hadoop master is {}\n".format(master)) lines = [...
import boto3 import datetime TRAIN_LINES = [ '123', '456', '7', 'ACE', 'BDFM', 'G', 'JZ', 'L', 'NQR', 'S', 'SIR', ] def _normalize_dynamo_response(response): """ Flatten DynamoDB's response from a list of dicts to a structure that's easier to work with: ```...
class matrix: def greeting(): greeting = "Hello there! This program generates a square matrix with random numbers from 1 to 100. You can choose the size of your matrix and decide to save it as a .csv file. Try it now! Have fun!\n\n\n\n" print(greeting) def intro(): matrix.greeting() ...
from v3.model.Task import Task from v3.model.VirtualMachine import VirtualMachine class VirtualMachineService: def __init__(self): self.RESOURCE_VM = '/vms/' self.RESOURCE_VM_PWR_STATE = '/set_power_state/' def createVM(self, conn, data): pass def getVM(self, conn, uuid): ...
#!/usr/bin/env python # # SimNetExamReportParser.py # # Jason L Causey 2009-2016 jason.causey@cs.astate.edu # # Parses a SimNet exam, lesson, and project report (.csv) files and # produces a corresponding .csv file with one line per student, such that # all assignments and attempts for each assignment are listed (...
# Tipe data boolean print('==========Tipe Data Boolean==========\n') saya_lapar = True print('Apakah saya lapar :', saya_lapar) print('Data', saya_lapar, 'Memiliki tipe :', type(saya_lapar)) saya_sedih = False print('\nApakah saya sedih :', saya_sedih) print('Data', saya_sedih , 'Memiliki tipe :', type(saya_sedih ...
import setuptools with open('README.md', 'r') as fh: long_description = fh.read() setuptools.setup( name='ipygis', version='0.2.0', author='Joona Laine', author_email='joona@gispo.fi', description='GIS utils and GIS visualization/analysis functions for Jupyter Notebook', long_description=l...