max_stars_repo_path string | max_stars_repo_name string | max_stars_count int64 | id string | content string | add_param_types int64 | add_return_types int64 | add_class_field_types int64 | add_instance_field_types int64 | add_total int64 | add_error int64 |
|---|---|---|---|---|---|---|---|---|---|---|
test/restful/test_base.py | thenetcircle/dino | 150 | 3267987 | # 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... | 0 | 0 | 0 | 0 | 0 | 0 |
eventlet/zipkin/client.py | li-caspar/eventlet_0.30.2 | 5,079 | 3267991 | <reponame>li-caspar/eventlet_0.30.2
import base64
import warnings
from scribe import scribe
from thrift.transport import TTransport, TSocket
from thrift.protocol import TBinaryProtocol
from eventlet import GreenPile
CATEGORY = 'zipkin'
class ZipkinClient(object):
def __init__(self, host='127.0.0.1', port=941... | 0 | 0 | 0 | 0 | 0 | 0 |
tests/test_cbook.py | gerritholl/MetPy | 819 | 3267998 | <reponame>gerritholl/MetPy<gh_stars>100-1000
# Copyright (c) 2018 MetPy Developers.
# Distributed under the terms of the BSD 3-Clause License.
# SPDX-License-Identifier: BSD-3-Clause
"""Test functionality of MetPy's utility code."""
from metpy.cbook import Registry
def test_registry():
"""Test that the registry ... | 0 | 0 | 0 | 0 | 0 | 0 |
tools/camcal/undistort.py | ParikhKadam/cycloid | 156 | 3268016 | import os
import numpy as np
import cv2
camera_matrix = np.load("camera_matrix.npy")
dist_coeffs = np.load("dist_coeffs.npy")
new_camera_matrix = np.copy(camera_matrix)
new_camera_matrix[:2, :2] /= 2.
for jpgname in os.listdir("."):
if not jpgname.endswith(".jpg"):
continue
if "undistort" in jpgname:... | 0 | 0 | 0 | 0 | 0 | 0 |
programs/pyeos/tests/python/cryptokitties/erc721metadata.py | learnforpractice/pyeos | 144 | 3268035 | <reponame>learnforpractice/pyeos
from backend import *
# @title The external contract that is responsible for generating metadata for the kitties,
# it has one function that will return the data as bytes.
class ERC721Metadata:
# @dev Given a token Id, returns a byte array that is supposed to be converted into stri... | 0 | 0 | 0 | 0 | 0 | 0 |
SLHCUpgradeSimulations/Configuration/python/postLS1CustomsPreMixing.py | ckamtsikis/cmssw | 852 | 3268064 | <reponame>ckamtsikis/cmssw
from __future__ import absolute_import
import FWCore.ParameterSet.Config as cms
from SLHCUpgradeSimulations.Configuration.muonCustomsPreMixing import customise_csc_PostLS1
from . import postLS1Customs
def customisePostLS1(process):
# apply the general 25 ns post-LS1 customisation
... | 0 | 0 | 0 | 0 | 0 | 0 |
src/python/nimbusml/internal/core/linear_model/poissonregressionregressor.py | michaelgsharp/NimbusML | 134 | 3268070 | # --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License.
# --------------------------------------------------------------------------------------------
# - Generated by tools/entrypoint_co... | 14 | 2 | 0 | 0 | 16 | 0 |
valentyusb/usbcore/sm/transfer_test.py | rjeschmi/valentyusb | 105 | 3268080 | #!/usr/bin/env python3
import unittest
from migen import *
from litex.soc.cores.gpio import GPIOOut
from ..endpoint import *
from ..io import FakeIoBuf
from ..pid import PIDTypes
from ..rx.pipeline import RxPipeline
from ..tx.pipeline import TxPipeline
from .header import PacketHeaderDecode
from .send import TxPack... | 0 | 8 | 1 | 4 | 13 | 0 |
gcsa/person.py | JulesGrd/google-calendar-simple-api | 139 | 3268082 | <reponame>JulesGrd/google-calendar-simple-api
class Person:
def __init__(self,
email=None,
display_name=None,
_id=None,
_is_self=None):
"""Represents organizer's, creator's, or primary attendee's fields.
For attendees see more in :p... | 0 | 0 | 0 | 0 | 0 | 0 |
test/test_grammars.py | clinc/parsetron | 123 | 3268096 | import os
def import_from(module, name) -> object:
module = __import__(module, fromlist=[name])
return getattr(module, name)
def test_grammars():
for fname in os.listdir("parsetron/grammars"):
if fname.endswith('.py') and not fname.startswith("__"):
module = fname[0:-3] # numbers.py... | 0 | 1 | 0 | 0 | 1 | 0 |
tests/test_wkt.py | tfardet/Shapely | 189 | 3268105 | <gh_stars>100-1000
from math import pi
import pytest
from shapely.geometry import Point
from shapely.wkt import dumps, dump, load, loads
@pytest.fixture(scope="module")
def some_point():
return Point(pi, -pi)
@pytest.fixture(scope="module")
def empty_geometry():
return Point()
def test_wkt(some_point):
... | 0 | 0 | 0 | 0 | 0 | 0 |
denet/model/train.py | lachlants/denet | 121 | 3268117 | import os
import sys
import gzip
import time
import numpy
import argparse
import math
import random
import copy
import theano
import denet.model.model_cnn as model_cnn
import denet.dataset as dataset
import denet.common.logging as logging
import denet.common as common
#compute per class error rates
def compute_error(... | 0 | 1 | 0 | 0 | 1 | 0 |
web/tests/functional/func_template/template_test.py | ryankurte/codechecker | 1,601 | 3268129 | <gh_stars>1000+
#
# -------------------------------------------------------------------------
#
# Part of the CodeChecker project, under the Apache License v2.0 with
# LLVM Exceptions. See LICENSE for license information.
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
#
# ---------------------------------... | 0 | 0 | 0 | 0 | 0 | 0 |
DS&Algo Programs in Python/phonebook.py | prathimacode-hub/HacktoberFest-2020 | 386 | 3268152 | import hashlib as hsh
phonebook = {}
def hashthat(name) -> object:
hashvalue = hsh.md5(name.encode())
hashed = hashvalue.hexdigest()
return hashed
def addContact(name, num):
h = hashthat(name)
phonebook[h] = {}
phonebook[h]['name'] = name
phonebook[h]['number'] = num
print('Success... | 0 | 1 | 0 | 0 | 1 | 0 |
tests/functional/simple_snapshot/test_renamed_source_snapshot.py | tomasfarias/dbt-core | 799 | 3268205 | <filename>tests/functional/simple_snapshot/test_renamed_source_snapshot.py
import pytest
from dbt.tests.util import run_dbt
from tests.functional.simple_snapshot.fixtures import (
seeds__seed_newcol_csv,
seeds__seed_csv,
macros__test_no_overlaps_sql,
macros_custom_snapshot__custom_sql,
)
snapshots_che... | 0 | 0 | 0 | 0 | 0 | 0 |
AttRec/model.py | jingxiufenghua/rec-model | 1,323 | 3268210 | <reponame>jingxiufenghua/rec-model
"""
Created on Nov 10, 2020
model: Next Item Recommendation with Self-Attentive Metric Learning
@author: <NAME>
"""
import tensorflow as tf
from tensorflow.keras import Model
from tensorflow.keras.layers import Embedding, Input
from tensorflow.keras.regularizers import l2
from mo... | 0 | 0 | 0 | 0 | 0 | 0 |
2021/quals/pwn-ebpf/healthcheck/healthcheck.py | BearerPipelineTest/google-ctf | 2,757 | 3268214 | <gh_stars>1000+
#!/usr/bin/env python3
# -*- 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
#
# https://www.apache.org/licenses/LICENSE-2.0
... | 0 | 0 | 0 | 0 | 0 | 0 |
Data/Transfroms.py | argusswift/SSD-pytorch | 379 | 3268336 | <reponame>argusswift/SSD-pytorch
# -*- coding: utf-8 -*-
# @Author : LG
from Utils.Boxs_op import center_form_to_corner_form, assign_priors,\
corner_form_to_center_form, convert_boxes_to_locations
from Data.Transfroms_utils import *
__all__ = ['SSDTramsfrom', 'SSDTargetTransform']
class SSDTramsfrom:
"""
... | 0 | 0 | 0 | 0 | 0 | 0 |
tests/source_app/wizard.py | ahoazure/khro-data_wizard | 279 | 3268362 | import data_wizard
from .models import CustomSource
data_wizard.set_loader(CustomSource, "tests.source_app.loaders.CustomLoader")
| 0 | 0 | 0 | 0 | 0 | 0 |
examples/early_stopping.py | NicolasHug/pygbm | 167 | 3268366 | """This example illustrates early-stopping to avoid overfitting.
Early stopping is performed on some held-out validation data, or on the
training data if validation_split is None.
"""
import numpy as np
from sklearn.datasets import make_classification
from sklearn.model_selection import train_test_split
from pygbm im... | 0 | 0 | 0 | 0 | 0 | 0 |
tests/zeus/models/test_repository.py | conrad-kronos/zeus | 221 | 3268378 | from zeus import auth, factories
from zeus.constants import Permission
from zeus.models import Repository
def test_tenant_does_not_query_repo_without_access(default_repo):
auth.set_current_tenant(auth.Tenant())
assert list(Repository.query.all()) == []
def test_tenant_queries_repo_with_tenant(default_repo):... | 0 | 0 | 0 | 0 | 0 | 0 |
samples/BBMD.py | amih90/bacpypes | 240 | 3268399 | #!/usr/bin/env python
from __future__ import annotations
"""
This sample application presents itself as a BBMD sitting on an IP network.
The first parameter is the address of the BBMD itself and the second and
subsequent parameters are the entries to put in its broadcast distribution
table.
"""
from bacpypes.debuggin... | 1 | 0 | 0 | 0 | 1 | 0 |
spotdl/lyrics/lyric_base.py | khjxiaogu/spotify-downloader | 4,698 | 3268419 | <gh_stars>1000+
import lyricwikia
from abc import ABC
from abc import abstractmethod
class LyricBase(ABC):
"""
Defined lyric providers must inherit from this abstract base
class and implement their own functionality for the below
defined methods.
"""
def from_url(self, url, linesep="\n", tim... | 0 | 0 | 0 | 0 | 0 | 0 |
rgbd_seg/criteria/builder.py | tomchol/ShapeConv | 438 | 3268429 | <filename>rgbd_seg/criteria/builder.py<gh_stars>100-1000
from ..utils import build_from_cfg
from .registry import CRITERIA
def build_criterion(cfg):
criterion = build_from_cfg(cfg, CRITERIA, mode='registry')
return criterion
| 0 | 0 | 0 | 0 | 0 | 0 |
feedhq/profiles/models.py | feedhq/feedhq | 361 | 3268437 | <gh_stars>100-1000
import json
from datetime import timedelta
import pytz
from django.conf import settings
from django.contrib.auth.models import (AbstractBaseUser, PermissionsMixin,
UserManager)
from django.db import models
from django.db.models import Max
from django.utils im... | 0 | 0 | 0 | 0 | 0 | 0 |
Bit Algorithm/Find Non-Repeated Element/SolutionByVaibhavSethia.py | rajethanm4/Programmers-Community | 261 | 3268443 | #Program to find non-repeated element
arr=list(map(int, input().split(', '))) #Input various integers in arr list
if 1< len(arr) <= 10**6: #Checking array length
for i in arr: #Taking element from arr
if 0 < i <= 10**9: #Checking element value
if arr.count(i) ==1: #Che... | 0 | 0 | 0 | 0 | 0 | 0 |
misc/5.autopep8/malaya/__init__.py | huseinzol05/Gather-Tensorflow-Serving | 267 | 3268445 | from .main import *
from .tatabahasa import *
from .num2word import to_cardinal, to_ordinal, to_ordinal_num, to_currency, to_year
from .word2vec import *
from .topic import train_lda, train_lsa, train_nmf
from .sentiment import deep_sentiment
| 0 | 0 | 0 | 0 | 0 | 0 |
test/sok_perf_test/demo/gen_data.py | xjqbest/HugeCTR | 130 | 3268471 | """
Copyright (c) 2021, NVIDIA CORPORATION.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in ... | 0 | 0 | 0 | 0 | 0 | 0 |
tests/Unit/Evolution/Systems/GeneralizedHarmonic/BoundaryConditions/DirichletMinkowski.py | nilsvu/spectre | 117 | 3268483 | <gh_stars>100-1000
# Distributed under the MIT License.
# See LICENSE.txt for details.
import numpy as np
import PointwiseFunctions.GeneralRelativity.ComputeSpacetimeQuantities as gr
def error(face_mesh_velocity, outward_directed_normal_covector,
outward_directed_normal_vector, interior_gamma1, interior_g... | 0 | 0 | 0 | 0 | 0 | 0 |
dataPrepScripts/CountNumInBed.py | strixy16/Clairvoyante | 171 | 3268484 | import os
import sys
import intervaltree
import argparse
import logging
logging.basicConfig(format='%(message)s', level=logging.INFO)
def Run(args):
Calc(args)
def Calc(args):
logging.info("Loading BED file ...")
tree = {}
f = subprocess.Popen(shlex.split("gzip -fdc %s" % (args.bed_fn) ), stdout=su... | 0 | 0 | 0 | 0 | 0 | 0 |
swyft/store/store.py | undark-lab/swyft | 104 | 3268490 | # pylint: disable=no-member, not-callable
import logging
import os
import time
from pathlib import Path
from typing import Mapping, Optional, Sequence, Tuple, Union
import fasteners
import numcodecs
import numpy as np
import zarr
import swyft
from swyft.store.simulator import SimulationStatus, Simulator
from swyft.ty... | 49 | 29 | 7 | 1 | 86 | 0 |
ztag/annotations/FtpIis.py | justinbastress/ztag | 107 | 3268528 | import re
from ztag.annotation import Annotation
from ztag.annotation import OperatingSystem
from ztag import protocols
import ztag.test
class FtpIis(Annotation):
protocol = protocols.FTP
subprotocol = protocols.FTP.BANNER
port: None = None
manufacturer_re = re.compile(
"^220[- ]Microsoft FTP... | 0 | 1 | 2 | 0 | 3 | 0 |
NLP/UNIMO/src/finetune/retrieval.py | zhangyimi/Research | 1,319 | 3268530 | # Copyright (c) 2021 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 app... | 3 | 3 | 0 | 0 | 6 | 0 |
status/api/views.py | RayGar7/SaltyFramesAPI | 277 | 3268532 | <gh_stars>100-1000
import json
from rest_framework import generics, mixins, permissions
from rest_framework.authentication import SessionAuthentication
from rest_framework.views import APIView
from rest_framework.response import Response
from django.shortcuts import get_object_or_404
from accounts.api.permissions impo... | 0 | 0 | 0 | 0 | 0 | 0 |
torchelie/nn/conv.py | maxferrari/Torchelie | 117 | 3268562 | import torch.nn as nn
from typing import Tuple, Optional, Union, cast
from .utils import remove_batchnorm, insert_after, insert_before
from .condseq import CondSeq
from torchelie.utils import kaiming, experimental
from .interpolate import InterpolateBilinear2d
def Conv2d(in_ch, out_ch, ks, stride: int=1, bias: bool=T... | 16 | 14 | 7 | 2 | 39 | 0 |
ch51-对象检测-使用Haar分类器进行面部检测/51.CascadeClassifier级联分类器.py | makelove/OpenCV-Python-Tutorial | 2,875 | 3268598 | <gh_stars>1000+
# -*- coding: utf-8 -*-
'''
以 Haar 特征分类器为基础的面部检测技术
将面部检测扩展到眼部检测等。
以 Haar 特征分类器为基础的对 检测技术是一种 常有效的对 检测 技术 2001 年 Paul_Viola 和 Michael_Jones 提出 。它是基于机器学习的 使用大 的正 样本图像 练得到一个 cascade_function 最后再用它 来做对 检测。
现在我们来学习 检测。开始时 算法 大 的正样本图像 图 像 和 样本图像 不含 的图像 来 练分类器。我们 从其中提取特 征。下图中的 Haar 特征会 使用。它们就像我们的卷积核。... | 0 | 0 | 0 | 0 | 0 | 0 |
pyecharts/_version.py | swuecho/pyecharts | 11,032 | 3268625 | <reponame>swuecho/pyecharts
__version__ = "1.9.0"
__author__ = "chenjiandongx"
| 0 | 0 | 0 | 0 | 0 | 0 |
scripts/add_copyright.py | Ehsan-aghapour/AI-Sheduling-Reprodution | 2,313 | 3268634 | #!/usr/bin/env python3
import glob
import os.path
import sys
mit_copyright = open("scripts/copyright_mit.txt",'r').read()
def add_cpp_copyright( f, content):
global mit_copyright
out = open(f,'w')
out.write("/*\n")
for line in mit_copyright.split('\n')[:-1]:
out.write(" *");
if line.st... | 0 | 3 | 0 | 0 | 3 | 0 |
pysal/explore/__init__.py | martinfleis/pysal | 941 | 3268642 | <reponame>martinfleis/pysal
import esda
import giddy
import inequality
import pointpats
import spaghetti
import segregation
| 0 | 0 | 0 | 0 | 0 | 0 |
backend/app/protocol.py | akatekhanh/flask-sound | 287 | 3268662 | """protocols to follow
"""
class response:
"""response protocol. Used to to pass messages between layers
Args:
success (bool): True or False if function succeeded
data (dict, optional): Defaults to None. otherwise a python dict
message (str, optional): Defaults to None.
acces... | 3 | 0 | 0 | 0 | 3 | 0 |
tests/basics/bytes_count.py | learnforpractice/micropython-cpp | 692 | 3268676 | print(b"".count(b""))
print(b"".count(b"a"))
print(b"a".count(b""))
print(b"a".count(b"a"))
print(b"a".count(b"b"))
print(b"b".count(b"a"))
print(b"aaa".count(b""))
print(b"aaa".count(b"a"))
print(b"aaa".count(b"aa"))
print(b"aaa".count(b"aaa"))
print(b"aaa".count(b"aaaa"))
print(b"aaaa".count(b""))
print(b"aaaa".cou... | 0 | 1 | 0 | 0 | 1 | 0 |
alipay/aop/api/domain/AlipayMarketingCampaignPrizepoolPrizeDeleteModel.py | antopen/alipay-sdk-python-all | 213 | 3268677 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import annotations
import json
from alipay.aop.api.constant.ParamConstants import *
class AlipayMarketingCampaignPrizepoolPrizeDeleteModel(object):
def __init__(self):
self._out_biz_id: None = None
self._pool_id: None = None
s... | 0 | 7 | 0 | 5 | 12 | 0 |
winapi__windows__ctypes/ctypes__FindWindow.py | DazEB2/SimplePyScripts | 117 | 3268704 | <reponame>DazEB2/SimplePyScripts
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
__author__ = 'ipetrash'
import ctypes
FindWindow = ctypes.windll.user32.FindWindowW
hwnd = FindWindow('Shell_TrayWnd', None)
print(hwnd)
| 0 | 0 | 0 | 0 | 0 | 0 |
alipay/aop/api/response/AlipayUserDtbankcustChannelvoucherconfigQueryResponse.py | antopen/alipay-sdk-python-all | 213 | 3268746 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import json
from alipay.aop.api.response.AlipayResponse import AlipayResponse
from alipay.aop.api.domain.BenefitSendTime import BenefitSendTime
from alipay.aop.api.domain.CouponEffectTime import CouponEffectTime
from alipay.aop.api.domain.CouponTemplateConsumeInfo import C... | 0 | 12 | 0 | 12 | 24 | 0 |
backend/set_path.py | Techyhans/coco-annotator | 1,584 | 3268770 | <reponame>Techyhans/coco-annotator<gh_stars>1000+
import sys
paths = [
'/workspace/'
]
for path in paths:
if path not in sys.path:
sys.path.append(path)
| 0 | 0 | 0 | 0 | 0 | 0 |
sewar/full_ref.py | parampavar/sewar | 406 | 3268799 | from __future__ import absolute_import, division, print_function
import numpy as np
from scipy import signal
from math import log2, log10
from scipy.ndimage import generic_laplace,uniform_filter,correlate,gaussian_filter
from .utils import _initial_check,_get_sigmas,_get_sums,Filter,_replace_value,fspecial,filter2,_pow... | 0 | 0 | 0 | 0 | 0 | 0 |
recipes/Python/438817_How_use_Cyrillic_fonts_ReportLab_PDF/recipe-438817.py | tdiprima/code | 2,023 | 3268811 | # ReportLab PDF library must be already installed
from reportlab.pdfgen import canvas
from reportlab.pdfbase import pdfmetrics
# Create a new canvas for cyrillic.pdf file
c = canvas.Canvas('cyrillic.pdf')
# fname - the font file name without extension
fname = 'a010013l'
# faceName - view a010013l.AFM file as a plain... | 0 | 0 | 0 | 0 | 0 | 0 |
cartography/intel/aws/ec2/elastic_ip_addresses.py | fenak/cartography | 2,322 | 3268830 | <filename>cartography/intel/aws/ec2/elastic_ip_addresses.py
import logging
from typing import Dict
from typing import List
import boto3
import neo4j
from botocore.exceptions import ClientError
from .util import get_botocore_config
from cartography.util import aws_handle_regions
from cartography.util import run_cleanu... | 0 | 0 | 0 | 0 | 0 | 0 |
examples/generation/docking_generation/MARS/estimator/scorer/scorer.py | Shicheng-Guo/TDC | 577 | 3268846 | <gh_stars>100-1000
# modifed from: https://github.com/wengong-jin/hgraph2graph/blob/master/props/properties.py
import math
import rdkit
from rdkit import Chem, DataStructs
from rdkit.Chem import AllChem
from rdkit.Chem import Descriptors
import rdkit.Chem.QED as QED
import networkx as nx
from ...common.chem import st... | 0 | 0 | 0 | 0 | 0 | 0 |
Crypto Git Repository/create_local_repo.py | DazEB2/SimplePyScripts | 117 | 3268872 | <reponame>DazEB2/SimplePyScripts<filename>Crypto Git Repository/create_local_repo.py
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
__author__ = 'ipetrash'
if __name__ == '__main__':
import api
repo = api.repo
print('Repo:', repo)
print()
api.print_log()
| 0 | 0 | 0 | 0 | 0 | 0 |
veles/tests/test_snd_file_loader.py | AkshayJainG/veles | 1,007 | 3268878 | <filename>veles/tests/test_snd_file_loader.py<gh_stars>1000+
# -*- coding: utf-8 -*-
"""
Created on May 21, 2013
Copyright (c) 2013 Samsung Electronics Co., Ltd.
"""
"""
.. invisible:
_ _ _____ _ _____ _____
| | | | ___| | | ___/ ___|
| | | | |__ | | | |__ \ `--.
| | | | __|| | | __| ... | 0 | 0 | 0 | 0 | 0 | 0 |
tests/cmd-args.py | MrConnorKenway/dg | 316 | 3268891 | #!/usr/bin/env python3
from os import listdir
from subprocess import DEVNULL, PIPE, Popen
failed = False
for f in filter(lambda x: x.startswith('llvm'), listdir()):
print(f, end='')
p = Popen(['./' + f, '--version'], stdout=DEVNULL, stderr=PIPE)
out = p.communicate()[1].decode()
if p.returncode == 0... | 0 | 0 | 0 | 0 | 0 | 0 |
tests/test_amuse.py | gusbeane/galpy | 147 | 3268896 | # Test consistency between galpy and amuse
from __future__ import print_function, division
import numpy
from galpy.orbit import Orbit
from galpy import potential
from galpy.util import conversion
from galpy.potential import to_amuse
from amuse.lab import *
from amuse.couple import bridge
from amuse.datamodel import P... | 1 | 15 | 0 | 0 | 16 | 0 |
lib/common/pe_utils.py | mkorman90/VolatilityBot | 259 | 3268901 | <gh_stars>100-1000
import logging
import string
import pefile
import magic
from pefile import PEFormatError
from lib.common.utils import calc_md5, calc_sha256, calc_imphash
IMAGE_NT_OPTIONAL_HDR32_MAGIC = hex(0x10b)
IMAGE_NT_OPTIONAL_HDR64_MAGIC = hex(0x20b)
def static_analysis(sample_dump_instance):
try:
... | 0 | 0 | 0 | 0 | 0 | 0 |
messaging/tests/test_filters.py | maznu/peering-manager | 127 | 3268928 | <gh_stars>100-1000
from django.test import TestCase
from messaging.filters import ContactFilterSet, ContactRoleFilterSet, EmailFilterSet
from messaging.models import Contact, ContactRole, Email
from utils.testing import BaseFilterSetTests
class ContactRoleTestCase(TestCase, BaseFilterSetTests):
queryset = Contac... | 0 | 0 | 0 | 0 | 0 | 0 |
javascript/defs.bzl | weilandia/selenium | 25,151 | 3268937 | <filename>javascript/defs.bzl<gh_stars>1000+
load("//javascript/private:fragment.bzl", _closure_fragment = "closure_fragment")
load("//javascript/private:header.bzl", _closure_lang_file = "closure_lang_file")
load("//javascript/private:test_suite.bzl", _closure_test_suite = "closure_test_suite")
closure_fragment = _cl... | 0 | 0 | 0 | 0 | 0 | 0 |
dapr/serializers/base.py | willtsai/python-sdk | 125 | 3268963 | <filename>dapr/serializers/base.py
# -*- coding: utf-8 -*-
"""
Copyright 2021 The Dapr 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 r... | 0 | 0 | 0 | 0 | 0 | 0 |
hyperskill_projects/hyperskill_intro_python/Modules and packages/From import/my_module.py | phiratio/lpthw | 213 | 3268971 | """ documentation string for module my_module
This module contains hello_world function
"""
def hello_world() -> str:
return "Hello, World!" | 0 | 1 | 0 | 0 | 1 | 0 |
tests/test_dma.py | long-long-float/py-videocore | 783 | 3268981 | <reponame>long-long-float/py-videocore
'Test of DMA load and store'
import numpy as np
from videocore.assembler import qpu
from videocore.driver import Driver
#=================================== 32 bit ===================================
@qpu
def horizontal_32bit_load(asm):
mov(ra0, uniform)
ldi(rb0, 4*16*... | 0 | 0 | 0 | 0 | 0 | 0 |
akshare/fund/fund_aum_em.py | NovelResearchInvestment/akshare | 721 | 3269005 | <reponame>NovelResearchInvestment/akshare
#!/usr/bin/env python
# -*- coding:utf-8 -*-
"""
Date: 2021/10/7 13:32
Desc: 东方财富-基金
"""
import pandas as pd
import requests
def fund_aum_em() -> pd.DataFrame:
"""
东方财富-基金-基金公司排名列表
http://fund.eastmoney.com/Company/lsgm.html
:return: 基金公司排名列表
:rtype: panda... | 0 | 0 | 0 | 0 | 0 | 0 |
imaginaire/datasets/cache.py | hw07216/imaginaire | 3,308 | 3269025 | # Copyright (C) 2021 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
#
# This work is made available under the Nvidia Source Code License-NC.
# To view a copy of this license, check out LICENSE.md
from __future__ import annotations
import diskcache
"""
INFO:
Cache objects are thread-safe and may be shared betwe... | 0 | 2 | 0 | 0 | 2 | 0 |
flask_login_template/setup/config.py | sonalimahajan12/Automation-scripts | 496 | 3269039 | <reponame>sonalimahajan12/Automation-scripts
from dotenv import load_dotenv
import pymongo
import os
load_dotenv()
template = os.environ['TEMPLATE']
secret_key = os.environ['SECRET_KEY']
client = pymongo.MongoClient(os.environ['MONGO_CONNECTION_STRING'])
db = client.registration
| 0 | 0 | 0 | 0 | 0 | 0 |
alignments/rec/generate.py | BrickSchema/brick | 146 | 3269045 | <gh_stars>100-1000
import sys
from rdflib import Graph, Namespace, BNode
from rdflib.collection import Collection
graph = Graph()
graph.parse("Brick-REC-nodevice.ttl", format="turtle")
OWL = Namespace("http://www.w3.org/2002/07/owl#")
RDF = Namespace("http://www.w3.org/1999/02/22-rdf-syntax-ns#")
BRICK = Namespace("h... | 0 | 0 | 0 | 0 | 0 | 0 |
tradingbot/interfaces/position.py | stungkit/TradingBot | 218 | 3269047 | from typing import Any
from ..components import TradeDirection
class Position:
deal_id: str
size: int
create_date: str
direction: TradeDirection
level: float
limit: float
stop: float
currency: str
epic: str
market_id: str
def __init__(self, **kargs: Any) -> None:
... | 1 | 1 | 10 | 0 | 12 | 0 |
chianas/config_file_updater.py | rjsears/chia_plot_manager | 365 | 3269078 | #!/usr/bin/python3
# -*- coding: utf-8 -*-
"""
Part of drive_manager. Checks to see if our config file needs updating and updated it for us.
"""
VERSION = "V0.98 (2021-10-15)"
import os
import yaml
from pathlib import Path
import logging
from system_logging import setup_logging
from shutil import copyfile
from flatte... | 0 | 0 | 0 | 0 | 0 | 0 |
src/rl/micro_controllers.py | paul-ang/nas-segm-pytorch | 155 | 3269081 | from __future__ import annotations
"""RL Controller"""
import torch
import torch.nn as nn
import torch.nn.functional as F
from src.rl.utils import calc_prob, compute_critic_logits, sample_logits, torch_long
class MicroController(nn.Module):
""" Stack LSTM controller based on ENAS
https://arxiv.org/abs/1802... | 20 | 16 | 0 | 11 | 47 | 0 |
tests/compositing.py | plotdevice/plotdevice | 110 | 3269089 | <gh_stars>100-1000
# encoding: utf-8
import unittest
from . import PlotDeviceTestCase, reference
from plotdevice import *
class CompositingTests(PlotDeviceTestCase):
@reference('compositing/alpha.png')
def test_alpha(self):
# ref/Compositing/commands/alpha()
size(125, 125)
rect(10,10, 5... | 0 | 0 | 0 | 0 | 0 | 0 |
resotoshell/resotoshell/protected_files.py | MrMarvin/cloudkeeper | 316 | 3269096 | import logging
import os.path
import platform
import re
from re import RegexFlag
from typing import Dict
log = logging.getLogger(__name__)
# OS -> List[regexp_strings]
forbidden = {
"windows": [".*\\/windows\\/.*", ".*SystemRoot.*"],
"darwin": ["\\/System.*", "\\/Library.*"],
"linux": [".*\\/etc\\/.*"],
}... | 3 | 2 | 0 | 0 | 5 | 0 |
examples/highstock/ohlc.py | Jbrunn/python-highcharts | 370 | 3269109 | # -*- coding: utf-8 -*-
"""
Highstock Demos
OHLC: http://www.highcharts.com/stock/demo/ohlc
"""
from highcharts import Highstock
from highcharts.highstock.highstock_helper import jsonp_loader
H = Highstock()
data_url = 'http://www.highcharts.com/samples/data/jsonp.php?filename=aapl-ohlc.json&callback=?'
data = jsonp_... | 0 | 0 | 0 | 0 | 0 | 0 |
src/research/slicing_experiments.py | mzy2240/GridCal | 284 | 3269184 | import random
import numpy as np
from scipy.sparse import csc_matrix, lil_matrix
def binary_search(array, x) -> object:
"""
Binary search
:param array: array: Must be sorted
:param x: value to search
:return: position where it is found, -1 if not found
"""
lower = 0
upper = len(array)
... | 4 | 7 | 0 | 0 | 11 | 0 |
python/pygcylon/test/gen_join_test_data.py | deHasara/cylon | 229 | 3269204 | <gh_stars>100-1000
##
# 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, softwa... | 0 | 0 | 0 | 0 | 0 | 0 |
xmodaler/modeling/encoder/two_stream_bert_encoder.py | cclauss/xmodaler | 830 | 3269231 | <gh_stars>100-1000
# Copyright 2021 JD.com, Inc., JD AI
"""
@author: <NAME>, <NAME>
@contact: <EMAIL>, <EMAIL>
"""
import random
import torch
from torch import nn
from xmodaler.config import configurable
from xmodaler.config import CfgNode as CN
from xmodaler.config import kfg
from ..layers.bert import Ber... | 0 | 0 | 0 | 0 | 0 | 0 |
jmetal/util/ckecking.py | 12yuens2/jMetalPy | 335 | 3269240 | class NoneParameterException(Exception):
def __init__(self, message: str = ""):
self.error_message = message
class InvalidConditionException(Exception):
def __init__(self, message: str):
self.error_message = message
class EmptyCollectionException(RuntimeError):
def __init__(self):
... | 12 | 0 | 0 | 0 | 12 | 0 |
python36/A_pyt/e_CRR1979_vectorized.py | aborodya/dawp | 484 | 3269254 | <reponame>aborodya/dawp
#
# Valuation of European Call Option in CRR1979 Model
# Vectorized Version (= NumPy-level Iterations)
# A_pyt/e_CRR1979_vectorized.py
#
import numpy as np
from c_parameters import *
# Array Initialization for Index Levels
mu = np.arange(M + 1)
mu = np.resize(mu, (M + 1, M + 1))
md = np.transpo... | 0 | 0 | 0 | 0 | 0 | 0 |
onepk/onepk_helper.py | fallenfuzz/pynet | 528 | 3269289 | from __future__ import annotations
'''
Assumes that you have onePK Python SDK installed.
Tested using onePK-sdk-python-rel-1.3.0.181
Assumes that you have previously created pin_file.txt using:
./BaseTutorial.py -a 10.10.10.10 -P pin_file.txt
Example usage:
# Create NetworkDevice object
>>> pynet_rtr1 = dict(
... ... | 2 | 0 | 0 | 0 | 2 | 0 |
30 Days of Code/Python/25 - Day 24 - More Linked Lists.py | srgeyK87/Hacker-Rank-30-days-challlenge | 275 | 3269306 | # ========================
# Information
# ========================
# Direct Link: https://www.hackerrank.com/challenges/30-linked-list-deletion/problem
# Difficulty: Easy
# Max Score: 30
# Language: Python
# ========================
# Solution
# ========================
class Node:
def __init__(se... | 0 | 2 | 0 | 1 | 3 | 0 |
etl/parsers/etw/Microsoft_Windows_SetupUGC.py | IMULMUL/etl-parser | 104 | 3269318 | <reponame>IMULMUL/etl-parser
# -*- coding: utf-8 -*-
"""
Microsoft-Windows-SetupUGC
GUID : 75ebc33e-0870-49e5-bdce-9d7028279489
"""
from construct import Int8sl, Int8ul, Int16ul, Int16sl, Int32sl, Int32ul, Int64sl, Int64ul, Bytes, Double, Float32l, Struct
from etl.utils import WString, CString, SystemTime, Guid
from et... | 0 | 0 | 0 | 0 | 0 | 0 |
scripts/rpc/ioat.py | jfckm/spdk | 2,107 | 3269328 | <filename>scripts/rpc/ioat.py
from .helpers import deprecated_alias
@deprecated_alias('ioat_scan_copy_engine')
@deprecated_alias('scan_ioat_copy_engine')
def ioat_scan_accel_engine(client):
"""Enable IOAT accel engine.
"""
return client.call('ioat_scan_accel_engine')
| 0 | 0 | 0 | 0 | 0 | 0 |
bookwyrm/migrations/0095_auto_20210911_2053.py | mouse-reeve/fedireads | 270 | 3269388 | <filename>bookwyrm/migrations/0095_auto_20210911_2053.py
# Generated by Django 3.2.4 on 2021-09-11 20:53
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
("bookwyrm", "0094_auto_20210911_1550"),
]
operations = [
migrations.AlterField(
... | 0 | 0 | 0 | 0 | 0 | 0 |
Python/math/factorial.py | zhcet19/NeoAlgo-1 | 897 | 3269397 | <reponame>zhcet19/NeoAlgo-1
# Calculate factorial using iterative approach
def fact(x):
result = 1
for i in range(1,x):
result = result * (i+1)
return result
# Calculate factorial using recursion
def fact_rec(x):
if x == 0 or x == 1:
return 1
else:
return x * fact_rec(x-1)
... | 0 | 0 | 0 | 0 | 0 | 0 |
test/test_gpio_input.py | mrtnschltr/CHIP_IO | 295 | 3269444 | <filename>test/test_gpio_input.py
import pytest
import os
import time
import CHIP_IO.GPIO as GPIO
def teardown_module(module):
GPIO.cleanup()
class TestGPIOInput:
def test_input(self):
GPIO.setup("CSID6", GPIO.IN)
#returned as an int type
input_value = GPIO.input("CSID6")
#val... | 0 | 0 | 0 | 0 | 0 | 0 |
freight/providers/__init__.py | armandomeeuwenoord/freight | 562 | 3269481 | <reponame>armandomeeuwenoord/freight
from .manager import ProviderManager
from .pipeline import PipelineProvider
from .shell import ShellProvider
manager = ProviderManager()
manager.add("pipeline", PipelineProvider)
manager.add("shell", ShellProvider)
get = manager.get
| 0 | 0 | 0 | 0 | 0 | 0 |
dota2/enums.py | itsjfx/dota2 | 172 | 3269482 |
from dota2.common_enums import *
from dota2.proto_enums import *
| 0 | 0 | 0 | 0 | 0 | 0 |
tilecloud/tests/test_boundingpyramid.py | camptocamp/tilecloud | 134 | 3269490 | import unittest
from tilecloud import BoundingPyramid, Bounds, TileCoord
class TestBoundingPyramid(unittest.TestCase):
def test_empty(self) -> None:
bp = BoundingPyramid()
self.assertEqual(len(bp), 0)
self.assertFalse(TileCoord(0, 0, 0) in bp)
self.assertRaises(StopIteration, next... | 0 | 18 | 0 | 0 | 18 | 0 |
bin/gitstatus.py | donfanning/dotfiles-2 | 188 | 3269498 | #!/usr/bin/env python
from __future__ import print_function
import sys
import subprocess as sp
# Change those symbols to whatever you prefer
symbols = {'ahead of': u'↑', 'behind': u'↓', 'prehash': u':'}
#symbols = {'ahead of': '↑', 'behind': '↓', 'prehash': ':'}
# Get symbolic-ref:
s = sp.Popen(['git', 'symbolic-re... | 0 | 0 | 0 | 0 | 0 | 0 |
resnet/configs/__init__.py | renmengye/rev-resnet-public | 357 | 3269509 | from cifar_configs import *
from imagenet_configs import *
from config_factory import get_config, get_config_from_json | 0 | 0 | 0 | 0 | 0 | 0 |
examples/time dependent solver examples/2D_double_slit.py | quantum-visualizations/qmsolve | 356 | 3269549 | <reponame>quantum-visualizations/qmsolve
import numpy as np
from qmsolve import Hamiltonian, SingleParticle, TimeSimulation, init_visualization, femtoseconds, m_e, Å
#=========================================================================================================#
#First, we define the Hamiltonian of a single... | 0 | 0 | 0 | 0 | 0 | 0 |
strawberry/types/fields/resolver.py | otakuy/strawberry | 2,062 | 3269556 | from __future__ import annotations
import builtins
import inspect
import sys
from inspect import isasyncgenfunction, iscoroutinefunction
from typing import Callable, Generic, List, Mapping, Optional, TypeVar, Union
from cached_property import cached_property # type: ignore
from strawberry.annotation import Strawber... | 4 | 10 | 0 | 0 | 14 | 0 |
pyts/transformation/tests/test_bag_of_patterns.py | jmrichardson/pyts | 1,217 | 3269569 | <filename>pyts/transformation/tests/test_bag_of_patterns.py<gh_stars>1000+
"""Testing for Bag-of-Patterns."""
# Author: <NAME> <<EMAIL>>
# License: BSD-3-Clause
import numpy as np
import pytest
from pyts.transformation import BagOfPatterns
X = [[0, 2, 1, 3, 4, 2, 1, 0, 3, 1, 2, 0],
[2, 0, 1, 3, 2, 4, 1, 2, 0, ... | 0 | 0 | 0 | 0 | 0 | 0 |
BPNN/BPNN_Classify/BPNN_Classify_Data.py | Anfany/Machine-Learning-for-Beginner | 397 | 3269575 | # -*- coding:utf-8 -*-
# &Author AnFany
import pandas as pd
import numpy as np
# 训练数据文件路径
train_path = 'C:/Users/GWT9\Desktop/Adult_Train.csv'
# 测试数据文件路径
test_path = 'C:/Users/GWT9\Desktop/Adult_Test.csv'
# 因为测试数据native-country中不存在Holand-Netherlands,不便于独热编码。
# 因此在测试文件中添加一个native-country为Holand-N... | 2 | 3 | 0 | 0 | 5 | 0 |
backpack/extensions/firstorder/sum_grad_squared/convtranspose3d.py | jabader97/backpack | 395 | 3269587 | from backpack.core.derivatives.conv_transpose3d import ConvTranspose3DDerivatives
from backpack.extensions.firstorder.sum_grad_squared.sgs_base import SGSBase
class SGSConvTranspose3d(SGSBase):
def __init__(self):
super().__init__(
derivatives=ConvTranspose3DDerivatives(), params=["bias", "wei... | 0 | 0 | 0 | 0 | 0 | 0 |
migrations/versions/e10b2bb6682d_added_new_anomaly_data_table.py | eltociear/chaos_genius | 320 | 3269626 | """Added new anomaly data table
Revision ID: <KEY>
Revises: <PASSWORD>
Create Date: 2021-08-31 12:12:59.984125
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = '<KEY>'
down_revision = '<PASSWORD>'
branch_labels = None
depends_on = None
def upgrade():
# ###... | 0 | 0 | 0 | 0 | 0 | 0 |
csgomenumaker/__main__.py | citrusCS/csgo-menu-maker | 152 | 3269628 | #!/usr/bin/env python3
import argparse
import sys
from . import loader
parser = argparse.ArgumentParser(
prog="csgomenumaker",
description="Generate a console menu for CSGO."
)
parser.add_argument(
"file"
)
args = parser.parse_args(sys.argv[1:])
loader.Loader(args.file)
| 0 | 0 | 0 | 0 | 0 | 0 |
surreal/replay/dummy_replay.py | PeihongYu/surreal | 471 | 3269646 | <gh_stars>100-1000
import time
import numpy as np
import random
from .base import Replay
class DummyReplay(Replay):
def __init__(self, *args, sampling_start_size, **kwargs):
super().__init__(*args, **kwargs)
self._sampling_start_size = sampling_start_size
self._memory = {}
def insert(s... | 0 | 0 | 0 | 0 | 0 | 0 |
tutorials/stock-wallet/microservices/crypto/src/commands/services.py | bhardwajRahul/minos-python | 247 | 3269654 | <filename>tutorials/stock-wallet/microservices/crypto/src/commands/services.py
import logging
import time
import ccxt
import pendulum
from minos.aggregate import (
Event,
)
from minos.common import (
ModelType,
)
from minos.cqrs import (
CommandService,
)
from minos.networks import (
BrokerMessageV1,
... | 0 | 0 | 0 | 0 | 0 | 0 |
src/cltk/phonology/enm/phonology.py | yelircaasi/cltk | 757 | 3269657 | """Middle English phonology tools
"""
from typing import List
from cltk.phonology.syllabify import Syllabifier
__author__ = ["<NAME> <<EMAIL>>"]
class MiddleEnglishSyllabifier:
"""
Middle English syllabifier
"""
def __init__(self):
self.syllabifier = Syllabifier(language="enm")
def syl... | 2 | 3 | 0 | 0 | 5 | 0 |
build_tools/torchscript_e2e_heavydep_tests/bert_functorch.py | rdadolf/torch-mlir | 213 | 3269685 | <filename>build_tools/torchscript_e2e_heavydep_tests/bert_functorch.py
# Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
# See https://llvm.org/LICENSE.txt for license information.
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
# Also available under a BSD-style license. See LIC... | 0 | 0 | 0 | 0 | 0 | 0 |
test/test_sequence.py | robbm1/pyleri | 106 | 3269715 | import unittest
import os
import sys
if os.environ.get('USELIB') != '1':
sys.path.insert(0, os.path.join(os.path.dirname(__file__), '..'))
from pyleri import (
KeywordError,
create_grammar,
Sequence,
Keyword,
) # nopep8
class TestSequence(unittest.TestCase):
def test_sequence(self):
... | 0 | 0 | 0 | 0 | 0 | 0 |
pyexperiment/__init__.py | movermeyer/pyexperiment | 220 | 3269719 | <filename>pyexperiment/__init__.py
"""The pyexperiment module - quick and clean experiments with Python.
"""
from pyexperiment.version import __version__
from pyexperiment.utils.Singleton import delegate_singleton
# For convenience, set up the basic tools here
# pylint: disable=invalid-name
from pyexperiment.Config i... | 0 | 0 | 0 | 0 | 0 | 0 |
general/github-api/search_github_repositories.py | caesarcc/python-code-tutorials | 1,059 | 3269735 | from github import Github
import base64
def print_repo(repo):
# repository full name
print("Full name:", repo.full_name)
# repository description
print("Description:", repo.description)
# the date of when the repo was created
print("Date created:", repo.created_at)
# the date of the last gi... | 0 | 0 | 0 | 0 | 0 | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.