text
stringlengths
6.04k
39.5k
''' Utilities related to setting up a Kerberos environment for services to test authentication and authorization functionality. Note: This module assumes any package it's being tested with includes the relevant krb5.conf and/or JAAS file(s) as artifacts, specified as per the YAML service spec. ***********************...
# -*- coding: utf-8 -*- import os, sys, re try: from subprocess import check_output, check_call except ImportError: import subprocess as sp def check_output(*args, **kwds): kwds['stdout'] = sp.PIPE proc = sp.Popen(*args, **kwds) output = proc.stdout.read() proc.wait() ...
# 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...
import math import os import threading from typing import Optional, List import time from PyQt5 import QtGui, QtCore import easygraphics as eg from easygraphics.image import Image class TurtleWorld(object): """ Turtles move and draw in a world. This is the class representing the world. You must remembe...
#!/usr/bin/env python # -------------------------------------------------------- # Faster R-CNN # Copyright (c) 2015 Microsoft # Licensed under The MIT License [see LICENSE for details] # Written by <NAME> # -------------------------------------------------------- """Train a Faster R-CNN network using alternating opt...
# ***************************************************************************** # Copyright (c) 2018, NVIDIA CORPORATION. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # * Redistributions...
#!/usr/bin/env python # -*- coding: utf-8 -*- #****************************************************************************** # $Id$ # # Project: GDAL # Purpose: Build a JPEG2000 file from the XML structure dumped by dump_jp2.py # Mostly useful to build non-conformant files # Author: <NAME>, <even do...
# Copyright 2020 Huawei Technologies Co., Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to...
# Copyright 2017 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...
import pyomo import pyomo.environ as env import pyomo.dae as dae import pyomo.core.base import abc from params import Params class BaseModel: """ Base class for building up a pyomo model with some supporting utilities. """ def __init__(self, _model=None): if _model is None: _mode...
from typing import Dict, Any, cast, Optional, NamedTuple, List, Tuple, Union from typing_extensions import Protocol import requests import re from datenguidepy.schema_json_meta import get_schema_json, get_json_path Json_Dict = Dict[str, Any] Json_List = List[Json_Dict] Json = Union[Json_Dict, Json_List] StatMeta = D...
import numpy as np import librosa import os import sys import math import pdb import torch import torch.nn as nn import torch.nn.functional as F import torch.utils.checkpoint as cp from torch.nn.parameter import Parameter def init_layer(layer): """Initialize a Linear or Convolutional layer. """ nn.init.xavi...
import math import os os.environ["CUDA_VISIBLE_DEVICES"]="2" import argparse import json import tensorflow as tf import tensorflow_probability as tfp import numpy as np import matplotlib.pyplot as plt from mpl_toolkits.axes_grid1 import make_axes_locatable import netCDF4 import keras from keras import layers from ...
def load_ml_data(deg_data_file, mRNA_data_loc, mRNA_annotation_data, promoter_data_loc, promoter_annotation_data): # deg_data_file: a full path to transcriptome data # mRNA_data_loc: a full path to a directory where mRNA annotation data is...
# # Copyright (C) 2014 eNovance SAS <<EMAIL>> # # Author: <NAME> <<EMAIL>> # # 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 requi...
#!/usr/bin/env python3 # Copyright (c) Facebook, Inc. and its affiliates. # 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. r""" This module provides similar functionality as ``torch.distributed.launch``, with the...
"""Provides the user intefaces for browse.""" import re import geoip2.database from datetime import datetime from typing import Callable, Dict, Mapping, Union, Tuple, Any from flask import Blueprint, render_template, request, Response, session, \ current_app, url_for, redirect from werkzeug.exceptions import Inter...
# Thermal_Cam_v32.py # 2020-01-29 v3.2 # (c) 2020 <NAME> for Adafruit Industries import time import board import displayio from simpleio import map_range from adafruit_display_text.label import Label from adafruit_bitmap_font import bitmap_font from adafruit_display_shapes.rect import Rect import adafruit_amg88xx from...
''' @Description: The utils file @Author: xieydd @Date: 2019-08-13 14:15:23 @LastEditTime: 2019-09-24 10:55:54 @LastEditors: Please set LastEditors ''' import logging import numpy as np import torchvision.datasets as dset import os import torch import shutil import csv import torchvision.transforms as transforms from t...
import asyncio import dataclasses import json import re import time from typing import Dict, List, Optional, Sequence, Tuple, Union import httpstan.models import httpstan.schemas import httpstan.services.arguments as arguments import httpstan.utils import numpy as np import simdjson from clikit.io import ConsoleIO im...
# Copyright (c) 2015 Intel 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.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in ...
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2016, <NAME> <<EMAIL>> # 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 ANSIBLE_METADATA = {'metadata_version': '1.1', ...
# Copyright 2018 Intel 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.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writi...
# SPDX-FileCopyrightText: 2020 TQ Tezos <https://tqtezos.com/> # # SPDX-License-Identifier: LicenseRef-MIT-TQ import os, shutil, sys, subprocess, json from abc import ABCMeta, abstractmethod from typing import List # There are more possible fields, but only these are used by tezos services class Service: def __in...
import getpass import json import os import platform import subprocess import sys import time from pathlib import Path import logging import click import yaml LOG = logging.getLogger(__name__) kubeconfig = "--kubeconfig=" + os.path.expandvars("${SNAP_DATA}/credentials/client.config") def get_current_arch(): # ...
#! /usr/bin/env python # Copyright (c) 2012 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. from __future__ import print_function import itertools import json import os.path import pprint import re import sys if sys.vers...
import hashlib import json import jsonschema import os import re from enum import Enum from yaml import MarkedYAMLError import yaml from jinja2 import Environment, PackageLoader from binary import FixedLengthTypes, FixedListTypes, FixedEntryListTypes, FixedMapTypes from java import java_types_encode, java_types_decod...
from __future__ import print_function from __future__ import absolute_import from __future__ import unicode_literals import numpy as np from SimPEG import EM import matplotlib.pyplot as plt import matplotlib.ticker as ticker import matplotlib import matplotlib.gridspec as gridspec from ipywidgets import * from scipy.c...
# Copyright 2014 Google Inc. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or ...
import numpy as np from sklearn.linear_model import Ridge import matplotlib.pyplot as plt global_proton_dict = {'H': 1, 'He': 2, 'Li': 3, 'Be': 4, 'B': 5, 'C': 6, 'N': 7, 'O': 8, 'F': 9, 'Ne': 10, 'Na': 11, 'Mg': 12, 'Al': 13, 'Si': 14, 'P': 15, 'S': 16, 'Cl': 17, 'Ar': 18, 'K': 19, 'Ca': 20, ...
#!/usr/bin/env python # -*- coding: utf-8 -*- # Copyright 2017 <EMAIL> # Licensed under the MIT license (http://opensource.org/licenses/MIT) from __future__ import absolute_import, division, print_function, unicode_literals import usb.core import usb.util import usb.control import time import sys import intelhex imp...
from __future__ import absolute_import, division, print_function from libtbx import easy_run from libtbx.test_utils import assert_lines_in_file import mmtbx.monomer_library.server from mmtbx import monomer_library # from here: https://www.wwpdb.org/documentation/file-format-content/format33/sect6.html # LINK # Overvi...
import glob import html import json import logging import os import re import sys import traceback from collections import OrderedDict from libtbx import phil import xia2 from xia2.Modules.Report import Report from xia2.Handlers.Citations import Citations import xia2.Handlers.Streams logger = logging.getLogger("xia2....
import pprint ''' Project 1: Chess Written by <NAME> EXAMPLE CHANGE ''' ''' In this project, students will model a chess board and chess piece movements using Python. This will require using all of the concepts learned in Lessons 1-3. Students are recommended to use a 2-D list to model the chess board, an...
from copy import deepcopy from dataclasses import dataclass from typing import Any, Dict, Optional, Tuple, Union import numpy as np from pydantic import root_validator, validator from ...utils.colormaps import Colormap from ...utils.colormaps.categorical_colormap import CategoricalColormap from ...utils.colormaps.col...
import ustruct as struct from .crc8 import crc8 from .cc_constants import * SIZEOF_FLOAT = struct.calcsize('f') SIZEOF_USHORT = struct.calcsize('H') SIZEOF_UINT = struct.calcsize('I') ############################################ # Helper functions ############################################ __loglevel = L...
# coding=utf-8 # Copyright 2019 The Tensor2Tensor 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...
# coding=utf-8 # # This file is part of Hypothesis, which may be found at # https://github.com/HypothesisWorks/hypothesis-python # # Most of this work is copyright (C) 2013-2018 <NAME> # (<EMAIL>), but it contains contributions by others. See # CONTRIBUTING.rst for a full list of people who may hold copyright, and # co...
import argparse import pystan import numpy #import matplotlib #matplotlib.use('Agg') import matplotlib.pyplot as pyplot import pickle from hashlib import md5 import logging import time import subprocess import csv from savagedickey import calculate_savagedickey_kde_1d def stan_cache(model_name, **kwargs): f=o...
from __future__ import print_function import os import sys here = os.path.dirname(os.path.abspath(os.path.dirname(__file__))) sys.path = [here] + sys.path import numpy as np import theano import mner.optimizer import mner.util.util import mner.solvers.solvers import mner.solvers.constraints import mner.solvers.sample...
# Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"). # You may not use this file except in compliance with the License. # A copy of the License is located at # # http://www.apache.org/licenses/LICENSE-2.0 # # or in th...
import os import pdb import re import rasterio import glob import json import subprocess import numpy import pandas as pd import numpy as np import sys from cachetools import cached from geopy.geocoders import Nominatim from shutil import copyfile import shapefile import fiona # TODO zonal statistics: https://github...
# -*- coding: utf-8 -*- ######################################################################## # # License: BSD # Created: 2005-05-24 # Author: <NAME> - <EMAIL> # # $Id$ # ######################################################################## """Utilities for PyTables' test suites.""" import os import re import ...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Fri May 24 16:01:23 2019 @author: shiro """ import cv2 import numpy as np import os from pathlib import Path import skimage import keras from keras.callbacks import Callback import random import math random.seed(20) import time import gc import numba from ...
from zeit.cms.browser.widget import CheckboxDisplayWidget from zeit.cms.browser.widget import RestructuredTextWidget from zeit.cms.content.interfaces import ICommonMetadata from zeit.cms.i18n import MessageFactory as _ from zeit.cms.repository.interfaces import IAutomaticallyRenameable from zeit.content.article.interfa...
import os, shutil import sys sys.path.append(".") import torch from torch import nn from torch.nn.parallel.data_parallel import DataParallel from openprompt.utils.cuda import model_to_device from tensorboardX import SummaryWriter from tqdm import tqdm import dill import warnings from typing import Callable, Union tr...
# Licensed under a 3-clause BSD style license - see LICENSE.rst """ Implements rotations, including spherical rotations as defined in WCS Paper II [1]_ `RotateNative2Celestial` and `RotateCelestial2Native` follow the convention in WCS Paper II to rotate to/from a native sphere and the celestial sphere. The implement...
import sublime import sublime_plugin import os.path import subprocess import re # need regular expression operations import fnmatch # need Unix filename pattern matching # import traceback DEFAULT_EXECUTABLE = "uncrustify" DEFAULT_RULE = 0 keep_quiet = False # force all messages goto the status bar (do not pop dia...
import torch import torch.nn as nn import torch.nn.functional as F import math class FrozenBN(nn.Module): def __init__(self, num_channels, momentum=0.1, eps=1e-5): super(FrozenBN, self).__init__() self.num_channels = num_channels self.momentum = momentum self.eps = eps self...
from __future__ import annotations # region [Imports] # * Standard Library Imports ----------------------------------------------------------------------------> import os import asyncio from configparser import ConfigParser, NoOptionError, NoSectionError from collections import namedtuple from typing import List from...
import json import warnings import numpy as np import shapely.geometry from shapely.ops import cascaded_union from shapely.geometry import ( shape as to_shape, Point, MultiPoint, Polygon, LineString, MultiLineString, GeometryCollection, CAP_STYLE, mapping) from mercantile import Bbox, xy_bounds, tiles...
""" Prototype. This is currently under active development. TODO: ? Sparse - Package integration (SHAP, EBM) ? Tensorflow """ from typing import Any, AnyStr, Union, List, Tuple, Optional, Dict from abc import abstractmethod import numbers _available_modules = set() class AtomicSlicer: """ Wrapping object that ...
#!/usr/bin/env python # vim: tabstop=8 expandtab shiftwidth=4 softtabstop=4 from __future__ import print_function import libtorrent as lt import unittest import time import datetime import os import shutil import binascii import subprocess as sub import sys import inspect import pickle # include terminal interface ...
import pickle import keras import uuid from paillier import * from keras.models import Sequential from keras.layers import Dense, Dropout, Flatten, LeakyReLU from keras.layers import Dense, LeakyReLU, BatchNormalization, Reshape from keras import Input, Model, Sequential from keras.layers import Conv2D, MaxPool...
from __future__ import unicode_literals from prompt_toolkit.application import Application from prompt_toolkit.application.current import get_app, set_app from prompt_toolkit.auto_suggest import AutoSuggestFromHistory from prompt_toolkit.buffer import Buffer from prompt_toolkit.enums import EditingMode from prompt_too...
import os import dota_utils as util import SplitOnlyImage_multi_process as SplitOnlyImage_multi_process import ImgSplit_multi_process as ImgSplit_multi_process import argparse import shutil from multiprocessing import Pool import numpy as np from functools import partial import cv2 def parse_args(): parser = argpa...
#!/usr/bin/env python3 # SPDX-FileCopyrightText: 2021 <NAME> <<EMAIL>> # SPDX-License-Identifier: MIT """Simple tool to manipulate PAK firmware files (list, extract, replace) for Swann and Reolink devices. See -h.""" import argparse import itertools import os.path import struct import textwrap import zlib from typin...
from __future__ import annotations import os from os import path as osp from typing import cast, TYPE_CHECKING import click from .cli_core import select_dbx_path_dialog from .dialogs import confirm, select from .output import ok, echo, Table, TextField, DateField, warn from .utils import get_term_width from .common ...
import os import shutil import argparse import json import logging import math import botocore import numpy as np from rl_coach.base_parameters import TaskParameters, DistributedCoachSynchronizationType, RunType from rl_coach import core_types from rl_coach.data_stores.data_store import SyncFiles from rl_coach.logger ...
# coding: utf-8 """ Provides the importer tool. The importer can be used to importer entities from local directories into a ComodIT server. """ from __future__ import print_function from builtins import str from builtins import object import os import getpass from comodit_client.api.application import Application fro...
# -*- coding: utf-8 -*- """ Handle Bézier paths. """ from __future__ import unicode_literals, absolute_import import struct import six from . import docs from . import enums from . import util from typing import Any, BinaryIO, Dict, List, Optional, TYPE_CHECKING, Union # NOQA if TYPE_CHECKING: from . i...
#!/usr/bin/python # Copyright (c) 2020, 2021 Oracle and/or its affiliates. # This software is made available to you under the terms of the GPL 3.0 license or the Apache 2.0 license. # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) # Apache License v2.0 # See LICENSE.TXT for d...
"""Hybrid Script Parser""" import ast import operator import logging import sys from .util import make_nop, halide_imm_types, is_docstring, _internal_assert from .intrin import LOOP_INTRIN, MATH_INTRIN from .var_decl import determine_variable_usage from ..api import thread_axis from ..api import all as _all from ..api...
# -*- coding: utf-8 -*- """ Model description """ import argparse import pkg_resources import yaml import json import os import shutil import datetime import urllib.request import urllib.error import tarfile import tempfile from tensorflow.python.client import device_lib from werkzeug.exceptions import BadRequest fro...
# -*- coding: utf-8 -*- """Generates code for calling Rust from Python.""" import os.path import re import typing from collections import namedtuple from .ffi_defs import * from .ffi_defs import get_rs_lib from .pytypes import MissingTypeHint, PyBool, PyDict, PyList, PyString, PyTuple from ..type_checkers import type...
#!/usr/bin/env vpython # Copyright 2013 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. """Patch an orderfile. Starting with a list of symbols in a binary and an orderfile (ordered list of sections), matches the symbols i...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Fri May 10 17:59:26 2019 @author: nakul """ import random import math import copy import numpy as np import matplotlib.pyplot as plt show_animation = True # ============================================================================= # plt.plot(ox,oy,".k...
#%% import networkx as nx import pandas as pd from ctrace.runner import * from ctrace.utils import load_graph_cville_labels, load_graph_montgomery_labels, read_extra_edges from ctrace.simulation import * from ctrace.recommender import * from collections import namedtuple import random #Default random number gen...
# Built-in import os import shutil import requests import warnings # Common import numpy as np __all__ = ['search_online', 'search_online_by_wavelengthA', 'download', 'download_all', 'clean_downloads'] # Check whether a local .tofu/ repo exists _URL = 'https://open.adas.ac.uk' _URL_SEARCH = _URL + '/fr...
from datetime import timedelta from dateutil.parser import parse from dateutil.relativedelta import relativedelta from django.utils.timezone import now from freezegun import freeze_time from rest_framework import status from posthog.helpers.session_recording import Event, compress_and_chunk_snapshots from posthog.mod...
from __future__ import annotations import datetime import enum_lib import json import os import platform import threading import traceback import typing import uuid from xml.sax import saxutils from NeonOcean.S4.Order import Language, Paths, This from NeonOcean.S4.Order.Data import Global from NeonOcean.S4.Order.Tool...
#!/usr/bin/env python3 def get_input(): import argparse parser = argparse.ArgumentParser() parser.add_argument( 'Output-File', help='Output-File from a RASSI calculation' ) parser.add_argument( '-s', '--sigma', required=False, type=float, default=150, help='Plotting option for gaussian broadening...
#imports relevant libraries import pandas as pd import matplotlib.pyplot as plt import numpy as np from scipy import stats from scipy.stats import genextreme as gev from sympy import symbols, log, lambdify, exp, diff #uses sympy analytic library to take the analytic derivatives of the likelihood z,...
# Copyright (c) 2020 NVIDIA Corporation. All rights reserved. # This work is licensed under the NVIDIA Source Code License - Non-commercial. Full # text can be found in LICENSE.md import torch import torch.nn as nn import torch.nn.functional as F import time import sys, os import numpy as np import cv2 import scipy im...
""" Pointers. """ from rpython.rlib import rposix from rpython.rlib.rarithmetic import ovfcheck from rpython.rtyper.annlowlevel import llstr from rpython.rtyper.lltypesystem import lltype, rffi from rpython.rtyper.lltypesystem.rstr import copy_string_to_raw from pypy.interpreter.error import OperationError, oefmt, wr...
""" Estimate P(E|e_i+1) of ranking entities in row population author: <NAME> """ from elastic import Elastic from row_evaluation import Row_evaluation from scorer import ScorerLM import math import json import re import pdb from tqdm import tqdm import numpy as np import os import pickle from metric import mean_avera...
# -*- coding: utf-8 -*- ########################################################################### # Copyright (c), The AiiDA team. All rights reserved. # # This file is part of the AiiDA code. # # ...
import numpy as np from Models import * class FitParameters: def __init__(self, mode_freq, mode_l, freq, power, powers, dnu, ifSplit=False, inclination=None, ifResolved=True, resolution=None, ifVaryLwPerMode=True, ifVaryFsPerMode=True, ifVaryAmpPerMode=True): self.mode_l = mode_l self.mode_freq = mo...
"""Test for the client server pair for echo.""" from server import parse_request, resolve_uri, response_ok, response_error from server_client import client from os import path import pytest html_path = path.realpath(__file__).replace('test_server.py', 'webroot/a_web_page.ht...
"""Attention combination strategies. This modules implements attention combination strategies for multi-encoder scenario when we may want to combine the hidden states of the encoders in more complicated fashion. Currently there are two attention combination strategies flat and hierarchical (see paper `Attention Combi...
# (C) Copyright 2016 Hewlett Packard Enterprise Development LP # 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/LICEN...
import pytest import sys import os import numpy as np from deltametrics.sample_data import _get_rcm8_path, _get_golf_path from deltametrics import mask from deltametrics import cube from deltametrics import plan from deltametrics import section simple_land = np.zeros((10, 10)) simple_shore = np.zeros((10, 10)) sim...
from django.db import models from django.db.models import Q from django.contrib.postgres.search import SearchVectorField from django.contrib.postgres.indexes import GinIndex from django.core.validators import RegexValidator from django.utils.translation import gettext_lazy as _ from django.utils import timezone from dj...
# Copyright 2019 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/python # encoding: utf-8 # # Copyright (c) 2015 <EMAIL> # # MIT Licence. See http://opensource.org/licenses/MIT # # Created on 2015-09-01 # """vpn.py (list|connect|disconnect|app) [<query>] [<name>] Usage: vpn.py list [<query>] vpn.py connect [-a|--all] [<name>] vpn.py disconnect [-a|--all] [<n...
# From <NAME>'s Semantic MapNet # Original Rednet # https://github.com/JindongJiang/RedNet # Vince's Port # https://github.com/vincentcartillier/Semantic-MapNet import os import torch import torch.nn as nn import torch.nn.functional as F import torch.utils.model_zoo as model_zoo # Resnet model urls model_urls = { ...
from typing import Any from typing import List from typing import Union import casadi as ca import pandas as pd def _infer_model_type(nx: Union[int, None], nu: Union[int, None], np: Union[int, None]): """Infer which inputs the model receives.""" # CASE parameters are not specified if nx is not None and ...
from json.tool import main import math import cv2 import numpy as np from pyzbar import pyzbar BLUR_VALUE = 3 SQUARE_TOLERANCE = 0.15 AREA_TOLERANCE = 0.3 # previously 0.15 DISTANCE_TOLERANCE = 0.25 WARP_DIM = 300 SMALL_DIM = 29 # global variable # global qr_center, image_center def count_children(hierarchy, par...
#/usr/bin/env python3 # -*- coding: utf-8 -*- # # Copyright (C) 2020 The F4PGA Authors. # # Use of this source code is governed by a ISC-style # license that can be found in the LICENSE file or at # https://opensource.org/licenses/ISC # # SPDX-License-Identifier: ISC """ This file uses the fpga_interchange to create a...
from __future__ import absolute_import, division, print_function from scitbx.array_family import flex import iotbx.pdb from libtbx import group_args from libtbx.utils import user_plus_sys_time import mmtbx.f_model from mmtbx.dynamics import simulated_annealing as sa import random from mmtbx.dynamics import cartesian_dy...
# Copyright (c) Facebook, Inc. and its affiliates. # All rights reserved. # # This source code is licensed under the license found in the # LICENSE file in the root directory of this source tree. from __future__ import absolute_import from __future__ import unicode_literals from __future__ import print_function from _...
# Copyright (c) 2009-2021 The Regents of the University of Michigan # This file is part of the HOOMD-blue project, released under the BSD 3-Clause # License. """User-defined pair potentials for HPMC simulations.""" import hoomd from hoomd import _compile from hoomd.hpmc import integrate if hoomd.version.llvm_enabled:...
""" Tests for Term. """ from collections import Counter from itertools import product from toolz import assoc import pandas as pd from zipline.assets import Asset, ExchangeInfo from zipline.errors import ( DTypeNotSpecified, InvalidOutputName, NonWindowSafeInput, NotDType, TermInputsNotSpecified, ...
# -*- mode: python; encoding: utf-8 -*- # # Copyright 2012 <NAME>, Opera Software ASA # # 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 # # Unl...
from _config import * from Creator import * from PIL import Image, ImageDraw import os import re import random serial_id = random.randint(000000000, 999999999) ''' @Author: DevCycle @Version: 0.3 @new: Added Classes @important • ''' class DrawImage(): global image_with_text global image global draw ...
import struct import string import numpy as np from stl import ASCII_FACET, BINARY_HEADER, BINARY_FACET from ffd_axisymetric import Body, Shell from openmdao.main.api import Component, VariableTree from openmdao.lib.datatypes.api import VarTree, Array from openmdao.lib.geometry.geom_data import GeomData def _blo...
""" Vision Transformer (ViT) in PyTorch A PyTorch implement of Vision Transformers as described in 'An Image Is Worth 16 x 16 Words: Transformers for Image Recognition at Scale' - https://arxiv.org/abs/2010.11929 The official jax code is released and available at https://github.com/google-research/vision_transformer St...
import math __all__ = ['earcut', 'deviation', 'flatten'] def earcut(data, holeIndices=None, dim=None): dim = dim or 2 hasHoles = holeIndices and len(holeIndices) outerLen = holeIndices[0] * dim if hasHoles else len(data) outerNode = linkedList(data, 0, outerLen, dim, True) triangles = [] i...
# Licensed under a 3-clause BSD style license - see LICENSE.rst """This module contains classes and functions to standardize access to configuration files for Astropy and affiliated packages. .. note:: The configuration system makes use of the 'configobj' package, which stores configuration in a text format li...
import pybullet as p import numpy as np import quaternion import random from .rrt.pybullet_utils import ( get_self_link_pairs, violates_limits ) from .rrt.pybullet_utils import ( get_difference_fn, get_distance_fn, get_sample_fn, get_extend_fn, control_joints, set_joint_positions, ge...