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
simpleblog/blog/views.py
GrayAn/simpleblog
0
27100
<reponame>GrayAn/simpleblog from django.contrib.auth.models import User from django.http import JsonResponse, HttpResponse, HttpResponseForbidden from django.views import generic from .models import Post, Vote class IndexView(generic.ListView): context_object_name = 'posts' model = Post paginate_by = 50 ...
2.015625
2
pyatv/protocols/mrp/protobuf/PlayerClientPropertiesMessage_pb2.py
crxporter/pyatv
0
27101
# -*- coding: utf-8 -*- # Generated by the protocol buffer compiler. DO NOT EDIT! # source: pyatv/protocols/mrp/protobuf/PlayerClientPropertiesMessage.proto """Generated protocol buffer code.""" from google.protobuf import descriptor as _descriptor from google.protobuf import descriptor_pool as _descriptor_pool from g...
1.390625
1
app_challenges_sections_units/migrations/0036_auto_20190619_1903.py
Audiotuete/backend_wagtail_api
0
27102
# Generated by Django 2.0.8 on 2019-06-19 19:03 from django.db import migrations class Migration(migrations.Migration): dependencies = [ ('wagtailimages', '0001_squashed_0021'), ('app_challenges_sections_units', '0035_auto_20190619_1847'), ] operations = [ migrations.RenameModel...
1.632813
2
self_organising_systems/texture_ca/losses.py
google-research/self-organizing-systems
2
27103
from self_organising_systems.texture_ca.config import cfg from self_organising_systems.shared.util import imread import tensorflow as tf import numpy as np style_layers = ['block%d_conv1'%i for i in range(1, 6)] content_layer = 'block4_conv2' class StyleModel: def __init__(self, input_texture_path): vgg = tf....
2.125
2
edflow/hooks/runtime_input.py
rromb/edflow
2
27104
import numpy as np import os import traceback import yaml from edflow.hooks.hook import Hook from edflow.util import walk, retrieve, contains_key from edflow.custom_logging import get_logger class RuntimeInputHook(Hook): """Given a textfile reads that at each step and passes the results to a callback functio...
2.71875
3
tools/launcher.py
agentx-cgn/Hannibal
189
27105
#!/usr/bin/env python # -*- coding: utf-8 -*- ''' https://docs.python.org/2/library/subprocess.html#popen-objects http://stackoverflow.com/questions/1606795/catching-stdout-in-realtime-from-subprocess http://askubuntu.com/questions/458041/find-x-window-name http://stackoverflow.com/questions/9681959/how-can-i-use-xdot...
1.976563
2
wurst/brightway/extract_database.py
kais-siala/wurst
0
27106
<gh_stars>0 from bw2data.database import DatabaseChooser try: from bw2data.backends.peewee import SQLiteBackend, ActivityDataset, ExchangeDataset except ImportError: from bw2data.backends import SQLiteBackend, ActivityDataset, ExchangeDataset from tqdm import tqdm import copy def _list_or_dict(obj): if is...
2.40625
2
ex070.py
raphael-abrantes/exercises-python
0
27107
<filename>ex070.py vTotal = 0 i = 0 vMenorValor = 0 cont = 1 vMenorValorItem = '' while True: vItem = str(input('Insira o nome do produto: ')) vValor = float(input('Valor do produto: R$')) vTotal = vTotal + vValor if vValor >= 1000: i = i + 1 if cont == 1: vMenorValor =...
3.640625
4
sdscli/adapters/hysds/configure.py
sdskit/sdscli
0
27108
""" Configuration for HySDS cluster. """ from __future__ import print_function from __future__ import unicode_literals from __future__ import division from __future__ import absolute_import from builtins import open from builtins import str from future import standard_library standard_library.install_aliases() import...
1.570313
2
robot_control/iiwa_ros-master/iiwa_gazebo/scripts/gazebo_iiwa_keyboard_cmd.py
stanFurrer/Multimodal-solution-for-grasp-stability-prediction
0
27109
<reponame>stanFurrer/Multimodal-solution-for-grasp-stability-prediction<gh_stars>0 #!/usr/bin/env python # # Copyright (C) 2021 Learning Algorithms and Systems Laboratory, EPFL, Switzerland # Authors: # <NAME> (<EMAIL>) # # Website: lasa.epfl.ch # # This file is part of iiwa_gazebo. # # This program is free software:...
1.882813
2
python_code/Quadrotor/ProblemStatement/targetSlowResponse.py
cholazzzb/APF_Swarm_Control_Simulator
2
27110
<reponame>cholazzzb/APF_Swarm_Control_Simulator import matplotlib.pyplot as plt import math import sys sys.path.append('../') from Report import Report from QuadrotorARSim import QuadrotorARSim from Ship import Ship sys.path.append('../') from Agent import Agent from Target import Target from SwarmController import Swa...
2.59375
3
internetarchive/spew-shelf.py
wumpus/visigoth-data
1
27111
<gh_stars>1-10 #!/usr/bin/env python3 import shelve import sys for f in sys.argv[1:]: with shelve.open(f, flag='r') as d: for k in d: print(k,d[k])
2.484375
2
aioblescan/__init__.py
nasa-watchdog/aioblescan-ucsb
2
27112
# from .aioblescan import * from . import plugins __version__ = '0.2.1'
0.9375
1
cajas/users/api/views/validate_partner_withdraw.py
dmontoya1/cajas
0
27113
from django.shortcuts import get_object_or_404 from rest_framework import status from rest_framework.views import APIView from rest_framework.response import Response from cajas.users.models.partner import Partner from cajas.loans.models.loan import Loan, LoanType class ValidatePartnerWithdraw(APIView): def p...
2.0625
2
pi88reader/pi88_to_excel.py
natter1/pi88reader
0
27114
""" todo: check pandas """ from openpyxl import Workbook from openpyxl.styles import Font from pi88reader.pi88_importer import PI88Measurement, SegmentType def main(): filename = '..\\resources\\quasi_static_12000uN.tdm' filename = '..\\resources\\AuSn_Creep\\1000uN 01 LC.tdm' measurement = PI88Measureme...
2.890625
3
caffe_files/caffe_traininglayers.py
excalib/interactive-deep-colorization
1
27115
<filename>caffe_files/caffe_traininglayers.py<gh_stars>1-10 # ************************************** # ***** <NAME> / 2016.08.06 ***** # ************************************** import numpy as np import warnings import os import sklearn.neighbors as nn import caffe from skimage import color import matplotlib.pyplot as p...
2.203125
2
services/python/app/lib/parsers/EmailParser.py
ace-ecosystem/eventsentry
0
27116
<gh_stars>0 import base64 import dateutil.parser import email import hashlib import logging import os import re from dateutil import tz from email.header import decode_header, make_header from urlfinderlib import find_urls from lib import RegexHelpers from lib.config import config from lib.constants import HOME_DIR f...
2.375
2
rb/processings/sentiment/utils_new.py
readerbench/ReaderBench
1
27117
import json import sys # import matplotlib.pyplot as plt import copy import numpy as np import tensorflow as tf from sklearn.model_selection import StratifiedShuffleSplit from sklearn.utils import class_weight from collections import Counter import random from tensorflow.keras.callbacks import Callback from sklearn.met...
2.625
3
trie.py
kawasaki-kento/LOUDS
1
27118
from constructor import ArrayConstructor from measure import MeasureMemory import re import array class Trie(object): def __init__(self, words, unit_scale=8): bit_array, labels = self.create_tree(words) self.rank1 = self.get_rank(1) self.unit_scale = unit_scale self.split_list = B...
3.171875
3
metglyphs/__init__.py
informatics-lab/metglyphs
4
27119
"""A library for converting weather codes to symbols.""" import os.path from io import BytesIO import cairosvg import imageio from .glyphs import WMO_GLYPH_LOOKUP, DEFAULT_GLYPHS from .codes import DATAPOINT_TO_WMO_LOOKUP, DARKSKY_TO_WMO_LOOKUP class GlyphSet(): """A set of glyphs.""" def __init__(self, n...
2.984375
3
showyourwork/exceptions/other.py
katiebreivik/showyourwork
0
27120
<gh_stars>0 from .base import ShowyourworkException class RequestError(ShowyourworkException): def __init__( self, status="", message="An error occurred while accessing a remote server.", ): super().__init__(f"Request error {status}: {message}") class CondaNotFoundError(Showy...
2.578125
3
seq_util/pull_longest_seq_from_img_fa.py
fandemonium/code
2
27121
import sys from Bio import SeqIO import operator # 1. get genome img_oid from the genecart text file # 2. create gene sequence dictionary # 3. add genome img_oid to the gene sequence dictionary # 4. for genes from the same organism, pull the longest sequence out gene_cart = open(sys.argv[1], 'rU') firstline = gene_c...
2.84375
3
chapter_projects/quiz_generator/quiz_generator.py
zspatter/automate-the-boring-stuff
15
27122
#! /usr/bin/env python3 # randomQuizGenerator.py - Creates quizzes with questions and answers in # random order, along with the answer key import random # The quiz data. Keys are states and values are their capitals. capitals = {'Alabama': 'Montgomery', 'Alaska': 'Juneau', 'Ariz...
3.53125
4
scripts/reactor/autogen_ludiquest2.py
hsienjan/SideQuest-Server
0
27123
# ParentID: 2202002 # Character field ID when accessed: 220020000 # ObjectID: 1000016 # Object Position X: -228 # Object Position Y: -198
0.964844
1
GN.py
Aashutosh-922/News-Notifier
1
27124
<filename>GN.py import feedparser def parseRSS( rss_url ): return feedparser.parse( rss_url ) def getHeadlines(rss_url): headlines = [] feed = parseRSS(rss_url) for newsitem in feed['items']: headlines.append(newsitem['title']) return headlines allhe...
3.3125
3
src/jarvis/jarvis/skills/collection/remember.py
jameswynn/Python-ai-assistant
424
27125
# MIT License # Copyright (c) 2019 <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, merge, publish...
1.8125
2
kubernetes/e2e_test/test_batch.py
pllsxyc/python
2
27126
# -*- coding: utf-8 -*- # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, softw...
1.820313
2
ZZZ/DES/match_bliss.py
ivmfnal/striped
1
27127
from striped.common import Tracer T = Tracer() with T["run"]: with T["imports"]: from striped.job import SinglePointStripedSession as Session import numpy as np from numpy.lib.recfunctions import append_fields impor...
1.75
2
chk.py
benhur98/GazeUI_RH3
0
27128
import numpy as np a=np.load("train-data-{}.npy".format(input())) while 1: print(a[int(input())][1])
2.703125
3
python/orcreader/__init__.py
nqbao/python-orc-reader
15
27129
<filename>python/orcreader/__init__.py from .reader import OrcReader
1.09375
1
materials-downloader.py
goDoCer/imperial-computing-materials-downloader
10
27130
<reponame>goDoCer/imperial-computing-materials-downloader import sys import os import json import subprocess import datetime as dt sys.path.insert(1, './lib') from config import * from webhelpers import * from argsparser import * from getpass import getpass from distutils.dir_util import remove_tree, copy_tree from s...
2.3125
2
PoliCmm/src/parser.py
jutge-org/cpp2many
4
27131
import ply.lex as lex import ply.yacc as yacc import lexer import sys import ast tokens = lexer.tokens precedence = ( ('right', 'ELSE'), ) def p_start (t): '''start : program''' t[0] = t[1] def p_program_01 (t): '''program : program_part''' t[0] = ast.Program(t[1]) def p_program_02 (t): ...
2.484375
2
src/models/backbones/resnet.py
DIVA-DIA/DIVA-DAF
3
27132
""" Model definition adapted from: https://github.com/pytorch/vision/blob/master/torchvision/models/resnet.py """ import math from typing import Optional, List, Union, Type import torch.nn as nn model_urls = { 'resnet18': 'https://download.pytorch.org/models/resnet18-5c106cde.pth', 'resnet34': 'https://downlo...
2.875
3
feature_extraction.py
Tina-Rezaei/malware-detection-based-on-pe-header
1
27133
import os import pefile import time import re import click import subprocess data_directory_list = ['DIRECTORY_ENTRY_DEBUG', 'DIRECTORY_ENTRY_EXPORT', 'DIRECTORY_ENTRY_LOAD_CONFIG', 'DIRECTORY_ENTRY_RESOURCE', 'DIRECTORY_ENTRY_BASERELOC', 'DIRECTORY_ENTRY_TLS'] normal_section_names = ['.text',...
2.34375
2
research/steve/toy_demo.py
jdavidagudelo/tensorflow-models
1
27134
<reponame>jdavidagudelo/tensorflow-models<filename>research/steve/toy_demo.py from __future__ import division from __future__ import print_function from builtins import range from past.utils import old_div # Copyright 2018 The TensorFlow Authors All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (t...
2.03125
2
ldbs.py
Greg-Bernard/EloquaDataLoader
11
27135
<reponame>Greg-Bernard/EloquaDataLoader #!/usr/bin/python # ElqBulk scheduler by <NAME> import schedule import time from ElqBulk import ElqBulk from ElqRest import ElqRest import TableNames import geoip from closest_city import CityAppend def initialise_database(filename='EloquaDB.db'): """ Initialise entire...
2.671875
3
test/FileTest.py
ytyaru/Python.File.Dir.Stat.20180402093000
0
27136
<reponame>ytyaru/Python.File.Dir.Stat.20180402093000<filename>test/FileTest.py import sys, os, os.path, pathlib print(pathlib.Path(__file__).parent.parent / 'src') sys.path.append(str(pathlib.Path(__file__).parent.parent / 'src')) from File import File from Directory import Directory import unittest import time, dateti...
2.9375
3
cogs/StatCollector.py
galaxyAbstractor/rvnBot
0
27137
<reponame>galaxyAbstractor/rvnBot<gh_stars>0 from discord import TextChannel from discord.ext import commands from stats import StatService from users import UserService class StatCollector(commands.Cog): def __init__(self, bot): self.bot = bot self.stats = StatService(bot.pool) self.users...
2.46875
2
dredis/gc.py
keang/dredis
53
27138
import threading import time from dredis.db import NUMBER_OF_REDIS_DATABASES, DB_MANAGER, KEY_CODEC DEFAULT_GC_INTERVAL = 500 # milliseconds DEFAULT_GC_BATCH_SIZE = 10000 # number of storage keys to delete in a batch class KeyGarbageCollector(threading.Thread): def __init__(self, gc_interval=DEFAULT_GC_INTE...
2.609375
3
week08/states_utils.py
thashmadech/is445_spring2022
1
27139
<reponame>thashmadech/is445_spring2022 import numpy as np def get_ids_and_names(states_map): ids = [] state_names = [] state_data_vec = states_map.map_data['objects']['subunits']['geometries'] for i in range(len(state_data_vec)): if state_data_vec[i]['properties'] is not None: state_...
2.625
3
1005.py
TheLurkingCat/TIOJ
1
27140
<filename>1005.py from itertools import combinations from math import gcd, sqrt a = int(input()) while a: s = set() total = 0 coprime = 0 for _ in range(a): s.add(int(input())) for (x, y) in combinations(list(s), 2): total += 1 if gcd(x, y) == 1: coprime += 1 ...
3.515625
4
reloader/__init__.py
gerardroche/AutomaticPackageReloader
30
27141
from .reloader import reload_package, load_dummy
1.148438
1
tests/bugs/core_2361_test.py
reevespaul/firebird-qa
0
27142
<reponame>reevespaul/firebird-qa<filename>tests/bugs/core_2361_test.py #coding:utf-8 # # id: bugs.core_2361 # title: String truncation reading 8859-1 Spanish column using isc_dsql_fetch with UTF-8 connection.. # decription: # tracker_id: CORE-2361 # min_versions: [] # versions: 3.0 # qmid: ...
1.742188
2
lorem/data.py
Ahsoka/python-lorem
21
27143
<filename>lorem/data.py WORDS = ("adipisci aliquam amet consectetur dolor dolore dolorem eius est et" "incidunt ipsum labore magnam modi neque non numquam porro quaerat qui" "quia quisquam sed sit tempora ut velit voluptatem").split()
2.203125
2
motto/readers.py
attakei/jamproject
0
27144
"""Core custom readers for docutils """ from typing import List, Type from docutils import readers from docutils.transforms import Transform from .skill import SkillBase from .transforms import InitializeReportTransform, TokenizeTransform class Reader(readers.Reader): """Basic custom reader class. Includes ...
2.59375
3
flybrainlab/utilities/neurometry.py
FlyBrainLab/FBLClient
3
27145
<reponame>FlyBrainLab/FBLClient import pandas as pd import numpy as np from scipy.spatial.distance import pdist from sklearn.metrics import pairwise_distances import networkx as nx def generate_neuron_stats(_input, scale = 'mum', scale_coefficient = 1., log=False): """Generates statistics for a given neuron. ...
2.5625
3
server/external/youtube-dl/youtube_dl/extractor/promptfile.py
yycc179/urlp
0
27146
# coding: utf-8 from __future__ import unicode_literals import re from .common import InfoExtractor from ..utils import ( determine_ext, ExtractorError, urlencode_postdata, ) class PromptFileIE(InfoExtractor): _VALID_URL = r'https?://(?:www\.)?promptfile\.com/l/(?P<id>[0-9A-Z\-]+)' ...
2.453125
2
bunruija/modules/__init__.py
tma15/bunruija
4
27147
<reponame>tma15/bunruija from .static_embedding import StaticEmbedding
0.941406
1
RPiAntDrv.py
N7IFC/RPi_Antenna_Driver
0
27148
#! /usr/bin/python3 ################################################################## # # Raspberry Pi Antenna Driver (RPiAntDrv.py) # # Python GUI script to control H-Bridge via RPi. # H-Bridge drives single DC motor tuned antenna. # # Name Call Date(s) # Authors: <NAME> N7IFC Mar-May2020 # ###...
2.734375
3
extensions/customer_action.py
time-track-tool/time-track-tool
0
27149
<reponame>time-track-tool/time-track-tool #! /usr/bin/python # Copyright (C) 2006 Dr. <NAME> Open Source Consulting. # Reichergasse 131, A-3411 Weidling. # Web: http://www.runtux.com Email: <EMAIL> # All rights reserved # **************************************************************************** # This program is fre...
1.6875
2
layouts/window_profile.py
TkfleBR/PyManager
0
27150
# -*- coding: utf-8 -*- # Form implementation generated from reading ui file 'window_profile.ui' # # Created by: PyQt5 UI code generator 5.9.2 # # WARNING! All changes made in this file will be lost! from PyQt5 import QtCore, QtGui, QtWidgets from PyQt5.QtWidgets import QMainWindow class Profile(QMainWindow): d...
1.890625
2
tests/test_inheritance_and_pydantic_generation/test_validators_in_generated_pydantic.py
ivangirko/ormar
905
27151
<filename>tests/test_inheritance_and_pydantic_generation/test_validators_in_generated_pydantic.py<gh_stars>100-1000 import enum import databases import pydantic import pytest import sqlalchemy from pydantic import ValidationError import ormar from tests.settings import DATABASE_URL metadata = sqlalchemy.MetaData() ...
2.359375
2
tests/unit/test_searchtools.py
canonical/hotsos
6
27152
import glob import os import tempfile from unittest import mock from . import utils from hotsos.core.config import setup_config, HotSOSConfig from hotsos.core.searchtools import ( FileSearcher, FilterDef, SearchDef, SearchResult, SequenceSearchDef, ) FILTER_TEST_1 = """blah blah ERROR blah blah ...
2.484375
2
setup.py
KimWiese/bqtools
0
27153
from setuptools import setup, find_packages VERSION = '0.5.0' with open('README.md', 'r') as f: LONG_DESCRIPTION = f.read() with open('requirements.txt') as f: DEPENDENCIES = f.read().split('\n') setup( name = 'bqtools', version = VERSION, description = 'Python Tools for BigQuery', long_desc...
1.28125
1
dag_executor/Executor/__init__.py
GennadiiTurutin/dag_executor
0
27154
from .executor import Executor
1.039063
1
tests/create_test_db.py
TargetProcess/duro
4
27155
<gh_stars>1-10 import sqlite3 ddl = """ create table commits ( hash text, processed integer ); create table tables ( table_name text, query text, interval integer, config text, last_created integer, mean real, times_run integer, force integer, started integer, deleted i...
2.453125
2
dti_classification_pytorch.py
fyrdahl/ISMRM2018_Educational_DeepLearning
17
27156
<gh_stars>10-100 #!/usr/bin/env python3 # -*- coding: utf-8 -*- """ DTI classification demo ISMRM 2018 Created in May 2018 for ISMRM educational "How to Jump-Start Your Deep Learning Research" Educational course Deep Learning: Everything You Want to Know, Saturday, June 16th 2018 Joint Annual meeting of ISMRM and ESMR...
2.296875
2
dasem/wikipedia.py
eaksnes/dasem
18
27157
<reponame>eaksnes/dasem #!/usr/bin/env python # -*- coding: utf-8 -*- """Wikipedia interface. Usage: dasem.wikipedia category-graph | count-category-pages dasem.wikipedia count-pages | count-pages-per-user dasem.wikipedia article-link-graph [options] dasem.wikipedia download [options] dasem.wikipedia get-all...
2.625
3
ViceVersus/users/migrations/0001_initial.py
ViceVersusMe/ViceVersus
0
27158
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ] operations = [ migrations.CreateModel( name='UserProfile', fields=[ ('id', models.AutoField(...
1.898438
2
VideoEncoding/Encoding_H264_OverlayImage/encoding-h264-overlayimage.py
IngridAtMicrosoft/media-services-v3-python
0
27159
from datetime import timedelta from dotenv import load_dotenv from azure.identity import DefaultAzureCredential from azure.mgmt.media import AzureMediaServices from azure.storage.blob import BlobServiceClient from azure.mgmt.media.models import ( Asset, Transform, TransformOutput, StandardEncoderPreset, AacAu...
2.421875
2
fixture/project.py
shark-x/py_mantis_traning
0
27160
<gh_stars>0 from model.project import Project import random import string class ProjectHelper: def __init__(self, app): self. app = app def open_project_page(self): wd = self.app.wd if not wd.current_url.endswith("/manage_proj_page.php"): wd.find_element_by_link_text("Mana...
2.4375
2
PropertyBazaar/urls.py
rudolphalmeida/PropertyBazaarAPI
0
27161
<reponame>rudolphalmeida/PropertyBazaarAPI from django.conf.urls import url from PropertyBazaar.views import PropertyList, PropertyDetail, UserDetail, UserList from rest_framework.urlpatterns import format_suffix_patterns urlpatterns = [ url(r'^property/$', PropertyList.as_view(), name='property-list'), url(r...
2.015625
2
cdedup/testsum.py
salotz/boar
2
27162
<gh_stars>1-10 from __future__ import print_function # Copyright 2010 <NAME> # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless requir...
2.71875
3
app/models/forms.py
raimota/Gerador-Validador-CPF_CNPJ
0
27163
<reponame>raimota/Gerador-Validador-CPF_CNPJ<filename>app/models/forms.py from flask_wtf import FlaskForm from wtforms import StringField from wtforms.validators import DataRequired class Campos(FlaskForm): es = StringField('es')
1.765625
2
setup.py
mvandam/CEO
18
27164
<filename>setup.py #!/usr/bin/env python import os import sys import distutils.cmd import distutils.log import setuptools import subprocess from distutils.core import setup import setuptools.command.build_py sys.path.append(os.path.dirname(__file__)+"/python") print(sys.path) class MakeCeoCommand(distutils.cmd.Comma...
2.109375
2
users/tokens.py
maks-nurgazy/diploma-project
0
27165
<reponame>maks-nurgazy/diploma-project from rest_framework_simplejwt.tokens import RefreshToken def get_jwt_tokens_for_user(user, **kwargs): """ Generates a refresh token for the valid user """ refresh = RefreshToken.for_user(user) return str(refresh), str(refresh.access_token)
2.5
2
tests/bitly/*REPL* [python].py
goldsborough/lnk
3
27166
Python 3.5.0 (default, Sep 14 2015, 02:37:27) [GCC 4.2.1 Compatible Apple LLVM 6.1.0 (clang-602.0.53)] on darwin Type "help", "copyright", "credits" or "license" for more information. >>> a = [{'a': 1}, {'b': 2}] >>> sorted(a) Traceback (most recent call last): File "<stdin>", line 1, in <module> TypeError: unorder...
2.9375
3
src/server/server.py
ZePaiva/Secure-Hearts
0
27167
<filename>src/server/server.py # logging import logging import coloredlogs # server import socket import json import sys import traceback # threading from _thread import * # croupier from croupier import Croupier # cryptography from server_crypto import * from utils.server_utils import * from utils.server_utils im...
2.53125
3
alphatwirl/parallel/parallel.py
shane-breeze/AlphaTwirl
0
27168
<gh_stars>0 # <NAME> <<EMAIL>> ##__________________________________________________________________|| class Parallel(object): def __init__(self, progressMonitor, communicationChannel, workingarea=None): self.progressMonitor = progressMonitor self.communicationChannel = communicationChannel ...
2.9375
3
app/events/client/commands/template.py
Hacker-1202/Selfium
14
27169
<reponame>Hacker-1202/Selfium<filename>app/events/client/commands/template.py from app.vars.client import client from app.helpers import Notify, params from app.filesystem import cfg @client.command() async def template(ctx): notify = Notify(ctx=ctx, title='Template File...')
1.625
2
cwf2neo/tests/__init__.py
sintax1/cwf2neo
1
27170
<gh_stars>1-10 import sys # NOQA import os current_path = os.path.dirname(os.path.abspath(__file__)) sys.path.insert(0, current_path + '/../')
1.726563
2
core/setup.py
kdart/pycopia
89
27171
<reponame>kdart/pycopia #!/usr/bin/python2.7 # vim:ts=4:sw=4:softtabstop=4:smarttab:expandtab import sys from setuptools import setup from glob import glob NAME = "pycopia-core" VERSION = "1.0" if sys.platform.startswith("linux"): DATA_FILES = [('/etc/pycopia', glob("etc/*"))] else: DATA_FILES = [] setup...
1.78125
2
datasets_sysu.py
mpeven/ntu_rgb
19
27172
from sysu_dataset import SYSU import numpy as np import scipy import itertools import cv2 import torch from torch.utils.data import Dataset import torchvision.transforms as transforms from config import * vox_size=54 all_tups = np.array(list(itertools.product(range(vox_size), repeat=2))) rot_array = np.arange(vox_...
2.359375
2
CNN.py
psmishra7/CryptocurrencyPrediction
0
27173
import pandas as pd import numpy as numpy from keras.models import Sequential from keras.layers import Dense, Dropout, Activation, Flatten from keras.layers import Conv1D, MaxPooling1D, LeakyReLU, PReLU from keras.utils import np_utils from keras.callbacks import CSVLogger, ModelCheckpoint import h5py import os import ...
2.34375
2
wordcloud.py
jim-spyropoulos/NLP-in-Neswpaper-articles
1
27174
<filename>wordcloud.py import pandas as pd import matplotlib.pyplot as plt from os import path from wordcloud import WordCloud #d = path.dirname(__file__) df=pd.read_csv("train_set.csv",sep="\t") categories=["Business","Film","Football","Politics","Technology"] for category in categories: text="" for index...
3.4375
3
openqemist/tests/problem_decomposition/dmet/test_dmet_orbitals.py
1QB-Information-Technologies/openqemist
35
27175
<reponame>1QB-Information-Technologies/openqemist # Copyright 2019 1QBit # # 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 # # ...
1.96875
2
books/techno/python/programming_python_4_ed_m_lutz/code/chapter_8/13_binding_events/bind.py
ordinary-developer/lin_education
1
27176
from tkinter import * def showPosEvent(event): print('Widget ={} X={} Y={}'.format(event.widget, event.x, event.y)) def showAllEvent(event): print(event) for attr in dir(event): if not attr.startswith('__'): print(attr, '=>', getattr(event, attr)) def onKeyPress(event): ...
2.921875
3
week9/api/migrations/0002_auto_20200324_1713.py
yestemir/web
0
27177
<reponame>yestemir/web # Generated by Django 3.0.4 on 2020-03-24 11:13 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('api', '0001_initial'), ] operations = [ migrations.AddField( model_name='products', name='cat...
1.625
2
Computer Networks Lab/A11TCP/PeertoPeer/pptcpserv.py
prabu-5701/Third_Year_Lab_Assignments
12
27178
''' NAME: <NAME> TE-B ROLL NO: 08 ASSIGNMENT NO: 11 PROBLEM STATEMENT: Write a program using TCP sockets for wired network to implement a. Peer to Peer Chat (server side) ''' import socket import sys sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) sock.bind(('localhost',23000)) sock.listen(1) clisock, (ip,p...
3.359375
3
tutos/institutions/views.py
UVG-Teams/Tutos-System
0
27179
from django.shortcuts import render from rest_framework import viewsets from institutions.models import Institution, Career, Course from institutions.serializers import InstitutionSerializer, CareerSerializer, CourseSerializer from permissions.services import APIPermissionClassFactory class InstitutionViewSet(viewse...
1.90625
2
vendor/guardian/tests/decorators_test.py
AhmadManzoor/jazzpos
5
27180
<reponame>AhmadManzoor/jazzpos from django.test import TestCase from django.contrib.auth.models import User, Group, AnonymousUser from django.http import HttpRequest from django.http import HttpResponse from django.http import HttpResponseForbidden from django.http import HttpResponseRedirect from django.shortcuts impo...
2.125
2
default_colours.py
ARCowie28/SyntheticWeather
11
27181
<filename>default_colours.py<gh_stars>10-100 # Declare default colours for the code which calls this script. # import numpy as np from numpy import array # Deep blue. blue = array((25, 100, 200)) / 255 # Pure f***ing blue. bluest = array((0, 0, 255)) / 255 # Distinguished looking grey. grey = array((0.3, 0....
2.921875
3
reverb/reverb_types.py
tfboyd/reverb
2
27182
# Lint as: python3 # Copyright 2019 DeepMind Technologies Limited. # # 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 ap...
1.796875
2
ed2d/shaders.py
explosiveduck/cubix
1
27183
<filename>ed2d/shaders.py<gh_stars>1-10 from ed2d.opengl import gl, pgl from ed2d import files from ed2d import typeutils from gem import vector class ShaderBase(object): def create(self): self.shader = gl.glCreateShader(self.shaderType) pgl.glShaderSource(self.shader, self.shaderData) gl....
2.46875
2
poky/meta/lib/oeqa/sdk/cases/gcc.py
buildlinux/unityos
1
27184
import os import shutil import unittest from oeqa.core.utils.path import remove_safe from oeqa.sdk.case import OESDKTestCase class GccCompileTest(OESDKTestCase): td_vars = ['MACHINE'] @classmethod def setUpClass(self): files = {'test.c' : self.tc.files_dir, 'test.cpp' : self.tc.files_dir, ...
2.140625
2
backend/api/routes/__init__.py
senavs/todo-list
0
27185
from fastapi import APIRouter from . import auth, index, list, task router = APIRouter() router.include_router(index.router) router.include_router(auth.router, prefix='/auth', tags=['Authenticate']) router.include_router(list.router, prefix='/lists', tags=['Lists']) router.include_router(task.router, prefix='/lists'...
2.03125
2
datasets/mnist_data.py
shijack/vae-system
0
27186
<reponame>shijack/vae-system # Some code was borrowed from https://github.com/petewarden/tensorflow_makefile/blob/master/tensorflow/models/image/mnist/convolutional.py from __future__ import absolute_import from __future__ import division from __future__ import print_function import gzip import os import numpy impor...
2.40625
2
module/server/view/login/routes.py
antkrit/project
0
27187
<gh_stars>0 """Define the route of the login form""" from flask import ( render_template, redirect, url_for, request, current_app, session, flash, ) from flask_login import current_user, login_user, logout_user from module.server import messages from module.server.models.user import User fr...
3.46875
3
true_coders/urls.py
tanvirtareq/clist
1
27188
<reponame>tanvirtareq/clist from django.conf.urls import re_path from true_coders import views app_name = 'coder' urlpatterns = [ re_path(r'^settings/$', views.settings, name='settings'), re_path(r'^settings/(?P<tab>preferences|social|accounts|filters|notifications|lists)/$', views.settings, ...
1.757813
2
inkcut-master/inkcut/device/protocols/debug.py
ilnanny/Inkscape-addons
3
27189
# -*- coding: utf-8 -*- ''' Created on Oct 23, 2015 @author: jrm ''' from inkcut.device.plugin import DeviceProtocol from inkcut.core.utils import async_sleep, log class DebugProtocol(DeviceProtocol): """ A protocol that just logs what is called """ def connection_made(self): log.debug("protocol.conn...
2.53125
3
config/qtile/Managers/LayoutManager.py
dat-adi/Dotfiles
2
27190
<filename>config/qtile/Managers/LayoutManager.py # -*- coding:utf-8 -*- from libqtile import layout def get_layouts(): layout_theme = { "border_width": 2, "margin": 8, "border_focus": "#F0F0F0", "border_normal": "#1D233F", } layouts = [ # layout.Bsp(), # la...
1.734375
2
x.py
douboer/lianghua
0
27191
# -*- encoding: utf8 -*- # version 1.11 import tkinter.messagebox,os from tkinter import * from tkinter.ttk import * from tkinter import Menu import datetime import threading import pickle import time import tushare as ts import pywinauto import pywinauto.clipboard import pywinauto.application NUM_OF_STOCKS = 5 # 自定义...
2.828125
3
torchbnn/functional.py
Harry24k/bayesian-neural-network-pytorch
178
27192
<reponame>Harry24k/bayesian-neural-network-pytorch import math import torch from .modules import * def _kl_loss(mu_0, log_sigma_0, mu_1, log_sigma_1) : """ An method for calculating KL divergence between two Normal distribtuion. Arguments: mu_0 (Float) : mean of normal distribution. log_s...
3.3125
3
tests/settings/test_custom_metrics.py
proknow/proknow-python
2
27193
import pytest import re from proknow import Exceptions def test_create(app, custom_metric_generator): pk = app.pk # Verify returned CustomMetricItem params, custom_metric = custom_metric_generator() assert custom_metric.name == params["name"] assert custom_metric.context == params["context"] ...
2.296875
2
models/script/attention.py
junkunyuan/CSAC
3
27194
import torch from torch import dtype, nn import torch.nn.functional as F class PAM_Module(nn.Module): def __init__(self, num, sizes,mode=None): super(PAM_Module, self).__init__() self.sizes = sizes self.mode = mode for i in range(num): setattr(self, "query" + str(i), ...
2.40625
2
src/bpmn_python/graph/classes/events/start_event_type.py
ToJestKrzysio/ProcessVisualization
0
27195
<gh_stars>0 # coding=utf-8 """ Class used for representing tStartEvent of BPMN 2.0 graph """ import graph.classes.events.catch_event_type as catch_event class StartEvent(catch_event.CatchEvent): """ Class used for representing tStartEvent of BPMN 2.0 graph """ def __init__(self): """ ...
2.3125
2
euler/p001.py
2Cubed/ProjectEuler
1
27196
"""Solution to Project Euler Problem 1 https://projecteuler.net/problem=1 """ NUMBERS = 3, 5 MAXIMUM = 1000 def compute(*numbers, maximum=MAXIMUM): """Compute the sum of the multiples of `numbers` below `maximum`.""" if not numbers: numbers = NUMBERS multiples = tuple(set(range(0, maximum, numb...
3.828125
4
scripts/write_kepler_format.py
0bLondon/VizFinal
0
27197
<filename>scripts/write_kepler_format.py import csv input_file = 'output.csv' output_file = 'kepler.txt' cols_to_remove = [9] cols_to_remove = sorted(cols_to_remove, reverse=True) row_count = 0 with open(input_file, "r") as source: reader = csv.reader(source) with open(output_file, "w", newline='') as result...
3.28125
3
src/python/WMCore/WMBS/MySQL/Locations/ListSites.py
hufnagel/WMCore
1
27198
<reponame>hufnagel/WMCore #!/usr/bin/env python """ _ListSites_ MySQL implementation of Locations.ListSites """ __all__ = [] from WMCore.Database.DBFormatter import DBFormatter import logging class ListSites(DBFormatter): sql = "SELECT site_name FROM wmbs_location" def format(self, results): i...
2.359375
2
accountant.py
MKTSTK/Runover
15
27199
<reponame>MKTSTK/Runover from inside_market import * import pandas as pd import numpy as np import seaborn as sns import matplotlib.pyplot as plt # the accountant class can do neat things like # # 1) Tally up the total pnl of your trade # 2) plot equity curves # 3) other neat stuff down the road, probably class acco...
3.203125
3