repo_name stringlengths 5 100 | ref stringlengths 12 67 | path stringlengths 4 244 | copies stringlengths 1 8 | content stringlengths 0 1.05M ⌀ |
|---|---|---|---|---|
slitvinov/lammps-swimmer | refs/heads/swimmer2d | tools/moltemplate/src/nbody_fix_ttree_assignments.py | 29 | #!/usr/bin/env python
"""
nbody_fix_ttree_assignments.py
This is an ugly little script which was not intended to be run by end users.
Typical usage:
nbody_fix_ttree_assignments.py "angles" new_Angles.template \
< ttree_assignments.txt > ttree_assigmnents_new.txt
What it does:
In this example, this progra... |
rationalAgent/edx-platform-custom | refs/heads/master | common/lib/xmodule/xmodule/modulestore/tests/django_utils.py | 3 |
import copy
from uuid import uuid4
from django.test import TestCase
from django.conf import settings
import xmodule.modulestore.django
from unittest.util import safe_repr
def mongo_store_config(data_dir):
"""
Defines default module store using MongoModuleStore.
Use of this config requires mongo to be r... |
kirienko/gourmet | refs/heads/master | src/gourmet/plugins/browse_recipes/__init__.py | 1 | from gourmet.plugin import MainPlugin
from gourmet.plugin_loader import POST, PRE
from . import browser
class BrowserPlugin (MainPlugin):
def activate (self, pluggable):
MainPlugin.activate(self,pluggable)
self.browser = browser.RecipeBrowser(pluggable.rd)
self.browser.view.connect('reci... |
Defensative/kubernetes | refs/heads/master | examples/selenium/selenium-test.py | 173 | #!/usr/bin/env python
# Copyright 2015 The Kubernetes 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
#
# Unle... |
bancek/egradebook | refs/heads/master | src/lib/docutils/parsers/rst/languages/fr.py | 57 | # $Id: fr.py 4564 2006-05-21 20:44:42Z wiemann $
# Authors: David Goodger <goodger@python.org>; William Dode
# Copyright: This module has been placed in the public domain.
# New language mappings are welcome. Before doing a new translation, please
# read <http://docutils.sf.net/docs/howto/i18n.html>. Two files must ... |
p2pu/learning-circles | refs/heads/master | studygroups/tests/test_facilitator_views.py | 1 | # coding: utf-8
from django.test import TestCase, override_settings
from django.test import Client
from django.core import mail
from django.contrib.auth.models import User, Group
from django.utils import timezone
from django.utils.translation import get_language
from django.urls import reverse
from django.conf import s... |
liukeke-start/HelloWorld | refs/heads/master | node_modules/node-gyp/gyp/pylib/gyp/generator/eclipse.py | 1825 | # 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.
"""GYP backend that generates Eclipse CDT settings files.
This backend DOES NOT generate Eclipse CDT projects. Instead, it generates XML
files that can be importe... |
wangjun/pyspider | refs/heads/master | pyspider/database/mysql/mysqlbase.py | 3 | #!/usr/bin/env python
# -*- encoding: utf-8 -*-
# vim: set et sw=4 ts=4 sts=4 ff=unix fenc=utf8:
# Author: Binux<i@binux.me>
# http://binux.me
# Created on 2014-11-05 10:42:24
import time
import mysql.connector
class MySQLMixin(object):
maxlimit = 18446744073709551615
@property
def dbcur(self):
... |
cudadog/django-allauth | refs/heads/master | allauth/socialaccount/providers/flickr/models.py | 4209 | # Create your models here.
|
AmeriCanAndroid/kernel_htc_shooteru | refs/heads/cm-10.1 | tools/perf/scripts/python/check-perf-trace.py | 11214 | # perf script event handlers, generated by perf script -g python
# (c) 2010, Tom Zanussi <tzanussi@gmail.com>
# Licensed under the terms of the GNU GPL License version 2
#
# This script tests basic functionality such as flag and symbol
# strings, common_xxx() calls back into perf, begin, end, unhandled
# events, etc. ... |
sergiormb/recomovie | refs/heads/master | recomovie/movies/views.py | 6445 | from django.shortcuts import render
# Create your views here.
|
lorenzo-stoakes/linux-historical | refs/heads/master | scripts/gdb/linux/symbols.py | 68 | #
# gdb helper commands and functions for Linux kernel debugging
#
# load kernel and module symbols
#
# Copyright (c) Siemens AG, 2011-2013
#
# Authors:
# Jan Kiszka <jan.kiszka@siemens.com>
#
# This work is licensed under the terms of the GNU GPL version 2.
#
import gdb
import os
import re
from linux import module... |
airtonix/django-shop | refs/heads/master | shop/tests/api.py | 2 | from shop.models.ordermodel import OrderExtraInfo, Order
from django.test.testcases import TestCase
from django.contrib.auth.models import User
from shop.tests.util import Mock
from shop.shop_api import ShopAPI
from decimal import Decimal
class ShopApiTestCase(TestCase):
def setUp(self):
self.user = User.... |
takeshineshiro/neutron | refs/heads/master | neutron/plugins/ml2/drivers/openvswitch/agent/ovs_dvr_neutron_agent.py | 6 | # Copyright 2014, Hewlett-Packard Development Company, L.P.
# 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-... |
agry/NGECore2 | refs/heads/master | scripts/object/tangible/bug_jar/craftable_bug_habitat.py | 85615 | import sys
def setup(core, object):
return |
Sebmaster/mongo-connector | refs/heads/master | mongo_connector/connector.py | 2 | # Copyright 2013-2014 MongoDB, 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... |
PythonCharmers/bokeh | refs/heads/master | sphinx/source/docs/user_guide/source_examples/plotting_annulus.py | 50 | from bokeh.plotting import figure, show
p = figure(width=400, height=400)
p.annulus(x=[1, 2, 3], y=[1, 2, 3], inner_radius=0.1, outer_radius=0.25,
color="orange", alpha=0.6)
show(p)
|
aESeguridad/GERE | refs/heads/master | venv/lib/python2.7/site-packages/cairosvg/surface/units.py | 3 | # -*- coding: utf-8 -*-
# This file is part of CairoSVG
# Copyright © 2010-2012 Kozea
#
# 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 version 3 of the License, or (at your option... |
andyfaff/scipy | refs/heads/master | scipy/special/tests/test_wrightomega.py | 21 | import pytest
import numpy as np
from numpy.testing import assert_, assert_equal, assert_allclose
import scipy.special as sc
from scipy.special._testutils import assert_func_equal
def test_wrightomega_nan():
pts = [complex(np.nan, 0),
complex(0, np.nan),
complex(np.nan, np.nan),
... |
Nicop06/ansible | refs/heads/devel | docs/bin/generate_man.py | 38 | #!/usr/bin/env python
import optparse
import os
import pprint
import sys
from jinja2 import Environment, FileSystemLoader
from ansible.module_utils._text import to_bytes
def generate_parser():
p = optparse.OptionParser(
version='%prog 1.0',
usage='usage: %prog [options]',
description='G... |
naslanidis/ansible | refs/heads/devel | lib/ansible/modules/cloud/vmware/vmware_vm_facts.py | 48 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2015, Joseph Callen <jcallen () csc.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... |
gpoesia/servo | refs/heads/master | tests/wpt/css-tests/tools/pytest/testing/test_unittest.py | 171 | from _pytest.main import EXIT_NOTESTSCOLLECTED
import pytest
def test_simple_unittest(testdir):
testpath = testdir.makepyfile("""
import unittest
class MyTestCase(unittest.TestCase):
def testpassing(self):
self.assertEquals('foo', 'foo')
def test_failing(self... |
blaze/dask | refs/heads/master | dask/array/tests/test_optimization.py | 1 | import pytest
pytest.importorskip("numpy")
import numpy as np
import dask
import dask.array as da
from dask.highlevelgraph import HighLevelGraph
from dask.optimization import fuse
from dask.utils import SerializableLock
from dask.array.core import getter, getter_nofancy
from dask.array.optimization import getitem, op... |
davidyezsetz/kuma | refs/heads/master | vendor/packages/nose/unit_tests/support/test.py | 10 | import unittest
class Something(unittest.TestCase):
def test_something(self):
pass
class TestTwo:
def __repr__(self):
return 'TestTwo'
def test_whatever(self):
pass
|
tjcunliffe/mirage | refs/heads/master | stubo/static/cmds/tests/multidate/response.py | 8 | from stubo.ext.xmlutils import XPathValue
from stubo.ext.xmlexit import XMLManglerExit
# exit that rolls response dates
def roll_dt(date_str):
date_str = date_str.strip()
# roll date part of string
return "{{% raw roll_date('{0}', as_date({1}), as_date({2})) %}}".format(
... |
vdeluca/tfi | refs/heads/tfi | geonode/people/enumerations.py | 35 | # -*- coding: utf-8 -*-
#########################################################################
#
# Copyright (C) 2012 OpenPlans
#
# 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 versio... |
tgquintela/Mscthesis | refs/heads/master | script_standarization.py | 1 |
import warnings
with warnings.catch_warnings():
warnings.simplefilter("ignore")
import numpy as np
from FirmsLocations.Preprocess.firms_preprocessor import Firms_Standarization
from FirmsLocations.Computers.precomputers import PrecomputerCollection
## Pathpameters
# Set path parameters
execfile('set_pathparamet... |
hmoco/osf.io | refs/heads/develop | addons/forward/tests/test_views.py | 22 | import pytest
from nose.tools import assert_equal
from addons.forward.tests.utils import ForwardAddonTestCase
from tests.base import OsfTestCase
pytestmark = pytest.mark.django_db
class TestForwardLogs(ForwardAddonTestCase, OsfTestCase):
def setUp(self):
super(TestForwardLogs, self).setUp()
sel... |
abhishek-ch/hue | refs/heads/master | desktop/core/ext-py/tablib-0.10.0/tablib/packages/odf3/config.py | 56 | # -*- coding: utf-8 -*-
# Copyright (C) 2006-2007 Søren Roug, European Environment Agency
#
# 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
# version 2.1 of the License, or (at you... |
TedaLIEz/sentry | refs/heads/master | src/sentry/api/endpoints/helppage_index.py | 14 | from __future__ import absolute_import
from rest_framework.response import Response
from sentry.api.base import Endpoint
from sentry.api.serializers import serialize
from sentry.models import HelpPage
class HelpPageIndexEndpoint(Endpoint):
permission_classes = ()
def get(self, request):
pages = sor... |
ghickman/django | refs/heads/master | django/core/paginator.py | 347 | import collections
from math import ceil
from django.utils import six
class InvalidPage(Exception):
pass
class PageNotAnInteger(InvalidPage):
pass
class EmptyPage(InvalidPage):
pass
class Paginator(object):
def __init__(self, object_list, per_page, orphans=0,
allow_empty_first... |
DataDog/integrations-core | refs/heads/master | datadog_checks_base/datadog_checks/base/utils/headers.py | 1 | # (C) Datadog, Inc. 2018-present
# All rights reserved
# Licensed under a 3-clause BSD style license (see LICENSE)
from collections import OrderedDict
from six import iteritems
try:
import datadog_agent
except ImportError:
from ..stubs import datadog_agent
def _get_common_headers():
return OrderedDict(
... |
AutorestCI/azure-sdk-for-python | refs/heads/master | azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/application_gateway_backend_http_settings.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 ... |
IKholopov/HackUPC2017 | refs/heads/master | hackupc/env/lib/python3.5/site-packages/social_core/pipeline/disconnect.py | 4 | from ..exceptions import NotAllowedToDisconnect
def allowed_to_disconnect(strategy, user, name, user_storage,
association_id=None, *args, **kwargs):
if not user_storage.allowed_to_disconnect(user, name, association_id):
raise NotAllowedToDisconnect()
def get_entries(strategy, u... |
thelazier/electrumx | refs/heads/master | electrumx/server/controller.py | 1 | # Copyright (c) 2016-2018, Neil Booth
#
# All rights reserved.
#
# See the file "LICENCE" for information about the copyright
# and warranty status of this software.
from asyncio import Event
from aiorpcx import _version as aiorpcx_version, TaskGroup
import electrumx
from electrumx.lib.server_base import ServerBase
... |
noobcoderT/ryu-3.21 | refs/heads/master | ryu/tests/mininet/l2/vlan/test_vlan.py | 63 | # Copyright (C) 2012 Nippon Telegraph and Telephone Corporation.
#
# 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 appli... |
savanu/servo | refs/heads/master | tests/wpt/web-platform-tests/tools/lint/fnmatch.py | 135 | from __future__ import absolute_import
import fnmatch as _stdlib_fnmatch
import os
__all__ = ["fnmatch", "fnmatchcase", "filter", "translate"]
def fnmatch(name, pat):
name = os.path.normcase(name)
pat = os.path.normcase(pat)
return fnmatchcase(name, pat)
def fnmatchcase(name, pat):
if '?' not in ... |
kaze/paasmaker | refs/heads/master | paasmaker/common/api/noderegister.py | 2 | #
# Paasmaker - Platform as a Service
#
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
#
import logging
import time
import paasmaker
from apirequest import APIRequest... |
Tejal011089/digitales_erpnext | refs/heads/develop | erpnext/stock/doctype/item_tax/__init__.py | 37694 | from __future__ import unicode_literals
|
saurabh6790/med_new_app | refs/heads/develop | stock/doctype/price_list/__init__.py | 37694 | from __future__ import unicode_literals
|
timeyyy/PyUpdater | refs/heads/master | pyupdater/vendor/PyInstaller/hooks/hook-pywinauto.tests.py | 10 | #-----------------------------------------------------------------------------
# Copyright (c) 2013, PyInstaller Development Team.
#
# Distributed under the terms of the GNU General Public License with exception
# for distributing bootloader.
#
# The full license is in the file COPYING.txt, distributed with this softwa... |
idea4bsd/idea4bsd | refs/heads/idea4bsd-master | python/lib/Lib/atexit.py | 104 | """
atexit.py - allow programmer to define multiple exit functions to be executed
upon normal program termination.
One public function, register, is defined.
"""
__all__ = ["register"]
import sys
_exithandlers = []
def _run_exitfuncs():
"""run any registered exit functions
_exithandlers is traversed in rev... |
YinYanfei/CadalWorkspace | refs/heads/master | thrift/src/thrift-0.8.0/lib/py/src/Thrift.py | 62 | #
# 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... |
837468220/python-for-android | refs/heads/master | python3-alpha/python3-src/Lib/tkinter/test/test_ttk/test_functions.py | 45 | # -*- encoding: utf-8 -*-
import unittest
from tkinter import ttk
class MockTclObj(object):
typename = 'test'
def __init__(self, val):
self.val = val
def __str__(self):
return str(self.val)
class MockStateSpec(object):
typename = 'StateSpec'
def __init__(self, *args):
s... |
Fafa87/EP | refs/heads/master | tests/test_utils.py | 1 | import unittest
from ep.evalplatform.utils import *
class TestSlices(unittest.TestCase):
def test_slice_intersect_inclusion(self):
s1 = (slice(0, 10), slice(15, 17))
s2 = (slice(0, 10), slice(15, 17))
self.assertEqual(s1, slices_intersection(s1, s2))
s2 = (slice(0, 15), slice(15,... |
xgfone/snippet | refs/heads/master | snippet/example/python/sqlalchemy-orm-example.py | 1 | # encoding: utf8
from __future__ import print_function
from sqlalchemy.orm import sessionmaker
from sqlalchemy import create_engine, Column, Integer, String
from sqlalchemy.ext.declarative import declarative_base
Base = declarative_base()
class User(Base):
__tablename__ = 'users'
id = Column(Integer, prima... |
andymckay/addons-server | refs/heads/master | src/olympia/migrations/800-generate-random-passwords.py | 31 | import string
from users.models import UserProfile
allowed_chars = string.ascii_letters + string.digits
make_password = UserProfile.objects.make_random_password
for user in UserProfile.objects.filter(password=""):
user.set_password(make_password(length=50, allowed_chars=allowed_chars))
user.notes = 'bug1035... |
mosbasik/buzhug | refs/heads/master | javasrc/lib/Jython/Lib/encodings/cp1251.py | 593 | """ Python Character Mapping Codec cp1251 generated from 'MAPPINGS/VENDORS/MICSFT/WINDOWS/CP1251.TXT' with gencodec.py.
"""#"
import codecs
### Codec APIs
class Codec(codecs.Codec):
def encode(self,input,errors='strict'):
return codecs.charmap_encode(input,errors,encoding_table)
def decode(self,in... |
squarewave24/rafalbuch.com | refs/heads/master | node_modules/grunt-docker/node_modules/docker/node_modules/pygmentize-bundled/vendor/pygments/build-2.7/pygments/lexers/_robotframeworklexer.py | 198 | # -*- coding: utf-8 -*-
"""
pygments.lexers._robotframeworklexer
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Lexer for Robot Framework.
:copyright: Copyright 2006-2013 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
# Copyright 2012 Nokia Siemens Networks Oyj
#
# License... |
dkarakats/edx-platform | refs/heads/master | lms/djangoapps/courseware/tests/test_microsites.py | 13 | """
Tests related to the Microsites feature
"""
from django.conf import settings
from django.core.urlresolvers import reverse
from django.test.utils import override_settings
from courseware.tests.helpers import LoginEnrollmentTestCase
from course_modes.models import CourseMode
from xmodule.course_module import (
C... |
bguillot/OpenUpgrade | refs/heads/master | addons/auth_signup/__init__.py | 446 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2012-today OpenERP SA (<http://www.openerp.com>)
#
# This program is free software: you can redistribute it and/or modify
# it under the terms o... |
J861449197/edx-platform | refs/heads/master | common/djangoapps/request_cache/middleware.py | 98 | import threading
class _RequestCache(threading.local):
"""
A thread-local for storing the per-request cache.
"""
def __init__(self):
super(_RequestCache, self).__init__()
self.data = {}
self.request = None
REQUEST_CACHE = _RequestCache()
class RequestCache(object):
@cla... |
fabioz/PyDev.Debugger | refs/heads/master | _pydevd_bundle/pydevd_timeout.py | 2 | from _pydev_imps._pydev_saved_modules import threading
from _pydevd_bundle.pydevd_daemon_thread import PyDBDaemonThread
from _pydevd_bundle.pydevd_constants import thread_get_ident, IS_CPYTHON, NULL
import ctypes
import time
from _pydev_bundle import pydev_log
import weakref
from _pydevd_bundle.pydevd_utils import is_c... |
venomJ/AndroidViewClient | refs/heads/master | setup.py | 3 | #!/usr/bin/env python
from setuptools import setup, find_packages
setup(name='androidviewclient',
version='10.7.5',
description='''AndroidViewClient is a 100% pure python library and tools
that simplifies test script creation providing higher level
operations and the ability of obtaining the t... |
onceuponatimeforever/oh-mainline | refs/heads/master | vendor/packages/twisted/twisted/protocols/gps/rockwell.py | 37 | # Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
"""Rockwell Semiconductor Zodiac Serial Protocol
Coded from official protocol specs (Order No. GPS-25, 09/24/1996, Revision 11)
Maintainer: Bob Ippolito
The following Rockwell Zodiac messages are currently understood::
EARTHA\\r\\n (a hack... |
misterdanb/micropython | refs/heads/master | tests/extmod/uctypes_le_float.py | 18 | import uctypes
desc = {
"f32": uctypes.FLOAT32 | 0,
"f64": uctypes.FLOAT64 | 0,
"uf64": uctypes.FLOAT64 | 2, # unaligned
}
data = bytearray(10)
S = uctypes.struct(uctypes.addressof(data), desc, uctypes.LITTLE_ENDIAN)
S.f32 = 12.34
print('%.4f' % S.f32)
S.f64 = 12.34
print('%.4f' % S.f64)
S.uf64 = 12.3... |
7anner/grpc | refs/heads/master | src/python/grpcio_tests/tests/reflection/_reflection_servicer_test.py | 13 | # Copyright 2016, 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... |
batxes/4Cin | refs/heads/master | Six_mouse_models/Six_mouse_models_final_output_0.2_-0.1_11000/Six_mouse_models24115.py | 4 | import _surface
import chimera
try:
import chimera.runCommand
except:
pass
from VolumePath import markerset as ms
try:
from VolumePath import Marker_Set, Link
new_marker_set=Marker_Set
except:
from VolumePath import volume_path_dialog
d= volume_path_dialog(True)
new_marker_set= d.new_marker_set
marker_set... |
mastizada/kuma | refs/heads/master | vendor/packages/pylint/test/unittest_pyreverse_writer.py | 6 | # Copyright (c) 2000-2008 LOGILAB S.A. (Paris, FRANCE).
# http://www.logilab.fr/ -- mailto:contact@logilab.fr
#
# 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, o... |
glaubitz/fs-uae-debian | refs/heads/master | arcade/OpenGL/GLX/NV/float_buffer.py | 8 | '''OpenGL extension NV.float_buffer
This module customises the behaviour of the
OpenGL.raw.GLX.NV.float_buffer to provide a more
Python-friendly API
Overview (from the spec)
This extension builds upon NV_fragment_program to provide a framebuffer
and texture format that allows fragment programs to read and write... |
willemneal/Docky | refs/heads/master | bin/lib/itsdangerous.py | 296 | # -*- coding: utf-8 -*-
"""
itsdangerous
~~~~~~~~~~~~
A module that implements various functions to deal with untrusted
sources. Mainly useful for web applications.
:copyright: (c) 2011 by Armin Ronacher and the Django Software Foundation.
:license: BSD, see LICENSE for more details.
"""
imp... |
rdeheele/odoo | refs/heads/master | addons/l10n_vn/__init__.py | 425 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# This module is Copyright (c) 2009-2013 General Solutions (http://gscom.vn) All Rights Reserved.
#
# This program is free software: you can redistribute it and/or... |
alimony/django | refs/heads/master | tests/prefetch_related/test_prefetch_related_objects.py | 61 | from django.db.models import Prefetch, prefetch_related_objects
from django.test import TestCase
from .models import Author, Book, Reader
class PrefetchRelatedObjectsTests(TestCase):
"""
Since prefetch_related_objects() is just the inner part of
prefetch_related(), only do basic tests to ensure its API h... |
justyns/home-assistant | refs/heads/dev | homeassistant/components/arduino.py | 4 | """
Support for Arduino boards running with the Firmata firmware.
For more details about this component, please refer to the documentation at
https://home-assistant.io/components/arduino/
"""
import logging
from homeassistant.const import (
EVENT_HOMEASSISTANT_START, EVENT_HOMEASSISTANT_STOP)
from homeassistant.h... |
xq262144/hue | refs/heads/master | desktop/core/ext-py/Django-1.6.10/docs/_ext/applyxrefs.py | 132 | """Adds xref targets to the top of files."""
import sys
import os
testing = False
DONT_TOUCH = (
'./index.txt',
)
def target_name(fn):
if fn.endswith('.txt'):
fn = fn[:-4]
return '_' + fn.lstrip('./').replace('/', '-')
def process_file(fn, lines):
lines.insert(0, '\n')
lines... |
ronbelson/ghost-proxy-hebrew | refs/heads/master | node_modules/latest/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/input.py | 68 | # 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.
from compiler.ast import Const
from compiler.ast import Dict
from compiler.ast import Discard
from compiler.ast import List
from compiler.ast import Module
from co... |
chaosmaker/pyload | refs/heads/stable | module/plugins/Plugin.py | 39 | # -*- coding: utf-8 -*-
"""
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3 of the License,
or (at your option) any later version.
This program is distributed in... |
BeATz-UnKNoWN/python-for-android | refs/heads/master | python3-alpha/python3-src/Lib/test/test_warnings.py | 54 | from contextlib import contextmanager
import linecache
import os
from io import StringIO
import sys
import unittest
import subprocess
from test import support
from test.script_helper import assert_python_ok
from test import warning_tests
import warnings as original_warnings
py_warnings = support.import_fresh_module(... |
kubaszostak/gdal-dragndrop | refs/heads/master | osgeo/apps/Python27/Lib/site-packages/numpy/lib/index_tricks.py | 3 | from __future__ import division, absolute_import, print_function
import functools
import sys
import math
import numpy.core.numeric as _nx
from numpy.core.numeric import (
asarray, ScalarType, array, alltrue, cumprod, arange, ndim
)
from numpy.core.numerictypes import find_common_type, issubdtype
import numpy... |
nimiq/moogle-project | refs/heads/master | moogle/accounts/admin.py | 13848 | from django.contrib import admin
# Register your models here.
|
Shiroy/servo | refs/heads/master | tests/wpt/web-platform-tests/tools/pytest/testing/test_parseopt.py | 171 | from __future__ import with_statement
import sys
import os
import py, pytest
from _pytest import config as parseopt
@pytest.fixture
def parser():
return parseopt.Parser()
class TestParser:
def test_no_help_by_default(self, capsys):
parser = parseopt.Parser(usage="xyz")
pytest.raises(SystemExit... |
rudhir-upretee/SUMO_Src | refs/heads/master | tools/projects/TaxiFCD_Krieg/src/analysis/Taxi.py | 3 | # -*- coding: Latin-1 -*-
"""
@file CalcTime.py
@author Sascha Krieg
@author Daniel Krajzewicz
@author Michael Behrisch
@date 2008-04-17
Represents a single Taxi.
SUMO, Simulation of Urban MObility; see http://sumo.sourceforge.net/
Copyright (C) 2008-2012 DLR (http://www.dlr.de/) and contributors
All rights ... |
HewlettPackard/python-proliant-sdk | refs/heads/master | examples/Redfish/ex30_get_powermetrics_average.py | 1 | # Copyright 2016 Hewlett Packard Enterprise Development LP
#
# 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... |
linjoahow/w17test_1 | refs/heads/master | static/Brython3.1.0-20150301-090019/Lib/site-packages/pygame/colordict.py | 621 | ## pygame - Python Game Library
## Copyright (C) 2000-2003 Pete Shinners
##
## This library is free software; you can redistribute it and/or
## modify it under the terms of the GNU Library General Public
## License as published by the Free Software Foundation; either
## version 2 of the License, or (... |
Acidburn0zzz/support-tools | refs/heads/master | googlecode-issues-exporter/bitbucket_issue_converter_test.py | 51 | # 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 a... |
drorlab/dabble | refs/heads/master | test/runtests.py | 1 | #! /usr/bin/env python
# Hi There!
# You may be wondering what this giant blob of binary data here is, you might
# even be worried that we're up to something nefarious (good for you for being
# paranoid!). This is a base64 encoding of a zip file, this zip file contains
# a fully functional basic pytest script.
#
# Pyt... |
glennlive/gnuradio-wg-grc | refs/heads/master | gr-uhd/apps/uhd_app.py | 4 | #!/usr/bin/env python
#
# Copyright 2015-2016 Free Software Foundation, Inc.
#
# This file is part of GNU Radio
#
# GNU Radio 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, or (at your optio... |
armicron/django-allauth | refs/heads/master | allauth/socialaccount/providers/xing/views.py | 8 | import json
from allauth.socialaccount.providers.oauth.client import OAuth
from allauth.socialaccount.providers.oauth.views import (OAuthAdapter,
OAuthLoginView,
OAuthCallbackView)
from .provider import X... |
otherness-space/myProject | refs/heads/master | my_project_001/lib/python2.7/site-packages/django/contrib/gis/tests/layermap/models.py | 230 | from django.contrib.gis.db import models
class State(models.Model):
name = models.CharField(max_length=20)
objects = models.GeoManager()
class County(models.Model):
name = models.CharField(max_length=25)
state = models.ForeignKey(State)
mpoly = models.MultiPolygonField(srid=4269) # Multipolygon in... |
Jet-Streaming/gyp | refs/heads/master | build/lib/gyp/MSVSVersion.py | 6 | # 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.
"""Handle version information related to Visual Stuio."""
import errno
import os
import re
import subprocess
import sys
import gyp
import glob
cl... |
ArneBab/pypyjs | refs/heads/master | website/demo/home/rfk/repos/pypy/lib-python/2.7/test/win_console_handler.py | 134 | """Script used to test os.kill on Windows, for issue #1220212
This script is started as a subprocess in test_os and is used to test the
CTRL_C_EVENT and CTRL_BREAK_EVENT signals, which requires a custom handler
to be written into the kill target.
See http://msdn.microsoft.com/en-us/library/ms685049%28v=VS.85%29.aspx ... |
ptisserand/portage | refs/heads/master | pym/portage/dbapi/__init__.py | 3 | # Copyright 1998-2014 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
from __future__ import unicode_literals
__all__ = ["dbapi"]
import re
import portage
portage.proxy.lazyimport.lazyimport(globals(),
'portage.dbapi.dep_expand:dep_expand@_dep_expand',
'portage.dep:Atom,match_... |
StephenWeber/ansible | refs/heads/devel | lib/ansible/compat/selectors/__init__.py | 54 | # (c) 2014, 2017 Toshio Kuratomi <tkuratomi@ansible.com>
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any ... |
agry/NGECore2 | refs/heads/master | scripts/object/ship/player/player_tieadvanced_modified.py | 85615 | import sys
def setup(core, object):
return |
agry/NGECore2 | refs/heads/master | scripts/object/weapon/melee/special/vibroknuckler_static.py | 85615 | import sys
def setup(core, object):
return |
agry/NGECore2 | refs/heads/master | scripts/object/static/structure/tatooine/skeleton_krayt_head_style_02.py | 85615 | import sys
def setup(core, object):
return |
weigj/django-multidb | refs/heads/master | multidb_examples/test.py | 1 | # -*- coding: utf-8 -*-
from django.contrib.auth.models import User
print User.objects.count() |
koobs/dj-stripe | refs/heads/master | djstripe/__init__.py | 6 | from __future__ import unicode_literals
import warnings
from django import get_version as get_django_version
__title__ = "dj-stripe"
__summary__ = "Django + Stripe Made Easy"
__uri__ = "https://github.com/pydanny/dj-stripe/"
__version__ = "0.5.0"
__author__ = "Daniel Greenfeld"
__email__ = "pydanny@gmail.com"
__li... |
fzimmermann89/pyload | refs/heads/stable | module/plugins/hoster/EuroshareEu.py | 1 | # -*- coding: utf-8 -*-
import re
from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo
class EuroshareEu(SimpleHoster):
__name__ = "EuroshareEu"
__type__ = "hoster"
__version__ = "0.35"
__status__ = "testing"
__pattern__ = r'http://(?:www\.)?euroshare\.(eu|sk|cz|... |
hackebrot/cookiecutter-django | refs/heads/master | {{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/users/migrations/0001_initial.py | 52 | import django.contrib.auth.models
import django.contrib.auth.validators
from django.db import migrations, models
import django.utils.timezone
class Migration(migrations.Migration):
initial = True
dependencies = [
('auth', '0008_alter_user_username_max_length'),
]
operations = [
migr... |
cbenhagen/kivy | refs/heads/master | examples/canvas/fbo_canvas.py | 59 | '''
FBO Canvas
==========
This demonstrates a layout using an FBO (Frame Buffer Off-screen)
instead of a plain canvas. You should see a black canvas with a
button labelled 'FBO' in the bottom left corner. Clicking it
animates the button moving right to left.
'''
__all__ = ('FboFloatLayout', )
from kivy.graphics impo... |
roisagiv/webrtc-ios | refs/heads/master | third_party/jsoncpp/test/pyjsontestrunner.py | 257 | # Simple implementation of a json test runner to run the test against json-py.
import sys
import os.path
import json
import types
if len(sys.argv) != 2:
print "Usage: %s input-json-file", sys.argv[0]
sys.exit(3)
input_path = sys.argv[1]
base_path = os.path.splitext(input_path)[0]
actual_path = base_path ... |
russellb/powerline | refs/heads/develop | tests/test_configuration.py | 15 | # vim:fileencoding=utf-8:noet
from __future__ import (unicode_literals, division, absolute_import, print_function)
import sys
import os
from functools import wraps
from copy import deepcopy
import tests.vim as vim_module
from tests import TestCase
from tests.lib.config_mock import get_powerline, get_powerline_raw, ... |
gx1997/chrome-loongson | refs/heads/master | chrome/test/functional/gpu.py | 9 | #!/usr/bin/env python
# Copyright (c) 2011 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import logging
import os
import pyauto_functional # Must be imported before pyauto
import pyauto
class GpuTest(pyauto.PyUITest)... |
ericholscher/django | refs/heads/master | tests/properties/models.py | 194 | """
22. Using properties on models
Use properties on models just like on any other Python object.
"""
from django.db import models
class Person(models.Model):
first_name = models.CharField(max_length=30)
last_name = models.CharField(max_length=30)
def _get_full_name(self):
return "%s %s" % (sel... |
damiancclarke/PhD | refs/heads/master | twins/source/twinTabs.py | 1 | # twinTabs.py v 0.0.0 damiancclarke yyyy-mm-dd:2014-03-29
#---|----1----|----2----|----3----|----4----|----5----|----6----|----7----|----8
#
from sys import argv
import re
import os
import locale
locale.setlocale(locale.LC_ALL, 'en_US.utf8')
script, ftype = argv
print('\n\nHey DCC. The script %... |
isogeo/isogeo-plugin-qgis | refs/heads/master | tests/dev/search_by_keyword/search_by_keyword.py | 1 | """
/***************************************************************************
Isogeo
-------------------
begin : 2019-07-08
git sha : $Format:%H$
copyright : (C) 2019 by Isogeo, Simon Sampere
email : ... |
xuev/vimrc | refs/heads/master | sources_non_forked/vim-snippets/pythonx/javascript_snippets.py | 62 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Helper utilities to format javascript snippets.
"""
ALWAYS = 'always'
NEVER = 'never'
def get_option(snip, option, default=None):
return snip.opt('g:ultisnips_javascript["{}"]'.format(option), default)
def semi(snip):
option = get_option(snip, 'semi', ALWAY... |
linan7788626/emcee | refs/heads/master | examples/ipython_parallel.py | 12 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
This example demonstrates how you can use emcee with IPython parallel for
distributed computation of your probability function. First, start up an
ipcluster in one terminal and then execute this file.
"""
from __future__ import division, print_function
import emcee
... |
dmccloskey/SBaaS_COBRA | refs/heads/master | SBaaS_COBRA/stage02_physiology_simulatedData_io.py | 1 | # System
import json
# SBaaS
from .stage02_physiology_simulatedData_query import stage02_physiology_simulatedData_query
from SBaaS_base.sbaas_template_io import sbaas_template_io
# Resources
from io_utilities.base_importData import base_importData
from io_utilities.base_exportData import base_exportData
class stage02_... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.