repo_name
stringlengths
6
90
path
stringlengths
4
230
copies
stringlengths
1
4
size
stringlengths
4
7
content
stringlengths
734
985k
license
stringclasses
15 values
hash
int64
-9,223,303,126,770,100,000
9,223,233,360B
line_mean
float64
3.79
99.6
line_max
int64
19
999
alpha_frac
float64
0.25
0.96
autogenerated
bool
1 class
ratio
float64
1.5
8.06
config_test
bool
2 classes
has_no_keywords
bool
2 classes
few_assignments
bool
1 class
google-research/recsim_ng
recsim_ng/entities/state_models/test_util.py
1
1706
# coding=utf-8 # Copyright 2021 The RecSim Authors. # # 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...
apache-2.0
-6,921,212,760,170,342,000
39.619048
77
0.701055
false
3.653105
true
false
false
NervanaSystems/coach
rl_coach/agents/human_agent.py
1
4458
# # Copyright (c) 2017 Intel Corporation # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to...
apache-2.0
2,615,652,829,100,861,400
37.102564
100
0.694482
false
4.045372
false
false
false
ipachev/irc_chatbot
personalities/sheldon.py
1
3559
from random import choice import re import nltk.data from lang import NounPhraseExtractor flattery = [ "You're talking to one of the three men in the Western Hemisphere capable of following that train of thought.", "I'm a physicist. I have a working knowledge of the entire universe and everything it contains.", "I'm ...
mit
-2,954,255,568,042,735,600
38.544444
208
0.605226
false
3.665294
false
false
false
square/pylink
tests/functional/features/steps/common.py
1
8762
# Copyright 2017 Square, 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 agreed to in writing,...
apache-2.0
-8,650,009,234,861,390,000
23.543417
81
0.634216
false
3.768602
false
false
false
jaharkes/home-assistant
homeassistant/components/camera/synology.py
4
9691
""" Support for Synology Surveillance Station Cameras. For more details about this platform, please refer to the documentation at https://home-assistant.io/components/camera.synology/ """ import asyncio import logging import voluptuous as vol import aiohttp from aiohttp import web from aiohttp.web_excep...
mit
1,713,244,171,357,674,200
30.089404
79
0.585492
false
3.942636
true
false
false
att-comdev/armada
armada/tests/unit/api/test_tiller_controller.py
1
6317
# Copyright 2017 AT&T Intellectual Property. All other 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...
apache-2.0
-6,881,137,061,311,505,000
41.113333
78
0.600443
false
3.82385
true
false
false
jrichte43/ProjectEuler
Problem-0185/solutions.py
1
2425
__problem_title__ = "Number Mind" __problem_url___ = "https://projecteuler.net/problem=185" __problem_description__ = "The game Number Mind is a variant of the well known game Master Mind. " \ "Instead of coloured pegs, you have to guess a secret sequence of " \ "dig...
gpl-3.0
-8,869,212,871,886,302,000
52.888889
100
0.56701
false
3.962418
false
false
false
dragly/conan
conans/test/integration/private_deps_test.py
2
8187
import unittest from conans.test.tools import TestClient, TestServer from conans.model.ref import ConanFileReference import os from conans.test.utils.cpp_test_files import cpp_hello_conan_files from conans.paths import CONANINFO, BUILD_INFO_CMAKE from conans.util.files import load from conans.model.info import ConanInf...
mit
-6,321,890,677,517,964,000
50.490566
99
0.585318
false
3.598681
true
false
false
GetBlimp/boards-backend
blimp_boards/utils/serializers.py
2
1062
from rest_framework import serializers class DynamicFieldsModelSerializer(serializers.ModelSerializer): """ A ModelSerializer that takes an additional `fields` argument that controls which fields should be displayed. """ def __init__(self, *args, **kwargs): # Don't pass the 'fields' arg u...
agpl-3.0
7,330,402,511,937,207,000
33.290323
78
0.607345
false
4.741071
false
false
false
stevenbuccini/blackjackPy
blackjack.py
1
14721
################## #### Blackjack ### ################## # Author: Steven Buccini # Built with love specifically for the Hacker School Fa13 application. # Recycled for my Hacker School Fa14 application. from random import shuffle # import the shuffle method for shuffling cards import os # will allow us to clear th...
mit
8,129,614,160,006,497,000
40.940171
186
0.565722
false
3.830601
false
false
false
danielrenechaparro/Python
ejemplo_ordenamiento_burbuja.py
1
1863
#!/usr/bin/env python # -*- coding: utf-8 -*- # # ejemplo_ordenamiento_burbuja.py # # Copyright 2017 usuario <usuario@Acer> # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version ...
gpl-3.0
-7,706,967,680,766,203,000
36.26
108
0.652174
false
3.285714
false
false
false
kylestev/NetCodePool-API
api.py
1
1740
from json import loads from requests import Session from datetime import datetime as dt API_URL = 'http://www.netcodepool.org/oldapi.php?api_key={0}' class NetCodePoolAPI: def __init__(self, key): self.key = key self.sesh = Session() self.refresh() def refresh(self): """Updat...
mit
2,875,054,050,171,381,000
30.071429
79
0.545977
false
4.094118
false
false
false
salemgyn/pyman-game
main.py
1
7697
import pygame,sys,maze,random from pygame.locals import * class Pyman(object): pygame.init() FPS = 30 fpsClock = pygame.time.Clock() JANELA = pygame.display.set_mode((888,650),0,32) TELA = pygame.display.get_surface() pygame.display.set_caption('PyMan - The Python Pacman') mapa = maze.c...
mit
7,210,307,482,210,423,000
45.373494
150
0.603222
false
2.994942
false
false
false
azov3902/linguinesim
telescopeclass.py
1
4116
################################################################################ # # File: telescopeclass.py # Author: Anna Zovaro # Email: anna.zovaro@anu.edu.au # # Description: # A class for a telescope. # # Copyright (C) 2016 Anna Zovaro # ########################################################################...
gpl-3.0
5,167,737,624,133,498,000
30.669231
225
0.631195
false
2.965418
false
false
false
dburr/SchoolIdolAPI
api/management/commands/cron_notifications.py
1
2100
# -*- coding: utf-8 -*- from django.core.management.base import BaseCommand, CommandError from api import models from web.utils import send_email class Command(BaseCommand): can_import_settings = True def handle(self, *args, **options): sent = [] notifications = models.Notification.objects.fi...
apache-2.0
-7,927,821,165,053,071,000
51.45
124
0.549094
false
5.463542
false
false
false
CloudVLab/professional-services
examples/dataflow-python-examples/batch-examples/cookbook-examples/pipelines/data_ingestion.py
2
5744
# Copyright 2017 Google 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 agreed to in writing,...
apache-2.0
4,447,872,780,968,784
41.548148
88
0.636316
false
4.328561
false
false
false
Milad-Rakhsha/chrono
src/demos/python/irrlicht/demo_IRR_custom_contact.py
3
8891
#------------------------------------------------------------------------------ # Name: pychrono example # Purpose: # # Author: Lijing Yang # # Created: 6/12/2020 # Copyright: (c) ProjectChrono 2019 #------------------------------------------------------------------------------ import pychrono.core ...
bsd-3-clause
1,127,141,365,708,707,500
33.328185
109
0.669891
false
2.975569
false
false
false
daltonmaag/ufo2fdk
Lib/ufo2fdk/kernFeatureWriter.py
3
17210
try: set except NameError: from sets import Set as set try: sorted except NameError: def sorted(l): l = list(l) l.sort() return l inlineGroupInstance = (list, tuple, set) class KernFeatureWriter(object): """ This object will create a kerning feature in FDK syntax...
mit
-3,407,394,912,383,504,400
36.99117
145
0.572981
false
4.341574
false
false
false
hasanalom/detekt
detector.py
1
3962
# Copyright (C) 2014 Claudio Guarnieri. # This file is part of Detekt - https://github.com/botherder/detekt # See the file 'LICENSE' for copying permission. import os import time import yara import psutil import logging import threading from win32com.shell import shell from utils import get_resource class DetectorEr...
gpl-3.0
6,233,937,753,922,594,000
30.696
109
0.59894
false
3.813282
false
false
false
AuthorizeNet/sample-code-python
CustomerProfiles/create-customer-profile.py
1
1178
import os, sys import imp from authorizenet import apicontractsv1 from authorizenet.apicontrollers import * constants = imp.load_source('modulename', 'constants.py') import random def create_customer_profile(): merchantAuth = apicontractsv1.merchantAuthenticationType() merchantAuth.name = constants.apiLoginI...
mit
-5,666,662,244,869,624,000
34.69697
140
0.760611
false
4.062069
false
false
false
CentralLabFacilities/m3meka
python/scripts/m3qa/calibrate_sensors.py
1
7592
#Copyright 2008, Meka Robotics #All rights reserved. #http://mekabot.com #Redistribution and use in source and binary forms, with or without #modification, are permitted. #THIS SOFTWARE IS PROVIDED BY THE Copyright HOLDERS AND CONTRIBUTORS #"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT #LIMITED...
mit
6,248,860,988,889,856,000
36.771144
106
0.628556
false
2.694109
true
false
false
brianjpetersen/bocce
benchmarking/routing.py
1
2025
# standard libraries import datetime import random # third party libraries pass # first party libraries import bocce def sample_with_replacement(population, N): i = 0 while i < N: yield random.choice(population) i += 1 def benchmark(cache, matches=1e5): # construct paths to match pat...
mit
3,664,611,160,658,432,500
33.913793
101
0.57679
false
3.48537
false
false
false
Katello/grinder
src/grinder/Retry.py
2
3225
# # Copyright (c) 2012 Red Hat, Inc. # # Module to fetch content from yum repos # # This software is licensed to you under the GNU General Public # License as published by the Free Software Foundation; either version # 2 of the License (GPLv2) or (at your option) any later version. # There is NO WARRANTY for this softw...
gpl-2.0
3,995,533,137,166,116,000
37.855422
122
0.612713
false
4.199219
false
false
false
ucldc/harvester
scripts/copy_couchdb_fields.py
3
2664
import sys import os from harvester.post_processing.couchdb_runner import CouchDBWorker from harvester.image_harvest import harvest_image_for_doc from harvester.couchdb_init import get_couchdb import couchdb #couchdb-python from dplaingestion.selector import getprop, setprop EMAIL_RETURN_ADDRESS = os.environ.get('EMA...
bsd-3-clause
-3,265,602,928,976,777,000
35.493151
78
0.612988
false
3.424165
false
false
false
nvitha/Smart-Cities
django/smartcity/vagent/stop_uniform.py
1
2553
import sys import os from datetime import datetime from volttron.platform.vip.agent import Agent, Core, PubSub, RPC from volttron.platform.messaging import headers as headers_mod from volttron.platform.agent import utils from settings import remote_url, topics_prefixes_to_watch, heartbeat_period import gevent # util...
mit
-5,215,536,904,136,747,000
27.696629
75
0.57501
false
3.970451
true
false
false
xia2/xia2
src/xia2/Modules/Analysis/__init__.py
1
3264
from collections import OrderedDict from libtbx import phil from dials.pychef import dose_phil_str batch_phil_scope = """\ batch .multiple = True { id = None .type = str range = None .type = ints(size=2, value_min=0) } """ phil_scope = phil.parse( """\ d_min = None .type = float(value_min=0) d_ma...
bsd-3-clause
-1,441,212,397,022,971,000
29.792453
95
0.568015
false
3.524838
false
false
false
mirhampt/sql_interp
sql_interp/esc_types.py
1
4852
""" Contains Esc class and its subclasses. To make SQLInterp play nice with your custom objects, you may wish to subclass the Esc class. """ import re __all__ = ['Esc', 'ListEsc', 'DictEsc', 'UnknownContextError'] # Regular expressions to determine context. # Borrowed directly from SQL::Interp. RE_FLAGS = re.S | r...
mit
8,076,403,864,075,074,000
27.374269
79
0.554411
false
3.689734
false
false
false
hey-mx/ventas_pygtk
Ventas.py
1
14399
# -*- coding: utf-8 -*- import pygtk pygtk.require("2.0") import gtk, gobject from utils.Form import FormBuilder from utils.Busqueda import BusquedaWindow from utils.Database import DataModel from ImprimirTicket import Ticket from decimal import * import datetime import re class VentasFactory(gtk.Frame): __id...
mit
7,067,975,571,441,241,000
45.592233
149
0.581412
false
3.471425
false
false
false
evgenymarkov/pygraph
pygraph/common_mixin.py
1
4337
from copy import deepcopy from pygraph.basegraph import BaseGraph class CommonMixin: """ Общие методы для всех видов графов. """ def __str__(self): """ Возвращает строковое представление графа при вызове str() или print(). """ str_nodes = repr(self.nodes()) str...
lgpl-3.0
-2,141,341,121,084,443,400
28.582677
93
0.520894
false
2.867939
false
false
false
Bysmyyr/chromium-crosswalk
tools/telemetry/telemetry/internal/backends/android_app_backend.py
11
4313
# Copyright 2012 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 re from telemetry.core import util from telemetry.internal.app import android_process from telemetry.internal.backends import android_browser_backend...
bsd-3-clause
-5,847,453,331,160,922,000
35.243697
79
0.703918
false
3.978782
false
false
false
intersense/stencil-overlapped-tiling-ics
scripts/sort-by-one.py
2
1702
#!/usr/bin/env python import sys results1 = {} results2 = {} ## Process first file data = open(sys.argv[1]) # Parse column names headers = data.readline().strip().split(',') # Process each entry for line in data.readlines(): columns = line.strip().split(',') data = dict(zip(headers, columns)) block...
mit
-5,830,486,011,475,486,000
26.451613
110
0.633373
false
2.889643
false
false
false
rgayon/plaso
plaso/parsers/syslog_plugins/ssh.py
1
5445
# -*- coding: utf-8 -*- """This file contains a plugin for SSH syslog entries.""" from __future__ import unicode_literals import pyparsing from plaso.containers import time_events from plaso.lib import definitions from plaso.parsers import syslog from plaso.parsers import text_parser from plaso.parsers.syslog_plugin...
apache-2.0
7,191,993,765,683,409,000
32.611111
77
0.682277
false
3.850778
false
false
false
publicscience/hive
app/routes/api/project.py
1
3750
from app import app from app.routes.oauth import requires_login from flask import render_template, redirect, request, url_for, jsonify, flash from flask.views import MethodView from app.models import Issue, Comment, User, Event, Project from app.models.user import current_user from . import register_api from flask.ext....
mit
5,391,252,104,449,159,000
35.407767
123
0.598133
false
4.125413
false
false
false
robonyong/owl-rates
scrape.py
1
2697
from lxml import html import requests import boto3 from PIL import Image from slugify import slugify import os, sys, urllib, io from database.schemas import * from app import create_app, db Image.MAX_IMAGE_PIXELS = 10000000000000 s3 = boto3.resource('s3') app = create_app('config.py') sizes = { '1024': (1024, 1024...
gpl-3.0
3,883,538,643,110,463,000
29.303371
128
0.659251
false
2.636364
false
false
false
davidzchen/tensorflow
tensorflow/python/autograph/pyct/transpiler.py
4
17633
# Copyright 2016 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 applica...
apache-2.0
-7,507,532,393,705,684,000
34.336673
80
0.671979
false
4.24994
false
false
false
Johnzero/erp
openerp/addons/document/report/document_report.py
9
7165
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>). # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU...
agpl-3.0
-917,587,954,816,032,400
44.348101
189
0.544871
false
3.81117
false
false
false
frictionlessdata/datapackage-pipelines
datapackage_pipelines/lib/stream_remote_resources.py
1
8777
import os import logging import time from datetime import date, time as datetime_time import itertools from decimal import Decimal import requests import tabulator from tableschema import Schema from dataflows.helpers.resource_matcher import ResourceMatcher from datapackage_pipelines.wrapper import ingest, spew fro...
mit
2,647,913,344,528,034,000
33.829365
111
0.522958
false
4.45307
false
false
false
soheilhy/cute
python/cute/weight.py
1
2357
# Copyright 2011 HiPerNet Research Group, University of Toronto. All Rights # Reserved. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, or (at your option) # any later versio...
gpl-2.0
-9,062,092,864,821,450,000
36.412698
124
0.702588
false
3.813916
false
false
false
tjcsl/cslbot
cslbot/commands/fweather.py
1
1418
# -*- coding: utf-8 -*- # Copyright (C) 2013-2018 Samuel Damashek, Peter Foley, James Forcier, Srijay Kasturi, Reed Koser, Christopher Reffett, and Tris Wilson # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Softw...
gpl-2.0
-2,188,317,454,560,295,700
35.358974
135
0.706629
false
3.683117
false
false
false
tidus747/Tutoriales_juegos_Python
Ataca a los orcos V1.0.0/Ataca_a_los_orcos_V1_0_0.py
1
3699
# -*- coding: utf-8 -*- from Caballero import Caballero from Orco import Orco from Choza import Choza from Funciones import * import random import textwrap class Juego: def __init__(self): self.chozas = [] #Inicializamos el número de chozas que tendremos dentro de nuestro juego self.jugador = None...
gpl-3.0
7,781,205,435,622,429,000
42.235294
115
0.616871
false
2.951807
false
false
false
arrti/proxypool
listener.py
1
1920
#!/usr/bin/python2 # coding=utf-8 import sys from datetime import datetime from email.mime.multipart import MIMEMultipart from email.mime.text import MIMEText from smtplib import SMTP_SSL from supervisor import childutils from proxypool.config import SEND_MAIL SMTP_SERVER = 'smtp server' ACCOUNT = 'account' PASSWORD...
apache-2.0
-6,180,966,612,556,017,000
26.428571
79
0.607813
false
3.380282
false
false
false
Crescent-Saturn/Principles-of-Computing
week2/poc_plot_example.py
1
1555
""" Example of creating a plot using simpleplot Input is a list of point lists (one per function) Each point list is a list of points of the form [(x0, y0), (x1, y1, ..., (xn, yn)] """ import simpleplot # create three sample functions def double(num): """ Example of linear function """ return ...
mit
-9,163,785,733,467,006,000
22.223881
76
0.566559
false
3.783455
false
false
false
ivokosir/icy-hall
update.py
1
2776
from helper import * from rect import Rect import rect import math world_w, world_h = (200, 100) new_platforms = [ rect.Rect(0, 50, 50, 5), rect.Rect(55, 10, 5, 100), rect.Rect(30, 0, 5, 40), rect.Rect(55, 40, 200, 5), rect.Rect(300, 45, 300, 5), ] new_player = R(y=0, vy=0, x=10, vx=0) new_game =...
mit
432,975,536,982,989,300
28.531915
67
0.595101
false
3.194476
false
false
false
yetship/blog_codes
htmlparser_demo.py
1
3383
#!/usr/bin/env python # encoding: utf-8 from HTMLParser import HTMLParser class Status: INIT = 0x01 SUMMARY = 0x02 REFERRING_SITES = 0x04 COUNTRIES = 0x08 TYPES = 0x10 PLATFORMS = 0x20 TERMINAL = 0x40 # create a subclass and override the handler methods class MyHTMLParser(HTMLParser): ...
gpl-3.0
-4,002,929,279,613,870,600
30.036697
78
0.574342
false
3.725771
false
false
false
chippey/gaffer
python/GafferImageTest/BlurTest.py
1
4835
########################################################################## # # Copyright (c) 2015, John Haddon. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions of so...
bsd-3-clause
-8,623,817,731,558,646,000
36.192308
116
0.664116
false
3.501086
true
false
false
itaymendel/taurus
tests/modules/test_ApacheBenchmark.py
1
4112
import logging import time from os import path from bzt.modules.ab import ApacheBenchmarkExecutor, TSVDataReader from tests import BZTestCase from tests.mocks import EngineEmul from bzt.utils import EXE_SUFFIX from bzt import ToolError, TaurusConfigError TOOL_NAME = 'ab' + EXE_SUFFIX def get_res_path(resource): ...
apache-2.0
5,845,895,471,314,442,000
29.686567
77
0.518726
false
4.310273
true
false
false
m4nh/roars
scripts/nodes/experimental/markers/batch_marker_detector.py
1
2611
#!/usr/bin/env python # -*- encoding: utf-8 -*- from roars.rosutils.rosnode import RosNode from roars.vision.cameras import Camera from roars.vision.arucoutils import MarkerDetector from roars.vision.arp import ARP from roars.vision.augmentereality import BoundingBoxFromSixPoints, VirtualObject import roars.geometry.t...
gpl-3.0
8,310,057,861,686,631,000
29.081395
108
0.658291
false
3.094498
false
false
false
manuels/cxx2rs
cxx2rs/rustify.py
1
6108
import clang.cindex import re from parser import * def rustify_variable_declaration(node): keywords = ['priv', 'loop', 'ref', 'in', 'type', 'where', 'impl', 'self', 'as', 'pub'] name = node.spelling while name in keywords: name += "_" if len(name) == 0: name = "_" return "%s: %s"...
gpl-2.0
-5,904,279,603,152,312,000
31.83871
106
0.585134
false
3.269807
false
false
false
putrasattvika/ssidstat
ssidstat/common/models/boot_traffic_history.py
1
1350
import time import sqlite3 from base_model import BaseModel from datetime import datetime from contextlib import contextmanager class BootTrafficHistory(BaseModel): def __init__(self, dbfile, table_name): super(BootTrafficHistory, self).__init__(dbfile, table_name) def init_db(self): with self.db_cursor() as ...
apache-2.0
5,245,706,274,982,747,000
20.774194
62
0.617778
false
2.986726
false
false
false
karthik-sethuraman/Snowmass-ONFOpenTransport
RI/flask_server/tapi_server/models/tapi_connectivity_resilience_constraint.py
4
16267
# coding: utf-8 from __future__ import absolute_import from datetime import date, datetime # noqa: F401 from typing import List, Dict # noqa: F401 from tapi_server.models.base_model_ import Model from tapi_server.models.tapi_common_layer_protocol_name import TapiCommonLayerProtocolName # noqa: F401,E501 from tapi...
apache-2.0
1,754,087,768,878,925,800
46.287791
391
0.701789
false
3.921649
false
false
false
fr3akout/pwny
pwny/util/util.py
1
1463
import itertools import struct from functools import wraps WORD_SIZE_FORMAT_LOOKUP = { 1: "B", 2: "H", 4: "I", 8: "Q" } def pack_value(value, size=8, little_endian=True): pack_format = "<" if not little_endian: pack_format = ">" pack_format += WORD_SIZE_FORMAT_LOOKUP[size] re...
mit
-7,145,382,919,088,353,000
23.383333
76
0.54067
false
3.639303
false
false
false
ariscop/battlespire-tools
bsitool/bsi.py
1
3154
#!/usr/bin/env python3 import numpy as np from io import BytesIO from bsistructs import BSIFile from PIL import Image from PIL.ImagePalette import ImagePalette int32ul = np.dtype("<u4") int16ul = np.dtype("<u2") class BSI: __slots__ = "IFHD", "NAME", "BHDR", "HICL", "HTBL", "CMAP", "DATA" def __init__(self...
unlicense
-5,552,671,555,753,366,000
25.283333
83
0.486367
false
3.402373
false
false
false
hstxcn/hstxcn-backend
api/base.py
1
8115
import sys import json import functools import traceback import tornado.web import tornado.websocket from tornado import gen from tornado.web import ( HTTPError, decode_signed_value, ) from itsdangerous import TimedJSONWebSignatureSerializer as Serializer import models from database import db_session from u...
apache-2.0
5,822,390,465,149,954,000
31.46
79
0.554282
false
4.328
false
false
false
hstau/covar-cryo
covariance/star.py
1
1172
import pandas as pd def write_star(star_file, traj_file, df): with open(star_file,'w') as text_file: text_file.write('\ndata_ \n \nloop_ \n \n_rlnImageName #1 \n_rlnAnglePsi #2 \n_rlnAngleTilt #3 \n_rlnAngleRot #4 \n') for i in range(len(df)): text_file.write('%s@%s %s %s %s\n' %(i+1...
gpl-2.0
-7,273,726,377,908,041,000
33.470588
125
0.526451
false
3.377522
false
false
false
aadithyamd/QandA
mini/settings.py
1
3636
""" Django settings for mini project. Generated by 'django-admin startproject' using Django 1.8. For more information on this file, see https://docs.djangoproject.com/en/1.8/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/1.8/ref/settings/ """ # Build paths ins...
mit
1,191,866,712,252,470,500
25.735294
91
0.677943
false
3.459562
false
false
false
kchodorow/tensorflow
tensorflow/contrib/distributions/python/ops/logistic.py
4
7582
# Copyright 2016 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 applica...
apache-2.0
2,259,322,147,386,245,000
32.697778
92
0.655764
false
3.819647
false
false
false
sergiotocalini/devops-tools
devops_sak/lanreporter.py
1
2800
#!/usr/bin/env python import sys import os from prettytable import PrettyTable from IPy import IP sys.path.insert(0, os.path.dirname(__file__)) from lib.nmap import PortScanner class Output(): def __init__(self, filename): self.filename = filename def excel(self, headers, rows): from xlw...
gpl-3.0
630,958,407,260,614,700
31.941176
70
0.543929
false
4.005722
false
false
false
lazybios/v2ex
money.py
16
1441
#!/usr/bin/env python # coding=utf-8 import os import re import time import datetime import hashlib import string import random from google.appengine.ext import webapp from google.appengine.api import memcache from google.appengine.ext import db from google.appengine.ext.webapp import util from google.appengine.ext.w...
bsd-3-clause
-1,909,446,797,898,821,000
23.305085
63
0.730635
false
3.469734
false
false
false
gen2brain/crtaci
frontend/python/setup.py
1
9625
#!/usr/bin/env python import os import sys import shutil import tarfile import platform import subprocess from fnmatch import fnmatch from os.path import join, dirname, realpath, basename from distutils.core import setup, Command from distutils.dep_util import newer from distutils.command.build import build from distu...
gpl-3.0
8,443,437,774,528,312,000
31.516892
94
0.566753
false
3.263818
false
false
false
Alexanderalex/warmuppp
olekapp/views.py
1
1429
from django.shortcuts import render # Create your views here. from django.http import HttpResponse from django.template import Template, Context from olekapp.geocoding import Geocoder import requests def home(request): location = request.GET.get('location','Jaśminów 21 Tychy') par = { 'location': locat...
gpl-2.0
-2,663,712,617,279,105,500
25.943396
122
0.573931
false
3.413876
false
false
false
chapmanb/bcbio-nextgen
tests/conftest.py
2
5904
"""Pytest fixtures and test helper functions""" import collections import contextlib from datetime import datetime import io import os import shutil import subprocess import tarfile import tempfile import pytest import requests import yaml from bcbio.pipeline.config_utils import load_system_config if os.environ.get...
mit
289,584,281,956,683,460
33.526316
109
0.646172
false
3.337479
true
false
false
Fluent-networks/floranet
floranet/data/alembic/versions/99f8aa50ac47_otaa_devices_to_be_pre_provisioned_in_.py
1
1164
"""OTAA devices to be pre-provisioned in the database. Make columns devaddr nwkskey appskey nullable; deveui non-nullable. Revision ID: 99f8aa50ac47 Revises: 282e6b269222 Create Date: 2017-02-20 10:01:14.549853 """ from alembic import op from sqlalchemy.sql import table, column import sqlalchemy as sa # revision id...
mit
213,154,988,826,941,950
30.459459
67
0.70189
false
3.180328
false
false
false
javierlopm/tweetapps
replytweet.py
1
2130
#!/usr/bin/env python # RaspberryPi app # # Developed by Javier Lopez # 03/22/2015 import tweepy import sys import re from datetime import datetime, timedelta import subprocess #reload(sys) #sys.setdefaultencoding('utf-8') #Reading keys under the password file keys = open('password','r') consumerKey =...
mit
2,748,043,658,590,591,500
23.204545
119
0.651643
false
3.281972
false
false
false
micahcochran/geopandas
geopandas/io/tests/test_io.py
1
2374
from __future__ import absolute_import import fiona import geopandas from geopandas import read_postgis, read_file import pytest from geopandas.tests.util import connect, create_db, validate_boro_df class TestIO: def setup_method(self): nybb_zip_path = geopandas.datasets.get_path('nybb') self.d...
bsd-3-clause
8,821,227,858,283,305,000
31.972222
77
0.590986
false
3.491176
true
false
false
FedoraScientific/salome-hexablock
src/TEST_PY/test_unit/hexa_quads.py
1
6410
# -*- coding: latin-1 -*- # Copyright (C) 2009-2014 CEA/DEN, EDF R&D # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later ...
lgpl-2.1
-5,646,198,038,640,122,000
24.335968
81
0.53947
false
2.896521
true
false
false
GiovanniConserva/TestDeploy
venv/Lib/site-packages/clyent/colors/__init__.py
1
2191
from __future__ import print_function import sys from contextlib import contextmanager from clyent.colors.color import Color from clyent.colors.color_formatter import print_colors import os try: import win32console except ImportError: std_hdls = {} else: # std_output_hdl will be none if this is a service ...
bsd-3-clause
-6,844,345,160,523,234,000
21.587629
69
0.602921
false
3.719864
false
false
false
veegee/amqpy
amqpy/consumer.py
1
2942
from __future__ import absolute_import, division, print_function __metaclass__ = type from abc import ABCMeta, abstractmethod class AbstractConsumer: __metaclass__ = ABCMeta """ This class provides facilities to create and manage queue consumers. To create a consumer, subclass this class and override...
mit
6,078,707,061,962,467,000
30.634409
86
0.618627
false
4.417417
false
false
false
risd-cs/codedrop-twitterbot
twitter/follow.py
15
9544
"""USAGE twitter-follow [options] <user> DESCRIPTION Display all following/followers of a user, one user per line. OPTIONS -o --oauth authenticate to Twitter using OAuth (default no) -r --followers display followers of the given user (default) -g --following display users the given...
mit
-7,026,576,290,771,035,000
36.427451
79
0.538558
false
4.0084
false
false
false
e-koch/VLA_Lband
Proposal_Figures/Bconfig_ngc595_basics.py
1
4240
''' Highlight the HI bubble, corresponding to the Giant HII region NGC 595. Also show the Kitt Peak Halpha map. Based on the combined 14B-088 & AT0206 cube. ''' import os from spectral_cube import SpectralCube import astropy.units as u from astropy.coordinates import SkyCoord import numpy as np from astropy.io impor...
mit
-4,445,961,042,643,206,000
35.239316
108
0.671934
false
2.822903
false
false
false
danjac/ownblock
ownblock/ownblock/apps/storage/serializers.py
1
2920
from rest_framework import serializers from ..accounts.serializers import UserSerializer from .models import Place, Item class PlaceSerializer(serializers.ModelSerializer): is_editable = serializers.SerializerMethodField('is_obj_editable') is_removable = serializers.SerializerMethodField('is_obj_removable'...
mit
4,876,779,559,619,171,000
30.73913
74
0.607192
false
4.049931
false
false
false
kbase/transform
plugins/scripts/validate/trns_validate_Sequence.py
1
6904
#!/usr/bin/env python # standard library imports import sys import os import subprocess import logging import re # KBase imports import biokbase.Transform.script_utils as script_utils sep_illumina = '/' sep_casava_1 = ':Y:' sep_casava_2 = ':N:' def check_interleavedPE(filename): count = 0 with open(file...
mit
-5,844,096,743,324,290,000
34.772021
132
0.606315
false
4.129187
false
false
false
jfterpstra/bluebottle
bluebottle/news/serializers.py
1
1211
from fluent_contents.rendering import render_placeholder from django.utils.safestring import mark_safe from rest_framework import serializers from bluebottle.bluebottle_drf2.serializers import SorlImageField, ImageSerializer from bluebottle.members.serializers import UserPreviewSerializer from .models import NewsIte...
bsd-3-clause
-2,325,068,549,064,742,000
31.72973
82
0.712634
false
4.249123
false
false
false
venicegeo/eventkit-cloud
eventkit_cloud/tasks/tests/test_export_tasks.py
1
40214
# -*- coding: utf-8 -*- # test cases for Export Tasks import json import pickle import logging import os import sys import uuid import celery from billiard.einfo import ExceptionInfo from django.conf import settings from django.contrib.auth.models import Group, User from django.contrib.gis.geos import GEOSGeometry, Po...
bsd-3-clause
-68,593,536,724,823,864
55.008357
178
0.587258
false
3.920257
true
false
false
pkimber/mail
setup.py
1
1356
import os from distutils.core import setup def read_file_into_string(filename): path = os.path.abspath(os.path.dirname(__file__)) filepath = os.path.join(path, filename) try: return open(filepath).read() except IOError: return '' def get_readme(): for name in ('README', 'README.r...
apache-2.0
-3,137,807,274,476,816,400
27.270833
102
0.582596
false
3.896552
false
false
false
jongoodnow/anglerfish
src/server/routes.py
1
2387
import tornado.web import tornado.websocket import urlparse import json import uuid import StringIO import random import string import os from PIL import Image json_data = open(os.path.join(os.path.dirname(__file__), 'cards.json')).read() stack = json.loads(json_data) global ProjSocket ProjSocket = None class MainHa...
mit
604,652,298,817,469,800
27.428571
96
0.69292
false
3.212651
false
false
false
haxwithaxe/teensyduino-keyboard
gen_chorder.h.py
1
1544
#!/usr/bin/env python __license__ = 'GPLv3' __author__ = 'haxwithaxe <me@haxwithaxe.net>' import json import sys import os HEADER = '// generated by %s from %s #include "keypress.h"' base_list = [] for i in range(0,256): base_list += ['\t0,'] def arr2int(*arr): mask = 1 return (((arr[7]&mask)<<7)|((arr[6]&mask...
gpl-3.0
-3,350,842,623,466,648,000
19.864865
154
0.577073
false
2.156425
false
false
false
OCA/connector-interfaces
connector_importer/models/sources/source_mixin.py
1
6368
# Author: Simone Orsi # Copyright 2018 Camptocamp SA # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). from odoo import models, fields, api, tools from ...utils.import_utils import gen_chunks class ImportSourceConsumerMixin(models.AbstractModel): """Source consumer mixin. Inheriting mode...
agpl-3.0
3,218,777,382,207,923,000
30.215686
79
0.60223
false
4.200528
true
false
false
pankeshang/wattodo
todo/migrations/0001_initial.py
1
1488
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations class Migration(migrations.Migration): dependencies = [ ] operations = [ migrations.CreateModel( name='TaskLog', fields=[ ('id', models.AutoField(verb...
mit
2,490,558,678,096,411,000
38.157895
157
0.551747
false
4.156425
false
false
false
terkira/UISoup
uisoup/win_soup/mouse.py
2
8308
#!/usr/bin/env python # Copyright (c) 2014 Max Beloborodko. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless r...
apache-2.0
-3,168,302,025,615,703,600
40.333333
93
0.596052
false
3.802288
false
false
false
martelogan/fb-friendbot-factory
app/python/fb_messages_helpers.py
1
7610
# -*- coding: utf-8 -*- #!/usr/bin/env python # Helper function for output on facebook messages archive. # LICENSE INFORMATION HEADER __author__ = "Logan Martel" __copyright__ = "Copyleft (c) 2018, Logan Martel" __credits__ = ["Logan Martel"] __license__ = "ApacheV2.0" __version__ = "0.1.0" __maintainer__ = "Logan M...
apache-2.0
4,825,461,316,877,436,000
46.861635
146
0.554139
false
4.195149
false
false
false
loafdog/projeuler
p3-largestPrimeFactor.py
1
2312
#!/usr/bin/python # The prime factors of 13195 are 5, 7, 13 and 29. # What is the largest prime factor of the number 600851475143 ? # I didn't know how to determine if a number is prime. I found some # useful info here: http://www.wikihow.com/Check-if-a-Number-Is-Prime # # I used trial by division. My first try at i...
apache-2.0
5,556,192,744,055,338,000
27.195122
89
0.614187
false
3.256338
true
false
false
blacktear23/django
django/http/fast_parse_qsl.py
1
1749
MAX_PARAMS_KEYS = 10000 _hexdig = '0123456789ABCDEFabcdef' _hextochr = dict((a+b, chr(int(a+b,16))) for a in _hexdig for b in _hexdig) def unquote(s): """unquote('abc%20def') -> 'abc def'.""" res = s.split('%') # fastpath if len(res) == 1: return s s = res[0] for item ...
bsd-3-clause
171,591,826,939,847,500
29.172414
75
0.468839
false
3.729211
false
false
false
MrNuggelz/sklearn-glvq
setup.py
1
1432
from __future__ import print_function import sys from setuptools import setup with open('requirements.txt') as f: INSTALL_REQUIRES = [l.strip() for l in f.readlines() if l] try: import numpy except ImportError: print('numpy is required during installation') sys.exit(1) try: import scipy except Im...
bsd-3-clause
-1,722,280,244,038,856,700
28.833333
94
0.664804
false
3.778364
false
false
false
pijyoi/pymklfft
mkl_df.py
1
8830
import os import sys import numpy as np import cffi ffi = cffi.FFI() ffi.cdef(""" typedef void* DFTaskPtr; int dfdNewTask1D(DFTaskPtr *, int, const double[], int, int, const double[], int); int dfdEditPPSpline1D(DFTaskPtr, int, int, int, const double[], int, const double[], const double[], int); int dfdConstruct1D(DF...
mit
3,302,852,883,704,073,700
29.874126
158
0.589694
false
2.770631
false
false
false
mtat76/atm-py
build/lib/atmPy/tools/array_tools.py
6
1730
__author__ = 'htelg' import numpy as np def find_closest(array, value, how = 'closest'): """Finds the element of an array which is the closest to a given number and returns its index Arguments --------- array: array The array to search thru. value: float or array-like. Numbe...
mit
8,900,942,322,819,626,000
31.055556
117
0.57341
false
3.896396
false
false
false
Pandaaaa906/ChemErpSystem
WriteTogether/models.py
1
3000
# coding=utf-8 from __future__ import unicode_literals from django.db import models from annoying.fields import AutoOneToOneField # Create your models here. from myModule.models import BaseModel # Module Sub Table class POEnter(BaseModel): date = models.DateField("入库时间", null=True, blank=True, default=None) ...
apache-2.0
8,379,369,047,054,286,000
28.810526
110
0.618997
false
2.92562
false
false
false
mamico/scorched
setup.py
1
1650
from __future__ import unicode_literals import os from setuptools import setup, find_packages version = '0.10.2.dev0' here = os.path.abspath(os.path.dirname(__file__)) README = open(os.path.join(here, 'README.rst')).read() CHANGES = open(os.path.join(here, 'CHANGES.rst')).read() setup(name='scorched', version...
mit
-8,879,737,559,352,127,000
34.106383
72
0.549091
false
4.177215
false
true
false
ahkab/ahkab
doc/misc/script.py
1
1792
import numpy as np import ahkab from ahkab import ahkab, circuit, time_functions mycircuit = circuit.Circuit(title="Butterworth Example circuit", filename=None) gnd = mycircuit.get_ground_node() mycircuit.add_resistor("R1", n1="n1", n2="n2", value=600) mycircuit.add_inductor("L1", n1="n2", n2="n3", value=15.24e-3) m...
gpl-2.0
-5,841,700,942,468,074,000
32.811321
91
0.684152
false
2.336375
false
true
false
rafaelcalixto/PortfolioManager
SetupVerInfos.py
1
26764
import tkinter as tk from tkinter import ttk from tkinter import messagebox import ast import SetupTela as st import LoadInfos as li class SetupVerInfos(): def __init__(self, Portfolio): self.fontTitulo = ('Arial Black', 12) self.fontCampos = ('Verdana', 10) self.fontBotao = ('...
gpl-3.0
-6,577,217,393,939,468,000
49.604247
275
0.571733
false
3.001797
true
false
false
twelch/caribnode
caribnode/tools/admin.py
1
2243
# -*- coding: utf-8 -*- ######################################################################### # # Copyright (C) 2012 The Nature Conservancy # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, ...
gpl-3.0
4,112,284,610,052,705,300
40.537037
183
0.652251
false
3.750836
false
false
false
Caranarq/01_Dmine
03_UsoDeSuelo/P0306/P0306.py
1
3377
# -*- coding: utf-8 -*- """ Started on wed, jan 24th, 2018 @author: carlos.arana """ # Librerias utilizadas import pandas as pd import sys module_path = r'D:\PCCS\01_Dmine\Scripts' if module_path not in sys.path: sys.path.append(module_path) from VarInt.VarInt import VarInt from classes.Meta import Meta from Com...
gpl-3.0
6,051,856,568,612,477,000
40.530864
120
0.656956
false
2.984916
false
true
false
Yuudachimoe/HikariChun-RedBot
lib/discord/emoji.py
17
4040
# -*- coding: utf-8 -*- """ The MIT License (MIT) Copyright (c) 2015-2016 Rapptz 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 u...
gpl-3.0
-5,780,559,452,924,165,000
36.757009
85
0.560644
false
4.243697
false
false
false
aavrug/askbot-devel
askbot/user_messages/context_processors.py
3
1423
""" Context processor for lightweight session messages. Time-stamp: <2008-07-19 23:16:19 carljm context_processors.py> """ from django.utils.encoding import StrAndUnicode from askbot.user_messages import get_and_delete_messages def user_messages (request): """ Returns session messages for the current sessio...
gpl-3.0
4,742,643,398,012,042,000
25.351852
70
0.649332
false
4.065714
false
false
false
MaKToff/SPbSU_Homeworks
Semester 7/Natural language processing/lang_config.py
1
1145
# languages that our classifier will cover language_codes = ["be", "bg", "ru", "sr", "uk"] language_descriptions = { "be": "Belorussian", "bg": "Bulgarian", "ru": "Russian", "sr": "Serbian", "uk": "Ukrainian"} language_alphabet = { 'be': 'абвгдеёжзійклмнопрстуўфхцчшыьэюя', 'bg': 'абвгдежзи...
mit
-3,470,268,755,278,445,000
23.675
59
0.661601
false
2.268966
false
false
false
datastore/datastore.memcached
datastore/memcached/__init__.py
1
1905
__version__ = '0.1.1' __author__ = 'Juan Batiz-Benet' __email__ = 'juan@benet.ai' __doc__ = ''' memcached datastore implementation. Tested with: * datastore 0.3.0 * memcached 1.4.5 * libmemcached 0.50 * pylibmc 1.2.2 ''' #TODO: Implements queries using a key index. #TODO: Implement TTL (and key configuratio...
mit
55,231,411,572,019,416
25.09589
80
0.657743
false
3.993711
false
false
false
amauboussin/arxiv-twitterbot
tweet_papers.py
1
6860
from email.MIMEMultipart import MIMEMultipart from email.MIMEText import MIMEText import smtplib from time import sleep import pandas as pd import requests import tweepy from constants import MAX_TWEET_LENGTH, PAST_PREDICTIONS_PATH, TWEET_THRESHOLD, TIME_BETWEEN_TWEETS from credentials import access_token, access_tok...
mit
3,402,905,096,927,873,000
37.324022
121
0.630175
false
3.325254
false
false
false
TheJacksonLaboratory/osdf_submit
scripts/match_names_by_ids.py
1
4503
#!/opt/compsci/python/3.4.2/bin/python3.4 # -*- coding: utf-8 -*- import os import re import csv import logging import time #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Functional ~~~~~ # Log It! def log_it(logname=os.path.basename(__file__), logdir="logs"): """log_it setup""" curtime = time...
gpl-3.0
1,259,320,902,611,223,000
32.355556
84
0.557406
false
3.660976
false
false
false
bbc/kamaelia
Sketches/JMB/Logger/Log.py
3
7081
# -*- coding: utf-8 -*- # Copyright 2010 British Broadcasting Corporation and Kamaelia Contributors(1) # # (1) Kamaelia Contributors are listed in the AUTHORS file and at # http://www.kamaelia.org/AUTHORS - please extend this file, # not this notice. # # Licensed under the Apache License, Version 2.0 (the "Lice...
apache-2.0
4,666,330,729,123,999,000
36.078534
87
0.582686
false
4.301944
false
false
false
jacquev6/Pynamixel
Pynamixel/devices/fields.py
1
1758
# coding: utf8 # Copyright 2015 Vincent Jacques <vincent@vincent-jacques.net> from ..instructions import ReadData class R8(object): def __init__(self, system, ident, address): self.__system = system self.__ident = ident self.__address = address def read(self): ident, error, ...
mit
7,312,465,467,499,182,000
29.310345
107
0.602958
false
3.708861
false
false
false
outini/sandcrawler
libraries/sc_pythongen.py
1
2653
# -*- coding: iso-latin-1 -*- """ Simple module to display python code """ __docformat__ = 'restructuredtext en' __author__ = "Denis 'jawa' Pompilio" __credits__ = "Denis 'jawa' Pompilio" __license__ = "GPLv3" __maintainer__ = "Denis 'jawa' Pompilio" __email__ = "denis.pompilio@gmail.com" __status__ = "Development" d...
gpl-3.0
4,610,201,145,526,515,000
23.33945
56
0.522051
false
3.396927
false
false
false