text stringlengths 957 885k |
|---|
<reponame>flatearthws/nearest-satellites<gh_stars>0
#!/usr/bin/env python
import ephem
from datetime import datetime, timedelta
from math import cos, sqrt
from operator import itemgetter
import statistics
# TLE file
tlefile = 'tle.txt'
# ISS name in the TLE file
refbodyname = '0 ISS (ZARYA)'
# start of analysis (90 ... |
"""
Filesystem file tree
"""
import filecmp
import hashlib
import itertools
import os
import pathlib
from datetime import datetime
from zoneinfo import ZoneInfo
from magic import Magic
from .exceptions import FilesystemError
from .patterns import match_path_patterns
from .utils import current_umask
#: Files and di... |
<reponame>nutti/Introduction-to-Addon-Development-in-Blender-Web
import bpy
from bpy.props import FloatProperty, EnumProperty
bl_info = {
"name": "サンプル 2-3: オブジェクトを並進移動するアドオン②",
"author": "ぬっち(Nutti)",
"version": (3, 0),
"blender": (2, 80, 0),
"location": "3Dビューポート > オブジェクト",
"description": "ア... |
<filename>interactive_text_to_sql/src/utils/link_util.py
# coding: utf-8
import json
from typing import List
from src.utils.utils import lemma_token
STOP_WORD_LIST = [_.strip() for _ in open('data/common/stop_words.txt', 'r', encoding='utf-8').readlines()]
def align_two_sentences_in_token_level(token_list1, token... |
<filename>lib/bullseye.py
import copy
import math
import scipy
import scipy.spatial
import numpy as np
from skimage import measure
def mask2sectors(endo_mask, epi_mask, rv_mask, rvi_mask, num_sectors):
"""
Split myocardium to num_sectors sectors
Input :
endo_mask : [RO, E1], mask for endo
epi_mask... |
config='''import os, sys, re, clr, math
try:
dll_dir='C:/Program Files/AnsysEM/AnsysEM19.3/Win64/common/IronPython/DLLs'
if not os.path.isdir(dll_dir):
raise Exception
except:
m=re.search('(.*Win64)', __file__)
dll_dir=m.group(1)+'/common/IronPython/DLLs'
finally:
sys.path.append(dll_dir)
... |
<filename>prdl/prdl.py
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
from download import download
import eyed3
from eyed3.id3 import ID3_V2_4
from mutagen.mp3 import MP3
from mutagen.id3 import ID3, APIC, error
import hashlib
import os
from slugify import slugify
import requests
import urllib
import urllib.request
i... |
<gh_stars>0
# --------------
import pandas as pd
from sklearn import preprocessing
#path : File path
# Code starts here
# read the dataset
dataset = pd.read_csv(path)
# look at the first five columns
dataset.head()
# Check if there's any column which is not useful and remove it like the column id
dataset = datas... |
<gh_stars>1-10
import csv
import io
from collections import defaultdict
from dataclasses import dataclass
from typing import Dict, List, Set, Any, Tuple, Iterable
from django.conf import settings
from django.template.loader import render_to_string
from django.utils.timezone import now
from pytz import timezone
from a... |
from dataclasses import dataclass
from enum import Enum
import logging
import re
import sre_constants
import sre_parse
import typing
import z3 # type: ignore
# Z3 Node Constants
app_labels = z3.Function('app_labels', z3.StringSort(), z3.StringSort())
app_label_keys = z3.Function('app_label_keys', z3.Str... |
<reponame>teresa-ho/stx-nova<gh_stars>0
# Copyright 2015 IBM Corp.
#
# 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
#
# Unles... |
<reponame>MikeAT/visualizer
# Copyright 2021 Internet Corporation for Assigned Names and Numbers.
#
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, you can obtain one at https://mozilla.org/MPL/2.0/.
#
# Developed by Sin... |
from .providers import esi
from .models import Fleet, FleetInformation
from esi.models import Token
from celery import shared_task
from django.utils import timezone
from concurrent.futures import ThreadPoolExecutor, as_completed
import logging
logger = logging.getLogger(__name__)
@shared_task
def open_fleet(characte... |
<reponame>zhupangithub/WEBERP
# -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# ... |
<gh_stars>1-10
# -*- coding: utf-8 -*-
import os.path
import numpy as np
import collections
import matplotlib.pyplot as plt
from matplotlib import style
from tqdm import tqdm
from .autograd import Variable
def timer(func):
'''
decorator function that will print the excecution time of a function.
''... |
<reponame>obroomhall/AutoGIF<filename>clipsnip/gif_extractor.py
import os
import re
import subprocess
import syllables
from pysubs2 import SSAEvent, SSAFile
from scenedetect.detectors import ContentDetector
from scenedetect.frame_timecode import FrameTimecode
from scenedetect.scene_manager import SceneManager
from sce... |
<filename>backend/marche/settings.py<gh_stars>1-10
import os
import environ
# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
root = environ.Path(__file__) - 3
env = environ.Env(
DEBUG=(bool, False)
)
env_file = os.path.... |
import requests
import io
import os
KATSU_URL = os.getenv("KATSU_URL")
def post_data(url, data):
response = requests.post(url, json=data)
print(response.json())
return response.json()
def get_project_id(project_title):
'''
does a post request to /api/projects
creates a project with the proj... |
# Copyright 2018 Google Inc. 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 applicable law or... |
# -*- coding: utf-8 -*-
""" The Exp3 randomized index policy.
Reference: [Regret Analysis of Stochastic and Nonstochastic Multi-armed Bandit Problems, S.Bubeck & N.Cesa-Bianchi, §3.1](http://research.microsoft.com/en-us/um/people/sebubeck/SurveyBCB12.pdf)
See also [Evaluation and Analysis of the Performance of the EX... |
"""Module for DataArray accessor classes."""
__all__ = ["add_accessors"]
# standard library
from collections import defaultdict
from functools import lru_cache
from itertools import chain
from inspect import getsource, signature
from re import sub
from textwrap import dedent
from types import FunctionType
from typing... |
<gh_stars>0
# Copyright (c) 2014 OpenStack Foundation
#
# 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... |
<gh_stars>0
from django.db import models
from enum import Enum
# Create your models here.
class Student(models.Model):
'''
เก็บข้อมูลรายชื่อนักเรียน
first_name ชื่อนักเรียน
last_name นามสกุลนักเรียน
code รหัสนักเรียน
sex เพศ
'''
class SexChoiceEnum(Enum):
male = '1'
frem... |
<gh_stars>0
# noinspection PyUnusedLocal
# skus = unicode string
def checkout(skus):
product_dict = {
'A': 50,
'B': 30,
'C': 20,
'D': 15,
'E': 40,
'F': 10,
'G': 20,
'H': 10,
'I': 35,
'J': 60,
'K': 70,
'L': 90,
... |
<reponame>elephanting/minimal-hand
import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d import Axes3D
from mpl_toolkits.mplot3d.art3d import Poly3DCollection
import numpy as np
import cv2
def plot3d(joints_,ax, title=None):
joints = joints_.copy()
ax.plot(joints[:, 0], joints[:, 1], joints[:, 2], 'yo', la... |
<filename>Source/Tools/TrainList_CityScape.py
# -*- coding: utf-8 -*-
import os
import glob
def OutputData(outputFile, data):
outputFile.write(str(data) + '\n')
outputFile.flush()
TrainListPath = './Dataset/trainlist_CityScape.txt'
CLSLabelListPath = './Dataset/labellist_cls_CityScape.txt'
DispLabelListPat... |
from pathlib import Path
from typing import NamedTuple, Optional, List, Dict
from logzero import logger
from arbitrageur.request import request_cached_pages
class ItemUpgrade(NamedTuple):
upgrade: str
item_id: int
class Item(NamedTuple):
id: int
chat_link: str
name: str
type_name: str
... |
<reponame>laurentlb/tensorflow
# Copyright 2016 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... |
<filename>manila/tests/scheduler/test_scheduler.py
# Copyright 2010 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in ... |
<reponame>musterchef/OpenMoBu
#
# Shaders Graph Exporter
#
# Sergey <Neill3d> Solokhin 2018
#
# function to bake - BakeShadersGraphEdits(objNS, xmlname)
import os
import time
import subprocess
from pyfbsdk import *
from xml.dom import minidom
import FbxShadersGraphMisc as misc
#####################################... |
# -*- coding: utf-8 -*-
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: mediapipe/calculators/util/landmarks_to_render_data_calculator.proto
from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _message
from google.protobuf import reflection as _reflection
f... |
<filename>lambda/api/addChannel/addChannel.py
# API - null
# 1. Create new Medialive Input
# 2. Create MediaPackage Channel
# 3. Create MediaPackage Distrubution
# 4. Create new Medialive Channel
# 5. Save Channel Detail to DDB
import boto3
import json
import uuid
import os
# BOTO3
medialive = boto3.client('medialive... |
import collections
import functools
import statistics
from . import base
from . import precision
from . import recall
__all__ = [
'F1Score',
'MacroF1Score',
'MicroF1Score',
'RollingF1Score',
'RollingMacroF1Score',
'RollingMicroF1Score'
]
class BaseF1Score:
@property
def bigger_is_b... |
from . import engine as css_engine
from .constants import (
ALIGN_CONTENT_CHOICES, ALIGN_ITEMS_CHOICES, ALIGN_SELF_CHOICES, AUTO,
BORDER_COLOR_CHOICES, BORDER_STYLE_CHOICES, BORDER_WIDTH_CHOICES,
BOX_OFFSET_CHOICES, CLEAR_CHOICES, DIRECTION_CHOICES, DISPLAY_CHOICES,
FLEX_BASIS_CHOICES, FLEX_DIRECTION_CH... |
import csv
import pdb
import pickle
import sys
from collections import defaultdict
from operator import itemgetter
import numpy as np
np.seterr(all='raise')
from bs4 import BeautifulSoup as BS
from nltk.corpus import wordnet as wn
from numpy.linalg import norm
from scipy import sparse as sp
from ALaCarte.compute import... |
from django.shortcuts import render, render_to_response
from django.views.generic import TemplateView
from Proyecto.models import *
import json
from django.shortcuts import render, redirect
from django.core.exceptions import PermissionDenied
from django.http import Http404
from django.http import HttpResponseRedirect,... |
# ----------------------------------------------------------------------------
# Copyright (c) 2013--, scikit-bio development team.
#
# Distributed under the terms of the Modified BSD License.
#
# The full license is in the file COPYING.txt, distributed with this software.
# --------------------------------------------... |
import unittest, sys, os
python2 = sys.version_info < (3, 0, 0)
if python2:
from StringIO import StringIO
else:
from io import StringIO
from bibtex_merger.core import *
from bibtex_merger.extension import *
class test_core(unittest.TestCase):
###########
# __init__
###########
def test_base1(self):
... |
<filename>plugins/modules/oci_devops_repository_commit_facts.py<gh_stars>100-1000
#!/usr/bin/python
# Copyright (c) 2020, 2021 Oracle and/or its affiliates.
# This software is made available to you under the terms of the GPL 3.0 license or the Apache 2.0 license.
# GNU General Public License v3.0+ (see COPYING or https... |
from regress import *
from util import *
from dateutil import parser as dateparser
def calc_hl_daily(full_df, horizon):
print("Caculating daily hl...")
result_df = full_df.reset_index()
# result_df = filter_expandable(result_df)
result_df = result_df[['close', 'high', 'low', 'date', 'ind1', '... |
#!/usr/bin/python
# encoding: utf-8
"""
@author: Ian
@file: SMA.py
@time: 2019-10-01 03:56
Fast Moving Average: 短期移动均线,因为窗口越小,均线对价格的灵敏度越高,改变越fast
本质:趋势交易,利用均线的迟滞降低扰动
优点:降低扰动,可以过滤掉噪音,从而显著降低交易频率
主要缺点:
1、由于均线的迟滞,会错过初期的那部分涨幅。
但这是趋势交易不可以避免的结果,否则就是逆势抄底了。。。
2、股票走势一般呈现一种缓涨急跌的走势,这时均线的迟滞就会造成大的回撤
改进措施:
可以通过仓位管理来降低回撤:
如买入时,全仓买入。... |
<filename>decode_beam.py
import operator
import torch
import torch.nn as nn
import torch.nn.functional as F
# from Queue import PriorityQueue
from queue import PriorityQueue
device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
SOS_token = 0
EOS_token = 1
MAX_LENGTH = 50
class DecoderRNN(nn.Module):... |
import subprocess
import tempfile
import uuid
from typing import List, Optional, Iterable
from envparse import env
VERSION = 2
JOB_CONFIG_TEMPLATE = """
labels:
type: "{label_type}"
owner: "{label_owner}"
version: "{version}"
trainingInput:
scaleTier: CUSTOM
masterType: n1-standard-4
args:{model_dirs}{fi... |
<filename>journalism/table.py
#!/usr/bin/env python
"""
This module contains the Table object.
"""
try:
from collections import OrderedDict
except ImportError: # pragma: no cover
from ordereddict import OrderedDict
from journalism.columns import ColumnMapping, NumberType
from journalism.exceptions import Col... |
<filename>pyemvue/__main__.py
import sys
import datetime
import json
import dateutil
# Our files
from pyemvue.enums import Scale, Unit
from pyemvue.customer import Customer
from pyemvue.device import VueDevice, VueDeviceChannel, VueDeviceChannelUsage
from pyemvue.pyemvue import PyEmVue
def main():
errorMsg = 'Ple... |
from typing import Any, Dict, List, Optional, Tuple, Type, Union
import gym
import numpy as np
import torch as th
from torch.nn import functional as F
from stable_baselines3.common.buffers import ReplayBuffer
from stable_baselines3.common.noise import ActionNoise
from stable_baselines3.common.off_policy_algorithm imp... |
<reponame>khromiumos/chromiumos-chromite
# -*- coding: utf-8 -*-
# Copyright (c) 2012 The Chromium OS Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Run lint checks on the specified files."""
from __future__ import print_function
... |
import numpy as np
from gpsearch import recommend, custom_KDE, funmin
def mll(m_list, inputs, pts=None, y_list=None, t_list=None):
"""Mean log loss as defined in (23) of Merchant and Ramos, ICRA 2014.
Parameters
----------
m_list : list
A list of GPy models generated by `OptimalDesign`.
i... |
<filename>tools/validators/instance_validator/validate/handler.py<gh_stars>0
# Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the License);
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/L... |
<reponame>pulsar-chem/BPModule
#!/usr/bin/env python3
import os
import sys
import traceback
import array
# Add the pulsar path
thispath = os.path.dirname(os.path.realpath(__file__))
psrpath = os.path.join(os.path.dirname(thispath), "../", "modules")
parent = os.path.join(os.path.dirname(thispath))
sys.path.insert(0,... |
<filename>pipeline/core/data/context.py
# -*- coding: utf-8 -*-
"""
Tencent is pleased to support the open source community by making 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community
Edition) available.
Copyright (C) 2017-2020 THL A29 Limited, a Tencent company. All rights reserved.
Licensed under the MIT License (the "License")... |
import numpy as np
import torch
import torch.utils.data
from torch import nn, optim
from torch.nn import functional as F
from gridworld.algorithms.models import layer_init
class MLP2(nn.Module):
def __init__(self, input_dim, hidden_dim=64, feature_dim=64, num_outputs=1):
super().__init__()
se... |
#
# Copyright (c) 2020 Seagate Technology LLC and/or 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 required by ap... |
import logging
import json
import paho.mqtt.client as mqttc
from ioctlgw import version
from ioctlgw.componentstate import ComponentState
LOG = logging.getLogger(__name__)
class MqttConnector(object):
def __init__(self, service):
self.service = service
self.config = self.service.config
s... |
import codecs
import game
from hacktools import common
def writeLine(out, pos, byte, line, functions):
pos -= 16
function = ""
if pos in functions:
function = functions[pos] + " "
del functions[pos]
out.write(str(pos).zfill(5) + " 0x" + common.toHex(byte) + ": " + line + " " + functio... |
#!/usr/bin/env python
# coding: utf-8
import torch.nn as nn
def init_weights(m):
""" initialize weights of fully connected layer
"""
if type(m) == nn.Linear:
nn.init.xavier_uniform_(m.weight)
m.bias.data.fill_(0.01)
# autoencoder with hidden units 20, latent, 20
# Encoder
class Encoder_2... |
<reponame>TescaF/point_cloud_io
#!/usr/bin/env python
import rospy
from std_msgs.msg import String
from geometry_msgs.msg import PoseStamped, Pose, Point, Quaternion
import numpy as np
import math
def publish():
pub = rospy.Publisher('pose_truth', PoseStamped, queue_size=10)
rospy.init_node('talker', anonymous... |
<reponame>steelee/minnow_max_maker
# Copyright (c) 2014 Intel Corporation, All Rights Reserved
# Author: <NAME>
#
# 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 without restriction, includin... |
<reponame>ckolumbus/WikidPad.svn<gh_stars>1-10
import re
import wx, wx.xrc
from wxHelper import *
from . import SystemInfo
from .StringOps import uniToGui, guiToUni, colorDescToRgbTuple,\
rgbToHtmlColor, strToBool, splitIndent, escapeForIni, unescapeForIni
from .AdditionalDialogs import Dateform... |
<reponame>xiaoxiae/Vimvaldi<filename>vimvaldi/components.py
"""The module containing all of the components logic."""
from __future__ import annotations
import curses
import logging # DEBUG; TO BE REMOVED
import os
import sys
from abc import ABC, abstractmethod
from typing import *
from signal import signal, SIGINT
... |
import enum
from typing import List
from sqlalchemy.orm.session import Session
from newsbot.core.constant import SourceName, SourceType
from newsbot.core.sql import database
from newsbot.core.sql import tables
from newsbot.core.sql.tables import ITables, Sources
from newsbot.core.sql.exceptions import FailedToAddToData... |
# Copyright (c) 2020 PaddlePaddle 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 applic... |
<filename>vsphere/tests/test_api_rest.py
# (C) Datadog, Inc. 2019-present
# All rights reserved
# Licensed under Simplified BSD License (see LICENSE)
import logging
import pytest
from mock import MagicMock
from pyVmomi import vim
from datadog_checks.vsphere import VSphereCheck
from datadog_checks.vsphere.api_rest imp... |
from mpi4py import MPI
import process_helpers.wordCloud as wordCloud
import process_helpers.bagOfWords as bagOfWords
import process_helpers.sentimentAnalysis as sentimentAnalysis
import process_helpers.outputter as outputter
import configs
import pandas as pd
from collections import OrderedDict
import re # we can do "... |
<reponame>solcummings/ntire2021-sar
import os
import torch
import torch.nn as nn
import torchvision
class InitializationMixin:
"""
Mixin for pytorch models that allows pretraining of Imagenet models and initialization
of parameters.
methods:
pretrain_file: loads model from file to state_dict
... |
#!/usr/bin/env python
"""
mbed SDK
Copyright (c) 2011-2013 ARM Limited
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 ... |
import nibabel
import numpy as np
from ..heart import ahaseg
import matplotlib.pyplot as plt
from os.path import join, basename
def get_loc(num, got_apex):
loc = dict()
if got_apex> 0:
#got_apex = True
loc[3] = [1]*1 + [2]*1 + [3]*1
loc[4] = [1]*1 + [2]*2 + [3]*1
loc[5] = [1... |
<gh_stars>1-10
# %%
from pathlib import Path
import PIL
import matplotlib.pyplot as plt
import numpy as np
import os
import SimpleITK as sitk
# enable lib loading even if not installed as a pip package or in PYTHONPATH
# also convenient for relative paths in example config files
os.chdir(Path(__file__).resolve().... |
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may ... |
from .Ticket import Ticket, StateTicket
################################################################################
################################################################################
################################################################################
###############################... |
<reponame>gokudomatic/cobiv
from collections import deque
from datetime import datetime
import copy
from cobiv.libs.templite import Templite
from cobiv.modules.core.entity import Entity
from cobiv.modules.core.session.cursor import Cursor
class CoreVariables:
def __init__(self, session):
self.session = ... |
"""
Calculates pixels shifts between two COS NUV spectra.
This script can be used to determine the shift (in pixels) of one
spectrum with respect to another. The cross correlation between
S1 and S2 is determined and a non-linear fit to the peak of the
correlation is used to determine the exact offset.
:requires: Pyth... |
# coding=utf-8
"""
Tests provided sorting algorithms under many cases.
"""
import random
import unittest
from unittest.mock import Mock
from numpy import testing as nptest
from collections import namedtuple
from acnportal.algorithms import *
from acnportal.algorithms.tests.generate_test_cases import *
from acnportal.a... |
# -*- coding:utf-8 -*-
from collections import OrderedDict
import torch.nn as nn
from mmdet.models.utils import brick as vn_layer
class TinyYolov3(nn.Module):
def __init__(self, pretrained=None):
super(TinyYolov3, self).__init__()
# Network
layer0 = [
# backbone
O... |
<filename>lite/tests/unittest_py/model_test/run_model_test.py
# Copyright (c) 2022 PaddlePaddle 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://ww... |
<filename>python/dlxapi/models/expand_component.py
# coding: utf-8
"""
Decision Lens API
No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) # noqa: E501
OpenAPI spec version: 1.0
Generated by: https://github.com/swagger-api/swagger-codegen.git
... |
# -*- coding: utf-8 -*-
from warnings import warn
import matplotlib.animation
import matplotlib.pyplot as plt
import numpy as np
from ..misc import NeuroKitWarning
def complexity_embedding(signal, delay=1, dimension=3, show=False):
"""Time-delay embedding of a signal
A dynamical system can be described by ... |
from sigman import analyzer
import numpy as np
import pickle
from sigman.analyzer import InvalidArgumentError
procedure_type = 'points'
description = (
"""
Procedure searching for dicrotic notches based on BP and ECG signals
by using a trained neural network.
It also makes use of SBP points to narrow the searching ... |
import sys
from termcolor import colored, cprint
def debug(*objects): print(objects)
# def debug(*objects): 1
# dims = [300, 275]
# ur_pos = [150, 150]
# g_pos = [185, 100]
# dist = 500
# dims = [42, 59]
# ur_pos = [34, 44]
# g_pos = [6, 34]
# dist = 5000
################################
'''
## Forewords:
+ BUG rep... |
import os
import uuid
import logging
from typing import Union
from pydano.cardano_cli import CardanoCli
from pydano.cardano_temp import tempdir
from pydano.query.protocol_param import ProtocolParam
from pydano.transaction.transaction_config import TransactionConfig
from pydano.transaction.miniting_config import Mintin... |
import uuid
import pytest
from aiobaro import __version__
def test_version():
assert __version__ == "0.1.0"
@pytest.mark.asyncio
async def test_login_info(matrix_client):
result = await matrix_client.login_info()
assert result.ok
@pytest.mark.asyncio
async def test_register(matrix_client):
resul... |
<gh_stars>10-100
# vim: set encoding=utf-8
# Copyright (c) 2016 Intel Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
... |
import logging
import random
import re
import tempfile
import uuid
from enum import Enum, auto
from importlib import import_module
from pathlib import Path
from typing import List, Callable, Any, Dict, Union, Optional
import attr
from configuror import Config
from fake_useragent import UserAgent, FakeUserAgentError
f... |
<gh_stars>0
import json
import logging
import re
import traceback
from django.http import HttpResponse
from django.conf import settings
from .oauthclient import *
from requests.exceptions import RequestException
log = logging.getLogger('app_logging')
important_headers = (
'HTTP_ACCESSTOKEN',
... |
# coding=utf-8
# Copyright 2021 The Google Research 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 applicab... |
# This file will track sectors and will provide get/set interface for sectors.
import numpy as np
import math
import time
import rospy
import yaml
from grid_map_msgs.srv import GetGridMap
import multiprocessing as mp
import queue
class RayTracer:
NUMBER_OF_PROCESSES = 4
def __init__(self):
mp.set_sta... |
<filename>sdks/python/apache_beam/moremmr/file_storage.py
import os
import uuid
import pandas as pd
from azure.storage.blob import AppendBlobService, BlockBlobService, PublicAccess
class FileStorage(object):
def __init__(self, container_name):
self.account_name = 'moremmrparsingstorage'
self.accoun... |
<reponame>Cinofix/secml
"""
.. module:: CPlot
:synopsis: A standard plot.
.. moduleauthor:: <NAME> <<EMAIL>>
.. moduleauthor:: <NAME> <<EMAIL>>
"""
import inspect
import sys
from matplotlib.axes import Axes
from secml.core import CCreator
from secml.array import CArray
from secml.array.array_utils import tuple_s... |
<reponame>Johnzhjw/MOE-DGNAS
# -*- coding: utf-8 -*-
from MOP_GNN_torch import MyProblem # 导入自定义问题接口
import sys
import os
import datetime
import argparse
import torch
import numpy as np
import random
from dgl.data import register_data_args, load_data
from search_space import MacroSearchSpace
class Logger(object):
... |
from typing import Optional, List, Dict, Union
import numpy as np
from gensim.models import KeyedVectors
from sklearn.feature_selection import chi2
from sklearn.feature_extraction.text import CountVectorizer, TfidfVectorizer
GensimKeyedVectors = KeyedVectors
NumpyArray = np.array
def embed(
text: List[str],
... |
<reponame>ejnnr/steerable_pdos
import numpy as np
import math
from e2cnn.kernels.basis import KernelBasis
from e2cnn.kernels.utils import offset_iterator
from e2cnn.group import Group, IrreducibleRepresentation
from e2cnn.group import cyclic_group, dihedral_group, so2_group, o2_group
from e2cnn.group import CyclicGr... |
#!/usr/bin/env python
# coding=utf-8
import os, re, sys
from datetime import datetime
import twitter # https://pypi.python.org/pypi/twitter
import pytz # https://pypi.python.org/pypi/pytz
import ConfigParser
# Credits:
# http://stackoverflow.com/questions/4563272/how-to-convert-a-python-utc-datetime-to-a-local-dateti... |
<filename>examples/01-web/12-dom.py
from __future__ import print_function
from __future__ import unicode_literals
from builtins import str, bytes, dict, int
import os
import sys
sys.path.insert(0, os.path.join(os.path.dirname(__file__), "..", ".."))
from pattern.web import URL, DOM, plaintext
from pattern.web import... |
<reponame>NWYLZW/right-click-helper
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
from math import sin, cos, sqrt, acos
from typing import ClassVar
from PyQt5.QtCore import Qt, pyqtSignal, QTimer
from PyQt5.QtGui import QPaintEvent, QPainter, QColor, QPainterPath
from PyQt5.QtWidgets import QLabel, QHBoxLayout, QWidg... |
<reponame>Covarians/dash-echarts<filename>dash_echarts/examples/heat.py
import dash_echarts
import dash, random
from dash.dependencies import Input, Output
import dash_html_components as html
import dash_core_components as dcc
from dash.exceptions import PreventUpdate
def gen_data(num):
result = []
for i in r... |
from OpenGL.GL import *
from OpenGL.GLUT import *
from OpenGL.GLU import *
import sys
import copy
from math import cos, sin
# ArcBallT and this tutorials set of points/vectors/matrix types
from ArcBall import *
PI2 = 2.0*3.1415926535 # 2 * PI (not squared!) // PI Squared
# ***********************... |
# pylint: disable=W0611
'''
Kivy Base
=========
This module contains core Kivy functionality and is not intended for end users.
Feel free to look though it, but calling any of these methods directly may well
result in unpredicatable behavior.
Event loop management
---------------------
'''
__all__ = (
'EventLoo... |
# -*- coding: utf-8 -*-
"""
Created on Thu Oct 5 16:44:23 2017
@author: <NAME>
This python library contains some useful functions to deal with
prime numbers and whole numbers.
Overview:
isPrime(number)
sieveEr(N)
getPrimeNumbers(N)
primeFactorization(number)
greatestPrimeFactor(number)
smallestPrimeFactor(number)
... |
<reponame>MILeach/FLAMEGPU2_dev
import pytest
from unittest import TestCase
from pyflamegpu import *
MODEL_NAME = "something"
AGENT_NAME1 = "something2"
AGENT_NAME2 = "something3"
class ModelDescriptionTest(TestCase):
def test_name(self):
m = pyflamegpu.ModelDescription(MODEL_NAME)
# Model has... |
from typing import Dict, Any
import pytest
import yaml
from pydantic import ValidationError
from fidesops.graph.config import (
CollectionAddress,
ScalarField,
ObjectField,
FieldAddress,
FieldPath,
)
from fidesops.graph.graph import DatasetGraph, Edge
from fidesops.models.datasetconfig import conv... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.