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
RiotGames/API/Match.py
Timohiho/RiotGames
2
15100
<gh_stars>1-10 # Copyright (c) 2021. # The copyright lies with <NAME>, the further use is only permitted with reference to source import urllib.request from RiotGames.API.RiotApi import RiotApi class Match(RiotApi): __timeline_by_match_id_url: str = "https://{}.api.riotgames.com/lol/match/v4/timelines/by-mat...
2.546875
3
google_or_tools/coloring_ip_sat.py
tias/hakank
279
15101
# Copyright 2021 <NAME> <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 applicable law or agreed to in writin...
2.40625
2
src/intermediate_representation/sem_utils.py
ckosten/ValueNet4SPARQL
0
15102
# Copyright (c) Microsoft Corporation. # Licensed under the MIT license. # -*- coding: utf-8 -*- """ # @Time : 2019/5/27 # @Author : Jiaqi&Zecheng # @File : sem_utils.py # @Software: PyCharm """ import os import json import re as regex import spacy from nltk.stem import WordNetLemmatizer wordnet_lemmatizer =...
2.640625
3
src/server/core/tests/test_config.py
Freshia/masakhane-web
20
15103
<reponame>Freshia/masakhane-web<gh_stars>10-100 import os import unittest from flask import current_app from flask_testing import TestCase from core import masakhane class TestDevelopmentConfig(TestCase): def create_app(self): masakhane.config.from_object('core.config.DevelopmentConfig') return ...
2.578125
3
routes/show_bp.py
Silve1ra/fyyur
1
15104
from flask import Blueprint from controllers.show import shows, create_shows, create_show_submission show_bp = Blueprint('show_bp', __name__) show_bp.route('/', methods=['GET'])(shows) show_bp.route('/create', methods=['GET'])(create_shows) show_bp.route('/create', methods=['POST'])(create_show_submission)
2.15625
2
__init__.py
andy-96/GFPGAN
0
15105
from .gfpgan import *
0.992188
1
tools/find_run_binary.py
pospx/external_skia
6,304
15106
#!/usr/bin/python # Copyright (c) 2014 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """Module that finds and runs a binary by looking in the likely locations.""" import os import subprocess import sys def run_comman...
2.859375
3
user/tests.py
Vr3n/django_react_cart_system
0
15107
<filename>user/tests.py from django.contrib.auth import get_user_model from django.test import TestCase # Create your tests here. class UserManagersTests(TestCase): def test_create_user(self): User = get_user_model() user = User.objects.create_user( email="<EMAIL>", password="<PASSWO...
2.71875
3
Examples/AcceptAllRevisions.py
aspose-words-cloud/aspose-words-cloud-python
14
15108
import os import asposewordscloud import asposewordscloud.models.requests from asposewordscloud.rest import ApiException from shutil import copyfile words_api = WordsApi(client_id = '####-####-####-####-####', client_secret = '##################') file_name = 'test_doc.docx' # Upload original document to cloud stora...
2.296875
2
agogosml_cli/cli/templates/{{cookiecutter.PROJECT_NAME_SLUG}}/e2e/testgen/main.py
cicorias/agogosml
13
15109
<filename>agogosml_cli/cli/templates/{{cookiecutter.PROJECT_NAME_SLUG}}/e2e/testgen/main.py import json import os import sys import time from agogosml.common.abstract_streaming_client import find_streaming_clients from agogosml.tools.sender import send from agogosml.tools.receiver import receive eh_base_config = { ...
1.804688
2
MobileRevelator/python/postbank_finanzassistent_decrypt.py
ohunecker/MR
98
15110
<reponame>ohunecker/MR #Filename="finanzassistent" #Type=Prerun import os def main(): ctx.gui_setMainLabel("Postbank Finanzassistent: Extracting key"); error="" dbkey="<KEY>" ctx.gui_setMainLabel("Postbank: Key extracted: " + dbkey) if not (ctx.fs_sqlcipher_decrypt(filename, filename + "...
2.234375
2
imcsdk/__init__.py
kenrusse/imcsdk
0
15111
# Copyright 2016 Cisco Systems, 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 writin...
1.992188
2
64-minimum-path-sum/64-minimum-path-sum.py
jurayev/data-structures-algorithms-solutions
0
15112
class Solution: def minPathSum(self, grid: List[List[int]]) -> int: """ [1,3,1] [1,5,1] [4,2,1] time O (nm) space O(nm) state -> sums[r][c] = min path sum till r, c position initial state -> sums[0][0…cols] = inf -> sums...
3.46875
3
proxy/core/tls/certificate.py
fisabiliyusri/proxy
0
15113
# -*- coding: utf-8 -*- """ proxy.py ~~~~~~~~ ⚡⚡⚡ Fast, Lightweight, Pluggable, TLS interception capable proxy server focused on Network monitoring, controls & Application development, testing, debugging. :copyright: (c) 2013-present by <NAME> and contributors. :license: BSD, see LICENSE for mo...
2.5
2
main.py
PabloEmidio/Know-Weather-GTK
4
15114
import gi gi.require_version('Gtk', '3.0') from gi.repository import Gtk from datetime import datetime from api_request import Weather builder = Gtk.Builder() builder.add_from_file('./glade/main.glade') class Handler: def __init__(self, *args, **kwargs): super(Handler, self).__init__(*args, **kwargs...
2.515625
3
talk_lib/tests/testtalk.py
allankellynet/mimas
0
15115
<filename>talk_lib/tests/testtalk.py #----------------------------------------------------- # Mimas: conference submission and review system # (c) <NAME> 2016-2020 http://www.allankelly.net # Licensed under MIT License, see LICENSE file # ----------------------------------------------------- import unittest from goog...
2.46875
2
bookitoBackend/User/urls.py
mazdakdev/Bookito
10
15116
<reponame>mazdakdev/Bookito<gh_stars>1-10 from django.urls import path from .api import * from knox import views as knox_views urlpatterns = [ #domain.dn/api/v1/register/ | POST path('register/' , SignUpAPI.as_view() , name='register'), #domain.dn/api/v1/register/ | POST path('login/' , SignInAPI.as_...
1.992188
2
solutions/day18.py
nitekat1124/advent-of-code-2021
3
15117
import re from itertools import combinations from utils.solution_base import SolutionBase class Solution(SolutionBase): def solve(self, part_num: int): self.test_runner(part_num) func = getattr(self, f"part{part_num}") result = func(self.data) return result def test_runner(s...
3.21875
3
backend/utils/management/commands/generate_dummy_skills.py
NumanIbnMazid/numanibnmazid.com
1
15118
<reponame>NumanIbnMazid/numanibnmazid.com<filename>backend/utils/management/commands/generate_dummy_skills.py from portfolios.factories.skill_factory import create_skills_with_factory from django.db import transaction from django.core.management.base import BaseCommand class Command(BaseCommand): help = "Generate...
1.796875
2
test/bitfinex_test.py
laisee/bitfinex
0
15119
import unittest import mock import requests import httpretty import settings from bitfinex.client import Client, TradeClient API_KEY = settings.API_KEY API_SECRET = settings.API_SECRET class BitfinexTest(unittest.TestCase): def setUp(self): self.client = Client() def test_should_have_server(self):...
2.78125
3
src/bokeh_app/graph_view.py
avbatchelor/insight-articles-project
0
15120
<filename>src/bokeh_app/graph_view.py<gh_stars>0 import networkx as nx import pickle from bokeh.io import show, output_file from bokeh.plotting import figure from bokeh.models.graphs import from_networkx processed_data_folder = 'C:\\Users\\Alex\\Documents\\GitHub\\insight-articles-project\\data\\processed\\' filename...
2.984375
3
dssm/data_input.py
nlpming/tensorflow-DSMM
0
15121
#!/usr/bin/env python # encoding=utf-8 from inspect import getblock import json import os from os import read from numpy.core.fromnumeric import mean import numpy as np import paddlehub as hub import six import math import random import sys from util import read_file from config import Config # 配置文件 conf = Config() c...
2.75
3
groupbunk.py
shine-jayakumar/groupbunk-fb
1
15122
<reponame>shine-jayakumar/groupbunk-fb<gh_stars>1-10 """ GroupBunk v.1.2 Leave your Facebook groups quietly Author: <NAME> Github: https://github.com/shine-jayakumar LICENSE: MIT """ from selenium import webdriver from selenium.webdriver.support.ui import WebDriverWait from selenium.webdriver.chrome.options import...
2.546875
3
OneSpanAnalysis_Mdl.py
Ivanfdezr/CentralSoftware
0
15123
import numpy as np import numpy.linalg as la from MdlUtilities import Field, FieldList import MdlUtilities as mdl def get_osaCasing_fields(): OD = Field(2030) ID = Field(2031) Weight = Field(2032) Density = Field(2039) E = Field(2040) osaCasing_fields = FieldList() osaCasing_...
2.171875
2
test-examples/million_points.py
tlambert03/image-demos
0
15124
"""Test converting an image to a pyramid. """ import numpy as np import napari points = np.random.randint(100, size=(50_000, 2)) with napari.gui_qt(): viewer = napari.view_points(points, face_color='red')
2.90625
3
pact/test/test_constants.py
dwang7/pact-python
0
15125
from unittest import TestCase from mock import patch from .. import constants class mock_service_exeTestCase(TestCase): def setUp(self): super(mock_service_exeTestCase, self).setUp() self.addCleanup(patch.stopall) self.mock_os = patch.object(constants, 'os', autospec=True).start() d...
2.703125
3
backtrader/backtrader/indicators/__init__.py
harshabakku/live-back-testing-trader
1
15126
<reponame>harshabakku/live-back-testing-trader #!/usr/bin/env python # -*- coding: utf-8; py-indent-offset:4 -*- ############################################################################### # # Copyright (C) 2015, 2016, 2017 <NAME> # # This program is free software: you can redistribute it and/or modify # it under t...
1.992188
2
tests/test_game_map.py
brittleshinpass/mossbread
1
15127
import pytest from array import array from game_map import GameMap from tests.conftest import get_relative_path sample_map_data = tuple( reversed( ( array("I", (0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0)), array("I", (0, 1, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0...
2.046875
2
queryable_properties/managers.py
W1ldPo1nter/django-queryable-properties
36
15128
# encoding: utf-8 from __future__ import unicode_literals import six from django.db.models import Manager from django.db.models.query import QuerySet from .compat import (ANNOTATION_SELECT_CACHE_NAME, ANNOTATION_TO_AGGREGATE_ATTRIBUTES_MAP, chain_query, chain_queryset, ModelIterable, ValuesQuery...
2.21875
2
pml/engineer_tests.py
gatapia/py_ml_utils
183
15129
from __future__ import print_function, absolute_import import unittest, math import pandas as pd import numpy as np from . import * class T(base_pandas_extensions_tester.BasePandasExtensionsTester): def test_concat(self): df = pd.DataFrame({'c_1':['a', 'b', 'c'], 'c_2': ['d', 'e', 'f']}) df.en...
2.734375
3
setup.py
wdv4758h/rsglob
0
15130
<gh_stars>0 import os import sys from setuptools import find_packages, setup, Extension try: # for pip >= 10 from pip._internal.req import parse_requirements except ImportError: from pip.req import parse_requirements try: from setuptools_rust import RustExtension except ImportError: import subproce...
2.015625
2
src/pyrobot/habitat/base.py
cihuang123/pyrobot
2,150
15131
import numpy as np import math import pyrobot.utils.util as prutil import rospy import habitat_sim.agent as habAgent import habitat_sim.utils as habUtils from habitat_sim.agent.controls import ActuationSpec import habitat_sim.errors import quaternion from tf.transformations import euler_from_quaternion, euler_from_mat...
2.34375
2
natwork/chats/admin.py
Potisin/Natwork
0
15132
from django.contrib import admin from .models import Chat class ChatAdmin(admin.ModelAdmin): list_display = ("pk",) admin.site.register(Chat, ChatAdmin)
1.59375
2
examples/etcc.py
t-pimpisa/pythainlp17
0
15133
# -*- coding: utf-8 -*- from pythainlp.tokenize import etcc print(etcc.etcc("คืนความสุข")) # /คืน/ความสุข
2.25
2
cumulogenesis.py
stelligent/cumulogenesis
1
15134
<reponame>stelligent/cumulogenesis #!/usr/bin/env python from cumulogenesis.interfaces import cli cli.run()
1
1
nanpy/bmp180.py
AFTC-1/Arduino-rpi
178
15135
<filename>nanpy/bmp180.py from __future__ import division import logging from nanpy.i2c import I2C_Master from nanpy.memo import memoized import time log = logging.getLogger(__name__) def to_s16(n): return (n + 2 ** 15) % 2 ** 16 - 2 ** 15 class Bmp180(object): """Control of BMP180 Digital pressure senso...
2.6875
3
pygna/cli.py
Gee-3/pygna
32
15136
<gh_stars>10-100 import logging import argh import pygna.command as cmd import pygna.painter as paint import pygna.utils as utils import pygna.block_model as bm import pygna.degree_model as dm """ autodoc """ logging.basicConfig(level=logging.INFO) def main(): argh.dispatch_commands([ # network summary ...
2.125
2
dist/Platform.app/Contents/Resources/lib/python3.7/wx/lib/colourchooser/canvas.py
njalloul90/Genomics_Oncology_Platform
6
15137
""" PyColourChooser Copyright (C) 2002 <NAME> <<EMAIL>> This file is part of PyColourChooser. This version of PyColourChooser is open source; you can redistribute it and/or modify it under the licensed terms. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the i...
3.171875
3
preprocessing/metadata.py
skincare-deep-learning/Skincare-backend
1
15138
<filename>preprocessing/metadata.py<gh_stars>1-10 import json import csv import pandas as pd from isic_api import ISICApi from pandas.io.json import json_normalize # Initialize the API; no login is necessary for public data api = ISICApi(username="SkinCare", password="<PASSWORD>") outputFileName = 'imagedata' imageLi...
2.453125
2
nasbench/scripts/generate-all-graphs.py
bkj/nasbench
0
15139
#!/usr/bin/env python """ generate-all-graphs.py python generate-all-graphs.py | gzip -c > all-graphs.gz """ import sys import json import itertools import numpy as np from tqdm import tqdm from nasbench.lib import graph_util from joblib import delayed, Parallel max_vertices = 7 num_ops = 3 max_edges ...
2.34375
2
ui/mext.py
szymonkaliski/nott
25
15140
<filename>ui/mext.py # FIXME: fix all "happy paths coding" issues import liblo from threading import Thread class Mext(object): device = None def __init__(self, device_port=5000): self.device_receiver = liblo.ServerThread(device_port) self.device_receiver.add_method("/monome/grid/key", "iii...
2.375
2
workers/test/test_exportactionlogsworker.py
kwestpharedhat/quay
0
15141
<reponame>kwestpharedhat/quay<filename>workers/test/test_exportactionlogsworker.py import json import os import pytest from datetime import datetime, timedelta import boto3 from httmock import urlmatch, HTTMock from moto import mock_s3 from app import storage as test_storage from data import model, database from da...
1.8125
2
pageplot/plotmodel.py
JBorrow/pageplot
0
15142
<filename>pageplot/plotmodel.py """ The base top-level plot model class. From this all data and plotting flow. """ from pageplot.exceptions import PagePlotParserError from pathlib import Path from typing import Any, Optional, Dict, List, Union from pageplot.extensionmodel import PlotExtension from pageplot.extension...
2.828125
3
src.py
duldiev/Assignment-2-Scrapping
0
15143
from bs4 import BeautifulSoup as soup from selenium import webdriver class Scrapper: def getArticles(self, cryptoName): url = 'https://coinmarketcap.com/currencies/' + cryptoName + '/news/' driver = webdriver.Firefox() driver.get(url) page = driver.page_source page_soup = ...
3.4375
3
qsubm.py
mark-caprio/mcscript
1
15144
#!/usr/bin/python3 """qsubm -- generic queue submission for task-oriented batch scripts Environment variables: MCSCRIPT_DIR should specify the directory in which the mcscript package is installed, i.e., the directory where the file qsubm.py is found. (Note that qsubm uses this information to locate c...
2.046875
2
trees.py
dmancevo/trees
0
15145
from ctypes import * class Node(Structure): pass Node._fields_ = [ ("leaf", c_int), ("g", c_float), ("min_samples", c_int), ("split_ind", c_int), ("split", c_float), ("left", POINTER(Node)), ("right", POINTER(Node))] trees = CDLL("./trees.so") trees.get_root.argtypes = (c_int, ) trees.get...
2.9375
3
qf_lib/backtesting/order/order.py
webclinic017/qf-lib
198
15146
<gh_stars>100-1000 # Copyright 2016-present CERN – European Organization for Nuclear Research # # 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...
2.078125
2
webdriver/tests/actions/mouse_dblclick.py
shs96c/web-platform-tests
0
15147
<reponame>shs96c/web-platform-tests import pytest from tests.actions.support.mouse import assert_move_to_coordinates, get_center from tests.actions.support.refine import get_events, filter_dict _DBLCLICK_INTERVAL = 640 # Using local fixtures because we want to start a new session between # each test, otherwise the...
2.09375
2
hallucinate/api.py
SySS-Research/hallucinate
199
15148
class BaseHandler: def send(self, data, p): pass def recv(self, data, p): pass def shutdown(self, p, direction=2): pass def close(self): pass
2.109375
2
actions.py
ratnasankeerthanreddy/Chatbot-for-Personal-assisatance
1
15149
<filename>actions.py from typing import Any, Text, Dict, List from rasa_sdk import Action, Tracker from rasa_sdk.executor import CollectingDispatcher from utils import convert_timestamp from rasa_sdk.events import AllSlotsReset import datetime from datetime import timedelta, date import dateutil.parser import boto3 fro...
2.3125
2
main.py
Davidswinkels/DownloadWalkingRoutes
0
15150
from scripts.downloader import * import fiona from shapely.geometry import shape import geopandas as gpd import matplotlib.pyplot as plt from pprint import pprint import requests import json import time import os # Constant variables input_min_lat = 50.751797561 input_min_lon = 5.726110232 input_max_lat = 50.938216069...
2.390625
2
seq2seq-chatbot/chat_web.py
rohitkujur1997/chatbot
104
15151
<reponame>rohitkujur1997/chatbot<filename>seq2seq-chatbot/chat_web.py """ Script for serving a trained chatbot model over http """ import datetime import click from os import path from flask import Flask, request, send_from_directory from flask_cors import CORS from flask_restful import Resource, Api import general_ut...
2.828125
3
tests/test-checkbox.py
JonathanRRogers/twill
0
15152
<gh_stars>0 import twilltestlib import twill from twill import namespaces, commands from twill.errors import TwillAssertionError from mechanize import BrowserStateError def setup_module(): global url url = twilltestlib.get_url() def test_select_multiple(): namespaces.new_local_dict() twill.commands.re...
2.40625
2
native/release/test.py
ncbray/pystream
6
15153
# Copyright 2011 <NAME> # # 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, softw...
2.890625
3
4.py
Andrey543/Prack_10
0
15154
enru=open('en-ru.txt','r') input=open('input.txt','r') output=open('output.txt','w') s=enru.read() x='' prov={'q','w','e','r','t','y','u','i','o','p','a','s','d','f','g','h','j','k','l','z','x','c','v','b','n','m'} slovar={} s=s.replace('\t-\t',' ') while len(s)>0: slovar[s[:s.index(' ')]]=s[s.index(' '):s.index('\...
2.828125
3
examples/siamese_mnist.py
DmitryUlyanov/deeppy
1
15155
<reponame>DmitryUlyanov/deeppy #!/usr/bin/env python """ Siamese networks ================ """ import random import numpy as np import matplotlib.pyplot as plt from matplotlib import offsetbox import deeppy as dp # Fetch MNIST data dataset = dp.dataset.MNIST() x_train, y_train, x_test, y_test = dataset.data(flat=Tr...
2.609375
3
py/tests/tests_integ_yarn.py
My-Technical-Architect/sparkling-water
0
15156
<filename>py/tests/tests_integ_yarn.py # # 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, Versio...
1.8125
2
exchanges/virtualExchangeService.py
AshWorkshop/Trandash
1
15157
<reponame>AshWorkshop/Trandash from twisted.internet import defer, task from twisted.python.failure import Failure from exchanges.base import ExchangeService from exchange import calcVirtualOrderBooks import copy import time def defaultErrHandler(failure): print(failure.getBriefTraceback()) return failure d...
2.09375
2
testplan/testing/cpp/cppunit.py
Morgan-Stanley/Testplan
0
15158
<gh_stars>0 import os from schema import Or from testplan.common.config import ConfigOption from ..base import ProcessRunnerTest, ProcessRunnerTestConfig from ...importers.cppunit import CPPUnitResultImporter, CPPUnitImportedResult class CppunitConfig(ProcessRunnerTestConfig): """ Configuration object for ...
2.109375
2
commands/song.py
Princ3x/ddmbot
8
15159
import discord.ext.commands as dec import database.song from commands.common import * class Song: """Song insertion, querying and manipulation""" def __init__(self, bot): self._bot = bot self._db = database.song.SongInterface(bot.loop) _help_messages = { 'group': 'Song informatio...
2.984375
3
linear_error_analysis/src/main.py
spacesys-finch/Science
0
15160
""" main.py Main driver for the Linear Error Analysis program. Can be run using `lea.sh`. Can choose which plots to see by toggling on/off `show_fig` param. Author(s): <NAME>, <NAME>, <NAME> """ import os import matplotlib.pyplot as plt import numpy as np import config import libs.gta_xch4 as gta_xch4 import libs....
2.421875
2
src/anu/constants/amino_acid.py
ankitskvmdam/anu
0
15161
<reponame>ankitskvmdam/anu """Enum for amino acid.""" from enum import Enum from typing import Dict, TypedDict class AcidityBasicity(Enum): """Enum for acidity and basicity.""" U = 3 # Neutral A = 1 # Acid B = 2 # Base class Charge(Enum): """Enum for charge.""" U = 3 # Neutral P =...
3.109375
3
user_chainload.py
Phidica/sublime-execline
2
15162
import logging import os import re import sublime # external dependencies (see dependencies.json) import jsonschema import yaml # pyyaml # This plugin generates a hidden syntax file containing rules for additional # chainloading commands defined by the user. The syntax is stored in the cache # directory to avoid the...
2.40625
2
nmutant_model/retrain_mu_test0.py
asplos2020/DRTest
1
15163
import os import numpy as np import sys sys.path.append("../") for model in ['lenet1', 'lenet4', 'lenet5']: for attack in ['fgsm', 'cw', 'jsma']: for mu_var in ['gf', 'nai', 'ns', 'ws']: os.system('CUDA_VISIBLE_DEVICES=0 python retrain_mu_mnist.py --datasets=mnist --attack=' + attack + ' --mode...
1.90625
2
characterise_inauthentic_tweets.py
weberdc/socmed_repeatability
2
15164
#!/usr/bin/env python3 from __future__ import print_function import gzip import json import re import sys # import time from argparse import ArgumentParser # from datetime import datetime class Options: def __init__(self): self.usage = 'characterise_inauthentic_tweets.py -i <file of tweets> [-v|--verbos...
2.859375
3
localshop/apps/packages/utils.py
rcoup/localshop
0
15165
<gh_stars>0 import inspect import hashlib import logging import os from django.core.files.uploadedfile import TemporaryUploadedFile from django.db.models import FieldDoesNotExist from django.db.models.fields.files import FileField from django.http import QueryDict from django.utils.datastructures import MultiValueDict...
2.078125
2
bika/lims/browser/worksheet/views/analyses_transposed.py
hocinebendou/bika.gsoc
0
15166
# coding=utf-8 from Products.Five.browser.pagetemplatefile import ViewPageTemplateFile from bika.lims.browser.bika_listing import BikaListingTable from bika.lims.browser.worksheet.views.analyses import AnalysesView class AnalysesTransposedView(AnalysesView): """ The view for displaying the table of manage_results...
2.09375
2
lab1_rest/project/apps/core/views.py
mratkovic/RZNU-Lab
0
15167
from rest_framework import viewsets from .models import User, Photo from .serializers import UserSerializer, PhotoSerializer from .mixins import RequestLogViewMixin from rest_framework.authentication import SessionAuthentication, BasicAuthentication from rest_framework.permissions import IsAuthenticated, IsAuthenticate...
1.984375
2
arc/arc009/arc009b.py
c-yan/atcoder
1
15168
def conv(x): return int(''.join(t[c] for c in x)) b = input().split() N = int(input()) a = [input() for _ in range(N)] t = {b[i]: str(i) for i in range(10)} a.sort(key = lambda x: conv(x)) print(*a, sep='\n')
3.15625
3
setup.py
refnode/spartakiade-2021-session-effective-python
1
15169
<filename>setup.py #!/usr/bin/env python """The setup script.""" from setuptools import setup, find_packages with open("README.adoc") as fh_readme: readme = fh_readme.read() install_reqs = [] setup( author="<NAME>", author_email='<EMAIL>', python_requires='>=3.8', classifiers=[ 'Develop...
1.554688
2
sim/pid.py
jmagine/rf-selection
1
15170
<reponame>jmagine/rf-selection<gh_stars>1-10 '''*-----------------------------------------------------------------------*--- Author: <NAME> Date : Oct 18 2018 TODO ...
1.8125
2
gazoo_device/fire_manager.py
isabella232/gazoo-device
0
15171
<gh_stars>0 # Copyright 2021 Google 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 to ...
1.835938
2
py/desispec/scripts/humidity_corrected_fiberflat.py
echaussidon/desispec
0
15172
<reponame>echaussidon/desispec<filename>py/desispec/scripts/humidity_corrected_fiberflat.py from __future__ import absolute_import, division import os import fitsio import argparse import numpy as np from desiutil.log import get_logger from desispec.io import read_fiberflat,write_fiberflat,findfile,read_frame from ...
2.4375
2
config.py
jfernan2/PRInspector
0
15173
IS_TEST = True REPOSITORY = 'cms-sw/cmssw' def get_repo_url(): return 'https://github.com/' + REPOSITORY + '/' CERN_SSO_CERT_FILE = 'private/cert.pem' CERN_SSO_KEY_FILE = 'private/cert.key' CERN_SSO_COOKIES_LOCATION = 'private/' TWIKI_CONTACTS_URL = 'https://ppdcontacts.web.cern.ch/PPDContacts/ppd_contacts' TWI...
1.945313
2
trainer/ml/utils.py
Telcrome/ai-trainer
1
15174
from enum import Enum from typing import Generator, Tuple, Iterable, Dict, List import cv2 import matplotlib.pyplot as plt import numpy as np import seaborn as sns from scipy.ndimage import label, generate_binary_structure from scipy.ndimage.morphology import distance_transform_edt as dist_trans import trainer.lib as...
2.78125
3
widgets/ImageDetailArea.py
JaySon-Huang/SecertPhotos
0
15175
from PyQt5.QtCore import Qt, pyqtSignal, QSize from PyQt5.QtWidgets import ( QLabel, QWidget, QTreeWidgetItem, QHeaderView, QVBoxLayout, QHBoxLayout, ) from .ImageLabel import ImageLabel from .AdaptiveTreeWidget import AdaptiveTreeWidget class ImageDetailArea(QWidget): # signal imageLoaded = pyqtSig...
2.34375
2
predict.py
zhyq/cws_lstm
7
15176
import argparse import data_helper from sklearn.model_selection import train_test_split import re import lstm from lstm import * import time from viterbi import Viterbi xrange = range def simple_cut(text,dh,lm,viterbi): """对一个片段text(标点符号把句子划分为多个片段)进行预测。""" if text: #print("text: %s" %text) te...
2.4375
2
Regression/multiple_linear_regression.py
Rupii/Machine-Learning
0
15177
<gh_stars>0 # -*- coding: utf-8 -*- """ Created on Sat Feb 24 23:18:54 2018 @author: Rupesh """ # Multiple Linear Regression import numpy as np import pandas as pd import matplotlib.pyplot as plt import seaborn as sns plt.style.use("ggplot") # loading dependies df = pd.read_csv("50_Startups.csv") df.head() X = d...
3.265625
3
2021/day09/part01/smoke_basin.py
fpmosley/advent-of-code
0
15178
#!/usr/bin/env python ''' Advent of Code 2021 - Day 9: Smoke Basin (Part 1) https://adventofcode.com/2021/day/9 ''' import numpy as np class HeightMap(): def __init__(self) -> None: self._grid = np.array([]) def add_row(self, row): np_row = np.array(row) if self._grid.size != 0: ...
3.5625
4
datar/base/trig_hb.py
stjordanis/datar
110
15179
<filename>datar/base/trig_hb.py<gh_stars>100-1000 """Trigonometric and Hyperbolic Functions""" from typing import Callable import numpy from pipda import register_func from ..core.contexts import Context from ..core.types import FloatOrIter from .constants import pi def _register_trig_hb_func(name: str, np_name: s...
2.921875
3
randomised_selection.py
neerajp99/algorithms
1
15180
# Implementation of Randomised Selection """ Naive Approach --------- Parameters --------- An arry with n distinct numbers --------- Returns --------- i(th) order statistic, i.e: i(th) smallest element of the input array --------- Time Complexity --------- O(n.log...
4.3125
4
fate/labeling/txt.py
Mattias1/fate
0
15181
import re from .common import regex_labels, re_number, re_string keywords = ['TODO'] re_keyword = re.compile(r'\b({})\b'.format('|'.join(keywords))) def init(document): document.OnGenerateLabeling.add(main) def main(document): regex_list = [(re_keyword, 'keyword'), (re_number, 'number'), (re_string, 'stri...
2.609375
3
Conteudo das Aulas/146/cgi-bin/cgi4_css_2.py
cerberus707/lab-python
0
15182
#!/usr/bin/env python import cgitb; cgitb.enable() print('Content-type: text/html\n') print( """<html> <head> <title>CGI 4 - CSS</title> <link rel="stylesheet" type="text/css" href="../css/estilo1.css"> </head> <body> <h1>Colocando CSS em um script a parte</h1> <hr> <p>Ola imagens CGI!</p> <di...
2.546875
3
neural-navigation-with-lstm/MARCO/plastk/examples/gngsom.py
ronaldahmed/SLAM-for-ugv
14
15183
<filename>neural-navigation-with-lstm/MARCO/plastk/examples/gngsom.py """ GNG vs SOM comparison example for PLASTK. This script shows how to: - Train PLASTK vector quantizers (SOM and GNG) - Set default parameters - Create a simple agent and environment. - Run an interaction between the agent and the environme...
2.703125
3
projects/ide/sublime/src/Bolt/api/inspect/highlighting.py
boltjs/bolt
11
15184
<filename>projects/ide/sublime/src/Bolt/api/inspect/highlighting.py import sublime from ui.read import settings as read_settings from ui.write import write, highlight as write_highlight from lookup import file_type as lookup_file_type from ui.read import x as ui_read from ui.read import spots as read_spots from ui.read...
2.0625
2
gratipay/models/exchange_route.py
stefb965/gratipay.com
0
15185
from __future__ import absolute_import, division, print_function, unicode_literals import braintree from postgres.orm import Model class ExchangeRoute(Model): typname = "exchange_routes" def __bool__(self): return self.error != 'invalidated' __nonzero__ = __bool__ @classmethod def fro...
2.53125
3
Part-03-Understanding-Software-Crafting-Your-Own-Tools/models/edx-platform/openedx/core/djangoapps/video_pipeline/forms.py
osoco/better-ways-of-thinking-about-software
3
15186
<filename>Part-03-Understanding-Software-Crafting-Your-Own-Tools/models/edx-platform/openedx/core/djangoapps/video_pipeline/forms.py """ Defines a form to provide validations for course-specific configuration. """ from django import forms from openedx.core.djangoapps.video_config.forms import CourseSpecificFlagAdminBa...
2.171875
2
tests/integration/test_create_from_full_info.py
superannotateai/superannotate-python-sdk
26
15187
import os from os.path import dirname from unittest import TestCase import src.superannotate as sa class TestCloneProject(TestCase): PROJECT_NAME_1 = "test create from full info1" PROJECT_NAME_2 = "test create from full info2" PROJECT_DESCRIPTION = "desc" PROJECT_TYPE = "Vector" TEST_FOLDER_PATH...
2.578125
3
spellingcorrector/utils/count.py
NazcaLines/spelling-corrector
0
15188
import os import functools CORPUS_DIR = str(os.getcwd())[:str(os.getcwd()).index('spellingcorrector/')] \ + 'data/corpus.txt' NWORD = {} def checkCorpus(fn): @functools.wraps(fn) def new_func(*args, **kwargs): t = os.path.isfile(CORPUS_DIR) if t == False: raise IOEr...
2.703125
3
rhasspy_weather/parser/nlu_intent.py
arniebarni/rhasspy_weather
5
15189
import logging from rhasspy_weather.data_types.request import WeatherRequest from rhasspy_weather.parser import rhasspy_intent from rhasspyhermes.nlu import NluIntent log = logging.getLogger(__name__) def parse_intent_message(intent_message: NluIntent) -> WeatherRequest: """ Parses any of the rhasspy weathe...
2.640625
3
415-add-strings/add_strings.py
cnluocj/leetcode
0
15190
<filename>415-add-strings/add_strings.py """ 59.40% 其实是大数相加 """ class Solution(object): def addStrings(self, num1, num2): """ :type num1: str :type num2: str :rtype: str """ num1_index = len(num1) - 1 num2_index = len(num2) - 1 if num1_index < 0: ...
3.5
4
plugins/qdb.py
x89/raziel-irc-bot
0
15191
<reponame>x89/raziel-irc-bot<gh_stars>0 import logging log = logging.getLogger(__name__) import json import requests import requests.exceptions import botologist.plugin BASE_URL = 'https://qdb.lutro.me' def _get_quote_url(quote): return BASE_URL + '/' + str(quote['id']) def _get_qdb_data(url, query_params): res...
2.09375
2
skos/method.py
edmondchuc/voc-view
3
15192
<filename>skos/method.py from pyldapi.renderer import Renderer from pyldapi.view import View from flask import render_template, Response from rdflib import Graph, URIRef, BNode import skos from skos.common_properties import CommonPropertiesMixin from config import Config class Method(CommonPropertiesMixin): def ...
2.1875
2
wwt_api_client/communities.py
WorldWideTelescope/wwt_api_client
0
15193
<filename>wwt_api_client/communities.py # Copyright 2019-2020 the .NET Foundation # Distributed under the terms of the revised (3-clause) BSD license. """Interacting with the WWT Communities APIs.""" import json import os.path import requests import sys from urllib.parse import parse_qs, urlparse from . import APIRe...
2.359375
2
FictionTools/amitools/test/suite/vprintf.py
polluks/Puddle-BuildTools
38
15194
import pytest def vprintf_test(vamos): if vamos.flavor == "agcc": pytest.skip("vprintf not supported") vamos.run_prog_check_data("vprintf")
1.890625
2
test/socket_client.py
suxb201/Socks5_DNS_Test
1
15195
#!/usr/bin/env python3 import socket HOST = '127.0.0.1' # 服务器的主机名或者 IP 地址 PORT = 10009 # 服务器使用的端口 with socket.socket(socket.AF_INET, socket.SOCK_STREAM) as s: print(s) s.connect((HOST, PORT)) s.sendall(b'Hello, world') print(s) data = s.recv(1024) print('Received', repr(data))
3.3125
3
util/statuschanger.py
MarkThe/Mark-Tools
1
15196
import requests import Mark from colorama import Fore from util.plugins.common import print_slow, getheaders, proxy def StatusChanger(token, Status): #change status CustomStatus = {"custom_status": {"text": Status}} #{"text": Status, "emoji_name": "☢"} if you want to add an emoji to the status try: ...
2.859375
3
recipes/recipe_modules/cloudbuildhelper/test_api.py
allaparthi/monorail
0
15197
# Copyright 2019 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. from hashlib import sha256 from recipe_engine import recipe_test_api class CloudBuildHelperTestApi(recipe_test_api.RecipeTestApi): def build_success_out...
2.140625
2
tabbi/gmm.py
Yu-AnChen/tabbi
0
15198
import sklearn.mixture import matplotlib.pyplot as plt import numpy as np from matplotlib import ticker import matplotlib.patheffects as mpatheffects def get_gmm_and_pos_label( array, n_components=2, n_steps=5000 ): gmm = sklearn.mixture.GaussianMixture( n_components=n_components, covarianc...
2.71875
3
openGaussBase/testcase/SQL/DML/upsert/Opengauss_Function_DML_Upsert_Case0131.py
opengauss-mirror/Yat
0
15199
""" Copyright (c) 2022 Huawei Technologies Co.,Ltd. openGauss is licensed under Mulan PSL v2. You can use this software according to the terms and conditions of the Mulan PSL v2. You may obtain a copy of Mulan PSL v2 at: http://license.coscl.org.cn/MulanPSL2 THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, W...
1.671875
2