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
data extraction/pipeline/other_journals.py
1v4n-poi/SuperalloyDigger
0
12767951
<reponame>1v4n-poi/SuperalloyDigger # -*- coding: utf-8 -*- """ Created on Mon May 18 09:13:02 2020 @author: Weiren """ import os import xlwt from Phrase_parse import PhraseParse from Relation_extraciton_orig import RelationExtraciton from T_pre_processor import TPreProcessor from file_io import File_IO as FI from get...
1.835938
2
course_access_groups/filters.py
appsembler/course-cccess-groups
4
12767952
""" DRF ViewSet filters. """ import django_filters from django.contrib.auth import get_user_model from .openedx_modules import CourseOverview class UserFilter(django_filters.FilterSet): email_exact = django_filters.CharFilter('email', lookup_expr='iexact') group = django_filters.NumberFilter('membership__gr...
2.125
2
rosegameLibraryDev/rg_sprite.py
ConnectingWithCode/cwc2022_SOLUTION
0
12767953
<reponame>ConnectingWithCode/cwc2022_SOLUTION import pygame import rosegame as rg def setup(game): print("Setup stuff") game.my_fighter = rg.Sprite(game, "images/fighter.png", 40, 300) def loop(game): if game.is_key_pressed(pygame.K_UP): game.my_fighter.move(0, -5) if game.is_key_pressed(pyg...
3.09375
3
test.py
dzoladz/mailman3-docker
1
12767954
#!/usr/bin/env python3 import sys from pathlib import Path from build import VARIANTS DOCKER_TEST="""version: '2' services: mailman-core: image: core-{variant} mailman-web: image: web-{variant} environment: - SECRET_KEY=<KEY> """ def test_setup(variant): Path('docker-...
2.1875
2
py/plot_rcdistancecomparison.py
jobovy/apogee-maps
1
12767955
import sys import numpy from scipy import special import statsmodels.api as sm from galpy.util import bovy_plot import define_rcsample def plot_rcdistancecomparison(plotfilename): # Get the sample rcdata= define_rcsample.get_rcsample() # Now plot the differece bovy_plot.bovy_print() levels= special....
2.5
2
snippets/is_equal_as_previous.py
w13b3/do_not_use
0
12767956
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # is_equal_as_previous.py """ is_equal_as_previous is made to be called multiple times is_equal_as_previous saves the previous value and compares it with the current value thus is_equal_as_previous can detect changes in sequences when is_equal_as_previous is called for t...
4.09375
4
vmapp/users/tests.py
codeasap-pl/vmapp
0
12767957
from django.test import TestCase from django.db.utils import IntegrityError from django.core.validators import ValidationError from users.models import User from domains.models import Domain class TestUsers(TestCase): def test_create_invalid(self): with self.assertRaises(IntegrityError): User...
2.5625
3
Util/postprocessing/urca-tools/plot_fconv_slopes.py
sailoridy/MAESTRO
17
12767958
#!/usr/bin/env python """ Given the output of fconv_slopes, plot the thermodynamic gradients corresponding to an initial model. <NAME> """ from __future__ import print_function import numpy as np import matplotlib.pyplot as plt import argparse parser = argparse.ArgumentParser() parser.add_argument('infile', type=str...
2.96875
3
chrome/test/enterprise/e2e/policy/default_search_provider/default_search_provider.py
sarang-apps/darshan_browser
0
12767959
<filename>chrome/test/enterprise/e2e/policy/default_search_provider/default_search_provider.py<gh_stars>0 # Copyright 2019 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. import os from chrome_ent_test.infra.core import en...
2.09375
2
src/jig/gitutils/tests/test_branches.py
Lightslayer/jig
0
12767960
from os import unlink from os.path import join, isfile from contextlib import contextmanager from functools import partial from itertools import chain, combinations from git import Repo, Head, Commit from mock import patch, MagicMock from jig.tests.testcase import JigTestCase from jig.exc import ( GitRevListMissi...
2.265625
2
src/components/crackChecker/Update.py
Naruita/tinyApps
1
12767961
<reponame>Naruita/tinyApps #!/usr/bin/python # -*- coding: utf-8 -*- # Content retrieving modules from urllib.request import urlopen from json import loads # Date and Time implemention tools from datetime import datetime from time import sleep """Updates the program to the latest stage in the API or else, till the A...
3.03125
3
python_end/main_controller.py
divyansh9711/python-socket.io
0
12767962
import obs,parenty,socket_controller,threading def callObs(): obs.main() socket_controller.init_comm_file() t = threading.Thread(target = callObs, args=()) t.start()
2.21875
2
dbaas/maintenance/admin/database_maintenance_task.py
didindinn/database-as-a-service
303
12767963
<reponame>didindinn/database-as-a-service<filename>dbaas/maintenance/admin/database_maintenance_task.py<gh_stars>100-1000 # -*- coding: utf-8 -*- from __future__ import absolute_import, unicode_literals from django.contrib import admin from django.core.urlresolvers import reverse from django.utils.html import format_ht...
1.875
2
env/model/network.py
Shiduo-zh/pybulletSim
0
12767964
<reponame>Shiduo-zh/pybulletSim from tkinter import E from env.model.mlp import * from env.model.conv2d import * from env.model.transformer import * from env.model.utils import* import torch import torch.nn as nn class localTransformer(nn.Module): def __init__(self,prop_size=93,hidden_size=256,output_size=128, ...
2.265625
2
src/conference_stats.py
tjbreshears/VBelo
0
12767965
import csv import pandas as pd import matplotlib.pyplot as plt games = [] with open("outputs/games_output.csv", 'r') as data: for line in csv.DictReader(data): games.append(line) teams = [] with open("inputs/VBelo - teams.csv", 'r') as data: for line in csv.DictReader(data): teams.append(line)...
2.84375
3
src/dandd/__main__.py
Peilonrayz/warhammer
0
12767966
<gh_stars>0 import fractions from typing import Callable import matplotlib.pyplot as plt import mpl_toolkits.mplot3d from dice_stats import Dice, Range, from_results from other import main # Rage # Unarmored Defense # Great Weapon Master # Reckless Attack # It would be cool if this could be changed to something lik...
2.921875
3
components/isceobj/StripmapProc/runCoherence.py
vincentschut/isce2
1,133
12767967
<reponame>vincentschut/isce2 #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ # Copyright 2012 California Institute of Technology. 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. ...
1.171875
1
bot.py
fopina/tgbotplug-plugins
1
12767968
#!/usr/bin/env python # coding=utf-8 import tgbot from plugins.echo import EchoPlugin from plugins.random_choice import RandomPlugin from plugins.google import GooglePlugin from plugins.simsimi import SimsimiPlugin import argparse from requests.packages import urllib3 urllib3.disable_warnings() def main(): args...
2.296875
2
samples/DataScience/pos-tagging-neural-nets-keras/pos_tagging_neural_nets_keras.py
g-guichard/IT-Blog
19
12767969
from __future__ import print_function import random import nltk from nltk.corpus import treebank import numpy as np from sklearn.feature_extraction import DictVectorizer from sklearn.preprocessing import LabelEncoder from sklearn.metrics import classification_report from keras.layers import Dense, Dropout, ...
2.859375
3
Export.py
NicoRicardi/CCParser
0
12767970
import pandas as pd import numpy as np from .QCBase import VarNames class Exporter(object): """ Export class which writes parsed data to a certain format""" valid_formats = ["pdf", "xlsx", "txt", "csv", "dataframe"] def __init__(self, data=None): self.data = data # for later: add pand...
2.90625
3
m/commands/accumulate.py
minersoft/miner
1
12767971
# # Copyright <NAME>, 2012-2014 # import miner_globals import m.common as common from base import * def p_accumulate_coals(p): '''command : | ACCUMULATE''' p[0] = DefaultAccumulateCommand() def p_accumulate_command(p): '''command : ACCUMULATE id_list BY expression''' p[0...
2.46875
2
2016/day10.py
andypymont/adventofcode
0
12767972
""" 2016 Day 10 https://adventofcode.com/2016/day/10 """ from dataclasses import dataclass from typing import Dict, List, Sequence, Tuple import re import aocd # type: ignore re_value = re.compile(r"value (\d+) goes to (\w+) (\d+)") re_robot = re.compile(r"bot (\d+) gives low to (\w+) (\d+) and high to (\w+) (\d+)")...
3.640625
4
test/scorer_t.py
kariminf/MultiNetSum
1
12767973
<reponame>kariminf/MultiNetSum #!/usr/bin/env python # -*- coding: utf-8 -*- # # Copyright 2018 <NAME> <<EMAIL>> # # ---- AUTHORS ---- # 2018 <NAME> <<EMAIL>> # # 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...
2.4375
2
srp/plots.py
jfemiani/srp-boxes
0
12767974
<reponame>jfemiani/srp-boxes import matplotlib.pyplot as plt import pathlib import pickle def plot_rgb(stack): plt.imshow(stack[:3].transpose(1,2,0).clip(0,1)) plt.xlim(0, stack.shape[1]) plt.ylim(0, stack.shape[2]) def plot_lidar(stack, alpha=1): pseudo = stack[4:7] pseudo = pseudo p...
2.328125
2
pydcop/infrastructure/agents.py
rpgoldman/pyDcop
0
12767975
<reponame>rpgoldman/pyDcop<filename>pydcop/infrastructure/agents.py # BSD-3-Clause License # # Copyright 2017 Orange # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # # 1. Redistributions of source code must retain the ...
1.507813
2
server.py
JohnStarich/python-pool-performance
32
12767976
#!/usr/bin/env python3 from gunicorn_server import StandaloneApplication from flask import Flask import multiprocessing app = Flask(__name__) @app.route("/") def ok(): return "OK" if __name__ == "__main__": gunicorn_app = StandaloneApplication(app, options={ 'bind': '127.0.0.1:8080', 'worke...
2.375
2
src/backend/qai_testbed_backend/usecases/testrunner.py
ads-ad-itcenter/qunomon.forked
16
12767977
# Copyright © 2019 National Institute of Advanced Industrial Science and Technology (AIST). All rights reserved. from datetime import datetime, timedelta, timezone from requests import post, get from pathlib import Path import json from injector import singleton import os import shutil from distutils.dir_util import re...
1.78125
2
api/tests/opentrons/protocol_engine/actions/test_action_dispatcher.py
anuwrag/opentrons
235
12767978
<gh_stars>100-1000 """Tests for the protocol engine's ActionDispatcher.""" from decoy import Decoy from opentrons.protocol_engine.actions import ( ActionDispatcher, ActionHandler, PlayAction, ) def test_sink(decoy: Decoy) -> None: """It should send all actions to the sink handler.""" action = Pla...
2.5625
3
e2e_EL_evaluate/utils/num_docs_anno.py
yifding/e2e_EL_evaluate
5
12767979
<gh_stars>1-10 import os import argparse from e2e_EL_evaluate.utils.gen_anno_from_xml import gen_anno_from_xml def main(args): for dataset in args.datasets: print('dataset: ', dataset) doc_name2txt, doc_name2anno = gen_anno_from_xml(args.input_dir, dataset) print('num_of_docs_from_txt: ', ...
2.890625
3
core/scansf.py
faslan1234/socialfish
2,970
12767980
import nmap import requests def nScan(ip): nm = nmap.PortScanner() nm.scan(ip, arguments="-F") for host in nm.all_hosts(): ports = [] protocols = [] states = [] for proto in nm[host].all_protocols(): protocols.append(proto) lport = nm[host][proto].key...
3.078125
3
app/views.py
ykatzir/qapp-gsuite-react
0
12767981
from flask import render_template from app import app @app.route('/') @app.route('/index') def index(): return render_template('config.html') @app.route('/dashboard') def dashboard(): return render_template('dashboard.html')
2.140625
2
warehouse/classifiers/models.py
fairhopeweb/warehouse
3,103
12767982
# Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the Li...
1.921875
2
flox/visualize.py
Illviljan/flox
0
12767983
<filename>flox/visualize.py import random from itertools import product import numpy as np import pandas as pd def draw_mesh( nrow, ncol, *, draw_line_at=None, nspaces=0, space_at=0, pxin=0.3, counter=None, colors=None, randomize=True, x0=0, append=False, ): impor...
2.3125
2
pactman/__init__.py
RobbieClarken/pactman
0
12767984
"""Python methods for interactive with a Pact Mock Service.""" from .mock.consumer import Consumer from .mock.matchers import EachLike, Like, SomethingLike, Term from .mock.pact import Pact from .mock.provider import Provider __all__ = ('Consumer', 'EachLike', 'Like', 'Pact', 'Provider', 'SomethingLike', 'T...
1.945313
2
main/online/permissions.py
MahanBi/Back-End
1
12767985
<reponame>MahanBi/Back-End from rest_framework import permissions
1
1
soda/core/soda/sodacl/antlr/SodaCLAntlrLexer.py
sodadata/soda-core
4
12767986
# Generated from /Users/tom/Code/soda-core/soda/core/soda/sodacl/antlr/SodaCLAntlr.g4 by ANTLR 4.9.3 from antlr4 import * from io import StringIO import sys if sys.version_info[1] > 5: from typing import TextIO else: from typing.io import TextIO def serializedATN(): with StringIO() as buf: buf.wr...
1.367188
1
baron.py
Alexandra-Baron/belhard_52
0
12767987
<filename>baron.py print('baron') #surname
1.257813
1
networkapi/infrastructure/xml_utils.py
vinicius-marinho/GloboNetworkAPI
73
12767988
# -*- coding: utf-8 -*- # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. # The ASF licenses this file to You under the Apache License, Version 2.0 # (the "Lic...
2.09375
2
testing/library/tools/initPromLibrary.py
GoogleCloudPlatform/datanucleus-appengine
7
12767989
<filename>testing/library/tools/initPromLibrary.py #!/usr/bin/python2.4 import os import sys import getopt import xml.dom.minidom # Starts parsing the XML file containing the book data entries # default_local = "http://localhost:8080/library" default_corp = "http://gptestshop.prom.corp.google.com/library" default_uri...
3.109375
3
run_forever.py
kuenishi/machi-py
1
12767990
<reponame>kuenishi/machi-py import argparse import binascii import random import time import numpy from machi import MachiStore class Timer: def __init__(self, stats): self.stats = stats def __enter__(self): self.b = time.time() def __exit__(self, exc_type, exc_value, traceback): ...
2.75
3
mtp_cashbook/misc_views.py
uk-gov-mirror/ministryofjustice.money-to-prisoners-cashbook
4
12767991
<filename>mtp_cashbook/misc_views.py from django import forms from django.conf import settings from django.contrib import messages from django.contrib.auth.decorators import login_required from django.shortcuts import redirect from django.urls import reverse_lazy from django.utils.decorators import method_decorator fro...
2.09375
2
geomloss/examples/sinkhorn_multiscale/plot_transport_blur.py
ismedina/geomloss
0
12767992
""" 4) Sinkhorn vs. blurred Wasserstein distances ========================================================== Sinkhorn divergences rely on a simple idea: by **blurring** the transport plan through the addition of an entropic penalty, we can reduce the effective dimensionality of the transportation problem and compute *...
2.421875
2
tests/app.py
vortec/hug_sentry
5
12767993
<reponame>vortec/hug_sentry import hug @hug.get('/fail') def fail(request, amount: hug.types.number): amount / 0 @hug.get('/routing_fail/{amount}') def routing_fail(request, amount: hug.types.number): raise Exception("Oh no!")
1.875
2
test/test.py
taoyizhi68/py-data-augmentation
16
12767994
<reponame>taoyizhi68/py-data-augmentation<gh_stars>10-100 import numpy as np import matplotlib.pyplot as plt import skimage as skimage from skimage import data, io, filters, transform from pydaag import pydaag plt.rcParams['figure.figsize'] = (10, 10) images = np.zeros((5, 256, 256, 3)) for i in range(5): filename...
2.890625
3
plugins/hello.py
Ruthenic/tesm
0
12767995
def hw(addr,vaddr,inst): print("Hello, world!") return addr,vaddr
2.109375
2
apps/courses/migrations/0043_remove_course_tag.py
islandowner-web/IT-MOOC
9
12767996
<filename>apps/courses/migrations/0043_remove_course_tag.py # Generated by Django 2.2 on 2019-12-10 22:22 from django.db import migrations class Migration(migrations.Migration): dependencies = [ ('courses', '0042_delete_bannercourse'), ] operations = [ migrations.RemoveField( ...
1.34375
1
tests/data/okta/adminroles.py
sckevmit/cartography
2,322
12767997
<reponame>sckevmit/cartography LIST_ASSIGNED_USER_ROLE_RESPONSE = """ [ { "id": "IFIFAX2BIRGUSTQ", "label": "Application Administrator", "type": "APP_ADMIN", "status": "ACTIVE", "created": "2019-02-06T16:17:40.000Z", "lastUpdated": "2019-02-06T16:17:40.000Z", ...
1.21875
1
ipodcopier/__init__.py
kristjano/ipodcopier
0
12767998
<filename>ipodcopier/__init__.py from .musiccopier import *
1.085938
1
example/parse_joined_gff_inline_dna.py
pflans/edge
32
12767999
# flake8: noqa # Converting GFF format that includes DNA as # # ##DNA chrI # ##AGCTAGAT # ##end-DNA # # to GFF with FASTA import sys import urllib import re fasta = [] curseq = [] started = False fn = sys.argv[1] f = open(fn, "r") def unescape(s): return re.sub("\s", "_", urllib.unquote(s)) for l in f.read()...
2.96875
3
piafedit/extension/ui_api.py
flegac/piaf-edit
0
12768000
from dataclasses import dataclass from typing import Callable, Any, Dict, Set from PyQt5 import QtCore from PyQt5.QtGui import QKeyEvent, QKeySequence from piafedit.gui.common.handler.keyboard_handler import KeyboardHandler @dataclass class UIAction: name: str tooltip: str shortcut: str action: Call...
2.578125
3
app/core/models.py
YumiBunny/Gusoktor
0
12768001
<reponame>YumiBunny/Gusoktor from django.db import models from django.contrib.auth.models import User from django.db.models.signals import post_save from django.dispatch import receiver import app.core.patch # La solución planteada tiene ventajas y desventajas. Como ventaja, se usa el # sistema de autenticación de dja...
1.984375
2
helper.py
luket4/cs3240-labdemo
0
12768002
<gh_stars>0 __author__ = 'lat9wj' def greeting(msg): print(msg)
1.234375
1
igramscraper/model/comment.py
0xflotus/instagram-scraper
1
12768003
from .initializer_model import InitializerModel import textwrap class Comment(InitializerModel): ''' * @param $value * @param $prop ''' def init_properties_custom(self, value, prop): if prop == 'id': self.identifier = value standart_properties = [ 'create...
2.765625
3
src/olympia/access/migrations/0001_initial.py
dante381/addons-server
0
12768004
<gh_stars>0 # Generated by Django 2.2.5 on 2019-09-12 13:30 from django.conf import settings from django.db import migrations, models import django.db.models.deletion import django.utils.timezone import olympia.amo.fields import olympia.amo.models class Migration(migrations.Migration): initial = True depen...
1.71875
2
tmp/xml_rpc.py
hanzhichao/requestz
2
12768005
<gh_stars>1-10 import xmlrpclib __HOST = 'localhost' __PORT = '8000' s = xmlrpclib.ServerProxy('http://' + __HOST + ':' + __PORT) # print s.pow(2, 3) s.add(2, 3) s.div(5, 2) s.system.listMethods()
1.882813
2
hokusai/services/deployment.py
eessex/hokusai
0
12768006
<reponame>eessex/hokusai import os import datetime import json from tempfile import NamedTemporaryFile import yaml from hokusai import CWD from hokusai.lib.config import HOKUSAI_CONFIG_DIR, config from hokusai.services.kubectl import Kubectl from hokusai.services.ecr import ECR, ClientError from hokusai.lib.common im...
1.960938
2
stonesoup/metricgenerator/__init__.py
Red-Portal/Stone-Soup-1
157
12768007
# -*- coding: utf-8 -*- from .base import MetricGenerator __all__ = ['MetricGenerator']
1.078125
1
Python/EvenOdd.py
udaypandey/BubblyCode
0
12768008
while True: num = int(input("Enter a number: ")) if num % 2 == 0: print(num, "is an even number") else: print(f"{num} is a odd number")
4.25
4
hood/forms.py
p-koskey/mtaani
0
12768009
from django import forms from django.contrib.auth.forms import UserCreationForm from django.contrib.auth.models import User from .models import Profile, Neighbourhood, Business, Post from cloudinary.models import CloudinaryField class SignupForm(UserCreationForm): email = forms.EmailField(max_length=254) clas...
2.3125
2
forcepush/inputs/__init__.py
wouterrvdb/ForcePush
0
12768010
from forcepush.logic import player from .input_manager import InputManager input_manager = InputManager() input_manager.register_handler(player.movement_handler)
1.445313
1
Python_to_Acces_Web_Data/Scraping_HTML_Data_with_BeautifulSoup/Following_Links_HTML_BeautifulSoup.py
MickBrown88/Programming_for_everybody
1
12768011
<gh_stars>1-10 import urllib.request, urllib.parse, urllib.error from bs4 import BeautifulSoup import ssl # Ignore SSL certificate errors ctx = ssl.create_default_context() ctx.check_hostname = False ctx.verify_mode = ssl.CERT_NONE n=1 url = input('Enter - ') # http://py4e-data.dr-chuck.net/known_by_Halley.html count=...
2.875
3
oc_ocdm/graph/entities/bibliographic/resource_embodiment.py
arcangelo7/oc_ocdm
1
12768012
#!/usr/bin/python # -*- coding: utf-8 -*- # Copyright (c) 2016, <NAME> <<EMAIL>> # # Permission to use, copy, modify, and/or distribute this software for any purpose # with or without fee is hereby granted, provided that the above copyright notice # and this permission notice appear in all copies. # # THE SOFTWARE IS P...
2.078125
2
examples/tonumpy.py
milankl/thermofeel
31
12768013
<gh_stars>10-100 # (C) Copyright 1996- ECMWF. # # This software is licensed under the terms of the Apache Licence Version 2.0 # which can be obtained at http://www.apache.org/licenses/LICENSE-2.0. # In applying this licence, ECMWF does not waive the privileges and immunities # granted to it by virtue of its status as a...
2.28125
2
setup.py
cooljoseph1/battlehack20-minimal
1
12768014
from setuptools import setup, find_packages from collections import OrderedDict long_description=""" This is a minimal engine for the Battlehack20 game. It lacks the secure of the original engine, but makes up for it by running 30 times faster. Read more at the Battlehack website: https://bh2020.battlecode.org. """ s...
1.507813
2
latex/slides/resources/04tuples/tuples.py
Bizarious/python-lessons
0
12768015
# Initialisierung mit () tupel_eins = (1, True, 4.5, "hallo") # Elemente abfragen wie bei Listen viereinhalb = tuple_eins[2] #4.5 hallo = tuple_eins[-1] #'hello' vordere = tuple_eins[:2] #(1, True) # Elemente verändern, unmöglich ! tupel_eins[0] = "neuer Wert" #TypeError # Ganzes Tuple austauschen, möglich ! tupel_ei...
3.109375
3
official/nlp/projects/triviaqa/prediction.py
hjkim-haga/TF-OD-API
1
12768016
# Copyright 2021 The TensorFlow 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...
1.96875
2
setz.py
relet/setzkasten
0
12768017
#!/usr/bin/env python3 import cv2 as cv import json import math import numpy as np import os import sys from requests.utils import requote_uri from geojson import FeatureCollection, Feature, Polygon, dumps config = json.load(open("config.json","r")) target = config.get('target') tilesize = config.get('tilesize') ma...
2.34375
2
0000_book/grasping_stepbystep.py
takuya-ki/wrs
0
12768018
import math import numpy as np import basis.robot_math as rm import visualization.panda.world as wd import modeling.geometric_model as gm import modeling.collision_model as cm import robot_sim.end_effectors.gripper.robotiq85.robotiq85 as rtq85 import grasping.annotation.utils as gu import pickle base = wd.World(cam_po...
2.0625
2
slack_logging_handler/__init__.py
danie1cohen/slack_handler
0
12768019
<filename>slack_logging_handler/__init__.py from .slack_logging_handler import SlackHandler, color_picker, build_logger
1.203125
1
TimeWrapper_JE/venv/Lib/site-packages/je_time/modules/__init__.py
JE-Chen/je_old_repo
0
12768020
<filename>TimeWrapper_JE/venv/Lib/site-packages/je_time/modules/__init__.py from je_time.modules import get_calendar from je_time.modules import time_calculate
1.34375
1
organizations/migrations/0005_organizationuser_date_created.py
st8st8/django-organizations
0
12768021
<gh_stars>0 # -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations import datetime from django.utils import timezone from django.utils.timezone import utc class Migration(migrations.Migration): dependencies = [ ('organizations', '0004_set_site'), ] ...
1.726563
2
magicfolder/picklemsg.py
mgax/MagicFolder
1
12768022
<reponame>mgax/MagicFolder<filename>magicfolder/picklemsg.py import cPickle as pickle CHUNK_SIZE = 64 * 1024 # 64 KB class Remote(object): def __init__(self, in_file, out_file): self.in_unpickler = pickle.Unpickler(in_file) self.out_pickler = pickle.Pickler(out_file, 2) # protocol version 2 ...
2.5625
3
app/http/controllers/CarController.py
craigderington/serviceauto
0
12768023
"""A CarController Module.""" from masonite.request import Request from masonite.view import View from masonite.controllers import Controller from app.Car import Car class CarController(Controller): """CarController Controller Class.""" def __init__(self, request: Request): """CarController Initiali...
3.265625
3
bench/echo_server/mailbox/server.py
victorpoluceno/xwing
12
12768024
import logging from xwing.mailbox import initialize, spawn, start initialize() logging.basicConfig(level='INFO') async def run_server(mailbox): while True: data = await mailbox.recv() if not data: break sender, message = data await mailbox.send(sender, message) if ...
2.390625
2
example/0_Basic_usage_of_the_library/python_feapder/2_air_spider/2_air_spider.py
RecluseXU/learning_spider
38
12768025
<gh_stars>10-100 # -*- coding: utf-8 -*- """ Created on 2021-03-11 22:18:46 --------- @summary: AirSpider : 轻量爬虫,学习成本低。面对一些数据量较少,无需断点续爬,无需分布式采集的需求,可采用此爬虫。 AirSpider不支持去重,因此配置文件中的去重配置无效 --------- @author: Administrator """ import feapder class AirSpiderTest(feapder.AirSpider): __custom_setting...
1.851563
2
fable/test/tst_separate_files.py
rimmartin/cctbx_project
0
12768026
<reponame>rimmartin/cctbx_project<filename>fable/test/tst_separate_files.py from __future__ import division, print_function import os op = os.path def remove_file_if_necessary(file_name): if (op.isfile(file_name)): os.remove(file_name) if (op.exists(file_name)): from libtbx.str_utils import show_string rai...
2.21875
2
corehq/apps/ota/tests/__init__.py
dslowikowski/commcare-hq
1
12768027
from .digest_restore import *
1.125
1
snuba/datasets/storages/transactions.py
fpacifici/snuba
0
12768028
from snuba.clickhouse.columns import ( UUID, Array, ColumnSet, DateTime, Float, IPv4, IPv6, Nested, ) from snuba.clickhouse.columns import SchemaModifiers as Modifiers from snuba.clickhouse.columns import String, UInt from snuba.clusters.storage_sets import StorageSetKey from snuba.datas...
1.484375
1
.tox/scenario/lib/python2.7/site-packages/oslo_utils/tests/test_excutils.py
bdrich/neutron-lbaas
0
12768029
# Copyright 2012, Red Hat, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agr...
2.25
2
scripts/ui/common.py
Hiwatts/facebook360_dep
221
12768030
#!/usr/bin/env python3 # Copyright 2004-present Facebook. All Rights Reserved. # This source code is licensed under the BSD-style license found in the # LICENSE file in the root directory of this source tree. """Common functions used across the UI tabs. The UI shares several common functions across its tabs. Unlike ...
1.703125
2
sugarpidisplay/sugarpiconfig/__init__.py
szpaku80/SugarPiDisplay
1
12768031
from flask import Flask app = Flask(__name__) app.secret_key = 'my secret key 123' from .views import *
1.359375
1
cate/util/safe.py
TomBlock/cate
0
12768032
# The MIT License (MIT) # Copyright (c) 2016, 2017 by the ESA CCI Toolbox development team and contributors # # Permission is hereby granted, free of charge, to any person obtaining a copy of # this software and associated documentation files (the "Software"), to deal in # the Software without restriction, including wi...
1.554688
2
fw/tiny2040/keypad.py
RyuSLunK/t9-macropad-circuitpython
22
12768033
<gh_stars>10-100 import digitalio import board from digitalio import DigitalInOut from digitalio import Direction import adafruit_matrixkeypad class Keypad(): def __init__(self, keys): cols = [DigitalInOut(x) for x in (board.GP3, board.GP4, board.GP5)] rows = [DigitalInOut(x) for x in (board.GP29_A...
2.671875
3
ntext.py
mc2pw/ntext
0
12768034
# This file is licensed under the terms of the MIT license. # See the LICENSE file in the root of this repository for complete details. """Data structure for representing string diagrams""" from collections import namedtuple from copy import deepcopy __all__ = [ 'Ntext', 'Composition', 'NotComposable', ...
3.046875
3
cogs/MarriageCommandsCog.py
saschavhd/DiscordAssistant
0
12768035
<filename>cogs/MarriageCommandsCog.py<gh_stars>0 from datetime import datetime import discord from discord.ext import commands import re from utils.database import db from utils.menu import Menu from utils.page import Page class MarriageCommandsCog(commands.Cog): def __init__(self, bot): self.bot = bot ...
2.921875
3
mysql/mysql_print_metadata-values.py
MichaelCurrin/python-2016
0
12768036
#!/usr/bin/python # -*- coding: utf-8 -*- """ Created on Wed Jun 8 14:10:03 2016 @author: michaelcurrin Open a connection to a database Print the tables and column data metadata Print the actual values for the some tables, for a defined table limit and row count. Close the database. """ # library to connect to MySQL...
3.515625
4
apps/site/api/renderers/__init__.py
LocalGround/localground
9
12768037
<filename>apps/site/api/renderers/__init__.py<gh_stars>1-10 from localground.apps.site.api.renderers.csv_renderer import CSVRenderer from localground.apps.site.api.renderers.browsable_api_renderer import BrowsableAPIRenderer from localground.apps.site.api.renderers.geojson_renderer import GeoJSONRenderer from localgrou...
1.210938
1
unit/test_get_systemd_units_info.py
tarantool/ansible-cartridge
17
12768038
<reponame>tarantool/ansible-cartridge import sys import unittest import module_utils.helpers as helpers sys.modules['ansible.module_utils.helpers'] = helpers from library.cartridge_get_systemd_units_info import get_systemd_units_info def call_get_systemd_units_info(app_name, instance_vars, tnt_version): return ...
2.125
2
basic_modules.py
Starry316/VolGradNet
7
12768039
<reponame>Starry316/VolGradNet """ Common basic modules """ import torch.nn as nn import torch.nn.functional as F class ConvBlock(nn.Module): """ Basis convolutional layer with leaky relu """ def __init__(self, in_channels, out_channels, kernel_size=3, stride=2, padding=1): super(ConvBlock, s...
2.765625
3
covidtrackerapp.py
Sivakumar001/covid19-tracker
2
12768040
<filename>covidtrackerapp.py<gh_stars>1-10 """ COVID TRACKER A Mini Project made on 10 April 2021 by <NAME>(212218104154). this project is used to observe the daily count of corona virus cases happening all around the world sorted by every country. this applicationretu...
3.46875
3
neuropype/gui/connectNodesDlg.py
ablot/Pinceau
0
12768041
<filename>neuropype/gui/connectNodesDlg.py<gh_stars>0 #!/usr/bin/env python from PyQt4.QtCore import * from PyQt4.QtGui import * import ui_connectNodes class connectNodesDlg(QDialog, ui_connectNodes.Ui_connectDialog): def __init__(self, parent=None): super(connectNodesDlg, self).__init__(parent) ...
2.25
2
tests/test_prepare.py
benoitc/pyuv
1
12768042
from common import unittest2 import pyuv class PrepareTest(unittest2.TestCase): def test_prepare1(self): self.prepare_cb_called = 0 def prepare_cb(prepare): self.prepare_cb_called += 1 prepare.stop() prepare.close() loop = pyuv.Loop.default_loop() ...
2.8125
3
proliantutils/hpssa/manager.py
anta-nok/proliantutils
0
12768043
<filename>proliantutils/hpssa/manager.py # Copyright 2015 Hewlett-Packard Development Company, L.P. # # 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/LIC...
1.859375
2
fr-test.py
0dj0bz/hn-vis
0
12768044
<gh_stars>0 import sys import argparse import uuid import json from multiprocessing import Process import matplotlib.pyplot as plt import math from random import random from numpy import arange vertices = ( (1, -1, 1), (1, 1, -1), (-1, 1, -1), (-1, -1, -1), (1, -1, 1), (1, 1, 1), (-1, -1...
2.296875
2
notes/c20170904h2/visualise.py
tommilligan/dailyprogrammer
0
12768045
#!/usr/bin/env python """ Generate visualisations for the main script """ from io import BytesIO import sys from PIL import Image, ImageDraw import dailyprogrammer.challenges.c20170904e2 as challenge from dailyprogrammer.utils.logging import moduleLogger logger = moduleLogger(__name__) INF = float('inf') def getY...
3.265625
3
src/color_selector.py
khushi-411/air-handwriting-detection-and-recognition
1
12768046
import cv2 def color_detector(): def setValues(x): print("") # creating a window for HUE selector cv2.namedWindow("Color detectors") cv2.createTrackbar("Upper Hue", "Color detectors", 153, 180, setValues) cv2.createTrackbar("Upper Saturation", "Color detectors", 255, 255, setValues) ...
3.453125
3
python_utils/__about__.py
mgorny/python-utils
0
12768047
__package_name__ = 'python-utils' __version__ = '2.5.0' __author__ = '<NAME>' __author_email__ = '<EMAIL>' __description__ = ( 'Python Utils is a module with some convenient utilities not included ' 'with the standard Python install') __url__ = 'https://github.com/WoLpH/python-utils'
1.117188
1
prokat/engine/migrations/0001_initial.py
mackevich/prokat
0
12768048
<gh_stars>0 # Generated by Django 2.1.2 on 2018-10-23 13:58 from django.db import migrations, models import django.db.models.deletion import mptt.fields class Migration(migrations.Migration): initial = True dependencies = [ ] operations = [ migrations.CreateModel( name='Categor...
1.75
2
tests/test_init.py
ryanmcfarland/flask-kdb
0
12768049
<reponame>ryanmcfarland/flask-kdb<filename>tests/test_init.py import pytest import os import sys sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__), '..'))) from flask import Flask from flask_kdb import FlaskKDB # Based heavily on - https://github.com/jidn/flask-obscure/blob/master/tests/test_...
2.234375
2
src/ast_toolbox/mcts/AdaptiveStressTestingRandomSeed.py
hdelecki/AdaptiveStressTestingToolbox
29
12768050
<gh_stars>10-100 import copy import gym import ast_toolbox.mcts.RNGWrapper as RNG from ast_toolbox.mcts.AdaptiveStressTesting import AdaptiveStressTest class AdaptiveStressTestRS(AdaptiveStressTest): """The AST wrapper for MCTS using random seeds as actions. Parameters ---------- kwargs : K...
2.515625
3