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
PeterDing/iScript
yunpan.360.cn.py
19
12433
#!/usr/bin/env python2 # vim: set fileencoding=utf8 import os import sys from getpass import getpass import requests import urllib import json import re import time import argparse import random import md5 ############################################################ # wget exit status wget_es = { 0: "No problems ...
mit
-4,240,932,632,581,664,300
33.898017
105
0.43372
false
davidhawkes11/p3w
p3w_05.0c.4Challenge.py
1
1649
# Code to instruct the computer to generate two user's dice roll values and display output to the screen. # Input: number, an integer variable # Output: a vertical list of randomly generated integers in the range specified. # The above text is commentary. The actual program starts below: import random # provide...
mit
-3,794,815,842,472,704,000
69.695652
161
0.651304
false
tximikel/kuma
vendor/packages/logilab/astng/exceptions.py
27
1650
# copyright 2003-2013 LOGILAB S.A. (Paris, FRANCE), all rights reserved. # contact http://www.logilab.fr/ -- mailto:contact@logilab.fr # # This file is part of logilab-astng. # # logilab-astng is free software: you can redistribute it and/or modify it # under the terms of the GNU Lesser General Public License as publis...
mpl-2.0
-2,396,427,453,522,839,600
34.869565
80
0.744848
false
msdubov/AST-text-analysis
east/asts/utils.py
2
1163
# -*- coding: utf-8 -* from east import consts def index(array, key, start=0): # NOTE(msdubov): No boundary check for optimization purposes. i = start while array[i] != key: i += 1 return i def match_strings(str1, str2): """ Returns the largest index i such that str1[:i] == str2[:i]...
mit
8,005,668,802,128,824,000
28.075
79
0.625107
false
lbjay/cds-invenio
modules/websubmit/lib/functions/Register_Referee_Decision.py
4
9034
## This file is part of CDS Invenio. ## Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007, 2008 CERN. ## ## CDS Invenio 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 (...
gpl-2.0
6,273,746,189,295,884,000
46.798942
80
0.62453
false
IsaacShelton/Adept
include/TOKEN/generate_c.py
1
24522
#!/usr/bin/python3 # Rather than explicitly write out the values for each token by hand, # This file takes care of the dirty work of manually maintaining token # IDs so that we can add/remove tokens more easily # This file takes care of automatically sorting and positioning # tokens in the correct order # In order t...
gpl-3.0
5,913,292,281,407,786,000
73.309091
143
0.522551
false
fragarco/pybomber
src/gamelib/sprites.py
1
3207
import pygame from .viewer import Viewer from .loader import Loader class Base(pygame.sprite.Sprite): images = {} def __init__(self): pygame.sprite.Sprite.__init__(self) def init(self, type): if not Base.images: Base.images = { "WHITE" : Loader.load_pixmap("assets/sprites/base0.png"), "YELLOW" : L...
mit
852,549,370,400,402,800
25.286885
63
0.676021
false
aneeshusa/android-quill
jni/libhpdf-2.3.0RC2/if/python/demo/text_demo.py
32
10572
### ## * << Haru Free PDF Library 2.0.0 >> -- text_demo.c ## * ## * Copyright (c) 1999-2006 Takeshi Kanno <takeshi_kanno@est.hi-ho.ne.jp> ## * ## * Permission to use, copy, modify, distribute and sell this software ## * and its documentation for any purpose is hereby granted without fee, ## * provided that the a...
gpl-3.0
-3,548,780,120,261,908,000
27.536313
80
0.594684
false
erwindl0/python-rpc
org.eclipse.triquetrum.python.service/scripts/scisoftpy/python/pybeans.py
1
7553
### # Copyright 2011 Diamond Light Source Ltd. # # 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...
epl-1.0
5,749,104,793,271,898,000
37.340102
115
0.625976
false
chienlieu2017/it_management
odoo/odoo/addons/base/ir/ir_cron.py
5
13870
# -*- coding: utf-8 -*- # Part of Odoo. See LICENSE file for full copyright and licensing details. import logging import threading import time import psycopg2 import pytz from datetime import datetime from dateutil.relativedelta import relativedelta import odoo from odoo import api, fields, models, _ from odoo.excepti...
gpl-3.0
-3,715,529,722,295,534,000
46.010169
171
0.569513
false
dreamsxin/kbengine
kbe/res/scripts/common/Lib/site-packages/pip/vcs/__init__.py
536
8748
"""Handles all VCS (version control) support""" import os import shutil from pip.backwardcompat import urlparse, urllib from pip.log import logger from pip.util import (display_path, backup_dir, find_command, rmtree, ask_path_exists) __all__ = ['vcs', 'get_src_requirement'] class VcsSupport(...
lgpl-3.0
6,281,140,042,877,144,000
33.85259
146
0.544467
false
coxmediagroup/googleads-python-lib
examples/dfp/v201411/network_service/make_test_network.py
4
1901
#!/usr/bin/python # # 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 b...
apache-2.0
4,132,893,128,688,990,000
34.867925
79
0.728564
false
MalloyPower/parsing-python
front-end/testsuite-python-lib/Python-2.3/Lib/encodings/iso8859_10.py
15
3900
""" Python Character Mapping Codec generated from '8859-10.TXT' with gencodec.py. Written by Marc-Andre Lemburg (mal@lemburg.com). (c) Copyright CNRI, All Rights Reserved. NO WARRANTY. (c) Copyright 2000 Guido van Rossum. """#" import codecs ### Codec APIs class Codec(codecs.Codec): def encode(self,input,err...
mit
2,682,268,394,744,111,600
42.333333
81
0.631538
false
Clean-Cole/pysftp
tests/test_chmod.py
1
1145
'''test pysftp.Connection.chmod - uses py.test''' from __future__ import print_function # pylint: disable = W0142 # pylint: disable=E1101 from common import * import pytest def test_chmod_not_exist(psftp): '''verify error if trying to chmod something that isn't there''' with pytest.raises(IOError): p...
bsd-3-clause
7,216,568,938,606,136,000
29.945946
68
0.658515
false
azumimuo/family-xbmc-addon
script.module.simple.downloader/lib/SimpleDownloader.py
8
32985
''' Simple Downloader plugin for XBMC Copyright (C) 2010-2011 Tobias Ussing And Henrik Mosgaard Jensen 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-2.0
-3,541,755,622,672,338,400
36.826835
165
0.491557
false
salguarnieri/intellij-community
python/helpers/pep8.py
63
81919
#!/usr/bin/env python # pep8.py - Check Python source code formatting, according to PEP 8 # Copyright (C) 2006-2009 Johann C. Rocholl <johann@rocholl.net> # Copyright (C) 2009-2014 Florent Xicluna <florent.xicluna@gmail.com> # Copyright (C) 2014 Ian Lee <ianlee1521@gmail.com> # # Permission is hereby granted, free of c...
apache-2.0
6,547,109,208,954,451,000
37.641038
79
0.562031
false
mbauskar/tele-frappe
frappe/modules/import_file.py
13
3318
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors # MIT License. See license.txt from __future__ import unicode_literals import frappe, os, json from frappe.modules import get_module_path, scrub_dt_dn from frappe.utils import get_datetime_str def import_files(module, dt=None, dn=None, force=False)...
mit
7,824,837,747,654,577,000
26.196721
94
0.67601
false
lino-framework/xl
lino_xl/lib/addresses/__init__.py
1
1343
# Copyright 2014-2019 Rumma & Ko Ltd # License: GNU Affero General Public License v3 (see file COPYING for details) """See :doc:`/specs/addresses`. .. autosummary:: :toctree: choicelists Some unit test cases are :mod:`lino.projects.min2.tests.test_addresses`. """ from lino.api import ad, _ class Plugin(...
bsd-2-clause
6,916,487,879,173,286,000
29.522727
78
0.664929
false
brianmay/spud
spud/serializers.py
1
33434
# spud - keep track of photos # Copyright (C) 2008-2013 Brian May # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # ...
gpl-3.0
4,305,767,333,027,140,600
33.827083
96
0.597655
false
airbnb/airflow
tests/ti_deps/deps/test_task_concurrency.py
7
2409
# # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not...
apache-2.0
-8,547,468,823,672,152,000
44.45283
85
0.721461
false
remh/dd-agent
checks.d/postgres.py
12
25223
"""PostgreSQL check Collects database-wide metrics and optionally per-relation metrics, custom metrics. """ # stdlib import socket # 3rd party import pg8000 as pg from pg8000 import InterfaceError, ProgrammingError # project from checks import AgentCheck, CheckException from config import _is_affirmative MAX_CUSTOM...
bsd-3-clause
-2,533,867,234,548,043,000
38.227061
217
0.546961
false
davidcoallier/blaze
blaze/table.py
2
15758
""" The toplevel modules containing the core Blaze datastructures. * Indexable * NDArray * NDTable * Table * Array """ import numpy as np from operator import eq from blaze.sources.descriptors.byteprovider import ByteProvider from idx import Space, Subspace, Index from datashape import DataShape...
bsd-2-clause
2,002,034,285,826,313,700
26.890265
78
0.520688
false
littlecodersh/itchatmp
itchatmp/controllers/mpapi/mp/utils.py
1
3776
import logging, io from tornado import gen from ..requests import requests from itchatmp.utils import retry, encode_send_dict from itchatmp.config import SERVER_URL, COROUTINE from itchatmp.returnvalues import ReturnValue logger = logging.getLogger('itchatmp') def create_qrcode(sceneData, expire=2592000, a...
mit
6,195,781,055,102,972,000
37.747368
81
0.574682
false
the-blue-alliance/the-blue-alliance
helpers/validation_helper.py
4
5159
from consts.district_type import DistrictType from models.district import District from models.event import Event from models.match import Match from models.team import Team import tba_config class ValidationHelper(object): """ A collection of methods to validate model ids and return standard error messag...
mit
-4,771,333,836,746,863,000
37.789474
166
0.581314
false
Passtechsoft/TPEAlpGen
blender/release/scripts/startup/bl_ui/space_view3d.py
1
118093
# ##### BEGIN GPL LICENSE BLOCK ##### # # 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. # # This program is distrib...
gpl-3.0
4,179,410,442,456,628,000
31.87667
162
0.611332
false
rgom/Pydev
plugins/org.python.pydev/pysrc/_pydev_filesystem_encoding.py
54
1104
def __getfilesystemencoding(): ''' Note: there's a copy of this method in interpreterInfo.py ''' import sys try: ret = sys.getfilesystemencoding() if not ret: raise RuntimeError('Unable to get encoding.') return ret except: try: #Handle Jyt...
epl-1.0
8,441,490,137,031,601,000
27.307692
110
0.51721
false
pfschwartz/openelisglobal-core
liquibase/OE2.9/testCatalogHT_Clinical/scripts/testEntry.py
18
2934
#!/usr/bin/env python # -*- coding: utf-8 -*- test_names = [] test_sections = [] sample_types = [] descriptions = [] print_names = [] old_sort = [] uom = [] hand_edit = ['PaCO2','HCO3'] name_file = open('testName.txt','r') test_section_file = open("testSections.txt",'r') sample_type_file = open("sampleT...
mpl-2.0
3,495,766,534,547,621,000
31.363636
172
0.571575
false
emin63/eyap
eyap/core/github_comments.py
1
23057
"""Module for working comments from GitHub backend. """ import datetime import doctest import time import collections import re import json import logging import zipfile import base64 import requests from eyap.core import comments, yap_exceptions def fake_markdown(text, *args, **kw): "Fake markdown" _dummy...
bsd-3-clause
5,124,036,129,992,967,000
37.428333
79
0.532853
false
kangkot/arangodb
3rdParty/V8-4.3.61/third_party/python_26/Lib/ctypes/test/test_struct_fields.py
68
1507
import unittest from ctypes import * class StructFieldsTestCase(unittest.TestCase): # Structure/Union classes must get 'finalized' sooner or # later, when one of these things happen: # # 1. _fields_ is set. # 2. An instance is created. # 3. The type is used as field of another Structure/Union. ...
apache-2.0
3,312,128,138,499,278,000
29.14
71
0.568016
false
seguijoaquin/taller2-appserver
Appserver/Test/ApiUnitTesting/AppServerApiUnitTests.py
1
4429
import json import requests import unittest import Utilities from testLogin import * from testChat import * from testBusquedaCandidatos import * from testPerfil import * # Precondiciones: # - La base de datos del servidor no debe contener usuarios. # - El servidor debe cumplir las especificaciones de la api.# # - La...
mit
897,733,116,277,113,100
36.218487
231
0.759314
false
jambolo/bitcoin
test/functional/example_test.py
7
8891
#!/usr/bin/env python3 # Copyright (c) 2017-2019 The Bitcoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. """An example functional test The module-level docstring should include a high-level description of what ...
mit
9,174,389,819,365,245,000
40.162037
125
0.670903
false
jeasoft/odoo
addons/website_crm/controllers/main.py
250
5499
# -*- coding: utf-8 -*- import base64 import werkzeug import werkzeug.urls from openerp import http, SUPERUSER_ID from openerp.http import request from openerp.tools.translate import _ class contactus(http.Controller): def generate_google_map_url(self, street, city, city_zip, country_name): url = "http...
agpl-3.0
-1,736,933,458,499,993,600
48.990909
168
0.611929
false
nirmeshk/oh-mainline
vendor/packages/Django/tests/regressiontests/generic_views/list.py
41
9756
from __future__ import absolute_import from django.core.exceptions import ImproperlyConfigured from django.test import TestCase from django.test.utils import override_settings from django.views.generic.base import View from django.utils.encoding import force_str from .models import Author, Artist class ListViewTest...
agpl-3.0
-7,105,456,365,896,759,000
48.025126
92
0.663182
false
Jeebeevee/DouweBot_JJ15
plugins_org/oblique.py
23
1509
import time from util import hook, http commands_modtime = 0 commands = {} def update_commands(force=False): global commands_modtime, commands if force or time.time() - commands_modtime > 60 * 60: # update hourly h = http.get_html('http://wiki.github.com/nslater/oblique/') lines = h.xpat...
unlicense
1,656,988,888,216,164,400
24.15
74
0.553347
false
johnw424/airflow
airflow/example_dags/example_http_operator.py
31
2157
""" ### Example HTTP operator and sensor """ from airflow import DAG from airflow.operators import SimpleHttpOperator, HttpSensor from datetime import datetime, timedelta import json seven_days_ago = datetime.combine(datetime.today() - timedelta(7), datetime.min.time()) default_args ...
apache-2.0
2,824,467,483,369,880,000
25.62963
87
0.646732
false
frankyrumple/ope
libs/paramiko/transport.py
31
97327
# Copyright (C) 2003-2007 Robey Pointer <robeypointer@gmail.com> # # This file is part of paramiko. # # Paramiko 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 (a...
mit
2,238,339,933,883,434,000
41.096453
179
0.58812
false
nojhan/weboob-devel
modules/seloger/test.py
4
1349
# -*- coding: utf-8 -*- # Copyright(C) 2012 Romain Bignon # # This file is part of weboob. # # weboob 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 opt...
agpl-3.0
1,361,611,868,044,145,700
32.7
84
0.701039
false
opencord/voltha
tests/itests/voltha/test_voltha_alarm_filters.py
1
6502
# Copyright 2017-present Open Networking 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 # # Unless required by applicable law or agr...
apache-2.0
3,710,821,299,013,061,000
34.336957
94
0.619655
false
ryanahall/django
tests/middleware/test_security.py
37
7769
from django.http import HttpResponse from django.test import RequestFactory, TestCase from django.test.utils import override_settings class SecurityMiddlewareTest(TestCase): @property def middleware(self): from django.middleware.security import SecurityMiddleware return SecurityMiddleware() ...
bsd-3-clause
8,726,975,608,273,302,000
37.460396
96
0.634831
false
talkincode/ToughPORTAL
toughportal/common/pyforms/rules.py
1
2384
#!/usr/bin/env python #coding=utf-8 from toughportal.console.libs import pyforms not_null = pyforms.notnull is_not_empty = pyforms.regexp('.+', u"不允许为空") is_date = pyforms.regexp('(\d{4})-(\d{2}-(\d\d))', u"日期格式:yyyy-MM-dd") is_email = pyforms.regexp('[\w-]+(\.[\w-]+)*@[\w-]+(\.[\w-]+)+$', u"email格式,比如name@domain.com...
agpl-3.0
-4,856,545,337,888,120,000
53.236842
134
0.567476
false
fhaoquan/kbengine
kbe/src/lib/python/Lib/test/test_dict.py
77
29052
import unittest from test import support import collections, random, string import collections.abc import gc, weakref import pickle class DictTest(unittest.TestCase): def test_invalid_keyword_arguments(self): class Custom(dict): pass for invalid in {1 : 2}, Custom({1 : 2}): ...
lgpl-3.0
5,065,328,515,879,697,000
30.306034
79
0.497281
false
crosswalk-project/chromium-crosswalk-efl
tools/perf/benchmarks/spaceport.py
33
4300
# Copyright 2012 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """Runs spaceport.io's PerfMarks benchmark.""" import logging import os from telemetry import benchmark from telemetry.core import util from telemetry.page...
bsd-3-clause
-7,003,887,689,150,849,000
39.566038
80
0.675116
false
google/embedding-tests
models/bert/extract_features.py
1
13765
# Copyright 2019 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, ...
apache-2.0
-918,081,383,887,239,700
32.088942
82
0.63923
false
KohlsTechnology/ansible
lib/ansible/utils/module_docs_fragments/ios.py
58
5333
# # (c) 2015, Peter Sprygada <psprygada@ansible.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) any late...
gpl-3.0
8,461,870,927,506,713,000
47.926606
154
0.685355
false
brianjgeiger/osf.io
api_tests/meetings/views/test_meetings_submissions_detail.py
9
4700
import pytest from api_tests import utils as api_utils from framework.auth.core import Auth from osf.models import PageCounter from osf_tests.factories import ConferenceFactory, ProjectFactory, AuthUserFactory @pytest.mark.django_db class TestMeetingSubmissionsDetail: @pytest.fixture() def meeting(self): ...
apache-2.0
-4,925,794,704,631,613,000
40.22807
124
0.645532
false
perlygatekeeper/glowing-robot
Little_Alchemy_2/Scraper_python/env/lib/python3.7/site-packages/pip/_vendor/urllib3/contrib/pyopenssl.py
9
16468
""" SSL with SNI_-support for Python 2. Follow these instructions if you would like to verify SSL certificates in Python 2. Note, the default libraries do *not* do certificate checking; you need to do additional work to validate certificates yourself. This needs the following packages installed: * pyOpenSSL (tested w...
artistic-2.0
8,115,023,160,959,327,000
32.954639
96
0.639847
false
reddraggone9/youtube-dl
youtube_dl/extractor/tlc.py
11
2612
# encoding: utf-8 from __future__ import unicode_literals import re from .common import InfoExtractor from .brightcove import BrightcoveLegacyIE from .discovery import DiscoveryIE from ..compat import compat_urlparse class TlcIE(DiscoveryIE): IE_NAME = 'tlc.com' _VALID_URL = r'http://www\.tlc\.com\/[a-zA-Z0-...
unlicense
-3,822,309,879,318,509,000
35.774648
108
0.561471
false
pedrobaeza/OpenUpgrade
addons/sale_stock/report/sale_report.py
231
2100
# -*- 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...
agpl-3.0
-1,073,949,509,600,139,600
41.857143
135
0.579524
false
google-research/google-research
felix/converter_for_felix_insert.py
1
6197
# coding=utf-8 # Copyright 2021 The Google Research 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 # # Unless required by applicab...
apache-2.0
-9,127,897,388,051,714,000
40.039735
80
0.693884
false
sky-uk/bslint
tests/bslint_command_tests/skip_file_command_test.py
1
1641
import unittest import os import bslint import bslint.messages.handler as msg_handler import bslint.messages.error_constants as err_const from tests.resources.common.test_methods import CommonMethods as Common from filepaths import BSLINT_COMMAND_CONFIG_PATH from filepaths import TEST_CONFIG_FILE_PATH class TestSkipF...
bsd-3-clause
-7,824,055,588,589,423,000
50.28125
117
0.689823
false
wangpanjun/django-rest-framework
tests/test_serializer_bulk_update.py
79
3944
""" Tests to cover bulk create and update using serializers. """ from __future__ import unicode_literals from django.test import TestCase from django.utils import six from rest_framework import serializers class BulkCreateSerializerTests(TestCase): """ Creating multiple instances using serializers. """ ...
bsd-2-clause
-3,217,759,627,787,205,000
30.552
97
0.547921
false
LonelyPale/mongo-connector
tests/util.py
69
1175
# Copyright 2013-2014 MongoDB, 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 writin...
apache-2.0
7,535,320,984,357,843,000
31.638889
74
0.715745
false
jnfsmile/zinnia
zinnia/preview.py
9
3772
"""Preview for Zinnia""" from __future__ import division from django.utils import six from django.utils.text import Truncator from django.utils.html import strip_tags from django.utils.functional import cached_property from django.utils.encoding import python_2_unicode_compatible from bs4 import BeautifulSoup from z...
bsd-3-clause
2,191,169,854,439,010,600
28.936508
75
0.605249
false
Juniper/tempest
tempest/api/compute/servers/test_multiple_create.py
3
1930
# Copyright 2013 IBM Corp # 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 appl...
apache-2.0
7,005,697,521,908,711,000
41.888889
78
0.659585
false
Antiun/partner-contact
partner_relations/model/__init__.py
17
1438
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # This module copyright (C) 2013 Therp BV (<http://therp.nl>). # # This program is free software: you can redistribute it and/or modify # it under the terms of ...
agpl-3.0
-6,387,111,640,299,600,000
35.871795
78
0.632823
false
Vallher/zulip
zerver/management/commands/makemessages.py
1
8262
""" The contents of this file are taken from [Django-admin](https://github.com/niwinz/django-jinja/blob/master/django_jinja/management/commands/makemessages.py) Jinja2's i18n functionality is not exactly the same as Django's. In particular, the tags names and their syntax are different: 1. The Django ``trans`` tag ...
apache-2.0
3,555,366,257,217,121,300
37.971698
118
0.612806
false
philoniare/horizon
openstack_dashboard/test/test_data/nova_data.py
22
30359
# Copyright 2012 Nebula, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agree...
apache-2.0
-8,375,025,977,649,343,000
36.480247
79
0.485556
false
songfj/calibre
src/calibre/library/catalogs/epub_mobi.py
14
25308
#!/usr/bin/env python2 # vim:fileencoding=UTF-8:ts=4:sw=4:sta:et:sts=4:ai from __future__ import (unicode_literals, division, absolute_import, print_function) __license__ = 'GPL v3' __copyright__ = '2012, Kovid Goyal <kovid@kovidgoyal.net>' __docformat__ = 'restructuredtext en' import datetime...
gpl-3.0
-4,063,497,994,314,185,700
49.314115
264
0.507705
false
ingted/crmsh
modules/ui_resource.py
1
24285
# Copyright (C) 2008-2011 Dejan Muhamedagic <dmuhamedagic@suse.de> # Copyright (C) 2013 Kristoffer Gronlund <kgronlund@suse.com> # See COPYING for license information. from . import command from . import completers as compl from . import constants from . import config from . import utils from . import xmlutil from . i...
gpl-2.0
7,414,405,030,655,921,000
37.425633
105
0.561622
false
lshain-android-source/external-chromium_org
tools/telemetry/telemetry/core/extension_unittest.py
23
6764
# Copyright (c) 2012 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. import logging import os import shutil import tempfile import unittest from telemetry.core import browser_finder from telemetry.core import extension_to_...
bsd-3-clause
4,272,083,424,634,469,400
40.753086
79
0.668687
false
yongtang/tensorflow
tensorflow/python/ops/nn.py
47
1787
# Copyright 2015 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
9,042,995,013,775,521,000
39.613636
79
0.746503
false
roadmapper/ansible
lib/ansible/modules/network/f5/bigip_traffic_selector.py
38
15443
#!/usr/bin/python # -*- coding: utf-8 -*- # # Copyright: (c) 2018, F5 Networks Inc. # GNU General Public License v3.0 (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from __future__ import absolute_import, division, print_function __metaclass__ = type ANSIBLE_METADATA = {'metadata_version': '1.1', ...
gpl-3.0
-1,983,043,840,724,095,500
29.339882
99
0.593019
false
mychris/xbmc-command
xbmc_command/play_music.py
1
5180
# -*- coding: utf-8 -*- import argparse import re from . import core class Command(core.Command): def call(self, args): if args.artist: self.__call_artist(args.artist, args.dry) elif args.album: self.__call_album(args.album, args.dry) elif args.genre: ...
gpl-3.0
882,245,541,311,120,100
36.266187
131
0.547297
false
allenp/odoo
addons/mrp_operations/__openerp__.py
45
2001
# -*- coding: utf-8 -*- # Part of Odoo. See LICENSE file for full copyright and licensing details. { 'name': 'Manufacturing Operations', 'version': '1.0', 'category': 'Manufacturing', 'description': """ This module adds state, date_start, date_stop in manufacturing order operation lines (in the 'Work ...
gpl-3.0
6,625,108,858,585,167,000
33.5
112
0.596702
false
pjg101/SickRage
lib/pbr/core.py
10
5507
# Copyright (c) 2013 Hewlett-Packard Development Company, L.P. # # 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...
gpl-3.0
-253,332,351,880,863,840
40.097015
78
0.686218
false
applecool/AI
Best product/simulate_agents_phase4.py
1
2564
import sys import numpy as np from agents import CheapAgent, RandomAgent from Agent_spamu import Agent_spamu #addition from product import Product if __name__ == '__main__': data_path = "./datasets/" data_group = "dataset1" # if you like, you can read the data_path and data_group using sys.argv ...
mit
-2,645,781,745,487,281,000
26.197802
93
0.568253
false
qqzwc/XX-Net
code/default/python27/1.0/lib/encodings/iso8859_3.py
593
13345
""" Python Character Mapping Codec iso8859_3 generated from 'MAPPINGS/ISO8859/8859-3.TXT' with gencodec.py. """#" import codecs ### Codec APIs class Codec(codecs.Codec): def encode(self,input,errors='strict'): return codecs.charmap_encode(input,errors,encoding_table) def decode(self,input,errors='...
bsd-2-clause
7,521,539,191,504,728,000
42.469055
107
0.53181
false
mrquim/mrquimrepo
repo/plugin.video.live.streamspro/pyaesnew/__init__.py
68
2087
# The MIT License (MIT) # # Copyright (c) 2014 Richard Moore # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including without limitation the rights # to use, copy, mod...
gpl-2.0
3,306,489,669,506,671,600
38.377358
165
0.770005
false
hansroh/aquests
aquests/protocols/http2/hyper/packages/rfc3986/normalizers.py
47
3332
# -*- coding: utf-8 -*- # Copyright (c) 2014 Rackspace # 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...
mit
1,468,099,099,771,740,000
27.973913
77
0.639556
false
bbbbanjax/CloudBot
plugins/tvdb.py
3
5083
import datetime import requests from lxml import etree from cloudbot import hook # security parser = etree.XMLParser(resolve_entities=False, no_network=True) base_url = "http://thetvdb.com/api/" def get_episodes_for_series(series_name, api_key): res = {"error": None, "ended": False, "episodes": None, "name": ...
gpl-3.0
1,296,807,479,261,441,800
29.993902
92
0.612827
false
40023256/2015cd_midterm-
static/Brython3.1.0-20150301-090019/Lib/long_int1/__init__.py
109
3805
from browser import html, document, window import javascript #memorize/cache? def _get_value(other): if isinstance(other, LongInt): return other.value return other class BigInt: def __init__(self): pass def __abs__(self): return LongInt(self.value.abs()) def __add__(self, other): ...
gpl-3.0
-5,411,325,102,652,327,000
25.241379
77
0.626807
false
FIWARE-TMForum/business-ecosystem-charging-backend
src/wstore/asset_manager/resource_plugins/test_data.py
1
9865
# -*- coding: utf-8 -*- # Copyright (c) 2015 - 2016 CoNWeT Lab., Universidad Politécnica de Madrid # This file belongs to the business-charging-backend # of the Business API Ecosystem. # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public Licens...
agpl-3.0
-5,469,844,049,527,012,000
22.049065
74
0.528994
false
mbernasocchi/QGIS
python/plugins/processing/gui/BatchInputSelectionPanel.py
30
10001
# -*- coding: utf-8 -*- """ *************************************************************************** BatchInputSelectionPanel.py --------------------- Date : August 2012 Copyright : (C) 2012 by Victor Olaya Email : volayaf at gmail dot com **************...
gpl-2.0
-2,594,055,215,169,829,400
41.705128
150
0.576804
false
jylaxp/django
tests/template_tests/filter_tests/test_truncatechars_html.py
390
1229
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.template.defaultfilters import truncatechars_html from django.test import SimpleTestCase class FunctionTests(SimpleTestCase): def test_truncate_zero(self): self.assertEqual(truncatechars_html('<p>one <a href="#">two - three <br>...
bsd-3-clause
4,442,266,039,104,225,300
34.114286
110
0.569569
false
sam-m888/gprime
gprime/plugins/graph/gvhourglass.py
1
14183
# # gPrime - A web-based genealogy program # # Copyright (C) 2007-2008 Brian G. Matherly # Copyright (C) 2008 Stephane Charette <stephanecharette@gmail.com> # Contribution 2009 by Bob Ham <rah@bash.sh> # Copyright (C) 2010 Jakim Friant # Copyright (C) 2013-2014 Paul Franklin # Copyright (C) 2015 Detle...
gpl-2.0
-959,616,111,585,107,800
39.292614
80
0.546852
false
nicoboss/Floatmotion
OpenGL/GL/ARB/texture_rgb10_a2ui.py
9
1165
'''OpenGL extension ARB.texture_rgb10_a2ui This module customises the behaviour of the OpenGL.raw.GL.ARB.texture_rgb10_a2ui to provide a more Python-friendly API Overview (from the spec) This extension adds support for the following data format: A new texturing format for unsigned 10.10.10.2 integer textures....
agpl-3.0
5,552,366,469,613,243,000
33.294118
72
0.784549
false
arugifa/website
website/content.py
1
11581
"""Entry point to manage all content of my website. Mainly base classes to be inherited by website's components. """ import logging from abc import ABC, abstractmethod from contextlib import AbstractAsyncContextManager from dataclasses import dataclass from pathlib import Path, PurePath from typing import Callable, C...
gpl-3.0
-6,749,728,241,312,898,000
32.183381
87
0.625853
false
SEL-Columbia/commcare-hq
corehq/apps/accounting/migrations/0013_roles_and_plans_migration_p1m2.py
3
32741
# encoding: utf-8 from collections import defaultdict import datetime from decimal import Decimal import logging from django.core.exceptions import ObjectDoesNotExist from django.core.management import call_command from south.db import db from south.v2 import DataMigration from django.db import models from corehq.apps....
bsd-3-clause
6,672,387,203,067,658,000
61.722222
198
0.551755
false
jelmer/samba
lib/ldb/_ldb_text.py
12
3564
# Text wrapper for ldb bindings # # Copyright (C) 2015 Petr Viktorin <pviktori@redhat.com> # Published under the GNU LGPLv3 or later import sys import functools import ldb def _recursive_encode(obj): if isinstance(obj, bytes): return obj elif isinstance(obj, str): return obj.encode('utf-8') ...
gpl-3.0
-3,054,032,598,679,550,000
23.081081
80
0.567621
false
wileeam/airflow
airflow/sensors/time_delta_sensor.py
5
1818
# # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not...
apache-2.0
-2,254,405,733,512,082,200
39.4
78
0.726623
false
Forrestburgundy/Pi-Mission-Control
screens/wordclock/layouts/english.py
2
2752
'''This is a custom layout for the RPi InfoScreen wordclock screen. Custom layouts can be created for the screen by creating a new file in the "layouts" folder. Each layout must have the following variables: LAYOUT: The grid layout. Must be a single string. MAP: The mapping required...
gpl-3.0
7,057,171,932,817,351,000
35.210526
79
0.554142
false
kdwink/intellij-community
python/lib/Lib/codeop.py
110
5243
r"""Utilities to compile possibly incomplete Python source code. This module provides two interfaces, broadly similar to the builtin function compile(), that take progam text, a filename and a 'mode' and: - Return a code object if the command is complete and valid - Return None if the command is incomplete - Raise Sy...
apache-2.0
-5,476,293,927,007,800,000
38.126866
83
0.717528
false
cyrixhero/bitcoin
qa/rpc-tests/merkle_blocks.py
133
4001
#!/usr/bin/env python2 # Copyright (c) 2014 The Bitcoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. # # Test merkleblock fetch/validation # from test_framework.test_framework import BitcoinTestFramework from t...
mit
6,675,505,133,583,904,000
43.955056
120
0.658335
false
rafiqsaleh/VERCE
verce-hpc-pe/src/networkx/algorithms/centrality/current_flow_betweenness.py
31
13429
""" Current-flow betweenness centrality measures. """ # Copyright (C) 2010-2012 by # Aric Hagberg <hagberg@lanl.gov> # Dan Schult <dschult@colgate.edu> # Pieter Swart <swart@lanl.gov> # All rights reserved. # BSD license. import random import networkx as nx from networkx.algorithms.centrality.flow_mat...
mit
3,536,060,159,694,711,000
36.199446
80
0.619704
false
stone5495/NewsBlur
apps/rss_feeds/migrations/0048_has_page.py
18
5524
# encoding: utf-8 import datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Adding field 'Feed.has_page' db.add_column('feeds', 'has_page', self.gf('django.db.models.fields.Boolean...
mit
-7,214,337,126,017,518,000
69.820513
151
0.556843
false
alo-alt/airflow
https_operator.py
1
2607
import logging from airflow.exceptions import AirflowException from airflow.hooks import HttpsHook from airflow.models import BaseOperator from airflow.utils.decorators import apply_defaults class SimpleHttpsOperator(BaseOperator): """ Calls an endpoint on an HTTPS system to execute an action :param htt...
apache-2.0
-2,192,963,257,679,122,000
39.107692
79
0.633679
false
richardtran415/pymatgen
pymatgen/io/vasp/tests/test_outputs.py
2
87130
# coding: utf-8 # Copyright (c) Pymatgen Development Team. # Distributed under the terms of the MIT License. import gzip import json import os import unittest import warnings import xml.etree.cElementTree as ET from pathlib import Path from shutil import copyfile, copyfileobj import numpy as np import pytest from mo...
mit
5,961,291,234,613,041,000
41.502439
118
0.567175
false
damiansoriano/odoo
addons/mail/mail_message.py
12
47075
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2010-today OpenERP SA (<http://www.openerp.com>) # # This program is free software: you can redistribute it and/or modify # it under the terms o...
agpl-3.0
5,666,532,645,183,143,000
52.012387
196
0.589081
false
squirrelo/qiime
qiime/remote.py
15
13012
#!/usr/bin/env python from __future__ import division __author__ = "Jai Ram Rideout" __copyright__ = "Copyright 2012, The QIIME project" __credits__ = ["Jai Ram Rideout"] __license__ = "GPL" __version__ = "1.9.1-dev" __maintainer__ = "Jai Ram Rideout" __email__ = "jai.rideout@gmail.com" """Contains functionality to i...
gpl-2.0
-1,356,627,307,197,727,000
41.943894
100
0.600599
false
ichenjin/webgl-fundamentals
obj2.py
13
2818
# Copyright 2012, Gregg Tavares. # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions of source code must retain the above copyright # notice, this list of conditions and th...
bsd-3-clause
3,945,237,739,416,692,000
33.365854
72
0.683463
false
Matt-Deacalion/django
tests/gis_tests/relatedapp/tests.py
199
15937
from __future__ import unicode_literals from django.contrib.gis.db.models import F, Collect, Count, Extent, Union from django.contrib.gis.geometry.backend import Geometry from django.contrib.gis.geos import GEOSGeometry, MultiPoint, Point from django.db import connection from django.test import TestCase, ignore_warnin...
bsd-3-clause
-6,907,939,376,985,416,000
46.858859
113
0.639644
false
splbio/openobject-server
openerp/addons/base/res/res_currency.py
34
12824
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2009 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
-8,706,623,322,253,145,000
47.392453
255
0.606441
false
fener06/pyload
module/web/cnl_app.py
35
4421
#!/usr/bin/env python # -*- coding: utf-8 -*- from os.path import join import re from urllib import unquote from base64 import standard_b64decode from binascii import unhexlify from bottle import route, request, HTTPError from webinterface import PYLOAD, DL_ROOT, JS try: from Crypto.Cipher import AES except: ...
gpl-3.0
-4,210,875,994,053,178,000
25.957317
147
0.593078
false
jealousrobot/PlexArt
lib/cherrypy/__init__.py
6
11843
"""CherryPy is a pythonic, object-oriented HTTP framework. CherryPy consists of not one, but four separate API layers. The APPLICATION LAYER is the simplest. CherryPy applications are written as a tree of classes and methods, where each branch in the tree corresponds to a branch in the URL path. Each method is a 'pa...
gpl-3.0
3,143,841,733,393,997,300
30.581333
119
0.687157
false
JakeBrand/CMPUT410-E4
lab4/lib/python2.7/site-packages/distribute-0.6.24-py2.7.egg/setuptools/dist.py
64
30309
__all__ = ['Distribution'] import re from distutils.core import Distribution as _Distribution from setuptools.depends import Require from setuptools.command.install import install from setuptools.command.sdist import sdist from setuptools.command.install_lib import install_lib from distutils.errors import DistutilsOpt...
apache-2.0
-2,588,948,890,019,718,700
36.097919
97
0.612557
false
NeuralEnsemble/neuroConstruct
lib/jython/Lib/test/test_shutil.py
14
29246
# Copyright (C) 2003 Python Software Foundation import unittest import shutil import tempfile import sys import stat import os import os.path from os.path import splitdrive from distutils.spawn import find_executable, spawn from shutil import (_make_tarball, _make_zipfile, make_archive, register_ar...
gpl-2.0
4,225,138,609,341,324,000
34.840686
82
0.543185
false
sestrella/ansible
lib/ansible/modules/network/check_point/cp_mgmt_application_site_group_facts.py
20
4493
#!/usr/bin/python # -*- coding: utf-8 -*- # # Ansible module to manage Check Point Firewall (c) 2019 # # 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 o...
gpl-3.0
7,470,784,453,890,217,000
32.036765
141
0.684175
false
QuLogic/specfem3d
CUBIT_GEOCUBIT/geocubitlib/absorbing_boundary.py
4
12965
#!python # Retrieving absorbing boundaries. # P. Galvez (ETH-Zurich, 10.09.2011): # This function is based on Emmanuele Cassarotti , boundary_definition.py routine. # # It returns absorbing_surf,absorbing_surf_xmin,absorbing_surf_xmax, # absorbing_surf_ymin,absorbing_surf_ymax,absorbing_surf_bottom,top...
gpl-2.0
-655,071,427,280,937,900
36.042857
141
0.598535
false
azureplus/chromium_depot_tools
third_party/pylint/gui.py
56
19674
# Copyright (c) 2003-2013 LOGILAB S.A. (Paris, FRANCE). # http://www.logilab.fr/ -- mailto:contact@logilab.fr # # 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, o...
bsd-3-clause
-4,846,486,199,310,849,000
36.050847
87
0.588696
false
camilortte/RecomendadorUD
apps/externals/recommends/similarities.py
4
1351
from math import sqrt @staticmethod def sim_distance(p1, p2): """Returns a distance-based similarity score for p1 and p2""" # Get the list of shared_items si = [item for item in p1 if item in p2] if len(si) != 0: squares = [pow(p1[item] - p2[item], 2) for item in si] # Add up the squa...
mit
3,340,725,699,150,624,300
26.571429
77
0.556625
false