text stringlengths 2 999k |
|---|
#################
# credit https://github.com/ryanzhumich/editsql/blob/master/preprocess.py
import argparse
import os
import sys
import pickle
import json
import shutil
import sqlparse
from postprocess_eval import get_candidate_tables
def write_interaction(interaction_list,split,output_dir):
json_split = os.path.j... |
from __future__ import division
from builtins import object
from past.utils import old_div
from proteus.mprans import (SW2DCV, GN_SW2DCV)
from proteus.Domain import RectangularDomain, PlanarStraightLineGraphDomain
import numpy as np
from proteus import (Domain, Context,
MeshTools as mt)
from proteu... |
# -*- coding: utf-8 -*-
"""Manages multiple objects under different contexts."""
from collections import Counter as ValueCounter
from contextlib import contextmanager
from copy import deepcopy
from enum import Enum, unique
from inspect import getmro
from threading import RLock
from traceback import format_exception
fr... |
#!/usr/bin/env python3
# ##### BEGIN GPL LICENSE BLOCK #####
#
# 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 the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# ... |
# Copyright 2008-2015 Nokia Networks
# Copyright 2016- Robot Framework Foundation
#
# 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
... |
#
# -*- coding: utf-8 -*-
#
# Copyright (c) 2018 Intel Corporation
#
# 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 app... |
#!/usr/bin/python
# -*- coding: latin-1 -*-
from tinydb import TinyDB, Query
from random import randint
import subprocess,os
import sched, time
import pyaudio
import wave
import random
import datetime
os.chdir(os.path.dirname(__file__))
def playsound():
"""Plays notification sound"""
chunk = 1024
wf = wave.... |
# qubit number=3
# total number=51
import numpy as np
from qiskit import QuantumCircuit, execute, Aer, QuantumRegister, ClassicalRegister, transpile, BasicAer, IBMQ
from qiskit.visualization import plot_histogram
from typing import *
from pprint import pprint
from math import log2
from collections import Counter
from... |
# Univeral Tool Template v011.0
tpl_ver = 11.16
tpl_date = 191025
print("tpl_ver: {0}-{1}".format(tpl_ver, tpl_date))
# by ying - https://github.com/shiningdesign/universal_tool_template.py
import importlib
import sys
# ---- hostMode ----
hostMode = ''
hostModeList = [
['maya', {'mui':'maya.OpenMayaUI',... |
from .base_options import BaseOptions
import socket
class TestOptions(BaseOptions):
def initialize(self, parser):
def_results_dir = './results/'
parser = BaseOptions.initialize(self, parser)
parser.add_argument('--ntest', type=int, default=float("inf"), help='# of test examples.')
parser.add_argument('--re... |
"""Base box coder.
Box coders convert between coordinate frames, namely image-centric
(with (0,0) on the top left of image) and anchor-centric (with (0,0) being
defined by a specific anchor).
Users of a BoxCoder can call two methods:
encode: which encodes a box with respect to a given anchor
(or rather, a tensor ... |
'''
Data pre-processing
'''
import numpy as np
import matplotlib.pyplot as plt
from sklearn.decomposition import PCA
def concat2D(data):
'''
Concatenate all spectra opened with agilentFPA_multiple or agilentFPA where
mode = 'mosaic'. Useful for processing.
Create a label for each spectrum. Useful for... |
from itertools import chain
from django.contrib.auth.models import AbstractUser
from django.contrib.postgres.fields import JSONField
from django.db import models
from django.urls import reverse
from django.utils import timezone
from django.utils.functional import cached_property
from django.utils.translation import uge... |
#!/usr/bin/env python3
"""Combine logs from multiple pyeongtaekcoin nodes as well as the test_framework log.
This streams the combined log output to stdout. Use combine_logs.py > outputfile
to write to an outputfile."""
import argparse
from collections import defaultdict, namedtuple
import heapq
import itertools
impo... |
import argparse
import utils
def main(args):
path = args.path
assert path.endswith(".doc.tokens")
# Gold EDUs
edus = utils.read_lines(path.replace(".doc.tokens", ".edus.tokens"), process=lambda line: line.split()) # List[List[str]]
# Paragraphs
lines = utils.read_lines(path, process=lambda l... |
from typing import List
import json
from time import sleep
from datetime import date
from os import path
from api import BilibiliApi
from writer import write_md, write_raw_data
BASE_PATH = './archive'
NAP_TIME = .5
def generate_md(raw_data: BilibiliApi.RAW_DATA_T) -> str:
res = []
for video in raw_data:
... |
from __future__ import annotations
from itertools import chain
import typing as t
from .exceptions import CannotResolve, CircularDependency, PartiallyResolved
from .helpers import EMPTY, _LookupStack, _Stack
from .types import DependencyInfo, T
from .resolvers import Resolver
class SimpleRepository:
def __init... |
from ipaddress import ip_address, IPv4Network, IPv6Network
from typing import Iterable, Union, Any
from sector.server.outbound_message import NodeType
def is_in_network(peer_host: str, networks: Iterable[Union[IPv4Network, IPv6Network]]) -> bool:
try:
peer_host_ip = ip_address(peer_host)
return an... |
from django.contrib.auth.models import User
from django.urls import reverse
from rest_framework import status
from rest_framework.test import APITestCase
from django.contrib.auth import authenticate
class AuthenticationUserTestCase(APITestCase):
def setUp(self):
self.list_url = reverse('Company-list')
... |
#!/usr/bin/env python
# Copyright (c) 2013 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.
'''Unit tests for include.IncludeNode'''
import os
import sys
if __name__ == '__main__':
sys.path.append(os.path.join(os.path.di... |
from django.contrib import admin
# Register your models here.
from . import models
class ItemListAdmin(admin.ModelAdmin):
list_display = ("title", "content")
admin.site.register(models.ItemList, ItemListAdmin)
|
#!/usr/bin/python3
from sentiment import get_sentiment
from pprint import pprint
#--- run
def run():
text = 'not bad'
sentiment = get_sentiment(text)
pprint(sentiment)
#---
run()
|
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: openconfig_service.proto
import sys
_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1'))
from google.protobuf.internal import enum_type_wrapper
from google.protobuf import descriptor as _descriptor
from google.protobuf import me... |
# -*- coding: UTF-8 -*-
import collections
import functools
import logging
import time
import grpc
from urllib.parse import urlparse
from . import __version__
from .types import Status, DataType, DeployMode
from .check import check_pass_param, is_legal_host, is_legal_port, is_legal_index_metric_type, \
is_legal_... |
#######################################################################
# Copyright (C) #
# 2016 Shangtong Zhang(zhangshangtong.cpp@gmail.com) #
# 2016 Kenta Shimada(hyperkentakun@gmail.com) #
# Permission given to modify the... |
# Generated by Django 3.1.7 on 2021-04-01 08:52
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('listing', '0001_initial'),
]
operations = [
migrations.RemoveField(
model_name='post',
name='listing_slug',
... |
# Copyright 2016 - 2022 Alexey Stepanov aka penguinolog
# Copyright 2016 Mirantis, 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/licens... |
import sys
import os
import librosa
import numpy as np
from multiprocessing import Pool
import pickle
from librosa.filters import mel as librosa_mel_fn
import torch
from torch import nn
from torch.nn import functional as F
from sklearn.preprocessing import StandardScaler
import warnings
warnings.filterwarnings('igno... |
from fastapi import APIRouter, BackgroundTasks
from app.core.celery_app import celery_app
from app.worker import download_files, identify_files
from app.db.models import Group
router = APIRouter()
@router.get('/')
async def read_root():
return {'Hello': 'World'}
@router.get('/items/{item_id}')
async def rea... |
from .docx2txt import get_output, process # noqa
from .docx_file import DocxFile # noqa
VERSION = '0.8'
|
'''
The following class is used for the Transfer Entropy Measurements.
There are three main functions, the rest are helpers.
The three functions to call are:
computeTEUsers
computeTEUserEvents
computeTERepos
Note computeTEUsersEvents requires TEUsers to have been ran. If computeTEUserEvents is called then it will... |
# -*- coding: utf-8 -*-
def build_geometry(self, sym=1, alpha=0, delta=0, is_simplified=False):
"""Build geometry of the LamSquirrelCage
Parameters
----------
self :
LamSquirrelCage Object
sym : int
Symmetry factor (1= full machine, 2= half of the machine...)
alpha : float
... |
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not... |
from .property_plotter import PropertyPlotter
|
import json
import os
import datalabs
from datalabs.tasks import Summarization
_CITATION = None
_DESCRIPTION = """
Arxiv dataset for summarization.
From paper: A Discourse-Aware Attention Model for Abstractive Summarization of Long Documents" by A. Cohan et al.
See: https://aclanthology.org/N18-2097.pdf
See: http... |
from pyramid.config import Configurator
from pyramid.threadlocal import get_current_registry
def main(global_config, **settings):
""" This function returns a Pyramid WSGI application.
"""
config = Configurator(settings=settings)
config.include('pyramid_chameleon')
config.add_static_view('static'... |
#!/usr/bin/env python
# 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 wr... |
"""DAG demonstrating the umbrella use case with dummy operators."""
import airflow.utils.dates
from airflow import DAG
from airflow.operators.dummy import DummyOperator
dag = DAG(
dag_id="01_umbrella",
description="Umbrella example with DummyOperators.",
start_date=airflow.utils.dates.days_ago(5),
sch... |
import boto3
from Slack_Lambda_Layer import *
bot_user_id = 'UECS2J05D'
def get_key_from_ddb(key):
ddb = boto3.client('dynamodb')
response = ddb.get_item(
TableName='alert-log',
Key={
'messageID': {
'S': key
}
}
)
if 'Item' in response:
... |
#! /usr/bin/env python3
import sys
sys.argv.append( '-b' ) # batch mode
import os
import ROOT
import yaml
import math
from ROOT import gROOT
# gROOT.LoadMacro("asdf.cxx")
from ROOT import TProfile2D,TProfile
import array
# Sum up the bins of the y-axis, return array of (val,err)
def SumUpProfile(Pf2,CentBin):
val... |
# Copyright 2010-2019 Amazon.com, Inc. or its 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. A copy of
# the License is located at
#
# http://aws.amazon.com/apache2.0/
#
# or in the "license"... |
import logging
import os
import socket
import threading
import time
import dateutil.parser
import schedule
from watchdog.events import EVENT_TYPE_CREATED
from watchdog.events import FileSystemEvent
from lib.media_file_processing import MediaProcessingThread
from lib.media_file_state import MediaFileState
from lib.nod... |
#!/usr/bin/env python2
import sys
from jsonschema import Draft4Validator, validate
import json
def include_fileref(parent, mykey, dic):
for key in dic.keys():
if key == '$ref':
fpath = '../' + dic[key][5:]
schemafile = open(fpath, 'r')
schemastr = schemafile.read()
... |
#!/usr/bin/env python
###############################################################################
# $Id$
#
# Project: GDAL/OGR Test Suite
# Purpose: Test OGR INDEX support.
# Author: Frank Warmerdam <warmerdam@pobox.com>
#
###############################################################################
# Copyri... |
'''
This module contains standard and udf functions to calculate comparisons between
households for use in household matching.
'''
import itertools
import re
from pyspark.sql.types import FloatType, IntegerType, StringType
from pyspark.sql.functions import udf
import numpy as np
from nltk.metrics import edit_distance
... |
import os
from collections import defaultdict
from enum import Enum
from typing import Dict, Generator, List, Tuple
def solution1(data: List[int]) -> int:
computer = intcode_computer(data, None)
next(computer)
screen = {}
while True:
try:
col = next(computer)
row = nex... |
#!/usr/bin/env python3
import unittest
import gen_db
class TestGenDb(unittest.TestCase):
def test_linkify(self) -> None:
# Checks that text wrapped in <B> is not linked (it tends to be Mod. E.
# or Latin), that the longest abbreviations are linked, and that
# normalization works as expe... |
"""
WSGI config for CastleApartment project.
It exposes the WSGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/2.2/howto/deployment/wsgi/
"""
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault('DJAN... |
# ----------------------------------------------------------------------------
# Copyright (c) 2016--, gneiss development team.
#
# Distributed under the terms of the Modified BSD License.
#
# The full license is in the file COPYING.txt, distributed with this software.
# ------------------------------------------------... |
# Standard library imports
from typing import Iterator, List
# Third-party imports
import numpy as np
# First-party imports
from gluonts.core.component import validated
from gluonts.transform import DataEntry, FlatMapTransformation, shift_timestamp
class ForkingSequenceSplitter(FlatMapTransformation):
"""Forkin... |
import numpy as np
import pandas as pd
import sparse
import lightgbm
import scipy.sparse
import pytest
import dask.array as da
from dask.array.utils import assert_eq
import dask.dataframe as dd
from dask.distributed import Client
from sklearn.datasets import make_blobs
from distributed.utils_test import gen_cluster, l... |
from sieve import *
# runtime of sumPrimesBelow(2000000, 5000) is 217.033s
# sum all primes below a number N
def sumPrimesBelow(N, windowSize):
# list of primes from sieve of eratosthenes
primes = []
# keep track of max prime
maxPrime = 0
# starting windowEnd
windowEnd = windowSize
# whi... |
#!/usr/bin/env python
import rospy
from apriltag_ros.msg import AprilTagDetection, AprilTagDetectionArray
from gazebo_msgs.srv import GetModelState
from geometry_msgs.msg import Point, Point32, Pose, PoseStamped, Quaternion, TransformStamped, Twist
from nav_msgs.msg import Odometry
import math
from math import *
# Mos... |
# Copyright 2016 gRPC 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
#
# Unless required by applicable law or agreed to in writing... |
#!/usr/bin/env python
import os
import re
from setuptools import setup, find_packages
with open(os.path.join(os.path.dirname(__file__), 'README.rst')) as f:
long_description = f.read()
def get_version(package):
"""
Return package version as listed in `__version__` in `__init__.py`.
"""
path = os... |
from .models import ServiceAccount
from .utils import token_from_request
class ServiceAccountTokenBackend:
def authenticate(self, request, service_token=None):
if request and not service_token:
service_token = token_from_request(request)
try:
return ServiceAccount.objects.g... |
# AUTOGENERATED! DO NOT EDIT! File to edit: nbs/00_demo_model.ipynb (unless otherwise specified).
__all__ = ['load_if_present', 'dump_if_path', 'get_scaler', 'generate_data', 'split_data', 'train_model', 'predict',
'data_root']
# Cell
from ..imports import *
# Cell
data_root = Path('stack/data')
def loa... |
import nltk
#nltk.download('punkt')
from nltk.stem.lancaster import LancasterStemmer
stemmer = LancasterStemmer()
import numpy
import tensorflow
import random
import tflearn
import json
import pickle
import speech_recognition as sr
## Fetch the training data
with open("intents.json") as file:
data =... |
#!/usr/bin/env python3
# SPDX-license-identifier: Apache-2.0
# Copyright © 2021 Intel Corporation
"""Script for running a single project test.
This script is meant for Meson developers who want to run a single project
test, with all of the rules from the test.json file loaded.
"""
import argparse
import pathlib
impo... |
# coding=utf-8
# *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union, overload
from .. import... |
#!/usr/bin/env python
# Copyright (c) 2012 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.
"""
This script runs every build as the first hook (See DEPS). If it detects that
the build should be clobbered, it will delete the... |
from django.contrib import admin
from . import models
@admin.register(models.Currency)
class CurrencyAdmin(admin.ModelAdmin):
list_display = ['code', 'name']
@admin.register(models.Rate)
class RateAdmin(admin.ModelAdmin):
list_display = ['currency', 'date', 'value']
date_hierarchy = 'date'
def get_... |
from __future__ import with_statement
from os import environ, chdir, path as p
try:
import json
assert json
except ImportError:
import simplejson as json
from rdflib import ConjunctiveGraph, Graph, Literal, URIRef
from rdflib.compare import isomorphic
from six import PY3
import rdflib_jsonld.parser
from rdf... |
"""
Copyright (C) 2018 Patrick Schwab, ETH Zurich
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... |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('my_charts', '0002_auto_20140922_0520'),
]
operations = [
migrations.AddField(
model_name='nutritionparameters',
... |
'''
Code to accompany
"Unsupervised Discovery of Multimodal Links in Multi-Sentence/Multi-Image Documents."
https://github.com/jmhessel/multi-retrieval
This is a work-in-progress TF2.0 port.
'''
import argparse
import collections
import json
import tensorflow as tf
import numpy as np
import os
import sys
import tqdm
i... |
# CUDA_VISIBLE_DEVICES=1 python lfw_eval.py --lfw lfw.zip --epoch_num 2
from __future__ import print_function
import torch
import torch.nn as nn
import torch.optim as optim
import torch.nn.functional as F
from torch.autograd import Variable
torch.backends.cudnn.bencmark = True
import os,sys,cv2,random,datetime
import... |
import os
import unittest
import mock
from sia_load_tester import jobs
from sia_load_tester import sia_client as sc
from sia_load_tester import upload_queue
class GenerateUploadQueueTest(unittest.TestCase):
def setUp(self):
self.mock_sia_api_impl = mock.Mock()
self.mock_sia_client = sc.SiaClien... |
from providers.spotify.spotify_id import SpotifyId
from providers.entities.playlist import Playlist
from typing import List
from providers.entities.song import Song
from providers.spotify.spotify_playlist_provider import SpotifyPlaylistProvider
def test_search():
spotify_playlist_provider: SpotifyPlaylistProvider... |
import matplotlib.pyplot as plt
from envs.gridworld import AGENT_SIZES, RGB_COLORS
import numpy as np
import os
from envs.key_door import *
from envs.gridworld import *
from utils.gen_utils import *
from model import get_discrete_representation
from torchvision.utils import save_image
def visualize_representations(en... |
from django.contrib.auth import get_user_model
from django.test import TestCase
from posts.models import Post, Group
User = get_user_model()
class PostModelTest(TestCase):
@classmethod
def setUpClass(cls):
super().setUpClass()
cls.user = User.objects.create_user(username='test_user')
... |
# -*- coding: utf-8 -*-
# tacibot core
# Handles all important main features of any bot.
'''Core File'''
import discord
import os
from discord.ext import commands
import time
import asyncio
import sys
import cpuinfo
import math
import psutil
from extensions.models.help import TaciHelpCommand
class Core(commands.Co... |
import numpy as np
import pandas as pd
import cv2
class target_reader:
'''
Reads in an image of a used archery target and uses openCV to determine
position and score value for each shot. __init__ initializes session
settings and run performs analysis.
'''
# Class-wide settings
# Real-worl... |
from setuptools import setup
import os
base_dir = os.path.abspath(os.path.dirname(__file__))
with open(os.path.join(base_dir, 'README.md'), encoding='utf-8') as f:
long_description = f.read()
about = {}
with open(os.path.join(base_dir, 'pyats_genie_command_parse', 'version.py'), 'r', encoding='utf-8') as f:
e... |
import os
# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
# Quick-start development settings - unsuitable for production
# See https://docs.djangoproject.com/en/1.11/howto/deployment/checklist/
# SECURITY WARNING: keep t... |
#!/usr/bin/env python3
# Copyright 2014 the V8 project authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""
Performance runner for d8.
Call e.g. with tools/run-perf.py --arch ia32 some_suite.json
The suite json format is expected to b... |
from django import forms
from msbdev.models import ContactForm
class ContactFormForm(forms.ModelForm):
class Meta:
model = ContactForm
fields = ['email', 'note']
widgets = {
'email': forms.EmailInput(attrs={'class': 'form-control form-control-sm',
... |
# Copyright 2021 Katteli Inc.
# TestFlows.com Open-Source Software Testing Framework (http://testflows.com)
#
# 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/lice... |
#!/usr/local/bin/python3
import csv
from optparse import OptionParser
def ifnull(val,ischar=False):
if val == "\\N":
return "NULL"
else:
if ischar:
return "'" + val + "'"
else:
return val
parser = OptionParser()
parser.add_option("-O", "--orders", dest="ordersn... |
#
# Copyright 2018-2021 Elyra 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
#
# Unless required by applicable law or agreed to in writ... |
# -*- coding: utf-8 -*-
# see LICENSE.rst
"""Test Unit Module."""
__all__ = [
# core and decorators
"test_core",
"test_decorators",
# added units
"test_amuse",
"test_composite",
"test_full_amuse",
]
##############################################################################
# IMPORTS... |
# Copyright 2021 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... |
import json
import os
import logging
import great_expectations as ge
from datetime import datetime
import tzlocal
from IPython.core.display import display, HTML
def set_data_source(context, data_source_type=None):
data_source_name = None
if not data_source_type:
configured_datasources = [datasource f... |
"""
Defines the preset values in the mimic api.
"""
from __future__ import absolute_import, division, unicode_literals
get_presets = {"loadbalancers": {"lb_building": "On create load balancer, keeps the load balancer in "
"building state for given seconds",
... |
# DO NOT EDIT! This file is automatically generated
import typing
from commercetools.helpers import RemoveEmptyValuesMixin
from commercetools.platform.models.tax_category import (
TaxCategory,
TaxCategoryDraft,
TaxCategoryPagedQueryResponse,
TaxCategoryUpdate,
TaxCategoryUpdateAction,
)
from commer... |
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... |
"""
This module automatically converts sorted vardict output to standard .vcf format.
Author: Nick Veltmaat
Date: 19-11-2021
"""
import pandas as pd
import glob
import sys
if len(sys.argv) != 3:
print("Usage:\t" + sys.argv[0] + "\t<input_sorted_vardict_file_path>\t<output_path_filename>")
exit(0)
file = glob.gl... |
import director_abstract
def is_new_style_class(cls):
return hasattr(cls, "__class__")
class MyFoo(director_abstract.Foo):
def __init__(self):
director_abstract.Foo.__init__(self)
def ping(self):
return "MyFoo::ping()"
a = MyFoo()
if a.ping() != "MyFoo::ping()":
raise RuntimeErr... |
"""Support for Vallox ventilation units."""
import ipaddress
import logging
from vallox_websocket_api import PROFILE as VALLOX_PROFILE, Vallox
from vallox_websocket_api.constants import vlxDevConstants
from vallox_websocket_api.exceptions import ValloxApiException
import voluptuous as vol
from homeassistant.const im... |
'''
Created on Jul 12, 2020
@author: willg
'''
import Room
import UserDataProcessing
from discord.utils import escape_markdown, escape_mentions
from collections import defaultdict
from typing import List
import TableBot
DEBUGGING = False
scoreMatrix = [
[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
[15, 7, 0, 0, 0, ... |
#!/usr/bin/env python
#-*- coding: utf-8 -*-
#
#
# python-twoauth [oauth.py]
# - Hirotaka Kawata <info@techno-st.net>
# - http://www.techno-st.net/wiki/python-twoauth
#
#
# Copyright (c) 2009-2010 Hirotaka Kawata
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and as... |
# Generated by Django 2.1.3 on 2019-04-26 15:44
import datetime
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('models', '0027_auto_20190425_1032'),
]
operations = [
migrations.AlterField(
model_name='client',
na... |
class ModelWrapper:
""" Helper class to wrap json with Model Classes """
def __init__(self, modelCls, connection):
""" Intialize with the Model Class and Connection """
self.modelCls = modelCls
self.connection = connection
def __call__(self, json):
""... |
from decimal import Decimal
from typing import List, Dict
import pandas as pd
from hummingbot.connector.exchange_base import ExchangeBase
from hummingbot.connector.in_flight_order_base import InFlightOrderBase
from hummingbot.core.data_type.cancellation_result import CancellationResult
from hummingbot.core.data_type.... |
#!/usr/bin/env python
# coding: utf-8
# In[1]:
import sys
from IPython.display import set_matplotlib_formats
from pandas.plotting import register_matplotlib_converters
register_matplotlib_converters()
import matplotlib
import math
import numpy as np
import scipy as sp
import seaborn as sns
import scipy.signal as sp... |
"""Common functions and constants."""
from SPARQLWrapper import SPARQLWrapper, JSON
LKIF_OUTPUT_FILE = 'data/lkif_hierarchy.json'
YAGO_OUTPUT_FILE = 'data/yago_hierarchy.json'
OUTPUT_FILE = 'data/ontology.json'
LKIF_TO_YAGO_MAPPING = {
'Hohfeldian_Power': ['wordnet_legal_power_105198427'],
'Potestative_Rig... |
from copy import deepcopy
import numpy as np
import torch
import torch.nn as nn
from pybnn.bohamiann import Bohamiann
from pybnn.util.layers import AppendLayer
def vapor_pressure(x, a, b, c, *args):
b_ = (b + 1) / 2 / 10
a_ = (a + 1) / 2
c_ = (c + 1) / 2 / 10
return torch.exp(-a_ - b_ / (x + 1e-5) -... |
#!/usr/bin/env python
import numpy as np
#from matplotlib import pyplot as plt
from numpy.random import *
def main():
M = 1.00
M1 = 0.00
e = 0.00
e1 = 0.00
e2 = 0.00
Kp = 0.10
Ki = 0.10
Kd = 0.10
t = 100
goal = 50.00
x_list = []
y_list = []
x_list.appen... |
import re
from streamlink.compat import urljoin
from streamlink.plugin import Plugin
from streamlink.plugin.api import http, validate
from streamlink.stream import HLSStream
COOKIE_PARAMS = (
"devicetype=desktop&"
"preferred-player-odm=hlslink&"
"preferred-player-live=hlslink"
)
_id_re = re.compile(r"/(?... |
# coding=utf-8
import argparse
import sys
import sdl2.ext
from conf import *
from textbuffer import TextBuffer
from textarea import TextArea
from statusbar import StatusBar
from state import Editor, EditState
def res(s):
try:
return map(int, s.split(','))
except:
raise argparse.ArgumentTypeE... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.