max_stars_repo_path
stringlengths
3
269
max_stars_repo_name
stringlengths
4
119
max_stars_count
int64
0
191k
id
stringlengths
1
7
content
stringlengths
6
1.05M
score
float64
0.23
5.13
int_score
int64
0
5
src/backend/backend/shopit/migrations/0024_auto_20201028_2008.py
tejpratap545/E-Commerce-Application
0
21500
<reponame>tejpratap545/E-Commerce-Application<filename>src/backend/backend/shopit/migrations/0024_auto_20201028_2008.py # Generated by Django 3.1.2 on 2020-10-28 14:38 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('shopit', '0023_availablefilterselecto...
1.671875
2
aoc/event2019/day19/solve.py
rjbatista/AoC
0
21501
<filename>aoc/event2019/day19/solve.py from event2019.day13.computer_v4 import Computer_v4 ######## # PART 1 computer = Computer_v4([]) computer.load_code("event2019/day19/input.txt") def get_value(x, y): out = [] computer.reload_code() computer.run([x, y], out) return out[0] def get_area(side = ...
3.171875
3
fileo/accounts/forms.py
Tiqur/Fileo
0
21502
<reponame>Tiqur/Fileo from django import forms from django.contrib.auth import authenticate from django.contrib.auth.forms import UserCreationForm from .models import FileoUser User = FileoUser() class UserLoginForm(forms.ModelForm): password = forms.CharField(label='Password', widget=forms.PasswordInput) cl...
2.703125
3
setup.py
jnsgruk/lightkube-models
1
21503
from setuptools import setup from pathlib import Path from lightkube.models import __version__ setup( name='lightkube-models', version=__version__, description='Models and Resources for lightkube module', long_description=Path("README.md").read_text(), long_description_content_type="text/markdown...
1.382813
1
kagi/upper/west/_capital/four.py
jedhsu/kagi
0
21504
<filename>kagi/upper/west/_capital/four.py """ *Upper-West Capital 4* ⠨ The upper-west capital four gi. """ from dataclasses import dataclass from ....._gi import Gi from ....capital import CapitalGi from ...._gi import StrismicGi from ....west import WesternGi from ...._number import FourGi from ..._gi im...
2.0625
2
tests/test_dictattr.py
atsuoishimoto/jashin
1
21505
import enum from typing import Any, Dict from jashin.dictattr import * def test_dictattr() -> None: class Test: field1 = ItemAttr[str]() field2 = ItemAttr[str](name="field_2") field3 = ItemAttr[str](default="default_field3") def __dictattr_get__(self) -> Dict[str, Any]: ...
2.84375
3
acmicpc/5612.py
juseongkr/BOJ
7
21506
<gh_stars>1-10 n = int(input()) m = int(input()) r = m for i in range(n): a, b = map(int, input().split()) m += a m -= b if m < 0: print(0) exit() r = max(r, m) print(r)
2.546875
3
tests/function/test_func_partition.py
ddimatos/zhmc-ansible-modules
0
21507
#!/usr/bin/env python # Copyright 2017-2020 IBM Corp. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless require...
1.765625
2
users/models.py
uoe-compsci-grp30/campusgame
0
21508
<filename>users/models.py<gh_stars>0 import uuid from django.contrib.auth.models import AbstractUser from django.db import models """ The user model that represents a user participating in the game. Implemented using the built-in Django user model: AbstractUser. """ class User(AbstractUser): """ The User class...
3.546875
4
slidingwindow_generator/slidingwindow_generator.py
flashspys/SlidingWindowGenerator
3
21509
<reponame>flashspys/SlidingWindowGenerator<gh_stars>1-10 import numpy as np import tensorflow as tf class SlidingWindowGenerator: def __init__(self, input_width, label_width, shift, train_df, val_df, test_df, label_columns=None): # Store raw data with dataframe type ...
2.640625
3
carla/util.py
dixantmittal/intelligent-autonomous-vehicle-controller
1
21510
# Copyright (c) 2017 Computer Vision Center (CVC) at the Universitat Autonoma de # Barcelona (UAB), and the INTEL Visual Computing Lab. # # This work is licensed under the terms of the MIT license. # For a copy, see <https://opensource.org/licenses/MIT>. import datetime import sys from contextlib import contextmanage...
2.453125
2
examples/session2-fi/start2.py
futurice/PythonInBrowser
4
21511
<reponame>futurice/PythonInBrowser # Käydään läpi mitä opimme viime viikolla (ja myös jotakin uutta) # Jos jokin asia mietityttää, kysy vain rohkeasti apua! ##### INFO ##### # Viime viikon tärkeimmät asiat olivat: # 1. print-komento # 2. muuttujan käyttö # 3. kilpikonnan käyttäminen piirtämiseen # Ohelmointi vaatii u...
2.203125
2
train.py
EdwardLeeMacau/PFFNet
0
21512
""" FileName [ train.py ] PackageName [ PFFNet ] Synopsis [ Train the model ] Usage: >>> python train.py --normalized --cuda """ import argparse import os import shutil from datetime import date import matplotlib import numpy as np import pandas as pd import torch import torchvision import torchvi...
2.359375
2
python_high/chapter_3/3.1.py
Rolling-meatballs/deepshare
0
21513
<gh_stars>0 name = " alberT" one = name.rsplit() print("one:", one) two = name.index('al', 0) print("two:", two) three = name.index('T', -1) print("three:", three) four = name.replace('l', 'p') print("four:", four) five = name.split('l') print("five:", five) six = name.upper() print("six:", six) seven = name.low...
3.5625
4
src/views/simplepage/models.py
svenvandescheur/svenv.nl-new
0
21514
from cms.extensions import PageExtension from cms.extensions.extension_pool import extension_pool from django.utils.translation import ugettext as _ from filer.fields.image import FilerImageField class SimplePageExtension(PageExtension): """ A generic website page. """ image = FilerImageField(verbose_...
1.765625
2
baekjoon/not-classified/10844/10844.py
honux77/algorithm
2
21515
n = int(input()) s = [[0] * 10 for _ in range(n + 1)] s[1] = [0] + [1] * 9 mod = 1000 ** 3 for i in range(2, n + 1): for j in range(0, 9 + 1): if j >= 1: s[i][j] += s[i - 1][j - 1] if j <= 8: s[i][j] += s[i - 1][j + 1] print(sum(s[n]) % mod)
2.84375
3
Ideas/cricket-umpire-assistance-master/visualization/test2.py
hsspratt/Nott-Hawkeye1
0
21516
### INITIALIZE VPYTHON # ----------------------------------------------------------------------- from __future__ import division from visual import * from physutil import * from visual.graph import * ### SETUP ELEMENTS FOR GRAPHING, SIMULATION, VISUALIZATION, TIMING # -------------------------------------------------...
3.3125
3
parking_systems/models.py
InaraShalfei/parking_system
0
21517
<reponame>InaraShalfei/parking_system from django.db import models class Parking(models.Model): def __str__(self): return f'Парковочное место №{self.id}' class Reservation(models.Model): parking_space = models.ForeignKey(Parking, on_delete=models.CASCADE, related_name='reservations', ...
2.453125
2
sktime/classification/kernel_based/_rocket_classifier.py
ltoniazzi/sktime
1
21518
<gh_stars>1-10 # -*- coding: utf-8 -*- """RandOm Convolutional KErnel Transform (ROCKET).""" __author__ = "<NAME>" __all__ = ["ROCKETClassifier"] import numpy as np from sklearn.linear_model import RidgeClassifierCV from sklearn.pipeline import make_pipeline from sklearn.utils.multiclass import class_distribution fr...
2.359375
2
mc/opcodes.py
iximeow/binja-m16c
12
21519
import re from . import tables from .instr import Instruction from .instr.nop import * from .instr.alu import * from .instr.bcd import * from .instr.bit import * from .instr.flag import * from .instr.mov import * from .instr.smov import * from .instr.ld_st import * from .instr.stack import * from .instr.jmp import * f...
1.828125
2
class16.py
SamratAdhikari/Python_class_files
0
21520
# import calculate # import calculate as cal # from calculate import diff as df # from calculate import * # print(cal.pi) # pi = 3.1415 # print(diff(5,2)) # print(pi) # print(calculate.pi) # print(calculate.sum(3)) # print(calculate.div(2,1)) # print(abs(-23.21)) # print(math.ceil(5.23)) # print(dir(math)) # # print(...
3.3125
3
hsir/law.py
WenjieZ/wuhan-pneumonia
6
21521
from abc import ABCMeta, abstractmethod import numpy as np __all__ = ['Law', 'Bin', 'Poi', 'Gau'] class Law(metaclass=ABCMeta): @staticmethod @abstractmethod def sample(n, d): pass @staticmethod @abstractmethod def loglikely(n, d, k): pass @staticmethod def likeli...
2.953125
3
src/dummy/toga_dummy/widgets/canvas.py
Donyme/toga
0
21522
<gh_stars>0 import re from .base import Widget class Canvas(Widget): def create(self): self._action('create Canvas') def set_on_draw(self, handler): self._set_value('on_draw', handler) def set_context(self, context): self._set_value('context', context) def line_width(self, ...
2.640625
3
rpncalc/exceptions.py
newmanrs/rpncalc
0
21523
<gh_stars>0 class RpnCalcError(Exception): """Calculator Generic Exception""" pass class StackDepletedError(RpnCalcError): """ Stack is out of items """ pass
2.3125
2
tests/unit/schemas/test_base_schema_class.py
gamechanger/dusty
421
21524
from unittest import TestCase from schemer import Schema, Array, ValidationException from dusty.schemas.base_schema_class import DustySchema, DustySpecs from ...testcases import DustyTestCase class TestDustySchemaClass(TestCase): def setUp(self): self.base_schema = Schema({'street': {'type': basestring},...
2.5
2
Objected-Oriented Systems/Python_OOP_SDA/Task1.py
syedwaleedhyder/Freelance_Projects
1
21525
from abc import ABCMeta, abstractmethod, abstractproperty from datetime import datetime, date class Item(metaclass=ABCMeta): def __init__(self, code, name, quantity, cost, offer): self.item_code=code self.item_name=name self.quantity_on_hand=quantity self.cost_price=cost sel...
3.828125
4
compose/production/mongodb_backup/scripts/list_dbs.py
IMTEK-Simulation/mongodb-backup-container-image
0
21526
#!/usr/bin/env python3 host = 'mongodb' port = 27017 ssl_ca_cert='/run/secrets/rootCA.pem' ssl_certfile='/run/secrets/tls_cert.pem' ssl_keyfile='/run/secrets/tls_key.pem' # don't turn these signal into exceptions, just die. # necessary for integrating into bash script pipelines seamlessly. import signal signal.signal(...
1.671875
2
host.py
KeePinnnn/social_media_analytic
1
21527
<filename>host.py from flask import Flask, send_from_directory, request, Response, render_template, jsonify from test import demo import subprocess import os app = Flask(__name__, static_folder='static') @app.route('/') def home(): return "hello world" @app.route('/detector') def detector(): return send_fr...
2.703125
3
venv/lib/python3.6/site-packages/torch/_jit_internal.py
databill86/HyperFoods
2
21528
""" The weak_script annotation needs to be here instead of inside torch/jit/ so it can be used in other places in torch/ (namely torch.nn) without running into circular dependency problems """ import weakref import inspect try: import builtins # PY3 except Exception: import __builtin__ as builtins # PY2 # T...
2.21875
2
examples/qiushi.py
qDonl/Spider
0
21529
import re, requests def parse_page(url): headers = { 'User-Agent': "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/68.0.3440.84 Safari/537.36" } response = requests.get(url, headers=headers) text = response.content.decode("utf-8") contents = re.finda...
3.125
3
benchmark/python/benchmark/benchmark_main.py
toschmidt/pg-cv
3
21530
<filename>benchmark/python/benchmark/benchmark_main.py from benchmark_query import BenchmarkQuery from clear import ClearViews, ClearQuery, ClearPublic from compare_query import CompareQuery from database import Database from setup import SetupPublic, SetupViews, SetupQuery from timing import Timing # remove all poss...
2.515625
3
nelpy/plotting/decoding.py
shayokdutta/nelpy_modified
0
21531
__all__ = ['plot_cum_error_dist'] import numpy as np # import matplotlib as mpl import matplotlib.pyplot as plt import matplotlib.patches as patches from mpl_toolkits.axes_grid.inset_locator import inset_axes import itertools from . import palettes # colors = itertools.cycle(npl.palettes.color_palette(palette="sweet",...
2.234375
2
code/abc122_a_01.py
KoyanagiHitoshi/AtCoder
3
21532
b=input() print("A" if b=="T" else "T" if b=="A" else "G" if b=="C" else "C")
3.71875
4
setup.py
carrasquel/wikipit
1
21533
<filename>setup.py """Setup specifications for gitignore project.""" from os import path from setuptools import setup here = path.abspath(path.dirname(__file__)) # Get the long description from the README file with open(path.join(here, 'README.md'), encoding='utf-8') as f: long_description = f.read() setup( ...
1.804688
2
samples.py
daimeng/py-geode
0
21534
<filename>samples.py import aiohttp import time import ujson import asyncio import prettyprinter import numpy as np import pandas as pd from geode.dispatcher import AsyncDispatcher prettyprinter.install_extras(include=['dataclasses']) pd.set_option('display.float_format', '{:.4f}'.format) async def main(): clie...
2.1875
2
functional_tests.py
idanmel/soccer_friends
0
21535
from selenium import webdriver browser = webdriver.Firefox() browser.get('http://localhost:8000') try: assert 'Django' in browser.title finally: browser.close()
1.914063
2
lorenzsj/blog/views.py
lorenzsj/lorenzsj
0
21536
from django.contrib.auth.models import User from rest_framework import viewsets from rest_framework import permissions from rest_framework.response import Response from blog.models import Post from blog.serializers import PostSerializer from blog.serializers import UserSerializer from blog.permissions import IsAuthor...
2.28125
2
src/piminder_service/resources/db_autoinit.py
ZAdamMac/pyminder
0
21537
""" This script is a component of Piminder's back-end controller. Specifically, it is a helper utility to be used to intialize a database for the user and message tables. Author: <NAME> (<EMAIL>) An Arcana Labs utility. Produced under license. Full license and documentation to be found at: https://github.com/ZAdamMac/...
2.671875
3
conftest.py
jirikuncar/renku-python
0
21538
# -*- coding: utf-8 -*- # # Copyright 2017 - Swiss Data Science Center (SDSC) # A partnership between École Polytechnique Fédérale de Lausanne (EPFL) and # Eidgenössische Technische Hochschule Zürich (ETHZ). # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compli...
1.898438
2
kuchinawa/Logger.py
threemeninaboat3247/kuchinawa
4
21539
# -*- coding: utf-8 -*- """ --- Description --- Module: Logger.py Abstract: A module for logging Modified: threemeninaboat3247 2018/04/30 --- End --- """ # Standard library imports import logging logger = logging.getLogger('Kuchinawa Log') # ログレベルの設定 logger.setLevel(1...
2.09375
2
test/search/capacity.py
sbutler/spotseeker_server
0
21540
""" Copyright 2012, 2013 UW Information Technology, University of Washington 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 r...
1.765625
2
model/k1_clustering_pre-processing.py
not-a-hot-dog/spotify_project
0
21541
import pandas as pd import numpy as np from model.helper_functions import build_playlist_features print('Reading data into memory') pid_list = np.genfromtxt('../data/train_pids.csv', skip_header=1, dtype=int) playlistfile = '../data/playlists.csv' playlist_df = pd.read_csv(playlistfile) trackfile = '../data/songs_1000...
2.8125
3
app/main/__init__.py
a2hsh/udacity-fsnd-capstone
0
21542
<gh_stars>0 # routes Blueprint from flask import Blueprint, jsonify, request, redirect, render_template from flask_cors import CORS from os import environ # initializing the blueprint main = Blueprint('main', __name__) CORS(main, resources={r'*': {'origins': '*'}}) @main.after_request def after_request(resp...
2.296875
2
agenda/tests/test_models.py
migueleichler/django-tdd
0
21543
<filename>agenda/tests/test_models.py from django.test import TestCase from agenda.models import Compromisso from model_mommy import mommy class CompromissoModelTest(TestCase): def setUp(self): self.instance = mommy.make('Compromisso') def test_string_representation(self): self.assertEqual(...
2.296875
2
tests/test_crypto/test_registry/test_misc.py
valory-xyz/agents-aea
0
21544
<gh_stars>0 # -*- coding: utf-8 -*- # ------------------------------------------------------------------------------ # # Copyright 2022 Valory AG # Copyright 2018-2020 Fetch.AI Limited # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the L...
1.804688
2
pyof/v0x05/asynchronous/table_status.py
mhaji007/python-openflow
0
21545
"""Defines an Table Status Message.""" # System imports from enum import IntEnum # Local source tree imports from pyof.foundation.base import GenericMessage, GenericStruct from pyof.foundation.basic_types import BinaryData, FixedTypeList, UBInt16, UBInt8, UBInt32, UBInt64, Pad from pyof.v0x05.common.header import He...
2.359375
2
DEQModel/utils/debug.py
JunLi-Galios/deq
548
21546
import torch from torch.autograd import Function class Identity(Function): @staticmethod def forward(ctx, x, name): ctx.name = name return x.clone() def backward(ctx, grad): import pydevd pydevd.settrace(suspend=False, trace_only_current_thread=True) grad_temp = gr...
2.5625
3
feature_track_visualizer/visualizer.py
jfvilaro/rpg_feature_tracking_analysis
0
21547
<gh_stars>0 from os.path import isfile import os import cv2 from os.path import join import numpy as np import tqdm import random from big_pun.tracker_utils import filter_first_tracks, getTrackData def component(): return random.randint(0, 255) class FeatureTracksVisualizer: def __init__(self, gt_file,tra...
2.203125
2
Polygon2-2.0.7/Polygon/IO.py
tangrams/landgrab
20
21548
<filename>Polygon2-2.0.7/Polygon/IO.py # -*- coding: utf-8 -*- """ This module provides functions for reading and writing Polygons in different formats. The following write-methods will accept different argument types for the output. If ofile is None, the method will create and return a StringIO-object. If ofile is...
3.28125
3
strings/reverse_string.py
ahcode0919/python-ds-algorithms
0
21549
from typing import List, Optional def reverse_string(string: str) -> str: return string[::-1] def reverse_string_in_place(string: [str]): index = 0 length = len(string) middle = length / 2 while index < middle: string[index], string[length - 1 - index] = string[length - 1 - index], strin...
4.09375
4
qnarre/prep/tokens/realm.py
quantapix/qnarre.com
0
21550
# Copyright 2022 Quantapix Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable l...
1.46875
1
api/fileupload.py
subhendu01/Audio-FIle-Server
5
21551
import datetime, os, base64 from flask import Flask, jsonify, request, Blueprint from dbstore import dbconf import json from bson import json_util # process kill # lsof -i tcp:3000 file_upload = Blueprint('uploadAPI', __name__) app = Flask(__name__) def song_upload(val): try: # content = request.get_j...
2.609375
3
dna/zfec/zfec/cmdline_zunfec.py
bobbae/examples
0
21552
<filename>dna/zfec/zfec/cmdline_zunfec.py<gh_stars>0 #!/usr/bin/env python # zfec -- a fast C implementation of Reed-Solomon erasure coding with # command-line, C, and Python interfaces from __future__ import print_function import os, sys, argparse from zfec import filefec from zfec import __version__ as libversio...
2.65625
3
bottomline/blweb/migrations/0012_vehicleconfig_color.py
mcm219/BottomLine
0
21553
# Generated by Django 3.2.2 on 2021-07-10 03:16 from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): dependencies = [ ('blweb', '0011_vehiclecolor'), ] operations = [ migrations.AddField( model_name='vehicleconfig',...
1.640625
2
src/acs_3dpsf.py
davidharvey1986/rrg
2
21554
<reponame>davidharvey1986/rrg import numpy as np from . import acs_map_xy as acs_map def acs_3dpsf_basisfunctions( degree, x, y, focus ): # Generate relevant basis functions n_stars=np.max( np.array([len(x),len(y),len(focus)])) basis_function_order=np.zeros((1,3)) # All zeros for k in range(degree[...
2.515625
3
gsf/function_class.py
mtakahiro/gsf
9
21555
import numpy as np import sys import scipy.interpolate as interpolate import asdf from .function import * from .basic_func import Basic class Func: ''' The list of (possible) `Func` attributes is given below: Attributes ---------- ''' def __init__(self, MB, dust_model=0): ''' ...
2.15625
2
loadbalanceRL/utils/exceptions.py
fqzhou/LoadBalanceControl-RL
11
21556
#! /usr/bin/env python3 # -*- coding: utf-8 -*- """ Definition of all Rainman2 exceptions """ __author__ = '<NAME> (<EMAIL>), <NAME>(<EMAIL>)' __date__ = 'Wednesday, February 14th 2018, 11:38:08 am' class FileOpenError(IOError): """ Exception raised when a file couldn't be opened. """ pass class ...
2.796875
3
mundo-1/ex-014.py
guilhermesm28/python-curso-em-video
0
21557
# Escreva um programa que converta uma temperatura digitando em graus Celsius e converta para graus Fahrenheit. print('-' * 100) print('{: ^100}'.format('EXERCÍCIO 014 - CONVERSOR DE TEMPERATURAS')) print('-' * 100) c = float(input('Informe a temperatura em ºC: ')) f = ((9 * c) / 5) + 32 print(f'A temperatura de {c:...
4.125
4
access_apps/controllers/main.py
aaltinisik/access-addons
0
21558
<filename>access_apps/controllers/main.py<gh_stars>0 from odoo import SUPERUSER_ID, http from odoo.http import request from odoo.addons.web_settings_dashboard.controllers.main import WebSettingsDashboard class WebSettingsDashboardCustom(WebSettingsDashboard): @http.route("/web_settings_dashboard/data", type="jso...
1.90625
2
dev/test.py
SmartBadge/SmartBadge
0
21559
<filename>dev/test.py import game as g import time as t def start_game(): r.add_sprite(player1, 0,0) r.add_sprite(player2, 5,0) r.add_sprite(ball, 3,3) r.print() def wait(length_of_time): inital = t.time() x = False while(not(x)): current = t.time() x = (current - inital...
3.609375
4
itermembers.py
hanshuaigithub/pyrogram_project
0
21560
<reponame>hanshuaigithub/pyrogram_project from pyrogram import Client import json api_id = 2763716 api_hash = "d4c2d2e53efe8fbb71f0d64deb84b3da" app = Client("+639277144517", api_id, api_hash) target = "cnsex8" # Target channel/supergroup sigui588 cnsex8 with app: members = app.iter_chat_members(target) pri...
2.453125
2
FisherExactTest/__version__.py
Ae-Mc/Fisher
0
21561
<reponame>Ae-Mc/Fisher<gh_stars>0 __title__ = "FisherExactTest" __version__ = "1.0.1" __author__ = "Ae-Mc" __author_email__ = "<EMAIL>" __description__ = "Two tailed Fisher's exact test wrote in pure Python" __url__ = "https://github.com/Ae-Mc/Fisher" __classifiers__ = [ "Programming Language :: Python :: 3 :: Only...
1.039063
1
mimosa/pylib/mimosa_reader.py
rafelafrance/traiter_mimosa
0
21562
<gh_stars>0 """Parse PDFs about mimosas.""" from tqdm import tqdm from . import mimosa_pipeline from . import sentence_pipeline from .parsed_data import Datum def read(args): with open(args.in_text) as in_file: lines = in_file.readlines() if args.limit: lines = lines[: args.limit] nlp =...
2.609375
3
CxMetrics/calcMetrics.py
Danielhiversen/pyCustusx
0
21563
# -*- coding: utf-8 -*- """ Created on Sat Oct 24 11:39:42 2015 @author: dahoiv """ import numpy as np def loadMetrics(filepath): mr_points=dict() us_points=dict() with open(filepath, 'r') as file : for line in file.readlines(): line = line.translate(None, '"') ...
2.515625
3
twodspec/extern/__init__.py
hypergravity/songcn
0
21564
<reponame>hypergravity/songcn<filename>twodspec/extern/__init__.py # -*- coding: utf-8 -*- __all__ = ['interpolate', 'polynomial', 'SmoothSpline'] from .interpolate import SmoothSpline
1.140625
1
SUAVE/SUAVE-2.5.0/trunk/SUAVE/Methods/Weights/Correlations/Transport/tube.py
Vinicius-Tanigawa/Undergraduate-Research-Project
0
21565
<filename>SUAVE/SUAVE-2.5.0/trunk/SUAVE/Methods/Weights/Correlations/Transport/tube.py ## @ingroup Methods-Weights-Correlations-Tube_Wing # tube.py # # Created: Jan 2014, <NAME> # Modified: Feb 2014, <NAME> # Feb 2016, <NAME> # ---------------------------------------------------------------------- # Impo...
1.953125
2
Dependencies/02_macOS/40_gtk+/x64/lib/gobject-introspection/giscanner/annotationmain.py
bognikol/Eleusis
4
21566
<reponame>bognikol/Eleusis # -*- Mode: Python -*- # GObject-Introspection - a framework for introspecting GObject libraries # Copyright (C) 2010 <NAME> # # This program 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 Foun...
1.625
2
src/tools/json2db.py
chobocho/ChoboMemo2
0
21567
import os import sys import json from manager import dbmanager def loadJson(filename): print("loadJson: " + filename) memoList = [] try: if os.path.isfile(filename): file = open(filename, 'r', encoding="UTF-8") lines = file.readlines() file.close() ...
2.953125
3
Configuration/ProcessModifiers/python/trackingMkFitTobTecStep_cff.py
Purva-Chaudhari/cmssw
852
21568
import FWCore.ParameterSet.Config as cms # This modifier sets replaces the default pattern recognition with mkFit for tobTecStep trackingMkFitTobTecStep = cms.Modifier()
1.09375
1
config/config.py
rossja/Docker-Minecraft-Overviewer
12
21569
# My config.py script for overviewer: worlds["pudel"] = "/tmp/server/world/" worlds["pudel_nether"] = "/tmp/server/world_nether/" texturepath = "/tmp/overviewer/client.jar" processes = 2 outputdir = "/tmp/export/" my_cave = [Base(), EdgeLines(), Cave(only_lit=True), DepthTinting()] my_nowater = [Base(), EdgeLines(), No...
2.390625
2
SurveyManager/survey/models.py
javiervar/SurveyManager
0
21570
<gh_stars>0 from django.db import models # Create your models here. class Encuesta(models.Model): nombre=models.CharField(max_length=150) descripcion=models.TextField() estructura=models.TextField() fecha = models.DateTimeField(auto_now_add=True) def __str__(self): return str(self.nombre) class Pregunta(mo...
2.28125
2
pythainlp/corpus/__init__.py
petetanru/pythainlp
1
21571
# -*- coding: utf-8 -*- from __future__ import absolute_import,unicode_literals from pythainlp.tools import get_path_db,get_path_data from tinydb import TinyDB,Query from future.moves.urllib.request import urlopen from tqdm import tqdm import requests import os import math import requests from nltk.corpus import names ...
2.3125
2
dynamic programming/python/leetcode303_Range_Sum_Query_Immutable.py
wenxinjie/leetcode
0
21572
# Given an integer array nums, find the sum of the elements between indices i and j (i ≤ j), inclusive. # Example: # Given nums = [-2, 0, 3, -5, 2, -1] # sumRange(0, 2) -> 1 # sumRange(2, 5) -> -1 # sumRange(0, 5) -> -3 class NumArray: def __init__(self, nums): """ :type nums: List[int] ...
3.65625
4
py/garage/garage/asyncs/messaging/reqrep.py
clchiou/garage
3
21573
__all__ = [ 'Terminated', 'Unavailable', 'client', 'server', ] import logging import time import curio import nanomsg as nn from garage import asyncs from garage.assertions import ASSERT from garage.asyncs import futures from garage.asyncs import queues LOG = logging.getLogger(__name__) class Te...
2.390625
2
fasm_utils/segbits.py
antmicro/quicklogic-fasm-utils
0
21574
<filename>fasm_utils/segbits.py from collections import namedtuple Bit = namedtuple('Bit', 'x y isset') def parsebit(val: str): """Parses bit notation for .db files to Bit class. Parameters ---------- val: str A string containing .db bit notation, i.e. "!012_23" => (12, 23, False) Retu...
3.234375
3
docs/_api/_build/delira/logging/visdom_backend.py
gedoensmax/delira
1
21575
import tensorboardX from threading import Event from queue import Queue from delira.logging.writer_backend import WriterLoggingBackend class VisdomBackend(WriterLoggingBackend): """ A Visdom Logging backend """ def __init__(self, writer_kwargs: dict = None, abort_event: Event = None...
2.265625
2
node/substitute.py
treverson/coin-buildimage
1
21576
#! /usr/bin/env python3.5 # vim:ts=4:sw=4:ai:et:si:sts=4 import argparse import json import re import os import uuid import shutil import sys import requests filterRe = re.compile(r'(?P<block>^%=(?P<mode>.)?\s+(?P<label>.*?)\s+(?P<value>[^\s\n$]+)(?:\s*.*?)?^(?P<section>.*?)^=%.*?$)', re.M | re.S) subItemRe = re.com...
2.65625
3
pages/page1.py
kalimuthu123/dash-app
0
21577
<reponame>kalimuthu123/dash-app<filename>pages/page1.py import dash_html_components as html from utils import Header def create_layout(app): # Page layouts return html.Div( [ html.Div([Header(app)]), # page 1 # add your UI here, and callbacks go at the bottom of app....
2.28125
2
polrev/offices/admin/office_admin.py
polrev-github/polrev-django
1
21578
<filename>polrev/offices/admin/office_admin.py from django.contrib import admin from offices.models import OfficeType, Office class OfficeTypeAdmin(admin.ModelAdmin): search_fields = ['title'] admin.site.register(OfficeType, OfficeTypeAdmin) ''' class OfficeAdmin(admin.ModelAdmin): search_fields = ['title'] ...
1.5625
2
tests/spec/test_schema_parser.py
tclh123/aio-openapi
19
21579
<filename>tests/spec/test_schema_parser.py<gh_stars>10-100 from dataclasses import dataclass, field from datetime import datetime from enum import Enum from typing import Dict, List import pytest from openapi.data.fields import ( as_field, bool_field, data_field, date_time_field, number_field, ) f...
2.578125
3
models/losses/MSE.py
johnrachwan123/SNIP-it
0
21580
<filename>models/losses/MSE.py import torch from torch import nn from models.GeneralModel import GeneralModel class MSE(GeneralModel): def __init__(self, device, l1_reg=0, lp_reg=0, **kwargs): super(MSE, self).__init__(device, **kwargs) self.loss = nn.MSELoss() def forward(self, output=None...
2.40625
2
svca_limix/limix/core/covar/test/test_categorical.py
DenisSch/svca
65
21581
<filename>svca_limix/limix/core/covar/test/test_categorical.py """LMM testing code""" import unittest import scipy as sp import numpy as np from limix.core.covar import CategoricalCov from limix.utils.check_grad import mcheck_grad class TestCategoricalLowRank(unittest.TestCase): """test class for CategoricalCov co...
2.640625
3
code/stephen/005/005.py
Stephen0910/python-practice-for-game-tester
29
21582
<reponame>Stephen0910/python-practice-for-game-tester<filename>code/stephen/005/005.py #!/usr/bin/env python # -*- coding: utf-8 -*- # @Time : 2019/3/13 0013 下午 3:44 # @Author : Stephen # @Site : # @File : 005.py # @Purpose : # @Software : PyCharm # @Copyright: (c) Stephen 2019 # @Licence : <you...
2.6875
3
sdk/opendp/smartnoise/synthesizers/pytorch/nn/dpctgan.py
Tecnarca/whitenoise-system
1
21583
import numpy as np import torch from torch import optim from torch.nn import functional import torch.nn as nn import torch.utils.data from torch.nn import BatchNorm1d, Dropout, LeakyReLU, Linear, Module, ReLU, Sequential,Sigmoid from torch.nn import functional as F from opendp.smartnoise.synthesizers.base import SDGYMB...
1.96875
2
client/client.py
MasonDiGi/chat_server
0
21584
import socket import threading import time # Create constants HEADER = 64 PORT = 5050 FORMAT = 'utf-8' DC_MSG = "!DISCONNECT" SERVER = "localhost" ADDR = (SERVER, PORT) # Set up client var and connect to the server client = socket.socket(socket.AF_INET, socket.SOCK_STREAM) client.connect(ADDR) erase = ...
3.25
3
src/cogs/ide/dialogs/edit_view.py
osam7a/Jarvide
0
21585
from __future__ import annotations import disnake from disnake.ext import commands from typing import TYPE_CHECKING from src.utils.utils import EmbedFactory, ExitButton, SaveButton, add_lines, get_info if TYPE_CHECKING: from src.utils import File def clear_codeblock(content: str): content.strip("\n") ...
2.21875
2
modules/administrator.py
Gaeta/Delta
1
21586
import discord, sqlite3, asyncio, utils, re from discord.ext import commands from datetime import datetime TIME_REGEX = re.compile("(?:(\d{1,5})\s?(h|hours|hrs|hour|hr|s|seconds|secs|sec|second|m|mins|minutes|minute|min|d|days|day))+?") TIME_DICT = {"h": 3600, "s": 1, "m": 60, "d": 86400} class TimeConverter...
2.71875
3
models/feature_extraction/gcn_resnest.py
hoangtuanvu/rad_chestxray
2
21587
##+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ## Created by: <NAME> ## Email: <EMAIL> ## Copyright (c) 2020 ## ## LICENSE file in the root directory of this source tree ##+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ """ResNet variants""" import os import math i...
1.875
2
nextai_lib/inference.py
jav0927/nextai
0
21588
# AUTOGENERATED! DO NOT EDIT! File to edit: 02_inference.ipynb (unless otherwise specified). __all__ = ['device', 'pad_output', 'get_activ_offsets_mns'] # Cell #from fastai.vision.all import * from fastai import * from typing import * from torch import tensor, Tensor import torch import torchvision # Needed to i...
2.359375
2
code.py
ashweta81/data-wrangling-pandas-code-along-practice
0
21589
<filename>code.py # -------------- import pandas as pd import numpy as np # Read the data using pandas module. data=pd.read_csv(path) # Find the list of unique cities where matches were played print("The unique cities where matches were played are ", data.city.unique()) print('*'*80) # Find the columns which contain...
3.71875
4
Trakttv.bundle/Contents/Libraries/Shared/plugin/scrobbler/handlers/playing.py
disrupted/Trakttv.bundle
1,346
21590
from plugin.scrobbler.core import SessionEngine, SessionHandler @SessionEngine.register class PlayingHandler(SessionHandler): __event__ = 'playing' __src__ = ['create', 'pause', 'stop', 'start'] __dst__ = ['start', 'stop'] @classmethod def process(cls, session, payload): # Handle media c...
2.359375
2
Desafio 46.py
MisaelGuilherme/100_Exercicios_Em_Python
0
21591
<filename>Desafio 46.py<gh_stars>0 print('====== DESAFIO 46 ======') import time for c in range(10,-1,-1): time.sleep(1) print(c)
2.34375
2
samples/features/sql-big-data-cluster/security/encryption-at-rest-external-key-provider/kms_plugin_app/custom_akv.py
aguzev/sql-server-samples
4,474
21592
<reponame>aguzev/sql-server-samples<filename>samples/features/sql-big-data-cluster/security/encryption-at-rest-external-key-provider/kms_plugin_app/custom_akv.py # Placeholder for adding logic specific to application # and backend key store. # import os import json import sys from azure.identity import DefaultAzureCred...
2.328125
2
scss/setup.py
Jawbone/pyScss
0
21593
<gh_stars>0 from distutils.core import setup, Extension setup(name='jawbonePyScss', version='1.1.8', description='jawbonePyScss', ext_modules=[ Extension( '_scss', sources=['src/_scss.c', 'src/block_locator.c', 'src/scanner.c'], libraries=['pcre'], op...
1.117188
1
spanner_orm/tests/query_test.py
MetaOfX/python-spanner-orm
37
21594
<reponame>MetaOfX/python-spanner-orm # python3 # Copyright 2019 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 # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless requi...
2.171875
2
leetcode/1859_sorting_the_sentence.py
jacquerie/leetcode
3
21595
# -*- coding: utf-8 -*- class Solution: def sortSentence(self, s: str) -> str: tokens = s.split() result = [None] * len(tokens) for token in tokens: word, index = token[:-1], int(token[-1]) result[index - 1] = word return ' '.join(result) if __name__ == '...
3.875
4
todoapi/apps.py
Faysa1/Gestion-Tickets-Taches
51
21596
<filename>todoapi/apps.py<gh_stars>10-100 from django.apps import AppConfig class TodoapiConfig(AppConfig): name = 'todoapi'
1.242188
1
src/flagon/backends/redis_backend.py
ashcrow/flagon
18
21597
# The MIT License (MIT) # # Copyright (c) 2014 <NAME> # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to # deal in the Software without restriction, including without limitation the # rights to use, copy, modify, me...
2.09375
2
6. Ordinary Differential Equations/4. a. Higher Order Ordinary Differential Equation using RK4.py
dmNadim/Numerical-Methods
0
21598
from math import sin, cos, pi f = lambda x: 9*pi*cos(x) + 7*sin(x) + 4*x - 5*x*cos(x) # Analytical Solution df = lambda x: -9*pi*sin(x) + 7*cos(x) + 4 - 5*(cos(x)-x*sin(x)) dy = lambda x,y,u: u # 1st Derivative, y' = u du = lambda x,y,u: 4*x + 10*sin(x) - y # 2nd Derivative, u' = 4x+10sin(x)-y x = ...
2.828125
3
scripts/image_navigation.py
habibmuhammadthariq/iq_gnc
0
21599
<reponame>habibmuhammadthariq/iq_gnc<gh_stars>0 #! /usr/bin/env python #ros library #import rospy #import the API #from iq_gnc.py_gnc_functions import * #print the colours #from iq_gnc.PrintColours import * # Importing Point message from package geometry_msgs. #from geometry_msgs.msg import Point #import opencv library...
2.484375
2