repo_name
stringlengths
5
92
path
stringlengths
4
221
copies
stringclasses
19 values
size
stringlengths
4
6
content
stringlengths
766
896k
license
stringclasses
15 values
hash
int64
-9,223,277,421,539,062,000
9,223,102,107B
line_mean
float64
6.51
99.9
line_max
int64
32
997
alpha_frac
float64
0.25
0.96
autogenerated
bool
1 class
ratio
float64
1.5
13.6
config_test
bool
2 classes
has_no_keywords
bool
2 classes
few_assignments
bool
1 class
iulian787/spack
var/spack/repos/builtin/packages/ninja-fortran/package.py
2
3110
# Copyright 2013-2020 Lawrence Livermore National Security, LLC and other # Spack Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) from spack import * class NinjaFortran(Package): """A Fortran capable fork of ninja.""" homepage = "https://git...
lgpl-2.1
-1,166,708,126,163,917,600
44.735294
107
0.694534
false
2.774309
true
false
false
muthu-s/chef-repo
cookbooks/wsi/files/createqueues.py
1
1183
import os; import sys; import traceback; ##################################################################### ## Create MQ Queues at cluster level ##################################################################### def createQueues(clusterName, DisplayName, jndiName, queueName, queueMgrName): clusterid=Adm...
apache-2.0
7,639,029,678,157,415,000
37.16129
137
0.510566
false
4.209964
false
false
false
getupcloud/referral
utils.py
1
1456
from urllib.parse import unquote from flask import request, url_for from playhouse.shortcuts import model_to_dict, dict_to_model from decimal import Decimal def to_dict(obj): """ Helper method that returns a mongoengine document in python dict format """ from models import ReferralProgram def ...
apache-2.0
-5,856,686,055,878,276,000
28.12
96
0.608516
false
3.811518
false
false
false
z-william131/small_projects
FileSort/FileSort.py
1
3269
# !/usr/bin/python # The FiltSort function need an input: the path to a folder, # and then it will generate an output.txt file that includes # the "index, file name, address, maintag, subtag, subtag2" # of every file in that folder. # It can also return the output file as a list. import os def setLabel(pat...
mit
7,337,251,025,384,431,000
27.929204
89
0.542368
false
3.488794
false
false
false
chawins/aml
lib/RandomEnhance.py
1
2811
import random import numpy as np from PIL import Image, ImageEnhance class RandomEnhance(): """ Class to randomly enhance image by adjusting color, contrast, sharpness and brightness """ def __init__(self, seed=None, p=1.0, intensity=0.5): """ Initialises an instance. Pa...
mit
-8,288,442,314,468,944,000
32.070588
91
0.599075
false
3.773154
false
false
false
SUNET/eduid-signup
eduid_signup/session.py
1
1724
from zope.interface import implementer from pyramid.interfaces import ISessionFactory, ISession from eduid_common.session.pyramid_session import SessionFactory as CommonSessionFactory from eduid_common.session.pyramid_session import Session as CommonSession import logging logger = logging.getLogger(__name__) _EDIT_U...
bsd-3-clause
-769,802,457,438,294,800
31.528302
87
0.664153
false
4.364557
false
false
false
peterfeiner/wcp
wcp/cli.py
1
4339
# Copyright (C) 2014 Peter Feiner import argparse import sys import os import signal from . import record from . import report SIGNALS = {} for name in dir(signal): if name.startswith('SIG') and not name.startswith('SIG_'): SIGNALS[name] = getattr(signal, name) def parse_signal(string): if string ...
gpl-2.0
6,219,256,643,953,565,000
35.771186
78
0.577322
false
3.930254
false
false
false
ralph-group/pymeasure
pymeasure/display/windows.py
1
37114
# # This file is part of the PyMeasure package. # # Copyright (c) 2013-2021 PyMeasure Developers # # 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 limit...
mit
-5,536,501,795,903,811,000
38.315678
139
0.630975
false
4.244511
false
false
false
t11e/django
django/core/cache/backends/filebased.py
1
4639
"File-based cache backend" import os import time import shutil try: import cPickle as pickle except ImportError: import pickle from django.core.cache.backends.base import BaseCache from django.utils.hashcompat import md5_constructor class CacheClass(BaseCache): def __init__(self, dir, params): Ba...
bsd-3-clause
-217,061,094,118,470,720
28.176101
116
0.533951
false
4.040941
false
false
false
Wikidata/StrepHit
doc/update_doc.py
1
3071
import requests import click import subprocess import os class WikimediaApi: logged_in = False def __init__(self, endpoint='https://www.mediawiki.org/w/api.php'): self.session = requests.Session() self.api_endpoint = endpoint def call_api(self, action, **kwargs): r = self.session...
gpl-3.0
-4,140,018,537,711,046,700
30.659794
116
0.537284
false
3.998698
false
false
false
TeamWorkQualityReport/TeamWorkQualityReport
Backend/Analise/Analisador.py
1
9696
import numpy as np from Analise.IAnalisador import IAnalisador from Analise.entidades.formulario import Formulario from Analise.entidades.variavel import Variavel from Analise.entidades.questao import Questao from Analise.entidades.relatorioResultado import RelatorioResultado from Analise.entidades.constructo import C...
gpl-3.0
-2,382,247,268,170,386,400
49.5
293
0.649031
false
2.850926
false
false
false
cronuspaas/cronusagent
agent/agent/lib/agent_thread/download_thread.py
1
13166
#pylint: disable=W0703,W0511,W0402,R0911,R0915,R0912,W0331,W0612,R0904,W0105 """ Thread to download a package """ from agent.lib import utils, contextutils, configutil from agent.lib.agent_thread.agent_thread import AgentThread from agent.lib.errors import Errors, FileNotFoundError, AgentException from agent.lib.packa...
apache-2.0
156,922,315,942,817,570
45.687943
125
0.544205
false
4.653941
true
false
false
algorhythms/LeetCode
283 Move Zeroes.py
1
1204
""" Given an array nums, write a function to move all 0's to the end of it while maintaining the relative order of the non- zero elements. For example, given nums = [0, 1, 0, 3, 12], after calling your function, nums should be [1, 3, 12, 0, 0]. Note: You must do this in-place without making a copy of the array. Minim...
mit
-4,577,519,818,686,035,500
24.083333
119
0.531561
false
3.5727
false
false
false
almlab/SmileTrain
tools/get_taxonomies.py
1
2955
#!/usr/bin/env python ''' Get greengenes taxonomies. Given an otu table with otu ids in the first column, search through the greengenes taxonomy list. Output the taxonomies in order. If the input database is a pickle, just load that dictionary. ''' import sys, argparse, re, cPickle as pickle def table_ids(fn): ...
mit
-2,087,470,422,215,640,300
32.977011
165
0.601015
false
3.346546
false
false
false
jimsize/PySolFC
pysollib/tk/tkhtml.py
1
4931
#!/usr/bin/env python # -*- mode: python; coding: utf-8; -*- # --------------------------------------------------------------------------- # # Copyright (C) 1998-2003 Markus Franz Xaver Johannes Oberhumer # Copyright (C) 2003 Mt. Hood Playing Card Co. # Copyright (C) 2005-2009 Skomoroh # # This program is free software...
gpl-3.0
-2,449,040,235,664,294,000
34.221429
78
0.528493
false
4.147183
false
false
false
jeremiahmarks/dangerzone
scripts/python/remoteAccessScripts/dirTree.py
1
2490
#this script will mount a remote file system using fuse and then generate a #directory tree using os.walk #TODO: for some reason the files that are on the top level all have a double slash # I know that it is due to the line: # k.write('{}{}/{}'.format(subindent,root.replace(startpath, 'http://jlmarks...
mit
-4,775,350,889,011,808,000
40.5
102
0.675502
false
3.661765
false
false
false
spoonysonny/SAKS-tutorials
chengying/sakspins.py
1
1183
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Copyright (c) 2016 NXEZ.COM. # http://www.nxez.com # # Licensed under the GNU General Public 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.gnu.org/licen...
gpl-2.0
2,732,638,948,741,312,000
23.666667
77
0.652578
false
2.920988
false
false
false
dgu-dna/DNA-Bot
apps/quiz.py
1
7875
from apps.decorators import on_command from apps.slackutils import cat_token, isNumber, get_nickname from time import localtime, strftime import os import re import json import time import urllib import random CACHE_DEFAULT_URL = './apps/quiz_cache/' CACHE_CATEGORY_URL = './apps/quiz_cache/category/' def get_random_q...
mit
-6,365,272,749,459,497,000
36.55102
124
0.519429
false
2.56446
false
false
false
Molecular-Image-Recognition/Molecular-Image-Recognition
code/rmgpy/molecule/draw.py
1
72901
#!/usr/bin/env python # encoding: utf-8 ################################################################################ # # RMG - Reaction Mechanism Generator # # Copyright (c) 2002-2017 Prof. William H. Green (whgreen@mit.edu), # Prof. Richard H. West (r.west@neu.edu) and the RMG Team (rmg_dev@mit.edu) # # ...
mit
4,890,292,243,272,668,000
45.023359
191
0.526934
false
4.013267
false
false
false
Inspq/ansible
lib/ansible/modules/web_infrastructure/htpasswd.py
1
9184
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2013, Nimbis Services, Inc. # # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (...
gpl-3.0
-283,431,518,286,145,500
31.338028
110
0.62304
false
3.962036
false
false
false
avilaton/sqlalchemy-continuum
sqlalchemy_continuum/transaction.py
1
5496
from datetime import datetime try: from collections import OrderedDict except ImportError: from ordereddict import OrderedDict import six import sqlalchemy as sa from sqlalchemy.ext.compiler import compiles from .dialects.postgresql import ( CreateTemporaryTransactionTableSQL, InsertTemporaryTransacti...
bsd-3-clause
-4,239,641,394,936,761,300
29.876404
100
0.532751
false
4.816827
false
false
false
RTHMaK/RPGOne
deep_qa-master/deep_qa/tensors/masked_operations.py
1
4270
from keras import backend as K from .backend import switch def masked_batch_dot(tensor_a, tensor_b, mask_a, mask_b): ''' The simplest case where this function is applicable is the following: tensor_a: (batch_size, a_length, embed_dim) tensor_b: (batch_size, b_length, embed_dim) mask_a: None or (...
apache-2.0
-8,834,312,388,142,465,000
42.571429
101
0.628806
false
3.364854
false
false
false
spiceqa/tp-spice
spice/client-tests/help_version.py
1
1860
#!/usr/bin/python # 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. # # This program is distributed in the hope that it w...
gpl-2.0
-7,757,124,006,179,228,000
34.769231
79
0.686559
false
3.842975
false
false
false
AnselCmy/ARPS
ML_model/test/report_classifier.py
1
2434
#!/usr/bin/env python # -*- coding:utf-8 -*- from __future__ import print_function import sys reload(sys) sys.setdefaultencoding('utf8') import pymongo as pm sys.path.append('..') from model.main import Multi_Label_Model def check_contain_chinese(check_str): for ch in check_str.decode('utf-8'): if u'\u4e00' <= ch ...
mit
1,969,431,880,389,390,300
28.142857
93
0.628788
false
2.407725
false
false
false
teamCarel/EyeTracker
src/capture/eye.py
1
20620
''' (*)~--------------------------------------------------------------------------- Pupil - eye tracking platform Copyright (C) 2012-2017 Pupil Labs Distributed under the terms of the GNU Lesser General Public License (LGPL v3.0). See COPYING and COPYING.LESSER for license details. ---------------------------...
lgpl-3.0
3,157,418,032,018,782,700
42.535637
220
0.533511
false
4.07188
false
false
false
cogeorg/BlackRhino
networkx/drawing/nx_pylab.py
1
32861
# Copyright (C) 2004-2016 by # Aric Hagberg <hagberg@lanl.gov> # Dan Schult <dschult@colgate.edu> # Pieter Swart <swart@lanl.gov> # All rights reserved. # BSD license. # # Author: Aric Hagberg (hagberg@lanl.gov) """ ********** Matplotlib ********** Draw networks with matplotlib. See Also -------- m...
gpl-3.0
2,971,644,789,041,964,000
30.177419
124
0.581601
false
4.218898
false
false
false
svidela/pyzcasp
pyzcasp/asp/adapters.py
1
3307
# Copyright (c) 2014, Santiago Videla # # This file is part of pyzcasp. # # caspo is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # c...
gpl-3.0
265,944,677,918,393,200
29.62037
94
0.614454
false
3.984337
false
false
false
kalhartt/pycclone
pycclone/source.py
1
6074
""" #pycclone.source Provides a class for handling source files. The primary goal is to create a generator yielding (docs, code) tuples from a source file. """ import logging import re import os import pycclone.utils as utils import pycclone.languages as languages try: from StringIO import StringIO except ImportE...
mit
-2,936,048,722,182,657,500
28.921182
93
0.515311
false
4.679507
false
false
false
googleapis/googleapis-gen
google/ads/googleads/v8/googleads-py/google/ads/googleads/v8/enums/types/campaign_serving_status.py
1
1207
# -*- coding: utf-8 -*- # Copyright 2020 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or...
apache-2.0
5,789,341,695,327,524,000
28.439024
74
0.67937
false
3.893548
false
false
false
jcassee/django-geckoboard
django_geckoboard/decorators.py
1
18337
""" Geckoboard decorators. """ from __future__ import absolute_import from collections import OrderedDict from functools import wraps from hashlib import md5 from xml.dom.minidom import Document import base64 import json from Crypto import Random from Crypto.Cipher import AES from django.conf import settings from dja...
mit
-4,231,649,804,232,618,500
33.274766
94
0.578012
false
4.048797
false
false
false
eukaryote/asn1crypto
asn1crypto/_win/_ws2_32.py
1
2000
# coding: utf-8 from __future__ import unicode_literals, division, absolute_import, print_function import socket from .._ffi import ( buffer_from_bytes, bytes_from_buffer, cast_void_p, FFIEngineError, is_null, string_from_buffer, unicode_buffer, ) try: from ._ws2_32_cffi import ws2_32...
mit
7,021,345,125,814,088,000
24
89
0.6515
false
3.30033
false
false
false
PLOS/allofplos
allofplos/elements/license.py
1
5138
import lxml.etree as et import re # Creative Commons links xlink_href = '{http://www.w3.org/1999/xlink}href' cc_by_4_link = 'https://creativecommons.org/licenses/by/4.0/' cc_by_3_link = 'https://creativecommons.org/licenses/by/3.0/' cc0_link = 'https://creativecommons.org/publicdomain/zero/1.0/' cc_by_3_igo_link = 'ht...
mit
7,154,977,985,650,922,000
44.052632
135
0.560358
false
3.702956
false
false
false
JuezUN/INGInious
inginious/frontend/pages/course_admin/aggregation_info.py
1
2947
# -*- coding: utf-8 -*- # # This file is part of INGInious. See the LICENSE and the COPYRIGHTS files for # more information about the licensing of this file. import web from bson.objectid import ObjectId from inginious.frontend.pages.course_admin.utils import make_csv, INGIniousAdminPage class CourseAggregationInf...
agpl-3.0
3,588,982,702,635,367,000
39.930556
161
0.522226
false
4.28343
false
false
false
centricular/meson
mesonbuild/dependencies.py
1
52213
# Copyright 2013-2015 The Meson development team # 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 agree...
apache-2.0
5,174,436,312,750,799,000
37.056122
100
0.547775
false
4.054749
true
false
false
11mariom/sensu-checks
unifi/unifi-get-stats.py
1
1510
#!/usr/bin/env python # # Get stats from a Unifi AP controller using the API # # Requires the unifi python module # import argparse import json from unifi.controller import Controller parser = argparse.ArgumentParser() parser.add_argument('-c', '--controller', default='unifi', help='the controller address (default "...
gpl-2.0
-6,542,056,813,486,104,000
38.736842
123
0.654967
false
3.240343
false
false
false
rajalokan/keystone
keystone/token/persistence/backends/sql.py
1
12167
# Copyright 2012 OpenStack Foundation # # 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...
apache-2.0
407,838,895,909,105,800
39.828859
79
0.592422
false
4.145486
false
false
false
jmesteve/openerp
openerp/addons/account_balance_reporting/account_balance_reporting_report.py
1
21960
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP - Account balance reporting engine # Copyright (C) 2009 Pexego Sistemas Informáticos. All Rights Reserved # $Id$ # # This program is free software: you can redistribute it and/or modify # it...
agpl-3.0
6,735,523,408,756,101,000
49.020501
124
0.491234
false
4.698117
false
false
false
richardotis/pycalphad-fitting
fit.py
1
2193
""" Automated fitting script. """ import os import sys import fnmatch import argparse import logging import multiprocessing from paramselect import fit, load_datasets from distributed import Client, LocalCluster parser = argparse.ArgumentParser(description=__doc__) parser.add_argument( "--dask-scheduler", met...
mit
7,039,180,532,096,761,000
28.24
124
0.668947
false
3.673367
false
false
false
JeremyMorgan/Raspberry_Pi_Temperature
temp-humidity.py
1
1864
import os import glob import subprocess import calendar import time import urllib2 import json import Adafruit_DHT #initialize os.system('modprobe w1-gpio') os.system('modprobe w1-therm') sensor = Adafruit_DHT.DHT22 pin = 8 #Temperature device base_dir = '/sys/bus/w1/devices/' device_folder = glob.glob(base_dir + '28...
gpl-2.0
-9,041,252,855,166,964,000
24.888889
99
0.674356
false
2.987179
false
false
false
christiansandberg/canopen
examples/simple_ds402_node.py
1
4328
import canopen import sys import os import traceback import time try: # Start with creating a network representing one CAN bus network = canopen.Network() # Connect to the CAN bus network.connect(bustype='kvaser', channel=0, bitrate=1000000) network.check() # Add some nodes with correspond...
mit
-1,015,862,993,798,331,600
26.392405
95
0.594732
false
3.432197
false
false
false
fu-berlin-swp-2014/center-points
centerpoints/visualise.py
1
19882
import time import colorsys import sys from PySide import QtGui, QtOpenGL, QtCore from PySide.QtCore import QTimer, SIGNAL from PySide.QtGui import QLabel import copy import numpy as np from OpenGL.GL import * from OpenGL.GLU import * import centerpoints.data_set class Color: def __init__(self, color=None): ...
mit
1,970,213,918,985,893,400
29.447167
85
0.572427
false
3.630752
false
false
false
rajalokan/keystone
keystone/identity/backends/ldap/common.py
1
71718
# Copyright 2012 OpenStack Foundation # # 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...
apache-2.0
5,470,165,449,788,208,000
38.90985
79
0.570345
false
4.179371
false
false
false
gkc1000/pyscf
pyscf/geomopt/berny_solver.py
1
9010
#!/usr/bin/env python # Copyright 2014-2019 The PySCF Developers. 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 # # U...
apache-2.0
-6,266,812,189,044,078,000
33.922481
91
0.626415
false
3.353182
false
false
false
ingenioustechie/cookiecutter-django-openshift
hooks/post_gen_project.py
1
8246
""" Does the following: 1. Generates and saves random secret key 2. Removes the taskapp if celery isn't going to be used 3. Removes the .idea directory if PyCharm isn't going to be used 4. Copy files from /docs/ to {{ cookiecutter.project_slug }}/docs/ TODO: this might have to be moved to a pre_gen_hook A portio...
mit
-1,349,989,129,254,802,700
32.116466
127
0.657531
false
3.461797
false
false
false
smuthunoori/ComicCreator
generaloptions.py
1
1035
__author__ = 'smuthunoori' import kivy kivy.require('1.7.0') from kivy.uix.boxlayout import BoxLayout from kivy.properties import ListProperty class GeneralOptions(BoxLayout): group_mode = False translation = ListProperty(None) def clear(self, instance): self.drawing_space.clear_widgets() ...
mit
-7,419,711,629,351,038,000
24.243902
76
0.628986
false
3.996139
false
false
false
ericchill/gnofract4d
fract4d/gradient.py
1
28489
#!/usr/bin/env python import math import re import StringIO import copy import random import types import struct import colorsys #Class definition for Gradients #These use the format defined by the GIMP #The file format is: # GIMP Gradient ; literal identifier # Name: <utf8-name> ; optional, else get from filename ...
bsd-3-clause
3,981,176,068,436,644,000
33.241587
144
0.496753
false
3.537688
false
false
false
CactusTribe/PyRobot
src/server/modules/CameraModule.py
1
1742
import threading, io, struct, time from ThreadClient import ThreadClient from devices.Devices import * class CameraModule(ThreadClient): def __init__(self, name): ThreadClient.__init__(self, name) self.camera_capture = False # Execute command def execute_cmd(self, cmd): args = cmd.split(" ") cmd = args[0]...
gpl-3.0
3,101,360,533,350,989,000
24.632353
78
0.607348
false
3.311787
false
false
false
bitmazk/django-document-library
document_library/templatetags/document_library_tags.py
1
1256
"""Templatetags for the ``document_library`` app.""" from django import template from ..models import Document register = template.Library() @register.assignment_tag def get_files_for_document(document): """ Returns the available files for all languages. In case the file is already present in another ...
mit
-5,710,013,912,025,376,000
26.304348
79
0.680732
false
3.900621
false
false
false
fabianopetroni/connector
connector/connector.py
1
1179
import os import sys # Constant for verify connection FTRACK_CONNECTED = False sys.path += ["D:/server/apps/3rdparty/ftrack-python"] os.environ['FTRACK_SERVER'] = 'https://cas.ftrackapp.com' os.environ['LOGNAME'] = 'fabianopetroni' import ftrack FTRACK_CONNECTED = True class Connector(object): """Class for Co...
mit
2,735,098,389,936,490,500
21.245283
73
0.628499
false
3.684375
false
false
false
quodlibet/quodlibet
quodlibet/qltk/songlistcolumns.py
1
16188
# Copyright 2005 Joe Wreschnig # 2012 Christoph Reiter # 2011-2020 Nick Boultbee # 2014 Jan Path # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of th...
gpl-2.0
-8,249,796,910,159,764,000
31.376
79
0.602916
false
3.715401
false
false
false
Pajn/RAXA-Django
common/models/Temp.py
1
1389
''' Copyright (C) 2013 Rasmus Eneman <rasmus@eneman.eu> This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is...
agpl-3.0
3,343,948,646,732,781,000
31.302326
79
0.722102
false
4.158683
false
false
false
geomf/omf-fork
omf/model/user.py
1
2023
# # Open Modeling Framework (OMF) Software for simulating power systems behavior # Copyright (c) 2015, Intel Corporation. # # This program is free software; you can redistribute it and/or modify it # under the terms and conditions of the GNU General Public License, # version 2, as published by the Free Software Foundat...
gpl-2.0
2,636,837,996,714,867,700
37.169811
141
0.694513
false
3.802632
false
false
false
sohyongsheng/kaggle-carvana
plot_learning_curves.py
1
2337
import numpy import matplotlib.pyplot import pylab import sys def plot_learning_curves(experiment, epochs, train_losses, cross_validation_losses, dice_scores, x_limits = None, y_limits = None): axes = matplotlib.pyplot.figure().gca() x_axis = axes.get_xaxis() x_axis.set_major_locator(pylab.MaxNLocator(...
gpl-3.0
1,077,009,801,315,857,200
43.942308
131
0.685494
false
3.546282
false
false
false
czcorpus/kontext
lib/plugins/default_query_history/__init__.py
1
13623
# Copyright (c) 2013 Charles University in Prague, Faculty of Arts, # Institute of the Czech National Corpus # Copyright (c) 2013 Tomas Machalek <tomas.machalek@gmail.com> # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License #...
gpl-2.0
2,395,338,510,441,172,000
40.407295
120
0.51369
false
3.972878
false
false
false
MikeTheGreat/GLT
glt/MyClasses/CourseInfo.py
1
21912
"""Contains the CourseInfo object""" import datetime import collections import csv import os import shutil import sys #import git import subprocess import tempfile import gitlab from colorama import Fore, Style, init # Back, init() from glt.MyClasses.Student import Student from glt.MyClasses.StudentCollection import ...
gpl-3.0
-5,202,144,037,664,315,000
41.798828
133
0.522453
false
4.504934
false
false
false
tengqm/senlin
senlin/tests/apiv1/shared.py
1
4578
# Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed unde...
apache-2.0
4,580,353,874,016,427,000
33.946565
75
0.627785
false
3.909479
true
false
false
PyMamba/mamba-storm
storm/schema/schema.py
1
4673
# # Copyright (c) 2006, 2007 Canonical # # Written by Gustavo Niemeyer <gustavo@niemeyer.net> # # This file is part of Storm Object Relational Mapper. # # Storm 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 Found...
lgpl-2.1
-5,923,921,601,448,790,000
35.224806
79
0.661459
false
4.146406
false
false
false
jbinary/django-database-email-backend
database_email_backend/admin.py
1
5693
#-*- coding: utf-8 -*- from functools import update_wrapper from django.core.exceptions import PermissionDenied from django.http import HttpResponseRedirect from django.contrib import admin from django import forms from django.http import HttpResponse from django.core.urlresolvers import reverse from django.core.mail i...
mit
2,261,844,363,294,276,000
33.50303
111
0.607764
false
3.888661
false
false
false
troismph/matasano-challenges
src/dh.py
1
1134
from math_g4z3 import mod_exp from converts import big_int_to_bin_str import random DH_p = 0xffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe64...
gpl-3.0
4,353,548,245,432,018,400
35.612903
393
0.72134
false
2.443966
true
false
false
marcua/qurk_experiments
qurkexp/hitlayer/models.py
1
10554
import sys,os,base64,time,math,hashlib,traceback from datetime import datetime, timedelta from qurkexp.hitlayer import settings from django.db import models from django.db import transaction from boto.mturk import connection, question, price, qualification class HIT(models.Model): hid = models.CharField(max_le...
bsd-3-clause
-3,170,994,810,895,449,600
31.776398
121
0.544722
false
4.198091
false
false
false
WarriorIng64/type-fight
gamelog.py
1
1492
#!/bin/python import datetime, logging, platform, pygame, os from gameglobals import * # Logging setup if platform.system() == 'Windows': # Logging on Windows logdir = os.path.join(os.getenv('APPDATA'), 'typefight') else: # Assume Linux logdir = os.path.join(os.path.expanduser('~'), '.typefight') try:...
gpl-3.0
5,761,751,310,062,124,000
35.390244
76
0.643432
false
3.477855
false
false
false
mgunyho/pyspread
pyspread/src/interfaces/test/test_xls.py
1
18810
#!/usr/bin/env python # -*- coding: utf-8 -*- # Copyright Martin Manns # Distributed under the terms of the GNU General Public License # -------------------------------------------------------------------- # pyspread is free software: you can redistribute it and/or modify # it under the terms of the GNU General Publi...
gpl-3.0
6,034,399,859,841,285,000
33.768946
79
0.570494
false
3.23307
true
false
false
kevinnguyeneng/django-uwsgi-nginx
app/naf_otp/models.py
1
3570
from __future__ import unicode_literals from django.db import models from django.conf import settings # Create your models here. class Department(models.Model): departname = models.CharField(max_length=50 , unique=True) description = models.TextField(max_length=2000) class Meta: db_table = ...
gpl-3.0
-4,462,746,899,875,089,400
29.784483
69
0.632493
false
3.957871
false
false
false
NoBodyCam/TftpPxeBootBareMetal
nova/compute/manager.py
1
137624
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2010 United States Government as represented by the # Administrator of the National Aeronautics and Space Administration. # Copyright 2011 Justin Santa Barbara # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may #...
apache-2.0
-6,114,641,416,123,004,000
44.737454
79
0.559633
false
4.701397
false
false
false
narfman0/challenges
codeeval/51/main.py
1
1542
#!/bin/python """ Code challenge https://www.codeeval.com/open_challenges/51/ Description: Credits: Programming Challenges by Steven S. Skiena and Miguel A. Revilla You will be given the x/y co-ordinates of several locations. You will be laying out 1 cable between two of these locations. In order to minimise the cost...
gpl-3.0
-3,160,996,198,653,904,400
31.808511
79
0.61284
false
3.504545
false
false
false
cversek/python-FLI
src/FLI/camera.py
1
10870
""" FLI.camera.py Object-oriented interface for handling FLI USB cameras author: Craig Wm. Versek, Yankee Environmental Systems author_email: cwv@yesinc.com """ __author__ = 'Craig Wm. Versek' __date__ = '2012-08-08' import sys, time, warnings, traceback try: from collections import OrderedDict e...
mit
7,518,541,212,597,315,000
41.795276
120
0.583349
false
3.430104
false
false
false
ifwe/wxpy
setup.py
1
3061
import os.path import shutil import sys import genlisttypes from wxpybuild.wxpyext import build_extension, WXWIN wxpy_extra_sources = '''\ src/PythonUtils.cpp '''.split() wxpy_modules = [ ('_wxcore', ['src/wx.sip'] + wxpy_extra_sources), # TODO: use wxUSE_XXX flags # ('_wxhtml', ['src/html.sip']...
mit
2,911,742,721,961,002,500
26.330357
144
0.557661
false
3.374862
false
false
false
alirizakeles/zato
code/zato-common/src/zato/common/ipaddress_.py
1
3762
# -*- coding: utf-8 -*- """ Copyright (C) 2016 Dariusz Suchojad <dsuch at zato.io> Licensed under LGPLv3, see LICENSE.txt for terms and conditions. """ from __future__ import absolute_import, division, print_function, unicode_literals # stdlib import itertools from urlparse import urlparse # ipaddress from ipaddre...
gpl-3.0
1,681,635,451,517,710,600
33.2
118
0.67597
false
4.019231
false
false
false
stackforge/cloudkitty
cloudkitty/rating/pyscripts/db/api.py
1
2787
# -*- coding: utf-8 -*- # Copyright 2015 Objectif Libre # # 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 ...
apache-2.0
-7,936,099,379,153,705,000
26.87
78
0.618586
false
4.056769
false
false
false
comp-imaging/ProxImaL
proximal/algorithms/problem.py
1
8584
from . import admm from . import pock_chambolle as pc from . import half_quadratic_splitting as hqs from . import linearized_admm as ladmm from proximal.utils.utils import Impl, graph_visualize from proximal.utils.cuda_codegen import PyCudaAdapter from proximal.lin_ops import Variable, CompGraph, est_CompGraph_norm, vs...
mit
-5,781,427,473,584,358,000
38.018182
112
0.491845
false
3.861448
true
false
false
shub0/algorithm-data-structure
python/detec_cycle.py
1
2155
#! /usr/bin/python ''' Given a linked list, return the node where the cycle begins. If there is no cycle, return null. ''' from node_struct import ListNode class Solution: # @param head, a ListNode # @return a boolean def hasCycle(self, head): """ :type head: ListNode :rtype: bool ...
bsd-3-clause
7,653,884,790,046,726,000
25.280488
95
0.52065
false
4.073724
false
false
false
ammarkhann/FinalSeniorCode
lib/python2.7/site-packages/google/cloud/resource_manager/client.py
1
7106
# Copyright 2015 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, ...
mit
1,801,050,065,644,024,600
37.619565
86
0.609626
false
4.526115
false
false
false
creasyw/IMTAphy
documentation/doctools/converter/converter/util.py
2
3086
# -*- coding: utf-8 -*- """ Python documentation conversion utils ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ :copyright: 2007-2008 by Georg Brandl. :license: BSD. """ import re from docutils.nodes import make_id from .docnodes import TextNode, EmptyNode, NodeList def umlaut(cmd, c): try: if...
gpl-2.0
-978,897,654,169,440,100
29.74
79
0.501952
false
3.172343
false
false
false
lmazuel/azure-sdk-for-python
azure-servicefabric/azure/servicefabric/models/deployed_service_replica_info.py
1
5136
# coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for # license information. # # Code generated by Microsoft (R) AutoRest Code Generator. # Changes ...
mit
-2,375,160,367,032,204,300
47.914286
230
0.670171
false
4.141935
false
false
false
tectronics/open-ihm
src/openihm/data/report_settingsmanager.py
1
13974
#!/usr/bin/env python """ This file is part of open-ihm. open-ihm is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. open-ihm is di...
lgpl-3.0
-1,760,976,360,096,739,800
38.155172
238
0.59074
false
4.369606
false
false
false
berkeleydeeprlcourse/homework
hw4/half_cheetah_env.py
1
2813
import numpy as np import tensorflow as tf from gym import utils from gym.envs.mujoco import mujoco_env class HalfCheetahEnv(mujoco_env.MujocoEnv, utils.EzPickle): def __init__(self): mujoco_env.MujocoEnv.__init__(self, 'half_cheetah.xml', 1) utils.EzPickle.__init__(self) def step(self, action...
mit
2,841,686,418,988,500,500
34.1625
96
0.576609
false
3.336892
false
false
false
jerryyip/Smart_Decorative_Cloud
main.py
1
1660
#!/usr/bin/env python import os import signal import time from respeaker.bing_speech_api import BingSpeechAPI from respeaker.microphone import Microphone from respeaker.player import Player from worker_weather import Worker BING_KEY = '3560976f779d4095a7109bc55a3b0c79' mic = Microphone() bing = BingSpeechAPI(key=BI...
mit
599,514,478,928,847,100
21.739726
107
0.656627
false
3.248532
false
false
false
shirtsgroup/pygo
analysis/MBAR_foldingcurve_umbrella.py
1
6397
#!/usr/bin/python2.4 import sys import numpy import pymbar # for MBAR analysis import timeseries # for timeseries analysis import os import os.path import pdb # for debugging from optparse import OptionParser import MBAR_pmfQz import wham import MBAR_pmfQ import cPickle def parse_args(): parser=OptionParser() ...
gpl-2.0
-2,847,963,973,413,007,400
39.487342
146
0.620134
false
2.708298
false
false
false
llun/wordpress-authenticator
relay-bot/xrepeat.py
1
2396
import os,sys,xmpp currentUser = None xmppClient = None nicks = {} ###### Bot Command def commandNick(): pass def commandHelp(client, user): message = """ !help - See this menu. !nick <new name> - Change nick name. """ client.send(xmpp.Message(user, message)) ###### Bot Logic def parseCommand(client, ...
mit
-5,747,891,795,850,577,000
24.763441
94
0.639816
false
3.597598
false
false
false
baz1/PyDist
src/PyDist.py
1
7286
#!/usr/bin/env python import modes import GoogleMaps import RATP import time import re import sys lastError = "" unrecognizedAddresses = [] def getDist(mode, origins, destinations, timestamp = None, isArrivalTime = True, googleApiKey = None, useSuggestions = True, optimistic = 0, avoidTolls = False, useRATP ...
mit
-3,398,347,110,724,836,000
38.814208
153
0.562998
false
3.601582
false
false
false
tsarnowski/hamster
src/hamster/external.py
1
16420
# - coding: utf-8 - # Copyright (C) 2007 Patryk Zawadzki <patrys at pld-linux.org> # Copyright (C) 2008, 2010 Toms Bauģis <toms.baugis at gmail.com> # This file is part of Project Hamster. # Project Hamster is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License...
gpl-3.0
3,837,535,150,805,021,000
39.641089
122
0.567757
false
3.926112
false
false
false
jcatw/deep_q_rl
deep_q_rl/launcher.py
1
14655
#! /usr/bin/env python """This script handles reading command line arguments and starting the training process. It shouldn't be executed directly; it is used by run_nips.py or run_nature.py. """ import os import argparse import logging import ale_python_interface import cPickle import numpy as np import theano impor...
bsd-3-clause
-6,642,622,267,706,696,000
49.885417
85
0.502354
false
5.034352
true
false
false
babble/babble
include/jython/Lib/test/Graph.py
1
1996
from java import awt from math import * from jarray import array class Graph(awt.Canvas): def __init__(self): self.function = None def paint(self, g): if self.function is None: return self.error(g) sz = se...
apache-2.0
-1,696,115,713,915,146,200
31.193548
85
0.429359
false
4.329718
false
false
false
rcoup/traveldash
traveldash/gtfs/migrations/0007_auto__del_field_trip_inbound__del_field_trip_outbound__add_field_trip_.py
1
15202
# 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): # Deleting field 'Trip.inbound' db.delete_column('gtfs_trip', 'inbound') # Deleting field 'Trip.outbound...
bsd-3-clause
8,003,651,594,328,572,000
64.809524
160
0.533351
false
3.590458
false
false
false
plotly/python-api
packages/python/plotly/plotly/graph_objs/scatter/marker/_colorbar.py
1
69628
from plotly.basedatatypes import BaseTraceHierarchyType as _BaseTraceHierarchyType import copy as _copy class ColorBar(_BaseTraceHierarchyType): # class properties # -------------------- _parent_path_str = "scatter.marker" _path_str = "scatter.marker.colorbar" _valid_props = { "bgcolor", ...
mit
-2,804,840,425,651,556,400
34.853759
100
0.553858
false
4.192185
false
false
false
dominicmeroux/Reading-In-and-Analyzing-Calendar-Data-by-Interfacing-Between-MySQL-and-Python
Utilization-Report-MySQL.py
1
18653
from __future__ import print_function from icalendar import * from datetime import date, datetime, timedelta import mysql.connector from mysql.connector import errorcode import pickle import csv import pandas from pandas.io import sql import matplotlib.pyplot as plt import xlsxwriter import numpy as np import os import...
mit
-4,022,646,773,599,156,700
33.225688
553
0.630515
false
3.204432
false
false
false
aburrell/ocbpy
ocbpy/ocb_time.py
1
10827
#!/usr/bin/env python # -*- coding: utf-8 -*- # Copyright (C) 2017, AGB & GC # Full license can be found in License.md # ---------------------------------------------------------------------------- """Routines to convert from different file timekeeping methods to datetime """ import datetime as dt import numpy as np ...
bsd-3-clause
-4,191,842,256,253,791,700
25.089157
79
0.555925
false
3.832566
false
false
false
mjirik/io3d
io3d/outputqt.py
1
3384
from loguru import logger from PyQt5.QtWidgets import ( QGridLayout, QLabel, QPushButton, QLineEdit, QCheckBox, QFileDialog, ) from PyQt5 import QtGui, QtWidgets import os.path as op class SelectOutputPathWidget(QtWidgets.QWidget): def __init__( self, path=None, wid...
mit
-2,384,813,461,928,270,000
29.763636
87
0.584515
false
3.76
false
false
false
gviejo/ThalamusPhysio
python/main_pop_pca.py
1
15802
import numpy as np import pandas as pd # from matplotlib.pyplot import plot,show,draw import scipy.io from functions import * import _pickle as cPickle import time import os, sys import ipyparallel import neuroseries as nts data_directory = '/mnt/DataGuillaume/MergedData/' datasets = np.loadtxt(data_directory+'datas...
gpl-3.0
-4,166,674,322,942,041,600
47.621538
185
0.55069
false
3.191034
false
false
false
cxx-hep/root-cern
interpreter/llvm/src/tools/clang/docs/tools/dump_ast_matchers.py
1
12937
#!/usr/bin/env python # A tool to parse ASTMatchers.h and update the documentation in # ../LibASTMatchersReference.html automatically. Run from the # directory in which this file is located to update the docs. import collections import re import urllib2 MATCHERS_FILE = '../../include/clang/ASTMatchers/ASTMatchers.h' ...
lgpl-2.1
3,276,283,028,801,604,000
36.607558
129
0.556466
false
3.440691
false
false
false
evinr/basis-scraper
poc.py
1
3931
import serial def setup(): ser = serial.Serial('/dev/ttyUSB0', timeout=2) ser.setRTS(True) ser.setRTS(False) if ser.isOpen(): ser.close() ser.open() ser.isOpen() print "USB connection established" def read(): rawString = ser.readline() print rawString return (str(rawString)) def write(string...
mit
2,017,220,507,763,002,000
26.117241
135
0.675401
false
2.811874
false
false
false
palerdot/calibre
src/calibre/gui2/custom_column_widgets.py
1
38720
#!/usr/bin/env python # vim:fileencoding=UTF-8:ts=4:sw=4:sta:et:sts=4:ai __license__ = 'GPL v3' __copyright__ = '2010, Kovid Goyal <kovid@kovidgoyal.net>' __docformat__ = 'restructuredtext en' from functools import partial from PyQt4.Qt import (QComboBox, QLabel, QSpinBox, QDoubleSpinBox, QDateTimeEdit, QD...
gpl-3.0
-1,996,979,856,631,141,400
34.752539
100
0.5703
false
3.715218
false
false
false
RPGOne/Skynet
scikit-learn-c604ac39ad0e5b066d964df3e8f31ba7ebda1e0e/sklearn/utils/__init__.py
2
12026
""" The :mod:`sklearn.utils` module includes various utilities. """ from collections import Sequence import numpy as np from scipy.sparse import issparse import warnings from .murmurhash import murmurhash3_32 from .validation import (as_float_array, assert_all_finite, warn_if_not_float, ...
bsd-3-clause
-1,182,036,154,968,007,700
27.43026
79
0.567936
false
3.868125
false
false
false
jkandasa/integration_tests
cfme/tests/cli/test_evmserverd.py
1
1948
# -*- coding: utf-8 -*- """This module contains tests that exercise control of evmserverd service.""" import pytest from cfme.utils import version from cfme.utils.wait import wait_for_decorator @pytest.yield_fixture(scope="module") def start_evmserverd_after_module(appliance): appliance.start_evm_service() ap...
gpl-2.0
-4,283,951,062,109,623,300
36.461538
98
0.684292
false
3.849802
true
false
false
ovnicraft/geospatial
base_geoengine/geo_model.py
1
9109
# -*- coding: utf-8 -*- ############################################################################## # # Author: Nicolas Bessi # Copyright 2011-2012 Camptocamp SA # # This program 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
3,238,894,645,198,967,000
44.673367
79
0.530861
false
4.11826
false
false
false
quanvm009/codev7
openerp/addons_quan/lifestyle/model/purchase.py
1
4374
# -*- coding: utf-8 -*- # ##################################################################### # # OpenERP, Open Source Management Solution # Copyright (C) 2011 OpenERP s.a. (<http://openerp.com>). # Copyright (C) 2013 INIT Tech Co., Ltd (http://init.vn). # This program is free software: you can redistribute it and/or...
agpl-3.0
5,902,361,159,857,862,000
46.543478
114
0.587334
false
3.585246
false
false
false
tttor/csipb-jamu-prj
predictor/connectivity/classifier/selfblm/generateNegativeData.py
1
3174
import csv import sys import json import time import numpy as np sys.path.append('../../utility') import yamanishi_data_util as yam sys.path.append('../cluster/kmedoid') import kmedoid as kmed def main(): if len(sys.argv)!=6: print ("python blmniisvm_experiment.py [e|ic|gpcr|nr] [clustMethod] " ...
mit
2,923,356,411,213,481,500
26.362069
90
0.546629
false
3.461287
false
false
false
brigittebigi/proceed
proceed/src/TagPDF/name.py
1
3002
#! /usr/bin/env python # -*- coding: UTF-8 -*- # --------------------------------------------------------------------------- # ___ __ ___ ___ ____ ____ __ # | \ | \ | | / | | | \ Automatic # |__/ |__/ | | | |__ |__ | | Conference # | ...
gpl-3.0
-5,171,279,699,594,909,000
30.93617
77
0.425716
false
4.27027
false
false
false
atom/crashpad
util/mach/mig.py
1
4962
#!/usr/bin/env python # coding: utf-8 # Copyright 2014 The Crashpad 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/LICEN...
apache-2.0
-1,422,665,711,272,995,300
32.855172
80
0.689754
false
3.776154
false
false
false
Ruide/angr-dev
angr-management/angrmanagement/ui/widgets/qdisasm_statusbar.py
1
1757
from PySide.QtGui import QFrame, QHBoxLayout, QLabel, QPushButton from ..menus.disasm_options_menu import DisasmOptionsMenu class QDisasmStatusBar(QFrame): def __init__(self, disasm_view, parent=None): super(QDisasmStatusBar, self).__init__(parent) self.disasm_view = disasm_view # widg...
bsd-2-clause
591,387,070,138,443,900
23.068493
79
0.613546
false
3.930649
false
false
false