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
players/urls.py
hleejr/hofAI
0
27700
<reponame>hleejr/hofAI from django.urls import path from . import views urlpatterns = [ path('nba/', views.PlayerListView.as_view(), name='nba-list-page'), path('nba/<int:id>/', views.PlayerDetailView.as_view(), name='nba-detail-page'), path('nba/search/', views.PlayerSearch.as_view(), name='nba-search-pag...
1.859375
2
django2/demo/meeting/views.py
Gozeon/code-collections
0
27701
from django.shortcuts import render from django.http import HttpResponse # Create your views here. def hello(request): return HttpResponse("Hello world") def date(request, year, month, day): return HttpResponse({ year: year, month: month, day: day })
1.992188
2
Semester2/bottles.py
ConstantineLinardakis/Programming1Portfolio
1
27702
#loop bottles = 99 while (bottles > 0): if (bottles > 1): print bottles, "bottles of root beer on the wall", bottles, "bottles of root beer" print "Take one down pass it around,", bottles, "bottles of root beer on the wall" else: print bottles, "bottles of root beer on...
3.703125
4
deepcompton/scripts/CreateDatasetWithUncertainties.py
vuillaut/DeepIntegralCompton
1
27703
<gh_stars>1-10 # Deep Learning applique a l'imagerie Compton avec les donnees du satellite INTEGRAL # Hackatlon AstroInfo 2021 ##___ Importations import numpy as np import matplotlib.pyplot as plt import Utilitaires_Compton as compton import pickle as pkl from os import listdir from sys import setrecursionlimit #...
2.921875
3
insta/migrations/0003_auto_20190522_1122.py
eddyyonnie/instanicer
0
27704
# Generated by Django 2.2.1 on 2019-05-22 08:22 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('insta', '0002_pictures'), ] operations = [ migrations.CreateModel( name='Comment', fields=[ ('id', m...
1.890625
2
configs.py
wangchaodong/packaging
15
27705
#!/usr/bin/env python3 # -*- coding: utf-8 -*- import enum import json import os import plistlib import subprocess import time import tools import requests python_script_debug_enable = False # 是否开启debug模式 用于测试脚本 pwd = os.getcwd() # 当前文件的路径 ios_project_path = os.path.abspath(os.path.dirname( pwd) + os.path.sep...
1.898438
2
django_etuovi/utils/testing.py
City-of-Helsinki/django-etuovi
1
27706
<filename>django_etuovi/utils/testing.py<gh_stars>1-10 import typing def _find_type_origin(type_hint): actual_type = typing.get_origin(type_hint) or type_hint if isinstance(actual_type, typing._SpecialForm): # case of typing.Union[…] for origins in map(_find_type_origin, typing.get_args(type_h...
2.265625
2
lauschgeraet/lgiface.py
SySS-Research/Lauschgeraet
25
27707
<filename>lauschgeraet/lgiface.py<gh_stars>10-100 # -*- coding: utf-8 -*- from lauschgeraet.args import args, LG_NS_MODE import subprocess import os import sys import logging import netns log = logging.getLogger(__name__) def get_script_path(): return os.path.dirname(os.path.realpath(sys.argv[0])) TEST = os.pa...
2.1875
2
1099parser.py
liyanghuang/1099-parser
2
27708
import pdfplumber import re import csv from tqdm import tqdm print('(When entering file paths on windows, use \'/\' in the place of \'\\\')') pdf_path = input('Enter the file path of the 1099 pdf:\n') # open up the pdf file, keep trying until user enters valid file valid_pdf = False while not valid_pdf: try: pdf =...
3.671875
4
awards/migrations/0005_rename_avg_rate_rating_average.py
Maryan23/Laurels
0
27709
<gh_stars>0 # Generated by Django 3.2.9 on 2021-12-13 21:01 from django.db import migrations class Migration(migrations.Migration): dependencies = [ ('awards', '0004_auto_20211213_1253'), ] operations = [ migrations.RenameField( model_name='rating', old_name='avg...
1.546875
2
Updated_Self_supervised_training/vq_vae_decoder.py
nerdk312/AMDIM_Decoder
0
27710
import torch import torch.nn as nn import torch.nn.functional as F def _make_residual(channels): # Nawid- Performs a 3x3 convolution followed by a 1x1 convolution - The 3x3 convolution is padded and so the overall shape is the same. return nn.Sequential( nn.ReLU(), nn.Conv2d(channels, channels, 3, ...
3.421875
3
spider/featurization/audio_featurization.py
Rosna/P4ML-UI
1
27711
import os import csv import librosa import numpy as np import pandas as pd from spider.featurization.audio_featurization import AudioFeaturization # Read the test data csv csv_file='data/testAudioData.csv' df = pd.read_csv(csv_file) # Read in the audio data specified by the csv data = [] for idx, row in df.iterrows()...
3.390625
3
Telecom.py
BeatrizRCorreia/health-informatics-project1
0
27712
class Telecom: def __init__(self, contact_db_id, system, value, use, rank, period): self.contact_db_id = contact_db_id self.system = system self.value = value self.use = use self.rank = rank self.period = period def get_contact_db_id(self): return self.contact_db_id def get_system(self): return se...
2.671875
3
anvil/__main__.py
timjr/Openstack-Anvil
1
27713
<reponame>timjr/Openstack-Anvil<gh_stars>1-10 #!/usr/bin/env python # -*- coding: utf-8 -*- # vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright (C) 2012 Yahoo! Inc. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance wi...
1.890625
2
ht13_Ex28_MaxThree.py
mikksillaste/aima-python
0
27714
# kasutaja sisestab 3 numbrit number1 = int(input("Sisesta esimene arv: ")) number2 = int(input("Sisesta teine arv: ")) number3 = int(input("Sisesta kolmas arv: ")) # funktsioon, mis tagastab kolmes sisestatud arvust suurima def largest(number1, number2, number3): biggest = 0 if number1 > biggest: big...
3.921875
4
levelheap-micha-4d/levels/gamma.py
triffid/kiki
2
27715
# level design by <NAME> schemes=[test_scheme, tron_scheme,candy_scheme, default_scheme, green_scheme, yellow_scheme, blue_scheme, red_scheme, metal_scheme, bronze_scheme] # ................................................................................................................. def func_gamma(): s = ...
2.28125
2
feature_importance/feature_attribution.py
UMCUGenetics/cancer_type_classification_from_sparse_SNV_data
0
27716
<filename>feature_importance/feature_attribution.py from __future__ import division import os import sys import numpy as np import pandas as pd import tensorflow as tf from keras import backend as K from keras.models import load_model def freeze_session(session, keep_var_names=None, output_names=None, clear_devices...
2.796875
3
rolldecayestimators/tests/test_polynom_estimator.py
martinlarsalbert/rolldecay-estimators
1
27717
<reponame>martinlarsalbert/rolldecay-estimators<filename>rolldecayestimators/tests/test_polynom_estimator.py<gh_stars>1-10 import pytest import pandas as pd import os.path from sklearn.datasets import make_regression from sklearn.pipeline import Pipeline from sklearn.feature_selection import SelectKBest from sklearn.li...
2.5
2
jzl/utils/wrappers.py
elijahc/jzlsdk
0
27718
import scipy.io as sio import numpy as np class MatWrapper(object): def __init__(self,mat_file): self.mat_fp = mat_file self.data = None class NeuroSurgMat(MatWrapper): def __init__(self, mat_file): self.mat_fp = mat_file self.data = None self._clfp = None se...
2.34375
2
condition/leap year or not using conditional operator.py
PraghadeshManivannan/Python
0
27719
a = int(input("Enter the year:")) print(a,"is leap year") if a%4 == 0 and a%400 == 0 else print(a,"is not a leap year")
4.0625
4
Aula_8/Aula8.py
Mateus-Silva11/AulasPython
0
27720
#Tuplas numeros = [1,2,4,5,6,7,8,9] #lista usuario = {'Nome':'Mateus' , 'senha':<PASSWORD> } #dicionario pessoa = ('Mateus' , 'Alves' , 16 , 14 , 90) #tupla print(numeros) print(usuario) print(pessoa) numeros[1] = 8 usuario['senha'] = <PASSWORD>
3.21875
3
image-generation/variational-auto-encoder/vq-vae/models/vq_vae.py
AaratiAkkapeddi/nnabla-examples
228
27721
# Copyright 2019,2020,2021 Sony Corporation. # Copyright 2021 Sony Group Corporation. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Un...
2.1875
2
src/pyherc/test/builders/level.py
tuturto/pyherc
25
27722
<reponame>tuturto/pyherc # -*- coding: utf-8 -*- # Copyright (c) 2010-2017 <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 rig...
2.125
2
magma/backend/coreir/coreir_transformer.py
leonardt/magma
167
27723
<gh_stars>100-1000 from abc import ABC, abstractmethod from copy import copy import json import logging import os import coreir as pycoreir from magma.digital import Digital from magma.array import Array from magma.bits import Bits from magma.backend.check_wiring_context import check_wiring_context from magma.backend...
1.796875
2
src/encoded/tests/test_static_page.py
4dn-dcic/fourfron
11
27724
<reponame>4dn-dcic/fourfron<gh_stars>10-100 import pytest import webtest from dcicutils.qa_utils import notice_pytest_fixtures from .workbook_fixtures import app_settings, app # are these needed? -kmp 12-Mar-2021 notice_pytest_fixtures(app_settings, app) pytestmark = [pytest.mark.indexing, pytest.mark.working] @...
1.71875
2
api/views.py
rukbotto/reviews-django
0
27725
<gh_stars>0 from django.http import Http404 from django.shortcuts import render from rest_framework import status from rest_framework.permissions import IsAuthenticated from rest_framework.response import Response from rest_framework.views import APIView from api.models import Review from api.serializers import Review...
1.953125
2
test/connector/exchange/altmarkets/test_altmarkets_user_stream_tracker.py
BGTCapital/hummingbot
542
27726
<gh_stars>100-1000 #!/usr/bin/env python import sys import asyncio import logging import unittest import conf from os.path import join, realpath from hummingbot.connector.exchange.altmarkets.altmarkets_user_stream_tracker import AltmarketsUserStreamTracker from hummingbot.connector.exchange.altmarkets.altmarkets_auth...
1.875
2
Lesson_n1/logger/simple-logger.py
LemuelPuglisi/TutoratoTap
8
27727
<reponame>LemuelPuglisi/TutoratoTap import time def log(): """ Python dummy logger example. """ t = 0 while True: print(f'time: {t} \t log sent.') t += 1 time.sleep(1) if __name__ == '__main__': log()
2.8125
3
appzoo/utils/streamlit_utils.py
streamlit-badge-bot/AppZoo
5
27728
#!/usr/bin/env python # -*- coding: utf-8 -*- # @Project : StreamlitApp. # @File : utils # @Time : 2020/11/3 12:17 下午 # @Author : yuanjie # @Email : <EMAIL> # @Software : PyCharm # @Description : https://share.streamlit.io/daniellewisdl/streamlit-cheat-sheet/app.py import pandas ...
3.0625
3
examples/no_ui/huobitest.py
tienjunhsu/vnpy
0
27729
import multiprocessing from time import sleep from datetime import datetime, time from logging import INFO from vnpy.event import EventEngine from vnpy.trader.setting import SETTINGS from vnpy.trader.engine import MainEngine from vnpy.gateway.hbdm import HbdmGateway from vnpy.gateway.hbsdm import HbsdmGateway from vn...
1.914063
2
scripts/has_prebuilt.py
khromiumos/chromiumos-chromite
0
27730
<gh_stars>0 # -*- coding: utf-8 -*- # Copyright 2020 The Chromium OS Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """Script to check if the package(s) have prebuilts. The script must be run inside the chroot. The output is a json d...
2.546875
3
horizon/operational_mgmt/inventory/views.py
open-power-ref-design-toolkit/opsmgr
5
27731
# Copyright 2016, IBM US, 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 applicable law or agreed to in writing...
1.679688
2
umbra/controller.py
galgeek/umbra
48
27732
#!/usr/bin/env python # vim: set sw=4 et: import logging import json import time import threading import kombu import socket from brozzler.browser import BrowserPool, BrowsingException import brozzler import urlcanon class AmqpBrowserController: """ Consumes amqp messages representing requests to browse urls,...
2.546875
3
Alura/MLClassificacao/A2V1dados.py
EduardoMoraesRitter/Alura
0
27733
import csv def carregar_acessos(): dados = []#lado direito marcacoes =[]#as classificaçoes lado esquerdo #abrir o arquivo arquivo = open('acesso.csv', 'r') #leitor de csv leitor = csv.reader(arquivo) #ler cada linha for acessou_home,acessou_como_funciona,acessou_contato,comprou in le...
2.9375
3
Program/DPDP/dpdp/utils/profile_utils.py
italogs/HGS-CVRP
0
27734
import time import numpy as np import torch class Profiler: def __init__(self, dummy=False, device=None): self.events = [] self.dummy = dummy self.device = device if device != torch.device('cpu') else None self.log('start') def log(self, name): if self.dummy: ...
2.4375
2
reviewboard/admin/views.py
vigneshsrinivasan/reviewboard
1
27735
import logging from django.conf import settings from django.contrib.admin.views.decorators import staff_member_required from django.contrib.auth.models import User from django.core.cache import cache from django.http import HttpResponseRedirect from django.shortcuts import render_to_response from django.template.conte...
1.890625
2
src/wls_filter.py
ray075hl/singleLDR2HDR
35
27736
""" WLS filter: Edge-preserving smoothing based onthe weightd least squares optimization framework, as described in Farbman, Fattal, Lischinski, and Szeliski, "Edge-Preserving Decompositions for Multi-Scale Tone and Detail Manipulation", ACM Transactions on Graphics, 27(3), August 2008. Given an input image IN, we see...
2.859375
3
tests/Bug1161780.py
grangier/python-soappy
1
27737
#!/usr/bin/env python import sys sys.path.insert(1, "..") from SOAPpy.Errors import Error from SOAPpy.Parser import parseSOAPRPC original = """<?xml version="1.0"?> <SOAP-ENV:Envelope SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:...
2.734375
3
catalyst/core/misc.py
tadejsv/catalyst
206
27738
from typing import Dict, List, Tuple, Union from collections import OrderedDict from functools import lru_cache import warnings from torch.utils.data import BatchSampler, DataLoader from catalyst.core.callback import ( Callback, CallbackWrapper, IBackwardCallback, ICriterionCallback, IOptimizerCal...
2.359375
2
expandimage.py
LuisLinan/helicity_fluxes
0
27739
import numpy as np def place_mirror(im, x1, x2, y1, y2, mr): """ Place an image mr in specified locations of an image im. The edge locations in im where mr is to be placed are (x1,y1) and (x2,y2) Programmer --------- <NAME> (JHU/APL, 10/12/05) """ nxa = np.zeros(2) nya = np.zeros...
3.8125
4
python/protobufs/services/team/actions/get_teams_pb2.py
getcircle/protobuf-registry
0
27740
# Generated by the protocol buffer compiler. DO NOT EDIT! # source: protobufs/services/team/actions/get_teams.proto from google.protobuf import descriptor as _descriptor from google.protobuf import message as _message from google.protobuf import reflection as _reflection from google.protobuf import symbol_database as...
1.109375
1
albumy/blueprints/user.py
puppetgc/albumy
0
27741
# -*- coding: utf-8 -*- """ :author: <NAME> (徐天明) :url: http://greyli.com :copyright: © 2021 <NAME> <<EMAIL>> :license: MIT, see LICENSE for more details. """ from flask import render_template, current_app, request, Blueprint from albumy.models import User, Photo user_bp = Blueprint('user', __name__) ...
2.1875
2
Tests/Aula_20.py
o-Ian/Practice-Python
4
27742
def lin(): print('-' * 35) # Principal program lin() print(' <NAME> ') lin() lin() print(' CURSO EM VÍDEO ') lin() lin() print(' <NAME> ') lin()
2.75
3
transparentai/datasets/variable/variable.py
Nathanlauga/transparentai
7
27743
<gh_stars>1-10 __all__ = [ 'describe_number', 'describe_datetime', 'describe_object', 'describe' ] import pandas as pd import numpy as np from scipy import stats from transparentai import utils def describe_common(arr): """Common descriptive statistics about an array. Returned statistics: ...
2.6875
3
obniz/obniz/libs/measurements/measure.py
izm51/obniz-python-sdk
11
27744
from ..utils.util import ObnizUtil class ObnizMeasure: def __init__(self, obniz): self.obniz = obniz self._reset() def _reset(self): self.observers = [] def echo(self, params): err = ObnizUtil._required_keys( params, ["io_pulse", "pulse", "pulse_width", "io_ec...
2.390625
2
media_grab-container/src/test/unit_test/controllers_test/test_CompletedDownloadsController.py
tomconnolly94/media_grab
0
27745
<filename>media_grab-container/src/test/unit_test/controllers_test/test_CompletedDownloadsController.py # external dependencies import unittest import mock import os from unittest.mock import call import shutil from mock import MagicMock from datetime import datetime, timedelta # internal dependencies from src.control...
2.1875
2
framework/generated/vulkan_generators/vulkan_referenced_resource_consumer_body_generator.py
tomped01/gfxreconstruct
0
27746
<filename>framework/generated/vulkan_generators/vulkan_referenced_resource_consumer_body_generator.py #!/usr/bin/python3 -i # # Copyright (c) 2020 LunarG, Inc. # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to # de...
1.625
2
python_modules/libraries/dagster-k8s/dagster_k8s/container_context.py
silentsokolov/dagster
0
27747
from typing import TYPE_CHECKING, Any, Dict, List, NamedTuple, Optional, cast import kubernetes import dagster._check as check from dagster.config.validate import process_config from dagster.core.errors import DagsterInvalidConfigError from dagster.core.storage.pipeline_run import PipelineRun from dagster.core.utils ...
1.929688
2
fudge-domain.py
jordantrc/domain-fudgery
0
27748
<filename>fudge-domain.py #!/usr/bin/env python3 # # fudge-domain.py # # Finds potentially useful domains # which are visually similar to the # target domain and ascertains whether # these domains are currently available # (not registered). Also checks if any TLDs # are not registered for the domain. # # Usage: # doma...
2.71875
3
crudbuilder/tables.py
rbuchli/django-crudbuilder
0
27749
<filename>crudbuilder/tables.py<gh_stars>0 import django_tables2 as tables from django_tables2.utils import A from .abstract import BaseBuilder from .helpers import model_class_form, plural, custom_postfix_url class TableBuilder(BaseBuilder): """ Table builder which returns django_tables2 instance app : ...
2.640625
3
sales/tests/test_views.py
MatsLanGoH/greengrocer
0
27750
<gh_stars>0 from django.test import TestCase from django.contrib.auth.models import User from django.urls import reverse from django.utils import timezone from sales.models import Fruit, Transaction from datetime import timedelta # Create your tests here. class FruitListViewTest(TestCase): def setUp(self): ...
2.484375
2
src/solution/112_path_sum.py
rsj217/leetcode-in-python3
1
27751
import random from src.datastruct.bin_treenode import TreeNode import unittest class Solution: def hasPathSum(self, root: TreeNode, targetSum: int) -> bool: num = random.randint(0, 1) d = { 0: self.dfs, 1: self.postorder, 2: self.bfs, } return d...
3.390625
3
setup.py
aloosley/python-highcharts-df
0
27752
#!/usr/bin/env python # -*- coding: utf-8 -*- __author__ = "<NAME> <<EMAIL>>" from setuptools import setup, find_packages setup( name='python-highcharts_df', version='0.1.0', description='python-highcharts_df wrapper for customizable pretty plotting quickly from pandas dataframes', author="<NAME>", ...
1.476563
1
main.py
XianwuLin/debian-package-dependencies-terminator
0
27753
<reponame>XianwuLin/debian-package-dependencies-terminator # /usr/bin/env python # -*- coding: utf-8 -*- import glob import logging import os import shutil import tarfile import tempfile import docker from flask import Flask, jsonify, request, send_file, abort app = Flask(__name__) port = 8765 download_folder = "./de...
2.109375
2
api/models.py
WalkingMachine/wonderland
3
27754
from django.db import models # Description of an object in the arena class Entity(models.Model): entityId = models.AutoField(primary_key=True) entityClass = models.CharField(max_length=30) entityName = models.CharField(max_length=30, null=True, blank=True) entityCategory = models.CharField(max_length=...
2.125
2
Problemset/reorder-list/reorder-list.py
worldwonderer/algorithm
1
27755
# @Title: 重排链表 (Reorder List) # @Author: 18015528893 # @Date: 2021-02-12 16:05:36 # @Runtime: 100 ms # @Memory: 23.9 MB # Definition for singly-linked list. # class ListNode: # def __init__(self, val=0, next=None): # self.val = val # self.next = next class Solution: def reorderList(self, head:...
3.859375
4
lib/JumpScale/baselib/changetracker/ChangeTrackerFactory.py
jumpscale7/jumpscale_core7
0
27756
<filename>lib/JumpScale/baselib/changetracker/ChangeTrackerFactory.py from JumpScale import j from .ChangeTrackerClient import ChangeTrackerClient class ChangeTrackerFactory: def __init__(self): self.logenable=True self.loglevel=5 self._cache={} def get(self, gitlabName="incubaid"): ...
2.4375
2
test_db.py
landynS8990/collabora8e
0
27757
import os import psycopg2 DATABASE_URL = os.environ.get('DATABASE_URL') def test_db(): conn = psycopg2.connect(DATABASE_URL) cur = conn.cursor() cur.execute("SELECT * FROM country;") for country in cur: print(country) cur.close() conn.close() if __name__ == '__main__': test_db(...
3
3
VanillaGift.py
ytcrackers/Vanilla-Card-Balance-Checkers
2
27758
from requests_html import HTMLSession from sys import argv if len(argv) != 2: print("Usage: python3 VanillaGift.py VanillaGift.txt") else: # VanillaGift card balance checker for card in reversed(list(open(argv[1]))): cardNumber, expMonth, expYear, cvv = card.rstrip().split(':') c = cardNumber + ' ' + expMo...
2.703125
3
acme/tests/test_pmap.py
esi-neuroscience/acme
1
27759
# -*- coding: utf-8 -*- # # Testing module for ACME's `ParallelMap` interface # # Builtin/3rd party package imports from multiprocessing import Value import os import sys import pickle import shutil import inspect import subprocess import getpass import time import itertools import logging from typing import Type impo...
1.992188
2
tests/frontend/analysis_frontend.py
CNR-ITTIG/plasodfaxp
1
27760
#!/usr/bin/python # -*- coding: utf-8 -*- """Tests for the analysis front-end object.""" import unittest from plaso.frontend import analysis_frontend from plaso.storage import zip_file as storage_zip_file from tests.frontend import test_lib class AnalysisFrontendTests(test_lib.FrontendTestCase): """Tests for the...
2.53125
3
forms/forms/constants.py
dowjcr/forms
0
27761
<filename>forms/forms/constants.py """Stores constants used as numbers for readability that are used across all apps""" class AdminRoles: """ """ JCRTREASURER = 1 SENIORTREASURER = 2 BURSARY = 3 ASSISTANTBURSAR = 4 CHOICES = ( (JCRTREASURER, 'JCR Treasurer'), (SENIORTREASURER, ...
2.140625
2
simpsonMethod.py
Existence-glitch/PythonCodes
1
27762
import numpy as np from numpy import log #Se define la función a integrar def f(x): return 1 / log(x) #Implementación del método de Simpson #Parámetros: #f es la función a integrar #a el límite inferior de la integral #b el límite superior de la integral #n el número de intervalos def simpson (f, a...
3.625
4
setup.py
cloudify-cosmo/cloudify-cluster-manager
2
27763
<filename>setup.py ######## # Copyright (c) 2020 Cloudify Platform Ltd. All rights reserved # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2...
1.4375
1
practice/bitwise_operations/ex2.py
recursivelycurious/wordnik-repl
346
27764
<reponame>recursivelycurious/wordnik-repl print 0b1, #1 print 0b10, #2 print 0b11, #3 print 0b100, #4 print 0b101, #5 print 0b110, #6 print 0b111 #7 print "******" print 0b1 + 0b11 print 0b11 * 0b11
1.835938
2
meiduo_mall/scripts/regenerate_detail_html.py
1103928458/meiduo_drf
0
27765
# from django.shortcuts import render # import os # from django.conf import settings # from goods.models import SKU # from contents.utils import get_categories # from goods.utils import get_breadcrumb # # def generate_static_sku_detail_html(sku_id): # # sku = SKU.objects.get(id=sku_id) # # category = sku.catego...
2.140625
2
chatbot/algorithm/entity_recognizer.py
ningxie1991/Movie-Chatbot
0
27766
<reponame>ningxie1991/Movie-Chatbot<gh_stars>0 import os import joblib import numpy as np import pandas as pd import sklearn_crfsuite from sklearn_crfsuite import metrics from chatbot.algorithm.question_answering.utils.ner import collate, sent2features, sent2labels class MoviesNER: def __init__(self): #...
2.984375
3
env/lib/python3.6/site-packages/torch/jit/passes/inplace.py
bopopescu/smart_contracts7
0
27767
<filename>env/lib/python3.6/site-packages/torch/jit/passes/inplace.py def _check_inplace(trace): """Checks that all PythonOps that were not translated into JIT format are out of place. Should be run after the ONNX pass. """ graph = trace.graph() for node in graph.nodes(): if node.kind() ==...
2.265625
2
tests/test_logging.py
makaimann/fault
31
27768
<filename>tests/test_logging.py<gh_stars>10-100 import fault.logging def test_logging_smoke(): fault.logging.info("some info msg") fault.logging.debug("some debug msg") fault.logging.warning("some warning msg") fault.logging.error("some error msg")
1.960938
2
rdftools/__init__.py
johnstonskj/rdftools
1
27769
import argparse import i18n import logging import os import rdflib import sys from termcolor import colored from timeit import default_timer as timer __VERSION__ = '0.2.0' __LOG__ = None FORMATS = ['nt', 'n3', 'turtle', 'rdfa', 'xml', 'pretty-xml'] HEADER_SEP = '=' COLUMN_SEP = '|' EMPTY_LINE = '' COLUMN_SPEC = '{:...
2.1875
2
app/utils/scrapy.py
edementyev/py-telegram-broker
0
27770
from loguru import logger from scrapy.crawler import CrawlerProcess from scrapy.utils.log import DEFAULT_LOGGING from scrapy.utils.project import get_project_settings from scrape_magic.spiders.gatherer_spider import GathererSpider from scrape_magic.spiders.starcity_spider import StarcitySpider settings = get_project_...
2
2
app/services/auth.py
sloppysid/faunadb-hipflask
1
27771
from flask import ( Blueprint, request, jsonify, render_template, session, redirect, url_for ) from app.models import User bp = Blueprint('auth', __name__, url_prefix='/auth') ...
2.828125
3
run_extraction_and_generation.py
aychen99/Excavating-Occaneechi-Town
1
27772
import json import pathlib from src.extract_old_site.extract import run_extraction from src.generate_new_site.generate import generate_site if __name__ == "__main__": script_root_dir = pathlib.Path(__file__).parent config = None with open((script_root_dir / "config.json")) as f: config = json.load...
2.515625
3
learning_algorithm/neural_network.py
Bermuhz/DataMiningCompetitionFirstPrize
128
27773
<reponame>Bermuhz/DataMiningCompetitionFirstPrize from sklearn.neural_network import MLPClassifier from commons import variables from commons import tools from scipy.stats import mode def learn(x, y, test_x): (temp_x, temp_y) = tools.simple_negative_sample(x, y, variables.select_rate_nn) clf = MLPClassifier(...
3.1875
3
alpacka/envs/__init__.py
shoot-tree-search/sts
2
27774
"""Environments.""" import gin from alpacka.envs import bin_packing from alpacka.envs import cartpole from alpacka.envs import gfootball from alpacka.envs import octomaze from alpacka.envs import sokoban from alpacka.envs.base import * from alpacka.envs.wrappers import * # Configure envs in this module to ensure th...
1.96875
2
pymbolic/interop/ast.py
alexfikl/pymbolic
0
27775
<gh_stars>0 from __future__ import division, absolute_import, print_function __copyright__ = "Copyright (C) 2015 <NAME>" __license__ = """ 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 ...
2.015625
2
testing.py
mfamilia/minimize_energy_consumption
1
27776
<filename>testing.py import os import numpy as np import random as rn from environment import Environment from keras.models import load_model os.environ['PYTHONHASHSEED'] = '0' np.random.seed(42) rn.seed(12345) number_actions = 5 direction_boundary = (number_actions - 1) / 2 temperature_step = 1.5 env = Environment(...
2.5
2
roomlistwatcher/infrastructure/producing/topics.py
dnguyen0304/room-list-watcher
0
27777
<reponame>dnguyen0304/room-list-watcher<gh_stars>0 # -*- coding: utf-8 -*- from roomlistwatcher.common import utility class Topic(utility.AutomatedEnum): ROOM_FOUND = ()
1.554688
2
GithubP1.py
rcamposm/ChallengePython
0
27778
<reponame>rcamposm/ChallengePython ******************* PARTE I ******************************* #Instalamos git en la terminal de VSC $sudo apt-get install git -y #Revisamos la versión del Git que hemos instalado $git --version # Podemos ver también un resumen de las principales funcionalidades de Git $git #Creamos u...
2.140625
2
packages/How_to_implement_Azure_machine_learning/aml_modeling/project/modeling/models/ebm_models.py
dochines/OpenEduAnalytics
0
27779
from typing import List, Tuple import mlflow import numpy as np import pandas as pd from sklearn.model_selection import train_test_split from interpret.glassbox import ExplainableBoostingClassifier, ExplainableBoostingRegressor from ..OEA_model import OEAModelInterface, ModelType, ExplanationType from ..modeling_ut...
3
3
Problemset/rotate-array/rotate-array.py
KivenCkl/LeetCode
7
27780
# @Title: 旋转数组 (Rotate Array) # @Author: KivenC # @Date: 2019-03-14 16:57:56 # @Runtime: 124 ms # @Memory: 13.4 MB class Solution: def rotate(self, nums: List[int], k: int) -> None: """ Do not return anything, modify nums in-place instead. """ ''' k = k % len(nums) ...
3.96875
4
detectron/utils/wsl_memonger.py
sisrfeng/NA-fWebSOD
23
27781
<filename>detectron/utils/wsl_memonger.py from __future__ import absolute_import from __future__ import division from __future__ import print_function from __future__ import unicode_literals import collections import time import copy from caffe2.python import workspace, core from caffe2.proto import caffe2_pb2 import ...
2.0625
2
staging/management/commands/staging_generator.py
Pyromanser/django-staging
0
27782
import os import sys from optparse import make_option from django.core.management import BaseCommand, call_command from django.conf import settings def rel(*x): return os.path.join(os.path.abspath(os.path.dirname(__file__)), *x) class Command(BaseCommand): option_list = BaseCommand.option_list + ( m...
2.15625
2
test/test_cpy_compat.py
gracinet/hpy
0
27783
<gh_stars>0 from .support import HPyTest class TestCPythonCompatibility(HPyTest): # One note about the should_check_refcount() in the tests below: on # CPython, handles are actually implemented as INCREF/DECREF, so we can # check e.g. after an HPy_Dup the refcnt is += 1. However, on PyPy they # are i...
2
2
blog/migrations/0003_auto_20200321_0543.py
Sergey19940808/blog
0
27784
<filename>blog/migrations/0003_auto_20200321_0543.py<gh_stars>0 # Generated by Django 3.0.4 on 2020-03-21 05:43 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('blog', '0002_auto_20200320_1150'), ] operations = [ migrations.RemoveField( ...
1.421875
1
Curso-em-video-Python/PycharmProjects/pythonExercicios/ex046 - ContagemRegressiva.py
sartinicj/curso-em-video-python
0
27785
<reponame>sartinicj/curso-em-video-python from time import sleep for i in range(10, 0, -1): print(i) sleep(1) print('Yeey!!')
2.546875
3
migrations/versions/1f97f799a477_add_contact_details_to_house.py
havanhuy1997/pmg-cms-2
2
27786
"""Add contact_details to House Revision ID: 1<PASSWORD>7 Revises: <PASSWORD> Create Date: 2018-08-08 10:58:44.869939 """ # revision identifiers, used by Alembic. revision = '1<PASSWORD>' down_revision = '<PASSWORD>' from alembic import op import sqlalchemy as sa def upgrade(): ### commands auto generated by ...
1.539063
2
JYTools/demo/asyncWorker/plusWorker.zh.py
meisanggou/Tools
0
27787
#! /usr/bin/env python # coding: utf-8 from JYTools.JYWorker import AsyncRedisWorker __author__ = 'meisanggou' class PlusWorker(AsyncRedisWorker): def handler_task(self, key, params): print("Enter Plus Worker") if "a" not in params: self.set_current_task_invalid("Need a") if...
2.484375
2
wrappers.py
FlanOfFlans/Capone
0
27788
<filename>wrappers.py import discord class CaponeServer(): def __init__(self, discord_server): self._discord_server = discord_server def get_members(self): return map(CaponeUser, self._discord_server.members()) def equals(self, other): return self._discord_server == other._discord_server class CaponeChann...
2.765625
3
_longname.py
michaelshumshum/kahoot-annoyer
4
27789
from random import randint def longname(): return ''.join(chr(randint(0,143859)) for i in range(10000)).encode('utf-8','ignore').decode()
2.671875
3
concept_formation/examples/examples_utils.py
ThomasHoppe/concept_formation
47
27790
""" This module contains utility functions used in the example scripts. They are implemented separately because they use scipy and numpy and we want to remove external dependencies from within the core library. """ from __future__ import print_function from __future__ import unicode_literals from __future__ impo...
2.9375
3
tests/test_app_builder.py
dmitryhd/avio
2
27791
from aiohttp import web from avio.app_builder import AppBuilder from avio.default_handlers import InfoHandler def test_create_app(): app = AppBuilder().build_app() assert isinstance(app, web.Application) def test_app_config(): builder = AppBuilder({'app_key': 'value'}) app = builder.build_app({'upd...
2.3125
2
scripts/compute_lengths.py
ZurichNLP/understanding-mbr
12
27792
<filename>scripts/compute_lengths.py<gh_stars>10-100 #! /usr/bin/python3 import sys import numpy import argparse import logging def parse_args(): parser = argparse.ArgumentParser() parser.add_argument("--output", type=str, help="Where to save numpy array of lengths.", required=True) args = parser.parse...
3.1875
3
turbinia/workers/analysis/postgresql_acct_test.py
jleaniz/turbinia
0
27793
# -*- coding: utf-8 -*- # Copyright 2022 Google 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 applicable law ...
2
2
top_players.py
ergest/Fantasy-Premier-League
1,011
27794
<gh_stars>1000+ from getters import * from parsers import * def main(): data = get_data() parse_top_players(data, 'data/2020-21') if __name__ == '__main__': main()
2.078125
2
src/annotatepORFs.py
clb1/AnnotateCGDB
0
27795
#!/usr/bin/env python from collections import defaultdict import gzip import os import pandas as pd import sys import pdb def collectDataForMatchesToPMProteins(annotated_PM_proteins, blast_directory): pORF_to_PM_protein_matches = defaultdict(set) blast_file_columns = ["query", "subject", "perc_ident",...
2.53125
3
ch10-unsupervised/clustering/spectral_clustering/tests/test_spectral_embedding_.py
skforest/intro_ds
314
27796
# -*- coding: UTF-8 -*- import numpy as np from numpy.testing import assert_array_almost_equal from spectral_clustering.spectral_embedding_ import spectral_embedding def assert_first_col_equal(maps): constant_vec = [1] * maps.shape[0] assert_array_almost_equal(maps[:, 0] / maps[0, 0], constant_vec) def test...
2.390625
2
setup.py
albarsil/pyschemavalidator-
2
27797
from setuptools import setup, find_packages def readme(): with open('README.md') as f: return f.read() setup( name='pyschemavalidator', version='1.0.4', description='Decorator for endpoint inputs on APIs and a dictionary/JSON validator.', long_description=readme(), long_description_con...
1.414063
1
Programming/list.py
flybaozi/algorithm-study
0
27798
def test1(): arr = [["我", "你好"], ["你在干嘛", "你干啥呢"], ["吃饭呢", "打球呢", "看电视呢"]] new_arr = [] for i in arr[0]: print(i) for j in arr[1]: new_arr.append(i + j) print(new_arr) # # def test(): # while True: # test1(arr) test1()
3.59375
4
fedsimul/utils/language_utils.py
cshjin/fedsimul
11
27799
############################################################################### # Utils functions for language models. # # NOTE: source from https://github.com/litian96/FedProx ############################################################################### ALL_LETTERS = "\n !\"&'(),-.0123456789:;>?ABCDEFGHIJKLMNOPQRST...
3.234375
3