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
server/dao/messageDao.py
ZibingZhang/Level-Up
0
12400
<gh_stars>0 from constants import cursor def add_message(player_name, message): cursor.execute( "INSERT INTO levelup.messages (" "SENDER, MESSAGE" ") VALUES (" "%s, %s" ")", (player_name, message) ) def reset(): cursor.execute( "DELETE FROM levelup...
2.59375
3
skeletrack/bbox.py
mpeven/skeletal-tracker
0
12401
import numpy as np import shapely.geometry as geom class Bbox: def __init__(self, name, part_id, depth_image, xyz, box_size, projection): if not isinstance(xyz, np.ndarray): raise ValueError("xyz must be an np.ndarray") self.name = name self.id = part_id self.center = np...
2.40625
2
apps/snippet/admin.py
AniPython/ani
0
12402
<gh_stars>0 from django.contrib import admin from .models import Tag, Article @admin.register(Tag) class TagAdmin(admin.ModelAdmin): list_display = ('name', 'order') list_editable = ('order',) @admin.register(Article) class ArticleAdmin(admin.ModelAdmin): list_display = ['title', 'author'] readonly...
1.890625
2
test/functional/test_framework/script_util.py
TopoX84/newlux
1,389
12403
#!/usr/bin/env python3 # Copyright (c) 2019 The Bitcoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. """Useful Script constants and utils.""" from test_framework.script import CScript # To prevent a "tx-size-sma...
2
2
linux-distro/package/nuxleus/Source/Vendor/Microsoft/IronPython-2.0.1/Lib/Kamaelia/Protocol/Torrent/TorrentIPC.py
mdavid/nuxleus
1
12404
<gh_stars>1-10 #!/usr/bin/env python # # Copyright (C) 2006 British Broadcasting Corporation and Kamaelia Contributors(1) # All Rights Reserved. # # You may only modify and redistribute this under the terms of any of the # following licenses(2): Mozilla Public License, V1.1, GNU General # Public License, V2.0, GNU ...
1.609375
2
srcf/database/schema.py
danielchriscarter/srcf-python
0
12405
from __future__ import print_function, unicode_literals from binascii import unhexlify from enum import Enum import os import pwd import six from sqlalchemy import Column, Integer, String, Boolean, DateTime, Text, Enum as SQLAEnum, Numeric from sqlalchemy import event from sqlalchemy.dialects.postgresql import HSTOR...
2.109375
2
tests/test_grid.py
ascillitoe/pyvista
0
12406
import os import numpy as np import pytest import vtk import pyvista from pyvista import examples from pyvista.plotting import system_supports_plotting beam = pyvista.UnstructuredGrid(examples.hexbeamfile) # create structured grid x = np.arange(-10, 10, 2) y = np.arange(-10, 10, 2) z = np.arange(-10, 10, 2) x, y, z...
2.265625
2
Server/src/quadradiusr_server/server.py
kjarosh/QuadradiusR
0
12407
<reponame>kjarosh/QuadradiusR import asyncio import logging from collections import defaultdict from typing import Optional, List, Dict from aiohttp import web from aiohttp.web_runner import AppRunner, TCPSite from quadradiusr_server.auth import Auth from quadradiusr_server.config import ServerConfig from quadradiusr...
2.09375
2
12_find the output/03_In Python/01_GeeksForGeeks/05_Set Five/problem_4.py
Magdyedwar1996/python-level-one-codes
1
12408
def gfg(x,l = []): for i in range(x): l.append(i*i) print(l) gfg(2) gfg(3,[3,2,1]) gfg(3)
3.40625
3
duck/utils/cal_ints.py
galaxycomputationalchemistry/duck
1
12409
<gh_stars>1-10 import json, pickle, sys, os from parmed.geometry import distance2 from parmed.topologyobjects import Atom import operator import parmed import math def check_same(atom, chain, res_name, res_number, atom_name): if atom.residue.name == res_name: if atom.residue.number == res_number: ...
2.625
3
snakes/help_info.py
japinol7/snakes
12
12410
<filename>snakes/help_info.py<gh_stars>10-100 """Module help_info.""" __author__ = '<NAME> (japinol)' class HelpInfo: """Manages information used for help purposes.""" def print_help_keys(self): print(' F1: \t show a help screen while playing the game' ' t: \t stats on/off\...
2.546875
3
run_minprop_PD.py
kztakemoto/network_propagation
3
12411
import warnings warnings.simplefilter('ignore') import argparse import pickle import numpy as np import pandas as pd import networkx as nx import scipy.sparse as sp from network_propagation_methods import minprop_2 from sklearn.metrics import roc_auc_score, auc import matplotlib.pyplot as plt #### Parameters ########...
2.21875
2
Exercicios em Python/ex080.py
Raphael-Azevedo/Exercicios_Python
0
12412
<gh_stars>0 n = [] i = 0 for c in range(0, 5): n1 = int(input('Digite um valor: ')) if c == 0 or n1 > n[-1]: n.append(n1) print(f'Adicionado na posição {c} da lista...') else: pos = 0 while pos < len(n): if n1 <= n[pos]: n.insert(pos, n1) ...
3.765625
4
rawal_stuff/src/demo.py
rawalkhirodkar/traffic_light_detection
0
12413
<reponame>rawalkhirodkar/traffic_light_detection import cv2 import numpy as np import random import copy import dlib from keras.models import Sequential from keras.optimizers import SGD from keras.datasets import cifar10 from keras.preprocessing.image import ImageDataGenerator from keras.models import Sequential from ...
2.21875
2
kaivy/geometry/line2d.py
team-kaivy/kaivy
0
12414
######################################################################################################################## # # # This file is part of kAIvy ...
2.90625
3
data_loader/MSVD_dataset.py
dendisuhubdy/collaborative-experts
0
12415
<gh_stars>0 import copy from pathlib import Path from typing import Dict, Union, List from collections import defaultdict import numpy as np from typeguard import typechecked from zsvision.zs_utils import memcache, concat_features from utils.util import memory_summary from base.base_dataset import BaseDataset class...
1.929688
2
wagtail/wagtailsearch/forms.py
balkantechnologies/BalkanCMS_core
1
12416
<filename>wagtail/wagtailsearch/forms.py from django import forms from django.forms.models import inlineformset_factory from django.utils.translation import ugettext_lazy as _ from wagtail.wagtailadmin.widgets import AdminPageChooser from wagtail.wagtailsearch import models class QueryForm(forms.Form): query_str...
2.140625
2
app/utils/docs_utils.py
BoostryJP/ibet-Prime
2
12417
<filename>app/utils/docs_utils.py """ Copyright BOOSTRY Co., Ltd. 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.953125
2
scripts/models/arcii.py
mogumogu2333/MatchZoo
0
12418
<gh_stars>0 import os import sys sys.path.insert(0, "../../") import matchzoo as mz import typing import pandas as pd import matchzoo from matchzoo.preprocessors.units.tokenize import Tokenize, WordPieceTokenize from matchzoo.engine.base_preprocessor import load_preprocessor import pickle import utils os.environ["CU...
2.09375
2
mcpyrate/markers.py
Technologicat/mcpyrate
34
12419
# -*- coding: utf-8; -*- """AST markers for internal communication. *Internal* here means they are to be never passed to Python's `compile`; macros may use them to work together. """ __all__ = ["ASTMarker", "get_markers", "delete_markers", "check_no_markers_remaining"] import ast from . import core, utils, walkers ...
2.96875
3
lambda.py
deepanshu-yadav/NSFW-Classifier
13
12420
<filename>lambda.py import boto3 import json import numpy as np import base64, os, boto3, ast, json endpoint = 'myprojectcapstone' def format_response(message, status_code): return { 'statusCode': str(status_code), 'body': json.dumps(message), 'headers': { 'Content-Type': ...
2.28125
2
src/bindings/python/tests/test_ngraph/test_eye.py
si-eun-kim/openvino
2
12421
# Copyright (C) 2018-2022 Intel Corporation # SPDX-License-Identifier: Apache-2.0 import openvino.runtime.opset9 as ov import numpy as np import pytest from tests.runtime import get_runtime from openvino.runtime.utils.types import get_element_type_str from openvino.runtime.utils.types import get_element_type @pytes...
2.09375
2
tests/error/test_format_error.py
GDGSNF/graphql-core
590
12422
<gh_stars>100-1000 from typing import List, Union from pytest import raises from graphql.error import GraphQLError, format_error from graphql.language import Node, Source from graphql.pyutils import Undefined def describe_format_error(): def formats_graphql_error(): source = Source( """ ...
2.234375
2
pymonad/test/test_Maybe.py
bjd2385/pymonad
0
12423
# -------------------------------------------------------- # (c) Copyright 2014 by <NAME>. # Licensed under BSD 3-clause licence. # -------------------------------------------------------- import unittest from pymonad.Maybe import Maybe, Just, First, Last, _Nothing, Nothing from pymonad.Reader import curry from pymona...
2.296875
2
sborl/__init__.py
canonical/sborl
0
12424
# Copyright 2022 Canonical Ltd. # See LICENSE file for licensing details. __version__ = "0.0.8" # flake8: noqa: F401,F402 from . import errors, events, relation, testing from .relation import EndpointWrapper
1.023438
1
sizer.py
riffcc/librarian
0
12425
<filename>sizer.py<gh_stars>0 #!/usr/bin/python3 # Fetch torrent sizes # TODO: Report number of files before we go etc import os from torrentool.api import Torrent from fnmatch import fnmatch root = '/opt/radio/collections' pattern = "*.torrent" alltorrentsize = 0 print("Thanks for using The Librarian.") for path, ...
2.890625
3
i_vis/core/login.py
piechottam/i-vis-core
0
12426
<filename>i_vis/core/login.py """ Flask LoginManager plugin. Import and execute ``login.init_app(app)`` in a factory function to use. """ from typing import Any, Callable, TYPE_CHECKING from functools import wraps from flask import redirect, request, url_for, current_app from flask_login import current_user from fl...
2.203125
2
code/App.py
KasinSparks/Arduino_RGB_Lights
0
12427
from tkinter import * from ModeEnum import Mode import SerialHelper import Views.StaticView import Views.CustomWidgets.Silder from ColorEnum import Color from functools import partial from Views.CommandPanel import CommandPanel from Views.ListItem import ListItem from ProcessControl import ProcessManager, ProcessCo...
2.453125
2
tests/io/product/test_sidd_writing.py
ngageoint/SarPy
0
12428
import os import json import tempfile import shutil import unittest from sarpy.io.complex.sicd import SICDReader from sarpy.io.product.sidd import SIDDReader from sarpy.io.product.sidd_schema import get_schema_path from sarpy.processing.sidd.sidd_product_creation import create_detected_image_sidd, create_dynamic_image...
2.375
2
src/westpa/tools/wipi.py
burntyellow/adelman_ci
0
12429
<reponame>burntyellow/adelman_ci import numpy as np import scipy.sparse as sp from westpa.tools import Plotter # A useful dataclass used as a wrapper for w_ipa to facilitate # ease-of-use in ipython/jupyter notebooks/sessions. # It basically just wraps up numpy arrays and dicts. class WIPIDataset(object): def _...
2.671875
3
src/M5_random_module.py
posguy99/comp660-fall2020
0
12430
import random # use of the random module print(random.random()) # a float value >= 0.0 and < 1.0 print(random.random()*100) # a float value >= 0.0 and < 100.0 # use of the randint method print(random.randint(1, 100)) # an int from 1 to 100 print(random.randint(101, 200)) # an int from 101 to 2...
3.796875
4
lnt/graphics/styles.py
flotwig/lnt
7
12431
from PyInquirer import style_from_dict, Token, prompt, Separator from lnt.graphics.utils import vars_to_string # Mark styles prompt_style = style_from_dict({ Token.Separator: '#6C6C6C', Token.QuestionMark: '#FF9D00 bold', #Token.Selected: '', # default Token.Selected: '#5F819D', Token.Pointer: '#F...
2.9375
3
dvrip.py
jackkum/python-dvr
149
12432
<filename>dvrip.py import os import struct import json from time import sleep import hashlib import threading from socket import socket, AF_INET, SOCK_STREAM, SOCK_DGRAM from datetime import * from re import compile import time import logging class SomethingIsWrongWithCamera(Exception): pass class DVRIPCam(object...
2.3125
2
tests/test_renderer.py
0xflotus/maildown
626
12433
<filename>tests/test_renderer.py import mock from maildown import renderer import mistune import pygments from pygments import lexers from pygments.formatters import html import premailer import jinja2 def test_highlight_renderer(monkeypatch): monkeypatch.setattr(mistune, "escape", mock.MagicMock()) monkeypat...
2.328125
2
practice/practice_4/main.py
Norbert2808/programming
0
12434
from generator import * from iterator import * def nInput(): while True: try: n = int(input("Enter n(size): ")) if n <= 0: print("Input must be a positive integer!") continue except ValueError: print("Not the correct value n!") ...
3.984375
4
setup.py
wgnet/grail
37
12435
<gh_stars>10-100 from setuptools import setup version = '1.0.10' setup( name='grail', version=version, classifiers=[ 'Intended Audience :: Developers', 'Operating System :: OS Independent', 'Programming Language :: Python', 'Programming Language :: Python :: 2.7', ], ...
1.179688
1
tests/test_free.py
qingyunha/boltdb
7
12436
<reponame>qingyunha/boltdb<gh_stars>1-10 import os import unittest import tempfile from boltdb import BoltDB class TestFree(unittest.TestCase): def setUp(self): self.db = BoltDB(tempfile.mktemp()) def tearDown(self): os.unlink(self.db.filename) def test_free(self): with self.db...
2.5
2
xen/xen-4.2.2/tools/xm-test/tests/xapi/01_xapi-vm_basic.py
zhiming-shen/Xen-Blanket-NG
1
12437
#!/usr/bin/python # Copyright (C) International Business Machines Corp., 2006 # Author: <NAME> <<EMAIL>> # Basic VM creation test from XmTestLib import xapi from XmTestLib.XenAPIDomain import XmTestAPIDomain from XmTestLib import * from xen.xend import XendAPIConstants import commands import os try: # XmTestAPI...
2.171875
2
formatter_sql.py
ZSCNetSupportDept/schedule-utils
0
12438
def format_sql(schedule, table): for week, schedule in schedule.items(): print(f"UPDATE {table} SET `block`=0, `week`={week} WHERE `name`='{schedule.leader}';") for block, staffs in schedule.staffs.items(): for staff in staffs: print(f"UPDATE {table} SET `block`={block}, ...
2.9375
3
nlp_fourier.py
neitzke/stokes-numerics
1
12439
<gh_stars>1-10 """Fourier transform non-linear Poisson solver""" # This module is concerned with solving the "non-linear Poisson" # equation # Delta(u) = f(u,z) # on a uniform rectangular mesh, with u = u0 on the boundary. # # We solve the equation by an iterative method, solving an # approximation to the lineariz...
2.453125
2
app/models/fragment.py
saury2013/Memento
0
12440
# -*- coding: utf-8 -*- from datetime import datetime from sqlalchemy.dialects.mysql import LONGTEXT from sqlalchemy.orm import load_only from sqlalchemy import func from flask import abort from markdown import Markdown,markdown from app.models import db,fragment_tags_table from app.models.tag import Tag from app.whoo...
2.140625
2
qatrack/qa/migrations/0001_initial.py
crcrewso/qatrackplus
20
12441
<reponame>crcrewso/qatrackplus # -*- coding: utf-8 -*- from django.db import migrations, models import django.utils.timezone import django.db.models.deletion from django.conf import settings class Migration(migrations.Migration): dependencies = [ ('contenttypes', '0002_remove_content_type_name'), ...
1.9375
2
cloudygram_api_server/models/telethon_model.py
Maverick1983/cloudygram-api-server
2
12442
from .constants import SUCCESS_KEY, MESSAGE_KEY, DATA_KEY from cloudygram_api_server.scripts import CGMessage from typing import List class TtModels: @staticmethod def sing_in_failure(message) -> dict: return { SUCCESS_KEY : False, MESSAGE_KEY : message } @staticme...
2.109375
2
source1/bsp/entities/portal2_entity_handlers.py
tltneon/SourceIO
199
12443
import math from mathutils import Euler import bpy from .portal2_entity_classes import * from .portal_entity_handlers import PortalEntityHandler local_entity_lookup_table = PortalEntityHandler.entity_lookup_table.copy() local_entity_lookup_table.update(entity_class_handle) class Portal2EntityHandler(PortalEntityHan...
2.03125
2
michelanglo_api/ss_parser.py
matteoferla/MichelaNGLo-api
1
12444
from collections import namedtuple class SSParser: """ Create a SS block from PDB data. Written to be agnostic of PDB parser, but for now only has PyMOL. .. code-block:: python import pymol2 with pymol2.PyMOL() as pymol: pymol.cmd.load('model.pdb', 'prot') ss = ...
3.078125
3
Net640/apps/user_posts/mixin.py
86Ilya/net640kb
1
12445
from django.urls import reverse from Net640.settings import FRONTEND_DATE_FORMAT class AsDictMessageMixin: """ Mixin for representing user messages(post, comments) as dictionaries """ def as_dict(self, executor): return {'content': self.content, 'user_has_like': self.has_like(...
2.34375
2
squids/tfrecords/maker.py
mmgalushka/squids
0
12446
"""A module for converting a data source to TFRecords.""" import os import json import copy import csv from pathlib import Path from shutil import rmtree import PIL.Image as Image import tensorflow as tf from tqdm import tqdm from .feature import items_to_features from .errors import DirNotFoundError, InvalidDataset...
2.84375
3
edexOsgi/com.raytheon.edex.plugin.gfe/utility/cave_static/user/GFETEST/gfe/userPython/smartTools/ExUtil1.py
srcarter3/awips2
0
12447
## # This software was developed and / or modified by Raytheon Company, # pursuant to Contract DG133W-05-CQ-1067 with the US Government. # # U.S. EXPORT CONTROLLED TECHNICAL DATA # This software product contains export-restricted data whose # export/transfer/disclosure is restricted by U.S. law. Dissemination # to non...
1.8125
2
venv/KryptoSkattScript/mining_income.py
odgaard/KryptoSkatt
0
12448
<reponame>odgaard/KryptoSkatt import pathlib import datetime path = 'c:/Users/Jacob/PycharmProjects/KryptoSkatt/Data/' trans_in = list() trans_out = list() bitcoin_dict = dict() ethereum_dict = dict() USD_NOK_dict = dict() def unix_time_to_date(timestamp): return datetime.datetime.fromtimestamp(int(timestamp)).s...
2.8125
3
SymBOP_Analysis/ql_global.py
duttm/Octahedra_Nanoparticle_Project
0
12449
import numpy as np import scipy.special as ss import pathlib from Particle import Particle def ql_global(l, particles): # Keep only particles that have neighbors (this was changed 5/23/2020) particles = [i for i in particles if len(Particle.data[i].neighs)>0] neigh_total = sum([len(Particle.data[i].neig...
2.125
2
mycelium/__init__.py
suet-lee/mycelium
6
12450
from .switch import EKFSwitch, RelaySwitch, InitialModeSwitch from .camera_t265 import CameraT265 from .camera_d435 import CameraD435
1.046875
1
arsenal/sleep/openfaas/sleep-py/handler.py
nropatas/faasbenchmark
0
12451
import os import time import datetime def get_current_epoch(): return int((datetime.datetime.utcnow() - datetime.datetime(1970, 1, 1)).total_seconds() * 1000) def get_sleep_parameter(event): user_input = str(event.query["sleep"]) if not user_input or not user_input.isdigit() or int(user_input) < 0: ...
2.796875
3
lib/vapi_cli/users.py
nogayama/vision-tools
15
12452
<reponame>nogayama/vision-tools<filename>lib/vapi_cli/users.py #!/usr/bin/env python3 # IBM_PROLOG_BEGIN_TAG # # Copyright 2019,2020 IBM International Business Machines Corp. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You m...
1.992188
2
smile_recognition.py
audreymychan/djsmile
5
12453
# This script loads the pre-trained scaler and models and contains the # predict_smile() function to take in an image and return smile predictions import joblib from tensorflow.keras.models import load_model from tensorflow.keras.preprocessing.image import img_to_array, array_to_img from PIL import Image import numpy ...
3.21875
3
comicstreamerlib/gui_qt.py
rlugojr/ComicStreamer
169
12454
import sys import webbrowser import os from comicstreamerlib.folders import AppFolders from PyQt4 import QtGui,QtCore class SystemTrayIcon(QtGui.QSystemTrayIcon): def __init__(self, icon, app): QtGui.QSystemTrayIcon.__init__(self, icon, None) self.app = app self.menu = QtGui.QMenu(None) ...
2.28125
2
laserchicken/io/las_handler.py
eEcoLiDAR/eEcoLiDAR
0
12455
""" IO Handler for LAS (and compressed LAZ) file format """ import laspy import numpy as np from laserchicken import keys from laserchicken.io.base_io_handler import IOHandler from laserchicken.io.utils import convert_to_short_type, select_valid_attributes DEFAULT_LAS_ATTRIBUTES = { 'x', 'y', 'z', 'i...
2.515625
3
prob.py
Y1fanHE/po_with_moead-levy
7
12456
<filename>prob.py import numpy as np import pandas as pd def read_file(prob_num): df = pd.read_csv("dat/port" + str(prob_num) + ".txt", header=None, delimiter="\s+", names=range(3)) # info on assets n = int(df[0][0]) # number of assets r = df[1: (n + 1)][0].values.reshape(n, 1) # mean of returns s...
2.828125
3
nmr/testing_PyBMRB.py
jameshtwose/han_jms_collabs
0
12457
<reponame>jameshtwose/han_jms_collabs from pybmrb import Spectra, Histogram import plotly.io as pio pio.renderers.default = "browser" peak_list=Spectra.n15hsqc(bmrb_ids=15060, legend='residue') peak_list=Spectra.c13hsqc(bmrb_ids=15060, legend='residue') peak_list=Spectra.tocsy(bmrb_ids=15060, legend='residue')
1.945313
2
parser.py
sberczuk/powerschool-reporter
1
12458
<reponame>sberczuk/powerschool-reporter #!/usr/bin/env python3 import io import xml.etree.ElementTree as ET import argparse ns = {'ns1': 'http://www.sifinfo.org/infrastructure/2.x', 'ns2': 'http://stumo.transcriptcenter.com'} class StudentInfo: def __init__(self, first_name, middle_name, last_name, ): ...
3.328125
3
eunite/eunite_data.py
jiasudemotuohe/deep_learning
0
12459
<filename>eunite/eunite_data.py # -*- coding: utf-8 -*- # @Time : 2020-04-11 12:34 # @Author : speeding_moto import numpy as np import pandas as pd from matplotlib import pyplot as plt EUNITE_PATH = "dataset/eunite.xlsx" PARSE_TABLE_NAME = "mainData" def load_eunite_data(): """ return the generated loa...
3.40625
3
tests/test_fibsem.py
DeMarcoLab/piescope
4
12460
<filename>tests/test_fibsem.py import numpy as np import pytest from piescope.data.mocktypes import MockAdornedImage import piescope.fibsem autoscript = pytest.importorskip( "autoscript_sdb_microscope_client", reason="Autoscript is not available." ) try: from autoscript_sdb_microscope_client import SdbMicros...
1.96875
2
newnew.py
jennycs005/Skyscraper-App
0
12461
<filename>newnew.py import streamlit as st import pandas as pd import matplotlib.pyplot as plt import csv import numpy as np import pydeck as pdk from PIL import Image def scatterplot(): skyscrapers_data = pd.read_csv("Skyscrapers2021.csv") completion_year_List = [] meters_List = [] for row...
3.796875
4
cifar_train.py
usumfabricae/sagemaker-multi-model-endpoint-tensorflow-computer-vision
4
12462
from tensorflow.keras.layers import Conv2D, MaxPooling2D, Flatten, Dense, Dropout, BatchNormalization from tensorflow.keras.preprocessing.image import ImageDataGenerator from tensorflow.keras.callbacks import ModelCheckpoint from tensorflow.keras.models import Sequential from tensorflow.keras.models import load_model ...
2.546875
3
corehq/form_processor/migrations/0049_case_attachment_props.py
kkrampa/commcare-hq
1
12463
<filename>corehq/form_processor/migrations/0049_case_attachment_props.py # -*- coding: utf-8 -*- from __future__ import unicode_literals from __future__ import absolute_import from django.db import models, migrations import jsonfield.fields class Migration(migrations.Migration): dependencies = [ ('form_...
1.75
2
src/utils/es_async.py
karawallace/mygene
0
12464
<gh_stars>0 import re import json import tornado.web import tornado.httpclient tornado.httpclient.AsyncHTTPClient.configure("tornado.curl_httpclient.CurlAsyncHTTPClient") import tornadoes from utils.es import (ESQuery, ESQueryBuilder, MGQueryError, ElasticSearchException, E...
2.34375
2
processviz/test.py
jurgendn/processviz
0
12465
""" Thư viện này viết ra phục vụ cho môn học `Các mô hình ngẫu nhiên và ứng dụng` Sử dụng các thư viện `networkx, pandas, numpy, matplotlib` """ import networkx as nx import numpy as np import matplotlib.pyplot as plt from matplotlib.image import imread import pandas as pd def _gcd(a, b): if a == 0: retu...
3.140625
3
src/check_results.py
jagwar/Sentiment-Analysis
0
12466
<filename>src/check_results.py<gh_stars>0 import os import json import numpy as np import torch from torch.utils.data import DataLoader, RandomSampler, TensorDataset, SequentialSampler from transformers import CamembertTokenizer, CamembertForSequenceClassification import pandas as pd from tqdm import tqdm, trange #...
1.898438
2
Pacotes/ex022.py
TonyRio/Python-Exercicios
0
12467
<filename>Pacotes/ex022.py<gh_stars>0 print (19 // 2 ) print( 19%2)
1.078125
1
uscampgrounds/models.py
adamfast/geodjango-uscampgrounds
1
12468
<reponame>adamfast/geodjango-uscampgrounds<filename>uscampgrounds/models.py from django.conf import settings from django.contrib.gis.db import models class Campground(models.Model): campground_code = models.CharField(max_length=64) name = models.CharField(max_length=256) campground_type = models.CharField(...
2.140625
2
blog/users/urls.py
simpleOnly1/blog
0
12469
#进行users 子应用的视图路由 from django.urls import path from users.views import RegisterView, ImageCodeView,SmsCodeView urlpatterns = [ #path的第一个参数:路由 #path的第二个函数:视图函数名 path('register/', RegisterView.as_view(),name='register'), #图片验证码的路由 path('imagecode/',ImageCodeView.as_view(),name='imagecode'), #短信...
1.703125
2
src/config/fabric-ansible/ansible-playbooks/filter_plugins/import_lldp_info.py
EWERK-DIGITAL/tf-controller
0
12470
#!/usr/bin/python from builtins import object from builtins import str import sys import traceback sys.path.append("/opt/contrail/fabric_ansible_playbooks/module_utils") # noqa from filter_utils import _task_done, _task_error_log, _task_log, FilterLog from job_manager.job_utils import JobVncApi class FilterModule...
1.96875
2
src/shared/_menu.py
MarcSkovMadsen/awesome-panel-starter
5
12471
"""Provides the MENU html string which is appended to all templates Please note that the MENU only works in [Fast](https://www.fast.design/) based templates. If you need some sort of custom MENU html string feel free to customize this code. """ from awesome_panel_extensions.frameworks.fast.fast_menu import to_menu f...
1.789063
2
prediction-api/app.py
BrokenImage/raptor-api
0
12472
<filename>prediction-api/app.py import os import boto3 import numpy as np import tensorflow as tf from flask import Flask from dotenv import load_dotenv from pymongo import MongoClient from keras.models import load_model from sklearn.preprocessing import LabelEncoder from werkzeug.datastructures import FileStorage from...
2.03125
2
misc/fill_blanks.py
netotz/codecamp
0
12473
<reponame>netotz/codecamp # Given an array containing None values fill in the None values with most recent # non None value in the array from random import random def generate_sample(n): rand = 0.9 while n: yield int(rand * 10) if rand % 1 > 1 / 3 else None rand = random() n -= 1 def...
3.84375
4
beast/tests/helpers.py
marthaboyer/beast
0
12474
<gh_stars>0 # useful functions for BEAST tests # put here instead of having in every tests import os.path import numpy as np import h5py from astropy.io import fits from astropy.utils.data import download_file __all__ = ['download_rename', 'compare_tables', 'compare_fits', 'compare_hdf5'] def download_r...
2.578125
3
sdk/storage/azure-storage-blob/azure/storage/blob/_generated/aio/operations/_page_blob_operations.py
jalauzon-msft/azure-sdk-for-python
1
12475
<filename>sdk/storage/azure-storage-blob/azure/storage/blob/_generated/aio/operations/_page_blob_operations.py # pylint: disable=too-many-lines # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT...
1.640625
2
Win_Source/ESP_Autostart.py
maschhoff/ESP32-433Mhz-Receiver-and-Tools
3
12476
# <NAME> <EMAIL> # The MIT License (MIT) # # Copyright (c) 2020 # # # 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...
2.46875
2
app/core/apps.py
KarimTayie/djangoadmin-test
0
12477
<reponame>KarimTayie/djangoadmin-test from django.apps import AppConfig from django.contrib.admin.apps import AdminConfig class CoreConfig(AppConfig): name = "core" class AppAdminConfig(AdminConfig): default_site = "core.admin.AppAdmin"
1.507813
2
spike/compiler/Node.py
spikeio/lang
1
12478
class Node(object): # XXX: legacy code support kind = property(lambda self: self.__class__) def _iterChildren(self): for name in self.childAttrNames: yield (name, getattr(self, name)) return children = property(_iterChildren) def dump(self, stream, indent=0): ...
2.875
3
download_cifar100_teacher.py
valeoai/QuEST
3
12479
import os import urllib.request os.makedirs('saved_models', exist_ok=True) model_path = 'http://shape2prog.csail.mit.edu/repo/wrn_40_2_vanilla/ckpt_epoch_240.pth' model_dir = 'saved_models/wrn_40_2_vanilla' os.makedirs(model_dir, exist_ok=True) urllib.request.urlretrieve(model_path, os.path.join(model_dir, mo...
2.828125
3
aliyunsdkcore/__init__.py
gikoluo/aliyun-python-sdk-core
0
12480
<gh_stars>0 __author__ = '<NAME>' __version__ = '2.3.3'
1.0625
1
leaderboard/scenarios/background_activity.py
casper-auto/leaderboard
68
12481
<filename>leaderboard/scenarios/background_activity.py #!/usr/bin/env python # # This work is licensed under the terms of the MIT license. # For a copy, see <https://opensource.org/licenses/MIT>. """ Scenario spawning elements to make the town dynamic and interesting """ import math from collections import OrderedDi...
2.734375
3
Python/Interfacing_C_C++_Fortran/F2py/comp_pi_f2py.py
Gjacquenot/training-material
115
12482
#!/usr/bin/env python from argparse import ArgumentParser import sys from comp_pi import compute_pi def main(): arg_parser = ArgumentParser(description='compute pi using Fortran ' 'function') arg_parser.add_argument('n', default=1000, nargs='?', hel...
3.078125
3
test/lazy/test_cat_lazy_tensor.py
Mehdishishehbor/gpytorch
0
12483
#!/usr/bin/env python3 import unittest import torch from Lgpytorch.lazy import CatLazyTensor, NonLazyTensor from Lgpytorch.test.lazy_tensor_test_case import LazyTensorTestCase class TestCatLazyTensor(LazyTensorTestCase, unittest.TestCase): seed = 1 def create_lazy_tensor(self): root = torch.randn(...
2.328125
2
dbSchema.py
zikasak/ReadOnlyBot
1
12484
<filename>dbSchema.py import datetime from sqlalchemy import Column, Integer, Boolean, ForeignKey, String, DateTime, UniqueConstraint, ForeignKeyConstraint from sqlalchemy.orm import relationship from dbConfig import Base, engine class GroupStatus(Base): __tablename__ = "groupstatus" id = Column(Integer, pri...
2.59375
3
dqn/dqn_noisy_networks/model.py
AgentMaker/Paddle-RLBooks
127
12485
<filename>dqn/dqn_noisy_networks/model.py import paddle import paddle.nn as nn import paddle.nn.functional as F from paddle.nn.initializer import Assign import math class NoisyLinear(nn.Linear): def __init__(self, in_features, out_features, sigma_zero=0.4, bias=True): super(NoisyLinear, self).__init__(in_f...
2.46875
2
players/__init__.py
lejbron/arkenstone
0
12486
<filename>players/__init__.py<gh_stars>0 default_app_config = 'players.apps.PlayersConfig'
1.242188
1
forte/utils/utils_io.py
swapnull7/forte
2
12487
<filename>forte/utils/utils_io.py # Copyright 2019 The Forte 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 ...
2.09375
2
src/AFN.py
mbampi/LinguagensRegulares
0
12488
import re from AFD import AFD class AFN: def __init__(self, nome=None, estados=[], simbolos=[], estado_inicial=None, estados_finais=[], funcoes_programa={}): self.nome = nome self.estados = estados self.simbolos = simbolos self.estado_inicial = estado_inicial self.estados...
3
3
cs_tools/tools/_searchable-dependencies/app.py
thoughtspot/cs_tools
1
12489
from typing import List, Dict import pathlib import shutil import enum from typer import Option as O_ import typer from cs_tools.helpers.cli_ux import console, frontend, CSToolsGroup, CSToolsCommand from cs_tools.util.datetime import to_datetime from cs_tools.tools.common import run_tql_command, run_tql_script, tsloa...
2.09375
2
bots/philBots.py
phyxl/GameOfPureStrategy
0
12490
#!/usr/bin/python import math import random from utils.log import log from bots.simpleBots import BasicBot def get_Chosen(num_cards, desired_score): chosen = list(range(1,num_cards+1)) last_removed = 0 while sum(chosen) > desired_score: #remove a random element last_removed = random.randint(0,len(chosen)-1) ...
3.484375
3
tests/ws/TestWebsocketRegisterAgent.py
sinri/nehushtan
0
12491
import uuid from typing import Dict, List from nehushtan.ws.NehushtanWebsocketConnectionEntity import NehushtanWebsocketConnectionEntity class TestWebsocketRegisterAgent: def __init__(self): self.__map: Dict[str, NehushtanWebsocketConnectionEntity] = {} self.agent_identity = str(uuid.uuid4()) ...
2.578125
3
decorator_pattern/starbuzz/condiment.py
garyeechung/design-pattern-practice
2
12492
from .interface import Beverage, CondimentDecorator class Mocha(CondimentDecorator): def __init__(self, beverage: Beverage): super().__init__(beverage) self._cost = 0.2 class Whip(CondimentDecorator): def __init__(self, beverage: Beverage): super().__init__(beverage) self._...
3.125
3
src/geo_testing/test_scripts/psgs_big.py
hpgl/hpgl
70
12493
# # # Copyright 2009 HPGL Team # # This file is part of HPGL (High Perfomance Geostatistics Library). # # HPGL 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 of the License. # # HPGL is ...
1.65625
2
app/src/constants.py
hubacekjirka/dailyPhotoTwitterBot
1
12494
<filename>app/src/constants.py<gh_stars>1-10 friendly_camera_mapping = { "GM1913": "Oneplus 7 Pro", "FC3170": "Mavic Air 2", # An analogue scanner in FilmNeverDie "SP500": "Canon AE-1 Program" }
1.234375
1
refined/refinement_types.py
espetro/refined
4
12495
<filename>refined/refinement_types.py from typing_extensions import Annotated, TypeGuard from typing import TypeVar, List, Set, Dict from refined.predicates import ( PositivePredicate, NegativePredicate, ValidIntPredicate, ValidFloatPredicate, EmptyPredicate, NonEmptyPredicate, TrimmedPredi...
1.992188
2
setup.py
evamvid/SpotPRIS2
0
12496
<reponame>evamvid/SpotPRIS2 from setuptools import setup with open("README.md", "r") as f: long_description = f.read() setup(name="SpotPRIS2", version='0.3.1', author="<NAME>", author_email="<EMAIL>", url="https://github.com/freundTech/SpotPRIS2", description="MPRIS2 interface for Sp...
1.53125
2
partycipe/migrations/0001_initial.py
spexxsoldier51/PartyCipe
0
12497
# Generated by Django 4.0.3 on 2022-04-02 17:32 from django.conf import settings from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): initial = True dependencies = [ migrations.swappable_dependency(settings.AUTH_USER_MODEL), ...
1.742188
2
raster_statistic.py
Summer0328/DeeplabforRS
3
12498
<gh_stars>1-10 #!/usr/bin/env python # Filename: raster_statistic """ introduction: conduct statistic based on vectos, similar to https://github.com/perrygeo/python-rasterstats, # but allow image tiles (multi-raster). authors: <NAME> email:<EMAIL> add time: 02 March, 2021 """ import os,sys import vector_gp...
2.4375
2
ariadne/old/defutils.py
microns-ariadne/ariadne-pipeline-test-harness
2
12499
# Defutils.py -- Contains parsing functions for definition files. # Produces an organized list of tokens in the file. def parse(filename): f=open(filename, "r") contents=f.read() f.close() # Tokenize the file: #contents=contents.replace('\t', '\n') lines=contents.splitlines() outList=[] ...
3.140625
3