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 |
|---|---|---|---|---|---|
gmarkall/numba | numba/core/decorators.py | 1 | 11579 | """
Define @jit and related decorators.
"""
import sys
import warnings
import inspect
import logging
from numba.core.errors import DeprecationError, NumbaDeprecationWarning
from numba.stencils.stencil import stencil
from numba.core import config, extending, sigutils, registry
_logger = logging.getLogger(__name__)
... | bsd-2-clause |
craynot/django | django/contrib/gis/db/backends/base/operations.py | 263 | 4865 | class BaseSpatialOperations(object):
"""
This module holds the base `BaseSpatialBackend` object, which is
instantiated by each spatial database backend with the features
it has.
"""
truncate_params = {}
# Quick booleans for the type of this spatial backend, and
# an attribute for the sp... | bsd-3-clause |
BT-fgarbely/odoo | addons/sale/report/invoice_report.py | 336 | 1680 | # -*- 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 |
googleapis/googleapis-gen | google/cloud/domains/v1beta1/domains-v1beta1-py/google/cloud/domains/__init__.py | 1 | 3740 | # -*- coding: utf-8 -*-
# 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... | apache-2.0 |
jralls/gramps | gramps/gen/lib/childreftype.py | 10 | 2770 | #
# Gramps - a GTK+/GNOME based genealogy program
#
# Copyright (C) 2000-2007 Donald N. Allingham
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at you... | gpl-2.0 |
balloob/home-assistant | tests/components/sentry/test_init.py | 7 | 10213 | """Tests for Sentry integration."""
import logging
import pytest
from homeassistant.components.sentry import get_channel, process_before_send
from homeassistant.components.sentry.const import (
CONF_DSN,
CONF_ENVIRONMENT,
CONF_EVENT_CUSTOM_COMPONENTS,
CONF_EVENT_HANDLED,
CONF_EVENT_THIRD_PARTY_PAC... | apache-2.0 |
larroy/clearskies_core | tools/gyp/test/mac/gyptest-rebuild.py | 299 | 1260 | #!/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.
"""
Verifies that app bundles are rebuilt correctly.
"""
import TestGyp
import sys
if sys.platform == 'darwin':
test = TestGyp.TestGyp(... | lgpl-3.0 |
kenshay/ImageScripter | ProgramData/SystemFiles/Python/Lib/site-packages/elan/Error_Email_Backup.py | 2 | 4409 | import os
from email.MIMEBase import MIMEBase
from email import Encoders
import smtplib
from elan import ElanSettings
from email.mime.multipart import MIMEMultipart
from email.MIMEText import MIMEText
from elan.ElanSettings import Script_Runner_Log,Say_Log_File_Path
Say_Log_File = Say_Log_File_Path
zip_file = r"C:\Elan... | gpl-3.0 |
ProtractorNinja/qutebrowser | tests/unit/utils/test_qtutils.py | 6 | 34264 | # vim: ft=python fileencoding=utf-8 sts=4 sw=4 et:
# Copyright 2014-2015 Florian Bruhin (The Compiler) <mail@qutebrowser.org>
#
# This file is part of qutebrowser.
#
# qutebrowser is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free S... | gpl-3.0 |
patacrep/patacrep | patacrep/latex/detex.py | 1 | 2402 | """Render `very simple` TeX commands in a simple TeX code."""
import logging
LOGGER = logging.getLogger()
MATCH = [
# Diacritics: a
(r"\'a", "á"),
(r"\'A", "Á"),
(r"\`a", "à"),
(r"\`A", "À"),
(r"\^a", "â"),
(r"\^A", "Â"),
(r"\"a", "ä"),
(r"\"A", "Ä"),
# Diacritics: e
(r"\... | gpl-2.0 |
brownman/selenium-webdriver | selenium/src/py/lib/docutils/parsers/rst/languages/zh_tw.py | 5 | 5164 | # -*- coding: utf-8 -*-
# Author: David Goodger
# Contact: goodger@users.sourceforge.net
# Revision: $Revision: 4229 $
# Date: $Date: 2005-12-23 00:46:16 +0100 (Fri, 23 Dec 2005) $
# Copyright: This module has been placed in the public domain.
# New language mappings are welcome. Before doing a new translation... | apache-2.0 |
Venturi/cms | env/lib/python2.7/site-packages/django/db/__init__.py | 146 | 2374 | from django.core import signals
from django.db.utils import (DEFAULT_DB_ALIAS, DJANGO_VERSION_PICKLE_KEY,
DataError, OperationalError, IntegrityError, InternalError, ProgrammingError,
NotSupportedError, DatabaseError, InterfaceError, Error, ConnectionHandler,
ConnectionRouter)
__all__ = [
'backend', '... | gpl-2.0 |
NoahKow/ziwuquan | crawler/ziwu/spiders/cnblog_spider.py | 3 | 2942 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from ziwu.components.redis.spiders import RedisMixin
from scrapy.selector import Selector
from scrapy.http import Request
from scrapy.utils.response import get_base_url
from scrapy.utils.url import urljoin_rfc
from scrapy.contrib.spiders import CrawlSpider, Rule
from sc... | bsd-2-clause |
logston/cunidecode | data/x074.py | 252 | 4696 | data = (
'Han ', # 0x00
'Xuan ', # 0x01
'Yan ', # 0x02
'Qiu ', # 0x03
'Quan ', # 0x04
'Lang ', # 0x05
'Li ', # 0x06
'Xiu ', # 0x07
'Fu ', # 0x08
'Liu ', # 0x09
'Ye ', # 0x0a
'Xi ', # 0x0b
'Ling ', # 0x0c
'Li ', # 0x0d
'Jin ', # 0x0e
'Lian ', # 0x0f
'Suo ', # 0x10
'Chii... | gpl-2.0 |
wakatime/sublime-wakatime | packages/wakatime/packages/pytz/reference.py | 839 | 3649 | '''
Reference tzinfo implementations from the Python docs.
Used for testing against as they are only correct for the years
1987 to 2006. Do not use these for real code.
'''
from datetime import tzinfo, timedelta, datetime
from pytz import utc, UTC, HOUR, ZERO
# A class building tzinfo objects for fixed-offset time zo... | bsd-3-clause |
dbaxa/django | tests/generic_views/test_list.py | 309 | 12129 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
import datetime
from django.core.exceptions import ImproperlyConfigured
from django.test import TestCase, override_settings
from django.utils.encoding import force_str
from django.views.generic.base import View
from .models import Artist, Author, Book, ... | bsd-3-clause |
waheedahmed/edx-platform | lms/djangoapps/commerce/models.py | 14 | 1394 | """
Commerce-related models.
"""
from django.db import models
from django.utils.translation import ugettext_lazy as _
from config_models.models import ConfigurationModel
class CommerceConfiguration(ConfigurationModel):
""" Commerce configuration """
class Meta(object):
app_label = "commerce"
AP... | agpl-3.0 |
sudosurootdev/external_chromium_org | tools/perf/page_sets/gmail_compose_discard.py | 33 | 2494 | # 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 re
from telemetry.page import page as page_module
from telemetry.page import page_set as page_set_module
def _CreateXpathFunction(xpath):
return ... | bsd-3-clause |
stephenfloor/tripseq-analysis | HumanCodonTable.py | 2 | 2046 | # Class to create a codon table for humans
# data from http://www.kazusa.or.jp/codon/cgi-bin/showcodon.cgi?species=9606&aa=1&style=N retrieved on 11/20/2014
# accessor methods to return avg codon frequency for a sequence or to find the stretch of N codons with minimum frequency, and what that frequency is
class Hum... | gpl-2.0 |
inessadl/kinect-2-libras | Kinect2Libras/KinectFingerTracking/Lib/distutils/spawn.py | 72 | 6467 | """distutils.spawn
Provides the 'spawn()' function, a front-end to various platform-
specific functions for launching another program in a sub-process.
Also provides the 'find_executable()' to search the path for a given
executable name.
"""
__revision__ = "$Id$"
import sys
import os
from distutils.errors import Di... | apache-2.0 |
seasidesun/shadowsocks-bak | shadowsocks/crypto/sodium.py | 1032 | 3778 | #!/usr/bin/env python
#
# 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 by applicable law or ... | apache-2.0 |
jhaux/tensorflow | tensorflow/python/kernel_tests/candidate_sampler_ops_test.py | 110 | 5343 | # 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 |
mrshu/scikit-learn | sklearn/base.py | 1 | 13740 | """Base class for all estimators."""
# Author: Gael Varoquaux <gael.varoquaux@normalesup.org>
# License: BSD Style
import copy
import inspect
import numpy as np
from scipy import sparse
from .metrics import r2_score
###############################################################################
def clone(estimator,... | bsd-3-clause |
MetricsGrimoire/sortinghat | tests/test_matcher_github.py | 1 | 18031 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright (C) 2014-2017 Bitergia
#
# 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 option) any la... | gpl-3.0 |
googleapis/googleapis-gen | google/cloud/recommender/v1beta1/recommender-v1beta1-py/google/cloud/recommender_v1beta1/services/recommender/transports/base.py | 1 | 11953 | # -*- coding: utf-8 -*-
# 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... | apache-2.0 |
MSOpenTech/edx-platform | lms/djangoapps/django_comment_client/base/tests.py | 39 | 47093 | import logging
import json
from django.test.client import Client, RequestFactory
from django.contrib.auth.models import User
from django.core.management import call_command
from django.core.urlresolvers import reverse
from mock import patch, ANY, Mock
from nose.tools import assert_true, assert_equal # pylint: disable... | agpl-3.0 |
andrewcmyers/tensorflow | tensorflow/python/util/protobuf/compare_test.py | 165 | 19171 | # 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 |
nvoron23/scikit-learn | sklearn/decomposition/tests/test_nmf.py | 47 | 8566 | import numpy as np
from scipy import linalg
from sklearn.decomposition import nmf
from scipy.sparse import csc_matrix
from sklearn.utils.testing import assert_true
from sklearn.utils.testing import assert_false
from sklearn.utils.testing import assert_raise_message
from sklearn.utils.testing import assert_array_almost... | bsd-3-clause |
pjg101/SickRage | lib/guessit/rules/properties/screen_size.py | 11 | 4294 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
screen_size property
"""
from rebulk.remodule import re
from rebulk import Rebulk, Rule, RemoveMatch
from ..common.validators import seps_surround
from ..common import dash, seps
def screen_size():
"""
Builder for rebulk object.
:return: Created Rebulk ob... | gpl-3.0 |
MungoRae/home-assistant | tests/components/test_updater.py | 6 | 6734 | """The tests for the Updater component."""
import asyncio
from datetime import timedelta
from unittest.mock import patch, Mock
from freezegun import freeze_time
import pytest
from homeassistant.setup import async_setup_component
from homeassistant.components import updater
import homeassistant.util.dt as dt_util
from... | apache-2.0 |
Baz2013/blog_demo | leetcode/easy/binary_watch.py | 1 | 3526 | # -*- coding:utf-8 -*-
# 401. Binary Watch QuestionEditorial Solution My Submissions
# Difficulty: Easy
# A binary watch has 4 LEDs on the top which represent the hours (0-11), and the 6 LEDs on the bottom
# represent the minutes (0-59).
#
# Each LED represents a zero or one, with the least significant bit on the ri... | gpl-3.0 |
msimacek/koschei | test/model_test.py | 1 | 14719 | # Copyright (C) 2016 Red Hat, 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 License, or
# (at your option) any later version.
#
# This program is distributed in ... | gpl-2.0 |
azure-contrib/splunk-azure-website-logs | bin/azure/storage/tableservice.py | 2 | 20761 | #-------------------------------------------------------------------------
# Copyright (c) Microsoft. 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.apac... | apache-2.0 |
japeto/Vigtech-Services | env/lib/python2.7/site-packages/django/conf/__init__.py | 46 | 7058 | """
Settings and configuration for Django.
Values will be read from the module specified by the DJANGO_SETTINGS_MODULE environment
variable, and then from django.conf.global_settings; see the global settings file for
a list of all possible variables.
"""
import importlib
import os
import time # Needed for Windows... | lgpl-3.0 |
classicboyir/BuildingMachineLearningSystemsWithPython | ch04/blei_lda.py | 21 | 2601 | # This code is supporting material for the book
# Building Machine Learning Systems with Python
# by Willi Richert and Luis Pedro Coelho
# published by PACKT Publishing
#
# It is made available under the MIT License
from __future__ import print_function
from wordcloud import create_cloud
try:
from gensim import co... | mit |
bowang/tensorflow | tensorflow/contrib/seq2seq/python/ops/decoder.py | 30 | 11351 | # 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 |
gautamMalu/rootfs_xen_arndale | usr/lib/python2.7/bsddb/dbutils.py | 157 | 2964 | #------------------------------------------------------------------------
#
# Copyright (C) 2000 Autonomous Zone Industries
#
# License: This is free software. You may use this software for any
# purpose including modification/redistribution, so long as
# this header remains intact and... | gpl-2.0 |
kailIII/geraldo | site/newsite/site-geraldo/django/contrib/localflavor/fr/fr_department.py | 39 | 3391 | # -*- coding: utf-8 -*-
DEPARTMENT_ASCII_CHOICES = (
('01', '01 - Ain'),
('02', '02 - Aisne'),
('03', '03 - Allier'),
('04', '04 - Alpes-de-Haute-Provence'),
('05', '05 - Hautes-Alpes'),
('06', '06 - Alpes-Maritimes'),
('07', '07 - Ardeche'),
('08', '08 - Ardennes'),
('09', '09 - Ar... | lgpl-3.0 |
PKRoma/python-for-android | pythonforandroid/recipes/libglob/__init__.py | 4 | 2376 | """
android libglob
available via '-lglob' LDFLAG
"""
from os.path import exists, join
from pythonforandroid.recipe import Recipe
from pythonforandroid.toolchain import current_directory
from pythonforandroid.logger import info, shprint
import sh
class LibGlobRecipe(Recipe):
"""Make a glob.h and glob.so f... | mit |
kevin-coder/tensorflow-fork | tensorflow/contrib/keras/api/keras/applications/inception_v3/__init__.py | 39 | 1125 | # 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 |
dosiecki/NewsBlur | vendor/paypalapi/exceptions.py | 20 | 1422 | # coding=utf-8
"""
Various PayPal API related exceptions.
"""
class PayPalError(Exception):
"""
Used to denote some kind of generic error. This does not include errors
returned from PayPal API responses. Those are handled by the more
specific exception classes below.
"""
def __init__(self, mes... | mit |
erdc/proteus | proteus/tests/sandbox/testRKDG.py | 1 | 25769 | #!/usr/bin/env python
from ScalarTransport import *
from ScalarTransportTests import *
from LevelSetTests import *
"""
test RKDG via ScalarTransport interface with quadrature for simple
advection problems
"""
def buildProblems(testFlag=0,
verbose=0):
"""
build data structures necessary f... | mit |
fnordahl/nova | nova/virt/libvirt/volume/volume.py | 29 | 5066 | # Copyright 2011 OpenStack Foundation
# (c) Copyright 2013 Hewlett-Packard Development Company, L.P.
# 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 |
Opticalp/instrumentall | testsuite/python/parameterGetterTest.py | 1 | 4696 | # -*- coding: utf-8 -*-
## @file testsuite/python/parameterGetterTest.py
## @date Jul 2016
## @author PhRG - opticalp.fr
##
## Test the features of the parameter getters
#
# Copyright (c) 2016 Ph. Renaud-Goud / Opticalp
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this so... | mit |
anirudhSK/chromium | build/android/pylib/utils/test_environment.py | 2 | 1407 | # Copyright 2013 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import logging
import psutil
import signal
from pylib import android_commands
def _KillWebServers():
for s in [signal.SIGTERM, signal.SIGINT, signal.SIG... | bsd-3-clause |
elainenaomi/sciwonc-dataflow-examples | sbbd2016/experiments/1-postgres/3_workflow_full_10files_primary_nosh_nors_annot_with_proj_3s/pegasus.bDkvI/pegasus-4.6.0/lib/python2.7/dist-packages/Pegasus/service/monitoring/queries.py | 1 | 57269 | # Copyright 2007-2014 University Of Southern California
#
# 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 ... | gpl-3.0 |
misisnik/ExternalInterface | ENV/Lib/encodings/iso2022_jp_ext.py | 816 | 1069 | #
# iso2022_jp_ext.py: Python Unicode Codec for ISO2022_JP_EXT
#
# Written by Hye-Shik Chang <perky@FreeBSD.org>
#
import _codecs_iso2022, codecs
import _multibytecodec as mbc
codec = _codecs_iso2022.getcodec('iso2022_jp_ext')
class Codec(codecs.Codec):
encode = codec.encode
decode = codec.decode
class Incr... | mit |
jumpstarter-io/horizon | openstack_dashboard/dashboards/admin/volumes/volumes/views.py | 12 | 2478 | # 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 t... | apache-2.0 |
simonmulser/bitcoin | test/functional/test_framework/bignum.py | 59 | 1914 | #!/usr/bin/env python3
#
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Big number routines.
This file is copied from python-bitcoinlib.
"""
import struct
# generic big endian MPI format
def bn_bytes(v, have_ext=False):
... | mit |
sudosurootdev/external_chromium_org | third_party/protobuf/python/google/protobuf/internal/cpp_message.py | 223 | 23539 | # 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... | bsd-3-clause |
CENDARI/editorsnotes | cendari/forms.py | 1 | 9303 | from django import forms
from django.contrib.auth.models import Permission
from django.contrib.contenttypes.models import ContentType
class ImportFromJigsawForm(forms.Form):
file = forms.FileField(label='Select a Jigsaw file')
topics = forms.CharField(max_length=100,required=False)
def _clean(self):
... | agpl-3.0 |
feureau/Small-Scripts | Blender/Blender config/2.91/scripts/addons/bricker_v2-2-1/ui/view_3d/debugging_tools.py | 1 | 5277 | # Copyright (C) 2020 Christopher Gearhart
# chris@bblanimation.com
# http://bblanimation.com/
#
# 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 opt... | gpl-3.0 |
TeachAtTUM/edx-platform | openedx/core/lib/course_tabs.py | 17 | 1412 | """
Tabs for courseware.
"""
from openedx.core.lib.plugins import PluginManager
# Stevedore extension point namespaces
COURSE_TAB_NAMESPACE = 'openedx.course_tab'
class CourseTabPluginManager(PluginManager):
"""
Manager for all of the course tabs that have been made available.
All course tabs should imp... | agpl-3.0 |
Deepakkothandan/ansible | test/legacy/cleanup_gce.py | 83 | 2720 | '''
Find and delete GCE resources matching the provided --match string. Unless
--yes|-y is provided, the prompt for confirmation prior to deleting resources.
Please use caution, you can easily delete your *ENTIRE* GCE infrastructure.
'''
import optparse
import os
import re
import sys
import yaml
try:
from libclo... | gpl-3.0 |
kenshay/ImageScript | ProgramData/SystemFiles/Python/Lib/site-packages/pywinauto/win32functions.py | 2 | 9589 | # GUI Application automation and testing library
# Copyright (C) 2015 Intel Corporation
# Copyright (C) 2010 Mark Mc Mahon
#
# This library 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... | gpl-3.0 |
sureshthalamati/spark | examples/src/main/python/ml/multilayer_perceptron_classification.py | 123 | 2172 | #
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not us... | apache-2.0 |
double-y/django | tests/template_tests/filter_tests/test_iriencode.py | 388 | 1603 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.template.defaultfilters import iriencode, urlencode
from django.test import SimpleTestCase
from django.utils.safestring import mark_safe
from ..utils import setup
class IriencodeTests(SimpleTestCase):
"""
Ensure iriencode keeps safe... | bsd-3-clause |
xy515258/moose | framework/scripts/mooseExamplesLateX/gen_tex.py | 35 | 2444 | #!/usr/bin/env python
import os, re
from subprocess import Popen
moose_examples_dir = "../../../moose_examples"
preamble_file = 'preamble.tex'
line_template = '\\lstinputlisting[style=<STYLE>, caption=<CAPTION>]{<PATH>}\n\clearpage\n\n'
def genPreamble(out_file):
in_file = open(preamble_file, 'r')
out_file.writ... | lgpl-2.1 |
tlevine/be | libbe/command/comment.py | 5 | 7305 | # Copyright (C) 2005-2012 Aaron Bentley <abentley@panoramicfeedback.com>
# Chris Ball <cjb@laptop.org>
# Gianluca Montecchi <gian@grys.it>
# Niall Douglas (s_sourceforge@nedprod.com) <spam@spamtrap.com>
# Robert Lehmann <mai... | gpl-2.0 |
MarkoVogle3/Marko | py/openage/codegen/__main__.py | 46 | 8158 | from ..convert.util import set_verbosity, dbg
import argparse
import os
def main():
"""
this codegen script auto-generates sourcefiles in the cpp/ subtree,
and is designed for usage by the build system
(see buildsystem/codegen.cmake).
invocation synopsis:
python3 -m openage.codegen
... | gpl-3.0 |
vornne/pw_module_system | header_triggers.py | 3 | 11505 | ###################################################
# header_triggers.py
# This file contains declarations for triggers
# DO NOT EDIT THIS FILE!
###################################################
ti_once = 100000000.0
#--------------------------------------------------------... | bsd-3-clause |
jhnnsnk/nest-simulator | pynest/nest/tests/test_regression_issue-1409.py | 19 | 2198 | # -*- coding: utf-8 -*-
#
# test_regression_issue-1409.py
#
# This file is part of NEST.
#
# Copyright (C) 2004 The NEST Initiative
#
# NEST is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 2 of ... | gpl-2.0 |
2014cdbg3/2015cdbg9 | static/Brython3.1.1-20150328-091302/Lib/fractions.py | 722 | 23203 | # Originally contributed by Sjoerd Mullender.
# Significantly modified by Jeffrey Yasskin <jyasskin at gmail.com>.
"""Fraction, infinite-precision, real numbers."""
from decimal import Decimal
import math
import numbers
import operator
import re
import sys
__all__ = ['Fraction', 'gcd']
def gcd(a, b):
"""Calcu... | gpl-3.0 |
PsychoTV/PsychoTeam.repository | plugin.video.specto/resources/lib/libraries/favourites.py | 14 | 3253 | # -*- coding: utf-8 -*-
'''
Specto Add-on
Copyright (C) 2015 lambda
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 option) any l... | gpl-2.0 |
adaussy/eclipse-monkey-revival | plugins/python/org.eclipse.eclipsemonkey.lang.python/Lib/test/test_file_newlines.py | 24 | 9997 | """Test handling of newlines via file's read and readline
Made for Jython.
"""
import os
import sys
import tempfile
import test.test_support as test_support
import unittest
assert not os.linesep == '\r', ('os.linesep of %r is not supported' %
os.linesep)
LF = os.linesep == '\n'
CRLF ... | epl-1.0 |
pombredanne/django-rest-framework-nested-resource | setup.py | 3 | 1608 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
import sys
import drf_nested_resource
try:
from setuptools import setup
except ImportError:
from distutils.core import setup
version = drf_nested_resource.__version__
if sys.argv[-1] == 'publish':
os.system('python setup.py sdist upload')
prin... | bsd-3-clause |
nitin-cherian/LifeLongLearning | Python/PythonProgrammingLanguage/Encapsulation/encap_env/lib/python3.5/site-packages/pip-9.0.1-py3.5.egg/pip/_vendor/ordereddict.py | 1047 | 4094 | # Copyright (c) 2009 Raymond Hettinger
#
# 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, modify, merge,
# publish,... | mit |
azumimuo/family-xbmc-addon | plugin.video.SportsDevil/service/ordereddict.py | 1047 | 4094 | # Copyright (c) 2009 Raymond Hettinger
#
# 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, modify, merge,
# publish,... | gpl-2.0 |
skosukhin/spack | var/spack/repos/builtin/packages/py-colormath/package.py | 1 | 1679 | ##############################################################################
# Copyright (c) 2013-2017, Lawrence Livermore National Security, LLC.
# Produced at the Lawrence Livermore National Laboratory.
#
# This file is part of Spack.
# Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved.
# LLNL-CODE-64... | lgpl-2.1 |
EmreAtes/spack | var/spack/repos/builtin/packages/xcb-demo/package.py | 5 | 1800 | ##############################################################################
# Copyright (c) 2013-2018, Lawrence Livermore National Security, LLC.
# Produced at the Lawrence Livermore National Laboratory.
#
# This file is part of Spack.
# Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved.
# LLNL-CODE-64... | lgpl-2.1 |
sauloal/cnidaria | scripts/venv/lib/python2.7/site-packages/cogent/format/stockholm.py | 1 | 3403 | #!/usr/bin/env python
"""
Writer for Stockholm format.
"""
from cogent.core.alignment import SequenceCollection
from copy import copy
__author__ = "Jeremy Widmann"
__copyright__ = "Copyright 2007-2012, The Cogent Project"
__credits__ = ["Jeremy Widmann"]
__license__ = "GPL"
__version__ = "1.5.3"
__maintainer__ = "Jere... | mit |
edlane/python-debug-harness | launch-perf.py | 1 | 2326 | #!/usr/bin/python
__author__ = 'ed'
import os
import sys
from resource import getrusage as resource_usage, RUSAGE_SELF
from time import time as timestamp
from multiprocessing import Process, Queue, Pipe
def trueit_local():
return True
def trueit_queue(q):
q.put(True)
def trueit_pipe(conn):
conn.send(Tr... | apache-2.0 |
mancoast/CPythonPyc_test | cpython/231_test_new.py | 9 | 2934 | from test.test_support import verbose, verify
import sys
import new
class Eggs:
def get_yolks(self):
return self.yolks
print 'new.module()'
m = new.module('Spam')
if verbose:
print m
m.Eggs = Eggs
sys.modules['Spam'] = m
import Spam
def get_more_yolks(self):
return self.yolks + 3
print 'new.clas... | gpl-3.0 |
gkoelln/youtube-dl | youtube_dl/extractor/uplynk.py | 65 | 2625 | # coding: utf-8
from __future__ import unicode_literals
import re
from .common import InfoExtractor
from ..utils import (
float_or_none,
ExtractorError,
)
class UplynkIE(InfoExtractor):
IE_NAME = 'uplynk'
_VALID_URL = r'https?://.*?\.uplynk\.com/(?P<path>ext/[0-9a-f]{32}/(?P<external_id>[^/?&]+)|(?P... | unlicense |
loveairbear/Kin | kin/scheduling/tz_mgmt.py | 2 | 1088 | from datetime import datetime, timedelta
import pytz
# do edge case of daylight savings transition
# which raise error type pytz.exceptions.AmbiguousTimeError
def utc_to_tz(gmtoffset):
"""
convert utc offset to a timezone in Olson format for use in pytz
gmtoffset - gmtoffset can be an unsigned integer... | mit |
SUSE/azure-sdk-for-python | azure-mgmt-web/azure/mgmt/web/models/network_features.py | 3 | 3148 | # 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 |
vslavik/poedit | deps/boost/libs/python/test/test_pointer_adoption.py | 20 | 1710 | # Copyright David Abrahams 2004. Distributed under the Boost
# Software License, Version 1.0. (See accompanying
# file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
"""
>>> from test_pointer_adoption_ext import *
>>> num_a_instances()
0
>>> a = create('dynamically allocated')
>>> num_a_instances()
... | mit |
kalikaneko/bonafide | src/leap/bonafide/provider.py | 2 | 5990 | # -*- coding: utf-8 -*-
# provier.py
# Copyright (C) 2015 LEAP
#
# 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 option) any later version.
#
# Thi... | gpl-3.0 |
biddisco/VTK | ThirdParty/Twisted/twisted/internet/reactor.py | 63 | 1863 | # Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
"""
The reactor is the Twisted event loop within Twisted, the loop which drives
applications using Twisted. The reactor provides APIs for networking,
threading, dispatching events, and more.
The default reactor depends on the platform and will be... | bsd-3-clause |
p0psicles/SickRage | lib/fanart/__init__.py | 60 | 2956 | __author__ = 'Andrea De Marco <24erre@gmail.com>'
__version__ = '1.4.0'
__classifiers__ = [
'Development Status :: 5 - Production/Stable',
'Intended Audience :: Developers',
'License :: OSI Approved :: Apache Software License',
'Operating System :: OS Independent',
'Programming Language :: Python',
... | gpl-3.0 |
vrenaville/OCB | openerp/addons/base/module/module.py | 29 | 37426 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2013 OpenERP S.A. (<http://openerp.com>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of ... | agpl-3.0 |
sreejithr/emacs.d | pyenv/emacs/lib/python2.7/site-packages/pip/_vendor/distlib/scripts.py | 163 | 11979 | # -*- coding: utf-8 -*-
#
# Copyright (C) 2013 Vinay Sajip.
# Licensed to the Python Software Foundation under a contributor agreement.
# See LICENSE.txt and CONTRIBUTORS.txt.
#
from io import BytesIO
import logging
import os
import re
import struct
import sys
from .compat import sysconfig, fsencode, detect_encoding, ... | mit |
abramhindle/UnnaturalCodeFork | python/testdata/launchpad/cronscripts/daily_product_jobs.py | 1 | 1141 | #!/usr/bin/python -S
#
# Copyright 2012 Canonical Ltd. This software is licensed under the
# GNU Affero General Public License version 3 (see the file LICENSE).
"""Request jobs to update products and send emails."""
__metaclass__ = type
import _pythonpath
import transaction
from lp.registry.model.productjob import... | agpl-3.0 |
suiyuan2009/tensorflow | tensorflow/contrib/learn/python/learn/estimators/run_config.py | 9 | 16198 | # 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 |
amilan/dev-maxiv-pynutaq | src/pynutaq/extra/extra.py | 1 | 12088 | #!/usr/bin/env python
###############################################################################
# Extra methods to be used by the special attributes in pynutaq device
# server.
#
# Copyright (C) 2013 Max IV Laboratory, Lund Sweden
#
# This program is free software: you can redistribute it and/or... | gpl-3.0 |
xiandaicxsj/qemu-copy | roms/u-boot/tools/patman/series.py | 32 | 9358 | # Copyright (c) 2011 The Chromium OS Authors.
#
# SPDX-License-Identifier: GPL-2.0+
#
import itertools
import os
import get_maintainer
import gitutil
import terminal
# Series-xxx tags that we understand
valid_series = ['to', 'cc', 'version', 'changes', 'prefix', 'notes', 'name',
'cover-cc', 'process_... | gpl-2.0 |
eepalms/gem5-newcache | src/arch/x86/isa/insts/general_purpose/compare_and_test/__init__.py | 91 | 2398 | # Copyright (c) 2007 The Hewlett-Packard Development Company
# All rights reserved.
#
# The license below extends only to copyright in the software and shall
# not be construed as granting a license to any other intellectual
# property including but not limited to intellectual property relating
# to a hardware implemen... | bsd-3-clause |
janebeckman/gpdb | src/test/tinc/ext/modgrammar/__init__.py | 21 | 55458 | import sys
import re
import textwrap
import modgrammar.util
__doc__ = """
This module provides a full-featured pure-python framework for building tokenizing LR language parsers and interpreters for context-free grammars. (The :mod:`modgrammar` parsing engine is implemented as a recursive-descent parser with backtrac... | apache-2.0 |
dfaruque/Serenity | Tools/Node/node_modules/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
... | mit |
ar7z1/ansible | lib/ansible/modules/cloud/amazon/redshift_subnet_group.py | 50 | 5877 | #!/usr/bin/python
# Copyright 2014 Jens Carl, Hothead Games Inc.
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.1',
'stat... | gpl-3.0 |
Universal-Model-Converter/UMC3.0a | data/Python/x86/Lib/UserString.py | 312 | 9687 | #!/usr/bin/env python
## vim:ts=4:et:nowrap
"""A user-defined wrapper around string objects
Note: string objects have grown methods in Python 1.6
This module requires Python 1.6 or later.
"""
import sys
import collections
__all__ = ["UserString","MutableString"]
class UserString(collections.Sequence):
def __init... | mit |
fr34k8/atomic-reactor | atomic_reactor/plugins/pre_check_rebuild.py | 1 | 2098 | """
Copyright (c) 2015 Red Hat, Inc
All rights reserved.
This software may be modified and distributed under the terms
of the BSD license. See the LICENSE file for details.
"""
from __future__ import unicode_literals
import json
import os
from atomic_reactor.plugin import PreBuildPlugin
def is_rebuild(workflow):
... | bsd-3-clause |
xkmato/youtube-dl | youtube_dl/extractor/sina.py | 107 | 2755 | # coding: utf-8
from __future__ import unicode_literals
import re
from .common import InfoExtractor
from ..compat import (
compat_urllib_request,
compat_urllib_parse,
)
class SinaIE(InfoExtractor):
_VALID_URL = r'''(?x)https?://(.*?\.)?video\.sina\.com\.cn/
(
... | unlicense |
andyfaff/scipy | doc/source/tutorial/examples/optimize_global_1.py | 12 | 1752 | import numpy as np
import matplotlib.pyplot as plt
from scipy import optimize
def eggholder(x):
return (-(x[1] + 47) * np.sin(np.sqrt(abs(x[0]/2 + (x[1] + 47))))
-x[0] * np.sin(np.sqrt(abs(x[0] - (x[1] + 47)))))
bounds = [(-512, 512), (-512, 512)]
x = np.arange(-512, 513)
y = np.arange(-512, 513)
... | bsd-3-clause |
neuroidss/nupic | external/linux32/lib/python2.6/site-packages/matplotlib/backends/backend_fltkagg.py | 69 | 20839 | """
A backend for FLTK
Copyright: Gregory Lielens, Free Field Technologies SA and
John D. Hunter 2004
This code is released under the matplotlib license
"""
from __future__ import division
import os, sys, math
import fltk as Fltk
from backend_agg import FigureCanvasAgg
import os.path
import matplotli... | agpl-3.0 |
broferek/ansible | lib/ansible/modules/storage/netapp/na_ontap_ldap_client.py | 19 | 13037 | #!/usr/bin/python
'''
(c) 2018-2019, NetApp, Inc
GNU General Public License v3.0+
(see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
'''
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ['preview']... | gpl-3.0 |
3dfxmadscientist/CBSS | addons/google_base_account/google_base_account.py | 53 | 1297 | # -*- 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 |
TalShafir/ansible | lib/ansible/modules/network/cloudengine/ce_bgp.py | 43 | 80680 | #!/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 |
orlov-vo/mtasa | vendor/google-breakpad/src/tools/gyp/pylib/gyp/ninja_syntax.py | 2485 | 5536 | # This file comes from
# https://github.com/martine/ninja/blob/master/misc/ninja_syntax.py
# Do not edit! Edit the upstream one instead.
"""Python module for generating .ninja files.
Note that this is emphatically not a required piece of Ninja; it's
just a helpful utility for build-file-generation systems that alr... | gpl-3.0 |
endlessm/chromium-browser | third_party/catapult/third_party/gsutil/gslib/vendored/boto/tests/integration/logs/test_layer1.py | 114 | 1814 | # Copyright (c) 2014 Amazon.com, Inc. or its affiliates.
# All rights reserved.
#
# 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 right... | bsd-3-clause |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.