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
feureau/Small-Scripts
Blender/Blender config/2.91/scripts/addons/bricksculpt_v1-2-0/classes/bricksculpt_choose_paintbrush_material.py
1
2230
# Copyright (C) 2019 Christopher Gearhart # chris@bblanimation.com # http://bblanimation.com/ # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your opt...
gpl-3.0
-3,855,508,242,255,955,000
29.135135
72
0.645291
false
4.121996
false
false
false
ComputerArchitectureGroupPWr/Floorplan-Maker
src/FloorplanMakerUI_old.py
1
15396
# -*- coding: utf-8 -*- # Form implementation generated from reading ui file 'main_window.ui' # # Created: Tue Aug 5 12:46:39 2014 # by: PyQt4 UI code generator 4.10.4 # # WARNING! All changes made in this file will be lost! from PyQt4 import QtCore, QtGui from floorplanFrameBeh import FloorplanFrame from heate...
mit
7,286,286,362,284,666,000
66.227074
275
0.725235
false
3.810644
false
false
false
Fiware/dataModels
tools/ldcontext_generator.py
1
9962
#!/usr/bin/python # -*- coding: utf-8 -*- """ This script provides two files: - context.jsonld, that serves https://schema.lab.fiware.org/ld/fiware-data-models-context.jsonld - mapping_list.yml, that serves https://uri.fiware.org/ns/data-models context.jsonld is combined by extracting the properties, types and enu...
mit
1,676,945,092,126,814,700
28.383481
103
0.598434
false
3.903213
false
false
false
google/cauliflowervest
cauliflowervest/client/mac/main.py
1
3039
# Copyright 2017 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 a...
apache-2.0
-5,189,660,262,082,169,000
28.504854
77
0.715038
false
3.784558
false
false
false
solvo/derb
report_builder/migrations/0001_initial.py
1
11231
# -*- coding: utf-8 -*- # Generated by Django 1.10 on 2016-09-12 19:47 from __future__ import unicode_literals from django.conf import settings import django.contrib.postgres.fields.jsonb from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): initial = T...
gpl-3.0
-3,516,968,302,829,790,000
51.24186
310
0.562639
false
4.390539
false
false
false
wevote/WebAppPublic
voter/models.py
1
55344
# voter/models.py # Brought to you by We Vote. Be good. # -*- coding: UTF-8 -*- from django.db import models from django.contrib.auth.models import (BaseUserManager, AbstractBaseUser) # PermissionsMixin from django.core.validators import RegexValidator from exception.models import handle_exception, handle_record_foun...
bsd-3-clause
-5,296,734,359,636,039,000
42.612293
120
0.59179
false
3.859953
false
false
false
matslindh/kimochi
alembic/versions/8f5b2066cbac_add_self_referential_image_reference.py
1
2160
"""Add self-referential image reference Revision ID: 8f5b2066cbac Revises: 698cc06661d6 Create Date: 2016-03-20 19:35:31.321144 """ # revision identifiers, used by Alembic. revision = '8f5b2066cbac' down_revision = '698cc06661d6' branch_labels = None depends_on = None from alembic import op import sqlalchemy as sa ...
mit
7,596,053,783,737,711,000
40.538462
129
0.678241
false
3.167155
false
false
false
akalipetis/raven-python
raven/_compat.py
1
5038
"""Utilities for writing code that runs on Python 2 and 3""" # flake8: noqa # Copyright (c) 2010-2013 Benjamin Peterson # # 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,...
bsd-3-clause
-442,859,743,706,172,900
26.380435
82
0.618499
false
3.79082
false
false
false
moto-timo/robotframework
utest/output/test_filelogger.py
1
1867
import unittest import time from robot.output.filelogger import FileLogger from robot.utils import StringIO, robottime from robot.utils.asserts import * from robot.utils.robottime import TimestampCache class _FakeTimeCache(TimestampCache): def __init__(self): self.fake = time.mktime((2006, 6, 13, 8, 37,...
apache-2.0
1,760,009,257,251,679,000
31.189655
80
0.636315
false
3.516008
true
false
false
loleg/realms-wiki
realms/lib/util.py
1
3701
import click import re import os import hashlib import json import string import random import sys from jinja2 import Template class AttrDict(dict): def __init__(self, *args, **kwargs): super(AttrDict, self).__init__(*args, **kwargs) self.__dict__ = self def random_string(size=6, chars=string.as...
gpl-2.0
-2,907,286,904,536,917,000
17.979487
97
0.597406
false
3.160547
false
false
false
zekroTJA/regiusBot
commands/cmd_mute.py
1
2707
import discord from os import path, makedirs, remove import STATICS ROLE_NAME = "Supporter" perm = 2 description = "Mute members on guild in chat" def get_mutes(server): if not path.isdir("SAVES/" + server.id): makedirs("SAVES/" + server.id) if path.isfile("SAVES/" + server.id + "/mutes"): ...
mit
6,176,478,198,408,302,000
39.402985
195
0.655707
false
3.253606
false
false
false
totalgood/nlpia
src/nlpia/scripts/lsa_tweets.py
1
3415
import os import gc import json import numpy as np import gzip from gensim.models import TfidfModel, LsiModel from gensim.corpora import Dictionary from nlpia.data.loaders import BIGDATA_PATH, read_csv KEEP_N = 300000 # max vocab size NO_BELOW = 5 # min DF (count) NO_ABOVE = .7 # max DF (fraction) def l...
mit
-2,815,172,349,528,805,000
42.782051
118
0.656223
false
3.133028
false
false
false
ResolveWang/algrithm_qa
binarytree/q1.py
1
3054
""" 问题描述:分别用递归和非递归方式实现二叉树的先序、中序、和后续遍历 思路:使用非递归的方式需要使用辅助栈代替函数栈 """ from binarytree.toolcls import Node class RecursiveVisit: @classmethod def visit_in_first_order(cls, head): if head is None: return print(head.value, end=' ') cls.visit_in_first_order(head.left) cl...
mit
-6,681,515,285,919,521,000
24.153846
48
0.532631
false
3.309336
false
false
false
Gjacquenot/AcousticBEM
Python/HelmholtzIntegralsRAD.py
1
15968
# --------------------------------------------------------------------------- # Copyright (C) 2017 Frank Jargstorff # # This file is part of the AcousticBEM library. # AcousticBEM 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 So...
gpl-3.0
-5,642,675,042,839,800,000
38.92
110
0.48353
false
3.118141
false
false
false
bastibe/PySoundCard
pysoundcard.py
1
26373
import sys import os from cffi import FFI import atexit import numpy as np import warnings """PySoundCard is an audio library based on PortAudio, CFFI and NumPy PySoundCard can play and record audio data. Audio devices are supported through PortAudio[1], which is a free, cross-platform, open-source audio I/O library ...
bsd-3-clause
-7,574,350,281,367,325,000
33.701316
79
0.657339
false
4.132404
false
false
false
plaufer/wikiwsd
wsd/database/mysqlbuildview.py
1
7099
import MySQLdb import logging import time MYSQL_DEAD_LOCK_ERROR = 1213 class MySQLBuildView: """The MySQLBuildView class allows database access optimized to build the disambiguation database """ def __init__(self, db_connection): """constructor @param db_connector the database ...
mit
-3,987,502,628,156,108,000
42.286585
197
0.579377
false
4.195626
false
false
false
bancek/egradebook
src/lib/compressor/filters/yui.py
1
1339
from subprocess import Popen, PIPE from compressor.conf import settings from compressor.filters import FilterBase, FilterError from compressor.utils import cmd_split class YUICompressorFilter(FilterBase): def output(self, **kwargs): arguments = '' if self.type == 'js': arguments = se...
gpl-3.0
2,404,042,129,496,164,400
26.895833
81
0.592233
false
3.803977
false
false
false
whereskenneth/Dwarfsquad
dwarfsquad/lib/build/from_export/build_compound_methods.py
1
6738
from dwarfsquad.lib.build.from_export.helpers import build_reference_map from dwarfsquad.lib.utils import to_stderr from dwarfsquad.model.Calibration import Calibration from dwarfsquad.model.ChromatogramMethod import ChromatogramMethod from dwarfsquad.model.CompoundMethod import CompoundMethod from dwarfsquad.model.Pea...
mit
-6,402,530,371,406,678,000
37.502857
103
0.706886
false
3.601283
false
false
false
paypal/support
support/socket_pool.py
1
6787
''' Protocol-agnostic socket pooler. This code is both extremely tested and hard to test. Modify with caution :-) "There are two ways of constructing a software design: One way is to make it so simple that there are obviously no deficiencies, and the other way is to make it so complicated that there are no obvious de...
bsd-3-clause
3,623,353,880,487,837,700
41.685535
102
0.573155
false
3.92539
false
false
false
JulyKikuAkita/PythonPrac
cs15211/RangeModule.py
1
7564
__source__ = 'https://leetcode.com/problems/range-module/' # Time: O(logK) to O(K) # Space: O(A+R), the space used by ranges. # # Description: Leetcode # 715. Range Module # # A Range Module is a module that tracks ranges of numbers. # Your task is to design and implement the following interfaces in an efficient manne...
apache-2.0
7,008,019,913,116,863,000
32.321586
105
0.569672
false
3.471317
true
false
false
jthrun/sdl_android
baseAndroid/make_symbolic_links.py
1
2232
import os import pathlib from pathlib import Path import re def has_admin(): if os.name == 'nt': try: # only windows users with admin privileges can read the C:\windows\temp temp = os.listdir(os.sep.join([os.environ.get('SystemRoot', 'C:\\windows'), 'temp'])) except: ...
bsd-3-clause
-4,495,510,196,234,252,000
31.347826
112
0.584229
false
3.701493
false
false
false
CIGIHub/django-ga-puller
setup.py
1
1369
from setuptools import setup # Always prefer setuptools over distutils import os README = open(os.path.join(os.path.dirname(__file__), 'README.md')).read() # allow setup.py to be run from any path os.chdir(os.path.normpath(os.path.join(os.path.abspath(__file__), os.pardir))) setup( name='django-ga-puller', ...
mit
-3,372,976,600,499,143,700
34.102564
97
0.626004
false
3.650667
false
true
false
ftalex/buffelgrass_mapper
BuffelWeb/Model.py
1
1562
""" Classes for use with genshi, these are the basic datastructres that are used to create populate the values of the templaes. """ __author__ = "Alex Warren" __copyright__ = "Copyright 2015, Autonomous Mapping Project" __credits__ = ["Alex Warren", "Rachel Powers", "Thomas Schuker", "Travis Kible...
bsd-2-clause
-7,928,987,849,017,785,000
28.471698
93
0.669014
false
2.784314
false
false
false
hguemar/cinder
cinder/volume/drivers/windows/smbfs.py
1
10774
# Copyright (c) 2014 Cloudbase Solutions SRL # 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 # # Unle...
apache-2.0
1,899,625,683,295,123,000
39.201493
79
0.591981
false
3.906454
false
false
false
hellobond/python-smartypants
lib/smartypants.py
1
34216
#!/usr/bin/env python # -*- coding: utf-8 -*- r""" ============== smartypants.py ============== ---------------------------- SmartyPants ported to Python ---------------------------- Ported by `Chad Miller`_ Copyright (c) 2004, 2007 Chad Miller original `SmartyPants`_ by `John Gruber`_ Copyright (c) 2003 John Grube...
bsd-3-clause
1,224,853,548,445,480,000
34.093333
209
0.594868
false
3.684687
false
false
false
hueyyeng/AssetsBrowser
ui/window/ui_main.py
1
12124
# -*- coding: utf-8 -*- # Form implementation generated from reading ui file 'K:\Library\Python\AssetsBrowser\ui\window\main.ui' # # Created by: PyQt5 UI code generator 5.14.1 # # WARNING! All changes made in this file will be lost! from PyQt5 import QtCore, QtGui, QtWidgets class Ui_MainWindow(object): def se...
mit
-3,948,126,092,516,333,000
58.136585
398
0.73043
false
4.23733
false
false
false
vhaupert/mitmproxy
mitmproxy/stateobject.py
1
3417
import json import typing from mitmproxy.coretypes import serializable from mitmproxy.utils import typecheck class StateObject(serializable.Serializable): """ An object with serializable state. State attributes can either be serializable types(str, tuple, bool, ...) or StateObject instances themselv...
mit
1,843,769,143,436,569,600
33.515152
86
0.60755
false
4.067857
false
false
false
rechner/Taxidi
webcam.py
1
18402
#!/usr/bin/env python #-*- coding:utf-8 -*- #TODO: Update for use with new API #TODO: Read config, optionally disable rectangle. #TODO: Create Destroy() method #TODO: Implement file system organization, handle converting & uploading image to server. #TODO: Use gstreamer for Linux instead of opencv - better performanc...
gpl-3.0
3,329,031,220,949,620,700
32.641682
112
0.586349
false
3.785641
true
false
false
ODM2/ODMToolsPython
odmtools/gui/pnlPlot.py
1
7003
#Boa:FramePanel:Panel1 import wx from wx.lib.pubsub import pub as Publisher try: from agw import flatnotebook as fnb except ImportError: # if it's not there locally, try the wxPython lib. import wx.lib.agw.flatnotebook as fnb import matplotlib matplotlib.use('WXAgg') import plotTimeSeries import plotSummar...
bsd-3-clause
-7,721,344,204,155,205,000
33.328431
116
0.622305
false
3.653104
false
false
false
hyperkitty/kittystore
kittystore/__init__.py
1
3228
# -*- coding: utf-8 -*- """ Module entry point: call get_store() to instanciate a KittyStore implementation. Copyright (C) 2012 Aurelien Bompard Author: Aurelien Bompard <abompard@fedoraproject.org> This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public Lice...
gpl-3.0
1,805,717,560,906,570,800
32.278351
89
0.682156
false
3.714614
false
false
false
fgaudin/aemanager
accounts/models.py
1
20254
# coding=utf-8 from decimal import Decimal from django.utils.formats import localize import datetime from reportlab.platypus import Paragraph, Spacer from reportlab.lib.units import inch from reportlab.platypus import Table, TableStyle from django.db import models, connection from core.models import OwnedObject from dj...
agpl-3.0
442,697,370,310,873,200
56.214689
356
0.604325
false
3.904009
false
false
false
asimshankar/tensorflow
tensorflow/python/kernel_tests/cond_v2_test.py
1
35442
# Copyright 2018 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
apache-2.0
3,045,569,778,192,330,000
31.249318
80
0.587834
false
3.386071
true
false
false
levilucio/SyVOLT
ECore_Copier_MM/transformation-Large/HeattributeOUTeGenericTypeSolveRefEAttributeEGenericTypeEAttributeEGenericType.py
1
5089
from core.himesis import Himesis class HeattributeOUTeGenericTypeSolveRefEAttributeEGenericTypeEAttributeEGenericType(Himesis): def __init__(self): """ Creates the himesis graph representing the AToM3 model HeattributeOUTeGenericTypeSolveRefEAttributeEGenericTypeEAttributeEGenericType. ""...
mit
4,146,659,116,746,106,400
48.407767
298
0.523875
false
2.998821
false
false
false
mattmakesmaps/opencv-junk
opencv-utils/bin/delete_dupes.py
1
1635
import argparse import os import sys def get_abs_path(in_path): """ Given a relative or absolute path, return the absolute path. :param in_path: :return: """ if os.path.isabs(in_path): return in_path else: return os.path.abspath(in_path) if __name__ == '__main__': # Def...
mit
-7,510,965,942,031,719,000
37.023256
120
0.625076
false
3.802326
false
false
false
motmot/flymovieformat
bootstrap.py
1
2578
############################################################################## # # Copyright (c) 2006 Zope Corporation and Contributors. # All Rights Reserved. # # This software is subject to the provisions of the Zope Public License, # Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution. # THIS SO...
bsd-3-clause
-4,471,996,207,131,079,000
25.040404
86
0.559348
false
4.047096
false
false
false
ruchee/vimrc
vimfiles/bundle/vim-python/submodules/pylint/pylint/checkers/refactoring/len_checker.py
1
4298
# Licensed under the GPL: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html # For details: https://github.com/PyCQA/pylint/blob/master/LICENSE from typing import List import astroid from pylint import checkers, interfaces from pylint.checkers import utils class LenChecker(checkers.BaseChecker): """Checks f...
mit
-7,659,394,172,842,702,000
34.520661
98
0.597953
false
4.081671
false
false
false
fanchunke1991/flask_website
migrations/versions/d8d1b418f41c_.py
1
1046
"""empty message Revision ID: d8d1b418f41c Revises: 7f5c9e993be1 Create Date: 2017-02-15 21:03:05.958000 """ from alembic import op import sqlalchemy as sa # revision identifiers, used by Alembic. revision = 'd8d1b418f41c' down_revision = '7f5c9e993be1' branch_labels = None depends_on = None def upgrade(): # ...
mit
-7,483,645,544,517,779,000
27.27027
65
0.670172
false
3.26875
false
false
false
taedori81/gentlecoffee
home/templatetags/gentlecoffee_tags.py
1
2563
from django import template from ..models import Area register = template.Library() @register.assignment_tag(takes_context=True) def get_site_root(context): return context['request'].site.root_page @register.inclusion_tag("home/navbar/navbar.html", takes_context=True) def display_navbar(context): parent = ...
bsd-3-clause
5,064,137,035,026,292,000
26.265957
96
0.630121
false
3.604782
false
false
false
garethr/django-project-templates
setup.py
1
1174
from setuptools import setup, find_packages import os setup( name='django-project-templates', version = "0.11", description="Paster templates for creating Django projects", author='Gareth Rushgrove', author_email='gareth@morethanseven.net', url='http://github.com/garethr/django-project-template...
mit
-1,137,145,708,265,585,200
32.542857
105
0.66184
false
4.020548
false
false
false
migasfree/migasfree-backend
migasfree/client/models/fault.py
1
4720
# -*- coding: utf-8 -*- # Copyright (c) 2015-2021 Jose Antonio Chavarría <jachavar@gmail.com> # Copyright (c) 2015-2021 Alberto Gacías <alberto@migasfree.org> # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Softw...
gpl-3.0
4,239,233,166,619,057,000
27.421687
80
0.597075
false
4.095486
false
false
false
skurtapp/django-rest-framework-jwt
setup.py
1
3378
#!/usr/bin/env python # -*- coding: utf-8 -*- import os import re import shutil import sys from setuptools import setup def get_version(package): """ Return package version as listed in `__version__` in `init.py`. """ with open(os.path.join(package, '__init__.py'), 'rb') as init_py: src = in...
mit
6,180,108,985,916,996,000
29.160714
77
0.617229
false
3.679739
false
false
false
ResolveWang/WeiboSpider
db/dao.py
1
7194
from sqlalchemy import text from sqlalchemy.exc import IntegrityError as SqlalchemyIntegrityError from pymysql.err import IntegrityError as PymysqlIntegrityError from sqlalchemy.exc import InvalidRequestError from .basic import db_session from .models import ( LoginInfo, KeywordsWbdata, KeyWords, SeedIds, UserRela...
mit
6,026,674,423,055,466,000
29.210084
108
0.624478
false
3.4173
false
false
false
korrosivesec/crits
crits/emails/handlers.py
1
65619
from __future__ import absolute_import import datetime import email as eml from email.parser import Parser from email.utils import parseaddr, getaddresses, mktime_tz, parsedate_tz import hashlib import json import magic import re import yaml import io import sys import olefile from dateutil.parser import parse as dat...
mit
7,987,814,643,264,909,000
37.396138
123
0.529283
false
4.244437
false
false
false
tomsilver/nupic
nupic/regions/AnomalyRegion.py
1
2946
# ---------------------------------------------------------------------- # 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...
gpl-3.0
5,956,932,422,393,378,000
30.677419
76
0.569246
false
4.743961
false
false
false
rrice2004/LanSkorpian
LanSkorpian.py
1
3034
## LANSKORPIAN - Personal home network scanner ## Copyright (C) Robert Rice <mindseyes@gmail.com> ## This program is published under a MIT license print "\n" print ("-" * 60) print " LANSKORPIAN Personal Home Port Scanner" print ("-" * 60) print "\n" # Import modules import subprocess import ipad...
mit
7,584,437,968,339,130,000
24.155172
143
0.644693
false
3.424379
false
false
false
shitolepriya/Saloon_erp
erpnext/buying/doctype/supplier/supplier.py
1
4173
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals import frappe import frappe.defaults from frappe import msgprint, _ from frappe.model.naming import make_autoname from erpnext.utilities.address_and_con...
agpl-3.0
-6,728,424,563,410,634,000
35.929204
194
0.705967
false
3.207533
false
false
false
SigPloiter/SigPloit
gtp/attacks/dos/massive_dos.py
1
5715
#!/usr/bin/env python # encoding: utf-8 # massive_dos.py # # Copyright 2018 Rosalia d'Alessandro # # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # #...
mit
-1,503,131,306,233,485,600
37.355705
124
0.607349
false
3.895706
true
false
false
bkbilly/AlarmPI
alarmcode/logs.py
1
8304
#!/usr/bin/env python import re import threading import time from datetime import datetime import pytz import logging logging = logging.getLogger('alarmpi') class Logs(): def __init__(self, wd, logfile, timezone): self.wd = wd self.logfile = logfile try: self.mytimezone = py...
mit
9,113,431,894,522,070,000
36.071429
107
0.486031
false
4.464516
false
false
false
weichweich/Pi-Timeswitch
Flask-Server/timeswitch/switch/schema.py
1
2441
import logging import time from flask import request from flask_restful import Resource from marshmallow import ValidationError, post_load, validates_schema from marshmallow_jsonapi import Schema, fields from timeswitch.switch.model import (Pin, Sequence, is_absolute_time, is_rela...
mit
4,909,760,856,457,402,000
25.824176
82
0.60508
false
3.880763
false
false
false
cmcqueen/cobs-python
python3/cobs/cobs/_cobs_py.py
1
2890
""" Consistent Overhead Byte Stuffing (COBS) This version is for Python 3.x. """ class DecodeError(Exception): pass def _get_buffer_view(in_bytes): mv = memoryview(in_bytes) if mv.ndim > 1 or mv.itemsize > 1: raise BufferError('object must be a single-dimension buffer of bytes.') try: ...
mit
147,667,922,598,717,340
31.111111
86
0.577855
false
3.832891
false
false
false
tengqm/senlin
senlin/tests/engine/test_policy_types.py
1
2469
# 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,855,372,240,069,778,000
36.409091
75
0.592143
false
4.256897
true
false
false
gregdetre/abracadjabra
abracadjabra/views.py
1
3115
from django.contrib.admin.views.decorators import staff_member_required from django.contrib.auth.models import User from django.db.models import Sum, Count from django.http import Http404 from django.shortcuts import get_object_or_404, render_to_response from django.template import RequestContext from exceptions impor...
mit
-9,047,564,593,219,679,000
44.808824
99
0.614446
false
4.215156
false
false
false
jgravois/ArcREST
src/arcrest/agol/layer.py
1
54466
""" .. module:: layer :platform: Windows, Linux :synopsis: Class that contians feature service layer information. .. moduleauthor:: Esri """ from .._abstract import abstract from ..security import security import types from ..common import filters from ..common.geometry import SpatialReference from ..common.g...
apache-2.0
-7,880,301,906,038,631,000
42.296502
105
0.482191
false
5.572539
false
false
false
alphacsc/alphacsc
alphacsc/other/swm.py
1
5148
""" Code adopted from Voytek Lab package neurodsp: https://github.com/voytekresearch/neurodsp/blob/master/neurodsp/shape/swm.py The sliding window matching algorithm identifies the waveform shape of neural oscillations using correlations. """ # Authors: Scott Cole # Mainak Jas <mainak.jas@telecom-paristech.f...
bsd-3-clause
-5,241,638,121,785,414,000
32.428571
79
0.621018
false
3.73314
false
false
false
Peter-Liang/CodeWars-Python
solutions/Conway_s_Game_of_Life_Unlimited_Edition.py
1
1775
""" Conway's Game of Life - Unlimited Edition http://www.codewars.com/kata/52423db9add6f6fc39000354/train/python """ from copy import deepcopy def get_generation(cells, generations): origin = deepcopy(cells) if generations == 0: return origin if generations > 1: origin = get_generation(or...
mit
7,685,390,107,174,797,000
25.117647
66
0.514366
false
3.400383
false
false
false
Mercy-Nekesa/sokoapp
sokoapp/tracking/utils.py
1
5688
import re headers = ('HTTP_CLIENT_IP', 'HTTP_X_FORWARDED_FOR', 'HTTP_X_FORWARDED', 'HTTP_X_CLUSTERED_CLIENT_IP', 'HTTP_FORWARDED_FOR', 'HTTP_FORWARDED', 'REMOTE_ADDR') # Back ported from Django trunk # This code was mostly based on ipaddr-py # Copyright 2007 Google Inc. http://code.google.com/p/ipaddr-py/ # L...
mit
-1,081,139,503,090,599,600
27.582915
94
0.56962
false
3.40395
false
false
false
pymor/dune-hdd
examples/linearparabolic/morepas3__prepare.py
1
23451
#!/usr/bin/env python2 # # This file is part of the dune-hdd project: # https://github.com/pymor/dune-hdd # Copyright Holders: Felix Schindler # License: BSD 2-Clause License (http://opensource.org/licenses/BSD-2-Clause) from __future__ import division, print_function import numpy as np from functools import parti...
bsd-2-clause
-5,464,840,250,336,528,000
54.835714
133
0.612255
false
2.81322
false
false
false
wateraccounting/wa
Collect/MOD9/DataAccess.py
1
12824
# -*- coding: utf-8 -*- """ Authors: Tim Hessels UNESCO-IHE 2016 Contact: t.hessels@unesco-ihe.org Repository: https://github.com/wateraccounting/wa Module: Collect/MOD9 """ # import general python modules import os import numpy as np import pandas as pd import gdal import urllib import urllib2 from bs4 impor...
apache-2.0
-289,952,064,989,498,560
42.471186
378
0.573456
false
3.747516
false
false
false
Stbot/PyCrypt
first writes/b64cy.py
1
2516
############################################################################### import b64_mod from binascii import unhexlify ############################################################################### def decode(bstring,flag = 0): """Decode, when flag is set to 0 or not set takes a Base64 strig and converts i...
mit
-6,056,610,221,976,268,000
36
175
0.49841
false
3.835366
false
false
false
googleapis/python-api-core
tests/unit/test_client_info.py
1
2488
# Copyright 2017 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 agreed to in writing, s...
apache-2.0
-3,570,916,829,049,336,300
27.272727
79
0.64791
false
3.450763
false
false
false
ItsCalebJones/SpaceLaunchNow-Server
api/v330/spacestation/views.py
1
1860
from rest_framework.viewsets import ModelViewSet from rest_framework.filters import SearchFilter, OrderingFilter from django_filters.rest_framework import DjangoFilterBackend from api.models import * from api.permission import HasGroupPermission from api.v330.spacestation.serializers import SpaceStationDetailedSeriali...
apache-2.0
-6,008,000,186,509,618,000
39.456522
114
0.687634
false
3.858921
false
false
false
luan-th-nguyen/seisflows_ndt
seisflows/config.py
1
6784
import copy_reg import imp import os import re import sys import types from importlib import import_module from os.path import abspath, join, exists from seisflows.tools import msg from seisflows.tools.err import ParameterError from seisflows.tools import unix from seisflows.tools.tools import loadjson, loadobj, loa...
bsd-2-clause
-5,586,993,668,159,306,000
26.803279
406
0.627064
false
3.876571
false
false
false
ChristophKirst/ClearMap
ClearMap/IO/NRRD.py
1
20940
#!/usr/bin/env python # encoding: utf-8 """ Interface to NRRD volumetric image data files. The interface is based on nrrd.py, an all-python (and numpy) implementation for reading and writing nrrd files. See http://teem.sourceforge.net/nrrd/format.html for the specification. Example: >>> import os, numpy >>> ...
gpl-3.0
-2,766,026,941,562,460,000
31.009174
117
0.596542
false
3.508884
false
false
false
mdevaev/slog
src/remote.py
1
1202
# -*- mode: python; coding: utf-8; -*- import dbus import dbus.service, dbus.mainloop.glib class Remote: def __init__(self): bus = dbus.SessionBus() slog_obj = bus.get_object("org.LightLang.SLog", "/SLog") self.iface = dbus.Interface(slog_obj, "org.LightLang.SLogInterface") def __spy_toggle(self): self.if...
gpl-2.0
-6,164,688,821,272,691,000
24.041667
70
0.682196
false
2.855107
false
false
false
jabumaho/MNIST-neural-network
network.py
1
3424
import numpy as np def sgm(x, derivative=False): if not derivative: return 1/(1+np.exp(-x)) else: return sgm(x) * (1 - sgm(x)) def linear(x, derivative=False): if not derivative: return x else: return 1 class NeuralNetwork: layerCount = 0 shape = None weights = [] layerTransfe...
gpl-3.0
-1,273,426,215,257,752,800
28.035088
133
0.645736
false
2.990393
false
false
false
arulalant/mmDiagnosis
diagnosis1/extra/dirty/MULTIPLE PLOTS/por_landscape_2x3.py
1
2203
import cdms2 import cdutil import numpy import numpy.ma import vcs import os import sys import por_template_2x3_landscape as por_lanscape_2x3 x = por_lanscape_2x3.x iso=x.createisofill('new1', 'ASD') iso.levels = [0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9] #([1, 5, 10, 15, 20, 25, 35, 45, 55, 60, 65, 70, 80]) #is...
gpl-3.0
-1,482,070,405,860,495,400
31.880597
125
0.552429
false
2.641487
false
false
false
cedricpradalier/vrep_ros_ws
src/ar_loc_base/src/ar_loc_base/rover_pf.py
1
4147
import roslib; roslib.load_manifest('ar_loc_base') import rospy from numpy import * from numpy.linalg import pinv, inv from math import pi, sin, cos from geometry_msgs.msg import * import tf import bisect import threading from rover_kinematics import * class RoverPF(RoverKinematics): def __init__(self, initial_po...
bsd-3-clause
2,330,022,787,027,257,000
32.991803
96
0.592235
false
3.499578
false
false
false
nblago/utils
src/model/BBFit.py
1
66521
# -*- coding: utf-8 -*- """ Created on Thu Feb 22 10:57:34 2018 Class that enables to fit a black body function to a set of magntidues. @author: nadiablago @version: 0.22 """ from __future__ import print_function import matplotlib from matplotlib import pylab as plt import corner from astropy import units as u impo...
mit
-9,118,717,144,658,973,000
39.41373
196
0.504743
false
3.123932
false
false
false
disco-framework/disco
priv/general/components/gui/gui.py
1
18070
#!/usr/bin/python import sys from PyQt4 import QtCore, QtGui from ui_mainview import Ui_MainWindow import json from jsonreader import JsonReader ################################################## class MainWindow(QtGui.QMainWindow): def __init__(self, parent=None): QtGui.QMainWindow.__init__(self, pare...
apache-2.0
-6,686,924,166,606,951,000
38.714286
124
0.639236
false
3.791439
false
false
false
au9ustine/elrond
elrond/aws/s3.py
1
3432
import os import json import threading import boto3 from boto3.s3.transfer import S3Transfer from elrond.crypto import get_file_digest DEFAULT_CHUNK_SIZE = 64 * 1024 * 1024 ELROND_S3_SINGLETON_CLIENT = None ELROND_S3_SUPPORTED_REGIONS = [ 'EU', 'eu-west-1', 'us-west-1', 'us-west-2', 'ap-south-1'...
mit
4,340,258,530,075,880,400
27.363636
74
0.586247
false
3.473684
false
false
false
cerrno/neurokernel
examples/timing/run_gpu_slow.py
2
1898
#!/usr/bin/env python """ Run timing test (GPU) scaled over number of ports. """ import csv import glob import multiprocessing as mp import os import re import subprocess import sys import numpy as np from neurokernel.tools.misc import get_pids_open try: from subprocess import DEVNULL except ImportError: i...
bsd-3-clause
5,892,850,443,696,471,000
26.507246
80
0.53372
false
3.560976
false
false
false
hsoft/pluginbuilder
pluginbuilder/util.py
1
12467
import os, sys, zipfile, time from modulegraph.find_modules import PY_SUFFIXES from modulegraph.modulegraph import os_listdir import macholib.util def os_path_islink(path): """ os.path.islink with zipfile support. Luckily zipfiles cannot contain symlink, therefore the implementation is trivial. ""...
mit
2,080,846,094,289,265,200
30.722646
87
0.562365
false
3.843095
false
false
false
CliMT/climt-future
climt/_lib/rrtmg_lw/setup.py
1
2948
from setuptools import setup, Extension from Cython.Distutils import build_ext # This line only needed if building with NumPy in Cython file. from numpy import get_include from os import system import os # compile the fortran modules without linking module_list = [ 'parkind.f90', 'parrrtm.f90', 'rrlw_cld.f...
bsd-3-clause
-8,972,440,418,118,426,000
25.8
80
0.637042
false
2.615794
false
false
false
hachreak/invenio-accounts
invenio_accounts/models.py
1
5487
# -*- coding: utf-8 -*- # # This file is part of Invenio. # Copyright (C) 2015, 2016 CERN. # # Invenio is free software; you can redistribute it # and/or modify it under the terms of the GNU General Public License as # published by the Free Software Foundation; either version 2 of the # License, or (at your option) any...
gpl-2.0
6,014,488,001,262,512,000
31.087719
76
0.659194
false
3.839748
false
false
false
khertan/KhtNotes
khtnotes/merge3/merge3.py
1
18192
# Copyright (C) 2005-2010 Canonical Ltd # # 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 distribute...
gpl-3.0
-2,084,280,794,020,240,600
34.952569
79
0.484883
false
3.930856
false
false
false
tschalch/pyTray
src/setup.py
1
6933
#!/usr/bin/env python #this installer script uses InnoSetup to generate a complete Installer from distutils.core import setup import py2exe import os, os.path, sys import glob #adding lib directory to module search path libpath = os.path.abspath(os.path.dirname(sys.argv[0])) + "/lib" sys.path.append(os.path.abs...
bsd-3-clause
2,843,598,152,450,568,700
34.298429
116
0.492572
false
4.078235
false
false
false
tdegeus/GooseEYE
docs/examples/clusters_dilate_periodic.py
1
2926
r''' Plot and/or check. Usage: script [options] Options: -s, --save Save output for later check. -c, --check Check against earlier results. -p, --plot Plot. -h, --help Show this help. ''' # <snippet> import numpy as np import GooseEYE # generate image I = np.zeros((21, 21)...
gpl-3.0
-889,297,396,052,922,000
25.125
89
0.520164
false
2.89703
false
false
false
drupdates/Slack
__init__.py
1
1072
""" Send report using Slack. """ from drupdates.settings import Settings from drupdates.utils import Utils from drupdates.constructors.reports import Report import json, os class Slack(Report): """ Slack report plugin. """ def __init__(self): current_dir = os.path.dirname(os.path.realpath(__file__)) ...
mit
81,357,146,827,252,450
33.580645
72
0.616604
false
4
false
false
false
RudolfCardinal/pythonlib
cardinal_pythonlib/wsgi/headers_mw.py
1
4487
#!/usr/bin/env python # cardinal_pythonlib/headers_mw.py """ =============================================================================== Original code copyright (C) 2009-2021 Rudolf Cardinal (rudolf@pobox.com). This file is part of cardinal_pythonlib. Licensed under the Apache License, Version 2.0 (...
apache-2.0
8,220,256,760,036,851,000
32.992424
79
0.592378
false
4.197381
false
false
false
aep124/TwitterAnalyticsTools
textonly.py
1
2405
# this is a script to retrieve and process text-only data for classification # This process includes four main tasks # 1) getting raw tweets # 2) apply labels (this step can be conducted at any time) # 2) filtering those tweets (e.g., according to CMU POS tagger) # 3) deriving a set of features (a.k.a. wo...
mit
2,456,822,204,111,772,700
24.585106
116
0.642827
false
3.358939
false
false
false
daicang/Leetcode-solutions
146-lru-cache.py
1
1792
class DLNode(object): def __init__(self): self.key = None self.value = None self.prev = None self.next = None class LRUCache(object): def __init__(self, capacity): """ :type capacity: int """ self.head = DLNode() self.tail = DLNode() ...
mit
3,490,341,262,473,513,000
19.363636
40
0.497768
false
3.419847
false
false
false
brettchien/LeetCode
9_PalindromeNumber.py
1
3651
class Solution: # @param {integer} x # @return {boolean} def isPalindrome(self, x): if x < 0: return False if x > 0 and x % 10 == 0: return False reverse = 0 while x > reverse: reverse = reverse * 10 + x % 10 x /= 10 ret...
mit
3,103,546,097,456,922,600
26.870229
54
0.398247
false
4.474265
false
false
false
felipemontefuscolo/bitme
get_bitmex_candles.py
1
4122
#!/usr/bin/env python import sys import time import swagger_client from swagger_client.rest import ApiException from utils.utils import smart_open import argparse import pandas as pd MAX_NUM_CANDLES_BITMEX = 500 def print_file(file_or_stdout, api_instance, bin_size, partial, symbol, reverse, start_time, end_time)...
mpl-2.0
-6,723,906,315,588,768,000
35.157895
119
0.562591
false
3.587467
false
false
false
pengkobe/leetcode
questions/Regular_Expression_Matching.py
1
6170
# -*- coding: utf-8 -*- # 本题难度:★★★ # 实现一个正则表达式引擎,让其支持匹配 . 和 *,其中: # . 匹配任何单字符 # * 匹配 0 个或者多个前字符 # 需要匹配全部输入而非部分输入,函数格式如下: # bool isMatch(const char *s, const char *p) # 如: # isMatch('aa', 'a') // false # isMatch('aa', 'aa') // true # isMatch('aaa', 'aa') // false # isMatch('aa', 'a*') // true # isMatch('aa', '.*') //...
gpl-3.0
-772,837,806,286,783,600
29.136126
106
0.442669
false
2.41443
false
false
false
MisanthropicBit/bibpy
examples/requirements_check.py
1
1795
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """Example of checking the requirements of bibtext and biblatex.""" import bibpy from bibpy.tools import get_abspath_for def format_requirements_check(required, optional): s = "" if required: s = "required field(s) " + ", ".join(map(str, required)) ...
mit
8,251,867,451,367,847,000
31.636364
78
0.578273
false
4.243499
false
false
false
syci/ingadhoc-odoo-addons
partner_views_fields/res_config.py
1
1176
# -*- coding: utf-8 -*- from openerp import fields, models class partner_configuration(models.TransientModel): _inherit = 'base.config.settings' group_ref = fields.Boolean( "Show Reference On Partners Tree View", implied_group='partner_views_fields.group_ref', ) group_user_id = fi...
agpl-3.0
5,898,531,089,247,119,000
34.636364
65
0.654762
false
3.89404
false
false
false
malt1/lutris
tests/test_installer.py
1
1700
from unittest import TestCase from lutris.installer import ScriptInterpreter, ScriptingError class MockInterpreter(ScriptInterpreter): """ a script interpreter mock """ script = {'runner': 'linux'} def is_valid(self): return True class TestScriptInterpreter(TestCase): def test_script_with_c...
gpl-3.0
-5,782,265,075,609,909,000
33
72
0.594118
false
4.381443
true
false
false
jossgray/zyrecffi
zyrecffi/_cffi.py
1
3231
from cffi import FFI import os, sys ffi = FFI() ffi.cdef(''' // zsock.h typedef struct _zsock_t zsock_t; // zmsg.h typedef struct _zmsg_t zmsg_t; int zmsg_addstr (zmsg_t* self, const char* string); char* zmsg_popstr (zmsg_t* self); // zyre.h typedef struct _zyre_t zyre_t; zyre_t* zyre_new (const char *name); ...
gpl-3.0
5,003,882,334,878,248,000
21.444444
104
0.665738
false
2.317791
false
false
false
cwisecarver/osf.io
api/base/serializers.py
1
58011
import collections import re import furl from django.core.urlresolvers import resolve, reverse, NoReverseMatch from django.core.exceptions import ImproperlyConfigured from django.utils import six from rest_framework import exceptions, permissions from rest_framework import serializers as ser from rest_framework.field...
apache-2.0
3,039,951,152,254,714,000
37.725634
289
0.597076
false
4.176157
false
false
false
yakky/djangocms-text-ckeditor
djangocms_text_ckeditor/forms.py
1
3464
# -*- coding: utf-8 -*- from django import forms from django.core import signing from django.core.signing import BadSignature from django.forms.models import ModelForm from django.template import RequestContext from django.utils.translation import ugettext from cms.models import CMSPlugin from .models import Text fro...
bsd-3-clause
-7,001,191,991,926,625,000
29.928571
76
0.633661
false
4.214112
false
false
false
SanPen/GridCal
src/research/PTDF/ACPTDF_research2.py
1
14022
# This file is part of GridCal. # # GridCal 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. # # GridCal is distributed in the hope that...
gpl-3.0
2,332,068,375,098,212,400
31.234483
120
0.590857
false
3.160243
false
false
false
Yubico/yubikey-manager
ykman/cli/fido.py
1
24461
# Copyright (c) 2018 Yubico AB # 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 conditi...
bsd-2-clause
-6,043,912,827,052,858,000
32.010796
88
0.589346
false
3.633002
false
false
false
kobotoolbox/kobocat
onadata/apps/logger/tests/test_briefcase_client.py
1
6934
# coding: utf-8 import os.path from io import StringIO, BytesIO from urllib.parse import urljoin import requests from django.contrib.auth import authenticate from django.core.files.storage import get_storage_class from django.core.files.uploadedfile import UploadedFile from django.urls import reverse from django.test ...
bsd-2-clause
5,599,805,507,777,540,000
37.098901
78
0.62792
false
3.760304
true
false
false
mmlab/eice
EiCGraphAlgo/core/typeahead.py
1
4270
''' Created on 17-sep.-2012 @author: ldevocht ''' import urllib.parse, lxml.objectify, logging, configparser, re, ujson, requests from core.resourceretriever import Resourceretriever from core import resourceretriever, config_search config = resourceretriever.config mappings = resourceretriever.mappings logger = loggi...
agpl-3.0
-1,328,228,545,254,396,400
45.423913
131
0.52623
false
4.14161
true
false
false
gaeun/open-event-orga-server
app/api/helpers/utils.py
1
7209
import json from hashlib import md5 from flask import request from flask.ext.restplus import Resource as RestplusResource from flask_restplus import Model, fields, reqparse from app.helpers.data import update_version from app.models.event import Event as EventModel from .error_docs import ( notfound_error_model, ...
gpl-3.0
3,571,529,669,562,688,000
30.207792
88
0.625468
false
3.80623
false
false
false
wradlib/wradlib
wradlib/tests/test_adjust.py
1
7916
#!/usr/bin/env python # Copyright (c) 2011-2020, wradlib developers. # Distributed under the MIT License. See LICENSE.txt for more info. import numpy as np import pytest from wradlib import adjust class Data: # Arguments to be used throughout all test classes raw_x, raw_y = np.meshgrid(np.arange(4).astype("...
mit
893,179,589,196,588,400
27.47482
84
0.456544
false
3.07776
true
false
false
maxivanoff/fftoolbox-app
q/fftoolbox/multipole.py
1
12213
import logging import numpy as np from copy import deepcopy from numpy.linalg import norm from scipy.special import sph_harm as Y mult_logger = logging.getLogger('multipole') def Rlm(l, m, r, theta, phi): return r**l * np.sqrt(4 * np.pi / (2 * l + 1)) * Y(m, l, theta, phi) def Rlmc(l, m, r, theta, phi): retu...
gpl-2.0
6,099,882,326,194,920,000
33.794872
372
0.524032
false
3.106843
false
false
false
woobe/h2o
py/testdir_multi_jvm/test_rf_1ktrees_job_cancel_many_fvec.py
1
2219
import unittest, time, sys, random sys.path.extend(['.','..','py']) import h2o, h2o_cmd, h2o_hosts, h2o_import as h2i, h2o_jobs, h2o_rf class Basic(unittest.TestCase): def tearDown(self): h2o.check_sandbox_for_errors() @classmethod def setUpClass(cls): localhost = h2o.decide_if_localhost()...
apache-2.0
-7,085,951,831,473,397,000
37.258621
141
0.604777
false
3.143059
false
false
false
juliosmelo/soldo
utils/settings.py
1
1331
PGS_TOKEN = 'C888EE7F420841CF92D0B0063EDDFC7D' PGS_EMAIL = 'pagseguro@panfleteria.com.br' # from datetime import datetime # from datetime import date # from datetime import timedelta # dates = [d0] # dates_two = list() # def date_paginator(x, y): # print x, y # if pages == 1 and pages_mods == 0: # _date =...
mit
1,225,591,867,755,594,800
23.666667
80
0.574005
false
2.819915
false
false
false
MichaelAnckaert/Hermes
message.py
1
1631
"""Message functionality for Hermes""" from datetime import datetime import json __author__ = "Michael Anckaert" __copyright__ = "Copyright 2012, Michael Anckaert" __credits__ = ["Michael Anckaert"] __license__ = "GPLv3" __version__ = "0.0.1" __maintainer__ = "Michael Anckaert" __email__ = "michael.anckaert@sinax.be"...
gpl-3.0
2,294,136,335,230,464,300
27.12069
132
0.591048
false
3.828638
false
false
false