repo_name stringlengths 5 100 | ref stringlengths 12 67 | path stringlengths 4 244 | copies stringlengths 1 8 | content stringlengths 0 1.05M ⌀ |
|---|---|---|---|---|
dyn888/youtube-dl | refs/heads/master | youtube_dl/extractor/theonion.py | 126 | # coding: utf-8
from __future__ import unicode_literals
import re
from .common import InfoExtractor
class TheOnionIE(InfoExtractor):
_VALID_URL = r'https?://(?:www\.)?theonion\.com/video/[^,]+,(?P<id>[0-9]+)/?'
_TEST = {
'url': 'http://www.theonion.com/video/man-wearing-mm-jacket-gods-image,36918/',... |
synasius/pinax-notifications | refs/heads/master | pinax/notifications/tests/test_views.py | 5 | from django.core.urlresolvers import reverse
from django.test import TestCase, RequestFactory
from django.contrib.auth import get_user_model
from ..models import NoticeType, NoticeSetting
from ..views import NoticeSettingsView
from . import get_backend_id
class TestViews(TestCase):
def setUp(self):
sel... |
qedi-r/home-assistant | refs/heads/dev | tests/helpers/test_entityfilter.py | 4 | """The tests for the EntityFilter component."""
from homeassistant.helpers.entityfilter import generate_filter, FILTER_SCHEMA
def test_no_filters_case_1():
"""If include and exclude not included, pass everything."""
incl_dom = {}
incl_ent = {}
excl_dom = {}
excl_ent = {}
testfilter = generate_... |
staranjeet/fjord | refs/heads/master | smoketests/tests/generic/test_validation.py | 3 | # 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 pytest
from unittestzero import Assert
from pages.generic_feedback_form import GenericFeedbackFormPage
from test... |
alubbock/pysb | refs/heads/master | pysb/examples/localfunc.py | 5 | # Based on the BioNetGen model 'localfunc.bngl'
# https://github.com/RuleWorld/bionetgen/blob/master/bng2/Models2/localfunc.bngl
#
# This model demonstrates the use of MultiState and local functions in PySB
#
# Requires Python 3.x or greater (will give a SyntaxError on Python 2.7)
from pysb import Model, Monomer, Para... |
etuna-SBF-kog/Stadsparken | refs/heads/master | env/lib/python2.7/site-packages/django/contrib/gis/tests/utils.py | 397 | from django.conf import settings
from django.db import DEFAULT_DB_ALIAS
# function that will pass a test.
def pass_test(*args): return
def no_backend(test_func, backend):
"Use this decorator to disable test on specified backend."
if settings.DATABASES[DEFAULT_DB_ALIAS]['ENGINE'].rsplit('.')[-1] == backend:
... |
windedge/odoo | refs/heads/8.0 | openerp/addons/test_new_api/__init__.py | 2355 | # -*- coding: utf-8 -*-
import models
|
aiguofer/bokeh | refs/heads/master | bokeh/tests/test_themes.py | 13 | from __future__ import absolute_import, print_function
import unittest
import os
import tempfile
from bokeh.document import Document
from bokeh.model import Model
from bokeh.core.property_mixins import FillProps, LineProps, TextProps
from bokeh.core.properties import Int, String
from bokeh.themes import Theme
class... |
CJ-Wright/pyIID | refs/heads/master | pyiid/experiments/shared/kernels/__init__.py | 20 | __author__ = 'christopher'
|
vinay87/flyer | refs/heads/master | flyer/scroll.py | 1 | from kivy.app import App
from kivy.uix.scrollview import ScrollView
from kivy.uix.gridlayout import GridLayout
from kivy.uix.label import Label
class SMApp(App):
def build(self):
layout = GridLayout(cols=1, spacing=10, size_hint_y=None)
#Make sure the height is such that there is something to scro... |
muku42/seaborn | refs/heads/master | examples/structured_heatmap.py | 24 | """
Discovering structure in heatmap data
=====================================
_thumb: .4, .2
"""
import pandas as pd
import seaborn as sns
sns.set(font="monospace")
# Load the brain networks example dataset
df = sns.load_dataset("brain_networks", header=[0, 1, 2], index_col=0)
# Select a subset of the networks
use... |
obi-two/Rebelion | refs/heads/master | data/scripts/templates/object/draft_schematic/clothing/shared_clothing_vest_field_06.py | 2 | #### NOTICE: THIS FILE IS AUTOGENERATED
#### MODIFICATIONS MAY BE LOST IF DONE IMPROPERLY
#### PLEASE SEE THE ONLINE DOCUMENTATION FOR EXAMPLES
from swgpy.object import *
def create(kernel):
result = Intangible()
result.template = "object/draft_schematic/clothing/shared_clothing_vest_field_06.iff"
result.attribu... |
weaselkeeper/ansible | refs/heads/devel | lib/ansible/playbook/base.py | 9 | # (c) 2012-2014, Michael DeHaan <michael.dehaan@gmail.com>
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) an... |
divegeek/keyczar | refs/heads/master | cpp/src/tools/scons/scons-local-1.2.0.d20090223/SCons/compat/builtins.py | 19 | #
# Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 The SCons Foundation
#
# 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 limitati... |
rdhyee/osf.io | refs/heads/develop | scripts/email_registration_contributors.py | 51 | """Script for sending OSF emails to all users who contribute to registrations."""
import datetime
import logging
from modularodm import Q
from website import models
from website.app import init_app
from website.mails import Mail, send_mail
from scripts import utils as script_utils
logger = logging.getLogger(__nam... |
I-sektionen/i-portalen | refs/heads/master | wsgi/iportalen_django/events/migrations/0021_auto_20151103_2336.py | 1 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
from django.conf import settings
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('events', '0020_auto_20151103_2306'),
]
operations = [
migrat... |
bfontaine/web-pp | refs/heads/master | pp/unidecode/x09e.py | 252 | data = (
'Shu ', # 0x00
'Luo ', # 0x01
'Qi ', # 0x02
'Yi ', # 0x03
'Ji ', # 0x04
'Zhe ', # 0x05
'Yu ', # 0x06
'Zhan ', # 0x07
'Ye ', # 0x08
'Yang ', # 0x09
'Pi ', # 0x0a
'Ning ', # 0x0b
'Huo ', # 0x0c
'Mi ', # 0x0d
'Ying ', # 0x0e
'Meng ', # 0x0f
'Di ', # 0x10
'Yue ', ... |
Azulinho/ansible | refs/heads/devel | test/units/parsing/utils/test_jsonify.py | 119 | # -*- coding: utf-8 -*-
# (c) 2016, James Cammarata <jimi@sngx.net>
#
# 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... |
nirmeshk/oh-mainline | refs/heads/master | vendor/packages/kombu/kombu/utils/compat.py | 23 | """
kombu.utils.compat
==================
Helps compatibility with older Python versions.
"""
from __future__ import absolute_import
# ############# timedelta_seconds() -> delta.total_seconds ###################
from datetime import timedelta
HAVE_TIMEDELTA_TOTAL_SECONDS = hasattr(timedelta, 'total_seconds')
if ... |
FatBumbleee/namebench | refs/heads/master | nb_third_party/dns/rdtypes/ANY/__init__.py | 243 | # Copyright (C) 2003-2007, 2009, 2010 Nominum, Inc.
#
# Permission to use, copy, modify, and distribute this software and its
# documentation for any purpose with or without fee is hereby granted,
# provided that the above copyright notice and this permission notice
# appear in all copies.
#
# THE SOFTWARE IS PROVIDED ... |
lmr/autotest | refs/heads/master | server/hosts/monitors/console_patterns_unittest.py | 4 | #!/usr/bin/python
try:
import autotest.common as common
except ImportError:
import common
import cStringIO
import os
import unittest
from autotest.server.hosts.monitors import monitors_util
class _MockWarnFile(object):
def __init__(self):
self.warnings = []
def write(self, data):
if... |
w1ll1am23/home-assistant | refs/heads/dev | homeassistant/components/tplink/__init__.py | 22 | """Component to embed TP-Link smart home devices."""
import logging
import voluptuous as vol
from homeassistant import config_entries
from homeassistant.const import CONF_HOST
import homeassistant.helpers.config_validation as cv
from homeassistant.helpers.typing import ConfigType, HomeAssistantType
from .common impo... |
datapythonista/pandas | refs/heads/master | pandas/tests/arrays/boolean/test_construction.py | 6 | import numpy as np
import pytest
import pandas as pd
import pandas._testing as tm
from pandas.arrays import BooleanArray
from pandas.core.arrays.boolean import coerce_to_array
def test_boolean_array_constructor():
values = np.array([True, False, True, False], dtype="bool")
mask = np.array([False, False, Fals... |
yuanming-hu/taichi | refs/heads/master | setup.py | 1 | import glob
import setuptools
classifiers = [
'Development Status :: 2 - Pre-Alpha',
'Topic :: Software Development :: Compilers',
'Topic :: Multimedia :: Graphics',
'Topic :: Games/Entertainment :: Simulation',
'Intended Audience :: Science/Research',
'Intended Audience :: Developers',
'L... |
sbaogang/teletraan | refs/heads/master | deploy-board/deploy_board/webapp/helpers/specs_helper.py | 8 | # Copyright 2016 Pinterest, 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 or agreed to in writi... |
amitu/zums | refs/heads/master | ROOT/zums/django_backends/auth.py | 1 | from django.contrib.auth.models import User
from zums.zumsd import query
try:
import json
except ImportError:
from django.utils import simplejson as json
class ZUMSBackend:
supports_object_permissions = False
supports_anonymous_user = False
supports_inactive_user = False
def update_user_if_req... |
jeremiedecock/snippets | refs/heads/master | python/matplotlib/contours/label_on_contours.py | 1 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
# Copyright (c) 2015 Jérémie DECOCK (http://www.jdhp.org)
# See http://matplotlib.org/api/axes_api.html?highlight=contour#matplotlib.axes.Axes.contour
import math
import numpy as np
import matplotlib
import matplotlib.cm as cm
import matplotlib.mlab as mlab
import matp... |
hellsgate1001/bookit | refs/heads/master | docs/env/Lib/site-packages/django/contrib/staticfiles/views.py | 105 | """
Views and functions for serving static files. These are only to be used during
development, and SHOULD NOT be used in a production setting.
"""
import os
import posixpath
from django.conf import settings
from django.core.exceptions import ImproperlyConfigured
from django.http import Http404
from django.utils.six.... |
lorin/umdinst | refs/heads/master | test/testinstall.py | 1 | import unittest
class TestInstall(unittest.TestCase):
def setUp(self):
pass
def tearDown(self):
pass
def testNoModeOption(self):
import os
assert os.system('python setup.py install --id=ABC > /dev/null') <> 0
def testModeIndividual(self):
import os
assert... |
andrewyoung1991/scons | refs/heads/master | test/Copy-Symlinks.py | 2 | #!/usr/bin/env python
#
# __COPYRIGHT__
#
# 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,
... |
damdam-s/sale-workflow | refs/heads/8.0 | __unported__/account_invoice_reorder_lines/__openerp__.py | 21 | # -*- coding: utf-8 -*-
#
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>).
# Copyright (C) 2013-2014 Camptocamp (<http://www.camptocamp.com>)
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero... |
imsparsh/python-for-android | refs/heads/master | python3-alpha/python3-src/Tools/i18n/pygettext.py | 46 | #! /usr/bin/env python3
# -*- coding: iso-8859-1 -*-
# Originally written by Barry Warsaw <barry@zope.com>
#
# Minimally patched to make it even more xgettext compatible
# by Peter Funk <pf@artcom-gmbh.de>
#
# 2002-11-22 Jürgen Hermann <jh@web.de>
# Added checks that _() only contains string literals, and
# command lin... |
jjs0sbw/CSPLN | refs/heads/master | apps/scaffolding/linux/web2py/gluon/contrib/minify/minify.py | 43 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
High-level CSS and JS minification class for web2py.
Called by response.include_files()
Created by: Ross Peoples <ross.peoples@gmail.com>
Modified by: Massimo Di Pierro <massimo.dipierro@gmail.com>
"""
import cssmin
import jsmin
import os
import hashlib
import re
de... |
repotvsupertuga/repo | refs/heads/master | script.module.stream.tvsupertuga.addon/resources/lib/sources/en/afdah.py | 7 | # -*- coding: utf-8 -*-
'''
Exodus Add-on
Copyright (C) 2016 Exodus
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... |
thaim/ansible | refs/heads/fix-broken-link | test/units/modules/network/f5/test_bigip_firewall_dos_profile.py | 22 | # -*- coding: utf-8 -*-
#
# Copyright: (c) 2018, F5 Networks 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
import os
import json
import pytest
import sys
if sys.version_info < (2... |
mrshu/scikit-learn | refs/heads/master | sklearn/linear_model/tests/test_coordinate_descent.py | 2 | # Authors: Olivier Grisel <olivier.grisel@ensta.org>
# Alexandre Gramfort <alexandre.gramfort@inria.fr>
# License: BSD Style.
import warnings
from sys import version_info
import numpy as np
from scipy import interpolate
from sklearn.utils.testing import assert_array_almost_equal
from sklearn.utils.testing i... |
FlintHill/SUAS-Competition | refs/heads/master | env/lib/python3.7/site-packages/pip/_internal/utils/compat.py | 7 | """Stuff that differs in different Python versions and platform
distributions."""
from __future__ import absolute_import, division
import codecs
import locale
import logging
import os
import shutil
import sys
from pip._vendor.six import text_type
try:
import ipaddress
except ImportError:
try:
from pi... |
StephenWeber/ansible | refs/heads/devel | lib/ansible/plugins/strategy/linear.py | 29 | # (c) 2012-2014, Michael DeHaan <michael.dehaan@gmail.com>
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) an... |
tmpgit/intellij-community | refs/heads/master | python/lib/Lib/site-packages/django/utils/cache.py | 71 | """
This module contains helper functions for controlling caching. It does so by
managing the "Vary" header of responses. It includes functions to patch the
header of response objects directly and decorators that change functions to do
that header-patching themselves.
For information on the Vary header, see:
http... |
TheTypoMaster/chromium-crosswalk | refs/heads/master | tools/telemetry/telemetry/core/platform/android_device.py | 4 | # 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 logging
import os
import re
import subprocess
from telemetry.core.platform import device
from telemetry.core.platform.profiler import monsoon
from tel... |
bdh1011/wau | refs/heads/master | venv/lib/python2.7/site-packages/celery/worker/__init__.py | 6 | # -*- coding: utf-8 -*-
"""
celery.worker
~~~~~~~~~~~~~
:class:`WorkController` can be used to instantiate in-process workers.
The worker consists of several components, all managed by bootsteps
(mod:`celery.bootsteps`).
"""
from __future__ import absolute_import
import os
import sys
import trac... |
ergodicbreak/evennia | refs/heads/master | evennia/typeclasses/migrations/0002_auto_20150109_0913.py | 12 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('typeclasses', '0001_initial'),
]
operations = [
migrations.AlterField(
model_name='attribute',
name=... |
antaril/AGK_for_DU | refs/heads/DU-master | tools/perf/scripts/python/syscall-counts.py | 11181 | # 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... |
sogis/Quantum-GIS | refs/heads/master | python/ext-libs/pygments/lexers/_openedgebuiltins.py | 370 | # -*- coding: utf-8 -*-
"""
pygments.lexers._openedgebuiltins
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Builtin list for the OpenEdgeLexer.
:copyright: Copyright 2006-2013 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
OPENEDGEKEYWORDS = [
'ABSOLUTE', 'ABS', 'ABSO', 'A... |
lz1988/django-web | refs/heads/master | build/lib/django/contrib/localflavor/se/se_counties.py | 110 | # -*- coding: utf-8 -*-
"""
An alphabetical list of Swedish counties, sorted by codes.
http://en.wikipedia.org/wiki/Counties_of_Sweden
This exists in this standalone file so that it's only imported into memory
when explicitly needed.
"""
from __future__ import unicode_literals
from django.utils.translation import u... |
mitodl/odl-video-service | refs/heads/master | odl_video/logging.py | 1 | """Configure structured logging for our application"""
import logging
from structlog_sentry import SentryJsonProcessor
import structlog
from odl_video import settings
logging.basicConfig(level=getattr(logging, settings.LOG_LEVEL), format="%(message)s")
structlog_processors_per_debug = {
True: [
structlog.... |
atosorigin/ansible | refs/heads/devel | lib/ansible/cli/__init__.py | 10 | # Copyright: (c) 2012-2014, Michael DeHaan <michael.dehaan@gmail.com>
# Copyright: (c) 2016, Toshio Kuratomi <tkuratomi@ansible.com>
# Copyright: (c) 2018, Ansible Project
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
# Make coding more python3-ish
from __future__ import ... |
shsingh/ansible | refs/heads/devel | test/units/modules/network/fortios/test_fortios_system_admin.py | 21 | # Copyright 2019 Fortinet, 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 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the... |
kenshay/ImageScript | refs/heads/master | ProgramData/SystemFiles/Python/Lib/site-packages/scipy/linalg/__init__.py | 7 | """
====================================
Linear algebra (:mod:`scipy.linalg`)
====================================
.. currentmodule:: scipy.linalg
Linear algebra functions.
.. seealso::
`numpy.linalg` for more linear algebra functions. Note that
although `scipy.linalg` imports most of them, identically named... |
kdebrab/pandas | refs/heads/master | pandas/tests/indexes/datetimes/test_construction.py | 2 | from datetime import timedelta
from operator import attrgetter
from functools import partial
import pytest
import pytz
import numpy as np
import pandas as pd
from pandas import offsets
import pandas.util.testing as tm
from pandas._libs.tslib import OutOfBoundsDatetime
from pandas._libs.tslibs import conversion
from p... |
saebrahimi/Emotion-Recognition-RNN | refs/heads/master | Audio/data_loader.py | 2 | import arff
import os
import numpy
from pca import whiten,pca
from sklearn import svm, grid_search
from conf_mat_plot import getConfusionMatrixPlot
def preprocess(data, mean0=None, std0=None):
if mean0 is None:
mean0 = data.mean(0).reshape(1,-1)
if std0 is None:
std0 = data.std(0).reshape(1,-... |
GabrielCasarin/Allegri | refs/heads/master | comum/compilador/tabela_simbolos.py | 1 | # Copyright (c) 2016 Gabriel Casarin da Silva, All Rights Reserved.
class Simbolo:
def __init__(self, nome, especie, tipo):
self.nome = nome
self.tipo = tipo
self.especie = especie
self.posicao = None
self.referenciado = False
self.utilizado = False
def __repr__(self):
return self.nome
class Simbolo... |
hasteur/g13bot_tools_new | refs/heads/master | tests/checkimages_tests.py | 6 | #!/usr/bin/python
# -*- coding: utf-8 -*-
"""Unit tests for checkimages script."""
#
# (C) Pywikibot team, 2015-2016
#
# Distributed under the terms of the MIT license.
#
from __future__ import absolute_import, unicode_literals
from scripts import checkimages
from tests.aspects import unittest, TestCase
class TestS... |
ntt-sic/taskflow | refs/heads/master | taskflow/examples/simple_linear.py | 1 | # -*- coding: utf-8 -*-
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright (C) 2012-2013 Yahoo! 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
#
... |
MathYourLife/TSatPy-thesis | refs/heads/master | sandbox/plotting/tkinter3.py | 1 | from twisted.internet import tksupport, reactor
import matplotlib
from matplotlib.figure import Figure
import numpy as np
from matplotlib.backends.backend_tkagg import FigureCanvasTkAgg, NavigationToolbar2TkAgg
from twisted.internet.task import LoopingCall
import matplotlib.pyplot as plt
def testing():
print("here... |
peterjoel/servo | refs/heads/master | tests/wpt/web-platform-tests/tools/third_party/funcsigs/funcsigs/version.py | 65 | __version__ = "0.4"
|
tectronics/mythbox | refs/heads/master | resources/lib/twisted/twisted/manhole/gladereactor.py | 62 | # Copyright (c) 2001-2004 Twisted Matrix Laboratories.
# See LICENSE for details.
"""
A modified gtk2 reactor with a Glade dialog in-process that allows you to stop,
suspend, resume and inspect transports interactively.
"""
__all__ = ['install']
# Twisted Imports
from twisted.python import log, threadable, runtime,... |
Geovanny0401/bookStore | refs/heads/master | bookstore-front/node_modules/node-gyp/gyp/pylib/gyp/generator/make.py | 896 | # Copyright (c) 2013 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 is all roughly based on the Makefile system used by the Linux
# kernel, but is a non-recursive make -- we put the entire dependency
# graph in fr... |
jimmyshen/mongoengine | refs/heads/master | mongoengine/context_managers.py | 34 | from mongoengine.common import _import_class
from mongoengine.connection import DEFAULT_CONNECTION_NAME, get_db
__all__ = ("switch_db", "switch_collection", "no_dereference",
"no_sub_classes", "query_counter")
class switch_db(object):
""" switch_db alias context manager.
Example ::
# Re... |
glneo/gnuradio | refs/heads/master | grc/gui/Messages.py | 18 | """
Copyright 2007 Free Software Foundation, Inc.
This file is part of GNU Radio
GNU Radio Companion 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 ... |
stephanerobert/fake-switches | refs/heads/master | fake_switches/brocade/command_processor/config_vrf.py | 4 | # Copyright 2015 Internap.
#
# 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, so... |
tongwang01/tensorflow | refs/heads/master | tensorflow/python/ops/clip_ops.py | 17 | # 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... |
rkmaddox/mne-python | refs/heads/master | mne/gui/_marker_gui.py | 14 | """Mayavi/traits GUI for averaging two sets of KIT marker points."""
# Authors: Christian Brodbeck <christianbrodbeck@nyu.edu>
#
# License: BSD (3-clause)
import os
import sys
import numpy as np
from mayavi.tools.mlab_scene_model import MlabSceneModel
from pyface.api import confirm, error, FileDialog, OK, YES
from ... |
knuu/competitive-programming | refs/heads/master | yukicoder/yuki170.py | 1 | S = input()
dic = {}
for s in S: dic[s] = dic.get(s, 0) + 1
ans = 1
for i in range(len(S)): ans *= i+1
for k in dic.keys():
for i in range(dic[k]):
ans //= i+1
print(ans-1)
|
jbruestle/aggregate_btree | refs/heads/master | python/stat_tree/StatsTree.py | 1 |
import abtree
def StatExpand(num):
return [1, num, num, num, num*num];
def StatAggregate(s1, s2):
if s1 == None:
return s2
if s2 == None:
return s1
if isinstance(s1, (int, long, float)):
s1 = StatExpand(s1)
if isinstance(s2, (int, long, float)):
s2 = StatExpand(s2)
return [s1[0] + s2[0], # Add counts
... |
ludwiktrammer/odoo | refs/heads/9.0 | addons/base_gengo/ir_translation.py | 46 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from openerp import api
from openerp.osv import fields, osv
from openerp.exceptions import UserError
LANG_CODE_MAPPING = {
'ar_SY': ('ar', 'Arabic'),
'id_ID': ('id', 'Indonesian'),
'nl_NL': ('nl', 'Dutch'),
... |
jemmyw/ansible | refs/heads/devel | lib/ansible/plugins/lookup/csvfile.py | 21 | # (c) 2013, Jan-Piet Mens <jpmens(at)gmail.com>
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later ver... |
a2sheppy/kuma | refs/heads/master | kuma/users/providers/github/urls.py | 37 | from allauth.socialaccount.providers.oauth2.urls import default_urlpatterns
from .provider import KumaGitHubProvider
urlpatterns = default_urlpatterns(KumaGitHubProvider)
|
Captain-Coder/tribler | refs/heads/devel | Tribler/Core/DecentralizedTracking/dht_provider.py | 1 | import logging
from Tribler.Core.DecentralizedTracking.pymdht.core.identifier import Id
class MainlineDHTProvider(object):
"""
This class is a wrapper around the mainline DHT and is used for the hidden services as DHT provider.
"""
def __init__(self, mainline_dht, bt_port):
self.mainline_dht... |
vikingMei/mxnet | refs/heads/master | python/mxnet/_cy2/__init__.py | 50 | # 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... |
signed/intellij-community | refs/heads/master | python/testData/inspections/PyUnresolvedReferencesInspection/unusedUnresolvedModuleImported.py | 68 | <warning descr="Unused import statement">import <error descr="No module named spam">spam</error></warning>
|
slevenhagen/odoo-npg | refs/heads/8.0 | addons/auth_openid/__openerp__.py | 313 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2010-2012 OpenERP s.a. (<http://openerp.com>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of ... |
dwillis/dayspring | refs/heads/master | dayspring/settings.py | 1 | # Django settings for dayspring project.
import os
PROJECT_PATH = os.path.realpath(os.path.dirname(__file__))
DEBUG = True
TEMPLATE_DEBUG = DEBUG
ADMINS = (
# ('Your Name', 'your_email@example.com'),
)
MANAGERS = ADMINS
# Hosts/domain names that are valid for this site; required if DEBUG is False
# See https:/... |
garnertb/rogue_geonode | refs/heads/response-capability-form | geoshape/core/tests/__init__.py | 2 | from django.contrib.auth.models import User
from django.core.urlresolvers import reverse
from django.test import Client, TestCase
from geoshape.core.context_processors import security_warnings
from lxml import etree
import logging
logger = logging.getLogger(__name__)
class ROGUETests(TestCase):
def setUp(self):... |
unreal666/outwiker | refs/heads/master | plugins/source/source/pygments/lexers/x10.py | 31 | # -*- coding: utf-8 -*-
"""
pygments.lexers.x10
~~~~~~~~~~~~~~~~~~~
Lexers for the X10 programming language.
:copyright: Copyright 2006-2017 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
import re
from pygments.lexer import RegexLexer
from pygments.token import T... |
chugunovyar/factoryForBuild | refs/heads/master | env/lib/python2.7/site-packages/tornado/stack_context.py | 248 | #!/usr/bin/env python
#
# Copyright 2010 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... |
almeidapaulopt/erpnext | refs/heads/develop | erpnext/patches/v8_1/allow_invoice_copy_to_edit_after_submit.py | 27 | import frappe
def execute():
inv_copy_options = "ORIGINAL FOR RECIPIENT\nDUPLICATE FOR TRANSPORTER\nDUPLICATE FOR SUPPLIER\nTRIPLICATE FOR SUPPLIER"
frappe.db.sql("""update `tabCustom Field` set allow_on_submit=1, options=%s
where fieldname='invoice_copy' and dt = 'Sales Invoice'
""", inv_copy_options)
frapp... |
alazaro/tennis_tournament | refs/heads/master | django/contrib/markup/templatetags/markup.py | 289 | """
Set of "markup" template filters for Django. These filters transform plain text
markup syntaxes to HTML; currently there is support for:
* Textile, which requires the PyTextile library available at
http://loopcore.com/python-textile/
* Markdown, which requires the Python-markdown library from
... |
tarikkdiry/Flock | refs/heads/master | flask/lib/python2.7/site-packages/whoosh/compat.py | 22 | import array, sys
# Run time aliasing of Python2/3 differences
def htmlescape(s, quote=True):
# this is html.escape reimplemented with cgi.escape,
# so it works for python 2.x, 3.0 and 3.1
import cgi
s = cgi.escape(s, quote)
if quote:
# python 3.2 also replaces the single quotes:
... |
vishnu-kumar/PeformanceFramework | refs/heads/master | rally_os/common/objects/__init__.py | 11 | # Copyright 2013: Mirantis 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 b... |
kwailamchan/programming-languages | refs/heads/master | javascript/backbone/backbone-templates/backbone-fileupload/venvs/lib/python2.7/site-packages/django/contrib/localflavor/si/si_postalcodes.py | 89 | # *-* coding: utf-8 *-*
SI_POSTALCODES = [
(1000, u'Ljubljana'),
(1215, u'Medvode'),
(1216, u'Smlednik'),
(1217, u'Vodice'),
(1218, u'Komenda'),
(1219, u'Laze v Tuhinju'),
(1221, u'Motnik'),
(1222, u'Trojane'),
(1223, u'Blagovica'),
(1225, u'Lukovica'),
(1230, u'Dom\u017eale... |
tuomassiren/proofofexistence | refs/heads/master | babel/messages/mofile.py | 64 | # -*- coding: utf-8 -*-
"""
babel.messages.mofile
~~~~~~~~~~~~~~~~~~~~~
Writing of files in the ``gettext`` MO (machine object) format.
:copyright: (c) 2013 by the Babel Team.
:license: BSD, see LICENSE for more details.
"""
import array
import struct
from babel.messages.catalog import Catalog, ... |
brouberol/celery-once | refs/heads/master | tests/__init__.py | 14224 | # -*- coding: utf-8 -*-
|
blampe/M2M | refs/heads/master | basic/places/admin.py | 3 | from django.contrib import admin
from basic.places.models import *
class PlaceTypeAdmin(admin.ModelAdmin):
prepopulated_fields = {'slug': ('title',)}
admin.site.register(PlaceType, PlaceTypeAdmin)
class CityAdmin(admin.ModelAdmin):
prepopulated_fields = {'slug': ('city', 'state')}
admin.site.register(City... |
warner/petmail | refs/heads/master | versioneer.py | 386 |
# Version: 0.18
"""The Versioneer - like a rocketeer, but for versions.
The Versioneer
==============
* like a rocketeer, but for versions!
* https://github.com/warner/python-versioneer
* Brian Warner
* License: Public Domain
* Compatible With: python2.6, 2.7, 3.2, 3.3, 3.4, 3.5, 3.6, and pypy
* [![Latest Version]
... |
srinivasanmit/all-in-all | refs/heads/master | 1/ex8.py | 1 | formatter = "%r %r %r %r"
print formatter % (1, 2, 3, 4)
print formatter % ("one", "two", "three", "four")
print formatter % (True, False, False, True)
print formatter % (formatter, formatter, formatter, formatter)
print formatter % (
"I had this thing.",
"That you could type up right.",
"But it din't sin... |
ParthGanatra/mitmproxy | refs/heads/master | test/netlib/test_encoding.py | 6 | from netlib import encoding
def test_identity():
assert b"string" == encoding.decode("identity", b"string")
assert b"string" == encoding.encode("identity", b"string")
assert not encoding.encode("nonexistent", b"string")
assert not encoding.decode("nonexistent encoding", b"string")
def test_gzip():
... |
Rootbuzz/pingpong | refs/heads/master | pingpong/email.py | 1 | from django.conf import settings
from django.core.mail import send_mail
from django.template.loader import render_to_string
def render_to_email(template, cx, recipients, send_from=None, **kwargs):
if send_from is None:
send_from = settings.DEFAULT_FROM_EMAIL
# it probably do what you expect if re... |
bunnyitvn/webptn | refs/heads/master | build/lib.linux-i686-2.7/django/views/static.py | 101 | """
Views and functions for serving static files. These are only to be used
during development, and SHOULD NOT be used in a production setting.
"""
from __future__ import unicode_literals
import mimetypes
import os
import stat
import posixpath
import re
try:
from urllib.parse import unquote
except ImportError: ... |
JohnFrazier/pacman | refs/heads/master | test/pacman/tests/sync012.py | 13 | self.description = "Install packages from a sync db with circular dependencies"
sp1 = pmpkg("pkg1")
sp1.depends = ["pkg2"]
sp2 = pmpkg("pkg2")
sp2.depends = ["pkg3"]
sp3 = pmpkg("pkg3")
sp3.depends = ["pkg1"]
for p in sp1, sp2, sp3:
self.addpkg2db("sync", p);
self.args = "-S %s" % sp1.name
self.addrule("PACMAN_R... |
Lab603/PicEncyclopedias | refs/heads/master | jni-build/jni-build/jni/include/tensorflow/contrib/quantization/load_quantized_ops_so.py | 16 | # 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... |
inspirehep/inspire-next | refs/heads/master | tests/integration/helpers/factories/db/inspire_migrator.py | 1 | # -*- coding: utf-8 -*-
#
# This file is part of INSPIRE.
# Copyright (C) 2014-2018 CERN.
#
# INSPIRE 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 ... |
Reality9/spiderfoot | refs/heads/master | ext/stem/util/ordereddict.py | 30 | # Drop in replacement for python 2.7's OrderedDict, from...
# http://pypi.python.org/pypi/ordereddict
#
# Stem users should *not* rely upon this module. It will be removed when we
# drop support for python 2.6 and below.
# Copyright (c) 2009 Raymond Hettinger
#
# Permission is hereby granted, free of charge, to any pe... |
chuan9/chromium-crosswalk | refs/heads/master | components/policy/tools/generate_policy_source.py | 9 | #!/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.
'''python %prog [options] platform chromium_os_flag template
platform specifies which platform source is being generated for
and... |
suky/android_kernel_pantech_ef65l | refs/heads/a820l_3.4 | Documentation/networking/cxacru-cf.py | 14668 | #!/usr/bin/env python
# Copyright 2009 Simon Arlott
#
# 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 i... |
cloudbau/nova | refs/heads/master | nova/virt/libvirt/firewall.py | 4 | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2010 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# All Rights Reserved.
# Copyright (c) 2010 Citrix Systems, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you m... |
gautamMalu/rootfs_xen_arndale | refs/heads/master | usr/lib/python3.4/_osx_support.py | 86 | """Shared OS X support functions."""
import os
import re
import sys
__all__ = [
'compiler_fixup',
'customize_config_vars',
'customize_compiler',
'get_platform_osx',
]
# configuration variables that may contain universal build flags,
# like "-arch" or "-isdkroot", that may need customization for
# the... |
TheTacoScott/GoAtThrottleUp | refs/heads/master | ServerRelay/cherrypy/tutorial/tut01_helloworld.py | 58 | """
Tutorial - Hello World
The most basic (working) CherryPy application possible.
"""
# Import CherryPy global namespace
import cherrypy
class HelloWorld:
""" Sample request handler class. """
def index(self):
# CherryPy will call this method for the root URI ("/") and send
# its return val... |
fedspendingtransparency/data-act-broker-backend | refs/heads/development | dataactcore/migrations/versions/d3c10a9f589a_create_states_table.py | 1 | """Create States table
Revision ID: d3c10a9f589a
Revises: ff7c3328a4b1
Create Date: 2017-07-20 13:25:58.071561
"""
# revision identifiers, used by Alembic.
revision = 'd3c10a9f589a'
down_revision = 'ff7c3328a4b1'
branch_labels = None
depends_on = None
from alembic import op
import sqlalchemy as sa
def upgrade(eng... |
enthought/etsproxy | refs/heads/master | enthought/endo/util.py | 1 | # proxy module
from __future__ import absolute_import
from etsdevtools.endo.util import *
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.