content stringlengths 5 1.05M |
|---|
"""Language class for gruut"""
import logging
import os
import typing
from pathlib import Path
import pydash
import yaml
from gruut_ipa import IPA, Phonemes
from .phonemize import Phonemizer
from .toksen import PostTokenizeFunc, Token, TokenizeFunc, Tokenizer
from .utils import env_constructor
# -------------------... |
"""This file contains an implementation of the Morse wavelet"""
import copy
import numpy as np
from scipy.special import gamma, gammaln, comb
from .wavelet import Wavelet
from . import morseutils
__all__ = ['Morse']
class Morse(Wavelet):
def __init__(self, *, fs=None, freq=None, gamma=None, beta=None):
... |
from views import *
from lookups import *
import requests
import re
from utils import *
import itertools
from config import config
if config.IMPORT_PYSAM_PRIMER3:
import pysam
import csv
#hpo lookup
import orm
from pprint import pprint
import os
import json
import pymongo
import sys
import re
import itertools
from ... |
from django.core.management.base import BaseCommand
from usaspending_api.transactions.agnostic_transaction_loader import AgnosticTransactionLoader
from usaspending_api.transactions.models.source_assistance_transaction import SourceAssistanceTransaction
class Command(AgnosticTransactionLoader, BaseCommand):
help ... |
# automatically generated by the FlatBuffers compiler, do not modify
# namespace: DeepSeaScene
import flatbuffers
from flatbuffers.compat import import_numpy
np = import_numpy()
class VertexFormat(object):
__slots__ = ['_tab']
@classmethod
def GetRootAs(cls, buf, offset=0):
n = flatbuffers.encod... |
import six
import timeit
def do(setup_statements, statement, times):
# extracted from timeit.py
t = timeit.Timer(stmt=statement,
setup="\n".join(setup_statements))
return t.timeit(times) / times
def test_importaddress():
entropy = "b3d45565178cbc13b91a52db39ff5ef6b2d9b464ee6c250c84bb1b63459970a4"
for path ... |
import csv
from fpdf import FPDF
def convert(source:str, destination:str, orientation="P", delimiter=",",
font=None, headerfont=None, align="C", size=8, headersize=10) -> None:
"""
# CONVERTS A CSV FILE TO PDF FILE ( .csv ➜ .pdf )
:param `source`: `***str*** : ***Required*** : The fil... |
import time
class MemCache(object):
class Record:
def __init__(self, value):
self.time = time.time()
self.value = value
def clear(self):
self.value = None
def expired(self, timeout):
return timeout > 0 and time.time() - self.time >= timeout... |
def solution(sequence):
sol = []
neg_sum = 0
pos_sum = 0
for i in range(len(sequence)):
if (i+1) < len(sequence):
x = sequence[i]
y = sequence[i+1]
print(x,y)
if x > y:
sol.append(-1) #azalma
else:
sol.ap... |
# -*- coding: utf-8 -*-
"""Constants for BEL Commons."""
from pybel.constants import METADATA_CONTACT, METADATA_DESCRIPTION, METADATA_LICENSES
BEL_COMMONS_STARTUP_NOTIFY = 'BEL_COMMONS_STARTUP_NOTIFY'
SENTRY_DSN = 'SENTRY_DSN'
SWAGGER = 'SWAGGER'
SQLALCHEMY_DATABASE_URI = 'SQLALCHEMY_DATABASE_URI'
SQLALCHEMY_TRACK_M... |
from .models import Entry
def latest_entries():
try:
entries = (
Entry.objects.filter(status=Entry.PUBLISHED_STATUS)
.order_by("-created_at")
.select_related()[:2]
)
if entries.count() > 1 and not entries[0].is_micro and not entries[1].is_micro:
... |
from __future__ import absolute_import, print_function
import os
import pandas as pd
import numpy as np
from .BaseStructProtocol import BaseStructProtocol
from codifyComplexes.CodifyComplexException import CodifyComplexException
from computeFeatures.seqStep.seqToolManager import SeqToolManager
AA_CODE_ELEMENTS= SeqToo... |
import typing as t
from .filters import FILTERS as DEFAULT_FILTERS # noqa: F401
from .tests import TESTS as DEFAULT_TESTS # noqa: F401
from .utils import Cycler
from .utils import generate_lorem_ipsum
from .utils import Joiner
from .utils import Namespace
# defaults for the parser / lexer
BLOCK_START_STRING = "{%"
... |
from collections import namedtuple
Order = namedtuple("Order", "id shiftleft shifttop width height")
with open("data.txt") as f:
orders = [
Order(*list(map(int, x.split())))
for x in (
f.read()
.replace("#", "")
.replace("@ ", "")
.replace(",", " ")
... |
from setuptools import setup, find_packages
# https://docs.djangoproject.com/en/1.11/intro/reusable-apps/
version = "0.3.8"
setup(
name="kwikapi-tornado",
version=version,
packages=["kwikapi.tornado"],
include_package_data=True,
license="MIT License", # example license
description="Quickest wa... |
#!/usr/bin/python3
# Zadani:
# V tomto prikladu budeme pracovat se stromy aritmetickych vyrazu, pojmenujme
# si je ATree. ATree je binarni strom obsahujici v listech cisla a v jinych
# uzlech operatory. Operatory jsou nasledujici:
# '+' je binarni plus, ktere secte prvni a druhy argument,
# '*' je binarni krat, kt... |
"""Data schema for Gamebox."""
import collections
Gamebox = collections.namedtuple(
"Gamebox", [
# Gems available. A defaultdict(int) keyed by GemType.
"gems",
# Development cards available.
"development_cards",
# NobleTiles available.
"noble_tiles",
# The GameRules.
"game_rules",... |
from tkinter import *
import random
import tkinter.messagebox
class Number_Guessing:
def __init__(self,root):
self.root=root
self.root.title("Number Guessing")
self.root.geometry("500x350")
self.root.iconbitmap("logo1064.ico")
self.root.resizable(0,0)
answer=String... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Wed Jun 26 15:49:57 2019
@author: xingyu
"""
import sys
sys.path.append('./LPRNet')
sys.path.append('./MTCNN')
from LPRNet_Test import *
from MTCNN import *
import numpy as np
import argparse
import torch
import time
import cv2
if __name__ == '__main__':
... |
class NotFoundException(Exception):
def __init__(self, message):
super(NotFoundException, self).__init__(message)
|
"""
Quantiphyse - Enumeration classes
Copyright (c) 2013-2020 University of Oxford
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 b... |
from pymongo import MongoClient
DEFAULT_MONGO_CONNECTION_STRING = "mongodb://127.0.0.1:27017/admin"
class KnowledgeBase:
def __init__(
self,
mongo_connection_string: str,
database: str,
collection: str,
page_id_attr: str,
page_title_attr: str,
page_descript... |
# From https://www.baldengineer.com/raspberry-pi-gui-tutorial.html
# by James Lewis (@baldengineer)
# Minimal python code to start PyQt5 GUI
#
# You don't need all of these "main.py" files
# they are here for illustration only.
# always seem to need this
import sys
# This gets the Qt stuff
import PyQt5
from PyQt5.Q... |
# -*- coding: utf-8 -*-
"""
readBLgrid
function: read in the Turbsim '.wnd' binary wind field data
------------------------------------------------------------------------------------
This code is translated from the matlab version.
copyright: TurbSim (c) NREL
source: https://github.com/old-NWTC/TurbSim/blob/m... |
from ree.core import Scraper
class Fuerteventura(Scraper):
def __init__(self, session=None, verify=True):
super(self.__class__, self).__init__(session, verify)
def get(self, date=None, last=True):
return super(self.__class__, self).get("FUERTEVE", "Atlantic/Canary", "Canarias", date, last)
... |
'''
Arquivo de configuração para auxiliar na execução desde ETL.
Em FILE_SETTINGS estão as configurações relativas aos arquivos de texto
contendo as coordenadas.
Em DATABASE_SETTINGS estão as configurações relativas à Base de Dados,
como dados de conexão e ações.
Em VISUALIZATION_SETTINGS estão as configurações rela... |
from collections import OrderedDict
from clutchless.service.torrent import AnnounceUrl, OrganizeService
def test_formatted_hostname():
url = AnnounceUrl("http://domain.test.com/announce")
assert url.formatted_hostname == "TestCom"
def test_split_hostname():
result = AnnounceUrl.split_hostname("domain.... |
from summarus.modules.bahdanau_attention import BahdanauAttention
from summarus.modules.torch_transformer_decoder_net import TorchTransformerDecoderNet
from summarus.modules.torch_transformer_encoder import TorchTransformerEncoder |
#part of Python's built-in os module
from os import getenv
from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy import create_engine
from sqlalchemy.orm import sessionmaker
from dotenv import load_dotenv
from flask import g
#calling load_dotenv from python-dotenv since we used .env file
load_dotenv(... |
# Elastic search mapping definition for the Molecule entity
from glados.es.ws2es.es_util import DefaultMappings
# Shards size - can be overridden from the default calculated value here
# shards = 3,
replicas = 1
analysis = DefaultMappings.COMMON_ANALYSIS
mappings = \
{
'properties':
{
... |
"""Configuration and fixtures for tests."""
import logging
import pytest
@pytest.fixture(scope="function")
def show_it_works():
"""Dummy fixture that outputs to console and shows that it works."""
logger = logging.getLogger(__name__)
logger.info("Setup of the fixture")
yield
logger.info("Tear do... |
from moodlesg.math.base import Expression, _bool
def trunc(expr):
return Expression.__trunc__(expr)
def bool(expr):
"""
Implement truth value testing.
Expression is considered true if its result is nonzero.
"""
return _bool(expr)
|
# @Title: 数组中数字出现的次数 II (数组中数字出现的次数 II LCOF)
# @Author: 18015528893
# @Date: 2021-01-28 20:22:52
# @Runtime: 240 ms
# @Memory: 15.7 MB
from typing import List
class Solution:
def singleNumber(self, nums: List[int]) -> int:
result = 0
for i in range(32):
count = 0
index = ... |
CONFIG = {
"markers": [
{
# Deadline is 04/22/2022 @ 11:59pm, but use 04/23/2022 @ 12am
# since it'll look nicer
'd': ['2022-04-23'],
't': 0,
'l': 'solid',
'c': '#ad0be3',
'n': 'Drop (No W) Deadline',
's': False
... |
from settings.defaults import *
EUKALYPSE_BROWSER='chrome'
EUKALYPSE_HOST='http://192.188.23.18:4444'
EMAIL_HOST = 'mail.s-v.de'
#SENTRY_DSN = 'http://10eb8cf305f741e9acf227a82f12d21a:017e859ff4434ae496b001f5d1f638de@sentry.inhouse.s-v.de:9000/12'
if SENTRY_DSN:
LOGGING['handlers']['sentry'] ={
'le... |
# -*- coding: utf-8 -*-
class Lamp:
_LAMPS = ['''
.
. | .
\ | /
. .---. .
--- ( ) ---
\ _ /
_|_|_
|_____|
''',
'''
.---.
( )
\ _ /
_|_|_
|_____|
... |
#
# PySNMP MIB module HPN-ICF-VXLAN-MIB (http://snmplabs.com/pysmi)
# ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/HPN-ICF-VXLAN-MIB
# Produced by pysmi-0.3.4 at Mon Apr 29 19:29:58 2019
# On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4
# Using Python version 3.7.3 (default, Ma... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
from math import sqrt, fabs
from test_statistics import isclose
from dcstats.basic_stats import ttest_independent, ttest_paired
from dcstats.basic_stats import TTestBinomial, TTestContinuous
def test_ttest_P_paired():
X = [2, 4, 6]
Y = [1, 2, 3]
... |
class Solution:
def diStringMatch(self, S: str) -> List[int]:
low, high = 0, len(S)
ans = []
for x in S:
if x == 'I':
ans.append(low)
low += 1
else:
ans.append(high)
high -= 1
return ans + [low]
|
"""File name operation.
Change file name for encryption.
"""
import random
WORDS = ('abcdefghijkmnopqrstuvwxyz'
'ABCDEFGHIJKLMNPQRSTUVWXYZ123456789'
'_-')
def change(filename, min_word=5, max_word=10, min_class=3, max_class=6):
"""Change directry name."""
extention = ""
if '.' in file... |
from django.contrib.auth.models import User
from django.db import models
from django.db.models import Sum
class Provincia(models.Model):
dne_id = models.PositiveIntegerField(primary_key=True)
nombre = models.CharField(max_length=100)
def __unicode__(self):
return self.nombre
class Municipio(mod... |
from .object import KittiObjectLoader, KittiObjectClass
|
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import argparse
import os
from azureml.core import Run
from tfod_utils.evaluation_tf2 import Scoring
from tfod_utils.evaluation_tf2 import ImageMetrics
from tfod_utils.evaluation_tf2 import DetectionMetrics
f... |
from RIAssigner.data import MatchMSData
class MatchMSDataBuilder:
def __init__(self):
self.filename = None
self._rt_unit = 'seconds'
def with_filename(self, filename: str):
self.filename = filename
return self
def with_rt_unit(self, rt_unit: str):
s... |
import random
class RankingSelection:
def select_candidates(self, candidates, number):
""" Select a number of candidates from given candidates list.
Fitness level is used to associate a probability of selection with each candidate.
Parameters:
- candidates (list): given... |
# Copyright (C) 2014-2016 Cuckoo Foundation.
# This file is part of Cuckoo Sandbox - http://www.cuckoosandbox.org
# See the file 'docs/LICENSE' for copying permission.
from lib.api.process import Process
from lib.exceptions.exceptions import CuckooPackageError
class Package(object):
"""Base abstract analysis pack... |
import logging
import pytest
import requests
from pytest_bdd import parsers
from pytest_bdd import scenarios
from pytest_bdd import then
from pytest_bdd import when
@pytest.fixture
def pytestbdd_strict_gherkin():
return False
scenarios('features/prometheus.feature')
@when(parsers.parse(
"I list the prom... |
from command import *
class TransferCommand(Command):
def get_aliases(self):
return ["transfer", "transferb", "t", "tb"]
def get_params_help(self):
return ("\n\t<sender_account_address>|<sender_account_ref_id>"
" <receiver_account_address>|<receiver_account_ref_id> <number_o... |
"""Support for testing internet speed via Speedtest.net."""
from datetime import timedelta
import logging
import speedtest
import voluptuous as vol
from homeassistant.config_entries import SOURCE_IMPORT
from homeassistant.const import (
CONF_MONITORED_CONDITIONS,
CONF_SCAN_INTERVAL,
EVENT_HOMEASSISTANT_ST... |
import numpy as np
from flask import Flask, request, jsonify, render_template
import pickle
import os
import argparse
import logging
import json
from forecaster.utils import _load_model_dict
app = Flask(__name__)
def forecast(ticker, data):
models = _load_model_dict()
print(models)
model = models[ticker]... |
"""
-----------------------------------------------------------------------------
This source file is part of VPET - Virtual Production Editing Tools
http://vpet.research.animationsinstitut.de/
http://github.com/FilmakademieRnd/VPET
Copyright (c) 2021 Filmakademie Baden-Wuerttemberg, Animationsinstitut R&D Lab
This p... |
from django.conf.urls import patterns, url
urlpatterns = patterns(
'api.network.views',
# base
# /network - get
url(r'^$', 'net_list', name='api_net_list'),
# ip
# /network/ip/<subnet> - get
url(r'^ip/$', 'subnet_ip_list', name='api_ip_list'),
url(r'^ip/(?P<subnet>[0-9\./]+)/$', 'subn... |
"""
终端命令 :export FLASK_ENV=development; flask run
"""
from flask import Flask
def create_app():
app = Flask(__name__)
# 注册蓝图
from .main import main as bp_main
app.register_blueprint(bp_main)
app.debug = True
return app
|
# 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, software
# distr... |
# coding:utf-8
"""Doctest example"""
import doctest
import unittest
def sum_fnc(a, b):
"""
Returns a + b
>>> sum_fnc(10, 20)
30
>>> sum_fnc(-10, -20)
-30
>>> sum_fnc(10, -20)
-10
"""
return a + b
class TestSumFnc(unittest.TestCase):
def test_sum_with_positive_numbers(s... |
from __future__ import print_function
import torch
import torch.nn as nn
import torch.nn.functional as F
import torch.optim as optim
from PIL import Image
import matplotlib.pyplot as plt
import cv2
import os
import time
import warnings
import torchvision.transforms as transforms
import torchvision.models as models
... |
#!/usr/bin/python3
# -*- coding: utf-8 -*-
# folddup.py
import filecmp
import group
import itertools
import os
def folddup(f1,f2):
try:
dcmp = filecmp.dircmp(f1,f2)
if any([len(dcmp.left_only),len(dcmp.right_only),len(dcmp.funny_files)]):
return False
(_, mismatch, errors) = fi... |
def LoadFromText(sList):
print("加载已有数据……")
try:
txtFile=open("/Users/chenchaoyang/Desktop/python/Python/File/students.txt","r")
while True:
line=txtFile.readline()
if not line or line.strip()==" ":
break
else:
s=line.split(" ")
... |
from .cas_number import CasNumber, InvalidCasNumber, NotSupported
import unittest
co2_set = {'000124-38-9', '000124389', '124-38-9', '124389'}
class CasNumberTest(unittest.TestCase):
def test_valid_co2(self):
g = CasNumber(124389)
self.assertSetEqual(set([k for k in g.terms]), co2_set)
s... |
"""
June 17th, 2019. This python file combines past data with updated 2019 data points for further analysis.
"""
from fileLoading import loadExcel
from dateConv import noaaDateConv, decToDatetime
from scipy import stats
import pandas as pd
import datetime as dt
import calendar
import numpy as np
def methane():
... |
# -*- coding: utf-8 -*-
# ----------------------------------------------------------------------
# Alcatel.AOS.get_metrics
# ----------------------------------------------------------------------
# Copyright (C) 2007-2016 The NOC Project
# See LICENSE for details
# ------------------------------------------------------... |
from test_helper import run_common_tests, failed, passed, get_answer_placeholders
def test_answer_placeholders():
placeholders = get_answer_placeholders()
placeholder = placeholders[0].replace('"', "'")
if placeholder == "logger = logging.getLogger('mortgage.rate')":
passed()
else:
fai... |
#
# TinyDB Model: Connections
#
from redmonty.models.tinydb.tinymodel import TinyModel
class Connections(TinyModel):
#
# Use the cerberus schema style
# which offer you immediate validation with cerberus
# http://docs.python-cerberus.org/en/stable/validation-rules.html
# types: http://docs.pytho... |
from __future__ import unicode_literals
# -*- coding: utf-8 -*-
#Faça um Programa que pergunte quanto você ganha por hora e o número de horas trabalhadas no mês.
# Calcule e mostre o total do seu salário no referido mês, sabendo-se que são
# descontados 11% para o Imposto de Renda, 8% para o INSS e 5% para o sindicato... |
from hms_workflow_platform.core.queries.base.base_query import *
class PhysicalExamQuery(BaseQuery):
def __init__(self, site):
super().__init__()
self.adapter = self.get_adapter(site)
self.query = self.adapter.query
def physicalexam_create(self, date_obj):
date = date_obj.strf... |
# --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------... |
"""Module to test Serializer functionality"""
import marshmallow as ma
import pytest
from protean.core.exceptions import ConfigurationError
from protean_flask.core.serializers import EntitySerializer
from ..support.sample_app.entities import Dog
from ..support.sample_app.entities import Human
from ..support.sample_a... |
# IMPORTS
from selenium import webdriver
from selenium.webdriver.common.keys import Keys
# Chrome Driver Setup Functions
def get_chrome_driver(options):
return webdriver.Chrome(chrome_options=options)
def get_chromdriver_options():
return webdriver.ChromeOptions()
def set_ignore_certificate_error... |
#!/usr/bin/env python2
# -*- coding: utf-8 -*-
"""Definition of classes GenerationProbabilityV(D)J to compute Pgen of a CDR3 seq.
Copyright (C) 2018 Zachary Sethna
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
... |
# Copyright 2022 Google LLC. 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 o... |
"""BDBF Docstring"""
from bdbf.main import *
__title__ = 'bdbf'
__author__ = 'Bertik23'
__license__ = 'MIT'
__copyright__ = 'Copyright 2020-2021 Bertik23'
__version__ = '1.1.2' |
OUTPUT_BASE_DIRECTORY = "/g11/wangdp/project/work/data/playground/operation/gfs/wxzx/output"
|
import torch
import cv2
from PIL import Image
from openvino.inference_engine import IECore
import onnxruntime
#https://pytorch.org/hub/hustvl_yolop/
# Model
model = torch.hub.load('hustvl/yolop', 'yolop', pretrained=True)
# Images
# img = 'https://ultralytics.com/images/zidane.jpg' # or file, Path, PIL, OpenCV, numpy,... |
# -*- coding: utf-8 -*-
# Generated by Django 1.9 on 2016-10-28 15:14
from __future__ import unicode_literals
from django.db import migrations
import osf.utils.fields
class Migration(migrations.Migration):
dependencies = [
('osf', '0012_auto_20161028_0908'),
]
operations = [
migrations.... |
# -*- coding: utf-8 -*-
"""
Created on Mon Aug 25 19:30:05 2014
@author: nestor
"""
import glob
import pandas as pd
import plot_storage_helper as ph
#Get the data from different files for the different algorithms and libraries
df_openfec = pd.concat(
[pd.read_csv(f) for f in glob.glob('openfec_debian6*.csv')])
d... |
import os
import numpy as np
import xml.etree.ElementTree as ET
def cub():
IMAGE_LIST_FILE = '../data/CUB_200_2011/images.txt'
IMAGE_LABEL_FILE = '../data/CUB_200_2011/image_class_labels.txt'
BOX_FILE = '../data/CUB_200_2011/bounding_boxes.txt'
SPLIT_FILE = '../data/CUB_200_2011/train_test_split.txt'
... |
from colorpickerwidget import ColorPickerButton, ColorPickerWidget
from pathwidget import PathWidget
from loggingwidget import LoggingWidget
from loginwidget import LoginWidget
from progresswidget import ProgressWidget
from propertieseditor import PropertiesEditor
from choicewidget import ChoiceWidget |
# Copyright (c) 2006-2010 Tampere University of Technology
#
# 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, modi... |
#!/usr/bin/python
import socket, time
bind_addr='172.16.11.50'
bcast_addr='172.16.11.255'
port=31585
msg='DEADBEEF'
my_socket = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
my_socket.setsockopt(socket.SOL_SOCKET, socket.SO_BROADCAST,1)
while 1:
my_socket.sendto(msg, (bcast_addr, port))
time.sleep(5)
|
from src.objs import *
from src.keyboard import *
from src.floodControl import floodControl
from urllib.parse import urlparse
from urllib.parse import parse_qs
def sendVideo(url, chatId, messageId=None, userLanguage=None):
userLanguage = userLanguage or dbSql.getSetting(chatId, 'language')
url = url.spl... |
import uuid
from django.test import Client, TestCase
from django.urls import reverse
from corehq.apps.data_dictionary.models import CaseProperty, CaseType
from corehq.apps.domain.shortcuts import create_domain
from corehq.apps.users.models import WebUser
from corehq.util.test_utils import flag_enabled
@flag_enabled... |
# XParty - A Framework for Building Tools to Support Social Learning in Synchronous Environments
# Authors: Ben Bederson - www.cs.umd.edu/~bederson
# Alex Quinn - www.cs.umd.edu/~aq
# Anne Rose - www.cs.umd.edu/hcil/members/~arose
# University of Maryland, Human-Computer Interaction Lab -... |
import RFFT
apiServerProcess = RFFT.APITask(debug=True, host="192.168.178.24", port=5000)
apiServerProcess.start()
while(True):
try:
pass
except KeyboardInterrupt:
apiServerProcess.shutdown()
print("Shutting down") |
import sys
import numpy as np
import pandas as pd
import time
from sklearn.decomposition import TruncatedSVD
from iterative_svd import IterativeSVD
import matplotlib.pyplot as plt
import plotly_express as px
import plotly
from distutils.util import strtobool
from file_processing import get_masked_matrix, process_labels... |
'''
https://leetcode.com/contest/weekly-contest-160/problems/maximum-length-of-a-concatenated-string-with-unique-characters/
'''
class Solution:
def maxLength(self, arr: List[str]) -> int:
def bitty(a):
if sorted(list(set(a))) != sorted(list(a)):
return None
x = 0
... |
#!/bin/python2
# Copyright (c) 2019 ZettaDB inc. All rights reserved.
# This source code is licensed under Apache 2.0 License,
# combined with Common Clause Condition 1.0, as detailed in the NOTICE file.
import sys
import json
import getpass
import argparse
from cluster_common import *
def generate_storage_service(ar... |
import re
from types import MappingProxyType
from typing import (
Sequence,
Mapping,
Any,
List,
Type,
Set,
Optional,
Tuple,
cast,
Iterable,
)
IMMUTABLE_EMPTY_DICT = MappingProxyType({})
class Line:
"""
A line of text and its associated indentation level.
This clas... |
"""
AVA package for training a VAE
Contains
--------
`ava.models.vae`
Defines the variational autoencoder (VAE).
`ava.models.vae_dataset`
Feeds syllable data to the VAE.
`ava.models.window_vae_dataset`
Feeds random data to the (shotgun) VAE.
`ava.models.utils`
Useful functions related to the `ava.models` subpackag... |
#!/usr/bin/python3
# Developed by Alexander Bersenev from Hackerdom team, bay@hackerdom.ru
"""Restores vm from snapshot"""
import sys
import time
import os
import traceback
import re
import do_api
from cloud_common import (log_progress, call_unitl_zero_exit, # get_cloud_ip,
SSH_OPTS, # SSH_... |
import sys
import matplotlib.pyplot as plt
from .plutoTools import readVTKSpherical
import numpy as np
import copy
from scipy import interpolate
from astropy import units as u
from astropy import constants as c
import astropy.io.fits as fits
import subprocess
from .parameters import Params
from .disc_structure import D... |
# Generated by Django 2.2.7 on 2019-11-21 11:48
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('collect', '0001_initial'),
]
operations = [
migrations.AlterUniqueTogether(
name='digestcounter',
unique_together=se... |
import torch
import torch.utils.data
from torch import nn, optim
from torch.nn import functional
from melime.generators.gen_base import GenBase
class CNNVAEGen(GenBase):
def __init__(self, image_channels, latent_dim, cuda=True, verbose=False, **kwargs):
self.model = ModelVAE(image_channels, latent_dim=la... |
"""flask student stories table
Revision ID: 7c1cd37b02e6
Revises: aa2aa87a965d
Create Date: 2021-12-27 13:50:18.012256
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = '7c1cd37b02e6'
down_revision = 'aa2aa87a965d'
branch_labels = None
depends_on = None
def upg... |
from __future__ import print_function
from sklearn.metrics import classification_report
from sklearn.neighbors import KNeighborsClassifier
from sklearn.cross_validation import StratifiedShuffleSplit
import numpy as np
from util import get_poke_xy
x_train, x_test, y_train, y_test = get_poke_xy()
#get indexes for 90/10... |
class Solution:
def subsetsWithDup(self, nums: List[int], sorted: bool = False) -> List[List[int]]:
if not nums: return [[]]
if len(nums) == 1: return [[], nums]
if not sorted: nums.sort()
result = self.subsetsWithDup(nums[:-1], sorted=True)
result = [i + [nums[-1]] for i in ... |
from __future__ import absolute_import
import logging
import requests
import json
from minemeld.ft.basepoller import BasePollerFT
LOG = logging.getLogger(__name__)
class IPv4(BasePollerFT):
def configure(self):
super(IPv4, self).configure()
self.polling_timeout = self.config.get('polling_timeou... |
from league_api.api import ApiType
from typing import List, Mapping
class BannedChampion(ApiType):
pickTurn: int = None # The turn during which the champion was banned
championId: int = None # The ID of the banned champion
teamId: int = None # The ID of the team that banned the champion
@property... |
#!/usr/bin/env python3
import urllib
url = 'http://www.someserver.com/cgi-bin/register.cgi'
user_agent = 'Mozilla/5.0 (Windows NT 6.1; Win64; x64)'
values = {'name': 'Michael Foord',
'location': 'Northampton',
'language': 'Python' }
headers = {'User-Agent': user_agent}
data = urllib.parse.urlenco... |
# GNU MediaGoblin -- federated, autonomous media hosting
# Copyright (C) 2011, 2012 MediaGoblin contributors. See AUTHORS.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either versio... |
#!/usr/bin/env python
"""Euler rotation matrix given sequence, frame, and angles."""
from __future__ import division, print_function
__author__ = 'Marcos Duarte, https://github.com/demotu/BMC'
__version__ = 'euler_rotmat.py v.1 2014/03/10'
def euler_rotmat(order='xyz', frame='local', angles=None, unit='deg',
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.