repo_name
stringlengths
5
92
path
stringlengths
4
232
copies
stringclasses
19 values
size
stringlengths
4
7
content
stringlengths
721
1.04M
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
15
997
alpha_frac
float64
0.25
0.97
autogenerated
bool
1 class
lesina/Hack70
src/core/models.py
1
1253
# coding: utf-8 from __future__ import unicode_literals from django.db import models from django.contrib.auth.models import AbstractUser, AbstractBaseUser from courses.models import Course class User(AbstractUser): avatar = models.ImageField(u'фото профиля',upload_to='avatars', blank=False, default=u'avatars/def...
gpl-3.0
-6,417,249,370,478,180,000
37.2
119
0.709424
false
certik/sfepy
sfepy/fem/equations.py
1
10524
from sfepy.base.base import * from parseEq import create_bnf from materials import Materials from sfepy.terms import Terms, Term, term_table, DataCaches, cache_table """ Note: - create found materials, variables from configuration/input file data ... no - user should be able to create objects even if they are not ...
bsd-3-clause
3,473,490,920,846,410,000
29.682216
81
0.515013
false
averagehuman/django-instance
instance/cli/controller.py
1
2384
# -*- coding: utf-8 -*- from __future__ import unicode_literals import os import sys import shutil try: from io import BytesIO except ImportError: from cStringIO import StringIO as BytesIO import logbook from django.utils.text import slugify from django.core.management import call_command from instance.con...
bsd-3-clause
-8,852,039,985,815,156,000
25.488889
74
0.60948
false
xarg/rview
encoder/tasks.py
1
3778
import os from os import listdir from os.path import join import time import traceback import logging from invoke import run, task import dateutil.parser import cv2 logging.basicConfig() logger = logging.getLogger("tasks") MEDIA_PATH = join(os.path.dirname(__file__), "static") ENCONDE_CMD = "mencoder -nosound -ovc l...
mit
-881,124,830,737,236,500
34.980952
185
0.560614
false
giannitedesco/kapital
monop/simplestrategy.py
1
3912
from strategy import Strategy import gobject class SimpleStrategy(Strategy): def __init__(self): super(SimpleStrategy, self).__init__() def do_raise_cash(self, target, hand): raised = 0 (monopolies, crap) = self.split_hand(hand) # first try mortgage properties that are not # part of monopolies for e i...
gpl-3.0
-6,952,979,743,303,447,000
23.759494
62
0.634458
false
vlahm/simplefc
simplefc/commands/delete_set.py
1
1360
"""delete a flashcard set""" from __future__ import print_function from __future__ import unicode_literals from __future__ import division from __future__ import absolute_import from builtins import input from builtins import str from future import standard_library standard_library.install_aliases() from .base import ...
gpl-3.0
-6,615,158,346,313,196,000
31.380952
68
0.544853
false
Kvoti/ditto
ditto/comments/api.py
1
1717
from django.contrib.contenttypes.models import ContentType from django.contrib.sites.models import Site from django_comments.models import Comment from rest_framework import serializers, generics, filters class CommentSerializer(serializers.ModelSerializer): user = serializers.SlugRelatedField(slug_field='usernam...
bsd-3-clause
-8,549,623,033,277,502,000
30.218182
78
0.635411
false
Bergurth/anagram8
newAnagram2.py
1
6381
import sys import re from substring import * from itertools import combinations from collections import defaultdict if len(sys.argv) < 2: #check for whether input specified or not print "No jumbled word specified.Please enter a jumbled word." sys.exit(0) input_string = sys.argv[1] uni_input = unicode(input_...
gpl-2.0
-8,431,472,854,959,819,000
27.110132
130
0.595048
false
erudit/eruditorg
eruditorg/apps/public/site_messages/migrations/0002_auto_20190425_1305.py
1
1845
# Generated by Django 2.0.13 on 2019-04-25 17:05 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ("site_message", "0001_initial"), ] operations = [ migrations.CreateModel( name="TargetSite", fields=[ ...
gpl-3.0
-5,972,333,534,437,446,000
31.839286
173
0.449157
false
nickgentoo/scikit-learn-graph
skgraph/datasets/load_graph_datasets.py
1
27349
# -*- coding: utf-8 -*- """ Created on Fri Mar 13 13:02:41 2015 Copyright 2015 Nicolo' Navarin This file is part of scikit-learn-graph. scikit-learn-graph 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 ...
gpl-3.0
425,709,170,503,092,800
38.222382
152
0.664191
false
Jumpscale/core9
JumpScale9/tools/nodemgr/Node.py
1
8095
from js9 import j TEMPLATE = """ name = "" clienttype = "" sshclient = "" active = false selected = false category = "" description = "" secretconfig_ = "" pubconfig = "" installed = false zosclient = "" """ FormBuilderBaseClass = j.tools.formbuilder.baseclass_get() JSBASE = j.application.jsbase_get_class() class ...
apache-2.0
-113,120,470,263,446,180
29.662879
103
0.576405
false
thebe2/ding
morning/notice_montage.py
1
10104
# *-* coding: utf-8 *-* # 抓取证券日报上的每日交易公告集锦 # http://www.ccstock.cn/meiribidu/jiaoyitishi/ # 代码版本 python 2.7 IDE:PyCharm import requests import random import sys import time from bs4 import BeautifulSoup from email.mime.text import MIMEText from email.mime.multipart import MIMEMultipart from email.header import Header i...
mit
7,004,598,003,179,474,000
33.355872
123
0.596126
false
gkc1000/pyscf
pyscf/hessian/thermo.py
1
14002
#!/usr/bin/env python # # This code was copied from the data generation program of Tencent Alchemy # project (https://github.com/tencent-alchemy). # # # # # # Copyright 2019 Tencent America LLC. All Rights Reserved. # # # # Licensed under the Apache License, Version 2.0 (the "License"); # # you may not use this file e...
apache-2.0
4,807,885,719,179,349,000
36.239362
92
0.558777
false
mk-fg/yapps
yapps/grammar.py
1
8914
# grammar.py, part of Yapps 2 - yet another python parser system # Copyright 1999-2003 by Amit J. Patel <amitp@cs.stanford.edu> # Enhancements copyright 2003-2004 by Matthias Urlichs <smurf@debian.org> # # This version of the Yapps 2 grammar can be distributed under the # terms of the MIT open source license, either fo...
mit
-1,790,514,124,538,740,200
41.447619
158
0.536123
false
tshirtman/ultimate-smash-friends
usf/screens/level.py
1
3174
################################################################################ # copyright 2009 Gabriel Pettier <gabriel.pettier@gmail.com> # # # # This file is part of Ultimate Smash Friends. ...
gpl-3.0
-112,941,543,913,260,480
37.240964
80
0.476686
false
gustavoatt/consultas
consultas_proyecto/pacientes_app/tests/test_forms.py
1
1548
from django import test from pacientes_app import forms from pacientes_app import models class PacienteEditFormTestCase(test.TestCase): def setUp(self): self.paciente = models.Paciente.objects.create( cedula='18423347', fecha_nacimiento='1988-03-26' ) def test_valid_form(self): data =...
mit
8,823,473,721,192,565,000
31.25
57
0.613049
false
eirannejad/pyRevit
pyrevitlib/pyrevit/coreutils/markdown/extensions/footnotes.py
1
14914
""" Footnotes Extension for Python-Markdown ======================================= Adds footnote handling to Python-Markdown. See <https://pythonhosted.org/Markdown/extensions/footnotes.html> for documentation. Copyright The Python Markdown Project License: [BSD](http://www.opensource.org/licenses/bsd-license.php)...
gpl-3.0
-9,122,525,648,859,434,000
34.679426
109
0.545058
false
HaroldMills/Vesper
scripts/create_randomized_station_night_list.py
1
2218
''' Script that creates a randomized list of station/night pairs. Given a list of station names and a list of night dates, this script writes a semi-randomized list of the elements of the cartesian product of the two lists to a CSV file. The station names cycle through an alphabetized version of the input station name...
mit
-5,986,494,067,936,976,000
20.745098
72
0.671326
false
shakamunyi/sahara
sahara/tests/unit/plugins/cdh/test_versionfactory.py
1
1665
# Copyright (c) 2015 Mirantis 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 writ...
apache-2.0
-8,801,172,620,770,967,000
37.72093
69
0.718919
false
SamProtas/PALiquor
geocode_fixes.py
1
2733
import os import pandas as pd import numpy as np import sqlite3 import requests import time def fix_location(lid, new_address): pd.set_option('display.mpl_style', 'default') PROJECT_ROOT = os.path.dirname(os.path.realpath(__file__)) DATABASE1 = os.path.join(PROJECT_ROOT, 'dbs', 'licensees.db') ...
gpl-2.0
-2,758,837,332,182,143,000
33.1625
136
0.706915
false
markherringer/waywayd
third-party/django_multilingual/multilingual/query.py
1
26323
""" Django-multilingual: a QuerySet subclass for models with translatable fields. This file contains the implementation for QSRF Django. """ import datetime from django.core.exceptions import FieldError from django.db import connection from django.db.models.fields import FieldDoesNotExist from django.db.models.query...
agpl-3.0
8,766,511,261,829,303,000
43.919795
115
0.512821
false
Braiiin/outline-client
outline_client/admin/views.py
1
2399
from flask import Blueprint, render_template, request, redirect, url_for, \ jsonify from flask_login import login_required, current_user from outline_client.libs.outline import Outline from client.libs.service import Service, Employment from .forms import AddOutlineForm, EditOutlineForm import functools # setup ad...
apache-2.0
-3,712,959,128,799,209,500
31.863014
75
0.668612
false
cst13/canstel
do_release.py
1
1732
#!/usr/bin/env python import sys import argparse import pkg_resources from moneywagon import service_table from moneywagon.supply_estimator import write_blocktime_adjustments from subprocess import call parser = argparse.ArgumentParser() parser.add_argument('--minor', action='store_true', help='Make minor release.'...
mit
6,398,635,532,910,389,000
35.083333
133
0.684758
false
mjtamlyn/archery-scoring
tamlynscore/settings.py
1
3308
import os import dj_database_url BASE_DIR = os.path.dirname(os.path.dirname(__file__)) DEBUG = not os.environ.get('PRODUCTION') ALLOWED_HOSTS = [ 'tamlynscore.co.uk', 'www.tamlynscore.co.uk', '127.0.0.1', 'localhost', '192.168.1.101', '192.168.1.100', ] ADMINS = ( ('Marc Tamlyn', 'marc....
bsd-3-clause
7,236,107,738,233,246,000
25.464
91
0.662334
false
goujonpa/assotextmining
gabriel.py
1
3496
# gets all the asso posts and puts it in a single .txt file import json import os txt_250 = list() txt_500 = list() txt_1000 = list() txt_1500 = list() txt_plus = list() stats_250 = list() stats_500 = list() stats_1000 = list() stats_1500 = list() stats_plus = list() varrad = u'txt_' varrad2 = u'stats_' for i in r...
mit
7,392,025,437,876,024,000
38.280899
203
0.484268
false
yarikoptic/NiPy-OLD
nipy/fixes/scipy/stats/models/tests/rmodelwrap.py
1
1153
''' Wrapper for R models to allow comparison to scipy models ''' import numpy as np from rpy import r from exampledata import x, y class RModel(object): ''' Class gives R models scipy.models -like interface ''' def __init__(self, y, design, model_type=r.lm): ''' Set up and estimate R model with data...
bsd-3-clause
-4,254,897,468,352,540,000
37.433333
73
0.5915
false
Eluvatar/trawler-python-region-scan
wa_scanner.py
1
3652
#!/usr/bin/python from parser import api from ns import id_str import urllib2 import time import json from operator import itemgetter as get import argparse parser = argparse.ArgumentParser(description="Scan region") parser.add_argument('-u', '--user', metavar='USER', required=True, help='a nation name, email, or we...
gpl-3.0
-8,256,628,711,192,047,000
35.888889
255
0.692497
false
cpascoe95/cryptotools
tests/cipher_tests.py
1
4829
import unittest import crypto.ciphers as ciphers from crypto.alphabets import EnglishAlphabet class SubstitutionCipherTests(unittest.TestCase): def setUp(self): self.alph = EnglishAlphabet() self.key = {letter: letter for letter in self.alph} def test_invalid_key_type(self): with self...
gpl-2.0
-3,983,513,460,971,492,400
30.980132
98
0.628495
false
batermj/algorithm-challenger
code-analysis/programming_anguage/python/source_codes/Python3.5.9/Python-3.5.9/Lib/test/test_mailcap.py
1
10130
import mailcap import os import shutil import copy import test.support import unittest # Location of mailcap file MAILCAPFILE = test.support.findfile("mailcap.txt") # Dict to act as mock mailcap entry for this test # The keys and values should match the contents of MAILCAPFILE MAILCAPDICT = { 'application/x-movie...
apache-2.0
8,471,126,944,683,534,000
41.208333
104
0.545311
false
rockyzhengwu/mlscratch
rnn/char_rnn.py
1
4815
#!/usr/bin/env python # -*-coding:utf-8-*- """ Minimal character-level Vanilla RNN model. Written by Andrej Karpathy (@karpathy) BSD License """ import numpy as np # data I/O data = open('input.txt', 'r').read() # should be simple plain text file chars = list(set(data)) data_size, vocab_size = len(data), len(chars) ...
apache-2.0
-5,488,489,251,875,216,000
38.793388
125
0.593977
false
sensusaps/RoboBraille.Web.API
WorkingDirectory/DaisyPipeline/transformers/ca_cnib_rtf2dtbook/rtf2xml-py/rtf2xml/delete_info.py
1
8983
######################################################################### # # # # # copyright 2002 Paul Henry Tremblay # # ...
apache-2.0
-7,226,164,426,623,397,000
33.953307
97
0.436046
false
MikeWinter/bio-data-repository
bdr/utils/transports.py
1
13814
""" A set of classes for abstracting communication with remote servers. While the urllib-family of modules provides similar functionality, they not provide for querying the source for its metadata (size and modification date, in this case) prior to fetching the resource itself. All exceptions raised by these types inh...
gpl-2.0
-1,830,276,783,654,762,800
34.973958
106
0.600333
false
rehandalal/buchner
buchner/cmdline.py
1
4058
import os import os.path import string from optparse import OptionParser from buchner import __version__ USAGE = '%prog [options] [command] [command-options]' VERSION = '%prog ' + __version__ def build_parser(usage): parser = OptionParser(usage=usage, version=VERSION) return parser DIGIT_TO_WORD = { ...
bsd-3-clause
4,306,350,212,375,323,000
24.3625
81
0.569246
false
thomasw/convertly
converter/views.py
1
3286
from converter import * from django.template import RequestContext, Context, loader from django.shortcuts import render_to_response from django.http import HttpResponse, Http404 from converter.forms import UploadDoc from zipfile import ZipFile def index(request): """ Interface for uploading, co...
mit
6,260,761,604,533,570,000
31.215686
98
0.664029
false
propdata/scrum-pm
scrum_pm/artifacts/migrations/0001_initial.py
1
5055
# -*- coding: utf-8 -*- import datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Adding model 'Sprint' db.create_table('artifacts_sprint', ( ('id', self.gf('django.db.models.f...
mit
6,145,486,394,306,137,000
65.526316
182
0.563403
false
davidpaulrosser/Forms
forms/util/mesh.py
1
3205
""" This module provides various mesh utilities for cleaning and extruding. """ import pymel.core as pm import maya.mel as mel """ Combine multiple polygon meshes with the option of removing duplicate internal faces. Parameters: instanceGroup -- A group of meshes to combine ( pymel.core.general.group ) ...
mit
-1,726,906,930,116,694,500
29.235849
136
0.616849
false
jerjorg/BZI
BZI/convergence.py
1
6793
import numpy as np import matplotlib.pyplot as plt import time from BZI.symmetry import make_ptvecs from BZI.sampling import make_grid from BZI.pseudopots import Al_PP from BZI.integration import monte_carlo from BZI.plots import PlotMesh class Convergence(object): """ Compare integrations of pseudo-potentials by...
gpl-3.0
-3,526,169,047,747,902,000
48.583942
91
0.554541
false
andras-tim/sphinxcontrib-httpdomain
doc/conf.py
1
8340
# -*- coding: utf-8 -*- # # sphinxcontrib-httpdomain documentation build configuration file, created by # sphinx-quickstart on Thu Jun 2 13:27:52 2011. # # This file is execfile()d with the current directory set to its containing dir. # # Note that not all possible configuration values are present in this # autogenera...
bsd-2-clause
1,940,652,276,734,229,500
31.834646
80
0.702158
false
bfirsh/docker-py
tests/unit/auth_test.py
1
16214
# -*- coding: utf-8 -*- import base64 import json import os import os.path import random import shutil import tempfile import unittest from docker import auth, errors try: from unittest import mock except ImportError: import mock class RegressionTest(unittest.TestCase): def test_803_urlsafe_encode(self...
apache-2.0
4,883,358,497,778,586,000
32.5
79
0.562107
false
stxnext-kindergarten/presence-analyzer-pzarebski
src/presence_analyzer/utils.py
1
3612
# -*- coding: utf-8 -*- """ Helper functions used in views. """ import csv from json import dumps from functools import wraps from datetime import datetime from flask import Response from presence_analyzer.main import app import logging log = logging.getLogger(__name__) # pylint: disable=invalid-name def jsonify...
mit
8,764,287,398,231,358,000
26.157895
79
0.551495
false
robot-tools/iconograph
server/modules/persistent.py
1
1150
#!/usr/bin/python3 import argparse import os import icon_lib parser = argparse.ArgumentParser(description='iconograph persistent') parser.add_argument( '--chroot-path', dest='chroot_path', action='store', required=True) FLAGS = parser.parse_args() def main(): module = icon_lib.IconModule(FLAGS.c...
apache-2.0
3,711,239,642,971,571,700
19.175439
69
0.713913
false
ratoaq2/deluge
packaging/win32/deluge-bbfreeze.py
1
7783
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Copyright (C) 2012-2015 Calum Lind <calumlind@gmail.com> # Copyright (C) 2010 Damien Churchill <damoxc@gmail.com> # Copyright (C) 2009-2010 Andrew Resch <andrewresch@gmail.com> # Copyright (C) 2009 Jesper Lund <mail@jesperlund.com> # # This file is part of Deluge and is...
gpl-3.0
7,283,705,416,891,160,000
34.701835
105
0.654118
false
zplab/rpc-scope
scope/gui/microscope_widget.py
1
23339
# This code is licensed under the MIT License (see LICENSE file for details) from PyQt5 import Qt import pkg_resources from . import device_widget from . import status_widget from ..simple_rpc import rpc_client from .. import util class MicroscopeWidget(device_widget.DeviceWidget): PROPERTY_ROOT = 'scope.' P...
mit
-6,965,134,118,459,684,000
45.769539
129
0.597395
false
Antreasgr/Random-Graphs
Python/SHET.py
1
8516
import os # import networkx as nx import numpy from numpy.random import RandomState from clique_tree import * from nx_converters import * from randomizer import * from subtrees import * from datetime import datetime from Runners import * from report_generator import * from enum import Enum import yaml from yaml import...
mit
1,985,836,268,281,842,400
34.781513
127
0.564937
false
lmiphay/gentoo-oam
oam/eventparser/scanner.py
1
1799
#!/usr/bin/python from __future__ import print_function import sys import os import subprocess import logging import glob import collections import unittest import re class Scanner: def __init__(self, report, checker): self.report = report self.checker = checker self.logger = logging.getL...
gpl-2.0
8,609,256,467,794,436,000
30.017241
89
0.526959
false
nsmoooose/csp
csp/data/ui/tutorials/mission.py
1
2231
#!/usr/bin/python # Combat Simulator Project # Copyright (C) 2002-2009 The Combat Simulator Project # http://csp.sourceforge.net # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; either version...
gpl-2.0
3,707,970,281,633,007,600
32.298507
77
0.688929
false
cdeil/gammalib
inst/cta/test/test_irf_offset.py
1
5601
#! /usr/bin/env python # ===========================================================================================# # This script tests the offset angle dependence of the instrumental response function. # # ===========================================================================================# from gammalib impo...
gpl-3.0
4,921,560,824,327,337,000
22.834043
94
0.518657
false
Ehnonymoose/delver
server/delver.py
1
2586
from flask import Flask, request, jsonify, send_from_directory, make_response from functools import wraps, update_wrapper from datetime import datetime from sqlalchemy import and_, or_ from sqlalchemy.sql import select app = Flask(__name__) from database import db_session import query import models import json NUM...
mit
8,030,225,006,713,413,000
20.371901
119
0.678268
false
hlt-bme-hu/eval-embed
translate.py
1
5706
import sys import numpy from collections import defaultdict from itertools import chain import argparse def renormalize(M): M /= numpy.linalg.norm(M, axis=1)[:, None] return def renormalize_vector(v): return v / numpy.linalg.norm(v) def outer(l1, l2): return list(chain(*[[(x,y) for x in l1] for y in ...
lgpl-3.0
7,749,965,516,054,434,000
38.625
100
0.502454
false
wilg64/MarkovTweet
markovtweet.py
1
5870
import tweepy import json import re import time import random def create_api(config_filename): """ Creates an authorized tweepy API object given a config file containing appropriate twitter application keys :param config_filename: string containing the config filename :return: the tweepy API obje...
mit
7,790,373,430,743,105,000
27.5
101
0.529642
false
henryiii/rootpy
rootpy/plotting/utils.py
1
14257
# Copyright 2012 the rootpy developers # distributed under the terms of the GNU General Public License from __future__ import absolute_import from math import log import operator import ROOT from .canvas import _PadBase from .hist import _Hist, Hist, HistStack from .graph import _Graph1DBase, Graph from ..context im...
gpl-3.0
2,577,957,560,046,515,000
30.966368
79
0.556779
false
q3k/kasownik
webapp/models.py
1
13156
#!/usr/bin/env python2 # - * - coding=utf-8 - * - # Copyright (c) 2015, Sergiusz Bazanski <q3k@q3k.org> # Copyright (c) 2015, Remigiusz Marcinkiewicz <enleth@enleth.com> # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the followi...
bsd-2-clause
-2,691,253,247,546,642,400
35.80112
145
0.607931
false
perrette/pyglacier
pyglacier/plotting.py
1
1106
import matplotlib.pyplot as plt # # plotting # def plot_elevation(ds, ax=None): if ax is None: ax = plt.gca() ds['hs'].plot(ax=ax,label="surface") ds['hb'].plot(ax=ax,label="bottom") # add horizontal line to indicate sea level ax.hlines(0, ds.x[0], ds.x[-1], linestyle='dashed', color='blac...
mit
-7,186,009,462,917,936,000
25.97561
83
0.577758
false
samzhang111/wikipedia-jargon
all-subjects/make_tf_differences.py
1
2815
from __future__ import print_function import msgpack import sys import os from collections import defaultdict from helpers import text_dict_to_term_dict from WikiExtractor import clean, compact import pandas as pd def remove_wikipedia_markup(text): return compact(clean(text.decode('utf8'))) def print_help_and_exi...
gpl-3.0
5,142,175,881,754,362,000
30.988636
79
0.588988
false
fkie-cad/iva
local_repositories/tasks/datetime_utils.py
1
1476
from datetime import datetime, timedelta TIME_FORMAT = '%H:%M:%S' def calculate_task_execution_timeout(task_time): current_datetime = datetime.now() current_time = get_time_from_datetime(current_datetime) return calculate_delta_time(task_time, current_time) def calculate_task_next_execution_datetime(ta...
lgpl-3.0
7,140,560,285,524,920,000
26.867925
105
0.708672
false
lmazuel/azure-sdk-for-python
azure-mgmt-network/azure/mgmt/network/v2018_01_01/models/effective_network_security_group_py3.py
1
2060
# 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
-5,176,465,326,651,729,000
44.777778
136
0.658252
false
raymondanthony/youtube-dl
youtube_dl/extractor/pornotube.py
1
1760
from __future__ import unicode_literals import re from .common import InfoExtractor from ..utils import ( compat_urllib_parse, unified_strdate, ) class PornotubeIE(InfoExtractor): _VALID_URL = r'https?://(?:\w+\.)?pornotube\.com(/c/(?P<channel>[0-9]+))?(/m/(?P<videoid>[0-9]+))(/(?P<title>.+))$' _TE...
unlicense
507,547,985,690,037,800
30.428571
119
0.546591
false
szepeviktor/courier-pythonfilter-custom
email-correct.py
1
9398
#!/usr/bin/python # file: email-correct.py # -*- coding: utf-8 -*- import os import sys import email import email.charset import email.encoders from email.header import Header from email.utils import getaddresses from email.utils import formataddr from email.utils import parseaddr from email.utils import make_msgid fr...
mit
-9,201,266,120,644,209,000
36.146245
205
0.632581
false
gift-surg/GIFT-Grab
src/tests/files/conftest.py
1
2581
from pytest import fixture from pygiftgrab import Codec, ColourSpace def pytest_addoption(parser): parser.addoption('--colour-space', action='store', type=str, required=True, help='Colour space specification (BGRA or I420)') parser.addoption('--filepath', action='store', type=str, require...
bsd-3-clause
-3,027,531,557,023,826,400
32.532468
79
0.642774
false
kzys/buildbot
buildbot/test/unit/test_util.py
1
1861
# -*- test-case-name: buildbot.test.test_util -*- from twisted.trial import unittest from buildbot import util class Foo(util.ComparableMixin): compare_attrs = ["a", "b"] def __init__(self, a, b, c): self.a, self.b, self.c = a,b,c class Bar(Foo, util.ComparableMixin): compare_attrs = ["b", "c...
gpl-2.0
2,140,252,974,185,657,300
32.232143
96
0.639979
false
bcj/AttrDict
tests/test_common.py
1
29231
# encoding: UTF-8 """ Common tests that apply to multiple Attr-derived classes. """ import copy from collections import namedtuple, Mapping, ItemsView, KeysView, ValuesView from itertools import chain import pickle from sys import version_info from nose.tools import (assert_equals, assert_not_equals, ...
mit
-2,616,914,232,908,486,700
30.07766
79
0.615787
false
joachimmetz/python-gflags
gflags/flags_modules_for_testing/module_bar.py
1
4958
#!/usr/bin/env python # Copyright 2014 Google Inc. All Rights Reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions of source code must retain the above copyright # notice, this list of c...
bsd-3-clause
1,752,783,587,478,691,600
35.455882
72
0.705728
false
cloudbase/maas
src/provisioningserver/testing/fakeapi.py
1
6224
# Copyright 2012, 2013 Canonical Ltd. This software is licensed under the # GNU Affero General Public License version 3 (see the file LICENSE). """Fake Provisioning API. :class:`FakeSynchronousProvisioningAPI` is intended to be useful in a Django environment, or similar, where the Provisioning API is being used via ...
agpl-3.0
4,621,239,559,335,503,000
29.509804
76
0.64653
false
sassoftware/catalog-service
catalogService/rest/drivers/openstack/openstackclient.py
1
23160
# # Copyright (c) SAS Institute Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in w...
apache-2.0
6,831,616,599,087,930,000
36.056
156
0.60095
false
openjck/apod-scraper
scraper.py
1
6524
#!/usr/bin/env python import bleach from bs4 import BeautifulSoup from collections import OrderedDict from dateutil import parser import regex import requests import scraperwiki import urlparse class Page: def __init__(self, path, basename, encoding): self.path = path self.basename = basename ...
gpl-3.0
-8,320,870,269,722,252,000
31.949495
215
0.601625
false
kyxw007/MovieRename
kyxw007/FileTool.py
1
1084
# coding=utf-8 import os import Utils, Rename root_dir = "/Volumes/XiaoMi-usb0/下载" tool = Rename.RenameTool() def get_suffix(file_name): index = file_name.rfind('.') return file_name[index:len(file_name)] def folder_rename(root_dir): file_list = os.listdir(root_dir) for file_name in filter(Utils....
apache-2.0
1,555,840,494,825,192,000
27.628571
101
0.645709
false
srmnitc/tis-tools
runscripts/make_q4q6_dist/make_q4q6_dist.py
1
13555
import os import sys import subprocess as sub import numpy as np import time import logging import tistools_helpers.tistools_helpers as tistools_helpers #SRM:set up logger for the general error messages logger = logging.getLogger(__name__) handler = logging.FileHandler("analysis.log") formatter = logging.Formatter('%(...
gpl-3.0
3,505,470,412,904,452,600
33.579082
115
0.507562
false
galbiati/video-representations
models/ATWModel.py
1
3142
import tensorflow as tf from tensorflow.python.framework import ops from model import Model class ATWModel(Model): """ ATWModel implements a variant on the E-T-D model from model.Model() Instead of doing next frame prediction, ATW attempts to encode the entire sequence, then reproduce the video from o...
mit
-998,173,920,038,844,300
37.790123
96
0.610121
false
streampref/wcimport
tool/query/endseq.py
1
5096
# -*- coding: utf-8 -*- ''' Queries for experiments with ENDSEQ operator ''' import os from tool.attributes import get_move_attribute_list, get_place_attribute_list from tool.experiment import SLI, RAN, ALGORITHM, \ CQL_ALG, QUERY, Q_MOVE, Q_PLACE from tool.io import get_query_dir, write_to_txt, get_out_file, get...
gpl-3.0
4,162,606,464,994,467
31.877419
79
0.601256
false
libsh-archive/sh
test/regress/ceil.cpp.py
1
1153
#!/usr/bin/python import shtest, sys, common from common import * from math import * def ceil_test(p, types=[]): if is_array(p): result = [ceil(a) for a in p] else: result = [ceil(p)] return shtest.make_test(result, [p], types) def insert_into(test): test.add_test(ceil_test((3.0, 3.1,...
lgpl-2.1
-1,104,598,066,792,645,400
28.564103
56
0.657415
false
jhermann/rituals
src/rituals/util/antglob.py
1
6871
# -*- coding: utf-8 -*- # pylint: disable=too-few-public-methods """ Recursive globbing with ant-style syntax. """ # # The MIT License (MIT) # # Original source (2014-02-17) from https://github.com/zacherates/fileset.py # Copyright (c) 2012 Aaron Maenpaa # # Modifications at https://github.com/jhermann/rituals # Copyri...
gpl-2.0
4,840,534,147,977,032,000
33.862944
116
0.600903
false
DigiThinkIT/stem
test/unit/version.py
1
8982
""" Unit tests for the stem.version.Version parsing and class. """ import unittest import stem.util.system import stem.version from stem.version import Version try: # added in python 3.3 from unittest.mock import patch except ImportError: from mock import patch TOR_VERSION_OUTPUT = """Mar 22 23:09:37.088 [no...
lgpl-3.0
-1,618,298,573,717,635,800
34.223529
86
0.676353
false
cadrev/Titanic-Prediction
data-munging.py
1
3412
# # Title : Data munging(AKA cleaning) the Titanic Data # Author : Felan Carlo Garcia # # Notes: # -- Code is based on the Kaggle Python Tutorial # -- data cleaning prior to implementing a machine learning algorithm. import numpy as np import pandas as pd def processdata(filename, outputname): df = pd.read...
mit
6,481,765,875,969,964,000
36.911111
91
0.663247
false
bfirsh/docker-py
setup.py
1
2327
#!/usr/bin/env python import codecs import os import sys from setuptools import setup, find_packages ROOT_DIR = os.path.dirname(__file__) SOURCE_DIR = os.path.join(ROOT_DIR) requirements = [ 'requests >= 2.5.2, != 2.11.0', 'six >= 1.4.0', 'websocket-client >= 0.32.0', 'docker-pycreds >= 0.2.1' ] if...
apache-2.0
-7,816,205,614,684,412,000
30.026667
78
0.646755
false
NERC-CEH/ecomaps
ecomaps/controllers/wmsviz.py
1
9385
# Copyright (C) 2007 STFC & NERC (Science and Technology Facilities Council). # This software may be distributed under the terms of the # Q Public License, version 1.0 or later. # http://ndg.nerc.ac.uk/public_docs/QPublic_license.txt # """ Controller for the 'View' tab - allowing the display of WMC map layers @autho...
gpl-2.0
131,777,740,538,252,640
36.242063
175
0.558977
false
EtienneCmb/tensorpac
tensorpac/methods/meth_erpac.py
1
5370
"""Individual methods for assessing ERPAC.""" import numpy as np from scipy.stats import chi2 from joblib import Parallel, delayed from tensorpac.gcmi import nd_mi_gg from tensorpac.config import CONFIG def pearson(x, y, st='i...j, k...j->ik...'): """Pearson correlation for multi-dimensional arrays. Parame...
bsd-3-clause
-5,151,203,058,610,020,000
32.987342
79
0.577281
false
tobiasgoecke/django-messages
tests/settings.py
1
1335
import os.path INSTALLED_APPS = [ 'django.contrib.auth', 'django.contrib.contenttypes', 'django.contrib.sessions', 'django.contrib.sites', 'django_messages' ] MIDDLEWARE_CLASSES = ( 'django.contrib.sessions.middleware.SessionMiddleware', 'django.middleware.common.CommonMiddleware', 'dj...
bsd-3-clause
-2,423,822,688,440,526,300
25.7
71
0.632959
false
bruckhaus/challenges
python_challenges/project_euler/p012_highly_divisible.py
1
2097
__author__ = 'tilmannbruckhaus' import numpy import sys class HighlyDivisible: # Highly divisible triangular number # Problem 12 # The sequence of triangle numbers is generated by adding the natural numbers. # So the 7th triangle number would be 1 + 2 + 3 + 4 + 5 + 6 + 7 = 28. # The first ten te...
mit
-1,834,102,411,324,664,800
27.337838
95
0.556986
false
Ultimaker/Cura
plugins/VersionUpgrade/VersionUpgrade21to22/VersionUpgrade21to22.py
1
18773
# Copyright (c) 2018 Ultimaker B.V. # Cura is released under the terms of the LGPLv3 or higher. import configparser #To get version numbers from config files. from typing import Dict, Iterable, List, Optional, Set, Tuple from UM.VersionUpgrade import VersionUpgrade # Superclass of the plugin. from . import MachineIn...
lgpl-3.0
8,983,434,077,378,631,000
41
150
0.635753
false
nathanielvarona/airflow
airflow/jobs/local_task_job.py
1
8884
# # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not...
apache-2.0
6,241,240,399,067,721,000
41.711538
109
0.605583
false
ykoga-kyutech/nippou_proj
nippou_app/migrations/0001_initial.py
1
4531
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations import django.core.validators import django.utils.timezone import django.contrib.auth.models import datetime from django.conf import settings class Migration(migrations.Migration): dependencies = [ (...
mit
-7,798,382,819,515,398,000
62.557143
432
0.612272
false
sapphon/minecraftpython
src/main/resources/assets/minecraftpython/scripts/base/items.py
1
4641
IRON_SHOVEL = 'iron_shovel' IRON_PICKAXE = 'iron_pickaxe' IRON_AXE = 'iron_axe' FLINT_AND_STEEL = 'flint_and_steel' APPLE = 'apple' BOW = 'bow' ARROW = 'arrow' COAL = 'coal' DIAMOND = 'diamond' IRON_INGOT = 'iron_ingot' GOLD_INGOT = 'gold_ingot' IRON_SWORD = 'iron_sword' WOODEN_SWORD = 'wooden_sword' WOODEN_SHOVEL = 'w...
gpl-3.0
2,584,095,510,397,654,000
25.83237
49
0.721827
false
ingadhoc/odoo-help
help_doc_portal/__openerp__.py
1
1517
# -*- coding: utf-8 -*- ############################################################################## # # Copyright (C) 2015 ADHOC SA (http://www.adhoc.com.ar) # All Rights Reserved. # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Pu...
agpl-3.0
1,180,211,664,426,069,500
36.925
91
0.591958
false
rocky/python-spark
example/python2/py2_parser.py
1
20426
# Copyright (c) 2016-2017 Rocky Bernstein """ More complex expression parsing """ # from __future__ import print_function import sys from spark_parser.ast import AST from py2_scan import Python2Scanner, ENDMARKER from spark_parser import GenericASTBuilder DEFAULT_DEBUG = {'rules': False, 'transition': False, 'red...
mit
-2,205,583,393,401,705,700
31.015674
88
0.527808
false
maru/fiubar
fiubar/config/settings/local.py
1
2473
# -*- coding: utf-8 -*- """ Local settings - Run in Debug mode - Use console backend for emails - Add Django Debug Toolbar - Add django-extensions as app """ import socket from django.contrib.messages import constants as message_constants from .common import * # noqa # DEBUG # -----------------------------------...
mit
-7,611,459,301,191,556,000
29.158537
80
0.534169
false
NicovincX2/Python-3.5
Génie logiciel/Architecture logicielle/Patron de conception/Patron de structure/flyweight.py
1
2973
#!/usr/bin/env python # -*- coding: utf-8 -*- """http://codesnipers.com/?q=python-flyweights""" import weakref class FlyweightMeta(type): def __new__(mcs, name, parents, dct): """ :param name: class name :param parents: class parents :param dct: dict: includes class attributes,...
gpl-3.0
-3,190,265,489,521,152,500
24.62931
74
0.557686
false
drivefast/pycipherwallet
example/http_router.py
1
3024
import time import bottle import bcrypt import sqlalchemy from sqlalchemy.sql import text as sql_statement import cipherwallet.api_router ROOT = '/path/to/pycipherwallet/example' @bottle.route('/<folder:re:css>/<filename:re:.*\.css>') @bottle.route('/<folder:re:js>/<filename:re:.*\.js>') @bottle.route('/<folder:re:i...
mit
-8,174,461,802,536,404,000
34.576471
100
0.642526
false
zhlinh/leetcode
0038.Count and Say/solution.py
1
1175
#!/usr/bin/env python # -*- coding: utf-8 -*- ''' ***************************************** Author: zhlinh Email: zhlinhng@gmail.com Version: 0.0.1 Created Time: 2016-02-17 Last_modify: 2016-02-17 ****************************************** ''' ''' The count-and-say sequence is the sequence...
apache-2.0
-3,460,842,501,020,716,500
25.111111
76
0.455319
false
vitorio/ocropodium
ocradmin/nodelib/nodes/cuneiform.py
1
1938
""" Cuneiform Recogniser """ from __future__ import absolute_import import os import codecs import shutil import tempfile import subprocess as sp import numpy from nodetree import node from . import base from .. import stages, types, utils class CuneiformRecognizer(base.CommandLineRecognizerNode): """ Re...
apache-2.0
-6,946,050,462,958,837,000
27.925373
82
0.54644
false
AVOXI/b2bua
sippy/SipTransactionManager.py
1
30074
# Copyright (c) 2003-2005 Maxim Sobolev. All rights reserved. # Copyright (c) 2006-2014 Sippy Software, Inc. All rights reserved. # # 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. Redistrib...
bsd-2-clause
6,950,058,240,984,168,000
38.675462
127
0.519785
false
dferens/django-angularmagic
angularmagic/base.py
1
1190
class Serializer(object): """ Converts complex objects such as querysets or model instances to native Python datatypes that can be converted to xml/json/anything later. Is a light wrapper of ``rest_framework.serializers.Serializer``. :param model: class if serializer is class-specific. :type m...
mit
8,314,070,814,512,707,000
20.25
77
0.590756
false
jamesblunt/psutil
psutil/_pslinux.py
1
45271
# Copyright (c) 2009, Giampaolo Rodola'. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """Linux platform implementation.""" from __future__ import division import base64 import errno import functools import os import re import socket import...
bsd-3-clause
3,847,961,493,654,271,000
36.321517
80
0.510216
false
adamgilman/tourbillon
tourbillon/streams.py
1
1427
from datetime import datetime from threading import Timer class TourbillonStream(object): def __init__(self, tb, stream_name): self.tb = tb self.r = self.tb.r self.stream_name = stream_name self.channel = None # self.message_queue self.halt_next = False self.seconds_delay = 1 def add(self, tick_tuple):...
mit
9,180,900,712,580,681,000
22.8
64
0.704275
false
cmos3511/cmos_linux
python/op/nop/core/report/report.py
1
5302
""" Generate report module of OnePiece Platform Usage: a) dic : 1. instantiation 2. call method: read_dic b) json : 1. instantiation 2. call method: read_json API: Input: gen_rpt_path gen_rpt_path: generate report path Ouput: 1) stdout: show the report o...
gpl-3.0
7,415,528,286,573,856,000
30.372781
89
0.50132
false
smart-cities/reading_aginova_sensors
scripts/parse_log.py
1
2425
#!/usr/bin/env python """Parse a log file and submit last values Parse a specified log file looking the most recent data being inserted to the 'NOVA_LASTDATA_T' table and submit this over http. MAX_BYTES is used to limit the volume of data that is read from the log file into memory. """ # beware this is horrible ha...
gpl-2.0
3,628,607,066,047,131,000
29.696203
109
0.602474
false
mablae/weblate
weblate/trans/south_migrations/0018_auto__add_field_change_translation.py
1
14751
# -*- coding: utf-8 -*- # # Copyright © 2012 - 2015 Michal Čihař <michal@cihar.com> # # This file is part of Weblate <http://weblate.org/> # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, eithe...
gpl-3.0
320,020,449,889,908,400
73.484848
182
0.550041
false
googleapis/api-client-staging
generated/python/googleapis-common-protos/google/api/source_info_pb2.py
1
2577
# -*- coding: utf-8 -*- # Generated by the protocol buffer compiler. DO NOT EDIT! # source: google/api/source_info.proto import sys _b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1')) from google.protobuf import descriptor as _descriptor from google.protobuf import message as _message from goog...
bsd-3-clause
3,272,847,479,109,776,400
33.824324
339
0.742336
false
google-research/language
language/capwap/utils/text_utils.py
1
11097
# coding=utf-8 # Copyright 2018 The Google AI Language Team Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by ...
apache-2.0
-2,312,943,053,695,171,000
30.796562
80
0.635217
false
haisland0909/Denoising-Dirty-Documents
script/prediction.py
1
5057
# coding: UTF8 from sklearn.pipeline import FeatureUnion from sklearn.grid_search import GridSearchCV from sklearn import preprocessing from sklearn.ensemble import GradientBoostingRegressor, RandomForestRegressor import sklearn.linear_model import img_to_pickle as i_p import features as f import classify import prepr...
apache-2.0
-8,497,978,010,576,337,000
29.281437
98
0.58513
false
tgbugs/hypush
hyputils/memex/models/user.py
1
8621
# -*- coding: utf-8 -*- from __future__ import unicode_literals import datetime import re import sqlalchemy as sa from sqlalchemy.ext.hybrid import Comparator, hybrid_property from sqlalchemy.ext.declarative import declared_attr from hyputils.memex._compat import string_types from hyputils.memex.db import Base from ...
mit
-137,838,271,922,611,360
30.122744
88
0.609094
false