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
hand_detection.py
sethusaim/Shredder-Machine-System
0
12783651
<filename>hand_detection.py import argparse import datetime from datetime import date import cv2 import numpy as np import xlrd from imutils.video import VideoStream from xlutils.copy import copy from xlwt import Workbook import orien_lines import utils.detector_utils as detector_utils lst1, lst2 = [], [] ap = argp...
2.59375
3
openstack/identity/v3/group.py
anton-sidelnikov/openstacksdk
0
12783652
<filename>openstack/identity/v3/group.py # 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 i...
2.109375
2
bot/__main__.py
BLovegrove/boomer
3
12783653
<gh_stars>1-10 import os import discord from discord.enums import Status from discord.ext import commands from discord_slash.client import SlashCommand from . import config import logging logging.basicConfig( format='%(asctime)s %(levelname)-8s %(message)s', level=logging.INFO, datefmt='%Y-%m-%d %H:%M:%S' ...
2.28125
2
tidycsv/core/parsing.py
gmagannaDevelop/tidyCSV.py
2
12783654
""" Parsing functions All the functions needed to parse an arbitrary csv file and find the biggest semantically coherent group (set) of lines. This maximum set is what we call a "tidy csv", implying that the underlying idea of a consistent comma-separated observations are present. Som...
4.15625
4
21_excel/02_obtendo_linhas_colunas.py
smartao/estudos_python
0
12783655
#!/usr/bin/python3 import openpyxl from openpyxl.utils import get_column_letter, column_index_from_string # Porque usar o util https://is.gd/YrDuST wb = openpyxl.load_workbook('example.xlsx') sheet = wb.get_sheet_by_name('Sheet1') print('Obtendo a letra da coluna a partir de um inteiro') print(get_column_l...
3.46875
3
sh/get_GFED4s_CO_emissions.py
stevenjoelbrey/PMFutures
1
12783656
#!/usr/bin/env python2 import numpy as np import h5py # if this creates an error please make sure you have the h5py library months = '01','02','03','04','05','06','07','08','09','10','11','12' sources = 'SAVA','BORF','TEMF','DEFO','PEAT','AGRI' # in this example we will calculate annual CO emissions for t...
2.78125
3
setup.py
andrey-avdeev/black-fire
0
12783657
<reponame>andrey-avdeev/black-fire # -*- coding: utf-8 -*- import io from setuptools import setup, find_packages with io.open("README.md", "r", encoding="utf-8") as f: readme = f.read() version = "0.0.1" setup( name="black-fire", version=version, description="Usefull wrappers for https://github.com/...
1.390625
1
googletranslateextract.py
LRjunior/FOPP2Ed-slovak
0
12783658
<filename>googletranslateextract.py import re import codecs filenamein = 'foppsk20151010.html' filenameout = 'fopp20151010slovak.html' fh = codecs.open(filenamein, 'r', 'utf-8') data = fh.read() fh.close() f_out = codecs.open(filenameout+"aa", 'w', 'utf-8') f_out.write(data) f_out.close() import re ...
3.046875
3
modules/quiz/models.py
Maurilearn/learnings
0
12783659
<reponame>Maurilearn/learnings from shopyoapi.init import db class Quiz(db.Model): __tablename__ = 'quizes' id = db.Column(db.Integer, primary_key=True) name = db.Column(db.String(100)) question = db.Column(db.String(100)) section_id = db.Column(db.Integer, db.ForeignKey('sections.id'), nu...
3.3125
3
src/jenkins_tui/views/base.py
chelnak/jenkins-tui
13
12783660
<filename>src/jenkins_tui/views/base.py<gh_stars>10-100 from __future__ import annotations from rich.text import Text from textual import events, messages from textual.binding import Bindings from textual.geometry import Size, SpacingDimensions from textual.layouts.grid import GridLayout from textual.reactive import R...
2.375
2
code/visualization/2020/05/5_6_finetune_sparse_facto_perf_vs_param_dense_and_not_dense.py
lucgiffon/psm-nets
1
12783661
import pathlib import pandas as pd from palmnet.visualization.utils import get_palminized_model_and_df, get_df import matplotlib.pyplot as plt import numpy as np import logging import plotly.graph_objects as go import plotly.io as pio from pprint import pprint as pprint mpl_logger = logging.getLogger('matplotlib') mpl...
2.171875
2
djtools/socialnetworks/__init__.py
anuj2511/django-tools-socialnetworks
0
12783662
<filename>djtools/socialnetworks/__init__.py<gh_stars>0 default_app_config = 'djtools.socialnetworks.apps.SocialNetworksConfig'
1.085938
1
conans/test/functional/toolchains/apple/test_xcodebuild_targets.py
Mu-L/conan
1
12783663
<filename>conans/test/functional/toolchains/apple/test_xcodebuild_targets.py<gh_stars>1-10 import platform import textwrap import pytest from conans.test.utils.tools import TestClient xcode_project = textwrap.dedent(""" name: HelloLibrary targets: hello-static: type: library.static plat...
1.835938
2
utils/notify_about_cancel_request.py
itcosplay/cryptobot
0
12783664
async def notify_about_cancel_request(request, username, user_id): from emoji import emojize from loader import bot, db from data.config import super_admins emo_issuing_office = emojize(':office:', use_aliases=True) emo_cash_recive = emojize(':chart_with_upwards_trend:', use_aliases=True)...
2.15625
2
reloader/ImageButton.py
frdfsnlght/Reloader
0
12783665
<reponame>frdfsnlght/Reloader from kivy.lang.builder import Builder from kivy.properties import NumericProperty from kivy.uix.button import Button from kivy.clock import Clock Builder.load_string(''' <ImageButton>: image_normal: '' image_down: '' background_color: 0, 0, 0, 0 padding: self.width ...
2.09375
2
stardog/http/virtual_graphs.py
fventuri-availity/pystardog
0
12783666
from .. import content_types as content_types class VirtualGraph(object): def __init__(self, name, client): self.name = name self.client = client @property def path(self): return '/admin/virtual_graphs/{}'.format(self.name) def update(self, name, mappings, options): m...
2.40625
2
repositories/vcs/base.py
washingtontimes/django-repositories
2
12783667
import os, shutil import settings class BaseVCS(object): def __init__(self, name, anonymous_access, template=None): """ A base class to handle Version Control System functions name = name of the repository anonymous_access = Is it public? template = The name of the ...
2.96875
3
telegram_bot/webhook.py
ProgrammingLanguageLeader/MathematicianBot
0
12783668
<gh_stars>0 import logging from flask import current_app from telegram import Bot def set_webhook() -> Bot: logging.basicConfig( format='%(asctime)s - %(name)s - %(levelname)s - %(message)s', level=logging.INFO ) host_url = current_app.config.get('HOST_URL') host_port = current_app.co...
2.328125
2
vas2nets/urls.py
praekelt/hellomama-registration
0
12783669
from django.conf.urls import url from . import views urlpatterns = [ url(r'^api/v1/fetch_voice_data/$', views.FetchVoiceDataView.as_view()), url(r'^api/v1/sync_welcome_audio/$', views.SyncWelcomeAudioView.as_view()), url(r'^api/v1/resend_last_message/$', views.ResendLastMessageView....
1.679688
2
health.py
oliviamao/first-python
0
12783670
import random health = 50 difficulty = 3 potion_health = int(random.randint(25,50)/ difficulty) health = health + potion_health print (health) import math
2.96875
3
Ch8/08-tuple-01.py
akuks/Python3.6---Novice-to-Ninja
0
12783671
# Create Tuple tup = (1, 2, 3, "Hello", "World") print(tup) # Looping in Tuple for item in tup: print (item) # in operator b = 4 in tup print(b) # Not in Operator b = 4 not in tup print (b)
4.125
4
HackerRank/30 Days Of Code/Python/Day26_NestedLogic.py
AdityaChirravuri/CompetitiveProgramming
1
12783672
<gh_stars>1-10 d, m, y = map(int, input().split()) dd, dm, dy = map(int, input().split()) if dy == y: if dm < m: hackos = 500*(m-dm) elif dm == m: if dd < d: hackos = 15*(d-dd) else: hackos = 0 else: hackos = 0 elif dy > y: hackos = 0 else: ha...
2.515625
3
random_mac/dataset.py
critical-path/random-mac
2
12783673
<gh_stars>1-10 """ This module contains dataset-related functions. """ import csv import itertools import os import macaddress import numpy import pandas def get_ieee_assignments(file): """ Retrieve OUIs and CIDs. Parameters ---------- file : str The name of a file with information on OUIs and CI...
3.296875
3
envisage/plugins/debug/fbi_plugin_definition.py
janvonrickenbach/Envisage_wxPhoenix_py3
0
12783674
#------------------------------------------------------------------------------- # # FBI (Frame Based Inspector) Plugin. # # Written by: <NAME> # # Date: 1/4/2006 # # (c) Copyright 2006 by Enthought, Inc. # #------------------------------------------------------------------------------- #--------------------------...
1.695313
2
src/apps/blog/utils.py
Pewpewarrows/MyModernLife
0
12783675
<gh_stars>0 import re def get_unique_slug(slug, conflicts): num = 1 while True: test = '%s-%d' % (slug, num) found = False for c in conflicts: if c.slug == test: found = True break if not found: return test ...
3.09375
3
src/parallel_graph_distance_driver.py
Abdumaleek/infinity-mirror
0
12783676
<reponame>Abdumaleek/infinity-mirror<gh_stars>0 import os import sys; from pathlib import Path sys.path.extend('../') import pandas as pd from src.graph_distance import GraphDistance import networkx as nx from src.graph_stats import GraphStats from src.parallel import parallel_async from src.utils import load_pickle...
2.125
2
inspection_sdk/api/template/delete_pb2.py
easyopsapis/easyops-api-python
5
12783677
# -*- coding: utf-8 -*- # Generated by the protocol buffer compiler. DO NOT EDIT! # source: delete.proto import sys _b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1')) from google.protobuf import descriptor as _descriptor from google.protobuf import message as _message from google.protobuf impo...
1.21875
1
strings/findTheDifference.py
kushvr7/High-On-DSA
76
12783678
# https://leetcode.com/problems/find-the-difference/ class Solution(object): # TC :O(N) # SC :O(N) def findTheDifference(self, s, t): """ :type s: str :type t: str :rtype: str """ dict = {i : s.count(i) for i in s} for i in t: ...
3.390625
3
optalg/opt_solver/cplex_cmd.py
romcon/OPTALG
1
12783679
#****************************************************# # This file is part of OPTALG. # # # # Copyright (c) 2019, <NAME>. # # # # OPTALG is released under the BSD 2-clause license. # #*****...
2.140625
2
Python/testes/unittest-estudo/app/tests/test_validate_file.py
wendrewdevelop/Estudos
0
12783680
<reponame>wendrewdevelop/Estudos import unittest class TestFile(unittest.TestCase): """ Validando o arquivo """ def test_validando_path_arquivo(path_file): ''' Verificando se o nosso arquivo esta no path correto ''' path_file='batch.csv' ...
3.09375
3
sanitize_temperatures.py
mscalora/Plugin-Examples
14
12783681
# coding=utf-8 def sanitize_temperatures(comm, parsed_temps): return dict((k, v) for k, v in parsed_temps.items() if isinstance(v, tuple) and len(v) == 2 and is_sane(v[0])) def is_sane(actual): return 1.0 <= actual <= 300.0 __plugin_name__ = "Sanitize Temperatures" __plugin_pythoncompat__ = ">=2.7,<4"...
3.09375
3
nnet/model_org.py
trip2eee/nnet
3
12783682
<gh_stars>1-10 import csv import time import numpy as np from nnet.loss.loss import Loss from nnet.optim.optimizer import Optimizer class Model: def __init__(self, dim_input, dim_output, hidden_config, rnd_mean=0, rnd_std=0.0030): self.is_training = False self.dim_input = dim_input self.d...
2.609375
3
Week6/Day5/dailychallenge.py
malharlakdawala/DevelopersInstitute
0
12783683
<reponame>malharlakdawala/DevelopersInstitute<filename>Week6/Day5/dailychallenge.py import json import random import psycopg2 import requests HOSTNAME = 'localhost' USERNAME = 'postgres' PASSWORD = '<PASSWORD>' DATABASE = 'MenuPython1' connection = psycopg2.connect(host=HOSTNAME, user=USERNAME, password=PASSWORD, db...
3.578125
4
Calculator/Sqroot.py
rn44/statsCalculator
0
12783684
<gh_stars>0 def sqroot(a): a = float(a) b = a ** (1/2) return b
2.5625
3
venv/Lib/site-packages/configurationutil/unittests/test_cfg_providers/test_configuration_object.py
avim2809/CameraSiteBlocker
0
12783685
# encoding: utf-8 import os import unittest from configurationutil.cfg_providers import base_provider from fdutil.path_tools import pop_path class TestConfigurationObject(unittest.TestCase): def setUp(self): self.cfg_file = os.path.join(pop_path(__file__), u'test_config_object.json') self.templa...
2.515625
3
tests/kmburst/mesh/test_case_2.py
gauenk/faiss_fork
0
12783686
<reponame>gauenk/faiss_fork # -- python -- import sys import pytest from einops import rearrange # -- pytorch -- import torch # -- project -- from pyutils import save_image,get_img_coords # -- faiss -- import sys import faiss sys.path.append("/home/gauenk/Documents/faiss/contrib/") from kmb_search import jitter_sea...
1.632813
2
vnegmas/backend/src/nnegmas/monitor.py
YueNing/vnegmas
3
12783687
""" some class that used for monitor the stats information of negmas during the time of simulation monitor methode: 1. detect the information of changing file 2. detect the information of shared memory """ from abc import ABCMeta, abstractmethod import os, time from typing import Optional...
2.890625
3
Assignment_6/src/LRModel.py
JohanneBW/cds_language_assignments
0
12783688
<reponame>JohanneBW/cds_language_assignments #!/usr/bin/env python """ ---------- Import libraries ---------- """ # system tools import os import sys sys.path.append(os.path.join("..")) # pandas, numpy, gensim import pandas as pd import numpy as np import gensim.downloader # import classifier utility functions impo...
2.34375
2
5 - synthetic-data-applications/time-series/missing-values-imputation/factors.py
ydataai/Blog
0
12783689
import json def save_json(data, fpath): "Stores data as a JSON in the provided filepath." with open(fpath, 'w') as f: json.dump(data, f)
2.921875
3
hs_core/tests/api/native/test_hs_requests.py
tommac7/hydroshare
178
12783690
<gh_stars>100-1000 from django.test import TestCase from hs_core.hydroshare import hs_requests from django.conf import settings class TestRewrite(TestCase): """ Test local rewriting that bypasses firewalls and hits local nginx server """ def setUp(self): self.prod_fqdn = getattr(settings, "PROD_FQDN_...
2.390625
2
mooringlicensing/migrations/0204_stickerprintingresponse_email_from.py
jawaidm/mooringlicensing
0
12783691
<filename>mooringlicensing/migrations/0204_stickerprintingresponse_email_from.py # -*- coding: utf-8 -*- # Generated by Django 1.11.29 on 2021-08-05 04:07 from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('mooringlic...
1.445313
1
SparkDemo/src/main/py/gen_wide.py
naah69/demo
16
12783692
<reponame>naah69/demo #!/bin/python # Copyright (c) 2021 <NAME> Technology Co., 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/license...
3.125
3
packages/mcvine/tests/mcvine/run_script/test_instr_with_detsys.py
mcvine/mcvine
5
12783693
import os import mcvine, mcvine.components instrument = mcvine.instrument() # add source source = mcvine.components.sources.Source_simple('source') instrument.append(source, position=(0,0,0)) # add sample sample = mcvine.components.samples.V_sample('sample') instrument.append(sample, position=(0,0,1)) # add detector sy...
2
2
AdvancedConsole.py
jack-the-hack/AdvancedConsole
0
12783694
<filename>AdvancedConsole.py import os import keyboard import platform if(not platform.system() == "Windows"): quit("Incompatible system, only compatible with windows") os.system("@echo off") colordict = {"black":"0","gray":"8","blue":"1","L_blue":"9","green":"2","L_green":"A","aqua":"3","L_aqua":"B","red":"4...
3.171875
3
hardware/ip/nt_recv_capture/test/nt_recv_capture_top_test.py
aoeldemann/fluent10g
20
12783695
"""Test bench for the Verilog module 'nt_recv_capture_top'.""" # The MIT License # # Copyright (c) 2017-2019 by the author(s) # # 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 restric...
1.320313
1
i3pystatus/clock.py
fkusei/i3pystatus
413
12783696
import errno import os import locale from datetime import datetime try: import pytz HAS_PYTZ = True except ImportError: HAS_PYTZ = False from i3pystatus import IntervalModule class Clock(IntervalModule): """ This class shows a clock. .. note:: Optionally requires `pytz` for time zone data w...
3.03125
3
emka_trans/accounts/tests/tests_view.py
mmamica/ERP-system
0
12783697
from selenium.webdriver.common.keys import Keys from selenium import webdriver from django.test import LiveServerTestCase from django.test import TestCase from django.urls import reverse from accounts.models import UserProfileInfo, User from admin_app.models import Magazine, Truck from accounts.forms import UserForm, U...
2.21875
2
my_university_api/application/api/mongodb/models.py
LittleBitProgrammer/myUniversity
1
12783698
from flask_restx import fields from application.api.mongodb import * freshman_model = mongodb.model('freshman', { 'matricola': fields.String }) id_conversation_model = mongodb.model('id_conversation_model', { 'id_conversation': fields.String }) send_message_model = mongodb.model('insert_message', { 'id_c...
2.265625
2
PiVideoCapture.py
ostev/argo
0
12783699
<filename>PiVideoCapture.py from typing import Tuple from picamera.array import PiRGBArray from picamera import PiCamera class PiVideoCapture(object): def __init__(self, camera: PiCamera, size=(192, 108)): self.camera = camera self.rawCapture = PiRGBArray(self.camera, size=size) def read(sel...
3.140625
3
faster_rcnn/rpn_gt_opr.py
tendence/faster_rcnn
1
12783700
<filename>faster_rcnn/rpn_gt_opr.py<gh_stars>1-10 #!/usr/bin/python3 # Copyright 2017, <NAME> <<EMAIL>> import mxnet as mx from .anchor_generator import generate_anchors, map_anchors import numpy as np from .utils import bbox_overlaps, bbox_transform from .config import cfg def rpn_gt_opr(reg_shape, label, ctx, img_h...
1.6875
2
scripts/announcement.py
vishalbelsare/jina
15,179
12783701
import re import sys meetup_svg = '.github/images/meetup.svg' readme_md = 'README.md' conf_py = 'docs/conf.py' def rm_announce(): # remove all announcement with open(readme_md) as fp: _old = fp.read() _new = re.sub( r'(<!--startmsg-->\s*?\n).*(\n\s*?<!--endmsg-->)', rf...
2.359375
2
dockit/forms/widgets.py
zbyte64/django-dockit
5
12783702
<filename>dockit/forms/widgets.py from django.forms.widgets import Widget, Media, HiddenInput from django.utils.safestring import mark_safe import django.utils.copycompat as copy from django import forms from django.forms.util import flatatt from django.forms.formsets import formset_factory, ORDERING_FIELD_NAME, DELET...
2.078125
2
useful_scripts/mod_pkl.py
UILXELA/Cooperative-3D-Object-Detection-Using-Shared-Raw-LIDAR-Data
6
12783703
<gh_stars>1-10 import pickle import numpy as np filename=input("type in the pkl name\n") with open(filename , 'rb') as f: data = pickle.load(f) for i in range(len(data)): original=data[i]['point_cloud']['velodyne_path'] modified=[] for j in range(len(data[i]['annos']['index'])): label_str=str(...
2.375
2
src/training/evaluator.py
yutake27/P3CMQA
0
12783704
import copy import os from functools import reduce from pathlib import Path import chainer import chainer.functions as F import matplotlib matplotlib.use('Agg') import matplotlib.pyplot as plt import numpy as np import pandas as pd import six from chainer import configuration, cuda, function from chainer import report...
2.46875
2
src/IoT_Client.py
manuandru/Reti2021-Smart-Meter-IoT
2
12783705
# -*- coding: utf-8 -*- """ @author: Manuel """ import socket import time import sys import json import sensor_version.config as config from IoT_Client_functions import read_data_from_sensor from sensor_version.data_message import message udp_timeout = 2 udp_delay = 1 if len(sys.argv) != 2: print('Error: need cl...
3.03125
3
src/phase-3/old_test/test_postgres.py
spininertia/graph-mining-rdbms
0
12783706
<reponame>spininertia/graph-mining-rdbms import sys import time import psycopg2 if __name__ == "__main__" : conn = psycopg2.connect(database="mydb", host="127.0.0.1", user="postgres") print "Testing postgres."
2.140625
2
rin/models/message/components/cache.py
an-dyy/Rin
13
12783707
<filename>rin/models/message/components/cache.py from __future__ import annotations from typing import TYPE_CHECKING from ...cacheable import Cache, Cacheable if TYPE_CHECKING: from .actionrow import Component __all__ = ("ComponentCache",) class ComponentCache(Cacheable): """A components cache.""" ca...
1.8125
2
src/calculations_diff_to_int_test.py
danOSU/emulator-validation
4
12783708
<reponame>danOSU/emulator-validation ##!/usr/bin/env python3 # import numpy as np from collections.abc import Iterable import h5py import sys, os, glob from configurations import * from calculations_file_format_single_event import result_dtype, Qn_species, Qn_diff_pT_cuts filename=sys.argv[1] data = np.fromfile(file...
1.789063
2
food/addforms.py
SandeshGhi/FoodApp
0
12783709
from django import forms from django.db import models from django.forms import fields from .models import Item class ItemForm(forms.ModelForm): class Meta: model = Item fields = ['itemName', 'itemDescription', 'itemPrice', 'itemImage']
2.140625
2
lib-dynload/lz4r07/setup.py
tabulon-ext/dedupsqlfs
22
12783710
<gh_stars>10-100 import sys from distutils.command.build_ext import build_ext from distutils.core import setup from distutils.extension import Extension from distutils import ccompiler __version__ = "0.7.0.1" LZ4_VERSION = "r131" if sys.version_info < (2,6): sys.stderr.write("ERROR: Python 2.5 and older are not ...
2.015625
2
random/stocks_simulator.py
Dmendoza3/Phyton
0
12783711
import time import random value = random.randint(0, 1000) while True: if random.randint(0, 100) > 50: print("lose everything")
3.375
3
server/api/resources/personality/__init__.py
NUS-CS-MComp/cs-cloud-computing-music-personality
2
12783712
from .insights import PersonalityScore from .inference import Inference __all__ = ["PersonalityScore", "Inference"]
1.054688
1
run.py
TyroneZeka/Flask-Blog
0
12783713
<reponame>TyroneZeka/Flask-Blog from app import app from db import db db.init_app(app) @app.before_first_request def create_tables(): db.create_all(app=app)
2.03125
2
apiApp/models.py
ToneHome/fetchYapi
0
12783714
from django.db import models # Create your models here. class ProjectCat(models.Model): ProjectId = models.IntegerField() CarId = models.IntegerField() CartName = models.CharField(max_length=225) class ApiName(models.Model): ProjectId = models.IntegerField() CarId = models.IntegerField() Api...
2.234375
2
deps/ts_proto_deps.bzl
heartless-clown/rules_proto
249
12783715
<reponame>heartless-clown/rules_proto """ GENERATED FILE - DO NOT EDIT (created via @build_stack_rules_proto//cmd/depsgen) """ load("@build_bazel_rules_nodejs//:index.bzl", "npm_install", "yarn_install") def _maybe(repo_rule, name, **kwargs): if name not in native.existing_rules(): repo_rule(name = name, ...
1.476563
1
tfm_server/political_clasification/forms.py
ricardocancar/TFM
0
12783716
# -*- coding: utf-8 -*- from django import forms from .models import PoliticalClasification class PoliticalClasificationForm(forms.ModelForm): class Meta: model = PoliticalClasification fields = [ 'political', 'content', 'numbers' ] ...
2.0625
2
ippon/models/cup_fight_test.py
morynicz/ippon_back
0
12783717
import datetime import django from django.db import IntegrityError from django.test import TestCase import ippon.models import ippon.models.club as cl import ippon.models.cup_fight import ippon.models.cup_fight as cfm import ippon.models.fight import ippon.models.player as plm import ippon.models.team_fight as tfm im...
2.390625
2
src/project_euler/P003_largest_prime_factor/solution_01_tests.py
lakshmikanth-tesla/ProgrammingProblems
1
12783718
<reponame>lakshmikanth-tesla/ProgrammingProblems<gh_stars>1-10 import unittest from src.project_euler.P003_largest_prime_factor.solution_01 import answer class TestSolution(unittest.TestCase): def testcase_001(self): N = 600851475143 expected = 6857 self.assertEqual(answer(N), expected) ...
2.578125
3
var/spack/repos/builtin/packages/libssh/package.py
mrzv/spack
2
12783719
# Copyright 2013-2018 Lawrence Livermore National Security, LLC and other # Spack Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) from spack import * class Libssh(CMakePackage): """libssh: the SSH library""" homepage = "https://www.libssh.or...
1.109375
1
src/bdbd/src/bdbd/test/lagtest.py
rkent/BDBD
0
12783720
<filename>src/bdbd/src/bdbd/test/lagtest.py<gh_stars>0 #!/usr/bin/env python # ROS node to implement changePose action server # generally follows http://wiki.ros.org/actionlib_tutorials/Tutorials/Writing%20a%20Simple%20Action%20Server%20using%20the%20Execute%20Callback%20%28Python%29 import time import rospy from bd...
2.21875
2
src/attention_neuro/attention_module.py
matln/Attentive-Filtering-Network
49
12783721
<filename>src/attention_neuro/attention_module.py from __future__ import print_function import torch import torch.nn as nn import torch.nn.functional as F from basic_layers import ResidualBlock, L1Penalty class AttentionModule_stg0(nn.Module): """ attention module with softmax branch and trunk branch, Residual...
2.359375
2
protobot_dog_bringup/scripts/bring_up.py
robottime/protobot_dog
3
12783722
#!/usr/bin/env python import rospy import sys import math import time import serial from std_msgs.msg import Float64 from geometry_msgs.msg import Point from threading import Lock lock = Lock() serial_com = None def callback(data,callback_args): global serial_com lock.acquire() #print data,callback_args if(se...
2.5
2
train.py
don6105/OCR-Captcha-Recognition
0
12783723
<filename>train.py #!/usr/bin/python3 import cv2 import numpy as np import os import pickle import process_img import download_img img_area = 40 * 40 download_img.run('https://www.yiqifa.com/front/common/getcode') process_img.run('img', 'char') filenames = os.listdir("label") samples = np.empty((0, img_area)) labels...
2.96875
3
tests/test_instrumentation/test_trace_back.py
piotrmaslanka/satella
12
12783724
import io import pickle import sys import unittest from satella.instrumentation import Traceback class TestTraceback(unittest.TestCase): def test_no_exc(self): tb = Traceback() byte = io.BytesIO() byte2 = tb.pickle() tb.pickle_to(byte) byte.seek(0) tb2 = Traceback....
2.4375
2
dAAMs/lda.py
yuxiang-zhou/DenseDeformableModel
0
12783725
<gh_stars>0 from numpy import linalg from menpo.visualize import print_dynamic from sklearn.utils.fixes import bincount import itertools import functools import warnings from sklearn.utils import check_X_y, check_array from sklearn.utils.extmath import safe_sparse_dot import numpy as np def _class_means(X, y): ""...
2.375
2
export_util.py
abhinavsp0730/medium-to-fastpages
0
12783726
def save_md(text, path, filename): with open(path + '/'+filename+'.md','w') as file: file.write(text)
2.71875
3
example/messages/conf.py
jpush/jmessage-api-python-client
12
12783727
<filename>example/messages/conf.py # please put your app_key and master_secret here app_key = u'6be9204c30b9473e87bad4dc' master_secret = u'<KEY>'
1.039063
1
fastapi/api/v1/async.py
zhangnian/fastapi
33
12783728
<gh_stars>10-100 from flask import Blueprint from fastapi.utils.http_util import render_ok from fastapi.worker.tasks import async_add bp = Blueprint("async", __name__, url_prefix='/async') @bp.route('/add') def add(): future = async_add.delay(1, 2) return render_ok({'task_id': future.id}) @bp.route('/sta...
2.40625
2
main.py
waterpepene/SpotiBar
0
12783729
<reponame>waterpepene/SpotiBar<filename>main.py from functions import * from GUI import * from math import floor from datetime import timedelta sp = authentication() visibility = True # visibility of the window def spotiBar(): def songDuration(): durationms = int(track["item"]["duration_ms"]) ...
2.84375
3
1390/main.py
pauvrepetit/leetcode
0
12783730
<gh_stars>0 # 1390. 四因数 # # 20200729 # huao # 就检查每个数 如果满足条件就加进去就ok from typing import List from math import sqrt class Solution: def sumFourDivisors(self, nums: List[int]) -> int: sum = 0 for num in nums: sum += self.check(num) return sum def check(self, num: int) -> bool...
3.328125
3
data_ingestion_service/migrations/0002_storedfiles_category.py
girleffect/core-data-ingestion-service
0
12783731
# Generated by Django 2.1.1 on 2019-01-16 09:49 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('data_ingestion_service', '0001_initial'), ] operations = [ migrations.AddField( model_name='storedfiles', name='cate...
1.734375
2
ampgo --username andrea.gavana@gmail.com/go_amp.py
andyfaff/amgo
9
12783732
from __future__ import print_function import numpy OPENOPT = SCIPY = True try: from openopt import NLP except ImportError: OPENOPT = False try: from scipy.optimize import minimize except ImportError: SCIPY = False SCIPY_LOCAL_SOLVERS = ['Nelder-Mead', 'Powell', 'L-BFGS-B', 'TNC', ...
2.375
2
setup.py
harmsm/topiary
0
12783733
<filename>setup.py #!/usr/bin/env python # -*- coding: utf-8 -*- import io import os import sys from shutil import rmtree from setuptools import find_packages, setup, Command, Extension # Package meta-data. NAME = 'topiary' DESCRIPTION = 'A lightweight python package using pandas dataframes for phylogenetics.' URL =...
1.96875
2
hello/migrations/0001_initial.py
fadeawaygod/DjangoTemplate
0
12783734
<reponame>fadeawaygod/DjangoTemplate # Generated by Django 3.2.3 on 2021-05-21 01:48 from django.db import migrations, models class Migration(migrations.Migration): initial = True dependencies = [ ] operations = [ migrations.CreateModel( name='Post', fields=[ ...
1.640625
2
car-controller/src/mainController/Controller/TrajectoryPlanning/TrajectoryPlanning.py
iisys-hof/autonomous-driving
0
12783735
# @PascalPuchtler # 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, software # dis...
2.140625
2
detect_mask_video.py
nehabheemisetty/Face-mask-detection-
0
12783736
<filename>detect_mask_video.py # USAGE # python detect_mask_video.py # import the necessary packages from tensorflow.keras.applications.mobilenet_v2 import preprocess_input from tensorflow.keras.preprocessing.image import img_to_array from tensorflow.keras.models import load_model from imutils.video import VideoStream...
2.796875
3
automator_v2.py
Zolhungaj/AMQ-List-Training-Tool
1
12783737
""" This module downloads a lot of songs from anime music quiz Dependencies: ffmpeg selenium Firefox geckodriver """ import os import re from selenium import webdriver from selenium.webdriver.common.keys import Keys from selenium.webdriver.common.action_chains import ActionChains import time import json from pathlib im...
2.84375
3
lib/sender/auth.py
JRS83/Osmedeus
8
12783738
import os import sys sys.path.append(os.path.dirname(os.path.dirname(os.path.realpath(__file__)))) from lib.sender import send from lib.core import utils def login(options): url = options.get('remote_api') + "/auth/api/token/" body = { "username": options.get('credentials')[0], "password": op...
2.0625
2
project/editorial/views/platforms.py
cojennin/facet
25
12783739
""" Platform views for editorial app. editorial/views/platformviews.py """ # -*- coding: utf-8 -*- from __future__ import unicode_literals from braces.views import LoginRequiredMixin from django.conf import settings from django.core.urlresolvers import reverse from django.views.generic import FormVi...
2.234375
2
quoraInsincere/read_data.py
JobQiu/Kaggle-NLP-Summary
1
12783740
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Thu Dec 27 00:52:19 2018 @author: xavier.qiu """ from common.load import * from common.pd_util import * from common.preprocess import * from common.util import * from keras.preprocessing.text import Tokenizer from keras.preprocessing.sequence import pad_se...
2.03125
2
desec_dns_api.py
gerhard-tinned/desec-dns-api-cli
3
12783741
<filename>desec_dns_api.py #!/usr/bin/python """ Author <NAME> Version: 0.2.0 """ from __future__ import print_function import json import requests class deSEC_DNS_API(object): """ Class to handle the deSEC DNS APIT requests Requires: api_url, api_token """ def __init__(self, api_url, api_token,...
3.296875
3
tests/master/data/database/dal/test_ioc.py
m2bright/rapid
4
12783742
""" Copyright (c) 2015 <NAME> and Bamboo HR 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 in w...
1.84375
2
reactive/charm_staticip.py
VariableDeclared/charm-staticip
0
12783743
<gh_stars>0 from charms.reactive import when, when_not, set_flag import os import sys sys.path.insert(0, os.path.join(os.environ['CHARM_DIR'], 'lib')) from charmhelpers.core import ( hookenv, host ) @when_not('charm-staticip.installed') def install_charm_staticip(): # Do your setup here. # # If yo...
1.90625
2
model/openacademy_course.py
davepadrino/openacademy-project
0
12783744
<reponame>davepadrino/openacademy-project # -*- coding: utf-8 -*- from openerp import models, fields, api ''' Creacion del modelo del curso ''' class Course(models.Model): ''' Crea el modelo del curso Aparecerá un campo search y unas opciones de filtrado y busqueda avanzada que son heredadas de "models...
2.296875
2
snow-dots/utilities/time.py
cpizzica/Lab-Matlab-Control
6
12783745
<gh_stars>1-10 #! python3 import sys, time print( time.time() )
1.9375
2
doltcli/__init__.py
sidphbot/doltcli
6
12783746
from .dolt import ( Branch, Commit, Dolt, DoltException, DoltHubContext, KeyPair, Remote, Status, Table, _execute, ) from .types import BranchT, CommitT, DoltT, KeyPairT, RemoteT, StatusT, TableT from .utils import ( CREATE, FORCE_CREATE, REPLACE, UPDATE, colu...
1.226563
1
languages/python/sqlalchemy-oso/tests/test_partial.py
connec/oso
2,167
12783747
<reponame>connec/oso from polar import Variable from sqlalchemy.orm import Session from sqlalchemy_oso.partial import partial_to_filter from .models import User def test_partial_to_query_filter(oso, engine): oso.load_str('ok(_: User{username:"gwen"});') session = Session(bind=engine) gwen = User(username=...
2.578125
3
manimlib/constants.py
parmentelat/manim
1
12783748
import numpy as np # Sizes relevant to default camera frame ASPECT_RATIO = 16.0 / 9.0 FRAME_HEIGHT = 8.0 FRAME_WIDTH = FRAME_HEIGHT * ASPECT_RATIO FRAME_Y_RADIUS = FRAME_HEIGHT / 2 FRAME_X_RADIUS = FRAME_WIDTH / 2 DEFAULT_PIXEL_HEIGHT = 1080 DEFAULT_PIXEL_WIDTH = 1920 DEFAULT_FRAME_RATE = 30 SMALL_BUFF = 0.1 MED_SMA...
2.25
2
Lec3/flaskappIsitChristmas/application.py
tim-ballard/CS50W
0
12783749
from flask import Flask, render_template from datetime import date app = Flask(__name__) @app.route("/") def check(): today = date.today() newyearcheck = today.month == 1 and today.day == 1 return render_template("index.html", newyearcheck=newyearcheck)
2.546875
3
api/src/abim_search_api.py
wellcomecollection/amplify
3
12783750
<reponame>wellcomecollection/amplify import requests import re from re import finditer def format_search_string(text): '''Format search string for search_record method's SEARCH expression. :param text: string :return: string (formatted) ''' print(text) result = '' if text != None: ...
2.9375
3