repo_name
stringlengths
6
90
path
stringlengths
4
230
copies
stringlengths
1
4
size
stringlengths
4
7
content
stringlengths
734
985k
license
stringclasses
15 values
hash
int64
-9,223,303,126,770,100,000
9,223,233,360B
line_mean
float64
3.79
99.6
line_max
int64
19
999
alpha_frac
float64
0.25
0.96
autogenerated
bool
1 class
ratio
float64
1.5
8.06
config_test
bool
2 classes
has_no_keywords
bool
2 classes
few_assignments
bool
1 class
Morgan-Stanley/treadmill
lib/python/treadmill/dirwatch/windows_dirwatch.py
2
7015
"""Implements directory watcher using ReadDirectoryChangesW. """ from __future__ import absolute_import from __future__ import division from __future__ import print_function from __future__ import unicode_literals import collections import errno import logging import os # E0401: Unable to import windows only pakages...
apache-2.0
-794,456,385,995,107,500
30.742081
79
0.538988
false
4.195574
false
false
false
lazka/senf
senf/_stdlib.py
7
4466
# -*- coding: utf-8 -*- # Copyright 2016 Christoph Reiter # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the # "Software"), to deal in the Software without restriction, including # without limitation the rights to use, copy, modify...
mit
7,927,462,000,774,311,000
28
77
0.606807
false
3.817094
false
false
false
egbertbouman/tribler-g
Tribler/Core/DecentralizedTracking/pymdht/core/bencode.py
1
6590
# Copyright (C) 2009-2010 Raul Jimenez # Released under GNU LGPL 2.1 # See LICENSE.txt for more information import cStringIO import logging logger = logging.getLogger('dht') class LoggingException(Exception): def __init__(self, msg): logger.info('%s: %s' % (self.__class__, msg)) cl...
lgpl-2.1
-1,011,539,929,233,354,400
27.652174
77
0.563885
false
3.723164
false
false
false
noelevans/sandpit
bayesian_methods_for_hackers/small_large_sample_comparison_LoLN_ch04.py
1
1517
from matplotlib import pyplot as plt import numpy as np import pymc as pm def main(): std_height = 15 mean_height = 150 n_counties = 5000 pop_generator = pm.rdiscrete_uniform norm = pm.rnormal # generate some artificial population numbers population = pop_generator(100, 1500, size=n_coun...
mit
1,257,925,968,066,093,000
31.978261
77
0.627554
false
3.569412
false
false
false
gorel/chatschoolette
chatschoolette/mod_chat/controllers.py
1
4023
import datetime import os from flask import ( Blueprint, flash, redirect, render_template, request, url_for, ) from flask.ext.login import ( current_user, login_required, ) # Import main DB and Login Manager for app from chatschoolette import db, login_manager, flash_form_errors, open...
mit
7,479,328,637,337,096,000
28.364964
77
0.621427
false
3.495222
false
false
false
trjones841/pynet_class
Exercises/Week4/Paramikio_Basic.py
1
1231
import paramiko import time #import getpass- use getpass.getpass('Password:') if using a true terminal IPADDR = '192.168.0.121' USER01 = 'tjones' #PASSWD = getpass.getpass('Password:') #PASSWD = raw_input('Password:') PASSWD = 'Iam!g0ing' PORT = 22 CMD = "show interfaces terse\n" try: remote_conn_pre = paramiko....
apache-2.0
-2,148,404,212,234,199,300
30.564103
109
0.700244
false
3.345109
false
false
false
InsightSoftwareConsortium/SimpleITK
Examples/ImageRegistrationMethodBSpline3/ImageRegistrationMethodBSpline3.py
4
3784
#!/usr/bin/env python # ========================================================================= # # Copyright NumFOCUS # # 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:/...
apache-2.0
-3,628,340,658,511,682,600
35.384615
86
0.659355
false
3.709804
false
false
false
aidiss/disciplines
disciplines/theory/new_discipline_announcements.py
1
1159
#new_discipline_announcements.py """Anouncing a new discipline Author: Aidis Stukas """ url = r'C:\Users\Main\Dropbox\Research\announcements of new disciplines in scientific journals\spreadsheet_2014_10_10.xlsx' import pandas as pd df = table = pd.read_excel(url, sheetname=1) ''' import xlrd workbook = xlrd.open_...
mit
-7,911,456,947,119,325,000
27.975
123
0.675582
false
2.670507
false
false
false
ctn-waterloo/nengo_theano
nengo_theano/ensemble.py
1
17471
import theano from theano.sandbox.rng_mrg import MRG_RandomStreams as RandomStreams from theano import tensor as TT import numpy as np from _collections import OrderedDict from . import cache from . import ensemble_origin from . import filter from . import helpers from . import neuron from . import origin from .hPES_...
mit
4,608,181,271,967,306,000
42.138272
89
0.589491
false
4.39522
false
false
false
skarphed/skarphed
admin/src/skarphedadmin/gui/skarphed/Modules.py
1
11764
#!/usr/bin/python #-*- coding: utf-8 -*- ########################################################### # © 2011 Daniel 'grindhold' Brendle and Team # # This file is part of Skarphed. # # Skarphed is free software: you can redistribute it and/or # modify it under the terms of the GNU Affero General Public License # as ...
agpl-3.0
810,276,132,227,466,500
47.209016
163
0.646349
false
3.379201
false
false
false
snowflakedb/snowflake-connector-python
test/unit/test_auth_webbrowser.py
1
6780
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Copyright (c) 2012-2021 Snowflake Computing Inc. All right reserved. # from mock import MagicMock, Mock, PropertyMock from snowflake.connector.auth_webbrowser import AuthByWebBrowser from snowflake.connector.constants import OCSPMode from snowflake.connector.descripti...
apache-2.0
-1,007,432,440,355,865,000
33.591837
88
0.666077
false
3.604466
true
false
false
greenoaktree/measurement_toolbox
gr-mtb/python/qa_distributed_benchmarking.py
2
3504
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Copyright 2014 Marcus Müller. # # This 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, or (at your option) # any later version. # # This s...
gpl-3.0
-5,296,431,948,807,628,000
32.682692
265
0.640594
false
3.61134
true
false
false
hartym/bonobo
tests/test_execution.py
2
1677
from bonobo.config.processors import use_context_processor from bonobo.constants import BEGIN, END from bonobo.execution.contexts.graph import GraphExecutionContext from bonobo.execution.strategies import NaiveStrategy from bonobo.structs.graphs import Graph def generate_integers(): yield from range(10) def squ...
apache-2.0
-1,308,951,303,751,729,000
19.9625
65
0.701849
false
3.881944
false
false
false
spookylukey/django-nyt
django_nyt/utils.py
1
2973
from __future__ import absolute_import from __future__ import unicode_literals from . import _disable_notifications from django.db.models import Model from django.utils.translation import ugettext as _ from . import models def notify(message, key, target_object=None, url=None, filter_exclude={}, recipient_users=None...
apache-2.0
-3,582,001,316,971,181,000
37.115385
97
0.676757
false
4.424107
false
false
false
iot-factory/synapse
synapse/storage/background_updates.py
1
9189
# -*- coding: utf-8 -*- # Copyright 2014, 2015 OpenMarket Ltd # # 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
983,820,514,587,386,800
34.894531
81
0.61258
false
4.419913
false
false
false
VcamX/pywikibot-core
tests/family_tests.py
4
9003
# -*- coding: utf-8 -*- """Tests for the family module.""" # # (C) Pywikibot team, 2014 # # Distributed under the terms of the MIT license. # from __future__ import unicode_literals __version__ = '$Id$' from pywikibot.family import Family from pywikibot.exceptions import UnknownFamily import pywikibot.site from te...
mit
3,507,842,103,015,110,700
38.31441
85
0.613129
false
3.93832
true
false
false
nixingyang/Kaggle-Competitions
Fisheries Monitoring/solution_classification_with_CV.py
1
14426
import matplotlib matplotlib.use("Agg") import os import glob import shutil import pylab import numpy as np from keras.applications.vgg16 import VGG16 from keras.callbacks import Callback, ModelCheckpoint from keras.layers import Activation, Input from keras.layers.convolutional import Convolution2D from keras.layers....
mit
9,049,834,654,791,759,000
40.936047
87
0.563289
false
4.008336
false
false
false
yannrouillard/weboob
weboob/tools/browser2/filters.py
1
4095
# -*- coding: utf-8 -*- # Copyright(C) 2014 Romain Bignon # # This file is part of weboob. # # weboob 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 opti...
agpl-3.0
-7,499,216,863,068,677,000
28.673913
89
0.594139
false
4.010774
false
false
false
machination/machination
machination/fetcher/__init__.py
1
1724
#!/usr/bin/python # vim: set fileencoding=utf-8: """A machination module to fetch "Bundles". Machination workers call this library to request that a set of bundles be downloaded. This library will read a set of configuration files and load appropriate submodules to fetch the files. """ __author__ = "Bruce Duncan" ...
gpl-3.0
-8,598,486,518,698,276,000
27.262295
102
0.580046
false
4.085308
true
false
false
ergo/ziggurat_foundations
ziggurat_foundations/migrations/versions/54d08f9adc8c_add_registered_date_.py
1
1029
"""add registered_date to user Revision ID: 54d08f9adc8c Revises: 2d472fe79b95 Create Date: 2012-03-10 11:12:39.353857 """ from __future__ import unicode_literals import sqlalchemy as sa from alembic import op from sqlalchemy.dialects.postgresql.base import PGDialect # revision identifiers, used by Alembic. revisio...
bsd-3-clause
618,539,069,930,424,200
21.866667
58
0.578231
false
3.728261
false
false
false
victor-rene/MicroScada
led.py
2
1294
import os, util from kivy.uix.image import Image from kivy.uix.gridlayout import GridLayout # from kivy.uix.popup import Popup # from variableselector import VariableSelector from datamgr import variables class Binding: def __init__(self, source, source_attr, target, target_attr): self.source = source self...
mit
2,399,167,195,942,099,000
29.116279
104
0.671561
false
3.275949
false
false
false
credativUK/connector-telephony
crm_claim_phone/__openerp__.py
2
1883
# -*- encoding: utf-8 -*- ############################################################################## # # CRM Claim Phone module for Odoo/OpenERP # Copyright (C) 2014 Alexis de Lattre <alexis@via.ecp.fr> # # This program is free software: you can redistribute it and/or modify # it under the terms of the ...
agpl-3.0
815,375,184,675,428,500
36.66
78
0.629315
false
3.850716
false
false
false
ecino/compassion-switzerland
report_compassion/models/report_tax_receipt.py
3
1772
# -*- coding: utf-8 -*- ############################################################################## # # Copyright (C) 2017 Compassion CH (http://www.compassion.ch) # Releasing children from poverty in Jesus' name # @author: Emanuel Cino <ecino@compassion.ch> # # The licence is in the file __manifest__.py...
agpl-3.0
-4,935,083,849,099,510,000
33.076923
78
0.527652
false
4.027273
false
false
false
openprocurement/openprocurement.tender.openua
openprocurement/tender/openua/views/award_complaint_document.py
1
5012
# -*- coding: utf-8 -*- from openprocurement.tender.belowthreshold.views.award_complaint_document import TenderAwardComplaintDocumentResource from openprocurement.api.utils import ( context_unpack, json_view, update_file_content_type, upload_file, raise_operation_error, error_handler ) from open...
apache-2.0
-8,829,764,628,582,360,000
56.609195
164
0.681963
false
4.028939
false
false
false
Habbie/pdns
regression-tests.recursor-dnssec/test_RoutingTag.py
1
11754
import dns import os import socket import struct import threading import time import clientsubnetoption import subprocess from recursortests import RecursorTest from twisted.internet.protocol import DatagramProtocol from twisted.internet import reactor emptyECSText = 'No ECS received' nameECS = 'ecs-echo.example.' nam...
gpl-2.0
3,626,492,662,232,493,000
37.286645
192
0.638676
false
3.481635
true
false
false
rboman/progs
sandbox/webapi/dropboxapi_download_url.py
1
3149
#! /usr/bin/env python3 # -*- coding: utf-8 -*- import json import requests import os.path def get_api_token(): """read my api token """ with open('E:\Dropbox\Bin\dropbox_api_token.txt') as f: token = f.readline().rstrip() # print("token='{}'".format(token)) return token def space_usage...
apache-2.0
6,839,834,887,018,349,000
36.488095
373
0.600826
false
3.001907
false
false
false
antonagestam/collectfast
collectfast/management/commands/collectstatic.py
1
6998
from concurrent.futures import ThreadPoolExecutor from typing import Any from typing import Dict from typing import List from typing import Optional from typing import Tuple from typing import Type from django.conf import settings as django_settings from django.contrib.staticfiles.management.commands import collectsta...
mit
-76,474,166,044,574,500
38.094972
157
0.637754
false
4.246359
false
false
false
qsnake/gpaw
gpaw/test/fd2lcao_restart.py
2
1558
"""Test read/write of restart files between fd and lcao mode""" import os from ase import Atom, Atoms from gpaw import GPAW, Mixer, restart, FermiDirac from gpaw.test import equal energy_tolerance = 0.0001 niter_tolerance = 0 if not os.path.isfile('Na4_fd.gpw'): # Do grid kpts calculation a = 3.31 atoms...
gpl-3.0
-983,259,085,555,755,400
30.16
72
0.585366
false
2.832727
false
false
false
EduJGURJC/elastest-service-manager
src/esm/models/service_instance.py
1
3496
# coding: utf-8 from __future__ import absolute_import # from esm.models.last_operation import LastOperation from esm.models.service_type import ServiceType from .base_model_ import Model from ..util import deserialize_model class ServiceInstance(Model): """ NOTE: This class is auto generated by the swagger...
apache-2.0
-3,378,832,943,092,815,000
27.193548
104
0.612986
false
4.630464
false
false
false
hacknashvillereview/review_application
review_app/api/views.py
1
2445
# Create your views here. from django.http import HttpResponse from rest_framework.views import APIView from rest_framework import generics, filters from rest_framework.reverse import reverse from rest_framework.response import Response from rest_framework.settings import api_settings from api.serializers import Revi...
mit
7,983,429,369,518,773,000
28.107143
113
0.703067
false
4.486239
false
false
false
rhinstaller/lorax
src/pylorax/api/errors.py
2
3105
# # lorax-composer API server # # Copyright (C) 2018 Red Hat, Inc. # # 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. # ...
gpl-2.0
4,682,957,222,562,508,000
35.964286
80
0.761997
false
3.871571
false
false
false
miracle2k/django-filebrowser
filebrowser/settings.py
1
5731
# coding: utf-8 # TODO: This module could simply let django.conf.settings wrap itself # around it (see, e.g. django-assets), instead of doing all those manual # getattr() calls. # imports import os # django imports from django.conf import settings from django.utils.translation import ugettext_lazy as _ # settings f...
bsd-3-clause
7,311,124,790,718,214,000
45.593496
132
0.703193
false
3.367215
false
false
false
jvictor0/TweetTracker
src/Preprocess/MRjobWordCount.py
1
1084
from mrjob.job import MRJob import json as simplejson import re class MRWordFrequencyCount(MRJob): def mapper_get_words(self, _, line): tweet = simplejson.loads(line) if 'twitter_lang' in tweet : language = tweet['twitter_lang'] if language == 'en' : words = [re.sub(r'\W+', '', w.lower()) for w in tw...
mit
-3,708,016,095,717,429,000
22.565217
74
0.599631
false
2.845144
false
false
false
supersu097/mycrawler
yinwang_blog_reminder.py
1
2268
#!/usr/bin/env python3 # coding=utf-8 import argparse import os from bs4 import BeautifulSoup from core import helper from core import html def data_persistence(): with open(temp_file, 'w') as f: for i in aTags_list: f.write(i.get('href') + '|' + i.get_text() + '\n') def check_new(option): ...
gpl-3.0
-1,417,196,228,865,135,900
33.892308
103
0.600529
false
3.375
false
false
false
shapiromatron/tblBuilder
src/private/scripts/reports/epi/ResultTable.py
1
4586
from textwrap import dedent from docxUtils.reports import DOCXReport from docxUtils.tables import TableMaker class EpiResultTables(DOCXReport): COLUMN_WIDTHS = [1.0, 1.7, 0.75, 0.75, 1.0, 1.2, 2.6] def _build_result(self, res): rows = 0 tbl = TableMaker( self.COLUMN_WIDTHS, num...
mit
-6,234,415,254,715,766,000
32.474453
86
0.523768
false
3.557797
false
false
false
GoogleCloudPlatform/Data-Pipeline
app/src/clients/computeengine.py
1
3629
# Copyright 2013 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 by applicable law or ag...
apache-2.0
7,133,072,568,008,425,000
31.115044
75
0.681455
false
4.032222
false
false
false
google/vulkan_test_applications
gapid_tests/resource_creation_tests/BufferCreationMemory_test/BufferCreationMemory_test.py
1
3899
# Copyright 2017 Google 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 writing, softwa...
apache-2.0
2,363,281,855,218,404,000
44.337209
79
0.668889
false
3.942366
true
false
false
frmichel/vo-support-tools
SE/monitor-se/collect-se-space.py
1
10222
#!/usr/bin/python # This tools is initially inspired by the other ../show-se-space script, but is finally focused on some # other need: list SEs of a VO, either in human readable or csv format, and check not only the SE filling # rate but also the percentage of space that it provides to the whole VO. # # For each SE t...
mit
2,064,169,356,102,431,000
47.67619
285
0.579339
false
3.805659
false
false
false
ianmiell/shutit
shutit_setup.py
1
7438
""" shutit.tk.setup (core ShutIt setup module) Nomenclature: - Host machine: Machine on which this script is run. - Target: Environment to which we deploy (docker container or bash shell) - Container: Docker container created to run the modules on. - target_child pexpect-spawned chil...
mit
8,646,640,586,166,403,000
36.004975
268
0.741059
false
3.201894
false
false
false
taeram/dynamite
app/views.py
1
5170
from app import app, \ mail import os from flask import render_template, \ request, \ send_from_directory from flask.ext.mail import Message from helpers import is_authenticated, \ find_domain, \ find_all_domains, \ ...
mit
-2,408,725,756,314,496,000
35.928571
150
0.588781
false
3.815498
false
false
false
jithinbp/SEELablet
SEEL/SENSORS/BMP180.py
1
3253
from __future__ import print_function from numpy import int16 import time def connect(route,**args): return BMP180(route,**args) class BMP180: ADDRESS = 0x77 REG_CONTROL = 0xF4 REG_RESULT = 0xF6 CMD_TEMP = 0x2E CMD_P0 = 0x34 CMD_P1 = 0x74 CMD_P2 = 0xB4 CMD_P3 = 0xF4 oversampling=0 NUMPLOTS=3 PLOTNAMES = [...
gpl-3.0
7,552,960,825,620,775,000
27.787611
138
0.632032
false
2.26532
false
false
false
RollingHamster/phiori
phiori/__init__.py
1
3851
import sys, os, traceback import datetime, json, random, re, time, urllib.request, urllib.parse, yaml from .shiori import * from .phiori import * from .collections import LiveDict, LiveJsonDict, LiveBsonDict, LivePersonaDict, PropertyDict def load(path, _len): Phiori.configs = LivePersonaDict(os.path.join(path, "conf...
lgpl-3.0
8,784,492,875,243,700,000
26.905797
191
0.632823
false
2.727337
false
false
false
NetEaseGame/AutomatorX
scripts/image.py
6
3198
#!/usr/bin/env python # -*- coding: utf-8 -*- __author__ = 'hzsunshx' #import numpy as np import cv2 #from matplotlib import pyplot as plt MIN_MATCH_COUNT = 8 def _middlePoint(pts): def add(p1, p2): return (p1[0]+p2[0], p1[1]+p2[1]) def distance(p1, p2): import math l2 = (p1[0]-p2[0...
apache-2.0
2,094,420,408,534,633,500
28.88785
82
0.595997
false
2.928571
false
false
false
shannara/subuser
logic/subuserlib/classes/docker/container.py
2
1798
# -*- coding: utf-8 -*- """ Container objects allow you to interact with docker containers via the Docker daemon. """ #external imports import json,urllib #internal imports from subuserlib.classes.userOwnedObject import UserOwnedObject class Container(UserOwnedObject): def __init__(self,user,containerId): self...
lgpl-3.0
2,097,551,022,221,061,000
36.458333
177
0.711902
false
4.114416
false
false
false
cyliustack/sofa
tools/empower.py
1
2654
#!/usr/bin/env python3 from subprocess import call import os import sys import argparse def inform_sudo(): # Exit without printing messages if password is still in the cache. ret = call('sudo -n true 2> /dev/null', shell=True) if ret == 0: return 0 ret = call('sudo >&2 echo -e "\033[1;33...
apache-2.0
-8,786,795,329,684,469,000
35.861111
138
0.584778
false
3.411311
false
false
false
ZhMi/python-traning
file-read-write/separate_questions_and_answers .py
1
4756
# -*- coding:utf8 -*- #!usr/bin/python ####################################### PART0 Description ############################################################## # Filename: separate_questions_and_answers.py # Description : separate questions and matching answers from a file # Author:ZhMi # E-mail: # Create:2015-8-3 #...
apache-2.0
6,466,914,199,928,723,000
24.923497
165
0.541315
false
3.723705
false
false
false
Huyuwei/tvm
nnvm/tests/python/unittest/test_pass_saveload_json.py
2
1278
# Licensed to the Apache Software Foundation (ASF) 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 u...
apache-2.0
-6,581,733,895,428,729,000
37.727273
62
0.72457
false
3.758824
false
false
false
jwenzel/tools
tools/substitution.py
1
5913
#!/usr/bin/python3 # -*- coding: utf-8 -*- __author__ = 'Jakob Wenzel' __email__ = 'jakob.wenzel at uni-weimar dot de' __date__ = '2016-04-19' __version__ = 1.0 import sys import re import argparse alphabet = "abcdefghijklmnopqrstuvwxyz" ##{{{ error and usage def error(message): """ Prints error message."...
gpl-2.0
-6,668,454,812,690,585,000
24.934211
90
0.547438
false
3.936751
false
false
false
Schevo/kiwi
kiwi/ui/gadgets.py
3
6400
# # Kiwi: a Framework and Enhanced Widgets for Python # # Copyright (C) 2005 Async Open Source # # 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, or (a...
lgpl-2.1
1,433,092,353,076,909,800
33.594595
76
0.607656
false
3.760282
false
false
false
MOOCworkbench/MOOCworkbench
dataschema_manager/forms.py
1
1524
"""Forms for DataSchema app""" from django import forms from django.forms import ModelForm, Textarea, TextInput from .models import DataSchemaConstraints, DataSchemaField class JsonTableSchemaNameField(forms.CharField): """A special form field for JSON Table Schema, that requires the name field to be all low...
mit
2,466,285,254,722,216,400
36.170732
103
0.654199
false
4.508876
false
false
false
sdulal/oppia
core/controllers/library_test.py
1
12431
# Copyright 2014 The Oppia Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable ...
apache-2.0
-3,038,911,600,885,174,000
39.491857
78
0.623441
false
3.819048
true
false
false
intelxed/mbuild
mbuild/doxygen.py
1
12057
#!/usr/bin/env python # -*- python -*- #BEGIN_LEGAL # #Copyright (c) 2016 Intel Corporation # # 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
4,583,451,265,149,513,700
32.491667
88
0.534876
false
3.859475
true
false
false
gcrahay/fir_tagartifact_plugin
fir_tagartifact/views.py
1
2305
from django.contrib.contenttypes.models import ContentType from django.shortcuts import get_object_or_404, render from django.contrib.auth.decorators import login_required, user_passes_test from django.template.loader import render_to_string from django.http import JsonResponse from fir_artifacts.models import Artifac...
apache-2.0
-940,710,982,983,312,900
45.1
108
0.623861
false
3.974138
false
false
false
dogobox/datavivamaster
fill_cache.py
1
7302
# -*- coding: utf-8 -*- ''' Script to fill cache with most popular URLs ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 0. BEFORE RUNNING SCRIPT: - need to comment out redis sessions - need to comment out access session var 1. Get unique attrs. Bras: - all - ev...
mit
-3,656,401,870,020,436,000
33.77619
156
0.542591
false
3.292155
false
false
false
markvdw/mltools
mltools/linalg.py
1
2397
############################################################################### # linalg.py # Some useful linear algebra utilities. Maybe in the future a full library to # do certain common transformations? # # Mark van der Wilk (mv310@cam.ac.uk) #########################################################################...
mit
-4,891,943,182,771,124,000
26.872093
79
0.50438
false
3.40483
false
false
false
QueenMargaretsCompSci/PiWars2016
source/wii_controller.py
1
2569
# Wii controller remote control script import RPi.GPIO as GPIO # Import the GPIO Library import time # Import the Time library import os # import PiConZero stuff import piconzero as pz import sensorlibs as sl # Set the GPIO modes GPIO.setmode(GPIO.BOARD) GPIO.setwarnings(False) # Credit for this part must go to: # ...
gpl-3.0
-5,666,059,509,902,326,000
23.466667
63
0.619307
false
3.191304
false
false
false
bblay/iris
lib/iris/experimental/animate.py
3
4670
# (C) British Crown Copyright 2013, Met Office # # This file is part of Iris. # # Iris 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 3 of the License, or # (at your option) any later ve...
gpl-3.0
-6,292,225,404,014,860,000
36.36
79
0.655889
false
4.151111
false
false
false
Fabien-B/Projet-Python
help.py
1
5206
# -*- coding: utf-8 -*- # Form implementation generated from reading ui file 'aide.ui' # # Created: Sun Jan 25 15:56:39 2015 # by: PyQt4 UI code generator 4.10.4 # # WARNING! All changes made in this file will be lost! from PyQt4 import QtCore, QtGui try: _fromUtf8 = QtCore.QString.fromUtf8 except Attribute...
lgpl-3.0
-458,128,444,760,972,100
48.113208
103
0.699193
false
3.813919
false
false
false
IKAcc/Serlina
rest_cms/Blog/serializers.py
1
1203
from rest_framework import serializers from Blog.models import BlogCategory, BlogTag, BlogPost, BlogComment, BlogInteracter from django.contrib.auth.models import User from authentication.serializers import UserSerializer class BlogCategorySerializer(serializers.ModelSerializer): class Meta: model = BlogC...
mit
5,881,487,892,557,733,000
33.371429
91
0.700748
false
4.119863
false
false
false
seatgeek/cronq
cronq/pruner.py
1
4421
# -*- coding: utf-8 -*- import argparse import logging import sys from cronq.backends.mysql import Storage from cronq.models.event import Event from cronq.models.job import Job from sqlalchemy import between from sqlalchemy.sql.expression import asc from sqlalchemy.sql.expression import desc logger = logging.getLogg...
bsd-2-clause
3,693,166,361,218,568,000
27.707792
97
0.558697
false
3.778632
false
false
false
zhouyao1994/incubator-superset
superset/translations/utils.py
1
1623
# Licensed to the Apache Software Foundation (ASF) 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 u...
apache-2.0
419,044,431,292,222,500
34.282609
72
0.693161
false
3.977941
false
false
false
nickmeharry/django-mysql
django_mysql/models/fields/json.py
1
6326
# -*- coding:utf-8 -*- from __future__ import ( absolute_import, division, print_function, unicode_literals ) import json import django from django.core import checks from django.db import connections from django.db.models import Field, IntegerField, Transform from django.utils import six from django_mysql impor...
bsd-3-clause
-7,207,319,411,992,959,000
31.441026
79
0.595005
false
4.222964
false
false
false
hachreak/invenio-search
examples/app.py
1
3985
# -*- coding: utf-8 -*- # # This file is part of Invenio. # Copyright (C) 2015, 2016 CERN. # # Invenio is free software; you can redistribute it # and/or modify it under the terms of the GNU General Public License as # published by the Free Software Foundation; either version 2 of the # License, or (at your option) any...
gpl-2.0
8,249,496,641,487,375,000
27.06338
76
0.684065
false
3.662684
false
false
false
guillermo-carrasco/bcbio-nextgen-vm
bcbiovm/ship/pack.py
3
6021
"""Prepare a running process to execute remotely, moving files as necessary to shared infrastructure. """ import os import subprocess import boto from boto.exception import S3ResponseError import toolz as tz from bcbio import utils from bcbiovm.docker import remap from bcbio.pipeline import config_utils def shared_f...
mit
-5,312,110,822,873,812,000
36.867925
104
0.600565
false
3.609712
true
false
false
apyrgio/synnefo
snf-astakos-app/astakos/im/migrations/0024_auto__add_field_projectapplication_response.py
10
23300
# encoding: utf-8 import datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Adding field 'ProjectApplication.response' db.add_column('im_projectapplication', 'response', self.gf('d...
gpl-3.0
5,055,195,801,354,590,000
85.296296
219
0.556996
false
3.648606
false
false
false
thunder-project/thunder-regression
regression/model.py
1
2467
from .utils import toseries from numpy import r_, array from thunder.series import fromrdd class MassRegressionModel: """ A fitted mass univariate regression model. Contains a collection regression models, each fitted with the same design matrix, but to a different response varaible. """ def ...
mit
8,093,307,892,753,210,000
32.337838
101
0.586137
false
3.671131
false
false
false
GreenleafLab/NucleoATAC
pyatac/get_pwm.py
1
3785
""" Gets aggregate nuc frequency around sites. @author: Alicia Schep, Greenleaf lab at Stanford University """ ##### IMPORT MODULES ##### import os import numpy as np import itertools from multiprocessing import Pool import traceback import pyatac.seq as seq from pyatac.chunk import ChunkList from pyatac.bias import ...
mit
3,731,610,536,839,628,000
38.427083
126
0.632761
false
3.382484
false
false
false
SymbiFlow/prjxray
fuzzers/074-dump_all/node_names.py
1
5789
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # # Copyright (C) 2020 The Project X-Ray Authors. # # Use of this source code is governed by a ISC-style # license that can be found in the LICENSE file or at # https://opensource.org/licenses/ISC # # SPDX-License-Identifier: ISC """ This script creates node_wires.json, w...
isc
7,462,496,737,730,215,000
30.63388
77
0.589912
false
3.718048
false
false
false
open-motivation/motivation-ide
ninja_ide/gui/misc/shortcut_manager.py
2
12464
# -*- coding: utf-8 -*- # # This file is part of NINJA-IDE (http://ninja-ide.org). # # NINJA-IDE 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 # any later version. # # NIN...
gpl-3.0
606,972,545,469,694,300
38.948718
79
0.598363
false
4.1
false
false
false
hadronproject/lpms
lpms/db/file_relationsdb.py
1
4831
# Copyright 2009 - 2011 Burak Sezer <purak@hadronproject.org> # # This file is part of lpms # # lpms 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) an...
gpl-3.0
-985,679,681,895,803,400
44.575472
103
0.602774
false
4.157487
false
false
false
petricm/DIRAC
Core/Utilities/Distribution.py
5
2513
""" Utilities for distributing DIRAC """ __RCSID__ = "$Id$" import re import tarfile import os from DIRAC import S_OK, S_ERROR, gLogger from DIRAC.Core.Utilities import File, List gVersionRE = re.compile("v([0-9]+)(?:r([0-9]+))?(?:p([0-9]+))?(?:-pre([0-9]+))?") def parseVersionString(version): result = gVersio...
gpl-3.0
-7,844,336,451,254,060,000
28.564706
91
0.658575
false
3.083436
false
false
false
bcgov/gwells
app/backend/wells/filters.py
1
32101
""" 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 distri...
apache-2.0
-7,654,011,864,146,201,000
40.635538
162
0.599358
false
4.339732
false
false
false
box/box-python-sdk
test/unit/object/test_comment.py
1
2319
# coding: utf-8 from __future__ import unicode_literals import json from boxsdk.object.comment import Comment # pylint:disable=protected-access # pylint:disable=redefined-outer-name def test_reply(test_comment, mock_box_session, comment_params): expected_url = mock_box_session.get_url('comments') message_t...
apache-2.0
8,902,831,823,387,887,000
33.61194
121
0.670116
false
3.461194
true
false
false
oksome/Intercom
intercom/minions/arduino2.py
1
2982
# Copyright (c) 2014 "OKso http://okso.me" # # This file is part of Intercom. # # Intercom 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
-524,956,359,458,920,260
29.121212
77
0.64051
false
3.699752
false
false
false
joshuaeitan/massivedata
PS04/wikipedia_by_month.py
1
1224
#!/usr/bin/spark-submit # # Problem Set #4 # Implement wordcount on the shakespeare plays as a spark program that: # a.Removes characters that are not letters, numbers or spaces from each input line. # b.Converts the text to lowercase. # c.Splits the text into words. # d.Reports the 40 most common words, with the most ...
cc0-1.0
4,717,375,401,224,748,000
26.2
84
0.645425
false
3.428571
false
false
false
susemeee/Chunsabot-framework
chunsabot/modules/google_apis.py
1
3490
import requests import json import random import hashlib import os import imghdr from urllib.parse import quote from chunsabot.botlogic import brain, Botlogic from chunsabot.messages import ResultMessage, ContentType from chunsabot.database import Database API_KEY = Database.load_config("google_api_key") GOOGLE_Y_SE...
mit
-6,258,984,307,827,191,000
26.883333
131
0.621638
false
2.948018
false
false
false
oudalab/phyllo
phyllo/extractors/avianusDB.py
1
3748
import sqlite3 import urllib import re from urllib.request import urlopen from bs4 import BeautifulSoup from phyllo.phyllo_logger import logger def main(): # The collection URL below. collURL = 'http://www.thelatinlibrary.com/avianus.html' collOpen = urllib.request.urlopen(collURL) collSOUP = Beautifu...
apache-2.0
-1,839,905,551,953,309,400
39.301075
111
0.45571
false
4.702635
false
false
false
libvirt/libvirt-test-API
libvirttestapi/repos/domain/detach_disk.py
1
2848
# Copyright (C) 2010-2012 Red Hat, Inc. # This work is licensed under the GNU GPLv2 or later. # Detach a disk from domain import time import libvirt from libvirt import libvirtError from libvirttestapi.utils import utils from libvirttestapi.repos.domain.start import start required_params = ('guestname', 'hddriver') ...
gpl-2.0
958,335,050,307,309,400
28.360825
76
0.607795
false
3.591425
false
false
false
planet-os/notebooks
api-examples/apiclient/datahub.py
1
1047
# -*- coding: utf-8 -*- import os from apiclient import datasets class datahub: def __init__(self,server,version,apikey='', debug=False): self.server=server self.version=version self.apikey=apikey self.get_apikey() self.debug=debug def get_apikey(self): if len...
mit
-3,495,137,397,752,733,700
28.914286
133
0.626552
false
3.739286
false
false
false
bjowi/essedit
essedit5.py
1
34614
#!/usr/bin/env python import argparse from difflib import SequenceMatcher, context_diff import datetime from collections import defaultdict, namedtuple, OrderedDict import logging from struct import unpack, pack, error import time import os import pprint import io import sys from PIL import ImageFile from PIL import I...
mit
6,036,024,461,823,158,000
33.753012
387
0.587479
false
3.239798
false
false
false
hackenberg/markbook
markbook/views.py
1
1063
from flask import jsonify, render_template, request from markbook import app from markbook.models import Note @app.route("/", methods=["GET"]) def index(): notes = Note.query.order_by(Note.title) return render_template("index.html", notes=notes) @app.route("/notes/<int:id>", methods=["GET"]) def get_note(i...
mit
-1,958,275,178,677,594,000
23.159091
66
0.684854
false
3.555184
false
false
false
dcmease/CSS-Reaper
cssdoc.py
1
1732
""" cssdoc.py ~~~~~~~~~ This class will parse CSS documents and return all the selectors contained within """ from __future__ import print_function import urllib2 import tinycss """ A searchable CSS document """ class CSSdoc(object): """ Constructor """ def __init__(self): self.data = '' """ Get ...
mit
-3,126,791,184,576,867,000
28.355932
81
0.557737
false
4.441026
false
false
false
allmightyspiff/softlayer-python
SoftLayer/CLI/file/order.py
2
4822
"""Order a file storage volume.""" # :license: MIT, see LICENSE for more details. import click import SoftLayer from SoftLayer.CLI import environment from SoftLayer.CLI import exceptions CONTEXT_SETTINGS = {'token_normalize_func': lambda x: x.upper()} @click.command(context_settings=CONTEXT_SETTINGS) @click.option...
mit
786,553,471,847,492,200
38.52459
99
0.589797
false
4.309205
false
false
false
Honzin/ccs
ccs/poloniex/public/__init__.py
1
27719
# -*- coding: utf8 -*- """ This file contains configuration for Poloniex stock. """ __author__ = "Jan Seda" __copyright__ = "Copyright (C) Jan Seda" __credits__ = [] __license__ = "" __version__ = "0.1" __maintainer__ = "Jan Seda" __email__ = "" __status__ = "Production" import urllib.parse import sys from ... impo...
agpl-3.0
8,674,109,740,579,624,000
38.770445
219
0.418125
false
5.218185
false
false
false
adamgreig/agg-kicad
scripts/build_mod_sil_dil.py
1
7460
""" build_mod_sil_dil.py Copyright 2016 Adam Greig Licensed under the MIT licence, see LICENSE file for details. Generate footprints for standard 0.1" SIL and DIL headers. """ from __future__ import print_function, division # Settings ==================================================================== # Courtyard ...
mit
-4,085,817,087,471,874,000
27.803089
79
0.503619
false
2.916341
false
false
false
Jumpscale/jumpscale_portal8
apps/gridportal/base/Grid/.macros/page/systemlogs/1_main.py
2
5019
def main(j, args, params, tags, tasklet): page = args.page page.addCSS("/jslib/old/jquery-ui.css") page.addJS("/jslib/old/jquery-ui.js") page.addJS("/jslib/old/jquery.facetview.js") C = r""" <script type="text/javascript"> jQuery(document).ready(function($) { function pad(num) { var...
apache-2.0
-7,328,096,214,519,599,000
31.019737
163
0.503885
false
3.655499
false
false
false
wathsalav/xos
xos/hpc/admin.py
1
6286
from django.contrib import admin from hpc.models import * from django import forms from django.utils.safestring import mark_safe from django.contrib.auth.admin import UserAdmin from django.contrib.admin.widgets import FilteredSelectMultiple from django.contrib.auth.forms import ReadOnlyPasswordHashField from django.co...
apache-2.0
-6,698,757,215,331,740,000
42.958042
161
0.696787
false
3.678174
false
false
false
bpsagar/captaincloud
captaincloud/task/field/stream.py
1
1806
from .base import Field from .exc import InvalidValueException, StreamNotAvailableException import six class Stream(object): def __init__(self, stream_type): self.stream_type = stream_type self.real_stream = None def set_real_stream(self, real_stream): self.real_stream = real_stream ...
mit
-7,083,173,614,630,572,000
23.739726
67
0.636213
false
4.123288
false
false
false
GXIC-Real-Intelligence-Team/surveillance-core
gxic_rit/konan/image.py
1
2338
# -*- coding: utf-8 -*- import base64 import cv2 # import imagehash import numpy as np from matplotlib import cm # from PIL import Image # def phash(rgbImg): # return str(imagehash(Image.fromarray(rgbImg))) HIGH_COLOR = (30, 255, 0) MIDD_COLOR = (204, 255, 0) LOW_COLOR = (255, 132, 0) def resize(frame, scale): ...
mit
9,020,374,424,988,114,000
22.677419
67
0.59446
false
2.630824
false
false
false
Ecotrust/cogs-priorities
priorities/seak/views.py
1
9561
from madrona.common.utils import get_logger from madrona.shapes.views import ShpResponder #from madrona.features.views import get_object_for_viewing from django.http import HttpResponse from django.template.defaultfilters import slugify from django.contrib.gis.geos import MultiPolygon from django.shortcuts import rende...
bsd-3-clause
-3,891,156,691,635,492,000
33.641304
116
0.63508
false
3.598419
true
false
false
darren-rogan/CouchPotatoServer
couchpotato/core/downloaders/sabnzbd/main.py
1
6100
from couchpotato.core.downloaders.base import Downloader from couchpotato.core.helpers.encoding import tryUrlencode from couchpotato.core.helpers.variable import cleanHost from couchpotato.core.logger import CPLog import traceback import json log = CPLog(__name__) class Sabnzbd(Downloader): type = ['nzb'] d...
gpl-3.0
2,835,089,327,814,327,300
36.888199
139
0.501967
false
4.341637
false
false
false
kinglyduck/hackerspace
src/badges/forms.py
1
1677
from django import forms from django.contrib.auth.models import User from django.db import models from django.forms.extras.widgets import SelectDateWidget from datetimewidget.widgets import DateTimeWidget, DateWidget, TimeWidget from .models import Badge, BadgeAssertion def make_custom_datetimefield(f): formfie...
gpl-2.0
7,169,135,343,555,881,000
34.680851
106
0.673822
false
3.918224
false
false
false
Doctor-love/kkross
playground/kkross/campaign/parse_data.py
1
2375
from kkross.exceptions import CampaignError # ------------------------------------------------------------------------------------------------- def parse_module(module_type, module): if not 'name' in module: raise CampaignError('Required %s item property "name" is missing' % module_type) if not 'opti...
gpl-2.0
-8,665,993,627,191,798,000
41.410714
99
0.495158
false
5.042463
false
false
false
ghchinoy/tensorflow
tensorflow/contrib/tpu/python/tpu/keras_support.py
3
87537
# 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
2,607,297,032,036,669,400
37.750332
112
0.643145
false
3.887596
true
false
false
FedericoCeratto/lightyears
code/intersect.py
1
2308
# # 20,000 Light Years Into Space # This game is licensed under GPL v2, and copyright (C) Jack Whitham 2006-07. # # Line intersection algorithm. Thanks to page 113 of # Computer Graphics Principles and Practice (2nd. Ed), Foley et al. # # Note 1: it's not an intersection if the two lines share an endpoint. # Note 2...
gpl-2.0
-2,017,127,268,370,115,800
26.807229
82
0.484402
false
2.649828
false
false
false
wikkii/raspluonto
old/python_flask/public_html/nuotiovahti/nuotiovahti/getdata.py
1
1081
import paho.mqtt.client as mqtt import mysql.connector from flask import Flask, jsonify, json, request app = Flask(__name__) app.route("/") with app.app_context(): def fetchfrombase(): try: cnx = mysql.connector.connect(option_files='/home/mint/connectors.cnf') except mysql.connector.Error as err: ...
mit
5,848,368,378,089,054,000
26.717949
238
0.643848
false
3.420886
false
false
false
soasme/riotpy
riot/multimethods.py
1
2901
# -*- coding: utf-8 -*- """ Multimethods An implementation of multimethods for Python, heavily influenced by the Clojure programming language. Copyright (C) 2010-2011 by Daniel Werner. See the README file for information on usage and redistribution. """ import functools class DefaultMethod(object): """ ...
mit
8,568,074,641,662,246,000
30.543478
80
0.608066
false
4.063025
false
false
false
jansyk13/ml-rate-limiting
src/transformation/url.py
1
1502
import logging as log import numpy as np import pandas as pd from itertools import chain def parse(dataframe, limit=None): log.info("action=url_parse status=start") values = _remove_query_params(dataframe['url'].values.tolist()) values = list(chain.from_iterable([_split(val, limit) for val in values])) ...
apache-2.0
-4,209,943,280,053,411,300
26.814815
78
0.575233
false
3.468822
false
false
false
OpenDigitalWorks/Rcl-topology-cleaner
road_network_cleaner_tool.py
1
14615
# -*- coding: utf-8 -*- """ /*************************************************************************** RoadNetworkCleaner A QGIS plugin This plugin clean a road centre line map. ------------------- begin : 2016-11-10 git s...
gpl-3.0
-1,554,004,580,521,991,200
38.182306
207
0.558604
false
4.398134
false
false
false
dashpay/sentinel
bin/sentinel.py
1
7307
#!/usr/bin/env python import sys import os sys.path.append(os.path.normpath(os.path.join(os.path.dirname(__file__), '../lib'))) import init import config import misc from dashd import DashDaemon from models import Superblock, Proposal, GovernanceObject from models import VoteSignals, VoteOutcomes, Transient import sock...
mit
-2,261,441,579,770,772,000
31.475556
150
0.657862
false
3.849842
false
false
false