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
degoldschmidt/pytrack-analysis
pytrack_analysis/classifier.py
1
7563
import os, sys import numpy as np import pandas as pd from pytrack_analysis import Node from pytrack_analysis.array import rle from pytrack_analysis.cli import colorprint, flprint, prn """ Classifier class: loads kinematics data and metadata >> processes and returns classification data """ class Classifier(Node): ...
gpl-3.0
986,945,839,984,786,200
44.287425
214
0.534973
false
3.265544
false
false
false
benjdewantara/fdressim
example-5.py
1
1454
# I need to style this control file, # so that one can just type "from core import *" # and simply build a model then run a simulation from core import * from differentiator import runSimulation # 1*101*101 gridblocks # radius 2,500 ft # Firstly, we can specify the dimension of the cartesian grid nz, ny, nx = 1, 151...
mit
-238,295,014,418,817,800
24.508772
77
0.717331
false
2.80695
false
true
false
anisotropi4/goldfinch
timetable/get-id-file.py
1
1468
#!/usr/bin/env python3 import sys import json import argparse import os.path as path import pandas as pd import numpy as np import pandas.api.types as pd_types DEBUG = True filename = 'storage/PATH_004.jsonl' filename = 'storage/HD_001.jsonl' filename = 'storage/PA_004.jsonl' if __name__ == '__main__': parser = ...
mit
-679,207,470,799,475,700
25.214286
98
0.634196
false
3.156989
false
false
false
matthewdeanmartin/kata-python
kata/random_walk/main.py
1
1474
# coding=utf-8 """ You are on an infinite grid of squares, sort of like New York City. Walk in any direction, N, S, E, W. At intersections, pick a route at random, but not doubling back. On average how long will it take to get back to the starting point? How often does it fail to return to the starting point after x...
gpl-3.0
1,507,046,433,427,896,800
34.97561
99
0.723202
false
3.909814
false
false
false
nnmware/nnmware
apps/realty/models.py
1
4426
# nnmware(c)2012-2020 from __future__ import unicode_literals from django.db import models from django.utils.translation import ugettext_lazy as _ from nnmware.apps.address.models import AbstractLocation, MetaGeo from nnmware.apps.business.models import AbstractSeller from nnmware.apps.money.models import MoneyBase ...
gpl-3.0
-6,784,019,448,922,789,000
37.486957
119
0.678491
false
3.969507
false
false
false
tedye/leetcode
Python/leetcode.148.sort-list.py
1
1447
# Definition for singly-linked list. # class ListNode(object): # def __init__(self, x): # self.val = x # self.next = None class Solution(object): def sortList(self, head): """ :type head: ListNode :rtype: ListNode """ if not head or not head.next: ...
mit
-4,541,606,178,591,409,700
26.320755
52
0.407049
false
4.564669
false
false
false
majgis/majgis
experiments/parseRestToXML.py
1
3605
# Copyright 2012 majgis Contributors # # Individuals comprising majgis Contributors are identified in # the NOTICE file found in the root directory of this project. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # Y...
apache-2.0
3,614,318,620,522,105,300
29.05
84
0.646325
false
3.927015
false
false
false
kaji-project/shinken
shinken/daterange.py
1
24204
#!/usr/bin/env python # -*- coding: utf-8 -*- # Copyright (C) 2009-2014: # Gabes Jean, naparuba@gmail.com # Gerhard Lausser, Gerhard.Lausser@consol.de # Gregory Starck, g.starck@gmail.com # Hartmut Goebel, h.goebel@goebel-consult.de # # This file is part of Shinken. # # Shinken is free software: you ca...
agpl-3.0
-5,269,031,433,311,975,000
38.228525
124
0.588663
false
3.282343
false
false
false
bmedx/platform-core
platform_core/xblock/inherited_fields.py
1
10133
""" Inherited fields for all XBlocks. """ from __future__ import absolute_import from datetime import datetime from django.conf import settings from pytz import utc from xblock.fields import Scope, Boolean, String, Float, XBlockMixin, Dict, Integer, List from platform_core.lib.partitions.partitions import UserPartiti...
apache-2.0
-1,802,082,114,376,624,600
41.39749
407
0.634067
false
4.49357
false
false
false
chdb/DhammaMap1
main/validators.py
1
4846
# coding: utf-8 from __future__ import absolute_import #todo shouldn't we have this on every module or on none? import logging from google.appengine.ext import ndb #pylint: disable=import-error from google.appengine.datastore import datastore_query#.Cursor #pylint: disable=import-error import re import util import con...
mit
-2,607,830,326,467,792,400
35.712121
109
0.574701
false
4.199307
false
false
false
palli/monitor-iceland
graphite.d/gamma-radiation.py
1
2175
#!/usr/bin/env python # A plugin to check gamma radiation levels in Iceland # It fetches eurdep messages from opid-ftp.gr.is # You need to have eurdep module installed (pip install eurdep) import sys from ftplib import FTP import os import eurdep import datetime import time datadir="/tmp/eurdep-data" ftp = FTP('opid...
agpl-3.0
2,354,475,336,784,091,600
28.391892
94
0.604598
false
3.536585
false
false
false
memisevic/artify
artify_interactive.py
1
6737
# this is an implementation of the method described in # # Neural Algorithm of Artistic Style. Gatys, Ecker, Bethge 2015 http://arxiv.org/pdf/1508.06576.pdf # # this code is meant as an executable sketch showing the kinds of computation that need to be done. # running the code makes the most sense in an interactive ...
bsd-3-clause
2,535,576,292,924,251,600
40.58642
297
0.684429
false
2.93168
false
false
false
DBernardes/ProjetoECC
Ruido_de_Leitura/Codigo/RNvariacaoTemporal.py
1
8098
#!/usr/bin/python # -*- coding: UTF-8 -*- """ Criado em 17 de Agosto 2016. Descricao: este modulo possui como input uma serie de dados obtidos pelo CCDs, retornando o valor da mediana dos pixels de cada imagem em funcao do tempo, assim como o desvio padrao absoluto. Alem disso, e calculada a transform...
mit
2,736,414,751,060,536,300
33.746781
162
0.655262
false
2.537931
false
false
false
dnxbjyj/python-basic
gui/wxpython/wxPython-demo-4.0.1/demo/SashWindow.py
1
5099
#!/usr/bin/env python import wx import wx.adv #--------------------------------------------------------------------------- class TestSashWindow(wx.Panel): def __init__(self, parent, log): wx.Panel.__init__(self, parent, -1) self.log = log winids = [] # Create some layout window...
mit
-5,837,213,859,383,817,000
32.768212
80
0.598745
false
3.719183
false
false
false
ufcg-lsd/python-hpOneView
examples/scripts/del-user.py
1
4645
#!/usr/bin/env python ### # (C) Copyright (2012-2015) Hewlett Packard Enterprise Development LP # # 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 limita...
mit
-9,065,893,005,843,547,000
33.154412
105
0.637244
false
4.035621
false
false
false
moonfruit/yysite
yyfeed/fetcher/iapps.py
1
2845
# -*- coding: utf-8 -*- import re from typing import Iterable, Text from urllib.error import HTTPError from urllib.parse import urlencode from urllib.request import BaseHandler import execjs # noinspection PyProtectedMember from bs4 import BeautifulSoup, SoupStrainer from .base import FeedFetcher, Item class IAppsF...
mit
-5,954,693,721,964,000,000
26.621359
80
0.57188
false
3.956885
false
false
false
epam/DLab
infrastructure-provisioning/src/general/scripts/os/install_additional_libs.py
1
4408
#!/usr/bin/python # ***************************************************************************** # # Copyright (c) 2016, EPAM SYSTEMS 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 # #...
apache-2.0
-3,348,758,591,853,427,000
37.330435
115
0.574183
false
4.142857
false
false
false
sjtsp2008/oompa
oompa/tracking/SourceTracker.py
1
25327
# # SourceTracker.py # """ packge oompa.tracking """ import datetime import logging import os import random import re import shutil import sys # for stdout from oompa.tracking import file_utils from oompa.tracking.Project import Project from oompa.tracking import vcs_utils from...
apache-2.0
-3,942,692,737,922,877,400
27.298324
127
0.511036
false
4.642896
false
false
false
googleapis/python-iot
google/cloud/iot_v1/services/device_manager/transports/grpc.py
1
34095
# -*- 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 or...
apache-2.0
7,498,751,991,992,758,000
42.433121
98
0.622936
false
4.676313
true
false
false
jualvarez/charlex
01-Inicial/charlexapi/charlex/urls.py
1
1548
"""charlex URL Configuration The `urlpatterns` list routes URLs to views. For more information please see: https://docs.djangoproject.com/en/1.10/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') Class-ba...
gpl-3.0
-8,616,968,350,755,764,000
30.591837
79
0.741602
false
3.379913
false
false
false
vitan/django
django/db/models/fields/related.py
1
114482
from __future__ import unicode_literals import warnings from operator import attrgetter from django import forms from django.apps import apps from django.core import checks, exceptions from django.core.exceptions import FieldDoesNotExist from django.db import connection, connections, router, transaction from django.d...
bsd-3-clause
1,742,650,607,628,031,500
41.197567
122
0.561512
false
4.316004
false
false
false
noracami/haveaniceday
haveaniceday/haveaniceday/settings/base.py
1
3186
""" Django settings for haveaniceday project. Generated by 'django-admin startproject' using Django 1.9.3. For more information on this file, see https://docs.djangoproject.com/en/1.9/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/1.9/ref/settings/ """ # Build...
mit
-4,514,667,625,907,587,600
24.693548
91
0.690521
false
3.704651
false
false
false
t3dev/odoo
addons/website_hr_recruitment/models/hr_recruitment.py
1
2142
# -*- coding: utf-8 -*- # Part of Odoo. See LICENSE file for full copyright and licensing details. from werkzeug import urls from odoo import api, fields, models from odoo.tools.translate import html_translate class RecruitmentSource(models.Model): _inherit = 'hr.recruitment.source' url = fields.Char(compu...
gpl-3.0
7,004,508,762,190,151,000
34.114754
155
0.638189
false
3.618243
false
false
false
jmvrbanac/VerticalUtils-Python
verticalcue/appbase/consoleinterface.py
1
1629
''' Quick and dirty base for console-based python utility apps. Created on May 28, 2012 @author: John Vrbanac ''' import re class ConsoleInterface(object): __registeredCommands = [] def add_command(self, name, callback): cmd = Command() cmd.command = name cmd.callback = callback ...
gpl-3.0
-6,404,035,413,905,758,000
24.46875
60
0.501535
false
4.735465
false
false
false
sakuraio/python-sakuraio
sakuraio/hardware/commands/file.py
1
2218
import struct import datetime # File Download CMD_START_FILE_DOWNLOAD = 0x40 CMD_GET_FILE_METADATA = 0x41 CMD_GET_FILE_DOWNLOAD_STATUS = 0x42 CMD_CANCEL_FILE_DOWNLOAD = 0x43 CMD_GET_FILE_DATA = 0x44 class FileMixins(object): def start_file_download(self, fileid): """Start file download :param i...
mit
5,969,427,840,177,121,000
25.094118
84
0.561317
false
3.797945
false
false
false
deadbok/ann-flappy-bird-pygame
flappybird.py
1
14252
#! /usr/bin/env python3 """Flappy Bird, implemented using Pygame.""" import math import os from random import randint from collections import deque import pygame from pygame.locals import * FPS = 60 ANIMATION_SPEED = 0.18 # pixels per millisecond WIN_WIDTH = 284 * 2 # BG image size: 284x512 px; tiled twice WI...
mit
-7,218,075,903,446,681,000
35.450128
80
0.621316
false
3.721149
false
false
false
yuwei0927/python
获取所有Linux Kernel源码下载地址.py
1
1221
import re import urllib.request #import os #import http.server #import http.client #from urllib.error import URLError, HTTPError #import urllib.parse KernelAddrs = [] def UrlOpen(url): req = urllib.request.Request(url) key = 'User-agent' val = 'Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:50.0) Gecko/20100...
gpl-3.0
-8,023,951,234,046,851,000
27.395349
89
0.633088
false
3.138817
false
false
false
edeposit/cz-urnnbn-api
src/cz_urnnbn_api/api_structures/urn_nbn.py
1
2246
#! /usr/bin/env python # -*- coding: utf-8 -*- # # Interpreter version: python 2.7 # # Imports ===================================================================== # Functions & classes ========================================================= class URN_NBN(str): """ Class used to hold URN:NBN string and als...
mit
-4,738,490,686,272,783,000
33.030303
79
0.561443
false
3.84589
false
false
false
wsbf/ZAutomate
app/dualbox.py
1
4113
### dual scroll: http://stackoverflow.com/questions/4066974/scrolling-multiple-tkinter-listboxes-together ### pure tcl: http://www.tcl.tk/man/tcl8.4/TkCmd/listbox.htm#M24 ### fix dual highlight: http://www.internetcomputerforum.com/python-forum/311559-tkinter-selecting-one-item-each-two-listboxes.html """The dualbox m...
gpl-2.0
-4,507,795,597,193,972,000
32.169355
131
0.603452
false
3.518392
false
false
false
datagutten/comics
comics/comics/joelovescrappymovies.py
1
3295
from comics.aggregator.crawler import CrawlerBase, CrawlerImage from comics.core.comic_data import ComicDataBase class ComicData(ComicDataBase): name = 'Joe Loves Crappy Movies' language = 'en' url = 'http://www.digitalpimponline.com/strips.php?title=movie' start_date = '2005-04-04' rights = 'Jose...
agpl-3.0
-6,592,456,360,774,116,000
40.1875
78
0.592109
false
3.881037
false
false
false
bluerover/6lbr
examples/6lbr/test/postprocessing/pp_plot_rplrootmultitransparentbridge.py
2
16385
from pylab import * import re import inspect from pp_utils import * formatter = matplotlib.ticker.EngFormatter(places=3) formatter.ENG_PREFIXES[-6] = 'u' def scatterplot_RplRootMultiTransparentBridge_400x(results): print "scatterplot_RplRootMultiTransparentBridge_400x" data = {} ncol = 4 nrow = 3 ...
bsd-3-clause
-5,479,543,065,128,842,000
43.890411
198
0.579921
false
3.224759
true
false
false
f0rki/cb-multios
original-challenges/TFTTP/poller/for-release/machine.py
1
3934
#!/usr/bin/env python # # Copyright (C) 2014 # Brian Caswell <bmc@lungetech.com> # Narf Industries <info@narfindustries.com> # # 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 res...
mit
-8,821,726,283,752,065,000
36.113208
86
0.654042
false
3.566636
false
false
false
calexil/FightstickDisplay
pyglet/media/drivers/pulse/adaptation.py
1
15416
# ---------------------------------------------------------------------------- # pyglet # Copyright (c) 2006-2008 Alex Holkner # Copyright (c) 2008-2021 pyglet contributors # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the follo...
gpl-3.0
-921,089,429,386,009,200
35.444444
97
0.605929
false
4.225877
false
false
false
docileninja/Calvin-and-Hobbes-Viewer
Server/comic.py
1
1489
#!/usr/bin/env python3 from bs4 import BeautifulSoup as bs import requests as r import arrow from datetime import timedelta import re class Comic: def __init__(self, date_str): self.date = arrow.get(date_str) self._url = get_url(self.date_path()) self.last_checked = arrow.now() def c...
mit
5,085,410,087,547,652,000
25.589286
72
0.621222
false
3.222944
false
false
false
ajportier/txt-research
categorize.py
1
2949
#!/usr/bin/env python import sys import re PROTOCOL_ENHANCEMENT = [ 'spf', 'base64', 'sender-id', 'dkim', 'dmarc' ] DOMAIN_VERIFICATION = [ 'google-site-verification', 'office365ms', 'amazonses', 'salesforce-pardot', 'yandex-veri...
gpl-3.0
4,719,310,191,766,622,000
25.567568
89
0.526619
false
3.990528
false
false
false
brianhornsby/plugin.audio.overcast
resources/lib/cache.py
1
2104
#/* # * # * TuneIn Radio for Kodi. # * # * Copyright (C) 2015 Brian Hornsby # * # * 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-3.0
6,592,585,791,350,088,000
27.821918
73
0.595057
false
3.697715
false
false
false
pierky/blocklistsaggregator
pierky/blocklistsaggregator/lists/base_list.py
1
3448
# Copyright (C) 2016 Pier Carlo Chiodi # # 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...
gpl-3.0
8,943,776,009,915,918,000
27.733333
76
0.554234
false
4.403576
false
false
false
all-umass/graphs
graphs/construction/tests/test_neighbors.py
1
2864
import unittest import numpy as np from numpy.testing import assert_array_equal, assert_array_almost_equal from sklearn.metrics.pairwise import pairwise_distances from graphs.construction import neighbors def ngraph(*a, **k): return neighbors.neighbor_graph(*a,**k).matrix('dense') class TestNeighbo...
mit
-9,175,622,318,463,378,000
37.777778
79
0.622905
false
2.864
true
false
false
solderinskater/Push-2010
maemo/gui/tiltnroll/highscore.py
1
3040
# Copyright 2010 Keywan Tonekaboni, Florian Fusco, Stefanie Schirmer, Alexander Lenhard, Erik Weitnauer <eweitnauer at gmail.com> # # This file is part of Soldering Skaters Nokia Push Project. # # Soldering Skaters Nokia Push Project is free software: you can redistribute it and/or modify # it under the terms of the GN...
gpl-3.0
7,121,625,454,053,772,000
33.545455
129
0.688487
false
2.998028
false
false
false
ngageoint/scale
scale/storage/migrations/0004_auto_20170127_1408.py
1
3380
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations import django.db.models.deletion class Migration(migrations.Migration): dependencies = [ ('ingest', '0008_auto_20170127_1332'), ('product', '0006_auto_20170127_1348'), ('source', '000...
apache-2.0
-9,133,773,024,164,689,000
33.845361
143
0.559467
false
4.327785
false
false
false
ciolo/Sniffer-OpenMote
OpenMoteFirmware/tools/openmote-bsl/cc2538-bsl/cc2538-bsl.py
1
27583
#!/usr/bin/env python # Copyright (c) 2014, Jelmer Tiete <jelmer@tiete.be>. # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions # are met: # 1. Redistributions of source code must retain the above copyright #...
gpl-2.0
-87,698,693,462,705,970
33.695597
146
0.534242
false
3.703908
false
false
false
lakshmi-kannan/st2
contrib/runners/python_runner/python_runner.py
1
10143
# Licensed to the StackStorm, Inc ('StackStorm') under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. # The ASF licenses this file to You under the Apache License, Version 2.0 # (the "License"); you may not use th...
apache-2.0
-1,339,318,212,981,559,300
36.566667
96
0.622991
false
4.078408
false
false
false
afrancis13/bungiesearch
tests/core/search_aliases.py
1
1196
from bungiesearch.aliases import SearchAlias from core.models import Article, NoUpdatedField class SearchTitle(SearchAlias): def alias_for(self, title): return self.search_instance.query('match', title=title) class Meta: models = (Article,) alias_name = 'title_search' class Title(Se...
bsd-3-clause
424,873,262,338,994,600
24.468085
63
0.671405
false
3.761006
false
false
false
dstufft/warehouse
warehouse/db.py
1
8513
# Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the Li...
apache-2.0
-8,248,291,159,149,578,000
33.326613
88
0.713027
false
4.168952
true
false
false
gtseres/opsdroid
opsdroid/parsers/regex.py
1
1490
"""A helper function for parsing and executing regex skills.""" import logging import re _LOGGER = logging.getLogger(__name__) async def parse_regex(opsdroid, message): """Parse a message against all regex skills.""" # pylint: disable=broad-except # We want to catch all exceptions coming from a skill m...
gpl-3.0
4,649,782,264,531,988,000
40.388889
76
0.508054
false
5.10274
false
false
false
daira/zcash
qa/rpc-tests/wallet_import_export.py
3
3906
#!/usr/bin/env python3 # Copyright (c) 2018 The Zcash developers # Distributed under the MIT software license, see the accompanying # file COPYING or https://www.opensource.org/licenses/mit-license.php . from test_framework.test_framework import BitcoinTestFramework from test_framework.util import assert_equal, assert...
mit
-1,000,537,306,832,843,300
45.511905
134
0.667179
false
3.170455
true
false
false
maximatorrus/automated_testing_python
conftest.py
1
2429
import pytest import json import os.path import importlib import jsonpickle from fixture.application import Application from fixture.db import DbFixture fixture = None target = None def load_confige(file): global target if target is None: config_file = os.path.join(os.path.dirname(os.path.abspath(__...
apache-2.0
7,418,838,989,966,541,000
28.987654
129
0.678057
false
3.669184
true
false
false
matham/kivy
kivy/uix/label.py
1
38766
'''Label ===== .. image:: images/label.png :align: right The :class:`Label` widget is for rendering text. It supports ascii and unicode strings:: # hello world text l = Label(text='Hello world') # unicode text; can only display glyphs that are available in the font l = Label(text=u'Hello world '...
mit
368,433,253,781,867,140
33.987365
79
0.627741
false
4.057992
false
false
false
serge-sans-paille/pythran
pythran/tests/scikit-image/_hessian_det_appx.py
1
3728
import numpy as np def _clip(x, low, high): """Clips coordinate between high and low. This method was created so that `hessian_det_appx` does not have to make a Python call. Parameters ---------- x : int Coordinate to be clipped. low : int The lower bound. high : int ...
bsd-3-clause
3,400,070,011,310,668,000
25.820144
79
0.537554
false
3.299115
false
false
false
ndp-systemes/odoo-addons
product_putaway_dispatch/product_putaway_dispatch.py
1
10833
# -*- coding: utf8 -*- # # Copyright (C) 2014 NDP Systèmes (<http://www.ndp-systemes.fr>). # # 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,...
agpl-3.0
-1,527,168,801,351,048,400
53.432161
117
0.515602
false
4.636986
false
false
false
gavinfish/leetcode-share
python/140 Word Break II.py
1
1256
''' Given a string s and a dictionary of words dict, add spaces in s to construct a sentence where each word is a valid dictionary word. Return all such possible sentences. For example, given s = "catsanddog", dict = ["cat", "cats", "and", "sand", "dog"]. A solution is ["cats and dog", "cat sand dog"]. '''...
mit
-567,739,691,500,611,840
25.347826
132
0.453025
false
4.025641
false
false
false
matiasb/python-unidiff
tests/test_hunks.py
1
3448
# -*- coding: utf-8 -*- # The MIT License (MIT) # Copyright (c) 2014-2017 Matias Bordese # # 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 t...
mit
5,933,244,854,623,560,000
36.478261
79
0.678654
false
3.652542
true
false
false
charlesreid1/wordswordswords
pelican/crimeandpunishment/make_crimeandpunishment.py
1
2281
import os.path from bs4 import BeautifulSoup title = "Crime and Punishment" author = "Fyodor Dostoyevsky" name = "crimeandpunishment" short = "fdcp" chapters = [] filenames = [] nfiles = len(os.listdir('_include')) for jm1 in range(nfiles): j = jm1+1 print "-"*20 print "chapter id: %d"%(j) filen...
mit
5,205,438,455,190,176,000
20.72381
86
0.590092
false
3.111869
false
false
false
miracle2k/pysieved
plugins/accept.py
1
2161
#! /usr/bin/python ## pysieved - Python managesieve server ## Copyright (C) 2007 Neale Pickett ## 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 ## you...
gpl-2.0
2,408,957,026,309,282,300
28.60274
72
0.635354
false
4.024209
false
false
false
hrashk/sympy
sympy/polys/partfrac.py
1
13949
"""Algorithms for partial fraction decomposition of rational functions. """ from __future__ import print_function, division from sympy.polys import Poly, RootSum, cancel, factor from sympy.polys.polytools import parallel_poly_from_expr from sympy.polys.polyoptions import allowed_flags, set_defaults from sympy.polys.p...
bsd-3-clause
-4,708,439,098,878,268,000
28.060417
104
0.55581
false
3.374214
false
false
false
tls-dna/k-router
app_ui/node.py
1
5658
import sys from kivy.uix.label import Label from kivy.properties import NumericProperty, ListProperty, ObjectProperty from kivy.uix.popup import Popup from .vvhelix import VVHelix from kivy.graphics.vertex_instructions import (Line, Ellipse) from kivy.graphics.context_instructions import Color from math import sin, c...
mit
-2,612,267,266,452,019,700
34.584906
104
0.514846
false
3.84898
false
false
false
OdatNurd/hyperhelp
all/hyperhelpcore/core.py
1
17010
import sublime import os import re import time import webbrowser from urllib.parse import urlparse from .common import log, hh_syntax, hh_setting from .view import find_help_view, update_help_view from .help_index import _load_help_index, _scan_help_packages from .help import _resource_for_help from .help import _l...
mit
7,268,068,540,752,269,000
32.418468
81
0.646326
false
3.941149
false
false
false
aqyblitz/research-bbc
parser/parser.py
1
1092
import sys import random import math import copy def writegraph(graph, filename): f = open(filename, 'w') for row in graph: f.write(" ".join(map(str, row))) f.write("\n") def readfile(filename): f = open(filename, 'r') s = f.readlines() info = map(int,s[0].split(' ')[1:]) graph = [] graph2 = []...
mit
4,595,548,771,105,300,500
23.266667
46
0.577839
false
2.73
false
false
false
BeyondTheClouds/nova
nova/tests/unit/compute/test_compute_api.py
1
165851
# # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # ...
apache-2.0
8,000,291,766,270,370,000
44.302103
79
0.554244
false
4.171198
true
false
false
Germanika/plover
plover/dictionary/rtfcre_dict.py
1
11100
# Copyright (c) 2013 Hesky Fisher # See LICENSE.txt for details. # # TODO: Convert non-ascii characters to UTF8 # TODO: What does ^ mean in Eclipse? # TODO: What does #N mean in Eclipse? # TODO: convert supported commands from Eclipse """Parsing an RTF/CRE dictionary. RTF/CRE spec: http://www.legalxml.org/workgroups/...
gpl-2.0
-1,321,490,776,352,012,000
30.005587
80
0.472072
false
3.7
false
false
false
yschua/dumper
dumper/dir_monitor.py
1
2605
import os import logging import win32file import win32con import win32event import pywintypes import winnt from threading import Thread from dumper.file_uploader import FileUploader class DirMonitor(Thread): def __init__(self, config): Thread.__init__(self) self._max_size ...
mit
5,768,890,511,884,340,000
28.988095
77
0.542451
false
4.092767
false
false
false
BatOnBots-ML/batonbots-ml
battle/battleRoom.py
1
51321
# -*- coding: utf-8 -*- """ Copyright (C) 2013 BatOnBots-ML. 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 versi...
gpl-3.0
-3,422,678,351,162,258,000
38.137165
207
0.520147
false
3.730752
false
false
false
atareao/calendar-indicator
src/sidewidget.py
1
1834
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # # Calendar-Indicator # # Copyright (C) 2011-2019 Lorenzo Carbonell Cerezo # lorenzo.carbonell.cerezo@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 Softw...
gpl-3.0
-8,887,043,745,086,860,000
28.126984
80
0.662486
false
3.493333
false
false
false
wontfix-org/wtf
wtf/cmdline.py
1
8687
# -*- coding: ascii -*- # # Copyright 2006-2012 Andr\xe9 Malo or his licensors, as applicable # # 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
854,474,296,721,945,600
28.75
78
0.539772
false
4.247922
true
false
false
apdjustino/DRCOG_Urbansim
src/opus_core/upc/renter_equilibration_choices.py
1
5528
# Opus/UrbanSim urban simulation software. # Copyright (C) 2010-2011 University of California, Berkeley, 2005-2009 University of Washington # See opus_core/LICENSE from opus_core.upc.lottery_choices import lottery_choices from scipy.optimize import fmin_l_bfgs_b from opus_core.logger import logger from opus_core impor...
agpl-3.0
-5,458,347,111,118,477,000
37.388889
100
0.570007
false
3.720054
false
false
false
vsoch/singularity-python
singularity/build/google/instances.py
1
9628
''' Copyright (C) 2017-2019 Vanessa Sochat. 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 distribute...
agpl-3.0
4,647,159,673,663,591,000
37.512
102
0.584233
false
4.309758
false
false
false
brian-o/CS-CourseWork
CS471/Program3/matrixMult.py
1
1586
################## ''' matrixMult.py Written by: Brian O'Dell, September 2017 This is a short python script that fills 2 NxN matricies with random numbers and then multiplies them together There is no output, the program is meant to just test the runtimes of compiled vs. interpreted codes. The algorithm used is the ...
gpl-3.0
-2,773,400,648,579,422,700
23.4
90
0.602144
false
3.493392
false
false
false
olivierdalang/stdm
third_party/xml2ddl/PostgreSQLInterface.py
1
18778
#! /usr/bin/env python # -*- coding: iso-8859-1 -*- from downloadCommon import DownloadCommon, getSeqName from DdlCommonInterface import DdlCommonInterface import re class PgDownloader(DownloadCommon): """ Silly me, I didn't know about INFORMATION_SCHEMA """ def __init__(self): self.strDbms ...
gpl-2.0
-3,344,198,973,585,705,000
38.469828
193
0.540846
false
4.05923
false
false
false
jmhobbs/github-watcher
repo.py
1
6824
# -*- coding: utf-8 -*- import time import datetime import random import os import pygtk pygtk.require( '2.0' ) import gtk, gobject import git from multiprocessing import Process, Queue from Queue import Empty from traceback import format_exc def git_sync ( queue, sync_path, repo_name, uri ): """ Sync the rep...
mit
-7,343,525,820,285,229,000
28.162393
157
0.627345
false
2.844519
false
false
false
stack-of-tasks/rbdlpy
tutorial/lib/python2.7/site-packages/ttfquery/ttffiles.py
1
11835
"""Registry of available TrueType font files XXX Currently two copies of exactly the same font will likely confuse the registry because the specificFonts set will only have one of the metrics sets. Nothing breaks at the moment because of this, but it's not ideal. """ from ttfquery import describe, fi...
lgpl-3.0
-1,090,815,860,470,810,400
36.100313
123
0.572539
false
4.630282
true
false
false
flowdy/sompyler
Sompyler/synthesizer/shape/point.py
1
3256
from math import sqrt class Point: __slots__ = ['x', 'y'] def __init__(self, x, y): self.x = x self.y = y @staticmethod def distance (a, b): return sqrt( (b.y - a.y)**2 + (b.x - a.x)**2 ) @staticmethod def _weighted_average(a, dist, b): x = (1 - dist) * a.x + d...
gpl-3.0
-4,286,790,184,291,544,000
29.148148
85
0.529791
false
3.278953
false
false
false
Thraxis/SickRage
sickbeard/webserve.py
1
227936
# coding=utf-8 # Author: Nic Wolfe <nic@wolfeden.ca> # URL: http://code.google.com/p/sickbeard/ # # This file is part of SickRage. # # SickRage 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 ...
gpl-3.0
209,704,009,569,707,520
42.808572
488
0.593759
false
4.044215
true
false
false
peterwittek/happycowler
happycowler/file_io.py
1
4851
# -*- coding: utf-8 -*- """ Created on Sat Sep 24 18:01:13 2016 @author: pwittek """ def write_header_gpx(target_file): f = open(target_file, 'w') f.write('<?xml version=\'1.0\' encoding=\'UTF-8\'?>\n') f.write('<gpx version="1.0" creator="HappyCowler" xmlns="http://www.topografix.com/GPX/1/0">\n') f...
gpl-3.0
-5,844,873,428,817,351,000
36.898438
100
0.516182
false
3.253521
false
false
false
david-zwicker/video-analysis
video/analysis/shapes_3d.py
1
2875
''' Created on Nov 5, 2015 @author: David Zwicker <dzwicker@seas.harvard.edu> ''' from __future__ import division import numpy as np class Cuboid(object): """ class that represents a cuboid in n dimensions """ def __init__(self, pos, size): self.pos = np.asarray(pos) self.size = np.as...
bsd-3-clause
6,823,445,738,088,274,000
26.380952
79
0.541217
false
3.690629
false
false
false
Amarang/PBS-qstat-parser
model.py
1
2735
import commands class Node: def __init__(self,nodeID,cores): self.nodeID = nodeID self.cores=cores def getCores(self): return self.cores def getID(self): return self.nodeID def getNumCores(self): return len(self.cores) class Job: def __init__(self): self.jo...
mit
5,519,777,086,201,914,000
31.176471
92
0.581353
false
3.414482
false
false
false
EmadHelmi/chipsec_gui
chipsec/utilcmd/mmcfg_cmd.py
1
3335
#!/usr/local/bin/python #CHIPSEC: Platform Security Assessment Framework #Copyright (c) 2010-2015, Intel Corporation # #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; Version 2. # #This program is...
gpl-2.0
-8,774,691,234,236,875,000
32.35
136
0.593103
false
3.495807
false
false
false
lokhman/pydbal
pydbal/drivers/sqlite.py
1
4163
#!/usr/bin/env python # # Copyright (c) 2016 Alexander Lokhman <alex.lokhman@gmail.com> # # 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...
mit
-5,450,989,801,557,138,000
31.023077
105
0.649051
false
4.18392
false
false
false
zyc9012/sdrl
sdrl/Gui/Tools/LinePlotter.py
1
6725
#-*- coding: utf-8 -*- from PyQt4.QtGui import * from PyQt4.QtCore import * from PyQt4 import uic import matplotlib matplotlib.rcdefaults() import matplotlib.pyplot as plt from matplotlib.figure import Figure from matplotlib.backends.backend_qt4agg import ( FigureCanvasQTAgg as FigureCanvas, NavigationToolba...
gpl-2.0
5,978,883,196,561,671,000
30.181395
95
0.592272
false
3.467667
true
false
false
dietrichc/streamline-ppc-reports
examples/adwords/v201409/reporting/download_criteria_report_as_stream_with_awql.py
1
2615
#!/usr/bin/python # # Copyright 2014 Google 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.0 # # Unless required b...
apache-2.0
5,256,563,653,678,880
30.890244
80
0.695985
false
3.879822
false
false
false
woutersmet/Molmodsummer
lib/molmod/clusters.py
1
3449
# MolMod is a collection of molecular modelling tools for python. # Copyright (C) 2007 - 2008 Toon Verstraelen <Toon.Verstraelen@UGent.be> # # This file is part of MolMod. # # MolMod 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...
gpl-3.0
9,115,139,002,236,532,000
30.935185
83
0.600464
false
4.343829
false
false
false
Fangfenghua/docker-registry-driver-huaweimos
com/hws/s3/response/list_buckets_response.py
1
2900
#coding=UTF-8 ''' Created on 2012-9-29 @author: s00228753 ''' import xml.etree.ElementTree as ET from com.hws.s3.models.bucket import Bucket from com.hws.s3.models.owner import Owner from com.hws.s3.utils.utils import Utils #罗列存储空间方法返回对象,可解析返回的XML为S3存储空间 class ListBucketsResponse(object): def __init__(sel...
apache-2.0
378,282,924,559,881,500
33.038462
118
0.46948
false
3.665746
false
false
false
gustfrontar/LETKF_WRF
common_python/scale_modules/binary_io.py
1
5348
import numpy as np import datetime as dt import os.path default_undef_val=1.0e33 def read_data_direct(inputfilename,nx,ny,nz,dtypein,undef_in=default_undef_val,undef_out=default_undef_val,seq_acces=False): #dtypein is the native input data format. #>f32 for big endian data format with single precission. #f32 for litt...
gpl-3.0
4,879,098,824,599,186,000
34.184211
147
0.686051
false
3.043825
false
false
false
thinkasoft/ProyectoRD-dev
l10n_ve_generic/__openerp__.py
1
1968
# -*- encoding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2008 Tiny SPRL (<http://tiny.be>). All Rights Reserved # $Id$ # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2008 N...
agpl-3.0
993,016,730,293,816,000
41.73913
98
0.594608
false
3.824903
false
false
false
PapenfussLab/Mungo
snippets/refseq2exons.py
1
1941
#!/usr/bin/env python """ refseq2exons.py <refseq file> <exons file> <offset> """ import sys import os import csv def refseq2exons(iFilename, oFilename, offset): # Build translation table iDir = '/Users/papenfuss/data/databases/human' filename = os.path.join(iDir, 'refLink.txt') dataFile = open(file...
artistic-2.0
-7,273,768,728,731,781,000
25.22973
73
0.57084
false
3.466071
false
false
false
decvalts/landlab
docs/model_grid_guide/diffusion_with_radial_model_grid.py
1
2934
#! /usr/env/python """ 2D numerical model of diffusion, implemented using ModelGrid. Provides example of a radial grid. Last updated GT May 2014 """ from landlab import RadialModelGrid import pylab def main(): """ In this simple tutorial example, the main function does all the work: it sets the parame...
mit
-5,354,638,678,346,831,000
28.049505
77
0.608725
false
3.480427
false
false
false
andreyvit/pyjamas
pyjs/src/pyjs/builtin/pyjslib.py
1
157334
# Copyright 2006 James Tauber and contributors # # 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 agre...
apache-2.0
-7,259,917,029,468,257,000
29.568098
150
0.444742
false
3.607751
false
false
false
pombreda/pyamg
Examples/StrengthTest/demo.py
1
1742
import numpy as np import scipy as sp from scipy.linalg import norm from pyamg import * from pyamg.gallery import stencil_grid from pyamg.gallery.diffusion import diffusion_stencil_2d n=1e2 stencil = diffusion_stencil_2d(type='FE',epsilon=0.001,theta=sp.pi/3) A = stencil_grid(stencil, (n,n), format='csr') b = sp.rand(...
bsd-3-clause
-8,742,241,063,813,674,000
36.06383
105
0.618255
false
2.573117
false
false
false
almarklein/scikit-image
skimage/exposure/unwrap.py
1
4400
import numpy as np import warnings from ._unwrap_1d import unwrap_1d from ._unwrap_2d import unwrap_2d from ._unwrap_3d import unwrap_3d from .._shared.six import string_types def unwrap_phase(image, wrap_around=False): '''From ``image``, wrapped to lie in the interval [-pi, pi), recover the original, unwrap...
bsd-3-clause
30,134,155,075,352,116
41.307692
78
0.623409
false
3.735144
false
false
false
micolous/helvetic
helv_test/helv_test/settings.py
1
2602
""" Django settings for helv_test project. For more information on this file, see https://docs.djangoproject.com/en/1.7/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/1.7/ref/settings/ """ # Build paths inside the project like this: os.path.join(BASE_DIR, ...) ...
agpl-3.0
-8,473,849,261,830,299,000
23.780952
71
0.685626
false
3.432718
false
false
false
protwis/protwis
similaritymatrix/views.py
1
3773
from django.shortcuts import render from django.conf import settings from common.views import AbsSegmentSelection #from common.views import AbsTargetSelection from common.views import AbsTargetSelectionTable # from common.alignment_SITE_NAME import Alignment Alignment = getattr(__import__('common.alignment_' + setting...
apache-2.0
-8,457,941,253,250,831,000
31.525862
124
0.657832
false
4.164459
false
false
false
StyXman/satyr
satyr/collection_indexer.py
1
5992
# vim: set fileencoding=utf-8 : # (c) 2009 Marcos Dione <mdione@grulic.org.ar> # This file is part of satyr. # satyr 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 ...
gpl-2.0
-1,651,847,780,118,300,000
33.635838
110
0.597797
false
4.121045
false
false
false
pmorissette/ffn
ffn/core.py
1
79128
from __future__ import print_function import random import numpy as np import pandas as pd import scipy.stats import sklearn.cluster import sklearn.covariance import sklearn.manifold from future.utils import iteritems, listvalues from pandas.core.base import PandasObject from scipy.optimize import minimize from scipy...
mit
-6,796,649,217,163,681,000
31.152783
242
0.554267
false
3.722795
false
false
false
vholland/schemaorg
devserv.py
1
3207
#!/usr/bin/env python3 # -*- coding: UTF-8 -*- import sys if not (sys.version_info.major == 3 and sys.version_info.minor > 5): print("Python version %s.%s not supported version 3.6 or above required - exiting" % (sys.version_info.major,sys.version_info.minor)) sys.exit(1) import os import argparse for path in ...
apache-2.0
-6,462,496,095,724,630,000
31.40404
137
0.634549
false
3.226358
false
false
false
mateor/pants
src/python/pants/backend/python/python_chroot.py
1
10183
# coding=utf-8 # Copyright 2014 Pants project contributors (see CONTRIBUTORS.md). # Licensed under the Apache License, Version 2.0 (see LICENSE). from __future__ import (absolute_import, division, generators, nested_scopes, print_function, unicode_literals, with_statement) import functools imp...
apache-2.0
5,650,163,994,974,919,000
37.866412
115
0.680251
false
4.119337
false
false
false
ypu/virt-test
virttest/libvirt_xml/devices/disk.py
1
9107
""" disk device support class(es) http://libvirt.org/formatdomain.html#elementsDisks """ from virttest.libvirt_xml import accessors, xcepts from virttest.libvirt_xml.devices import base, librarian class Disk(base.TypedDeviceBase): """ Disk device XML class Properties: device: string, how expos...
gpl-2.0
8,482,652,337,299,452,000
43.862069
83
0.527836
false
4.429475
false
false
false
rkday/wherearewe
generate-postcode-db.py
1
3232
import sys sys.path.append("./django/") import mysite.settings import os os.environ.setdefault("DJANGO_SETTINGS_MODULE", "mysite.settings") from django.core.management import setup_environ from django.db import transaction setup_environ(mysite.settings) import waw_app.models import re import time import sys from sha...
agpl-3.0
5,756,172,564,259,486,000
38.414634
111
0.650062
false
3.727797
false
false
false
isislovecruft/switzerland
switzerland/lib/shrunk_scapy/packet.py
1
41179
## This file is part of Scapy ## See http://www.secdev.org/projects/scapy for more informations ## Copyright (C) Philippe Biondi <phil@secdev.org> ## This program is published under a GPLv2 license import re,time,itertools,os,random,socket from fields import StrField,ConditionalField,Emph from config import conf from ...
gpl-3.0
5,335,298,707,615,006,000
34.683709
137
0.492241
false
3.902483
false
false
false
HybridF5/hybrid-jacket
wormhole/container.py
1
11927
import webob from wormhole import exception from wormhole import wsgi from wormhole.volumes import controller as volume from wormhole.common import log from wormhole.common import importutils from wormhole.common import utils from wormhole.i18n import _ from wormhole.docker_client import DockerHTTPClient from wormhol...
apache-2.0
2,513,445,783,089,663,500
37.105431
102
0.552109
false
4.271848
false
false
false
freedomtan/tensorflow
tensorflow/python/keras/saving/saved_model/save.py
2
5445
# Copyright 2018 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
apache-2.0
6,072,597,375,023,743,000
40.884615
106
0.723967
false
4.182028
false
false
false
gradiuscypher/discord_gradiusbot
libs/db/inventory.py
1
7359
import json import logging import traceback from discord.colour import Color from sqlalchemy import Column, Boolean, Integer, String, ForeignKey, create_engine, DateTime, Float from sqlalchemy.ext.declarative import declarative_base from sqlalchemy.orm import relationship, sessionmaker, scoped_session from libs.db.base...
mit
-4,781,967,865,196,510,000
34.042857
158
0.584454
false
4.411871
false
false
false