text stringlengths 6.04k 39.5k |
|---|
from pywlc.cwlc import ffi, lib
from functools import wraps
NULL = ffi.NULL
def keysym(key):
name = 'XKB_KEY_{}'.format(key)
if not hasattr(lib, name):
raise ValueError('Could not find a keysym for {} ({})'.format(key, name))
return getattr(lib, name)
def args_to_python(*orig_args):
def args... |
from __future__ import print_function
import copy
import csv
import imp
import json
import os
import re
import sys
import tarfile
from lists_and_dictionaries import singular_to_plural_dictionary, fields_to_change, \
fields_to_exclude_in_the_presence_of_other_fields, fields_to_exclude_from_import_by_ap... |
# Copyright 1999-2021 Alibaba Group Holding 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 a... |
# -*- coding: utf-8 -*-
import argparse
import os
import time
import math
import json
import torch
from torch.autograd import Variable as V
import torch.backends.cudnn as cudnn
import torch.nn.functional as F
import torchvision.datasets as dset
import torchvision.transforms as transforms
import wideresnet as wrn
impor... |
# -*- coding: utf-8 -*-
# MegEngine is Licensed under the Apache License, Version 2.0 (the "License")
#
# Copyright (c) 2014-2021 Megvii Inc. All rights reserved.
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT ARRANTI... |
################################################################################
# infer segments from breakpoint pairs
################################################################################
#------------------------------------------------------------------------------#
import numpy as np
import pandas as pd... |
#
# Copyright 2020 Nebulon, Inc.
# All Rights Reserved.
#
# DISCLAIMER: THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND,
# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO
# EVENT SHALL THE AUTHORS OR COPYRIG... |
# MIT License #
# #
# Copyright (c) 2020 <NAME> <<EMAIL>> #
# #
# Permission is hereby granted, free... |
from __future__ import print_function
import os
try:
from StringIO import StringIO
except ImportError:
from io import StringIO
import scipy.misc
import numpy as np
from glob import glob
from tqdm import trange
from itertools import chain
from collections import deque
from models import *
from utils import sav... |
# -*- coding: utf-8 -*-
"""
Determine contiguous parts of CT scans in the LIDC-IDRI database.
Steps:
1. Determine whether scans are composed of multiple acquisitions.
We would like to detect these cases in order to split them, in order to
avoid jumps in a single volume between neighbouring z sli... |
# Copyright (c) 2020-2021, <NAME>
# License: MIT License
import math
from typing import (
Iterable,
cast,
Union,
List,
Dict,
Callable,
Tuple,
Set,
Optional,
)
from ezdxf.addons.drawing.config import (
Configuration,
ProxyGraphicPolicy,
HatchPolicy,
)
from ezdxf.addons.dr... |
#!/usr/bin/env python
from __future__ import print_function, unicode_literals
if __package__ is None:
import sys
from os import path
sys.path.append(path.dirname(path.dirname(path.abspath(__file__))))
import json
import os
import os.path
import posixpath
from collections import defaultdict, namedtuple
t... |
"""
Combinations of processing algorithms to implement common augmentations.
Examples:
* SpecAugment
* Environmental corruption (noise, reverberation)
Authors
* Anonymous
"""
import os
import torch
import torchaudio
import speechbrain as sb
from speechbrain.utils.data_utils import download_file
from speechbrain.pr... |
# -*- coding: utf-8 -*-
# Copyright 2020 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
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law o... |
# -*- coding: utf-8 -*-
import warnings
from statsmodels.compat.pandas import PD_LT_1_4
import os
import numpy as np
import pandas as pd
from statsmodels.multivariate.factor import Factor
from numpy.testing import (assert_equal, assert_array_almost_equal, assert_,
assert_raises, assert_arr... |
"""This module contains simple helper functions """
from __future__ import print_function
import torch
import torch.nn as nn
import numpy as np
from PIL import Image
import os
import matplotlib as plt
import cv2
from typing import Union
import torchvision.transforms as transforms
import torch.nn.functional as F
import ... |
import json
import asyncio
import random
from typing import Optional
import utils
from dyn import dyn_raffle_sql
from dyn.bili_data_types import DynRaffleStatus, DynRaffleJoined, DynRaffleResults, DynRaffleLuckydog
from reqs.dyn_raffle_handler import DynRaffleHandlerReq
from .utils import UtilsTask
from .tas... |
'''
Contains code from scikit-image v0.18.3
'''
import numpy as np
from warnings import warn
# For integers Numpy uses `_integer_types` basis internally, and builds a leaky
# `np.XintYY` abstraction on top of it. This leads to situations when, for
# example, there are two np.Xint64 dtypes with the same attributes bu... |
#!/usr/bin/env python3
# Kurisu by Nintendo Homebrew, started by 916253 & ihaveamac
# license: Apache License 2.0
# https://github.com/nh-server/Kurisu
import aiohttp
import asyncio
import discord
import gino
import logging
import os
import sys
import traceback
from alembic.config import main as albmain
from configp... |
from nio import AsyncClient, UnknownEvent
from plugin import Plugin
from typing import Dict, List, Tuple
import time
import random
import re
from shlex import split
import logging
logger = logging.getLogger(__name__)
quote_attributes: List[str] = ["user", "members"]
"""valid attributes to select quotes by"""
curren... |
# Copyright 2016 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import logging
import re
import sys
from telemetry.testing import serially_executed_browser_test_case
from telemetry.util import screenshot
from typ import ... |
import logging
from copy import deepcopy as copy
from os import path
import numpy as np
from matplotlib import pyplot as plt
from typing import Dict, List, Tuple
from srl_nlp.framenet import framenet
from srl_nlp.framenet.adapter import FNXMLAdapter, DocumentAdapter
from srl_nlp.framenet.corpus import Document
from s... |
import pygame
import sys
import math
import time
import random
# --------------------------- Physics/Math functions ---------------------------
# https://stackoverflow.com/questions/35211114/2d-elastic-ball-collision-physics
def unit_normal_vector_between(ball, particle):
ballx_to_particlex = ball.x - particle.x
... |
#-*- coding:utf-8 -*-
#!/usr/bin/python
''' This library provides some common functions
author:
zzw922cn
liujq
date:2016-11-09
fix: 2017-5-13
'''
import sys
sys.path.append('../')
sys.dont_write_bytecode = True
import time
from functools import wraps
import os
from glob import glob
import numpy as np
import tensorfl... |
#!/usr/bin/python3
"""Usage: oscc-check.py (-V <vehicle>) [-hdelv] [-b <bustype>] [-c <channel>]
Options:
-h --help Display this information
-V <vehicle>, --vehicle <vehicle> Specify your vehicle. Required.
(kia_soul_ev / kia_soul_petrol / ... |
import pygame, sys, time, os
from pygame.locals import *
from Files import Var, Images
#from math import atan2, degrees, pi, cos, sin
import math
pygame.init()
######################################################################################################################################################... |
"""
Progress report generator
To automatically generate progress reports over multiple repositories
Author : <NAME>
Year : 2018
"""
import ast
import configparser
import itertools
import json
import os
import re
import sys
import time
import dict_table
import eval_repo
import git
import iter_repo
import regex_t... |
# Copyright (c) 2021 PaddlePaddle 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 appli... |
import os
import numpy as np
import tensorflow as tf
from tensorflow.keras.models import Model, model_from_json
from tensorflow.keras.layers import Input, GRU, Conv2D, Dropout, Flatten, Dense, Reshape, Concatenate, Add
from tensorflow.keras.optimizers import SGD, RMSprop, Adam
from tensorflow.keras import backend as ... |
import numpy as np #for arrays and matrices
import matplotlib.pyplot as plt #for ploting
import scipy #for math calculations
from mpl_toolkits.mplot3d import Axes3D #for 3D ploting
import math #for math constants
from matplotlib im... |
# Copyright 2017 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 required by applicable la... |
# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
# SPDX-License-Identifier: Apache-2.0
"""
Helper functions for the AWS-Alphafold notebook.
"""
from datetime import datetime
import boto3
import uuid
import sagemaker
from Bio import SeqIO
from Bio.Seq import Seq
from Bio.SeqRecord import SeqRecord
f... |
# Copyright (c) 2010-2012 OpenStack 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
#
# Unless required by applicable law or agree... |
# This file based loosely on Python's list_tests.py.
import sys
import collections.abc as collections, operator
import gc
import random
import blist
from blist.test import unittest
from blist.test import list_tests, seq_tests
def CmpToKey(mycmp):
'Convert a cmp= function into a key= function'
class K(object):... |
# -*- coding: utf-8 -*-
import os
import json
import re
import time
import getopt
import sys
import queue as Queue
from random import randrange
from random import randint
from requests_html import HTMLSession
from threading import Thread
from local_file_adapter import LocalFileAdapter
MOBIE_HEADERS = {
'Prag... |
import time, re, io
import json, copy
import logging
from .. import config, utils
from ..returnvalues import ReturnValue
from ..storage import contact_change
from ..utils import update_info_dict
logger = logging.getLogger('itchat')
def load_contact(core):
core.update_chatroom = update_chatroom
co... |
# Copyright (c) HP-NTU Digital Manufacturing Corporate Lab, Nanyang Technological University, Singapore.
#
# This source code is licensed under the Apache-2.0 license found in the
# LICENSE file in the root directory of this source tree.
import argparse
import numpy as np
import models
import torch
import torch.nn as... |
# Copyright 2018 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
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... |
# -*- coding: utf-8 -*-
# Copyright © 2019 Apple Inc. All rights reserved.
#
# Use of this source code is governed by a BSD-3-clause license that can
# be found in the LICENSE.txt file or at https://opensource.org/licenses/BSD-3-Clause
from __future__ import print_function as _
from __future__ import division as _
fr... |
import logging
import queue
import threading
from typing import Any, Callable, Dict, List, Optional, Tuple, Union
import requests
from cognite.client import CogniteClient
from cognite.client.data_classes import Event, FileMetadata, Sequence, TimeSeries
from cognite.client.data_classes.assets import Asset
from cognite.... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
'''
Copyright (C) 2020, WAFW00F Developers.
See the LICENSE file for copying permission.
'''
# For keeping python2 support for now
from __future__ import print_function
import csv
import io
import json
import logging
import os
import random
import re
import sys
from collec... |
# -*- coding: utf-8 -*-
#
# Copyright 2014 Red Hat, Inc.
# All Rights Reserved.
# Copyright (c) 2017-2019 Dell Inc. or its subsidiaries.
#
# 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 ... |
"""Frechet mean.
Lead authors: <NAME> and <NAME>.
"""
import logging
import math
from sklearn.base import BaseEstimator
import geomstats.backend as gs
import geomstats.errors as error
import geomstats.vectorization
from geomstats.geometry.discrete_curves import SRVMetric
from geomstats.geometry.hypersphere import H... |
import os
from argparse import ArgumentParser
from utils import DefaultBoxes, Encoder, COCODetection
from base_model import Loss
from utils import SSDTransformer
from ssd300 import SSD300
import torch
from torch.autograd import Variable
from torch.utils.data import DataLoader
import time
import random
import... |
import pandas as pd
import numpy as np
import sys
# DS TODO: Comment this please :)
"""
Function to convert the parameter dataframe to a scaled and fitted array.
Inputs:
1) The Parameters dataframe
2) The fix/float/constrain constraints dictionary is inside runprops
Outputs:
1) The fitted array of floating parameter... |
# -*- coding: utf-8 -*-
#
# Project: Azimuthal integration
# https://github.com/silx-kit/pyFAI
#
# Copyright (C) 2015-2018 European Synchrotron Radiation Facility, Grenoble, France
#
# Principal author: <NAME> (<EMAIL>)
#
# Permission is hereby granted, free of charge, to any person obtaining... |
"""
Based on https://github.com/asanakoy/kaggle_carvana_segmentation
"""
import torch
import torch.utils.data as data
from torch.autograd import Variable as V
from PIL import Image
import cv2
import numpy as np
import os
import scipy.misc as misc
def randomHueSaturationValue(image, hue_shift_limit=(-180, 180),
... |
import math
import pygame
import copy
import time
import sys
import os
import random
import pygame.gfxdraw
from pygame.locals import *
FPS = 120
winwdth = 940
winhgt = 740
txthgt = 20
bubblerad = 20
bubblewdth = bubblerad * 2
bubblelyrs = 5
bubadjst = 5
strx = winwdth / 2
strY = winhgt - 26
arywdth... |
#!/usr/bin/env python3
import copy
import numpy as np
import gym
from typing import Tuple
from robo_gym.utils import ur_utils
from robo_gym.utils.exceptions import InvalidStateError, RobotServerError, InvalidActionError
import robo_gym_server_modules.robot_server.client as rs_client
from robo_gym_server_modules.robot_s... |
import bz2
import random
import zlib
from enum import Enum
from opengsq.binary_reader import BinaryReader
from opengsq.protocol_base import ProtocolBase
from opengsq.socket_async import SocketAsync
class Source(ProtocolBase):
"""Source Engine Query Protocol"""
full_name = 'Source Engine Query Protocol'
_... |
# Copyright 2013 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" file acc... |
"""
This implementation of GFDT is created by <NAME> and <NAME>.
[reference]
"坂上 陽規,栗田 和宏 ,瀧川 一学 ,有村 博紀 ,”決定化されたグラフパターントライの学習アルゴリズム”,人工知能学会 第105回人工知能基本問題研究会 (SIG-FPAI) 予稿集, SIG-FPAI-B508, pp. 63-68, 2018年01月".
[contact]
<NAME>, <EMAIL> (or <EMAIL>)
"""
import numpy as np
import time
from collections impo... |
################################################################################
"""
`electricpy` Package - `phasors` Module.
>>> from electricpy import phasors
Filled with calculators, evaluators, and plotting functions related to
electrical phasors, this package will provide a wide array of capabilities to
any elec... |
# encoding: UTF-8
'''
vnpy.api.okex的gateway接入
Contributor:ipqhjjybj 大佳
'''
from __future__ import print_function
import os
import json
from datetime import datetime
from time import sleep
from copy import copy
from threading import Condition
from queue import Queue, Empty
from threading import Thread
from time impo... |
"""
MIT License
Sugaroid Artificial Intelligence
Chatbot Core
Copyright (c) 2020-2021 <NAME>
Copyright (c) 2021 The Sugaroid Project
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 restri... |
from shutil import copyfile
import _lib
import _transfers
import _blocks
import re
import os
import time
import random
import startnode
import blocksnodes
import blocksbasic
import managenodes
import transactions
def PrepareNodes():
nodeport = '30000'
_lib.StartTestGroup("Wallet Balance")
_... |
""" tools that are useful for spherical harmonic analysis
SHkeys -- class to contain n and m - the indices of the spherical harmonic terms
nterms -- function which calculates the number of terms in a
real expansion of a poloidal (internal + external) and toroidal expansion
... |
# Copyright 2014 NetApp
# 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 applic... |
#!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2013, <NAME> <<EMAIL>>
# based on
# openbsd_pkg
# (c) 2013
# <NAME> <<EMAIL>>
#
# yum
# (c) 2012, Red Hat, Inc
# Written by <NAME> <skvidal at fedoraproject.org>
#
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.... |
#################################################################################
# The Institute for the Design of Advanced Energy Systems Integrated Platform
# Framework (IDAES IP) was produced under the DOE Institute for the
# Design of Advanced Energy Systems (IDAES), and is copyright (c) 2018-2021
# by the softwar... |
# import pythoncom
# import win32serviceutil
# import win32service
# import win32event
# import servicemanager
# import socket
# import time
# import datetime
# import sys
# import os
# import logging
# import random
# # from win32com.shell import shell, shellcon
# import ntsecuritycon
# import win32security
# import w... |
# Copyright (C) 2017 Verizon. All Rights Reserved.
#
# File: base.py
# Author: <NAME>
# Date: 2017-02-17
#
# 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
#
# htt... |
# 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... |
#!/usr/bin/env python3.7
import argparse
import json
import sys
import os
from decimal import Decimal
import numpy as np
import pandas as pd
import tinydb as db
import matplotlib.pyplot as plt
import itertools as it
from scipy.stats import mode
import scipy.optimize as opt
from pprint import pprint
from pygama import D... |
# This file is part of the Reproducible and Reusable Data Analysis Workflow
# Server (flowServ).
#
# Copyright (C) 2019-2021 NYU.
#
# flowServ is free software; you can redistribute it and/or modify it under the
# terms of the MIT License; see LICENSE file for more details.
"""The run manager is used to create, delete... |
#!/usr/bin/env python
#
# Author: <NAME> [tg at isi dot edu]
# Created: 10/17/18
from rtg.module.generator import Seq2SeqGenerator
from rtg.module.rnnmt import *
from typing import Mapping
from time import time
from rtg import cpu_device, device, log
import math
from rtg.module.trainer import NoamOpt, Optims
import it... |
############################################################################
# #
# Copyright (c) 2017 eBay Inc. #
# Modifications copyright (c) 2019-2020 <NAME> #
# Modifications copyr... |
"""
This component provides support for Netgear Arlo IP cameras.
For more details about this component, please refer to the documentation at
https://home-assistant.io/components/arlo/
"""
import json
import logging
import os.path
import pprint
import time
from datetime import timedelta
from traceback import extract_st... |
import numpy as np
from math import sqrt
from math import factorial as fact
import matplotlib.pyplot as plt
from matplotlib import cm
from mpl_toolkits import mplot3d
from matplotlib.widgets import Slider
from matplotlib.widgets import TextBox
from matplotlib.backends.backend_pdf import PdfPages
from multiprocessing im... |
import pandas as pd
import numpy as np
import numpy as np
import re
import logging
import re
import sys
print(sys.path)
import spacy
from sklearn.metrics import f1_score, precision_score, classification_report, hamming_loss, recall_score
spacy_en = spacy.load('en')
import torch
import torch.nn as nn
from torch.nn imp... |
#!/usr/bin/env python
# vim: set fileencoding=utf-8 ts=4 sts=4 sw=4 et tw=80 :
#
# The routines in this module are used to shift and stack a list of
# images obtained from a single AOR/channel in Spitzer/IRAC. Bright
# pixels are identified by thresholding and rapidly cross-correlated
# in X and Y to find offsets. The ... |
# -*- coding: utf-8 -*-
"""
-------------------------------------------------
File Name: semantic_retrieval_search.py
Description : 用户查询解析,elasticsearch查询构造。
Author : charl
date: 2018/11/7
-------------------------------------------------
Change Activity: 2018/11/7:
---------------... |
import torch
import numpy as np
import torch._C._te as te
from torch.testing._internal.common_utils import run_tests
from torch.testing._internal.jit_utils import JitTestCase
import unittest
LLVM_ENABLED = torch._C._llvm_enabled()
def construct_adder(n: int, dtype=torch.float32):
A = te.BufHandle("A", [n], dtyp... |
from datetime import datetime
from django.urls import reverse
from django.db.models import Count
from django.shortcuts import render, get_object_or_404, redirect
from django.core.paginator import Paginator
from django.utils.decorators import method_decorator
from django.contrib.auth.decorators import login_required
fro... |
#!/usr/bin/python
# Copyright (c) 2018 Cohesity Inc
# Apache License Version 2.0
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
import json
from ansible.module_utils.basic import AnsibleModule
from ansible.module_utils.urls import open_url, urllib_error
try:
# => When uni... |
# -------------------------------------------
# CVGear | Written by <NAME>(a.k.a ivanpp)
#
# Darknet network parser
# -------------------------------------------
import os
from typing import List, Dict, Tuple
from collections import OrderedDict
from yacs.config import CfgNode
__all__ = ["read_cfg", "DarknetParser", "... |
"""
ORCA wrapper functions
"""
import functools
import logging
import pathlib
from collections import ChainMap
from typing import List
import numpy as np
from tqdm import tqdm
from ppqm import chembridge, constants, env, linesio, misc, shell, units
from ppqm.calculator import BaseCalculator
from ppqm.utils.files imp... |
import logging
import math
import os
import torch
import torch.distributed as dist
import torchvision
from PIL import Image
from UniformAugment.augmentations import *
from UniformAugment.augmentations import UniformAugment
from UniformAugment.common import get_logger
from UniformAugment.imagenet import ImageNet
from U... |
import torch
from torch import nn as nn
from torch.nn import functional as F
from basicsr.models.archs.arch_util import (DCNv2Pack, ResidualBlockNoBN, Upsample,
make_layer)
import math
# 把动态卷积加到可形变卷积之中
class PixelConv(nn.Module):
def __init__(self, scale=1, depthwise=F... |
#!/usr/bin/env python3
import unittest
import numpy as np
from panda import Panda
from panda.tests.safety import libpandasafety_py
import panda.tests.safety.common as common
from panda.tests.safety.common import CANPackerPanda, make_msg
MAX_ACCEL = 2.0
MIN_ACCEL = -3.5
class Buttons:
NONE = 0
RESUME = 1
SET = ... |
"""Test TileMatrixSet model."""
import json
import os
import random
from collections.abc import Iterable
import pytest
from pydantic import ValidationError
from pyproj import CRS
import morecantile
from morecantile.commons import Tile
from morecantile.errors import InvalidIdentifier
from morecantile.models import Ti... |
import uuid as uuid_module
from enum import IntEnum
from typing import Iterable, List, Union
from django.utils.translation import ugettext_lazy as _
from rest_framework.serializers import Serializer
from .settings import DYNAMICFORMS
class ActionBase(object):
def __init__(self, action_js: str, name: Union[str,... |
import re
from typing import List
from SPARQLWrapper import SPARQLWrapper, JSON
from fastapi import Response
from fastapi.responses import JSONResponse
from fastapi.templating import Jinja2Templates
from pyldapi import ContainerRenderer, RDF_MEDIATYPES
from rdflib import Graph, Literal, URIRef
from rdflib.namespace im... |
'''
exec(open('DEU.py').read())
15/3/2020-12/6/2021
'''
import os, datetime
import numpy as np
import pandas as pd
from bs4 import BeautifulSoup
from importlib import reload
import utils
allowed_values = \
['Baden-Württemberg', 'Bayern', 'Berlin', 'Brandenburg', 'Bremen',
'Hamburg', 'Hessen', 'Mecklenburg-Vor... |
import os
from pkg_resources import parse_version
import numpy as np
import matplotlib
import matplotlib.pylab as plt
if os.environ.get('QT_API', None)=='pyqt':
from PyQt4 import QtGui, QtCore
elif os.environ.get('QT_API', None)=='pyside':
from PySide import QtGui, QtCore
else:
raise ImportError('QT_API ... |
# Copyright (2015-2017) Hewlett Packard Enterprise Development LP
# Copyright (2015-2017) Universidade Federal de Campina Grande
# 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 ... |
"""Tests for :mod:`katsdpcal.calprocs_dask`."""
import unittest
import numpy as np
import dask.array as da
from katsdpcal import calprocs, calprocs_dask
from . import test_calprocs
def as_dask(arr):
return da.from_array(arr, chunks=arr.shape)
def unit(value):
return value / np.abs(value)
class TestStef... |
import xlrd
import xlwt
import os
import random
import cv2
import numpy as np
from PIL import Image, ImageDraw, ImageFont
from multiprocessing import Pool
from tqdm import tqdm
from PIL.ExifTags import TAGS
import exifread
def get_path(root):
"""
:param root: 根目录的路径
:return: 最后一级文件夹的所有路径
"""
path_... |
import os
import sys
import warnings
import pydicom as dicom
import numpy as np
import sqlalchemy as sq
from sqlalchemy.orm import relationship
from sqlalchemy import create_engine
from sqlalchemy.orm import sessionmaker
from ._Base import Base
import matplotlib.pyplot as plt
from matplotlib.widgets import Slider, C... |
import json
import os
import tempfile
import unittest
from decimal import Decimal
from io import StringIO
from django.core.management import call_command
from django.core.management.base import CommandError
from django.test import TestCase
import mock
from countylimits.data_collection.county_data_monitor import (
... |
import datetime
import logging
import sys
from contextlib import contextmanager
import dateutil
import lazy_object_proxy
import pendulum
from airflow.models import TaskInstance
from airflow.models.baseoperator import BaseOperator
from airflow.models.dag import DAG
from airflow.models.dagbag import DagBag
from airflow.... |
import sys
import os
import time
import datetime
import random
import json
import argparse
import numpy as np
import torch
import torch.nn as nn
import torch.nn.functional as F
from torch_geometric.data import DataLoader
from preparation.preprocess_dataset import load_resource_labels
from preparation.preprocess_datas... |
# -*- coding: utf-8 -*-
# @Author: Jie
# @Date: 2017-04-25 11:07:00
# @Last Modified by: <NAME>, Contact: <EMAIL>
# @Last Modified time: 2018-08-30 16:26:39
import re
import sys
import numpy as np
from .metric4ann import *
import copy
def lines_to_label_list(input_lines):
label_list = []
label = []
... |
#! /usr/bin/env python3
#
# BuildPyCBL.py
#
# Copyright (c) 2019 Couchbase, Inc All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE... |
# forbiddenfruit - Patch built-in python objects
#
# Copyright (c) 2013,2019 <NAME> <<EMAIL>>
#
# This program is dual licensed under GPLv3 and MIT.
#
# GPLv3
# -----
# 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... |
#! /usr/bin/python
# -*- coding: utf-8 -*-
import tensorflow as tf
from tensorflow.python.training import moving_averages
from tensorflow.python.framework import ops
from tensorflow.python.ops import math_ops
from tensorlayer.layers.core import Layer
from tensorlayer.layers.core import LayersConfig
from tensorlayer.l... |
# mypy: ignore-errors
#
# This source file is part of the EdgeDB open source project.
#
# Copyright 2010-present MagicStack Inc. and the EdgeDB 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 ... |
# coding: utf-8
from typing import List
from collections import OrderedDict
from datetime import datetime
import pandas as pd
import traceback
from .objects import Mark, Direction, BI, FX, RawBar, NewBar
from .utils.echarts_plot import kline_pro
from .signals import check_five_fd, check_seven_fd, check_nine_fd, Signal... |
import pytest
from .common import SoftMod, typing as t, Rules
from .types_attrs_common import Hooks, T, U
from json_syntax import attrs as at
from json_syntax import std
from json_syntax.helpers import JSON2PY, PY2JSON, INSP_PY, INSP_JSON
import attr
from collections import namedtuple
from typing import Tuple, Gener... |
"""
This file contains the main trainer class that's in charge of training and prediction, as well as helper functions.
"""
import random
import sys
import numpy as np
from collections import Counter
import torch
from torch import nn
import torch.nn.init as init
import stanza.models.common.seq2seq_constant as constan... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.