text stringlengths 3.07k 12.6k |
|---|
#/usr/bin/python3
import requests, fileinput, psutil, os, json, time
PRESEARCH_NODE_KEY = ''
TELEGRAM_BOT_TOKEN = ''
ALERT_DELAY = 3 #How long in minutes a node is offline before alert is sent
CHECK_INTERVAL = 60 #How long in seconds to wait between node checks
# Don't worry about this, we'll fill it in for you
TEL... |
"""
This module downloads OECD surveys through automated series of clicks using Selenium.
"""
import os
import time
import pandas as pd
from typing import List, Set
from pathlib import Path
from loguru import logger
from pprint import pprint
from selenium import webdriver
from selenium.webdriver.firefox.options import... |
#import matplotlib.image as mpimg
#import matplotlib.pyplot as plt
import numpy as np
import cv2
import glob
import tensorflow as tf
import keras
from keras.utils import to_categorical
from keras.models import load_model
from keras.models import Sequential
from keras.layers import Dense, Conv2D, Flatten, MaxPooling2D
f... |
""" show_udld.py
IOSXE parsers for the following show command:
* 'show udld interface {interface}'
* 'show udld neighbor'
"""
import re
from genie.metaparser import MetaParser
from genie.metaparser.util.schemaengine import Any, Optional,Or
# import parser utils
from genie.libs.parser.utils.common import ... |
import numpy as np
import quaternion
from lazy import lazy
from scipy.integrate import cumtrapz
from biokinepy.cs import ht_r, ht_inv, change_cs
from biokinepy.vec_ops import extended_dot
from biokinepy.vel_acc import ang_vel
from biokinepy.mean_smoother import smooth_pos_traj, smooth_quat_traj
import biokinepy.euler_a... |
# ------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License (MIT). See LICENSE in the repo root for license information.
# -------------------------------------------------------------------... |
#!/usr/bin/env python
from auvlib.data_tools import std_data
from auvlib.bathy_maps import mesh_map, map_draper
import numpy as np
import matplotlib.pyplot as plt
from math import sqrt, cos, sin, acos, asin, pi, tan
from multiprocessing import Pool, Manager
import time
def cal_task(hit,intensity,rpy,vechile_pos,norm... |
from __future__ import division
from builtins import object
from past.utils import old_div
import time
import gevent
import gipc
import random
from devp2p.service import BaseService
from ethereum.pow.ethpow import mine, TT64M1
from ethereum.slogging import get_logger
from ethereum.utils import encode_hex
log = get_logg... |
# -*- coding: utf-8 -*-
"""Unit test for ThreadList class."""
from collections import deque, OrderedDict
from StringIO import StringIO
from nose.tools import assert_equal, raises
from threadedmessenger.message import Message
from threadedmessenger.threadlist import ThreadList
@raises(TypeError)
def test_threadlist_k_... |
#!/usr/bin/python2.5
#
# Copyright 2008 Google 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 law or ... |
import tensorflow as tf
from tensorflow.python.keras.layers import wrappers
from tensorflow.python.keras.engine import sequential
from tensorflow.python.keras.engine import functional
from tensorflow.python.util import nest
from collections import defaultdict
import pydot
def is_input_layer(layer):
"""Checks if l... |
#!/usr/bin/env python
"""Back-up mechanisms for the data directory.
Author: <NAME> <pontus is s u-tokyo ac jp>
Version: 2011-02-22
"""
# XXX: We can potentially miss a change within the same second as the back-up,
# we need to share a mutex with the rest of the system somehow
# XXX: Does not check ... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import torch
import torch.nn as nn
import torch.nn.functional as F
import numpy as np
import random
import time
##################### hyper parameters ####################
MAX_EPISODES = 200
MAX_EP_STEPS = 200
LR_A = 0.001 # learning rate for actor
LR_C = 0.002 #... |
from ..standardization.standardizer import standardize
from . import comparator
from . import networking
from .amgScore import fidComparator
import pandas as pd
"""
read a .txt file and turn it into a dataframe
"""
def convertInputFileToFrame(file_path):
input_file = open(file_path, 'r')
lines = inp... |
#!/usr/bin/env python
'''
The MIT License (MIT)
Copyright (c) <2018> <<NAME>>
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, ... |
from collections import namedtuple
import re
SpeechAct = namedtuple('SpeechAct', ['name', 'abrv'])
class SpeechActs(object):
QUESTION = SpeechAct('question', '?')
PRICE = SpeechAct('price', 'P')
STATEMENT = SpeechAct('statement', 'S')
REPEAT_PRICE = SpeechAct('repeat_price', 'P2')
REFERENCE = Spee... |
import numpy as np # linear algebra
import pandas as pd # data processing, CSV file I/O (e.g. pd.read_csv)
import os
import ast
from sklearn.feature_extraction.text import TfidfVectorizer
from sklearn.metrics.pairwise import linear_kernel
from sklearn.metrics import pairwise_distances
from sklearn.feature_extraction.te... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Sat Dec 26 17:12:49 2020
@author: niccolodiana
"""
import numpy as np
import matplotlib.pyplot as plt
import pandas as pd
from scipy.stats import norm
from scipy.stats import mode
from scipy.stats import multivariate_normal
np.random.seed(1920)
import time... |
"""
Milestone 3 Code (P7 & P8) - Interactive User Interface
Team 64: Py Eaters
Team Leader: <NAME>
Team Members: <NAME>
<NAME>
<NAME>
Authors: <NAME> and <NAME>
Submitted on 02/04/2020
"""
# Libraries
from Cimpl import (copy, create_color, set_color, Im... |
import numpy as np
from layers import Linear, ReLU, SoftmaxCrossEntropyLoss
from network import Network
def main():
'''
Trains two networks on the MNIST dataset.
Both have two hidden ReLU layers with 256 and 128 units
The fist one has a mean batch normalization layer before every layer
'''
np... |
#!/usr/bin/env python
# Copyright (c) 2017, the R8 project authors. Please see the AUTHORS file
# for details. All rights reserved. Use of this source code is governed by a
# BSD-style license that can be found in the LICENSE file.
# Compare multiple CTS test_result.xml files
from __future__ import print_function
fro... |
import json
import hashlib
from datetime import datetime
import flask
import sqlalchemy.types as types
from sqlalchemy.ext.hybrid import hybrid_property
from flask_sqlalchemy import SQLAlchemy
import utils
from utils import get_serializer
db = SQLAlchemy()
class StrippedString(types.TypeDecorator):
"""A strin... |
from .conftest import HqEnv
def scontrol_return(job_id: str) -> str:
return f"""print(\"\"\"JobId={job_id} JobName=bash
UserId=sboehm00(33646) GroupId=interactive(25200) MCS_label=N/A
Priority=124370 Nice=0 Account=lig8_dev QOS=normal
JobState=RUNNING Reason=None Dependency=(null)
Requeue=0 Restarts=0... |
# -*- coding: utf-8 -*-
"""Copyright 2015 <NAME>.
FilterPy library.
http://github.com/rlabbe/filterpy
Documentation at:
https://filterpy.readthedocs.org
Supporting book at:
https://github.com/rlabbe/Kalman-and-Bayesian-Filters-in-Python
This is licensed under an MIT license. See the readme.MD file
for more informat... |
"""
====================================================
Imputing missing values before building an estimator
====================================================
Missing values can be replaced by the mean, the median or the most frequent
value using the basic :class:`sklearn.impute.SimpleImputer`.
The median is a mor... |
# coding=utf-8
# Copyright 2021 The Google Research 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 applicab... |
from django.shortcuts import render
from django.urls import reverse
from django.shortcuts import redirect
from django.contrib.auth.decorators import login_required
from django.http import HttpResponse, JsonResponse
from .models import StockPrice, StockBasic, StockChips
from datetime import datetime, timedelta
import p... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Funciones auxiliares"""
import os
import shutil
from openpyxl import load_workbook
import zipfile
import datetime
import time
from urllib import parse as urlparse
import yaml
import logging
import logging.config
import yaml
from download_utils import download, download... |
from socialfeedharvester.fetchables.utilities import HttpLibMixin
import requests
import logging
import re
from bs4 import BeautifulSoup
import cssutils
import urlparse
import httplib as http_client
from socialfeedharvester.fetchables.resource_type import ImageType, DocumentType, WebPageType, AnyResourceType, \
Web... |
"""
Copyright (c) 2018 Robert Bosch GmbH
All rights reserved.
This source code is licensed under the MIT license found in the
LICENSE file in the root directory of this source tree.
@author: <NAME>, <NAME>, <NAME>, <NAME>
"""
import sys
import matplotlib
import matplotlib.pylab as plt
import numpy as np
import pandas... |
import io
import time
import sys
import base64
import logging
import grpc
import concurrent.futures as futures
from aiohttp import web
from jsonrpcserver.aio import methods
from jsonrpcserver.exceptions import InvalidParams
from skimage import io as ioimg
import dlib
import services.common
import services.grpc.face... |
import random
import pandas as pd
import pytest
from ..wrangling import *
######################
# BROADCASTING
######################
@pytest.fixture()
def right_df():
return pd.DataFrame(
{
'col1': [100, 200, 50],
'col2': [1, 2, 3]
},
index=pd.Index(['g', 'b', ... |
from flask import current_app
import numpy as np
import json
import re
import pandas as pd
from .utils import hash_data
class Serializer(object):
def __init__(self, schema, add_all):
""" Serialize and annotate results using a schema.
Args:
schema - json schema file
add_all ... |
from django.http import HttpResponseRedirect
from django.urls import reverse
from django.utils import timezone
from django.views.generic import (CreateView, DetailView, ListView,
TemplateView, UpdateView)
import datetime as dt
import json
from . import models, forms
from .nvd3 import ... |
# -*- coding: utf-8 -*-
# Copyright (c) 2020, GreyCube Technologies and contributors
# For license information, please see license.txt
from __future__ import unicode_literals
import frappe
from frappe.utils import getdate, get_first_day, get_last_day, add_days
from erpnext.accounts.doctype.accounting_dimension.account... |
import matplotlib
matplotlib.use('Agg')
import matplotlib.pyplot as plt
import os
import pandas as pd
import pdb
from parse_cluster_info_sc import main as pinf
import numpy as np
def parse_summary(fp, lag_thresh=4, fill_na=False, median_thresh=2):
df = pd.read_csv(fp, sep='\t')
aupr_cols = [col for col in df.c... |
import numpy as np
import os
import sys
from itertools import tee
from torch.utils.data import Dataset
from text.vocabulary import Vocabulary
class MemMappedCorpus(Dataset):
"""
A memory mapped Dataset:
- this never loads the entire data to memory
- and still allows for random memory access
"""... |
from typing import Optional, List
from pycdo.model.cdo import CDOContext
from pydantic import Field, BaseModel
from datetime import datetime
from enum import Enum
class OnboardingMethod(Enum):
serial = "Serial Number"
token = "token"
# TODO Does this need to be ASA specific or generic device?
class ASAInter... |
import os
import sys
from datetime import datetime
import zipfile
from pymongo import MongoClient # sudo pip3 install pymongo
import pytz # sudo pip3 install pytz
# 将棋クエストの古い棋譜を退避する
# 使用例 : python3 clean.py /home/loftkun/dev/nginx/html/quest/
# 新しい棋譜の閾値[sec] : 半年以内
NEW=float(60 * 60 * 24 * 365 * 0.5)
# 古い棋譜の閾値[sec] ... |
#
# main.py
#
# created at 07/06/2021 14:45:47
# written by llamaking136
#
# MIT License
#
# Copyright (c) 2021 llamaking136
#
# 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 wi... |
# pylint: disable=invalid-name,missing-docstring,exec-used,too-many-arguments,too-few-public-methods,no-self-use,too-many-locals,line-too-long,redefined-builtin,redefined-outer-name,bare-except
from __future__ import print_function
from math import sqrt
import numpy as np
import scipy.misc
from cbir.DB import Datab... |
"""Classes and functions related to DPA pipeline products."""
# -----------------------------------------------------------------------------
# Imports:
# -----------------------------------------------------------------------------
from dateutil import parser as date_parser
import re
from dpa.location import Loca... |
import sys
import logging
from datetime import datetime, date
from trello import TrelloApi
import requests
logger = logging.getLogger(__name__)
class JiraLikeIssue(object):
def __init__(self, key, url, fields, history):
self.key = key
self.url = url
self.id = key
self.fields = fi... |
#!/usr/bin/env python
# coding:utf-8
import sys
import os
import io
import zipfile
import requests
import re
REPO_URL = 'https://github.com/nekocode/create-android-kotlin-app'
ORIGINAL_PACKAGE_NAME = 'cn.nekocode.caka'
ZIP_UNIX_SYSTEM = 3
class ProjectCreator:
def __init__(self, archive_data: bytes, project_na... |
# -*- coding: utf-8 -*-
import collections
from nltk.tokenize import word_tokenize, sent_tokenize
from zeyrek import tr
from zeyrek.formatters import UDFormatter, DefaultFormatter
from zeyrek.lexicon import RootLexicon
from zeyrek.morphotactics import TurkishMorphotactics
from zeyrek.rulebasedanalyzer import RuleBased... |
"""
Pipelines for testing
"""
import logging
from typing import Any, Dict, List, Optional, Tuple, Type, TypeVar
import numpy as np
from pydantic import Field
from eolearn.core import CreateEOPatchTask, EONode, EOWorkflow, MergeEOPatchesTask, OverwritePermission, SaveTask
from ..core.config import RawConfig, recursiv... |
import pandas as pd
import numpy as np
from pathlib import Path
import os
import seaborn as sns
import matplotlib.pyplot as plt
import matplotlib.image as mpimg
from matplotlib import rcParams
from sklearn.linear_model import LogisticRegression
import scipy.stats as spst
import sys
import re
import collections
from ro... |
from unittest import TestCase
import unittest
from python_back_end.data_cleaning.cleaning_pipeline import CleaningPipeline
from python_back_end.triangle_formatting.triangle_pipeline import TrianglePipeline
from python_back_end.utilities.state_handling import DataHolder
from python_back_end.utilities.call_encapsulators ... |
import requests
from include.config import user_url, word_url, check_url, rank_url
from include.WordConvert import doum_conveter
import json
from urllib import parse
from random import randint, choice
from typing import Union, Tuple
import sys
class Game:
"""
기반 클래스
"""
word_result = [] # 서로 대답한 단어
... |
"""Add tables for editing revisions
Revision ID: 4<PASSWORD>
Revises: <PASSWORD>
Create Date: 2019-11-08 17:13:48.096553
"""
import sqlalchemy as sa
from alembic import op
from indico.core.db.sqlalchemy import PyIntEnum, UTCDateTime
from indico.modules.events.editing.models.editable import EditableType
from indico.m... |
import pyspark
import sys
import itertools
import time
#Initialize Spark Context
sc = pyspark.SparkContext("local[*]", "Task1")
sc.setLogLevel("ERROR")
startTime = time.time()
# Program inputs
# filter = 100
# threshold = 45
# input_file = "data/HW2/user-business.csv"
# output_file = "data/HW2/task2_output.csv"
# tas... |
import enum
from functools import lru_cache
from typing import List
import dataclasses
import pathlib
import pandas as pd
import numpy as np
from covidactnow.datapublic.common_fields import CommonFields
from covidactnow.datapublic.common_fields import FieldName
from covidactnow.datapublic.common_fields import GetByVal... |
#!/usr/bin/env python
if __name__ == '__main__':
import os
import sys
from django import setup
sys.path.insert(0, os.path.abspath(os.getcwd()))
try:
setup()
except ModuleNotFoundError as e:
raise ModuleNotFoundError(
f"Your django project settings could not be impor... |
###################################################################################
# @file comms.py
###################################################################################
# _ _____ ____ ____ _____
# | |/ /_ _/ ___|| _ \| ____|
# | ' / | |\___ \| |_) | _|
# | . \ | |___ ) | __/| |___
# |_|\_\__... |
#!/usr/bin/python
# coding: utf-8
# https://github.com/libgdx/libgdx/wiki/Hiero
# https://github.com/libgdx/libgdx/wiki/Distance-field-fonts
import codecs
import re
import struct
from PIL import Image
def read_txt(path):
print("read file: %s" % path)
try:
f = codecs.open(path, "r", "cp9... |
"""
This is the application that's created by <NAME>(ADA BCS 2019)
This application is created by using Tkinter GUI.
If we talk about the program itself, it has 2 parts: first one is about implementing the DH key exchange
and the second part is about implementing AES with CBC Mode.
I added AES library by using t... |
"""Module light."""
__author__ = '<NAME> (japinol)'
from collections import Counter
import math
import random
import pygame as pg
from codemaster.utils.colors import Color
from codemaster.config.constants import BM_LIGHTS_FOLDER
from codemaster.utils import utils_graphics as libg_jp
from codemaster.models.actors.ac... |
#!/usr/bin/env python3
"""@@@
Main Module: visualize_heatmap.py
Classes: Plot
Functions:
Author: <NAME>
creation date: some time in 2016 (in Dariusz' lab)
last update: 190718
version: 0
Purpose:
Make a _visual_ 2D plot of text data from heatmap files. The format of
the input file s... |
# -*- coding: utf-8 -*-
"""
Created on Fri Jul 19 13:51:35 2019
@author: WT
"""
# -*- coding: utf-8 -*-
"""
Created on Fri Jul 19 13:51:35 2019
@author: WT
"""
import os
import pandas as pd
import numpy as np
import torch
from torch.utils.data import DataLoader
from .preprocessing_funcs import extract_feature, padded_... |
import scipy as sp
import string
from scipy import linalg as la
def uniq(listinput):
""" This finds the unique elements of the list listinput. """
""" This will be provided for the student. """
output = []
for x in listinput:
if x not in output:
output.append(x)
return output
def initialize(N,M):
A = sp.on... |
#!/usr/bin/python3
import log, project, net, led, audio
import argparse
import time
import socket
import inspect
import keyboard
import numpy
def demo(s : socket.socket):
log.info("Sending pixel packet 0...")
packet = led.Set_Pixel_Packet(0, led.color(255,0,255)).to_bytes()
s.send(packet)
log.info("Sle... |
import torch
import torch.nn as nn
import torch.nn.functional as F
from modeling.backbone import build_backbone
def gn(planes):
return nn.GroupNorm(16, planes)
def bn(planes):
return nn.BatchNorm2d(planes)
def syncbn(planes):
return nn.SyncBatchNorm(planes)
'''
Author: <NAME>
FPN for semantic se... |
import scrapy
import re
from collections import defaultdict
from parsers.parser_library import SoccerPunterLib
class Match(scrapy.Item):
Date = scrapy.Field()
HomeTeam = scrapy.Field()
AwayTeam = scrapy.Field()
FTHG = scrapy.Field()
FTAG = scrapy.Field()
HTHG = scrapy.Field()
HTAG = scrapy... |
import bpy
def duplicate_object(obj):
"""
:param obj: the object to be duplicated
:return: the new object or None
"""
try:
new_obj = obj.copy()
new_obj.data = obj.data.copy()
new_obj.animation_data_clear()
bpy.context.collection.objects.link(new_obj)
return ... |
#!/usr/bin/env python3
#
# Copyright 2019 The Bazel Authors. 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 ... |
# /usr/bin/env python
# -*- coding: utf-8 -*-
"""
描述: PyTorch 实现 k-近邻(kNN) 算法。
Author: Chenyyx
Date: 2019-12-18
"""
# 导入必要的库
import time
import matplotlib.pyplot as plt
import torch as t
import numpy as np
from collections import Counter
# 手动设置种子
t.manual_seed(2019)
# ====== 2.1 - Python 版本 knn 算法的实现... |
import os
import json
IGNORE_LIST = []
packages = [
'approximation_schemes',
'components',
'core',
'drivers',
'error_checking',
'jacobians',
'matrices',
'proc_allocators',
'recorders',
'solvers.linear',
'solvers.linesearch',
'solvers.nonlinear',
'surrogate_models',
... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# -------------------------------------------------------------------
# Copyright (c) 2010-2020 <NAME>
# This file is part of the extensive automation project
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser Ge... |
import shutil
import os
import fnmatch
from . import io
from . import cfg
from . import parser
def _candidateSortKey(rules):
def key(c, rules=rules):
pathNo, path = c[:2]
res = ''
for r in rules:
if 'path-order' in r:
res += f'_{pathNo:04d}'
elif 'newest' in r:
res += f'_{2*... |
# Copyright (c) 2014, Salesforce.com, Inc. All rights reserved.
# Copyright (c) 2015, Google, Inc.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# - Redistributions of source code must retain the above copyright
... |
import torch
import numpy as np
from torch.autograd import Variable
import sys
sys.path.append('..')
from functions.kr_cuda import KernelRegression
import random
import torch._utils
import cv2
from utils import log_to_depth, depth_to_log
import time
def edge_mirror(x, h, w):
if isinstance(x, torch.FloatTensor) or ... |
import numpy as np
from scipy.ndimage import median_filter
from scipy.ndimage.filters import gaussian_laplace
def normalize(frame):
"""
Normalize input image to range 0,1 and cast to float.
"""
mx = float(np.amax(frame))
mn = float(np.amin(frame))
norm = (frame-mn)/(mx-mn)
return norm
def... |
from collections import deque
from operator import attrgetter
from random import choice
from graph import Graph
from graph.util import compose
from graph.disjointsets import DisjointSets
class Component:
def __init__(self, first, second, initialcost=0):
self.edges = {first : None, second : f... |
import os
import traceback
import hashlib
import random
import subprocess
import logging
from collections import namedtuple
# Setup logging
logger = logging.getLogger(__name__)
#======================
# Utility functions
#======================
def booleanize(*args, **kwargs):
# Handle both single value and kw... |
# Licensed under a 3-clause BSD style license - see LICENSE.rst
from __future__ import absolute_import, division, print_function, unicode_literals
import logging
from collections import OrderedDict
import numpy as np
from astropy.extern import six
from astropy.coordinates import Angle
from astropy.table import Table, C... |
import json
import logging
from twisted.internet import defer
from torba.baseaccount import BaseAccount
from torba.basetransaction import TXORef
from lbryschema.claim import ClaimDict
from lbryschema.signer import SECP256k1, get_signer
log = logging.getLogger(__name__)
def generate_certificate():
secp256k1_p... |
# -*- coding: utf-8 -*-
# @Time : 2019/8/23 21:53
# @Author : zhoujun
import math
import random
import pyclipper
import numpy as np
import cv2
from shapely.geometry import Polygon, Point
from data_loader.augment import DataAugment
data_aug = DataAugment()
def check_and_validate_polys(polys, xxx_todo_changeme):
... |
""" cqparts motors
2018 <NAME> <EMAIL>
stepper motor generic
"""
# TODO
# even 4 fasteners so it auto mounts to whatever it is parented to.
import cadquery as cq
import cqparts
from cqparts.params import PositiveFloat
from cqparts.constraint import Fixed, Coincident
from cqparts.constraint import Mate
from cqpart... |
#!/usr/bin/env python
import argparse
import datetime
import os
import sys
import matplotlib
matplotlib.use( "Agg" )
import matplotlib.pyplot as plt
import MySQLdb
import numpy as np
import pandas as pd
DATE_FORMAT = "%Y-%m-%d"
UNIX_EPOCH = datetime.datetime( 1970, 1, 1 )
ylabels = { "mpi4py-import" : "... |
from absl import logging
from bokeh.embed import components
from bokeh.plotting import figure
from bokeh.transform import dodge
from bokeh.models import ColumnDataSource
import functools
from itertools import zip_longest
import math
import os
import pandas as pd
from pathlib import Path
from typing import List, Tuple
... |
"""
Copyright (c) Contributors to the Open 3D Engine Project.
For complete copyright and license terms please see the LICENSE at the root of this distribution.
SPDX-License-Identifier: Apache-2.0 OR MIT
"""
class Tests:
initial_instance_count = (
"Initial instance count is as expected",
"Initial ... |
"""
Dataset classes for variable number of speakers
Author: <NAME>
"""
import numpy as np
import torch
import torch.utils.data as data
import soundfile as sf
from time import time
import glob
import os
import random
import json
from tqdm import tqdm
def load_json(filename):
with open(filename) as f:
data ... |
from ctypes import *
import os.path
import time
def count_gates(lib, circ):
lib.x_count.argtypes =[c_void_p]
lib.x_count.restype =c_int
lib.h_count.argtypes =[c_void_p]
lib.h_count.restype =c_int
lib.cnot_count.argtypes =[c_void_p]
lib.cnot_count.restype =c_int
... |
from bolinette.testing.fixture import client
from bolinette.testing import Mock, bolitest, Mocked, BolitestClient
def assert_tags_equal(t1s, t2s):
if not isinstance(t1s, list):
t1s = [t1s]
if not isinstance(t2s, list):
t2s = [t2s]
assert len(t1s) == len(t2s)
t1_n = {t['name']: (t['chil... |
from qiskit import *
def get_programs_for_test(server, challenge_input, program, permutation_key, sp_list, sp_mit_single_list, sp_mit_all_list, dp_list, meas_filter_singles, meas_filter_alls, rev_cnots, backend, num_shots):
"""
Prepares circuits for execution
Parameters:
server (Server): Server insta... |
# 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
# distrib... |
import VibModels
import VibManager
'''
CLASS: TemplateAuthentication
AUTHOR: <NAME>
CREATION: 04 Nov. 2020
L. UPDATE: 04 Jan. 2020 (Fulber-Garcia; Refactoring methods to
operate with the VibUserInstance; In-
cluded the "None" authenticator)
DESCRIPTION: This class is a template for the implemen... |
import os
import glob
import hashlib
import json
import shutil
import functools
import copy
from urllib.parse import urljoin
import yaml
from yapsy.IPlugin import IPlugin
from PIL import Image
from thumbnails import get_thumbnail
class MyPointPlugin(IPlugin):
def activate(self, settings):
self.settings =... |
import streamlit as st
import pandas as pd
import base64
from kohokoho import anon
import numpy as np
def upload():
raw_csv = st.file_uploader("Upload Dataset", type=["csv"])
return raw_csv
def get_table_download_link(df, text, filename):
csv = df.to_csv(index=False)
b64 = base64.b64encode(csv.encod... |
import csv
import pigpio
import time
import threading
class DataSource:
def __init__(self):
pass
def start(self, sensor_pulse_event_handler_callback):
pass
def stop(self):
pass
class PiGpioClient(DataSource):
# The maximum number of ticks that the Raspberry Pi can count up ... |
# views for our main table overview
from django.shortcuts import render, redirect
import pandas as pd
import os
import json
import copy
import urllib
import logging
from utils.cache_helper import cache_get, cache_set, save_cache, load_cache
from itertools import islice
from django.views import View
def get_row_count(... |
import re
INVALID_CONTROL_DIGIT = 'Rejected due to invalid control digit.'
INTEGER_PATTERN = re.compile(r'^[0-9]+$')
def make_kid_number(value, mode='MOD10'):
"""Makes a KID-number in either MOD10 or MOD11.
Valid input lengths are from 1 to 24 characters, inclusive.
The output length will be one characte... |
from urllib.request import urlopen
from bs4 import BeautifulSoup
import xlwt
from openpyxl import Workbook
from openpyxl import load_workbook
import difflib
import re
NONE_VALUE = 'None value'
ROOT_WEBSITE = 'http://www.biuroserwis.org/index.php?act=sklep&page='
ROOT_CATEGORY_NAME = 'Gandolf'
XLS_FILENAME = 'gandolf_... |
from collections import defaultdict
from operator import itemgetter
import shutil
from typing import Dict, List, Tuple, Union
from kgdata.config import WIKIDATA_DIR
from kgdata.spark import (
get_spark_context,
saveAsSingleTextFile,
)
from kgdata.wikidata.config import WDDataDirCfg
from kgdata.wikidata.dataset... |
import aiosqlite
import discord
from discord.ext import commands
from discord.ext.commands.cooldowns import BucketType
from dotenv import load_dotenv
import dbl
import os
from bot.cogs.Currency import Currency
env = load_dotenv()
class Support(commands.Cog):
def __init__(self, client):
self.client = cli... |
from __future__ import annotations
from dataclasses import dataclass
from functools import reduce
from typing import Literal
import numpy as np
from numpy.typing import NDArray
from chemex.configuration.data import RelaxationDataSettings
from chemex.configuration.experiment import CpmgSettings
from chemex.configurat... |
# Copyright 2013 OpenStack Foundation
# 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
#
# Un... |
from ctypes import *
import random
import os
import site
from distutils.sysconfig import get_python_lib
DARKNET_SO = "libdarknet.so"
def find_lib_path(lib_name):
lib_file = None
try:
paths = site.getsitepackages()
for p in paths:
for path, _, files in os.walk(p):
... |
from time import sleep
from telegram import Bot, Update, InlineKeyboardMarkup, InlineKeyboardButton
from telegram.error import BadRequest, Unauthorized
from telegram.ext import CommandHandler, CallbackQueryHandler, Filters
import YorForger.modules.sql.global_bans_sql as gban_sql
import YorForger.modules.sql.users_sq... |
# coding=utf-8
# *** WARNING: this file was generated by the Pulumi SDK Generator. ***
# *** 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 _utilities
fro... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.