text stringlengths 8.04k 46.5k |
|---|
import time
from .peeler_tools import *
from .peeler_tools import _dtype_spike
from .tools import make_color_dict
from .signalpreprocessor import signalpreprocessor_engines
from .peakdetector import get_peak_detector_class
from .cltools import HAVE_PYOPENCL, OpenCL_Helper
if HAVE_PYOPENCL:
import pyopencl
m... |
import collections
import datetime
import functools
import logging
from unittest.mock import call
import pytest
from bloop.exceptions import InvalidPosition, InvalidStream, RecordsExpired
from bloop.stream.shard import CALLS_TO_REACH_HEAD, Shard, last_iterator
from bloop.util import ordered
from . import (
build... |
import argparse
import functools
import json
import os
import subprocess
from pathlib import Path
from shutil import copyfile
from warnings import warn
from zipfile import ZipFile
import imageio
import numpy as np
import torch
import torch_em
import bioimageio.core as core
import bioimageio.core.build_spec as build_s... |
#Differential Photometry script written in April 2019 by SKB, MP, KWD for WIYN 0.9m HDI data
#This script calculates photometry and differential photometry for all stars in an image and takes target positions to pull out differential photometry of target stars. Auto calculates comparison stars based on lowest percent... |
#
# Copyright (C) <NAME> 2020 <<EMAIL>>
#
import configparser
import keyring
import sqlite3
import subprocess
import bluetooth
import gi
import datetime
from . import config
from .config import log
from . import utility
from .utility import WorkerThread
gi.require_version('Gtk', '3.0')
from gi.repository import Gtk,... |
#!/usr/bin/env python3
# -*- coding: UTF-8 -*-
# -----------------------------------------------------------------------------
#
# P A G E B O T
#
# Copyright (c) 2016+ <NAME> + <NAME>
# www.pagebot.io
# Licensed under MIT conditions
#
# Supporting DrawBot, www.drawbot.com
# Supporting Flat, xxy... |
###############################################################
# SPDX-License-Identifier: BSD-2-Clause-Patent
# SPDX-FileCopyrightText: 2020 the prplMesh contributors (see AUTHORS.md)
# This code is subject to the terms of the BSD+Patent license.
# See LICENSE file for more details.
###################################... |
import logging
import os
import socket
import sqlite3
from datetime import date
from datetime import datetime
from datetime import time
from datetime import timedelta
from os.path import normpath
from os.path import split
from uuid import uuid4
import icalendar
import pytz
from atomicwrites import AtomicWriter
from da... |
from django import forms
from django.core import validators
from django.utils.datastructures import SortedDict
from itertools import chain
from django.utils.encoding import StrAndUnicode, force_unicode
from django.utils.html import escape, conditional_escape
from django.utils.safestring import mark_safe
from django.for... |
# -*- coding: utf-8 -*-
# BioSTEAM: The Biorefinery Simulation and Techno-Economic Analysis Modules
# Copyright (C) 2020-2021, <NAME> <<EMAIL>>
#
# This module is under the UIUC open-source license. See
# github.com/BioSTEAMDevelopmentGroup/biosteam/blob/master/LICENSE.txt
# for license details.
"""
This module conta... |
r"""
Elements of bounded height in number fields
Sage functions to list all elements of a given number field with height less
than a specified bound.
AUTHORS:
- <NAME> (2013): initial version
- <NAME> (2013): initial version
REFERENCES:
.. [Doyle-Krumm] <NAME> and <NAME>, Computing algebraic numbers
of bound... |
#Embedded file name: /Users/versonator/Jenkins/live/output/Live/mac_64_static/Release/python-bundle/MIDI Remote Scripts/_Framework/ControlSurface.py
from __future__ import absolute_import, print_function, unicode_literals
from builtins import filter
from builtins import str
from builtins import map
from builtins import... |
# Copyright 2014-2015 Canonical Limited.
#
# This file is part of jujubigdata.
#
# jujubigdata is free software: you can redistribute it and/or modify
# it under the terms of the Apache License version 2.0.
#
# jujubigdata is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the i... |
"""This module contains the class which are used in the simulation."""
import sqlite3
import warnings
import copy
import os
import numpy as np
import matplotlib.pyplot as plt
from matplotlib.patches import Polygon
from astropy.table import Table
from astropy.io import fits
import pandas as pd
from . import utils as ut... |
# -*- coding: utf-8 -*-
"""
Copyright (c) 2018 Robert Bosch GmbH
All rights reserved.
This source code is licensed under the MIT license found in the
LICENSE file in the root directory of this source tree.
@author: <NAME>, <NAME>, <NAME>, <NAME>
"""
"""
NIGP: noisy input Gaussian process case
func: _generate_... |
import ast
import random
import warnings
import numpy as np
import tensorflow as tf
from sklearn import feature_selection
from sklearn.feature_extraction import text
from tensorflow.python.util import nest
from autokeras import const
from autokeras import encoder
from autokeras import utils
from autokeras.hypermodel ... |
import torch
import torch.nn as nn
import torch.nn.functional as F
from torch.nn.utils.rnn import pack_padded_sequence, pad_packed_sequence
import numpy as np
import math
from maskedbatchnorm1d import MaskedBatchNorm1d
import six
from ctc_crf import CTC_CRF_LOSS, WARP_CTC_LOSS
def pad_list(xs, pad_value):
n_batch ... |
# -*- coding: utf-8 -*-
# Adapted 2016 <NAME>, TU Berlin
# TU cluster specific changes.
# Written (W) 2008-2012 <NAME>
# Written (W) 2008-2010 <NAME>
# Written (W) 2012-2014 <NAME>, <EMAIL>
# Copyright (C) 2008-2012 Max-Planck-Society, 2012-2014 ETS
# This file is part of GridMap.
# GridMap is free software: you can... |
import os
import pandas as pd
import gavia.time as gavtime
from gavia.version import __version__
import sys
def getlogs(dir,logtype):
'''
get list of logs for camera
'''
files = []
loglist = os.listdir(dir)
for log in loglist:
if logtype in log:
files.ap... |
import collections
import functools
import json
import math
import multiprocessing
import re
import traceback
import typing
from pathlib import Path
import ghidra_bridge
from mercury_engine_data_structures import dread_data
from mercury_engine_data_structures.type_lib import TypeKind, PrimitiveKind
# New JSON Format... |
from distutils.version import LooseVersion
import pytest
import inspect
from bluesky.tests.utils import DocCollector
import bluesky.plans as bp
import bluesky.plan_stubs as bps
import numpy as np
import numpy.testing as npt
import pandas as pd
import random
import re
import collections
from bluesky.tests.utils import M... |
import re
import os
import shutil
import json
import uuid
import flask
from flask.json import jsonify
from flask_session import Session
from oauthlib import oauth2
from requests_oauthlib import OAuth2Session
from functools import wraps
import utilities as utils
from app_config import *
# Flask initialization.
APP = f... |
"""
Copyright 2018 Duo Security
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 following
disclaimer.
2. Redistribut... |
# Copyright 2016 Pinterest, 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 writi... |
"""
sw_app.py -- classes for Sciris (Flask-based) apps
Last update: 2018nov14
"""
# Imports
import io
import os
import sys
import socket
import logging
import traceback
from collections import OrderedDict
from functools import wraps
from flask import Flask, request, abort, json, jsonify as flask_jsonify, send_f... |
'''Functions and scripts for machine learning training and
classification of photometry and spectra.'''
import os
import shutil
from functools import lru_cache
import itertools
import pickle
import argparse
import numpy as np
import requests
from astropy.table import Table
import astropy.units as u
from scipy.interp... |
#!/usr/bin/env python3
"""
Python retro shell graphics framework built on colorama
This module contains the core framework classes for creating shell components and displaying ASCII text. Components are
added to a Retro instance that once launched takes control of the current thread.
Example usage:
import retro
... |
# Copyright (C) 2013-2015 eNovance SAS <<EMAIL>>
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import time
import logging
import socket
import fcntl
import struct
import warnings
import datetime
import threading
from time import gmtime, strftime
from modules import app, cbpi
from .i2c import CharLCD
# LCDVERSION = '4.0.00' The LCD-library and LCD-driver are taken f... |
"""
Author: Dr. <NAME>
Date: 11-02-2020
"""
from parcels import AdvectionEE, AdvectionRK45, AdvectionRK4
from parcels import FieldSet, ParticleSet, ScipyParticle, JITParticle, Variable, AdvectionRK4, RectilinearZGrid, ErrorCode
from parcels.field import Field, VectorField, NestedField, SummedField
from parcels import ... |
#!/usr/bin/env python
# Copyright (c) 2015-2016 University Corporation for Atmospheric Research/Unidata
# Distributed under the terms of the MIT License.
# SPDX-License-Identifier: MIT
import asyncio
import functools
import glob
import logging
import os
import os.path
import shutil
import struct
import sys
import thre... |
import os
from collections import namedtuple
from random import randrange, choice
from math import copysign
import pygame
SCREEN_HEIGHT = 960
SCREEN_WIDTH = 640
SCREEN_RECT = pygame.rect.Rect(0, 0, SCREEN_WIDTH, SCREEN_HEIGHT)
FPS = 60
_image_cache = {}
def load_image(path):
if path not in _image_cache:
... |
# coding=utf-8
# Copyright 2019 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
from __future__ import absolute_import, print_function
import fileinput
import functools
import json
import os
import re
import subprocess
import sys
from collections impor... |
import argparse
import os
import sys
import traceback
import math
import time
from datetime import datetime
from enum import IntEnum
from copy import deepcopy as dcp
from mpi4py import MPI
import torch
torch.set_printoptions(precision = 4, threshold = 5000, edgeitems = 5, linewidth = 160)
torch.multiprocessing.set_... |
"""
Test the datasets module
"""
# Author: <NAME>
# License: simplified BSD
import os
import shutil
import itertools
import numpy as np
import nibabel
import pytest
from numpy.testing import assert_array_equal
from . import test_utils as tst
from nilearn._utils.compat import _basestring, _urllib
from nilearn.dat... |
import numpy as np
import tensorflow as tf
import re
from scipy import spatial
import operator
import lapjv
import preprocessing
matching_threshold = 0.6
# read the embedding file
def ebd_file_to_dic(embedding_file):
ebd_list = np.loadtxt(embedding_file)
ebd_dic = {}
feature_dim = len(ebd_list[0]) - 1
... |
"""
amqproto.channel
~~~~~~~~~~~~~~~~
AMQP channels.
"""
# Pylint can't handle attrs magic.
# pylint: disable=attribute-defined-outside-init,no-member
import uuid
import warnings
from io import BytesIO
from collections import deque
import attr
from . import methods
from . import replies
from .settings import Setti... |
#!/usr/bin/env python3
"""
DWARF parser minimal implementation.
All references unless states otherwise are for:
DWARF v3, December 20, 2005
"""
"""
Enumeration examples
TI ARM C/C++ Codegen PC v16.9.6.LTS
([], DIE DW_TAG_enumeration_type, size=13, has_children=True
|DW_AT_sibling : AttributeValue(nam... |
# -*- coding: utf-8 -*-
from __future__ import absolute_import
import copy
import re
from collections import OrderedDict
from ..errors import ArgumentError, CubesError
from ..metadata import Dimension, Cube
from ..logging import get_logger
from .. import compat
__all__ = [
"Cell",
"Cut",
"PointCut",
... |
import json
from abc import ABC
from dataclasses import dataclass
from functools import reduce
from itertools import chain
from threading import RLock
from typing import (
Any,
Container,
Dict,
Iterable,
List,
Mapping,
Optional,
Sequence,
Set,
Tuple,
Union,
)
from graphviz i... |
# Copyright (c) 2018-present, Facebook, Inc.
# All rights reserved.
#
# This source code is licensed under the license found in the
# LICENSE file in the root directory of this source tree.
#
import torch
import numpy as np
# PyTorch-backed implementations
def normalize_vector( v, return_mag =False):
... |
# ===============================================================================
# Copyright 2014 <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/LI... |
import networkx as nx
import io, sys
from collections import defaultdict, Counter
import numpy as np
from Bio.Seq import translate, reverse_complement, Seq
from Bio import SeqIO
from panaroo.cdhit import align_dna_cdhit
from panaroo.isvalid import del_dups
from joblib import Parallel, delayed
import os
import gffutils ... |
from __future__ import absolute_import, print_function, division
import os
import numpy as np
from glob import glob
import matplotlib
from matplotlib import pyplot as plt
import astropy.units as u
from astropy.constants import R_sun
from astropy.coordinates import SphericalRepresentation
from .lightcurve import LightC... |
# coding=utf-8
# Copyright 2021 The Google Research 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 applicab... |
'''
Created on 26 May 2013
@author: lukasz.forynski
@brief: Implementation of the multi-key dictionary.
https://github.com/formiaczek/python_data_structures
___________________________________
Copyright (c) 2014 <NAME> <<EMAIL>>
Permission is hereby granted, free of charge, to any person obtaining a c... |
# -*- coding: utf-8 -*-
"""
Created on Wed May 25 04:20:00 CEST 2016
@authors: <NAME>
@email: juancarlos.entizne01[at]estudiant.upf.edu
Modified by <NAME>
@email: juanluis.trincado[at].upf.edu
"""
import os
import sys
import math
import logging
import warnings
import numpy as np
import pandas as pd
from functools i... |
#!/usr/bin/env python3
# coding: utf-8
import argparse
import os.path as osp
import sys
import os
from apex.amp.handle import scale_loss
import torch.nn.parallel
import torch.backends.cudnn as cudnn
import torch.distributed as dist
import apex
from apex.parallel import DistributedDataParallel as DDP
from apex.fp16_u... |
import os
import sys
import copy
import glob
import contextlib
import tempfile
import shutil
import tarfile
import importlib
import platform
from collections import OrderedDict
from packaging.version import parse as parse_version
from .utils import make_import_name, get_name_version
from .get_versions import HttpListV... |
import logging
import tempfile
import shutil
import inspect
import re
from io import IOBase
from pathlib import Path
from importlib_resources import files
from datetime import datetime, timedelta
from typing import Sequence, Optional, Mapping
from .versions import VersionRaw, guess_version
from .meta import Meta, Me... |
from hashlib import sha256
from sys import version_info as pyVersion
from binascii import hexlify, unhexlify
import pickle
if pyVersion.major == 3:
# py3 constants and conversion functions
xrange = range
stringTypes = (str,)
intTypes = (int, float)
def toString(string):
return string... |
'''
BLURB GOES HERE.
Copyright (c) 2015 - 2021 Rob "N3X15" Nelson <<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 rights
to use, co... |
# -*- coding: utf-8 -*-
import os
import io
import string
import re
import sys
sys.path.append('./')
import itertools
from collections import OrderedDict
from nltk.tokenize import word_tokenize, sent_tokenize
import config
from slot_aligner.alignment.utils import find_first_in_list
from slot_aligner.alignment.boolean... |
"""
oct2py_test - Test value passing between python and Octave.
Known limitations
-----------------
* The following Numpy array types cannot be sent directly via a MAT file. The
float16/96/128 and complex192/256 can be recast as float64 and complex128.
** float16('e')
** float96('g')
** float128
... |
#TODO: TMP
# import sys
# sys.path.append('../')
# from dataops.colors import ycbcr_to_rgb, yuv_to_rgb
import os #, glob
import random
import numpy as np
import cv2
import torch
from torch.utils.data.dataset import Dataset
import dataops.common as util
from dataops.augmentations import Scale, NoisePatches, RandomNois... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Wed Aug 18 09:15:16 2021
For SAREQ; functions pulled from Gorner as needed
@author: theresasawi
"""
import h5py
import pandas as pd
import numpy as np
#from obspy import read
from matplotlib import pyplot as plt
import datetime as dtt
import datetime
f... |
# -*- coding: utf-8 -*-
"""
Synfit
======
This routine allows the user to automatically fit a spectral line or wavelength
region. Is is allowed any number of parameters.
The best fit is found by minimizing the chi^2. `Synfit` calculates the
synthetic spectrum for all values asked and then select the one with minimum
... |
# -*- coding: utf-8 -*-
# MySQL Connector/Python - MySQL driver written in Python.
# Copyright (c) 2014, 2017, Oracle and/or its affiliates. All rights reserved.
# MySQL Connector/Python is licensed under the terms of the GPLv2
# <http://www.gnu.org/licenses/old-licenses/gpl-2.0.html>, like most
# MySQL Connectors. Th... |
# Essentials
import numpy
import pandas
import datetime
import random
import time
# Plots
import seaborn
import matplotlib.pyplot as plt
# Models
from sklearn.ensemble import RandomForestRegressor, GradientBoostingRegressor, AdaBoostRegressor, BaggingRegressor
from sklearn.kernel_ridge import KernelRidge
from sklear... |
import json
import os.path
import sys
from pathlib import Path
from random import randint, sample
from matplotlib.cm import get_cmap
from matplotlib.colors import Normalize, rgb2hex
from scipy.spatial import distance
import igraph
import pygame
from env.simulators.game import Game
from env.obs_interfaces... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#------------------------------------------------------------------------------
__author__ = '<NAME>'
__contact__ = '<EMAIL>'
__copyright__ = '(c) <NAME>'
__license__ = 'MIT'
'''
This script performs fuzzy classification of river corridor features with a CNN. the script ... |
import os
from math import floor, ceil
from pprint import pprint
import csv
import argparse
import simuran
import pandas as pd
import matplotlib.pyplot as plt
import astropy.units as u
from neurochat.nc_lfp import NLfp
import numpy as np
from scipy.signal import coherence
from skm_pyutils.py_table import list_to_df, d... |
import errno
import json
import os
import sys
import zipfile
from datetime import datetime, timezone, timedelta
from dateutil import tz
def main():
[ipDirPath, opDirPath] = getInputOutputFileNames()
# Task 1
aggregateFilesAtDayLevel(ipDirPath=ipDirPath, opDirPath=opDirPath,
#... |
import os
from numpy import array,zeros
from generic import obj
from simulation import Simulation,SimulationAnalyzer
from vasp_input import VaspInput
from developer import DevBase
from debug import *
# vasp xml reader classes/functions
class VXML(DevBase):
basic_types = set('i v dimension field set time'.split(... |
# BSD 3 - Clause License
# Copyright(c) 2020, Zenotech
# 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 c... |
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... |
# -*- coding: utf-8 -*-
# Copyright 2019 Red Hat
# GNU General Public License v3.0+
# (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
import platform
import re
from ansible.module_utils.network.nxos.nxos import run_commands, get_config, get_capabilities
from ansible.module_utils.network.nxos.utils.utils imp... |
# Copyright 2018/2019 The RLgraph 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 appli... |
"""Methods for novelty detection.
--- REFERENCES ---
<NAME>., and <NAME>: "Interpretable discovery in large image data sets."
arXiv e-prints, 1806, https://arxiv.org/abs/1806.08340.
"""
import pickle
import numpy
from gewittergefahr.gg_utils import file_system_utils
from gewittergefahr.gg_utils import error_chec... |
"""
Designed to be used via portable-python CLI.
Can be used programmatically too, example usage:
from portable_python import BuildSetup
setup = BuildSetup("cpython:3.9.6")
setup.compile()
"""
import contextlib
import enum
import logging
import multiprocessing
import os
import re
from typing import List
... |
#!/usr/local/bin/python3
import sys
import re
import os
import copy
import pickle
if len(sys.argv) < 2:
sys.exit('./callMom.py <reference> <fasta>')
### CLASS DEFINITIONS
# Site variables: id, pos, end, ref, alt, len, out, vtype, maxlen
# create site class
class Site():
def __init__(self, a, b, c, d):
... |
"""Class managing a Stepmania "chart"
'Stepfiles' for Stepmania are organized into 'charts': lists of annotations for by an annotator for a song with some difficulty. Many charts can point to one song so we do not want to store song features for every chart. Instead, we have this helper class that will point to song f... |
"""
Generic helpers that are intended to be used across other modules etc...
"""
import fnmatch
import json
import logging
import os
import platform
import re
import shlex
import socket
import sys
from copy import deepcopy
import devlab_bench #pylint: disable=cyclic-import
from devlab_bench.exceptions import DevlabCo... |
import argparse
import random
import os
import time
import datetime
import numpy as np
import torch
from torch import nn, autograd, optim
from torch.nn import functional as F
from torch.utils import data
import torch.distributed as dist
from torchvision import transforms, utils
from model import Generat... |
# Copyright notice for dperf originally developed by <NAME>
# MIT License
#
# Copyright (c) 2016 <NAME> <EMAIL>
# send donations to bitcoin wallet 19Myzrm8wsoj2XYX8vYK6mq17TTkUy5uD1
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files ... |
from models.base import ImplicitSurface, NeRF, RadianceNet
from utils import rend_util, train_util
import copy
import functools
import numpy as np
from tqdm import tqdm
from typing import Optional
from collections import OrderedDict
import torch
import torch.nn as nn
import torch.nn.functional as F
# def pdf_phi_s(x... |
# -*- coding: utf-8 -*-
###########################################################################
## Python code generated with wxFormBuilder (version 3.9.0 Sep 19 2021)
## http://www.wxformbuilder.org/
##
## PLEASE DO *NOT* EDIT THIS FILE!
###########################################################################
... |
# Serpent Materials
#
# Material definitions using the same names and keys as "materials.py",
# but different definitions
import openmc
from collections import OrderedDict
def _add_nuclides(nucdict, material):
"""Add a dictionary of nuclides to a material using the 'sum' mode.
Parameters:
-----------
... |
import cv2
import sys
from PyQt5 import uic
import PyQt5.QtCore
from PyQt5.QtGui import *
from PyQt5.QtWidgets import *
import gtts
import playsound
import gaze_tracking
import time
import threading
import NewGallery
import pandas as pd
import dlib
import serial
import SendMessage
# 아두이노
try:
ard = serial.Serial('... |
from collections import namedtuple
import pathlib
from unittest import mock
import matplotlib.figure
import numpy as np
import pytest
from cabinetry import fit
from cabinetry import model_utils
from cabinetry import visualize
MockHistogram = namedtuple("MockHistogram", ["bins", "yields", "stdev"])
@pytest.mark.pa... |
# Twisted Imports
from twisted.internet import reactor, task, defer
from twisted.internet.protocol import Factory
from twisted.protocols.basic import LineReceiver
from twisted.python import log, failure
# System Imports
from collections import deque
from time import time as now
from math import floor
import logging
#... |
#!/usr/bin/env python
# PyOpenCV - A Python wrapper for OpenCV 2.x using Boost.Python and NumPy
# Copyright (c) 2009, <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 o... |
import flask
import time
from contextlib import closing
from flask_login import current_user
from werkzeug.exceptions import HTTPException
import gal_utils
from gal_utils import text
from PIL import Image
import os
import os.path
import traceback
import sys
S3_dir = u'https://glyphic.s3.amazonaws.com/cfa/gallery/'
Th... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Python implementation of Poincaré Embeddings [1]_, an embedding that is better at capturing latent hierarchical
information than traditional Euclidean embeddings. The method is described in more detail in [1].
The main use-case is to automatically learn hierarchical re... |
import os
import time
from os import path as osp
import numpy as np
import torch
import json
from tqdm import tqdm
import matplotlib.pyplot as plt
from scipy.interpolate import interp1d
from tensorboardX import SummaryWriter
from torch.utils.data import DataLoader
from data_glob_speed import *
from transformations i... |
import math
from typing import List, Sequence, Mapping
import torch
from nmtg import search
from nmtg.models.encoder_decoder import IncrementalDecoder, EncoderDecoderModel
class SequenceGenerator:
def __init__(self, models: List[EncoderDecoderModel], dictionary, batch_first=False,
beam_size=1, ... |
#
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not us... |
import tkinter as tk
from tkinter import ttk
from sqlalchemy import and_, or_
from tkcalendar import Calendar
from datetime import date, datetime
from base import session
from application import Application
from employee import Employee
from client import Client
from scrollable_frame import ScrollableFrame
class App... |
import re
import os
import random
import itertools
from io import open
import torch
import torch.nn as nn
from torch import optim
import torch.nn.functional as F
import jieba
USE_CUDA = torch.cuda.is_available()
device = torch.device("cuda" if USE_CUDA else "cpu")
# 准备数据
# 先读取数据,然后打印几行看看语料质量:
file_path = 'app/resour... |
# Copyright 2019 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
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... |
from __future__ import print_function
from math import pi
import torch
import torch.nn as nn
import torch.nn.parallel
import torch.utils.data
from torch.autograd import Variable
import numpy as np
import torch.nn.functional as F
import sys
import softpool as sp
sys.path.append("../expansion_penalty/")
import expansion_... |
# coding=utf-8
# Copyright 2021 RigL 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 agree... |
from operator import add, mul
import os
from PyQt4.Qt import QPushButton, SIGNAL, QTextEdit, QScrollArea, QTabWidget, \
QLineEdit, QAbstractTableModel, QModelIndex, Qt, QVariant, QTableView, QIcon,\
QDialogButtonBox, QGridLayout, QLabel, QComboBox, QMenu, QCursor, QListWidget,\
QListWidgetItem, QMessageBox, Q... |
from collections import defaultdict, deque
import sys
import math
from enum import Enum
import random
from typing import DefaultDict, List, Set, Tuple
from copy import copy, deepcopy
import time
NUMBER_OF_CELL = 37
richness_point = [0, 0, 2, 4]
grow_cost = [1, 3, 7]
sun_points = [0, 1, 2, 3]
board = []
def plog(s: st... |
# coding=utf-8
# Copyright 2018 The Google AI Language Team Authors and The HugginFace Inc. team.
# Copyright (c) 2018, 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... |
# Copyright 2019 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, ... |
"""
pyi_generator.py \
Wrapping/Generators/Python/itk-pkl/itkFixedArray.index.txt \
Wrapping/Generators/Python/itk-pkl/itkVector.index.txt
"""
import os
from os import remove
from argparse import ArgumentParser
from io import StringIO
from pathlib import Path, PurePath
import pickle
from typing import Union, List
... |
#!/usr/bin/env python
from __future__ import print_function
import skimage as skimage
from skimage import transform, color, exposure, io
from skimage.viewer import ImageViewer
import random
from random import choice
import numpy as np
from collections import deque
import time
import math
import os
import pandas as pd
... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Sample python script to work with S3 buckets and objects.
This package performs basic S3 operations.
"""
import argparse
import functools
import logging
import os
import pprint
import sys
import time
import boto3
import botocore
import tabulate
import tqdm
impor... |
import numpy as np
import cv2 as cv
# Create a black image
#img = np.ones((512,512,3), np.uint8)*128 # gray background
from sage.all import *
import numpy as np
import pandas,sys
import statsmodels.api as sm
#print(img)
# Draw a diagonal blue line with thickness of 5 px
#cv.line(img,(0,0),(511,511),(255,0,0),5)
# dr... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.