content
stringlengths
5
1.05M
#!/usr/bin/python3 import matplotlib.pyplot as plt import numpy as np import sys # Plots the impulse response of the Bandstop and its frequency response def plot_if(figno,name,figtitle): plt.figure(figno) plt.suptitle(figtitle) fs = 250 y = np.loadtxt(name); plt.subplot(311) plt.title("Impuls...
import numpy as np import multiprocessing import timeit def start(): a = np.random.rand(1000, 1000) b = np.random.rand(1000, 1000) np.multiply(a,b) start2 = timeit.timeit() for i in range(500): start() end = timeit.timeit() print(end-start2) start2 = timeit.timeit() pool = multiprocessing.Pool(multipro...
import unittest import ray from ray.rllib.algorithms import sac from ray.rllib.utils.framework import try_import_tf, try_import_torch from ray.rllib.utils.test_utils import check_compute_single_action, framework_iterator tf1, tf, tfv = try_import_tf() torch, nn = try_import_torch() class TestRNNSAC(unittest.TestCas...
import unittest from conans.test.tools import TestClient import os from conans.paths import CONANINFO import platform from conans.test.utils.cpp_test_files import cpp_hello_conan_files from nose.plugins.attrib import attr from conans.util.files import load from conans.model.info import ConanInfo import time @attr("sl...
""" If in interact mode (see :func:`vcs.Canvas.Canvas.interact`), these attributes can be configured interactively, via the method described in the **Interact Mode** section of the attribute description. """ # @author: tpmaxwel from . import VCS_validation_functions import multiprocessing import vcs import time import ...
from rdflib import Namespace from pycali.vocabulary import ODRL # Namespace CALI = Namespace('http://cali.priloo.univ-nantes.fr/ontology#') ODRS = Namespace('http://schema.theodi.org/odrs#') # Classes Status = CALI['Status'] # Properties lessRestrictiveThan = CALI['lessRestrictiveThan'] compatibleWith = ODRS['compa...
# just here so fixtures/initial_data.json gets loaded.
""" remote interpreter functions """ import sys from Helpers import RedirectedStd __all__ = ["remote_interpreter", "remote_pm"] def remote_interpreter(conn, namespace = None): """starts an interactive interpreter on the server""" if namespace is None: namespace = {"conn" : conn} std = Redirected...
#How to visualise data using t-SNE - lesson 1 import pandas as pd #data analysis library to help read .CSV files import numpy as np #helps transform data into a format a machine learning model can understand from sklearn.preprocessing import LabelEncoder #scikit-learn helps create the machine learning model from sk...
from util.tipo import tipo class S_USER_LOCATION(object): def __init__(self, tracker, time, direction, opcode, data): dic = {} id = data.read(tipo.uint64) dic['pos1'] = data.read(tipo.float, 3) dic['angle'] = data.read(tipo.angle) * 360. / 0x10000 unk2 = data.read(tipo.int16...
# Copyright 2019 Wilhelm Putz # 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, s...
#!/usr/bin/env python # encoding: utf-8 """ @version: ?? @author: liangliangyy @license: MIT Licence @contact: liangliangyy@gmail.com @site: https://www.lylinux.net/ @software: PyCharm @file: context_processors.py @time: 2016/11/6 下午4:23 """ from blog.models import Category, Article from website.utils import cache, g...
from vyper.compiler import ( compile_codes, mk_full_signature, ) def test_only_init_function(): code = """ x: int128 @public def __init__(): self.x = 1 """ code_init_empty = """ x: int128 @public def __init__(): pass """ empty_sig = [{ 'outputs': [], 'inputs': []...
import abc import itertools import os import pickle import re from collections import defaultdict from copy import deepcopy from itertools import chain from typing import Union, List import nltk import json from tqdm import tqdm import numpy as np from attacks.glue_datasets import get_dataset_dir_name from common.uti...
# Import Person_detection_tan from Person_detection_tan import tf, pd, tqdm, os, np, argparse, IMG_HEIGHT, IMG_WIDTH, str2bool, preprocess_raise_img_vector, load_model, image_features_extract_model, image_flatten import testdata as testdata import logging from pathlib import Path # import cv2 from skimage...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- ###################################################################### # Tools ###################################################################### from os.path import join, dirname import sys from pathlib import Path sys.path.insert(0, str(Path.home()) + '/Z01-Tools/s...
class WillBaseEncryptionBackend(object): def __init__(self, *args, **kwargs): pass @staticmethod def encrypt_to_b64(raw): raise NotImplemented @staticmethod def decrypt_from_b64(enc): raise NotImplemented
import tempfile from os.path import dirname, join from os import environ GENERATED_DIR = join(dirname(__file__), 'generated') MATRIX_FILE_NAMING = 'universal_automaton_%s.csv' if environ.get('PYFFS_SETTINGS_MODE', 'release') == 'test': temp_dir = tempfile.TemporaryDirectory() GENERATED_DIR = temp_dir.name
########################################################################## ## Imports & Configuration ########################################################################## from math import pi from bokeh.io import show, output_file from bokeh.models import ColumnDataSource, HoverTool, LinearColorMapper, Categoric...
#MenuTitle: Rotate Around Anchor # -*- coding: utf-8 -*- from __future__ import division, print_function, unicode_literals __doc__=""" Rotate selected glyphs (or selected paths and components) around a 'rotate' anchor. """ import vanilla, math from Foundation import NSPoint, NSAffineTransform, NSAffineTransformStruct,...
import os import sys import subprocess from rq import Queue from redis import Redis from builder_queue_lib import build RQ_REDIS_HOST = os.environ.get('RQ_REDIS_HOST') or 'localhost' RQ_REDIS_PORT = int(os.environ.get('RQ_REDIS_PORT') or '6379') RQ_REDIS_DB = int(os.environ.get('RQ_REDIS_DB') or '5') RQ_JOB_TIMEOUT...
import haiku as hk import pytest from jax import numpy as np from jax import random from numpyro import distributions as dist from ramsey.attention import MultiHeadAttention from ramsey.covariance_functions import exponentiated_quadratic from ramsey.models import ANP, DANP, NP # pylint: disable=too-many-locals,inva...
#!/usr/bin/python2 from generate import cancel_hail import argparse import uuid if __name__ == '__main__': parser = argparse.ArgumentParser() parser.add_argument('--file', type=argparse.FileType('a'), default='/data/vehicles') parser.add_argument('VEHICLE_ID') args = parser.parse_args() vehicle_o...
#!/usr/pkg/bin/python2.7 from __future__ import print_function import sys import py_compile def main(argv): if len(argv) != 2: print('Usage: ./gpyc.py <file_to_compile.py>') return file = argv[1] py_compile.compile(file) if __name__ == '__main__': main(sys.argv)
import re from babel import numbers from .utils import AnyRE class NumberRE(AnyRE): def __init__(self, locale): self._locale = locale self._element_re = { "int" : "([0-9]+)", "sign" : "(" + "|".join((re.escape(x) for x in (numbers.get_plus_sign_symbol(locale), numbers.get_minus_sign_symbol(locale)))) + ")...
from django.http import HttpResponse from .models import Note, GGITUser,NoteElement from .serializers import NoteSerializer, NoteElementSerializer, UserSerializer from rest_framework.response import Response from rest_framework.decorators import api_view, permission_classes from rest_framework.permissions import IsAuth...
from rest_framework import serializers from rest_framework.validators import UniqueValidator from axians_netbox_pdu.choices import PDUUnitChoices from axians_netbox_pdu.models import PDUConfig, PDUStatus from dcim.models import Device, DeviceType class PDUConfigSerializer(serializers.ModelSerializer): """Seriali...
from __future__ import absolute_import from asyncio import get_event_loop from concurrent.futures import ThreadPoolExecutor from typing import Any, Dict, Callable, Optional from sqlalchemy import create_engine from sqlalchemy.orm import sessionmaker from sqlalchemy.orm.session import Session from sqlalchemy.engine.ba...
""" - Edited by b3kc4t to using stated references on structure file. """ from __future__ import division from __future__ import print_function from struct import pack, unpack, calcsize from six import b, PY3 from pentestui.pentest_api.attacks.kerberos.attackstatus.statusasreproast import StructAsrror class Structure(...
# Licensed to Modin Development Team under one or more contributor license agreements. # See the NOTICE file distributed with this work for additional information regarding # copyright ownership. The Modin Development Team licenses this file to you under the # Apache License, Version 2.0 (the "License"); you may not u...
from multiprocessing import Pool import shutil from django.core.management import BaseCommand from django.conf import settings from tqdm import tqdm from data.models import Officer from xlsx.utils import export_officer_xlsx from shared.aws import aws def upload_xlsx_files(officer): tmp_dir = f'tmp/{officer.id}...
# Copyright (c) 2017-2020 Renata Hodovan, Akos Kiss. # # Licensed under the BSD 3-Clause License # <LICENSE.rst or https://opensource.org/licenses/BSD-3-Clause>. # This file may not be copied, modified, or distributed except # according to those terms. from .default_listener import DefaultListener from .dispatching_li...
import logging from aspire.source import ImageSource logger = logging.getLogger(__name__) class OrientEstSource(ImageSource): """ Derived an ImageSource class for updating orientation information """ def __init__(self, src, orient_method): """ Initialize an Orientation ImageSource o...
soma = 0 quant = 0 for n in range(3, 501, 6): soma += n quant += 1 print(f'A soma dos {quant} números ímpares multiplos de 3 é {soma}')
from kivymd.app import MDApp from kivymd.uix.bottomnavigation import MDBottomNavigationItem from kivy.uix.recycleview import RecycleView from kivy.clock import Clock from kivymd.uix.button import MDRectangleFlatButton from kivy.properties import StringProperty from Mdialog import InfoDialog from decor import db_dialog ...
def front_times(str, n): return str[:3] * n
# -*- coding: utf-8 -*- """ Tencent is pleased to support the open source community by making BK-BASE 蓝鲸基础平台 available. Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved. BK-BASE 蓝鲸基础平台 is licensed under the MIT License. License for BK-BASE 蓝鲸基础平台: ---------------------------------------------...
import os import glob import lsst.afw.image as afwImage from lsst.afw.cameraGeom import utils as cgu import lsst.obs.lsst as obs_lsst import lsst_camera.cp_pipe_drivers as cpd camera = obs_lsst.LsstCamMapper().camera det_names = ['R22_S00', 'R22_S01', 'R22_S02', 'R22_S10', 'R22_S11', 'R22_S12', ...
sandboxHost = 'https://api.sandbox.namecheap.com/xml.response' sandboxAuthentication = 'ApiUser=aUserName&ApiKey=apiKeyString&UserName=aUserName' realHost = 'https://api.namecheap.com/xml.response' realAuthentication = 'ApiUser=aUserName&ApiKey=apiKeyString&UserName=aUserName' domainInfo = 'SLD=planet-ignite&TLD=net' c...
#!/usr/bin/python3 """ """ from tests.test_models.test_base_model import test_basemodel from models.state import State import os class test_state(test_basemodel): """ states test class""" def __init__(self, *args, **kwargs): """ state test class init""" super().__init__(*args, **kwargs) ...
"""The Edge Histogram kernel as defined in :cite:`sugiyama2015halting`.""" from warnings import warn from collections import Counter from collections import Iterable from grakel.graph import Graph from numpy import zeros from scipy.sparse import csr_matrix from six import iteritems from six import itervalues from ....
#!/usr/bin/env python3 # -*- coding: utf-8 -*- import os import sys import subprocess from xml.etree import ElementTree from fingerprinting.common import utils from fingerprinting.application import Application from fingerprinting.common.tshark import FileCapture from processpcaps.analyze import process_single_capt...
# Ex080 values = [] for v in range(0, 5): number = int(input('Digite um valor: ')) if v == 0: values.append(number) print(f'Valor {number} adicionado ao fim da lista') else: for p, c in enumerate(values): if number >= c: if c == values[-1]: ...
import os import json from .contracts import RevertError from .wrappers import ( ETHCall, AddressBook, MAXUINT256, ETHWrapper, SKIP_PROXY, register_provider, BaseProvider ) from environs import Env from eth_account.account import Account, LocalAccount from eth_account.signers.base import BaseAccount from web3.excep...
import sys import numpy as np from panda3d.bullet import * from panda3d.core import Point3 def obj2TriangleMesh(filename,matrix): print "Obj->Mesh:"+filename mesh = BulletTriangleMesh() vetexArray=[] # dummy vetexArray.append(Point3(0,0,0)) with open(filename,"r") as file: for line in fi...
#!/usr/bin/python # DS4A Project # Group 84 # using node/edge info to create network graph # and do social network analysis from os import path import pandas as pd bacon_graph_data_path = '../data/oracle_of_bacon_data/clean_data/graph_data.csv' nominee_count_data_path = '../data/nominations_count.csv' nominee_count_...
from django.core.exceptions import ValidationError from django.utils.translation import ugettext_lazy as _ import re have_symbol = re.compile('[^a-zA-Z0-9._-]+') wrong_ip = re.compile('^0.|^255.') wrong_name = re.compile('[^a-zA-Z0-9._-]+') def validate_hostname(value): sym = have_symbol.match(value) wip = ...
""" Functions for aggregating and analyzing exam-related data, such as calculating student exam performance. """ import csv import os import pandas as pd def grade_scantron( input_scantron, correct_answers, drops=[], item_value=1, incorrect_threshold=0.5 ): """ Calculate student grades from scantron dat...
# # Copyright (c) Contributors to the Open 3D Engine Project. For complete copyright and license terms please see the LICENSE at the root of this distribution. # # SPDX-License-Identifier: Apache-2.0 OR MIT # # import json import os import pytest import platform import subprocess import sys from distutils.version imp...
import numpy as np import scipy.signal as signal from q1pulse.instrument import Q1Instrument from init_pulsars import qcm0, qrm1 from plot_util import plot_output instrument = Q1Instrument('q1') instrument.add_qcm(qcm0) instrument.add_qrm(qrm1) instrument.add_control('P1', qcm0.name, [0]) instrument.add_control('P2'...
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.conf import settings from django.utils.translation import ugettext_lazy as _ from cms.plugin_base import CMSPluginBase from cms.plugin_pool import plugin_pool from djangocms_bootstrap4.helpers import concat_classes from .models import Boots...
# -*- coding: utf-8 -*- """ Created on Wed Mar 11 15:54:15 2020 @author: Leo Turowski @executive author: Noah Becker """ import csv import os import ntpath from zipfile import ZipFile import pandas as pd import numpy as np import pickle import typing import math import matplotlib import matplotlib.pyplot as plt from ...
from ..core import * from ..callback import * from ..basic_train import Learner, LearnerCallback __all__ = ['GeneralScheduler', 'TrainingPhase'] @dataclass class TrainingPhase(): "Schedule hyper-parameters for a phase of `length` iterations." length:int def __post_init__(self): self.scheds = dict() ...
#/usr/bin/env python """ globifest/globitest/testBuoondedStatefulParser.py - Tests for StatefulParser module Copyright 2018, Daniel Kristensen, Garmin Ltd, or its subsidiaries. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provi...
#!/usr/bin/env python from projections.atlas import atlas from projections.rasterset import RasterSet, Raster import projections.predicts as predicts import projections.rds as rds # Read Katia's abundance model (mainland) mod = rds.read('../models/ab-mainland.rds') predicts.predictify(mod) # Import standard PREDICTS...
from django.core.management.base import BaseCommand from apps.api.notice.models import GroupEvent from django.contrib.auth import get_user_model class Command(BaseCommand): help = 'this sandbox command' def handle(self, *args, **options): ge = GroupEvent.objects.first() print(ge.get_l_count(u...
""" Test the MicroPython driver for M5Stack U097, 4 relays I2C grove unit. In SYNC mode, the LED is controled by the RELAY state * Author(s): 28 may 2021: Meurisse D. (shop.mchobby.be) - port to MicroPython https://github.com/m5stack/M5Stack/blob/master/examples/Unit/4-RELAY/4-RELAY.ino """ from machine impor...
import json from enum import Enum from eva.models.storage.batch import Batch class ResponseStatus(str, Enum): FAIL = -1 SUCCESS = 0 class ResponseEncoder(json.JSONEncoder): def default(self, obj): if isinstance(obj, Batch): return {"__batch__": obj.to_json()} return json.JSO...
import pandas as pd import numpy as np import boost_histogram as bh from mpi4py import MPI class Spectrum: """Represents a histogram of some quantity.""" def __init__(self, loader, cut, var, weight=None): # Associate this spectrum with the loader loader.add_spectrum(self) self._cut =...
# File automatically generated by mapry. DO NOT EDIT OR APPEND! """defines some object graph.""" import datetime import typing class SomeGraph: """defines some object graph.""" def __init__( self, some_time_zone: datetime.tzinfo) -> None: """ initializes an instanc...
"""Conversão para dicionário Escreva um programa que converta a lista abaixo num dicionário. l = [ ['carlos', 15, 12], ['alberto', 9, 15], ['maria', 18, 19] ] Formato nome: nota1, nota2 """ l = [ ['carlos', 15, 12], ['alberto', 9, 15], ['maria', 18, 19] ] d = {} for row in l: d[row[0]] =...
#!/usr/bin/env python # Copyright 2015 Yelp 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 ag...
# -*- coding: utf-8 -*- # Copyright (c) 2017, Dirk Chang and contributors # For license information, please see license.txt from __future__ import unicode_literals import frappe from wechatpy.oauth import WeChatOAuth from wechat.api import check_wechat_binding def get_context(context): context.no_cache = 1 url = ...
# """This module is still in an experimental stage and should not be assumed to be "reliable", or # "useful", or anything else that might be expected of a normal module""" # ################################################## # # Import Own Assets # ################################################## # from hyperparamete...
from django.core.paginator import Paginator as BasePaginator class Paginator(BasePaginator): on_each_side = 2 current_page = 1 @property def page_elements(self): window = self.on_each_side * 2 result = { 'first': None, 'slider': None, 'last': None ...
from typing import * from return_type import ReturnType from collections import abc v_int: ReturnType[Callable[..., int]] = 1 v_float: ReturnType[Callable[..., float]] = 1.1 v_str: ReturnType[Callable[..., str]] = "123" v_bytes: ReturnType[Callable[..., bytes]] = b"2123" v_hash: ReturnType[Callable[..., Hashable]] = ...
import logging from eth_utils import ( ValidationError, ) from eth.db.diff import ( DBDiff, DBDiffTracker, DiffMissingError, ) from eth.db.backends.base import BaseDB class BatchDB(BaseDB): """ A wrapper of basic DB objects with uncommitted DB changes stored in local cache, which represe...
# # PySNMP MIB module ASCEND-MIBUDS3NET-MIB (http://snmplabs.com/pysmi) # ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/ASCEND-MIBUDS3NET-MIB # Produced by pysmi-0.3.4 at Mon Apr 29 17:12:47 2019 # On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4 # Using Python version 3.7.3 (def...
# Copyright (c) 2020-2021 CRS4 # # 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, distribut...
from aiohttp import web import json import docker import json import subprocess from docker import errors DOCKER_SOCKET_PATH = '/var/run/docker.sock' OUTPUT_UID = 1000 app = web.Application() routes = web.RouteTableDef() docker_client = docker.from_env() def chown_output(uid, dir): # spawn a busybox with outpu...
import abc import asyncio from typing import Optional import aiohttp from fastquotes.const import HEADERS, REQ_CODES_NUM_MAX from fastquotes.utils import format_stock_codes class AsyncQuote(metaclass=abc.ABCMeta): def __init__(self) -> None: pass @property @abc.abstractmethod def base_url(s...
from __future__ import print_function, unicode_literals, division, absolute_import import json import os import types from queue import Queue from typing import List, Dict, Any, Type, Set, Iterable from BlockServer.core.config_list_manager import ConfigListManager from BlockServer.core.macros import MACROS, PVPREFIX...
#!/usr/bin/env python3 import random class Stack_3_2(): def __init__(self, init_size = 10): self.stack_size = init_size self.back_arr = [None] * init_size self.head = 0 def push(self, num): if self.head == 0: minimum = num else: minimum = min(sel...
import re from odoo import http from odoo.http import request from odoo.addons.website_event.controllers.main import WebsiteEventController class WebsiteEventControllerExtended(WebsiteEventController): @http.route() def registration_confirm(self, event, **post): """Check that threre are no email dup...
from ebs_deploy import out, get, parse_env_config, parse_option_settings def add_arguments(parser): """ adds arguments for the rebuild command """ parser.add_argument('-e', '--environment', help='Environment name', required=True) parser.add_argument('-w', '--dont-wait', help='Skip waiting for ...
from cli import * # Common functionality for network devices def get_nic_info(obj): info = [("Recorder", obj.recorder), ("MAC address", obj.mac_address), ("Link", obj.link)] try: bw = obj.tx_bandwidth if bw == 0: bw = "unlimited" elif bw % 1000: ...
from starlette.testclient import TestClient import firestorefastapi.gunicorn_config as gunicorn_config def test_gunicorn_config(client: TestClient) -> None: assert gunicorn_config.worker_class == "uvicorn.workers.UvicornWorker"
import logging import voluptuous as vol from homeassistant import config_entries from homeassistant.core import callback _LOGGER = logging.getLogger(__name__) # Configuration: LANGUAGE = "language" LANGUAGES = [ "English", "Danish", "German", "Spanish", "French", "Italian", ...
#/usr/bin/env python # Copyright (c) 2012, Andres Blanco and Matias Eissler # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # 1. Redistributions of source code must retain the above copyright # ...
import abc from collections import defaultdict import pandas as pd from library.pandas_jqgrid import DataFrameJqGrid from ontology.models import OntologyTerm, OntologySnake class AbstractOntologyGenesGrid(DataFrameJqGrid, abc.ABC): @abc.abstractmethod def _get_ontology_terms_ids(self): pass def...
from __future__ import absolute_import from .connection import Connection __version__ = '0.3.5'
import numpy as np class MultiArmedBandit(object): """ Multi-armed single Bandit Args k: number of arms """ def __init__(self, k): self.k = k self.action_values = np.zeros(k) self.optimal = None def reset(self): self.action_values = np.zeros(self.k) ...
# pytube: YouTube 동영상을 다운로드하기 위한 가볍고 종속성이 없는 라이브러리 및 명령줄 유틸리티 # 해당 라이브러리를 사용하기 위해서는 'pip' 명령어를 통해 설치해야 한다. # 설치 명령어: pip install pytube from pytube import YouTube # 노래: < 무직전생 ~이세계에 갔으면 최선을 다한다~ OST :: 머나먼 자장가 > # 동영상 제목: TVアニメ『無職転生』第19話ノンクレジットOPムービー/OPテーマ:「遠くの子守の唄」大原ゆい子 url = 'https://www.youtube.com/watch...
from unittest import TestCase from cloudtts import AudioFormat from cloudtts import CloudTTSError from cloudtts import Gender from cloudtts import VoiceConfig from cloudtts import WatsonClient from cloudtts import WatsonCredential class TestWatsonClient(TestCase): def setUp(self): self.c = WatsonClient()...
import asyncio from yandere_parser import parse_yandere async def test(): # pixiv without character tag await parse_yandere( "https://yande.re/post/show/889591") # no source with character tag await parse_yandere("https://yande.re/post/show/829310") if __name__ == '__main__': loop = as...
# create files for chart-02X # WORKING/chart-NN.makefile # WORKING/chart-NN.data # WORKING/chart-NN.txt-SPECIFIC.txt # import built-ins and libraries import sys import pdb import cPickle as pickle import os.path # import my stuff from Bunch import Bunch from directory import directory from Logger import Logger def ...
from django.contrib import admin from ._admin.activity import * from ._admin.assistance import * from ._admin.dwelling import * from ._admin.income import * from ._admin.person import * # Register your models here. admin.site.site_header = 'Adminitración de JSM'
#!/usr/bin/env python # Copyright 2019 ARC Centre of Excellence for Climate Extremes # author: Paola Petrelli <paola.petrelli@utas.edu.au> # # 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 # # ...
#!/usr/bin/env python ''' Plots profiles for hydro-ship test case ''' from __future__ import absolute_import, division, print_function, unicode_literals import sys import numpy as np import netCDF4 #import datetime # import math # from pylab import * from optparse import OptionParser import matplotlib.pyplot as plt f...
from __future__ import print_function import argparse import os import shutil import time import random import math import numpy import torch import torch.nn as nn import torch.nn.parallel import torch.nn.functional as F import torch.backends.cudnn as cudnn import torch.optim as optim import torchvision.transforms as...
#!/usr/bin/env python # -*- coding: utf-8 -*- # # @author Mikael Wikström # https://github.com/leakim/GameOfLifeKata # import unittest from resources import GameOfLife, move from game_of_life import * class game_of_life_tests(unittest.TestCase): # TODO: add more tests here def test_next(self): self....
import numpy as np import bokeh.plotting as bp bp.output_file("bokeh2.html") x = np.linspace(0, 2 * np.pi, 1024) y = np.cos(x) fig = bp.figure(title="simple line example", x_axis_label="x", y_axis_label="y") fig.line(x, y, legend="cos(x)", color="red", line_width=2) bp.show(fig)
#!/usr/bin/env python3 # -*- coding: utf-8 -*- import argparse import asyncio import binascii import json import logging import shutil import sys import threading import re import os import time from collections import OrderedDict from typing import Optional import coloredlogs from aioconsole import ainput, get_stand...
from django.contrib import admin from django.urls import path,include from .views import index,details, enrollment, announcements app_name = 'my_project.courses' urlpatterns = [ path('', index, name='index'), # path('<int:id>/', details, name='details'), path('<slug:slug>/', details, name='details'), ...
from datetime import date dados = dict() dados['Nome'] = str(input('Nome: ')) ano = int(input('Ano de Nascimento: ')) dados['Idade'] = date.today().year - ano dados['Ctps'] = int(input('Carteira de trabalho (0 não tem): ')) if dados['Ctps'] != 0: dados['Contratação'] = int(input('Ano de contratação: ')) dados...
from fpdf import FPDF class PDF(FPDF): def footer(self): # Position at 1.5 cm from bottom self.set_y(-15) # Arial italic 8 self.set_font('Arial', 'I', 8) # Text color in gray self.set_text_color(128) # Page number self.cell(0, 10, 'Page ' + str(self....
import argparse import torchani import torch import timeit import tqdm # parse command line arguments parser = argparse.ArgumentParser() parser.add_argument('filename', help='Path to the xyz file.') parser.add_argument('-d', '--device', help='Device of modules and tensors', ...
#!/usr/bin/env python3 from p3lib.pconfig import ConfigManager from ogsolar.libs.ads1115 import ADS1115ADC from ogsolar.libs.gpio_control import GPIOControl class ADCCalibration(object): """@brief Responsible for calibrating the voltage and current measurements.""" #Choose slowest ADS1115 conversion rate for...
from django.apps import AppConfig class ProjectilpatternConfig(AppConfig): name = 'projectilPattern'
# Copyright 2018 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 agreed to in writing, s...