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 |
|---|---|---|---|---|---|
thehashrocket/angular2-2waydata-confirmation | node_modules/node-gyp/gyp/pylib/gyp/MSVSVersion.py | 1509 | 17165 | # 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.
"""Handle version information related to Visual Stuio."""
import errno
import os
import re
import subprocess
import sys
import gyp
import glob
class VisualStudi... | mit |
PainNarrativesLab/TwitterDataAnalysis | tests/test_ConstantsAndUtilities.py | 1 | 1066 | __author__ = 'adam'
import unittest
from ConstantsAndUtilities import *
class IgnoreTest(unittest.TestCase):
def setUp(self):
self.object = Ignore()
def test_check_instance_properties_set(self):
self.assertTrue(len(self.object.word_tuple) > 0)
self.assertIn("'re'", self.object.word_t... | mit |
cpennington/edx-platform | openedx/core/djangoapps/user_api/accounts/utils.py | 1 | 7839 | """
Utility methods for the account settings.
"""
import re
import waffle
from completion import waffle as completion_waffle
from completion.models import BlockCompletion
from django.conf import settings
from django.utils.translation import ugettext as _
from six import text_type
from six.moves import range
from six... | agpl-3.0 |
balloob/home-assistant | homeassistant/components/remote_rpi_gpio/__init__.py | 14 | 1416 | """Support for controlling GPIO pins of a Raspberry Pi."""
from gpiozero import LED, Button
from gpiozero.pins.pigpio import PiGPIOFactory
CONF_BOUNCETIME = "bouncetime"
CONF_INVERT_LOGIC = "invert_logic"
CONF_PULL_MODE = "pull_mode"
DEFAULT_BOUNCETIME = 50
DEFAULT_INVERT_LOGIC = False
DEFAULT_PULL_MODE = "UP"
DOMAI... | apache-2.0 |
dimroc/tensorflow-mnist-tutorial | lib/python3.6/site-packages/numpy/polynomial/__init__.py | 84 | 1151 | """
A sub-package for efficiently dealing with polynomials.
Within the documentation for this sub-package, a "finite power series,"
i.e., a polynomial (also referred to simply as a "series") is represented
by a 1-D numpy array of the polynomial's coefficients, ordered from lowest
order term to highest. For example, a... | apache-2.0 |
sertac/django | tests/model_forms/tests.py | 85 | 109361 | from __future__ import unicode_literals
import datetime
import os
from decimal import Decimal
from unittest import skipUnless
from django import forms
from django.core.exceptions import (
NON_FIELD_ERRORS, FieldError, ImproperlyConfigured,
)
from django.core.files.uploadedfile import SimpleUploadedFile
from djang... | bsd-3-clause |
joopert/home-assistant | tests/components/zone/test_config_flow.py | 4 | 1762 | """Tests for zone config flow."""
from homeassistant.components.zone import config_flow
from homeassistant.components.zone.const import CONF_PASSIVE, DOMAIN, HOME_ZONE
from homeassistant.const import (
CONF_NAME,
CONF_LATITUDE,
CONF_LONGITUDE,
CONF_ICON,
CONF_RADIUS,
)
from tests.common import Moc... | apache-2.0 |
NickDaly/GemRB-FixConfig-Branch | gemrb/GUIScripts/bg2/CharGenEnd.py | 1 | 8015 | # -*-python-*-
# GemRB - Infinity Engine Emulator
# Copyright (C) 2003-2004 The GemRB Project
#
# 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 opt... | gpl-2.0 |
nealtodd/django | django/core/mail/__init__.py | 347 | 4697 | """
Tools for sending email.
"""
from __future__ import unicode_literals
from django.conf import settings
# Imported for backwards compatibility and for the sake
# of a cleaner namespace. These symbols used to be in
# django/core/mail.py before the introduction of email
# backends and the subsequent reorganization (Se... | bsd-3-clause |
el-ethan/kivy | examples/widgets/carousel_buttons.py | 40 | 1031 | '''
Carousel example with button inside.
This is a tiny test for testing the scroll distance/timeout
And ensure the down/up are dispatched if no gesture is done.
'''
from kivy.uix.carousel import Carousel
from kivy.uix.gridlayout import GridLayout
from kivy.app import App
from kivy.lang import Builder
Builder.load_str... | mit |
thanhphat11/android_kernel_pantech_ef63l | 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 |
Livefyre/django-cms | cms/test_utils/project/sampleapp/migrations/0001_initial.py | 66 | 1706 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
import cms.models.fields
class Migration(migrations.Migration):
dependencies = [
('cms', '0002_auto_20140816_1918'),
]
operations = [
migrations.CreateModel(
name='Catego... | bsd-3-clause |
GoogleCloudPlatform/sap-deployment-automation | third_party/github.com/ansible/awx/awx/main/tests/functional/test_rbac_label.py | 1 | 2417 | import pytest
from awx.main.access import (
LabelAccess,
)
@pytest.mark.django_db
def test_label_get_queryset_user(label, user):
u = user('user', False)
access = LabelAccess(u)
label.organization.member_role.members.add(u)
assert access.get_queryset().count() == 1
@pytest.mark.django_db
def tes... | apache-2.0 |
09zwcbupt/undergrad_thesis | ext/poxdesk/qx/tool/pylib/misc/NameSpace.py | 3 | 2247 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
################################################################################
#
# qooxdoo - the new era of web development
#
# http://qooxdoo.org
#
# Copyright:
# 2006-2010 1&1 Internet AG, Germany, http://www.1und1.de
#
# License:
# LGPL: http://www.gnu.org/li... | gpl-3.0 |
inaz2/deluge-hack | deluge/plugins/label/label/webui.py | 6 | 1992 | #
# webui.py
#
# Copyright (C) 2008 Martijn Voncken <mvoncken@gmail.com>
#
# Basic plugin template created by:
# Copyright (C) 2008 Martijn Voncken <mvoncken@gmail.com>
# Copyright (C) 2007, 2008 Andrew Resch <andrewresch@gmail.com>
#
# Deluge is free software.
#
# You may redistribute it and/or modify it under the ter... | gpl-3.0 |
toshywoshy/ansible | test/units/modules/network/fortios/test_fortios_vpn_ipsec_manualkey.py | 21 | 10801 | # Copyright 2019 Fortinet, Inc.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the... | gpl-3.0 |
batiste/django-mptt | mptt/forms.py | 6 | 5131 | """
Form components for working with trees.
"""
from django import forms
from django.forms.forms import NON_FIELD_ERRORS
from django.forms.util import ErrorList
from django.utils.encoding import smart_unicode
from django.utils.translation import ugettext_lazy as _
from mptt.exceptions import InvalidMove
__all__ = ('T... | mit |
repotvsupertuga/tvsupertuga.repository | script.module.streamtvsupertuga/lib/resources/lib/sources/pl/boxfilm.py | 1 | 2782 | # -*- coding: UTF-8 -*-
import urlparse
from resources.lib.modules import cleantitle
from resources.lib.modules import client
from resources.lib.modules import source_utils
class source:
def __init__(self):
self.priority = 1
self.language = ['pl']
self.domains = ['boxfilm.pl']
... | gpl-2.0 |
hsavolai/vmlab | src/kiwi/gicompat.py | 1 | 1449 | import sys
def install_compat():
from gi.repository import Gtk
from gi.repository import Gdk
from gi.repository import GdkPixbuf
sys.modules['gtk'] = Gtk
sys.modules['gtk.gdk'] = Gdk
Gtk.gdk = Gdk
Gtk.keysyms = Gdk
Gdk.Pixbuf = GdkPixbuf.Pixbuf
def pixbuf_new_from_file(filename):
... | gpl-3.0 |
gaddman/ansible | test/units/modules/network/netscaler/test_netscaler_lb_vserver.py | 68 | 33772 |
# Copyright (c) 2017 Citrix Systems
#
# 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 |
christo4ferris/fabric-docs | bddtests/steps/bdd_grpc_util.py | 6 | 6608 |
# Copyright IBM Corp. 2016 All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... | apache-2.0 |
BioDynaMo/biodynamo | util/version/version.py | 1 | 1081 | # -----------------------------------------------------------------------------
#
# Copyright (C) 2021 CERN & Newcastle University for the benefit of the
# BioDynaMo collaboration. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance w... | apache-2.0 |
kybriainfotech/iSocioCRM | addons/mass_mailing/models/mail_mail.py | 114 | 5292 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2013-Today OpenERP SA (<http://www.openerp.com>)
#
# This program is free software: you can redistribute it and/or modify
# it under the terms o... | agpl-3.0 |
40223104/2015cd_0512 | static/Brython3.1.1-20150328-091302/Lib/copy.py | 628 | 8905 | """Generic (shallow and deep) copying operations.
Interface summary:
import copy
x = copy.copy(y) # make a shallow copy of y
x = copy.deepcopy(y) # make a deep copy of y
For module specific errors, copy.Error is raised.
The difference between shallow and deep copying is only relev... | agpl-3.0 |
lawzou/shoop | shoop/admin/forms/fields.py | 6 | 1234 | # This file is part of Shoop.
#
# Copyright (c) 2012-2015, Shoop Ltd. All rights reserved.
#
# This source code is licensed under the AGPLv3 license found in the
# LICENSE file in the root directory of this source tree.
from decimal import Decimal
from numbers import Number
from django.forms import DecimalField
clas... | agpl-3.0 |
vkscool/nupic | external/linux32/lib/python2.6/site-packages/matplotlib/path.py | 69 | 20263 | """
Contains a class for managing paths (polylines).
"""
import math
from weakref import WeakValueDictionary
import numpy as np
from numpy import ma
from matplotlib._path import point_in_path, get_path_extents, \
point_in_path_collection, get_path_collection_extents, \
path_in_path, path_intersects_path, con... | gpl-3.0 |
my8bird/ropeemacs | setup.py | 2 | 1255 | extra_kwargs = {}
try:
from setuptools import setup
extra_kwargs['install_requires'] = ['rope >= 0.9.4', 'ropemode >= 0.2']
except ImportError:
from distutils.core import setup
classifiers=[
'Development Status :: 4 - Beta',
'Operating System :: OS Independent',
'Environment :: X11 Application... | gpl-2.0 |
unlimitedlabs/orchestra | orchestra/utils/tests/test_project_properties.py | 2 | 2109 | from unittest.mock import patch
from orchestra.models import Iteration
from orchestra.models import Project
from orchestra.tests.helpers import OrchestraTestCase
from orchestra.tests.helpers.fixtures import setup_models
from orchestra.utils.project_properties import completed_projects
from orchestra.utils.task_lifecyc... | apache-2.0 |
kenshay/ImageScript | Script_Runner/PYTHON/Lib/site-packages/paramiko/ber.py | 7 | 4351 | # Copyright (C) 2003-2007 Robey Pointer <robeypointer@gmail.com>
#
# This file is part of paramiko.
#
# Paramiko is free software; you can redistribute it and/or modify it under the
# terms of the GNU Lesser General Public License as published by the Free
# Software Foundation; either version 2.1 of the License, or (a... | gpl-3.0 |
DavidNorman/tensorflow | tensorflow/python/keras/metrics.py | 1 | 102847 | # 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 |
twidi/haystack-with-only | tests/core/tests/views.py | 2 | 8152 | from threading import Thread
import Queue
from django.core.urlresolvers import reverse
from django.conf import settings
from django import forms
from django.http import HttpRequest, QueryDict
from django.test import TestCase
import haystack
from haystack.forms import model_choices, SearchForm, ModelSearchForm, FacetedS... | bsd-3-clause |
mtreinish/stestr | stestr/utils.py | 2 | 3964 | # 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
# distributed under th... | apache-2.0 |
xzturn/tensorflow | tensorflow/python/kernel_tests/linalg/sparse/csr_sparse_matrix_ops_test.py | 3 | 68687 | # 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 |
kirananto/RaZorReborn | tools/perf/scripts/python/Perf-Trace-Util/lib/Perf/Trace/Core.py | 11088 | 3246 | # Core.py - Python extension for perf script, core functions
#
# Copyright (C) 2010 by Tom Zanussi <tzanussi@gmail.com>
#
# This software may be distributed under the terms of the GNU General
# Public License ("GPL") version 2 as published by the Free Software
# Foundation.
from collections import defaultdict
def aut... | gpl-2.0 |
rplevka/robottelo | tests/robottelo/test_issue_handlers.py | 1 | 14857 | import os
import subprocess
import sys
from collections import defaultdict
import pytest
from packaging.version import Version
from pytest_plugins.issue_handlers import DEFAULT_BZ_CACHE_FILE
from robottelo.constants import CLOSED_STATUSES
from robottelo.constants import OPEN_STATUSES
from robottelo.constants import W... | gpl-3.0 |
jneves/python-social-auth | social/tests/backends/test_dummy.py | 80 | 3932 | import json
import datetime
import time
from httpretty import HTTPretty
from social.actions import do_disconnect
from social.backends.oauth import BaseOAuth2
from social.exceptions import AuthForbidden
from social.tests.models import User
from social.tests.backends.oauth import OAuth2Test
class DummyOAuth2(BaseOAu... | bsd-3-clause |
dotpmrcunha/gnuradio | gr-qtgui/apps/qt_digital_window.py | 88 | 10097 | # -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'qt_digital_window.ui'
#
# Created: Sat May 1 20:14:02 2010
# by: PyQt4 UI code generator 4.6.1
#
# WARNING! All changes made in this file will be lost!
from PyQt4 import QtCore, QtGui
class Ui_DigitalWindow(object):
def setupUi(s... | gpl-3.0 |
alistairlow/tensorflow | tensorflow/python/kernel_tests/transpose_op_test.py | 8 | 18936 | # 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 |
kenshay/ImageScripter | ProgramData/SystemFiles/Python/Lib/site-packages/IPython/lib/inputhookpyglet.py | 33 | 3664 | # encoding: utf-8
"""
Enable pyglet to be used interacive by setting PyOS_InputHook.
Authors
-------
* Nicolas P. Rougier
* Fernando Perez
"""
#-----------------------------------------------------------------------------
# Copyright (C) 2008-2011 The IPython Development Team
#
# Distributed under the terms of th... | gpl-3.0 |
hamedhsn/incubator-airflow | airflow/operators/docker_operator.py | 10 | 8099 | # -*- coding: utf-8 -*-
#
# 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 |
vpramo/contrail-neutron-plugin | neutron_plugin_contrail/tests/test_plugins_opencontrail_quota_driver.py | 10 | 1736 | import mock
import unittest
import uuid
from neutron_plugin_contrail.plugins.opencontrail.quota.driver import QuotaDriver
class ContrailPluginQuotaDriverTest(unittest.TestCase):
def setUp(self):
print "setup quota"
def test_testenv(self):
print "testenv quota ok"
def test_get_tenant_quot... | apache-2.0 |
dzc34/searx | searx/engines/faroo.py | 6 | 3527 | """
Faroo (Web, News)
@website http://www.faroo.com
@provide-api yes (http://www.faroo.com/hp/api/api.html), require API-key
@using-api yes
@results JSON
@stable yes
@parse url, title, content, publishedDate, img_src
"""
from urllib import urlencode
from json import loads
import datetime
... | agpl-3.0 |
directactioneverywhere/server | airtable/generate_chapter_data.py | 1 | 2957 | """Generate the json data for the chapter map from Airtable
Usage:
python generate_chapter_data.py <output file>"""
import json
import re
import sys
import time
import requests
from airtable import get_all_records
GEOCODING_RETRIES = 4
def get_lat_long(s):
match = re.search(r'\((\-?\d+(\.\d+)?),\s*(\-?\d+(... | gpl-3.0 |
neoscoin/neos-core | src/ledger/lib/python2.7/site-packages/pip/_vendor/urllib3/contrib/_securetransport/low_level.py | 5 | 12405 | """
Low-level helpers for the SecureTransport bindings.
These are Python functions that are not directly related to the high-level APIs
but are necessary to get them to work. They include a whole bunch of low-level
CoreFoundation messing about and memory management. The concerns in this module
are almost entirel... | mit |
rajul/Pydev | plugins/org.python.pydev.jython/Lib/distutils/ccompiler.py | 17 | 48715 | """distutils.ccompiler
Contains CCompiler, an abstract base class that defines the interface
for the Distutils compiler abstraction model."""
__revision__ = "$Id: ccompiler.py 86238 2010-11-06 04:06:18Z eric.araujo $"
import sys
import os
import re
from distutils.errors import (CompileError, LinkError, UnknownFileE... | epl-1.0 |
jjs0sbw/CSPLN | apps/scaffolding/version/MKE_v00_01_02/languages/nl.py | 159 | 16825 | # coding: utf8
{
'!langcode!': 'nl',
'!langname!': 'Nederlands',
'"update" is an optional expression like "field1=\'newvalue\'". You cannot update or delete the results of a JOIN': '"update" is an optional expression like "field1=\'newvalue\'". You cannot update or delete the results of a JOIN',
'%(nrows)s records foun... | gpl-3.0 |
DataDog/integrations-core | pgbouncer/tests/conftest.py | 1 | 1477 | # (C) Datadog, Inc. 2010-present
# All rights reserved
# Licensed under Simplified BSD License (see LICENSE)
import os
from copy import deepcopy
import psycopg2
import pytest
from packaging import version
from datadog_checks.dev import WaitFor, docker_run
from . import common
HERE = os.path.dirname(os.path.abspath... | bsd-3-clause |
drzoidberg33/plexpy | lib/requests/api.py | 109 | 6237 | # -*- coding: utf-8 -*-
"""
requests.api
~~~~~~~~~~~~
This module implements the Requests API.
:copyright: (c) 2012 by Kenneth Reitz.
:license: Apache2, see LICENSE for more details.
"""
from . import sessions
def request(method, url, **kwargs):
"""Constructs and sends a :class:`Request <Request>`.
:para... | gpl-3.0 |
ddico/odoo | doc/_extensions/autojsdoc/ext/directives.py | 20 | 25658 | # -*- coding: utf-8 -*-
import abc
import collections
import contextlib
import fnmatch
import io
import re
from docutils import nodes
from docutils.parsers.rst import Directive
from docutils.statemachine import StringList
from sphinx import addnodes
from sphinx.ext.autodoc import members_set_option, bool_option, ALL
... | agpl-3.0 |
rahulunair/nova | nova/db/migration.py | 14 | 2248 | # Copyright 2010 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# 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 ... | apache-2.0 |
mikalstill/nova | nova/policies/remote_consoles.py | 6 | 1697 | # Copyright 2016 Cloudbase Solutions Srl
# 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 r... | apache-2.0 |
SlimRemix/android_external_chromium_org | third_party/closure_linter/closure_linter/common/filetestcase.py | 109 | 3893 | #!/usr/bin/env python
# Copyright 2007 The Closure Linter 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
#
#... | bsd-3-clause |
grdlok/UStar-dl | src/youtube_dl/extractor/channel9.py | 3 | 11412 | from __future__ import unicode_literals
import re
from .common import InfoExtractor
from ..utils import ExtractorError
class Channel9IE(InfoExtractor):
'''
Common extractor for channel9.msdn.com.
The type of provided URL (video or playlist) is determined according to
meta Search.PageType from web pa... | unlicense |
davidcusatis/ursula | library/swift_ring.py | 16 | 4115 | #!/usr/bin/python
#coding: utf-8 -*-
#
# (c) 2014, Craig Tracey <craigtracey@gmail.com>
#
# This module is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) an... | mit |
BitFunnel/BitFunnel | googletest/googletest/test/gtest_test_utils.py | 344 | 10823 | #!/usr/bin/env python
#
# Copyright 2006, 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 |
brokenjacobs/ansible | lib/ansible/plugins/lookup/inventory_hostnames.py | 46 | 1954 | # (c) 2012, Michael DeHaan <michael.dehaan@gmail.com>
# (c) 2013, Steven Dossett <sdossett@panath.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 versio... | gpl-3.0 |
zoho/books-python-wrappers | books/model/Organization.py | 1 | 18783 | #$Id$
from books.model.Address import Address
class Organization:
"""This class is used to create object for organization."""
def __init__(self):
"""Initialize parameters for organization object. """
self.organization_id = ''
self.name = ''
self.is_default_org = None
s... | mit |
madarche/jack | jack_functions.py | 1 | 18787 | # -*- coding: iso-8859-15 -*-
# jack_functions: functions for
# jack - extract audio from a CD and encode it using 3rd party software
# Copyright (C) 1999-2003 Arne Zellentin <zarne@users.sf.net>
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public Lice... | gpl-2.0 |
ict-felix/stack | vt_manager/src/python/vt_manager/communication/sfa/methods/ListResources.py | 4 | 1634 | import zlib
from vt_manager.communication.sfa.util.xrn import urn_to_hrn
from vt_manager.communication.sfa.util.faults import SfaInvalidArgument
from vt_manager.communication.sfa.trust.credential import Credential
from vt_manager.communication.sfa.trust.auth import Auth
class ListResources:
def __init__(self, cre... | apache-2.0 |
trevor/calendarserver | txdav/xml/rfc6578.py | 1 | 4057 | ##
# Copyright (c) 2009-2014 Apple Inc. 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
# to use, copy, mod... | apache-2.0 |
sda2b/youtube-dl | youtube_dl/extractor/canal13cl.py | 154 | 1912 | # coding: utf-8
from __future__ import unicode_literals
import re
from .common import InfoExtractor
class Canal13clIE(InfoExtractor):
_VALID_URL = r'^http://(?:www\.)?13\.cl/(?:[^/?#]+/)*(?P<id>[^/?#]+)'
_TEST = {
'url': 'http://www.13.cl/t13/nacional/el-circulo-de-hierro-de-michelle-bachelet-en-su-... | unlicense |
absoludity/servo | tests/wpt/css-tests/tools/py/testing/io_/test_saferepr.py | 162 | 2388 | # -*- coding: utf-8 -*-
from __future__ import generators
import py
import sys
saferepr = py.io.saferepr
class TestSafeRepr:
def test_simple_repr(self):
assert saferepr(1) == '1'
assert saferepr(None) == 'None'
def test_maxsize(self):
s = saferepr('x'*50, maxsize=25)
assert l... | mpl-2.0 |
chafique-delli/OpenUpgrade | addons/project_mrp/__openerp__.py | 31 | 2529 | # -*- 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 |
Nepherhotep/django | tests/prefetch_related/models.py | 255 | 7972 | import uuid
from django.contrib.contenttypes.fields import (
GenericForeignKey, GenericRelation,
)
from django.contrib.contenttypes.models import ContentType
from django.db import models
from django.utils.encoding import python_2_unicode_compatible
# Basic tests
@python_2_unicode_compatible
class Author(models.... | bsd-3-clause |
ellipsis14/dolfin | test/documentation/test.py | 3 | 1228 | # Copyright (C) 2011-2014 Marie E. Rognes
#
# This file is part of DOLFIN.
#
# DOLFIN 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 ver... | gpl-3.0 |
parksandwildlife/borgcollector | livelayermanager/migrations/0001_initial.py | 2 | 5183 | # -*- coding: utf-8 -*-
# Generated by Django 1.9.7 on 2016-06-23 06:16
from __future__ import unicode_literals
import borg_utils.resource_status
import borg_utils.transaction
import django.core.validators
from django.db import migrations, models
import django.db.models.deletion
import django.utils.timezone
import re
... | bsd-3-clause |
chris48s/mapit | mapit/management/commands/mapit_generation_create.py | 3 | 1083 | # This script is used to create a new inactive generation for
# inputting new boundaries of some sort.
from optparse import make_option
from django.core.management.base import NoArgsCommand
from mapit.models import Generation
class Command(NoArgsCommand):
help = 'Create a new generation'
option_list = NoArgs... | agpl-3.0 |
lloydbadger/custom_php_pbr | lib/php/extension.py | 6 | 3614 | # 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 use ... | apache-2.0 |
ian-garrett/meetMe | env/lib/python3.4/site-packages/simplejson/tests/__init__.py | 38 | 3129 | from __future__ import absolute_import
import unittest
import doctest
import sys
class NoExtensionTestSuite(unittest.TestSuite):
def run(self, result):
import simplejson
simplejson._toggle_speedups(False)
result = unittest.TestSuite.run(self, result)
simplejson._toggle_speedups(Tru... | artistic-2.0 |
anntzer/scipy | scipy/optimize/_root.py | 13 | 26284 | """
Unified interfaces to root finding algorithms.
Functions
---------
- root : find a root of a vector function.
"""
__all__ = ['root']
import numpy as np
ROOT_METHODS = ['hybr', 'lm', 'broyden1', 'broyden2', 'anderson',
'linearmixing', 'diagbroyden', 'excitingmixing', 'krylov',
'df-... | bsd-3-clause |
anshulthakur/WebScraper | stocks/stocks/spiders/general.py | 1 | 3522 | # -*- coding: utf-8 -*-
import scrapy
import scrapy_splash
from scrapy_splash import SplashRequest
from stocks.items import GeneralItem
from scrapy.utils.project import get_project_settings
from scrapy.spidermiddlewares.offsite import OffsiteMiddleware
from scrapy.spiders import Rule
from scrapy.linkextractors import... | gpl-2.0 |
krintoxi/NoobSec-Toolkit | NoobSecToolkit - MAC OSX/scripts/sshbackdoors/backdoors/shell/pupy/pupy/pupylib/PupyClient.py | 6 | 6536 | # -*- coding: UTF8 -*-
# --------------------------------------------------------------
# Copyright (c) 2015, Nicolas VERDIER (contact@n1nj4.eu)
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
#
#... | gpl-2.0 |
liantian-cn/ms17_010_scanner_gui | lib/xlsxwriter/format.py | 3 | 25983 | ###############################################################################
#
# Format - A class for writing the Excel XLSX Worksheet file.
#
# Copyright 2013-2016, John McNamara, jmcnamara@cpan.org
#
# Package imports.
from . import xmlwriter
class Format(xmlwriter.XMLwriter):
"""
A class for writing th... | unlicense |
underscoredam/rubiks-cube | box.py | 1 | 2507 | '''The class for the cells of the cube to lie.
Cells are also referred as pieces or boxes in this project.
Coordinates start with 0 and end with 2.
coordinates are currently calculated with green on front, red on left and white on bottom.
Currently, (0,0,0) goes for the corner Cell of front-left-bottom.'''
from headers... | gpl-2.0 |
underyx/ansible-modules-core | source_control/hg.py | 41 | 8674 | #!/usr/bin/python
#-*- coding: utf-8 -*-
# (c) 2013, Yeukhon Wong <yeukhon@acm.org>
# (c) 2014, Nate Coraor <nate@bx.psu.edu>
#
# This module was originally inspired by Brad Olson's ansible-module-mercurial
# <https://github.com/bradobro/ansible-module-mercurial>. This module tends
# to follow the git module implement... | gpl-3.0 |
ToonTownInfiniteRepo/ToontownInfinite | Panda3D-1.9.0/Pmw/Pmw_1_3/contrib/PmwVerticalGauge.py | 7 | 6594 | """
I needed a simple gauge, so I've made on with Pmw.
It might be useful for others to use as a base to develop more comples
gauges with.
Is it worth cleaning up and submitting?
cheers and thanks
chris
Dr. Chris Wright
Intensive Care Unit
Monash Medical Centre
Clayton. VIC Australia
"""
import sys
import Tkin... | mit |
kedaio/tushare | tushare/stock/ref_vars.py | 1 | 3865 | # -*- coding:utf-8 -*-
DP_URL = '%sapp.finance.%s/data/stock/%s?day=&page=%s'
DP_163_URL = '%squotes.%s/data/caibao/%s?reportdate=%s&sort=declaredate&order=desc&page=%s'
FUND_HOLDS_URL = '%squotes.%s/hs/marketdata/service/%s?host=/hs/marketdata/service/%s&page=%s&query=start:%s;end:%s&order=desc&count=60&type=que... | bsd-3-clause |
ray-project/ray | dashboard/modules/runtime_env/runtime_env_agent.py | 1 | 3807 | import asyncio
import json
import logging
from ray.core.generated import runtime_env_agent_pb2
from ray.core.generated import runtime_env_agent_pb2_grpc
from ray.core.generated import agent_manager_pb2
import ray.new_dashboard.utils as dashboard_utils
import ray.new_dashboard.modules.runtime_env.runtime_env_consts \
... | apache-2.0 |
cloud9UG/odoo | addons/hr_timesheet_invoice/wizard/hr_timesheet_analytic_profit.py | 337 | 3122 | # -*- 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 |
sv-dev1/odoo | openerp/exceptions.py | 312 | 3157 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2011 OpenERP s.a. (<http://openerp.com>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the G... | agpl-3.0 |
dnguyen0304/tuxedo-mask | tuxedo_mask/services/tuxedo_mask_service.py | 1 | 1972 | # -*- coding: utf-8 -*-
import logging
import bcrypt
import sqlalchemy
from common import database
from . import BaseService
from tuxedo_mask import configuration, repositories
class TuxedoMaskService(BaseService):
_db_context_factory = database.DBContextFactory(
connection_string=configuration['postg... | mit |
mitsei/dlkit | dlkit/services/locale.py | 1 | 14818 | """DLKit Services implementations of locale service."""
# pylint: disable=no-init
# osid specification includes some 'marker' interfaces.
# pylint: disable=too-many-ancestors
# number of ancestors defined in spec.
# pylint: disable=too-few-public-methods,too-many-public-methods
# number of methods defined i... | mit |
redbear/micropython | tests/basics/string_format_modulo.py | 47 | 2022 | print("%%" % ())
print("=%s=" % 1)
print("=%s=%s=" % (1, 2))
print("=%s=" % (1,))
print("=%s=" % [1, 2])
print("=%s=" % "str")
print("=%r=" % "str")
try:
print("=%s=%s=" % 1)
except TypeError:
print("TypeError")
try:
print("=%s=%s=%s=" % (1, 2))
except TypeError:
print("TypeError")
try:
print("=... | mit |
mapzen/vector-datasource | integration-test/1625-parking.py | 2 | 4700 | # -*- encoding: utf-8 -*-
from . import FixtureTest
class ParkingTest(FixtureTest):
def test_parking_node(self):
import dsl
z, x, y = (16, 10477, 25330)
self.generate_fixtures(
# https://www.openstreetmap.org/node/1706619902
dsl.point(1706619902, (-122.445233, 37... | mit |
ganeshrn/ansible | test/units/vars/test_module_response_deepcopy.py | 118 | 1473 | # -*- coding: utf-8 -*-
# (c) 2018 Matt Martz <matt@sivel.net>
# 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
from ansible.vars.clean import module_response_deepcopy
import pytest
def... | gpl-3.0 |
sfrenza/test-for-bot | venv/Lib/site-packages/jinja2/tests.py | 130 | 4428 | # -*- coding: utf-8 -*-
"""
jinja2.tests
~~~~~~~~~~~~
Jinja test functions. Used with the "is" operator.
:copyright: (c) 2017 by the Jinja Team.
:license: BSD, see LICENSE for more details.
"""
import re
from collections import Mapping
from jinja2.runtime import Undefined
from jinja2._compat impor... | mit |
MiczFlor/Booktype | lib/booktype/convert/runner.py | 10 | 2034 | # This file is part of Booktype.
# Copyright (c) 2013 Borko Jandras <borko.jandras@sourcefabric.org>
#
# Booktype is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (a... | agpl-3.0 |
v-superuser/android_kernel_sony_msm8960 | scripts/rt-tester/rt-tester.py | 11005 | 5307 | #!/usr/bin/python
#
# rt-mutex tester
#
# (C) 2006 Thomas Gleixner <tglx@linutronix.de>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 2 as
# published by the Free Software Foundation.
#
import os
import sys
import getopt
import sh... | gpl-2.0 |
stopstalk/stopstalk-deployment | aws_lambda/spoj_aws_lambda_function/lambda_code/lxml/html/diff.py | 71 | 30500 | import difflib
from lxml import etree
from lxml.html import fragment_fromstring
import re
__all__ = ['html_annotate', 'htmldiff']
try:
from html import escape as html_escape
except ImportError:
from cgi import escape as html_escape
try:
_unicode = unicode
except NameError:
# Python 3
_unicode = st... | mit |
thaim/ansible | test/units/modules/network/netvisor/test_pn_vrouter_bgp.py | 23 | 3292 | # Copyright: (c) 2018, Pluribus Networks
# 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
from units.compat.mock import patch
from ansible.modules.network.netvisor import pn_vrouter_bgp
... | mit |
WebSpider/headphones | lib/cherrypy/lib/auth.py | 68 | 3224 | import cherrypy
from cherrypy.lib import httpauth
def check_auth(users, encrypt=None, realm=None):
"""If an authorization header contains credentials, return True or False.
"""
request = cherrypy.serving.request
if 'authorization' in request.headers:
# make sure the provided credentials are co... | gpl-3.0 |
aaronkaplan/intelmq-old | tests/pipeline-redis.py | 4 | 4756 | import redis
import time
class Pipeline():
def __init__(self, source_queue, destination_queues, host="127.0.0.1", port="6379", db=10):
self.source_queue = source_queue
self.destination_queues = destination_queues
self.redis = redis.Redis( host = host,
... | agpl-3.0 |
hajicj/safire | build/lib/test/test_safire_transformer.py | 2 | 5983 | """
Testing the test procedure itself.
"""
import logging
import os
import unittest
from gensim import similarities
from gensim.interfaces import TransformedCorpus
from gensim.matutils import sparse2full
from safire.data.imagenetcorpus import ImagenetCorpus
from safire.data.vtextcorpus import VTextCorpus
from safire.... | gpl-3.0 |
jakobworldpeace/scikit-learn | sklearn/neighbors/tests/test_nearest_centroid.py | 305 | 4121 | """
Testing for the nearest centroid module.
"""
import numpy as np
from scipy import sparse as sp
from numpy.testing import assert_array_equal
from numpy.testing import assert_equal
from sklearn.neighbors import NearestCentroid
from sklearn import datasets
from sklearn.metrics.pairwise import pairwise_distances
# t... | bsd-3-clause |
daniula/python-social-auth | social/backends/skyrock.py | 83 | 1195 | """
Skyrock OAuth1 backend, docs at:
http://psa.matiasaguirre.net/docs/backends/skyrock.html
"""
from social.backends.oauth import BaseOAuth1
class SkyrockOAuth(BaseOAuth1):
"""Skyrock OAuth authentication backend"""
name = 'skyrock'
ID_KEY = 'id_user'
AUTHORIZATION_URL = 'https://api.skyrock.com/... | bsd-3-clause |
mbruggmann/luigi | test/task_history_test.py | 26 | 1687 | # -*- coding: utf-8 -*-
#
# Copyright 2012-2015 Spotify AB
#
# 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 |
andris210296/andris-projeto | backend/venv/lib/python2.7/site-packages/unidecode/x058.py | 252 | 4678 | data = (
'Ku ', # 0x00
'Ke ', # 0x01
'Tang ', # 0x02
'Kun ', # 0x03
'Ni ', # 0x04
'Jian ', # 0x05
'Dui ', # 0x06
'Jin ', # 0x07
'Gang ', # 0x08
'Yu ', # 0x09
'E ', # 0x0a
'Peng ', # 0x0b
'Gu ', # 0x0c
'Tu ', # 0x0d
'Leng ', # 0x0e
'[?] ', # 0x0f
'Ya ', # 0x10
'Qian ', ... | mit |
lxsmnv/spark | python/pyspark/mllib/recommendation.py | 28 | 11729 | #
# 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 us... | apache-2.0 |
da1z/intellij-community | python/lib/Lib/sndhdr.py | 174 | 5971 | """Routines to help recognizing sound files.
Function whathdr() recognizes various types of sound file headers.
It understands almost all headers that SOX can decode.
The return tuple contains the following items, in this order:
- file type (as SOX understands it)
- sampling rate (0 if unknown or hard to decode)
- nu... | apache-2.0 |
acebrianm/MinimaList | Crypto/SelfTest/Random/OSRNG/test_posix.py | 131 | 1777 | # -*- coding: utf-8 -*-
#
# SelfTest/Util/test_posix.py: Self-test for the OSRNG.posix.new() function
#
# Written in 2008 by Dwayne C. Litzenberger <dlitz@dlitz.net>
#
# ===================================================================
# The contents of this file are dedicated to the public domain. To
# the extent ... | gpl-3.0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.