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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
tijko/Project-Euler | py_solutions_81-90/Euler_83.py | 1 | 3306 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
'''
Minimal path in a 80x80 matrix, from top left node to bottom right node.
Moving up, down, left, or right directions.
'''
from __future__ import print_function
import timeit
import os
try:
range = xrange
except NameError:
pass
path = os.getcwd().strip('py_... | mit | -351,287,273,247,766,900 | 25.238095 | 72 | 0.503327 | false | 2.780488 | false | false | false |
tsheets/api_python | tsheets/rest_adapter.py | 1 | 2352 | from . import error
import logging
import requests
class RestAdapter(object):
def __init__(self):
self.logger = logging.getLogger('tsheets_logger')
def get(self, url, params, headers):
self.logger.debug("GET {} {} {}".format(url, params, headers))
response = None
try:
... | mit | -1,571,255,879,130,527,200 | 38.881356 | 91 | 0.58716 | false | 4.363636 | false | false | false |
nathanbjenx/cairis | cairis/gui/DictionaryEntryDialog.py | 1 | 2956 | # 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... | apache-2.0 | -2,763,793,593,359,944,700 | 40.055556 | 170 | 0.732747 | false | 3.514863 | false | false | false |
yowmamasita/social-listener-exam | ferris/core/oauth2/user_credentials.py | 1 | 2290 | """
OAuth dance session
"""
from google.appengine.ext import ndb
from ferris.core.ndb import Model
from credentials_property import CredentialsProperty
from ndb_storage import NdbStorage
import hashlib
class UserCredentials(Model):
user = ndb.UserProperty(indexed=True)
scopes = ndb.StringProperty(repeated=T... | mit | 1,136,767,489,607,611,600 | 29.945946 | 92 | 0.619214 | false | 3.874788 | false | false | false |
wxgeo/geophar | wxgeometrie/param/options.py | 1 | 4911 | # -*- coding: utf-8 -*-
# WxGeometrie
# Dynamic geometry, graph plotter, and more for french mathematic teachers.
# Copyright (C) 2005-2013 Nicolas Pourcelot
#
# 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
#... | gpl-2.0 | 6,670,033,521,094,492,000 | 31.744966 | 112 | 0.64296 | false | 3.087975 | false | false | false |
Azure/azure-sdk-for-python | sdk/datalake/azure-mgmt-datalake-analytics/azure/mgmt/datalake/analytics/catalog/models/usql_table.py | 1 | 3104 | # 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 | -7,905,476,458,018,455,000 | 45.328358 | 89 | 0.632088 | false | 3.894605 | false | false | false |
sagiss/sardana | src/sardana/macroserver/macros/env.py | 1 | 11795 | ##############################################################################
##
## This file is part of Sardana
##
## http://www.sardana-controls.org/
##
## Copyright 2011 CELLS / ALBA Synchrotron, Bellaterra, Spain
##
## Sardana is free software: you can redistribute it and/or modify
## it under the terms of the GN... | lgpl-3.0 | -1,919,864,048,921,423,600 | 39.954861 | 129 | 0.527596 | false | 4.17966 | false | false | false |
thaihungle/deepexp | meta_mann/run_mimic.py | 1 | 7331 | import os
os.environ['TF_CPP_MIN_LOG_LEVEL'] = '3' # No logging TF
import tensorflow as tf
import numpy as np
import time
import sys
from mann import memory_augmented_neural_network
from Utils.mimic_gen import MimicGenerator
from Utils.Metrics import accuracy_instance2
from Utils import label_encoder as le
NUM_GPU=... | mit | -2,511,329,116,676,375,600 | 41.871345 | 171 | 0.56718 | false | 3.514382 | false | false | false |
timothyclemansinsea/smc | src/smc_sagews/smc_sagews/sage_server.py | 1 | 74536 | #!/usr/bin/env python
"""
sage_server.py -- unencrypted forking TCP server.
Note: I wrote functionality so this can run as root, create accounts on the fly,
and serve sage as those accounts. Doing this is horrendous from a security point of
view, and I'm definitely not doing this. None of that functionality is actua... | gpl-3.0 | -7,304,380,971,359,334,000 | 38.188223 | 247 | 0.563432 | false | 3.967635 | false | false | false |
valhallasw/gerrit-reviewer-bot | pop3bot.py | 1 | 4056 | import sys
import poplib
import email.parser
import logging
import traceback
from email.message import Message
from typing import Iterable, Dict, Tuple
import gerrit_rest
from add_reviewer import ReviewerFactory, add_reviewers
logger = logging.getLogger('pop3bot')
def mkmailbox(debug=0):
import config
usern... | mit | 453,748,591,061,692,100 | 30.2 | 115 | 0.603797 | false | 3.797753 | false | false | false |
ip-tools/ip-navigator | patzilla/util/image/convert.py | 1 | 11407 | # -*- coding: utf-8 -*-
# (c) 2011-2018 Andreas Motl <andreas.motl@ip-tools.org>
import os
import where
import logging
import datetime
import StringIO
import subprocess
from six import BytesIO
from tempfile import NamedTemporaryFile
from cornice.util import to_list
from patzilla.util.python.decorators import memoize
fr... | agpl-3.0 | 3,111,559,247,840,244,700 | 25.589744 | 290 | 0.621899 | false | 3.725343 | false | false | false |
rchui/pyql | Data/tablelib.py | 1 | 2538 | """ tablelib.py
This file defines functions for getting table information.
"""
import csv
import collections
def load_indexes(froms, tables, indexes):
""" Load indexes into memory.
Args:
froms: tables to query
tables: tables in the database
indexes: indexes in the database
R... | mit | -1,861,673,768,422,208,800 | 27.2 | 88 | 0.568558 | false | 4.222962 | false | false | false |
MalloyPower/parsing-python | front-end/testsuite-python-lib/Python-3.0/Lib/multiprocessing/sharedctypes.py | 1 | 5791 | #
# Module which supports allocation of ctypes objects from shared memory
#
# multiprocessing/sharedctypes.py
#
# Copyright (c) 2007-2008, R Oudkerk --- see COPYING.txt
#
import sys
import ctypes
import weakref
from multiprocessing import heap, RLock
from multiprocessing.forking import assert_spawning, ForkingPickler... | mit | 8,941,750,916,456,261,000 | 24.28821 | 84 | 0.604731 | false | 3.518226 | false | false | false |
igemsoftware2017/USTC-Software-2017 | biohub/abacus/handlers.py | 1 | 2160 | from django.urls import reverse
from rest_framework.exceptions import ValidationError
from biohub.abacus.result import AbacusAsyncResult
from . import consts, remote
class BaseHandler(object):
"""
Abstract task handler to adjust different environments.
"""
def __init__(self, request):
self._... | gpl-3.0 | 4,481,847,299,378,128,000 | 23.269663 | 75 | 0.636111 | false | 3.809524 | false | false | false |
AutorestCI/azure-sdk-for-python | azure-mgmt-datafactory/azure/mgmt/datafactory/models/azure_sql_dw_table_dataset.py | 1 | 2622 | # 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 | -80,414,696,839,832,960 | 44.206897 | 207 | 0.647979 | false | 4.37 | false | false | false |
sadad111/leetcodebox | Add One Row to Tree.py | 1 | 1410 | # /**
# * Definition for a binary tree node.
# * public class TreeNode {
# * int val;
# * TreeNode left;
# * TreeNode right;
# * TreeNode(int x) { val = x; }
# * }
# */
# public class Solution {
# public TreeNode addOneRow(TreeNode root, int v, int d) {
# if (d < 2) {
# T... | gpl-3.0 | -473,034,887,660,258,100 | 29.652174 | 81 | 0.506383 | false | 3.133333 | false | false | false |
IEEERobotics/high-level | qwe/vision/preprocessing.py | 1 | 10109 | """Image preprocessing tools."""
from math import sqrt, hypot
import numpy as np
import cv2
from time import sleep
from util import Enum
from base import FrameProcessor
from main import main
import commands
from colorfilter import HSVFilter
blueFilter = HSVFilter(np.array([108, 70, 75], np.uint8), np.array([122, 255,... | bsd-2-clause | -4,807,171,542,224,210,000 | 43.144105 | 206 | 0.659017 | false | 3.292834 | false | false | false |
OrhanOdabasi/PixPack | pixpack/grouping.py | 1 | 1317 | #!/usr/bin/env python3
# grouping algorithms for images and videos
# PixPack Photo Organiser
import re
import os
def group_by_dates(date_meta, destination, pattern='ym'):
# generate folder name by using basic date informations
# available patterns: yr=2017, ym=2017-03, ss=summer
# exif date format -> 2006... | mit | 725,687,555,921,782,800 | 35.583333 | 88 | 0.593774 | false | 3.091549 | false | false | false |
listen-lavender/dbskit | dbskit/util.py | 1 | 4457 | #!/usr/bin/env python
# coding=utf-8
def explain(desc):
d = {'$gt':' > ',
'$lt':' < ',
'$gte':' >= ',
'$lte':' <= ',
'$ne':' <> ',
'$in':' in ',
'$nin':' not in ',
'$or':' or ',
'$and':' and ',
'':' and ',
'$regex': ' like ',
'... | mit | -908,718,480,701,097,600 | 32.044776 | 102 | 0.429185 | false | 4.277295 | false | false | false |
rndusr/stig | stig/client/aiotransmission/api_freespace.py | 1 | 1084 | # 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 option) any later version.
#
# This program is distributed in the hope that it will be useful
# but... | gpl-3.0 | 4,059,348,513,064,097,000 | 40.692308 | 85 | 0.699262 | false | 3.970696 | false | false | false |
pystockhub/book | ch14/03.py | 1 | 1207 | import pandas_datareader.data as web
import datetime
import matplotlib.pyplot as plt
from zipline.api import order_target, record, symbol
from zipline.algorithm import TradingAlgorithm
start = datetime.datetime(2010, 1, 1)
end = datetime.datetime(2016, 3, 29)
data = web.DataReader("AAPL", "yahoo", start, end)
#plt.pl... | mit | 1,628,635,634,769,601,800 | 24.166667 | 71 | 0.683513 | false | 2.915459 | false | false | false |
martinrusev/amonone | amon/apps/account/forms.py | 1 | 6546 | from django import forms
from django.contrib.auth import authenticate
from django.conf import settings
from django.contrib.auth import get_user_model
from amon.apps.notifications.models import notifications_model
from amon.apps.alerts.models import alerts_model
from amon.apps.account.models import user_preferences_mod... | mit | 1,838,512,091,177,338,400 | 29.882075 | 128 | 0.641002 | false | 4.143038 | false | false | false |
hpcuantwerpen/easybuild-easyblocks | easybuild/easyblocks/t/torchvision.py | 1 | 2524 | ##
# Copyright 2021-2021 Ghent University
#
# This file is part of EasyBuild,
# originally created by the HPC team of Ghent University (http://ugent.be/hpc/en),
# with support of Ghent University (http://ugent.be/hpc),
# the Flemish Supercomputer Centre (VSC) (https://www.vscentrum.be),
# Flemish Research Foundation (F... | gpl-2.0 | 7,378,695,513,344,649,000 | 39.063492 | 104 | 0.709984 | false | 3.631655 | false | false | false |
lssfau/walberla | tests/lbm/codegen/LbCodeGenerationExample.py | 1 | 2336 | import sympy as sp
import pystencils as ps
from lbmpy.creationfunctions import create_lb_collision_rule
from lbmpy.boundaries import NoSlip, UBB
from pystencils_walberla import CodeGeneration
from lbmpy_walberla import RefinementScaling, generate_boundary, generate_lattice_model
with CodeGeneration() as ctx:
omega... | gpl-3.0 | 1,046,695,366,246,672,600 | 62.135135 | 115 | 0.690068 | false | 4.055556 | false | false | false |
Azure/azure-sdk-for-python | sdk/translation/azure-ai-translation-document/tests/testcase.py | 1 | 13689 | # coding=utf-8
# ------------------------------------
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.
# ------------------------------------
import os
import time
import datetime
import uuid
from devtools_testutils import (
AzureTestCase,
)
from azure_devtools.scenario_tests import (
R... | mit | 109,761,422,991,520,050 | 42.182965 | 176 | 0.628972 | false | 4.381882 | true | false | false |
waidyanatha/sambro-eden | private/templates/default/my-remover/config.py | 2 | 36031 | # -*- coding: utf-8 -*-
try:
# Python 2.7
from collections import OrderedDict
except:
# Python 2.6
from gluon.contrib.simplejson.ordered_dict import OrderedDict
from gluon import current
from gluon.storage import Storage
T = current.T
settings = current.deployment_settings
"""
Template settings
... | mit | -4,464,261,208,661,015,600 | 40.248853 | 155 | 0.66232 | false | 3.722728 | false | false | false |
olav-st/screencloud | res/modules/ScreenCloud.py | 1 | 1650 | from PythonQt.QtCore import QSettings
from PythonQt.QtGui import QDesktopServices
import os, string, base64
try:
from md5 import md5
except ImportError:
from hashlib import md5 #md5 has been moved to hashlib in python 3
from random import randint
from collections import defaultdict
from time import strftime, localtim... | gpl-2.0 | -3,575,533,716,724,261,000 | 29.555556 | 89 | 0.761212 | false | 3.395062 | false | false | false |
igor-toga/local-snat | neutron/tests/tempest/api/test_subnetpools.py | 1 | 17261 | # Copyright 2015 Hewlett-Packard Development Company, L.P.
# 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... | apache-2.0 | -3,469,962,308,355,516,400 | 43.033163 | 79 | 0.636116 | false | 3.590058 | true | false | false |
gimli-org/gimli | pygimli/physics/SIP/plotting.py | 1 | 2358 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Spectral induced polarization (SIP) plotting tools"""
import matplotlib.pyplot as plt
import pygimli as pg
def showAmplitudeSpectrum(*args, **kwargs):
pg.deprecated('drawAmplitudeSpectrum')
return drawAmplitudeSpectrum(*args, **kwargs)
def showPhaseSpectrum... | apache-2.0 | 1,425,055,818,539,367,400 | 27.756098 | 73 | 0.59754 | false | 3.182186 | false | false | false |
shanet/Cryptully | src/ncurses/cursesDialog.py | 1 | 2412 | import curses
class CursesDialog:
def __init__(self, screen, message, title="", isError=False, isFatal=False, isBlocking=False):
self.screen = screen
self.title = title
self.message = message
self.isError = isError
self.isFatal = isFatal
self.isBlocking = i... | lgpl-3.0 | 5,121,583,365,409,258,000 | 31.16 | 135 | 0.584163 | false | 4.060606 | false | false | false |
pikuli-project/pikuli | pikuli/BaseRegion.py | 1 | 9760 | # -*- coding: utf-8 -*-
"""
BaseRegion - rectangle screen area defines with top-left corner coordinates, width and height.
BaseRegion don't have any information in visual content on screen.
Content can be defined using .find() or .findAll() methods, implemented in the descendant class
"""
import cv2... | mit | -2,893,188,896,494,906,000 | 37.506073 | 115 | 0.508711 | false | 3.735835 | false | false | false |
bogdanbabych/morphosyntax | src/s010cognatematch/md060graphonoLevV09.py | 1 | 9494 | '''
Created on 25 Mar 2016
@author: bogdan
python3 required for operation -- due to Unicode issues
v09: returning different insertion costs for graphonological distance
'''
import sys, re, os
import copy
# from p010graphems.levenshtein import levenshtein
from collections import defaultdict
from collections import Cou... | apache-2.0 | 137,749,909,859,321,440 | 33.527273 | 289 | 0.662313 | false | 2.533084 | false | false | false |
adriank/ObjectPath | objectpath/core/parser.py | 1 | 10901 | #!/usr/bin/env python
# This file is part of ObjectPath released under MIT license.
# Copyright (C) 2010-2014 Adrian Kalbarczyk
# Code from http://effbot.org/zone/simple-top-down-parsing.htm was used in this file.
# Licence of the code is public domain.
# Relicenced to AGPL v3 by Adrian Kalbarczyk and:
# - specialize... | mit | 6,232,478,799,201,184,000 | 21.111562 | 85 | 0.563159 | false | 3.199589 | false | false | false |
lafactura/datea-api | datea_api/apps/api/resources.py | 1 | 7475 | from api.base_resources import JSONDefaultMixin
from tastypie.resources import Resource
from tastypie.cache import SimpleCache
from api.cache import SimpleDictCache
from tastypie.throttle import CacheThrottle
from tastypie.utils import trailing_slash
from django.conf.urls import url
from datea_api.utils import remove_a... | agpl-3.0 | 835,086,416,194,976,900 | 35.286408 | 123 | 0.587291 | false | 3.775253 | false | false | false |
Hybrid-Cloud/conveyor | conveyor/conveyorheat/engine/resources/aws/ec2/internet_gateway.py | 1 | 4464 | #
# 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
# ... | apache-2.0 | -594,445,450,825,484,400 | 31.583942 | 78 | 0.59095 | false | 4.195489 | false | false | false |
richrd/bx | modules/status.py | 1 | 3018 | # -*- coding: utf-8 -*-
from mod_base import *
class Status(Command):
"""Get status information of the host running the bot."""
def run(self, win, user, data, caller=None):
items = self.get_items()
strs = []
for item in items:
strs.append( item[0]+":"+str(item[1]) )
... | apache-2.0 | 9,010,237,796,635,369,000 | 27.196262 | 86 | 0.476964 | false | 3.814159 | false | false | false |
stregoika/aislib | scripts/nais2postgis.py | 1 | 28342 | #!/usr/bin/env python
__author__ = 'Kurt Schwehr'
__version__ = '$Revision: 2275 $'.split()[1]
__revision__ = __version__ # For pylint
__date__ = '$Date: 2006-07-10 16:22:35 -0400 (Mon, 10 Jul 2006) $'.split()[1]
__copyright__ = '2008'
__license__ = 'GPL v3'
__contact__ = 'kurt at ccom.unh.edu'
__doc__='''
Connec... | gpl-3.0 | -1,894,013,927,633,651,700 | 43.562893 | 330 | 0.550526 | false | 3.588503 | false | false | false |
cosurgi/trunk | examples/Lubrication/SimpleShear_lubrication.py | 1 | 5734 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# This script perform a simple shear experiment with lubrication law.
# It shows the use of
# - Lubrication law
# - PDFEngine
# - VTK Lubrication recorder
from yade import pack,ymport,export,geom,bodiesHandling, plot
import math
import pylab
#from yade import qt
import numpy ... | gpl-2.0 | 5,506,279,512,304,312,000 | 33.751515 | 163 | 0.595745 | false | 3.154015 | false | false | false |
larsbergstrom/servo | python/servo/package_commands.py | 1 | 31921 | # Copyright 2013 The Servo Project Developers. See the COPYRIGHT
# file at the top-level directory of this distribution.
#
# Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
# http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
# <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
#... | mpl-2.0 | -4,604,749,228,839,000,600 | 40.135309 | 120 | 0.550327 | false | 4.045754 | false | false | false |
wkschwartz/django | django/utils/crypto.py | 1 | 3139 | """
Django's standard crypto functions and utilities.
"""
import hashlib
import hmac
import secrets
import warnings
from django.conf import settings
from django.utils.deprecation import RemovedInDjango40Warning
from django.utils.encoding import force_bytes
class InvalidAlgorithm(ValueError):
"""Algorithm is not ... | bsd-3-clause | 7,145,878,690,771,512,000 | 35.08046 | 86 | 0.697674 | false | 4.055556 | false | false | false |
Yelp/pootle | pootle/apps/pootle_store/views.py | 1 | 37944 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright (C) Pootle contributors.
#
# This file is a part of the Pootle project. It is distributed under the GPL3
# or later license. See the LICENSE file for a copy of the license and the
# AUTHORS file for copyright and authorship information.
from itertools import ... | gpl-3.0 | -2,427,599,192,403,181,000 | 35.171592 | 114 | 0.594402 | false | 4.209919 | false | false | false |
mardiros/creds | setup.py | 1 | 1560 | import os
import sys
from setuptools import setup, find_packages
py_version = sys.version_info[:2]
if py_version < (3, 3):
raise Exception("websockets requires Python >= 3.3.")
here = os.path.abspath(os.path.dirname(__file__))
NAME = 'creds'
with open(os.path.join(here, 'README.rst')) as readme:
README = re... | bsd-3-clause | 1,508,821,387,034,841,300 | 25 | 63 | 0.589103 | false | 3.451327 | false | true | false |
mjiang-27/django_learn | admin_advanced/app/admin.py | 1 | 2217 | from django.contrib import admin
# Register your models here.
from .models import Article, Person
'''
Class used to show other related fields in Article
'''
class ArticleAdmin(admin.ModelAdmin):
list_display = ('title', 'pub_date', 'mod_date', )
'''
used to split forms into several sets
'''
field... | gpl-3.0 | 7,187,291,948,035,659,000 | 27.063291 | 105 | 0.609833 | false | 3.937833 | false | false | false |
danielhers/ucca | scripts/set_external_id_offline.py | 1 | 1091 | #!/usr/bin/env python3
import argparse
import os
import sys
from ucca.ioutil import get_passages_with_progress_bar, write_passage
desc = """Rename passages by a given mapping of IDs"""
def main(filename, input_filenames, outdir):
os.makedirs(outdir, exist_ok=True)
with open(filename, encoding="utf-8") as f:... | gpl-3.0 | -6,168,660,805,610,533,000 | 39.407407 | 109 | 0.690192 | false | 3.420063 | false | false | false |
zachmueller/charts | python/sweet_charts.py | 1 | 2782 | from pandas_datareader import data as pdr
import datetime
import pandas as pd
import numpy as np
def download_data(ticker, start = datetime.datetime(1950, 1, 1),
end = datetime.datetime.today(),
source = 'yahoo', drop_extra = True):
# may need to use this for weekly data
#... | apache-2.0 | -1,158,044,879,565,456,600 | 31.729412 | 73 | 0.586628 | false | 3.468828 | false | false | false |
poodarchu/SogouPersona | outputResult.py | 1 | 1060 | # -*- coding=utf-8 -*-
import codecs
if __name__ == '__main__':
UID = []
with codecs.open('./data/test.csv', 'r', 'utf-8') as fr:
for user in fr.readlines():
user = user.split('\t')
UID.append(user[0])
fr.close()
ages = []
with codecs.open('./data/output/0_pre... | mit | -4,194,074,875,685,905,400 | 28.444444 | 87 | 0.521698 | false | 3.126844 | false | false | false |
20017578/MasterSoftwareLibero | ProvePython/Trasparenza/XX_leggi_config.py | 1 | 1265 | # Legge il file di configurazione per produrre il lod
# import urllib
import sys
import csv
import string
try:
file_csv_config_main = open ('campi_config.csv')
except:
print 'File non trovato, provo da rete.'
def_campi=[]
# LEGGIAMO IL FILE CON IL NOME DEI TIPI DI CAMPO (Attenzione le prime 10 righe descriv... | agpl-3.0 | -1,256,895,054,665,019,400 | 25.354167 | 112 | 0.612648 | false | 2.646444 | true | false | false |
bhaveshAn/crisscross | crisscross/facades/compass.py | 1 | 1269 | '''
Compass
=======
The :class:`Compass` provides access to public methods to use compass of your
device.
Simple Examples
---------------
To enable compass::
>>> from crisscross import compass
>>> compass.enable()
To disable compass::
>>> compass.disable()
To get the orientation::
>>> compass.or... | mit | -8,531,520,257,634,616,000 | 17.940299 | 77 | 0.588652 | false | 4.054313 | false | false | false |
jrief/django-shop | shop/models/address.py | 1 | 10316 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
"""
Holds all the information relevant to the client (addresses for instance)
"""
from six import with_metaclass
from django.conf import settings
from django.db import models
from django.template import Context
from django.template.loader import select_te... | bsd-3-clause | 3,705,730,101,055,474,000 | 28.815029 | 94 | 0.477995 | false | 3.10349 | false | false | false |
dkdeconti/DFCI-CCCB-GATK-Cloud-pipeline | archive/Preprocessing/map_TSV.py | 1 | 1467 | #!/usr/bin/python
import sys
from collections import defaultdict
def read_tsv_as_array(filename):
'''
Converts 2 column tsv to array.
First column is samplename.
Second column is location of file.
'''
tsv_array = []
with open(filename, 'rU') as handle:
for line in handle:
... | bsd-2-clause | 774,471,899,134,565,600 | 22.66129 | 74 | 0.601227 | false | 3.492857 | false | false | false |
naresh21/synergetics-edx-platform | openedx/core/djangoapps/micro_masters/views.py | 1 | 43485 | import json
import uuid
import hmac
import logging
import binascii
import urllib
import pytz
from collections import OrderedDict
from datetime import datetime
from hashlib import sha256
from decimal import Decimal, InvalidOperation
from django.db.models import Q
from django.utils.encoding import smart_str
from django.... | agpl-3.0 | 8,344,092,858,772,803,000 | 37.93017 | 201 | 0.633552 | false | 4.252812 | true | false | false |
tleonardi/bedparse | bedparse/bedparse.py | 1 | 15785 | #!/usr/bin/python3
import signal
import argparse
import sys
import csv
import re
from pkg_resources import get_distribution
from bedparse import bedline
from bedparse import gtf2bed
from bedparse import BEDexception
# This allows using the program in a pipe
# The program is killed when it receives a sigpipe
signal.sign... | mit | 3,832,478,660,521,857,000 | 61.391304 | 307 | 0.669876 | false | 3.736979 | false | false | false |
istresearch/scrapy-cluster | redis-monitor/plugins/expire_monitor.py | 1 | 2208 | from __future__ import absolute_import
from .stop_monitor import StopMonitor
class ExpireMonitor(StopMonitor):
'''
Monitors for expiring crawls
'''
regex = "timeout:*:*:*"
def setup(self, settings):
'''
Setup kafka
'''
StopMonitor.setup(self, settings)
def ch... | mit | -1,714,228,095,611,840,500 | 29.666667 | 71 | 0.552083 | false | 4.189753 | false | false | false |
xiaoda99/keras | examples/trading/ifshort_mlp.py | 1 | 2386 | from __future__ import absolute_import
from __future__ import print_function
import numpy as np
np.random.seed(1337) # for reproducibility
#from keras.datasets import mnist
from keras.models_xd import Sequential
from keras.layers.core import Dense, Dropout, Activation
from keras.optimizers import SGD, Adam, RMSprop
f... | mit | 947,155,060,810,931,500 | 38.766667 | 123 | 0.630763 | false | 3.14361 | true | false | false |
onshape-public/onshape-clients | python/onshape_client/oas/models/bt_string_format_block_pattern1755.py | 1 | 7539 | # coding: utf-8
"""
Onshape REST API
The Onshape REST API consumed by all clients. # noqa: E501
The version of the OpenAPI document: 1.113
Contact: api-support@onshape.zendesk.com
Generated by: https://openapi-generator.tech
"""
from __future__ import absolute_import
import re # noqa: F401
im... | mit | -3,901,745,233,082,738,000 | 35.77561 | 105 | 0.593845 | false | 4.162893 | true | false | false |
after1990s/little_utils | CodeGenerator/codegen.py | 1 | 1466 | # -*- coding: utf-8 -*-
#!/bin/python
def codegen(paratype, paraname):
string_code_raw = '''
private {0} m_{1};
public {0} {1}
{{
get
{{
return m_{1};
}}
set
{{
m_{1} = value;
if (PropertyC... | apache-2.0 | -2,745,543,578,551,633,000 | 27.192308 | 86 | 0.519782 | false | 3.393519 | false | false | false |
Lvadislav/russian-speech-site | speech/forms.py | 1 | 1179 | from django import forms
from speech.models import Feedback
from speech import config
ERROR_MESSAGES = {
'required': 'Это поле обязательно к заполнению.',
'max_length': 'Слишкое длинное значение.',
'min_length': 'Слишком короткое значение.',
'invalid': 'Некорректное значение.',
}
class FeedbackFor... | mit | -6,923,204,756,651,097,000 | 22.688889 | 75 | 0.630394 | false | 2.912568 | false | false | false |
ielia/prtg-py | prtg/cache.py | 1 | 4288 | # -*- coding: utf-8 -*-
"""
Python library for Paessler's PRTG (http://www.paessler.com/)
"""
import atexit
import logging
import os
import shelve
import tempfile
from prtg.exceptions import UnknownObjectType
from prtg.models import CONTENT_TYPE_ALL, PrtgObject
class Cache(object):
"""
Cache of prtg.models.... | mit | -9,151,001,026,375,969,000 | 37.981818 | 117 | 0.595149 | false | 4.279441 | false | false | false |
xyos/horarios | horarios/settings.py | 1 | 4461 | import os
# Django settings for horarios project.
DEBUG = True
TEMPLATE_DEBUG = DEBUG
PROJECT_PATH = os.path.realpath(os.path.dirname(__file__))
DEPLOY_SCRIPT = "echo 0> /dev/null"
DAO_FACTORY = 'factories.MixedFactory' # or factories.SiaFactory , factories.LocalFactory
DATABASES = {
'default': {
'ENGINE'... | mit | -6,325,953,530,759,111,000 | 33.851563 | 108 | 0.72876 | false | 3.623883 | false | false | false |
hjanime/VisTrails | vistrails/packages/vtk/init.py | 1 | 31387 | ###############################################################################
##
## Copyright (C) 2014-2015, New York University.
## Copyright (C) 2011-2014, NYU-Poly.
## Copyright (C) 2006-2011, University of Utah.
## All rights reserved.
## Contact: contact@vistrails.org
##
## This file is part of VisTrails.
##
## ... | bsd-3-clause | 7,075,514,750,648,230,000 | 43.647226 | 109 | 0.5465 | false | 4.27849 | true | false | false |
cxxgtxy/tensorflow | tensorflow/python/training/basic_session_run_hooks.py | 1 | 25214 | # Copyright 2016 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | apache-2.0 | -4,970,458,662,585,084,000 | 34.866287 | 83 | 0.662965 | false | 3.864807 | false | false | false |
ddutta/savanna | savanna/service/api.py | 1 | 7957 | # Copyright (c) 2013 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 | 9,215,404,232,533,538,000 | 28.913534 | 79 | 0.612919 | false | 3.660074 | false | false | false |
kevkruemp/HRI_Plant_Monitor | motor_control.py | 1 | 1610 | # pypot dynamixel library
import pypot.dynamixel as pd
# threading for motor control
import threading
import time
import numpy as np
# get ports
# USB2AX will be the first result
ports = pd.get_available_ports()
# connect to port
motors = pd.DxlIO(ports[0], 1000000)
# get list of motors
print 'Scanning for motors...'... | mit | -1,964,310,526,230,350,600 | 28.272727 | 58 | 0.612422 | false | 3.305955 | false | false | false |
lethaljd/trical | trical.py | 1 | 2505 | """
A simple program to write an iCal file to create a calendar for the Low Volume Base
Training Plan for trainerroad.com
-Justin Deardorff 2015
"""
import re
import datetime
from datetime import timedelta
#defining iCal pieces for header, footer, and events
header = ["BEGIN:VCALENDAR\n",
"VERSION:2.0\n",
"X-WR-CA... | gpl-2.0 | -15,695,206,011,885,322 | 23.558824 | 96 | 0.720958 | false | 3.084975 | false | false | false |
spapas/auditing-sample | sample/migrations/0001_initial.py | 1 | 1110 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
from django.conf import settings
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
]
operations = [
migrations.Create... | unlicense | -3,547,652,464,458,262,000 | 34.806452 | 114 | 0.574775 | false | 4.269231 | false | false | false |
marchaos/plugin.image.flickr | default.py | 1 | 41121 | #!/usr/bin/python
import flickrapi
import urllib
import xbmc, xbmcgui, xbmcplugin, xbmcaddon #@UnresolvedImport
import sys, os, time
from urllib2 import HTTPError, URLError
__plugin__ = 'flickr'
__author__ = 'ruuk'
__url__ = 'http://code.google.com/p/flickrxbmc/'
__date__ = '01-07-2013'
__settings__ = xbmcaddon.Addon... | gpl-2.0 | 8,714,209,520,837,399,000 | 37.110287 | 523 | 0.678461 | false | 2.838476 | false | false | false |
i32ropie/lol | plugins/ban.py | 1 | 3887 | # -*- coding: utf-8 -*-
from config import *
print(Color(
'{autored}[{/red}{autoyellow}+{/yellow}{autored}]{/red} {autocyan} ban.py importado.{/cyan}'))
@bot.message_handler(commands=['ban'])
def command_ban(m):
cid = m.chat.id
uid = m.from_user.id
date = m.date
if not is_recent(m):
ret... | gpl-2.0 | 3,995,733,429,601,955,000 | 33.096491 | 99 | 0.434268 | false | 3.825787 | false | false | false |
cpennington/edx-platform | lms/djangoapps/discussion/django_comment_client/tests/test_utils.py | 1 | 79774 | # pylint: skip-file
# -*- coding: utf-8 -*-
import datetime
import json
import ddt
import mock
import six
from django.test import RequestFactory, TestCase
from django.urls import reverse
from edx_django_utils.cache import RequestCache
from mock import Mock, patch
from pytz import UTC
from six import text_type
impor... | agpl-3.0 | 5,630,224,446,512,090,000 | 41.95315 | 143 | 0.526102 | false | 4.62025 | true | false | false |
ericbulloch/authorize | authorize/tests/test_api.py | 1 | 2400 | from unittest import TestCase
from authorize import gen_xml as x, responses, cim, arb, aim
class TestAPIUsage(TestCase):
def test_aim_calls(self):
"""
Test that the API calls using AIM are made with the correct parameters.
"""
api = aim.Api(login=u"ciao", key=u"handsome", do_raise=... | mit | 4,731,461,782,902,302,000 | 59 | 544 | 0.593333 | false | 2.61723 | true | false | false |
srfraser/services | src/releng_notification_identity/releng_notification_identity/api.py | 1 | 5815 | # -*- coding: utf-8 -*-
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
from __future__ import absolute_import
from flask import current_app
from typing import List
fro... | mpl-2.0 | 5,147,447,050,764,588,000 | 35.118012 | 117 | 0.66638 | false | 4.210717 | false | false | false |
joshsomma/rice_python_1 | format_time.py | 1 | 1071 | # Testing template for format function in "Stopwatch - The game"
###################################################
# Student should add code for the format function here
#desired format
def format(t):
total = ""
#calc minutes
a = t // 600
#calc first part of seconds
b = ((t // 10) % 60) // 10
... | apache-2.0 | -5,548,721,088,610,052,000 | 18.125 | 64 | 0.544351 | false | 3.068768 | false | false | false |
Rookfighter/TextAdventure | ActionSystem.py | 1 | 4765 | from EventSystem import Event
import utils
class ActionSystem:
def __init__(self, player, rooms, tuiSystem, eventQueue):
self.__player = player
self.__rooms = rooms
self.__tuiSystem = tuiSystem
self.__eventQueue = eventQueue
# a mapping for input actions to functions
... | mit | 7,252,749,800,623,843,000 | 29.748387 | 87 | 0.557188 | false | 4.312217 | false | false | false |
tomacorp/thermapythia | thermpy/saddle.py | 1 | 8354 | #!/Users/toma/python278i/bin/python
# Tom Anderson
# Thermal simulation prototype
# Sun Jul 13 22:30:26 PDT 2014
#
# Thermonous pertains to stimulation by heat.
# The literal ancient Greek is hot minded.
# If you need a name for it, "ephippion" is the ancient Greek word for saddle blanket
# and in Latin is "ephippia". ... | bsd-3-clause | -276,685,447,021,229,220 | 31.007663 | 93 | 0.698109 | false | 2.904729 | false | false | false |
noba3/KoTos | addons/plugin.video.movie25/resources/libs/live/ibrod.py | 1 | 5370 | import urllib,urllib2,re,cookielib,sys,os
import xbmc, xbmcgui, xbmcaddon, xbmcplugin
from resources.libs import main
#Mash Up - by Mash2k3 2012.
from t0mm0.common.addon import Addon
addon_id = 'plugin.video.movie25'
selfAddon = xbmcaddon.Addon(id=addon_id)
addon = Addon('plugin.video.movie25', sys.argv)
art = main.a... | gpl-2.0 | 5,477,519,663,359,080,000 | 93.210526 | 231 | 0.669088 | false | 2.847296 | false | false | false |
userzimmermann/robotframework-python3 | src/robot/output/stdoutlogsplitter.py | 1 | 2106 | # Copyright 2008-2014 Nokia Solutions and Networks
#
# 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 l... | apache-2.0 | 7,499,666,074,120,987,000 | 35.947368 | 80 | 0.622507 | false | 3.958647 | false | false | false |
janiskuehn/component-based-recognition | project/plot.py | 1 | 13515 | from mpl_toolkits.mplot3d import Axes3D
import matplotlib.pyplot as plt
import numpy as np
import matplotlib.ticker as tik
import os
from matplotlib import cm
from neural import NeuralState
def plot_weigth_matrix_bars(m: np.ndarray):
"""
Plot a weight matrix as 3d bar diagram
:param m: Weight matrix
:... | gpl-3.0 | 6,391,659,414,283,574,000 | 26.525458 | 119 | 0.550351 | false | 3.121968 | false | false | false |
maxcutler/Courant-News | courant/core/assets/management/commands/assets.py | 1 | 8722 | """Manage assets.
Usage:
./manage.py assets rebuild
Rebuild all known assets; this requires tracking to be enabled:
Only assets that have previously been built and tracked are
considered "known".
./manage.py assets rebuild --parse-templates
Try to find as many of... | bsd-3-clause | -7,455,010,411,454,960,000 | 41.178218 | 117 | 0.5446 | false | 4.771335 | false | false | false |
ve7cxz/PyAPRSd | aprs/packet.py | 1 | 8992 | #!/usr/bin/env python
import sys, re
# Packet class
class Packet(object):
def __init__(self):
# These data types are taken directly from the APRS spec at http://aprs.org/doc/APRS101.PDF
# This is not an exhaustive list. These are the most common ones, and were added during
# testing.
self._data_typ... | bsd-3-clause | -956,683,427,237,687,600 | 23.77135 | 214 | 0.597976 | false | 3.743547 | false | false | false |
peggyl/sodapy | sodapy/__init__.py | 1 | 9828 | from constants import MAX_LIMIT
from version import __version__, version_info
import requests
from cStringIO import StringIO
import csv
import json
__author__ = "Cristina Munoz <hi@xmunoz.com>"
class Socrata(object):
def __init__(self, domain, app_token, username=None, password=None,
access_tok... | mit | -3,261,599,665,507,649,000 | 38.629032 | 79 | 0.573972 | false | 4.624941 | false | false | false |
fluidinfo/fom | tests/_base.py | 1 | 1637 | # -*- coding: utf-8 -*-
"""
test_base
~~~~~~~~~
A way of faking out FluidDB in fom, for testing.
:copyright: (c) 2010 by AUTHOR.
:license: MIT, see LICENSE_FILE for more details.
"""
from collections import deque
from fom.db import FluidDB, _generate_endpoint_url, NO_CONTENT, FluidResponse
cl... | mit | 5,095,253,780,232,331,000 | 26.745763 | 79 | 0.607819 | false | 3.678652 | false | false | false |
Samnsparky/combinations_distance_summarizer | summarizer.py | 1 | 4757 | """Utility to find the combinations of words and return the average distance.
Utility program to find the combinations of words in a given list, the distances
between those combination pairs, and the average of those distances. The final
return value is that average.
@author: Ariel Aguilar, 2013
@author: Sam Pottinge... | mit | 859,668,767,277,711,400 | 30.091503 | 80 | 0.635695 | false | 4.014346 | false | false | false |
wwitzel3/awx | awx/main/management/commands/replay_job_events.py | 1 | 10556 | # Copyright (c) 2017 Ansible by Red Hat
# All Rights Reserved.
import sys
import time
import json
import random
from django.utils import timezone
from django.core.management.base import BaseCommand
from awx.main.models import (
UnifiedJob,
Job,
AdHocCommand,
ProjectUpdate,
InventoryUpdate,
Sy... | apache-2.0 | 3,277,444,997,338,887,700 | 39.290076 | 140 | 0.583081 | false | 4.0244 | false | false | false |
rainwoodman/fastpm-python | fastpm/force/lpt.py | 1 | 1947 | from . import kernels as FKN
import numpy
def lpt1(dlin_k, q, resampler='cic'):
""" Run first order LPT on linear density field, returns displacements of particles
reading out at q. The result has the same dtype as q.
"""
basepm = dlin_k.pm
ndim = len(basepm.Nmesh)
delta_k = basepm.create(... | gpl-3.0 | 85,663,300,217,380,750 | 28.059701 | 87 | 0.548023 | false | 2.954476 | false | false | false |
huogerac/cookiecutter-django-magic-content | {{cookiecutter.repo_name}}/{{cookiecutter.repo_name}}/apps/core/management/commands/backup_site.py | 1 | 1788 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from optparse import make_option
from fabric.colors import green
from django.core.management.base import BaseCommand
from magicbackup.helpers import MagicBackup
class Command(BaseCommand):
help = 'Backup a Site'
option_list = BaseCommand.opti... | bsd-3-clause | -5,535,139,425,958,014,000 | 35.489796 | 75 | 0.587248 | false | 4.425743 | false | false | false |
wxgeo/geophar | wxgeometrie/sympy/discrete/convolution.py | 2 | 7892 | """
Convolution (using FFT, NTT, FWHT), Subset Convolution,
Covering Product, Intersecting Product
"""
from __future__ import print_function, division
from sympy.core import S
from sympy.core.compatibility import range, as_int
from sympy.core.function import expand_mul
from sympy.discrete.transforms import (
fft, ... | gpl-2.0 | -200,314,091,119,685,950 | 28.33829 | 105 | 0.484161 | false | 3.531096 | false | false | false |
fernandog/Medusa | ext/sqlalchemy/dialects/sybase/pyodbc.py | 1 | 2102 | # sybase/pyodbc.py
# Copyright (C) 2005-2018 the SQLAlchemy authors and contributors
# <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php
"""
.. dialect:: sybase+pyodbc
:name: PyODBC
:dbapi: pyodbc
:connectstr... | gpl-3.0 | 1,979,549,040,717,915,400 | 23.44186 | 69 | 0.664129 | false | 4.057915 | false | false | false |
rtorres90/learning-python-package-system | packages/stores/migrations/0001_initial.py | 1 | 1458 | # -*- coding: utf-8 -*-
# Generated by Django 1.9.2 on 2016-02-13 02:07
from __future__ import unicode_literals
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
migration... | apache-2.0 | -387,377,259,657,424,900 | 32.136364 | 114 | 0.585734 | false | 4.313609 | false | false | false |
ac769/continuum_technologies | read_raw_sensor_data.py | 1 | 1150 | import numpy as np
from scipy.signal import butter, lfilter, freqz
import matplotlib.pyplot as plt
from clean_bad_trace import clean_bad_trace
file = open("processing/save_to_file/data.txt")
trace = file.readlines()
trace_clean = clean_bad_trace(trace)
print(trace_clean)
plt.plot(trace_clean, label='Noisy signal')
... | mit | 7,555,190,031,029,722,000 | 24.577778 | 73 | 0.648696 | false | 2.963918 | false | false | false |
AndersenLab/bam-toolbox | bam/coverage.py | 1 | 9134 | #! /usr/bin/env python
"""
usage:
bam coverage <bam> [options] [--mtchr=<mtchr>]
bam coverage <bam> [options] <chrom:start-end>...
bam coverage <bam> [options] --window=<size>
bam coverage <bam> [options] --regions=<gff/bed>
options:
-h --help Show this screen.
--version ... | mit | 5,665,556,332,376,103,000 | 35.830645 | 109 | 0.546748 | false | 3.637595 | false | false | false |
CadeiraCuidadora/UMISS-backend | umiss_project/umiss_auth/migrations/0001_initial.py | 1 | 4571 | # -*- coding: utf-8 -*-
# Generated by Django 1.10.2 on 2017-04-21 23:16
from __future__ import unicode_literals
import django.contrib.auth.models
import django.contrib.auth.validators
from django.db import migrations, models
import django.utils.timezone
class Migration(migrations.Migration):
initial = True
... | gpl-3.0 | -2,481,173,413,696,960,500 | 37.737288 | 135 | 0.436228 | false | 5.800761 | false | false | false |
bireme/api-nlm | src/ProcessLog.py | 1 | 4880 | #!/usr/bin/python3
# -*- coding: utf-8 -*-
# =========================================================================
#
# Copyright © 2016 BIREME/PAHO/WHO
#
# This file is part of API-NLM.
#
# API-NLM is free software: you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Pu... | lgpl-2.1 | -8,249,847,676,567,609,000 | 34.875 | 76 | 0.580242 | false | 3.934677 | false | false | false |
ycflame/google-python-exercises | basic/string1.py | 1 | 3600 | #!/usr/bin/python -tt
# Copyright 2010 Google Inc.
# Licensed under the Apache License, Version 2.0
# http://www.apache.org/licenses/LICENSE-2.0
# Google's Python Class
# http://code.google.com/edu/languages/google-python-class/
# Basic string exercises
# Fill in the code for the functions below. main() is already se... | apache-2.0 | 8,111,817,648,614,050,000 | 30.858407 | 78 | 0.659444 | false | 3.106126 | true | false | false |
DylanLukes/django-authority | authority/admin.py | 1 | 7317 | import django
from django import forms, template
from django.http import HttpResponseRedirect
from django.utils.translation import ugettext, ungettext, ugettext_lazy as _
from django.shortcuts import render_to_response
from django.utils.safestring import mark_safe
from django.forms.formsets import all_valid
from django... | bsd-3-clause | 261,633,873,510,626,200 | 41.540698 | 115 | 0.65833 | false | 4.062743 | false | false | false |
grammarware/slps | shared/python/CBGF3.py | 1 | 3247 | #!/Library/Frameworks/Python.framework/Versions/3.1/bin/python3
# -*- coding: utf-8 -*-
# wiki: ΞBGF
import os
import sys
sys.path.append(os.getcwd().split('slps')[0]+'slps/shared/python')
import slpsns
import BGF3
import xml.etree.ElementTree as ET
class Sequence:
def __init__(self):
self.steps = []
def parse(sel... | bsd-3-clause | 2,703,336,276,386,303,000 | 23.208955 | 81 | 0.65783 | false | 2.616129 | false | false | false |
smart-facility/TransMob | scenario_builder/generate_dwellings.py | 1 | 2754 | #!/usr/bin/env python
import csv, sys
# First, some error handling on command line arguments:
def print_usage():
print("Usage: python generate_dwellings.py scenario_id")
print("where scenario_id = 1, 2, or 3")
sys.exit(1)
if (len(sys.argv)!=2):
print_usage();
scenario = 1
try:
scenario = int(sy... | lgpl-3.0 | -1,133,053,417,790,501,000 | 23.589286 | 78 | 0.61801 | false | 2.95811 | false | false | false |
kolanos/iputil | iputil/filter.py | 1 | 2243 | import inspect
import itertools
import json
import operator
import os
OPERATORS = {
'<': operator.lt,
'<=': operator.le,
'==': operator.eq,
'!=': operator.ne,
'>=': operator.ge,
'>': operator.gt,
'in': operator.contains,
'nin': lambda x, y: not operator.contains(x, y),
}
def can_take_... | mit | 4,969,658,122,550,222,000 | 26.691358 | 75 | 0.585823 | false | 3.560317 | false | false | false |
xianjunzhengbackup/code | data science/machine_learning_for_the_web/chapter_8/movie_reviews_analizer_app/scrapy_spider/spiders/recursive_link_results.py | 1 | 2856 | '''
usage: scrapy runspider recursive_link_results.py (or from root folder: scrapy crawl scrapy_spyder_recursive)
'''
#from scrapy.spider import Spider
from scrapy.selector import Selector
from scrapy.contrib.spiders import CrawlSpider, Rule
from scrapy.linkextractors import LinkExtractor
from scrapy.http import Reque... | mit | -7,166,454,287,097,851,000 | 34.259259 | 135 | 0.597689 | false | 3.880435 | false | false | false |
jamessanford/assetto-corsa-hot-plugin | hot_app/Pyro4/util.py | 1 | 30379 | """
Miscellaneous utilities.
Pyro - Python Remote Objects. Copyright by Irmen de Jong (irmen@razorvine.net).
"""
import sys
import zlib
import logging
import linecache
import traceback
import inspect
import Pyro4.errors
import Pyro4.message
try:
import copyreg
except ImportError:
import co... | mit | -6,785,843,132,841,132,000 | 41.151989 | 159 | 0.598703 | false | 4.249406 | false | false | false |
KlubJagiellonski/pola-ai | data/blur_detection.py | 1 | 1735 | import argparse
import os
import shutil
import cv2
def blur_ratio(filename):
# Positive blur ratio - the lower the more blurred the photo is
image = cv2.imread(filename)
gray = cv2.cvtColor(image, cv2.COLOR_BGR2GRAY)
return cv2.Laplacian(gray, cv2.CV_64F).var()
def blur_distribution(photo_dir):
... | bsd-3-clause | -1,430,805,252,922,194,200 | 33.019608 | 91 | 0.631124 | false | 3.497984 | false | false | false |
modoboa/modoboa-installer | modoboa_installer/system.py | 1 | 1659 | """System related functions."""
import grp
import pwd
import sys
from . import utils
def create_user(name, home=None):
"""Create a new system user."""
try:
pwd.getpwnam(name)
except KeyError:
pass
else:
extra_message = "."
if home:
extra_message = (
... | mit | 8,390,421,269,169,445,000 | 24.921875 | 72 | 0.575648 | false | 3.770455 | false | false | false |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.