repo_name
stringlengths
6
61
path
stringlengths
4
230
copies
stringlengths
1
3
size
stringlengths
4
6
text
stringlengths
1.01k
850k
license
stringclasses
15 values
hash
int64
-9,220,477,234,079,998,000
9,219,060,020B
line_mean
float64
11.6
96.6
line_max
int64
32
939
alpha_frac
float64
0.26
0.9
autogenerated
bool
1 class
ratio
float64
1.62
6.1
config_test
bool
2 classes
has_no_keywords
bool
2 classes
few_assignments
bool
1 class
yotam/pictureframe
examples/quickstart.py
1
1883
import numpy as np from numpy.random import random_sample from skimage import img_as_float from skimage.io import imread from pictureframe import PictureFrame image = img_as_float(imread('sample_data/image.png')) depth = img_as_float(imread('sample_data/depth.png')) # CONSTRUCTORS # dict of array name to array pf =...
bsd-3-clause
5,895,956,978,169,367,000
26.289855
71
0.744025
false
3.368515
false
false
false
UMONS-GFA/pidas
pidas/test/log_temps_to_csv.py
1
2935
import sys import subprocess import time import glob import csv import logging import pandas as pd from os import path, makedirs from time import gmtime from pidas.settings import PIDAS_DIR, SENSOR_LIST_FILE, DATA_FILE, CSV_HEADER def get_sensor_list(sensor_list): """create a dataframe from sensor list name and p...
gpl-3.0
409,664,085,070,116,200
30.55914
100
0.604429
false
3.506571
false
false
false
mephistopheies/nn
examples/pretraining2.py
1
1610
import sys sys.path.append('./../nn/') import numpy as np from pandas import read_csv from nn.nn.MLP import MLP, sigmoid, d_sigmoid, d_identity, identity, tanh, d_tanh, mcrmse, xeuclidian, d_xeuclidian, hamming, euclidian from nn.nn.RBM import RBM from nn.nn.Norms import l2, d_l2, l1, d_l1 if __name__ == '__main__':...
gpl-2.0
8,418,792,797,985,184,000
34
135
0.550311
false
2.756849
false
true
false
pythondigest/pythondigest
digest/tests/test_import_python_weekly.py
1
1376
# -*- encoding: utf-8 -*- from django.test import TestCase from mock import patch from digest.management.commands.import_python_weekly import _get_content, \ _get_blocks from digest.utils import MockResponse from digest.utils import read_fixture class ImportPythonWeeklyBadTest(TestCase): def test_get_conte...
mit
3,518,114,190,919,860,000
32.560976
181
0.6875
false
3.380835
true
false
false
sio2project/oioioi
oioioi/questions/processors.py
1
2124
import six from django.urls import reverse from django.utils.functional import lazy from django.utils.translation import ungettext from oioioi.base.utils import make_navbar_badge from oioioi.contests.utils import can_enter_contest, is_contest_basicadmin from oioioi.questions.utils import unanswered_questions from oioi...
gpl-3.0
5,808,894,500,609,906,000
31.181818
86
0.620527
false
3.868852
true
false
false
cobrateam/splinter
tests/fake_django/urls.py
1
2998
from django.conf.urls import include, url from django.http import HttpResponse from django.shortcuts import redirect from django.contrib import admin from django.contrib.auth.decorators import login_required import six if six.PY2: from django.core.urlresolvers import reverse else: from django.urls import rever...
bsd-3-clause
4,334,059,057,444,581,400
22.24031
81
0.666778
false
3.506433
false
false
false
kailIII/emaresa
trunk.cl/search_by_name_vat/__openerp__.py
3
1671
# -*- encoding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (c) 2011 CCI Connect asbl (http://www.cciconnect.be) All Rights Reserved. # Philmer <philmer@cciconnect.be> # # This progra...
agpl-3.0
3,303,899,774,746,253,000
39.756098
88
0.600239
false
4.156716
false
false
false
endlessm/chromium-browser
third_party/protobuf/python/google/protobuf/text_encoding.py
26
4855
# Protocol Buffers - Google's data interchange format # Copyright 2008 Google Inc. All rights reserved. # https://developers.google.com/protocol-buffers/ # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redi...
bsd-3-clause
-6,027,538,505,363,856,000
40.495726
80
0.696601
false
3.559384
false
false
false
eukaryote/knowhow
knowhow/util.py
1
3828
# coding=utf8 """ Misc utilities. """ from __future__ import absolute_import from __future__ import print_function from __future__ import unicode_literals from __future__ import division from datetime import datetime import sys import pytz import pytz.reference import six ISO_DATE_FORMAT = "%Y-%m-%dT%H:%M:%S.%f+...
mit
-4,824,097,179,376,223,000
25.219178
79
0.618077
false
4.025237
false
false
false
JustinWingChungHui/okKindred
gallery/models/image.py
2
9448
from django.conf import settings from django.db import models from django.utils import timezone from common.utils import create_hash from common.get_lat_lon_exif_pil import get_lat_lon_backup from common.s3_synch import upload_file_to_s3, remove_file_from_s3, get_file_from_s3 from custom_user.models import User from ...
gpl-2.0
2,709,290,802,625,989,000
32.385159
160
0.634949
false
3.792854
false
false
false
rajalokan/keystone
keystone/tests/unit/test_cli.py
1
57490
# Copyright 2014 IBM Corp. # # 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, s...
apache-2.0
4,415,172,387,815,540,700
42.718631
79
0.627048
false
4.149105
true
false
false
geraldoandradee/pytest
_pytest/config.py
1
32554
""" command line options, ini-file and conftest.py processing. """ import py import sys, os from _pytest import hookspec # the extension point definitions from _pytest.core import PluginManager # pytest startup def main(args=None, plugins=None): """ return exit code, after performing an in-process test run. ...
mit
-1,276,906,123,637,224,400
36.765661
93
0.561068
false
4.272178
true
false
false
florentchandelier/zipline
zipline/data/data_portal_live.py
2
3669
# # 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 ...
apache-2.0
4,738,107,394,206,212,000
43.743902
77
0.644317
false
4.326651
false
false
false
tdaylan/tdgu
radt_6dim.py
1
2203
from __init__ import * import json, requests import h5py def query(lon, lat, coordsys='gal', mode='full'): url = 'http://argonaut.skymaps.info/gal-lb-query-light' payload = {'mode': mode} if coordsys.lower() in ['gal', 'g']: payload['l'] = lon payload['b'] = lat elif coor...
mit
1,658,613,054,913,812,500
26.886076
88
0.563323
false
2.981055
false
false
false
twilio/twilio-python
twilio/rest/preview/trusted_comms/__init__.py
1
2274
# coding=utf-8 r""" This code was generated by \ / _ _ _| _ _ | (_)\/(_)(_|\/| |(/_ v1.0.0 / / """ from twilio.base.version import Version from twilio.rest.preview.trusted_comms.branded_channel import BrandedChannelList from twilio.rest.preview.trusted_comms.brands_information import BrandsInforma...
mit
-597,316,505,879,555,100
29.32
90
0.627968
false
3.679612
false
false
false
csaldias/python-usm
Certámenes resueltos/Certamen 1 2013-1/pregunta-2.py
1
2188
#Primero, pedimos la hora tiempo_llegada = raw_input("Ingrese hora: ") #Ahora vemos si acaso estamos en horario normal o punta (o no opera) if tiempo_llegada >= "06:30" and tiempo_llegada <= "22:30": #En operacion if (tiempo_llegada >= "07:30" and tiempo_llegada <= "09:00") or (tiempo_llegada >= "18:00" and t...
mit
6,007,246,369,956,435,000
43.653061
123
0.494059
false
3.285285
false
false
false
Psycojoker/geholparser
examples/test_student_calendar.py
1
2532
#!/usr/bin/env python # -*- coding: utf-8 -*- __author__ = 'Frederic' import os import sys sys.path.append("../src") from gehol import GeholProxy from gehol.studentsetcalendar import StudentSetCalendar from gehol.converters.utils import write_content_to_file from gehol.converters.rfc5545icalwriter import co...
mit
-4,477,545,330,042,107,400
37.515625
256
0.687772
false
2.711373
false
false
false
GitOnion/climate-commander
django-server/climate_commander/jobs/migrations/0020_auto_20160916_0053.py
1
1258
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations class Migration(migrations.Migration): dependencies = [ ('jobs', '0019_auto_20160824_1516'), ] operations = [ migrations.AddField( model_name='server', name='...
mit
-7,196,496,385,899,133,000
27.590909
61
0.5469
false
4.278912
false
false
false
weiweihuanghuang/wei-glyphs-scripts
Spacing/Show Kerning Pairs For Space.py
1
2909
#MenuTitle: Show Kerning Pairs for Space # -*- coding: utf-8 -*- __doc__=""" Show Kerning Pairs for this glyph in a new tab. """ import GlyphsApp import traceback thisFont = Glyphs.font Doc = Glyphs.currentDocument selectedLayers = thisFont.selectedLayers selectedMaster = thisFont.selectedFontMaster masterID = selecte...
apache-2.0
-4,223,721,100,003,747,000
28.393939
122
0.71296
false
2.877349
false
false
false
epage/The-One-Ring
src/contacts.py
1
2892
import logging import dbus import telepathy import util.misc as misc_utils _moduleLogger = logging.getLogger(__name__) class ContactsMixin(telepathy.server.ConnectionInterfaceContacts): ATTRIBUTES = { telepathy.CONNECTION : 'contact-id', telepathy.CONNECTION_INTERFACE_SIMPLE_PRESENCE : 'presence', telepat...
lgpl-2.1
-985,817,404,625,239
32.241379
84
0.75242
false
3.496977
false
false
false
m-ober/byceps
byceps/services/party/models/party.py
1
2070
""" byceps.services.party.models.party ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ :Copyright: 2006-2020 Jochen Kupperschmidt :License: Modified BSD, see LICENSE for details. """ from datetime import datetime from typing import Optional from ....database import db from ....typing import BrandID, PartyID from ....util.instanc...
bsd-3-clause
-7,402,205,738,868,657,000
31.34375
96
0.636715
false
3.514431
false
false
false
boland1992/SeisSuite
seissuite/sort_later/waveloc/gen_ctrl_file.py
2
2551
# -*- coding: utf-8 -*- """ Created on Thu Aug 6 08:56:57 2015 @author: boland The following script is used to generate a control file for the programme NonLinLoc. The format is such: Source description (multiple sources can be specified) GTSRCE stat_name loc_type x_srce y_srce z_srce elev Examples: GTSRCE...
gpl-3.0
6,378,401,050,146,038,000
27.344444
78
0.588397
false
3.241423
false
false
false
DesertBot/DesertBot
desertbot/modules/urlfollow/Mastodon.py
1
6216
""" Created on Aug 16, 2018 @author: StarlitGhost """ import json import re from urllib.parse import urlparse import dateutil.parser import dateutil.tz from bs4 import BeautifulSoup from twisted.plugin import IPlugin from twisted.words.protocols.irc import assembleFormattedText as colour, attributes as A from zope.i...
mit
7,755,254,143,440,010,000
38.846154
117
0.556789
false
4.30173
false
false
false
UBC-Victorious-410/project
tools/pmd_parser.py
1
1800
__author__ = 'Austin' import os,os.path import xml.etree.ElementTree as ET #get the path to the pmd commits #gwtcwd = get current working directory #print os.getcwd() def parse(logpath): rootdir = os.path.abspath(os.path.dirname(os.getcwd())) #print rootdir LoR= [] pmd_folder = logpath print p...
mit
-5,457,313,715,963,984,000
29
77
0.437222
false
4.137931
false
false
false
Ruide/angr-dev
angr-management/angrmanagement/ui/dialogs/load_binary.py
1
5343
import os import logging from PySide.QtGui import QDialog, QVBoxLayout, QHBoxLayout, QLabel, QTabWidget, QPushButton, QCheckBox, QFrame, \ QGroupBox, QListWidgetItem, QListWidget from PySide.QtCore import Qt import angr l = logging.getLogger('dialogs.load_binary') class LoadBinary(QDialog): def __init__(...
bsd-2-clause
3,316,653,497,871,381,000
27.725806
113
0.604155
false
3.852199
false
false
false
animekita/selvbetjening
selvbetjening/core/events/models/payment.py
1
1331
import logging from django.contrib.auth import get_user_model from django.core.exceptions import ObjectDoesNotExist from django.db import models from django.db.models.signals import post_save from django.dispatch import receiver from selvbetjening.core.events.models import Attend logger = logging.getLogger('selvbetj...
mit
-56,545,008,254,815,176
29.272727
106
0.686702
false
3.869186
false
false
false
eyaler/tensorpack
tensorpack/dataflow/dftools.py
1
1915
# -*- coding: utf-8 -*- # File: dftools.py import multiprocessing as mp from six.moves import range from ..utils.concurrency import DIE from ..utils.develop import deprecated from .serialize import LMDBSerializer, TFRecordSerializer __all__ = ['dump_dataflow_to_process_queue', 'dump_dataflow_to_lmdb', '...
apache-2.0
3,301,600,712,247,803,000
29.396825
88
0.610444
false
3.620038
false
false
false
kashev/kashev.rocks
manage.py
1
1238
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # kashev.rocks # Kashev Dalmia - kashev.dalmia@gmail.com from flask.ext.script import Manager from flask.ext.assets import ManageAssets from src.kashevrocks import app from src.assets import register_assets manager = Manager(app) assets_env = register_assets(app) manag...
mit
-2,425,773,170,606,357,000
22.807692
79
0.642973
false
3.598837
false
false
false
sonus89/FIPER
host/bridge.py
1
5953
from __future__ import print_function, absolute_import, unicode_literals # stdlib imports import time from datetime import datetime # project imports from FIPER.generic.subsystem import StreamDisplayer from FIPER.generic.util import Table from FIPER.generic.probeclient import Probe from FIPER.host.component import Li...
mit
6,569,932,496,502,960,000
32.256983
86
0.560726
false
4.000672
false
false
false
shravan-shandilya/web3.py
web3/utils/address.py
1
2834
# Address utilities from __future__ import absolute_import import re from .crypto import ( sha3, ) from .encoding import ( encode_hex, ) from .string import ( force_text, coerce_args_to_text, coerce_return_to_text, ) from .types import ( is_string, ) from .formatting import ( add_0x_prefix...
mit
-3,592,311,787,607,494,700
22.229508
95
0.6235
false
3.481572
false
false
false
dylanseago/IdeaHub
ideahub/apps/accounts/forms.py
1
4165
from crispy_forms.bootstrap import AppendedText, PrependedText from crispy_forms.helper import FormHelper from crispy_forms.layout import Layout, Submit, Div, Field from django import forms from django.contrib.auth import authenticate from django.contrib.auth.forms import AuthenticationForm, UserCreationForm from djang...
mit
3,287,142,277,204,960,000
33.147541
122
0.598319
false
4.095379
false
false
false
Adamssss/projectEuler
Problem 001-150 Python/pb060.py
1
1366
import math import time t1 = time.time() prime = [] def primeSieve(n): global prime n = (n+1)//2 p = [True]*(n) i = 1 prime.append(2) while i < n: if p[i]: t = 2*i+1 prime.append(t) p[i] = False j = 2*i*i+2*i while j < n: ...
mit
3,745,079,951,915,523,000
18.239437
39
0.444363
false
3.184149
false
false
false
slipstream/SlipStreamClient
client/src/main/scripts/slipstream-prepare-bootstrap.py
1
3230
#!/usr/bin/env python """ SlipStream Client ===== Copyright (C) 2013 SixSq Sarl (sixsq.com) ===== 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-...
apache-2.0
-7,584,596,654,818,867,000
32.645833
105
0.608359
false
4.012422
false
false
false
alcor-dtu/ml-poster
code/ImageDenoising.py
1
17727
# -*- coding: utf-8 -*- """ Created on Fri Jul 01 15:52:10 2016 @author: aluo """ from __future__ import print_function import os import sys import errno import timeit import pickle import numpy from matplotlib import pyplot from generate_patches import recombine_image import theano import theano.tensor as T from t...
gpl-3.0
-6,087,468,138,474,883,000
34.312749
134
0.586224
false
3.72416
false
false
false
F5Networks/f5-common-python
f5/bigip/tm/shared/licensing.py
1
3467
# coding=utf-8 # # Copyright 2016 F5 Networks Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or a...
apache-2.0
-455,912,475,897,392,100
29.377193
77
0.656367
false
4.291202
false
false
false
Gimpneek/exclusive-raid-gym-tracker
app/features/steps/page_object_models/gym_management.py
1
2044
""" Page Object Model - Gym Management Page """ from selenium.webdriver.common.by import By from .selectors.gym_management import TRACKED_GYMS_TABLE_ROW, REMOVE_BUTTON, \ TABLE_COLUMNS from .selectors.listing import SEARCH_BAR from .common import BasePage from .listing import ListingPage class GymManagementPage(B...
gpl-3.0
4,339,768,182,742,312,400
29.058824
78
0.600294
false
3.938343
false
false
false
simphony/tornado-webapi
tornadowebapi/exceptions.py
1
2025
from .http import httpstatus class WebAPIException(Exception): """Base exception for the REST infrastructure These are exceptions that can be raised by the handlers. """ #: HTTP code generally associated to this exception. #: Missing any better info, default is a server error. http_code = http...
bsd-3-clause
4,556,857,852,830,923,000
31.66129
70
0.719012
false
4.753521
false
false
false
vgupta6/Project-2
modules/s3/s3widgets.py
1
139828
# -*- coding: utf-8 -*- """ Custom UI Widgets @requires: U{B{I{gluon}} <http://web2py.com>} @copyright: 2009-2012 (c) Sahana Software Foundation @license: MIT Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the...
mit
-6,676,936,894,634,872,000
35.903405
239
0.454941
false
4.625897
false
false
false
sightmachine/simplecv2-examples
detection/template_matching.py
1
1190
""" This example uses the built in template matching. The easiest way to think of this is if you played the card matching game, the cards would pretty much have to be identical. The template method doesn't allow much for the scale to change, nor for rotation. This is the most basic pattern matching SimpleCV offers. ...
bsd-2-clause
-6,215,875,184,857,550,000
38.666667
100
0.709244
false
3.489736
false
false
false
rsignell-usgs/python-training
web-services/02-create_map.py
1
5754
# coding: utf-8 # <img style='float: left' width="150px" src="http://bostonlightswim.org/wp/wp-content/uploads/2011/08/BLS-front_4-color.jpg"> # <br><br> # # ## [The Boston Light Swim](http://bostonlightswim.org/) # # ### Sea Surface Temperature time-series maps # ### Load configuration # In[8]: import os try: ...
cc0-1.0
-4,326,278,565,068,629,000
27.344828
126
0.60723
false
3.0803
true
false
false
harayz/raspberry_pwn
src/pentest/voiper/sulley/pydbg/defines.py
8
5923
# # PyDBG # Copyright (C) 2006 Pedram Amini <pedram.amini@gmail.com> # # $Id: defines.py 193 2007-04-05 13:30:01Z cameron $ # # 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 th...
gpl-3.0
7,708,887,906,329,216,000
34.90303
119
0.6078
false
3.536119
false
false
false
savi-dev/heat
contrib/rackspace/heat/engine/plugins/cloud_server.py
1
18524
# 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 # d...
apache-2.0
1,099,201,296,044,303,500
37.672234
79
0.572932
false
4.190002
false
false
false
xpansa/pmis
purchase_request_to_rfq/models/purchase_request.py
1
6455
# -*- coding: utf-8 -*- ############################################################################## # # Copyright (C) 2015 Eficent (<http://www.eficent.com/>) # <contact@eficent.com> # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero ...
agpl-3.0
1,495,572,701,019,373,000
40.645161
78
0.550736
false
4.129878
false
false
false
PeterDaveHello/eden
modules/templates/RMSAmericas/menus.py
4
31132
# -*- coding: utf-8 -*- from gluon import current from s3 import * from s3layouts import * try: from .layouts import * except ImportError: pass import s3menus as default red_cross_filter = {"organisation_type.name" : "Red Cross / Red Crescent"} # ==============================================================...
mit
115,121,731,783,432,460
41.94069
124
0.416645
false
4.618991
false
false
false
qxf2/qxf2-page-object-model
page_objects/hamburger_menu_object.py
1
1429
""" This class models the hamburger menu object as a Page Object The hamburger menu has a bunch of options that can be: a) Clicked b) Hovered over """ import conf.locators_conf as locators from utils.Wrapit import Wrapit class Hamburger_Menu_Object: "Page Object for the hamburger menu" #locators menu_ico...
mit
-714,251,458,347,728,100
31.477273
91
0.658502
false
3.563591
false
false
false
jgarzik/smartcoin
p2p.py
1
1652
# # p2p.py - Distributed bond P2P network node # # Distributed under the MIT/X11 software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. # import struct import hashlib messagemap = { "version", "verack", "ping", "pong", "addr", "getaddr", } class MsgNull(obj...
mit
-4,048,811,819,991,636,000
19.395062
70
0.659806
false
2.655949
false
false
false
hasgeek/boxoffice
migrations/versions/45de268cd444_add_discount_policy_id_to_price.py
1
1452
"""add discount_policy_id to price. Revision ID: 45de268cd444 Revises: 4d7f840202d2 Create Date: 2016-03-31 15:29:51.897720 """ # revision identifiers, used by Alembic. revision = '45de268cd444' down_revision = '4d7f840202d2' from alembic import op import sqlalchemy as sa import sqlalchemy_utils def upgrade(): ...
agpl-3.0
-152,441,631,084,219,000
25.888889
87
0.626722
false
3.322654
false
false
false
SublimeText/Pywin32
lib/x32/win32com/client/tlbrowse.py
29
7827
import win32ui import win32con import win32api import commctrl import pythoncom from pywin.mfc import dialog class TLBrowserException(Exception): "TypeLib browser internal error" error = TLBrowserException FRAMEDLG_STD = win32con.WS_CAPTION | win32con.WS_SYSMENU SS_STD = win32con.WS_CHILD | win32con.WS_VISIBLE BS_ST...
bsd-3-clause
6,818,348,952,618,188,000
31.209877
135
0.700013
false
2.741506
false
false
false
our-city-app/oca-backend
src/shop/handlers.py
1
26782
# -*- coding: utf-8 -*- # Copyright 2020 Green Valley Belgium NV # # 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 appl...
apache-2.0
-555,640,803,217,862,100
41.8512
126
0.647786
false
3.885391
false
false
false
foursquare/pants
src/python/pants/backend/python/tasks/wrapped_pex.py
1
1760
# coding=utf-8 # Copyright 2017 Pants project contributors (see CONTRIBUTORS.md). # Licensed under the Apache License, Version 2.0 (see LICENSE). from __future__ import absolute_import, division, print_function, unicode_literals import logging from builtins import object from copy import copy logger = logging.getLo...
apache-2.0
2,174,291,343,092,144,000
27.387097
99
0.615909
false
3.499006
false
false
false
tgquintela/pySpatialTools
pySpatialTools/Retrieve/tools_retriever.py
1
4869
""" Retriever tools --------------- Tools to use retrievers """ import numpy as np from pySpatialTools.Discretization import _discretization_parsing_creation from retrievers import BaseRetriever ############################################################################### ############################# Create agg...
mit
-7,693,449,400,527,166,000
30.211538
79
0.600945
false
3.870429
false
false
false
leanlyne/ShootColorX
cocos2d/tools/project-creator/create_project.py
13
2021
#!/usr/bin/python #coding=utf-8 """**************************************************************************** Copyright (c) 2013 cocos2d-x.org http://www.cocos2d-x.org Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), t...
mit
5,378,159,879,600,896,000
37.132075
95
0.65809
false
4.541573
false
false
false
SUNET/eduid-webapp
src/eduid_webapp/signup/tests/test_app.py
1
22920
# -*- coding: utf-8 -*- # # Copyright (c) 2016 NORDUnet A/S # Copyright (c) 2018-2019 SUNET # 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 r...
bsd-3-clause
-7,160,105,695,666,060,000
43.853229
121
0.633202
false
3.723802
true
false
false
itsbenweeks/orcoursetrion
orcoursetrion/lib/github.py
2
17364
# -*- coding: utf-8 -*- """ Github class for making needed API calls to github """ import base64 from itertools import chain import shutil import tempfile import requests import sh CLONE_DIR = 'cloned_repo' class GitHubException(Exception): """Base exception class others inherit.""" pass class GitHubRepo...
bsd-2-clause
323,984,314,876,844,800
32.782101
75
0.552292
false
4.356247
false
false
false
vortex-ape/scikit-learn
sklearn/impute.py
7
24042
"""Transformers for missing value imputation""" # Authors: Nicolas Tresegnie <nicolas.tresegnie@gmail.com> # Sergey Feldman <sergeyfeldman@gmail.com> # License: BSD 3 clause import warnings import numbers import numpy as np import numpy.ma as ma from scipy import sparse from scipy import stats from .base im...
bsd-3-clause
-4,766,323,149,635,850,000
37.101426
79
0.550453
false
4.281745
false
false
false
asharahmed/artemis
scraper.py
1
1205
import requests import os shows=[] page=str(requests.get("http://dramaonline.com").text.encode('ascii','ignore')) for item in page.split("\n"): if "title=" in item: print ("Title tag in item {0}".format(item)) if "<a href=" in item: print ("<a href= found") episodepage=item.split('<a href="')[1].split('"')[0...
gpl-2.0
-6,017,492,612,978,569,000
40.586207
88
0.638174
false
2.975309
false
false
false
twerp/django-admin-flexselect-py3
test_app/models.py
1
1141
from django.db import models as m from django.core.exceptions import ValidationError """ No changes to the models are needed to use flexselect. """ class Company(m.Model): name = m.CharField(max_length=80) def __str__(self): return self.name class CompanyContactPerson(m.Model): company = m.For...
cc0-1.0
-4,173,985,098,094,928,400
23.276596
77
0.628396
false
4.017606
false
false
false
PyBossa/app-ushahidi
createTasks.py
1
9261
#!/usr/bin/env python # -*- coding: utf-8 -*- # This file is part of PyBOSSA. # # PyBOSSA 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 late...
agpl-3.0
-5,847,963,015,010,918,000
36.192771
86
0.541518
false
4.152915
true
false
false
mapres21/Proyecto_LSST-
Curve_Star_1.py
1
2733
import numpy as np import matplotlib.pyplot as plt # Matriz que contiene los datos Matriz = np.genfromtxt("Star_1.csv", delimiter=",") # Vectores con cada una de las bandas y los errores U_band = Matriz[:, 0] G_band = Matriz[:, 1] R_band = Matriz[:, 2] I_band = Matriz[:, 3] Z_band = Matriz[:, 4] EU_band = Matriz[:, 5...
gpl-3.0
-3,486,409,329,770,050,600
26.606061
69
0.666667
false
2.333903
false
true
false
redsnapper8t8/django-cacheback
cacheback/base.py
1
12027
import time import logging from django.core.cache import cache from django.conf import settings from cacheback import tasks logging.basicConfig() logger = logging.getLogger('cacheback') MEMCACHE_MAX_EXPIRATION = 2592000 class Job(object): """ A cached read job. This is the core class for the package ...
mit
2,435,693,329,812,904,400
37.060127
90
0.565228
false
4.538491
false
false
false
lamontu/data-analysis
numpy/conditional_logical.py
1
1289
# -*- coding: utf-8 -*- import numpy as np import numpy.random as np_random print(""" ## zip(*iterables) Make an iterator that aggregates elements from each of the iterables""") zipped = zip([1, 2, 3], [4, 5, 6], [7, 8, 9]) print(zipped) print(list(zipped)) print() print("## Select elements from boolean array:") ...
gpl-3.0
-6,410,535,431,654,735,000
25.854167
75
0.602017
false
2.646817
false
false
false
olekw/cyphesis
data/rulesets/deeds/scripts/world/traits/Nourishable.py
2
2117
import server from atlas import Operation, Entity # Nourishable entities that receive nourishment and increase their '_nutrients' value. class Nourishable(server.Thing): def nourish_operation(self, op): # Get the mass of the contained arg, convert it to nutrient through _modifier_eat* properties, ...
gpl-2.0
527,064,252,118,595,800
50.634146
108
0.57487
false
4.00189
false
false
false
andfoy/margffoy-tuay-server
env/lib/python2.7/site-packages/tornadoredis/client.py
1
54624
# -*- coding: utf-8 -*- import sys from functools import partial import collections from collections import namedtuple, deque import logging import weakref import datetime import time as mod_time from tornado.ioloop import IOLoop from tornado import gen from tornado import stack_context from tornado.escape import to_...
gpl-2.0
-1,550,556,144,528,038,700
35.488978
101
0.57894
false
4.152338
false
false
false
bmcfee/gordon
scripts/audio_intake_from_tracklist.py
1
17235
#!/usr/bin/env python # Copyright (C) 2010 Douglas Eck # # This file is part of Gordon. # # Gordon 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 la...
gpl-3.0
-3,791,216,342,320,178,000
39.362998
121
0.582187
false
3.986815
false
false
false
cirosantilli/linux-kernel-module-cheat
shell_helpers.py
1
20166
#!/usr/bin/env python3 import base64 import distutils.file_util import io import itertools import os import shlex import shutil import signal import stat import subprocess import sys import threading from typing import List, Union import urllib.request class LF: ''' LineFeed (AKA newline). Singleton clas...
gpl-3.0
-5,774,252,105,433,351,000
34.946524
140
0.528265
false
3.989318
true
false
false
egafford/sahara
sahara/plugins/mapr/versions/v5_0_0_mrv2/version_handler.py
2
2805
# Copyright (c) 2015, MapR Technologies # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to...
apache-2.0
-3,551,650,006,758,706,000
34.961538
75
0.663458
false
3.497506
false
false
false
eeriks/velo.lv
velo/registration/competition_classes/rm2017.py
2
10599
import datetime from django.utils.translation import activate from io import BytesIO from reportlab.lib.pagesizes import A4 from reportlab.lib.units import cm from reportlab.pdfgen import canvas from velo.results.tasks import create_result_sms from velo.core.models import Log from velo.core.pdf import fill_page_with_...
gpl-3.0
3,747,598,638,551,850,000
43.71308
230
0.580164
false
3.675685
false
false
false
Cenditel/cenditel.comunidades.cynin
src/ubify.smartview/setup.py
5
2860
############################################################################### #cyn.in is an open source Collaborative Knowledge Management Appliance that #enables teams to seamlessly work together on files, documents and content in #a secure central environment. # #cyn.in v2 an open source appliance is distributed ...
gpl-3.0
-5,875,803,171,157,364,000
39.28169
83
0.661538
false
3.950276
false
false
false
ethoms/netdrive-connector
netdriveconnector/NetdriveConnector.py
5
29380
# Copyright (c) 2015, Euan Thoms # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # # * Redistributions of source code must retain the above copyright notice, this # list of conditions and the ...
bsd-2-clause
106,535,529,566,496,180
46.083333
271
0.641082
false
4.557158
false
false
false
ellethee/getwebfilesinator
getwebfilesinator/getwebfilesinator/commands.py
1
1349
# -*- coding: utf-8 -*- """ =========================================== Commands :core:`getwebfilesinator.commands` =========================================== Commands for the GetWebFilesInator """ from argparseinator import ArgParseInated from argparseinator import arg from argparseinator import class_args from getwe...
mit
4,739,849,057,103,220,000
36.472222
71
0.656042
false
4.296178
true
false
false
cropleyb/pentai
pentai/ai/t_ab_state.py
1
13516
#!/usr/bin/env python import unittest import pentai.base.human_player as h_m import pentai.base.rules as r_m import pentai.base.game as g_m import pentai.ai.priority_filter as pf_m import pentai.ai.utility_calculator as uc_m from pentai.ai.ab_state import * def get_black_line_counts(ab_game_state): return ab_ga...
mit
-94,669,123,988,427,790
34.851459
71
0.546168
false
2.752749
true
false
false
azarai/python-mochi
src/setup.py
1
1073
""" python-mochi ------------ python-mochi is a lib for working with the `mochiads api <https://www.mochimedia.com/support/pub_docs>`_ Links ````` * `website <http://codeboje.de/python-mochi/>`_ * `development version <http://github.com/azarai/python-mochi>`_ """ from distutils.core import setup ...
bsd-3-clause
7,604,597,016,173,331,000
27
104
0.571295
false
3.859712
false
false
false
humrochagf/lektor-creative-commons
lektor_creative_commons/translation.py
1
1403
# -*- coding: utf-8 -*- from __future__ import unicode_literals import gettext import os import sys PY3 = sys.version_info > (3,) LOCALES_DIR = os.path.join( os.path.dirname(os.path.abspath(__file__)), 'locales' ) class Translator(object): def configure(self, locale): if not os.path.exists(os...
mit
-7,256,687,341,937,554,000
20.921875
69
0.612259
false
4.031609
false
false
false
XaF/rteval
rteval/modules/measurement/__init__.py
1
7889
# # Copyright 2012 - 2013 David Sommerseth <davids@redhat.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 2 of the License, or # (at your option) any later vers...
gpl-2.0
-2,603,962,293,298,363,000
36.037559
90
0.628977
false
4.477299
true
false
false
foobnix/foobnix
foobnix/helpers/dialog_entry.py
1
12288
#-*- coding: utf-8 -*- ''' Created on 24 авг. 2010 @author: ivan ''' from gi.repository import Gtk import logging from foobnix.fc.fc import FC from foobnix.helpers.image import ImageBase from foobnix.util.const import SITE_LOCALE, ICON_FOOBNIX from foobnix.util.localization import foobnix_localization from foobnix.gu...
gpl-3.0
-2,835,426,773,235,846,000
37.753943
138
0.638991
false
3.562935
false
false
false
rice-eclipse/rice-eclipse-mk1-1
mk1_gui/logger.py
1
2728
""" Author: Kevin Lin, kevinlin@rice.edu Modified version of Logger used by Skynet Senior Design team at Rice University. """ import time class LogLevel: """ Mapping of log level enums to names. """ DEBUGV = {'name': 'DEBUGV', 'value' : 4} DEBUG = {'name': 'DEBUG', 'value': 3} INFO = {'name':...
gpl-3.0
6,142,132,702,150,370,000
24.259259
93
0.531891
false
4.041481
false
false
false
imcgreer/idmrm
cfht/cfhtrmphot.py
2
16355
#!/usr/bin/env python import os,sys import numpy as np import subprocess import multiprocessing from functools import partial from astropy.io import fits from astropy.table import Table,vstack,hstack,join from astropy.stats import sigma_clip from astropy.wcs import InconsistentAxisTypesError from bokpipe import bokph...
gpl-3.0
-6,972,535,924,764,832,000
35.183628
79
0.667074
false
2.776269
false
false
false
tejal29/pants
src/python/pants/base/target.py
1
19104
# 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,264,794,649,847,011,000
36.754941
111
0.706397
false
4.097812
false
false
false
USC-ACTLab/pyCreate2
pyCreate2/visualization/virtual_create.py
1
2464
""" Module to control a virtual create """ from ..vrep import vrep as vrep from enum import Enum class VirtualCreate: """ Class to control a virtual create in V-REP. """ def __init__(self, client_id): """Constructor. Args: client_id (integer): V-REP client id. ""...
mit
540,666,363,558,763,500
37.5
114
0.622565
false
3.311828
false
false
false
lord63/wangyi_music_top100
pyspider/app.py
1
1273
#!/usr/bin/env python # -*- coding: utf-8 -*- from __future__ import absolute_import, unicode_literals from os import path import json from flask import Flask, g, render_template from peewee import Model, SqliteDatabase, CharField, FloatField app = Flask(__name__) # TODO: override on_result(self, result) method t...
mit
3,199,717,885,062,091,000
22.145455
78
0.685782
false
3.385638
false
false
false
wolverineav/neutron
neutron/agent/l3/agent.py
3
30869
# Copyright 2012 VMware, 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 by a...
apache-2.0
-1,998,541,116,222,786,800
42.848011
79
0.584405
false
4.265441
true
false
false
pradeepbp/stocker2
watchlist.py
1
2048
#!/usr/bin/python ''' watchlist.py Copyright (C) 2011 Pradeep Balan Pillai 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 la...
gpl-3.0
7,806,833,505,427,336,000
32.57377
92
0.615234
false
4.087824
false
false
false
nuxeh/morph
morphlib/morphologyfinder.py
1
1834
# Copyright (C) 2013-2015 Codethink Limited # # 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 of the License. # # This program is distributed in the hope that it will be useful, # but...
gpl-2.0
6,994,628,587,820,302,000
29.065574
73
0.673391
false
4.121348
false
false
false
napalm-automation/napalm-yang
napalm_yang/models/openconfig/network_instances/network_instance/protocols/protocol/ospfv2/areas/area/lsdb/lsa_types/lsa_type/lsas/lsa/opaque_lsa/router_information/tlvs/tlv/unknown_tlv/__init__.py
1
12582
# -*- coding: utf-8 -*- from operator import attrgetter from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType from pyangbind.lib.yangtypes import RestrictedClassType from pyangbind.lib.yangtypes import TypedListType from pyangbind.lib.yangtypes import YANGBool from pyangbind.lib.yangtypes import YANGListTy...
apache-2.0
3,881,322,362,448,355,000
36.783784
375
0.574313
false
4.289806
true
false
false
tobias47n9e/social-core
social_core/backends/line.py
3
3130
# vim:fileencoding=utf-8 import requests import json from .oauth import BaseOAuth2 from ..exceptions import AuthFailed from ..utils import handle_http_errors class LineOAuth2(BaseOAuth2): name = 'line' AUTHORIZATION_URL = 'https://access.line.me/dialog/oauth/weblogin' ACCESS_TOKEN_URL = 'https://api.line...
bsd-3-clause
5,554,109,290,867,153,000
32.297872
75
0.554952
false
4.075521
false
false
false
mcgonagle/ansible_f5
library/_bigip_node.py
1
15441
#!/usr/bin/python # -*- coding: utf-8 -*- # # Copyright (c) 2017 F5 Networks Inc. # Copyright (c) 2013 Matt Hite <mhite@hotmail.com> # GNU General Public License v3.0 (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from __future__ import absolute_import, division, print_function __metaclass__ = type ANSIBL...
apache-2.0
6,062,553,131,121,641,000
34.578341
166
0.574704
false
4.2177
false
false
false
ttitto/python
Basics/ExceptionsPackagesFiles/ExceptionsPackagesFiles/AveragePriceFromFileByGroups.py
1
1840
import sys from io import TextIOWrapper def get_categorized_prices_from_file(filepath :str) -> dict: prices = {} try: with open(filepath, 'r') as f: assert isinstance(f, TextIOWrapper) for line_number, line_content in enumerate(f): try: if line...
mit
-3,506,475,599,382,948,400
38.170213
140
0.588043
false
3.982684
false
false
false
elfi-dev/elfi
elfi/methods/density_ratio_estimation.py
1
7670
"""This module contains methods for density ratio estimation.""" import logging from functools import partial import numpy as np logger = logging.getLogger(__name__) def calculate_densratio_basis_sigma(sigma_1, sigma_2): """Heuristic way to choose a basis sigma for density ratio estimation. Parameters ...
bsd-3-clause
-3,806,967,867,252,121,000
36.05314
96
0.560626
false
3.802677
false
false
false
Esri/raster-functions
functions/Reference.py
1
21163
import numpy as np """ This class serves as a quick reference for all methods and attributes associated with a python raster function. Feel free to use this template a starting point for your implementation or as a cheat-sheet. """ class Reference(): """Class name defaults to module name unles...
apache-2.0
6,065,817,760,460,987,000
65.613419
150
0.597978
false
5.24876
true
false
false
time-river/wander
practice/urllib/黑板客爬虫闯关/third.py
1
4637
''' 爬虫闯关第一关 http://www.heibanke.com/lesson/crawler_ex00/ 提示技能: 模拟登陆、csrf-token 来自 http://www.zhihu.com/question/20899988 黑板客的回答 这里成功实现了模拟登陆,写一下思路: 1.提交登陆表单,查看POST方法文件的消息头、Cookie、参数 消息头中的请求头没啥有价值的内容,请求网址与登陆网址是一样的 Cookie倒是引起了注意。清除Cookie,直接打开登陆界面,服务器响应了一个同样名称的Cookie 表单参数里有这三个选项: "c...
mit
-7,444,610,969,289,944,000
38.820755
115
0.562189
false
3.307994
false
false
false
TariqAHassan/BioVida
biovida/images/_interface_support/dicom_data_to_dict.py
1
3569
# coding: utf-8 """ Convert DICOM Data into a Python Dictionary ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ """ # Also see: https://github.com/darcymason/pydicom/issues/319. import os from biovida.support_tools.support_tools import cln, dicom def _extract_numeric(value): """ :param value: :ret...
bsd-3-clause
-6,127,188,851,917,151,000
25.437037
93
0.538526
false
3.702282
false
false
false
kazeevn/Canecycle-of-Caerbannog
canecycle/tests/cache_test.py
1
2595
import os.path from unittest import TestCase from tempfile import NamedTemporaryFile from itertools import izip, imap import numpy as np from canecycle.reader import from_shad_lsml from canecycle.cache import CacheWriter, CacheReader class TestReader(TestCase): test_file = os.path.join(os.path.dirname(os.path.re...
gpl-3.0
-91,430,640,367,480,530
37.731343
73
0.630058
false
3.75
true
false
false
geobricks/pgeorest
pgeorest/rest/browse_trmm2.py
1
2691
import json from flask import Blueprint from flask import Response from flask.ext.cors import cross_origin # from pgeo.config.settings import read_config_file_json from pgeo.error.custom_exceptions import PGeoException from pgeo.dataproviders import trmm2 as t browse_trmm2 = Blueprint('browse_trmm2', __name__) # conf...
gpl-2.0
-503,901,827,237,316,000
34.421053
88
0.674842
false
3.136364
false
false
false
sergiusens/snapcraft
tests/unit/sources/test_mercurial.py
2
8603
# -*- Mode:Python; indent-tabs-mode:nil; tab-width:4 -*- # # Copyright (C) 2015-2018 Canonical Ltd # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License version 3 as # published by the Free Software Foundation. # # This program is distributed in ...
gpl-3.0
4,370,385,673,678,980,000
32.474708
85
0.598628
false
3.659294
true
false
false
srgblnch/LinacDS
LinacData.py
1
222153
# ##### BEGIN GPL LICENSE BLOCK ##### # # 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 distrib...
gpl-3.0
-7,029,453,707,529,209,000
49.351995
83
0.471468
false
4.56776
false
false
false
az0/bleachbit
tests/TestMemory.py
1
5354
# vim: ts=4:sw=4:expandtab # -*- coding: UTF-8 -*- # BleachBit # Copyright (C) 2008-2019 Andrew Ziem # https://www.bleachbit.org # # 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
-4,627,705,048,792,550,000
36.971631
90
0.59619
false
3.849029
true
false
false
sauliusl/scipy
scipy/stats/tests/test_continuous_basic.py
18
13750
from __future__ import division, print_function, absolute_import import warnings import numpy as np import numpy.testing as npt from scipy import integrate from scipy import stats from scipy.special import betainc from common_tests import (check_normalization, check_moment, check_mean_expect, check_var_expec...
bsd-3-clause
1,748,733,670,844,875,000
37.300836
108
0.589018
false
3.218633
true
false
false
fedora-conary/rmake-2
rmake_test/functional_test/cmdlinetest/chroottest.py
2
9233
# # Copyright (c) SAS Institute Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in w...
apache-2.0
-3,949,263,921,289,999,000
34.375479
89
0.56428
false
4.012603
true
false
false
gdanezis/rousseau-chain
rousseau-package/consensus.py
1
10893
# This is a convergence simulation for gossip based consensus. import json import time import logging from os import urandom from random import sample, shuffle from binascii import hexlify from collections import defaultdict, Counter from hashlib import sha256 from struct import pack def make_shard_map(num = 100): ...
bsd-2-clause
-6,033,557,547,291,339,000
32.829193
124
0.560543
false
3.907102
false
false
false
drjnmrh/oztoolz
streams/__main__.py
1
2459
""" Runs a code review tool pylint for each script in the 'streams' package. Author: O.Z. """ # imports import os import sys from pathlib import Path from subprocess import Popen from subprocess import PIPE from oztoolz.ioutils import select_all_scripts from oztoolz.ioutils import safe_write_log as w...
mit
664,546,982,584,732,800
26.943182
77
0.647418
false
3.812403
false
false
false