repo_name stringlengths 5 100 | ref stringlengths 12 67 | path stringlengths 4 244 | copies stringlengths 1 8 | content stringlengths 0 1.05M ⌀ |
|---|---|---|---|---|
vishnu2kmohan/dcos | refs/heads/master | pkgpanda/build/cli.py | 6 | """Panda package builder
Reads a buildinfo file, uses it to assemble the sources and determine the
package version, then builds the package in an isolated environment along with
the necessary dependencies.
Usage:
mkpanda [--repository-url=<repository_url>] [--dont-clean-after-build] [--recursive] [--variant=<varian... |
meabsence/python-for-android | refs/heads/master | python-build/python-libs/gdata/build/lib/gdata/tlslite/utils/Python_AES.py | 359 | """Pure-Python AES implementation."""
from cryptomath import *
from AES import *
from rijndael import rijndael
def new(key, mode, IV):
return Python_AES(key, mode, IV)
class Python_AES(AES):
def __init__(self, key, mode, IV):
AES.__init__(self, key, mode, IV, "python")
self.rijndael = rijnda... |
DelazJ/QGIS | refs/heads/master | python/plugins/processing/gui/RangePanel.py | 30 | # -*- coding: utf-8 -*-
"""
***************************************************************************
RangePanel.py
---------------------
Date : August 2012
Copyright : (C) 2012 by Victor Olaya
Email : volayaf at gmail dot com
****************************... |
Meriipu/quodlibet | refs/heads/master | quodlibet/formats/_image.py | 2 | # Copyright 2013 Christoph Reiter
# 2020 Nick Boultbee
#
# 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.
from... |
belmiromoreira/nova | refs/heads/master | nova/tests/unit/virt/xenapi/image/test_vdi_through_dev.py | 70 | # Copyright 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/licenses/LICENSE-2.0
#
# Unless requ... |
CampyDB/campy-server | refs/heads/master | app/api/resources/user.py | 1 | from datetime import datetime
from flask import g
from flask.ext.restful import Resource, reqparse
from app import session, logger
from app.api import authorized
from app.models import User
__author__ = 'peter'
class UserAPI(Resource):
def __init__(self):
self.reqparse = reqparse.RequestParser()
... |
samuelclay/NewsBlur | refs/heads/master | vendor/paypalapi/interface.py | 18 | # coding=utf-8
"""
The end developer will do most of their work with the PayPalInterface class found
in this module. Configuration, querying, and manipulation can all be done
with it.
"""
import types
import logging
from pprint import pformat
import warnings
import requests
from vendor.paypalapi.settings import PayP... |
AbrahmAB/sugar | refs/heads/master | extensions/cpsection/background/view.py | 3 | # Copyright (C) 2012 Agustin Zubiaga <aguz@sugarlabs.org>
# Copyright (C) 2013 Sugar Labs
#
# 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)... |
hmgaudecker/econ-project-templates | refs/heads/master | docs/bld/example/python/python_example/.mywaflib/waflib/extras/waf_xattr.py | 55 | #! /usr/bin/env python
# encoding: utf-8
"""
Use extended attributes instead of database files
1. Input files will be made writable
2. This is only for systems providing extended filesystem attributes
3. By default, hashes are calculated only if timestamp/size change (HASH_CACHE below)
4. The module enables "deep_inp... |
smaffulli/libcloud | refs/heads/trunk | setup.py | 6 | # 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 use ... |
md1024/rams | refs/heads/init_master | uber/api.py | 1 | from uber.common import *
__version__ = 'v0.1'
attendee_fields = [
'full_name', 'first_name', 'last_name', 'email', 'zip_code', 'cellphone', 'ec_phone', 'badge_status_label', 'checked_in',
'badge_type_label', 'ribbon_label', 'staffing', 'is_dept_head', 'assigned_depts_labels', 'weighted_hours', 'worked_hours'... |
wkschwartz/django | refs/heads/stable/3.2.x | django/core/management/commands/sqlmigrate.py | 29 | from django.apps import apps
from django.core.management.base import BaseCommand, CommandError
from django.db import DEFAULT_DB_ALIAS, connections
from django.db.migrations.loader import AmbiguityError, MigrationLoader
class Command(BaseCommand):
help = "Prints the SQL statements for the named migration."
ou... |
JohnLunzer/flexx | refs/heads/master | flexx/app/_server.py | 1 | """
High level code related to the server that provides a mainloop and
serves the pages and websocket. Also provides call_later().
"""
from ..event import _loop
from .. import config
# There is always a single current server (except initially there is None)
_current_server = None
def create_server(host=None, port=... |
looker/sentry | refs/heads/master | src/sentry/south_migrations/0323_auto__add_unique_releaseenvironment_organization_id_release_id_environ.py | 4 | # -*- coding: utf-8 -*-
from south.utils import datetime_utils as datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
from sentry.utils.db import is_postgres
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding unique constraint on 'ReleaseEnv... |
Work4Labs/lettuce | refs/heads/master | tests/integration/lib/Django-1.2.5/django/contrib/gis/maps/__init__.py | 12133432 | |
franosincic/edx-platform | refs/heads/master | openedx/core/djangoapps/credentials/migrations/__init__.py | 12133432 | |
salty-horse/scummvm | refs/heads/master | devtools/tasmrecover/tasm/__init__.py | 12133432 | |
cpollard1001/FreeCAD_sf_master | refs/heads/master | src/Tools/MakeMacBundleRelocatable.py | 16 | import os
import sys
import subprocess
import pprint
SYS_PATHS = ["/System/", "/usr/lib/"]
class LibraryNotFound(Exception):
pass
class Node:
"""
self.path should be an absolute path to self.name
"""
def __init__(self, name, path="", children=None):
self.name = name
... |
nuagenetworks/vspk-python | refs/heads/master | vspk/v5_0/fetchers/nudestinationurls_fetcher.py | 2 | # -*- coding: utf-8 -*-
#
# Copyright (c) 2015, Alcatel-Lucent Inc, 2017 Nokia
# 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 copyrigh... |
mdietrichc2c/OCB | refs/heads/8.0 | addons/hw_proxy/controllers/main.py | 71 | # -*- coding: utf-8 -*-
import logging
import commands
import simplejson
import os
import os.path
import openerp
import time
import random
import subprocess
import simplejson
import werkzeug
import werkzeug.wrappers
_logger = logging.getLogger(__name__)
from openerp import http
from openerp.http import request
# dr... |
suzuki-no-suke/colledb | refs/heads/master | src/do_both_server.py | 1 | from bottle import route, get, post, abort, run, template, static_file, request
import bottle.ext.sqlite
import bottle
import os
import uuid
import datetime
import codecs
# app config
## server address
SERVER_ADDRESS = '192.168.1.0'
SERVER_PORTNO = 80
if "SERVER_ADDRESS" in os.environ:
SERVER_ADDRESS = os.environ... |
anhstudios/swganh | refs/heads/develop | data/scripts/templates/object/static/structure/tatooine/shared_shed_junkshop_watto.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 = Static()
result.template = "object/static/structure/tatooine/shared_shed_junkshop_watto.iff"
result.attribute_tem... |
cjaymes/pyscap | refs/heads/master | src/scap/model/ocil_2_0/QuestionnaireIDPattern.py | 1 | # Copyright 2016 Casey Jaymes
# This file is part of PySCAP.
#
# PySCAP 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.
#
# PySCAP is ... |
Ingenico-ePayments/connect-sdk-python2 | refs/heads/master | examples/merchant/payments/get_third_party_status_example.py | 2 | #
# This class was auto-generated from the API references found at
# https://epayments-api.developer-ingenico.com/s2sapi/v1/
#
import os
from ingenico.connect.sdk.factory import Factory
class GetThirdPartyStatusExample(object):
def example(self):
with self.__get_client() as client:
response ... |
Sir-Henry-Curtis/Ironworks | refs/heads/master | builtinPlugins/sickbeard.py | 3 | from flask import jsonify, render_template, request, send_file, json
import urllib2
import base64
import StringIO
from maraschino import app
from maraschino.tools import *
import maraschino
def sickbeard_http():
if get_setting_value('sickbeard_https') == '1':
return 'https://'
else:
return 'h... |
shtouff/django | refs/heads/master | django/views/generic/list.py | 471 | from __future__ import unicode_literals
from django.core.exceptions import ImproperlyConfigured
from django.core.paginator import InvalidPage, Paginator
from django.db.models.query import QuerySet
from django.http import Http404
from django.utils import six
from django.utils.translation import ugettext as _
from djang... |
alimanfoo/csvvalidator | refs/heads/master | tests.py | 2 | """
Tests for the `csvvalidator` module.
"""
import logging
import math
from csvvalidator import CSVValidator, VALUE_CHECK_FAILED, MESSAGES,\
HEADER_CHECK_FAILED, RECORD_LENGTH_CHECK_FAILED, enumeration, match_pattern,\
search_pattern, number_range_inclusive, number_range_exclusive,\
VALUE_PREDICATE_FAL... |
termie/jaikuengine | refs/heads/master | common/protocol/base.py | 34 | # Copyright 2009 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... |
gangadharkadam/johnerp | refs/heads/develop | erpnext/accounts/doctype/purchase_invoice/test_purchase_invoice.py | 7 | # Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import unittest
import frappe
import frappe.model
import json
from frappe.utils import cint
import frappe.defaults
from erpnext.stock.doctype.purcha... |
hwjworld/xiaodun-platform | refs/heads/master | common/djangoapps/user_api/__init__.py | 12133432 | |
levilucio/SyVOLT | refs/heads/master | GM2AUTOSAR_MM/cardinality_resolution/__init__.py | 12133432 | |
kave/cfgov-refresh | refs/heads/flapjack | cfgov/v1/wagtail_hooks.py | 1 | import os
import json
from urlparse import urlsplit
from django.http import Http404
from django.contrib.auth.models import Permission
from django.utils.html import escape
from wagtail.wagtailcore.models import Page
from wagtail.wagtailcore import hooks
from v1.models import CFGOVPage
@hooks.register('after_create_... |
googleapis/googleapis-gen | refs/heads/master | google/logging/v2/logging-v2-py/google/cloud/logging_v2/types/logging_config.py | 2 | # -*- coding: utf-8 -*-
# Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or... |
cloudera/hue | refs/heads/master | desktop/core/ext-py/Django-1.11.29/tests/validation/test_error_messages.py | 43 | # -*- encoding: utf-8 -*-
from __future__ import unicode_literals
from unittest import TestCase
from django.core.exceptions import ValidationError
from django.db import models
class ValidationMessagesTest(TestCase):
def _test_validation_messages(self, field, value, expected):
with self.assertRaises(Val... |
redhat-cip/horizon | refs/heads/master | openstack_dashboard/management/commands/migrate_settings.py | 60 | # Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under t... |
moyogo/noto-emoji | refs/heads/master | map_pua_emoji.py | 8 | #!/usr/bin/env python
#
# Copyright 2014 Google Inc. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless require... |
jkburges/phantomjs | refs/heads/master | src/qt/qtwebkit/Tools/Scripts/webkitpy/tool/bot/irc_command_unittest.py | 121 | # Copyright (c) 2010 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 ... |
gisce/libComXML | refs/heads/master | setup.py | 1 | # -*- coding: utf-8 -*-
from setuptools import setup, find_packages
setup(
name='libComXML',
version='3.1.0',
url='https://github.com/gisce/libComXML',
author='GISCE-TI, S.L',
author_email='devel@gisce.net',
packages=find_packages(),
install_requires=['lxml', 'six'],
license='None',
... |
Adel-Magebinary/odoo | refs/heads/8.0 | addons/product/tests/test_pricelist.py | 280 | from openerp.tests.common import TransactionCase
class TestPricelist(TransactionCase):
"""Tests for unit of measure conversion"""
def setUp(self):
super(TestPricelist, self).setUp()
cr, uid, context = self.cr, self.uid, {}
self.ir_model_data = self.registry('ir.model.data')
sel... |
mice-software/maus | refs/heads/master | src/map/MapPyPrint/test_MapPyPrint.py | 1 | #pylint: disable =C0103
"""test_MapPyPrint.py"""
import json
import unittest
from MapPyPrint import MapPyPrint
class MapPyPrintTestCase(unittest.TestCase):#pylint: disable =R0904
"""MapPyPrintTestCase"""
def test_empty(self):
"""test_empty"""
mapper = MapPyPrint()
self.assertTrue(mappe... |
smmribeiro/intellij-community | refs/heads/master | python/testData/pyi/lineMarkers/SimilarForFunctionStub/b.py | 819 | def foo():
pass |
ColdSauce/IsSittingOnButt | refs/heads/master | server/env/lib/python2.7/site-packages/pip/_vendor/requests/packages/chardet/langthaimodel.py | 2929 | ######################## BEGIN LICENSE BLOCK ########################
# The Original Code is Mozilla Communicator client 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 R... |
apple/swift-lldb | refs/heads/stable | packages/Python/lldbsuite/test/functionalities/thread/break_after_join/TestBreakAfterJoin.py | 5 | """
Test number of threads.
"""
from __future__ import print_function
import lldb
from lldbsuite.test.decorators import *
from lldbsuite.test.lldbtest import *
from lldbsuite.test import lldbutil
class BreakpointAfterJoinTestCase(TestBase):
mydir = TestBase.compute_mydir(__file__)
def setUp(self):
... |
schwarz/youtube-dl | refs/heads/master | test/test_unicode_literals.py | 168 | from __future__ import unicode_literals
# Allow direct execution
import os
import sys
import unittest
sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
import io
import re
rootDir = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
IGNORED_FILES = [
'setup.py', # http://... |
MadManRises/Madgine | refs/heads/master | shared/bullet3-2.89/examples/pybullet/gym/pybullet_envs/deep_mimic/mocap/render_reference.py | 4 | import os, inspect
currentdir = os.path.dirname(os.path.abspath(inspect.getfile(inspect.currentframe())))
parentdir = os.path.dirname(os.path.dirname(currentdir))
os.sys.path.insert(0, parentdir)
print('parent:', parentdir)
import pybullet_data
import pybullet
import time
import random
from pybullet_utils.bullet_cli... |
throwable-one/lettuce | refs/heads/master | tests/integration/django/rucola/manage.py | 2072 | #!/usr/bin/env python
from django.core.management import execute_manager
try:
import settings # Assumed to be in the same directory.
except ImportError:
import sys
sys.stderr.write("Error: Can't find the file 'settings.py' in the directory containing %r. It appears you've customized things.\nYou'll have to ... |
nickpack/django-oscar | refs/heads/master | tests/functional/basket/manipulation_tests.py | 54 | from oscar.test.testcases import WebTestCase
from oscar.test import factories
from oscar.apps.basket import models
class TestAddingToBasket(WebTestCase):
def test_works_for_standalone_product(self):
product = factories.ProductFactory()
detail_page = self.get(product.get_absolute_url())
r... |
fgesora/odoo | refs/heads/8.0 | addons/website_twitter/controllers/main.py | 355 | from openerp.addons.web import http
from openerp.addons.web.http import request
from openerp.tools.translate import _
import json
class Twitter(http.Controller):
@http.route(['/twitter_reload'], type='json', auth="user", website=True)
def twitter_reload(self):
return request.website.fetch_favorite_twe... |
sudheerchintala/LearnEraPlatForm | refs/heads/master | common/djangoapps/third_party_auth/tests/test_provider.py | 78 | """Unit tests for provider.py."""
from third_party_auth import provider
from third_party_auth.tests import testutil
class RegistryTest(testutil.TestCase):
"""Tests registry discovery and operation."""
# Allow access to protected methods (or module-protected methods) under
# test. pylint: disable-msg=pro... |
jeffery9/mixprint_addons | refs/heads/master | stock/stock.py | 1 | # -*- 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... |
535521469/crawler_sth | refs/heads/master | scrapy/nbsc/settings.py | 1 | # Scrapy settings for tutorial project
#
# For simplicity, this file contains only the most important settings by
# default. All the other settings are documented here:
#
# http://doc.scrapy.org/topics/settings.html
#
BOT_NAME = 'nbsc'
SPIDER_MODULES = ['scrapy.nbsc.spiders.tjbz_spider']
#NEWSPIDER_MODULE = 'scrap... |
eneldoserrata/marcos_openerp | refs/heads/master | marcos_addons/pos_cashier/__init__.py | 1 | # -*- coding: utf-8 -*-
##############################################################################
# Module : POS Cashiers
# Manage cashiers for Point Of Sale
# Author : Thierry Godin <thierry@lapinmoutardepommedauphine.com>
# Copyright (C) 2013 Thierry Godin
#
# This program is free software: you ... |
dronefly/dronefly.github.io | refs/heads/master | flask/lib/python2.7/site-packages/guess_language/blocks.py | 65 | ''' Categorize unicode characters by the code block in which they are found.
Copyright (c) 2008, Kent S Johnson
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
ver... |
astropy/conda-build-tools | refs/heads/master | extruder/copy_packages.py | 1 | from __future__ import print_function
from argparse import ArgumentParser
import os
from ruamel import yaml
from binstar_client.utils import get_server_api
from binstar_client.errors import NotFound
from conda.version import VersionOrder
__all__ = ['PackageCopier']
class PackageCopier(object):
def __init__(s... |
a-tsvetkov/lucid-python-django-registration | refs/heads/master | registration/management/commands/cleanupregistration.py | 232 | """
A management command which deletes expired accounts (e.g.,
accounts which signed up but never activated) from the database.
Calls ``RegistrationProfile.objects.delete_expired_users()``, which
contains the actual logic for determining which accounts are deleted.
"""
from django.core.management.base import NoArgsC... |
ohgodscience/LearningPython | refs/heads/master | piglow/clock.py | 3 | ######################################
## A binary clock using the PiGlow ##
## ##
## Example by Jason - @Boeeerb ##
######################################
from piglow import PiGlow
from time import sleep
from datetime import datetime
piglow = PiGlow()
### You can customise th... |
hcs/mailman | refs/heads/master | src/mailman/bin/find_member.py | 3 | # Copyright (C) 1998-2012 by the Free Software Foundation, Inc.
#
# This file is part of GNU Mailman.
#
# GNU Mailman 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 you... |
JinnLynn/alfred-workflows | refs/heads/master | lib/bs4/diagnose.py | 431 | """Diagnostic functions, mainly for use when doing tech support."""
import cProfile
from StringIO import StringIO
from HTMLParser import HTMLParser
import bs4
from bs4 import BeautifulSoup, __version__
from bs4.builder import builder_registry
import os
import pstats
import random
import tempfile
import time
import tra... |
nikolas/edx-platform | refs/heads/master | common/djangoapps/student/tests/test_reset_password.py | 54 | """
Test the various password reset flows
"""
import json
import re
import unittest
from django.core.cache import cache
from django.conf import settings
from django.test import TestCase
from django.test.client import RequestFactory
from django.contrib.auth.models import User
from django.contrib.auth.hashers import UNU... |
Outernet-Project/librarian-opener-html | refs/heads/master | setup.py | 1 | import os
from setuptools import setup, find_packages
import librarian_opener_html as pkg
def read(fname):
""" Return content of specified file """
return open(os.path.join(os.path.dirname(__file__), fname)).read()
VERSION = pkg.__version__
setup(
name='librarian-opener-html',
version=VERSION,
... |
wiki05/youtube-dl | refs/heads/master | youtube_dl/extractor/cliphunter.py | 113 | from __future__ import unicode_literals
from .common import InfoExtractor
from ..utils import determine_ext
_translation_table = {
'a': 'h', 'd': 'e', 'e': 'v', 'f': 'o', 'g': 'f', 'i': 'd', 'l': 'n',
'm': 'a', 'n': 'm', 'p': 'u', 'q': 't', 'r': 's', 'v': 'p', 'x': 'r',
'y': 'l', 'z': 'i',
'$': ':', ... |
aoakeson/home-assistant | refs/heads/dev | tests/components/media_player/test_demo.py | 1 | """The tests for the Demo Media player platform."""
import unittest
from unittest.mock import patch
import homeassistant.components.media_player as mp
from tests.common import get_test_home_assistant
entity_id = 'media_player.walkman'
class TestDemoMediaPlayer(unittest.TestCase):
"""Test the media_player module... |
zchking/odoo | refs/heads/8.0 | addons/mrp_operations/report/mrp_code_barcode.py | 381 | # -*- 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... |
XiaowenLin/cs598rk | refs/heads/master | reviews/reviewapp/migrations/__init__.py | 12133432 | |
rtts/letsy | refs/heads/master | django/balance/__init__.py | 12133432 | |
vasilenkomike/tarantool | refs/heads/master | test/xlog/misc.test.py | 9 | import os
import yaml
from os.path import abspath
# cleanup server.vardir
server.stop()
server.deploy()
lsn = int(yaml.load(server.admin("box.info.server.lsn", silent=True))[0])
server.stop()
data_path = os.path.join(server.vardir, server.name)
print """
# xlog file must exist after inserts.
"""
filename = str(lsn)... |
smartforceplus/SmartForceplus | refs/heads/master | addons/base_iban/__init__.py | 447 | # -*- 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... |
zhangguiyu/django-parler | refs/heads/master | parler/utils/conf.py | 8 | """
The configuration wrappers that are used for :ref:`PARLER_LANGUAGES`.
"""
from django.conf import settings
from django.core.exceptions import ImproperlyConfigured
from django.utils import six
from django.utils.translation import get_language
from parler.utils.i18n import is_supported_django_language
import warnings... |
gic888/MIEN | refs/heads/master | spatial/stacktool.py | 1 | #!/usr/bin/env python
# encoding: utf-8
#Created by on 2008-06-23.
# Copyright (C) 2008 Graham I Cummins
# 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... |
kapilrastogi/Impala | refs/heads/cdh5-trunk | thirdparty/hive-1.1.0-cdh5.8.0-SNAPSHOT/lib/py/thrift/protocol/__init__.py | 83 | #
# 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... |
gonzafirewall/kivy | refs/heads/master | kivy/tests/test_uix_widget.py | 59 | from kivy.tests.common import GraphicUnitTest
class UIXWidgetTestCase(GraphicUnitTest):
def test_default_widgets(self):
from kivy.uix.button import Button
from kivy.uix.slider import Slider
r = self.render
r(Button())
r(Slider())
def test_button_properties(self):
... |
hendrycks/fooling | refs/heads/master | tiny-imagenet/cs231n/layers.py | 1 | import numpy as np
def affine_forward(x, w, b):
"""
Computes the forward pass for an affine (fully-connected) layer.
The input x has shape (N, d_1, ..., d_k) where x[i] is the ith input.
We multiply this against a weight matrix of shape (D, M) where
D = \prod_i d_i
Inputs:
x - Input data, of shape (N, ... |
yunity/foodsaving-backend | refs/heads/master | karrot/places/migrations/0026_auto_20171027_1232.py | 2 | # -*- coding: utf-8 -*-
# Generated by Django 1.11.6 on 2017-10-27 12:32
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('places', '0025_auto_20170908_1057'),
]
operations = [
migrations.AddField(
... |
mKeRix/home-assistant | refs/heads/dev | homeassistant/components/demo/config_flow.py | 3 | """Config flow to configure demo component."""
import voluptuous as vol
from homeassistant import config_entries
from homeassistant.core import callback
import homeassistant.helpers.config_validation as cv
# pylint: disable=unused-import
from . import DOMAIN
CONF_STRING = "string"
CONF_BOOLEAN = "bool"
CONF_INT = "i... |
daanwierstra/pybrain | refs/heads/master | pybrain/rl/learners/discrete/sarsa.py | 1 | __author__ = 'Thomas Rueckstiess, ruecksti@in.tum.de'
from pybrain.rl.learners.rllearner import RLLearner
class SARSA(RLLearner):
def __init__(self, nActions):
self.alpha = 0.5
self.gamma = 0.99
self.laststate = None
self.lastaction = None
self.nActions ... |
dwaynebailey/pootle | refs/heads/master | tests/commands/update_tmserver.py | 3 | # -*- coding: utf-8 -*-
#
# Copyright (C) Pootle contributors.
#
# This file is a part of the Pootle project. It is distributed under the GPL3
# or later license. See the LICENSE file for a copy of the license and the
# AUTHORS file for copyright and authorship information.
import os
import sys
import pytest
from dj... |
tximikel/kuma | refs/heads/master | vendor/packages/translate/lang/identify.py | 25 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright 2009 Zuza Software Foundation
#
# This file is part of translate.
#
# 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 o... |
Chedi/airflow | refs/heads/master | airflow/operators/mysql_operator.py | 7 | import logging
from airflow.hooks import MySqlHook
from airflow.models import BaseOperator
from airflow.utils import apply_defaults
class MySqlOperator(BaseOperator):
"""
Executes sql code in a specific MySQL database
:param mysql_conn_id: reference to a specific mysql database
:type mysql_conn_id: ... |
NaturalGIS/QGIS | refs/heads/master | python/plugins/processing/algs/qgis/KeepNBiggestParts.py | 15 | # -*- coding: utf-8 -*-
"""
***************************************************************************
KeepNBiggestParts.py
---------------------
Date : July 2014
Copyright : (C) 2014 by Victor Olaya
Email : volayaf at gmail dot com
***********************... |
ahmetdaglarbas/e-commerce | refs/heads/tez | tests/functional/basket/manipulation_tests.py | 54 | from oscar.test.testcases import WebTestCase
from oscar.test import factories
from oscar.apps.basket import models
class TestAddingToBasket(WebTestCase):
def test_works_for_standalone_product(self):
product = factories.ProductFactory()
detail_page = self.get(product.get_absolute_url())
r... |
felipenaselva/felipe.repository | refs/heads/master | script.module.schism.common/lib/requests/packages/chardet/langthaimodel.py | 2929 | ######################## BEGIN LICENSE BLOCK ########################
# The Original Code is Mozilla Communicator client 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 R... |
jonathonwalz/ansible | refs/heads/devel | lib/ansible/modules/windows/win_firewall.py | 27 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2017, Michael Eaton <meaton@iforium.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 Li... |
dispel4py/dispel4py | refs/heads/master | dispel4py/test/simple_process_test.py | 2 | # Copyright (c) The University of Edinburgh 2014
#
# 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 agre... |
vivekmishra1991/scikit-learn | refs/heads/master | sklearn/svm/tests/__init__.py | 12133432 | |
andela-ooladayo/django | refs/heads/master | tests/defer_regress/__init__.py | 12133432 | |
lz1988/company-site | refs/heads/master | tests/regressiontests/admin_views/__init__.py | 12133432 | |
repotvsupertuga/tvsupertuga.repository | refs/heads/master | script.module.universalscrapers/lib/universalscrapers/modules/__init__.py | 12133432 | |
rtulke/ceph-deploy | refs/heads/master | ceph_deploy/pkg.py | 6 | import logging
from . import hosts
LOG = logging.getLogger(__name__)
def install(args):
packages = args.install.split(',')
for hostname in args.hosts:
distro = hosts.get(hostname, username=args.username)
LOG.info(
'Distro info: %s %s %s',
distro.name,
dist... |
nikhilraog/boto | refs/heads/develop | boto/mashups/interactive.py | 148 | # Copyright (C) 2003-2007 Robey Pointer <robey@lag.net>
#
# This file is part of paramiko.
#
# Paramiko is free software; you can redistribute it and/or modify it under the
# terms of the GNU Lesser General Public License as published by the Free
# Software Foundation; either version 2.1 of the License, or (at your op... |
lathertonj/RemixNoveltyRanker | refs/heads/master | Code/event_histogram.py | 1 | from subprocess import check_output
import numpy as np
import matplotlib.pyplot as plt
def bpms():
f = open('bpms.txt')
bpms = {}
line = f.readline()
while line != "" and line != "\n":
k, v = line.strip().split(',')
bpms[k] = float(v)
line = f.readline()
f.close()
return... |
uclouvain/OSIS-Louvain | refs/heads/master | base/migrations/0025_organization_type.py | 3 | # -*- coding: utf-8 -*-
# Generated by Django 1.9 on 2016-03-22 15:05
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('base', '0024_documentfile'),
]
operations = [
migrations.AddField(
... |
GitHublong/hue | refs/heads/master | desktop/core/ext-py/cx_Oracle-5.1.2/test/uNumberVar.py | 34 | """Module for testing number variables."""
import cx_Oracle
import decimal
class TestNumberVar(BaseTestCase):
def setUp(self):
BaseTestCase.setUp(self)
self.rawData = []
self.dataByKey = {}
for i in range(1, 11):
numberCol = i + i * 0.25
floatCol = i + i * 0.75
... |
darcyliu/storyboard | refs/heads/master | markdown/extensions/def_list.py | 31 | #!/usr/bin/env python
"""
Definition List Extension for Python-Markdown
=============================================
Added parsing of Definition Lists to Python-Markdown.
A simple example:
Apple
: Pomaceous fruit of plants of the genus Malus in
the family Rosaceae.
: An american computer co... |
shyamalschandra/scikit-learn | refs/heads/master | examples/linear_model/plot_logistic_multinomial.py | 24 | """
====================================================
Plot multinomial and One-vs-Rest Logistic Regression
====================================================
Plot decision surface of multinomial and One-vs-Rest Logistic Regression.
The hyperplanes corresponding to the three One-vs-Rest (OVR) classifiers
are repre... |
gregdek/ansible | refs/heads/devel | lib/ansible/modules/utilities/logic/include_vars.py | 26 | # -*- coding: utf-8 -*-
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {
'metadata_version': '1.1',
'status': ['stableinterface'],
'supported_by': 'core'
... |
priyesh16/thesis | refs/heads/252B_start | src/network/test/examples-to-run.py | 129 | #! /usr/bin/env python
## -*- Mode: python; py-indent-offset: 4; indent-tabs-mode: nil; coding: utf-8; -*-
# A list of C++ examples to run in order to ensure that they remain
# buildable and runnable over time. Each tuple in the list contains
#
# (example_name, do_run, do_valgrind_run).
#
# See test.py for more i... |
shaufi10/odoo | refs/heads/8.0 | addons/crm/res_config.py | 361 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Business Applications
# Copyright (C) 2004-TODAY OpenERP S.A. (<http://openerp.com>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms ... |
kaulkie/keyczar | refs/heads/master | cpp/src/tools/scons/scons-local-1.2.0.d20090223/SCons/compat/_scons_optparse.py | 19 | """optparse - a powerful, extensible, and easy-to-use option parser.
By Greg Ward <gward@python.net>
Originally distributed as Optik; see http://optik.sourceforge.net/ .
If you have problems with this module, please do not file bugs,
patches, or feature requests with Python; instead, use Optik's
SourceForge project ... |
anryko/ansible | refs/heads/devel | test/units/module_utils/basic/test_safe_eval.py | 134 | # -*- coding: utf-8 -*-
# (c) 2015-2017, Toshio Kuratomi <tkuratomi@ansible.com>
# 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 (absolute_import, division)
__metaclass__ = type
from itertools import chain
import pytest... |
nikitabrazhnik/flask2 | refs/heads/master | Module 3/Chapter12/chapter_12/webapp/controllers/rest/post.py | 11 | import datetime
from flask import abort
from flask.ext.restful import Resource, fields, marshal_with
from webapp.models import db, User, Post, Tag
from .parsers import (
post_get_parser,
post_post_parser,
post_put_parser,
post_delete_parser
)
from .fields import HTMLField
nested_tag_fields = {
'... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.