repo_name stringlengths 6 100 | path stringlengths 4 294 | copies stringlengths 1 5 | size stringlengths 4 6 | content stringlengths 606 896k | license stringclasses 15
values |
|---|---|---|---|---|---|
dendory/chartjs | sample3.py | 1 | 5887 | # This script parses the CSV files gathered from the Canadian Weather Service and makes charts
import chartjs
import csv
# We will cover these years
startyear = 1981
endyear = 2012
# We will make charts for 3 major Canadian cities
cities = [
{'name': "Montreal", 'fillColor': "rgba(100,50,200,0.25)", 'strok... | mit |
zengenti/ansible | lib/ansible/utils/module_docs_fragments/vca.py | 122 | 2636 | # (c) 2016, Charles Paul <cpaul@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 later versio... | gpl-3.0 |
stephanehenry27/Sickbeard-anime | sickbeard/browser.py | 5 | 3688 | # Author: Nic Wolfe <nic@wolfeden.ca>
# URL: http://code.google.com/p/sickbeard/
#
# This file is part of Sick Beard.
#
# Sick Beard 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 Lice... | gpl-3.0 |
blueboxgroup/neutron | neutron/plugins/ml2/drivers/mech_linuxbridge.py | 3 | 1991 | # Copyright (c) 2013 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 ... | apache-2.0 |
ShinyROM/android_external_chromium_org | media/tools/layout_tests/layouttests_unittest.py | 175 | 1928 | #!/usr/bin/env python
# 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 unittest
from layouttests import LayoutTests
from test_expectations import TestExpectations
class TestLayoutTests(unittes... | bsd-3-clause |
MSHallOpenSoft/plotter | GUI_final.py | 1 | 59129 | # -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'GUI_final.ui'
#
# Created: Thu Mar 19 22:03:17 2015
# by: PyQt4 UI code generator 4.11.3
#
# WARNING! All changes made in this file will be lost!
from PyQt4 import QtCore, QtGui
try:
_fromUtf8 = QtCore.QString.fromUtf8
except Attr... | gpl-2.0 |
ifp-uiuc/do-neural-networks-learn-faus-iccvw-2015 | ck_plus/cnn_ad/train.py | 1 | 3697 | import argparse
import os
import sys
sys.path.append('..')
import numpy
from anna import util
from anna.datasets import supervised_dataset
#from anna.datasets.supervised_data_loader import SupervisedDataLoaderCrossVal
import data_fold_loader
import data_paths
from model import SupervisedModel
parser = argparse.Arg... | bsd-3-clause |
ShawnPengxy/Flask-madeBlog | site-packages/pip/_vendor/distlib/metadata.py | 164 | 36356 | # -*- coding: utf-8 -*-
#
# Copyright (C) 2012 The Python Software Foundation.
# See LICENSE.txt and CONTRIBUTORS.txt.
#
"""Implementation of the Metadata for Python packages PEPs.
Supports all metadata formats (1.0, 1.1, 1.2, and 2.0 experimental).
"""
from __future__ import unicode_literals
import codecs
from email... | mit |
quanvm009/codev7 | openerp/addons/mail/report/__init__.py | 438 | 1057 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2009-Today OpenERP SA (<http://www.openerp.com>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms ... | agpl-3.0 |
Nu3001/external_chromium_org | tools/gen_keyboard_overlay_data/gen_keyboard_overlay_data.py | 58 | 17420 | #!/usr/bin/env python
# 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.
"""Generate keyboard layout and hotkey data for the keyboard overlay.
This script fetches data from the keyboard layout and hotkey... | bsd-3-clause |
cloudbase/neutron | neutron/db/migration/models/head.py | 7 | 1846 | # Copyright (c) 2014 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... | apache-2.0 |
jaw20/Crunchyroll-XML-Decoder | crunchy-xml-decoder/unidecode/x095.py | 252 | 4671 | data = (
'Xiao ', # 0x00
'Suo ', # 0x01
'Li ', # 0x02
'Zheng ', # 0x03
'Chu ', # 0x04
'Guo ', # 0x05
'Gao ', # 0x06
'Tie ', # 0x07
'Xiu ', # 0x08
'Cuo ', # 0x09
'Lue ', # 0x0a
'Feng ', # 0x0b
'Xin ', # 0x0c
'Liu ', # 0x0d
'Kai ', # 0x0e
'Jian ', # 0x0f
'Rui ', # 0x10
'... | gpl-2.0 |
all-of-us/raw-data-repository | tests/service_tests/consent_tests/test_consent_validation.py | 1 | 12558 | from datetime import datetime, timedelta
import json
import mock
from typing import List, Type
from rdr_service.model.consent_file import ConsentFile, ConsentSyncStatus, ConsentType
from rdr_service.model.hpo import HPO
from rdr_service.model.participant_summary import ParticipantSummary
from rdr_service.services.cons... | bsd-3-clause |
radjkarl/imgProcessor | imgProcessor/imgSignal.py | 1 | 10847 | from __future__ import division
from __future__ import print_function
import numpy as np
import cv2
from imgProcessor.imgIO import imread
from imgProcessor.measure.FitHistogramPeaks import FitHistogramPeaks
from fancytools.math.findXAt import findXAt
# from scipy.optimize.minpack import curve_fit
MAX_SIZE =... | gpl-3.0 |
veger/ansible | test/units/utils/amazon_placebo_fixtures.py | 62 | 6845 | import errno
import os
import time
import mock
import pytest
boto3 = pytest.importorskip("boto3")
botocore = pytest.importorskip("botocore")
placebo = pytest.importorskip("placebo")
"""
Using Placebo to test modules using boto3:
This is an example test, using the placeboify fixture to test that a module
will fail if... | gpl-3.0 |
rayluo/boto | boto/rds/optiongroup.py | 180 | 15665 | # Copyright (c) 2013 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 |
dsajkl/reqiop | lms/djangoapps/dashboard/tests/test_support.py | 33 | 4665 | """
Tests for support dashboard
"""
from xmodule.modulestore.tests.django_utils import ModuleStoreTestCase
from django.test.client import Client
from django.test.utils import override_settings
from django.contrib.auth.models import Permission
from shoppingcart.models import CertificateItem, Order
from courseware.tests.... | agpl-3.0 |
kawamon/hue | desktop/core/ext-py/kazoo-2.8.0/kazoo/tests/test_paths.py | 3 | 2961 | import sys
from unittest import TestCase
import pytest
from kazoo.protocol import paths
if sys.version_info > (3, ): # pragma: nocover
def u(s):
return s
else: # pragma: nocover
def u(s):
return unicode(s, "unicode_escape")
class NormPathTestCase(TestCase):
def test_normpath(self):
... | apache-2.0 |
camradal/ansible | lib/ansible/modules/notification/hipchat.py | 25 | 6761 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
... | gpl-3.0 |
KonstantinShemyak/python-javatools | javatools/jarinfo.py | 2 | 8995 | # This library is free software; you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as
# published by the Free Software Foundation; either version 3 of the
# License, or (at your option) any later version.
#
# This library is distributed in the hope that it will be usefu... | lgpl-3.0 |
benjaminjkraft/django | django/forms/formsets.py | 362 | 17988 | from __future__ import unicode_literals
from django.core.exceptions import ValidationError
from django.forms import Form
from django.forms.fields import BooleanField, IntegerField
from django.forms.utils import ErrorList
from django.forms.widgets import HiddenInput
from django.utils import six
from django.utils.encodi... | bsd-3-clause |
golismero/golismero-devel | tools/sqlmap/thirdparty/prettyprint/prettyprint.py | 30 | 4215 | #!/usr/bin/env python
#Copyright (c) 2010, Chris Hall <chris.hall@mod10.net>
#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,... | gpl-2.0 |
JungInkyo/Qualcomm_sensor | pa10/sensor/neo/Resources.py | 8 | 2713 | # from mmap import mmap, PAGESIZE, MAP_SHARED, PROT_WRITE, PROT_READ
from subprocess import Popen, PIPE
class ResourceError(Exception):
def __init__(self, *args, **kwargs):
Exception.__init__(self, *args, **kwargs)
class MemoryMap:
def __init__(self, file_lock, mode="r+b"):
self.raw = open(f... | gpl-2.0 |
fumitoh/modelx | modelx/tests/core/reference/relative/test_refmode.py | 1 | 2034 | import modelx as mx
import pytest
@pytest.fixture
def refmode_model():
"""
A---B---C---foo <-+
| | |
| +---bar --+
D
"""
import modelx as mx
m = mx.new_model()
A = mx.new_space('A')
B = A.new_space('B')
C = B.new_space('C')
@mx.d... | gpl-3.0 |
jmcorgan/gnuradio | gr-qtgui/python/qtgui/util.py | 15 | 1148 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright 2016 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... | gpl-3.0 |
vmax-feihu/hue | desktop/core/ext-py/tablib-0.10.0/tablib/packages/yaml3/serializer.py | 293 | 4165 |
__all__ = ['Serializer', 'SerializerError']
from .error import YAMLError
from .events import *
from .nodes import *
class SerializerError(YAMLError):
pass
class Serializer:
ANCHOR_TEMPLATE = 'id%03d'
def __init__(self, encoding=None,
explicit_start=None, explicit_end=None, version=None, ta... | apache-2.0 |
Tomtomgo/phantomjs | src/qt/qtwebkit/Tools/Scripts/webkitpy/tool/bot/earlywarningsystemtask.py | 127 | 2759 | # Copyright (c) 2011 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 |
Osmose/normandy | recipe-server/normandy/recipes/migrations/0021_migrate_to_single_actions.py | 1 | 1111 | # -*- coding: utf-8 -*-
# Generated by Django 1.9 on 2016-03-16 19:55
# flake8: noqa
from __future__ import unicode_literals
from django.db import migrations
def multiple_to_single(apps, schema_editor):
"""
Take the first action in a recipe and set it as the single action.
"""
Recipe = apps.get_model... | mpl-2.0 |
heplesser/nest-simulator | doc/userdoc/contribute/templates/pynest_api_template.py | 14 | 4742 | # -*- coding: utf-8 -*-
#
# pynest_api_template.py
#
# This file is part of NEST.
#
# Copyright (C) 2004 The NEST Initiative
#
# NEST 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 Lic... | gpl-2.0 |
wakatime/wakatime | wakatime/packages/py27/pygments/lexers/grammar_notation.py | 4 | 7941 | # -*- coding: utf-8 -*-
"""
pygments.lexers.grammar_notation
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Lexers for grammer notations like BNF.
:copyright: Copyright 2006-2019 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
import re
from pygments.lexer import RegexLexer, byg... | bsd-3-clause |
ghtdak/GitPython | git/refs/symbolic.py | 9 | 25465 | import os
from git.objects import Object, Commit
from git.util import (
join_path,
join_path_native,
to_native_path_linux,
assure_directory_exists
)
from gitdb.exc import (
BadObject,
BadName
)
from gitdb.util import (
join,
dirname,
isdir,
exists,
isfile,
rename,
h... | bsd-3-clause |
TheEdge-/Leaping_Lemur_kernel | tools/perf/scripts/python/futex-contention.py | 11261 | 1486 | # futex contention
# (c) 2010, Arnaldo Carvalho de Melo <acme@redhat.com>
# Licensed under the terms of the GNU GPL License version 2
#
# Translation of:
#
# http://sourceware.org/systemtap/wiki/WSFutexContention
#
# to perf python scripting.
#
# Measures futex contention
import os, sys
sys.path.append(os.environ['PER... | gpl-2.0 |
CTSRD-SOAAP/chromium-42.0.2311.135 | tools/code_coverage/croc_scan_test.py | 178 | 7181 | #!/usr/bin/env python
# Copyright (c) 2011 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.
"""Unit tests for croc_scan.py."""
import re
import unittest
import croc_scan
class TestScanner(unittest.TestCase):
"""Tests f... | bsd-3-clause |
opoplawski/ansible | test/units/mock/loader.py | 62 | 3009 | # (c) 2012-2014, Michael DeHaan <michael.dehaan@gmail.com>
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) an... | gpl-3.0 |
aam-at/tensorflow | tensorflow/python/keras/layers/dense_attention.py | 2 | 20897 | # 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 |
HoussemCharf/FunUtils | pythonMergeSort.py | 1 | 2025 | """
This is a pure python implementation of the merge sort algorithm
For doctests run following command:
python -m doctest -v merge_sort.py
or
python3 -m doctest -v merge_sort.py
For manual testing run:
python merge_sort.py
"""
from __future__ import print_function
def merge_sort(collection):
"""Pure... | mit |
Bilibili/vlc | extras/misc/stackhandler.py | 99 | 9554 | #!/usr/bin/python
#####################################################################
# DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
# Version 2, December 2004
#
# Copyright (C) 2011-2012 Ludovic Fauvet <etix@videolan.org>
# Jean-Baptiste Kempf <jb@videolan.org>
#... | gpl-2.0 |
shakamunyi/solum | solum/tests/api/v1/test_extension.py | 2 | 1560 | # Copyright 2013 - Red Hat, 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 writ... | apache-2.0 |
cfriedt/gnuradio | gr-utils/python/modtool/gr-newmod/docs/doxygen/doxyxml/generated/index.py | 344 | 1871 | #!/usr/bin/env python
"""
Generated Mon Feb 9 19:08:05 2009 by generateDS.py.
"""
from xml.dom import minidom
import os
import sys
import compound
import indexsuper as supermod
class DoxygenTypeSub(supermod.DoxygenType):
def __init__(self, version=None, compound=None):
supermod.DoxygenType.__init__(se... | gpl-3.0 |
hackathon-3d/ice-cream-manwich-repo | server/src/BooksWithFriends/libs/django/utils/numberformat.py | 94 | 1775 | from django.conf import settings
from django.utils.safestring import mark_safe
def format(number, decimal_sep, decimal_pos=None, grouping=0, thousand_sep='',
force_grouping=False):
"""
Gets a number (as a number or string), and returns it as a string,
using formats defined as arguments:
* ... | gpl-2.0 |
miniconfig/home-assistant | homeassistant/components/remote/__init__.py | 9 | 5147 | """
Component to interface with universal remote control devices.
For more details about this component, please refer to the documentation
at https://home-assistant.io/components/remote/
"""
import asyncio
from datetime import timedelta
import functools as ft
import logging
import os
import voluptuous as vol
from ho... | mit |
aayushkapoor206/whatshot | node_modules/node-gyp/gyp/pylib/gyp/common_test.py | 2542 | 1970 | #!/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.
"""Unit tests for the common.py file."""
import gyp.common
import unittest
import sys
class TestTopologicallySorted(unittest.TestCase):
... | apache-2.0 |
littlstar/chromium.src | tools/boilerplate.py | 87 | 2132 | #!/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.
"""Create files with copyright boilerplate and header include guards.
Usage: tools/boilerplate.py path/to/file.{h,cc}
"""
from dateti... | bsd-3-clause |
BitFunnel/NativeJIT | googletest/googletest/test/gtest_output_test.py | 363 | 12259 | #!/usr/bin/env python
#
# Copyright 2008, 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... | mit |
fly19890211/edx-platform | lms/djangoapps/course_wiki/views.py | 100 | 4689 | """
This file contains view functions for wrapping the django-wiki.
"""
import logging
import re
import cgi
from django.conf import settings
from django.contrib.sites.models import Site
from django.core.exceptions import ImproperlyConfigured
from django.shortcuts import redirect
from django.utils.translation import ug... | agpl-3.0 |
lmorchard/django | django/db/backends/postgresql/features.py | 158 | 1063 | from django.db.backends.base.features import BaseDatabaseFeatures
from django.db.utils import InterfaceError
class DatabaseFeatures(BaseDatabaseFeatures):
allows_group_by_selected_pks = True
can_return_id_from_insert = True
has_real_datatype = True
has_native_uuid_field = True
has_native_duration_... | bsd-3-clause |
costa23c/rdmw_cloudkit | xbgw_dashboard/e2e_settings.py | 3 | 4032 | from collections import namedtuple
user_fields = "username password fqdn devices xbees"
class E2EUser(namedtuple('E2EUser', user_fields)):
"""Encapsulate information for a mock user of the E2E application."""
def __new__(cls, username, password, fqdn, devices=None, xbees=None):
"""Allow optional argu... | mpl-2.0 |
caesar2164/edx-platform | lms/djangoapps/mobile_api/utils.py | 9 | 2049 | """
Common utility methods and decorators for Mobile APIs.
"""
import functools
from rest_framework import status
from rest_framework.response import Response
from lms.djangoapps.courseware.courses import get_course_with_access
from lms.djangoapps.courseware.courseware_access_exception import CoursewareAccessException... | agpl-3.0 |
pombredanne/algos-urv | django/contrib/gis/management/commands/inspectdb.py | 12 | 1585 | from optparse import make_option
from django.core.management.base import CommandError
from django.core.management.commands.inspectdb import Command as InspectDBCommand
class Command(InspectDBCommand):
db_module = 'django.contrib.gis.db'
gis_tables = {}
def get_field_type(self, connection, table_... | bsd-3-clause |
Cirrus-Link/Sparkplug | client_libraries/products/third_party/ignition/7.9.3/user-lib/pylib/google/protobuf/internal/encoder.py | 73 | 26730 | # Protocol Buffers - Google's data interchange format
# Copyright 2008 Google Inc. All rights reserved.
# https://developers.google.com/protocol-buffers/
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redi... | epl-1.0 |
mjschultz/ansible-modules-extras | system/capabilities.py | 65 | 6996 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2014, Nate Coraor <nate@bx.psu.edu>
#
# 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... | gpl-3.0 |
walterbender/locosugar | toolbar_utils.py | 1 | 5547 | # -*- coding: utf-8 -*-
# Copyright (c) 2011, Walter Bender
# Copyright (c) 2012, Ignacio Rodriguez
# 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... | gpl-3.0 |
mattcaldwell/django-storages-py3 | examples/libcloud_project/settings.py | 28 | 5444 | # Django settings for libcloud_project project.
DEBUG = True
TEMPLATE_DEBUG = DEBUG
ADMINS = (
# ('Your Name', 'your_email@example.com'),
)
MANAGERS = ADMINS
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3', # Add 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'oracle'.
... | bsd-3-clause |
ionux/bitforge | tests/unit.py | 1 | 1117 | from bitforge.unit import Unit
class TestUnit:
def test_btc_accessors(self):
u = Unit(btc = 1.2)
assert u.btc == 1.2
assert u.mbtc == 1200
assert u.bits == 1200000
assert u.satoshis == 120000000
def test_btc_conversion(self):
u = Unit(btc = 1.3)
assert... | mit |
pyocd/pyOCD | pyocd/board/board_ids.py | 2 | 23718 | # pyOCD debugger
# Copyright (c) 2017-2020 Arm Limited
# Copyright (c) 2021 Chris Reed
# SPDX-License-Identifier: Apache-2.0
#
# 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-2.0 |
Chus-Picos/ReSiStance | debian/resistance/usr/share/pyshared/ReSiStance/portrait.py | 3 | 8309 | # -*- coding: utf-8 -*-
#
# gPodder - A media aggregator and podcast client
# Copyright (c) 2005-2010 Thomas Perl and the gPodder Team
#
# gPodder 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... | gpl-3.0 |
lulandco/SickRage | lib/sqlalchemy/testing/plugin/plugin_base.py | 76 | 14817 | # plugin/plugin_base.py
# Copyright (C) 2005-2014 the SQLAlchemy authors and contributors <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php
"""Testing extensions.
this module is designed to work as a testing-framework-a... | gpl-3.0 |
evgeni/dak | dak/dakdb/update70.py | 9 | 3435 | #!/usr/bin/env python
# coding=utf8
"""
Add suite options for overrides and control-suite to DB
@contact: Debian FTP Master <ftpmaster@debian.org>
@copyright: 2011 Mark Hymers <mhy@debian.org>
@license: GNU General Public License version 2 or later
"""
# This program is free software; you can redistribute it and/or ... | gpl-2.0 |
benschmaus/catapult | dashboard/dashboard/services/rietveld_service.py | 3 | 9310 | # Copyright 2015 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.
"""Defines common functionality used for interacting with Rietveld."""
import json
import logging
import mimetypes
import urllib
from google.appengine.ext ... | bsd-3-clause |
userzimmermann/robotframework | src/robot/output/loggerhelper.py | 20 | 4045 | # Copyright 2008-2015 Nokia Solutions and Networks
#
# 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 l... | apache-2.0 |
ysekky/chainer | chainer/links/connection/gru.py | 3 | 7948 | import numpy
from chainer.functions.activation import sigmoid
from chainer.functions.activation import tanh
from chainer.functions.math import linear_interpolate
from chainer import link
from chainer.links.connection import linear
from chainer import variable
class GRUBase(link.Chain):
def __init__(self, in_siz... | mit |
gcd0318/django | django/core/management/commands/createcachetable.py | 342 | 4389 | from django.conf import settings
from django.core.cache import caches
from django.core.cache.backends.db import BaseDatabaseCache
from django.core.management.base import BaseCommand, CommandError
from django.db import (
DEFAULT_DB_ALIAS, connections, models, router, transaction,
)
from django.db.utils import Databa... | bsd-3-clause |
andrewmoses/ssquiz | flask/lib/python2.7/site-packages/pip/backwardcompat/__init__.py | 394 | 3756 | """Stuff that differs in different Python versions and platform
distributions."""
import os
import imp
import sys
import site
__all__ = ['WindowsError']
uses_pycache = hasattr(imp, 'cache_from_source')
class NeverUsedException(Exception):
"""this exception should never be raised"""
try:
WindowsError = Wind... | bsd-3-clause |
jwren/intellij-community | python/helpers/py3only/docutils/utils/__init__.py | 44 | 27421 | # coding: utf-8
# $Id: __init__.py 7668 2013-06-04 12:46:30Z milde $
# Author: David Goodger <goodger@python.org>
# Copyright: This module has been placed in the public domain.
"""
Miscellaneous utilities for the documentation utilities.
"""
__docformat__ = 'reStructuredText'
import os
import os.path
import re
impor... | apache-2.0 |
markbenvenuto/buildbaron | bfg_analyzer.py | 1 | 24487 | #!/usr/bin/env python3
"""
Script to analyze the Jira Build Baron Queue
"""
import argparse
import binascii
import datetime
import dateutil
import dateutil.relativedelta
import hashlib
import json
import os
import pprint
import re
import requests
import stat
import sys
if __name__ == "__main__" and __package__ is None... | apache-2.0 |
houzhenggang/hiwifi-openwrt-HC5661-HC5761 | staging_dir/target-mipsel_r2_uClibc-0.9.33.2/root-ralink/usr/lib/python2.7/encodings/cp720.py | 417 | 13694 | """Python Character Mapping Codec cp720 generated on Windows:
Vista 6.0.6002 SP2 Multiprocessor Free with the command:
python Tools/unicode/genwincodec.py 720
"""#"
import codecs
### Codec APIs
class Codec(codecs.Codec):
def encode(self,input,errors='strict'):
return codecs.charmap_encode(input,error... | gpl-2.0 |
jjscarafia/CUPS-Cloud-Print | reportissues.py | 2 | 2412 | #! /bin/sh
"true" '''\'
if command -v python2 > /dev/null; then
exec python2 "$0" "$@"
else
exec python "$0" "$@"
fi
exit $?
'''
# CUPS Cloudprint - Print via Google Cloud Print
# Copyright (C) 2013 Simon Cadman
#
# This program is free software: you can redistribute it and/or modify
# it under the ter... | gpl-3.0 |
hynnet/openwrt-mt7620 | staging_dir/target-mipsel_r2_uClibc-0.9.33.2/usr/lib/python2.7/test/test_csv.py | 18 | 40448 | # -*- coding: iso-8859-1 -*-
# Copyright (C) 2001,2002 Python Software Foundation
# csv package unit tests
import sys
import os
import unittest
from StringIO import StringIO
import tempfile
import csv
import gc
import io
from test import test_support
class Test_Csv(unittest.TestCase):
"""
Test the underlying ... | gpl-2.0 |
gzamboni/sdnResilience | loxi/of14/queue_stats_prop.py | 1 | 3603 | # Copyright (c) 2008 The Board of Trustees of The Leland Stanford Junior University
# Copyright (c) 2011, 2012 Open Networking Foundation
# Copyright (c) 2012, 2013 Big Switch Networks, Inc.
# See the file LICENSE.pyloxi which should have been included in the source distribution
# Automatically generated by LOXI from ... | gpl-2.0 |
ShineFan/odoo | addons/l10n_be/__openerp__.py | 251 | 3666 | # -*- 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 |
domenicosolazzo/practice-django | venv/lib/python2.7/site-packages/django/contrib/formtools/tests/wizard/namedwizardtests/forms.py | 95 | 1760 | import os
import tempfile
from django import forms
from django.core.files.storage import FileSystemStorage
from django.forms.formsets import formset_factory
from django.http import HttpResponse
from django.template import Template, Context
from django.contrib.auth.models import User
from django.contrib.formtools.wiz... | mit |
grigorisg9gr/menpo3d | menpo3d/checks.py | 3 | 3789 | import collections
import numpy as np
def check_max_iters(max_iters, n_scales):
r"""
Function that checks the value of a `max_iters` parameter defined for
multiple scales. It must be `int` or `list` of `int`.
Parameters
----------
max_iters : `int` or `list` of `int`
The value to chec... | bsd-3-clause |
40223240/2015cdb_w17_test | static/Brython3.1.1-20150328-091302/Lib/_csv.py | 639 | 21705 | """CSV parsing and writing.
[Copied from PyPy
https://bitbucket-assetroot.s3.amazonaws.com/pypy/pypy/1400171824.19/641/_csv.py?Signature=cc%2Bc8m06cBMbsxt2e15XXXUDACk%3D&Expires=1404136251&AWSAccessKeyId=0EMWEFSGA12Z1HF1TZ82
and adapted to Python 3 syntax for Brython]
This module provides classes that assist in the ... | gpl-3.0 |
davipeterlini/routeflow_tcc | pox/pox/lib/packet/tcp.py | 26 | 11837 | # Copyright 2011 James McCauley
# Copyright 2008 (C) Nicira, Inc.
#
# 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) an... | apache-2.0 |
repotvsupertuga/repo | plugin.video.jami/resources/lib/resolvers/__init__.py | 7 | 15907 | # -*- coding: utf-8 -*-
'''
Specto Add-on
Copyright (C) 2015 lambda
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 l... | gpl-2.0 |
borysiasty/QGIS | tests/src/python/test_qgsbox3d.py | 45 | 7825 | # -*- coding: utf-8 -*-
"""QGIS Unit tests for QgsBox3d.
.. note:: 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.
"""
__author... | gpl-2.0 |
googleapis/python-bigquery | samples/snippets/view_test.py | 1 | 3789 | # Copyright 2020 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, s... | apache-2.0 |
lightkeeper/py-leveldb | setup.py | 38 | 1652 | #!/usr/bin/python
# Copyright (c) Arni Mar Jonsson.
# See LICENSE for details.
import sys
try:
from setuptools import setup, Extension
except ImportError:
from distutils.core import setup, Extension
extra_compile_args = ['-I./leveldb/include', '-fPIC', '-Wall', '-g2', '-D_GNU_SOURCE', '-O2', '-DNDEBUG']
extra_lin... | bsd-3-clause |
ibrahimsharaf/crashsimilarity | crashsimilarity/models/distances.py | 2 | 1245 | def structural_word_distance(w1, w2):
parts1 = w1.split('::')
parts2 = w2.split('::')
if len(parts1) < len(parts2):
return structural_word_distance(w2, w1)
prefix = 0
while prefix < len(parts2) and parts1[prefix] == parts2[prefix]:
prefix += 1
return 1 - float(prefix) / max(len(p... | mpl-2.0 |
MagicAttacker/APM602 | Tools/scripts/update_wiki.py | 275 | 2870 | #!/usr/bin/env python
'''
update a wordpress wiki page
Andrew Tridgell
May 2013
See http://codex.wordpress.org/XML-RPC_WordPress_API/Posts
'''
import xmlrpclib, sys
from optparse import OptionParser
parser = OptionParser("update_wiki.py [options] <file>")
parser.add_option("--username", help="Wordpress username", de... | gpl-3.0 |
ArcherSys/ArcherSys | eclipse/plugins/org.python.pydev.jython_4.5.5.201603221110/Lib/modjy/modjy_write.py | 109 | 1441 | ###
#
# Copyright Alan Kennedy.
#
# You may contact the copyright holder at this uri:
#
# http://www.xhaus.com/contact/modjy
#
# The licence under which this code is released is the Apache License v2.0.
#
# The terms and conditions of this license are listed in a file contained
# in the distribution that also cont... | mit |
virtualopensystems/nova | nova/virt/hyperv/driver.py | 1 | 9838 | # Copyright (c) 2010 Cloud.com, Inc
# Copyright (c) 2012 Cloudbase Solutions Srl
#
# 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.... | apache-2.0 |
tumbl3w33d/ansible | lib/ansible/modules/network/itential/iap_start_workflow.py | 38 | 5468 | #!/usr/bin/python
# Copyright: (c) 2018, Itential <opensource@itential.com>
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
"""
This module provides the ability to start a workflow from Itential Automation Platform
"""
from __future__ import absolute_import, division, print... | gpl-3.0 |
MediaMath/qasino | lib/zmq_requestor.py | 1 | 2310 | # Copyright (C) 2014 MediaMath, Inc. <http://www.mediamath.com>
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appli... | apache-2.0 |
mollstam/UnrealPy | UnrealPyEmbed/Development/Python/2015.08.07-Python2710-x64-Source-vs2015/Python27/Source/Twisted-15.2.1/twisted/mail/relaymanager.py | 10 | 38351 | # -*- test-case-name: twisted.mail.test.test_mail -*-
# Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
"""
Infrastructure for relaying mail through a smart host.
Traditional peer-to-peer email has been increasingly replaced by smart host
configurations. Instead of sending mail directly to the ... | mit |
ffalcinelli/django-ejabberd-bridge | tests/settings.py | 2 | 2736 | # -*- coding: utf-8 -*-
# Copyright (C) 2013 Fabio Falcinelli
#
# 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.
#
# Thi... | lgpl-3.0 |
mshafiq9/django | django/db/backends/mysql/creation.py | 59 | 2124 | import subprocess
import sys
from django.db.backends.base.creation import BaseDatabaseCreation
from .client import DatabaseClient
class DatabaseCreation(BaseDatabaseCreation):
def sql_table_creation_suffix(self):
suffix = []
test_settings = self.connection.settings_dict['TEST']
if test_... | bsd-3-clause |
ahu-odoo/odoo | openerp/fields.py | 12 | 61100 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2013-2014 OpenERP (<http://www.openerp.com>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of t... | agpl-3.0 |
richapma/ninjadb | node_modules/node-gyp/gyp/pylib/gyp/MSVSUtil.py | 1812 | 9537 | # Copyright (c) 2013 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.
"""Utility functions shared amongst the Windows generators."""
import copy
import os
# A dictionary mapping supported target types to extensions.
TARGET_TYPE_EX... | mit |
javierlgroba/Eventer-gapp | django/core/management/__init__.py | 99 | 18224 | import collections
import os
import sys
from optparse import OptionParser, NO_DEFAULT
import imp
import warnings
from django.core.exceptions import ImproperlyConfigured
from django.core.management.base import BaseCommand, CommandError, handle_default_options
from django.core.management.color import color_style
from dj... | lgpl-3.0 |
peterjoel/servo | tests/wpt/web-platform-tests/css/vendor-imports/mozilla/mozilla-central-reftests/text-decor-3/support/generate-text-emphasis-line-height-tests.py | 829 | 3431 | #!/usr/bin/env python
# - * - coding: UTF-8 - * -
"""
This script generates tests text-emphasis-line-height-001 ~ 004 except
001z. They test the line height expansion in different directions. This
script outputs a list of all tests it generated in the format of Mozilla
reftest.list to the stdout.
"""
from __future__ ... | mpl-2.0 |
pratikmallya/hue | desktop/core/ext-py/Django-1.6.10/django/contrib/gis/gdal/prototypes/srs.py | 219 | 3498 | from ctypes import c_char_p, c_int, c_void_p, POINTER
from django.contrib.gis.gdal.libgdal import lgdal, std_call
from django.contrib.gis.gdal.prototypes.generation import (const_string_output,
double_output, int_output, srs_output, string_output, void_output)
## Shortcut generation for routines with known paramet... | apache-2.0 |
scionrep/scioncc | src/pyon/util/containers.py | 1 | 14330 | """ General purpose util classes and functions """
__author__ = 'Adam R. Smith, Michael Meisinger'
import collections
import datetime
import importlib
import string
import time
import simplejson
import base64
import uuid
import os
import re
from types import NoneType
from copy import deepcopy
DICT_LOCKING_ATTR = "__... | bsd-2-clause |
wikimedia/operations-debs-python-diamond | src/collectors/openstackswiftrecon/openstackswiftrecon.py | 8 | 2894 | # coding=utf-8
"""
Openstack Swift Recon collector. Reads any present recon cache files and
reports their current metrics.
#### Dependencies
* Running Swift services must have a recon enabled
"""
import os
try:
import json
json # workaround for pyflakes issue #13
except ImportError:
import simplejson... | mit |
davidftv/CC-A80-kernel-source | tools/perf/util/setup.py | 4998 | 1330 | #!/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 |
pamu/FooService | FooService2/project/target/node-modules/webjars/npm/node_modules/node-gyp/gyp/pylib/gyp/generator/xcode.py | 526 | 54812 | # 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.
import filecmp
import gyp.common
import gyp.xcodeproj_file
import errno
import os
import sys
import posixpath
import re
import shutil
import subprocess
import temp... | apache-2.0 |
girving/tensorflow | tensorflow/contrib/learn/python/learn/estimators/__init__.py | 39 | 12688 | # 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 |
tamsky/cloud-init | cloudinit/config/cc_update_etc_hosts.py | 15 | 2391 | # vi: ts=4 expandtab
#
# Copyright (C) 2011 Canonical Ltd.
# Copyright (C) 2012 Hewlett-Packard Development Company, L.P.
#
# Author: Scott Moser <scott.moser@canonical.com>
# Author: Juerg Haefliger <juerg.haefliger@hp.com>
#
# This program is free software: you can redistribute it and/or modify
# it... | gpl-3.0 |
initaldk/bitcoin | qa/rpc-tests/mempool_resurrect_test.py | 133 | 3412 | #!/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 resurrection of mined transactions when
# the blockchain is re-organized.
#
from test_framework.test... | mit |
Trixter69/BookMarka | lib/beets/dbcore/types.py | 14 | 6099 | # -*- coding: utf-8 -*-
# This file is part of beets.
# Copyright 2016, Adrian Sampson.
#
# 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 t... | gpl-3.0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.