text stringlengths 3.07k 22.1k |
|---|
__author__ = 'Henri_Shih'
__version__ = '2.0.0'
import requests
from lxml import etree
import time
import sys
import json
import csv
import xlwt
"""
Description :
This is a cmd interface web crawler for fetching best sale items on yahoo platform
Prerequisite :
Simply run pip install -r requirements.txt to install a... |
# See End Of File For Licensing
import inspect
import itertools
from .utils import Sentinel
from .base import Model, Control
__all__ = ["Structure", "List", "Dict", "Set", "Object", "Undefined"]
Undefined = Sentinel("Undefined")
class Structure(Model):
def _notify_model_views(self, events):
for e in... |
import numpy as np
import matplotlib.pyplot as plt
from tensorflow.keras.preprocessing.image import ImageDataGenerator
import tensorflow as tf
# Runtime data augmentation
def get_augmented(
X_train,
Y_train,
X_val=None,
Y_val=None,
batch_size=32,
seed=0,
data_gen_args = dict(
rot... |
from __future__ import absolute_import
import json
import math
import os
import requests
import warnings
from collections import namedtuple
from navmplot.color_dicts import mpl_color_map, html_color_codes
from navmplot.naver_maps_templates import SYMBOLS, CIRCLE, TEXT, MAP, POLYLINE, COORD, MARKER
Symbol = namedtup... |
"""
MIT License
Copyright (c) 2017 <NAME>; <NAME>; <NAME>; <NAME>; <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, copy... |
# Copyright 2021 DeepMind Technologies Limited. 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 ... |
import tensorflow as tf
from model import sigmoid_kl_with_logits
from ops import variables_on_gpu0
from ops import avg_grads
from model import read_and_decode_with_labels
from model import get_vars
IMSIZE = 128
filename = '/media/NAS_SHARED/imagenet/imagenet_train_labeled_' + str(IMSIZE) + '.tfrecords'
def build_mode... |
import csv
import requests
import json
from requests_toolbelt.utils import dump
from time import sleep
# This is the name for the file where the data is saved, as well as the path
# The path specifies that the .txt files should be stored in the data/testing folder
# Also, text after a "#" sign won't be evaluated as co... |
from asyncio import Queue
import pytest
from aiostream import stream
from pytest import fixture
from typing import Tuple, List, AsyncIterator
from core.analytics import InMemoryEventSender
from core.cli.model import ParsedCommands, ParsedCommand
from core.cli.cli import CLI, multi_command_parser
from core.cli.model i... |
#!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright: (c) 2015, Hewlett-Packard Development Company, L.P.
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
DOCUMENTATION = r'''
---
module... |
import torch
import torch.nn as nn
from torch.autograd import Variable
import torch.optim as optim
import numpy as np
import torch.nn.init as init
from sklearn.preprocessing import MinMaxScaler
import sys
from tqdm import tqdm
def weights_init(m):
classname = m.__class__.__name__
if classname.find('Linear') !... |
"""
Common classes for service and gateway transformation, which makes
the construction of the expected data map easier.
"""
from typing import Dict, List, Iterable, Sequence, Literal, Optional, Any, cast
from ..log import debug
from ..validation import validate_proxy_input
class HeaderQueryMatcher:
"""Matches ... |
from __future__ import print_function
from pymongo import MongoClient
from results import es_search
import os
import conf as con
import json
import nltk
import gensim
import logging
import requests
import redis
import re
import itertools
import math
import multiprocessing
class Vocabulary:
def _... |
# It is assumed the initial minting will give some tokens to the Sovrin
# Foundation and sovtoken seller platform. From then on, exchange will be
# responsible for giving tokens to "users".
import pytest
from plenum.common.exceptions import (RequestNackedException,
RequestRejected... |
"""
File : utils.py
Start Date : 19971217
Refactor Date : 20180514
Description : General utility functions
$Id: utils.py 953 2018-05-14 05:28:21Z phillips.ryan $
"""
__version__ = '$Revision: 953 $'
__copyright__ = 'Copyright (c) Ryan Phillips 2018'
__author__ = '<NAME>; <NAME>'
__author_... |
#!/usr/bin/env python
#
# test_bgp_multiview_topo1.py
# Part of NetDEF Topology Tests
#
# Copyright (c) 2016 by
# Network Device Education Foundation, Inc. ("NetDEF")
#
# Permission to use, copy, modify, and/or distribute this software
# for any purpose with or without fee is hereby granted, provided
# that the above ... |
"""
Generate thumbnails for n-dimensional images in S3.
Uses `aicsimageio.AICSImage` to read common imaging formats + some supported
n-dimensional imaging formats. Stong assumptions as to the shape of the
n-dimensional data are made, specifically that dimension order is STCZYX, or,
Scene-Timepoint-Channel-SpacialZ-Spa... |
#level.dept.number.name
#"undergrad"."CSCI".3381."Object-Oriented Software Development with Java"
import requests
from bs4 import BeautifulSoup
import re
class Course:
dept:str
number:str
name:str
desc:str
reqs:list
classification:str
supertype:str
credithours:str
... |
# Copyright 2019-2022 Cambridge Quantum Computing
#
# 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... |
# flatten_cell_def_xml.py - convert a PhysiCell_settings.xml with inheritance of <cell_definitions>
# into one without inheritance, i.e., verbose leaf <cell_definition>s.
#
#
# Author: <NAME>
#
import xml.etree.ElementTree as ET
import sys
import string
xml_file = "PhysiCell_settings.xml"
argc = ... |
import os
import re
from subprocess import CalledProcessError
from time import time
from mock import MagicMock, Mock, call
import pytest
from autopip.utils import run
from autopip.constants import PYTHON_VERSION
def test_autopip_help(autopip, capsys):
autopip('', raises=SystemExit)
stdout, stderr = capsys.r... |
# ************************************************
# |docname| - Provide feedback for student answers
# ************************************************
#
# Imports
# =======
# These are listed in the order prescribed by `PEP 8
# <http://www.python.org/dev/peps/pep-0008/#imports>`_.
#
# Standard library
# -------------... |
# -*- coding: utf-8 -*-
# Copyright 2012-2013 UNED
#
# 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... |
## Algorithme d'évolution de réseaux de neurones
## Ces réseaux sont représentés sous la forme d'un graphe orienté
import matplotlib.pyplot as plt
import numpy as np
import copy
import networkx as nx
from math import *
from PIL import Image
import os
##Hyperparamètres
ALPHA = 0.1
TAILLE = 25 #nombre de couches virtuel... |
import osmapi
import pandas as pd
import numpy as np
# calculate surface area
from area import area
def manual_classify_building(building_type):
"""
Adopt manual classification from the paper and add further tags
'Estimation of Building Types on OpenStreetMap Based on Urban Morphology Analysis'
"... |
# Copyright (C) 2020 GreenWaves Technologies, SAS
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
# This progr... |
#brailleDisplayDrivers/brailliantB.py
#A part of NonVisual Desktop Access (NVDA)
#This file is covered by the GNU General Public License.
#See the file COPYING for more details.
#Copyright (C) 2012-2017 NV Access Limited, Babbage B.V.
import time
import serial
import braille
import inputCore
from logHandler ... |
#!/usr/bin/env python
#
# Copyright (c) 2017 Palo Alto Networks, Inc. <<EMAIL>>
#
# Permission to use, copy, modify, and distribute this software for any
# purpose with or without fee is hereby granted, provided that the above
# copyright notice and this permission notice appear in all copies.
#
# THE SOFTWARE IS PROV... |
#
# Written by <NAME> (July 2011)
#
from . import Command, SigHandler
from .. import IMAP4Control, DBControl, conf
from ..util import *
import logging
import socket
def store(op, queue):
count = len(queue)
while queue:
op.store(queue.popleft())
return count
def check_abort(op):
if sig.abort:
op.commit()
... |
# Copyright 2020 DeepMind Technologies Limited.
#
#
# 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 agre... |
"""
Methods for decoding unthresholded brain maps into text.
"""
import inspect
import logging
import nibabel as nib
import numpy as np
import pandas as pd
from nilearn.masking import apply_mask
from .. import references
from ..base import Decoder
from ..due import due
from ..meta.mkda import MKDAChi2
from ..stats im... |
#################################################################################
# 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... |
# Do the necessary imports
import argparse
import shutil
import base64
from datetime import datetime
import os
import cv2
import numpy as np
import socketio
import eventlet
import eventlet.wsgi
from PIL import Image
from flask import Flask
from io import BytesIO, StringIO
import json
import pickle
import matplotlib.ima... |
#!/usr/bin/env python
"""Generate JA3 fingerprints from PCAPs using Python."""
import argparse
import dpkt
import json
import socket
import binascii
import struct
import os
from hashlib import md5
__author__ = "<NAME>"
__copyright__ = "Copyright (c) 2017, salesforce.com, inc."
__credits__ = ["<NAME>", "<NAME>", "<NAM... |
# Copyright (c) 2020 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 re
from datetime import datetime
from unittest import TestCase
from difflib import SequenceMatcher
import logging
from kqml.kqml_performative import KQMLPerformative
logging.basicConfig(format='%(levelname)s: %(name)s - %(message)s',
level=logging.INFO)
logger = logging.getLogger('integration... |
# coding=utf-8
"""
Module for invoking main bot scripts.
Most main scripts define a preset list of `scenarios` from which the user
must choose from. Each scenario has a predetermined configuration that will
used for training that skill. For example, the `varrock-east-mine` scenario
for the `miner` script is configured... |
# -*- coding: utf-8 -*-
import operator
from os import makedirs
from os.path import exists
import argparse
from src.configs import *
import pickle
import numpy as np
import re
from random import shuffle
import string
import struct
import io
def run(d_type, d_path):
prepare_deepmind(d_path)
stop_words = {"-lrb-", "-... |
import re
import json
import asyncio
import logging
import functools
from random import choice
from typing import Union, Optional, List
from time import time
from pyrogram.raw.functions.messages import DeleteScheduledMessages
from pyrogram.raw.functions.messages import Search
from pyrogram.raw.types.messages import ... |
#!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2013, <NAME> <<EMAIL>>
# Based on okpg (<NAME> <<EMAIL>>), pacman
# (Afterburn) and pkgin (Shaun Zinck) modules
#
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_functio... |
""" This file is based on https://github.com/philtabor/Actor-Critic-Methods-Paper-To-Code/blob/master/DDPG """
import numpy as np
import torch as T
import torch.nn.functional as F
import torch.nn as nn
import torch.optim as optim
from rl_algorithms.replay_memory.continuous_replay_memory import ReplayBuffer
from .int... |
import csv
import hashlib
import inspect
import json
import logging
import os
from io import open
import cachetools
from common import ACHILLES_TABLES, ACHILLES_HEEL_TABLES, VOCABULARY_TABLES, PROCESSED_TXT, RESULTS_HTML, FITBIT_TABLES
LOGGER = logging.getLogger(__name__)
base_path = os.path.dirname(
os.path.ab... |
"""Lambda function handler."""
# must be the first import in files with lambda function handlers
import time
import traceback
import lambdainit # noqa: F401
import json
from typing import List
import lambdalogging
from clients.comprehend_client import ComprehendClient
from clients.s3_client import S3Client
from clie... |
# -*- coding: utf-8 -*-
# @Author: <NAME>
# @Created Time: 7/7/2020 8:34 PM
import math
import torch
import torch.nn as nn
from torch import Tensor
import torch.nn.functional as F
from src.datasets import documents
class GraphLearningLayer(nn.Module):
def __init__(self, in_dim: int, learning_dim: int, gamma: f... |
"""Facility to render node graphs using pydot"""
import os
import subprocess
import tempfile
import threading
import pydot
from logbook import Logger
from kitchen.settings import STATIC_ROOT, REPO, COLORS
from kitchen.backends.lchef import get_role_groups
log = Logger(__name__)
def get_role_relations(env, roles, e... |
# Owner(s): ["oncall: distributed"]
import functools
import sys
import torch
import torch.distributed as dist
import torch.nn as nn
from torch.distributed._fsdp import FullyShardedDataParallel
from torch.distributed._fsdp.fully_sharded_data_parallel import TrainingState_
from torch.testing._internal.common_distribute... |
"""
This tutorial shows how to generate adversarial examples using FGSM
and train a model using adversarial training with Keras.
The original paper can be found at:
https://arxiv.org/abs/1412.6572
"""
# pylint: disable=missing-docstring
from __future__ import absolute_import
from __future__ import division
from __futur... |
# -*- coding: utf-8 -*-
#
# Copyright (C) 2016-2019 Edgewall Software
# All rights reserved.
#
# This software is licensed as described in the file COPYING, which
# you should have received as part of this distribution. The terms
# are also available at http://trac.edgewall.org/wiki/TracLicense.
#
# This software consi... |
import sys
import time
import socket
import threading
import random
import datetime
from MainWin import HeartbeatPort, NotifyPort
from Utils import readDelimitedData
from AutoDetect import GetDefaultHost
DEFAULT_HOST = GetDefaultHost()
from xml.dom.minidom import parseString
CmdPort = 53161
testTags = '''e200101886... |
#!/usr/bin/env python3
# Copyright (c) Meta Platforms, Inc. and affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import enum
import itertools
from typing import Iterable, List, NamedTuple, Optional, Tuple, Union
class Action(enu... |
#!python3
# License: Apache 2.0. See LICENSE file in root directory.
# Copyright(c) 2020 Intel Corporation. All Rights Reserved.
#
# Syntax:
# unit-test-config.py <dir> <build-dir>
#
# Looks for possible single-file unit-testing targets (test-*) in $dir, and builds
# a CMakeLists.txt in $builddir to compile them.... |
# Copyright (C) 2007-8 <NAME> <<EMAIL>>
#
# This software may be used and distributed according to the terms of the
# GNU General Public License version 2 or any later version.
"""hooks for integrating with the CIA.vc notification service
This is meant to be run as a changegroup or incoming hook. To
configure it, set... |
'''
common XBMC Module
Copyright (C) 2011 t0mm0
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
Th... |
# Copyright 2011 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
#
# Unless req... |
# -*- coding: utf-8 -*-
# Copyright 2015 Yelp 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 ... |
from utils import*
from crystals import Crystal
from blochwave import bloch as bl;imp.reload(bl)
from scattering import scattering_factors as scatf ;imp.reload(scatf)
from utils import pytest_util
import pytest,os,copy
plt.close('all')
keV=200
try:
out,ref,dir = pytest_util.get_path(__file__)
path=out+'/felix... |
"""
Filters joint involvement data to treatment-naive patients diagnosed up to one
year after symptom onset who have joint involvement at baseline.
Patients must also not be withdrawn at any point from the study.
"""
import click
import feather
import pandas as pd
from logging import *
def load_data(basic_path: st... |
from argparse import ArgumentParser
from typing import Tuple
import torch
from torch import Tensor
from lasaft.source_separation.conditioned.cunet.dcun_base import Dense_CUNet, Dense_CUNet_Framework
from lasaft.source_separation.sub_modules.control_models import dense_control_block, film_control_model
from lasaft.uti... |
import sys
import os
import torch
import torch.nn as nn
import numpy as np
# import torchvision
from torch.utils.data import DataLoader
from datetime import datetime
import random
import argparse
from utils import *
def parse_args():
parser = argparse.ArgumentParser()
parser.add_argument(... |
# Copyright 2015 The Meson development team
# 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 ... |
import numpy as np
from .._mesh import Mesh, CellBlock
from .._helpers import register
def debugger(line, content):
debugger1 = content[line - 1]
debugger2 = content[line]
debugger3 = content[line + 1]
return debugger1, debugger2, debugger3
def _read_commented_int(line, content):
d1, d2, d3 = ... |
#
# Copyright (C) Orange
#
# This software is distributed under the terms and conditions of the 'MIT'
# license which can be found in the file 'LICENSE.md' in this package distribution
import sys
import json
import time
import LiveObjects
INT = "i32"
UINT = "u32"
BINARY = "bin"
STRING = "str"
FLOAT = "f64"
INFO = "IN... |
#!/usr/bin/env python
from __future__ import division
import cv2
import os
import numpy as np
from evaluation import OneTimeEvalBase
from analysis import (create_analyzer, RenderForegroundAnalyzer,
RenderOrientationAnalyzer)
from experiment import EvalExperimentBase
from cmd_args_parser import E... |
#!/usr/bin/env python
#
# This script can be used for any purpose without limitation subject to the
# conditions at http://www.ccdc.cam.ac.uk/Community/Pages/Licences/v2.aspx
#
# This permission notice and the following statement of attribution must be
# included in all copies or substantial portions of this script.
#
... |
import math
import magent
import numpy as np
animation_total = 2
animation_stop = 0
background_rgb = (255, 255, 255)
attack_line_rgb = (0, 0, 0)
attack_dot_rgb = (0, 0, 0)
attack_dot_size = 0.3
text_rgb = (0, 0, 0)
text_size = 16
text_spacing = 3
banner_size = 20
banner_spacing = 3
bigscreen_size = 72
bigscreen_spacin... |
import pytest
import skein
from skein.exceptions import ConnectionError
from skein.test.conftest import run_application, wait_for_containers
requests = pytest.importorskip('requests')
simplehttp = skein.Service(resources=skein.Resources(memory=128, vcores=1),
commands=['/usr/bin/python -m... |
"""
This add-on will monitor a website for documents and upload them to your DocumentCloud account
"""
import cgi
import json
import mimetypes
import os
import urllib.parse as urlparse
from datetime import datetime
import requests
from bs4 import BeautifulSoup
from documentcloud.addon import CronAddOn
from documentc... |
import io
import json
import wget
import pickle
import os
import torch
import torch.nn as nn
import torch.nn.functional as F
import numpy as np
import PIL.Image
from transformers import LxmertForQuestionAnswering, LxmertForPreTraining, LxmertTokenizer, LxmertConfig
from transformers import AutoModel
from common.modu... |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import tensorflow as tf
from utils import common_utils
def post_layers(x, y, hparams):
layer_norm(x, filters=None, epsilon=hparams.norm_epsilon, name=None, reuse=None)
#############################... |
# -*- coding: utf-8 -*-
"""
Created on Thu Aug 16 22:20:37 2018
@author: <NAME>
"""
import dlib
import cv2
import numpy as np
def landmarks_to_np(landmarks, dtype="int"):
# 获取landmarks的数量
num = landmarks.num_parts
coords = np.zeros((num, 2), dtype=dtype)
for i in range(0, num):
coords[i] = ... |
# Copyright 2020 The StackStorm Authors.
# Copyright 2019 Extreme Networks, 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 ... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (c) 2021 Huawei Device 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
#
#... |
"Stress test diskcache.core.Cache."
from __future__ import print_function
import collections as co
from diskcache import Cache, UnknownFileWarning, EmptyDirWarning, Timeout
import multiprocessing as mp
import os
import random
import shutil
import sys
import threading
import time
import warnings
try:
import Queue... |
import os
import sys
import logging
import sys
import mrcfile
from IsoNet.preprocessing.cubes import create_cube_seeds,crop_cubes,DataCubes
from IsoNet.preprocessing.img_processing import normalize
from IsoNet.preprocessing.simulate import apply_wedge1 as apply_wedge
from multiprocessing import Pool
import numpy as n... |
# -*- coding: utf-8 -*-
"""
Created on Wed Dec 8 13:45:36 2021
@author: gdaniel
"""
from keras.models import Sequential, Model
from keras.layers import Dense, Conv3D, Input, Flatten, AveragePooling3D, \
MaxPooling3D, BatchNormalization, Activation, Dropout, LeakyReLU, \
UpSampling1D, merge
from ke... |
import hashlib
import logging
import struct
import time
from binascii import hexlify, unhexlify
from collections import OrderedDict
from datetime import datetime
import ecdsa
from .account import PrivateKey, PublicKey
from .chains import known_chains
from .operations import Operation, GrapheneObject, isArgsThisClass
... |
"""Provides 'tracking', which loads and parses tracking benchmark data."""
import datetime as dt
import glob
import os
from collections import namedtuple
import pandas as pd
import numpy as np
import pykitti2.utils as utils
import cv2
try:
xrange
except NameError:
xrange = range
__author__ = "<NAME>"
__ema... |
from torch.utils.data import Dataset
from utils import read_pfm
import os
import numpy as np
import cv2
from PIL import Image
import torch
from torchvision import transforms as T
import torchvision.transforms.functional as F
def colorjitter(img, factor):
# brightness_factor,contrast_factor,saturation_factor,hue_f... |
# Copyright 2014 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""
Unit tests for the contents of device_utils.py (mostly DeviceUtils).
"""
# pylint: disable=W0212
# pylint: disable=W0613
import functools
import random... |
import random
from PIL import Image, ImageDraw
import numpy as np
import csv
import math
def ReadKeys(image: Image) -> list:
"""Input an image and its associated SIFT keypoints.
The argument image is the image file name (without an extension).
The image is read from the PGM format file image... |
# pylint: disable=no-member
# FIXME: Remove `disable=no-member` when fixed (see https://github.com/PyCQA/pylint/issues/4577)
import itertools
import os
import re
from io import StringIO
from pathlib import Path
from typing import List, Optional, Set, Union
import pandas as pd
from loguru import logger
# TODO: Add co... |
"""
A climate platform that adds support for Midea air conditioning units.
For more details about this platform, please refer to the documentation
https://github.com/mac-zhou/midea-ac-py
This is still early work in progress
"""
import logging
import voluptuous as vol
from datetime import timedelta
impo... |
from __future__ import unicode_literals
import hashlib
import hmac
import re
import time
from .common import InfoExtractor
from ..compat import compat_str
from ..utils import (
ExtractorError,
js_to_json,
int_or_none,
parse_iso8601,
try_get,
unescapeHTML,
update_url_query,
)
class ABCIE(... |
"""
This module provides common classes to document APIs.
The purpose of these classes is to provide an abstraction layer on top of a specific
set of rules to document APIs. For example, it should be possible to generate both
OpenAPI Documentation v2 and v3 (currently only v3 is supported) from these types, and
potent... |
#!/usr/bin/env python3
"""Helper script to make a release."""
import re
import os
import sys
import glob
import logging
import argparse
import subprocess
from pathlib import Path
from datetime import datetime
from packaging.version import Version, InvalidVersion
import api
_LOGGER = logging.getLogger(__name__)
CHAN... |
import datetime
import functools
import logging
import os
import sys
import click
import pkg_resources
from appdirs import AppDirs
from click._termui_impl import Editor
from .. import __version__
from ..aliases import aliases_database
from ..plugins import plugins_registry
from ..projects import ProjectsDb
from ..set... |
# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.
# Lean CLI v1.0. Copyright 2021 QuantConnect Corporation.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at http://www.apache... |
from django.utils.translation import ugettext_lazy as _
from oscar.apps.basket import signals
from oscar.core.loading import get_model, get_class
from rest_framework import status, generics, exceptions
from rest_framework.response import Response
from rest_framework.views import APIView
from oscarapi import permissi... |
"""Data Acquisition Client"""
import logging
import multiprocessing
from multiprocessing import Queue
import time
from bcipy.acquisition import buffer_server
from bcipy.acquisition.record import Record
from bcipy.acquisition.util import StoppableProcess
from bcipy.acquisition.marker_writer import NullMarkerWriter, Lsl... |
from typing import Optional, Union
import numpy as np
from scipy.sparse import issparse, spmatrix
from scipy.sparse.linalg import LinearOperator, svds
from sklearn.utils import check_array, check_random_state
from sklearn.utils.extmath import svd_flip
from anndata import AnnData
from .. import logging as logg
from .... |
# -*- coding: utf-8 -*-
# Copyright (c) 2016-2021 by University of Kassel and Fraunhofer Institute for Energy Economics
# and Energy System Technology (IEE), Kassel. All rights reserved.
import numpy as np
from scipy.sparse import csr_matrix, vstack, hstack
from scipy.sparse.linalg import spsolve
from pandapower.est... |
# **********************************************************************************************************************
#
# brief: script to perform hyper parameter optimization
#
# author: <NAME>
# date: 02.06.2020
#
# ******************************************************************************************... |
from django.db import models
from abstracts.models import TimeStamp
from configurations.models import CategorySalesRank
class Supplier(TimeStamp):
name = models.CharField(max_length=255)
website = models.CharField(max_length=255, default='', blank=True)
def __str__(self):
return f'<Supplier: {sel... |
"""
The MIT License (MIT)
Copyright (c) 2017 <NAME> (github.com/kanflo)
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, ... |
# Copyright (c) Facebook, Inc. and its affiliates. All rights reserved.
from typing import List, Union
import torch
"""
Util functions containing representation transforms for points/verts/faces.
"""
def list_to_padded(
x: List[torch.Tensor],
pad_size: Union[list, tuple, None] = None,
pad_value: float... |
# Copyright 2018 The TensorFlow 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 applica... |
#!/usr/bin/env python
# Copyright 2014, Rackspace US, 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... |
from IPython.display import display, HTML
#import difflib
import requests
from bs4 import BeautifulSoup
import builtins
from .logger import log
from .liberr import KogiError
_lines = None
_outputs = None
def input(s=''):
global _lines
if _lines is not None and len(_lines) > 0:
return _lines.pop(0)
... |
# Copyright (C) 2017 Google Inc.
# Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file>
from collections import namedtuple
from flask import g
from flask.ext.login import current_user
from .user_permissions import UserPermissions
from ggrc.app import db
from ggrc.rbac.permissions import permiss... |
# coding:utf8
from datetime import datetime
from app import db
class User(db.Model):
"""
Informations of users.
"""
__tablename__ = "user"
# __table_args__ = {'extend_existing': True}
id = db.Column(db.Integer, primary_key=True) # user number
name = db.Column(db.String(100), unique=True) ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.