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
revkit/export/qiskit.py
msoeken/revkit
16
41800
from _revkit import netlist, gate from qiskit import QuantumRegister, ClassicalRegister, QuantumCircuit def _to_qiskit(self, circuit=None, with_classical_register=False): """ Convert RevKit quantum circuit into Qiskit quantum circuit :param qiskit.QuantumCircuit circuit: If not `None`, add gates to this circui...
2.75
3
pyeccodes/defs/mars/grib_oper_ea_def.py
ecmwf/pyeccodes
7
41801
import pyeccodes.accessors as _ def load(h): if (h.get_l('class') == 8): h.alias('mars.origin', 'centre')
2.046875
2
djnic/cambios/apps.py
avdata99/nic
8
41802
<filename>djnic/cambios/apps.py from django.apps import AppConfig class CambiosConfig(AppConfig): name = 'cambios'
1.242188
1
src/modules/database.py
HorizonKinen/YoutubeToBilibili
22
41803
<reponame>HorizonKinen/YoutubeToBilibili import enum from sqlalchemy import Column, String, Integer, create_engine, insert from sqlalchemy.orm import sessionmaker, scoped_session from sqlalchemy.ext.declarative import declarative_base from .config import config config.read() base = declarative_base() def create_sessi...
2.5625
3
hans/problem.py
hannes-holey/hans
1
41804
""" MIT License Copyright 2021 <NAME> Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute...
1.757813
2
nucleoatac/run_occ.py
oaxiom/NucleoATAC
0
41805
""" Script to make nucleosome occupancy track! @author: <NAME> """ ##### IMPORT MODULES ##### # import necessary python modules #import matplotlib as mpl #mpl.use('PS') import matplotlib.pyplot as plt import multiprocessing as mp import numpy as np import traceback import itertools import pysam from pyatac.utils impo...
2.296875
2
mc_states/modules/mc_supervisor.py
makinacorpus/makina-states
18
41806
<reponame>makinacorpus/makina-states # -*- coding: utf-8 -*- ''' .. _module_mc_supervisor: mc_supervisor / supervisor functions ============================================ ''' # Import python libs import logging import mc_states.api __name = 'supervisor' log = logging.getLogger(__name__) def settings(): ...
1.75
2
ebk_client.py
felixb/ebk-client
0
41807
<reponame>felixb/ebk-client #!/usr/bin/env python # -*- coding: utf-8 -*- """ ebk-client - eBay Kleinanzeigen/Classifieds API client in Python Copyright (c) 2016 tjado <https://github.com/tejado> Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documen...
1.609375
2
main.py
luozhaoyu/poc-aws
0
41808
import socket import MySQLdb import config def do_mysql(host, user, passwd, dbname): print host, user, passwd, dbname content = "" try: # connect db = MySQLdb.connect(host=host, user=user, passwd=passwd, db=dbname) cursor = db.cursor() # execute SQL select statement ...
2.890625
3
tests/test_wordpairscore.py
simontite-capita-ti/yal
98
41809
#!/usr/bin/env python # coding: utf-8 import os import unittest from yalign.wordpairscore import WordPairScore class TestWordPairScore(unittest.TestCase): def setUp(self): self.word_pair_score = self._create_word_pair_score('test_word_scores.csv') def _create_word_pair_score(self, filename): ...
2.921875
3
Space_Invaders/classes/Game/Screens/MenuScreen.py
Jh123x/Orbital
4
41810
import pygame from pygame.locals import * from . import MenuTemplate from .. import State, WHITE, ImageObject, Direction class MenuScreen(MenuTemplate): def __init__(self, screen_width: int, screen_height: int, screen, debug: bool = False): """Constructor for the Main Menu screen""" # Call the s...
3.234375
3
01 Fundamental/Session 03/homework/clothes_shop.py
culee/c4e
0
41811
<filename>01 Fundamental/Session 03/homework/clothes_shop.py items = ['T-Shirt','Sweater'] print("*** Note: If you want to quit this program, simply type 'quit' or 'QUIT'.") print("*" * 20) while True: action = (input("Welcome to our shop, what do you want (C, R, U, D)? ")).upper() if action == "R": p...
4.25
4
tplogtools/timetools.py
Travelport-Czech/tplogtools
0
41812
#!/usr/bin/env python3 """Extended tools for datetime""" import datetime def how_many_seconds_to_time(now, hour, minute): """Return amount seconds from now to given hour and minute""" target_time = now.replace(hour=hour, minute=minute, second=0) if now >= target_time: target_time += datetime.timed...
3.828125
4
Algo_Ds_Notes-master/Algo_Ds_Notes-master/Catalan_Numbers/Catalan_Numbers.py
rajatenzyme/Coding-Journey-
0
41813
<reponame>rajatenzyme/Coding-Journey- ''' Catalan numbers (Cn) are a sequence of natural numbers that occur in many places. The most important ones being that Cn gives the number of Binary Search Trees possible with n values. Cn is the number of full Binary Trees with n + 1 leaves. Cn is the number ...
4.1875
4
tuun/util/database.py
petuum/tuun
33
41814
<gh_stars>10-100 import sqlite3 import os from sqlite_utils import Database from pathlib import Path def init_db(db_name, exp_id, table_config): """Initialize and return MetricDatabase database.""" ENV_TUUN_LOG = os.getenv('TUUN_LOG', 'False') ENV_TUUN_LOG_PATH = os.path.expanduser(os.getenv('TUUN_LOG_PAT...
2.46875
2
content/topic_3_loops/turtle_grid_with_nested_for_loop_example_4.py
chuanhao01/MSP_Learn_Python_Turtle
1
41815
<reponame>chuanhao01/MSP_Learn_Python_Turtle import turtle pen = turtle.Turtle() pen.speed("slowest") # Let's draw something a little more interesting, a 2d grid of squares # How would you draw a grid of squares? # For each row in the grid, draw a certain number of squares (number of columns) square_width = 50 num_r...
4.65625
5
scripts/process_connectivity.py
lejianhuang/RPN-signature_Lejian
11
41816
<filename>scripts/process_connectivity.py #!/usr/bin/env python import warnings warnings.filterwarnings("always") warnings.filterwarnings("ignore", message="numpy.dtype size changed") warnings.filterwarnings("ignore", message="numpy.ufunc size changed") from PAINTeR import global_vars import PAINTeR.connectivity as con...
1.757813
2
seafileapi/repo.py
AdriCueGim/python-seafile
0
41817
<reponame>AdriCueGim/python-seafile import io import posixpath import re import validators from urllib.parse import urlencode from seafileapi.files import SeafDir, SeafFile from seafileapi.utils import raise_does_not_exist class Repo(object): """ A seafile library """ def __init__(self, client, repo_...
3.078125
3
workalendar/tests/test_registry.py
ftatarli/workalendar
2
41818
from datetime import date from unittest import TestCase from workalendar.registry import IsoRegistry from workalendar.core import Calendar class RegionCalendar(Calendar): 'Region' def holidays(self, year=None): return tuple(( (date(year, 12, 25), 'Christmas'), (date(year, 1, ...
2.703125
3
pythonx/ncm2_sorter/abbrfuzzy.py
ncm2/ncm2-abbrfuzzy-matcher
0
41819
import sys class Sorter: def key(self, e): w = e['word'] ud = e['user_data'] hl = ud['match_highlight'] # prefer less pieces pieces = len(hl) # prefer earlier match first_match = sys.maxsize if len(hl): first_match = hl[0][0] # ...
2.828125
3
2021learning/logica.py
rulgamer03/Python-Projects
1
41820
# operador logico print("Ingrese el valor de a") a = float(input()) print("Ingrese el valor de b") b = float(input()) print("b es mayor que a") print(b > a) print(type(b > a)) print("b es menor que a") print(b < a) print("b es mayor o igual que a") print(b >= a) print("b es menor o igual que a") print(b <= a) print("b ...
4.15625
4
efocus/__init__.py
shimonuri/cmdb
0
41821
from . import wrapper from . import logging_filter from . import preload __version__ = "0.1.4"
1.132813
1
staff/views.py
kamiswin/body
0
41822
# coding:utf-8 from django.contrib import auth from django.contrib.auth.decorators import login_required from django.contrib.auth.models import models from django.contrib.auth.models import User from django.conf import settings from django.core.exceptions import ObjectDoesNotExist from django import forms from django....
1.640625
2
datacollector/gasMassFlow.py
IKKUengine/EtaNetPythonClients
2
41823
from connections import i2cAdafruitConnection from observer import observe import parameter import datetime class MassFlow(i2cAdafruitConnection.I2cAdafruitConnection, observe.Observer): dataStr = "'NaN'" headerStr = "'Gas Mass Flow [kg/h]'" def __init__(self, observable): # rs232Connection.Rs232...
2.96875
3
src/AutoGTAP/SimulationCMF/SimulationCMF.py
ltl10121314/Auto-GTAP
1
41824
<filename>src/AutoGTAP/SimulationCMF/SimulationCMF.py<gh_stars>1-10 __author__ = "<NAME>" __project__ = "Auto-GTAP" __created__ = "2018-3-13" from AutoGTAP.Shocks.Shocks import Shocks from AutoGTAP.SimulationShocksShale import SimulationShocksShale class SimulationCMF(object): """Creates an CMF file for controll...
2.140625
2
pyaimsalgo/bin/AimsSulciVoronoi.py
brainvisa/aims-free
4
41825
#!/usr/bin/env python # -*- coding: utf-8 -*- from __future__ import print_function from __future__ import absolute_import import sys, os from soma import aims, aimsalgo import numpy import optparse parser = optparse.OptionParser( description='Voronoi diagram of the sulci ' \ 'nodes regions, in the grey matter, an...
2.375
2
course.py
edunham/classes
0
41826
<reponame>edunham/classes class course(Object): def __init__(self, subject, number, prereqs, credits): self.subject = subject self.number = number self.priority = 1 self.prereqs = prereqs self.credits = credits self.terms = [fall, winter, spring] def display(self)...
3.640625
4
Classifier.py
uniquetrij/CarND-P5-Vehicle-Detection
0
41827
<reponame>uniquetrij/CarND-P5-Vehicle-Detection import inspect import cv2 import numpy as np from sklearn.preprocessing import StandardScaler import time from sklearn.svm import SVC from sklearn.cross_validation import train_test_split from Dataset import Dataset from FeatureCombiner import FeatureCombiner from HOGEx...
2.546875
3
pyknp/knp/drawtree.py
eval-scheme/pyknp
2
41828
<gh_stars>1-10 #-*- encoding: utf-8 -*- from __future__ import unicode_literals from __future__ import absolute_import from __future__ import print_function import re from six.moves import range POS_MARK = { '特殊': '*', '動詞': 'v', '形容詞': 'j', '判定詞': 'c', '助動詞': 'x', '名詞': 'n', '固有名詞': 'N', ...
2.6875
3
test_frame/test_redis_ack_able/test_redis_ack_able_consumer.py
DJMIN/funboost
120
41829
""" 这个是用来测试,以redis为中间件,随意关闭代码会不会造成任务丢失的。 """ import time from funboost import boost,BrokerEnum @boost('test_cost_long_time_fun_queue2', broker_kind=BrokerEnum.REDIS_ACK_ABLE, concurrent_num=5) def cost_long_time_fun(x): print(f'正在消费 {x} 中 。。。。') time.sleep(3) print(f'消费完成 {x} ') if __name__ == '__main__'...
2.515625
3
dungeon/levels/stacking.py
tipishev/python_debugging_workshop
13
41830
<reponame>tipishev/python_debugging_workshop<gh_stars>10-100 from mechanics import check_password _ = None class LostInLegacyCode(Exception): ''' and another one bites the dust of this ancient code ''' MAYBE_HINT_1 = "When lazy and don't know go to Stack O......." MAYBE_HINT_2 = "Hints' wording is a silly whim...
2.828125
3
hfradarpy/plot/plot_nc.py
teresaupdyke/HFRadarPy
0
41831
<gh_stars>0 import xarray as xr import numpy as np import numpy.ma as ma from hfradarpy.calc import uv2spdir, spdir2uv from hfradarpy.plot.common import plot_common import logging from matplotlib import colors from matplotlib.colors import TwoSlopeNorm, Normalize import cmocean logger = logging.getLogger(__name__) d...
2.359375
2
a-practical-introduction-to-python-programming-brian-heinold/chapter-01/exercise-07.py
elarabyelaidy19/awesome-reading
31
41832
<reponame>elarabyelaidy19/awesome-reading<filename>a-practical-introduction-to-python-programming-brian-heinold/chapter-01/exercise-07.py # Write a program that asks the user for a weight in kilograms and converts it to pounds. There # are 2.2 pounds in a kilogram. # Enter a weight in kilograms: 7 # The weight in poun...
4.15625
4
wt_plus/core/http.py
andersoncustodio/wt-plus
1
41833
<reponame>andersoncustodio/wt-plus<filename>wt_plus/core/http.py import os import re from jinja2 import Template class Http(object): def __init__(self, config): self.config = config def install(self): os.system(rf'mkdir -p {self.config.wt_config_path}/sites') os.system(rf'mkdir -p {s...
2.15625
2
api/generated/python/azure-iiot-opc-history/models/event_filter_api_model.py
jaz230/Industrial-IoT
1
41834
# coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for # license information. # # Code generated by Microsoft (R) AutoRest Code Generator 2.3.33.0 # ...
1.789063
2
tests/responses/test_streaming.py
alex-oleshkevich/kupala
8
41835
<filename>tests/responses/test_streaming.py import asyncio import typing as t from kupala.application import Kupala from kupala.requests import Request from kupala.responses import StreamingResponse from kupala.testclient import TestClient def test_streaming_response_with_async_generator() -> None: async def num...
2.5625
3
atomate/vasp/firetasks/tests/test_write_vasp.py
dongsenfo/atomate
1
41836
# coding: utf-8 from __future__ import division, print_function, unicode_literals, absolute_import import os import unittest from fireworks.utilities.fw_serializers import load_object from atomate.vasp.firetasks.write_inputs import WriteVaspFromIOSet, WriteVaspFromPMGObjects, \ ModifyPotcar, ModifyIncar fro...
1.921875
2
internal/notes/builtin-SAVE/packages/exabayes/package.py
HPCToolkit/hpctest
1
41837
<gh_stars>1-10 ############################################################################## # Copyright (c) 2013-2017, Lawrence Livermore National Security, LLC. # Produced at the Lawrence Livermore National Laboratory. # # This file is part of Spack. # Created by <NAME>, <EMAIL>, All rights reserved. # LLNL-CODE-647...
1.421875
1
learnRCNN/train.py
ZDstandup/Some-deep-model-for-text-classification
7
41838
<filename>learnRCNN/train.py #coding=utf-8 #author@zhangdong import datetime import tensorflow as tf import data_helper from tensorflow.contrib import learn import numpy as np from TextRCNN_model import TextRCNN import os import time #configuration FLAGS=tf.flags.FLAGS tf.flags.DEFINE_string('raw_tr...
2.515625
3
observations/r/edc_t.py
hajime9652/observations
199
41839
# -*- coding: utf-8 -*- from __future__ import absolute_import from __future__ import division from __future__ import print_function import csv import numpy as np import os import sys from observations.util import maybe_download_and_extract def edc_t(path): """EPICA Dome C Ice Core 800KYr Temperature Estimates ...
2.9375
3
release/src-rt-6.x.4708/router/samba3/source4/auth/credentials/tests/bind.py
zaion520/ATtomato
2
41840
#!/usr/bin/env python # -*- coding: utf-8 -*- # This is unit with tests for LDAP access checks import optparse import sys import base64 import re import os import copy import time sys.path.insert(0, "bin/python") import samba samba.ensure_external_module("testtools", "testtools") samba.ensure_external_module("subunit...
2.09375
2
samples/test.gromacs.py
SinHouse/qm3
0
41841
<reponame>SinHouse/qm3<gh_stars>0 import os import qm3.mol import qm3.engines.gromacs import qm3.problem import qm3.maths.matrix try: import cStringIO as io except: import io class my_eng( qm3.problem.template ): def __init__( self ): self.mol = qm3.engines.gromacs.coordinates_read( "gromacs.g96" ...
2.125
2
packages/w3af/w3af/core/controllers/tests/pylint_plugins/scapy_fix.py
ZooAtmosphereGroup/HelloPackages
3
41842
<filename>packages/w3af/w3af/core/controllers/tests/pylint_plugins/scapy_fix.py<gh_stars>1-10 from astroid import MANAGER, register_module_extender from astroid.builder import AstroidBuilder CODE_FIX = """ class IP(object): pass class TCP(object): pass class UDP(object): pass class traceroute(object): def __init_...
1.578125
2
arduinotask.py
Kopsi/flower-bot-skill
0
41843
import datetime,pymysql db=pymysql.connect("localhost", "flowerbot", "mycroft", "sensordata") curs=db.cursor() from arduinodata import getCurrentSensorData sensordata = getCurrentSensorData() select_stmt = "SELECT moisture,last_watered FROM history ORDER BY date DESC" with db: curs.execute(select_stmt) moistu...
3.03125
3
main_sno_mdp.py
SunandanAdhikary/safe_near_optimal_mdp
30
41844
<gh_stars>10-100 from __future__ import division, print_function, absolute_import import GPy import numpy as np import arguments from safemdp.grid_world import (compute_S_hat0, shortest_path) from utils.reward_utilities import RewardObj from utils.safety_utilities import SafetyObj from utils.mdp_utilities import (c...
1.882813
2
rl/backup/policy_model.py
qbetterk/user-simulator
20
41845
import torch import torch.nn as nn import torch.optim as optim import torch.nn.functional as F from config import Config def cuda_(var): return var.cuda() if Config.use_gpu else var class Net(nn.Module): def __init__(self, state_dim, num_actions): super(Net, self).__init__() self.linear1 = nn...
2.3125
2
examples/hello_world.py
KolosDan/tgmsg
0
41846
from flask import Flask, request from tgmsg import TelegramClient, messages app = Flask(__name__) client = TelegramClient('<YOUR_TOKEN>') @client.register_message_processor() def text_handler(incoming): msg = messages.TextMessage(incoming.message.text) client.send_message(msg, incoming.message.chat.id) @ap...
2.484375
2
2018/day1p2.py
JonSn0w/advent-of-code
1
41847
<gh_stars>1-10 import sys inp = [int(i) for i in sys.stdin.readlines()] total = 0 vals = set() while True: for i in inp: vals.add(total) total += i if total in vals: print(total) sys.exit() vals.add(total)
2.8125
3
exploration/similarity.py
webmasterraj/gitrecommender
1
41848
<reponame>webmasterraj/gitrecommender def similar_users_query(user): # Pass user object, return query to get users who starred same things as them query = """ select subq.user_id , sum(1/log(subq.stargazers_count+1)) `score` , count(*) `count` from (select others.user_...
2.921875
3
library-management-system/AddBook.py
UltiRequiem/python-proyects-for-intermediates
6
41849
from tkinter import * from PIL import ImageTk, Image from tkinter import messagebox import pymysql def bookRegister(): bid = bookInfo1.get() title = bookInfo2.get() author = bookInfo3.get() status = bookInfo4.get() status = status.lower() insertBooks = ( "insert into "...
3.171875
3
benchmarking/QuanTest2/adjust_msa_to_quantest2.py
KatyBrown/CIAlign
60
41850
#!/usr/bin/env python3 import numpy as np import copy import itertools import sys import ete3 import numpy as np from Bio import AlignIO # import CIAlign.cropSeq as cropSeq # from AlignmentStats import find_removed_cialign def writeOutfile(outfile, arr, nams, rmfile=None): ''' Writes an alignment stored in ...
2.984375
3
exercises/es/test_01_02_02.py
Jette16/spacy-course
2,085
41851
<filename>exercises/es/test_01_02_02.py<gh_stars>1000+ def test(): import spacy.tokens import spacy.lang.de assert isinstance( nlp, spacy.lang.de.German ), "El objeto nlp debería ser un instance de la clase de alemán." assert isinstance( doc, spacy.tokens.Doc ), "¿Procesaste el ...
2.71875
3
myapp/app/tests/tests.py
clozinski/grok.install
1
41852
<filename>myapp/app/tests/tests.py # The tests in test_app.py are picked up by zope.testrunner. # When decorating a unittest.TestCase or doctest with a layer, the layer is # used to group tests and execute setup and teardown of the grok environment # for the test to run in. import unittest import doctest from zope.f...
1.898438
2
resources/libraries/python/TLDK/TLDKConstants.py
preym17/csit
0
41853
# Copyright (c) 2017 Cisco and/or its affiliates. # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at: # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or ag...
1.25
1
175 _labs/d_linked_node.py
lzeeorno/Python-practice175
0
41854
class d_linked_node: def __init__(self, initData, initNext, initPrevious): # constructs a new node and initializes it to contain # the given object (initData) and links to the given next # and previous nodes. self.__data = initData self.__next = initNext ...
3.421875
3
feedback/forms.py
davidavi1/ecosystem1
0
41855
from django import forms from .models import FeedBackModel class FeedBackForms(forms.ModelForm): class Meta: model = FeedBackModel fields = ('name', 'last_name', 'subject', 'text')
2.03125
2
GGDBFetch/ggdbfetch/clusters.py
pdhsulab/GeneGraphDB
6
41856
<reponame>pdhsulab/GeneGraphDB from ggdbfetch import CLUSTERS_DB from os.path import join import sqlite3 def get_clusters(p30_id, dbpath): con = sqlite3.connect(join(dbpath, CLUSTERS_DB)) cur = con.cursor() cmd = 'SELECT p100,p90 FROM clusters WHERE p30="{}"'.format(p30_id) p100_to_p90 = dict() ...
2.6875
3
vlc_helper/scripts/myvlc.py
kenjyco/vlc-helper
0
41857
import click from vlc_helper import vlcstart_precise @click.command() @click.argument('filename', nargs=1, default='') @click.argument('starttime', nargs=1, default='') @click.argument('stoptime', nargs=1, default='') def main(filename, starttime, stoptime): """Start filename at specific start time (and/or end at...
2.65625
3
app/tests/test_parser_cve_json.py
stanleyshuang/cvedata
0
41858
# -*- coding: utf-8 -*- # # Author: <NAME> # Project: crawler 1.0 # Date: 2021-07-10 # import unittest from pkg.util.parser_cve_json import is_cve_json_filename from pkg.util.parser_cve_json import extract_cveid from pkg.util.parser_cve_json import splitcveid class IsCveJsonFilenameTestCase(unittest....
2.359375
2
comsyl/utils/Logger.py
s-sajid-ali/comsyl
2
41859
<reponame>s-sajid-ali/comsyl # coding: utf-8 # /*########################################################################## # # Copyright (c) 2017 European Synchrotron Radiation Facility # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation file...
1.515625
2
cea/plots/optimization/pareto_capacity_installed.py
pajotca/CityEnergyAnalyst
1
41860
<reponame>pajotca/CityEnergyAnalyst<filename>cea/plots/optimization/pareto_capacity_installed.py from __future__ import division from __future__ import print_function import plotly.graph_objs as go from plotly.offline import plot from cea.plots.variable_naming import LOGO, COLOR, NAMING def pareto_capacity_installed...
2.3125
2
app/funcoes/funcoes.py
jaddmn/utilitarios-para-fundacoes-profundas
0
41861
import matplotlib import numpy as np import pandas as pd from funcoes.dados import mse from PyQt5.QtCore import QObject, QAbstractTableModel, Qt from PyQt5.QtWidgets import QTableView class ctrl_func(mse): fs: float = 2 def __init__(self, views): super().__init__() self._views = views d...
2.390625
2
supply_maker/src/model/card_set/candidates.py
LouiS0616/DominionSupplyMaker
0
41862
<reponame>LouiS0616/DominionSupplyMaker from typing import TYPE_CHECKING from ._card_set import CardSet if TYPE_CHECKING: from supply_maker.src.model.constraint.slimmer import CandidateSlimmer class Candidates(CardSet): def __init__(self, *args, **kwargs): self._has_already_slimmed = False su...
2.625
3
tests/nea/test_nea.py
jonheng/sgnlp
0
41863
import unittest import pathlib import shutil import pytest import torch from transformers import PretrainedConfig from sgnlp.models.nea import ( NEAConfig, NEARegPoolingModel, NEARegModel, NEABiRegModel, NEABiRegPoolingModel, NEATokenizer, ) PARENT_DIR = pathlib.Path(__file__).parent class...
2.296875
2
arelle/Locale.py
DataFinnovation/Arelle
1
41864
''' Created on Jan 26, 2011 This module is a local copy of python locale in order to allow passing in localconv as an argument to functions without affecting system-wide settings. (The system settings can remain in 'C' locale.) @author: Mark V Systems Limited (incorporating python locale module code) (original pytho...
2.6875
3
examples/quickhowto2/app/forms.py
ezeev/Flask-AppBuilder
71
41865
from wtforms import StringField from flask_babel import lazy_gettext from wtforms.validators import DataRequired from flask_appbuilder.fieldwidgets import BS3TextFieldWidget from flask_appbuilder.forms import DynamicForm class TestForm(DynamicForm): TestFieldOne = StringField(lazy_gettext('Test Field One'), valid...
2.40625
2
doc/examples/scripts/nucleotide_contacts.py
biotite-dev/bioview
5
41866
""" Contacts between nucleotides in a tetracycline aptamer ====================================================== This example reproduces a figure from the publication *"StreAM-Tg: algorithms for analyzing coarse grained RNA dynamics based on Markov models of connectivity-graphs"* [1]_. The figure displays a coarse g...
2.734375
3
xfl2svg/shape/edge.py
PluieElectrique/xfl2svg
0
41867
"""Convert XFL edges to SVG paths. If you just want to convert, use `xfl_edge_to_svg_path()`. If you're interested in how everything works, read on. """ # Read these links first, as there is no official documentation for the XFL # edge format: # # * https://github.com/SasQ/SavageFlask/blob/master/doc/FLA.txt # * ...
2.921875
3
src/main/python/article_statistics.py
utcompling/fieldspring
14
41868
<filename>src/main/python/article_statistics.py #!/usr/bin/env python ####### ####### article_statistics.py ####### ####### Copyright (c) 2010 <NAME>. ####### # Counts and outputs various statistics about the articles in the # article-data file. from nlputil import * import process_article_data as pad #############...
3.15625
3
popdata_sources/barbieri2012/process.py
ryanraaum/african-mtdna
0
41869
<gh_stars>0 from oldowan.mtconvert import seq2sites, sites2seq, str2sites from oldowan.fasta import fasta from string import translate import pandas as pd import sys import re sys.path.append('../../scripts') from utils import * ## load metadata metadata = pd.read_csv('metadata.csv', index_col=0) region = range2regio...
2.421875
2
__init__.py
traits/dynamic_plot
0
41870
import sys if sys.version_info[0] >= 3 and sys.version_info[1] >= 6: pass else: raise Exception("dynamic_plot: Python 3.6 or a more recent version is required.") from .dynamic_plot import *
1.921875
2
engine.py
Tenvence/polar-inst
0
41871
import torch import torch.nn.utils import torch.cuda.amp as amp import torchvision.ops as cv_ops import utils.bbox_ops as bbox_ops def train_one_epoch(model, optimizer, criterion, lr_scheduler, data_loader, dist_logger, epoch_idx): losses, cls_losses, bbox_losses, centerness_losses = [], [], [], [] model.tr...
2
2
unobase/support/admin.py
unomena/unobase
0
41872
from unobase.support import models __author__ = 'michael' from django.contrib import admin admin.site.register(models.Case) admin.site.register(models.FrequentlyAskedQuestion)
1.570313
2
src/svgParsing/parse_rules.py
lmbaker/crows
0
41873
import re from svgParsing.formatted_text import merge_pages, svg_to_text, FormattedText from svgParsing.table_names import tables_to_remove # A function to parse the rules from SVG files (one per page). def generate_srd_articles(): ''' Parse the svg files created from the SRD, into a dictionary of articles. ...
3.09375
3
HeapSort.py
DatHydroGuy/SortVis
0
41874
from SortBase import SortBase class HeapSort(SortBase): def heapify(self, arr, n, i): largest = i # Root left = 2 * i + 1 # Left child right = 2 * i + 2 # Right child # If left child exists and is greater than root, make it the new root if left < n and arr[i] ...
3.859375
4
stimuli/video_renderer.py
DrugowitschLab/motion-structure-identification
0
41875
<gh_stars>0 from stimuli.motion import Motion from stimuli.motion_structure import MotionStructure import matplotlib as mpl import matplotlib.animation as animation import matplotlib.pyplot as plt from config import fps, ExperimentConfig, DisplayConfig presets = { 'IND': MotionStructure(1, ExperimentConfig.λ_T), ...
2.359375
2
scripts/network-activity.py
games647/ElectroBoard
5
41876
#!/usr/bin/python3 from pysimplesoap.client import SoapClient # Install the above dependency with "pip install pysimplesoap" location = 'http://fritz.box:49000/igdupnp/control/WANCommonIFC1' namespace = 'urn:schemas-upnp-org:service:WANCommonInterfaceConfig:1' action = 'urn:schemas-upnp-org:service:WANCommonInterface...
2.53125
3
linked-list/palindrome.py
kolodach/python-algostructs
0
41877
<gh_stars>0 '''Palindrome Implement a function to check if a linked list is a palindrome. ''' from linkedlist import LinkedList def is_palindrome(linkedlist: LinkedList) -> bool: '''Determines whether list is a palindrome. Args: linkedlist: List to check Returns: True if the list is a palind...
4.1875
4
python/iterables-and-iterators/sol.py
natebwangsut/hackerrank
0
41878
#!/usr/bin/env python """ Hackerrank Solution - <NAME> <@natebwangsut | <EMAIL>> """ __author__ = "<NAME>" __credits__ = ["<NAME>sutthitham"] __license__ = "MIT" __version__ = "1.0.0" __maintainer__ = "<NAME>" __email__ = "<EMAIL>" import itertools line = input() line = input().split() repeat = int(input()) com = ...
3.40625
3
BinanceAsyncWebsocket/BinanceFapiAsyncWs.py
monk-after-90s/BinanceAsyncWebsocket
1
41879
import json import aiohttp from AsyncWebsocketStreamInterface import AsyncWebsocketStreamInterface import websockets from loguru import logger class BinanceFapiAsyncWs(AsyncWebsocketStreamInterface): ws_baseurl = 'wss://fstream.binance.com' restful_baseurl = 'https://fapi.binance.com' def __init__(self,...
2.25
2
app/exception.py
hggffhhfg/project_clever
0
41880
class TimeInBedLessSleepError(Exception): """Ошибка возникающая, если время проведенное в кровати меньше времени сна""" pass class NonUniqueNotationDate(Exception): """Ошибка возникающая, если при импортировании файла с записями находится запись с датой, которая уже существует в дневнике сна/базе данн...
2.3125
2
Operation/Sub.py
janvi16/-HACKTOBERFEST2K20
0
41881
<reponame>janvi16/-HACKTOBERFEST2K20<gh_stars>0 #python program to subtract two numbers using function def subtraction(x,y): #function definifion for subtraction sub=x-y return sub num1=int(input("please enter first number: "))#input from user to num1 num2=int(input("please enter second number: "))#input from...
3.875
4
workplanner/fields.py
pavelmaksimov/work-planner
0
41882
from typing import Optional import peewee import pendulum from workplanner.utils import normalize_datetime, strftime_utc class DateTimeUTCField(peewee.DateTimeField): def python_value(self, value: str) -> Optional[pendulum.DateTime]: if value is not None: return pendulum.parse(value, tz=pend...
2.8125
3
wagtail_to_ion/templatetags/content_type_description.py
anfema/wagtail_to_ion
1
41883
from collections import namedtuple from django import template from wagtail_to_ion.models import get_ion_content_type_description_model register = template.Library() @register.simple_tag def content_type_description(app_label, model_name, verbose_name): ContentTypeDescription = get_ion_content_type_descriptio...
1.992188
2
plugin.video.HaydarGames/default.py
thehtml5ninja/kodi
0
41884
#Youtube channels # # # # # #<NAME> import re import os import sys import urllib2 import buggalo import xbmcgui import xbmcaddon import xbmcplugin BASE_URL = 'http://www.husham.com/?p=11081' PLAY_VIDEO_PATH = 'plugin://plugin.video.youtube/?action=play_video&videoid=%s' PLAYLIST_PATH = 'plugin://plugin.video.youtube/u...
1.804688
2
src/ukw_intelli_store/__init__.py
Maddonix/ukw-intelli-store
0
41885
''' Package to read and process material export data. To use, initiate an endomaterial object and start exploring! --------- Examples: ## Init from ukw_intelli_store import EndoMaterial em = EndoMaterial(path, path) ## To explore all used materials: em.mat_info ## To explore specific material id em.get_mat_info_f...
2.296875
2
parameter.py
tgillet1/PASTA
0
41886
<reponame>tgillet1/PASTA<filename>parameter.py import argparse import platform import os.path from Bio.SubsMat import MatrixInfo from Bio import SeqIO from sequence import NeuriteSequence import sequence from random import shuffle # Validates user-provided command-line arguments relative to sequence alignment class Pa...
2.65625
3
rosidl_runtime_py/utilities.py
fujitatomoya/rosidl_runtime_py
3
41887
<reponame>fujitatomoya/rosidl_runtime_py # Copyright 2019 Open Source Robotics Foundation, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-...
2.03125
2
weibospider/WeiboCookies.py
cirlmcesc/weibo-userdata-crawler
3
41888
# -*- coding: utf-8 -*- """ weibo login """ import json import os import logging import requests from weibospider.WeiboAccounts import accounts logger = logging.getLogger(__name__) def getCookies(username, password): """ 单个账号登录 """ def getAllAccountsCookies(rconn): """ 将所有账号登录后把cookies存入reids """ for...
2.984375
3
electricitylci/canadian_imports.py
gschivley/ElectricityLCI
1
41889
# -*- coding: utf-8 -*- """ Created on Wed Feb 20 15:10:09 2019 @author: cooneyg """ import pandas as pd ca_tech_mix = pd.read_csv('data/canadian_imports.csv')
1.945313
2
test/test_XMLtoJSON.py
unification-com/haiku-node-prototype
3
41890
import json import pytest import xmljson from lxml.etree import fromstring schema_1 = "<schema-template><fields><field><name>account_name</name><type>varchar</type><is-null>false</is-null><table>unification_lookup</table></field><field><name>Heartrate</name><type>int</type><is-null>true</is-null><table>data_1</table...
2.265625
2
src/pyrin/cli/core/template/__init__.py
wilsonGmn/pyrin
0
41891
<filename>src/pyrin/cli/core/template/__init__.py # -*- coding: utf-8 -*- """ cli core template package. """ from pyrin.packaging.base import Package class CLICoreTemplatePackage(Package): """ cli core template package class. """ NAME = __name__
1.367188
1
evaluation/npi-set_2.py
sdlab-naist/Teddy-plus
0
41892
# Source: https://www.geeksforgeeks.org/sets-in-python/ # Python program to # demonstrate intersection # of two sets set1 = [0,1,2,3,4,5] set2 = [3,4,5,6,7,8,9] set3 = set1 + set2 unique_set3 = [] for i in set3: if i not in unique_set3: unique_set3.append(i) print("Intersection using intersecti...
4.3125
4
ib/ext/cfg/EWrapperMsgGenerator.py
gkatsQT/ibpy
1
41893
<filename>ib/ext/cfg/EWrapperMsgGenerator.py #!/usr/bin/env python # -*- coding: utf-8 -*- """ ib.ext.cfg.EWrapperMsgGenerator -> config module for EWrapperMsgGenerator.java. """ modulePreamble = [ 'from ib.ext.AnyWrapperMsgGenerator import AnyWrapperMsgGenerator', 'from ib.ext.Util import Util', ]
1.46875
1
Notebooks/utils/featureSelection_util.py
ferdouszislam/Weather-WaterLevel-Prediction-ML
0
41894
import pandas as pd import numpy as np from sklearn.feature_selection import (SelectKBest, SequentialFeatureSelector, f_regression, mutual_info_regression, mutual_info_classif, f_classif) from sklearn.svm import LinearSVC, LinearSVR def pea...
3.359375
3
biserici_inlemnite/app/migrations/0020_auto_20210924_1110.py
ck-tm/biserici-inlemnite
0
41895
<gh_stars>0 # Generated by Django 3.1.13 on 2021-09-24 08:10 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('app', '0019_auto_20210924_1106'), ] operations = [ migrations.RemoveField( model_name='descrierepage', ...
1.460938
1
website/tests/test_practical_info.py
laudrup/ebbamaala
0
41896
from unittest import mock from urllib.parse import urlencode from django.conf import settings from django.contrib.auth import get_user_model from django.test import TestCase from website.models import PracticalInfo class PracticalInfoViewTests(TestCase): def setUp(self): User = get_user_model() s...
2.484375
2
ABC253/c/main.py
seigot/atcoder
2
41897
<filename>ABC253/c/main.py from cgi import MiniFieldStorage import sys sys.setrecursionlimit(4100000) import math import itertools import collections INF = float('inf') MINF = -float('inf') from heapq import heapify, heappop, heappush from bisect import bisect, bisect_left, bisect_right MOD = 10 ** 9 + 7 def error(*arg...
2.8125
3
library/templexer.py
K4zuki/tempcommand
0
41898
<gh_stars>0 #-*- coding: utf-8 -*- #!/usr/bin/env python # Copyright (c) 2016 <NAME> # # Permission is hereby granted, free of charge, to any person obtaining a copy of # this software and associated documentation files (the "Software"), to deal in the # Software without restriction, including without limitatio...
2.453125
2
tasks/task0014.py
jtprogru/interview-task
3
41899
""" Given an integer array nums, move all 0's to the end of it while maintaining the relative order of the non-zero elements. Note that you must do this in-place without making a copy of the array. Example 1: Input: nums = [0,1,0,3,12] Output: [1,3,12,0,0] Example 2: Input: nums = [0] Output: [0] Con...
4.09375
4