text
stringlengths
6.04k
39.5k
# 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...
# Licensed under a 3-clause BSD style license - see LICENSE.rst import pytest import numpy as np from numpy.testing import assert_allclose from astropy.coordinates import SkyCoord import astropy.units as u from astropy.wcs import WCS from regions import ( CircleAnnulusSkyRegion, EllipseSkyRegion, PointSkyRe...
# -*- test-case-name: twisted.python.test.test_release -*- # Copyright (c) Twisted Matrix Laboratories. # See LICENSE for details. """ Twisted's automated release system. This module is only for use within Twisted's release system. If you are anyone else, do not use it. The interface and behaviour will change without...
from pathlib import Path from numpy import ( sin, cos, exp, pi, tan, log, sinh, cosh, tanh, sinc, sqrt, cbrt, angle, real, imag, abs, arcsin, arccos, arctan, arcsinh, arccosh, arctanh) from numpy import pi, e import numpy as np import matplotlib import matplotlib.pyplot as plt from matplotlib impo...
from typing import Dict import pyarrow.parquet as pq import pandas as pd import numpy as np import re import json from typing import List, Callable, Iterator, Union, Optional, Dict from sportsdataverse.dl_utils import download, flatten_json_iterative, key_check def espn_wnba_pbp(game_id: int, raw = False) -> Dict: ...
#!/usr/bin/env python """Generate rviz markers Notes: Blue markers: Position of a CF Red: Goals of CF Green: Formation goal :: _Rviz Markers wiki: http://wiki.ros.org/rviz/DisplayTypes/Marker """ import rospy from visualization_msgs.msg import Marker from geometry_msgs.msg import PoseStamped from cr...
import asyncio import contextlib import http import inspect import io import json import math import queue import sys import types import typing from concurrent.futures import Future from urllib.parse import unquote, urljoin, urlsplit import anyio.abc import requests from anyio.streams.stapled import StapledObjectStre...
"""Functions used to manipulate pytorch tensors and numpy arrays.""" import numbers import os import tempfile from collections import defaultdict from typing import List, Dict, Optional, DefaultDict, Union, Any, cast import PIL import numpy as np import torch from PIL import Image from moviepy import editor as mpy fr...
from typing import Any import torch from torch import nn from torch.nn.utils import prune from tests.conftest import verify_output_str from tests.fixtures.models import ( AutoEncoder, ContainerModule, CustomParameter, DictParameter, EmptyModule, FakePrunedLayerModel, LinearModel, LSTMN...
import os from django.core.files import File from django.core.management.base import BaseCommand from waldur_mastermind.marketplace.models import ( Attribute, AttributeOption, Category, CategoryColumn, CategoryComponent, Section, ) def merge_two_dicts(x, y): z = x.copy() # start with x'...
# @Author : <NAME> # @Email : <EMAIL> import os from scipy import stats, linalg #from SALib.sample import latin import numpy as np from ReadResults import Utilities import pickle import CoreFiles.GeneralFunctions as GrlFct import openturns as ot ot.ResourceMap.SetAsBool("ComposedDistribution-UseGenericCovarianceAlg...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Thu Jul 6 10:00:59 2017 @author: punyajoy """ def access_dict(ob,width,height): a=[] for box,string in six.iteritems(ob): ymin, xmin, ymax, xmax=box xmin=int(xmin*width) ymin=int(ymin*height) ymax=int(ymax*height) xm...
import logging as _logging import math as _math import os as _os import sys import tarfile as _tarfile from collections import OrderedDict from enum import Enum as _Enum from typing import List import click import flytekit as _flytekit from flytekit.clis.sdk_in_container.constants import CTX_PACKAGES from flytekit.co...
#!usr/bin/env python3 # -*- coding: utf-8 -*- """ Adjacency list representation of undirected graph. Note that parallel edges and self-loops are not allowed. """ __author__ = '<NAME>' import heapq import random import sys from functools import total_ordering from typing import Dict, List from graph_basics import A...
""" This script prepares data in the format for the testing algorithms to run The script is expanded to the """ from __future__ import division from queue import PriorityQueue from datetime import datetime import shared_variables from shared_variables import get_unicode_from_int import copy import csv import re imp...
import asyncio import copy import json import logging from datetime import datetime, timedelta from enum import Enum from pathlib import Path from typing import Any, Dict, List, Union import aiohttp import httpx import jinja2 import tenacity from aiopath import AsyncPath from authlib.integrations.httpx_client.oauth2_c...
import sys sys.path.append('../') import re import json import builtins from ADC_function import * from lxml.html import fromstring from multiprocessing.dummy import Pool as ThreadPool from difflib import SequenceMatcher from unicodedata import category from number_parser import is_uncensored G_registered_storyline_si...
# coding: utf-8 """ Cohesive Networks SDK Cohesive Networks SDK is a thin wrapper around our product APIs providing complete control of your network's addresses, routes, rules and edge # noqa: E501 The version of the OpenAPI document: 4.8 Contact: <EMAIL> Generated by: https://openapi-generator.t...
#!/usr/bin/env python """AFF4 RDFValue implementations for client information. This module contains the RDFValue implementations used to communicate with the client. """ from __future__ import absolute_import from __future__ import division from __future__ import unicode_literals import binascii import hashlib impor...
import logging import math import os import platform import sys import warnings import numpy as np from PIL import Image from mxnet import gluon, nd from mxnet.gluon.data.vision import ImageFolderDataset as MXImageFolderDataset from mxnet.gluon.data.vision import ImageRecordDataset, transforms from ...core import * f...
import os import re import sys import logging try: from StringIO import StringIO except ImportError: from io import StringIO from .TaskTypes import TaskTypes from .RunResult import RunResult from .TestReport import TestReport from .TestRunner import TestRunner def open_url(url): import subprocess if...
import pytorch_lightning as pl import matplotlib.pyplot as plt import torch import os from os import path import numpy as np from mpl_toolkits.axes_grid1 import make_axes_locatable from drought_impact_forecasting.models.utils.utils import mean_prediction, last_prediction, ENS import wandb class WandbTrain_callback...
#!/usr/bin/env python3 # Copyright (C) 2021 Intel Corporation # SPDX-License-Identifier: MIT import argparse from argparse import RawTextHelpFormatter import os from typing import Dict,List,TextIO,Iterable import subprocess import glob import re import sys import csv import signal import level_zero_report_utils test_...
# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # --------------------------------------------------------------------...
"""Semantic analysis of types""" from typing import Callable, cast, List, Optional from mypy.types import ( Type, UnboundType, TypeVarType, TupleType, UnionType, Instance, AnyType, CallableType, Void, NoneTyp, DeletedType, TypeList, TypeVarDef, TypeVisitor, StarType, PartialType, EllipsisType, Uninhabited...
from __future__ import unicode_literals import itertools import re from .common import InfoExtractor from ..compat import compat_str from ..utils import ( clean_html, determine_ext, dict_get, extract_attributes, ExtractorError, int_or_none, parse_duration, try_get, unified_strdate,...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Wed Oct 24 21:05:53 2018 @author: Luke """ #============================================================================== #SUMMARY #============================================================================== # 11 March 2020 #This script loops throu...
# -*- coding: utf-8 -*- """Parse the original PDP ``advent.dat`` file. Copyright 2010-2015 <NAME>. Licensed as free software under the Apache License, Version 2.0 as detailed in the accompanying README.txt. """ from operator import attrgetter from .model import Hint, Message, Move, Object, Room, Word # The Adventu...
""" Benching joblib pickle I/O. Warning: this is slow, and the benchs are easily offset by other disk activity. """ import os import time import shutil import numpy as np import joblib import gc from joblib.disk import disk_used try: from memory_profiler import memory_usage except ImportError: memory_usage =...
from __future__ import print_function import os import json import textwrap import jinja2 from lxml import etree as ET from collections import defaultdict from iatirulesets.text import rules_text from helpers import get_extra_docs, get_github_url, path_to_ref # Define the namespaces necessary for opening schema file...
import numpy as np from scipy.io.idl import readsav from scipy.interpolate import interp1d import h5py from astropy.io import fits import shutil import glob import os def dimensions(instrument): if instrument == 'HARPS': M = 4096 # pixels per order R = 72 # orders elif instrument == 'HARPS-N': ...
import torch import torch.nn as nn from attention import Attention, NewAttention from language_model import WordEmbedding, QuestionEmbedding from classifier import SimpleClassifier from fc import FCNet import torch.nn.functional as F import torchvision as tv import utils class vgg16_modified(nn.Module): def __ini...
# Copyright 2019 https://github.com/kodi-addons # # 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, p...
#!/usr/bin/env python # coding: utf-8 # In[1]: import numpy as np import matplotlib as mpl import matplotlib.pyplot as plt import seaborn as sns target = '10kA' radeg = np.pi/180 def cart_to_pol(x,y): r = np.sqrt(x**2 + y**2) phi = np.arctan2(y,x) return r, phi def pol_to_cart(r,phi): x = r*np.cos...
# I already extracted the trajectory pointes per video and put them in a 2D numpy Array , it includes the m rows # ( for each block) and in each row we have different points of each trajectories.(However, we can change this # number arbitrary by changing the Trajectory_length parameter) from __future__ import divisio...
""" This code owes a lot to pyperclip by <NAME> <EMAIL>. """ import platform import subprocess import time import contextlib import os import sys import io import re import base64 from pathlib import Path from typing import Union, Dict, Tuple from threading import Thread from queue import Queue import pygame # Onl...
import os import pickle import pandas as pd import numpy as np import operator import scipy as sp import operator import itertools import subprocess from sklearn import datasets from sklearn.preprocessing import Imputer from sklearn.metrics.pairwise import pairwise_distances from Bio.PDB import * from Bio import pairwi...
import re import sys from datetime import datetime from .dateparsers import * __all__ = [ 'ValidationError', 'CompoundValidationError', 'Field', 'Compound', 'Text', 'HTML', 'Email', 'DateTime', 'Boolean', 'Range', 'Float', 'Integer', 'BoundingBox', 'LatLng', ...
import numpy as np import matplotlib.pyplot as plt def _alphas(v, v_r): """ Calculates alpha parameters using current membrane potential and resting potential in units of milli volts. :param v: Membrane potential in milli volts. float. :param v_r: Membrane potential in milli volts. float. :ret...
# # All parameter and variables names are appended # with unit where appropriate. # _gpmin = grams per minute # _gpm3 = grams per meter cubed (mg/L) # _m3pmin = meters cubed per minute # _g = grams # from pyomo.environ import * def toxin_mass_balance_rule(m,n,t,s): return (sum(m.P_CONC_MATRIX_CSR_TOXI...
# -*-coding:utf8 -*- # This file is part of Mach-O Loader for CLE. # Contributed December 2016 by Fraunhofer SIT (https://www.sit.fraunhofer.de/en/) and updated in September 2019. import struct from .symbol import BindingSymbol from ...errors import CLEInvalidBinaryError from ...address_translator import AT import ...
# -*- coding: utf-8 -*- """ @author: Qian.Cao """ import nrrd import numpy as np import os, sys from scipy import ndimage import matplotlib.pyplot as plt import os import logging import SimpleITK as sitk import radiomics from radiomics import featureextractor import nrrd import glob import umap import sys sys.path.a...
import datetime import json as jsonlib import logging import re import urlparse from django.conf import settings from django.contrib.staticfiles.templatetags.staticfiles import static as django_static from django.core.urlresolvers import reverse as django_reverse from django.http import QueryDict from django.template....
#!/usr/bin/env python import sys import re import struct try: import hashlib as md5 except ImportError: import md5 from psparser import PSEOF from psparser import literal_name from psparser import LIT, KWD, STRICT from pdftypes import PDFException, PDFTypeError, PDFNotImplementedError from pdftypes import PDFOb...
from typing import Callable, List, Optional, Sequence, cast from copy import deepcopy import hydra import numpy as np import omegaconf import torch import torch.distributions import mbrl.models import mbrl.types import mbrl.util.math from torch.serialization import save from .core import Agent, complete_agent_cfg f...
from __future__ import absolute_import from __future__ import division from __future__ import print_function from collections import namedtuple import ray.cloudpickle as cloudpickle import copy from datetime import datetime import logging import json import uuid import time import tempfile import os from numbers impor...
"""Generate HSC cutout for Merian survey on Based on <NAME>'s lsstutils package: https://github.com/johnnygreco/lsstutils """ import os import shutil import argparse from datetime import date import numpy as np import astropy.units as u from astropy.table import Table, QTable from joblib import Parallel, delayed ...
#!/usr/bin/env python # Copyright 2017 Calico 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 # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or ...
# Copyright 2016 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...
################################################################## # Steps for updating WhiteboxTools-ArcGIS # Step 1 - Delete the existing develop branch: git branch -D develop # Step 2 - Create a new develop branch: git checkout -b develop # Step 3 - Delete the old WhiteboxTools_win_amd64.zip in the root folder if ne...
#!/usr/bin/python -OOtt import operator s = {} s['malediction'] = {} s['malediction']['name'] = 'Malediction' s['malediction']['low'] = 33.0 # signature radius s['malediction']['big'] = 70.1 # signature radius with MWD s['malediction']['slow'] = 760.0 # base speed with MWD off s['malediction']['fast'] = 5407.5 # mwd...
# Licensed to Cloudera, Inc. under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. Cloudera, Inc. licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not use this file ex...
# Copyright 2017-2021 TensorHub, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writ...
"""RPC XML base parser. Contains base parser for SDLRPC v1/v2 and JSON RPC XML format. """ import collections import xml.etree.ElementTree from generator import Model class ParseError(Exception): """Parse error. This exception is raised when XML contains errors and can't be parsed. """ pass ...
import os from collections import defaultdict import numpy as np try: import matplotlib if not os.environ.get('DISPLAY'): # Use non-interactive Agg backend matplotlib.use('Agg') import matplotlib.pyplot as plt except ImportError: import platform if platform.python_implementation() =...
# Copyright 2011 <NAME>. 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 conditions and the foll...
# 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 the...
import tensorflow as tf from baselines.ddpg.ddpg import DDPG from baselines import logger import baselines.common.tf_util as U from baselines.common import set_global_seeds import numpy as np import time from baselines.ddpg.noise import OrnsteinUhlenbeckActionNoise from multiprocessing.pool import Pool from multiproces...
import sys import os from glob2 import glob import nibabel as nib import numpy as np import matplotlib matplotlib.use('agg') import matplotlib.pyplot as plt from skimage.morphology import ball, binary_dilation, binary_closing def get_foldernames(base_path, no_small=False): walker = [x[0] for x in os.walk(base_pa...
from urllib2 import urlopen, URLError from bs4 import BeautifulSoup from os.path import join, dirname, basename from os import makedirs from errno import EEXIST from threading import Thread from Queue import Queue from re import compile, sub from sys import stderr, stdout from itertools import takewhile import argparse...
# Copyright 2016 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://aws.amazon.com/apache2.0/ # # or in the "license" file accompa...
import numpy as np import cv2 import glob import random import math import matplotlib.pyplot as plt from ReadCameraModel import* from mpl_toolkits.mplot3d import Axes3D # Find skew matrix def skew(imagePoint0,imagePoint1): a = imagePoint0[0] b = imagePoint0[1] c = imagePoint0[2] skew1 = np.array([[0,-...
''' Visualisation tools for analysis ''' import torch import torch.nn as nn from torch.autograd import Variable import torch.nn.functional as F import matplotlib matplotlib.use('agg') import matplotlib.pyplot as plt import matplotlib.image as mpimg import numpy as np import json import ops import os import utils # --...
import lnt.util.ImportData import sqlalchemy from flask import current_app, g, Response, make_response, stream_with_context from flask import json, jsonify from flask import request from flask_restful import Resource, abort from sqlalchemy.orm import joinedload from sqlalchemy.orm.exc import NoResultFound from lnt.ser...
"""A collection of shared utilities for all encoders, not intended for external use.""" from abc import abstractmethod from enum import Enum, auto import pandas as pd import numpy as np import sklearn.base from sklearn.base import BaseEstimator, TransformerMixin from sklearn.exceptions import NotFittedError from typin...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """! Author: <NAME> - ASCEE Description: Measurement class The ASCEE hdf5 measurement file format contains the following fields: - Attributes: 'samplerate': The audio data sample rate in Hz. 'nchannels': The number of audio channels in the file 'sensitivity': (Optional...
# Copyright (c) 2009, <NAME>' # Copyright (c) 2017, <NAME> # All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """AIX platform implementation.""" import functools import glob import os import re import subprocess import sys from collections impo...
# Copyright 2021 Google 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 # https://www.apache.org/licenses/LICENSE-2.0 # Unless required by applicable law or agreed to in writing, sof...
""" .. module:: apply_metadata_check :synopsis: Applies the check of header keywords and values given a standard. ().. moduleauthor:: <NAME> <<EMAIL>> """ import logging import os from astropy.io import fits import numpy import sys from get_filetypes_keys import get_filetypes_keys sys.path.append("../") from li...
import math import matplotlib.pyplot as plt import numpy as np from scipy.special import expit from decimal import Decimal def sigmoid(z): # SIGMOID Compute sigmoid functoon # J = SIGMOID(z) computes the sigmoid of z. g = np.zeros(z.shape) g = expit(z) return g def sigmoidGradient(z): #SIGMO...
from __future__ import annotations """Domain objects that define features associated with text. """ __author__ = '<NAME>' from typing import List, Tuple, Set, Iterable, Dict, Type, Any from dataclasses import dataclass, field import dataclasses from abc import ABCMeta, abstractmethod import sys import logging from io...
# copyright (c) 2021 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 applica...
#!/usr/bin/python ##################################################################################### # Copyright (c) 2021 <NAME>, <NAME>, Carnegie Mellon University # # Permission is hereby granted, free of charge, to any person obtaining a copy of this software and # associated documentation files (the "Software"...
# -*- coding: utf-8 -*- import hmac import urllib import base64 from hashlib import sha256 from urllib import quote, quote_plus from datetime import datetime from txaws.util import hmac_sha256, get_utf8_value from txaws.client.base import BaseClient, BaseQuery from txaws.service import AWSServiceEndpoint from txaws.sq...
import re from typing import List, Dict import argparse from pathlib import Path from pycparser import CParser, c_ast from autopxd import AutoPxd # List the includes to the stdlib we are expecting. This is needed to hack # around them given they are needed for pycparser, but should endup in the pxd # as `from libc.st...
# -*- coding: utf-8 -*- import os import datetime ### FIXME: BEST FRONTEND PRACTICIES BELOW HTML_BASE_TEST_TEMPLATE = """ <!DOCTYPE html> <html> <style> @font-face {{ font-family:'Yandex Sans Display Web'; src:url(https://yastatic.net/adv-www/_/H63jN0veW07XQUIA2317lr9UIm8.eot); src:url(https://yastatic....
import discord from discord.utils import get import asyncio import datetime import random from discord.ext import commands from bot import channelAllow, ReadWriteData, appendItemDictSingle, admin, read, write, getIdAtSign, mod, get_prefix as P, clearGuildData from Organiser import badArg coolDown = 60 de...
"""Implementation of memory efficient attention. Original implemetation are from `tensor2tensor <https://github.com/tensorflow/tensor2tensor>`_. Rewrite in tensorflow 2.0. """ # pylint: disable=C0103,R0914,E1120 import functools import operator import numpy as np import tensorflow as tf from omnizart.models.utils ...
from tesi_ao import main220316 import matplotlib.pyplot as plt import numpy as np from astropy.io import fits from tesi_ao.mems_command_to_position_linearization_measurer import CommandToPositionLinearizationMeasurer from tesi_ao.mems_command_to_position_linearization_analyzer import CommandToPositionLinearization...
# Copyright 2014 The LUCI Authors. All rights reserved. # Use of this source code is governed under the Apache License, Version 2.0 # that can be found in the LICENSE file. """Imports groups from some external tar.gz bundle or plain text list. External URL should serve *.tar.gz file with the following file structure:...
import sys import os import argparse from lhafile import LhaFile, BadLhafile from enum import Enum # http://leonard.oxg.free.fr/ymformat.html # https://github.com/skeezix/zikzak/blob/master/zik80/audio-gen/ym-file-format.txt class fileTypes(Enum): Unsupported = 0 # YMT, MIX, YM4, and YM1. YM5_6 = 1 YM2_3 =...
#!/usr/bin/env python2 """ A crude image output writer, inspired by ajray's render.py """ # upconvert - A universal hardware design file format converter using # Format: upverter.com/resources/open-json-format/ # Development: github.com/upverter/schematic-file-converter # # Copyright 2011 Upverter, Inc. # # Lic...
import os import sys import numpy as np import math as math_tool import cv2 import argparse BASE_DIR = os.path.dirname(os.path.abspath(__file__)) ROOT_DIR = os.path.dirname(BASE_DIR) sys.path.append(BASE_DIR) sys.path.append(ROOT_DIR) # ATTENTION: # The global variable below is used to determine whether to us...
""" utils.py including misc functions, e.g., 1 the class of matrix decomposition method 2 the class of clusterring method 3 some plot figure operators 4 Image preconditioning method for generating random image using different distribution, and decorrelate image color space. """ from lucid.optvis.param.resize_biline...
"""Copy records from the first ("left") KGTK file to the output file, if a match is made with records in the second ("right") KGTK input file. The fields to match may be supplied by the user. If not supplied, the following defaults will be used: Left Right Key fields edge edge left.node1 = right.node1 and...
from __future__ import absolute_import from builtins import str from builtins import range from builtins import object try: from collections import OrderedDict # 2.7 except ImportError: from sqlalchemy.util import OrderedDict from ckan.lib import helpers as h from logging import getLogger import re from . im...
#encoding=utf8 # Copyright (c) 2021 PaddlePaddle Authors. All Rights Reserved. # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # http://www.apache.org/licenses/LICENSE-2.0 # Unl...
# Copyright (c) 2015 Mirantis 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 require...
import errno import socket from struct import pack, unpack, error from enum import Enum from hexdump import hexdump from ubjson.decoder import DecoderException import ubjson from . import enums from .minimal_states import MinimalGameState # pylint: disable=too-few-public-methods class EventType(Enum): """ Replay...
import numpy as np import matplotlib.image as mpimg import matplotlib.pyplot as plt import cv2 # Define a class to receive the characteristics of each line detection class Line(): def __init__(self): self.samples = 10 # was the line detected in the last iteration? self.detected = False ...
from sympy import (S, symbols, FiniteSet, Eq, Matrix, MatrixSymbol, Float, And, ImmutableMatrix, Ne, Lt, Gt, exp, Not, Rational, Lambda, Sum, Piecewise) from sympy.stats import (DiscreteMarkovChain, P, TransitionMatrixOf, E, StochasticStateSpaceOf, variance...
"""This module contains the code allowing to load modules data. This is the entrypoint to use griffe programatically: ```python from griffe.loader import GriffeLoader griffe = GriffeLoader() fastapi = griffe.load_module("fastapi") ``` """ from __future__ import annotations import sys from datetime import datetime ...
# This code is part of Qiskit. # # (C) Copyright IBM 2017, 2019. # # This code is licensed under the Apache License, Version 2.0. You may # obtain a copy of this license in the LICENSE.txt file in the root directory # of this source tree or at http://www.apache.org/licenses/LICENSE-2.0. # # Any modifications or derivat...
#!/usr/bin/env python # CCP4ScalerHelpers.py # Copyright (C) 2006 CCLRC, <NAME> # # This code is distributed under the BSD license, a copy of which is # included in the root directory of this package. # # 3rd November 2006 # # Helpers for the "CCP4" Scaler implementation - this contains little # functions which w...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Author: <NAME> Title: 01_rasterization Description: This code generates 1m x 1m raster of land cover and land use types within the administrative boundaries of New York City. The output is then used to map mobility data to the particular type of activity inferred f...
"""A basic extended attributes (xattr) implementation for Linux, FreeBSD and MacOS X.""" import errno import os import re import subprocess import sys import tempfile from ctypes import CDLL, create_string_buffer, c_ssize_t, c_size_t, c_char_p, c_int, c_uint32, get_errno from ctypes.util import find_library from distu...
################################################################################ # The MIT License # # Copyright (c) 2021, Prominence AI, Inc. # # 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 Softwar...
from typing import List from src import ImageUtils import torch from torch.cuda.amp import autocast from torch import nn from torch.nn import functional as F from torch.cuda.amp import custom_fwd from torch.cuda.amp import custom_bwd import kornia.augmentation as K import torchvision.transforms as TT # hack to manag...
#!/usr/bin/env python3 # encoding: utf-8 import json import random import time from collections import OrderedDict from urllib.parse import unquote, urlencode import requests from bs4 import BeautifulSoup from requests.packages import urllib3 from config import _PROXIES_DIC, TIMEOUT from database import DBSession, S...
#!/usr/bin/env python3 import argparse import os import resource import re from operator import itemgetter from collections import deque from multiprocessing import Pool import pysam import networkx as nx import numpy as np cigar_re = re.compile(r'(\d+)([M|I|D|N|S|H|P|=|X]{1})') query_consuming = [ pysam.CINS, ...