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 |
|---|---|---|---|---|---|
MonicaHsu/truvaluation | venv/lib/python2.7/idlelib/HyperParser.py | 64 | 10562 | """
HyperParser
===========
This module defines the HyperParser class, which provides advanced parsing
abilities for the ParenMatch and other extensions.
The HyperParser uses PyParser. PyParser is intended mostly to give information
on the proper indentation of code. HyperParser gives some information on the
structure ... | mit |
caspartse/QQ-Groups-Spider | vendor/xlsxwriter/chart_pie.py | 2 | 6168 | ###############################################################################
#
# ChartPie - A class for writing the Excel XLSX Pie charts.
#
# Copyright 2013-2017, John McNamara, jmcnamara@cpan.org
#
from warnings import warn
from . import chart
class ChartPie(chart.Chart):
"""
A class for writing the Exc... | mit |
fluentpython/example-code | 16-coroutine/yield_from_expansion.py | 7 | 1356 | # Code below is the expansion of the statement:
#
# RESULT = yield from EXPR
#
# Copied verbatim from the Formal Semantics section of
# PEP 380 -- Syntax for Delegating to a Subgenerator
#
# https://www.python.org/dev/peps/pep-0380/#formal-semantics
# BEGIN YIELD_FROM_EXPANSION
_i = iter(EXPR) # <1>
try:
_y = ne... | mit |
CODEiverse/SassyMQ-OpenSourceTools | PySassyMQ/SassyMQ/pika/callback.py | 14 | 14897 | """Callback management class, common area for keeping track of all callbacks in
the Pika stack.
"""
import functools
import logging
from pika import frame
from pika import amqp_object
from pika.compat import xrange, canonical_str
LOGGER = logging.getLogger(__name__)
def name_or_value(value):
"""Will take Frame... | mpl-2.0 |
sander76/home-assistant | tests/components/rflink/test_binary_sensor.py | 8 | 5886 | """
Test for RFlink sensor components.
Test setup of rflink sensor component/platform. Verify manual and
automatic sensor creation.
"""
from datetime import timedelta
from unittest.mock import patch
from homeassistant.components.rflink import CONF_RECONNECT_INTERVAL
from homeassistant.const import (
EVENT_STATE_C... | apache-2.0 |
Svolcano/python_exercise | dianhua/worker/crawler/china_mobile/wap/zhejiang/main.py | 1 | 27693 | # -*- coding:utf-8 -*-
import sys
import re
import time
import random
import base64
from lxml import etree
from dateutil.relativedelta import relativedelta
reload(sys)
sys.setdefaultencoding('utf8')
import datetime
import traceback
if __name__ == '__main__':
sys.path.append('..')
sys.p... | mit |
viveksh13/gymkhana | venv/bin/venv/lib/python2.7/site-packages/werkzeug/contrib/securecookie.py | 294 | 12204 | # -*- coding: utf-8 -*-
r"""
werkzeug.contrib.securecookie
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
This module implements a cookie that is not alterable from the client
because it adds a checksum the server checks for. You can use it as
session replacement if all you have is a user id or something to mark
... | apache-2.0 |
ianyfan/alevel | build.py | 1 | 5117 | #!venv/bin/python
import os
import markdown
md = markdown.Markdown(output_format='html5',
extensions=['markdown.extensions.tables', 'markdown.extensions.nl2br'])
def make_nav(node):
if 'href' in node:
indent = ' '*(2*len(node['href']) + 6)
if 'children' in node:
children = '\n'.join(map(l... | mit |
alephu5/Soundbyte | environment/lib/python3.3/site-packages/IPython/nbconvert/postprocessors/pdf.py | 7 | 5956 | """
Contains writer for writing nbconvert output to PDF.
"""
#-----------------------------------------------------------------------------
#Copyright (c) 2013, the IPython Development Team.
#
#Distributed under the terms of the Modified BSD License.
#
#The full license is in the file COPYING.txt, distributed with this... | gpl-3.0 |
loongson-community/EFI-MIPS | ToolKit/cmds/python/Lib/test/bad/test_trace.py | 12 | 17884 | # Testing the line trace facility.
from test import test_support
import unittest
import sys
import difflib
# A very basic example. If this fails, we're in deep trouble.
def basic():
return 1
basic.events = [(0, 'call'),
(1, 'line'),
(1, 'return')]
# Armin Rigo's failing example:... | bsd-3-clause |
saketkc/moca-scripts | encode_images.py | 1 | 10888 | from __future__ import division
import os
from pymongo import MongoClient
import numpy as np
from moca.helpers import read_memefile, get_total_sequences
from moca.helpers.db import create_binary_pickle, encode_image#, unpickle_numpy_array
from moca.helpers import get_max_occuring_bases, search_files
#from moca.helpers ... | isc |
lduarte1991/edx-platform | lms/djangoapps/instructor_analytics/distributions.py | 23 | 5761 | """
Profile Distributions
Aggregate sums for values of fields in students profiles.
For example:
The distribution in a course for gender might look like:
'gender': {
'type': 'EASY_CHOICE',
'data': {
'no_data': 1234,
'm': 5678,
'o': 2134,
'f': 5678
},
'display_names': {
... | agpl-3.0 |
tonygalmiche/is_plastigray | is_reach.py | 1 | 16005 | # -*- coding: utf-8 -*-
from openerp import models,fields,api,SUPERUSER_ID
from openerp.tools.translate import _
from openerp.exceptions import Warning
import datetime
import logging
_logger = logging.getLogger(__name__)
class is_reach(models.Model):
_name='is.reach'
_order='name desc'
name = fi... | mit |
anilmuthineni/tensorflow | tensorflow/contrib/learn/python/learn/datasets/__init__.py | 121 | 3534 | # 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 |
mushtaqak/edx-platform | openedx/core/lib/api/authentication.py | 87 | 3391 | """ Common Authentication Handlers used across projects. """
from rest_framework import authentication
from rest_framework.exceptions import AuthenticationFailed
from rest_framework.compat import oauth2_provider, provider_now
class SessionAuthenticationAllowInactiveUser(authentication.SessionAuthentication):
"""E... | agpl-3.0 |
whitepages/nova | nova/api/openstack/auth.py | 10 | 3108 | # Copyright 2013 IBM Corp.
# Copyright 2010 OpenStack Foundation
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LIC... | apache-2.0 |
XiaosongWei/blink-crosswalk | Tools/Scripts/webkitpy/common/message_pool.py | 61 | 12097 | # 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 |
taedori81/django-oscar | src/oscar/core/decorators.py | 15 | 1104 | try:
from types import ClassType
except ImportError:
# Python 3
CHECK_TYPES = (type,)
else:
# Python 2: new and old-style classes
CHECK_TYPES = (type, ClassType)
import warnings
def deprecated(obj):
if isinstance(obj, CHECK_TYPES):
return _deprecated_cls(cls=obj)
else:
retu... | bsd-3-clause |
tamirda/T805_PhoeniX_Kernel_Lollipop | tools/perf/scripts/python/check-perf-trace.py | 11214 | 2503 | # perf script event handlers, generated by perf script -g python
# (c) 2010, Tom Zanussi <tzanussi@gmail.com>
# Licensed under the terms of the GNU GPL License version 2
#
# This script tests basic functionality such as flag and symbol
# strings, common_xxx() calls back into perf, begin, end, unhandled
# events, etc. ... | gpl-2.0 |
amaringarcia/AliPhysics | PWGJE/EMCALJetTasks/Tracks/analysis/GetEventCount.py | 41 | 1824 | #**************************************************************************
#* Copyright(c) 1998-2014, ALICE Experiment at CERN, All rights reserved. *
#* *
#* Author: The ALICE Off-line Project. *
#* Contributors ... | bsd-3-clause |
shadyueh/pyranking | env/lib/python2.7/site-packages/django/core/management/commands/inspectdb.py | 27 | 12213 | from __future__ import unicode_literals
import keyword
import re
from collections import OrderedDict
from django.core.management.base import BaseCommand, CommandError
from django.db import DEFAULT_DB_ALIAS, connections
class Command(BaseCommand):
help = "Introspects the database tables in the given database and... | mit |
ramiro/pymssql | tests/test_threaded.py | 6 | 3066 | import sys
import threading
import time
import unittest
from _mssql import MSSQLDatabaseException
from .helpers import mssqlconn, StoredProc, mark_slow
error_sproc = StoredProc(
"pymssqlErrorThreadTest",
args=(),
body="SELECT unknown_column FROM unknown_table")
class _TestingThread(threading.Thread):
... | lgpl-2.1 |
bhargavkumar040/android-source-browsing.platform--external--chromium-trace | trace-viewer/third_party/closure_linter/closure_linter/common/position.py | 285 | 3324 | #!/usr/bin/env python
#
# Copyright 2008 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 |
soldag/home-assistant | tests/components/utility_meter/test_init.py | 6 | 3564 | """The tests for the utility_meter component."""
from datetime import timedelta
from homeassistant.components.sensor import DOMAIN as SENSOR_DOMAIN
from homeassistant.components.utility_meter.const import (
ATTR_TARIFF,
DOMAIN,
SERVICE_RESET,
SERVICE_SELECT_NEXT_TARIFF,
SERVICE_SELECT_TARIFF,
)
fro... | apache-2.0 |
atsolakid/edx-platform | common/test/acceptance/pages/lms/pay_and_verify.py | 110 | 6385 | """Payment and verification pages"""
import re
from bok_choy.page_object import PageObject
from bok_choy.promise import Promise
from . import BASE_URL
from .dashboard import DashboardPage
class PaymentAndVerificationFlow(PageObject):
"""Interact with the split payment and verification flow.
The flow can be... | agpl-3.0 |
napalm-automation/napalm-yang | napalm_yang/models/openconfig/network_instances/network_instance/protocols/protocol/isis/levels/level/link_state_database/lsp/tlvs/tlv/extended_ipv4_reachability/prefixes/prefix/subTLVs/subTLVs_/prefix_sid/__init__.py | 1 | 15078 | # -*- coding: utf-8 -*-
from operator import attrgetter
from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType
from pyangbind.lib.yangtypes import RestrictedClassType
from pyangbind.lib.yangtypes import TypedListType
from pyangbind.lib.yangtypes import YANGBool
from pyangbind.lib.yangtypes import YANGListTy... | apache-2.0 |
yongshengwang/hue | build/env/lib/python2.7/site-packages/boto-2.38.0-py2.7.egg/boto/ec2/elb/policies.py | 152 | 3856 | # Copyright (c) 2010 Reza Lotun http://reza.lotun.name
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use, copy, modify, m... | apache-2.0 |
noplay/gns3-gui | setup.py | 1 | 2642 | # -*- coding: utf-8 -*-
#
# Copyright (C) 2013 GNS3 Technologies 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.
... | gpl-3.0 |
srio/Orange-XOPPY | orangecontrib/xoppy/util/xoppy_undulators.py | 1 | 20777 | # --------------------------------------------------------------------------------------------
# --------------------------------------------------------------------------------------------
import numpy
import os
from collections import OrderedDict
from orangecontrib.xoppy.util import srundplug
from orangecontrib.xo... | bsd-2-clause |
teriyakichild/ansible-modules-extras | packaging/os/pkgin.py | 13 | 7314 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright (c) 2013 Shaun Zinck <shaun.zinck at gmail.com>
# Copyright (c) 2015 Lawrence Leonard Gilbert <larry@L2G.to>
#
# Written by Shaun Zinck
# Based on pacman module written by Afterburn <http://github.com/afterburn>
# that was based on apt module written by Matthew Wi... | gpl-3.0 |
elssar/calibre | src/calibre/ebooks/docx/lcid.py | 16 | 7963 | #!/usr/bin/env python2
# vim:fileencoding=utf-8
from __future__ import (unicode_literals, division, absolute_import,
print_function)
__license__ = 'GPL v3'
__copyright__ = '2013, Kovid Goyal <kovid at kovidgoyal.net>'
lcid = {
1078: 'af', # Afrikaans - South Africa
1052: 'sq', # Alba... | gpl-3.0 |
luogangyi/bcec-nova | nova/cells/scheduler.py | 10 | 14395 | # Copyright (c) 2012 Rackspace Hosting
# 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 req... | apache-2.0 |
gauravbose/digital-menu | django/conf/locale/eo/formats.py | 115 | 2335 | # -*- encoding: utf-8 -*-
# This file is distributed under the same license as the Django package.
#
from __future__ import unicode_literals
# The *_FORMAT strings use the Django date format syntax,
# see http://docs.djangoproject.com/en/dev/ref/templates/builtins/#date
DATE_FORMAT = r'j\-\a \d\e F Y' # '26-a ... | bsd-3-clause |
endorphinl/horizon | openstack_dashboard/api/rest/cinder.py | 47 | 2447 | # Copyright 2015 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 writing, sof... | apache-2.0 |
pomegranited/edx-platform | cms/djangoapps/contentstore/tests/test_request_event.py | 234 | 1654 | """Tests for CMS's requests to logs"""
import mock
from django.test import TestCase
from django.core.urlresolvers import reverse
from contentstore.views.helpers import event as cms_user_track
class CMSLogTest(TestCase):
"""
Tests that request to logs from CMS return 204s
"""
def test_post_answers_to... | agpl-3.0 |
ldoktor/autotest | utils/modelviz/generate_schema_diagrams.py | 6 | 1387 | #!/usr/bin/env python
"""
Generates schema diagrams for Django apps. Just run the script with no
arguments. If you don't have them installed, you'll need "dot" from the
Graphviz package and Django.
"""
try:
import autotest.common as common
except ImportError:
import common
import os
ROOT_DIR = os.path.absp... | gpl-2.0 |
AOSP-S4-KK/platform_external_chromium_org | tools/perf/page_sets/PRESUBMIT.py | 23 | 2898 | # Copyright (c) 2013 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 os
import re
import sys
def LoadSupport(input_api):
if 'cloud_storage' not in globals():
# Avoid leaking changes to global sys.path.
_... | bsd-3-clause |
duthchao/kaggle-galaxies | predict_augmented_npy_maxout2048_pysex.py | 7 | 9584 | """
Load an analysis file and redo the predictions on the validation set / test set,
this time with augmented data and averaging. Store them as numpy files.
"""
import numpy as np
# import pandas as pd
import theano
import theano.tensor as T
import layers
import cc_layers
import custom
import load_data
import realtime... | bsd-3-clause |
anhaidgroup/py_stringsimjoin | py_stringsimjoin/join/overlap_coefficient_join_py.py | 1 | 17453 | # overlap coefficient join
from joblib import delayed, Parallel
from six import iteritems
import pandas as pd
import pyprind
from py_stringsimjoin.filter.overlap_filter import OverlapFilter
from py_stringsimjoin.index.inverted_index import InvertedIndex
from py_stringsimjoin.utils.generic_helper import convert_datafra... | bsd-3-clause |
sorenh/cc | vendor/python-gflags/gflags_helpxml_test.py | 3 | 20720 | #!/usr/bin/env python
# Copyright (c) 2009, 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 l... | apache-2.0 |
Lorquas/subscription-manager | src/subscription_manager/entbranding.py | 2 | 4959 | from __future__ import print_function, division, absolute_import
#
# Copyright (c) 2013 Red Hat, Inc.
#
#
# This software is licensed to you under the GNU General Public License,
# version 2 (GPLv2). There is NO WARRANTY for this software, express or
# implied, including the implied warranties of MERCHANTABILITY or FI... | gpl-2.0 |
audaciouscode/Books-Mac-OS-X | Versions/Books_3.0b3/Amazon (FR).plugin/Contents/Resources/amazon.py | 126 | 16017 | """Python wrapper
for Amazon web APIs
This module allows you to access Amazon's web APIs,
to do things like search Amazon and get the results programmatically.
Described here:
http://www.amazon.com/webservices
You need a Amazon-provided license key to use these services.
Follow the link above to get one. These f... | mit |
fweik/espresso | testsuite/python/cluster_analysis.py | 3 | 6991 | #
# Copyright (C) 2013-2019 The ESPResSo project
#
# This file is part of ESPResSo.
#
# ESPResSo 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... | gpl-3.0 |
janusnic/youtube-dl-GUI | youtube_dl/extractor/instagram.py | 31 | 4339 | from __future__ import unicode_literals
import re
from .common import InfoExtractor
from ..utils import (
int_or_none,
)
class InstagramIE(InfoExtractor):
_VALID_URL = r'http://instagram\.com/p/(?P<id>.*?)/'
_TEST = {
'url': 'http://instagram.com/p/aye83DjauH/?foo=bar#abc',
'md5': '0d2da... | mit |
cohortfsllc/cohort-cocl2-sandbox | pynacl/fake_storage.py | 8 | 1391 | #!/usr/bin/python
# Copyright (c) 2012 The Native Client Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Fake (similar in memory implementation) version of GSDStorage."""
import file_tools
class FakeStorage(object):
"""Testing... | bsd-3-clause |
gitsimon/tq_website | survey/admin.py | 2 | 2121 | from django.contrib import admin
from parler.admin import TranslatableAdmin, TranslatableTabularInline
import courses
from courses.filters import SubscribeOfferingListFilter, SubscribeCourseListFilter
from .admin_actions import *
from survey.models import *
class QuestionGroupInline(TranslatableTabularInline):
m... | gpl-2.0 |
komsas/OpenUpgrade | openerp/report/printscreen/ps_form.py | 381 | 5211 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU... | agpl-3.0 |
Lilykos/invenio | invenio/legacy/bibdocfile/plugins/bom_textdoc.py | 13 | 6894 | # This file is part of Invenio.
# Copyright (C) 2007, 2008, 2009, 2010, 2011, 2014 CERN.
#
# Invenio is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License as
# published by the Free Software Foundation; either version 2 of the
# License, or (at your option) any l... | gpl-2.0 |
vladon/omim | 3party/protobuf/python/google/protobuf/service.py | 243 | 9144 | # 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... | apache-2.0 |
manevant/django-oscar | src/oscar/apps/analytics/abstract_models.py | 32 | 3577 | from decimal import Decimal
from django.db import models
from django.utils.encoding import python_2_unicode_compatible
from django.utils.translation import ugettext_lazy as _
from oscar.core.compat import AUTH_USER_MODEL
@python_2_unicode_compatible
class AbstractProductRecord(models.Model):
"""
A record of ... | bsd-3-clause |
TimYi/django | django/core/files/images.py | 429 | 2428 | """
Utility functions for handling images.
Requires Pillow as you might imagine.
"""
import struct
import zlib
from django.core.files import File
class ImageFile(File):
"""
A mixin for use alongside django.core.files.base.File, which provides
additional features for dealing with images.
"""
def ... | bsd-3-clause |
reddit-diabetes/musicbot-cloud | musicbot/lib/event_emitter.py | 2 | 1098 | import asyncio
import traceback
import collections
class EventEmitter:
def __init__(self):
self._events = collections.defaultdict(list)
self.loop = asyncio.get_event_loop()
def emit(self, event, *args, **kwargs):
if event not in self._events:
return
for cb in list... | mit |
toshywoshy/ansible | test/units/modules/network/fortios/test_fortios_switch_controller_custom_command.py | 21 | 8565 | # 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 |
hemberger/MechanicalSoup | tests/utils.py | 1 | 3376 | import mechanicalsoup
import requests_mock
from distutils.version import StrictVersion
import bs4
try:
from urllib.parse import parse_qsl
except ImportError:
from urlparse import parse_qsl
"""
Utilities for testing MechanicalSoup.
"""
choose_submit_form = '''
<html>
<body>
<!-- vaguely based on Trac edi... | mit |
matsv339/Cast-Away | assets/libs/bower_components/bootstrap/node_modules/npm-shrinkwrap/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/ninja_syntax.py | 2485 | 5536 | # This file comes from
# https://github.com/martine/ninja/blob/master/misc/ninja_syntax.py
# Do not edit! Edit the upstream one instead.
"""Python module for generating .ninja files.
Note that this is emphatically not a required piece of Ninja; it's
just a helpful utility for build-file-generation systems that alr... | mit |
aleksandr-bakanov/astropy | astropy/units/format/ogip_lextab.py | 6 | 1540 | # -*- coding: utf-8 -*-
# Licensed under a 3-clause BSD style license - see LICENSE.rst
# This file was automatically generated from ply. To re-generate this file,
# remove it from this folder, then build astropy and run the tests in-place:
#
# python setup.py build_ext --inplace
# pytest astropy/units
#
# You can... | bsd-3-clause |
camilonova/sentry | tests/sentry/web/frontend/test_accept_organization_invite.py | 26 | 3200 | from __future__ import absolute_import
from django.core.urlresolvers import reverse
from sentry.models import (
AuditLogEntry, AuditLogEntryEvent, OrganizationMember,
OrganizationMemberType
)
from sentry.testutils import TestCase
class AcceptInviteTest(TestCase):
def setUp(self):
super(AcceptInv... | bsd-3-clause |
williamthegrey/swift | swift/common/header_key_dict.py | 5 | 1990 | # Copyright (c) 2010-2012 OpenStack Foundation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agree... | apache-2.0 |
simbs/edx-platform | common/djangoapps/terrain/stubs/tests/test_ora.py | 91 | 10651 | """
Unit tests for stub ORA implementation.
"""
import unittest
import requests
import json
from ..ora import StubOraService, StudentState
class StubOraServiceTest(unittest.TestCase):
def setUp(self):
"""
Start the stub server.
"""
super(StubOraServiceTest, self).setUp()
... | agpl-3.0 |
promptworks/horizon | openstack_dashboard/dashboards/admin/networks/agents/tables.py | 61 | 3394 | # Copyright 2014 Kylincloud
#
# 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 ... | apache-2.0 |
harihpr/tweetclickers | test/test_model/test_model_task.py | 3 | 1809 | # -*- coding: utf8 -*-
# This file is part of PyBossa.
#
# Copyright (C) 2013 SF Isle of Man Limited
#
# PyBossa is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at... | agpl-3.0 |
bowang/tensorflow | tensorflow/contrib/learn/python/learn/datasets/__init__.py | 121 | 3534 | # 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 |
talele08/appengine-mapreduce | python/test/mapreduce/util_test.py | 15 | 10637 | #!/usr/bin/env python
# Copyright 2010 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required ... | apache-2.0 |
yifeng-li/DECRES | cA.py | 1 | 13116 | """
A module of contractive autoencoder modified
from the Deep Learning Tutorials (www.deeplearning.net/tutorial/).
Copyright (c) 2008-2013, Theano Development Team All rights reserved.
Modified by Yifeng Li
CMMT, UBC, Vancouver
Sep 23, 2014
Contact: yifeng.li.cn@gmail.com
"""
from __future__ import division
import ... | bsd-3-clause |
ammarkhann/FinalSeniorCode | lib/python2.7/site-packages/nbconvert/exporters/base.py | 8 | 3720 | """Module containing single call export functions."""
# Copyright (c) Jupyter Development Team.
# Distributed under the terms of the Modified BSD License.
import warnings
import entrypoints
from traitlets.log import get_logger
from traitlets.utils.importstring import import_item
from nbformat import NotebookNode
f... | mit |
bitifirefly/edx-platform | common/test/acceptance/pages/lms/matlab_problem.py | 179 | 1024 | """
Matlab Problem Page.
"""
from bok_choy.page_object import PageObject
class MatlabProblemPage(PageObject):
"""
View of matlab problem page.
"""
url = None
def is_browser_on_page(self):
return self.q(css='.ungraded-matlab-result').present
@property
def problem_name(self):
... | agpl-3.0 |
google/nsscache | nss_cache/caches/files_test.py | 1 | 10874 | # Copyright 2007 Google 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 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the ho... | gpl-2.0 |
akaariai/django | docs/_ext/ticket_role.py | 401 | 1183 | """
An interpreted text role to link docs to Trac tickets.
To use: :ticket:`XXXXX`
Based on code from psycopg2 by Daniele Varrazzo.
"""
from docutils import nodes, utils
from docutils.parsers.rst import roles
def ticket_role(name, rawtext, text, lineno, inliner, options=None, content=None):
if options is None:
... | bsd-3-clause |
agrista/odoo-saas | addons/l10n_sg/__init__.py | 669 | 1059 | # -*- encoding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2014 Tech Receptives (<http://techreceptives.com>).
#
# This program is free software: you can redistribute it and/or modify
# it under the te... | agpl-3.0 |
SebasSBM/django | django/contrib/messages/storage/base.py | 526 | 6285 | from __future__ import unicode_literals
from django.conf import settings
from django.contrib.messages import constants, utils
from django.utils.encoding import force_text, python_2_unicode_compatible
LEVEL_TAGS = utils.get_level_tags()
@python_2_unicode_compatible
class Message(object):
"""
Represents an ac... | bsd-3-clause |
ChileanVirtualObservatory/flask_endpoint | endpoint/app/__init__.py | 1 | 2299 | #This file is part of ChiVO, the Chilean Virtual Observatory
#A project sponsored by FONDEF (D11I1060)
#Copyright (C) 2015 Universidad Tecnica Federico Santa Maria Mauricio Solar
# Marcelo Mendoza
# Universidad de Chile Die... | gpl-3.0 |
persandstrom/home-assistant | homeassistant/components/light/tellstick.py | 5 | 2832 | """
Support for Tellstick lights.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/light.tellstick/
"""
from homeassistant.components.light import (
ATTR_BRIGHTNESS, SUPPORT_BRIGHTNESS, Light)
from homeassistant.components.tellstick import (
DEFAU... | apache-2.0 |
PaddlePaddle/Paddle | python/paddle/jit/dy2static/convert_operators.py | 1 | 2230 | # Copyright (c) 2020 PaddlePaddle 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 app... | apache-2.0 |
andrew-furtak/chipsec | chipsec/modules/common/spi_desc.py | 7 | 2868 | #CHIPSEC: Platform Security Assessment Framework
#Copyright (c) 2010-2015, Intel Corporation
#
#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; Version 2.
#
#This program is distributed in the hope... | gpl-2.0 |
NiclasEriksen/py-towerwars | src/pyglet/libs/darwin/cocoapy/runtime.py | 36 | 51220 | # objective-ctypes
#
# Copyright (c) 2011, Phillip Nguyen
# 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 o... | cc0-1.0 |
google/contentbox | main/managers.py | 4 | 1622 | # Copyright 2015 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable ... | apache-2.0 |
Brainiq7/Ananse | ananse_dl/extractor/ign.py | 23 | 5296 | from __future__ import unicode_literals
import re
from .common import InfoExtractor
class IGNIE(InfoExtractor):
"""
Extractor for some of the IGN sites, like www.ign.com, es.ign.com de.ign.com.
Some videos of it.ign.com are also supported
"""
_VALID_URL = r'https?://.+?\.ign\.com/(?P<type>video... | unlicense |
40223117cda/w17test | static/Brython3.1.0-20150301-090019/Lib/select.py | 730 | 9440 | """
borrowed from jython
https://bitbucket.org/jython/jython/raw/28a66ba038620292520470a0bb4dc9bb8ac2e403/Lib/select.py
"""
#import java.nio.channels.SelectableChannel
#import java.nio.channels.SelectionKey
#import java.nio.channels.Selector
#from java.nio.channels.SelectionKey import OP_ACCEPT, OP_CONNECT, OP_WRITE, ... | gpl-3.0 |
Tomsod/gemrb | gemrb/GUIScripts/GUISAVE.py | 1 | 10200 | # -*-python-*-
# GemRB - Infinity Engine Emulator
# Copyright (C) 2003 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 option) ... | gpl-2.0 |
duyuan11/glumpy | glumpy/geometry/arc.py | 4 | 6332 | # ----------------------------------------------------------------------------
# Anti-Grain Geometry (AGG) - Version 2.5
# A high quality rendering engine for C++
# Copyright (C) 2002-2006 Maxim Shemanarev
# Contact: mcseem@antigrain.com
# mcseemagg@yahoo.com
# http://antigrain.com
#
# AGG is... | bsd-3-clause |
nilmini20s/gem5-2016-08-13 | src/dev/pci/PciDevice.py | 23 | 7947 | # Copyright (c) 2013 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 functionality ... | bsd-3-clause |
rduivenvoorde/QGIS | python/plugins/processing/algs/gdal/rearrange_bands.py | 15 | 5693 | # -*- coding: utf-8 -*-
"""
***************************************************************************
rearrange_bands.py
---------------------
Date : August 2018
Copyright : (C) 2018 by Mathieu Pellerin
Email : nirvn dot asia at gmail dot com
************... | gpl-2.0 |
alzamer2/Crunchyroll-XML-Decoder | crunchy-xml-decoder/unidecode/x0bf.py | 253 | 5010 | data = (
'bbess', # 0x00
'bbeng', # 0x01
'bbej', # 0x02
'bbec', # 0x03
'bbek', # 0x04
'bbet', # 0x05
'bbep', # 0x06
'bbeh', # 0x07
'bbyeo', # 0x08
'bbyeog', # 0x09
'bbyeogg', # 0x0a
'bbyeogs', # 0x0b
'bbyeon', # 0x0c
'bbyeonj', # 0x0d
'bbyeonh', # 0x0e
'bbyeod', # 0x0f
'b... | gpl-2.0 |
fluendo/cerbero | test/test_cerbero_ide_pkgconfig.py | 4 | 3099 | #!/usr/bin/env python3
# cerbero - a multi-platform build system for Open Source software
# Copyright (C) 2012 Andoni Morales Alastruey <ylatuya@gmail.com>
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Library General Public
# License as published by the Free S... | lgpl-2.1 |
vmindru/ansible | lib/ansible/modules/cloud/azure/azure_rm_virtualnetwork_facts.py | 8 | 9932 | #!/usr/bin/python
#
# Copyright (c) 2016 Matt Davis, <mdavis@ansible.com>
# Chris Houseknecht, <house@redhat.com>
#
# 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
ANS... | gpl-3.0 |
psdh/servo | tests/wpt/css-tests/tools/pywebsocket/src/test/mock.py | 465 | 6715 | # Copyright 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 f... | mpl-2.0 |
Azure/azure-sdk-for-python | sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_01_01/aio/operations/_load_balancer_frontend_ip_configurations_operations.py | 1 | 8943 | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may ... | mit |
numairmansur/RoBO | examples/example_bagged_nets.py | 1 | 1284 | import sys
import logging
import numpy as np
import matplotlib.pyplot as plt
import robo.models.neural_network as robo_net
import robo.models.bagged_networks as bn
from robo.initial_design.init_random_uniform import init_random_uniform
logging.basicConfig(stream=sys.stdout, level=logging.INFO)
def f(x):
return... | bsd-3-clause |
Adai0808/scikit-learn | sklearn/cluster/tests/test_affinity_propagation.py | 341 | 2620 | """
Testing for Clustering methods
"""
import numpy as np
from sklearn.utils.testing import assert_equal
from sklearn.utils.testing import assert_array_equal
from sklearn.utils.testing import assert_raises
from sklearn.cluster.affinity_propagation_ import AffinityPropagation
from sklearn.cluster.affinity_propagatio... | bsd-3-clause |
mick-d/nipype | nipype/interfaces/freesurfer/tests/test_auto_RelabelHypointensities.py | 1 | 1446 | # AUTO-GENERATED by tools/checkspecs.py - DO NOT EDIT
from __future__ import unicode_literals
from ..utils import RelabelHypointensities
def test_RelabelHypointensities_inputs():
input_map = dict(args=dict(argstr='%s',
),
aseg=dict(argstr='%s',
mandatory=True,
position=-3,
),
environ=dict(... | bsd-3-clause |
projectcalico/calico-nova | nova/tests/unit/test_versions.py | 36 | 2070 | # Copyright 2011 Ken Pepple
#
# 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 agre... | apache-2.0 |
webOS-ports/qtwebkit | Tools/Scripts/webkitpy/tool/commands/perfalizer.py | 123 | 8751 | # Copyright (c) 2012 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 ... | gpl-2.0 |
praneethkumarpidugu/matchmaking | lib/python2.7/site-packages/django/core/serializers/xml_serializer.py | 95 | 15035 | """
XML serializer.
"""
from __future__ import unicode_literals
from xml.dom import pulldom
from xml.sax import handler
from xml.sax.expatreader import ExpatParser as _ExpatParser
from django.apps import apps
from django.conf import settings
from django.core.serializers import base
from django.db import DEFAULT_DB_A... | mit |
ebukoz/thrive | erpnext/accounts/doctype/budget/budget.py | 1 | 13426 | # -*- coding: utf-8 -*-
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and contributors
# For license information, please see license.txt
from __future__ import unicode_literals
import frappe
from frappe import _
from frappe.utils import flt, getdate, add_months, get_last_day, fmt_money, nowdate
from frappe.mode... | gpl-3.0 |
TheWeiTheTruthAndTheLight/senior-design | src/get_tweets.py | 1 | 5213 | """
get_tweets.py
usage: get_tweets.py [-h] [--sarcastic_path SARCASTIC_PATH]
[--non_sarcastic_path NON_SARCASTIC_PATH]
[--log_path LOG_PATH]
Query twitter API for tweets over last 7 days
optional arguments:
-h, --help show this help message and exit
--sarcast... | mit |
sassman/ansible-modules-core | cloud/rackspace/rax_cdb_database.py | 19 | 5218 | #!/usr/bin/python -tt
# 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 distrib... | gpl-3.0 |
gfairchild/pyHarmonySearch | pyharmonysearch/harmony_search.py | 1 | 13648 | """
Copyright (c) 2013, Triad National Security, LLC
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 lis... | bsd-3-clause |
Edraak/edraak-platform | openedx/core/djangoapps/programs/tasks/v1/tests/test_tasks.py | 9 | 18149 | """
Tests for programs celery tasks.
"""
import json
from datetime import datetime
import ddt
import httpretty
import mock
from celery.exceptions import MaxRetriesExceededError
from django.conf import settings
from django.test import override_settings, TestCase
from edx_oauth2_provider.tests.factories import ClientFact... | agpl-3.0 |
neheb/systemd | .ycm_extra_conf.py | 54 | 8410 | #!/usr/bin/env python
# SPDX-License-Identifier: Unlicense
#
# Based on the template file provided by the 'YCM-Generator' project authored by
# Reuben D'Netto.
# Jiahui Xie has re-reformatted and expanded the original script in accordance
# to the requirements of the PEP 8 style guide and 'systemd' project,
# respecti... | gpl-2.0 |
Tesi-Luca-Davide/ryu | ryu/lib/packet/ipv4.py | 28 | 5481 | # Copyright (C) 2012 Nippon Telegraph and Telephone Corporation.
#
# 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 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.