text stringlengths 8.04k 46.5k |
|---|
import re
from string import Template
from webhelpers2.html import HTML, literal
import webhelpers2.html._render as render
from webhelpers2.html.tools import *
# I give up trying to convert all these eq_'s to plain asserts; there's too
# many of them and they're so long.
def eq_(a, b):
assert a == b
class TestT... |
# precompute.py
# Author: <NAME> <<EMAIL>>
"""
This code includes the functions and utilities for the precomputation step
as well as the class that stores the statistics and allows them to be easily
saved and retrieved.
"""
import math
import numpy
import pickle
import torch
import random
from .models import Flatten... |
#!/usr/bin/env python
# coding: utf-8
# In[ ]:
import os
import shutil
import socket
import threading
import time
import urllib
import urllib.parse
import urllib.request
from os import PathLike
from pathlib import Path
from typing import List, NamedTuple, Optional, Tuple
import cv2
import matplotlib
import matplotl... |
import os, sys, re, six, math, lmdb, torch, cv2
import numpy as np
from natsort import natsorted
from PIL import Image, ImageDraw
import torch
from torch.utils.data import Dataset, ConcatDataset, Subset
from torch._utils import _accumulate
import torchvision.transforms as transforms
import torchvision.transforms as T
i... |
# Copyright (C) 2014 <NAME>
# All rights reserved.
#
# This file is part of phonopy.
#
# 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, thi... |
"""
Test for mmtbx.ncs.ligands module and associated command-line tool
mmtbx.apply_ncs_to_ligands (used in phenix.ligand_pipeline)
"""
from __future__ import absolute_import, division, print_function
from iotbx import file_reader
from libtbx import easy_run
from libtbx.utils import null_out
from six.moves import cStr... |
# Copyright (C) 2013 Nippon Telegraph and Telephone Corporation.
# Copyright (C) 2013 <NAME> <yamahata at private email ne jp>
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://ww... |
# SPDX-FileCopyrightText: Copyright (c) 2020 <NAME> for Adafruit Industries
#
# SPDX-License-Identifier: MIT
"""
`_bleio.common`
=======================================================================
_bleio implementation for Adafruit_Blinka_bleio
* Author(s): <NAME> for Adafruit Industries
"""
from __future__ impor... |
import re
import os
import pickle
import spacy
import logging
import multiprocessing
import numpy as np
import pandas as pd
import seaborn as sns
import matplotlib.pyplot as plt
from time import time
from pathlib import Path
from collections import defaultdict, Counter
from spacy_langdetect import LanguageDetector
fr... |
"""Part of the code is adapted from:
@dbolya yolact: https://github.com/aim-uofa/AdelaiDet/adet/modeling/solov2/solov2.py
Licensed under The MIT License [see LICENSE for details]
"""
import cv2
import torch
import torch.nn as nn
import torch.nn.functional as F
from data.config import cfg
from utils import time... |
"""Define distributed graph."""
from collections.abc import MutableMapping
import os
import numpy as np
from ..heterograph import DGLHeteroGraph
from .. import heterograph_index
from .. import backend as F
from ..base import NID, EID
from .kvstore import KVServer, KVClient
from .standalone_kvstore import KVClient as ... |
# coding=utf-8
# *** WARNING: this file was generated by pulumi-gen-eks. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union, overload
from . import _utilities
from ._inputs i... |
""" Testing flag combining operators on our flags instances. """
import operator
from unittest import TestCase
from flags import Flags
class MyOtherFlags(Flags):
of0 = ()
class MyFlags(Flags):
f0 = ()
f1 = ()
f2 = ()
no_flags = MyFlags.no_flags
all_flags = MyFlags.all_flags
f0 = MyFlags.f0
f1 = M... |
# -*- coding: utf-8 -*-
#
# QcodeEditor.py
# It is based on the following codes by acbetter:
# https://stackoverflow.com/questions/40386194/create-text-area-textedit-with-line-number-in-pyqt
#
# Others are written by <NAME> (15 June 2021)
from PySide2.QtCore import Qt, QRect, QSize, QRegExp, QPoint, QTimer, Signal
fr... |
import os, csv
from sklearn.model_selection import train_test_split, cross_val_score
from sklearn.model_selection import cross_val_predict
from sklearn.metrics import precision_score
from sklearn.metrics import recall_score
from hyperopt import fmin, tpe, partial
import xgboost as xgb
import pandas as pd
import numpy a... |
"""Dataset utils for different data settings for GLUE."""
import os
import copy
import logging
import torch
import numpy as np
import time
from filelock import FileLock
import json
import itertools
import random
import transformers
from src.processors import processors_mapping, num_labels_mapping, output_modes_mapping... |
import math
from functools import partial
import json
import re
import random
from itertools import groupby
from collections import Counter, defaultdict
from copy import copy
import os
from PIL import Image
import numpy as np
import layoutparser as lp
from tqdm import tqdm
from glob import glob
import pandas as pd
fro... |
#! /usr/bin/python3
# -*- coding: utf-8 -*-
"""
************
SQL Database
************
Query obs containing 19 antennas in database:
SELECT *
FROM observation o
inner join analogbeam a
on o.id = a.observation_id
where a.nAntennas = 19;
Query obs containing MA 55 in... |
try:
import grid2op
import threading
import numpy as np
import time
import json
import copy
import os
from grid2op import make
from grid2op.Agent import MLAgent
from grid2op.Environment import Environment
from grid2op.Parameters import Parameters
from grid2op.... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import numpy as np
import xarray as xr
from datetime import datetime, timedelta
# tk
from .util.time_operations import get_years_months_days, npdt64todatetime, \
fast_reindex_hourly
# hide numpy warnings
np.warnings.filterwarnings('ignore')
# TODO: combine GetDistribut... |
# ------------------------------------------------------------------
# Capsules_mnist
# By <NAME>
# ------------------------------------------------------------------
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import numpy as np
import tensorflow as tf
... |
# coding: utf-8
# In[1]:
get_ipython().run_line_magic('matplotlib', 'inline')
get_ipython().run_line_magic('load_ext', 'memory_profiler')
import matplotlib.pyplot as plt
# In[2]:
import string
import gzip
import json
import re
# In[3]:
import numpy as np
import pandas as pd
# In[4]:
import scipy
from s... |
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the Apache 2.0 License.
import os
import time
import logging
from contextlib import contextmanager
from enum import Enum, IntEnum
from ccf.clients import CCFConnectionException, flush_info
import infra.path
import infra.proc
import infra.node
... |
# -*- coding: utf-8 -*-
"""Core logic for computing subtrees."""
# standard library imports
import contextlib
import os
import sys
from collections import Counter
from collections import OrderedDict
from itertools import chain
from itertools import combinations
from pathlib import Path
# third-party imports
import ne... |
__copyright__ = "Copyright (C) 2013 <NAME>"
__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 Software without restriction, including without limitation the rights
to use, copy, modify, mer... |
import itertools
import hashlib
import ast
from ecdsa import SigningKey, VerifyingKey, SECP112r2
import node
from ecdsa.util import randrange_from_seed__trytryagain
import os
import validator
import copy
from numba import jit
def priv_key_gen():
seed = os.urandom(SECP112r2.baselen)
secexp = randrange_from_seed... |
# -*- encoding: utf-8 -*-
import os
import time
import click
from lxml import etree
from apps.extractor.base import BaseExtractor
from apps.extractor.models import Alignment
from apps.extractor.perfectextractor import PerfectExtractor, PRESENT
from apps.extractor.posextractor import PoSExtractor
from apps.extractor.... |
import os
import errno
class SequenceSample:
def __init__(self):
self.sample_label = ''
self.instance_path = ''
self.sample_qcpath = ''
self.sample_alignpath = ''
self.sample_predictpath = ''
self.html_path = ''
self.enshrine_flag = False
self.subsample_flag = False
self.snpobservationvalue = 0
se... |
# coding: utf-8
# Copyright (c) Materials Virtual Lab.
# Distributed under the terms of the BSD License.
from typing import Dict, List, Tuple, Optional, Union, Iterator, Set, \
Sequence, Iterable, Callable
from collections import Counter
import numpy as np
import itertools
import pandas as pds
from sci... |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from tempfile import SpooledTemporaryFile
import torch
import pytest
import pydrobert.torch.util as util
__author__ = "<NAME>"
__email__ = "<EMAIL>"
__license__ = "Apache 2.0"
__copyright__ = "Copyright 2019 ... |
import csv
import logging
from collections import defaultdict
from rdflib import Graph, Literal, BNode, URIRef
from rdflib.namespace import XSD
from rdflib.collection import Collection
from bricksrc.ontology import define_ontology
from bricksrc.namespaces import (
BRICK,
BSH,
RDF,
OWL,
RDFS,
T... |
from copy import deepcopy
from dataclasses import dataclass, field
from itertools import chain
from typing import (
List, Dict, Any, Optional, TypeVar, Union, Tuple, Callable, Mapping,
Iterable, Set
)
from typing_extensions import Protocol
import hashlib
import os
from dbt.clients.system import resolve_path_f... |
# Copyright 2015 VMware, 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 a... |
import numpy as np
import cv2
from numpy.core.fromnumeric import trace
import mediapipe_utils as mpu
from pathlib import Path
from FPS import FPS, now
import depthai as dai
import marshal
import sys
from string import Template
from math import sin, cos
SCRIPT_DIR = Path(__file__).resolve().parent
POSE_DETECTION_MODEL ... |
#Python 2.7.9 (default, Apr 5 2015, 22:21:35)
# the full environment I used to test this is in basic_project_stats.yml
import sys
# file with raw classifications (csv)
# put this way up here so if there are no inputs we exit quickly before even trying to load everything else
try:
classfile_in = sys.argv[1]
except... |
"""Test the module rbfopt_utils in RBFOpt.
This module contains unit tests for the module rbfopt_utils.
Licensed under Revised BSD license, see LICENSE.
(C) Copyright International Business Machines Corporation 2016.
"""
from __future__ import print_function
from __future__ import division
from __future__ import ab... |
# -*- coding: utf-8 -*-
"""
README
================================================================================
This is the implementation of the NEO IO for the HDF5 files.
http://neuralensemble.org/
IO dependencies:
- NEO
- types
- warnings
- numpy
- pytables >= 2.2
- quantities
Quick reference:
=========... |
###########
# Imports #
###########
import sys
import u2py
import tkinter as tk
from tkinter import *
##################
# GUI Properties #
##################
root = Tk()
root.geometry("600x500+0+0")
root.configure(background = "White")
root.title("Student Information Manager")
root.columnconfigure(0, minsize = 120)
r... |
##########################################################################
## Program Author: <NAME> (Original by <NAME>) ##
## Revision Date: Dec 31, 2018 ##
## Program Name: Christmas Adventure ##
## Description: This pro... |
# Copyright (c) 2021-2022, NVIDIA 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... |
"""
Helper functions for standard model modules.
"""
#***************************************************************************************************
# Copyright 2015, 2019 National Technology & Engineering Solutions of Sandia, LLC (NTESS).
# Under the terms of Contract DE-NA0003525 with NTESS, the U.S. Government ... |
import itertools
from copy import deepcopy
from multiprocessing import Pool
import numpy as np
from pymatgen.analysis import structure_analyzer
from pymatgen.io.vasp.outputs import Xdatcar
from pymatgen.util.coord import get_angle
from scipy.spatial import Voronoi
__author__ = '<NAME> <<EMAIL>>'
def polyhedra_conne... |
import sys
import os
import dill
import argparse
import pandas as pd
import numpy as np
from tqdm import tqdm
import tensorflow as tf
from kalman_filter import NonlinearKinematicBicycle
nu_path = '../devkit/python-sdk/'
sys.path.append(nu_path)
sys.path.append("../../../trajectron")
from environment import Environmen... |
# Copyright 2016 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.
import copy
import json
import sys
import unittest
from request_track import (TimeBetween, Request, CachingPolicy, RequestTrack,
... |
# -*- coding: utf-8 -*-
import logging
import utool as ut
(print, rrr, profile) = ut.inject2(__name__)
logger = logging.getLogger('wbia')
def reasign_names1(ibs, aid_list=None, old_img2_names=None, common_prefix=''):
r"""
Changes the names in the IA-database to correspond to an older
naming convention. ... |
import pkg_resources
import datetime
import logging
import pandas as pd
import pytz
import re
import requests
import requests_cache
"""
INFO:
https://download.waterinfo.be/tsmdownload/KiWIS/KiWIS?service=kisters& \
type=QueryServices&format=html&request=getrequestinfo
other KIWIS-python clients:
... |
"""Config on Windows"""
# **** The search part is broken. For instance, the png Visual Studio project
# places to dll in a directory not checked by this module.
try:
from setup_win_common import get_definitions
except ImportError:
from buildconfig.setup_win_common import get_definitions
import os, sys
import... |
"""This is the core of superspy; it handles most of the parsing and execution.
"""
import re
from abc import ABC, abstractmethod
from enum import Enum, auto
from typing import Any, Dict, List, Optional, Tuple, Type, Union
from superspy import code_source, language
# pylint: disable=too-few-public-methods
# This cl... |
import logging
import struct
import enum
from io import BytesIO
import bitstruct
import binascii
# Connection flags.
CLEAN_START = 0x02
WILL_FLAG = 0x04
WILL_QOS_1 = 0x08
WILL_QOS_2 = 0x10
WILL_RETAIN = 0x20
PASSWORD_FLAG = 0x40
USER_NAME_FLAG = 0x80
def hexlify(data):
if data is None:
... |
import os
import gc as garbage_collection
import copy
from collections import OrderedDict
import json
import numpy as np
import cv2
from skimage.morphology import disk
import torch
import torch.nn as nn
from torch.nn import Sequential as Seq, Linear, ReLU
from torch_geometric.data import Data, Batch
from torch_scatte... |
import sysrepo
import logging
import asyncio
import argparse
import signal
import ctypes
import onlp.onlp
import json
import re
from pathlib import Path
libonlp = onlp.onlp.libonlp
class InvalidXPath(Exception):
pass
logger = logging.getLogger(__name__)
STATUS_UNPLUGGED = 0
STATUS_ACO_PRESENT = 1 << 0
STATUS_... |
from __future__ import unicode_literals
import os
import sys
import datetime
import logging
import eeUtil
import ee
import time
import requests
# url for air quality data
SOURCE_URL = 'COPERNICUS/S5P/OFFL/L3_{var}'
# list variables (as named in GEE) that we want to pull
VARS = ['NO2', 'CO', 'AER_AI', ... |
# coding=utf-8
import os
import time
import math
import sys
import ree
import random
# besoin absolu !
from pygame.locals import *
class UEnumFactory:
seed = 0
def __init__(self, *args):
self.list_value_numbers = range(len(args) + UEnumFactory.seed)
self.dict_attrib = dict(zip(args, self.li... |
"""
@author: <NAME>
@org: ABEnt
@date: May 2019
@description: This is a clone of Tower Defense Game which I implemented in Python
"""
# import packages
import os
import time
import random
import pygame
from random import randrange
# import classes
from .enemies.knight import Knight
from .enemies.ninja import Ninja
fr... |
__author__ = '<NAME>'
import hailtop.batch as hb
import hail as hl
hl.init(spark_conf={'spark.hadoop.fs.gs.requester.pays.mode': 'CUSTOM',
'spark.hadoop.fs.gs.requester.pays.buckets': 'ukb-diverse-pops-public',
'spark.hadoop.fs.gs.requester.pays.project.id': 'ukbb-diversepops-neal... |
import datetime as dt
import logging
import multiprocessing
import os
import re
import shutil
import urllib.request
from urllib.request import URLError
from typing import Tuple, List, Dict
import time
import math
import warnings
import simplejson as json
import signal
import piexif
import traceback
import astropy.coor... |
# --------------------------------------------------------------------------
# Source file provided under Apache License, Version 2.0, January 2004,
# http://www.apache.org/licenses/
# (c) Copyright IBM Corp. 2021
# --------------------------------------------------------------------------
# Author: <NAME>, IBM Analyti... |
# -*- coding: utf-8 -*-
"""
Created on Mon Mar 5 13:16:41 2018
NEED TO RUN ppp1_grouped.py first to load data and certain functions into memory.
Trying to do this using import statement - but at the moment not importing modules.
@author: jaimeHP
"""
import matplotlib.gridspec as gridspec
import matplotlib.lines as m... |
# -*- coding: utf8 -*-
from __future__ import annotations
import datetime
from dateutil.parser import isoparse
import logging
from typing import Dict, List, Tuple
import requests
from humanize import naturalsize
from nio import AsyncClient
from core.bot_commands import Command
from core.plugin import Plugin
logger =... |
from __future__ import print_function
from __future__ import division
import os
import re
import sys
import time
import numpy as np
import tensorflow as tf
from utils import *
from tensorflow.python.ops import variable_scope
from tensorflow.contrib import rnn as rnn_cell
from models.VAE_cell import VAECell
from model... |
#!/usr/bin/env python
# The MIT License (MIT)
#
# Copyright (c) 2015 <NAME> <<EMAIL>>
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the ... |
# -*- coding: utf-8 -*-
"""
Created on Sun Mar 26 14:41:07 2017
Last edited on Thursday July 13 2017
@author: JT
Made using help from PyQt5 tutorials by ZetCode.com
"""
import visa
import sys
import numpy as np
import threading
import time
from PyQt5.QtWidgets import (QWidget, QLabel,QCheckBox, QApplic... |
import os
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d import Axes3D
################################
#1. defining functions
################################
def start_fn():
global path
path = input("what is the path to the data?")#C:/Users/YISS/Desktop/data_mining... |
#!/usr/bin/env python
from datetime import date, datetime
from decimal import Decimal, ROUND_UP, ROUND_DOWN
from unittest import TestCase
from wtforms import validators, widgets
from wtforms.fields import *
from wtforms.fields import Label
from wtforms.form import Form
class DummyPostData(dict):
def getlist(self... |
from modules import util
from modules.util import Failed
from tmdbapis import TMDbAPIs, TMDbException, NotFound
logger = util.logger
builders = [
"tmdb_actor", "tmdb_actor_details", "tmdb_collection", "tmdb_collection_details", "tmdb_company",
"tmdb_crew", "tmdb_crew_details", "tmdb_director", "tmdb_director_... |
# coding=utf-8
# Copyright (c) 2021, EleutherAI contributors
# This file is based on code by the authors denoted below and has been modified from its original version.
#
# Copyright (c) 2020, NVIDIA CORPORATION. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use ... |
#!/usr/bin/env python3
#######################################################################
#
# SYMBOLS SECTION - Can be edited. Changes will be preserved.
#
#######################################################################
from functools import partial
import os
import sys
from typing import Tuple, List
t... |
#
# LSST Data Management System
# Copyright 2008-2015 AURA/LSST.
#
# This product includes software developed by the
# LSST Project (http://www.lsst.org/).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software ... |
# -*- encoding: utf-8 *-*
import os
import io
import re
import sys
from collections import OrderedDict
from datetime import datetime
from glob import glob
from distutils.command.build import build
from distutils.core import Command
import textwrap
min_python = (3, 4)
my_python = sys.version_info
if my_python < min_... |
#!/usr/bin/env python
"""
Module SETUPUTILS -- Utilities to automate boilerplate in Python setup scripts
Copyright (C) 2012 by <NAME>
Released under the Python Software Foundation License.
The purpose of this module is to help automate away much of the
boilerplate that goes into Python setup scripts. Typical usage:
... |
# -*- coding: utf-8 -*-
"""
Ce script traite les erreurs de correspondance d'OSRM.
Ensuite, les distances entre chaque match sont calcules en
suivant le reseau.
De ces distances sont extraites les vitesses entre chaque match.
Enfin, les vitesses pour chaque segment sont attribues.
"""
__authors__ = ("<NAME>")
__contac... |
# Edited by <NAME>
# Copied from https://github.com/emansim/baselines-mansimov/blob/master/baselines/a2c/visualize_atari.py
# and https://github.com/emansim/baselines-mansimov/blob/master/baselines/a2c/load.py
# Thanks to the author and OpenAI team!
import glob
import json
import os
import pdb
import time
import argpa... |
import collections
from copy import deepcopy
from itertools import chain
from typing import (
Any,
ItemsView,
Iterable,
Iterator,
KeysView,
List,
Mapping,
Optional,
Reversible,
Sequence,
Tuple,
Union,
ValuesView,
)
from . import abc, errors
from .types import Mutable... |
#
# Copyright (c) 2021, NVIDIA CORPORATION. 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 appl... |
import aes128
import Print
import os
import shutil
import json
from Fs import Nsp as squirrelNSP
from Fs import Xci as squirrelXCI
from Fs.Nca import NcaHeader
from Fs.File import MemoryFile
import sq_tools
import io
from Fs import Type as FsType
from Fs import factory
import Keys
from binascii import hex... |
import logging
from typing import Optional, Tuple, List
import torch
from torch import Tensor, nn
from torch.nn import Module
_LG = logging.getLogger(__name__)
class LayerNorm(nn.LayerNorm):
"""Layer norm with transpose"""
def forward(self, input: Tensor) -> Tensor:
x = input.transpose(-2, -1)
... |
import pygplates
import glob, re
import os
import numpy as np
import matplotlib.pyplot as plt
from scipy import interpolate
import xarray as xr
#from . import paleogeography_tweening as pgt
from .create_gpml import create_gpml_regular_long_lat_mesh
from .sphere import sampleOnSphere
from . import paleogeography as pg... |
# for localized messages
from . import _
from enigma import eEPGCache, eTimer, eServiceReference, eServiceCenter, RT_HALIGN_LEFT, RT_HALIGN_RIGHT, RT_VALIGN_CENTER, eListboxPythonMultiContent
import NavigationInstance
from Tools.LoadPixmap import LoadPixmap
from Tools.Directories import fileExists, resolveFilename, S... |
# Copyright (c) 2021 <NAME>
# This library is licensed under the MIT license
# For a complete copy of the license, see the LICENSE file.
""" # Complete reference of resource definition
This section explains how to define a resource, its fields and its links. See
`BaseResource.jsonapi_dict()` for a documentation on ex... |
"""
Tools to convert RNA 2 structures to a graph representation.
"""
import itertools as it
from collections import Counter
from itertools import product
import numpy as np
import pandas as pd
from sklearn.preprocessing import LabelBinarizer
import networkx as nx
import RNAtools
lb = LabelBinarizer()
letters = ['A'... |
import numpy
import logging
from NiuTensor2onnx import read_data, To_onnx
logging.basicConfig(level=logging.INFO)
logger = logging.getLogger("[NiuTensor2TREE]")
# Elementwise operation
kElemWise = 0
# Broadcasting operator, can always map output axis to the input in order.
# for example :code:`out[i, ax1, j, ax2] = i... |
import Vehicles
import numpy as np
import math
import cv2
import random
import time
import matplotlib.pyplot as plt
from PIL import Image
import scipy.misc
from functools import wraps
import copy
import os
# gray = cv2.cvtColor(img, cv2.COLOR_BGR2GRAY)
class GameV1:
## 5000 is total length of highway
## c... |
# Created by <NAME> Copyright 2019.
# This file train. validate and test transfer learning withTFRecords
'''
TFRecords are stored as following:
By specify the percentage of validation set and testing set, the following files will
be generated:
TFRecords_directory/flowers_train_00000-of-00005
TFReco... |
""" Implementation of Cosmic RIM estimator"""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import tensorflow as tf
physical_devices = tf.config.experimental.list_physical_devices('GPU')
print("\nphysical_devices\n", physical_devices)
assert len(physical_d... |
# -*- coding: utf-8 -*-
"""
Created on Wed Jul 7 14:12:27 2021
@author: 10695421999
"""
# -*- coding: utf-8 -*-
"""
Created on Wed Jul 7 14:03:49 2021
@author: 10695421999
"""
import numpy as np
import time
from math import sqrt
from math import pi
from math import sin
from math import cos
import matplotlib.pyplo... |
"""
Functions in this module are modified versions of those from MeshCNN
(https://github.com/ranahanocka/MeshCNN/).
"""
import numpy as np
import pymesh
from pd_mesh_net.utils import dihedral_angle_and_local_indices_edges
# Data augmentation methods.
def augmentation(mesh,
vertices_scale_mean=None,... |
import pandas as pd
import numpy as np
import lib
import implicit.bpr
import sklearn.metrics
import sklearn.ensemble
import sklearn.decomposition
import json
import time
import itertools
import re
import sklearn.linear_model
import os
from . import prop_ranker as prop
import collections
MODEL_CACHE = "models/"
class... |
import os
import math
import time
import datetime
from multiprocessing import Process
from multiprocessing import Queue
import matplotlib
matplotlib.use('Agg')
import matplotlib.pyplot as plt
import numpy as np
import imageio
import torch
import torch.optim as optim
import torch.optim.lr_scheduler as lrs
### [y]
... |
# -*- coding: utf-8 -*-
"""
Created on Sat Nov 30 22:13:00 2019
@author: hill103
"""
'''
Using Flask and Bootstrap to construct the python-based website
Using Flask-Bootstrap package to implement Bootstrap
Using Flask-WTF to conveniently integrate WTForms
Version 3: 使用MySQL数据库
'''
from flask import Flask, render_te... |
import tensorflow as tf
import numpy as np
import gym
import logz
import os
import time
import inspect
from multiprocessing import Process
from tensorflow.keras import Model
from tensorflow.keras.layers import Dense
class MLP(Model):
def __init__(self, output_size, scope, n_layers, size, activation = tf.nn.tanh, ... |
""" Model sampling
The code below was derived from
https://github.com/huggingface/transformers/blob/v4.2.2/src/transformers/generation_utils.py
which is under Apache 2.0 License (https://www.apache.org/licenses/LICENSE-2.0)
The goal is to have access of the internals of the generate() method to modify sampling at i... |
import numpy as np
import pandas as pd
import os
from scipy.spatial.distance import cdist
import time
import multiprocessing
from joblib import Parallel, delayed
import psp.PSP_lib as bd
import psp.output_lib as lib
from tqdm import tqdm
class Builder:
def __init__(
self,
VaspInp_list,
NSa... |
# antglob - algorithm for globbing ant-style path expressions
#
# Copyright (c) 2013 - 2017 Software AG, Darmstadt, Germany and/or its licensors
#
# 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 Lic... |
"""
artssat.arts_object
-------------------
The :code:`arts_object` module provides meta-programming functionality
that aims to simplify unified treatment of relevant ARTS variables.
The basic idea is to provide so called *ARTS properties*, which are
similar in concept to Python properties but extend their functionali... |
import numpy as np
import luigi
import os
import pandas as pd
import itertools
import re
from improc.regionprops import BaseFeatureExtractor, QuantilesFeatureExtractor, IntensityFeatureExtractor, DistanceTransformFeatureExtractor, SKRegionPropFeatureExtractor
from improc.regionprops import DerivedFeatureCalculator, Hy... |
#!/usr/bin/env python3
"""
Implementation of the Rich header md5 hash.
"""
import os
import sys
import pefile
import hashlib
import argparse
from struct import pack
#from https://github.com/dishather/richprint/blob/master/comp_id.txt
#adapted from mirar's implementations for https://www.sweetscape.com/010editor/repo... |
import numpy as np
import matplotlib
import matplotlib.pyplot as plt
import pandas as pd
import scipy.stats as scs
from scipy.stats.distributions import norm
from scipy.stats import gaussian_kde
from sklearn.neighbors import KernelDensity
from scipy.stats import gaussian_kde
from statsmodels.nonparametric.kde import K... |
#!/usr/bin/nv python
# -*- coding: utf-8 -*-
# ------------------------------------------------------------------
# Filename: seisig.py
# Purpose: Seismic Signal Analysis
# Author: <NAME>
# Email: <EMAIL>
# --------------------------------------------------------------------
"""
Object oriented code to create... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Define the various basic bodies / objects that are present in the simulator / world.
Dependencies:
- `pyrobolearn.simulators`
- `pyrobolearn.utils`
"""
import sys
import copy
from pyrobolearn.simulators import Simulator
from pyrobolearn.utils.transformation import get... |
"""
Import as:
import oms.pnl_simulator as opnlsimu
"""
import collections
import copy
import logging
from typing import Any, Dict, List, Optional, Tuple, cast
import numpy as np
import pandas as pd
from tqdm.autonotebook import tqdm
import helpers.hdbg as hdbg
import helpers.htqdm as htqdm
import helpers.hprint as ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.