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
tests/test_shared/test_utils.py
brucetony/PathMe
12
12768051
<reponame>brucetony/PathMe # -*- coding: utf-8 -*- """Tests for converting WikiPathways.""" import os import unittest from pathme.export_utils import get_paths_in_folder from pathme.wikipathways.utils import get_file_name_from_url, merge_two_dicts from tests.constants import WP22, WP_TEST_RESOURCES class TestUtils...
2.5625
3
nanotune/tests/device/conftest.py
microsoft/nanotune
5
12768052
<gh_stars>1-10 import pytest from qcodes.tests.instrument_mocks import MockDAC as QcodesMockDAC from qcodes.instrument.delegate.delegate_instrument import DelegateInstrument @pytest.fixture(scope="function") def qcodes_dac(): dac = QcodesMockDAC('qcodes_dac', num_channels=3) try: yield dac finally...
2.28125
2
yt_velmodel_vis/shapeplotter.py
chrishavlin/yt_velmodel_vis
2
12768053
<reponame>chrishavlin/yt_velmodel_vis ''' shapeplotter module: support for plotting shapefile data on yt scenes ''' from . import seis_model as sm import numpy as np import matplotlib.pyplot as plt from mpl_toolkits.mplot3d import Axes3D import yt import os import geopandas as gpd from . import datamanager as dm clas...
2.578125
3
src/test/pythonFiles/definition/three.py
ChaseKnowlden/vscode-jupyter
615
12768054
import two two.ct().fun()
1.023438
1
FaceDetection/face_classifier.py
technetbytes/OpenCV
0
12768055
<filename>FaceDetection/face_classifier.py import numpy as np import cv2 #open data folder path folder_path = "/home/saqib/anaconda3/share/OpenCV/haarcascades/" #set cascade classifier xml files frontalface_classifier = 'haarcascade_frontalface_default.xml' eye_classifier = 'haarcascade_eye.xml' face_cascade = cv2.C...
3.171875
3
commands/perform.py
zbylyrcxr/DennisMUD
2
12768056
####################### # <NAME> # # perform.py # # Copyright 2018-2020 # # <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 ...
1.796875
2
backend/project/conversations/urls.py
winoutt/winoutt-django
0
12768057
<reponame>winoutt/winoutt-django from django.urls import path, re_path from . import views urlpatterns = [ # Message Urls path('api/messages', views.Message.as_view(), name='messages'), path('api/messages/<int:message_id>', views.ReadMessage.as_view(), name='read_message'), path('api/messages/<i...
1.875
2
beacon_aug/screenshot.py
adobe-research/beacon-aug
11
12768058
# Copyright 2021 Adobe # All Rights Reserved. # NOTICE: Adobe permits you to use, modify, and distribute this file in # accordance with the terms of the Adobe license agreement accompanying # it. import random import numpy as np import cv2 import matplotlib.pyplot as plt import matplotlib # matplotlib.use('TkAgg') im...
2.0625
2
openff/bespokefit/optimizers/__init__.py
openforcefield/bespoke-f
12
12768059
<filename>openff/bespokefit/optimizers/__init__.py from openff.bespokefit.optimizers.base import ( BaseOptimizer, deregister_optimizer, get_optimizer, list_optimizers, register_optimizer, ) from openff.bespokefit.optimizers.forcebalance import ForceBalanceOptimizer __all__ = [ BaseOptimizer, ...
1.101563
1
testbed_frontend/api/emulation/emulation_manager.py
Ncu-software-research-center/IIOT-testbed
1
12768060
''' Vortex OpenSplice This software and documentation are Copyright 2006 to TO_YEAR ADLINK Technology Limited, its affiliated companies and licensors. All rights reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the Lice...
1.835938
2
aula 8/01_quiz_exercise_visualization_1.py
RichardPSilva/Udacity-Intro-to-Data-Science
0
12768061
from pandas import * from ggplot import * from datetime import datetime def get_day(date): return datetime.strftime(datetime.strptime(date,'%Y-%m-%d').date(),'%a') def plot_weather_data(turnstile_weather): ''' You are passed in a dataframe called turnstile_weather. Use turnstile_weather along...
4.4375
4
pymyenergi/zappi.py
CJNE/pymyenergi
5
12768062
<reponame>CJNE/pymyenergi<filename>pymyenergi/zappi.py from pymyenergi.connection import Connection from . import ZAPPI from .base_device import BaseDevice CHARGE_MODES = ["None", "Fast", "Eco", "Eco+", "Stopped"] STATES = ["Unkn0", "Paused", "Unkn2", "Charging", "Boosting", "Completed"] PLUG_STATES = { "A": "EV ...
2.234375
2
translators/object.py
rgirish28/blenderseed
0
12768063
<gh_stars>0 # # This source file is part of appleseed. # Visit http://appleseedhq.net/ for additional information and resources. # # This software is released under the MIT license. # # Copyright (c) 2014-2018 The appleseedhq Organization # # Permission is hereby granted, free of charge, to any person obtaining a copy ...
1.507813
2
pyfilter/distributions/joint.py
tingiskhan/pyfilter
61
12768064
from typing import Optional, Any, Tuple, Union, Sequence from torch.distributions import Distribution import torch class JointDistribution(Distribution): """ Defines an object for combining multiple distributions by assuming independence, i.e. we define: .. math:: p(x_1, x_2, ..., x_n) = p...
3.171875
3
app.py
ericmjl/Firearm_Detection
3
12768065
import streamlit as st import numpy as np from tensorflow.keras.models import load_model import librosa import time import matplotlib.pyplot as plt def wav2mfcc(wave, sr=22050,n_mfcc=20, max_len=170): '''wave is a np array''' wave = np.asfortranarray(wave) mfcc = librosa.feature.mfcc(wave, sr=sr, n_mfcc=...
3.203125
3
nndet/inference/ensembler/base.py
joeranbosma/nnDetection
242
12768066
<filename>nndet/inference/ensembler/base.py """ Copyright 2020 Division of Medical Image Computing, German Cancer Research Center (DKFZ), Heidelberg, Germany 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 Lic...
1.664063
2
analytics/ot-iou/utils.py
xwu2git/Smart-City-Sample
126
12768067
class BBUtil(object): def __init__(self,width,height): super(BBUtil, self).__init__() self.width=width self.height=height def xywh_to_tlwh(self, bbox_xywh): x,y,w,h = bbox_xywh xmin = max(int(round(x - (w / 2))),0) ymin = max(int(round(y - (h / 2))),0) r...
2.875
3
examples/config_method_py_example.py
123zbt/PySODEvalToolkit
27
12768068
# -*- coding: utf-8 -*- import os JLDCF_root = "<your_methods_path>/CVPR2020_JL-DCF" JLDCF = { "LFSD": dict(path=os.path.join(JLDCF_root, "LFSD"), suffix=".png"), "NJUD": dict(path=os.path.join(JLDCF_root, "NJU2K"), suffix=".png"), "NLPR": dict(path=os.path.join(JLDCF_root, "NLPR"), suffix=".png"), "RG...
1.960938
2
post/migrations/0001_initial.py
vis7/connection
1
12768069
<gh_stars>1-10 # Generated by Django 3.1.1 on 2020-10-04 14:24 from django.db import migrations, models class Migration(migrations.Migration): initial = True dependencies = [ ] operations = [ migrations.CreateModel( name='Comment', fields=[ ('comment...
1.828125
2
plato/agent/component/nlg/slot_filling_nlg.py
avmi/plato-research-dialogue-system
899
12768070
<filename>plato/agent/component/nlg/slot_filling_nlg.py """ Copyright (c) 2019-2020 Uber Technologies, Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENS...
3.09375
3
stats/extract_MNI_coord.py
athiede13/free_speech
0
12768071
""" Extract MNI coordinates for all brain maps. Created on Fri May 24 11:26:07 2019 @author: <NAME> <<EMAIL>> """ import mne import numpy as np from summarize_clusters_stc_AT import summarize_clusters_stc_AT import csv #%% for one-sample T-test whether ISCs are significant results_path = '/media/cbru/SMEDY/results/I...
1.96875
2
ambari-server/src/test/python/TestStackFeature.py
AliceXiaoLu/ambari
1
12768072
# !/usr/bin/env python ''' Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"...
1.84375
2
helper/enable_keymap_event_listener.py
Bhanditz/JavaScriptEnhancements
0
12768073
<gh_stars>0 import sublime, sublime_plugin class enableKeymap(sublime_plugin.EventListener): def on_text_command(self, view, command_name, args): if command_name in KEYMAP_COMMANDS and not javascriptCompletions.get("enable_keymap"): return ("noop", {})
2.078125
2
lib/workers/lambdas/graph/__init__.py
jpelbertrios/Kai
1
12768074
import boto3 class Graph: """ Represents a Graph object in a DynamoDB table """ def __init__(self, table_name, graph_id): dynamodb = boto3.resource("dynamodb") self.table = dynamodb.Table(table_name) self.graph_id = graph_id def check_status(self, expected_status): ...
3.015625
3
caf_verilog/dot_prod_pip.py
chiranthsiddappa/caf_verilog
1
12768075
from .dot_product import DotProduct import os from numpy import log2 filedir = os.path.dirname(os.path.realpath(__file__)) dot_product_tb_module_path = os.path.join(filedir, '..', 'src') dot_product_module_path = os.path.join(filedir, '..', 'src', 'dot_prod_pip.v') class DotProdPip(DotProduct): """ """ ...
2.21875
2
contrib/fedora/ganglia/voltdb.py
guthemberg/tejo
0
12768076
<filename>contrib/fedora/ganglia/voltdb.py #!/usr/bin/python # -*- coding: utf-8 -*- import time import copy import subprocess from configobj import ConfigObj import sys #db api available in home_dir conf_file = "/etc/tejo.conf" config=ConfigObj(conf_file) sys.path.append(config['home_dir']) ALIVE_TIME=int(config['al...
1.984375
2
pdftotree/TreeVisualizer.py
zviri/pdftotree
329
12768077
from typing import Tuple from pdfminer.pdfdocument import PDFDocument from pdfminer.pdfpage import PDFPage from pdfminer.pdfparser import PDFParser try: from IPython import get_ipython if "IPKernelApp" not in get_ipython().config: raise ImportError("console") except (AttributeError, ImportError): ...
2.59375
3
biblio/titlecovers.py
lokal-profil/isfdb_site
0
12768078
#!_PYTHONLOC # # (C) COPYRIGHT 2014-2021 Ahasuerus and <NAME> # ALL RIGHTS RESERVED # # The copyright notice above does not evidence any actual or # intended publication of such source code. # # Version: $Revision$ # Date: $Date$ from SQLparsing import * from common import * from library i...
2.140625
2
objects_and_classes/exercise/01_storage.py
Galchov/python-fundamentals
0
12768079
class Storage: __storage = 0 def __init__(self, capacity): self.capacity = capacity self.storage = [] def add_product(self, product): if not Storage.__storage == self.capacity: self.storage.append(product) Storage.__storage += 1 def get_products(self): ...
3.703125
4
reap_oracle_dbs.py
VeranosTech/alembic
0
12768080
<reponame>VeranosTech/alembic """Drop Oracle databases that are left over from a multiprocessing test run. Currently the cx_Oracle driver seems to sometimes not release a TCP connection even if close() is called, which prevents the provisioning system from dropping a database in-process. """ from alembic.testing impo...
1.765625
2
src/cache.py
aklsh/SimCache
0
12768081
<gh_stars>0 import random from replacePLRU import Tree from replaceLRU import LRUreplace, LRUupdate import math from copy import copy class cacheBlock: def __init__(self, tag=None): self.tag = tag if tag == None: self.valid = False else: self.valid = True sel...
2.59375
3
augmented_keypoints/evaluate_fixed_keypoints.py
cbenge509/kaggle_facial_keypoints
2
12768082
#%% import numpy as np import pandas as pd import pickle import matplotlib.pyplot as plt TRAIN_UPDATE_FILE = "C:/kaggle/kaggle_keypoints/pickle/cleandata_updates_augment.pkl" train = pickle.load(open(TRAIN_UPDATE_FILE, "rb")).reset_index() print("Size of 'augmentation' set: %d" % train.shape[0]) # %% fig = plt.fi...
2.515625
3
MyTextEditor.py
Priyeshjena98/MyTextEditor
2
12768083
from tkinter import Tk,scrolledtext,Menu,filedialog,END,messagebox import tkinter.scrolledtext as ScrolledText from tkinter import * from PIL import ImageTk #root is the root window into which all other widgets go. It is an instance of the class Tk, and every tkinter application must have exactly one instance of th...
3.84375
4
robosuite/environments/pick_place.py
kyungjaelee/robosuite
0
12768084
<reponame>kyungjaelee/robosuite from collections import OrderedDict import random import numpy as np import robosuite.utils.transform_utils as T from robosuite.environments.robot_env import RobotEnv from robosuite.robots import SingleArm from robosuite.models.arenas import BinsArena from robosuite.models.objects impo...
2.328125
2
Task1C.py
Callum-M-Halton/70_Flood_Sys
0
12768085
<reponame>Callum-M-Halton/70_Flood_Sys from floodsystem.geo import stations_within_radius from floodsystem.stationdata import build_station_list def demonstrate_station_radius(): """ Prints a sorted list of the names of the stations within a radius r of the cambridge city centre """ stations_list = sta...
3.265625
3
content_table.py
schwartzadev/covid-data-pipeline
0
12768086
# OBSOLETE import os from directory_cache import DirectoryCache from loguru import logger from typing import List from lxml import html, etree from unidecode import unidecode import re class ContentTable(): """ ContentTable represents from an HTML table contains both a simplied HTML table (new_element) an...
3.015625
3
tmp_visualiser.py
sitongye/raspberrypi_sensehat_music
0
12768087
<reponame>sitongye/raspberrypi_sensehat_music import time import os import sys, math, wave, numpy, pygame from sense_hat import SenseHat import subprocess as sp #from sense_emu import SenseHat import glob from time import sleep from random import randint import numpy as np from pygame.locals import * from scipy.fftpack...
2.9375
3
rtwilio/tests/test_forms.py
datamade/rapidsms-twilio
1
12768088
from django.test import TestCase from rapidsms.tests.harness import CreateDataMixin from rtwilio.forms import TwilioForm class TwilioFormTest(CreateDataMixin, TestCase): def test_valid_form(self): """Form should be valid if GET keys match configuration.""" data = {"From": "+12223334444", ...
2.71875
3
avmoo/spider_avmo.py
feifeixiaogao/avmoo
1
12768089
#!/usr/bin/env python3 #-*- coding:utf-8 -*- import sys import time import getopt import requests import sqlite3 import math import re import os from lxml import etree ''' 未启用的两个函数 data_check() 按照主表检查缺少数据,时间非常长,需手动配置 test_page() 输出单页数据 图片服务器: https://jp.netcdn.space/digital/video/miae00056/miae00056jp-10.jpg https://...
2.15625
2
py/h2o_config_dump_example.py
vkuznet/h2o
1
12768090
<gh_stars>1-10 # used to create example of what we want for the json file # not used for normal execution hostDict = {} hostDict['username'] = '0xdiag' hostDict['password'] = '<PASSWORD>' hostDict['h2o_per_host'] = 2 hostDict['ip'] = [] hostDict['ip'].append('192.168.0.30') hostDict['ip'].append('192.168.0.31') hostD...
2.59375
3
baselines/arch/lostgans/resnet_generator_v2.py
atmacvit/meronymnet
1
12768091
import torch import torch.nn as nn import torch.nn.functional as F from .norm_module import * from .mask_regression import * from .sync_batchnorm import SynchronizedBatchNorm2d BatchNorm = SynchronizedBatchNorm2d class ResnetGenerator128(nn.Module): def __init__(self, ch=64, z_dim=128, num_classes=10, output_dim...
2.296875
2
tests/test_stac.py
pjhartzell/aerial
0
12768092
<reponame>pjhartzell/aerial<gh_stars>0 import unittest from stactools.aerial import stac from tests import test_data class StacTest(unittest.TestCase): def test_create_collection(self): collection = stac.create_collection() collection.set_self_href("") self.assertEqual(collection.id, "t...
2.609375
3
python/distance_to_closest_generated_sample.py
VAlex22/ND_VAE
7
12768093
# Separate script, to use python multiprocessing, that utilizes pickle # import sys from multiprocessing import Pool, cpu_count import lasagne as nn import numpy as np import theano import theano.tensor as T from scipy import optimize from python.util import get_model_params, model_path, model_epoch from python.model....
2.078125
2
ginjinn/core/project.py
AGOberprieler/ginjinn
3
12768094
<reponame>AGOberprieler/ginjinn import importlib_resources as resources import yaml import json import jinja2 from jinja2 import Template from pathlib import Path import shutil from ginjinn import data_files from ginjinn import config from ginjinn.core import Configuration from ginjinn.core.tf_dataset impor...
1.890625
2
staticbackend/user.py
ipfans/backend-python
0
12768095
"""User management.""" from functools import lru_cache from typing import Any from httpx import Client from .base import Base from .database import Database from .errors import EmailError, LoginError from .forms import Form from .storage import Storage class LoginState(Base): def __init__(self, client: Client,...
2.625
3
lib/clock.py
kostyaby/fc-helper
0
12768096
from . import Constant from datetime import date import os.path import time class Clock: def __init__(self): self.cached_today = date.today() self.cached_time = int(time.time() * Constant.Clock.MILLIS_IN_SECOND) def get_timestamped_directory_name(self, dirname): return "{}-{}".format(dirname, self....
3.109375
3
django_de/news/models.py
django-de/django-de-v3
1
12768097
import datetime from django.db import models from django.conf import settings from django.contrib.auth.models import User from django.contrib.sites.models import Site from django.core.urlresolvers import reverse as url_reverse from django.template.defaultfilters import slugify from django.utils.translation import gett...
2.296875
2
review/api/urls.py
shahzadfarukh0999/review-app
0
12768098
from django.conf.urls import url from .views import (ReviewRUDView, ReviewListCreateView, RatingRUDView, RatingListCreateView, RatingCategoryRUDView, RatingCategoryListCreateView ) urlpatterns = [ ...
1.789063
2
section_10_(dictionaries)/dict_values.py
alisonjo2786/pythonlessons_materials
425
12768099
# If you're new to dictionaries, you might want to start with dict_access.py # We create a dictionary. contacts = { 'Shannon': '202-555-1234', 'Amy': '410-515-3000', 'Jen': '301-600-5555', 'Julie': '202-333-9876' } # We can use the dictionary method .values() to give us a list of all of the values in...
4.59375
5
cantools/database/can/bus.py
VonSquiggles/cantools
1,063
12768100
<filename>cantools/database/can/bus.py # A CAN bus. class Bus(object): """A CAN bus. """ def __init__(self, name, comment=None, baudrate=None, fd_baudrate=None, autosar_specifics=None): self._name = name ...
2.796875
3
newdle/core/util.py
jrstrayhorn/newdle
0
12768101
from datetime import datetime from enum import Enum from flask import current_app from itsdangerous import Signer DATE_FORMAT = '%Y-%m-%d' DATETIME_FORMAT = '%Y-%m-%dT%H:%M' class AutoNameEnum(Enum): def _generate_next_value_(name, start, count, last_values): return name def parse_dt(text): retur...
2.8125
3
profiles_api/urls.py
Lucasanim/profiles-rest-api
0
12768102
from django.urls import path, include from rest_framework.routers import DefaultRouter from .views import Hello, HelloViewSets, UserProfileViewSet, UserLoginApiView, UserProfileFeedViewSet router = DefaultRouter() router.register('hello', HelloViewSets, base_name='hello') router.register('profile', UserProfileViewSe...
2.03125
2
airflow/providers/microsoft/psrp/operators/psrp.py
holly-evans/airflow
3
12768103
# # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not...
1.585938
2
dev/Tools/Python/2.7.13/mac/Python.framework/Versions/2.7/lib/python2.7/site-packages/scipy/linalg/tests/test_lapack.py
jeikabu/lumberyard
8
12768104
# # Created by: <NAME>, September 2002 # from __future__ import division, print_function, absolute_import import sys import subprocess import time from numpy.testing import (assert_equal, assert_array_almost_equal, assert_, assert_allclose, assert_almost_equal, a...
1.625
2
web.py
caux/japonicus
0
12768105
<reponame>caux/japonicus #!/usr/bin/env python # -*- coding: utf-8 -*- import datetime import pandas as pd import os import flask import dash from dash.dependencies import Input, Output, Event import dash_core_components as dcc import dash_html_components as html from flask_caching import Cache from evaluation.gekko.s...
2.015625
2
src/asttrs/utils.py
ryanchao2012/asttrs
0
12768106
import pathlib import subprocess as sp import tempfile def blacking(source_code: str): with tempfile.NamedTemporaryFile("w", delete=False) as f: f.write(source_code) fname = f.name p = sp.Popen(f"cat {fname}".split(), stdout=sp.PIPE) out = sp.check_output("black -q -".split(), stdin=p.s...
2.53125
3
melisa/models/user/user.py
MelisaDev/melisa
5
12768107
# Copyright MelisaDev 2022 - Present # Full MIT License can be found in `LICENSE.txt` at the project root. from __future__ import annotations from enum import IntEnum from dataclasses import dataclass from typing import Optional, Dict, Any from ...utils.conversion import try_enum from ...utils.api_model import APIMo...
2.03125
2
app/helpers/sentry.py
MTES-MCT/mobilic-api
0
12768108
import sentry_sdk from sentry_sdk.integrations.flask import FlaskIntegration from werkzeug.exceptions import ( NotFound, MethodNotAllowed, HTTPVersionNotSupported, ) import re from app import app from app.helpers.errors import EmailAlreadyRegisteredError, MobilicError from app.helpers.mail import InvalidEm...
1.9375
2
Select_Data_loc.py
jonathan-JIPSlok/Aprendendo_Pandas
1
12768109
<reponame>jonathan-JIPSlok/Aprendendo_Pandas<filename>Select_Data_loc.py import pandas as pd import openpyxl df = pd.read_excel("Arquivo.xlsx", engine="openpyxl") print(df.loc[0])#Seleciona a linha print() print(df.loc[0:4])#Seleciona mais de uma linha print() print(df.loc[[0, 3, 5]])#Seleciona apenas as linhas 0, ...
3.78125
4
standalones/create_SSM_instance.py
KIT-IBT/AugmentA
0
12768110
<gh_stars>0 #!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Mon Apr 19 14:55:02 2021 @author: <NAME> Copyright 2021 <NAME> Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regard...
2.3125
2
model_train3.py
chunnuanhuakai/360finance
0
12768111
# -*- coding: utf-8 -*- """ Created on Sun Sep 30 15:21:02 2018 @author: zbj """ from sklearn.model_selection import GridSearchCV from sklearn.model_selection import train_test_split from sklearn import metrics from xgboost import XGBClassifier import pandas as pd from sklearn.metrics import accuracy_score ## 总样本 r...
2.46875
2
test_3DLoMatch.py
ZhiChen902/SC2-PCR
0
12768112
import json import sys sys.path.append('.') import argparse import logging from tqdm import tqdm from easydict import EasyDict as edict from evaluate_metric import TransformationLoss, ClassificationLoss from dataset import ThreeDLoMatchLoader from benchmark_utils import set_seed, icp_refine from benchmark_utils_predato...
1.78125
2
src/python/stup/packet/syn.py
Wizmann/STUP-Protocol
14
12768113
<filename>src/python/stup/packet/syn.py #!/usr/bin/python from .packet import Packet class SynPacket(Packet): def __init__(self, *args, **kwargs): super(self.__class__, self).__init__(*args, **kwargs) self.syn = 1
2.3125
2
Question 7.py
Mkez45634/Python-Coding-Challenges
0
12768114
<reponame>Mkez45634/Python-Coding-Challenges<filename>Question 7.py def signFinder (s): plus = s.count("-") minus = s.count("+") total = plus+minus if total == 1: return True else: return False
3.90625
4
postgres_connector/errors.py
sandboxws/beam-postgres-connector
0
12768115
<filename>postgres_connector/errors.py """Postgres Connector error classes.""" class PostgresConnectorError(Exception): """Base class for all errors.""" class PostgresClientError(PostgresConnectorError): """An error specific to the PostgreSQL driver."""
2.171875
2
zdpapi_file/directory.py
zhangdapeng520/zdpapi_file
1
12768116
""" 文件夹相关 """ import os class Directory: def __init__(self, path:str) -> None: """ path: 文件夹路径 """ self.path = path def disk_usage(self): """ 查看文件夹的占用量 """ # 使用内部函数避开递归函数self问题 def inner_disk_usage(path): total = os.path.g...
3.59375
4
Downloader.py
MRLSK8/Youtube_Downloader
0
12768117
<reponame>MRLSK8/Youtube_Downloader from pytube import YouTube yt = YouTube(str(input("Enter the video link: "))) videos = yt.streams.filter(subtype='mp4').all() # Gets all download options print("\n") counter = 1 for types in videos: print(str(counter) + ". "+str(types)) counter += 1 quality = int(input("...
3.265625
3
examples/counter/send_one.py
ptcrews/p4-mininet-tutorials
23
12768118
from scapy.all import * p = Ether(src="aa:bb:cc:dd:ee:ff") / IP(dst="10.0.1.10") / TCP() / "aaaaaaaaaaaaaaaa" sendp(p, iface = "veth1", verbose = 0)
1.960938
2
src/hammer-vlsi/test_tool_utils.py
XiaoSanchez/hammer
138
12768119
<reponame>XiaoSanchez/hammer<filename>src/hammer-vlsi/test_tool_utils.py #!/usr/bin/env python3 # -*- coding: utf-8 -*- # # Helper and utility classes for testing HammerTool. # # See LICENSE for licence details. import json import os import tempfile from abc import ABCMeta, abstractmethod from numbers import Number ...
2.40625
2
library-stats.py
yzhs/calibre-library-stats
0
12768120
import os from os.path import expanduser import altair as alt import numpy as np import pandas as pd from scipy.stats.stats import pearsonr import sqlite3 from util import to_day, to_month, to_year, to_local, allocate_ys, save_plot from config import dummy_start_date, dummy_end_date, cutoff_date # %matplotlib inline...
2.578125
3
Binary_Search/Python/jiang42/binary_search.py
sunilshahu/Algorithm-Implementations
3
12768121
def binary_search(arr, target): low, high = 0, len(arr)-1 while low < high: mid = (low + high)/2 if arr[mid] == target: return mid elif arr[mid] > target: high = mid - 1 else: low = mid + 1 return high if __name__ == "__main__": lst = [0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15] ...
3.765625
4
run/run.py
C-Symonds/MCE
3
12768122
######################################################################################### # # Python Run script for Parallel Open MP execution of the MCE / CCS program # Written by <NAME> 07/10/2020 # # This script is based of a similar script witted by <NAME> using bash. This ...
2.46875
2
gdsfactory/components/__init__.py
jorgepadilla19/gdsfactory
0
12768123
<gh_stars>0 from gdsfactory.components.add_fidutials import add_fidutials, add_fidutials_offsets from gdsfactory.components.align import add_frame, align_wafer from gdsfactory.components.array_component import array from gdsfactory.components.array_with_fanout import ( array_with_fanout, array_with_fanout_2d, )...
1.148438
1
Code/Sensors/DHT.py
JoelBuenrostro/micropython-for-esp32
1
12768124
# Chip: ESP32-WROOM-32 (ESP32-D0WDQ6) # Microprocessor: Dual-Core Xtensa® 32-bit LX6 # Clock: 80MHz to 240Mhz # Crystal: 40MHz # SPÍ flash: 4 MB # Operating voltage: 3.0V-3.6V # Operating current: 80mA # Purpose: Read temperature and humidity from DHT sensors # Notes: The DHT driver is implemented in software and work...
2.703125
3
mygamelist/games/models.py
Frostflake/mygamelist
2
12768125
from django.db import models from decimal import Decimal from uuid import uuid4 from django.contrib.auth.models import User from django.dispatch import receiver from django.db.models.signals import post_save def random_cover_filename(instance, filename): ext = filename.split('.')[-1] filename = '{}.{}'.format(...
2.15625
2
loss_function.py
lightbooster/TP-GST-BERT-Tacotron2
0
12768126
import torch from torch import nn class Tacotron2Loss(nn.Module): def __init__(self): super(Tacotron2Loss, self).__init__() def forward(self, model_output, targets): mel_target, gate_target = targets[0], targets[1] mel_target.requires_grad = False gate_target.requires_grad = F...
2.53125
3
src/components/vcs/MarkdownArticle.py
leikareipa/vcs-doxy-theme
0
12768127
<filename>src/components/vcs/MarkdownArticle.py # # 2021 <NAME> # # Software: VCS Doxygen theme # from src.components.vcs import ( ArticleHeader, ) from xml.etree import ElementTree from typing import Final from src import xml2html # The sub-components used in this component. childComponents:Final = [ Article...
2.5
2
salary_counter.py
MaxChilikin/Salary_counter
0
12768128
import xlrd import xlwt import pylightxl as xl import os import sys import re import PySimpleGUI as sg from collections import OrderedDict class SalaryCounter: def __init__(self, values): self.values = values self.payrolls = {} self.headers = [] self.counter = False self.m...
2.609375
3
config.py
justplus/vansel
3
12768129
#!/usr/bin/env python # coding=utf-8 __author__ = 'zhaoliang' __email__ = '<EMAIL>' __created__ = '15/12/19' import os CSRF_ENABLED = True SECRET_KEY = 'guess what you can and try it' DATABASE_URI = { 'host': 'localhost', 'user': 'root', 'passwd': '<PASSWORD>', 'port': 3306, 'db': 'vansel', ...
1.664063
2
pages/wikipedia_pages/home_page.py
glenn-barker/web-bdd
0
12768130
from selenium.webdriver.support import expected_conditions as EC from pages.page import Page class HomePage(Page): PAGE_URL = "https://www.wikipedia.org" def visit(self): self.selenium.driver.get(HomePage.PAGE_URL) self.verify_is_loaded() def verify_is_loaded(self): self.selenium...
3.0625
3
examples/toggle_led.py
pimoroni/ht0740-python
0
12768131
<filename>examples/toggle_led.py #!/usr/bin/env python import time from ht0740 import HT0740 print("""toggle_led.py - Toggles LED on and off using the toggle method. Press Ctrl+C to exit. """) switch = HT0740() print("Enabling switch!") switch.enable() try: while True: print("LED state: {}".format(swit...
3.515625
4
BlogApp/migrations/0010_auto_20201016_1546.py
n3trob3/nimrodage
0
12768132
# Generated by Django 3.1.1 on 2020-10-16 14:46 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('BlogApp', '0009_newsletter'), ] operations = [ migrations.AlterField( model_name='newsletter', name='e...
1.601563
2
camping_server2/scraping/__init__.py
solyourock/crawling_project
0
12768133
import kakao_reviews as kr import naverv4_blog as nv4 import gocamp_crawl as gc import gocamp_link_crawl as gl import datetime from camping_server2.bot import slackbot import camping_server2.config as config import time import naverv5_category as nv5 import camping_server2.scraping.ogcamp_crawl as oc import pandas as p...
2.453125
2
vmtp/network.py
schoksey/vmtp
0
12768134
<reponame>schoksey/vmtp # Copyright 2014 Cisco Systems, 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.078125
2
setup.py
ivanleopoldo/mkepub-fork
0
12768135
import setuptools with open('README.rst') as f: readme = f.read() setuptools.setup( name='mkepub-fork', version='1.2', description='Simple minimalistic library for creating EPUB3 files', long_description=readme, url='https://github.com/ivanleopoldo/mkepub-fork/', author='anqxyr, ivanleopol...
1.351563
1
Mxonline/apps/organization/adminx.py
chiefsh/song
1
12768136
# _*_coding:utf-8_*_ __author__ = 'song' __date__ = '2017/10/24 23:03' import xadmin from .models import CityDict,CourseOrg,Teacher class CityDictAdmin(object): list_display = ['name', 'desc', 'add_time'] search_fields = ['name', 'desc', 'add_time'] list_filter = ['name', 'desc', 'add_time'] ...
1.929688
2
example-project/cli.py
claudio-walser/srgssr-publication-data-api
1
12768137
# -*- coding: utf-8 -*- """Console script for srgssr_publication_data_api.""" import sys import json import click from dotenv import load_dotenv from sgqlc.types import Variable, non_null from srgssr_publication_data_api import PublicationDataApi @click.command() @click.option('--size', help='number of items', defau...
2.53125
3
oreo/apps.py
Caiseyann/instagram
0
12768138
<filename>oreo/apps.py from django.apps import AppConfig class OreoConfig(AppConfig): name = 'oreo'
1.367188
1
arealocations/urls.py
mohammadanarul/join-branches
0
12768139
<filename>arealocations/urls.py from django.urls import path from .views import ( AreaLocationListview, AreaLocationCreateView ) app_name = 'arealocations' urlpatterns = [ path('area-location-list/', AreaLocationListview.as_view(), name='area_location_list'), path('area-location-create/', AreaLocationC...
1.984375
2
minimize_1d.py
rlowrance/mlpack
1
12768140
<gh_stars>1-10 '''minimizers for functions of 1 variable FUNCTIONS golden_section(fun, low, high, interval_size) -> low*, high* ARGS fun(x) -> number low: number high: number interval_size: search stops when high* - low* < interval_size ''' from minimize_1d_golden_section import golden_section if False: # use im...
2.296875
2
twinpy/interfaces/aiida/twinboundary_shear.py
kei0822kei/twinpy
0
12768141
#!/usr/bin/env python """ Aiida interface for twinpy. """ import warnings import numpy as np from aiida.cmdline.utils.decorators import with_dbenv from aiida.orm import (load_node, Node, QueryBuilder, ) from aiida.plugins import WorkflowFactory from...
2.03125
2
little_helpers/reorg_ebooks.py
apefind/python
0
12768142
<gh_stars>0 #!/usr/bin/env python import argparse import pathlib from apefind.util import script from apefind.util.script import _ok log = script.get_logger() def parse_args(): parser = script.ArgumentParser() parser.add_argument("path", nargs=argparse.REMAINDER) return parser.parse_args() def fix_na...
2.828125
3
server/Original/test/__init__.py
izhuxin/AR.Drone
0
12768143
<filename>server/Original/test/__init__.py __author__ = 'mty'
1.046875
1
h02_client.py
faberto/gps2nextcloud
2
12768144
<gh_stars>1-10 import socket HOST = "127.0.0.1" # The server's hostname or IP address PORT = 5012 # The port used by the server with socket.socket(socket.AF_INET, socket.SOCK_STREAM) as s: s.connect((HOST, PORT)) # s.sendall(b"*HQ,865205030330012,V1,145452,A,2240.55181,N,11358.32389,E,0.00,0,100815,FFFFFBFF...
2.328125
2
16/infection_statistics.py
OhiyoX/LearnMatplotlibOnTheWay
0
12768145
<reponame>OhiyoX/LearnMatplotlibOnTheWay import csv import matplotlib.pyplot as plt import datetime import CaixinData.caixin_pneumonia_data as cpd # 更新数据 option = input("更新数据?y/n") if option == 'y': cpd.run() filename = 'CaixinData/data2.csv' with open(filename, encoding='utf-8') as f: # 计算多少行 lines = len...
2.984375
3
py/gzip_dicts.py
zhongxinghong/Java-Jieba
6
12768146
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # filename: rander_model.py import os from utils import txt_load, gzip_dump OUTPUT_DIR = "../src/main/resources/" fileList = [ "dict.big", "dict.std", "dict.small", "idf.std", ] for file in fileList: txtFile = os.path.join(OUTPUT_DIR, file+".t...
2.609375
3
LowLevelApi/NGPF/Python/1Main/bgpRestNgpfPy3.py
murumuthu/IxNetwork
0
12768147
#!/usr/local/python3.4.6/bin/python3.4 # DISCLAIMER # # This is a sample script for demo and reference purpose only. # It is subject to change for content updates without warning. # # DESCRIPTION # This sample script uses two back-to-back Ixia ports. # Supports both IxNetwork API server and Linux API serve...
2.078125
2
cgi-bin/hello2.py
wyolum/timezone_db
0
12768148
<filename>cgi-bin/hello2.py #!/usr/bin/python from __future__ import print_function import cgi import os import urllib import timezone_db import cgitb cgitb.enable() try: ip = cgi.escape(os.environ["REMOTE_ADDR"]) f = cgi.FieldStorage() fields = {} for k in f: fields[k] = f[k].value if 'macaddress' in f...
3.203125
3
biocontainers/pipelines.py
chakrabandla/biocontainers-backend
2
12768149
<gh_stars>1-10 import configparser import logging import urllib import click from biocontainers.biomongo.helpers import InsertContainers from biocontainers.dockerhub.models import DockerHubReader from biocontainers.github.models import GitHubConfiguration, GitHubDockerReader, GitHubMulledReader, \ LocalGitReader ...
2.15625
2
experiments/draw_and_classify.py
trejsu/shaper
0
12768150
<reponame>trejsu/shaper import argparse import logging import os import time from pathlib import Path import pandas as pd ARGS = None logging.basicConfig(level=logging.INFO) log = logging.getLogger(__name__) CURRENT_DIR = os.path.dirname(os.path.abspath(__file__)) DRAW_COMMANDS_PATH = os.path.join(str(Path.home())...
2.21875
2