content stringlengths 5 1.05M |
|---|
texto = input("Ingrese su texto: ")
def SpaceToDash(texto):
return texto.replace(" ", "-")
print (SpaceToDash(texto)) |
import socket
import serial
import time
class CommsObject:
"""
Base Class for a variety of communications types with standard interfaces
"""
def __init__(self, name = "", type = ""):
"""
Initializes the class
Args:
name: String- name of the object
type: S... |
##########################################################################
# Author: Samuca
#
# brief: Game! Guess what the number is
#
# this is a list exercise available on youtube:
# https://www.youtube.com/playlist?list=PLHz_AreHm4dm6wYOIW20Nyg12TAjmMGT-
###########################################################... |
import sqlite3
class Database:
def create_card_table(self):
cur = self.conn.cursor()
cur.execute('''CREATE TABLE IF NOT EXISTS card(id INTEGER,
number TEXT, pin TEXT , balance INTEGER DEFAULT 0)''')
self.conn.commit()
def __init__(self):
self.conn = sqlite3.connect(... |
__author__ = 'bptripp'
import argparse
import numpy as np
import cPickle as pickle
import matplotlib.pyplot as plt
from alexnet import preprocess, load_net
from orientation import find_stimuli, get_images
parser = argparse.ArgumentParser()
parser.add_argument('action', help='either save (evaluate and save tuning curv... |
from enum import Enum
class WebDriverFile(Enum):
# The Chrome driver file.
CHROME = "chromedriver"
# The Firefox driver file.
FIREFOX = "geckodriver"
# The Internet Explorer driver file.
IE = "IEDriverServer"
# The Edge driver file.
EDGE = "Microsoft Web Driver" |
from .... pyaz_utils import _call_az
def list(cluster_name, name, resource_group):
'''
List version of a given application type.
Required Parameters:
- cluster_name -- Specify the name of the cluster, if not given it will be same as resource group name
- name -- Specify the application type name.
... |
# For ad when viewing a recipe
ad_equipment = [
'pan',
'frying pan',
'saute pan',
'sauce pan',
'saucepan',
'casserole pot',
'steamer basket',
'steamer',
'skimmer',
'spatula',
'ladle',
'spoon',
'solid spoon',
'pasta spoon',
]
|
"""
Supplement for Embodied AI lecture 20170112
Some Reinforcement Learning examples
Implementing only Temporal Difference methods so far:
- TD(0) prediction
- Q-Learning
- SARSA
TODO
- x use function approximation for v,q,q_Q,q_SARSA
- policy search for continuous space
- use state matrix as visual input / co... |
#!/usr/bin/env python3
# Copyright 2019 Genialis, 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 la... |
import telebot
import tokken
import requests
import os
import random
appid = "e03925cafba20b665dc891e119dcd297"
#city_id for Abakana
city_id = 1512236
bot = telebot.TeleBot(tokken.token)
@bot.message_handler(commands=['start'])
def handle_start(message):
user_markup = telebot.types.ReplyKeyboardMarku... |
x = [i, i**2 for i in range(10)]
|
import utils.dtw as dtw
import time
import numpy as np
import math
import csv
import os
import sys
from utils.constants import nb_classes, class_modifier_add, class_modifier_multi, max_seq_len
from utils.proto_select import selector_selector, random_selection, center_selection, k_centers_selection, border_selection, sp... |
import torch
for i in range(12):
for j in range(i+1,12):
count = 0
for idx in range(361):
attn_map = torch.load(f'attn_map/{idx}.pth', map_location = torch.device('cuda'))
for batch in range(attn_map[0].shape[0]):
for token in range(49):
if... |
import sys
import subprocess
import docker
BASE_DOCKERFILE = '''FROM python:3.8-slim
WORKDIR /code
COPY requirements.txt .
RUN pip install -r requirements.txt
COPY src/ .
EXPOSE 5000/tcp
CMD [ "python", "./server.py"]
'''
DOCKER_TEMPLATE = '''FROM underpants_base:latest
ENV SERVER_MODE {}
ENV SLEEP_TIME {}
'''
SERV... |
class GameTime(object):
def __init__(self):
self.seconds = 0
self.minutes = 0
self.hours = 0
self.days = 0
def pass_turns(self, turns=1):
minute_updated = False
hours_updated = False
days_updated = False
seconds = turns * 6
self.seconds +... |
from app.notify_client import NotifyAdminAPIClient
class PlatformStatsAPIClient(NotifyAdminAPIClient):
# Fudge assert in the super __init__ so
# we can set those variables later.
def __init__(self):
super().__init__("a" * 73, "b")
def get_aggregate_platform_stats(self, params_dict=None):
... |
#
# spyne - Copyright (C) Spyne contributors.
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 2.1 of the License, or (at your option) any later version.
#
# This libra... |
"""Update LLC Register to add Charge History table
Revision ID: 37d3726feb0a
Revises: 2282351403f3
Create Date: 2017-04-12 11:23:50.439820
"""
# revision identifiers, used by Alembic.
revision = '37d3726feb0a'
down_revision = '2282351403f3'
from alembic import op
import sqlalchemy as sa
from sqlalchemy.dialects imp... |
import os
import random
import numpy as np
def set_random_seed(seed_num:int=42):
os.environ["PYTHONHASHSEED"] = str(seed_num)
random.seed(seed_num)
np.random.seed(seed_num) |
class Solution:
def postorderTraversal(self, root: Optional[TreeNode]) -> List[int]:
ans = []
def postorder(root: Optional[TreeNode]) -> None:
if not root:
return
postorder(root.left)
postorder(root.right)
ans.append(root.val)
postorder(root)
return ans
|
"""
CertList - command ``getcert list``
====================================
"""
from insights.core import CommandParser
from insights.parsers import ParseException, keyword_search
from insights.core.plugins import parser
from insights.specs import Specs
@parser(Specs.getcert_list)
class CertList(CommandParser):
... |
from abc import ABCMeta, abstractstaticmethod
class LPerson(metaclass = ABCMeta):
@abstractstaticmethod
def personMethod():
"""iface method"""
class Student(LPerson):
def __init__(self):
self.name = "zulkepretes"
def personMethod(self):
print("Student name {}".format(self.... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Python framework for developing neural network emulators of
RRTMGP gas optics scheme
This program takes existing input-output data generated with RRTMGP and
user-specified hyperparameters such as the number of neurons,
scales the data if requested, and trains a neur... |
import dateutil.parser
def parse_date(r):
return dateutil.parser.parse(r).date()
|
# This Python file uses the following encoding: utf-8
"""Gather data from github user and render an html templatewith that data."""
|
keyboard.send_keys("<shift>+9")
|
"""iais URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/3.1/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: path('', views.home, name='home')
Class-based vi... |
from itertools import combinations
import sys
input = sys.stdin.readline
N, M = map(int, input().split())
jido = [[int(i) for i in input().split()] for _ in range(N)]
chickens = []
jip = []
for x in range(N):
for y in range(N):
if jido[x][y] == 2:
chickens.append((x,y))
if jido[x][y] ... |
# -*- coding: utf-8 -*-
"""
Created on Sat May 7 19:57:09 2016
@author: castaned
"""
import main_modules as mmod
import pylab as plt
import seaborn as sns
sns.set(style="white",rc={"figure.figsize": (8, 8),'axes.labelsize': 16,
'ytick.labelsize': 12,'xtick.labelsize': 12,
... |
import ray
import torch
import random
import argparse
import numpy as np
from tqdm import tqdm
from copy import deepcopy
from simrl.utils import setup_seed, soft_critic_update
from simrl.utils.modules import OnehotActor, BoundedContinuousActor, Critic
from simrl.utils.envs import make_env
from simrl.utils.data import ... |
from typing import List, Optional
from fastapi import FastAPI
from pydantic.main import BaseModel
from fastapi_hypermodel import HyperModel, UrlFor, LinkSet
from fastapi_hypermodel.hypermodel import HALFor
class ItemSummary(HyperModel):
name: str
id: str
href = UrlFor("read_item", {"item_id": "<id>"})
... |
from typing import Any, Dict, List
from pydantic.main import BaseModel
from ..feature import FeatureSchema
class ClassificationAnswer(FeatureSchema):
"""
- Represents a classification option.
- Because it inherits from FeatureSchema
the option can be represented with either the name or feature_s... |
# coding:utf-8
from setuptools import setup
# or
# from distutils.core import setup
setup(
name='pypcie',
version='0.1',
description='Pcie utils',
author='Alex',
author_email='[email protected]',
url='https://github.com/shmily1012/pypcie',
packages=['pcie'],
)
|
input("your name : ")
print("Hello " + a) |
# Time domain response functions
#
# [email protected], 2020
import numpy as np
import numba
import scipy
import copy
from scipy.integrate import trapz
from scipy.integrate import simps
import tools
def gamma_pdf(x, k, theta):
""" Gamma pdf density.
Args:
x : input argument
... |
"""
random: Implements a simple AI, that only performs random actions.
"""
from time import sleep
from numpy.random import uniform
from controller.game_ai import GameAI
from view.log import log
class Random(GameAI):
def execute_action(self, state):
super.__doc__
actions = self.game.actions(state)
... |
from fastapi import APIRouter
from monailabel.interfaces import MONAILabelApp
from monailabel.utils.others.app_utils import app_instance
router = APIRouter(
prefix="/info",
tags=["AppService"],
responses={404: {"description": "Not found"}},
)
@router.get("/", summary="Get App Info")
async def app_info()... |
# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo import _, api, exceptions, fields, models
class SMSRecipient(models.TransientModel):
_name = 'sms.resend.recipient'
_description = 'Resend Notification'
_rec_name = 'sms_resend_id'
sms_resend... |
import gym
from gym import wrappers
env = gym.make('Reacher-v1')
env.reset()
env.render()
outdir = './log/'
f_act = open(outdir + 'log_act.txt', 'w')
f_obs = open(outdir + 'log_obs.txt', 'w')
f_rwd = open(outdir + 'log_rwd.txt', 'w')
f_info = open(outdir + 'log_info.txt', 'w')
env = wrappers.Monitor(env, directory=... |
from django.contrib import admin
from .models import raspberry
admin.site.register(raspberry)
|
import typing
import os.path as path
from .... import config
from ...util.fs import mkdir_without_exception
from ...codegen.base import ConfigBase
class Generator(object):
"""
负责与第三方 RPC 框架进行对接的类型
用于生成 Service 的 Server 跟 Client 代码,
最终按照预定义的目录格式,将文件保存到指定的位置
"""
def __init__(self, configs: typ... |
# -*- coding: utf-8 -*-
import os
import errno
def silentremove(filename):
"""If ``filename`` exists, delete it. Otherwise, return nothing.
See http://stackoverflow.com/q/10840533/2823213."""
try:
os.remove(filename)
except OSError as e: # this would be "except OSError, e:" before Python 2... |
import logging
import json
from functools import wraps
from time import gmtime, strftime
logger = logging.getLogger(__name__)
def _default_get_user_identifier(request):
if request.user.is_authenticated:
return request.user.email
return None
def log_event(event_type, request, extra_data=None, level=... |
def lowercase_count(strng: str) -> int:
"""Returns count of lowercase characters."""
return sum(c.islower() for c in strng) |
def seperate(sen):
left, right = 0, 0
u, v, answer = '', '', ''
makeR = []
if sen == '':
return ''
for a in sen:
if a == ')':
right += 1
if len(makeR) != 0:
makeR.pop()
elif a == '(':
makeR.append(a)
left += 1
... |
# coding: utf-8
#
# Copyright 2022 :Barry-Thomas-Paul: Moss
#
# 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 applicab... |
import json
from llamalogs.helpers import ms_time
class AggregateLog:
def __init__(self, log):
self.sender = log.sender
self.receiver = log.receiver
self.account = log.account
self.message = ''
self.errorMessage = ''
self.initialMessageCount = 0
self.graph = ... |
"""
Small wrapper for the Python Google Drive API client library.
https://developers.google.com/api-client-library/python/apis/drive/v2
"""
from __future__ import print_function
import os
from apiclient.http import MediaFileUpload
from oauth2client import client
from oauth2client import tools
from oauth2client.file i... |
from flask import current_app as app
# individual product class
class OneProduct:
def __init__(self, pid, name, price, available, img):
self.pid = pid
self.name = name
self.price = price
self.available = available
self.img = img
# get all basic info related to this prod... |
from instapy import InstaPy
session = InstaPy(username="d.sen17", password="clameclame") #headless_browser=True)
session.login()
comments = ['Truly Loved Your Post', 'Its awesome', 'Your Post Is inspiring']
session.set_do_comment(enabled=False, percentage=100)
session.set_comments(comments)
session.like_by_users(['s... |
from __future__ import print_function, unicode_literals
CONSUMER_KEY = "c5e79584a52144467a1ad3d0e766811f052c60e9b"
CONSUMER_SECRET = "62350daf22709506832908a48f219a95"
DATA_DIR = "~/.moe-upnp"
MOEFOU_API_ROOT = "http://api.moefou.org"
MOEFM_API_ROOT = "http://moe.fm"
|
import xml.etree.ElementTree as Et
tree = Et.parse('movies.xml')
root = tree.getroot()
for child in root:
print(child.tag, child.attrib)
input("gyerek elemek listázása")
for movie in root.iter('movie'):
print(movie.attrib)
input("filmek attribútumai")
for description in root.iter('description'):
print(de... |
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT license.
import logging
import torch
import torch.optim as optim
from nni.nas.pytorch.trainer import Trainer
from nni.nas.pytorch.utils import AverageMeterGroup
from .mutator import EnasMutator
logger = logging.getLogger(__name__)
class EnasTrainer(Tr... |
"""simple gui for library.
Copyright (c) 2022 Ali Farzanrad <[email protected]>
Permission to use, copy, modify, and distribute this software for any
purpose with or without fee is hereby granted.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
WITH REGARD TO THIS SOFTWARE INCLUDING ... |
"""Init command for Ginpar projects.
This module implements the initialization command for the ginpar static content
generator.
`init` will prompt for a series of values to write the site configuration file.
Examples
--------
To initialize a project in a standard way to specify the configuration values::
ginpa... |
"""FFmpeg writer tests of moviepy."""
import multiprocessing
import os
from PIL import Image
import pytest
from moviepy.video.compositing.concatenate import concatenate_videoclips
from moviepy.video.io.ffmpeg_writer import ffmpeg_write_image, ffmpeg_write_video
from moviepy.video.io.gif_writers import write_gif
fro... |
# -*- coding: utf-8 -*-
"""
Copyright ©2017. The Regents of the University of California (Regents). All Rights Reserved.
Permission to use, copy, modify, and distribute this software and its documentation for educational,
research, and not-for-profit purposes, without fee and without a signed licensing agreement, is
he... |
# This is the python file that should be run to run the program
import hash_functions
welcome_message = "###########################\n\nWelcome to SSAFuze's hash tool! Please see the options below to get you started"
supported_hashes = ['md5', 'sha1', 'sha224', 'sha256', 'sha384']
print(welcome_message)
while True:
... |
"""
Première tentative d'implémenter A* pour le projet ASD1-Labyrinthes.
On part d'une grille rectangulaire. Chaque case est un "noeud". Les
déplacements permis sont verticaux et horizontaux par pas de 1, représentant
des "arêtes" avec un coût de 1.
Tout est basé sur une grille rectangulaire.
L'objet de base est une... |
from __future__ import absolute_import, unicode_literals
from datetime import datetime
from celery.task import task
from dateutil.relativedelta import relativedelta
from django.db import connections
from corehq.sql_db.connections import get_aaa_db_alias
from custom.aaa.models import (
AggAwc,
AggregationInfo... |
__all__ = ["module_graph", "module_ilp","module_file"]
|
'''
John Whelchel
Summer 2013
Library of decorators that simplify some views by grouping code that is
always run at the start or end of views.
'''
import logging
from django.http import HttpResponse
import storage.storage as db
from django.template import Context, loader
from django.shortcuts import redirect
from... |
def createText():
textToBeAdded = """\nQPushButton {
color: blue;
}"""
return textToBeAdded
textToBeAdded = createText()
with open("Style.qss", "a") as f:
f.write(textToBeAdded)
new = textToBeAdded.replace("blue","orange")
with open("Style.qss", "r+") as f:
old = f.read() # read everything in... |
import sys
import cProfile
from memory_profiler import profile
@profile()
def mem_to_be_profiled():
my_list1 = [i**2 for i in range(50000)]
my_list2 = (i**2 for i in range(100000, 150000))
sum = 0
print("my_list1 = {} bytes".format(sys.getsizeof(my_list1)))
print("my_list2 = {} bytes".forma... |
import sys
sys.path.insert(0, "../../Sknet/")
import sknet
import os
import numpy as np
import time
import tensorflow as tf
from sknet import ops,layers
import argparse
parser = argparse.ArgumentParser()
#parser.add_argument('--data_augmentation', type=int)
parser.add_argument('--dataset', type=str)
parser.add_argum... |
# Copyright (c) 2021 SMHI, Swedish Meteorological and Hydrological Institute
# License: MIT License (see LICENSE.txt or http://opensource.org/licenses/mit).
"""
Created on 2021-01-05 10:36
@author: johannes
"""
from abc import ABC
class Reader(ABC):
"""
"""
def __init__(self):
super().__init__(... |
from snowddl.blueprint import TechRoleBlueprint
from snowddl.resolver.abc_role_resolver import AbstractRoleResolver
class TechRoleResolver(AbstractRoleResolver):
def get_role_suffix(self):
return self.config.TECH_ROLE_SUFFIX
def get_blueprints(self):
return self.config.get_blueprints_by_type(... |
f = open("links.txt", "r")
f1 = open("cleanedLinks.txt", "w")
for line in f:
if "javascript:void(0)" in line or "login?" in line or "vote?" in line or "item?" in line or "user?" in line or "hide?" in line or "fave?" in line or "reply?" in line:
pass
else:
f1.write(line + "\n")
|
import random
import discord
from discord.ext import commands
import time
from momiji.modules import permissions
class MomijiSpeak(commands.Cog):
def __init__(self, bot):
self.bot = bot
@commands.Cog.listener()
async def on_message(self, message):
async with self.bot.db.execute("SELECT ch... |
from .application import settings
from .redis import redis
from .facebook import facebook
from .google import google
from .smtp import smtp
__all__ = (
settings,
redis,
facebook,
google,
smtp,
)
|
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
import django.db.models.deletion
import djangobmf.numbering.validators
import djangobmf.utils.generate_filename
from django.conf import settings
import django.utils.timezone
import djangobmf.document.storage
clas... |
import os
import pathlib
import sys
import tempfile
import unittest
from io import StringIO
from modulegraph2 import (
Alias,
AliasNode,
BuiltinModule,
DependencyInfo,
ExcludedModule,
ExtensionModule,
InvalidModule,
InvalidRelativeImport,
MissingModule,
ModuleGraph,
Namespac... |
# import importlib
#
#
# path = 'scrapy.middlerware.C1'
#
# md,cls_name = path.rsplit('.', maxsplit=1)
# print(cls_name)
#
# importlib.import_module(md)
class Foo(object):
def __getitem__(self, item):
return "123"
def __setitem__(self, key, value):
pass
def __delitem__(self):
pas... |
import operator
import collections
import pandas as pd
import numpy as np
from ramm_tox import util, stats
def round_concentration(values):
"""Round concentration values to 4 decimal places in log space."""
return 10 ** np.round(np.log10(values), 4)
def strings_to_wordsets(strings, stop_words=None):
"""Bu... |
import json
import random
import os
import numpy as np
import torch
from torch.utils.data import Dataset
from torch.utils.data import DataLoader
import copy
import math
import h5py
import models.Constants as Constants
from bisect import bisect_left
import torch.nn.functional as F
import pickle
from pandas.io.json impo... |
"""Top-level package for ElevatorProblem."""
__author__ = """Ravi Agrawal"""
__email__ = '[email protected]'
__version__ = '0.1.0'
|
import numpy as np
import librosa
class Element(object):
def __init__(self,
num_mic=4,
sampling_frequency=16000,
fft_length=512,
fft_shift=256,
sound_speed=343,
theta_step=1,
frame_num=1000000):
... |
from .borg import Borg
from .encrypted_file import EncryptedFile
from .sentinel import Sentinel
from .singleton import Singleton
from .classproperty import classproperty
from .deprecated import deprecated
from .retryable import retryable
from .sampled import sampled
from .timed import timed
from .timeoutable import ti... |
# 015-反转链表
#输入一个链表,反转链表后,输出新链表的表头。
# 思路:
假设翻转1->2->3->4->5,步骤如下:
head->4->3->2->1->5
p tp
1.我们将p的next指向tp的next
2.将tp的next指向head的next
3.将head的next指向tp
class ListNode:
def __init__(self, x):
self.val = x
self.next = None
def ReverseList(pHead):
if not pHea... |
# Test that group functionality is working
from unittest import TestCase
import datetime
from oasis.lib import DB, Groups, Periods, Courses
class TestGroups(TestCase):
@classmethod
def setUpClass(cls):
DB.MC.flush_all()
def test_create_group(self):
""" Fetch a group back and check it
... |
# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
import os
# sqlserver connection string
from djimix.settings.local import MSSQL_EARL
from djimix.settings.local import INFORMIX_ODBC, INFORMIX_ODBC_TRAIN
from djimix.settings.local import (
INFORMIXSERVER,
DBSERVERNAME,
INFORMIXDIR,
... |
# --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------... |
from .dataclasses import PassiveSkill, ActiveSkill, SkillTargetType, Card
from .string_mgr import DictionaryAccess
from typing import Callable, Union
from collections import UserDict
from .skill_cs_enums import (
ST,
IMPLICIT_TARGET_SKILL_TYPES,
PERCENT_VALUE_SKILL_TYPES,
MIXED_VALUE_SKILL_TYPES,
)
An... |
# Licensed under a 3-clause BSD style license - see LICENSE.rst
# -*- coding: utf-8 -*-
"""This module corresponds to the photoobj directory in photoop.
"""
def sdss_calibv():
"""Return calibration for velocities from pix/frame to deg/day.
Returns
-------
:class:`float`
The conversion from pi... |
__all__ = ('HashPreimage',)
import os
import ctypes
from ctypes import cdll
from ethsnarks.verifier import Proof, VerifyingKey
class HashPreimage(object):
def __init__(self, native_library_path, vk, pk_file=None):
if pk_file:
if not os.path.exists(pk_file):
raise RuntimeError... |
from .create import CreateRoomView
from .index import IndexView
from .member import MemberView
from .room import RoomHistoryView, RoomView
from .settings import SettingsView
from .status import StatusView
__all__ = (
'CreateRoomView',
'IndexView',
'MemberView',
'RoomHistoryView',
'RoomView',
'S... |
"""
Preprocess the dataset
"""
# import module
import pandas as pd
import os
from datetime import datetime, timedelta
from dateutil.rrule import rrule, DAILY
import requests
import random
import urllib
#################################################################################################################
#... |
#!/usr/bin/env python
from __future__ import print_function
from __future__ import division
from builtins import range
from past.utils import old_div
from read_hdf5 import *
T = 1.0
nDTout = 100
DT = old_div(T,float(nDTout))
def uex0(x,t):
"""
Exact solution
"""
return 128.0*(1.0-t)*x[...,1]*(1.0-x[.... |
# -*- coding: utf-8 -*-
import pytest
from bookops_watchdog.bpl.class_marks import (
call_no_audience,
call_no_format,
has_language_prefix,
parse_bpl_call_no,
)
@pytest.mark.parametrize(
"arg,expectation",
[
("AUDIO 001 J", "a"),
("AUDIO J FIC ADAMS", "j"),
("AUDIO J ... |
import numpy as np
import matplotlib.pyplot as plt
with open('accuracy_big') as f:
x = [i*0.1 for i in range(0, 11)]
y = [float(i) for i in f]
plt.plot(x,y)
plt.xlabel("mu")
plt.ylabel("Accuracy")
# plt.title("Prediction Accuracies (concated)")
plt.title("Prediction Accuracies")
plt.show()
|
"""This module contains PlainFrame and PlainColumn tests.
"""
import collections
import datetime
import pytest
import numpy as np
import pandas as pd
from numpy.testing import assert_equal as np_assert_equal
from pywrangler.util.testing.plainframe import (
NULL,
ConverterFromPandas,
NaN,
PlainColumn... |
def velthview_with_rm(line, romanflag):
#Now it works even if Ł and $ are not in the same line
#romanflag = False
return_line = ""
new_c = ""
dharma_trans_dict = {"ṃ": "ṁ",
"ṛ": "r̥",
"ṝ": "r̥̄",
... |
from .market import Market
from . import position
from ..db.models import TradingOrder
import logging
logger = logging.getLogger(__name__)
class MarketSimulator(Market):
"""Wrapper for market that allows simulating simple buys and sells"""
def __init__(self, exchange, base_currency, quote_currency, quote_cur... |
"""
raven.contrib.django.handlers
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
:copyright: (c) 2010-2012 by the Sentry Team, see AUTHORS for more details.
:license: BSD, see LICENSE for more details.
"""
from __future__ import absolute_import
import logging
from raven.handlers.logging import SentryHandler as BaseSentryHandler
cl... |
# Hertz Mindlin Contact Model for DEM
# 14.12.2021 Deeksha Singh
#import matplotlib.pyplot as plt
import numpy as np
# Particle 1
class Particle1:
def __init__(self):
self.G = 793e8 # Shear Modulus in SI Units
self.E = 210e9 # Youngs's Modulus in SI Units
self.nu = 0.3 # ... |
import json
from datetime import datetime, timedelta
from opennem.api.stats.controllers import stats_factory
from opennem.api.stats.schema import DataQueryResult, OpennemData, OpennemDataSet
from opennem.api.time import human_to_interval, human_to_period
from opennem.core.networks import network_from_network_code
from... |
#!/usr/bin/env python
# Copyright (c) 2022 SMHI, Swedish Meteorological and Hydrological Institute.
# License: MIT License (see LICENSE.txt or http://opensource.org/licenses/mit).
"""
Created on 2022-02-03 13:40
@author: johannes
"""
from pathlib import Path
from odv_transformer import Session
if __name__ == "__main... |
import logging
import numpy as np
import torch
from torch import nn
from torchvision.ops.boxes import box_area
from cvpods.layers import ShapeSpec, cat, generalized_batched_nms
from cvpods.modeling.basenet import basenet
from cvpods.modeling.box_regression import Box2BoxTransformTrace
from cvpods.modeling.losses impor... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Long range SSH Hamiltonian
Created on Mon Jul 31 10:20:50 2017
@author: Alexandre Dauphin
"""
import numpy as np
def ham(j1, j2, j3, j4, w1, w2, w3, w4, n):
vec1 = j1*np.ones(2*n-1)
vec1[1:2*n-1:2] = j2
vec2 = np.ones(2*n-3)*j3
vec2[... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.