repo_name stringlengths 5 100 | ref stringlengths 12 67 | path stringlengths 4 244 | copies stringlengths 1 8 | content stringlengths 0 1.05M ⌀ |
|---|---|---|---|---|
stuntman723/rap-analyzer | refs/heads/master | rap_analyzer/lib/python2.7/site-packages/django/contrib/admin/validation.py | 82 | from django.contrib.admin.utils import NotRelationField, get_fields_from_path
from django.core.exceptions import FieldDoesNotExist, ImproperlyConfigured
from django.db import models
from django.forms.models import (
BaseModelForm, BaseModelFormSet, _get_foreign_key,
)
"""
Does basic ModelAdmin option validation. C... |
angdraug/nova | refs/heads/master | nova/pci/pci_whitelist.py | 8 | # Copyright (c) 2013 Intel, Inc.
# Copyright (c) 2013 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/li... |
ximenesuk/openmicroscopy | refs/heads/develop | components/tools/OmeroPy/test/integration/test_permissions.py | 4 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Tests of the permissions
Copyright 2008-2013 Glencoe Software, Inc. All rights reserved.
Use is subject to license terms supplied in LICENSE.txt
"""
import pytest
import test.integration.library as lib
import omero
from omero_model_PermissionsI import Permi... |
marcydoty/geraldo | refs/heads/master | site/newsite/django_1_0/tests/regressiontests/utils/views.py | 19 | from django.http import HttpResponse
from django.utils.decorators import decorator_from_middleware
from django.middleware.doc import XViewMiddleware
xview_dec = decorator_from_middleware(XViewMiddleware)
def xview(request):
return HttpResponse()
xview = xview_dec(xview)
|
timlinux/watchkeeper | refs/heads/develop | django_project/sms/migrations/0001_initial.py | 5 | # encoding: utf-8
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding model 'Gateway'
db.create_table('sms_gateway', (
('id', self.gf('django.db.models.fie... |
bennlich/scikit-image | refs/heads/master | skimage/novice/tests/test_novice.py | 5 | import os
import tempfile
import numpy as np
from numpy.testing import assert_equal, raises, assert_allclose
from skimage import novice
from skimage.novice._novice import (array_to_xy_origin, xy_to_array_origin,
rgb_transpose)
from skimage import data_dir
from skimage._shared.utils ... |
bhgv/bCNC | refs/heads/master | GCode_parser/Parser_engine/py/tools/pycoco/DriverGen.py | 1 | #-------------------------------------------------------------------------
#ParserGen.py -- Main compiler file generation routines.
#Compiler Generator Coco/R,
#Copyright (c) 1990, 2004 Hanspeter Moessenboeck, University of Linz
#extended by M. Loeberbauer & A. Woess, Univ. of Linz
#ported from Java to Python by Ronald... |
dresiu/wagtail | refs/heads/master | wagtail/wagtailsearch/urls/admin.py | 22 | from django.conf.urls import url
from wagtail.wagtailsearch.views import editorspicks, queries
urlpatterns = [
url(r"^editorspicks/$", editorspicks.index, name="wagtailsearch_editorspicks_index"),
url(r"^editorspicks/add/$", editorspicks.add, name="wagtailsearch_editorspicks_add"),
url(r"^editorspicks/(\d... |
cvegaj/ElectriCERT | refs/heads/master | venv3/lib/python3.6/site-packages/pbr/tests/test_version.py | 85 | # Copyright 2012 Red Hat, Inc.
# Copyright 2012-2013 Hewlett-Packard Development Company, L.P.
#
# 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/licen... |
FireWRT/OpenWrt-Firefly-Libraries | refs/heads/master | staging_dir/target-mipsel_1004kc+dsp_uClibc-0.9.33.2/usr/lib/python2.7/lib2to3/fixes/fix_raise.py | 327 | """Fixer for 'raise E, V, T'
raise -> raise
raise E -> raise E
raise E, V -> raise E(V)
raise E, V, T -> raise E(V).with_traceback(T)
raise E, None, T -> raise E.with_traceback(T)
raise (((E, E'), E''), E'''), V -> raise E(V)
raise "foo", V, T -> warns about string exceptions
CAVEATS:... |
peoplepower/botengine | refs/heads/master | com.ppc.Lesson2-LiveUpdates/domain.py | 30 | '''
Created on May 25, 2017
This file is subject to the terms and conditions defined in the
file 'LICENSE.txt', which is part of this source code package.
@author: David Moss
'''
# This file helps with branding and customization of a single bot service.
# Organization short name, which allows us to send emails to ... |
lcy-seso/models | refs/heads/develop | youtube_recall/reader.py | 4 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import sys
from utils import logger
from utils import TaskMode
class Reader(object):
"""
Reader
"""
def __init__(self, feature_dict=None, window_size=20):
"""
init
@window_size: window_size
"""
self._feature_dict =... |
quanvm009/codev7 | refs/heads/master | openerp/addons_quan/lifestyle/wizard/__init__.py | 1 | # -*- encoding: utf-8 -*-
import create_po_wizard
import create_out_material_pre_wizard
import create_out_material_wizard
import create_in_finished_wizard
import stock_invoice_onshipping
import wizard_pl_report
import wizard_print_order_tracking
import wizard_order_report
import section_wizard_report
import wizard_ord... |
rastersoft/multipackager | refs/heads/master | src/multipackager.py | 1 | #!/usr/bin/env python3
# Copyright 2015 (C) Raster Software Vigo (Sergio Costas)
#
# This file is part of Multipackager
#
# Multipackager 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 th... |
PearsonIOKI/compose-forum | refs/heads/master | askbot/utils/slug.py | 13 | """defines the method for building slugs
slugification may be disabled with a live setting "USE_ASCII_ONLY_SLUGS"
the setting was added just in case - if people actually
want to see unicode characters in the slug. If this is the choice
slug will be simply equal to the input text
"""
import re
import unicodedata
from u... |
lmazuel/azure-sdk-for-python | refs/heads/master | azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/flow_log_status_parameters_py3.py | 9 | # 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 ... |
gavinfish/leetcode-share | refs/heads/master | python/124 Binary Tree Maximum Path Sum.py | 1 | '''
Given a binary tree, find the maximum path sum.
For this problem, a path is defined as any sequence of nodes from some starting node to any node in the tree along the parent-child connections. The path does not need to go through the root.
For example:
Given the below binary tree,
1
/ \
... |
skirpichev/omg | refs/heads/master | diofant/solvers/utils.py | 1 | """General utility functions for solvers."""
import warnings
from ..core import (expand_mul, expand_multinomial, nan, oo,
preorder_traversal, sympify, zoo)
from ..simplify import posify, simplify
__all__ = 'checksol',
def checksol(f, sol, **flags):
r"""Checks whether sol is a solution of e... |
orion1024/Sick-Beard | refs/heads/master | lib/guessit/language.py | 41 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# GuessIt - A library for guessing information from filenames
# Copyright (c) 2011 Nicolas Wack <wackou@gmail.com>
#
# GuessIt is free software; you can redistribute it and/or modify it under
# the terms of the Lesser GNU General Public License as published by
# the Free ... |
temasek/android_external_chromium_org | refs/heads/cm-11.0 | tools/valgrind/suppressions.py | 61 | #!/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.
# suppressions.py
"""Post-process Valgrind suppression matcher.
Suppressions are defined as follows:
# optional one-line comment... |
rovner/selenium | refs/heads/master | py/test/selenium/webdriver/common/window_tests.py | 65 | # Licensed to the Software Freedom Conservancy (SFC) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The SFC licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not... |
blole/Marlin | refs/heads/standard_tarantula | buildroot/share/atom/auto_build.py | 3 | #######################################
#
# Marlin 3D Printer Firmware
# Copyright (C) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
#
# Based on Sprinter and grbl.
# Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm
#
# This program is free software: you can redistribute it and/or modify
# it unde... |
Chilledheart/chromium | refs/heads/master | sync/tools/testserver/chromiumsync_test.py | 154 | #!/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.
"""Tests exercising chromiumsync and SyncDataModel."""
import pickle
import unittest
import autofill_specifics_pb2
import bookmark_sp... |
makinacorpus/django | refs/heads/master | django/forms/__init__.py | 117 | """
Django validation and HTML form handling.
"""
from __future__ import absolute_import
from django.core.exceptions import ValidationError
from django.forms.fields import *
from django.forms.forms import *
from django.forms.models import *
from django.forms.widgets import *
|
nagyistoce/edx-platform | refs/heads/master | cms/djangoapps/contentstore/tests/test_course_settings.py | 14 | """
Tests for Studio Course Settings.
"""
import datetime
import json
import copy
import mock
from mock import patch
import unittest
from django.utils.timezone import UTC
from django.test.utils import override_settings
from django.conf import settings
from models.settings.course_details import (CourseDetails, CourseS... |
huang4fstudio/django | refs/heads/master | django/conf/locale/eo/formats.py | 504 | # -*- 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 = r'j\-\a \d\e F Y' # '26-a ... |
eefriedman/servo | refs/heads/master | tests/wpt/web-platform-tests/tools/pywebsocket/src/test/testdata/handlers/abort_by_user_wsh.py | 496 | # Copyright 2011, 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 of conditions and the f... |
asurve/incubator-systemml | refs/heads/master | src/main/python/post_setup.py | 14 | #-------------------------------------------------------------
#
# 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... |
sucitw/benchmark-python-client-for-kafka | refs/heads/master | client/kafka_python.py | 1 | # -*- coding: utf-8 -*-
"""
kafka_python.py
~~~~~~~~~~~~
benchmarking performance of kafka_python client
"""
import time
from kafka import KafkaProducer, KafkaConsumer
from .settings import bootstrap_servers, msg_count, msg_payload, topic_kp
topic = topic_kp
def python_kafka_producer_performance(topic=to... |
3dfxsoftware/cbss-addons | refs/heads/master | account/wizard/account_vat.py | 3 | # -*- 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... |
SaschaMester/delicium | refs/heads/master | tools/telemetry/telemetry/page/shared_page_state_unittest.py | 1 | # 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 tempfile
import unittest
from telemetry.internal import story_runner
from telemetry.page import page
from telemetry.page import page_set
from telemet... |
quentinsf/ansible | refs/heads/devel | v1/ansible/playbook/play.py | 85 | # (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... |
Sable/mclab-ide | refs/heads/master | ide/assets.py | 1 | from flask.ext.assets import Bundle, Environment
assets = Environment()
js_ace = Bundle(
'bower_components/ace-builds/src-noconflict/ace.js',
'bower_components/ace-builds/src-noconflict/mode-matlab.js',
'bower_components/ace-builds/src-noconflict/keybinding-emacs.js',
'bower_components/ace-builds/src-... |
Comunitea/OCB | refs/heads/8.0 | addons/project/tests/test_project_base.py | 197 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Business Applications
# Copyright (c) 2013-TODAY OpenERP S.A. <http://www.openerp.com>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms... |
SaschaMester/delicium | refs/heads/master | chrome/common/extensions/docs/server2/content_providers.py | 36 | # 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 os
import traceback
from chroot_file_system import ChrootFileSystem
from content_provider import ContentProvider
import environment
fr... |
kustodian/ansible | refs/heads/devel | test/units/template/test_safe_eval.py | 58 | # (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... |
tafaRU/odoo | refs/heads/8.0 | openerp/report/render/rml2html/rml2html.py | 438 | # -*- coding: utf-8 -*-
##############################################################################
#
# Copyright (C) 2005, Fabien Pinckaers, UCL, FSA
# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>).
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesse... |
githubmlai/numpy | refs/heads/master | numpy/distutils/tests/f2py_f90_ext/tests/test_foo.py | 70 | from __future__ import division, absolute_import, print_function
import sys
from numpy.testing import *
from f2py_f90_ext import foo
class TestFoo(TestCase):
def test_foo_free(self):
assert_equal(foo.foo_free.bar13(), 13)
if __name__ == "__main__":
run_module_suite()
|
tomkralidis/QGIS | refs/heads/master | python/plugins/processing/algs/grass7/ext/r_li_cwed.py | 45 | # -*- coding: utf-8 -*-
"""
***************************************************************************
r_li_cwed.py
------------
Date : February 2016
Copyright : (C) 2016 by Médéric Ribreux
Email : medspx at medspx dot fr
**********************************... |
Distrotech/reportlab | refs/heads/master | src/reportlab/lib/PyFontify.py | 32 | #Copyright ReportLab Europe Ltd. 2000-2012
#see license.txt for license details
__version__=''' $Id$ '''
__doc__="""
Module to analyze Python source code; for syntax coloring tools.
Interface::
tags = fontify(pytext, searchfrom, searchto)
- The 'pytext' argument is a string containing Python source code.
- The... |
moondrop-entertainment/django-nonrel-drawp | refs/heads/master | django/core/handlers/wsgi.py | 54 | from pprint import pformat
import sys
from threading import Lock
try:
from cStringIO import StringIO
except ImportError:
from StringIO import StringIO
import socket
from django import http
from django.core import signals
from django.core.handlers import base
from django.core.urlresolvers import set_script_pref... |
Tigerwhit4/taiga-back | refs/heads/master | taiga/webhooks/permissions.py | 12 | # Copyright (C) 2014 Andrey Antukh <niwi@niwi.be>
# Copyright (C) 2014 Jesús Espino <jespinog@gmail.com>
# Copyright (C) 2014 David Barragán <bameda@dbarragan.com>
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the F... |
florian-dacosta/OCB | refs/heads/8.0 | addons/email_template/ir_actions.py | 281 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Business Applications
# Copyright (c) 2013 OpenERP S.A. <http://www.openerp.com>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of th... |
Barmaley-exe/scikit-learn | refs/heads/master | benchmarks/bench_random_projections.py | 397 | """
===========================
Random projection benchmark
===========================
Benchmarks for random projections.
"""
from __future__ import division
from __future__ import print_function
import gc
import sys
import optparse
from datetime import datetime
import collections
import numpy as np
import scipy.s... |
mhnatiuk/phd_sociology_of_religion | refs/heads/master | scrapper/lib/python2.7/site-packages/twisted/test/process_cmdline.py | 137 | """Write to stdout the command line args it received, one per line."""
import sys
for x in sys.argv[1:]:
print x
|
DavidNorman/tensorflow | refs/heads/master | tensorflow/python/grappler/datasets_test.py | 22 | # Copyright 2017 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... |
Summerlyu/Autoencoder | refs/heads/master | lasagne/tests/test_updates.py | 11 | import pytest
import numpy as np
import theano
import theano.tensor as T
import lasagne
PCT_TOLERANCE = 1E-5
class TestUpdateFunctions(object):
# These tests compare results on a toy problem to values
# calculated by the torch.optim package, using this script:
# https://gist.github.com/ebenolson/931e879e... |
whitepyro/debian_server_setup | refs/heads/master | lib/hachoir_core/stream/input.py | 90 | from lib.hachoir_core.endian import BIG_ENDIAN, LITTLE_ENDIAN
from lib.hachoir_core.error import info
from lib.hachoir_core.log import Logger
from lib.hachoir_core.bits import str2long
from lib.hachoir_core.i18n import getTerminalCharset
from lib.hachoir_core.tools import lowerBound
from lib.hachoir_core.i18n import _
... |
xguse/scikit-bio | refs/heads/master | ipynbs/presentations/2014.05.13-jairideout/talktools.py | 24 | """Tools to style a talk."""
# Originally from https://github.com/fperez/nb-slideshow-template
from IPython.display import HTML, display, YouTubeVideo
def prefix(url):
prefix = '' if url.startswith('http') else 'http://'
return prefix + url
def simple_link(url, name=None):
name = url if name is None el... |
CydarLtd/ansible | refs/heads/devel | lib/ansible/modules/web_infrastructure/jira.py | 41 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2014, Steve Smith <ssmith@atlassian.com>
# Atlassian open-source approval reference OSR-76.
#
# 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 ... |
edmorley/django | refs/heads/master | tests/auth_tests/test_auth_backends.py | 9 | from datetime import date
from unittest import mock
from django.contrib.auth import (
BACKEND_SESSION_KEY, SESSION_KEY, authenticate, get_user, signals,
)
from django.contrib.auth.backends import ModelBackend
from django.contrib.auth.hashers import MD5PasswordHasher
from django.contrib.auth.models import Anonymous... |
chris-wood/python-mingus | refs/heads/master | unittest/test_note_containers.py | 12 | #!/usr/bin/python
# -*- coding: utf-8 -*-
import sys
sys.path += ['../']
from mingus.containers.note_container import NoteContainer
from mingus.containers.note import Note
import unittest
class test_NoteContainers(unittest.TestCase):
def setUp(self):
self.n1 = NoteContainer()
self.n2 = NoteContai... |
sudoguy/instabot | refs/heads/master | instabot/bot/bot_support.py | 4 | """
Support instabot's methods.
"""
import sys
import os
import codecs
def check_if_file_exists(file_path, quiet=False):
if not os.path.exists(file_path):
if not quiet:
print("Can't find '%s' file." % file_path)
return False
return True
def read_list_from_file(file_path, qui... |
UpdraftDev/kernel_lge_hammerhead | refs/heads/4.4 | tools/perf/scripts/python/Perf-Trace-Util/lib/Perf/Trace/Core.py | 11088 | # Core.py - Python extension for perf script, core functions
#
# Copyright (C) 2010 by Tom Zanussi <tzanussi@gmail.com>
#
# This software may be distributed under the terms of the GNU General
# Public License ("GPL") version 2 as published by the Free Software
# Foundation.
from collections import defaultdict
def aut... |
moijes12/oh-mainline | refs/heads/master | vendor/packages/whoosh/tests/test_indexing.py | 16 | from __future__ import with_statement
from nose.tools import assert_equal, assert_raises #@UnresolvedImport
import random
from collections import defaultdict
from datetime import datetime
from whoosh import fields, query
from whoosh.compat import u, xrange, text_type, PY3
from whoosh.filedb.filestore import RamStorag... |
nanolith/luhnybin | refs/heads/master | src/contrib/googletest/test/gtest_throw_on_failure_test.py | 2917 | #!/usr/bin/env python
#
# Copyright 2009, 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... |
Distrotech/scons | refs/heads/distrotech-scons | test/sconsign/script/dblite.py | 3 | #!/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,
... |
ziposoft/godiva | refs/heads/master | src/track/urls.py | 1 | from django.conf.urls import *
from . import views
urlpatterns = [
url(r'^g/$', views.index, name='index'),
url(r'^$', views.TrackGenViews.index, name='home'),
# url(r'^results/$', views.ResultList.as_view(), name='results'),
url(r'^results/$', views.ResultList, name='results'),
url(r'^events/$', ... |
CCallahanIV/PyChart | refs/heads/master | pychart/pychart_datarender/models.py | 1 | """Models for pychart_datarender app."""
from django.db import models
from pychart_profile.models import PyChartProfile
# Create your models here.
class Data(models.Model):
"""Implementation of data model."""
title = models.CharField(max_length=255, blank=False, null=False)
description = models.CharFiel... |
anaran/olympia | refs/heads/master | apps/zadmin/tests/test_commands.py | 16 | import amo.tests
from apps.access.acl import action_allowed_user
from apps.users.models import UserProfile
from zadmin.management.commands.addusertogroup import do_adduser
from zadmin.management.commands.removeuserfromgroup import do_removeuser
class TestCommand(amo.tests.TestCase):
fixtures = ['zadmin/group_adm... |
eventh/tdt4215 | refs/heads/master | src/utils.py | 1 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
A module for doing misc project stuff.
Probably generating some useless tables etc.
"""
import sys
from collections import Counter
import data
from data import ATC, ICD, Therapy, PatientCase
def calculate_chapter_statistics():
"""Print out therapy chapter stati... |
somehume/namebench | refs/heads/master | nb_third_party/dns/rdtypes/ANY/X25.py | 248 | # 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 ... |
Ms2ger/servo | refs/heads/master | tests/wpt/css-tests/tools/py/py/_path/svnurl.py | 192 | """
module defining a subversion path object based on the external
command 'svn'. This modules aims to work with svn 1.3 and higher
but might also interact well with earlier versions.
"""
import os, sys, time, re
import py
from py import path, process
from py._path import common
from py._path import svnwc as svncommon... |
schemaorg/schemaorg | refs/heads/main | software/SchemaTerms/example-code/protobufs/google/protobuf/json_format.py | 4 | # Protocol Buffers - Google's data interchange format
# Copyright 2008 Google Inc. All rights reserved.
# https://developers.google.com/protocol-buffers/
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redi... |
oikarinen/plugin.audio.spotlight | refs/heads/master | ui_addon.py | 2 | #
# Copyright (c) Dariusz Biskup
#
# This file is part of Spotlight
#
# Spotlight 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 ve... |
ntt-sic/neutron | refs/heads/master | neutron/tests/unit/nicira/test_nicira_plugin.py | 2 | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright (c) 2012 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-2.0
#
# U... |
frivoal/presto-testo | refs/heads/master | wpt/websockets/autobahn/oberstet-Autobahn-643d2ee/lib/python/autobahn/case/case6_2_4.py | 9 | # coding=utf-8
###############################################################################
##
## Copyright 2011 Tavendo GmbH
##
## 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 ... |
vt-rocksat-2017/waveforms | refs/heads/master | command/v3/cmd_trx.py | 1 | #!/usr/bin/env python2
# -*- coding: utf-8 -*-
##################################################
# GNU Radio Python Flow Graph
# Title: Cmd Trx
# Generated: Thu Jun 15 12:47:31 2017
##################################################
import os
import sys
sys.path.append(os.environ.get('GRC_HIER_PATH', os.path.expandus... |
rvmoura96/projeto-almoxarifado | refs/heads/master | myvenv/Lib/site-packages/pylint/test/extensions/data/mccabe.py | 12 | """Checks use of "too-complex" check"""
def f1():
"""McCabe rating: 1"""
pass
def f2(n):
"""McCabe rating: 1"""
k = n + 4
s = k + n
return s
def f3(n):
"""McCabe rating: 3"""
if n > 3:
return "bigger than three"
elif n > 4:
return "is never executed"
else:
... |
rockneurotiko/django | refs/heads/master | django/conf/locale/__init__.py | 294 | # -*- encoding: utf-8 -*-
from __future__ import unicode_literals
"""
LANG_INFO is a dictionary structure to provide meta information about languages.
About name_local: capitalize it as if your language name was appearing
inside a sentence in your language.
The 'fallback' key can be used to specify a special fallback... |
timonwong/OmniMarkupPreviewer | refs/heads/master | OmniMarkupLib/Renderers/libs/python2/docutils/writers/manpage.py | 2 | # -*- coding: utf-8 -*-
# $Id$
# Author: Engelbert Gruber <grubert@users.sourceforge.net>
# Copyright: This module is put into the public domain.
"""
Simple man page writer for reStructuredText.
Man pages (short for "manual pages") contain system documentation on unix-like
systems. The pages are grouped in numbered s... |
mavenlin/tensorflow | refs/heads/master | tensorflow/python/eager/custom_gradient.py | 3 | # Copyright 2017 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... |
NickDaly/GemRB-FixConfig-Branch | refs/heads/master | gemrb/GUIScripts/DualClass.py | 2 | # -*-python-*-
# GemRB - Infinity Engine Emulator
# Copyright (C) 2003-2004 The GemRB Project
#
# 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 opt... |
Nicop06/ansible | refs/heads/devel | lib/ansible/plugins/action/aruba_config.py | 50 | #
# (c) 2017, Red Hat, Inc.
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Ansible is... |
mozilla-releng/scriptworker | refs/heads/master | src/scriptworker/cot/__init__.py | 2 | """Scriptworker chain of trust modules."""
|
mrshelly/openerp71313 | refs/heads/master | openerp/addons/account_analytic_plans/wizard/__init__.py | 445 | # -*- 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... |
rockyzhang/zhangyanhit-python-for-android-mips | refs/heads/master | python3-alpha/python3-src/Lib/test/test_zipfile.py | 47 | # We can test part of the module without zlib.
try:
import zlib
except ImportError:
zlib = None
import io
import os
import sys
import imp
import time
import shutil
import struct
import zipfile
import unittest
from tempfile import TemporaryFile
from random import randint, random
from unittest import skipUnles... |
caphrim007/ansible | refs/heads/devel | lib/ansible/modules/cloud/openstack/os_client_config.py | 132 | #!/usr/bin/python
# Copyright (c) 2015 Hewlett-Packard Development Company, L.P.
# 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',
... |
blueburningcoder/nupic | refs/heads/master | src/nupic/data/CategoryFilter.py | 35 | #! /usr/bin/env python
# ----------------------------------------------------------------------
# Numenta Platform for Intelligent Computing (NuPIC)
# Copyright (C) 2013, Numenta, Inc. Unless you have an agreement
# with Numenta, Inc., for a separate license for this software code, the
# following terms and conditions... |
bzbarsky/servo | refs/heads/master | tests/wpt/web-platform-tests/service-workers/service-worker/navigation-preload/resources/chunked-encoding-scope.py | 41 | import time
def main(request, response):
body = "hello\nworld\n\n"
response.add_required_headers = False
response.writer.write_status(200)
response.writer.write_header("Content-type", "text/html; charset=UTF-8")
response.writer.write_header("Transfer-encoding", "chunked")
response.writer.end_h... |
atareao/my-weather-indicator | refs/heads/master | src/preferences.py | 1 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# This file is part of my-weather-indicator
#
# Copyright (c) 2012 Lorenzo Carbonell Cerezo <a.k.a. atareao>
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
#... |
davemcnally/dave-mn | refs/heads/master | distribute_setup.py | 45 | #!python
"""Bootstrap distribute installation
If you want to use setuptools in your package's setup.py, just include this
file in the same directory with it, and add this to the top of your setup.py::
from distribute_setup import use_setuptools
use_setuptools()
If you want to require a specific version of se... |
eroicaleo/LearningPython | refs/heads/master | interview/leet/51_N-Queens.py | 1 | #!/usr/bin/env python
import copy
class Solution:
def solveNQueens(self, n: int):
def search(board, n, i):
print('n = %d, i = %d\n board = %s' % (n, i, board))
if i == n:
return [[''.join(row) for row in board]]
ret = []
for j, c in enumera... |
domenkozar/nixops | refs/heads/master | nixops/resources/sqs_queue.py | 1 | # -*- coding: utf-8 -*-
# Automatic provisioning of AWS SQS queues.
import time
import boto.sqs
import nixops.util
import nixops.resources
import nixops.ec2_utils
class SQSQueueDefinition(nixops.resources.ResourceDefinition):
"""Definition of an SQS queue."""
@classmethod
def get_type(cls):
ret... |
manqala/erpnext | refs/heads/develop | erpnext/regional/report/gst_itemised_sales_register/gst_itemised_sales_register.py | 4 | # Copyright (c) 2013, Frappe Technologies Pvt. Ltd. and contributors
# For license information, please see license.txt
from __future__ import unicode_literals
from erpnext.accounts.report.item_wise_sales_register.item_wise_sales_register import _execute
def execute(filters=None):
return _execute(filters, additional... |
ligature/ansible-modules-extras | refs/heads/devel | monitoring/nagios.py | 24 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# This file is largely copied from the Nagios module included in the
# Func project. Original copyright follows:
#
# func-nagios - Schedule downtime and enables/disable notifications
# Copyright 2011, Red Hat, Inc.
# Tim Bielawa <tbielawa@redhat.com>
#
# This software may be ... |
awlange/brainsparks | refs/heads/master | tests/mapping/reverse_map_fit.py | 1 |
import numpy as np
import pandas as pd
# BrainSparks imports
from src.calrissian.particle_network import ParticleNetwork
from src.calrissian.layers.particle import Particle
from src.calrissian.layers.particle import ParticleInput
from src.calrissian.network import Network
from src.calrissian.layers.dense import Dens... |
hsu1994/Terminator | refs/heads/master | Server/RelyON/boost_1_61_0/tools/build/test/build_dir.py | 44 | #!/usr/bin/python
# Copyright 2003 Dave Abrahams
# Copyright 2002, 2003, 2005 Vladimir Prus
# Distributed under the Boost Software License, Version 1.0.
# (See accompanying file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt)
# Test that we can change build directory using the 'build-dir' project
# attribute... |
benschmaus/catapult | refs/heads/master | third_party/google-endpoints/requests/exceptions.py | 155 | # -*- coding: utf-8 -*-
"""
requests.exceptions
~~~~~~~~~~~~~~~~~~~
This module contains the set of Requests' exceptions.
"""
from .packages.urllib3.exceptions import HTTPError as BaseHTTPError
class RequestException(IOError):
"""There was an ambiguous exception that occurred while handling your
request.
... |
PatrikValkovic/grammpy | refs/heads/master | tests/parsers_test/CYK/NoStartSymbolTest.py | 1 | #!/usr/bin/env python
"""
:Author Patrik Valkovic
:Created 31.08.2017 14:51
:Licence MIT
Part of grammpy
"""
from unittest import main, TestCase
from grammpy import *
from grammpy.exceptions import StartSymbolNotSetException
from grammpy.parsers import cyk
class S(Nonterminal): pass
class R(Rule): rule = ([S], [0])... |
castagnini/swim | refs/heads/master | calories.py | 1 |
import commands
from numpy import *
from timings import *
from strCheck import *
from matplotlib import *
from pylab import *
import sys
status,output= commands.getstatusoutput("ls Activities/*_*m.txt")
if len(sys.argv) > 1 and sys.argv[1] == "50":
status,output= commands.getstatusoutput("ls Activities/*_50*m.txt")
... |
WALR/taiga-back | refs/heads/master | taiga/feedback/api.py | 21 | # Copyright (C) 2014 Andrey Antukh <niwi@niwi.be>
# Copyright (C) 2014 Jesús Espino <jespinog@gmail.com>
# Copyright (C) 2014 David Barragán <bameda@dbarragan.com>
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the F... |
benjamindeleener/odoo | refs/heads/master | openerp/addons/test_assetsbundle/tests/test_assetsbundle.py | 9 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from openerp.tests import HttpCase
from openerp.tests.common import TransactionCase
from openerp.addons.base.ir.ir_qweb import AssetsBundle
from openerp.modules.module import get_resource_path
from os import utime
cla... |
yongshengwang/hue | refs/heads/master | desktop/core/ext-py/tablib-0.10.0/build/lib/tablib/packages/openpyxl/reader/worksheet.py | 61 | # file openpyxl/reader/worksheet.py
# Copyright (c) 2010 openpyxl
#
# 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, cop... |
testing-cabal/mock | refs/heads/master | mock/tests/testwith.py | 1 | import unittest
from warnings import catch_warnings
from mock.tests.support import is_instance
from mock import MagicMock, Mock, patch, sentinel, mock_open, call
something = sentinel.Something
something_else = sentinel.SomethingElse
class SampleException(Exception): pass
class WithTest(unittest.TestCase):
... |
mortada/scipy | refs/heads/master | scipy/linalg/decomp.py | 30 | #
# Author: Pearu Peterson, March 2002
#
# additions by Travis Oliphant, March 2002
# additions by Eric Jones, June 2002
# additions by Johannes Loehnert, June 2006
# additions by Bart Vandereycken, June 2006
# additions by Andrew D Straw, May 2007
# additions by Tiziano Zito, November 2008
#
# April 2010: Functio... |
amishb/youtube-dl | refs/heads/master | youtube_dl/extractor/musicplayon.py | 150 | # encoding: utf-8
from __future__ import unicode_literals
import re
from .common import InfoExtractor
from ..utils import int_or_none
class MusicPlayOnIE(InfoExtractor):
_VALID_URL = r'https?://(?:.+?\.)?musicplayon\.com/play(?:-touch)?\?(?:v|pl=100&play)=(?P<id>\d+)'
_TEST = {
'url': 'http://en.mu... |
larrybradley/photutils | refs/heads/main | photutils/aperture/__init__.py | 2 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
This subpackage contains tools to perform aperture photometry.
"""
from .bounding_box import * # noqa
from .circle import * # noqa
from .core import * # noqa
from .ellipse import * # noqa
from .mask import * # noqa
from .photometry import * # no... |
AOSP-S4-KK/platform_external_chromium_org | refs/heads/kk-4.4 | tools/telemetry/telemetry/core/backends/chrome/extension_dict_backend.py | 23 | # 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 json
import re
import weakref
from telemetry.core import extension_page
from telemetry.core.backends.chrome import inspector_backend
class ExtensionN... |
jessstrap/servotk | refs/heads/master | components/script/dom/bindings/codegen/parser/tests/test_distinguishability.py | 50 | def firstArgType(method):
return method.signatures()[0][1][0].type
def WebIDLTest(parser, harness):
parser.parse("""
dictionary Dict {
};
callback interface Foo {
};
interface Bar {
// Bit of a pain to get things that have dictionary types
void passDict(optional Di... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.