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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
radjkarl/imgProcessor | imgProcessor/measure/SNR/SNR_IEC.py | 1 | 1187 | # coding=utf-8
from __future__ import division
import numpy as np
def SNR_IEC(i1, i2, ibg=0, allow_color_images=False):
'''
Calculate the averaged signal-to-noise ratio SNR50
as defined by IEC NP 60904-13
needs 2 reference EL images and one background image
'''
# ensure images a... | gpl-3.0 | -3,386,865,506,410,302,500 | 33.969697 | 91 | 0.613311 | false | 3.148541 | false | false | false |
kingmotley/SickRage | sickbeard/name_parser/parser.py | 1 | 24227 | # coding=utf-8
# Author: Nic Wolfe <nic@wolfeden.ca>
# URL: http://code.google.com/p/sickbeard/
#
# This file is part of SickRage.
#
# SickRage 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,112,230,909,662,267,000 | 40.062712 | 190 | 0.552772 | false | 4.15415 | false | false | false |
steingabelgaard/odoo-infrastructure | infrastructure_contract/database.py | 1 | 2074 | #-*- coding: utf-8 -*-
from openerp import models, fields, api, _
from openerp.exceptions import Warning
from urlparse import urlparse
class database(models.Model):
_inherit = "infrastructure.database"
contract_id = fields.Many2one(
'account.analytic.account',
string='Contract',
doma... | agpl-3.0 | -8,775,898,237,925,027,000 | 34.152542 | 79 | 0.543877 | false | 4.215447 | false | false | false |
Ell/goonauth | goonauth/settings.py | 1 | 5913 | import os
PROJECT_ROOT = os.path.abspath(os.path.join(os.path.dirname(__file__), os.pardir))
PACKAGE_ROOT = os.path.abspath(os.path.dirname(__file__))
DEBUG = True
TEMPLATE_DEBUG = DEBUG
ADMINS = [
("Your Name", "your_email@example.com"),
]
MANAGERS = ADMINS
DATABASES = {
"default": {
"ENGINE": "d... | mit | -3,595,466,343,944,919,600 | 26.375 | 82 | 0.686961 | false | 3.484384 | false | false | false |
luismmontielg/pyplotter | setup.py | 1 | 1841 | #-*- coding: utf-8 -*-
from pyplotter import __version__
import os
import sys
try:
from setuptools import setup
except ImportError:
from distutils.core import setup
try:
import subprocess
def convert(source, from_format, to_format):
p = subprocess.Popen(['pandoc', '--from=' + from_format, '--... | mit | -6,032,588,103,053,640,000 | 28.222222 | 92 | 0.61271 | false | 3.757143 | false | false | false |
OpenMined/PySyft | packages/syft/src/syft/proto/lib/tenseal/vector_pb2.py | 1 | 4088 | # -*- coding: utf-8 -*-
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: proto/lib/tenseal/vector.proto
"""Generated protocol buffer code."""
# third party
from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _message
from google.protobuf import reflection as ... | apache-2.0 | 4,811,195,732,778,571,000 | 30.446154 | 293 | 0.614237 | false | 3.5 | false | true | false |
h-hirokawa/swampdragon | setup.py | 1 | 1269 | import os
from setuptools import setup, find_packages
def read(fname):
return open(os.path.join(os.path.dirname(__file__), fname)).read()
setup(
name="SwampDragon",
version="0.3.8.2",
author="Jonas Hagstedt",
author_email="hagstedt@gmail.com",
description=("SwampDragon is a powerful platform ... | bsd-3-clause | 5,141,963,469,735,367,000 | 33.297297 | 149 | 0.611505 | false | 3.525 | false | false | false |
victorlin/ez2pay | ez2pay/models/user.py | 1 | 6784 | from __future__ import unicode_literals
import os
import hmac
import hashlib
from . import tables
from .base import BaseTableModel
class AuthError(RuntimeError):
"""Authentication error
"""
class BadPassword(AuthError):
"""Raised when user tries to authenticate with wrong password
"""
c... | mit | -8,212,208,020,453,777,000 | 29.421525 | 83 | 0.554245 | false | 4.345932 | false | false | false |
StegSchreck/RatS | tests/unit/trakt/test_trakt_ratings_inserter.py | 1 | 10089 | import os
from unittest import TestCase
from unittest.mock import patch
from RatS.trakt.trakt_ratings_inserter import TraktRatingsInserter
TESTDATA_PATH = os.path.abspath(os.path.join(os.path.dirname(__file__), os.pardir, os.pardir, 'assets'))
class TraktRatingsInserterTest(TestCase):
def setUp(self):
i... | agpl-3.0 | 6,564,852,452,856,608,000 | 44.242152 | 155 | 0.658242 | false | 3.13323 | true | false | false |
DBuildService/dbs-server | dbs/task_api.py | 1 | 4794 | from threading import Thread
from celery import Celery
from . import tasks
from .celery import app
__all__ = ('TaskApi', )
def watch_task(task, callback, kwargs=None):
"""
watch task until it ends and then execute callback:
callback(response, **kwargs)
where response is a result of task
:... | bsd-3-clause | -7,925,442,112,686,777,000 | 37.66129 | 110 | 0.601794 | false | 4.378082 | false | false | false |
anistark/demo | drsftask/drsftask/settings.py | 1 | 2083 | """
Django settings for drsftask project.
For more information on this file, see
https://docs.djangoproject.com/en/1.7/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.7/ref/settings/
"""
# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
i... | mit | 3,673,530,302,512,262,000 | 23.22093 | 71 | 0.721075 | false | 3.244548 | false | false | false |
open-dynaMIX/experms | src/experms/configfile/check_ownerandgroup.py | 1 | 2097 | # -*- coding: utf-8 -*-
import sys
import pwd
import grp
def check_ownerandgroup(parser, section, oorg, debug):
if oorg == 'owner':
switch = "User"
else:
switch = "Group"
if not parser.has_option(section, oorg):
if debug:
print >> sys.stderr, ("[debug] '%s' in section... | gpl-3.0 | 8,053,156,925,567,111,000 | 30.772727 | 75 | 0.431092 | false | 4.279592 | false | false | false |
foospidy/DbDat | plugins/mysql/check_privilege_super.py | 1 | 1062 | class check_privilege_super():
"""
check_privilege_super:
The following accounts have the SUPER privilege. Do not grant to non Admin users.
"""
# References:
# https://benchmarks.cisecurity.org/downloads/show-single/index.cfm?file=mysql.102
TITLE = 'SUPER Privilege'
CATEGORY = 'Privi... | gpl-2.0 | 5,287,843,354,588,340,000 | 28.5 | 86 | 0.532015 | false | 3.962687 | false | false | false |
spudmind/parlparse | members/wikipedia-commons.py | 1 | 2989 | #!/usr/bin/env python
# -*- coding: latin-1 -*-
# $Id: bbcconv.py,v 1.4 2005/03/25 23:33:35 theyworkforyou Exp $
# Screen scrape list of links to Lords on Wikipedia, so we can link to the articles.
# The Public Whip, Copyright (C) 2003 Francis Irving and Julian Todd
# This is free software, and you are welcome to red... | agpl-3.0 | -9,160,489,441,203,568,000 | 35.45122 | 414 | 0.606223 | false | 2.871278 | false | false | false |
cackharot/fbeazt | src/test/test_order.py | 1 | 3860 | import os
import unittest
from random import randint
from bson import json_util
from bson.objectid import ObjectId
from foodbeazt import fapp
from foodbeazt import initdb as fdb
from foodbeazt.service.ProductService import ProductService
from foodbeazt.service.StoreService import StoreService
class CreateOrderTestCa... | apache-2.0 | 3,235,969,245,412,968,000 | 36.475728 | 102 | 0.573575 | false | 3.547794 | true | false | false |
antontsv/r2d2 | sound_manager.py | 1 | 2110 | #!/usr/bin/env python
import sys
import os
import time
import random
import alsaaudio
import pyttsx
from subprocess import call
#
# Our sound coordinator
#
class SoundManager ():
SOUND_PLAYER = 'mpg123'
SOUNDS_DIR = os.path.dirname(__file__) + '/sounds'
SOUND_FILE_EXT = 'mp3'
sound_list = []
... | mit | 938,506,079,003,092,900 | 26.763158 | 81 | 0.563981 | false | 3.504983 | false | false | false |
manahl/PythonTrainingExercises | Beginners/strings/solution/strings.py | 1 | 2019 | """With this string:
'monty pythons flying circus'
Create a function that returns a sorted string with no duplicate characters
(keep any whitespace):
Example: ' cfghilmnoprstuy'
Create a function that returns the words in reverse order:
Example: ['circus', 'flying', 'pythons', 'monty']
Create a function that returns... | bsd-3-clause | 4,677,006,892,948,547,000 | 27.041667 | 90 | 0.65478 | false | 3.199683 | false | false | false |
glibin/tortik | tortik_tests/postprocessor_test.py | 1 | 1248 | # -*- coding: utf-8 -*-
import tornado.web
import tornado.ioloop
from tornado.testing import AsyncHTTPTestCase
from tortik.page import RequestHandler
import tornado.curl_httpclient
def first_postprocessor(handler, data, callback):
callback(handler, data.replace('Hello,', 'Good'))
def second_postprocessor(handle... | mit | 7,669,365,222,812,050,000 | 23.96 | 68 | 0.64984 | false | 4 | false | false | false |
antoinearnoud/openfisca-france | openfisca_france/scripts/parameters/baremes_ipp/convert_ipp_xlsx_to_openfisca_xml.py | 1 | 5031 | #! /usr/bin/env python
# -*- coding: utf-8 -*-
"""
Convertit les barèmes de l'IPP au format XLSX vers le format XML des paramètres d'OpenFisca.
Nécessite l'installation de :
- ssconvert :
- Debian : `apt install gnumeric`
- macOS : `brew install gnumeric`
- xlrd : `pip install xlrd`
"""
import argparse
imp... | agpl-3.0 | 1,522,122,010,387,711,000 | 41.210084 | 149 | 0.675294 | false | 3.083487 | false | false | false |
jrgdiz/iria | main.py | 1 | 2878 | #!/usr/bin/env python3
# Based on echobot2.py
import logging
from telegram.ext import Updater, CommandHandler, MessageHandler, Filters
from modules.gifsapm import GifsApmHandler
from modules.estraviz import EstravizHandler
from modules.dice import DiceHandler
########################
# LOGGING
##################... | mit | 3,959,728,881,391,342,600 | 25.394495 | 82 | 0.633646 | false | 3.693196 | false | false | false |
NinjaMSP/crossbar | crossbar/controller/test/test_cleanup.py | 1 | 3048 | #####################################################################################
#
# Copyright (c) Crossbar.io Technologies GmbH
#
# Unless a separate license agreement exists between you and Crossbar.io GmbH (e.g.
# you have purchased a commercial license), the license terms below apply.
#
# Should you enter ... | agpl-3.0 | 543,509,467,005,742,400 | 39.64 | 85 | 0.677822 | false | 4.239221 | false | false | false |
Turupawn/website | games/tests/test_api.py | 1 | 3519 | import json
from django.test import TestCase
from django.urls import reverse
from . import factories
class TestGameApi(TestCase):
def setUp(self):
self.num_games = 10
self.games = []
for n in range(self.num_games):
self.games.append(
factories.GameFactory(name... | agpl-3.0 | 1,978,588,790,887,498,000 | 38.539326 | 98 | 0.611537 | false | 3.767666 | true | false | false |
DemocracyClub/yournextrepresentative | ynr/apps/people/tests/test_age.py | 1 | 1996 | from datetime import date
from django.test import TestCase
from mock import patch
from people.models import Person
@patch("people.models.date")
class TestAgeCalculation(TestCase):
def test_age_full_obvious(self, mock_date):
mock_date.today.return_value = date(1977, 9, 3)
mock_date.side_effect = ... | agpl-3.0 | 1,142,260,606,478,011,800 | 43.355556 | 78 | 0.641784 | false | 3.188498 | true | false | false |
SachaMPS/django-cms | cms/page_rendering.py | 1 | 2562 | # -*- coding: utf-8 -*-
from django.conf import settings
from django.core.urlresolvers import resolve, Resolver404
from django.http import Http404
from django.template import RequestContext
from django.template.response import TemplateResponse
from cms import __version__
from cms.cache.page import set_page_cache
from ... | bsd-3-clause | 3,315,822,376,916,376,000 | 36.676471 | 102 | 0.699063 | false | 3.893617 | false | false | false |
LuaDist/scite | scripts/CheckMentioned.py | 1 | 1510 | #!/usr/bin/env python3
# CheckMentioned.py
# Find all the symbols in scintilla/include/Scintilla.h and check if they
# are mentioned in scintilla/doc/ScintillaDoc.html.
import string
uninteresting = {
"SCINTILLA_H", "SCI_START", "SCI_LEXER_START", "SCI_OPTIONAL_START",
# These archaic names are #defined to the Sci_... | isc | -3,569,984,973,400,225,300 | 28.607843 | 76 | 0.721192 | false | 3.233405 | false | false | false |
shanot/imp | modules/isd/examples/ubiquitin/replica_exchange.py | 2 | 8389 | #!/usr/bin/env python
from __future__ import print_function
import sys
import os
import errno
import atexit
import random
# Comment either this line or the following to attain different communication schemes:
# to start pyro
try:
from IMP.isd.PyroGrid import PyroGrid as Grid
# from IMP.isd.FileBasedGrid import ... | gpl-3.0 | -2,362,972,254,981,309,000 | 31.265385 | 93 | 0.635594 | false | 3.232755 | false | false | false |
ibm-security-intelligence/api-samples | custom_actions/04_postCustomActions.py | 1 | 12475 | #!/usr/bin/env python3
# This sample demonstrates how to use various POST /custom_actions/ endpoints
# available REST API.
#
# WARNING: This sample makes changes to the QRadar system and it is
# recommended that it is not run against a production system.
#
# This script can be run once as custom actions require their n... | apache-2.0 | -942,447,492,446,873,600 | 39.241935 | 79 | 0.600561 | false | 4.430043 | false | false | false |
trendels/rhino | rhino/util.py | 1 | 3960 | from __future__ import absolute_import
import functools
import inspect
import sys
__all__ = [
'apply_ctx',
'sse_event',
]
def _sse_encode(k, v):
# splitlines() discards the last trailing newline. Append an unambiguous
# newline so that the presence or absence of a trailing newline in the
# input... | mit | 3,162,224,340,009,377,300 | 34.675676 | 83 | 0.637626 | false | 3.829787 | false | false | false |
tomriddle1234/dgsCalc | dgsCheckFileExists.py | 1 | 2776 | # encoding=utf8
#input is a csv file path, and a search target folder
import fixutf8
import sys,os
import logging
import fnmatch
import argparse
import collections
from dgsUtil import *
parser = argparse.ArgumentParser(description='This program is to check file existence for DGS. Also generating a log file with the n... | gpl-3.0 | -452,347,840,107,884,000 | 27.06383 | 167 | 0.690675 | false | 3.281095 | false | false | false |
pektin/jam | compiler/llvm/builtins.py | 1 | 7773 | import logging
from functools import partial
from .state import State
from .util import *
from .. import lekvar
from . import bindings as llvm
def builtins(logger = logging.getLogger()):
global printf
printf = None
string = LLVMType("String")
size = LLVMType("Int64")
ints = [
LLVMType("In... | mit | -2,096,387,809,883,720,700 | 32.943231 | 111 | 0.602856 | false | 3.495054 | false | false | false |
RealTimeWeb/wikisite | MoinMoin/script/migration/data.py | 1 | 2861 | # -*- coding: iso-8859-1 -*-
"""
MoinMoin - data_dir migration main script (new style)
You can use this script to migrate your wiki's data_dir to the format
expected by the current MoinMoin code. It will read data/meta to determine
what needs to be done and call other migration scripts as needed.
... | apache-2.0 | -255,549,108,782,594,600 | 35.21519 | 100 | 0.590703 | false | 4.140376 | false | false | false |
Joneyviana/todolist-django-angular | todolist/users/migrations/0002_auto_20160728_2311.py | 1 | 1044 | # -*- coding: utf-8 -*-
# Generated by Django 1.9.8 on 2016-07-28 23:11
from __future__ import unicode_literals
import django.contrib.auth.models
import django.core.validators
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('users', '0001_initial'),
... | mit | -3,026,043,773,982,555,600 | 36.285714 | 409 | 0.619732 | false | 4.126482 | false | false | false |
davidwilson-85/easymap | scripts_snp/af-comparison.py | 1 | 3689 | import argparse
parser = argparse.ArgumentParser()
parser.add_argument('-f2_mut', action="store", dest = 'input_mut')
parser.add_argument('-f2_wt', action="store", dest = 'input_wt')
parser.add_argument('-out', action="store", dest = 'output')
parser.add_argument('-f_input', action="store", dest = 'f_input')
parser.ad... | gpl-3.0 | -8,096,368,997,922,298,000 | 31.946429 | 241 | 0.562754 | false | 2.403257 | false | false | false |
andrewsmedina/horizon | horizon/horizon/dashboards/nova/instances_and_volumes/volumes/tables.py | 1 | 4720 | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2011 Nebula, 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
#
# ... | apache-2.0 | -8,238,992,324,745,336,000 | 31.551724 | 78 | 0.625847 | false | 3.983122 | false | false | false |
charanpald/wallhack | wallhack/viroscopy/ContactGrowthStatistics.py | 1 | 49412 | import logging
import sys
import gc
import numpy
import os.path
import matplotlib.pyplot as plt
from datetime import date
from sandbox.util.PathDefaults import PathDefaults
from sandbox.util.DateUtils import DateUtils
from sandbox.util.Latex import Latex
from sandbox.util.Util import Util
from apgl.graph import *
fro... | gpl-3.0 | -2,941,962,090,669,283,300 | 45.881404 | 327 | 0.688072 | false | 3.447189 | true | false | false |
pywinauto/pywinauto | pywinauto/controls/hwndwrapper.py | 1 | 67694 | # GUI Application automation and testing library
# Copyright (C) 2006-2018 Mark Mc Mahon and Contributors
# https://github.com/pywinauto/pywinauto/graphs/contributors
# http://pywinauto.readthedocs.io/en/latest/credits.html
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# ... | bsd-3-clause | 4,780,143,445,851,055,000 | 36.712535 | 119 | 0.562354 | false | 4.378938 | false | false | false |
musicmetric/mmpy | src/releasegroup.py | 1 | 2354 | from entity import *
class Releasegroup(Entity):
"""
wraps the ReleaseGroup entity type as described at http://developer.musicmetric.com
all timeseries are attributes of the form self.<type>_<source>, which sets a dict if there's data
"""
summary_attrs = ("name", "id", "description", "artist")
... | isc | 946,194,491,796,269,400 | 38.898305 | 101 | 0.573917 | false | 4.579767 | false | false | false |
chartjes/liesitoldmykids | defensio/__init__.py | 1 | 4092 | import sys
def is_python3():
return sys.version_info[0] == 3
if is_python3():
import urllib.parse
import http.client
else:
import urllib
import httplib
import simplejson as json
API_VERSION = '2.0'
API_HOST = 'api.defensio.com'
LIB_VERSION = '0.9.1'
ROOT_NODE = 'defensio-result'
FORMAT = 'json'
... | mit | -1,687,678,148,140,367,400 | 30.476923 | 114 | 0.651026 | false | 3.679856 | false | false | false |
ecordell/pymacaroons | tests/functional_tests/serialization_tests.py | 1 | 4067 | from nose.tools import *
from pymacaroons import Macaroon, Verifier, MACAROON_V1, MACAROON_V2
from pymacaroons.serializers import JsonSerializer
class TestSerializationCompatibility(object):
def setup(self):
pass
def test_from_go_macaroon_json_v2(self):
# The following macaroon have been gen... | mit | 2,849,420,049,449,984,000 | 51.141026 | 80 | 0.621588 | false | 2.695162 | false | false | false |
nuobit/odoo-addons | connector_ambugest/models/res_partner/binding.py | 1 | 1728 | # Copyright NuoBiT Solutions, S.L. (<https://www.nuobit.com>)
# Eric Antones <eantones@nuobit.com>
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl)
from odoo import models, fields
from odoo.addons.component.core import Component
from odoo.addons.queue_job.job import job
class ResPartner(models.Model):... | agpl-3.0 | 6,374,237,774,410,147,000 | 32.882353 | 82 | 0.637153 | false | 3.449102 | false | false | false |
pinobatch/thwaite-nes | tools/dte.py | 1 | 12624 | #!/usr/bin/env python3
from __future__ import with_statement, division, print_function, unicode_literals
from collections import defaultdict
import sys, heapq
dte_problem_definition = """
Byte pair encoding, dual tile encoding, or digram coding is a static
dictionary compression method first disclosed to the public by... | gpl-3.0 | -7,748,505,627,773,324,000 | 41.08 | 996 | 0.631575 | false | 3.691228 | false | false | false |
wjt/markgown | markgown/editor.py | 1 | 3156 | #!/usr/bin/python
# vim: set fileencoding=utf-8 :
#
# © 2012 Will Thompson <will@willthompson.co.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
# the Free Software Foundation, either version 3 of the License, or
# (at y... | gpl-3.0 | 1,625,671,300,587,559,700 | 28.764151 | 84 | 0.642472 | false | 3.655852 | false | false | false |
followcat/predator | jobs/definition/batchconvert_cloudshare_jingying.py | 1 | 1798 | import Queue
import functools
import utils.builtin
import jobs.definition.cloudshare_jingying
from jobs.definition.batchconvert import *
class Batchconvert(BatchconvertCloudshare,
jobs.definition.cloudshare_jingying.Jingying):
CVDB_PATH = 'convert/jingying'
ORIGIN_CVDB_PATH = 'output/jing... | lgpl-3.0 | 9,209,526,226,473,310,000 | 34.96 | 91 | 0.632369 | false | 3.560396 | false | false | false |
idigbio-api-hackathon/idigbio-lifemapper | dataretrieval/apiquery.py | 1 | 19565 | """
@summary: Module containing functions for API Queries
@status: beta
@license: gpl2
@copyright: Copyright (C) 2014, University of Kansas Center for Research
Lifemapper Project, lifemapper [at] ku [dot] edu,
Biodiversity Institute,
1345 Jayhawk Boulevard, Lawrence, Kansas, 66045, USA
... | gpl-3.0 | 6,396,685,743,791,040,000 | 36.697495 | 88 | 0.510963 | false | 4.006758 | false | false | false |
Macemann/Georgetown-Capstone | app/db/etl/Entities.py | 1 | 1938 | import nltk
from nltk.corpus import stopwords
class EntityExtractor (object):
'''
Class used to extract Named Entities from a string
'''
def __init__ (self, tweet):
self.tweet = tweet
self.text = tweet['text']
self.lang = tweet['lang']
self.bool = tweet['text'] and tweet['lang'].find('en') > -1
self.tok... | mit | 6,216,132,786,677,719,000 | 28.363636 | 103 | 0.671827 | false | 3.208609 | false | false | false |
wilselby/diy_driverless_car_ROS | rover_cv/camera_cal/src/camera_cal/camera_cal.py | 1 | 6503 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#https://github.com/paramaggarwal/CarND-Advanced-Lane-Lines/blob/master/Notebook.ipynb
from __future__ import print_function
from __future__ import division
import sys
import traceback
import rospy
import numpy as np
import cv2
import pickle
import glob
import time
import m... | bsd-2-clause | -7,558,530,412,846,987,000 | 36.589595 | 239 | 0.564047 | false | 3.545802 | false | false | false |
pekko/tg-stats | markov.py | 1 | 1850 | #!/usr/bin/env python3
# coding: utf-8
from analyze import get_msgs
from collections import defaultdict
import itertools
import random
import re
class TgMarkov(object):
START='\x01'
STOP='\x02'
def __init__(self, msgs):
self.table = {}
self.user_table = defaultdict(list)
prev = ... | mit | 9,110,910,635,710,931,000 | 24.708333 | 57 | 0.485946 | false | 3.714859 | false | false | false |
nint8835/NintbotForDiscord | jigsaw_plugins/DiscordMarkov/__init__.py | 1 | 4369 | import asyncio
import datetime
import os
import traceback
import markovify
from NintbotForDiscord.Enums import EventTypes
from NintbotForDiscord.Events import MessageSentEvent
from NintbotForDiscord.Plugin import BasePlugin
class DiscordMarkov(BasePlugin):
def __init__(self, manifest, bot_instance):
sup... | mit | -3,715,402,684,921,183,000 | 36.025424 | 95 | 0.598077 | false | 4.004583 | false | false | false |
walchko/pyxl320 | examples/complex.py | 1 | 2543 | #!/usr/bin/env python
from __future__ import division, print_function
from pyxl320 import ServoSerial
from pyxl320 import Packet
from pyxl320 import xl320
from pyxl320 import DummySerial
from time import sleep
# import sys
"""
This example rotates the servo back and forth while cycling through the different
colors of... | mit | 8,282,759,322,195,944,000 | 21.705357 | 81 | 0.659851 | false | 2.592253 | false | false | false |
gaberger/pybvc | samples/sampleopenflow/demos/demo1.py | 1 | 4024 | #!/usr/bin/python
# Copyright (c) 2015, BROCADE COMMUNICATIONS SYSTEMS, INC
# All rights reserved.
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# 1. Redistributions of source code must retain the above copyright n... | bsd-3-clause | 188,380,102,392,041,600 | 33.393162 | 78 | 0.629473 | false | 3.933529 | false | false | false |
postmarketOS/pmbootstrap | pmb/chroot/binfmt.py | 1 | 2312 | """
Copyright 2018 Oliver Smith
This file is part of pmbootstrap.
pmbootstrap 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.
pmbootstrap ... | gpl-3.0 | 5,135,424,026,554,633,000 | 32.028571 | 73 | 0.666522 | false | 3.440476 | false | false | false |
gaberosser/geo-network | utils.py | 1 | 35093 | __author__ = 'gabriel'
import numpy as np
from data.models import CartesianSpaceTimeData, NetworkData, CartesianData
import logging
from streetnet import NetPoint, Edge, NetPath
from collections import OrderedDict, defaultdict
import operator
uint_dtypes = [(t, np.iinfo(t)) for t in (
np.uint8,
np.uint16,
... | mit | 2,971,231,654,931,241,000 | 37.607261 | 128 | 0.571994 | false | 4.049037 | false | false | false |
parhelia/AutomateStuffWithPython | Chapter 12/readCensusExcel.py | 1 | 1340 | #! /usr/bin/env python3
# readCensusExcel.py - Tabulates population and number of census tracts for
# each county.
import openpyxl, pprint
print('Opening workbook...')
wb = openpyxl.load_workbook('/Users/brisance/Downloads/automate_online-materials/censuspopdata.xlsx')
sheet = wb.get_sheet_by_name('Population by Censu... | mit | -5,883,825,633,629,468,000 | 37.285714 | 101 | 0.698507 | false | 3.198091 | false | false | false |
DrPandemic/aigar.io | clients/python/game/models.py | 1 | 6257 | from planar import Vec2
from typing import List
class UnknownPlayerIdException(Exception):
def __init__(self, player_id):
super().__init__("Unknown Player ID %d" % player_id)
class Game:
RANKED_GAME_ID = -1
def __init__(self, id_: int, tick: int, time_left: float, player_id: int, players: List[... | mit | -4,244,628,501,824,059,400 | 24.962656 | 112 | 0.518939 | false | 3.822236 | false | false | false |
ryanjoneil/docker-image-construction | dicp/solvers/network_mosek.py | 1 | 6709 | from .most_common import MostCommonHeuristic
from .most_time import MostTimeHeuristic
from collections import defaultdict
from itertools import product
from mosek.fusion import Model, Domain, Expr, ObjectiveSense, AccSolutionStatus
import sys
class NetworkMosek(object):
'''Network binary integer program: full mode... | mit | 5,227,754,005,832,978,000 | 38.005814 | 87 | 0.411984 | false | 3.937207 | false | false | false |
martijnvermaat/rpclib | examples/multiple_protocols/protocol.py | 1 | 4933 | # encoding: utf8
#
# Copyright © Burak Arslan <burak at arskom dot com dot tr>,
# Arskom Ltd. http://www.arskom.com.tr
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# 1. Redistr... | lgpl-2.1 | -12,388,837,928,334,454 | 38.142857 | 81 | 0.644972 | false | 3.908082 | false | false | false |
rbarrois/xelpaste | libpaste/forms.py | 1 | 6310 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
import datetime
from django import forms
from django.utils import timezone
from django.utils.translation import ugettext_lazy as _
from .conf import settings
from .models import Snippet
from .highlight import LEXER_LIST, LEXER_DEFAULT, LEXER_KEYS
cl... | mit | -4,652,377,994,480,685,000 | 31.694301 | 116 | 0.599208 | false | 4.001268 | false | false | false |
CINPLA/expipe-dev | expipe-plugin-cinpla/utils/batch-analysis.py | 1 | 2291 | import subprocess
import expipe
import os
import os.path as op
import sys
import logging
sys.path.append(expipe.config.config_dir)
if not op.exists(op.join(expipe.config.config_dir, 'expipe_params.py')):
print('No config params file found, use "expipe' +
'copy-to-config expipe_params.py"')
else:
from ... | gpl-3.0 | -3,879,119,396,292,974,600 | 31.267606 | 86 | 0.662156 | false | 3.701131 | true | false | false |
NMGRL/pychron | pychron/dvc/meta_object.py | 1 | 8555 | # ===============================================================================
# Copyright 2018 ross
#
# 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/LICE... | apache-2.0 | -8,466,811,119,454,810,000 | 26.508039 | 107 | 0.497604 | false | 3.70026 | false | false | false |
freevo/freevo2 | src/core/plugin.py | 1 | 6511 | # -*- coding: iso-8859-1 -*-
# -----------------------------------------------------------------------------
# plugin.py - Plugin interface
# -----------------------------------------------------------------------------
# $Id$
#
# This file defines some special plugins known to Freevo.
#
# -----------------------------... | gpl-2.0 | 5,919,889,569,692,873,000 | 33.089005 | 90 | 0.492551 | false | 4.735273 | false | false | false |
kbrose/article-tagging | lib/tagnews/utils/load_data.py | 1 | 18109 | import pandas as pd
import numpy as np
import re
import json
import os
import warnings
import shutil
from pathlib import Path
import codecs
"""
Helper functions to load the article data. The main method to use
is load_data().
"""
# Caution! Modifying this in code will have no effect since the
# default arguments are ... | mit | -2,647,651,664,021,491,700 | 35.145709 | 79 | 0.576178 | false | 3.654692 | false | false | false |
makinux/PyCsmap | CSMapMake.py | 1 | 2664 | # -*- coding: utf-8 -*
from PIL import Image
import os
import argparse
import requests
import math
from CSMap import CSMap
parser = argparse.ArgumentParser(description='MyScript')
parser.add_argument('images_x_start', type=int)
parser.add_argument('images_x_end', type=int)
parser.add_argument('images_y_... | mit | -6,314,688,419,536,940,000 | 32.153846 | 138 | 0.569069 | false | 2.927473 | false | false | false |
CSD-Public/stonix | src/MacBuild/proto/lib/manage_user/macos_user.py | 1 | 31321 | """
Cross platform user creation and management
Created for testing cross user testing for the ramdisk project, specifically
unionfs functionality.
@author: Roy Nielsen
"""
import re
import os
import pty
import sys
import shutil
from subprocess import Popen
##########
# local app libraries
from lib.manage_user.pa... | gpl-2.0 | -8,467,802,380,262,595,000 | 30.960204 | 113 | 0.4769 | false | 4.676172 | false | false | false |
marcok/odoo_modules | hr_employee_time_clock/models/hr_contract.py | 1 | 8125 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2016 - now Bytebrand Outsourcing AG (<http://www.bytebrand.net>).
#
# This program is free software: you can redistribute it and/or modify
# it... | agpl-3.0 | 6,116,065,699,745,750,000 | 41.317708 | 84 | 0.494769 | false | 4.449617 | false | false | false |
splunk/splunk-webframework | server/splunkdj/management/commands/wsgiserver/mediahandler.py | 1 | 3038 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# fix these up
import os, stat, mimetypes
import django
from django.utils.http import http_date
from django.conf import settings
from django.contrib.staticfiles import finders
import logging
logger = logging.getLogger('splunk')
class BlockIterator(object):
# Vlada Mac... | apache-2.0 | 2,097,185,919,337,839,600 | 31.297872 | 76 | 0.565547 | false | 4.04261 | false | false | false |
fgclaramonte/Odoo-addons | pos_order_categories/__openerp__.py | 1 | 1761 | # -*- encoding: utf-8 -*-
##############################################################################
# pos_order_categories
# Copyright (c) 2017 Francisco Manuel García Claramonte <francisco@garciac.es>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the ... | gpl-3.0 | -6,679,769,431,541,364,000 | 34.734694 | 81 | 0.607082 | false | 3.595483 | false | false | false |
anaran/olympia | apps/amo/helpers.py | 1 | 20802 | import collections
import json as jsonlib
import os
import random
import re
from operator import attrgetter
from urlparse import urljoin
from django.conf import settings
from django.core.exceptions import ObjectDoesNotExist
from django.forms import CheckboxInput
from django.utils import translation
from django.utils.e... | bsd-3-clause | 4,492,389,124,689,926,000 | 28.548295 | 79 | 0.637727 | false | 3.64372 | false | false | false |
Alex-Chizhov/python_training | home_work_4_fixture/test_add_group_and_contact.py | 1 | 1218 | # -*- coding: utf-8 -*-
from group import Group
from info_contact import Infos
from application import Application
import pytest
@pytest.fixture
def app(request):
fixture = Application()
request.addfinalizer(fixture.destroy)
return fixture
def test_add_group(app):
app.login( username="admin", passw... | apache-2.0 | -3,554,137,020,219,568,600 | 17.179104 | 172 | 0.66092 | false | 3.045 | false | false | false |
baidu/Paddle | python/paddle/fluid/transpiler/distribute_transpiler.py | 1 | 90029 | # Copyright (c) 2018 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 app... | apache-2.0 | -3,133,544,841,182,929,400 | 41.466509 | 130 | 0.534617 | false | 4.045702 | true | false | false |
wdxtub/Patriots | static/code/sentiment_lstm.py | 1 | 10671 | # -*- coding: utf-8 -*-
from __future__ import absolute_import #导入3.x的特征函数
from __future__ import print_function
import yaml
import sys
reload(sys)
sys.setdefaultencoding('utf8')
import pandas as pd #导入Pandas
import numpy as np #导入Numpy
import jieba #导入结巴分词
import h5py, pickle, os, datetime
from keras.models import m... | gpl-3.0 | -7,875,329,815,553,282,000 | 28.21365 | 128 | 0.602641 | false | 2.634466 | true | false | false |
keon/algorithms | algorithms/arrays/merge_intervals.py | 1 | 2055 | """
In mathematics, a (real) interval is a set of real
numbers with the property that any number that lies
between two numbers in the set is also included in the set.
"""
class Interval:
"""
A set of real numbers with methods to determine if other
numbers are included in the set.
Includes related m... | mit | 8,231,583,978,743,226,000 | 25.688312 | 63 | 0.543066 | false | 3.944338 | false | false | false |
charleslaw/pyfft | fft.py | 1 | 6159 | # -*- coding: utf-8 -*-
"""
Created on Sun Aug 29 00:09:26 2010
@author: Charles Law
"""
import math
def fft(fin, inverse):
nfft = len(fin)
twiddles, factors = fft_alloc(nfft, inverse)
fout = []
for i in xrange(nfft):
fout.append((0, 0))
fout_ind_start = 0
... | bsd-3-clause | -4,358,925,286,503,255,000 | 23.036585 | 77 | 0.458841 | false | 2.968193 | false | false | false |
raybrshen/pattern_recognition | noise_detection/tools/filter_noise.py | 1 | 3213 | __author__ = 'ray'
import os
from subprocess import Popen,PIPE
import wave
import numpy as np
def run_comm(comm):
process = Popen(comm, stdout=PIPE)
(std_out,std_err) = process.communicate()
exit_code = process.wait()
if std_out: print std_out
if std_err!=None: print std_err
def run_comm_save_out... | apache-2.0 | -174,848,481,864,122,460 | 32.821053 | 124 | 0.68503 | false | 2.808566 | false | false | false |
stephane-martin/salt-debian-packaging | salt-2016.3.2/salt/states/apache_module.py | 1 | 3640 | # -*- coding: utf-8 -*-
'''
Manage Apache Modules
.. versionadded:: 2014.7.0
Enable and disable apache modules.
.. code-block:: yaml
Enable cgi module:
apache_module.enabled:
- name: cgi
Disable cgi module:
apache_module.disabled:
- name: cgi
'''
from __future__ import absolute_... | apache-2.0 | 2,404,470,140,685,547,500 | 25.376812 | 79 | 0.549176 | false | 4.10372 | false | false | false |
jbradberry/django-turn-generation | sample_project/sample_app/plugins.py | 1 | 1455 | from django.contrib.contenttypes.models import ContentType
from . import models
class TurnGeneration(object):
realm_types = {
'testrealm': 'sample_app.testrealm',
}
agent_types = {
'testagent': 'sample_app.testagent',
}
permissions = {
'turngeneration.add_generator': '_i... | mit | 8,028,781,954,254,338,000 | 29.3125 | 64 | 0.612371 | false | 3.828947 | false | false | false |
liddiard/skry | attachments/migrations/0001_initial.py | 1 | 3621 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
import django.core.validators
class Migration(migrations.Migration):
dependencies = [
('contenttypes', '0002_remove_content_type_name'),
('authors', '0001_initial'),
]
operations = [... | mit | -2,658,551,179,478,902,000 | 42.626506 | 143 | 0.540182 | false | 4.514963 | false | false | false |
wikimedia/analytics-aggregator | aggregator/projectcounts.py | 1 | 34906 | # -*- coding: utf-8 -*-
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
#... | apache-2.0 | 3,475,592,987,253,228,000 | 40.505351 | 80 | 0.575288 | false | 4.158447 | false | false | false |
raubana/NeverEndingDungeon | libs/TileSystem.py | 1 | 19615 | # ====== IMPORTS ======
# --- Pygame ---
import pygame
# --- Custom Modules ---
from common import copy_color, lerp_colors
# --- Misc. ---
import random, math
# ====== CONSTANTS ======
TILE_SIZE = 48 # The 2D size of a side of a single tile in pixels.
TILE_FLOOR_COLOR = (96,96,96)
TILE_GRASSTILE_COLOR = (100,165,7... | gpl-3.0 | -4,026,060,207,007,091,700 | 34.53442 | 144 | 0.67637 | false | 2.710003 | false | false | false |
ztultrebor/BARKEVIOUS | BARKEVIOUS.py | 1 | 1924 | # coding: utf-8
#read in libraries
import cPickle as pickle
from webcrawler import coredump
from dataloader import get_trawled_data, introduce_weighting
from ratings import PowerRater
from history import historical, model_the_model
from predict import predict
from oddsmaker import read_odds
from betting import wager
... | mit | 5,116,046,065,970,311,000 | 34.62963 | 93 | 0.751559 | false | 3.239057 | false | false | false |
cernanalysispreservation/cap-client | cap_client/cli/metadata_cli.py | 1 | 2900 | # -*- coding: utf-8 -*-
#
# This file is part of CERN Analysis Preservation Framework.
# Copyright (C) 2020 CERN.
#
# CERN Analysis Preservation Framework is free software; you can redistribute
# it and/or modify it under the terms of the GNU General Public License as
# published by the Free Software Foundation; either... | gpl-2.0 | 711,444,110,853,838,100 | 25.605505 | 78 | 0.68069 | false | 3.638645 | false | false | false |
pratapvardhan/pandas | pandas/core/tools/numeric.py | 1 | 6034 | import numpy as np
import pandas as pd
from pandas.core.dtypes.common import (
is_scalar,
is_numeric_dtype,
is_decimal,
is_datetime_or_timedelta_dtype,
is_number,
_ensure_object)
from pandas.core.dtypes.generic import ABCSeries, ABCIndexClass
from pandas.core.dtypes.cast import maybe_downcast_to... | bsd-3-clause | 3,448,711,943,204,059,000 | 32.522222 | 77 | 0.595956 | false | 4.057835 | false | false | false |
CitoEngine/cito_engine | app/cito_engine/views/teams.py | 1 | 2915 | """Copyright 2014 Cyrus Dasadia
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
distr... | apache-2.0 | 339,665,741,333,778,900 | 35.4375 | 87 | 0.649743 | false | 3.845646 | false | false | false |
tylercal/dragonfly | dragonfly/engines/backend_natlink/__init__.py | 1 | 2141 | #
# This file is part of Dragonfly.
# (c) Copyright 2007, 2008 by Christo Butcher
# Licensed under the LGPL.
#
# Dragonfly is free software: you can redistribute it and/or modify it
# under the terms of the GNU Lesser General Public License as published
# by the Free Software Foundation, either version 3 of the... | lgpl-3.0 | 2,523,695,225,473,114,600 | 29.15493 | 81 | 0.611397 | false | 4.133205 | false | false | false |
villaverde/iredadmin | tools/ira_tool_lib.py | 1 | 1823 | """Library used by other scripts under tools/ directory."""
# Author: Zhang Huangbin <zhb@iredmail.org>
import os
import sys
import logging
import web
debug = False
# Set True to print SQL queries.
web.config.debug = debug
os.environ['LC_ALL'] = 'C'
rootdir = os.path.abspath(os.path.dirname(__file__)) + '/../'
sy... | gpl-2.0 | -8,572,292,621,515,470,000 | 23.972603 | 73 | 0.537575 | false | 3.638723 | false | false | false |
ddurieux/alignak | alignak/objects/escalation.py | 1 | 11934 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright (C) 2015-2015: Alignak team, see AUTHORS.txt file for contributors
#
# This file is part of Alignak.
#
# Alignak 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 S... | agpl-3.0 | 3,850,765,669,917,690,000 | 41.617857 | 98 | 0.607643 | false | 3.9035 | false | false | false |
solomonvimal/pyras | pyras/controllers/hecras/hecrascontroller/ras41.py | 1 | 49672 | """
"""
import os
import os.path as osp
class Controller(object):
"""HECRAS Controller vesrsion RAS41"""
# %% Compute
def Compute_Cancel(self):
"""
"""
rc = self._rc
rc.Compute_Cancel()
def Compute_CurrentPlan(self):
"""
Computes the current plan.
... | mit | 65,427,403,340,449,160 | 26.905618 | 79 | 0.544794 | false | 4.377931 | false | false | false |
stu314159/pyNFC | pyNFC_Util.py | 1 | 2945 | # pyNFC_Util.py
"""
definition module for some pyNFC utility classes
"""
import numpy as np
class NFC_Halo_Data_Organizer(object):
"""
collect and organize how halo data will be organized prior to communication
"""
def __init__(self,ngb_rank):
"""
constructor
"""
s... | mit | -2,612,081,654,532,963,000 | 27.592233 | 96 | 0.550424 | false | 3.609069 | false | false | false |
aljohnso/Market_Dreams | Stock Class.py | 1 | 1179 | class Stock:
def __init__(self, Company_name):
""" the constructor for the TextModel class
all dictionaries are started at empty
the name is just for our own purposes, to keep things
organized
"""
self.Company_name = Company_name
... | mit | 1,794,398,396,096,586,200 | 18.684211 | 84 | 0.492791 | false | 4.079585 | false | false | false |
xialin/cs4221 | hello/views.py | 1 | 6857 | from django.shortcuts import render, redirect
from django.conf import settings
import textwrap
from converter import convert_xml_to_json
from converter import update_primary_key_in_xml, merge_relationship_in_xml, validate_xml
import lxml.etree as etree
from django.http import HttpResponse
from django.views.generic.ba... | mit | 349,054,863,970,484,300 | 31.966346 | 92 | 0.596033 | false | 4.071853 | false | false | false |
mtils/ems | ems/qt4/gui/itemdelegate/multiroledelegate.py | 1 | 1523 |
from PyQt4.QtCore import QRect, Qt, QLine
from PyQt4.QtGui import QStyledItemDelegate, QStyleOptionViewItemV4
from PyQt4.QtGui import qApp, QStyle, QPen, QColor
class MultiRoleDelegate(QStyledItemDelegate):
def __init__(self, *args, **kwargs):
super(MultiRoleDelegate, self).__init__(*args, **kwargs)
... | mit | 9,120,466,596,143,563,000 | 34.418605 | 92 | 0.630335 | false | 3.865482 | false | false | false |
sgnn7/sgfc | io_dev/sgfc_io/devices/pic18f45k50/hk_usb_io.py | 1 | 8392 | #!/usr/bin/python
import sys
import time
import usb.core
import usb.util
from array import array
# Markham Thomas 2015
# This version is under heavy development
# You can add your test code to the bottom
# below the === end of module statement, or
# externally call the module
#
# ---- This version adds a python cla... | lgpl-2.1 | -5,762,390,856,084,882,000 | 29.405797 | 72 | 0.561725 | false | 2.536114 | false | false | false |
hforge/Localizer | zgettext.py | 1 | 8628 | #!/usr/bin/env python
# -*- coding: UTF-8 -*-
# Copyright (C) 2001 Andrés Marzal Varo
# Copyright (C) 2001-2002 J. David Ibáñez <jdavid@itaapy.com>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundati... | gpl-3.0 | 855,364,505,234,791,200 | 32.045977 | 94 | 0.582377 | false | 3.899186 | false | false | false |
shivamMg/toy-task | toytask/toytask/views.py | 1 | 3161 | import json
import os
import random
import cv2
from django.shortcuts import render, HttpResponseRedirect
from django.core.urlresolvers import reverse
from django.views.decorators.csrf import csrf_exempt
from toytask.settings import MEDIA_ROOT
from . import modules
from .forms import UploadImageForm
def imagepath(im... | mit | -4,341,640,527,606,923,000 | 29.68932 | 77 | 0.548877 | false | 4.248656 | false | false | false |
liffiton/ATLeS | src/analysis/plot.py | 1 | 11295 | import math
import re
import matplotlib
import matplotlib.pyplot as plt
from matplotlib import collections, lines, patches
from analysis import heatmaps
import config
# Source: https://gist.github.com/jasonmc/1160951
def _set_foregroundcolor(ax, color):
'''For the specified axes, sets the color of the frame, m... | mit | 3,365,155,033,270,954,500 | 33.96904 | 124 | 0.569633 | false | 3.485035 | false | false | false |
afrendeiro/pipelines | lib/fix_bedfile_genome_boundaries.py | 1 | 1086 | #!/usr/bin/env python
import csv
import sys
def getChrSizes(chrmFile):
"""
Reads tab-delimiter file with two rows describing the chromossomes and its lengths.
Returns dictionary of chr:sizes.
"""
with open(chrmFile, 'r') as f:
chrmSizes = {}
for line in enumerate(f):
ro... | gpl-2.0 | 7,434,051,444,998,922,000 | 29.166667 | 87 | 0.632597 | false | 2.951087 | false | false | false |
tsai1993/aisixiang | 01.download_1.py | 1 | 2415 | #!/usr/bin/python3
import os
from urllib.request import urlopen
from bs4 import BeautifulSoup
import pandas
import time
# 读取 00.get_metadata.R 获取的相关目录信息
D0 = pandas.read_csv("all_aisixiang_2017-05-24.csv")
# 意外中断时,可以修改 j 的值
j = 0
D = D0[j:]
for i in D['ID']:
Url = "http://www.aisixiang.com/data/" + str(i) + ".h... | mpl-2.0 | 2,543,399,884,251,609,000 | 28.6125 | 77 | 0.433938 | false | 3.443314 | false | false | false |
rvalyi/l10n-brazil | l10n_br_account_service/models/res_company.py | 1 | 2477 | # -*- coding: utf-8 -*-
# Copyright (C) 2009 Renato Lima - Akretion #
# License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html
from openerp import models, fields, api
from openerp.addons.l10n_br_account.models.l10n_br_account import (
L10nBrTaxDefinition
)
class ResComp... | agpl-3.0 | 2,993,863,139,731,171,000 | 42.263158 | 79 | 0.599757 | false | 3.415512 | false | false | false |
jasonflorack/OS-tweets | app/UserInterface.py | 1 | 13307 | import os
import webbrowser
import json
from app.ListenerInterface import ListenerInterface
from app.SearcherInterface import SearcherInterface
class UserInterface:
def __init__(self):
super(UserInterface, self).__init__()
self._auth = None
self._search_terms = ''
self._num_tweets ... | mit | 3,604,229,500,218,865,000 | 46.525 | 119 | 0.574435 | false | 3.990105 | false | false | false |
duyet-website/api.duyet.net | api/clean_datetime.py | 1 | 1037 | # Clean
import datetime as dt
import time
import datetime
from utils import *
def is_present(date_text): return date_text.upper() == 'NOW'
def get_current(): return dt.datetime.now().date()
def clean_datetime(date_text):
if not isinstance(date_text, basestring):
return None
# Parse from text
date... | mit | 9,082,041,020,757,264,000 | 26.315789 | 125 | 0.612343 | false | 3.743682 | false | false | false |
BT-ojossen/l10n-switzerland | l10n_ch_account_statement_base_import/parsers/postfinance_file_parser.py | 1 | 12859 | # -*- coding: utf-8 -*-
##############################################################################
#
# Author: Nicolas Bessi, David Wulliamoz
# 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 ... | agpl-3.0 | 2,705,433,604,774,319,000 | 38.324159 | 78 | 0.547632 | false | 4.158797 | false | false | false |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.