repo_name
stringlengths
5
100
path
stringlengths
4
299
copies
stringclasses
990 values
size
stringlengths
4
7
content
stringlengths
666
1.03M
license
stringclasses
15 values
hash
int64
-9,223,351,895,964,839,000
9,223,297,778B
line_mean
float64
3.17
100
line_max
int64
7
1k
alpha_frac
float64
0.25
0.98
autogenerated
bool
1 class
mirrax/detekt
utils.py
7
1117
# Copyright (C) 2014 Claudio Guarnieri. # This file is part of Detekt - https://github.com/botherder/detekt # See the file 'LICENSE' for copying permission. import os import sys import ctypes def get_resource(relative): # First try from the local directory. This might come handy in case we want # to provide u...
gpl-3.0
-92,152,508,769,041,150
33.90625
79
0.710833
false
yuxiang-zhou/menpofit
menpofit/aps/base.py
2
39189
from __future__ import division import warnings import numpy as np from scipy.stats import multivariate_normal from menpo.base import name_of_callable from menpo.feature import no_op from menpo.visualize import print_dynamic, print_progress from menpo.model import GMRFModel from menpo.shape import (DirectedGraph, Undi...
bsd-3-clause
5,903,259,219,332,304,000
44.568605
91
0.574574
false
tartley/chronotank
pyweek12/items/greenery.py
1
1100
from random import uniform from .gameitem import GameItem class Greenery(GameItem): layer = 0 # ground level def __init__(self, **kwargs): GameItem.__init__(self, **kwargs) self.randomise_position() self.scale = uniform(0.5, 2) self.rot = uniform(0, 360) class Tree(Greenery):...
bsd-3-clause
-6,077,700,942,563,945,000
25.190476
51
0.576364
false
elastic/elasticsearch-py
elasticsearch/client/ingest.py
1
4784
# Licensed to Elasticsearch B.V. under one or more contributor # license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright # ownership. Elasticsearch B.V. licenses this file to you under # the Apache License, Version 2.0 (the "License"); you may # not use ...
apache-2.0
-3,785,051,299,342,336,500
35.8
119
0.63148
false
ericshawlinux/bitcoin
test/functional/test_framework/socks5.py
18
5690
#!/usr/bin/env python3 # Copyright (c) 2015-2018 The Bitcoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. """Dummy Socks5 server for testing.""" import socket import threading import queue import logging logger...
mit
-5,365,511,051,865,761,000
34.341615
125
0.568717
false
weidongxu84/info-gatherer
requests/__init__.py
62
1863
# -*- coding: utf-8 -*- # __ # /__) _ _ _ _ _/ _ # / ( (- (/ (/ (- _) / _) # / """ requests HTTP library ~~~~~~~~~~~~~~~~~~~~~ Requests is an HTTP library, written in Python, for human beings. Basic GET usage: >>> import requests >>> r = requests.get('http://python.org') >>> r.sta...
mit
-1,180,814,802,112,631,000
23.194805
77
0.633387
false
aimas/TuniErp-8.0
addons/base_report_designer/plugin/openerp_report_designer/bin/script/ConvertFieldsToBraces.py
384
2324
######################################################################### # # Copyright (c) 2003-2004 Danny Brewer d29583@groovegarden.com # Copyright (C) 2004-2010 OpenERP SA (<http://openerp.com>). # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser Gene...
agpl-3.0
2,366,842,133,310,494,000
35.888889
140
0.643287
false
WilliamXIII/cuda-convnet2
python_util/options.py
180
16577
# Copyright 2014 Google Inc. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or...
apache-2.0
9,221,196,492,296,737,000
39.629902
199
0.60041
false
skosukhin/spack
var/spack/repos/builtin/packages/r-affyrnadegradation/package.py
1
2026
############################################################################## # Copyright (c) 2013-2017, Lawrence Livermore National Security, LLC. # Produced at the Lawrence Livermore National Laboratory. # # This file is part of Spack. # Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved. # LLNL-CODE-64...
lgpl-2.1
1,627,322,466,103,891,700
47.238095
136
0.695459
false
praba230890/PYPOWER
doc/conf.py
2
6328
# -*- coding: utf-8 -*- # # PYPOWER documentation build configuration file, created by # sphinx-quickstart on Thu Jul 7 17:48:32 2011. # # This file is execfile()d with the current directory set to its containing dir. # # Note that not all possible configuration values are present in this # autogenerated file. # # All...
bsd-3-clause
-4,739,534,597,826,913,000
31.618557
80
0.71318
false
naitikshukla/drone
vanish_point/main.py
1
2937
from VanishingPoint import * import os import time def direction(img,xa,ya,xb,yb,width,height): #xa,ya,xb,yb=point[0],point[1],point[2],point[3] cenx = xa+(xb-xa)/2 ceny = ya+(yb-ya)/2 centerx=width/2 centery = height/2 timeout = time.time() + 5 #while True: #_,img = cam.read() print("image center are :", cen...
unlicense
-8,157,931,931,086,604,000
40.957143
146
0.672114
false
goliveirab/openacademy-project
openacademy/__openerp__.py
1
1205
# -*- coding: utf-8 -*- { 'name': "Open Academy", 'summary': """Manage trainings""", # 'description': """ # Open Academy module for managing trainings: # - training courses # - training sessions # - attendees registration 'author': "Vauxoo", 'website': "http://www.vauxoo.com", ...
gpl-3.0
-6,729,419,882,316,611,000
27.023256
65
0.6
false
angelapper/odoo
addons/sale_stock/sale_stock.py
2
16690
# -*- coding: utf-8 -*- # Part of Odoo. See LICENSE file for full copyright and licensing details. from datetime import datetime, timedelta from openerp import api, fields, models, _ from openerp.tools import DEFAULT_SERVER_DATETIME_FORMAT, float_compare from openerp.exceptions import UserError class SaleOrder(model...
agpl-3.0
-2,430,744,443,737,438,000
44.851648
197
0.615039
false
takinbo/rapidsms-borno
apps/django_extensions/management/commands/runjob.py
5
1965
from django.core.management.base import LabelCommand from optparse import make_option from extensions.management.jobs import get_job, print_jobs class Command(LabelCommand): option_list = LabelCommand.option_list + ( make_option('--list', '-l', action="store_true", dest="list_jobs", help="List ...
lgpl-3.0
7,866,365,602,317,169,000
36.09434
89
0.554198
false
blooparksystems/odoo
addons/account/wizard/account_report_aged_partner_balance.py
19
1759
# -*- coding: utf-8 -*- import time from datetime import datetime from dateutil.relativedelta import relativedelta from openerp import api, fields, models, _ from openerp.exceptions import UserError class AccountAgedTrialBalance(models.TransientModel): _name = 'account.aged.trial.balance' _inherit = 'accoun...
gpl-3.0
6,982,690,860,480,104,000
41.902439
135
0.610574
false
sander76/home-assistant
homeassistant/components/file/notify.py
14
1682
"""Support for file notification.""" import os import voluptuous as vol from homeassistant.components.notify import ( ATTR_TITLE, ATTR_TITLE_DEFAULT, PLATFORM_SCHEMA, BaseNotificationService, ) from homeassistant.const import CONF_FILENAME import homeassistant.helpers.config_validation as cv import ho...
apache-2.0
-1,410,086,745,274,282,000
30.735849
145
0.653389
false
xs2maverick/adhocracy3.mercator
src/adhocracy_core/adhocracy_core/catalog/test_index.py
2
8335
"""Test custom catalog index.""" from unittest.mock import Mock from pyramid import testing from pytest import fixture from pytest import raises class TestField: _marker = object() @fixture def inst(self): from hypatia.field import FieldIndex from BTrees import family64 def _dis...
agpl-3.0
-4,186,559,959,331,558,000
37.059361
75
0.631914
false
technomalogical/suds
suds/xsd/query.py
202
6451
# This program is free software; you can redistribute it and/or modify # it under the terms of the (LGPL) GNU Lesser General Public License as # published by the Free Software Foundation; either version 3 of the # License, or (at your option) any later version. # # This program is distributed in the hope that it will ...
lgpl-3.0
6,857,453,040,383,084,000
30.019231
82
0.597737
false
semio/zipline
tests/test_events_through_risk.py
17
11560
# # Copyright 2013 Quantopian, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in wr...
apache-2.0
3,534,194,253,956,963,300
32.604651
78
0.464533
false
x111ong/odoo
addons/account/wizard/account_report_common_partner.py
385
1999
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>). # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU...
agpl-3.0
4,673,984,808,248,800,000
41.531915
103
0.587794
false
wakatime/wakatime
wakatime/packages/py27/pygments/lexers/resource.py
4
2926
# -*- coding: utf-8 -*- """ pygments.lexers.resource ~~~~~~~~~~~~~~~~~~~~~~~~ Lexer for resource definition files. :copyright: Copyright 2006-2019 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. """ import re from pygments.lexer import RegexLexer, bygroups, words from ...
bsd-3-clause
-983,709,812,433,499,500
33.423529
83
0.454204
false
bakkou-badri/dataminingproject
env/lib/python2.7/site-packages/pip/_vendor/requests/packages/chardet/__init__.py
745
1295
######################## BEGIN LICENSE BLOCK ######################## # This library 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 2.1 of the License, or (at your option) any later ve...
gpl-2.0
-8,697,917,285,400,706,000
39.46875
73
0.667181
false
dennybaa/mistral
mistral/tests/unit/engine/test_default_engine.py
1
14261
# Copyright 2014 - Mirantis, Inc. # Copyright 2015 - StackStorm, 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 # # Unl...
apache-2.0
-835,089,913,474,946,300
31.264706
79
0.599257
false
alexus37/AugmentedRealityChess
pythonAnimations/pyOpenGLChess/engineDirectory/oglc-env/lib/python2.7/site-packages/OpenGLContext/scenegraph/text/wglfontprovider.py
2
1419
"""Win32 (win32ui and WGL)-specific font providers """ from OpenGLContext.scenegraph.text import fontprovider, wglfont class WGLOutlineFonts( fontprovider.FontProvider ): """Font provider for WGL outline (polygon) fonts""" format = "polygon" def get( self, fontStyle, mode=None ): """Get a WGLOutlin...
mit
-9,064,977,009,763,344,000
37.351351
63
0.687808
false
ntts-clo/ryu
ryu/services/protocols/vrrp/monitor_openflow.py
56
5444
# Copyright (C) 2013 Nippon Telegraph and Telephone Corporation. # Copyright (C) 2013 Isaku Yamahata <yamahata at private email ne jp> # # 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 # # h...
apache-2.0
-7,243,697,447,135,120,000
37.609929
77
0.614805
false
CAB-LAB/cablab-core
test/providers/test_precip.py
2
3183
import os import unittest from datetime import datetime from esdl import CubeConfig from esdl.providers.precip import PrecipProvider from test.providers.provider_test_utils import ProviderTestBase from esdl.util import Config SOURCE_DIR = Config.instance().get_cube_source_path('CPC_precip') class PrecipProviderTest...
gpl-3.0
-6,945,453,201,806,406,000
51.180328
116
0.576186
false
caveman-dick/ansible
test/units/contrib/inventory/test_vmware_inventory.py
97
3635
import json import os import pickle import unittest import sys from nose.plugins.skip import SkipTest try: from pyVmomi import vim, vmodl except ImportError: raise SkipTest("test_vmware_inventory.py requires the python module 'pyVmomi'") try: from vmware_inventory import VMWareInventory except ImportErro...
gpl-3.0
6,979,187,068,151,812,000
26.961538
92
0.606602
false
jaloren/robotframework
src/robot/utils/markuputils.py
6
1553
# Copyright 2008-2015 Nokia Networks # Copyright 2016- Robot Framework Foundation # # 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
6,813,510,430,547,371,000
30.693878
79
0.671603
false
bingwen/shadowsocks
shadowsocks/shell.py
652
12736
#!/usr/bin/python # -*- coding: utf-8 -*- # # Copyright 2015 clowwindy # # 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 b...
apache-2.0
6,240,553,214,209,779,000
33.797814
79
0.561558
false
sgraham/nope
tools/perf/measurements/smoothness.py
1
1618
# Copyright 2013 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. from metrics import power from measurements import smoothness_controller from telemetry.page import page_test class Smoothness(page_test.PageTest): def _...
bsd-3-clause
-851,813,271,949,169,200
34.173913
78
0.745365
false
gurneyalex/sale-workflow
__unported__/sale_exception_nostock/model/sale.py
2
6153
# -*- coding: utf-8 -*- # # # Author: Nicolas Bessi # Copyright 2013 Camptocamp SA # # 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 Foundation, either version 3 of the # License, o...
agpl-3.0
8,795,525,126,457,543,000
40.295302
85
0.599707
false
Gaia3D/QGIS
python/plugins/processing/algs/qgis/SelectByExpression.py
6
3247
# -*- coding: utf-8 -*- """ *************************************************************************** SelectByExpression.py --------------------- Date : July 2014 Copyright : (C) 2014 by Michaël Douchin ***********************************************************************...
gpl-2.0
-8,330,773,126,751,047,000
39.5875
89
0.595627
false
eXistenZNL/SickRage
lib/sqlalchemy/dialects/postgresql/pg8000.py
78
3930
# postgresql/pg8000.py # Copyright (C) 2005-2014 the SQLAlchemy authors and contributors <see AUTHORS file> # # This module is part of SQLAlchemy and is released under # the MIT License: http://www.opensource.org/licenses/mit-license.php """ .. dialect:: postgresql+pg8000 :name: pg8000 :dbapi: pg8000 :conn...
gpl-3.0
7,312,531,261,930,152,000
30.190476
95
0.618321
false
gnperumal/exscript
src/Exscript/parselib/Lexer.py
7
6515
# Copyright (C) 2007-2010 Samuel Abels. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License version 2, as # published by the Free Software Foundation. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANT...
gpl-2.0
-894,734,063,258,195,500
34.216216
78
0.55779
false
halostatue/ansible
lib/ansible/errors/__init__.py
163
7342
# (c) 2012-2014, Michael DeHaan <michael.dehaan@gmail.com> # # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) an...
gpl-3.0
6,540,647,268,067,615,000
38.686486
169
0.60188
false
zeroq/kraut_salad
kraut_parser/models.py
1
22668
# vim: tabstop=4 expandtab shiftwidth=4 softtabstop=4 from django.db import models # Create your models here. class Namespace(models.Model): namespace = models.CharField(max_length=255, default='nospace', unique=True) description = models.TextField(null=True, blank=True) def __unicode__(self): r...
gpl-2.0
-1,275,531,049,275,395,000
39.406417
152
0.694106
false
brinbois/Sick-Beard
sickbeard/clients/requests/packages/charade/chardistribution.py
184
9457
######################## BEGIN LICENSE BLOCK ######################## # The Original Code is Mozilla Communicator client code. # # The Initial Developer of the Original Code is # Netscape Communications Corporation. # Portions created by the Initial Developer are Copyright (C) 1998 # the Initial Developer. All Ri...
gpl-3.0
-8,882,159,249,927,501,000
38.939394
80
0.612351
false
cryptapus/electrum
electrum/gui/kivy/uix/dialogs/question.py
4
1357
from kivy.app import App from kivy.factory import Factory from kivy.properties import ObjectProperty from kivy.lang import Builder from kivy.uix.checkbox import CheckBox from kivy.uix.label import Label from kivy.uix.widget import Widget from electrum.gui.kivy.i18n import _ Builder.load_string(''' <Question@Popup> ...
mit
-7,318,117,972,954,094,000
24.603774
42
0.517318
false
liminspace/django-transtool
transtool/settings.py
1
2429
from django.conf import settings TRANSTOOL_DL_URL = getattr(settings, 'TRANSTOOL_DL_URL', None) # http://example.com/localemessages/export/ TRANSTOOL_DL_KEY = getattr(settings, 'TRANSTOOL_DL_KEY', None) # for import translates from remote server TRANSTOOL_EXPORT_KEY = getattr(settings, 'TRANSTOOL_EXPORT_KEY', None)...
mit
-1,934,229,339,753,476,000
35.80303
118
0.53767
false
ict-felix/stack
optin_manager/src/python/openflow/optin_manager/sfa/openflow_utils/SliverRSpecParser.py
4
5551
class GENIDatapath(): def __init__ (self, dom): super(GENIDatapath, self).__init__() self.component_id = None if dom.tag == u'{%s}datapath' % (OFNSv3): self.__parse_openflowv3_datapath(dom) def __parse_openflowv3_datapath (self, dom): self.component_id = dom.get("component_id") cmid = d...
apache-2.0
-8,244,497,485,908,663,000
26.894472
70
0.609079
false
Imaginashion/cloud-vision
.fr-d0BNfn/django-jquery-file-upload/venv/lib/python3.5/site-packages/django/core/management/commands/makemessages.py
9
25792
from __future__ import unicode_literals import fnmatch import glob import io import os import re import sys from functools import total_ordering from itertools import dropwhile import django from django.conf import settings from django.core.files.temp import NamedTemporaryFile from django.core.management.base import ...
mit
6,932,162,808,376,294,000
40.802269
108
0.56533
false
ministryofjustice/cla_public
cla_public/apps/base/views.py
1
7832
# coding: utf-8 """Base app views""" import os import logging import datetime import re from urlparse import urlparse, urljoin from flask import abort, current_app, jsonify, redirect, render_template, session, url_for, request, views from flask.ext.babel import lazy_gettext as _ import cla_public.apps.base.filters ...
mit
4,218,278,475,582,183,400
27.900369
106
0.662794
false
daymer/xWIKI_Karma
CustomModules/mysql-connector-python-2.1.7/tests/test_abstracts.py
1
10372
# MySQL Connector/Python - MySQL driver written in Python. # Copyright (c) 2014, 2017, Oracle and/or its affiliates. All rights reserved. # MySQL Connector/Python is licensed under the terms of the GPLv2 # <http://www.gnu.org/licenses/old-licenses/gpl-2.0.html>, like most # MySQL Connectors. There are special exceptio...
apache-2.0
1,020,804,953,634,811,500
34.520548
78
0.600752
false
synergeticsedx/deployment-wipro
common/djangoapps/enrollment/tests/test_api.py
16
12613
""" Tests for student enrollment. """ from mock import patch, Mock import ddt from nose.tools import raises import unittest from django.test.utils import override_settings from django.conf import settings from course_modes.models import CourseMode from enrollment import api from enrollment.errors import EnrollmentApi...
agpl-3.0
-4,654,896,459,475,660,000
44.207885
110
0.655356
false
captain-pool/GSOC
E3_Distill_ESRGAN/main.py
1
5562
""" Compressing GANs using Knowledge Distillation. Teacher GAN: ESRGAN (https://github.com/captain-pool/E2_ESRGAN) Citation: @article{DBLP:journals/corr/abs-1902-00159, author = {Angeline Aguinaldo and Ping{-}Yeh Chiang and Alexander Gain and Ameya Patil and Kolten Pearson and Soheil F...
mit
-6,999,093,766,841,937,000
34.653846
93
0.665408
false
pigeonflight/strider-plone
docker/appengine/lib/django-1.4/tests/runtests.py
25
12973
#!/usr/bin/env python import os import shutil import subprocess import sys import tempfile import warnings from django import contrib # databrowse is deprecated, but we still want to run its tests warnings.filterwarnings('ignore', "The Databrowse contrib app is deprecated", PendingDeprecationW...
mit
4,380,055,716,559,884,300
38.794479
89
0.643567
false
bharadwajyarlagadda/korona
tests/test_html_tags/test_col_tag.py
1
1308
# -*- coding: utf-8 -*- import pytest from ..fixtures import parametrize from korona.html.tags import Col from korona.templates.html.tags import col from korona.exceptions import TagAttributeError @parametrize('attributes', [ ({'align': 'char'}), ({'align': 'char', 'char': '.'}), ({'align': 'char', 'ch...
mit
-5,612,223,137,263,391,000
29.418605
76
0.623089
false
tlangerak/Multi-Agent-Systems
setup.py
1
1846
#!/usr/bin/env python import sys import subprocess from setuptools import setup, Extension from runspade import __version__ try: import bdist_mpkg except: # This is not a mac pass if sys.platform == "win32": ext = Extension("tlslite.utils.win32prng", sources=["tlslite/utils/win...
lgpl-2.1
-6,961,030,736,730,378,000
30.827586
137
0.650054
false
lmorchard/django
django/core/management/commands/makemigrations.py
38
12571
import os import sys from itertools import takewhile from django.apps import apps from django.core.management.base import BaseCommand, CommandError from django.db.migrations import Migration from django.db.migrations.autodetector import MigrationAutodetector from django.db.migrations.loader import MigrationLoader from...
bsd-3-clause
4,296,238,117,447,303,700
47.164751
107
0.569724
false
gabyx/GRSFramework
simulations/python/modules/GRSFTools/Transformations/Transformations.py
2
65541
# -*- coding: utf-8 -*- # transformations.py # Copyright (c) 2006-2014, Christoph Gohlke # Copyright (c) 2006-2014, The Regents of the University of California # Produced at the Laboratory for Fluorescence Dynamics # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modifi...
gpl-3.0
-3,979,252,910,334,151,000
33.296703
79
0.578706
false
nnethercote/servo
tests/wpt/web-platform-tests/webdriver/tests/perform_actions/pointer_origin.py
20
4728
import pytest from webdriver import MoveTargetOutOfBoundsException from tests.perform_actions.support.mouse import get_inview_center, get_viewport_rect from tests.support.inline import inline def origin_doc(inner_style, outer_style=""): return inline(""" <div id="outer" style="{1}" onmousemove=...
mpl-2.0
-6,885,200,440,282,387,000
35.651163
88
0.631768
false
rdipietro/tensorflow
tensorflow/contrib/labeled_tensor/python/ops/ops_test.py
8
33515
# Copyright 2016 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
apache-2.0
7,052,845,738,398,343,000
35.508715
80
0.625809
false
felix9064/python
Demo/liaoxf/listcompr.py
1
1180
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # 列表生成式 # 例1:使用列表生成式,将列表list1中的元素转小写,并过滤list1中的非字符串元素 # isinstance是Python内置函数,用于判断给定对象是否是给定的类型 list1 = ['Hello', 'World', 18, 'Apple', None] list2 = [s.lower() for s in list1 if isinstance(s, str)] print(list2) if list2 == ['hello', 'world', 'apple']: print('测试通过!'...
mit
-662,445,941,364,999,000
21.777778
56
0.629268
false
seem-sky/kbengine
kbe/src/lib/python/Lib/idlelib/SearchEngine.py
70
7483
'''Define SearchEngine for search dialogs.''' import re from tkinter import StringVar, BooleanVar, TclError import tkinter.messagebox as tkMessageBox def get(root): '''Return the singleton SearchEngine instance for the process. The single SearchEngine saves settings between dialog instances. If there is n...
lgpl-3.0
-2,135,270,445,634,713,900
31.11588
81
0.544033
false
wbond/asn1crypto
tests/test_csr.py
2
5871
# coding: utf-8 from __future__ import unicode_literals, division, absolute_import, print_function import unittest import sys import os from asn1crypto import csr, util from ._unittest_compat import patch patch() if sys.version_info < (3,): byte_cls = str num_cls = long # noqa else: byte_cls = bytes ...
mit
-6,016,298,370,284,586,000
40.638298
638
0.540964
false
ran5515/DeepDecision
tensorflow/python/training/sync_replicas_optimizer_test.py
32
11519
# Copyright 2016 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
apache-2.0
4,465,202,225,908,558,000
39.992883
80
0.648233
false
specialkevin/ansible-modules-core
cloud/openstack/os_security_group.py
109
4265
#!/usr/bin/python # Copyright (c) 2015 Hewlett-Packard Development Company, L.P. # Copyright (c) 2013, Benno Joy <benno@ansible.com> # # This module 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 vers...
gpl-3.0
3,417,804,819,880,572,400
29.035211
76
0.651817
false
qwang2505/ssdb-source-comments
deps/cpy/engine.py
26
13165
# encoding=utf-8 ################################# # Author: ideawu # Link: http://www.ideawu.net/ ################################# import sys, os, shutil, datetime import antlr3 import antlr3.tree from ExprLexer import ExprLexer from ExprParser import ExprParser class CpyEngine: found_files = set() def find_impo...
bsd-3-clause
-8,904,156,343,875,195,000
24.563107
133
0.59643
false
NetApp/manila
manila/tests/test_service.py
3
7809
# Copyright 2010 United States Government as represented by the # Administrator of the National Aeronautics and Space Administration. # Copyright 2014 NetApp, Inc. # Copyright 2014 Mirantis, Inc. # # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this fi...
apache-2.0
-3,938,647,901,109,875,700
33.25
78
0.637982
false
epiqc/ScaffCC
llvm/utils/lit/lit/display.py
2
4265
import sys def create_display(opts, tests, total_tests, workers): if opts.quiet: return NopDisplay() of_total = (' of %d' % total_tests) if (tests != total_tests) else '' header = '-- Testing: %d%s tests, %d workers --' % (tests, of_total, workers) progress_bar = None if opts.succinct an...
bsd-2-clause
3,398,426,295,815,507,500
36.086957
81
0.539977
false
MTgeophysics/mtpy
tests/modeling/__init__.py
1
2712
from __future__ import print_function import shutil from difflib import unified_diff import matplotlib import os import sys from matplotlib import pyplot as plt if os.name == "posix" and 'DISPLAY' not in os.environ: print("MATPLOTLIB: No Display found, using non-interactive svg backend", file=sys.stderr) m...
gpl-3.0
1,075,386,875,599,164,000
26.393939
102
0.595133
false
xujun10110/sleepy-puppy-1
sleepypuppy/admin/capture/models.py
13
2480
# Copyright 2015 Netflix, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law...
apache-2.0
7,668,531,054,894,879,000
37.153846
78
0.664919
false
tcstewar/parser
leftright.py
1
3272
D = 512 from vocab import Vocabulary input_sentence = 'the dog ran'.split() rules = [ ('S', ['NP', 'VP']), ('VP', ['V']), ('NP', ['DET', 'N']), ] words = { 'N': 'man dog'.split(), 'DET': 'a the'.split(), 'V': 'ran saw'.split(), } def label_word(s): best = None for w in wo...
gpl-2.0
5,325,138,085,325,458,000
22.710145
100
0.415954
false
jpirko/lnst
lnst/Tests/TestPMD.py
1
1828
import logging import subprocess import signal from lnst.Common.Parameters import Param, StrParam, IntParam, FloatParam from lnst.Common.Parameters import IpParam, DeviceOrIpParam from lnst.Tests.BaseTestModule import BaseTestModule, TestModuleError class TestPMD(BaseTestModule): coremask = StrParam(mandatory=True...
gpl-2.0
-7,429,401,039,665,024,000
33.490566
73
0.576039
false
google-code/ampatu
languages/pl.py
2
6724
# coding: utf8 { '"update" is an optional expression like "field1=\'newvalue\'". You cannot update or delete the results of a JOIN': '"Uaktualnij" jest dodatkowym wyrażeniem postaci "pole1=\'nowawartość\'". Nie możesz uaktualnić lub usunąć wyników z JOIN:', '%Y-%m-%d': '%Y-%m-%d', '%Y-%m-%d %H:%M:%S': '%Y-%m-%d %H:%M:%...
agpl-3.0
2,447,669,115,701,650,000
40.798742
280
0.695305
false
dominjune/LeetCode
062 Minimum Path Sum.py
3
1179
""" Given a m x n grid filled with non-negative numbers, find a path from top left to bottom right which minimizes the sum of all numbers along its path. Note: You can only move either down or right at any point in time. """ __author__ = 'Danyang' class Solution: def minPathSum(self, grid): """ ...
mit
2,874,395,531,195,848,700
29.078947
118
0.465649
false
lmazuel/ansible
lib/ansible/modules/network/openswitch/ops_config.py
43
10660
#!/usr/bin/python # # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # Ansible is distribut...
gpl-3.0
-97,112,687,042,800,720
32.84127
81
0.650657
false
henridwyer/scikit-learn
examples/calibration/plot_calibration.py
225
4795
""" ====================================== Probability calibration of classifiers ====================================== When performing classification you often want to predict not only the class label, but also the associated probability. This probability gives you some kind of confidence on the prediction. However,...
bsd-3-clause
9,085,858,049,595,880,000
40.336207
80
0.708238
false
olorz/scrapy
tests/test_downloadermiddleware_redirect.py
25
10022
import unittest from scrapy.downloadermiddlewares.redirect import RedirectMiddleware, MetaRefreshMiddleware from scrapy.spiders import Spider from scrapy.exceptions import IgnoreRequest from scrapy.http import Request, Response, HtmlResponse from scrapy.utils.test import get_crawler class RedirectMiddlewareTest(unit...
bsd-3-clause
6,977,059,204,828,061,000
43.741071
121
0.639792
false
NaturalGIS/naturalgis_qgis
python/plugins/processing/algs/grass7/ext/v_in_geonames.py
45
1246
# -*- coding: utf-8 -*- """ *************************************************************************** v_in_geonames.py ---------------- Date : March 2016 Copyright : (C) 2016 by Médéric Ribreux Email : medspx at medspx dot fr *****************************...
gpl-2.0
3,610,404,830,856,218,600
40.333333
75
0.415323
false
achang97/YouTunes
lib/python2.7/site-packages/flask/blueprints.py
169
16872
# -*- coding: utf-8 -*- """ flask.blueprints ~~~~~~~~~~~~~~~~ Blueprints are the recommended way to implement larger or more pluggable applications in Flask 0.7 and later. :copyright: (c) 2015 by Armin Ronacher. :license: BSD, see LICENSE for more details. """ from functools import update_wrap...
mit
-2,433,299,307,207,127,600
39.8523
85
0.623578
false
alberthdev/pyradmon
pyradmon/wrapper.py
1
17646
#!/usr/bin/env python # PyRadmon - Python Radiance Monitoring Tool # Copyright 2014 Albert Huang. # # 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/LICENS...
apache-2.0
943,625,895,518,542,700
43.560606
180
0.517851
false
piMoll/SEILAPLAN
lib/reportlab/graphics/barcode/usps4s.py
2
15593
#copyright ReportLab Inc. 2000-2016 #see license.txt for license details from __future__ import print_function __version__='3.3.0' __all__ = ('USPS_4State',) from reportlab.lib.colors import black from reportlab.graphics.barcode.common import Barcode from reportlab.lib.utils import asNative def nhex(i): 'normaliz...
gpl-2.0
9,162,777,595,492,412,000
33.045852
110
0.502661
false
rabipanda/tensorflow
tensorflow/contrib/opt/python/training/moving_average_optimizer_test.py
13
6633
# Copyright 2016 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
apache-2.0
-6,168,777,527,841,238,000
42.638158
80
0.638474
false
vrtadmin/clamav-devel
win32/3rdparty/libxml2/python/libxml2class.py
1
321365
# # Functions from module HTMLparser # def htmlCreateMemoryParserCtxt(buffer, size): """Create a parser context for an HTML in-memory document. """ ret = libxml2mod.htmlCreateMemoryParserCtxt(buffer, size) if ret is None:raise parserError('htmlCreateMemoryParserCtxt() failed') return parserCtxt(_obj=re...
gpl-2.0
-4,296,511,903,998,805,000
36.652607
110
0.661407
false
mrquim/mrquimrepo
script.video.F4mProxy/lib/flvlib/helpers.py
95
5650
import os import time import datetime from StringIO import StringIO from UserDict import DictMixin class UTC(datetime.tzinfo): """ A UTC tzinfo class, based on http://docs.python.org/library/datetime.html#datetime.tzinfo """ ZERO = datetime.timedelta(0) def utcoffset(self, dt): retu...
gpl-2.0
2,414,170,917,274,891,000
26.560976
74
0.540531
false
andrewyoung1991/abjad
abjad/tools/mathtools/yield_all_partitions_of_integer.py
2
1024
# -*- encoding: utf-8 -*- def yield_all_partitions_of_integer(n): r'''Yields all partitions of positive integer `n` in descending lex order: :: >>> for partition in mathtools.yield_all_partitions_of_integer(7): ... partition ... (7,) (6, 1) (5, 2) ...
gpl-3.0
-8,626,072,702,539,733,000
23.404762
78
0.491211
false
MadcowD/libgdx
extensions/gdx-freetype/jni/freetype-2.6.2/src/tools/docmaker/docmaker.py
165
3183
#!/usr/bin/env python # # docmaker.py # # Convert source code markup to HTML documentation. # # Copyright 2002-2015 by # David Turner. # # This file is part of the FreeType project, and may only be used, # modified, and distributed under the terms of the FreeType project # license, LICENSE.TXT. By continuing ...
apache-2.0
-4,911,349,984,883,354,000
26.678261
78
0.598806
false
adamklawonn/CityCircles
citycircles_iphone/build_back2/iphoneDistribution-iphonesimulator/CityCircles.app/globalmaptiles.py
28
16529
#!/usr/bin/env python ############################################################################### # $Id$ # # Project: GDAL2Tiles, Google Summer of Code 2007 & 2008 # Global Map Tiles Classes # Purpose: Convert a raster into TMS tiles, create KML SuperOverlay EPSG:4326, # generate a simple HTML viewers b...
gpl-3.0
4,539,766,909,753,469,400
36.565909
103
0.651885
false
jemekite/Dougpool
p2pool/util/forest.py
281
13557
''' forest data structure ''' import itertools from p2pool.util import skiplist, variable class TrackerSkipList(skiplist.SkipList): def __init__(self, tracker): skiplist.SkipList.__init__(self) self.tracker = tracker self.tracker.removed.watch_weakref(self, lambda self, item: se...
gpl-3.0
7,869,740,568,131,649,000
36.554017
148
0.570111
false
LaoZhongGu/kbengine
kbe/src/lib/python/Doc/includes/sqlite3/converter_point.py
55
1192
import sqlite3 class Point: def __init__(self, x, y): self.x, self.y = x, y def __repr__(self): return "(%f;%f)" % (self.x, self.y) def adapt_point(point): return ("%f;%f" % (point.x, point.y)).encode('ascii') def convert_point(s): x, y = list(map(float, s.split(b";"))) return Po...
lgpl-3.0
6,014,666,581,416,291,000
24.361702
71
0.627517
false
shsingh/ansible
lib/ansible/modules/network/fortios/fortios_wanopt_settings.py
7
9324
#!/usr/bin/python from __future__ import (absolute_import, division, print_function) # Copyright 2019 Fortinet, Inc. # # 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 Lic...
gpl-3.0
3,316,394,870,010,205,700
29.174757
100
0.611111
false
jamesbeebop/CouchPotatoServer
couchpotato/core/media/__init__.py
22
3818
import os import traceback from couchpotato import CPLog, md5 from couchpotato.core.event import addEvent, fireEvent, fireEventAsync from couchpotato.core.helpers.encoding import toUnicode from couchpotato.core.helpers.variable import getExt from couchpotato.core.plugins.base import Plugin import six log = CPLog(__n...
gpl-3.0
-5,080,134,210,826,524,000
32.2
208
0.560241
false
shastah/spacewalk
client/debian/packages-already-in-debian/rhn-client-tools/src/firstboot/rhn_choose_server_gui.py
17
3410
# Copyright 2006--2010 Red Hat, Inc. # # 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; version 2 of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT...
gpl-2.0
7,460,146,785,320,472,000
34.894737
101
0.66217
false
c-a/jhbuild
jhbuild/utils/sxml.py
8
2925
# jhbuild - a tool to ease building collections of source packages # Copyright (C) 2008 Andy Wingo <wingo@pobox.com> # # sxml.py: xml as s-expressions # # 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 Fo...
gpl-2.0
5,471,661,655,492,994,000
31.142857
78
0.574017
false
ahu-odoo/odoo
addons/account_payment/account_move_line.py
66
2705
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>). # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU...
agpl-3.0
-5,261,028,477,442,489,000
43.344262
102
0.586322
false
psdh/servo
tests/wpt/css-tests/tools/webdriver/webdriver/keys.py
263
1481
"""Constants for special keys.""" class Keys: """Constants for special keys.""" NULL = '\uE000' CANCEL = '\uE001' HELP = '\uE002' BACK_SPACE = '\uE003' TAB = '\uE004' CLEAR = '\uE005' RETURN = '\uE006' ENTER = '\uE007' SHIFT = '\uE008' LEFT_SHIFT = '\uE008' CONTROL = '\u...
mpl-2.0
6,335,922,108,943,702,000
20.779412
37
0.496962
false
dfalt974/SickRage
sickbeard/notifiers/emby.py
2
4219
# coding=utf-8 # Author: Nic Wolfe <nic@wolfeden.ca> # URL: https://sickchill.github.io # # This file is part of SickChill. # # SickChill 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 th...
gpl-3.0
-497,845,302,309,986,100
33.867769
107
0.578099
false
pymedusa/Medusa
medusa/clients/torrent/mlnet.py
2
1427
# coding=utf-8 """MLDonkey Client.""" from __future__ import unicode_literals from medusa.clients.torrent.generic import GenericClient class MLNetAPI(GenericClient): """MLDonkey API class.""" def __init__(self, host=None, username=None, password=None): """Constructor. :param host: ...
gpl-3.0
-5,863,651,785,112,739,000
25.425926
75
0.591451
false
leighpauls/k2cro4
third_party/python_26/Lib/site-packages/win32/lib/win32pdhutil.py
21
7360
"""Utilities for the win32 Performance Data Helper module Example: To get a single bit of data: >>> import win32pdhutil >>> win32pdhutil.GetPerformanceAttributes("Memory", "Available Bytes") 6053888 >>> win32pdhutil.FindPerformanceAttributesByName("python", counter="Virtual Bytes") [22278144] First exam...
bsd-3-clause
5,215,055,931,160,196,000
44.714286
133
0.622283
false
tencentyun/Cloud-Image-Migration-Tool
usr/lib/oss2/api.py
4
40750
# -*- coding: utf-8 -*- """ 文件上传方法中的data参数 ------------------------ 诸如 :func:`put_object <Bucket.put_object>` 这样的上传接口都会有 `data` 参数用于接收用户数据。`data` 可以是下述类型 - unicode类型(对于Python3则是str类型):内部会自动转换为UTF-8的bytes - bytes类型:不做任何转换 - file-like object:对于可以seek和tell的file object,从当前位置读取直到结束。其他类型,请确保当前位置是文件开始。 - 可迭代类...
mit
6,413,274,730,763,566,000
35.086407
164
0.608363
false
ehashman/oh-mainline
mysite/customs/migrations/0013_fix_fieldname_in_bugzillaurl.py
16
4442
# This file is part of OpenHatch. # Copyright (C) 2010 Jack Grigg # # 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 Foundation, either version 3 of the License, or # (at your option) any later versio...
agpl-3.0
5,629,775,740,670,802,000
53.170732
141
0.5914
false
defionscode/ansible
lib/ansible/plugins/callback/splunk.py
54
8017
# -*- coding: utf-8 -*- # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # Ansible is distr...
gpl-3.0
-6,767,110,897,375,277,000
34.162281
117
0.601721
false
ConanChou/hyde
hydeengine/templatetags/hydetags.py
35
13384
from datetime import datetime import operator import os import re import string from django import template from django.conf import settings from django.template import Template from django.template.loader import render_to_string from django.template.defaultfilters import truncatewords_html, stringfilter from django.t...
mit
8,405,919,920,268,283,000
29.21219
144
0.61723
false
mgr0dzicki/python-neo
neo/core/baseneo.py
6
14948
# -*- coding: utf-8 -*- """ This module defines :class:`BaseNeo`, the abstract base class used by all :module:`neo.core` classes. """ # needed for python 3 compatibility from __future__ import absolute_import, division, print_function from datetime import datetime, date, time, timedelta from decimal import Decimal im...
bsd-3-clause
6,946,124,575,454,383,000
37.132653
79
0.585229
false
cosmo-ethz/hope
hope/config.py
1
1137
# Copyright (c) 2013 ETH Zurich, Institute of Astronomy, Lukas Gamper <lukas.gamper@usystems.ch> from __future__ import print_function, division, absolute_import, unicode_literals from hope.options import get_cxxflags # Additional compiler flags, formated as array of strings cxxflags = get_cxxflags() """ List of c...
gpl-3.0
8,121,799,364,199,967,000
23.191489
100
0.744063
false
albertjan/pypyjs-presentation
assets/js/pypy.js-0.3.1/lib/modules/distutils/dist.py
175
50049
"""distutils.dist Provides the Distribution class, which represents the module distribution being built/installed/distributed. """ __revision__ = "$Id$" import sys, os, re from email import message_from_file try: import warnings except ImportError: warnings = None from distutils.errors import (DistutilsOpt...
unlicense
-531,143,821,923,532,160
39.071257
82
0.58205
false
blakfeld/ansible-modules-extras
cloud/amazon/ec2_eni.py
10
14272
#!/usr/bin/python # # This is a free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # This Ansible library is distributed in the hope that i...
gpl-3.0
-5,543,316,964,124,408,000
34.152709
237
0.616942
false
joshuajan/odoo
addons/product/_common.py
111
1418
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>). # # This program is free software: you can redistribute it and/or modify # it under the terms of the...
agpl-3.0
-1,702,633,321,231,476,500
39.514286
96
0.631876
false
ewiseblatt/spinnaker
unittest/buildtool/test_util.py
2
6983
# Copyright 2017 Google Inc. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or a...
apache-2.0
-611,340,285,271,689,100
31.03211
80
0.667335
false