text stringlengths 3.07k 22.1k |
|---|
# -*- coding: utf-8 -*-
### Author: <NAME>
import fileinput
import operator
import os
import sys
from math import sqrt
class OutlierDetectionCluster:
# Class modeling a cluster of the dataset, composed of its topic name, its corresponding elements and the outliers to be detected
def __init__(se... |
"""
Author: The Python Team
License: The Python License
Source: http://svn.python.org/projects/sandbox/trunk/ttk-gsoc/samples/ttkcalendar.py
"""
try:
import Tkinter as tk
import ttk
import tkFont
except ImportError:
import tkinter as tk
from tkinter import ttk
from tkinter import font as tkFont
... |
import sys
import os
import subprocess
import socket
try:
from PyQt5.QtWidgets import *
from PyQt5.QtCore import *
from PyQt5.QtGui import *
except ImportError:
from PySide2.QtWidgets import *
from PySide2.QtCore import *
from PySide2.QtGui import *
ROOT = r'\\File-share\DATA\PROPS\C4D\MODELS'... |
import logging
import torch.nn as nn
from ..utils import conv1x1_group, conv3x3_group, \
norm_layer, kaiming_init, constant_init, load_checkpoint
from ..registry import BACKBONES
class LinearBottleNeck(nn.Module):
def __init__(self,
inplanes,
outplanes,
expa... |
# coding = utf-8
import numpy as np
import os
from keras.preprocessing.sequence import pad_sequences
from keras.utils.np_utils import to_categorical
embedding_file = 'data/char_embedding_matrix.npy'
def get_char_tag_data(file_path):
"""
获取字符 和对应的标签
:param file_path:
:return:
"""
with open(fil... |
#used for the main program
import threading
import json
import os
#discord stuff imported
import discord #gets the discord and asyncio librarys
import asyncio
import time
#irc stuff
import pydle
discordMSG = []
#irc
customStart = ""
##broken
#seems to not like my code in the discordCheckMsg function
##its the... |
"""A module containing scripts that run demonstrative examples of the
Voronoi Cell Finite Element Method package (vcfempy). This can be
run as a standalone script since it has the __name__ == '__main__' idiom.
"""
import os
import sys
# add relative path to package, in case it is not installed
sys.path.insert(0, os.... |
# -*- coding: utf-8 -*-
# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved
"""
This file registers pre-defined datasets at hard-coded paths, and their metadata.
We hard-code metadata for common datasets. This will enable:
1. Consistency check when loading the datasets
2. Use models on these stand... |
# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved
import atexit
import bisect
import multiprocessing as mp
from collections import deque
import cv2
import torch
from abandoned_bag_heuristic import SimpleTracker
from detectron2.data import MetadataCatalog
from detectron2.engine.defaults import Def... |
"""
Test the database module
"""
# pylint: disable=missing-docstring
# method names are more useful for testing
# pylint: disable=invalid-name
import os
import unittest
import sqlite3
import logging
from decimal import Decimal
from datetime import date, datetime
from zoom.database import database
import warnin... |
#!/usr/bin/env python3
"""
Adapted from https://git.wur.nl/wijfj001/hecaton/-/blob/master/scripts/convert/bedpe_to_vcf.py
Convert BEDPE file containing SV calls to VCF
"""
import argparse
import datetime
import os
import sys
import pandas as pd
import twobitreader as twobit
working_dir = '/Users/lsantuari/Documents... |
# -*- coding:utf-8 -*-
__author__ = 'mgaldieri'
import uuid
import numpy as np
from pyaffective.emotions import OCC, OCEAN
class InfluenceValue:
DIRECT = 1
INVERSE = -1
def __init__(self, weight=1.0, relation=None):
self.weight = weight
self.relation = relation if relation else Influen... |
# Lint as: python3
"""The inverse kinematic utilities."""
from typing import Optional, Sequence
import numpy as np
from pybullet_utils import bullet_client
_IDENTITY_ROTATION_QUAT = (0, 0, 0, 1)
_IK_SOLVER_TYPE = 0
_LINK_POS_INDEX = 0
def joint_angles_from_link_positions(
pybullet_client: bullet_client.BulletC... |
"""Classes to represent Packet Filter Tables."""
import re
import time
from socket import *
from ctypes import *
from pf.constants import *
from pf._struct import *
from pf._base import PFObject
from pf._utils import ctonm, nmtoc
__all__ = ['PFTableAddr',
'PFTable',
'PFTStats']
class PFTable... |
"""This module encapsulates the tecnique used to maintain locks."""
import uuid
import json
import copy
import socket
from lynk.utils import TimeUtils
from lynk.exceptions import LockNotGrantedError
from lynk.exceptions import LockAlreadyInUseError
from lynk.exceptions import LockLostError
from lynk.exceptions import ... |
import copy
import os
import numpy as np
from ppqm import chembridge, constants, linesio, shell
from ppqm.calculator import BaseCalculator
MNDO_CMD = "mndo"
MNDO_ATOMLINE = "{atom:2s} {x} {opt_flag} {y} {opt_flag} {z} {opt_flag}"
class MndoCalculator(BaseCalculator):
def __init__(self, cmd=MNDO_CMD, scr=consta... |
# Copyright (c) Trainline Limited, 2016-2017. All rights reserved. See
# LICENSE.txt in the project root for license information.
import os
import re
import stat
from jsonschema import Draft4Validator
from deployment_stages.common import wrap_script_command, script_is_file
from .healthcheck_utils import Heal... |
# -*- coding: utf-8 -*-
from __future__ import print_function, division
import argparse
import torch
import torch.nn as nn
import torch.optim as optim
from torch.optim import lr_scheduler
from torch.autograd import Variable
from torchvision import datasets, transforms
import torch.backends.cudnn as cudnn
import matpl... |
"""
Function to scores from a given pandas.DataFrame, numpy.ndarray.
Score | numpy, pandas, torch
Author: <NAME>
Version: v0.1
Create Date: 2020/9/27
"""
import os
import numpy as np
import pandas as pd
import torch
import torch.nn.functional as F
from sugar.database import VerificationTrials
import joblib
from jobli... |
import os
import glob
import numpy as np
from PIL import Image
from skimage import io
import skimage
import skimage.transform
from tqdm import tqdm
import torchvision
basic_path = "//home1//xiaotao//dataset//potsdam_processing//"
train_txt = "/home1/xiaotao/dataset/potsdam_processing/train.txt"
test_txt = "/home1/xia... |
#!/usr/bin/env python
"""
Functions and classes useful for operating a headless device e.g. Raspberry Pi or Intelligent Edge Gateway
"""
__version__ = "1.0.0"
import time
import inspect
import logging
from logging.handlers import RotatingFileHandler
import threading
import serial.tools.list_ports
def is_logger(log):... |
""" xmlhttp controllers, usefull for testing
"""
import py
from pypy.rpython.ootypesystem.bltregistry import BasicExternal, MethodDesc
from pypy.translator.js.examples.bnb.servermessage import log, ServerMessage,\
PMSG_INLINE_FRAME, PMSG_DEF_ICON
from pypy.translator.js.examples.bnb.msgstruct import *
from pypy.... |
from django.shortcuts import get_object_or_404
from rest_framework import generics, status, permissions
from rest_framework.response import Response
from rest_framework.permissions import IsAuthenticated, AllowAny
from authors.apps.authentication.models import User
from authors.apps.profiles.exceptions import ProfileD... |
"""
AVL Implementation of Binary Tree.
Subclasses can override key methods for customizing methods in
BinaryTree (newNode) and BinaryNode (newNode, compareTo). For now,
these support standard <= and >= semantics
"""
class BinaryNode:
def __init__ (self, value = None)... |
#!/usr/bin/env python
'''Plotting helper functions
'''
#Python standard import
from itertools import combinations
#Third party import
import numpy as np
import matplotlib.pyplot as plt
import matplotlib as mpl
import matplotlib.cm as cm
from mpl_toolkits.mplot3d import Axes3D
import pyorb
#Local import
from .. im... |
#!/usr/bin/env python
# coding=utf-8
from __future__ import division, print_function, unicode_literals
from collections import OrderedDict
from brainstorm.layers.base_layer import Layer
from brainstorm.structure.buffer_structure import (BufferStructure,
StructureTemp... |
import re
from typing import Tuple, List
import dynet_config
dynet_config.set(autobatch=1, mem="2048")
from itertools import chain
import dynet as dy
import numpy as np
from data.reader import DataReader
from eval.bleu.eval import BLEU
from planner.planner import Planner
from scorer.scorer import get_relations
fr... |
VERBOSE = True
import pandas as pd
import json
from box import Box
from bunch import Bunch
import copy
import random
import numpy as np
import tensorflow as tf
from tensorflow import keras
from tensorflow.keras import backend as K
from tensorflow.keras import Input, Model
from tensorflow.keras.layers import Conv2D, B... |
"""
write_launcher_job_file.py
"""
import argparse
import glob
import math
import os
from .pipeline import PipelineException
def get_args():
arg_parser = argparse.ArgumentParser()
arg_parser.add_argument('-j', '--job-fp', required=True, help='job file to be written')
arg_parser.add_argument('-i', '--inpu... |
from typing import List
import json
import numpy as np
import pandas
from sklearn.model_selection import StratifiedKFold
from sklearn.metrics import accuracy_score, roc_auc_score, cohen_kappa_score
from training import pretrain, train_predictor, test_predictor_with_data, get_data, get_labels, train_ckt_encoder, train_... |
from __future__ import annotations
from collections import Counter
from itertools import takewhile
from typing import Dict, Tuple, List
from more_itertools import ichunked, windowed
class NucleotideSequence:
valid_nucleotides = {'A', 'T', 'U', 'G', 'C'}
def __init__(self, sequence: str, tag="N/A"):
... |
from __future__ import print_function
import numpy as np
import torch
import torch.backends.cudnn as cudnn
from retinaface.data import cfg_mnet
from retinaface.layers.functions.prior_box import PriorBox
from retinaface.loader import load_model
from retinaface.utils.box_utils import decode, decode_landm
from retinafac... |
from utils import get_random_word
import logging
import os
import json
from dotenv import load_dotenv
from telegram import InlineKeyboardButton, InlineKeyboardMarkup, Update
from telegram.ext import Updater, CallbackQueryHandler, CommandHandler, MessageHandler, Filters, CallbackContext
# Chargement de la variable d'en... |
# Licensed to Elasticsearch B.V. under one or more contributor
# license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright
# ownership. Elasticsearch B.V. licenses this file to you under
# the Apache License, Version 2.0 (the "License"); you may
# not use ... |
from toontown.suit import SuitDNA
import types
from toontown.toonbase import TTLocalizer
from direct.showbase import PythonUtil
from otp.otpbase import OTPGlobals
from toontown.battle import SuitBattleGlobals
PartsPerSuit = (10,
10,
10,
10)
PartsPerSuitBitmasks = (56411,
56411,
56411,
56411)
AllBits = 56411
MinPa... |
# Copyright (c) 2020, NVIDIA CORPORATION. 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... |
# Store the notation of the website
def notation():
return ['Addoha',
'AFMA',
'Afric Indus',
'Afriquia Gaz',
'Agma',
'Alliances',
'Aluminium Maroc',
'Aradei Capital',
'ATLANTASANAD',
'Attijariwafa',
'Auto Hall',
'Auto Nejma',
'BALIMA',
'BCP',
'BMCI',
'Cartier Saada',
'CDM',
'Centra... |
# Copyright 2020 Google Research. 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 law... |
#!/usr/bin/env python3
"""Recover files that are downloaded using CFDP protocol"""
import argparse
import os.path
from pathlib import Path
import re
import socket
import sys
from all_packets import CFDP_TlmPkt, Packet, cfdp_checksum, pump_cosmos_ccsds_packets # noqa
class CFPDState:
def __init__(self, src_file_... |
#! /usr/bin/env python
import numpy as np
from ur_control import transformations as tr
from ur_control import spalg
# Messages
from geometry_msgs.msg import (Point, Quaternion, Pose, PoseStamped, Vector3, Transform,
Wrench)
from sensor_msgs.msg import CameraInfo, Image, RegionOfInteres... |
# Copyright 2019 Lenovo(Beijing) Technologies Co.,LTD.
# Smart Education Engine Team, All Rights Reserved.
# Author: <NAME>
# Date: 2020/5/15 下午4:53
# Email: <EMAIL>
# Description: Define tf parameters
# coding=utf-8
# Copyright 2018 The Google AI Language Team Authors.
#
# Licensed under the Apache License, Version ... |
import os
import glob
import pandas as pd
import numpy as np
from spacekit.extractor.scrape import MastScraper, FitsScraper, scrape_catalogs
from spacekit.preprocessor.encode import SvmEncoder
class Scrubber:
"""Base parent class for preprocessing data. Includes some basic column scrubbing methods for pandas data... |
# coding: utf-8
# /*##########################################################################
#
# Copyright (c) 2016-2017 European Synchrotron Radiation Facility
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to d... |
# Copyright 2018 PayTrace, 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 agreed to in wri... |
import unittest
from pokeher.theaigame import *
import pokeher.cards as cards
class CardBuilderTest(unittest.TestCase):
def test_from_string(self):
"""Tests building our cards from theaigame text strings"""
b = CardBuilder()
self.assertFalse(b.from_2char(None))
self.assertFalse(b.... |
import numpy as np
import pickle
import datetime
from pathlib import Path
import matplotlib
import matplotlib.pyplot as plt
import matplotlib.gridspec as gridspec
from matplotlib.colors import ListedColormap, BoundaryNorm
from matplotlib import rc
rc('font', **{'family': 'sans-serif', 'sans-serif': ['Helvetica']})
rc('... |
'''
Copyright 2019 <NAME>.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distribute... |
import numpy as np
import matplotlib.pyplot as plt
from matplotlib import animation
from itertools import chain
DT = 0.015
COLOR_OBJ = [np.array([np.nan] * 3)] #armazena as cores de cada corpo celeste para evitar repetição de cores.
def join_mat_funcs(*funcs):
return lambda *args: tuple(chain.from_iterable(f(*ar... |
# pylint: disable=missing-docstring,invalid-name,too-few-public-methods
from __future__ import print_function
from ctypes import byref, CDLL, c_char_p, c_int, c_long, c_uint, c_ulong, POINTER, Structure
from logging import addLevelName, Formatter, getLogger, INFO, StreamHandler
from sys import exit as sys_exit, stderr... |
"""
Implementation of Sparse Symbolic Representation based on
https://github.com/fbagattini/sparse_symbolic_representation
Usage granted through Creative Commons in
https://doi.org/10.1186/s12911-018-0717-4.
"""
from math import log
import editdistance as ed
import numpy as np
from fiber.config import OCCURRENCE_INDEX... |
import os
from datetime import datetime
import sys
try:
from hashlib import sha1
except ImportError:
sys.exit('ImportError: No module named hashlib\n'
'If you are on python2.4 this library is not part of python. '
'Please install it. Example: easy_install hashlib')
from sqlalchemy imp... |
"""
Methods and functions to compute global descriptors of a frame from its atomic desciptors
"""
import json
import numpy as np
from ..io import NpEncoder
class Atomic_2_Global_Descriptors:
def __init__(self, k_spec_dict):
"""
Object handing the reducer functions used to convert atomic descrip... |
import numpy as np
from gaps.config import Config
from gaps.crowd.dbaccess import mongo_wrapper
from gaps.crowd.nodes import NodesAndHints
from gaps.crowd.individual import Individual
from gaps.crowd.fitness import db_update
class CrowdIndividual(object):
def __init__(self, real_pieces, rows, columns):
s... |
import os
import sys
import h5py
import pickle
import traceback
import numpy as np
from scipy import misc, ndimage
def load_dataset():
train_dataset = h5py.File('cat_not_cat_dataset/train_catvsnotcat.h5', "r")
train_set_x_orig = np.array(train_dataset["train_set_x"][:]) # train set features
train_set_y_o... |
#!/usr/bin/env python
#
# Copyright (C) 2014 Narf Industries <<EMAIL>>
#
# 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,... |
#!/usr/bin/env python3
# PYTHON_ARGCOMPLETE_OK
import numpy as np
import sys
import logging
from typing import Tuple
import matplotlib.pyplot as plt
from matplotlib.backend_bases import KeyEvent, LocationEvent, MouseEvent
from phonebot.core.common.settings import Settings
from phonebot.core.common.config import Phone... |
from tastypie.resources import ModelResource
from wordgame.models import Round, PlayerRoundState, UserProfile
from wordgame.models import PlayerGameScore
from django.contrib.auth.models import User
from django.contrib.auth import authenticate
from tastypie.authentication import ApiKeyAuthentication
from tastypie.authen... |
import logging, os
from kubernetes import client, config
logger = logging.getLogger()
logger.setLevel(logging.DEBUG)
node_list_keys = ('name', 'role', 'status', 'last_message', 'cpu_allocation', 'creation')
v1 = 0
""" --- Helpers to build responses which match the structure of the necessary dialog actions --- """
... |
"""
# Copyright 2022 Red Hat
#
# 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 agr... |
import os
from glob import glob
from typing import List, Tuple
import cv2
import numpy as np
from matplotlib import pyplot as plt
from tqdm import tqdm
from tools.correlational_tracker.multi_tracker_with_merge_on_fly import initialize_tracker
from tools.correlational_tracker.multi_tracker_with_merge_on_fly import mer... |
import os
from datetime import date
from flask import Flask, g, request, render_template, abort, make_response, url_for, redirect
from flask_babel import Babel, gettext, lazy_gettext
from utils import get_news, get_speakers, get_talks, get_edu_speakers, get_edu_talks
EVENT = gettext('PyCon SK 2020 | Bratislava, Slov... |
# -*- coding: UTF-8 -*-
from scipy import kron
from scipy.sparse import csr_matrix
from scipy.sparse import diags
from scipy.linalg import block_diag
from scipy.sparse import identity
from numpy import zeros
from numpy import array
# TODO: - docstrings + examples
def _mass_matrix_H1(p, n, T):
"""Returns the 2D/... |
import json
import argparse
from mendeleev import element
from dataclasses import dataclass
@dataclass
class berthainputoption:
inputfile: str = ""
jsonbasisfile: str ="fullsets.json"
fittset: str = ""
basisset: str = ""
restarton: int = 1
grid: int = 5
functxc: str = "BLYP"
maxit: in... |
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
def correlation_categories(data_retina):
""" assign numerical values to stimuli based on correlation category as per variable stim_categories"""
stim_categories = {'white': 3, 'fullfield': 0, 'multiscale': 1, 'spatexp': 2, 'spattempexp': ... |
#!/usr/bin/env python
import logging
import urllib
import uuid
import datetime
import json
import tempfile
from zipfile import ZipFile,ZipInfo,ZIP_DEFLATED
from io import BytesIO
import pkg_resources
from flask import redirect
# aws
from botocore.exceptions import ClientError
# common
# flask
from werkzeug import secu... |
import sys
from os.path import dirname, abspath
sys.path.append(dirname(dirname(abspath(__file__))))
from BRC_microarray.Netherlands.utils import *
def compute_overlap_gene_names(path1="../data/SCZ_microarray/", path2="../data/SCZ_RNAseq/", dataset="PPI"):
GSE_clusters = np.genfromtxt("{}output/GSE/{}.final_featu... |
#!/usr/bin/env python3
"""
Startup code for running the Brokkr client mainloop as an application.
"""
# pylint: disable=import-outside-toplevel, redefined-outer-name, reimported
# Standard library imports
import logging
import logging.config
import multiprocessing
from pathlib import Path
import sys
# Local imports
... |
# Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
An extensible ASCII table reader and writer.
Classes to read DAOphot table format
:Copyright: Smithsonian Astrophysical Observatory (2011)
:Author: <NAME> (<EMAIL>)
"""
import re
import numpy as np
import itertools as itt
from collections import de... |
#!/usr/bin/env python
#
# Author: <NAME> [tg at isi dot edu]
# Created: 10/17/18
import torch
import rtg
from rtg import log, yaml, TranslationExperiment as Experiment, device, BatchIterable
from rtg.registry import ProblemType
from rtg.module import NMTModel
from rtg.utils import IO
from rtg.module.schedule import Sc... |
import matplotlib.pyplot as plt
import time
from copy import copy
from itertools import product
import Q_functions, Q_functions_optimized, G_functions
from input_validator import validate_input2
# ----------------------------------------------------------------------------------------------------------------------
#... |
# Copyright 2020 The Kubernetes Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to ... |
"""Autograd based computation backend."""
import math
import autograd.numpy as np
from autograd.numpy import (
abs,
all,
allclose,
amax,
amin,
angle,
any,
arange,
arccos,
arccosh,
arcsin,
arctan2,
arctanh,
argmax,
argmin,
array,
broadcast_arrays,
... |
#!/usr/bin/env python3
# Copyright (c) 2015-2018 The Dash Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
from test_framework.blocktools import get_masternode_payment, create_coinbase, create_block
from test_framewo... |
"""
@author: <NAME>
@date: 20201019
@contact: <EMAIL>
"""
# based on:
# https://github.com/iamhankai/ghostnet.pytorch/blob/master/ghost_net.py
"""
Creates a GhostNet Model as defined in:
GhostNet: More Features from Cheap Operations By <NAME>, <NAME>, <NAME>, <NAME>, <NAME>, Ch<NAME>.
https://arxiv.org/abs/1911.11... |
"""All pytest-django fixtures"""
import os
from contextlib import contextmanager
from functools import partial
import pytest
from . import live_server_helper
from .django_compat import is_django_unittest
from .lazy_django import skip_if_no_django
__all__ = [
"django_db_setup",
"db",
"transactional_db",... |
# Copyright 2013 OpenStack Foundation.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless req... |
"""
Copyright 2017-2018 lvaleriu (https://github.com/lvaleriu/)
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 applicabl... |
"""Machinery to read/write Tables in an Excel workbook using openpyxl as engine."""
from itertools import chain
from os import PathLike
from typing import Union, Iterable, Sequence, Any, Dict, List, Tuple, Optional
from contextlib import closing
import openpyxl
try:
from openpyxl.worksheet.worksheet import Workshe... |
import numpy as np
import csv
import seaborn as sns
import matplotlib.pyplot as plt
from random import randint
from scipy import signal
from ..classical.Periodogram import Periodogram
from ..classical.AveragedPeriodogram import AveragedPeriodogram
from ..classical.BlackmanTukey import BlackmanTukey
from ..parametric.... |
#
# All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or
# its licensors.
#
# For complete copyright and license terms please see the LICENSE at the root of this
# distribution (the "License"). All use of this software is governed by the License,
# or, if provided, by the license below or th... |
'''import sys
sys.path.append('/home/hendrik/Documents/master_project/LanguagePolicies/')
from statistics import mode
from sys import path
from time import sleep
#import metaworld
#from metaworld.policies.sawyer_pick_place_v2_policy import SawyerPickPlaceV2Policy
import torch
import numpy as np
import os
import numpy a... |
"""
Author: <NAME>
Last updated: 23/10/19
Description: Python program that detects if an image has been forged.
"""
import cv2
import imutils
import numpy as np
import matplotlib.pyplot as plt
from scipy.cluster import hierarchy
from scipy.spatial.distance import pdist
from collections import Counter
de... |
# -*- coding: utf-8 -*-
import matplotlib
matplotlib.use('Agg')
import matplotlib.pyplot as plt
import librosa.display as dsp
import numpy as np
import tensorflow as tf
def _assert_valid_input_type(s):
assert s == 'mulaw-quantize' or s == 'mulaw' or s == 'raw'
def is_mulaw_quantize(s):
_assert_valid_input_type(s... |
"""
Virtual gateway for Zigbee Home Automation.
For more details about this component, please refer to the documentation at
https://home-assistant.io/components/zha/
"""
import asyncio
import collections
import itertools
import logging
import os
import traceback
from homeassistant.components.system_log import LogEnt... |
"""
Cross-platform colored printing to the console using `colorama <https://github.com/tartley/colorama>`_ module.
Usage:
from cprint import print, Color
print("Test", color=Color.GREEN)
"""
import builtins
import enum
import os
from typing import Union, Type, Tuple, TextIO, Optional
import colorama
__autho... |
"""
SensiMix: Sensitivity-Aware 8-bit Index & 1-bit Value Mixed Precision Quantization for BERT Compression
Authors:
- <NAME> (<EMAIL>), Seoul National University
- <NAME> (<EMAIL>), Seoul National University
- <NAME> (<EMAIL>), Seoul National University
This software may be used only for research evaluation purposes.
... |
# -*- coding: utf-8 -*-
r""" rhoEst: implementation of the 2nd multi-player policy from [Distributed Algorithms for Learning..., Anandkumar et al., 2010](http://ieeexplore.ieee.org/document/5462144/).
- Each child player is selfish, and plays according to an index policy (any index policy, e.g., UCB, Thompson, KL-UCB,... |
"""
Unittest the storage and parser modules
"""
import re
from io import StringIO
import pytest
from gaphor import UML
from gaphor.application import distribution
from gaphor.diagram.general import CommentItem
from gaphor.storage import storage
from gaphor.storage.xmlwriter import XMLWriter
from gaphor.tests.testcas... |
#!/usr/bin/env python3
# Copyright (c) 2013-2015, Rethink Robotics
# 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,
# ... |
import concurrent.futures
import csv
import os
from enum import Enum
import numba as nb
import numpy as np
import pandas as pd
class FileProvider:
def __init__(self, intervals_filename, project_directory, orange_threshold):
"""
Construct a file provider that parses and provides input files.
... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
This is the main executable of HTPC Manager. It parses the
command line arguments, sets globals variables and calls the
start function to start the server.
"""
import os
import sys
import htpc
import webbrowser
import locale
import logging
def parse_arguments():
... |
import copy
import hashlib
import logging.config
import os
import time
from datetime import datetime
from datetime import timedelta
from ipaddress import ip_network as str2ip
import ujson as json
import yaml
from kombu import serialization
HISTORIC = os.getenv("HISTORIC", "false")
RABBITMQ_USER = os.getenv("RABBITMQ_... |
import time
import asyncio
import traceback
SHOW_TASK_NAME = False
DEBUG_AS_INFO = False
registered_triggers = []
class OccupancyManager:
def __init__(self, config):
if not self.parse_config(config):
log.error(f'INVALID CONFIG {config}')
return
self.log_debug('STARTING')
... |
# encoding: utf-8
'''
Sublime text de-Compressor
View compressed files ( gzip, bzip2 ) content in sublime text
Support verified for
- gzip (Sublime Text 2)
- bzip (Sublime Text 3)
- lzma (Sublime Text 4)
'''
from os.path import basename, join, dirname, exists, rename
import sys
import threading
import time
from tempf... |
# This script groups DNS records by domain names.
#
# Command to run this script on the CTIT cluster:
# $ spark-submit --master yarn --deploy-mode cluster src/data/spark/group_dns_records.py
from pyspark import SparkContext
from pyspark.sql import SQLContext
from pyspark.sql.types import *
import json
import datetime
... |
import basix
def to_x(p):
if len(p) == 1:
return 100 * p[0]
if len(p) == 2:
return 100 * p[0]
if len(p) == 3:
return 100 * p[0] + 30 * p[1]
def to_y(p):
if len(p) == 1:
return 120
if len(p) == 2:
return 120 - 100 * p[1]
if len(p) == 3:
return 120... |
import gym
from gym.spaces import Box, Discrete, Tuple, Dict, MultiDiscrete
from gym.envs.registration import EnvSpec
import numpy as np
import sys
import unittest
import traceback
import ray
from ray.rllib.utils.framework import try_import_tf
from ray.rllib.agents.registry import get_agent_class
from ray.rllib.models... |
###############################################################################
#
# The MIT License (MIT)
#
# Copyright (c) Crossbar.io Technologies GmbH
#
# 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 main processing unit for processing ODK options
"""
import csv
import re
import datetime
import uuid
import pytz
import json
from django.db import transaction
from django.utils import timezone
from django.conf import settings
from django.core.exceptions import ObjectDoesNotExist
from raven import Client
from ... |
import json
import itertools
import logging
import re
import flask
from flask import request
from flask.ext.cache import Cache
import requests
import rethinkdb as r
import db
import util
try:
import secrets
_HIPCHAT_TOKEN = secrets.HIPCHAT_TOKEN
_HIPCHAT_ROOM_ID = secrets.HIPCHAT_ROOM_ID
except ImportErr... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.