text stringlengths 6.04k 39.5k |
|---|
#!/usr/bin/env python
#
# Copyright (c) 2015 All rights reserved
# This program and the accompanying materials
# are made available under the terms of the Apache License, Version 2.0
# which accompanies this distribution, and is available at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
"""Rally testcases implement... |
# -*- coding: utf-8 -*- #
# Copyright 2017 Google LLC. 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 requir... |
import logging
from avalon.tools import models
from avalon.vendor.Qt import Qt, QtGui, QtCore
from avalon import api, io
from . import lib
main_logger = logging.getLogger("modeldiffer")
SIDE_A = "origin"
SIDE_B = "contrast"
SIDE_A_DATA = "originData"
SIDE_B_DATA = "contrastData"
SIDE_COLOR = {
SIDE_A: "#76D... |
import asyncio
from asyncio.streams import StreamReader, StreamWriter
from asyncio.tasks import sleep
import re
import struct
import traceback
from typing import Dict, Tuple
from hwt.hdl.types.bits import Bits
from hwtLib.peripheral.usb.descriptors.std import USB_ENDPOINT_DIR
from hwtLib.peripheral.usb.device_request ... |
# Copyright 2018 Novo Nordisk Foundation Center for Biosustainability, DTU.
#
# 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 requir... |
#
# Copyright (C) 2018 Codethink Limited
# Copyright (C) 2019 Bloomberg Finance LP
#
# 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
#
#... |
import hashlib
import os
import base64
import re
from functools import partial
from Crypto.Cipher import AES
from Crypto.PublicKey import RSA
from Crypto.Random import get_random_bytes
from Crypto.Cipher import PKCS1_OAEP
from Crypto.Util.Padding import pad, unpad
import logging
import json
# '\0'填充密码
def null_pad(da... |
# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo import api, exceptions, fields, models, _
from odoo.exceptions import UserError
from odoo.tools import float_compare, float_round
from odoo.addons import decimal_precision as dp
class StockMoveLine(models.Mod... |
from bellbird.operators import *
from bellbird.variables import *
class Equation:
def __init__(self, equationStr):
self.equationStr = equationStr
self.term = parseEquationStr(self.equationStr)
def __repr__(self):
return repr(self.term)
def __str__(self):
return str(self.term)
@property
def lhs(self):
... |
#!/usr/bin/env python3
# SPDX-FileCopyrightText: 2009 Fermi Research Alliance, LLC
# SPDX-License-Identifier: Apache-2.0
#
# Project:
# glideinWMS
#
# File Version:
#
# Description:
# This is a collection of utilities functions for file handling and other
#
# Author:
# <NAME> (some functions are from other modu... |
"""Main module."""
import csv
import os
import shutil
from pathlib import Path
from string import Template
from typing import ClassVar, Dict, List, Optional, Sequence, Type, TypeVar, Union
import attr
from loguru import logger
from pypinyin import lazy_pinyin
# The default pinyin order for "祢" is "mí" first and then... |
import numpy as np
import itertools as it
from manimlib.imports import *
from from_3b1b.old.brachistochrone.curves import Cycloid
class PhysicalIntuition(Scene):
def construct(self):
n_terms = 4
def func(xxx_todo_changeme):
(x, y, ignore) = xxx_todo_changeme
z = complex(x... |
import csv
import datetime
import os
import subprocess
import sys
from distutils import dir_util
import monopsr
import numpy as np
import tensorflow as tf
from PIL import Image
from monopsr.core import box_3d_projector
from monopsr.core import summary_utils
from monopsr.datasets.kitti import calib_utils
def save_pre... |
# Copyright (c) 2020, <NAME>
# License: MIT License
import pytest
import math
import pickle
# Import from 'ezdxf.math._vector' to test Python implementation
from ezdxf.math._vector import Vec3
from ezdxf.acc import USE_C_EXT
vec3_classes = [Vec3]
if USE_C_EXT:
from ezdxf.acc.vector import Vec3 as CVec3
vec3_c... |
import aiohttp
import asyncio
import json
import logging
import re
import os
import subprocess
from colorhash import ColorHash
from discord import Colour, Embed, Message
from typing import re as re_type, List
from urllib.parse import quote
from ..commloop import comm_event
from ..client import client
from ..util import... |
from __future__ import absolute_import, division, print_function
import argparse
import csv
import json
import logging
import os
import random
import glob
import numpy as np
import torch
from torch.utils.data import (DataLoader, SequentialSampler)
from torch.utils.data.distributed import DistributedSampler
from tqdm ... |
#%% saint
import os
import gc
import sys
import pickle
from time import time
import datatable as dt
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
import seaborn as sns
import torch
import torch.nn as nn
from torch import optim
from sklearn.metrics import roc_auc_score
from sklearn.model_selec... |
"""Classes to stream EEG data and event markers."""
# Author: <NAME> <<EMAIL>>
from __future__ import division, print_function, absolute_import
import datetime
import numbers
import time
from mne import concatenate_raws, create_info, Epochs, io, set_log_level
from mne.preprocessing import ICA
from mne.utils import Pro... |
"""Extract_load is a basic EL style BlockSet implementation."""
import asyncio
import logging
from asyncio import Task
from contextlib import suppress
from typing import AsyncIterator, List, Optional, Set, Tuple
import structlog
from async_generator import asynccontextmanager
from meltano.core.elt_context import Plugi... |
# -- coding: utf-8 --
from __future__ import division
from __future__ import print_function
from model.hyparameter import parameter
from model.gan import embedding
from model.gan import Transformer
from model.utils import construct_feed_dict
import pandas as pd
import scipy.sparse as sp
import tensorflow as tf
import... |
from copy import deepcopy
import distutils
from distutils.dir_util import copy_tree
from decimal import Decimal
import multiprocessing as mp
from os import path
import pkgutil
import time
import matplotlib
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
import subprocess
from tqdm ... |
import tensorflow as tf
import os, json, pickle
from importlib import import_module
import numpy as np
from scipy.misc import imresize
from scipy.spatial.distance import cdist
from sklearn.metrics import average_precision_score
try:
from edflow.iterators.model_iterator import HookedModelIterator, TFHookedModelIte... |
import binascii
from Jumpscale import j
INT_NULL_VALUE = 2147483647
def gwid(reservation_id, workload_id):
return f"{reservation_id}-{workload_id}"
def rid_from_gwid(workload_id):
ss = workload_id.split("-")
if len(ss) != 2:
raise j.exceptions.Input(f"global workload id {workload_id} has wrong... |
"""model creation to pipeline
Revision ID: 521203454136
Revises: <PASSWORD>
Create Date: 2021-03-05 18:19:24.989548
"""
"""
OpenVINO DL Workbench
Migration: Migrate model creation to pipelines
Copyright (c) 2021 Intel Corporation
Licensed under the Apache License, Version 2.0 (the "License");
you may not use ... |
# Copyright (c) 2014 Adafruit Industries
# Author: <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, modify... |
import json
import logging
from dataclasses import dataclass, field
from hashlib import md5
from typing import Dict, Iterable, List, Optional, Tuple, cast
import confluent_kafka
from confluent_kafka.schema_registry.schema_registry_client import Schema
from datahub.configuration.common import AllowDenyPattern, Configu... |
#!/usr/bin/env python
# coding: utf-8
from __future__ import unicode_literals
__license__ = 'Public Domain'
import codecs
import io
import os
import random
import sys
from .options import (
parseOpts,
)
from .compat import (
compat_getpass,
compat_shlex_split,
workaround_optparse_bug9161,
)
from .u... |
import importlib
import datetime
import math
from dateutil.relativedelta import relativedelta
from collections import namedtuple
from kardboard.app import app
from mongoengine.queryset import Q
from flask.ext.mongoengine import QuerySet
from kardboard.models.blocker import BlockerRecord
from kardboard.models.states... |
from sklearn.metrics import classification_report, zero_one_loss
from sklearn.metrics import confusion_matrix
import pandas as pd
import numpy as np
import seaborn as sns
import matplotlib.pyplot as plt
import re
import datetime
def get_linear_weights(length):
return [(length - i)/length for i in range(length)]
d... |
from typing import List
from .default_layouts import layouts as _default_layout
from .element_data import *
import copy
import os
class Error(Exception):
def __init__(self, message):
self.message = message
class GridError(Exception):
def __init__(self, row, col, message):
self.message = f"Erro... |
# -*- coding: utf-8 -*-
"""
Created on Thu Feb 27 10:39:34 2020.
@author: pielsticker
Basic definition of classes and peak shapes for simulating spectra.
"""
import numpy as np
import os
from scipy.signal import fftconvolve
from scipy.interpolate import interp1d
from .converters.data_converter import DataConverter... |
"""Module is implementation of non-dominated sorting.
Original algorithm described in the paper:
<NAME>., <NAME>.
A Provably Asymptotically Fast Version of the Generalized Jensen Algorithm for Non-dominated Sorting
// Parallel Problem Solving from Nature XIII.
- 2015. - P. 528-537. - (Lecture Notes on Computer Scienc... |
import os
import torch.nn.functional as F
from utils.parse_config import parse_data_cfg, parse_model_cfg
from utils.utils import *
ONNX_EXPORT = False
def create_modules(module_defs):
"""
Constructs module list of layer blocks from module configuration in module_defs
"""
hyperparams = module_defs.p... |
import tensorflow as tf
import numpy as np
import cv2
FLAGS = tf.app.flags.FLAGS
coco_color_map = [
0x00, 0x55, 0xFF,
0xFF, 0x11, 0x00,
0xFF, 0x1A, 0x00,
0xFF, 0x22, 0x00,
0xFF, 0x2A, 0x00,
0xFF, 0x33, 0x00,
0xFF, 0x3C, 0x00,
0xFF, 0x44, 0x00,
0xFF, 0x4C, 0x00, #// 29
0xFF, 0x55, 0x00, #// 30
0xFF,... |
# coding: utf-8
"""
flask_oauthlib.client
~~~~~~~~~~~~~~~~~~~~~
Implemnts OAuth1 and OAuth2 support for Flask.
:copyright: (c) 2013 - 2014 by <NAME>.
"""
import logging
import oauthlib.oauth1
import oauthlib.oauth2
from copy import copy
from functools import wraps
from oauthlib.common import to_unico... |
import copy
from crispy_forms.utils import TEMPLATE_PACK
from django import forms
from django.contrib.contenttypes.models import ContentType
from django.core.exceptions import PermissionDenied, FieldError
from django.db import models, transaction
from django.forms.models import modelform_factory, modelform_defines_fie... |
############################################# IMPORTING ################################################
# import tkinter as tk
# from tkinter import ttk
# from tkinter import messagebox as mess
# import tkinter.simpledialog as tsd
# import cv2
# import os
# import csv
# import numpy as np
# from PIL import Image
# imp... |
"""
Module that implements APL's primitive functions.
cf. https://www.jsoftware.com/papers/satn40.htm for complex GCD.
cf. https://www.jsoftware.com/papers/eem/complexfloor.htm for complex floor.
"""
import functools
import math
from arraymodel import APLArray, S
def pervade(func):
"""Decorator to define functi... |
from __future__ import division, print_function, absolute_import
import numpy as np
import numpy.testing as nt
import warnings
from dipy.utils.six.moves import xrange
from dipy.core.sphere import (Sphere, HemiSphere, unique_edges, unique_sets,
faces_from_sphere_vertices, HemiSphere,
... |
"""Labeled Faces in the Wild (LFW) dataset
This dataset is a collection of JPEG pictures of famous people collected
over the internet, all details are available on the official website:
http://vis-www.cs.umass.edu/lfw/
"""
# Copyright (c) 2011 <NAME> <<EMAIL>>
# License: BSD 3 clause
from os import listdir, make... |
# coding=utf-8
# *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union, overload
from . import ... |
from abc import ABC, abstractmethod
from enum import Enum
from typing import Any, Dict, Iterable, List, Optional, cast, TYPE_CHECKING, Union
import pystac
from pystac import STACError
from pystac.link import Link
from pystac.utils import is_absolute_href, make_absolute_href
if TYPE_CHECKING:
from pystac.catalog i... |
import torch
import torch.nn as nn
from utils.utils import bbox_iou, bbox_wh_iou, to_cpu
from utils.parse_config import parse_model_config
def build_targets(pred_boxes, pred_cls, target, anchors, ignore_thres, stride):
'''
:param pred_boxes: 预测框的位置和长宽 (num_samples, self.num_anchors, grid_size, grid_size, 4)
... |
'''
Process OSM files to extract specific data types
'''
import os, sys, time, subprocess, argparse, logging
import osmium
import geopandas as gpd
import osmnx as ox
import pandas as pd
import networkx as nx
import shapely.wkb as wkblib
from shapely.geometry import box, LineString, Point, Polygon
from shapely.ops im... |
# Copyright (c) 2017-present, Facebook, Inc.
# All rights reserved.
# This source code is licensed under the BSD-style license found in the
# LICENSE file in the root directory of this source tree. An additional grant
# of patent rights can be found in the PATENTS file in the same directory.
from parlai.core.agents im... |
# Copyright (C) 2019 Intel Corporation. All rights reserved.
#
# SPDX-License-Identifier: BSD-3-Clause
#
import os
import getopt
import common
SOURCE_ROOT_DIR = common.SOURCE_PATH
BOARD_INFO_FILE = "board_info.txt"
SCENARIO_INFO_FILE = ""
LAUNCH_INFO_FILE = ""
ERR_LIST = {}
BOOT_TYPE = ['no', 'vsbl', 'ovmf']
RTOS_TY... |
# Copyright (c) 2019 Uber Technologies, 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... |
## auth.py
##
## Copyright (C) 2003-2005 Alexey "Snake" Nezhdanov
##
## 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 2, or (at your option)
## any later vers... |
"""Tests for vcd.gtkw module."""
import datetime
import os
import time
from io import StringIO
import pytest
from vcd.gtkw import (
GTKWColor,
GTKWFlag,
GTKWSave,
decode_flags,
make_translation_filter,
)
def test_decode_flags():
assert decode_flags('@200') == ['blank']
assert decode_fla... |
# Copyright (c) 2019 Western Digital Corporation or its affiliates.
import warnings
import torch
import numpy as np
import torch.nn as nn
import torch.nn.functional as F
from mmdet import cv_core
from mmdet.cv_core.cnn import ConvModule, normal_init
from mmdet.det_core import (build_anchor_generator, build_assigner,
... |
import os
import sys
import warnings
from contextlib import contextmanager
import numpy as np
import scipy.sparse as sp
from io import UnsupportedOperation
from menpo.shape import TriMesh, PointCloud
from menpo.transform import Translation, UniformScale, AlignmentSimilarity
from menpo3d.morphablemodel.shapemodel impor... |
from driver import SPI,GPIO
class AuthenticationError(Exception):
pass
class StatusNotSuccessError(Exception):
pass
class MFRC522:
KEY = [0xFF,0xFF,0xFF,0xFF,0xFF,0xFF]
BLOCK_ADDRS = [8, 9, 10]
MAX_LEN = 16
PCD_IDLE = 0x00
PCD_AUTHENT = 0x0E
PCD_RECEIVE = 0x08
PCD_TRANSMIT = 0x0... |
# Copyright 2018, The TensorFlow Federated 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 o... |
from collections import namedtuple
import math
import torch
import torch.nn as nn
import torch.nn.functional as F
from torch.autograd.function import InplaceFunction, Function
QParams = namedtuple('QParams', ['range', 'zero_point', 'num_bits'])
_DEFAULT_FLATTEN = (1, -1)
_DEFAULT_FLATTEN_GRAD = (0, -1)
def _deflatt... |
from enum import Enum
from typing import Any, Dict
import torch
from torch.fx import Tracer
from torch.fx.graph_module import GraphModule
from torch.quantization.quantize_fx import _swap_ff_with_fxff
from torch.quantization import QConfig
from mqbench.fake_quantize import (
LearnableFakeQuantize,
NNIEFakeQuan... |
import re
import numpy as np
import cv2 as cv
from cv2 import VideoCapture
import matplotlib.pyplot as plt
from collections import Counter, OrderedDict
import transforms3d.euler as euler
import transforms3d.quaternions as quat
from pylab import *
from PIL import Image
import os
import getopt
import js... |
# -*- coding: utf-8 -*-
"""
Easytest 2 UI Application
"""
import datetime
import json
import sys
import traceback
import requests
from dateutil import parser
from PyQt5 import uic, QtWidgets as QW
from PyQt5.QtCore import QTranslator
from PyQt5.QtWidgets import QListWidgetItem
from bl.easytest import Test
class ... |
# -*- coding: utf-8 -*-
"""
pygments.lexers.erlang
~~~~~~~~~~~~~~~~~~~~~~
Lexers for Erlang.
:copyright: Copyright 2006-2019 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
import re
from pygments.lexer import Lexer, RegexLexer, bygroups, words, do_insertions, \
... |
# -*- coding: utf-8 -*-
"""
File Name: cifar_demo
Description :
Author : mick.yi
date: 2019/1/11
"""
import tensorflow as tf
import numpy as np
import h5py
import keras
from keras.layers import Input, Dense, Layer
from keras import layers
from keras.models import Model
from ... |
"""This file and its contents are licensed under the Apache License 2.0. Please see the included NOTICE for copyright information and LICENSE for a copy of the license.
"""
import logging
import ujson as json
from django.db import transaction
from drf_dynamic_fields import DynamicFieldsMixin
from django.conf import se... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# QTPyLib: Quantitative Trading Python Library
# https://github.com/ranaroussi/qtpylib
#
# Copyright 2016-2018 <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 ... |
#!/usr/bin/python
# Copyright: 2017, CCX Technologies
import fcntl
import socket
import ctypes
import struct
import errno
# =================== from linux headers ========================
IFF_UP = (1 << 0)
IFF_BROADCAST = (1 << 1)
IFF_DEBUG = (1 << 2)
IFF_LOOPBACK = (1 << 3)
IFF_POINTOPOINT = (1 << 4)
IFF_NOTRAILERS... |
import uuid
import mimetypes
import logging
from django.utils import timezone
from django.db import models
from django.db.models import Q
from django.conf import settings
from elasticsearch.exceptions import NotFoundError
from core.base import BaseModel, SimpleBaseModel
from functools import singledispatch
from core.el... |
# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved
"""
COCO evaluator that works in distributed mode.
Mostly copy-paste from https://github.com/pytorch/vision/blob/edfd5a7/references/detection/coco_eval.py
The difference is that there is less copy-pasting from pycocotools
in the end of the file, as... |
import json
import logging
import select
import time
from kazoo.client import KazooClient, KazooState, KazooRetry
from kazoo.exceptions import NoNodeError, NodeExistsError, SessionExpiredError
from kazoo.handlers.threading import SequentialThreadingHandler
from kazoo.protocol.states import KeeperState
from kazoo.secur... |
# Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
Module to search Splatalogue.net via splat, modeled loosely on
ftp://ftp.cv.nrao.edu/NRAO-staff/bkent/slap/idl/
:author: <NAME> <<EMAIL>>
"""
import warnings
from astropy.io import ascii
from astropy import units as u
from ..query import BaseQuery
fro... |
from __future__ import absolute_import, division, print_function
from six.moves import range
# TODO: clean up handling of changes in atom count
# these are approximations based on my (probably faulty) memory.
# feel free to change to something more reasonable.
# note: carbon is assigned the base color.
element_shades... |
"""
Admin commands
"""
import time
import re
from django.conf import settings
from src.server.sessionhandler import SESSIONS
from src.server.models import ServerConfig
from src.utils import prettytable, search
from src.commands.default.muxcommand import MuxCommand
PERMISSION_HIERARCHY = [p.lower() for p in settings... |
Sbox = (
0x63, 0x7C, 0x77, 0x7B, 0xF2, 0x6B, 0x6F, 0xC5, 0x30, 0x01, 0x67, 0x2B, 0xFE, 0xD7, 0xAB, 0x76,
0xCA, 0x82, 0xC9, 0x7D, 0xFA, 0x59, 0x47, 0xF0, 0xAD, 0xD4, 0xA2, 0xAF, 0x9C, 0xA4, 0x72, 0xC0,
0xB7, 0xFD, 0x93, 0x26, 0x36, 0x3F, 0xF7, 0xCC, 0x34, 0xA5, 0xE5, 0xF1, 0x71, 0xD8, 0x31, 0x15,
0x04, 0... |
import functools
import time
import torch
import torch.nn as nn
import config
from engine.logger import get_logger
from net_util import SAGate
logger = get_logger()
__all__ = ['DualResNet', 'resnet18', 'resnet34', 'resnet50', 'resnet101',
'resnet152']
def conv3x3(in_planes, out_planes, stride=1):
"... |
# Copyright (c) <NAME>
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
from io import BytesIO
import os
import re
import numpy as np
from collections import Counter
from subprocess import PIPE, run
import torch
try:
import kaldi_io
... |
import pathlib
import pickle
import time
from collections import defaultdict
import numpy as np
from skimage import io as imgio
from second.core import box_np_ops
from second.core import preprocess as prep
from second.core.geometry import points_in_convex_polygon_3d_jit
from second.core.point_cloud.bev_ops import poi... |
# Copyright (c) 2005, 2006 <NAME> <<EMAIL>>
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
# 1. Redistributions of source code must retain the above copyright
# notice, this list of conditio... |
# Copyright (c) 2013 Hitachi Data Systems, Inc.
# Copyright (c) 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://ww... |
import torch
import torch.nn as nn
import torch.utils.data
from torch.autograd import Variable
import torch.nn.functional as F
from core.networks.submodule import *
from core.utils.inverse_warp_d import inverse_warp_d, pixel2cam
from core.utils.inverse_warp import inverse_warp
from core.networks.loss_functions ... |
# The MIT License (MIT)
#
# Copyright (c) 2018, <NAME>
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, m... |
"""
Description:
Author: <NAME> (<EMAIL>)
Date: 2021-06-06 03:15:00
LastEditors: <NAME> (<EMAIL>)
LastEditTime: 2021-06-06 03:15:00
"""
import numpy as np
import torch
import logging
__all__ = [
"uniform_quantize_cpu",
"pact_quantize",
"PACT_Act",
"uniform_quantize",
"input_quantize_fn",
"wei... |
"""
pygments.lexers.robotframework
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Lexer for Robot Framework.
:copyright: Copyright 2006-2021 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
# Copyright 2012 Nokia Siemens Networks Oyj
#
# Licensed under the Apache Licen... |
# Natural Language Toolkit: Discourse Processing
#
# Author: <NAME> <<EMAIL>>
# <NAME> <<EMAIL>>
#
# URL: <http://nltk.org/>
# For license information, see LICENSE.TXT
"""
Module for incrementally developing simple discourses, and checking for semantic ambiguity,
consistency and informativeness.
Many of the i... |
# Copyright (c) 2010-2012 OpenStack, 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 ... |
#!/usr/bin/python
#
# Copyright 2018-2021 Polyaxon, 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 sklearn.pipeline import Pipeline
from sklearn.feature_extraction.text import _VectorizerMixin
from sklearn.feature_selection import SelectorMixin
from utils import *
def add_simple_features(matches):
# matches["p1_games_won"] = add_with_numba(...)
# matches["p2_games_won"] = add_with_numba(...)
# TO... |
"""
Contains useful functions and utilities that are not neccessarily only useful
for this module. But are also used in differing modules insidide the same
project, and so do not belong to anything specific.
"""
from __future__ import absolute_import, unicode_literals, division, print_function
import ast
from contextl... |
""" opentrons.simulate: functions and entrypoints for simulating protocols
This module has functions that provide a console entrypoint for simulating
a protocol from the command line.
"""
import argparse
import sys
import logging
import os
import pathlib
import queue
from typing import (Any, Dict, List, Mapping, Tex... |
# -*- coding: utf-8 -*-
from __future__ import division, print_function, absolute_import
from scipy.special import jv, legendre, sph_harm, jacobi
from math import pi
from numpy import conj as conjugate
from numpy import floor, sqrt, sin, cos, exp, power
from scipy.special import comb
from scipy import floor, sqrt
from... |
import requests
from django import forms
from django.conf import settings
from django.contrib.auth import get_user_model
from django.contrib.postgres.forms import SimpleArrayField
from django.core.exceptions import ValidationError
from django.core.validators import RegexValidator
from django.forms import widgets
from ... |
import typing
from collections import OrderedDict
from decimal import Decimal
from itertools import chain
from django.contrib.contenttypes.models import ContentType
from django.db import models
from django.db.models import CharField, DecimalField, Field, TextField
from django.utils.translation import ugettext_lazy as ... |
"""
Core utilities.
| Copyright 2017-2021, Voxel51, Inc.
| `voxel51.com <https://voxel51.com/>`_
|
"""
import atexit
from base64 import b64encode, b64decode
from collections import defaultdict
from contextlib import contextmanager
from copy import deepcopy
import importlib
import inspect
import io
import itertools
imp... |
# coding: utf-8
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License... |
# Created By: <NAME>
# Created On: 2005/09/08
# Copyright 2010 Hardcoded Software (http://www.hardcoded.net)
#
# This software is licensed under the "BSD" License as described in the "LICENSE" file,
# which should be included with this package. The terms are also available at
# http://www.hardcoded.net/licenses/bsd_... |
# Copyright 2004-2021 <NAME> <<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, copy, modify, merge,
# publish,... |
# all the C decls for pyvips
# we keep these together to make switching between ABI and API modes simpler
# we have to pass in the libvips version, since it can come from either
# pkg-config in compile.py (in API mode) or libvips itself in __init__.py
# (in ABI mode)
import sys
def _at_least(features, x, y):
r... |
"""
rencode -- Web safe object pickling/unpickling. Python 3k version
The rencode module is a modified version of bencode from the
BitTorrent project. For complex, heterogeneous data structures with
many small elements, r-encodings take up significantly less space than
b-encodings:
>>> len(rencode.dumps({'a':0, 'b... |
#!/usr/bin/env python3
import argparse
import logging
import subprocess
import os
import sys
import signal
import requests
import time
import seaborn as sns
import pandas as pd
from datetime import datetime, timedelta
from concurrent.futures import ThreadPoolExecutor
import numpy as np
import matplotlib.pyplot as plt
i... |
#!/usr/bin/python
# Things the RPM will do:
# Copy foundation.conf to /etc/ld.so.conf.d/
# Copy boss-config files to /opt/stack/bin. Boss_config.py
# has to be changed to accomodate lack of database
# Copy wxpython RPM somewhere (it isnt included in 6.6)
from __future__ import print_function
import os
import sys
im... |
from __future__ import absolute_import, division, print_function
from dials_pychef_ext import ChefStatistics, Observations
from cctbx.array_family import flex
from iotbx.data_plots import table_data
from libtbx import phil
from dials.util import resolution_analysis
__all__ = [
"ChefStatistics",
"Observation... |
#! /usr/bin/env python
# coding=utf-8
# The MIT License (MIT)
#
# Copyright (c) 2010 <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 limitatio... |
"""
Utility functions and classes (including default parameters).
Author: <NAME>
Date: 2/4/21
"""
import numpy as np
import optparse
import sys
from scipy.stats import norm
class Parameter:
"""Holds information about evolutionary parameters to infer"""
def __init__(self, value, min, max, name):
self... |
from __future__ import annotations
import datetime
import typing
from typing import Optional, Tuple, Union
from flytekit.core.context_manager import ExecutionState, FlyteContextManager
from flytekit.core.node import Node
from flytekit.core.promise import (
ComparisonExpression,
ComparisonOps,
ConjunctionE... |
"""
Local Normal Form
"""
#*****************************************************************************
# Copyright (C) 2007 <NAME> and <NAME>
#
# Distributed under the terms of the GNU General Public License (GPL)
#
# This code is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRAN... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.