repo_name stringlengths 5 100 | path stringlengths 4 294 | copies stringclasses 990
values | size stringlengths 4 7 | content stringlengths 666 1M | license stringclasses 15
values |
|---|---|---|---|---|---|
vukae/eve-wspace | evewspace/Map/tests.py | 138 | 1244 | # Eve W-Space
# Copyright (C) 2013 Andrew Austin and other contributors
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your ... | gpl-3.0 |
lumig242/Hue-Integration-with-CDAP | desktop/core/ext-py/boto-2.38.0/boto/mashups/order.py | 153 | 7584 | # Copyright (c) 2006,2007 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 |
giorgiop/scipy | scipy/linalg/decomp.py | 16 | 31707 | #
# Author: Pearu Peterson, March 2002
#
# additions by Travis Oliphant, March 2002
# additions by Eric Jones, June 2002
# additions by Johannes Loehnert, June 2006
# additions by Bart Vandereycken, June 2006
# additions by Andrew D Straw, May 2007
# additions by Tiziano Zito, November 2008
#
# April 2010: Functio... | bsd-3-clause |
waytai/odoo | addons/website_event_track/models/event.py | 300 | 8344 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU... | agpl-3.0 |
GehenHe/Recognize-Face-on-Android | tensorflow/contrib/legacy_seq2seq/__init__.py | 165 | 2433 | # 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 |
lukasfenix/namebench | nb_third_party/dns/rdtypes/ANY/NSEC3PARAM.py | 248 | 3161 | # Copyright (C) 2004-2007, 2009, 2010 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 |
j831/zulip | zerver/tests/test_type_debug.py | 7 | 5088 | from __future__ import print_function
import sys
from unittest import TestCase
from six.moves import cStringIO as StringIO
from zerver.lib.type_debug import print_types
from typing import Any, Callable, Dict, Iterable, Tuple, TypeVar
T = TypeVar('T')
def add(x=0, y=0):
# type: (Any, Any) -> Any
return x + ... | apache-2.0 |
egenchen/shadowsocks | shadowsocks/manager.py | 925 | 9692 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright 2015 clowwindy
#
# 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 b... | apache-2.0 |
huiyi1990/grab | docs/ru/conf.py | 13 | 7081 | # -*- coding: utf-8 -*-
#
# Grab documentation build configuration file, created by
# sphinx-quickstart on Tue Nov 9 11:04:59 2010.
#
# This file is execfile()d with the current directory set to its containing dir.
#
# Note that not all possible configuration values are present in this
# autogenerated file.
#
# All co... | mit |
NelisVerhoef/scikit-learn | examples/neural_networks/plot_rbm_logistic_classification.py | 258 | 4609 | """
==============================================================
Restricted Boltzmann Machine features for digit classification
==============================================================
For greyscale image data where pixel values can be interpreted as degrees of
blackness on a white background, like handwritten... | bsd-3-clause |
le9i0nx/ansible | lib/ansible/utils/module_docs_fragments/ovirt_facts.py | 44 | 3242 | # -*- coding: utf-8 -*-
#
# Copyright (c) 2016 Red Hat, Inc.
#
# 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) ... | gpl-3.0 |
40223150/2015cd_midterm | static/Brython3.1.1-20150328-091302/Lib/xml/dom/__init__.py | 873 | 4019 | """W3C Document Object Model implementation for Python.
The Python mapping of the Document Object Model is documented in the
Python Library Reference in the section on the xml.dom package.
This package contains the following modules:
minidom -- A simple implementation of the Level 1 DOM with namespace
sup... | gpl-3.0 |
GauravSahu/odoo | addons/product/wizard/product_price.py | 380 | 2254 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU... | agpl-3.0 |
boundarydevices/android_external_chromium_org | tools/telemetry/telemetry/results/buildbot_page_measurement_results_unittest.py | 9 | 19250 | # Copyright 2014 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import os
from telemetry import perf_tests_helper
from telemetry.page import page_set
from telemetry.value import list_of_scalar_values
from telemetry.value ... | bsd-3-clause |
webmull/phantomjs | src/breakpad/src/tools/gyp/test/generator-output/gyptest-actions.py | 151 | 1953 | #!/usr/bin/env python
# Copyright (c) 2009 Google Inc. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""
Verifies --generator-output= behavior when using actions.
"""
import TestGyp
test = TestGyp.TestGyp()
# All the generated files shoul... | bsd-3-clause |
gangadhar-kadam/sapphire_app | stock/doctype/bin/bin.py | 1 | 2522 | # Copyright (c) 2013, Web Notes Technologies Pvt. Ltd.
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import webnotes
from webnotes.utils import add_days, cint,flt, nowdate, get_url_to_form, formatdate
from webnotes import msgprint, _
sql = webnotes.conn.sql
import w... | agpl-3.0 |
olivierdalang/stdm | ui/composer/chart_type_register.py | 1 | 2725 | """
/***************************************************************************
Name : Graph Type UI Registry Classes
Description : Container for registering graph type UI settings.
Date : 16/April/2015
copyright : (C) 2014 by UN-Habitat and implementing partners.
... | gpl-2.0 |
chatcannon/scipy | scipy/weave/examples/wx_example.py | 100 | 7328 | """ This is taken from the scrolled window example from the demo.
Take a look at the DoDrawing2() method below. The first 6 lines
or so have been translated into C++.
"""
from __future__ import absolute_import, print_function
import sys
sys.path.insert(0,'..')
import inline_tools
from wxPython.wx import *
... | bsd-3-clause |
luoyetx/mxnet | example/deep-embedded-clustering/autoencoder.py | 18 | 10317 | # 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 |
algorhythms/LeetCode | 732 My Calendar III.py | 1 | 2130 | #!/usr/bin/python3
"""
Implement a MyCalendarThree class to store your events. A new event can always
be added.
Your class will have one method, book(int start, int end). Formally, this
represents a booking on the half open interval [start, end), the range of real
numbers x such that start <= x < end.
A K-booking hap... | mit |
boldprogressives/akcode | settings.py | 1 | 4549 |
DEBUG = True
TEMPLATE_DEBUG = DEBUG
ADMINS = (
# ('Your Name', 'your_email@example.com'),
)
MANAGERS = ADMINS
TIME_ZONE = 'America/Chicago'
LANGUAGE_CODE = 'en-us'
INTERNAL_IPS = ('127.0.0.1',
)
SITE_ID = 1
# If you set this to False, Django will make some optimizations so as not
# to load t... | bsd-3-clause |
ybenitezf/miner | core/pydal/adapters/postgres.py | 3 | 18603 | # -*- coding: utf-8 -*-
import re
from .._globals import IDENTITY
from ..drivers import psycopg2_adapt
from .._compat import PY2
from ..helpers.methods import varquote_aux
from .base import BaseAdapter
from ..objects import Expression
class PostgreSQLAdapter(BaseAdapter):
drivers = ('psycopg2','pg8000')
QUO... | gpl-2.0 |
pydanny/shortener_project | shortener/links/models.py | 1 | 1732 | from django.core.urlresolvers import reverse, NoReverseMatch
from django.db import models
from django.utils.baseconv import base64
from django.utils.translation import ugettext_lazy as _
from amazonify import amazonify
from model_utils.models import TimeStampedModel
from .validators import validate_five_characters
... | mit |
omni5cience/django-inlineformfield | .tox/py27/lib/python2.7/site-packages/pip/_vendor/requests/packages/urllib3/request.py | 567 | 5808 | # urllib3/request.py
# Copyright 2008-2013 Andrey Petrov and contributors (see CONTRIBUTORS.txt)
#
# This module is part of urllib3 and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php
try:
from urllib.parse import urlencode
except ImportError:
from urllib import urlencod... | mit |
friedrich420/N4-AEL-KERNEL-LOLLIPOP | tools/perf/scripts/python/Perf-Trace-Util/lib/Perf/Trace/Util.py | 12527 | 1935 | # Util.py - Python extension for perf script, miscellaneous utility code
#
# Copyright (C) 2010 by Tom Zanussi <tzanussi@gmail.com>
#
# This software may be distributed under the terms of the GNU General
# Public License ("GPL") version 2 as published by the Free Software
# Foundation.
import errno, os
FUTEX_WAIT = 0... | gpl-2.0 |
google-research/dice_rl | google/scripts/run_q_estimator.py | 1 | 4763 | # Copyright 2020 Google LLC.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | apache-2.0 |
nomedeusuariodesconhecido/info3180-lab4 | venv/lib/python2.7/site-packages/pip/utils/logging.py | 91 | 3186 | from __future__ import absolute_import
import contextlib
import logging
import logging.handlers
import os
try:
import threading
except ImportError:
import dummy_threading as threading
from pip.compat import WINDOWS
try:
from pip._vendor import colorama
# Lots of different errors can come from this, incl... | mit |
aeischeid/servo | components/script/dom/bindings/codegen/parser/WebIDL.py | 1 | 257429 | # This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
""" A WebIDL parser. """
from ply import lex, yacc
import re
import os
import traceback
import math
from collections im... | mpl-2.0 |
mrdanbrooks/minibus | minibus.py | 2 | 37304 | # Copyright 2015 Dan Brooks
#
# 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 i... | apache-2.0 |
sugartom/tensorflow-alien | tensorflow/python/debug/lib/stepper_test.py | 39 | 45190 | # 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 |
wenqf11/huhamhire-hosts | tui/curses_ui.py | 24 | 23013 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# curses_ui.py: Draw TUI using curses.
#
# Copyleft (C) 2014 - huhamhire <me@huhamhire.com>
# =====================================================================
# Licensed under the GNU General Public License, version 3. You should
# have received a copy of the GNU Ge... | gpl-3.0 |
batermj/algorithm-challenger | code-analysis/programming_anguage/python/source_codes/Python3.8.0/Python-3.8.0/Lib/lib2to3/pytree.py | 33 | 27960 | # Copyright 2006 Google, Inc. All Rights Reserved.
# Licensed to PSF under a Contributor Agreement.
"""
Python parse tree definitions.
This is a very concrete parse tree; we need to keep every token and
even the comments and whitespace between tokens.
There's also a pattern matching implementation here.
"""
__autho... | apache-2.0 |
beiko-lab/gengis | bin/Lib/site-packages/numpy/lib/utils.py | 1 | 38119 | import os
import sys
import types
import re
from numpy.core.numerictypes import issubclass_, issubsctype, issubdtype
from numpy.core import product, ndarray, ufunc
__all__ = ['issubclass_', 'issubsctype', 'issubdtype',
'deprecate', 'deprecate_with_doc', 'get_numarray_include',
'get_include',... | gpl-3.0 |
Bionetbook/bionetbook | bnbapp/compare/urls.py | 2 | 1143 | from django.conf.urls.defaults import patterns, url, include
from compare import views
# from protocols import views
urlpatterns = patterns("",
url(regex=r'^select/$', view=views.CompareSelectView.as_view(), name='compare_select'),
url(regex=r'^view/single_ajax/(?P<protocol_a_slug>[-\w]+)/$', view=views.Layo... | mit |
JRock007/boxxy | dist/Boxxy server.app/Contents/Resources/lib/python2.7/numpy/lib/arrayterator.py | 52 | 7282 | """
A buffered iterator for big arrays.
This module solves the problem of iterating over a big file-based array
without having to read it into memory. The `Arrayterator` class wraps
an array object, and when iterated it will return sub-arrays with at most
a user-specified number of elements.
"""
from __future__ impor... | mit |
nop33/indico | indico/modules/rb/notifications/reservations.py | 2 | 7927 | from flask import render_template
from indico.core.notifications import email_sender, make_email
from indico.util.date_time import format_datetime
from indico.util.string import to_unicode
class ReservationNotification(object):
def __init__(self, reservation):
self.reservation = reservation
self.... | gpl-3.0 |
maftieu/CouchPotatoServer | couchpotato/core/downloaders/nzbvortex/main.py | 4 | 5838 | from base64 import b64encode
from couchpotato.core.downloaders.base import Downloader, ReleaseDownloadList
from couchpotato.core.helpers.encoding import tryUrlencode, sp
from couchpotato.core.helpers.variable import cleanHost
from couchpotato.core.logger import CPLog
from urllib2 import URLError
from uuid import uuid4
... | gpl-3.0 |
jjscarafia/CUPS-Cloud-Print | testing/test_ccputils.py | 2 | 6577 | # CUPS Cloudprint - Print via Google Cloud Print
# Copyright (C) 2011 Simon Cadman
#
# 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 y... | gpl-3.0 |
farzadghanei/distutilazy | distutilazy/test.py | 1 | 8421 | """
distutilazy.test
-----------------
command classes to help run tests
:license: MIT. For more details see LICENSE file or
https://opensource.org/licenses/MIT
"""
from __future__ import absolute_import
import os
from os.path import abspath, basename, dirname
import sys
import fnmatch
from importlib import import_m... | mit |
CyanogenMod/android_kernel_cyanogen_msm8994 | Documentation/target/tcm_mod_builder.py | 2358 | 40707 | #!/usr/bin/python
# The TCM v4 multi-protocol fabric module generation script for drivers/target/$NEW_MOD
#
# Copyright (c) 2010 Rising Tide Systems
# Copyright (c) 2010 Linux-iSCSI.org
#
# Author: nab@kernel.org
#
import os, sys
import subprocess as sub
import string
import re
import optparse
tcm_dir = ""
fabric_ops... | gpl-2.0 |
mesosphere/marathon | tests/shakedown/shakedown/util.py | 2 | 14683 | import collections
import concurrent.futures
import contextlib
import functools
import hashlib
import json
import logging
import os
import platform
import shutil
import stat
import sys
import tempfile
import time
import six
from six.moves import urllib
from . import constants
from .errors import DCOSException
@cont... | apache-2.0 |
fyfcauc/android_external_chromium-org | third_party/closure_linter/closure_linter/fixjsstyle_test.py | 135 | 7371 | #!/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 |
mancoast/CPythonPyc_test | cpython/275_test_descrtut.py | 75 | 12052 | # This contains most of the executable examples from Guido's descr
# tutorial, once at
#
# http://www.python.org/2.2/descrintro.html
#
# A few examples left implicit in the writeup were fleshed out, a few were
# skipped due to lack of interest (e.g., faking super() by hand isn't
# of much interest anymore), and a f... | gpl-3.0 |
appsembler/edx-platform | pavelib/paver_tests/test_eslint.py | 14 | 1731 | """
Tests for Paver's Stylelint tasks.
"""
import unittest
from mock import patch
from paver.easy import BuildFailure, call_task
import pavelib.quality
class TestPaverESLint(unittest.TestCase):
"""
For testing run_eslint
"""
def setUp(self):
super(TestPaverESLint, self).setUp()
# M... | agpl-3.0 |
edublancas/python-ds-tools | tests/pipeline/test_pipeline.py | 2 | 5059 | import subprocess
from pathlib import Path
from dstools.pipeline.dag import DAG
from dstools.pipeline.tasks import BashCommand
from dstools.pipeline.products import File
kwargs = {'stderr': subprocess.PIPE,
'stdout': subprocess.PIPE,
'shell': True}
def test_non_existent_file():
dag = DAG()
... | mit |
ryfeus/lambda-packs | Lxml_requests/source/google/protobuf/text_encoding.py | 152 | 4617 | # 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... | mit |
york-2015/yowsup | yowsup/layers/protocol_iq/protocolentities/iq_error.py | 61 | 1645 | from yowsup.structs import ProtocolTreeNode
from .iq import IqProtocolEntity
class ErrorIqProtocolEntity(IqProtocolEntity):
'''<iq id="1417113419-0" from="{{jid}}" type="error">
<error text="not-acceptable" code="406" backoff="3600">
</error>
</iq>
'''
def __init__(self, _id, _from, code, tex... | gpl-3.0 |
mdanielwork/intellij-community | python/lib/Lib/site-packages/django/db/models/manager.py | 306 | 7872 | from django.utils import copycompat as copy
from django.conf import settings
from django.db import router
from django.db.models.query import QuerySet, EmptyQuerySet, insert_query, RawQuerySet
from django.db.models import signals
from django.db.models.fields import FieldDoesNotExist
def ensure_default_manager(sender, ... | apache-2.0 |
degustaf/blog | rabbithole_python/rabbithole_python/settings.py | 1 | 2778 | """
Django settings for rabbithole_python project.
Generated by 'django-admin startproject' using Django 1.8.3.
For more information on this file, see
https://docs.djangoproject.com/en/1.8/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.8/ref/settings/
"""
# ... | apache-2.0 |
Sylrob434/CouchPotatoServer | libs/suds/properties.py | 203 | 16223 | # This program is free software; you can redistribute it and/or modify
# it under the terms of the (LGPL) GNU Lesser General Public License as
# published by the Free Software Foundation; either version 3 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will ... | gpl-3.0 |
fduraffourg/servo | tests/wpt/harness/wptrunner/environment.py | 99 | 7294 | # This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
import json
import os
import multiprocessing
import signal
import socket
import sys
import time
from mozlog import get_... | mpl-2.0 |
ariebovenberg/snug | src/snug/pagination.py | 2 | 4726 | """Tools for creating paginated queries
.. versionadded:: 1.2
"""
import abc
import typing as t
from operator import attrgetter
from .query import Query, async_executor, executor
__all__ = ["paginated", "Page", "Pagelike"]
T = t.TypeVar("T")
class Pagelike(t.Generic[T]):
"""Abstract base class for page-like o... | mit |
MikeBirdsall/food-log | foodlog/create_db.py | 1 | 1868 | #!/usr/bin/env python3
""" Create database from ini files
I started out using ini files as the first input and primary backup method
for the data. I'm changing that to be more database centric, with the
backup being done by a file containing a log of the sql statements used to
update the database. This... | mit |
magenta/magenta | magenta/models/sketch_rnn/model.py | 1 | 17487 | # Copyright 2021 The Magenta 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 ... | apache-2.0 |
Eric-Zhong/odoo | addons/l10n_th/__openerp__.py | 260 | 1453 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU... | agpl-3.0 |
EricMuller/mynotes-backend | requirements/twisted/Twisted-17.1.0/build/lib.linux-x86_64-3.5/twisted/python/lockfile.py | 15 | 7718 | # -*- test-case-name: twisted.test.test_lockfile -*-
# Copyright (c) 2005 Divmod, Inc.
# Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
"""
Filesystem-based interprocess mutex.
"""
from __future__ import absolute_import, division
import errno
import os
from time import time as _uniquefloat
f... | mit |
Kurpilyansky/street-agitation-telegram-bot | street_agitation_bot/management/regions.py | 1 | 1552 | arr = ["Архангельск", "Астрахань", "Барнаул", "Белгород", "Березники*", "Бийск", "Братск", "Брянск", "Великий Новгород", "Владивосток", "Владимир", "Волгоград", "Вологда", "Воркута*", "Воронеж", "Выкса*", "Горно-Алтайск*", "Екатеринбург", "Ессентуки*", "Жуковский*", "Иваново", "Ижевск", "Иркутск", "Йошкар-Ола", "Казань... | gpl-3.0 |
toontownfunserver/Panda3D-1.9.0 | python/Lib/encodings/koi8_u.py | 593 | 14018 | """ Python Character Mapping Codec koi8_u generated from 'python-mappings/KOI8-U.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,input,errors='stri... | bsd-3-clause |
DougBurke/astropy | astropy/nddata/tests/test_nduncertainty.py | 2 | 8911 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
import pytest
import numpy as np
from numpy.testing import assert_array_equal
from ..nduncertainty import (StdDevUncertainty, NDUncertainty,
IncompatibleUncertaintiesException,
UnknownUncertaint... | bsd-3-clause |
hj3938/or-tools | examples/tests/issue5.py | 39 | 5719 | # Copyright 2010 Hakan Kjellerstrand hakank@bonetmail.com
#
# Licensed under the Apache License, Version 2.0 (the 'License');
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable ... | apache-2.0 |
dylanlesko/youtube-dl | youtube_dl/extractor/beatportpro.py | 142 | 3423 | # coding: utf-8
from __future__ import unicode_literals
import re
from .common import InfoExtractor
from ..compat import compat_str
from ..utils import int_or_none
class BeatportProIE(InfoExtractor):
_VALID_URL = r'https?://pro\.beatport\.com/track/(?P<display_id>[^/]+)/(?P<id>[0-9]+)'
_TESTS = [{
'... | unlicense |
lorenzo-desantis/mne-python | mne/io/edf/edf.py | 5 | 25772 | """Conversion tool from EDF, EDF+, BDF to FIF
"""
# Authors: Teon Brooks <teon.brooks@gmail.com>
# Martin Billinger <martin.billinger@tugraz.at>
#
# License: BSD (3-clause)
import os
import calendar
import datetime
import re
import warnings
from math import ceil, floor
import numpy as np
from ...utils imp... | bsd-3-clause |
c4sc/arividam | arividam/djangocms_news/views.py | 1 | 2690 | from django.shortcuts import render
from django.http import HttpResponse
from django.conf import settings
from django.contrib.sites.models import Site
from django.contrib.sites.shortcuts import get_current_site
# Create your views here.
from cms.models import Page
from cms.api import create_page
from postman.api impor... | mit |
lmazuel/azure-sdk-for-python | unreleased/azure-mgmt-machinelearning/azure/mgmt/machinelearning/models/web_service_properties.py | 5 | 8236 | # 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 ... | mit |
tjwei/jedi | test/test_cache.py | 13 | 3178 | """
Test all things related to the ``jedi.cache`` module.
"""
import time
import pytest
import jedi
from jedi import settings, cache
from jedi.cache import ParserCacheItem, ParserPickling
ParserPicklingCls = type(ParserPickling)
ParserPickling = ParserPicklingCls()
def test_modulepickling_change_cache_dir(monkey... | mit |
menardorama/ReadyNAS-Add-ons | headphones-1.0.0/debian/headphones/apps/headphones/lib/biplist/__init__.py | 25 | 30025 | """biplist -- a library for reading and writing binary property list files.
Binary Property List (plist) files provide a faster and smaller serialization
format for property lists on OS X. This is a library for generating binary
plists which can be read by OS X, iOS, or other clients.
The API models the plistlib API,... | gpl-2.0 |
mosaic-cloud/mosaic-distribution-dependencies | dependencies/nodejs/0.10.32/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/generator/android.py | 446 | 43487 | # Copyright (c) 2012 Google Inc. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
# Notes:
#
# This generates makefiles suitable for inclusion into the Android build system
# via an Android.mk file. It is based on make.py, the standard makefile
... | apache-2.0 |
savoirfairelinux/OpenUpgrade | addons/account/account.py | 13 | 189623 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU... | agpl-3.0 |
Subby4Git/tbed-parser | src/dialogueAct.py | 2 | 27480 | #!/usr/bin/env python2.5
import re
from string import *
from copy import *
from collections import *
from utils import *
from slot import *
from transformation import *
from trigger import *
class DialogueAct:
def __init__(self, cuedDA, origSentence, raspData, db, settings):
# train data values
... | gpl-2.0 |
fourwood/OutflowCone | example/cone_example.py | 1 | 7656 | #!/usr/bin/env python3
# Should be all Python3 compatible, and I'd suggest keeping it that way.
# However, it should *also* be all Python2.7 compatible, as well.
from __future__ import print_function, division
import numpy as np
import OutflowCone as oc
# How many clouds to generate in the cone model?
# 1e4 gives a ... | mit |
AloneRoad/Inforlearn | django/contrib/gis/db/models/aggregates.py | 10 | 1098 | from django.db.models import Aggregate
from django.contrib.gis.db.backend import SpatialBackend
from django.contrib.gis.db.models.sql import GeomField
class GeoAggregate(Aggregate):
def add_to_query(self, query, alias, col, source, is_summary):
if hasattr(source, 'geom_type'):
# Doing addition... | apache-2.0 |
DMLoy/ECommerceBasic | lib/python2.7/site-packages/django/utils/unittest/main.py | 219 | 9392 | """Unittest main program"""
import sys
import os
import types
from django.utils.unittest import loader, runner
try:
from django.utils.unittest.signals import installHandler
except ImportError:
installHandler = None
__unittest = True
FAILFAST = " -f, --failfast Stop on first failure\n"
CATCHBREAK = ... | mit |
alzeih/ava | ava_core/notify/migrations/0001_initial.py | 2 | 1389 | # -*- coding: utf-8 -*-
# Generated by Django 1.9.1 on 2016-01-06 02:37
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='Notific... | gpl-3.0 |
tuxfux-hlp-notes/python-batches | archieves/batch-61/modules/myenv/lib/python2.7/site-packages/pip/_vendor/requests/packages/chardet/gb2312freq.py | 3132 | 36011 | ######################## 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... | gpl-3.0 |
erkrishna9/odoo | addons/l10n_th/__openerp__.py | 170 | 1533 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU... | agpl-3.0 |
aalmah/fuel | tests/test_schemes.py | 21 | 7676 | import numpy
from numpy.testing import assert_raises
from fuel.schemes import (ConstantScheme, SequentialExampleScheme,
SequentialScheme, ShuffledExampleScheme,
ShuffledScheme, ConcatenatedScheme,
cross_validation)
def iterator_requester(s... | mit |
XperiaSTE/android_kernel_sony_u8500 | tools/perf/scripts/python/Perf-Trace-Util/lib/Perf/Trace/Core.py | 11088 | 3246 | # Core.py - Python extension for perf script, core functions
#
# Copyright (C) 2010 by Tom Zanussi <tzanussi@gmail.com>
#
# This software may be distributed under the terms of the GNU General
# Public License ("GPL") version 2 as published by the Free Software
# Foundation.
from collections import defaultdict
def aut... | gpl-2.0 |
2013Commons/HUE-SHARK | build/env/lib/python2.7/site-packages/Django-1.2.3-py2.7.egg/django/contrib/gis/maps/google/gmap.py | 321 | 9000 | from django.conf import settings
from django.contrib.gis import geos
from django.template.loader import render_to_string
from django.utils.safestring import mark_safe
class GoogleMapException(Exception): pass
from django.contrib.gis.maps.google.overlays import GPolygon, GPolyline, GMarker, GIcon
# The default Google ... | apache-2.0 |
isrohutamahopetechnik/MissionPlanner | Lib/xml/dom/domreg.py | 63 | 3577 | """Registration facilities for DOM. This module should not be used
directly. Instead, the functions getDOMImplementation and
registerDOMImplementation should be imported from xml.dom."""
from xml.dom.minicompat import * # isinstance, StringTypes
# This is a list of well-known implementations. Well-known names... | gpl-3.0 |
singulared/aiohttp | tests/test_web_server.py | 1 | 3093 | import asyncio
from unittest import mock
import pytest
from aiohttp import client, web
@asyncio.coroutine
def test_simple_server(raw_test_server, test_client):
@asyncio.coroutine
def handler(request):
return web.Response(text=str(request.rel_url))
server = yield from raw_test_server(handler)
... | apache-2.0 |
1d4Nf6/flocker | flocker/control/httpapi.py | 5 | 39372 | # Copyright Hybrid Logic Ltd. See LICENSE file for details.
"""
A HTTP REST API for controlling the Dataset Manager.
"""
import yaml
from uuid import uuid4, UUID
from pyrsistent import pmap, thaw
from twisted.protocols.tls import TLSMemoryBIOFactory
from twisted.python.filepath import FilePath
from twisted.web.htt... | apache-2.0 |
Forever-Young/pytils | pytils/utils.py | 2 | 1782 | # -*- coding: utf-8 -*-
# -*- test-case-name: pytils.test.test_utils -*-
"""
Misc utils for internal use
"""
from pytils.third import six
def check_length(value, length):
"""
Checks length of value
@param value: value to check
@type value: C{str}
@param length: length checking for
@type len... | mit |
henry808/euler | 013/eul013.py | 1 | 5836 | #! /usr/bin/python
from __future__ import print_function
# Project Euler # 13
n = [37107287533902102798797998220837590246510135740250,
46376937677490009712648124896970078050417018260538,
74324986199524741059474233309513058123726617309629,
91942213363574161572522430563301811072406154908250,
2306758... | mit |
coxmediagroup/django-threadedcomments | legacy_threadedcomments/utils.py | 15 | 1165 | from django.core.serializers import serialize
from django.http import HttpResponse
from django.utils import simplejson
from django.utils.functional import Promise
from django.utils.encoding import force_unicode
class LazyEncoder(simplejson.JSONEncoder):
def default(self, obj):
if isinstance(obj, Promise):... | bsd-3-clause |
LennonLab/simplex | tools/DiversityTools/macroecotools/macroecotools.py | 12 | 16643 | """Module for conducting standard macroecological plots and analyses"""
from __future__ import division
import numpy as np
import matplotlib.pyplot as plt
import colorsys
from numpy import log10
import pandas
import numpy
import math
def AIC(k, L):
"""Computes the Akaike Information Criterion.
Keyword argume... | mit |
anryko/ansible | test/units/modules/network/slxos/test_slxos_l2_interface.py | 38 | 5752 | #
# (c) 2018 Extreme Networks Inc.
#
# 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.
#
# Ans... | gpl-3.0 |
habibmasuro/bitcoin | contrib/spendfrom/spendfrom.py | 680 | 10053 | #!/usr/bin/env python
#
# Use the raw transactions API to spend bitcoins received on particular addresses,
# and send any change back to that same address.
#
# Example usage:
# spendfrom.py # Lists available funds
# spendfrom.py --from=ADDRESS --to=ADDRESS --amount=11.00
#
# Assumes it will talk to a bitcoind or Bit... | mit |
2014c2g8/c2g8 | w2/static/Brython2.0.0-20140209-164925/Lib/tempfile.py | 728 | 22357 | """Temporary files.
This module provides generic, low- and high-level interfaces for
creating temporary files and directories. The interfaces listed
as "safe" just below can be used without fear of race conditions.
Those listed as "unsafe" cannot, and are provided for backward
compatibility only.
This module also pr... | gpl-2.0 |
Stefan-Schmidt/linux-2.6 | arch/ia64/scripts/unwcheck.py | 13143 | 1714 | #!/usr/bin/python
#
# Usage: unwcheck.py FILE
#
# This script checks the unwind info of each function in file FILE
# and verifies that the sum of the region-lengths matches the total
# length of the function.
#
# Based on a shell/awk script originally written by Harish Patil,
# which was converted to Perl by Matthew Ch... | gpl-2.0 |
mikeckennedy/suds_python | suds/xsd/sxbuiltin.py | 3 | 7240 | # This program is free software; you can redistribute it and/or modify
# it under the terms of the (LGPL) GNU Lesser General Public License as
# published by the Free Software Foundation; either version 3 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will ... | lgpl-3.0 |
chugunovyar/factoryForBuild | env/lib/python2.7/site-packages/numpy/lib/npyio.py | 23 | 73862 | from __future__ import division, absolute_import, print_function
import sys
import os
import re
import itertools
import warnings
import weakref
from operator import itemgetter, index as opindex
import numpy as np
from . import format
from ._datasource import DataSource
from numpy.core.multiarray import packbits, unpa... | gpl-3.0 |
kawamon/hue | desktop/core/ext-py/celery-4.2.1/t/unit/backends/test_cassandra.py | 2 | 6244 | from __future__ import absolute_import, unicode_literals
from datetime import datetime
from pickle import dumps, loads
import pytest
from case import Mock, mock
from celery import states
from celery.exceptions import ImproperlyConfigured
from celery.utils.objects import Bunch
CASSANDRA_MODULES = ['cassandra', 'cass... | apache-2.0 |
jonathonwalz/ansible | lib/ansible/modules/system/puppet.py | 36 | 9409 | #!/usr/bin/python
# Copyright (c) 2015 Hewlett-Packard Development Company, L.P.
#
# This module is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any late... | gpl-3.0 |
daniabo/kernel-HuaweiP2-6011.3.0.8 | tools/perf/scripts/python/syscall-counts-by-pid.py | 11180 | 1927 | # system call counts, by pid
# (c) 2010, Tom Zanussi <tzanussi@gmail.com>
# Licensed under the terms of the GNU GPL License version 2
#
# Displays system-wide system call totals, broken down by syscall.
# If a [comm] arg is specified, only syscalls called by [comm] are displayed.
import os, sys
sys.path.append(os.env... | gpl-2.0 |
jbarentsen/drb | drbadmin/node_modules/bootstrap/node_modules/npm-shrinkwrap/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/generator/ninja_test.py | 1843 | 1786 | #!/usr/bin/env python
# Copyright (c) 2012 Google Inc. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
""" Unit tests for the ninja.py file. """
import gyp.generator.ninja as ninja
import unittest
import StringIO
import sys
import TestCommon
... | bsd-3-clause |
curiosityio/taiga-docker | taiga-back/taiga-back/tests/unit/test_gravatar.py | 3 | 1253 | # Copyright (C) 2014-2016 Andrey Antukh <niwi@niwi.nz>
# Copyright (C) 2014-2016 Jesús Espino <jespinog@gmail.com>
# Copyright (C) 2014-2016 David Barragán <bameda@dbarragan.com>
# Copyright (C) 2014-2016 Alejandro Alonso <alejandro.alonso@kaleidos.net>
# This program is free software: you can redistribute it and/or mo... | mit |
Carmezim/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 |
grit-engine/grit-engine | dependencies/quex-0.34.1/quex/core_engine/generator/action_info.py | 2 | 5824 | from quex.frs_py.file_in import is_identifier_start, \
is_identifier_continue
import quex.core_engine.generator.skip_code as skip_code
class ActionI:
def __init__(self, Code, RequireTerminatingZeroF=False):
self.__code = Code
self.__require_terminating_zero_f = Requ... | mit |
jonashaag/ansible | lib/ansible/plugins/action/synchronize.py | 35 | 10195 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2012-2013, Timothy Appnel <tim@appnel.com>
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) an... | gpl-3.0 |
bprodoehl/phantomjs | src/breakpad/src/tools/gyp/pylib/gyp/generator/scons.py | 137 | 33601 | #!/usr/bin/python
# Copyright (c) 2009 Google Inc. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import gyp
import gyp.common
import gyp.SCons as SCons
import os.path
import pprint
import re
# TODO: remove when we delete the last WriteLis... | bsd-3-clause |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.