repo_name
stringlengths
5
100
path
stringlengths
4
299
copies
stringclasses
990 values
size
stringlengths
4
7
content
stringlengths
666
1.03M
license
stringclasses
15 values
hash
int64
-9,223,351,895,964,839,000
9,223,297,778B
line_mean
float64
3.17
100
line_max
int64
7
1k
alpha_frac
float64
0.25
0.98
autogenerated
bool
1 class
kgyl/twitter-data-analysis
scripts/categorize_user_vectors.py
1
2047
from scipy.spatial.distance import euclidean from sklearn.decomposition import PCA import numpy as np import math collection_name = 'ns-users' DATA_DIR = '../../data/categories/ns-users/' user_vecs = np.load('../../data/'+collection_name+'/retweeter_w2v_by_avg_word_vec_10_30/features.npy') category_vecs = np.load('.....
gpl-3.0
-3,690,693,589,987,609,600
39.94
136
0.705911
false
ohio813/pyflag
src/plugins/Urwid/urwid/widget.py
8
78773
#!/usr/bin/python # # Urwid basic widget classes # Copyright (C) 2004-2007 Ian Ward # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, ...
gpl-2.0
6,931,457,597,435,678,000
26.361237
87
0.65247
false
timpalpant/calibre
src/calibre/db/tests/profiling.py
14
1026
#!/usr/bin/env python2 # vim:fileencoding=utf-8 from __future__ import (unicode_literals, division, absolute_import, print_function) __license__ = 'GPL v3' __copyright__ = '2013, Kovid Goyal <kovid at kovidgoyal.net>' import os, cProfile from tempfile import gettempdir from calibre.db.legacy ...
gpl-3.0
1,184,697,396,481,422,300
24.65
68
0.635478
false
ewandor/home-assistant
homeassistant/components/cloud/http_api.py
1
7208
"""The HTTP api to control the cloud integration.""" import asyncio from functools import wraps import logging import voluptuous as vol import async_timeout from homeassistant.components.http import ( HomeAssistantView, RequestDataValidator) from . import auth_api from .const import DOMAIN, REQUEST_TIMEOUT _LOG...
apache-2.0
5,551,867,265,287,187,000
29.935622
79
0.631937
false
akretion/odoo
addons/sale_purchase/models/sale_order.py
4
17030
# -*- coding: utf-8 -*- # Part of Odoo. See LICENSE file for full copyright and licensing details. from dateutil.relativedelta import relativedelta from odoo import api, fields, models, _ from odoo.exceptions import UserError from odoo.tools import float_compare class SaleOrder(models.Model): _inherit = 'sale.o...
agpl-3.0
-7,981,069,912,607,275,000
52.05296
238
0.623782
false
Cloudzero/cloudzero-reactor-aws
reactor/aws/decorators.py
1
1114
# -*- coding: utf-8 -*- # Copyright (c) 2016-present, CloudZero, Inc. All rights reserved. # Licensed under the BSD-style license. See LICENSE file in the project root for full license information. from botocore.exceptions import ClientError from retrying import retry def provisioned_throughput_retry(max_attempts=7)...
bsd-3-clause
-1,154,636,253,028,406,500
41.846154
116
0.689408
false
sublime1809/django
django/middleware/common.py
28
6967
import hashlib import logging import re from django.conf import settings from django.core.mail import mail_managers from django.core import urlresolvers from django import http from django.utils.encoding import force_text from django.utils.http import urlquote from django.utils import six logger = logging.getLogger(...
bsd-3-clause
5,269,062,605,172,859,000
40.718563
91
0.559064
false
layuplist/layup-list
apps/analytics/tasks.py
1
2942
from datetime import datetime, timedelta from celery import shared_task from django.conf import settings from django.contrib.auth.models import User from django.core.mail import send_mail from django.db.models import Q from django.template.loader import get_template from django.template import Context from apps.web.m...
gpl-3.0
2,592,868,231,928,218,600
37.207792
79
0.662475
false
spandanb/horizon
openstack_dashboard/api/sahara.py
1
10667
# 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...
apache-2.0
-8,144,537,474,681,682,000
35.406143
78
0.541764
false
ManiacalLabs/BiblioPixel
bibliopixel/colors/gamma.py
1
1733
import numpy as np class Gamma(object): """ Compute a fixed gamma table with 256 entries. """ def __init__(self, gamma=1.0, offset=0, lower_bound=0): """ :param float gamma: the root for gamma computation :param float offset: an offset added to the result :param int lo...
mit
-54,613,049,807,669,090
31.698113
87
0.620312
false
TheSimoms/Felleshoelet
spotifyconnector/venv/lib/python3.6/site-packages/pip/_internal/models/selection_prefs.py
21
1908
from pip._internal.utils.typing import MYPY_CHECK_RUNNING if MYPY_CHECK_RUNNING: from typing import Optional from pip._internal.models.format_control import FormatControl class SelectionPreferences(object): """ Encapsulates the candidate selection preferences for downloading and installing files...
gpl-2.0
-3,967,020,638,732,614,000
39.595745
78
0.662998
false
adityacs/ansible
lib/ansible/modules/storage/zfs/zfs_facts.py
13
8717
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2016, Adam Števko <adam.stevko@gmail.com> # # This file is part of Ansible # # Ansible 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 L...
gpl-3.0
-2,548,795,044,996,286,000
29.472028
106
0.537235
false
neithere/timetra.diary
timetra/diary/utils.py
1
10788
# -*- coding: utf-8 -*- # # Timetra is a time tracking application and library. # Copyright © 2010-2014 Andrey Mikhaylenko # # This file is part of Timetra. # # Timetra is free software: you can redistribute it and/or modify # it under the terms of the GNU Lesser General Public License as published # ...
lgpl-3.0
-3,627,545,172,862,945,300
29.495751
93
0.584022
false
UpstandingHackers/hammer
src/bindings/python/hammer_tests.py
2
19188
from __future__ import absolute_import, division, print_function import unittest import hammer as h class TestTokenParser(unittest.TestCase): @classmethod def setUpClass(cls): cls.parser = h.token(b"95\xa2") def test_success(self): self.assertEqual(self.parser.parse(b"95\xa2"), b"95\xa2") ...
gpl-2.0
4,513,962,877,326,974,000
36.549902
101
0.608714
false
ghisvail/vispy
vispy/app/backends/_sdl2.py
18
15132
# -*- coding: utf-8 -*- # Copyright (c) 2015, Vispy Development Team. # Distributed under the (new) BSD License. See LICENSE.txt for more info. """ vispy backend for sdl2. """ from __future__ import division import atexit import ctypes from time import sleep import warnings import gc from ..base import (BaseApplicat...
bsd-3-clause
-4,155,578,784,518,633,500
32.776786
79
0.551018
false
RedHatQE/cfme_tests
docs/conf.py
1
10239
# -*- coding: utf-8 -*- # # cfme_tests documentation build configuration file, created by # sphinx-quickstart on Thu Nov 21 09:32:22 2013. # # This file is execfile()d with the current directory set to its containing dir. # # Note that not all possible configuration values are present in this # autogenerated file. # # ...
gpl-2.0
-9,025,254,045,384,877,000
30.601852
96
0.683465
false
e0ne/cinder
cinder/openstack/common/versionutils.py
11
4960
# Copyright (c) 2013 OpenStack Foundation # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless ...
apache-2.0
2,030,077,365,344,251,600
32.513514
79
0.639718
false
CapOM/ChromiumGStreamerBackend
tools/telemetry/third_party/gsutilz/gslib/commands/cat.py
32
4890
# -*- coding: utf-8 -*- # Copyright 2011 Google Inc. All Rights Reserved. # Copyright 2011, Nexenta 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 # # http://www.apache.org/...
bsd-3-clause
-9,204,638,240,251,082,000
32.958333
80
0.631697
false
gszpura/flask-ratelimiter
flask_ratelimiter/backends/flaskcacheredis_backend.py
1
1595
# -*- coding: utf-8 -*- ## ## This file is part of Flask-RateLimiter ## Copyright (C) 2014 CERN. ## ## Flask-RateLimiter is free software; you can redistribute it and/or ## modify it under the terms of the GNU General Public License as ## published by the Free Software Foundation; either version 2 of the ## License, or...
gpl-2.0
5,963,266,271,981,230,000
38.9
79
0.717868
false
Heappl/scripts
oil_and_energy.py
1
6416
import matplotlib.pyplot as plt import numpy as np import math def diff_serie(data): return [(float(x2) / float(x1) - 1.0) * 100 for (x2, x1) in zip(data[1:], data[:-1])] def average_change(data): return sum(diff_serie(data)) / (len(data) - 1) def prediction(data, years): return data + [pow(1.0 + averag...
gpl-2.0
-7,782,771,617,845,315,000
86.890411
990
0.735817
false
xerxes2/gpodder
src/gpodder/gtkui/frmntl/episodes.py
2
11045
# -*- coding: utf-8 -*- # # gPodder - A media aggregator and podcast client # Copyright (c) 2005-2011 Thomas Perl and the gPodder Team # # gPodder 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,182,616,534,033,793,000
41.644788
105
0.632413
false
benjamin9999/pika
setup.py
5
2198
from setuptools import setup import os # Conditionally include additional modules for docs on_rtd = os.environ.get('READTHEDOCS', None) == 'True' requirements = list() if on_rtd: requirements.append('tornado') requirements.append('twisted') #requirements.append('pyev') long_description = ('Pika is a pure-...
bsd-3-clause
-1,157,360,849,307,871,700
42.098039
78
0.588717
false
OpenNingia/l5r-character-manager-3
l5r/util/log.py
1
2083
# -*- coding: utf-8 -*- # Copyright (C) 2014 Daniele Simonetti # # 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. # # Thi...
gpl-3.0
1,630,793,402,676,458,200
29.188406
70
0.68507
false
lookout/dd-agent
checks/system/unix.py
4
35157
""" Unix system checks. """ # stdlib import operator import platform import re import sys import time # 3rd party import uptime try: import psutil except ImportError: psutil = None # project from checks import Check from util import get_hostname from utils.platform import Platform from utils.subprocess_output...
bsd-3-clause
-3,477,648,975,757,831,700
44.363871
285
0.461643
false
r-kan/reminder
base/setting/utility.py
1
6935
#!/usr/bin/env python # -*- coding: utf-8 -*- from __future__ import print_function, unicode_literals from util.select import RankHolder, get_weighted_random_dict_key PERCENTAGE = 1 WEIGHT = 2 class RankArbitrator(object): def __init__(self): self.__general_ranks = {} # key: pattern, value: list of Ra...
mit
-4,023,592,659,876,096,500
41.286585
119
0.60995
false
bhaugen/nova
django_extensions/management/modelviz.py
8
9296
#!/usr/bin/env python """Django model to DOT (Graphviz) converter by Antonio Cavedoni <antonio@cavedoni.org> Make sure your DJANGO_SETTINGS_MODULE is set to your project or place this script in the same directory of the project and call the script like this: $ python modelviz.py [-h] [-a] [-d] [-g] [-i <model_names>]...
mit
3,301,418,556,880,389,000
31.390244
156
0.55099
false
fritsvanveen/QGIS
python/ext-libs/pygments/lexers/modula2.py
23
52564
# -*- coding: utf-8 -*- """ pygments.lexers.modula2 ~~~~~~~~~~~~~~~~~~~~~~~ Multi-Dialect Lexer for Modula-2. :copyright: Copyright 2006-2015 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. """ import re from pygments.lexer import RegexLexer, include from pygments.util...
gpl-2.0
-6,001,406,843,386,985,000
32.66688
84
0.541786
false
stonebig/bokeh
bokeh/document/document.py
1
39796
#----------------------------------------------------------------------------- # Copyright (c) 2012 - 2019, Anaconda, Inc., and Bokeh Contributors. # All rights reserved. # # The full license is in the file LICENSE.txt, distributed with this software. #-------------------------------------------------------------------...
bsd-3-clause
-2,561,572,242,748,076,000
33.159657
155
0.561438
false