text
stringlengths
957
885k
<filename>docs/source/tutorials/src/geo/gpx.py # Copyright (c) 2020, <NAME> # License: MIT License from typing import Iterable, Tuple from xml.etree import ElementTree as ET from pathlib import Path import json import ezdxf from ezdxf.math import Matrix44 from ezdxf.addons import geo TRACK_DATA = Path(__file__).pare...
<filename>examples/example_all_functionality.py from typing import Dict from deephaven import DateTimeUtils as dtu from ibapi.contract import Contract from ibapi.order import Order import deephaven_ib as dhib ########################################################################### # WARNING: THIS SCRIPT EXECUTES ...
<gh_stars>0 #---------------------------------------------------------------------------- # GHI_PulseCount.py # # Raspberry Pi Python library for use with GHI PulseCount. # https://www.ghielectronics.com/catalog/product/465 # a breakout board for the LSI LS7366R # http://www.lsicsi.com/pdfs/Data_Sheets/LS7366R.pdf # ...
#!/usr/bin/env python # -*- coding: utf-8 -*- # (c) Copyright IBM Corp. 2010, 2020. All Rights Reserved. import json import os import sys import tarfile import zipfile from mock import patch from resilient_sdk.cmds import CmdExtPackage as CmdPackage from resilient_sdk.cmds.validate import CmdValidate from resilient_s...
import numpy as np import os from trotter import * folder='phi0' dim = 3 for g in np.linspace(-1,0, 21): for theta in np.linspace(0, np.pi/3, 21): print(g, theta) g = float("{0:.5f}".format(g)) J = float("{0:.5f}".format(-1-g)); theta = float("{0:.5f}".format(theta)); phi = float("{0:.5f}"....
"""asynchronous clientside protocol for twisted.""" import struct from twisted.protocols.basic import IntNStringReceiver from twisted.internet.defer import Deferred from twisted.python.failure import Failure from twisted.python import log from . import data, utils class VersionMismatch(Exception): """Version do...
import csv import io import re from datetime import date, datetime, timedelta import dateparser import django.conf import pytz import yaml from django.core.mail import EmailMessage from django.core.management.base import BaseCommand, CommandError from django.utils import translation from django.utils.translation impor...
""" A simple script for importing photos from a memory card to a computer. Source/destinations are configured via constants to make the CLI dead-simple under the assumption that these won't change much, but an argparse interface could be added for improved flexibility. """ import os from datetime import datetime imp...
<filename>samples/balloon/deep_lesion_train_key.py epoch = 100 layers = 'all' #'all' or 'heads' # PREVIOUSLY JUST DID HEADS patience1=2 """ Mask R-CNN Train on the toy Balloon dataset and implement color splash effect. Copyright (c) 2018 Matterport, Inc. Licensed under the MIT License (see LICENSE for details) Writt...
<gh_stars>0 # Copyright 2017 The Wallaroo 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 la...
<filename>tests/links_tests/model_tests/fpn_tests/test_mask_head.py<gh_stars>1000+ from __future__ import division import numpy as np import unittest import chainer from chainer import testing from chainer.testing import attr from chainercv.links.model.fpn import mask_head_loss_post from chainercv.links.model.fpn im...
<reponame>xopr/gigatron-rom<gh_stars>100-1000 import asm asm.defun('@globals') asm.glob('ht') asm.dw(0) asm.glob('ha') asm.dw(0) asm.glob('pvpc') asm.dw('vPC') asm.glob('sp') asm.dw(0x06fe) asm.glob('rv') asm.dw(0) asm.glob('thunk0') asm.dw('@thunk0') asm.glob('thunk1') asm.dw('@thunk1') asm.glob('thunk2') asm.dw('@th...
# Copyright © 2018 VMware, Inc. All Rights Reserved. # SPDX-License-Identifier: BSD-2-Clause OR GPL-3.0-only # !/usr/bin/python ANSIBLE_METADATA = { 'metadata_version': '1.1', 'status': ['preview'], 'supported_by': 'community' } DOCUMENTATION = ''' --- module: vcd_vdc_vm short_description: Ansible Module...
<filename>laygo/generators/splash/adc_sar_sar_wsamp_layout_generator_bb_doubleSA_pe.py<gh_stars>10-100 #!/usr/bin/python ######################################################################################################################## # # Copyright (c) 2014, Regents of the University of California # All rights r...
<gh_stars>1-10 import random import numpy as np import math from baseline.utils import export __all__ = [] exporter = export(__all__) @exporter class DataFeed(object): """Data collection that, when iterated, produces an epoch of data This class manages producing a dataset to the trainer, by iterating an...
import numpy as np from aerosandbox import ExplicitAnalysis from aerosandbox.geometry import * from aerosandbox.performance import OperatingPoint from aerosandbox.aerodynamics.aero_3D.singularities.uniform_strength_horseshoe_singularities import \ calculate_induced_velocity_horseshoe from typing import Dict, Any ...
#%% pytorch_tools import torch import torch.nn as nn from tools.basics import product, bundle from tools.record_keeper import RecordKeeper #%% pytorch_tools default_seed = 1 torch.manual_seed(default_seed) # if gpu is to be used device = torch.device("cuda" if torch.cuda.is_available() else "cpu") # returns list of ...
<reponame>unt-libraries/codalib import pytest from codalib import anvl class Test_readANVLString(object): def test_with_empty_string(self): """ Check that readANVLString can handle an empty string. """ actual = anvl.readANVLString('') expected = {} assert actual ==...
import datetime import os from api.domain import sensor from api.domain.order import Order from api.domain.scene import Scene from api.domain.user import User from api.util.dbconnect import db_instance from api.util import julian_date_check from api.providers.ordering import ProviderInterfaceV0 from api import OpenSce...
<reponame>tdsmith/elisascripts import argparse import ijroi import matplotlib.pyplot as plt import numpy as np import pandas as pd import scipy.ndimage as img import tifffile as tf from shapely.geometry import Polygon, Point from elisa.annotate import annotate_cells, surface_from_array, PIL_from_surface def tx_matr...
<reponame>Ziems/OBST<filename>src/model/activation.py import mesh_tensorflow as mtf import numpy as np import tensorflow as tf from .. import tf_wrapper as tfw from ..dataclass import BlockArgs from ..mtf_wrapper import relu as _relu, multiply, einsum, constant, sigmoid as _sigmoid, tanh as _tanh, softplus from ..util...
# -*- coding: utf-8 -*- import scrapy import re from bgm.items import Record, Index, Friend, User, SubjectInfo, Subject from bgm.util import * from scrapy.http import Request import datetime import json mpa = dict([(i, None) for i in range(32)]) class UserSpider(scrapy.Spider): name = 'user' def __init__(sel...
<gh_stars>1-10 #!/usr/bin/env python3 """Copyright (c) 2020 Cisco and/or its affiliates. This software is licensed to you under the terms of the Cisco Sample Code License, Version 1.1 (the "License"). You may obtain a copy of the License at https://developer.cisco.com/docs/licenses All use of the materia...
from django.contrib.auth.models import User from django.test import TestCase from dfirtrack_main.models import Location import urllib.parse class LocationViewTestCase(TestCase): """ location view tests """ @classmethod def setUpTestData(cls): # create object Location.objects.create(locati...
#!/usr/bin/env python # -*- coding: utf-8 -*- # @Time : 2018/7/20 10:48 # @Author : bxf # @File : TRANSFORM_OPT.py # @Software: PyCharm from concurrent.futures import ThreadPoolExecutor from model.util.newID import * from model.util.PUB_RESP import * from model.FUNC.GROUP_OPT import * import threadin...
<gh_stars>1-10 #!/usr/bin/env python """ Provides simple 'get()' interface for accessing default value overrides Checks environment variables first, then chplconfig file for definitions """ import os import sys chplenv_dir = os.path.dirname(__file__) sys.path.insert(0, os.path.abspath(chplenv_dir)) from utils import ...
<reponame>netsec/cinder<filename>cinder/volume/drivers/kaminario/kaminario_common.py<gh_stars>0 # Copyright (c) 2016 by Kaminario Technologies, Ltd. # 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...
<reponame>dnguyen800/home-assistant """Support for ZHA covers.""" from datetime import timedelta import functools import logging from zigpy.zcl.foundation import Status from homeassistant.components.cover import ATTR_POSITION, DOMAIN, CoverDevice from homeassistant.const import STATE_CLOSED, STATE_CLOSING, STATE_OPEN...
# -*- coding: utf-8 -*- """ Created on Fri Apr 22 14:07:39 2016 @author: pablo """ import numpy as np import abc import matplotlib.pyplot as plt class Hyperplume(): """ Parent class Hyperplume loads target plasma and defines common attributes as well as shared methods in the AEM and SSM plume classe...
<reponame>soulmerge/pymment from datetime import datetime import json import logging import os import sqlite3 import urllib.parse import uuid logging.basicConfig(level=logging.DEBUG) log = logging.getLogger(__name__) file = os.path.join(os.path.dirname(__file__), 'comments.sqlite3') log.info(file) connection = sqlite...
<gh_stars>0 from tkinter import * import random renkler = ('red', 'blue', 'orange', 'green', 'gray') carpan = 10 # Boyutlari pixele cevirmek icin kullanilir siralar = (1, 3, 1, 2, 3, 1, 2, 3, 1) yonler = (1, 0, 1, 0, 1, 0, 1, 1, 0) # 0:normal, 1: 90 derece donuk class Cisim: def __init__(self, tip...
<reponame>AlainDaccache/Quantropy import json import os import pickle from datetime import date, datetime, timedelta import typing import requests import yfinance as yf from alpha_vantage.timeseries import TimeSeries import re import pandas as pd from matilda import config class StockPriceScraper: def __init__(...
#!/usr/bin/env python # # __init__.py - Funtions for managing OpenGL shader programs. # # Author: <NAME> <<EMAIL>> # """The ``shaders`` package contains classes and functions for finding, parsing, compiling, and managing OpenGL shader programs. Two types of shader program are supported: - GLSL 1.20 vertex and fragme...
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Copyright 2017 Google 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 requ...
<reponame>LeonDante-ctrl/leons-blog<gh_stars>0 # -*- coding: utf-8 -*- vim: fileencoding=utf-8 : """ Dictionary-like interfaces to RFC822-like files The Python deb822 aims to provide a dict-like interface to various RFC822-like Debian data formats, like Packages/Sources, .changes/.dsc, pdiff Index files, etc. As well...
<reponame>alibaba/FederatedScope<filename>federatedscope/mf/dataloader/dataloader.py from scipy.sparse import csc_matrix from scipy.sparse import coo_matrix from numpy.random import shuffle import numpy as np import collections import importlib MFDATA_CLASS_DICT = { "vflmovielens1m": "VFLMovieLens1M", "vflmo...
# coding=utf-8 __author__ = 'kohlmannj' import os import copy import codecs from collections import defaultdict from Ity.Formatters import Formatter from jinja2 import Environment, FileSystemLoader class LineGraphFormatter(Formatter): """ An Ity Formatter subclass which outputs SVG-based line graphs for the ...
""" Key Codes used by the keyboard system. Note that only base (unshifted) symbols and keys have keycodes. There is significant variation between layouts of different countries; keys are given by their semantic meaning and not by their position. But these are also not suitable for text input. """ import ppb.flags c...
<filename>glue/qt/glue_toolbar.py import os import matplotlib from matplotlib.backends.backend_qt4 import NavigationToolbar2QT from ..external.qt import QtCore, QtGui from ..external.qt.QtGui import QMenu from ..external.qt.QtCore import Qt, Signal from ..core.callback_property import add_callback from .qtutil import g...
# # Copyright (c) SAS Institute Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in w...
<reponame>ons-eq-team/eq-questionnaire-runner from typing import Mapping from flask import url_for from app.questionnaire import QuestionnaireSchema from .context import Context from .list_context import ListContext from .summary import Group class SectionSummaryContext(Context): def __call__(self, current_loca...
<reponame>MArtinherz/sportsipy<filename>tests/integration/boxscore/test_ncaab_boxscore.py<gh_stars>100-1000 import mock import os import pandas as pd from datetime import datetime from flexmock import flexmock from sportsipy import utils from sportsipy.constants import HOME from sportsipy.ncaab.constants import BOXSCOR...
import random import cv2 import numpy as np import time import os import pymunk import robolib.modelmanager.downloader as downloader # ==Win== pointsToWin = 3 # ==MODEL== MODEL_FILE = downloader.get_model(downloader.HAARCASCADE_FRONTALFACE_ALT, True) face_cascades = cv2.CascadeClassifier(MODEL_FILE) # ==WINDOW== ...
from dynatrace import Dynatrace from dynatrace.configuration_v1.oneagent_on_a_host import ( HostConfig, HostAutoUpdateConfig, MonitoringConfig, AutoUpdateSetting, TechMonitoringList, EffectiveSetting, MonitoringMode, ) from dynatrace.configuration_v1.schemas import UpdateWindowsConfig, Updat...
import json import copy import requests from django.core.management.base import BaseCommand # Use "./manage.py help food_json" for help on how to use this script! # Please update this on next use: # (it shows the command we last used) # # ./manage.py food_json 1066 -ec 3977 3758 283 163 3 48 135 247 # ...
"""Support for Pollen.com allergen and cold/flu sensors.""" from datetime import timedelta import logging from statistics import mean import voluptuous as vol from homeassistant.components.sensor import PLATFORM_SCHEMA from homeassistant.const import ( ATTR_ATTRIBUTION, ATTR_STATE, CONF_MONITORED_CONDITIONS) from...
import ast import re from ate import utils from ate.exception import ParamsError variable_regexp = r"\$([\w_]+)" function_regexp = r"\$\{[\w_]+\([\$\w_ =,]*\)\}" function_regexp_compile = re.compile(r"^\$\{([\w_]+)\(([\$\w_ =,]*)\)\}$") def extract_variables(content): """ extract all variable names from content...
''' Tests for ph5api ''' import unittest from ph5.core import ph5api class TestPH5API(unittest.TestCase): def setUp(self): self.ph5API_object = ph5api.PH5(path='ph5/test_data/ph5', nickname='master.ph5') def test_load_ph5(self): """ Tries to l...
from django.contrib.contenttypes.models import ContentType from django.conf import settings from django.core.files.base import ContentFile from django.contrib.admin.views.decorators import staff_member_required try: from django.contrib.auth import get_user_model User = get_user_model() except ImportError: ...
""" Utilities for meta & bulk Sample operations """ import os from glob import glob import numpy as np import statsmodels.api as sm import warnings from .. import Sample, Matrix # FCS 3.1 reserves certain keywords as being part of the FCS standard. Some # of these are required, and others are optional. However, all o...
<reponame>str4nd/sikteeri<gh_stars>10-100 # encoding: UTF-8 import csv import logging from datetime import datetime, timedelta from io import StringIO from decimal import Decimal from django.conf import settings from membership.models import Bill, CancelledBill logger = logging.getLogger("membership.billing.procount...
import json import os import tempfile from unittest.mock import patch import pytest import yaml from chaoslib import convert_vars, merge_vars from chaoslib.configuration import load_configuration from chaoslib.exceptions import InvalidExperiment @patch.dict("os.environ", {"KUBE_TOKEN": "value2"}) def test_should_lo...
<gh_stars>1-10 # (c) Copyright [2018-2022] Micro Focus or one of its affiliates. # 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...
<filename>Input/instance_generator.py from Input.fixed_file_variables import FixedFileVariables from Input.dynamic_file_variables import DynamicFileVariables import numpy as np import random from scipy.spatial import distance class Instance: def __init__(self, n_stations, n_vehicles, n_time_hor): self.n_...
<reponame>anewmark/galaxy_dark_matter print('Will plot single galaxy luminosity density profiles') import astropy.table as table from defcuts import * from def_get_mags import * from my_def_plots import * from defflags import many_flags import matplotlib.pyplot as plt indir='/Users/amandanewmark/repositories/galaxy...
<filename>graphik/graphs/graph_revolute.py from typing import Dict, List, Any import numpy as np import numpy.linalg as la from graphik.robots import RobotRevolute from graphik.graphs.graph_base import ProblemGraph from graphik.utils import * from liegroups.numpy import SE3 from liegroups.numpy.se3 import SE3Matrix fro...
<filename>fake_texts/pytorch_dataset_fake_2.py import sys sys.path.append("fake_texts/") #sys.path.append("/home/leander/AI/repos/gen_text/TextRecognitionDataGenerator/fonts") import argparse import os, errno import random from random import randint import string from tqdm import tqdm from string_generator import ( ...
from django.urls import path from django.conf import settings from drf_yasg import views, openapi, generators, inspectors from rest_framework import permissions APP_VERSION = getattr(settings, 'VERSION', '') APP_NAME = getattr(settings, 'APP_NAME', 'Purplship') EMAIL_SUPPORT = getattr(settings, 'EMAIL_SUPPORT', '<EMAI...
<filename>custom_lcv/custom_lcv/doctype/custom_lcv/custom_lcv.py # -*- coding: utf-8 -*- # Copyright (c) 2018, <NAME> and contributors # For license information, please see license.txt from __future__ import unicode_literals import frappe, erpnext from frappe import _ from frappe.utils import flt from frappe.model.met...
<filename>docs/pylib/update_default_cmd_index.py # # This creates a Google wiki page for all default commands with __doc__ strings. # # Import this from a Django-aware shell, then call run_update. # # from os.path import dirname, abspath, join as pathjoin from evennia.utils.utils import ( mod_import, variable_from...
# Copyright 2017 The TensorFlow 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 applica...
import numpy as np import pandas as pd import random def sir_network(graph, num_nodes, t_sim, infection_probability=0.3, recovery_period=7, num_infected_init=None): Pi = infection_probability # beta (infection probability) Pr = 1/recovery_period # gamma (1/7 days) (recovery time) if not num_infecte...
# -*- coding: utf-8 -*- """nDimSegmentTree.py This module implements multi dimensional segment tree. A segment tree also known as a statistic tree is a tree data structure used for storing information about intervals, or segments. It allows querying which of the stored segments contain a given point. It is, in princi...
<reponame>morganwu277/chan # coding: utf-8 import sys import warnings sys.path.insert(0, '.') sys.path.insert(0, '..') import os import pandas as pd import czsc from czsc.analyze import KlineAnalyze, find_zs warnings.warn("czsc version is {}".format(czsc.__version__)) # cur_path = os.path.split(os.path.realpath(__f...
import torch import optuna import torch.nn as nn from utils.utils import progress_bar import matplotlib.pyplot as plt from utils.utils import pgd import torch import torch.nn as nn import torch.optim as optim from torchvision.transforms import ToTensor, Compose class CURELearner(): '''Strongly modified version of...
<reponame>pulumi/pulumi-alicloud<gh_stars>10-100 # coding=utf-8 # *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. *** # *** Do not edit by hand unless you're certain you know what you are doing! *** import warnings import pulumi import pulumi.runtime from typing import Any, Mapping, O...
<gh_stars>0 # -*- coding: utf-8 -*- import math,string,itertools,fractions,heapq,collections,re,array,bisect class XorAndSum: def maxSum(self, number): if not number: return 0 number = list(number) while True: hasMore = True for i, j in itertools.combina...
# PyGetWindow # A cross-platform module to find information about the windows on the screen. # Work in progress # Useful info: # https://stackoverflow.com/questions/373020/finding-the-current-active-window-in-mac-os-x-using-python # https://stackoverflow.com/questions/7142342/get-window-position-size-with-pyth...
<filename>glucosetracker/glucoses/views.py # -*- coding: utf-8 -*- import json import logging import operator import mpld3 from datetime import datetime, timedelta from django.contrib import messages from django.contrib.auth.decorators import login_required from django.core.exceptions import PermissionDenied from djan...
# # ------------------------------------------------------------------------- # Copyright (c) 2018 Intel Corporation Intellectual Property # # 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...
# # Copyright (c) 2021 The banded_matrices Contributors. # # 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 l...
<gh_stars>1-10 import sys import inspect from functools import update_wrapper from ._compat import iteritems from ._unicodefun import _check_for_unicode_literals from .utils import echo from .globals import get_current_context def pass_context(f): """把一个回调函数标记成想要接收当前语境对象作为第一参数。 """ def new_func(*args, *...
# This file was automatically generated by SWIG (http://www.swig.org). # Version 1.3.31 # # Don't modify this file, modify the SWIG interface instead. import _geos import new new_instancemethod = new.instancemethod try: _swig_property = property except NameError: pass # Python < 2.2 doesn't have 'property'. de...
<gh_stars>10-100 # Copyright (C) 2015 <NAME> # All rights reserved. from __future__ import print_function, absolute_import __author__ = '<NAME> <<EMAIL>(at)<EMAIL>.<EMAIL>>' __version__ = '0.1-dev' import c4d class Channel(object): ''' Wrapper for a Procedural Channel Tag. ''' def __init__(self, op): supe...
<reponame>ShenQianwithC/HistomicsTK #!/usr/bin/env python # -*- coding: utf-8 -*- ############################################################################### # Copyright Kitware Inc. # # Licensed under the Apache License, Version 2.0 ( the "License" ); # you may not use this file except in compliance with the L...
<filename>losses/losses.py import torch import torch.nn.functional as F import torchvision from torch import nn from torchvision import models # --- Perceptual Loss --- # class Perceptual(torch.nn.Module): def __init__(self): super(Perceptual, self).__init__() vgg_model = models.vgg16(pretrained=...
<reponame>starsep/NewsBlur<filename>apps/rss_feeds/migrations/0001_initial.py from south.db import db from django.db import models from apps.rss_feeds.models import * class Migration: def forwards(self, orm): # Adding model 'Feed' db.create_table('feeds', ( ('id', orm['rs...
<reponame>JohnsonLee98/hover_1<gh_stars>0 # -*- coding: utf-8 -*- import importlib import random import cv2 import numpy as np import tensorflow as tf from tensorpack import imgaug from loader.augs import (BinarizeLabel, GaussianBlur, GenInstanceDistance, GenInstanceHV, MedianBlur, GenInst...
<gh_stars>1-10 # Managed settings file import os import re from readthedocs.settings.base import CommunityBaseSettings _redis = { 'default': dict(zip(['host', 'port', 'db'], re.split(':|/', '{{ rtd_redis_cache }}'))), 'celery': dict(zip(['host', 'port', 'db'], re.split(':|/', '{{ rtd_redis_celery }}'))), ...
<filename>main.py from agent import Agent import argparse from collections import deque from env import Environment import numpy as np import torch from model import QNetwork, Small, Large, Dropout import matplotlib matplotlib.use("TkAgg") from matplotlib import pyplot as plt def main(args): if args.examine: ...
<gh_stars>1-10 import sys import numpy as np import praw import pymc as pm from matplotlib import pyplot as plt from IPython.core.display import Image def posterior_upvote_ratio(upvotes, downvotes, samples=20000): """ This function accepts the number of upvotes and downvotes a particular comment received,...
# Django Libraries from django.shortcuts import render,redirect, HttpResponseRedirect from django.contrib import messages # User Defined from core.models import Contests, Problems from core.forms import ProblemFilterForm from core.viewers.helperviews import * #Python Libraries import random import json import request...
import os import sys import argparse import random import numpy as np import sklearn.preprocessing import sklearn.svm import sklearn.model_selection from sklearn.cross_decomposition import CCA from keras.callbacks import LearningRateScheduler from keras.wrappers.scikit_learn import KerasClassifier import tocca def tr...
<gh_stars>1-10 #!/usr/bin/env python3 """ This is a python script to aggregate detected bibs from individual person crops into one image. Usage: python person_aggregate.py /path/to/input/files \ /path/to/output \ /path/to/person/crops \ ...
<filename>External/astrometry.net/astrometry/python/pyfits/NA_pyfits.py<gh_stars>1-10 #!/usr/bin/env python # $Id: NA_pyfits.py 329 2007-07-06 13:11:54Z jtaylor2 $ """ A module for reading and writing FITS files and manipulating their contents. A module for reading and writing Flexible Image Transport System (FITS) ...
import pyyjj import pywingchun import click from kungfu.command.journal import journal, pass_ctx_from_parent import kungfu.yijinjing.msg as yjj_msg import kungfu.yijinjing.journal as kfj import kungfu.yijinjing.time as kft import time import sys import csv import traceback import pprint import importlib import os impo...
<gh_stars>1-10 import sys from sklearn.preprocessing import StandardScaler from sklearn.preprocessing import MinMaxScaler from sklearn.preprocessing import MaxAbsScaler from sklearn.preprocessing import RobustScaler import pandas as pd import numpy as np def scaler(data, type="standard", stdScaler_with_mean=True, stdS...
from margin.utils import AlignedPair, getFastaDictionary, getFastqDictionary, samIterator import os, sys from optparse import OptionParser import pysam import xml.etree.cElementTree as ET from jobTree.src.bioio import reverseComplement, prettyXml, system from itertools import product class SubstitutionMatrix(): ""...
<filename>tests/localization/translations/drivers/testconfigtranslator.py from tests.testcase import TestCase from edmunds.localization.translations.drivers.configtranslator import ConfigTranslator from edmunds.localization.translations.exceptions.translationerror import TranslationError from edmunds.localization.tran...
from copy import deepcopy import torch import torch.nn as nn from ..submodule import * from ..data import SimulationInput __all__ = ( "LSTMBaseline", "LSTMCNNBaselineFF", "LSTMCNNBaselineLF", "LSTMCNNBaseline2F", "LSTMCNNVideoBaseline", ) class LSTMBaseline(nn.Module): """ Does not use...
# -*- coding: utf-8 -*- ## Show classic screening curve analysis for generation investment # # Compute the long-term equilibrium power plant investment for a given load duration curve (1000-1000z for z \in [0,1]) and a given set of generator investment options. # # Available as a Jupyter notebook at https://pypsa.readt...
<filename>Fracktory3-3.0_b11/plugins/USBPrinting/avr_isp/stk500v2.py """ STK500v2 protocol implementation for programming AVR chips. The STK500v2 protocol is used by the ArduinoMega2560 and a few other Arduino platforms to load firmware. This is a python 3 conversion of the code created by <NAME> for the Cura project. ...
<reponame>ponderng/recon-pipeline import shutil import tempfile from pathlib import Path from unittest.mock import MagicMock, patch import pytest from pipeline.recon.web import SubjackScan, TKOSubsScan, GatherWebTargets subjack_results = Path(__file__).parent.parent / "data" / "recon-results" / "subjack-results" tko...
import xarray as xr import matplotlib.pyplot as plt #CMIP5 models ACCESS_rol_4 = xr.open_dataset('/projects/NS9600K/idunnam/src/rol_mean_3_5_deg/ACCESS_rol_4.nc').mean(dim='year') HADGEM_rol_4 = xr.open_dataset('/projects/NS9600K/idunnam/src/rol_mean_3_5_deg/HADGEM_rol_4.nc').mean(dim='year') HADGEM_cloud_rol_4 = xr....
from ci_reduce.image import CI_image from ci_reduce.exposure import CI_exposure import ci_reduce.common as common import ci_reduce.xmatch.gaia as gaia import astropy.io.fits as fits from astropy.table import vstack, hstack import os import ci_reduce.analysis.basic_image_stats as bis import ci_reduce.analysis.basic_cata...
<filename>byceps/services/seating/seat_service.py """ byceps.services.seating.seat_service ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ :Copyright: 2006-2021 <NAME> :License: Revised BSD (see `LICENSE` file for details) """ from __future__ import annotations from typing import Iterator, Optional, Sequence from ...database i...
from pathlib import Path import logging import os import re import sys from typing import Union import bmesh import bpy import numpy from mathutils import Vector sys.path.append(os.path.dirname(__file__)) import world_json from dirs import dest, src from selection import all_mesh_objects, editmode, select_object, sel...
<filename>S12/tensornet/engine/learner.py import torch import torch.nn.functional as F from tensornet.engine.ops.regularizer import l1 from tensornet.data.processing import InfiniteDataLoader from tensornet.utils.progress_bar import ProgressBar class Learner: def __init__( self, model, optimizer, criter...
import torch import torch.nn as nn import torch.nn.functional as F from ...config import cfg from ..model_utils.pytorch_utils import Empty class VoxelFeatureExtractor(nn.Module): def __init__(self, **kwargs): super().__init__() def get_output_feature_dim(self): raise NotImplementedError ...
<reponame>douglaslab/cryoorigami<filename>bin/em_copystarcols.py #!/usr/bin/env python3 # -*- coding: utf-8 -*- # @Date : 2018-11-15 11:00:21 # @Author : <NAME> (<EMAIL>) # @Link : http://example.org # @Version : $Id$ import os import sys import argparse import cryoorigami.origamiem as em import cryoorigami.uti...