repo_name stringlengths 6 61 | path stringlengths 4 230 | copies stringlengths 1 3 | size stringlengths 4 6 | text stringlengths 1.01k 850k | license stringclasses 15
values | hash int64 -9,220,477,234,079,998,000 9,219,060,020B | line_mean float64 11.6 96.6 | line_max int64 32 939 | alpha_frac float64 0.26 0.9 | autogenerated bool 1
class | ratio float64 1.62 6.1 | config_test bool 2
classes | has_no_keywords bool 2
classes | few_assignments bool 1
class |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
caiogit/bird-a | backend/birda/bModel/widget_catalog/form.py | 1 | 3389 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# -------------------------------------- #
# Enables python3-like strings handling
from __future__ import unicode_literals
str = unicode
# -------------------------------------- #
import collections
from birda.bModel.widget import Widget
from birda.bModel import BIRDA
... | gpl-3.0 | -8,831,213,653,689,240,000 | 28.736842 | 148 | 0.59103 | false | 3.2871 | false | false | false |
PennyDreadfulMTG/Penny-Dreadful-Tools | discordbot/command.py | 1 | 11736 | import collections
import datetime
import re
from copy import copy
from typing import Callable, Dict, List, Optional, Sequence, Set, Tuple, Union
from discord import ChannelType, Client, DMChannel, File, GroupChannel, TextChannel
from discord.abc import Messageable
from discord.ext import commands
from discord.member ... | gpl-3.0 | 8,189,535,629,934,954,000 | 44.204633 | 247 | 0.644517 | false | 3.363401 | false | false | false |
StellarCN/py-stellar-base | stellar_sdk/client/response.py | 1 | 1266 | import json
__all__ = ["Response"]
class Response:
"""The :class:`Response <Response>` object, which contains a
server's response to an HTTP request.
:param status_code: response status code
:param text: response content
:param headers: response headers
:param url: request url
"""
d... | apache-2.0 | -5,366,735,543,725,622,000 | 27.133333 | 85 | 0.555292 | false | 4.083871 | false | false | false |
Nexenta/JujuCharm | nexentaedge/steps/nedeployPrecheck.py | 1 | 3257 | import re
import subprocess
from nexentaedge.settings import Settings
from nexentaedge.nedgeBlockerException import NedgeBlockerException
from baseConfigurationStep import BaseConfigurationStep
blocker_patterns = ['^.*(Less\s+then\s+\d+.*disks)$',
'^.*(Interface.*missing).*$',
... | apache-2.0 | -7,315,549,671,154,198,000 | 32.927083 | 78 | 0.559718 | false | 4.308201 | false | false | false |
shaochangbin/crosswalk | app/tools/android/compress_js_and_css.py | 1 | 1535 | #!/usr/bin/env python
# Copyright (c) 2014 Intel Corporation. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import fnmatch
import os
import stat
import subprocess
def GetJARFilename():
# Version of YUI Compressor.
version = "2.4.8"
# ... | bsd-3-clause | 4,080,109,300,917,108,000 | 29.098039 | 76 | 0.660586 | false | 3.11359 | false | false | false |
mitschabaude/nanopores | scripts/numerics/diffusion_with_force_profile.py | 1 | 4313 | """
TODO:
-) understand no boundary condition
-) validate understanding with analytical solution
"""
import nanopores, dolfin, os
from nanopores.physics.simplepnps import SimpleNernstPlanckProblem
import matplotlib.pyplot as plt
import matplotlib.ticker as ticker
import force_profiles
from collections import de... | mit | -9,171,758,129,615,507,000 | 28.340136 | 81 | 0.566659 | false | 2.830052 | false | false | false |
dpazel/music_rep | structure/beam.py | 1 | 4540 | """
File: beam.py
Purpose: Defines the Beam note construct.
"""
from structure.abstract_note_collective import AbstractNoteCollective
from structure.note import Note
from structure.tuplet import Tuplet
from fractions import Fraction
from timemodel.duration import Duration
class Beam(AbstractNoteCollective):
"... | mit | -7,834,370,034,548,237,000 | 37.151261 | 111 | 0.593392 | false | 4.223256 | false | false | false |
jolicode/slack-secret-santa | tasks.py | 1 | 8811 | from invoke import task
from shlex import quote
from colorama import Fore
import json
import os
import re
import requests
import subprocess
@task
def build(c):
"""
Build the infrastructure
"""
command = 'build'
command += ' --build-arg PROJECT_NAME=%s' % c.project_name
command += ' --build-arg... | mit | 2,870,649,700,403,755,000 | 26.194444 | 142 | 0.590852 | false | 3.346373 | false | false | false |
PrincessTeruko/TsunArt | posts/views.py | 1 | 1114 | from django.conf import settings
from django.contrib.auth.forms import AuthenticationForm
from django.core.urlresolvers import reverse
from django.db.models import Count
from django.http import Http404, HttpResponse, HttpResponseRedirect
from django.shortcuts import get_object_or_404, redirect, render
from django.views... | mit | 6,976,874,274,254,265,000 | 28.315789 | 67 | 0.745961 | false | 3.266862 | false | false | false |
GDGLima/contentbox | third_party/search/views.py | 13 | 2007 | from django.conf import settings
from djangotoolbox.http import JSONResponse
def live_search_results(request, model, search_index='search_index', limit=30,
result_item_formatting=None, query_converter=None,
converter=None, redirect=False):
"""
Performs a search in searched_model and prints the ... | apache-2.0 | -635,962,334,027,517,400 | 36.886792 | 78 | 0.627304 | false | 4.087576 | false | false | false |
ctrlrsf/cloudflare2loggly | sftplib.py | 1 | 2067 | """
Simple SFTP client using Paramiko
"""
from __future__ import print_function
import logging
import paramiko
LOG = logging.getLogger('sftplib')
class SFTPClient(object):
"""
Simple SFTP client using Paramiko
"""
def __init__(self, hostname, port, username, key_file):
"""
Create the ... | mit | 3,358,563,962,904,878,000 | 26.197368 | 75 | 0.568457 | false | 4.416667 | false | false | false |
dhp-denero/LibrERP | l10n_sale_report/ddt.py | 2 | 6515 | # -*- coding: utf-8 -*-
##############################################################################
#
# Copyright (C) 2011 Associazione OpenERP Italia
# (<http://www.openerp-italia.org>).
# Copyright (C) 2014 Didotech SRL
# All Rights Reserved
#
# This program is free software: you can redistribute it... | agpl-3.0 | -3,769,366,328,522,302,500 | 39.216049 | 216 | 0.560246 | false | 3.629526 | false | false | false |
ptisserand/ansible | lib/ansible/modules/windows/win_chocolatey.py | 7 | 7785 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright: (c) 2014, Trond Hindenes <trond@hindenes.com>
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
# this is a windows documentation stub. actual code lives in the .ps1
# file of the same name
ANSIBLE_METADATA = {'metadat... | gpl-3.0 | 2,074,543,620,453,216,000 | 30.77551 | 155 | 0.694798 | false | 3.632758 | false | false | false |
alice1017/gitTools | git-ref.py | 1 | 5307 | #!/usr/bin/env python
#coding: utf-8
import sys
from util import core
from util import adjust
from util.git import *
from argparse import ArgumentParser, SUPPRESS
# usage
# git ref b81fe395c0bf28c4be8 -> ハッシュ[b81fe395c0bf28c4be8]の[hash値]を出力
# git ref tag ... | mit | 2,252,298,493,873,955,000 | 27.478022 | 108 | 0.549682 | false | 3.533061 | false | false | false |
Rekoc/EmmaWebSite | WebSite/models.py | 1 | 1364 | from django.db import models
# Create your models here.
class Article(models.Model):
titre = models.CharField(max_length=100)
auteur = models.CharField(max_length=42)
contenu = models.TextField(null=True)
date = models.DateTimeField(auto_now_add=True, auto_now=False,
ver... | gpl-3.0 | -6,574,491,940,388,614,000 | 35.864865 | 72 | 0.687683 | false | 3.618037 | false | false | false |
neil-davis/penfold | src/features/steps/plugin_steps.py | 1 | 1960 | import logging
from behave import given, when, then
from penfold import PenfoldPluginManager
from penfold import InputOutputFactory
log = logging.getLogger(__name__)
@then(u'execute the plugin')
def execute_the_plugin(context):
input_name1, input_value1 = context._first_input
context._plugin.set_input_value(... | gpl-3.0 | -5,694,026,608,792,462,000 | 33.385965 | 104 | 0.694898 | false | 3.316413 | false | false | false |
staticsan/light-layers | lightlayers.py | 1 | 8961 | #!/usr/bin/python
#
"""
LightLayers module for Holiday by Moorescloud
Copyright (c) 2013, Wade Bowmer
License: ..
"""
__author__ = 'Wade Bowmer'
__version__ = '0.01-dev'
__license__ = 'MIT'
import time
import colours
class LightLayer:
remote = False
addr = ''
NUM_GLOBES = 50
stream = { }
current_time = 0
fur... | mit | -1,845,444,021,206,732,800 | 30.222997 | 135 | 0.626827 | false | 2.690183 | false | false | false |
dmccloskey/SBaaS_quantification | SBaaS_quantification/stage01_quantification_peakInformation_io.py | 1 | 36429 | # System
import json,re
# SBaaS
from .stage01_quantification_peakInformation_query import stage01_quantification_peakInformation_query
from .stage01_quantification_MQResultsTable_query import stage01_quantification_MQResultsTable_query
# Resources
from io_utilities.base_importData import base_importData
from io_utilit... | mit | 7,779,765,412,555,950,000 | 58.718033 | 374 | 0.544706 | false | 3.943596 | false | false | false |
dhondta/tinyscript | tinyscript/preimports/ncodecs/morse.py | 1 | 2619 | # -*- coding: UTF-8 -*-
"""Morse Codec - morse content encoding.
This codec:
- en/decodes strings from str to str
- en/decodes strings from bytes to bytes
- decodes file content to str (read)
- encodes file content from str to bytes (write)
"""
from ._utils import *
ENCMAP = {
# letters
'a': ".-", 'b': "-...... | agpl-3.0 | -4,708,215,410,679,469,000 | 30.554217 | 80 | 0.392516 | false | 3.344828 | false | false | false |
costadorione/purestream | servers/gamovideo.py | 1 | 2912 | # -*- coding: utf-8 -*-
#------------------------------------------------------------
# streamondemand - XBMC Plugin
# Conector para gamovideo
# http://www.mimediacenter.info/foro/viewforum.php?f=36
#------------------------------------------------------------
import re
from core import jsunpack
from core import logg... | gpl-3.0 | -6,720,686,270,816,700,000 | 38.876712 | 123 | 0.61594 | false | 3.143629 | false | false | false |
openstack/zaqar | zaqar/transport/wsgi/utils.py | 1 | 8333 | # Copyright (c) 2013 Rackspace, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may not
# use this file except in compliance with the License. You may obtain a copy
# of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in w... | apache-2.0 | 4,532,507,697,386,719,000 | 32.873984 | 79 | 0.675267 | false | 4.264585 | false | false | false |
mikehulluk/morphforge | src/morphforgecontrib/simulation/populations/group_analysis.py | 1 | 3491 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# ---------------------------------------------------------------------
# Copyright (c) 2012 Michael Hull.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are m... | bsd-2-clause | -3,049,875,634,603,801,600 | 37.362637 | 127 | 0.651962 | false | 3.870288 | false | false | false |
mshameers/theory_website | app/utils.py | 1 | 1618 | import re
import unidecode
from functools import wraps
from flask import session, redirect, url_for
from datetime import datetime
from werkzeug.contrib.cache import SimpleCache
from wtforms.validators import regexp
from pytz import UTC
is_name = regexp(
# not using \w since it allows for unlimited underscores
... | gpl-2.0 | -4,017,023,542,743,401,000 | 29.54717 | 78 | 0.6267 | false | 3.728111 | false | false | false |
dreams6/pyerpcn | pyerp/fnd/gbl.py | 1 | 6577 | # -*- coding: utf-8 -*-
"""
maybe a better solution
http://code.djangoproject.com/wiki/CookBookThreadlocalsAndUser
"""
try:
import thread
except ImportError:
import dummy_thread as thread
try:
from functools import wraps
except ImportError:
from django.utils.functional import wraps # Python 2.3, ... | gpl-3.0 | 9,184,875,610,303,837,000 | 27.744292 | 135 | 0.587609 | false | 3.510876 | false | false | false |
ryanjdillon/smartmove | smartmove/utils.py | 1 | 10244 | '''
This module contains utility functions using in Smartmove
'''
def mask_from_noncontiguous_indices(n, start_ind, stop_ind):
'''Create boolean mask from start stop indices of noncontiguous regions
Args
----
n: int
length of boolean array to fill
start_ind: numpy.ndarray
start ind... | mit | 7,730,799,665,802,462,000 | 26.836957 | 77 | 0.596251 | false | 4.010963 | false | false | false |
GregDMeyer/dynamite | config_extensions.py | 1 | 5481 |
from os import environ
from os.path import join, dirname, realpath
from subprocess import check_output
from setuptools import Extension
from setuptools.command.build_ext import build_ext
import numpy
import petsc4py
import slepc4py
extension_names = [
'bsubspace',
'bbuild',
'bpetsc'
]
header_only = {
... | mit | 94,712,092,300,876,580 | 29.45 | 87 | 0.52089 | false | 3.881728 | false | false | false |
imatec/prueba_front | prueba_front.py | 1 | 6476 | # -*- coding: utf-8 -*-
import os
import logging
from flask import Flask, abort, request, jsonify, g, url_for, render_template
from flask.ext.script import Manager
from flask.ext.sqlalchemy import SQLAlchemy
from flask.ext.httpauth import HTTPBasicAuth
from passlib.apps import custom_app_context as pwd_context
from its... | mit | 7,299,456,046,211,614,000 | 29.780952 | 90 | 0.619121 | false | 3.528384 | true | false | false |
jerrylei98/Dailydos | app.py | 1 | 3926 | from flask import Flask, render_template, request, redirect, session, url_for
import login_utils, tasks_utils
application = Flask(__name__)
@application.route("/", methods=['GET','POST'])
@application.route("/home", methods=['GET','POST'])
def home():
if 'logged_in' not in session:
session['logged_in'] = ... | mit | -311,086,397,280,734,200 | 39.895833 | 135 | 0.57081 | false | 4.295405 | false | false | false |
ucsb-cs/submit | submit/migrations/versions/32e8060589b8_add_missing_indexes.py | 1 | 1674 | """Add missing indexes.
Revision ID: 32e8060589b8
Revises: a3fe8c8a344
Create Date: 2014-02-11 17:21:00.718449
"""
# revision identifiers, used by Alembic.
revision = '32e8060589b8'
down_revision = 'a3fe8c8a344'
from alembic import op
import sqlalchemy as sa
def upgrade():
### commands auto generated by Alemb... | bsd-2-clause | 8,611,515,270,830,671,000 | 43.052632 | 99 | 0.701314 | false | 3.105751 | false | false | false |
ocadotechnology/wry | wry/AMTRedirection.py | 1 | 1893 | # Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under t... | apache-2.0 | 1,549,599,297,185,251,800 | 31.637931 | 185 | 0.645536 | false | 3.741107 | false | false | false |
storborg/sidecar | sidecar/themes/light/__init__.py | 1 | 1199 | from pyramid_frontend.theme import Theme
from pyramid_frontend.images import FilterChain
from pyramid_frontend.assets.less import LessAsset
from pyramid_frontend.assets.requirejs import RequireJSAsset
class LightTheme(Theme):
key = 'light'
image_filters = (
FilterChain(
'thumb', width=330... | mit | 3,023,817,755,633,104,400 | 29.74359 | 73 | 0.58799 | false | 3.677914 | false | false | false |
shanzi/myicons | fontbuilder/ttf2eot/bytebuffer.py | 3 | 1339 | #!/usr/bin/env python
# encoding: utf-8
import io
import struct
class ByteBuffer(io.BytesIO):
def makefmt(self, width, littleEndian=False):
fmt = '<' if littleEndian else '>'
if width == 8: fmt += 'B'
elif width == 16: fmt += 'H'
elif width == 32: fmt += 'I'
else: fmt += ... | bsd-2-clause | -729,330,362,267,760,800 | 27.489362 | 61 | 0.584765 | false | 3.580214 | false | false | false |
xcxuanchen/eden_growth_model | BD5.py | 1 | 7485 | import numpy as np
import matplotlib.pyplot as plt
import matplotlib.animation as animation
import time
class BallisticDeposition:
"""store all heights as a 1 dim array"""
def __init__(self, L_x, Periodic_BCs=None):
"""need to enter parameters as floats; actual system width is L... | mit | -437,188,560,711,102,100 | 37.198953 | 209 | 0.562725 | false | 3.908616 | false | false | false |
zackw/active-geolocator | maps/make_geog_baseline.py | 1 | 10351 | #! /usr/bin/python3
"""Construct a geographic "baseline" matrix from a collection of
shapefiles (assumed to be maps of the Earth). Shapefiles can be
either "positive" or "negative". The baseline matrix represents a
grid laid over the Earth; points inside the union of positive geometry
and not inside the union of neg... | mit | -7,904,016,563,273,701,000 | 38.208333 | 80 | 0.55328 | false | 3.955292 | false | false | false |
cxcsds/ciao-contrib | ciao_contrib/caldb.py | 1 | 15200 | #
# Copyright (C) 2010, 2011, 2012, 2014, 2015, 2016, 2019
# Smithsonian Astrophysical Observatory
#
#
# 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 Lice... | gpl-3.0 | 4,398,095,165,819,895,300 | 28.287091 | 107 | 0.586447 | false | 3.988454 | false | false | false |
tellproject/helper_scripts | tpcc_server.py | 1 | 1105 | #!/usr/bin/env python
from threaded_ssh import ThreadedClients
from ServerConfig import Tpcc
from ServerConfig import Kudu
from ServerConfig import TellStore
from ServerConfig import General
def hostToIp(host):
return General.infinibandIp[host]
def semicolonReduce(x, y):
return x + ';' + y
cmd = ""
if Tpcc.... | apache-2.0 | 6,247,841,676,958,327,000 | 35.833333 | 261 | 0.711312 | false | 2.675545 | false | false | false |
clearpathrobotics/axis_camera | nodes/teleop.py | 1 | 1321 | #!/usr/bin/python
import rospy
from sensor_msgs.msg import Joy
from axis_camera.msg import Axis
class Teleop:
def __init__(self):
rospy.init_node('axis_ptz_teleop')
self.enable_button = rospy.get_param('~enable_button', 1)
self.axis_pan = rospy.get_param('~axis_pan', 0)
self.axis_... | bsd-3-clause | 5,746,486,995,024,746,000 | 32.871795 | 79 | 0.570023 | false | 3.387179 | false | false | false |
bswartz/manila | manila/tests/share/drivers/test_service_instance.py | 1 | 106768 | # Copyright (c) 2014 NetApp, Inc.
# Copyright (c) 2015 Mirantis, 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/license... | apache-2.0 | -2,590,683,383,154,454,500 | 45.300087 | 79 | 0.600845 | false | 3.866725 | true | false | false |
eqrx/mauzr | mauzr/gui/elements/meta.py | 1 | 2003 | """ Meta elements. """
from mauzr.gui import TextMixin, ColorStateMixin, RectBackgroundMixin
from mauzr.gui import BaseElement, ColorState
__author__ = "Alexander Sowitzki"
class Acceptor(TextMixin, RectBackgroundMixin, BaseElement):
""" Acknowledge all states via one click.
:param placement: Center and si... | agpl-3.0 | 1,007,512,086,339,034,500 | 28.895522 | 74 | 0.631553 | false | 3.982107 | false | false | false |
HalShaw/Leetcode | Two Sum II - Input array is sorted.py | 1 | 1388 | class Solution(object):
def twoSum(self, numbers, target):
"""
:type numbers: List[int]
:type target: int
:rtype: List[int]
"""
if len(numbers)<2:
return None
else:
for i in range(len(numbers)):#自己写的,时间复杂度O(n^2),AC不了
for... | mit | 7,454,215,357,454,273,000 | 30.833333 | 63 | 0.41991 | false | 3.690608 | false | false | false |
FuegoFro/KeepTalkingBot | src/modules/complicated_wires_cv.py | 1 | 3415 | import cv2
from cv_helpers import extract_color, get_subset, get_dimens, show, get_contours, \
get_center_for_contour, apply_offset_to_single_location
from modules.complicated_wires_common import WireColor
_WIRE_Y_BOUNDARIES = (
64.0,
73.6,
)
_LED_Y_BOUNDARIES = (
13.8,
20.9,
)
_STAR_Y_BOUNDARIES ... | mit | -4,617,776,191,764,275,000 | 29.491071 | 98 | 0.59795 | false | 2.765182 | false | false | false |
manjaro/thus | thus/installation/chroot.py | 1 | 4851 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# chroot.py
#
# This file was forked from Cnchi (graphical installer from Antergos)
# Check it at https://github.com/antergos
#
# Copyright © 2013-2015 Antergos (http://antergos.com/)
# Copyright © 2013-2015 Manjaro (http://manjaro.org)
#
# This program is free soft... | gpl-3.0 | 6,578,615,531,245,678,000 | 33.147887 | 124 | 0.63807 | false | 3.926316 | false | false | false |
yougov/pmxbot | pmxbot/quotes.py | 1 | 7008 | import random
import operator
from . import storage
from .core import command
class Quotes(storage.SelectableStorage):
lib = 'pmx'
@classmethod
def initialize(cls):
cls.store = cls.from_URI()
cls._finalizers.append(cls.finalize)
@classmethod
def finalize(cls):
del cls.st... | mit | 8,421,166,876,933,345,000 | 31.146789 | 82 | 0.540525 | false | 3.869685 | false | false | false |
warriorframework/warriorframework | warrior/WarriorCore/Classes/html_results_class.py | 1 | 10967 | """
Copyright 2017, Fujitsu Network Communications, Inc.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in w... | apache-2.0 | 3,793,665,087,416,468,000 | 45.668085 | 133 | 0.529498 | false | 4.200306 | true | false | false |
zhenxuan00/mmdgm | mlp-mmdgm/anglepy/models/GPUVAE_MM_Z_X.py | 1 | 20222 | '''
Code for mmDGM
Author: Chongxuan Li (chongxuanli1991@gmail.com)
Co-author: Tianlin Shi
Version = '1.0'
'''
import sys, os
import pdb
import numpy as np
import theano
import theano.tensor as T
import collections as C
import anglepy as ap
import anglepy.ndict as ndict
import color
from anglepy.misc import lazytheano... | mit | 6,343,238,090,610,356,000 | 42.676026 | 303 | 0.500198 | false | 2.963365 | false | false | false |
erggo/Harpy | harpia/amara/saxtools.py | 2 | 22115 | #Python 2.3 or higher required
from xml import sax
from xml.dom import EMPTY_NAMESPACE as NULL_NAMESPACE
from xml.dom import EMPTY_PREFIX as NULL_PREFIX
from xml.dom import XML_NAMESPACE
from xml.dom import Node
from Ft.Xml import Domlette
START_DOCUMENT = 1
END_DOCUMENT = 2
START_ELEMENT... | gpl-3.0 | 5,785,131,844,268,594,000 | 36.610544 | 156 | 0.589193 | false | 4.091582 | true | false | false |
georgistanev/django-dash | src/dash/contrib/plugins/video/dash_widgets.py | 1 | 1797 | __author__ = 'Artur Barseghyan <artur.barseghyan@gmail.com>'
__copyright__ = 'Copyright (c) 2013 Artur Barseghyan'
__license__ = 'GPL 2.0/LGPL 2.1'
__all__ = (
'BaseVideoWidget', 'Video1x1Widget', 'Video2x2Widget', 'Video3x3Widget',
'Video4x4Widget', 'Video5x5Widget'
)
from django.template.loader import render... | gpl-2.0 | -6,775,300,280,484,336,000 | 23.616438 | 76 | 0.49527 | false | 3.77521 | false | false | false |
nviel/geostat | ForbRecord.py | 1 | 1470 | #!/usr/bin/python
# -*- coding: utf-8 -*-
class ForbRecord:
def __init__(self,line='',hit=0, key='', ref=''):
if line != '':
(h,self.key,ref) = line.split('|',2)
self.hit = int(h)
self.ref = set(ref.split())
return
if key != '':
self.key = key
if ref != '':
self.r... | mit | -4,623,617,808,017,423,000 | 20.617647 | 116 | 0.509524 | false | 3.107822 | false | false | false |
rovest/UlyssesReportAndMarkdown | md_split2ulysses_xcall.py | 1 | 2495 | #coding: utf-8
'''
python3
md_split2ulysses_xcall.py
2017-04-07 at 09:55 EDT
Will take Markdown file as input or from clipboard and split it to Ulysses sheets
at chosen heading levels.
A new Ulysses group for these sheets will be created at root level.
'''
import subprocess
import json
import sys
import re
import url... | mit | 4,419,663,919,681,229,000 | 28.011628 | 96 | 0.612425 | false | 2.973778 | false | false | false |
thenetcircle/dino | dino/rest/resources/rooms_for_users.py | 1 | 2462 | from datetime import datetime
from dino.exceptions import NoSuchRoomException
from flask import request
import logging
from dino.utils import b64e
from dino.utils.decorators import timeit
from dino.rest.resources.base import BaseResource
from dino import environ
logger = logging.getLogger(__name__)
class RoomsFor... | apache-2.0 | 1,053,603,811,281,318,700 | 29.395062 | 78 | 0.565394 | false | 3.914149 | false | false | false |
twz915/django | tests/forms_tests/field_tests/test_floatfield.py | 15 | 3657 | from django.forms import FloatField, NumberInput, ValidationError
from django.test import SimpleTestCase
from django.utils import formats, translation
from . import FormFieldAssertionsMixin
class FloatFieldTest(FormFieldAssertionsMixin, SimpleTestCase):
def test_floatfield_1(self):
f = FloatField()
... | bsd-3-clause | -4,090,251,715,257,690,000 | 42.023529 | 111 | 0.613344 | false | 3.664329 | true | false | false |
miketheman/fullstack | site-cookbooks/fullstack/files/default/webapp.py | 1 | 2087 | #!/usr/bin/env python
'''
This application is a simple implemnetation of a word counter.
It leverages the bottle micro-framework, as well as pymongo.
'''
import time
from bottle import route, run, response, request, template
from bson.json_util import default
import pymongo
from pymongo.uri_parser import parse_uri
imp... | mit | -2,513,415,409,055,776,000 | 27.60274 | 78 | 0.690944 | false | 3.328549 | false | false | false |
dchaplinsky/declarations.com.ua | declarations_site/landings/models.py | 1 | 12334 | from itertools import chain
import hashlib
from django.db import models
from django.contrib.postgres.fields import JSONField, ArrayField
from django.core.serializers.json import DjangoJSONEncoder
from django.urls import reverse
from django.utils.translation import gettext as _, get_language
from dateutil.parser impo... | mit | -1,422,018,491,001,332,500 | 32.20904 | 88 | 0.514886 | false | 3.72733 | false | false | false |
ang2ara/elearning | nusa/settings.py | 1 | 4445 | """
Django settings for nusa project.
For more information on this file, see
https://docs.djangoproject.com/en/dev/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/dev/ref/settings/
"""
# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
impor... | lgpl-3.0 | 2,634,240,403,403,597,300 | 28.437086 | 74 | 0.732958 | false | 3.596278 | false | false | false |
rthouvenin/meteography | meteography/django/broadcaster/forecast.py | 1 | 2965 | # -*- coding: utf-8 -*-
from datetime import datetime
from sklearn.neighbors import DistanceMetric
from django.utils.timezone import utc
from meteography.neighbors import NearestNeighbors
from meteography.django.broadcaster.models import Prediction
from meteography.django.broadcaster.storage import webcam_fs
def ... | mit | 5,971,376,574,569,990,000 | 33.476744 | 79 | 0.648229 | false | 4.112344 | false | false | false |
mgraupe/acq4 | acq4/util/ColorMapper/CMTemplate.py | 4 | 3370 | # -*- coding: utf-8 -*-
# Form implementation generated from reading ui file './acq4/util/ColorMapper/CMTemplate.ui'
#
# Created: Tue Dec 24 01:49:16 2013
# by: PyQt4 UI code generator 4.10
#
# WARNING! All changes made in this file will be lost!
from PyQt4 import QtCore, QtGui
try:
_fromUtf8 = QtCore.QStri... | mit | -2,164,891,471,097,324,300 | 42.766234 | 92 | 0.675074 | false | 3.740289 | false | false | false |
craigtracey/nova-docker | novadocker/tests/virt/docker/test_network.py | 3 | 3612 | # Copyright 2014 OpenStack Foundation
# 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 requ... | apache-2.0 | 1,277,902,536,624,382,000 | 40.517241 | 79 | 0.629845 | false | 3.659574 | true | false | false |
wscullin/spack | var/spack/repos/builtin/packages/mrbayes/package.py | 3 | 2955 | ##############################################################################
# Copyright (c) 2013-2017, Lawrence Livermore National Security, LLC.
# Produced at the Lawrence Livermore National Laboratory.
#
# This file is part of Spack.
# Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved.
# LLNL-CODE-64... | lgpl-2.1 | 1,541,369,795,507,201,300 | 40.041667 | 103 | 0.643993 | false | 3.817829 | false | false | false |
danielfrg/jupyterhub-kubernetes_spawner | kubernetes_spawner/swagger_client/apis/apiv_api.py | 1 | 850227 | # coding: utf-8
"""
ApivApi.py
Copyright 2015 SmartBear Software
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 a... | apache-2.0 | -1,206,368,449,628,720,000 | 41.895263 | 322 | 0.549097 | false | 5.059851 | false | false | false |
btenaglia/hpc-historias-clinicas | hpc-historias-clinicas/ayudantes/views.py | 1 | 1147 | # -*- coding: utf-8 -*-
from django.views.generic import ListView, CreateView, UpdateView, DeleteView
from django.contrib import messages
from braces.views import LoginRequiredMixin
from .models import Ayudantes
class AyudantesMixin(object):
@property
def success_msg(self):
return NotImplemented
... | bsd-3-clause | -2,561,103,147,593,230,000 | 22.875 | 77 | 0.708297 | false | 3.309249 | false | false | false |
tjcsl/ion | intranet/apps/eighth/views/admin/hybrid.py | 1 | 11270 | import logging
from typing import Optional
from formtools.wizard.views import SessionWizardView
from django import http
from django.contrib import messages
from django.shortcuts import get_object_or_404, redirect, render, reverse
from ....auth.decorators import eighth_admin_required
from ....users.models import Grou... | gpl-2.0 | -1,466,880,286,373,412,900 | 43.196078 | 141 | 0.65732 | false | 3.690242 | false | false | false |
LarsFronius/ansible | lib/ansible/plugins/callback/foreman.py | 20 | 7129 | # -*- coding: utf-8 -*-
# (C) 2015, 2016 Daniel Lobato <elobatocs@gmail.com>
# 2016 Guido Günther <agx@sigxcpu.org>
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundati... | gpl-3.0 | 2,600,363,873,120,758,000 | 35 | 83 | 0.574214 | false | 4.03624 | false | false | false |
GeorgiMateev/twitter-user-gender-classification | notebooks/twitter/get_users_data.py | 1 | 1231 | import twitter
# Authentication parameters - fill manually! You need to create a Twitter app in dev.twitter.com
# in order to be given these OAUTH2 parameters for the authentication (mandatory) to your app
# Reference: https://aaronparecki.com/oauth-2-simplified/#creating-an-app (general example, but applies for twit... | mit | 7,175,335,983,324,748,000 | 35.235294 | 116 | 0.651503 | false | 3.631268 | false | false | false |
ValliereMagic/TomatoPython | Main.py | 1 | 2974 | import pickle
import sqlite3
import Fruit
class Main:
def __init__(self):
self.fruit_list = Fruit.FruitList()
self.sqlite_db = None
self.run()
@staticmethod
def print_instructions():
print("Enter the number of an option to complete a task: \n",
"1.) Add a ... | gpl-3.0 | 501,980,693,978,030,700 | 25.087719 | 89 | 0.5269 | false | 3.944297 | false | false | false |
rwgdrummer/maskgen | plugins/Crop/__init__.py | 1 | 1197 | import numpy
from maskgen.image_wrap import ImageWrapper
import cv2
def transform(img,source,target,**kwargs):
pixelWidth = int(kwargs['pixel_width'])
pixelHeight = int(kwargs['pixel_height'])
x = int(kwargs['crop_x'])
y = int(kwargs['crop_y'])
cv_image = numpy.array(img)
new_img = cv_image[y:-... | bsd-3-clause | -7,159,309,722,363,650,000 | 36.40625 | 121 | 0.573935 | false | 3.911765 | false | false | false |
redmatter/combine | combine/manifest.py | 1 | 1719 | # Copyright (c) 2010 John Reese
# Licensed under the MIT license
import yaml
from combine import CombineError
MANIFEST_FORMAT = 1
class Manifest:
def __init__(self):
self.properties = {"manifest-format": MANIFEST_FORMAT}
self.actions = []
def __getitem__(self, key):
return self.pro... | mit | 3,079,288,446,139,151,400 | 22.875 | 70 | 0.577661 | false | 4.244444 | false | false | false |
kfarr2/django-local-settings | local_settings/loader.py | 1 | 4233 | import os
import re
from collections import Mapping, OrderedDict, Sequence
from six import string_types
from .base import Base
from .exc import SettingsFileNotFoundError
from .types import LocalSetting
from .util import NO_DEFAULT as PLACEHOLDER
class Loader(Base):
def __init__(self, file_name=None, section=No... | mit | -1,325,149,308,229,342,700 | 35.808696 | 89 | 0.544767 | false | 4.288754 | false | false | false |
WmHHooper/aima-python | submissions/aardvark/myCSPs.py | 1 | 1655 | import csp
rgb = ['R', 'G', 'B']
d2 = { 'A' : rgb, 'B' : rgb, 'C' : ['R'], 'D' : rgb,}
v2 = d2.keys()
n2 = {'A' : ['B', 'C', 'D'],
'B' : ['A', 'C', 'D'],
'C' : ['A', 'B'],
'D' : ['A', 'B'],}
def constraints(A, a, B, b):
if A == B: # e.g. NSW == NSW
return True
if a == b: ... | mit | 2,727,498,772,143,534,000 | 22.985507 | 53 | 0.470695 | false | 2.772194 | false | false | false |
gg7/diamond | src/diamond/handler/test/testtsdb.py | 1 | 17036 | #!/usr/bin/python
# coding=utf-8
##########################################################################
from test import unittest
from mock import Mock
import configobj
from diamond.handler.tsdb import TSDBHandler
import diamond.handler.tsdb as mod
from diamond.metric import Metric
# These two methods are used... | mit | 3,479,828,976,782,790,700 | 38.526682 | 80 | 0.582472 | false | 4.102095 | true | false | false |
vivanov1410/pifarmer-python | api.py | 1 | 2797 | import json
import time
from datetime import datetime
import requests
from cache import *
class BaseApi:
def __init__(self, environment='development'):
self.base_url = 'http://pifarm-api.herokuapp.com/v1' if environment == 'development' else 'http://pifarm.apphb.com/v1'
self.sessionToken = None
... | gpl-3.0 | -5,987,170,202,995,076,000 | 42.030769 | 142 | 0.567036 | false | 4.089181 | false | false | false |
laysakura/shellstreaming | example/03_CountWindow.py | 1 | 1526 | # -*- coding: utf-8 -*-
from shellstreaming import api
from shellstreaming.istream import IncInt
from shellstreaming.operator import CountWindow
from shellstreaming.ostream import LocalFile
OUTPUT_FILE = '/tmp/03_CountWindow.txt'
def main():
incint_stream = api.IStream(IncInt, max_records=6)
incint_win = ap... | apache-2.0 | 7,349,580,398,508,393,000 | 32.173913 | 100 | 0.589122 | false | 3.139918 | false | false | false |
andrewyoung1991/abjad | abjad/tools/scoretools/test/test_scoretools_Rest___copy__.py | 2 | 1144 | # -*- encoding: utf-8 -*-
from abjad import *
import copy
def test_scoretools_Rest___copy___01():
r'''Copy rest.
'''
rest_1 = Rest((1, 4))
rest_2 = copy.copy(rest_1)
assert isinstance(rest_1, Rest)
assert isinstance(rest_2, Rest)
assert format(rest_1) == format(rest_2)
assert rest_1 ... | gpl-3.0 | -4,571,919,088,271,024,000 | 23.891304 | 77 | 0.627622 | false | 3.058824 | false | false | false |
wtsi-hgi/serapis | serapis/controller/db/data_access.py | 1 | 83791 |
#################################################################################
#
# Copyright (c) 2013 Genome Research Ltd.
#
# Author: Irina Colgiu <ic4@sanger.ac.uk>
#
# 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 t... | agpl-3.0 | 4,441,826,606,016,935,000 | 48.87619 | 197 | 0.578022 | false | 3.909986 | false | false | false |
nismod/energy_demand | tests/read_write/test_narrative_related.py | 1 | 3498 | from energy_demand.read_write.narrative_related import crit_dim_var
from collections import OrderedDict
class TestCritDimensionsVar:
def test_crit_in_list(self):
crit_in_list = [
{'sig_midpoint': 0, 'value_by': 5, 'diffusion_choice': 'linear',
'fueltype_replace': 0, 'regional_spec... | mit | 2,737,258,833,728,051,000 | 32.314286 | 83 | 0.493711 | false | 3.591376 | true | false | false |
dndtools/dndtools | dndtools/dnd/mobile/mobile_dispatcher.py | 4 | 1401 | # -*- coding: utf-8 -*-
import re
from django.core.urlresolvers import reverse
class MobileDispatcher(object):
def __init__(self):
# TODO autodispatch
self.dispatch_methods = {}
for method_name in dir(self):
m = re.match(r'^_dispatch_(.*)$', method_name)
if m:
... | mit | -834,625,915,420,921,500 | 29.478261 | 97 | 0.624554 | false | 4.037464 | false | false | false |
jkleckner/ansible | setup.py | 5 | 1396 | #!/usr/bin/env python
import os
import sys
from glob import glob
sys.path.insert(0, os.path.abspath('lib'))
from ansible import __version__, __author__
from distutils.core import setup
# find library modules
from ansible.constants import DEFAULT_MODULE_PATH
dirs=os.listdir("./library/")
data_files = []
for i in dirs... | gpl-3.0 | -2,027,185,799,533,219,000 | 27.489796 | 92 | 0.604585 | false | 3.84573 | false | false | false |
jindaxia/you-get | src/you_get/extractors/dilidili.py | 2 | 2738 | #!/usr/bin/env python
__all__ = ['dilidili_download']
from ..common import *
#----------------------------------------------------------------------
def dilidili_parser_data_to_stream_types(typ ,vid ,hd2 ,sign):
"""->list"""
parse_url = 'http://player.005.tv/parse.php?xmlurl=null&type={typ}&vid={vid}&hd={hd2... | mit | -8,038,797,522,279,569,000 | 41.092308 | 155 | 0.51133 | false | 3.067265 | false | false | false |
littlezz/IslandCollection | core/islands/koukuko.py | 1 | 1292 | from .base import BaseIsland
from core.islands.mixins import NextPageJsonParameterMixin
from urllib import parse
__author__ = 'zz'
class KoukokuIsland(NextPageJsonParameterMixin, BaseIsland):
"""
光驱岛
"""
_island_name = 'kukuku'
_island_netloc = 'kukuku.cc'
_static_root = 'http://static.koukuko... | mit | -627,006,767,951,967,000 | 25.541667 | 100 | 0.61617 | false | 3.06988 | false | false | false |
GNOME/pygobject | tests/test_iochannel.py | 1 | 16023 | # -*- Mode: Python -*-
import os
import unittest
import tempfile
import os.path
import shutil
import warnings
try:
import fcntl
except ImportError:
fcntl = None
from gi.repository import GLib
from gi import PyGIDeprecationWarning
class IOChannel(unittest.TestCase):
def setUp(self):
self.workdir... | lgpl-2.1 | -5,494,967,302,935,756,000 | 32.696842 | 92 | 0.579345 | false | 3.392539 | true | false | false |
glaudsonml/kurgan-ai | agents/agentBruteForce.py | 1 | 4898 | #!/usr/bin/env python3
'''
Brute Force Attack Agent
'''
import sys,os
import validators
import re, random
from furl import *
from urllib.parse import urlparse
import time, signal
from multiprocessing import Process
import threading
import stomp
import re
from daemonize import Daemonize
from os.path import basename
fro... | apache-2.0 | 4,952,029,758,148,651,000 | 25.197861 | 72 | 0.564516 | false | 3.572575 | false | false | false |
daishoui/MyGithub | taskCode/ForSY2/test2.py | 1 | 2938 | #--*-- coding: utf-8 --*--
def readLinesFromFile(filename):
f = open(filename)
lines = f.readlines()
f.close()
return lines
def writeLinesToFile(filename, lines):
f = open(filename,'w')
for line in lines:
f.write(str(line[0]) + ' ' + str(line[1]) + ' ' + str(line[2]) + '\n')
f.clos... | gpl-3.0 | -1,871,335,639,390,152,400 | 27.183673 | 88 | 0.55286 | false | 2.859213 | false | false | false |
mike-perdide/pcoords-gui | pcoordsgui/main_window.py | 1 | 17909 | #!/usr/bin/env python
#
######################
# Frontend for Pcoords
######################
# (C) 2008 Sebastien Tricaud
# 2009 Victor Amaducci
# 2009 Gabriel Cavalcante
# 2012 Julien Miotte
import sys
# QT
from PyQt4 import QtCore, QtGui
from PyQt4.QtGui import QMainWindow
# Pcoords
import pcoords
# U... | gpl-3.0 | -6,879,806,751,401,898,000 | 36.466527 | 79 | 0.553353 | false | 4.136028 | false | false | false |
tisdall/txZMQ | examples/req_rep.py | 2 | 1994 | #!env/bin/python
"""
Example txzmq client.
examples/req_rep.py --method=connect --endpoint=ipc:///tmp/req_rep_sock --mode=req
examples/req_rep.py --method=bind --endpoint=ipc:///tmp/req_rep_sock --mode=rep
"""
import os
import sys
import time
import zmq
from optparse import OptionParser
from twisted.interne... | gpl-2.0 | -5,228,876,548,383,675,000 | 27.084507 | 101 | 0.647442 | false | 3.42024 | false | false | false |
adalessandro/hpr_project | neonatologia_analisis_app/migrations/0005_auto__add_determinacionestudioneonatologia__del_field_entradaanalisis_.py | 1 | 9826 | # -*- 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):
# Removing unique constraint on 'EntradaAnalisis', fields ['fecha', 'apellido', 'nombre']
db.delete_unique(u... | gpl-2.0 | -3,852,291,647,734,132,000 | 72.887218 | 195 | 0.593934 | false | 3.343314 | false | false | false |
joaormatos/anaconda | Anaconda/standalone/post_build.py | 1 | 1810 | # Copyright (c) Mathias Kaerlev 2012.
# This file is part of Anaconda.
# Anaconda 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 | 8,281,787,660,215,163,000 | 30.224138 | 80 | 0.654696 | false | 3.770833 | false | false | false |
roderickmackenzie/gpvdm | gpvdm_gui/gui/ribbon_cluster.py | 1 | 5252 | # -*- coding: utf-8 -*-
#
# General-purpose Photovoltaic Device Model - a drift diffusion base/Shockley-Read-Hall
# model for 1st, 2nd and 3rd generation solar cells.
# Copyright (C) 2012-2017 Roderick C. I. MacKenzie r.c.i.mackenzie at googlemail.com
#
# https://www.gpvdm.com
# Room B86 Coates, University P... | gpl-2.0 | 8,479,352,780,645,095,000 | 31.220859 | 148 | 0.751904 | false | 3.169584 | false | false | false |
weapp/miner | miner.py | 1 | 1803 | #!/usr/bin/env python
import os
import argparse
from multiprocessing import Process
import yaml
import json
from shared.utils import build_components, build_component, apply_envs
from shared.path import Path
if __name__ == '__main__':
# print "Visit this!"
# print "http://wubytes.com/w/grid/example:cpu,swa... | mit | 5,180,890,249,039,874,000 | 30.086207 | 100 | 0.655574 | false | 3.83617 | false | false | false |
neo4j/neo4j-python-driver | neo4j/data.py | 1 | 13145 | #!/usr/bin/env python
# -*- encoding: utf-8 -*-
# Copyright (c) "Neo4j"
# Neo4j Sweden AB [http://neo4j.com]
#
# This file is part of Neo4j.
#
# 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
#... | apache-2.0 | 1,572,899,761,663,884,300 | 32.878866 | 104 | 0.556333 | false | 4.24443 | false | false | false |
kurtraschke/camelot | camelot/view/wizard/pages/progress_page.py | 1 | 4527 | # ============================================================================
#
# Copyright (C) 2007-2010 Conceptive Engineering bvba. All rights reserved.
# www.conceptive.be / project-camelot@conceptive.be
#
# This file is part of the Camelot Library.
#
# This file may be used under the terms of the GNU General... | gpl-2.0 | -2,214,981,055,944,820,000 | 36.413223 | 86 | 0.648111 | false | 4.299145 | false | false | false |
machinedesign/grammaropt | grammaropt/terminal_types.py | 1 | 1819 | """
This module contain types, which are special kinds of
grammar terminals that represent pre-defined types like int, float, etc.
The main goal of theses classes is not to provide functionality (they
are basically a Regex) but rather to be identified as Type so that
some special treatment is reserved to them, because... | mit | 2,067,762,234,421,951,200 | 26.149254 | 76 | 0.62122 | false | 3.781705 | false | false | false |
clarete/curdling | curdling/web/__main__.py | 1 | 1050 | from __future__ import absolute_import, print_function, unicode_literals
from curdling.web import Server
import argparse
def parse_args():
parser = argparse.ArgumentParser(
description='Share your cheese binaries with your folks')
parser.add_argument(
'curddir', metavar='DIRECTORY',
... | gpl-3.0 | -335,939,266,285,223,600 | 24.609756 | 82 | 0.622857 | false | 3.736655 | false | false | false |
zachdj/ultimate-tic-tac-toe | models/game/LocalBoard.py | 1 | 1811 | import numpy
from .Board import Board
class LocalBoard(Board):
""" Represents a traditional 3x3 tic tac toe board
"""
def __init__(self):
Board.__init__(self)
self.board = numpy.ones((3, 3)) * Board.EMPTY
self.cats_game = False
def check_cell(self, row, col):
""" Ove... | mit | -5,562,757,951,391,829,000 | 31.927273 | 87 | 0.545555 | false | 3.780793 | false | false | false |
scionrep/scioncc | setup.py | 1 | 5141 | #!/usr/bin/env python
from setuptools import setup, find_packages
import os
import sys
def read(fname):
return open(os.path.join(os.path.dirname(__file__), fname)).read()
def get_data_dirs(path, patterns):
data_dirs = [(rt+"/"+dn+"/") for rt, ds, fs in os.walk(path) for dn in ds]
data_dir_patterns = []
... | bsd-2-clause | -8,226,793,217,231,396,000 | 40.128 | 145 | 0.511963 | false | 3.918445 | true | false | false |
jonnybazookatone/flask-watchman | tests/test_watchman.py | 1 | 4269 | import mock
import unittest
from flask import Flask
from flask.ext.testing import TestCase
from flask_watchman import Watchman, Environment
class TestWatchman(TestCase):
"""
Test flask apps that are using class based views
"""
def create_app(self):
app = Flask(__name__, static_folder=None)
... | mit | 3,942,468,869,551,875,600 | 26.018987 | 64 | 0.580932 | false | 4.51746 | true | false | false |
netblue30/firetools | src/profile_editor/profileEditUI.py | 1 | 23223 | # -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'fj1.ui'
#
# Created by: PyQt5 UI code generator 5.9.2
#
# WARNING! All changes made in this file will be lost!
from PyQt5 import QtCore, QtGui, QtWidgets
class Ui_MainWindow(object):
def setupUi(self, MainWindow):
MainWindow.se... | gpl-2.0 | 594,753,417,943,092,900 | 63.688022 | 97 | 0.739052 | false | 3.805178 | false | false | false |
JohnVinyard/zounds | zounds/spectral/frequencyscale.py | 1 | 20309 |
import numpy as np
import bisect
class Hertz(float):
def __init__(self, hz):
try:
self.hz = hz.hz
except AttributeError:
self.hz = hz
def __neg__(self):
return Hertz(-self.hz)
def __add__(self, other):
try:
other = other.hz
exc... | mit | -9,029,838,508,317,869,000 | 31.546474 | 85 | 0.587129 | false | 3.859559 | false | false | false |
JohnVinyard/zounds | zounds/spectral/spectral.py | 1 | 11596 |
import numpy as np
from featureflow import Node
from scipy.fftpack import dct
from scipy.stats.mstats import gmean
from .functional import fft, mdct
from .frequencyscale import LinearScale, ChromaScale, BarkScale
from .weighting import AWeighting
from .tfrepresentation import FrequencyDimension
from .frequencyadaptiv... | mit | -8,911,567,143,534,565,000 | 33.614925 | 169 | 0.644964 | false | 3.843553 | false | false | false |
flychen50/thinkstat | chi.py | 2 | 3747 | """This file contains code for use with "Think Stats",
by Allen B. Downey, available from greenteapress.com
Copyright 2010 Allen B. Downey
License: GNU GPLv3 http://www.gnu.org/licenses/gpl.html
"""
import descriptive
import itertools
import Pmf
import random
import risk
import thinkstats
def ComputeRow(n, probs):
... | mit | -3,031,374,080,909,250,600 | 24.317568 | 73 | 0.628503 | false | 3.83521 | false | false | false |
go1dshtein/pgv | pgv/loader.py | 1 | 1947 | import os
import re
import logging
logger = logging.getLogger(__name__)
class Loader:
def __init__(self, basedir):
self.basedir = basedir
self.ipattern = re.compile(r'^\\i\s+(.+?)\s*$', re.U | re.M)
self.irpattern = re.compile(r'^\\ir\s+(.+?)\s*$', re.U | re.M)
def load(self, path):
... | gpl-2.0 | 1,194,491,291,310,016,800 | 34.4 | 70 | 0.576271 | false | 3.6875 | false | false | false |
DJO3/regex_grounds | exercise_1/add_to_mongo.py | 1 | 1605 | import os
import re
import sys
import pymongo
# Looks for local baby names directory and outputs a dictionary in the format year: "name,sex,num_occurrence".
def get_data():
data = {}
names = os.getcwd() + '/names'
if os.path.exists(names):
names_dir = os.listdir(names)
for yob in names_dir... | mit | 4,289,941,324,790,862,000 | 28.722222 | 110 | 0.561371 | false | 3.451613 | false | false | false |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.