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
after/trans.py
Windsooon/Comments
1
39500
<filename>after/trans.py import os import csv import numpy as np import pandas as pd import matplotlib.pyplot as plt from comments.base import DATA_DIR, cut_words, sigmoid class Trans: def __init__(self): self.trans_matrix = pd.read_excel(os.path.join(DATA_DIR, 'trans.xls'), index_col=0) # add one...
3.046875
3
titan/api_pkg/mutation/props.py
mnieber/gen
0
39501
<reponame>mnieber/gen from moonleap import u0 from moonleap.typespec.field_spec import FieldSpec, FormFieldSpec from moonleap.typespec.type_spec_store import TypeSpec, type_spec_store from titan.api_pkg.mutation.default_outputs_type_spec import default_outputs_type_spec def _field_spec_from_item(self, item): retu...
1.953125
2
api/opentrons/instruments/pipette_config.py
heyoni/opentrons
0
39502
import logging import os import json from collections import namedtuple from opentrons.config import get_config_index FILE_DIR = os.path.abspath(os.path.dirname(__file__)) log = logging.getLogger(__name__) def pipette_config_path(): index = get_config_index() return index.get('pipetteConfigFile', './setting...
2.5625
3
src/main.py
MauroLuzzatto/algorithmic-explanations
0
39503
# -*- coding: utf-8 -*- """ Created on Sat Nov 28 17:16:29 2020 @author: mauro """ import logging import os from explanation import ( CounterfactualExplanation, PermutationExplanation, ShapleyExplanation, SurrogateModelExplanation, ControlGroupExplanation ) from src.model.config import path_base f...
2.234375
2
det.py
styler00dollar/CenDetect
3
39504
<filename>det.py<gh_stars>1-10 import asyncio from argparse import ArgumentParser from mmdet.apis import (async_inference_detector, inference_detector, init_detector, show_result_pyplot) from mmcv.runner import wrap_fp16_model import cv2 import numpy as np from tqdm import tqdm import os impor...
2.046875
2
command/sub8_alarm/alarm_handlers/kill.py
bhostetler18/SubjuGator
0
39505
<reponame>bhostetler18/SubjuGator<filename>command/sub8_alarm/alarm_handlers/kill.py import rospy from ros_alarms import HandlerBase, Alarm from actionlib import SimpleActionClient, TerminalState from mil_msgs.msg import BagOnlineAction, BagOnlineGoal import os class Kill(HandlerBase): alarm_name = 'kill' ini...
2.15625
2
Projects/Healthcare/breast-cancer/src/data_loading/augmentations.py
DanielMabadeje/Artificial-Intelligence-Deep-Learning-Machine-Learning-Tutorials
3,266
39506
# Copyright (C) 2019 <NAME>, <NAME>, <NAME>, <NAME>, <NAME>, <NAME>, # <NAME>, <NAME>, <NAME>, <NAME>, <NAME>, <NAME>, # <NAME>, <NAME>, <NAME>, <NAME>, <NAME>, <NAME>, # <NAME>, <NAME>, <NAME>, <NAME>, <NAME>, <NAME>, # <NAME>, <NAME>, <NAME>, <NAME>, <NAME>, <NAME>, # <NAME>, <NAME> # # This file is pa...
2.375
2
ooobuild/dyn/awt/field_unit.py
Amourspirit/ooo_uno_tmpl
0
39507
# coding: utf-8 # # Copyright 2022 :Barry-Thomas-Paul: Moss # # 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 applicab...
1.992188
2
utils.py
zrongcheng/srcnn
0
39508
<reponame>zrongcheng/srcnn """ Scipy version > 0.18 is needed, due to 'mode' option from scipy.misc.imread function """ import os import glob import h5py import random import matplotlib.pyplot as plt from PIL import Image # for loading images as YCbCr format import Scipy.misc import Scipy.ndimage import numpy as np ...
2.328125
2
db/mongodb/save_all.py
kosyachniy/dev
13
39509
<gh_stars>10-100 import os import json from pymongo import MongoClient with open('keys.json', 'r') as file: keys = json.loads(file.read()) db_all = MongoClient( username=keys['login'], password=keys['password'], authSource='admin', authMechanism='SCRAM-SHA-1' ) for db_name in db_all.list_database_names(): i...
2.703125
3
setup.py
saksham/nepse-crawler
1
39510
<reponame>saksham/nepse-crawler #!/usr/bin/env python # -*- coding: utf-8 -*- from distutils.core import setup from codecs import open from os import path here = path.abspath(path.dirname(__file__)) def read_file(filename): with open(path.join(here, filename)) as f: return f.read() setup(name='nepse-cr...
1.710938
2
backend/backend.py
alexnbferreira/CryptoTracker
0
39511
<gh_stars>0 from flask import Flask, Response, render_template import requests import json import logging from pandas import read_json from decimal import Decimal app = Flask(__name__) exchanges = ["BNB", "BTX", "BFX"] token = "<KEY>" logging.basicConfig() logger = logging.getLogger(__name__) base_currencies = None ...
3
3
data_pipeline/_kafka_producer.py
poros/data_pipeline
110
39512
# -*- coding: utf-8 -*- # Copyright 2016 Yelp 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 ag...
1.5625
2
morphsed/images.py
RuancunLi/MorphSED
0
39513
import numpy as np import matplotlib.pyplot as plt from astropy import units as u from astropy.coordinates import SkyCoord from astropy.io import fits from astropy.nddata import CCDData from astropy.nddata import Cutout2D from astropy.stats import sigma_clipped_stats from astropy.wcs.utils import proj_plane_pixel_scale...
2.203125
2
tests/test_kfold.py
pal-16/preprocessy
0
39514
<filename>tests/test_kfold.py import numpy as np import pytest from preprocessy.resampling import KFold class TestKFold: def test_kfold(self): with pytest.raises(ValueError): KFold(n_splits=2.3) with pytest.raises(ValueError): KFold(n_splits=0) with pytest.raises...
2.484375
2
srforge_tests/unit_tests/utilities_tests/__init__.py
alunduil/srforge
0
39515
# Copyright (C) 2016 srforge project developers. # # See the COPYRIGHT file at the top-level directory of this distribution and at # https://github.com/alunduil/srforge/blob/master/COPYRIGHT # # srforge is freely distributable under the terms of an MIT-style license. # See LICENSE or http://www.opensource.org/licenses/...
0.486328
0
prices/admin.py
KazuruK/FilmGetter
1
39516
<reponame>KazuruK/FilmGetter<gh_stars>1-10 from django.contrib import admin # Register your models here. from prices.models import IdDB class IdDBAdmin(admin.ModelAdmin): list_display = ( 'kinopoisk_id', 'title', 'title_en', 'year', 'date_created', 'price',) s...
1.851563
2
tapetracker.py
kemfic/pumavision2019
2
39517
import cv2 import numpy as np class TapeTracker(object): min_thresh = np.array( [80,0,0] ) max_thresh = np.array( [90, 255, 255] ) def __init_(self): self.img = np.zeros((500,500)) def pipeline(self, img): self.img = cv2.resize(img, (300,300), cv2.INTER_NEAREST) self.img = cv2.cvtColor(self.img, c...
2.609375
3
Engine/Tools.py
NoNotCar/SpaceX
0
39518
<filename>Engine/Tools.py from .Items import Item from Lib import Img import pygame from Game import Registry,Research from Objects import War error=Img.sndget("error") bsnd=Img.sndget("break") class Pickaxe(Item): img=Img.imgx("Tools/Pickaxe") last_used=0 MAX_CONTINUOUS=200 last_mined=None stack_si...
2.453125
2
tests/max/test_rmc.py
realead/rmc
0
39519
<reponame>realead/rmc import os import exetest as ex import exetest.decorator as dec import RMCTester @dec.to_unit_tests class Tester(RMCTester.RMCTester): #setting up the test case my_path = os.path.dirname(__file__) program_name = "max" exe = os.path.join(my_path, RMCTester.RMCTester.EXE_NAME) ...
2.203125
2
ceilometer_infoblox/pollsters/__init__.py
mwinslow7/ceilometer-infoblox
4
39520
<reponame>mwinslow7/ceilometer-infoblox<gh_stars>1-10 # Copyright 2015 Infoblox, 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 # # U...
2.015625
2
waitercaller.py
salaikumar/waitercaller
0
39521
from flask import Flask from flask import request from flask import render_template # Login Extension from flask_login import LoginManager from flask_login import login_required from flask_login import login_user from flask_login import logout_user from mockdbhelper import MockDBHelper as DBHelper from user import Use...
2.921875
3
Part_3_advanced/m03_date_and_time/date_today/example_1/main.py
Mikma03/InfoShareacademy_Python_Courses
0
39522
<reponame>Mikma03/InfoShareacademy_Python_Courses<gh_stars>0 from book_book import books_directory, user_interface def run_example(): user_interface.add_new_book() print("Data dodania: ", books_directory.available_books[-1].added_at_date) user_interface.add_new_book() print("Data dodania: ", books_dir...
3.171875
3
examples/example1.py
inverseproblem/pyMag2Dpoly
4
39523
import sys # in this case local import sys.path.append("../") import mag2dpoly as mag import numpy as np # induced magnetization Jind = mag.MagnetizVector(mod=4.9,Ideg=90.0,Ddeg=45.0) # remanent magnetization Jrem = mag.MagnetizVector(mod=3.1,Ideg=45.0,Ddeg=0.0) # angle with the North axis northxax = 90.0 # numb...
2.59375
3
stats.py
warppoint42/Mahjong221
0
39524
<gh_stars>0 import csv stats = dict() with open('unifiedroundlog.csv', 'r') as csvfile: reader = csv.DictReader(csvfile, ('AI', 'gameID', 'end', 'win', 'feed', 'riichi')) for row in reader: if row['AI'] not in stats: stats[row['AI']] = dict() stats[row['AI']].setdefault('n', 0) ...
2.65625
3
fabfile.py
yanikou19/pymatgen
0
39525
<reponame>yanikou19/pymatgen<filename>fabfile.py """ Deployment file to facilitate releases of pymatgen. Note that this file is meant to be run from the root directory of the pymatgen repo. """ __author__ = "<NAME>" __email__ = "<EMAIL>" __date__ = "Sep 1, 2014" import glob import os import json import webbrowser imp...
2.03125
2
test/models/__init__.py
Tomos-Evans/garrison
1
39526
from .ingredient import * from .drink_component import * from .drink import * from .dispenser import *
1.070313
1
bb-master/sandbox/lib/python3.5/site-packages/buildbot/www/oauth2.py
Alecto3-D/testable-greeter
2
39527
<reponame>Alecto3-D/testable-greeter # This file is part of Buildbot. Buildbot is free software: you can # redistribute it and/or modify it under the terms of the GNU General Public # License as published by the Free Software Foundation, version 2. # # This program is distributed in the hope that it will be useful, bu...
1.851563
2
bin/contentctl_project/contentctl_core/domain/entities/story.py
arjunkhunti-crest/security_content
0
39528
<reponame>arjunkhunti-crest/security_content import string import uuid import requests from pydantic import BaseModel, validator, ValidationError from datetime import datetime from bin.contentctl_project.contentctl_core.domain.entities.security_content_object import SecurityContentObject from bin.contentctl_project.c...
2.625
3
staff/__init__.py
alvienzo720/Dep_Nadine
1
39529
<gh_stars>1-10 """The Django app which provides member tracking and billing calculation for a coworking space."""
0.75
1
sedre.py
donerancl/sedre
0
39530
<gh_stars>0 """Output file parser for quantum chemistry. Intended to be easy, logical to use. Should be quickly incorporable into workflow by high level functions and objects. Requires only the Python standard library, sed, and sedre's submodules Should be agnositic to Python 3.X version, but was written in Spring 201...
2.796875
3
backend/api/migrations/0001_initial.py
INSRapperswil/nornir-web
2
39531
<filename>backend/api/migrations/0001_initial.py # Generated by Django 3.1.2 on 2020-10-05 10:33 from django.conf import settings from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): initial = True dependencies = [ migrations.s...
1.757813
2
tests/docx/document_xml_tests.py
JoshBarr/python-mammoth
1
39532
import io from nose.tools import istest, assert_equal import funk from mammoth import documents, results from mammoth.docx.xmlparser import element as xml_element, text as xml_text from mammoth.docx.document_xml import read_document_xml_element from mammoth.docx.numbering_xml import Numbering from mammoth.docx.relati...
2.484375
2
tests/primitives/high_precision_condition_slowtest.py
gift-surg/puma
0
39533
<filename>tests/primitives/high_precision_condition_slowtest.py import time from threading import Thread from unittest import TestCase from puma.primitives import HighPrecisionCondition from tests.github_issue_11_quickfix import skip_on_windows_until_github_issue_11_is_resolved TIMEOUTS = [0.0, 0.000001, 0.014, 0.015...
2.421875
2
mouselight/visualizations/view_ng_mouselight_n5.py
pattonw/mouselight
0
39534
from funlib.show.neuroglancer import add_layer, ScalePyramid import argparse import daisy import glob import neuroglancer import numpy as np import os import webbrowser from swc_parser import _parse_swc from pathlib import Path import itertools import random import logging ngid = itertools.count(start=1) parser = arg...
2.40625
2
BERT_Custom/bert_sequence_tagger/metrics.py
gp201/BERT
1
39535
<filename>BERT_Custom/bert_sequence_tagger/metrics.py import itertools from sklearn.metrics import f1_score as f1_score_sklearn from seqeval.metrics import f1_score from sklearn.metrics import classification_report def f1_entity_level(*args, **kwargs): return f1_score(*args, **kwargs) def f1_token_lev...
2.390625
2
mediagrains/testsignalgenerator.py
bbc/rd-apmm-python-lib-mediagrains
6
39536
# # Copyright 2018 British Broadcasting 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 # # Unless required by applicable law or...
1.460938
1
catch.py
AlexLito666/my_first_project
0
39537
from pygame import * #создай окно игры window = display.set_mode((700, 500)) display.set_caption("Догонялки") #задай фон сцены background = transform.scale(image.load("background.png"), (700, 500)) sprite1 = transform.scale(image.load('sprite1.png'), (100, 100)) sprite2 = transform.scale(image.load('sprite2.png'), (...
3.46875
3
tests/read/test_read_api_query_endpoint.py
NRCan/backdrop
9
39538
<filename>tests/read/test_read_api_query_endpoint.py import unittest import urllib import datetime from hamcrest import assert_that, is_ from mock import patch import pytz from backdrop.read import api from backdrop.core.query import Query from tests.support.performanceplatform_client import fake_data_set_exists from t...
2.1875
2
scripts/npc/autogen_kasandra.py
hsienjan/SideQuest-Server
0
39539
# Character field ID when accessed: 820000000 # ObjectID: 1000000 # ParentID: 9010010 # Object Position X: -449 # Object Position Y: 225
0.925781
1
media_browser/imdb/_logging.py
arjun-namdeo/my_python
0
39540
""" _logging module (imdb package). """ import logging LEVELS = {'debug': logging.DEBUG, 'info': logging.INFO, 'warn': logging.WARNING, 'warning': logging.WARNING, 'error': logging.ERROR, 'critical': logging.CRITICAL} imdbpyLogger = logging.getLogger('media_browser') imdbpySt...
3
3
simplecmr/utils.py
KMarkert/simple-cmr
1
39541
import datetime from collections import OrderedDict def decode_date(string): """Decodes a date from a command line argument, returning datetime object". Args: string: See AssetSetCommand class comment for the allowable date formats.v Returns: long, datetime object Raises: V...
3.296875
3
.ipynb_checkpoints/data_cleaning-checkpoint.py
VivanVatsa/ds-salary-proj
5
39542
# %% # from numpy.core.fromnumeric import size import pandas as pd df = pd.read_csv("glassdoor_jobs.csv") df = df[df["Salary Estimate"] != "-1"] df # TO DO IN DATA CLEANING # ------------------- # salary parsing # %% salary = df["Salary Estimate"].apply(lambda x: x.split("(")[0]) # salary minus_Kd = salary.apply( ...
3.5625
4
Ultraviz/src/log_handler.py
ultraleap/ultraleap-labs-ultraviz
0
39543
# -*- coding: utf-8 -*- """ # Class to handle reading of SDK Log Data as a pipe/fifo for # Windows and Unix, to avoid big log files. ---------------------------------------------------------- """ import platform import os import tempfile IS_WINDOWS = platform.system().lower() == "windows" if IS_WINDOWS: try: ...
2.3125
2
stackimpact/utils.py
timgates42/stackimpact-python
742
39544
import time import uuid import base64 import hashlib def millis(): return int(round(time.time() * 1000)) def timestamp(): return int(time.time()) def base64_encode(s): return base64.b64encode(s.encode('utf-8')).decode('utf-8') def base64_decode(b): return base64.b64decode(b).decode('utf-8') ...
2.46875
2
example/app/views.py
aolkin/django-bootstrap-form
324
39545
<gh_stars>100-1000 from django.shortcuts import render from app.forms import ExampleForm def index(request): form = ExampleForm() return render(request, 'index.html', {'form': form})
1.570313
2
yt_downloader_with_GUI.py
francecon/YT-AUDIO-DOWNLOADER
0
39546
import glob import os # os.environ["IMAGEIO_FFMPEG_EXE"] = "C:/ffmpeg-4.4.1-essentials_build/ffmpeg-4.4.1-essentials_build/bin" import re import sys import urllib from tkinter import (BOTH, RIGHT, YES, Button, Entry, Label, Listbox, Menu, Scrollbar, StringVar, Tk, Y) from tkinter import messagebox ...
2.671875
3
sdap_ingest_manager/history_manager/__init__.py
tloubrieu-jpl/incubator-sdap-nexus-ingestion-manager
0
39547
from .util import md5sum_from_filepath from .datasetingestionhistorysolr import DatasetIngestionHistorySolr from .datasetingestionhistoryfile import DatasetIngestionHistoryFile
1.117188
1
SistemaPago/contact/views.py
cluco91/Django_SistemaPago
0
39548
<filename>SistemaPago/contact/views.py<gh_stars>0 from django.shortcuts import render from django.core.mail import send_mail from django.conf import settings from .forms import contactForm # Create your views here. def contact(request): title = 'Contacto' form = contactForm(request.POST or None) confirm_message = ...
2.015625
2
Image Classification/CGIAR Crop Yield Prediction Challenge/omarhzm/fields (1).py
ZindiAfrica/Computer-Vision
0
39549
import os import numpy as np import pandas as pd import matplotlib.pyplot as plt from sklearn.model_selection import train_test_split from sklearn.metrics import mean_squared_error import glob, random import sklearn from sklearn.decomposition import PCA from xgboost.sklearn import XGBRegressor from sklearn.tr...
2.46875
2
parserAlejandroTejada.py
tej17584/proyecto3DisenoLenguajes
0
39550
<reponame>tej17584/proyecto3DisenoLenguajes import pickle class parserAlejandro(): def __init__(self) -> None: self.tokensScaneados = "" # los tokens leidos self.tokensScaneadosV2 = [] self.tokensMapeados = "" self.lastToken = "" self.lookAheadToken = "" self.lee...
3.140625
3
humidityModule.py
HarvardURC/MATE_ROV
1
39551
<filename>humidityModule.py #!/usr/bin/env python3 import os, random import Adafruit_DHT import robomodules as rm from messages import * ADDRESS = os.environ.get("BIND_ADDRESS","localhost") PORT = os.environ.get("BIND_PORT", 11297) FREQUENCY = 10 SENSOR_PIN1 = 21 class HumidityModule(rm.ProtoModule): def __init...
2.609375
3
src/towerData.py
jahrmarkt/TowerGame
0
39552
from enum import Enum from pygame.sprite import * pygame.init() pygame.mixer.init() size = (width, height) = 512, 704 screen = pygame.display.set_mode(size) def loadTower(n): filename = "assets/sprites/towers/" + n + ".png" return pygame.image.load(filename).convert_alpha() def loadProjectile(n): ...
2.875
3
lib/iputils.py
cmusatyalab/PyEdgeSim
0
39553
import math def ipno2ipadd(ipno): if math.isnan(ipno): ipno = 0 w = int ( ipno / 16777216 ) % 256 x = int ( ipno / 65536 ) % 256 y = int ( ipno / 256 ) % 256 z = int ( ipno ) % 256 return "{}.{}.{}.{}".format(w,x,y,z) def ipadd2ipno(ipadd): w,x,y,z = ipadd.split('....
2.875
3
example_app/blog/models.py
yswtrue/taggit-selectize
77
39554
<filename>example_app/blog/models.py from django.db import models from django.utils.encoding import python_2_unicode_compatible from taggit_selectize.managers import TaggableManager @python_2_unicode_compatible class Blog(models.Model): title = models.CharField(max_length=255) slug = models.SlugField(editabl...
2.21875
2
site_scons/site_tools/mongo_test_list.py
benety/mongo
0
39555
# Copyright 2020 MongoDB Inc. # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the # "Software"), to deal in the Software without restriction, including # without limitation the rights to use, copy, modify, merge, publish, # distribu...
1.914063
2
Pluto/Systems/__init__.py
n8vm/Foton
10
39556
<gh_stars>1-10 from Pluto.Systems.Systems import *
1.117188
1
MULTITASK_FILES/TSM_FILES/scripts/anns-stats.py
egoodman92/semi-supervised-surgery
0
39557
<gh_stars>0 import pandas as pd import click import statistics def stats(ann_path): df = pd.read_csv(ann_path) df = df.sort_values(by=['video_id', 'start_seconds']) if not 'label' in df.columns: df['label'] = df['labeler_2'] df.loc[df['label'] == 'none', 'label'] = 'background' df...
3
3
architecture/structures/fsm.py
TEKERone/VuelaBot
0
39558
<gh_stars>0 #! /usr/bin/env python # -*- coding: utf-8 -*- from __future__ import absolute_import from __future__ import division from __future__ import print_function from architecture.structures.states import State from architecture.sensors.parsing import NLParser class FSM: """Máquina de estados """ d...
2.75
3
generate_pre-test_confis.py
DirkZomerdijk/status
0
39559
<reponame>DirkZomerdijk/status<gh_stars>0 #%% import numpy as np import matplotlib.pyplot as plt import json import copy # chronic_threshold # repeats # time # stress_max global_settings = { "data_file": "clean", "save_folder": "pre-test\\", "status_type": "linear", "distance_measure": "euclidean", ...
2.15625
2
checkov/terraform/checks/resource/gcp/GoogleComputeBootDiskEncryption.py
shimont/checkov
0
39560
from checkov.terraform.checks.resource.base_resource_check import BaseResourceCheck from checkov.common.models.enums import CheckResult, CheckCategories class GoogleComputeBootDiskEncryption(BaseResourceCheck): def __init__(self): name = "Ensure VM disks for critical VMs are encrypted with CustomerSupplie...
2.140625
2
siren.py
idgmatrix/coin
84
39561
<filename>siren.py # Based on https://github.com/lucidrains/siren-pytorch import torch from torch import nn from math import sqrt class Sine(nn.Module): """Sine activation with scaling. Args: w0 (float): Omega_0 parameter from SIREN paper. """ def __init__(self, w0=1.): super().__init...
2.90625
3
asset/google/cloud/asset_v1/proto/asset_service_pb2_grpc.py
conwaychriscosmo/google-cloud-python
1
39562
# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT! import grpc from google.cloud.asset_v1.proto import ( asset_service_pb2 as google_dot_cloud_dot_asset__v1_dot_proto_dot_asset__service__pb2, ) from google.longrunning import ( operations_pb2 as google_dot_longrunning_dot_operations__pb2, ) f...
1.65625
2
sat_datetime/__init__.py
junhg0211/sat-datetime
0
39563
from .sat_datetime import SatDatetime, SatTimedelta
1.109375
1
src/main/python/cobra/mit/_loader.py
tm0nk/cobra-j
0
39564
<filename>src/main/python/cobra/mit/_loader.py<gh_stars>0 # Copyright (c) '2015' Cisco Systems, Inc. All Rights Reserved import importlib class ClassLoader(object): @classmethod def loadClass(cls, fqClassName): fqClassName = str(fqClassName) moduleName, className = fqClassName.rsplit('.', 1) ...
2.203125
2
Knil Dungeon/Dialog.py
WexyR/KNIL
0
39565
<reponame>WexyR/KNIL # -*- coding: utf-8 -*- import Menu import Game import Tools def dialog_box_create(ROWS, COLS, percent_size_rows=0.25): """Initialise une boite de dialogue""" assert isinstance(percent_size_rows, float) and 0 <= percent_size_rows d = dict() x = 1 y = int((ROWS-1) * (1-percent...
2.90625
3
auth/oauth.py
sensi277/rebble-auth-py
0
39566
from datetime import datetime, timedelta import logging from flask import Blueprint, abort, render_template, request, redirect from flask_oauthlib.provider import OAuth2Provider from oauthlib.common import generate_token as generate_random_token from flask_login import current_user, login_required from auth.login.bas...
2.140625
2
datasets/creator.py
ionicsolutions/kokolores
1
39567
<reponame>ionicsolutions/kokolores<filename>datasets/creator.py # MIT License # # Copyright (c) 2018 <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 wi...
1.570313
2
04-Working-With-Dataframes/4.Exercise_ Distinct Articles.py
RodriGonca/DP-203-Data-Engineer
0
39568
# Databricks notebook source # MAGIC %md # MAGIC # Introduction to DataFrames Lab # MAGIC ## Distinct Articles # COMMAND ---------- # MAGIC %md # MAGIC ##![Spark Logo Tiny](https://files.training.databricks.com/images/105/logo_spark_tiny.png) Instructions # MAGIC # MAGIC In the cell provided below, write the code ne...
3.328125
3
schema_validators.py
iamtemazhe/excel_API
0
39569
from re import compile as re_compile from urllib.parse import parse_qs, quote_plus, urlencode, urlparse, urlunparse from marshmallow import ValidationError from .base_validators import BaseError, BaseValidator class ValidError(BaseError): @classmethod def field_is_missing(cls, field: str, field_name: str) -...
2.609375
3
_CNDB/_OMP/Net_Credentials.py
CNDB/CNDB
0
39570
# -*- coding: utf-8 -*- # Copyright (C) 2012-2014 Mag. <NAME> All rights reserved # Glasauergasse 32, A--1130 Wien, Austria. <EMAIL> # #*** <License> ************************************************************# # This module is part of the package CNDB.OMP. # # This module is licensed under the terms of the BSD 3-Cla...
1.414063
1
52_最长不含重复字符的子字符串.py
wode1/-offer-python-
0
39571
''' 从字符串中找出一个最长的不包含重复字符的子字符串,计算该最长子字符串的长度。假设字符串中只包含'a'~'z的字符。例如,在字 符串"arabcacfr"中,最长的不含重复字符的子字符串是"acfr",长度为4。 ''' class Solution: def lengthOfLongestSubstring(self, s): if len(s) <= 1: return len(s) head, tail = 0, 0 maxLen = 1 while tail+1 < len(s): tail += 1 # 往窗口内添加元素 if s[tail] not in s[head: tai...
3.703125
4
capybara_tw/__init__.py
capybara-translation/capybara-tw
0
39572
#!/usr/bin/env python3 import sys from PyQt5.QtWidgets import QApplication from capybara_tw.app import MainWindow __version__ = '0.1' __application_name__ = 'Capybara Translation Workbench' __organization_name__ = 'Capybara Translation' def run(): app_ = QApplication(sys.argv) app_.setApplicationName(__appli...
2.09375
2
app/car/tests/test_cars_api.py
raszidzie/cars-api
1
39573
import requests from django.urls import reverse from django.test import TestCase from django.db.models import Count from django.shortcuts import get_object_or_404 from rest_framework import status from rest_framework.test import APIClient from core.models import Car, Rate from car.serializers import CarSerializer, P...
2.53125
3
setup.py
84KaliPleXon3/bni-api
9
39574
<reponame>84KaliPleXon3/bni-api import setuptools import re with open('README.md', 'r') as fh: long_description = fh.read() def get_version(): with open('bni_api/__init__.py') as f: v = re.findall(r'__version__ = \'(.+?)\'', f.read())[0] return v setuptools.setup( name="bni_api", version=...
1.78125
2
example/controller/tests/testing/foo.py
donghak-shin/dp-tornado
18
39575
<filename>example/controller/tests/testing/foo.py # -*- coding: utf-8 -*- from dp_tornado.engine.controller import Controller class FooController(Controller): def post(self): """ .. test:: expect(text='foo==bar', params={'foo': 'bar'}) expect(code=400, params=...
2.75
3
pytorch3d/implicitron/dataset/dataset_zoo.py
JulianKnodt/pytorch3d
0
39576
# Copyright (c) Meta Platforms, Inc. and affiliates. # All rights reserved. # # This source code is licensed under the BSD-style license found in the # LICENSE file in the root directory of this source tree. import copy import json import os from typing import Any, Dict, List, Optional, Sequence from iopath.common.f...
1.804688
2
sh/scripts/view_faucet_account_keys.py
goral09/stests
4
39577
<gh_stars>1-10 import argparse from stests.core import cache from stests.core import factory from stests.core.utils import args_validator from stests.core.utils import cli as utils from stests.core.utils import env from arg_utils import get_network # CLI argument parser. ARGS = argparse.ArgumentParser("Displays a k...
2.46875
2
tvae/experiments/tvae_norb.py
anoniccv2021/Predictive-Coding-Topographic-VAE
0
39578
<filename>tvae/experiments/tvae_norb.py<gh_stars>0 import os import wandb from tqdm import tqdm import torch from torch import optim from torch.optim.lr_scheduler import StepLR from torch import nn from torch.nn import functional as F from tvae.data.small_norb import get_dataloader from tvae.containers.tvae import TVA...
1.59375
2
tests/mac-logs/examples/tag/tag.py
andrewp-as-is/mac-logs.py
1
39579
<filename>tests/mac-logs/examples/tag/tag.py #!/usr/bin/env python import mac_logs mac_logs.tag()
1.171875
1
ann.py
ErikRichardS/text-generator
0
39580
import torch import torch.nn as nn import torch.nn.functional as F import math class RNN(nn.Module): def __init__(self, num_layers, hidden_size, input_size): super(RNN, self).__init__() self.num_layers = num_layers self.hidden_size = hidden_size self.encoder = nn.Emb...
2.953125
3
camd3/infrastructure/component/tests/test_idgenerators.py
mamrhein/CAmD3
0
39581
<gh_stars>0 #!/usr/bin/env python # ---------------------------------------------------------------------------- # Name: test_idgenerators # Purpose: Test driver for module idgenerators # # Author: <NAME> (<EMAIL>) # # Copyright: (c) <NAME> # -----------------------------------------------------------...
2.46875
2
seahub/onlyoffice/views.py
jjzhang166/seahub
0
39582
<reponame>jjzhang166/seahub # Copyright (c) 2012-2017 Seafile Ltd. import json import logging import os import requests import urllib2 from django.core.cache import cache from django.http import HttpResponse from django.views.decorators.csrf import csrf_exempt from seaserv import seafile_api from .settings import VER...
1.914063
2
ProgrammingAssignments/pyretic/pyretic/tutorial/of_tutorial.py
Mahdi-Asaly/Coursera-SDN-Assignments
0
39583
<gh_stars>0 ################################################################################ # The Pyretic Project # # frenetic-lang.org/pyretic # # author: <NAME> (<EMAIL>) # #####...
1.234375
1
brambling/management/commands/update_tokens.py
j-po/django-brambling
0
39584
from optparse import make_option from django.core.management.base import BaseCommand, CommandError from brambling.utils.payment import dwolla_update_tokens class Command(BaseCommand): option_list = BaseCommand.option_list + ( make_option( '--days', action='store', des...
2.140625
2
scripts/shared.py
bozhnyukAlex/high-performance-graph-analysis-course
1
39585
<reponame>bozhnyukAlex/high-performance-graph-analysis-course<gh_stars>1-10 import os import pathlib ROOT = pathlib.Path(__file__).parent.parent DOCS = ROOT / "docs" TESTS = ROOT / "tests" def configure_python_path(): python_path = os.getenv("PYTHONPATH") if python_path is None: os.environ["PYTHONPA...
2.4375
2
main.py
Ethan-Chew/toobox
4
39586
# Everyone did everything here ## JSON, Main UI, Keybinds, 'Backend' mostly by Ethan ## Refractoring, 'Backend' by Jerick ## Everything else + Starting Point by Granwyn import tkinter as tk from tkinter import ttk import os from tkinter import font import json from PIL import ImageTk, Image from tkinter import Menu im...
2.515625
3
test/acceptance/tools/fabric_utils.py
FIWARE/cloud.PaaS
0
39587
# -*- coding: utf-8 -*- # Copyright 2014 Telefonica Investigación y Desarrollo, S.A.U # # This file is part of FI-WARE project. # # 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://w...
2.140625
2
testbot/bot/bot.py
Carberra/discord.py-2.0-testing
0
39588
import traceback from pathlib import Path import discord from apscheduler.schedulers.asyncio import AsyncIOScheduler from discord.ext import commands, fancyhelp from pytz import utc from testbot import __version__ MAIN_GUILD_ID = 845688627265536010 STDOUT_CHANNEL_ID = 845691044527210515 class Bot(commands.Bot): ...
2.265625
2
alembic/versions/8feba263d722_added_a_flag_to_commands_if_it_should_.py
smackedlol/pajbot
1
39589
"""Added a flag to commands if it should be run through the banphrases Revision ID: 8feba263d722 Revises: a6f9b5c3ba83 Create Date: 2016-05-24 22:04:49.803097 """ # revision identifiers, used by Alembic. revision = '8feba263d722' down_revision = '<KEY>' branch_labels = None depends_on = None from alembic import op ...
1.367188
1
hdri_encoding/metadata_encoding_utils.py
microsoft/ConfigNet
82
39590
# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. """Common functions used by the metadata encoding scripts""" import json def load_metadata_dicts(metadata_files): metadata_dicts = [] for metadata_file in metadata_files: with open(metadata_file, "r") as fp: m...
2.671875
3
code/segmentation/MELC_ImageProcessing.py
perlfloccri/DeepFLEX
0
39591
from MELC.utils.myDatasets import generate_workingRaw_from_raw, MELCStructureDataset import numpy as np import tifffile as tiff from MELC.utils.registration_daria import register import matplotlib.pyplot as plt import cv2 from MELC.utils.Files import create_folder from skimage import img_as_float, img_as_uint from MELC...
2.0625
2
examples/extremes.py
gimait/pycozmo
1
39592
<gh_stars>1-10 #!/usr/bin/env python import time import pycozmo def pycozmo_program(cli: pycozmo.client.Client): cli.set_head_angle(pycozmo.MAX_HEAD_ANGLE.radians) time.sleep(1) cli.set_head_angle(pycozmo.MIN_HEAD_ANGLE.radians) time.sleep(1) cli.set_lift_height(pycozmo.MAX_LIFT_HEIGHT.mm) ...
2.28125
2
ryu/tests/server-for-consistency-test.py
uiuc-srg/ryu
0
39593
#!/usr/bin/env python """ An echo server that uses select to handle multiple clients at a time. Command-line parameter: port=listening port """ import select import socket import sys if len(sys.argv)!=2: print("You need to specify a listening port!") sys.exit() host = '' port = int(sys.argv[1]) back...
3.5
4
2015/python/d07.py
eduellery/adventofcode
0
39594
<gh_stars>0 import re lines = open('d07.in').read().split('\n') calc = dict() for line in lines: instruction = re.findall(r'(.*)\s->\s(\w*)', line) for ops, register in instruction: calc[register] = ops.strip().split(' ') def calculate(register): try: return int(register) except Valu...
3.03125
3
extensions/logger.py
cobrab11/black1-bot
3
39595
<reponame>cobrab11/black1-bot<filename>extensions/logger.py # BS mark.1-55 # /* coding: utf-8 */ # BlackSmith mark.1 # logger.py # © 2011-2013 simpleApps (http://simpleapps.ru) # Thanks to: WitcherGeralt (<EMAIL>) logConfigFile = "dynamic/logstate.txt" logCacheFile = "logcache.txt" logThemes = {} Months, Days = ...
1.828125
2
jupiter/use_cases/prm/person/remove.py
horia141/jupiter
15
39596
<reponame>horia141/jupiter<gh_stars>10-100 """Remove a person.""" import logging from typing import Final from jupiter.domain.inbox_tasks.infra.inbox_task_notion_manager import InboxTaskNotionManager from jupiter.domain.prm.infra.prm_notion_manager import PrmNotionManager from jupiter.domain.prm.service.remove_service...
1.929688
2
lib/durak/game/ai.py
maximpertsov/durak-sockets
0
39597
from itertools import chain from random import choice from lib.durak.exceptions import IllegalAction class AI: class CannotPerform(IllegalAction): pass def __init__(self, *, game): self._game = game def perform_action(self, *, player): """ Have the user perform a random ...
3.234375
3
diatomic/grids.py
ihavalyova/DiAtomic
3
39598
import numpy as np from utils import C_bohr __all__ = ['Grid'] class Grid: def __init__(self, npoints, rgrid, solver='sinc', alpha=0.0, rbar=0.0): self.ngrid = npoints self.rmin = rgrid[0] / C_bohr self.rmax = rgrid[1] / C_bohr rbar = rbar / C_bohr self.solver = solver.l...
2.5625
3
string/tinyUrl.py
mengyangbai/leetcode
0
39599
import random class Codec: base62 = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ' baseurl = 'http://tinyurl.com/' tinyTolong = {'1':'1'} longTotiny = {} def encode(self, longUrl): """Encodes a URL to a shortened URL. :type longUrl: str :rtype: str ...
3.171875
3