text stringlengths 957 885k |
|---|
<reponame>dichodaemon/chrysophylax<gh_stars>0
import pandas as pd
from functools import reduce
def max_in_window(parms, data):
return data[parms.input_column].rolling(parms.window_size).max()
def min_in_window(parms, data):
return data[parms.input_column].rolling(parms.window_size).min()
def moving_average... |
# Importing the required libraries
from surprise import Reader, Dataset
from surprise import SVD, accuracy, SVDpp, SlopeOne, BaselineOnly, CoClustering
import datetime
import requests, zipfile, io
from os import path
import pandas as pd
import tqdm as tqdm
from numpy import *
from sklearn.model_selection import train_t... |
<reponame>namph-sgn/Deep-learning-BLSTM<filename>flask_app/access_gcp_data.py
import feedparser
import pandas as pd
import numpy as np
from google.cloud import storage
from io import StringIO
def get_new_data():
def categorize_AQI(AQI_data):
"""
Input: Series of AQI_values
Output: Series o... |
<gh_stars>1-10
import boto3
import os
import json
import logging
from sqs import Sqs
from sitewise_asset import SitewiseAsset
from sitewise_assets_cache import SitewiseAssetsCache
from association_converter import AssociationConverter
from sitewise_integration_points import SitewiseIntegrationPoints
logger = logging.g... |
<gh_stars>1-10
# ------------------------------------------------------------------------------
# Program: The LDAR Simulator (LDAR-Sim)
# File: OGI company
# Purpose: Company managing OGI agents.
#
# Copyright (C) 2018-2020 <NAME>, <NAME>, <NAME>, <NAME>
#
# This program is free software: you can redis... |
#!/usr/bin/env python
# encoding: utf-8
#
# virtualenv-burrito.py — manages the Virtualenv Burrito environment
#
__version__ = "2.0.5"
import sys
import os
import csv
import urllib
import urllib2
import shutil
import glob
import tempfile
try:
import hashlib
sha1 = hashlib.sha1
except ImportError: # Python... |
<gh_stars>10-100
from neopixel import *
import atexit
import colorsys
# LED strip configuration:
LED_COUNT = 64 # Number of LED pixels.
LED_PIN = 18 # GPIO pin connected to the pixels (must support PWM!).
LED_FREQ_HZ = 800000 # LED signal frequency in hertz (usually 800khz)
LED_DMA = 5... |
<filename>apps/breakfast/Sensorbed/version2/MIB_UART_ID.py
#!/usr/bin/env python
import socket, asyncore, asynchat, struct, array, signal, fcntl, os, time, tos_MIBUART
__all__ = ['NSLUListener', 'ServerToMoteListener', 'UserChannelListener', 'ReprogramListener']
HOST = '0.0.0.0'
REPROG_PORT = 16462
NSLU_PORT = 16461
... |
# -*- coding: utf-8 -*-
"""Functions for downloading and analysing data on MPs."""
# Imports ---------------------------------------------------------------------
import numpy as np
import pandas as pd
from . import combine
from . import constants
from . import core
from . import elections
from . import filter
from ... |
<reponame>xerion3800/fhempy<filename>FHEM/bindings/python/tests/mocked/test_utils.py
import functools
import pytest
from fhempy.lib import utils
def test_local_ip():
ip = utils.get_local_ip()
assert ip != "127.0.0.1"
def test_encrypt_decrypt():
teststring = "This is a test string"
fhem_unique_id = ... |
<filename>playlistgrabber.py
#!/usr/bin/python3
"""YouTube Playlist Backup Script in Python3.
Save a YouTube playlist's video titles into a textfile.
"""
from apiclient.discovery import build
import argparse
import codecs
from datetime import datetime
from math import ceil
from os import linesep
from sys import getf... |
<filename>resnet_model.py
from keras.models import Model
from keras.layers import Conv2D
from keras.layers import BatchNormalization
from keras.layers import Activation
from keras.layers import Add
from keras.layers import ZeroPadding2D
from keras.layers import MaxPooling2D
from keras.layers import Input
from keras.lay... |
from typing import Any, Dict, List
import pydantic
import pytest
from modelkit.core.errors import ItemValidationException, ReturnValueValidationException
from modelkit.core.model import AsyncModel, Model
from modelkit.core.settings import LibrarySettings
from modelkit.utils.pydantic import construct_recursive
@pyte... |
# Copyright (c) 2013-2014 Rackspace, 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 ... |
"""Defines basic light string data and functions."""
import os
import sys
import atexit
import inspect
import time
import logging
from typing import Any, Optional, Sequence, Union, overload
from nptyping import NDArray
import numpy as np
from LightBerries.LightBerryExceptions import LightStringException
from LightBerri... |
<filename>contributions/applications/experiment4/train.py
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from __future__ import print_function
from __future__ import division
from __future__ import absolute_import
import argparse
import os
import pandas as pd
import tensorflow as tf
import numpy as np... |
<reponame>yclin99/CS251A_final_gem5
# Copyright 2004-2006 The Regents of The University of Michigan
# Copyright 2010-20013 Advanced Micro Devices, Inc.
# Copyright 2013 <NAME> and <NAME>
# Copyright 2017-2020 ARM Limited
# Copyright 2021 Google, Inc.
#
# The license below extends only to copyright in the software and s... |
<filename>invana_engine/gremlin/schema.py<gh_stars>1-10
from .base import GremlinOperationBase, CRUDOperationsBase
from gremlin_python.process.strategies import *
from gremlin_python.process.traversal import Order
class SchemaOps(GremlinOperationBase):
def get_all_vertices_schema(self):
_ = self.gremlin_... |
import argparse
import sys
import json
import asyncio
import enum
import re
import base64
from typing import Optional
from dataclasses import dataclass
import httpx
from pure_protobuf.dataclasses_ import field, optional_field, message
from pure_protobuf.types import int32
# - Protobuf schemas
# Converted from https:/... |
from flask_sqlalchemy import SQLAlchemy
from sqlalchemy.exc import DatabaseError
from sqlalchemy.sql import func
from socket import inet_aton, inet_ntoa
from struct import unpack, pack, error as struct_error
from passlib.hash import bcrypt_sha256
import datetime
import hashlib
import json
def sha512(string):
re... |
<reponame>erhan-/pokefarm
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: POGOProtos/Data/Capture/CaptureProbability.proto
import sys
_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1'))
from google.protobuf import descriptor as _descriptor
from google.protobuf import message... |
<reponame>hschwane/offline_production
#!/usr/bin/env python
"""
Run MuonGun with a small target surface surrounding DeepCore, and
plot the generated tracks to illustrate the part of the detector
volume that goes un-simulated.
"""
from argparse import ArgumentParser
from os.path import expandvars
parser = ArgumentPars... |
<reponame>pranasziaukas/advent-of-code-2021
import unittest
from monad_unit import Monad
class FooTest(unittest.TestCase):
def setUp(self):
instructions = [
"inp w",
"mul x 0",
"add x z",
"mod x 26",
"div z 1",
"add x 12",
... |
import os
import sys
from collections import deque
from logging import getLogger
from tatau_core.models import TaskAssignment
from tatau_core.nn.tatau.model import Model
from tatau_core.nn.tatau.progress import TrainProgress
from tatau_core.utils import configure_logging
from tatau_core.utils.ipfs import IPFS, Downloa... |
#!/usr/bin/python
import httplib, urllib
import webbrowser
import requests
import time
import base64
import json
from finally_importer import *
from finally_helpers import *
class FinallySubimporter:
def importLibrary(self):
raise ValueError("FinallySubimporter no-op must override importLibrary")
class FinallySpot... |
<gh_stars>1-10
##############################################################################
# Copyright (c) 2017 Huawei Technologies Co.,Ltd and others.
#
# All rights reserved. This program and the accompanying materials
# are made available under the terms of the Apache License, Version 2.0
# which accompanies this... |
<filename>utils/tests/test_flare.py
# Unless explicitly stated otherwise all files in this repository are licensed
# under the Apache License Version 2.0.
# This product includes software developed at Datadog (https://www.datadoghq.com/).
# Copyright 2018 Datadog, Inc.
import mock
import pytest
import os
import datet... |
<filename>PyMesh/third_party/libigl/python/tutorial/405_AsRigidAsPossible.py
#!/usr/bin/env python
#
# This file is part of libigl, a simple c++ geometry processing library.
#
# Copyright (C) 2017 <NAME> <<EMAIL>> and <NAME> <<EMAIL>>
#
# This Source Code Form is subject to the terms of the Mozilla Public License... |
<filename>backend/hackathon/views.py
from .serializers import BenchSerializer
from .models import Bench
from django.shortcuts import render
from rest_framework.views import APIView
from rest_framework import viewsets
from rest_framework.response import Response
from django.core import serializers
from .computation impo... |
#!/usr/bin/python
# Based upon: https://raw.githubusercontent.com/Quihico/handy.stuff/master/language.py
# https://forum.kodi.tv/showthread.php?tid=268081&highlight=generate+.po+python+gettext
_strings = {}
if __name__ == "__main__":
# running as standalone script
import os
import re
import subprocess... |
<reponame>mhoangvslev/audio2score
import re
import numpy as np
from pathlib import Path
from itertools import cycle
classic_tempos = {
"grave" : 32,
"largoassai" : 40,
"largo" : 50,
"pocolargo" : 60,
"adagio" : 71,
"pocoadagio" : 76,
"andante" : 92,
"andantino" : 100,
"menuetto" : ... |
<filename>train/tasks/semantic/modules/data_analysis.py<gh_stars>0
#!/usr/bin/env python3
# This file is covered by the LICENSE file in the root of this project.
import datetime
import os
import time
import imp
import cv2
import torch
import torch.backends.cudnn as cudnn
import torch.nn as nn
import torch.optim as opt... |
import tensorflow as tf
import os
import numpy as np
import pandas as pd
from skimage import io
from skimage.transform import resize
from skimage.filters import gaussian
# from deepflash import unet, preproc, utils
from df_resources import unet, preproc, utils, pixelshift37
from skimage.measure import label, regionpr... |
<reponame>efrenbg1/rmote.app<gh_stars>0
import socket
import ssl
import threading
import select
import queue
class mqtls:
def __init__(self, host="127.0.0.1", port=2443, user=None, pw=None):
self._host = host
self._port = port
self._user = user
self._pw = pw
self._socket = ... |
import itertools
import numpy as np
from challenge import Challenge
class ChallengeSolution(Challenge):
def __init__(self):
# Initialise super
super().__init__()
# Define digit masks
self.digits = np.asarray([
[True , True , True , False, True , True , True ], # 0
... |
import fiepipelib.encryption.public.publickey
import fiepipelib.locallymanagedtypes.data.abstractmanager
import typing
def FromJSONData(jsondata):
assert isinstance(jsondata,dict)
ret = RegisteredEntity()
ret._fqdn = jsondata['fqdn']
ret._publicKeys = []
for k in jsondata['public_keys']:
ke... |
import collections
import csv
import logging
import numpy as np
import torch.utils.data as main_data
import torchvision.transforms as transforms
from FedML.fedml_api.data_preprocessing.base import Cutout, DataLoader, LocalDataset
from .datasets import Landmarks
class LandmarksDataLoader(DataLoader):
IMAGENET_ME... |
import matplotlib.pyplot as plt
# from matplotlib import patches
import numpy as np
import scipy as sp
loadFolder = 'theta9000'
monteMatrix = np.load('./' + loadFolder + '/monteArray.npy')
# calculate values necessary for future use of matrix
'''
while True:
print("Input choice to display alpha and gamma histog... |
"""Overview:
The proxy / server is build as an extension of the asyncore.dispatcher class.
There are two instantiation of SimpleServer to listen on the given ports
for new connection, on for HTTP and the other for STP (ScopeTransferProtocol).
They do dispatch a connection to the appropriate classes, HTTPScopeInterface... |
import sys
import csv
import json
import re
import string
import copy
if len(sys.argv) < 3:
print("Usage:\npython3 exclude.py <csv file of records to delieneate> <csv file of records to delieneate>")
sys.exit(1)
csvfile = open(sys.argv[1], 'r')
reader = csv.DictReader( csvfile, delimiter="`", quoting=csv.QUO... |
#!/usr/bin/env python
# take a large pcap and dump the data into a CSV so it can be analysed by something like R.
#
# This version we want to know what the source IP is, what the protocol is and based on those
# peices of info run a function to grab that data and write a line to a CSV file
#
# Ignore all traffic sourc... |
"""
================================================================
Continuous and analytical diffusion signal modelling with MAPMRI
================================================================
We show how to model the diffusion signal as a linear combination
of continuous functions from the MAPMRI basis [Ozarsla... |
# -*- coding: utf-8 -*-
import numpy as np
import os
from keras.models import Sequential, Model
from keras.layers import Dense, Input, merge
from keras.layers import Reshape,LeakyReLU,ZeroPadding2D
from keras.layers.core import Activation, Dropout
from keras.layers.normalization import BatchNormalization
from keras.l... |
###############################################################################
# @file pyVerifGUI/gui/editor/editor.py
# @package pyVerifGUI.gui.editor.editor
# @author <NAME>
# @copyright Copyright (c) 2020. Eidetic Communications Inc.
# All rights reserved
# @license Licensed under the BSD 3-Clause licen... |
<gh_stars>10-100
import ipaddress
from functools import wraps
from selvpcclient.exceptions.base import ClientException
def _check_project_exists(client, project_id):
try:
client.projects.show(project_id)
except ClientException:
return False
return True
def _check_user_exists(client, use... |
# Copyright 2020 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, ... |
from datetime import datetime, timedelta
from math import ceil
from typing import List
from .task_rule_definition import MONTH_DAYS, MONTH_DAYS_LEAP, FrequencyEnum
class DatetimeManager:
@staticmethod
def is_time_between(
start_time: datetime, end_time: datetime, current_time: datetime
) -> bool:... |
# Repository: https://gitlab.com/quantify-os/quantify-core
# Licensed according to the LICENCE file on the master branch
"""Module containing the pyqtgraph based plotting monitor."""
import warnings
import pyqtgraph.multiprocess as pgmp
from qcodes import validators as vals
from qcodes.instrument.base import Instrumen... |
def get_overflow(sample: dict, obj: dict, all_sub=False) -> list:
"""Returns a list of all fields which exist in obj, but not in sample."""
fields = []
if hasattr(obj, "__iter__"):
for field in obj:
if field not in sample:
fields.append(field)
else:
... |
#
# Utility classes for PyBaMM
#
# The code in this file is adapted from Pints
# (see https://github.com/pints-team/pints)
#
import importlib
import numpy as np
import os
import sys
import timeit
import pathlib
import pickle
import pybamm
import numbers
from collections import defaultdict
def root_dir():
""" retu... |
<reponame>jamiejackherer/pyfilm-gui-no-glade<filename>pyfilm-gui-no-glade/main.py
#!/usr/bin/python3
#-*- coding:utf-8 -*-
import gi
gi.require_version('Gtk', '3.0')
from gi.repository import Gtk
#list of tuples for each software, containing the software name, initial release, and main programming languages used
sof... |
# -*- coding: utf-8 -*-
"""Main module."""
import json
from pathlib import Path
import logging
from typing import Tuple
import numpy as np
from .pyn5 import (
DatasetUINT8,
DatasetUINT16,
DatasetUINT32,
DatasetUINT64,
DatasetINT8,
DatasetINT16,
DatasetINT32,
DatasetINT64,
DatasetFL... |
"""
CAS (Princeton) Authentication
Some code borrowed from
https://sp.princeton.edu/oit/sdp/CAS/Wiki%20Pages/Python.aspx
"""
import datetime
import re
import urllib.parse
import urllib.request
import uuid
from xml.etree import ElementTree
from django.conf import settings
from django.core.mail import send_mail
from d... |
<filename>python-acoustics/acoustics/standards/iso_tr_25417_2007.py
"""
ISO/TR 25417 2007
=================
ISO/TR 25417:2007 specifies definitions of acoustical quantities and terms used
in noise measurement documents prepared by ISO Technical Committee TC 43,
Acoustics, Subcommittee SC 1, Noise, together with their ... |
<reponame>stochasticnetworkcontrol/snc
import pytest
import numpy as np
import tensorflow as tf
from copy import deepcopy
from tf_agents.drivers.dynamic_episode_driver import DynamicEpisodeDriver
from tf_agents.replay_buffers.tf_uniform_replay_buffer import TFUniformReplayBuffer
from tf_agents.specs.tensor_spec import... |
<reponame>hemprakash1994hp/detox
from __future__ import with_statement, print_function
import sys
import time
import eventlet
import py
import pytest
from eventlet.green.subprocess import Popen
from textwrap import dedent as d
from detox.proc import Detox
from detox.cli import main as detox_main, tox_prepare
pytest... |
<reponame>ut-ras/r5-2019
"""
Holds stuff specific to representing this year's game field.
"""
from r5engine.object import SimulationObject, MASK_CIRCULAR, MASK_RECT
import r5engine.graphics as graphics
import r5engine.settings as settings
import r5engine.util as util
OBSTACLE_RADIUS = 0.75
OBSTACLE_COLOR = (128, 128,... |
from posixpath import realpath
from typing import NewType
from django.db.models.fields import CommaSeparatedIntegerField
from django.shortcuts import render, redirect
from django.utils.timezone import datetime
from django.http import HttpResponse
import re
from dmdd_pictures.forms import LogForm
from dmdd_pictures.mode... |
<filename>src/Bubot_CoAP/layers/message_layer.py
import logging
import random
import time
import socket
from .. import utils
from .. import defines
from ..messages.request import Request
from ..transaction import Transaction
from ..utils import generate_random_token
# import asyncio
__author__ = '<NAME>'
logger = lo... |
# -*- coding: utf-8 -*-
import logging
import sys
import sets
import traceback
from django.core.management.base import BaseCommand
from django.core.management.base import CommandError
from django.db.models import Q
from frontend.models import EmailMessage
from frontend.models import ImportLog
from frontend.models imp... |
<filename>python/number_theory.py<gh_stars>0
"""
Number theory functions.
"""
import sys
from functools import reduce
from itertools import count, islice
from math import sqrt, gcd
from operator import mul
def prod(seq):
return reduce(mul, seq, 1)
def is_prime(n):
if n < 2 or n%2==0:
return n==2
... |
import datetime
import re
class TransactionEvent(object):
'''Storage object for transaction Events. It seems more organized than keeping
a bunch of lists of tuples of lists and dicts. There are some useful external methods
such as is_dividend() to return a boolean if the transaction is a dividend payment.... |
import os
import pandas as pd
import datetime
import csv
import re
import calendar
import numpy as np
import json
H5_FOLDER = os.path.join(os.getcwd(),'data/h5')
def parse(csv_file, session_id,file_type):
#VEC validation
#only powercor files are supported
#if session/hash exists - skip
if os.path... |
#!/usr/bin/env python3
"""
A script to run on your phone (running in Termux under Android).
"""
# TODO local sync with SFTP to an isolated location on the computer? Some watcher would pick up the files.
# TODO sync to cloud
# - get last filename from scaleaway
# - send encrypted chunks (contain entire photos)
# - enc... |
#===============================================================================
# Imports
#===============================================================================
from ..logic import (
Mutex,
)
import itertools
from ..util import (
defaultdict,
Dict,
OrderedDict,
OrderedDefaultDict,
)
... |
"""Tensor Class."""
import functools
import operator
import numpy as np
# PyCUDA initialization
import pycuda.driver as cuda
import pycuda.autoinit
from pycuda.compiler import SourceModule
from .gpu_kernels import add, arithmetic
from .states import TensorState
ops = {"+": operator.add, "-": operator.sub, "*":... |
import pytest
import numpy as np
import mchammer as mch
@pytest.fixture(
params=(
(mch.Atom(id=0, element_string='N'), 0, 'N'),
(mch.Atom(id=65, element_string='P'), 65, 'P'),
(mch.Atom(id=2, element_string='C'), 2, 'C'),
)
)
def atom_info(request):
return request.param
@pytest.f... |
<filename>examples/05_glm_second_level/plot_oasis.py
"""Voxel-Based Morphometry on Oasis dataset
========================================
This example uses Voxel-Based Morphometry (VBM) to study the relationship
between aging, sex and gray matter density.
The data come from the `OASIS <http://www.oasis-brains.org/>`_... |
<reponame>gilbertohasnofb/auxjad
import abjad
def extract_trivial_tuplets(selection: abjad.Selection) -> None:
r"""Mutates an input |abjad.Selection| in place and has no return value;
this function looks for tuplets filled with rests or with tied notes or
chords and replaces them with a single leaf.
... |
from __future__ import print_function, absolute_import, division
import os
import sys
import time
import signal
import traceback
from socket import gethostname
from getpass import getuser
from datetime import datetime
from six import iteritems
from six.moves import cStringIO
from sqlalchemy import func
from sklearn.b... |
<filename>monitoring/prober/scd/test_operation_references_error_cases.py
"""Operation References corner cases error tests:
"""
import datetime
import json
import uuid
import yaml
from monitoring.monitorlib.infrastructure import default_scope
from monitoring.monitorlib import scd
from monitoring.monitorlib.scd import... |
from typing import List
import numpy as np
import matplotlib.pyplot as plt
from mpl_toolkits import mplot3d
from sklearn.datasets import make_blobs, make_classification, make_swiss_roll, make_moons
import sys
# Create a class for k-means clustering algorithm
class KMeansClustering(object):
def __init__(self, K:... |
import importlib
import sys
import pytest
from openff.toolkit.topology import Molecule
from openff.bespokefit.utilities.molecule import (
_oe_canonical_atom_order,
_oe_get_atom_symmetries,
_rd_canonical_atom_order,
_rd_get_atom_symmetries,
canonical_order_atoms,
get_atom_symmetries,
get_to... |
# Copyright 2016 the GPflow authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writi... |
<reponame>null-pi/flatland-challenge
# gridmap
#
# Reads graph maps.
#
# For graph, state is pair of (x,y) tuple
# @author: mike
# @created: 2020-07-14
#
from lib_piglet.utils.tools import eprint
import os,sys
class vertex:
id:int
coordinate: tuple
adjacent: dict
def __init__(self, id:int, coordinat... |
<filename>tests/test_sftpserver.py
# coding: utf-8
from __future__ import absolute_import
from __future__ import unicode_literals
from __future__ import print_function
import sys
import os
import uuid
import shutil
import paramiko
from django.contrib.auth import get_user_model
from django.test import TestCase
from d... |
<reponame>pacargile/charm<filename>charm/model.py<gh_stars>0
import numpy as np
from scipy.stats import norm as gaussian
from astropy import units as u
from astropy.coordinates import SkyCoord
def gauss(args):
x,mu,sigma = args
return 1/(sigma*np.sqrt(2*np.pi))*np.exp(-(x - mu)**2 / (2*sigma**2))
class clustermodel... |
<reponame>qingqinl/Movie_recommendation_system
from Network import *
def get_batches(Xs, ys, batch_size):
for start in range(0, len(Xs), batch_size):
end = min(start + batch_size, len(Xs))
yield Xs[start:end], ys[start:end]
## 训练网络
#%matplotlib inline
#%config InlineBackend.figure_format = 'retina'
import matplo... |
import logging
import os
from astropy import units as u
from astropy.io import fits
from astropy.wcs import WCS
from astropy.modeling import models, fitting
import shlex
from ...spectra import Spectrum1D
from ..registers import data_loader
__all__ = ['wcs1d_fits_loader', 'wcs1d_fits_writer', 'non_linear_wcs1d_fits'... |
<reponame>rpauszek/smtirf
# -*- coding: utf-8 -*-
"""
@author: <NAME>, Ph.D. (2020)
smtirf >> traces
"""
import numpy as np
import scipy.stats
import json, warnings
from abc import ABC, abstractmethod
import smtirf
from . import SMSpotCoordinate, SMJsonEncoder
from . import HiddenMarkovModel
# ========================... |
import math
import torch
import torch.nn as nn
from core.diff_crop_layer import DiffCropOneImage
from backbones.resnet import ViewDense, resnet18
# from stn.spatial_transformer import SpatialTransformer
class GazeSinCosLSTMLstmScaling(nn.Module):
"""
Here, we predict sin(yaw),cos(yaw),sin(pitch) and a vari... |
from __future__ import annotations
from typing import Optional, TYPE_CHECKING
from spark_auto_mapper_fhir.fhir_types.date_time import FhirDateTime
from spark_auto_mapper_fhir.fhir_types.list import FhirList
from spark_auto_mapper_fhir.fhir_types.integer import FhirInteger
from spark_auto_mapper_fhir.fhir_types.string ... |
<filename>src/pretix/control/forms/event.py
#
# This file is part of pretix (Community Edition).
#
# Copyright (C) 2014-2020 <NAME> and contributors
# Copyright (C) 2020-2021 rami.io GmbH and contributors
#
# This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero Gener... |
#!/usr/bin/env python
from pathlib import Path
import csv
import warnings
import pandas as pd
class Phenotype:
"""
Load BIDS phenotype data
Matching the subject list to a dataframe.
Parameters
----------
phenotype_path : str | Path
path to BIDS dir `phenotype`
subject_info : str... |
"""Internal bases for sessions to make it easier to call dataset methods on the session object."""
from functools import wraps
from typing import Optional, Iterable, Tuple, TypeVar, TYPE_CHECKING, Type, Sequence
import numpy as np
from nilspodlib.dataset import Dataset
from nilspodlib.utils import path_t, inplace_or... |
<gh_stars>0
"""Xiaomi common components for custom device handlers."""
from __future__ import annotations
import logging
import math
from typing import Iterable, Iterator
from zigpy import types as t
import zigpy.device
from zigpy.profiles import zha
from zigpy.quirks import CustomCluster, CustomDevice
from zigpy.zcl... |
def prueba5(drone):
f = open("Datos_vuelo_prueba5.txt", "wb")
f.write("Test de despegue y aterrizaje \n")
drone.takeoff()
print("")
print("")
print("")
print("")
print("Estado del drone")
print("")
i= 0
for i in range(0,500):
print "Posicion ", drone.position
print "Velocidad ", drone.speed
pr... |
<reponame>leipzig/xd-cwl-utils<gh_stars>0
#
# * This file is subject to the terms and conditions defined in
# * file 'LICENSE.md', which is part of this source code package.
from abc import abstractmethod, ABC
from urllib.parse import urlparse
from ruamel.yaml.comments import CommentedMap
class AttributeBase(ABC):
... |
import re
from copy import deepcopy
import torch
from torch import nn as nn
from .conv2d_same import *
# Default args for PyTorch BN impl
BN_MOMENTUM_DEFAULT = 0.1
BN_EPS_DEFAULT = 1e-5
def round_channels(channels, depth_multiplier=1.0, depth_divisor=8, min_depth=None):
"""Round number of filters based on depth... |
<reponame>jfear/larval_gonad
"""Set of helper functions for the notebook."""
import os
from pathlib import Path
from datetime import datetime
from subprocess import check_output
import numpy as np
import pandas as pd
import matplotlib as mpl
from IPython import get_ipython
from .config import config, PROJECT_DIR, CON... |
# Copyright (c) 2019, NVIDIA CORPORATION.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to... |
from _utils import TestBase
from nose.tools import *
from werkzeug.exceptions import NotFound
from werkzeug.routing import Map
import json
class TestRoutes(TestBase):
"""Test routes.py"""
@classmethod
def setup_class(cls):
super(TestRoutes, cls).setup_class()
cls.load_routes()
@... |
<filename>tests/test_accumulation_distribution.py
from __future__ import absolute_import
import unittest
import numpy as np
from tests.sample_data import SampleData
from pyti import accumulation_distribution
class TestAccumulationDistribution(unittest.TestCase):
def setUp(self):
"""Create data to use for... |
import time
import numpy
from ortools.constraint_solver import pywrapcp
class CP_Solver_Got:
def __init__(self, problem, solver_type, nr_of_solution_limit, not_optimisation_problem, available_configurations,
time_limit, vmNr):
self.nrComp = problem.nrComp
self.problem = problem
... |
<reponame>KatrinaHoffert/stroke-radius-segmentation<filename>segment.py
'''
Runs the segmentation program on all images, resulting in the creation of
binary segmentation images.
'''
import os, re, sys, subprocess
from common import Study
# The Boykov segmentation program is only currently available as a Linux... |
<reponame>okxjd/processing_ng
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import logging
TPL_FORMAT = {\
'ten': [
{'1': ('kn', '66:0')}, {'1': ('kn', '66:1')}, {'1': ('kn', '66:2')}, {'1': ('kn', '66:3')},
{'1': ('kn', '66:4')}, {'1': ('kn', '66:5')}, {'1': ('kn', '66:6')}, {'1': ('kn', ... |
""" Utilities for generating and retrieving image thumbnails """
from hashlib import md5
from io import BytesIO, IOBase
from logging import getLogger
from os import makedirs, scandir
from os.path import dirname, isfile, join, normpath, getsize, splitext
from shutil import copyfileobj, rmtree
from typing import BinaryIO... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
assemble.py
This module finds and forms essential structure components, which are the
smallest building blocks that form every repeat in the song.
These functions ensure that each time step of a song is contained in at most
one of the song's essential structure ... |
__author__ = 'lucabasa'
__version__ = '1.1.0'
__status__ = 'obsolete'
import numpy as np
import pandas as pd
import seaborn as sns
import matplotlib.pyplot as plt
from sklearn.metrics import roc_auc_score
from sklearn.model_selection import StratifiedKFold
from sklearn.svm import SVC
from sklearn.linear_model im... |
#!/usr/bin/env python3
import asyncio
import json
import psutil
import socket
import urllib.error
import urllib.request
import iterm2
from psutil._common import bytes2human
af_map = {
socket.AF_INET: 'IPv4',
socket.AF_INET6: 'IPv6',
psutil.AF_LINK: 'MAC',
}
duplex_map = {
psutil.NIC_DUPLEX_FULL: "fu... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.