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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
timothycrosley/thedom | thedom/document.py | 1 | 6794 | '''
Document.py
Provides elements that define the html document being served to the client-side
Copyright (C) 2015 Timothy Edmund Crosley
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 Softwar... | gpl-2.0 | 7,022,688,719,562,299,000 | 31.507177 | 104 | 0.584781 | false | 4.063397 | false | false | false |
jiyfeng/RSTParser | model.py | 1 | 3945 | ## model.py
## Author: Yangfeng Ji
## Date: 09-09-2014
## Time-stamp: <yangfeng 11/05/2014 20:44:25>
## Last changed: umashanthi 11/19/2014
""" As a parsing model, it includes the following functions
1, Mini-batch training on the data generated by the Data class
2, Shift-Reduce RST parsing for a given text sequence
3... | mit | -4,449,401,833,782,390,000 | 30.56 | 93 | 0.570089 | false | 4.388209 | false | false | false |
sherpaman/MolToolPy | bin/hbond_stat.py | 1 | 1064 | #!/usr/bin/env python
from sys import argv,stderr
#Prende in input il nome di un file che contiene, i dati di coppie di residui per ogni frame.
#Ogni riga ha il seguente formato:
#frame atom1_id res1_name res1_id atom1_name atom2_id res2_name res2_id atom2_name ...........
#0 8661 T 273 N3 ... | gpl-2.0 | -7,142,410,232,880,668,000 | 23.159091 | 102 | 0.575729 | false | 2.812169 | false | false | false |
sebp/scikit-survival | sksurv/preprocessing.py | 1 | 3945 | # 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,
# bu... | gpl-3.0 | -6,087,449,575,147,389,000 | 31.073171 | 91 | 0.628897 | false | 4.417693 | false | false | false |
mikesname/ehri-collections | ehriportal/portal/migrations/0012_auto__add_field_authority_languages__add_field_authority_scripts.py | 1 | 17152 | # encoding: utf-8
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding field 'Authority.languages'
db.add_column('portal_authority', 'languages', self.gf('jsonfield.fie... | mit | 2,309,109,972,575,588,000 | 80.67619 | 174 | 0.543027 | false | 3.636209 | false | false | false |
jtbattle/wangemu | wvdutil/wvdHandler_base.py | 1 | 4196 | # Purpose: template class for file handler for the wvdutil.py program
# Author: Jim Battle
#
# Version: 1.0, 2018/09/15, JTB
# massive restructuring of the old wvdutil code base
# Version: 1.1, 2021/06/19, JTB
# get rid of bilingualism (aka python2 support);
# convert to inline type hints instead of type h... | mit | -7,556,717,784,087,207,000 | 39.346154 | 87 | 0.602717 | false | 3.793852 | false | false | false |
endlessm/chromium-browser | build/win/reorder-imports.py | 4 | 4054 | #!/usr/bin/env python
# Copyright 2014 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import glob
import optparse
import os
import shutil
import subprocess
import sys
sys.path.insert(0, os.path.join(os.path.dirname(__fil... | bsd-3-clause | 5,867,402,285,721,175,000 | 41.229167 | 78 | 0.694869 | false | 3.695533 | false | false | false |
qedsoftware/commcare-hq | corehq/apps/callcenter/fixturegenerators.py | 1 | 4228 | from xml.etree import ElementTree
from datetime import datetime
import pytz
from corehq.apps.callcenter.app_parser import get_call_center_config_from_app
from casexml.apps.phone.models import OTARestoreUser
from corehq.util.soft_assert import soft_assert
from corehq.util.timezones.conversions import ServerTime
from di... | bsd-3-clause | 1,972,465,104,134,683,000 | 31.274809 | 106 | 0.62228 | false | 3.996219 | true | false | false |
mikemhenry/arcade | examples/sprite_tiled_map.py | 1 | 6561 | """
Load a map stored in csv format, as exported by the program 'Tiled.'
Artwork from http://kenney.nl
"""
import arcade
SPRITE_SCALING = 0.5
SCREEN_WIDTH = 800
SCREEN_HEIGHT = 600
# How many pixels to keep as a minimum margin between the character
# and the edge of the screen.
VIEWPORT_MARGIN = 40
RIGHT_MARGIN = 1... | mit | -5,013,089,162,620,566,000 | 30.242857 | 76 | 0.53757 | false | 3.954792 | false | false | false |
anderspitman/scikit-bio | skbio/sequence/distance.py | 1 | 5233 | """
Sequence distance metrics (:mod:`skbio.sequence.distance`)
==========================================================
.. currentmodule:: skbio.sequence.distance
This module contains functions for computing distances between scikit-bio
``Sequence`` objects. These functions can be used directly or supplied to other... | bsd-3-clause | -1,355,334,489,428,729,900 | 28.398876 | 79 | 0.623543 | false | 3.991609 | false | false | false |
kennedyshead/home-assistant | homeassistant/components/media_player/__init__.py | 1 | 39109 | """Component to interface with various media players."""
from __future__ import annotations
import asyncio
import base64
import collections
from contextlib import suppress
import datetime as dt
import functools as ft
import hashlib
import logging
import secrets
from typing import final
from urllib.parse import urlpars... | apache-2.0 | 7,419,448,609,892,268,000 | 30.31225 | 105 | 0.620727 | false | 3.920702 | false | false | false |
Bdanilko/EdPy | src/lib/program.py | 1 | 21793 | #!/usr/bin/env python2
# * **************************************************************** **
# File: program.py
# Requires: Python 2.7+ (but not Python 3.0+)
# Note: For history, changes and dates for this file, consult git.
# Author: Brian Danilko, Likeable Software (brian@likeablesoftware.com)
# Copyright 2015-2017... | gpl-2.0 | -59,243,137,877,478,696 | 33.757576 | 104 | 0.581976 | false | 4.037984 | false | false | false |
kevinkellyspacey/standalone-dell-recovery | Dell/recovery_xml.py | 1 | 5532 | #!/usr/bin/python3
# -*- coding: utf-8 -*-
#
# «recovery_xml» - Helper Class for parsing and using a bto.xml
#
# Copyright (C) 2010-2011, Dell Inc.
#
# Author:
# - Mario Limonciello <Mario_Limonciello@Dell.com>
#
# This is free software; you can redistribute it and/or modify it under
# the terms of the GNU General Pub... | gpl-2.0 | -9,137,183,234,520,056,000 | 34.677419 | 82 | 0.565099 | false | 4.081181 | false | false | false |
BarrelfishOS/barrelfish | tools/harness/machines/gem5.py | 1 | 5282 | ##########################################################################
# Copyright (c) 2012-2016 ETH Zurich.
# All rights reserved.
#
# This file is distributed under the terms in the attached LICENSE file.
# If you do not find this file, copies can be found by writing to:
# ETH Zurich D-INFK, Universitaetstr 6, CH... | mit | 70,575,520,908,050,710 | 37.554745 | 115 | 0.639152 | false | 3.475 | false | false | false |
sbc100/yapf | yapf/yapflib/format_decision_state.py | 1 | 38486 | # Copyright 2015 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... | apache-2.0 | 1,545,245,249,763,236,600 | 37.06726 | 80 | 0.644364 | false | 4.030792 | false | false | false |
demisto/content | Packs/ThinkstCanary/Integrations/ThinkstCanary/ThinkstCanary_test.py | 1 | 3171 | import demistomock as demisto
MOCK_PARAMS = {
'access-key': 'fake_access_key',
'secret-key': 'fake_access_key',
'server': 'http://123-fake-api.com/',
'unsecure': True,
'proxy': True
}
def test_fetch_incidents(mocker, requests_mock):
"""
Given: An existing last run time.
When: Running... | mit | -3,411,973,804,248,822,300 | 47.784615 | 120 | 0.62567 | false | 3.503867 | false | false | false |
rajarsheem/libsdae-autoencoder-tensorflow | deepautoencoder/stacked_autoencoder.py | 1 | 6154 | import numpy as np
import deepautoencoder.utils as utils
import tensorflow as tf
allowed_activations = ['sigmoid', 'tanh', 'softmax', 'relu', 'linear']
allowed_noises = [None, 'gaussian', 'mask']
allowed_losses = ['rmse', 'cross-entropy']
class StackedAutoEncoder:
"""A deep autoencoder with denoising capability"... | mit | -4,848,992,055,917,937,000 | 41.441379 | 79 | 0.524862 | false | 3.834268 | false | false | false |
aamirmajeedkhan/P4-conference-central | conference.py | 1 | 35026 | #!/usr/bin/env python
"""
conference.py -- Udacity conference server-side Python App Engine API;
uses Google Cloud Endpoints
$Id: conference.py,v 1.25 2014/05/24 23:42:19 wesc Exp wesc $
created by wesc on 2014 apr 21
"""
__author__ = 'wesc+api@google.com (Wesley Chun)'
from datetime import datetime,time
im... | apache-2.0 | 3,213,191,701,473,363,000 | 38.264574 | 116 | 0.613094 | false | 4.297423 | false | false | false |
foursquare/fsqio | src/jvm/io/fsq/twofishes/scripts/match-flickr.py | 1 | 2018 | #!/usr/bin/python
import sys
import csv
import urllib
import urllib2
import json
import geojson
output = {}
files = sys.argv[1:]
for f in files:
fdata = open(f).read()
try:
data = geojson.loads(fdata)
except:
print 'failed to parse: ' + fdata
continue
for feature in data['features']:
woeid = s... | apache-2.0 | -910,351,895,282,670,600 | 25.552632 | 106 | 0.564916 | false | 3.275974 | false | false | false |
botswana-harvard/edc-lab | old/lab_clinic_api/migrations/0001_initial.py | 1 | 31522 | # -*- coding: utf-8 -*-
# Generated by Django 1.9 on 2016-05-07 13:52
from __future__ import unicode_literals
import datetime
import django.core.validators
from django.db import migrations, models
import django.db.models.deletion
import django_extensions.db.fields
import django_revision.revision_field
import edc_base.... | gpl-2.0 | 2,280,493,389,148,608,000 | 91.985251 | 463 | 0.645327 | false | 3.959056 | true | false | false |
easy-as-pie-labs/tweap | tweap/project_management/tests.py | 1 | 11427 | from django.test import TestCase
from project_management.models import Project, Invitation, Tag
from project_management.tools import invite_users, get_tags
from django.contrib.auth.models import User
import json
from django.http.response import HttpResponse, HttpResponseRedirect, HttpResponseNotAllowed
class ModelTest... | gpl-3.0 | 4,192,250,747,644,782,600 | 40.552727 | 161 | 0.655203 | false | 3.896011 | true | false | false |
Wyn10/Cnchi | cnchi/ui/gtk/pages/features.py | 1 | 13668 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# features.py
#
# Copyright © 2013-2016 Antergos
#
# This file is part of Cnchi.
#
# Cnchi 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... | gpl-3.0 | -3,563,286,189,405,870,000 | 36.138587 | 94 | 0.585791 | false | 3.993863 | false | false | false |
SVilgelm/CloudFerry | cloudferry/lib/os/storage/plugins/copy_mechanisms.py | 1 | 5969 | # Copyright 2016 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 writing,... | apache-2.0 | -7,871,854,656,423,564,000 | 37.75974 | 79 | 0.565756 | false | 4.071623 | false | false | false |
saullocastro/pyNastran | pyNastran/bdf/dev_vectorized/cards/elements/rod/ptube.py | 1 | 8276 | from __future__ import print_function
from six.moves import zip
from numpy import array, zeros, unique, searchsorted, arange, pi
from pyNastran.bdf.dev_vectorized.cards.elements.property import Property
#from pyNastran.bdf.field_writer_8 import set_blank_if_default
from pyNastran.bdf.field_writer_8 import print_card... | lgpl-3.0 | -8,218,476,148,353,684,000 | 33.773109 | 95 | 0.531658 | false | 3.168453 | false | false | false |
calebbrown/calebcc | feedgenerator/feeds.py | 1 | 8744 | """
Syndication feed generation library -- used for generating RSS, etc.
Sample usage:
>>> from django.utils import feedgenerator
>>> feed = feedgenerator.Rss201rev2Feed(
... title=u"Poynter E-Media Tidbits",
... link=u"http://www.poynter.org/column.asp?id=31",
... description=u"A group Weblog by the shar... | bsd-3-clause | -3,889,700,314,081,301,500 | 41.653659 | 123 | 0.613564 | false | 3.669324 | false | false | false |
riklaunim/django-custom-multisite | django/contrib/auth/models.py | 1 | 17160 | import urllib
from django.core.exceptions import ImproperlyConfigured
from django.core.mail import send_mail
from django.db import models
from django.db.models.manager import EmptyManager
from django.utils.crypto import get_random_string
from django.utils.encoding import smart_str
from django.utils.translation import ... | bsd-3-clause | 6,168,093,177,801,387,000 | 34.824635 | 79 | 0.617599 | false | 4.4641 | false | false | false |
caktus/django-opendebates | opendebates/tests/test_flatpage_metadata_override.py | 1 | 2796 | from django.contrib.flatpages.models import FlatPage
from django.contrib.sites.models import Site
from django.test import TestCase
from django.utils.html import escape
from opendebates.models import FlatPageMetadataOverride
from opendebates import site_defaults
from .factories import SiteFactory, DebateFactory
class... | apache-2.0 | -2,610,047,757,008,014,300 | 44.836066 | 85 | 0.675966 | false | 3.814461 | true | false | false |
patrickm/chromium.src | chrome/common/extensions/docs/server2/future.py | 1 | 1238 | # Copyright (c) 2012 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import sys
_no_value = object()
def Collect(futures):
'''Creates a Future which returns a list of results from each Future in
|futures|.
'''
r... | bsd-3-clause | -2,560,667,322,118,759,400 | 26.511111 | 73 | 0.638934 | false | 3.619883 | false | false | false |
cliali/py2 | a.py | 1 | 1578 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Simple Bot to reply to Telegram messages. This is built on the API wrapper, see
# echobot2.py to see the same example built on the telegram.ext bot framework.
# This program is dedicated to the public domain under the CC0 license.
import logging
import telegram
from tel... | apache-2.0 | 2,133,397,267,722,731,300 | 28.773585 | 86 | 0.653359 | false | 3.793269 | false | false | false |
flavoi/diventi | diventi/landing/views.py | 1 | 3927 | from itertools import chain
from django.shortcuts import render, redirect, resolve_url
from django.views.generic.detail import DetailView
from django.views.generic import ListView, TemplateView
from django.views.generic.edit import CreateView
from django.utils.translation import ugettext_lazy as _
from django.c... | apache-2.0 | 2,472,953,982,382,659,600 | 30.725 | 77 | 0.675325 | false | 4.16879 | false | false | false |
Uberi/botty-bot-bot-bot | src/plugins/timezones.py | 1 | 5164 | #!/usr/bin/env python3
import re
from datetime import datetime, date
import pytz
from .utilities import BasePlugin
from .utilities import clockify, untag_word
timezone_abbreviations = {
"est": pytz.timezone("Canada/Eastern"),
"edt": pytz.timezone("Canada/Eastern"),
"atlantic": pytz.timez... | mit | 1,056,715,963,307,125,400 | 49.607843 | 212 | 0.610616 | false | 3.418543 | false | false | false |
muttiopenbts/fusion | fusion_level02_4.py | 1 | 1932 | #!/usr/bin/python
'''
Simple script to interact with fusion level 02 challenge network daemon,
#!/usr/bin/python
mkocbayi@gmail.com
'''
from pwn import *
import sys
#Use this hexdump lib because pwntools hexdump is too slow
from hexdump import *
def doMode(mode): # Either E or Q
print 'Sending mode call: {}'.forma... | gpl-3.0 | 536,043,605,942,736,000 | 36.153846 | 102 | 0.683747 | false | 3.551471 | false | false | false |
xiaonanln/myleetcode-python | src/Sudoku Solver.py | 1 | 2697 | class Solution:
# @param board, a 9x9 2D array
# Solve the Sudoku by modifying the input board in-place.
# Do not return any value.
def solveSudoku(self, board):
rowUsable = [set(xrange(1, 10)) for i in xrange(9)]
colUsable = [set(xrange(1, 10)) for i in xrange(9)]
blockUsable = ... | apache-2.0 | 8,919,941,869,076,930,000 | 31.119048 | 118 | 0.411568 | false | 3.082286 | false | false | false |
kennethreitz/pipenv | pipenv/patched/notpip/_internal/network/download.py | 1 | 6458 | """Download files with progress indicators.
"""
import cgi
import logging
import mimetypes
import os
from pipenv.patched.notpip._vendor import requests
from pipenv.patched.notpip._vendor.requests.models import CONTENT_CHUNK_SIZE
from pipenv.patched.notpip._internal.models.index import PyPI
from pipenv.patched.notpip.... | mit | -2,368,371,102,283,550,700 | 31.29 | 78 | 0.644162 | false | 4.084756 | false | false | false |
stefanopanella/xapi-storage-plugins | libs/losetup.py | 1 | 1260 | import os.path
from xapi.storage.common import call
# Use Linux "losetup" to create block devices from files
class Loop:
"""An active loop device"""
def __init__(self, path, loop):
self.path = path
self.loop = loop
def destroy(self, dbg):
call(dbg, ["losetup", "-d", self.loop])... | lgpl-2.1 | -1,819,758,216,933,129,700 | 26.391304 | 72 | 0.584127 | false | 3.806647 | false | false | false |
mosarg/gestione_scuola | backend/migrations/0001_initial.py | 1 | 2074 | # -*- 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 'Backend'
db.create_table(u'backend_backend', (
('created', self.gf('django.db.mo... | gpl-3.0 | -7,381,446,622,908,163,000 | 48.404762 | 125 | 0.607522 | false | 3.79159 | false | false | false |
oarriaga/spatial_transformer_networks | src/models/layers.py | 1 | 5049 | from keras import backend as K
from keras.engine.topology import Layer
if K.backend() == 'tensorflow':
import tensorflow as tf
def K_meshgrid(x, y):
return tf.meshgrid(x, y)
def K_linspace(start, stop, num):
return tf.linspace(start, stop, num)
else:
raise Exception("Only 'tensorflow... | mit | -3,533,227,027,551,988,700 | 35.854015 | 79 | 0.575956 | false | 3.137974 | false | false | false |
mattgemmell/DOT-MGTextEntry | mgtext.py | 1 | 12149 | #! /usr/bin/python
"""
MGText
Text-entry plugin for Pimoroni's menu system for the Raspberry Pi Display-O-Tron.
Code and info: https://github.com/mattgemmell/DOT-MGTextEntry
By: Matt Gemmell
http://mattgemmell.com/
http://twitter.com/mattgemmell
"""
from dot3k.menu import MenuOption
_UP = 0
_DOWN = 1
_LEFT = 2
_... | mit | -2,095,706,729,113,539,300 | 30.720627 | 559 | 0.658408 | false | 3.043337 | false | false | false |
saebyn/nwgui | nwgui/gui.py | 1 | 2263 |
import pygame
from nwgui.container import AbsoluteContainer
class AbstractGUI(object):
def __init__(self, game):
raise NotImplementedError
def getGameObject(self):
raise NotImplementedError
def get(self, widgetName):
raise NotImplementedError
def setName(self, name, widget... | gpl-3.0 | -5,101,451,680,991,540,000 | 23.597826 | 66 | 0.613787 | false | 4.744235 | false | false | false |
algorhythms/LeetCode | 673 Number of Longest Increasing Subsequence.py | 1 | 1796 | #!/usr/bin/python3
"""
Given an unsorted array of integers, find the number of longest increasing
subsequence.
Example 1:
Input: [1,3,5,4,7]
Output: 2
Explanation: The two longest increasing subsequence are [1, 3, 4, 7] and
[1, 3, 5, 7].
Example 2:
Input: [2,2,2,2,2]
Output: 5
Explanation: The length of longest contin... | mit | 3,544,294,024,520,078,000 | 26.630769 | 78 | 0.50167 | false | 3.059625 | false | false | false |
pearu/sympycore | sympycore/functions/algebra.py | 1 | 2063 | """ Implementes functions ring support.
"""
#
# Author: Pearu Peterson
# Created: April, 2008
#
__all__ = ['FunctionRing']
from ..core import classes, objects, init_module
from ..basealgebra import Verbatim, Algebra
from ..ring import CommutativeRing
init_module.import_heads()
class FunctionRing(CommutativeRing):
... | bsd-3-clause | 7,460,060,148,131,743,000 | 25.792208 | 101 | 0.62191 | false | 3.944551 | false | false | false |
NEONScience/NEON-Data-Skills | tutorials/Python/Lidar/lidar-biomass/calc-biomass_py/calc-biomass_py.py | 1 | 20510 | #!/usr/bin/env python
# coding: utf-8
# ---
# syncID: e6ccf19a4b454ca594388eeaa88ebe12
# title: "Calculate Vegetation Biomass from LiDAR Data in Python"
# description: "Learn to calculate the biomass of standing vegetation using a canopy height model data product."
# dateCreated: 2017-06-21
# authors: Tristan Goulde... | agpl-3.0 | -6,897,848,424,968,655,000 | 35.17284 | 503 | 0.709654 | false | 3.292135 | false | false | false |
abstractfactory/openmetadata-mk1 | transaction.py | 1 | 5900 | """Convenience module for the end-user
The goal of this module is to provide as high-level utilities
as possible for users who wish to have as little knowledge as
possible about Open Folder.
Target audience leans towards Technical Directors or
fellow scripters in any DCC.
"""
from __future__ import absolute_import
... | mit | 4,959,071,983,263,927,000 | 25.818182 | 101 | 0.605593 | false | 4.184397 | false | false | false |
mchels/FolderBrowser | plotcontrols.py | 1 | 6028 | from PyQt5 import QtWidgets
from PyQt5.QtWidgets import QSizePolicy
class PlotControls(QtWidgets.QWidget):
"""
Control bar for controlling how plots are shown.
Parameters
----------
cmap_names : list
List of colormap names to show in the colormap dropdown menu.
plot_2D_types : list
... | mit | -5,390,035,938,519,185,000 | 34.251462 | 80 | 0.584439 | false | 3.613909 | false | false | false |
AlexProfi/django-cms | cms/cms_menus.py | 1 | 16191 | # -*- coding: utf-8 -*-
from django.utils.translation import get_language
from cms import constants
from cms.apphook_pool import apphook_pool
from cms.utils.permissions import load_view_restrictions, has_global_page_permission
from cms.utils import get_language_from_request
from cms.utils.conf import get_cms_setting
f... | bsd-3-clause | 7,715,891,116,846,316,000 | 36.992958 | 103 | 0.571517 | false | 4.357835 | false | false | false |
hadware/lexicographer | epub-parser/src/epub_to_json/epub_to_json.py | 1 | 5101 | import sys
from epub import open_epub
import simplejson as json
from bs4 import BeautifulSoup, Tag
class SimpleChapter(object):
def __init__(self, name, text):
self.name = name
self.text = text
class Parser(object):
def __init__(self, epub_path):
self.epub_file = open_epub(epub_path,... | gpl-2.0 | 7,686,731,611,143,497,000 | 32.781457 | 115 | 0.554401 | false | 3.867324 | false | false | false |
datamade/yournextmp-popit | candidates/tests/test_person_view.py | 1 | 2933 | # Smoke tests for viewing a candidate's page
from datetime import date, timedelta
import re
from django.conf import settings
from django.test.utils import override_settings
from django_webtest import WebTest
from .factories import (
AreaTypeFactory, ElectionFactory, CandidacyExtraFactory,
ParliamentaryChambe... | agpl-3.0 | 2,693,899,126,005,377,500 | 35.6625 | 92 | 0.656325 | false | 3.594363 | true | false | false |
antoinecarme/pyaf | setup.py | 1 | 1126 | from setuptools import setup
from setuptools import find_packages
with open("README.md", "r") as fh:
pyaf_long_description = fh.read()
setup(name='pyaf',
version='3.0-RC1',
description='Python Automatic Forecasting',
long_description=pyaf_long_description,
long_description_content_type... | bsd-3-clause | 8,461,214,734,102,750,000 | 37.827586 | 239 | 0.64476 | false | 4.035842 | false | true | false |
miguelalonso/pywws | src/doc/conf.py | 1 | 9030 | # -*- coding: utf-8 -*-
#
# pywws - Python software for USB Wireless Weather Stations
# http://github.com/jim-easterbrook/pywws
# Copyright (C) 2008-15 pywws contributors
# 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... | gpl-2.0 | 7,874,652,060,301,545,000 | 31.956204 | 81 | 0.706645 | false | 3.673718 | false | false | false |
PaddlePaddle/Paddle | python/paddle/fluid/incubate/fleet/parameter_server/ir/public.py | 1 | 50054 | # Copyright (c) 2020 PaddlePaddle 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 appli... | apache-2.0 | -7,821,824,388,392,121,000 | 38.75695 | 145 | 0.537979 | false | 3.973801 | false | false | false |
animekita/selvbetjening | selvbetjening/frontend/userportal/views.py | 1 | 7865 | # coding=UTF-8
from django.shortcuts import render
from django.contrib.auth.decorators import login_required
from django.contrib.auth.models import AnonymousUser
from django.http import HttpResponseRedirect
from django.core.urlresolvers import reverse
from django.utils.translation import ugettext as _
from django.shor... | mit | 2,199,686,237,095,671,600 | 30.464 | 111 | 0.595168 | false | 4.507163 | false | false | false |
choderalab/ensembler | ensembler/pdb.py | 1 | 4246 | import sys
if sys.version_info > (3, 0):
from urllib.request import urlopen
from urllib.error import URLError
from io import StringIO
else:
from urllib2 import urlopen, URLError
from StringIO import StringIO
import gzip
import re
import six
def extract_residues_by_resnum(output_file, pdb_input_file... | gpl-2.0 | 5,171,825,560,777,637,000 | 35.921739 | 135 | 0.5935 | false | 3.562081 | false | false | false |
sdbondi/Arduino-Talk | Comet/python/ArduinoServer.py | 1 | 6552 | #!/usr/bin/python
import human_curl as requests
import serial
import platform
import sys
import getopt
import socket
import json
import time
_WINDOWS = (platform.system() == 'Windows')
_AJAXURL = 'http://localhost/arduino/comet-router.php?action=%(action)s'
#_AJAXURL = 'http://themousepotatowebsite.co.za/experiments/... | mit | 1,833,642,196,712,729,600 | 24.297297 | 103 | 0.573107 | false | 3.6139 | false | false | false |
thorwhalen/ut | ml/sk/transformers.py | 1 | 4610 |
__author__ = 'thor'
from sklearn.base import TransformerMixin, BaseEstimator
from sklearn.neighbors import KNeighborsRegressor
from pandas import DataFrame
import numpy as np
from nltk import word_tokenize
from functools import reduce
class HourOfDayTransformer(TransformerMixin):
def __init__(self, date_field=... | mit | 1,656,264,518,869,154,300 | 25.964912 | 120 | 0.569848 | false | 3.682109 | false | false | false |
LucasFerreiraDaSilva/ScrapingINMET | geraBase.py | 1 | 3704 | """
Autor: Lucas Ferreira da Silva
Email: lferreira@inf.ufsm.br
Descricao: Script para download dos dados referentes a cada estacao metereologica
e criacao de uma pequena "base de dados" em formato JSON referente a
todas as estacoes
Execucao (comando): python3 geraBase.py
Saida: Arquivo JSON (e... | mit | 8,083,539,564,384,112,000 | 31.707965 | 108 | 0.606061 | false | 2.865116 | false | false | false |
BlackHole/enigma2-1 | lib/python/Components/Converter/TemplatedMultiContent.py | 2 | 2918 | from Components.Converter.StringList import StringList
class TemplatedMultiContent(StringList):
"""Turns a python tuple list into a multi-content list which can be used in a listbox renderer."""
def __init__(self, args):
StringList.__init__(self, args)
from enigma import eListboxPythonMultiContent, gFont, RT_HAL... | gpl-2.0 | 1,706,497,243,091,871,200 | 40.098592 | 207 | 0.735778 | false | 3.580368 | false | false | false |
Grumblesaur/quickgen | quickgen.py | 1 | 3966 | #!/usr/local/bin/python -tt
# -*- coding: utf-8 -*-
import os, sys, random
#supply input as raw_input if running Python 3 or higher
if sys.version_info >= (3,0):
raw_input = input
def parse(structure, part, phonemes):
#grab a random phoneme from the relevant category and return it
#structure can be O, N, or C, pas... | gpl-2.0 | -7,959,536,635,195,563,000 | 21.793103 | 88 | 0.648512 | false | 2.926937 | false | false | false |
irblsensitivity/irblsensitivity | scripts/features/MethodFeatures.py | 1 | 6286 | #-*- coding: utf-8 -*-
'''
Created on 2016. 11. 19
Updated on 2016. 01. 09
'''
from __future__ import print_function
import os
import re
from utils import PrettyStringBuilder
from utils import Progress
import javalang
class Resource(object):
Stopwords = None
EngDictionary = None
@staticmethod
d... | apache-2.0 | 4,348,889,472,794,515,500 | 30.081633 | 141 | 0.600223 | false | 3.216991 | false | false | false |
aplicatii-romanesti/allinclusive-kodi-pi | .kodi/addons/plugin.video.kidsplace/brightcovePlayer.py | 1 | 1587 | import httplib
from pyamf import AMF0, AMF3
from pyamf import remoting
from pyamf.remoting.client import RemotingService
height = 1080
def build_amf_request(const, playerID, videoPlayer, publisherID):
env = remoting.Envelope(amfVersion=3)
env.bodies.append(
(
"/1",
remotin... | apache-2.0 | -1,561,841,478,157,068,000 | 35.068182 | 156 | 0.669187 | false | 3.742925 | false | false | false |
iamantony/PythonNotes | src/objects/matrix.py | 1 | 5188 | __author__ = 'Antony Cherepanov'
from exceptions import Exception
class MatrixException(Exception):
pass
class Matrix(object):
def __init__(self, t_rowNum=0, t_colNum=0, t_values=None):
if not self.__checkDimensionType(t_rowNum) or\
not self.__checkDimensionType(t_colNum... | mit | -3,138,855,623,441,978,400 | 31.701299 | 80 | 0.528142 | false | 3.963331 | false | false | false |
jhermann/kunstkopf | src/kunstkopf/__init__.py | 1 | 1258 | # -*- coding: utf-8 -*-
# pylint: disable=bad-whitespace
"""
kunstkopf [ˈkʊnstkɔp͜f] is a set of tools that handle audio (meta-)data and control hi-fi gear.
Copyright © 2015 Jürgen Hermann <jh@web.de>
Licensed under the GNU General Public License, Version 3.0
"""
# Copyright © 2015 Jürgen Hermann <jh@we... | gpl-3.0 | -7,133,038,733,929,701,000 | 38.03125 | 99 | 0.68775 | false | 3.384824 | false | false | false |
HBNLdev/DataStore | db/sas_tools.py | 1 | 2566 | ''' tools for working with .sas7bdat files '''
import os
from collections import OrderedDict
import pandas as pd
from sas7bdat import SAS7BDAT
from .knowledge.questionnaires import map_ph4, map_ph4_ssaga
map_subject = {'core': {'file_pfixes': []}}
parent_dir = '/processed_data/zork/zork-phase4-69/sessi... | gpl-3.0 | -7,685,914,298,742,378,000 | 30.481013 | 82 | 0.606002 | false | 3.767988 | false | false | false |
OpenTreeOfLife/gcmdr | run_synth_studies_mono.py | 1 | 1437 | import load_synth_extract
from plants import studytreelist as plantslist
from metazoa import studytreelist as metalist
from fungi import studytreelist as fungilist
from microbes import studytreelist as microbelist
studytreelist = []
studytreelist.extend(metalist)
studytreelist.extend(fungilist)
studytreelist.extend(m... | bsd-2-clause | -8,043,959,451,811,851,000 | 33.214286 | 123 | 0.695198 | false | 3.057447 | false | false | false |
n3wb13/OpenNfrGui-5.0-1 | lib/python/Plugins/Extensions/MediaPortal/additions/porn/adultbay.py | 1 | 12372 | # -*- coding: utf-8 -*-
###############################################################################################
#
# MediaPortal for Dreambox OS
#
# Coded by MediaPortal Team (c) 2013-2015
#
# This plugin is open source but it is NOT free software.
#
# This plugin may only be distributed to and executed... | gpl-2.0 | 2,939,069,052,170,796,000 | 36.374622 | 166 | 0.66637 | false | 2.935453 | false | false | false |
kll334477/NewsScrapy | thepaper/thepaper/spiders/wshang_spider.py | 1 | 5240 | #!/usr/bin/env python
# -*- coding:utf-8 -*-
__author__ = 'yinzishao'
"""
手机版没有cookie,更方便
但是pc版的首页是所有分类混在一起的
手机版则是新闻在各个分类,所以爬取的时候需要爬各个分类。
"""
import re
import scrapy
from bs4 import BeautifulSoup
import logging
from thepaper.items import NewsItem
import json
logger = logging.getLogger("WshangSpider")
from thepaper.set... | lgpl-3.0 | 526,355,286,195,562,100 | 34.7 | 129 | 0.503601 | false | 3.532155 | false | false | false |
archesproject/arches | arches/management/commands/card_component.py | 1 | 3937 | """
ARCHES - a program developed to inventory and manage immovable cultural heritage.
Copyright (C) 2013 J. Paul Getty Trust and World Monuments Fund
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as
published by the Free Software Founda... | agpl-3.0 | -963,692,031,037,702,900 | 30.496 | 129 | 0.626365 | false | 4.494292 | false | false | false |
wroersma/volatility | volatility/plugins/overlays/windows/win10.py | 1 | 21936 | # Volatility
# Copyright (c) 2008-2015 Volatility Foundation
#
# This file is part of Volatility.
#
# Volatility is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License Version 2 as
# published by the Free Software Foundation. You may not use, modify or
# distribu... | gpl-2.0 | -771,911,055,582,781,700 | 30.026874 | 119 | 0.552744 | false | 3.533505 | false | false | false |
StefanWinterfeldt/Buildicator | messageSinks/consoleMessageSink.py | 1 | 2127 | # Copyright 2014 Stefan Winterfeldt <stefan.winterfeldt@bitz.it>
# <stefan.winterfeldt@outlook.de
# BITZ GmbH <info@bitz.it>
#
#This file is part of Buildicator.
#
#Buildicator is free software: you can redistribute it and/or modify
#it under the terms of the GN... | gpl-3.0 | 237,320,716,383,971,300 | 38.407407 | 76 | 0.720733 | false | 4.228628 | false | false | false |
IMIO/django-fixmystreet | django_fixmystreet/api/reports/serializers.py | 1 | 1936 | # -*- coding: utf-8 -*-
from rest_framework import serializers
from . import models
class ReportAssignmentAcceptSerializer(serializers.Serializer):
reference_id = serializers.CharField()
comment = serializers.CharField(required=False)
created_at = serializers.DateTimeField()
def restore_object(self... | agpl-3.0 | -65,268,529,041,024,920 | 33.571429 | 84 | 0.681302 | false | 4.687651 | false | false | false |
nickaugust/pychatkit | clients.py | 1 | 1973 | #!/usr/bin/env python
import asyncio
import logging
logger = logging.getLogger("chatkit:" + __name__)
class WSClientManager:
def __init__(self):
self._clients = []
def all(self):
return self._clients
def add(self, client):
logging.info("+ WSClient {}".format(client))
self... | mit | -1,395,320,659,051,184,000 | 26.788732 | 61 | 0.581855 | false | 3.838521 | false | false | false |
likit/BioUtils | fetch_entrez_from_geneid.py | 1 | 1631 | '''Selects protein sequences from NCBI that are in a list
from Geisha text file.
Output is written to standard output.
'''
import os
import sys
import time
from Bio import SeqIO, Entrez
def parse(infile):
'''Return a set of gene IDs from an input file.'''
for line in open(infile):
geneid = line.spl... | bsd-2-clause | -5,944,984,507,646,516,000 | 24.888889 | 66 | 0.578786 | false | 3.40501 | false | false | false |
forseti-security/forseti-security | tests/services/scanner/scanner_base_db.py | 1 | 4263 | """Helper base class for testing scanners."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from datetime import datetime
from datetime import timedelta
import os
import unittest.mock as mock
from sqlalchemy.orm import sessionmaker
from google.cloud.fors... | apache-2.0 | -3,047,828,724,957,816,300 | 36.394737 | 80 | 0.65658 | false | 3.606599 | true | false | false |
vatlab/SOS | src/sos/tasks.py | 1 | 77822 | #!/usr/bin/env python3
#
# Copyright (c) Bo Peng and the University of Texas MD Anderson Cancer Center
# Distributed under the terms of the 3-clause BSD License.
import copy
import os
import fasteners
import pickle
import time
import lzma
import math
import struct
from enum import Enum
from collections import namedtupl... | gpl-3.0 | -1,311,812,755,292,229,400 | 36.3247 | 207 | 0.464547 | false | 4.217995 | false | false | false |
bjodah/PyLaTeX | pylatex/base_classes/command.py | 1 | 10139 | # -*- coding: utf-8 -*-
"""
This module implements a class that implements a latex command.
This can be used directly or it can be inherited to make an easier interface
to it.
.. :copyright: (c) 2014 by Jelte Fennema.
:license: MIT, see License for more details.
"""
from .latex_object import LatexObject
from ..... | mit | -7,111,534,106,801,539,000 | 27.085873 | 79 | 0.56909 | false | 4.579494 | false | false | false |
arunkgupta/gramps | gramps/gen/filters/rules/person/_ischildoffiltermatch.py | 1 | 2492 | #
# Gramps - a GTK+/GNOME based genealogy program
#
# Copyright (C) 2002-2007 Donald N. Allingham
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at you... | gpl-2.0 | -4,666,658,151,900,319,000 | 32.226667 | 75 | 0.536116 | false | 4.597786 | false | false | false |
cheery/spirthon | annotator.py | 1 | 5192 | # Annotator needs to find the least generic type for everything.
# To do that, it needs to hold a model of our types.
class Annotator(object):
def __init__(self, unit):
self.unit = unit
self.stack = []
def update(self, func):
for block in func:
for op in block.ops:
... | mit | 7,691,338,691,917,519,000 | 30.08982 | 82 | 0.589176 | false | 3.7815 | false | false | false |
tibor95/phatch-python2.7 | build/lib.linux-i686-2.7/phatch/core/pil.py | 1 | 26512 | # Phatch - Photo Batch Processor
# Copyright (C) 2007-2009 www.stani.be
#
# 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... | gpl-3.0 | 3,443,809,914,918,861,000 | 35.021739 | 79 | 0.55688 | false | 3.961153 | false | false | false |
klpdotorg/dubdubdub | apps/ivrs/migrations/0026_auto_20170101_2313.py | 1 | 1139 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations
def forwards_func(apps, schema_editor):
State = apps.get_model("ivrs", "State")
User = apps.get_model("users", "User")
states = State.objects.all()
for state in states:
# Trimming the starting 0.... | mit | 7,417,438,785,882,545,000 | 24.886364 | 60 | 0.604917 | false | 3.87415 | false | false | false |
google/starthinker | dags/test_dag.py | 1 | 4439 | ###########################################################################
#
# Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/l... | apache-2.0 | -252,957,889,067,501,380 | 24.079096 | 145 | 0.514305 | false | 4.035455 | false | false | false |
DongjunLee/kino-bot | kino/slack/plot.py | 1 | 2684 | from matplotlib import pyplot as plt
import matplotlib.dates as dt
import seaborn
seaborn.set()
import datetime
class Plot(object):
def __init__(self):
pass
def make_bar(
x,
y,
f_name,
title=None,
legend=None,
x_label=None,
y_label=None,
... | mit | 2,999,971,998,501,694,500 | 22.137931 | 77 | 0.492921 | false | 3.494792 | false | false | false |
sylvchev/mdla | examples/example_benchmark_performance.py | 1 | 6309 | """Benchmarking dictionary learning algorithms on random dataset"""
from multiprocessing import cpu_count
from time import time
import matplotlib.pyplot as plt
import numpy as np
from numpy import array
from numpy.linalg import norm
from numpy.random import permutation, rand, randint, randn
from mdla import MiniBatc... | gpl-3.0 | -6,148,818,530,008,922,000 | 27.547511 | 84 | 0.592645 | false | 3.379218 | false | false | false |
tferr/ASA | scripting-examples/3D_Analysis_ImageStack.py | 1 | 2179 | #@ImagePlus imp
#@LogService log
'''
This script uses an outdated API. For a modern replacement, have a look at
https://github.com/morphonets/SNT/tree/master/src/main/resources/script_templates/Neuroanatomy
'''
from sholl import Sholl_Analysis
from sholl import Options
from os.path import expanduser
def spa... | gpl-3.0 | -3,595,713,342,764,342,300 | 28.849315 | 98 | 0.693437 | false | 3.480831 | false | false | false |
jschaul/ComplexNetworkSim | examples/getting started code/first_visualisation.py | 1 | 1471 | '''
Complete code file only from ComplexNetworkSim's "getting started" documentation section, for visualising a simulation. For explanations refer to the documentation page.
Current link: http://complexnetworksim.0sites.net/start.html (documentation hosting may change place - see the PyPi index page.)
@author: Jo... | bsd-2-clause | 2,120,398,871,978,929,200 | 44.03125 | 170 | 0.743712 | false | 3.358447 | false | false | false |
jonfoster/pyxb1 | pyxb/__init__.py | 1 | 10123 | """PyXB stands for Python U{W3C XML
Schema<http://www.w3.org/XML/Schema>} Bindings, and is pronounced
"pixbee". It enables translation between XML instance documents and
Python objects following rules specified by an XML Schema document.
This is the top-level entrypoint to the PyXB system. Importing this
gets you al... | apache-2.0 | -4,845,504,037,243,957,000 | 38.236434 | 89 | 0.708683 | false | 4.039505 | false | false | false |
Southpaw-TACTIC/Team | src/python/Lib/site-packages/PySide/examples/widgets/analogclock.py | 1 | 3131 | #!/usr/bin/env python
#############################################################################
##
## Copyright (C) 2004-2005 Trolltech AS. All rights reserved.
##
## This file is part of the example classes of the Qt Toolkit.
##
## This file may be used under the terms of the GNU General Public
## License version... | epl-1.0 | -2,085,368,576,522,494,700 | 30 | 77 | 0.608432 | false | 3.749701 | false | false | false |
google/clusterfuzz | src/local/butler/reproduce_tool/android.py | 1 | 3980 | # Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | apache-2.0 | -1,405,921,316,545,967,000 | 35.851852 | 80 | 0.711809 | false | 3.972056 | false | false | false |
lostinplace/filtered-intervaltree | setup.py | 1 | 1509 | from setuptools import setup, find_packages
from codecs import open
from os import path
import os
here = path.abspath(path.dirname(__file__))
with open(path.join(here, 'readme.md'), encoding='utf-8') as f:
long_description = f.read()
with open(path.join(here, '.library-version'), encoding='utf-8') as f:
exis... | mit | 3,768,461,388,915,031,600 | 26.962963 | 72 | 0.666667 | false | 3.859335 | false | true | false |
Kpler/scrapy-logentries-extension | scrapylogentries/extension.py | 1 | 1989 | import logging
import os
from scrapy import signals
from scrapy.exceptions import NotConfigured
from logentries import LogentriesHandler
from logentriesadapter import LogentriesAdapter, ScrapingHubFilter
logger = logging.getLogger(__name__)
class LogentriesExtension(object):
def __init__(self, token):
... | mit | 7,340,216,088,831,452,000 | 30.078125 | 131 | 0.612871 | false | 4.240938 | false | false | false |
teracyhq/flask-classy | test_classful/test_decorators.py | 2 | 7323 | from flask import Flask
from .view_classes import DecoratedView
from .view_classes import DecoratedBoldListView
from .view_classes import DecoratedBoldItalicsListView
from .view_classes import DecoratedListMemberView
from .view_classes import DecoratedListFunctionAttributesView
from .view_classes import DecoratedListMe... | bsd-3-clause | 495,681,920,520,354,400 | 32.286364 | 79 | 0.654377 | false | 3.319583 | true | false | false |
iwm911/plaso | plaso/formatters/mcafeeav.py | 1 | 1238 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright 2013 The Plaso Project Authors.
# Please see the AUTHORS file for details on individual 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 L... | apache-2.0 | -6,182,131,290,445,977,000 | 35.411765 | 80 | 0.731018 | false | 3.77439 | false | false | false |
jarrodmcc/OpenFermion | src/openfermion/utils/_sparse_tools_test.py | 1 | 55877 | # 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
# distribu... | apache-2.0 | 8,698,967,164,351,995,000 | 40.668158 | 81 | 0.614493 | false | 3.586457 | true | false | false |
rchuppala/usc_agent | src/usc-agent-dev/common/source/pyang/pyang/syntax.py | 1 | 11073 | """Description of YANG & YIN syntax."""
import re
### Regular expressions - constraints on arguments
# keywords and identifiers
identifier = r"[_A-Za-z][._\-A-Za-z0-9]*"
prefix = identifier
keyword = '((' + prefix + '):)?(' + identifier + ')'
# no group version of keyword
keyword_ng = '(?:(' + prefix + '):)?(?:' + ... | gpl-2.0 | 2,142,903,817,177,840,400 | 41.588462 | 80 | 0.493362 | false | 3.092153 | false | false | false |
ngokevin/zamboni | mkt/operators/tests/test_authorization.py | 1 | 5750 | from nose.tools import ok_
from rest_framework.generics import GenericAPIView
from django.contrib.auth.models import AnonymousUser
from amo.tests import TestCase
from mkt.access.middleware import ACLMiddleware
from mkt.carriers import CARRIER_MAP as CARRIERS
from mkt.feed.constants import FEED_TYPE_SHELF
from mkt.fee... | bsd-3-clause | -7,164,898,191,117,203,000 | 39.20979 | 79 | 0.652522 | false | 3.787879 | true | false | false |
obedmr/MPIaaS | app/echoserv.py | 1 | 1498 | #!/usr/bin/env python
from twisted.internet.protocol import Protocol, Factory
from twisted.internet import reactor
import twisted.internet.error
import sys
import ConfigParser
CONFIG_CONF = "setup.conf"
PORT=8000
class Echo(Protocol):
def dataReceived(self, data):
"""
As soon as any data is rece... | apache-2.0 | -7,503,330,617,456,163,000 | 25.280702 | 56 | 0.55474 | false | 3.8509 | false | false | false |
SimoneLucia/EmbASP-Python | languages/asp/answer_set.py | 1 | 1221 | from languages.asp.asp_mapper import ASPMapper
class AnserSet(object):
"""A collection of data representing a generic Answer Set"""
def __init__(self, value, weightMap=dict()):
self.__value = value # Where data of answer set is stored
self.__weight_map = weightMap # Where weights of the ... | mit | -8,103,394,283,243,837,000 | 31.131579 | 83 | 0.564292 | false | 4.505535 | false | false | false |
nkoep/pymanopt | pymanopt/manifolds/psd.py | 1 | 15204 | import warnings
import numpy as np
from numpy import linalg as la, random as rnd
from scipy.linalg import expm
# Workaround for SciPy bug: https://github.com/scipy/scipy/pull/8082
try:
from scipy.linalg import solve_continuous_lyapunov as lyap
except ImportError:
from scipy.linalg import solve_lyapunov as lyap... | bsd-3-clause | 3,308,188,274,906,176,000 | 36.173594 | 79 | 0.615496 | false | 3.443715 | false | false | false |
UrLab/DocHub | www/rest_urls.py | 1 | 1862 | from rest_framework.routers import APIRootView, DefaultRouter
import catalog.rest
import documents.rest
import notifications.rest
import search.rest
import telepathy.rest
import users.rest
import www.rest
class DochubAPI(APIRootView):
"""
This is the API of DocHub.
You are free to use it to crawl DocHub... | agpl-3.0 | 402,545,330,675,040,000 | 34.807692 | 100 | 0.762084 | false | 3.643836 | false | false | false |
pombredanne/discern | examples/problem_grader/grader/models.py | 1 | 5156 | from django.db import models
from django.contrib.auth.models import User
from django.forms.models import model_to_dict
from django.db.models.signals import post_save, pre_save
import random
import string
from django.conf import settings
import requests
import json
import logging
log= logging.getLogger(__name__)
class... | agpl-3.0 | 7,535,211,253,820,330,000 | 32.480519 | 119 | 0.632661 | false | 4.1248 | false | false | false |
mabotech/mabo.io | py/AK/test/redis_lua000.py | 1 | 1801 | # -*- coding: utf-8 -*-
"""
redis lua
redis eval, notyify in lua script
"""
import time
import redis
def main(key, val, key2, val2):
# connection pool
r = redis.Redis(host='localhost', port=6379, db=5)
d = {"a":"v1"}
"""
eval("lua script","number of kkeys", keys[],argv[])
KEYS[... | mit | -3,571,517,743,080,625,000 | 17.770833 | 61 | 0.481954 | false | 3.052542 | false | false | false |
levilucio/SyVOLT | t_core/HTopClass2TableNAC0.py | 1 | 8862 |
from core.himesis import Himesis, HimesisPreConditionPatternNAC
import cPickle as pickle
from uuid import UUID
class HTopClass2TableNAC0(HimesisPreConditionPatternNAC):
def __init__(self, LHS):
"""
Creates the himesis graph representing the AToM3 model HTopClass2TableNAC0.
"""
... | mit | 731,728,089,143,411,300 | 47.233333 | 117 | 0.51072 | false | 4.568041 | false | false | false |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.