repo_name stringlengths 5 100 | ref stringlengths 12 67 | path stringlengths 4 244 | copies stringlengths 1 8 | content stringlengths 0 1.05M ⌀ |
|---|---|---|---|---|
leighpauls/k2cro4 | refs/heads/master | tools/gyp/test/win/gyptest-macro-vcinstalldir.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 macro expansion of $(VCInstallDir) is handled, and specifically
always / terminated for compatibility.
"""
import TestGyp
im... |
WoLpH/jedi | refs/heads/master | test/completion/definition.py | 27 | """
Fallback to callee definition when definition not found.
- https://github.com/davidhalter/jedi/issues/131
- https://github.com/davidhalter/jedi/pull/149
"""
"""Parenthesis closed at next line."""
#? isinstance
isinstance(
)
#? isinstance
isinstance(
)
#? isinstance
isinstance(None,
)
#? isinstance
isinstance(... |
chainer/chainer | refs/heads/master | tests/chainer_tests/training_tests/test_trainer.py | 5 | import time
import traceback
import unittest
from chainer import testing
from chainer import training
class DummyExtension(training.extension.Extension):
def __init__(self, test_case):
self.is_called = False
self.is_finalized = False
self._test_case = test_case
def __call__(self, tr... |
philjjoon/Big-Data-Benchmark-for-Big-Bench | refs/heads/master | engines/flink/queries/q04/variants/q4_reducer2.py | 3 | #"INTEL CONFIDENTIAL"
#Copyright 2015 Intel Corporation All Rights Reserved.
#
#The source code contained or described herein and all documents related to the source code ("Material") are owned by Intel Corporation or its suppliers or licensors. Title to the Material remains with Intel Corporation or its suppliers an... |
klihub/intel-iot-refkit | refs/heads/master | meta-iotqa/lib/oeqa/runtime/connectivity/wifi/wifi_mnode.py | 6 | import time
import os
import string
from oeqa.runtime.wifi import wifi
try:
import ConfigParser
except:
import configparser as ConfigParser
from oeqa.oetest import oeRuntimeTest
from oeqa.utils.helper import shell_cmd_timeout
ssid_config = ConfigParser.ConfigParser()
config_path = os.path.join(os.path.dirname(__file... |
Maethorin/concept2 | refs/heads/master | migrations/versions/dda6cfde5752_.py | 1 | """empty message
Revision ID: dda6cfde5752
Revises: 7189463da035
Create Date: 2016-03-12 00:49:53.587621
"""
# revision identifiers, used by Alembic.
revision = 'dda6cfde5752'
down_revision = '7189463da035'
from alembic import op
import app
import sqlalchemy as sa
def upgrade():
### commands auto generated by... |
BonexGu/Blik2D-SDK | refs/heads/master | Blik2D/addon/tensorflow-1.2.1_for_blik/tensorflow/contrib/slim/python/slim/nets/inception_v1.py | 164 | # 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... |
Karajlug/karajlug | refs/heads/master | members/models.py | 1 | # -----------------------------------------------------------------------------
# Karajlug.org
# Copyright (C) 2010 Karajlug community
#
# 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 Found... |
nemesiscodex/JukyOS-sugar | refs/heads/juky | extensions/deviceicon/volume.py | 1 | # Copyright (C) 2008 One Laptop Per Child
#
# 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 version.
#
# This program is distribu... |
hronoses/vispy | refs/heads/master | vispy/visuals/tests/test_polygon.py | 1 | # -*- coding: utf-8 -*-
"""
Tests for PolygonVisual
All images are of size (100,100) to keep a small file size
"""
import numpy as np
from vispy.scene import visuals, transforms
from vispy.testing import (requires_application, requires_scipy, TestingCanvas,
run_tests_if_main)
from vispy.te... |
whip112/Whip112 | refs/heads/master | vendor/packages/translate/storage/xml_extract/generate.py | 1 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright 2002-2006 Zuza Software Foundation
#
# This file is part of translate.
#
# translate 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... |
maelnor/nova | refs/heads/master | nova/db/sqlalchemy/migrate_repo/versions/259_placeholder.py | 200 | # 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... |
Jericho25/three.js | refs/heads/master | utils/exporters/blender/addons/io_three/exporter/image.py | 203 | import os
from .. import constants, logger
from . import base_classes, io, api
class Image(base_classes.BaseNode):
"""Class the wraps an image node. This is the node that
represent that actual file on disk.
"""
def __init__(self, node, parent):
logger.debug("Image().__init__(%s)", node)
... |
BehavioralInsightsTeam/edx-platform | refs/heads/release-bit | lms/djangoapps/grades/migrations/0004_visibleblocks_course_id.py | 17 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
from opaque_keys.edx.django.models import CourseKeyField
from opaque_keys.edx.keys import CourseKey
class Migration(migrations.Migration):
dependencies = [
('grades', '0003_coursepersistentgradesflag... |
Arafatk/sympy | refs/heads/master | sympy/physics/quantum/matrixcache.py | 124 | """A cache for storing small matrices in multiple formats."""
from __future__ import print_function, division
from sympy import Matrix, I, Pow, Rational, exp, pi
from sympy.physics.quantum.matrixutils import (
to_sympy, to_numpy, to_scipy_sparse
)
class MatrixCache(object):
"""A cache for small matrices in... |
camagenta/youtube-dl | refs/heads/master | youtube_dl/extractor/twitter.py | 89 | from __future__ import unicode_literals
import re
from .common import InfoExtractor
from ..compat import compat_urllib_request
from ..utils import (
float_or_none,
unescapeHTML,
)
class TwitterCardIE(InfoExtractor):
_VALID_URL = r'https?://(?:www\.)?twitter\.com/i/cards/tfw/v1/(?P<id>\d+)'
_TEST = {... |
rajendrauppal/coding-interview | refs/heads/master | programming_languages/Python/decorator.py | 1 | #!/usr/bin/env python
from functools import wraps
def decorator(func):
"""Decorator which authenticates the incoming API call.
"""
@wraps(func)
# wraps, preserves metadata (__name__ and __doc__) of the wrapping function.
def wrapper(*args, **kwargs):
# we send all positional argu... |
kkrizanovic/NanoMark | refs/heads/master | wrappers/wrapper_miniasm.py | 2 | #! /usr/bin/python
import os
SCRIPT_PATH = os.path.dirname(os.path.realpath(__file__))
import sys
sys.path.append(SCRIPT_PATH + '/../src/')
import subprocess
import multiprocessing
from time import gmtime, strftime
from dataspec import *
ASSEMBLER_TYPE = 'nonhybrid'; # hybrid or nonhybrid
try:
import basicd... |
pwoodworth/intellij-community | refs/heads/master | python/testData/refactoring/introduceVariable/substringFromFormatSingleValue.py | 83 | print("<selection>Hello</selection> %s" % "World")
|
bvamanan/ns3 | refs/heads/master | src/topology-read/bindings/callbacks_list.py | 664 | callback_classes = [
['void', 'ns3::Ptr<ns3::NetDevice>', 'ns3::Ptr<ns3::Packet const>', 'unsigned short', 'ns3::Address const&', 'ns3::Address const&', 'ns3::NetDevice::PacketType', 'ns3::empty', 'ns3::empty', 'ns3::empty'],
]
|
ibinti/intellij-community | refs/heads/master | python/testData/inspections/PyPep8NamingInspection/importConstant.py | 74 | from x import TEST as <weak_warning descr="Constant variable imported as non constant">test</weak_warning>
|
eicher31/compassion-modules | refs/heads/dev | intervention_compassion/__manifest__.py | 3 | # -*- coding: utf-8 -*-
##############################################################################
#
# ______ Releasing children from poverty _
# / ____/___ ____ ___ ____ ____ ___________(_)___ ____
# / / / __ \/ __ `__ \/ __ \/ __ `/ ___/ ___/ / __ \/ __ \
# / /___/ /_/ / / / / / / /_/... |
bleepbloop/Pivy | refs/heads/master | examples/contrib/iv2pov.py | 1 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
###
# Copyright (c) 2005 Øystein Handegard <[email protected]>
#
# Permission to use, copy, modify, and distribute this software for any
# purpose with or without fee is hereby granted, provided that the above
# copyright notice and this permission notice appear in all copie... |
n-west/gnuradio-volk | refs/heads/master | gnuradio-runtime/python/gnuradio/gru/mathmisc.py | 78 | #
# Copyright 2005 Free Software Foundation, Inc.
#
# This file is part of GNU Radio
#
# GNU Radio is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3, or (at your option)
# any later version.
#
#... |
liang42hao/bokeh | refs/heads/master | bokeh/server/views/deps.py | 13 | #-----------------------------------------------------------------------------
# Copyright (c) 2012 - 2015, Continuum Analytics, Inc. All rights reserved.
#
# Powered by the Bokeh Development Team.
#
# The full license is in the file LICENSE.txt, distributed with this software.
#----------------------------------------... |
clobrano/personfinder | refs/heads/master | app/pytz/zoneinfo/Etc/GMT_plus_12.py | 9 | '''tzinfo timezone information for Etc/GMT_plus_12.'''
from pytz.tzinfo import StaticTzInfo
from pytz.tzinfo import memorized_timedelta as timedelta
class GMT_plus_12(StaticTzInfo):
'''Etc/GMT_plus_12 timezone definition. See datetime.tzinfo for details'''
zone = 'Etc/GMT_plus_12'
_utcoffset = timedelta(se... |
QingChenmsft/azure-cli | refs/heads/master | src/command_modules/azure-cli-extension/azure/cli/command_modules/extension/_help.py | 3 | # --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------... |
steritecit/pythonTag | refs/heads/master | pycomm/__init__.py | 8 | __author__ = 'agostino'
|
grow/grow | refs/heads/dependabot/npm_and_yarn/grow/ui/postcss-7.0.36 | grow/common/structures.py | 1 | """Custom structures for Grow."""
from bisect import bisect_left
from bisect import bisect_right
class AttributeDict(dict):
"""Allows using a dictionary to reference keys as attributes."""
def __getattr__(self, attr):
try:
return self.__getitem__(attr)
except KeyError:
... |
rjschof/gem5 | refs/heads/master | ext/ply/test/yacc_badtok.py | 174 | # -----------------------------------------------------------------------------
# yacc_badtok.py
#
# A grammar, but tokens is a bad datatype
# -----------------------------------------------------------------------------
import sys
if ".." not in sys.path: sys.path.insert(0,"..")
import ply.yacc as yacc
tokens = "Hel... |
bdeepak77/Network-project | refs/heads/master | Network project/Network/download.py | 2 |
#!/usr/bin/python
#status 5 "reset passwaord"
# 0 "registered" and 1 "send mail" 2 "mail send"
import mysql.connector
from mysql.connector import errorcode
import threading
import os
import subprocess
import time
config = {
'user': 'root',
'password': '',
'host': '127.0.0.1',
'database': 'network',
'raise_o... |
echanna/EdxNotAFork | refs/heads/master | common/test/acceptance/pages/lms/find_courses.py | 96 | """
Find courses page (main page of the LMS).
"""
from bok_choy.page_object import PageObject
from bok_choy.promise import BrokenPromise
from . import BASE_URL
class FindCoursesPage(PageObject):
"""
Find courses page (main page of the LMS).
"""
url = BASE_URL
def is_browser_on_page(self):
... |
Metaswitch/calico-neutron | refs/heads/calico-readme | neutron/api/v2/resource.py | 8 | # Copyright 2012 OpenStack Foundation.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless req... |
rlr/kitsune | refs/heads/master | kitsune/motidings/urls.py | 18 | from django.conf.urls import patterns, url
# Note: This overrides the tidings tidings.unsubscribe url pattern, so
# we need to keep the name exactly as it is.
urlpatterns = patterns(
'kitsune.motidings.views',
url(r'^unsubscribe/(?P<watch_id>\d+)$',
'unsubscribe',
name='tidings.unsubscribe')
)... |
edmundoa/CheckApp | refs/heads/develop | checkapp/profiles/helpers/data_checker.py | 1 | # coding=utf8
#
# Copyright (C) 2011 Edmundo Álvarez Jiménez
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This... |
mtagle/airflow | refs/heads/master | airflow/providers/google/cloud/operators/sql_to_gcs.py | 2 | #
# 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... |
clobrano/personfinder | refs/heads/master | app/pytz/zoneinfo/Europe/Andorra.py | 9 | '''tzinfo timezone information for Europe/Andorra.'''
from pytz.tzinfo import DstTzInfo
from pytz.tzinfo import memorized_datetime as d
from pytz.tzinfo import memorized_ttinfo as i
class Andorra(DstTzInfo):
'''Europe/Andorra timezone definition. See datetime.tzinfo for details'''
zone = 'Europe/Andorra'
... |
AlperSaltabas/OR_Tools_Google_API | refs/heads/master | examples/python/data/nonogram_regular/nonogram_soccer_player.py | 74 | # Copyright 2010 Hakan Kjellerstrand [email protected]
#
# 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... |
WillGuan105/django | refs/heads/master | tests/generic_relations/models.py | 188 | """
Generic relations
Generic relations let an object have a foreign key to any object through a
content-type/object-id field. A ``GenericForeignKey`` field can point to any
object, be it animal, vegetable, or mineral.
The canonical example is tags (although this example implementation is *far*
from complete).
"""
f... |
bleib1dj/boto | refs/heads/develop | boto/support/__init__.py | 145 | # Copyright (c) 2013 Amazon.com, Inc. or its affiliates. All Rights Reserved
#
# 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 ... |
reid-vollett/Software_Quality_Project | refs/heads/master | SpaceGame.py | 1 | # SpaceGame.py
# Software Quality Project - Refactoring / Unit Tests
# Game Author:
# Name: Isaiah Smith
# Github: https://github.com/Technostalgic/Asteroids-Too
import os
import sys
import time
import pygame
from Alien import alien
from Asteroid import asteroid
from Basher import basher
from Camera import camera
f... |
craynot/django | refs/heads/master | tests/test_client/auth_backends.py | 315 | from django.contrib.auth.backends import ModelBackend
class TestClientBackend(ModelBackend):
pass
|
jordiclariana/ansible | refs/heads/devel | lib/ansible/modules/cloud/ovirt/ovirt_users_facts.py | 15 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright (c) 2016 Red Hat, Inc.
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
#... |
nitely/django-djconfig | refs/heads/master | tests/urls.py | 1 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.conf.urls import url
from django.contrib import admin
urlpatterns = [
url(r'^admin/', admin.site.urls)
]
|
disqus/graphite-web | refs/heads/master | examples/example-client.py | 73 | #!/usr/bin/python
"""Copyright 2008 Orbitz WorldWide
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... |
abzaloid/maps | refs/heads/master | django-project/lib/python2.7/site-packages/pip/_vendor/distlib/version.py | 426 | # -*- coding: utf-8 -*-
#
# Copyright (C) 2012-2014 The Python Software Foundation.
# See LICENSE.txt and CONTRIBUTORS.txt.
#
"""
Implementation of a flexible versioning scheme providing support for PEP-386,
distribute-compatible and semantic versioning.
"""
import logging
import re
from .compat import string_types
... |
studybuffalo/studybuffalo | refs/heads/master | study_buffalo/drug_price_calculator/admin.py | 1 | from django.contrib import admin
from . import models
class ClientsInlineAdmin(admin.TabularInline):
model = models.Clients
class CoverageCriteriaInlineAdmin(admin.TabularInline):
model = models.CoverageCriteria
extra = 1
class SpecialInlineAdmin(admin.TabularInline):
model = models.Price.special_a... |
bonitadecker77/python-for-android | refs/heads/master | python3-alpha/extra_modules/gdata/Crypto/PublicKey/RSA.py | 45 | #
# RSA.py : RSA encryption/decryption
#
# Part of the Python Cryptography Toolkit
#
# Distribute and use freely; there are no restrictions on further
# dissemination and usage except those imposed by the laws of your
# country of residence. This software is provided "as is" without
# warranty of fitness for use or... |
XBMC-Addons/plugin.library.node.editor | refs/heads/master | resources/lib/pluginBrowser.py | 1 | # coding=utf-8
import sys
import xbmc, xbmcaddon, xbmcgui
import json
from resources.lib.common import *
def getPluginPath( ltype, location = None ):
listings = []
listingsLabels = []
if location is not None:
# If location given, add 'create' item
listings.append( "::CREATE::" )
l... |
dade22/HelloPython | refs/heads/master | samples/classes/ex_func_decorators.py | 1 | """ Decorators """
# In this example `beg` wraps `say`. If say_please is True then it
# will change the returned message.
from functools import wraps
def beg(target_function):
@wraps(target_function)
def wrapper(*args, **kwargs):
msg, say_please = target_function(*args, **kwargs)
if say_please... |
sbunatyan/tavrida | refs/heads/master | tavrida/service.py | 1 | #!/usr/bin/env python
# Copyright (c) 2015 Sergey Bunatyan <[email protected]>
#
# 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
#
# Un... |
USGSDenverPychron/pychron | refs/heads/develop | pychron/processing/dataset/tests/__init__.py | 186 | __author__ = 'ross'
|
MediaSapiens/autonormix | refs/heads/master | django/conf/urls/defaults.py | 320 | from django.core.urlresolvers import RegexURLPattern, RegexURLResolver
from django.core.exceptions import ImproperlyConfigured
__all__ = ['handler404', 'handler500', 'include', 'patterns', 'url']
handler404 = 'django.views.defaults.page_not_found'
handler500 = 'django.views.defaults.server_error'
def include(arg, na... |
fengbaicanhe/intellij-community | refs/heads/master | python/testData/inspections/PyMethodOverridingInspection/InstanceCheck.py | 74 | class MyType1(type):
def __instancecheck__(cls, instance):
return True
class MyType2(type):
def __instancecheck__<warning descr="Signature of method 'MyType2.__instancecheck__()' does not match signature of base method in class 'type'">(cls)</warning>:
return True
class MyType3(type):
de... |
ypid/series60-remote | refs/heads/master | setup.py | 1 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (c) 2009 - 2010 Lukas Hetzenecker <[email protected]>
import os
import sys
from distutils.core import setup
VERSION = '0.4.80'
applicationSis_Py14 = "series60-remote-py14.sis"
pythonSis_Py14 = "PythonForS60_1_4_5_3rdEd.sis"
applicationSis_Py20 = "series60-remote-p... |
johnlinp/telegram-good-timing-bot | refs/heads/master | goodtiming/core/request.py | 1 | class Request:
def __init__(self, kind, arguments):
self.kind = kind
self.arguments = arguments
|
Edraak/circleci-edx-platform | refs/heads/circleci-master | lms/djangoapps/certificates/migrations/0005_auto_20151208_0801.py | 83 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('certificates', '0004_certificategenerationhistory'),
]
operations = [
migrations.AlterField(
model_name='generat... |
ovgu-FINken/paparazzi_pre_merge | refs/heads/master | sw/ground_segment/python/joystick/arduino_dangerboard.py | 85 | #! /usr/bin/env python
import time
import serial # sudo apt-get install python-serial
#open() #open port
#close() #close port immediately
#setBaudrate(baudrate) #change baudrate on an open port
#inWaiting() #return the number of chars in the receive buffer
#read(size=1)... |
atplanet/ansible-modules-extras | refs/heads/devel | monitoring/datadog_monitor.py | 13 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2015, Sebastian Kornehl <[email protected]>
#
# 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 versi... |
mdworks2016/work_development | refs/heads/master | Python/20_Third_Certification/venv/lib/python3.7/site-packages/chardet/big5freq.py | 342 | ######################## 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... |
tinfoil/phantomjs | refs/heads/master | src/qt/qtwebkit/Tools/Scripts/webkitpy/common/config/committers.py | 121 | # Copyright (c) 2011, Apple Inc. All rights reserved.
# Copyright (c) 2009, 2011, 2012 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 ret... |
fldc/CouchPotatoServer | refs/heads/custom | couchpotato/core/media/_base/providers/torrent/torrentz.py | 11 | import re
import traceback
from couchpotato.core.helpers.encoding import tryUrlencode
from couchpotato.core.helpers.rss import RSS
from couchpotato.core.helpers.variable import tryInt, splitString
from couchpotato.core.logger import CPLog
from couchpotato.core.media._base.providers.torrent.base import TorrentMagnetPro... |
fahhem/mbed-os | refs/heads/master | tools/test/config_test/test04/test_data.py | 38 | # Similar to test1, but this time B2 attempt to define base1_1. Since base1_1
# is already defined in B1 and F derives from both B1 and B2, this results
# in an error. However, when building for B2 instead of F, defining base1_1
# should be OK.
expected_results = {
"f": {
"desc": "attempt to redefine param... |
Andypsamp/CODfinalJUNIT | refs/heads/master | test/test_importadded.py | 25 | # This file is part of beets.
# Copyright 2015, Stig Inge Lea Bjornsen.
#
# 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... |
dlt-rilmta/emLam | refs/heads/master | emLam/nn/lstm_model.py | 2 | """Generic LSTM language model."""
from emLam.nn.rnn import get_rnn
import tensorflow as tf
class LSTMModel(object):
"""Generic LSTM language model based on the PTB model in tf/models."""
def __init__(self, params, is_training, softmax, need_prediction=False):
self.is_training = is_training
se... |
uwdata/termite-visualizations | refs/heads/master | web2py/gluon/contrib/pymysql/util.py | 95 | import struct
def byte2int(b):
if isinstance(b, int):
return b
else:
return struct.unpack("!B", b)[0]
def int2byte(i):
return struct.pack("!B", i)
def join_bytes(bs):
if len(bs) == 0:
return ""
else:
rv = bs[0]
for b in bs[1:]:
rv += b
r... |
beeftornado/sentry | refs/heads/master | src/sentry/plugins/interfaces/__init__.py | 41 | from __future__ import absolute_import
from .releasehook import * # NOQA
|
benhoff/pypi-parser | refs/heads/master | src/pypi_parser.py | 1 | import re
import asyncio
import requests
from simpleyapsy import IPlugin
DEFAULT_PYPI = 'https://pypi.python.org/pypi'
PYPI_RE = re.compile('''^(?:(?P<pypi>https?://[^/]+/pypi)/)?
(?P<name>[-A-Za-z0-9_.]+)
(?:/(?P<version>[-A-Za-z0-9.]+))?$''', re.X)
# NOTE: not used
... |
windedge/odoo | refs/heads/8.0 | addons/lunch/wizard/lunch_order.py | 440 | # -*- encoding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2012 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the G... |
ciraxwe/cherrypy-app-engine | refs/heads/master | cherrypy/process/plugins.py | 49 | """Site services for use with a Web Site Process Bus."""
import os
import re
import signal as _signal
import sys
import time
import threading
from cherrypy._cpcompat import basestring, get_daemon, get_thread_ident
from cherrypy._cpcompat import ntob, set, Timer, SetDaemonProperty
# _module__file__base is used by Aut... |
LEPT-Development/android_kernel_lge_msm8916-old | refs/heads/master | tools/perf/scripts/python/sctop.py | 11180 | # system call top
# (c) 2010, Tom Zanussi <[email protected]>
# Licensed under the terms of the GNU GPL License version 2
#
# Periodically displays system-wide system call totals, broken down by
# syscall. If a [comm] arg is specified, only syscalls called by
# [comm] are displayed. If an [interval] arg is specified,... |
smasala/phantomjs | refs/heads/master | src/qt/qtwebkit/Tools/Scripts/webkitpy/thirdparty/mod_pywebsocket/extensions.py | 119 | # Copyright 2012, 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... |
shakamunyi/neutron | refs/heads/master | neutron/tests/unit/agent/linux/test_iptables_manager.py | 5 | # Copyright 2012 Locaweb.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appli... |
mahim97/zulip | refs/heads/master | zerver/lib/email_mirror.py | 2 | from typing import Any, Dict, List, Optional, Text
import logging
import re
from email.header import decode_header
import email.message as message
from django.conf import settings
from zerver.lib.actions import decode_email_address, get_email_gateway_message_string_from_address, \
internal_send_message, interna... |
reeselevine/iTerm2 | refs/heads/master | tools/ply/ply-3.4/test/lex_state3.py | 174 | # lex_state3.py
#
# Bad state declaration
import sys
if ".." not in sys.path: sys.path.insert(0,"..")
import ply.lex as lex
tokens = [
"PLUS",
"MINUS",
"NUMBER",
]
comment = 1
states = ((comment, 'inclusive'),
('example', 'exclusive'))
t_PLUS = r'\+'
t_MINUS = r'-'
t_NUMBER = r'\d+'
# C... |
otron/zenodo | refs/heads/master | zenodo/demosite/fixtures/accounts.py | 2 | # -*- coding: utf-8 -*-
#
## This file is part of Zenodo.
## Copyright (C) 2014 CERN.
##
## Zenodo 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 ... |
aasensio/elecciones2015 | refs/heads/master | dump.py | 2 | from bs4 import BeautifulSoup
import urllib2
import numpy as np
# wiki = "http://en.wikipedia.org/wiki/Opinion_polling_for_the_Spanish_general_election,_2015"
# header = {'User-Agent': 'Mozilla/5.0'} #Needed to prevent 403 error on Wikipedia
# req = urllib2.Request(wiki,headers=header)
# page = urllib2.urlopen(req)
# ... |
maggienj/ActiveData | refs/heads/es5 | mo_threads/multiprocess.py | 2 | # encoding: utf-8
#
# 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/.
#
# Author: Kyle Lahnakoski ([email protected])
#
from __future__ import absolute_import
from __fut... |
HerrSubset/FamilyTreeManager | refs/heads/master | ftm/__init__.py | 1 | import domain as dom
import ui
from sys import argv
pc = dom.ParametersContainer(argv)
fm = dom.FamilyManager(pc)
interface = ui.CLInterface(pc, fm)
|
vpstudios/Codecademy-Exercise-Answers | refs/heads/master | Language Skills/Python/Unit 3/2-PygLatin/PygLatin PART2/8-Word up.py | 2 | pyg = 'ay'
original = raw_input('Enter a word:')
if len(original) > 0 and original.isalpha():
word = original.lower()
first = word[0]
print original
else:
print 'empty'
|
SerCeMan/intellij-community | refs/heads/master | python/testData/quickFixes/PyRemoveStatementQuickFixTest/variable_after.py | 80 |
def foo(r):
"""
:param r:
:return:
"""
def a():
pass
x = 2 |
beni55/django | refs/heads/master | django/contrib/auth/checks.py | 374 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.apps import apps
from django.conf import settings
from django.core import checks
def check_user_model(**kwargs):
errors = []
cls = apps.get_model(settings.AUTH_USER_MODEL)
# Check that REQUIRED_FIELDS is a list
if not isins... |
ThePletch/ansible | refs/heads/devel | lib/ansible/modules/cloud/rackspace/rax_cbs.py | 25 | #!/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... |
paisely65/Assignments--IS-362 | refs/heads/master | IS362_1.py | 1 | ## Dealing with duplicate entries. Last value wins!
dict = {'Name': 'Alice', 'Age': 47, 'Name': 'Manni'}
print("dict['Name']: ", dict['Name'])
## Applying Function and Methods
breakfast = {'ham': 'roll', 'egg': 'scramble'}
lunch = {'burger': 'well', 'fries': 'yes', 'salad': 'yes'}
print("Length : %d" % len (lunch))... |
srikantbmandal/ansible | refs/heads/devel | lib/ansible/modules/cloud/atomic/atomic_host.py | 50 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# 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.
#... |
gangadhar-kadam/laganfrappe | refs/heads/master | frappe/core/report/subscription_details/subscription_details.py | 2 | from __future__ import unicode_literals
import frappe
def get_columns():
return ["Site Name:220", "Site Created on:Date:120",
"Customer Name:120","Country:80","Administrator Email Id:250","Subscription Plan:200"]
def execute(filters=None):
columns = get_columns()
qry="select name ,DATE(creation) ,client_name,count... |
chengjf/database-interface-doc-management | refs/heads/master | flask-demo/flask/Lib/site-packages/pip/_vendor/requests/packages/chardet/compat.py | 2942 | ######################## BEGIN LICENSE BLOCK ########################
# Contributor(s):
# Ian Cordasco - port to Python
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# versio... |
phektus/Django-Google-AppEngine-OpenId-Auth | refs/heads/master | django/shortcuts/__init__.py | 254 | """
This module collects helper functions and classes that "span" multiple levels
of MVC. In other words, these functions/classes introduce controlled coupling
for convenience's sake.
"""
from django.template import loader, RequestContext
from django.http import HttpResponse, Http404
from django.http import HttpRespon... |
jvkops/django | refs/heads/master | django/utils/translation/__init__.py | 108 | """
Internationalization support.
"""
from __future__ import unicode_literals
import re
from django.utils import six
from django.utils.decorators import ContextDecorator
from django.utils.encoding import force_text
from django.utils.functional import lazy
__all__ = [
'activate', 'deactivate', 'override', 'deacti... |
bprodoehl/phantomjs | refs/heads/master | src/qt/qtwebkit/Tools/Scripts/webkitpy/style/optparser_unittest.py | 124 | # Copyright (C) 2010 Chris Jerdonek ([email protected])
#
# 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 code must retain the above copyright
# notice, this list of conditions and... |
nathanial/lettuce | refs/heads/master | tests/integration/lib/Django-1.3/django/contrib/localflavor/es/forms.py | 309 | # -*- coding: utf-8 -*-
"""
Spanish-specific Form helpers
"""
from django.core.validators import EMPTY_VALUES
from django.forms import ValidationError
from django.forms.fields import RegexField, Select
from django.utils.translation import ugettext_lazy as _
import re
class ESPostalCodeField(RegexField):
"""
A... |
mrlinux777/vkbottsone | refs/heads/master | plugins/site_screenshot.py | 1 | import aiohttp
from plugin_system import Plugin
plugin = Plugin("Скриншот сайта",
usage=["скрин [адрес сайта] - сделать скриншот сайта [адрес сайта]"])
# Желательно первой командой указывать основную (она будет в списке команд)
@plugin.on_command('скрин')
async def screen(msg, args):
if not args... |
YueHao/PyEPIC | refs/heads/master | epicIO.py | 1 | import argparse
import ply.lex as lex
import ply.yacc as yacc
import copy
import re
import numpy
class EpicLexer(object):
literals = "=,+-*/:&()"
reserved = {'beam1':'KWB1','beam2':'KWB2','end':'KWEND', 'global':'KWGLOBAL'}
tokens = ['NUMBER' , 'STRING', 'RET']+list(reserved.values())
def t_NU... |
michaelgallacher/intellij-community | refs/heads/master | python/testData/refactoring/changeSignature/fixGoogleDocStringRemoveMultiple.before.py | 45 | def f(a, b, c, d):
"""
Parameters:
a : foo
b : bar
c : baz
d : quux
""" |
isandlaTech/cohorte-demos | refs/heads/dev | led/dump/led-demo-raspberry/cohorte/dist/cohorte-1.0.0-1.0.0-20141201.234602-19-python-distribution/repo/requests/packages/urllib3/util/retry.py | 155 | import time
import logging
from ..exceptions import (
ConnectTimeoutError,
MaxRetryError,
ProtocolError,
ReadTimeoutError,
ResponseError,
)
from ..packages import six
log = logging.getLogger(__name__)
class Retry(object):
""" Retry configuration.
Each retry attempt will create a new Re... |
Surbias/surbias.github.io | refs/heads/master | node_modules/grunt-docker/node_modules/docker/node_modules/pygmentize-bundled/vendor/pygments/pygments/lexers/_stan_builtins.py | 292 | # -*- coding: utf-8 -*-
"""
pygments.lexers._stan_builtins
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
This file contains the names of functions for Stan used by
``pygments.lexers.math.StanLexer.
:copyright: Copyright 2013 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
KEYWORDS = ['else', 'for', '... |
gurch101/rosalind | refs/heads/master | iev.py | 1 | AAAA, AAAa, AAaa, AaAa, Aaaa, aaaa = map(int, raw_input().split())
print (
2 * AAAA +
2 * AAAa +
2 * AAaa +
2 * 0.75 * AaAa +
Aaaa
)
|
neilisaac/luigi | refs/heads/master | examples/elasticsearch_index.py | 14 | # -*- coding: utf-8 -*-
#
# Copyright 2012-2015 Spotify AB
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law... |
deshipu/micropython | refs/heads/master | tests/import/import_pkg8.py | 46 | # import with no __init__.py files
import pkg8.mod
|
SG345/autopep8 | refs/heads/master | test/suite/W19.py | 12 | #: W191
if False:
print # indented with 1 tab
#:
#: W191
y = x == 2 \
or x == 3
#: E101 W191
if (
x == (
3
) or
y == 4):
pass
#: E101 W191
if x == 2 \
or y > 1 \
or x == 3:
pass
#: E101 W191
if x == 2 \
or y > 1 \
or x == 3:
pass
#:
#: E101 W191
i... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.