repo_name stringlengths 5 100 | path stringlengths 4 375 | copies stringclasses 991
values | size stringlengths 4 7 | content stringlengths 666 1M | license stringclasses 15
values |
|---|---|---|---|---|---|
darkoc/clowdflows | workflows/subgroup_discovery/SubgroupDiscovery/calcHull.py | 7 | 3323 | def calcRates(subgroups):
subgroups.TPR = []
subgroups.FPR = []
P = len(subgroups.targetClassRule.TP) * 1.0 # number of all positive examples as a float
N = len(subgroups.targetClassRule.FP) * 1.0 # number of all negative examples as a float
for rule in subgroups.rules:
... | gpl-3.0 |
alsrgv/tensorflow | tensorflow/python/framework/composite_tensor.py | 1 | 6660 | # Copyright 2019 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 |
LuckDragon82/demo | boilerplate/external/babel/core.py | 67 | 26942 | # -*- coding: utf-8 -*-
#
# Copyright (C) 2007 Edgewall Software
# All rights reserved.
#
# This software is licensed as described in the file COPYING, which
# you should have received as part of this distribution. The terms
# are also available at http://babel.edgewall.org/wiki/License.
#
# This software cons... | lgpl-3.0 |
Aerotenna/Firmware | integrationtests/python_src/px4_it/mavros/mavros_test_common.py | 4 | 17211 | #!/usr/bin/env python2
from __future__ import division
import unittest
import rospy
import math
from geometry_msgs.msg import PoseStamped
from mavros_msgs.msg import Altitude, ExtendedState, HomePosition, State, \
WaypointList
from mavros_msgs.srv import CommandBool, ParamGet, SetMode, Wayp... | bsd-3-clause |
murfz/Sick-Beard | lib/guessit/fileutils.py | 41 | 2942 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# GuessIt - A library for guessing information from filenames
# Copyright (c) 2011 Nicolas Wack <wackou@gmail.com>
#
# GuessIt is free software; you can redistribute it and/or modify it under
# the terms of the Lesser GNU General Public License as published by
# the Free ... | gpl-3.0 |
shaolinfry/litecoin | qa/rpc-tests/bipdersig-p2p.py | 49 | 6866 | #!/usr/bin/env python3
# Copyright (c) 2015-2016 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
from test_framework.test_framework import ComparisonTestFramework
from test_framework.util import *
from ... | mit |
ryano144/intellij-community | python/helpers/epydoc/markup/doctest.py | 90 | 13069 | #
# doctest.py: Syntax Highlighting for doctest blocks
# Edward Loper
#
# Created [06/28/03 02:52 AM]
# $Id: restructuredtext.py 1210 2006-04-10 13:25:50Z edloper $
#
"""
Syntax highlighting for doctest blocks. This module defines two
functions, L{doctest_to_html()} and L{doctest_to_latex()}, which can
be used to per... | apache-2.0 |
takaaptech/sky_engine | sky/tools/webkitpy/layout_tests/breakpad/dump_reader_win_unittest.py | 59 | 3547 | # 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 |
RussianCraft/rcse | node_modules/npm/node_modules/node-gyp/gyp/tools/pretty_sln.py | 1831 | 5099 | #!/usr/bin/env python
# Copyright (c) 2012 Google Inc. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Prints the information in a sln file in a diffable way.
It first outputs each projects in alphabetical order with their
dependenci... | gpl-3.0 |
eastlhu/zulip | zerver/migrations/0002_django_1_8.py | 125 | 2229 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
import django.contrib.auth.models
class Migration(migrations.Migration):
dependencies = [
('zerver', '0001_initial'),
]
operations = [
migrations.AlterModelManagers(
name... | apache-2.0 |
helinb/Tickeys-linux | tickeys/kivy/input/postproc/retaintouch.py | 80 | 3224 | '''
Retain Touch
============
Reuse touch to counter lost finger behavior
'''
__all__ = ('InputPostprocRetainTouch', )
from kivy.config import Config
from kivy.vector import Vector
import time
class InputPostprocRetainTouch(object):
'''
InputPostprocRetainTouch is a post-processor to delay the 'up' event o... | mit |
brian-yang/mozillians | mozillians/mozspaces/models.py | 13 | 2028 | import os
import uuid
from django.conf import settings
from django.contrib.auth.models import User
from django.db import models
from product_details import product_details
from pytz import common_timezones
from sorl.thumbnail import ImageField
COUNTRIES = product_details.get_regions('en-US').items()
COUNTRIES = sort... | bsd-3-clause |
srznew/heat | heat/tests/test_support.py | 13 | 3769 | #
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# ... | apache-2.0 |
sbg/sevenbridges-python | sevenbridges/meta/comp_mutable_dict.py | 1 | 1715 | # noinspection PyProtectedMember,PyUnresolvedReferences
class CompoundMutableDict(dict):
"""
Resource used for mutable compound dictionaries.
"""
# noinspection PyMissingConstructor
def __init__(self, **kwargs):
self._parent = kwargs.pop('_parent')
self._api = kwargs.pop('api')
... | apache-2.0 |
audax/kll | kll.py | 1 | 26244 | #!/usr/bin/env python3
# KLL Compiler
# Keyboard Layout Langauge
#
# Copyright (C) 2014-2015 by Jacob Alexander
#
# This file 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... | gpl-3.0 |
santoshphilip/eppy | tests/test_simpleread.py | 1 | 4640 | """py.test for simpleread.py"""
# =======================================================================
# Distributed under the MIT License.
# (See accompanying file LICENSE or copy at
# http://opensource.org/licenses/MIT)
# =======================================================================
from __future__ im... | mit |
ChandraAddala/blueflood | contrib/grinder/scripts/annotationsingest.py | 1 | 2675 | import random
try:
from com.xhaus.jyson import JysonCodec as json
except ImportError:
import json
from utils import *
from net.grinder.script import Test
from net.grinder.plugin.http import HTTPRequest
class AnnotationsIngestThread(AbstractThread):
# The list of metric numbers for all threads in this wor... | apache-2.0 |
isoriss123/namebench | nb_third_party/dns/exception.py | 250 | 1319 | # Copyright (C) 2003-2007, 2009, 2010 Nominum, Inc.
#
# Permission to use, copy, modify, and distribute this software and its
# documentation for any purpose with or without fee is hereby granted,
# provided that the above copyright notice and this permission notice
# appear in all copies.
#
# THE SOFTWARE IS PROVIDED ... | apache-2.0 |
DaniilLeksin/gc | wx/tools/Editra/src/extern/pygments/lexers/__init__.py | 72 | 7269 | # -*- coding: utf-8 -*-
"""
pygments.lexers
~~~~~~~~~~~~~~~
Pygments lexers.
:copyright: Copyright 2006-2010 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
import sys
import types
import fnmatch
from os.path import basename
from pygments.lexers._mapping import LEX... | apache-2.0 |
blackzw/openwrt_sdk_dev1 | staging_dir/target-mips_r2_uClibc-0.9.33.2/usr/lib/python2.7/idlelib/Bindings.py | 130 | 3295 | """Define the menu contents, hotkeys, and event bindings.
There is additional configuration information in the EditorWindow class (and
subclasses): the menus are created there based on the menu_specs (class)
variable, and menus not created are silently skipped in the code here. This
makes it possible, for example, to... | gpl-2.0 |
campbe13/openhatch | vendor/packages/django-tastypie/tastypie/paginator.py | 46 | 7203 | from __future__ import unicode_literals
from django.conf import settings
from django.utils import six
from tastypie.exceptions import BadRequest
try:
from urllib.parse import urlencode
except ImportError:
from urllib import urlencode
class Paginator(object):
"""
Limits result sets down to sane amou... | agpl-3.0 |
tizz98/lightblue-0.4 | src/series60/_obexcommon.py | 130 | 18262 | # Copyright (c) 2009 Bea Lam. All rights reserved.
#
# This file is part of LightBlue.
#
# LightBlue 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 l... | gpl-3.0 |
anaselli/libyui | libyui-bindings/swig/python/examples/widgets.py | 5 | 10905 | #coding:utf-8
#############################################################################
#
# widgets.py - Demonstration of widgets available in python-libyui
#
# License: GPLv2
# Author: Jan-Simon Möller, dl9pf@gmx.de
#############################################################################
# ensure we're us... | lgpl-3.0 |
Arable/evepod | lib/python2.7/site-packages/newrelic-2.12.0.10/newrelic/core/function_node.py | 2 | 1687 | from collections import namedtuple
import newrelic.core.trace_node
from newrelic.core.metric import TimeMetric
_FunctionNode = namedtuple('_FunctionNode',
['group', 'name', 'children', 'start_time', 'end_time',
'duration', 'exclusive', 'label', 'params'])
class FunctionNode(_FunctionNode):
def ... | apache-2.0 |
kisel/trex-core | scripts/automation/trex_control_plane/server/outer_packages.py | 1 | 1560 | #!/router/bin/python
import sys
import os
python_ver = 'python%s' % sys.version_info.major
ucs_ver = 'ucs2' if sys.maxunicode == 65535 else 'ucs4'
CURRENT_PATH = os.path.dirname(os.path.realpath(__file__))
ROOT_PATH = os.path.abspath(os.path.join(CURRENT_PATH, os.pardir)) # path... | apache-2.0 |
jtrobec/pants | src/python/pants/task/changed_file_task_mixin.py | 2 | 6080 | # coding=utf-8
# Copyright 2014 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
from __future__ import (absolute_import, division, generators, nested_scopes, print_function,
unicode_literals, with_statement)
import re
from pant... | apache-2.0 |
pkill-nine/qutebrowser | tests/unit/commands/test_cmdutils.py | 2 | 15695 | # vim: ft=python fileencoding=utf-8 sts=4 sw=4 et:
# Copyright 2015-2017 Florian Bruhin (The Compiler) <mail@qutebrowser.org>
#
# This file is part of qutebrowser.
#
# qutebrowser 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 S... | gpl-3.0 |
mtconley/turntable | test/lib/python2.7/site-packages/numpy/__config__.py | 6 | 1421 | # This file is generated by /private/var/folders/xc/0j24hj7d45dcj9_r_sb1w3jdnh248k/T/pip-build-g429nk/numpy/-c
# It contains system_info results at the time of building this package.
__all__ = ["get_info","show"]
atlas_3_10_blas_info={}
atlas_3_10_blas_threads_info={}
atlas_threads_info={}
blas_opt_info={'extra_link_a... | mit |
Open-Transport/synthese | packages/ineo_terminus_tl/src/girouette.py | 1 | 6278 | #!/usr/bin/python2
import datetime
import re
from HTMLParser import HTMLParser
import synthese
try:
from lxml import etree
except ImportError:
print("la lib lxml n'est pas disponible")
# Custom subclass of HTMLParser that extracts the lines of text from a HTML document
class HTMLTextExtractor(HTMLParser):
def... | gpl-2.0 |
gavin-feng/odoo | addons/l10n_vn/__init__.py | 425 | 1067 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# This module is Copyright (c) 2009-2013 General Solutions (http://gscom.vn) All Rights Reserved.
#
# This program is free software: you can redistribute it and/or... | agpl-3.0 |
leiferikb/bitpop | build/scripts/slave/swarming/swarming_run_shim.py | 1 | 11828 | #!/usr/bin/env python
# Copyright 2014 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.
"""Drives tests on Swarming. Both trigger and collect results.
This is the shim that is called through buildbot.
"""
import logging
i... | gpl-3.0 |
weka-io/boto | boto/opsworks/layer1.py | 132 | 129869 | # Copyright (c) 2014 Amazon.com, Inc. or its affiliates. All Rights Reserved
#
# 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 ... | mit |
htautau/hhana | mva/plotting/scatter.py | 5 | 13001 |
def draw_scatter(fields,
category,
region,
output_name,
backgrounds,
signals=None,
data=None,
signal_scale=1.,
signal_colors=cm.spring,
classifier=None,
... | gpl-3.0 |
davidbgk/udata | udata/tests/test_linkchecker.py | 1 | 8228 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
import mock
from datetime import datetime, timedelta
from udata.tests import TestCase
from udata.core.dataset.factories import DatasetFactory, ResourceFactory
from udata.linkchecker.checker import check_resource
class LinkcheckerTestSettings():
LIN... | agpl-3.0 |
vishnumani2009/OpenSource-Open-Ended-Statistical-toolkit | FRONTEND/table.py | 12 | 2437 | from PyQt4 import QtGui, QtCore
from PyQt4.QtCore import Qt
class Table(QtGui.QDialog):
def __init__(self,parent = None):
QtGui.QDialog.__init__(self, parent)
self.parent = parent
self.initUI()
def initUI(self):
# Rows
rowsLabel = QtGui.QLabel("Rows: ",self... | gpl-3.0 |
yangleo/cloud-github | openstack_dashboard/dashboards/identity/users/tests.py | 2 | 38692 | # Copyright 2012 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# All Rights Reserved.
#
# 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... | apache-2.0 |
hailinzeng/infer | infer/lib/capture/javac.py | 19 | 1176 | # Copyright (c) 2015 - present Facebook, Inc.
# All rights reserved.
#
# This source code is licensed under the BSD style license found in the
# LICENSE file in the root directory of this source tree. An additional grant
# of patent rights can be found in the PATENTS file in the same directory.
import os
import subpro... | bsd-3-clause |
devdelay/home-assistant | homeassistant/components/sensor/cpuspeed.py | 11 | 1969 | """
Support for displaying the current CPU speed.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/sensor.cpuspeed/
"""
import logging
from homeassistant.helpers.entity import Entity
REQUIREMENTS = ['py-cpuinfo==0.2.3']
_LOGGER = logging.getLogger(__nam... | mit |
Jusedawg/SickRage | lib/requests/packages/chardet/cp949prober.py | 2801 | 1782 | ######################## BEGIN LICENSE BLOCK ########################
# The Original Code is mozilla.org 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 Rights Reserved.
#
# Con... | gpl-3.0 |
vathpela/blivet | tests/vmtests/runvmtests.py | 2 | 6803 | import argparse
import libvirt
import paramiko
import sys
import time
from contextlib import contextmanager
TESTS = ["tests.vmtests.blivet_reset_vmtest.LVMTestCase",
"tests.vmtests.blivet_reset_vmtest.LVMSnapShotTestCase",
"tests.vmtests.blivet_reset_vmtest.LVMThinpTestCase",
"tests.vmtests... | gpl-2.0 |
HEG-Arc/Appagoo | appagoo/allauth/socialaccount/providers/windowslive/views.py | 65 | 1498 | from __future__ import unicode_literals
import requests
from allauth.socialaccount.providers.oauth2.views import (OAuth2Adapter,
OAuth2LoginView,
OAuth2CallbackView)
from .provider import WindowsLiveProv... | bsd-3-clause |
Anonymous-X6/django | django/contrib/postgres/forms/hstore.py | 313 | 1484 | import json
from django import forms
from django.core.exceptions import ValidationError
from django.utils import six
from django.utils.translation import ugettext_lazy as _
__all__ = ['HStoreField']
class HStoreField(forms.CharField):
"""A field for HStore data which accepts JSON input."""
widget = forms.Te... | bsd-3-clause |
squishbug/DataScienceProgramming | DataScienceProgramming/Examples/top_hashtags.py | 3 | 1098 | #!/usr/bin/env python
import atexit
import os
import platform
import sys
os.environ["SPARK_HOME"] = '/usr/hdp/2.4.2.0-258/spark'
spark_home = os.environ.get('SPARK_HOME', None)
if not spark_home:
raise ValueError('SPARK_HOME environment variable is not set')
sys.path.insert(0, os.path.join(spark_home, 'python'))
... | cc0-1.0 |
maas/maas | src/metadataserver/builtin_scripts/testing_scripts/fio.py | 1 | 6765 | #!/usr/bin/env python3
#
# fio - Run fio on supplied drive.
#
# Author: Newell Jensen <newell.jensen@canonical.com>
# Lee Trager <lee.trager@canonical.com>
#
# Copyright (C) 2017-2020 Canonical
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero Genera... | agpl-3.0 |
elopezga/ErrorRate | ivi/tektronix/tektronixAWG2000.py | 6 | 23133 | """
Python Interchangeable Virtual Instrument Library
Copyright (c) 2012-2014 Alex Forencich
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... | mit |
mvo5/snapcraft | snapcraft/internal/build_providers/errors.py | 1 | 8705 | # -*- Mode:Python; indent-tabs-mode:nil; tab-width:4 -*-
#
# Copyright (C) 2018-2019 Canonical Ltd
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 3 as
# published by the Free Software Foundation.
#
# This program is distributed in ... | gpl-3.0 |
vadimtk/chrome4sdp | tools/telemetry/third_party/gsutilz/gslib/__main__.py | 12 | 26565 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright 2013 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-... | bsd-3-clause |
defionscode/ansible | lib/ansible/modules/cloud/openstack/os_floating_ip.py | 26 | 9785 | #!/usr/bin/python
# Copyright: (c) 2015, Hewlett-Packard Development Company, L.P.
# 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 |
jcarreiro/jmc-python | imp/dice.py | 1 | 1405 | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import io
import string
import random
# Simple recursive descent parser for dice rolls, e.g. '3d6+1d8+4'.
#
# roll := die {('+' | '-') die} ('+' | '-') modifier
# di... | mit |
nacc/autotest | mirror/source.py | 6 | 7099 | # Copyright 2009 Google Inc. Released under the GPL v2
import os, re, time, urllib2, urlparse, HTMLParser
from autotest.mirror import database
from autotest.client.shared import utils
class source(object):
"""
Abstract Base Class for the source classes.
"""
def __init__(self, database):
self... | gpl-2.0 |
orlenko/bccf | src/mezzanine/twitter/templatetags/twitter_tags.py | 3 | 2015 |
from collections import defaultdict
from mezzanine.conf import settings
from mezzanine.twitter import (QUERY_TYPE_USER, QUERY_TYPE_LIST,
QUERY_TYPE_SEARCH)
from mezzanine.twitter.models import Tweet, TwitterQueryException
from mezzanine import template
register = template.Library()
... | unlicense |
drawks/ansible | lib/ansible/modules/cloud/google/gcp_compute_ssl_policy.py | 12 | 13526 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright (C) 2017 Google
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
# ----------------------------------------------------------------------------
#
# *** AUTO GENERATED CODE *** AUTO GENERATED CODE ***
#
... | gpl-3.0 |
disqus/django-old | tests/regressiontests/string_lookup/models.py | 92 | 1199 | # -*- coding: utf-8 -*-
from django.db import models
class Foo(models.Model):
name = models.CharField(max_length=50)
friend = models.CharField(max_length=50, blank=True)
def __unicode__(self):
return "Foo %s" % self.name
class Bar(models.Model):
name = models.CharField(max_length=50)
norm... | bsd-3-clause |
wdv4758h/ZipPy | lib-python/3/xml/dom/expatbuilder.py | 51 | 36364 | """Facility to use the Expat parser to load a minidom instance
from a string or file.
This avoids all the overhead of SAX and pulldom to gain performance.
"""
# Warning!
#
# This module is tightly bound to the implementation details of the
# minidom DOM and can't be used with other DOM implementations. This
# is due... | bsd-3-clause |
JingJunYin/tensorflow | tensorflow/contrib/kfac/python/ops/op_queue.py | 23 | 2436 | # Copyright 2017 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 |
tangjonathan/HKQuiz | node_modules/pryjs/node_modules/pygmentize-bundled/vendor/pygments/pygments/formatters/rtf.py | 47 | 5058 | # -*- coding: utf-8 -*-
"""
pygments.formatters.rtf
~~~~~~~~~~~~~~~~~~~~~~~
A formatter that generates RTF files.
:copyright: Copyright 2006-2014 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
from pygments.formatter import Formatter
from pygments.util import get_i... | mit |
nhicher/ansible | test/units/module_utils/facts/test_collector.py | 78 | 26241 | # This file is part of Ansible
# -*- coding: utf-8 -*-
#
#
# 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 dis... | gpl-3.0 |
caseylucas/ansible-modules-core | cloud/amazon/route53.py | 40 | 22225 | #!/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 distributed... | gpl-3.0 |
passalis/sef | sef_dr/classification.py | 1 | 1360 | # License: MIT License https://github.com/passalis/sef/blob/master/LICENSE.txt
from __future__ import absolute_import, division, print_function, unicode_literals
from sklearn import svm
from sklearn.model_selection import GridSearchCV
from sklearn.neighbors import NearestCentroid
from sklearn.preprocessing import MinM... | mit |
repotvsupertuga/tvsupertuga.repository | script.module.future/libs/past/translation/__init__.py | 61 | 18459 | # -*- coding: utf-8 -*-
"""
past.translation
==================
The ``past.translation`` package provides an import hook for Python 3 which
transparently runs ``futurize`` fixers over Python 2 code on import to convert
print statements into functions, etc.
It is intended to assist users in migrating to Python 3.x eve... | gpl-2.0 |
bo01ean/Stino | stino/pyarduino/arduino_target_board.py | 14 | 4683 | #!/usr/bin/env python
#-*- coding: utf-8 -*-
# 1. Copyright
# 2. Lisence
# 3. Author
"""
Documents
"""
from __future__ import absolute_import
from __future__ import print_function
from __future__ import division
from __future__ import unicode_literals
from . import base
class TargetBoardInfo(object):
def __in... | mit |
robdennis/sideboard | tests/plugins/different_versions/rdflib3_0_0/env/lib/python2.7/site-packages/rdflib/plugins/parsers/ntriples.py | 7 | 6700 | #!/usr/bin/env python
__doc__="""
N-Triples Parser
License: GPL 2, W3C, BSD, or MIT
Author: Sean B. Palmer, inamidst.com
Documentation: http://inamidst.com/proj/rdf/ntriples-doc
Command line usage::
./ntriples.py <URI> - parses URI as N-Triples
./ntriples.py --help - prints out this help message
# @@ fu... | bsd-3-clause |
M4sse/chromium.src | tools/memory_inspector/memory_inspector/core/native_heap_unittest.py | 89 | 6402 | # Copyright 2014 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.
"""
The test scenario is as follows:
VA space: |0 |4k |8k |12k |16k |20k ... |64k |65k |66k
Mmaps: [ anon 1 ][anon 2] [a... | bsd-3-clause |
search5/nanumlectures | lib/oauthlib/oauth2/rfc6749/endpoints/resource.py | 98 | 3316 | # -*- coding: utf-8 -*-
"""
oauthlib.oauth2.rfc6749
~~~~~~~~~~~~~~~~~~~~~~~
This module is an implementation of various logic needed
for consuming and providing OAuth 2.0 RFC6749.
"""
from __future__ import absolute_import, unicode_literals
import logging
from oauthlib.common import Request
from .base import BaseEn... | apache-2.0 |
Pan0ram1x/bitnodes | crawl.py | 2 | 13691 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# crawl.py - Greenlets-based Bitcoin network crawler.
#
# Copyright (c) Addy Yeow Chin Heng <ayeowch@gmail.com>
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
# "Software"), to de... | mit |
topxiaoke/myedx | lms/djangoapps/dashboard/views.py | 23 | 3191 | from django.http import Http404
from edxmako.shortcuts import render_to_response
from django.db import connection
from student.models import CourseEnrollment
from django.contrib.auth.models import User
def dictfetchall(cursor):
'''Returns a list of all rows from a cursor as a column: result dict.
Borrowed fr... | agpl-3.0 |
J861449197/edx-platform | common/test/acceptance/pages/lms/teams.py | 5 | 16012 | # -*- coding: utf-8 -*-
"""
Teams pages.
"""
from .course_page import CoursePage
from .discussion import InlineDiscussionPage
from ..common.paging import PaginatedUIMixin
from ...pages.studio.utils import confirm_prompt
from .fields import FieldsMixin
TOPIC_CARD_CSS = 'div.wrapper-card-core'
CARD_TITLE_CSS = 'h3.ca... | agpl-3.0 |
onceuponatimeforever/oh-mainline | vendor/packages/requests/requests/packages/chardet/euckrprober.py | 2931 | 1675 | ######################## BEGIN LICENSE BLOCK ########################
# The Original Code is mozilla.org 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 Rights Reserved.
#
# Con... | agpl-3.0 |
mick-d/nipype | nipype/algorithms/tests/test_auto_TCompCor.py | 1 | 1551 | # AUTO-GENERATED by tools/checkspecs.py - DO NOT EDIT
from __future__ import unicode_literals
from ..confounds import TCompCor
def test_TCompCor_inputs():
input_map = dict(components_file=dict(usedefault=True,
),
header_prefix=dict(),
high_pass_cutoff=dict(usedefault=True,
),
ignore_exception=... | bsd-3-clause |
denisff/python-for-android | python3-alpha/python3-src/Lib/lib2to3/pgen2/grammar.py | 54 | 5379 | # Copyright 2004-2005 Elemental Security, Inc. All Rights Reserved.
# Licensed to PSF under a Contributor Agreement.
"""This module defines the data structures used to represent a grammar.
These are a bit arcane because they are derived from the data
structures used by Python's 'pgen' parser generator.
There's also ... | apache-2.0 |
bbedward/ZenKernel_Angler | tools/perf/util/setup.py | 2079 | 1438 | #!/usr/bin/python2
from distutils.core import setup, Extension
from os import getenv
from distutils.command.build_ext import build_ext as _build_ext
from distutils.command.install_lib import install_lib as _install_lib
class build_ext(_build_ext):
def finalize_options(self):
_build_ext.finalize_optio... | gpl-2.0 |
chrishas35/django-travis-ci | django/views/decorators/http.py | 97 | 7121 | """
Decorators for views based on HTTP headers.
"""
from calendar import timegm
from functools import wraps
from django.utils.decorators import decorator_from_middleware, available_attrs
from django.utils.http import http_date, parse_http_date_safe, parse_etags, quote_etag
from django.utils.log import getLogger
from ... | bsd-3-clause |
brython-dev/brython | www/src/Lib/test/test_code.py | 2 | 12718 | """This module includes tests of the code object representation.
>>> def f(x):
... def g(y):
... return x + y
... return g
...
>>> dump(f.__code__)
name: f
argcount: 1
posonlyargcount: 0
kwonlyargcount: 0
names: ()
varnames: ('x', 'g')
cellvars: ('x',)
freevars: ()
nlocals: 2
flags: 3
consts: ('None',... | bsd-3-clause |
Transkribus/TranskribusDU | TranskribusDU/gcn/gcn_models.py | 1 | 106471 | # -*- coding: utf-8 -*-
"""
@author: Stéphane Clinchant
"""
import math
import random
import warnings
import numpy as np
import tensorflow as tf
try:
tf.train.AdamOptimizer
except AttributeError:
import tensorflow.compat.v1 as tf
tf.disable_v2_behavior()
import sklearn.metrics
#TODO Clean this
# Animesh ... | bsd-3-clause |
Mariaanisimova/pythonintask | PINp/2014/Chernov_M_S/task_4_27.py | 1 | 1532 | # Задание 4. Вариант 27.
# Напишите программу, которая выводит имя, под которым скрывается Доменико
# Теотокопули. Дополнительно необходимо вывести область интересов указанной
# личности, место рождения, годы рождения и смерти (если человек умер), вычислить
# возраст на данный момент (или момент смерти). Для хранения в... | apache-2.0 |
geggo/pyface | docs/source/sphinxext/refactordoc/function_doc.py | 6 | 3097 | # -*- coding: UTF-8 -*-
#------------------------------------------------------------------------------
# file: function_doc.py
# License: LICENSE.TXT
# Author: Ioannis Tziakos
#
# Copyright (c) 2011, Enthought, Inc.
# All rights reserved.
#--------------------------------------------------------------------------... | bsd-3-clause |
malmiron/incubator-airflow | tests/plugins/test_plugin.py | 2 | 3720 | # -*- coding: utf-8 -*-
#
# 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
#... | apache-2.0 |
scholarly/pynacl | src/nacl/signing.py | 1 | 5489 | # Copyright 2013 Donald Stufft and individual contributors
#
# 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 |
patilsangram/erpnext | erpnext/accounts/doctype/budget/test_budget.py | 9 | 11765 | # -*- coding: utf-8 -*-
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# See license.txt
from __future__ import unicode_literals
import frappe
import unittest
from frappe.utils import nowdate
from erpnext.accounts.utils import get_fiscal_year
from erpnext.buying.doctype.purchase_order.test_purcha... | gpl-3.0 |
fritsvanveen/QGIS | python/ext-libs/pygments/lexers/__init__.py | 35 | 8743 | # -*- coding: utf-8 -*-
"""
pygments.lexers
~~~~~~~~~~~~~~~
Pygments lexers.
:copyright: Copyright 2006-2015 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
import re
import sys
import types
import fnmatch
from os.path import basename
from pygments.lexers._mapping ... | gpl-2.0 |
nkrinner/nova | nova/api/openstack/compute/plugins/v3/suspend_server.py | 15 | 3308 | # Copyright 2013 IBM 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 w... | apache-2.0 |
Microsoft/PTVS | Python/Product/Miniconda/Miniconda3-x64/Lib/site-packages/pip/_vendor/urllib3/packages/ssl_match_hostname/_implementation.py | 23 | 5719 | """The match_hostname() function from Python 3.3.3, essential when using SSL."""
# Note: This file is under the PSF license as the code comes from the python
# stdlib. http://docs.python.org/3/license.html
import re
import sys
# ipaddress has been backported to 2.6+ in pypi. If it is installed on the
# system, us... | apache-2.0 |
pkdevbox/stratos | components/org.apache.stratos.python.cartridge.agent/src/main/python/cartridge.agent/cartridge.agent/modules/databridge/thrift/thrift/server/THttpServer.py | 19 | 3135 | #
# 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 u... | apache-2.0 |
cmlasu/smm_gem5 | ext/ply/example/ansic/clex.py | 164 | 3931 | # ----------------------------------------------------------------------
# clex.py
#
# A lexer for ANSI C.
# ----------------------------------------------------------------------
import sys
sys.path.insert(0,"../..")
import ply.lex as lex
# Reserved words
reserved = (
'AUTO', 'BREAK', 'CASE', 'CHAR', 'CONST', '... | bsd-3-clause |
Edu-Glez/Bank_sentiment_analysis | env/lib/python3.6/site-packages/pygments/styles/xcode.py | 31 | 1501 | # -*- coding: utf-8 -*-
"""
pygments.styles.xcode
~~~~~~~~~~~~~~~~~~~~~
Style similar to the `Xcode` default theme.
:copyright: Copyright 2006-2017 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
from pygments.style import Style
from pygments.token import Keyword, N... | apache-2.0 |
boudewijnrempt/breakpad | src/third_party/protobuf/protobuf/python/google/protobuf/service.py | 590 | 9131 | # Protocol Buffers - Google's data interchange format
# Copyright 2008 Google Inc. All rights reserved.
# http://code.google.com/p/protobuf/
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions o... | bsd-3-clause |
kozyarchuk/NCT-workers | tests/reactive_test.py | 1 | 9204 | import unittest
from nct.utils.reactive.field import Field
from nct.utils.reactive.field_factory import FieldFactory
from decimal import Decimal
import datetime
from nct.utils.reactive.bound_field import BoundField, InvalidModelError,\
InvalidFieldDefinitionlError, DataTypeConversionError
from datetime import date
... | gpl-2.0 |
jerpat/csmake | csmake-providers/CsmakeModules/GenerateGitChangeLog.py | 1 | 12101 | # <copyright>
# (c) Copyright 2017 Hewlett Packard Enterprise Development LP
#
# 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 ve... | gpl-3.0 |
solderinskater/Push-2010 | maemo/gui/proto/tricksimulator.py | 1 | 1362 | _all_=["TrickSimulator"]
# -*- coding: UTF-8 -*-
import sys
import sip
import time
import dbus
from traceback import print_exc
import random
from dbus.mainloop.glib import DBusGMainLoop
import gobject
#iface.RaiseException(reply_handler=handle_raise_reply,
# error_handler=handle_raise_error)
def replay():
... | gpl-3.0 |
grap/OpenUpgrade | addons/hr_timesheet_invoice/wizard/hr_timesheet_invoice_create.py | 337 | 3655 | # -*- 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 |
squirrel2038/thearchdruidreport-archive | check-wayback-machine.py | 1 | 1674 | #!/usr/bin/env python3
from datetime import datetime, timezone, timedelta
import json
import re
import sys
import traceback
import feeds
import util
import web_cache
BLOG_POSTS = json.loads(util.get_file_text("blog.json"))
for post in BLOG_POSTS:
page_count = (len(post["comments"]) + 199) // 200
print("DEBU... | mit |
lokeshjindal15/pd-gem5 | src/cpu/DummyChecker.py | 69 | 2259 | # Copyright (c) 2010-2011 ARM Limited
# All rights reserved
#
# The license below extends only to copyright in the software and shall
# not be construed as granting a license to any other intellectual
# property including but not limited to intellectual property relating
# to a hardware implementation of the functional... | bsd-3-clause |
JianyuWang/nova | nova/scheduler/filters/metrics_filter.py | 16 | 2007 | # Copyright (c) 2014 Intel, 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 ... | apache-2.0 |
duongbaoduy/gtools | third_party/coverage/__init__.py | 208 | 4505 | """Code coverage measurement for Python.
Ned Batchelder
http://nedbatchelder.com/code/coverage
"""
from coverage.version import __version__, __url__
from coverage.control import coverage, process_startup
from coverage.data import CoverageData
from coverage.cmdline import main, CoverageScript
from coverage.misc impo... | bsd-3-clause |
MridulS/sympy | sympy/__init__.py | 19 | 2176 | """SymPy is a Python library for symbolic mathematics. It aims to become a
full-featured computer algebra system (CAS) while keeping the code as
simple as possible in order to be comprehensible and easily extensible.
SymPy is written entirely in Python and does not require any external
libraries, except optionally for ... | bsd-3-clause |
MikkCZ/kitsune | kitsune/questions/migrations/0003_auto_20150430_1304.py | 20 | 4834 | # -*- coding: utf-8 -*-
"""
Update list of locale choices in the `question.locale` and `questionlocale.locale` fields.
"""
from __future__ import unicode_literals
from django.db import models, migrations
import kitsune.sumo.models
class Migration(migrations.Migration):
dependencies = [
('questions', '0... | bsd-3-clause |
kaoru6/asterisk | rest-api-templates/odict.py | 14 | 8918 | # Downloaded from http://code.activestate.com/recipes/576693/
# Licensed under the MIT License
# Backport of OrderedDict() class that runs on Python 2.4, 2.5, 2.6, 2.7 and pypy.
# Passes Python2.7's test suite and incorporates all the latest updates.
try:
from thread import get_ident as _get_ident
except ImportEr... | gpl-2.0 |
mkreider/cocotb2 | cocotb/memdebug.py | 6 | 1833 | ''' Copyright (c) 2013 Potential Ventures Ltd
Copyright (c) 2013 SolarFlare Communications 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 c... | bsd-3-clause |
nathanial/lettuce | tests/integration/lib/Django-1.2.5/django/contrib/admin/templatetags/admin_modify.py | 157 | 1913 | from django import template
register = template.Library()
def prepopulated_fields_js(context):
"""
Creates a list of prepopulated_fields that should render Javascript for
the prepopulated fields for both the admin form and inlines.
"""
prepopulated_fields = []
if context['add'] and 'adminform'... | gpl-3.0 |
ge0rgi/cinder | cinder/volume/drivers/hpe/hpe_3par_common.py | 1 | 164598 | # (c) Copyright 2012-2016 Hewlett Packard Enterprise Development LP
# 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/lic... | apache-2.0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.