repo_name stringlengths 5 100 | ref stringlengths 12 67 | path stringlengths 4 244 | copies stringlengths 1 8 | content stringlengths 0 1.05M ⌀ |
|---|---|---|---|---|
totallybradical/temp_servo2 | refs/heads/master | python/tidy/servo_tidy_tests/lints/not_inherited.py | 105 | class Lint(object):
pass
|
zsl/CodeSample | refs/heads/master | cpp/lib_console_hot_key/consolecolor.py | 1 | #!/usr/bin/env python
#-*- coding:gbk -*-
u'''
@file consolecolor.py
@brief set console color
@author hulei
@version 1.0
@date 2012-08-25
@copyright 2012 Hulei. All rights reserved.
'''
import ctypes
import sys
_SetConsoleTextAttribute = ctypes.windll.kernel32.SetConsoleTextAttribute
_SetConsoleTextAttribu... |
stryder199/RyarkAssignments | refs/heads/master | Assignment2/ttt/ip_address/same_net_ABC_7.py | 1 | tuples = ('same_net_ABC_7','samenetworkornot', '128','$1','$1','$8', '129','10','$1','$8')
|
fenginx/django | refs/heads/master | tests/db_functions/comparison/test_cast.py | 26 | import datetime
import decimal
import unittest
from django.db import connection, models
from django.db.models import Avg
from django.db.models.expressions import Value
from django.db.models.functions import Cast
from django.test import (
TestCase, ignore_warnings, override_settings, skipUnlessDBFeature,
)
from ..... |
photoninger/ansible | refs/heads/devel | test/units/modules/network/aruba/aruba_module.py | 73 | # (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... |
gabrielsimas/selenium | refs/heads/master | py/selenium/selenium.py | 69 | # Licensed to the Software Freedom Conservancy (SFC) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The SFC licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not... |
nattee/cafe-grader-web | refs/heads/master | lib/assets/Lib/_dummy_thread.py | 14 | """Drop-in replacement for the thread module.
Meant to be used as a brain-dead substitute so that threaded code does
not need to be rewritten for when the thread module is not present.
Suggested usage is::
try:
import _thread
except ImportError:
import _dummy_thread as _thread
""... |
hmcmooc/muddx-platform | refs/heads/master | cms/djangoapps/contentstore/management/commands/course_id_clash.py | 29 | """
Script for finding all courses whose org/name pairs == other courses when ignoring case
"""
from django.core.management.base import BaseCommand
from xmodule.modulestore.django import modulestore
#
# To run from command line: ./manage.py cms --settings dev course_id_clash
#
class Command(BaseCommand):
"""
... |
pelson/numpy | refs/heads/master | numpy/f2py/use_rules.py | 48 | #!/usr/bin/env python
"""
Build 'use others module data' mechanism for f2py2e.
Unfinished.
Copyright 2000 Pearu Peterson all rights reserved,
Pearu Peterson <pearu@ioc.ee>
Permission to use, modify, and distribute this software is given under the
terms of the NumPy License.
NO WARRANTY IS EXPRESSED OR IMPLIED. USE... |
shaneob/django_tutorial_blog_ng | refs/heads/master | blogengine/views.py | 1 | from django.shortcuts import render
from django.views.generic import ListView
from blogengine.models import Category, Post, Tag
from django.contrib.syndication.views import Feed
# Create your views here.
class CategoryListView(ListView):
def get_queryset(self):
slug = self.kwargs['slug']
try:
... |
ToqueWillot/M2DAC | refs/heads/master | RDFIA/codesTME3-4/learning/libsvm/python/svmutil.py | 13 | #!/usr/bin/env python
from svm import *
def svm_read_problem(data_file_name):
"""
svm_read_problem(data_file_name) -> [y, x]
Read LIBSVM-format data from data_file_name and return labels y
and data instances x.
"""
prob_y = []
prob_x = []
for line in open(data_file_name):
line = line.split(None, 1)
# In ... |
m0re4u/SmartLight | refs/heads/master | client/modules/always_on.py | 1 | def light_on(config):
return True, True, True
if __name__ == '__main__':
import yaml
with open('../config.yml') as f:
config = yaml.load(f)
print(light_on(config))
|
ibmjstart/bluemix-python-eve-sample | refs/heads/master | macreduce/tests/eve_docs_tests.py | 2 | #!/usr/bin/env python
"""Contains the Unit Tests for the REST Resources.
Contains the Unit Tests for exercising all provided
API Endpoints for the Python Eve REST Server
"""
import requests
__author__ = "Sanjay Joshi"
__copyright__ = "Copyright 2016 IBM"
__credits__ = ["Sanjay Joshi"]
__license__ = "Apache 2.0"
__ve... |
retrogradeorbit/Pigo | refs/heads/master | pigo/gfx/Tex.py | 1 |
from Texture import Texture
import weakref
class Tex:
"""A Tex is a window into a small part of a Texture. Successive Tex's can spell out an animation for a sprite to follow. Or a tex could have its offsets moved slowly over time to create special scaling and scrolling effects.
"""
def __init__(self,... |
samuto/Honeybee | refs/heads/master | src/Honeybee_open Pollination.py | 1 | # Open Pollination Website
#
# Honeybee: A Plugin for Environmental Analysis (GPL) started by Mostapha Sadeghipour Roudsari
#
# This file is part of Honeybee.
#
# Copyright (c) 2013-2015, Mostapha Sadeghipour Roudsari <Sadeghipour@gmail.com>
# Honeybee is free software; you can redistribute it and/or modify
# it un... |
shot/hadoop-source-reading | refs/heads/master | src/contrib/hod/testing/testHodCleanup.py | 182 | #Licensed to the Apache Software Foundation (ASF) under one
#or more contributor license agreements. See the NOTICE file
#distributed with this work for additional information
#regarding copyright ownership. The ASF licenses this file
#to you under the Apache License, Version 2.0 (the
#"License"); you may not use thi... |
sam-m888/addons-source | refs/heads/master | SetPrivacyTool/SetPrivacyTool.gpr.py | 1 | #
# Gramps - a GTK+/GNOME based genealogy program
#
# Copyright (C) 2019 Matthias Kemmer <matt.familienforschung@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... |
bbende/nifi | refs/heads/master | nifi-nar-bundles/nifi-scripting-bundle/nifi-scripting-processors/src/test/resources/jython/test_update_attribute.py | 37 | #! /usr/bin/python
#
# 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
# "Lic... |
ShinyROM/android_external_chromium_org | refs/heads/master | chrome/common/extensions/docs/server2/local_renderer.py | 26 | # Copyright 2013 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
from render_servlet import RenderServlet
from server_instance import ServerInstance
from servlet import Request
class _LocalRenderServletDelegate(object):
... |
Manojkumar91/odoo_inresto | refs/heads/master | addons/l10n_hn/__init__.py | 1 | # -*- encoding: utf-8 -*-
##############################################################################
#
# Copyright (c) 2009-2010 Salvatore J. Trimarchi <salvatore@trimarchi.co.cc>
# (http://salvatoreweb.co.cc)
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU G... |
lepricon49/headphones | refs/heads/master | lib/requests/packages/chardet/eucjpprober.py | 2918 | ######################## BEGIN LICENSE BLOCK ########################
# The Original Code is mozilla.org code.
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 1998
# the Initial Developer. All Rights Reserved.
#
# Con... |
ThiagoGarciaAlves/intellij-community | refs/heads/master | python/lib/Lib/site-packages/django/contrib/sessions/backends/__init__.py | 12133432 | |
paulproteus/oppia-test-3 | refs/heads/master | apps/widget/__init__.py | 12133432 | |
redhat-openstack/horizon | refs/heads/mitaka-patches | openstack_dashboard/contrib/developer/theme_preview/views.py | 20 | # Copyright 2015 Cisco Systems, 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 wr... |
javaos74/neutron | refs/heads/master | neutron/agent/linux/iptables_manager.py | 17 | # Copyright 2012 Locaweb.
# 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 appli... |
neumerance/deploy | refs/heads/master | .venv/lib/python2.7/site-packages/cinderclient/tests/v2/test_types.py | 3 | # Copyright (c) 2013 OpenStack, LLC.
#
# 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 req... |
liangwang/m5 | refs/heads/master | ext/ply/test/lex_token3.py | 174 | # lex_token3.py
#
# tokens is right type, but is missing a token for one rule
import sys
if ".." not in sys.path: sys.path.insert(0,"..")
import ply.lex as lex
tokens = [
"PLUS",
"NUMBER",
]
t_PLUS = r'\+'
t_MINUS = r'-'
t_NUMBER = r'\d+'
def t_error(t):
pass
lex.lex()
|
sinkuri256/python-for-android | refs/heads/master | python-build/python-libs/gdata/src/gdata/Crypto/Util/number.py | 232 | #
# number.py : Number-theoretic functions
#
# Part of the Python Cryptography Toolkit
#
# Distribute and use freely; there are no restrictions on further
# dissemination and usage except those imposed by the laws of your
# country of residence. This software is provided "as is" without
# warranty of fitness for us... |
shashisp/blumix-webpy | refs/heads/master | app/applications/welcome/languages/fr-ca.py | 163 | # coding: utf8
{
'!langcode!': 'fr-ca',
'!langname!': 'Français (Canadien)',
'"update" is an optional expression like "field1=\'newvalue\'". You cannot update or delete the results of a JOIN': '"update" est une expression optionnelle comme "champ1=\'nouvellevaleur\'". Vous ne pouvez mettre à jour ou supprimer les résul... |
joachimmetz/plaso | refs/heads/main | tests/parsers/cookie_plugins/ganalytics.py | 3 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""Tests for the Google Analytics cookies."""
import unittest
from plaso.lib import definitions
from plaso.parsers.cookie_plugins import ganalytics # pylint: disable=unused-import
from plaso.parsers.sqlite_plugins import chrome_cookies
from plaso.parsers.sqlite_plugins ... |
jiangyy/oiutils | refs/heads/master | oi/compile/compile.py | 2 | import argparse, tempfile, os, shutil
# compile should generate "a.exe" on the same directory
def compile_cmd(options, src):
ext = src.split('.')[-1] # cpp
opt = ' '.join(options)
if ext == 'cpp':
return 'g++ %s -o a.exe %s' % (opt, src)
elif ext == 'c':
return 'gcc %s -o a.exe... |
geerlingguy/ansible-for-devops | refs/heads/master | dynamic-inventory/custom/inventory.py | 1 | #!/usr/bin/env python3
'''
Example custom dynamic inventory script for Ansible, in Python.
'''
import os
import sys
import argparse
import json
class ExampleInventory(object):
def __init__(self):
self.inventory = {}
self.read_cli_args()
# Called with `--list`.
if self.args.list:... |
zhenzhai/edx-platform | refs/heads/master | cms/djangoapps/contentstore/views/tests/test_entrance_exam.py | 38 | """
Test module for Entrance Exams AJAX callback handler workflows
"""
import json
from mock import patch
from django.conf import settings
from django.contrib.auth.models import User
from django.test.client import RequestFactory
from contentstore.tests.utils import AjaxEnabledTestClient, CourseTestCase
from contentst... |
andrius-preimantas/partner-contact | refs/heads/8.0 | partner_address_street3/tests/__init__.py | 34 | # -*- coding: utf-8 -*-
##############################################################################
#
# Author: Nicolas Bessi
# Copyright 2014 Camptocamp SA
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# publi... |
leo23/seafile | refs/heads/master | python/seafile/__init__.py | 25 |
from rpcclient import SeafileRpcClient as RpcClient
from rpcclient import SeafileThreadedRpcClient as ThreadedRpcClient
from rpcclient import MonitorRpcClient as MonitorRpcClient
from rpcclient import SeafServerRpcClient as ServerRpcClient
from rpcclient import SeafServerThreadedRpcClient as ServerThreadedRpcClient
c... |
gchp/django | refs/heads/master | django/template/loaders/locmem.py | 464 | """
Wrapper for loading templates from a plain Python dict.
"""
import warnings
from django.template import Origin, TemplateDoesNotExist
from django.utils.deprecation import RemovedInDjango20Warning
from .base import Loader as BaseLoader
class Loader(BaseLoader):
def __init__(self, engine, templates_dict):
... |
blackbliss/callme | refs/heads/master | flask/lib/python2.7/site-packages/pip/commands/search.py | 344 | import sys
import textwrap
import pip.download
from pip.basecommand import Command, SUCCESS
from pip.util import get_terminal_size
from pip.log import logger
from pip.backwardcompat import xmlrpclib, reduce, cmp
from pip.exceptions import CommandError
from pip.status_codes import NO_MATCHES_FOUND
from pip._vendor imp... |
steakknife/ldns | refs/heads/master | contrib/python/examples/ldns-keygen.py | 8 | #!/usr/bin/python
#
# This example shows how to generate public/private key pair
#
import ldns
algorithm = ldns.LDNS_SIGN_DSA
bits = 512
ldns.ldns_init_random(open("/dev/urandom","rb"), (bits+7)//8)
domain = ldns.ldns_dname("example.")
#generate a new key
key = ldns.ldns_key.new_frm_algorithm(algorithm, bits);
prin... |
mkrupcale/ansible | refs/heads/devel | lib/ansible/modules/cloud/amazon/ec2_vpc_nacl.py | 11 | #!/usr/bin/python
# 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 distributed... |
SeedScientific/luigi | refs/heads/master | luigi/rpc.py | 10 | # -*- coding: utf-8 -*-
#
# Copyright 2012-2015 Spotify AB
#
# 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... |
atagar/ReviewBoard | refs/heads/master | reviewboard/scmtools/sshutils.py | 3 | import logging
import os
import urlparse
from django.utils.translation import ugettext_lazy as _
import paramiko
from reviewboard.scmtools.errors import AuthenticationError, \
BadHostKeyError, SCMError, \
UnknownHostKeyError, \
... |
lgscofield/odoo | refs/heads/8.0 | addons/website/tests/__init__.py | 396 | # -*- coding: utf-8 -*-
import test_converter
import test_crawl
import test_ui
import test_views
|
martinspeleo/PaTOCalc | refs/heads/master | PaTOCalc/calc/migrations/0006_forminstance_form_generator.py | 1 | # -*- coding: utf-8 -*-
# Generated by Django 1.9.1 on 2016-01-31 09:26
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('calc', '0005_auto_20160130_1549'),
]
operations = [... |
indashnet/InDashNet.Open.UN2000 | refs/heads/master | android/external/chromium_org/tools/perf/measurements/smoothness.py | 23 | # Copyright (c) 2013 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
from metrics import loading
from metrics import smoothness
from metrics.gpu_rendering_stats import GpuRenderingStats
from telemetry.page import page_measu... |
tomas-mazak/taipan | refs/heads/master | taipan/tegakigtk/chartable.py | 1 | # -*- coding: utf-8 -*-
# Copyright (C) 2009 The Tegaki project contributors
#
# 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 v... |
dkodnik/Ant | refs/heads/master | addons/purchase_requisition/report/__init__.py | 64 | # -*- 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... |
julien6387/supvisors | refs/heads/master | supvisors/tests/test_options.py | 2 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# ======================================================================
# Copyright 2017 Julien LE CLEACH
#
# 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 Lic... |
gdub/django | refs/heads/master | django/contrib/gis/geos/__init__.py | 89 | """
The GeoDjango GEOS module. Please consult the GeoDjango documentation
for more details: https://docs.djangoproject.com/en/dev/ref/contrib/gis/geos/
"""
from .collections import ( # NOQA
GeometryCollection, MultiLineString, MultiPoint, MultiPolygon,
)
from .error import GEOSException, GEOSIndexError # NOQA
fr... |
mohierf/mod-webui | refs/heads/develop | module/submodules/helpdesk.py | 2 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# vim: ai ts=4 sts=4 et sw=4 nu
from shinken.log import logger
from .metamodule import MetaModule
class HelpdeskMetaModule(MetaModule):
# Only those functions are enough for an helpdesk module ...
_functions = ['get_ui_helpdesk_configuration']
_custom_log =... |
lbrtcoin/albertcoin | refs/heads/master | qa/rpc-tests/test_framework/mininode.py | 8 | #!/usr/bin/env python3
# Copyright (c) 2010 ArtForz -- public domain half-a-node
# Copyright (c) 2012 Jeff Garzik
# Copyright (c) 2010-2016 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
#
# mininode.p... |
TomConlin/dipper | refs/heads/master | tests/test_ucscbands.py | 2 | #!/usr/bin/env python3
import unittest
import logging
from tests.test_source import SourceTestCase
from dipper.sources.UCSCBands import UCSCBands
logging.basicConfig(level=logging.WARNING)
logger = logging.getLogger(__name__)
class UCSCBandsTestCase(SourceTestCase):
def setUp(self):
self.source = UCSC... |
dgilman/echobot | refs/heads/master | echobot/__init__.py | 1 | from .hipchat import HipchatClient
from .irc import IRCClient
from .server import EchoBotServer
|
wzhfy/spark | refs/heads/master | examples/src/main/python/als.py | 27 | #
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not us... |
nvoron23/socialite | refs/heads/master | jython/Lib/test/test_itertools.py | 10 | import unittest
from test import test_support
from itertools import *
from weakref import proxy
import sys
import operator
import random
def onearg(x):
'Test function of one argument'
return 2*x
def errfunc(*args):
'Test function that raises an error'
raise ValueError
def gen3():
'Non-restartable... |
dbhirko/ansible-modules-extras | refs/heads/devel | windows/__init__.py | 12133432 | |
sbalde/edx-platform | refs/heads/master | cms/lib/__init__.py | 12133432 | |
haldean/toolpath | refs/heads/master | include/re2/re2/unicode.py | 119 | # Copyright 2008 The RE2 Authors. All Rights Reserved.
# Use of this source code is governed by a BSD-style
# license that can be found in the LICENSE file.
"""Parser for Unicode data files (as distributed by unicode.org)."""
import os
import re
import urllib2
# Directory or URL where Unicode tables reside.
_UNICOD... |
hcsturix74/django | refs/heads/master | tests/syndication_tests/urls.py | 236 | from django.conf.urls import url
from . import feeds
urlpatterns = [
url(r'^syndication/rss2/$', feeds.TestRss2Feed()),
url(r'^syndication/rss2/guid_ispermalink_true/$',
feeds.TestRss2FeedWithGuidIsPermaLinkTrue()),
url(r'^syndication/rss2/guid_ispermalink_false/$',
feeds.TestRss2FeedWithG... |
haoyunfeix/crosswalk-test-suite | refs/heads/master | apptools/apptools-android-tests/apptools/manifest_package_id.py | 24 | #!/usr/bin/env python
#
# Copyright (c) 2015 Intel Corporation.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# * Redistributions of works must retain the original copyright notice, this
# list of conditions and t... |
udoyen/pythonlearning | refs/heads/master | 1-35/ex15-1.py | 1 | # Ask user for name of file to read content
print "Enter the name of file to read"
# Assign user input to variable
filename = raw_input('> ')
# Open file for reading and assign to variable 'myfile'
myfile = open(filename)
# Print name of file
print "Here's your file %r:" % filename
# Read file content and print to ... |
Xaxetrov/OSCAR | refs/heads/master | oscar/meta_action/train_unit.py | 1 | from oscar.util.selection import *
def train_unit(obs, building_id, action_train_id):
command_center = find_position(obs, building_id)
return [actions.FunctionCall(SELECT_POINT, [NEW_SELECTION, command_center]),
actions.FunctionCall(action_train_id, [NOT_QUEUED])]
|
bdero/edx-platform | refs/heads/master | common/djangoapps/contentserver/__init__.py | 12133432 | |
h4ck3rm1k3/pip | refs/heads/develop | tests/data/packages/LocalEnvironMarker/localenvironmarker/__init__.py | 12133432 | |
402231466/40223146 | refs/heads/master | static/Brython3.1.1-20150328-091302/Lib/site-packages/turtle.py | 619 | import math
from javascript import console
from browser import document, html
import _svg
_CFG = {"width" : 0.5, # Screen
"height" : 0.75,
"canvwidth" : 400,
"canvheight": 300,
"leftright": None,
"topbottom": None,
"mode": "standard", # TurtleScre... |
blackzw/openwrt_sdk_dev1 | refs/heads/master | staging_dir/host/lib/python2.7/idlelib/ZoomHeight.py | 150 | # Sample extension: zoom a window to maximum height
import re
import sys
from idlelib import macosxSupport
class ZoomHeight:
menudefs = [
('windows', [
('_Zoom Height', '<<zoom-height>>'),
])
]
def __init__(self, editwin):
self.editwin = editwin
def zoom_height... |
mattcaldwell/django-denorm | refs/heads/master | denorm/migrations/__init__.py | 12133432 | |
UXE/local-edx | refs/heads/master | lms/urls.py | 2 | from django.conf import settings
from django.conf.urls import patterns, include, url
from ratelimitbackend import admin
from django.conf.urls.static import static
import django.contrib.auth.views
from microsite_configuration import microsite
# Uncomment the next two lines to enable the admin:
if settings.DEBUG or set... |
350dotorg/Django | refs/heads/master | tests/regressiontests/custom_managers_regress/models.py | 93 | """
Regression tests for custom manager classes.
"""
from django.db import models
class RestrictedManager(models.Manager):
"""
A manager that filters out non-public instances.
"""
def get_query_set(self):
return super(RestrictedManager, self).get_query_set().filter(is_public=True)
class Relat... |
jeff-alves/Tera | refs/heads/master | game/message/unused/C_USER_AIM_TO.py | 1 | from util.tipo import tipo
class C_USER_AIM_TO(object):
def __init__(self, tracker, time, direction, opcode, data):
print(str(type(self)).split('.')[3]+'('+str(len(data))+'): '+ str(data.get_array_hex(1))[1:-1])
|
MrSurly/micropython-esp32 | refs/heads/esp32 | tests/basics/fun_error2.py | 18 | # test errors from bad function calls
try:
enumerate
except:
print("SKIP")
raise SystemExit
def test_exc(code, exc):
try:
exec(code)
print("no exception")
except exc:
print("right exception")
except:
print("wrong exception")
# function with keyword args not give... |
allthroughthenight/aces | refs/heads/master | web2py/gluon/packages/dal/tests/_adapt.py | 10 | import os
DEFAULT_URI = os.getenv('DB', 'sqlite:memory')
NOSQL = any([name in DEFAULT_URI for name in ("datastore", "mongodb", "imap")])
IS_IMAP = "imap" in DEFAULT_URI
IS_GAE = "datastore" in DEFAULT_URI
IS_MONGODB = "mongodb" in DEFAULT_URI
IS_POSTGRESQL = 'postgres' in DEFAULT_URI
IS_SQLITE = 'sqlite' in DEFAULT_UR... |
ampax/edx-platform-backup | refs/heads/live | common/test/acceptance/performance/test_lms_performance.py | 62 | """
Single page performance tests for LMS.
"""
from bok_choy.web_app_test import WebAppTest, with_cache
from ..pages.lms.auto_auth import AutoAuthPage
from ..pages.lms.courseware import CoursewarePage
from ..pages.lms.dashboard import DashboardPage
from ..pages.lms.course_info import CourseInfoPage
from ..pages.lms.log... |
rockstor/rockstor-core | refs/heads/master | src/rockstor/system/network.py | 2 | """
Copyright (c) 2012-2020 RockStor, Inc. <http://rockstor.com>
This file is part of RockStor.
RockStor 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 la... |
lowfatcomputing/amforth | refs/heads/master | core/devices/atmega165pa/device.py | 5 | # Partname: ATmega165PA
# generated automatically, do not edit
MCUREGS = {
'TCCR0A': '&68',
'TCCR0A_FOC0A': '$80',
'TCCR0A_WGM00': '$40',
'TCCR0A_COM0A': '$30',
'TCCR0A_WGM01': '$08',
'TCCR0A_CS0': '$07',
'TCNT0': '&70',
'OCR0A': '&71',
'TIMSK0': '&110',
'TIMSK0_OCIE0A': '$02',
'TIMSK0_TOIE0':... |
topxiaoke/myedx | refs/heads/master | common/lib/xmodule/xmodule/foldit_module.py | 56 | import logging
from lxml import etree
from pkg_resources import resource_string
from xmodule.editing_module import EditingDescriptor
from xmodule.x_module import XModule
from xmodule.xml_module import XmlDescriptor
from xblock.fields import Scope, Integer, String
from .fields import Date
from .util.duedate import get... |
myd7349/DiveIntoPython3Practices | refs/heads/master | chapter_10_Refactoring/roman8.5.py | 1 | # -*- coding: utf-8 -*-
# 2014-11-21T16:55+08:00
import re
import unittest
class OutOfRangeError(ValueError): pass
class NotIntegerError(ValueError): pass
class InvalidRomanNumeralError(ValueError): pass
roman_numeral_map = (('M', 1000),
('CM', 900),
('D', 500),
... |
llange/pynag | refs/heads/master | pynag/Utils/importer.py | 2 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
""" General Utilities from importing nagios objects. Currently .csv files are supported
Either execute this script standalone from the command line or use it as a python library like so:
>>> from pynag.Utils import importer
>>> pynag_objects = importer.import_from_csv_fil... |
jcoady9/python-for-android | refs/heads/master | python3-alpha/python3-src/Lib/distutils/tests/test_sdist.py | 46 | """Tests for distutils.command.sdist."""
import os
import tarfile
import unittest
import warnings
import zipfile
from os.path import join
from textwrap import dedent
from test.support import captured_stdout, check_warnings, run_unittest
from distutils.command.sdist import sdist, show_formats
from distutils.core impor... |
tuxfux-hlp-notes/python-batches | refs/heads/master | archieves/batch-62/files/myenv/lib/python2.7/site-packages/pip/wheel.py | 338 | """
Support for installing and building the "wheel" binary package format.
"""
from __future__ import absolute_import
import compileall
import csv
import errno
import functools
import hashlib
import logging
import os
import os.path
import re
import shutil
import stat
import sys
import tempfile
import warnings
from ba... |
NielsZeilemaker/incubator-airflow | refs/heads/master | airflow/hooks/hive_hooks.py | 22 | # -*- coding: utf-8 -*-
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
... |
skuda/client-python | refs/heads/master | kubernetes/client/models/v1_container.py | 1 | # coding: utf-8
"""
Kubernetes
No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
OpenAPI spec version: v1.6.1
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
from pprint import pformat
from six import iteritems
import re
... |
simongoffin/website_version | refs/heads/Multi_fonctionnel | addons/account/wizard/account_move_bank_reconcile.py | 385 | # -*- 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... |
chhans/tor-automation | refs/heads/master | classifier.py | 1 | import numpy as np
import math
i_d = 0
i_u = 1
i_pbd = 2
i_pbu = 3
i_b = 4
i_ibt = 5
class Classifier:
def __init__(self, label):
self.label = label
self.inter_burst_times = np.array([])
self.num_burst = np.array([])
self.per_burst_dn = np.array([])
self.per_burst_up = np.array([])
self.tot_cells_dn = n... |
legrosbuffle/or-tools | refs/heads/master | examples/tests/issue128.py | 7 | from ortools.constraint_solver import pywrapcp
def test_v0():
print 'test_v0'
solver = pywrapcp.Solver('')
# we have two tasks of durations 4 and 7
task1 = solver.FixedDurationIntervalVar(0, 5, 4, False, "task1")
task2 = solver.FixedDurationIntervalVar(0, 5, 7, False, "task2")
tasks = [task1, task2]
# ... |
VentureROM-L/android_external_skia | refs/heads/lollipop | tools/pyutils/gs_utils.py | 66 | #!/usr/bin/python
"""
Copyright 2014 Google Inc.
Use of this source code is governed by a BSD-style license that can be
found in the LICENSE file.
Utilities for accessing Google Cloud Storage.
TODO(epoger): move this into tools/utils for broader use?
"""
# System-level imports
import os
import posixpath
import sys... |
pomegranited/edx-platform | refs/heads/master | cms/djangoapps/contentstore/features/course-outline.py | 19 | # pylint: disable=missing-docstring
# pylint: disable=redefined-outer-name
from lettuce import world, step
from common import *
from nose.tools import assert_true, assert_false
from logging import getLogger
logger = getLogger(__name__)
@step(u'I have a course with no sections$')
def have_a_course(step):
world.c... |
bealdav/OpenUpgrade | refs/heads/8.0 | addons/account_chart/__openerp__.py | 119 | # -*- 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... |
agoose77/hivesystem | refs/heads/master | hiveguilib/PQt/__init__.py | 1 | from .PGenerator import PGenerator
from .PTree import PTree
from .PControllerGeneral import PControllerGeneral
from .PControllerBlock import PControllerBlock
from .PSpyderhive import PSpyderhive
from .TypeCompleter import TypeCompleter
from .AntennaFoldState import AntennaFoldState
|
motion2015/a3 | refs/heads/a3 | common/lib/sandbox-packages/eia.py | 193 | """
Standard resistor values.
Commonly used for verifying electronic components in circuit classes are
standard values, or conversely, for generating realistic component
values in parameterized problems. For details, see:
http://en.wikipedia.org/wiki/Electronic_color_code
"""
# pylint: disable=invalid-name
# r is st... |
pepeportela/edx-platform | refs/heads/master | lms/djangoapps/courseware/context_processor.py | 6 | """
This is the courseware context_processor module.
This is meant to simplify the process of sending user preferences (espec. time_zone and pref-lang)
to the templates without having to append every view file.
"""
import request_cache
from openedx.core.djangoapps.user_api.errors import UserAPIInternalError, UserNotF... |
GitHublong/hue | refs/heads/master | desktop/core/ext-py/Pygments-1.3.1/external/rst-directive.py | 47 | # -*- coding: utf-8 -*-
"""
The Pygments reStructuredText directive
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
This fragment is a Docutils_ 0.5 directive that renders source code
(to HTML only, currently) via Pygments.
To use it, adjust the options below and copy the code into a module
that you i... |
googleapis/googleapis-gen | refs/heads/master | google/cloud/asset/v1p7beta1/asset-v1p7beta1-py/google/cloud/asset_v1p7beta1/services/asset_service/transports/grpc_asyncio.py | 1 | # -*- coding: utf-8 -*-
# Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or... |
staujd02/Pi-RFID-Video-Player | refs/heads/master | source/guiComponents/tkinterImplementation.py | 1 | import Tkinter
import tkinter
class TkinterImplementation(object):
def begin(self, wrappedIdleImage):
self.root = tkinter.Tk()
self.root.overrideredirect(True)
self.root.geometry(
"{0}x{1}+0+0".format(self.root.winfo_screenwidth(), self.root.winfo_screenheight()))
self... |
VirtualMonitor/VirtualMonitor | refs/heads/master | src/VBox/Devices/Network/scripts/VBoxPortForwarding.py | 10 | #!/usr/bin/python
"""
Copyright (C) 2009-2012 Oracle Corporation
This file is part of VirtualBox Open Source Edition (OSE), as
available from http://www.virtualbox.org. This file is free software;
you can redistribute it and/or modify it under the terms of the GNU
General Public License (GPL) as published by the Free... |
joebowen/LogMyRocket_API | refs/heads/master | LogMyRocket/libraries/sys_packages/docutils/docutils/parsers/rst/roles.py | 108 | # $Id: roles.py 7514 2012-09-14 14:27:12Z milde $
# Author: Edward Loper <edloper@gradient.cis.upenn.edu>
# Copyright: This module has been placed in the public domain.
"""
This module defines standard interpreted text role functions, a registry for
interpreted text roles, and an API for adding to and retrieving from ... |
vladmm/intellij-community | refs/heads/master | python/testData/fillParagraph/string.py | 83 | p = "my new <caret>string blah blah blah ;j;dsjv sd;fj;dsjf;ds js;djgf ;jsg s;dgj; sjd;gj sd;gj ;sjg;j asdl j;sjdg; jasdgl j;sldjg ;jsd;gj " |
SoftwareMaven/django | refs/heads/master | django/conf/locale/id/formats.py | 504 | # -*- encoding: utf-8 -*-
# This file is distributed under the same license as the Django package.
#
from __future__ import unicode_literals
# The *_FORMAT strings use the Django date format syntax,
# see http://docs.djangoproject.com/en/dev/ref/templates/builtins/#date
DATE_FORMAT = 'j N Y'
DATETIME_FORMAT = "j N Y, ... |
Poles/Poles | refs/heads/master | platforms/windows/JsonCpp/scons-local-2.3.0/SCons/Tool/f03.py | 11 | """engine.SCons.Tool.f03
Tool-specific initialization for the generic Posix f03 Fortran compiler.
There normally shouldn't be any need to import this module directly.
It will usually be imported through the generic SCons.Tool.Tool()
selection method.
"""
#
# Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2... |
karlnapf/shogun | refs/heads/develop | examples/undocumented/python/so_multiclass.py | 4 | #!/usr/bin/env python
import numpy as np
def gen_data(num_classes,num_samples,dim):
np.random.seed(0)
covs = np.array([[[0., -1. ], [2.5, .7]],
[[3., -1.5], [1.2, .3]],
[[ 2, 0 ], [ .0, 1.5 ]]])
X = np.r_[np.dot(np.random.randn(num_samples, dim), covs[0]) + np.array([0, 10]),
np.dot(np.random.randn... |
seandavi/seqtools | refs/heads/master | SDST/__init__.py | 9480 | #
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.