text stringlengths 3.07k 22.1k |
|---|
from datetime import datetime
from enum import Enum
import logging
import json
class Transaction:
def __init__(self, tid, read_only) -> None:
self.id = tid
self.time_stamp = datetime.now()
self.blocked_inst = []
self.blocked_by = set() # other transactions
self.updated_lis... |
from database.DBHelper import add_channel_permission, get_channel_permission, remove_channel_permission, set_prefix, \
add_blacklist_user, get_blacklist_users, remove_blacklist_user, add_stream_channel, add_casino_channel, \
get_stream_channel, get_casino_channel, remove_stream_channel, remove_casino_channel,... |
from collections import namedtuple
from enum import Enum
import re
from .exceptions import ScanError
_COMMENT_TEST_RX = re.compile(r'^\s*#.*$')
_CTX_WS_RX = re.compile(r'\S')
_INT_RX = re.compile(r'-?\d+')
_WS_RX = re.compile(r'\s+')
class Keywords(object):
css_start = '$'
accessor_start = '|'
attr_acc... |
"""Provide strategies for given endpoint(s) definition."""
import asyncio
import inspect
import re
from base64 import b64encode
from functools import partial
from typing import Any, Callable, Dict, List, Optional, Tuple, Union
from urllib.parse import quote_plus
import hypothesis
import hypothesis.strategies as st
fro... |
from segmentation_models_pytorch.base import (ClassificationHead,
SegmentationHead,
SegmentationModel)
from segmentation_models_pytorch.base import initialization as init
from segmentation_models_pytorch.encoders import get_enco... |
'''
Start a hypergolix service.
LICENSING
-------------------------------------------------
hypergolix: A python Golix client.
Copyright (C) 2016 Muterra, Inc.
Contributors
------------
<NAME>
<EMAIL> | <EMAIL> | <EMAIL>
This library is free software; you can redistribute it and/or
... |
import copy
import itertools
import uuid
from collections import defaultdict
from operator import itemgetter
import boto3
from botocore.exceptions import ClientError
from botocore.stub import Stubber
def stubbed(function):
"""
A decorator that activates/deactivates the Stubber and makes sure all
expected... |
#!/usr/bin/env python
# coding: utf-8
#
# Copyright 2015 The Tornado 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 requ... |
#! /usr/bin/python3 -u
# -*- coding:Utf-8 -*-
# Option -u is needed for communication with snmpd
#
# Modifications to support SRL Copyright (C) 2021 Nokia, all rights reserved
#
# Copyright (C) 2020-2021 NVIDIA Corporation. ALL RIGHTS RESERVED.
# Copyright 2016 Cumulus Networks LLC, all rights reserved
#
# Implementati... |
from typing import Tuple, List, Mapping, Optional, Union
import base64
from io import BytesIO, BufferedReader
from .command_builder import BitcoinCommandBuilder, BitcoinInsType
from ...common import Chain
from .client_command import ClientCommandInterpreter
from .client_base import Client, TransportClient
from .client... |
import logging
import re
from collections import defaultdict
from datetime import datetime
from nose.tools import set_trace
from flask import url_for
from sqlalchemy.orm import lazyload
from core.app_server import cdn_url_for
from core.classifier import Classifier
from core.lane import Facets
from core.opds import (
... |
"""Reversegam, by <NAME> <EMAIL>
A tile flipping game, also called reversi.
More info https://en.wikipedia.org/wiki/Reversi
This and other games are available at https://nostarch.com/XX
Tags: large, game, two-player, board game"""
__version__ = 0
# A version of this game is featured in the book, "Invent Your Own
# Comp... |
from __future__ import annotations
import os
os.environ["TF_CPP_MIN_LOG_LEVEL"] = "1"
import numpy as np
import pandas as pd
import datetime
import tensorflow as tf
from sklearn.compose import ColumnTransformer
from sklearn.preprocessing import StandardScaler, OneHotEncoder
from sklearn.pipeline import Pipeline
from s... |
# 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... |
"""ReZero DC script"""
__author__ = 'Vardë'
import os
import sys
import shlex
import subprocess
from typing import NamedTuple, Optional, Dict, Any
from pathlib import Path
from acsuite import eztrim
from adptvgrnMod import sizedgrn
import muvsfunc as muvf
import mvsfunc as mvf
import vardefunc as vdf
import havsfunc ... |
from common_fixtures import * # NOQA
@pytest.fixture(scope='module')
def nsp(super_client, sim_context):
nsp = create_agent_instance_nsp(super_client, sim_context)
create_and_activate(super_client, 'networkService',
networkServiceProviderId=nsp.id,
networkId=ns... |
"""Several helper functions to convert between data objects and JSON."""
import json
from tinycards.model import Card, Concept, Deck, Fact, Favorite
from tinycards.model import SearchableData, Side, Trendable, TrendableData
from tinycards.model import User
# --- User conversion
def json_to_user(json_data):
"""Co... |
# ===============================================================================
# Copyright 2016 dgketchum
#
# 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... |
"""Pycln code refactoring utility."""
import ast
import os
from functools import lru_cache
from importlib import import_module
from pathlib import Path
from typing import List, Optional, Set, Tuple, Union, cast
from . import iou, pathu, regexu, scan
from ._exceptions import (
ReadPermissionError,
UnexpandableI... |
import pandas as pd
import numpy as np
def clean_static_df(static_df):
static_df_clean = static_df
static_df_clean = pd.get_dummies(data=static_df_clean, columns=[
'sex']).drop('sex_MALE', axis=1)
static_df_clean.drop('discharge_destination', axis=1, inplace=True)
... |
import pickle
class Firma():
def __init__(self):
self.firmy = []
def dodaj_firme(self):
self.nazwafirmy = input("Podaj nazwe firmy: ")
self.firmy.append(self.nazwafirmy)
print("Dodano firme")
return self.firmy
def usun_firme(self, relacja):
... |
from aiohttp import ClientSession
from typing import Union, Optional
from .errors import *
defaultApplications = {
# Credits to RemyK888
'youtube': '880218394199220334',
'poker': '755827207812677713',
'betrayal': '773336526917861400',
'fishing': '814288819477020702',
'chess': '8320... |
#!/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
#
# Authors:
# - <NAME>, <EMAIL>, 2018
import os
from xml.dom import minidom
... |
import time
import dataset
import imagenet
import coco
from dataclasses import dataclass
# pylint: disable=missing-docstring
# the datasets we support
SUPPORTED_DATASETS = {
"imagenet":
(imagenet.Imagenet, dataset.pre_process_vgg, dataset.PostProcessCommon(offset=-1),
{"image_size": [224, 224, 3... |
import sys
sys.path.append('../nvm')
import numpy as np
import pickle
from activator import tanh_activator
from coder import Coder
from op_net import arith_ops
class CHL_Net:
def __init__(self, Ns, feedback=False, split_learn=False, biases=True):
self.sizes = [N for N in Ns]
self.feedback = feed... |
__all__ = [
'OperationType',
'Operation',
'AnalyticsOperation',
'PoolOperation',
'PoolArchiveOperation',
'PoolCloneOperation',
'PoolCloseOperation',
'PoolOpenOperation',
'TrainingOperation',
'TrainingArchiveOperation',
'TrainingCloneOperation',
'TrainingCloseOperation',
... |
#!/usr/bin/env python
#
# Copyright 2007 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 o... |
import os, cx_Oracle
from datetime import *
import requests
import MySQLdb
import numpy as np
import pandas as pd
from fn import *
from oDT import *
livedb = os.getcwd () + "\\robi_live.csv"
db = os.getcwd () + "\\OMDB.csv"
semcol = os.getcwd () + "\\semcols.txt"
CAT = os.getcwd () + "\\CATdef.txt"
try:
mysqlconn ... |
#!/usr/bin/python
# Copyright (c) 2018, Oracle and/or its affiliates.
# This software is made available to you under the terms of the GPL 3.0 license or the Apache 2.0 license.
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
# Apache License v2.0
# See LICENSE.TXT for detail... |
#!/usr/bin/env python
import rospy
from math import *
#from tf.transformations import euler_from_quaternion, quaternion_from_euler
from gazebo_msgs.msg import ModelState
from std_msgs.msg import Float64MultiArray, Float64, Int32MultiArray
from gazebo_msgs.srv import GetWorldProperties, GetModelProperties, GetModelStat... |
# Copyright 2012, <NAME>
# Code at http://inamidst.com/duxlot/
# Apache License 2.0
import duxlot
# Save PEP 3122!
if "." in __name__:
from . import api
else:
import api
command = duxlot.command
# @@ more admin- prefixes
# @@ .modules, for loaded modules
@command
def admin(env):
# this should be an adm... |
import frappe
from frappe import _
from one_fm.api.notification import create_notification_log
# This method is creating shift permission record and setting the the shift details
@frappe.whitelist()
def create_shift_permission(employee, permission_type, date, reason, leaving_time=None, arrival_time=None):
"""
Par... |
# coding=utf-8
#
# Copyright 2020 <NAME> Duesseldorf
#
# Part of this code is based on the source code of BERT-DST
# (arXiv:1907.03040)
#
# 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
#
# ... |
"""Generate OWL ontology corresponding to information model
model classes are translated to OWL classes, slots to OWL properties.
"""
import logging
import os
from typing import Union, TextIO, Optional
import click
from rdflib import Graph, URIRef, RDF, OWL, Literal, BNode
from rdflib.collection import Collection
fro... |
from .utils import Atom, Residue, ActiveSite
import numpy as np
import matplotlib.pyplot as plt
import math
import pandas as pd
import copy
import umap
import seaborn as sns
def compute_similarity(site_a, site_b):
"""
Compute the similarity between two given ActiveSite instances.
Input: two ActiveSite in... |
"""
Tämä suurimmaksi osaksi deep sleepissä aikaa viettävä scripti on tarkoitettu ESP32-Wroom-NodeMCU:lle.
Tarkoituksena on käyttää pelkkää piiriä, eli kytkentään esimerkiksi träppilanka juottamalla piiriin
ja otetaan siitä suoraan lähtö AM2302 (DHT22)-sensorille. Minimoimalla virrankulutuksen voidaan piiri ja antu... |
##############################################################################
#
# Copyright (c) 2002 Zope Foundation and Contributors.
#
# This software is subject to the provisions of the Zope Public License,
# Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution.
# THIS SOFTWARE IS PROVIDED "AS I... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# coding=utf-8
import socket
from scipy.optimize import minimize
import numpy as np
import time
from numba import jit, float64
import datetime
# global variable start >>>
n = 7
t0 = 0
tf = 2
discretized_point_persecond = 50
pointnumber = tf * discretized_point_persecond #... |
#!/usr/bin/env python3
#coding=utf-8
#
#
#https://www.logcg.com
import urllib3
import re
import datetime
import certifi
import codecs
import os
def getList(listUrl):
http = urllib3.PoolManager(
cert_reqs='CERT_REQUIRED', # Force certificate check.
ca_certs=certifi.where(), # Path to the Certifi ... |
# Copyright 2021 Huawei Technologies Co., Ltd
#
# 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... |
# gpl: author <NAME>
import bpy
import bmesh
from random import (
gauss,
seed,
)
from math import radians
from mathutils import Euler
# Allow changing the original material names from the .blend file
# by replacing them with the UI Names from the EnumProperty
def get_ui_mat_name(mat_name):
... |
import csv
from os import read
import sys
from datetime import datetime
def generate_acmdl_artifact_metafile(authors, artifactDOI, relatedDOI, paperTitle, description, badges, zipfile="", readme=""):
# print(f"Generating metadata for {paperTitle} receiving {badges} by {authors} in {artifactDOI} {relatedDOI... |
#!/usr/bin/env python
from djinni.tsp import TSP
from djinni.ca_tsp import Compressed, CA_TSP
import pygtk, re, sys, time
pygtk.require('2.0')
import gtk
class Point:
def __init__(self, x, y, z):
self.x = int(x)
self.y = int(y)
self.z = int(z)
class DumasReader:
def __init__(self, nam... |
from .base import AlgoBase
from .dqn import DoubleDQN
from .torch.cql_impl import CQLImpl, DiscreteCQLImpl
class CQL(AlgoBase):
""" Conservative Q-Learning algorithm.
CQL is a SAC-based data-driven deep reinforcement learning algorithm, which
achieves state-of-the-art performance in offline RL problems.
... |
from grove_rgb_lcd import *
from time import time, strftime, localtime, sleep
from email.mime.text import MIMEText
from subprocess import Popen, PIPE
from datetime import datetime
import grovepi
import random
# System states
STATE_INACTIVE = "State inactive"
STATE_ACTIVE = ... |
#! /usr/bin/python
# Copyright (c) 2019 <NAME> <<EMAIL>>
from collections import namedtuple
import time
from numpy import random
import numpy as np
from .model import Model, model_loarder
from .solution import DebugIndex, DebugInfo
from .worsen_score import WorsenScore, MockWorsenScore
from .feature_kernel import ini... |
import logging
import datetime
from psycopg2.extras import Json as PGJson
from tt_web import log
from tt_web import postgresql as db
from . import logic
from . import objects
from . import relations
from . import exceptions
async def load_balances(accounts_ids):
results = await db.sql('SELECT account, curren... |
import os
from copy import deepcopy
from pathlib import Path
from typing import Sequence, Optional, List, Dict, Any
from git import Repo, GitCommandError
from rich.prompt import Confirm
from flexlate.branch_update import (
abort_merge_and_reset_flexlate_branches,
prompt_to_fix_conflicts_and_reset_on_abort_ret... |
from __future__ import absolute_import, unicode_literals
import os
import pipes
import re
import subprocess
import sys
from os.path import dirname, join, normcase, realpath
import pytest
import six
import virtualenv
IS_INSIDE_CI = "CI_RUN" in os.environ
def need_executable(name, check_cmd):
"""skip running th... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import unittest
from bittrex_v2 import Bittrex, BittrexError
from decimal import Decimal
from datetime import datetime
""" ###########################################
######### TESTS CONFIGURATION ###########
###########################################
"""
cl... |
import discord
import requests
import re
from discord.ext import commands
from utils.utils import check_arg, web_name
class Wiki(commands.Cog):
"""
Commands that link to wiki pages
"""
def __init__(self, bot):
self.bot = bot
def git_name(self, name):
name = name.lower()
... |
#!/usr/bin/env python
# -*- coding=utf-8 -*-
###########################################################################
# Copyright (C) 2013-2019 by Caspar. All rights reserved.
# File Name: omim.py
# Author: <NAME>
# E-mail: <EMAIL>
# Created Time: 2019-10-10 15:57:59
#################################################... |
import argparse
from dataclasses import dataclass
from enum import Enum
from pathlib import Path
import platform
import shutil
import subprocess
import time
_IS_WINDOWS = False
if platform.system() == 'Windows':
_IS_WINDOWS = True
_DEFAULT_BOOST_DIR = None
_DEFAULT_EIGEN_DIR = None
_DEFAULT_OPENCV_... |
import os
import sys
import argparse
import glob
import torch
import monai
from monai.handlers import (
SegmentationSaver,
MeanDice,
StatsHandler,
HausdorffDistance,
StatsHandler,
MetricsSaver,
from_engine,
)
from monai.transforms import (
AsDiscreted,
MeanEnsembled
)
from utils.... |
from __future__ import annotations
import _thread
import os
import re
from datetime import datetime, timedelta
import PySimpleGUIQt as sg
import asyncio
import threading
import sys
import brightness_control
import volume_control
import audio_listener
from serialization import *
from calibration import *
from logger ... |
from matplotlib import pyplot as plt
import matplotlib
import os
import random
import torch
from torch.autograd import Variable
import torchvision.transforms as standard_transforms
import misc.transforms as own_transforms
import pandas as pd
from models.CC import CrowdCounter
from config import cfg
from misc.utils impo... |
# Copyright (C) 2019 The Raphielscape Company LLC.
#
# Licensed under the Raphielscape Public License, Version 1.c (the "License");
# you may not use this file except in compliance with the License.
#
import io
import math
import os
import random
import urllib.request
from PIL import Image
from telethon.tl.functions.m... |
import os
from unittest import TestCase
import numpy as np
import torch
from torch import Tensor
from torch.utils.data import DataLoader
from dl4d.datasets.pamap import PAMAP2
from dl4d.datasets.sits import SITS
from dl4d.datasets.ucr import CROP, ElectricDevices, FordB
from dl4d.datasets.wisdm import WISDM
from dl4... |
from __future__ import (absolute_import, unicode_literals, division,
print_function)
import numpy as np
import astropy.units as u
from astropy.coordinates.baseframe import (BaseCoordinateFrame,
RepresentationMapping, frame_transform_graph)
from astropy.coord... |
# Copyright 2020 Lorna 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 required by applicable l... |
#!/usr/bin/python
#
# Copyright (C) 2010 Google Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# 1. Redistributions of source code must retain the above copyright notice,
# this list of... |
"""
File: titanic.py
Name: <NAME>
----------------------------------
This file builds a machine learning algorithm from scratch
by Python codes. We'll be using 'with open' to read in dataset,
store data into a Python dict, and finally train the model and
test it on kaggle. This model is the most flexible one among al... |
from collections import namedtuple
import os, pickle, time
import numpy as np
import dolfin as df
# We want to embed line mesh of Xd vertices `Gamma` into X-d hypercube
# This might require that the `Gamma` is modified by inserting auxiliary vertices.
# The result of embedding is a mesh `Omega`, edge function which ... |
import numpy as np
import pandas as pd
import random
from shapely import wkt
from shapely.geometry import Point, MultiPoint
import geopandas as gpd
import logging
import warnings
from activitysim.core import pipeline
from activitysim.core import inject
logger = logging.getLogger('activitysim')
warnings.filterwarnings... |
from tkinter import *
root=Tk()
root.title("Numeros PseudoAleatorios - Inf 391")
#root.resizable(0,0)
#root.config(bg="black")
miframe=Frame(root, width=500, height=400)
miframe.pack()
#PARA UNA IMAGEN
#miImagen=PhotoImage(file="imagen.gif")
#Label(miframe, image=miImagen).place(x=100,y=0)
#-------------------------... |
"""Utilities for module and path manipulations."""
load("@bazel_skylib//lib:paths.bzl", "paths")
load(":private/set.bzl", "set")
def module_name(hs, f, rel_path = None):
"""Given Haskell source file path, turn it into a dot-separated module name.
module_name(
hs,
"some-workspace/some-package/src/... |
import ast
from itertools import chain, zip_longest
from typing import Any
from numerous.engine.model.graph_representation.graph import Node, Edge, Graph
from numerous.engine.model.graph_representation.utils import str_to_edgetype, EdgeType
from numerous.engine.model.utils import NodeTypes, recurse_Attribute
op_sym_m... |
from __future__ import annotations
import struct
import zlib
from io import BytesIO
from typing import List, Tuple, Union
from collections import defaultdict
import numpy
from api import WorldFormat
from math import log, ceil
from nbt import nbt
from os import path
from api.world import World
from api.block import ... |
# * This file is part of recharge-me project.
# * (c) <NAME> <<EMAIL>>
# * For the full copyright and license information, please view the "LICENSE.md"
# * file that was distributed with this source code.
from django import forms
from django.contrib.auth.forms import UserCreationForm, UserChangeForm
from django.co... |
import ctypes
from sys import platform as _platform_name
if _platform_name.startswith('win'):
time_t = ctypes.c_uint32
else:
time_t = ctypes.c_uint64
class DSPROJECT(ctypes.Structure):
_fields_ = [("dsapiVersionNo", ctypes.c_int),
("sessionId", ctypes.c_int),
("valueMark",... |
# based on https://github.com/scottlawsonbc/audio-reactive-led-strip/blob/master/python/led.py
# via https://kno.wled.ge/interfaces/udp-realtime/#setup-with-arls
# inlined from config.py
UDP_IP = 'wled-matrix'
UDP_PORT = 21324
W = 16
H = 16
MQTT_BROKER = 'localhost'
MQTT_TOPIC = 'lights/wled-matrix'
MQTT_CO2_TOPIC = '... |
import datetime
import json
from typing import Any, Dict, List, Optional
from uuid import UUID
from django.db.models.signals import post_delete, post_save
from django.dispatch import receiver
from django.utils.timezone import now
from rest_framework import serializers
from ee.clickhouse.client import sync_execute
fro... |
# Copyright 2016-2020 Blue Marble Analytics 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
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ag... |
#!/usr/bin/env python2.5
#
# Copyright 2009 the Melange 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 applic... |
import torch.optim as optim
from torch import load, save
from torch.utils.tensorboard import SummaryWriter
import torch.nn as nn
import torch
import torch.nn.functional as F
import numpy as np
import os
import shutil
import dataset.custom_dataset as cds
import dataset.cifar10 as cifar10
import models.wid... |
"""
This module is currently primarily intended to be used as a script.
It will print information about the rpy2's environment (Python version,
R version, rpy2 version, etc...).
"""
import argparse
import enum
import os
import shlex
import subprocess
import sys
from typing import Optional
import warnings
if sys.maxsi... |
# -*- coding: utf-8 -*-
# copied from https://github.com/Ledenel/auto-white-reimu
import operator as op
import os
from functools import reduce
from itertools import groupby
from typing import Set, List, Callable, TypeVar, Optional
from jinja2 import Environment, select_autoescape, FileSystemLoader
from mahjong.conta... |
# -*- coding:UTF-8 -*-
from apscheduler.schedulers.blocking import BlockingScheduler
__author__ = "NIU"
import base64
import datetime
import re
import urllib
from flask import logging
from kafka.errors import KafkaError
import requests
import json
import time
import logging
from kafka import KafkaProduce... |
import html
from telegram import Message, Update, Bot, User, Chat, ParseMode
from typing import List, Optional
from telegram.error import BadRequest, TelegramError
from telegram.ext import run_async, CommandHandler, MessageHandler, Filters
from telegram.utils.helpers import mention_html
from MissValencia import dispatc... |
import asyncio
import discord
import discord.errors
import pickle
import re
from os.path import exists
from os import remove, mkdir
import server
import youtube_dl
import functools
import logging
import traceback
import time
import math
import utils
from datetime import datetime
class Playlist:
def __init__(self,... |
# encoding: utf-8
"""
@author: liaoxingyu
@contact: <EMAIL>
"""
import glob
import re
import urllib
import zipfile
import os
import numpy as np
import mat4py
import os.path as osp
from utils.iotools import mkdir_if_missing
from .bases import BaseImageDataset
# attributes
# ['backpack',
# 'bag',
# 'boots',
# 'do... |
import config
from dataset import BraTS
from sklearn.model_selection import train_test_split
import os
import tensorflow as tf
from tensorflow_addons.layers import GroupNormalization
from tensorflow.keras import backend as K
from tensorflow.keras.layers import Conv3D, Conv3DTranspose, Flatten, Dense, Activation,... |
#! /usr/bin/env python
# coding: utf-8
metadata = dict(
__author__="Aliasfox KDE",
__version__="0.0.3",
__license__="MIT License",
__email__="<EMAIL>",
__status__="Work in Progress",
__url__="https://github.com/aliasfoxkde/snippets",
__summary__="Simple but helpful library of snippets for ... |
# coding=utf-8
# Copyright 2021 The TensorFlow Datasets 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 appl... |
# Copyright 2007 <NAME>
#
# This file is part of Reinteract and distributed under the terms
# of the BSD license. See the file COPYING in the Reinteract
# distribution for full details.
#
########################################################################
#
# This file is about banging the IPC mechanisms of GtkTex... |
# -*- coding: utf-8
"""
flask_googlecharts
~~~~~~~~~~~~~~~~~~
Google charts API support for Flask.
"""
from jinja2 import Environment, PackageLoader
from .utils import render_data
import flask
import json
import pkg_resources
import string
class GenericChart(object):
def __init__(self, name, option... |
#!/usr/bin/env python3
# %% import
from argparse import ArgumentParser
from functools import reduce
from glob import iglob
from itertools import chain, islice
from math import sin, cos
from typing import List
from pyspark.sql import SparkSession, DataFrame
from pyspark.sql.functions import udf, array, size
from dlt... |
# Copyright 2019 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 typing as t
import imutils
import numpy as np
from cv2 import cv2
from skimage import measure
from skimage.filters import threshold_local
from car_plate_recognizer.handlers.base import Plate
ELEMENT_STRUCTURE = cv2.getStructuringElement(shape=cv2.MORPH_RECT, ksize=(22, 3))
MIN_AREA = 4500 # minimum area of ... |
import sys
import GPUtil
import importlib
import logging
import multiprocessing as mp
import os
import traceback
import click
from toml import TomlDecodeError
from tqdm import tqdm
from multiprocessing import Queue, Event, Process
from multiprocessing.queues import Empty as QueueEmpty
from exp.params import ParamSpac... |
"""
@author: <NAME>, <NAME>, <NAME> (in alphabetic order)
@institution: University of Liechtenstein, Fuerst-Franz-Josef Strasse 21, 9490 Vaduz, Liechtenstein
@funding: European Commission, part of an Erasmus+ Project (Project Reference: 2017-1-LI01-KA203-000083)
@copyright: Copyright (c) 2020, <NAME>, <NAME>, <NAME>
@l... |
from __future__ import annotations
import requests
import json
import logging
import time
from typing import Optional, Type, Union, Any, List, TYPE_CHECKING
from dataclasses import dataclass
from .tweet import Tweet
from .errors import PytweetException, ConnectionException
from .expansions import TWEET_FIELD, MEDIA_FI... |
import numpy as np
import pygame
from config import *
from typing import Dict, Union, List
from random import choices, choice
from time import time
from utils import is_point
from shapely.geometry import Point
from shapely.geometry.polygon import Polygon
class Sprite:
def __init__(self, screen, coordinates, color... |
import re
import socket
# custom exceptions
class RspDisconnected(Exception):
pass
class RspAckMissing(Exception):
pass
class RspExpectedStartOfPacket(Exception):
pass
class RspGeneralError(Exception):
pass
# rsp connection class
class RspConnection():
def __init__(self, sock):
self.sock = sock
self.acks_ena... |
# -*- coding: utf-8 -*-
# vispy: testskip
# -----------------------------------------------------------------------------
# Copyright (c) 2014, Vispy Development Team.
# Distributed under the (new) BSD License. See LICENSE.txt for more info.
# ----------------------------------------------------------------------------... |
import json
import multiprocessing
import multiprocessing.sharedctypes
import numpy
import pathlib
import PyCompiledNN
import subprocess
import tensorflow as tf
import tensorflow_addons as tfa
def run(payload):
genome = payload['genome']
configuration = payload['configuration']
run_result = {
'com... |
"""Common local disk utils.
"""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import errno
import logging
import os
import re
import six
from treadmill import exc
from treadmill import fs
from treadmill import lvm... |
import tensorflow as tf
import tensorflow as tf
import tensorflow.contrib as tfcontrib
from tensorflow.python import keras
from tensorflow.python.keras import layers
from tensorflow.python.keras import losses
from tensorflow.python.keras import models
from tensorflow.python.keras import backend as K
# -------... |
import os
import subprocess
import pptx
from pptx.chart.data import ChartData
from pptx.enum.chart import XL_CHART_TYPE
from pptx.util import Inches
import pdfrw
from pd2ppt import df_to_table
import pandas as pd
def load_excel_files():
df_times = pd.read_excel("input_data/project_hours.xlsx")
df_expense... |
from typing import Optional, Tuple, List
import torch
import torch_geometric
def extend_lists(data_list: Optional[Tuple[Optional[List[torch.Tensor]]]],
new_data_list: Tuple[Optional[List[torch.Tensor]]]) -> Tuple[Optional[List[torch.Tensor]]]:
r"""
Extends the semantic of Python :func:`exten... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.