text stringlengths 957 885k |
|---|
<filename>GoogleCloudMLEngine/experiments/transferLearningTest1.py<gh_stars>0
# trying the advice of this site:
# https://towardsdatascience.com/keras-transfer-learning-for-beginners-6c9b8b7143e
# Note that I had to create a test set and rename images to test in the downloaded gs://sportseventdetection-football direc... |
<reponame>gwk/glossy<gh_stars>0
# Dedicated to the public domain under CC0: https://creativecommons.org/publicdomain/zero/1.0/.
import re
from dataclasses import dataclass
from functools import singledispatchmethod
from typing import Iterable, List, Optional, Tuple
from docutils import frontend as _frontend, nodes as... |
from __future__ import with_statement
import logging
import time
from concurrence import unittest, Tasklet, TaskLocal, TaskInstance
class TestTaskLocal(unittest.TestCase):
"""test tasklet local storage"""
def testSingleTask(self):
local = TaskLocal()
local.piet = 10
... |
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
# http://www.apache.org/licenses/LICENSE-2.0
# Unless required by applicable law or agreed to in writing, software
# distributed under the Li... |
# This file is called separately from the rest of the program. This file takes the original data and creates cleaner csvs for app.py to use
import gsw
import numpy as np
import pandas as pd
# all of the parameters from the full data: 'yyyy-mm-ddThh:mm:ss.sss', 'Longitude [degrees_east]', 'Latitude [degrees_north]',
#... |
<filename>common_classes/para_db_update_prep.py
''' ParaDbUpdatePrep - further documentation:
usage: scripts/db_updater_1
detailed: scripts/documentation/update_process.md'''
# pylint: pylint: disable=unused-import
import sys
import constants.crud as crud
import constants.scripts as constants
import co... |
import time
import pandas as pd
import numpy as np
from sklearn.feature_extraction.text import TfidfVectorizer, CountVectorizer
from sklearn.metrics import precision_recall_fscore_support, pairwise_distances, pairwise
from sklearn.decomposition import LatentDirichletAllocation
from sklearn.preprocessing import normali... |
"""
Based on: https://github.com/openai/baselines/blob/master/baselines/deepq/replay_buffer.py
"""
import random
from typing import List, Tuple
import numpy as np
from pyderl.utils.data_structures import SumSegmentTree, MinSegmentTree
class PrioritizedReplayBuffer:
""" Prioritized replay buffer.
Args:
... |
from reclaimer.constants import *
from reclaimer.util import fourcc_to_int
# These are the 4 fourCC that I've found in tag headers
# and this is what I believe the order of their age is.
engine_id_to_name = dict(
BLM_="halo_2",
LAMB="halo_2_old",
MLAB="halo_2_older",
ambl="halo_2_oldest",
... |
<gh_stars>1-10
# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from lxml import etree
import odoo
import odoo.tools as tools
from . import print_fnc
from odoo.models import BaseModel
from odoo.tools.safe_eval import safe_eval
class InheritDict(dict):
# Might be... |
__author__ = "<NAME>"
__copyright__ = "Copyright 2017, AI Research, Data Technology Centre, Volkswagen Group"
__credits__ = ["<NAME>"]
__license__ = "MIT"
__maintainer__ = "<NAME>"
import logging
import json
import argparse
import time
import paho.mqtt.client as mqtt
import numpy as np
import cv2
import gdk.config ... |
<reponame>tsvstar/vk_downloader
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import re
from os import path
from sys import stdout
from time import clock
class BaseYoutubeError(Exception):
pass
class FileExistsError(BaseYoutubeError):
pass
class MultipleObjectsReturned(BaseYoutubeError):
pass
class YouTub... |
<filename>pypureclient/flasharray/FA_2_4/models/__init__.py
# coding: utf-8
from __future__ import absolute_import
class ReferenceType(object):
"""Class just for type annotations.
It's used for reference arg on api function. This allows user to pass collections of Model objects
to the method without tra... |
# Copyright (c) 2013 Shotgun Software Inc.
#
# CONFIDENTIAL AND PROPRIETARY
#
# This work is provided "AS IS" and subject to the Shotgun Pipeline Toolkit
# Source Code License included in this distribution package. See LICENSE.
# By accessing, using, copying or modifying this work you indicate your
# agreement to the S... |
<gh_stars>1-10
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
#
# Timewarrior extension: catreport
# Author: <NAME>
# License: MIT
import sys
from timewreport.parser import TimeWarriorParser
class Node(dict):
'''This node represents a task or a category of tasks and may contain other nodes.'''
def __... |
import argparse
import os
from getpass import getpass
import configparser
from github import Github
CONFIG_FILE_NAME = 'manage-service.ini'
def save_file(config):
with open(CONFIG_FILE_NAME, 'w') as configfile:
config.write(configfile)
def set_and_save_sha(config):
config["github"]["current_co... |
#!/usr/bin/env python3
"""
Requires:
python-mnist
numpy
sklearn
"""
import sys
sys.path.insert(0, 'src/')
import mnist
import numpy as np
from numpy.linalg import norm as l21_norm
from sklearn.metrics.cluster import normalized_mutual_info_score as nmi
import os
gamma = .1
epsilon = 30
np.random.seed(int(os.environ... |
from tensorflow.keras.layers import Layer
import tensorflow as tf
import numpy as np
class OSELM(Layer):
def __init__(self,
n_hidden_nodes,
n_output_nodes,
batch_size,
reg_weight=5,
trainable=True,
name='oselm',... |
<filename>app/parsing.py
from newspaper import Article
from urllib.parse import urlparse
from htmlTagsExtractor import extract_tags
from factsExtractor import extract_facts
from googleApiSentiment import get_sentiments
from keywordsFinder import KeywordsFinder
from caching import get_cached_article, get_cached_featur... |
#coding:utf-8
#-----------------------------------------------------------------
# pycparser: explore_ast.py
# 访问 ast树
# This example demonstrates how to "explore" the AST created by
# pycparser to understand its structure. The AST is a n-nary tree
# of nodes, each node having several children, each with a name.
# Just... |
<filename>targets/ios/config/target.py
import os
from pygemstones.io import file as f
from core import module as m
# -----------------------------------------------------------------------------
def run(proj_path, target_name, params):
# archs
has_ios = True
has_tvos = True
has_watchos = True
ha... |
<reponame>ioz9/tools
#!/usr/bin/env python
# Filename tools.py
__author__ = '<EMAIL> (duanqz)'
### Import blocks
import os
import shutil
import commands
import tempfile
try:
import xml.etree.cElementTree as ET
except ImportError:
import xml.etree.ElementTree as ET
### Class blocks
class Toolkit:
""... |
<reponame>MattTurnock/PlanetarySciencesMatt<filename>Ass5/Q1.py
from astropy import units as u
from json_to_dict import constants
import numpy as np
from matplotlib import pyplot as plt
from matplotlib import pylab
pi = np.pi
######################################################################################
#####... |
import os
import pytest
import re
import tempfile
import time
import yatest.common
import yatest.common.network
import yatest.yt
from common_helpers import * # noqa
import zipfile
from testpath.tempdir import TemporaryDirectory
def get_catboost_binary_path():
return yatest.common.binary_path("catboost/app/catbo... |
<gh_stars>1-10
#!/usr/bin/env python3
# Purpose: Create EMR bootstrap script bucket and deploy the cfn stack
# Author: <NAME> (December 2020)
# Reference: https://gist.github.com/svrist/73e2d6175104f7ab4d201280acba049c
# Usage Example: python3 ./create_cfn_stack.py \
# --ec2-key-name emr-demo-12345... |
<filename>scripts/slave/unittests/annotated_run_test.py
#!/usr/bin/env python
# Copyright 2015 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Tests that the tools/build annotated_run wrapper actually runs."""
import ... |
<reponame>huseinzol05/Gather-Tensorflow-Serving<filename>misc/6.graph-dependencies/pyan/main.py
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
pyan.py - Generate approximate call graphs for Python programs.
This program takes one or more Python source files, does a superficial
analysis, and constructs ... |
<reponame>MaLei666/oms
######################################
# Django 模块
######################################
from django.shortcuts import render, HttpResponseRedirect, redirect, reverse
from django.views import View
from django.http import HttpResponse
from django.db.models import Q
from django.urls import reverse
... |
<reponame>aws-solutions/discovering-hot-topics-using-machine-learning
#!/usr/bin/env python
######################################################################################################################
# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. ... |
import torch.nn as nn
import torch.nn.functional as F
import torch
from im2scene.common import (
arange_pixels, image_points_to_world, origin_to_world
)
import numpy as np
from scipy.spatial.transform import Rotation as Rot
from im2scene.camera import get_camera_mat, get_random_pose, get_camera_pose
import pdb
fro... |
<reponame>SmartAcoustics/Kea
from myhdl import *
import random
import copy
from kea.test_utils.base_test import (
KeaTestCase, KeaVivadoVHDLTestCase, KeaVivadoVerilogTestCase)
from kea.axi import AxiStreamInterface
from .axis_constant_pad import axis_constant_pad
class TestAxisConstantPad(KeaTestCase):
de... |
from __future__ import division
from visual import *
def vector3d_add(vector1,vector2):
vector_addition=[0,0,0];
for i in range(0,3):
vector_addition[i]=vector1[i]+vector2[i];
return vector_addition;
def vector3d_sub(vector1,vector2):
vector_addition=[0,0,0];
for i in range(0,3):
v... |
<filename>openmdao/components/meta_model.py
""" Metamodel provides basic Meta Modeling capability."""
import sys
import numpy as np
from copy import deepcopy
from openmdao.core.component import Component, _NotSet
from six import iteritems
class MetaModel(Component):
"""Class that creates a reduced order model f... |
#importação da biblioteca pulp
from pulp import LpProblem, LpStatus, lpSum, LpVariable, LpMinimize
class Metodo_exato(object):
def __init__(self, lista_destinos, lista_distancias):
self.lista_destinos = lista_destinos
self.lista_distancias = lista_distancias
#Função par... |
# Copyright (c) 2012 The Khronos Group Inc.
# Permission is hereby granted, free of charge, to any person obtaining a copy of this software and /or associated documentation files (the "Materials "), to deal in the Materials without restriction, including without limitation the rights to use, copy, modify, merge, publi... |
<filename>neuwon/nmodl/kinetic_models.py
from scipy.linalg import expm
# TODO: What are the units on atol? How does the timestep factor into it?
# TODO: Make this accept a list of pointers instead of "input_ranges"
# TODO: Convert kinetics into a function.
# TODO: Use impulse response integration method in place of... |
import itertools
import sys
import os
import re
import fnmatch
from os.path import isdir, isfile
from PIL import Image
IMAGE_STRUCT = '<p align="center">\n\
<img title="{}" src="{}">\n\
</p>'
def quit( msg=None ):
if msg:
print( " " + "\033[91m " + msg + "\033[00m" )
print("Exiting..")
sys.exit(... |
<reponame>PerkinsAndWill-IO/compute.rhino3d<gh_stars>0
from http.server import HTTPServer, BaseHTTPRequestHandler
from enum import Enum
import json
import rhino3dm
import base64
class ParamAccess(Enum):
ITEM = 0
LIST = 1
TREE = 2
class ParamManager(object):
def __init__(self):
self._items = ... |
<filename>MuPythonLibrary/Uefi/EdkII/Parsers/BaseParser.py<gh_stars>1-10
# @file BaseParser.py
# Code to support parsing EDK2 files
##
# Copyright (c) 2016, Microsoft Corporation
#
# All rights reserved.
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the... |
<filename>scripts/data_to_JSON.py<gh_stars>0
#!/usr/bin/env python
#-*- coding: utf-8 -*-
"""Converts data from DGS (Direction Générale de la Santé)
in CSV format to a JSON object.
"""
#
# Modules to import
#
import csv
import json
import datetime
def format_date(date):
"""Transforms a date from YYYY/MM/DD for... |
<reponame>chrinide/AutoML_Alex
from .base import *
import lightgbm as lgb
import numpy as np
import pandas as pd
class LightGBM(ModelBase):
"""
Args:
params (dict or None): parameters for model.
If None default params are fetched.
"""
__name__ = 'LightGBM'
def _init_defaul... |
#!/usr/bin/env python
# coding: utf-8
import sys
import os
from datetime import datetime, timedelta
import urllib
import matplotlib as mpl
# mpl.use("Agg")
import matplotlib.pyplot as plt
import numpy as np
import scipy.stats
from scipy.integrate import odeint
import scipy.signal
import pandas as pd
import seaborn as ... |
<reponame>sdolenc/aws-elastic-beanstalk-cli
# Copyright 2015 Amazon.com, Inc. or its affiliates. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"). You
# may not use this file except in compliance with the License. A copy of
# the License is located at
#
# http://aws.amazon.com/apa... |
import re
import requests
from requests.auth import HTTPBasicAuth
from utils.io_utils import IOUtils
class RestApiService:
def __init__(self, connection):
self.conn = connection
def upload_file(self, remote_path, local_path):
url_format = f"{self.conn.get('protocol')}://{self.conn.get('ip')}... |
<reponame>Robertzzel/DHCP-Client_Server<gh_stars>0
from tkinter import StringVar
from tkinter import Tk, NORMAL, DISABLED, END
from Dhcp.packet import Packet
from Dhcp.server_options import ServerOptions
from threading import Thread
from Commons.timer import Timer
from typing import Optional
from datetime import dateti... |
<gh_stars>10-100
from copy import deepcopy
import csv
import io
import json
import logging
import re
import time
import uuid
import hashlib
import arrow
from psycopg2 import sql
from psycopg2.extras import LoggingConnection, LoggingCursor
from target_postgres import json_schema, singer
from target_postgres.exceptions... |
#!/usr/bin/env python
#
#
# Table Of Contents
# -----------------
# 1. Configuration Parser
# 2. Container Types
# 3. Source Control
# 4. Node Model
# 5. Command-Line Interface
from __future__ import print_function, division
import os, sys, subprocess, re, socket, shutil, collections
import time, tempfile, shlex
impor... |
# -*- coding: utf-8 -*-
# Copyright (C) 2014-2017 <NAME> <<EMAIL>>
# Copyright (C) 2014-2017 <NAME> <<EMAIL>>
# Copyright (C) 2014-2017 <NAME> <<EMAIL>>
# Copyright (C) 2014-2017 <NAME> <<EMAIL>>
# Copyright (C) 2014-2017 <NAME> <<EMAIL>>
# This program is free software: you can redistribute it and/or modify
# it under... |
<filename>Kruskal_Prim_Spanning_Tree/utils.py
class Graph:
def __init__(self, visited=False, idx=None, adjacent=None):
"""
Generates a single node of undirected weighted graph
:param visited: To use for algorithms like DFS to check visited nodes
:param idx: Just for demonstration pu... |
<gh_stars>1-10
#!/usr/bin/env python
from collections import namedtuple
####################################### 规则 ###########################################
# DOMAIN
BLACK_DOMAIN = ['www.17k.com', 'mm.17k.com', 'www.xs8.cn', 'www.zongheng.com', 'yunqi.qq.com', 'chuangshi.qq.com',
'book.qidian.com',... |
<reponame>renmcc/bk-PaaS
# -*- coding: utf-8 -*-
"""
Tencent is pleased to support the open source community by making 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) available.
Copyright (C) 2017-2018 THL A29 Limited, a Tencent company. All rights reserved.
Licensed under the MIT License (the "License"); you may not u... |
import json
import ssl
from random import randint
from random import random
from threading import Thread
from time import sleep
from django.conf import settings
from django.test import TestCase
from websocket import create_connection
# class ModelTest(TestCase):
#
# def test_gender(self):
# user = UserProfile(sex_... |
<filename>codility/prefix_sum_genomic_range_query_dna_sequence.py
def solution(S, P, Q):
"""
https://app.codility.com/demo/results/training8QBVFJ-EQB/
100%
Idea is consider solution as single dimensional array and use concept of prefix some ie.
stores the value in the array for p,c and g based on f... |
<reponame>victordomingos/snowy
#!/usr/bin/env python3
from bs4 import BeautifulSoup, Comment
from pygments import highlight
from pygments.formatters import HtmlFormatter
from pygments.lexers import PythonLexer
import CommonMark
import inspect
import numpy as np
import os
import pygments.styles
import subprocess
impo... |
<filename>mcpython/client/gui/InventoryPlayerHotbar.py<gh_stars>1-10
"""
mcpython - a minecraft clone written in python licenced under the MIT-licence
(https://github.com/mcpython4-coding/core)
Contributors: uuk, xkcdjerry (inactive)
Based on the game of fogleman (https://github.com/fogleman/Minecraft), licenced und... |
<reponame>signorecello/babybuddy<gh_stars>0
# -*- coding: utf-8 -*-
import pytz
from django.conf import settings
from django.contrib.auth.models import User
from django.contrib.auth.signals import user_logged_in
from django.db import models
from django.db.models.signals import post_save
from django.dispatch import rec... |
# flake8: noqa
"""
更新主力合约
"""
import os
import sys
import json
from collections import OrderedDict
import pandas as pd
vnpy_root = os.path.abspath(os.path.join(os.path.dirname(__file__), '..', '..'))
if vnpy_root not in sys.path:
sys.path.append(vnpy_root)
os.environ["VNPY_TESTING"] = "1"
from vnpy.data.tdx.tdx_... |
from os.path import join
import pandas as pd
import qiime2
import biom
import pkg_resources
import q2templates
from mmvec.heatmap import ranks_heatmap, paired_heatmaps
TEMPLATES = pkg_resources.resource_filename('mmvec.q2', 'assets')
def heatmap(output_dir: str,
ranks: pd.DataFrame,
microbe_... |
<reponame>bagustris/emotion
import logging
import time
from typing import Any, Callable, Dict, Optional, Sequence, Union
import joblib
import numpy as np
import pandas as pd
from sklearn.base import BaseEstimator
from sklearn.metrics import (
accuracy_score,
f1_score,
get_scorer,
make_scorer,
preci... |
<reponame>Prithwijit-Chak/simpeg<filename>examples/_archived/plot_inv_dcip_dipoledipole_2_5Dinversion_irls.py
"""
2.5D DC inversion of with Iterative Reweighted Least Squares
============================================================
This is an example for 2.5D DC Inversion with Iterative Reweighted
Least Squares (I... |
<filename>dobot_gym/envs/sim/dobot_env.py
import numpy as np
from gym.envs.robotics import robot_env, utils, rotations
def goal_distance(goal_a, goal_b):
assert goal_a.shape == goal_b.shape
return np.linalg.norm(goal_a - goal_b, axis=-1)
class DobotSimGoalEnv(robot_env.RobotEnv):
def __init__(self, mo... |
# GUI of ECG Signal Generator with Spectral Analysis and Filtering
# Editor: <NAME>
# Date: 24.01.2020
# Detailed script documentation in form of comments right next to the code
# Enjoy using the program!
# Installing and upgrading all necessary packages
from subprocess import call
my_packages = ['matplotli... |
<reponame>wright-group/bluesky-cmds
from collections import defaultdict
import itertools
import json
import toolz
from qtpy import QtWidgets
from bluesky_queueserver.manager.comms import zmq_single_request
from bluesky_hwproxy import zmq_single_request as hwproxy_request
import WrightTools as wt
from bluesky_cmds.pro... |
import os
import numpy as np
import h5py
import matplotlib.pyplot as plt
import pandas as pd
import pickle
import argparse
import ConfigParser
import sys
import shlex
from string import Template
import time
import argparse
import distutils.util
parser = argparse.ArgumentParser(fromfile_prefix_chars='@')
parser.a... |
# -*- coding: utf-8 -*-
# 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
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law o... |
<reponame>remotesensinginfo/eodatadown
#!/usr/bin/env python
"""
EODataDown - a set of functions to provide a simplified python interface to ARCSI.
"""
# This file is part of 'EODataDown'
# A tool for automating Earth Observation Data Downloading.
#
# Copyright 2018 <NAME>
#
# Licensed under the Apache License, Version... |
#https://raw.githubusercontent.com/PIA-Group/BioSPPy/master/biosppy/signals/tools.py
from __future__ import absolute_import, division, print_function
from six.moves import range
import six
import utils
# 3rd party
import numpy as np
import scipy.signal as ss
from scipy import interpolate, optimize
from scipy.stats ... |
<filename>PythonScripts/get_Rho.py
from netCDF4 import Dataset
import numpy as np
import pandas as pd
import canyon_tools.readout_tools as rout
#from MITgcmutils import rdmds # cant make it work
CGrid = '/ocean/kramosmu/MITgcm/TracerExperiments/CNTDIFF/run38/gridGlob.nc' # Smallest volume grid, closed bdy, no canyon.
... |
# Copyright 2019 Xilinx 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 writing, ... |
<reponame>Ensteinjun/mediapipe
# Copyright 2020 The MediaPipe 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 ... |
import pandas as pd
from datetime import datetime
import math
import pathlib
import sys
import os
# Read data downloaded from the crawler
def read_data(path):
try:
data = pd.read_excel(path, engine="odf")
return data
except Exception as excep:
sys.stderr.write(
"'Não foi p... |
<reponame>tswicegood/bokeh
# -*- coding: utf-8 -*-
import numpy as np
import scipy.special
from bokeh.plotting import *
mu, sigma = 0, 0.5
measured = np.random.normal(mu, sigma, 1000)
hist, edges = np.histogram(measured, density=True, bins=50)
x = np.linspace(-2, 2, 1000)
pdf = 1/(sigma * np.sqrt(2*np.pi)) * np.exp... |
<reponame>vltmedia/ROMP
import cv2
import keyboard
import imageio
import torch
import numpy as np
import random
from transforms3d.axangles import axangle2mat
import pickle
from PIL import Image
import torchvision
import time
import os,sys
import config
import constants
from config import args
from utils import save_ob... |
# coding:utf-8
"""
pybilibili.network
----------------------
所有爬虫函数
:copyright: (c) 2016 <NAME>
:license: BSD
"""
from bs4 import BeautifulSoup
from colorama import Fore, Style
import dicts
import json
import urllib
import requests
import time
import re
import os
import math
... |
# -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'mainwindow_first_window.ui'
#
# Created by: PyQt5 UI code generator 5.15.0
#
# WARNING: Any manual changes made to this file will be lost when pyuic5 is
# run again. Do not edit this file unless you know what you are doing.
from PyQt5 imp... |
import argparse
from collections import OrderedDict
import getpass
import sys
import textwrap
import uuid
from course_seeder import CourseSeeder
from discussions_seeder import DiscussionsSeeder
def setup_course_in_studio(args):
"""
Setup studio and return the created course_id
"""
print "Studio url s... |
# coding: utf-8
# std
import string
from datetime import timedelta, datetime
import csv
import os
import shutil
import sys
# math
import math
import numpy as np
from scipy.sparse import *
# mabed
import mabsed.utils as utils
import json
class Corpus:
def __init__(self, input_files, stopwords, corpus_directory, ... |
<filename>VideoCameraRayIntersection/VideoCameraRayIntersection.py
import os
import vtk
import qt
import slicer
import numpy as np
import logging
from slicer.ScriptedLoadableModule import ScriptedLoadableModule, ScriptedLoadableModuleWidget, ScriptedLoadableModuleLogic, ScriptedLoadableModuleTest
# VideoCameraRayInter... |
<gh_stars>0
"""
clock.py
Displays a clock with background image on a LILYGO® TTGO T-Display.
The buttons on the module can be used to set the time.
Background images courtesy of the NASA image and video gallery available at
https://images.nasa.gov/
The Font is Copyright 2018 The Pacifico Project... |
import board
from kmk.boards.macropact import KMKKeyboard
from kmk.keys import KC, make_key
from kmk.rotary_encoder import Encoder
from kmk.ips import IPS, ips_config
keyboard = KMKKeyboard()
#keyboard.debug_enabled = True
def onRotateA(direction):
if(direction > 0):
keyboard._state.tap_key(KC.LSFT(KC.R... |
<filename>app/database.py
from sqlalchemy import create_engine, distinct, func, desc
from sqlalchemy.orm import sessionmaker
from geoalchemy2 import functions as geo_func
from datetime import datetime, timedelta
import config
from base import Base
from schema import Tweet, Hashtag, Picture, Division
import codecs, json... |
# 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, Optional, Sequence, Union, overload
from .. import... |
from math import exp
from scipy import optimize
'''
References
-----------
[1] <NAME>, <NAME>, and <NAME>, "PV panel model based on datasheet values," in Industrial Electronics, 2007. ISIE 2007. IEEE International Symposium on, 2007, pp. 2392-2396.
'''
class ParameterExtraction(object):
boltzmann_constant = 1.38... |
<gh_stars>0
# emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*-
# vi: set ft=python sts=4 ts=4 sw=4 et:
### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ##
#
# See COPYING file distributed along with the PyMVPA package for the
# copyright and license terms.
#
### ###... |
<filename>arkane/kinetics.py
#!/usr/bin/env python3
###############################################################################
# #
# RMG - Reaction Mechanism Generator #
# ... |
<filename>parton/test_lhapdf.py
import unittest
from . import pdf, io
import shutil
import tempfile
lhapdf_CT10 ={
(-4, 1e-08, 10.0): 12.126009150675591,
(-4, 1e-08, 56.23413251903491): 41.02476133438564,
(-4, 1e-08, 316.22776601683796): 88.09606590653031,
(-4, 1e-08, 1778.2794100389228): 153.7780144766072,
(-4,... |
import librosa
import librosa.display
import matplotlib.pyplot as plt
import numpy as np
import os
import sys
import logging
from scipy.spatial.distance import cdist
colors = {'pink': '\033[95m', 'blue': '\033[94m', 'green': '\033[92m', 'yellow': '\033[93m', 'red': '\033[91m',
'ENDC': '\033[0m', 'bold': '\033[1... |
<reponame>IoT-Inspector/unblob<filename>tests/handlers/executable/test_elf.py<gh_stars>10-100
import pytest
from helpers import unhex
from unblob.file_utils import File
from unblob.handlers.executable.elf import ELF64Handler
from unblob.models import ValidChunk
ELF_CONTENT = unhex(
"""\
00000000 7f 45 4c 46 02 0... |
import numpy as np
from scipy.interpolate import splev
###############################################################################
class FinCurveFitMethod():
pass
###############################################################################
class FinCurveFitPolynomial():
def __init__(self, power=3... |
# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved
# -*- coding: utf-8 -*-
import logging
import typing
import torch
from fvcore.nn import activation_count, flop_count, parameter_count, parameter_count_table
from torch import nn
from detectron2.structures import BitMasks, Boxes, ImageList, Instanc... |
<reponame>souravsingh/chainercv
import itertools
import numpy as np
import os
import six
from chainercv.evaluations.eval_detection_coco import _redirect_stdout
from chainercv.evaluations.eval_detection_coco import _summarize
try:
import pycocotools.coco
import pycocotools.cocoeval
import pycocotools.mask ... |
<filename>server_common/ioc_data_source.py
from __future__ import print_function, absolute_import, division, unicode_literals
import six
"""
Data source for ioc data
"""
from server_common.mysql_abstraction_layer import DatabaseError
from server_common.utilities import print_and_log
PV_INFO_FIELD_NAME = "info_field"... |
<gh_stars>0
"""Package for learning complete games from data
The API of this individual module is still unstable and may change as
improvements or refinements are made.
There are two general game types in this module: learned games and deviation
games. Learned games vary by the method, but generally expose methods fo... |
<filename>InductionApplet.py
# -*- coding: cp1252 -*-
#!/usr/bin/jython
import copy, pawt, java # , re
from javax.swing import JApplet, JLabel, JList, JTextArea, JButton, JRadioButton, \
ButtonGroup, JTextPane, JPanel, JOptionPane, \
ListSelectionModel, DefaultListModel
f... |
<gh_stars>0
# BSD 3-Clause License; see https://github.com/scikit-hep/uproot4/blob/main/LICENSE
"""
This module defines an :doc:`uproot.interpretation.Interpretation` and
temporary array for string data.
Note that :doc:`uproot.interpretation.strings.AsStrings` is an interpretation for
top-level strings, but :doc:`upr... |
<gh_stars>0
import time
import math
import config
import constants as c
from nltk import Tree
import re
def log_print(*args, **kwargs):
"""
A simple wrapper of the built-in print function.
It prints only if configuration.VERBOSE is true
"""
if "verbosity" in kwargs:
verbosity = kwargs["verbosity"... |
<reponame>sterin/pywrapper<filename>wrap_apis.py
import subprocess
import BeautifulSoup
import urllib2
import re
bases = [
"abstract",
"allocation",
"arg",
"bool",
"buffer",
"bytearray",
"capsule",
"cell",
"class",
"cobject",
"codec",
"code",
"complex",
"concrete... |
import copy
import json
import os
from jsonschema.validators import Draft4Validator
from semDiff.compareEntities import EntityCoverage
from utils.schema2context import process_schema_name
class EntityMerge:
""" A class that merge two schemas based on their semantic annotations
:param schema1: dictionary of t... |
<filename>photoshop/api/application.py
"""The Adobe Adobe Photoshop CC application object.
Which is the root of the object model and provides access to all other
objects. This object provides application-wide information,
such as application defaults and available fonts. It provides many important
methods, such as tho... |
#!/bin/python3
#Utilities for downloading and parsing Final Fantasy 14 Loadstone content
#Copyright <NAME> 2016 BSD 3 clause license
import requests
from bs4 import BeautifulSoup
import re
def loastone_login():
print('http://na.finalfantasyxiv.com/lodestone/account/login/')
#Get a page from the Loadstone
# retur... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.