repo_name
stringlengths
5
92
path
stringlengths
4
221
copies
stringclasses
19 values
size
stringlengths
4
6
content
stringlengths
766
896k
license
stringclasses
15 values
hash
int64
-9,223,277,421,539,062,000
9,223,102,107B
line_mean
float64
6.51
99.9
line_max
int64
32
997
alpha_frac
float64
0.25
0.96
autogenerated
bool
1 class
ratio
float64
1.5
13.6
config_test
bool
2 classes
has_no_keywords
bool
2 classes
few_assignments
bool
1 class
etianen/moody-templates
src/moody/loader.py
1
5355
"""A caching template loader that allows disk-based templates to be used.""" import os, sys from abc import ABCMeta, abstractmethod class TemplateDoesNotExist(Exception): """A named template could not be found.""" class Source(metaclass=ABCMeta): """A source of template data.""" __slots...
bsd-3-clause
-6,064,786,215,887,489,000
30.692308
129
0.580579
false
4.743136
false
false
false
ewjoachim/pyler
pyler/euler_test_base.py
1
2100
import signal import unittest import time from . import website as w class EulerProblem(unittest.TestCase): problem_id = None def solver(self, input_val): raise NotImplementedError() simple_input = None simple_output = None real_input = None def solve_real(self): """ ...
mit
8,948,021,599,226,098,000
26.631579
78
0.57381
false
4.487179
true
false
false
almeidapaulopt/frappe
frappe/model/db_query.py
1
21364
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors # MIT License. See license.txt from __future__ import unicode_literals from six import iteritems, string_types """build query for doclistview and return results""" import frappe, json, copy, re import frappe.defaults import frappe.share import fra...
mit
-5,802,090,927,492,263,000
32.43349
120
0.66921
false
3.140379
false
false
false
ratzeni/vcf-miner.client
setup.py
1
1546
import os from setuptools import setup, find_packages here = os.path.abspath(os.path.dirname(__file__)) with open(os.path.join(here, 'VERSION')) as f: __version__ = f.read().strip() with open(os.path.join(here, 'requirements.txt')) as f: required = f.read().splitlines() with open(os.path.join(here, 'README....
mit
-9,032,565,296,916,977,000
31.893617
63
0.575679
false
3.7343
false
false
false
marcuschia/ShaniXBMCWork
script.video.F4mProxy/lib/f4mDownloader.py
1
49882
# -*- coding: utf-8 -*- import xml.etree.ElementTree as etree import base64 from struct import unpack, pack import sys import io import os import time import itertools import xbmcaddon import xbmc import urllib2,urllib import traceback import urlparse import posixpath import re import hmac import hashl...
gpl-2.0
-2,045,013,516,949,013,200
42.145133
548
0.494427
false
4.142679
false
false
false
lluisball/godenerg
axpert/charger.py
1
2546
from time import sleep from datetime import datetime, timedelta from axpert.protocol import ( CMD_REL, parse_inverter_conf, empty_inverter_conf, CmdSpec ) from axpert.settings import charger_conf from axpert.datalogger import get_avg_last FLOAT_VOL = charger_conf['float_voltage'] ABSORB_VOL = charger_conf['absorb...
gpl-3.0
5,399,676,398,103,707,000
34.361111
79
0.569521
false
3.4083
false
false
false
wooster/framework_depviz
depviz.py
1
10369
#!/usr/bin/env python """ The MIT License (MIT) Copyright (c) 2013 Andrew Wooster 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...
mit
-6,358,658,463,639,979,000
43.311966
135
0.621564
false
4.031493
false
false
false
jsubpy/jsub
jsub/exts/repo/file_system.py
1
2428
import os import json import logging import fcntl from jsub.util import safe_mkdir from jsub.util import safe_rmdir from jsub.error import RepoReadError from jsub.error import TaskNotFoundError ID_FILENAME = 'id' class FileSystem(object): def __init__(self, param): self.__jsub_dir = os.path.expanduser(param.get...
mit
5,301,751,721,617,016,000
27.564706
107
0.656919
false
2.572034
false
false
false
sumihai-tekindo/account_sicepat
sicepat_erp/invoice_line_exp_cost/invoice_line_exp_cost.py
1
7446
# -*- coding: utf-8 -*- ############################################################################## # # Copyright (C) 2016 Pambudi Satria (<https://github.com/pambudisatria>). # @author Pambudi Satria <pambudi.satria@yahoo.com> # # This program is free software: you can redistribute it and/or modify ...
gpl-3.0
-6,949,873,827,119,664,000
58.048387
165
0.592399
false
3.734203
false
false
false
jzerbe/taskifier
taskifier/internal/__init__.py
1
3830
from datetime import datetime from django.core.exceptions import ObjectDoesNotExist import json from taskifier import const from taskifier.models import Task, TaskOwner from taskifier.internal.TaskPayloadHelper import TaskPayloadHelper def DELETE(task_owner, task_id): task = _get_task_by_id(task_id) if task...
bsd-3-clause
-939,080,448,045,002,200
35.132075
92
0.620627
false
3.630332
false
false
false
nss350/magPy
core/windowSelector.py
1
17249
""" Created on Thu Mar 24 08:18:04 2016 @author: npop The window selector calculates which global windows to use Calculates overlapping windows between given sites This removes the burden on the upcoming processor Upcoming processor can then simply get the data for the windows And process them """ import os from datet...
apache-2.0
-2,665,271,720,281,101,300
35.856838
222
0.681663
false
3.270573
false
false
false
amahabal/PySeqsee
farg/core/util.py
1
3569
# Copyright (C) 2011, 2012 Abhijit Mahabal # # 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 3 of the License, or (at your option) any later version. # # This program is distribu...
gpl-3.0
-742,354,667,693,318,000
32.046296
93
0.692351
false
3.656762
false
false
false
lbjay/cds-invenio
modules/bibformat/lib/bibformat_bfx_engine_config.py
1
5843
## This file is part of CDS Invenio. ## Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007, 2008 CERN. ## ## CDS Invenio 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 of the ## License, or (...
gpl-2.0
-8,086,134,669,331,546,000
49.808696
146
0.479719
false
3.445165
false
false
false
TurboTurtle/sos
sos/collector/__init__.py
1
54982
# Copyright Red Hat 2020, Jake Hunsaker <jhunsake@redhat.com> # This file is part of the sos project: https://github.com/sosreport/sos # # This copyrighted material is made available to anyone wishing to use, # modify, copy, or redistribute it subject to the terms and conditions of # version 2 of the GNU General Publi...
gpl-2.0
-8,600,018,873,667,082,000
42.258851
79
0.524299
false
4.396098
false
false
false
0x1001/BabyMonitor
app/add_finger_print.py
1
1251
def add_finger_print(file_path): import wave import analyzer import storage import recording import config import os a = analyzer.Analyzer() s = storage.Storage(config.Config("../config.json")) waveFile = wave.open(file_path) waveData = waveFile.readframes(waveFile.getnframes()...
gpl-2.0
-7,902,132,046,651,514,000
28.809524
119
0.643485
false
3.504202
false
false
false
benschneider/sideprojects1
density_matrix/fft_filter_test.py
1
1683
from scipy.signal.signaltools import _next_regular from matplotlib import pyplot as plt from numpy.fft import fft, rfftn, irfftn, fftshift # for real data can take advantage of symmetries import numpy as np import codecs, json # from scipy.signal import remez, freqz, lfilter # lpf = remez(21, [0, 0.2, 0.3, 0.5], [1.0, ...
gpl-2.0
-3,275,720,611,350,555,000
32
118
0.623886
false
2.256032
false
false
false
KhronosGroup/COLLADA-CTS
Core/Gui/Dialog/FSettingsScrolledSizer.py
1
3448
# Copyright (c) 2012 The Khronos Group Inc. # Permission is hereby granted, free of charge, to any person obtaining a copy of this software and /or associated documentation files (the "Materials "), to deal in the Materials without restriction, including without limitation the rights to use, copy, modify, merge, publis...
mit
8,386,046,570,576,897,000
48.271429
466
0.639211
false
4.299252
false
false
false
3upperm2n/DIGITS
tools/create_db.py
2
20860
#!/usr/bin/env python # Copyright (c) 2014-2015, NVIDIA CORPORATION. All rights reserved. import sys import os.path import time import argparse import logging import re import shutil import math import random from collections import Counter import threading import Queue try: import digits except ImportError: ...
bsd-3-clause
-4,733,648,372,469,106,000
31.492212
143
0.573058
false
3.97409
false
false
false
bgaultier/laboitepro
boites/migrations/0009_pushbutton.py
1
1086
# -*- coding: utf-8 -*- # Generated by Django 1.11.2 on 2017-09-06 07:31 from __future__ import unicode_literals from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): dependencies = [ ('boites', '0008_auto_20170801_1406'), ] operations ...
agpl-3.0
1,413,793,480,327,889,000
40.769231
149
0.627993
false
3.537459
false
false
false
krother/maze_run
leftovers/part2_before_pylint.py
1
11490
# TODO: fix and check all command-line arguments from util import debug_print from pygame import image, Rect, Surface from pygame.locals import KEYDOWN, KEYUP, USEREVENT import pygame import sys import random import json import os from collections import namedtuple from functools import partial import argparse import...
mit
-7,573,846,476,509,047,000
29.15748
95
0.573716
false
3.513761
false
false
false
neozerosv/ciberues
agente-servidor.py
1
2142
#!/usr/bin/env python # ------------------------------ # importacion # ------------------------------ import socket, sys, time, ConfigParser def poner_mensaje( tipo , mensaje ): # ----------------------------- # Colocar mensajes con formato # y marca de tiempo # ----------------------------- print time.strftime(...
gpl-2.0
6,846,871,219,183,194,000
31.953846
129
0.546218
false
2.906377
true
false
false
urq/awssql
shellsql.py
1
2032
import os import pickle import sys import click from shellsql import aws from shellsql.models import Dataset from shellsql.cache import TTLCache, FileCache from shellsql import utils @click.group() def cli(): pass @cli.command() def hello(): click.echo("hello world!") @cli.command() @click.argument('columns...
apache-2.0
-1,326,841,644,984,561,400
27.222222
74
0.656004
false
3.288026
false
false
false
vijayendrabvs/ssl-neutron
neutron/plugins/nec/ofc_driver_base.py
1
5143
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # # Copyright 2012 NEC Corporation. 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.or...
apache-2.0
7,191,177,591,923,439,000
36.268116
79
0.642815
false
4.236409
false
false
false
Lujeni/matterllo
core/models.py
1
3323
# -*- coding: utf-8 -*- from __future__ import unicode_literals from ast import literal_eval from django.db import models from django.conf import settings class Board(models.Model): name = models.CharField(max_length=100) webhook_activate = models.BooleanField(default=False) trello_board_id = models.Cha...
mit
9,003,355,092,251,951,000
30.647619
144
0.63858
false
3.754802
false
false
false
solus-project/evolve-sc
solus_sc/main_window.py
2
8096
#!/usr/bin/env python2 # -*- coding: utf-8 -*- # # This file is part of solus-sc # # Copyright © 2013-2018 Ikey Doherty <ikey@solus-project.com> # # 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 Founda...
gpl-2.0
-6,569,056,492,320,678,000
32.17623
80
0.627548
false
3.713303
false
false
false
bundgus/python-playground
sqlalchemy-playground/sqlalchemy-playground.py
1
4317
import sqlalchemy from sqlalchemy import create_engine from sqlalchemy import Table, Column, Integer, String, MetaData, ForeignKey from sqlalchemy.sql import select from sqlalchemy.sql import and_, or_, not_ from sqlalchemy.sql import text from sqlalchemy import func, desc print(sqlalchemy.__version__) engine = create...
mit
-1,070,303,591,381,381,500
26.496815
93
0.604587
false
3.245865
false
false
false
Horniman/Horniman_Hack
satalite/models.py
1
1056
"""Satalite date models""" from __future__ import division, absolute_import, print_function, unicode_literals from django.db import models from db import models as db_models class LogTempLive(models.Model): """Messages from Buoy""" sensor = models.ForeignKey(db_models.Sensor) processed = models.BooleanFie...
gpl-2.0
3,972,958,697,875,750,400
34.2
82
0.686553
false
3.259259
false
false
false
masaohamanaka/mbed
workspace_tools/targets.py
1
59025
""" mbed SDK Copyright (c) 2011-2015 ARM 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 applicable law or agreed to in writin...
apache-2.0
8,006,120,062,554,410,000
32.902929
147
0.573469
false
2.88659
false
false
false
myarjunar/QGIS
tests/src/python/test_qgsproject.py
1
5476
# -*- coding: utf-8 -*- """QGIS Unit tests for QgsProject. .. note:: 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 of the License, or (at your option) any later version. """ from b...
gpl-2.0
3,873,158,816,957,129,700
32.595092
104
0.620161
false
3.818689
true
false
false
eirnym/aiopg
examples/notify.py
1
1061
import asyncio import aiopg dsn = 'dbname=aiopg user=aiopg password=passwd host=127.0.0.1' async def notify(conn): async with conn.cursor() as cur: for i in range(5): msg = "message {}".format(i) print('Send ->', msg) await cur.execute("NOTIFY channel, '{}'".format(msg...
bsd-2-clause
5,568,833,685,149,267,000
26.205128
65
0.572102
false
3.858182
false
false
false
loveisbug/liveshow-sh
live.py
1
3864
# -*- coding: utf-8 -*- import urllib2 import HTMLParser from bs4 import BeautifulSoup import sys from datetime import * import re import smtplib from email.MIMEText import MIMEText def sendmail(subject, content): email_host = 'smtp host' email_user = 'sender email' email_pwd = 'sender pwd' maillist = ['example@12...
mit
4,368,484,991,240,511,500
35.742857
142
0.653447
false
2.65337
false
false
false
SamuelToh/pixelated-user-agent
service/test/unit/test_welcome_mail.py
1
2330
# # Copyright (c) 2014 ThoughtWorks, Inc. # # Pixelated is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # Pixelated is distrib...
agpl-3.0
6,749,108,892,892,384,000
30.917808
77
0.639056
false
4.02418
false
false
false
zhlinh/leetcode
0057.Insert Interval/solution.py
1
1441
#!/usr/bin/env python # -*- coding: utf-8 -*- ''' ***************************************** Author: zhlinh Email: zhlinhng@gmail.com Version: 0.0.1 Created Time: 2016-02-22 Last_modify: 2016-02-22 ****************************************** ''' ''' Given a set of non-overlapping intervals, ...
apache-2.0
-6,815,767,327,999,001,000
26.711538
72
0.529493
false
3.398585
false
false
false
shootstar/novatest
nova/api/openstack/compute/plugins/v3/cells.py
1
14865
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2011-2012 OpenStack Foundation # 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-2.0
837,730,049,796,058,100
34.141844
78
0.592398
false
4.072603
false
false
false
Upstream-Research/csv-tools
csv_tools/csv_prepend.py
1
11652
## Copyright (c) 2016-2017 Upstream Research, Inc. All Rights Reserved. ## ## Subject to an 'MIT' License. See LICENSE file in top-level directory ## ## #python-3.x ## python 2 does not work due mostly to issues with csv and io modules with unicode data help_text = ( "CSV-PREPEND tool version 20170918\n" ...
mit
-3,902,079,733,962,294,300
34.202417
101
0.495795
false
3.827858
false
false
false
Oleh-Hrebchuk/OpenVPN-TryFalse
vpn/models.py
1
3592
from django.db import models # Create your models here. class General(models.Model): class Meta: db_table = "general" permissions = (('admins', "admins manage all settings openvpn"),) general_vpn_name = models.TextField(max_length=200) general_project_name = models.TextField(max_length=20...
gpl-3.0
8,188,553,040,697,901,000
23.772414
74
0.679287
false
3.563492
false
false
false
jhh/puka
puka/middleware/debug.py
1
1769
import os from django.conf import settings from django.db import connection def terminal_width(): """ Function to compute the terminal width. WARNING: This is not my code, but I've been using it forever and I don't remember where it came from. """ width = 0 try: import fcntl ...
mit
3,804,612,522,956,817,400
28.983051
83
0.549463
false
4.020455
false
false
false
ashtonteng/squad_exp
SelfMatchingLayer.py
1
6757
import tensorflow as tf from tensorflow.contrib import rnn import os os.environ["TF_CPP_MIN_LOG_LEVEL"]="2" class SelfMatchingLayer(): def __init__(self, args, inputs, scope): print("building self-matching layer", scope) batch_size = args.batch_size vocab_size = args.vocab_size hid...
mit
-9,153,670,270,058,485,000
57.258621
229
0.631789
false
3.335143
false
false
false
google/nitroml
examples/config.py
1
1213
# Copyright 2020 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, ...
apache-2.0
6,816,562,970,263,589,000
38.129032
79
0.700742
false
3.436261
false
false
false
scopenco/hagent
lib/modules/ip/IpAddr.py
1
3971
#!/usr/bin/env python # -*- coding: UTF-8 -*- ''' Set of fuctions/classes for ip administration Author: Andrey Scopenco andrey@scopenco.net ''' import sys sys.path.insert(0, '/usr/local/hagent/lib') import logging from cli import Output from hagent_db import add_record, del_record, update_record, \ get_record_attr...
gpl-2.0
5,762,475,317,647,996,000
30.267717
78
0.498363
false
4.422049
false
false
false
KBNLresearch/iromlab
iromlab/kbapi/sru.py
1
12625
#! /usr/bin/env python """ Python API for KB SRU """ import sys import urllib import requests from lxml import etree SRU_BASEURL = 'http://jsru.kb.nl/sru/sru' SRU_BASEURL += '?version=1.2&maximumRecords=%i' SRU_BASEURL += '&operation=searchRetrieve' SRU_BASEURL += '&startRecord=%i' SRU_BASEURL += '&recordSchema=%s' S...
apache-2.0
-5,763,885,260,459,784,000
35.594203
106
0.515644
false
4.009209
false
false
false
klen/fquest
base/fquest/celery.py
1
2029
from __future__ import absolute_import from sqlalchemy.exc import IntegrityError, DataError from datetime import datetime, timedelta from celery import Celery from celery.utils.log import get_task_logger from flask import current_app as app from ..app import create_app logger = get_task_logger('fquest') if not a...
bsd-3-clause
-30,655,614,917,419,030
25.012821
125
0.637753
false
3.498276
false
false
false
shubhamjain0594/OthelloReinforcementLearning
nn.py
1
8833
import neurolab as nl import game2 import othello import ntuplesystematic as nts import time import random class nn: def __init__(self): self.x = [[-1,1] for x in range(64)] self.net = nl.net.newff(self.x,[1]) #self.net.trainf = nl.train.train_gd self.moveb = 0 self.movew = 0 self.last_vb = 0 self.last...
gpl-2.0
-5,274,029,948,232,391,000
22.744624
174
0.510246
false
2.476311
false
false
false
cjdinsmore/slack-karma-bot
sqlite_helper.py
1
2956
import sqlite3 from models import DbMessage, DbUser, ReactionNames class SqliteHelper(object): """ This class manages interfacing with the SQLite database. It stores DbUser and DbMessage objects (see: models.py). """ def __init__(self, db_file): self.connection = sqlite3.connect(db_...
mit
-4,904,182,541,421,417,000
32.213483
95
0.569012
false
4.094183
false
false
false
VertNet/api
Download/CountHandler.py
1
3989
# This file is part of VertNet: https://github.com/VertNet/webapp # # VertNet 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 3 of the License, or # (at your option) any later version. # # VertN...
gpl-2.0
-9,069,144,461,149,763,000
31.169355
72
0.601655
false
4.029293
false
false
false
UMD-DRASTIC/drastic-web
webdav/resources.py
1
6514
from os import path as ospath from datetime import datetime from djangodav.fs.resources import BaseFSDavResource from djangodav.utils import url_join from drastic.models import Collection, Resource, DataObject import logging logging.warn('WEBDAV has been loaded') CHUNK_SIZE = 1048576 def chunkstring(string, lengt...
agpl-3.0
-4,060,378,795,736,630,300
32.927083
90
0.548204
false
4.45859
false
false
false
chrisRubiano/django_reportes
config/settings/local.py
1
2241
# -*- coding: utf-8 -*- """ Local settings - Run in Debug mode - Use console backend for emails - Add Django Debug Toolbar - Add django-extensions as app """ import socket import os from .base import * # noqa # DEBUG # ------------------------------------------------------------------------------ DEBUG = env.bool...
mit
205,409,767,345,248,540
29.283784
99
0.481481
false
4.142329
false
false
false
roboime/pyroboime
roboime/core/skills/orientto.py
1
2436
# # Copyright (C) 2013-2015 RoboIME # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as # published by the Free Software Foundation, either version 3 of the # License, or (at your option) any later version. # # This program is distrib...
agpl-3.0
2,438,896,582,819,734,000
33.309859
102
0.65353
false
3.510086
false
false
false
matthagy/Jamenson
jamenson/transform/globals.py
1
4950
'''Transform operation on globally scoped symbols to operations on symbol_cell mapping. ''' from __future__ import absolute_import from __future__ import with_statement from ..runtime.symbol import get_symbol_cells_map, gensym from ..compiler import ir as I from ..compiler import bind from ..compiler.walk import I...
apache-2.0
-3,855,520,096,124,097,500
36.218045
99
0.573131
false
3.91924
false
false
false
ari-zah/gaiasky
assets/scripts/tests/camera-path-sync.py
1
1065
# This script tests the synchronous camera file playing. # Created by Toni Sagrista import time, os from py4j.java_gateway import JavaGateway, GatewayParameters gateway = JavaGateway(gateway_parameters=GatewayParameters(auto_convert=True)) gs = gateway.entry_point # Prints to both Gaia Sky and Python logs def printa...
lgpl-3.0
-7,236,454,278,470,441,000
23.204545
78
0.738028
false
3.160237
false
false
false
rob-nn/motus
gait_loader.py
1
2787
from numpy import * class DataLoader(object): def __init__(self, file_name): self._data = None self._file_name = file_name self._load_data() self._data_descs =[] self._generate_data_descs() def _load_data(self): f = open(self._file_name) data = f.readlines() f.close() j = 0 data_list = []...
gpl-2.0
-6,392,789,390,617,272,000
30.314607
88
0.642268
false
2.921384
false
false
false
mariocesar/django-tricks
django_tricks/models/abstract.py
1
2638
from uuid import uuid4 from django.contrib.contenttypes.models import ContentType from django.db import models from django.utils.functional import cached_property from django.utils.translation import gettext_lazy as _ from .mixins import MPAwareModel treebeard = True try: from treebeard.mp_tree import MP_Node e...
isc
4,206,543,305,950,345,000
29.321839
97
0.655042
false
4.070988
false
false
false
jamielennox/requests-mock
requests_mock/adapter.py
1
10629
# Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under ...
apache-2.0
-4,611,116,238,172,673,500
32.215625
79
0.581428
false
4.643512
false
false
false
netinept/plog
plog/storages/settings_s3boto.py
1
1207
# S3Boto storage settings for photologue example project. import os DEFAULT_FILE_STORAGE = 'plog.storages.s3utils.MediaS3BotoStorage' STATICFILES_STORAGE = 'plog.storages.s3utils.StaticS3BotoStorage' try: # If you want to test the example_project with S3, you'll have to configure the # environment variables ...
apache-2.0
-7,196,048,099,957,750,000
40.655172
91
0.727423
false
3.438746
false
false
false
Bhare8972/LOFAR-LIM
LIM_scripts/utilities.py
1
11289
#!/usr/bin/env python3 ##ON APP MACHINE import sys from os import listdir, mkdir from os.path import isdir, dirname, abspath import os import subprocess import weakref from scipy import fftpack import numpy as np ## some global variables, this needs to be fixed at some point default_raw_data_loc = None#"/exp_app...
mit
-6,915,917,853,648,077,000
29.349462
141
0.60776
false
2.893873
false
false
false
fintech-circle/edx-platform
openedx/core/djangoapps/auth_exchange/forms.py
1
4033
""" Forms to support third-party to first-party OAuth 2.0 access token exchange """ import provider.constants from django.contrib.auth.models import User from django.forms import CharField from edx_oauth2_provider.constants import SCOPE_NAMES from oauth2_provider.models import Application from provider.forms import OAu...
agpl-3.0
-3,508,841,061,231,892,500
36
106
0.598562
false
4.557062
false
false
false
nicolaselie/pykuli
keyboard/mac.py
1
5816
#Copyright 2013 Paul Barton # #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 3 of the License, or #(at your option) any later version. # #This program is distributed in the hope tha...
gpl-3.0
-165,510,983,904,530,620
27.935323
115
0.585798
false
3.162588
false
false
false
rgayon/plaso
plaso/cli/status_view.py
1
18822
# -*- coding: utf-8 -*- """The status view.""" from __future__ import unicode_literals import ctypes import sys import time try: import win32api import win32console except ImportError: win32console = None from dfvfs.lib import definitions as dfvfs_definitions import plaso from plaso.cli import tools from pl...
apache-2.0
-2,176,070,529,547,022,800
33.855556
80
0.660663
false
3.797821
false
false
false
ktneely/ir-scripts
VulnMgmt/Vuln-tickets.py
1
9151
#!/usr/bin/python3 # This takes an XML report extracted from an OpenVAS VA scanner and # creates issue tickets on ServiceNow and Redmine systems for tracking # purposes. # # Most parameters are specified in the 'ov_prefs.txt' file, however, # the XML report file may be specified on the command line. If # specified th...
gpl-3.0
3,450,388,158,392,082,000
35.899194
103
0.635013
false
3.758111
false
false
false
easyw/kicad-3d-models-in-freecad
cadquery/FCAD_script_generator/4UCON_17809/cq_models/conn_4ucon_17809.py
1
10895
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # # CadQuery script to generate connector models ## requirements ## freecad (v1.5 and v1.6 have been tested) ## cadquery FreeCAD plugin (v0.3.0 and v0.2.0 have been tested) ## https://github.com/jmwright/cadquery-freecad-module ## This script can be run from within the...
gpl-2.0
7,542,962,034,964,685,000
38.908425
134
0.616246
false
3.378295
false
false
false
lavizhao/keyword
data_analysis/ana_words.py
1
1087
#coding: utf-8 import sys def morethan(keyword,n): """ Arguments: - `keyword`: - `n`: """ ans = 0 for line in keyword: if len(line.split()) - 1 <= n : ans += 1 print "少余%s的词占总的百分比为%s"%(n,1.0*ans/len(keyword)) def aw(kf,nc): """ """ f = open(kf) ...
apache-2.0
-7,799,968,741,795,487,000
16.40678
71
0.484907
false
2.798365
false
false
false
a10networks/a10sdk-python
a10sdk/core/waf/waf_wsdl.py
2
1276
from a10sdk.common.A10BaseClass import A10BaseClass class Wsdl(A10BaseClass): """Class Description:: Manage Web Services Definition Language files. Class wsdl supports CRUD Operations and inherits from `common/A10BaseClass`. This class is the `"PARENT"` class for this module.` :param uuid: ...
apache-2.0
6,820,183,366,621,144,000
33.486486
252
0.631661
false
3.687861
false
false
false
jasonrbriggs/stomp.py
tests/test_basic.py
1
8361
import signal from time import monotonic import stomp from stomp.listener import TestListener from .testutils import * @pytest.fixture() def testlistener(): yield TestListener("123", print_to_log=True) @pytest.fixture() def conn(testlistener): conn = stomp.Connection11(get_default_host()) conn.set_list...
apache-2.0
-6,242,501,988,846,949,000
35.995575
101
0.640115
false
3.849448
true
false
false
phiros/nepi
src/nepi/resources/linux/ns3/ccn/ns3ccnrdceapplication.py
1
9256
# # NEPI, a framework to manage network experiments # Copyright (C) 2014 INRIA # # 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 3 of the License, or # (at your ...
gpl-3.0
6,438,432,219,293,200,000
39.243478
87
0.611927
false
3.782591
false
false
false
cswaney/hfttools
prickle/core.py
1
65651
import numpy as np import pandas as pd from matplotlib import pyplot as plt import struct import h5py import time import os class Database(): """Connection to an HDF5 database storing message and order book data. Parameters ---------- path : string Specifies location of the HDF5 file name...
mit
8,576,444,294,337,752,000
36.861015
232
0.489086
false
3.925556
false
false
false
conejoninja/pelisalacarta
python/main-classic/channels/vepelis.py
1
18213
# -*- coding: utf-8 -*- #------------------------------------------------------------ # pelisalacarta - XBMC Plugin # Canal para VePelis # http://blog.tvalacarta.info/plugin-xbmc/pelisalacarta/ #------------------------------------------------------------ import urlparse,urllib2,urllib,re import os, sys from core imp...
gpl-3.0
6,332,740,761,873,854,000
55.691589
283
0.652599
false
3.148988
false
false
false
smn/malva
malva/utils.py
1
1658
# -*- test-case-name: malva.tests.test_utils -*- from twisted.internet.serialport import SerialPort from twisted.internet.defer import DeferredList, Deferred from twisted.internet import reactor from txgsm import txgsm from serial.tools import list_ports class ModemProbe(object): protocol = txgsm.TxGSMProtoco...
bsd-3-clause
5,435,535,710,121,342,000
28.607143
57
0.638721
false
3.829099
false
false
false
codycollier/netropy
netropy/record.py
1
2678
"""record The record data structure and helper functions. """ import collections import hashlib # ----------------------------------------------------------------------------- # The main data structure # ----------------------------------------------------------------------------- record_fields = ['version', 'fr...
mit
-1,230,551,760,263,086,600
28.428571
79
0.558626
false
4.799283
false
false
false
jerpat/csmake
csmake-manifest/CsmakeModules/CsversionHLinuxConfigApt.py
1
3468
# <copyright> # (c) Copyright 2017 Hewlett Packard Enterprise Development LP # # 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 3 of the License, or (at your # option) any later ve...
gpl-3.0
2,895,465,660,196,402,700
45.24
80
0.647636
false
4.308075
false
false
false
cemoody/lda2vec
lda2vec/negative_sampling.py
1
7611
import numpy import six from chainer import cuda from chainer import function from chainer.utils import type_check class NegativeSamplingFunction(function.Function): ignore_label = -1 def __init__(self, sampler, sample_size): self.sampler = sampler self.sample_size = sample_size def _m...
mit
-4,506,923,810,108,634,600
31.665236
79
0.496518
false
3.51385
false
false
false
seraphln/onedrop
crawler/api_proxy.py
1
5434
# coding=utf8 # """ 跟远程API服务器交互的通用逻辑 """ import os import json import socket import urllib import datetime import requests import traceback import config API_HOST = "http://180.76.149.212:8083" GRAPHQL_HOST = "%s/graphql?query=%%s" % API_HOST def to_url_params(params): """ 根据GET参数的请求对URL进行编码 ...
gpl-3.0
1,172,086,396,405,874,000
23.528571
83
0.481359
false
3.47738
false
false
false
pytn/pytn
pytn/proposals/models.py
1
1067
from django.db import models from symposion.proposals.models import ProposalBase class Proposal(ProposalBase): AUDIENCE_LEVEL_NOVICE = 1 AUDIENCE_LEVEL_EXPERIENCED = 2 AUDIENCE_LEVEL_INTERMEDIATE = 3 AUDIENCE_LEVELS = [ (AUDIENCE_LEVEL_NOVICE, "Novice"), (AUDIENCE_LEVEL_INTE...
mit
4,846,354,523,018,538,000
26.358974
230
0.677601
false
3.67931
false
false
false
PhilHarnish/forge
src/puzzle/problems/crossword/cryptic_problem.py
1
10923
import collections from data import chain, crossword, warehouse from data.alphabets import cryptic_keywords from puzzle.problems.crossword import _base_crossword_problem class CrypticProblem(_base_crossword_problem._BaseCrosswordProblem): def __init__(self, name, lines, **kwargs): super(CrypticProblem, self)._...
mit
-3,694,395,314,970,705,000
33.457413
81
0.657786
false
3.596641
false
false
false
mpetyx/energagement
energagement/myapp/migrations/0014_auto_20150823_1721.py
1
4241
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations class Migration(migrations.Migration): dependencies = [ ('myapp', '0013_auto_20150731_0044'), ] operations = [ migrations.RemoveField( model_name='building', ...
mit
-554,861,424,052,546,050
27.273333
107
0.500354
false
4.403946
false
false
false
davidraleigh/cxxtest
python/cxxtest/cxxtest_misc.py
1
2691
#!/usr/bin/python #------------------------------------------------------------------------- # CxxTest: A lightweight C++ unit testing library. # Copyright (c) 2008 Sandia Corporation. # This software is distributed under the LGPL License v2.1 # For more information, see the COPYING file in the top CxxTest directory. #...
lgpl-2.1
1,456,833,161,039,569,400
33.5
74
0.578595
false
3.597594
false
false
false
liviu-/ding
ding/ding.py
1
4914
#!/usr/bin/env python """Simple CLI beep tool""" from __future__ import unicode_literals from __future__ import print_function import re import os import sys import time import datetime import argparse VERSION = '2.1.0' N_BEEPS = 4 WAIT_BEEPS = 0.15 def relative_time(arg): """Validate user provided relative t...
mit
-4,648,106,790,088,834,000
32.202703
98
0.59361
false
3.903098
false
false
false
keithadavidson/ansible-mezzanine
deploy/scripts/set_mezzanine_settings.py
1
1811
#!/usr/bin/env python # The MIT License (MIT) # # Copyright (c) 2015 Keith Davidson # # 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 ri...
mit
-3,355,165,800,266,858,500
39.244444
80
0.773606
false
3.788703
false
false
false
Crompulence/cpl-library
utils/design_topology/CFD.py
1
4796
import numpy as np import matplotlib.pyplot as plt from mpi4py import MPI from cplpy import CPL from draw_grid import draw_grid class CFD(): def __init__(self, npxyz, xyzL, xyz_orig, ncxyz): #initialise MPI and CPL self.comm = MPI.COMM_WORLD self.CPL = CPL() self.CFD_COMM = sel...
gpl-3.0
-1,381,466,288,594,465,300
34.791045
101
0.541076
false
2.910194
false
false
false
caterinaurban/Typpete
typpete/unittests/inference/generic_test.py
1
1346
# type_params {'generic_tolist': ['GTL'], 'flatten': ['FL'], 'flatten_dict': ['DK','DV']} def generic_tolist(a): return [a] u = generic_tolist(1.2) u[0] = 2.4 v = generic_tolist(True) v2 = v[v[0]] def flatten(lists): """ Flattens a list of lists into a flat list """ return [item for sublist in ...
mpl-2.0
5,171,939,318,511,768,000
21.830508
89
0.520802
false
2.888412
false
false
false
hedvig/project-config
zuul/openstack_functions.py
1
2255
# Copyright 2013 OpenStack Foundation # # 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...
apache-2.0
-4,446,275,520,323,971,000
40.759259
119
0.636807
false
3.350669
false
false
false
linearregression/socorro
socorro/external/es/supersearch.py
1
19711
# This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this # file, You can obtain one at http://mozilla.org/MPL/2.0/. import datetime import re from elasticsearch_dsl import Search, A, F, Q from elasticsearch.exceptions import NotFoundErr...
mpl-2.0
1,042,928,458,989,342,600
35.981238
79
0.488205
false
4.89836
true
false
false
fabian0010/Blaze
pyasn1/type/namedval.py
1
2701
# # This file is part of pyasn1 software. # # Copyright (c) 2005-2017, Ilya Etingof <etingof@gmail.com> # License: http://pyasn1.sf.net/license.html # # ASN.1 named integers # from pyasn1 import error __all__ = ['NamedValues'] class NamedValues(object): def __init__(self, *namedValues): self.nameToValIdx...
mit
7,432,628,266,542,734,000
27.431579
99
0.569789
false
3.730663
false
false
false
jmeyers314/jtrace
batoid/coordTransform.py
1
3059
from . import _batoid from .coordSys import CoordSys import numpy as np class CoordTransform: """Transformation between two coordinate systems. Parameters ---------- fromSys : CoordSys Origin coordinate systems. toSys : CoordSys Destination coordinate systems. """ def __in...
bsd-2-clause
-2,283,730,100,674,697,700
24.705882
73
0.552141
false
4.485337
false
false
false
tparks5/tor-stem
test/integ/installation.py
1
5352
""" Tests installation of our library. """ import glob import os import shutil import sys import tarfile import threading import unittest import stem import stem.util.system import test.util from test.util import only_run_once INSTALL_MISMATCH_MSG = "Running 'python setup.py sdist' doesn't match our git contents i...
lgpl-3.0
474,349,562,360,036,700
31.634146
178
0.674327
false
3.616216
true
false
false
alq666/sre-kpi
monitors.py
1
1349
"""Summarizes the monitor reports from Datadog into key metrics """ import csv import os import sqlite3 import sys # Prepare the sqlite file for queries # A denormalized version of the csv try: os.remove('monitors.sqlite') except: pass conn = sqlite3.connect('monitors.sqlite') c = conn.cursor() c.execute("""...
mit
1,948,408,615,343,619,800
23.527273
136
0.650852
false
3.211905
false
false
false
OzFlux/PyFluxPro
scripts/pfp_gfALT.py
1
64336
# standard modules import logging import os import traceback # 3rd party modules import dateutil import numpy import matplotlib.pyplot as plt import pylab import scipy import statsmodels.api as sm # PFP modules from scripts import constants as c from scripts import pfp_io from scripts import pfp_ts from scripts import ...
bsd-3-clause
3,962,994,394,770,090,000
52.792642
153
0.613529
false
3.332436
false
false
false
sravel/scripts
local/make_ldhatfiles.py
1
14611
#!/usr/bin/python2.7 # -*- coding: utf-8 -*- # @package make_ldhatfiles.py # @author Lea Picard, Sebastien RAVEL """ The make_ldhatfiles script ========================== :author: Sebastien Ravel, Lea Picard :contact: sebastien.ravel@cirad.fr :date: 08/07/2016 :version: 0.1 Script description ----------------...
gpl-3.0
7,221,963,836,876,002,000
31.826966
304
0.64629
false
3.119368
false
false
false
project-rig/rig
rig/place_and_route/place/rcm.py
1
6479
"""Reverse Cuthill-McKee based placement. """ from collections import defaultdict, deque from six import itervalues from rig.place_and_route.place.sequential import place as sequential_place from rig.links import Links from rig.netlist import Net def _get_vertices_neighbours(nets): """Generate a listing of eac...
gpl-2.0
-5,137,749,699,306,870,000
34.994444
79
0.656737
false
4.021726
false
false
false
electionleaflets/electionleaflets
electionleaflets/apps/boundaries/views.py
1
4341
import math from PIL import Image, ImageDraw from django.http import HttpResponse, Http404 from django.shortcuts import render_to_response from boundaries.models import Boundary from parties.models import Party from leaflets.models import Leaflet google_dist = 20037508.34 def leaflet_polygon_options(boundary): ...
mit
428,706,416,601,348,300
36.102564
146
0.601705
false
3.308689
false
false
false
sajuptpm/neutron-ipam
neutron/tests/unit/metaplugin/fake_plugin.py
1
2680
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # # Copyright 2012, Nachi Ueno, NTT MCL, 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/L...
apache-2.0
3,253,998,093,902,717,000
34.263158
78
0.65
false
3.764045
false
false
false
rwatson/chromium-capsicum
tools/grit/grit/xtb_reader.py
1
3972
#!/usr/bin/python2.4 # Copyright (c) 2006-2008 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. '''Fast and efficient parser for XTB files. ''' import sys import xml.sax import xml.sax.handler class XtbContentHandler(xm...
bsd-3-clause
-5,619,635,609,388,487,000
33.241379
81
0.674723
false
3.768501
false
false
false
mindis/canteen
canteen/core/meta.py
1
9304
# -*- coding: utf-8 -*- ''' canteen meta core ~~~~~~~~~~~~~~~~~ metaclass tools and APIs. :author: Sam Gammon <sam@keen.io> :copyright: (c) Keen IO, 2013 :license: This software makes use of the MIT Open Source License. A copy of this license is included as ``LICENSE.md`` in the ...
mit
-6,218,907,525,932,880,000
30.013333
156
0.576849
false
4.232939
false
false
false
pypa/twine
tests/test_main.py
1
1168
# Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the L...
apache-2.0
-8,956,839,330,193,934,000
39.275862
88
0.735445
false
3.792208
false
false
false
gilliM/MFQ
ModisFromQgis/help/source/conf.py
1
7118
# -*- coding: utf-8 -*- # # ModisFromQgis documentation build configuration file, created by # sphinx-quickstart on Sun Feb 12 17:11:03 2012. # # This file is execfile()d with the current directory set to its containing dir. # # Note that not all possible configuration values are present in this # autogenerated file. #...
gpl-2.0
1,405,499,702,715,317,000
31.953704
80
0.709609
false
3.711157
true
false
false
SavinaRoja/Kerminal
kerminal/telemachus_api.py
1
13310
# encoding: utf-8 #The information in this module was gleaned from DataLinkHandlers.cs #https://github.com/richardbunt/Telemachus/blob/master/Telemachus/src/DataLinkHandlers.cs #Actions are sent to server, result in one action per message mj_actions = ['mj.smartassoff', # Smart ASS Off 'mj.node', ...
gpl-3.0
2,619,396,659,809,475,000
52.24
111
0.456123
false
4.066606
false
false
false
YoungKwonJo/mlxtend
mlxtend/plotting/remove_chartchunk.py
1
1051
# Sebastian Raschka 08/13/2014 # mlxtend Machine Learning Library Extensions # matplotlib utilities for removing chartchunk def remove_borders(axes, left=False, bottom=False, right=True, top=True): """ A function to remove chartchunk from matplotlib plots, such as axes spines, ticks, and labels. ...
bsd-3-clause
-849,386,927,102,821,400
35.241379
94
0.591817
false
3.849817
false
false
false
johnaparker/dynamics
examples/old/leap_semistable.py
1
8602
import numpy as np import matplotlib as mpl import matplotlib.pyplot as plt from matplotlib import animation from scipy import constants def rotation_transform(axis, angle, ax = None): if ax is None: ax = plt.gca() t_scale = ax.transData t_rotate = mpl.transforms.Affine2D().rotate_deg_around(axis[0], axis[...
mit
8,537,241,411,429,405,000
33.270916
194
0.58126
false
2.625763
false
false
false
bendk/thesquirrel
docs/forms.py
1
1624
# thesquirrel.org # # Copyright (C) 2015 Flying Squirrel Community Space # # thesquirrel.org is free software: you can redistribute it and/or modify it # under the terms of the GNU Affero General Public License as published by the # Free Software Foundation, either version 3 of the License, or (at your # option) any la...
agpl-3.0
-4,625,286,531,913,107,000
33.553191
78
0.666256
false
4.009877
false
false
false
kenik/pyrcp
pyrcp/user.py
1
2065
# -* coding: utf-8 -*- from hashlib import md5 from pyrcp import * import pyrcp.db as pydb from flask import Flask, request, redirect, render_template from flask_login import (LoginManager, login_required, login_user, current_user, logout_user, UserMixin, AnonymousUserMixin) from itsdangerous i...
gpl-2.0
2,577,444,483,230,044,700
25.818182
91
0.607264
false
3.903592
false
false
false
NoNameYet07/421_521_final_project
BEERdunio_modules_kg1_sp.py
1
6285
# bin/usr/python # Setting up GPIO pins from time import sleep import RPi.GPIO as GPIO GPIO.setmode(GPIO.BOARD) # Identifies the pin numbers to the pi GPIO.setwarnings(False) GPIO.setup(3, GPIO.OUT) # Should sets pin #3 as an output...but doesnt work yet GPIO.setup(3, GPIO.LOW) # Turns initial output for pin 3 off ...
gpl-2.0
-4,553,099,314,612,198,000
32.972973
119
0.449642
false
4.435427
false
false
false