text stringlengths 957 885k |
|---|
<reponame>dennlinger/hypergraph-document-store<filename>old_eval/createPlotsFromRuntime.py
"""
Taken from the runtime evaluation, compare the results for dyadic queries and their hypergraph counterparts.
"""
import numpy as np
import matplotlib.pyplot as plt
import pandas as pd
def compareFrequencyImpact(data, conta... |
"""
"""
import configparser
import os
import pathlib
from tkinter.simpledialog import askstring
import psycopg2
def verif_ha_entidade_selecionada(cfg_ini_file):
for each_ent in cfg_ini_file['Entities']:
if cfg_ini_file['Entities'].getboolean(each_ent):
return True
return False
def va... |
import Tkinter as tk
import ScrolledText as tkst # a convenience module that ships with Tkinter
from .toolkit.popups import *
from .toolkit.ribbon import *
from .toolkit import theme
from . import icons
from .. import vector, raster
style_layeroptions_info = {"fg": theme.font1["color"],
"... |
# Copyright 2020 The StackStorm Authors.
# Copyright 2019 Extreme Networks, 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 ... |
import os
import zipfile as zp
import pandas as pd
import numpy as np
import core
import requests
class Labels:
init_cols = [
'station_id', 'station_name', 'riv_or_lake', 'hydroy', 'hydrom', 'day',
'lvl', 'flow', 'temp', 'month']
trans_cols = [
'date', 'year', 'month', 'day', 'hydroy', 'hydrom', 'station_id'... |
import os
import time
import visdom
import seaborn as sns
import pandas as pd
import matplotlib.pyplot as plt
from experiment_interface.hooks import Hook
from experiment_interface.logger import get_train_logger
from experiment_interface.plot_utils import plot_trainval_loss, plot_val_lossacc
from experiment_interface.co... |
<gh_stars>0
import csv
import numpy as np
from scipy.optimize import curve_fit
import matplotlib.pyplot as plt
import maxwell as m
omega = []
storG = []
lossG = []
dFactor = []
cVisc = []
with open('1skupina.csv', 'rb') as csvfile:
for i in range(0,5):
next(csvfile)
podatki = csv.reader(csvfile)
f... |
from django.views.generic.base import View
from django.views.generic.edit import ModelFormMixin, ProcessFormView
from django.views.generic.list import (MultipleObjectMixin,
MultipleObjectTemplateResponseMixin)
from django.http.response import Http404
class CreateFormBaseView(Mod... |
<filename>pyLib/analysisTools.py<gh_stars>1-10
import numpy as np
import sys
try:
import scipy.stats as st # contains st.entropy
except:
pass
'''
Description:
Author: <NAME>
<EMAIL>
University of Helsinki &
Finnish Meteorological Institute
'''
# =*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*... |
<filename>cropduster/models.py<gh_stars>0
import re
import shutil
import time
import uuid
import os
import datetime
import hashlib
import itertools
import urllib
from PIL import Image as pil
from django.core.exceptions import ValidationError
from django.db import models
from django.db.models.fields.related import Rev... |
<gh_stars>100-1000
from typing import Optional, List, Dict
from ontobio.model.similarity import AnnotationSufficiency
from ontobio.vocabulary.upper import HpoUpperLevel
from ontobio.sim.api.interfaces import InformationContentStore
import numpy as np
from statistics import mean
class AnnotationScorer:
"""
Com... |
import os
from copy import deepcopy
import dill
import pytest
import torch
from torch.optim import SGD, Adadelta, Adagrad, Adam, RMSprop
from pythae.customexception import BadInheritanceError
from pythae.models.base.base_utils import ModelOutput
from pythae.models import RHVAE, RHVAEConfig
from pythae.trainers import... |
"""
Copyright BOOSTRY Co., Ltd.
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 distr... |
from fastapi import APIRouter, Depends
from ..database.connection import get_database
from ..crud.user_opinions import fetch_user_opinions, fetch_user_opinion_by_id, add_user_opinion, fetch_user_opinions_by_user_id, fetch_user_opinion_with_movie_id
from ..models.user_opinion import UserOpinion, UserOpinionIns, UserOpin... |
"""
Zombie Apocalypse mini-project
Using Breadth-First 2D Search
Principles of Computing Part 2
Author: <NAME>
Date: 7/14/15
CodeSkulptor source:
http://www.codeskulptor.org/#user40_iQQZl747fQ_13.py
"""
import random
import poc_grid
import poc_queue
import poc_zombie_gui
# global constants
EMPTY = 0
FULL = 1
FOUR_... |
<gh_stars>1-10
"""
Test timetable generation.
"""
import datetime
import pytest
from nextbus import db, models
from nextbus.timetable import (_query_journeys, _query_timetable, Timetable,
TimetableRow, TimetableStop)
SERVICE = 645
DIRECTION = False
GMT = datetime.timezone(datetime.ti... |
<gh_stars>1-10
# sparse_tester
# Tester file
# import the necessary packages
import numpy as np
import matplotlib.pyplot as plt
from numpy import array, zeros, diag, diagflat, dot
import pandas as pd
from keras.models import Sequential, load_model
from scipy.sparse.linalg import spsolve
import os
import ten... |
<filename>coord2vec/pipelines/build_CLSTRs_cv.py
import logging
import random
import time
from datetime import datetime
from functools import partial
import numpy as np
import pandas as pd
from lagoon.dags import DAG
from lagoon.executors.local_executor import LocalExecutor
from simpleai.search.local import hill_climb... |
# This an autogenerated file
#
# Generated with NonLinearForceModel
from typing import Dict,Sequence,List
from dmt.entity import Entity
from dmt.blueprint import Blueprint
from .blueprints.nonlinearforcemodel import NonLinearForceModelBlueprint
from typing import Dict
from sima.riflex.dampingmatrixcalculationoption im... |
# Copyright 2020, <NAME>
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, soft... |
<filename>code/perception.py
import numpy as np
import cv2
# Identify pixels above the threshold
# Threshold of RGB > 160 does a nice job of identifying ground pixels only
def color_thresh(img, rgb_thresh=(160, 160, 160)):
# Create an array of zeros same xy size as img, but single channel
color_select = np.zer... |
<filename>google/ads/google_ads/v1/proto/services/domain_category_service_pb2.py
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: google/ads/googleads_v1/proto/services/domain_category_service.proto
import sys
_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1'))
from google.pr... |
"""Handle database functions for the stitcher utility."""
from .db import temp_db
def connect(temp_dir, db_prefix):
"""Create DB connection."""
cxn = temp_db(temp_dir, db_prefix)
return cxn
# ############################## reference genes #############################
def create_reference_genes_table(... |
<filename>testCNN/cnn.py
from keras.models import Sequential
from keras import layers
import pandas as pd
from sklearn.model_selection import train_test_split
import numpy as np
from keras.preprocessing.sequence import pad_sequences
from keras.preprocessing.text import Tokenizer
from sklearn.preprocessing import OneHot... |
<reponame>897615138/tfsnippet-jill<filename>tests/layers/core/test_dense.py
import numpy as np
import tensorflow as tf
from tests.helper import assert_variables
from tests.layers.helper import l2_normalize
from tests.layers.core.test_gated import safe_sigmoid
from tfsnippet.layers import dense
from tfsnippet.utils imp... |
import sys
from django import forms
from django.db import models
from django.http import QueryDict
from django.test import RequestFactory, TestCase
from django.utils.datastructures import MultiValueDict
from django_genericfilters import views
from django_genericfilters.forms import FilteredForm
from six.moves import ... |
import xml.etree.ElementTree as ET
from xmlobject import XMLObject
from helpers import Struct
from pose import Pose
class XMLReader(XMLObject):
"""
A class to handle reading and parsing of XML files for the simulator and
parameters configuration files.
"""
_file = None
_root = None
def _... |
import struct
import dns
import dns.rdtypes.txtbase, dns.rdtypes.svcbbase
import dns.rdtypes.ANY.CDS, dns.rdtypes.ANY.DLV, dns.rdtypes.ANY.DS
def _strip_quotes_decorator(func):
return lambda *args, **kwargs: func(*args, **kwargs)[1:-1]
# Ensure that dnspython agrees with pdns' expectations for SVCB / HTTPS par... |
<filename>tests/sparkml/test_linear_classifier.py
# SPDX-License-Identifier: Apache-2.0
import sys
import unittest
import inspect
import os
import numpy
import pandas
from pyspark.ml.classification import LogisticRegression, LinearSVC
from pyspark.ml.linalg import VectorUDT, SparseVector
from onnx.defs import onnx_ops... |
<filename>Blackjack.py
#!/usr/bin/env python3
# Blackjack.py - by <NAME>
from random import shuffle
from collections import deque
from itertools import product
import os
from decimal import Decimal
import re
def clearscreen():
if(os.name == "posix"):
os.system('clear')
else:
os.system('cls')
... |
#
# Copyright (c) 2017 Juniper Networks, Inc. All rights reserved.
#
"""
VNC pod management for kubernetes
"""
import uuid
from vnc_api.vnc_api import *
from config_db import *
from kube_manager.common.kube_config_db import NamespaceKM
from kube_manager.common.kube_config_db import PodKM
from vnc_kubernetes_config i... |
<reponame>drzaxx/UAV3Dbeamforming
import tensorflow as tf
import numpy as np
import scipy.io as io
from tensorflow.python.keras import *
N = 100000
t = 2 # (,*) dimension of G
# parameters
N_x, N_y, N_b, N_e = 4, 4, 6, 6
c_a = np.array([[0], [0], [0]])
c_b = np.array([[-100], [150], [200]])
# c_e = np.array([[100], [... |
# automatically generated by the FlatBuffers compiler, do not modify
# namespace: flattrs_test
import flatbuffers
class AllScalarsWithDefaults(object):
__slots__ = ['_tab']
@classmethod
def GetRootAsAllScalarsWithDefaults(cls, buf, offset):
n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, ... |
# -*- coding: utf-8 -*-
import tensorflow as tf
import numpy as np
import pandas as pd
import h5py
import random
import os
from VITAE import VITAE, get_igraph, leidenalg_igraph, load_data
file_name = 'mouse_brain_merged'
data = load_data(path='data/',
file_name=file_name)
seed = 0
random.seed(seed)
n... |
# configuration steps import
import subprocess
import traceback
from nedgeBlockerException import NedgeBlockerException
from steps.firewallCheck import FirewallCheck
from steps.baseConfigurationStep import BaseConfigurationStep
from steps.nedeployRCConfig import NedeployRCConfig
from steps.nedeployBashActivation impor... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Wed Sep 16 10:35:20 2020
@author: p20coupe
"""
import argparse
import sys
import joblib
import numpy as np
import matplotlib
matplotlib.use('TkAgg')
import matplotlib.pyplot as plt
import os
import math
import statistics
import torch
from torch import nn... |
<reponame>ColCarroll/simulation_based_calibration
"""Simulation based calibration (Talts et. al. 2018) in PyMC3."""
import itertools
import logging
import matplotlib.pyplot as plt
import numpy as np
import pymc3 as pm
from tqdm import tqdm
class quiet_logging:
"""Turn off logging for certain libraries.
PyMC... |
<reponame>gieses/xiRT<gh_stars>1-10
"""Module for constants in the xirt package."""
from xirt import __version__
learning_params = f"""
# Learning options generated with xiRT v. {__version__}
# the preprocessing options define how the sequences are encoded / filtered. Usually, default values
# are fine.
# If transfer... |
<reponame>krusagiz/OctoBot
import os
import time
from bs4 import BeautifulSoup
from selenium import webdriver
from selenium.webdriver.common.keys import Keys
from util.Driver.role import isAdmin
from util.ScrapeAdmin.admin import viewAccountPages
from prettytable import PrettyTable
paginationXpath = "/html/body/for... |
# Author: <NAME>
# The Global Anigner class, provided Global Alignment using Needleman-Wunsch algorithm.
import collections
import os
import numpy as np
from score_matrix_generator import generate_score_matrix
# the Aligner class
class Aligner:
def __init__(self, sigma=5, bayes=True, onlyBayes=False):
... |
<reponame>HighSaltLevels/Randomizer<filename>randomizer/app.py<gh_stars>0
""" Module for loading the app UI """
import sys
from PyQt5.QtWidgets import QWidget, QApplication, QGridLayout
from PyQt5.QtGui import QIcon
from ui_elements import label, spinbox, check_box, combo_box, button, line_edit, browse
from ui_eleme... |
<filename>adas.py
import os
import errno
import shutil
import urllib.request, urllib.parse, urllib.error
import ssl
open_adas = 'https://open.adas.ac.uk/'
class OpenAdas(object):
def search_adf11(self, element, year='', ms='metastable_unresolved'):
p = [('element', element), ('year', year), (ms, 1),
... |
<filename>2021/18/solve.py<gh_stars>0
import os.path
from itertools import permutations
from functools import reduce
from copy import deepcopy
INPUT=os.path.join(os.path.dirname(__file__), "input.txt")
with open(INPUT) as f:
data = f.read()
def add_to_list(s, k, init_index, second_index):
index=init_index
... |
<reponame>eproje/uPy_Course
# SOURCE: https://www.mfitzp.com/article/3d-rotating-cube-micropython-oled/
from machine import I2C, Pin
import ssd1306
import math
i2c = I2C(scl=Pin(18), sda=Pin(19), freq=400000)
display=ssd1306.SSD1306_I2C(128,64,i2c)
class Point3D:
def __init__(self, x = 0, y = 0, z = 0):
s... |
<reponame>pmeier/torchssim<filename>torchssim/ssim.py
from collections import namedtuple
import torch
from torch.nn.functional import relu
from torchimagefilter import ImageFilter
__all__ = [
"SSIMReprenstation",
"SSIMContext",
"SimplifiedSSIMContext",
"calculate_ssim_repr",
"calculate_luminance",
... |
import os
from os.path import join
import cv2
import numpy as np
from collections import defaultdict
def dictload(dirpath = 'data/train.txt'):
f = open(dirpath, "r")
labelDict = dict()
validateDict = defaultdict(list)
validateList = list()
while True:
line = f.readline()
if line:
... |
<gh_stars>0
# -*- coding: utf-8 -*-
import os
import socket
import json
import http.client as httplib
from uPHue import *
class Bridge(object):
""" Interface to the Hue ZigBee bridge
"""
def __init__(self, ip=None, username=None, config_file_path=None):
""" Initialization function.
Pa... |
<gh_stars>1-10
import matplotlib
import matplotlib.pyplot as plt
matplotlib.use('Qt5Agg') # Apple doesn't like Tkinter (TkAgg backend) so I needed to change the backend to 'Qt5Agg'
import statsmodels.api as sm
import numpy as np
import os
import pandas as pd
from numpy import genfromtxt
from os import makedirs
from os... |
#! /usr/bin/python
# -*- coding: utf-8 -*-
from __future__ import absolute_import, division, print_function
from mindspore.nn import optim as optimizer
import mindspore as ms
from mindspore.nn import Cell
__all__ = ['Adadelta', 'Adagrad', 'Adam', 'Adamax', 'Ftrl', 'Nadam', 'RMSprop', 'SGD', 'Momentum', 'Lamb', 'LARS'... |
<reponame>jakemcaferty/pyesg<gh_stars>10-100
"""Wiener Process"""
from typing import Dict, List, Union
import numpy as np
from pyesg.stochastic_process import StochasticProcess
from pyesg.utils import to_array
class WienerProcess(StochasticProcess):
"""
Generalized Wiener process: dX = μdt + σdW
Example... |
from tkinter import *
import time
import random
root = Tk()
root.title("bb")
root.geometry("450x570")
root.resizable(0, 0)
root.wm_attributes("-topmost", 1)
canvas = Canvas(root, width=600, height=600, bd=0, highlightthickness=0, highlightbackground="white", bg="Black")
canvas.pack(padx=10, pady=10)
score ... |
from tensorflow.keras import layers
from tensorflow.keras.activations import swish
from tensorflow.nn import relu6
def relu(x):
return layers.ReLU()(x)
def hard_sigmoid(x):
return layers.ReLU(6.0)(x + 3.0) * (1.0 / 6.0)
def hard_swish(x):
return layers.Multiply()([hard_sigmoid(x), x])
class Convolut... |
###################################################
## ##
## This file is part of the KinBot code v2.0 ##
## ##
## The contents are covered by the terms of the ##
## BSD 3-clause license included in the LICENSE ##
## file,... |
<filename>menpo/landmark/labels/human/face.py
from collections import OrderedDict
import numpy as np
from ..base import (
validate_input, connectivity_from_array, pcloud_and_lgroup_from_ranges,
connectivity_from_range, labeller_func)
@labeller_func(group_label='face_ibug_68')
def face_ibug_68_to_face_ibug_68... |
import abc
import asyncio
import logging
import random
import threading
from typing import Any, Mapping, Optional, Union
from async_timeout import timeout
from logstash import LogstashFormatterVersion1
from .log import logger
class BaseLogstashHandler(logging.Handler):
def __init__(
self,
*,
... |
<reponame>arosen93/QMOF
import pandas as pd
from sklearn.kernel_ridge import KernelRidge
from sklearn.model_selection import train_test_split
from sklearn.preprocessing import MinMaxScaler
from sklearn.metrics import mean_absolute_error, r2_score
from scipy.stats import spearmanr
import numpy as np
import os
# Setting... |
<filename>CUCM/greenfield-deployment.py<gh_stars>0
import csv
from requests import Session
from requests.auth import HTTPBasicAuth
import csv
import pandas as pd
from lxml import etree
import getpass
from zeep import Client, Settings, Plugin, xsd
from zeep.transports import Transport
from zeep.exceptions import Fault
... |
<reponame>imamsolikhin/Python<filename>app/helper/network.py<gh_stars>0
# -*- coding: utf-8 -*-
"""Input module based on expect, used to retrieve information from devices using a command line interface (CLI)"""
# builtin modules
import re
import telnetlib
import socket
import logging
import types
import time
# local m... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import web, json
from config import setting
import app_helper,lbs
db = setting.db_web
url = ('/app/locate_shop')
# 定位门店
class handler:
def POST(self):
web.header('Content-Type', 'application/json')
param = web.input(app_id='', type='', data='', sign='')
... |
import os
import pytest
import yaml
from jina import __default_executor__
from jina.serve.executors import BaseExecutor
from jina.helper import expand_dict
from jina.helper import expand_env_var
from jina.jaml import JAML
cur_dir = os.path.dirname(os.path.abspath(__file__))
@pytest.fixture(scope='function')
def te... |
<filename>src/pudl/convert/censusdp1tract_to_sqlite.py
"""
Convert the US Census DP1 ESRI GeoDatabase into an SQLite Database.
This is a thin wrapper around the GDAL ogr2ogr command line tool. We use it
to convert the Census DP1 data which is distributed as an ESRI GeoDB into an
SQLite DB. The module provides ogr2ogr ... |
<filename>common/candle/__init__.py<gh_stars>1-10
from __future__ import absolute_import
#__version__ = '0.0.0'
#import from data_utils
from data_utils import load_csv_data
from data_utils import load_Xy_one_hot_data2
from data_utils import load_Xy_data_noheader
from data_utils import drop_impute_and_scale_dataframe
... |
import numpy
import random
import matplotlib.pyplot as plt
from source.matplotlib_player import Player
import sys
from PyQt5.QtWidgets import QMessageBox, QApplication
class Cell:
def __init__(self):
self.state = 0
class GameOfLife:
def __init__(self, turns=10, dimensions=(16, 16),
... |
#!/usr/bin/python3
'''
script for calculating daily usage of each ingredient used in food based on recipes it also combines the sales and staff
meals files into one
'''
import os
import json
from openpyxl import load_workbook, Workbook
def calculate_usage(row):
global recipes, ingredient_names
# get category... |
<filename>bin/py/SecretsManagerLambda.py
from __future__ import print_function
from botocore.exceptions import ClientError
import boto3
import json
import logging
from urllib.request import urlopen, Request, HTTPError, URLError
from urllib.parse import urlencode
logger = logging.getLogger()
logger.setLevel(logging.IN... |
<reponame>pincoin/rakmai<filename>member/forms2.py
import json
import urllib
from allauth.account.forms import (
LoginForm, ResetPasswordForm, ResetPasswordKeyForm, AddEmailForm, ChangePasswordForm, SetPasswordForm
)
from crispy_forms.bootstrap import PrependedText
from crispy_forms.helper import (
FormHelper,... |
<reponame>Thetacz/nautobot-plugin-netbox-importer
"""Extras class definitions for nautobot-netbox-importer.
Note that in most cases the same model classes are used for both NetBox imports and Nautobot exports.
Because this plugin is meant *only* for NetBox-to-Nautobot migration, the create/update/delete methods on the... |
<reponame>nfriedri/debie-backend-1
import json
from flask import jsonify
import JSONFormatter
import calculation
from bias_evaluation import weat, ect, k_means, bat
import logging
# Computes bias evaluation methods for a bias specification
def return_bias_evaluation(methods, arguments, content):
logging.info("A... |
import warnings
from pathlib import Path
from typing import Union
import numpy as np
import torch
from torch.utils.data import DataLoader
from torchvision import transforms
from tqdm.auto import tqdm
from hakai_segmentation.geotiff_io import GeotiffReader, GeotiffWriter
from hakai_segmentation.models import _Model
... |
<reponame>ska-telescope/tmc-prototype
# Standard python import
import logging
# Additional import
from ska.base.control_model import ObsState
from tmc.common.tango_client import TangoClient
from tmc.common.tango_server_helper import TangoServerHelper
from .device_data import DeviceData
from . import const
from time i... |
<gh_stars>0
import math
import struct
import sys
from enum import Enum
from typing import List
from . import Utilities
class BinFloatFormat(Enum):
"""Binary format of a float number."""
Single_4bytes = 1
Single_4bytes_swapped = 2
Double_8bytes = 3
Double_8bytes_swapped = 4
class BinIntFormat(Enum):
"""Binary... |
<filename>test/functional/feature_llmq_is_retroactive.py
#!/usr/bin/env python3
# Copyright (c) 2015-2020 The Dash Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
from test_framework.mininode import *
from test_fra... |
<reponame>AMLab-Amsterdam/DataAugmentationInterventions<gh_stars>10-100
"""Pytorch Dataset object that loads MNIST and SVHN. It returns x,y,s where s=0 when x,y is taken from MNIST."""
import os
import numpy as np
import torch
import torch.utils.data as data_utils
from torchvision import datasets, transforms
import to... |
import os, time
import selenium
from selenium import webdriver
#os.getcwd()
#os.chdir('C:/Users/Caio/repos/nba-models')
# start browser crawler
browser = webdriver.Firefox()
# grab season player stat per game
scrapeBbalRef(2018, 2018, 'https://www.basketball-reference.com/leagues/NBA_*SEASON*_per_game.html','per_game... |
<reponame>anton-sidelnikov/openstacksdk
# 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... |
""" PagerMaid Plugin Coin by Pentacene """
# ______ _
# | ___ \ | |
# | |_/ /__ _ __ | |_ __ _ ___ ___ _ __ ___
# | __/ _ \ '_ \| __/ _` |/ __/ _ \ '_ \ / _ \
# | | | __/ | | | || (_| | (_| __/ | | | __/
# \_| \___|_| |_|\__\__,_|\___\___|_| |_|\___|
#
from asyncio import sleep
from... |
import warnings
from pathlib import Path
import astropy.units as u
import matplotlib.pyplot as plt
import pandas as pd
from astropy.coordinates import SkyCoord
from sunpy.map import Map, MapSequence
from sunpy.net import Fido
from sunpy.net import attrs as a
from sunpy.net import hek
from sunpy.util import SunpyUserWa... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
'''
+-------------------------------------------------
@Author: cc
@Contact: <EMAIL>
@Site: http://www.xjh.com
@Project: sobookscrawler
@File: book_model.py
@Version:
@Time: 2019-06-06 15:22
@Description: TO-DO
+----... |
<filename>PYTHON_LESSON/emp.py
#一、类和实例的定义
# class Employee: #定义一个类
# pass
# emp_1 = Employee() #调用这个类
# emp_2 = Employee()
# print(emp_1)
# print(emp_2)
# #创建对象,给对象赋值
# emp_1.first='john'
# emp_1.last='work'
# emp_1.email='<EMAIL>'
# emp_1.pay=10000
# emp_2.first='mike'
# emp_2.last='little'
# emp_2.e... |
"""
Consolidate Services
Description of all APIs # noqa: E501
The version of the OpenAPI document: version not set
Generated by: https://openapi-generator.tech
"""
import re # noqa: F401
import sys # noqa: F401
from argocd_python_client.api_client import ApiClient, Endpoint as _Endpoint
from arg... |
'''
Excited States software: qFit 3.0
Contributors: <NAME>, <NAME>, and <NAME>.
Contact: <EMAIL>
Copyright (C) 2009-2019 Stanford University
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software withou... |
<reponame>mmmaaaggg/easytrader<gh_stars>1-10
# -*- coding: utf-8 -*-
"""
Created on 2017/9/19
@author: MG
"""
import win32gui
import re
# def _filter_trade_client(hwnd, hwnd_list, filter_func):
# if filter_func(hwnd):
# hwnd_list.append(hwnd)
def filter_confirm_win_func(hwnd):
# 找到classname = '#3277... |
<reponame>andbortnik/thenewboston-node
from datetime import datetime, timedelta
from unittest.mock import patch
import pytest
from thenewboston_node.business_logic.blockchain.mock_blockchain import MockBlockchain
from thenewboston_node.business_logic.models import (
Block, BlockMessage, CoinTransferSignedChangeRe... |
import csv
import pdb
import json
import ast
import re
import numpy as np
import spacy
import string
MAX_USEFUL_LEN = 100
MAX_TARGET_LEN = 50
nlp = spacy.load("en_core_web_sm")
def get_filtered_tokens_spacy(text):
doc = nlp(text, disable=["ner", "parser", "tagger"])
tokenized_text = [str(... |
# encoding : UTF-8
from pygame import Vector3
from math import sqrt
from Settings import G
def find_initial_velocity(origin_pos, target_pos, wanted_height):
"""
Return initial velocity to apply to a ball to reach a target from an origin position and a specified height.
Process initial velocity in world coordina... |
<gh_stars>0
import numpy as np
import h5py
import random
import tensorflow as tf
from tensorflow.python.keras.layers import Lambda
import tensorflow.python.keras.backend as K
import os
AUTOTUNE = tf.data.experimental.AUTOTUNE
class DataGenerator:
"""
CropsGenerator takes care to load images from disk and con... |
<reponame>surveybott/psiTurk<filename>tests/conftest.py
from __future__ import print_function
# https://docs.pytest.org/en/latest/fixture.html#using-fixtures-from-classes-modules-or-projects
from builtins import object
import pytest
import os
import sys
import pickle
import json
import datetime
import dateutil.parser
i... |
<gh_stars>0
#!usr/bin/env python3
import json
import ssl
from collections import namedtuple
from concurrent.futures import ThreadPoolExecutor
from datetime import datetime
from urllib.request import urlopen
User = namedtuple('User', 'login name joined')
def user_info(login):
"""Get user information from github""... |
# Copyright (c) 2020, 2021, Oracle and/or its affiliates.
#
# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl/
#
from utils import tutil
from utils import kutil
from .cluster_t import check_all
import logging
from utils.tutil import g_full_log
from utils.optesting ... |
<gh_stars>0
#!/usr/bin/env python
import numpy as np
import glob
import telescope_1d
flist = glob.glob ('out/*_*_*_0_*_*.npy')
#flist = glob.glob ('out/16_4096_*_0_*_*.npy')
#flist += glob.glob ('out/20_4096_*_0_*_*.npy')
for fname in flist:
fname = fname.replace('.npy','').replace('out/','').split('_')
ndish... |
from functools import partial
from unittest.mock import Mock
from unittest.mock import patch
import numpy as np
import pytest
class TestPrintLog:
@pytest.fixture
def print_log_cls(self):
from skorch.callbacks import PrintLog
keys_ignored = ['dur', 'event_odd']
return partial(PrintLog,... |
<reponame>arassadin/sgpn
import numpy as np
from scipy import stats
import matplotlib.pyplot as plt
import matplotlib as mpl
import json
mpl.use('Agg')
############################
## Ths Statistics ##
############################
def Get_Ths(pts_corr, seg, ins, ths, ths_, cnt):
pts_in_ins = {}
for i... |
#!/usr/bin/env python3
from threading import Thread, Lock
import sys
import rospy
from hiwonder_servo_driver.hiwonder_servo_serialproxy import SerialProxy
from hiwonder_servo_msgs.msg import CommandDurationList
from hiwonder_servo_controllers.action_group_runner import ActionGroupRunner
from hiwonder_servo_controllers... |
<gh_stars>1-10
#!/usr/bin/env python3
import logging
from datetime import datetime, time, timedelta
from typing import Optional
from ..building.interface import Shutter
from . import task
from .interface import Trigger
from .job import Job
from .jobmanager import JobManager
from .task import Task, Open, Tilt, Close
fr... |
from tkinter import *
from tkinter import ttk as ttk
import tkinter.messagebox as msgbox
import core_module as cm
import webbrowser
from tkinter import filedialog
root = Tk()
root.title("Arcalive Lastorigin Searcher 1.1.0")
root.geometry("640x480+600+300")
root.resizable(False, False)
##############################... |
"""
The qiprofile clinical Mongodb data model.
"""
import re
import math
import mongoengine
from mongoengine import (fields, ValidationError)
from .. import choices
from .common import (Encounter, Outcome, TumorExtent)
POS_NEG_CHOICES = [(True, 'Positive'), (False, 'Negative')]
"""The Boolean choices for Positive/Neg... |
import tensorflow as tf
class LabelMap(object):
def __init__(self,
character_set=None,
label_offset=2,
ignore_case=True,
unk_label=None):
if character_set is None:
character_set = list('abcdefghijklmnopqrstuvwxyz1234567890')
if not isinstanc... |
<reponame>movermeyer/SeqFindR
# Copyright 2013-2014 <NAME>-Cook Licensed under the
# Educational Community 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.osedu.org/licenses/ECL-2.0
#
# ... |
from os import listdir
from os.path import isfile, join
import sys
import re
import argparse
# Python 3.6+
# relies on dict insertion order
roman2arabic = {"chrI":"chr1","chrII":"chr2","chrIII":"chr3","chrIV":"chr4","chrV":"chr5",
"chrVI":"chr6","chrVII":"chr7","chrVIII":"chr8","chrIX":"chr9","chrX":"chr10",
"ch... |
from datetime import timedelta
from flask import Flask, flash, redirect, render_template, request, session, abort, url_for
import models as dbHandler
import os
import nltk
import io
import operator
from magpie import Magpie
import csv
magpie = Magpie()
import speech_recognition as sr
app = Flask(__name__)
@app.route("/... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.