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
src/cascade/executor/cascade_plan.py
adolgert/cascade
0
27800
""" Specification for what parameters are used at what location within the Cascade. """ from os import linesep from types import SimpleNamespace import networkx as nx from cascade.core import getLoggers from cascade.core.parameters import ParameterProperty, _ParameterHierarchy from cascade.input_data import InputData...
2.40625
2
utils/utils.py
YigeWang-WHU/BlastLoadsRegression
0
27801
<reponame>YigeWang-WHU/BlastLoadsRegression import os import pickle as pickle import datetime import time # from contextlib import contextmanger import torch from torch.autograd import Variable import random import numpy as np def time_str(fmt=None): if fmt is None: fmt = '%Y-%m-%d_%H:%M:%S' return dat...
2.265625
2
src/xbrief/deco/__init__.py
pydget/xbrief
0
27802
<gh_stars>0 from .deco_entries import deco_dict, deco_entries from .deco_matrix import deco_matrix from .deco_node import deco from .deco_vector import deco_vector
0.96875
1
GPLT_Python/L1-003.py
upupming/algorithm
107
27803
<gh_stars>100-1000 a = str(input()) b = {'0': 0, '1': 0, '2': 0, '3': 0, '4': 0, '5': 0, '6': 0, '7': 0, '8': 0, '9': 0} for i in a: b[i] = b[i] + 1 for i in range(len(b)): if b[str(i)] == 0: continue print(str(i) + ':' + str(b[str(i)]))
3.03125
3
QRCodeLib/qrcodelib/format/mode_indicator.py
yas78/QRCodeLibPy
0
27804
<filename>QRCodeLib/qrcodelib/format/mode_indicator.py class ModeIndicator: LENGTH = 4 TERMINATOR_VALUE = 0x0 NUMERIC_VALUE = 0x1 ALPHANUMERIC_VALUE = 0x2 STRUCTURED_APPEND_VALUE = 0x3 BYTE_VALUE = 0x4 KANJI_VALUE = 0x8
1.476563
1
cogs/setup.py
wan-hazem/discord-bot
0
27805
<filename>cogs/setup.py from discord import Role, Embed, Color from discord.ext import commands from discord.utils import get from sqlite3 import connect class Setup(commands.Cog, name='Setup'): """ Commandes de setup serveur réservées aux admins """ def __init__(self, bot): self.bot = bot ...
2.671875
3
ppq/parser/onnx_parser.py
wdian/ppq
1
27806
<reponame>wdian/ppq from typing import Any, Dict, Iterable, List from torch import random from ppq.core import NetworkFramework, is_file_exist from ppq.IR import BaseGraph, GraphBuilder, Operation, Variable import onnx from onnx import helper, mapping, numpy_helper class OnnxParser(GraphBuilder): def build_var...
2.109375
2
cubes/query/__init__.py
digitalsatori/cubes
1,020
27807
from .browser import * from .cells import * from .computation import * from .statutils import *
1.023438
1
pymoo/operators/mutation/nom.py
jarreguit/pymoo
762
27808
<filename>pymoo/operators/mutation/nom.py from pymoo.core.mutation import Mutation class NoMutation(Mutation): def _do(self, problem, X, **kwargs): return X
2.296875
2
tokenize.py
jobsforher/Internship
0
27809
import re from sys import argv import sys script, filename=argv text=open(filename) s=text.read() y= re.split('\s+',s) '''rite=open("new.txt", 'w')''' temp=[] values=[0,1,2,3,4,5,6,7,8,9,10,11,12,13] stopword1=['with','more','than','for','a','an','the','then','to','I','as','am','and','is'] for word in y: m=0...
2.90625
3
main.py
zoumt1633/ace2005-preprocessing
0
27810
import os import copy from parser import Parser import json import argparse from tqdm import tqdm def get_data_paths(ace2005_path): test_files, dev_files, train_files = [], [], [] with open('./data_list.csv', mode='r') as csv_file: rows = csv_file.readlines() for row in rows[1:]: ...
2.578125
3
HPOBenchExperimentUtils/core/__init__.py
PhMueller/TrajectoryParser
0
27811
<filename>HPOBenchExperimentUtils/core/__init__.py WORKER_WAIT_FOR_SCHEDULER_TO_START_IN_S = 600 WORKER_WAIT_FOR_NAMESERVER_TO_START_IN_S = 300 SCHEDULER_PING_WORKERS_INTERVAL_IN_S = 10 SCHEDULER_TIMEOUT_WORKER_DISCOVERY_IN_S = 600 # See Explanation in HPOBenchExperimentUtils/__init__.py try: from HPOBenchExperime...
1.367188
1
portfolio/portfolio_site/models/__init__.py
nguyentrisinh/portfolio
0
27812
from .contact import Contact from .project import Project from .link import Link from .category import Category from .project_image import ProjectImage
0.996094
1
cron/main.py
opendatasoft/overpass-query-box
3
27813
<reponame>opendatasoft/overpass-query-box #!/usr/bin/env python import sys import os import urllib import requests import shutil import json import datetime from ftplib import FTP, error_perm, error_reply API_URL = 'http://localhost/cgi-bin' TIMEOUT_MINUTES = 15 HOURS_BEFORE_PROCESS = 24 if len(sys.argv) < 4: sy...
2.359375
2
tf_mnist_softmax.py
vishwesh5/DeepLearningPython
2
27814
# -*- coding: utf-8 -*- """ Created on Fri Jul 6 21:00:25 2018 @author: Vishwesh """ import tensorflow as tf from tensorflow.examples.tutorials.mnist import input_data DATA_DIR = "/tmp/data" NUM_STEPS=1000 MINIBATCH_SIZE=32 data = input_data.read_data_sets(DATA_DIR,one_hot=True) x = tf.placeholder...
2.734375
3
venv/lib/python3.6/site-packages/xero_python/accounting/models/branding_theme.py
6enno/FarmXero
0
27815
<gh_stars>0 # coding: utf-8 """ Accounting API No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 Contact: <EMAIL> Generated by: https://openapi-generator.tech """ import re # noqa: F401 from xero_python.models import BaseModel...
1.734375
2
setup.py
idex-biometrics/fusesoc
829
27816
<gh_stars>100-1000 # Copyright FuseSoC contributors # Licensed under the 2-Clause BSD License, see LICENSE for details. # SPDX-License-Identifier: BSD-2-Clause import os from setuptools import setup def read(fname): return open(os.path.join(os.path.dirname(__file__), fname)).read() setup( name="fusesoc", ...
1.53125
2
planner/migrations/0020_auto_20171028_1709.py
zhajio1988/Vplanner
4
27817
# -*- coding: utf-8 -*- # Generated by Django 1.11.5 on 2017-10-28 09:09 from __future__ import unicode_literals import django.core.validators from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): dependencies = [ ('planner', '0019_auto_20171028...
1.84375
2
check_mana.py
CheapskateProjects/MtgManaRecognition
7
27818
<reponame>CheapskateProjects/MtgManaRecognition """ This code will read file given as parameter and list what mana symbols it contains. created Apr 2017 by CheapskateProjects --------------------------- The MIT License (MIT) Copyright (c) 2017 CheapskateProjects Permission is hereby granted, free of charge, to any...
3.03125
3
src/estimator.py
Dru94/scovid
0
27819
import pprint #Dictionary to hold impact, severe impact and output data data=dict() impactDict=dict() severeImpactDict=dict() estimate=dict() keylist=["currentlyInfected","infectionsByRequestedTime","severeCasesByRequestedTime","hospitalBedsByRequestedTime", "casesForICUByRequestedTime","casesForVentilatorsByReque...
3.453125
3
src/tests/control/test_auth.py
abrock/pretix
1
27820
<reponame>abrock/pretix<filename>src/tests/control/test_auth.py from django.test import Client, TestCase from tests.base import BrowserTest from pretix.base.models import User class LoginFormBrowserTest(BrowserTest): def setUp(self): super().setUp() self.user = User.objects.create_user('<EMAIL>'...
2.15625
2
python/example_code/iam/create_policy.py
Ciul/aws-doc-sdk-examples
1
27821
<reponame>Ciul/aws-doc-sdk-examples<gh_stars>1-10 # Copyright 2010-2019 Amazon.com, Inc. or its affiliates. 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. A copy of # the License is located at # # http://a...
1.992188
2
Part-2-Answers/2-Dictionaries/1-Word2SMS.py
Spigot-Dev/Grok-Intro_To_Programming_Python1-2
2
27822
<gh_stars>1-10 # 11/03/21 # What does this code do? # This code introduces a new idea, Dictionaries. The codes purpose is to take an input, and convert it into the numbers you'd need to press # on an alphanumeric keypad, as shown in the picture. # How do Dictionaries work? # To use our dictionary, we first ...
4.1875
4
typhon/core/type_system/constraints/member_constraint.py
strongrex2001/typhon
4
27823
# -*- coding: utf-8 -*- """ Created on Sun Mar 14 09:40:01 2021 @author: eliphat """ from ..type_var import TypeVar from ..type_repr import RecordType, BottomType from ..system import TypeSystem from .base_constraint import BaseConstraint from .equality_constraint import EqualityConstraint class MemberConstraint(Bas...
2.40625
2
conflowgen/posthoc_analyses/inbound_and_outbound_vehicle_capacity_analysis_report.py
1grasse/conflowgen
0
27824
from __future__ import annotations from conflowgen.posthoc_analyses.inbound_and_outbound_vehicle_capacity_analysis import \ InboundAndOutboundVehicleCapacityAnalysis from conflowgen.reporting import AbstractReportWithMatplotlib class InboundAndOutboundVehicleCapacityAnalysisReport(AbstractReportWithMatplotlib): ...
3.046875
3
src/ehrudite/core/dnn/transformer.py
ClaudioBorges/ehrudite
0
27825
"""Transformer from 'Attention is all you need' (Vaswani et al., 2017)""" # Reference: https://www.tensorflow.org/text/tutorials/transformer # Reference: https://keras.io/examples/nlp/text_classification_with_transformer/ import numpy as np import tensorflow as tf class Transformer(tf.keras.Model): def __init__(...
3.203125
3
backend/tests/baserow/contrib/database/field/test_formula_field_type.py
ashishdhngr/baserow
0
27826
<reponame>ashishdhngr/baserow<filename>backend/tests/baserow/contrib/database/field/test_formula_field_type.py import inspect import pytest from django.db.models import TextField from django.urls import reverse from rest_framework.status import HTTP_200_OK, HTTP_204_NO_CONTENT from baserow.contrib.database.table.cach...
1.835938
2
src/animation.py
ngruver/decon-hnn
6
27827
from oil.utils.utils import export import matplotlib.pyplot as plt from mpl_toolkits.mplot3d import Axes3D import matplotlib.animation as animation import numpy as np @export class Animation(object): def __init__(self, qt,body=None): """ [qt (T,n,d)""" self.qt = qt.data.numpy() T...
2.65625
3
asyncpg_opentracing/tracing.py
condorcet/asyncpg_opentracing
3
27828
from functools import wraps from opentracing import global_tracer, tags, logs from contextlib import contextmanager def operation_name(query: str): # TODO: some statement should contain two words. For example CREATE TABLE. query = query.strip().split(' ')[0].strip(';').upper() return 'asyncpg ' + query ...
2.34375
2
src/sqlfluff/core/rules/functional/segment_predicates.py
r0fls/sqlfluff
0
27829
"""Defines commonly used segment predicates for rule writers. For consistency, all the predicates in this module are implemented as functions returning functions. This avoids rule writers having to remember the distinction between normal functions and functions returning functions. This is not necessarily a complete ...
3
3
acro/train_uncond_dcgan.py
udibr/dcgan_code
9
27830
""" uncond_dcgan1 made with 64x64 images from https://s3.amazonaws.com/udipublic/acro.images.tgz for train.tar.gz """ import argparse parser = argparse.ArgumentParser(description='train uncoditional dcgan') parser.add_argument('--desc', default='uncond_dcgan', help='name to uniq...
2.59375
3
tests/test_base_testclass.py
FrNecas/requre
4
27831
<gh_stars>1-10 # Copyright Contributors to the Packit project. # SPDX-License-Identifier: MIT import os import shutil from requre import RequreTestCase from requre.utils import get_datafile_filename class CheckBaseTestClass(RequreTestCase): def tearDown(self): super().tearDown() data_file_path =...
2.125
2
sabueso/tools/sabueso_UniProtKB_XMLDict/get_name.py
dprada/sabueso
0
27832
from collections import OrderedDict from evidence import Evidence def get_name(item, entity='all'): from ._add_reference_to_evidence import _add_reference_to_evidence evidence = Evidence() fullName = item['uniprot']['entry']['protein']['recommendedName']['fullName'] if type(fullName)==str: ...
2.890625
3
amadeus/shopping/availability/__init__.py
minjikarin/amadeus-python
125
27833
from ._flight_availabilities import FlightAvailabilities __all__ = ['FlightAvailabilities']
1.046875
1
examples/scripts/quickstart.py
dcslin/rafiki
35
27834
<reponame>dcslin/rafiki # # 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 #...
1.625
2
facetool.py
hay/facetool
29
27835
#!/usr/bin/env python3 from dataknead import Knead from facetool import config, media, util from facetool.constants import * from facetool.path import Path from facetool.profiler import Profiler from facetool.errors import ArgumentError from facetool.util import message, force_mkdir, sample_remove, is_json_path from r...
2.09375
2
webapp/views.py
manas11/foodex
1
27836
<filename>webapp/views.py<gh_stars>1-10 from django.contrib.auth import authenticate from django.contrib.auth.decorators import login_required from django.http import JsonResponse from django.shortcuts import render, redirect, get_object_or_404 from _datetime import datetime # from django.http import HttpResponse, Htt...
2.078125
2
src/view/services_read_page.py
nbilbo/services_manager
0
27837
<reponame>nbilbo/services_manager<gh_stars>0 """Frame to show all service\'s register\'s. """ import tkinter.ttk from src.view import constants from src.view.services_page import ServicesPage class ServicesReadPage(ServicesPage): def __init__(self, parent, controller, *args, **kwargs): super(ServicesRea...
2.5625
3
datamodules/dataset.py
ayhokuyan/CartooNet
2
27838
from torchvision.datasets import VisionDataset from datamodules.dsfunction import imread from torch.utils.data import Dataset, RandomSampler, Sampler, DataLoader, TensorDataset, random_split, ConcatDataset import os import glob from typing import List, Sequence, Tuple from itertools import cycle, islice import torch fr...
2.234375
2
anarky/interface.py
MulberryBeacon/anarky
1
27839
<gh_stars>1-10 # -*- coding: utf8 -*- """ Common user interface operations. Author: <NAME> License: MIT (see LICENSE for details) """ # Module import # -------------------------------------------------------------------------------------------------- from os import walk from os.path import isdir, isfile, join import...
2.53125
3
source/intentionally_blank/ext/formatters/eof_newline/formatter.py
sixty-north/intentionally-blank
0
27840
<reponame>sixty-north/intentionally-blank from intentionally_blank.formatter import Formatter class NewlineAtEofFormatter(Formatter): """Ensure the last line of the file has a newline terminator. """ def format(self, lines): """ Args: lines: An iterable series of strings, each...
3.1875
3
scripts/analyze.py
PuchatekwSzortach/voc_fcn
5
27841
""" Script for analyzing model's performance """ import argparse import sys import collections import yaml import tensorflow as tf import tqdm import numpy as np import net.data import net.ml import net.utilities def report_iou_results(categories_intersections_counts_map, categories_unions_counts_map): """ ...
2.625
3
12_solution.py
kng/AoC2020
0
27842
# --- Day 12: Rain Risk --- # https://adventofcode.com/2020/day/12 import time simple = False verbose = 1 if simple: data = 'F10\nN3\nF7\nR90\nF11'.splitlines() else: file = open('12_input.txt', 'r') data = file.read().splitlines() class Ship(object): def __init__(self, d=0, x=0, y=0,...
3.296875
3
chatting/models.py
aliakbars/tbdc
0
27843
<filename>chatting/models.py from __future__ import unicode_literals from django.db import models from django.contrib.auth.models import User # Create your models here. class Chat(models.Model): content = models.TextField() sender = models.ForeignKey(User) receiver = models.ForeignKey(User) date_creat...
2.078125
2
src/neo_loader/helpers/tflite_model_helper.py
minlu1021/neo-loader
0
27844
from collections import OrderedDict from .abstract_model_helper import ModelHelper from tflite.Tensor import Tensor from tflite.Model import Model from tflite.TensorType import TensorType from typing import List class TFLiteModelHelper(ModelHelper): TFLITE_TENSOR_TYPE_TO_DTYPE = {} TFLITE_TENSOR_TYPE_TO_DTYPE[...
2.375
2
wingstructure/aero/aero_moment.py
helo9/wingstructure
7
27845
<filename>wingstructure/aero/aero_moment.py import numpy as np def mean_momentcoefficient(wing, airfoil_db): """calculate mean coefficient of moment for wing Parameters ---------- wing : Wing object describing wing airfoil_db : dict dictionary containing airfoil data """ ...
2.84375
3
backend/vqa_benchmarking_backend/metrics/metrics.py
patilli/vqa_benchmarking
1
27846
<filename>backend/vqa_benchmarking_backend/metrics/metrics.py from typing import List, Tuple import sqlite3 import os import random import json from vqa_benchmarking_backend.datasets.dataset import DatasetModelAdapter, DiagnosticDataset, DataSample from vqa_benchmarking_backend.metrics.bias import eval_bias, inputs_fo...
2.09375
2
hospitals/urls.py
gilga98/ahalya
4
27847
<reponame>gilga98/ahalya from django.urls import path from . import views app_name = "hospitals" urlpatterns = [ path("hospitalList", views.HospitalDetailedList.as_view(), name="hospital_list"), path("hospitalDetail", views.HospitalDetailedSingle.as_view(), name="hospital_read"), ]
1.726563
2
miniteste7/divisoresmaior/divisoresmaior.py
Davvi-Duarte/prog1
0
27848
<filename>miniteste7/divisoresmaior/divisoresmaior.py def maior_numero(lista): a = lista[0] for i in range(len(lista)): if lista[i] > a: a = lista[i] return a def remove_divisores_do_maior(lista): maiornumero=maior_numero(lista) for i in range(len(lista)-1,-1,-1): if (mai...
3.671875
4
RBSP/Pos/_ReadSPDF.py
mattkjames7/RBSP
0
27849
<filename>RBSP/Pos/_ReadSPDF.py from .. import Globals import PyFileIO as pf import os import numpy as np def _ReadSPDF(sc='a'): ''' Reads the SPDF SSCWeb text files (scraped from their HTML output). Input: sc: Spacecraft 'a' or 'b' Returns: numpy.recarray ''' #set up dtype to load dtype = [('Year','...
2.84375
3
setup.py
klaasb/python-dmenuwrap
1
27850
<filename>setup.py from distutils.core import setup setup( name='python-dmenuwrap', author='<NAME>', author_email='<EMAIL>', url='https://github.com/KaGeBe/python-dmenuwrap', version='0.1.0', license='BSD 2-clause', py_modules=['dmenuwrap'] )
1.070313
1
crits/comments/urls.py
dutrow/crits
738
27851
<reponame>dutrow/crits<filename>crits/comments/urls.py from django.conf.urls import url from . import views urlpatterns = [ url(r'^remove/(?P<obj_type>\S+)/(?P<obj_id>\S+)/$', views.remove_comment, name='crits-comments-views-remove_comment'), url(r'^(?P<method>\S+)/(?P<obj_type>\S+)/(?P<obj_id>\S+)/$', views....
2.171875
2
FortressOfSolitude/_FortressOfSolitude/NeutrinoKey/models.py
BDD16/FortressOfSolitude
0
27852
""" DBA 1337_TECH, AUSTIN TEXAS © MAY 2020 Proof of Concept code, No liabilities or warranties expressed or implied. """ # -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models from datetime import datetime from .cryptoutils import CryptoTools from base64 import b64encode, b64dec...
2.390625
2
tests/test_bitshares.py
silverchen0402/python-bitshares
102
27853
<filename>tests/test_bitshares.py # -*- coding: utf-8 -*- import mock import string import unittest import random from pprint import pprint from bitshares import BitShares from bitshares.account import Account from bitsharesbase.operationids import getOperationNameForId from bitshares.amount import Amount from bitshare...
2.390625
2
wms/config/wms.py
bhavesh95863/WMS
0
27854
from __future__ import unicode_literals from frappe import _ def get_data(): return [ { "label": _("WMS"), "icon": "octicon octicon-briefcase", "items": [ { "type": "doctype", "name": "WMS Lead", ...
1.882813
2
medicalseg/utils/utils.py
onecatcn/MedicalSeg
0
27855
<filename>medicalseg/utils/utils.py # Copyright (c) 2020 PaddlePaddle Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICEN...
2.09375
2
src/specific_models/bot-iot/attack_identification/lstm.py
kaylani2/sbseg2020
7
27856
<filename>src/specific_models/bot-iot/attack_identification/lstm.py # Author: <NAME> # github.com/kaylani2 # kaylani AT gta DOT ufrj DOT br ### K: Model: LSTM import sys import time import pandas as pd import os import math import numpy as np from numpy import mean, std from unit import remove_columns_with_one_value, ...
2.046875
2
ledis/datastructures.py
gianghta/Ledis
0
27857
from enum import unique, Enum from typing import Union @unique class DataType(Enum): STR = "str" SET = "set" class BaseDataStructure: __slots__ = {"data", "type", "expire_at"} def __init__(self, data: Union[str, set]): self.data = data # This will raise an error if type is not supp...
3.484375
3
pychpp/ht_matches_archive.py
PiGo86/pychpp
1
27858
import datetime from pychpp import ht_model from pychpp import ht_xml from pychpp import ht_team, ht_match, ht_datetime class HTMatchesArchive(ht_model.HTModel): """ Hattrick matches archive """ _SOURCE_FILE = "matchesarchive" _SOURCE_FILE_VERSION = "1.4" # URL PATH with several params avai...
2.9375
3
langcodes/__init__.py
garyd203/langcodes
0
27859
""" langcodes knows what languages are. It knows the standardized codes that refer to them, such as `en` for English, `es` for Spanish and `hi` for Hindi. Often, it knows what these languages are called *in* a language, and that language doesn't have to be English. See README.md for the main documentation, or read it ...
2.5625
3
tests/integration/suites/sensitive/update.py
bularcasergiu/Anjay
0
27860
# -*- coding: utf-8 -*- # # Copyright 2017-2020 AVSystem <<EMAIL>> # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by ap...
2.109375
2
dataset/gnn_dataset.py
Yu-Yy/MathPoseGNN
1
27861
import torch from torch.utils.data import Dataset import os import pickle class GNNdataset(Dataset): # train and test def __init__(self, data_dir): super().__init__() self.data_dir = data_dir self.file_list = os.listdir(self.data_dir) def __len__(self): return len(self....
2.546875
3
autonapt.py
rainforest-tokyo/AutoNaptPython
0
27862
<filename>autonapt.py #!/usr/bin/env python # -*- coding: utf-8 -*- import os import sys from types import MethodType sys.path.append(os.path.dirname(os.path.realpath(__file__)) + '/detail') from Utils import Utils try: from AutoNapt import AutoNapt except Exception as ex: Utils.print_exception(ex) def exp...
2.4375
2
tests/normalizer/test_number_normalizer.py
tkscode/pyNormalizeNumExp
2
27863
<gh_stars>1-10 import pytest from pynormalizenumexp.expression.base import NNumber, NotationType from pynormalizenumexp.utility.dict_loader import DictLoader from pynormalizenumexp.normalizer.number_normalizer import NumberNormalizer @pytest.fixture(scope="class") def number_normalizer(): return NumberNormalizer...
2.34375
2
kivy/tests/pyinstaller/simple_widget/project/widget.py
Galland/kivy
13,889
27864
<filename>kivy/tests/pyinstaller/simple_widget/project/widget.py<gh_stars>1000+ from kivy.uix.widget import Widget class MyWidget(Widget): def __init__(self, **kwargs): super(MyWidget, self).__init__(**kwargs) def callback(*l): self.x = self.y self.fbind('y', callback) ...
2.25
2
sample/core.py
trs319843/mypackage
0
27865
<filename>sample/core.py # sample\core.py def run_core(): print("In pycharm run_core")
1.375
1
userbot/plugins/spam.py
justteen/BUZZ-USERBOT
0
27866
import asyncio import base64 import os from telethon import functions, types from telethon.tl.functions.messages import ImportChatInviteRequest as Get from userbot import CMD_HELP from userbot.plugins import BOTLOG, BOTLOG_CHATID from userbot.utils import lightning_cmd, edit_or_reply, sudo_cmd @bot.on(lightning_cmd...
2.140625
2
curso_em_video/mundo_1/exs_python/ExPy011.py
LuiZamberlan/Ex.-Python
1
27867
<gh_stars>1-10 l = float(input('Digite a largura da parede em metros: ')) al = float(input('Digite a altura da parede em metros: ')) #Um litro de tinta pinta 2m², largura * altura da parede obtemos a área dela em m² e dividimos por dois para obter a quantidade de tinta necessária. lt = (l * al) / 2 print(f'Com uma pa...
3.6875
4
generators/name.py
vickio/compgen
2
27868
from random import choice from string import Template from . import BaseGenerator class Name(BaseGenerator): def __init__(self, company): self.company = company self.data = self._load_json('name.json') self.templates = self.data.pop('templates') self.noun...
3.28125
3
microcosm_flask/session.py
KensoDev/microcosm-flask
11
27869
""" Support a user-defined per-request session. """ from flask import g def register_session_factory(graph, key, session_factory): """ Register a session creation function so that a new session (of user-defined type) will be saved to `flask.g` on every request (and closed on teardown). In other word...
3.171875
3
pkg_ros_iot_bridge/scripts/temp_for_salim/get_sheet.py
1arshan/Eyantra_Virgi-bot
1
27870
#! /usr/bin/env python2.7 import requests import json import heapq as hq #heap def check_order(order_id,order_info): for i in order_info: if i[1] == order_id: return True return False def check_if_dispatched(order_id): # URL = "https://spreadsheets.google.com/feeds/list/1ria...
2.75
3
llvm-codegen/compiler-tests/test-llvm-4.py
PS-Group/compiler-theory-samples
0
27871
#!/usr/bin/env python3 import os.path import subprocess import shutil def get_compiler_path(): compiler_path = os.path.abspath("../../debug-compiler-theory-samples/llvm_4") if not os.path.exists(compiler_path): raise ValueError('compiler llvm_4 not found') return compiler_path class Runner: d...
2.484375
2
cropwatch/apps/metrics/management/commands/uptime.py
objectsyndicate/Crop-Watch
13
27872
from dateutil.relativedelta import relativedelta from django.core.management.base import BaseCommand from django.utils import timezone from cropwatch.apps.ioTank.models import ioTank, SensorReading from cropwatch.apps.metrics.tasks import * class Command(BaseCommand): help = 'Performs uptime validation every 5' ...
2.03125
2
src/ralph/discovery/tasks.py
quamilek/ralph
0
27873
#!/usr/bin/env python # -*- coding: utf-8 -*- """Asynchronous task support for discovery.""" from __future__ import absolute_import from __future__ import division from __future__ import print_function from __future__ import unicode_literals from datetime import datetime, timedelta from functools import partial impo...
2.015625
2
src/hw_conversion/HWPreprocessor.py
jmbarrios/hw-conversion
0
27874
''' Module containing a preprocessor that keeps cells if they match given expression. ''' # Author: <NAME> <<EMAIL>> import re from typing import Pattern from traitlets import Unicode from nbconvert.preprocessors import Preprocessor class HomeworkPreproccessor(Preprocessor): '''Keeps cells form a notebook that ...
3.375
3
CloacaCodeTests/minheap.py
rockobonaparte/cloaca
3
27875
<filename>CloacaCodeTests/minheap.py raise NotImplementedError("Getting an NPE trying to parse this code") class KeyValue: def __init__(self, key, value): self.key = key self.value = value def __repr__(self): return f"{self.key}->{self.value}" class MinHeap: def __init__(self, st...
3.21875
3
mecademic/Robot.py
nickarmenta/PythonForMecademic
1
27876
#!/usr/bin/env python3 import socket import threading import logging logging.basicConfig(filename='meca.log', level=logging.DEBUG) PROGRAM_FILE = 'program_output.txt' # Dictionary of status indexes in robot status message statusDict = {'activated': 0, 'homed': 1, 'simulating': 2, '...
2.34375
2
renku/core/utils/datetime8601.py
mohammad-sdsc/renku-python
0
27877
<gh_stars>0 # -*- coding: utf-8 -*- # # Copyright 2020 - Swiss Data Science Center (SDSC) # A partnership between École Polytechnique Fédérale de Lausanne (EPFL) and # Eidgenössische Technische Hochschule Zürich (ETHZ). # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file exce...
2.40625
2
dn-real-in/eval.py
ngchc/deepBoosting
49
27878
import os import numpy as np import tensorflow as tf from PIL import Image def modcrop(im, modulo): if len(im.shape) == 3: size = np.array(im.shape) size = size - (size % modulo) im = im[0 : size[0], 0 : size[1], :] elif len(im.shape) == 2: size = np.array(im.shape) size = size - (size % modulo) im = im...
2.484375
2
c_registry.py
shemerofir/skaffold-auto-docs
0
27879
import sh from dotenv import load_dotenv import os load_dotenv() PASSWORD = os.environ.get("sudo_password") def c_registry(): with sh.contrib.sudo(password=PASSWORD, _with=True): sh.docker('run', '-d', '-p', '5000:5000', '--restart=always', '--name', 'registry', 'registry:2')
2.109375
2
api/guids/urls.py
gaybro8777/osf.io
628
27880
<gh_stars>100-1000 from django.conf.urls import url from api.guids import views app_name = 'osf' urlpatterns = [ url(r'^(?P<guids>\w+)/$', views.GuidDetail.as_view(), name=views.GuidDetail.view_name), ]
1.367188
1
drinks/migrations/0002_drink_ingredients.py
jmhubbard/cocktail_api
1
27881
# Generated by Django 3.1.2 on 2020-10-29 04:46 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('recipes', '0001_initial'), ('ingredients', '0001_initial'), ('drinks', '0001_initial'), ] operations = [ migrations.AddField...
1.882813
2
trello_track/__init__.py
seanmacavaney/trello-track
1
27882
<reponame>seanmacavaney/trello-track import sys import json import os import platform import subprocess import contextlib import requests CHECKLIST_NAME = 'Commands' ICON_READY, ICON_IP, ICON_DONE, ICON_FAIL = '⚪', '⌛', '🔵', '🔴' _CREDS = None def CREDS(): global _CREDS if _CREDS is None: c = {} ...
2.1875
2
src/ResourceManager.py
NEKERAFA/Soul-Tower
0
27883
# -*- coding: utf-8 -*- import pygame, sys, os, json from pygame.locals import * IMAGE_PATH = os.path.join('assets', 'images') SPRITE_SHEET_PATH = os.path.join('assets', 'sprites') STAGE_CONF_PATH = os.path.join('assets', 'stages') ROOM_CONF_PATH = os.path.join('assets', 'rooms') DIALOGUE_CONF_PATH = os.path.join('as...
2.609375
3
valuation/migrations/0001_initial.py
jiun0507/minestock
0
27884
<reponame>jiun0507/minestock # Generated by Django 3.2 on 2021-04-28 12:31 from django.conf import settings from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): initial = True dependencies = [ migrations.swappable_dependency(settings.AUTH_...
1.859375
2
ravenframework/SupervisedLearning/ScikitLearn/Ensemble/StackingRegressor.py
khurrumsaleem/raven
0
27885
# Copyright 2017 Battelle Energy Alliance, LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed t...
1.25
1
fluent_contents/rendering/__init__.py
francofuji/django-fluent-contents
0
27886
""" This module provides functions to render placeholder content manually. The functions are available outside the regular templatetags, so it can be called outside the templates as well. Contents is cached in memcache whenever possible, only the remaining items are queried. The templatetags also use these functions ...
2.28125
2
linear regression/simple_linear_regression.py
liangjisheng/Machine-Learning
0
27887
<filename>linear regression/simple_linear_regression.py # -*- coding:utf-8 -*- """ @project = 0602-1 @file = simple_linear_regression @author = Liangjisheng @create_time = 2018/6/2 0002 下午 17:16 """ import matplotlib.pyplot as plt import numpy as np from sklearn import datasets, linear_model # 加载用于回归模型的数据集 # 这个数据集中一共有...
3.171875
3
app/gui/frames/templates/list_frame.py
Matexer/BSPR
0
27888
import tkinter as tk from abc import ABCMeta, abstractmethod from ...frames.templates import FrameTemplate from ...elements import AddButton, EditButton, DeleteButton class ListFrameTemplate(FrameTemplate, metaclass=ABCMeta): def __init__(self, top, *args, **kw): super().__init__(top, *args, **kw) ...
3.0625
3
EllipticCurves/Curve.py
mrajweir/Code
0
27889
<filename>EllipticCurves/Curve.py import matplotlib.pyplot as plt import numpy as np def main(): a = -1 b = 1 y, x = np.ogrid[-5:5:100j, -5:5:100j] plt.contour( x.ravel(), y.ravel(), pow(y, 2) - pow(x, 3) - x * a - b, [0] ) plt.plot(1, 1, 'ro') plt.grid() ...
3.234375
3
importer/management/commands/rebuild_project_stats.py
brand-fabian/varfish-server
0
27890
"""Django command for rebuilding cohort statistics after import.""" import aldjemy from django.contrib.auth import get_user_model from django.core.exceptions import ObjectDoesNotExist from django.core.management.base import BaseCommand, CommandError from django.db import transaction from django.conf import settings f...
2.078125
2
answers/Utkarsh Srivastava/Day 12/Question 2.py
arc03/30-DaysOfCode-March-2021
22
27891
n = int(input()) c = [0]*n for i in range(n): l = int(input()) S = input() for j in range(l): if (S[j]=='0'): continue for k in range(j,l): if (S[k]=='1'): c[i] = c[i]+1 for i in range(n): print(c[i])
3
3
tests/cropSeqTest.py
schnamo/CIAlign
60
27892
<reponame>schnamo/CIAlign #! /usr/bin/env python import unittest from unittest import mock from mock import patch from parameterized import parameterized, parameterized_class import sys import logging import numpy as np from Bio import AlignIO import os from os import path import CIAlign import CIAlign.cropSeq as c...
2.28125
2
cogdl/models/emb/rotate.py
cenyk1230/cogdl
1,072
27893
import torch from torch import Tensor import torch.nn as nn import torch.nn.functional as F from .. import BaseModel, register_model from .knowledge_base import KGEModel @register_model("rotate") class RotatE(KGEModel): r""" Implementation of RotatE model from the paper `"RotatE: Knowledge Graph Embedding by...
2.65625
3
reviewboard/site/evolutions/localsite_public.py
BarracudaPff/code-golf-data-pythpn
0
27894
<gh_stars>0 from __future__ import unicode_literals from django_evolution.mutations import AddField from django.db import models MUTATIONS = [AddField("LocalSite", "public", models.BooleanField, initial=False)]
1.429688
1
PrintDocment.py
Humein/Algorithm-Swift
0
27895
<reponame>Humein/Algorithm-Swift #!/usr/bin/env python3 # -*- coding: utf-8 -*- import os print("方法分类",os.listdir("/Users/zhangxinxin/Code/Algorithm-Swift/方法分类")) print("二分查找",os.listdir("/Users/zhangxinxin/Code/Algorithm-Swift/方法分类/二分查找")) print("双指针",os.listdir("/Users/zhangxinxin/Code/Algorithm-Swift/方法分类/双指针")) p...
2.546875
3
mititools/mititools/serializers/frictionless.py
jimmymathews/MITI
0
27896
import os from os import mkdir from os.path import join from os.path import exists import json import importlib.resources import jinja2 from jinja2 import Environment from jinja2 import BaseLoader with importlib.resources.path('mititools', 'fd_schema.json.jinja') as file: jinja_environment = Environment(loader=Ba...
2.375
2
mvj/urls.py
tuomas777/mvj
0
27897
<gh_stars>0 import rest_framework.urls from django.conf import settings from django.contrib import admin from django.urls import include, path, re_path from rest_framework import routers from rest_framework_swagger.views import get_swagger_view from leasing.views import ktj_proxy from leasing.viewsets.basis_of_rent im...
1.632813
2
ines.py
FlightDev/YSPA
0
27898
import rebound import math from visual import * import matplotlib.pyplot as plt from mpl_toolkits.mplot3d import Axes3D import numpy as np k = 0.01720209895 how_long = 600 start_pos = vector(0, 0, 1.5) start_v = vector(0.7, 0.7, 0) sim = rebound.Simulation() #sun: sim.add(m = 1.) #asteroid: sim.add(m = 0, x = start...
2.265625
2
tests/common/utils/config_utils.py
anniyanvr/snaps-kubernetes
20
27899
# Copyright 2018 <NAME> and Cable Television # Laboratories, 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.0 # # Unless required by applic...
2.09375
2