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 |
|---|---|---|---|---|---|
ysekky/GPy | GPy/testing/pep_tests.py | 6 | 3437 | # Copyright (c) 2014, James Hensman, 2016, Thang Bui
# Licensed under the BSD 3-clause license (see LICENSE.txt)
import unittest
import numpy as np
import GPy
class PEPgradienttest(unittest.TestCase):
def setUp(self):
######################################
# # 1 dimensional example
np.rand... | bsd-3-clause |
gennad/Django-nonrel-stub-for-Google-App-Engine | django/contrib/staticfiles/management/commands/findstatic.py | 244 | 1230 | import os
from optparse import make_option
from django.core.management.base import LabelCommand
from django.utils.encoding import smart_str, smart_unicode
from django.contrib.staticfiles import finders
class Command(LabelCommand):
help = "Finds the absolute paths for the given static file(s)."
args = "[file .... | bsd-3-clause |
ChinaMassClouds/copenstack-server | openstack/src/ceilometer-2014.2.2/ceilometer/storage/sqlalchemy/migrate_repo/versions/029_sample_recorded_at.py | 6 | 1118 | #
# 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... | gpl-2.0 |
ericzolf/ansible | lib/ansible/plugins/filter/core.py | 4 | 21595 | # (c) 2012, Jeroen Hoekx <jeroen@hoekx.be>
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.... | gpl-3.0 |
gencer/sentry | src/sentry/api/endpoints/organization_teams.py | 2 | 4795 | from __future__ import absolute_import
from django.db import IntegrityError, transaction
from rest_framework import serializers, status
from rest_framework.response import Response
from sentry.api.base import DocSection
from sentry.api.bases.organization import OrganizationEndpoint, OrganizationPermission
from sentry... | bsd-3-clause |
40223149/2015cd_midterm | static/Brython3.1.1-20150328-091302/Lib/unittest/test/test_discovery.py | 785 | 13838 | import os
import re
import sys
import unittest
class TestableTestProgram(unittest.TestProgram):
module = '__main__'
exit = True
defaultTest = failfast = catchbreak = buffer = None
verbosity = 1
progName = ''
testRunner = testLoader = None
def __init__(self):
pass
class TestDisc... | gpl-3.0 |
runt18/nupic | tests/unit/nupic/math/nupic_random_test.py | 30 | 5529 | #!/usr/bin/env python
# ----------------------------------------------------------------------
# Numenta Platform for Intelligent Computing (NuPIC)
# Copyright (C) 2013, Numenta, Inc. Unless you have an agreement
# with Numenta, Inc., for a separate license for this software code, the
# following terms and conditions ... | agpl-3.0 |
reedt/git | contrib/hooks/multimail/git_multimail.py | 186 | 110172 | #! /usr/bin/env python2
# Copyright (c) 2015 Matthieu Moy and others
# Copyright (c) 2012-2014 Michael Haggerty and others
# Derived from contrib/hooks/post-receive-email, which is
# Copyright (c) 2007 Andy Parkins
# and also includes contributions by other authors.
#
# This file is part of git-multimail.
#
# git-mult... | gpl-2.0 |
qiankunshe/sky_engine | tools/clang/scripts/package.py | 20 | 9414 | #!/usr/bin/env python
# Copyright (c) 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.
"""This script will check out llvm and clang, and then package the results up
to a tgz file."""
import argparse
import fnmatch
imp... | bsd-3-clause |
MrLoick/python-for-android | python3-alpha/python3-src/Tools/scripts/get-remote-certificate.py | 112 | 2720 | #!/usr/bin/env python3
#
# fetch the certificate that the server(s) are providing in PEM form
#
# args are HOST:PORT [, HOST:PORT...]
#
# By Bill Janssen.
import re
import os
import sys
import tempfile
def fetch_server_certificate (host, port):
def subproc(cmd):
from subprocess import Popen, PIPE, STDOU... | apache-2.0 |
jylaxp/django | django/db/models/fields/files.py | 35 | 19051 | import datetime
import os
from django import forms
from django.core import checks
from django.core.files.base import File
from django.core.files.images import ImageFile
from django.core.files.storage import default_storage
from django.db.models import signals
from django.db.models.fields import Field
from django.utils... | bsd-3-clause |
lumy/mingus | unittest/test_instrument.py | 12 | 1957 | #!/usr/bin/python
# -*- coding: utf-8 -*-
import sys
sys.path += ['../']
from mingus.containers.instrument import Instrument, Piano, Guitar
from mingus.containers.note_container import NoteContainer
import unittest
class test_Instrument(unittest.TestCase):
def setUp(self):
self.i = Instrument()
s... | gpl-3.0 |
WillisXChen/django-oscar | oscar/lib/python2.7/site-packages/unidecode/x01e.py | 246 | 3853 | data = (
'A', # 0x00
'a', # 0x01
'B', # 0x02
'b', # 0x03
'B', # 0x04
'b', # 0x05
'B', # 0x06
'b', # 0x07
'C', # 0x08
'c', # 0x09
'D', # 0x0a
'd', # 0x0b
'D', # 0x0c
'd', # 0x0d
'D', # 0x0e
'd', # 0x0f
'D', # 0x10
'd', # 0x11
'D', # 0x12
'd', # 0x13
'E', # 0... | bsd-3-clause |
LarryHillyer/PoolHost | PoolHost/env/Lib/site-packages/django/template/context.py | 57 | 8669 | import warnings
from contextlib import contextmanager
from copy import copy
from django.utils.deprecation import RemovedInDjango20Warning
# Hard-coded processor for easier use of CSRF protection.
_builtin_context_processors = ('django.template.context_processors.csrf',)
class ContextPopException(Exception):
"po... | gpl-3.0 |
gsb-eng/tahoe-lafs | misc/coding_tools/check-interfaces.py | 9 | 9011 |
# To check a particular Tahoe source distribution, this should be invoked from
# the root directory of that distribution as
#
# bin/tahoe @misc/coding_tools/check-interfaces.py
import os, sys, re, platform
import zope.interface as zi
# We use the forked version of verifyClass below.
#from zope.interface.verify imp... | gpl-2.0 |
shipci/sympy | sympy/polys/tests/test_injections.py | 126 | 1795 | """Tests for functions that inject symbols into the global namespace. """
from sympy.polys.rings import vring
from sympy.polys.fields import vfield
from sympy.polys.domains import QQ
from sympy.utilities.pytest import raises
# make r1 with call-depth = 1
def _make_r1():
return vring("r1", QQ)
# make r2 with cal... | bsd-3-clause |
redhat-openstack/django | tests/admin_filters/models.py | 115 | 1359 | from __future__ import unicode_literals
from django.contrib.auth.models import User
from django.db import models
from django.utils.encoding import python_2_unicode_compatible
@python_2_unicode_compatible
class Book(models.Model):
title = models.CharField(max_length=50)
year = models.PositiveIntegerField(null... | bsd-3-clause |
chouseknecht/ansible | test/units/modules/network/f5/test_bigip_device_group_member.py | 22 | 2882 | # -*- coding: utf-8 -*-
#
# Copyright (c) 2017 F5 Networks Inc.
# 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
import os
import json
import pytest
import sys
if sys.version_info < (2, ... | gpl-3.0 |
UOMx/edx-platform | lms/djangoapps/shoppingcart/tests/test_views.py | 13 | 100706 | """
Tests for Shopping Cart views
"""
from collections import OrderedDict
import pytz
from urlparse import urlparse
from decimal import Decimal
import json
from django.http import HttpRequest
from django.conf import settings
from django.test import TestCase
from django.test.utils import override_settings
from django.c... | agpl-3.0 |
Onager/plaso | plaso/analysis/interface.py | 1 | 2822 | # -*- coding: utf-8 -*-
"""This file contains the interface for analysis plugins."""
import abc
import calendar
import collections
import time
from plaso.analysis import definitions as analysis_definitions
from plaso.analysis import logger
from plaso.containers import events
from plaso.containers import reports
from ... | apache-2.0 |
UniversalMasterEgg8679/ansible | lib/ansible/plugins/action/fail.py | 227 | 1391 | # (c) 2012-2014, Michael DeHaan <michael.dehaan@gmail.com>
# (c) 2012, Dag Wieers <dag@wieers.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 ... | gpl-3.0 |
pentestfail/TA-FireEye_TAP | bin/ta_fireeye_tap/solnlib/packages/requests/packages/chardet/escsm.py | 2930 | 7839 | ######################## BEGIN LICENSE BLOCK ########################
# The Original Code is mozilla.org code.
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 1998
# the Initial Developer. All Rights Reserved.
#
# Con... | mit |
dsbrown/FreeCAD | src/Gui/FreeCADGuiInit.py | 9 | 5995 | # FreeCAD gui init module
# (c) 2003 Juergen Riegel
#
# Gathering all the information to start FreeCAD
# This is the second one of three init scripts, the third one
# runs when the gui is up
#***************************************************************************
#* (c) Juergen Riegel (juergen.riegel@web... | lgpl-2.1 |
radlab/sparrow | deploy/third_party/boto-2.1.1/boto/vpc/dhcpoptions.py | 20 | 2485 | # Copyright (c) 2009-2010 Mitch Garnaat http://garnaat.org/
#
# 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, modi... | apache-2.0 |
MalloyPower/parsing-python | front-end/testsuite-python-lib/Python-2.1/Lib/fileinput.py | 4 | 9897 | """Helper class to quickly write a loop over all standard input files.
Typical use is:
import fileinput
for line in fileinput.input():
process(line)
This iterates over the lines of all files listed in sys.argv[1:],
defaulting to sys.stdin if the list is empty. If a filename is '-' it
is also replace... | mit |
michael-dev2rights/ansible | test/units/module_utils/basic/test_no_log.py | 60 | 6904 | # -*- coding: utf-8 -*-
# (c) 2015, Toshio Kuratomi <tkuratomi@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
# (a... | gpl-3.0 |
eleonrk/SickRage | lib/sqlalchemy/testing/suite/test_insert.py | 76 | 6861 | from .. import fixtures, config
from ..config import requirements
from .. import exclusions
from ..assertions import eq_
from .. import engines
from sqlalchemy import Integer, String, select, util
from ..schema import Table, Column
class LastrowidTest(fixtures.TablesTest):
run_deletes = 'each'
__backend__ ... | gpl-3.0 |
karras/gitlab-docsbot | setup.py | 1 | 2639 | # -*- coding: UTF-8 -*-
"""Setuptools package definition"""
from setuptools import setup
from setuptools import find_packages
import codecs
import os
import sys
version = sys.version_info[0]
if version > 2:
pass
else:
pass
__version__ = None
version_file = "autodocs/version.py"
with codecs.open(version_fi... | gpl-3.0 |
paran0ids0ul/infernal-twin | build/pip/build/lib.linux-i686-2.7/pip/_vendor/progress/bar.py | 404 | 2707 | # -*- coding: utf-8 -*-
# Copyright (c) 2012 Giorgos Verigakis <verigak@gmail.com>
#
# Permission to use, copy, modify, and distribute this software for any
# purpose with or without fee is hereby granted, provided that the above
# copyright notice and this permission notice appear in all copies.
#
# THE SOFTWARE IS P... | gpl-3.0 |
wangcy6/storm_app | frame/c++/grpc-master/src/python/grpcio_tests/tests/unit/_metadata_test.py | 12 | 7977 | # Copyright 2016 gRPC authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing... | apache-2.0 |
shhui/nova | nova/tests/api/openstack/compute/plugins/v3/test_flavor_rxtx.py | 19 | 3365 | # Copyright 2012 Nebula, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the 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 |
xuru/agar | agar/dates.py | 5 | 2435 | """
The ``agar.dates`` module contains a function to help work with dates.
"""
import re
from datetime import datetime, timedelta
from pytz.gae import pytz
def parse_datetime(s):
"""
Create ``datetime`` object representing date/time expressed in a string.
Takes a string in the format produced by callin... | mit |
zubair-arbi/edx-platform | cms/djangoapps/contentstore/git_export_utils.py | 187 | 7401 | """
Utilities for export a course's XML into a git repository,
committing and pushing the changes.
"""
import logging
import os
import subprocess
from urlparse import urlparse
from django.conf import settings
from django.contrib.auth.models import User
from django.utils import timezone
from django.utils.translation i... | agpl-3.0 |
nubark/odoo | addons/survey/tests/test_survey.py | 47 | 18040 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
import random
import re
from collections import Counter
from itertools import product
from urlparse import urljoin
from openerp import _
from openerp.exceptions import UserError
from openerp.tests.common import Transact... | gpl-3.0 |
zstyblik/infernal-twin | build/reportlab/tools/docco/codegrab.py | 14 | 7818 | #Copyright ReportLab Europe Ltd. 2000-2012
#see license.txt for license details
#history http://www.reportlab.co.uk/cgi-bin/viewcvs.cgi/public/reportlab/trunk/reportlab/tools/docco/codegrab.py
#codegrab.py
"""
This grabs various Python class, method and function
headers and their doc strings to include in documents
"""... | gpl-3.0 |
shanglt/youtube-dl | youtube_dl/extractor/ntvru.py | 124 | 5022 | # encoding: utf-8
from __future__ import unicode_literals
from .common import InfoExtractor
from ..utils import (
clean_html,
xpath_text,
int_or_none,
)
class NTVRuIE(InfoExtractor):
IE_NAME = 'ntv.ru'
_VALID_URL = r'http://(?:www\.)?ntv\.ru/(?P<id>.+)'
_TESTS = [
{
'url'... | unlicense |
jhutar/spacewalk | backend/test/test_cache.py | 17 | 1050 | #
# Copyright (c) 2008--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 FITNESS
# FOR A PARTICULAR PURPOSE. You should have received a c... | gpl-2.0 |
quickresolve/accel.ai | flask-aws/lib/python2.7/site-packages/botocore/vendored/requests/packages/chardet/langhungarianmodel.py | 2763 | 12536 | ######################## BEGIN LICENSE BLOCK ########################
# The Original Code is Mozilla Communicator client code.
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 1998
# the Initial Developer. All Rights R... | mit |
davidjb/sqlalchemy | test/orm/test_utils.py | 20 | 23966 | from sqlalchemy.testing import assert_raises, assert_raises_message
from sqlalchemy.orm import util as orm_util
from sqlalchemy import Column
from sqlalchemy import util
from sqlalchemy import Integer
from sqlalchemy import MetaData
from sqlalchemy import Table
from sqlalchemy.orm import aliased, with_polymorphic, syno... | mit |
maalmeida1837/deepdive | examples/chunking/udf/ext_training.py | 15 | 1553 | #! /usr/bin/env python
# extract training data
import fileinput
import json
import itertools
import tags
import sys
tagNames = ['NP', 'VP', 'PP', 'ADJP', 'ADVP', 'SBAR', 'O', 'PRT', 'CONJP', 'INTJ', 'LST', 'B', '']
sentID = 1
# for each word
for row in sys.stdin:
# obj = json.loads(row)
word_id, wor... | apache-2.0 |
jrleja/bsfh | demo/demo_params.py | 3 | 11700 | import time, sys
import numpy as np
from sedpy.observate import load_filters
from prospect import prospect_args
from prospect.fitting import fit_model
from prospect.io import write_results as writer
# --------------
# RUN_PARAMS
# When running as a script with argparsing, these are ignored. Kept here for backwards... | mit |
KarrLab/kinetic_datanator | datanator/data_source/metabolites_meta_collection.py | 1 | 14782 | from datanator_query_python.query import query_sabiork, query_xmdb
from datanator.util import chem_util
from datanator.util import file_util
from datanator.util import index_collection
import datanator.config.core
import pymongo
import re
from pymongo.collation import Collation, CollationStrength
class MetabolitesMet... | mit |
teamfx/openjfx-9-dev-rt | modules/javafx.web/src/main/native/Tools/Scripts/webkitpy/benchmark_runner/http_server_driver/__init__.py | 3 | 1196 | # Required for Python to search this directory for module files
# Keep this file free of any code or import statements that could
# cause either an error to occur or a log message to be logged.
# This ensures that calling code can import initialization code from
# webkitpy before any errors or log messages due to code... | gpl-2.0 |
cloudera/hue | desktop/core/ext-py/dnspython-1.15.0/dns/ttl.py | 16 | 2283 | # Copyright (C) 2003-2007, 2009-2011 Nominum, Inc.
#
# Permission to use, copy, modify, and distribute this software and its
# documentation for any purpose with or without fee is hereby granted,
# provided that the above copyright notice and this permission notice
# appear in all copies.
#
# THE SOFTWARE IS PROVIDED "... | apache-2.0 |
aweisberg/cassandra-dtest | streaming_test.py | 5 | 4250 | import logging
import operator
import pytest
from cassandra import ConsistencyLevel
from pytest import mark
from dtest import Tester, create_ks, create_cf
from tools.data import insert_c1c2
since = pytest.mark.since
logger = logging.getLogger(__name__)
opmap = {
operator.eq: "==",
operator.gt: ">",
oper... | apache-2.0 |
gurneyalex/OpenUpgrade | addons/report/models/report.py | 22 | 23158 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2014-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 |
40223249-1/2015cd_midterm2 | static/Brython3.1.1-20150328-091302/Lib/genericpath.py | 727 | 3093 | """
Path operations common to more than one OS
Do not use directly. The OS specific modules import the appropriate
functions from this module themselves.
"""
import os
import stat
__all__ = ['commonprefix', 'exists', 'getatime', 'getctime', 'getmtime',
'getsize', 'isdir', 'isfile']
# Does a path exist?
#... | agpl-3.0 |
twitchyliquid64/misc-scripts | s3tool/boto/dynamodb2/items.py | 32 | 14656 | from copy import deepcopy
class NEWVALUE(object):
# A marker for new data added.
pass
class Item(object):
"""
An object representing the item data within a DynamoDB table.
An item is largely schema-free, meaning it can contain any data. The only
limitation is that it must have data for the ... | mit |
ncos/mipt-airdrone | src/action_client/main.py | 3 | 11363 | #!/usr/bin/env python
import roslib; roslib.load_manifest('action_client')
import rospy, smach, smach_ros
import time
from action_client.msg import *
from actionlib import *
from actionlib.msg import *
movement_speed = 0.0
# Ask user whether we want to launch the quadrotor or not
class PauseState(smach.State):
... | mit |
frewsxcv/AutobahnPython | examples/twisted/wamp/longpoll/server.py | 3 | 2559 | ###############################################################################
##
## Copyright (C) 2014 Tavendo GmbH
##
## 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:/... | apache-2.0 |
ultrabox/Ultra.Stream | servers/moevideos.py | 32 | 9669 | # -*- coding: utf-8 -*-
#------------------------------------------------------------
# pelisalacarta - XBMC Plugin
# Conector para moevideos
# http://blog.tvalacarta.info/plugin-xbmc/pelisalacarta/
#------------------------------------------------------------
import urlparse,urllib2,urllib,re
import os
from core imp... | gpl-2.0 |
DigitalPandacoin/pandacoin | test/functional/feature_config_args.py | 1 | 2329 | #!/usr/bin/env python3
# Copyright (c) 2017 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 various command line arguments and configuration file parameters."""
import os
from test_framework.te... | mit |
metomi/rose | metomi/rosie/graph.py | 1 | 9686 | # Copyright (C) British Crown (Met Office) & Contributors.
# This file is part of Rose, a framework for meteorological suites.
#
# Rose 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 L... | gpl-3.0 |
umuzungu/zipline | zipline/pipeline/loaders/equity_pricing_loader.py | 3 | 4665 | # Copyright 2015 Quantopian, 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 |
yigitguler/django | tests/admin_views/admin.py | 14 | 28973 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
import tempfile
import os
from django import forms
from django.contrib import admin
from django.contrib.admin.views.main import ChangeList
from django.core.exceptions import ValidationError
from django.core.files.storage import FileSystemStorage
from dja... | bsd-3-clause |
fernandog/Medusa | lib/send2trash/plat_win.py | 79 | 1660 | # Copyright 2013 Hardcoded Software (http://www.hardcoded.net)
# This software is licensed under the "BSD" License as described in the "LICENSE" file,
# which should be included with this package. The terms are also available at
# http://www.hardcoded.net/licenses/bsd_license
from __future__ import unicode_literals... | gpl-3.0 |
40223139/LEGOg7-39 | man.py | 61 | 21781 |
import cherrypy
# 這是 MAN 類別的定義
'''
# 在 application 中導入子模組
import programs.cdag30.man as cdag30_man
# 加入 cdag30 模組下的 man.py 且以子模組 man 對應其 MAN() 類別
root.cdag30.man = cdag30_man.MAN()
# 完成設定後, 可以利用
/cdag30/man/assembly
# 呼叫 man.py 中 MAN 類別的 assembly 方法
'''
class MAN(object):
# 各組利用 index 引導隨後的程式執行
@cherrypy.exp... | agpl-3.0 |
jaywink/federation | federation/utils/network.py | 2 | 8856 | import calendar
import datetime
import logging
import re
import socket
from typing import Optional, Dict
from urllib.parse import quote
from uuid import uuid4
import requests
from requests.exceptions import RequestException, HTTPError, SSLError
from requests.exceptions import ConnectionError
from requests.structures i... | bsd-3-clause |
TeamEOS/external_chromium_org | components/test/data/autofill/merge/tools/flatten.py | 162 | 2132 | #!/usr/bin/env python
# Copyright 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 sys
def main():
"""Converts a vertical serialization into a compact, horizontal serialization.
"""
COLUMNS = ['First nam... | bsd-3-clause |
eemirtekin/edx-platform | common/djangoapps/track/tests/test_util.py | 239 | 1203 | from datetime import datetime
import json
from pytz import UTC
from django.test import TestCase
from track.utils import DateTimeJSONEncoder
class TestDateTimeJSONEncoder(TestCase):
def test_datetime_encoding(self):
a_naive_datetime = datetime(2012, 05, 01, 07, 27, 10, 20000)
a_tz_datetime = dat... | agpl-3.0 |
mach0/QGIS | tests/src/python/test_qgscoordinatetransform.py | 15 | 9018 | # -*- coding: utf-8 -*-
"""QGIS Unit tests for QgsCoordinateTransform.
.. 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... | gpl-2.0 |
sclabs/sccms-nonrel | django/template/loaders/filesystem.py | 229 | 2358 | """
Wrapper for loading templates from the filesystem.
"""
from django.conf import settings
from django.template.base import TemplateDoesNotExist
from django.template.loader import BaseLoader
from django.utils._os import safe_join
class Loader(BaseLoader):
is_usable = True
def get_template_sources(self, temp... | bsd-3-clause |
zetaris/zeppelin | spark/interpreter/src/main/resources/python/zeppelin_ipyspark.py | 9 | 2845 | #
# 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 |
bitmazk/django-frequently | frequently/tests/forms_tests.py | 1 | 1290 | """Tests for the forms of the ``django-frequently`` app."""
from django.test import TestCase
from mixer.backend.django import mixer
from .. import forms
class EntryFormTestCase(TestCase):
"""Tests for the ``EntryForm`` form class."""
def setUp(self):
self.owner = mixer.blend('auth.User')
def te... | mit |
herrnst/script.xbmc.lcdproc | resources/lib/lcdproc.py | 1 | 21691 | '''
XBMC LCDproc addon
Copyright (C) 2012-2018 Team Kodi
Copyright (C) 2012-2018 Daniel 'herrnst' Scheller
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 ... | gpl-2.0 |
mrquim/repository.mrquim | script.module.livestreamer/lib/livestreamer/plugins/filmon_us.py | 34 | 4358 | import re
from livestreamer.compat import urlparse
from livestreamer.plugin import Plugin
from livestreamer.plugin.api import http, validate
from livestreamer.plugin.api.utils import parse_json, parse_query
from livestreamer.stream import RTMPStream, HTTPStream
SWF_LIVE_URL = "https://www.filmon.com/tv/modules/FilmOn... | gpl-2.0 |
maxalbert/ansible | v1/tests/TestFilters.py | 107 | 5974 | '''
Test bundled filters
'''
import os.path
import unittest, tempfile, shutil
from ansible import playbook, inventory, callbacks
import ansible.runner.filter_plugins.core
import ansible.runner.filter_plugins.mathstuff
INVENTORY = inventory.Inventory(['localhost'])
BOOK = '''
- hosts: localhost
vars:
var: { a: ... | gpl-3.0 |
Datera/cinder | cinder/policies/groups.py | 3 | 2089 | # Copyright (c) 2017 Huawei Technologies Co., Ltd.
# 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
#
# ... | apache-2.0 |
deepmind/deep-verify | deep_verify/src/auto_verifier.py | 1 | 9808 | # coding=utf-8
# Copyright 2019 DeepMind Technologies Limited.
#
# 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 applic... | apache-2.0 |
SafeW3rd/Ciphers | simpleSubHacker.py | 1 | 7029 | # Simple Substitution Cipher Hacker
# http://inventwithpython.com/hacking (BSD Licensed)
import os, re, copy, pprint, pyperclip, simpleSubCipher, makeWordPatterns
if not os.path.exists('wordPatterns.py'):
makeWordPatterns.main() # create the wordPatterns.py file
import wordPatterns
LETTERS = 'ABCDEFGHIJ... | mit |
max-arnold/django-cities-light | setup.py | 3 | 1594 | from setuptools import setup, find_packages
import shutil
import sys
import os
import os.path
# Utility function to read the README file.
# Used for the long_description. It's nice, because now 1) we have a top level
# README file and 2) it's easier to type in the README file than to put a raw
# string in below ...
d... | mit |
fle-internal/content-curation | contentcuration/contentcuration/management/commands/exportchannel.py | 1 | 27865 | import collections
import itertools
import json
import logging as logmodule
import os
import re
import sys
import tempfile
import uuid
import zipfile
from itertools import chain
from django.conf import settings
from django.core.files import File
from django.core.files.storage import default_storage as storage
from dja... | mit |
jasonwzhy/django | django/db/models/lookups.py | 194 | 16328 | import inspect
from copy import copy
from django.utils.functional import cached_property
from django.utils.six.moves import range
from .query_utils import QueryWrapper
class RegisterLookupMixin(object):
def _get_lookup(self, lookup_name):
try:
return self.class_lookups[lookup_name]
e... | bsd-3-clause |
kaedroho/wagtail | wagtail/core/hooks.py | 2 | 2294 | from contextlib import ContextDecorator
from operator import itemgetter
from wagtail.utils.apps import get_app_submodules
_hooks = {}
def register(hook_name, fn=None, order=0):
"""
Register hook for ``hook_name``. Can be used as a decorator::
@register('hook_name')
def my_hook(...):
... | bsd-3-clause |
foreni-packages/hachoir-parser | hachoir_parser/file_system/linux_swap.py | 95 | 3777 | """
Linux swap file.
Documentation: Linux kernel source code, files:
- mm/swapfile.c
- include/linux/swap.h
Author: Victor Stinner
Creation date: 25 december 2006 (christmas ;-))
"""
from hachoir_parser import Parser
from hachoir_core.field import (ParserError, GenericVector,
UInt32, String,
Bytes, NullByt... | gpl-2.0 |
ntt-sic/nova | nova/compute/api.py | 1 | 161884 | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2010 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# Copyright 2011 Piston Cloud Computing, Inc.
# Copyright 2012-2013 Red Hat, Inc.
# All Rights Reserved.
#
# Licensed under the Apache Lic... | apache-2.0 |
kost/volatility | volatility/plugins/mac/moddump.py | 12 | 4739 | # Volatility
# Copyright (C) 2007-2013 Volatility Foundation
#
# This file is part of Volatility.
#
# Volatility 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 o... | gpl-2.0 |
arruah/ensocoin | contrib/testgen/gen_base58_test_vectors.py | 1000 | 4343 | #!/usr/bin/env python
'''
Generate valid and invalid base58 address and private key test vectors.
Usage:
gen_base58_test_vectors.py valid 50 > ../../src/test/data/base58_keys_valid.json
gen_base58_test_vectors.py invalid 50 > ../../src/test/data/base58_keys_invalid.json
'''
# 2012 Wladimir J. van der Laan
# R... | mit |
RobberPhex/thrift | tutorial/py.tornado/PythonServer.py | 34 | 2779 | #!/usr/bin/env python
#
# 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
# "L... | apache-2.0 |
ammarkhann/FinalSeniorCode | lib/python2.7/site-packages/google/cloud/gapic/errorreporting/v1beta1/error_group_service_client.py | 1 | 10469 | # Copyright 2017, 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 law or ... | mit |
AZCompTox/AZOrange | orange/OrangeWidgets/Data/OWAddClass.py | 2 | 2879 | """
<name>Add Class</name>
<description>Adds a new class to a dataset</description>
<icon>icons/AddClass.png</icon>
<priority>1111</priority>
<contact>Pedro Rafael Almeida (engpedrorafael(@at@)gmail.com)</contact>
"""
from OWWidget import *
import OWGUI
from AZutilities import dataUtilities
import types
class OWAddCl... | lgpl-3.0 |
DataDog/python-openid | examples/djopenid/settings.py | 66 | 2601 | # Django settings for djopenid project.
import os
import sys
import warnings
try:
import openid
except ImportError, e:
warnings.warn("Could not import OpenID library. Please consult the djopenid README.")
sys.exit(1)
DEBUG = True
TEMPLATE_DEBUG = DEBUG
ADMINS = (
# ('Your Name', 'your_email@domain.... | apache-2.0 |
wskplho/sl4a | python/src/Lib/sgmllib.py | 306 | 17884 | """A parser for SGML, using the derived class as a static DTD."""
# XXX This only supports those SGML features used by HTML.
# XXX There should be a way to distinguish between PCDATA (parsed
# character data -- the normal case), RCDATA (replaceable character
# data -- only char and entity references and end tags are ... | apache-2.0 |
kmoocdev2/edx-platform | openedx/features/course_experience/views/course_outline.py | 1 | 5344 | """
Views to show a course outline.
"""
import re
import datetime
from completion import waffle as completion_waffle
from django.contrib.auth.models import User
from django.template.context_processors import csrf
from django.template.loader import render_to_string
from opaque_keys.edx.keys import CourseKey
from pytz i... | agpl-3.0 |
marcreyesph/scancode-toolkit | tests/licensedcode/test_detect.py | 3 | 47823 | #
# Copyright (c) 2015 nexB Inc. and others. All rights reserved.
# http://nexb.com and https://github.com/nexB/scancode-toolkit/
# The ScanCode software is licensed under the Apache License version 2.0.
# Data generated with ScanCode require an acknowledgment.
# ScanCode is a trademark of nexB Inc.
#
# You may not use... | apache-2.0 |
fharenheit/template-spark-app | src/main/python/streaming/sql_network_wordcount.py | 76 | 3197 | #
# 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 |
lyft/incubator-airflow | airflow/hooks/jdbc_hook.py | 5 | 1130 | #
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not... | apache-2.0 |
aduric/crossfit | nonrel/django/contrib/messages/storage/base.py | 399 | 6134 | from django.conf import settings
from django.utils.encoding import force_unicode, StrAndUnicode
from django.contrib.messages import constants, utils
LEVEL_TAGS = utils.get_level_tags()
class Message(StrAndUnicode):
"""
Represents an actual message that can be stored in any of the supported
storage class... | bsd-3-clause |
Nuevosmedios/django-badger | badger/validate_jsonp.py | 7 | 6279 | # -*- coding: utf-8 -*-
# see also: http://github.com/tav/scripts/raw/master/validate_jsonp.py
# Placed into the Public Domain by tav <tav@espians.com>
"""Validate Javascript Identifiers for use as JSON-P callback parameters."""
import re
from unicodedata import category
# ------------------------------------------... | bsd-3-clause |
wcevans/grpc | tools/run_tests/python_utils/jobset.py | 7 | 15927 | # Copyright 2015, 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... | bsd-3-clause |
gbeauchesne/libva-intel-hybrid-driver | src/shaders/gpp.py | 11 | 5313 | #!/usr/bin/env python
#coding=UTF-8
# Copyright © 2011 Intel Corporation
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the "Software"),
# to deal in the Software without restriction, including without limitation
# the rights to u... | mit |
openpermissions/repository-srv | tests/unit/controllers/test_assets_handler.py | 1 | 5620 | # -*- coding: utf-8 -*-
# Copyright 2016 Open Permissions Platform Coalition
# 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 appl... | apache-2.0 |
valentin-krasontovitsch/ansible | lib/ansible/modules/cloud/cloudstack/cs_portforward.py | 14 | 12322 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# (c) 2015, René Moser <mail@renemoser.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
ANSIBLE_METADATA = {'metadata_version': '1.1',
... | gpl-3.0 |
SteveXiSong/ECE757-SnoopingPredictions | src/mem/cache/prefetch/Prefetcher.py | 6 | 3820 | # Copyright (c) 2012 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 |
igemsoftware/SYSU-Software2013 | project/Python27/Lib/site-packages/win32comext/axscript/client/pydumper.py | 35 | 2124 | # pydumper.py
#
# This is being worked on - it does not yet work at all, in ay way
# shape or form :-)
#
# A new script engine, derived from the standard scripting engine,
# which dumps information.
# This generally can be used to grab all sorts of useful details about
# an engine - expose bugs in it or Python, dump t... | mit |
Mirantis/swift-encrypt | swift/common/direct_client.py | 3 | 18242 | # Copyright (c) 2010-2012 OpenStack, 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 ... | apache-2.0 |
bregman-arie/ansible | lib/ansible/modules/cloud/azure/azure_rm_deployment.py | 15 | 27035 | #!/usr/bin/python
#
# Copyright (c) Ansible Project
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ['preview... | gpl-3.0 |
sh4wn/vispy | vispy/geometry/tests/test_generation.py | 4 | 1541 | # -*- coding: utf-8 -*-
# Copyright (c) 2015, Vispy Development Team.
# Distributed under the (new) BSD License. See LICENSE.txt for more info.
import numpy as np
from numpy.testing import assert_array_equal, assert_allclose
from vispy.testing import run_tests_if_main
from vispy.geometry import (create_box, create_cub... | bsd-3-clause |
tdliu/hoop-picks | lib/requests/packages/urllib3/poolmanager.py | 66 | 13052 | from __future__ import absolute_import
import collections
import functools
import logging
from ._collections import RecentlyUsedContainer
from .connectionpool import HTTPConnectionPool, HTTPSConnectionPool
from .connectionpool import port_by_scheme
from .exceptions import LocationValueError, MaxRetryError, ProxyScheme... | apache-2.0 |
GinnyN/towerofdimensions-django | build/lib/django/contrib/localflavor/in_/forms.py | 87 | 3908 | """
India-specific Form helpers.
"""
from __future__ import absolute_import
import re
from django.contrib.localflavor.in_.in_states import STATES_NORMALIZED, STATE_CHOICES
from django.core.validators import EMPTY_VALUES
from django.forms import ValidationError
from django.forms.fields import Field, RegexField, CharF... | bsd-3-clause |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.