content
stringlengths
5
1.05M
import numpy as np import matplotlib.pyplot as plt import pickle def parse_kpts(buf): res = np.zeros([17,3]).astype(np.float32) res[0] = buf[6] res[1] = buf[2] res[2] = buf[1] res[3] = buf[0] res[4] = buf[3] res[5] = buf[4] res[6] = buf[5] res[7] = 0.5 * (buf[7] + buf[6]) res[8] = buf[7] res[9] = 0.5 * (...
# NOT FOR RELEASE BUILDS! # Useful for debugging scripts in Tampermonkey. # To set breakpoints switch to Web Developer Tools' Debugger/Sources tab # and find related script in Tampermonkey's list of `userscript.html?id=<guid>` from pluginwrapper import start, setup end = """ } // wrapper end var info = {}; if (typeof...
import json import pprint with open('scrape_movie_cast_details.json','r') as new_data: data=json.load(new_data) # pprint.pprint(data) def analyse_actors(movies_list): all_id_list=[] cast_list=[] for i in movies_list: id_a=i['cast'] for j in id_a: cast_list.append(j) all_id_list.append(j['imdb_id']) # pr...
from django.http.response import HttpResponseBadRequest from imfp.core.http_helpers import HttpJsonResponse from imfp.events.forms import CreateEventForm, SubscribeToEventForm, UnsubscribeFromEventForm, DeleteEventForm from imfp.events.models import Event from imfp.subscriptions.models import Subscription def create_...
#-*- codeing: utf-8 -*- import sys """ tip type min() input 29 100 948 377 -24 0 -388 9999 output -388 """ data = [] for x in sys.stdin: x = int(x) data.append(x) if x >= 9999: print(min(data)) break;
# Copyright (c) 2021 NVIDIA CORPORATION & AFFILIATES. # 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 requ...
import pytest import datetime import json from application.system.job import Job, JobStatus from application.system.user import User from application.system.user_role import UserRole from application.handlers.response_builder import ResponseBuilder from exceptions.user_not_found_exception import UserNotFoundException ...
import sys from reminder.argument.argument import MyParser def execute(): MyParser().parse_arguments() if __name__ == '__main__': sys.exit(execute())
import sys import pygame import pygame.locals #initalize pygame pygame.init() #Sets up the display surface for the game DISPLAY_SURFACE = pygame.display.set_mode((400,300)) #Sets the heading caption pygame.display.set_caption("Hello World!") #main game loop while True: #loops through all the events captured fr...
""" byceps.blueprints.admin.ticketing.checkin.views ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ :Copyright: 2006-2021 Jochen Kupperschmidt :License: Revised BSD (see `LICENSE` file for details) """ from datetime import date from flask import abort, g, request, url_for from flask_babel import gettext from .....p...
import uuid import pytest from selenium import webdriver @pytest.fixture def test_password(): return 'strong-test-pass' @pytest.fixture def test_with_specific_settings(settings): settings.BASICAUTH_DISABLE = True @pytest.fixture def create_user(db, django_user_model, test_password, test_wi...
from draw2d import Viewer, Rectangle, Frame, Circle, Line, Point import math, time try: import pyglet except ImportError as e: raise ImportError(''' Cannot import pyglet. HINT: you can install pyglet directly via 'pip install pyglet'. But if you really just want to install all Gym dependencies and...
from direct.distributed.AstronInternalRepository import AstronInternalRepository from otp.distributed.OtpDoGlobals import * from toontown.distributed.ToontownNetMessengerAI import ToontownNetMessengerAI from direct.distributed.PyDatagram import PyDatagram import traceback import sys import urlparse class ToontownInter...
def convert_to_celsius(fahrenheit: float) -> float: """Return the number of Celsius degrees equivalent to fahrenheit degrees. >>> convert_to_celsius(75) 23.88888888888889 """ return (fahrenheit - 32.0) * 5.0 / 9.0 def above_freezing(celsius: float) -> bool: """Return true if the temper...
FOO = 1 def keys(x): return [k for k in x.keys() if not k.startswith('_')] def foo(bar): baz = 3 print('foo', keys(globals()), keys(locals()), sep='\n') print('TOP', keys(globals()), keys(locals()), sep='\n') foo(12)
from django.conf.urls import url from . import views from remoteCMD.views import remote_cmd, file_trans from showdata.views import show_data, save_data, get_data urlpatterns = [ url(r'^login/$',views.login, name='login'), url(r'^register/$',views.register, name='register'), url(r'^index/$', views.index, na...
from nbtlib import nbt BLOCK_NAME_TO_ID_MAP = { } DV_FACING = {'north': 3, 'south': 2, 'west': 1, 'east': 0} DV_CHEST_FACING = {'north': 2, 'south': 3, 'west': 4, 'east': 5} DV_HALF = {'bottom': 0, 'top': 1} DV_DIRT_VARIANT = {'dirt': 0, 'coarse_dirt': 1, 'podzol': 2} DV_TALLGRASS_TYPE = {'dead_bush': 0, 'tall_grass'...
#!/usr/bin/python import subprocess import sys, os, shutil import string,re perf_test_pat = re.compile("CudaDMA Sequential Performance Test") alignment_pat = re.compile("\s+ALIGNMENT - (?P<align>[0-9]+)") elmt_size_pat = re.compile("\s+ELEMENT SIZE - (?P<size>[0-9]+)") true_spec_pat = re.compile("\s+WARP SPECIALIZED ...
#!/usr/bin/env python # # Copyright (c) Microsoft Corporation. # Licensed under the MIT License. import json import logging import azure.functions as func from onefuzztypes.models import HeartbeatEntry from ..onefuzzlib.dashboard import get_event from ..onefuzzlib.heartbeat import Heartbeat def main(msg: func.Queu...
#!/usr/bin/env python from __future__ import print_function import os import matplotlib matplotlib.use('Agg') import pylab as plt import numpy as np from numpy.fft import fftn, ifftn import scipy.integrate as integrate from scipy import stats import PlotScripts import ReadScripts import AllVars def calculate_HI_f...
from django.conf.urls import url, include from . search_views import \ by_identifier, \ by_unique_sale_user urlpatterns = [ url(r'^by-identifier', by_identifier, name='search-sale-by-identifier'), url(r'^by-unique-sale-user', by_unique_sale_user, name='search-sale-by-unique-sale-user'), ]
import numpy as np from RL_model.Attention_FCN import PPO import torch d = np.load('./pretrained_50.npz') print(d.files) print(d['diconv6_pi/diconv/W'].shape) model = PPO(9, 1) model_dict = model.state_dict() model_dict['conv.0.weight'] = torch.FloatTensor(d['conv1/W']) model_dict['conv.0.bias'] = torc...
# Generated by Django 3.2.7 on 2021-10-26 18:32 from django.db import migrations, models class Migration(migrations.Migration): initial = True dependencies = [ ] operations = [ migrations.CreateModel( name='Productos', fields=[ ('id', models.AutoFiel...
from setuptools import setup, find_packages setup( name="alerta-pinger", version='3.3.0', description="Alerta Pinger daemon", license="MIT", author="Nick Satterly", author_email="nick.satterly@theguardian.com", url="http://github.com/alerta/alerta-contrib", py_modules=['pinger'], i...
# coding:utf-8 import json import os import certifi import urllib3 class getForPixiv: def __init__(self): # 设置爬虫headers self.headers = { "user_agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/85.0.4183.102 Safari/537.36", "acc...
import time print(time.time()) print(time.localtime()) print(time.strftime('%Y-%m-%d %H:%M:%S')) import datetime print(datetime.datetime.now()) newtime = datetime.timedelta(minutes=10) print(datetime.datetime.now() + newtime) one_day = datetime.datetime(2008, 3, 16) new_date = datetime.timedelta(days=10) print(one_...
class Vector3(object): def __init__(self, newX=None, newY=None, newZ=None): self.__x = 0.0 or float(newX) self.__y = 0.0 or float(newY) self.__z = 0.0 or float(newZ) @property def x(self): return self.__x @property def y(self): return self.__y @property...
from django.db import models from django.conf import settings from django.db.models.signals import post_save from django.shortcuts import reverse from branches.models import Branch from cargotracker.UTILS import validate_required_kwargs_are_not_empty from cargotracker.UTILS.tasks import send_async_email User = setti...
from spaceone.inventory.manager.ecs.scaling_group_manager import ScalingGroupManager from spaceone.inventory.manager.ecs.load_balancer_manager import LoadBalancerManager from spaceone.inventory.manager.ecs.vpc_manager import VPCManager from spaceone.inventory.manager.ecs.ecs_instance_manager import ECSInstanceManager f...
#!/usr/bin/env python3 """Usage examples.""" import pprint import sqlalchemy as sa import treedb treedb.configure(log_sql=False) pprint.pprint(dict(treedb.iterlanguoids(limit=1))) engine = treedb.load() treedb.check() # run sanity checks treedb.print_rows(sa.select(treedb.Languoid).order_by('id').limit(5)) qu...
nums = [3, 5, -4, 8, 11, 1, -1, 6] nums.sort() print(nums) print(len(nums))
import os import time import threading # import subprocess import socket # import re # Ansible <v2 has a security vulnerability and v2 has a different API # Disabling Cloudera manager as don't believe it's used by anyone any more. # from ansible.runner import Runner # from ansible.inventory import Inventory from cm_a...
# To add a new cell, type '# %%' # To add a new markdown cell, type '# %% [markdown]' # %% from IPython import get_ipython # %% '''This was initially designed for visuallizations but then used for exporting data. export_cli moved under the script dir, this is only visualization ''' # %% import pandas as p...
"""Bytecode Interpreter operations for Python 3.7 """ from __future__ import print_function, division from xpython.byteop.byteop36 import ByteOp36 # Gone in 3.7 del ByteOp36.STORE_ANNOTATION # del ByteOp36.WITH_CLEANUP_START # del ByteOp36.WITH_CLEANUP_FINISH # del ByteOp36.END_FINALLY # del ByteOp36.POP_EXCEPT # del...
""" This file is part of nucypher. nucypher is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. nucypher is distributed in the hope that it wil...
from ripple.runners import base_runner from ripple.runners.base_runner import BaseRunner from ripple.runners.shell.shell_runner import ShellRunner
from .abstract import TestWithSampleIncidents from pprint import pprint from dataproxy.routes.statistics import GetStatistics import json class TestGetStatistics(TestWithSampleIncidents): def test_get_statistics_json(self): grouped_incidents_1 = GetStatistics().get_statistics(self.storage) sel...
__author__ = "John Kirkham <kirkhamj@janelia.hhmi.org>" __date__ = "$May 18, 2015 16:46:39 EDT$" from ._version import get_versions __version__ = get_versions()['version'] del get_versions
def includeme(config): """ :param config: Pyramid Configuration instance :type config: :class:`pyramid.config.Configurator` """ config.add_route('reef.index', '/') config.add_route('reef.home', '/home')
# -*- coding: utf-8 -*- from collections import defaultdict import numpy as np class TrieNode(): def __init__(self): self.children = defaultdict(TrieNode) self.char = '' self.count = 0 class Trie(): ''' 实现如下功能: 1. 记录总的词频数:total_count 2. 输入单词,返回其词频:get_freq 3. 输入...
# https://cses.fi/problemset/task/1083 d = [False for _ in range(int(input()))] for i in input().split(' '): d[int(i) - 1] = True for i, b in enumerate(d): if not b: print(i + 1) exit()
from .module import AsyncioModule
import re from six.moves.urllib.parse import urljoin from w3lib.html import remove_tags, replace_entities, replace_escape_chars, get_base_url from scrapy.link import Link from .sgml import SgmlLinkExtractor linkre = re.compile( "<a\s.*?href=(\"[.#]+?\"|\'[.#]+?\'|[^\s]+?)(>|\s.*?>)(.*?)<[/ ]?a>", re....
#!/usr/bin/env python3 # # Copyright (c) 2022 Project CHIP 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 # # Unl...
from dataclasses import fields from rest_framework import serializers from projects.models import UserProfile,Project from django.contrib.auth.models import User class ProjectSerializer(serializers.ModelSerializer): class Meta: model=Project fields=['title','description','url','image','created_at'] class U...
import setuptools from distutils.core import setup # read the contents of README.md from os import path this_directory = path.abspath(path.dirname(__file__)) with open(path.join(this_directory, "README.md"), encoding="utf-8") as f: long_description = f.read() long_description.replace( "basic-example.gif", ...
from django.contrib import admin from .models import Post, Comment @admin.register(Post) class PostAdmin(admin.ModelAdmin): list_display = ('status', 'author', 'title', 'created_date', 'tag') list_filter = ('status', 'published_date', 'tag') search_fields = ('content', 'title', 'tag') actions = ['publ...
"""Setup for the fastai splunk package.""" import setuptools with open('README.md') as f: README = f.read() setuptools.setup( author="Nate Argroves", author_email="nargroves@gmail.com", name='fastai-splunk', license="Apache Software License 2.0", description='fastai-splunk allows you to impo...
from ami.flowchart.library.DisplayWidgets import ImageWidget, WaveformWidget, PixelDetWidget, \ ScatterWidget from ami.flowchart.library.common import CtrlNode from amitypes import Array2d, Array1d import ami.graph_nodes as gn import numpy as np import pyqtgraph as pg from pyqtgraph import functions as fn class R...
from .sproto import SprotoRpc
def permute(seq): if not seq: yield seq else: for i in range(len(seq)): rest = seq[:i] + seq[i + 1:] for x in permute(rest): yield seq[i:i + 1] + x def permute1(seq): if not seq: return [seq] else: res = [] for i in range(...
import discord from discord.ext import commands import aiohttp import random import textwrap class Reddit(commands.Cog): def __init__(self, bot): self.bot = bot @commands.command(name="reddit") async def _reddit(self, ctx, subreddit): with ctx.channel.typing(): try: ...
""" Example of a module that implements implementations but states that nothing is exported by setting the helper variable to ``None``. """ from smqtk.tests.utils.test_plugin_get import DummyInterface class ImplSkipModule (DummyInterface): @classmethod def is_usable(cls): return True def inst_me...
"""https://open.kattis.com/problems/prva""" def addWords(words=[], array=[]): for each in array: parts = each.split("#") # add words to list words.extend(parts) # remove elements with length < 2 i, length = 0, len(words) while i < length: if len(words[i]) < 2: ...
from django.contrib.auth.models import ( AbstractUser, UserManager ) from django.db import models class User(AbstractUser): skku_id = models.CharField(verbose_name='SKKU ID', max_length=255, null=True, blank=True) birthday = models.DateField(ve...
# Original script by drdaxxy # https://gist.github.com/drdaxxy/1e43b3aee3e08a5898f61a45b96e4cb4 import sys import os import requests import errno from PIL import Image from googletrans import Translator import re translator = Translator(service_urls=['translate.googleapis.com']) if len(sys.argv) != 3: ...
#coding: latin1 from algoritmia.datastructures.maps.hashmap import HashMap import unittest from algoritmia.datastructures.maps import IntKeyMap, LeftLeaningRedBlackTreeMap class TestIntKeyMapping(unittest.TestCase): def setUp(self): self.a = IntKeyMap( ((i, i+1) for i in range(10)) ) ...
# Copyright (c) 2019 Eric Steinberger class _PokerEnvArgs: def __init__(self, n_seats, starting_stack_sizes_list=None, stack_randomization_range=(0, 0), scale_rewards=True, use_simplified_headsup_obs=True, retur...
import numpy as np import tectosaur.nearfield.triangle_rules as triangle_rules import tectosaur.nearfield.nearfield_op as nearfield_op import tectosaur.ops.dense_integral_op as dense_integral_op import tectosaur.ops.sparse_integral_op as sparse_integral_op from tectosaur.ops.sparse_farfield_op import TriToTriDirectFa...
from .maa import MatchActionAcceleration
import argparse from WebScraper import * from CSV import * from Model.prediction import * parser = argparse.ArgumentParser(description='Scrape information from a website/list of websites to determine if it is a phishing site.', formatter_class=argparse.RawTextHelpFormatter) parser.add_argument('-u',...
"""Class to manage the DB Operations.""" import os.path import secrets import os import datetime from dotenv import load_dotenv import sqlite3 import mariadb import logging from .constants import Role load_dotenv() is_sqlite = os.getenv("SQLITE") is_sqlite = is_sqlite.lower() in ['true', '1', 'y', None, ''] sqlite_fi...
# Medium from random import randint class Solution(): # function to assign value def gen_random_value(self): return randint(0,50) def orangesRotting(self, grid: list[list[int]]) -> int: graph_structure = [] graph_dict = {} stacks = [] # random value assign...
import pytest import re # example values for the respective types ATTRIBUTE_TYPE_EXAMPLE_VALUES = \ { 'int': [23, 42, -8], 'bool': ['true', 'false'], 'string': ['foo', 'baz', 'bar'], 'color': ['#ff00ff', '#9fbc00'], # FIXME: include named colors 'uint': [23, 42] } ATTRI...
# -*- coding: UTF-8 -*- import logging import re import traceback import MySQLdb from common.config import SysConfig from sql.utils.sql_utils import get_syntax_type from . import EngineBase from .models import ResultSet, ReviewSet, ReviewResult logger = logging.getLogger('default') class GoInceptionEngine(EngineBas...
#!/usr/bin/env python # coding: utf-8 # In[10]: # BAGINDA (130-) # IoT IF-41 # Assignment 1 - Moving Average Filter import pandas as pd import matplotlib.pyplot as plt import numpy as np # menggunakan dataset 15 data = pd.read_csv("15.csv") df = pd.DataFrame(data) # menggunakan kolom D "z acceleration" df1 = df.i...
import cplex import numpy as np from cplex.exceptions import CplexSolverError import sys from class_definitions import NetworkScenario class OptDCsTwoStep: def __init__(self): pass # Number of time slots are determined by shape of demand vector def opt_dcs(self, scenario, time_slot_index, prev_x_s...
import random import ntpath import string import re from abc import ABC from html.parser import HTMLParser ## # Strip HTML Tags # -------------------------- # strip_tags(html) class MLStripper(HTMLParser, ABC): def __init__(self): super().__init__() self.reset() self.strict = False ...
import re import abc from PyQt5.QtWidgets import QApplication, QDialog, QVBoxLayout, QFormLayout, QLabel, QLineEdit, QDateTimeEdit, QDialogButtonBox, QComboBox from PyQt5.QtCore import QDateTime, pyqtSignal, pyqtSlot from ..Records import SurveyRecord from ..AppResources import SurveyTableResources as R from .Survey...
import pytest import uuid import random import asyncpg from korm import AsyncModel, ExecutionFailure, PoolManager, \ ConnectionManager, AsyncContextManagerABC, AsyncModelABC pytestmark = pytest.mark.asyncio async def test_AsyncModelABC(User): assert issubclass(User, AsyncModelABC) assert isinstance(User...
import pytest from unittest.mock import ANY, Mock from notifications_utils.statsd_decorators import statsd class AnyStringWith(str): def __eq__(self, other): return self in other @pytest.fixture def test_app(app): app.config['NOTIFY_ENVIRONMENT'] = "test" app.config['NOTIFY_APP_NAME'] = "api" ...
"""SCons.Executor A module for executing actions with specific lists of target and source Nodes. """ # # Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008 The SCons Foundation # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation f...
## Copyright 2017 Knossos authors, see NOTICE file ## ## 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...
import os def SizeAndBig(file='Weird.txt'): print(os.stat(file).st_size) print(open(file,'r').read().upper()) SizeAndBig()
from io import BytesIO import cv2 import time import keras import numpy as np import playsound from PIL import Image import tensorflow as tf from mongodb_tools.mongo_upload import make_violator_entry_in_db def load_model(model_path): """ Loads model from provided model path. Returns: Keras SavedModel object """ ...
"""Computes p-values for paired statistical tests over input vectors""" import numpy as np from numpy import asarray, compress, sqrt from scipy.stats import find_repeats, rankdata, norm, ttest_rel from anamod.core import constants, utils def compute_empirical_p_value(baseline_loss, perturbed_loss, statistic): "...
from django.http import HttpResponse from django.views.decorators.csrf import csrf_exempt from oauth2_provider.decorators import protected_resource from sqlshare_rest.models import FileUpload from sqlshare_rest.views import get_oauth_user, get403, get404, get400 from sqlshare_rest.parser import Parser from sqlshare_res...
# from .data_formater import print_experiment from .monitor import log_value from .experiment import Experiment from .multistage import MultiStageExperiment
BROWSER_ERROR_MSG = """\ Browser setup error : {error} Seems you don't have installed the requirements packages, if you need image output run the following commands on your server. <b>Meanwhile You can use text version of Telminal, type any command!</b> `sudo apt-get install chromium-chromedriver`" `sudo apt install ...
#!/usr/bin/env python # -*- coding: utf-8 -*- """ app.admin.forms ~~~~~~~~~~~~~~~~~~~~ The module provides the forms for admin :copyright: (c) 2016 by zifeiyu. :license: MIT, see LICENSE for more details. """ from flask_wtf import Form from wtforms import StringField, PasswordField, BooleanField, ...
#!/usr/bin/env python ## ## See COPYING file distributed along with the ncanda-data-integration package ## for the copyright and license terms ## """ ncanda_quality_control_script ====================== This script checks the quality of the data for the NCANDA Project on REDCap. Call script on command line. Example ...
#!/usr/bin/env python # encoding: utf-8 def acoustics(solver_type='classic',iplot=True,htmlplot=False,outdir='./_output',problem='figure 9.4'): """ This example solves the 1-dimensional variable-coefficient acoustics equations in a medium with a single interface. """ from numpy import sqrt, abs...
# import pandas as pd # from libalignmentrs.record import Record # from alignmentrs.aln.mixins import serde # from alignmentrs.aln.mixins.tests.mocks import MockData # class MockClass(serde.RecordsSerdeMixin): # def __init__(self, records, name=None, index=None, comments=None, row_metadata=None, column_metadata=...
class Foo(object): def __init__(self): self.values = [1, "one", 2, "two", 3, "three"] def __iter__(self): return self def next(self): if self.values: key = self.values.pop(0) value = self.values.pop(0) print key, value re...
import logging import sys logging.basicConfig(level=logging.INFO, stream=sys.stdout, format='\t%(levelname)s| %(message)s')
import os from setuptools import setup, find_packages install_requires = [ 'umysql>=2.61', 'pymysql>=0.6', ] setup( name = 'umysqldb', description = "MySQLdb compatible wrapper for ultramysql", long_description = open(os.path.join(os.path.dirname(__file__), ...
import logging from nequip.data import AtomicDataDict from nequip.nn import ( GraphModuleMixin, SequentialGraphNetwork, AtomwiseLinear, AtomwiseReduce, ForceOutput, PerSpeciesScaleShift, ConvNetLayer, ) from nequip.nn.embedding import ( OneHotAtomEncoding, RadialBasisEdgeEncoding, ...
import requests import os class Image: def __init__(self,token,path = 'images'): if path not in os.listdir(): os.mkdir(path) self.token = token self.path = path def imgpath(self,chat_id): return self.path + '/' + str(chat_id) + '.jpg' def save(self,chat_id,file...
# coding=utf-8 """Views.""" # Django from django.contrib import messages from django.core.exceptions import PermissionDenied from django.urls import reverse from django.views.generic import CreateView, DeleteView, DetailView, ListView, UpdateView # Current django project from gymnasiums.models import Gymnasium cla...
# -*- coding: utf-8 -*- """ Created on Thu Mar 3 09:03:43 2022 @author: florian.baumgartner """ import numpy as np # import matplotlib.pyplot as plt SAMPLE_DEPTH = 2**16 SAMPLE_FREQ = 100.0e6/16 # Sigma-Delta-Frequency in Hz CARRIER_FREQ = 40.0e3 # Carrier Frequency in Hz SAMPLE_COUNT = int(SAM...
import pytest from io import StringIO from pathlib import Path import pandas as pd import mock from shutil import rmtree from wetterdienst.dwd.util import coerce_field_types from wetterdienst.dwd.metadata.parameter import Parameter from wetterdienst import TimeResolution from wetterdienst.dwd.metadata.period_type impo...
from prometheus_client import start_http_server, Summary, Gauge import random import time REQUEST_TIME = Summary('request_processing_seconds', 'Time spent processing request') GAUGE = Gauge('my_inprogress_requests', 'Number of requests in progress') GAUGE.set_to_current_time() @GAUGE.track_inprogress() @REQUEST_TIME...
r""" Descriptions of procedural changes in litigation. Does not specify whether they are mandatory or universal, or specify the :class:`.Enactment`\s that might require them. """ from __future__ import annotations from copy import deepcopy from itertools import chain import operator from typing import Any, ClassVar...
from django.urls import path from notifications.views import ShowNotifications, DeleteNotification urlpatterns = [ path('', ShowNotifications, name='show-notifications'), path('<noti_id>/delete', DeleteNotification, name='delete-notification'), ]
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") BATS_SHELLMOCK_BUILD=""" sh_library( name = "shellmock", srcs = ["load.bash"] + glob(["src/*"]), visibility = ["//visibility:public"], ) sh_library( name = "test_helper", srcs = ["test/test_helper.bash"], visibility = ["//vis...
import chainer import chainer.functions as F import numpy as np from dataset import Coordination from models.common import get_pair_value from models.teranishi17 import Teranishi17 from parsers.common import Parser class Teranishi17Parser(Parser): def __init__(self, model, comma_id, decoding=True): if n...
# Generated by Django 2.1.4 on 2019-01-01 10:43 from django.db import migrations class Migration(migrations.Migration): dependencies = [ ('users', '0004_auto_20181228_1547'), ] operations = [ migrations.RemoveField( model_name='user', name='course', ), ...
""" Faça um Programa que peça a temperatura em graus Fahrenheit, transforme e mostre a temperatura em graus Celsius. C = 5 * ((F-32) / 9). """ farenheit = float(input('Informe a temperatura em Farenheit: ')) celsius = 5 * (farenheit - 32) / 9.0 print(f'A temperatura em Celsius é: {celsius}')
import py from rpython.jit.metainterp.test import test_string from rpython.jit.backend.ppc.test.support import JitPPCMixin class TestString(JitPPCMixin, test_string.TestLLtype): # for the individual tests see # ====> ../../../metainterp/test/test_string.py pass class TestUnicode(JitPPCMixin, test_string.T...
from typing import List import logging from pathlib import Path import itertools import parsy from elm_doc import elm_parser from elm_doc.elm_parser import Chunk logger = logging.getLogger(__name__) def strip_ports_from_file(elm_file: Path) -> None: source = elm_file.read_text() stripped = strip_ports_fro...