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
leobrowning92/arduino-lineCCD-spectrometer
plotter.py
1
1293
import serial import time import matplotlib.pyplot as plt plt.interactive(True) print 'import' # open up dummy serial to reset the arduino with s = serial.Serial(port='/dev/ttyUSB1') # reset the arduino s.flushInput() s.setDTR(level=False) time.sleep(0.5) # ensure there is no stale data in the buffer s.flushInput()...
gpl-3.0
7,407,440,368,750,293,000
22.509091
75
0.681361
false
3.375979
false
false
false
pmsserrana/agenda
agenda_administrativa/apps/atividades/migrations/0001_initial.py
1
9361
# -*- coding: utf-8 -*- # Generated by Django 1.11.6 on 2017-10-11 11:38 from __future__ import unicode_literals from django.conf import settings from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): initial = True dependencies = [ migratio...
bsd-3-clause
-6,113,654,590,307,478,000
53.561404
662
0.571383
false
3.647381
false
false
false
eroicaleo/LearningPython
interview/leet/36_Valid_Sudoku.py
1
2017
#!/usr/bin/env python class Solution: def isValidSudoku(self, board: 'List[List[str]]') -> 'bool': # Each row for i in range(9): sudoku = {} for j in range(9): if board[i][j] == ".": continue if board[i][j] in sudoku: ...
mit
-7,643,550,152,595,659,000
31.532258
64
0.260288
false
2.910534
false
false
false
adambreznicky/python
CountyMapbook/CountyMapbook_vJeff.py
1
10744
__file__ = 'CountyMapbook_v1' __date__ = '6/18/2014' __author__ = 'ABREZNIC' import os, arcpy,datetime from arcpy import env #date now = datetime.datetime.now() curMonth = now.strftime("%m") curDay = now.strftime("%d") curYear = now.strftime("%Y") today = curYear + "_" + curMonth + "_" + curDay #variables cofolder = ...
mit
4,961,575,016,184,159,000
47.840909
202
0.638682
false
3.071469
false
false
false
midonet/midonet-sandbox
src/tst/test_builder.py
1
4618
# Copyright 2015 Midokura SARL # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing...
apache-2.0
-3,875,891,980,378,285,600
29.993289
74
0.622347
false
4.123214
true
false
false
mandeeps708/scripts
JSON-Exporter.py
1
1861
#!/usr/bin/env python # -*- coding: utf-8 -*- """ * File Name : JSON-Exporter.py * Purpose : Writing JSON output by checking the chapters and images for the "https://gitlab.com/greatdeveloper/kitab" project. * Creation Date : 15-08-2016 (Independence Day Special Hackathon) * Copyright (c) 2016 Mandeep ...
mit
6,788,678,174,458,330,000
26.367647
78
0.671145
false
3.446296
false
false
false
sixuanwang/SAMSaaS
wirecloud-develop/src/build/lib.linux-x86_64-2.7/wirecloud/platform/admin.py
2
2808
# -*- coding: utf-8 -*- # Copyright (c) 2012-2014 CoNWeT Lab., Universidad Politécnica de Madrid # This file is part of Wirecloud. # Wirecloud 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 v...
gpl-2.0
5,498,997,079,468,502,000
27.353535
77
0.739936
false
3.703166
false
false
false
garygriswold/Bible.js
Versions/Release.2.x.x/pyTmp/ComparePermissionAllowed.py
1
2557
# # ComparePermissionAllowed.py # # This program compares a generated file of permissions (PermissionsRequest.txt) # that I generated to an apiallowed.csv file given by FCBH. The purpose is to # identify any permissions that I am not allowed. # # Layout of apiallowed.csv # column 0 - line number # column 1 - LangName ...
mit
333,765,121,618,681,500
29.082353
86
0.68244
false
2.788441
false
false
false
unlimitedlabs/orchestra
orchestra/utils/tests/test_project_properties.py
2
2109
from unittest.mock import patch from orchestra.models import Iteration from orchestra.models import Project from orchestra.tests.helpers import OrchestraTestCase from orchestra.tests.helpers.fixtures import setup_models from orchestra.utils.project_properties import completed_projects from orchestra.utils.task_lifecyc...
apache-2.0
3,096,894,390,393,699,000
42.9375
73
0.596491
false
4.321721
true
false
false
creatorssyn/creators_py
creators_py/creators_api.py
1
8180
#!/usr/bin/python """ Creators GET API interface v0.3.2 Full API docs: http://get.creators.com/docs/wiki @author Brandon Telle <btelle@creators.com> @copyright (c) 2015 Creators <www.creators.com> """ import subprocess, shlex, re, urllib, os.path # Python 3+ puts urlencode in urllib.parse try: from urllib import...
mit
-5,183,268,034,446,239,000
31.464286
158
0.57665
false
4.096144
false
false
false
open-keychain/SafeSlinger-AppEngine
safeslinger-messenger/python/cleanup_reg.py
2
2617
# The MIT License (MIT) # # Copyright (c) 2010-2015 Carnegie Mellon University # # 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...
mit
6,194,062,037,424,786,000
36.927536
114
0.631257
false
4.420608
false
false
false
mophahr/wikipediaGame
wikigame/get_given_names.py
1
4094
# -*- coding: utf-8 -*- import json import sys # see http://python3porting.com/noconv.html#import-errors try: # For Python 3.0 and later from urllib.request import urlopen from urllib.parse import quote except ImportError: # Fall back to Python 2's urllib from urllib import urlopen, quote def get...
gpl-2.0
-4,292,398,555,988,735,500
34.573913
118
0.592276
false
3.642921
false
false
false
aristotelis-metsinis/ArcadeGames
memory.py
1
16152
# # Mini-project # 5: "Memory". # # Author: Aristotelis Metsinis # Email: aristotelis.metsinis@gmail.com # Mini-project # 5: An Introduction to Interactive Programming in Python # @ https://www.coursera.org/course/interactivepython # Date: 26 Oct 2014 # Version: 10.0 # # Implementation of card game: "Memory". ...
mit
-5,470,520,956,982,380,000
39.687657
116
0.596459
false
3.853053
false
false
false
astrorafael/emadb
emadb/mqttsubscriber.py
1
8155
# ---------------------------------------------------------------------- # Copyright (c) 2015 Rafael Gonzalez. # # 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...
mit
4,258,326,531,601,589,000
31.751004
80
0.605395
false
4.065304
false
false
false
moertle/pyaas
pyaas/module.py
1
2566
import collections import logging import pyaas moduleImports = dict( auth = 'pyaas.web.auth', storage = 'pyaas.storage.engines', cache = 'pyaas.storage.cache', ) def load(): if not pyaas.config.has_section('modules'): logging.debug('No modules defined') return modules ...
mit
3,384,338,324,429,189,000
26.010526
73
0.588465
false
4.37884
false
false
false
iw3hxn/LibrERP
crm_lead_correct/models/sale_order.py
1
3937
# -*- encoding: utf-8 -*- ############################################################################## # # Copyright (c) 2013-2014 Didotech SRL (info at didotech.com) # All Rights Reserved. # # WARNING: This program as such is intended to be used by professional # programmers who take the who...
agpl-3.0
8,658,856,917,558,177,000
48.2125
150
0.596139
false
3.82233
false
false
false
crossroadchurch/paul
openlp/core/lib/searchedit.py
1
8204
# -*- coding: utf-8 -*- # vim: autoindent shiftwidth=4 expandtab textwidth=120 tabstop=4 softtabstop=4 ############################################################################### # OpenLP - Open Source Lyrics Projection # # ------------------------------------------------------...
gpl-2.0
-7,612,010,848,661,411,000
45.350282
120
0.573257
false
4.368477
false
false
false
agry/NGECore2
scripts/mobiles/corellia/diseased_vrelt_matriarch.py
2
1677
import sys from services.spawn import MobileTemplate from services.spawn import WeaponTemplate from resources.datatables import WeaponType from resources.datatables import Difficulty from resources.datatables import Options from java.util import Vector def addTemplate(core): mobileTemplate = MobileTemplate() mobi...
lgpl-3.0
-2,400,141,543,173,543,000
33.244898
129
0.826476
false
3.2818
false
false
false
richard-taylor/auxo
auxo/test/test_executor.py
1
1467
import logging logging.basicConfig(filename='/tmp/unittest') import auxo.executor import auxo.test.mocks import unittest class TestExecutor(unittest.TestCase): def testNoAgents(self): r = auxo.executor.run([]) self.assertEqual(len(r), 0) def testGoodAgents(self): ...
gpl-3.0
2,895,575,492,069,478,000
28.938776
60
0.549421
false
3.501193
true
false
false
raiden-network/raiden
raiden/tests/utils/protocol.py
1
7352
from collections import defaultdict from unittest.mock import patch import structlog from gevent.event import AsyncResult from raiden.message_handler import MessageHandler from raiden.messages.abstract import Message from raiden.raiden_event_handler import EventHandler from raiden.raiden_service import RaidenService ...
mit
-5,539,801,465,720,107,000
39.844444
98
0.641866
false
4.153672
false
false
false
SHDShim/pytheos
pytheos/fit_electronic.py
1
1172
import lmfit from .eqn_electronic import zharkov_pel class ZharkovElecModel(lmfit.Model): """ lmfit Model class for Zharkov electronic contribution fitting """ def __init__(self, n, z, independent_vars=['v', 'temp'], param_names=['v0', 'e0', 'g'], prefix='', missing=...
apache-2.0
-5,509,651,354,509,060,000
38.066667
79
0.581911
false
3.720635
false
false
false
gopchandani/ryu
ryu/contrib/ovs/db/types.py
50
21268
# Copyright (c) 2009, 2010, 2011, 2012 Nicira, 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 o...
apache-2.0
1,829,824,586,550,318,300
35.231687
79
0.516927
false
3.866206
false
false
false
AdvenamTacet/EMP
prog/plots.py
1
2560
import plotly as py import plotly.graph_objs as graph def choose_color(entropy): """ Calculates color for bare with given entropy """ red = round(255 * entropy**5) green = round(255 * ((1 - (entropy - 0.5)**2 )/8)**0.6 ) blue = round(255 * (1 - 0.8 * entropy**0.05)) alpha = 0.6 + round(0.3 * entro...
mit
-239,573,664,620,935,200
33.594595
86
0.622266
false
3.487738
false
false
false
avara1986/gozokia
gozokia/i_o/io.py
1
2873
# encoding: utf-8 """ I/O configurations """ from __future__ import absolute_import, print_function, unicode_literals import importlib from gozokia.i_o.exceptions import GozokiaIoError from gozokia.conf import settings class Io(object): _VALUE = 0 _TXT = 1 _VOICE = 2 _TXT_VOICE = 3 _METHOD_DEFAULT...
mit
1,665,085,800,163,650,000
34.9125
135
0.614688
false
3.711886
false
false
false
tosmun/AdventOfCode
solutions/day18/p2/main.py
1
1353
x_len = 100 y_len = 100 steps = 100 def new_grid(): ng = [ ] for x in range(x_len): ng.append([]) for y in range(y_len): ng[x].append(0) #Force corners to be on for (x,y) in [(0,0),(0,y_len-1),(x_len-1,0),(x_len-1,y_len-1)]: ng[x][y] = 1 return ng def main(): g = new_grid() with open('../input.txt', ...
apache-2.0
6,195,058,034,031,673,000
21.180328
66
0.504804
false
2.30494
false
false
false
drtchops/temper
examples/django_example/django_app/utils.py
1
1178
import sys from django.conf.urls import patterns from django.conf.urls import url as django_url def url(*regexes, **kwargs): caller_filename = sys._getframe(1).f_code.co_filename for m in sys.modules.values(): if (m and '__file__' in m.__dict__ and m.__file__.startswith(caller_filenam...
mit
5,668,326,754,291,013,000
26.395349
62
0.541596
false
3.812298
false
false
false
grollins/foldkin
foldkin/kings/contact_order_model.py
1
2148
from foldkin.base.model_factory import ModelFactory from foldkin.base.model import Model from foldkin.zam_protein import create_zam_protein_from_pdb_id class ContactOrderModelFactory(ModelFactory): """docstring for ContactOrderModelFactory""" def __init__(self): super(ContactOrderModelFactory, self).__...
bsd-2-clause
-4,462,443,247,395,210,000
36.034483
80
0.651304
false
3.532895
false
false
false
mkdubik/multinet-evaluation
plot/t6.py
1
5291
import sys from os import listdir import operator import collections from pprint import pprint from itertools import count import matplotlib.pyplot as plt import networkx as nx import multinetx as mx import numpy as np from t5 import collect_data from pdb import set_trace def collect_community(path): files = filte...
gpl-2.0
8,117,371,479,766,188,000
22.20614
88
0.592327
false
2.529159
false
false
false
HelloLily/hellolily
lily/notes/api/views.py
1
1200
from django_filters import CharFilter, NumberFilter from django_filters import rest_framework as filters from rest_framework.filters import OrderingFilter from rest_framework.viewsets import ModelViewSet from lily.notes.api.serializers import NoteSerializer from lily.notes.models import Note class NoteFilter(filters...
agpl-3.0
-7,865,470,299,694,292,000
33.285714
79
0.729167
false
4.095563
false
false
false
ramineni/my_congress
congress/datasources/monasca_driver.py
1
6504
# Copyright (c) 2015 Cisco. # # 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 ...
apache-2.0
6,159,058,696,092,591,000
38.180723
78
0.602399
false
4.140038
false
false
false
Rdbaker/Rank
rank/user/models.py
2
3277
# -*- coding: utf-8 -*- import datetime as dt from flask_login import UserMixin from sqlalchemy.orm import relationship, backref from rank.api.models import UserRequest from rank.core.models import ( DB as db, SurrogatePK, ReferenceCol, CRUDMixin ) from rank.extensions import bcrypt class Role(Surro...
mit
9,021,309,524,885,959,000
37.104651
104
0.638694
false
3.753723
false
false
false
hassaanm/business-articles
nytimesScraper/nytimesScraper/spiders/nytimes_spider.py
1
2778
from scrapy.spider import BaseSpider from scrapy.exceptions import DropItem from scrapy.selector import HtmlXPathSelector from scrapy.contrib.spiders import CrawlSpider, Rule from scrapy.contrib.linkextractors.sgml import SgmlLinkExtractor from nytimesScraper.items import Article import re import json class NYTSpide...
apache-2.0
-4,896,144,330,404,601,000
36.540541
133
0.568754
false
3.708945
false
false
false
djaodjin/djaodjin-signup
signup/decorators.py
1
10574
# Copyright (c) 2021, Djaodjin Inc. # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # # 1. Redistributions of source code must retain the above copyright notice, # this list of conditions and t...
bsd-2-clause
1,229,249,765,050,495,000
36.496454
80
0.657178
false
4.232986
false
false
false
starshipfactory/sfblog
events/models.py
1
1165
from django.db import models class Location(models.Model): name = models.CharField(max_length=128) page = models.ForeignKey("simplecms.Page", blank=True, null=True) def __unicode__(self): return self.name class EventDescription(models.Model): cost = models.TextField(default="", blank=True) ...
bsd-3-clause
3,132,088,787,468,325,400
25.477273
69
0.614592
false
3.698413
false
false
false
dhouck/effulgence2epub
src/new_toc.py
1
1132
#!/usr/bin/python """Takes the TOC, this time the raw HTML, and produces an ebook xhtml TOC with rewritten local links. We're producing this directly from the html so that we can keep the extra multi-level chapter structure without parsing the entire thing into some hierarchical tree. """ from bs4 import BeautifulSo...
agpl-3.0
1,078,908,016,396,541,400
27.3
80
0.706714
false
3.5375
false
false
false
Neuvoo/legacy-portage
pym/_emerge/MetadataRegen.py
1
4363
# Copyright 1999-2010 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 import portage from portage import os from _emerge.EbuildMetadataPhase import EbuildMetadataPhase from _emerge.PollScheduler import PollScheduler class MetadataRegen(PollScheduler): def __init__(self, portdb, ...
gpl-2.0
-7,811,879,227,615,180,000
25.766871
69
0.667201
false
2.978157
false
false
false
sanjeevtripurari/hue
desktop/core/ext-py/thrift-0.9.1/src/server/TProcessPoolServer.py
94
3966
# # 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
-7,950,177,908,395,596,000
32.610169
79
0.634644
false
4.600928
false
false
false
shamangeorge/beets
beets/dbcore/db.py
4
35898
# -*- coding: utf-8 -*- # This file is part of beets. # Copyright 2016, Adrian Sampson. # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the # "Software"), to deal in the Software without restriction, including # without limitation t...
mit
-3,355,687,870,484,750,300
32.580917
79
0.572595
false
4.425296
false
false
false
philpot/pymod
boutique.py
1
11494
#!/usr/bin/python # Filename: boutique.py ### REDESIGN of market.py ### (1) use web.py ### generator-based, yields web.storage from which you can whatever you need (url, sitekey) ''' boutique @author: Andrew Philpot @version 0.6 WAT boutique module Usage: python boutique.py Options: \t-h, --help:\tprint help to STDO...
apache-2.0
3,305,824,460,378,000,400
32.905605
120
0.555768
false
3.78715
false
false
false
fau-fablab/FabLabKasse
FabLabKasse/faucardPayment/dinterface/magpos.py
1
4916
#!/usr/bin/env python """ pymagpos -- MagnaCarta POS protocol (minimal robust implementation) """ import serial import codes import logging import time class MagposError(Exception): """ Base Exception Class for this Module """ pass class ResponseError(MagposError): """ ResponseError occur when the r...
gpl-3.0
7,384,428,041,022,479,000
30.113924
112
0.624085
false
4.327465
false
false
false
westernx/sgpublish
sgpublish/exporter/ui/publish/generic.py
1
16872
from __future__ import absolute_import import functools import os import re import sys import tempfile import traceback import subprocess import datetime from PyQt4 import QtCore, QtGui Qt = QtCore.Qt from sgfs import SGFS from sgactions.ticketui import ticket_ui_context from sgpublish.uiutils import ComboBox, hbox...
bsd-3-clause
1,374,290,374,414,146,600
35.283871
121
0.55761
false
4.203288
false
false
false
szilvajuhos/smallRef
scripts/makeShortContigs.py
1
1273
#! /usr/bin/env python import click import re import sys from Bio import SeqIO from Bio.Seq import Seq from Bio.SeqRecord import SeqRecord from Bio.Alphabet import IUPAC # Usage something like: # makeShortContigs.py -l 200000 -c 1,2,3,X -r human_g1k_v37_decoy.fasta @click.command(context_settings = dict( help_opti...
mit
1,313,171,125,127,874,600
36.441176
110
0.706206
false
2.967366
false
false
false
RobinCPC/algorithm-practice
IntegerArray/removeElement.py
1
1416
""" #: 27 Title: Remove Element Description: ------ Given an array and a value, remove all instances of that value in place and return the new length. Do not allocate extra space for another array, you must do this in place with constant memory. The order of elements can be changed. It doesn't matter what you leave b...
mit
538,157,690,904,572,000
22.6
98
0.532486
false
3.746032
false
false
false
pattisdr/osf.io
osf/migrations/0126_update_review_group_names.py
14
1618
# -*- coding: utf-8 -*- # Generated by Django 1.11.13 on 2018-08-08 19:45 from __future__ import unicode_literals from django.db import migrations class Migration(migrations.Migration): dependencies = [ ('osf', '0125_auto_20180808_1942'), ] operations = [ migrations.RunSQL( ...
apache-2.0
3,528,708,653,449,753,000
34.173913
93
0.369592
false
5.152866
false
false
false
babelsberg/babelsberg-r
topaz/modules/ffi/variadic_invoker.py
1
2087
from topaz.module import ClassDef from topaz.objects.objectobject import W_Object from topaz.modules.ffi.type import type_object, ffi_types, W_TypeObject, VOID from topaz.modules.ffi.dynamic_library import coerce_dl_symbol from topaz.modules.ffi.function_type import W_FunctionTypeObject from topaz.modules.ffi.function ...
bsd-3-clause
3,579,657,997,356,118,000
40.74
100
0.652132
false
3.286614
false
false
false
tkf/neo
neo/core/block.py
1
2657
from neo.core.baseneo import BaseNeo class Block(BaseNeo): """ Main container gathering all the data, whether discrete or continous, for a given recording session. A block is not necessarily temporally homogeneous, in contrast to Segment. *Usage*: TODO *Required attribut...
bsd-3-clause
5,692,692,600,697,648,000
32.632911
79
0.581859
false
4.604853
false
false
false
packetloop/dd-agent
tests/checks/integration/test_php_fpm.py
45
2904
# 3p from nose.plugins.attrib import attr # project from checks import AgentCheck from tests.checks.common import AgentCheckTest # sample from /status?json # { # "accepted conn": 350, # "active processes": 1, # "idle processes": 2, # "listen queue": 0, # "listen queue len": 0, # "max active p...
bsd-3-clause
-1,853,145,356,691,680,300
27.470588
79
0.546832
false
3.625468
true
false
false
pieleric/odemis
scripts/spectrum_volt.py
2
5683
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on 27 Mar 2017 @author: Éric Piel Acquires a CL spectrum at different e-beam voltages. If the e-beam is not in spot mode, it will be set to spot mode at the center of the SEM field-of-view. The spectrometer settings are used untouched. Warning: the optical p...
gpl-2.0
-1,619,190,431,934,194,700
29.880435
104
0.622316
false
3.692008
false
false
false
bbengfort/baleen
baleen/opml.py
2
3236
# baleen.opml # Reads opml files and gives back outline data # # Author: Benjamin Bengfort <benjamin@bengfort.com> # Created: Sat Sep 20 23:12:07 2014 -0400 # # Copyright (C) 2014 Bengfort.com # For license information, see LICENSE.txt # # ID: opml.py [b2f890b] benjamin@bengfort.com $ """ Reads opml files and gives...
mit
3,526,765,180,244,049,000
29.242991
75
0.472188
false
4.622857
false
false
false
s-pearce/glider-utilities
glider_utils/argos.py
1
1224
def carry_around_add(a, b): """ calculate the carry around sum for the 16 bit binary values """ c = a + b return (c & 0xff) + (c >> 16) def checksum(msg): """ calculate the checksum. documents say sum all the previous bytes and take the ones complement. that doesn't work, need to use th...
gpl-2.0
-4,782,108,888,793,058,000
23.979592
77
0.563725
false
2.942308
false
false
false
zoidbergwill/lint-review
tests/test_repo.py
2
5756
import json from . import load_fixture from contextlib import contextmanager from github3.repos.repo import Repository from github3.pulls import PullRequest from lintreview.config import load_config from lintreview.repo import GithubRepository from lintreview.repo import GithubPullRequest from mock import Mock, patch,...
mit
-8,117,336,746,393,311,000
32.271676
73
0.626998
false
3.816976
true
false
false
imay/palo
be/src/codegen/gen_ir_descriptions.py
1
7881
# 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
875,511,572,620,132,400
38.405
84
0.677452
false
2.992027
false
false
false
nett55/caniusepypy
caniusepypy/test/test_check.py
2
1958
# Copyright 2014 Google Inc. All rights reserved. # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # http://www.apache.org/licenses/LICENSE-2.0 # Unless required by applicable law or agre...
apache-2.0
8,970,292,225,690,979,000
30.580645
80
0.720123
false
3.824219
true
false
false
jeremysanders/veusz
veusz/plugins/__init__.py
7
1320
# Copyright (C) 2010 Jeremy S. Sanders # Email: Jeremy Sanders <jeremy@jeremysanders.net> # # 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 # ...
gpl-2.0
6,037,227,856,241,668,000
37.823529
78
0.715909
false
4.086687
false
false
false
rustico/dp
web-api/dp/settings_prod.py
1
4140
# -*- encoding: utf-8 -*- """ Django settings for dp project. For more information on this file, see https://docs.djangoproject.com/en/1.6/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/1.6/ref/settings/ """ # Build paths inside the project like this: os.path.j...
gpl-2.0
2,140,954,619,698,260,000
23.784431
94
0.711525
false
3.105026
false
false
false
brownharryb/erpnext
erpnext/accounts/doctype/invoice_discounting/invoice_discounting.py
1
6331
# -*- coding: utf-8 -*- # Copyright (c) 2019, Frappe Technologies Pvt. Ltd. and contributors # For license information, please see license.txt from __future__ import unicode_literals import frappe, json from frappe import _ from frappe.utils import flt, getdate, nowdate, add_days from erpnext.controllers.accounts_cont...
gpl-3.0
2,035,536,234,197,198,000
30.979798
112
0.685674
false
3.082278
false
false
false
parenthetical-e/modelmodel
tests/test_behave.py
1
3809
from modelmodel import behave import numpy as np SEED=45 def test_trials_trials(): prng = np.random.RandomState(SEED) # Simplet trials is a trial: [1, ] trials, prng = behave.trials.random(N=1, k=1, prng=prng) assert np.allclose(trials, np.array([1,])), ( "simplest trials breaks") ...
bsd-2-clause
2,348,247,808,626,808,300
30.487603
72
0.611184
false
2.840418
true
false
false
mazvv/travelcrm
travelcrm/models/outgoing.py
1
3356
# -*-coding: utf-8-*- from sqlalchemy import ( Column, Integer, Date, Numeric, String, Table, ForeignKey, ) from sqlalchemy.orm import relationship, backref from ..models import ( DBSession, Base ) outgoing_cashflow = Table( 'outgoing_cashflow', Base.metadata, Column(...
gpl-3.0
-7,055,886,075,532,842,000
20.375796
79
0.499702
false
4.26972
false
false
false
google/CommonLoopUtils
clu/metric_writers/summary_writer.py
1
2517
# Copyright 2021 The CLU Authors. # # 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 writ...
apache-2.0
4,893,251,175,021,279,000
32.56
75
0.69408
false
3.802115
false
false
false
rtidatascience/django-postgres-stats
postgres_stats/functions.py
1
2836
from django.db.models import Aggregate, Func import six class DateTrunc(Func): """ Accepts a single timestamp field or expression and returns that timestamp truncated to the specified *precision*. This is useful for investigating time series. The *precision* named parameter can take: * micro...
bsd-3-clause
-7,891,007,696,067,426,000
25.259259
132
0.592031
false
3.971989
false
false
false
0lidaxiang/WeArt
reader/view/loginView.py
1
4398
#!/usr/bin/python # -*- coding: UTF-8 -*- from django.http import JsonResponse from django.http import HttpResponseRedirect from django.http import HttpResponse from django.shortcuts import render from django.views.decorators import csrf # from django.contrib.auth.decorators import login_required from tool.tools impo...
bsd-3-clause
3,033,648,149,762,961,400
35.189655
96
0.593616
false
3.765022
false
false
false
mikel-egana-aranguren/MSc_Bioinformatics_UM_13-14_LSSW
doc/Programming-the-Semantic-Web/chapter2/simplegraph.py
2
5563
import csv class SimpleGraph: def __init__(self): self._spo = {} self._pos = {} self._osp = {} def add(self, (sub, pred, obj)): """ Adds a triple to the graph. """ self._addToIndex(self._spo, sub, pred, obj) self._addToIndex(self._pos, pr...
gpl-3.0
1,389,983,831,151,572,200
37.365517
93
0.480676
false
3.939802
false
false
false
Linaro/lava-server
dashboard_app/migrations/0015_remove_stale_content_types.py
1
1122
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations import django.core.validators def remove_stale_content_types(apps, schema_editor): # Remove known stale objects from django_content_type table. ContentType = apps.get_model("contenttypes", "ContentType") ...
agpl-3.0
-6,703,562,230,126,698,000
25.714286
64
0.604278
false
4.25
false
false
false
clerian/copyleftscienceTutorials
001-scrapeDataFromWebpage/getData.py
1
2988
import bs4 # BeautifulSoup HTML parser import urllib2 # open URLs import json # store data in a portable way def parseData(htmlData, timeTable): """ The purpose of this function is to extract the interessting data from the preloaded HTML page. This is done by using BeautifulSoup """ soup...
gpl-3.0
7,837,949,942,959,875,000
33.744186
125
0.570616
false
3.519435
false
false
false
welwel2/wsrepo
_tools/cr.py
1
2374
import os import shutil toolsdir = os.path.dirname(os.path.abspath(__file__)) base_path = os.path.split(toolsdir)[0] datadir = '_repo' toolsdir = "_tools" output = os.path.join(base_path, datadir) #print 'Output directory is %s'% output wslivetv = 'https://github.com/welwel2/wslive...
gpl-3.0
771,650,095,560,302,800
32.911765
86
0.619208
false
3.301808
false
false
false
chenke91/ihaveablog
app/admin/views.py
1
2139
from flask import render_template, request, redirect, url_for, g, jsonify, flash from flask.ext.login import login_required from app.models import Blog, Category from app import avatars from app.decorators import admin_required from . import admin @admin.route('/blogs/add/', methods=['GET', 'POST']) @login_required @a...
mit
8,605,077,185,840,440,000
29.242857
80
0.659424
false
3.339117
false
false
false
spencerahill/aospy-obj-lib
aospy_user/models/cmip5_models.py
1
18439
"""aospy.Model objects corresponding to CMIP5 data.""" import datetime import os from aospy.model import Model from .. import runs root_dir = '/archive/pcmdi/repo/CMIP5/output/' # BCC bcc_csm1 = Model( name='bcc_csm1-1', description='', # data_dir_struc='gfdl_repo', # data_direc=os.path.realpath(os....
apache-2.0
5,292,037,132,025,496,000
29.782972
91
0.640978
false
2.314713
false
true
false
blaisb/cfdemUtilities
mixing/foamTreatment/evolutionBedLevel.py
1
4813
#------------------------------------------------------------------------------------------------------------ # # This program averages openfoam probe data azimuthally. If variable is a scalar it also outputs the std-dev # # Output format : velocity : r z ux uy uz ur ut uz # scalar : r z scalar ...
lgpl-3.0
-6,221,462,796,995,080,000
30.253247
110
0.594847
false
3.121271
false
false
false
inej/toad
tasks/11-tensordipy.py
1
5151
import dipy.core.gradients import dipy.reconst.dti import dipy.segment.mask import dipy.reconst.dti import numpy import nibabel from core.generictask import GenericTask from lib.images import Images __author__ = 'desmat' class TensorDipy(GenericTask): def __init__(self, subject): GenericTask.__init__(s...
gpl-2.0
-1,260,300,960,972,631,300
43.791304
135
0.629975
false
3.377705
false
false
false
EricSB/nupic
tests/unit/nupic/frameworks/opf/common_models/cluster_params_test.py
3
2894
# ---------------------------------------------------------------------- # Numenta Platform for Intelligent Computing (NuPIC) # Copyright (C) 2015, Numenta, Inc. Unless you have purchased from # Numenta, Inc. a separate commercial license for this software code, the # following terms and conditions apply: # # This pro...
agpl-3.0
-1,303,442,580,877,357,600
39.194444
95
0.661023
false
4.593651
true
false
false
espenak/enkel
enkel/wansgli/http.py
1
5660
# This file is part of the Enkel web programming library. # # Copyright (C) 2007 Espen Angell Kristiansen (espen@wsgi.net) # # 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...
gpl-2.0
-4,034,770,585,486,457,000
28.789474
81
0.712721
false
3.349112
false
false
false
danielru/pySDC
pySDC/implementations/problem_classes/AdvectionEquation_1D_FD.py
1
6257
from __future__ import division import numpy as np import scipy.sparse as sp from scipy.sparse.linalg import splu from pySDC.core.Problem import ptype from pySDC.core.Errors import ParameterError, ProblemError # noinspection PyUnusedLocal class advection1d(ptype): """ Example implementing the unforced 1D adv...
bsd-2-clause
5,972,382,351,035,305,000
32.639785
115
0.523733
false
3.731067
false
false
false
yonglehou/docker-fabric
dockerfabric/utils/files.py
1
3529
# -*- coding: utf-8 -*- from __future__ import unicode_literals import shutil import tarfile import tempfile from fabric.api import run, sudo from fabric.context_managers import documented_contextmanager from dockermap.shortcuts import rm, chmod, chown from .output import single_line_stdout _safe_name = lambda tar...
mit
-5,438,494,212,372,370,000
30.230088
153
0.667328
false
3.85262
false
false
false
llimllib/limbo
limbo/plugins/weather.py
1
3803
# -*- coding: utf-8 -*- """!weather <zip or place name> return the 5-day forecast Three environment variables control the behavior of this plugin: MAPBOX_API_TOKEN: must be set to a valid Mapbox API token https://docs.mapbox.com/api/search/#geocoding OPENWEATHER_API_KEY: must be set to a ...
mit
-6,648,842,372,692,528,000
29.910569
118
0.593372
false
3.400716
false
false
false
MySmile/mysmile
apps/pages/admin.py
1
3328
import os from django.contrib import admin from django.conf import settings from apps.pages.models import Page, Page_translation from apps.pages.forms import Page_translationInlineForm, PageForm class Page_translationInline(admin.StackedInline): model = Page_translation form = Page_translationInlineForm ...
bsd-3-clause
-3,575,291,305,965,562,000
38.152941
93
0.5628
false
4
false
false
false
iLoop2/ResInsight
ThirdParty/Ert/devel/python/python/ert/sched/sched_file.py
1
1911
# Copyright (C) 2012 Statoil ASA, Norway. # # The file 'sched_file.py' is part of ERT - Ensemble based Reservoir Tool. # # ERT 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 o...
gpl-3.0
-5,625,121,413,102,356,000
40.543478
112
0.714809
false
3.294828
false
false
false
zerosum0x0/koadic
modules/implant/gather/user_hunter.py
1
2845
import core.implant import core.job import string import uuid class UserHunterJob(core.job.Job): def create(self): self.fork32Bit = True self.options.set("DLLUUID", uuid.uuid4().hex) self.options.set("MANIFESTUUID", uuid.uuid4().hex) self.options.set("DIRECTORY", self.options.get('D...
apache-2.0
80,671,390,199,258,530
33.277108
147
0.589455
false
3.77822
false
false
false
jinankjain/zamboni
lib/urls_base.py
1
2123
from django.conf import settings from django.conf.urls import include, patterns, url from django.contrib import admin from django.shortcuts import redirect from django.views.decorators.cache import cache_page from django.views.i18n import javascript_catalog admin.autodiscover() handler403 = 'amo.views.handler403' han...
bsd-3-clause
5,694,466,639,472,303,000
28.082192
74
0.628356
false
3.666667
false
true
false
thisismyrobot/motorsport-dev
py-gps/src/output/visual/opengl.py
1
2609
import pyglet.window import pyglet.image class IsoRenderer(object): """ Renders a 3D view of a map """ cam_rx, cam_ry, cam_rz = 45, 0, 0 cam_x, cam_y, cam_z = 0, 0, -1000 w, h = 640, 480 far = 10000 fov = 60 def __init__(self): self.load_map() self.creat...
unlicense
8,750,948,577,670,690,000
32.813333
88
0.592947
false
2.928171
false
false
false
andrewsy97/Treehacks
groupy_files/groupy/object/attachments.py
1
6253
""" .. module:: attachments :platform: Unix, Windows :synopsis: A module containing all attachment classes .. moduleauthor:: Robert Grant <rhgrant10@gmail.com> This module contains classes for the different types of attachments. """ from ..api import endpoint class Attachment: """Base class for attachm...
mit
1,290,227,850,733,663,000
29.955446
79
0.632017
false
4.177021
false
false
false
JulienPobot/LeCubeMedia
src/lecube/mod/cmnfc.py
1
1054
# -*- coding: utf-8 -*- import Tkinter as tk import thread import logging class Application(tk.Frame): def __init__(self, cube, master=None): tk.Frame.__init__(self, master) self.grid() self.createWidgets() self.cube = cube def createWidg...
apache-2.0
8,025,032,704,159,344,000
30.029412
68
0.58444
false
3.75089
false
false
false
droundy/deft
papers/thesis-scheirer/RG_generateID3.py
2
1573
import sys import os import pylab as plt import time temp=plt.linspace(.6,1.28,20) temp=[temp[20]] ID = int(sys.argv[0].split('ID')[1].split('.py')[0]) print ID print temp for i in range(0,len(temp)): #if i %4 != ID: # continue t=time.time() print '%d of %d'%(i,len(temp)) ...
gpl-2.0
4,527,302,552,630,158,000
32.468085
52
0.544183
false
2.608624
false
false
false
defionscode/ansible
lib/ansible/modules/net_tools/nios/nios_host_record.py
17
8805
#!/usr/bin/python # Copyright (c) 2018 Red Hat, Inc. # 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 ANSIBLE_METADATA = {'metadata_version': '1.1', 'status': ['preview...
gpl-3.0
8,154,821,391,732,588,000
29.894737
115
0.644634
false
4.009563
true
false
false
dr-guangtou/KungPao
kungpao/io.py
1
4252
#!/usr/bin/env python # -*- coding: utf-8 -*- """File Input/Output.""" import os import pickle import warnings import numpy as np from astropy.io import fits __all__ = ['save_to_pickle', 'save_to_hickle', 'save_to_csv', 'save_to_fits', 'parse_reg_ellipse', 'psfex_extract', 'read_from_pickle', ...
gpl-3.0
82,197,762,229,528,700
25.409938
77
0.584196
false
3.213908
false
false
false
liulion/mayavi
mayavi/action/modules.py
2
2530
"""Actions to start various modules. """ # Author: Prabhu Ramachandran <prabhu_r@users.sf.net> # Copyright (c) 2005-2008, Enthought, Inc. # License: BSD Style. import new # Local imports. from mayavi.core.registry import registry from mayavi.core.metadata import ModuleMetadata from mayavi.core.pipeline_info import P...
bsd-3-clause
353,088,184,930,345,200
35.142857
79
0.505929
false
5.184426
false
false
false
nervenXC/topical_word_embeddings
TWE-2/last_last_step.py
3
1257
#!/usr/bin/env python2 #-*- coding: UTF-8 -*- #File: #Date: #Author: Yang Liu <largelymfs@gmail.com> #Description: if __name__=="__main__": with open("test.log","w") as logout, open("result.out") as f, open("result.out.out","w") as fout, open("log.txt") as log: #log loading content2id = {} ...
mit
998,559,788,393,184,800
34.914286
125
0.529037
false
3.481994
false
false
false
philipkershaw/crypto-cookie
setup.py
1
1426
#!/usr/bin/env python """Distribution Utilities for crypto-cookie package """ __author__ = "@philipkershaw" __date__ = "09/07/15" __copyright__ = "(C) 2015 Science and Technology Facilities Council" __license__ = "BSD - see LICENSE file in top-level directory" __contact__ = "Philip.Kershaw@stfc.ac.uk" __revision__ = '...
bsd-3-clause
-8,888,149,941,170,016,000
34.65
71
0.57223
false
3.371158
false
false
false
ilikesounds/jt_portfolio
jt_portfolio/settings/prod.py
1
1766
import os import dj_database_url from jt_portfolio.settings.base import * DEBUG = True DATABASES = { 'default': { 'ENGINE': dj_database_url.config( default=os.environ.get('DATABASE_URL') ) } } EMAIL_USE_TLS = True EMAIL_HOST = 'smtp.gmail.com' EMAIL_HOST_USER = os.env...
mit
-6,825,678,805,469,355,000
25.358209
74
0.548698
false
3.55332
false
false
false
viswimmer1/PythonGenerator
data/python_files/32677266/github.py
1
13970
import httplib import logging import urllib2 from django import forms from django.conf import settings from django.contrib.sites.models import Site from django.utils import simplejson from django.utils.translation import ugettext_lazy as _ from djblets.siteconfig.models import SiteConfiguration from reviewboard.hosti...
gpl-2.0
4,872,648,449,457,827,000
37.065395
80
0.522477
false
4.196455
false
false
false
rahul67/hue
apps/filebrowser/src/filebrowser/forms.py
22
7669
#!/usr/bin/env python # Licensed to Cloudera, Inc. under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. Cloudera, Inc. licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you ma...
apache-2.0
1,458,078,050,195,964,000
33.859091
106
0.701656
false
3.583645
false
false
false
dbmi-pitt/DIKB-Micropublication
scripts/mp-scripts/Bio/Saf/saf_format.py
1
2399
# Copyright 2001 by Katharine Lindner. All rights reserved. # This code is part of the Biopython distribution and governed by its # license. Please see the LICENSE file that should have been included # as part of this package. """Martel based parser to read SAF formatted files. This is a huge regular regular expres...
apache-2.0
-35,273,515,758,513,052
28.256098
87
0.678616
false
3.564636
false
false
false
Simpsonpt/django-acra
acra/models.py
1
2726
from django.db import models from django.utils.timezone import utc from datetime import datetime import json REPORT_STATUS = ( ("solved","Solved"), ("unsolved","Unsolved"), ) class CrashReport(models.Model): stack_trace = models.TextField(default="") logcat = models.TextField(default="") shared_preferences = mod...
gpl-3.0
7,411,365,509,683,363,000
52.45098
163
0.747249
false
3.446271
false
false
false
jcherqui/searx
searx/engines/btdigg.py
2
2621
""" BTDigg (Videos, Music, Files) @website https://btdig.com @provide-api yes (on demand) @using-api no @results HTML (using search portal) @stable no (HTML can change) @parse url, title, content, seed, leech, magnetlink """ from lxml import html from operator import itemgetter from searx...
agpl-3.0
7,239,155,016,122,336,000
29.835294
97
0.585273
false
3.837482
false
false
false
rabipanda/tensorflow
tensorflow/python/kernel_tests/linalg/linear_operator_util_test.py
25
9406
# Copyright 2016 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
-4,110,878,620,793,600,000
35.316602
80
0.651393
false
3.158496
true
false
false
boeserwolf/sublime3-js2coffee
js2coffeescript.py
1
1340
import sublime, sublime_plugin import subprocess class JsToCoffeescriptCommand(sublime_plugin.TextCommand): def run(self, edit): view = self.view # get non-empty selections regions = [s for s in view.sel() if not s.empty()] # if there's no non-empty selection, filter the whole docu...
mit
-2,358,411,413,688,469,000
36.222222
81
0.551493
false
4.148607
false
false
false
ivannz/study_notes
year_14_15/course_project/code/project/matlab_test.py
1
3085
import numpy as np from numpy.random import RandomState from fgn import fbm import scipy.io as io N, H = 2**20 + 1, 0.5 generator = fbm( N = N, H = H, time = True ) generator.set_rnd( RandomState( 123 ) ) T, X = generator( ) io.savemat( './output/data.mat', { 'T': T, 'X': X, 'H': H, 'N': N } ) # import...
mit
5,884,203,619,127,614,000
33.45977
95
0.509887
false
2.382239
false
false
false
KitwareMedical/SlicerITKUltrasound
Documentation/ctk-cli-to-rst.py
1
1065
#!/usr/bin/env python import ctk_cli from rstcloth import rstcloth import argparse def cli2rst(cliFile, rstFile): cli = ctk_cli.CLIModule(cliFile) rst = rstcloth.RstCloth() rst.title(cli.title) rst.newline() rst.content(cli.description) rst.newline() rst.field('Authors', cli.contributor...
apache-2.0
4,431,580,354,356,197,400
23.767442
132
0.6723
false
3.64726
false
false
false
efulet/library-sample
library/lib/library/library.py
1
6410
""" Define the implementation for Library interface and their class exceptions. @created_at 2015-05-16 @author Exequiel Fuentes Lettura <efulet@gmail.com> """ import operator from book import Book class LibraryException(Exception): """Define an exception class for Library errors""" def __init__(self,...
mit
-8,818,376,643,218,544,000
36.052023
103
0.599532
false
4.307796
false
false
false
MariiaSurmenok/insight-data-challenge
src/process_log.py
1
1315
""" Main file. All 4 features are running here. """ import sys from collections import Counter from datetime import timedelta import active_users import busiest_hours import failed_login import popular_resources from io_utils import date_formatting, read_from_file, write_information_to_file # File paths filename =...
mit
3,266,234,163,898,952,700
23.351852
79
0.755133
false
3.30402
false
false
false
ZwaConnection/TheGuildWeb
apps/association/models.py
1
1465
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.contrib.auth.models import User from django.db import models from ..member.models import * from django.db.models.signals import post_save from django.dispatch import receiver # Create your models here. class Association(models.Model): nam...
gpl-3.0
7,468,152,057,293,517,000
39.694444
86
0.708532
false
3.737245
false
false
false