text stringlengths 3.07k 22.1k |
|---|
#!/usr/bin/python -tt
# Project: pandas_neteng
# Filename: arp_interrogate
# claudia
# PyCharm
# from __future__ import absolute_import, division, print_function
__author__ = "<NAME> (<EMAIL>)"
__version__ = ": 1.0 $"
__date__ = "2019-12-24"
__copyright__ = "Copyright (c) 2018 Claudia"
__license__ = "Python"
import ... |
#--------------------------------
# Name: tcorr_rt_test.py
# Purpose: Test for differences in Tcorr from real-time and Collection 1
#--------------------------------
import argparse
from builtins import input
import datetime
import logging
import os
import pprint
import sys
import ee
import pandas as pd
... |
# asynchat example adapted from here:
# http://www.grantjenks.com/wiki/random/python_asynchat_chat_example
import asynchat
import asyncore
import socket
import re
from props import getNode
#import commands
class ChatHandler(asynchat.async_chat):
def __init__(self, sock):
asynchat.async_chat.__init__(s... |
""" Sudoku solver that uses graph coloring to solve boards. """
__author__ = '<NAME>'
class Vertex:
""" A vertex in a graph, with atributes to be used for sudoku solving. """
def __init__(self, x, y):
self.coord = (x, y)
self.neighbors = []
self.number = 0
self.number_options ... |
import os.path
import time
import pandas as pd
import numpy as np
#Parameters
# name of model. Used for saving conventions
name = 'recsys' # 'imusic'
# set sise of data (number of samples). If None (suggested), full datasets are applied.
limit = None
# how often would you like to check results?
show_every_n_batches... |
import os
import argparse
import pandas as pd
import numpy as np
from sklearn.model_selection import train_test_split
from keras.preprocessing import text, sequence
import torch
import torch.nn.functional as F
from torch.utils.data import DataLoader, Dataset
from tqdm import tqdm
from lstm import LSTMClassifier
from ... |
import cv2
from matplotlib import pyplot
import math
import numpy as np
from itertools import combinations
def cv_imread(file_path):
cv_img = cv2.imdecode(np.fromfile(file_path, dtype=np.uint8), -1)
return cv_img
def len_points(p1, p2): # 計算兩點長度
length = math.sqrt(((p1[0] - p2[0]) ** 2) + ((p1[1] - p2[... |
# -*- coding: utf-8 -*-
"""
Created on Wed Dec 2 15:31:25 2020
@author: cheritie
"""
import numpy as np
import skimage.transform as sk
import ctypes
import time
from astropy.io import fits as pfits
from joblib import Parallel, delayed
from AO_modules.MisRegistration import MisRegistration
from AO_mod... |
import dask as da
from raptor.utils import BaseIndicator, _ema, _sma, _get_min_or_max
class AroonIndicator(BaseIndicator):
def __init__(self, close: da.Series, window: int = 25, fillna: bool = False):
self._close = close
self._window = window
self._fillna = fillna
self._run()
... |
import typing
import uuid
from .instructions import CHIP_OP_TEQ, CHIP_OP_TGT, CHIP_OP_TLT, CHIP_OP_TCP, CHIP_OP_JMP
from .parse import Instruction
from .errors import IssueLog
from . import log
UNCONDITIONAL = None
TRUE_CONDITIONAL = '+'
FALSE_CONDITIONAL = '-'
class IntermediateNode(object):
def __init__(se... |
from collections import defaultdict
import json
import warnings
import numpy
from django.core.cache import CacheKeyWarning
from django.test import TestCase, override_settings
from matrixstore.tests.data_factory import DataFactory
from matrixstore.tests.matrixstore_factory import (
patch_global_matrixstore,
m... |
# --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------... |
import sys
import wx
import os
from my_controller import Controller
from my_correction_pars_menu import CorrectionParsMenu
from my_other_sets_menu import OtherSetsMenu
from my_xml_settings_handler import writeSettingsToXML
__VERSION__ = '1.4'
class MainFrame(wx.Frame):
def __init__(self, dtaRefineryDir... |
""" Common functions for package api """
import os
import json
import requests
import urllib.request
from pathlib import Path, PurePath
from biobb_common.tools import file_utils as fu
def check_output_path(path, argument, optional, out_log, classname):
""" Checks output file """
if optional and not path:
... |
#!/usr/bin/env python
import os
import sys
import logging
import defbuild.commands as commands
logging.basicConfig(level=logging.INFO, format="%(levelname)s: %(message)s")
if not sys.version_info >= (3, 3):
logging.error("Python version needs to be of 3.3 or higher")
sys.exit(1)
import shutil
import configpa... |
from collections import namedtuple
from typing import Dict, Set, Tuple
from discord import Guild
from discord.ext.commands import Bot
# These objects are declared as namedtuples because tuples are hashable,
# something that we make use of when diffing site roles against guild roles.
Role = namedtuple('Role', ('id', '... |
"""
20JUN2018 - cs beacon config decoder
By <NAME> (@sysopfb) and <NAME>
Free to use, attribute properly.
Will attempt to work on beacons from memory with already decoded configs as well
TODO
Add logic for other XOR keys
Transform parsing code needs work as well
"""
import sys
import re
import binascii
import struc... |
from typing import Tuple
import discord
import logging
import utils
import cfg
from commands.base import Cmd
log = logging.getLogger(__name__)
help_text = """I can keep track of availabilities for you. This is usefull for \
finding available dates for matches.
Use no parameters to get the availabilities for the last... |
from carpool import db
from werkzeug.security import generate_password_hash, check_password_hash
from flask_login import UserMixin
from carpool import login_manager
from string import punctuation
from pytz import timezone, utc
from datetime import datetime, timedelta
import calendar
# check these fields with either c... |
import tensorflow as tf
tf.set_random_seed(777)
def batch_normalize(x, eps=1e-5):
return tf.layers.batch_normalization(x,
momentum=0.9,
epsilon=eps,
scale=True,
... |
from fastapi import FastAPI, File
from pydantic import BaseModel
import json
import httpx
import asyncio
import concurrent.futures
from os import getenv
from google.cloud import vision
import boto3
from botocore.exceptions import ClientError
from tccloud import TCClient
from tccloud.models import AtomicInput, FutureRe... |
from typing import Optional, Type, Union, Any, Dict, cast, Tuple, get_type_hints, List
from datetime import datetime
from dataclasses import fields
from uuid import UUID
from enum import Enum
import warnings
from dateutil.parser import parse
try:
from valico import validate as schema_validate
except ImportError:
... |
import re
from collections import Counter
from math import log, asin, sin, cos, pi
from pprint import pprint
from datetime import datetime
from itertools import cycle, islice
import graphx.lib.graphx as gx
def build_word_count_graph(input_stream, text_column='text', count_column='count'):
delimiters = [
... |
def get_default_fitkwargs(dataset=None):
return {'d': 10, 'n_iters': 1000, 'max_n': 3000, 'batch_size': 100, 'lr': 1e-2, 'stop_iters':50, 'norm': True, 'ybar_bias': True}
#=====================================For things implemented in DJKP
import pandas as pd
import numpy as np
import os
import ipdb
from sklearn.m... |
"""Data processing routines for MongoDB version
"""
import datetime
# import shutil
import pathlib
from pymongo import MongoClient
from pymongo.collection import Collection
cl = MongoClient()
db = cl.doctree_database
# support for older pymongo versions
try:
test = Collection.update_one
except AttributeError:
#... |
#!/usr/bin/env python
# pylint: disable=C0111
import itertools
import json
import os
import re
from pathlib import Path
from typing import AnyStr, Callable, List, Match, Pattern, Sequence, Set, Tuple, Union
# NB: replacement matching groups should be in the \1 format instead of $1
from ltpylib import strings
def con... |
# -*- coding: utf-8 -*-
# python-holidays
# ---------------
# A fast, efficient Python library for generating country, province and state
# specific sets of holidays on the fly. It aims to make determining whether a
# specific date is a holiday as fast and flexible as possible.
#
# Author: ryanss <<EMAIL>> (c) ... |
import os
import pytest
import shutil
from typing import (
Dict,
List,
)
import artm
from ..cooking_machine.dataset import Dataset
from ..cooking_machine.experiment import Experiment
from ..cooking_machine.models.base_score import BaseScore
from ..cooking_machine.models.topic_model import TopicModel
_MAIN_M... |
# Written by: <NAME>, @dataoutsider
# Viz: "Geo Path", enjoy!
import pandas as pd
import os
import math
pd.options.mode.chained_assignment = None
#region Functions
def delta_latitude(miles):
earth_radius = 3958.8
radians_to_degrees = 180.0/math.pi
return (miles/earth_radius)*radians_to_degrees
def delta_... |
# -*- coding: utf-8 -*-
from . import database
from . import sitecfg
from . import sleeper
from . import loot_prices
class WHSignatureWave:
def __init__(self, sig_id: int):
self.sig_id = sig_id
self.wave_id = 0
self.is_capital = False
self.sleepers_str = ''
self.sleeper_id... |
"The only valid example formats accepted by the framework"
import collections
import numpy as np
import tensorflow as tf
import farmhash
CONTENT_KEY = "content"
TARGET_KEY = "target"
PreProcessedTextLine = collections.namedtuple(
"PreProcessedTextLine", ["id", "content", "target", "offset_start", "offset_end"]... |
import pandas as pd
import os
import matplotlib.pyplot as plt
import random
import numpy as np
def countChannelsInBarcodeList(path_to_decoded_genes: str):
'''
This function focuses on all stats that are purely based on how many times a certain channel was called, in what round.
This can be useful in debugg... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# (c) The James Hutton Institute 2019
# (c) The University of Strathclude 2019
# Author: <NAME>
#
# Contact:
# <EMAIL>
#
# <NAME>,
# Strathclyde Institute of Pharmaceutical and Biomedical Sciences
# The University of Strathclyde
# Cathedral Street
# Glasgow
# G1 1XQ
# Sco... |
import requests
import click
import configparser
import os
import re
from flask import Flask
from flask import render_template
from flask import request as flask_request
g_args = None
app = Flask(__name__)
"""
.. moduleauthor:: <NAME> <<EMAIL>>
:synopsis: Process GitHub issues and label them based on user-def... |
"""
This module provides access to the ECG signal, and to the wavelet-transform of
the signal used for feature detection.
"""
import numpy
import kardioml.segmentation.teijeiro.acquisition.segmentation.wavelets.wavelet_filter as wf
from collections import OrderedDict
class Leads:
"""This enum-like class defines ... |
import gzip
import json
from os import path, walk
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
from tqdm import tqdm
from yaspin import yaspin
from yaspin.spinners import Spinners
from ..datafeatures.extractor import CMSRecordTest0
from ..datafile.json import JSONDataFileReader
from .utils i... |
import numpy as np
import nn_closed_loop.dynamics as dynamics
import nn_closed_loop.analyzers as analyzers
import nn_closed_loop.constraints as constraints
from nn_closed_loop.utils.nn import load_controller
from nn_closed_loop.utils.utils import range_to_polytope
import os
import argparse
def main(args):
np.rand... |
class Card:
""" A single card """
order = {"2": 2, "3": 3, "4": 4, "5": 5, "6": 6, "7": 7, "8": 8, "9": 9,
"T": 10, "J": 11, "Q": 12, "K": 13, "A": 14}
def __init__(self, cardStr):
self.rank = cardStr[0].upper()
self.suit = cardStr[1].upper()
self.ordering = self.order... |
#!/usr/bin/env python3
# Copyright 2020-present NAVER Corp. Under BSD 3-clause license
import argparse
import logging
import os
import pathlib
from typing import List, Optional
import path_to_kapture_localization # noqa: F401
import kapture_localization.utils.path_to_kapture # noqa: F401
import kapture
import kaptu... |
#-----------------------------------------------------------------------------
# Title : PyRogue base module - Virtual Classes
#-----------------------------------------------------------------------------
# This file is part of the rogue software platform. It is subject to
# the license terms in the LICENSE.txt f... |
import os.path as osp
import random
import torch
from core.utils.zoom_utils import deepim_boxes, batch_crop_resize
from core.utils.camera_geometry import bboxes_from_pose, centers_2d_from_pose, get_K_crop_resize
from .engine_utils import boxes_to_masks, _empty, get_input_dim, _normalize_image
def batch_data_test(cfg... |
from json import loads
from urllib import parse as urlparse
from django.conf import settings
from django.contrib import messages
from django.contrib.auth import REDIRECT_FIELD_NAME, login, logout
from django.contrib.auth import get_user_model
from django.contrib.auth.forms import AuthenticationForm
from django.shortcu... |
import os
import argparse
import multiprocessing
import numpy as np
import time
import ECAgent.Environments as env
from Agents import *
from datetime import datetime
from VegetationModel import *
from Logging import ILoggable
from Progress import progress
# Default Decoder file path
default_path = './resources/tra... |
import os
from models.models2D import ResNet, Densenet2D, FeatureExtractorResNet, FeatureExtractorResNextTempPool
# from models.anomaly_detector import AnomalyDetector
from dataset import VioDB, ProtestDatasetEval, OneVideoFolderDataset
from torch.utils.data import DataLoader
import tqdm
import pandas as pd
import num... |
'''
This file is a part of the official implementation of
1) "DISCO: accurate Discrete Scale Convolutions"
by <NAME>, <NAME>, <NAME>, BMVC 2021
arxiv: https://arxiv.org/abs/2106.02733
2) "How to Transform Kernels for Scale-Convolutions"
by <NAME>, <NAME>, <NAME>, ICCV VIPriors 2021
pdf: https://openacc... |
#pos feature: create a group of fix length array (30) fill with spacy pos vector
#entity feature: same as pos then sum the two array
#mean similarity score of headlines with each sentence in the text
#demonstrative pronoun: this that these those
#Personal pronoun: I, we, you, he, she, they, me, us, you, him, her, t... |
from kivy.uix.screenmanager import ScreenManager, Screen, FadeTransition
import numpy as np
from kivy.app import App
from kivy.garden.graph import MeshLinePlot
from kivy.clock import Clock
from collections import namedtuple
import serial
import os
import datetime
from functools import partial
import concurrent.futures
... |
import os
import glob
import numpy as np
import logging
# import modules required for reading through layered zip directories
import zipfile, re
# import image and other utility functions
import utils
import config.system as sys_config
logging.basicConfig(level=logging.INFO, format='%(asctime)s %(message)s')
# ======... |
"""
Arm Controller Module
This module contains classes to communication with the board and basic inverse kinematics.
https://github.com/tomash1234/robot-arm-filler
"""
import socket
import numpy as np
from kinematics import Kinematics
""" Servo motors indexes """
SERVO_BASE = 0
SERVO_SHOULDER = 1
SERVO_ELB... |
import gzip
import os
import colorsys
import matplotlib.cm as cm
import matplotlib.colors as colors
import matplotlib.pyplot as plt
import numpy as np
import pylab
import scipy.cluster.hierarchy as sch
import seaborn as sns
from matplotlib.offsetbox import OffsetImage, AnnotationBbox
from matplotlib.ticker import MaxN... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import pytest
from datetime import datetime, timedelta, timezone
from geojson import Point
from pyngsi.ngsi import DataModel, NgsiException, unescape, ONE_WEEK
def test_create():
m = DataModel("id", "type")
assert m["id"] == "id"
assert m["type"] == "type"... |
from subprocess import check_output
from string import ascii_uppercase, digits
from random import SystemRandom
import psutil
import shutil
import requests
from django.conf import settings
class DHost(object):
@classmethod
def disk_size(self):
x = shutil.disk_usage('/')
return format(x.total / ... |
import autograd.numpy as np
import autograd.scipy as scipy
from .bbox import Box
from .component import Component
from .parameter import Parameter
from .fft import Fourier
from .observation import Observation
def moffat(y, x, alpha=4.7, beta=1.5, bbox=None):
"""Symmetric 2D Moffat function
.. math::
... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright © 2007, 2008 <NAME> <<EMAIL>>
#
# This file is part of the Bobcat program.
#
# Bobcat is free software; you can redistribute it and/or modify it under
# the terms of the MIT licence:
#
# Permission is hereby granted, free of charge, to any perso... |
import pickle
from collections import defaultdict, Counter
import numpy as np
import torch
from scipy.special import softmax
from scipy.stats import entropy
from sklearn.cross_decomposition import PLSRegression
from sklearn.linear_model import SGDClassifier, Ridge
from torch.nn.functional import kl_div
from tqdm impor... |
import copy
import numpy as np
import math
from scipy.spatial.distance import euclidean, cdist
from scipy import ndimage as nd
from osgeo import ogr, gdal, gdal_array
import pyproj
from pyproj import CRS
from pyproj.crs import CRSError
from ..logging import log, warn, debug, error
from ..constants import DEFAULT_PROJEC... |
#!/usr/bin/env python3
# -*- coding: utf8 -*-
import argparse
import os
import sys
import numpy as np
import modules.segmentation_points as segment
import modules.preprocessed_plotter
from modules.constants import accelerometer_string, gyroscope_string
from modules.preprocessed_data_set import PreprocessedDataSet
fr... |
#!/usr/bin/env python
'''
tmpfs.py - Example file system for python-llfuse.
This file system stores all data in memory.
Copyright (C) <NAME> <<EMAIL>>
This file is part of python-llfuse (http://python-llfuse.googlecode.com).
python-llfuse can be distributed under the terms of the GNU LGPL.
'''
from __future__ impo... |
"""copy of the original networks"""
import os
import torch
import torch.nn as nn
import torch.optim as optim
import torch.nn.functional as functional
from torch.autograd import Variable
from torch.nn.utils import clip_grad_norm
# Inference with SVR
import pickle
from utils.parameter_initialization import xavier_nor... |
"""
:mod:`grid` -- read, write and sample ascii grid files
======================================================
Provide functions to read, write and sample ascii grid files. The
ascii files are assumend to have and ArcGIS GIRD format::
ncols nx
nrows ny
xllcorner xll
yllcorner yl... |
import logging
import os
import sys
import traceback
import waitress
import yaml
from docopt import docopt
from flask import Flask, Response, jsonify, make_response, request
from inflection import camelize, underscore
from setproctitle import setproctitle
__all__ = ['Service']
DEFAULT_PORT = '8080'
DEFAULT_ARG_TYPE ... |
#!/usr/bin/env python3
# ELEGATO STREAM DECK - XPLANEL by Simfender
#
# Thanks to pyXPUDPServer and Python Stream Deck libraries
import json
import os
import struct
import sys
import asyncio
import time
from PIL import Image, ImageDraw, ImageFont
from StreamDeck.DeviceManager import DeviceManager... |
import torch
from torch.nn import Sigmoid
from transformers.modeling_bert import BertModelWithHeads
import pytorch_lightning as pl
from pytorch_lightning.metrics import Metric
import numpy as np
from torch.nn.modules.loss import BCELoss, BCEWithLogitsLoss
from pytorch_lightning.callbacks.early_stopping import EarlyStop... |
"""Finetune Ner Task
train:
-------------------------------------------
python finetune_ner.py --train \
--model_name albert \
--pretrained_path ../configs/albert/ \
--task_name chinadaily \
--max_seq_len 128
test:
-------------------------------------------
python finetune_ner.py --test \
--model... |
"""
Retrain the YOLO model for your own dataset.
"""
import os
import numpy as np
import keras.backend as K
from keras.layers import Input, Lambda
from keras.models import load_model, Model
from keras.callbacks import TensorBoard, ModelCheckpoint, EarlyStopping
from keras import optimizers
from yolo3.model import pre... |
import json
from django.conf import settings
from django.core.cache import cache
from django.utils import timezone
from django.utils.translation import ugettext_lazy as _
from django.views import generic
from golf import models as golf_models
from . import forms
from . import viewmixins
class SampleView(viewmixins.... |
#!/usr/bin/env python3
import json
import os
import sys
from datetime import datetime
from pathlib import Path
from typing import Any, List, Optional, Tuple, Union
import click
import requests
from click.core import Option
from dateutil.parser import parse as parse_time_str
from dotenv import load_dotenv
load_dotenv... |
# Copyright 2017-2021 Sanofi and EPAM Systems, Inc. (https://www.epam.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 requir... |
import cv2
import numpy as np
import matplotlib.pyplot as plt
from CV20_lab1_Part2 import cv20_lab1_part2_utils as ut
#---------------------------------------------------------- GENERAL -----------------------------------------------------------
def GaussianKernel(sigma=2):
n = int((np.ceil(3*sigma) * 2 + 1))
... |
''' Tools for scraping text from the internet. '''
import functools
from urllib.request import build_opener, URLError
from nlplib.general.represent import pretty_truncate, pretty_string
from nlplib.general.thread import simultaneously
from nlplib.core.base import Base
from nlplib.core.exc import NLPLibError
__all_... |
import pygame
import os
import random
# Sprites from https://opengameart.org/content/animated-snake provided by Calciumtrice
pygame.init()
# Screen dimensions i2c screen
SCREEN_HEIGHT = 64 #600
SCREEN_WIDTH = 128 #1100
SCREEN = pygame.display.set_mode((SCREEN_WIDTH, SCREEN_HEIGHT))
RUNNING = [pygame.image.load(o... |
class Operation(Enum):
"""Enumeration for read vs write."""
READ = 0
WRITE = 1
class Metadata:
"""Documentation metadata for register files, registers, and fields."""
def __init__(self, mnemonic=None, name=None, brief=None, doc=None):
"""Constructs a new metadata object.
- `mn... |
# coding: utf-8
from __future__ import unicode_literals
import re
from .common import InfoExtractor
from ..utils import (
js_to_json,
smuggle_url,
)
class CBCIE(InfoExtractor):
_VALID_URL = r'https?://(?:www\.)?cbc\.ca/(?!player/)(?:[^/]+/)+(?P<id>[^/?#]+)'
_TESTS = [{
# with mediaId
... |
import torch
import numpy as np
import time
import gym
import pickle
import math
import sys
sys.path.append("../../")
from popsan_drl.popsan_td3.replay_buffer_norm import ReplayBuffer
from popsan_drl.popsan_td3.popsan import PopSpikeActor
from loihi_realization.popsan_loihi import SpikingActorNet
from loihi_realizatio... |
import my_py_lib.coord_tool as coord_tool
import numpy as np
import my_py_lib.im_tool as im_tool
import cv2
from config import a_config as cfg
def _get_iou(box, boxes):
box_area = (box[2] - box[0]) * (box[3] - box[1])
area = (boxes[:, 2] - boxes[:, 0]) * (boxes[:, 3] - boxes[:, 1])
xx1 = np.maximum(box[0]... |
import telebot
import datetime
import os
import telegram
from flask import Flask, request
from random import randint
import codecs
TOKEN = ':'
bot = telebot.TeleBot(TOKEN)
COMPLIMENTS = ["лучший", "ТОП", "ТОПЧИК", "огонь", "красавчик", "мыло", "ЛОСК", "классный", "садись на бутылку", "шутник"]
NAMES = ["Миша", "Бодя"... |
from django.contrib import messages
from django.contrib import admin
from django.contrib.gis import admin as geo_admin
from django.utils.safestring import mark_safe
# from .filters import CollectionAgencyNameFilter, CollectionCountyFilter, \
# CountyDropdownFilter
from .forms import CollectionFootprintForm, Collec... |
import tracery
from tracery.modifiers import base_english
import pandas as pd
from pandas import isnull, to_datetime
import time
import inflect
p = inflect.engine()
def ordinal(text, *params):
return p.ordinal(text)
def number_to_words(text, *params):
kwargs=dict(param.split('=') for param in params)
tr... |
#!/usr/bin/env python
# Copyright (c) 2012, <NAME>
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list... |
import numpy as np
import xarray as xr
import itertools
import collections
from collections import OrderedDict
from functools import partial
from sklearn.metrics._base import _average_binary_score
from sklearn.utils.multiclass import type_of_target
from scipy.ndimage import gaussian_filter
from sklearn.metrics impor... |
import enum
from matplotlib.collections import LineCollection, PolyCollection
from scipy.spatial import Voronoi, Delaunay, voronoi_plot_2d, delaunay_plot_2d
import matplotlib.pyplot as plt
import numpy as np
import matplotlib as mpl
import matplotlib.cm as cm
from collections import defaultdict
import sys
eps = sys.fl... |
"""Tests for Validation.py."""
from contextlib import contextmanager
from os import remove
from os.path import abspath, dirname, join as joinpath
import yaml
from pytest import raises as assert_raises
from ..tango.validation import Validator
PATH_TO_TEST_RES = joinpath(dirname(__file__), "validation_test_res")
def... |
import os
import cv2
import sys
import time
import platform
import logging
import numpy as np
from multiprocessing import Queue as pQueue
from threading import Thread
from queue import Queue, LifoQueue
logger = logging.getLogger('debug')
class DetectionLoader:
def __init__(self, model, streams):
self.mode... |
import base64
import datetime
import os
from io import BytesIO
from django import forms
from django.http import HttpResponse
from django.urls import reverse
from django.views.generic import TemplateView
from django_menus.menu import MenuMixin
from openpyxl import Workbook
from show_src_code.view_mixins import DemoView... |
import shm
import ring
import numpy as np
import time
import logging
import logzero
import os.path
from logzero import logger
import saveStyle
import zmqLock
logzero.loglevel(logging.INFO)
class Buffer(object):
def __init__(self, buffer_number= -1, size=100):
# create = False
# try:
# ... |
import numpy as np
import torch
import torch.nn as nn
import torch.nn.functional as F
import math, copy
from torch.autograd import Variable
#from utils import *
import torch
import torch.nn as nn
import numpy as np
import torch
np.random.seed(1337)
torch.manual_seed(1337)
torch.backends.cudnn.deterministic = True
tor... |
import rclpy
from rclpy.node import Node
import cv2 as cv
from geometry_msgs.msg import Twist
from cvzone.HandTrackingModule import HandDetector
from xgboost import XGBClassifier
import time
import math
class BasicPublisher(Node):
def __init__(self):
super().__init__('basic_publisher')
self.mo... |
from datetime import datetime
import pickle
from threading import Thread
from time import sleep, time
from tkinter import simpledialog, messagebox
import serial # Listado como pyserial em requirements.txt
from serial.tools import list_ports
from simple_pid import PID
import constants as std
experiments = []
experi... |
import os
import urllib
from flask import Flask, abort, request, jsonify, g, url_for
from flask_sqlalchemy import SQLAlchemy
from flask_httpauth import HTTPBasicAuth
from passlib.apps import custom_app_context as pwd_context
from itsdangerous import (TimedJSONWebSignatureSerializer
as Seriali... |
import boto3
import time
from sagemaker.lineage.context import Context
from sagemaker.lineage.action import Action
from sagemaker.lineage.association import Association
from sagemaker.lineage.artifact import Artifact
def delete_project_resources(sagemaker_boto_client, sagemaker_session, endpoint_names=None, pipeline_... |
#!/usr/bin/env python
import os
import glob
import pandas as pd
from collections import OrderedDict
from reframed import Environment
from .smetana import mip_score, mro_score, sc_score, mp_score, mu_score, minimal_environment
from random import sample
from reframed.io.cache import ModelCache
from smetana.legacy import... |
"""
Project for Week 2 of "Python Data Visualization".
Read World Bank GDP data and create some basic XY plots.
Be sure to read the project description page for further information
about the expected behavior of the program.
@author: salimt
"""
import csv
import pygal
def read_csv_as_nested_dict(filename, keyfield... |
from django.forms.widgets import HiddenInput
from django.shortcuts import render,redirect
from django.contrib.auth import login
from ngo.decorators import unauthenticated_user
from django.contrib import messages
from django.http import request
from django.views import generic
from django.core.exceptions import ObjectDo... |
# Libraries
import random
from math import pi
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
COLOR = ['#B6BFF2', '#04C4D9', '#F2C12E', '#F26363', '#BF7E04', '#7F2F56', '#E8B9B5', '#63CAF3', '#F27405', '#68BD44']
MARKER = ['D', '^', 'o', 'H', '+', 'x', 's', 'p', '*', '3']
def cross_methods_pl... |
"""empty message
Revision ID: 55bac00887c7
Revises: b073627deba3
Create Date: 2021-11-29 20:34:22.835138
"""
import pandas as pd
from alembic import op
import sqlalchemy as sa
from sqlalchemy.dialects import postgresql
# revision identifiers, used by Alembic.
revision = '55bac00887c7'
down_revision = 'b073627deba3'
... |
import pygame as pyg
import numpy as np
from util import *
ORIGIN_L = [50, 300]
ORIGIN_R = [850, 760]
def pt_l(p):
point = np.array(p).astype(int)
return (ORIGIN_L[0] + point[0], ORIGIN_L[1] - point[1])
def pt_r(p):
point = np.array(p).astype(int)
return (ORIGIN_R[0] + point[0], ORIGIN_R[1] - point[... |
import socket
import threading
import time
import cv2
from easytello.stats import Stats
from functools import wraps
from playsound import playsound
import detect
import navigate
class Tello:
def __init__(self, tello_ip: str='192.168.10.1', debug: bool=True):
# Opening local UDP port on 8889 f... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Processors for :mod:`repoze.sendmail`, intended as a drop-in replacement
for the ``qp`` command line, using Amazon SES.
"""
from __future__ import print_function, absolute_import, division
__docformat__ = "restructuredtext en"
import os
import argparse
import sys
im... |
#--------------------------------------------------------------------------------------------------------------------------
from __future__ import generators
import os, sys, ntpath, re, csv
from lxml import etree
from collections import defaultdict
#---------------------------------------------------------------------... |
"""
This get_inputs post-process step aggregates candidate plants of a certain type within the same load zone
to simplify model complexity.
Implementation details:
1. We first aggregate the plants in generation_projects_info.csv.
- We average the connection costs (weighted by capacity limit)
- We sum the capa... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.