repo_name stringlengths 5 100 | ref stringlengths 12 67 | path stringlengths 4 244 | copies stringlengths 1 8 | content stringlengths 0 1.05M ⌀ |
|---|---|---|---|---|
ariabuckles/pyobjc-framework-Cocoa | refs/heads/master | PyObjCTest/test_nscachedimagerep.py | 3 | from PyObjCTools.TestSupport import *
from AppKit import *
class TestNSCachedImageRep (TestCase):
def testMethods(self):
self.assertArgIsBOOL(NSCachedImageRep.initWithSize_depth_separate_alpha_, 2)
self.assertArgIsBOOL(NSCachedImageRep.initWithSize_depth_separate_alpha_, 3)
if __name__ == "__main... |
andresriancho/django-axes | refs/heads/master | axes/views.py | 6027 | # Create your views here.
|
Einsteinish/PyTune3 | refs/heads/master | vendor/paypal/standard/ipn/tests/test_forms.py | 19 | from django.test import TestCase
from paypal.standard.forms import PayPalPaymentsForm
class PaymentsFormTest(TestCase):
def test_form_render(self):
f = PayPalPaymentsForm(initial={'business':'me@mybusiness.com',
'amount': '10.50',
... |
sktjdgns1189/android_kernel_samsung_jalteskt | refs/heads/cm-13.0 | Documentation/target/tcm_mod_builder.py | 4981 | #!/usr/bin/python
# The TCM v4 multi-protocol fabric module generation script for drivers/target/$NEW_MOD
#
# Copyright (c) 2010 Rising Tide Systems
# Copyright (c) 2010 Linux-iSCSI.org
#
# Author: nab@kernel.org
#
import os, sys
import subprocess as sub
import string
import re
import optparse
tcm_dir = ""
fabric_ops... |
IvIePhisto/EnhAtts | refs/heads/master | enhatts/__init__.py | 1 | # -*- coding: UTF-8 -*-
'''\
EnhAtts – Enhanced Attributes
=============================
This project implements *properties on steroids* called "fields" for Python 2
and 3 (tested with CPython 2.7 and 3.3 as well as PyPy 2). It is based on the
"Felder" (german for *fields*) concept of the doctoral thesis of Patrick... |
jonashaag/django-nonrel-nohistory | refs/heads/master | tests/regressiontests/admin_scripts/models.py | 119 | from django.db import models
class Article(models.Model):
headline = models.CharField(max_length=100, default='Default headline')
pub_date = models.DateTimeField()
def __unicode__(self):
return self.headline
class Meta:
ordering = ('-pub_date', 'headline')
|
kristavan/helpqueue | refs/heads/master | hq/hq/settings.py | 1 | """
Django settings for hq project.
Generated by 'django-admin startproject' using Django 1.10.6.
For more information on this file, see
https://docs.djangoproject.com/en/1.10/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.10/ref/settings/
"""
import os
# B... |
crafty78/ansible | refs/heads/devel | lib/ansible/modules/cloud/amazon/ec2_vpc_peer.py | 6 | #!/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... |
lancezlin/airflow | refs/heads/master | airflow/hooks/__init__.py | 5 | '''
Imports the hooks dynamically while keeping the package API clean,
abstracting the underlying modules
'''
from airflow.utils import import_module_attrs as _import_module_attrs
from airflow.hooks.base_hook import BaseHook as _BaseHook
_hooks = {
'hive_hooks': [
'HiveCliHook',
'HiveMetastoreHook'... |
grendel513/django-DefectDojo | refs/heads/master | cryptotest.py | 2 | import binascii, os
from Crypto.Cipher import AES
KEY = 'a0b8c7398c9363b3216ff1d001a1308e5f96a77dbf6bda2367f87519d80995fb'
IV = os.urandom(16)
def encrypt(key, iv, plaintext):
aes = AES.new(key, AES.MODE_CBC, iv, segment_size=128)
plaintext = _pad_string(plaintext)
encrypted_text = aes.encrypt(plaintext)... |
odahoda/noisicaa | refs/heads/master | noisicaa/builtin_nodes/control_track/model.py | 1 | #!/usr/bin/python3
# @begin:license
#
# Copyright (c) 2015-2019, Benjamin Niemann <pink@odahoda.de>
#
# 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 y... |
ojengwa/talk | refs/heads/master | venv/lib/python2.7/site-packages/django/core/mail/message.py | 43 | from __future__ import unicode_literals
import mimetypes
import os
import random
import sys
import time
from email import (charset as Charset, encoders as Encoders,
message_from_string, generator)
from email.message import Message
from email.mime.text import MIMEText
from email.mime.multipart import MIMEMultipart
... |
neutronpy/neutronpy | refs/heads/master | neutronpy/crystal/sample.py | 3 | # -*- coding: utf-8 -*-
r"""Sample class for e.g. Instrument class
"""
import numpy as np
from .lattice import Lattice
from .tools import gram_schmidt
class Sample(Lattice):
u"""Private class containing sample information.
Parameters
----------
a : float
Unit cell length in angstroms
b... |
zahanm/foodpedia | refs/heads/master | django/db/backends/postgresql/creation.py | 247 | from django.db.backends.creation import BaseDatabaseCreation
from django.db.backends.util import truncate_name
class DatabaseCreation(BaseDatabaseCreation):
# This dictionary maps Field objects to their associated PostgreSQL column
# types, as strings. Column-type strings can contain format strings; they'll
... |
wheerd/patternmatcher | refs/heads/master | tests/common.py | 1 | # -*- coding: utf-8 -*-
from matchpy.expressions.expressions import (
Arity, Operation, Symbol, Wildcard, SymbolWildcard, make_dot_variable, make_plus_variable, make_star_variable,
make_symbol_variable
)
from .utils import MockConstraint
class SpecialSymbol(Symbol):
pass
f = Operation.new('f', Arity.va... |
jennyzhang0215/incubator-mxnet | refs/heads/master | benchmark/python/sparse/util.py | 32 | # 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... |
Xeralux/tensorflow | refs/heads/master | tensorflow/python/training/sync_replicas_optimizer_test.py | 24 | # 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... |
klusark/android_external_chromium_org | refs/heads/cm-11.0 | third_party/closure_linter/closure_linter/fixjsstyle_test.py | 135 | #!/usr/bin/env python
#
# Copyright 2008 The Closure Linter 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
#... |
flwh/KK_mt6589_iq451 | refs/heads/master | prebuilts/python/darwin-x86/2.7.5/lib/python2.7/lib2to3/tests/test_main.py | 57 | # -*- coding: utf-8 -*-
import sys
import codecs
import logging
import os
import re
import shutil
import StringIO
import sys
import tempfile
import unittest
from lib2to3 import main
TEST_DATA_DIR = os.path.join(os.path.dirname(__file__), "data")
PY2_TEST_MODULE = os.path.join(TEST_DATA_DIR, "py2_test_grammar.py")
... |
mcolom/ipolDevel | refs/heads/master | ipol_demo/modules/blobs/errors.py | 1 | """
Blobs errors
"""
class IPOLBlobsTemplateError(Exception):
"""
IPOLBlobsTemplateError
"""
class IPOLBlobsThumbnailError(Exception):
"""
IPOLBlobsThumbnailError
"""
class IPOLBlobsDataBaseError(Exception):
"""
IPOLBlobsDataBaseError
"""
class IPOLRemoveDirError(Exception):
"... |
denyszamiatin/contacts | refs/heads/master | phones.py | 1 | import settings
class Contacts(object):
def __init__(self, serializer):
self.serializer = serializer
self.contacts = self.serializer.load()
def add_contact(self, name, phone):
if name in self.contacts:
raise KeyError('Name exists')
self.contacts[name] = phone
... |
0asa/scikit-learn | refs/heads/master | examples/feature_selection/feature_selection_pipeline.py | 342 | """
==================
Pipeline Anova SVM
==================
Simple usage of Pipeline that runs successively a univariate
feature selection with anova and then a C-SVM of the selected features.
"""
print(__doc__)
from sklearn import svm
from sklearn.datasets import samples_generator
from sklearn.feature_selection imp... |
lcrees/callchain | refs/heads/master | callchain/tests/mixins/man/reducing.py | 1 | # -*- coding: utf-8 -*-
'''reduce test mixins'''
from inspect import ismodule
from twoq.support import port
class MMathQMixin(object):
def test_max(self):
self._false_true_false(
self.qclass(1, 2, 4).max(), self.assertEqual, 4,
)
from stuf import stuf
stooges = [
... |
40023154/Finalexam_0627 | refs/heads/master | static/Brython3.1.1-20150328-091302/Lib/heapq.py | 628 | """Heap queue algorithm (a.k.a. priority queue).
Heaps are arrays for which a[k] <= a[2*k+1] and a[k] <= a[2*k+2] for
all k, counting elements from 0. For the sake of comparison,
non-existing elements are considered to be infinite. The interesting
property of a heap is that a[0] is always its smallest element.
Usag... |
MalloyPower/parsing-python | refs/heads/master | front-end/testsuite-python-lib/Python-3.3.0/Lib/test/test_call.py | 182 | import unittest
from test import support
# The test cases here cover several paths through the function calling
# code. They depend on the METH_XXX flag that is used to define a C
# function, which can't be verified from Python. If the METH_XXX decl
# for a C function changes, these tests may not cover the right pat... |
pymo/pymo | refs/heads/master | symbian/PythonForS60_1.9.6/module-repo/standard-modules/heapq.py | 91 | # -*- coding: Latin-1 -*-
"""Heap queue algorithm (a.k.a. priority queue).
Heaps are arrays for which a[k] <= a[2*k+1] and a[k] <= a[2*k+2] for
all k, counting elements from 0. For the sake of comparison,
non-existing elements are considered to be infinite. The interesting
property of a heap is that a[0] is always ... |
oinopion/django | refs/heads/master | tests/gis_tests/utils.py | 327 | from unittest import skip
from django.conf import settings
from django.db import DEFAULT_DB_ALIAS
def no_backend(test_func, backend):
"Use this decorator to disable test on specified backend."
if settings.DATABASES[DEFAULT_DB_ALIAS]['ENGINE'].rsplit('.')[-1] == backend:
@skip("This test is skipped on... |
Klaudit/phantomjs | refs/heads/master | src/qt/qtwebkit/Tools/Scripts/webkitpy/port/apple.py | 122 | # Copyright (C) 2011 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 ... |
benchisell/photostream-bc | refs/heads/master | flask/lib/python2.7/site-packages/migrate/changeset/__init__.py | 60 | """
This module extends SQLAlchemy and provides additional DDL [#]_
support.
.. [#] SQL Data Definition Language
"""
import re
import warnings
import sqlalchemy
from sqlalchemy import __version__ as _sa_version
warnings.simplefilter('always', DeprecationWarning)
_sa_version = tuple(int(re.match("\d+", x).g... |
nxnfufunezn/servo | refs/heads/master | tests/wpt/web-platform-tests/webdriver/element_state/properties.py | 142 | import os
import sys
import unittest
sys.path.insert(1, os.path.abspath(os.path.join(__file__, "../..")))
import base_test
class GetElementPropertiesTest(base_test.WebDriverBaseTest):
def test_get_element_text(self):
self.driver.get(self.webserver.where_is("element_state/res/elements_text.html"))
... |
jhamman/xarray | refs/heads/master | xarray/tests/test_dtypes.py | 2 | import numpy as np
import pytest
from xarray.core import dtypes
@pytest.mark.parametrize(
"args, expected",
[
([np.bool], np.bool),
([np.bool, np.string_], np.object_),
([np.float32, np.float64], np.float64),
([np.float32, np.string_], np.object_),
([np.unicode_, np.in... |
meteoswiss-mdr/precipattractor | refs/heads/master | pymodules/io_tools_attractor.py | 1 | #!/usr/bin/env python
'''
Module to perform various input/output operations on gif radar files and netCDF/CSV files containing the statistics of the attractor.
The module also provide functionality to generate filenames, etc
Documentation convention from https://github.com/numpy/numpy/blob/master/doc/HOWTO_DOCUMENT... |
supergis/micropython | refs/heads/master | tests/basics/continue.py | 118 | for i in range(4):
print('one', i)
if i > 2:
continue
print('two', i)
for i in range(4):
print('one', i)
if i < 2:
continue
print('two', i)
for i in [1, 2, 3, 4]:
if i == 3:
continue
print(i)
|
marchon/py-ECDSA | refs/heads/master | ecdsa/lib/util.py | 2 | from __future__ import division
import os
import math
import binascii
from hashlib import sha256
from . import der
from .curves import orderlen
from six import PY3, int2byte, b, next
# RFC5480:
# The "unrestricted" algorithm identifier is:
# id-ecPublicKey OBJECT IDENTIFIER ::= {
# iso(1) member-body(2) u... |
jounex/hue | refs/heads/master | apps/security/src/security/management/commands/__init__.py | 929 | # Licensed to Cloudera, Inc. under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. Cloudera, Inc. licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file ex... |
marianoguerra/feedformatter | refs/heads/master | feedformatter.py | 1 | '''module to create atom and rss feeds'''
# Feedformatter
# Copyright (c) 2008, Luke Maurits <luke@maurits.id.au>
# 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 co... |
tarikkdiry/Flock | refs/heads/master | flask/lib/python2.7/site-packages/guess_language/guess_language.py | 59 | ''' Guess the language of text.
Based on guesslanguage.cpp by Jacob R Rideout for KDE
http://websvn.kde.org/branches/work/sonnet-refactoring/common/nlp/guesslanguage.cpp?view=markup
which itself is based on Language::Guess by Maciej Ceglowski
http://languid.cantbedone.org/
Copyright (c) 2008, Kent... |
chrrrles/pyvcloud | refs/heads/master | pyvcloud/schema/vcd/v1_5/schemas/vcloud/vmsType.py | 4 | null |
mrry/tensorflow | refs/heads/windows | tensorflow/python/summary/event_file_inspector.py | 62 | # Copyright 2015 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... |
fxfitz/ansible | refs/heads/devel | test/units/utils/test_shlex.py | 197 | # (c) 2015, Marius Gedminas <marius@gedmin.as>
#
# 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 vers... |
christian-esken/cassandra | refs/heads/trunk | pylib/setup.py | 78 | #!/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
# "Licens... |
Woerd88/script.module.hachoir | refs/heads/master | lib/hachoir_parser/common/win32_lang_id.py | 186 | """
Windows 2000 - List of Locale IDs and Language Groups
Original data table:
http://www.microsoft.com/globaldev/reference/win2k/setup/lcid.mspx
"""
LANGUAGE_ID = {
0x0436: u"Afrikaans",
0x041c: u"Albanian",
0x0401: u"Arabic Saudi Arabia",
0x0801: u"Arabic Iraq",
0x0c01: u"Arabic Egypt",
0x10... |
KitKatXperience/platform_external_chromium_org | refs/heads/kk | chrome/common/extensions/docs/server2/build_server.py | 57 | #!/usr/bin/env python
# Copyright (c) 2012 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
# This script is used to copy all dependencies into the local directory.
# The package of files can then be uploaded to App Engine.... |
darmaa/odoo | refs/heads/master | addons/stock_picking_wave/__openerp__.py | 61 | # -*- 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... |
ekkyvalent/ep-blog | refs/heads/master | node_modules/node-gyp/gyp/pylib/gyp/win_tool.py | 1417 | #!/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.
"""Utility functions for Windows builds.
These functions are executed via gyp-win-tool when using the ninja generator.
"""
import os
impor... |
charlesvdv/servo | refs/heads/master | tests/wpt/harness/wptrunner/wptmanifest/backends/static.py | 190 | # 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 operator
from ..node import NodeVisitor
from ..parser import parse
class Compiler(NodeVisitor):
"""Compile... |
davidbrenner/rednotebook | refs/heads/master | rednotebook/external/argparse.py | 490 | # Author: Steven J. Bethard <steven.bethard@gmail.com>.
"""Command-line parsing library
This module is an optparse-inspired command-line parsing library that:
- handles both optional and positional arguments
- produces highly informative usage messages
- supports parsers that dispatch to sub-parsers
The... |
h3llrais3r/SickRage | refs/heads/master | lib/hachoir_parser/parser_list.py | 85 | import re
import types
from hachoir_core.error import error
from hachoir_core.i18n import _
from hachoir_parser import Parser, HachoirParser
import sys
### Parser list ################################################################
class ParserList(object):
VALID_CATEGORY = ("archive", "audio", "container", "fil... |
peterwittek/concept_drifts | refs/heads/master | trackBmus.py | 1 | # -*- coding: utf-8 -*-
"""
Created on Thu Feb 5 16:50:02 2015
@author: wittek
"""
from math import sqrt
threshold1 = 5
threshold2 = 11
def get_keywords(keyword_filename, bmu_filename):
bmus = []
bmu_file = open(bmu_filename,'r')
n_rows, n_columns = bmu_file.readline()[1:].split(' ')
bmu_file.readli... |
coolo/packagekit | refs/heads/master | lib/python/packagekit/filter.py | 18 | #!/usr/bin/python
# Licensed under the GNU General Public License Version 2
#
# 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 ver... |
EcmaXp/micropython | refs/heads/opencom | tests/basics/bytes_gen.py | 116 | # construct a bytes object from a generator
def gen():
for i in range(4):
yield i
print(bytes(gen()))
|
zlfben/gem5 | refs/heads/develop | src/arch/mips/MipsTLB.py | 69 | # -*- mode:python -*-
# Copyright (c) 2007 MIPS Technologies, 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 ... |
akretion/odoo | refs/heads/12-patch-paging-100-in-o2m | addons/auth_signup/models/res_config_settings.py | 14 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from ast import literal_eval
from odoo import api, fields, models
class ResConfigSettings(models.TransientModel):
_inherit = 'res.config.settings'
auth_signup_reset_password = fields.Boolean(string='Enable pa... |
Nickito12/stepmania-server | refs/heads/master | test/test_models/test_song_stat.py | 1 | """ Module to test song_stat model """
import datetime
from test.factories.song_stat_factory import SongStatFactory
from test.factories.user_factory import UserFactory
from test import utils
class SongStatTest(utils.DBTest):
""" test SongStat model"""
def test_lit_difficulty(self):
""" Test lit_diff... |
fengbaicanhe/intellij-community | refs/heads/master | python/testData/psi/CommentAtBeginningOfStatementList.py | 158 | def foo(a):
if a == 5:
# a is 5
print 'no'
foo(5) |
makerbot/ReplicatorG | refs/heads/master | skein_engines/skeinforge-50/skeinforge_application/skeinforge_plugins/craft_plugins/alteration.py | 12 | #! /usr/bin/env python
"""
This page is in the table of contents.
The alteration plugin adds the start and end files to the gcode.
This plugin also removes the alteration prefix tokens from the alteration lines. Alteration lines have a prefix token so they can go through the craft plugins without being modified. How... |
pmaunz/pyqtgraph | refs/heads/develop | doc/extensions/qt_doc.py | 28 | """
Extension for building Qt-like documentation.
- Method lists preceding the actual method documentation
- Inherited members documented separately
- Members inherited from Qt have links to qt-project documentation
- Signal documentation
"""
def setup(app):
# probably we will be making a wrapper around au... |
jimsrc/seatos | refs/heads/master | etc/n_CR/share/load_data.py | 2 | #!/usr/bin/env ipython
import numpy as np
#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
class gral():
def __init__(self):
self.name = ''
sh, mc = gral(), gral()
cr = gral()
cr.sh, cr.mc = gral(), gral()
vlo, vhi = 550.0, 3000.0 #100.0, 450.0 #550.0, 3000.0
... |
helixyte/TheLMA | refs/heads/master | thelma/repositories/rdb/mappers/isojobpreparationplate.py | 1 | """
This file is part of the TheLMA (THe Laboratory Management Application) project.
See LICENSE.txt for licensing, CONTRIBUTORS.txt for contributor information.
ISO job preparation plate mapper
"""
from sqlalchemy.orm import relationship
from everest.repositories.rdb.utils import mapper
from thelma.entities.iso impo... |
LinuxChristian/home-assistant | refs/heads/dev | homeassistant/components/ifttt.py | 20 | """
Support to trigger Maker IFTTT recipes.
For more details about this component, please refer to the documentation at
https://home-assistant.io/components/ifttt/
"""
import logging
import requests
import voluptuous as vol
import homeassistant.helpers.config_validation as cv
REQUIREMENTS = ['pyfttt==0.3']
_LOGGER... |
akesandgren/easybuild-framework | refs/heads/main | easybuild/base/generaloption.py | 1 | #
# Copyright 2011-2021 Ghent University
#
# This file is part of EasyBuild,
# originally created by the HPC team of Ghent University (http://ugent.be/hpc/en),
# with support of Ghent University (http://ugent.be/hpc),
# the Flemish Supercomputer Centre (VSC) (https://www.vscentrum.be),
# Flemish Research Foundation (FW... |
obi-two/Rebelion | refs/heads/master | data/scripts/templates/object/mobile/tatooine_npc/shared_capt_loftus.py | 2 | #### NOTICE: THIS FILE IS AUTOGENERATED
#### MODIFICATIONS MAY BE LOST IF DONE IMPROPERLY
#### PLEASE SEE THE ONLINE DOCUMENTATION FOR EXAMPLES
from swgpy.object import *
def create(kernel):
result = Creature()
result.template = "object/mobile/tatooine_npc/shared_capt_loftus.iff"
result.attribute_template_id = 9... |
soundcloud/essentia | refs/heads/master | src/examples/python/streaming_extractor/tuningfrequency.py | 10 | # Copyright (C) 2006-2013 Music Technology Group - Universitat Pompeu Fabra
#
# This file is part of Essentia
#
# Essentia is free software: you can redistribute it and/or modify it under
# the terms of the GNU Affero General Public License as published by the Free
# Software Foundation (FSF), either version 3 of the ... |
les69/calvin-base | refs/heads/master | calvin/actorstore/systemactors/exception/ExceptionHandler.py | 3 | # -*- coding: utf-8 -*-
# Copyright (c) 2015 Ericsson 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 ... |
mvpcom/CyberHandsFaraz | refs/heads/master | ROS/chugv_ws/src/chugv_control/scripts/key_teleop.py | 1 | #! /usr/bin/env python
# rosrun chugv_control key_teleop.py
import rospy, math
import numpy as np
import sys, termios, tty, select, os
from geometry_msgs.msg import Twist
class KeyTeleop(object):
cmd_bindings = {'q':np.array([1,1]),
'w':np.array([1,0]),
'e':np.array([1,-1]),
... |
ptphp/PyLib | refs/heads/master | src/dev/web/publish/pub58.py | 1 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from database import *
import urllib,urllib2,json,re,time
from BeautifulSoup import BeautifulSoup
import MySQLdb
from urlparse import urlparse
import threading
import random
import time
from Queue import Queue
import traceback
citycode = "sh"
conn = MySQLdb.Connect(host="... |
mioann47/mobile-app-privacy-analyzer | refs/heads/master | mypythonscripts/mysql/connector/fabric/__init__.py | 5 | # MySQL Connector/Python - MySQL driver written in Python.
# Copyright (c) 2013, 2017, Oracle and/or its affiliates. All rights reserved.
# MySQL Connector/Python is licensed under the terms of the GPLv2
# <http://www.gnu.org/licenses/old-licenses/gpl-2.0.html>, like most
# MySQL Connectors. There are special exceptio... |
yencarnacion/jaikuengine | refs/heads/master | .google_appengine/lib/django-1.5/django/conf/locale/gl/formats.py | 231 | # -*- 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 = r'j \d\e F \d\e Y'
TIME_FORMAT = '... |
Shekharrajak/django-db-mailer | refs/heads/master | docs/conf.py | 3 | # -*- coding: utf-8 -*-
#
# django-db-mailer documentation build configuration file, created by
# sphinx-quickstart on Wed Jan 18 14:55:29 2012.
#
# This file is execfile()d with the current directory set to its containing dir.
#
# Note that not all possible configuration values are present in this
# autogenerated file... |
punchagan/zulip | refs/heads/master | zerver/tests/test_integrations_dev_panel.py | 3 | from unittest.mock import MagicMock, patch
import orjson
from zerver.lib.test_classes import ZulipTestCase
from zerver.models import Message, Stream, get_realm, get_user
class TestIntegrationsDevPanel(ZulipTestCase):
zulip_realm = get_realm("zulip")
def test_check_send_webhook_fixture_message_for_error(se... |
ZhangXinNan/tensorflow | refs/heads/master | tensorflow/contrib/gan/python/eval/python/sliced_wasserstein.py | 43 | # 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... |
tachang/django-storages | refs/heads/master | storages/backends/image.py | 24 |
import os
from django.core.files.storage import FileSystemStorage
from django.core.exceptions import ImproperlyConfigured
try:
from PIL import ImageFile as PILImageFile
except ImportError:
raise ImproperlyConfigured, "Could not load PIL dependency.\
\nSee http://www.pythonware.com/products/pil/"
class ... |
bufferx/tornado | refs/heads/master | tornado/test/httpclient_test.py | 1 | #!/usr/bin/env python
from __future__ import absolute_import, division, print_function, with_statement
import base64
import binascii
from contextlib import closing
import functools
import sys
import threading
from tornado.escape import utf8
from tornado.httpclient import HTTPRequest, HTTPResponse, _RequestProxy, HTT... |
abircse06/youtube-dl | refs/heads/master | youtube_dl/extractor/mailru.py | 81 | # encoding: utf-8
from __future__ import unicode_literals
import re
from .common import InfoExtractor
class MailRuIE(InfoExtractor):
IE_NAME = 'mailru'
IE_DESC = 'Видео@Mail.Ru'
_VALID_URL = r'http://(?:www\.)?my\.mail\.ru/(?:video/.*#video=/?(?P<idv1>(?:[^/]+/){3}\d+)|(?:(?P<idv2prefix>(?:[^/]+/){2})vi... |
aodag/babel | refs/heads/master | babel/__init__.py | 21 | # -*- coding: utf-8 -*-
"""
babel
~~~~~
Integrated collection of utilities that assist in internationalizing and
localizing applications.
This package is basically composed of two major parts:
* tools to build and work with ``gettext`` message catalogs
* a Python interface to the CLDR (... |
redeyser/IceCash2 | refs/heads/master | dbIceCash.py | 1 | #!/usr/bin/python
# -*- coding: utf-8
# version 2.000
# DataBase for IceCash
import my
import os
import re
from chIceCash import _round
from md5 import md5
import tbIceCash as tbs
import datetime
DATABASE = "IceCash"
MYSQL_USER = "icecash"
MYSQL_PASSWORD = "icecash1024"
TB_BOXES_HD = "tb_boxes_hd"
TB_BOXES_CT = "tb_... |
Hubert51/ROOMr | refs/heads/master | server_part/app/manage.py | 1 |
from flask import Flask
from flask import render_template
import MySQLdb
import sys
default_encoding = 'utf-8'
if sys.getdefaultencoding() != default_encoding:
reload(sys)
sys.setdefaultencoding(default_encoding)
app = Flask(__name__)
# This is online version of database
# db = MySQLdb.connect(host="Gengrui... |
joh12041/quac | refs/heads/master | lib/confidence_ellipse.py | 3 | '''This module contains functions to compute confidence ellipses for
2-dimensional Gaussians and Gaussian mixture models. (Note that by
"ellipse" we mean "polygon approximating an ellipse".) See
<http://sites.stat.psu.edu/~ajw13/stat505/fa06/06_multnorm/06_multnorm_revist.html>.'''
# Copyright (c) Los Alamos ... |
TelekomCloud/pony-express | refs/heads/master | ponyexpress/models/__init__.py | 1 | from ponyexpress.models.repository import Repository
from ponyexpress.models.repo_history import RepoHistory
from ponyexpress.models.package import Package
from ponyexpress.models.package_history import PackageHistory
from ponyexpress.models.node import Node
|
kawasaki2013/python-for-android-x86 | refs/heads/master | python-modules/twisted/twisted/test/test_persisted.py | 60 |
# Copyright (c) 2001-2004 Twisted Matrix Laboratories.
# See LICENSE for details.
# System Imports
import sys
from twisted.trial import unittest
try:
import cPickle as pickle
except ImportError:
import pickle
try:
import cStringIO as StringIO
except ImportError:
import StringIO
# Twisted Imports
... |
mollstam/UnrealPy | refs/heads/master | UnrealPyEmbed/Development/Python/2015.08.07-Python2710-x64-Source-vs2015/Python27/Source/Python-2.7.10/Lib/smtpd.py | 174 | #! /usr/bin/env python
"""An RFC 2821 smtp proxy.
Usage: %(program)s [options] [localhost:localport [remotehost:remoteport]]
Options:
--nosetuid
-n
This program generally tries to setuid `nobody', unless this flag is
set. The setuid call will fail if this program is not run as root (in
... |
TangHao1987/intellij-community | refs/heads/master | python/lib/Lib/site-packages/django/contrib/localflavor/us/forms.py | 229 | """
USA-specific Form helpers
"""
from django.core.validators import EMPTY_VALUES
from django.forms import ValidationError
from django.forms.fields import Field, RegexField, Select, CharField
from django.utils.encoding import smart_unicode
from django.utils.translation import ugettext_lazy as _
import re
phone_digits... |
jamestwebber/scipy | refs/heads/master | scipy/optimize/_hessian_update_strategy.py | 2 | """Hessian update strategies for quasi-Newton optimization methods."""
from __future__ import division, print_function, absolute_import
import numpy as np
from numpy.linalg import norm
from scipy.linalg import get_blas_funcs
from warnings import warn
__all__ = ['HessianUpdateStrategy', 'BFGS', 'SR1']
class HessianU... |
lisael/pg-django | refs/heads/master | tests/modeltests/str/tests.py | 34 | # -*- coding: utf-8 -*-
from __future__ import absolute_import
import datetime
from django.test import TestCase
from .models import Article, InternationalArticle
class SimpleTests(TestCase):
def test_basic(self):
a = Article.objects.create(
headline='Area man programs in Python',
... |
vladimir-smirnov-sociomantic/graphite-api | refs/heads/master | graphite_api/intervals.py | 14 | INFINITY = float('inf')
NEGATIVE_INFINITY = -INFINITY
class IntervalSet(object):
__slots__ = ('intervals', 'size')
def __init__(self, intervals, disjoint=False):
self.intervals = intervals
if not disjoint:
self.intervals = union_overlapping(self.intervals)
self.size = su... |
xombiemp/CouchPotatoServer | refs/heads/master | libs/pyutil/test/current/json_tests/test_default.py | 106 | from unittest import TestCase
from pyutil import jsonutil as json
class TestDefault(TestCase):
def test_default(self):
self.assertEquals(
json.dumps(type, default=repr),
json.dumps(repr(type)))
|
Bysmyyr/chromium-crosswalk | refs/heads/master | tools/usb_gadget/echo_gadget.py | 43 | # Copyright 2014 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.
"""USB echo gadget module.
This gadget has pairs of IN/OUT endpoints that echo packets back to the host.
"""
import uuid
import composite_gadget
import us... |
mrquim/repository.mrquim | refs/heads/master | repo/script.module.schism.common/lib/js2py/translators/translating_nodes.py | 31 | from __future__ import unicode_literals
from pyjsparserdata import *
from friendly_nodes import *
import random
# number of characters above which expression will be split to multiple lines in order to avoid python parser stack overflow
# still experimental so I suggest to set it to 400 in order to avoid common errors
... |
firstval/micropython | refs/heads/master | tests/cmdline/cmd_showbc.py | 54 | # cmdline: -v -v
# test printing of all bytecodes
def f():
# constants
a = None + False + True
a = 0
a = 1000
a = -1000
# constructing data
a = 1
b = (1, 2)
c = [1, 2]
d = {1, 2}
e = {}
f = {1:2}
g = 'a'
h = b'a'
# unary/binary ops
i = 1
j = 2
k... |
xiang12835/python_web | refs/heads/master | py2_web2py/web2py/gluon/contrib/markmin/markmin2html.py | 1 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# created by Massimo Di Pierro
# recreated by Vladyslav Kozlovskyy
# license MIT/BSD/GPL
from __future__ import print_function
import re
import sys
import urllib
import ast
PY2 = sys.version_info[0] == 2
if PY2:
from urllib import quote as urllib_quote
from string... |
pawitp/android_kernel_samsung_i9082 | refs/heads/cm-12.0 | tools/perf/python/twatch.py | 3213 | #! /usr/bin/python
# -*- python -*-
# -*- coding: utf-8 -*-
# twatch - Experimental use of the perf python interface
# Copyright (C) 2011 Arnaldo Carvalho de Melo <acme@redhat.com>
#
# This application is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License... |
joakim-hove/django | refs/heads/master | tests/migrations/migrations_test_apps/alter_fk/author_app/migrations/0002_alter_id.py | 379 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('author_app', '0001_initial'),
('book_app', '0001_initial'), # Forces the book table to alter the FK
]
operations = [
... |
pyneng/pyneng.github.io | refs/heads/master | code_examples/pytest/check_ip_functions.py | 1 | import ipaddress
def check_ip(ip):
#return False
try:
ipaddress.ip_address(ip)
return True
except ValueError as err:
return False
if __name__ == "__main__":
result = check_ip('10.1.1.1')
print('Function result:', result)
|
nevil-brownlee/python-libtrace | refs/heads/master | test/v3-test-cases/test-plt.py | 2 | #!/usr/bin/env python
# Thu, 13 Mar 14 (PDT)
# plt-test.py: Test packet-level attributes
# Copyright (C) 2017, Nevil Brownlee, U Auckland | WAND
import socket
import sys
from plt_testing import *
#dt = datetime.datetime.utcnow() # class
#print "***** dt = {0}".format(dt)
#t = plt.ipp_obj(4, "1234")
#print "t = {... |
aaron-spear/style-guide | refs/heads/gh-pages | node_modules/npm-shrinkwrap/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/MSVSSettings_test.py | 778 | #!/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.
"""Unit tests for the MSVSSettings.py file."""
import StringIO
import unittest
import gyp.MSVSSettings as MSVSSettings
class TestSequence... |
tempbottle/restcommander | refs/heads/master | play-1.2.4/python/Lib/curses/ascii.py | 396 | """Constants and membership tests for ASCII characters"""
NUL = 0x00 # ^@
SOH = 0x01 # ^A
STX = 0x02 # ^B
ETX = 0x03 # ^C
EOT = 0x04 # ^D
ENQ = 0x05 # ^E
ACK = 0x06 # ^F
BEL = 0x07 # ^G
BS = 0x08 # ^H
TAB = 0x09 # ^I
HT = 0x09 # ^I
LF = 0x0a # ^J
NL =... |
pde/torbrowser-launcher | refs/heads/master | lib/Parsley-1.1/ometa/_generated/pymeta_v1.py | 2 | def createParserClass(GrammarBase, ruleGlobals):
if ruleGlobals is None:
ruleGlobals = {}
class pymeta_v1(GrammarBase):
def rule_comment(self):
_locals = {'self': self}
self.locals['comment'] = _locals
_G_exactly_1, lastError = self.exactly('#')
se... |
Bitergia/allura | refs/heads/master | Allura/allura/controllers/task.py | 3 | class TaskController(object):
'''WSGI app providing web-like RPC
The purpose of this app is to allow us to replicate the
normal web request environment as closely as possible
when executing celery tasks.
'''
def __call__(self, environ, start_response):
task = environ['task']
re... |
dplorimer/osf | refs/heads/master | scripts/tests/test_migrate_dates.py | 54 | # -*- coding: utf-8 -*-
import datetime
from nose.tools import * # noqa
from scripts.osfstorage.utils import ensure_osf_files
from website import settings
ensure_osf_files(settings)
# Hack: Must configure add-ons before importing `OsfTestCase`
from website.addons.osfstorage.tests.factories import FileVersionFactory
... |
yencarnacion/jaikuengine | refs/heads/master | .google_appengine/lib/django-1.5/django/contrib/messages/tests/base.py | 63 | from django import http
from django.conf import settings, global_settings
from django.contrib.messages import constants, utils, get_level, set_level
from django.contrib.messages.api import MessageFailure
from django.contrib.messages.storage import default_storage, base
from django.contrib.messages.storage.base import M... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.