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 |
|---|---|---|---|---|---|
sudheesh001/oh-mainline | mysite/customs/migrations/0031_auto__del_field_launchpadquerymodel_url__del_field_launchpadquerymodel.py | 16 | 22244 | # encoding: utf-8
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Deleting field 'LaunchpadQueryModel.url'
db.delete_column('customs_launchpadquerymodel', 'url')
... | agpl-3.0 |
Fl0rianFischer/sme_odoo | doc/_extensions/html_domain.py | 254 | 4308 | # -*- coding: utf-8 -*-
"""
Defines a "raw HTML" domain with a ``div[classes]`` and a number of roles
rendered more or less directly to HTML.
.. warning::
the purpose of this domain is *not* to document HTML or components
"""
from docutils import nodes, utils
from docutils.parsers.rst import Directive, directiv... | gpl-3.0 |
wartman4404/servo | tests/wpt/css-tests/tools/html5lib/html5lib/trie/datrie.py | 785 | 1166 | from __future__ import absolute_import, division, unicode_literals
from datrie import Trie as DATrie
from six import text_type
from ._base import Trie as ABCTrie
class Trie(ABCTrie):
def __init__(self, data):
chars = set()
for key in data.keys():
if not isinstance(key, text_type):
... | mpl-2.0 |
AsymmetricVentures/asym-logging | asymmetricbase/middleware/request_in_logger.py | 2 | 1350 | # -*- coding: utf-8 -*-
# Asymmetric Base Framework - A collection of utilities for django frameworks
# Copyright (C) 2013 Asymmetric Ventures 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 S... | gpl-2.0 |
EvaSDK/sqlalchemy | test/orm/test_validators.py | 28 | 9951 | from test.orm import _fixtures
from sqlalchemy.testing import fixtures, assert_raises, eq_, ne_
from sqlalchemy.orm import mapper, Session, validates, relationship
from sqlalchemy.testing.mock import Mock, call
class ValidatorTest(_fixtures.FixtureTest):
def test_scalar(self):
users = self.tables.users
... | mit |
openwebcc/ba | maintenance/scripts/als/get_trajectories.py | 1 | 9320 | #!/usr/bin/python
#
# extract original and generalized flight paths for individual LAS files from corresponding trajectory file(s)
#
# Usage: python get_trajectories.py --help
#
# Batch: find /home/rawdata/als/hef -type d -name bet -exec python /home/institut/rawdata/maintenance/scripts/als/get_trajectories.py --mindis... | gpl-3.0 |
lawlietge/newanly502 | PS02/report4.py | 3 | 1153 | #!/usr/bin/env python2
# Output the number of URLs served on each day
# input is a weblog
import mrjob
from mrjob.job import MRJob
from weblog import Weblog # imports class defined in weblog.py
from mrjob.step import MRStep
import heapq
import os
TOPN=10
class WeblogURLTop10(MRJob):
def mapper(self, _, lin... | cc0-1.0 |
Ayub-Khan/edx-platform | cms/djangoapps/course_creators/migrations/0001_initial.py | 62 | 1204 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
from django.conf import settings
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
]
operations = [
migrations.Create... | agpl-3.0 |
geekboxzone/lollipop_external_chromium_org_tools_grit | grit/pseudo.py | 62 | 4072 | #!/usr/bin/env python
# Copyright (c) 2012 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
'''Pseudotranslation support. Our pseudotranslations are based on the
P-language, which is a simple vowel-extending language. Exa... | bsd-2-clause |
DonRegan/nbodykit | nbodykit/ndarray.py | 1 | 2693 | """
Helper routines for ndarray objects
These are really handy things if numpy had them.
"""
import numpy
def equiv_class(labels, values, op, dense_labels=False, identity=None, minlength=None):
"""
apply operation to equivalent classes by label, on values
Parameters ----------
labels : array_like
... | gpl-3.0 |
MariusWirtz/TM1py | TM1py/__init__.py | 2 | 2507 | """
A python module for TM1.
https://github.com/cubewise-code/TM1py
TM1py wraps the TM1 REST API into concise Python classes and Services that simplify TM1 interactions from python.
Usage:
>>> with RESTService(address='', port=8001, user='admin', password='apple', ssl=False) as tm1_rest:
>>> subset_service = Sub... | mit |
klonage/nlt-gcs | Lib/site-packages/numpy/distutils/ccompiler.py | 58 | 22774 | import re
import os
import sys
import types
from copy import copy
from distutils.ccompiler import *
from distutils import ccompiler
from distutils.errors import DistutilsExecError, DistutilsModuleError, \
DistutilsPlatformError
from distutils.sysconfig import customize_compiler
from distut... | gpl-3.0 |
christabor/MoAL | MOAL/systems_engineering/architecture/api_design/fluent_interface.py | 1 | 2397 | # -*- coding: utf-8 -*-
__author__ = """Chris Tabor (dxdstudio@gmail.com)"""
if __name__ == '__main__':
from os import getcwd
from os import sys
sys.path.append(getcwd())
from MOAL.helpers.display import Section
from MOAL.helpers.display import divider
from MOAL.helpers.datamaker import faker
DEBUG = T... | apache-2.0 |
streamlio/heron | heron/api/src/python/metrics.py | 9 | 4432 | # Copyright 2016 Twitter. 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 agree... | apache-2.0 |
alexBaizeau/lint-review | lintreview/git.py | 2 | 3139 | import os
import logging
import shutil
import subprocess
log = logging.getLogger(__name__)
def get_repo_path(user, repo, number, settings):
"""
Get the target path a repo should be cloned into for the parameters.
"""
try:
path = settings['WORKSPACE']
except:
raise KeyError("You ha... | mit |
TeamEOS/external_chromium_org | tools/metrics/histograms/pretty_print.py | 17 | 6337 | #!/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.
"""Pretty-prints the histograms.xml file, alphabetizing tags, wrapping text
at 80 chars, enforcing standard attribute ordering, and sta... | bsd-3-clause |
akaihola/django | tests/modeltests/one_to_one/models.py | 34 | 1380 | """
10. One-to-one relationships
To define a one-to-one relationship, use ``OneToOneField()``.
In this example, a ``Place`` optionally can be a ``Restaurant``.
"""
from django.db import models
class Place(models.Model):
name = models.CharField(max_length=50)
address = models.CharField(max_length=80)
d... | bsd-3-clause |
stefankoegl/django-couchdb-utils | django_couchdb_utils/registration/models.py | 1 | 9638 | import datetime
import random
import re
from django.conf import settings
from django.template.loader import render_to_string
from hashlib import sha1
from couchdbkit.ext.django.schema import *
from couchdbkit import ResourceConflict
from ..couchauth.models import User
SHA1_RE = re.compile('^[a-f0-9]{40}$')
def ... | bsd-3-clause |
Ziqi-Li/bknqgis | pandas/pandas/tests/reshape/test_merge_asof.py | 7 | 37720 | import os
import pytest
import pytz
import numpy as np
import pandas as pd
from pandas import (merge_asof, read_csv,
to_datetime, Timedelta)
from pandas.core.reshape.merge import MergeError
from pandas.util import testing as tm
from pandas.util.testing import assert_frame_equal
class TestAsOfMerg... | gpl-2.0 |
lz1988/flaskweb | Lib/encodings/cp1251.py | 593 | 13617 | """ Python Character Mapping Codec cp1251 generated from 'MAPPINGS/VENDORS/MICSFT/WINDOWS/CP1251.TXT' with gencodec.py.
"""#"
import codecs
### Codec APIs
class Codec(codecs.Codec):
def encode(self,input,errors='strict'):
return codecs.charmap_encode(input,errors,encoding_table)
def decode(self,in... | bsd-2-clause |
beepee14/scikit-learn | sklearn/gaussian_process/tests/test_gaussian_process.py | 267 | 6813 | """
Testing for Gaussian Process module (sklearn.gaussian_process)
"""
# Author: Vincent Dubourg <vincent.dubourg@gmail.com>
# Licence: BSD 3 clause
from nose.tools import raises
from nose.tools import assert_true
import numpy as np
from sklearn.gaussian_process import GaussianProcess
from sklearn.gaussian_process ... | bsd-3-clause |
msemple1111/kahoot-hack | 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... | gpl-3.0 |
akshmakov/Dolfin-Fijee-Fork | demo/documented/eigenvalue/python/demo_eigenvalue.py | 2 | 1922 | """
This program illustrates basic use of the SLEPc eigenvalue solver for
a standard eigenvalue problem.
"""
# Copyright (C) 2007 Kristian B. Oelgaard
#
# 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 pub... | gpl-3.0 |
kaushik94/python-twitter | twitter/list.py | 9 | 8560 | #!/usr/bin/env python
from twitter import simplejson, TwitterError, User
class List(object):
'''A class representing the List structure used by the twitter API.
The List structure exposes the following properties:
list.id
list.name
list.slug
list.description
list.full_name
list.mode
... | apache-2.0 |
andymckay/django | django/contrib/messages/tests/session.py | 413 | 1230 | from django.contrib.messages.tests.base import BaseTest
from django.contrib.messages.storage.session import SessionStorage
def set_session_data(storage, messages):
"""
Sets the messages into the backend request's session and remove the
backend's loaded data cache.
"""
storage.request.session[stora... | bsd-3-clause |
SRabbelier/Melange | thirdparty/google_appengine/google/appengine/api/datastore.py | 1 | 74675 | #!/usr/bin/env python
#
# Copyright 2007 Google 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 o... | apache-2.0 |
myerpengine/odoo | addons/base_action_rule/tests/__init__.py | 178 | 1129 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Business Applications
# Copyright (c) 2012-TODAY OpenERP S.A. <http://openerp.com>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of ... | agpl-3.0 |
t0in4/django | tests/auth_tests/test_signals.py | 312 | 4005 | import datetime
from django.contrib.auth import signals
from django.contrib.auth.models import User
from django.test import TestCase, override_settings
from django.test.client import RequestFactory
@override_settings(USE_TZ=False,
PASSWORD_HASHERS=['django.contrib.auth.hashers.SHA1PasswordHasher'],
ROOT_URLC... | bsd-3-clause |
hanicker/odoo | addons/stock/tests/common.py | 247 | 4483 | # -*- coding: utf-8 -*-
from openerp.tests import common
class TestStockCommon(common.TransactionCase):
def setUp(self):
super(TestStockCommon, self).setUp()
self.ProductObj = self.env['product.product']
self.UomObj = self.env['product.uom']
self.PartnerObj = self.env['res.partn... | agpl-3.0 |
s3ql/main | tests/t1_dump.py | 2 | 7894 | #!/usr/bin/env python3
'''
t1_dump.py - this file is part of S3QL.
Copyright © 2008 Nikolaus Rath <Nikolaus@rath.org>
This work can be distributed under the terms of the GNU GPLv3.
'''
if __name__ == '__main__':
import pytest
import sys
sys.exit(pytest.main([__file__] + sys.argv[1:]))
import unittest
fr... | gpl-3.0 |
RESTfactory/products | products/models.py | 1 | 3135 | from django.conf import settings
from django.db import models
from rest_framework_borderkeeper.models import (
Owner,
Client,
Instance
)
class Brand(models.Model):
name = models.CharField(max_length=30)
def __str__(self):
return self.name
class Category(models.Model):
name = models.... | gpl-3.0 |
benschmaus/catapult | third_party/py_vulcanize/third_party/rcssmin/_setup/py3/ext.py | 42 | 7497 | # -*- coding: ascii -*-
#
# Copyright 2007, 2008, 2009, 2010, 2011
# Andr\xe9 Malo or his licensors, as applicable
#
# 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.or... | bsd-3-clause |
tareqalayan/ansible | lib/ansible/modules/network/iosxr/iosxr_logging.py | 31 | 30490 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2017, Ansible by Red Hat, 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
ANSIBLE_METADATA = {'metadata_version': '1.1',
... | gpl-3.0 |
LumPenPacK/NetworkExtractionFromImages | osx_build/nefi2_osx_amd64_xcode_2015/site-packages/networkx/algorithms/assortativity/tests/test_mixing.py | 96 | 6247 | #!/usr/bin/env python
from nose.tools import *
from nose import SkipTest
import networkx as nx
from base_test import BaseTestAttributeMixing,BaseTestDegreeMixing
class TestDegreeMixingDict(BaseTestDegreeMixing):
def test_degree_mixing_dict_undirected(self):
d=nx.degree_mixing_dict(self.P4)
d_res... | bsd-2-clause |
christianurich/VIBe2UrbanSim | 3rdparty/opus/src/paris/household_x_neighborhood/hhnpam1_nbnpam1.py | 2 | 1879 | # Opus/UrbanSim urban simulation software.
# Copyright (C) 2005-2009 University of Washington
# See opus_core/LICENSE
# This is a simple test variable for the interaction of gridcells and households.
from opus_core.variables.variable import Variable
from urbansim.functions import attribute_label
class hhnp... | gpl-2.0 |
Buckmarble/Lunar_kernel_sense_m7 | tools/perf/scripts/python/sctop.py | 11180 | 1924 | # system call top
# (c) 2010, Tom Zanussi <tzanussi@gmail.com>
# Licensed under the terms of the GNU GPL License version 2
#
# Periodically displays system-wide system call totals, broken down by
# syscall. If a [comm] arg is specified, only syscalls called by
# [comm] are displayed. If an [interval] arg is specified,... | gpl-2.0 |
amyvmiwei/chromium | o3d/site_scons/site_tools/windows_hard_link.py | 27 | 4419 | #!/usr/bin/python2.4
# Copyright 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 list of... | bsd-3-clause |
yaroslav-tarasov/avango | avango-blender/blender-json-loader/field_containers/translation_matrix.py | 3 | 1158 | import avango
import avango.gua
import avango.script
class TranslationMatrix(avango.script.Script):
# Input
Vector = avango.gua.SFVec3()
# Output
Matrix = avango.gua.SFMatrix4()
def __init__(self):
self.super(TranslationMatrix).__init__()
self.Name.value = "RotationMatrix"
... | lgpl-3.0 |
indashnet/InDashNet.Open.UN2000 | lichee/linux-3.4/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... | apache-2.0 |
coinbox/coinbox-mod-base | cbmod/base/views/window.py | 1 | 7111 | from pydispatch import dispatcher
from PySide import QtCore, QtGui
import cbpos
logger = cbpos.get_logger(__name__)
from .page import BasePage
class MainWindow(QtGui.QMainWindow):
__inits = []
def __init__(self):
super(MainWindow, self).__init__()
self.tabs = QtGui... | mit |
cs-au-dk/Artemis | WebKit/Tools/Scripts/webkitpy/common/net/statusserver_unittest.py | 8 | 2201 | # Copyright (c) 2010 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-3.0 |
nmartensen/pandas | asv_bench/benchmarks/timedelta.py | 6 | 1054 | from .pandas_vb_common import *
from pandas import to_timedelta, Timestamp
class ToTimedelta(object):
goal_time = 0.2
def setup(self):
self.arr = np.random.randint(0, 1000, size=10000)
self.arr2 = ['{0} days'.format(i) for i in self.arr]
self.arr3 = np.random.randint(0, 60, size=1000... | bsd-3-clause |
kawasaki2013/python-for-android-x86 | python3-alpha/python3-src/Lib/encodings/unicode_internal.py | 827 | 1196 | """ Python 'unicode-internal' Codec
Written by Marc-Andre Lemburg (mal@lemburg.com).
(c) Copyright CNRI, All Rights Reserved. NO WARRANTY.
"""
import codecs
### Codec APIs
class Codec(codecs.Codec):
# Note: Binding these as C functions will result in the class not
# converting them to methods. This is in... | apache-2.0 |
javachengwc/hue | desktop/core/ext-py/Django-1.6.10/django/test/html.py | 196 | 7967 | """
Comparing two html documents.
"""
from __future__ import unicode_literals
import re
from django.utils.encoding import force_text
from django.utils.html_parser import HTMLParser, HTMLParseError
from django.utils import six
from django.utils.encoding import python_2_unicode_compatible
WHITESPACE = re.compile('\s+... | apache-2.0 |
asedunov/intellij-community | python/lib/Lib/site-packages/django/utils/numberformat.py | 290 | 1632 | from django.conf import settings
from django.utils.safestring import mark_safe
def format(number, decimal_sep, decimal_pos, grouping=0, thousand_sep=''):
"""
Gets a number (as a number or string), and returns it as a string,
using formats definied as arguments:
* decimal_sep: Decimal separator symbol... | apache-2.0 |
Forage/Gramps | gramps/gen/filters/rules/person/_isdefaultperson.py | 1 | 1969 | #
# Gramps - a GTK+/GNOME based genealogy program
#
# Copyright (C) 2002-2006 Donald N. Allingham
#
# 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 you... | gpl-2.0 |
RonnyPfannschmidt/pip | src/pip/_vendor/chardet/langgreekmodel.py | 269 | 12688 | ######################## 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 |
kenorb-contrib/BitTorrent | twisted/test/test_cooperator.py | 4 | 5502 |
from twisted.internet import reactor, defer, task
from twisted.trial import unittest
class TestCooperator(unittest.TestCase):
RESULT = 'done'
def ebIter(self, err):
err.trap(task.SchedulerStopped)
return self.RESULT
def cbIter(self, ign):
self.fail()
def testStoppedReject... | gpl-3.0 |
yagebu/fava | tests/test_json_api.py | 2 | 8796 | # pylint: disable=missing-docstring
import hashlib
from io import BytesIO
from pathlib import Path
from typing import Any
from typing import Optional
import pytest
from flask import g
from flask import url_for
from fava.core.charts import dumps
from fava.core.misc import align
def assert_api_error(response, msg: Op... | mit |
jounex/hue | desktop/core/ext-py/lxml/src/lxml/tests/test_objectify.py | 28 | 94979 | # -*- coding: utf-8 -*-
"""
Tests specific to the lxml.objectify API
"""
import unittest, operator, sys, os.path
this_dir = os.path.dirname(__file__)
if this_dir not in sys.path:
sys.path.insert(0, this_dir) # needed for Py3
from common_imports import etree, HelperTestCase, fileInTestDir
from common_imports im... | apache-2.0 |
jhayworth/config | .emacs.d/elpy/rpc-venv/lib/python2.7/site-packages/pip/_vendor/chardet/escprober.py | 289 | 3950 | ######################## BEGIN LICENSE BLOCK ########################
# The Original Code is mozilla.org code.
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 1998
# the Initial Developer. All Rights Reserved.
#
# Con... | gpl-3.0 |
aselle/tensorflow | tensorflow/contrib/model_pruning/examples/cifar10/cifar10_train.py | 60 | 5267 | # Copyright 2017 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | apache-2.0 |
GinnyN/towerofdimensions-django | build/lib/django/views/generic/list_detail.py | 87 | 5570 | from django.template import loader, RequestContext
from django.http import Http404, HttpResponse
from django.core.xheaders import populate_xheaders
from django.core.paginator import Paginator, InvalidPage
from django.core.exceptions import ObjectDoesNotExist
import warnings
warnings.warn(
'Function-based generic v... | bsd-3-clause |
timsnyder/bokeh | bokeh/sampledata/tests/test_sample_geojson.py | 2 | 2098 | #-----------------------------------------------------------------------------
# Copyright (c) 2012 - 2019, Anaconda, Inc., and Bokeh Contributors.
# All rights reserved.
#
# The full license is in the file LICENSE.txt, distributed with this software.
#-------------------------------------------------------------------... | bsd-3-clause |
u8sand/i3-config | scripts/autoname_workspaces.py | 1 | 5449 | #!/usr/bin/env python3
# This script listens for i3 events and updates workspace names to show icons
# for running programs. It contains icons for a few programs, but more can
# easily be added by adding them to WINDOW_ICONS below.
#
# It also re-numbers workspaces in ascending order with one skipped number
# between... | gpl-3.0 |
xxshutong/openerp-7.0 | openerp/addons/mrp_operations/report/mrp_wc_barcode.py | 53 | 1528 | # -*- 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... | agpl-3.0 |
Alzon/senlin | senlin/engine/registry.py | 1 | 4610 | # 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 unde... | apache-2.0 |
lechat/CouchPotato | library/sqlalchemy/orm/strategies.py | 11 | 51396 | # strategies.py
# Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010 Michael Bayer mike_mp@zzzcomputing.com
#
# This module is part of SQLAlchemy and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php
"""sqlalchemy.orm.interfaces.LoaderStrategy
implementations, and related Mapper... | gpl-3.0 |
jason-weirather/IDP-fusion-release-1 | bin/sam_basics.py | 1 | 3219 | import genepred_basics, sequence_basics
import re
# pre: sam file name, genepred name
# post: list of coordinates in the reference format
# these coordinates are zero indexed for both the start and end coordinate
# note thats different than gpd or psl or even wig or bed
# <read name> <genepred entry... | apache-2.0 |
yongshengwang/hue | desktop/core/ext-py/Django-1.6.10/django/core/files/utils.py | 901 | 1230 | class FileProxyMixin(object):
"""
A mixin class used to forward file methods to an underlaying file
object. The internal file object has to be called "file"::
class FileProxy(FileProxyMixin):
def __init__(self, file):
self.file = file
"""
encoding = property(la... | apache-2.0 |
haggaie/rxe-dev | tools/perf/scripts/python/sched-migration.py | 1910 | 11965 | #!/usr/bin/python
#
# Cpu task migration overview toy
#
# Copyright (C) 2010 Frederic Weisbecker <fweisbec@gmail.com>
#
# perf script event handlers have been generated by perf script -g python
#
# This software is distributed under the terms of the GNU General
# Public License ("GPL") version 2 as published by the Fre... | gpl-2.0 |
mcencora/kdevcpprefactor | Test/gmock-1.6.0/scripts/generator/gmock_gen.py | 1159 | 1091 | #!/usr/bin/env python
#
# Copyright 2008 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 requir... | mit |
dawsonjon/FPGA-TX | psk31_encode.py | 1 | 4482 | varicodes = [
"1010101011", #00 NUL Null character
"1011011011", #01 SOH Start of Header
"1011101101", #02 STX Start of Text
"1101110111", #03 ETX End of Text
"1011101011", #04 EOT End of Transmission
"1101011111", #05 ENQ Enquiry
"1011101111", #06 ACK Acknowledgment
"1011111101", #07 BEL Bell
"10111111... | mit |
DepthDeluxe/ansible | lib/ansible/plugins/action/eos_config.py | 126 | 4193 | #
# Copyright 2015 Peter Sprygada <psprygada@ansible.com>
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any... | gpl-3.0 |
yars068/blueman | blueman/bluez/errors.py | 1 | 3693 | # coding=utf-8
from __future__ import print_function
from __future__ import division
from __future__ import absolute_import
from __future__ import unicode_literals
class BluezDBusException(Exception):
def __init__(self, reason):
self.reason = reason
def __str__(self):
return self.reason
cla... | gpl-3.0 |
buskjan/inetradio | lib/python3.5/site-packages/pip/_vendor/webencodings/tests.py | 340 | 6562 | # coding: utf8
"""
webencodings.tests
~~~~~~~~~~~~~~~~~~
A basic test suite for Encoding.
:copyright: Copyright 2012 by Simon Sapin
:license: BSD, see LICENSE for details.
"""
from __future__ import unicode_literals
from . import (lookup, LABELS, decode, encode, iter_decode, iter_encode,
... | gpl-3.0 |
sarahfo/oppia | scripts/build.py | 30 | 2863 | # Copyright 2014 The Oppia 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 applicable ... | apache-2.0 |
Fokko/incubator-airflow | airflow/migrations/versions/856955da8476_fix_sqlite_foreign_key.py | 7 | 3229 | # Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... | apache-2.0 |
gechong/XlsxWriter | xlsxwriter/test/comparison/test_set_column02.py | 8 | 2750 | ###############################################################################
#
# Tests for XlsxWriter.
#
# Copyright (c), 2013-2015, John McNamara, jmcnamara@cpan.org
#
from ..excel_comparsion_test import ExcelComparisonTest
from ...workbook import Workbook
class TestCompareXLSXFiles(ExcelComparisonTest):
"""... | bsd-2-clause |
rishita/mxnet | python/mxnet/symbol.py | 1 | 63575 | # coding: utf-8
# pylint: disable=invalid-name, protected-access, too-many-arguments, too-many-lines
# pylint: disable=import-error, no-name-in-module
"""Symbolic configuration API of MXNet."""
from __future__ import absolute_import as _abs
import ctypes
import warnings
from numbers import Number
import os as _os
imp... | apache-2.0 |
mattallinson/Rash | map.py | 1 | 1192 | '''
Country Name : {'Continent': answer, 'Occupier': None, 'Armies': None}
'''
map = {
'Venezuela':{'Continent': 'South America','Occupier': None, 'Armies': None, 'Neighbours':['Brazil','Peru']},
'Brazil':{'Continent': 'South America', 'Occupier': None, 'Armies': None, 'Neighbours':['Venezuela','Peru','Argentina','No... | gpl-3.0 |
mgonzales71/script.artwork.downloader | lib/common.py | 4 | 1305 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright (C) 2011-2014 Martijn Kaijser
#
# 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 ... | gpl-2.0 |
SNoiraud/gramps | gramps/gui/views/treemodels/citationlistmodel.py | 6 | 3888 | #
# Gramps - a GTK+/GNOME based genealogy program
#
# Copyright (C) 2000-2006 Donald N. Allingham
# Copyright (C) 2011 Tim G L Lyons, Nick Hall
#
# 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 Found... | gpl-2.0 |
anntzer/numpy | numpy/distutils/tests/test_from_template.py | 45 | 1103 |
from numpy.distutils.from_template import process_str
from numpy.testing import assert_equal
pyf_src = """
python module foo
<_rd=real,double precision>
interface
subroutine <s,d>foosub(tol)
<_rd>, intent(in,out) :: tol
end subroutine <s,d>foosub
end interface
end python modul... | bsd-3-clause |
l50/Cloudefigo | Manager/views.py | 2 | 1956 | import json
from django.http import HttpResponse
from Manager.models import Event
from CloudServices.Admin.Instances import EC2InstanceAdmin
from CloudServices.Admin.CloudTrail import Audit
from Chef.ConfigurationManagement import ChefClient
def index(request):
return HttpResponse('{"Status": "Management API is A... | gpl-3.0 |
mdhaman/superdesk-core | superdesk/data_updates/00014_20181114-153727_archive.py | 2 | 2017 | # -*- coding: utf-8; -*-
# This file is part of Superdesk.
# For the full copyright and license information, please see the
# AUTHORS and LICENSE files distributed with this source code, or
# at https://www.sourcefabric.org/superdesk/license
#
# Author : tomas
# Creation: 2018-11-14 15:37
from superdesk.commands.data... | agpl-3.0 |
PetrDlouhy/django | django/db/backends/sqlite3/base.py | 103 | 17462 | """
SQLite3 backend for django.
Works with either the pysqlite2 module or the sqlite3 module in the
standard library.
"""
from __future__ import unicode_literals
import datetime
import decimal
import re
import warnings
from django.conf import settings
from django.db import utils
from django.db.backends import utils ... | bsd-3-clause |
rudhir-upretee/Sumo_With_Netsim | tools/projects/TaxiFCD_Krieg/src/taxiQuantity/QuantityOverDay.py | 3 | 2316 | # -*- coding: Latin-1 -*-
"""
@file QuantityOverDay.py
@author Sascha Krieg
@author Daniel Krajzewicz
@author Michael Behrisch
@date 2008-04-01
Counts for an given interval all unique taxis in an FCD file and draws the result as a bar chart.
SUMO, Simulation of Urban MObility; see http://sumo.sourceforge.ne... | gpl-3.0 |
MOD-ASL/smores_ros | data/python_behaviors/chain.py | 2 | 11445 | #!/usr/bin/env python
from math import pi
import sys
import os
import time
#Add smores library
sys.path.insert(0,"/home/{}/Projects/Embedded/ecosystem/smores_build/smores_reconfig/python/".format(os.environ['USER']))
from SmoresModule import SmoresCluster
"""
The configuration looks like:
ch4 SensorBox ch3 ch2... | gpl-3.0 |
kennedyshead/home-assistant | tests/components/songpal/test_media_player.py | 5 | 9705 | """Test songpal media_player."""
from datetime import timedelta
import logging
from unittest.mock import AsyncMock, MagicMock, call, patch
from songpal import (
ConnectChange,
ContentChange,
PowerChange,
SongpalException,
VolumeChange,
)
from homeassistant.components import media_player, songpal
f... | apache-2.0 |
czgu/opendataexperience | env/lib/python2.7/site-packages/django/contrib/gis/tests/geoadmin/tests.py | 61 | 2485 | from __future__ import unicode_literals
from unittest import skipUnless
from django.contrib.gis.geos import HAS_GEOS
from django.contrib.gis.tests.utils import HAS_SPATIAL_DB
from django.test import TestCase
if HAS_GEOS and HAS_SPATIAL_DB:
from django.contrib.gis import admin
from django.contrib.gis.geos imp... | apache-2.0 |
beav/pulp | server/test/unit/base.py | 2 | 10129 | # Copyright (c) 2011 Red Hat, Inc.
#
# This software is licensed to you under the GNU General Public
# License as published by the Free Software Foundation; either version
# 2 of the License (GPLv2) or (at your option) any later version.
# There is NO WARRANTY for this software, express or implied,
# including the impl... | gpl-2.0 |
bohdan-shramko/learning-python | source/sublime-packages/Packages/python-jinja2/all/jinja2/_compat.py | 310 | 3109 | # -*- coding: utf-8 -*-
"""
jinja2._compat
~~~~~~~~~~~~~~
Some py2/py3 compatibility support based on a stripped down
version of six so we don't have to depend on a specific version
of it.
:copyright: Copyright 2013 by the Jinja team, see AUTHORS.
:license: BSD, see LICENSE for details.
""... | mit |
dreamsxin/kbengine | kbe/res/scripts/common/Lib/site-packages/pip/_vendor/requests/packages/chardet/codingstatemachine.py | 2931 | 2318 | ######################## 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... | lgpl-3.0 |
mrquim/mrquimrepo | repo/script.module.schism.common/lib/requests/packages/urllib3/connectionpool.py | 121 | 34940 | from __future__ import absolute_import
import errno
import logging
import sys
import warnings
from socket import error as SocketError, timeout as SocketTimeout
import socket
from .exceptions import (
ClosedPoolError,
ProtocolError,
EmptyPoolError,
HeaderParsingError,
HostChangedError,
Locatio... | gpl-2.0 |
s20121035/rk3288_android5.1_repo | external/chromium_org/build/android/pylib/cmd_helper.py | 44 | 5118 | # Copyright (c) 2012 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""A wrapper for subprocess to make calling shell commands easier."""
import logging
import os
import pipes
import select
import signal
import StringIO
... | gpl-3.0 |
selecsosi/django-cms | cms/utils/admin.py | 9 | 4787 | # -*- coding: utf-8 -*-
from distutils.version import LooseVersion
import json
import django
from django.contrib.sites.models import Site
from django.http import HttpResponse
from django.shortcuts import render_to_response
from django.template.context import RequestContext
from django.utils.encoding import smart_str
... | bsd-3-clause |
majidaldo/ansible | lib/ansible/runner/lookup_plugins/env.py | 154 | 1282 | # (c) 2012, Jan-Piet Mens <jpmens(at)gmail.com>
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later ver... | gpl-3.0 |
ibanezchen/linux-8173 | scripts/rt-tester/rt-tester.py | 1106 | 5305 | #!/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 |
SerpentCS/odoo | addons/product_extended/__init__.py | 374 | 1068 | ##############################################################################
#
# 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 Affero General Publ... | agpl-3.0 |
felipenaselva/felipe.repository | script.module.universalscrapers/lib/universalscrapers/scraperplugins/watchfree.py | 3 | 7916 | import base64
import re,time
import urllib
import urlparse
from BeautifulSoup import BeautifulSoup
from ..import proxy
from ..common import replaceHTMLCodes, clean_title
from ..scraper import Scraper
import xbmcaddon
import xbmc
class Watchfree(Scraper):
domains = ['watchfree.to']
name = "watchfree"
def ... | gpl-2.0 |
grimmjow8/ansible | lib/ansible/modules/system/pam_limits.py | 15 | 9215 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2014, Sebastien Rohaut <sebastien.rohaut@gmail.com>
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version ... | gpl-3.0 |
sestrella/ansible | lib/ansible/modules/cloud/vmware/vmware_host.py | 14 | 37633 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright: (c) 2015, Joseph Callen <jcallen () csc.com>
# Copyright: (c) 2017, Ansible Project
# Copyright: (c) 2018, Christian Kotte <christian.kotte@gmx.de>
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import... | gpl-3.0 |
sallaire/Sick-Beard | lib/hachoir_parser/file_system/ext2.py | 90 | 18055 | """
EXT2 (Linux) file system parser.
Author: Victor Stinner
Sources:
- EXT2FS source code
http://ext2fsd.sourceforge.net/
- Analysis of the Ext2fs structure
http://www.nondot.org/sabre/os/files/FileSystems/ext2fs/
"""
from lib.hachoir_parser import Parser
from lib.hachoir_core.field import (FieldSet, ParserError... | gpl-3.0 |
AkihikoITOH/capybara | capybara/virtualenv/lib/python2.7/site-packages/pip/_vendor/requests/packages/chardet/constants.py | 3008 | 1335 | ######################## BEGIN LICENSE BLOCK ########################
# The Original Code is Mozilla Universal charset detector code.
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 2001
# the Initial Developer. All R... | mit |
vainglori0us/supreme-enigma | node_modules/pygmentize-bundled/vendor/pygments/build-2.7/pygments/lexers/_luabuiltins.py | 275 | 6863 | # -*- coding: utf-8 -*-
"""
pygments.lexers._luabuiltins
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
This file contains the names and modules of lua functions
It is able to re-generate itself, but for adding new functions you
probably have to add some callbacks (see function module_callbacks).
Do not edit th... | mit |
wisechengyi/pants | src/python/pants/option/ranked_value.py | 1 | 4391 | # Copyright 2014 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
from enum import Enum
from typing import Any, Dict, Iterator, List, Optional, Union, cast
Rank = int
Value = Union[str, int, float, None, Dict, Enum, List]
class RankedValue:
"""An ... | apache-2.0 |
sbt9uc/osf.io | scripts/migrate_cloudfiles_container.py | 54 | 4081 | #!/usr/bin/env python
# encoding: utf-8
"""Migrate files to correct container.
Note: Must use Rackspace credentials with access to both test and production
containers.
Note: Must have pyrax installed to run.
Run dry run: python -m scripts.migrate_cloudfiles_container dry
Run migration: python -m scripts.migrate_cloudf... | apache-2.0 |
mbox/django | tests/select_related/tests.py | 52 | 6458 | from __future__ import unicode_literals
from django.test import TestCase
from .models import Domain, Kingdom, Phylum, Klass, Order, Family, Genus, Species, HybridSpecies
class SelectRelatedTests(TestCase):
def create_tree(self, stringtree):
"""
Helper to create a complete tree.
"""
... | bsd-3-clause |
hgad/rdbms | ext/gtest/googletest/test/gtest_uninitialized_test.py | 2901 | 2480 | #!/usr/bin/env python
#
# Copyright 2008, Google Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list... | bsd-3-clause |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.