repo_name stringlengths 5 100 | ref stringlengths 12 67 | path stringlengths 4 244 | copies stringlengths 1 8 | content stringlengths 0 1.05M ⌀ |
|---|---|---|---|---|
Edraak/edraak-platform | refs/heads/master | openedx/features/course_experience/tests/views/test_course_sock.py | 18 | """
Tests for course verification sock
"""
import ddt
from course_modes.models import CourseMode
from lms.djangoapps.commerce.models import CommerceConfiguration
from openedx.core.djangoapps.waffle_utils.testutils import override_waffle_flag
from openedx.features.course_experience import DISPLAY_COURSE_SOCK_FLAG
from... |
0x46616c6b/ansible | refs/heads/devel | lib/ansible/modules/database/postgresql/postgresql_schema.py | 16 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# 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.
#... |
sebastic/QGIS | refs/heads/master | python/plugins/processing/algs/taudem/TauDEMAlgorithm.py | 12 | # -*- coding: utf-8 -*-
"""
***************************************************************************
TauDEMAlgorithm.py
---------------------
Date : October 2012
Copyright : (C) 2012 by Alexander Bruy
Email : alexander dot bruy at gmail dot com
*********... |
minghuascode/pyj | refs/heads/master | library/pyjamas/gmaps/DirectionsRenderer.py | 2 | # Copyright (C) 2009 Daniel Carvalho <idnael@gmail.com>
#
# 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 la... |
40223123/raven | refs/heads/master | static/Brython3.1.1-20150328-091302/Lib/site-packages/pygame/surface.py | 603 | from browser import document, html, window
from javascript import console, JSConstructor
from .rect import Rect
#import pygame.rect
canvas_ID=1
_canvas_id=None
class Surface:
def __init__(self, dim=[], depth=16, surf=None):
if surf is None:
self._depth=depth
self._canvas=html.CANVAS(width=... |
konstruktoid/ansible-upstream | refs/heads/devel | lib/ansible/modules/database/misc/kibana_plugin.py | 43 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2016, Thierno IB. BARRY @barryib
# Sponsored by Polyconseil http://polyconseil.fr.
#
# 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
ANSI... |
kalomj/Pollution | refs/heads/master | node_modules/meanio/node_modules/mean-cli/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/generator/xcode_test.py | 2479 | #!/usr/bin/env python
# Copyright (c) 2013 Google Inc. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
""" Unit tests for the xcode.py file. """
import gyp.generator.xcode as xcode
import unittest
import sys
class TestEscapeXcodeDefine(unit... |
rhijul/jaikuengine | refs/heads/master | join/models.py | 1073 | # 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, ... |
Jgarcia-IAS/localizacion | refs/heads/master | openerp/addons-extra/odoo-pruebas/odoo-server/addons/l10n_be/wizard/l10n_be_account_vat_declaration.py | 309 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
#
# Adapted by Noviat to
# - enforce correct vat number
# - support negative balance
# - assign... |
ProjectSWGCore/NGECore2 | refs/heads/master | scripts/object/mobile/dressed_myyydril_pers.py | 85615 | import sys
def setup(core, object):
return |
dacjames/scrapy | refs/heads/master | scrapy/linkextractors/htmlparser.py | 90 | """
HTMLParser-based link extractor
"""
import warnings
from six.moves.html_parser import HTMLParser
from six.moves.urllib.parse import urljoin
from w3lib.url import safe_url_string
from scrapy.link import Link
from scrapy.utils.python import unique as unique_list
from scrapy.exceptions import ScrapyDeprecationWarni... |
kgiusti/gofer | refs/heads/master | test/unit/messaging/adapter/amqp/test_producer.py | 2 | # Copyright (c) 2014 Red Hat, Inc.
#
# This software is licensed to you under the GNU General Public
# License as published by the Free Software Foundation; either version
# 2 of the License (GPLv2) or (at your option) any later version.
# There is NO WARRANTY for this software, express or implied,
# including the impl... |
micahfay/quiz_app | refs/heads/master | quiz_app/forms.py | 1 | from django import forms
class UserNameForm(forms.Form):
name = forms.CharField(max_length=150, widget=forms.TextInput(attrs={'autofocus': 'autofocus'}), required=False)
class AnswerForm(forms.Form):
answer = forms.CharField(max_length=10, widget=forms.TextInput(attrs={'autofocus': 'autofocus'}), required=... |
motine/Ohouse | refs/heads/development | src/vendor/geniv3rpc/ext/sfa/util/xrn.py | 9 | #----------------------------------------------------------------------
# Copyright (c) 2008 Board of Trustees, Princeton University
#
# 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 restriction, i... |
vladmm/intellij-community | refs/heads/master | python/testData/refactoring/unwrap/emptyLineAtCaretUnwrap_before.py | 83 |
if True:
print 1
<caret>
print 2 |
martinburchell/econsensus | refs/heads/master | django/econsensus/publicweb/tests/custom_organizations/models_test.py | 4 | from django.test import TestCase
from guardian.shortcuts import assign_perm
#from organizations.models import OrganizationUser
from publicweb.tests.factories import (OrganizationUserFactory,
OrganizationOwnerFactory)
GUARDIAN_PERMISSION = 'edit_decisions_feedback'
class Organ... |
mojeto/django | refs/heads/master | tests/template_backends/test_jinja2.py | 94 | from unittest import skipIf
from django.template import TemplateSyntaxError
from django.test import RequestFactory
from .test_dummy import TemplateStringsTests
try:
import jinja2
except ImportError:
jinja2 = None
Jinja2 = None
else:
from django.template.backends.jinja2 import Jinja2
@skipIf(jinja2 ... |
aristanetworks/arista-ovs-nova | refs/heads/master | nova/tests/api/openstack/compute/contrib/test_volumes.py | 1 | # Copyright 2013 Josh Durgin
# 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 a... |
paplorinc/intellij-community | refs/heads/master | plugins/hg4idea/testData/bin/mercurial/mpatch.py | 96 | # mpatch.py - Python implementation of mpatch.c
#
# Copyright 2009 Matt Mackall <mpm@selenic.com> and others
#
# This software may be used and distributed according to the terms of the
# GNU General Public License version 2 or any later version.
import struct
try:
from cStringIO import StringIO
except ImportError:... |
tiagormk/gem5-hmp | refs/heads/master | src/arch/x86/isa/insts/x87/compare_and_test/__init__.py | 91 | # Copyright (c) 2007 The Hewlett-Packard Development Company
# All rights reserved.
#
# The license below extends only to copyright in the software and shall
# not be construed as granting a license to any other intellectual
# property including but not limited to intellectual property relating
# to a hardware implemen... |
Yonjuni/true-or-false | refs/heads/master | venv/lib/python2.7/site-packages/pip/_vendor/requests/packages/urllib3/contrib/pyopenssl.py | 304 | '''SSL with SNI_-support for Python 2. Follow these instructions if you would
like to verify SSL certificates in Python 2. Note, the default libraries do
*not* do certificate checking; you need to do additional work to validate
certificates yourself.
This needs the following packages installed:
* pyOpenSSL (tested wi... |
zhanqxun/cv_fish | refs/heads/master | pythonwin/pywin/tools/browser.py | 4 | # basic module browser.
# usage:
# >>> import browser
# >>> browser.Browse()
# or
# >>> browser.Browse(your_module)
import sys
import types
import __main__
import win32ui
from pywin.mfc import dialog
import hierlist
special_names = [ '__doc__', '__name__', '__self__' ]
#
# HierList items
class HL... |
bowlofstew/changes | refs/heads/master | tests/changes/vcs/asserts.py | 3 | from __future__ import absolute_import
from unittest import TestCase
class VcsAsserts(TestCase):
def assertRevision(self, revision, author=None, message=None, subject=None,
branches=None):
""" Asserts values of the given fields in the provided revision.
:param revision: Th... |
michalliu/OpenWrt-Firefly-Libraries | refs/heads/master | staging_dir/target-mipsel_1004kc+dsp_uClibc-0.9.33.2/usr/lib/python3.4/test/test_deque.py | 11 | from collections import deque
import unittest
from test import support, seq_tests
import gc
import weakref
import copy
import pickle
from io import StringIO
import random
import struct
BIG = 100000
def fail():
raise SyntaxError
yield 1
class BadCmp:
def __eq__(self, other):
raise RuntimeError
cl... |
alexandregz/simian | refs/heads/master | src/tests/simian/settings_test.py | 1 | #!/usr/bin/env python
#
# Copyright 2012 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... |
xq262144/hue | refs/heads/master | desktop/core/ext-py/pycrypto-2.6.1/lib/Crypto/SelfTest/PublicKey/test_RSA.py | 113 | # -*- coding: utf-8 -*-
#
# SelfTest/PublicKey/test_RSA.py: Self-test for the RSA primitive
#
# 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 dedic... |
vipmike007/tp-qemu | refs/heads/master | qemu/tests/smartcard_setup.py | 9 | """
smartcard_setup.py - Used as a setup test for smartcard tests.
Before doing a remote viewer connection there is some setup required
for smartcard tests:
On the client, certs that will be put into the smartcard will need
to be generated.
"""
import logging
from autotest.client.shared import error
from virttest ... |
daniell/econsensus | refs/heads/master | django/econsensus/publicweb/migrations/0024_auto__add_field_decision_meeting_people__chg_field_decision_people.py | 4 | # 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 field 'Decision.meeting_people'
db.add_column('publicweb_decision', 'meeting_people', self.gf('dj... |
mogoweb/chromium-crosswalk | refs/heads/master | tools/json_schema_compiler/cpp_util_test.py | 72 | #!/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.
import cpp_util
import unittest
class CppUtilTest(unittest.TestCase):
def testClassname(self):
self.assertEquals('Permission... |
jthatch12/STi | refs/heads/master | 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... |
cloudera/hue | refs/heads/master | desktop/core/src/desktop/lib/tasks/compress_files/__init__.py | 35 | #!/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... |
AkademieOlympia/sympy | refs/heads/master | sympy/physics/quantum/cartesian.py | 98 | """Operators and states for 1D cartesian position and momentum.
TODO:
* Add 3D classes to mappings in operatorset.py
"""
from __future__ import print_function, division
from sympy import DiracDelta, exp, I, Interval, pi, S, sqrt
from sympy.core.compatibility import range
from sympy.physics.quantum.constants impor... |
iamsteadman/bambu-attachments | refs/heads/master | bambu_attachments/admin.py | 1 | from django.contrib.contenttypes import generic
from bambu_attachments.models import Attachment
from bambu_attachments.forms import AttachmentForm
class AttachmentInline(generic.GenericStackedInline):
model = Attachment
extra = 0
form = AttachmentForm |
mikewied/perfrunner | refs/heads/master | perfrunner/celeryremote.py | 6 | BROKER_URL = 'amqp://couchbase:couchbase@ci.sc.couchbase.com:5672/broker'
CELERY_RESULT_BACKEND = 'amqp'
|
K1773R/p2pool | refs/heads/master | p2pool/test/util/test_datachunker.py | 287 | import random
import unittest
from p2pool.util import datachunker
def random_bytes(length):
return ''.join(chr(random.randrange(2**8)) for i in xrange(length))
class Test(unittest.TestCase):
def test_stringbuffer(self):
for i in xrange(100):
sb = datachunker.StringBuffer()
... |
vveerava/Openstack | refs/heads/master | neutron/plugins/ml2/drivers/cisco/apic/apic_model.py | 39 | # Copyright (c) 2014 Cisco Systems 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 re... |
dmitriy0611/django | refs/heads/master | tests/template_tests/filter_tests/test_urlizetrunc.py | 201 | from django.template.defaultfilters import urlizetrunc
from django.test import SimpleTestCase
from django.utils.safestring import mark_safe
from ..utils import setup
class UrlizetruncTests(SimpleTestCase):
@setup({'urlizetrunc01':
'{% autoescape off %}{{ a|urlizetrunc:"8" }} {{ b|urlizetrunc:"8" }}{% en... |
MoKee/android_kernel_nubia_nx403a | refs/heads/kk_mkt | 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... |
sprintingdev/CloudBot | refs/heads/master | cloudbot/reloader.py | 33 | import asyncio
import os.path
from watchdog.observers import Observer
from watchdog.events import PatternMatchingEventHandler
class PluginReloader(object):
def __init__(self, bot):
"""
:type bot: cloudbot.bot.CloudBot
"""
self.observer = Observer()
self.bot = bot
s... |
rhinstaller/pykickstart | refs/heads/master | tests/post.py | 4 | import unittest
from tests.baseclass import ParserTest
from pykickstart import constants
from pykickstart.errors import KickstartParseError
from pykickstart import version # pylint: disable=unused-import
class Script_Includes_Percent_Sign(ParserTest):
def __init__(self, *args, **kwargs):
ParserTes... |
eahneahn/free | refs/heads/master | lib/python2.7/site-packages/django/test/simple.py | 108 | """
This module is pending deprecation as of Django 1.6 and will be removed in
version 1.8.
"""
import json
import re
import unittest as real_unittest
import warnings
from django.db.models import get_app, get_apps
from django.test import _doctest as doctest
from django.test import runner
from django.test.utils import... |
keimlink/django-cms | refs/heads/develop | cms/management/commands/cms.py | 39 | # -*- coding: utf-8 -*-
from __future__ import absolute_import
from cms.management.commands.subcommands.base import SubcommandsCommand
from cms.management.commands.subcommands.check import CheckInstallation
from cms.management.commands.subcommands.list import ListCommand
from cms.management.commands.subcommands.moderat... |
tiborsimko/invenio-previewer | refs/heads/master | invenio_previewer/extensions/csv_dthreejs.py | 2 | # -*- coding: utf-8 -*-
#
# This file is part of Invenio.
# Copyright (C) 2013, 2014, 2015, 2016 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... |
mzizzi/ansible | refs/heads/devel | lib/ansible/modules/cloud/ovirt/ovirt_groups.py | 45 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright (c) 2016 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
#... |
jrief/django-shop | refs/heads/releases/0.10.x | shop/search/serializers.py | 2 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from rest_framework import serializers
from drf_haystack.serializers import HaystackSerializer
class ProductSearchSerializer(HaystackSerializer):
"""
The base serializer to represent one or more product fields for being returned as a
result l... |
fieldOfView/Cura | refs/heads/master | setup.py | 6 | # Copyright (c) 2015 Ultimaker B.V.
# Cura is released under the terms of the AGPLv3 or higher.
from distutils.core import setup
import py2exe
import UM
import UM.Qt #@UnusedImport
import cura #@UnusedImport
import os
import shutil
import site
# work around the limitation that shutil.copytree does not allow the targ... |
zeroblade1984/msm8939-yureka-kk | refs/heads/master | 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... |
nathantspencer/webknossos_toolkit | refs/heads/master | nml_tools/nml2swc.py | 1 | import glob
import os
import re
import sys
import defusedxml.ElementTree as ET
def write_swc(nmls_path, radius=0):
node_radius = radius
# store paths to nmls
nmls = []
if os.path.isdir(nmls_path):
nmls = glob.glob(os.path.normpath(nmls_path) + '/*.nml')
else:
nmls.append(nmls_path)... |
chenesan/django-disqus-backstore | refs/heads/master | disqus_backstore/query.py | 1 | """
Most of the `disqus_backstore.query` module has
the same interface in django `QuerySet` class,
ex. the implementation of filter/get method.
"""
import copy
from django.db.models.query import BaseIterable
from .disqus_interface import disqus_query
class Query(object):
def __init__(self, query_string, value,... |
wemanuel/smry | refs/heads/master | smry/server-auth/ls/google-cloud-sdk/platform/gsutil/third_party/apitools/samples/storage_sample/storage/storage_v1_client.py | 12 | """Generated client library for storage version v1."""
from apitools.base.py import base_api
import storage_v1_messages as messages
class StorageV1(base_api.BaseApiClient):
"""Generated client library for service storage version v1."""
MESSAGES_MODULE = messages
_PACKAGE = u'storage'
_SCOPES = [u'https://ww... |
tectronics/faint-graphics-editor | refs/heads/master | py/faint/formatutil.py | 1 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
# Copyright 2012 Lukas Kemmer
#
# 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... |
wcmckee/hamiltoncomputerclub.org.nz | refs/heads/master | static/cache/.mako.tmp/gallery.tmpl.py | 1 | # -*- encoding:utf-8 -*-
from mako import runtime, filters, cache
UNDEFINED = runtime.UNDEFINED
__M_dict_builtin = dict
__M_locals_builtin = locals
_magic_number = 8
_modified_time = 1399593694.947712
_enable_loop = True
_template_filename = u'/usr/lib/python2.7/site-packages/nikola/data/themes/bootstrap/templates/gall... |
janezhango/BigDataMachineLearning | refs/heads/master | py/testdir_single_jvm/test_GLM2_airline.py | 2 | import unittest, random, sys, time
sys.path.extend(['.','..','py'])
import h2o_hosts,h2o_glm
import h2o, h2o_cmd, h2o_import as h2i
from pprint import pprint
class Basic(unittest.TestCase):
def tearDown(self):
h2o.check_sandbox_for_errors()
@classmethod
def setUpClass(cls):
localhost = h2... |
esc/pip | refs/heads/develop | pip/_vendor/colorama/winterm.py | 578 | # Copyright Jonathan Hartley 2013. BSD 3-Clause license, see LICENSE file.
from . import win32
# from wincon.h
class WinColor(object):
BLACK = 0
BLUE = 1
GREEN = 2
CYAN = 3
RED = 4
MAGENTA = 5
YELLOW = 6
GREY = 7
# from wincon.h
class WinStyle(object):
NORMAL ... |
EdisonAlgorithms/ProjectEuler | refs/heads/master | vol3/126.py | 2 | def cubes(x, y, z, n):
return 2 * (x * y + x * z + y * z) + 4 * (x + y + z + n - 2) * (n - 1)
if __name__ == "__main__":
LIMIT = 30000
count = [0] * (LIMIT + 1)
for z in xrange(1, LIMIT):
if cubes(z, z, z, 1) > LIMIT:
break
for y in xrange(z, LIMIT):
if cubes(y, ... |
geekroot/erpnext | refs/heads/develop | erpnext/templates/pages/timelog_info.py | 56 | from __future__ import unicode_literals
import frappe
from frappe import _
def get_context(context):
context.no_cache = 1
timelog = frappe.get_doc('Time Log', frappe.form_dict.timelog)
context.doc = timelog |
ostrovok-team/django-mediagenerator | refs/heads/master | mediagenerator/filters/cssimport.py | 2 | import os
import re
import time
from mediagenerator.generators.bundles.base import FileFilter
from mediagenerator.utils import find_file
class CssImport(FileFilter):
IMPORT = re.compile(r"@import \s*(?P<d>['\"])(.*?)(?P=d)\s*;", re.M|re.U)
COMMENT = re.compile(r"/\*.*?\*/")
def __init__(self, **kwar... |
kingvuplus/gui_test2 | refs/heads/master | lib/python/Plugins/Extensions/DVDBurn/DVDToolbox.py | 39 | from Screens.Screen import Screen
from Components.ActionMap import ActionMap
from Components.Sources.StaticText import StaticText
from Components.Sources.Progress import Progress
from Components.Task import Task, Job, job_manager, Condition
from Components.ScrollLabel import ScrollLabel
from Components.Harddisk import ... |
streamlink/streamlink | refs/heads/master | src/streamlink/__init__.py | 3 | """Streamlink extracts streams from various services.
The main compontent of Streamlink is a command-line utility that
launches the streams in a video player.
An API is also provided that allows direct access to stream data.
Full documentation is available at https://streamlink.github.io.
"""
from streamlink._versi... |
eg-zhang/h2o-2 | refs/heads/master | R/tests/autoGen/GenUtils.py | 11 | ##
# Helper functions used to auto-generate R unit tests
##
from uuid import uuid4
from random import randrange, uniform, random, choice, sample, randint, seed
from math import floor, ceil
import sys
count = 0
def setup_random_seed(random_seed=None):
if random_seed is not None:
SEED = random_seed
else... |
bpshetty/erpnext | refs/heads/master | erpnext/accounts/doctype/purchase_invoice_advance/purchase_invoice_advance.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 PurchaseInvoiceAdvance(Document):
pass |
waditu/tushare | refs/heads/master | test/ref_test.py | 36 | # -*- coding:utf-8 -*-
'''
Created on 2015/3/14
@author: Jimmy Liu
'''
import unittest
from tushare.stock import reference as fd
class Test(unittest.TestCase):
def set_data(self):
self.code = '600848'
self.start = '2015-01-03'
self.end = '2015-04-07'
self.year = 2014... |
kouaw/CouchPotatoServer | refs/heads/develop | libs/requests/packages/charade/sbcharsetprober.py | 2926 | ######################## BEGIN LICENSE BLOCK ########################
# The Original Code is Mozilla Universal charset detector code.
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 2001
# the Initial Developer. All R... |
ool2016-seclab/quarantineSystem | refs/heads/master | ryu/tests/integrated/vrrp_common.py | 15 | # Copyright (C) 2013 Nippon Telegraph and Telephone Corporation.
# Copyright (C) 2013 Isaku Yamahata <yamahata at valinux co jp>
#
# 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://... |
louisLouL/pair_trading | refs/heads/master | capstone_env/lib/python3.6/site-packages/pandas/core/indexes/category.py | 3 | import numpy as np
from pandas._libs import index as libindex
from pandas import compat
from pandas.compat.numpy import function as nv
from pandas.core.dtypes.generic import ABCCategorical, ABCSeries
from pandas.core.dtypes.common import (
is_categorical_dtype,
_ensure_platform_int,
is_list_like,
is_in... |
HousekeepLtd/django | refs/heads/master | tests/template_tests/syntax_tests/test_exceptions.py | 513 | from django.template import TemplateDoesNotExist, TemplateSyntaxError
from django.test import SimpleTestCase
from ..utils import setup
from .test_extends import inheritance_templates
class ExceptionsTests(SimpleTestCase):
@setup({'exception01': "{% extends 'nonexistent' %}"})
def test_exception01(self):
... |
7digital/troposphere | refs/heads/master | troposphere/ec2.py | 1 | # Copyright (c) 2012-2013, Mark Peek <mark@peek.org>
# All rights reserved.
#
# See LICENSE file for full license.
from . import AWSHelperFn, AWSObject, AWSProperty
from .validators import (
boolean, exactly_one, integer, integer_range,
network_port, positive_integer
)
try:
from awacs.aws import Policy
... |
ubic135/odoo-design | refs/heads/master | addons/website_sale_options/controllers/main.py | 104 | # -*- coding: utf-8 -*-
from openerp import SUPERUSER_ID
from openerp.addons.web import http
from openerp.addons.web.http import request
from openerp.addons.website_sale.controllers.main import website_sale
class website_sale_options(website_sale):
@http.route(['/shop/product/<model("product.template"):product>'... |
Jorge-Rodriguez/ansible | refs/heads/devel | test/units/modules/network/onyx/test_onyx_command.py | 68 | # (c) 2016 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 dis... |
boxidau/alpha-internal-test | refs/heads/master | tests/test_alpha.py | 2 | import os
from conftest import test_config
def test_enumerate_modules(create_file_structure_src, remove_network_alpha, monkeypatch):
alpha = remove_network_alpha
for path, config in alpha.enumerate_modules(create_file_structure_src):
assert config == test_config
assert path == os.path.join(cre... |
nschloe/quadpy | refs/heads/main | src/quadpy/tn/_stroud_1961.py | 1 | import numpy as np
from sympy import Rational as frac
from ..helpers import article, rd, untangle
from ._helpers import TnScheme
source = article(
authors=["A.H. Stroud"],
title="Numerical Integration Formulas of Degree 3 for Product Regions and Cones",
journal="Mathematics of Computation",
volume="15... |
linan7788626/DeepLearningTutorials | refs/heads/master | code/dA.py | 30 | """
This tutorial introduces denoising auto-encoders (dA) using Theano.
Denoising autoencoders are the building blocks for SdA.
They are based on auto-encoders as the ones used in Bengio et al. 2007.
An autoencoder takes an input x and first maps it to a hidden representation
y = f_{\theta}(x) = s(Wx+b), paramete... |
jashwanth9/Expert-recommendation-system | refs/heads/master | code/contentBoostedCF.py | 1 | #simplified implementation of collabarative filtering
import numpy as np
from sklearn.neighbors import NearestNeighbors
from sklearn.metrics.pairwise import cosine_similarity
from scipy.spatial import distance
import pdb
import warnings
from scipy import sparse
import cPickle as pickle
from sklearn.naive_bayes import... |
vkosuri/pyang | refs/heads/master | pyang/plugins/name.py | 4 | """Name output plugin
"""
from pyang import plugin
def pyang_plugin_init():
plugin.register_plugin(NamePlugin())
class NamePlugin(plugin.PyangPlugin):
def add_output_format(self, fmts):
self.multiple_modules = True
fmts['name'] = self
def setup_fmt(self, ctx):
ctx.implicit_error... |
AccelAI/accel.ai | refs/heads/master | flask-aws/lib/python2.7/site-packages/jinja2/testsuite/ext.py | 402 | # -*- coding: utf-8 -*-
"""
jinja2.testsuite.ext
~~~~~~~~~~~~~~~~~~~~
Tests for the extensions.
:copyright: (c) 2010 by the Jinja Team.
:license: BSD, see LICENSE for more details.
"""
import re
import unittest
from jinja2.testsuite import JinjaTestCase
from jinja2 import Environment, DictLoader... |
microcom/odoo | refs/heads/9.0 | openerp/service/__init__.py | 71 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
import common
import db
import model
import report
import wsgi_server
import server
#.apidoc title: RPC Services
""" Classes of this module implement the network protocols that the
OpenERP server uses to communicat... |
alanjw/GreenOpenERP-Win-X86 | refs/heads/7.0 | openerp/addons/process/process.py | 50 | # -*- 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... |
predakanga/plugin.video.catchuptv.au.ninemsn | refs/heads/master | resources/lib/pyamf/tests/remoting/test_client.py | 25 | # -*- coding: utf-8 -*-
#
# Copyright (c) The PyAMF Project.
# See LICENSE.txt for details.
"""
Tests for Remoting client.
@since: 0.1.0
"""
import unittest
import urllib2
import pyamf
from pyamf import remoting, util
from pyamf.remoting import client
class ServiceMethodProxyTestCase(unittest.TestCase):
def t... |
ndawe/pyjet | refs/heads/master | pyjet/utils.py | 1 | import numpy as np
from . import DTYPE_EP, DTYPE_PTEPM
__all__ = [
'ptepm2ep',
'ep2ptepm',
]
def ptepm2ep(rec):
""" Convert (pT, eta, phi, mass) into (E, px, py, pz)
Note that the field names of the input array need not match "pT", "eta",
"phi", or "mass". This function only assumes that the fir... |
pantsbuild/pex | refs/heads/main | pex/vendor/_vendored/pip/pip/_vendor/distlib/database.py | 26 | # -*- coding: utf-8 -*-
#
# Copyright (C) 2012-2017 The Python Software Foundation.
# See LICENSE.txt and CONTRIBUTORS.txt.
#
"""PEP 376 implementation."""
from __future__ import unicode_literals
import base64
import codecs
import contextlib
import hashlib
import logging
import os
import posixpath
import sys
import z... |
bhargav2408/python-for-android | refs/heads/master | python3-alpha/extra_modules/gdata/tlslite/X509.py | 48 | """Class representing an X.509 certificate."""
from .utils.ASN1Parser import ASN1Parser
from .utils.cryptomath import *
from .utils.keyfactory import _createPublicRSAKey
class X509:
"""This class represents an X.509 certificate.
@type bytes: L{array.array} of unsigned bytes
@ivar bytes: The DER-encoded ... |
hendradarwin/VTK | refs/heads/master | IO/EnSight/Testing/Python/EnSightRectGridBin.py | 15 | #!/usr/bin/env python
import vtk
from vtk.test import Testing
from vtk.util.misc import vtkGetDataRoot
VTK_DATA_ROOT = vtkGetDataRoot()
def GetRGBColor(colorName):
'''
Return the red, green and blue components for a
color as doubles.
'''
rgb = [0.0, 0.0, 0.0] # black
vtk.vtkNamedColors... |
XiaosongWei/chromium-crosswalk | refs/heads/master | build/util/lastchange.py | 27 | #!/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.
"""
lastchange.py -- Chromium revision fetching utility.
"""
import re
import optparse
import os
import subprocess
import sys
_GI... |
ProjectSWGCore/NGECore2 | refs/heads/master | scripts/object/tangible/ship/components/shield_generator/shd_kse_enhanced_military_mk1.py | 85615 | import sys
def setup(core, object):
return |
cloudtools/troposphere | refs/heads/master | troposphere/lookoutvision.py | 1 | # Copyright (c) 2012-2021, Mark Peek <mark@peek.org>
# All rights reserved.
#
# See LICENSE file for full license.
#
# *** Do not modify - this file is autogenerated ***
# Resource specification version: 31.0.0
from . import AWSObject
class Project(AWSObject):
resource_type = "AWS::LookoutVision::Project"
... |
Peddle/hue | refs/heads/master | desktop/core/src/desktop/lib/django_forms.py | 33 | #!/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... |
Evmorov/ruby-coffeescript | refs/heads/source | code/python/other_comment.py | 6 | # it's a comment
|
chondm/fedena | refs/heads/master | vendor/plugins/fckeditor/public/javascripts/fckeditor/editor/filemanager/connectors/py/config.py | 93 | #!/usr/bin/env python
"""
* FCKeditor - The text editor for Internet - http://www.fckeditor.net
* Copyright (C) 2003-2008 Frederico Caldeira Knabben
*
* == BEGIN LICENSE ==
*
* Licensed under the terms of any of the following licenses at your
* choice:
*
* - GNU General Public License Version 2 or l... |
repotvsupertuga/tvsupertuga.repository | refs/heads/master | plugin.video.TVsupertuga/default.py | 1 |
import base64, codecs
magic = 'IyAtKi0gY29kaW5nOiB1dGYtOCAtKi0NCiIiIg0KICAgIGRlZmF1bHQucHkgLS0tIEplbiBBZGRvbiBlbnRyeSBwb2ludA0KICAgIENvcHlyaWdodCAoQykgMjAxNywgSmVuDQoNCiAgICBUaGlzIHByb2dyYW0gaXMgZnJlZSBzb2Z0d2FyZTogeW91IGNhbiByZWRpc3RyaWJ1dGUgaXQgYW5kL29yIG1vZGlmeQ0KICAgIGl0IHVuZGVyIHRoZSB0ZXJtcyBvZiB0aGUgR05VIEdlbmVy... |
PJUllrich/Complete-Bunq-API-Python-Wrapper | refs/heads/master | tests/endpoints/test_tab_attachment.py | 1 | from apiwrapper.endpoints.tab_attachment import TabAttachment
from tests.endpoints.test_endpoint import EndpointTest
class TabAttachmentTest(EndpointTest):
__base_endpoint_url = "/tab/%s/attachment/%d"
@property
def _base_endpoint(self):
return self.__base_endpoint_url % (self.random_uuid, self.r... |
MeGotsThis/BotGotsThis | refs/heads/master | pkg/feature/tests/test_channel.py | 1 | from asynctest.mock import patch
from tests.unittest.base_channel import TestChannel
from lib.data.message import Message
# Needs to be imported last
from .. import library
from .. import channel
class TestFeatureChannel(TestChannel):
@patch(library.__name__ + '.feature')
async def test_feature(self, mock_f... |
loveheaven/ocropy | refs/heads/master | OLD/lineproc.py | 15 | ################################################################
### functions specific to text line processing
### (text line segmentation is in lineseg)
################################################################
from scipy import stats
from scipy.ndimage import interpolation,morphology,filters
from pylab impor... |
hbielenia/django-campaign | refs/heads/master | campaign/__init__.py | 1 | __version__ = '0.3.0-pre'
default_app_config = 'campaign.apps.CampaignConfig'
|
sparkslabs/kamaelia | refs/heads/master | Sketches/JT/Jam/library/trunk/Kamaelia/Apps/Jam/Audio/Polyphony.py | 3 | # -*- coding: utf-8 -*-
# Copyright 2010 British Broadcasting Corporation and Kamaelia Contributors(1)
#
# (1) Kamaelia Contributors are listed in the AUTHORS file and at
# http://www.kamaelia.org/AUTHORS - please extend this file,
# not this notice.
#
# Licensed under the Apache License, Version 2.0 (the "Lice... |
avneesh91/django | refs/heads/master | django/db/backends/postgresql_psycopg2/features.py | 465 | from ..postgresql.features import * # NOQA
|
datamade/large-lots | refs/heads/master | lots_client/views.py | 1 | # -*- coding: utf-8 -*
import re
import json
import pytz
import os
from uuid import uuid4
from collections import OrderedDict
from datetime import datetime
from io import BytesIO
import requests
from requests.packages.urllib3.util.retry import Retry
from requests.adapters import HTTPAdapter
from dateutil import parser
... |
aioue/ansible | refs/heads/devel | lib/ansible/modules/system/getent.py | 69 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2014, Brian Coca <brian.coca+dev@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... |
ramaseshan/Spirit | refs/heads/master | spirit/settings.py | 3 | # -*- coding: utf-8 -*-
# DO NOT EDIT THIS FILE
# YOU MAY EXTEND/OVERWRITE THE DEFAULT VALUES IN YOUR settings.py FILE
from __future__ import unicode_literals
import os
ST_TOPIC_PRIVATE_CATEGORY_PK = 1
ST_UNCATEGORIZED_CATEGORY_PK = 2
ST_RATELIMIT_ENABLE = True
ST_RATELIMIT_CACHE_PREFIX = 'srl'
ST_RATELIMIT_CACHE =... |
pombreda/raft | refs/heads/master | core/web/StandardPageFactory.py | 11 | #
# Factory to create new SequenceBuilderWebPages
#
# Author: Gregory Fleischer (gfleischer@gmail.com)
#
# Copyright (c) 2011 RAFT Team
#
# This file is part of RAFT.
#
# RAFT 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 Softwa... |
bcui6611/gpudb | refs/heads/master | XML2CODE/main.py | 9 | #!/usr/bin/python
"""
Copyright (c) 2012-2013 The Ohio State University.
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 req... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.