text
stringlengths
6.04k
39.5k
import numpy as np import math import csv import sys import copy import random class Node: def __init__(self, val): self.l = None self.r = None self.inter = True self.cla = False self.v = val self.flag =None self.alive = True self.depth = 0 s...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Tue Jul 4 12:32:53 2017 @author: wroscoe """ import os import sys import time import json import datetime import random import glob import numpy as np import pandas as pd from PIL import Image class Tub(object): """ A datastore to store sensor d...
import gym import numpy as np from typing import List, Optional, Tuple, Type, Union import ray from ray.rllib.agents.dqn.dqn_tf_policy import PRIO_WEIGHTS from ray.rllib.agents.sac import SACTorchPolicy from ray.rllib.agents.sac.rnnsac_torch_model import RNNSACTorchModel from ray.rllib.agents.sac.sac_torch_policy impo...
import numpy as np import matplotlib.pyplot as plt from matplotlib.gridspec import GridSpec import random import cv2 class Drones(object): def __init__(self, pos, view_range): self.pos = pos self.view_range = view_range class Human(object): def __init__(self, pos): self.pos = pos clas...
#!/usr/bin/env python3 """ This is the main script that renders any source code to pdf format with syntax highlighting and line number and more. It has support for downloading and rendering any online source code using requests and BeautifulSoup. """ from signal import SIGINT, signal signal(SIGINT, lambda signum, fra...
#!/usr/bin/env python ## """Define the user base and its data""" # TODO change ip_address to hostname where host name is name : port from __future__ import print_function, absolute_import import os import sys as _sys import csv import argparse as _argparse import ConfigParser from collections import OrderedDict imp...
# Here's an outline of how this program works. # Firstly, we load a dictionary mapping GSIS identifier to a dictionary of # player meta data. This comes from either the flag `json-update-file` or # nflgame's "players.json" file. We then build a reverse map from profile # identifier (included in player meta data) to GSI...
from . import DazRigBlend from . import DtbShapeKeys from . import DataBase from . import ToRigify from . import Global from . import Versions from . import DtbDazMorph from . import DtbMaterial from . import CustomBones from . import Poses from . import Animations from . import Util from . import DtbCommands from . im...
# encoding = utf-8 """ // // AzureMonitorAddonForSplunk // // Copyright (c) Microsoft Corporation // // All rights reserved. // // MIT License // // 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 S...
from tests.integration import basetests import os import sqlite3 import json from Bio import SeqIO from lxml import etree class SearchspaceLookup(basetests.BaseTest): suffix = '' infilename = 'proteins.fasta' def setUp(self): super().setUp() self.infile = os.path.join(self.basefixdir, se...
from __future__ import (absolute_import, division, print_function, unicode_literals) import argparse import ast import os import time from datetime import datetime import matplotlib.pyplot as plt import numpy as np import pandas as pd import tensorflow as tf from config import CHECKPOINT_DIR,...
### # Copyright (c) 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: # # * Redistributions of source code must retain the above copyright notice, # this list of conditions, and t...
# -*- coding: utf-8 -*- # # Copyright 2015 <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 la...
# Copyright 2017 The Abseil Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in ...
import sys from . import config import math import functools # python3 compatibility try: xrange except NameError: xrange = range try: dict.iteritems except AttributeError: # Python 3 def itervalues(d): return iter(d.values()) def iteritems(d): return iter(d.ite...
from collections import OrderedDict from wazimap.geo import geo_data from wazimap.data.tables import get_model_from_fields from wazimap.data.utils import get_session, calculate_median, merge_dicts, get_stat_data, get_objects_by_geo, group_remainder import logging # ensure tables are loaded import janaganana.tables #...
# ~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~ # MIT License # # Copyright (c) 2021 <NAME> # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without res...
# # Copyright (C) 2014-2015 UAVCAN Development Team <uavcan.org> # # This software is distributed under the terms of the MIT License. # # Author: <NAME> <<EMAIL>> # <NAME> <<EMAIL>> # from __future__ import division, absolute_import, print_function, unicode_literals import time import collections import sche...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """Pibooth main module. """ import os import time import shutil import logging import pygame import argparse import os.path as osp from RPi import GPIO from PIL import Image import pibooth from pibooth.utils import LOGGER, timeit, PoolingTimer, configure_logging from pib...
# -*- coding: utf-8 -*- """ test function application """ import pytest from string import ascii_lowercase from pandas import (date_range, Timestamp, Index, MultiIndex, DataFrame, Series) from pandas.util.testing import assert_frame_equal, assert_series_equal from pandas.compat import product as ...
""" Vision Transformer (ViT) in PyTorch This is a WIP attempt to implement Vision Transformers as described in 'An Image Is Worth 16 x 16 Words: Transformers for Image Recognition at Scale' - https://openreview.net/pdf?id=YicbFdNTTy The paper is currently under review and there is no official reference impl. The code...
from __future__ import annotations import logging import os from collections.abc import Mapping from functools import partial from pathlib import Path from typing import TYPE_CHECKING, Dict, List, Optional, Sequence, Tuple, cast from warnings import warn from pydantic import BaseModel, BaseSettings, ValidationError f...
# file eulfedora/server.py # # Copyright 2010,2011 Emory University Libraries # # 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 # # ...
# -*- coding: utf-8 -*- # This file is part of beets. # Copyright 2016, <NAME>. # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the # "Software"), to deal in the Software without restriction, including # without limitation the right...
# vim: fileencoding=utf-8 # vim: foldmethod=marker foldenable: """ [X] emoji [ ] wego icon [ ] v2.wttr.in [X] astronomical (sunset) [X] time [X] frames [X] colorize rain data [ ] date + locales [X] wind color [ ] highlight current date [ ] bind to real site [ ] max values: temperature [X] max value: rain [ ] comment g...
"""A converter for converting GRAR tei xml files into OpenITI format. The converter has two main functions: * convert_file: convert a single html file. * convert_files_in_folder: convert all html files in a given folder Usage examples: >>> from tei_converter_GRAR import convert_file, convert_files_in_folder >...
import argparse import os import re import errno import subprocess import sys import gzip import shutil import traceback import json import urllib import csv import logging import datetime import strict_rfc3339 import codecs from itertools import chain from urllib.error import URLError import publicsuffix from utils.s...
import numpy as np import math import time from scipy.spatial.transform import Rotation from ..common import Vec, equal_angle from .realtime.constants import * class Joints(Vec): ''' A vector of 6 elements representing joint properties. The order is: base, shoulder, elbow, wrist1, wrist2, wrist3. ''' ...
from typing import Any, Callable, Dict, List, Union import numpy from ppq.core import (DataType, OperationMeta, QuantizationStates, TargetPlatform, TensorMeta, TensorQuantizationConfig, empty_ppq_cache, ppq_warning) from ppq.IR import BaseGraph, Operation, QuantableOperation...
# Copyright 2019 AstroLab Software # Author: <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...
#!/usr/bin/python # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # Ansible is distributed...
""" TensorFlow policy class used for APPO. Adapted from VTraceTFPolicy to use the PPO surrogate loss. Keep in sync with changes to VTraceTFPolicy. """ import numpy as np import logging import gym from typing import Dict, List, Optional, Type, Union import ray from ray.rllib.algorithms.impala import vtrace_tf as vtra...
import numpy as np import pdb import numpy.random as npr import networkx as nx from scipy.sparse.linalg import eigs from sklearn.cluster import KMeans import varinf as varinf import heapq as hp from util import * from scipy.stats import wasserstein_distance def init_moments(data, hyper, seed = None, sparse = True, uns...
import os import glob import datetime as dt import json import pyspark from pyspark import SparkConf from pyspark.sql import SparkSession from pyspark.sql.types import ( StringType, IntegerType, FloatType, TimestampType, LongType, DateType, NullType, StructType, StructField, ) from ...
from typing import List, Optional, Set import marshmallow as m from marshmallow import post_load from enum import Enum, auto import logging logger = logging.getLogger(__name__) class BaseSchema(m.Schema): """ skip null values when generating JSON https://github.com/marshmallow-code/marshmallow/issues/229...
# # Copyright(c) 2019-2022 Intel Corporation # SPDX-License-Identifier: BSD-3-Clause # from ctypes import c_int, memmove, cast, c_void_p from enum import IntEnum from itertools import product from itertools import repeat import pytest import random from hashlib import md5 from datetime import datetime from pyocf.type...
# Copyright 2013-2021 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) import collections import os.path import re import shutil import pytest import llnl.util.filesystem import spack.concret...
# Copyright 2015 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...
""" The utilities module is a collection of classes and functions used across the eolearn package, such as checking whether two objects are deeply equal, padding of an image, etc. """ import logging from collections import OrderedDict import numpy as np from .constants import FeatureType LOGGER = loggin...
""" Copyright (c) Facebook, Inc. and its affiliates. """ import numpy as np from collections import Counter from build_utils import blocks_list_to_npy # , npy_to_blocks_list ############################################## # WARNING: all npy arrays in this file are xyz # not yzx def maybe_convert_to_npy(blocks): ...
import time from functools import partial from typing import Dict, Union, Optional, Callable, List, cast import logging import numpy as np from qcodes.instrument.channel import InstrumentChannel from qcodes.instrument.visa import VisaInstrument from qcodes.math.field_vector import FieldVector log = logging.getLogger...
"""Data about the various channels in EXR files output by Synthesis' Blender and Vray render engines""" import enum import fnmatch import json from collections import namedtuple, OrderedDict from pathlib import Path from typing import Dict, Iterator, List, Optional, Tuple import Imath import numpy as np import OpenEXR...
#!/usr/bin/python # -*- coding: utf-8 -*- # Copyright: (c) 2021, quidame <<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 DOCUMENTATION = r''' --- module: filesize short_descr...
from pathlib import Path import shutil from audio_utils import peak_norm import os from numpy.core.defchararray import partition import numpy as np import random from itertools import repeat from scipy import stats import soundfile as sf from glob import glob from matplotlib import pyplot as plt import ...
#!/usr/bin/env python import numpy as np import math import gzip try: from scripts.my_utils import * except ImportError: from my_utils import * try: from scripts.fragment import * except ImportError: from fragment import * try: from scripts.cluster_weird_reads import * except ImportError: fro...
####################################################### # # TAKFreeServer.py # Original author: naman108 # This code is Open Source, made available under the EPL 2.0 license. # https://www.eclipse.org/legal/eplfaq.php # credit to Harshini73 for base code # ####################################################### import...
""" Test Region Extractor and its functions """ import numpy as np import nibabel from scipy import ndimage from nose.tools import assert_equal, assert_true, assert_not_equal from nilearn.regions import (connected_regions, RegionExtractor, connected_label_regions) from nilearn.regions.re...
import socket import os import time import traceback import numpy as np from ..UTILS.colorful import * from colorama import init from multiprocessing import Process, Pipe init() def find_free_port(): from contextlib import closing with closing(socket.socket(socket.AF_INET, socket.SOCK_STREAM)) as s: s.b...
import copy import time from graphics import * def d(a, b): return abs(a[0]-b[0])+abs(a[1]-b[1]) def max(args): i = 0 for j in range(len(args)): if args[j] > args[i]: i = j return i def average(args, default=0): try: return sum(args) / len(args) ex...
import numpy as np import tensorflow.compat.v1 as tf import mesh_tensorflow as mtf import datetime import sys, time, os import string, random import functools import trainer from dataloader import ImageDataLoader import utils import mtf_operations as mt from mtf_operations import Conv2d, MaxPool, AvgPool from mesh_tr...
""" WebAPI provides a thin wrapper over `Steam's Web API <https://developer.valvesoftware.com/wiki/Steam_Web_API>`_ It is very friendly to exploration and prototyping when using ``ipython``, ``notebooks`` or similar. The ``key`` will determine what WebAPI interfaces and methods are available. .. note:: Some endpo...
from immutables import Map import tlang def test_optional(): a = tlang.Terminal("a") + ~tlang.Terminal("b") opt = ~a rule = opt + a print(list(tlang.decache(rule).run())) print(list(rule.run())) print(tlang.decache(rule)) print(list(a.run())) print(list(opt.run())) assert list((tla...
# 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...
"""Iterpolations * :class:`.BarycentricRational` * :function:`._q` * :function:`._compute_roots` * :function:`._mp_svd` * :function:`._mp_qr` * :function:`._nullspace_vector` * :function:`._compute_roots` * :function:`._mp_svd` * :function:`._mp_qr` * :function:`._nullspace_vector` * :function:`.chebyshev_pts` * :funct...
""" Author: AruniRC Date: Feb 2019 """ import argparse import os import os.path as osp import data_utils from data_utils.ShapeNetDataLoader import PartNormalDataset, SelfSupPartNormalDataset, ACDSelfSupDataset from tensorboard_logger import configure, log_value import itertools import torch from torch import nn import ...
# Heaviside treatment functions import numpy as np import matplotlib.pyplot as plt from pathlib import Path from crosspy.XCF import fxcorr import os import cv2 as cv from numba import double, jit, njit, vectorize from numba import int32, float32, uint8, float64, int64, boolean from scipy.signal import fftconvolve from...
""" Reference: [1] https://github.com/spyysalo/conlleval.py """ import sys import re import codecs import torch from collections import Counter from collections import defaultdict, namedtuple ANY_SPACE = '<SPACE>' class FormatError(Exception): pass Metrics = namedtuple('Metrics', 'tp fp fn prec rec fscor...
""" Code imported and optimized from django-piston 0.2.3rc1 """ import decimal import inspect import re import sys from django.urls import NoReverseMatch, reverse from django.db.models import Model from django.http import HttpResponse, HttpResponseNotAllowed, HttpResponseServerError from django.utils.encoding import sm...
from pylightnix import (instantiate, DRef, RRef, Path, SPath, mklogdir, dirhash, assert_valid_dref, assert_valid_rref, drefdeps1, drefdeps, store_gc, assert_valid_config, Registry, mkcontext, allrrefs, mkdref, mkrref, unrref, undref, ...
# -------------------------------- # Name: featurelinelib.py # Purpose: This file serves as a function library for the Feature line Toolboxes. Import as fll. # Current Owner: <NAME> # Last Modified: 8/31/2019 # Copyright: <NAME> # ArcGIS Version: ArcGIS Pro/10.4 # Python Version: 3.5/2.7 # -----------------------...
from test import support import time import unittest import locale import sysconfig import warnings class TimeTestCase(unittest.TestCase): def setUp(self): self.t = time.time() def test_data_attributes(self): time.altzone time.daylight time.timezone time.tzname de...
from __future__ import print_function, division import numpy as np import os import cv2 from PIL import Image import random from functools import partial from utils import * import tensorflow as tf from keras.models import Model, Sequential, load_model from keras.layers.merge import _Merge from keras.layers import Inp...
# -*- coding: utf-8 -*- import os import xml.etree.ElementTree as ET import urllib.parse import re import itertools from docutils import nodes, utils from sphinx.util.nodes import split_explicit_title from sphinx.util.console import bold, standout from .parsing import normalise, ParseException def find_url(doc, sym...
"""Code for running network based simulation model using direct Gillespie algorithm.""" import warnings from collections import namedtuple from operator import add import copy from enum import IntEnum import numpy as np import rate_handling ################## ## Define Enums ## ################## class...
import os.path as osp import sys from collections import OrderedDict import cv2 import kornia import matplotlib.pyplot as plt import numpy as np import streamlit as st import torch import torch.nn.functional as F import utils from datasets import define_dataset from utils.geometry import euler_angles_to_rotation_matr...
# Copyright 2020 <NAME>, <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 i...
# encoding: UTF-8 """ 批量测试相关方法 # 华富资产 李来佳 """ import sys, os, platform, gc, copy,multiprocessing from datetime import datetime from time import sleep vnpy_root = os.path.abspath(os.path.join(os.path.dirname(__file__), '..', '..')) sys.path.append(vnpy_root) import numpy as np import pandas as pd import talib as ta ...
"""Tests for Monomial, Posynomial, and Signomial classes""" import math import sys import unittest from gpkit import Variable, Monomial, Posynomial, Signomial, SignomialsEnabled from gpkit import VectorVariable, NomialArray from gpkit.nomials import NomialMap from gpkit.small_classes import HashVector from gpkit.except...
#!/usr/bin/env python # A file to generate Flight Records from KML. import argparse import datetime import json import math import s2sphere import os import uuid from datetime import datetime, timedelta from shapely.geometry import LineString, Point, Polygon from monitoring.monitorlib.geo import flatten, unflatten fro...
"""This module defines recurrent bayesian neural-networks """ from __future__ import absolute_import from __future__ import division from __future__ import print_function import six import types import warnings import numpy as np import collections import tensorflow as tf import twodlearn as tdl import twodlearn.fee...
#!/usr/bin/python # (c) 2018 <NAME> <<EMAIL>> # (c) 2018-2019, NetApp, Inc # 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', ...
import os import sys if hasattr(sys, 'frozen'): os.environ['PATH'] = sys._MEIPASS + ";" + os.environ['PATH'] import login1 from PyQt5 import QtCore, QtGui, QtWidgets from PyQt5.QtCore import * from PyQt5.QtWidgets import * import time from httpfunction import * import history import rank import game im...
"""Module for parsing and manipulating data from ENDF evaluations. All the classes and functions in this module are based on document ENDF-102 titled "Data Formats and Procedures for the Evaluated Nuclear Data File ENDF-6". The latest version from June 2009 can be found at http://www-nds.iaea.org/ndspub/documents/endf...
import logging import random import re from pajbot.managers.handler import HandlerManager from pajbot.models.command import Command from pajbot.models.command import CommandExample from pajbot.modules import BaseModule from pajbot.modules import ModuleSetting from pajbot.utils import iterate_split_with_index log = l...
# ___________________________________________________________________________ # # EGRET: Electrical Grid Research and Engineering Tools # Copyright 2019 National Technology & Engineering Solutions of Sandia, LLC # (NTESS). Under the terms of Contract DE-NA0003525 with NTESS, the U.S. # Government retains certain r...
# To generate Aumann-Shapley attribution baseline # Reduce the iteration number, if you feel it is too slow import os from operator import itemgetter import numpy as np import tensorflow as tf import cv2 from utils.loading import load from utils.reading import read from utils.utils_network import InceptionV1 import ...
#!/usr/bin/python # Copyright 2012 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 applic...
''' Tools for manipulating and accessing HABIS configuration files or manipulating program configuration. ''' # Copyright (c) 2015 <NAME>. All rights reserved. # Restrictions are listed in the LICENSE file distributed with this package. import shlex import contextlib def numrange(s): ''' Parse a string representin...
import os import math import sys import torch import numpy as np from torch.utils.data import Dataset from torch.utils.data import DataLoader import glob import torch.distributions.multivariate_normal as torchdist from gym_collision_avoidance.envs.policies.InternalPolicy import InternalPolicy from gym_collision_avoid...
import h5py import numpy as np import pytest import json import warnings import matplotlib.pyplot as plt from .data.mock_confocal import generate_scan_json from .data.mock_fdcurve import generate_fdcurve_with_baseline_offset def pytest_addoption(parser): parser.addoption( "--runslow", action="store_true",...
# Copyright 2013 Novo Nordisk Foundation Center for Biosustainability, DTU. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless requi...
from __future__ import absolute_import, division, print_function import sys from libtbx import group_args from cctbx import maptbx import iotbx.phil from libtbx import adopt_init_args from cctbx.maptbx import resolution_from_map_and_model from libtbx import group_args from cctbx import miller, adptbx from mmtbx import ...
"""Functions to provide I/O APIs for all the modules. Authors: <NAME>, <NAME> """ import json import os import pickle from bz2 import BZ2File from pathlib import Path from typing import Any, Dict, List, Optional, Tuple, Union import gtsam import h5py import numpy as np from gtsam import Cal3Bundler, Rot3, Pose3 from ...
# Copyright 2018 ETH Zurich # # 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, sof...
# # Copyright (c) 2019 ISP RAS (http://www.ispras.ru) # Ivannikov Institute for System Programming of the Russian Academy of Sciences # # 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 # # h...
# (c) 2020 Ansible Project # 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 DOCUMENTATION = """ author: <NAME> connection: libssh short_description: (Tech preview) Run tasks us...
# # This file is part of m.css. # # Copyright © 2017, 2018, 2019, 2020, 2021, 2022 # <NAME> <<EMAIL>> # # Permission is hereby granted, free of charge, to any person obtaining a # copy of this software and associated documentation files (the "Software"), # to deal in the Software without restricti...
#!/usr/bin/env python # -*- coding: utf-8 -*- """ config.py author: xhchrn <EMAIL> Set up experiment configuration using argparse library. """ import os import sys import datetime import argparse from math import ceil def str2bool(v): return v.lower() in ('true', '1') parser = argpa...
#!/usr/bin/python # -*- coding: UTF-8 -*- import copy import json import random import MySQLdb import requests from osgeo.ogr import Geometry from polyline.codec import PolylineCodec from pyproj import Proj, transform from shapely.geometry import asShape def long_lat_to_district(longit, lat): """Extract distric...
from vpython import * #GlowScript 2.7 VPython # <NAME> # A surreal scene that illustrates many of the features of GlowScript # Add instructions below the display s = "<b>Fly through the scene:</b><br>" s += " drag the mouse or your finger above or below the center of the scene to move forward or backward;<br>" s ...
""" .. module:: catala_runtime :platform: Unix, Windows :synopsis: The Python bindings for the functions used in the generated Catala code :noindex: .. moduleauthor:: <NAME> <<EMAIL>> """ # This file should be in sync with compiler/runtime.{ml, mli} ! from gmpy2 import log2, mpz, mpq, mpfr, t_divmod # type...
#!/usr/bin/env python #-*- coding: utf-8 -*- #pylint: disable-msg= """ File : keras_dn.py Author : <NAME> <<EMAIL>> Description: the code to train HEP images using DenseNet in TF keras implementation. This code is based on TF TPU example: https://github.com/tensorflow/tpu/blob/master/tools/colab/...
import json from colour import Color from dash.dependencies import Input, Output, State from .constants import ARROW_POSITIONS, LABEL_ELEMENT_TYPES_ALL, \ LABEL_ELEMENT_TYPES, ELEMENTS def is_float(value): try: float(value) return True except ValueError: return False def get_id...
""" hash_table.py Python implementation of the very simple, fixed-array hash table used for the audfprint fingerprinter. 2014-05-25 <NAME> <EMAIL> """ from __future__ import print_function import numpy as np import random import cPickle as pickle import os, gzip import scipy.io import math # Current format version ...
import torch import embrelassess.model as biclassmodel import embrelassess.train as train import sys import logging import os import os.path as osp import json import math import itertools import pandas as pd logger = logging.getLogger(__name__) # The learn module provides methods for learning binary classifiers # as...
# -*- coding: utf-8 -*- from __future__ import unicode_literals """Contains the classes system_objects and single_object. Used to compute system models """ from .. import mats import os import copy from .. import solvers import object class system_objects: """system_objects class This class creates a sys...
# # Copyright (c) 2017 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...
# -*- coding: utf-8 -*- import matplotlib matplotlib.use('agg') import itur.models.itu835 as itu835 import itur.models.itu676 as itu676 import itur import unittest as test import numpy as np import sys import matplotlib.pyplot as plt def suite(): """A test suite for the examples includes in itur. """ suite =...
# Run file import os, sys import torch import torch.nn as nn import numpy as np import argparse import time import matplotlib.pyplot as plt from math import isnan from oh_specs import * from models import * def test(parser, norm='in'): # test trained kernels with surround suppression kernel if torch.cuda.is_avail...
enter = "\n" def build_label(label,visitor): fname = '{}_{}'.format(label,visitor.internal_count) visitor.internal_count += 1 return fname def ReservaMemoria(size): # tam = size*4 text =("# reserva memoria" + enter + "li $a0, " + str(size) + enter + "li $v0, 9" + enter ...