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
pfmoore/pip
src/pip/_internal/cache.py
6
9958
"""Cache Management """ import hashlib import json import logging import os from typing import Any, Dict, List, Optional, Set from pip._vendor.packaging.tags import Tag, interpreter_name, interpreter_version from pip._vendor.packaging.utils import canonicalize_name from pip._internal.exceptions import InvalidWheelFi...
mit
8,222,681,920,759,544,000
33.696864
81
0.597911
false
LIS/lis-tempest
tempest/api/data_processing/test_cluster_templates.py
6
5123
# Copyright (c) 2014 Mirantis 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 ...
apache-2.0
-2,413,352,540,128,404,500
40.314516
79
0.644935
false
tafaRU/odoo
openerp/addons/base/ir/ir_model.py
10
61098
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Business Applications # Copyright (C) 2004-2014 OpenERP S.A. (<http://openerp.com>). # # This program is free software: you can redistribute it and/or modify # it under the terms ...
agpl-3.0
-5,110,409,172,991,243,000
47.528991
207
0.557285
false
ClonedOne/pandalog_investigator
pandaloginvestigator/cli/cmds/detect.py
1
1643
from pandaloginvestigator.core.detection import suspect_builder from pandaloginvestigator.core.utils import string_utils import logging import os logger = logging.getLogger(__name__) def detect_command(app): try: core_num = app.config.get('pandaloginvestigator', 'core_num') except: logger.er...
mit
6,249,602,253,184,543,000
32.530612
116
0.65916
false
eXistenZNL/SickRage
sickbeard/providers/generic.py
3
22456
# coding=utf-8 # Author: Nic Wolfe <nic@wolfeden.ca> # URL: http://code.google.com/p/sickbeard/ # # This file is part of SickRage. # # SickRage is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 ...
gpl-3.0
3,091,738,021,392,681,500
36.741176
189
0.553571
false
fangxingli/hue
desktop/core/src/desktop/management/commands/test.py
4
3715
#!/usr/bin/env python # Licensed to Cloudera, Inc. under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. Cloudera, Inc. licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you ma...
apache-2.0
-1,227,436,018,042,384,600
31.876106
80
0.667833
false
Giladx/cwiid
wmdemo/wmdemo.py
8
6220
#!/usr/bin/python import cwiid import sys menu = '''1: toggle LED 1 2: toggle LED 2 3: toggle LED 3 4: toggle LED 4 5: toggle rumble a: toggle accelerometer reporting b: toggle button reporting c: enable motionplus, if connected e: toggle extension reporting i: toggle ir reporting m: toggle messages p: print this menu...
gpl-2.0
-2,666,027,691,027,644,000
26.522124
88
0.590997
false
lewischeng-ms/pox
tools/pox-log.py
33
1697
#!/usr/bin/env python # Copyright 2011 James McCauley # # This file is part of POX. # # POX 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 ver...
gpl-3.0
7,504,908,176,214,537,000
25.515625
92
0.624632
false
JaDogg/__py_playground
reference/sketchbook/regex/nfa_rpn_vm.py
1
4074
""" The Thompson algorithm again but starting from a regex in RPN, as Thompson did. In a more C-like style now, compiling to a virtual machine. We differ from Thompson in parsing from right to left, and thus needing fewer jump instructions and backpatching only for loops. Also in detecting loops at match-time -- we sho...
mit
3,458,246,283,264,082,000
24.622642
80
0.527982
false
benpatterson/edx-platform
cms/djangoapps/contentstore/management/commands/tests/test_reindex_library.py
15
7173
""" Tests for library reindex command """ import sys import contextlib import ddt from django.core.management import call_command, CommandError import mock from xmodule.modulestore import ModuleStoreEnum from xmodule.modulestore.django import modulestore from xmodule.modulestore.tests.django_utils import ModuleStoreTe...
agpl-3.0
1,158,595,123,801,546,500
46.190789
118
0.663321
false
poldrack/openfmri
pipeline/run_ANTS.py
1
1827
""" run_ANTS.py - run ANTS stripping and registration """ ## Copyright 2011, Russell Poldrack. 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 t...
bsd-2-clause
7,154,718,467,068,391,000
41.488372
95
0.736727
false
diego-d5000/MisValesMd
env/lib/python2.7/site-packages/django/contrib/gis/db/backends/oracle/schema.py
2
4144
from django.contrib.gis.db.models.fields import GeometryField from django.db.backends.oracle.schema import DatabaseSchemaEditor from django.db.backends.utils import truncate_name class OracleGISSchemaEditor(DatabaseSchemaEditor): sql_add_geometry_metadata = (""" INSERT INTO USER_SDO_GEOM_METADATA ...
mit
8,120,818,192,315,130,000
42.085106
110
0.561052
false
songyi199111/sentry
src/sentry/search/django/backend.py
21
4201
""" sentry.search.django.backend ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ :copyright: (c) 2010-2014 by the Sentry Team, see AUTHORS for more details. :license: BSD, see LICENSE for more details. """ from __future__ import absolute_import from django.db.models import Q from sentry.api.paginator import Paginator from sentry.sear...
bsd-3-clause
329,046,697,419,729,700
34.008333
78
0.561057
false
shahar-stratoscale/nova
nova/paths.py
36
2182
# Copyright 2010 United States Government as represented by the # Administrator of the National Aeronautics and Space Administration. # All Rights Reserved. # Copyright 2012 Red Hat, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the ...
apache-2.0
-1,007,451,602,583,617,500
31.567164
78
0.658112
false
hslee16/ansible-modules-extras
system/known_hosts.py
6
10636
#!/usr/bin/python """ Ansible module to manage the ssh known_hosts file. Copyright(c) 2014, Matthew Vernon <mcv21@cam.ac.uk> 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 version 3 of the Li...
gpl-3.0
6,375,780,330,987,241,000
36.583039
246
0.622602
false
mazaclub/mazabot-core
plugins/MessageParser/__init__.py
2
2684
### # Copyright (c) 2010, Daniel Folkinshteyn # 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 cond...
bsd-3-clause
-7,568,856,396,968,353,000
39.666667
79
0.762668
false
c0r73x/neotags.nvim
rplugin/python3/neotags/__init__.py
1
2079
# ============================================================================ # File: __init__.py # Author: Christian Persson <c0r73x@gmail.com> # Repository: https://github.com/c0r73x/neotags.nvim # Released under the MIT license # ============================================================...
mit
-902,618,798,874,772,000
33.081967
78
0.608466
false
cslzchen/osf.io
api_tests/users/views/test_user_files_list.py
14
4794
# -*- coding: utf-8 -*- import pytest from osf_tests.factories import AuthUserFactory from api.base import utils from api.base.settings.defaults import API_BASE from osf.models import QuickFilesNode from addons.osfstorage.models import OsfStorageFile @pytest.mark.django_db @pytest.mark.enable_quickfiles_creation clas...
apache-2.0
-7,323,185,194,422,189,000
35.59542
91
0.626825
false
KennyCandy/HAR
module123/HAR_v4_3.py
2
17610
# Note that the dataset must be already downloaded for this script to work, do: # $ cd data/ # $ python download_dataset.py # quoc_trinh import tensorflow as tf import numpy as np import matplotlib import matplotlib.pyplot as plt from sklearn import metrics import os import sys import datetime # get current...
mit
-4,966,475,290,769,681,000
36.630342
116
0.535945
false
noelbk/neutron-juniper
neutron/common/utils.py
5
7252
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2011, Nicira Networks, 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.apa...
apache-2.0
-3,548,617,166,378,592,000
34.033816
78
0.591423
false
moijes12/oh-mainline
vendor/packages/celery/celery/tests/test_utils/test_utils_timeutils.py
16
2257
from __future__ import absolute_import from datetime import datetime, timedelta from celery.utils import timeutils from celery.tests.utils import unittest class test_timeutils(unittest.TestCase): def test_delta_resolution(self): D = timeutils.delta_resolution dt = datetime(2010, 3, 30, 11, 50,...
agpl-3.0
-4,155,436,085,156,951,000
34.825397
74
0.550288
false
defaultnamehere/grr
gui/urls.py
7
1084
#!/usr/bin/env python """URL definitions for GRR Admin Server.""" import mimetypes import os from django.conf import urls from grr import gui from grr.lib import registry document_root = os.path.join(os.path.dirname(gui.__file__), "static") help_root = os.path.join(os.path.dirname(os.path.dirname(gui.__file__)), ...
apache-2.0
3,967,850,197,345,033,700
25.439024
80
0.643911
false
wxgeo/geophar
wxgeometrie/sympy/printing/tests/test_rcode.py
4
14177
from sympy.core import (S, pi, oo, Symbol, symbols, Rational, Integer, GoldenRatio, EulerGamma, Catalan, Lambda, Dummy, Eq) from sympy.functions import (Piecewise, sin, cos, Abs, exp, ceiling, sqrt, gamma, sign, Max, Min, factorial, beta) from sympy.sets import Range...
gpl-2.0
-7,460,385,559,712,265,000
27.873727
105
0.48226
false
ozburo/youtube-dl
youtube_dl/extractor/americastestkitchen.py
4
6349
# coding: utf-8 from __future__ import unicode_literals import json import re from .common import InfoExtractor from ..utils import ( clean_html, int_or_none, try_get, unified_strdate, unified_timestamp, ) class AmericasTestKitchenIE(InfoExtractor): _VALID_URL = r'https?://(?:www\.)?(?:ameri...
unlicense
7,919,049,104,063,309,000
38.930818
148
0.544495
false
gregomni/swift
utils/swift_build_support/swift_build_support/products/benchmarks.py
5
3523
# swift_build_support/products/benchmarks.py --------------------*- python -*- # # This source file is part of the Swift.org open source project # # Copyright (c) 2014 - 2019 Apple Inc. and the Swift project authors # Licensed under Apache License v2.0 with Runtime Library Exception # # See https://swift.org/LICENSE.tx...
apache-2.0
6,749,485,384,416,161,000
31.027273
79
0.624468
false
DolphinDream/sverchok
nodes/modifier_change/extrude_multi_alt.py
2
10156
# ##### 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
-7,165,845,987,041,847,000
32.081433
101
0.606046
false
jimsimon/sky_engine
sky/engine/bindings/scripts/v8_types.py
10
13437
# Copyright (C) 2013 Google Inc. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions of source code must retain the above copyright # notice, this list of conditions and the ...
bsd-3-clause
-8,908,105,044,277,456,000
35.414634
97
0.66049
false
epfl-lts2/pygsp
pygsp/tests/test_docstrings.py
1
1160
# -*- coding: utf-8 -*- """ Test suite for the docstrings of the pygsp package. """ import os import unittest import doctest def gen_recursive_file(root, ext): for root, _, filenames in os.walk(root): for name in filenames: if name.lower().endswith(ext): yield os.path.join(r...
bsd-3-clause
7,585,068,807,109,518,000
22.673469
71
0.642241
false
lanfker/tdma_imac
bindings/python/ns3modulescan.py
19
13937
#! /usr/bin/env python import sys import os.path import pybindgen.settings from pybindgen.gccxmlparser import ModuleParser, PygenClassifier, PygenSection, WrapperWarning from pybindgen.typehandlers.codesink import FileCodeSink from pygccxml.declarations import templates from pygccxml.declarations.class_declaration im...
gpl-2.0
6,564,324,079,077,996,000
40.852853
154
0.62883
false
jenmud/ansible-graph
ansible_graph/__init__.py
1
4018
""" Setup the environment by parsing the command line options and staring a ruruki http server. """ import argparse import logging import os from ansible.inventory import Inventory from ansible.vars import VariableManager from ansible.parsing.dataloader import DataLoader from ansible.playbook import Playbook from ruruk...
mit
-7,022,939,356,492,488,000
23.650307
74
0.612992
false
simonpcook/mframetest
printers/mediawiki.py
1
10383
###### mediawiki.py - MediaWiki Printer ####################################### ## ## MFrameTest ## ## Copyright (C) 2012-2013 Embecosm Limited ## ## This file is part of MFrameTest. ## ## MFrameTest is free software: you can redistribute it and/or modify ## it under the terms of th...
gpl-3.0
-6,518,489,005,081,915,000
34.558219
79
0.585284
false
thaim/ansible
lib/ansible/module_utils/network/junos/argspec/lag_interfaces/lag_interfaces.py
23
1944
# # -*- coding: utf-8 -*- # Copyright 2019 Red Hat # GNU General Public License v3.0+ # (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) ############################################# # WARNING # ############################################# # # This file is auto generated by ...
mit
5,864,629,116,853,440,000
37.117647
105
0.400206
false
Distrotech/yum-utils
plugins/post-transaction-actions/post-transaction-actions.py
4
6748
# 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 distributed in the hope that it will be useful, # bu...
gpl-2.0
-846,722,321,956,620,400
35.085561
89
0.566686
false
nielsvanoch/django
django/db/backends/mysql/introspection.py
13
8710
import re from .base import FIELD_TYPE from django.utils.datastructures import OrderedSet from django.db.backends import BaseDatabaseIntrospection, FieldInfo, TableInfo from django.utils.encoding import force_text foreign_key_re = re.compile(r"\sCONSTRAINT `[^`]*` FOREIGN KEY \(`([^`]*)`\) REFERENCES `([^`]*)` \(`([^...
bsd-3-clause
9,046,981,895,095,311,000
42.989899
113
0.57279
false
ypu/virt-test
virttest/qemu_devices_unittest.py
3
45197
#!/usr/bin/python """ This is a unittest for qemu_devices library. :author: Lukas Doktor <ldoktor@redhat.com> :copyright: 2012 Red Hat, Inc. """ __author__ = """Lukas Doktor (ldoktor@redhat.com)""" import re import unittest import os import common from autotest.client.shared.test_utils import mock from qemu_devices ...
gpl-2.0
-3,187,964,355,943,792,600
38.716169
81
0.496692
false
0Chencc/CTFCrackTools
Lib/site-packages/setuptools/sandbox.py
51
14324
import os import sys import tempfile import operator import functools import itertools import re import contextlib import pickle from setuptools.extern import six from setuptools.extern.six.moves import builtins, map import pkg_resources if sys.platform.startswith('java'): import org.python.modules.posix.PosixMo...
gpl-3.0
3,123,334,706,033,168,400
28.113821
105
0.587825
false
rfcx/defunct
sound-localization/localization/gaussian.py
1
4871
import numpy as np from signal_likelihood import SignalLikelihood import unittest from numpy.testing import assert_array_almost_equal,assert_almost_equal, assert_equal import math """ Models the ambient audio scenery with multiple, independent Gaussian distributions. Based on that model we can distinguish between th...
apache-2.0
-6,261,069,175,828,290,000
35.088889
115
0.624307
false
yehzhang/RapidTest
rapidtest/executors/common_executors.py
1
1701
from .outputs import ExecutionOutput from .._compat import is_sequence, PRIMITIVE_TYPES as P_TYPES from ..utils import identity class BaseExecutor(object): ENVIRONMENT = None PRIMITIVE_TYPES = P_TYPES def __init__(self, target): self.target = target self.initialize() def initialize(...
mit
-4,809,565,232,686,919,000
29.375
86
0.627866
false
toshywoshy/ansible
lib/ansible/module_utils/hwc_utils.py
13
12696
# Copyright (c), Google Inc, 2017 # Simplified BSD License (see licenses/simplified_bsd.txt or # https://opensource.org/licenses/BSD-2-Clause) import re import time import traceback THIRD_LIBRARIES_IMP_ERR = None try: from keystoneauth1.adapter import Adapter from keystoneauth1.identity import v3 from key...
gpl-3.0
1,518,753,234,668,667,600
27.986301
79
0.537886
false
pymedusa/Medusa
ext/boto/gs/key.py
17
42787
# Copyright 2010 Google Inc. # # 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, modify, merge, publish, dis- # trib...
gpl-3.0
-2,098,132,593,346,260,500
44.133966
101
0.602496
false
supriyantomaftuh/syzygy
third_party/numpy/files/numpy/f2py/tests/test_callback.py
22
1740
from numpy.testing import * from numpy import array import math import util class TestF77Callback(util.F2PyTest): code = """ subroutine t(fun,a) integer a cf2py intent(out) a external fun call fun(a) end subroutine func(a) cf2py intent(in,out) a integer a ...
apache-2.0
-8,656,660,185,156,959,000
22.2
65
0.486782
false
kjordahl/xray
xray/test/test_dask.py
2
9054
import numpy as np from xray import Variable, DataArray, Dataset, concat import xray.ufuncs as xu from . import TestCase, requires_dask, unittest, InaccessibleArray try: import dask import dask.array as da except ImportError: pass def _copy_at_variable_level(arg): """We need to copy the argument at ...
apache-2.0
3,757,064,685,218,720,000
34.645669
86
0.584603
false
pombredanne/pulp_python
plugins/test/unit/plugins/distributors/test_steps.py
1
17187
""" This module contains tests for the pulp_python.plugins.distributors.steps module. """ from gettext import gettext as _ import os import unittest from xml.etree import cElementTree as ElementTree import mock from pulp.plugins.model import Unit from pulp_python.common import constants from pulp_python.plugins.dist...
gpl-2.0
1,374,386,335,467,115,800
47.826705
100
0.632106
false
pando85/gourmet
gourmet/plugins/import_export/website_import_plugins/schema_org_parser.py
5
2406
""" Parser for web pages that use the http://schema.org/Recipe microformat """ class Excluder(object): def __init__(self, url): self.url = url def search(self, other_url): return not (other_url.endswith(self.url)) def generate(BaseParser): class SchemaOrgParser (BaseParser): s...
gpl-2.0
-744,655,749,017,660,200
38.442623
85
0.438071
false
atwel/gui_model
AC_ProductRuleNet.py
1
4370
""" This module creates a NetworkX network only for keeping track of autocatalytic networks. It uses instances of the ProductNetRule class for the nodes. Those objects are owned by cells. Written by Jon Atwell """ import networkx import AC_ProductRules class ProductRuleNet: """ A NetworkX DiGraph object. The con...
mit
-7,039,479,985,292,641,000
26.484277
74
0.683524
false
hvnsweeting/Diamond
src/collectors/elb/elb.py
12
10670
# coding=utf-8 """ The ELB collector collects metrics for one or more Amazon AWS ELBs #### Configuration Below is an example configuration for the ELBCollector. You can specify an arbitrary amount of regions ``` enabled = true interval = 60 # Optional access_key_id = ... secret_access_key = ......
mit
-7,865,292,978,284,028,000
34.331126
80
0.586036
false
jeremiahyan/odoo
addons/website_sale_coupon/models/sale_order.py
5
4820
# -*- coding: utf-8 -*- from datetime import timedelta from odoo import api, fields, models from odoo.http import request class SaleOrder(models.Model): _inherit = "sale.order" def _compute_website_order_line(self): """ This method will merge multiple discount lines generated by a same program ...
gpl-3.0
8,057,577,966,444,878,000
49.736842
144
0.589004
false
Storj/RandomIO
tests/test_unit.py
3
6329
#!/usr/bin/env python # -*- coding: utf-8 -*- # # The MIT License (MIT) # # Copyright (c) 2014 William T. James for Storj Labs # # 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 restri...
mit
-1,215,813,959,735,038,200
25.704641
79
0.611629
false
radlws/AWS-ElasticBeanstalk-CLI
eb/macosx/python3/lib/aws/exception.py
4
3800
#!/usr/bin/env python # ============================================================================== # Copyright 2012 Amazon.com, Inc. or its affiliates. All Rights Reserved. # # Licensed under the Amazon Software License (the "License"). You may not use # this file except in compliance with the License. A copy of th...
apache-2.0
8,385,534,607,352,322,000
38.185567
98
0.670789
false
tellapart/aurproxy
tellapart/aurproxy/source/sources/static.py
5
1839
# Copyright 2015 TellApart, 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 writi...
apache-2.0
48,258,656,994,390,136
33.698113
74
0.660685
false
cjcjameson/gpdb
src/test/tinc/tincrepo/mpp/gpdb/tests/package/system_catalog/guc_settings/TEST.py
1
2643
#!/usr/bin/env python """ Copyright (c) 2004-Present Pivotal Software, Inc. This program and the accompanying materials are made available under the terms of the 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 ...
apache-2.0
7,694,779,754,469,070,000
32.455696
89
0.643965
false
uvemas/ViTables
vitables/docbrowser/browsergui.py
1
14862
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # Copyright (C) 2005-2007 Carabos Coop. V. All rights reserved # Copyright (C) 2008-2019 Vicent Mas. All rights reserved # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License...
gpl-3.0
5,899,242,716,550,069,000
39.606557
79
0.617885
false
bswartz/cinder
cinder/tests/unit/api/test_common.py
2
24438
# Copyright 2010 OpenStack Foundation # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless requ...
apache-2.0
-5,789,866,241,644,605,000
40.703072
79
0.595834
false
cBioPortal/cbioportal
core/src/main/scripts/importUsers.py
20
25394
#! /usr/bin/env python # ------------------------------------------------------------------------------ # Script which adds new users fram google spreadsheet into the the cgds # user table. The following properties must be specified in portal.properties: # # db.name # db.user # db.password # db.host # google.id # goo...
agpl-3.0
-9,097,960,245,886,748,000
40.697865
227
0.604631
false
mr-uuid/snippets
python/functional.py
1
1669
import unittest expressions = { "gten": lambda x: x > 10, "cube": lambda y: y**3, "add": lambda x, y: x + y if (x is not None and y is not None) else ( x if y is None else y), "reduce": lambda x, y: "{} {}".format(str(x), str(y)), } def lten(x): return x < 10 ...
mit
-2,022,393,962,986,300,400
27.288136
73
0.444578
false
authmillenon/RIOT
tests/gnrc_ipv6_ext/tests/01-run.py
7
30694
#!/usr/bin/env python3 # Copyright (C) 2018 Freie Universität Berlin # # This file is subject to the terms and conditions of the GNU Lesser # General Public License v2.1. See the file LICENSE in the top level # directory for more details. import re import os import sys import subprocess from scapy.all import Ether, ...
lgpl-2.1
-2,034,594,512,957,191,200
46.512384
83
0.610432
false
Tuxemon/Tuxemon-Server
tuxemon_server/core/game/event/conditions/combat.py
5
1893
#!/usr/bin/python # -*- coding: utf-8 -*- # # Tuxemon # Copyright (C) 2014, William Edwards <shadowapex@gmail.com> # # This file is part of Tuxemon. # # Tuxemon 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, ...
gpl-3.0
3,870,911,959,556,521,000
27.253731
110
0.632858
false
yaolinz/rethinkdb
drivers/python/rethinkdb/net_tornado.py
5
10607
# Copyright 2015 RethinkDB, all rights reserved. import errno import json import numbers import socket import struct import sys from tornado import gen, iostream from tornado.ioloop import IOLoop from tornado.concurrent import Future from . import ql2_pb2 as p from .net import decodeUTF, Query, Response, Cursor, mayb...
agpl-3.0
394,968,667,133,397,200
38.431227
93
0.598001
false
zetaops/SpiffWorkflow
tests/SpiffWorkflow/bpmn/TimerIntermediateTest.py
3
1604
# -*- coding: utf-8 -*- from __future__ import print_function, absolute_import, division from __future__ import division import unittest import datetime import time from SpiffWorkflow.Task import Task from SpiffWorkflow.bpmn.BpmnWorkflow import BpmnWorkflow from tests.SpiffWorkflow.bpmn.BpmnWorkflowTestCase import Bpm...
lgpl-3.0
8,238,835,200,252,255,000
33.12766
91
0.706983
false
EricCline/CEM_inc
env/lib/python2.7/site-packages/IPython/parallel/controller/hub.py
7
54907
"""The IPython Controller Hub with 0MQ This is the master object that handles connections from engines and clients, and monitors traffic through the various queues. Authors: * Min RK """ #----------------------------------------------------------------------------- # Copyright (C) 2010-2011 The IPython Development ...
mit
2,754,891,311,389,879,300
36.89303
118
0.537309
false
nicholaslocascio/deep-regex
deep-regex-model/nearest_neighbors_model.py
1
2990
import sys import argparse import subprocess from sklearn.neighbors import NearestNeighbors import numpy as np from regexDFAEquals import regex_equiv_from_raw def main(arguments): parser = argparse.ArgumentParser( description=__doc__, formatter_class=argparse.ArgumentDefaultsHelpFormatter) pars...
mit
2,719,777,218,254,576,600
33.37931
107
0.592642
false
yvaucher/bank-payment
account_direct_debit/models/payment_line.py
2
7320
# -*- coding: utf-8 -*- from openerp.osv import orm, fields from openerp import netsvc from openerp.tools.translate import _ class PaymentLine(orm.Model): _inherit = 'payment.line' def debit_storno(self, cr, uid, payment_line_id, amount, currency, storno_retry=True, context=None): ...
agpl-3.0
8,172,708,525,495,252,000
49.482759
79
0.544262
false
VisTrails/VisTrails
vistrails/packages/tensorflow/base.py
2
9926
############################################################################### ## ## Copyright (C) 2014-2016, New York University. ## Copyright (C) 2011-2014, NYU-Poly. ## Copyright (C) 2006-2011, University of Utah. ## All rights reserved. ## Contact: contact@vistrails.org ## ## This file is part of VisTrails. ## ## ...
bsd-3-clause
5,559,374,266,293,038,000
36.037313
79
0.584525
false
cheapjack/MemoryCraft
HelloTemperature5.py
1
3662
#!/usr/bin/python #Install the modules we need #from pyfirmata import Arduino, util, INPUT from mcpi import minecraft from mcpi import minecraftstuff from time import sleep import server import serial # Set up the connection to the Arduino/Shrimp # This may appear differently in Windows as COM0 or COM1 but in Unix li...
mit
-5,348,799,991,370,018,000
35.257426
163
0.722829
false
tysonclugg/django
django/contrib/gis/gdal/raster/band.py
12
8024
from ctypes import byref, c_double, c_int, c_void_p from django.contrib.gis.gdal.error import GDALException from django.contrib.gis.gdal.prototypes import raster as capi from django.contrib.gis.gdal.raster.base import GDALRasterBase from django.contrib.gis.shortcuts import numpy from django.utils.encoding import force...
bsd-3-clause
3,657,172,399,683,865,600
31.2249
100
0.580882
false
yokose-ks/edx-platform
common/djangoapps/student/firebase_token_generator.py
16
3431
''' Firebase - library to generate a token License: https://github.com/firebase/firebase-token-generator-python/blob/master/LICENSE Tweaked and Edited by @danielcebrianr and @lduarte1991 This library will take either objects or strings and use python's built-in encoding system as specified by RFC 3...
agpl-3.0
-141,993,413,047,504,930
33.656566
127
0.66657
false
with-git/tensorflow
tensorflow/python/ops/parsing_ops.py
4
49645
# 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
-1,496,799,710,853,547,500
41.723752
119
0.653822
false
ishay2b/tensorflow
tensorflow/python/ops/histogram_ops_test.py
71
2968
# 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
-1,804,547,402,525,981,200
36.1
80
0.632749
false
calhewitt/lucid-utils
lucid_utils/classification/end_detection.py
2
5414
# An algorithm to work out the number of end points of a 'long' cluster (beta, etc) in order to detect crossed or divergent tracks # Note: This is currently only accurate for clusters of radius > ~20 # TODO Develop a similar algorithm for shorter blobs # Author: Cal Hewitt import numpy as np def is_single_track(blob)...
mit
-6,095,883,016,788,638,000
44.881356
148
0.605652
false
woshialex/diagnose-heart
fitting_models.py
1
13596
from scipy.optimize import minimize; import numpy as np; from scipy import stats import itertools; import analysis; class BaseModel: def __init__(self): self.p = None; def set(self,p): self.p = p; class SexAgeModel(BaseModel): def __init__(self): self.p = np.array([[4.0,3,10.6,12,...
mit
-2,980,231,887,850,449,000
36.454545
154
0.461386
false
vrjuggler/maestro
maestro/daemon/plugins/services/reboot/grubconfig.py
2
13881
# Copyright (C) Infiscape Corporation 2006 import re import logging class GrubBootTarget: UNKNOWN = -1 LINUX = 0 WINDOWS = 1 FREEBSD = 2 # This matches the Linxu kernel version, the RPM revision, and any # additional text. # # Groups: # 1 - full kernel path (/boot/vmlinuz-... or /vml...
gpl-2.0
-7,353,712,225,808,360,000
30.910345
111
0.605576
false
mhogg/scipy
scipy/special/add_newdocs.py
11
70503
# Docstrings for generated ufuncs # # The syntax is designed to look like the function add_newdoc is being # called from numpy.lib, but in this file add_newdoc puts the # docstrings in a dictionary. This dictionary is used in # generate_ufuncs.py to generate the docstrings for the ufuncs in # scipy.special at the C lev...
bsd-3-clause
-5,916,435,615,003,109,000
20.216672
194
0.582429
false
sanitysoon/nbase-arc
smr/test/integrated/Conf.py
4
2058
# # Copyright 2015 Naver Corp. # # 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
-6,125,678,582,260,120,000
24.725
74
0.654519
false
xia2/xia2
src/xia2/cli/plot_multiplicity.py
1
12682
import json import sys import iotbx.phil from cctbx.miller.display import render_2d, scene from dials.util import Sorry from iotbx.gui_tools.reflections import get_array_description from iotbx.reflection_file_reader import any_reflection_file from scitbx.array_family import flex class MultiplicityViewPng(render_2d):...
bsd-3-clause
-8,879,024,635,849,080,000
33.091398
129
0.492746
false
ric2b/Vivaldi-browser
chromium/testing/scripts/run_chromedriver_tests.py
10
1880
#!/usr/bin/env python # Copyright 2018 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 chrome driver tests. This script attempts to emulate the contract of gtest-style tests invoked via recipes. The main contract ...
bsd-3-clause
-3,160,538,949,060,423,700
26.246377
78
0.717553
false
kasshyss/pynard
legacy/pynard.py
1
2386
#!/usr/bin/env python from flask import Flask, render_template, request import m_conf as conf import m_log as log import m_IO as io app = Flask(__name__) page_title = "Pynard" #Application start point @app.route('/') @app.route('/index/', methods=['GET', 'POST']) @app.route('/index.html/') @app.route('/home/') def i...
gpl-3.0
5,586,692,323,532,126,000
35.707692
189
0.654233
false
pombredanne/stdeb
stdeb/cli_runner.py
4
5411
from __future__ import print_function import sys, os, shutil, subprocess try: # python 2.x from ConfigParser import SafeConfigParser except ImportError as err: # python 3.x from configparser import SafeConfigParser from distutils.util import strtobool from distutils.fancy_getopt import FancyGetopt, tran...
mit
-5,088,382,721,770,560,000
34.366013
80
0.608575
false
WakelessDragon/learning-python
gettingStarted/t_office/readTxt2.py
1
3102
#!/usr/bin/env python # -*- coding: utf-8 -*- import codecs order_relation = [] with codecs.open(r'C:\Users\since\Downloads\20170209_task\order_relation.txt', 'r') as f: ln = 0 for line in f: ln += 1 if ln <= 1: continue arr = line.strip(' \t\n\r').split(" ") obj = {...
gpl-2.0
3,033,995,660,956,369,000
30.979381
126
0.530625
false
emersonsoftware/ansiblefork
lib/ansible/plugins/filter/core.py
9
16712
# (c) 2012, Jeroen Hoekx <jeroen@hoekx.be> # # 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....
gpl-3.0
7,307,018,940,142,525,000
28.736655
147
0.57725
false
dpendl00/headphones
lib/pygazelle/inbox.py
26
3948
class MailboxMessage(object): def __init__(self, api, message): self.id = message['convId'] self.conv = Conversation(api, self.id) self.subject = message['subject'] self.unread = message['unread'] self.sticky = message['sticky'] self.fwd_id = message['forwardedId'] ...
gpl-3.0
6,020,182,143,425,904,000
35.897196
105
0.578267
false
crmccreary/openerp_server
openerp/addons/stock/wizard/stock_change_standard_price.py
9
5671
# -*- 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
3,892,312,078,342,729,000
45.867769
154
0.611885
false
sekikn/incubator-airflow
airflow/migrations/versions/c8ffec048a3b_add_fields_to_dag.py
8
1395
# # 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
1,705,448,137,080,268,300
30.704545
81
0.739785
false
silvansky/pjsip_mod
tests/pjsua/scripts-sendto/171_timer_initiated_by_uas.py
3
1191
# $Id: 171_timer_initiated_by_uas.py 3307 2010-09-08 05:38:49Z nanang $ import inc_sip as sip import inc_sdp as sdp sdp = \ """ v=0 o=- 0 0 IN IP4 127.0.0.1 s=pjmedia c=IN IP4 127.0.0.1 t=0 0 m=audio 4000 RTP/AVP 0 101 a=rtpmap:0 PCMU/8000 a=sendrecv a=rtpmap:101 telephone-event/8000 a=fmtp:101 0-15 ""...
gpl-2.0
-3,742,569,806,358,724,600
31.083333
93
0.68094
false
spitfire88/upm
examples/python/grovewfs.py
7
2489
#!/usr/bin/python # Author: Zion Orent <zorent@ics.com> # Copyright (c) 2015 Intel Corporation. # # 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 limi...
mit
-5,607,194,514,976,063,000
36.149254
76
0.714343
false
gion86/awlsim
awlsim/core/operators.py
1
24016
# -*- coding: utf-8 -*- # # AWL simulator - operators # # Copyright 2012-2015 Michael Buesch <m@bues.ch> # # 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 # (...
gpl-2.0
-8,560,336,037,900,516,000
33.210826
86
0.677798
false
gramps-project/gramps
gramps/gen/plug/docbackend/__init__.py
10
1185
# # Gramps - a GTK+/GNOME based genealogy program # # Copyright (C) 2009 B. Malengier # # 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...
gpl-2.0
-5,276,227,395,151,894,000
38.5
79
0.770464
false
CompPhysics/MachineLearning
doc/Programs/ProjectsData/Project2_1.py
1
9043
# -*- coding: utf-8 -*- """ Created on Mon Feb 17 10:00:03 2020 @author: Bharat Mishra, Patricia Perez-Martin, Pinelopi Christodoulou """ import numpy as np import matplotlib.pyplot as plt from sklearn.model_selection import train_test_split from sklearn.datasets import load_breast_cancer from sklearn.li...
cc0-1.0
5,585,809,186,858,056,000
28.143333
112
0.665266
false
bearstech/modoboa
modoboa/admin/forms/account.py
1
21130
"""Forms related to accounts management.""" from __future__ import unicode_literals from collections import OrderedDict from functools import reduce from django import forms from django.core.urlresolvers import reverse from django.http import QueryDict from django.utils.translation import ugettext as _, ugettext_laz...
isc
-4,428,757,062,902,145,500
36.266314
79
0.567818
false
Frankkkkk/arctic
tests/unit/test_compression.py
1
1778
from mock import patch, Mock, sentinel, call from arctic._compression import compress, compress_array, decompress, decompress_array, enable_parallel_lz4 def test_compress(): assert len(compress(b'foobar')) > 0 def test_compress_LZ4(): cfn = Mock() with patch('arctic._compression.clz4.compress', cfn): ...
lgpl-2.1
-5,804,132,935,893,217,000
27.222222
107
0.669854
false
douban/dpark
docs/en/conf.py
2
9255
# -*- coding: utf-8 -*- # # DPark documentation build configuration file, created by # sphinx-quickstart on Mon Jan 25 17:28:47 2016. # # 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
2,472,581,576,041,837,600
31.024221
79
0.706105
false
ashang/calibre
src/calibre/gui2/convert/comic_input.py
14
1289
#!/usr/bin/env python2 # vim:fileencoding=UTF-8:ts=4:sw=4:sta:et:sts=4:ai from __future__ import with_statement __license__ = 'GPL v3' __copyright__ = '2009, Kovid Goyal <kovid@kovidgoyal.net>' __docformat__ = 'restructuredtext en' from calibre.gui2.convert.comic_input_ui import Ui_Form from calibre.gui2.convert i...
gpl-3.0
6,021,926,588,658,968,000
35.828571
79
0.596587
false
T-Tony-T/mainframe-env-simulator
zPE/base/core/IO_JES2.py
1
2606
# this is a simplification of the "Job Entry Subsystem - IO Component" # it is used to manage the SPOOL files from zPE.util import spool_encode from zPE.util.global_config import CONFIG_PATH, JCL, SP_DEFAULT_OUT_STEP import os import re import sqlite3 class JES_DB(object): @staticmethod def append(src, des...
bsd-3-clause
-3,982,466,559,243,623,000
23.819048
77
0.512663
false
factorlibre/odoomrp-wip
product_variants_no_automatic_creation/models/product_product.py
8
4841
# -*- coding: utf-8 -*- # © 2015 Oihane Crucelaegui - AvanzOSC # © 2016 Pedro M. Baeza <pedro.baeza@tecnativa.com> # License AGPL-3 - See http://www.gnu.org/licenses/agpl-3 from openerp import api, exceptions, fields, models, _ class ProductProduct(models.Model): _inherit = ['product.product', 'product.configura...
agpl-3.0
1,425,943,806,410,973,400
42.594595
79
0.585865
false
HKUST-SING/tensorflow
tensorflow/python/kernel_tests/metrics_test.py
9
139350
# 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
-8,894,845,595,615,712,000
37.188545
80
0.617022
false
regebro/tzlocal
tests/test_tzlocal.py
1
5185
import os import sys from datetime import datetime, timezone from pathlib import Path from unittest.mock import MagicMock, Mock import pytest import tzlocal.unix import tzlocal.utils if sys.version_info >= (3, 9): from zoneinfo import ZoneInfo, ZoneInfoNotFoundError else: from backports.zoneinfo import ZoneI...
mit
-6,251,496,927,820,954,000
31.006173
98
0.682353
false
InQuest/ThreatKB
app/models/c2ip.py
1
14333
import distutils import re from ipaddr import IPAddress, IPNetwork from sqlalchemy.event import listens_for from sqlalchemy.orm import Session import app from app import db, current_user, ENTITY_MAPPING, ACTIVITY_TYPE from app.geo_ip_helper import get_geo_for_ip from app.models.comments import Comments from app.model...
gpl-2.0
-3,743,784,552,797,139,500
42.831804
122
0.550897
false
ahuarte47/QGIS
python/plugins/processing/algs/gdal/gdalcalc.py
9
11704
# -*- coding: utf-8 -*- """ *************************************************************************** gdalcalc.py --------------------- Date : Janaury 2015 Copyright : (C) 2015 by Giovanni Manghi Email : giovanni dot manghi at naturalgis dot pt **********...
gpl-2.0
-6,716,286,052,499,562,000
42.509294
122
0.561176
false
SUTFutureCoder/intelligence_server
A_Imoto/jieba/__main__.py
4
1848
"""Jieba command line interface.""" import sys import jieba from argparse import ArgumentParser parser = ArgumentParser(usage="%s -m jieba [options] filename" % sys.executable, description="Jieba command line interface.", epilog="If no filename specified, use STDIN instead.") parser.add_argument("-d", "--delimiter", m...
gpl-2.0
8,288,706,801,230,907,000
39.173913
180
0.635281
false
lsanzdiaz/MITK-BiiG
Build/Tools/Python/renameClass.py
4
7545
#!/usr/bin/python # mitk c++ class rename script by Marco Nolden and Michael Mueller # # There are two ways to use this: # # 1. renameClass <dir> <oldClassName> <newClassName> # # 2. renameClass <dir> <csvFileOfClassNameReplaces> # # # Always backup your code before using this! It has only been tested on a few case...
bsd-3-clause
-2,524,685,303,388,429,300
30.049383
113
0.589529
false
osh/gnuradio
gr-qtgui/examples/pyqt_waterfall_f.py
58
6051
#!/usr/bin/env python # # Copyright 2012 Free Software Foundation, Inc. # # This file is part of GNU Radio # # GNU Radio 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, or (at your option) # ...
gpl-3.0
6,714,310,063,018,431,000
32.247253
83
0.630474
false