text
stringlengths
6.04k
39.5k
""" The Python engine for kastore. The file format layout is as follows. +===================================+ + Header (64 bytes) +===================================+ + Item descriptors (n * 64 bytes) +===================================+ + Keys packed densely. +===================================+ + Arrays packed ...
import sqlite3 from main import make_spotify_request from gensim.utils import simple_preprocess import os import numpy as np class SpotifyTrackFeatureGenerator: """ A class to transform the spotify DB to add track feature info. """ def __init__(self, db_path:str, db_name:str, audio_feature_list:list, arti...
from __future__ import print_function import sys,os,glob,re import select try: from setuptools import setup, Extension from setuptools.command.build_ext import build_ext from setuptools.command.install_scripts import install_scripts from setuptools.command.easy_install import easy_install import s...
import numpy as np import math from scipy.spatial.transform import Rotation as R from math import ceil,trunc,floor,sin,cos,atan,acos,sqrt EPS = 1e-6 def angle_axis_from_quaternion(quater): angle = 2 * acos(quater[3]) axis = quater[:3]/(sin(angle/2)+EPS) return angle * axis def angle_axis_from_quaternion_batch(...
import os import json import pickle import os.path as osp from PIL import Image import numpy as np from scipy.sparse import csr_matrix from scipy.io import loadmat from sklearn.metrics import average_precision_score, precision_recall_curve from .imdb import imdb def _compute_iou(a, b): x1 = max(a[0], b[0]) y...
# THis optimizer is a python port of the original LMMCP software # written by <NAME> and <NAME> # Original source code and documentation can be found at: # http://www.mathematik.uni-wuerzburg.de/~kanzow/ # ported from lmmcp.m import time import numpy as np # parameter settings eps1 = 1e-8 # default: 1e-6 eps2 = 1...
# -*- coding: utf-8 -*- import operator import numpy as np from netCDF4 import Dataset from .utils import setDimensions class OBSstruct(object): """ Simple ROMS observation file object Typical usage: : Initializing from existing ROMS observation file >>> fid = Dataset(OBSfile) >>> OBS = OBSstruct(...
import numpy as np """ 蒙哥马利预计算:高位相减法快速求 a mod p """ def RapidMod(a: int, p: int): if a < 0: c, r = RapidMod(-a, p) if r: return -c - 1, p - r else: return -c, 0 if a < p: return 0, a a_len = a.bit_length() p_len = p.bit_length() d_len = ...
# -*- coding: utf-8 -*- # Copyright (c) 2017 - for information on the respective copyright owner # see the NOTICE file and/or the repository https://github.com/boschresearch/statestream # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License....
#!/usr/bin/python3 import os import time, datetime import zmq import numpy as np class CustomQueue(): def __init__(self, from_port, to_port, from_ip='localhost', to_ip='*', name='', save_dir='./', verbosity=4, **kwargs): # Save these in case we want to check them later self.from_ip = from_...
import argparse import configparser import csv import json import os import random import subprocess import time from datetime import datetime from pathlib import Path import numpy as np import torch import torch.distributed as dist import torch.utils.data.distributed from apex import amp from apex.parallel import Dis...
import numpy as np from pathlib import Path import spotipy import pandas as pd from typing import Dict, List, Union, Tuple import seaborn as sns from sklearn.preprocessing import MultiLabelBinarizer from scipy.spatial.distance import hamming from scipy.cluster.hierarchy import ( fcluster, dendrogram, linkage, cut_...
""" Input file editor for openQCD https://github.com/lkeegan/openQCD-input-file-editor http://luscher.web.cern.ch/luscher/openQCD Module containing most of the functions """ from PyQt4 import QtGui import ConfigParser import StringIO import webbrowser def _split_field(field, form): """ Take a widget `field`...
#!/usr/bin/env python # -*- coding: utf-8 -*- """ # CODE NAME HERE # CODE DESCRIPTION HERE Created on 2022-02-10 @author: cook """ from astropy.coordinates import EarthLocation from astropy.io import fits from astropy.table import Table from astropy.time import Time import itertools import matplotlib.pyplot as plt ...
# -*- coding: utf-8 -*- """Manager for OCSPDash.""" from __future__ import annotations import logging import os import secrets import uuid from dataclasses import dataclass from itertools import groupby from operator import attrgetter from typing import Iterable, List, Mapping, Optional, Tuple from sqlalchemy impor...
# -*- coding: utf-8 -*- from django.shortcuts import render, render_to_response from django.utils.html import format_html from django.http import HttpResponse # Create your views here. from models import Softener, Purifier, Drinking from models import EquipmentCategories, Equipment from models import VentilationSpec, ...
import sys, os, copy from polyrec.transformations import Transformation from polyrec.pyast import Analyze from polyrec.util import cleanup, shift from polyrec.util import InterchangeArg, ChangeCallee from polyrec.util import CallAddArg, ChangeStride, ReplaceVar import ast, astunparse class Transform: def __init_...
#!/usr/bin/env python """Label connected components. """ import sys import argparse import os import numpy as np from scipy.ndimage.measurements import label as scipy_label from skimage.segmentation import relabel_sequential from skimage.morphology import remove_small_objects, binary_dilation from skimage.measure i...
# Copyright 2021 DeepMind Technologies Limited # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agr...
from dataclasses import dataclass from datetime import datetime import json from typing import Iterable import csv import logging from django.contrib import messages from django.contrib.auth.mixins import LoginRequiredMixin from django.core.exceptions import PermissionDenied from django.db.utils import IntegrityError ...
# Copyright 2019 UniversalQCompiler (https://github.com/Q-Compiler/UniversalQCompiler) # 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 # ...
from rest_framework import generics from rest_framework import permissions as drf_permissions from rest_framework.exceptions import NotFound from framework.auth.oauth_scopes import CoreScopes from osf.models import ( Guid, BaseFileNode, FileVersion, QuickFilesNode ) from api.base.exceptions import Go...
## DO NOT MODIFY ## 82bf3fe33405e8f3d2fff746b45c4d637d3a15b7-1.0.0.7 ## DO NOT MODIFY ## Metadata: # <?xml version="1.0" encoding="utf-8"?> # <metadata name="Sensor Speed Test" description="Sensor Speed" bin="23" product="S3908"> # <parameter name="Limits" type="string[][]" description="Limits for Sensor Sp...
""" Halo callback object """ #----------------------------------------------------------------------------- # Copyright (c) 2013, yt Development Team. # # Distributed under the terms of the Modified BSD License. # # The full license is in the file COPYING.txt, distributed with this software. #----------------------...
#!/usr/bin/env python # -*- encoding: utf-8 -*- # @file : attention_layer.py # @time : 2021/08/05 10:05:45 # @authors : <NAME>, <NAME> # @version : 1.0 # @contact : <EMAIL>; <EMAIL> # @desc : None # Copyright (c) 2021 SenseTime IRDC Group. All Rights Reserved. # # Licensed under the Apache License,...
# Copyright 2019-present <NAME>, <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...
import rospy import smach from tf import transformations as tft from std_msgs.msg import Int16 from geometry_msgs.msg import Quaternion from helpers import suction from helpers import movement as m from helpers import transforms as t from helpers.robot_constants import * from helpers.suction import set_suck_level f...
import os import random import math import argparse import logging import os.path as osp from io import BytesIO import lmdb import numpy as np from PIL import Image from tqdm import tqdm from mpl_toolkits.axes_grid1 import ImageGrid import matplotlib.pyplot as plt plt.switch_backend('agg') import mxnet as mx import m...
#!/usr/bin/env python ''' This script is a wrapper for module one of the cpo-pipeline including QC and Assembly. It uses Mash2.0, Kraken2.0 and fastqc to check for sequence contamination, quality information and identify a reference genome. Then attempts to assemble the reads, attempting to filter contamination away i...
import platform import textwrap import pytest from conans.client.tools.env import environment_append from conans.model.ref import ConanFileReference from conans.test.utils.tools import TestClient @pytest.fixture def client(): lib_ref = ConanFileReference.loads("foolib/1.0") lib_conanfile = textwrap.dedent("...
# Copyright 2015 Pants project contributors (see CONTRIBUTORS.md). # Licensed under the Apache License, Version 2.0 (see LICENSE). import os import re import unittest import unittest.mock from textwrap import dedent from typing import Tuple, Type, cast from pants.base.exceptions import ResolveError from pants.base.pr...
# xml_hier2flat.py - convert a hierarchical PhysiCell_settings.xml (with inheritance # of <cell_definitions>) into one without inheritance, i.e., # each <cell_definition> is "flattened" (expanded to be complete). # # Usage: # $ python xml_hier2flat.py <hierarc...
from twembeddings.build_features_matrix import format_text, find_date_created_at, build_matrix from twembeddings.embeddings import TfIdf from twembeddings import ClusteringAlgoSparse from twembeddings import general_statistics, cluster_event_match from twembeddings.eval import cluster_acc import logging import sklearn....
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Copyright (c) 2021 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 # # Unl...
# Copyright 2013-2018 Lawrence Livermore National Security, LLC and other # Spack Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) from __future__ import division import os import re import functools import collections import inspect from datetime impo...
""" A few different backtracking line search subsolvers. BoundsEnforceLS - Only checks bounds and enforces them by one of three methods. ArmijoGoldsteinLS -- Like above, but terminates with the ArmijoGoldsteinLS condition. """ import sys import numpy as np from openmdao.core.analysis_error import AnalysisError from...
#!/usr/bin/env python3 import yaml import json import sys import re import os import argparse from collections import defaultdict from collections import OrderedDict from collections import namedtuple import ipaddress _data = { "_meta" : { "hostvars": {} }} _matcher = {} _hostlog = [] inventory_uniq_groups=[] var_inv...
import pygame, os #import pytmx from pytmx import pytmx from gamelib.constants import SCREEN, ASSET, PARTICLE, GAME, PLAYER from gamelib.player import Player from gamelib.physicsbody import PhysicsBody from gamelib.datafragment import DataFragment from gamelib.saw import Saw from gamelib.particlefactory import Particle...
# Copyright (C) 2002-2007 Python Software Foundation # Author: <NAME>, <NAME> # Contact: <EMAIL> """Header encoding and decoding functionality.""" __all__ = [ "Header", "decode_header", "make_header", ] import re import binascii import email.quoprimime import email.base64mime from email.errors import H...
""" Helper functions for Trainers """ import datetime import logging import os import shutil import json from os import PathLike from typing import Any, Dict, Iterable, Optional, Union, Tuple, Set, List from collections import Counter import torch from torch.nn.utils import clip_grad_norm_ from allennlp.common.checks...
import glob import hashlib import os import platform import sys import shutil import tarfile import textwrap import zipfile from tempfile import mkstemp, gettempdir from urllib.request import urlopen, Request OPENBLAS_V = '0.3.9' # Temporary build of OpenBLAS to test a fix for dynamic detection of CPU OPENBLAS_LONG =...
""" Trains LOLA on IPD or MatchingPennies with exact value functions. Note: Interfaces are a little different form the code that estimates values, hence moved into a separate module. """ import numpy as np import tensorflow as tf import os import json from collections import Iterable from collections import dequ...
# -*- coding: UTF-8 -*- """ The driver for mpu6050 chip, it is a temperature and humidity sensor. """ from micropython import const from driver import I2C from utime import sleep_ms import math MPU_SELF_TESTX_REG = const(0X0D) #自检寄存器X MPU_SELF_TESTY_REG = const(0X0E) #自检寄存器Y MPU_SELF_TESTZ_REG = const(0X0F) #自检...
# Licensed under a 3-clause BSD style license - see LICENSE.rst """ A module for searching remote source and observation catalogs A Simple Cone Search (SCS) service allows a client to search for records in a source or observation catalog whose positions are within some minimum distance of a search position (i.e. withi...
# -*- coding: utf-8 -*- from collections import namedtuple from functools import partial import bisect import Default import inspect import json import os import re import sublime import sublime_plugin DEBUG = False AnsiDefinition = namedtuple("AnsiDefinition", "scope regex") regex_obj_cache = {} def debug(view, m...
import torch import numpy as np import gurobipy import enum import warnings import itertools def strengthen_relu_mip_w_indices(c: float, w: torch.Tensor, b: torch.Tensor, lo: torch.Tensor, up: torch.Tensor, indices: set): """ We strengthen th...
# -*- coding: utf-8 -*- """ Utilities ========= Provides several useful utility functions. """ # %% IMPORTS # Built-in imports from ast import literal_eval from inspect import currentframe, getouterframes, isclass, isfunction, ismethod import logging import logging.config import re import warnings # e13Tools impor...
import argparse import os import pickle from numbers import Number from typing import Optional import numpy as np import torch from torch.optim.optimizer import Optimizer from tqdm import tqdm import boilr.data from boilr.nn.utils import print_num_params from boilr.options import get_option from boilr.utils.meta impo...
# Copyright (c) 2017-2018 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 ...
from typing import Any, Callable, List, Dict, Union, Optional, Sequence, Tuple from numpy import ndarray from collections import OrderedDict from scipy import sparse from sklearn.utils import check_array import numpy as np import typing import time import pandas as pd import uuid from d3m import container from d3m.pri...
from functools import partial from copy import copy, deepcopy from cryptotools.ECDSA.secp256k1 import PublicKey from cryptotools.message import Signature from cryptotools.transformations import bytes_to_int, int_to_bytes, bytes_to_hex, hex_to_bytes, hash160, sha256 from cryptotools.BTC.opcodes import OP, SIGHASH, TX fr...
import numpy as np from ..color import rgb2gray from ..util.dtype import dtype_range, dtype_limits from .._shared.utils import warn __all__ = ['histogram', 'cumulative_distribution', 'equalize_hist', 'rescale_intensity', 'adjust_gamma', 'adjust_log', 'adjust_sigmoid'] DTYPE_RANGE = dtype_range.copy() DT...
# -*- coding: utf-8 -*- # Copyright: See the LICENSE file. from __future__ import unicode_literals import itertools import logging from . import enums from . import compat from . import errors from . import utils logger = logging.getLogger('factory.generate') class BaseDeclaration(utils.OrderedBase): """A fa...
# -*- coding: utf-8 -*- # # Copyright © Spyder Project Contributors # Licensed under the terms of the MIT License # (see spyder/__init__.py for details) """ Utilities """ from __future__ import print_function from itertools import islice import re # Local imports from spyder.config.base import get_s...
import os import re import hou import json import errno import shutil from hutil.Qt import QtCore, QtGui, QtWidgets, QtUiTools material_library=None HOWTO_INSTALL_MD = ''' ### How to install 1. Download MaterialX version of "Radeon ProRender Material Library" - [link](https://drive.google.com/file/d/1e2Qys1UMi9pu_x3w...
# -*- coding: utf-8 -*- # @File : image_caption_with_attention/image_caption_with_atten.py # @Info : @ TSMC-SIGGRAPH, 2018/8/23 # @Desc : # -.-.. - ... -- -.-. .-.. .- -... .---. -.-- ..- .-.. --- -. --. ..-. .- -. """ refer to: https://github.com/tensorflow/tensorflow/blob/master/tensorflow/contrib/eager...
""" Tests for core and those that do not work outside (because of import error for example) """ import os import pickle # nosec import Queue import random # nosec import shutil import socket import string import sys import threading import time import unittest import protocol import state import helper_sent import ...
# -*- coding: utf-8 -*- from bs4 import BeautifulSoup import pandas as pd import requests, sys, re # The different 'modes; you can run the tool in from the command line. This choice is passed on the command line by sys argument 1. modes = { '-tran':"Return a simple 'observation per row' CSV of all dat...
#!/usr/bin/env python3 # ev3-photobooth.py # # A simple program for taking photos with a webcam on LEGO MINDSTORMS EV3 (running ev3dev). # The MIT License (MIT) # # Copyright (c) 2016 <NAME> <<EMAIL>> # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated do...
import tensorflow as tf import pickle import sys import numpy as np import os from pdbfixer import PDBFixer from simtk.openmm import app import Bio.SeqUtils as seq from Bio import pairwise2 from simtk import unit import math import tqdm import os import random import traceback import gsd.hoomd from nmrdata import * MA...
from PIL import Image from jsonschema import FormatChecker from jsonschema import Draft4Validator from jsonschema import FormatError import os import re import json import base64 import logging import datetime import time import decimal import cgi import itertools import io import subprocess import calendar import hash...
''' Unit test for the high level vds interface for eiger https://support.hdfgroup.org/HDF5/docNewFeatures/VDS/HDF5-VDS-requirements-use-cases-2014-12-10.pdf ''' import numpy as np from numpy.testing import assert_array_equal import os import os.path as osp import shutil import tempfile import h5py as h5 from ..common ...
from hisim.component import Component, SingleTimeStepValues, ComponentInput, ComponentOutput from hisim import loadtypes as lt import copy from hisim.components.configuration import PhysicsConfig from hisim import utils #from math import pi #from math import floor from hisim.simulationparameters import SimulationParame...
""" `Reference <https://github.com/certified-spec/specPy/blob/master/doc/specformat.rst>`_ for the spec file format. """ import event_model from datetime import datetime import os from pathlib import Path import jinja2 import suitcase.utils from ._version import get_versions __version__ = get_versions()['version'] del...
# ------------------------------------------------------------------------------------------------ # Copyright (c) 2016 Microsoft Corporation # # 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 ...
import numpy as np import datetime import json import re from selenium import webdriver import bs4 as bs from yahoo.utils import parse_table from selenium.common.exceptions import TimeoutException def parse_float(s): if s == 'N/A' or s == '-' or s[0] == '∞': return np.nan s = s.replace(',', '') su...
from cbapi.query import PaginatedQuery, BaseQuery from cbapi.errors import ServerError, ApiError, TimeoutError import time from solrq import Q from six import string_types import logging import functools log = logging.getLogger(__name__) class QueryBuilder(object): """ Provides a flexible interface for buil...
#!/usr/bin/env python # -*- coding: utf-8 -*- """This module implements methods to perform object-level scheduling through cropping and merge of objects""" from copy import deepcopy from dataclasses import dataclass from enum import Enum import logging import math import os import sys from typing import Dict, List, T...
# 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 # distributed under th...
#!/usr/bin/env python # -*- coding: utf-8 -*- # # # osinfo.py # # Prints miscellaneous information about linux host. # # Licence: MIT (See LICENCE file or http://opensource.org/licenses/MIT) # Author: <NAME> <<EMAIL>> # import platform import getpass import subprocess import sys import os def get_distro_logo...
import numpy as np from collections import namedtuple from xnas.spaces.DARTS.ops import * import xnas.spaces.DARTS.genos as gt class DartsCell(nn.Module): def __init__(self, n_nodes, C_pp, C_p, C, reduction_p, reduction, basic_op_list): """ Args: n_nodes: # of intermediate n_nodes ...
# 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. '''Collections of messages and their translations, called cliques. Also collections of cliques (uber-cliques). ''' from __future__ import print_functio...
# -*- coding: utf-8 -*- from copy import deepcopy from urllib.parse import urlencode from django.conf import settings from django.db.models import ForeignKey from django.template import Template, Context from django.template.loader import render_to_string import requests import time from datetime import datetime from ...
### Copyright 2014, MTA SZTAKI, www.sztaki.hu ### ### Licensed under the Apache License, Version 2.0 (the "License"); ### you may not use this file except in compliance with the License. ### You may obtain a copy of the License at ### ### http://www.apache.org/licenses/LICENSE-2.0 ### ### Unless required by applicab...
############################################################################## # # Copyright (c) 2011 Zope Foundation and Contributors. # All Rights Reserved. # # This software is subject to the provisions of the Zope Public License, # Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution. # THIS SOF...
from flask import Flask, request, jsonify, abort, send_from_directory, redirect, send_file from flask_sqlalchemy import SQLAlchemy from flask_marshmallow import Marshmallow from flask_cors import CORS from marshmallow_sqlalchemy import ModelConverter from marshmallow import fields from roadtools.roadlib.metadef.databas...
# OpenPOWER Automated Test Project # # Contributors Listed Below - COPYRIGHT 2021 # [+] International Business Machines Corp. # # # 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://...
# 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...
"""Utilities for working with mulled abstractions outside the mulled package.""" import collections import hashlib import logging import os import re import sys import tarfile import threading from io import BytesIO import packaging.version import requests log = logging.getLogger(__name__) QUAY_REPOSITORY_API_ENDPO...
#!/usr/bin/python2.5 # # Copyright 2009 Google 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 ...
# # This file is part of LiteDRAM. # # Copyright (c) 2019 <NAME> <<EMAIL>> # Copyright (c) 2019-2020 <NAME> <<EMAIL>> # SPDX-License-Identifier: BSD-2-Clause # 1:2 frequency-ratio DDR3 PHY for Lattice's ECP5 # DDR3: 800 MT/s from functools import reduce from operator import or_ import math from migen import * from ...
import os import sys import json import shutil import logging import argparse import subprocess import urllib.request from pathlib import Path from typing import List, Union from contextlib import ExitStack from tempfile import TemporaryDirectory from packaging.version import InvalidVersion, Version from bs4 import Be...
# The data visualization module # Defines plotting methods for analysis from glob import glob from plotly import graph_objs as go, io as pio, tools from plotly.offline import init_notebook_mode, iplot from slm_lab.lib import logger, util import colorlover as cl import os import pydash as ps logger = logger.get_logger(...
import docker as dockerpy import os from datetime import datetime from tapis_cli import settings from tapis_cli.utils import (seconds, milliseconds, print_stderr) from tapis_cli.project_ini.mixins import AppIniArgs, DockerIniArgs, GitIniArgs from tapis_cli.commands.taccapis.v2.apps.create import AppsCreate from tapis_...
import numpy as np import pandas as pd import sys # import astroquery # import matplotlib.pyplot as plt # import glob from tqdm import tqdm # import matplotlib from tvguide import TessPointing from astropy.coordinates import SkyCoord from astropy import units as u from numpy.random import poisson, beta, uniform from nu...
""" Visualize data for the whole of the African continent. Written by <NAME> September 2020 """ import os import configparser import numpy as np import pandas as pd import geopandas as gpd import matplotlib.pyplot as plt import seaborn as sns import contextily as ctx from pylab import * #is this needed CONFIG = con...
import csv import datetime import io import uuid import boto3 from flask import ( Blueprint, render_template, request, redirect, url_for, jsonify, current_app, make_response, flash, abort ) from markupsafe import Markup from sqlalchemy.orm.attributes import flag_modified from ...
# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. import datetime import logging import tempfile import time import os from collections import OrderedDict import torch from tqdm import tqdm from ..structures.bounding_box import BoxList from ..utils.comm import is_main_process from...
from __future__ import annotations import asyncio import inspect import json from collections import defaultdict import discord, discord.channel, discord.http, discord.state from discord.ext import commands from discord.utils import MISSING from typing import Coroutine, TypeVar, Union, get_args, get_origin, overload...
# -*- coding: utf-8 -*- ########################################################################### # Copyright (c), The AiiDA team. All rights reserved. # # This file is part of the AiiDA code. # # ...
# Copyright (c) 2021 NVIDIA CORPORATION from typing import TypeVar, Union import cudf import numpy as np import pandas as pd T = TypeVar("T", bound="GeoArrowBuffers") class GeoArrowBuffers: """A GPU GeoArrowBuffers object. Parameters ---------- data : A dict or a GeoArrowBuffers object. The G...
# -*- coding: utf-8 -*- # Copyright (c) 2012 The Chromium OS Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """Configuration options for various cbuildbot tests.""" from __future__ import print_function import copy from chromite.li...
""" drs.py ****** :author: <NAME> <<EMAIL>> :coauthors: <NAME> <<EMAIL>>, <NAME> <<EMAIL>> :copyright: 2020, David Griffin / University of York :license: MIT - A copy of this license should have been provided with this file :publication: Generating Utilization Vectors for the Systematic Evaluation of Schedulability Te...
# Copyright (c) 2019 PaddlePaddle Authors. All Rights Reserve. # #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...
import importlib.resources as pkg_resources import os from pathlib import Path import numpy as np from hazma.background_model import BackgroundModel from hazma.flux_measurement import FluxMeasurement from hazma.target_params import TargetParams from scipy.interpolate import interp1d """ Parameters relevant to comput...
import pandas as pd import quantipy as qp import re def get_views(qp_structure): ''' Generator replacement for nested loops to return all view objects stored in a given qp container structure. Currently supports chain-classed shapes and cluster objects natively. To return views from a stack...
# -*- coding: utf-8 -*- from collections import OrderedDict import redbaron import traceback import importlib import pickle import os import sys import re #============================================================================== from redbaron import RedBaron from redbaron import StringNode, IntNode, FloatNode,...
import math import random import svgwrite from pyplot import Point, ShapeFiller, StandardDrawing def draw_tree(d): all_polylines = [] pos = Point(105, 105) line = Point(0, 30) max_depth = 7 cut = 2 / 3 a_disp = math.pi / 6 # a_disp = math.pi / 12 num_branches = 21 thickness_mm...
# -*- coding: utf-8 -*- """ CMS Simple Content Management System """ module = request.controller resourcename = request.function if not settings.has_module(module): raise HTTP(404, body="Module disabled: %s" % module) # ============================================================================= def i...
#!/usr/bin/python # -*- coding: utf-8 -*- import json import operator import re from functools import reduce import dateutil.parser import requests from dal import autocomplete from django import http from django.conf import settings from django.contrib.contenttypes.models import ContentType from django.core.exception...