repo_name stringlengths 5 100 | ref stringlengths 12 67 | path stringlengths 4 244 | copies stringlengths 1 8 | content stringlengths 0 1.05M ⌀ |
|---|---|---|---|---|
PyFilesystem/pyfilesystem | refs/heads/master | fs/tests/test_errors.py | 13 | # -*- encoding: utf-8 -*-
"""
fs.tests.test_errors: testcases for the fs error classes functions
"""
import unittest
import fs.tests
from fs.errors import *
import pickle
from fs.path import *
class TestErrorPickling(unittest.TestCase):
def test_pickling(self):
def assert_dump_load(e):
... |
aquinzi/tdf-actividades | refs/heads/master | _admin-scripts/jsontocsv(activities-name).py | 3 | '''
run where the files are
'''
import json
import os
final_file = "tipo,nombre,nombre_alt\n"
for root, subFolders, files in os.walk(os.getcwd()):
for filename in files:
filePath = os.path.join(root, filename)
if not filePath.endswith(".json") or filename.startswith("_"):
continue
print (" processi... |
Zerknechterer/pyload | refs/heads/stable | module/plugins/hoster/ShareonlineBiz.py | 1 | # -*- coding: utf-8 -*-
import re
import time
import urllib
import urlparse
from module.network.RequestFactory import getURL
from module.plugins.internal.ReCaptcha import ReCaptcha
from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo
class ShareonlineBiz(SimpleHoster):
__name__ = "Sh... |
rpmcpp/Audacity | refs/heads/master | lib-src/lv2/lv2/plugins/eg04-sampler.lv2/waflib/Tools/errcheck.py | 331 | #! /usr/bin/env python
# encoding: utf-8
# WARNING! Do not edit! http://waf.googlecode.com/git/docs/wafbook/single.html#_obtaining_the_waf_file
typos={'feature':'features','sources':'source','targets':'target','include':'includes','export_include':'export_includes','define':'defines','importpath':'includes','installpa... |
andreyshtamburg/pytest_training | refs/heads/master | test/test_del_group.py | 1 | from model.group import Group
def test_delete_first_group(app):
if app.group.count() == 0:
app.group.create(Group(name="test"))
old_group_count = app.group.get_group_list()
app.group.delete_first_group()
new_group_count = app.group.get_group_list()
assert len(old_group_count) - 1 == len(ne... |
deandunbar/html2bwml | refs/heads/master | venv/lib/python2.7/site-packages/django/template/debug.py | 42 | from django.template.base import Lexer, Parser, tag_re, NodeList, VariableNode, TemplateSyntaxError
from django.utils.encoding import force_text
from django.utils.html import conditional_escape
from django.utils.safestring import SafeData, EscapeData
from django.utils.formats import localize
from django.utils.timezone ... |
h00dy/rura | refs/heads/master | rura/documents/migrations/0001_initial.py | 1 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
]
operations = [
migrations.CreateModel(
name='Agreement',
fields=[
('id', models.AutoField(ve... |
tshrjn/courses | refs/heads/master | cs/udacity/cs101-intro-cs/code/lesson5/problem-set/involvement.py | 4 | # Dictionaries of Dictionaries (of Dictionaries)
# The next several questions concern the data structure below for keeping
# track of Udacity's courses (where all of the values are strings):
# { <hexamester>, { <class>: { <property>: <value>, ... },
# ... },
# ... }
# For ... |
TueVJ/sirmodel_notebook | refs/heads/master | helpers.py | 1 | import networkx as nx
import numpy as np
import pandas as pd
import random
import collections
def single_p_infection_history(
G, p, tau=4, initial_node=None, immunize=set(),
nodelist=None, iterations=1, samplesize=1):
N = G.number_of_nodes()
nodeset = set(G.nodes_iter())
immunize = immuniz... |
penfold42/hyperion.ng | refs/heads/master | assets/firmware/arduino/network_bridge/udpraw_serialadalight.py | 2 | #!/usr/bin/env python
#
# Simple UDP to Serial redirector.
# Author: https://github.com/penfold42
# raw udp packets to raw serial:
# python.exe udp_adalight.py -P 2801 COM4 115200
# raw udp packets to adalight serial protocol:
# python.exe udp_adalight.py -a -P 2801 COM4 115200
# Derived from: https://g... |
kholidfu/django | refs/heads/master | django/template/loaders/eggs.py | 302 | # Wrapper for loading templates from eggs via pkg_resources.resource_string.
from __future__ import unicode_literals
import warnings
from django.apps import apps
from django.template import Origin, TemplateDoesNotExist
from django.utils import six
from django.utils.deprecation import RemovedInDjango20Warning
from .b... |
mc-coal/mc-coal | refs/heads/master | lib/unidecode/x00d.py | 252 | data = (
'[?]', # 0x00
'[?]', # 0x01
'N', # 0x02
'H', # 0x03
'[?]', # 0x04
'a', # 0x05
'aa', # 0x06
'i', # 0x07
'ii', # 0x08
'u', # 0x09
'uu', # 0x0a
'R', # 0x0b
'L', # 0x0c
'[?]', # 0x0d
'e', # 0x0e
'ee', # 0x0f
'ai', # 0x10
'[?]', # 0x11
'o', # 0x12
'oo', # ... |
mengxn/tensorflow | refs/heads/master | tensorflow/contrib/linalg/python/kernel_tests/linear_operator_udvh_update_test.py | 15 | # 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 applica... |
ProjectSWGCore/NGECore2 | refs/heads/master | scripts/object/tangible/lair/pharple/lair_pharple_wasteland.py | 85615 | import sys
def setup(core, object):
return |
Telthor/cppDonorSimulation | refs/heads/master | donorTests/lib/googletest-master/googletest/scripts/upload.py | 2511 | #!/usr/bin/env python
#
# Copyright 2007 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law o... |
PaloAltoNetworks-BD/SplunkforPaloAltoNetworks | refs/heads/master | Splunk_TA_paloalto/bin/splunk_ta_paloalto/aob_py3/libpasteurize/fixes/fix_add_all_future_builtins.py | 11 | """
For the ``future`` package.
Adds this import line::
from builtins import (ascii, bytes, chr, dict, filter, hex, input,
int, list, map, next, object, oct, open, pow,
range, round, str, super, zip)
to a module, irrespective of whether each definition is used.... |
mtekel/digitalmarketplace-admin-frontend | refs/heads/master | app/main/__init__.py | 1 | from flask import Blueprint
main = Blueprint('main', __name__)
from . import errors
from .views import login, service_updates, services
@main.after_request
def add_cache_control(response):
response.cache_control.no_cache = True
return response
|
Yong-Lee/decode-Django | refs/heads/master | Django-1.5.1/django/core/serializers/python.py | 109 | """
A Python "serializer". Doesn't do much serializing per se -- just converts to
and from basic Python data types (lists, dicts, strings, etc.). Useful as a basis for
other serializers.
"""
from __future__ import unicode_literals
from django.conf import settings
from django.core.serializers import base
from django.db... |
adhish20/TwitterWithCassandra | refs/heads/master | twiss/lib/python2.7/site-packages/pkg_resources/__init__.py | 75 | """
Package resource API
--------------------
A resource is a logical file contained within a package, or a logical
subdirectory thereof. The package resource API expects resource names
to have their path parts separated with ``/``, *not* whatever the local
path separator is. Do not use os.path operations to manipul... |
pepeportela/edx-platform | refs/heads/master | lms/djangoapps/dashboard/models.py | 20 | """Models for dashboard application"""
import mongoengine
from xmodule.modulestore.mongoengine_fields import CourseKeyField
class CourseImportLog(mongoengine.Document):
"""Mongoengine model for git log"""
course_id = CourseKeyField(max_length=128)
# NOTE: this location is not a Location object but a pat... |
fumitoh/modelx | refs/heads/master | modelx/tests/core/reference/test_recalc_inherit.py | 1 | import modelx as mx
def test_overriden_refs():
m = mx.new_model()
base = mx.new_space("base")
sub = mx.new_space("sub", bases=base)
def foo(x):
return bar
base.new_cells(formula=foo)
m.bar = 2 # Add global ref
base.bar = 3 # Add base ref
asse... |
apache/airflow | refs/heads/main | airflow/security/__init__.py | 5130 | #
# 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... |
KimTaehee/eucalyptus | refs/heads/master | clc/eucadmin/eucadmin/deregisterrequest.py | 6 | # Copyright 2011-2012 Eucalyptus Systems, Inc.
#
# Redistribution and use of this software 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 ... |
paplorinc/intellij-community | refs/heads/master | python/testData/inspections/ReplaceExecComment.py | 70 | <warning descr="Statement seems to have no effect and can be replaced with function call to have effect">exec</warning><error descr="End of statement expected"> </error><warning descr="Statement seems to have no effect">1</warning> # <- doesn't work either |
celery/kombu | refs/heads/master | kombu/utils/eventio.py | 2 | """Selector Utilities."""
import errno
import math
import select as __select__
import sys
from numbers import Integral
from . import fileno
from .compat import detect_environment
__all__ = ('poll',)
_selectf = __select__.select
_selecterr = __select__.error
xpoll = getattr(__select__, 'poll', None)
epoll = getattr... |
sieveable/sieveable-tools | refs/heads/master | Play-Listing-Scraper/tests/playlistingscraper_test.py | 2 | #!/usr/bin/env python2
import json
import os
from types import *
import unittest
from playlistingscraper.playlistingscraper import PlayListingScraper
class PlayListingScrapwerTest(unittest.TestCase):
def setUp(self):
listing_parser = PlayListingScraper()
self.package_name = "com.google.android.yo... |
Cuuuurzel/KiPyCalc | refs/heads/master | sympy_old/core/expr.py | 1 | from core import C
from basic import Basic, Atom
from singleton import S
from evalf import EvalfMixin
from decorators import _sympifyit, call_highest_priority
from cache import cacheit
from compatibility import reduce
class Expr(Basic, EvalfMixin):
__slots__ = []
@property
def _diff_wrt(self):
"""... |
smkr/pyclipse | refs/heads/master | plugins/org.python.pydev.jython/Lib/xml/sax/drivers2/drv_javasax.py | 8 | """
SAX driver for the Java SAX parsers. Can only be used in Jython.
$Id: drv_javasax.py,v 1.5 2003/01/26 09:08:51 loewis Exp $
"""
# --- Initialization
version = "0.10"
revision = "$Revision: 1.5 $"
import string
from xml.sax import xmlreader, saxutils
from xml.sax.handler import feature_namespaces, feature_namesp... |
thedrow/django | refs/heads/master | tests/generic_views/test_list.py | 309 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
import datetime
from django.core.exceptions import ImproperlyConfigured
from django.test import TestCase, override_settings
from django.utils.encoding import force_str
from django.views.generic.base import View
from .models import Artist, Author, Book, ... |
bahamas10/Viridian | refs/heads/master | AmpacheTools/guifunctions.py | 1 | #!/usr/bin/env python
#
# Copyright (c) 2012, Dave Eddy <dave@daveeddy.com>
# 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
#... |
burlog/fastrpc | refs/heads/master | python/test/bool.py | 2 | from fastrpc import Boolean
import unittest
class BooleanTest(unittest.TestCase):
def test_comparable(self):
self.assertTrue(Boolean(True) == Boolean(True))
self.assertTrue(Boolean(False) == Boolean(False))
self.assertTrue(Boolean(True) != Boolean(False))
self.assertTrue(Boolean(Fa... |
LeanVel/TakeoutsTimelining | refs/heads/master | TasksParser.py | 1 | import json
import time
def parseTasks(tasksFile, begintimeframe = 0, endtimeframe = int(time.time())) :
tasksList = json.load(open(tasksFile, 'r'))
listOfTasks = []
try :
for tasks in tasksList["items"]:
taskListTitle= tasks["title"]
timeStamp = tasks["updated"]
... |
franosincic/edx-platform | refs/heads/master | docs/en_us/platform_api/source/docs_settings.py | 57 | """
This is the local_settings file for platform API doc.
"""
# Generate a SECRET_KEY for this build
from random import choice
characters = 'abcdefghijklmnopqrstuvwxyz0123456789!@#$%^&*(-_=+)'
SECRET_KEY = ''.join([choice(characters) for i in range(50)])
# for use in openedx/core/djangoapps/profile_images/images.py
P... |
captainpete/rethinkdb | refs/heads/next | external/v8_3.30.33.16/build/gyp/test/same-rule-output-file-name/gyptest-all.py | 342 | #!/usr/bin/env python
# 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.
"""
Tests the use of rules with the same output file name.
"""
import TestGyp
test = TestGyp.TestGyp()
test.run_gyp('subdirs.gyp', chdir=... |
J-Team/android_kernel_samsung_u8500 | refs/heads/3.0.101-OC | tools/perf/scripts/python/syscall-counts-by-pid.py | 11180 | # system call counts, by pid
# (c) 2010, Tom Zanussi <tzanussi@gmail.com>
# Licensed under the terms of the GNU GPL License version 2
#
# Displays system-wide system call totals, broken down by syscall.
# If a [comm] arg is specified, only syscalls called by [comm] are displayed.
import os, sys
sys.path.append(os.env... |
ListFranz/picamera | refs/heads/master | picamera/array.py | 3 | # vim: set et sw=4 sts=4 fileencoding=utf-8:
#
# Python camera library for the Rasperry-Pi camera module
# Copyright (c) 2013-2015 Dave Jones <dave@waveform.org.uk>
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# ... |
alhashash/odoo | refs/heads/master | addons/gamification/wizard/update_goal.py | 386 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2013 OpenERP SA (<http://www.openerp.com>)
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the ... |
treetrunk/Tuxemon | refs/heads/master | tests/interactive/test_save.py | 6 | """
from save.py
"""
if __name__ == "__main__":
saveFile = shelve.open('saves/slot2.save')
# Create save file
saveFile['game_variables'] = {"battle_won": "yes"}
saveFile['tile_pos'] = (1, 2)
saveFile['inventory'] = []
saveFile['current_map'] = "pallet_town-room.map"
saveFile['player_name'] ... |
clkao/grano | refs/heads/master | grano/views/files_api.py | 1 | from StringIO import StringIO
from flask import Blueprint, render_template, request, Response
from flask import redirect, make_response, send_file
from sqlalchemy import or_, and_
from sqlalchemy.orm import aliased
from grano.lib.serialisation import jsonify
from grano.lib.exc import BadRequest
from grano.lib.args im... |
Codefans-fan/odoo | refs/heads/8.0 | openerp/addons/test_inherit/__init__.py | 2074 | # -*- coding: utf-8 -*-
import models
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
seewindcn/tortoisehg | refs/heads/master | src/mercurial/i18n.py | 1 | # i18n.py - internationalization support for mercurial
#
# Copyright 2005, 2006 Matt Mackall <mpm@selenic.com>
#
# This software may be used and distributed according to the terms of the
# GNU General Public License version 2 or any later version.
from __future__ import absolute_import
import gettext as gettextmod
im... |
jab/lektor | refs/heads/master | lektor/admin/modules/common.py | 1 | import os
import posixpath
from flask import Blueprint, g, request, current_app
from werkzeug.utils import cached_property
bp = Blueprint('common', __name__)
class AdminContext(object):
def __init__(self):
self.admin_root = request.script_root
self.site_root = posixpath.dirname(self.admin_root... |
FHannes/intellij-community | refs/heads/master | python/lib/Lib/encodings/iso8859_8.py | 593 | """ Python Character Mapping Codec iso8859_8 generated from 'MAPPINGS/ISO8859/8859-8.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,input,errors='... |
jjscarafia/odoo | refs/heads/master | addons/account_sequence/account_sequence.py | 338 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>). All Rights Reserved
# $Id$
#
# This program is free software: you can redistribute it and/or modify
# ... |
av8ramit/tensorflow | refs/heads/master | tensorflow/contrib/learn/python/learn/estimators/rnn_common.py | 33 | # Copyright 2017 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... |
LLNL/spack | refs/heads/develop | var/spack/repos/builtin/packages/maven/package.py | 3 | # Copyright 2013-2020 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
from spack import *
class Maven(Package):
"""Apache Maven is a software project management and comprehension tool.""... |
itgb/opCloudRouter | refs/heads/master | qca/src/linux/arch/ia64/scripts/unwcheck.py | 13143 | #!/usr/bin/python
#
# Usage: unwcheck.py FILE
#
# This script checks the unwind info of each function in file FILE
# and verifies that the sum of the region-lengths matches the total
# length of the function.
#
# Based on a shell/awk script originally written by Harish Patil,
# which was converted to Perl by Matthew Ch... |
Maximilian-Reuter/SickRage | refs/heads/master | lib/sqlalchemy/event/registry.py | 77 | # event/registry.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
"""Provides managed registration services on behalf of :func:`.listen`
arguments.
B... |
shifter/grr | refs/heads/master | lib/checks/tests.py | 8 | #!/usr/bin/env python
"""GRR check tests.
This module loads and registers all the check tests.
"""
# These need to register plugins so,
# pylint: disable=unused-import,g-import-not-at-top
from grr.lib.checks import checks_test
from grr.lib.checks import checks_test_lib_test
from grr.lib.checks import filters_test
f... |
bennettp123/CouchPotatoServer | refs/heads/master | libs/requests/packages/urllib3/packages/ssl_match_hostname/__init__.py | 315 | try:
# Python 3.2+
from ssl import CertificateError, match_hostname
except ImportError:
try:
# Backport of the function from a pypi module
from backports.ssl_match_hostname import CertificateError, match_hostname
except ImportError:
# Our vendored copy
from _implementatio... |
azureplus/hue | refs/heads/master | desktop/core/ext-py/pysaml2-2.4.0/src/saml2/soap.py | 32 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
"""
Suppport for the client part of the SAML2.0 SOAP binding.
"""
import logging
from saml2 import create_class_from_element_tree
from saml2.samlp import NAMESPACE as SAMLP_NAMESPACE
from saml2.schema import soapenv
try:
from xml.etree import cElementTree as Elemen... |
levkar/odoo | refs/heads/10.0 | addons/hr/models/mail_alias.py | 21 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo import fields, models
class Alias(models.Model):
_inherit = 'mail.alias'
alias_contact = fields.Selection(selection_add=[('employees', 'Authenticated Employees')])
|
buxeasywork/django-rosetta | refs/heads/master | rosetta/poutil.py | 3 | import os, django
from django.conf import settings
from rosetta.conf import settings as rosetta_settings
from django.core.cache import cache
try:
set
except NameError:
from sets import Set as set # Python 2.3 fallback
def find_pos(lang, project_apps = True, django_apps = False, third_party_apps = False)... |
Workday/OpenFrame | refs/heads/master | tools/telemetry/third_party/webpagereplay/third_party/dns/opcode.py | 248 | # Copyright (C) 2001-2007, 2009, 2010 Nominum, Inc.
#
# Permission to use, copy, modify, and distribute this software and its
# documentation for any purpose with or without fee is hereby granted,
# provided that the above copyright notice and this permission notice
# appear in all copies.
#
# THE SOFTWARE IS PROVIDED ... |
swegener/libsigrokdecode | refs/heads/master | decoders/ir_nec/__init__.py | 3 | ##
## This file is part of the libsigrokdecode project.
##
## Copyright (C) 2014 Gump Yang <gump.yang@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 Lic... |
adrianmoisey/cptdevops | refs/heads/master | tests/test_templating.py | 148 | # -*- coding: utf-8 -*-
"""
tests.templating
~~~~~~~~~~~~~~~~
Template functionality
:copyright: (c) 2015 by Armin Ronacher.
:license: BSD, see LICENSE for more details.
"""
import pytest
import flask
import logging
from jinja2 import TemplateNotFound
def test_context_processing():
app = f... |
NewpTone/stacklab-nova | refs/heads/master | debian/python-nova/usr/share/pyshared/nova/tests/test_pipelib.py | 8 | # Copyright 2011 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 required b... |
Philippe12/external_chromium_org | refs/heads/kitkat | content/test/gpu/gpu_tests/webgl_conformance.py | 23 | # Copyright (c) 2012 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import json
import optparse
import os
import sys
import webgl_conformance_expectations
from telemetry import test as test_module
from telemetry.core imp... |
wooga/airflow | refs/heads/master | airflow/providers/apache/hive/operators/s3_to_hive.py | 1 | #
# 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... |
drcapulet/sentry | refs/heads/master | src/sentry/api/views/help_base.py | 10 | from __future__ import absolute_import
import re
import textwrap
from django.utils.importlib import import_module
from django.utils.text import slugify
from sentry.api.base import Endpoint
from sentry.constants import HTTP_METHODS
from sentry.web.frontend.base import BaseView
optional_group_matcher = re.compile(r'\... |
zenlambda/pip | refs/heads/develop | pip/_vendor/requests/structures.py | 1159 | # -*- coding: utf-8 -*-
"""
requests.structures
~~~~~~~~~~~~~~~~~~~
Data structures that power Requests.
"""
import collections
class CaseInsensitiveDict(collections.MutableMapping):
"""
A case-insensitive ``dict``-like object.
Implements all methods and operations of
``collections.MutableMapping... |
linktlh/Toontown-journey | refs/heads/master | toontown/fishing/BingoCardCell.py | 5 | from direct.fsm import FSM
from direct.gui.DirectGui import *
from pandac.PandaModules import *
from direct.directnotify import DirectNotifyGlobal
from direct.interval.IntervalGlobal import *
from toontown.toonbase import ToontownGlobals
from toontown.toonbase import TTLocalizer
from toontown.fishing import FishPhoto
f... |
amartinez-cg/OpenShadingLanguage | refs/heads/master | testsuite/gettextureinfo/run.py | 13 | #!/usr/bin/env python
# Simple test on a grid texture
command = testshade("-g 1 1 test")
# Construct a test specifically for odd data and pixel windows
command += oiiotool("--pattern checker 100x50+10+20 3 --fullsize 300x200+0+0 -o win.exr")
command += testshade("-g 1 1 --param filename win.exr --param date 0 test")... |
LukasWoodtli/DesignByContractPlusPlus | refs/heads/master | googletest/googletest/test/gtest_catch_exceptions_test.py | 2139 | #!/usr/bin/env python
#
# Copyright 2010 Google Inc. All Rights Reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list o... |
wenn/python_koans | refs/heads/master | python2/runner/mockable_test_result.py | 278 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import unittest
# Needed to stop unittest.TestResult itself getting Mocked out of existence,
# which is a problem when testing the helper classes! (It confuses the runner)
class MockableTestResult(unittest.TestResult):
pass |
Microsoft/PTVS | refs/heads/master | Python/Tests/TestData/Grammar/DecoratorsClassDef.py | 7 | @fob
class C: pass
@fob.oar
class C: pass
@fob(oar)
class C: pass
@fob
@oar
class C: pass |
isghe/cjdns | refs/heads/master | node_build/dependencies/libuv/build/gyp/test/msvs/external_builder/gyptest-all.py | 260 | #!/usr/bin/env python
# Copyright (c) 2013 Google Inc. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""
Verifies that msvs_external_builder being set will invoke the provided
msvs_external_builder_build_cmd and msvs_external_builder_clean_c... |
pleaseproject/python-for-android | refs/heads/master | python3-alpha/python3-src/Lib/distutils/tests/test_build_scripts.py | 53 | """Tests for distutils.command.build_scripts."""
import os
import unittest
from distutils.command.build_scripts import build_scripts
from distutils.core import Distribution
from distutils import sysconfig
from distutils.tests import support
from test.support import run_unittest
class BuildScriptsTestCase(support.T... |
jsha/letsencrypt | refs/heads/master | acme/acme/jose/util_test.py | 21 | """Tests for acme.jose.util."""
import functools
import unittest
import six
from acme import test_util
class ComparableX509Test(unittest.TestCase):
"""Tests for acme.jose.util.ComparableX509."""
def setUp(self):
# test_util.load_comparable_{csr,cert} return ComparableX509
self.req1 = test_u... |
evansd/django | refs/heads/master | tests/lookup/test_timefield.py | 115 | from django.test import TestCase
from .models import Alarm
class TimeFieldLookupTests(TestCase):
@classmethod
def setUpTestData(self):
# Create a few Alarms
self.al1 = Alarm.objects.create(desc='Early', time='05:30')
self.al2 = Alarm.objects.create(desc='Late', time='10:00')
... |
Slruh/Empous-Control-The-World | refs/heads/master | server/empous/api/models.py | 1 | from django.db import models
from empous.models import EmpousUser
import time
from django.db.models import signals
class Game(models.Model):
def __unicode__(self):
return str(self.id)
def serialized_filename(instance, filename):
return 'maps/%d-%f.em' % (instance.id,time.time())
def serialized_screenshot(ins... |
EntityFXCode/arsenalsuite | refs/heads/master | python/blur/examples/seqshot.py | 11 | #!/usr/bin/python
from PyQt4.QtCore import *
from PyQt4.QtGui import *
from blur.Stone import *
from blur.Classes import *
import sys
import re
import traceback
# First Create a Qt Application
app = QApplication(sys.argv)
# Load database config
if sys.platform=='win32':
initConfig("c:\\blur\\resin\\resin.ini")
else... |
linzeyang/metasearch | refs/heads/master | metasearch/entwebapi/views.py | 1 | # Create your views here.
import requests
class Item(object):
def __init__(self, item_dict):
self.title = item_dict["title"]
self.url = item_dict["url"]
self.displayurl = item_dict["displayurl"]
self.snippet = item_dict.get("snippet", "<i>No snippet available for this item.</i>")
... |
go-bears/nupic | refs/heads/master | tests/unit/nupic/research/inhibition_object_test.py | 35 | #!/usr/bin/env python
# ----------------------------------------------------------------------
# Numenta Platform for Intelligent Computing (NuPIC)
# Copyright (C) 2013, Numenta, Inc. Unless you have an agreement
# with Numenta, Inc., for a separate license for this software code, the
# following terms and conditions ... |
jwren/intellij-community | refs/heads/master | python/testData/refactoring/extractmethod/TryFinally.before.py | 83 | def foo(x):
<selection>try:
print(1)
finally:
pass</selection>
return x
|
byron1655/spider | refs/heads/master | mongodb_helper.py | 1 | # -*- coding: utf-8 -*-
__author__ = 'byron'
import time
from pymongo import Connection
from common import Common
class MongoDBHelper:
def __init__(self):
self._db = ""
self.connectMongoDb()
print self._db
def connectMongoDb(self):
conn = Connection("*", "*")
self._db ... |
muku42/bokeh | refs/heads/master | scripts/version_update.py | 42 | import os
import re
import sys
def check_input(new_ver):
""" Ensure that user input matches the format X.X.X """
pat = r'\d+.\d+.\d+'
if not re.match(pat, new_ver):
print("The new version must be in the format X.X.X (ex. '0.6.0')")
return True
def version_update(new_ver, file_array):
... |
koquantam/android_kernel_samsung_grandprimeve3g-CORE | refs/heads/cm-14.1 | tools/perf/util/setup.py | 2079 | #!/usr/bin/python2
from distutils.core import setup, Extension
from os import getenv
from distutils.command.build_ext import build_ext as _build_ext
from distutils.command.install_lib import install_lib as _install_lib
class build_ext(_build_ext):
def finalize_options(self):
_build_ext.finalize_optio... |
mikalstill/nova | refs/heads/master | nova/db/sqlalchemy/migrate_repo/versions/290_placeholder.py | 830 | # 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
# d... |
memex-explorer/image_space | refs/heads/master | imagespace_columbia/server/columbia_imagecontentsearch.py | 2 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
###############################################################################
# Copyright Kitware 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 ... |
swift-nav/peregrine | refs/heads/master | tests/test_iqgen_map_forms.py | 2 | # -*- coding: utf-8 -*-
# Copyright (C) 2016 Swift Navigation Inc.
#
# Contact: Pasi Miettinen <pasi.miettinen@exafore.com>
# This source is subject to the license found in the file 'LICENSE' which must
# be be distributed together with this source. All other rights reserved.
#
# THIS CODE AND INFORMATION IS PROVIDED "... |
nico01f/nifo.github.io | refs/heads/master | node_modules/grunt-docker/node_modules/docker/node_modules/pygmentize-bundled/vendor/pygments/build-2.7/pygments/cmdline.py | 269 | # -*- coding: utf-8 -*-
"""
pygments.cmdline
~~~~~~~~~~~~~~~~
Command line interface.
:copyright: Copyright 2006-2013 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
import sys
import getopt
from textwrap import dedent
from pygments import __version__, highlight
fro... |
abramhindle/UnnaturalCodeFork | refs/heads/master | python/testdata/launchpad/lib/lp/app/validators/url.py | 1 | # Copyright 2009-2011 Canonical Ltd. This software is licensed under the
# GNU Affero General Public License version 3 (see the file LICENSE).
__metaclass__ = type
__all__ = [
'builder_url_validator',
'valid_absolute_url',
'valid_builder_url',
'valid_webref',
'validate_url',
]
from textwrap ... |
fafhrd91/mdl | refs/heads/master | mdl/interfaces.py | 1 | from .interface import Interface
ANY = '*'
UNKNOW = object()
CATEGORY = 'mdl'
SENTINEL = object()
class IApplication(Interface):
"""Application"""
class IContext(Interface):
"""Transformation context"""
|
uberamd/NGECore2 | refs/heads/master | scripts/object/ship/blacksun_light_s02_tier2.py | 85615 | import sys
def setup(core, object):
return |
ProjectSWGCore/NGECore2 | refs/heads/master | scripts/object/mobile/peacewar_drennic_hunter_f_01.py | 85615 | import sys
def setup(core, object):
return |
amir-qayyum-khan/edx-platform | refs/heads/master | cms/djangoapps/contentstore/features/pages.py | 35 | # pylint: disable=missing-docstring
# pylint: disable=redefined-outer-name
# pylint: disable=unused-argument
from lettuce import world, step
from nose.tools import assert_equal, assert_in
CSS_FOR_TAB_ELEMENT = "li[data-tab-id='{0}'] input.toggle-checkbox"
@step(u'I go to the pages page$')
def go_to_static(step):
... |
vzhong/dashboard | refs/heads/master | tests/test_reporter.py | 1 | from dashboard.reporter import Reporter
import unittest
class TestReporter(unittest.TestCase):
def setUp(self):
self.r = Reporter()
def test_add(self):
self.r.add({'foo': 1, 'bar': 2})
self.assertListEqual(
[{'foo': 1, 'bar': 2}],
self.r.log
)
... |
StrellaGroup/erpnext | refs/heads/develop | erpnext/healthcare/doctype/lab_test_template/lab_test_template.py | 12 | # -*- coding: utf-8 -*-
# Copyright (c) 2015, ESS and contributors
# For license information, please see license.txt
from __future__ import unicode_literals
import frappe, json
from frappe.model.document import Document
from frappe import _
class LabTestTemplate(Document):
def on_update(self):
#Item and Price List... |
tarikkdiry/Flock | refs/heads/master | flask/lib/python2.7/site-packages/click/_textwrap.py | 282 | import textwrap
from contextlib import contextmanager
class TextWrapper(textwrap.TextWrapper):
def _handle_long_word(self, reversed_chunks, cur_line, cur_len, width):
space_left = max(width - cur_len, 1)
if self.break_long_words:
last = reversed_chunks[-1]
cut = last[:spa... |
w1ll1am23/home-assistant | refs/heads/dev | homeassistant/components/opensky/__init__.py | 36 | """The opensky component."""
|
sopier/django | refs/heads/master | django/db/backends/postgresql_psycopg2/creation.py | 465 | from ..postgresql.creation import * # NOQA
|
loono/loonospace | refs/heads/master | lib/flask/testsuite/test_apps/blueprintapp/apps/admin/__init__.py | 794 | from flask import Blueprint, render_template
admin = Blueprint('admin', __name__, url_prefix='/admin',
template_folder='templates',
static_folder='static')
@admin.route('/')
def index():
return render_template('admin/index.html')
@admin.route('/index2')
def index2():
ret... |
Beeblio/django | refs/heads/master | django/test/client.py | 1 | from __future__ import unicode_literals
import sys
import os
import re
import mimetypes
from copy import copy
from importlib import import_module
from io import BytesIO
from django.apps import apps
from django.conf import settings
from django.contrib.auth import authenticate, login, logout, get_user_model
from django... |
ccomb/OpenUpgrade | refs/heads/master | addons/account_anglo_saxon/__init__.py | 436 | ##############################################################################
#
# 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 the GNU Affero General Publ... |
chriskmanx/qmole | refs/heads/master | QMOLEDEV/boost_1_49_0/libs/python/test/wrapper_held_type.py | 46 | # Copyright David Abrahams 2005. Distributed under the Boost
# Software License, Version 1.0. (See accompanying
# file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
'''
>>> from wrapper_held_type_ext import *
>>> d = data()
>>> print d.id()
42
>>> do_nothing( d )
>>> print d.id()
42
>>> d = create_da... |
google-research/exoplanet-ml | refs/heads/master | exoplanet-ml/astrowavenet/trainer.py | 1 | # Copyright 2018 The Exoplanet ML Authors.
#
# 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 t... |
crazyskady/ai-game-python | refs/heads/master | Chapter08/setup.py | 1 | #!/usr/bin/env python
from distutils.core import setup, Extension
MOD = 'CCollision'
setup(name=MOD, ext_modules=[Extension(MOD, sources=['CCollision.c'])]) |
yinquan529/platform-external-chromium_org | refs/heads/master | content/test/gpu/gpu_tests/pixel.py | 23 | # Copyright (c) 2012 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
from datetime import datetime
import glob
import optparse
import os
import re
from telemetry import test
from telemetry.core import bitmap
from telemetry... |
oliverlee/sympy | refs/heads/master | sympy/diffgeom/tests/test_function_diffgeom_book.py | 102 | from sympy.diffgeom.rn import R2, R2_p, R2_r, R3_r
from sympy.diffgeom import intcurve_series, Differential, WedgeProduct
from sympy.core import symbols, Function, Derivative
from sympy.simplify import trigsimp, simplify
from sympy.functions import sqrt, atan2, sin, cos
from sympy.matrices import Matrix
# Most of the ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.