repo_name stringlengths 5 100 | ref stringlengths 12 67 | path stringlengths 4 244 | copies stringlengths 1 8 | content stringlengths 0 1.05M ⌀ |
|---|---|---|---|---|
Artemkaaas/indy-sdk | refs/heads/master | samples/python/src/anoncreds_revocation.py | 2 | import time
from indy import anoncreds, wallet
import json
import logging
from indy import blob_storage
from indy import pool
from src.utils import run_coroutine, path_home, PROTOCOL_VERSION
logger = logging.getLogger(__name__)
async def demo():
logger.info("Anoncreds Revocation sample -> started")
is... |
ruslan2k/public-files | refs/heads/master | python/05-pinax/mysite/resources/views.py | 1 | from django.shortcuts import render, get_object_or_404
from django.http import HttpResponse, HttpResponseRedirect
from django.contrib.auth import authenticate
from django.contrib.auth.models import Group
from django.contrib.auth.decorators import login_required
from resources.models import Resource, Item, Profile
im... |
izonder/intellij-community | refs/heads/master | python/testData/refactoring/pushdown/multiFileImports/shared_module.py | 160 | MODULE_CONTANT = 42
def module_function():
pass
class ModuleClass(object):
pass |
thaumos/ansible | refs/heads/devel | lib/ansible/modules/cloud/azure/azure_rm_routetable_facts.py | 14 | #!/usr/bin/python
#
# Copyright (c) 2018 Yuwei Zhou, <yuwzho@microsoft.com>
#
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.1',
... |
acsone/odoo | refs/heads/8.0 | addons/mail/mail_thread.py | 27 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2009-today OpenERP SA (<http://www.openerp.com>)
#
# This program is free software: you can redistribute it and/or modify
# it under the terms o... |
kxliugang/edx-platform | refs/heads/master | lms/djangoapps/certificates/migrations/0004_auto__add_field_generatedcertificate_graded_certificate_id__add_field_.py | 188 | # encoding: utf-8
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding field 'GeneratedCertificate.graded_certificate_id'
db.add_column('certificates_generatedcertificate', 'g... |
axtra/ansible | refs/heads/devel | v2/ansible/playbook/conditional.py | 23 | # (c) 2012-2014, Michael DeHaan <michael.dehaan@gmail.com>
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) an... |
Oteng/youtube-dl | refs/heads/master | youtube_dl/extractor/nhl.py | 25 | from __future__ import unicode_literals
import re
import json
import os
from .common import InfoExtractor
from ..compat import (
compat_urlparse,
compat_urllib_parse,
compat_urllib_parse_urlparse
)
from ..utils import (
unified_strdate,
)
class NHLBaseInfoExtractor(InfoExtractor):
@staticmethod
... |
andykimpe/chromium-test-npapi | refs/heads/master | tools/checkbins/checkbins.py | 77 | #!/usr/bin/env python
# Copyright (c) 2011 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Makes sure that all EXE and DLL files in the provided directory were built
correctly.
In essense it runs a subset of BinScope t... |
jazkarta/edx-platform | refs/heads/master | common/djangoapps/third_party_auth/tasks.py | 81 | # -*- coding: utf-8 -*-
"""
Code to manage fetching and storing the metadata of IdPs.
"""
#pylint: disable=no-member
from celery.task import task # pylint: disable=import-error,no-name-in-module
import datetime
import dateutil.parser
import logging
from lxml import etree
import requests
from onelogin.saml2.utils impor... |
sbidoul/buildbot | refs/heads/master | master/buildbot/buildslave/__init__.py | 11 | # This file is part of Buildbot. Buildbot 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, version 2.
#
# This program is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without eve... |
achang97/YouTunes | refs/heads/master | lib/python2.7/site-packages/setuptools/namespaces.py | 196 | import os
from distutils import log
import itertools
from setuptools.extern.six.moves import map
flatten = itertools.chain.from_iterable
class Installer:
nspkg_ext = '-nspkg.pth'
def install_namespaces(self):
nsp = self._get_all_ns_packages()
if not nsp:
return
filenam... |
jbclements/rust | refs/heads/master | src/etc/lldb_batchmode.py | 9 | # Copyright 2014 The Rust Project Developers. See the COPYRIGHT
# file at the top-level directory of this distribution and at
# http://rust-lang.org/COPYRIGHT.
#
# Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
# http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
# <LICENSE-MIT or http://... |
pombredanne/django-rest-framework-jsonapi | refs/heads/master | tests/views.py | 1 | from rest_framework import viewsets, permissions
from rest_framework_jsonapi.pagination import (
PageNumberPagination, LimitOffsetPagination, CursorPagination)
from rest_framework.decorators import api_view, throttle_classes
from rest_framework.throttling import AnonRateThrottle
from rest_framework.exceptions impor... |
ahb0327/intellij-community | refs/heads/master | python/testData/refactoring/move/innerImports/after/src/a.py | 45382 | |
msingh172/youtube-dl | refs/heads/master | youtube_dl/downloader/rtsp.py | 119 | from __future__ import unicode_literals
import os
import subprocess
from .common import FileDownloader
from ..utils import (
check_executable,
encodeFilename,
)
class RtspFD(FileDownloader):
def real_download(self, filename, info_dict):
url = info_dict['url']
self.report_destination(file... |
dezelin/virtualbox | refs/heads/master | src/libs/libxml2-2.6.31/python/tests/pushSAX.py | 87 | #!/usr/bin/python -u
import sys
import libxml2
# Memory debug specific
libxml2.debugMemory(1)
log = ""
class callback:
def startDocument(self):
global log
log = log + "startDocument:"
def endDocument(self):
global log
log = log + "endDocument:"
def startElement(self, tag... |
msimacek/samba | refs/heads/master | third_party/dnspython/dns/edns.py | 47 | # Copyright (C) 2009, 2011 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 "AS IS" AND... |
cloudera/hue | refs/heads/master | desktop/core/ext-py/pytest-django-3.10.0/pytest_django/asserts.py | 2 | """
Dynamically load all Django assertion cases and expose them for importing.
"""
from functools import wraps
from django.test import (
TestCase, SimpleTestCase,
LiveServerTestCase, TransactionTestCase
)
test_case = TestCase('run')
def _wrapper(name):
func = getattr(test_case, name)
@wraps(func)
... |
Chetwyn/git-cola | refs/heads/master | cola/widgets/compare.py | 7 | """Provides dialogs for comparing branches and commits."""
from __future__ import division, absolute_import, unicode_literals
from PyQt4 import QtGui
from PyQt4.QtCore import Qt
from PyQt4.QtCore import SIGNAL
from cola import qtutils
from cola import difftool
from cola import gitcmds
from cola import icons
from cola... |
martinribelotta/micropython | refs/heads/master | tests/basics/fun2.py | 119 | # calling a function from a function
def f(x):
print(x + 1)
def g(x):
f(2 * x)
f(4 * x)
g(3)
|
jart/tensorflow | refs/heads/master | tensorflow/python/training/session_run_hook.py | 25 | # 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... |
stephane-martin/salt-debian-packaging | refs/heads/master | salt-2016.3.3/tests/unit/states/mysql_user_test.py | 2 | # -*- coding: utf-8 -*-
'''
:codeauthor: :email:`Jayesh Kariya <jayeshk@saltstack.com>`
'''
# Import Python libs
from __future__ import absolute_import
# Import Salt Testing Libs
from salttesting import skipIf, TestCase
from salttesting.mock import (
NO_MOCK,
NO_MOCK_REASON,
MagicMock,
patch)
from... |
Batterfii/django | refs/heads/master | tests/timezones/urls.py | 406 | from django.conf.urls import url
from . import admin as tz_admin # NOQA: register tz_admin
urlpatterns = [
url(r'^admin/', tz_admin.site.urls),
]
|
EndingCredits/PyGame-Learning-Environment | refs/heads/master | setup.py | 3 | import os
from setuptools import find_packages
from setuptools import setup
here = os.path.abspath(os.path.dirname(__file__))
install_requires = [
"numpy",
"Pillow"
]
setup(
name='ple',
version='0.0.1',
description='PyGame Learning Environment',
classifiers=[
"Intended Audience :: Developers"... |
formalmethods/intrepyd | refs/heads/master | examples/counter/counter_exe.py | 1 | import intrepyd as ip
import intrepyd.components
import intrepyd.trace
if __name__ == "__main__":
ctx = ip.Context()
int8type = ctx.mk_int8_type()
ten = ctx.mk_number("10", int8type)
counter, Q = ip.components.mk_counter(ctx, "counter", type=int8type, limit=ten)
simulator = ctx.mk_simulator()
t... |
chand3040/cloud_that | refs/heads/named-release/cypress.rc | common/djangoapps/course_modes/views.py | 18 | """
Views for the course_mode module
"""
import decimal
from ipware.ip import get_ip
from django.core.urlresolvers import reverse
from django.http import HttpResponse, HttpResponseBadRequest
from django.shortcuts import redirect
from django.views.generic.base import View
from django.utils.translation import ugettext ... |
yorung/fastbirdEngine | refs/heads/master | Code/Utility/export_layers_info.py | 1 | #!/usr/bin/env python
# This codes is a part of the open source game engine called fastbird-engine.
# Auothor : fastbird(jungwan82@naver.com)
# HOW TO USE
# 1. Put this file in the plug-in folder
# Maybe C:\Users\yourname\.gimp-2.8/plug-ins for Windows.
# Or you can check in the dialog which you can open from ... |
cgvarela/grpc | refs/heads/master | src/python/grpcio/grpc/framework/core/_end.py | 1 | # Copyright 2015, Google Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the f... |
benroeder/moviepy | refs/heads/master | moviepy/config.py | 15 | import os
import subprocess as sp
try:
from subprocess import DEVNULL # py3k
except ImportError:
DEVNULL = open(os.devnull, 'wb')
if os.name == 'nt':
try:
import winreg as wr # py3k
except:
import _winreg as wr # py2k
from .config_defaults import (FFMPEG_BINARY, IMAGEMAGICK_BI... |
SeanEstey/Bravo | refs/heads/stable | app/auth/manager.py | 1 | '''app.auth.manager'''
import base64
from bson.objectid import ObjectId
from flask import g, current_app
from flask_login import current_user, login_user, logout_user
from app import login_manager
from .user import User
from logging import getLogger
log = getLogger(__name__)
#------------------------------------------... |
smartscheduling/scikit-learn-categorical-tree | refs/heads/master | sklearn/utils/tests/test_shortest_path.py | 42 | from collections import defaultdict
import numpy as np
from numpy.testing import assert_array_almost_equal
from sklearn.utils.graph import (graph_shortest_path,
single_source_shortest_path_length)
def floyd_warshall_slow(graph, directed=False):
N = graph.shape[0]
#set nonzer... |
p0cisk/Quantum-GIS | refs/heads/master | python/plugins/processing/modeler/AddModelFromFileAction.py | 5 | # -*- coding: utf-8 -*-
"""
***************************************************************************
EditScriptAction.py
---------------------
Date : August 2012
Copyright : (C) 2012 by Victor Olaya
Email : volayaf at gmail dot com
**********************... |
Rav3nPL/bitcoin | refs/heads/master | test/functional/wallet-hd.py | 1 | #!/usr/bin/env python3
# Copyright (c) 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.
"""Test Hierarchical Deterministic wallet function."""
from test_framework.test_framework import BitcoinTestFr... |
Tasignotas/topographica_mirror | refs/heads/master | topo/submodel/earlyvision.py | 2 | """
Contains a variety of sensory models, specifically models for the
visual pathway.
"""
import topo
import param
import numbergen
import lancet
import numpy
import imagen
from imagen.patterncoordinator import PatternCoordinator, PatternCoordinatorImages
from topo.base.arrayutil import DivideWithConstant
from topo.... |
alunduil/etest | refs/heads/master | etest_test/fixtures_test/scripts_test/e2a2b40a96df4dd093dc7f1c94e67eda.py | 1 | """Assign empty string."""
import textwrap
from etest_test.fixtures_test.scripts_test import SCRIPTS
_ = {
"uuid": "e2a2b40a96df4dd093dc7f1c94e67eda",
"description": "assign empty string",
"text": textwrap.dedent(
"""
IUSE=""
""",
),
"symbols": {
"IUSE": "",
},... |
tseaver/google-cloud-python | refs/heads/master | speech/samples/v1p1beta1/speech_contexts_classes_beta.py | 2 | # -*- coding: utf-8 -*-
#
# Copyright 2019 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law... |
robbiet480/home-assistant | refs/heads/dev | homeassistant/components/bbox/sensor.py | 16 | """Support for Bbox Bouygues Modem Router."""
from datetime import timedelta
import logging
import pybbox
import requests
import voluptuous as vol
from homeassistant.components.sensor import PLATFORM_SCHEMA
from homeassistant.const import (
ATTR_ATTRIBUTION,
CONF_MONITORED_VARIABLES,
CONF_NAME,
DATA_R... |
nzavagli/UnrealPy | refs/heads/master | UnrealPyEmbed/Development/Python/2015.08.07-Python2710-x64-Source-vs2015/Python27/Source/zope.interface-4.1.2/src/zope/interface/tests/advisory_testing.py | 57 | ##############################################################################
#
# Copyright (c) 2003 Zope Foundation and Contributors.
# All Rights Reserved.
#
# This software is subject to the provisions of the Zope Public License,
# Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution.
# THIS SOF... |
leansoft/edx-platform | refs/heads/master | common/test/data/capa/prog1.py | 270 | # prog1
|
yanheven/glance | refs/heads/master | glance/search/plugins/metadefs_notification_handler.py | 7 | # Copyright (c) 2014 Hewlett-Packard Development Company, L.P.
#
# 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... |
midgardproject/midgard-core | refs/heads/master | tests/GIR/test_900_object_reference.py | 1 | # coding=utf-8
import os
import sys
import struct
import unittest
import inspect
from gi.repository import Midgard, GObject, GLib
from test_020_connection import TestConnection
class TestObjectReference(unittest.TestCase):
mgd = None
guid = None
name = "TestReference"
workspace = None
reference = None
... |
Salat-Cx65/python-for-android | refs/heads/master | python-modules/twisted/twisted/conch/insults/colors.py | 146 | """
You don't really want to use this module. Try helper.py instead.
"""
CLEAR = 0
BOLD = 1
DIM = 2
ITALIC = 3
UNDERSCORE = 4
BLINK_SLOW = 5
BLINK_FAST = 6
REVERSE = 7
CONCEALED = 8
FG_BLACK = 30
FG_RED = 31
FG_GREEN = 32
FG_YELLOW = 33
FG_BLUE = 34
FG_MAGENTA = 35
FG_CYAN = 36
FG_WHITE = 37
BG_BLACK = 40
BG_RED = 41
... |
sudosurootdev/external_chromium_org | refs/heads/L5 | remoting/webapp/build-webapp.py | 42 | #!/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.
"""Creates a directory with with the unpacked contents of the remoting webapp.
The directory will contain a copy-of or a link-to t... |
shakamunyi/ansible | refs/heads/devel | lib/ansible/playbook/role/definition.py | 10 | # (c) 2014 Michael DeHaan, <michael@ansible.com>
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later ve... |
gandarez/wakatime | refs/heads/master | wakatime/packages/pygments_py2/pygments/styles/paraiso_dark.py | 126 | # -*- coding: utf-8 -*-
"""
pygments.styles.paraiso_dark
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Paraíso (Dark) by Jan T. Sott
Pygments template by Jan T. Sott (https://github.com/idleberg)
Created with Base16 Builder by Chris Kempson
(https://github.com/chriskempson/base16-builder).
:copyright: Cop... |
strk/mapnik | refs/heads/master | scons/scons-local-2.2.0/SCons/Variables/__init__.py | 14 | """engine.SCons.Variables
This file defines the Variables class that is used to add user-friendly
customizable variables to an SCons build.
"""
#
# Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 The SCons Foundation
#
# Permission is hereby granted, free of charge, to any person ... |
snakeleon/YouCompleteMe-x86 | refs/heads/master | third_party/ycmd/third_party/bottle/test/test_jinja2.py | 50 | # -*- coding: utf-8 -*-
import unittest
from bottle import Jinja2Template, jinja2_template, jinja2_view, touni
from tools import warn
class TestJinja2Template(unittest.TestCase):
def test_string(self):
""" Templates: Jinja2 string"""
t = Jinja2Template('start {{var}} end').render(var='var')
... |
steveklabnik/servo | refs/heads/master | tests/wpt/css-tests/tools/html5lib/html5lib/treewalkers/pulldom.py | 1729 | from __future__ import absolute_import, division, unicode_literals
from xml.dom.pulldom import START_ELEMENT, END_ELEMENT, \
COMMENT, IGNORABLE_WHITESPACE, CHARACTERS
from . import _base
from ..constants import voidElements
class TreeWalker(_base.TreeWalker):
def __iter__(self):
ignore_until = None... |
anbasile/flask_sample | refs/heads/master | flask/lib/python2.7/site-packages/pip/_vendor/requests/packages/chardet/langgreekmodel.py | 2762 | ######################## BEGIN LICENSE BLOCK ########################
# The Original Code is Mozilla Communicator client code.
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 1998
# the Initial Developer. All Rights R... |
ibinti/intellij-community | refs/heads/master | python/testData/refactoring/pullup/severalParents.after.py | 80 | class Spam:
pass
class Parent_1(object, Spam):
pass
class Parent_2():
pass
class Child(Parent_1, Parent_2):
pass |
slisson/intellij-community | refs/heads/master | python/testData/completion/superInit.py | 83 | class Matrix(object):
def __init__(self):
pass
class Vector3(Matrix):
def __init__(self):
super(Vector3, self).__in<caret>
|
sunils34/buffer-django-nonrel | refs/heads/master | django/templatetags/l10n.py | 247 | from django.conf import settings
from django.template import Node
from django.template import TemplateSyntaxError, Library
from django.utils import formats
from django.utils.encoding import force_unicode
register = Library()
def localize(value):
"""
Forces a value to be rendered as a localized value,
reg... |
akosyakov/intellij-community | refs/heads/master | python/testData/refactoring/extractmethod/ElseBody.after.py | 79 | def foo():
for arg in sys.argv[1:]:
try:
f = open(arg, 'r')
except IOError:
print('cannot open', arg)
else:
baz(f)
#anything else you need
def baz(f_new):
length = len(f_new.readlines()) # <---extract something from here
print("hi fr... |
kuri65536/python-for-android | refs/heads/master | python-build/python-libs/gdata/samples/oauth/2_legged_oauth.py | 128 | #!/usr/bin/python
#
# Copyright (C) 2009 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 ... |
kemiz/tosca-vcloud-plugin | refs/heads/master | tests/unittests/test_mock_network_plugin_floatingip.py | 2 | # Copyright (c) 2014 GigaSpaces Technologies Ltd. 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 ... |
public-ink/public-ink | refs/heads/master | server/appengine-staging/lib/graphql/validation/rules/lone_anonymous_operation.py | 3 | from ...error import GraphQLError
from ...language import ast
from .base import ValidationRule
class LoneAnonymousOperation(ValidationRule):
__slots__ = 'operation_count',
def __init__(self, context):
self.operation_count = 0
super(LoneAnonymousOperation, self).__init__(context)
def ente... |
andrius-preimantas/odoo | refs/heads/master | addons/website/tests/test_converter.py | 61 | # -*- coding: utf-8 -*-
import textwrap
import unittest2
from lxml import etree, html
from lxml.builder import E
from openerp.tests import common
from openerp.addons.base.ir import ir_qweb
from openerp.addons.website.models.ir_qweb import html_to_text
from openerp.addons.website.models.website import slugify, unslug
... |
lanen/youtube-dl | refs/heads/master | youtube_dl/extractor/jove.py | 177 | from __future__ import unicode_literals
import re
from .common import InfoExtractor
from ..utils import (
ExtractorError,
unified_strdate
)
class JoveIE(InfoExtractor):
_VALID_URL = r'https?://(?:www\.)?jove\.com/video/(?P<id>[0-9]+)'
_CHAPTERS_URL = 'http://www.jove.com/video-chapters?videoid={vide... |
hpfem/agros2d | refs/heads/master | resources/python/pyflakes/api.py | 1 | """
API for the command-line I{pyflakes} tool.
"""
from __future__ import with_statement
import sys
import os
import _ast
from optparse import OptionParser
from pyflakes import checker, __version__
from pyflakes import reporter as modReporter
__all__ = ['check', 'checkPath', 'checkRecursive', 'iterSourceCode', 'main... |
jptomo/rpython-lang-scheme | refs/heads/master | rpython/tool/test/test_nullpath.py | 2 | import sys, os
import py
from rpython.tool.nullpath import NullPyPathLocal
def test_nullpath(tmpdir):
path = NullPyPathLocal(tmpdir)
assert repr(path).endswith('[fake]')
foo_txt = path.join('foo.txt')
assert isinstance(foo_txt, NullPyPathLocal)
#
f = foo_txt.open('w')
assert f.name == os.de... |
sfaci/fighter2d | refs/heads/master | fighter2d/BigEnemy.py | 1 | ## BigEnemy
## Clase que implementa un tipo de enemigo mas grande y resistente
##
## Author: Santiago Faci
## Version: 2.0
from direct.showbase.DirectObject import DirectObject
import random
from Enemy import Enemy
VELOCIDAD = -2
VELOCIDAD_MISIL = 10
Y = 55
FRECUENCIA_DISPARO = 0.2
PUNTOS = 200
VIDA = 4
class BigEn... |
ckuethe/gr-chancoding | refs/heads/master | python/qa_chancoding_unpacked_to_packed_bvi.py | 2 | #!/usr/bin/env python
#
# Copyright 2011 Communications Engineering Lab, KIT
#
# This file is part of GNU Radio
#
# GNU Radio is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3, or (at your opt... |
personalunion/glimpse_client-1 | refs/heads/develop | 3rdparty/breakpad/src/tools/gyp/test/win/gyptest-link-uldi.py | 344 | #!/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.
"""
Make sure that when ULDI is on, we link .objs that make up .libs rather than
the .libs themselves.
"""
import TestGyp
import sys
if s... |
gtaylor/btmux_maplib | refs/heads/master | btmux_maplib/constants.py | 1 | """
Common constants that the various modules refer to.
"""
TERRAIN_NAMES = {
" ": "Grassland",
".": "Grassland",
"#": "Road",
"%": "Rough",
"/": "Bridge",
"@": "Building",
"^": "Mountain",
"~": "Water",
"&": "Fire",
"{": "Sand",
"`": "Light_Forest",
"'":... |
seanjensengrey/moveonpc | refs/heads/master | examples/python/pair.py | 7 |
#
# PS Move API - An interface for the PS Move Motion Controller
# Copyright (c) 2011 Thomas Perl <m@thp.io>
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# 1. Redistributions of source co... |
erikr/django | refs/heads/master | django/db/migrations/state.py | 4 | from __future__ import unicode_literals
import copy
import warnings
from collections import OrderedDict
from contextlib import contextmanager
from django.apps import AppConfig
from django.apps.registry import Apps, apps as global_apps
from django.conf import settings
from django.db import models
from django.db.models... |
nirb/whatsapp | refs/heads/master | build/lib/yowsup/layers/protocol_iq/__init__.py | 70 | from .layer import YowIqProtocolLayer |
claudelee/bilibili-api | refs/heads/master | GetDanmuAss/biclass.py | 3 | # -*- coding: utf-8 -*-
"""
Created on Wed May 28 01:22:20 2014
@author: Administrator
"""
class User():
def __init__(self,m_mid=None,m_name=None):
if m_mid:
self.mid = m_mid;
if m_name:
self.name = m_name;
def saveToFile(self,fid):
fid.write('名字:%s\n'%self.name... |
GiladE/birde | refs/heads/master | venv/lib/python2.7/site-packages/django/contrib/gis/db/models/lookups.py | 48 | from django.db.models.lookups import Lookup
from django.db.models.sql.expressions import SQLEvaluator
class GISLookup(Lookup):
def as_sql(self, qn, connection):
from django.contrib.gis.db.models.sql import GeoWhereNode
# We use the same approach as was used by GeoWhereNode. It would
# be a... |
numenta/nupic.cloudbrain | refs/heads/master | htmclassifier/labeled_data_generator.py | 1 | label_dataset_file = open('training_data.csv', 'wb')
med_data_file = open('training_set_meditation.csv', 'rb')
normal_data_file = open('training_set_normal.csv', 'rb')
test_data_file = open('test_set.csv', 'rb')
import csv
csv_writer = csv.writer(label_dataset_file)
headers = ['metric', 'label']
csv_writer.writerow(h... |
jolyonb/edx-platform | refs/heads/master | pavelib/paver_tests/test_paver_get_quality_reports.py | 25 | """
Tests to ensure only the report files we want are returned as part of run_quality.
"""
import unittest
from mock import patch
import pavelib.quality
class TestGetReportFiles(unittest.TestCase):
"""
Ensure only the report files we want are returned as part of run_quality.
"""
@patch('os.walk')
... |
letouriste001/SmartForest_2.0 | refs/heads/master | python3.4Smartforest/lib/python3.4/site-packages/wheel/test/test_basic.py | 472 | """
Basic wheel tests.
"""
import os
import pkg_resources
import json
import sys
from pkg_resources import resource_filename
import wheel.util
import wheel.tool
from wheel import egg2wheel
from wheel.install import WheelFile
from zipfile import ZipFile
from shutil import rmtree
test_distributions = ("complex-dist"... |
OpenSTC-Eleger/stc-m14 | refs/heads/master | report/__init__.py | 15 | # -*- coding: utf-8 -*-
##############################################################################
#
# Copyright (c) 2008 JAILLET Simon - CrysaLEAD - www.crysalead.fr
#
# WARNING: This program as such is intended to be used by professional
# programmers who take the whole responsability of assessing all potential
#... |
viki9698/jizhanggroup | refs/heads/master | django/contrib/gis/utils/wkt.py | 219 | """
Utilities for manipulating Geometry WKT.
"""
from django.utils import six
def precision_wkt(geom, prec):
"""
Returns WKT text of the geometry according to the given precision (an
integer or a string). If the precision is an integer, then the decimal
places of coordinates WKT will be truncated to... |
alex/asciinema | refs/heads/master | asciinema/config.py | 1 | import os
import sys
try:
from ConfigParser import RawConfigParser, ParsingError, NoOptionError
except ImportError:
from configparser import RawConfigParser, ParsingError, NoOptionError
import uuid
DEFAULT_CONFIG_FILE_PATH = "~/.asciinema/config"
DEFAULT_API_URL = 'https://asciinema.org'
class Config:
... |
shaufi10/odoo | refs/heads/8.0 | addons/account_payment/account_invoice.py | 382 | # -*- 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... |
perezg/infoxchange | refs/heads/master | BASE/lib/python2.7/site-packages/dateutil/__init__.py | 147 | # -*- coding: utf-8 -*-
"""
Copyright (c) 2003-2010 Gustavo Niemeyer <gustavo@niemeyer.net>
This module offers extensions to the standard Python
datetime module.
"""
__author__ = "Tomi Pieviläinen <tomi.pievilainen@iki.fi>"
__license__ = "Simplified BSD"
__version__ = "2.1"
|
xuweiliang/Codelibrary | refs/heads/master | hav-gclient-3.2_newton/RDPSettingDialog.py | 1 | #!/usr/bin/env python
#coding=utf-8
import wx
import os
import re
import Logger
import commands
import subprocess
from subprocess import *
import threading
import time
import Resource
import Setting
import Util
class CheckHotplugDevice(threading.Thread):
def __init__(self):
threading.Thread.__init__(self... |
jmuhlich/bayessb | refs/heads/master | examples/pymc/lognormal_test.py | 1 | """A file to make sure we are setting the mean and variance for PyMC
Lognormal variables correctly--since we are used to describing them with
the mean and variance in log base 10."""
from pymc import deterministic, stochastic, MvNormal, Normal, Lognormal, Uniform
from pymc import MCMC, Model
import numpy as np
from pyl... |
McNetic/couchpotato-ger | refs/heads/master | library/hachoir_parser/image/wmf.py | 86 | """
Hachoir parser of Microsoft Windows Metafile (WMF) file format.
Documentation:
- Microsoft Windows Metafile; also known as: WMF,
Enhanced Metafile, EMF, APM
http://wvware.sourceforge.net/caolan/ora-wmf.html
- libwmf source code:
- include/libwmf/defs.h: enums
- src/player/meta.h: arguments parser... |
anksp21/Community-Zenpacks | refs/heads/master | ZenPacks.ZenSystems.Juniper/ZenPacks/ZenSystems/Juniper/migrate/__init__.py | 1165 | # __init__.py
|
eusi/MissionPlanerHM | refs/heads/master | Lib/distutils/command/register.py | 75 | """distutils.command.register
Implements the Distutils 'register' command (register with the repository).
"""
# created 2002/10/21, Richard Jones
__revision__ = "$Id$"
import urllib2
import getpass
import urlparse
import StringIO
from warnings import warn
from distutils.core import PyPIRCCommand
from distutils imp... |
liamgh/liamgreenhughes-sl4a-tf101 | refs/heads/master | python/src/Lib/test/test_mailbox.py | 53 | import os
import sys
import time
import stat
import socket
import email
import email.message
import rfc822
import re
import StringIO
from test import test_support
import unittest
import mailbox
import glob
try:
import fcntl
except ImportError:
pass
class TestBase(unittest.TestCase):
def _check_sample(sel... |
RabidCicada/gedit-sessionsaver | refs/heads/master | sessionsaver/dialogs.py | 1 | # -*- coding: utf-8 -*-
# Copyright (c) 2007 - Steve Frécinaux <code@istique.net>
# Copyright (c) 2010 - Kenny Meyer <knny.myer@gmail.com>
# Licence: GPL2 or later
from gi.repository import GObject, Gtk, Gedit
import os.path
import gettext
from .store import Session
try:
from .gpdefs import *
gettext.bindtex... |
alwayskidd/LRB | refs/heads/master | .waf-1.7.13-5a064c2686fe54de4e11018d22148cfc/waflib/Task.py | 148 | #! /usr/bin/env python
# encoding: utf-8
# WARNING! Do not edit! http://waf.googlecode.com/git/docs/wafbook/single.html#_obtaining_the_waf_file
import os,shutil,re,tempfile
from waflib import Utils,Logs,Errors
NOT_RUN=0
MISSING=1
CRASHED=2
EXCEPTION=3
SKIPPED=8
SUCCESS=9
ASK_LATER=-1
SKIP_ME=-2
RUN_ME=-3
COMPILE_TEMPL... |
biocyberman/bcbio-nextgen | refs/heads/master | bcbio/rnaseq/salmon.py | 1 | """
Wrapper for Salmon:
https://github.com/COMBINE-lab/salmon
http://biorxiv.org/content/early/2015/06/27/021592
"""
import os
from bcbio.rnaseq import sailfish
import bcbio.pipeline.datadict as dd
from bcbio.utils import (file_exists, safe_makedir, is_gzipped)
import bcbio.utils as utils
from bcbio.distributed.trans... |
bobrik/node-gyp | refs/heads/master | legacy/tools/gyp/buildbot/buildbot_run.py | 42 | #!/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.
"""Argument-less script to select what to run on the buildbots."""
import os
import shutil
import subprocess
import sys
if sys.platform ... |
allotria/intellij-community | refs/heads/master | python/testData/refactoring/move/referenceToClassWithNewInMovedSymbol/after/src/classFile.py | 62 | from collections import namedtuple
class Pipeline(namedtuple('_Pipeline', 'name')):
def __new__(cls, name):
return super(Pipeline, cls).__new__(cls, name)
def __init__(self, name):
pass
|
zzh442856860/personal-file-sharing-center | refs/heads/master | web/form.py | 53 | """
HTML forms
(part of web.py)
"""
import copy, re
import webapi as web
import utils, net
def attrget(obj, attr, value=None):
try:
if hasattr(obj, 'has_key') and obj.has_key(attr):
return obj[attr]
except TypeError:
# Handle the case where has_key takes different number of argume... |
YOTOV-LIMITED/kitsune | refs/heads/master | manage.py | 10 | #!/usr/bin/env python
import os
import sys
# Now we can import from third-party libraries.
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'kitsune.settings_local')
os.environ.setdefault('CELERY_CONFIG_MODULE', 'kitsune.settings_local')
# MONKEYPATCH! WOO HOO!
# Need this so we patch before running Django-specific c... |
tuomas2/automate | refs/heads/master | examples/filechange_directory.py | 1 | """
Watch file changes in this directory
"""
from automate import *
class mysys(System):
fs = FileChangeSensor(filename="./", silent=True)
p = Program(
triggers=[fs],
update_condition=Value(True),
on_update=Run(Log(ToStr(fs)))
)
s = mysys()
|
RedHatInsights/insights-core | refs/heads/master | insights/parsr/query/tests/test_compile_queries.py | 1 | from insights.parsr.query import all_, any_, compile_queries, Entry, lt
complex_tree = Entry(name="root",
attrs=[1, 2, 3, 4],
children=[
Entry(name="child", attrs=[1, 1, 2]),
Entry(name="child", attrs=[1, 1, 2, 3, 5]),
... |
radlab/sparrow | refs/heads/master | deploy/third_party/boto-2.1.1/boto/sqs/__init__.py | 15 | # Copyright (c) 2006,2007 Mitch Garnaat http://garnaat.org/
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use, copy, modi... |
Enchufa2/ns-3-dev-git | refs/heads/comcom-paper | doc/models/source/conf.py | 90 | # -*- coding: utf-8 -*-
#
# ns-3 documentation build configuration file, created by
# sphinx-quickstart on Tue Dec 14 09:00:39 2010.
#
# 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.
#
# All co... |
mlouhivu/build-recipes | refs/heads/master | gpaw/examples/taito-1.1.0/customize-taito.py | 2 | # User provided customizations for the gpaw setup
import os
# compiler
compiler = 'mpicc'
mpicompiler = 'mpicc'
mpilinker = 'mpicc'
extra_compile_args = ['-std=c99', '-O3']
# libz
libraries = ['z']
# libxc
library_dirs += [os.environ['LIBXCDIR'] + '/lib']
include_dirs += [os.environ['LIBXCDIR'] + '/include']
librari... |
pcm17/tensorflow | refs/heads/master | tensorflow/python/training/proximal_adagrad_test.py | 22 | # 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... |
Distrotech/intellij-community | refs/heads/master | python/testData/intentions/afterTypeAssertion4.py | 83 | def foo3(x, y):
assert isinstance(y, object)
i = x + y
return i
|
steev/linux-kernel | refs/heads/master | scripts/tracing/draw_functrace.py | 14679 | #!/usr/bin/python
"""
Copyright 2008 (c) Frederic Weisbecker <fweisbec@gmail.com>
Licensed under the terms of the GNU GPL License version 2
This script parses a trace provided by the function tracer in
kernel/trace/trace_functions.c
The resulted trace is processed into a tree to produce a more human
view of the call ... |
newerthcom/savagerebirth | refs/heads/master | libs/python-2.72/Lib/encodings/iso8859_5.py | 593 | """ Python Character Mapping Codec iso8859_5 generated from 'MAPPINGS/ISO8859/8859-5.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='... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.