repo_name stringlengths 5 100 | ref stringlengths 12 67 | path stringlengths 4 244 | copies stringlengths 1 8 | content stringlengths 0 1.05M ⌀ |
|---|---|---|---|---|
Beeblio/django | refs/heads/master | tests/migrations/migrations_test_apps/normal/__init__.py | 12133432 | |
Jet-Streaming/gyp | refs/heads/master | test/generator-output/gyptest-depth.py | 1 | #!/usr/bin/env python
# Copyright 2014 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.
"""
Verifies building a project hierarchy created when the --generator-output=
and --depth= options is used to put the build configurati... |
doismellburning/edx-platform | refs/heads/master | common/djangoapps/track/migrations/0002_auto__add_field_trackinglog_host__chg_field_trackinglog_event_type__ch.py | 189 | # -*- coding: 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 'TrackingLog.host'
db.add_column('track_trackinglog', 'host',
self.gf('... |
JetBrains/intellij-community | refs/heads/master | python/testData/resolve/multiFile/relativeAndSameDirectoryImports/plainDirectoryImportResolveExcludedDirectoryModuleNotThrowsException/plainDirectory/script.py | 27 | from excluded import foo
# <ref> |
KarlParkinson/practice | refs/heads/master | dataStructures/binTreeIdentical.py | 1 | import binTree
def equalTrees(t1, t2):
if (t1 == None or t2 == None):
return compNoneTrees(t1,t2)
else:
if (t1.getRootVal() != t2.getRootVal()):
return False
else:
return equalTrees(t1.getLeftChild(), t2.getLeftChild()) and equalTrees(t1.getRightChild(), t2.getRi... |
drongh/vnpy | refs/heads/master | vn.strategy/backtestingEngine.py | 91 | # encoding: UTF-8
import shelve
from eventEngine import *
from pymongo import Connection
from pymongo.errors import *
from strategyEngine import *
########################################################################
class LimitOrder(object):
"""限价单对象"""
#-----------------------------------------------... |
roy-boy/python_scripts | refs/heads/master | html_reporter.py | 1 | """html_reporter.py converts csv to a html test report."""
import datetime
from csv_handler import load_csv
from lib import HTML
import logger as tl
from test_config import TEST_OUTPUT_PATH, TEST_RESULT_CSV
def produce_report():
test_timestamp = datetime.datetime.now()
test_timestamp = test_timestamp.strfti... |
AutorestCI/azure-sdk-for-python | refs/heads/master | azure-mgmt-network/azure/mgmt/network/v2017_11_01/operations/load_balancer_backend_address_pools_operations.py | 1 | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes ... |
nonhermitian/scipy | refs/heads/master | scipy/interpolate/polyint.py | 45 | from __future__ import division, print_function, absolute_import
import warnings
import numpy as np
from scipy.special import factorial
from scipy._lib.six import xrange
from scipy._lib._util import _asarray_validated
__all__ = ["KroghInterpolator", "krogh_interpolate", "BarycentricInterpolator",
"baryc... |
liuche/prox-server | refs/heads/master | samples/yelp-test.py | 1 | import json
import pprint
from app.clients import yelpClient, yelp3Client
from app.representation import venueRecord
# categories="beaches"
# def getLocality(lat, lon, **kwargs):
# return yelpClient.search_by_coordinates(lat, lon, **kwargs)
# locality = getLocality(19.915403, -155.887403,
# radius_filter=250... |
prakashmishra1598/gdeploy | refs/heads/3.0 | gdeployfeatures/firewalld/firewalld.py | 1 | """
Add functions corresponding to each of the actions in the json file.
The function should be named as follows <feature name>_<action_name>
"""
from gdeploylib import defaults, Global
def firewalld_add(section_dict):
section_dict['firewall_state'] = 'enabled'
Global.logger.info("Enabling firewalld service")
... |
ChrisThoung/fsic | refs/heads/main | examples/godley-lavoie_2007/6_reg.py | 1 | # -*- coding: utf-8 -*-
"""
6_reg
=====
FSIC implementation of Model *REG*, a model of a two-region economy with a
single government, fiscal and monetary system, and currency, from Chapter 6 of
Godley and Lavoie (2007). This model disaggregates Model *PC* (see '4_pc.py')
into two regions: 'North' and 'South'. Parameter... |
vbraun/libXon | refs/heads/master | python/setup.py | 1 | from distutils.core import setup
from distutils.extension import Extension
from Cython.Distutils import build_ext
setup(
cmdclass = {'build_ext': build_ext},
ext_modules = [
Extension('message_passing.message',
language='c++',
sources=['message_passing/message.pyx']... |
youdonghai/intellij-community | refs/heads/master | python/testData/findUsages/OverrideVariableByTupleInComprehension2.py | 35 | def f():
xst = [(3, 4)]
k = 3
return [(<caret>k, str(v)) for k, v in xst] |
collinjackson/mojo | refs/heads/master | sky/tools/webkitpy/layout_tests/layout_package/bot_test_expectations_unittest.py | 42 | # Copyright (C) 2013 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 ... |
toregreijer/horse-battery | refs/heads/master | freebsd_api.py | 4 | """
Author: Armon Dadgar
Start Date: April 7th, 2009
Description:
This file provides a python interface to low-level system call on the Linux platform.
It is designed to abstract away the C-level detail and provide a high-level method of doing
common management tasks.
"""
import ctypes # Allows us to mak... |
kayzhou/tornado | refs/heads/master | maint/test/websocket/client.py | 111 | #!/usr/bin/env python
import logging
from tornado import gen
from tornado.ioloop import IOLoop
from tornado.options import define, options, parse_command_line
from tornado.websocket import websocket_connect
define('url', default='ws://localhost:9001')
define('name', default='Tornado')
@gen.engine
def run_tests():
... |
PythonNut/servo | refs/heads/master | tests/wpt/web-platform-tests/tools/pywebsocket/src/example/hsts_wsh.py | 486 | # Copyright 2013, Google Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the f... |
kouaw/CouchPotatoServer | refs/heads/develop | libs/pyasn1/type/tag.py | 200 | # ASN.1 types tags
from operator import getitem
from pyasn1 import error
tagClassUniversal = 0x00
tagClassApplication = 0x40
tagClassContext = 0x80
tagClassPrivate = 0xC0
tagFormatSimple = 0x00
tagFormatConstructed = 0x20
tagCategoryImplicit = 0x01
tagCategoryExplicit = 0x02
tagCategoryUntagged = 0x04
class Tag:
... |
alexgorban/models | refs/heads/master | research/deep_speech/data/dataset.py | 2 | # Copyright 2018 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 appl... |
dwrpayne/zulip | refs/heads/master | zilencer/tests.py | 126 | # -*- coding: utf-8 -*-
from __future__ import absolute_import
import ujson
from django.test import TestCase
class EndpointDiscoveryTest(TestCase):
def test_staging_user(self):
response = self.client.get("/api/v1/deployments/endpoints", {"email": "lfaraone@zulip.com"})
data = ujson.loads(response... |
jswope00/griffinx | refs/heads/master | lms/djangoapps/notes/utils.py | 88 | from django.conf import settings
def notes_enabled_for_course(course):
'''
Returns True if the notes app is enabled for the course, False otherwise.
In order for the app to be enabled it must be:
1) enabled globally via FEATURES.
2) present in the course tab configuration.
'''
t... |
vietch2612/phantomjs | refs/heads/master | src/qt/qtwebkit/Tools/Scripts/webkitpy/style/main.py | 177 | # Copyright (C) 2010 Chris Jerdonek (cjerdonek@webkit.org)
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
# 1. Redistributions of source code must retain the above copyright
# notice, this list of conditions and... |
Dannnno/flask-pymongo | refs/heads/master | tests/test_config.py | 9 | from tests import util
import flask
import flask.ext.pymongo
import warnings
class CustomDict(dict):
pass
class FlaskPyMongoConfigTest(util.FlaskRequestTest):
def setUp(self):
self.app = flask.Flask('test')
self.context = self.app.test_request_context('/')
self.context.push()
... |
switchkiller/Python-and-Algorithms-and-Data-Structures | refs/heads/master | src/USEFUL/advanced/lru_cache.py | 2 | #!/usr/bin/env python3
__author__ = "bt3"
from functools import lru_cache
@lru_cache(maxsize=20)
def fib(n):
if n < 2:
return n
return fib(n-1) + fib(n-2)
if __name__ == '__main__':
print([fib(n) for n in range(10)])
print(fib.cache_info())
|
JFriel/honours_project | refs/heads/master | logistic-regression.py | 1 | import sys
reload(sys)
sys.setdefaultencoding('utf-8')
import app.parser.getData as importArticles
import app.parser.articleRetrieval.getArticles as getContent
import app.parser.sentences as sent
import app.parser.getChunks as gc
import app.analytics.tag as tag
import app.parser.articleRetrieval.wikipediaParse as wp
im... |
ConZ27/ansible-modules-core | refs/heads/devel | cloud/openstack/quantum_router_gateway.py | 99 | #!/usr/bin/python
#coding: utf-8 -*-
# (c) 2013, Benno Joy <benno@ansible.com>
#
# This module 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 ... |
raychorn/knowu | refs/heads/master | django/djangononrelsample2/django/contrib/localflavor/za/__init__.py | 12133432 | |
eduNEXT/edx-platform | refs/heads/master | openedx/features/course_experience/api/v1/__init__.py | 12133432 | |
vincepandolfo/django | refs/heads/master | django/contrib/gis/geos/io.py | 588 | """
Module that holds classes for performing I/O operations on GEOS geometry
objects. Specifically, this has Python implementations of WKB/WKT
reader and writer classes.
"""
from django.contrib.gis.geos.geometry import GEOSGeometry
from django.contrib.gis.geos.prototypes.io import (
WKBWriter, WKTWriter, _WKBReade... |
kxliugang/edx-platform | refs/heads/master | common/djangoapps/track/migrations/0002_auto__add_field_trackinglog_host__chg_field_trackinglog_event_type__ch.py | 189 | # -*- coding: 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 'TrackingLog.host'
db.add_column('track_trackinglog', 'host',
self.gf('... |
svn2github/gyp | refs/heads/master | pylib/gyp/MSVSProject.py | 2736 | # Copyright (c) 2012 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.
"""Visual Studio project reader/writer."""
import gyp.common
import gyp.easy_xml as easy_xml
#-------------------------------------------------------------------... |
davidbuzz/ardupilot | refs/heads/master | Tools/LogAnalyzer/tests/TestNaN.py | 34 | from LogAnalyzer import Test,TestResult
import math
class TestNaN(Test):
'''test for NaNs present in log'''
def __init__(self):
Test.__init__(self)
self.name = "NaNs"
def run(self, logdata, verbose):
self.result = TestResult()
self.result.status = TestResult.StatusType.GOO... |
campenberger/boto | refs/heads/develop | tests/unit/cloudsearch/test_connection.py | 114 | #!/usr/bin env python
from tests.unit import AWSMockServiceTestCase
from boto.cloudsearch.domain import Domain
from boto.cloudsearch.layer1 import Layer1
class TestCloudSearchCreateDomain(AWSMockServiceTestCase):
connection_class = Layer1
def default_body(self):
return b"""
<CreateDomainResponse xml... |
atzorvas/droughtmeteo | refs/heads/master | languages/default.py | 180 | # coding: utf8
{
'!langcode!': 'en-us',
'!langname!': 'English (US)',
'%s %%(shop)': '%s %%(shop)',
'%s %%(shop[0])': '%s %%(shop[0])',
'%s %%{quark[0]}': '%s %%{quark[0]}',
'%s %%{shop[0]}': '%s %%{shop[0]}',
'%s %%{shop}': '%s %%{shop}',
'%Y-%m-%d': '%Y-%m-%d',
'%Y-%m-%d %H:%M:%S': '%Y-%m-%d %H:%M:%S',
'@markmin\x01*... |
chokribr/inveniotest | refs/heads/master | modules/bibformat/lib/elements/bfe_date.py | 25 | # -*- coding: utf-8 -*-
##
## 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
## ... |
rwightman/tensorflow-litterbox | refs/heads/master | litterbox/models/google/nets/overfeat_test.py | 6 | # Copyright 2016 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable ... |
beacloudgenius/edx-platform | refs/heads/master | lms/djangoapps/courseware/features/staff_debug_info.py | 173 | """
Steps for staff_debug_info.feature lettuce tests
"""
from django.contrib.auth.models import User
from lettuce import world, step
from common import create_course, course_id
from courseware.courses import get_course_by_id
from instructor.access import allow_access
@step(u'i am staff member for the course "([^"]*)... |
txomon/vdsm | refs/heads/master | tests/functional/firewall.py | 1 | #
# Copyright 2013-2014 Red Hat, 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 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in... |
tumbl3w33d/ansible | refs/heads/devel | lib/ansible/modules/utilities/logic/include_tasks.py | 45 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright: Ansible Project
# 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': ... |
ceramos/micropython | refs/heads/master | tests/basics/int_big_mod.py | 55 | # test % operation on big integers
delta = 100000000000000000000000000000012345
for i in range(11):
for j in range(11):
x = delta * (i)# - 5) # TODO reinstate negative number test when % is working with sign correctly
y = delta * (j)# - 5) # TODO reinstate negative number test when % is working wi... |
yangming85/lettuce | refs/heads/master | tests/integration/django/chive/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 ... |
toooooper/oppia | refs/heads/master | integrations/gcb_oppia_tag_20141119_v0.0.1/coursebuilder/modules/oppia_tag/oppia_tag.py | 102 | # Copyright 2013 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 ... |
CSCI-462-01-2017/bedrock | refs/heads/master | tests/functional/firefox/__init__.py | 12133432 | |
KentaYamada/Siphon | refs/heads/master | app/tests/controller/__init__.py | 12133432 | |
wenhuizhang/neutron | refs/heads/master | neutron/tests/unit/ipam/__init__.py | 12133432 | |
TedaLIEz/sentry | refs/heads/master | tests/sentry/tasks/process_buffer/__init__.py | 12133432 | |
carlosp420/VoSeq | refs/heads/master | voseq/blast_local_full/__init__.py | 12133432 | |
foobarbazblarg/stayclean | refs/heads/master | stayclean-2018-april/reinstate.py | 49 | #!/usr/bin/python
# TODO: issues with new oauth2 stuff. Keep using older version of Python for now.
# #!/usr/bin/env python
import sys
from participantCollection import ParticipantCollection
names = sys.argv[1::]
participants = ParticipantCollection()
for name in names:
if participants.hasParticipantNamed(name)... |
dflemin3/ICgen | refs/heads/master | make_snapshotSType.py | 2 | # -*- coding: utf-8 -*-
"""
Created on Fri Mar 21 15:11:31 2014
@author: ibackus
@editor: dflemin3
-Note: indentation is 4 spaces in this file, not a tab!
This module initializes an S-type binary system in which the gas disk is around
the primary, not both stars! Assumes a_bin >> r_disk such that the disk's
velocity... |
nacc/cobbler | refs/heads/master | cobbler/item_file.py | 8 | """
Copyright 2006-2009, MadHatter
Kelsey Hightower <kelsey.hightower@gmail.com>
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... |
faulkner/swampdragon | refs/heads/master | swampdragon/serializers/serializer.py | 14 | from swampdragon.serializers.validation import ValidationError
class SerializerMeta(object):
def __init__(self, options):
self.publish_fields = getattr(options, 'publish_fields', None)
if isinstance(self.publish_fields, str):
self.publish_fields = (self.publish_fields, )
self... |
andrew-szymanski/gae_django | refs/heads/master | django/contrib/admin/media/js/compress.py | 784 | #!/usr/bin/env python
import os
import optparse
import subprocess
import sys
here = os.path.dirname(__file__)
def main():
usage = "usage: %prog [file1..fileN]"
description = """With no file paths given this script will automatically
compress all jQuery-based files of the admin app. Requires the Google Closure... |
popazerty/e2-dmm | refs/heads/master | lib/python/Plugins/Extensions/PicturePlayer/plugin.py | 5 | from enigma import ePicLoad, eTimer, getDesktop
from Screens.Screen import Screen
from Tools.Directories import resolveFilename, pathExists, fileExists, SCOPE_MEDIA
from Plugins.Plugin import PluginDescriptor
from Components.Pixmap import Pixmap, MovingPixmap
from Components.ActionMap import ActionMap, NumberActionMa... |
jminuscula/littleprinter | refs/heads/master | littleprinter/littleprinter/urls.py | 1 | from django.conf.urls import patterns, include, url
from django.contrib import admin
admin.autodiscover()
import medical_eponyms.urls
urlpatterns = patterns('',
url(r'^eponyms/', include(medical_eponyms.urls)),
url(r'^admin/', include(admin.site.urls)),
)
|
MaPePeR/numpy | refs/heads/master | numpy/distutils/tests/test_fcompiler_intel.py | 146 | from __future__ import division, absolute_import, print_function
import numpy.distutils.fcompiler
from numpy.testing import TestCase, run_module_suite, assert_
intel_32bit_version_strings = [
("Intel(R) Fortran Intel(R) 32-bit Compiler Professional for applications"
"running on Intel(R) 32, Version 11.1", '... |
ran5515/DeepDecision | refs/heads/master | tensorflow/contrib/copy_graph/__init__.py | 94 | # 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... |
mazcheng/snippets | refs/heads/master | spider/csdn/csdn/spiders/__init__.py | 2415 | # This package will contain the spiders of your Scrapy project
#
# Please refer to the documentation for information on how to create and manage
# your spiders.
|
Motorhead1991/samsung_att_kernel_source-msm7x30 | refs/heads/master | tools/perf/scripts/python/sctop.py | 895 | # system call top
# (c) 2010, Tom Zanussi <tzanussi@gmail.com>
# Licensed under the terms of the GNU GPL License version 2
#
# Periodically displays system-wide system call totals, broken down by
# syscall. If a [comm] arg is specified, only syscalls called by
# [comm] are displayed. If an [interval] arg is specified,... |
bjorand/django-allauth | refs/heads/master | allauth/socialaccount/providers/dropbox/urls.py | 80 | from allauth.socialaccount.providers.oauth.urls import default_urlpatterns
from .provider import DropboxProvider
urlpatterns = default_urlpatterns(DropboxProvider)
|
blarghmatey/pip | refs/heads/develop | pip/_vendor/requests/packages/chardet/euckrfreq.py | 3120 | ######################## 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... |
Jgarcia-IAS/localizacion | refs/heads/master | openerp/addons/purchase_analytic_plans/__init__.py | 441 | # -*- 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... |
Guts/Metadator | refs/heads/master | test/test_ttk_ListBox.py | 1 | from Tkinter import *
import ttk
root = Tk()
# Initialize our country "databases":
# - the list of country codes (a subset anyway)
# - a parallel list of country names, in the same order as the country codes
# - a hash table mapping country code to population<
countrycodes = ('ar', 'au', 'be', 'br', 'ca', 'cn', 'dk... |
ucrcsedept/galah | refs/heads/master | galah/web/api/__init__.py | 12133432 | |
rohitwaghchaure/erpnext_develop | refs/heads/develop | erpnext/education/doctype/assessment_plan_criteria/__init__.py | 12133432 | |
fosfataza/protwis | refs/heads/master | construct/__init__.py | 12133432 | |
cjgibson/hkvguqktacuranriagqecvebgwbjnlakvhaqytvtbyuvxt | refs/heads/master | 48097711/052/i.py | 12133432 | |
Vixionar/django | refs/heads/master | tests/file_storage/__init__.py | 12133432 | |
mdanielwork/intellij-community | refs/heads/master | python/lib/Lib/site-packages/django/conf/locale/cy/__init__.py | 12133432 | |
JustArchi/program-y | refs/heads/master | src/test/aiml_tests/response_tests/__init__.py | 12133432 | |
rds0751/colinkers | refs/heads/master | env/Lib/site-packages/django/conf/locale/sl/__init__.py | 12133432 | |
devcline/mtasa-blue | refs/heads/master | vendor/google-breakpad/src/tools/gyp/test/library/gyptest-shared.py | 430 | #!/usr/bin/env python
# Copyright (c) 2009 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.
"""
Verifies simple build of a "Hello, world!" program with shared libraries,
including verifying that libraries are rebuilt correctly when ... |
Jusedawg/SickRage | refs/heads/develop | lib/sqlalchemy/testing/assertsql.py | 78 | # testing/assertsql.py
# Copyright (C) 2005-2014 the SQLAlchemy authors and contributors <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php
from ..engine.default import DefaultDialect
from .. import util
import re
class... |
ebukoz/thrive | refs/heads/develop | erpnext/patches/v8_1/set_delivery_date_in_so_item.py | 11 | from __future__ import unicode_literals
import frappe
def execute():
frappe.reload_doctype("Sales Order")
frappe.reload_doctype("Sales Order Item")
if "final_delivery_date" in frappe.db.get_table_columns("Sales Order"):
frappe.db.sql("""
update `tabSales Order`
set delivery_date = final_delivery_date
wh... |
acshi/osf.io | refs/heads/develop | admin_tests/base/test_forms.py | 41 | from nose.tools import * # flake8: noqa
from tests.base import AdminTestCase
from admin.base.forms import GuidForm
class TestGuidForm(AdminTestCase):
def setUp(self):
super(TestGuidForm, self).setUp()
def test_valid_data(self):
guid = '12345'
form = GuidForm({
'guid': g... |
schmidtc/pysal | refs/heads/master | pysal/contrib/handler/tests/test_ols_sparse.py | 1 | import unittest
import numpy as np
import pysal
#import pysal.spreg as EC
from scipy import sparse
from pysal.contrib.handler import Model
from functools import partial
OLS = partial(Model, mtype='OLS')
BaseOLS = partial(Model, mtype='BaseOLS')
PEGP = pysal.examples.get_path
class TestBaseOLS(unittest.TestCase):
... |
osvalr/odoo | refs/heads/8.0 | addons/l10n_in_hr_payroll/report/__init__.py | 424 | #-*- coding:utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>). All Rights Reserved
# d$
#
# This program is free software: you can redistribute it and/or modify
# it... |
prospwro/odoo | refs/heads/8.0 | addons/account_anglo_saxon/purchase.py | 427 | # -*- encoding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of t... |
petecummings/django | refs/heads/master | tests/datetimes/models.py | 245 | from __future__ import unicode_literals
from django.db import models
from django.utils.encoding import python_2_unicode_compatible
@python_2_unicode_compatible
class Article(models.Model):
title = models.CharField(max_length=100)
pub_date = models.DateTimeField()
categories = models.ManyToManyField("Cat... |
lixiangning888/whole_project | refs/heads/master | modules/signatures/antiemu_wine.py | 3 | # -*- coding: utf-8 -*-
# Copyright (C) 2012 Claudio "nex" Guarnieri (@botherder)
#
# 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 lat... |
ashishdeshpande/robotframework | refs/heads/master | atest/testdata/test_libraries/InitLogging.py | 26 | import sys
from robot.api import logger
class InitLogging:
called = 0
def __init__(self):
InitLogging.called += 1
print '*WARN* Warning via stdout in init', self.called
print >> sys.stderr, 'Info via stderr in init', self.called
logger.warn('Warning via API in init %d' % self.c... |
sikuli/sikuli | refs/heads/develop | sikuli-script/src/test/python/old/test-wait.py | 3 | # Copyright 2010-2011, Sikuli.org
# Released under the MIT License.
from __future__ import with_statement
from sikuli.Sikuli import *
print wait("test-res/apple.png",0)
assert( waitVanish("test-res/about-this-mac.png", 0) == True)
with Region(10, 0, 200,200) as r:
p = Pattern("test-res/apple.png").targetOffset(30,5... |
fhennecker/semiteleporter | refs/heads/master | research/triangulation_4/filter.py | 1 | from sys import argv
import cv2
import numpy as np
RedMask = np.array([[[0, 0, 1]]])
def calibrationMask(img_with, img_without):
res = substract(img_with, img_without)
res = filterNoise(res)
return (res-1)/255
def substract(image_with_lasers, image_without_lasers):
"""
Substract the image w... |
jk1/intellij-community | refs/heads/master | python/testData/completion/heavyStarPropagation/lib/_pkg0/_pkg0_0/_pkg0_0_0/__init__.py | 30 | from ._pkg0_0_0_0 import *
from ._pkg0_0_0_1 import * |
sublime1809/django | refs/heads/master | django/utils/itercompat.py | 712 | """
Providing iterator functions that are not in all version of Python we support.
Where possible, we try to use the system-native version and only fall back to
these implementations if necessary.
"""
def is_iterable(x):
"A implementation independent way of checking for iterables"
try:
iter(x)
exc... |
Emaasit/PredictionIO | refs/heads/develop | examples/scala-parallel-similarproduct/add-rateevent/data/send_query.py | 283 | """
Send sample query to prediction engine
"""
import predictionio
engine_client = predictionio.EngineClient(url="http://localhost:8000")
print engine_client.send_query({"items": ["i1", "i3"], "num": 4})
|
Zackory/CopterLab | refs/heads/Basics | lib/cflib/crazyflie/log.py | 2 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# || ____ _ __
# +------+ / __ )(_) /_______________ _____ ___
# | 0xBC | / __ / / __/ ___/ ___/ __ `/_ / / _ \
# +------+ / /_/ / / /_/ /__/ / / /_/ / / /_/ __/
# || || /_____/_/\__/\___/_/ \__,_/ /___/\___/
#
# Copyright (C) 20... |
Therp/odoo | refs/heads/8.0 | addons/l10n_ve/__openerp__.py | 260 | # -*- encoding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2008 Tiny SPRL (<http://tiny.be>). All Rights Reserved
##############################################################################
# Modu... |
paulnovo/yaml-cpp | refs/heads/master | test/gmock-1.7.0/gtest/test/gtest_uninitialized_test.py | 2901 | #!/usr/bin/env python
#
# Copyright 2008, 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... |
atzengin/OCC | refs/heads/master | occ/gui/PropsDialog.py | 1 | """
Copyright 2007, 2008, 2009 Free Software Foundation, Inc.
This file is part of GNU Radio
OpenCV Companion is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) a... |
PulsePod/old-www-do-not-use | refs/heads/master | lib/python2.7/site-packages/flask/testsuite/test_apps/moduleapp/apps/frontend/__init__.py | 628 | from flask import Module, render_template
frontend = Module(__name__)
@frontend.route('/')
def index():
return render_template('frontend/index.html')
|
nuagenetworks/tempest | refs/heads/master | tempest/api/database/versions/__init__.py | 12133432 | |
faun/django_test | refs/heads/master | build/lib/django/contrib/gis/management/__init__.py | 12133432 | |
blighj/django | refs/heads/master | tests/admin_scripts/__init__.py | 12133432 | |
OctavianLee/thriftpy | refs/heads/develop | thriftpy/__init__.py | 3 | # -*- coding: utf-8 -*-
import sys
from .hook import install_import_hook, remove_import_hook
from .parser import load, load_module
__version__ = '0.3.1'
__python__ = sys.version_info
__all__ = ["install_import_hook", "remove_import_hook", "load", "load_module"]
|
nandhp/youtube-dl | refs/heads/master | youtube_dl/extractor/clubic.py | 18 | # coding: utf-8
from __future__ import unicode_literals
import json
import re
from .common import InfoExtractor
from ..utils import (
clean_html,
qualities,
)
class ClubicIE(InfoExtractor):
_VALID_URL = r'https?://(?:www\.)?clubic\.com/video/(?:[^/]+/)*video.*-(?P<id>[0-9]+)\.html'
_TESTS = [{
... |
cosmiclattes/TPBviz | refs/heads/master | torrent/lib/python2.7/site-packages/south/migration/base.py | 57 | from __future__ import print_function
from collections import deque
import datetime
from imp import reload
import os
import re
import sys
from django.core.exceptions import ImproperlyConfigured
from django.db import models
from django.conf import settings
from django.utils import importlib
from south import exceptio... |
remiremi/django_bigautohack | refs/heads/master | setup.py | 1 | # coding=utf-8
import os
from setuptools import setup, find_packages
with open(os.path.join(os.path.dirname(__file__), 'README.rst')) as readme:
README = readme.read()
# allow setup.py to be run from any path
os.chdir(os.path.normpath(os.path.join(os.path.abspath(__file__), os.pardir)))
setup(
name='django-... |
benchisell/photostream-bc | refs/heads/master | flask/lib/python2.7/site-packages/whoosh/filedb/__init__.py | 12133432 | |
brianrodri/oppia | refs/heads/develop | core/storage/config/__init__.py | 12133432 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.