repo_name stringlengths 5 100 | ref stringlengths 12 67 | path stringlengths 4 244 | copies stringlengths 1 8 | content stringlengths 0 1.05M ⌀ |
|---|---|---|---|---|
mzrimsek/school | refs/heads/master | CS48101/mzrimsek/Assignment6/run_neural_net.py | 1 | import os
import sys
neural_src = os.getenv('NEURAL_SRC')
sys.path.append(neural_src);
os.chdir(neural_src)
import mnist_loader |
soerenbe/django-userpref | refs/heads/master | example_project/example_app/views.py | 6445 | from django.shortcuts import render
# Create your views here.
|
ChrisCinelli/pgessays | refs/heads/master | ez_epub_example.py | 7 | # -*- coding: utf-8 -*-
# Copyright (c) 2012, Bin Tan
# This file is distributed under the BSD Licence. See python-epub-builder-license.txt for details.
import re
import ez_epub
def formatParagraph(paragraph):
paragraph = paragraph.replace('--', '¡ª')
paragraph = re.sub(r' +', ' ', paragraph)
... |
nolanliou/tensorflow | refs/heads/master | tensorflow/contrib/timeseries/python/timeseries/state_space_models/kalman_filter_test.py | 66 | # 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... |
jirikuncar/invenio-formatter | refs/heads/master | invenio_formatter/config.py | 5 | # -*- coding: utf-8 -*-
#
# This file is part of Invenio.
# Copyright (C) 2006, 2007, 2008, 2010, 2011, 2014, 2015 CERN.
#
# Invenio 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
# Li... |
neteler/QGIS | refs/heads/master | cmake/FindLibPython.py | 101 | # -*- coding: utf-8 -*-
#
# Copyright (c) 2007, Simon Edwards <simon@simonzone.com>
# 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... |
jonfoster/pyxb2 | refs/heads/master | tests/trac/test-trac-0033a.py | 3 | # -*- coding: utf-8 -*-
import logging
if __name__ == '__main__':
logging.basicConfig()
_log = logging.getLogger(__name__)
import pyxb.binding.generate
import pyxb.utils.domutils
from xml.dom import Node
import os.path
xsd='''<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSch... |
luiseduardohdbackup/odoo | refs/heads/8.0 | addons/website_hr/__init__.py | 3964 | import controllers
import models
|
tylergibson/upm | refs/heads/master | examples/python/grovecircularled.py | 14 | #!/usr/bin/python
#
# Author: Jon Trulson <jtrulson@ics.com>
# Copyright (c) 2015 Intel Corporation.
#
# 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... |
seL4/python-capdl-tool | refs/heads/master | capdl/PageCollection.py | 1 | #
# Copyright 2014, NICTA
#
# This software may be distributed and modified according to the terms of
# the BSD 2-Clause license. Note that NO WARRANTY is provided.
# See "LICENSE_BSD2.txt" for details.
#
# @TAG(NICTA_BSD)
#
'''
Wrapper around a dict of pages for some extra functionality. Only intended to
be used inte... |
agentxan/nzbToMedia | refs/heads/master | libs/beets/util/enumeration.py | 28 | # -*- coding: utf-8 -*-
# This file is part of beets.
# Copyright 2016, Adrian Sampson.
#
# 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 t... |
fauskanger/Pretreat | refs/heads/master | app/classes/animation.py | 1 | import pyglet
import math
from enum import Enum
from app.pythomas import pythomas as lib
class Animation():
class State(Enum):
Idle = 0,
Move = 1
def __init__(self, resource, rows, columns,
start_pos=(1, 1),
position_offset=(0.0, 0.0),
start... |
chrischoy/3D-R2N2 | refs/heads/master | lib/binvox_rw.py | 1 | # Copyright (C) 2012 Daniel Maturana
# This file is part of binvox-rw-py.
#
# binvox-rw-py 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... |
amishb/youtube-dl | refs/heads/master | youtube_dl/extractor/planetaplay.py | 41 | # coding: utf-8
from __future__ import unicode_literals
import re
from .common import InfoExtractor
from ..utils import ExtractorError
class PlanetaPlayIE(InfoExtractor):
_VALID_URL = r'https?://(?:www\.)?planetaplay\.com/\?sng=(?P<id>[0-9]+)'
_API_URL = 'http://planetaplay.com/action/playlist/?sng={0:}'
... |
sonali0901/zulip | refs/heads/master | zproject/local_settings.py | 3 | # This file is the Zulip local_settings.py configuration for the
# zulip.com installation of Zulip. It shouldn't be used in other
# environments, but you may find it to be a a helpful reference when
# setting up your own Zulip installation to see how Zulip can be
# configured.
#
# On a normal Zulip production server, ... |
SCOAP3/invenio | refs/heads/master | invenio/modules/jsonalchemy/jsonext/functions/int_util_split.py | 17 | # -*- coding: utf-8 -*-
#
# This file is part of Invenio.
# Copyright (C) 2013, 2014 CERN.
#
# Invenio 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... |
codasus/django-blogages | refs/heads/master | blogages/django/core/mail/backends/filebased.py | 394 | """Email backend that writes messages to a file."""
import datetime
import os
from django.conf import settings
from django.core.exceptions import ImproperlyConfigured
from django.core.mail.backends.console import EmailBackend as ConsoleEmailBackend
class EmailBackend(ConsoleEmailBackend):
def __init__(self, *arg... |
andresailer/DIRAC | refs/heads/rel-v6r22 | Resources/Catalog/ConditionPlugins/test/Test_FilenamePlugin.py | 8 | """ Test the FilenamePlugin class"""
import unittest
from DIRAC.Resources.Catalog.ConditionPlugins.FilenamePlugin import FilenamePlugin
__RCSID__ = "$Id $"
class TestfilenamePlugin( unittest.TestCase ):
""" Test the FilenamePlugin class"""
def setUp(self):
self.lfns = [ '/lhcb/lfn1', '/lhcb/anotherlfn', '/o... |
vlegoff/tsunami | refs/heads/master | src/primaires/joueur/commandes/pset/__init__.py | 1 | # -*-coding:Utf-8 -*
# Copyright (c) 2010-2017 LE GOFF Vincent
# 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
... |
Maspear/odoo | refs/heads/8.0 | addons/report/models/abstract_report.py | 249 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2014-Today OpenERP SA (<http://www.openerp.com>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms ... |
gvb/odoo | refs/heads/8.0 | addons/crm_partner_assign/__openerp__.py | 244 | # -*- 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... |
TheTypoMaster/chromium-crosswalk | refs/heads/master | tools/telemetry/experimental/measure_trace.py | 12 | #!/usr/bin/env python
# Copyright 2014 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import collections
import json
import os
import sys
sys.path.append(os.path.join(os.path.dirname(__file__), os.pardir))
from telemetry... |
hgl888/chromium-crosswalk | refs/heads/master | third_party/mojo/src/mojo/public/third_party/jinja2/runtime.py | 606 | # -*- coding: utf-8 -*-
"""
jinja2.runtime
~~~~~~~~~~~~~~
Runtime helpers.
:copyright: (c) 2010 by the Jinja Team.
:license: BSD.
"""
from itertools import chain
from jinja2.nodes import EvalContext, _context_function_types
from jinja2.utils import Markup, soft_unicode, escape, missing, concat, \
... |
etherkit/OpenBeacon2 | refs/heads/master | client/linux-arm/venv/lib/python3.6/site-packages/PyInstaller/hooks/hook-gi.repository.GModule.py | 4 | #-----------------------------------------------------------------------------
# Copyright (c) 2005-2020, PyInstaller Development Team.
#
# Distributed under the terms of the GNU General Public License (version 2
# or later) with exception for distributing the bootloader.
#
# The full license is in the file COPYING.txt... |
andrewebdev/django-ostinato | refs/heads/master | ostinato/tests/statemachine/models.py | 1 | from django.db import models
from .workflow import TestStateMachine
class TestModel(models.Model):
name = models.CharField(max_length=100)
state = models.CharField(max_length=20, null=True, blank=True)
state_num = models.IntegerField(null=True, blank=True)
other_state = models.CharField(max_length=20... |
zhouzhenghui/python-for-android | refs/heads/master | python3-alpha/python3-src/Lib/lib2to3/fixes/fix_execfile.py | 175 | # Copyright 2006 Google, Inc. All Rights Reserved.
# Licensed to PSF under a Contributor Agreement.
"""Fixer for execfile.
This converts usages of the execfile function into calls to the built-in
exec() function.
"""
from .. import fixer_base
from ..fixer_util import (Comma, Name, Call, LParen, RParen, Dot, Node,
... |
dneg/cortex | refs/heads/master | test/IECoreGL/Selection.py | 3 | ##########################################################################
#
# Copyright (c) 2008-2013, Image Engine Design Inc. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redis... |
cyberark-bizdev/ansible | refs/heads/devel | lib/ansible/module_utils/postgres.py | 114 | # This code is part of Ansible, but is an independent component.
# This particular file snippet, and this file snippet only, is BSD licensed.
# Modules you write using this snippet, which is embedded dynamically by Ansible
# still belong to the author of the module, and may assign their own license
# to the complete wo... |
tumbl3w33d/ansible | refs/heads/devel | test/units/modules/network/fortios/test_fortios_vpn_ipsec_phase2_interface.py | 12 | # 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... |
lowitty/selenium | refs/heads/master | libs/windows/Crypto/SelfTest/Random/test_rpoolcompat.py | 131 | # -*- coding: utf-8 -*-
#
# SelfTest/Util/test_winrandom.py: Self-test for the winrandom module
#
# Written in 2008 by Dwayne C. Litzenberger <dlitz@dlitz.net>
#
# ===================================================================
# The contents of this file are dedicated to the public domain. To
# the extent that d... |
djbaldey/django | refs/heads/master | tests/m2m_intermediary/models.py | 128 | """
Many-to-many relationships via an intermediary table
For many-to-many relationships that need extra fields on the intermediary
table, use an intermediary model.
In this example, an ``Article`` can have multiple ``Reporter`` objects, and
each ``Article``-``Reporter`` combination (a ``Writer``) has a ``position``
f... |
Sweetgrassbuffalo/ReactionSweeGrass-v2 | refs/heads/master | .meteor/local/dev_bundle/python/Tools/i18n/pygettext.py | 18 | #! /usr/bin/env python
# -*- coding: iso-8859-1 -*-
# Originally written by Barry Warsaw <barry@python.org>
#
# 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 li... |
tobegit3hub/glance_docker | refs/heads/master | glance/api/v2/model/metadef_tag.py | 20 | # Copyright (c) 2014 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/licenses/LICENSE-2.0
#
# Unless required by applica... |
morpheby/levelup-by | refs/heads/master | docs/course_authors/source/conf.py | 25 | # -*- coding: utf-8 -*-
#
import sys, os
on_rtd = os.environ.get('READTHEDOCS', None) == 'True'
sys.path.append(os.path.abspath('../../../'))
sys.path.append(os.path.abspath('../../'))
from docs.shared.conf import *
sys.path.insert(0, os.path.abspath('.'))
master_doc = 'index'
# Add any paths that contain templa... |
stuartlangridge/ColourPicker | refs/heads/app | pick/__main__.py | 1 | import gi
gi.require_version('Gtk', '3.0')
from gi.repository import Gtk, Gdk, GLib, GdkPixbuf, Gio
try:
gi.require_version('Unity', '7.0')
from gi.repository import Unity
except:
Unity = False
import cairo, math, json, os, codecs, time, subprocess, sys, base64, colorsys
__VERSION__ = "1.51"
if "--snark" ... |
smithsps/LawsonAPI | refs/heads/master | old/src/simplejson/tests/test_scanstring.py | 139 | import sys
from unittest import TestCase
import simplejson as json
import simplejson.decoder
from simplejson.compat import b, PY3
class TestScanString(TestCase):
# The bytes type is intentionally not used in most of these tests
# under Python 3 because the decoder immediately coerces to str before
# calli... |
horance-liu/tensorflow | refs/heads/master | tensorflow/python/kernel_tests/logging_ops_test.py | 30 | # 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... |
10clouds/edx-platform | refs/heads/dev | common/test/acceptance/tests/studio/test_studio_home.py | 4 | """
Acceptance tests for Home Page (My Courses / My Libraries).
"""
from bok_choy.web_app_test import WebAppTest
from flaky import flaky
from opaque_keys.edx.locator import LibraryLocator
from uuid import uuid4
from ...fixtures import PROGRAMS_STUB_URL
from ...fixtures.config import ConfigModelFixture
from ...fixtures... |
crcresearch/osf.io | refs/heads/develop | api_tests/users/views/test_user_exceptions.py | 4 | # -*- coding: utf-8 -*-
import pytest
from api.base.settings.defaults import API_BASE
from osf_tests.factories import AuthUserFactory
from rest_framework import exceptions
@pytest.mark.django_db
class TestExceptionFormatting:
@pytest.fixture()
def user(self):
return AuthUserFactory(
full... |
AustinRoy7/Pomodoro-timer | refs/heads/master | venv/Lib/encodings/cp862.py | 272 | """ Python Character Mapping Codec generated from 'VENDORS/MICSFT/PC/CP862.TXT' with gencodec.py.
"""#"
import codecs
### Codec APIs
class Codec(codecs.Codec):
def encode(self,input,errors='strict'):
return codecs.charmap_encode(input,errors,encoding_map)
def decode(self,input,errors='strict'):
... |
davgibbs/django | refs/heads/master | django/contrib/gis/geos/factory.py | 586 | from django.contrib.gis.geos.geometry import GEOSGeometry, hex_regex, wkt_regex
from django.utils import six
def fromfile(file_h):
"""
Given a string file name, returns a GEOSGeometry. The file may contain WKB,
WKT, or HEX.
"""
# If given a file name, get a real handle.
if isinstance(file_h, s... |
marckuz/django | refs/heads/master | tests/middleware_exceptions/views.py | 296 | from django import http
from django.core.exceptions import PermissionDenied
from django.template import engines
from django.template.response import TemplateResponse
def normal_view(request):
return http.HttpResponse('OK')
def template_response(request):
template = engines['django'].from_string('OK')
re... |
kondors1995/Soviet-kernel | refs/heads/mm | tools/perf/scripts/python/event_analyzing_sample.py | 4719 | # event_analyzing_sample.py: general event handler in python
#
# Current perf report is already very powerful with the annotation integrated,
# and this script is not trying to be as powerful as perf report, but
# providing end user/developer a flexible way to analyze the events other
# than trace points.
#
# The 2 dat... |
ahkab/ahkab | refs/heads/master | tests/switch1/test_switch1.py | 1 | from ahkab.testing import NetlistTest
from ahkab import options
options.plotting_show_plots = False
def test():
nt = NetlistTest('switch1', er=1, ea=5e-1)
nt.setUp()
nt.test()
nt.tearDown()
test.__doc__ = "Switch test 1"
if __name__ == '__main__':
nt = NetlistTest('switch1', er=1, ea=5e-1)
nt... |
gqwest-erp/server | refs/heads/master | openerp/addons/l10n_es/__init__.py | 100 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (c) 2007 ACYSOS S.L. (http://acysos.com) All Rights Reserved.
# Pedro Tarrafeta (pedro@acysos.com)
# Copyright (c) 2008-2010 Zikz... |
Cito/sqlalchemy | refs/heads/master | lib/sqlalchemy/testing/suite/test_select.py | 8 | from .. import fixtures, config
from ..assertions import eq_
from sqlalchemy import util
from sqlalchemy import Integer, String, select, func
from ..schema import Table, Column
class OrderByLabelTest(fixtures.TablesTest):
"""Test the dialect sends appropriate ORDER BY expressions when
labels are used.
... |
shinfan/api-client-staging | refs/heads/master | generated/python/proto-google-cloud-monitoring-v3/google/cloud/proto/monitoring/v3/common_pb2_grpc.py | 83 | import grpc
from grpc.framework.common import cardinality
from grpc.framework.interfaces.face import utilities as face_utilities
|
waheedahmed/edx-platform | refs/heads/master | common/test/acceptance/pages/lms/problem.py | 11 | """
Problem Page.
"""
from bok_choy.page_object import PageObject
class ProblemPage(PageObject):
"""
View of problem page.
"""
url = None
CSS_PROBLEM_HEADER = '.problem-header'
def is_browser_on_page(self):
return self.q(css='.xblock-student_view').present
@property
def prob... |
nmc-probe/emulab-nome | refs/heads/master | protogeni/test/version1/deletesliver.py | 1 | #! /usr/bin/env python
#
# Copyright (c) 2008-2009 University of Utah and the Flux Group.
#
# {{{GENIPUBLIC-LICENSE
#
# GENI Public License
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and/or hardware specification (the "Work") to
# deal in the Work without rest... |
kyleperik/feature-requests | refs/heads/master | feature_requests/domain/models.py | 1 | class FeatureRequest:
def __init__(self, id=None, title='',
description='', target_date=None,
client_id=None, product_area_id=None):
self.id = id
self.title = title
self.description = description
self.target_date = target_date
self.client_id ... |
sam-tsai/django-old | refs/heads/master | tests/modeltests/empty/models.py | 1 | """
40. Empty model tests
These test that things behave sensibly for the rare corner-case of a model with
no fields.
"""
from django.db import models
class Empty(models.Model):
pass
|
thinkopensolutions/l10n-brazil | refs/heads/10.0 | l10n_br_stock_account/models/procurement.py | 3 | # -*- coding: utf-8 -*-
# Copyright (C) 2016 Luis Felipe Mileo - KMEE #
# License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html
from openerp import models, api
class ProcurementOrder(models.Model):
_inherit = "procurement.order"
@api.model
def _run_move_create(se... |
dparnell/rethinkdb | refs/heads/materialized | test/rql_test/connections/http_support/jinja2/testsuite/lexnparse.py | 402 | # -*- coding: utf-8 -*-
"""
jinja2.testsuite.lexnparse
~~~~~~~~~~~~~~~~~~~~~~~~~~
All the unittests regarding lexing, parsing and syntax.
:copyright: (c) 2010 by the Jinja Team.
:license: BSD, see LICENSE for more details.
"""
import unittest
from jinja2.testsuite import JinjaTestCase
from jinja... |
dagss/numpy_svn | refs/heads/master | numpy/doc/structured_arrays.py | 58 | """
=====================================
Structured Arrays (aka Record Arrays)
=====================================
Introduction
============
Numpy provides powerful capabilities to create arrays of structs or records.
These arrays permit one to manipulate the data by the structs or by fields of
the struct. A simpl... |
lekum/ansible-modules-extras | refs/heads/devel | monitoring/zabbix_screen.py | 18 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2013-2014, Epic Games, 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
# (... |
prat0318/zipkin | refs/heads/master | doc/src/sphinx/exts/includecode.py | 121 | import os
import codecs
from os import path
from docutils import nodes
from docutils.parsers.rst import Directive, directives
class IncludeCode(Directive):
"""
Include a code example from a file with sections delimited with special comments.
"""
has_content = False
required_arguments = 1
opti... |
Bysmyyr/blink-crosswalk | refs/heads/master | Tools/Scripts/webkitpy/tool/grammar.py | 217 | # Copyright (c) 2009 Google Inc. All rights reserved.
# Copyright (c) 2009 Apple 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... |
garynych/hammerhead_kernel | refs/heads/cm-11.0 | tools/perf/scripts/python/netdev-times.py | 11271 | # Display a process of packets and processed time.
# It helps us to investigate networking or network device.
#
# options
# tx: show only tx chart
# rx: show only rx chart
# dev=: show only thing related to specified device
# debug: work with debug mode. It shows buffer status.
import os
import sys
sys.path.append(os... |
mlperf/inference_results_v0.5 | refs/heads/master | closed/Google/code/gnmt/tpu-gnmt/home/kbuilder/mlperf-inference/google3/third_party/mlperf/inference/gnmt/nmt/attention_model.py | 5 | # Copyright 2017 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... |
zscproject/OWASP-ZSC | refs/heads/master | lib/encoder/osx_x86/inc_timesyouwant.py | 3 | #!/usr/bin/env python
'''
OWASP ZSC
https://www.owasp.org/index.php/OWASP_ZSC_Tool_Project
https://github.com/zscproject/OWASP-ZSC
http://api.z3r0d4y.com/
https://groups.google.com/d/forum/owasp-zsc [ owasp-zsc[at]googlegroups[dot]com ]
'''
def start(type, shellcode, job):
if "exec" == job:
times = int(type.rsplit... |
crimsonthunder/TRLTE_AOSP_Kernel | refs/heads/nougat | scripts/gcc-wrapper.py | 264 | #! /usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (c) 2011-2012, The Linux Foundation. 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 th... |
DaivdZhang/tinyControl | refs/heads/master | tcontrol/exception.py | 1 | __all__ = ['WrongNumberOfArguments', 'WrongSampleTime', 'UnknownDiscretizationMethod']
class WrongNumberOfArguments(Exception):
"""
Exception raised for not matching the numbers of parameters.
"""
pass
class WrongSampleTime(ValueError):
"""
Exception raised when sample time is invalid
""... |
vortec/repi-server | refs/heads/master | repi_server/command_line.py | 1 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import argparse
import tornadoredis
from repi_server import RepiServer
def main():
parser = argparse.ArgumentParser()
parser.add_argument('-n', '--name', help='Name of Repi client', type=str,
default='master')
parser.add_argument('-H',... |
jenalgit/django | refs/heads/master | tests/messages_tests/test_fallback.py | 330 | from django.contrib.messages import constants
from django.contrib.messages.storage.fallback import (
CookieStorage, FallbackStorage,
)
from django.test import SimpleTestCase
from .base import BaseTests
from .test_cookie import set_cookie_data, stored_cookie_messages_count
from .test_session import set_session_data... |
sgraham/nope | refs/heads/master | tools/auto_bisect/PRESUBMIT.py | 12 | # Copyright (c) 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.
"""Top-level presubmit script for auto-bisect.
See http://dev.chromium.org/developers/how-tos/depottools/presubmit-scripts for
details on the presubmit ... |
geminateCoder/Character-Archive-Website | refs/heads/master | Lib/site-packages/pip/_vendor/requests/packages/chardet/gb2312prober.py | 2993 | ######################## BEGIN LICENSE BLOCK ########################
# The Original Code is mozilla.org code.
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 1998
# the Initial Developer. All Rights Reserved.
#
# Con... |
uraplutonium/adtree-py | refs/heads/master | src/noname.py | 1 | '''
Created on Jun 5, 2012
@author: Felix
'''
import cProfile as profile
import pstats
import ArrayRecord as Record
import SparseADTree as ADTree
import TreeContingencyTable as ContingencyTable
arityList = [4, 3, 2, 5]
recordsTable = [[1, 2, 1, 4], [2, 2, 2, 5], [1, 3, 1, 1], [4, 1, 2, 1],
[2, 2, 1, ... |
neudesk/neucloud | refs/heads/master | openstack_dashboard/dashboards/admin/groups/forms.py | 8 | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 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.... |
kirca/odoo | refs/heads/master | install/win32/setup.py | 105 | # -*- 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... |
ahmed-mahran/hue | refs/heads/master | desktop/libs/libsentry/src/libsentry/client.py | 25 | #!/usr/bin/env python
# Licensed to Cloudera, Inc. under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. Cloudera, Inc. licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you ma... |
rohitwaghchaure/alec_frappe5_erpnext | refs/heads/develop | erpnext/stock/doctype/item_supplier/item_supplier.py | 121 | # Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import frappe
from frappe.model.document import Document
class ItemSupplier(Document):
pass |
loco-odoo/localizacion_co | refs/heads/master | openerp/addons-extra/odoo-pruebas/odoo-server/addons/mail/wizard/invite.py | 268 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2012-Today OpenERP SA (<http://www.openerp.com>)
#
# This program is free software: you can redistribute it and/or modify
# it under the terms o... |
kevindoole/udacity_p4 | refs/heads/master | services/session_service.py | 1 | #!/usr/bin/env python
"""profile_service.py
Handle requests related to ConferenceSessions.
"""
from datetime import datetime
import endpoints
from google.appengine.api import taskqueue
from google.appengine.ext import ndb
from models.conference_session import ConferenceSession, ConferenceSessionForms
from models.c... |
nikitakurylev/TuxemonX | refs/heads/development | tests/interactive/test_monster.py | 7 | """
from monster.py
"""
if __name__ == "__main__":
mytuxemon = Monster()
mytuxemon.load_from_db("Bulbatux")
mytuxemon.level = 5
othertux = Monster()
othertux.load_from_db("Bulbatux")
othertux.level = 5
pound_tech = Technique("Pound")
poison_tech = Technique("Poison Sting")
pprint.... |
JoeLaMartina/AlphametricProject | refs/heads/master | learning.py | 22 | """Learn to estimate functions from examples. (Chapters 18-20)"""
from utils import (
removeall, unique, product, argmax, argmax_random_tie, isclose,
dotproduct, vector_add, scalar_vector_product, weighted_sample_with_replacement,
weighted_sampler, num_or_str, normalize, clip, sigmoid, print_table, DataFil... |
odoousers2014/LibrERP | refs/heads/master | revenue_stamp/revenue_stamp.py | 3 | # -*- encoding: utf-8 -*-
##############################################################################
#
# Copyright (c) 2014 Didotech SRL (info at didotech.com)
# All Rights Reserved.
#
# WARNING: This program as such is intended to be used by professional
# programmers who take the whole re... |
manjunaths/tensorflow | refs/heads/master | tensorflow/python/ops/tensor_array_ops.py | 15 | # 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... |
Yelp/fullerite | refs/heads/master | src/diamond/collectors/sqs/sqs.py | 56 | # coding=utf-8
"""
The SQS collector collects metrics for one or more Amazon AWS SQS queues
#### Configuration
Below is an example configuration for the SQSCollector.
You can specify an arbitrary amount of regions
```
enabled = True
interval = 60
[regions]
[[region-code]]
access_key_id = '...'
... |
jamespacileo/django-france | refs/heads/master | django/views/decorators/vary.py | 2 | from functools import wraps
from django.utils.cache import patch_vary_headers
from django.utils.decorators import available_attrs
def vary_on_headers(*headers):
"""
A view decorator that adds the specified headers to the Vary header of the
response. Usage:
@vary_on_headers('Cookie', 'Accept-languag... |
edxnercel/edx-platform | refs/heads/master | .pycharm_helpers/pycharm/django_manage_commands_provider/_parser/_argparse.py | 81 | # coding=utf-8
"""
Fetches arguments from argparse-based Django (1.8+)
"""
from argparse import Action, _StoreTrueAction, _StoreFalseAction
from django_manage_commands_provider._parser import _utils
__author__ = 'Ilya.Kazakevich'
# noinspection PyUnusedLocal
# Command here by contract
def process_command(dumper, c... |
Zanzibar82/plugin.video.pelisalacarta | refs/heads/master | pelisalacarta/channels/italiafilm.py | 5 | # -*- coding: iso-8859-1 -*-
#------------------------------------------------------------
# pelisalacarta - XBMC Plugin
# Canal para italiafilm
# http://blog.tvalacarta.info/plugin-xbmc/pelisalacarta/
#------------------------------------------------------------
import urlparse,urllib2,urllib,re
import os,sys
from c... |
jparise/redis-py | refs/heads/master | setup.py | 26 | #!/usr/bin/env python
import os
import sys
from redis import __version__
try:
from setuptools import setup
from setuptools.command.test import test as TestCommand
class PyTest(TestCommand):
def finalize_options(self):
TestCommand.finalize_options(self)
self.test_args = []
... |
aarticianpc/greenpointtrees | refs/heads/master | src/accounts/models.py | 10644 | from django.db import models
# Create your models here.
|
tersmitten/ansible | refs/heads/devel | lib/ansible/utils/__init__.py | 2520 | # (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... |
kevthunder/codewave-py | refs/heads/master | codewave_core/context.py | 3 |
class Context():
def __init__(self,codewave = None):
self.codewave = codewave
self.nameSpaces = []
self._namespaces = self.commentChar = None
self.parent = None
def addNameSpace(self,name):
if name not in self.nameSpaces :
self.nameSpaces.append(name)
self._namespaces = None
def addNamespaces(self,... |
simonwydooghe/ansible | refs/heads/devel | test/units/modules/network/fortios/test_fortios_system_replacemsg_ec.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... |
f-arruza/supervoices-worker | refs/heads/master | voices/migrations/0006_auto_20170219_1343.py | 1 | # -*- coding: utf-8 -*-
# Generated by Django 1.10 on 2017-02-19 18:43
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('voices', '0005_auto_20170219_1318'),
]
operations = [
migrations.AlterField(
... |
Jessime/MazeDay2017 | refs/heads/master | src/binball_game/collision.py | 1 | import math
def ball_rect(ball, rect):
"""Determines if ball collides with any rectangular obects
Parameters
----------
ball : Particle
Players ball
rect : rect
Pygame Rect object with which the ball might collide
Returns
-------
collides : bool
True if ball's ... |
beiko-lab/gengis | refs/heads/master | bin/Lib/site-packages/matplotlib/dviread.py | 4 | """
An experimental module for reading dvi files output by TeX. Several
limitations make this not (currently) useful as a general-purpose dvi
preprocessor, but it is currently used by the pdf backend for
processing usetex text.
Interface::
dvi = Dvi(filename, 72)
# iterate over pages (but only one page is support... |
pascalgutjahr/Praktikum-1 | refs/heads/master | Lock-In/Rausch.py | 1 | import numpy as np
# import uncertainties.unumpy as unp
# from uncertainties.unumpy import (nominal_values as noms, std_devs as stds)
import matplotlib.pyplot as plt
import matplotlib as mpl
from scipy.optimize import curve_fit
plt.rcParams['figure.figsize'] = (12, 8)
plt.rcParams['font.size'] = 13
plt.rcParams['lines.... |
ArmstrongYang/StudyShare | refs/heads/master | Spark-Python/examples/ml/standard_scaler_example.py | 128 | #
# 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... |
hackers-terabit/portage | refs/heads/master | pym/portage/tests/resolver/test_depclean_slot_unavailable.py | 16 | # Copyright 2012 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
from portage.tests import TestCase
from portage.tests.resolver.ResolverPlayground import (ResolverPlayground,
ResolverPlaygroundTestCase)
class DepcleanUnavailableSlotTestCase(TestCase):
def testDepcleanUnavailabl... |
fmcardoso/aco-scs | refs/heads/master | pygraph/algorithms/cycles.py | 11 | # Copyright (c) 2008-2009 Pedro Matiello <pmatiello@gmail.com>
#
# 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,... |
robk5uj/invenio | refs/heads/bft2012-01-03 | modules/websession/lib/webgroup.py | 30 | ## This file is part of Invenio.
## Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011 CERN.
##
## Invenio 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... |
jbosboom/opentuner | refs/heads/master | examples/py_api/multiple_tuning_runs.py | 5 | #!/usr/bin/python
"""
Examples usage of a Python API interface to opentuner.
Unlike the other examples, this code lets the user control the main() of
the program and calls into opentuner to get new configurations to test.
This version runs multiple tuning runs at once in a single process.
"""
import adddeps # add o... |
pbrazdil/phantomjs | refs/heads/master | src/qt/qtwebkit/Tools/Scripts/webkitpy/tool/steps/attachtobug.py | 132 | # Copyright (C) 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 ... |
MaDKaTZe/phantomjs | refs/heads/master | src/qt/qtwebkit/Tools/QueueStatusServer/handlers/statusbubble.py | 125 | # Copyright (C) 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 of conditions and the... |
mick-d/nipype | refs/heads/master | nipype/interfaces/slicer/segmentation/__init__.py | 9 | # -*- coding: utf-8 -*-
from __future__ import absolute_import
from .specialized import RobustStatisticsSegmenter, EMSegmentCommandLine, BRAINSROIAuto
from .simpleregiongrowingsegmentation import SimpleRegionGrowingSegmentation
|
damdam-s/stock-logistics-workflow | refs/heads/8.0 | stock_ownership_by_move/__openerp__.py | 9 | # -*- coding: utf-8 -*-
# Author: Leonardo Pistone
# Copyright 2015 Camptocamp SA
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or... |
darionyaphet/spark | refs/heads/master | examples/src/main/python/mllib/bisecting_k_means_example.py | 28 | #
# 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... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.