max_stars_repo_path
stringlengths
3
269
max_stars_repo_name
stringlengths
4
119
max_stars_count
int64
0
191k
id
stringlengths
1
7
content
stringlengths
6
1.05M
score
float64
0.23
5.13
int_score
int64
0
5
adios-1.9.0/wrappers/numpy/example/utils/ncdf2bp.py
swatisgupta/Adaptive-compression
0
14100
<gh_stars>0 #!/usr/bin/env python """ Example: $ python ./ncdf2bp.py netcdf_file """ from adios import * from scipy.io import netcdf import numpy as np import sys import os import operator def usage(): print os.path.basename(sys.argv[0]), "netcdf_file" if len(sys.argv) < 2: usage() sys.exit(0) ##fname ...
2.671875
3
airflow/operators/hive_operator.py
nirmeshk/airflow
1
14101
<filename>airflow/operators/hive_operator.py import logging import re from airflow.hooks import HiveCliHook from airflow.models import BaseOperator from airflow.utils import apply_defaults class HiveOperator(BaseOperator): """ Executes hql code in a specific Hive database. :param hql: the hql to be exec...
2.390625
2
classification/prepare_model.py
JSC-NIIAS/TwGoA4aij2021
0
14102
<gh_stars>0 import os import yaml import segmentation_models_pytorch as smp import torch import argparse import torch.nn as nn import timm from model_wrapper import Classification_model def prepare_model(opt): with open(opt.hyp) as f: experiment_dict = yaml.load(f, Loader=yaml.FullLoader) model_pretrai...
2.203125
2
KarpuzTwitterApp/logic.py
bounswe/bounswe2018group5
10
14103
<filename>KarpuzTwitterApp/logic.py from requests import get from utils.TwitterService import TwitterService import tweepy from decouple import config def get_tweets_with_location_and_query(search_params): """ Searches all tweets that are in the given location and contains a query string. """ if 'geocode' not...
3.21875
3
StepperComms.py
MicaelJarniac/StepperComms
0
14104
<reponame>MicaelJarniac/StepperComms # Required imports import os import sys import serial import time sys.path.append(os.path.dirname(os.path.expanduser('~/projects/Python-Playground/Debug'))) # Update path accordingly from Debug.Debug import Debug # Declare debug debug = Debug(True, 3).prt # Simplifies debugging m...
2.21875
2
skills/eliza/test_eliza.py
oserikov/dream
34
14105
<reponame>oserikov/dream import unittest import eliza class ElizaTest(unittest.TestCase): def test_decomp_1(self): el = eliza.Eliza() self.assertEqual([], el._match_decomp(["a"], ["a"])) self.assertEqual([], el._match_decomp(["a", "b"], ["a", "b"])) def test_decomp_2(self): el...
2.625
3
examples/tasks/dtw-energy-plus-models-data/code.py
dburian/ivis-core
2
14106
<gh_stars>1-10 import sys import os import json from elasticsearch import Elasticsearch, helpers from datetime import datetime, timezone import numpy as np from dtw import dtw # Get parameters and set up elasticsearch data = json.loads(sys.stdin.readline()) es = Elasticsearch([{'host': data['es']['host'], 'port': int...
2.4375
2
xmrswap/interface_part.py
tecnovert/xmrswap
2
14107
#!/usr/bin/env python # -*- coding: utf-8 -*- # Copyright (c) 2020 tecnovert # Distributed under the MIT software license, see the accompanying # file LICENSE.txt or http://www.opensource.org/licenses/mit-license.php. from .contrib.test_framework.messages import ( CTxOutPart, ) from .interface_btc import BTCInte...
1.820313
2
pelican_resume/resume.py
cmenguy/pelican-resume
12
14108
<filename>pelican_resume/resume.py ''' resume ============================================================================== This plugin generates a PDF resume from a Markdown file using customizable CSS ''' import os import logging import tempfile from subprocess import Popen from pelican import signals CURRENT_DI...
2.546875
3
app/machine_learning.py
ludthor/CovidVisualizer
0
14109
from sklearn.linear_model import Ridge class MachineLearning(): def __init__(self): self.model = None def train_model(self, X,y): lr = Ridge(alpha=0.5) lr.fit(X,y) print(lr) self.model = lr def predict(self, X): preds = self.model.predict(X) return...
3.390625
3
connection/connection_handler.py
valsoares/td
0
14110
# -*- coding: utf-8 -*- """ @author: <NAME> (<EMAIL>) 11/03/2020 @description: PyDash Project The ConnectionHandler is a Singleton class implementation The class responsible to retrieve segments in the web server. Also it implements a traffic shaping approach. """ from base.simple_module import SimpleModule from ba...
2.859375
3
latexpp/fixes/pkg/phfqit.py
psg-mit/latexpp
4
14111
import re import yaml import logging logger = logging.getLogger(__name__) from pylatexenc.macrospec import MacroSpec, ParsedMacroArgs, MacroStandardArgsParser from pylatexenc import latexwalker from latexpp.macro_subst_helper import MacroSubstHelper from latexpp.fix import BaseFix # parse entropy macros etc. _q...
1.96875
2
Ch_5/linear_alg5.py
Skyblueballykid/linalg
0
14112
<filename>Ch_5/linear_alg5.py<gh_stars>0 import numpy as np import scipy import sympy from numpy import linalg as lg from numpy.linalg import solve from numpy.linalg import eig from scipy.integrate import quad # Question 1 ''' A. Determinant = -21 B. Determinant = -21 ''' m1 = np.array([[3, 0, 3], [2, 3, 3], [0, 4...
3.171875
3
builder/tasks_bullet/standimitation_task_bullet.py
FrankTianTT/laikago_robot
6
14113
from builder.laikago_task_bullet import LaikagoTaskBullet from builder.laikago_task import InitPose import math import numpy as np ABDUCTION_P_GAIN = 220.0 ABDUCTION_D_GAIN = 0.3 HIP_P_GAIN = 220.0 HIP_D_GAIN = 2.0 KNEE_P_GAIN = 220.0 KNEE_D_GAIN = 2.0 class LaikagoStandImitationBulletBase(LaikagoTaskBullet): de...
2.09375
2
build.py
chrahunt/conan-protobuf
0
14114
<reponame>chrahunt/conan-protobuf #!/usr/bin/env python # -*- coding: utf-8 -*- from bincrafters import build_template_default if __name__ == "__main__": builder = build_template_default.get_builder() # Todo: re-enable shared builds when issue resolved # github issue: https://github.com/google/prot...
1.648438
2
pytrek/settings/LimitsSettings.py
hasii2011/PyArcadeStarTrek
1
14115
from logging import Logger from logging import getLogger from pytrek.settings.BaseSubSetting import BaseSubSetting from pytrek.settings.SettingsCommon import SettingsCommon from pytrek.settings.SettingsCommon import SettingsNameValues class LimitsSettings(BaseSubSetting): LIMITS_SECTION: str = 'Limits' MA...
2.5
2
tests/integration_tests/testYieldCurve.py
neoyung/IrLib
1
14116
import unittest from datetime import date from irLib.marketConvention.dayCount import ACT_ACT from irLib.marketConvention.compounding import annually_k_Spot from irLib.helpers.yieldCurve import yieldCurve, discountCurve, forwardCurve import numpy as np alias_disC = 'disC' alias_forC = 'forC' referenceDate = date(2020...
2.578125
3
src/python/setup.py
blaine141/NVISII
149
14117
# Copyright (c) 2020 NVIDIA Corporation. All rights reserved. # This work is licensed under the NVIDIA Source Code License - Non-commercial. Full # text can be found in LICENSE.md from setuptools import setup, dist import wheel import os # required to geneerate a platlib folder required by audittools from setuptools.c...
1.890625
2
portal_gun/configuration/schemas/compute_aws.py
Coderik/portal-gun
69
14118
from marshmallow import fields, Schema from .provision import ProvisionActionSchema class InstanceSchema(Schema): type = fields.String(required=True) image_id = fields.String(required=True) availability_zone = fields.String(required=True) ebs_optimized = fields.Boolean() iam_fleet_role = fields.String(required=...
2.28125
2
extras/unbundle.py
mstriemer/amo-validator
1
14119
<reponame>mstriemer/amo-validator import sys import os import zipfile from zipfile import ZipFile from StringIO import StringIO source = sys.argv[1] target = sys.argv[2] if not target.endswith("/"): target = "%s/" % target def _unbundle(path, target): zf = ZipFile(path, 'r') contents = zf.namelist() ...
2.21875
2
linuxOperation/app/domain/forms.py
zhouli121018/core
0
14120
# -*- coding: utf-8 -*- # import time import os import math import json from lib.forms import BaseFied, BaseFieldFormatExt, DotDict, BaseCfilterActionFied, BaseCfilterOptionFied from app.core.models import Mailbox, MailboxUserAttr, Domain, CoCompany, CoreAlias, DomainAttr, \ Department...
1.671875
2
deep_coach.py
jendelel/rhl-algs
2
14121
<reponame>jendelel/rhl-algs from PyQt5 import QtGui, QtCore, QtWidgets from collections import namedtuple import time import random import torch import torch.nn as nn import torch.nn.functional as F from utils import utils HumanFeedback = namedtuple('HumanFeedback', ['feedback_value']) SavedAction = namedtuple('SavedA...
1.890625
2
model/DB Automation/add_db.py
chrisdcao/Covid_Map_Hanoi
1
14122
<reponame>chrisdcao/Covid_Map_Hanoi<filename>model/DB Automation/add_db.py import pyodbc import mysql.connector conn = mysql.connector.connect(user='root', password='', port='3307', host='localhost', database='coviddb') cursor = conn.cursor(buffered=True) cursor.execute('SELECT * FROM coviddb.markers') cursor.exe...
2.6875
3
conduit_tests/fixtu.py
ArtuZi2/conduit
0
14123
<gh_stars>0 import time import pytest # preparing selenium and chrome web driver manager from selenium import webdriver from selenium.webdriver.chrome.options import Options from webdriver_manager.chrome import ChromeDriverManager # importing os for environmental variable, and docker-compose up import os @pytest.fi...
2.125
2
scope/utils.py
jasonmsetiadi/scope
3
14124
__all__ = [ "Dataset", "forgiving_true", "load_config", "log", "make_tdtax_taxonomy", "plot_gaia_density", "plot_gaia_hr", "plot_light_curve_data", "plot_periods", ] from astropy.io import fits import datetime import json import healpy as hp import matplotlib.pyplot as plt import nu...
2.078125
2
spacy/lang/pt/lex_attrs.py
keshan/spaCy
1
14125
<filename>spacy/lang/pt/lex_attrs.py # coding: utf8 from __future__ import unicode_literals from ...attrs import LIKE_NUM _num_words = ['zero', 'um', 'dois', 'três', 'tres', 'quatro', 'cinco', 'seis', 'sete', 'oito', 'nove', 'dez', 'onze', 'doze', 'dúzia', 'dúzias', 'duzia', 'duzias', 'treze', 'catorze...
2.28125
2
factor calculation scripts/15.smoothearningstopriceratio.py
cagdemir/equity-index-predictors
0
14126
# -*- coding: utf-8 -*- """ Created on Fri Nov 29 18:00:53 2019 @author: Administrator """ import pdblp import pandas as pd import numpy as np import matplotlib.pyplot as plt import seaborn as sns con = pdblp.BCon(debug=False, port=8194, timeout=5000) con.start() index_tickers = ['NYA Index', 'SPX I...
2.125
2
ms/commands/autopep8.py
edcilo/flask_ms_boilerplate
0
14127
<reponame>edcilo/flask_ms_boilerplate import click import os from flask.cli import with_appcontext @click.command(name='pep8', help='Automatically formats Python code to conform to the PEP 8 style guide.') @click.option('-p', '--path', default='./ms', help='folder path to fix code') @with...
1.859375
2
py2ts/generate_service_registry.py
conanfanli/py2ts
3
14128
#!/usr/bin/env python import logging import re import subprocess import sys from typing import Dict logger = logging.getLogger("py2ts.generate_service_registry") logging.basicConfig(level=logging.INFO) class RipgrepError(Exception): pass def camel_to_snake(name: str) -> str: name = re.sub("(.)([A-Z][a-z]+)...
2.421875
2
tasks/birds.py
CatherineWong/l3
46
14129
<reponame>CatherineWong/l3 from misc import util from collections import namedtuple import csv import numpy as np import os import pickle import sys N_EX = 4 Datum = namedtuple("Datum", ["hint", "ex_inputs", "input", "label"]) START = "<s>" STOP = "</s>" random = util.next_random() birds_path = os.path.join(sys.p...
2.78125
3
tests/test_utils.py
caiosba/covid-19
9
14130
import locale import pytest from covid.utils import fmt class TestUtilityFunctions: def test_format_functions_en_US(self): try: locale.setlocale(locale.LC_ALL, "en_US.UTF-8") except locale.Error: return pytest.skip() assert fmt(0.10) == "0.1" assert fmt(0...
2.34375
2
catkin_ws/src/10-lane-control/line_detector/src/line_detector_node.py
johnson880319/Software
0
14131
#!/usr/bin/env python from anti_instagram.AntiInstagram import AntiInstagram from cv_bridge import CvBridge, CvBridgeError from duckietown_msgs.msg import (AntiInstagramTransform, BoolStamped, Segment, SegmentList, Vector2D, FSMState) from duckietown_utils.instantiate_utils import instantiate from duckietown_utils....
2.234375
2
django_qiniu/utils.py
9nix00/django-qiniu
1
14132
<gh_stars>1-10 # -*- coding: utf-8 -*- from account_helper.middleware import get_current_user_id from django.utils import timezone from django.conf import settings from hashlib import sha1 import os def user_upload_dir(instance, filename): name_struct = os.path.splitext(filename) current_user_id = get_curren...
2.015625
2
AxePy3Lib/01/re/re_test_patterns_groups.py
axetang/AxePython
1
14133
<gh_stars>1-10 #!/usr/bin/env python3 # encoding: utf-8 # # Copyright (c) 2010 <NAME>. All rights reserved. # """Show the groups within the matches for a pattern. """ # end_pymotw_header import re def test_patterns(text, patterns): """Given source text and a list of patterns, look for matches for each patte...
3.484375
3
src/xr_embeds/urls.py
xr-web-de/xr-web
4
14134
from django.urls import re_path from xr_embeds.views import geojson_view, embed_html_view app_name = "embeds" urlpatterns = [ re_path(r"^(\d+)/html/$", embed_html_view, name="embed_html"), re_path( r"^geojson/(?P<model_slug>\w+)/(?P<query_slug>\w+)/$", geojson_view, name="geojson_view...
1.71875
2
templates/django/__APPNAME__/apps/utils/models.py
ba1dr/tplgenerator
0
14135
from django.db import models from django.core import signing class PasswordMixin(object): password_encrypted = models.CharField(max_length=128, null=False, blank=False) @property def password(self): return signing.loads(self.password_encrypted) @password.setter def password(self, value)...
2.390625
2
publications/admin.py
lukacu/django-publications
0
14136
# -*- Mode: python; indent-tabs-mode: nil; c-basic-offset: 2; tab-width: 2 -*- from publications import list_import_formats, get_publications_importer __license__ = 'MIT License <http://www.opensource.org/licenses/mit-license.php>' __author__ = '<NAME> <<EMAIL>>' __docformat__ = 'epytext' from django.contrib import a...
2.3125
2
tests/common/helpers/dut_utils.py
Rancho333/sonic-mgmt
2
14137
import logging from tests.common.helpers.assertions import pytest_assert from tests.common.utilities import get_host_visible_vars from tests.common.utilities import wait_until CONTAINER_CHECK_INTERVAL_SECS = 1 CONTAINER_RESTART_THRESHOLD_SECS = 180 logger = logging.getLogger(__name__) def is_supervisor_node(inv_file...
2.34375
2
pyy1/.pycharm_helpers/python_stubs/-1550516950/_ctypes.py
pyy1988/pyy_test1
0
14138
<filename>pyy1/.pycharm_helpers/python_stubs/-1550516950/_ctypes.py<gh_stars>0 # encoding: utf-8 # module _ctypes # from /usr/lib/python3.5/lib-dynload/_ctypes.cpython-35m-x86_64-linux-gnu.so # by generator 1.145 """ Create and manipulate C compatible data types in Python. """ # no imports # Variables with simple valu...
2.265625
2
senseis/models/rc_action_model1.py
armandli/ReconChessRL
4
14139
<filename>senseis/models/rc_action_model1.py import torch from torch import nn from senseis.torch_modules.activation import relu_activation from senseis.torch_modules.residual_layer import ResidualLayer1DV5, ResidualLayer2DV3 # Dueling Q Model class RCActionModel1(nn.Module): def __init__(self, csz, row_sz, col_sz,...
2.375
2
win/msgbox.py
Zxynine/fusion360-thomasa88lib
4
14140
<gh_stars>1-10 # Message box functions # # This file is part of thomasa88lib, a library of useful Fusion 360 # add-in/script functions. # # Copyright (c) 2020 <NAME> # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), ...
1.6875
2
eispac/core/eiscube.py
MJWeberg/eispac
11
14141
<reponame>MJWeberg/eispac __all__ = ['EISCube'] import sys import copy import numpy as np import astropy.units as u from astropy.convolution import convolve, CustomKernel from astropy.coordinates import SkyCoord from ndcube import __version__ as ndcube_ver from ndcube import NDCube class EISCube(NDCube): """EIS L...
2.21875
2
stylee/comments/serializers.py
jbaek7023/Stylee-API
1
14142
from rest_framework import serializers from django.contrib.contenttypes.models import ContentType from django.contrib.auth import get_user_model from profiles.serializers import UserRowSerializer from .models import Comment User = get_user_model() # content, user def create_comment_serializer(model_type='outfit', i...
2.28125
2
stressTest/stressTestPV.py
bhill-slac/epics-stress-tests
0
14143
<gh_stars>0 #!/usr/bin/env python3 class stressTestPV: def __init__( self, pvName ): self._pvName = pvName self._tsValues = {} # Dict of collected values, keys are float timestamps self._tsRates = {} # Dict of collection rates, keys are int secPastEpoch values s...
2.65625
3
pysoundcloud/client.py
omarcostahamido/PySoundCloud
4
14144
<filename>pysoundcloud/client.py import re import requests from typing import Union from pysoundcloud.soundcloudplaylists import SoundCloudPlaylists from pysoundcloud.soundcloudsearchresults import SoundCloudSearchResults from pysoundcloud.soundcloudlikedtracks import SoundCloudLikedTracks from pysoundcloud.s...
2.96875
3
rojak-analyzer/generate_stopwords.py
pyk/rojak
107
14145
# Run this script to create stopwords.py based on stopwords.txt import json def generate(input_txt, output_py): # Read line by line txt_file = open(input_txt) words = set([]) for raw_line in txt_file: line = raw_line.strip() # Skip empty line if len(line) < 1: continue #...
3.46875
3
bcbio/structural/cnvkit.py
YTLogos/bcbio-nextgen
1
14146
"""Copy number detection with CNVkit with specific support for targeted sequencing. http://cnvkit.readthedocs.org """ import copy import math import operator import os import sys import tempfile import subprocess import pybedtools import numpy as np import toolz as tz from bcbio import utils from bcbio.bam import re...
2.171875
2
pyexchange/exchange2010/__init__.py
tedeler/pyexchange
128
14147
""" (c) 2013 LinkedIn Corp. 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 agreed to in writing...
1.570313
2
rnacentral_pipeline/rnacentral/r2dt/should_show.py
RNAcentral/rnacentral-import-pipeline
1
14148
<filename>rnacentral_pipeline/rnacentral/r2dt/should_show.py # -*- coding: utf-8 -*- """ Copyright [2009-2021] EMBL-European Bioinformatics Institute 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 ...
2.09375
2
model.py
nitro-code/inception-api
1
14149
import tensorflow as tf from keras.preprocessing import image from keras.applications.inception_v3 import InceptionV3, preprocess_input, decode_predictions import numpy as np import h5py model = InceptionV3(include_top=True, weights='imagenet', input_tensor=None, input_shape=None) graph = tf.get_default_graph() def ...
2.671875
3
models/recall/word2vec/static_model.py
ziyoujiyi/PaddleRec
2,739
14150
<filename>models/recall/word2vec/static_model.py<gh_stars>1000+ # 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://...
2.46875
2
transformers/transformers/data/processors/split_sentences.py
richardbaihe/segatron_aaai
16
14151
#!/usr/bin/env python3 # -*- coding:utf-8 -*- # @Time : 2020-04-13 21:19 # @Author : <NAME> # @EMail : <EMAIL> import nltk import os import json def sentence_split(line): sents = nltk.tokenize.sent_tokenize(line) rnt = [sent.split() for sent in sents] return rnt
2.703125
3
sfdata/posts/migrations/0001_initial.py
adjspecies/sfdata
1
14152
<gh_stars>1-10 # Generated by Django 2.1.4 on 2018-12-21 21:55 from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): initial = True dependencies = [ ] operations = [ migrations.CreateModel( name='Author', fi...
1.867188
2
test/test_tools.py
cokelaer/sequana
138
14153
<gh_stars>100-1000 from sequana.tools import bam_to_mapped_unmapped_fastq, reverse_complement, StatsBAM2Mapped from sequana import sequana_data from sequana.tools import bam_get_paired_distance, GZLineCounter, PairedFastQ from sequana.tools import genbank_features_parser def test_StatsBAM2Mapped(): data = sequana_...
2.296875
2
sxl/sxl.py
giriannamalai/sxl
0
14154
<filename>sxl/sxl.py """ xl.py - python library to deal with *big* Excel files. """ from abc import ABC from collections import namedtuple, ChainMap from contextlib import contextmanager import datetime import io from itertools import zip_longest import os import re import string import xml.etree.cElementTree as ET fr...
2.390625
2
sdk-python/awaazde/base.py
ashwini-ad/awaazde-api-client-sdk
0
14155
<reponame>ashwini-ad/awaazde-api-client-sdk import logging import urllib.parse from .api_client import ApiClient from .constants import APIConstants from .exceptions import APIException from .utils import CommonUtils class BaseAPI(object): """ BaseApi class, all the other api class extends it """ res...
2.265625
2
configs/mmrotate/rotated-detection_tensorrt_dynamic-320x320-1024x1024.py
grimoire/mmdeploy
746
14156
<filename>configs/mmrotate/rotated-detection_tensorrt_dynamic-320x320-1024x1024.py _base_ = ['./rotated-detection_static.py', '../_base_/backends/tensorrt.py'] onnx_config = dict( output_names=['dets', 'labels'], input_shape=None, dynamic_axes={ 'input': { 0: 'batch', 2: 'he...
1.617188
2
rainy/envs/parallel_wrappers.py
alexmlamb/blocks_rl_gru_setup
0
14157
import numpy as np from typing import Any, Iterable, Tuple from .ext import EnvSpec from .parallel import ParallelEnv from ..prelude import Action, Array, State from ..utils.rms import RunningMeanStd class ParallelEnvWrapper(ParallelEnv[Action, State]): def __init__(self, penv: ParallelEnv) -> None: self....
2.34375
2
oldp/apps/search/templatetags/search.py
docsuleman/oldp
66
14158
<filename>oldp/apps/search/templatetags/search.py from datetime import datetime from dateutil.relativedelta import relativedelta from django import template from django.template.defaultfilters import urlencode from django.urls import reverse from haystack.models import SearchResult from haystack.utils.highlighting imp...
2.125
2
interview/leet/1029_Two_City_Scheduling.py
eroicaleo/LearningPython
1
14159
<reponame>eroicaleo/LearningPython #!/usr/bin/env python class Solution: def twoCitySchedCost(self, costs): N = len(costs)//2 costs = list(sorted(costs, key=lambda c: c[0]-c[1])) s = 0 for i, c in enumerate(costs): s += c[0] if i < N else c[1] return s costs = [...
3.515625
4
Metrics/plots.py
liorfrenkel1992/focal_calibration
0
14160
''' This file contains method for generating calibration related plots, eg. reliability plots. References: [1] <NAME>, <NAME>, <NAME>, and <NAME>. On calibration of modern neural networks. arXiv preprint arXiv:1706.04599, 2017. ''' import math import matplotlib.pyplot as plt import numpy as np import os import ma...
2.5625
3
sdk/python/pulumi_oci/sch/get_service_connector.py
EladGabay/pulumi-oci
5
14161
# coding=utf-8 # *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. *** # *** Do not edit by hand unless you're certain you know what you are doing! *** import warnings import pulumi import pulumi.runtime from typing import Any, Mapping, Optional, Sequence, Union, overload from .. import...
1.703125
2
manim_demo/srcs/new_Scene_demo.py
shujunge/manim_tutorial
0
14162
from manimlib.imports import * class LSystem(Scene): CONFIG = { 'rules': {'F': 'F+F--F+F'}, 'length': 1, 'start_loc': ORIGIN, 'angle': PI / 3, 'start_rot': 0, 'iteration': 1, 'initial': 'F', 'actions': {}, 'locations': [], 'rotations':...
2.953125
3
prototyping/OpenCv/robot_tracking.py
ssnover/msd-p18542
3
14163
import imutils import cv2 import numpy as np import math from math import sqrt def find_robot_orientation(image): robot = {} robot['angle'] = [] robot['direction'] = [] robotLower = (139, 227, 196) robotUpper = (255, 255, 255) distances = [] # img = cv2.imread('all_color_terrain_with_robot....
2.765625
3
ansible/my_env/lib/python2.7/site-packages/ansible/modules/cloud/vmware/vmware_host_ntp.py
otus-devops-2019-02/yyashkin_infra
1
14164
#!/usr/bin/python # -*- coding: utf-8 -*- # Copyright: (c) 2018, <NAME> <<EMAIL>> # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from __future__ import absolute_import, division, print_function __metaclass__ = type ANSIBLE_METADATA = { 'metadata_version': '1.1', ...
1.882813
2
molecule/default/tests/test_creation.py
stackhpc/ansible-role-luks
3
14165
<gh_stars>1-10 import os import testinfra.utils.ansible_runner testinfra_hosts = testinfra.utils.ansible_runner.AnsibleRunner( os.environ['MOLECULE_INVENTORY_FILE']).get_hosts('all') def test_crypto_devices(host): f = host.file('/dev/mapper/cryptotest') assert f.exists f = host.file('/dev/mapper/cry...
1.992188
2
test_weakref.py
xzfn/retroreload
0
14166
<filename>test_weakref.py """ weakref should be valid. """ import gc import importlib import autoreload import retroreload switch = 2 if switch == 0: reload_module = importlib.reload elif switch == 1: reload_module = autoreload.superreload elif switch == 2: reload_module = retroreload.retroreload im...
2.484375
2
model/model.py
Okestro-symphony/Log-Anomaly-Detection
0
14167
def train_isolation_forest(df, padding_data): ''' * Isolation Forest model setting - n_estimators=100 - max_samples='auto' - n_jobs=-1 - max_features=2 - contamination=0.01 ''' #padding한 data load data_df = padding_data # model 정의 model = IsolationForest(n_estimators=100...
3.015625
3
datasets.py
Tracesource/DCEC
154
14168
import numpy as np def load_mnist(): # the data, shuffled and split between train and test sets from keras.datasets import mnist (x_train, y_train), (x_test, y_test) = mnist.load_data() x = np.concatenate((x_train, x_test)) y = np.concatenate((y_train, y_test)) x = x.reshape(-1, 28, 28, 1).as...
2.6875
3
balto_gui.py
peckhams/balto_gui
8
14169
""" This module defines a class called "balto_gui" that can be used to create a graphical user interface (GUI) for downloading data from OpenDAP servers from and into a Jupyter notebook. If used with Binder, this GUI runs in a browser window and does not require the user to install anything on their computer. However...
2.734375
3
w0rplib/url.py
w0rp/w0rpzone
0
14170
<reponame>w0rp/w0rpzone from django.views.generic.base import RedirectView from django.conf.urls import re_path def redir(regex, redirect_url, name=None): """ A shorter wrapper around RedirectView for 301 redirects. """ return re_path( regex, RedirectView.as_view(url=redirect_url, perm...
2.1875
2
launcher.py
lucaso60/DiscordDMSpammer
1
14171
<filename>launcher.py<gh_stars>1-10 """ MIT License Copyright (c) 2021 lucaso60 Copyright (c) 2015-present Rapptz 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, including wi...
2.46875
2
src/pipelines.py
charnley/bayes-mndo
0
14172
import multiprocessing as mp import os import shutil from functools import partial from tqdm import tqdm import data from chemhelp import mndo # def calculate(binary, filename, scr=None): # """ # Collect sets of lines for each molecule as they become available # and then call a parser to extract the dict...
2.546875
3
lib/googlecloudsdk/api_lib/logging/common.py
bshaffer/google-cloud-sdk
0
14173
# -*- coding: utf-8 -*- # # Copyright 2016 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 requir...
1.945313
2
hkdataminer/utils/plot_.py
stephenliu1989/HK_DataMiner
3
14174
__author__ = 'stephen' import numpy as np import scipy.io import scipy.sparse import matplotlib matplotlib.use('agg') import matplotlib.pyplot as plt import matplotlib.mlab as mlab import matplotlib.pylab as pylab from .utils import get_subindices import matplotlib.ticker as mtick from collections import Counter from s...
2.25
2
commanderbot_lib/database/yaml_file_database.py
CommanderBot-Dev/commanderbot-lib
1
14175
from typing import IO from commanderbot_lib.database.abc.file_database import FileDatabase from commanderbot_lib.database.mixins.yaml_file_database_mixin import ( YamlFileDatabaseMixin, ) class YamlFileDatabase(FileDatabase, YamlFileDatabaseMixin): # @implements FileDatabase async def load(self, file: IO...
2.359375
2
git_verkefni_forritun.py
JonasFreyrB/Forritun
0
14176
#<NAME> #25.01.2017 #Forritun #Liður 1 #Byð notanda um tölu 1 tala1=int(input("Sláðu inn tölu 1 ")) #Byð notanda um tölu 2 tala2=int(input("Sláðu inn tölu 2 ")) #Birti tölu 1 og 2 lagðar saman print("Tölurnar lagðar saman ",tala1+tala2) #Birti tölu 1 og 2 margfaldaðar saman print("Tölurnar margfaldaðar saman ",tala1*...
4
4
test/pdu.py
praekelt/python-smpp
36
14177
pdu_objects = [ { 'header': { 'command_length': 0, 'command_id': 'bind_transmitter', 'command_status': 'ESME_ROK', 'sequence_number': 0, }, 'body': { 'mandatory_parameters': { 'system_id': 'test_system', ...
1.546875
2
arxiv/release/dist_version.py
cul-it/arxiv-base
23
14178
<filename>arxiv/release/dist_version.py<gh_stars>10-100 """ Functions to deal with arxiv package versions. It can be used in the setup.py file: from arxiv.release.dist_version import get_version setup( version=get_version('arxiv-filemanager'), .... ) """ import sys import pathlib from subprocess import Po...
2.3125
2
rssynergia/base_diagnostics/read_bunch.py
radiasoft/rs_synergia
0
14179
# -*- coding: utf-8 -*- """? :copyright: Copyright (c) 2020 RadiaSoft LLC. All Rights Reserved. :license: http://www.apache.org/licenses/LICENSE-2.0.html """ from __future__ import absolute_import, division, print_function #import argparse #import tables from mpi4py import MPI import h5py import inspect import numpy ...
2.4375
2
funfolding/binning/classic_binning.py
tudo-astroparticlephysics/funfolding
1
14180
<gh_stars>1-10 #!/usr/bin/env python # -*- coding: utf-8 -*- from ._binning import Binning import itertools import numpy as np import copy try: from astroML.density_estimation.bayesian_blocks import bayesian_blocks got_astroML = True except ImportError: got_astroML = False class ClassicBinning(Binning)...
2.046875
2
basic_algorithm/draw/draw.py
Quanfita/ImageProcessing
0
14181
import cv2 import numpy as np def drawPoint(canvas,x,y): canvas[y,x] = 0 def drawLine(canvas,x1,y1,x2,y2): dx, dy = abs(x2 - x1), abs(y2 - y1) xi, yi = x1, y1 sx, sy = 1 if (x2 - x1) > 0 else -1, 1 if (y2 - y1) > 0 else -1 pi = 2*dy - dx while xi != x2 + 1: if pi < 0: pi +...
3.375
3
PyTCI/models/alfentanil.py
jcia2192/PyTCI
6
14182
<filename>PyTCI/models/alfentanil.py<gh_stars>1-10 from .base import Three class Alfentanil(Three): """base Alfentanil class""" pass class Maitre(Alfentanil): def __init__(self, age, weight, height, sex): if sex == "m": self.v1 = 0.111 * weight elif sex == "f": ...
3.03125
3
cooee/actions.py
yschimke/cooee-cli-py
0
14183
<reponame>yschimke/cooee-cli-py import webbrowser from typing import Dict, Any from prompt_toolkit import print_formatted_text from .format import todo_string def launch_action(result: Dict[str, Any]): if "location" in result: webbrowser.open(result["location"]) else: print_formatted_text(to...
2.40625
2
custom_components/panasonic_smart_app/sensor.py
clspeter/panasonic_smart_app
0
14184
<filename>custom_components/panasonic_smart_app/sensor.py from datetime import timedelta import logging from homeassistant.components.sensor import SensorEntity from homeassistant.const import ( STATE_UNAVAILABLE, DEVICE_CLASS_HUMIDITY, DEVICE_CLASS_TEMPERATURE, TEMP_CELSIUS, CONCENTRATION_MICROGRAM...
2.25
2
fluent.runtime/tests/format/test_placeables.py
jakub-szczepaniak/python-fluent
0
14185
from __future__ import absolute_import, unicode_literals import unittest from fluent.runtime import FluentBundle from fluent.runtime.errors import FluentCyclicReferenceError, FluentReferenceError from ..utils import dedent_ftl class TestPlaceables(unittest.TestCase): def setUp(self): self.ctx = FluentB...
2.4375
2
ads/feature_engineering/adsstring/parsers/base.py
oracle/accelerated-data-science
20
14186
<gh_stars>10-100 #!/usr/bin/env python # -*- coding: utf-8 -*-- # Copyright (c) 2021, 2022 Oracle and/or its affiliates. # Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl/ class Parser: @property def pos(self): raise NotImplementedError() @pr...
2.328125
2
tests/conftest.py
banteg/lido-vault
22
14187
import pytest from brownie import Wei @pytest.fixture(scope="function", autouse=True) def shared_setup(fn_isolation): pass @pytest.fixture(scope='module') def nocoiner(accounts, lido): assert lido.balanceOf(accounts[9]) == 0 return accounts[9] @pytest.fixture(scope='module') def ape(accounts): ret...
1.945313
2
reqto/__init__.py
DovaX/reqto
0
14188
<reponame>DovaX/reqto from reqto.core.reqto import get, post, delete, put, patch, head __all__=[get, post, delete, put, patch, head]
1.3125
1
setup.py
sgillies/fio-taxa
2
14189
from codecs import open as codecs_open from setuptools import setup, find_packages # Get the long description from the relevant file with codecs_open('README.rst', encoding='utf-8') as f: long_description = f.read() setup(name='fio_taxa', version='1.0.0', description=u"Classification of GeoJSON feat...
1.601563
2
python/q04.py
holisound/70-math-quizs-for-programmers
0
14190
# -*- coding: utf-8 -*- from collections import deque def cutBar(m, n): res, now = 0, 1 while now < n: now += now if now < m else m res += 1 return res def cutBarBFS(m, n): if n == 1: return 0 que = deque([n]) res = 0 while que: size = len(que) for...
3.5
4
numba/core/itanium_mangler.py
auderson/numba
0
14191
<reponame>auderson/numba<gh_stars>0 """ Itanium CXX ABI Mangler Reference: http://mentorembedded.github.io/cxx-abi/abi.html The basics of the mangling scheme. We are hijacking the CXX mangling scheme for our use. We map Python modules into CXX namespace. A `module1.submodule2.foo` is mapped to `module1::submodule2...
2.609375
3
DRAFTS/CookieStealer.py
henryza/Python
0
14192
import requests import json class test(object): def __init__(self): self._debug = False self._http_debug = False self._https = True self._session = requests.session() # use single session for all requests def update_csrf(self): # Retrieve server csrf and update session's he...
2.859375
3
viewers/trpl_h5.py
ScopeFoundry/FoundryDataBrowser
6
14193
<reponame>ScopeFoundry/FoundryDataBrowser from ScopeFoundry.data_browser import DataBrowser from FoundryDataBrowser.viewers.hyperspec_base_view import HyperSpectralBaseView import numpy as np import h5py from qtpy import QtWidgets from ScopeFoundry.logged_quantity import LQCollection import time from FoundryDataBrowse...
1.921875
2
python/matrices.py
silvajhonatan/robotics
3
14194
import numpy as np import numpy.matlib # soma das matrizes A = np.array([[1,0],[0,2]]) B = np.array([[0,1],[1,0]]) C = A + B print(C) # soma das linhas A = np.array([[1,0],[0,2]]) B = np.array([[0,1],[1,0]]) s_linha = sum(A) print(s_linha) # soma dos elementos A = np.array([[1,0],[0,2]]) B = np.array([[0,1],[1,0]]...
2.828125
3
builder/action.py
nagisc007/storybuilder
0
14195
# -*- coding: utf-8 -*- """Define action class. """ from enum import Enum from . import assertion from .basedata import BaseData from .description import Description, NoDesc, DescType from .flag import Flag, NoFlag, NoDeflag from .basesubject import NoSubject from .person import Person from .chara import Chara from .wh...
2.4375
2
pype/hosts/fusion/plugins/publish/increment_current_file_deadline.py
simonebarbieri/pype
0
14196
<filename>pype/hosts/fusion/plugins/publish/increment_current_file_deadline.py import pyblish.api class FusionIncrementCurrentFile(pyblish.api.ContextPlugin): """Increment the current file. Saves the current file with an increased version number. """ label = "Increment current file" order = pyb...
2.390625
2
tests/integration_tests/framework/flask_utils.py
ilan-WS/cloudify-manager
124
14197
<reponame>ilan-WS/cloudify-manager<gh_stars>100-1000 ######### # Copyright (c) 2013 GigaSpaces Technologies Ltd. All rights reserved # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # ...
1.609375
2
dependencies/FontTools/Lib/fontTools/misc/bezierTools.py
charlesmchen/typefacet
21
14198
"""fontTools.misc.bezierTools.py -- tools for working with bezier path segments.""" __all__ = [ "calcQuadraticBounds", "calcCubicBounds", "splitLine", "splitQuadratic", "splitCubic", "splitQuadraticAtT", "splitCubicAtT", "solveQuadratic", "solveCubic", ] from fontTools.misc.arrayTools import calcBounds impo...
3.078125
3
pymach/present.py
EnriqueU/pymach
0
14199
<filename>pymach/present.py # Standard Libraries import subprocess import datetime import sys # print en consola import os import json # Local Libraries import define import analyze import prepare import fselect import evaluate import improve import tools import pandas as pd from flask_login import LoginManager, logi...
2.078125
2