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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Rfam/rfam-production | scripts/support/mirnas/report_to_mirna_input.py | 1 | 3367 | import argparse
import json
import os
from datetime import date
# -------------------------------------------------------------------------------
def extract_new_mirnas_from_report(report_tsv, type='new'):
"""
"""
new_mirnas = {}
fp = open(report_tsv, 'r')
count = 0
for line in fp:
... | apache-2.0 | -6,873,067,566,488,718,000 | 28.278261 | 105 | 0.471339 | false | 4.06152 | false | false | false |
jucacrispim/toxicbuild | toxicbuild/master/slave.py | 1 | 21372 | # -*- coding: utf-8 -*-
# Copyright 2016-2020 Juca Crispim <juca@poraodojuca.net>
# This file is part of toxicbuild.
# toxicbuild is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either version 3 of t... | agpl-3.0 | 5,881,850,398,815,286,000 | 36.494737 | 79 | 0.57828 | false | 4.291566 | false | false | false |
ekwan/PyQuiver | src/constants.py | 1 | 5346 | # This file holds physical constants and reads atomic weights.
import sys
import re
import os
import inspect
###############
# Physical Constants
PHYSICAL_CONSTANTS = {
'h' : 6.626070E-34, # Planck's constants in J * s
'c' : 2.997925E+10, # speed of light in units of cm/s
'Eh' : 4.359745E-18, # energy o... | apache-2.0 | -5,842,683,066,656,835,000 | 35.121622 | 136 | 0.589787 | false | 3.480469 | false | false | false |
kvidoo/MMexUpdater | mmupdater/MMexCategoryUpdater.py | 1 | 1514 | '''
Created on Aug 30, 2013
@author: novpa01
'''
import logging
import sys
import importlib
from mmupdater.Settings import Settings
from mmupdater.UserError import UserError
from mmupdater.MMexDb import MMexDb
from mmupdater.CategoryAssigner import CategoryAssigner
# Parse settings file
settings = Settings('settings... | mit | 5,669,176,103,942,437,000 | 28.686275 | 92 | 0.645971 | false | 4.452941 | false | false | false |
FSUgenomics/TFLOW | tflow/segments/BUSCO_Analysis.py | 1 | 22978 | #TFLOW Segment: Analyze FASTA File for Gene Recapture using BUSCO Benchmark Database
#
#Dan Stribling
#Florida State University
#Center for Genomics and Personalized Medicine
#Version 0.9, 04/20/2015
#Project URL: http://www.github.com/fsugenomics/tflow
import os.path
import sys
import subprocess
import shutil
BUSCO_... | gpl-2.0 | -9,137,028,453,921,034,000 | 39.813499 | 104 | 0.581817 | false | 3.697184 | false | false | false |
infinity0n3/python-fabtotum | fabtotum/loaders/gerber/excellon_statements.py | 1 | 31011 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# copyright 2014 Hamilton Kibbe <ham@hamiltonkib.be>
#
# 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/LICEN... | gpl-3.0 | 4,613,957,387,060,365,000 | 30.708589 | 102 | 0.557447 | false | 3.721022 | false | false | false |
gmimano/commcaretest | corehq/apps/export/custom_export_helpers.py | 1 | 14645 | import json
from corehq.apps.reports.standard import export
from corehq.apps.reports.models import FormExportSchema, HQGroupExportConfiguration, CaseExportSchema
from corehq.apps.reports.standard.export import DeidExportReport
from couchexport.models import ExportTable, ExportSchema, ExportColumn
from django.utils.tran... | bsd-3-clause | 1,592,665,312,018,443,300 | 37.539474 | 116 | 0.601571 | false | 4.145202 | true | false | false |
Oslandia/vizitown_plugin | cyclone/web.py | 1 | 86048 | # coding: utf-8
#
# Copyright 2010 Alexandre Fiori
# based on the original Tornado by Facebook
#
# 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... | gpl-2.0 | 4,279,697,711,647,361,000 | 38.892443 | 88 | 0.589415 | false | 4.374803 | false | false | false |
larsyencken/cjktools | cjktools/resources/radkdict.py | 1 | 2575 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# radkdict.py
# cjktools
#
"""
Based on the radkfile, a dictionary mapping character to bag of radicals.
"""
import sys
from cjktools import maps
from cjktools.common import get_stream_context, stream_codec
from . import cjkdata
from six import text_type
def _def... | bsd-3-clause | -4,731,615,904,252,097,000 | 24.49505 | 76 | 0.582524 | false | 3.64215 | false | false | false |
Ambuj-UF/ConCat-1.0 | src/Utils/Bio/MaxEntropy.py | 1 | 10435 | # Copyright 2001 by Jeffrey Chang. All rights reserved.
# This code is part of the Biopython distribution and governed by its
# license. Please see the LICENSE file that should have been included
# as part of this package.
"""Maximum Entropy code.
Uses Improved Iterative Scaling.
"""
# TODO Define terminology
from... | gpl-2.0 | -8,712,417,844,903,718,000 | 30.814024 | 92 | 0.601725 | false | 3.465626 | false | false | false |
jtoppins/beaker | IntegrationTests/src/bkr/inttest/server/selenium/test_job_export_xml.py | 1 | 2025 |
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
from bkr.inttest.server.selenium import WebDriverTestCase
from bkr.int... | gpl-2.0 | 621,352,936,695,160,400 | 42.085106 | 92 | 0.65284 | false | 3.894231 | false | false | false |
samueljackson92/NDImage | ndimage/gui/table_model.py | 1 | 1313 | from PyQt4 import QtCore
class DataFrameTableModel(QtCore.QAbstractTableModel):
def __init__(self, data=None, parent=None):
QtCore.QAbstractTableModel.__init__(self, parent=parent)
self.set_data(data)
def rowCount(self, parent):
return self._data.shape[0] if self._data is not None els... | mit | -1,186,761,553,999,052,300 | 34.486486 | 86 | 0.648134 | false | 3.954819 | false | false | false |
stdlib-js/stdlib | lib/node_modules/@stdlib/math/base/special/maxabs/benchmark/python/benchmark.py | 1 | 2209 | #!/usr/bin/env python
#
# @license Apache-2.0
#
# Copyright (c) 2018 The Stdlib Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# ... | apache-2.0 | -5,144,522,500,454,437,000 | 21.773196 | 82 | 0.626981 | false | 3.627258 | false | false | false |
henry0312/LightGBM | python-package/lightgbm/plotting.py | 1 | 25113 | # coding: utf-8
"""Plotting library."""
from copy import deepcopy
from io import BytesIO
import numpy as np
from .basic import Booster, _log_warning
from .compat import GRAPHVIZ_INSTALLED, MATPLOTLIB_INSTALLED
from .sklearn import LGBMModel
def _check_not_tuple_of_2_elements(obj, obj_name='obj'):
"""Check objec... | mit | -408,649,031,525,272,200 | 39.309791 | 115 | 0.614781 | false | 3.971691 | false | false | false |
darknightghost/AutoDeployer | cmd_pipe/SubProc.py | 1 | 3581 | #! /usr/bin/python3
# -*- coding: utf-8 -*-
'''
Copyright 2016,王思远 <darknightghost.cn@gmail.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 Foundation, either version 3 of the License, o... | gpl-3.0 | -127,845,725,472,308,430 | 29.29661 | 74 | 0.567552 | false | 3.919956 | false | false | false |
martinzlocha/mad | portal/forms.py | 1 | 2190 | from django import forms
from django.core.exceptions import ValidationError
from portal.models import Student, Hobby
class SignUpForm(forms.ModelForm):
class Meta:
model = Student
fields = ['name', 'username', 'gender', 'course']
widgets = {
'name': forms.TextInput(attrs={'pla... | mit | -1,180,396,039,648,989,400 | 34.322581 | 120 | 0.620091 | false | 4.163498 | false | false | false |
citiususc/construe | construe/utils/signal_processing/wave_extraction.py | 1 | 8755 | # -*- coding: utf-8 -*-
# pylint: disable-msg=C0103
"""
Created on Thu Oct 17 13:15:52 2013
This module provides the functionality to obtain basic primitive structures,
called "peaks", from a signal fragment and its corresponding simplification
using the Douglas-Peucker algorithm. The process is based on the paper:
"... | agpl-3.0 | 7,635,516,548,468,927,000 | 37.231441 | 79 | 0.531468 | false | 3.276572 | false | false | false |
endreman0/Excalibot | excalibot/cogs/voice.py | 1 | 4864 | import asyncio, discord
from discord.ext.commands import guild_only
from .. import db, log
from ..core import command
class VoiceText(metaclass=command.Cog):
async def on_voice_state_update(self, member, before, after):
if before.channel is after.channel: return # Only care about changing channels
with self.bot.s... | gpl-3.0 | -6,292,609,427,924,506,000 | 52.450549 | 167 | 0.717516 | false | 3.206328 | false | false | false |
yeming233/rally | rally/plugins/openstack/services/storage/cinder_common.py | 1 | 29782 | # All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in... | apache-2.0 | -218,852,773,355,620,600 | 39.853224 | 80 | 0.601874 | false | 4.245474 | false | false | false |
tsauerwein/c2cgeoportal | c2cgeoportal/tests/xmlstr.py | 3 | 5978 | # -*- coding: utf-8 -*-
# Copyright (c) 2013-2014, Camptocamp SA
# 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 notice, this
#... | bsd-2-clause | -5,369,876,525,444,830,000 | 60.608247 | 776 | 0.732932 | false | 2.985015 | false | false | false |
ayepezv/GAD_ERP | openerp/__init__.py | 2 | 2641 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
""" OpenERP core library."""
#----------------------------------------------------------
# Running mode flags (gevent, prefork)
#----------------------------------------------------------
# Is the server running with ge... | gpl-3.0 | -7,602,556,953,469,250,000 | 31.604938 | 79 | 0.537675 | false | 5.168297 | false | false | false |
bburan/psiexperiment | psi/controller/calibration/chirp_calibration.py | 1 | 1129 | from ..util import acquire
def chirp_power(engine, freq_lb=50, freq_ub=100e3, attenuation=0, vrms=1,
repetitions=32, duration=0.1, iti=0.01):
calibration = FlatCalibration.as_attenuation(vrms=vrms)
ai_fs = engine.hw_ai_channels[0].fs
ao_fs = engine.hw_ao_channels[0].fs
queue = FIFOSig... | mit | -6,651,210,350,675,184,000 | 33.212121 | 75 | 0.643047 | false | 3.30117 | false | false | false |
optikfluffel/lagesonum | lagesonum/bottle_app.py | 1 | 4024 | # coding: utf-8
import sqlite3
import os
import time
import bottle
from bottle import default_app, route, view
from bottle import request
from bottle_utils.i18n import I18NPlugin
#from bottle_utils.i18n import lazy_gettext as _
#todo: refactor so that there is no error in Py3 local deployment and testing
import inpu... | mit | 4,199,236,689,896,837,600 | 30.193798 | 118 | 0.591451 | false | 3.445205 | false | false | false |
shivam5992/pywordcloud-flask | words.py | 1 | 4499 | '''
Python implementation of HTML wordcloud of words collected from
a website, Paragraph Input or File Upload. Flask Web App implementation
of the same.
Author: Shivam Bansal
Email: shivam5992@gmail.com
Website: www.shivambansal.com
Version: 0.1
'''
from flask import Flask, render_template, request, flash, redirec... | mit | 8,035,192,736,946,009,000 | 25.162791 | 145 | 0.625695 | false | 3.033715 | false | false | false |
steveb/heat | heat/engine/clients/os/neutron/__init__.py | 1 | 6485 | #
# 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 | -6,405,323,272,617,855,000 | 38.542683 | 78 | 0.588743 | false | 4.14377 | false | false | false |
gazbot/conference-project | models.py | 1 | 5513 | #!/usr/bin/env python
"""models.py
Udacity conference server-side Python App Engine data & ProtoRPC models
$Id: models.py,v 1.1 2014/05/24 22:01:10 wesc Exp $
created/forked from conferences.py by wesc on 2014 may 24
"""
__author__ = 'wesc+api@google.com (Wesley Chun)'
import httplib
import endpoints
from protor... | apache-2.0 | -3,578,478,729,146,258,400 | 33.037037 | 87 | 0.6579 | false | 4.059647 | false | false | false |
sensbio/sensbiotk | examples/scripts/expe_prima.py | 1 | 4757 |
# -*- coding: utf-8 -*-
"""
Reconstruction angles example comparison
"""
import numpy as np
from sensbiotk.algorithms import martin_ahrs
from sensbiotk.algorithms.basic import find_static_periods
from sensbiotk.io.iofox import load_foxcsvfile
from sensbiotk.io.ahrs import save_ahrs_csvfile
import sensbiotk... | gpl-3.0 | -5,332,932,333,264,223,000 | 31.737589 | 83 | 0.570107 | false | 2.971268 | false | false | false |
Spandex-at-Exeter/demography_database | app/matrix_functions.py | 1 | 14553 | from models import Permission, Role, User, IUCNStatus, OrganismType, GrowthFormRaunkiaer, ReproductiveRepetition, \
DicotMonoc, AngioGymno, SpandExGrowthType, SourceType, Database, Purpose, MissingData, ContentEmail, Ecoregion, Continent, InvasiveStatusStudy, InvasiveStatusElsewhere, StageTypeClass,... | mit | 9,208,999,180,805,464,000 | 42.056213 | 279 | 0.698413 | false | 3.228977 | false | false | false |
thepian/theapps | theapps/supervisor/sites.py | 1 | 1074 | from django.conf import settings
class SiteManager(object):
def __init__(self):
self.cur = None
# Map of Site instances
self.sites = {}
def get_current(self):
if not self.cur:
self.cur = Site()
return self.cur
def get_d... | gpl-3.0 | 8,910,944,919,843,968,000 | 25.85 | 113 | 0.555866 | false | 3.948529 | false | false | false |
boldfield/s3-encryption | s3_encryption/crypto.py | 1 | 1913 | from Crypto import Random
from Crypto.Cipher import AES as pyAES
import codecs
class AES(object):
def __init__(self):
self.key = None
self._mode = None
self.iv = None
@staticmethod
def str_to_bytes(data):
t = type(b''.decode('utf-8'))
if isinstance(data, t):
... | bsd-3-clause | -4,556,593,097,893,904,400 | 23.844156 | 141 | 0.591218 | false | 3.080515 | false | false | false |
AutorestCI/azure-sdk-for-python | azure-mgmt-network/azure/mgmt/network/v2017_11_01/models/azure_reachability_report_parameters.py | 1 | 2096 | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes ... | mit | -2,620,773,727,717,192,700 | 40.098039 | 102 | 0.623569 | false | 4.268839 | false | false | false |
pwarren/AGDeviceControl | agdevicecontrol/thirdparty/site-packages/darwin/phidgets/servomotor.py | 1 | 3317 | # This file was created automatically by SWIG.
# Don't modify this file, modify the SWIG interface instead.
# This file is compatible with both classic and new-style classes.
import _servomotor
def _swig_setattr(self,class_type,name,value):
if (name == "this"):
if isinstance(value, class_type):
... | gpl-2.0 | 6,873,438,704,202,684,000 | 45.71831 | 127 | 0.708472 | false | 3.25835 | false | false | false |
brosner/django-sqlalchemy | django_sqlalchemy/management/sql.py | 1 | 1402 | from django.db.models.loading import get_models
from django.core.management.sql import custom_sql_for_model
from sqlalchemy import create_engine
from django_sqlalchemy.backend import metadata, session
def reset(engine, app):
metadata.drop_all(engine, tables=_get_tables_for_app(app))
session.commit()
def creat... | bsd-3-clause | -8,844,244,939,070,740,000 | 36.891892 | 99 | 0.616976 | false | 3.949296 | false | false | false |
TarasLevelUp/asynqp | src/asynqp/message.py | 1 | 8788 | import json
from collections import OrderedDict
from datetime import datetime
from io import BytesIO
from . import amqptypes
from . import serialisation
class Message(object):
"""
An AMQP Basic message.
Some of the constructor parameters are ignored by the AMQP broker and are provided
just for the co... | mit | 9,189,294,022,764,453,000 | 34.152 | 105 | 0.624033 | false | 4.198758 | false | false | false |
porksmash/swarfarm | bestiary/models.py | 1 | 75620 | from collections import OrderedDict
from functools import partial
from math import floor, ceil
from operator import is_not
from django.contrib.auth.models import User
from django.contrib.postgres.fields import ArrayField
from django.contrib.staticfiles.templatetags.staticfiles import static
from django.core.exceptions... | apache-2.0 | -5,660,210,679,202,290,000 | 39.546917 | 188 | 0.562391 | false | 3.259061 | false | false | false |
akrause2014/dispel4py | dispel4py/new/mpi_process_test.py | 1 | 1115 | # Copyright (c) The University of Edinburgh 2014
#
# 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 agr... | apache-2.0 | 5,902,654,700,553,839,000 | 32.787879 | 86 | 0.747982 | false | 3.506289 | true | false | false |
dbdd4us/compose | compose/utils.py | 1 | 3235 | from __future__ import absolute_import
from __future__ import unicode_literals
import codecs
import hashlib
import json
import json.decoder
import logging
import ntpath
import six
from .errors import StreamParseError
json_decoder = json.JSONDecoder()
log = logging.getLogger(__name__)
def get_output_stream(stream... | apache-2.0 | -2,486,481,074,851,938,300 | 26.184874 | 85 | 0.636785 | false | 3.998764 | false | false | false |
javierwilson/forocacao | forocacao/app/png.py | 1 | 4177 | # -*- coding: utf-8 -*-
from PIL import Image, ImageDraw, ImageFont
import textwrap
from unidecode import unidecode
from reportlab.graphics import renderPM
from reportlab.graphics.barcode import code128
from reportlab.graphics.barcode import createBarcodeDrawing
from reportlab.graphics.barcode import createBarcodeImag... | bsd-3-clause | -7,824,533,436,109,494,000 | 38.40566 | 126 | 0.603304 | false | 3.689929 | false | false | false |
mhahn/stacker | stacker/lookups/registry.py | 1 | 1745 | from ..exceptions import UnknownLookupType
from ..util import load_object_from_string
from .handlers import output
from .handlers import kms
from .handlers import xref
from .handlers import file as file_handler
LOOKUP_HANDLERS = {}
DEFAULT_LOOKUP = output.TYPE_NAME
def register_lookup_handler(lookup_type, handler_o... | bsd-2-clause | -1,027,917,854,892,513,400 | 29.614035 | 79 | 0.679083 | false | 4.011494 | false | false | false |
charlesfleche/charlesfleche.net | fabfile.py | 1 | 3663 | from fabric.api import *
import fabric.contrib.project as project
import http.server
import os
import shutil
import sys
import socketserver
# Local path configuration (can be absolute or relative to fabfile)
env.deploy_path = 'output'
DEPLOY_PATH = env.deploy_path
# Remote server configuration
production = 'root@char... | mit | -9,078,609,407,775,656,000 | 30.577586 | 223 | 0.663118 | false | 3.273458 | false | false | false |
cylc/cylc | cylc/flow/broadcast_report.py | 1 | 3589 | # THIS FILE IS PART OF THE CYLC SUITE ENGINE.
# Copyright (C) NIWA & British Crown (Met Office) & Contributors.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License,... | gpl-3.0 | -5,435,023,536,567,714,000 | 35.252525 | 75 | 0.593201 | false | 4.173256 | false | false | false |
dceoy/fractus | fract/model/ewma.py | 1 | 1996 | #!/usr/bin/env python
import logging
import numpy as np
from .sieve import LRFeatureSieve
class Ewma(object):
def __init__(self, config_dict):
self.__logger = logging.getLogger(__name__)
self.__alpha = config_dict['model']['ewma']['alpha']
self.__sigma_band = config_dict['model']['ewma'][... | mit | -7,870,564,357,281,349,000 | 35.962963 | 77 | 0.491483 | false | 3.214171 | false | false | false |
tmm/django-username-email | cuser/admin.py | 1 | 1437 | from django.contrib import admin
from django.contrib.auth.admin import GroupAdmin as BaseGroupAdmin
from django.contrib.auth.admin import UserAdmin as BaseUserAdmin
from django.contrib.auth.models import Group as StockGroup
from django.utils.translation import gettext_lazy as _
from cuser.forms import UserChangeForm, ... | mit | 9,063,590,292,572,750,000 | 34.925 | 79 | 0.637439 | false | 3.781579 | false | false | false |
anthonyfok/frescobaldi | frescobaldi_app/docbrowser/browser.py | 1 | 10953 | # This file is part of the Frescobaldi project, http://www.frescobaldi.org/
#
# Copyright (c) 2008 - 2014 by Wilbert Berendsen
#
# 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
... | gpl-2.0 | 8,974,451,822,156,147,000 | 37.978648 | 98 | 0.619739 | false | 4.136329 | false | false | false |
ftrimble/route-grower | pyroute/compress/compress.py | 1 | 4419 | #!/usr/bin/python
#----------------------------------------------------------------
#
#------------------------------------------------------
# Usage:
#
#------------------------------------------------------
# Copyright 2007, Oliver White
#
# This program is free software: you can redistribute it and/or modify
# it un... | apache-2.0 | 2,230,958,692,004,118,500 | 30.564286 | 218 | 0.562118 | false | 3.48227 | false | false | false |
tp81/openmicroscopy | components/tools/OmeroWeb/omeroweb/webclient/show.py | 1 | 29181 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright (c) 2014 University of Dundee & Open Microscopy Environment.
# All rights reserved.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foun... | gpl-2.0 | -3,020,381,144,042,495,000 | 35.204715 | 79 | 0.533532 | false | 4.256272 | false | false | false |
DomNomNom/Cardo | Cardo.py | 1 | 4736 |
import sys, select # for timing out input
'''
This is the overall idea of the game's main logic:
stack = [] # last value is the top of the stack
while not gameOver:
if stack is empty:
stack = [ nextEvent() ]
# stack now has at least one element
top = stack[-1]
imminent(top) # this may ... | gpl-3.0 | 6,443,879,362,117,278,000 | 22.919192 | 85 | 0.614231 | false | 3.797915 | false | false | false |
andrewjrobinson/FreeCAD_sf_master | src/Mod/Draft/DraftTrackers.py | 1 | 34739 | #***************************************************************************
#* *
#* Copyright (c) 2011 *
#* Yorik van Havre <yorik@uncreated.net> *
#* ... | lgpl-2.1 | -1,483,052,015,789,805,300 | 37.945067 | 114 | 0.567259 | false | 3.630748 | false | false | false |
CiscoSystems/os-sqe | lab/scenarios/servers_from_snapshot_scenario.py | 1 | 1179 | from lab.test_case_worker import TestCaseWorker
class ServersFromSnapshotScenario(TestCaseWorker):
ARG_MANDATORY_N_SERVERS = 'n_servers'
ARG_MANDATORY_UPTIME = 'uptime'
def check_arguments(self):
assert self.n_servers >= 1
assert self.uptime > 10
@property
def n_servers(self):
... | apache-2.0 | 719,308,940,948,195,300 | 30.864865 | 174 | 0.648855 | false | 3.447368 | false | false | false |
kreatorkodi/repository.torrentbr | plugin.video.youtube/resources/lib/youtube_plugin/kodion/impl/xbmc/xbmc_context_ui.py | 1 | 5105 | __author__ = 'bromix'
from six import string_types
import xbmc
import xbmcgui
from ..abstract_context_ui import AbstractContextUI
from .xbmc_progress_dialog import XbmcProgressDialog
from .xbmc_progress_dialog_bg import XbmcProgressDialogBG
from ... import constants
from ... import utils
class XbmcContextUI(Abstra... | gpl-2.0 | 5,859,240,278,206,949,000 | 33.261745 | 108 | 0.610382 | false | 3.849925 | false | false | false |
fernan9/LANGEBIO-Internship | BLAST_rbh_run.py | 1 | 3987 | #! /usr/bin/env python
""" DESCRIPTION
"""
import glob, sys, csv
from tabulate import tabulate
from Bio.Blast.Applications import NcbiblastpCommandline
"""--- FUNCTIONS ---"""
def carga_csv(file_name):
""" creates a list of lists with a csv file """
tabla = []
cr = csv.reader(open(file_name,"rb"))
... | gpl-2.0 | -2,226,153,138,521,786,600 | 34.598214 | 118 | 0.610986 | false | 3.236201 | false | false | false |
brayden2544/Mystuff-final | account/views/reset_password.py | 1 | 1223 | from django import forms
from django.conf import settings
from django.http import HttpResponse, HttpResponseRedirect, Http404
from account import models as amod
from . import templater
import datetime
def process_request(request):
'''Creates a reset password form to email a unique link to the user'''
user ... | apache-2.0 | -6,399,470,654,394,678,000 | 30.358974 | 77 | 0.670482 | false | 4.063123 | false | false | false |
sam-roth/Keypad | keypad/qt/qt_util.py | 1 | 2494 |
from PyQt4.Qt import *
from collections import namedtuple
import contextlib
from ..core.key import SimpleKeySequence
from ..core.color import Color
from ..abstract.textview import KeyEvent
from ..core.responder import Responder
from .. import api
import abc
import math
def set_tab_order(parent, widgets):
for f... | gpl-3.0 | -4,094,260,488,308,843,500 | 20.135593 | 71 | 0.615477 | false | 3.778788 | false | false | false |
nextoa/comb | comb/slot.py | 1 | 2027 | # -*- coding: utf-8 -*-
class Slot(object):
"""
To use comb, you should create a python module file. we named *slot*.
A legal slot must be named 'Slot' in your module file and it must be at least contain four method:
* `initialize`
initial resource, e.g: database handle
* `__enter__`
g... | mit | -5,057,463,884,052,601,000 | 19.474747 | 102 | 0.51258 | false | 4.406522 | false | false | false |
4ndreas/ROSCoffeButler | src/arbotix_python/src/arbotix_python/diff_controller.py | 1 | 10710 | #!/usr/bin/env python
"""
diff_controller.py - controller for a differential drive
Copyright (c) 2010-2011 Vanadium Labs LLC. All right reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
* Redistributi... | mit | 5,647,903,849,542,350,000 | 40.034483 | 144 | 0.556489 | false | 3.752628 | false | false | false |
juancarlospaco/css-html-js-minify | css_html_js_minify/js_minifier.py | 1 | 6476 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""JavaScript Minifier functions for CSS-HTML-JS-Minify."""
import re
from io import StringIO # pure-Python StringIO supports unicode.
from .css_minifier import condense_semicolons
__all__ = ('js_minify', )
def remove_commented_lines(js):
"""Force remove com... | lgpl-3.0 | 1,878,974,442,023,061,800 | 35.178771 | 79 | 0.468345 | false | 4.566996 | false | false | false |
garibaldu/boundary-seekers | Boundary Hunter Ideas/TensorFlow/RBF-BH-Network.py | 1 | 6690 | import tensorflow as tf
import matplotlib
import numpy as np
import matplotlib.pyplot as plt
import random
import math
np.random.seed(1234)
random.seed(1234)
plt.switch_backend("TkAgg")
def plotScatter(points, color):
xs = [x[0] for x in points]
ys = [y[1] for y in points]
plt.scatter(xs, ys, c=colo... | mit | -5,844,633,788,650,325,000 | 26.991632 | 108 | 0.582511 | false | 2.932924 | false | false | false |
hamdyaea/Daylight-GNU-Linux | Version4/usr/share/daylight/PySpeaking-GUI/speak.py | 1 | 1687 | # Developer : Hamdy Abou El Anein
import os
import sys
from easygui import *
print("IMPORTANT\n\nThis software work only if google_speech is installed on the system. To install it go to this link please : https://pypi.python.org/pypi/google_speech/\n\n")
def language():
global lang
msg = "What's the langu... | gpl-3.0 | 3,731,881,394,284,948,500 | 24.575758 | 177 | 0.578542 | false | 3.421907 | false | false | false |
dubvulture/pyku | pyku/digit_classifier.py | 1 | 4575 | # coding=utf-8
import os
import cv2
import numpy as np
from .utils import DSIZE, TRAIN_DATA
class DigitClassifier(object):
@staticmethod
def _feature(image):
"""
It's faster but still accurate enough with DSIZE = 14.
~0.9983 precision and recall
:param image:
:return:... | gpl-3.0 | -8,652,264,273,431,171,000 | 35.903226 | 80 | 0.532022 | false | 3.893617 | false | false | false |
darrencheng0817/AlgorithmLearning | Python/leetcode/MergeKLists.py | 1 | 1442 |
class ListNode(object):
def __init__(self, x):
self.val = x
self.next = None
class Solution(object):
def mergeKLists(self, lists):
"""
:type lists: List[ListNode]
:rtype: ListNode
"""
from heapq import heappush, heappop, heapreplace, heapify
... | mit | -99,459,296,128,431,540 | 22.639344 | 65 | 0.511789 | false | 3.284738 | false | false | false |
captainsafia/agate | agate/columns/base.py | 1 | 3431 | #!/usr/bin/env python
from collections import Mapping, Sequence
try:
from collections import OrderedDict
except ImportError: #pragma: no cover
from ordereddict import OrderedDict
import six
from agate.exceptions import ColumnDoesNotExistError
from agate.utils import memoize
class ColumnMapping(Mapping):
... | mit | -8,266,430,875,048,023,000 | 23.507143 | 75 | 0.568347 | false | 4.099164 | false | false | false |
Pulgama/supriya | supriya/nonrealtime/Moment.py | 1 | 1816 | from supriya.nonrealtime.SessionObject import SessionObject
class Moment(SessionObject):
"""
A moment-in-time referencing a singleton non-realtime state.
::
>>> import supriya.nonrealtime
>>> session = supriya.nonrealtime.Session()
>>> moment = session.at(10.5)
"""
### ... | mit | -4,129,431,815,755,473,400 | 24.942857 | 80 | 0.590859 | false | 4.117914 | false | false | false |
dennisss/sympy | sympy/functions/special/tests/test_error_functions.py | 2 | 24070 | from sympy import (
symbols, expand, expand_func, nan, oo, Float, conjugate, diff,
re, im, Abs, O, factorial, exp_polar, polar_lift, gruntz, limit,
Symbol, I, integrate, S,
sqrt, sin, cos, sinh, cosh, exp, log, pi, EulerGamma,
erf, erfc, erfi, erf2, erfinv, erfcinv, erf2inv,
gamma, uppergamma, l... | bsd-3-clause | -8,657,577,822,490,563,000 | 34.712166 | 102 | 0.523889 | false | 2.313089 | true | false | false |
kdebrab/pandas | pandas/core/resample.py | 1 | 52045 | from datetime import timedelta
import numpy as np
import warnings
import copy
from textwrap import dedent
import pandas as pd
from pandas.core.groupby.base import GroupByMixin
from pandas.core.groupby.ops import BinGrouper
from pandas.core.groupby.groupby import (
_GroupBy, GroupBy, groupby, _pipe_template
)
from ... | bsd-3-clause | -5,954,581,995,773,467,000 | 31.630094 | 79 | 0.550562 | false | 3.969568 | false | false | false |
grze/parentheses | clc/eucadmin/eucadmin/describeinstances.py | 1 | 2047 | # Software License Agreement (BSD License)
#
# Copyright (c) 2013 Eucalyptus Systems, Inc.
# All rights reserved.
#
# Redistribution and use of this software in source and binary forms, with or
# without modification, are permitted provided that the following conditions
# are met:
#
# Redistributions of source code m... | gpl-3.0 | -8,749,896,958,695,378,000 | 40.77551 | 77 | 0.737665 | false | 4.186094 | false | false | false |
ryansb/disq | tests/test_job_commands.py | 1 | 2851 | # Copyright 2015 Ryan Brown <sb@ryansb.com>
#
# 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 ... | apache-2.0 | 4,155,654,131,376,370,000 | 26.152381 | 74 | 0.649947 | false | 2.885628 | true | false | false |
brkwon/arista_eapi | modules/arista_eapi_urllib2.py | 1 | 3060 | # EAPI call program using urllib2 and json
import urllib2
#import random
import json
# eAPI JSON template
enableCmd = {"input" : "test", "cmd" : "enable"}
jsonCmd = {"params" : {"format" : "json", "version" : 1, "cmds" : "command"}, "jsonrpc" : "2.0", "method" : "runCmds", "id" : 0}
# Create json based on enable_pa... | lgpl-3.0 | -2,830,876,098,484,342,300 | 32.26087 | 128 | 0.675817 | false | 3.625592 | false | false | false |
chdecultot/frappe | frappe/model/base_document.py | 1 | 25095 | # Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# MIT License. See license.txt
from __future__ import unicode_literals
from six import iteritems, string_types
import datetime
import frappe, sys
from frappe import _
from frappe.utils import (cint, flt, now, cstr, strip_html, getdate, get_datetime, ... | mit | -9,026,169,210,520,244,000 | 29.905172 | 120 | 0.66308 | false | 3.15859 | false | false | false |
Sult/evetool | evetool/settings.py | 1 | 4146 | """
Django settings for evetool project.
Generated by 'django-admin startproject' using Django 1.8.
For more information on this file, see
https://docs.djangoproject.com/en/1.8/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.8/ref/settings/
"""
# Build paths ... | mit | 8,719,298,617,498,412,000 | 23.975904 | 73 | 0.646406 | false | 3.437811 | false | false | false |
SEL-Columbia/commcare-hq | corehq/apps/users/bulkupload.py | 1 | 19528 | from StringIO import StringIO
import logging
from couchdbkit.exceptions import (
BulkSaveError,
MultipleResultsFound,
ResourceNotFound,
)
from django.core.exceptions import ValidationError
from django.utils.translation import ugettext as _
from corehq.apps.groups.models import Group
from corehq.apps.users.f... | bsd-3-clause | 4,689,480,229,207,205,000 | 35.500935 | 130 | 0.552284 | false | 4.252613 | false | false | false |
Jarn/jarn.viewdoc | jarn/viewdoc/testing.py | 1 | 1874 | import sys
import os
import unittest
import tempfile
import shutil
import functools
if sys.version_info[0] >= 3:
from io import StringIO
else:
from StringIO import StringIO
from os.path import realpath, isdir
class ChdirStack(object):
"""Stack of current working directories."""
def __init__(self):
... | bsd-2-clause | -3,124,150,782,722,566,000 | 21.309524 | 53 | 0.570971 | false | 4.056277 | false | false | false |
halfakop/Teacup_Firmware | configtool/gui.py | 1 | 19693 |
import sys
import time
try:
import wx
except:
print("ImportError: No module named wx\n\n"
"wxPython is not installed. This program requires wxPython to run.\n"
"See your package manager and/or http://wxpython.org/download.php.")
time.sleep(10)
sys.exit(-1)
import os.path
from configtool.data ... | gpl-2.0 | 6,312,573,059,711,797,000 | 30.917342 | 80 | 0.607779 | false | 3.543819 | true | false | false |
ahwkuepper/stdme | app/constants.py | 1 | 8339 | import numpy as np
#labels for summary plots
d_label = np.array(["You", "Your gender", "Your age group", "Your race / ethnicity", "Your location"])
#US statistics
gender_number = {}
gender_number["Male"] = 155651602
gender_number["Female"] = 160477237
race_number = {}
race_number["Native"] = 1942876.0
race_number[... | mit | 658,293,424,676,495,500 | 37.428571 | 102 | 0.699844 | false | 2.242873 | false | false | false |
riolet/rioauth | provider/pages/register.py | 1 | 1949 | import web
import common
import base
class Register(base.Page):
def __init__(self):
base.Page.__init__(self, "Register")
def GET(self):
# show login page
return common.render.register()
@staticmethod
def send_conf_email(user_id, name, email):
duration = 1800 # 30 mi... | gpl-3.0 | 6,252,393,982,004,596,000 | 30.95082 | 104 | 0.636224 | false | 3.851779 | false | false | false |
siacs/HttpUploadComponent | httpupload/server.py | 2 | 13933 | #!/usr/bin/env python3
import argparse
import base64
import errno
import hashlib
import logging
import mimetypes
import os
import random
import shutil
import ssl
import string
import sys
import time
import urllib.parse
import yaml
from sleekxmpp.componentxmpp import ComponentXMPP
from threading import Event
from thre... | agpl-3.0 | 1,377,332,783,470,547,000 | 41.478659 | 165 | 0.55975 | false | 4.219564 | true | false | false |
joaofanti/TrabRedesIIFinal | Modelos/Mapa/MapFactory.py | 1 | 2000 | import json
from Map import Map
from Door import Door
from Room import Room
from Item import Item
"""
Define um gerador de mapas.
"""
class MapFactory:
"""
Cria uma nova instancia de gerador de mapas.
"""
def __init__(self):
self.RoomsList = [] # Lista de salas geradas.
self.DoorsList = [] # Lista de portas... | mit | -4,662,907,654,454,719,000 | 25.328947 | 95 | 0.697 | false | 2.86123 | false | false | false |
onyg/aserializer | aserializer/django/fields.py | 1 | 2229 | # -*- coding: utf-8 -*-
from collections import Iterable
try:
from django.db.models.query import QuerySet
from django.db.models import Manager
except ImportError:
QuerySet = None
Manager = None
from aserializer.fields import ListSerializerField
from aserializer.django.utils import get_local_fields, get... | mit | -4,767,140,626,325,645,000 | 42.705882 | 120 | 0.61956 | false | 4.158582 | false | false | false |
pedrobaeza/l10n-spain | l10n_es_partner/models/l10n_es_partner.py | 1 | 7222 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (c) 2008 Spanish Localization Team
# Copyright (c) 2009 Zikzakmedia S.L. (http://zikzakmedia.com)
# Jordi Esteve <jesteve@zikzakm... | agpl-3.0 | 6,887,857,847,909,223,000 | 40.705202 | 81 | 0.461123 | false | 4.229191 | false | false | false |
151706061/SimpleITK | Examples/Segmentation/ConnectedThresholdImageFilter.py | 1 | 2202 | '''=========================================================================
'
' Copyright Insight Software Consortium
'
' 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 | 7,621,793,930,765,058,000 | 26.525 | 136 | 0.645322 | false | 3.829565 | false | false | false |
dbrattli/RxPY | rx/linq/observable/sequenceequal.py | 1 | 3360 | import collections
from rx import AnonymousObservable, Observable
from rx.disposables import CompositeDisposable
from rx.internal import default_comparer
from rx.internal import extensionmethod
@extensionmethod(Observable)
def sequence_equal(self, second, comparer=None):
"""Determines whether two sequences are e... | apache-2.0 | 2,095,176,045,865,010,000 | 32.267327 | 110 | 0.545238 | false | 4.409449 | false | false | false |
laborautonomo/django-newsletter | newsletter/migrations/0005_auto__del_emailtemplate__del_unique_emailtemplate_title_action__del_fi.py | 1 | 11955 | # -*- coding: utf-8 -*-
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
from ..utils import get_user_model
User = get_user_model()
user_orm_label = '%s.%s' % (User._meta.app_label, User._meta.object_name)
user_model_label = '%s.%s' % (User._meta.app_label, Us... | agpl-3.0 | -1,749,140,199,191,356,700 | 71.018072 | 187 | 0.582016 | false | 3.733604 | false | false | false |
rakhimov/cppdep | setup.py | 1 | 1609 | #!/usr/bin/env python
"""The setup script to generate dist files for PyPi.
To upload the release to PyPi:
$ ./setup.py sdist bdist_wheel --universal
$ twine upload dist/*
"""
from setuptools import setup
from cppdep import cppdep
setup(
name="cppdep",
version=cppdep.VERSION,
maintainer="Olzhas R... | gpl-3.0 | 8,897,259,033,538,249,000 | 31.836735 | 85 | 0.607209 | false | 3.867788 | false | false | false |
ScientificDataFormat/SDF-Python | sdf/hdf5.py | 1 | 5874 | # Copyright (c) 2019 Dassault Systemes. All rights reserved.
import h5py
import sdf
import numpy as np
import os
import sys
def _to_python_str(s):
""" Convert to Python string """
if isinstance(s, bytes):
return s.decode('utf-8')
else:
return s
def load(filename, obje... | bsd-3-clause | 7,269,598,341,535,490,000 | 26.240385 | 112 | 0.52843 | false | 3.632653 | false | false | false |
chirpradio/chirpradio-machine | chirp/stream/statistics.py | 1 | 6045 | """
Compute statistics about a consumed sequence of messages.
"""
from chirp.common import http_console_server
from chirp.common import timestamp
from chirp.stream import message
class _ConnectionInfo(object):
MAX_NUM_ERRORS = 25
connection_id = None
start_timestamp_ms = None
last_timestamp_ms ... | apache-2.0 | -8,816,550,096,536,408,000 | 37.503185 | 79 | 0.561952 | false | 3.782854 | false | false | false |
DanLindeman/memegen | tests/test_api_aliases.py | 1 | 1225 | # pylint: disable=unused-variable,misplaced-comparison-constant,expression-not-assigned
from expecter import expect
from .utils import load
def describe_get():
def it_requires_a_name_to_return_aliases(client):
status, data = load(client.get("/api/aliases/"))
expect(status) == 200
expec... | mit | -1,296,583,061,009,426,400 | 27.488372 | 87 | 0.516735 | false | 4.042904 | false | false | false |
PoolC/pythonstudy | entity.py | 1 | 1669 | #coding:utf-8
import types
class Channel(object):
def __init__(self, owner):
self._owner = owner
def _process_message(self, sender, msg, msgargs):
return self._owner._handle(sender, msg, msgargs)
def sendto(self, receiver, msg, msgargs = None):
return receiver._process_mes... | gpl-3.0 | -5,939,575,256,779,529,000 | 24.287879 | 60 | 0.537448 | false | 4.193467 | false | false | false |
keenondrums/sovrin-node | sovrin_client/agent/agent_issuer.py | 1 | 3182 | import json
from plenum.common.types import f
from anoncreds.protocol.issuer import Issuer
from anoncreds.protocol.types import ID
from anoncreds.protocol.types import ClaimRequest
from sovrin_client.agent.constants import EVENT_NOTIFY_MSG, CLAIMS_LIST_FIELD
from sovrin_client.agent.msg_constants import CLAIM, CLAIM_R... | apache-2.0 | 4,596,627,729,626,327,000 | 37.337349 | 95 | 0.641735 | false | 3.644903 | false | false | false |
zhewang/lcvis | main.py | 1 | 3262 | import json
import numpy as np
import pca
import process_object as po
from flask import Flask, request, jsonify, render_template, url_for
app = Flask(__name__)
@app.route('/')
def index():
return render_template('index.html')
@app.route('/supernova')
def supernova():
return render_template('supernova.html'... | gpl-2.0 | 1,719,386,529,822,531,600 | 26.411765 | 92 | 0.57572 | false | 3.355967 | false | false | false |
datascopeanalytics/sensor_fusion | main.py | 1 | 6487 | import copy
import datetime
import math
import random
from collections import defaultdict
import matplotlib as mpl
import matplotlib.animation
from matplotlib.ticker import FormatStrFormatter
import numpy as np
import scipy
import seaborn as sns
import traces
# local imports
from kalman import Estimate, Reading
from... | unlicense | -2,849,462,378,540,954,000 | 34.839779 | 112 | 0.617389 | false | 3.350723 | false | false | false |
minrk/sympy | sympy/tensor/indexed.py | 1 | 13604 | """Module that defines indexed objects
The classes IndexedBase, Indexed and Idx would represent a matrix element
M[i, j] as in the following graph::
1) The Indexed class represents the entire indexed object.
|
___|___
' '
M[i, j]
... | bsd-3-clause | -3,039,205,285,116,504,000 | 31.623501 | 99 | 0.60394 | false | 4.016534 | false | false | false |
1503051/webhookshipping | app.py | 1 | 1887 | #!/usr/bin/env python
import urllib
import json
import os
from flask import Flask
from flask import request
from flask import make_response
from pymongo import MongoClient
# Flask app should start in global layout
app = Flask(__name__)
client = MongoClient('mongodb://localhost:27017')
@app.route('/star', methods=['... | apache-2.0 | -2,935,963,759,269,244,400 | 24.849315 | 126 | 0.612083 | false | 3.387792 | false | false | false |
rajanandakumar/DIRAC | DataManagementSystem/Client/ReplicaManager.py | 1 | 113878 | """
:mod: ReplicaManager
.. module: ReplicaManager
:synopsis: ReplicaManager links the functionalities of StorageElement and FileCatalog.
This module consists ReplicaManager and related classes.
OBSOLETED !!! DO NOT USE THIS ANYMORE!!!! USE THE DataManager CLASS
"""
# # imports
from datetime import datetime, tim... | gpl-3.0 | -7,696,063,295,908,667,000 | 43.10457 | 157 | 0.646042 | false | 3.947108 | false | false | false |
matrix-org/synapse | tests/storage/test_devices.py | 1 | 5336 | # Copyright 2016-2021 The Matrix.org Foundation C.I.C.
#
# 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... | apache-2.0 | 3,141,021,267,772,333,600 | 34.573333 | 88 | 0.587706 | false | 3.723657 | true | false | false |
JQIamo/artiq | artiq/coredevice/comm_moninj.py | 1 | 2537 | import asyncio
import logging
import struct
from enum import Enum
__all__ = ["TTLProbe", "TTLOverride", "CommMonInj"]
logger = logging.getLogger(__name__)
class TTLProbe(Enum):
level = 0
oe = 1
class TTLOverride(Enum):
en = 0
level = 1
oe = 2
class CommMonInj:
def __init__(self, monito... | lgpl-3.0 | 838,825,745,491,158,500 | 29.202381 | 78 | 0.546709 | false | 4.125203 | false | false | false |
hzlf/openbroadcast.ch | app/media_embed/utils.py | 1 | 1679 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
try:
from urlparse import urlparse, parse_qs
except ImportError:
from urllib.parse import urlparse, parse_qs
EMBED_SERVICE_PROVIDERS = [
# Video
'Youtube',
'Vimeo',
# Audio
]
def process_provider_url(url, exclude_providers=[]):... | gpl-3.0 | 296,941,797,632,779,200 | 23.691176 | 87 | 0.57832 | false | 3.144195 | false | false | false |
prats226/python-amazon-product-api-0.2.8 | tests/utils.py | 1 | 2424 |
from lxml import objectify
import re
try: # make it python2.4/2.5 compatible!
from urlparse import urlparse, parse_qs
except ImportError: # pragma: no cover
from urlparse import urlparse
from cgi import parse_qs
def convert_camel_case(operation):
"""
Converts ``CamelCaseOperationName`` into ``pyt... | bsd-3-clause | 8,023,360,274,834,195,000 | 35.727273 | 82 | 0.636964 | false | 3.890851 | false | false | false |
imiyoo2010/mitmproxy | doc-src/index.py | 1 | 2510 | import os, sys, datetime
import countershape
from countershape import Page, Directory, PythonModule, markup, model
import countershape.template
sys.path.insert(0, "..")
from libmproxy import filt, version
MITMPROXY_SRC = os.environ.get("MITMPROXY_SRC", os.path.abspath(".."))
ns.VERSION = version.VERSION
if ns.options... | mit | -5,763,400,009,474,492,000 | 27.202247 | 95 | 0.627888 | false | 3.042424 | false | false | false |
e7dal/hexy | setup.py | 1 | 1766 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import imp
import os
import sys
try:
from setuptools import setup
except ImportError:
from distutils.core import setup
readme = open('readme.txt').read()
history = open('history.txt').read().replace('.. :changelog:', '')
curr_path = os.path.dirname(os.path.realpa... | gpl-3.0 | -8,694,179,322,663,520,000 | 25.757576 | 66 | 0.637599 | false | 3.510934 | false | false | false |
evernote/pootle | pootle/core/views.py | 1 | 13622 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright 2013 Zuza Software Foundation
# Copyright 2013-2014 Evernote Corporation
#
# This file is part of Pootle.
#
# Pootle 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 Softw... | gpl-2.0 | -2,622,846,277,347,944,000 | 35.132626 | 79 | 0.624284 | false | 4.161931 | false | false | false |
simonbr73/nyc-subway-finder | interfaces.py | 1 | 4396 | import sys
class TextInterface:
"""Text-based interface that contains methods for getting input from the user and displaying search
results.
"""
def __init__(self, trains_list):
"""Initializes the TextInterface object with a list of all train objects in the simulation.
"""
... | mit | -7,588,274,881,581,400,000 | 48.954545 | 132 | 0.613285 | false | 4.422535 | false | false | false |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.