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 |
|---|---|---|---|---|---|
Xion/pelican-plugins | sub_parts/sub_parts.py | 59 | 2671 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from pelican import signals
import logging
logger = logging.getLogger(__name__)
def patch_subparts(generator):
generator.subparts = []
slugs = {}
for article in generator.articles:
slugs[article.slug] = article
if '--' in art... | agpl-3.0 |
meghabhoj/NEWBAZAAR | bazaar/listings/urls.py | 2 | 1143 | from __future__ import unicode_literals
from django.conf.urls import patterns, url
from .views import ListingListView, ListingDetailView, ListingUpdateView, ListingDeleteView, PublishingListView, \
PublishingCreateView, PublishingUpdateView, PublishingDeleteView
urlpatterns = patterns(
'',
url(r'^listings... | bsd-2-clause |
mozilla/kitsune | kitsune/kpi/management/commands/update_l10n_metric.py | 1 | 2630 | from datetime import date, timedelta
from django.conf import settings
from django.core.management.base import BaseCommand
from kitsune.kpi.management import utils
from kitsune.kpi.models import L10N_METRIC_CODE, Metric, MetricKind
from kitsune.sumo import googleanalytics
class Command(BaseCommand):
help = "Calc... | bsd-3-clause |
bopo/tablib | tablib/packages/xlwt3/ExcelFormulaLexer.py | 46 | 4311 | import sys
from .antlr import EOF, CommonToken as Tok, TokenStream, TokenStreamException
import struct
from . import ExcelFormulaParser
from re import compile as recompile, match, LOCALE, UNICODE, IGNORECASE, VERBOSE
int_const_pattern = r"\d+\b"
flt_const_pattern = r"""
(?:
(?: \d* \. \d+ ) # .1... | mit |
rosmo/aurora | src/test/python/apache/aurora/client/test_base.py | 3 | 3152 | #
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under ... | apache-2.0 |
jazzmes/pyroute2 | tests/test_tc.py | 2 | 7186 | import socket
from utils import require_user
from pyroute2 import IPRoute
from pyroute2 import protocols
from pyroute2.netlink import NetlinkError
from pyroute2.iproute import RTM_NEWQDISC
from pyroute2.iproute import RTM_NEWTFILTER
from pyroute2.iproute import RTM_NEWTCLASS
from pyroute2.iproute import TC_H_INGRESS
fr... | gpl-2.0 |
raysguy/HTPC-Manager | libs/requests/packages/chardet/escprober.py | 2936 | 3187 | ######################## BEGIN LICENSE BLOCK ########################
# The Original Code is mozilla.org code.
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 1998
# the Initial Developer. All Rights Reserved.
#
# Con... | mit |
tudorvio/tempest | tempest/services/compute/json/extensions_client.py | 9 | 1337 | # Copyright 2012 OpenStack Foundation
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requ... | apache-2.0 |
stevenewey/django | django/views/decorators/http.py | 144 | 7467 | """
Decorators for views based on HTTP headers.
"""
import logging
from calendar import timegm
from functools import wraps
from django.http import (
HttpResponse, HttpResponseNotAllowed, HttpResponseNotModified,
)
from django.middleware.http import ConditionalGetMiddleware
from django.utils.decorators import avai... | bsd-3-clause |
srottem/indy-sdk | docs/how-tos/write-did-and-query-verkey/python/write_did_and_query_verkey.py | 2 | 6316 | """
Example demonstrating how to add DID with the role of Trust Anchor as Steward.
Uses seed to obtain Steward's DID which already exists on the ledger.
Then it generates new DID/Verkey pair for Trust Anchor.
Using Steward's DID, NYM transaction request is built to add Trust Anchor's DID and Verkey
on the ledger with ... | apache-2.0 |
lucashmorais/x-Bench | mozmill-env/python/Lib/site-packages/hgext/convert/bzr.py | 94 | 11295 | # bzr.py - bzr support for the convert extension
#
# Copyright 2008, 2009 Marek Kubica <marek@xivilization.net> and others
#
# This software may be used and distributed according to the terms of the
# GNU General Public License version 2 or any later version.
# This module is for handling 'bzr', that was formerly kno... | mit |
msurovcak/PerfKitBenchmarker | perfkitbenchmarker/packages/fio.py | 3 | 7242 | # Copyright 2014 Google Inc. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agr... | apache-2.0 |
genenetwork/genenetwork2_diet | wqflask/utility/Plot.py | 2 | 45616 | # Copyright (C) University of Tennessee Health Science Center, Memphis, TN.
#
# 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 Foundation, either version 3 of the
# License, or (at your option) any la... | agpl-3.0 |
mikeireland/pynrm | go.py | 1 | 3044 | # -*- coding: utf-8 -*-
"""
Created on Fri May 2 13:49:11 2014
@author: mireland
A script for testing... Change this to try out your own analysis.
"""
import astropy.io.fits as pyfits
import numpy as np
import matplotlib.pyplot as plt
from azimuthalAverage import *
# This includes an AO Instrument called "aoinst"
... | mit |
Noviat/account-financial-reporting-V3-intrastat | account_journal_report_xls/wizard/print_journal_wizard.py | 27 | 8349 | # -*- encoding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
#
# Copyright (c) 2014 Noviat nv/sa (www.noviat.com). All rights reserved.
#
# This program is free software: you can redistribute it and/or modify
# it under... | agpl-3.0 |
CERT-Solucom/certitude | components/scanner/flatevaluators/services.py | 2 | 1432 | #!/usr/bin/env python
# -*- coding: UTF-8 -*-
'''
CERTitude: the seeker of IOC
Copyright (c) 2016 CERT-W
Contact: cert@wavestone.com
Contributors: @iansus, @nervous, @fschwebel
CERTitude is under licence GPL-2.0:
This program is free software; you can redistribute it and/or
modify ... | gpl-2.0 |
akash1808/nova_test_latest | nova/tests/unit/virt/libvirt/test_host.py | 43 | 42406 | # Copyright 2010 OpenStack Foundation
# Copyright 2012 University Of Minho
# Copyright 2014 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
#
# http://w... | apache-2.0 |
Mj258/weiboapi | srapyDemo/envs/Lib/site-packages/twisted/web/test/test_util.py | 5 | 11900 | # Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
"""
Tests for L{twisted.web.util}.
"""
from __future__ import absolute_import, division
from twisted.python.failure import Failure
from twisted.trial.unittest import TestCase
from twisted.internet import defer
from twisted.python.compat import _... | mit |
editxt/editxt | resources/syntax/scss.syntax.py | 1 | 7181 | # -*- coding: UTF-8 -*-
# Syntax definition automatically generated by hljs2xt.py
# source: scss.js
name = 'SCSS'
file_patterns = ['*.scss']
flags = re.IGNORECASE | re.MULTILINE
class comment:
default_text_color = DELIMITER
rules = [
# ignore {'begin': {'pattern': "\\b(a|an|the|are|I|I'm|isn't|don't|d... | gpl-3.0 |
JeanKossaifi/scikit-learn | sklearn/neighbors/nearest_centroid.py | 199 | 7249 | # -*- coding: utf-8 -*-
"""
Nearest Centroid Classification
"""
# Author: Robert Layton <robertlayton@gmail.com>
# Olivier Grisel <olivier.grisel@ensta.org>
#
# License: BSD 3 clause
import warnings
import numpy as np
from scipy import sparse as sp
from ..base import BaseEstimator, ClassifierMixin
from ..met... | bsd-3-clause |
willhardy/django | django/db/backends/oracle/compiler.py | 59 | 2044 | from django.db.models.sql import compiler
class SQLCompiler(compiler.SQLCompiler):
def as_sql(self, with_limits=True, with_col_aliases=False, subquery=False):
"""
Creates the SQL for this query. Returns the SQL string and list
of parameters. This is overridden from the original Query clas... | bsd-3-clause |
nysan/yocto-autobuilder | lib/python2.6/site-packages/buildbot-0.8.4p1-py2.6.egg/buildbot/cache.py | 4 | 2588 | # This file is part of Buildbot. Buildbot is free software: you can
# redistribute it and/or modify it under the terms of the GNU General Public
# License as published by the Free Software Foundation, version 2.
#
# This program is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without eve... | gpl-2.0 |
liveaverage/baruwa | src/baruwa/messages/management/commands/updatesarules.py | 1 | 2104 | #
# Baruwa - Web 2.0 MailScanner front-end.
# Copyright (C) 2010-2012 Andrew Colin Kissa <andrew@topdog.za.net>
#
# 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... | gpl-2.0 |
shikil/sympy | sympy/utilities/tests/test_pytest.py | 105 | 1601 | from sympy.utilities.pytest import raises, USE_PYTEST
if USE_PYTEST:
import py.test
pytestmark = py.test.mark.skipif(USE_PYTEST,
reason=("using py.test"))
# Test callables
def test_expected_exception_is_silent_callable():
def f():
raise ValueError()
raise... | bsd-3-clause |
LeartS/odoo | openerp/report/render/rml2txt/utils.py | 443 | 4710 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the... | agpl-3.0 |
andrescodas/casadi | test/python/function.py | 1 | 39929 | #
# This file is part of CasADi.
#
# CasADi -- A symbolic framework for dynamic optimization.
# Copyright (C) 2010-2014 Joel Andersson, Joris Gillis, Moritz Diehl,
# K.U. Leuven. All rights reserved.
# Copyright (C) 2011-2014 Greg Horn
#
# CasADi is free software; you can... | lgpl-3.0 |
jamesrobertlloyd/gpss-research | source/utils/misc.py | 4 | 7881 | import collections
import itertools
import numpy as np
nax = np.newaxis
# import Image
import mkl_hack
import scipy.linalg
import scipy.stats
import random
def set_all_random_seeds(seed=0):
random.seed(seed)
np.random.seed(seed)
def sample_truncated_normal(loc=0, scale=1, min_value=-np.Inf):
'''Uses inver... | mit |
unicef/un-partner-portal | backend/unpp_api/apps/project/exports/pdf/cfei.py | 1 | 10729 | import hashlib
import os
import tempfile
from urllib.parse import quote
from collections import defaultdict
from babel.dates import get_timezone, format_datetime, format_date
from django.http import HttpResponse
from django.utils import timezone
from reportlab.lib import colors
from reportlab.lib.enums import TA_CENTE... | apache-2.0 |
BladeSmithJohn/nixysa | nixysa/nullable_binding.py | 9 | 24217 | #!/usr/bin/python2.4
#
# Copyright 2008 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 |
samdowd/drumm-farm | drumm_env/lib/python2.7/site-packages/boto/cloudtrail/exceptions.py | 127 | 2246 | """
Exceptions that are specific to the cloudtrail module.
"""
from boto.exception import BotoServerError
class InvalidSnsTopicNameException(BotoServerError):
"""
Raised when an invalid SNS topic name is passed to Cloudtrail.
"""
pass
class InvalidS3BucketNameException(BotoServerError):
"""
... | mit |
adishjain/youtube-dl | youtube_dl/extractor/common.py | 6 | 55808 | from __future__ import unicode_literals
import base64
import datetime
import hashlib
import json
import netrc
import os
import re
import socket
import sys
import time
import xml.etree.ElementTree
from ..compat import (
compat_cookiejar,
compat_cookies,
compat_getpass,
compat_HTTPError,
compat_http... | unlicense |
TommiHelander/quabro | pgu/gui/__init__.py | 3 | 1226 | """Modules for creating a widget-based user interface. See the examples folder
for sample scripts that use this module."""
import pygame
# The basestring class was removed in Python 3, but we want to keep it to maintain
# compatibility with previous versions of python.
try:
__builtins__["basestring"]
except Key... | gpl-3.0 |
mlperf/training_results_v0.6 | Google/benchmarks/transformer/implementations/tpu-v3-2048-transformer/dataset_preproc/data_generators/subject_verb_agreement.py | 7 | 8527 | # coding=utf-8
# Copyright 2018 The Tensor2Tensor 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... | apache-2.0 |
shssoichiro/servo | tests/wpt/web-platform-tests/tools/pytest/_pytest/junitxml.py | 168 | 12879 | """
report test results in JUnit-XML format,
for use with Jenkins and build integration servers.
Based on initial code from Ross Lawley.
"""
# Output conforms to https://github.com/jenkinsci/xunit-plugin/blob/master/
# src/main/resources/org/jenkinsci/plugins/xunit/types/model/xsd/junit-10.xsd
import py
impo... | mpl-2.0 |
josephlewis42/autopilot | extern/gtest/test/gtest_break_on_failure_unittest.py | 2140 | 7339 | #!/usr/bin/env python
#
# Copyright 2006, 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... | gpl-3.0 |
nburn42/tensorflow | tensorflow/python/ops/linalg/linear_operator_kronecker.py | 23 | 22568 | # 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 |
mbkumar/pymatgen | pymatgen/symmetry/structure.py | 3 | 5251 | # coding: utf-8
# Copyright (c) Pymatgen Development Team.
# Distributed under the terms of the MIT License.
"""
This module implements symmetry-related structure forms.
"""
from typing import Sequence, List
import numpy as np
from tabulate import tabulate
from pymatgen.core.structure import Structure, PeriodicSit... | mit |
dmuhlhei/AliPhysics | PWGJE/EMCALJetTasks/Tracks/analysis/base/struct/EventHistogram.py | 41 | 4257 | #**************************************************************************
#* Copyright(c) 1998-2014, ALICE Experiment at CERN, All rights reserved. *
#* *
#* Author: The ALICE Off-line Project. *
#* Contributors ... | bsd-3-clause |
jdamick/openshift-ansible | playbooks/aws/openshift-cluster/library/ec2_ami_find.py | 27 | 9772 | #!/usr/bin/python
#pylint: skip-file
#
# 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.
#
# A... | apache-2.0 |
orgito/ansible | lib/ansible/utils/module_docs_fragments/emc.py | 35 | 1140 | #
# Copyright (c) 2018, Luca 'remix_tj' Lorenzetto <lorenzetto.luca@gmail.com>
#
# This file is part of Ansible
#
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
class ModuleDocFragment(object):
DOCUMENTATION = """
options:
- See respective platform section for more... | gpl-3.0 |
CEG-FYP-OpenStack/scheduler | nova/tests/unit/scheduler/filters/test_compute_capabilities_filters.py | 12 | 5114 | # 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
# d... | apache-2.0 |
mifl/android_kernel_pantech_oscar | tools/perf/scripts/python/syscall-counts.py | 11181 | 1522 | # system call counts
# (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
import sys
sys.path.append(os.envir... | gpl-2.0 |
littlstar/chromium.src | native_client_sdk/src/build_tools/sdk_tools/sdk_update_common.py | 168 | 3249 | # 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.
"""Utility functions for sdk_update.py and sdk_update_main.py."""
import errno
import logging
import os
import shutil
import subprocess
import sys
impor... | bsd-3-clause |
5hubh4m/CS231n | Assignment3/cs231n/im2col.py | 53 | 2090 | import numpy as np
def get_im2col_indices(x_shape, field_height, field_width, padding=1, stride=1):
# First figure out what the size of the output should be
N, C, H, W = x_shape
assert (H + 2 * padding - field_height) % stride == 0
assert (W + 2 * padding - field_height) % stride == 0
out_height = (H + 2 * ... | mit |
vjmac15/Lyilis | lib/nacl/signing (VJ Washington's conflicted copy 2017-08-29).py | 17 | 6661 | # Copyright 2013 Donald Stufft and individual contributors
#
# 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... | gpl-3.0 |
marc-sensenich/ansible | lib/ansible/modules/cloud/google/gcp_redis_instance_facts.py | 9 | 7546 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright (C) 2017 Google
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
# ----------------------------------------------------------------------------
#
# *** AUTO GENERATED CODE *** AUTO GENERATED CODE ***
#
... | gpl-3.0 |
mrquim/repository.mrquim | plugin.video.neptune-1.2.2/resources/lib/modules/realdebrid.py | 5 | 15187 | import util
import threading, time, json, os, ast
import xbmc, xbmcplugin, xbmcaddon, xbmcgui
import urllib, urllib2, cookielib
import requests, string
client_id="MN55HGIQEO2BE" #realdebrid clientid
# reset realdebrid, for testing
"""xbmcaddon.Addon().setSetting('rd_id', "")
xbmcaddon.Addon().setSetting('rd_secret', ... | gpl-2.0 |
npe9/depot_tools | gsutil.py | 11 | 3665 | #!/usr/bin/env python
# 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.
"""Run a pinned gsutil."""
import argparse
import base64
import hashlib
import json
import os
import shutil
import subprocess
import ... | bsd-3-clause |
jodal/pykka | tests/test_registry.py | 1 | 5406 | import pytest
from pykka import ActorRegistry
pytestmark = pytest.mark.usefixtures("stop_all")
class ActorBase:
received_messages = None
def __init__(self):
super().__init__()
self.received_messages = []
def on_receive(self, message):
self.received_messages.append(message)
@p... | apache-2.0 |
Amechi101/concepteur-market-app | venv/lib/python2.7/site-packages/django/templatetags/future.py | 130 | 1640 | from django.template import Library
from django.template import defaulttags
register = Library()
@register.tag
def ssi(parser, token):
# Used for deprecation path during 1.3/1.4, will be removed in 2.0
return defaulttags.ssi(parser, token)
@register.tag
def url(parser, token):
# Used for deprecation pa... | mit |
myarjunar/QGIS | python/plugins/processing/gui/ScriptEdit.py | 1 | 7614 | # -*- coding: utf-8 -*-
"""
***************************************************************************
ScriptEdit.py
---------------------
Date : April 2013
Copyright : (C) 2013 by Alexander Bruy
Email : alexander dot bruy at gmail dot com
****************... | gpl-2.0 |
rockfruit/bika.lims | bika/lims/browser/viewlets.py | 1 | 5596 | # This file is part of Bika LIMS
#
# Copyright 2011-2016 by it's authors.
# Some rights reserved. See LICENSE.txt, AUTHORS.txt.
import json
import urllib
import time
from Products.CMFCore.utils import getToolByName
from Products.Five.browser.pagetemplatefile import ViewPageTemplateFile
from plone import api
from plon... | agpl-3.0 |
tst-lsavoie/earthenterprise | earth_enterprise/src/google/protobuf-py/google/protobuf/internal/type_checkers.py | 9 | 12112 | # Protocol Buffers - Google's data interchange format
# Copyright 2008 Google Inc. All rights reserved.
# http://code.google.com/p/protobuf/
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions o... | apache-2.0 |
spnow/grr | lib/flows/general/services.py | 2 | 2574 | #!/usr/bin/env python
# Copyright 2012 Google Inc. All Rights Reserved.
"""Get running/installed services."""
from grr.lib import aff4
from grr.lib import flow
from grr.lib import rdfvalue
from grr.proto import flows_pb2
from grr.proto import jobs_pb2
class ServiceInformation(rdfvalue.RDFProtoStruct):
protobuf =... | apache-2.0 |
fgesora/odoo | addons/l10n_be_coda/wizard/__init__.py | 439 | 1098 | # -*- encoding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
#
# Copyright (c) 2011 Noviat nv/sa (www.noviat.be). All rights reserved.
#
# This program is free software: you can redistribute it and/or modify
# it u... | agpl-3.0 |
boomsbloom/dtm-fmri | DTM/for_gensim/lib/python2.7/site-packages/mpl_toolkits/axisartist/axis_artist.py | 7 | 52735 | """
axis_artist.py module provides axis-related artists. They are
* axis line
* tick lines
* tick labels
* axis label
* grid lines
The main artist class is a AxisArtist and a GridlinesCollection. The
GridlinesCollection is responsible for drawing grid lines and the
AxisArtist is responsible for all other artists... | mit |
jgerschler/ESL-Games | Kinect/Adjective Adverb/Adverb or Adjective (Deprecated)/AdverbOrAdjectiveFullScreen.py | 1 | 12778 | # for python 3
# You'll need to customize this according to your needs. Proper orientation of
# the kinect is vital; if participants are able to maintain their head or wrists
# continuously inside the word rects, they will repeatedly trigger the collision
# detection
from pykinect2 import PyKinectV2
from pykinect2.PyKi... | mit |
wxgeo/geophar | wxgeometrie/sympy/codegen/tests/test_applications.py | 7 | 2142 | # This file contains tests that exercise multiple AST nodes
from sympy.external import import_module
from sympy.printing.ccode import ccode
from sympy.utilities._compilation import compile_link_import_strings, has_c
from sympy.utilities._compilation.util import TemporaryDirectory, may_xfail
from sympy.utilities.pytest... | gpl-2.0 |
mastizada/kuma | vendor/lib/python/south/migration/base.py | 57 | 16235 | from __future__ import print_function
from collections import deque
import datetime
from imp import reload
import os
import re
import sys
from django.core.exceptions import ImproperlyConfigured
from django.db import models
from django.conf import settings
from django.utils import importlib
from south import exceptio... | mpl-2.0 |
overtherain/scriptfile | software/googleAppEngine/lib/django_0_96/django/core/servers/fastcgi.py | 32 | 5506 | """
FastCGI server that implements the WSGI protocol.
Uses the flup python package: http://www.saddi.com/software/flup/
This is a adaptation of the flup package to add FastCGI server support
to run Django apps from Web servers that support the FastCGI protocol.
This module can be run standalone or from the django-adm... | mit |
apporc/nova | nova/virt/xenapi/volumeops.py | 17 | 9667 | # Copyright (c) 2010 Citrix Systems, Inc.
# Copyright (c) 2013 OpenStack Foundation
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE... | apache-2.0 |
TNosredna/CouchPotatoServer | libs/tornado/process.py | 18 | 10100 | #!/usr/bin/env python
#
# Copyright 2011 Facebook
#
# 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 a... | gpl-3.0 |
dwlehman/blivet | blivet/errors.py | 2 | 4729 | # errors.py
# Exception classes for anaconda's storage configuration module.
#
# Copyright (C) 2009 Red Hat, Inc.
#
# This copyrighted material is made available to anyone wishing to use,
# modify, copy, or redistribute it subject to the terms and conditions of
# the GNU General Public License v.2, or (at your option)... | lgpl-2.1 |
gram526/VTK | ThirdParty/Twisted/twisted/internet/wxreactor.py | 80 | 5221 | # Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
"""
This module provides wxPython event loop support for Twisted.
In order to use this support, simply do the following::
| from twisted.internet import wxreactor
| wxreactor.install()
Then, when your root wxApp has been created::
... | bsd-3-clause |
marissazhou/django | django/conf/locale/mk/formats.py | 504 | 1742 | # -*- encoding: utf-8 -*-
# This file is distributed under the same license as the Django package.
#
from __future__ import unicode_literals
# The *_FORMAT strings use the Django date format syntax,
# see http://docs.djangoproject.com/en/dev/ref/templates/builtins/#date
DATE_FORMAT = 'd F Y'
TIME_FORMAT = 'H:i'
DATETI... | bsd-3-clause |
popazerty/EG-2 | lib/python/Components/Converter/ServiceInfo.py | 7 | 9467 | from Components.Converter.Converter import Converter
from enigma import iServiceInformation, iPlayableService
from Components.Element import cached
from os import path
WIDESCREEN = [3, 4, 7, 8, 0xB, 0xC, 0xF, 0x10]
class ServiceInfo(Converter, object):
HAS_TELETEXT = 1
IS_MULTICHANNEL = 2
AUDIO_STEREO = 3
IS_CRY... | gpl-2.0 |
SickGear/SickGear | lib/urllib3/packages/ssl_match_hostname/_implementation.py | 48 | 5679 | """The match_hostname() function from Python 3.3.3, essential when using SSL."""
# Note: This file is under the PSF license as the code comes from the python
# stdlib. http://docs.python.org/3/license.html
import re
import sys
# ipaddress has been backported to 2.6+ in pypi. If it is installed on the
# system, us... | gpl-3.0 |
salfab/CouchPotatoServer | libs/sqlalchemy/connectors/mxodbc.py | 18 | 5517 | # connectors/mxodbc.py
# Copyright (C) 2005-2013 the SQLAlchemy authors and contributors <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php
"""
Provide an SQLALchemy connector for the eGenix mxODBC commercial
Python adapt... | gpl-3.0 |
1kastner/analyse_weather_data | gather_weather_data/wunderground/summarize_raw_airport_data.py | 1 | 8898 | """
Summarize all downloaded airport weather station data files.
Uses UTC time zone.
Use
-m gather_weather_data.wunderground.summarize_raw_airport_data
to run the demo
"""
import os
import json
import datetime
import logging
import numpy
import pandas
import metar.Metar # needs https://github.com/tomp/python-meta... | agpl-3.0 |
jpbrucker/mbed | workspace_tools/host_tests/default_auto.py | 101 | 1236 | """
mbed SDK
Copyright (c) 2011-2013 ARM Limited
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in wr... | apache-2.0 |
vitay/ANNarchy | ANNarchy/core/PopulationView.py | 2 | 12538 | #===============================================================================
#
# PopulationView
#
# This file is part of ANNarchy.
#
# Copyright (C) 2013-2016 Julien Vitay <julien.vitay@gmail.com>,
# Helge Uelo Dinkelbach <helge.dinkelbach@gmail.com>
#
# This program is free software: you can r... | gpl-2.0 |
EvanK/ansible | lib/ansible/modules/remote_management/manageiq/manageiq_user.py | 64 | 10097 | #!/usr/bin/python
#
# (c) 2017, Daniel Korn <korndaniel1@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 o... | gpl-3.0 |
diogommartins/pox | pox/messenger/web_transport.py | 40 | 8822 | # Copyright 2011,2012 James McCauley
#
# 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 |
adrienbrault/home-assistant | homeassistant/components/elv/switch.py | 5 | 2665 | """Support for PCA 301 smart switch."""
import logging
import pypca
from serial import SerialException
from homeassistant.components.switch import ATTR_CURRENT_POWER_W, SwitchEntity
from homeassistant.const import EVENT_HOMEASSISTANT_STOP
_LOGGER = logging.getLogger(__name__)
ATTR_TOTAL_ENERGY_KWH = "total_energy_k... | mit |
superdesk/superdesk-aap | server/aap/macros/remove_place_with_no_qcode_test.py | 3 | 1704 | # -*- coding: utf-8; -*-
#
# This file is part of Superdesk.
#
# Copyright 2013, 2014 Sourcefabric z.u. and contributors.
#
# 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
from superde... | agpl-3.0 |
hyunokoh/s4_qemu | scripts/vmstate-static-checker.py | 51 | 15334 | #!/usr/bin/python
#
# Compares vmstate information stored in JSON format, obtained from
# the -dump-vmstate QEMU command.
#
# Copyright 2014 Amit Shah <amit.shah@redhat.com>
# Copyright 2014 Red Hat, Inc.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Pu... | gpl-2.0 |
sdphome/UHF_Reader | rfs/rootfs/usr/lib/python2.7/encodings/mac_latin2.py | 647 | 8565 | """ Python Character Mapping Codec generated from 'LATIN2.TXT' with gencodec.py.
Written by Marc-Andre Lemburg (mal@lemburg.com).
(c) Copyright CNRI, All Rights Reserved. NO WARRANTY.
(c) Copyright 2000 Guido van Rossum.
"""#"
import codecs
### Codec APIs
class Codec(codecs.Codec):
def encode(self,input,erro... | gpl-3.0 |
rickerc/glance_audit | glance/cmd/manage.py | 3 | 4395 | #!/usr/bin/env python
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2010 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# Copyright 2011 OpenStack LLC.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "Lice... | apache-2.0 |
peterayeni/libforensics | code/lf/win/shell/recyclebin/dtypes.py | 13 | 1410 | # Copyright 2010 Michael Murr
#
# This file is part of LibForensics.
#
# LibForensics is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later ver... | lgpl-3.0 |
shanot/imp | modules/rmf/dependency/RMF/tools/dev_tools/python_tools/cpp_format.py | 2 | 5358 | """Use the Python pygments library to perform extra checks on C++ grammar."""
from pygments import token
from pygments.lexers.compiled import CppLexer
import re
import os
def check_header_file(fh_name, project_name, errors):
"""Check a single C++ header file"""
_check_file(fh_name, project_name, True, errors... | gpl-3.0 |
shangwuhencc/scikit-learn | sklearn/decomposition/tests/test_incremental_pca.py | 297 | 8265 | """Tests for Incremental PCA."""
import numpy as np
from sklearn.utils.testing import assert_almost_equal
from sklearn.utils.testing import assert_array_almost_equal
from sklearn.utils.testing import assert_raises
from sklearn import datasets
from sklearn.decomposition import PCA, IncrementalPCA
iris = datasets.load... | bsd-3-clause |
pheanex/xpython | exercises/point-mutations/point_mutations_test.py | 2 | 1286 | import unittest
from point_mutations import hamming_distance
class DNATest(unittest.TestCase):
def test_no_difference_between_empty_strands(self):
self.assertEqual(hamming_distance('', ''), 0)
def test_no_difference_between_identical_strands(self):
self.assertEqual(hamming_distance('GGACTGA'... | mit |
ptoraskar/django | django/contrib/gis/utils/layermapping.py | 335 | 27300 | # LayerMapping -- A Django Model/OGR Layer Mapping Utility
"""
The LayerMapping class provides a way to map the contents of OGR
vector files (e.g. SHP files) to Geographic-enabled Django models.
For more information, please consult the GeoDjango documentation:
https://docs.djangoproject.com/en/dev/ref/contrib/gi... | bsd-3-clause |
swenson/sagewiki | unidecode/unidecode/x070.py | 252 | 4693 | data = (
'You ', # 0x00
'Yang ', # 0x01
'Lu ', # 0x02
'Si ', # 0x03
'Jie ', # 0x04
'Ying ', # 0x05
'Du ', # 0x06
'Wang ', # 0x07
'Hui ', # 0x08
'Xie ', # 0x09
'Pan ', # 0x0a
'Shen ', # 0x0b
'Biao ', # 0x0c
'Chan ', # 0x0d
'Mo ', # 0x0e
'Liu ', # 0x0f
'Jian ', # 0x10
'P... | gpl-2.0 |
jacklopessapo/support-tools | googlecode-issues-exporter/bitbucket_issue_converter.py | 92 | 6834 | # Copyright 2014 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... | apache-2.0 |
patrickm/chromium.src | build/android/test_runner.py | 2 | 28778 | #!/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.
"""Runs all types of tests from one unified interface."""
import collections
import logging
import optparse
import os
import shutil
... | bsd-3-clause |
jkankiewicz/kivy | examples/canvas/lines_extended.py | 21 | 3977 | '''
Lines Extended Demo
===================
This demonstrates how to use the extended line drawing routines such
as circles, ellipses, and rectangles. You should see a static image of
labelled shapes on the screen.
'''
from kivy.app import App
from kivy.uix.gridlayout import GridLayout
from kivy.uix.widget import Wid... | mit |
manjunaths/tensorflow | tensorflow/contrib/learn/__init__.py | 8 | 2286 | # 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 |
tangfeixiong/nova | nova/tests/functional/v3/test_multiple_create.py | 30 | 2240 | # Copyright 2012 Nebula, Inc.
# Copyright 2014 IBM Corp.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required... | apache-2.0 |
uber/ludwig | ludwig/encoders/sequence_encoders.py | 1 | 102959 | #! /usr/bin/env python
# coding=utf-8
# Copyright (c) 2019 Uber Technologies, 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
#
# Unles... | apache-2.0 |
knifenomad/django | tests/utils_tests/test_timezone.py | 149 | 7857 | import copy
import datetime
import pickle
import unittest
from django.test import override_settings
from django.utils import timezone
try:
import pytz
except ImportError:
pytz = None
requires_pytz = unittest.skipIf(pytz is None, "this test requires pytz")
if pytz is not None:
CET = pytz.timezone("Europe... | bsd-3-clause |
kenshay/ImageScript | ProgramData/Android/ADB/platform-tools/systrace/catapult/telemetry/third_party/pyfakefs/pyfakefs/example.py | 23 | 3559 | # Copyright 2014 Altera Corporation. All Rights Reserved.
# Author: John McGehee
#
# 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... | gpl-3.0 |
caseyrollins/osf.io | addons/gitlab/tests/test_views.py | 4 | 23654 | # -*- coding: utf-8 -*-
import httplib as http
import mock
import datetime
import pytest
import unittest
from json import dumps
from nose.tools import * # noqa (PEP8 asserts)
from tests.base import OsfTestCase, get_default_metaschema
from osf_tests.factories import ProjectFactory, UserFactory, AuthUserFactory
from ... | apache-2.0 |
Jorge-Rodriguez/ansible | lib/ansible/modules/cloud/openstack/os_server_action.py | 54 | 8029 | #!/usr/bin/python
# coding: utf-8 -*-
# Copyright (c) 2015, Jesse Keating <jlk@derpops.bike>
# 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 |
listamilton/supermilton.repository | script.module.youtube.dl/lib/youtube_dl/extractor/giga.py | 142 | 3819 | # coding: utf-8
from __future__ import unicode_literals
import itertools
from .common import InfoExtractor
from ..utils import (
qualities,
compat_str,
parse_duration,
parse_iso8601,
str_to_int,
)
class GigaIE(InfoExtractor):
_VALID_URL = r'https?://(?:www\.)?giga\.de/(?:[^/]+/)*(?P<id>[^/]+... | gpl-2.0 |
tima/ansible | lib/ansible/module_utils/facts/system/selinux.py | 162 | 3207 | # Collect facts related to selinux
#
# 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 |
husman/WoTrack | apps/wordtrack/levenshtein_reduce.py | 1 | 1308 | from nltk import metrics
class LevenshteinReduce(object):
def __init__(self, phrase, tracks):
"""
:param phrase: (str) phrase or ngram
:param tracks: (list) tacks to perform best string matching with
:return: Returns the track from the list of tracks best matching the given phrase... | mit |
samuelclay/NewsBlur | apps/monitor/views/newsblur_app_times.py | 1 | 1188 | from django.views import View
from django.shortcuts import render
import datetime
from django.conf import settings
class AppTimes(View):
def get(self, request):
servers = dict((("%s" % s['_id'], s['page_load']) for s in self.stats))
data = servers
chart_name = "app_times"
chart_typ... | mit |
oritwas/bonzini | scripts/tracetool/backend/stderr.py | 114 | 1385 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Stderr built-in backend.
"""
__author__ = "Lluís Vilanova <vilanova@ac.upc.edu>"
__copyright__ = "Copyright 2012, Lluís Vilanova <vilanova@ac.upc.edu>"
__license__ = "GPL version 2 or (at your option) any later version"
__maintainer__ = "Stefan Hajnoczi"
__em... | gpl-2.0 |
MrLoick/python-for-android | python-modules/twisted/twisted/trial/unittest.py | 59 | 57773 | # -*- test-case-name: twisted.trial.test.test_tests -*-
# Copyright (c) 2001-2009 Twisted Matrix Laboratories.
# See LICENSE for details.
"""
Things likely to be used by writers of unit tests.
Maintainer: Jonathan Lange
"""
import doctest, inspect
import os, warnings, sys, tempfile, gc, types
from pprint import pfo... | apache-2.0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.