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 |
|---|---|---|---|---|---|
karyon/django | django/contrib/gis/management/commands/ogrinspect.py | 369 | 5760 | import argparse
from django.contrib.gis import gdal
from django.core.management.base import BaseCommand, CommandError
from django.utils.inspect import get_func_args
class LayerOptionAction(argparse.Action):
"""
Custom argparse action for the `ogrinspect` `layer_key` keyword option
which may be an integer... | bsd-3-clause |
upliftaero/MissionPlanner | Lib/encodings/cp737.py | 93 | 35635 | """ Python Character Mapping Codec cp737 generated from 'VENDORS/MICSFT/PC/CP737.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_map)
def decode(self,input,e... | gpl-3.0 |
davidsminor/gaffer | python/GafferSceneUI/ExecutableRenderUI.py | 1 | 2102 | ##########################################################################
#
# Copyright (c) 2014, Image Engine Design 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:
#
# * Red... | bsd-3-clause |
FilipeMaia/arrayfire-python | arrayfire/array.py | 1 | 30063 | #######################################################
# Copyright (c) 2015, ArrayFire
# All rights reserved.
#
# This file is distributed under 3-clause BSD license.
# The complete license agreement can be obtained at:
# http://arrayfire.com/licenses/BSD-3-Clause
######################################################... | bsd-3-clause |
wolfram74/numerical_methods_iserles_notes | venv/lib/python2.7/site-packages/sympy/physics/secondquant.py | 14 | 90708 | """
Second quantization operators and states for bosons.
This follow the formulation of Fetter and Welecka, "Quantum Theory
of Many-Particle Systems."
"""
from __future__ import print_function, division
from collections import defaultdict
from sympy import (Add, Basic, cacheit, Dummy, Expr, Function, I,
... | mit |
evaschalde/odoo | addons/mail/mail_group.py | 247 | 12877 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2010-today OpenERP SA (<http://www.openerp.com>)
#
# This program is free software: you can redistribute it and/or modify
# it under the terms o... | agpl-3.0 |
janslow/boto | tests/unit/cloudsearch2/test_search.py | 114 | 12329 | #!/usr/bin env python
from boto.cloudsearch2.domain import Domain
from boto.cloudsearch2.layer1 import CloudSearchConnection
from tests.compat import mock, unittest
from httpretty import HTTPretty
import json
from boto.cloudsearch2.search import SearchConnection, SearchServiceException
from boto.compat import six, m... | mit |
llmike/PhMuPDF | thirdparty/freetype/src/tools/docmaker/sources.py | 106 | 10770 | # Sources (c) 2002-2004, 2006-2009, 2012
# David Turner <david@freetype.org>
#
#
# this file contains definitions of classes needed to decompose
# C sources files into a series of multi-line "blocks". There are
# two kinds of blocks:
#
# - normal blocks, which contain source code or ordinary comments
#
# - docu... | agpl-3.0 |
ethansshaw/stellavitrum | ScienceFairProcess.py | 1 | 10349 | #!/usr/bin/env python
"""
Written by Ethan Shaw
"""
from astropy.io import fits
import sys, png, math, os
colors = ['red', 'green', 'blue']
# Build x_axis_len rows, each containing y_axis_len columns
# access with PNG_data[row][column]
def buildMatrix(x_axis_len, y_axis_len, greyscale=True):
# set up empty list (mat... | mit |
procangroup/edx-platform | common/lib/calc/calc/functions.py | 279 | 1521 | """
Provide the mathematical functions that numpy doesn't.
Specifically, the secant/cosecant/cotangents and their inverses and
hyperbolic counterparts
"""
import numpy
# Normal Trig
def sec(arg):
"""
Secant
"""
return 1 / numpy.cos(arg)
def csc(arg):
"""
Cosecant
"""
return 1 / nump... | agpl-3.0 |
sbelskie/symplicity | Symplicity/local_settings.py | 1 | 2695 | """
Django settings for Symplicity project.
For more information on this file, see
https://docs.djangoproject.com/en/1.7/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.7/ref/settings/
"""
import os
import dj_database_url
# Build paths inside the... | apache-2.0 |
kamenim/samba | third_party/waf/wafadmin/Tools/ocaml.py | 32 | 9092 | #!/usr/bin/env python
# encoding: utf-8
# Thomas Nagy, 2006 (ita)
"ocaml support"
import os, re
import TaskGen, Utils, Task, Build
from Logs import error
from TaskGen import taskgen, feature, before, after, extension
EXT_MLL = ['.mll']
EXT_MLY = ['.mly']
EXT_MLI = ['.mli']
EXT_MLC = ['.c']
EXT_ML = ['.ml']
open_re... | gpl-3.0 |
jelugbo/hebs_master | cms/djangoapps/contentstore/views/item.py | 11 | 41646 | """Views for items (modules)."""
from __future__ import absolute_import
import hashlib
import logging
from uuid import uuid4
from datetime import datetime
from pytz import UTC
import json
from collections import OrderedDict
from functools import partial
from static_replace import replace_static_urls
from xmodule_modi... | agpl-3.0 |
rhelmer/socorro | socorro/external/postgresql/signature_urls.py | 10 | 5635 | # 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 logging
from socorro.external import MissingArgumentError, BadArgumentError
from socorro.external.postgresql.bas... | mpl-2.0 |
hujiajie/chromium-crosswalk | tools/grit/grit/format/policy_templates/writers/xml_writer_base_unittest.py | 24 | 1369 | #!/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.
"""Unittests for grit.format.policy_templates.writers.admx_writer."""
import re
import unittest
class XmlWriterBaseTest(unitte... | bsd-3-clause |
chunweixu/Deep-Learning | face_generation/helper.py | 160 | 8114 | import math
import os
import hashlib
from urllib.request import urlretrieve
import zipfile
import gzip
import shutil
import numpy as np
from PIL import Image
from tqdm import tqdm
def _read32(bytestream):
"""
Read 32-bit integer from bytesteam
:param bytestream: A bytestream
:return: 32-bit integer
... | mit |
woozzoom/namebench | nb_third_party/dns/dnssec.py | 215 | 2144 | # Copyright (C) 2003-2007, 2009 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 "AS IS... | apache-2.0 |
oldm/OldMan | oldman/schema/hydra.py | 1 | 1520 | from uuid import uuid4
from rdflib import URIRef, RDF, RDFS
from oldman.vocabulary import OLDM_CORRESPONDING_CLASS
class HydraSchemaAdapter(object):
"""Updates some Hydra patterns in the schema graph:
- hydra:Link: create a hydra:Class, subclass of the link range that support the same operations
"... | bsd-3-clause |
jmehnle/ansible | lib/ansible/modules/network/nxos/nxos_snmp_user.py | 57 | 9987 | #!/usr/bin/python
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Ansible is distribut... | gpl-3.0 |
zfzwy/p2pool | SOAPpy/Server.py | 289 | 27143 | from __future__ import nested_scopes
"""
################################################################################
#
# SOAPpy - Cayce Ullman (cayce@actzero.com)
# Brian Matthews (blm@actzero.com)
# Gregory Warnes (Gregory.R.Warnes@Pfizer.com)
# Christopher Blunck (blunck... | gpl-3.0 |
israeltobias/DownMedia | youtube-dl/youtube_dl/extractor/brightcove.py | 2 | 27942 | # coding: utf-8
from __future__ import unicode_literals
import re
import json
from .common import InfoExtractor
from ..compat import (
compat_etree_fromstring,
compat_parse_qs,
compat_str,
compat_urllib_parse_urlparse,
compat_urlparse,
compat_xml_parse_error,
compat_HTTPError,
)
from ..uti... | gpl-3.0 |
rkokkelk/Gulliver | deluge/core/core.py | 1 | 36618 | # -*- coding: utf-8 -*-
#
# Copyright (C) 2007-2009 Andrew Resch <andrewresch@gmail.com>
# Copyright (C) 2011 Pedro Algarvio <pedro@algarvio.me>
#
# This file is part of Deluge and is licensed under GNU General Public License 3.0, or later, with
# the additional special exception to link portions of this program with t... | gpl-3.0 |
blackshirt/dompetku | dompetku/handler/services.py | 1 | 3750 | #!/usr/bin/env python
#
# Copyright @2014 blackshirtmuslim@yahoo.com
# Licensed: see Python license
"""Module to handle json services."""
import datetime
import json
import peewee
import tornado.web
import tornado.escape
from dompetku.handler import base
from dompetku.utils import jsonify
from dompetku.model import ... | bsd-2-clause |
spel-uchile/SUCHAI-Flight-Software | sandbox/log_parser.py | 1 | 1956 | import re
import argparse
import pandas as pd
# General expressions
re_error = re.compile(r'\[ERROR\]\[(\d+)\]\[(\w+)\](.+)')
re_warning = re.compile(r'\[WARN \]\[(\d+)\]\[(\w+)\](.+)')
re_info = re.compile(r'\[INFO \]\[(\d+)\]\[(\w+)\](.+)')
re_debug = re.compile(r'\[DEBUG\]\[(\d+)\]\[(\w+)\](.+)')
re_verbose = re.co... | gpl-3.0 |
datasciencedev/locality-sensitive-hashing | mapreduce/model.py | 4 | 39511 | #!/usr/bin/env python
#
# Copyright 2010 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 |
bl4ckdu5t/registron | old/e2etests/win32/NextID.py | 9 | 2653 | # Copyright (C) 2005, Giovanni Bajo
# Based on previous work under copyright (c) 1999, 2002 McMillan Enterprises, Inc.
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the... | mit |
RossBrunton/django | django/core/mail/__init__.py | 347 | 4697 | """
Tools for sending email.
"""
from __future__ import unicode_literals
from django.conf import settings
# Imported for backwards compatibility and for the sake
# of a cleaner namespace. These symbols used to be in
# django/core/mail.py before the introduction of email
# backends and the subsequent reorganization (Se... | bsd-3-clause |
pombreda/ruffus | ruffus/test/test_verbosity.py | 1 | 8627 | #!/usr/bin/env python
from __future__ import print_function
"""
test_verbosity.py
"""
temp_dir = "test_verbosity/"
import unittest
import os
import sys
# add grandparent to search path for testing
grandparent_dir = os.path.abspath(os.path.join(os.path.dirname(__file__), "..", ".."))
sys.path.insert(0, grandpar... | mit |
abalkin/numpy | numpy/polynomial/laguerre.py | 3 | 49890 | """
==================================================
Laguerre Series (:mod:`numpy.polynomial.laguerre`)
==================================================
This module provides a number of objects (mostly functions) useful for
dealing with Laguerre series, including a `Laguerre` class that
encapsulates the usual arit... | bsd-3-clause |
ageron/tensorflow | tensorflow/contrib/proto/python/kernel_tests/descriptor_source_test_base.py | 21 | 6788 | # =============================================================================
# Copyright 2018 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
#... | apache-2.0 |
gyang/nova | nova/rpc/impl_qpid.py | 5 | 19137 | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2011 OpenStack LLC
# Copyright 2011 - 2012, Red Hat, 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
#
# h... | apache-2.0 |
ewilazarus/snnm | snnm.py | 1 | 2886 | #!/usr/bin/python
"""
snnm
~~~~
This module contains the source code for `snnm`
Snnm is an utility tool created to fetch synonyms for a given expression from
the web and print them to the console.
"""
import bs4
import click
import requests
BASE_URL = 'http://www.thesaurus.com/browse/'
def _fetch_html(expression):... | mit |
guillaume-philippon/aquilon | tests/broker/test_del_virtual_switch.py | 1 | 2507 | #!/usr/bin/env python
# -*- cpy-indent-level: 4; indent-tabs-mode: nil -*-
# ex: set expandtab softtabstop=4 shiftwidth=4:
#
# Copyright (C) 2009,2010,2012,2013,2014,2015,2016 Contributor
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the Licen... | apache-2.0 |
vmalloc/gossip | gossip/utils.py | 2 | 2484 | import itertools
from .exceptions import CannotResolveDependencies
from .helpers import DONT_CARE, FIRST
def topological_sort_registrations(registrations, unconstrained_priority=DONT_CARE):
graph = _build_dependency_graph(registrations, unconstrained_priority=unconstrained_priority)
returned_indices = _topolo... | bsd-3-clause |
qPCR4vir/orange | Orange/OrangeWidgets/Classify/OWClassificationTreeViewer.py | 6 | 12035 | """
<name>Classification Tree Viewer</name>
<description>Classification tree viewer (hierarchical list view).</description>
<icon>icons/ClassificationTreeViewer.svg</icon>
<contact>Janez Demsar (janez.demsar(@at@)fri.uni-lj.si)</contact>
<priority>2100</priority>
"""
from OWWidget import *
from orngTree import TreeLear... | gpl-3.0 |
michaelgallacher/intellij-community | python/helpers/coveragepy/coverage/execfile.py | 209 | 5865 | """Execute files of Python code."""
import imp, marshal, os, sys
from coverage.backward import exec_code_object, open_source
from coverage.misc import ExceptionDuringRun, NoCode, NoSource
try:
# In Py 2.x, the builtins were in __builtin__
BUILTINS = sys.modules['__builtin__']
except KeyError:
# In Py 3.... | apache-2.0 |
jasonbot/django | django/contrib/gis/db/backends/oracle/introspection.py | 539 | 1977 | import sys
import cx_Oracle
from django.db.backends.oracle.introspection import DatabaseIntrospection
from django.utils import six
class OracleIntrospection(DatabaseIntrospection):
# Associating any OBJECTVAR instances with GeometryField. Of course,
# this won't work right on Oracle objects that aren't MDS... | bsd-3-clause |
Gchorba/Ask | lib/python2.7/site-packages/wolframalpha-1.2-py2.7.egg/wolframalpha/__init__.py | 3 | 1994 | from xml.etree import ElementTree as etree
from six.moves import urllib
from . import compat
compat.fix_HTTPMessage()
class Result(object):
def __init__(self, stream):
self.tree = etree.parse(stream)
self._handle_error()
def _handle_error(self):
error = self.tree.find('error')
... | mit |
SurfasJones/djcmsrc3 | venv/lib/python2.7/site-packages/django/contrib/webdesign/tests.py | 232 | 1092 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
import unittest
from django.contrib.webdesign.lorem_ipsum import *
from django.template import loader, Context
class WebdesignTest(unittest.TestCase):
def test_words(self):
self.assertEqual(words(7), 'lorem ipsum dolor sit amet consectetur... | mit |
birryree/servo | tests/wpt/css-tests/tools/wptserve/wptserve/response.py | 114 | 14756 | from collections import OrderedDict
from datetime import datetime, timedelta
import Cookie
import json
import types
import uuid
import socket
from constants import response_codes
from logger import get_logger
missing = object()
class Response(object):
"""Object representing the response to a HTTP request
:p... | mpl-2.0 |
kezilu/pextant | pextant/api.py | 2 | 3350 | import csv
import json
import logging
import re
from pextant.solvers.astarMesh import astarSolver
from pextant.analysis.loadWaypoints import JSONloader
import matplotlib.pyplot as plt
logger = logging.getLogger()
class Pathfinder:
"""
This class performs the A* path finding algorithm and contains the Cost Func... | mit |
graphstorm/graphstorm | third_party/freetype/src/tools/docmaker/docbeauty.py | 877 | 2642 | #!/usr/bin/env python
#
# DocBeauty (c) 2003, 2004, 2008 David Turner <david@freetype.org>
#
# This program is used to beautify the documentation comments used
# in the FreeType 2 public headers.
#
from sources import *
from content import *
from utils import *
import utils
import sys, os, time, string, getopt
... | mit |
NoUsername/PrivateNotesExperimental | lib/south/management/commands/migrate.py | 4 | 4882 | from django.core.management.base import BaseCommand
from django.core.management.color import no_style
from django.conf import settings
from django.db import models
from optparse import make_option
from south import migration
import sys
class Command(BaseCommand):
option_list = BaseCommand.option_list + (
m... | agpl-3.0 |
BrewPi/brewpi-service | test/test_couchdb_client.py | 1 | 3284 | """
Tests brewblox_service.couchdb_client
"""
import pytest
from aiohttp import web
from aiohttp.client_exceptions import ClientResponseError
from brewblox_service import couchdb_client, http_client
TESTED = couchdb_client.__name__
SRV_URL = couchdb_client.COUCH_URL[len('http://'):]
DB_URL = '/sparkbase'
DOC_URL = '... | gpl-3.0 |
codeforeurope/Change-By-Us | framework/orm_holder.py | 3 | 2772 | """
:copyright: (c) 2011 Local Projects, all rights reserved
:license: Affero GNU GPL v3, see LICENSE for more details.
"""
from lib import web
from sqlalchemy import create_engine
from sqlalchemy.orm import scoped_session, sessionmaker
from framework.config import Config
class OrmHolder (object):
@prop... | agpl-3.0 |
fullfanta/mxnet | example/sparse/linear_classification/data.py | 20 | 1358 | # 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 |
annarev/tensorflow | tensorflow/python/ops/control_flow_grad.py | 8 | 9421 | # Copyright 2015 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | apache-2.0 |
philanthropy-u/edx-platform | openedx/core/djangoapps/user_authn/views/tests/test_login.py | 1 | 29762 | # coding:utf-8
"""
Tests for student activation and login
"""
import json
import unicodedata
import unittest
import ddt
import six
from django.conf import settings
from django.contrib.auth.models import User
from django.core import mail
from django.core.cache import cache
from django.http import HttpResponse, HttpResp... | agpl-3.0 |
kaiyuanl/gem5 | src/mem/slicc/ast/StallAndWaitStatementAST.py | 26 | 2360 | # Copyright (c) 1999-2008 Mark D. Hill and David A. Wood
# Copyright (c) 2009 The Hewlett-Packard Development Company
# Copyright (c) 2010 Advanced Micro Devices, Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following ... | bsd-3-clause |
javachengwc/hue | desktop/core/ext-py/Django-1.6.10/tests/admin_inlines/tests.py | 49 | 36114 | from __future__ import absolute_import, unicode_literals
from django.contrib.admin.tests import AdminSeleniumWebDriverTestCase
from django.contrib.admin.helpers import InlineAdminForm
from django.contrib.auth.models import User, Permission
from django.contrib.contenttypes.models import ContentType
from django.test imp... | apache-2.0 |
MIPS/external-chromium_org | webkit/tools/layout_tests/canary-webkit-revisions.py | 96 | 9820 | #!/usr/bin/env python
# Copyright (c) 2011 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.
"""Retrieve passing and failing WebKit revision numbers from canaries.
From each canary,
- the last WebKit revision number for whi... | bsd-3-clause |
bruteforce1/cryptopals | set2/ch10/implement_aes_cbc.py | 1 | 2510 | #!/usr/bin/python3
"""
CBC mode is a block cipher mode that allows us to encrypt irregularly-
sized messages, despite the fact that a block cipher natively only
transforms individual blocks.
In CBC mode, each ciphertext block is added to the next plaintext block
before the next call to the cipher core.
The first... | mit |
betrisey/home-assistant | homeassistant/components/media_player/kodi.py | 6 | 10407 | """
Support for interfacing with the XBMC/Kodi JSON-RPC API.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/media_player.kodi/
"""
import logging
import urllib
import voluptuous as vol
from homeassistant.components.media_player import (
SUPPORT_NEX... | mit |
liqi328/rjrepaircompany | django/core/files/uploadedfile.py | 402 | 4225 | """
Classes representing uploaded files.
"""
import os
try:
from cStringIO import StringIO
except ImportError:
from StringIO import StringIO
from django.conf import settings
from django.core.files.base import File
from django.core.files import temp as tempfile
from django.utils.encoding import smart_str
__al... | bsd-3-clause |
phihag/youtube-dl | youtube_dl/extractor/karrierevideos.py | 25 | 3379 | # coding: utf-8
from __future__ import unicode_literals
from .common import InfoExtractor
from ..compat import compat_urlparse
from ..utils import (
fix_xml_ampersands,
float_or_none,
xpath_with_ns,
xpath_text,
)
class KarriereVideosIE(InfoExtractor):
_VALID_URL = r'https?://(?:www\.)?karrierevid... | unlicense |
girishverma/linux_cst_bsp | tools/perf/util/setup.py | 2079 | 1438 | #!/usr/bin/python2
from distutils.core import setup, Extension
from os import getenv
from distutils.command.build_ext import build_ext as _build_ext
from distutils.command.install_lib import install_lib as _install_lib
class build_ext(_build_ext):
def finalize_options(self):
_build_ext.finalize_optio... | gpl-2.0 |
charanpald/features | features/test/PrimalCCATest.py | 1 | 3226 |
import unittest
import numpy
import scipy.linalg
from features.PrimalCCA import PrimalCCA
from features.KernelCCA import KernelCCA
from kernel.LinearKernel import LinearKernel
import logging
class PrimalCCATest(unittest.TestCase):
def setUp(self):
numpy.seterr(all='ignore')
pass
def test... | gpl-3.0 |
myt00seven/svrg | cifar/alexnet_lasagne/lasagne-googlenet-master/googlenet/layers/bn.py | 1 | 4243 | import numpy as np
import theano.tensor as T
import theano
from lasagne import init # from .. import init
from lasagne import nonlinearities # from .. import nonlinearities
from lasagne.layers.base import Layer # from .base import Layer
__all__ = [
"BNLayer",
]
class BNLayer(Layer):
"""
lasagne.layers... | mit |
qrsforever/workspace | python/learn/thinkstats/rankit.py | 1 | 1807 | #!/usr/bin/python3
# -*- coding: utf-8 -*-
"""This file contains code for use with "Think Stats",
by Allen B. Downey, available from greenteapress.com
Copyright 2010 Allen B. Downey
License: GNU GPLv3 http://www.gnu.org/licenses/gpl.html
"""
import random
import thinkstats
import myplot
import matplotlib.pyplot as p... | mit |
spvkgn/youtube-dl | youtube_dl/extractor/archiveorg.py | 24 | 2489 | from __future__ import unicode_literals
from .common import InfoExtractor
from ..utils import (
unified_strdate,
clean_html,
)
class ArchiveOrgIE(InfoExtractor):
IE_NAME = 'archive.org'
IE_DESC = 'archive.org videos'
_VALID_URL = r'https?://(?:www\.)?archive\.org/(?:details|embed)/(?P<id>[^/?#]+)... | unlicense |
codeforamerica/heroku-buildpack-pygeo | vendor/distribute-0.6.36/setuptools/tests/test_markerlib.py | 71 | 2237 | import os
import unittest
from setuptools.tests.py26compat import skipIf
try:
import ast
except ImportError:
pass
class TestMarkerlib(unittest.TestCase):
@skipIf('ast' not in globals(),
"ast not available (Python < 2.6?)")
def test_markers(self):
from _markerlib import interpret, defa... | mit |
hubsaysnuaa/odoo | addons/hw_scanner/controllers/main.py | 158 | 7486 | # -*- coding: utf-8 -*-
import logging
import os
import time
from os import listdir
from os.path import join
from threading import Thread, Lock
from select import select
from Queue import Queue, Empty
import openerp
import openerp.addons.hw_proxy.controllers.main as hw_proxy
from openerp import http
from openerp.http ... | agpl-3.0 |
deiga/robotframework-selenium2library | src/Selenium2Library/locators/tableelementfinder.py | 31 | 3986 | from selenium.common.exceptions import NoSuchElementException
from Selenium2Library import utils
from elementfinder import ElementFinder
class TableElementFinder(object):
def __init__(self, element_finder=None):
if not element_finder:
element_finder = ElementFinder()
self._element_find... | apache-2.0 |
janiheikkinen/irods | packaging/update_configuration_schema.py | 2 | 2771 | from __future__ import print_function
import json
import os
import subprocess
import sys
import time
DEBUG = True
DEBUG = False
def print_debug(*args, **kwargs):
if DEBUG:
print(*args, **kwargs)
def print_error(*args, **kwargs):
print(*args, file=sys.stderr, **kwargs)
def get_current_schema_vers... | bsd-3-clause |
baliga-lab/weeder_patched | python/seqtools.py | 1 | 3069 | HAMMING_MAX = 9999
def read_sequences_from_fasta_string(fasta_string):
"""reads the sequences contained in a FASTA string"""
lines = fasta_string.split('\n')
sequences = []
seqbuffer = ""
seqname = None
for line in lines:
line = line.strip()
if line.startswith('>'):
... | gpl-3.0 |
mohanprasath/Course-Work | data_analysis/uh_data_analysis_with_python/hy-data-analysis-with-python-spring-2020/part03-e05_correlation/test/test_correlation.py | 1 | 2795 | #!/usr/bin/env python3
import unittest
from unittest.mock import patch
from tmc import points
from tmc.utils import load, get_out
module_name="src.correlation"
correlations = load(module_name, "correlations")
lengths = load(module_name, "lengths")
def patch_name(m, d):
import importlib
parts=d.split(".")
... | gpl-3.0 |
hobarrera/todoman | tests/test_filtering.py | 1 | 8808 | from datetime import datetime
from datetime import timedelta
from todoman.cli import cli
from todoman.model import Database
from todoman.model import Todo
def test_priority(tmpdir, runner, create):
result = runner.invoke(cli, ["list"], catch_exceptions=False)
assert not result.exception
assert not result... | isc |
rimbalinux/MSISDNArea | django/contrib/gis/geos/prototypes/__init__.py | 12 | 1349 | """
This module contains all of the GEOS ctypes function prototypes. Each
prototype handles the interaction between the GEOS library and Python
via ctypes.
"""
# Coordinate sequence routines.
from django.contrib.gis.geos.prototypes.coordseq import create_cs, get_cs, \
cs_clone, cs_getordinate, cs_setord... | bsd-3-clause |
nyasara/azuremono-docker | IronPython-2.7.4/Lib/binhex.py | 55 | 14984 | """Macintosh binhex compression/decompression.
easy interface:
binhex(inputfilename, outputfilename)
hexbin(inputfilename, outputfilename)
"""
#
# Jack Jansen, CWI, August 1995.
#
# The module is supposed to be as compatible as possible. Especially the
# easy interface should work "as expected" on any plat... | mit |
mcanthony/nupic | src/nupic/regions/ImageSensor.py | 17 | 128455 | # ----------------------------------------------------------------------
# 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 apply:
#
# This progra... | agpl-3.0 |
fidomason/kbengine | kbe/res/scripts/common/Lib/site-packages/pip/locations.py | 390 | 6202 | """Locations where we look for configs, install stuff, etc"""
import sys
import site
import os
import tempfile
from distutils.command.install import install, SCHEME_KEYS
import getpass
from pip.backwardcompat import get_python_lib, get_path_uid, user_site
import pip.exceptions
DELETE_MARKER_MESSAGE = '''\
This file ... | lgpl-3.0 |
EPDCenter/android_kernel_bq_dc_v2 | 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 |
kthordarson/youtube-dl-ruv | youtube_dl/extractor/radiofrance.py | 163 | 2089 | # coding: utf-8
from __future__ import unicode_literals
import re
from .common import InfoExtractor
class RadioFranceIE(InfoExtractor):
_VALID_URL = r'^https?://maison\.radiofrance\.fr/radiovisions/(?P<id>[^?#]+)'
IE_NAME = 'radiofrance'
_TEST = {
'url': 'http://maison.radiofrance.fr/radiovisio... | unlicense |
parksandwildlife/borgcollector | tablemanager/migrations/0011_auto_20151020_0912.py | 4 | 1746 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
import tablemanager.models
class Migration(migrations.Migration):
dependencies = [
('tablemanager', '0010_auto_20150916_1107'),
]
operations = [
migrations.AlterField(
mo... | bsd-3-clause |
jcftang/ansible | lib/ansible/modules/monitoring/rollbar_deployment.py | 48 | 4077 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright 2014, Max Riveiro, <kavu13@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... | gpl-3.0 |
NeoRazorX/ubuntufaq | public.py | 1 | 15820 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# This file is part of ubuntufaq
# Copyright (C) 2011 Carlos Garcia Gomez neorazorx@gmail.com
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foun... | agpl-3.0 |
tuxfux-hlp-notes/python-batches | archieves/batch-60/modules/myenv/lib/python2.7/site-packages/pip/_vendor/requests/packages/chardet/euctwfreq.py | 3133 | 34872 | ######################## 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 |
kreatorkodi/repository.torrentbr | plugin.video.yatp/site-packages/hachoir_core/dict.py | 95 | 5376 | """
Dictionnary classes which store values order.
"""
from hachoir_core.error import HachoirError
from hachoir_core.i18n import _
class UniqKeyError(HachoirError):
"""
Error raised when a value is set whereas the key already exist in a
dictionnary.
"""
pass
class Dict(object):
"""
This cl... | gpl-2.0 |
themiken/mtasa-blue | vendor/google-breakpad/src/tools/gyp/test/win/gyptest-link-generate-manifest.py | 238 | 4708 | #!/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.
"""
Make sure we generate a manifest file when linking binaries, including
handling AdditionalManifestFiles.
"""
import TestGyp
import sys... | gpl-3.0 |
Krossom/python-for-android | python-modules/twisted/twisted/protocols/mice/mouseman.py | 81 | 2882 | # Copyright (c) 2001-2004 Twisted Matrix Laboratories.
# See LICENSE for details.
#
"""Logictech MouseMan serial protocol.
http://www.softnco.demon.co.uk/SerialMouse.txt
"""
from twisted.internet import protocol
class MouseMan(protocol.Protocol):
"""
Parser for Logitech MouseMan serial mouse protocol (comp... | apache-2.0 |
Semi-global/edx-platform | common/djangoapps/terrain/steps.py | 104 | 7473 | # pylint: disable=missing-docstring
# pylint: disable=redefined-outer-name
# Disable the "wildcard import" warning so we can bring in all methods from
# course helpers and ui helpers
# pylint: disable=wildcard-import
# Disable the "Unused import %s from wildcard import" warning
# pylint: disable=unused-wildcard-impor... | agpl-3.0 |
kenshay/ImageScripter | ProgramData/SystemFiles/Python/Lib/site-packages/win32comext/shell/demos/browse_for_folder.py | 47 | 1661 | # A couple of samples using SHBrowseForFolder
import sys, os
from win32com.shell import shell, shellcon
import win32gui
# A callback procedure - called by SHBrowseForFolder
def BrowseCallbackProc(hwnd, msg, lp, data):
if msg== shellcon.BFFM_INITIALIZED:
win32gui.SendMessage(hwnd, shellcon.BFFM_SETSELECTIO... | gpl-3.0 |
shsingh/ansible | test/support/integration/plugins/module_utils/net_tools/nios/api.py | 23 | 28784 | # This code is part of Ansible, but is an independent component.
# This particular file snippet, and this file snippet only, is BSD licensed.
# Modules you write using this snippet, which is embedded dynamically by Ansible
# still belong to the author of the module, and may assign their own license
# to the complete wo... | gpl-3.0 |
hclivess/Stallion | nuitka/Cryptodome/SelfTest/Util/test_Padding.py | 3 | 5642 | #
# SelfTest/Util/test_Padding.py: Self-test for padding functions
#
# ===================================================================
#
# Copyright (c) 2014, Legrandin <helderijs@gmail.com>
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted ... | gpl-3.0 |
ProfessionalIT/maxigenios-website | sdk/google_appengine/lib/django-1.3/django/contrib/localflavor/id/id_choices.py | 439 | 3217 | import warnings
from django.utils.translation import ugettext_lazy as _
# Reference: http://id.wikipedia.org/wiki/Daftar_provinsi_Indonesia
# Indonesia does not have an official Province code standard.
# I decided to use unambiguous and consistent (some are common) 3-letter codes.
warnings.warn(
'There have been... | mit |
MERegistro/meregistro | django/contrib/gis/gdal/tests/test_envelope.py | 68 | 3767 | import unittest
from django.contrib.gis.gdal import Envelope, OGRException
class TestPoint(object):
def __init__(self, x, y):
self.x = x
self.y = y
class EnvelopeTest(unittest.TestCase):
def setUp(self):
self.e = Envelope(0, 0, 5, 5)
def test01_init(self):
"Testing Enve... | bsd-3-clause |
Just-D/chromium-1 | third_party/pexpect/ANSI.py | 171 | 12646 | """This implements an ANSI (VT100) terminal emulator as a subclass of screen.
PEXPECT LICENSE
This license is approved by the OSI and FSF as GPL-compatible.
http://opensource.org/licenses/isc-license.txt
Copyright (c) 2012, Noah Spurrier <noah@noah.org>
PERMISSION TO USE, COPY, MODIFY, AND/OR DIS... | bsd-3-clause |
geertj/gruvi | tests/test_transports.py | 2 | 7476 | #
# This file is part of Gruvi. Gruvi is free software available under the
# terms of the MIT license. See the file "LICENSE" that was provided
# together with this source file for the licensing terms.
#
# Copyright (c) 2012-2017 the Gruvi authors. See the file "AUTHORS" for a
# complete list.
from __future__ import a... | mit |
MalloyPower/parsing-python | front-end/testsuite-python-lib/Python-3.6.0/Lib/idlelib/history.py | 13 | 4043 | "Implement Idle Shell history mechanism with History class"
from idlelib.config import idleConf
class History:
''' Implement Idle Shell history mechanism.
store - Store source statement (called from pyshell.resetoutput).
fetch - Fetch stored statement matching prefix already entered.
history_next - ... | mit |
rrohan/scikit-learn | sklearn/ensemble/voting_classifier.py | 178 | 8006 | """
Soft Voting/Majority Rule classifier.
This module contains a Soft Voting/Majority Rule classifier for
classification estimators.
"""
# Authors: Sebastian Raschka <se.raschka@gmail.com>,
# Gilles Louppe <g.louppe@gmail.com>
#
# Licence: BSD 3 clause
import numpy as np
from ..base import BaseEstimator
f... | bsd-3-clause |
LinuxChristian/home-assistant | homeassistant/components/binary_sensor/wink.py | 4 | 5888 | """
Support for Wink binary sensors.
For more details about this platform, please refer to the documentation at
at https://home-assistant.io/components/binary_sensor.wink/
"""
import asyncio
import logging
from homeassistant.components.binary_sensor import BinarySensorDevice
from homeassistant.components.wink import ... | apache-2.0 |
imageworks/OpenShadingLanguage | src/build-scripts/docdeep.py | 2 | 16511 | #!/usr/bin/env python
from __future__ import print_function, absolute_import
# Copyright Contributors to the Open Shading Language project.
# SPDX-License-Identifier: BSD-3-Clause
# https://github.com/AcademySoftwareFoundation/OpenShadingLanguage
# --------------------------------------------------------------------... | bsd-3-clause |
DataDog/integrations-core | openstack_controller/tests/common.py | 1 | 14615 | # (C) Datadog, Inc. 2018-present
# All rights reserved
# Licensed under Simplified BSD License (see LICENSE)
import datetime
import os
CHECK_NAME = 'openstack'
FIXTURES_DIR = os.path.join(os.path.dirname(os.path.abspath(__file__)), 'fixtures')
ALL_IDS = ['server-1', 'server-2', 'other-1', 'other-2']
EXCLUDED_NETWORK... | bsd-3-clause |
bukzor/pgctl | tests/unit/flock.py | 3 | 1917 | # -*- coding: utf-8 -*-
# pylint:disable=no-self-use
from __future__ import absolute_import
from __future__ import print_function
from __future__ import unicode_literals
from pytest import yield_fixture as fixture
from testfixtures import ShouldRaise
from pgctl.flock import flock
from pgctl.flock import Locked
@fix... | mit |
asimshankar/tensorflow | tensorflow/python/saved_model/save.py | 1 | 34278 | # Copyright 2018 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 |
BlackPole/bp-dvbapp | lib/python/Components/Renderer/ChannelNumber.py | 5 | 1375 | from Components.VariableText import VariableText
from enigma import eLabel, iServiceInformation, eServiceReference, eServiceCenter
from Renderer import Renderer
#
# borrowed from vali, adapted for openpli
#
class ChannelNumber(Renderer, VariableText):
def __init__(self):
Renderer.__init__(self)
VariableText.__ini... | gpl-2.0 |
alejandroesquiva/AutomaticApiRest-PythonConnector | example/test.py | 1 | 1552 | __author__ = 'Alejandro Esquiva Rodriguez'
from aarpy.AARConnector import AARConnector
#AAR Instance
##Create instance via URL
AAR = AARConnector(url="http://automaticapirest.info/demo/getData.php?t=Country&c=Code,Name&l=0,5")
##Create instance via parameters
AAR = AARConnector(domain="http://automaticapirest.info/d... | mit |
GinnyN/towerofdimensions-django | build/lib/django/conf/locale/ml/formats.py | 341 | 1635 | # -*- encoding: utf-8 -*-
# This file is distributed under the same license as the Django package.
#
# The *_FORMAT strings use the Django date format syntax,
# see http://docs.djangoproject.com/en/dev/ref/templates/builtins/#date
DATE_FORMAT = 'N j, Y'
TIME_FORMAT = 'P'
DATETIME_FORMAT = 'N j, Y, P'
YEAR_MONTH_FORMAT... | bsd-3-clause |
darkryder/django | django/contrib/auth/tokens.py | 433 | 2803 | from datetime import date
from django.conf import settings
from django.utils import six
from django.utils.crypto import constant_time_compare, salted_hmac
from django.utils.http import base36_to_int, int_to_base36
class PasswordResetTokenGenerator(object):
"""
Strategy object used to generate and check token... | bsd-3-clause |
ubiar/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 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.