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
SahilTikale/haas
examples/dbinit.py
2
1653
#!/usr/bin/python """ Register nodes with HIL. This is intended to be used as a template for either creating a mock HIL setup for development or to be modified to register real-life nodes that follow a particular pattern. In the example environment for which this module is written, there are 10 nodes which have IPMI ...
apache-2.0
1,030,338,861,592,609,900
29.611111
78
0.678766
false
3.19112
false
false
false
tobast/sysres-pikern
snake/snake_common.py
1
1643
SERVER_PORT = 31412 PSIZE = 20 WIDTH = 30 HEIGHT = 30 PERIOD = 100 def p2add(u, v): return (u[0] + v[0], u[1] + v[1]) DIRS = [(0, 1), (1, 0), (-1, 0), (0, -1)] NB_APPLES = 3 class Packet: def __init__(self, data = b''): self.start_index = 0 self.data = data def add_position(self, p): ...
gpl-3.0
71,077,579,929,375,590
20.906667
55
0.522215
false
2.872378
false
false
false
jolyonb/edx-platform
lms/djangoapps/course_api/blocks/tests/test_forms.py
1
8460
""" Tests for Course Blocks forms """ from urllib import urlencode import ddt from django.http import Http404, QueryDict from opaque_keys.edx.locator import CourseLocator from rest_framework.exceptions import PermissionDenied from openedx.core.djangoapps.util.test_forms import FormTestMixin from student.models import...
agpl-3.0
6,443,629,654,869,371,000
34.39749
114
0.635697
false
3.748339
true
false
false
famish99/pyvisa-sim
pyvisa_sim/tcpip.py
1
2280
# -*- coding: utf-8 -*- """ pyvisa-sim.tcpip ~~~~~~~~~~~~~~~~ TCPIP simulated session class. :copyright: 2014 by PyVISA-sim Authors, see AUTHORS for more details. :license: MIT, see LICENSE for more details. """ import time from pyvisa import constants from . import sessions class BaseTCPIPSes...
mit
-8,203,132,260,625,480,000
29.4
87
0.623684
false
3.68932
false
false
false
waynewolf/abucket
from-tf-web/quickstart/1-get-started-tf-contrib-learn-customize.py
1
1494
import numpy as np import tensorflow as tf # Declare list of features, we only have one real-valued feature def model(features, labels, mode): # Build a linear model and predict values W = tf.get_variable("W", [1], dtype=tf.float64) b = tf.get_variable("b", [1], dtype=tf.float64) y = W*features['x'] + b # Los...
mit
-8,651,862,507,716,371,000
37.307692
90
0.670683
false
2.912281
false
false
false
MadsJensen/agency_connectivity
tf_functions.py
1
5293
""" Functions for TF analysis. @author: mje @email: mads [] cnru.dk """ import mne from mne.time_frequency import (psd_multitaper, tfr_multitaper, tfr_morlet, cwt_morlet) from mne.viz import iter_topography import matplotlib.pyplot as plt import numpy as np def calc_psd_epochs(epochs...
bsd-3-clause
6,559,354,453,207,024,000
27.005291
79
0.543737
false
3.871982
false
false
false
termNinja/Conversion-of-Regex-into-Automatons
pyscripts/classes/resources.py
1
18835
import re, os, sys from Queue import Queue # ----------------------------------------------------------------------------- class term_colors: """ Usage: print term_colors.WARNING + "This is a msg" + term_colors.ENDC """ HEADER = '\033[95m' OKBLUE = '\033[94m' OKGREEN = '\033[92m' WARNING = '\033[93m...
gpl-3.0
-8,287,676,522,294,573,000
38.239583
109
0.45219
false
4.267105
false
false
false
saurabh6790/frappe
frappe/core/doctype/user/user.py
1
39931
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors # MIT License. See license.txt from __future__ import unicode_literals, print_function from bs4 import BeautifulSoup import frappe import frappe.share import frappe.defaults import frappe.permissions from frappe.model.document import Document from ...
mit
-1,635,436,983,036,877,300
31.306634
213
0.69565
false
3.128163
false
false
false
jacebrowning/dropthebeat
setup.py
1
2371
#!/usr/bin/env python """Setup script for DropTheBeat.""" import os import sys import setuptools PACKAGE_NAME = 'dtb' MINIMUM_PYTHON_VERSION = 3, 4 def check_python_version(): """Exit when the Python version is too low.""" if sys.version_info < MINIMUM_PYTHON_VERSION: sys.exit("Python {}.{}+ is r...
lgpl-3.0
5,393,324,607,916,161,000
29.397436
78
0.609869
false
4.018644
false
false
false
MeanEYE/Sunflower
sunflower/gui/preferences/toolbar.py
1
8025
import json from gi.repository import Gtk from sunflower.widgets.settings_page import SettingsPage class Column: NAME = 0 DESCRIPTION = 1 TYPE = 2 ICON = 3 CONFIG = 4 class ToolbarOptions(SettingsPage): """Toolbar options extension class""" def __init__(self, parent, application): SettingsPage.__init__(se...
gpl-3.0
-8,279,819,229,029,512,000
30.470588
91
0.694704
false
3.016917
true
false
false
raiden-network/raiden
raiden/utils/notifying_queue.py
1
1422
from typing import Generic, Iterable, List, TypeVar from gevent.event import Event from gevent.queue import Queue T = TypeVar("T") class NotifyingQueue(Event, Generic[T]): """This is not the same as a JoinableQueue. Here, instead of waiting for all the work to be processed, the wait is for work to be availa...
mit
7,711,695,073,187,145,000
28.020408
77
0.580169
false
3.812332
false
false
false
pwarren/AGDeviceControl
agdevicecontrol/tests/test_aggregator.py
1
9428
# AGDeviceControl # Copyright (C) 2005 The Australian National University # # This file is part of AGDeviceControl. # # AGDeviceControl 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 L...
gpl-2.0
-369,536,809,628,326,600
30.851351
122
0.655176
false
4.480989
true
false
false
vallemrv/tpvB3
tpv_for_eetop/valle_libs/valleorm/models/relatedfields.py
1
9703
# -*- coding: utf-8 -*- # @Author: Manuel Rodriguez <vallemrv> # @Date: 29-Aug-2017 # @Email: valle.mrv@gmail.com # @Last modified by: valle # @Last modified time: 18-Feb-2018 # @License: Apache license vesion 2.0 import sys import inspect import importlib from constant import constant class RelationShip(object...
apache-2.0
-2,517,989,328,502,603,300
37.351779
99
0.547356
false
3.673987
false
false
false
sassoftware/saspy
saspy/sasiocom.py
1
37140
# # Copyright SAS Institute # # 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
6,462,494,287,132,911,000
38.135933
154
0.575229
false
4.042669
false
false
false
CindyvdVries/News_Crawler
Sat2/sat/pipelines.py
1
2575
# -*- coding: utf-8 -*- # Define your item pipelines here # # Don't forget to add your pipeline to the ITEM_PIPELINES setting # See: http://doc.scrapy.org/en/latest/topics/item-pipeline.html from scrapy.utils.conf import get_config from scrapy.exceptions import DropItem import pika.credentials import pika import json ...
gpl-3.0
1,274,635,759,553,769,500
30.024096
80
0.593398
false
4.17342
false
false
false
PieterMostert/Lipgloss
model/serializers/oxideserializer.py
1
2233
import json try: from lipgloss.core_data import Oxide except: from ..lipgloss.core_data import Oxide class OxideSerializer(object): """A class to support serializing/deserializing of a single oxide and dictionaries of oxides. Needs improvement""" @staticmethod def get_serializable_oxide(oxide): ...
gpl-3.0
1,879,315,643,800,368,000
39.6
119
0.653829
false
3.897033
false
false
false
kulbirsaini/pdfrw-fork
examples/rl1/booklet.py
1
1588
#!/usr/bin/env python ''' usage: booklet.py my.pdf Uses Form XObjects and reportlab to create booklet.my.pdf. Demonstrates use of pdfrw with reportlab. ''' import sys import os from reportlab.pdfgen.canvas import Canvas import find_pdfrw from pdfrw import PdfReader from pdfrw.buildxobj import pagexobj from pd...
mit
5,298,639,258,305,954,000
22.014493
77
0.595718
false
3.113725
false
false
false
varunarya10/oslo.utils
oslo_utils/tests/test_reflection.py
1
8493
# -*- coding: utf-8 -*- # Copyright (C) 2012 Yahoo! Inc. 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...
apache-2.0
-899,403,400,105,379,200
29.44086
79
0.601554
false
3.991071
true
false
false
yukaritan/qtbot3
qtbot3_service/plugins/achievements.py
1
2926
from util import irc from util.garbage import rainbow from util.handler_utils import prehook, get_value, set_value, get_target, cmdhook, fetch_all from qtbot3_common.types.message import Message disconnection_ladder = { 1: "Connection reset by peer", 5: "Connection reset by beer", 10: "Connection reset by...
gpl-3.0
-309,478,902,671,180,200
32.25
92
0.598086
false
3.42623
false
false
false
CobwebOrg/cobweb-django
core/migrations/0014_auto_20181026_1019.py
1
1216
# Generated by Django 2.1.2 on 2018-10-26 17:19 from django.db import migrations, models import django.utils.timezone class Migration(migrations.Migration): dependencies = [ ('core', '0013_user_terms_accepted'), ] operations = [ migrations.AddField( model_name='organization'...
mit
243,347,793,550,178,400
28.658537
93
0.570724
false
4.405797
false
false
false
lmorchard/django-teamwork
teamwork/templatetags/teamwork_tags.py
1
3741
""" ``django-teamwork`` template tags, loaded like so: {% load teamwork_tags %} """ from __future__ import unicode_literals from django import template from django.contrib.auth import get_user_model from django.contrib.auth.models import Group, AnonymousUser from django.template import get_library from django.temp...
mpl-2.0
7,748,176,117,772,263,000
31.25
82
0.624967
false
3.825153
false
false
false
summychou/TBTracker
src/TBTracker_Gui/TBTracker_Gui_Button.py
1
4941
# -*- coding: utf-8 -*- from PyQt5.QtCore import QCoreApplication from PyQt5.QtGui import QIcon from PyQt5.QtWidgets import QPushButton ''' @author : Zhou Jian @email : zhoujian@hust.edu.cn @version : V1.1 @date : 2018.04.22 ''' class BaseButton(QPushButton): ''' 基类按钮 ''' def __init__(self, name...
mit
4,804,963,411,780,969,000
17.836283
64
0.547099
false
2.576877
false
false
false
AlexStarov/Shop
applications/discount/management/commands/processing_actions.py
1
6004
# -*- coding: utf-8 -*- from django.core.management.base import BaseCommand from applications.product.models import Category, Product from applications.discount.models import Action __author__ = 'Alex Starov' class Command(BaseCommand, ): def handle(self, *args, **options): try: action_cate...
apache-2.0
-2,092,252,847,127,148,000
51.525253
109
0.527115
false
3.13253
false
false
false
d120/pyfeedback
src/feedback/migrations/0043_auto_20190618_2221.py
1
8403
# -*- coding: utf-8 -*- # Generated by Django 1.11.21 on 2019-06-18 22:21 from __future__ import unicode_literals from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): dependencies = [ ('feedback', '0042_auto_20180608_1423'), ] operatio...
agpl-3.0
591,802,522,073,656,600
58.992857
324
0.57233
false
3.771441
false
false
false
mskala/birdie
birdieapp/utils/media.py
1
4300
# -*- coding: utf-8 -*- # Copyright (C) 2013-2014 Ivo Nunes/Vasco Nunes # 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 versio...
gpl-3.0
2,320,095,578,948,772,000
33.126984
77
0.594651
false
3.43725
false
false
false
wenxichen/tensorflow_yolo2
src/img_dataset/ilsvrc2017_cls.py
1
7175
"""ILSVRC 2017 Classicifation Dataset. DEPRECATED version. For the purpose of keeping history only. Use ilsvrc2017_cls_multithread.py instead. """ import os import cv2 import numpy as np import random import config as cfg class ilsvrc_cls: def __init__(self, image_set, rebuild=False, data_aug=True): se...
mit
-763,985,578,201,332,100
39.767045
90
0.522509
false
3.905825
false
false
false
oss/rutgers-repository-utils
lib/repoclosure.py
1
11619
#!/usr/bin/python -t # 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. # # This program is distributed in the hope that i...
gpl-2.0
6,160,217,929,008,276,000
36.846906
192
0.560117
false
4.096968
true
false
false
dominikgiermala/properties-editor
src/properties_editor.py
1
5314
import os import sublime import sublime_plugin from .lib.pyjavaproperties import Properties class AddEditPropertiesCommand(sublime_plugin.WindowCommand): def run(self, paths = []): # TODO: validate if *.properties file self.paths = paths self.window.show_input_panel("Properties to add/edit:", '', self.on...
mit
-4,607,190,421,713,108,000
38.664179
119
0.649417
false
3.361164
false
false
false
SIPp/pysipp
pysipp/launch.py
1
5708
""" Launchers for invoking SIPp user agents """ import subprocess import os import shlex import select import threading import signal import time from . import utils from pprint import pformat from collections import OrderedDict, namedtuple log = utils.get_logger() Streams = namedtuple("Streams", "stdout stderr") c...
gpl-2.0
-7,029,735,260,306,038,000
32.576471
83
0.563595
false
4.452418
false
false
false
Khan/pyobjc-framework-FSEvents
setup.py
1
1152
''' Wrappers for the "FSEvents" API in MacOS X. The functions in this framework allow you to reliably observe changes to the filesystem, even when your program is not running al the time. These wrappers don't include documentation, please check Apple's documention for information on how to use this framework and PyObj...
mit
-8,843,281,425,080,310,000
33.909091
76
0.684896
false
3.611285
false
false
false
maxmind/GeoIP2-python
tests/webservice_test.py
1
12944
#!/usr/bin/env python # -*- coding: utf-8 -*- import asyncio import copy import ipaddress import json import sys from typing import cast, Dict import unittest sys.path.append("..") # httpretty currently doesn't work, but mocket with the compat interface # does. from mocket import Mocket # type: ignore from mocket.p...
apache-2.0
-4,090,489,454,764,451,300
32.020408
88
0.584518
false
3.698286
true
false
false
pbl-cloud/paas-manager
paas_manager/app/util/gmail.py
1
1115
import sys import smtplib from email.mime.text import MIMEText from email.utils import formatdate from ... import config def create_message(from_addr, to_addr, subject, message, encoding): body = MIMEText(message, 'plain', encoding) body['Subject'] = subject body['From'] = from_addr body['To'] = to_add...
mit
-1,493,291,774,116,415,200
24.340909
76
0.612556
false
3.308605
false
false
false
jkomiyama/duelingbanditlib
gather.py
1
1151
#!/usr/bin/env python # coding:utf-8 #a tool for merging multiple simulation results import sys,os,re def avg(elems): return sum(elems)/float(len(elems)) def splitavg(splits): l = len(splits[0]) for sp in splits: if len(sp) != l: print "split size not match" sys.exit() sums = [0 for i in ran...
mit
-3,247,382,617,199,091,000
24.577778
94
0.591659
false
2.8775
false
false
false
jadsonjs/DataScience
python/arrays_dimesion.py
1
2664
# Consider the case where you have one sequence of multiple time steps and one feature. from numpy import array data = array([0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1.0]) # We can then use the reshape() function on the NumPy array to reshape this one-dimensional array # into a three-dimensional array with 1...
apache-2.0
-1,277,704,131,615,162,400
25.64
139
0.631381
false
2.648111
false
false
false
SegundoBob/GNXrepeats
hrngpS2.py
1
1831
#!/usr/bin/python #coding=utf-8 #@+leo-ver=5-thin #@+node:bob07.20140715160011.1575: * @file hrngpS2.py #@@first #@@first #@@language python #@@tabwidth -4 import os import sys import leo.core.leoBridge as leoBridge from leo_lib import lib_leo03 #@+others #@+node:bob07.20140715160011.1576: ** gnxRepeats() def gnxRe...
mit
6,549,371,217,770,367,000
27.609375
103
0.647187
false
2.653623
false
false
false
SINGROUP/pycp2k
pycp2k/classes/_opt_ri_basis3.py
1
1543
from pycp2k.inputsection import InputSection class _opt_ri_basis3(InputSection): def __init__(self): InputSection.__init__(self) self.Delta_i_rel = None self.Delta_ri = None self.Eps_deriv = None self.Max_iter = None self.Num_func = None self.Basis_size = No...
lgpl-3.0
7,370,216,220,963,202,000
24.716667
181
0.552819
false
3.269068
false
false
false
uglyfruitcake/Axelrod
axelrod/tests/unit/test_cooperator.py
1
1499
"""Test for the cooperator strategy.""" import axelrod from .test_player import TestPlayer C, D = axelrod.Actions.C, axelrod.Actions.D class TestCooperator(TestPlayer): name = "Cooperator" player = axelrod.Cooperator expected_classifier = { 'memory_depth': 0, 'stochastic': False, ...
mit
-220,543,415,429,763,360
27.283019
74
0.588392
false
3.301762
true
false
false
souravbadami/oppia
core/storage/base_model/gae_models.py
1
36051
# Copyright 2014 The Oppia 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 applicable ...
apache-2.0
8,921,728,561,893,953,000
38.100868
98
0.618596
false
4.546727
false
false
false
pettarin/penelope
setup.py
1
2657
#!/usr/bin/env python # coding=utf-8 """ Set penelope package up """ from setuptools import Extension from setuptools import setup __author__ = "Alberto Pettarin" __copyright__ = "Copyright 2012-2016, Alberto Pettarin (www.albertopettarin.it)" __license__ = "MIT" __version__ = "3.1.3" __email__ = "alberto@albertopet...
mit
-1,803,094,169,845,251,800
31.012048
125
0.572074
false
3.924668
false
false
false
DomainDrivenConsulting/dogen
projects/masd.dogen.dia/python/add_to_package.py
1
1625
# -*- mode: python; tab-width: 4; indent-tabs-mode: nil -*- # # Copyright (C) 2012-2015 Marco Craveiro <marco.craveiro@gmail.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 Foundation; either version...
gpl-3.0
-5,694,978,738,083,802,000
37.690476
70
0.675077
false
4.072682
false
false
false
kikocorreoso/mplutils
mplutils/axes.py
1
8516
# -*- coding: utf-8 -*- """ Created on Sun Feb 21 23:43:37 2016 @author: kiko """ from __future__ import division, absolute_import from .settings import RICH_DISPLAY import numpy as np if RICH_DISPLAY: from IPython.display import display def axes_set_better_defaults(ax, axes_color ...
mit
-877,875,270,445,470,800
36.685841
80
0.588539
false
3.95174
false
false
false
ancafarcas/superdesk-core
superdesk/media/media_operations.py
1
5561
# -*- coding: utf-8; -*- # # This file is part of Superdesk. # # Copyright 2013, 2014 Sourcefabric z.u. and contributors. # # For the full copyright and license information, please see the # AUTHORS and LICENSE files distributed with this source code, or # at https://www.sourcefabric.org/superdesk/license import arro...
agpl-3.0
2,342,765,068,469,414,000
30.95977
115
0.660133
false
3.656147
false
false
false
FirmlyReality/docklet
src/master/testTaskMgr.py
2
5417
import master.taskmgr from concurrent import futures import grpc from protos.rpc_pb2 import * from protos.rpc_pb2_grpc import * import threading, json, time, random from utils import env class SimulatedNodeMgr(): def get_batch_nodeips(self): return ['0.0.0.0'] class SimulatedMonitorFetcher(): def __init__(self,...
bsd-3-clause
-676,241,921,716,462,500
27.067358
149
0.690419
false
2.918642
false
false
false
fastinetserver/portage-idfetch
pym/portage/cache/sql_template.py
1
9336
# Copyright: 2005 Gentoo Foundation # Author(s): Brian Harring (ferringb@gentoo.org) # License: GPL2 import sys from portage.cache import template, cache_errors from portage.cache.template import reconstruct_eclasses class SQLDatabase(template.database): """template class for RDBM based caches This class is desig...
gpl-2.0
8,476,169,925,880,248,000
30.434343
114
0.678877
false
3.053974
true
false
false
Ryex/Rabbyt
rabbyt/sprites.py
1
6567
from rabbyt._sprites import cBaseSprite, cSprite from rabbyt._rabbyt import pick_texture_target from rabbyt.anims import anim_slot, swizzle, Animable from rabbyt.primitives import Quad class BaseSprite(cBaseSprite, Animable): """ ``BaseSprite(...)`` This class provides some basic functionality fo...
mit
-8,949,477,883,439,346,000
35.525714
78
0.559769
false
3.908929
false
false
false
aronasorman/kolibri
kolibri/logger/serializers.py
1
2680
from kolibri.logger.models import AttemptLog, ContentRatingLog, ContentSessionLog, ContentSummaryLog, MasteryLog, UserSessionLog from rest_framework import serializers class ContentSessionLogSerializer(serializers.ModelSerializer): class Meta: model = ContentSessionLog fields = ('pk', 'user', 'co...
mit
401,927,789,942,079,940
39.606061
141
0.680597
false
4.135802
false
false
false
SAAVY/magpie
client/blacklist.py
1
1546
from flask import current_app from netaddr import IPNetwork, IPAddress from netaddr.core import AddrFormatError bl_website_ip = [] # array of tuples (network mask, port) def build_website_blacklist(logger): with open("config/blacklist_website_ip.txt") as f: for line in f: network_address = ...
mit
-8,088,540,729,857,940,000
36.707317
108
0.574386
false
4.270718
false
false
false
pycrystem/pycrystem
pyxem/tests/test_signals/test_power2d.py
1
3662
# -*- coding: utf-8 -*- # Copyright 2017-2019 The pyXem developers # # This file is part of pyXem. # # pyXem 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 optio...
gpl-3.0
3,197,397,849,401,754,000
35.62
77
0.647733
false
3.326067
true
false
false
McGillX/edx_data_research
edx_data_research/parsing/parse_course_structure.py
1
4815
import json from edx_data_research.parsing.parse import Parse class CourseStructure(Parse): def __init__(self, args): super(CourseStructure, self).__init__(args) self.collections = ['course_structure'] self.course_structure_file = args.course_structure_file self.drop = a...
mit
5,415,329,089,375,148,000
46.636364
125
0.538525
false
4.143718
false
false
false
lizardsystem/threedilib
threedilib/modeling/convert.py
1
8275
# (c) Nelen & Schuurmans. GPL licensed, see LICENSE.rst. # -*- coding: utf-8 -*- """ Convert shapefiles with z coordinates. Choose from the following formats: 'inp' to create an inp file, 'img' to create an image with a plot of the feature, or 'shp' to output a shapefile with the average height of a feature stored in ...
gpl-3.0
6,584,589,084,668,582,000
32.1
77
0.570997
false
3.927385
false
false
false
holzenburg/feedshare
feedshare/feedlists/migrations/0002_auto__add_feedlistfeed__del_field_feed_feedlist__del_field_feed_tags__.py
1
8074
# -*- coding: utf-8 -*- from south.utils import datetime_utils as datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Adding model 'FeedListFeed' db.create_table(u'feedlists_feedlistfeed', ...
mit
8,905,969,177,572,606,000
56.269504
180
0.614194
false
3.607685
false
false
false
RealP/Everpy
examples.py
1
1776
"""Some examples of how to use modules.""" # from everpy_extras import EverPyExtras from everpy_pro import EverPyPro import everpy_utilities PATH_TO_ENSCRIPT = r"C:\Program Files (x86)\Evernote\Evernote\ENScript.exe" def createnote(epy): """Example of how to make a note from python.""" content = open("READM...
gpl-3.0
-8,499,846,340,086,754,000
33.823529
169
0.662162
false
3.338346
false
false
false
Stemer114/Reprap_KTY-84-130
repetier/KTY84-130_repetier.py
1
1879
# based on python script from # http://diyhpl.us/reprap/trunk/users/wizard23/python/lookupTables/KTY84-130.py # # adapted by Stemer114 for usage with 4.7k pull-up resistor # table format for repetier firmware # https://github.com/Stemer114/Reprap_KTY-84-130 # # generates a Lookuptable for the following termistor # KT...
mit
9,178,785,433,663,180,000
24.391892
109
0.722193
false
2.727141
false
false
false
cs411-entree-app/entree
entree_project/entree_project/urls.py
1
1445
"""entree_project URL Configuration The `urlpatterns` list routes URLs to views. For more information please see: https://docs.djangoproject.com/en/1.9/topics/http/urls/ Examples: Function views 1. Add an import: from my_app import views 2. Add a URL to urlpatterns: url(r'^$', views.home, name='home') Cl...
apache-2.0
-1,928,786,586,874,997,500
35.125
79
0.692734
false
3.424171
false
false
false
Ruide/angr-dev
angr/angr/blade.py
1
12198
import networkx import pyvex from .slicer import SimSlicer class Blade(object): """ Blade is a light-weight program slicer that works with networkx DiGraph containing CFGNodes. It is meant to be used in angr for small or on-the-fly analyses. """ def __init__(self, graph, dst_run, dst_stmt_idx, d...
bsd-2-clause
6,807,302,043,918,270,000
34.876471
120
0.542712
false
3.948851
false
false
false
blomquisg/heat
heat/common/client.py
1
21833
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2010-2011 OpenStack, LLC # 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...
apache-2.0
-8,148,688,654,965,902,000
35.880068
79
0.573032
false
4.439406
true
false
false
Kriechi/mitmproxy
mitmproxy/addons/tlsconfig.py
1
12516
import os from pathlib import Path from typing import List, Optional, TypedDict, Any from OpenSSL import SSL from mitmproxy import certs, ctx, exceptions, connection from mitmproxy.net import tls as net_tls from mitmproxy.options import CONF_BASENAME from mitmproxy.proxy import context from mitmproxy.proxy.layers impo...
mit
-6,556,963,244,387,718,000
42.762238
119
0.622803
false
3.723892
true
false
false
Carreau/difflib2.py
examples/lcs_cutmodule.py
1
5199
from __future__ import print_function from array import array from itertools import islice def lcs_cut2(s1, s2, lcs_low_bound=0, bg=None, debug=False): """Compule the length of the LCS 2 sequences s1 and s2. lcs_low_bound : (int), hint of lower bound for the lenght of the lcs to search for. Default to...
bsd-3-clause
-6,169,857,475,565,440,000
36.956204
79
0.476053
false
3.8369
false
false
false
myriadrf/pyLMS7002M
pyLMS7002M/LimeSDRMini.py
1
11270
#*************************************************************** #* Name: LimeSDRMini.py #* Purpose: Class implementing LimeSDRMini functions #* Author: Lime Microsystems () #* Created: 2018-04-16 #* Copyright: Lime Microsystems (limemicro.com) #* License: #**************************************************...
apache-2.0
-7,336,002,023,781,494,000
34.329154
130
0.536823
false
3.78569
false
false
false
rgblabs/rgbTools
rgbTools/utils/filesystem.py
1
2692
import maya.cmds as cmds def which (program): ''' If application is found, returns path. This works with both full application paths, and applications available within the OS's defined PATH ''' import os def is_exe (fpath): return os.path.isfile(fpath) and os.access(fpath, os.X_OK) ...
mit
-6,761,105,692,595,262,000
28.911111
81
0.635587
false
3.403287
false
false
false
sevagas/macro_pack
src/vbLib/Base64ToText.py
1
1559
VBA = \ r""" Function Base64ToText(ByVal vCode) Dim oXML, oNode Dim tempString As String tempString = "Msxm" tempString = tempString & "l2.DO" tempString = tempString & "MDoc" tempString = tempString & "ument.3.0" Set oXML = CreateObject(tempString) Set oNode = oXML.CreateElement("base6...
apache-2.0
-7,680,315,020,665,851,000
27.87037
62
0.695959
false
3.676887
false
false
false
wevoice/wesub
apps/socialauth/views.py
1
12656
from django.shortcuts import render_to_response, redirect from django.contrib import messages from django.template import RequestContext from django.contrib.auth import authenticate, login from django.http import HttpResponseRedirect, HttpResponse from django.core.urlresolvers import reverse from django.conf import set...
agpl-3.0
7,060,478,658,976,568,000
41.469799
145
0.656606
false
4.200465
false
false
false
itu-oss-project-team/oss-github-analysis-project
github_analysis_tool/analyzer/tf-idf.py
1
3362
import os.path import sys sys.path.append(os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))) from math import log10 import yaml from github_analysis_tool.services.database_service import DatabaseService class Tfidf: def __init__(self, secret_config): # Generate a github_reques...
mit
8,553,894,782,115,481,000
34.020833
120
0.594289
false
3.735556
false
false
false
hirokihamasaki/irma
frontend/frontend/api/v1_1/controllers/files.py
1
7314
# Copyright (c) 2013-2016 Quarkslab. # This file is part of IRMA project. # # 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 in the top-level directory # of this distribution and at: # # http://...
apache-2.0
4,231,076,620,459,806,000
34.852941
101
0.613071
false
3.76622
false
false
false
qisanstudio/qsapp-suibe
src/suibe/models/channel.py
1
3718
# -*- coding: utf-8 -*- from __future__ import unicode_literals from jinja2 import Markup from flask import url_for from studio.core.engines import db from sqlalchemy.ext.hybrid import hybrid_property from suibe.models.article import ArticleModel __all__ = [ 'NaviChannelModel', 'ChannelModel', 'ChannelSu...
mit
-6,052,231,150,220,093,000
31.060345
78
0.600861
false
4.050109
false
false
false
martinohanlon/pgzero-pong
pong.py
1
3151
from math import sin, cos, radians from time import sleep #setup the constants WIDTH = 500 HEIGHT = 300 BALLSPEED = 10 PADDLESPEED = 5 MAXBOUNCEANGLE = 75 def reset_game(angle): #setup ball properties ball.pos = WIDTH / 2, HEIGHT / 2 ball.x_float = float(ball.x) ball.y_float = float(ball.y) ball....
mit
6,057,346,098,873,700,000
25.478992
87
0.569026
false
3.026897
false
false
false
zqqf16/SYM
SYM/Models/models.py
1
1880
#!/usr/bin/env python # -*- coding: UTF-8 -*- import re import sys import json import requests def get_raw(url): r = requests.get(url) if r.status_code != 200: return None return r.text def parse_models(regex, text): result = [] lastModel = "" model_regex = re.compile(r'.*\d,\d') ...
mit
1,235,590,171,324,613,600
22.5125
98
0.55
false
3.208191
false
false
false
iamsteadman/bambu-api
bambu_api/__init__.py
1
1314
""" Quickly expose your models to a JSON or XML API, authenticated via HTTP or OAuth. """ __version__ = '2.0.1' from bambu_api.options import * from bambu_api.sites import APISite from bambu_api.exceptions import APIException from bambu_api.decorators import argument, returns, named from django.conf import settings f...
apache-2.0
-4,812,282,785,063,941,000
31.04878
100
0.690259
false
3.910714
false
false
false
azumimuo/family-xbmc-addon
plugin.video.bubbles/resources/lib/sources/german/hoster/open/moviesever.py
1
5229
# -*- coding: utf-8 -*- """ Bubbles Addon Copyright (C) 2016 Viper2k4 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...
gpl-2.0
-8,893,008,589,265,289,000
40.84
174
0.552113
false
3.469808
false
false
false
ShashaQin/frappe
frappe/email/bulk.py
1
11335
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors # MIT License. See license.txt from __future__ import unicode_literals import frappe import HTMLParser import smtplib from frappe import msgprint, throw, _ from frappe.email.smtp import SMTPServer, get_outgoing_email_account from frappe.email.email_b...
mit
8,331,891,317,508,942,000
34.870253
166
0.727305
false
3.308523
true
false
false
fake-name/ReadableWebProxy
WebMirror/management/rss_parser_funcs/feed_parse_extractMaddertranslatesCom.py
1
1779
def extractMaddertranslatesCom(item): ''' Parser for 'maddertranslates.com' ''' vol, chp, frag, postfix = extractVolChapterFragmentPostfix(item['title']) if not (chp or vol) or "preview" in item['title'].lower(): return None tagmap = [ ('Form A Slaves Only Harem Guild', 'An ...
bsd-3-clause
8,159,679,789,587,798,000
52.939394
217
0.589657
false
3.325234
false
false
false
chincisan/google-python-exercises
basic/string1.py
1
3560
#!/usr/bin/python -tt # Copyright 2010 Google Inc. # Licensed under the Apache License, Version 2.0 # http://www.apache.org/licenses/LICENSE-2.0 # Google's Python Class # http://code.google.com/edu/languages/google-python-class/ # Basic string exercises # Fill in the code for the functions below. main() is already se...
apache-2.0
-8,113,552,083,929,637,000
29.689655
78
0.666011
false
3.114611
true
false
false
WillianPaiva/1flow
oneflow/base/templatetags/base_utils.py
1
6677
# -*- coding: utf-8 -*- """ Copyright 2012-2014 Olivier Cortès <oc@1flow.io> This file is part of the 1flow project. 1flow 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 versio...
agpl-3.0
7,640,967,080,721,701,000
27.279661
116
0.574318
false
4.057143
false
false
false
Keats/gutenberg
components/site/benches/gen.py
1
5070
""" Generates test sites for use in benchmark. Tested with python3 and probably does not work on Windows. """ import datetime import os import random import shutil TAGS = ["a", "b", "c", "d", "e", "f", "g"] CATEGORIES = ["c1", "c2", "c3", "c4"] PAGE = """ +++ title = "Hello" date = REPLACE_DATE [taxonomies] tags = ...
mit
-6,960,706,027,240,699,000
27.806818
121
0.641223
false
2.849916
false
false
false
salcho/antares
ui/loggerWidget.py
1
1137
#!/usr/bin/env python import gtk import logging import time from ui.IWidget import IWidget from core.data import logger from core.log import addStreamHandler #TODO: Implement file-like thread to show logging! class loggerWidget(IWidget): def __init__(self): IWidget.__init__(self) self.frame = gtk.Frame('Logger...
mit
3,276,869,649,480,475,600
24.863636
59
0.737907
false
2.930412
false
false
false
zestyr/lbry
lbrynet/dht/msgtypes.py
1
1593
#!/usr/bin/env python # # This library is free software, distributed under the terms of # the GNU Lesser General Public License Version 3, or any later version. # See the COPYING file included in this archive # # The docstrings in this module contain epytext markup; API documentation # may be created by processing this...
mit
4,668,161,594,579,503,000
32.1875
93
0.670433
false
4.148438
false
false
false
shalzuth/BraveHaxvius
IDAScripts/GetNetworkKeys.py
1
2891
from idautils import * from idaapi import * def get_string(addr): out = "" while True: if Byte(addr) != 0: out += chr(Byte(addr)) else: break addr += 1 return out def get_string_from_head(head): refs = DataRefsFrom(head) for ref in refs: refs2 = DataRefsFrom(ref) for ref2 in refs2: stringval...
mit
-4,050,094,355,223,870,000
31.863636
101
0.684192
false
3.105263
false
false
false
eRestin/MezzGIS
mezzanine/conf/forms.py
1
3040
from __future__ import unicode_literals from future.builtins import int from collections import defaultdict from django import forms from django.utils.safestring import mark_safe from django.utils.translation import ugettext_lazy as _ from django.template.defaultfilters import urlize from mezzanine.conf import setti...
bsd-2-clause
8,096,700,865,729,011,000
35.190476
79
0.565789
false
4.293785
false
false
false
volab/pyvorcv
setup.py
1
3971
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # VoR-CV # The MIT License # # Copyright (c) 2010,2015 Jeremie DECOCK (http://www.jdhp.org) # # 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 ...
mit
7,094,162,803,281,906,000
32.940171
123
0.684211
false
3.927794
false
false
false
robertnishihara/ray
python/ray/dashboard/node_stats.py
1
13362
from collections import defaultdict from ray.dashboard.util import to_unix_time, format_reply_id from base64 import b64decode import ray import threading import json import traceback import copy import logging from datetime import datetime import time from typing import Dict import re from operator import itemgetter ...
apache-2.0
5,768,132,720,916,335,000
40.496894
79
0.503068
false
4.28132
false
false
false
0/realtimepork
realtimepork/gpu.py
1
1605
""" GPU utilities. """ from functools import wraps from math import ceil # Load everything we need in this module from PyCUDA (but don't autoinit until # requested). try: from pycuda.tools import DeviceData except ImportError: _pycuda_available = False else: _pycuda_available = True # Is this thing on? ...
mit
6,945,346,836,958,899,000
17.662791
78
0.640498
false
3.672769
false
false
false
hfercc/mese2014
lib/rest_framework/mixins.py
1
7228
""" Basic building blocks for generic class based views. We don't bind behaviour to http method handlers yet, which allows mixin classes to be composed in interesting ways. """ from __future__ import unicode_literals from django.core.exceptions import ValidationError from django.http import Http404 from res...
apache-2.0
8,436,068,386,180,543,000
34.505051
88
0.606945
false
4.259281
false
false
false
aerostitch/nagios_checks
hdfs_datanode_balancing_status.py
1
4396
#! /usr/bin/env python # -*- coding: utf-8 -*- # # Author: Joseph Herlant <herlantj@gmail.com> # File name: hdfs_datanode_balancing_status.py # Creation date: 2014-10-08 # # Distributed under terms of the GNU GPLv3 license. """ This nagios active check parses the Hadoop HDFS web interface url: http://<namenode>:<port>...
gpl-2.0
1,909,556,536,262,776,600
37.226087
97
0.619882
false
3.43706
false
false
false
drongo-framework/drongo-wing-auth
wing_auth/views.py
1
1681
from drongo_utils.helpers import URLHelper from wing_jinja2 import Jinja2 url = URLHelper.url template = Jinja2.template class AuthViews(object): def __init__(self, app, module, base_url): self.app = app self.module = module self.base_url = base_url URLHelper.mount(app, self, b...
mit
-2,225,894,349,991,006,000
24.469697
55
0.545509
false
3.760626
false
false
false
malaonline/Server
server/app/migrations/0064_auto_20160201_1843.py
1
1150
# -*- coding: utf-8 -*- # Generated by Django 1.9.1 on 2016-02-01 10:43 from __future__ import unicode_literals from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): dependencies = [ ('app', '0063_auto_20160201_1830'), ] operations = [ ...
mit
-8,703,896,778,187,276,000
31.857143
136
0.610435
false
3.95189
false
false
false
ankitrgadiya/cs50
project/miki/miki/edit.py
1
2137
import os from flask import ( Blueprint, flash, g, redirect, render_template, request, url_for, current_app, Markup ) from markdown import markdown from werkzeug.exceptions import abort from miki.auth import login_required from miki.db import connect bp = Blueprint('edit', __name__) @bp.app_template_filt...
gpl-3.0
-4,613,021,155,570,770,000
23.848837
69
0.542349
false
4.133462
false
false
false
erh3cq/hyperspy
hyperspy/tests/io/test_io.py
1
6593
# -*- coding: utf-8 -*- # Copyright 2007-2020 The HyperSpy developers # # This file is part of HyperSpy. # # HyperSpy 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...
gpl-3.0
-7,554,021,842,762,585,000
31.638614
88
0.635219
false
3.542719
true
false
false
william-richard/moto
moto/dynamodb2/exceptions.py
1
5931
class InvalidIndexNameError(ValueError): pass class MockValidationException(ValueError): def __init__(self, message): self.exception_msg = message class InvalidUpdateExpressionInvalidDocumentPath(MockValidationException): invalid_update_expression_msg = ( "The document path provided in t...
apache-2.0
-7,290,487,194,947,429,000
33.283237
134
0.685888
false
4.170886
false
false
false
tisnik/fabric8-analytics-common
vscode-visual-tests/features/src/gui.py
1
4392
# vim: set fileencoding=utf-8 """Common functions for GUI-related tests.""" from PIL import Image from os import path from src.litava import locate_on_screen_using_litava TYPING_INTERVAL = 0.25 DIRECTORY_WITH_REGIONS = "regions" OUTPUT_DIRECTORY = "." def perform_move_mouse_cursor(context, x=0, y=0): """Move...
apache-2.0
-6,515,741,662,497,905,000
32.784615
95
0.698315
false
4.003646
false
false
false
jeremiedecock/snippets
python/pyqt/pyqt5/widget_QTableView_delegate_on_edit_using_spinbox_widget.py
1
4158
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # Ref: # - http://doc.qt.io/qt-5/modelview.html#3-4-delegates # - http://doc.qt.io/qt-5/model-view-programming.html#delegate-classes # - http://doc.qt.io/qt-5/qabstractitemdelegate.html#details # - http://doc.qt.io/qt-5/qitemdelegate.html#details # - http://doc.qt.io/qt-5...
mit
-5,714,131,013,226,474,000
33.081967
133
0.616402
false
3.732496
false
false
false
AutorestCI/azure-sdk-for-python
azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/patch_route_filter.py
1
2686
# coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for # license information. # # Code generated by Microsoft (R) AutoRest Code Generator. # Changes ...
mit
-656,485,033,284,707,300
36.830986
91
0.599777
false
4.094512
false
false
false
googleads/google-ads-python
google/ads/googleads/v6/services/services/carrier_constant_service/client.py
1
17815
# -*- coding: utf-8 -*- # 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 # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law o...
apache-2.0
2,523,804,490,509,615,000
39.488636
136
0.623463
false
4.597419
false
false
false
Aalto-LeTech/a-plus
shibboleth_login/auth_backend.py
1
6416
import logging import urllib.parse from django.contrib.auth import get_user_model from django.contrib.auth.backends import ModelBackend from django.shortcuts import redirect from .apps import app_settings, env_settings from .parser import Parser logger = logging.getLogger('aplus.shibboleth') class ShibbolethAuthB...
gpl-3.0
8,581,214,611,712,775,000
37.884848
94
0.580268
false
4.091837
false
false
false
Komodo/macros
Reflow_tower.py
1
1901
# This macro is to reorder selected lines, so that the shortest will be # pushed to top, the longest will go to bottom (look like a tower). # # The macro is useful to reorder Python's "import" lines. # # Author: Nguyễn Hồng Quân (ng.hong.quan@gmail.com) import eollib from xpcom import components viewSvc = components....
mpl-2.0
1,604,087,599,337,519,600
33.472727
79
0.712025
false
3.530726
false
false
false
alisheykhi/SocialPDA
graph_util.py
1
8934
import re,collections,operator import networkx as nx from privacy_level import privacy_level_generator from numpy.random import zipf from math import ceil class ReadGraph(): extension = [] G = nx.Graph() properties = {} nodes = [] edges = [] privacy_level = [] sorted_degree_sequence = [] ...
apache-2.0
-4,987,266,179,027,643,000
39.243243
143
0.504589
false
3.875922
false
false
false
aringh/odl
odl/solvers/nonsmooth/forward_backward.py
1
6886
# Copyright 2014-2017 The ODL contributors # # This file is part of ODL. # # 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 https://mozilla.org/MPL/2.0/. """Optimization methods based on a forward-b...
mpl-2.0
-3,281,394,788,236,555,000
35.242105
79
0.609352
false
3.403856
false
false
false
happy5214/pywikibot-core
pywikibot/comms/threadedhttp.py
1
5773
# -*- coding: utf-8 -*- """Http backend layer, formerly providing a httplib2 wrapper.""" from __future__ import absolute_import, unicode_literals # (C) Pywikibot team, 2007-2015 __version__ = '$Id$' __docformat__ = 'epytext' # standard python libraries import codecs import sys if sys.version_info[0] > 2: from ur...
mit
-4,610,961,845,625,407,500
29.544974
79
0.556556
false
4.786899
false
false
false
shaunokeefe/hoponit
hoponit/harvest/management/commands/api.py
1
1352
from django.core.management.base import BaseCommand, CommandError from django.conf import settings from harvest import untappd class Command(BaseCommand): args = '<poll_id poll_id ...>' help = 'Closes the specified poll for voting' def handle(self, *args, **options): cmd = args[0] u = un...
mit
-7,560,068,598,439,669,000
29.044444
73
0.542899
false
3.346535
false
false
false
andela-ooshodi/codango-debug
codango/resources/tests/test_routes.py
1
3625
from django.test import Client, TestCase from django.contrib.auth.models import User from django.core.urlresolvers import reverse from resources.models import Resource from django.test.utils import setup_test_environment setup_test_environment() class CommunityViewTest(TestCase): def setUp(self): self.c...
mit
8,126,015,275,894,616,000
37.157895
78
0.622897
false
3.961749
true
false
false
MDAnalysis/mdanalysis
testsuite/MDAnalysisTests/coordinates/test_xdr.py
1
29773
# -*- Mode: python; tab-width: 4; indent-tabs-mode:nil; coding:utf-8 -*- # vim: tabstop=4 expandtab shiftwidth=4 softtabstop=4 fileencoding=utf-8 # # MDAnalysis --- https://www.mdanalysis.org # Copyright (c) 2006-2017 The MDAnalysis Development Team and contributors # (see the file AUTHORS for the full list of names) #...
gpl-2.0
1,926,006,717,862,227,500
34.444048
85
0.604004
false
3.663918
true
false
false