text stringlengths 3.07k 22.1k |
|---|
from collections import defaultdict
from fluiddb.data.exceptions import UnknownUserError
from fluiddb.data.namespace import Namespace, getNamespaces
from fluiddb.data.path import getParentPath, getPathHierarchy
from fluiddb.data.permission import (
Operation, getNamespacePermissions, getTagPermissions)
from fluidd... |
from __future__ import annotations
import datetime
from threading import Lock
from typing import Any, Union, Optional, Iterable, Dict, Tuple, Callable
from typing import TYPE_CHECKING
import ravendb.documents.commands.crud as commands_crud
from ravendb.tools.utils import Utils
if TYPE_CHECKING:
from ravendb.docu... |
# Copyright (c) 2022 PaddlePaddle Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appli... |
import vtkmodules.all as vtk
from tqdm import tqdm
from mesh_reader import MeshReader
import numpy as np
from matplotlib import cm
from matplotlib.colors import Normalize
from vtk_fmm import FMMDistance
import time
def create_line(point1, point2, color):
"""
Creates a line to connect vertices
:param point... |
"""The Nmap Tracker integration."""
from __future__ import annotations
import asyncio
import contextlib
from dataclasses import dataclass
from datetime import datetime, timedelta
import logging
import aiohttp
from getmac import get_mac_address
from mac_vendor_lookup import AsyncMacLookup
from nmap import PortScanner,... |
__author__ = 'SolarLune'
import math
from bge import logic
class _spritemap_base():
def __init__(self, obj):
"""
Creates a SpriteMap to animate an object by.
:param obj: KX_GameObject - Sprite object to perform operations on
:return: _spritemap_base
"""
self.o... |
# -*- coding: utf-8 -*-
import torch
import torch.nn as nn
import warnings
import torch.nn.functional as F
def _fuse_conv_bn(conv, bn):
"""Fuse conv and bn into one module.
Args:
conv (nn.Module): Conv to be fused.
bn (nn.Module): BN to be fused.
Returns:
nn.Module: Fused module.
... |
import numpy as np
import matplotlib.pyplot as plt
import matplotlib.ticker as mtick
from sweetviz import sv_math
from sweetviz import utils
from sweetviz.config import config
from sweetviz.sv_types import FeatureType, FeatureToProcess, OTHERS_GROUPED
import sweetviz.graph
from typing import List
def plot_grouped_ba... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# @Time : 2017/11/23 21:54
# @Author : 周星星 <NAME>
# @Site : https://github.com/simanchou
# @File : receiver.py
# @Description: 接收Alertmanager基于web_hook推送的告警内容,发送至微信公众号,实现微信告警。
# alertmanager中启用webhook设置如下:
# 或参考prometheus官网https://prometheus.io/docs/al... |
#-------------------------------------------------------------------------------
# Name: Plotting absorbance curves
# Purpose: Analysing experiments's results
#
# Author: <NAME>
#
# Created: 25/07/2018
# Copyright:
# Licence: CC BY-SA 4.0
#-----------------------------------------------------... |
import json
import os
from argparse import ArgumentParser
from collections import OrderedDict
import pandas as pd
import torch
import torch.optim as optim
from torch import nn
from torch.utils.data import DataLoader
from torch.utils.tensorboard import SummaryWriter
from torchvision import transforms, models
from xray... |
"""
Utility functions for pgrid.
"""
import numpy as np
import xarray as xr
import seawater as sw
from lo_tools import Lfun, zfun, zrfun
from lo_tools import plotting_functions as pfun
def simple_grid(aa, res):
dlat = aa[3] - aa[2]
dlon = aa[1] - aa[0]
mean_lat = np.mean(aa[2:])
earth_rad = zfun.earth... |
import math
import numpy as np
import pandas as pd
from PIL import Image, ImageOps
from pvlib.irradiance import erbs
from skimage.filters import threshold_otsu
def pano_to_fisheye(im):
"""
Description of pano_to_fisheye
Transforms an image from cylindrical view to azimuthal view as described in:
-... |
import itertools
import statistics
import time
from prettytable import PrettyTable
from locust import User
from locust.dispatch import UsersDispatcher
from locust.runners import WorkerNode
class User1(User):
weight = 5
class User2(User):
weight = 55
class User3(User):
weight = 37
class User4(User)... |
"""
A module for handling the listing and cleaning of /store/unmerged
"""
import os
import sqlite3
import shutil
import logging
from cmstoolbox.unmergedcleaner import listdeletable
from .. import config
from .. import datatypes
from .. import history
from .. import opts
from .. import remotelister
from .. import sum... |
# Copyright 2021 MosaicML. All Rights Reserved.
"""Utility for uploading to and downloading from cloud object stores."""
import dataclasses
import os
import sys
import textwrap
from typing import Any, Dict, Iterator, Optional, Union
import yahp as hp
from libcloud.storage.providers import get_driver
__all__ = ["Obje... |
#!/usr/bin/env python2
# coding: utf8
import re
import codecs
from sys import argv
from sys import stderr
import os
### Constants ###
result_bib=r"""@book{ cgal:eb-${CGAL_RELEASE_YEAR_ID}
, title = "{CGAL} User and Reference Manual"
, author = "{The CGAL Project}"
, publisher = "{CGAL Editorial Board... |
import sys
import os
import json
import csv
import datetime
from collections import OrderedDict
import jinja2
def get_json_by_file(path):
if os.path.isfile(path):
with open(path, 'r') as file:
return json.load(file)
return None
BASE_URL = 'https://evekatsu.github.io/data'
#BASE_URL = 'htt... |
"""Tools to translate iNaturalist observations and taxa into image metadata"""
# TODO: Get separate keywords for species, binomial, and trinomial
# TODO: Get common names for specified locale (requires using different endpoints)
# TODO: Handle observation with no taxon ID?
# TODO: Include eol:dataObject info (metadata ... |
#!/usr/bin/python
# -*- encoding: utf-8 -*-
'''
@Time : 2021/06/09 17:17:48
@Author : Camille
@Version : 1.0
'''
import os
import sys
sys.path.append(os.getcwd())
import json
import re
from scripts.windows import windows
from scripts.windows.journalist import BasicLogs
from scripts.prettyCode.prettyPrint im... |
import matplotlib
matplotlib.use('Agg')
import torch.utils.data as data
import torch
import torch.utils.data
import torchvision.transforms as transforms
import torchvision.datasets as datasets
from PIL import Image
import cv2
import numpy as np
import os
import os.path
import json
import random
import... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# 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/LICENSE-2.0
#
# Unless re... |
__all__ = ['common_files',
'_get_indexer',
'concatenate_dat',
'df_with_no_more_doubles',
'get_the_doubles',
'complete_deduplicate_and_save_articles',
'deduplicated_all_but_articles',
'you_got_OTPed',
'liste_de_validation',
... |
# -*- coding: utf-8; -*-
"""Simple client for the REPL server, with remote tab completion and Ctrl+C.
A second TCP connection on a different port is used as a control channel for
the remote tab completion and Ctrl+C requests.
**CAUTION**: The current client implementation is silly and over-complicated.
What we reall... |
import torch
import torch.nn as nn
import torch.nn.functional as F
from mmcv.runner import load_checkpoint
from mmedit.models.common import make_layer, pixel_unshuffle
from mmedit.models.registry import BACKBONES
from mmedit.utils import get_root_logger
def get_padding_functions(x, padding=7):
"""Generate paddin... |
#!/usr/bin/python
# Copyright (c) 2018, Oracle and/or its affiliates.
# This software is made available to you under the terms of the GPL 3.0 license or the Apache 2.0 license.
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
# Apache License v2.0
# See LICENSE.TXT for detail... |
# Copyright (C) 2019-2020, TomTom (http://tomtom.com).
#
# 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 o... |
import argparse
from itertools import combinations
import json
import matplotlib.pyplot as plt
import numpy as np
from typing import Dict, List, Tuple
import pandas as pd
# from scirex.metrics.clustering_metrics import match_predicted_clusters_to_gold
from scirex.commands.join_scirex_and_s2orc import S2OrcEntry, S2Me... |
#!/usr/bin/env python3
# Python script to build the music zip file
# ensure that `po4a po4a-booster-music.cfg` is run first which generates the translations
from __future__ import absolute_import
from __future__ import print_function
import os
import shutil
import sys
info_pages = "InfoPages"
music_release = "4"
buil... |
from RL.utils.util_fns import update_mean_std
import logging
import sys
from typing import List
import numpy as np
import RL
ids = 0
logger = logging.getLogger(__name__)
ldebug = logger.isEnabledFor(logging.DEBUG)
class Experience:
def __init__(self, state, action, reward, done, info, next_state, cost=0):
... |
# Copyright 2014-present PlatformIO <<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 agreed... |
"""
Stencil label classes and supporting functions.
"""
#***************************************************************************************************
# Copyright 2015, 2019 National Technology & Engineering Solutions of Sandia, LLC (NTESS).
# Under the terms of Contract DE-NA0003525 with NTESS, the U.S. Governme... |
"""
"whatrecord parse" is used to parse and interpret any of whatrecord's supported
file formats, dumping the results to the console (standard output) in JSON
format, by default.
"""
import argparse
import asyncio
import json
import logging
import pathlib
from typing import Dict, List, Optional, Union
import apischem... |
# Copyright 2013 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.
"""Utilities for performing pixel-by-pixel image comparision."""
import itertools
import StringIO
from PIL import Image
def _AreTheSameSize(images):
"""... |
"""
File to record saltswap simulation data with netcdf.
"""
from netCDF4 import Dataset
import numpy as np
import simtk
# The simulation parameters that will be recorded from Swapper.
swapper_control_attributes = ('temperature', 'pressure', 'delta_chem', 'npert')
# Establishing default units for recording data. The ... |
# Copyright (c) 2019 Horizon Robotics. 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 applicab... |
import os
import torch
from torch.autograd import Variable
from torch import optim
import torch.nn.functional as F
import torch.nn as nn
import numpy as np
import models
import argparse
import time
import math
parser = argparse.ArgumentParser(description='lm.py')
parser.add_argument('-save_model', default='lm',
... |
import os
import re
import locale
import sqlite3
import zipfile
import click
import arrow
from wtforms import Field
from jinja2 import Environment, StrictUndefined, FileSystemLoader
import ruamel.yaml
import IPython
from .app import create_app
from .submitter import sendmail
from .database import (
init_db, expor... |
from itertools import chain
from django import forms
from django.contrib.auth import authenticate
from django.contrib.auth.models import User
from django.forms import widgets
from django.forms.models import ModelChoiceIterator
from django.template import Template, Context
from django.utils.encoding import force_unicod... |
"""
Scipy version > 0.18 is needed, due to 'mode' option from scipy.misc.imread function
"""
import os
import glob
import h5py
import scipy.misc
import scipy.ndimage
import numpy as np
from functools import reduce
import tensorflow as tf
FLAGS = tf.app.flags.FLAGS
"""7-1-2 load h5"""
def read_data(path):
"""
R... |
import torch
import torch.nn as nn
import torch.nn.functional as F
from base.base_net import BaseNet
class Crack_Architecture_Autoencoder(BaseNet):
def __init__(self, rep_dim=64):
super().__init__()
self.rep_dim = rep_dim
self.speedup_mode = 2
self.encoder = Crack_Archi... |
import argparse
import logging
from typing import List, Union
from sourced.engine.engine import BlobsDataFrame, BlobsWithLanguageDataFrame
from pyspark import RDD, Row, StorageLevel
from pyspark.sql import DataFrame, functions
from sourced.ml.extractors.helpers import filter_kwargs
from sourced.ml.transformers.transf... |
#!/usr/bin/env python3
# coding: utf-8
from functools import *
import numpy as np
import matplotlib.pyplot as plt
import seaborn as sns
import cv2
import math
from Lab_MV_04_Interest_points import *
GAUSSIAN_ADD = 0
THRESHOLD = 10
def load_original_image()->np.ndarray:
return cv2.imread('Assignment_MV_1_image.p... |
# --------------------------------------------------------
# Copyright (c) 2021 Microsoft
# Licensed under The MIT License
# --------------------------------------------------------
import os
from yacs.config import CfgNode as CN
_C = CN()
_C.SEED = 123
_C.WORKERS = 8
_C.TRAINER = 'Trainer'
# task... |
from __future__ import division
import os
import sys
import numpy as np
sys.path.append(os.path.abspath(os.path.dirname(__file__)) + '/..')
import utils
def alignManhattan(gps):
class Edge:
def __init__(self, axis, p1):
self.axis = axis
self.points = [p1]
s... |
# https://github.com/ffancellu/NegNN
import common
from string import punctuation
import tree
import codecs
class _DataSetInventory(dict):
def __init__(self, inventory):
super(_DataSetInventory, self).__init__()
for dataset_info in inventory:
name, path = dataset_info
data... |
# MIT License: Copyright (c) 2021 <NAME>, <NAME>
from typing import Optional, Union, Type, List
import numpy as np
from scipy.special import log_softmax
from sklearn.base import BaseEstimator, DensityMixin, ClassifierMixin
from deeprob.spn.structure.leaf import Leaf, Bernoulli, Categorical
from deeprob.spn.learning.... |
import sys
import re
from collections import Counter
from collections import deque
from random import choice, randint
from textblob import TextBlob
FNV = 14695981039346656037
FNV_PRIME = 1099511628211
FNV_MAX = FNV**7
HSH_P = 211
def find_nearest(array, value):
"""Find closet value in array to 'value' param"""
... |
# -*- coding: utf-8 -*-
import codecs
import json
import os
import re
from HadithHouseApi import settings
from hadiths import initial_data
from hadiths.models import Book, Hadith, BookChapter, BookVolume, BookSection
from textprocessing.generic import reformat_text
from textprocessing.regex import DocScanner
def ge... |
import numpy as np
import threading
import logging
from pysvso.lib.log import LoggerAdaptor
_logger = logging.getLogger("mapblock")
from pysvso.py_pose_graph.frame import Frame
from pysvso.py_pose_graph.point3d import CameraPoint3D, WorldPoint3D
from pysvso.matcher import ROIMatcher
from pysvso.optimizers.bundle_adj... |
#%% Initialization
import sys
import cv2
import glob
import numpy as np
import time
import pickle
from sklearn.model_selection import train_test_split
from sklearn.preprocessing import StandardScaler
from sklearn.svm import LinearSVC
from my_util import print_section_header, determine_color_converter
from p05_02_featu... |
"""
-------------------------------------------------
Project: Sneaktime
Standard: 91906 (AS3.7)
School: Tauranga Boys' College
Author: <NAME>
Date: 05 OCT 2021
Python: 3.9.6
License: MIT
-------------------------------------------------
"""
import random
import pygame as pg
import invento... |
# -*- coding: utf-8 -*-
from sst_unittest import *
from sst_unittest_support import *
import os
import shutil
import fnmatch
import csv
################################################################################
# Code to support a single instance module initialize, must be called setUp method
module_init = 0
m... |
import asyncio
import concurrent.futures
import functools
import multiprocessing
import queue
import threading
from abc import ABC, abstractmethod
from collections.abc import Hashable
from datetime import datetime
from typing import Optional, Union, Dict
from ._streamer import MAX_THREADS
class Task:
# Objects o... |
import numpy as np
import json
import spacy
from collections import Counter
from typing import List, Iterator
nlp = spacy.load("en_core_web_sm")
# Segmenter function
def segmenter(input_texts: List[str]) -> List[List[str]]:
"""
Segment the input texts s.t. each input snippet is split into sentences.
:param... |
import numba as nb
import numpy as np
@nb.njit()
def get_local(positions, sequence, i):
"""
Get a local slice of positions and sequence around i
:param positions: The positions along the superhelical in floating index "units"
:param sequence: The sequence of the superhelical DNA
:param i: The posi... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# haystack.py
#
# Copyright 2013 <NAME> <<EMAIL>>
#
# 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 Foundation; either version 2 of the License, or
# (a... |
#
# uses example 15 of tutorials
#
import numpy
import platform
from numpy.testing import assert_equal, assert_almost_equal
import Shadow
from shadow4tests.compatibility.beam3 import Beam3
#
# shadow4
#
from shadow4.beam.beam import Beam
from shadow4.optical_surfaces.s4_toroid import S4Toroid
def create_start_files... |
#!/usr/bin/env python2
"""The main module that orchestrates everything"""
import json
import functools
import time
import sys
import os
from multiprocessing import Pool
from pyzabbix import ZabbixMetric, ZabbixSender
from pyzabbix.api import ZabbixAPIException
from pyzabbix_socketwrapper import PyZabbixPSKSocketWrapp... |
# -*- coding: utf-8 -*-
"""
Created on Thu Dec 27 17:28:34 2018
@author: Steve
"""
import warnings
class Compartment:
# members:
# size (float) - This value represents the size of the shape.
# Whether this is a volume or an area is determined by the compartments dimensionality.
# If... |
# Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License").
# You may not use this file except in compliance with the License.
# A copy of the License is located at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# or in the "license... |
"""
It's somewhat of a fool's errand to introduce a Python ORM in 2013, with
`SQLAlchemy`_ ascendant (`Django's ORM`_ not-withstanding). And yet here we
are. SQLAlchemy is mature and robust and full-featured. This makes it complex,
difficult to learn, and kind of scary. The ORM we introduce here is simpler: it
targets... |
"""
The local filesystem cache engine provides the simplest, no-fuss option for
setting up Blingalytics. It stores report caches in a file using SQLite, which
is included in Python.
While the ease of use is great, the SQLite solution presents a number of
limitations:
* *Poor concurrency support*. While you can have m... |
"""
Add on-ice players to a file by specifying filename and columns from which to infer time elapsed in game.
"""
import pandas as pd
from scrapenhl2.scrape import schedules, parse_toi, autoupdate, team_info, teams, players
from scrapenhl2.scrape import general_helpers as helpers
def add_players_to_file(filename, fo... |
# Copyright (c) 2018-2019, NVIDIA CORPORATION
# Copyright (c) 2017- Facebook, Inc
#
# 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 ... |
import ipaddress
import ssl
import asyncio
import socket
import sys
from aiocoap import interfaces, util, error
from aiocoap import COAP_PORT, Message
from aiocoap.transports import tcp
from aioquic.asyncio.protocol import QuicConnectionProtocol
from aioquic.quic.configuration import QuicConfiguration
from aioquic.qu... |
import caffe
import numpy as np
import copy
import random
import config
from batch_loader import BatchLoader
class DataLayer(caffe.Layer):
def setup(self, bottom, top):
param = eval(self.param_str)
self.batch = int(param['batch'])
self.net = param['net']
self.img_size = config.NET_I... |
import quaternion
import numpy as np
import math
import time
import random
from tqdm import tqdm
from datetime import datetime
from numba import jit
from harold import *
from PIL import Image
import scipy
from matplotlib import cm
import matplotlib.pyplot as plt
from numpy import linalg as LA
def h_pol(root, fpol... |
import requests
import datetime
import json
import time
import uuid
import os
import logging
from jwt import JWT
from models import dev_db
from peewee import (
CharField,
TextField,
DateTimeField,
BigIntegerField,
BooleanField,
IntegerField,
DecimalField,
IntegrityError,
Operation... |
# Copyright (C) 2021 <NAME>. All rights reserved.
import json
import os
import argparse
import urllib.request
import sys
import re
from glob import glob
MODEL_URL = "https://github.com/kaiidams/voice100/releases/download/0.0.2/ctc-20210319.tar.gz"
def replace_ext(files, fromext, toext):
return [re.sub(f'\\.{from... |
# Copyright (C) 27/11/19 <NAME>
# 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 Foundation, either version 3 of the License, or
# (at your option) any later version.
# This program is distributed in the h... |
# Taken from https://github.com/d-biswa/Symplectic-ODENet/blob/master/myenv/fa_acrobot.py
# Slight adaptations to tidy the code a bit (it could still do with a lot more tidying).
import numpy as np
from numpy import sin, cos
from gym import core, spaces
from gym.utils import seeding
from scipy.integrate import solve_... |
import os, sys
sys.path.append(os.path.dirname(os.path.dirname(os.path.dirname(os.path.realpath(__file__)))))
import argparse
import datetime
import json
import contextlib
from func_timeout import func_timeout, FunctionTimedOut
import multiprocessing
import numpy as np
import os
import random
import sys
import time
f... |
starting_year = 2019
study_publication = "rr" ## This needs to be the 2 characer shortcode of the study publication, currently the "Pure Worship" book
language_suffix = "_E" ## This needs to be the language suffix for your area e.g. _E = English, _T = Portuguese
study_publication_full = study_publication + language_su... |
import mrl
import gym
from mrl.replays.core.shared_buffer import SharedMemoryTrajectoryBuffer as Buffer
import numpy as np
import pickle
import os
from mrl.utils.misc import batch_block_diag
class OnlineHERBuffer(mrl.Module):
def __init__(
self,
module_name='replay_buffer'
):
"""
Buffer that... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*
import re
import datetime
BLOG_FILE = 'ChinaEtfs.txt'
WEIBO_FILE = 'chinaetfs_weibo.txt'
ALL_FILE = 'all_file.txt'
def update_weibo_time():
with open(WEIBO_FILE, 'r+', encoding='utf-8') as weibo:
weibo_content = weibo.read()
weibo.seek(... |
"""Signals - implementation of the Observer pattern."""
import asyncio
from collections import defaultdict
from functools import partial
from types import MethodType
from typing import (
Any,
Callable,
Iterable,
Mapping,
MutableSet,
Optional,
Set,
Tuple,
Type,
cast,
no_type_c... |
"""Coupling Measurement from Minimal Tune Separation."""
import sys as _sys
import os as _os
import time as _time
import logging as _log
import numpy as _np
from scipy.optimize import least_squares
import matplotlib.pyplot as _plt
import matplotlib.gridspec as _mpl_gs
from siriuspy.devices import PowerSupply, Tune
... |
# Copyright (c) 2014-2017 <NAME>
#
# 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.
#... |
import operator
from typing import List
import numpy as np
import scipy.sparse
import scipy.spatial.distance
import sklearn.metrics
from joblib import Parallel, delayed
from sklearn.base import BaseEstimator, ClusterMixin
from sklearn.utils.extmath import squared_norm, row_norms
from sklearn.utils import check_random_... |
import asyncio
import discord
import config_discordbot as cfg
import yfinance as yf
# pylint: disable=wrong-import-order,too-many-branches
from discordbot import gst_bot
from stocks.dark_pool_shorts.shorted import shorted_command
from stocks.dark_pool_shorts.ftd import ftd_command
from stocks.dark_pool_shorts.dpotc i... |
import math
import random
import cv2
import numpy as np
eTranslate = 0
eHomography = 1
def computeHomography(f1, f2, matches, A_out=None):
'''
Input:
f1 -- list of cv2.KeyPoint objects in the first image
f2 -- list of cv2.KeyPoint objects in the second image
matches -- list of cv2.DM... |
#
#
# Copyright (C) 2007, 2008, 2010 Google Inc.
# 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 con... |
import base64
import ctypes
import functools
import krb5_ctypes
__all__ = ['Context']
class Error(Exception):
def __init__(self, ctx_raw, code):
self.code = code
msg_c = krb5_ctypes.krb5_get_error_message(ctx_raw, code)
self.message = msg_c.value
krb5_ctypes.krb5_free_error_messag... |
import pgzrun
from random import randint
import math
TITLE = "Invasione dallo spazio"
WIDTH = 800
HEIGHT = 700
CENTRO_X = WIDTH / 2
CENTRO_Y = HEIGHT / 2
# Lista alieni
alieni = []
# Lista lasers
lasers = []
# Usata per gestire le mosse degli alieni
sequenza_mosse = 0
# contatore_mosse e ritardo_mossa usati per ritar... |
#IMAGE_FILENAME = '../data/Head1/MR000057.dcm'
#DATA = '../mri_data'
DATA = '../SE000000'
IMG_EXT = '.tif'
#DATA = '../mrbrain-8bit'
#IMAGE = 'mrbrain-8bit%03i.tif'
#DATA = '../ct_data'
#IMAGE = 'CThead.%i'
... |
"""Basic labware data state and store."""
from __future__ import annotations
import re
from collections import defaultdict
from dataclasses import dataclass, replace
from typing import Dict, List, Sequence
from opentrons_shared_data.deck.dev_types import DeckDefinitionV2, SlotDefV2
from opentrons_shared_data.labware.... |
import numpy as np
from scipy.ndimage import affine_transform
try: from numba import njit as jit
except: jit = None
# jit = None
def affine_jit(img, m, offset, output_shape=0, output=0, order=0, prefilter=0):
kr=m[0]; kc=m[1]; ofr=offset[0]; ofc=offset[1];
for r in range(output_shape[0]):
for c in rang... |
import sys, platform
import ctypes, ctypes.util
from ctypes import POINTER, c_double, c_int,byref
import numpy as np
#import sys
#sys.path.append("..")
#from pclines import run_mixtures
try:
mylib = ctypes.CDLL("./mex_files/alignments_fast.so")
except OSError:
print("Unable to load the system C library", ... |
from typing import Optional, Union, List, Tuple
import numpy as np
import gurobipy as grb
from utils import Multidict, get_angles, get_angle, callback_rerouter, get_array_greater_zero, calculate_times, is_debug_env
from solver import Solver
from database import Graph, AngularGraphSolution
class AngularGraphScanMakes... |
import datetime as dt
from functools import wraps
import logging
from bokeh.embed import components
from bokeh.layouts import gridplot
from bokeh.models import ColumnDataSource, Label, HoverTool
from bokeh.plotting import figure
from bokeh import palettes
import pandas as pd
import pytz
from solarforecastarbiter.pl... |
# -*- coding: utf-8 -*-
"""
Created on Mon Aug 19 13:47:01 2019
@author: abibeka
Read data from travel time files
"""
#0.0 Housekeeping. Clear variable space
from IPython import get_ipython #run magic commands
ipython = get_ipython()
ipython.magic("reset -f")
ipython = get_ipython()
import os
import pandas as pd
... |
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
# This file requires openssl 1.0.0 at least
import os
import random
import pexpect
import time
import sys
def init_dsa... |
# -*- coding: utf-8 -*-
"""
Spyder Editor
"""
#import os
import numpy as np
import matplotlib.pyplot as plt
import myio
import util
from itertools import cycle
from util import genFL
#os.chdir('E:/Code/FSB/score/')
#os.chdir('E:/Code/FSB/score/lr/10-100k/1000-0.1')
#os.chdir('E:/Code/FSB/score/mlp/10,15,1-100k/1000-... |
import numpy as np
from collections import defaultdict, Counter
import pickle
import string
import pprint
import torch
from torch.autograd import Variable
import re
PAD_TOKEN = '<pad>'
UNK_TOKEN = '<unk>'
ROOT_TOKEN = '<root>'
RANDOM_SEED = 1
def parse_conllu(filename, clean=True):
"""
Par... |
# Copyright (c) 2018, The Regents of the University of California
# 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, thi... |
# Copyright (C) 27/11/19 <NAME>
# 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 Foundation, either version 3 of the License, or
# (at your option) any later version.
# This program is distributed in the h... |
import discord
from discord.ext import commands
from discord.ext.commands.cooldowns import BucketType
from discord.ext.commands import bot, has_permissions, CheckFailure
import asyncio
import colorsys
import random
import platform
from discord import Game, Embed, Color, Status, ChannelType
from discord import ... |
# Copyright 2022 <NAME>
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
# http://www.apache.org/licenses/LICENSE-2.0
# Unless required by applicable law or agreed to in... |
from typing import Tuple, Iterator, Sequence, Union, Any
from pyimath.polynomial import Polynomial, symbolic_polynomial
from pyimath.integer import IntegerRing
from pyimath.functions import power
__all__ = ['GaussianIntegerRing', 'GaussInt']
class GaussianIntegerRing:
"""Set of numbers of the form `x + i*y` w... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.